annotate src/w32fns.c @ 111417:6316c70b291e

Support R2L lines in tool-tip text. xfns.c (Fx_show_tip): If any of the tool-tip text lines is R2L, adjust width of tool-tip frame to the width of text, excluding the stretch glyph at the beginning of R2L glyph rows. w32fns.c (Fx_show_tip): Likewise.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 06 Nov 2010 15:45:37 +0200
parents b9e560ce3ab6
children ad93f2dd2d38
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16884
36babc489b0c Change all uses of win95, winnt, and win32
Geoff Voelker <voelker@cs.washington.edu>
parents: 16602
diff changeset
1 /* Graphical user interface functions for the Microsoft W32 API.
111170
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
2
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
3 Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
4 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5 Free Software Foundation, Inc.
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
6
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7 This file is part of GNU Emacs.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
8
94963
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94917
diff changeset
9 GNU Emacs is free software: you can redistribute it and/or modify
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
10 it under the terms of the GNU General Public License as published by
94963
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94917
diff changeset
11 the Free Software Foundation, either version 3 of the License, or
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94917
diff changeset
12 (at your option) any later version.
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
13
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
14 GNU Emacs is distributed in the hope that it will be useful,
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
17 GNU General Public License for more details.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
18
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
19 You should have received a copy of the GNU General Public License
94963
8971ddf55736 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94917
diff changeset
20 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
21
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
22 /* Added by Kevin Gallo */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
23
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
24 #include <config.h>
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
25
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
26 #include <signal.h>
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
27 #include <stdio.h>
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
28 #include <limits.h>
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
29 #include <errno.h>
79213
c2dfa5567b1b Include math.h.
Jason Rumney <jasonr@gnu.org>
parents: 79054
diff changeset
30 #include <math.h>
105669
68dd71358159 * alloc.c: Do not define struct catchtag.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105374
diff changeset
31 #include <setjmp.h>
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
32
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
33 #include "lisp.h"
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
34 #include "w32term.h"
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
35 #include "frame.h"
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
36 #include "window.h"
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
37 #include "buffer.h"
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
38 #include "intervals.h"
89585
f89c9d4bd81c (Fx_create_frame, x_create_tip_frame): Use new version of x_new_fontset.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
39 #include "dispextern.h"
f89c9d4bd81c (Fx_create_frame, x_create_tip_frame): Use new version of x_new_fontset.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
40 #include "keyboard.h"
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
41 #include "blockinput.h"
24412
d11ac02f9d6a Use epaths.h istead of paths.h.
Richard M. Stallman <rms@gnu.org>
parents: 24339
diff changeset
42 #include "epaths.h"
89585
f89c9d4bd81c (Fx_create_frame, x_create_tip_frame): Use new version of x_new_fontset.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
43 #include "character.h"
f89c9d4bd81c (Fx_create_frame, x_create_tip_frame): Use new version of x_new_fontset.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
44 #include "charset.h"
23506
246a14f0622f (Vx_pixel_size_width): New global variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23407
diff changeset
45 #include "coding.h"
25069
ee9bfbc340ba (w32_find_ccl_program): Get compiled CCL code by just
Kenichi Handa <handa@m17n.org>
parents: 24856
diff changeset
46 #include "ccl.h"
89585
f89c9d4bd81c (Fx_create_frame, x_create_tip_frame): Use new version of x_new_fontset.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
47 #include "fontset.h"
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
48 #include "systime.h"
89585
f89c9d4bd81c (Fx_create_frame, x_create_tip_frame): Use new version of x_new_fontset.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
49 #include "termhooks.h"
f89c9d4bd81c (Fx_create_frame, x_create_tip_frame): Use new version of x_new_fontset.
Jason Rumney <jasonr@gnu.org>
parents: 88123
diff changeset
50 #include "w32heap.h"
108303
36d25edeedb5 Fix bug #6126.
Eli Zaretskii <eliz@gnu.org>
parents: 107753
diff changeset
51 #include "w32.h"
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
52
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
53 #include "bitmaps/gray.xbm"
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
54
78907
90bd4f87874a (globals_of_w32fns): Init common controls.
Jason Rumney <jasonr@gnu.org>
parents: 78260
diff changeset
55 #include <commctrl.h>
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
56 #include <commdlg.h>
21884
bc4455bca454 Include shellapi.h.
Richard M. Stallman <rms@gnu.org>
parents: 21874
diff changeset
57 #include <shellapi.h>
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
58 #include <ctype.h>
53739
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
59 #include <winspool.h>
78106
f9eb7f243bdc (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
Jason Rumney <jasonr@gnu.org>
parents: 77995
diff changeset
60 #include <objbase.h>
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
61
45963
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
62 #include <dlgs.h>
91099
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
63 #include <imm.h>
45963
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
64 #define FILE_NAME_TEXT_FIELD edt1
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
65
90865
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
66 #include "font.h"
94917
e61553aa7a73 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 94618
diff changeset
67 #include "w32font.h"
90865
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
68
96489
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
69 #ifndef FOF_NO_CONNECTED_ELEMENTS
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
70 #define FOF_NO_CONNECTED_ELEMENTS 0x2000
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
71 #endif
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
72
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
73 void syms_of_w32fns (void);
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
74 void globals_of_w32fns (void);
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
75
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
76 extern void free_frame_menubar (struct frame *);
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
77 extern double atof (const char *);
109100
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
78 extern int w32_console_toggle_lock_key (int, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
79 extern void w32_menu_display_help (HWND, HMENU, UINT, UINT);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
80 extern void w32_free_menu_strings (HWND);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
81 extern const char *map_w32_filename (const char *, const char **);
41732
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
82
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
83 extern int quit_char;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
84
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
85 extern char *lispy_function_keys[];
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
86
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
87 /* The colormap for converting color names to RGB values */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
88 Lisp_Object Vw32_color_map;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
89
14810
4dd6867765b9 (Vwin32_pass_alt_to_system,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14461
diff changeset
90 /* Non nil if alt key presses are passed on to Windows. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
91 Lisp_Object Vw32_pass_alt_to_system;
14810
4dd6867765b9 (Vwin32_pass_alt_to_system,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14461
diff changeset
92
15459
76ff60cd2b8d (Vwin32_alt_is_meta): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 15434
diff changeset
93 /* Non nil if alt key is translated to meta_modifier, nil if it is translated
76ff60cd2b8d (Vwin32_alt_is_meta): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 15434
diff changeset
94 to alt_modifier. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
95 Lisp_Object Vw32_alt_is_meta;
15459
76ff60cd2b8d (Vwin32_alt_is_meta): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 15434
diff changeset
96
24339
e8b73c2ac4ec (Vw32_quit_key): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24252
diff changeset
97 /* If non-zero, the windows virtual key code for an alternative quit key. */
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
98 int w32_quit_key;
24339
e8b73c2ac4ec (Vw32_quit_key): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24252
diff changeset
99
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
100 /* Non nil if left window key events are passed on to Windows (this only
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
101 affects whether "tapping" the key opens the Start menu). */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
102 Lisp_Object Vw32_pass_lwindow_to_system;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
103
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
104 /* Non nil if right window key events are passed on to Windows (this
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
105 only affects whether "tapping" the key opens the Start menu). */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
106 Lisp_Object Vw32_pass_rwindow_to_system;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
107
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
108 /* Virtual key code used to generate "phantom" key presses in order
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
109 to stop system from acting on Windows key events. */
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
110 Lisp_Object Vw32_phantom_key_code;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
111
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
112 /* Modifier associated with the left "Windows" key, or nil to act as a
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
113 normal key. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
114 Lisp_Object Vw32_lwindow_modifier;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
115
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
116 /* Modifier associated with the right "Windows" key, or nil to act as a
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
117 normal key. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
118 Lisp_Object Vw32_rwindow_modifier;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
119
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
120 /* Modifier associated with the "Apps" key, or nil to act as a normal
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
121 key. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
122 Lisp_Object Vw32_apps_modifier;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
123
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
124 /* Value is nil if Num Lock acts as a function key. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
125 Lisp_Object Vw32_enable_num_lock;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
126
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
127 /* Value is nil if Caps Lock acts as a function key. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
128 Lisp_Object Vw32_enable_caps_lock;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
129
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
130 /* Modifier associated with Scroll Lock, or nil to act as a normal key. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
131 Lisp_Object Vw32_scroll_lock_modifier;
14810
4dd6867765b9 (Vwin32_pass_alt_to_system,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14461
diff changeset
132
27894
6c4ff3519d09 (w32_wnd_proc) [WM_LBUTTON_DOWN, WM_RBUTTON_DOWN, WM_LBUTTON_UP,
Jason Rumney <jasonr@gnu.org>
parents: 27516
diff changeset
133 /* Switch to control whether we inhibit requests for synthesized bold
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
134 and italic versions of fonts. */
42845
ebb3a20bc357 (w32_load_system_font, w32_to_x_charset): Use strnicmp
Jason Rumney <jasonr@gnu.org>
parents: 42833
diff changeset
135 int w32_enable_synthesized_fonts;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
136
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
137 /* Enable palette management. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
138 Lisp_Object Vw32_enable_palette;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
139
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
140 /* Control how close left/right button down events must be to
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
141 be converted to a middle button down event. */
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
142 int w32_mouse_button_tolerance;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
143
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
144 /* Minimum interval between mouse movement (and scroll bar drag)
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
145 events that are passed on to the event loop. */
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
146 int w32_mouse_move_interval;
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
147
42719
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
148 /* Flag to indicate if XBUTTON events should be passed on to Windows. */
86065
2557aa084b57 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 86053
diff changeset
149 static int w32_pass_extra_mouse_buttons_to_system;
42719
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
150
85979
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
151 /* Flag to indicate if media keys should be passed on to Windows. */
86065
2557aa084b57 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 86053
diff changeset
152 static int w32_pass_multimedia_buttons_to_system;
42719
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
153
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
154 /* Non nil if no window manager is in use. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
155 Lisp_Object Vx_no_window_manager;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
156
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
157 /* If non-zero, a w32 timer that, when it expires, displays an
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
158 hourglass cursor on all frames. */
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
159 static unsigned hourglass_timer = 0;
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
160 static HWND hourglass_hwnd = NULL;
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
161
100982
7c89b12c3a26 (Vx_pointer_shape, Vx_nontext_pointer_shape)
Jason Rumney <jasonr@gnu.org>
parents: 100951
diff changeset
162 #if 0 /* TODO: Mouse cursor customization. */
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
163 /* The background and shape of the mouse pointer, and shape when not
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
164 over text or in the modeline. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
165 Lisp_Object Vx_pointer_shape, Vx_nontext_pointer_shape, Vx_mode_pointer_shape;
64487
c9a7bffa9534 (Vx_hand_shape): Variable removed.
Kim F. Storm <storm@cua.dk>
parents: 64084
diff changeset
166 Lisp_Object Vx_hourglass_pointer_shape, Vx_window_horizontal_drag_shape;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
167
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
168 /* The shape when over mouse-sensitive text. */
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
169
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
170 Lisp_Object Vx_sensitive_text_pointer_shape;
100982
7c89b12c3a26 (Vx_pointer_shape, Vx_nontext_pointer_shape)
Jason Rumney <jasonr@gnu.org>
parents: 100951
diff changeset
171 #endif
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
172
49369
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
173 #ifndef IDC_HAND
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
174 #define IDC_HAND MAKEINTRESOURCE(32649)
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
175 #endif
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
176
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
177 /* Color of chars displayed in cursor box. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
178 Lisp_Object Vx_cursor_fore_pixel;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
179
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
180 /* Nonzero if using Windows. */
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
181
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
182 static int w32_in_use;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
183
23506
246a14f0622f (Vx_pixel_size_width): New global variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23407
diff changeset
184 /* Regexp matching a font name whose width is the same as `PIXEL_SIZE'. */
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
185
23506
246a14f0622f (Vx_pixel_size_width): New global variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23407
diff changeset
186 Lisp_Object Vx_pixel_size_width_font_regexp;
246a14f0622f (Vx_pixel_size_width): New global variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23407
diff changeset
187
24147
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
188 /* Alist of bdf fonts and the files that define them. */
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
189 Lisp_Object Vw32_bdf_filename_alist;
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
190
24497
b09ceba3d319 (enum_font_cb2): Set the font height to be the
Geoff Voelker <voelker@cs.washington.edu>
parents: 24481
diff changeset
191 /* A flag to control whether fonts are matched strictly or not. */
86065
2557aa084b57 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 86053
diff changeset
192 static int w32_strict_fontnames;
24481
f65692fe7dd5 (w32_strict_fontnames): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24479
diff changeset
193
24695
2fe2c743ce68 (w32_strict_painting): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24692
diff changeset
194 /* A flag to control whether we should only repaint if GetUpdateRect
2fe2c743ce68 (w32_strict_painting): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24692
diff changeset
195 indicates there is an update region. */
86065
2557aa084b57 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 86053
diff changeset
196 static int w32_strict_painting;
24695
2fe2c743ce68 (w32_strict_painting): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24692
diff changeset
197
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
198 Lisp_Object Qnone;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
199 Lisp_Object Qsuppress_icon;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
200 Lisp_Object Qundefined_color;
36000
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
201 Lisp_Object Qcancel_timer;
96079
efbaf6995245 * w32fns.c, xfns.c (Qfont_param): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95894
diff changeset
202 Lisp_Object Qfont_param;
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
203 Lisp_Object Qhyper;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
204 Lisp_Object Qsuper;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
205 Lisp_Object Qmeta;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
206 Lisp_Object Qalt;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
207 Lisp_Object Qctrl;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
208 Lisp_Object Qcontrol;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
209 Lisp_Object Qshift;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
210
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
211
55468
f13a7f45ce0f (Vw32_ansi_code_page): New Lisp variable.
Jason Rumney <jasonr@gnu.org>
parents: 54336
diff changeset
212 /* The ANSI codepage. */
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
213 int w32_ansi_code_page;
55468
f13a7f45ce0f (Vw32_ansi_code_page): New Lisp variable.
Jason Rumney <jasonr@gnu.org>
parents: 54336
diff changeset
214
51474
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
215 /* Prefix for system colors. */
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
216 #define SYSTEM_COLOR_PREFIX "System"
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
217 #define SYSTEM_COLOR_PREFIX_LEN (sizeof (SYSTEM_COLOR_PREFIX) - 1)
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
218
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
219 /* State variables for emulating a three button mouse. */
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
220 #define LMOUSE 1
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
221 #define MMOUSE 2
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
222 #define RMOUSE 4
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
223
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
224 static int button_state = 0;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
225 static W32Msg saved_mouse_button_msg;
43472
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
226 static unsigned mouse_button_timer = 0; /* non-zero when timer is active */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
227 static W32Msg saved_mouse_move_msg;
43472
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
228 static unsigned mouse_move_timer = 0;
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
229
41732
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
230 /* Window that is tracking the mouse. */
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
231 static HWND track_mouse_window;
48375
4d7b83cc03aa Added a partial implementation of play-sound-internal for Windows. Fixed the following entry in etc/PROBLEMS: Emacs built on Windows 9x/ME crashes at startup on Windows XP, or Emacs built on XP crashes at startup on Windows 9x/ME.
Ben Key <bkey1@tampabay.rr.com>
parents: 48359
diff changeset
232
92935
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
233 /* Multi-monitor API definitions that are not pulled from the headers
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
234 since we are compiling for NT 4. */
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
235 #ifndef MONITOR_DEFAULT_TO_NEAREST
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
236 #define MONITOR_DEFAULT_TO_NEAREST 2
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
237 #endif
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
238 /* MinGW headers define MONITORINFO unconditionally, but MSVC ones don't.
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
239 To avoid a compile error on one or the other, redefine with a new name. */
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
240 struct MONITOR_INFO
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
241 {
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
242 DWORD cbSize;
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
243 RECT rcMonitor;
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
244 RECT rcWork;
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
245 DWORD dwFlags;
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
246 };
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
247
97493
dde0533b6aec [_MSC_VER && _MSC_VER < 1300]: Declare HMONITOR.
Eli Zaretskii <eliz@gnu.org>
parents: 97194
diff changeset
248 /* Reportedly, VS 6 does not have this in its headers. */
110994
734b2470f93c src/w32*.c: Whitespace fixes and typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 109701
diff changeset
249 #if defined (_MSC_VER) && _MSC_VER < 1300
97493
dde0533b6aec [_MSC_VER && _MSC_VER < 1300]: Declare HMONITOR.
Eli Zaretskii <eliz@gnu.org>
parents: 97194
diff changeset
250 DECLARE_HANDLE(HMONITOR);
dde0533b6aec [_MSC_VER && _MSC_VER < 1300]: Declare HMONITOR.
Eli Zaretskii <eliz@gnu.org>
parents: 97194
diff changeset
251 #endif
dde0533b6aec [_MSC_VER && _MSC_VER < 1300]: Declare HMONITOR.
Eli Zaretskii <eliz@gnu.org>
parents: 97194
diff changeset
252
51776
6a03280c654a (clipboard_sequence_fn): New variable.
Jason Rumney <jasonr@gnu.org>
parents: 51763
diff changeset
253 typedef BOOL (WINAPI * TrackMouseEvent_Proc)
6a03280c654a (clipboard_sequence_fn): New variable.
Jason Rumney <jasonr@gnu.org>
parents: 51763
diff changeset
254 (IN OUT LPTRACKMOUSEEVENT lpEventTrack);
91099
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
255 typedef LONG (WINAPI * ImmGetCompositionString_Proc)
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
256 (IN HIMC context, IN DWORD index, OUT LPVOID buffer, IN DWORD bufLen);
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
257 typedef HIMC (WINAPI * ImmGetContext_Proc) (IN HWND window);
104030
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
258 typedef HWND (WINAPI * ImmReleaseContext_Proc) (IN HWND wnd, IN HIMC context);
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
259 typedef HWND (WINAPI * ImmSetCompositionWindow_Proc) (IN HIMC context,
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
260 IN COMPOSITIONFORM *form);
92935
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
261 typedef HMONITOR (WINAPI * MonitorFromPoint_Proc) (IN POINT pt, IN DWORD flags);
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
262 typedef BOOL (WINAPI * GetMonitorInfo_Proc)
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
263 (IN HMONITOR monitor, OUT struct MONITOR_INFO* info);
51776
6a03280c654a (clipboard_sequence_fn): New variable.
Jason Rumney <jasonr@gnu.org>
parents: 51763
diff changeset
264
6a03280c654a (clipboard_sequence_fn): New variable.
Jason Rumney <jasonr@gnu.org>
parents: 51763
diff changeset
265 TrackMouseEvent_Proc track_mouse_event_fn = NULL;
91099
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
266 ImmGetCompositionString_Proc get_composition_string_fn = NULL;
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
267 ImmGetContext_Proc get_ime_context_fn = NULL;
104030
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
268 ImmReleaseContext_Proc release_ime_context_fn = NULL;
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
269 ImmSetCompositionWindow_Proc set_ime_composition_window_fn = NULL;
92935
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
270 MonitorFromPoint_Proc monitor_from_point_fn = NULL;
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
271 GetMonitorInfo_Proc get_monitor_info_fn = NULL;
91099
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
272
56971
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
273 extern AppendMenuW_Proc unicode_append_menu;
41732
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
274
91099
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
275 /* Flag to selectively ignore WM_IME_CHAR messages. */
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
276 static int ignore_ime_char = 0;
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
277
21874
c0871d40073e (msh_mousewheel): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21735
diff changeset
278 /* W95 mousewheel handler */
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
279 unsigned int msh_mousewheel = 0;
21874
c0871d40073e (msh_mousewheel): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21735
diff changeset
280
43472
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
281 /* Timers */
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
282 #define MOUSE_BUTTON_ID 1
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
283 #define MOUSE_MOVE_ID 2
43472
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
284 #define MENU_FREE_ID 3
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
285 #define HOURGLASS_ID 4
43472
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
286 /* The delay (milliseconds) before a menu is freed after WM_EXITMENULOOP
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
287 is received. */
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
288 #define MENU_FREE_DELAY 1000
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
289 static unsigned menu_free_timer = 0;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
290
109295
fffdf1688ad0 src/w32fns.c (Qtooltip): Declare.
Juanma Barranquero <lekktu@gmail.com>
parents: 109290
diff changeset
291 /* In dispnew.c */
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
292
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
293 extern Lisp_Object Vwindow_system_version;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
294
109295
fffdf1688ad0 src/w32fns.c (Qtooltip): Declare.
Juanma Barranquero <lekktu@gmail.com>
parents: 109290
diff changeset
295 /* The below are defined in frame.c. */
fffdf1688ad0 src/w32fns.c (Qtooltip): Declare.
Juanma Barranquero <lekktu@gmail.com>
parents: 109290
diff changeset
296
109058
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 108303
diff changeset
297 extern Lisp_Object Vmenu_bar_mode, Vtool_bar_mode;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
298 extern Lisp_Object Vwindow_system_version;
109295
fffdf1688ad0 src/w32fns.c (Qtooltip): Declare.
Juanma Barranquero <lekktu@gmail.com>
parents: 109290
diff changeset
299 extern Lisp_Object Qtooltip;
fffdf1688ad0 src/w32fns.c (Qtooltip): Declare.
Juanma Barranquero <lekktu@gmail.com>
parents: 109290
diff changeset
300
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
301 #ifdef GLYPH_DEBUG
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
302 int image_cache_refcount, dpyinfo_refcount;
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
303 #endif
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
304
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
305
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
306 /* From w32term.c. */
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
307 extern int w32_num_mouse_buttons;
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
308 extern Lisp_Object Vw32_recognize_altgr;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
309
40385
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
310 extern HWND w32_system_caret_hwnd;
42865
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
311
40385
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
312 extern int w32_system_caret_height;
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
313 extern int w32_system_caret_x;
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
314 extern int w32_system_caret_y;
42865
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
315 extern int w32_use_visible_system_caret;
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
316
42918
9b06036a8c5e (syms_of_w32fns): Initialize w32_visible_system_caret_hwnd.
Jason Rumney <jasonr@gnu.org>
parents: 42865
diff changeset
317 static HWND w32_visible_system_caret_hwnd;
40385
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
318
76075
25965473846d (current_popup_menu): Use from w32menu.c.
Jason Rumney <jasonr@gnu.org>
parents: 75348
diff changeset
319 /* From w32menu.c */
25965473846d (current_popup_menu): Use from w32menu.c.
Jason Rumney <jasonr@gnu.org>
parents: 75348
diff changeset
320 extern HMENU current_popup_menu;
76083
5e1d8f9b52ea * w32fns.c (menubar_in_use): New flag.
Jason Rumney <jasonr@gnu.org>
parents: 76078
diff changeset
321 static int menubar_in_use = 0;
76075
25965473846d (current_popup_menu): Use from w32menu.c.
Jason Rumney <jasonr@gnu.org>
parents: 75348
diff changeset
322
93599
a67af10a545c (uniscribe_font_driver) [WINDOWSNT]: Declare for w32fns.c.
Jason Rumney <jasonr@gnu.org>
parents: 93319
diff changeset
323 /* From w32uniscribe.c */
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
324 extern void syms_of_w32uniscribe (void);
93599
a67af10a545c (uniscribe_font_driver) [WINDOWSNT]: Declare for w32fns.c.
Jason Rumney <jasonr@gnu.org>
parents: 93319
diff changeset
325 extern int uniscribe_available;
a67af10a545c (uniscribe_font_driver) [WINDOWSNT]: Declare for w32fns.c.
Jason Rumney <jasonr@gnu.org>
parents: 93319
diff changeset
326
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
327 /* Function prototypes for hourglass support. */
109100
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
328 static void w32_show_hourglass (struct frame *);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
329 static void w32_hide_hourglass (void);
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
330
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
331
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
332
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
333 /* Error if we are not connected to MS-Windows. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
334 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
335 check_w32 (void)
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
336 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
337 if (! w32_in_use)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
338 error ("MS-Windows not in use or not initialized");
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
339 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
340
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
341 /* Nonzero if we can use mouse menus.
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
342 You should not call this unless HAVE_MENUS is defined. */
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
343
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
344 int
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
345 have_menus_p (void)
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
346 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
347 return w32_in_use;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
348 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
349
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
350 /* Extract a frame as a FRAME_PTR, defaulting to the selected frame
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
351 and checking validity for W32. */
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
352
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
353 FRAME_PTR
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
354 check_x_frame (Lisp_Object frame)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
355 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
356 FRAME_PTR f;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
357
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
358 if (NILP (frame))
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
359 frame = selected_frame;
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
360 CHECK_LIVE_FRAME (frame);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
361 f = XFRAME (frame);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
362 if (! FRAME_W32_P (f))
63704
426ba3ecedd7 (check_x_frame, check_x_display_info): Follow error conventions.
Juanma Barranquero <lekktu@gmail.com>
parents: 63348
diff changeset
363 error ("Non-W32 frame used");
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
364 return f;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
365 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
366
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
367 /* Let the user specify a display with a frame.
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
368 nil stands for the selected frame--or, if that is not a w32 frame,
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
369 the first display on the list. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
370
50362
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
371 struct w32_display_info *
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
372 check_x_display_info (Lisp_Object frame)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
373 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
374 if (NILP (frame))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
375 {
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
376 struct frame *sf = XFRAME (selected_frame);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
377
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
378 if (FRAME_W32_P (sf) && FRAME_LIVE_P (sf))
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
379 return FRAME_W32_DISPLAY_INFO (sf);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
380 else
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
381 return &one_w32_display_info;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
382 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
383 else if (STRINGP (frame))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
384 return x_display_info_for_name (frame);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
385 else
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
386 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
387 FRAME_PTR f;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
388
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
389 CHECK_LIVE_FRAME (frame);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
390 f = XFRAME (frame);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
391 if (! FRAME_W32_P (f))
63704
426ba3ecedd7 (check_x_frame, check_x_display_info): Follow error conventions.
Juanma Barranquero <lekktu@gmail.com>
parents: 63348
diff changeset
392 error ("Non-W32 frame used");
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
393 return FRAME_W32_DISPLAY_INFO (f);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
394 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
395 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
396
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
397 /* Return the Emacs frame-object corresponding to an w32 window.
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
398 It could be the frame's main window or an icon window. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
399
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
400 /* This function can be called during GC, so use GC_xxx type test macros. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
401
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
402 struct frame *
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
403 x_window_to_frame (struct w32_display_info *dpyinfo, HWND wdesc)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
404 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
405 Lisp_Object tail, frame;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
406 struct frame *f;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
407
90970
3371fc48749b Replace uses of GC_* macros with the non-GC_ versions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 90919
diff changeset
408 for (tail = Vframe_list; CONSP (tail); tail = XCDR (tail))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
409 {
25646
9154af188477 Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents: 25289
diff changeset
410 frame = XCAR (tail);
90970
3371fc48749b Replace uses of GC_* macros with the non-GC_ versions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 90919
diff changeset
411 if (!FRAMEP (frame))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
412 continue;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
413 f = XFRAME (frame);
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 25646
diff changeset
414 if (!FRAME_W32_P (f) || FRAME_W32_DISPLAY_INFO (f) != dpyinfo)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
415 continue;
27936
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
416
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
417 if (FRAME_W32_WINDOW (f) == wdesc)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
418 return f;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
419 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
420 return 0;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
421 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
422
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
423
109100
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
424 static Lisp_Object unwind_create_frame (Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
425 static Lisp_Object unwind_create_tip_frame (Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
426 static void my_create_window (struct frame *);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
427 static void my_create_tip_window (struct frame *);
50362
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
428
33387
01a10bc04233 (Qw32_charset_hangeul): Rename to match w32 headers.
Jason Rumney <jasonr@gnu.org>
parents: 33216
diff changeset
429 /* TODO: Native Input Method support; see x_create_im. */
109100
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
430 void x_set_foreground_color (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
431 void x_set_background_color (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
432 void x_set_mouse_color (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
433 void x_set_cursor_color (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
434 void x_set_border_color (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
435 void x_set_cursor_type (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
436 void x_set_icon_type (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
437 void x_set_icon_name (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
438 void x_explicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
439 void x_set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
440 void x_set_title (struct frame *, Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
441 void x_set_tool_bar_lines (struct frame *, Lisp_Object, Lisp_Object);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
442
50362
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
443
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
444
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
445
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
446 /* Store the screen positions of frame F into XPTR and YPTR.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
447 These are the positions of the containing window manager window,
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
448 not Emacs's own window. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
449
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
450 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
451 x_real_positions (FRAME_PTR f, int *xptr, int *yptr)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
452 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
453 POINT pt;
43398
8782b8cfed62 *** empty log message ***
Jason Rumney <jasonr@gnu.org>
parents: 43210
diff changeset
454 RECT rect;
8782b8cfed62 *** empty log message ***
Jason Rumney <jasonr@gnu.org>
parents: 43210
diff changeset
455
78212
87b807b2d9b1 (x_real_positions): Get real position from OS instead of calculating it.
Jason Rumney <jasonr@gnu.org>
parents: 78106
diff changeset
456 /* Get the bounds of the WM window. */
87b807b2d9b1 (x_real_positions): Get real position from OS instead of calculating it.
Jason Rumney <jasonr@gnu.org>
parents: 78106
diff changeset
457 GetWindowRect (FRAME_W32_WINDOW (f), &rect);
87b807b2d9b1 (x_real_positions): Get real position from OS instead of calculating it.
Jason Rumney <jasonr@gnu.org>
parents: 78106
diff changeset
458
87b807b2d9b1 (x_real_positions): Get real position from OS instead of calculating it.
Jason Rumney <jasonr@gnu.org>
parents: 78106
diff changeset
459 pt.x = 0;
87b807b2d9b1 (x_real_positions): Get real position from OS instead of calculating it.
Jason Rumney <jasonr@gnu.org>
parents: 78106
diff changeset
460 pt.y = 0;
87b807b2d9b1 (x_real_positions): Get real position from OS instead of calculating it.
Jason Rumney <jasonr@gnu.org>
parents: 78106
diff changeset
461
87b807b2d9b1 (x_real_positions): Get real position from OS instead of calculating it.
Jason Rumney <jasonr@gnu.org>
parents: 78106
diff changeset
462 /* Convert (0, 0) in the client area to screen co-ordinates. */
87b807b2d9b1 (x_real_positions): Get real position from OS instead of calculating it.
Jason Rumney <jasonr@gnu.org>
parents: 78106
diff changeset
463 ClientToScreen (FRAME_W32_WINDOW (f), &pt);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
464
43398
8782b8cfed62 *** empty log message ***
Jason Rumney <jasonr@gnu.org>
parents: 43210
diff changeset
465 /* Remember x_pixels_diff and y_pixels_diff. */
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
466 f->x_pixels_diff = pt.x - rect.left;
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
467 f->y_pixels_diff = pt.y - rect.top;
43398
8782b8cfed62 *** empty log message ***
Jason Rumney <jasonr@gnu.org>
parents: 43210
diff changeset
468
78212
87b807b2d9b1 (x_real_positions): Get real position from OS instead of calculating it.
Jason Rumney <jasonr@gnu.org>
parents: 78106
diff changeset
469 *xptr = rect.left;
87b807b2d9b1 (x_real_positions): Get real position from OS instead of calculating it.
Jason Rumney <jasonr@gnu.org>
parents: 78106
diff changeset
470 *yptr = rect.top;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
471 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
472
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
473
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
474
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
475 DEFUN ("w32-define-rgb-color", Fw32_define_rgb_color,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
476 Sw32_define_rgb_color, 4, 4, 0,
94432
2dd3f3069c1c (Fw32_define_rgb_color): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 93599
diff changeset
477 doc: /* Convert RGB numbers to a Windows color reference and associate with NAME.
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
478 This adds or updates a named color to `w32-color-map', making it
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
479 available for use. The original entry's RGB ref is returned, or nil
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
480 if the entry is new. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
481 (Lisp_Object red, Lisp_Object green, Lisp_Object blue, Lisp_Object name)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
482 {
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
483 Lisp_Object rgb;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
484 Lisp_Object oldrgb = Qnil;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
485 Lisp_Object entry;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
486
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
487 CHECK_NUMBER (red);
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
488 CHECK_NUMBER (green);
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
489 CHECK_NUMBER (blue);
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
490 CHECK_STRING (name);
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
491
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
492 XSETINT (rgb, RGB (XUINT (red), XUINT (green), XUINT (blue)));
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
493
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
494 BLOCK_INPUT;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
495
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
496 /* replace existing entry in w32-color-map or add new entry. */
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
497 entry = Fassoc (name, Vw32_color_map);
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
498 if (NILP (entry))
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
499 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
500 entry = Fcons (name, rgb);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
501 Vw32_color_map = Fcons (entry, Vw32_color_map);
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
502 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
503 else
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
504 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
505 oldrgb = Fcdr (entry);
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
506 Fsetcdr (entry, rgb);
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
507 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
508
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
509 UNBLOCK_INPUT;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
510
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
511 return (oldrgb);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
512 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
513
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
514 /* The default colors for the w32 color map */
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
515 typedef struct colormap_t
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
516 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
517 char *name;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
518 COLORREF colorref;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
519 } colormap_t;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
520
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
521 colormap_t w32_color_map[] =
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
522 {
14983
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
523 {"snow" , PALETTERGB (255,250,250)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
524 {"ghost white" , PALETTERGB (248,248,255)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
525 {"GhostWhite" , PALETTERGB (248,248,255)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
526 {"white smoke" , PALETTERGB (245,245,245)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
527 {"WhiteSmoke" , PALETTERGB (245,245,245)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
528 {"gainsboro" , PALETTERGB (220,220,220)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
529 {"floral white" , PALETTERGB (255,250,240)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
530 {"FloralWhite" , PALETTERGB (255,250,240)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
531 {"old lace" , PALETTERGB (253,245,230)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
532 {"OldLace" , PALETTERGB (253,245,230)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
533 {"linen" , PALETTERGB (250,240,230)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
534 {"antique white" , PALETTERGB (250,235,215)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
535 {"AntiqueWhite" , PALETTERGB (250,235,215)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
536 {"papaya whip" , PALETTERGB (255,239,213)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
537 {"PapayaWhip" , PALETTERGB (255,239,213)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
538 {"blanched almond" , PALETTERGB (255,235,205)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
539 {"BlanchedAlmond" , PALETTERGB (255,235,205)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
540 {"bisque" , PALETTERGB (255,228,196)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
541 {"peach puff" , PALETTERGB (255,218,185)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
542 {"PeachPuff" , PALETTERGB (255,218,185)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
543 {"navajo white" , PALETTERGB (255,222,173)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
544 {"NavajoWhite" , PALETTERGB (255,222,173)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
545 {"moccasin" , PALETTERGB (255,228,181)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
546 {"cornsilk" , PALETTERGB (255,248,220)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
547 {"ivory" , PALETTERGB (255,255,240)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
548 {"lemon chiffon" , PALETTERGB (255,250,205)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
549 {"LemonChiffon" , PALETTERGB (255,250,205)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
550 {"seashell" , PALETTERGB (255,245,238)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
551 {"honeydew" , PALETTERGB (240,255,240)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
552 {"mint cream" , PALETTERGB (245,255,250)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
553 {"MintCream" , PALETTERGB (245,255,250)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
554 {"azure" , PALETTERGB (240,255,255)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
555 {"alice blue" , PALETTERGB (240,248,255)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
556 {"AliceBlue" , PALETTERGB (240,248,255)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
557 {"lavender" , PALETTERGB (230,230,250)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
558 {"lavender blush" , PALETTERGB (255,240,245)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
559 {"LavenderBlush" , PALETTERGB (255,240,245)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
560 {"misty rose" , PALETTERGB (255,228,225)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
561 {"MistyRose" , PALETTERGB (255,228,225)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
562 {"white" , PALETTERGB (255,255,255)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
563 {"black" , PALETTERGB ( 0, 0, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
564 {"dark slate gray" , PALETTERGB ( 47, 79, 79)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
565 {"DarkSlateGray" , PALETTERGB ( 47, 79, 79)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
566 {"dark slate grey" , PALETTERGB ( 47, 79, 79)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
567 {"DarkSlateGrey" , PALETTERGB ( 47, 79, 79)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
568 {"dim gray" , PALETTERGB (105,105,105)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
569 {"DimGray" , PALETTERGB (105,105,105)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
570 {"dim grey" , PALETTERGB (105,105,105)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
571 {"DimGrey" , PALETTERGB (105,105,105)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
572 {"slate gray" , PALETTERGB (112,128,144)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
573 {"SlateGray" , PALETTERGB (112,128,144)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
574 {"slate grey" , PALETTERGB (112,128,144)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
575 {"SlateGrey" , PALETTERGB (112,128,144)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
576 {"light slate gray" , PALETTERGB (119,136,153)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
577 {"LightSlateGray" , PALETTERGB (119,136,153)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
578 {"light slate grey" , PALETTERGB (119,136,153)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
579 {"LightSlateGrey" , PALETTERGB (119,136,153)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
580 {"gray" , PALETTERGB (190,190,190)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
581 {"grey" , PALETTERGB (190,190,190)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
582 {"light grey" , PALETTERGB (211,211,211)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
583 {"LightGrey" , PALETTERGB (211,211,211)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
584 {"light gray" , PALETTERGB (211,211,211)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
585 {"LightGray" , PALETTERGB (211,211,211)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
586 {"midnight blue" , PALETTERGB ( 25, 25,112)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
587 {"MidnightBlue" , PALETTERGB ( 25, 25,112)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
588 {"navy" , PALETTERGB ( 0, 0,128)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
589 {"navy blue" , PALETTERGB ( 0, 0,128)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
590 {"NavyBlue" , PALETTERGB ( 0, 0,128)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
591 {"cornflower blue" , PALETTERGB (100,149,237)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
592 {"CornflowerBlue" , PALETTERGB (100,149,237)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
593 {"dark slate blue" , PALETTERGB ( 72, 61,139)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
594 {"DarkSlateBlue" , PALETTERGB ( 72, 61,139)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
595 {"slate blue" , PALETTERGB (106, 90,205)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
596 {"SlateBlue" , PALETTERGB (106, 90,205)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
597 {"medium slate blue" , PALETTERGB (123,104,238)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
598 {"MediumSlateBlue" , PALETTERGB (123,104,238)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
599 {"light slate blue" , PALETTERGB (132,112,255)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
600 {"LightSlateBlue" , PALETTERGB (132,112,255)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
601 {"medium blue" , PALETTERGB ( 0, 0,205)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
602 {"MediumBlue" , PALETTERGB ( 0, 0,205)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
603 {"royal blue" , PALETTERGB ( 65,105,225)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
604 {"RoyalBlue" , PALETTERGB ( 65,105,225)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
605 {"blue" , PALETTERGB ( 0, 0,255)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
606 {"dodger blue" , PALETTERGB ( 30,144,255)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
607 {"DodgerBlue" , PALETTERGB ( 30,144,255)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
608 {"deep sky blue" , PALETTERGB ( 0,191,255)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
609 {"DeepSkyBlue" , PALETTERGB ( 0,191,255)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
610 {"sky blue" , PALETTERGB (135,206,235)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
611 {"SkyBlue" , PALETTERGB (135,206,235)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
612 {"light sky blue" , PALETTERGB (135,206,250)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
613 {"LightSkyBlue" , PALETTERGB (135,206,250)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
614 {"steel blue" , PALETTERGB ( 70,130,180)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
615 {"SteelBlue" , PALETTERGB ( 70,130,180)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
616 {"light steel blue" , PALETTERGB (176,196,222)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
617 {"LightSteelBlue" , PALETTERGB (176,196,222)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
618 {"light blue" , PALETTERGB (173,216,230)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
619 {"LightBlue" , PALETTERGB (173,216,230)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
620 {"powder blue" , PALETTERGB (176,224,230)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
621 {"PowderBlue" , PALETTERGB (176,224,230)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
622 {"pale turquoise" , PALETTERGB (175,238,238)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
623 {"PaleTurquoise" , PALETTERGB (175,238,238)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
624 {"dark turquoise" , PALETTERGB ( 0,206,209)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
625 {"DarkTurquoise" , PALETTERGB ( 0,206,209)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
626 {"medium turquoise" , PALETTERGB ( 72,209,204)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
627 {"MediumTurquoise" , PALETTERGB ( 72,209,204)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
628 {"turquoise" , PALETTERGB ( 64,224,208)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
629 {"cyan" , PALETTERGB ( 0,255,255)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
630 {"light cyan" , PALETTERGB (224,255,255)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
631 {"LightCyan" , PALETTERGB (224,255,255)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
632 {"cadet blue" , PALETTERGB ( 95,158,160)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
633 {"CadetBlue" , PALETTERGB ( 95,158,160)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
634 {"medium aquamarine" , PALETTERGB (102,205,170)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
635 {"MediumAquamarine" , PALETTERGB (102,205,170)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
636 {"aquamarine" , PALETTERGB (127,255,212)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
637 {"dark green" , PALETTERGB ( 0,100, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
638 {"DarkGreen" , PALETTERGB ( 0,100, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
639 {"dark olive green" , PALETTERGB ( 85,107, 47)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
640 {"DarkOliveGreen" , PALETTERGB ( 85,107, 47)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
641 {"dark sea green" , PALETTERGB (143,188,143)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
642 {"DarkSeaGreen" , PALETTERGB (143,188,143)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
643 {"sea green" , PALETTERGB ( 46,139, 87)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
644 {"SeaGreen" , PALETTERGB ( 46,139, 87)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
645 {"medium sea green" , PALETTERGB ( 60,179,113)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
646 {"MediumSeaGreen" , PALETTERGB ( 60,179,113)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
647 {"light sea green" , PALETTERGB ( 32,178,170)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
648 {"LightSeaGreen" , PALETTERGB ( 32,178,170)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
649 {"pale green" , PALETTERGB (152,251,152)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
650 {"PaleGreen" , PALETTERGB (152,251,152)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
651 {"spring green" , PALETTERGB ( 0,255,127)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
652 {"SpringGreen" , PALETTERGB ( 0,255,127)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
653 {"lawn green" , PALETTERGB (124,252, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
654 {"LawnGreen" , PALETTERGB (124,252, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
655 {"green" , PALETTERGB ( 0,255, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
656 {"chartreuse" , PALETTERGB (127,255, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
657 {"medium spring green" , PALETTERGB ( 0,250,154)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
658 {"MediumSpringGreen" , PALETTERGB ( 0,250,154)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
659 {"green yellow" , PALETTERGB (173,255, 47)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
660 {"GreenYellow" , PALETTERGB (173,255, 47)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
661 {"lime green" , PALETTERGB ( 50,205, 50)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
662 {"LimeGreen" , PALETTERGB ( 50,205, 50)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
663 {"yellow green" , PALETTERGB (154,205, 50)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
664 {"YellowGreen" , PALETTERGB (154,205, 50)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
665 {"forest green" , PALETTERGB ( 34,139, 34)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
666 {"ForestGreen" , PALETTERGB ( 34,139, 34)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
667 {"olive drab" , PALETTERGB (107,142, 35)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
668 {"OliveDrab" , PALETTERGB (107,142, 35)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
669 {"dark khaki" , PALETTERGB (189,183,107)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
670 {"DarkKhaki" , PALETTERGB (189,183,107)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
671 {"khaki" , PALETTERGB (240,230,140)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
672 {"pale goldenrod" , PALETTERGB (238,232,170)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
673 {"PaleGoldenrod" , PALETTERGB (238,232,170)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
674 {"light goldenrod yellow" , PALETTERGB (250,250,210)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
675 {"LightGoldenrodYellow" , PALETTERGB (250,250,210)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
676 {"light yellow" , PALETTERGB (255,255,224)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
677 {"LightYellow" , PALETTERGB (255,255,224)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
678 {"yellow" , PALETTERGB (255,255, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
679 {"gold" , PALETTERGB (255,215, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
680 {"light goldenrod" , PALETTERGB (238,221,130)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
681 {"LightGoldenrod" , PALETTERGB (238,221,130)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
682 {"goldenrod" , PALETTERGB (218,165, 32)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
683 {"dark goldenrod" , PALETTERGB (184,134, 11)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
684 {"DarkGoldenrod" , PALETTERGB (184,134, 11)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
685 {"rosy brown" , PALETTERGB (188,143,143)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
686 {"RosyBrown" , PALETTERGB (188,143,143)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
687 {"indian red" , PALETTERGB (205, 92, 92)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
688 {"IndianRed" , PALETTERGB (205, 92, 92)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
689 {"saddle brown" , PALETTERGB (139, 69, 19)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
690 {"SaddleBrown" , PALETTERGB (139, 69, 19)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
691 {"sienna" , PALETTERGB (160, 82, 45)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
692 {"peru" , PALETTERGB (205,133, 63)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
693 {"burlywood" , PALETTERGB (222,184,135)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
694 {"beige" , PALETTERGB (245,245,220)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
695 {"wheat" , PALETTERGB (245,222,179)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
696 {"sandy brown" , PALETTERGB (244,164, 96)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
697 {"SandyBrown" , PALETTERGB (244,164, 96)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
698 {"tan" , PALETTERGB (210,180,140)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
699 {"chocolate" , PALETTERGB (210,105, 30)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
700 {"firebrick" , PALETTERGB (178,34, 34)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
701 {"brown" , PALETTERGB (165,42, 42)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
702 {"dark salmon" , PALETTERGB (233,150,122)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
703 {"DarkSalmon" , PALETTERGB (233,150,122)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
704 {"salmon" , PALETTERGB (250,128,114)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
705 {"light salmon" , PALETTERGB (255,160,122)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
706 {"LightSalmon" , PALETTERGB (255,160,122)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
707 {"orange" , PALETTERGB (255,165, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
708 {"dark orange" , PALETTERGB (255,140, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
709 {"DarkOrange" , PALETTERGB (255,140, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
710 {"coral" , PALETTERGB (255,127, 80)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
711 {"light coral" , PALETTERGB (240,128,128)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
712 {"LightCoral" , PALETTERGB (240,128,128)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
713 {"tomato" , PALETTERGB (255, 99, 71)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
714 {"orange red" , PALETTERGB (255, 69, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
715 {"OrangeRed" , PALETTERGB (255, 69, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
716 {"red" , PALETTERGB (255, 0, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
717 {"hot pink" , PALETTERGB (255,105,180)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
718 {"HotPink" , PALETTERGB (255,105,180)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
719 {"deep pink" , PALETTERGB (255, 20,147)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
720 {"DeepPink" , PALETTERGB (255, 20,147)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
721 {"pink" , PALETTERGB (255,192,203)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
722 {"light pink" , PALETTERGB (255,182,193)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
723 {"LightPink" , PALETTERGB (255,182,193)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
724 {"pale violet red" , PALETTERGB (219,112,147)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
725 {"PaleVioletRed" , PALETTERGB (219,112,147)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
726 {"maroon" , PALETTERGB (176, 48, 96)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
727 {"medium violet red" , PALETTERGB (199, 21,133)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
728 {"MediumVioletRed" , PALETTERGB (199, 21,133)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
729 {"violet red" , PALETTERGB (208, 32,144)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
730 {"VioletRed" , PALETTERGB (208, 32,144)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
731 {"magenta" , PALETTERGB (255, 0,255)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
732 {"violet" , PALETTERGB (238,130,238)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
733 {"plum" , PALETTERGB (221,160,221)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
734 {"orchid" , PALETTERGB (218,112,214)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
735 {"medium orchid" , PALETTERGB (186, 85,211)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
736 {"MediumOrchid" , PALETTERGB (186, 85,211)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
737 {"dark orchid" , PALETTERGB (153, 50,204)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
738 {"DarkOrchid" , PALETTERGB (153, 50,204)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
739 {"dark violet" , PALETTERGB (148, 0,211)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
740 {"DarkViolet" , PALETTERGB (148, 0,211)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
741 {"blue violet" , PALETTERGB (138, 43,226)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
742 {"BlueViolet" , PALETTERGB (138, 43,226)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
743 {"purple" , PALETTERGB (160, 32,240)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
744 {"medium purple" , PALETTERGB (147,112,219)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
745 {"MediumPurple" , PALETTERGB (147,112,219)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
746 {"thistle" , PALETTERGB (216,191,216)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
747 {"gray0" , PALETTERGB ( 0, 0, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
748 {"grey0" , PALETTERGB ( 0, 0, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
749 {"dark grey" , PALETTERGB (169,169,169)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
750 {"DarkGrey" , PALETTERGB (169,169,169)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
751 {"dark gray" , PALETTERGB (169,169,169)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
752 {"DarkGray" , PALETTERGB (169,169,169)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
753 {"dark blue" , PALETTERGB ( 0, 0,139)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
754 {"DarkBlue" , PALETTERGB ( 0, 0,139)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
755 {"dark cyan" , PALETTERGB ( 0,139,139)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
756 {"DarkCyan" , PALETTERGB ( 0,139,139)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
757 {"dark magenta" , PALETTERGB (139, 0,139)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
758 {"DarkMagenta" , PALETTERGB (139, 0,139)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
759 {"dark red" , PALETTERGB (139, 0, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
760 {"DarkRed" , PALETTERGB (139, 0, 0)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
761 {"light green" , PALETTERGB (144,238,144)},
88b23d545848 (win32_color_map): Use PALETTERGB instead of RGB.
Geoff Voelker <voelker@cs.washington.edu>
parents: 14810
diff changeset
762 {"LightGreen" , PALETTERGB (144,238,144)},
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
763 };
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
764
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
765 DEFUN ("w32-default-color-map", Fw32_default_color_map, Sw32_default_color_map,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
766 0, 0, 0, doc: /* Return the default color map. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
767 (void)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
768 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
769 int i;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
770 colormap_t *pc = w32_color_map;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
771 Lisp_Object cmap;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
772
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
773 BLOCK_INPUT;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
774
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
775 cmap = Qnil;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
776
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
777 for (i = 0; i < sizeof (w32_color_map) / sizeof (w32_color_map[0]);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
778 pc++, i++)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
779 cmap = Fcons (Fcons (build_string (pc->name),
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
780 make_number (pc->colorref)),
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
781 cmap);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
782
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
783 UNBLOCK_INPUT;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
784
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
785 return (cmap);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
786 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
787
86065
2557aa084b57 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 86053
diff changeset
788 static Lisp_Object
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
789 w32_color_map_lookup (char *colorname)
23314
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
790 {
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
791 Lisp_Object tail, ret = Qnil;
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
792
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
793 BLOCK_INPUT;
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
794
85372
f7d19cfed7da * xselect.c (x_own_selection, x_handle_selection_clear)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85311
diff changeset
795 for (tail = Vw32_color_map; CONSP (tail); tail = XCDR (tail))
23314
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
796 {
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
797 register Lisp_Object elt, tem;
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
798
85372
f7d19cfed7da * xselect.c (x_own_selection, x_handle_selection_clear)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85311
diff changeset
799 elt = XCAR (tail);
23314
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
800 if (!CONSP (elt)) continue;
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
801
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
802 tem = Fcar (elt);
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
803
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
804 if (lstrcmpi (SDATA (tem), colorname) == 0)
23314
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
805 {
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
806 ret = Fcdr (elt);
23314
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
807 break;
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
808 }
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
809
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
810 QUIT;
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
811 }
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
812
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
813
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
814 UNBLOCK_INPUT;
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
815
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
816 return ret;
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
817 }
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
818
51474
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
819
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
820 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
821 add_system_logical_colors_to_map (Lisp_Object *system_colors)
51474
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
822 {
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
823 HKEY colors_key;
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
824
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
825 /* Other registry operations are done with input blocked. */
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
826 BLOCK_INPUT;
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
827
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
828 /* Look for "Control Panel/Colors" under User and Machine registry
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
829 settings. */
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
830 if (RegOpenKeyEx (HKEY_CURRENT_USER, "Control Panel\\Colors", 0,
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
831 KEY_READ, &colors_key) == ERROR_SUCCESS
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
832 || RegOpenKeyEx (HKEY_LOCAL_MACHINE, "Control Panel\\Colors", 0,
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
833 KEY_READ, &colors_key) == ERROR_SUCCESS)
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
834 {
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
835 /* List all keys. */
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
836 char color_buffer[64];
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
837 char full_name_buffer[MAX_PATH + SYSTEM_COLOR_PREFIX_LEN];
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
838 int index = 0;
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
839 DWORD name_size, color_size;
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
840 char *name_buffer = full_name_buffer + SYSTEM_COLOR_PREFIX_LEN;
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
841
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
842 name_size = sizeof (full_name_buffer) - SYSTEM_COLOR_PREFIX_LEN;
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
843 color_size = sizeof (color_buffer);
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
844
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
845 strcpy (full_name_buffer, SYSTEM_COLOR_PREFIX);
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
846
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
847 while (RegEnumValueA (colors_key, index, name_buffer, &name_size,
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
848 NULL, NULL, color_buffer, &color_size)
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
849 == ERROR_SUCCESS)
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
850 {
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
851 int r, g, b;
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
852 if (sscanf (color_buffer, " %u %u %u", &r, &g, &b) == 3)
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
853 *system_colors = Fcons (Fcons (build_string (full_name_buffer),
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
854 make_number (RGB (r, g, b))),
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
855 *system_colors);
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
856
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
857 name_size = sizeof (full_name_buffer) - SYSTEM_COLOR_PREFIX_LEN;
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
858 color_size = sizeof (color_buffer);
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
859 index++;
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
860 }
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
861 RegCloseKey (colors_key);
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
862 }
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
863
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
864 UNBLOCK_INPUT;
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
865 }
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
866
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
867
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
868 static Lisp_Object
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
869 x_to_w32_color (char * colorname)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
870 {
35288
912ea0b8e09b (x_to_w32_color, x_set_icon_name, xlfd_strip_height)
Jason Rumney <jasonr@gnu.org>
parents: 34998
diff changeset
871 register Lisp_Object ret = Qnil;
912ea0b8e09b (x_to_w32_color, x_set_icon_name, xlfd_strip_height)
Jason Rumney <jasonr@gnu.org>
parents: 34998
diff changeset
872
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
873 BLOCK_INPUT;
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
874
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
875 if (colorname[0] == '#')
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
876 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
877 /* Could be an old-style RGB Device specification. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
878 char *color;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
879 int size;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
880 color = colorname + 1;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
881
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
882 size = strlen (color);
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
883 if (size == 3 || size == 6 || size == 9 || size == 12)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
884 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
885 UINT colorval;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
886 int i, pos;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
887 pos = 0;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
888 size /= 3;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
889 colorval = 0;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
890
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
891 for (i = 0; i < 3; i++)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
892 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
893 char *end;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
894 char t;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
895 unsigned long value;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
896
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
897 /* The check for 'x' in the following conditional takes into
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
898 account the fact that strtol allows a "0x" in front of
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
899 our numbers, and we don't. */
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
900 if (!isxdigit (color[0]) || color[1] == 'x')
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
901 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
902 t = color[size];
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
903 color[size] = '\0';
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
904 value = strtoul (color, &end, 16);
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
905 color[size] = t;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
906 if (errno == ERANGE || end - color != size)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
907 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
908 switch (size)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
909 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
910 case 1:
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
911 value = value * 0x10;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
912 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
913 case 2:
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
914 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
915 case 3:
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
916 value /= 0x10;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
917 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
918 case 4:
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
919 value /= 0x100;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
920 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
921 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
922 colorval |= (value << pos);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
923 pos += 0x8;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
924 if (i == 2)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
925 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
926 UNBLOCK_INPUT;
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
927 XSETINT (ret, colorval);
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
928 return ret;
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
929 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
930 color = end;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
931 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
932 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
933 }
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
934 else if (strnicmp (colorname, "rgb:", 4) == 0)
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
935 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
936 char *color;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
937 UINT colorval;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
938 int i, pos;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
939 pos = 0;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
940
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
941 colorval = 0;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
942 color = colorname + 4;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
943 for (i = 0; i < 3; i++)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
944 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
945 char *end;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
946 unsigned long value;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
947
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
948 /* The check for 'x' in the following conditional takes into
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
949 account the fact that strtol allows a "0x" in front of
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
950 our numbers, and we don't. */
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
951 if (!isxdigit (color[0]) || color[1] == 'x')
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
952 break;
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
953 value = strtoul (color, &end, 16);
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
954 if (errno == ERANGE)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
955 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
956 switch (end - color)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
957 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
958 case 1:
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
959 value = value * 0x10 + value;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
960 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
961 case 2:
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
962 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
963 case 3:
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
964 value /= 0x10;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
965 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
966 case 4:
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
967 value /= 0x100;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
968 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
969 default:
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
970 value = ULONG_MAX;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
971 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
972 if (value == ULONG_MAX)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
973 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
974 colorval |= (value << pos);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
975 pos += 0x8;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
976 if (i == 2)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
977 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
978 if (*end != '\0')
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
979 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
980 UNBLOCK_INPUT;
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
981 XSETINT (ret, colorval);
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
982 return ret;
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
983 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
984 if (*end != '/')
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
985 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
986 color = end + 1;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
987 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
988 }
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
989 else if (strnicmp (colorname, "rgbi:", 5) == 0)
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
990 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
991 /* This is an RGB Intensity specification. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
992 char *color;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
993 UINT colorval;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
994 int i, pos;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
995 pos = 0;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
996
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
997 colorval = 0;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
998 color = colorname + 5;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
999 for (i = 0; i < 3; i++)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1000 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1001 char *end;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1002 double value;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1003 UINT val;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1004
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
1005 value = strtod (color, &end);
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1006 if (errno == ERANGE)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1007 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1008 if (value < 0.0 || value > 1.0)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1009 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1010 val = (UINT)(0x100 * value);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1011 /* We used 0x100 instead of 0xFF to give a continuous
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1012 range between 0.0 and 1.0 inclusive. The next statement
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1013 fixes the 1.0 case. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1014 if (val == 0x100)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1015 val = 0xFF;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1016 colorval |= (val << pos);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1017 pos += 0x8;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1018 if (i == 2)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1019 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1020 if (*end != '\0')
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1021 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1022 UNBLOCK_INPUT;
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
1023 XSETINT (ret, colorval);
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
1024 return ret;
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1025 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1026 if (*end != '/')
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1027 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1028 color = end + 1;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1029 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1030 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1031 /* I am not going to attempt to handle any of the CIE color schemes
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1032 or TekHVC, since I don't know the algorithms for conversion to
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1033 RGB. */
23314
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
1034
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
1035 /* If we fail to lookup the color name in w32_color_map, then check the
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1036 colorname to see if it can be crudely approximated: If the X color
23314
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
1037 ends in a number (e.g., "darkseagreen2"), strip the number and
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
1038 return the result of looking up the base color name. */
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
1039 ret = w32_color_map_lookup (colorname);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1040 if (NILP (ret))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1041 {
23314
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
1042 int len = strlen (colorname);
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
1043
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1044 if (isdigit (colorname[len - 1]))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1045 {
39548
6192be048459 (x_to_w32_color): Fix argument to alloca.
Andrew Innes <andrewi@gnu.org>
parents: 39137
diff changeset
1046 char *ptr, *approx = alloca (len + 1);
23314
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
1047
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
1048 strcpy (approx, colorname);
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
1049 ptr = &approx[len - 1];
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1050 while (ptr > approx && isdigit (*ptr))
23314
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
1051 *ptr-- = '\0';
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
1052
87acd2b6ce97 (w32_color_map_lookup): New function.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23160
diff changeset
1053 ret = w32_color_map_lookup (approx);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1054 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1055 }
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1056
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1057 UNBLOCK_INPUT;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1058 return ret;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1059 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1060
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1061 void
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1062 w32_regenerate_palette (FRAME_PTR f)
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1063 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1064 struct w32_palette_entry * list;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1065 LOGPALETTE * log_palette;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1066 HPALETTE new_palette;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1067 int i;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1068
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1069 /* don't bother trying to create palette if not supported */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1070 if (! FRAME_W32_DISPLAY_INFO (f)->has_palette)
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1071 return;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1072
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1073 log_palette = (LOGPALETTE *)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1074 alloca (sizeof (LOGPALETTE) +
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1075 FRAME_W32_DISPLAY_INFO (f)->num_colors * sizeof (PALETTEENTRY));
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1076 log_palette->palVersion = 0x300;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1077 log_palette->palNumEntries = FRAME_W32_DISPLAY_INFO (f)->num_colors;
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1078
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1079 list = FRAME_W32_DISPLAY_INFO (f)->color_list;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1080 for (i = 0;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1081 i < FRAME_W32_DISPLAY_INFO (f)->num_colors;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1082 i++, list = list->next)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1083 log_palette->palPalEntry[i] = list->entry;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1084
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1085 new_palette = CreatePalette (log_palette);
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1086
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1087 enter_crit ();
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1088
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1089 if (FRAME_W32_DISPLAY_INFO (f)->palette)
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1090 DeleteObject (FRAME_W32_DISPLAY_INFO (f)->palette);
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1091 FRAME_W32_DISPLAY_INFO (f)->palette = new_palette;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1092
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1093 /* Realize display palette and garbage all frames. */
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1094 release_frame_dc (f, get_frame_dc (f));
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1095
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1096 leave_crit ();
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1097 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1098
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1099 #define W32_COLOR(pe) RGB (pe.peRed, pe.peGreen, pe.peBlue)
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1100 #define SET_W32_COLOR(pe, color) \
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1101 do \
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1102 { \
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1103 pe.peRed = GetRValue (color); \
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1104 pe.peGreen = GetGValue (color); \
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1105 pe.peBlue = GetBValue (color); \
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1106 pe.peFlags = 0; \
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1107 } while (0)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1108
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1109 #if 0
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1110 /* Keep these around in case we ever want to track color usage. */
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1111 void
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1112 w32_map_color (FRAME_PTR f, COLORREF color)
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1113 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1114 struct w32_palette_entry * list = FRAME_W32_DISPLAY_INFO (f)->color_list;
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1115
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1116 if (NILP (Vw32_enable_palette))
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1117 return;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1118
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1119 /* check if color is already mapped */
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1120 while (list)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1121 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1122 if (W32_COLOR (list->entry) == color)
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1123 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1124 ++list->refcount;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1125 return;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1126 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1127 list = list->next;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1128 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1129
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1130 /* not already mapped, so add to list and recreate Windows palette */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1131 list = (struct w32_palette_entry *)
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1132 xmalloc (sizeof (struct w32_palette_entry));
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1133 SET_W32_COLOR (list->entry, color);
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1134 list->refcount = 1;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1135 list->next = FRAME_W32_DISPLAY_INFO (f)->color_list;
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1136 FRAME_W32_DISPLAY_INFO (f)->color_list = list;
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1137 FRAME_W32_DISPLAY_INFO (f)->num_colors++;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1138
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1139 /* set flag that palette must be regenerated */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1140 FRAME_W32_DISPLAY_INFO (f)->regen_palette = TRUE;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1141 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1142
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1143 void
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1144 w32_unmap_color (FRAME_PTR f, COLORREF color)
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1145 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1146 struct w32_palette_entry * list = FRAME_W32_DISPLAY_INFO (f)->color_list;
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1147 struct w32_palette_entry **prev = &FRAME_W32_DISPLAY_INFO (f)->color_list;
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1148
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1149 if (NILP (Vw32_enable_palette))
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1150 return;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1151
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1152 /* check if color is already mapped */
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1153 while (list)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1154 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1155 if (W32_COLOR (list->entry) == color)
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1156 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1157 if (--list->refcount == 0)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1158 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1159 *prev = list->next;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1160 xfree (list);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1161 FRAME_W32_DISPLAY_INFO (f)->num_colors--;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1162 break;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1163 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1164 else
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1165 return;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1166 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1167 prev = &list->next;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1168 list = list->next;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1169 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1170
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1171 /* set flag that palette must be regenerated */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1172 FRAME_W32_DISPLAY_INFO (f)->regen_palette = TRUE;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1173 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1174 #endif
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1175
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1176
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1177 /* Gamma-correct COLOR on frame F. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1178
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1179 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1180 gamma_correct (struct frame *f, COLORREF *color)
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1181 {
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1182 if (f->gamma)
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1183 {
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1184 *color = PALETTERGB (
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1185 pow (GetRValue (*color) / 255.0, f->gamma) * 255.0 + 0.5,
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1186 pow (GetGValue (*color) / 255.0, f->gamma) * 255.0 + 0.5,
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1187 pow (GetBValue (*color) / 255.0, f->gamma) * 255.0 + 0.5);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1188 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1189 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1190
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1191
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1192 /* Decide if color named COLOR is valid for the display associated with
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1193 the selected frame; if so, return the rgb values in COLOR_DEF.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1194 If ALLOC is nonzero, allocate a new colormap cell. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1195
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1196 int
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1197 w32_defined_color (FRAME_PTR f, char *color, XColor *color_def, int alloc)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1198 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1199 register Lisp_Object tem;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1200 COLORREF w32_color_ref;
14353
d0d8d9d73f7f backout 1.3
Geoff Voelker <voelker@cs.washington.edu>
parents: 14243
diff changeset
1201
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1202 tem = x_to_w32_color (color);
14353
d0d8d9d73f7f backout 1.3
Geoff Voelker <voelker@cs.washington.edu>
parents: 14243
diff changeset
1203
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1204 if (!NILP (tem))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1205 {
27516
8001542eaee2 (w32_defined_color): Check for valid frame before
Jason Rumney <jasonr@gnu.org>
parents: 27407
diff changeset
1206 if (f)
8001542eaee2 (w32_defined_color): Check for valid frame before
Jason Rumney <jasonr@gnu.org>
parents: 27407
diff changeset
1207 {
8001542eaee2 (w32_defined_color): Check for valid frame before
Jason Rumney <jasonr@gnu.org>
parents: 27407
diff changeset
1208 /* Apply gamma correction. */
8001542eaee2 (w32_defined_color): Check for valid frame before
Jason Rumney <jasonr@gnu.org>
parents: 27407
diff changeset
1209 w32_color_ref = XUINT (tem);
8001542eaee2 (w32_defined_color): Check for valid frame before
Jason Rumney <jasonr@gnu.org>
parents: 27407
diff changeset
1210 gamma_correct (f, &w32_color_ref);
8001542eaee2 (w32_defined_color): Check for valid frame before
Jason Rumney <jasonr@gnu.org>
parents: 27407
diff changeset
1211 XSETINT (tem, w32_color_ref);
8001542eaee2 (w32_defined_color): Check for valid frame before
Jason Rumney <jasonr@gnu.org>
parents: 27407
diff changeset
1212 }
27407
7df920562cbe (w32_defined_color): Apply gamma correction before trying to map to
Jason Rumney <jasonr@gnu.org>
parents: 27397
diff changeset
1213
7df920562cbe (w32_defined_color): Apply gamma correction before trying to map to
Jason Rumney <jasonr@gnu.org>
parents: 27397
diff changeset
1214 /* Map this color to the palette if it is enabled. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1215 if (!NILP (Vw32_enable_palette))
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1216 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1217 struct w32_palette_entry * entry =
27516
8001542eaee2 (w32_defined_color): Check for valid frame before
Jason Rumney <jasonr@gnu.org>
parents: 27407
diff changeset
1218 one_w32_display_info.color_list;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1219 struct w32_palette_entry ** prev =
27516
8001542eaee2 (w32_defined_color): Check for valid frame before
Jason Rumney <jasonr@gnu.org>
parents: 27407
diff changeset
1220 &one_w32_display_info.color_list;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1221
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1222 /* check if color is already mapped */
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1223 while (entry)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1224 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1225 if (W32_COLOR (entry->entry) == XUINT (tem))
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1226 break;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1227 prev = &entry->next;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1228 entry = entry->next;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1229 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1230
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1231 if (entry == NULL && alloc)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1232 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1233 /* not already mapped, so add to list */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1234 entry = (struct w32_palette_entry *)
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1235 xmalloc (sizeof (struct w32_palette_entry));
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1236 SET_W32_COLOR (entry->entry, XUINT (tem));
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1237 entry->next = NULL;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1238 *prev = entry;
27516
8001542eaee2 (w32_defined_color): Check for valid frame before
Jason Rumney <jasonr@gnu.org>
parents: 27407
diff changeset
1239 one_w32_display_info.num_colors++;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1240
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1241 /* set flag that palette must be regenerated */
27516
8001542eaee2 (w32_defined_color): Check for valid frame before
Jason Rumney <jasonr@gnu.org>
parents: 27407
diff changeset
1242 one_w32_display_info.regen_palette = TRUE;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1243 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1244 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1245 /* Ensure COLORREF value is snapped to nearest color in (default)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1246 palette by simulating the PALETTERGB macro. This works whether
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1247 or not the display device has a palette. */
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1248 w32_color_ref = XUINT (tem) | 0x2000000;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1249
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1250 color_def->pixel = w32_color_ref;
48346
140fd0332d31 (w32_defined_color): Adjust RGB values for Emacs.
Jason Rumney <jasonr@gnu.org>
parents: 47983
diff changeset
1251 color_def->red = GetRValue (w32_color_ref) * 256;
140fd0332d31 (w32_defined_color): Adjust RGB values for Emacs.
Jason Rumney <jasonr@gnu.org>
parents: 47983
diff changeset
1252 color_def->green = GetGValue (w32_color_ref) * 256;
140fd0332d31 (w32_defined_color): Adjust RGB values for Emacs.
Jason Rumney <jasonr@gnu.org>
parents: 47983
diff changeset
1253 color_def->blue = GetBValue (w32_color_ref) * 256;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1254
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1255 return 1;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1256 }
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1257 else
14353
d0d8d9d73f7f backout 1.3
Geoff Voelker <voelker@cs.washington.edu>
parents: 14243
diff changeset
1258 {
d0d8d9d73f7f backout 1.3
Geoff Voelker <voelker@cs.washington.edu>
parents: 14243
diff changeset
1259 return 0;
d0d8d9d73f7f backout 1.3
Geoff Voelker <voelker@cs.washington.edu>
parents: 14243
diff changeset
1260 }
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1261 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1262
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1263 /* Given a string ARG naming a color, compute a pixel value from it
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1264 suitable for screen F.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1265 If F is not a color screen, return DEF (default) regardless of what
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1266 ARG says. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1267
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1268 int
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1269 x_decode_color (FRAME_PTR f, Lisp_Object arg, int def)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1270 {
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1271 XColor cdef;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1272
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
1273 CHECK_STRING (arg);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1274
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
1275 if (strcmp (SDATA (arg), "black") == 0)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1276 return BLACK_PIX_DEFAULT (f);
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
1277 else if (strcmp (SDATA (arg), "white") == 0)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1278 return WHITE_PIX_DEFAULT (f);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1279
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1280 if ((FRAME_W32_DISPLAY_INFO (f)->n_planes * FRAME_W32_DISPLAY_INFO (f)->n_cbits) == 1)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1281 return def;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1282
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1283 /* w32_defined_color is responsible for coping with failures
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1284 by looking for a near-miss. */
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
1285 if (w32_defined_color (f, SDATA (arg), &cdef, 1))
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1286 return cdef.pixel;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1287
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1288 /* defined_color failed; return an ultimate default. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1289 return def;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1290 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1291
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1292
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1293
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1294 /* Functions called only from `x_set_frame_param'
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1295 to set individual parameters.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1296
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1297 If FRAME_W32_WINDOW (f) is 0,
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1298 the frame is being created and its window does not exist yet.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1299 In that case, just record the parameter's new value
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1300 in the standard place; do not attempt to change the window. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1301
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1302 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1303 x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1304 {
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
1305 struct w32_output *x = f->output_data.w32;
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
1306 PIX_TYPE fg, old_fg;
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
1307
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
1308 fg = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
1309 old_fg = FRAME_FOREGROUND_PIXEL (f);
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
1310 FRAME_FOREGROUND_PIXEL (f) = fg;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1311
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1312 if (FRAME_W32_WINDOW (f) != 0)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1313 {
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
1314 if (x->cursor_pixel == old_fg)
109326
269057771f8c Fix bug #6609.
Eli Zaretskii <eliz@gnu.org>
parents: 109295
diff changeset
1315 {
269057771f8c Fix bug #6609.
Eli Zaretskii <eliz@gnu.org>
parents: 109295
diff changeset
1316 x->cursor_pixel = fg;
269057771f8c Fix bug #6609.
Eli Zaretskii <eliz@gnu.org>
parents: 109295
diff changeset
1317 x->cursor_gc->background = fg;
269057771f8c Fix bug #6609.
Eli Zaretskii <eliz@gnu.org>
parents: 109295
diff changeset
1318 }
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
1319
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1320 update_face_from_frame_parameter (f, Qforeground_color, arg);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1321 if (FRAME_VISIBLE_P (f))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1322 redraw_frame (f);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1323 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1324 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1325
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1326 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1327 x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1328 {
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1329 FRAME_BACKGROUND_PIXEL (f)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1330 = x_decode_color (f, arg, WHITE_PIX_DEFAULT (f));
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1331
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1332 if (FRAME_W32_WINDOW (f) != 0)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1333 {
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1334 SetWindowLong (FRAME_W32_WINDOW (f), WND_BACKGROUND_INDEX,
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1335 FRAME_BACKGROUND_PIXEL (f));
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1336
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1337 update_face_from_frame_parameter (f, Qbackground_color, arg);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1338
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1339 if (FRAME_VISIBLE_P (f))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1340 redraw_frame (f);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1341 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1342 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1343
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1344 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1345 x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1346 {
50229
e3a41ffa1cba Remove setup of cross_cursor (already has hand_cursor).
Kim F. Storm <storm@cua.dk>
parents: 50164
diff changeset
1347 Cursor cursor, nontext_cursor, mode_cursor, hand_cursor;
17632
d2915156a803 (x_set_mouse_color): Update calls to x_catch_errors
Richard M. Stallman <rms@gnu.org>
parents: 16884
diff changeset
1348 int count;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1349 int mask_color;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1350
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1351 if (!EQ (Qnil, arg))
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1352 f->output_data.w32->mouse_pixel
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1353 = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1354 mask_color = FRAME_BACKGROUND_PIXEL (f);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1355
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1356 /* Don't let pointers be invisible. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1357 if (mask_color == f->output_data.w32->mouse_pixel
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1358 && mask_color == FRAME_BACKGROUND_PIXEL (f))
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1359 f->output_data.w32->mouse_pixel = FRAME_FOREGROUND_PIXEL (f);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1360
100982
7c89b12c3a26 (Vx_pointer_shape, Vx_nontext_pointer_shape)
Jason Rumney <jasonr@gnu.org>
parents: 100951
diff changeset
1361 #if 0 /* TODO : Mouse cursor customization. */
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1362 BLOCK_INPUT;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1363
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1364 /* It's not okay to crash if the user selects a screwy cursor. */
17632
d2915156a803 (x_set_mouse_color): Update calls to x_catch_errors
Richard M. Stallman <rms@gnu.org>
parents: 16884
diff changeset
1365 count = x_catch_errors (FRAME_W32_DISPLAY (f));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1366
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1367 if (!EQ (Qnil, Vx_pointer_shape))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1368 {
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
1369 CHECK_NUMBER (Vx_pointer_shape);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1370 cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XINT (Vx_pointer_shape));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1371 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1372 else
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1373 cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_xterm);
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1374 x_check_errors (FRAME_W32_DISPLAY (f), "bad text pointer cursor: %s");
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1375
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1376 if (!EQ (Qnil, Vx_nontext_pointer_shape))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1377 {
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
1378 CHECK_NUMBER (Vx_nontext_pointer_shape);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1379 nontext_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1380 XINT (Vx_nontext_pointer_shape));
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1381 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1382 else
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1383 nontext_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_left_ptr);
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1384 x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s");
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1385
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
1386 if (!EQ (Qnil, Vx_hourglass_pointer_shape))
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
1387 {
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
1388 CHECK_NUMBER (Vx_hourglass_pointer_shape);
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
1389 hourglass_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
1390 XINT (Vx_hourglass_pointer_shape));
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
1391 }
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
1392 else
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
1393 hourglass_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_watch);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1394 x_check_errors (FRAME_W32_DISPLAY (f), "bad busy pointer cursor: %s");
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1395
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1396 x_check_errors (FRAME_W32_DISPLAY (f), "bad nontext pointer cursor: %s");
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1397 if (!EQ (Qnil, Vx_mode_pointer_shape))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1398 {
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
1399 CHECK_NUMBER (Vx_mode_pointer_shape);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1400 mode_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f),
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1401 XINT (Vx_mode_pointer_shape));
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1402 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1403 else
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1404 mode_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_xterm);
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1405 x_check_errors (FRAME_W32_DISPLAY (f), "bad modeline pointer cursor: %s");
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1406
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1407 if (!EQ (Qnil, Vx_sensitive_text_pointer_shape))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1408 {
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
1409 CHECK_NUMBER (Vx_sensitive_text_pointer_shape);
50229
e3a41ffa1cba Remove setup of cross_cursor (already has hand_cursor).
Kim F. Storm <storm@cua.dk>
parents: 50164
diff changeset
1410 hand_cursor
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1411 = XCreateFontCursor (FRAME_W32_DISPLAY (f),
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1412 XINT (Vx_sensitive_text_pointer_shape));
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1413 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1414 else
50229
e3a41ffa1cba Remove setup of cross_cursor (already has hand_cursor).
Kim F. Storm <storm@cua.dk>
parents: 50164
diff changeset
1415 hand_cursor = XCreateFontCursor (FRAME_W32_DISPLAY (f), XC_crosshair);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1416
34133
f1063cc498e4 (Fx_create_frame): Reintroduce the call to face-set-after-frame-defaults.
Jason Rumney <jasonr@gnu.org>
parents: 34089
diff changeset
1417 if (!NILP (Vx_window_horizontal_drag_shape))
f1063cc498e4 (Fx_create_frame): Reintroduce the call to face-set-after-frame-defaults.
Jason Rumney <jasonr@gnu.org>
parents: 34089
diff changeset
1418 {
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
1419 CHECK_NUMBER (Vx_window_horizontal_drag_shape);
34133
f1063cc498e4 (Fx_create_frame): Reintroduce the call to face-set-after-frame-defaults.
Jason Rumney <jasonr@gnu.org>
parents: 34089
diff changeset
1420 horizontal_drag_cursor
f1063cc498e4 (Fx_create_frame): Reintroduce the call to face-set-after-frame-defaults.
Jason Rumney <jasonr@gnu.org>
parents: 34089
diff changeset
1421 = XCreateFontCursor (FRAME_X_DISPLAY (f),
f1063cc498e4 (Fx_create_frame): Reintroduce the call to face-set-after-frame-defaults.
Jason Rumney <jasonr@gnu.org>
parents: 34089
diff changeset
1422 XINT (Vx_window_horizontal_drag_shape));
f1063cc498e4 (Fx_create_frame): Reintroduce the call to face-set-after-frame-defaults.
Jason Rumney <jasonr@gnu.org>
parents: 34089
diff changeset
1423 }
f1063cc498e4 (Fx_create_frame): Reintroduce the call to face-set-after-frame-defaults.
Jason Rumney <jasonr@gnu.org>
parents: 34089
diff changeset
1424 else
f1063cc498e4 (Fx_create_frame): Reintroduce the call to face-set-after-frame-defaults.
Jason Rumney <jasonr@gnu.org>
parents: 34089
diff changeset
1425 horizontal_drag_cursor
f1063cc498e4 (Fx_create_frame): Reintroduce the call to face-set-after-frame-defaults.
Jason Rumney <jasonr@gnu.org>
parents: 34089
diff changeset
1426 = XCreateFontCursor (FRAME_X_DISPLAY (f), XC_sb_h_double_arrow);
f1063cc498e4 (Fx_create_frame): Reintroduce the call to face-set-after-frame-defaults.
Jason Rumney <jasonr@gnu.org>
parents: 34089
diff changeset
1427
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1428 /* Check and report errors with the above calls. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1429 x_check_errors (FRAME_W32_DISPLAY (f), "can't set cursor shape: %s");
17632
d2915156a803 (x_set_mouse_color): Update calls to x_catch_errors
Richard M. Stallman <rms@gnu.org>
parents: 16884
diff changeset
1430 x_uncatch_errors (FRAME_W32_DISPLAY (f), count);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1431
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1432 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1433 XColor fore_color, back_color;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1434
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1435 fore_color.pixel = f->output_data.w32->mouse_pixel;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1436 back_color.pixel = mask_color;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1437 XQueryColor (FRAME_W32_DISPLAY (f),
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1438 DefaultColormap (FRAME_W32_DISPLAY (f),
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1439 DefaultScreen (FRAME_W32_DISPLAY (f))),
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1440 &fore_color);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1441 XQueryColor (FRAME_W32_DISPLAY (f),
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1442 DefaultColormap (FRAME_W32_DISPLAY (f),
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1443 DefaultScreen (FRAME_W32_DISPLAY (f))),
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1444 &back_color);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1445 XRecolorCursor (FRAME_W32_DISPLAY (f), cursor,
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1446 &fore_color, &back_color);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1447 XRecolorCursor (FRAME_W32_DISPLAY (f), nontext_cursor,
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1448 &fore_color, &back_color);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1449 XRecolorCursor (FRAME_W32_DISPLAY (f), mode_cursor,
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1450 &fore_color, &back_color);
50229
e3a41ffa1cba Remove setup of cross_cursor (already has hand_cursor).
Kim F. Storm <storm@cua.dk>
parents: 50164
diff changeset
1451 XRecolorCursor (FRAME_W32_DISPLAY (f), hand_cursor,
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1452 &fore_color, &back_color);
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
1453 XRecolorCursor (FRAME_W32_DISPLAY (f), hourglass_cursor,
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1454 &fore_color, &back_color);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1455 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1456
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1457 if (FRAME_W32_WINDOW (f) != 0)
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1458 XDefineCursor (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), cursor);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1459
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1460 if (cursor != f->output_data.w32->text_cursor && f->output_data.w32->text_cursor != 0)
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1461 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->text_cursor);
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1462 f->output_data.w32->text_cursor = cursor;
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1463
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1464 if (nontext_cursor != f->output_data.w32->nontext_cursor
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1465 && f->output_data.w32->nontext_cursor != 0)
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1466 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->nontext_cursor);
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1467 f->output_data.w32->nontext_cursor = nontext_cursor;
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1468
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
1469 if (hourglass_cursor != f->output_data.w32->hourglass_cursor
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
1470 && f->output_data.w32->hourglass_cursor != 0)
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
1471 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->hourglass_cursor);
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
1472 f->output_data.w32->hourglass_cursor = hourglass_cursor;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1473
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1474 if (mode_cursor != f->output_data.w32->modeline_cursor
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1475 && f->output_data.w32->modeline_cursor != 0)
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1476 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->modeline_cursor);
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1477 f->output_data.w32->modeline_cursor = mode_cursor;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1478
50229
e3a41ffa1cba Remove setup of cross_cursor (already has hand_cursor).
Kim F. Storm <storm@cua.dk>
parents: 50164
diff changeset
1479 if (hand_cursor != f->output_data.w32->hand_cursor
e3a41ffa1cba Remove setup of cross_cursor (already has hand_cursor).
Kim F. Storm <storm@cua.dk>
parents: 50164
diff changeset
1480 && f->output_data.w32->hand_cursor != 0)
e3a41ffa1cba Remove setup of cross_cursor (already has hand_cursor).
Kim F. Storm <storm@cua.dk>
parents: 50164
diff changeset
1481 XFreeCursor (FRAME_W32_DISPLAY (f), f->output_data.w32->hand_cursor);
e3a41ffa1cba Remove setup of cross_cursor (already has hand_cursor).
Kim F. Storm <storm@cua.dk>
parents: 50164
diff changeset
1482 f->output_data.w32->hand_cursor = hand_cursor;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1483
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1484 XFlush (FRAME_W32_DISPLAY (f));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1485 UNBLOCK_INPUT;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1486
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1487 update_face_from_frame_parameter (f, Qmouse_color, arg);
33387
01a10bc04233 (Qw32_charset_hangeul): Rename to match w32 headers.
Jason Rumney <jasonr@gnu.org>
parents: 33216
diff changeset
1488 #endif /* TODO */
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1489 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1490
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1491 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1492 x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1493 {
34062
0044985507c7 (x_set_cursor_color): Use x_update_cursor instead of x_display_cursor.
Jason Rumney <jasonr@gnu.org>
parents: 33929
diff changeset
1494 unsigned long fore_pixel, pixel;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1495
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
1496 if (!NILP (Vx_cursor_fore_pixel))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1497 fore_pixel = x_decode_color (f, Vx_cursor_fore_pixel,
34062
0044985507c7 (x_set_cursor_color): Use x_update_cursor instead of x_display_cursor.
Jason Rumney <jasonr@gnu.org>
parents: 33929
diff changeset
1498 WHITE_PIX_DEFAULT (f));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1499 else
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1500 fore_pixel = FRAME_BACKGROUND_PIXEL (f);
34062
0044985507c7 (x_set_cursor_color): Use x_update_cursor instead of x_display_cursor.
Jason Rumney <jasonr@gnu.org>
parents: 33929
diff changeset
1501
34089
445e01c537a3 Fix last change.
Jason Rumney <jasonr@gnu.org>
parents: 34062
diff changeset
1502 pixel = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1503
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1504 /* Make sure that the cursor color differs from the background color. */
34062
0044985507c7 (x_set_cursor_color): Use x_update_cursor instead of x_display_cursor.
Jason Rumney <jasonr@gnu.org>
parents: 33929
diff changeset
1505 if (pixel == FRAME_BACKGROUND_PIXEL (f))
0044985507c7 (x_set_cursor_color): Use x_update_cursor instead of x_display_cursor.
Jason Rumney <jasonr@gnu.org>
parents: 33929
diff changeset
1506 {
0044985507c7 (x_set_cursor_color): Use x_update_cursor instead of x_display_cursor.
Jason Rumney <jasonr@gnu.org>
parents: 33929
diff changeset
1507 pixel = f->output_data.w32->mouse_pixel;
0044985507c7 (x_set_cursor_color): Use x_update_cursor instead of x_display_cursor.
Jason Rumney <jasonr@gnu.org>
parents: 33929
diff changeset
1508 if (pixel == fore_pixel)
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1509 fore_pixel = FRAME_BACKGROUND_PIXEL (f);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1510 }
34062
0044985507c7 (x_set_cursor_color): Use x_update_cursor instead of x_display_cursor.
Jason Rumney <jasonr@gnu.org>
parents: 33929
diff changeset
1511
44047
73645cbc79a7 (x_set_cursor_color): Set foreground of cursor, not frame.
Jason Rumney <jasonr@gnu.org>
parents: 43963
diff changeset
1512 f->output_data.w32->cursor_foreground_pixel = fore_pixel;
34062
0044985507c7 (x_set_cursor_color): Use x_update_cursor instead of x_display_cursor.
Jason Rumney <jasonr@gnu.org>
parents: 33929
diff changeset
1513 f->output_data.w32->cursor_pixel = pixel;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1514
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1515 if (FRAME_W32_WINDOW (f) != 0)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1516 {
44094
16eb7bad861d (x_set_cursor_color): Set cursor_gc as well.
Jason Rumney <jasonr@gnu.org>
parents: 44076
diff changeset
1517 BLOCK_INPUT;
16eb7bad861d (x_set_cursor_color): Set cursor_gc as well.
Jason Rumney <jasonr@gnu.org>
parents: 44076
diff changeset
1518 /* Update frame's cursor_gc. */
16eb7bad861d (x_set_cursor_color): Set cursor_gc as well.
Jason Rumney <jasonr@gnu.org>
parents: 44076
diff changeset
1519 f->output_data.w32->cursor_gc->foreground = fore_pixel;
16eb7bad861d (x_set_cursor_color): Set cursor_gc as well.
Jason Rumney <jasonr@gnu.org>
parents: 44076
diff changeset
1520 f->output_data.w32->cursor_gc->background = pixel;
16eb7bad861d (x_set_cursor_color): Set cursor_gc as well.
Jason Rumney <jasonr@gnu.org>
parents: 44076
diff changeset
1521
16eb7bad861d (x_set_cursor_color): Set cursor_gc as well.
Jason Rumney <jasonr@gnu.org>
parents: 44076
diff changeset
1522 UNBLOCK_INPUT;
16eb7bad861d (x_set_cursor_color): Set cursor_gc as well.
Jason Rumney <jasonr@gnu.org>
parents: 44076
diff changeset
1523
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1524 if (FRAME_VISIBLE_P (f))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1525 {
34062
0044985507c7 (x_set_cursor_color): Use x_update_cursor instead of x_display_cursor.
Jason Rumney <jasonr@gnu.org>
parents: 33929
diff changeset
1526 x_update_cursor (f, 0);
0044985507c7 (x_set_cursor_color): Use x_update_cursor instead of x_display_cursor.
Jason Rumney <jasonr@gnu.org>
parents: 33929
diff changeset
1527 x_update_cursor (f, 1);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1528 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1529 }
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1530
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1531 update_face_from_frame_parameter (f, Qcursor_color, arg);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1532 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1533
24147
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
1534 /* Set the border-color of frame F to pixel value PIX.
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
1535 Note that this does not fully take effect if done before
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1536 F has a window. */
50362
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
1537
24147
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
1538 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1539 x_set_border_pixel (struct frame *f, int pix)
24147
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
1540 {
50362
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
1541
24147
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
1542 f->output_data.w32->border_pixel = pix;
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
1543
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
1544 if (FRAME_W32_WINDOW (f) != 0 && f->border_width > 0)
24147
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
1545 {
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
1546 if (FRAME_VISIBLE_P (f))
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
1547 redraw_frame (f);
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
1548 }
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
1549 }
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
1550
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1551 /* Set the border-color of frame F to value described by ARG.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1552 ARG can be a string naming a color.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1553 The border-color is used for the border that is drawn by the server.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1554 Note that this does not fully take effect if done before
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1555 F has a window; it must be redone when the window is created. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1556
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1557 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1558 x_set_border_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1559 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1560 int pix;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1561
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
1562 CHECK_STRING (arg);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1563 pix = x_decode_color (f, arg, BLACK_PIX_DEFAULT (f));
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1564 x_set_border_pixel (f, pix);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1565 update_face_from_frame_parameter (f, Qborder_color, arg);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1566 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1567
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
1568
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1569 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1570 x_set_cursor_type (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1571 {
47140
9ef4bf7492cb (Vblink_cursor_alist): Removed.
Kim F. Storm <storm@cua.dk>
parents: 47097
diff changeset
1572 set_frame_cursor_types (f, arg);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1573
49392
4e6b3d53732a (x_set_cursor_type): Set cursor_type_changed,
Jason Rumney <jasonr@gnu.org>
parents: 49369
diff changeset
1574 /* Make sure the cursor gets redrawn. */
49494
07f0ea120d7d (init_external_image_libraries): Try alternate names for the jpeg dll.
Juanma Barranquero <lekktu@gmail.com>
parents: 49455
diff changeset
1575 cursor_type_changed = 1;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1576 }
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
1577
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1578 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1579 x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1580 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1581 int result;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1582
25235
98c67187cd6b (x_set_icon_type): Support setting frame icons.
Geoff Voelker <voelker@cs.washington.edu>
parents: 25084
diff changeset
1583 if (NILP (arg) && NILP (oldval))
98c67187cd6b (x_set_icon_type): Support setting frame icons.
Geoff Voelker <voelker@cs.washington.edu>
parents: 25084
diff changeset
1584 return;
98c67187cd6b (x_set_icon_type): Support setting frame icons.
Geoff Voelker <voelker@cs.washington.edu>
parents: 25084
diff changeset
1585
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1586 if (STRINGP (arg) && STRINGP (oldval)
25235
98c67187cd6b (x_set_icon_type): Support setting frame icons.
Geoff Voelker <voelker@cs.washington.edu>
parents: 25084
diff changeset
1587 && EQ (Fstring_equal (oldval, arg), Qt))
98c67187cd6b (x_set_icon_type): Support setting frame icons.
Geoff Voelker <voelker@cs.washington.edu>
parents: 25084
diff changeset
1588 return;
98c67187cd6b (x_set_icon_type): Support setting frame icons.
Geoff Voelker <voelker@cs.washington.edu>
parents: 25084
diff changeset
1589
98c67187cd6b (x_set_icon_type): Support setting frame icons.
Geoff Voelker <voelker@cs.washington.edu>
parents: 25084
diff changeset
1590 if (SYMBOLP (arg) && SYMBOLP (oldval) && EQ (arg, oldval))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1591 return;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1592
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1593 BLOCK_INPUT;
25235
98c67187cd6b (x_set_icon_type): Support setting frame icons.
Geoff Voelker <voelker@cs.washington.edu>
parents: 25084
diff changeset
1594
98c67187cd6b (x_set_icon_type): Support setting frame icons.
Geoff Voelker <voelker@cs.washington.edu>
parents: 25084
diff changeset
1595 result = x_bitmap_icon (f, arg);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1596 if (result)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1597 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1598 UNBLOCK_INPUT;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1599 error ("No icon window available");
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1600 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1601
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1602 UNBLOCK_INPUT;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1603 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1604
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1605 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1606 x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1607 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1608 if (STRINGP (arg))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1609 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1610 if (STRINGP (oldval) && EQ (Fstring_equal (oldval, arg), Qt))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1611 return;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1612 }
71171
9fcdaa132bf3 (x_set_icon_name): Don't use arg if it's not a string and not nil.
Eli Zaretskii <eliz@gnu.org>
parents: 70233
diff changeset
1613 else if (!NILP (arg) || NILP (oldval))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1614 return;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1615
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1616 f->icon_name = arg;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1617
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1618 #if 0
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1619 if (f->output_data.w32->icon_bitmap != 0)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1620 return;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1621
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1622 BLOCK_INPUT;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1623
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1624 result = x_text_icon (f,
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
1625 (char *) SDATA ((!NILP (f->icon_name)
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
1626 ? f->icon_name
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
1627 : !NILP (f->title)
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
1628 ? f->title
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
1629 : f->name)));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1630
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1631 if (result)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1632 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1633 UNBLOCK_INPUT;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1634 error ("No icon window available");
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1635 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1636
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1637 /* If the window was unmapped (and its icon was mapped),
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1638 the new icon is not mapped, so map the window in its stead. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1639 if (FRAME_VISIBLE_P (f))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1640 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1641 #ifdef USE_X_TOOLKIT
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1642 XtPopup (f->output_data.w32->widget, XtGrabNone);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1643 #endif
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1644 XMapWindow (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1645 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1646
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1647 XFlush (FRAME_W32_DISPLAY (f));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1648 UNBLOCK_INPUT;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1649 #endif
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1650 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1651
33870
8816b5542315 (x_change_window_heights): New function.
Jason Rumney <jasonr@gnu.org>
parents: 33865
diff changeset
1652
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1653 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1654 x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1655 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1656 int nlines;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1657 int olines = FRAME_MENU_BAR_LINES (f);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1658
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1659 /* Right now, menu bars don't work properly in minibuf-only frames;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1660 most of the commands try to apply themselves to the minibuffer
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1661 frame itself, and get an error because you can't switch buffers
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1662 in or split the minibuffer window. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1663 if (FRAME_MINIBUF_ONLY_P (f))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1664 return;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1665
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1666 if (INTEGERP (value))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1667 nlines = XINT (value);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1668 else
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1669 nlines = 0;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1670
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1671 FRAME_MENU_BAR_LINES (f) = 0;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1672 if (nlines)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1673 FRAME_EXTERNAL_MENU_BAR (f) = 1;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1674 else
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1675 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1676 if (FRAME_EXTERNAL_MENU_BAR (f) == 1)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1677 free_frame_menubar (f);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1678 FRAME_EXTERNAL_MENU_BAR (f) = 0;
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1679
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1680 /* Adjust the frame size so that the client (text) dimensions
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1681 remain the same. This depends on FRAME_EXTERNAL_MENU_BAR being
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1682 set correctly. */
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
1683 x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1684 do_pending_window_change (0);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1685 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1686 adjust_glyphs (f);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1687 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1688
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1689
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1690 /* Set the number of lines used for the tool bar of frame F to VALUE.
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1691 VALUE not an integer, or < 0 means set the lines to zero. OLDVAL
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1692 is the old number of tool bar lines. This function changes the
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1693 height of all windows on frame F to match the new tool bar height.
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1694 The frame's height doesn't change. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1695
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1696 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1697 x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1698 {
33865
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1699 int delta, nlines, root_height;
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1700 Lisp_Object root_window;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1701
36000
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
1702 /* Treat tool bars like menu bars. */
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
1703 if (FRAME_MINIBUF_ONLY_P (f))
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
1704 return;
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
1705
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1706 /* Use VALUE only if an integer >= 0. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1707 if (INTEGERP (value) && XINT (value) >= 0)
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1708 nlines = XFASTINT (value);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1709 else
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1710 nlines = 0;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1711
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1712 /* Make sure we redisplay all windows in this frame. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1713 ++windows_or_buffers_changed;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1714
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1715 delta = nlines - FRAME_TOOL_BAR_LINES (f);
33865
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1716
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1717 /* Don't resize the tool-bar to more than we have room for. */
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1718 root_window = FRAME_ROOT_WINDOW (f);
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
1719 root_height = WINDOW_TOTAL_LINES (XWINDOW (root_window));
33865
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1720 if (root_height - delta < 1)
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1721 {
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1722 delta = root_height - 1;
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1723 nlines = FRAME_TOOL_BAR_LINES (f) + delta;
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1724 }
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1725
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1726 FRAME_TOOL_BAR_LINES (f) = nlines;
50362
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
1727 change_window_heights (root_window, delta);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1728 adjust_glyphs (f);
33865
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1729
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1730 /* We also have to make sure that the internal border at the top of
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1731 the frame, below the menu bar or tool bar, is redrawn when the
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1732 tool bar disappears. This is so because the internal border is
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1733 below the tool bar if one is displayed, but is below the menu bar
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1734 if there isn't a tool bar. The tool bar draws into the area
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1735 below the menu bar. */
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1736 if (FRAME_W32_WINDOW (f) && FRAME_TOOL_BAR_LINES (f) == 0)
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1737 {
83571
ca1c27e2707e (x_set_tool_bar_lines): Don't use updating_frame.
Jason Rumney <jasonr@gnu.org>
parents: 76700
diff changeset
1738 clear_frame (f);
33865
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1739 clear_current_matrices (f);
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1740 }
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1741
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1742 /* If the tool bar gets smaller, the internal border below it
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1743 has to be cleared. It was formerly part of the display
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1744 of the larger tool bar, and updating windows won't clear it. */
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1745 if (delta < 0)
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1746 {
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1747 int height = FRAME_INTERNAL_BORDER_WIDTH (f);
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
1748 int width = FRAME_PIXEL_WIDTH (f);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
1749 int y = nlines * FRAME_LINE_HEIGHT (f);
33865
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1750
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1751 BLOCK_INPUT;
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1752 {
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1753 HDC hdc = get_frame_dc (f);
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1754 w32_clear_area (f, hdc, 0, y, width, height);
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1755 release_frame_dc (f, hdc);
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1756 }
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1757 UNBLOCK_INPUT;
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
1758
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
1759 if (WINDOWP (f->tool_bar_window))
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
1760 clear_glyph_matrix (XWINDOW (f->tool_bar_window)->current_matrix);
33865
f32333d8172b (x_set_tool_bar_lines): Clear internal border when making tool bar
Jason Rumney <jasonr@gnu.org>
parents: 33443
diff changeset
1761 }
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1762 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1763
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1764
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1765 /* Change the name of frame F to NAME. If NAME is nil, set F's name to
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1766 w32_id_name.
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1767
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1768 If EXPLICIT is non-zero, that indicates that lisp code is setting the
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1769 name; if NAME is a string, set F's name to NAME and set
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1770 F->explicit_name; if NAME is Qnil, then clear F->explicit_name.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1771
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1772 If EXPLICIT is zero, that indicates that Emacs redisplay code is
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1773 suggesting a new name, which lisp code should override; if
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1774 F->explicit_name is set, ignore the new name; otherwise, set it. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1775
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1776 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1777 x_set_name (struct frame *f, Lisp_Object name, int explicit)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1778 {
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1779 /* Make sure that requests from lisp code override requests from
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1780 Emacs redisplay code. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1781 if (explicit)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1782 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1783 /* If we're switching from explicit to implicit, we had better
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1784 update the mode lines and thereby update the title. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1785 if (f->explicit_name && NILP (name))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1786 update_mode_lines = 1;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1787
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1788 f->explicit_name = ! NILP (name);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1789 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1790 else if (f->explicit_name)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1791 return;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1792
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1793 /* If NAME is nil, set the name to the w32_id_name. */
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1794 if (NILP (name))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1795 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1796 /* Check for no change needed in this very common case
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1797 before we do any consing. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1798 if (!strcmp (FRAME_W32_DISPLAY_INFO (f)->w32_id_name,
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
1799 SDATA (f->name)))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1800 return;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1801 name = build_string (FRAME_W32_DISPLAY_INFO (f)->w32_id_name);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1802 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1803 else
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
1804 CHECK_STRING (name);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1805
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1806 /* Don't change the name if it's already NAME. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1807 if (! NILP (Fstring_equal (name, f->name)))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1808 return;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1809
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1810 f->name = name;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1811
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1812 /* For setting the frame title, the title parameter should override
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1813 the name parameter. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1814 if (! NILP (f->title))
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1815 name = f->title;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1816
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1817 if (FRAME_W32_WINDOW (f))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1818 {
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1819 if (STRING_MULTIBYTE (name))
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
1820 name = ENCODE_SYSTEM (name);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1821
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1822 BLOCK_INPUT;
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
1823 SetWindowText (FRAME_W32_WINDOW (f), SDATA (name));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1824 UNBLOCK_INPUT;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1825 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1826 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1827
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1828 /* This function should be called when the user's lisp code has
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1829 specified a name for the frame; the name will override any set by the
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1830 redisplay code. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1831 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1832 x_explicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1833 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1834 x_set_name (f, arg, 1);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1835 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1836
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1837 /* This function should be called by Emacs redisplay code to set the
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1838 name; names set this way will never override names set by the user's
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1839 lisp code. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1840 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1841 x_implicitly_set_name (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1842 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1843 x_set_name (f, arg, 0);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1844 }
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1845
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1846 /* Change the title of frame F to NAME.
79054
dcfd2d0c6c47 *** empty log message ***
Martin Rudalics <rudalics@gmx.at>
parents: 78907
diff changeset
1847 If NAME is nil, use the frame name as the title. */
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1848
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1849 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1850 x_set_title (struct frame *f, Lisp_Object name, Lisp_Object old_name)
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1851 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1852 /* Don't change the title if it's already NAME. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1853 if (EQ (name, f->title))
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1854 return;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1855
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1856 update_mode_lines = 1;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1857
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1858 f->title = name;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1859
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1860 if (NILP (name))
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1861 name = f->name;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1862
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1863 if (FRAME_W32_WINDOW (f))
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1864 {
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1865 if (STRING_MULTIBYTE (name))
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
1866 name = ENCODE_SYSTEM (name);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1867
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1868 BLOCK_INPUT;
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
1869 SetWindowText (FRAME_W32_WINDOW (f), SDATA (name));
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1870 UNBLOCK_INPUT;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1871 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1872 }
50362
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
1873
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1874 void
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1875 x_set_scroll_bar_default_width (struct frame *f)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1876 {
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
1877 int wid = FRAME_COLUMN_WIDTH (f);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
1878
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
1879 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
1880 FRAME_CONFIG_SCROLL_BAR_COLS (f) = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) +
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
1881 wid - 1) / wid;
50362
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
1882 }
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
1883
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1884
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
1885 /* Subroutines for creating a frame. */
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
1886
49369
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
1887 Cursor
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
1888 w32_load_cursor (LPCTSTR name)
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
1889 {
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
1890 /* Try first to load cursor from application resource. */
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
1891 Cursor cursor = LoadImage ((HINSTANCE) GetModuleHandle (NULL),
49369
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
1892 name, IMAGE_CURSOR, 0, 0,
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
1893 LR_DEFAULTCOLOR | LR_DEFAULTSIZE | LR_SHARED);
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
1894 if (!cursor)
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
1895 {
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
1896 /* Then try to load a shared predefined cursor. */
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
1897 cursor = LoadImage (NULL, name, IMAGE_CURSOR, 0, 0,
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
1898 LR_DEFAULTCOLOR | LR_DEFAULTSIZE | LR_SHARED);
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
1899 }
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
1900 return cursor;
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
1901 }
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1902
110975
e0ac9a58795e src/w32*.c: Make functions static.
Juanma Barranquero <lekktu@gmail.com>
parents: 110540
diff changeset
1903 static LRESULT CALLBACK w32_wnd_proc (HWND, UINT, WPARAM, LPARAM);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1904
86065
2557aa084b57 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 86053
diff changeset
1905 static BOOL
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1906 w32_init_class (HINSTANCE hinst)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1907 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1908 WNDCLASS wc;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1909
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1910 wc.style = CS_HREDRAW | CS_VREDRAW;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1911 wc.lpfnWndProc = (WNDPROC) w32_wnd_proc;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1912 wc.cbClsExtra = 0;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1913 wc.cbWndExtra = WND_EXTRA_BYTES;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1914 wc.hInstance = hinst;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1915 wc.hIcon = LoadIcon (hinst, EMACS_CLASS);
49369
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
1916 wc.hCursor = w32_load_cursor (IDC_ARROW);
23506
246a14f0622f (Vx_pixel_size_width): New global variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23407
diff changeset
1917 wc.hbrBackground = NULL; /* GetStockObject (WHITE_BRUSH); */
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1918 wc.lpszMenuName = NULL;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1919 wc.lpszClassName = EMACS_CLASS;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1920
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1921 return (RegisterClass (&wc));
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1922 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1923
86065
2557aa084b57 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 86053
diff changeset
1924 static HWND
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1925 w32_createscrollbar (struct frame *f, struct scroll_bar * bar)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1926 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1927 return (CreateWindow ("SCROLLBAR", "", SBS_VERT | WS_CHILD | WS_VISIBLE,
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1928 /* Position and size of scroll bar. */
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
1929 XINT (bar->left) + VERTICAL_SCROLL_BAR_WIDTH_TRIM,
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
1930 XINT (bar->top),
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
1931 XINT (bar->width) - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2,
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
1932 XINT (bar->height),
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1933 FRAME_W32_WINDOW (f),
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1934 NULL,
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1935 hinst,
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1936 NULL));
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1937 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1938
86065
2557aa084b57 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 86053
diff changeset
1939 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
1940 w32_createwindow (struct frame *f)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1941 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1942 HWND hwnd;
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1943 RECT rect;
72269
b37e887392d9 (w32_createwindow): Handle -geometry command line option and the geometry
Eli Zaretskii <eliz@gnu.org>
parents: 72265
diff changeset
1944 Lisp_Object top = Qunbound;
b37e887392d9 (w32_createwindow): Handle -geometry command line option and the geometry
Eli Zaretskii <eliz@gnu.org>
parents: 72265
diff changeset
1945 Lisp_Object left = Qunbound;
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
1946 struct w32_display_info *dpyinfo = &one_w32_display_info;
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1947
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1948 rect.left = rect.top = 0;
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
1949 rect.right = FRAME_PIXEL_WIDTH (f);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
1950 rect.bottom = FRAME_PIXEL_HEIGHT (f);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1951
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1952 AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1953 FRAME_EXTERNAL_MENU_BAR (f));
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1954
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1955 /* Do first time app init */
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1956
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1957 if (!hprevinst)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1958 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
1959 w32_init_class (hinst);
72269
b37e887392d9 (w32_createwindow): Handle -geometry command line option and the geometry
Eli Zaretskii <eliz@gnu.org>
parents: 72265
diff changeset
1960 }
b37e887392d9 (w32_createwindow): Handle -geometry command line option and the geometry
Eli Zaretskii <eliz@gnu.org>
parents: 72265
diff changeset
1961
73285
d1194b4c29b3 2006-10-07 Ralf Angeli <angeli@caeruleus.net>
Jason Rumney <jasonr@gnu.org>
parents: 73087
diff changeset
1962 if (f->size_hint_flags & USPosition || f->size_hint_flags & PPosition)
d1194b4c29b3 2006-10-07 Ralf Angeli <angeli@caeruleus.net>
Jason Rumney <jasonr@gnu.org>
parents: 73087
diff changeset
1963 {
d1194b4c29b3 2006-10-07 Ralf Angeli <angeli@caeruleus.net>
Jason Rumney <jasonr@gnu.org>
parents: 73087
diff changeset
1964 XSETINT (left, f->left_pos);
d1194b4c29b3 2006-10-07 Ralf Angeli <angeli@caeruleus.net>
Jason Rumney <jasonr@gnu.org>
parents: 73087
diff changeset
1965 XSETINT (top, f->top_pos);
d1194b4c29b3 2006-10-07 Ralf Angeli <angeli@caeruleus.net>
Jason Rumney <jasonr@gnu.org>
parents: 73087
diff changeset
1966 }
d1194b4c29b3 2006-10-07 Ralf Angeli <angeli@caeruleus.net>
Jason Rumney <jasonr@gnu.org>
parents: 73087
diff changeset
1967 else if (EQ (left, Qunbound) && EQ (top, Qunbound))
72269
b37e887392d9 (w32_createwindow): Handle -geometry command line option and the geometry
Eli Zaretskii <eliz@gnu.org>
parents: 72265
diff changeset
1968 {
b37e887392d9 (w32_createwindow): Handle -geometry command line option and the geometry
Eli Zaretskii <eliz@gnu.org>
parents: 72265
diff changeset
1969 /* When called with RES_TYPE_NUMBER, w32_get_arg will return zero
b37e887392d9 (w32_createwindow): Handle -geometry command line option and the geometry
Eli Zaretskii <eliz@gnu.org>
parents: 72265
diff changeset
1970 for anything that is not a number and is not Qunbound. */
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
1971 left = x_get_arg (dpyinfo, Qnil, Qleft, "left", "Left", RES_TYPE_NUMBER);
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
1972 top = x_get_arg (dpyinfo, Qnil, Qtop, "top", "Top", RES_TYPE_NUMBER);
72269
b37e887392d9 (w32_createwindow): Handle -geometry command line option and the geometry
Eli Zaretskii <eliz@gnu.org>
parents: 72265
diff changeset
1973 }
72071
0bfda07cccbc (w32_createwindow): If `left' and/or `top' frame parameters are bound to some
Eli Zaretskii <eliz@gnu.org>
parents: 71545
diff changeset
1974
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1975 FRAME_W32_WINDOW (f) = hwnd
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1976 = CreateWindow (EMACS_CLASS,
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1977 f->namebuf,
39137
2d2b989f4a4b (w32_createwindow): Undo last change.
Andrew Innes <andrewi@gnu.org>
parents: 39128
diff changeset
1978 f->output_data.w32->dwStyle | WS_CLIPCHILDREN,
72071
0bfda07cccbc (w32_createwindow): If `left' and/or `top' frame parameters are bound to some
Eli Zaretskii <eliz@gnu.org>
parents: 71545
diff changeset
1979 EQ (left, Qunbound) ? CW_USEDEFAULT : XINT (left),
0bfda07cccbc (w32_createwindow): If `left' and/or `top' frame parameters are bound to some
Eli Zaretskii <eliz@gnu.org>
parents: 71545
diff changeset
1980 EQ (top, Qunbound) ? CW_USEDEFAULT : XINT (top),
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1981 rect.right - rect.left,
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1982 rect.bottom - rect.top,
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1983 NULL,
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1984 NULL,
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1985 hinst,
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1986 NULL);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
1987
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1988 if (hwnd)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
1989 {
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
1990 SetWindowLong (hwnd, WND_FONTWIDTH_INDEX, FRAME_COLUMN_WIDTH (f));
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
1991 SetWindowLong (hwnd, WND_LINEHEIGHT_INDEX, FRAME_LINE_HEIGHT (f));
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
1992 SetWindowLong (hwnd, WND_BORDER_INDEX, FRAME_INTERNAL_BORDER_WIDTH (f));
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
1993 SetWindowLong (hwnd, WND_SCROLLBAR_INDEX, f->scroll_bar_actual_width);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
1994 SetWindowLong (hwnd, WND_BACKGROUND_INDEX, FRAME_BACKGROUND_PIXEL (f));
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1995
21884
bc4455bca454 Include shellapi.h.
Richard M. Stallman <rms@gnu.org>
parents: 21874
diff changeset
1996 /* Enable drag-n-drop. */
bc4455bca454 Include shellapi.h.
Richard M. Stallman <rms@gnu.org>
parents: 21874
diff changeset
1997 DragAcceptFiles (hwnd, TRUE);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
1998
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
1999 /* Do this to discard the default setting specified by our parent. */
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2000 ShowWindow (hwnd, SW_HIDE);
71545
26164031aa5a (w32_createwindow): Use CW_USEDEFAULT instead of f->left_pos and SH_SHOW
Eli Zaretskii <eliz@gnu.org>
parents: 71171
diff changeset
2001
26164031aa5a (w32_createwindow): Use CW_USEDEFAULT instead of f->left_pos and SH_SHOW
Eli Zaretskii <eliz@gnu.org>
parents: 71171
diff changeset
2002 /* Update frame positions. */
26164031aa5a (w32_createwindow): Use CW_USEDEFAULT instead of f->left_pos and SH_SHOW
Eli Zaretskii <eliz@gnu.org>
parents: 71171
diff changeset
2003 GetWindowRect (hwnd, &rect);
26164031aa5a (w32_createwindow): Use CW_USEDEFAULT instead of f->left_pos and SH_SHOW
Eli Zaretskii <eliz@gnu.org>
parents: 71171
diff changeset
2004 f->left_pos = rect.left;
26164031aa5a (w32_createwindow): Use CW_USEDEFAULT instead of f->left_pos and SH_SHOW
Eli Zaretskii <eliz@gnu.org>
parents: 71171
diff changeset
2005 f->top_pos = rect.top;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2006 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2007 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2008
86065
2557aa084b57 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 86053
diff changeset
2009 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
2010 my_post_msg (W32Msg * wmsg, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2011 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2012 wmsg->msg.hwnd = hwnd;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2013 wmsg->msg.message = msg;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2014 wmsg->msg.wParam = wParam;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2015 wmsg->msg.lParam = lParam;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2016 wmsg->msg.time = GetMessageTime ();
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2017
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2018 post_msg (wmsg);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2019 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2020
16884
36babc489b0c Change all uses of win95, winnt, and win32
Geoff Voelker <voelker@cs.washington.edu>
parents: 16602
diff changeset
2021 /* GetKeyState and MapVirtualKey on Windows 95 do not actually distinguish
14461
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2022 between left and right keys as advertised. We test for this
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2023 support dynamically, and set a flag when the support is absent. If
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2024 absent, we keep track of the left and right control and alt keys
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2025 ourselves. This is particularly necessary on keyboards that rely
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2026 upon the AltGr key, which is represented as having the left control
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2027 and right alt keys pressed. For these keyboards, we need to know
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2028 when the left alt key has been pressed in addition to the AltGr key
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2029 so that we can properly support M-AltGr-key sequences (such as M-@
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2030 on Swedish keyboards). */
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2031
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2032 #define EMACS_LCONTROL 0
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2033 #define EMACS_RCONTROL 1
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2034 #define EMACS_LMENU 2
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2035 #define EMACS_RMENU 3
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2036
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2037 static int modifiers[4];
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2038 static int modifiers_recorded;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2039 static int modifier_key_support_tested;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2040
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2041 static void
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2042 test_modifier_support (unsigned int wparam)
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2043 {
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2044 unsigned int l, r;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2045
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2046 if (wparam != VK_CONTROL && wparam != VK_MENU)
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2047 return;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2048 if (wparam == VK_CONTROL)
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2049 {
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2050 l = VK_LCONTROL;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2051 r = VK_RCONTROL;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2052 }
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2053 else
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2054 {
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2055 l = VK_LMENU;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2056 r = VK_RMENU;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2057 }
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2058 if (!(GetKeyState (l) & 0x8000) && !(GetKeyState (r) & 0x8000))
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2059 modifiers_recorded = 1;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2060 else
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2061 modifiers_recorded = 0;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2062 modifier_key_support_tested = 1;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2063 }
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2064
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2065 static void
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2066 record_keydown (unsigned int wparam, unsigned int lparam)
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2067 {
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2068 int i;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2069
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2070 if (!modifier_key_support_tested)
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2071 test_modifier_support (wparam);
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2072
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2073 if ((wparam != VK_CONTROL && wparam != VK_MENU) || !modifiers_recorded)
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2074 return;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2075
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2076 if (wparam == VK_CONTROL)
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2077 i = (lparam & 0x1000000) ? EMACS_RCONTROL : EMACS_LCONTROL;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2078 else
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2079 i = (lparam & 0x1000000) ? EMACS_RMENU : EMACS_LMENU;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2080
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2081 modifiers[i] = 1;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2082 }
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2083
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2084 static void
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2085 record_keyup (unsigned int wparam, unsigned int lparam)
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2086 {
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2087 int i;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2088
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2089 if ((wparam != VK_CONTROL && wparam != VK_MENU) || !modifiers_recorded)
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2090 return;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2091
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2092 if (wparam == VK_CONTROL)
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2093 i = (lparam & 0x1000000) ? EMACS_RCONTROL : EMACS_LCONTROL;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2094 else
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2095 i = (lparam & 0x1000000) ? EMACS_RMENU : EMACS_LMENU;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2096
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2097 modifiers[i] = 0;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2098 }
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2099
14810
4dd6867765b9 (Vwin32_pass_alt_to_system,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14461
diff changeset
2100 /* Emacs can lose focus while a modifier key has been pressed. When
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
2101 it regains focus, be conservative and clear all modifiers since
14810
4dd6867765b9 (Vwin32_pass_alt_to_system,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14461
diff changeset
2102 we cannot reconstruct the left and right modifier state. */
4dd6867765b9 (Vwin32_pass_alt_to_system,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14461
diff changeset
2103 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
2104 reset_modifiers (void)
14810
4dd6867765b9 (Vwin32_pass_alt_to_system,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14461
diff changeset
2105 {
15314
796d825f4444 (reset_modifiers): Only clear a modifier if the modifier key has been
Richard M. Stallman <rms@gnu.org>
parents: 15290
diff changeset
2106 SHORT ctrl, alt;
796d825f4444 (reset_modifiers): Only clear a modifier if the modifier key has been
Richard M. Stallman <rms@gnu.org>
parents: 15290
diff changeset
2107
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2108 if (GetFocus () == NULL)
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2109 /* Emacs doesn't have keyboard focus. Do nothing. */
14810
4dd6867765b9 (Vwin32_pass_alt_to_system,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14461
diff changeset
2110 return;
15314
796d825f4444 (reset_modifiers): Only clear a modifier if the modifier key has been
Richard M. Stallman <rms@gnu.org>
parents: 15290
diff changeset
2111
796d825f4444 (reset_modifiers): Only clear a modifier if the modifier key has been
Richard M. Stallman <rms@gnu.org>
parents: 15290
diff changeset
2112 ctrl = GetAsyncKeyState (VK_CONTROL);
796d825f4444 (reset_modifiers): Only clear a modifier if the modifier key has been
Richard M. Stallman <rms@gnu.org>
parents: 15290
diff changeset
2113 alt = GetAsyncKeyState (VK_MENU);
796d825f4444 (reset_modifiers): Only clear a modifier if the modifier key has been
Richard M. Stallman <rms@gnu.org>
parents: 15290
diff changeset
2114
796d825f4444 (reset_modifiers): Only clear a modifier if the modifier key has been
Richard M. Stallman <rms@gnu.org>
parents: 15290
diff changeset
2115 if (!(ctrl & 0x08000))
796d825f4444 (reset_modifiers): Only clear a modifier if the modifier key has been
Richard M. Stallman <rms@gnu.org>
parents: 15290
diff changeset
2116 /* Clear any recorded control modifier state. */
796d825f4444 (reset_modifiers): Only clear a modifier if the modifier key has been
Richard M. Stallman <rms@gnu.org>
parents: 15290
diff changeset
2117 modifiers[EMACS_RCONTROL] = modifiers[EMACS_LCONTROL] = 0;
796d825f4444 (reset_modifiers): Only clear a modifier if the modifier key has been
Richard M. Stallman <rms@gnu.org>
parents: 15290
diff changeset
2118
796d825f4444 (reset_modifiers): Only clear a modifier if the modifier key has been
Richard M. Stallman <rms@gnu.org>
parents: 15290
diff changeset
2119 if (!(alt & 0x08000))
796d825f4444 (reset_modifiers): Only clear a modifier if the modifier key has been
Richard M. Stallman <rms@gnu.org>
parents: 15290
diff changeset
2120 /* Clear any recorded alt modifier state. */
796d825f4444 (reset_modifiers): Only clear a modifier if the modifier key has been
Richard M. Stallman <rms@gnu.org>
parents: 15290
diff changeset
2121 modifiers[EMACS_RMENU] = modifiers[EMACS_LMENU] = 0;
796d825f4444 (reset_modifiers): Only clear a modifier if the modifier key has been
Richard M. Stallman <rms@gnu.org>
parents: 15290
diff changeset
2122
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2123 /* Update the state of all modifier keys, because modifiers used in
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2124 hot-key combinations can get stuck on if Emacs loses focus as a
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2125 result of a hot-key being pressed. */
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2126 {
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2127 BYTE keystate[256];
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2128
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2129 #define CURRENT_STATE(key) ((GetAsyncKeyState (key) & 0x8000) >> 8)
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2130
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2131 GetKeyboardState (keystate);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2132 keystate[VK_SHIFT] = CURRENT_STATE (VK_SHIFT);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2133 keystate[VK_CONTROL] = CURRENT_STATE (VK_CONTROL);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2134 keystate[VK_LCONTROL] = CURRENT_STATE (VK_LCONTROL);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2135 keystate[VK_RCONTROL] = CURRENT_STATE (VK_RCONTROL);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2136 keystate[VK_MENU] = CURRENT_STATE (VK_MENU);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2137 keystate[VK_LMENU] = CURRENT_STATE (VK_LMENU);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2138 keystate[VK_RMENU] = CURRENT_STATE (VK_RMENU);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2139 keystate[VK_LWIN] = CURRENT_STATE (VK_LWIN);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2140 keystate[VK_RWIN] = CURRENT_STATE (VK_RWIN);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2141 keystate[VK_APPS] = CURRENT_STATE (VK_APPS);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2142 SetKeyboardState (keystate);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2143 }
14810
4dd6867765b9 (Vwin32_pass_alt_to_system,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14461
diff changeset
2144 }
4dd6867765b9 (Vwin32_pass_alt_to_system,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14461
diff changeset
2145
15377
65d9ff2c8602 (sync_modifiers): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15314
diff changeset
2146 /* Synchronize modifier state with what is reported with the current
65d9ff2c8602 (sync_modifiers): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15314
diff changeset
2147 keystroke. Even if we cannot distinguish between left and right
65d9ff2c8602 (sync_modifiers): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15314
diff changeset
2148 modifier keys, we know that, if no modifiers are set, then neither
65d9ff2c8602 (sync_modifiers): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15314
diff changeset
2149 the left or right modifier should be set. */
65d9ff2c8602 (sync_modifiers): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15314
diff changeset
2150 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
2151 sync_modifiers (void)
15377
65d9ff2c8602 (sync_modifiers): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15314
diff changeset
2152 {
65d9ff2c8602 (sync_modifiers): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15314
diff changeset
2153 if (!modifiers_recorded)
65d9ff2c8602 (sync_modifiers): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15314
diff changeset
2154 return;
65d9ff2c8602 (sync_modifiers): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15314
diff changeset
2155
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
2156 if (!(GetKeyState (VK_CONTROL) & 0x8000))
15377
65d9ff2c8602 (sync_modifiers): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15314
diff changeset
2157 modifiers[EMACS_RCONTROL] = modifiers[EMACS_LCONTROL] = 0;
65d9ff2c8602 (sync_modifiers): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15314
diff changeset
2158
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
2159 if (!(GetKeyState (VK_MENU) & 0x8000))
15377
65d9ff2c8602 (sync_modifiers): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15314
diff changeset
2160 modifiers[EMACS_RMENU] = modifiers[EMACS_LMENU] = 0;
65d9ff2c8602 (sync_modifiers): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15314
diff changeset
2161 }
65d9ff2c8602 (sync_modifiers): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15314
diff changeset
2162
14461
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2163 static int
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2164 modifier_set (int vkey)
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2165 {
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2166 if (vkey == VK_CAPITAL || vkey == VK_SCROLL)
15280
f39684fddaff (modifier_set): Check toggle state of CapsLock even
Karl Heuer <kwzh@gnu.org>
parents: 15232
diff changeset
2167 return (GetKeyState (vkey) & 0x1);
14461
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2168 if (!modifiers_recorded)
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2169 return (GetKeyState (vkey) & 0x8000);
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2170
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2171 switch (vkey)
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2172 {
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2173 case VK_LCONTROL:
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2174 return modifiers[EMACS_LCONTROL];
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2175 case VK_RCONTROL:
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2176 return modifiers[EMACS_RCONTROL];
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2177 case VK_LMENU:
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2178 return modifiers[EMACS_LMENU];
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2179 case VK_RMENU:
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2180 return modifiers[EMACS_RMENU];
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2181 }
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2182 return (GetKeyState (vkey) & 0x8000);
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2183 }
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2184
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2185 /* Convert between the modifier bits W32 uses and the modifier bits
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2186 Emacs uses. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2187
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2188 unsigned int
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2189 w32_key_to_modifier (int key)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2190 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2191 Lisp_Object key_mapping;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2192
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2193 switch (key)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2194 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2195 case VK_LWIN:
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2196 key_mapping = Vw32_lwindow_modifier;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2197 break;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2198 case VK_RWIN:
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2199 key_mapping = Vw32_rwindow_modifier;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2200 break;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2201 case VK_APPS:
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2202 key_mapping = Vw32_apps_modifier;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2203 break;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2204 case VK_SCROLL:
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2205 key_mapping = Vw32_scroll_lock_modifier;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2206 break;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2207 default:
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2208 key_mapping = Qnil;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2209 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2210
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2211 /* NB. This code runs in the input thread, asychronously to the lisp
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2212 thread, so we must be careful to ensure access to lisp data is
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2213 thread-safe. The following code is safe because the modifier
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2214 variable values are updated atomically from lisp and symbols are
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2215 not relocated by GC. Also, we don't have to worry about seeing GC
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2216 markbits here. */
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2217 if (EQ (key_mapping, Qhyper))
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2218 return hyper_modifier;
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2219 if (EQ (key_mapping, Qsuper))
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2220 return super_modifier;
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2221 if (EQ (key_mapping, Qmeta))
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2222 return meta_modifier;
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2223 if (EQ (key_mapping, Qalt))
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2224 return alt_modifier;
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2225 if (EQ (key_mapping, Qctrl))
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2226 return ctrl_modifier;
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2227 if (EQ (key_mapping, Qcontrol)) /* synonym for ctrl */
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2228 return ctrl_modifier;
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2229 if (EQ (key_mapping, Qshift))
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2230 return shift_modifier;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2231
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2232 /* Don't generate any modifier if not explicitly requested. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2233 return 0;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2234 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2235
86065
2557aa084b57 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 86053
diff changeset
2236 static unsigned int
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
2237 w32_get_modifiers (void)
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2238 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2239 return ((modifier_set (VK_SHIFT) ? shift_modifier : 0) |
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2240 (modifier_set (VK_CONTROL) ? ctrl_modifier : 0) |
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2241 (modifier_set (VK_LWIN) ? w32_key_to_modifier (VK_LWIN) : 0) |
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2242 (modifier_set (VK_RWIN) ? w32_key_to_modifier (VK_RWIN) : 0) |
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2243 (modifier_set (VK_APPS) ? w32_key_to_modifier (VK_APPS) : 0) |
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2244 (modifier_set (VK_SCROLL) ? w32_key_to_modifier (VK_SCROLL) : 0) |
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2245 (modifier_set (VK_MENU) ?
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2246 ((NILP (Vw32_alt_is_meta)) ? alt_modifier : meta_modifier) : 0));
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2247 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2248
14461
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2249 /* We map the VK_* modifiers into console modifier constants
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2250 so that we can use the same routines to handle both console
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2251 and window input. */
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2252
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2253 static int
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
2254 construct_console_modifiers (void)
14461
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2255 {
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2256 int mods;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2257
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2258 mods = 0;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2259 mods |= (modifier_set (VK_SHIFT)) ? SHIFT_PRESSED : 0;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2260 mods |= (modifier_set (VK_CAPITAL)) ? CAPSLOCK_ON : 0;
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2261 mods |= (modifier_set (VK_SCROLL)) ? SCROLLLOCK_ON : 0;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2262 mods |= (modifier_set (VK_NUMLOCK)) ? NUMLOCK_ON : 0;
14461
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2263 mods |= (modifier_set (VK_LCONTROL)) ? LEFT_CTRL_PRESSED : 0;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2264 mods |= (modifier_set (VK_RCONTROL)) ? RIGHT_CTRL_PRESSED : 0;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2265 mods |= (modifier_set (VK_LMENU)) ? LEFT_ALT_PRESSED : 0;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2266 mods |= (modifier_set (VK_RMENU)) ? RIGHT_ALT_PRESSED : 0;
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2267 mods |= (modifier_set (VK_LWIN)) ? LEFT_WIN_PRESSED : 0;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2268 mods |= (modifier_set (VK_RWIN)) ? RIGHT_WIN_PRESSED : 0;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2269 mods |= (modifier_set (VK_APPS)) ? APPS_PRESSED : 0;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2270
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2271 return mods;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2272 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2273
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2274 static int
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2275 w32_get_key_modifiers (unsigned int wparam, unsigned int lparam)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2276 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2277 int mods;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2278
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2279 /* Convert to emacs modifiers. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2280 mods = w32_kbd_mods_to_emacs (construct_console_modifiers (), wparam);
14461
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2281
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2282 return mods;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2283 }
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2284
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2285 unsigned int
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2286 map_keypad_keys (unsigned int virt_key, unsigned int extended)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2287 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2288 if (virt_key < VK_CLEAR || virt_key > VK_DELETE)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2289 return virt_key;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2290
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2291 if (virt_key == VK_RETURN)
14810
4dd6867765b9 (Vwin32_pass_alt_to_system,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14461
diff changeset
2292 return (extended ? VK_NUMPAD_ENTER : VK_RETURN);
4dd6867765b9 (Vwin32_pass_alt_to_system,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14461
diff changeset
2293
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2294 if (virt_key >= VK_PRIOR && virt_key <= VK_DOWN)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2295 return (!extended ? (VK_NUMPAD_PRIOR + (virt_key - VK_PRIOR)) : virt_key);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2296
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2297 if (virt_key == VK_INSERT || virt_key == VK_DELETE)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2298 return (!extended ? (VK_NUMPAD_INSERT + (virt_key - VK_INSERT)) : virt_key);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2299
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2300 if (virt_key == VK_CLEAR)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2301 return (!extended ? VK_NUMPAD_CLEAR : virt_key);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2302
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2303 return virt_key;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2304 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2305
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2306 /* List of special key combinations which w32 would normally capture,
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
2307 but Emacs should grab instead. Not directly visible to lisp, to
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2308 simplify synchronization. Each item is an integer encoding a virtual
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2309 key code and modifier combination to capture. */
86065
2557aa084b57 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 86053
diff changeset
2310 static Lisp_Object w32_grabbed_keys;
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2311
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
2312 #define HOTKEY(vk, mods) make_number (((vk) & 255) | ((mods) << 8))
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2313 #define HOTKEY_ID(k) (XFASTINT (k) & 0xbfff)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2314 #define HOTKEY_VK_CODE(k) (XFASTINT (k) & 255)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2315 #define HOTKEY_MODIFIERS(k) (XFASTINT (k) >> 8)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2316
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
2317 #define RAW_HOTKEY_ID(k) ((k) & 0xbfff)
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
2318 #define RAW_HOTKEY_VK_CODE(k) ((k) & 255)
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
2319 #define RAW_HOTKEY_MODIFIERS(k) ((k) >> 8)
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
2320
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2321 /* Register hot-keys for reserved key combinations when Emacs has
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2322 keyboard focus, since this is the only way Emacs can receive key
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2323 combinations like Alt-Tab which are used by the system. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2324
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2325 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
2326 register_hot_keys (HWND hwnd)
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2327 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2328 Lisp_Object keylist;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2329
90970
3371fc48749b Replace uses of GC_* macros with the non-GC_ versions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 90919
diff changeset
2330 /* Use CONSP, since we are called asynchronously. */
3371fc48749b Replace uses of GC_* macros with the non-GC_ versions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 90919
diff changeset
2331 for (keylist = w32_grabbed_keys; CONSP (keylist); keylist = XCDR (keylist))
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2332 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2333 Lisp_Object key = XCAR (keylist);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2334
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2335 /* Deleted entries get set to nil. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2336 if (!INTEGERP (key))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2337 continue;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2338
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2339 RegisterHotKey (hwnd, HOTKEY_ID (key),
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2340 HOTKEY_MODIFIERS (key), HOTKEY_VK_CODE (key));
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2341 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2342 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2343
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2344 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
2345 unregister_hot_keys (HWND hwnd)
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2346 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2347 Lisp_Object keylist;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2348
90970
3371fc48749b Replace uses of GC_* macros with the non-GC_ versions.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 90919
diff changeset
2349 for (keylist = w32_grabbed_keys; CONSP (keylist); keylist = XCDR (keylist))
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2350 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2351 Lisp_Object key = XCAR (keylist);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2352
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2353 if (!INTEGERP (key))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2354 continue;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2355
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2356 UnregisterHotKey (hwnd, HOTKEY_ID (key));
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2357 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2358 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2359
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2360 /* Main message dispatch loop. */
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2361
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2362 static void
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2363 w32_msg_pump (deferred_msg * msg_buf)
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2364 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2365 MSG msg;
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2366 int result;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2367 HWND focus_window;
21874
c0871d40073e (msh_mousewheel): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21735
diff changeset
2368
c0871d40073e (msh_mousewheel): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21735
diff changeset
2369 msh_mousewheel = RegisterWindowMessage (MSH_MOUSEWHEEL);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
2370
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2371 while (GetMessage (&msg, NULL, 0, 0))
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2372 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2373 if (msg.hwnd == NULL)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2374 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2375 switch (msg.message)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2376 {
23950
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2377 case WM_NULL:
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2378 /* Produced by complete_deferred_msg; just ignore. */
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2379 break;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2380 case WM_EMACS_CREATEWINDOW:
78106
f9eb7f243bdc (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
Jason Rumney <jasonr@gnu.org>
parents: 77995
diff changeset
2381 /* Initialize COM for this window. Even though we don't use it,
f9eb7f243bdc (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
Jason Rumney <jasonr@gnu.org>
parents: 77995
diff changeset
2382 some third party shell extensions can cause it to be used in
f9eb7f243bdc (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
Jason Rumney <jasonr@gnu.org>
parents: 77995
diff changeset
2383 system dialogs, which causes a crash if it is not initialized.
f9eb7f243bdc (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
Jason Rumney <jasonr@gnu.org>
parents: 77995
diff changeset
2384 This is a known bug in Windows, which was fixed long ago, but
f9eb7f243bdc (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
Jason Rumney <jasonr@gnu.org>
parents: 77995
diff changeset
2385 the patch for XP is not publically available until XP SP3,
f9eb7f243bdc (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
Jason Rumney <jasonr@gnu.org>
parents: 77995
diff changeset
2386 and older versions will never be patched. */
f9eb7f243bdc (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
Jason Rumney <jasonr@gnu.org>
parents: 77995
diff changeset
2387 CoInitialize (NULL);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
2388 w32_createwindow ((struct frame *) msg.wParam);
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2389 if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0))
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2390 abort ();
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2391 break;
21608
d191a8737145 (w32_msg_pump): Handle WM_EMACS_SETLOCALE.
Geoff Voelker <voelker@cs.washington.edu>
parents: 19707
diff changeset
2392 case WM_EMACS_SETLOCALE:
d191a8737145 (w32_msg_pump): Handle WM_EMACS_SETLOCALE.
Geoff Voelker <voelker@cs.washington.edu>
parents: 19707
diff changeset
2393 SetThreadLocale (msg.wParam);
d191a8737145 (w32_msg_pump): Handle WM_EMACS_SETLOCALE.
Geoff Voelker <voelker@cs.washington.edu>
parents: 19707
diff changeset
2394 /* Reply is not expected. */
d191a8737145 (w32_msg_pump): Handle WM_EMACS_SETLOCALE.
Geoff Voelker <voelker@cs.washington.edu>
parents: 19707
diff changeset
2395 break;
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2396 case WM_EMACS_SETKEYBOARDLAYOUT:
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2397 result = (int) ActivateKeyboardLayout ((HKL) msg.wParam, 0);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2398 if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE,
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2399 result, 0))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2400 abort ();
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2401 break;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2402 case WM_EMACS_REGISTER_HOT_KEY:
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2403 focus_window = GetFocus ();
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2404 if (focus_window != NULL)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2405 RegisterHotKey (focus_window,
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
2406 RAW_HOTKEY_ID (msg.wParam),
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
2407 RAW_HOTKEY_MODIFIERS (msg.wParam),
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
2408 RAW_HOTKEY_VK_CODE (msg.wParam));
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2409 /* Reply is not expected. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2410 break;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2411 case WM_EMACS_UNREGISTER_HOT_KEY:
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2412 focus_window = GetFocus ();
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2413 if (focus_window != NULL)
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
2414 UnregisterHotKey (focus_window, RAW_HOTKEY_ID (msg.wParam));
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2415 /* Mark item as erased. NB: this code must be
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2416 thread-safe. The next line is okay because the cons
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2417 cell is never made into garbage and is not relocated by
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2418 GC. */
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
2419 XSETCAR ((Lisp_Object) ((EMACS_INT) msg.lParam), Qnil);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2420 if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2421 abort ();
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2422 break;
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2423 case WM_EMACS_TOGGLE_LOCK_KEY:
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2424 {
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2425 int vk_code = (int) msg.wParam;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2426 int cur_state = (GetKeyState (vk_code) & 1);
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
2427 Lisp_Object new_state = (Lisp_Object) ((EMACS_INT) msg.lParam);
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2428
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2429 /* NB: This code must be thread-safe. It is safe to
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2430 call NILP because symbols are not relocated by GC,
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2431 and pointer here is not touched by GC (so the markbit
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2432 can't be set). Numbers are safe because they are
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2433 immediate values. */
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2434 if (NILP (new_state)
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2435 || (NUMBERP (new_state)
35288
912ea0b8e09b (x_to_w32_color, x_set_icon_name, xlfd_strip_height)
Jason Rumney <jasonr@gnu.org>
parents: 34998
diff changeset
2436 && ((XUINT (new_state)) & 1) != cur_state))
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2437 {
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2438 one_w32_display_info.faked_key = vk_code;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2439
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2440 keybd_event ((BYTE) vk_code,
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2441 (BYTE) MapVirtualKey (vk_code, 0),
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2442 KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2443 keybd_event ((BYTE) vk_code,
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2444 (BYTE) MapVirtualKey (vk_code, 0),
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2445 KEYEVENTF_EXTENDEDKEY | 0, 0);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2446 keybd_event ((BYTE) vk_code,
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2447 (BYTE) MapVirtualKey (vk_code, 0),
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2448 KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2449 cur_state = !cur_state;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2450 }
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2451 if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE,
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2452 cur_state, 0))
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2453 abort ();
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2454 }
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2455 break;
92362
099207aa138c (w32_msg_pump): Disable debug code.
Jason Rumney <jasonr@gnu.org>
parents: 92175
diff changeset
2456 #ifdef MSG_DEBUG
099207aa138c (w32_msg_pump): Disable debug code.
Jason Rumney <jasonr@gnu.org>
parents: 92175
diff changeset
2457 /* Broadcast messages make it here, so you need to be looking
099207aa138c (w32_msg_pump): Disable debug code.
Jason Rumney <jasonr@gnu.org>
parents: 92175
diff changeset
2458 for something in particular for this to be useful. */
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2459 default:
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2460 DebPrint (("msg %x not expected by w32_msg_pump\n", msg.message));
92362
099207aa138c (w32_msg_pump): Disable debug code.
Jason Rumney <jasonr@gnu.org>
parents: 92175
diff changeset
2461 #endif
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2462 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2463 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2464 else
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2465 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2466 DispatchMessage (&msg);
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2467 }
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2468
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2469 /* Exit nested loop when our deferred message has completed. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2470 if (msg_buf->completed)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2471 break;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2472 }
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2473 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2474
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2475 deferred_msg * deferred_msg_head;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2476
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2477 static deferred_msg *
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2478 find_deferred_msg (HWND hwnd, UINT msg)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2479 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2480 deferred_msg * item;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2481
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2482 /* Don't actually need synchronization for read access, since
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2483 modification of single pointer is always atomic. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2484 /* enter_crit (); */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2485
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2486 for (item = deferred_msg_head; item != NULL; item = item->next)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2487 if (item->w32msg.msg.hwnd == hwnd
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2488 && item->w32msg.msg.message == msg)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2489 break;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2490
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2491 /* leave_crit (); */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2492
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2493 return item;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2494 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2495
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2496 static LRESULT
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2497 send_deferred_msg (deferred_msg * msg_buf,
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2498 HWND hwnd,
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2499 UINT msg,
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2500 WPARAM wParam,
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2501 LPARAM lParam)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2502 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2503 /* Only input thread can send deferred messages. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2504 if (GetCurrentThreadId () != dwWindowsThreadId)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2505 abort ();
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2506
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2507 /* It is an error to send a message that is already deferred. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2508 if (find_deferred_msg (hwnd, msg) != NULL)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2509 abort ();
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2510
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2511 /* Enforced synchronization is not needed because this is the only
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2512 function that alters deferred_msg_head, and the following critical
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2513 section is guaranteed to only be serially reentered (since only the
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2514 input thread can call us). */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2515
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2516 /* enter_crit (); */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2517
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2518 msg_buf->completed = 0;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2519 msg_buf->next = deferred_msg_head;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2520 deferred_msg_head = msg_buf;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2521 my_post_msg (&msg_buf->w32msg, hwnd, msg, wParam, lParam);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2522
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2523 /* leave_crit (); */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2524
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2525 /* Start a new nested message loop to process other messages until
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2526 this one is completed. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2527 w32_msg_pump (msg_buf);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2528
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2529 deferred_msg_head = msg_buf->next;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2530
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2531 return msg_buf->result;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2532 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2533
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2534 void
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2535 complete_deferred_msg (HWND hwnd, UINT msg, LRESULT result)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2536 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2537 deferred_msg * msg_buf = find_deferred_msg (hwnd, msg);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2538
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2539 if (msg_buf == NULL)
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
2540 /* Message may have been cancelled, so don't abort. */
23950
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2541 return;
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2542
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2543 msg_buf->result = result;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2544 msg_buf->completed = 1;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2545
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2546 /* Ensure input thread is woken so it notices the completion. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2547 PostThreadMessage (dwWindowsThreadId, WM_NULL, 0, 0);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2548 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2549
86065
2557aa084b57 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 86053
diff changeset
2550 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
2551 cancel_all_deferred_msgs (void)
23950
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2552 {
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2553 deferred_msg * item;
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2554
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2555 /* Don't actually need synchronization for read access, since
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2556 modification of single pointer is always atomic. */
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2557 /* enter_crit (); */
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2558
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2559 for (item = deferred_msg_head; item != NULL; item = item->next)
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2560 {
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2561 item->result = 0;
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2562 item->completed = 1;
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2563 }
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2564
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2565 /* leave_crit (); */
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2566
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2567 /* Ensure input thread is woken so it notices the completion. */
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2568 PostThreadMessage (dwWindowsThreadId, WM_NULL, 0, 0);
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2569 }
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2570
74221
3146bd0e5646 (w32_msg_worker): Define as WINAPI and arg as void pointer.
Jason Rumney <jasonr@gnu.org>
parents: 73674
diff changeset
2571 DWORD WINAPI
3146bd0e5646 (w32_msg_worker): Define as WINAPI and arg as void pointer.
Jason Rumney <jasonr@gnu.org>
parents: 73674
diff changeset
2572 w32_msg_worker (void *arg)
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2573 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2574 MSG msg;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2575 deferred_msg dummy_buf;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2576
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2577 /* Ensure our message queue is created */
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
2578
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2579 PeekMessage (&msg, NULL, 0, 0, PM_NOREMOVE);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
2580
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2581 if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0))
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2582 abort ();
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2583
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2584 memset (&dummy_buf, 0, sizeof (dummy_buf));
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2585 dummy_buf.w32msg.msg.hwnd = NULL;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2586 dummy_buf.w32msg.msg.message = WM_NULL;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2587
94432
2dd3f3069c1c (Fw32_define_rgb_color): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 93599
diff changeset
2588 /* This is the initial message loop which should only exit when the
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2589 application quits. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2590 w32_msg_pump (&dummy_buf);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2591
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
2592 return 0;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2593 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2594
23950
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2595 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
2596 signal_user_input (void)
69426
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2597 {
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2598 /* Interrupt any lisp that wants to be interrupted by input. */
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2599 if (!NILP (Vthrow_on_input))
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2600 {
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2601 Vquit_flag = Vthrow_on_input;
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2602 /* If we're inside a function that wants immediate quits,
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2603 do it now. */
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2604 if (immediate_quit && NILP (Vinhibit_quit))
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2605 {
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2606 immediate_quit = 0;
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2607 QUIT;
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2608 }
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2609 }
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2610 }
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2611
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2612
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2613 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
2614 post_character_message (HWND hwnd, UINT msg,
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
2615 WPARAM wParam, LPARAM lParam,
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
2616 DWORD modifiers)
23950
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2617 {
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2618 W32Msg wmsg;
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2619
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2620 wmsg.dwModifiers = modifiers;
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2621
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2622 /* Detect quit_char and set quit-flag directly. Note that we
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2623 still need to post a message to ensure the main thread will be
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
2624 woken up if blocked in sys_select, but we do NOT want to post
23950
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2625 the quit_char message itself (because it will usually be as if
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2626 the user had typed quit_char twice). Instead, we post a dummy
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2627 message that has no particular effect. */
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2628 {
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2629 int c = wParam;
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2630 if (isalpha (c) && wmsg.dwModifiers == ctrl_modifier)
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2631 c = make_ctrl_char (c) & 0377;
24339
e8b73c2ac4ec (Vw32_quit_key): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24252
diff changeset
2632 if (c == quit_char
e8b73c2ac4ec (Vw32_quit_key): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24252
diff changeset
2633 || (wmsg.dwModifiers == 0 &&
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
2634 w32_quit_key && wParam == w32_quit_key))
23950
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2635 {
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2636 Vquit_flag = Qt;
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2637
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2638 /* The choice of message is somewhat arbitrary, as long as
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2639 the main thread handler just ignores it. */
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2640 msg = WM_NULL;
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2641
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2642 /* Interrupt any blocking system calls. */
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2643 signal_quit ();
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2644
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2645 /* As a safety precaution, forcibly complete any deferred
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2646 messages. This is a kludge, but I don't see any particularly
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2647 clean way to handle the situation where a deferred message is
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2648 "dropped" in the lisp thread, and will thus never be
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2649 completed, eg. by the user trying to activate the menubar
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2650 when the lisp thread is busy, and then typing C-g when the
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2651 menubar doesn't open promptly (with the result that the
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2652 menubar never responds at all because the deferred
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2653 WM_INITMENU message is never completed). Another problem
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2654 situation is when the lisp thread calls SendMessage (to send
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2655 a window manager command) when a message has been deferred;
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2656 the lisp thread gets blocked indefinitely waiting for the
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2657 deferred message to be completed, which itself is waiting for
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2658 the lisp thread to respond.
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2659
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2660 Note that we don't want to block the input thread waiting for
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2661 a reponse from the lisp thread (although that would at least
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2662 solve the deadlock problem above), because we want to be able
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2663 to receive C-g to interrupt the lisp thread. */
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2664 cancel_all_deferred_msgs ();
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2665 }
69426
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2666 else
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
2667 signal_user_input ();
23950
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2668 }
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2669
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2670 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2671 }
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
2672
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2673 /* Main window procedure */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2674
110975
e0ac9a58795e src/w32*.c: Make functions static.
Juanma Barranquero <lekktu@gmail.com>
parents: 110540
diff changeset
2675 static LRESULT CALLBACK
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
2676 w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2677 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2678 struct frame *f;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
2679 struct w32_display_info *dpyinfo = &one_w32_display_info;
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
2680 W32Msg wmsg;
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
2681 int windows_translate;
24206
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2682 int key;
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
2683
15650
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2684 /* Note that it is okay to call x_window_to_frame, even though we are
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2685 not running in the main lisp thread, because frame deletion
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2686 requires the lisp thread to synchronize with this thread. Thus, if
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2687 a frame struct is returned, it can be used without concern that the
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2688 lisp thread might make it disappear while we are using it.
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2689
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2690 NB. Walking the frame list in this thread is safe (as long as
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2691 writes of Lisp_Object slots are atomic, which they are on Windows).
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2692 Although delete-frame can destructively modify the frame list while
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2693 we are walking it, a garbage collection cannot occur until after
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2694 delete-frame has synchronized with this thread.
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2695
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2696 It is also safe to use functions that make GDI calls, such as
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
2697 w32_clear_rect, because these functions must obtain a DC handle
15650
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2698 from the frame struct using get_frame_dc which is thread-aware. */
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2699
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
2700 switch (msg)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2701 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2702 case WM_ERASEBKGND:
15650
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2703 f = x_window_to_frame (dpyinfo, hwnd);
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2704 if (f)
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2705 {
27407
7df920562cbe (w32_defined_color): Apply gamma correction before trying to map to
Jason Rumney <jasonr@gnu.org>
parents: 27397
diff changeset
2706 HDC hdc = get_frame_dc (f);
15650
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2707 GetUpdateRect (hwnd, &wmsg.rect, FALSE);
27407
7df920562cbe (w32_defined_color): Apply gamma correction before trying to map to
Jason Rumney <jasonr@gnu.org>
parents: 27397
diff changeset
2708 w32_clear_rect (f, hdc, &wmsg.rect);
7df920562cbe (w32_defined_color): Apply gamma correction before trying to map to
Jason Rumney <jasonr@gnu.org>
parents: 27397
diff changeset
2709 release_frame_dc (f, hdc);
24718
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
2710
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
2711 #if defined (W32_DEBUG_DISPLAY)
39128
42efaa34094a (w32_createwindow): Remove the WS_CLIPCHILDREN style
Andrew Innes <andrewi@gnu.org>
parents: 37707
diff changeset
2712 DebPrint (("WM_ERASEBKGND (frame %p): erasing %d,%d-%d,%d\n",
42efaa34094a (w32_createwindow): Remove the WS_CLIPCHILDREN style
Andrew Innes <andrewi@gnu.org>
parents: 37707
diff changeset
2713 f,
42efaa34094a (w32_createwindow): Remove the WS_CLIPCHILDREN style
Andrew Innes <andrewi@gnu.org>
parents: 37707
diff changeset
2714 wmsg.rect.left, wmsg.rect.top,
42efaa34094a (w32_createwindow): Remove the WS_CLIPCHILDREN style
Andrew Innes <andrewi@gnu.org>
parents: 37707
diff changeset
2715 wmsg.rect.right, wmsg.rect.bottom));
24718
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
2716 #endif /* W32_DEBUG_DISPLAY */
15650
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2717 }
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2718 return 1;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2719 case WM_PALETTECHANGED:
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2720 /* ignore our own changes */
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2721 if ((HWND)wParam != hwnd)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2722 {
15650
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2723 f = x_window_to_frame (dpyinfo, hwnd);
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2724 if (f)
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2725 /* get_frame_dc will realize our palette and force all
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2726 frames to be redrawn if needed. */
bc9525478463 (win32_wnd_proc): Handle WM_ERASEBKGND and
Karl Heuer <kwzh@gnu.org>
parents: 15459
diff changeset
2727 release_frame_dc (f, get_frame_dc (f));
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2728 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
2729 return 0;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2730 case WM_PAINT:
24718
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
2731 {
24670
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2732 PAINTSTRUCT paintStruct;
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2733 RECT update_rect;
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109160
diff changeset
2734 memset (&update_rect, 0, sizeof (update_rect));
24670
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2735
39128
42efaa34094a (w32_createwindow): Remove the WS_CLIPCHILDREN style
Andrew Innes <andrewi@gnu.org>
parents: 37707
diff changeset
2736 f = x_window_to_frame (dpyinfo, hwnd);
42efaa34094a (w32_createwindow): Remove the WS_CLIPCHILDREN style
Andrew Innes <andrewi@gnu.org>
parents: 37707
diff changeset
2737 if (f == 0)
42efaa34094a (w32_createwindow): Remove the WS_CLIPCHILDREN style
Andrew Innes <andrewi@gnu.org>
parents: 37707
diff changeset
2738 {
42efaa34094a (w32_createwindow): Remove the WS_CLIPCHILDREN style
Andrew Innes <andrewi@gnu.org>
parents: 37707
diff changeset
2739 DebPrint (("WM_PAINT received for unknown window %p\n", hwnd));
42efaa34094a (w32_createwindow): Remove the WS_CLIPCHILDREN style
Andrew Innes <andrewi@gnu.org>
parents: 37707
diff changeset
2740 return 0;
42efaa34094a (w32_createwindow): Remove the WS_CLIPCHILDREN style
Andrew Innes <andrewi@gnu.org>
parents: 37707
diff changeset
2741 }
42efaa34094a (w32_createwindow): Remove the WS_CLIPCHILDREN style
Andrew Innes <andrewi@gnu.org>
parents: 37707
diff changeset
2742
24670
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2743 /* MSDN Docs say not to call BeginPaint if GetUpdateRect
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2744 fails. Apparently this can happen under some
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2745 circumstances. */
42935
20a21fb23284 (w32_wnd_proc) <WM_PAINT>: Initialize update_rect.
Jason Rumney <jasonr@gnu.org>
parents: 42918
diff changeset
2746 if (GetUpdateRect (hwnd, &update_rect, FALSE) || !w32_strict_painting)
24670
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2747 {
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2748 enter_crit ();
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2749 BeginPaint (hwnd, &paintStruct);
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2750
42935
20a21fb23284 (w32_wnd_proc) <WM_PAINT>: Initialize update_rect.
Jason Rumney <jasonr@gnu.org>
parents: 42918
diff changeset
2751 /* The rectangles returned by GetUpdateRect and BeginPaint
20a21fb23284 (w32_wnd_proc) <WM_PAINT>: Initialize update_rect.
Jason Rumney <jasonr@gnu.org>
parents: 42918
diff changeset
2752 do not always match. Play it safe by assuming both areas
20a21fb23284 (w32_wnd_proc) <WM_PAINT>: Initialize update_rect.
Jason Rumney <jasonr@gnu.org>
parents: 42918
diff changeset
2753 are invalid. */
20a21fb23284 (w32_wnd_proc) <WM_PAINT>: Initialize update_rect.
Jason Rumney <jasonr@gnu.org>
parents: 42918
diff changeset
2754 UnionRect (&(wmsg.rect), &update_rect, &(paintStruct.rcPaint));
24670
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2755
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2756 #if defined (W32_DEBUG_DISPLAY)
39128
42efaa34094a (w32_createwindow): Remove the WS_CLIPCHILDREN style
Andrew Innes <andrewi@gnu.org>
parents: 37707
diff changeset
2757 DebPrint (("WM_PAINT (frame %p): painting %d,%d-%d,%d\n",
42efaa34094a (w32_createwindow): Remove the WS_CLIPCHILDREN style
Andrew Innes <andrewi@gnu.org>
parents: 37707
diff changeset
2758 f,
42efaa34094a (w32_createwindow): Remove the WS_CLIPCHILDREN style
Andrew Innes <andrewi@gnu.org>
parents: 37707
diff changeset
2759 wmsg.rect.left, wmsg.rect.top,
42efaa34094a (w32_createwindow): Remove the WS_CLIPCHILDREN style
Andrew Innes <andrewi@gnu.org>
parents: 37707
diff changeset
2760 wmsg.rect.right, wmsg.rect.bottom));
42efaa34094a (w32_createwindow): Remove the WS_CLIPCHILDREN style
Andrew Innes <andrewi@gnu.org>
parents: 37707
diff changeset
2761 DebPrint ((" [update region is %d,%d-%d,%d]\n",
24670
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2762 update_rect.left, update_rect.top,
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2763 update_rect.right, update_rect.bottom));
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2764 #endif
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2765 EndPaint (hwnd, &paintStruct);
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2766 leave_crit ();
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2767
102584
5cd33b0be96f * w32term.h (WM_EMACS_PAINT): New message.
Jason Rumney <jasonr@gnu.org>
parents: 102394
diff changeset
2768 /* Change the message type to prevent Windows from
5cd33b0be96f * w32term.h (WM_EMACS_PAINT): New message.
Jason Rumney <jasonr@gnu.org>
parents: 102394
diff changeset
2769 combining WM_PAINT messages in the Lisp thread's queue,
5cd33b0be96f * w32term.h (WM_EMACS_PAINT): New message.
Jason Rumney <jasonr@gnu.org>
parents: 102394
diff changeset
2770 since Windows assumes that each message queue is
5cd33b0be96f * w32term.h (WM_EMACS_PAINT): New message.
Jason Rumney <jasonr@gnu.org>
parents: 102394
diff changeset
2771 dedicated to one frame and does not bother checking
5cd33b0be96f * w32term.h (WM_EMACS_PAINT): New message.
Jason Rumney <jasonr@gnu.org>
parents: 102394
diff changeset
2772 that hwnd matches before combining them. */
5cd33b0be96f * w32term.h (WM_EMACS_PAINT): New message.
Jason Rumney <jasonr@gnu.org>
parents: 102394
diff changeset
2773 my_post_msg (&wmsg, hwnd, WM_EMACS_PAINT, wParam, lParam);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
2774
24670
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2775 return 0;
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
2776 }
24695
2fe2c743ce68 (w32_strict_painting): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24692
diff changeset
2777
2fe2c743ce68 (w32_strict_painting): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24692
diff changeset
2778 /* If GetUpdateRect returns 0 (meaning there is no update
2fe2c743ce68 (w32_strict_painting): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24692
diff changeset
2779 region), assume the whole window needs to be repainted. */
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
2780 GetClientRect (hwnd, &wmsg.rect);
24695
2fe2c743ce68 (w32_strict_painting): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24692
diff changeset
2781 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
2fe2c743ce68 (w32_strict_painting): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24692
diff changeset
2782 return 0;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2783 }
14461
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2784
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2785 case WM_INPUTLANGCHANGE:
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2786 /* Inform lisp thread of keyboard layout changes. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2787 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2788
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2789 /* Clear dead keys in the keyboard state; for simplicity only
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2790 preserve modifier key states. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2791 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2792 int i;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2793 BYTE keystate[256];
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2794
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2795 GetKeyboardState (keystate);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2796 for (i = 0; i < 256; i++)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2797 if (1
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2798 && i != VK_SHIFT
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2799 && i != VK_LSHIFT
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2800 && i != VK_RSHIFT
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2801 && i != VK_CAPITAL
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2802 && i != VK_NUMLOCK
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2803 && i != VK_SCROLL
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2804 && i != VK_CONTROL
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2805 && i != VK_LCONTROL
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2806 && i != VK_RCONTROL
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2807 && i != VK_MENU
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2808 && i != VK_LMENU
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2809 && i != VK_RMENU
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2810 && i != VK_LWIN
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2811 && i != VK_RWIN)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2812 keystate[i] = 0;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2813 SetKeyboardState (keystate);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2814 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2815 goto dflt;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2816
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2817 case WM_HOTKEY:
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2818 /* Synchronize hot keys with normal input. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2819 PostMessage (hwnd, WM_KEYDOWN, HIWORD (lParam), 0);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2820 return (0);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2821
14461
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2822 case WM_KEYUP:
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2823 case WM_SYSKEYUP:
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2824 record_keyup (wParam, lParam);
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2825 goto dflt;
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2826
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2827 case WM_KEYDOWN:
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
2828 case WM_SYSKEYDOWN:
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2829 /* Ignore keystrokes we fake ourself; see below. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2830 if (dpyinfo->faked_key == wParam)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2831 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2832 dpyinfo->faked_key = 0;
24206
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2833 /* Make sure TranslateMessage sees them though (as long as
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2834 they don't produce WM_CHAR messages). This ensures that
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2835 indicator lights are toggled promptly on Windows 9x, for
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2836 example. */
79563
fb6105cb466b (w32_wnd_proc, Fw32_reconstruct_hot_key): Range check
Jason Rumney <jasonr@gnu.org>
parents: 79393
diff changeset
2837 if (wParam < 256 && lispy_function_keys[wParam])
24206
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2838 {
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2839 windows_translate = 1;
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2840 goto translate;
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2841 }
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2842 return 0;
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2843 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2844
15377
65d9ff2c8602 (sync_modifiers): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15314
diff changeset
2845 /* Synchronize modifiers with current keystroke. */
65d9ff2c8602 (sync_modifiers): New function.
Richard M. Stallman <rms@gnu.org>
parents: 15314
diff changeset
2846 sync_modifiers ();
14461
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
2847 record_keydown (wParam, lParam);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2848 wParam = map_keypad_keys (wParam, (lParam & 0x1000000L) != 0);
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
2849
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
2850 windows_translate = 0;
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2851
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2852 switch (wParam)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2853 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2854 case VK_LWIN:
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2855 if (NILP (Vw32_pass_lwindow_to_system))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2856 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2857 /* Prevent system from acting on keyup (which opens the
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2858 Start menu if no other key was pressed) by simulating a
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2859 press of Space which we will ignore. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2860 if (GetAsyncKeyState (wParam) & 1)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2861 {
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2862 if (NUMBERP (Vw32_phantom_key_code))
24206
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2863 key = XUINT (Vw32_phantom_key_code) & 255;
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2864 else
24206
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2865 key = VK_SPACE;
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2866 dpyinfo->faked_key = key;
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2867 keybd_event (key, (BYTE) MapVirtualKey (key, 0), 0, 0);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2868 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2869 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2870 if (!NILP (Vw32_lwindow_modifier))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2871 return 0;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2872 break;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2873 case VK_RWIN:
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2874 if (NILP (Vw32_pass_rwindow_to_system))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2875 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2876 if (GetAsyncKeyState (wParam) & 1)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2877 {
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2878 if (NUMBERP (Vw32_phantom_key_code))
24206
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2879 key = XUINT (Vw32_phantom_key_code) & 255;
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2880 else
24206
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2881 key = VK_SPACE;
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2882 dpyinfo->faked_key = key;
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2883 keybd_event (key, (BYTE) MapVirtualKey (key, 0), 0, 0);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2884 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2885 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2886 if (!NILP (Vw32_rwindow_modifier))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2887 return 0;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2888 break;
24206
d3649b38bb37 (w32_wnd_proc): Fix bug introduced by previous change;
Andrew Innes <andrewi@gnu.org>
parents: 24147
diff changeset
2889 case VK_APPS:
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2890 if (!NILP (Vw32_apps_modifier))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2891 return 0;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2892 break;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2893 case VK_MENU:
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
2894 if (NILP (Vw32_pass_alt_to_system))
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2895 /* Prevent DefWindowProc from activating the menu bar if an
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2896 Alt key is pressed and released by itself. */
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2897 return 0;
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
2898 windows_translate = 1;
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2899 break;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
2900 case VK_CAPITAL:
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2901 /* Decide whether to treat as modifier or function key. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2902 if (NILP (Vw32_enable_caps_lock))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2903 goto disable_lock_key;
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2904 windows_translate = 1;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2905 break;
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2906 case VK_NUMLOCK:
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2907 /* Decide whether to treat as modifier or function key. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2908 if (NILP (Vw32_enable_num_lock))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2909 goto disable_lock_key;
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2910 windows_translate = 1;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2911 break;
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2912 case VK_SCROLL:
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2913 /* Decide whether to treat as modifier or function key. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2914 if (NILP (Vw32_scroll_lock_modifier))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2915 goto disable_lock_key;
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2916 windows_translate = 1;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2917 break;
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2918 disable_lock_key:
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2919 /* Ensure the appropriate lock key state (and indicator light)
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2920 remains in the same state. We do this by faking another
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2921 press of the relevant key. Apparently, this really is the
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2922 only way to toggle the state of the indicator lights. */
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2923 dpyinfo->faked_key = wParam;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2924 keybd_event ((BYTE) wParam, (BYTE) MapVirtualKey (wParam, 0),
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2925 KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2926 keybd_event ((BYTE) wParam, (BYTE) MapVirtualKey (wParam, 0),
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2927 KEYEVENTF_EXTENDEDKEY | 0, 0);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2928 keybd_event ((BYTE) wParam, (BYTE) MapVirtualKey (wParam, 0),
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2929 KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2930 /* Ensure indicator lights are updated promptly on Windows 9x
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2931 (TranslateMessage apparently does this), after forwarding
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2932 input event. */
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2933 post_character_message (hwnd, msg, wParam, lParam,
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2934 w32_get_key_modifiers (wParam, lParam));
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2935 windows_translate = 1;
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2936 break;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
2937 case VK_CONTROL:
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2938 case VK_SHIFT:
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2939 case VK_PROCESSKEY: /* Generated by IME. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2940 windows_translate = 1;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2941 break;
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2942 case VK_CANCEL:
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2943 /* Windows maps Ctrl-Pause (aka Ctrl-Break) into VK_CANCEL,
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2944 which is confusing for purposes of key binding; convert
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2945 VK_CANCEL events into VK_PAUSE events. */
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2946 wParam = VK_PAUSE;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2947 break;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2948 case VK_PAUSE:
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2949 /* Windows maps Ctrl-NumLock into VK_PAUSE, which is confusing
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2950 for purposes of key binding; convert these back into
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2951 VK_NUMLOCK events, at least when we want to see NumLock key
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2952 presses. (Note that there is never any possibility that
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2953 VK_PAUSE with Ctrl really is C-Pause as per above.) */
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2954 if (NILP (Vw32_enable_num_lock) && modifier_set (VK_CONTROL))
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2955 wParam = VK_NUMLOCK;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2956 break;
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2957 default:
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2958 /* If not defined as a function key, change it to a WM_CHAR message. */
79563
fb6105cb466b (w32_wnd_proc, Fw32_reconstruct_hot_key): Range check
Jason Rumney <jasonr@gnu.org>
parents: 79393
diff changeset
2959 if (wParam > 255 || !lispy_function_keys[wParam])
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2960 {
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2961 DWORD modifiers = construct_console_modifiers ();
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2962
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2963 if (!NILP (Vw32_recognize_altgr)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2964 && modifier_set (VK_LCONTROL) && modifier_set (VK_RMENU))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2965 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2966 /* Always let TranslateMessage handle AltGr key chords;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2967 for some reason, ToAscii doesn't always process AltGr
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2968 chords correctly. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2969 windows_translate = 1;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2970 }
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2971 else if ((modifiers & (~SHIFT_PRESSED & ~CAPSLOCK_ON)) != 0)
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2972 {
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2973 /* Handle key chords including any modifiers other
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2974 than shift directly, in order to preserve as much
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
2975 modifier information as possible. */
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2976 if ('A' <= wParam && wParam <= 'Z')
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2977 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2978 /* Don't translate modified alphabetic keystrokes,
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2979 so the user doesn't need to constantly switch
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2980 layout to type control or meta keystrokes when
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2981 the normal layout translates alphabetic
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2982 characters to non-ascii characters. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2983 if (!modifier_set (VK_SHIFT))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2984 wParam += ('a' - 'A');
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2985 msg = WM_CHAR;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2986 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2987 else
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2988 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2989 /* Try to handle other keystrokes by determining the
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2990 base character (ie. translating the base key plus
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2991 shift modifier). */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2992 int add;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2993 int isdead = 0;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2994 KEY_EVENT_RECORD key;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
2995
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2996 key.bKeyDown = TRUE;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2997 key.wRepeatCount = 1;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2998 key.wVirtualKeyCode = wParam;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
2999 key.wVirtualScanCode = (lParam & 0xFF0000) >> 16;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3000 key.uChar.AsciiChar = 0;
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
3001 key.dwControlKeyState = modifiers;
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3002
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3003 add = w32_kbd_patch_key (&key);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3004 /* 0 means an unrecognised keycode, negative means
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3005 dead key. Ignore both. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3006 while (--add >= 0)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3007 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3008 /* Forward asciified character sequence. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3009 post_character_message
79578
f54781f97950 (w32_wnd_proc) <WM_KEYDOWN>: Cast char to unsigned before passing as wParam.
Jason Rumney <jasonr@gnu.org>
parents: 79563
diff changeset
3010 (hwnd, WM_CHAR,
f54781f97950 (w32_wnd_proc) <WM_KEYDOWN>: Cast char to unsigned before passing as wParam.
Jason Rumney <jasonr@gnu.org>
parents: 79563
diff changeset
3011 (unsigned char) key.uChar.AsciiChar, lParam,
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3012 w32_get_key_modifiers (wParam, lParam));
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3013 w32_kbd_patch_key (&key);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3014 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3015 return 0;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3016 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3017 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3018 else
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3019 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3020 /* Let TranslateMessage handle everything else. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3021 windows_translate = 1;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3022 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3023 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3024 }
14461
4fe9540be594 (modifiers, modifier_key_support_tested,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14353
diff changeset
3025
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
3026 translate:
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3027 if (windows_translate)
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3028 {
16884
36babc489b0c Change all uses of win95, winnt, and win32
Geoff Voelker <voelker@cs.washington.edu>
parents: 16602
diff changeset
3029 MSG windows_msg = { hwnd, msg, wParam, lParam, 0, {0,0} };
36babc489b0c Change all uses of win95, winnt, and win32
Geoff Voelker <voelker@cs.washington.edu>
parents: 16602
diff changeset
3030 windows_msg.time = GetMessageTime ();
36babc489b0c Change all uses of win95, winnt, and win32
Geoff Voelker <voelker@cs.washington.edu>
parents: 16602
diff changeset
3031 TranslateMessage (&windows_msg);
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3032 goto dflt;
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3033 }
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3034
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3035 /* Fall through */
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3036
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3037 case WM_SYSCHAR:
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3038 case WM_CHAR:
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3039 post_character_message (hwnd, msg, wParam, lParam,
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3040 w32_get_key_modifiers (wParam, lParam));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3041 break;
14810
4dd6867765b9 (Vwin32_pass_alt_to_system,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14461
diff changeset
3042
91099
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3043 case WM_UNICHAR:
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3044 /* WM_UNICHAR looks promising from the docs, but the exact
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3045 circumstances in which TranslateMessage sends it is one of those
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3046 Microsoft secret API things that EU and US courts are supposed
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3047 to have put a stop to already. Spy++ shows it being sent to Notepad
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3048 and other MS apps, but never to Emacs.
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3049
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3050 Some third party IMEs send it in accordance with the official
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3051 documentation though, so handle it here.
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3052
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3053 UNICODE_NOCHAR is used to test for support for this message.
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3054 TRUE indicates that the message is supported. */
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3055 if (wParam == UNICODE_NOCHAR)
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3056 return TRUE;
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3057
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3058 {
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3059 W32Msg wmsg;
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3060 wmsg.dwModifiers = w32_get_key_modifiers (wParam, lParam);
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3061 signal_user_input ();
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3062 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3063 }
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3064 break;
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3065
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3066 case WM_IME_CHAR:
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3067 /* If we can't get the IME result as unicode, use default processing,
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3068 which will at least allow characters decodable in the system locale
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3069 get through. */
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3070 if (!get_composition_string_fn)
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3071 goto dflt;
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3072
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3073 else if (!ignore_ime_char)
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3074 {
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3075 wchar_t * buffer;
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3076 int size, i;
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3077 W32Msg wmsg;
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3078 HIMC context = get_ime_context_fn (hwnd);
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3079 wmsg.dwModifiers = w32_get_key_modifiers (wParam, lParam);
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3080 /* Get buffer size. */
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3081 size = get_composition_string_fn (context, GCS_RESULTSTR, buffer, 0);
110994
734b2470f93c src/w32*.c: Whitespace fixes and typos.
Juanma Barranquero <lekktu@gmail.com>
parents: 109701
diff changeset
3082 buffer = alloca (size);
91099
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3083 size = get_composition_string_fn (context, GCS_RESULTSTR,
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3084 buffer, size);
104030
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3085 release_ime_context_fn (hwnd, context);
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3086
91099
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3087 signal_user_input ();
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3088 for (i = 0; i < size / sizeof (wchar_t); i++)
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3089 {
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3090 my_post_msg (&wmsg, hwnd, WM_UNICHAR, (WPARAM) buffer[i],
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3091 lParam);
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3092 }
102394
f978553ef98f (w32_wnd_proc): Only ignore IME messages for the
Jason Rumney <jasonr@gnu.org>
parents: 101901
diff changeset
3093 /* Ignore the messages for the rest of the
f978553ef98f (w32_wnd_proc): Only ignore IME messages for the
Jason Rumney <jasonr@gnu.org>
parents: 101901
diff changeset
3094 characters in the string that was output above. */
f978553ef98f (w32_wnd_proc): Only ignore IME messages for the
Jason Rumney <jasonr@gnu.org>
parents: 101901
diff changeset
3095 ignore_ime_char = (size / sizeof (wchar_t)) - 1;
91099
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3096 }
102394
f978553ef98f (w32_wnd_proc): Only ignore IME messages for the
Jason Rumney <jasonr@gnu.org>
parents: 101901
diff changeset
3097 else
f978553ef98f (w32_wnd_proc): Only ignore IME messages for the
Jason Rumney <jasonr@gnu.org>
parents: 101901
diff changeset
3098 ignore_ime_char--;
f978553ef98f (w32_wnd_proc): Only ignore IME messages for the
Jason Rumney <jasonr@gnu.org>
parents: 101901
diff changeset
3099
91099
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3100 break;
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3101
104030
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3102 case WM_IME_STARTCOMPOSITION:
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3103 if (!set_ime_composition_window_fn)
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3104 goto dflt;
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3105 else
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3106 {
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3107 COMPOSITIONFORM form;
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3108 HIMC context;
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3109 struct window *w;
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3110
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3111 f = x_window_to_frame (dpyinfo, hwnd);
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3112 w = XWINDOW (FRAME_SELECTED_WINDOW (f));
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3113
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3114 form.dwStyle = CFS_RECT;
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3115 form.ptCurrentPos.x = w32_system_caret_x;
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3116 form.ptCurrentPos.y = w32_system_caret_y;
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3117
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3118 form.rcArea.left = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, 0);
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3119 form.rcArea.top = (WINDOW_TOP_EDGE_Y (w)
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3120 + WINDOW_HEADER_LINE_HEIGHT (w));
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3121 form.rcArea.right = (WINDOW_BOX_RIGHT_EDGE_X (w)
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3122 - WINDOW_RIGHT_MARGIN_WIDTH (w)
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3123 - WINDOW_RIGHT_FRINGE_WIDTH (w));
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3124 form.rcArea.bottom = (WINDOW_BOTTOM_EDGE_Y (w)
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3125 - WINDOW_MODE_LINE_HEIGHT (w));
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3126
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3127 context = get_ime_context_fn (hwnd);
109880
22ddbf1e2954 (w32_wnd_proc): Don't check context before initializing.
Jason Rumney <jasonr@gnu.org>
parents: 109818
diff changeset
3128
22ddbf1e2954 (w32_wnd_proc): Don't check context before initializing.
Jason Rumney <jasonr@gnu.org>
parents: 109818
diff changeset
3129 if (!context)
22ddbf1e2954 (w32_wnd_proc): Don't check context before initializing.
Jason Rumney <jasonr@gnu.org>
parents: 109818
diff changeset
3130 break;
22ddbf1e2954 (w32_wnd_proc): Don't check context before initializing.
Jason Rumney <jasonr@gnu.org>
parents: 109818
diff changeset
3131
104030
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3132 set_ime_composition_window_fn (context, &form);
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3133 release_ime_context_fn (hwnd, context);
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3134 }
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3135 break;
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
3136
91099
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3137 case WM_IME_ENDCOMPOSITION:
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3138 ignore_ime_char = 0;
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3139 goto dflt;
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
3140
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3141 /* Simulate middle mouse button events when left and right buttons
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3142 are used together, but only if user has two button mouse. */
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3143 case WM_LBUTTONDOWN:
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3144 case WM_RBUTTONDOWN:
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
3145 if (w32_num_mouse_buttons > 2)
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3146 goto handle_plain_button;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3148 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3149 int this = (msg == WM_LBUTTONDOWN) ? LMOUSE : RMOUSE;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3150 int other = (msg == WM_LBUTTONDOWN) ? RMOUSE : LMOUSE;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3151
15205
0f5d6cd72e21 (win_msg_worker): Use post_msg.
Richard M. Stallman <rms@gnu.org>
parents: 15148
diff changeset
3152 if (button_state & this)
0f5d6cd72e21 (win_msg_worker): Use post_msg.
Richard M. Stallman <rms@gnu.org>
parents: 15148
diff changeset
3153 return 0;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3154
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3155 if (button_state == 0)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3156 SetCapture (hwnd);
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3157
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3158 button_state |= this;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3159
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3160 if (button_state & other)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3161 {
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3162 if (mouse_button_timer)
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3163 {
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3164 KillTimer (hwnd, mouse_button_timer);
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3165 mouse_button_timer = 0;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3166
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3167 /* Generate middle mouse event instead. */
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3168 msg = WM_MBUTTONDOWN;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3169 button_state |= MMOUSE;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3170 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3171 else if (button_state & MMOUSE)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3172 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3173 /* Ignore button event if we've already generated a
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3174 middle mouse down event. This happens if the
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3175 user releases and press one of the two buttons
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3176 after we've faked a middle mouse event. */
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3177 return 0;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3178 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3179 else
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3180 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3181 /* Flush out saved message. */
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3182 post_msg (&saved_mouse_button_msg);
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3183 }
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
3184 wmsg.dwModifiers = w32_get_modifiers ();
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3185 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
70233
589489bb1924 (w32_wnd_proc) <WM_LBUTTONDOWN, WM_RBUTTONDOWN>:
Jason Rumney <jasonr@gnu.org>
parents: 69879
diff changeset
3186 signal_user_input ();
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3187
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3188 /* Clear message buffer. */
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3189 saved_mouse_button_msg.msg.hwnd = 0;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3190 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3191 else
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3192 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3193 /* Hold onto message for now. */
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3194 mouse_button_timer =
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
3195 SetTimer (hwnd, MOUSE_BUTTON_ID,
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
3196 w32_mouse_button_tolerance, NULL);
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3197 saved_mouse_button_msg.msg.hwnd = hwnd;
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3198 saved_mouse_button_msg.msg.message = msg;
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3199 saved_mouse_button_msg.msg.wParam = wParam;
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3200 saved_mouse_button_msg.msg.lParam = lParam;
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3201 saved_mouse_button_msg.msg.time = GetMessageTime ();
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
3202 saved_mouse_button_msg.dwModifiers = w32_get_modifiers ();
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3203 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3204 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3205 return 0;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3206
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3207 case WM_LBUTTONUP:
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3208 case WM_RBUTTONUP:
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
3209 if (w32_num_mouse_buttons > 2)
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3210 goto handle_plain_button;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3211
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3212 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3213 int this = (msg == WM_LBUTTONUP) ? LMOUSE : RMOUSE;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3214 int other = (msg == WM_LBUTTONUP) ? RMOUSE : LMOUSE;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3215
15205
0f5d6cd72e21 (win_msg_worker): Use post_msg.
Richard M. Stallman <rms@gnu.org>
parents: 15148
diff changeset
3216 if ((button_state & this) == 0)
0f5d6cd72e21 (win_msg_worker): Use post_msg.
Richard M. Stallman <rms@gnu.org>
parents: 15148
diff changeset
3217 return 0;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3218
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3219 button_state &= ~this;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3220
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3221 if (button_state & MMOUSE)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3222 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3223 /* Only generate event when second button is released. */
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3224 if ((button_state & other) == 0)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3225 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3226 msg = WM_MBUTTONUP;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3227 button_state &= ~MMOUSE;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3228
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3229 if (button_state) abort ();
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3230 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3231 else
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3232 return 0;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3233 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3234 else
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3235 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3236 /* Flush out saved message if necessary. */
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3237 if (saved_mouse_button_msg.msg.hwnd)
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3238 {
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3239 post_msg (&saved_mouse_button_msg);
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3240 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3241 }
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
3242 wmsg.dwModifiers = w32_get_modifiers ();
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3243 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
70233
589489bb1924 (w32_wnd_proc) <WM_LBUTTONDOWN, WM_RBUTTONDOWN>:
Jason Rumney <jasonr@gnu.org>
parents: 69879
diff changeset
3244 signal_user_input ();
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3245
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3246 /* Always clear message buffer and cancel timer. */
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3247 saved_mouse_button_msg.msg.hwnd = 0;
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3248 KillTimer (hwnd, mouse_button_timer);
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3249 mouse_button_timer = 0;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3250
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3251 if (button_state == 0)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3252 ReleaseCapture ();
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3253 }
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3254 return 0;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3255
42719
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
3256 case WM_XBUTTONDOWN:
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
3257 case WM_XBUTTONUP:
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
3258 if (w32_pass_extra_mouse_buttons_to_system)
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
3259 goto dflt;
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
3260 /* else fall through and process them. */
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3261 case WM_MBUTTONDOWN:
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3262 case WM_MBUTTONUP:
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3263 handle_plain_button:
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3264 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3265 BOOL up;
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3266 int button;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3267
69406
8b54066613d1 (w32_wnd_proc): Ignore middle and extra button events if a menu is already
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3268 /* Ignore middle and extra buttons as long as the menu is active. */
8b54066613d1 (w32_wnd_proc): Ignore middle and extra button events if a menu is already
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3269 f = x_window_to_frame (dpyinfo, hwnd);
8b54066613d1 (w32_wnd_proc): Ignore middle and extra button events if a menu is already
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3270 if (f && f->output_data.w32->menubar_active)
8b54066613d1 (w32_wnd_proc): Ignore middle and extra button events if a menu is already
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3271 return 0;
8b54066613d1 (w32_wnd_proc): Ignore middle and extra button events if a menu is already
Eli Zaretskii <eliz@gnu.org>
parents: 68651
diff changeset
3272
42719
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
3273 if (parse_button (msg, HIWORD (wParam), &button, &up))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3274 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3275 if (up) ReleaseCapture ();
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3276 else SetCapture (hwnd);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3277 button = (button == 0) ? LMOUSE :
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3278 ((button == 1) ? MMOUSE : RMOUSE);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3279 if (up)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3280 button_state &= ~button;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3281 else
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3282 button_state |= button;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3283 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3284 }
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3285
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
3286 wmsg.dwModifiers = w32_get_modifiers ();
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3287 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
69426
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
3288 signal_user_input ();
42719
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
3289
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
3290 /* Need to return true for XBUTTON messages, false for others,
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
3291 to indicate that we processed the message. */
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
3292 return (msg == WM_XBUTTONDOWN || msg == WM_XBUTTONUP);
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3293
41732
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3294 case WM_MOUSEMOVE:
69879
a3c24f2249c9 (w32_wnd_proc) <WM_MOUSEMOVE>: Ignore mouse movements if a menu is active
Eli Zaretskii <eliz@gnu.org>
parents: 69867
diff changeset
3295 /* Ignore mouse movements as long as the menu is active. These
a3c24f2249c9 (w32_wnd_proc) <WM_MOUSEMOVE>: Ignore mouse movements if a menu is active
Eli Zaretskii <eliz@gnu.org>
parents: 69867
diff changeset
3296 movements are processed by the window manager anyway, and
a3c24f2249c9 (w32_wnd_proc) <WM_MOUSEMOVE>: Ignore mouse movements if a menu is active
Eli Zaretskii <eliz@gnu.org>
parents: 69867
diff changeset
3297 it's wrong to handle them as if they happened on the
a3c24f2249c9 (w32_wnd_proc) <WM_MOUSEMOVE>: Ignore mouse movements if a menu is active
Eli Zaretskii <eliz@gnu.org>
parents: 69867
diff changeset
3298 underlying frame. */
a3c24f2249c9 (w32_wnd_proc) <WM_MOUSEMOVE>: Ignore mouse movements if a menu is active
Eli Zaretskii <eliz@gnu.org>
parents: 69867
diff changeset
3299 f = x_window_to_frame (dpyinfo, hwnd);
a3c24f2249c9 (w32_wnd_proc) <WM_MOUSEMOVE>: Ignore mouse movements if a menu is active
Eli Zaretskii <eliz@gnu.org>
parents: 69867
diff changeset
3300 if (f && f->output_data.w32->menubar_active)
a3c24f2249c9 (w32_wnd_proc) <WM_MOUSEMOVE>: Ignore mouse movements if a menu is active
Eli Zaretskii <eliz@gnu.org>
parents: 69867
diff changeset
3301 return 0;
a3c24f2249c9 (w32_wnd_proc) <WM_MOUSEMOVE>: Ignore mouse movements if a menu is active
Eli Zaretskii <eliz@gnu.org>
parents: 69867
diff changeset
3302
41732
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3303 /* If the mouse has just moved into the frame, start tracking
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3304 it, so we will be notified when it leaves the frame. Mouse
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3305 tracking only works under W98 and NT4 and later. On earlier
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3306 versions, there is no way of telling when the mouse leaves the
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3307 frame, so we just have to put up with help-echo and mouse
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3308 highlighting remaining while the frame is not active. */
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3309 if (track_mouse_event_fn && !track_mouse_window)
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3310 {
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3311 TRACKMOUSEEVENT tme;
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3312 tme.cbSize = sizeof (tme);
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3313 tme.dwFlags = TME_LEAVE;
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3314 tme.hwndTrack = hwnd;
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3315
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3316 track_mouse_event_fn (&tme);
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3317 track_mouse_window = hwnd;
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3318 }
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3319 case WM_VSCROLL:
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
3320 if (w32_mouse_move_interval <= 0
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3321 || (msg == WM_MOUSEMOVE && button_state == 0))
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3322 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
3323 wmsg.dwModifiers = w32_get_modifiers ();
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3324 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3325 return 0;
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3326 }
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3327
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3328 /* Hang onto mouse move and scroll messages for a bit, to avoid
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3329 sending such events to Emacs faster than it can process them.
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3330 If we get more events before the timer from the first message
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3331 expires, we just replace the first message. */
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3332
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3333 if (saved_mouse_move_msg.msg.hwnd == 0)
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3334 mouse_move_timer =
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
3335 SetTimer (hwnd, MOUSE_MOVE_ID,
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
3336 w32_mouse_move_interval, NULL);
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3337
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3338 /* Hold onto message for now. */
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3339 saved_mouse_move_msg.msg.hwnd = hwnd;
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3340 saved_mouse_move_msg.msg.message = msg;
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3341 saved_mouse_move_msg.msg.wParam = wParam;
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3342 saved_mouse_move_msg.msg.lParam = lParam;
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3343 saved_mouse_move_msg.msg.time = GetMessageTime ();
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
3344 saved_mouse_move_msg.dwModifiers = w32_get_modifiers ();
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3345
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3346 return 0;
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3347
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3348 case WM_MOUSEWHEEL:
21884
bc4455bca454 Include shellapi.h.
Richard M. Stallman <rms@gnu.org>
parents: 21874
diff changeset
3349 case WM_DROPFILES:
bc4455bca454 Include shellapi.h.
Richard M. Stallman <rms@gnu.org>
parents: 21874
diff changeset
3350 wmsg.dwModifiers = w32_get_modifiers ();
bc4455bca454 Include shellapi.h.
Richard M. Stallman <rms@gnu.org>
parents: 21874
diff changeset
3351 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
69426
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
3352 signal_user_input ();
21884
bc4455bca454 Include shellapi.h.
Richard M. Stallman <rms@gnu.org>
parents: 21874
diff changeset
3353 return 0;
bc4455bca454 Include shellapi.h.
Richard M. Stallman <rms@gnu.org>
parents: 21874
diff changeset
3354
85979
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
3355 case WM_APPCOMMAND:
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
3356 if (w32_pass_multimedia_buttons_to_system)
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
3357 goto dflt;
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
3358 /* Otherwise, pass to lisp, the same way we do with mousehwheel. */
83878
f65f55d787ec Horizontal mouse wheel support:
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
3359 case WM_MOUSEHWHEEL:
f65f55d787ec Horizontal mouse wheel support:
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
3360 wmsg.dwModifiers = w32_get_modifiers ();
f65f55d787ec Horizontal mouse wheel support:
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
3361 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
f65f55d787ec Horizontal mouse wheel support:
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
3362 signal_user_input ();
f65f55d787ec Horizontal mouse wheel support:
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
3363 /* Non-zero must be returned when WM_MOUSEHWHEEL messages are
f65f55d787ec Horizontal mouse wheel support:
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
3364 handled, to prevent the system trying to handle it by faking
f65f55d787ec Horizontal mouse wheel support:
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
3365 scroll bar events. */
f65f55d787ec Horizontal mouse wheel support:
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
3366 return 1;
f65f55d787ec Horizontal mouse wheel support:
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
3367
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3368 case WM_TIMER:
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3369 /* Flush out saved messages if necessary. */
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3370 if (wParam == mouse_button_timer)
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3371 {
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3372 if (saved_mouse_button_msg.msg.hwnd)
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3373 {
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3374 post_msg (&saved_mouse_button_msg);
69426
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
3375 signal_user_input ();
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3376 saved_mouse_button_msg.msg.hwnd = 0;
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3377 }
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3378 KillTimer (hwnd, mouse_button_timer);
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3379 mouse_button_timer = 0;
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3380 }
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3381 else if (wParam == mouse_move_timer)
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3382 {
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3383 if (saved_mouse_move_msg.msg.hwnd)
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3384 {
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3385 post_msg (&saved_mouse_move_msg);
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3386 saved_mouse_move_msg.msg.hwnd = 0;
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3387 }
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3388 KillTimer (hwnd, mouse_move_timer);
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3389 mouse_move_timer = 0;
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3390 }
43472
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3391 else if (wParam == menu_free_timer)
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3392 {
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3393 KillTimer (hwnd, menu_free_timer);
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3394 menu_free_timer = 0;
43484
a3cecd273126 (w32_wnd_proc) <WM_TIMER>: Fix last change.
Jason Rumney <jasonr@gnu.org>
parents: 43472
diff changeset
3395 f = x_window_to_frame (dpyinfo, hwnd);
76075
25965473846d (current_popup_menu): Use from w32menu.c.
Jason Rumney <jasonr@gnu.org>
parents: 75348
diff changeset
3396 /* If a popup menu is active, don't wipe its strings. */
76083
5e1d8f9b52ea * w32fns.c (menubar_in_use): New flag.
Jason Rumney <jasonr@gnu.org>
parents: 76078
diff changeset
3397 if (menubar_in_use
76075
25965473846d (current_popup_menu): Use from w32menu.c.
Jason Rumney <jasonr@gnu.org>
parents: 75348
diff changeset
3398 && current_popup_menu == NULL)
43472
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3399 {
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3400 /* Free memory used by owner-drawn and help-echo strings. */
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3401 w32_free_menu_strings (hwnd);
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3402 f->output_data.w32->menubar_active = 0;
76083
5e1d8f9b52ea * w32fns.c (menubar_in_use): New flag.
Jason Rumney <jasonr@gnu.org>
parents: 76078
diff changeset
3403 menubar_in_use = 0;
43472
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3404 }
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3405 }
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3406 else if (wParam == hourglass_timer)
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3407 {
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3408 KillTimer (hwnd, hourglass_timer);
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3409 hourglass_timer = 0;
96674
ff312a846b25 * w32fns.c (Fx_create_frame): Remove duplicate unwind_protect.
Jason Rumney <jasonr@gnu.org>
parents: 96664
diff changeset
3410 w32_show_hourglass (x_window_to_frame (dpyinfo, hwnd));
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3411 }
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3412 return 0;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3413
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3414 case WM_NCACTIVATE:
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3415 /* Windows doesn't send us focus messages when putting up and
16884
36babc489b0c Change all uses of win95, winnt, and win32
Geoff Voelker <voelker@cs.washington.edu>
parents: 16602
diff changeset
3416 taking down a system popup dialog as for Ctrl-Alt-Del on Windows 95.
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3417 The only indication we get that something happened is receiving
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3418 this message afterwards. So this is a good time to reset our
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3419 keyboard modifiers' state. */
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3420 reset_modifiers ();
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3421 goto dflt;
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
3422
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3423 case WM_INITMENU:
24751
e0eaca5025bc (w32_wnd_proc): Ensure mouse capture is released if
Andrew Innes <andrewi@gnu.org>
parents: 24718
diff changeset
3424 button_state = 0;
e0eaca5025bc (w32_wnd_proc): Ensure mouse capture is released if
Andrew Innes <andrewi@gnu.org>
parents: 24718
diff changeset
3425 ReleaseCapture ();
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3426 /* We must ensure menu bar is fully constructed and up to date
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3427 before allowing user interaction with it. To achieve this
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3428 we send this message to the lisp thread and wait for a
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3429 reply (whose value is not actually needed) to indicate that
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3430 the menu bar is now ready for use, so we can now return.
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3431
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3432 To remain responsive in the meantime, we enter a nested message
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3433 loop that can process all other messages.
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3434
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3435 However, we skip all this if the message results from calling
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3436 TrackPopupMenu - in fact, we must NOT attempt to send the lisp
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3437 thread a message because it is blocked on us at this point. We
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3438 set menubar_active before calling TrackPopupMenu to indicate
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3439 this (there is no possibility of confusion with real menubar
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3440 being active). */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3441
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3442 f = x_window_to_frame (dpyinfo, hwnd);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3443 if (f
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3444 && (f->output_data.w32->menubar_active
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3445 /* We can receive this message even in the absence of a
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3446 menubar (ie. when the system menu is activated) - in this
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3447 case we do NOT want to forward the message, otherwise it
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3448 will cause the menubar to suddenly appear when the user
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3449 had requested it to be turned off! */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3450 || f->output_data.w32->menubar_widget == NULL))
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3451 return 0;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3452
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3453 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3454 deferred_msg msg_buf;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3455
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3456 /* Detect if message has already been deferred; in this case
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3457 we cannot return any sensible value to ignore this. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3458 if (find_deferred_msg (hwnd, msg) != NULL)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3459 abort ();
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3460
76083
5e1d8f9b52ea * w32fns.c (menubar_in_use): New flag.
Jason Rumney <jasonr@gnu.org>
parents: 76078
diff changeset
3461 menubar_in_use = 1;
76078
3479e5ecb040 * w32fns.c (w32_wnd_proc) [WM_INITMENU]: Set menubar_active frame parameter.
Jason Rumney <jasonr@gnu.org>
parents: 76075
diff changeset
3462
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3463 return send_deferred_msg (&msg_buf, hwnd, msg, wParam, lParam);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3464 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3465
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3466 case WM_EXITMENULOOP:
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3467 f = x_window_to_frame (dpyinfo, hwnd);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3468
76075
25965473846d (current_popup_menu): Use from w32menu.c.
Jason Rumney <jasonr@gnu.org>
parents: 75348
diff changeset
3469 /* If a menu is still active, check again after a short delay,
25965473846d (current_popup_menu): Use from w32menu.c.
Jason Rumney <jasonr@gnu.org>
parents: 75348
diff changeset
3470 since Windows often (always?) sends the WM_EXITMENULOOP
25965473846d (current_popup_menu): Use from w32menu.c.
Jason Rumney <jasonr@gnu.org>
parents: 75348
diff changeset
3471 before the corresponding WM_COMMAND message.
25965473846d (current_popup_menu): Use from w32menu.c.
Jason Rumney <jasonr@gnu.org>
parents: 75348
diff changeset
3472 Don't do this if a popup menu is active, since it is only
25965473846d (current_popup_menu): Use from w32menu.c.
Jason Rumney <jasonr@gnu.org>
parents: 75348
diff changeset
3473 menubar menus that require cleaning up in this way.
25965473846d (current_popup_menu): Use from w32menu.c.
Jason Rumney <jasonr@gnu.org>
parents: 75348
diff changeset
3474 */
76083
5e1d8f9b52ea * w32fns.c (menubar_in_use): New flag.
Jason Rumney <jasonr@gnu.org>
parents: 76078
diff changeset
3475 if (f && menubar_in_use && current_popup_menu == NULL)
43472
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3476 menu_free_timer = SetTimer (hwnd, MENU_FREE_ID, MENU_FREE_DELAY, NULL);
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3477
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3478 /* If hourglass cursor should be displayed, display it now. */
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3479 if (f && f->output_data.w32->hourglass_p)
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3480 SetCursor (f->output_data.w32->hourglass_cursor);
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3481
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3482 goto dflt;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3483
28272
f62bb21d38db (w32_wnd_proc): Handle WM_MENUSELECT message.
Jason Rumney <jasonr@gnu.org>
parents: 27936
diff changeset
3484 case WM_MENUSELECT:
41638
aadcf676d5de (w32_wnd_proc) <WM_MENUSELECT>: Display help directly.
Jason Rumney <jasonr@gnu.org>
parents: 41480
diff changeset
3485 /* Direct handling of help_echo in menus. Should be safe now
aadcf676d5de (w32_wnd_proc) <WM_MENUSELECT>: Display help directly.
Jason Rumney <jasonr@gnu.org>
parents: 41480
diff changeset
3486 that we generate the help_echo by placing a help event in the
aadcf676d5de (w32_wnd_proc) <WM_MENUSELECT>: Display help directly.
Jason Rumney <jasonr@gnu.org>
parents: 41480
diff changeset
3487 keyboard buffer. */
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3488 {
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3489 HMENU menu = (HMENU) lParam;
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3490 UINT menu_item = (UINT) LOWORD (wParam);
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3491 UINT flags = (UINT) HIWORD (wParam);
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3492
41638
aadcf676d5de (w32_wnd_proc) <WM_MENUSELECT>: Display help directly.
Jason Rumney <jasonr@gnu.org>
parents: 41480
diff changeset
3493 w32_menu_display_help (hwnd, menu, menu_item, flags);
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3494 }
28272
f62bb21d38db (w32_wnd_proc): Handle WM_MENUSELECT message.
Jason Rumney <jasonr@gnu.org>
parents: 27936
diff changeset
3495 return 0;
f62bb21d38db (w32_wnd_proc): Handle WM_MENUSELECT message.
Jason Rumney <jasonr@gnu.org>
parents: 27936
diff changeset
3496
21735
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3497 case WM_MEASUREITEM:
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3498 f = x_window_to_frame (dpyinfo, hwnd);
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3499 if (f)
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3500 {
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3501 MEASUREITEMSTRUCT * pMis = (MEASUREITEMSTRUCT *) lParam;
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3502
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3503 if (pMis->CtlType == ODT_MENU)
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3504 {
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3505 /* Work out dimensions for popup menu titles. */
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3506 char * title = (char *) pMis->itemData;
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3507 HDC hdc = GetDC (hwnd);
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3508 HFONT menu_font = GetCurrentObject (hdc, OBJ_FONT);
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3509 LOGFONT menu_logfont;
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3510 HFONT old_font;
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3511 SIZE size;
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3512
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3513 GetObject (menu_font, sizeof (menu_logfont), &menu_logfont);
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3514 menu_logfont.lfWeight = FW_BOLD;
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3515 menu_font = CreateFontIndirect (&menu_logfont);
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3516 old_font = SelectObject (hdc, menu_font);
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3517
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
3518 pMis->itemHeight = GetSystemMetrics (SM_CYMENUSIZE);
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
3519 if (title)
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
3520 {
56971
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3521 if (unicode_append_menu)
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3522 GetTextExtentPoint32W (hdc, (WCHAR *) title,
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3523 wcslen ((WCHAR *) title),
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3524 &size);
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3525 else
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3526 GetTextExtentPoint32 (hdc, title, strlen (title), &size);
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3527
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
3528 pMis->itemWidth = size.cx;
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
3529 if (pMis->itemHeight < size.cy)
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
3530 pMis->itemHeight = size.cy;
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
3531 }
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
3532 else
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
3533 pMis->itemWidth = 0;
21735
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3534
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3535 SelectObject (hdc, old_font);
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3536 DeleteObject (menu_font);
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3537 ReleaseDC (hwnd, hdc);
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3538 return TRUE;
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3539 }
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3540 }
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3541 return 0;
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3542
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3543 case WM_DRAWITEM:
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3544 f = x_window_to_frame (dpyinfo, hwnd);
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3545 if (f)
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3546 {
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3547 DRAWITEMSTRUCT * pDis = (DRAWITEMSTRUCT *) lParam;
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3548
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3549 if (pDis->CtlType == ODT_MENU)
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3550 {
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3551 /* Draw popup menu title. */
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3552 char * title = (char *) pDis->itemData;
30239
6a55bd8a85f8 (w32_wnd_proc) [WM_DRAW_ITEM]: Do not try to draw a null title.
Jason Rumney <jasonr@gnu.org>
parents: 29317
diff changeset
3553 if (title)
6a55bd8a85f8 (w32_wnd_proc) [WM_DRAW_ITEM]: Do not try to draw a null title.
Jason Rumney <jasonr@gnu.org>
parents: 29317
diff changeset
3554 {
6a55bd8a85f8 (w32_wnd_proc) [WM_DRAW_ITEM]: Do not try to draw a null title.
Jason Rumney <jasonr@gnu.org>
parents: 29317
diff changeset
3555 HDC hdc = pDis->hDC;
6a55bd8a85f8 (w32_wnd_proc) [WM_DRAW_ITEM]: Do not try to draw a null title.
Jason Rumney <jasonr@gnu.org>
parents: 29317
diff changeset
3556 HFONT menu_font = GetCurrentObject (hdc, OBJ_FONT);
6a55bd8a85f8 (w32_wnd_proc) [WM_DRAW_ITEM]: Do not try to draw a null title.
Jason Rumney <jasonr@gnu.org>
parents: 29317
diff changeset
3557 LOGFONT menu_logfont;
6a55bd8a85f8 (w32_wnd_proc) [WM_DRAW_ITEM]: Do not try to draw a null title.
Jason Rumney <jasonr@gnu.org>
parents: 29317
diff changeset
3558 HFONT old_font;
6a55bd8a85f8 (w32_wnd_proc) [WM_DRAW_ITEM]: Do not try to draw a null title.
Jason Rumney <jasonr@gnu.org>
parents: 29317
diff changeset
3559
6a55bd8a85f8 (w32_wnd_proc) [WM_DRAW_ITEM]: Do not try to draw a null title.
Jason Rumney <jasonr@gnu.org>
parents: 29317
diff changeset
3560 GetObject (menu_font, sizeof (menu_logfont), &menu_logfont);
6a55bd8a85f8 (w32_wnd_proc) [WM_DRAW_ITEM]: Do not try to draw a null title.
Jason Rumney <jasonr@gnu.org>
parents: 29317
diff changeset
3561 menu_logfont.lfWeight = FW_BOLD;
6a55bd8a85f8 (w32_wnd_proc) [WM_DRAW_ITEM]: Do not try to draw a null title.
Jason Rumney <jasonr@gnu.org>
parents: 29317
diff changeset
3562 menu_font = CreateFontIndirect (&menu_logfont);
6a55bd8a85f8 (w32_wnd_proc) [WM_DRAW_ITEM]: Do not try to draw a null title.
Jason Rumney <jasonr@gnu.org>
parents: 29317
diff changeset
3563 old_font = SelectObject (hdc, menu_font);
6a55bd8a85f8 (w32_wnd_proc) [WM_DRAW_ITEM]: Do not try to draw a null title.
Jason Rumney <jasonr@gnu.org>
parents: 29317
diff changeset
3564
56971
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3565 /* Always draw title as if not selected. */
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3566 if (unicode_append_menu)
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3567 ExtTextOutW (hdc,
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3568 pDis->rcItem.left
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3569 + GetSystemMetrics (SM_CXMENUCHECK),
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3570 pDis->rcItem.top,
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3571 ETO_OPAQUE, &pDis->rcItem,
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3572 (WCHAR *) title,
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3573 wcslen ((WCHAR *) title), NULL);
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3574 else
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3575 ExtTextOut (hdc,
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3576 pDis->rcItem.left
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3577 + GetSystemMetrics (SM_CXMENUCHECK),
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3578 pDis->rcItem.top,
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3579 ETO_OPAQUE, &pDis->rcItem,
a35b92556545 (w32_wnd_proc) [WM_MEASUREITEM, WM_DRAWITEM]: Handle
Jason Rumney <jasonr@gnu.org>
parents: 56856
diff changeset
3580 title, strlen (title), NULL);
30239
6a55bd8a85f8 (w32_wnd_proc) [WM_DRAW_ITEM]: Do not try to draw a null title.
Jason Rumney <jasonr@gnu.org>
parents: 29317
diff changeset
3581
6a55bd8a85f8 (w32_wnd_proc) [WM_DRAW_ITEM]: Do not try to draw a null title.
Jason Rumney <jasonr@gnu.org>
parents: 29317
diff changeset
3582 SelectObject (hdc, old_font);
6a55bd8a85f8 (w32_wnd_proc) [WM_DRAW_ITEM]: Do not try to draw a null title.
Jason Rumney <jasonr@gnu.org>
parents: 29317
diff changeset
3583 DeleteObject (menu_font);
6a55bd8a85f8 (w32_wnd_proc) [WM_DRAW_ITEM]: Do not try to draw a null title.
Jason Rumney <jasonr@gnu.org>
parents: 29317
diff changeset
3584 }
21735
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3585 return TRUE;
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3586 }
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3587 }
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3588 return 0;
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3589
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3590 #if 0
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3591 /* Still not right - can't distinguish between clicks in the
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3592 client area of the frame from clicks forwarded from the scroll
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3593 bars - may have to hook WM_NCHITTEST to remember the mouse
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3594 position and then check if it is in the client area ourselves. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3595 case WM_MOUSEACTIVATE:
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3596 /* Discard the mouse click that activates a frame, allowing the
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3597 user to click anywhere without changing point (or worse!).
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3598 Don't eat mouse clicks on scrollbars though!! */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3599 if (LOWORD (lParam) == HTCLIENT )
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3600 return MA_ACTIVATEANDEAT;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3601 goto dflt;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3602 #endif
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3603
41732
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3604 case WM_MOUSELEAVE:
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3605 /* No longer tracking mouse. */
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3606 track_mouse_window = NULL;
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
3607
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3608 case WM_ACTIVATEAPP:
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3609 case WM_ACTIVATE:
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3610 case WM_WINDOWPOSCHANGED:
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3611 case WM_SHOWWINDOW:
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3612 /* Inform lisp thread that a frame might have just been obscured
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3613 or exposed, so should recheck visibility of all frames. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3614 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3615 goto dflt;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3616
14810
4dd6867765b9 (Vwin32_pass_alt_to_system,
Geoff Voelker <voelker@cs.washington.edu>
parents: 14461
diff changeset
3617 case WM_SETFOCUS:
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
3618 dpyinfo->faked_key = 0;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
3619 reset_modifiers ();
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3620 register_hot_keys (hwnd);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3621 goto command;
15314
796d825f4444 (reset_modifiers): Only clear a modifier if the modifier key has been
Richard M. Stallman <rms@gnu.org>
parents: 15290
diff changeset
3622 case WM_KILLFOCUS:
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3623 unregister_hot_keys (hwnd);
24751
e0eaca5025bc (w32_wnd_proc): Ensure mouse capture is released if
Andrew Innes <andrewi@gnu.org>
parents: 24718
diff changeset
3624 button_state = 0;
e0eaca5025bc (w32_wnd_proc): Ensure mouse capture is released if
Andrew Innes <andrewi@gnu.org>
parents: 24718
diff changeset
3625 ReleaseCapture ();
40385
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
3626 /* Relinquish the system caret. */
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
3627 if (w32_system_caret_hwnd)
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
3628 {
42918
9b06036a8c5e (syms_of_w32fns): Initialize w32_visible_system_caret_hwnd.
Jason Rumney <jasonr@gnu.org>
parents: 42865
diff changeset
3629 w32_visible_system_caret_hwnd = NULL;
40385
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
3630 w32_system_caret_hwnd = NULL;
42918
9b06036a8c5e (syms_of_w32fns): Initialize w32_visible_system_caret_hwnd.
Jason Rumney <jasonr@gnu.org>
parents: 42865
diff changeset
3631 DestroyCaret ();
40385
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
3632 }
43472
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3633 goto command;
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3634 case WM_COMMAND:
76083
5e1d8f9b52ea * w32fns.c (menubar_in_use): New flag.
Jason Rumney <jasonr@gnu.org>
parents: 76078
diff changeset
3635 menubar_in_use = 0;
43472
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3636 f = x_window_to_frame (dpyinfo, hwnd);
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3637 if (f && HIWORD (wParam) == 0)
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3638 {
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3639 if (menu_free_timer)
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3640 {
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3641 KillTimer (hwnd, menu_free_timer);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3642 menu_free_timer = 0;
43472
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3643 }
7faac536665f (mouse_move_timer, mouse_button_timer): Initialize.
Jason Rumney <jasonr@gnu.org>
parents: 43398
diff changeset
3644 }
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3645 case WM_MOVE:
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3646 case WM_SIZE:
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
3647 command:
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
3648 wmsg.dwModifiers = w32_get_modifiers ();
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3649 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3650 goto dflt;
15034
fb947ec168a8 (defined_color): Map color to nearest in default palette.
Richard M. Stallman <rms@gnu.org>
parents: 14983
diff changeset
3651
78106
f9eb7f243bdc (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
Jason Rumney <jasonr@gnu.org>
parents: 77995
diff changeset
3652 case WM_DESTROY:
f9eb7f243bdc (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
Jason Rumney <jasonr@gnu.org>
parents: 77995
diff changeset
3653 CoUninitialize ();
f9eb7f243bdc (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
Jason Rumney <jasonr@gnu.org>
parents: 77995
diff changeset
3654 return 0;
f9eb7f243bdc (w32_msg_pump) <WM_EMACS_CREATEWINDOW>: Initialize COM.
Jason Rumney <jasonr@gnu.org>
parents: 77995
diff changeset
3655
15034
fb947ec168a8 (defined_color): Map color to nearest in default palette.
Richard M. Stallman <rms@gnu.org>
parents: 14983
diff changeset
3656 case WM_CLOSE:
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
3657 wmsg.dwModifiers = w32_get_modifiers ();
15034
fb947ec168a8 (defined_color): Map color to nearest in default palette.
Richard M. Stallman <rms@gnu.org>
parents: 14983
diff changeset
3658 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
fb947ec168a8 (defined_color): Map color to nearest in default palette.
Richard M. Stallman <rms@gnu.org>
parents: 14983
diff changeset
3659 return 0;
fb947ec168a8 (defined_color): Map color to nearest in default palette.
Richard M. Stallman <rms@gnu.org>
parents: 14983
diff changeset
3660
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3661 case WM_WINDOWPOSCHANGING:
41448
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3662 /* Don't restrict the sizing of tip frames. */
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3663 if (hwnd == tip_window)
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3664 return 0;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3665 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3666 WINDOWPLACEMENT wp;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3667 LPWINDOWPOS lppos = (WINDOWPOS *) lParam;
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3668
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3669 wp.length = sizeof (WINDOWPLACEMENT);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3670 GetWindowPlacement (hwnd, &wp);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3671
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3672 if (wp.showCmd != SW_SHOWMINIMIZED && (lppos->flags & SWP_NOSIZE) == 0)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3673 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3674 RECT rect;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3675 int wdiff;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3676 int hdiff;
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3677 DWORD font_width;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3678 DWORD line_height;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3679 DWORD internal_border;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3680 DWORD scrollbar_extra;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3681 RECT wr;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3682
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
3683 wp.length = sizeof (wp);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3684 GetWindowRect (hwnd, &wr);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3685
14353
d0d8d9d73f7f backout 1.3
Geoff Voelker <voelker@cs.washington.edu>
parents: 14243
diff changeset
3686 enter_crit ();
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3687
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3688 font_width = GetWindowLong (hwnd, WND_FONTWIDTH_INDEX);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3689 line_height = GetWindowLong (hwnd, WND_LINEHEIGHT_INDEX);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3690 internal_border = GetWindowLong (hwnd, WND_BORDER_INDEX);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3691 scrollbar_extra = GetWindowLong (hwnd, WND_SCROLLBAR_INDEX);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3692
14353
d0d8d9d73f7f backout 1.3
Geoff Voelker <voelker@cs.washington.edu>
parents: 14243
diff changeset
3693 leave_crit ();
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3694
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3695 memset (&rect, 0, sizeof (rect));
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3696 AdjustWindowRect (&rect, GetWindowLong (hwnd, GWL_STYLE),
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3697 GetMenu (hwnd) != NULL);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3698
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3699 /* Force width and height of client area to be exact
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3700 multiples of the character cell dimensions. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3701 wdiff = (lppos->cx - (rect.right - rect.left)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3702 - 2 * internal_border - scrollbar_extra)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3703 % font_width;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3704 hdiff = (lppos->cy - (rect.bottom - rect.top)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3705 - 2 * internal_border)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3706 % line_height;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3707
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3708 if (wdiff || hdiff)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3709 {
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3710 /* For right/bottom sizing we can just fix the sizes.
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3711 However for top/left sizing we will need to fix the X
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3712 and Y positions as well. */
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3713
74618
69b307896f8b (w32_wnd_proc): Force non-tooltip frames to respect the minimum tracking size.
Juanma Barranquero <lekktu@gmail.com>
parents: 74350
diff changeset
3714 int cx_mintrack = GetSystemMetrics (SM_CXMINTRACK);
69b307896f8b (w32_wnd_proc): Force non-tooltip frames to respect the minimum tracking size.
Juanma Barranquero <lekktu@gmail.com>
parents: 74350
diff changeset
3715 int cy_mintrack = GetSystemMetrics (SM_CYMINTRACK);
69b307896f8b (w32_wnd_proc): Force non-tooltip frames to respect the minimum tracking size.
Juanma Barranquero <lekktu@gmail.com>
parents: 74350
diff changeset
3716
69b307896f8b (w32_wnd_proc): Force non-tooltip frames to respect the minimum tracking size.
Juanma Barranquero <lekktu@gmail.com>
parents: 74350
diff changeset
3717 lppos->cx = max (lppos->cx - wdiff, cx_mintrack);
69b307896f8b (w32_wnd_proc): Force non-tooltip frames to respect the minimum tracking size.
Juanma Barranquero <lekktu@gmail.com>
parents: 74350
diff changeset
3718 lppos->cy = max (lppos->cy - hdiff, cy_mintrack);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3719
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3720 if (wp.showCmd != SW_SHOWMAXIMIZED
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3721 && (lppos->flags & SWP_NOMOVE) == 0)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3722 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3723 if (lppos->x != wr.left || lppos->y != wr.top)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3724 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3725 lppos->x += wdiff;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3726 lppos->y += hdiff;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3727 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3728 else
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3729 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3730 lppos->flags |= SWP_NOMOVE;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3731 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3732 }
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3733
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3734 return 0;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3735 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3736 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3737 }
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3738
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3739 goto dflt;
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3740
24479
3b2c3636bf0e (w32_wnd_proc): Handle WM_GETMINMAXINFO message.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24412
diff changeset
3741 case WM_GETMINMAXINFO:
36080
743534626f73 (w32_wnd_proc) <WM_GETMINMAXINFO>: Allow resizing the
Andrew Innes <andrewi@gnu.org>
parents: 36000
diff changeset
3742 /* Hack to allow resizing the Emacs frame above the screen size.
743534626f73 (w32_wnd_proc) <WM_GETMINMAXINFO>: Allow resizing the
Andrew Innes <andrewi@gnu.org>
parents: 36000
diff changeset
3743 Note that Windows 9x limits coordinates to 16-bits. */
743534626f73 (w32_wnd_proc) <WM_GETMINMAXINFO>: Allow resizing the
Andrew Innes <andrewi@gnu.org>
parents: 36000
diff changeset
3744 ((LPMINMAXINFO) lParam)->ptMaxTrackSize.x = 32767;
743534626f73 (w32_wnd_proc) <WM_GETMINMAXINFO>: Allow resizing the
Andrew Innes <andrewi@gnu.org>
parents: 36000
diff changeset
3745 ((LPMINMAXINFO) lParam)->ptMaxTrackSize.y = 32767;
24479
3b2c3636bf0e (w32_wnd_proc): Handle WM_GETMINMAXINFO message.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24412
diff changeset
3746 return 0;
3b2c3636bf0e (w32_wnd_proc): Handle WM_GETMINMAXINFO message.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24412
diff changeset
3747
49369
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
3748 case WM_SETCURSOR:
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
3749 if (LOWORD (lParam) == HTCLIENT)
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3750 {
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3751 f = x_window_to_frame (dpyinfo, hwnd);
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3752 if (f->output_data.w32->hourglass_p && !menubar_in_use
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3753 && !current_popup_menu)
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3754 SetCursor (f->output_data.w32->hourglass_cursor);
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3755 else
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3756 SetCursor (f->output_data.w32->current_cursor);
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3757 return 0;
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3758 }
49369
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
3759 goto dflt;
49494
07f0ea120d7d (init_external_image_libraries): Try alternate names for the jpeg dll.
Juanma Barranquero <lekktu@gmail.com>
parents: 49455
diff changeset
3760
49369
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
3761 case WM_EMACS_SETCURSOR:
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
3762 {
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
3763 Cursor cursor = (Cursor) wParam;
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3764 f = x_window_to_frame (dpyinfo, hwnd);
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3765 if (f && cursor)
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3766 {
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3767 f->output_data.w32->current_cursor = cursor;
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3768 if (!f->output_data.w32->hourglass_p)
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3769 SetCursor (cursor);
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
3770 }
49369
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
3771 return 0;
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
3772 }
49494
07f0ea120d7d (init_external_image_libraries): Try alternate names for the jpeg dll.
Juanma Barranquero <lekktu@gmail.com>
parents: 49455
diff changeset
3773
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3774 case WM_EMACS_CREATESCROLLBAR:
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3775 return (LRESULT) w32_createscrollbar ((struct frame *) wParam,
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3776 (struct scroll_bar *) lParam);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3777
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3778 case WM_EMACS_SHOWWINDOW:
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3779 return ShowWindow ((HWND) wParam, (WPARAM) lParam);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3780
21608
d191a8737145 (w32_msg_pump): Handle WM_EMACS_SETLOCALE.
Geoff Voelker <voelker@cs.washington.edu>
parents: 19707
diff changeset
3781 case WM_EMACS_SETFOREGROUND:
24718
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3782 {
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3783 HWND foreground_window;
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3784 DWORD foreground_thread, retval;
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3785
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3786 /* On NT 5.0, and apparently Windows 98, it is necessary to
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3787 attach to the thread that currently has focus in order to
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3788 pull the focus away from it. */
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3789 foreground_window = GetForegroundWindow ();
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3790 foreground_thread = GetWindowThreadProcessId (foreground_window, NULL);
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3791 if (!foreground_window
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3792 || foreground_thread == GetCurrentThreadId ()
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3793 || !AttachThreadInput (GetCurrentThreadId (),
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3794 foreground_thread, TRUE))
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3795 foreground_thread = 0;
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3796
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3797 retval = SetForegroundWindow ((HWND) wParam);
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3798
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3799 /* Detach from the previous foreground thread. */
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3800 if (foreground_thread)
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3801 AttachThreadInput (GetCurrentThreadId (),
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3802 foreground_thread, FALSE);
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3803
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3804 return retval;
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
3805 }
21608
d191a8737145 (w32_msg_pump): Handle WM_EMACS_SETLOCALE.
Geoff Voelker <voelker@cs.washington.edu>
parents: 19707
diff changeset
3806
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3807 case WM_EMACS_SETWINDOWPOS:
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3808 {
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3809 WINDOWPOS * pos = (WINDOWPOS *) wParam;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3810 return SetWindowPos (hwnd, pos->hwndInsertAfter,
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3811 pos->x, pos->y, pos->cx, pos->cy, pos->flags);
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
3812 }
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3813
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3814 case WM_EMACS_DESTROYWINDOW:
21884
bc4455bca454 Include shellapi.h.
Richard M. Stallman <rms@gnu.org>
parents: 21874
diff changeset
3815 DragAcceptFiles ((HWND) wParam, FALSE);
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3816 return DestroyWindow ((HWND) wParam);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3817
42865
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3818 case WM_EMACS_HIDE_CARET:
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3819 return HideCaret (hwnd);
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3820
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3821 case WM_EMACS_SHOW_CARET:
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3822 return ShowCaret (hwnd);
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3823
40385
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
3824 case WM_EMACS_DESTROY_CARET:
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
3825 w32_system_caret_hwnd = NULL;
42865
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3826 w32_visible_system_caret_hwnd = NULL;
40385
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
3827 return DestroyCaret ();
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
3828
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
3829 case WM_EMACS_TRACK_CARET:
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
3830 /* If there is currently no system caret, create one. */
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
3831 if (w32_system_caret_hwnd == NULL)
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
3832 {
42865
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3833 /* Use the default caret width, and avoid changing it
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3834 unneccesarily, as it confuses screen reader software. */
40385
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
3835 w32_system_caret_hwnd = hwnd;
42865
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3836 CreateCaret (hwnd, NULL, 0,
40385
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
3837 w32_system_caret_height);
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
3838 }
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3839
42865
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3840 if (!SetCaretPos (w32_system_caret_x, w32_system_caret_y))
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3841 return 0;
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3842 /* Ensure visible caret gets turned on when requested. */
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3843 else if (w32_use_visible_system_caret
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3844 && w32_visible_system_caret_hwnd != hwnd)
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3845 {
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3846 w32_visible_system_caret_hwnd = hwnd;
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3847 return ShowCaret (hwnd);
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3848 }
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3849 /* Ensure visible caret gets turned off when requested. */
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3850 else if (!w32_use_visible_system_caret
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3851 && w32_visible_system_caret_hwnd)
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3852 {
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3853 w32_visible_system_caret_hwnd = NULL;
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3854 return HideCaret (hwnd);
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3855 }
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3856 else
40d08b8571ec (w32_visible_system_caret_hwnd): New static variable.
Jason Rumney <jasonr@gnu.org>
parents: 42845
diff changeset
3857 return 1;
40385
b3dbd98f9b97 (w32_wnd_proc) <WM_KILLFOCUS>: Destroy the system caret.
Jason Rumney <jasonr@gnu.org>
parents: 40120
diff changeset
3858
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3859 case WM_EMACS_TRACKPOPUPMENU:
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3860 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3861 UINT flags;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3862 POINT *pos;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3863 int retval;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3864 pos = (POINT *)lParam;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3865 flags = TPM_CENTERALIGN;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3866 if (button_state & LMOUSE)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3867 flags |= TPM_LEFTBUTTON;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3868 else if (button_state & RMOUSE)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3869 flags |= TPM_RIGHTBUTTON;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3870
21735
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3871 /* Remember we did a SetCapture on the initial mouse down event,
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3872 so for safety, we make sure the capture is cancelled now. */
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3873 ReleaseCapture ();
23160
95a213639589 (w32_wnd_proc): Always zero button_state when releasing
Geoff Voelker <voelker@cs.washington.edu>
parents: 22625
diff changeset
3874 button_state = 0;
21735
711a61942023 (x_set_vertical_scroll_bars): Put scroll bars on the
Geoff Voelker <voelker@cs.washington.edu>
parents: 21608
diff changeset
3875
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3876 /* Use menubar_active to indicate that WM_INITMENU is from
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3877 TrackPopupMenu below, and should be ignored. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3878 f = x_window_to_frame (dpyinfo, hwnd);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3879 if (f)
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3880 f->output_data.w32->menubar_active = 1;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3881
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3882 if (TrackPopupMenu ((HMENU)wParam, flags, pos->x, pos->y,
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3883 0, hwnd, NULL))
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3884 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3885 MSG amsg;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3886 /* Eat any mouse messages during popupmenu */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3887 while (PeekMessage (&amsg, hwnd, WM_MOUSEFIRST, WM_MOUSELAST,
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3888 PM_REMOVE));
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3889 /* Get the menu selection, if any */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3890 if (PeekMessage (&amsg, hwnd, WM_COMMAND, WM_COMMAND, PM_REMOVE))
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3891 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3892 retval = LOWORD (amsg.wParam);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3893 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3894 else
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3895 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3896 retval = 0;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3897 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3898 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3899 else
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3900 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3901 retval = -1;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3902 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3903
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3904 return retval;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3905 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3906
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3907 default:
21874
c0871d40073e (msh_mousewheel): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21735
diff changeset
3908 /* Check for messages registered at runtime. */
c0871d40073e (msh_mousewheel): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21735
diff changeset
3909 if (msg == msh_mousewheel)
c0871d40073e (msh_mousewheel): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21735
diff changeset
3910 {
c0871d40073e (msh_mousewheel): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21735
diff changeset
3911 wmsg.dwModifiers = w32_get_modifiers ();
c0871d40073e (msh_mousewheel): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21735
diff changeset
3912 my_post_msg (&wmsg, hwnd, msg, wParam, lParam);
69426
46a8c3e0161d (signal_user_input): New function.
Jason Rumney <jasonr@gnu.org>
parents: 69406
diff changeset
3913 signal_user_input ();
21874
c0871d40073e (msh_mousewheel): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21735
diff changeset
3914 return 0;
c0871d40073e (msh_mousewheel): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 21735
diff changeset
3915 }
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3916
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3917 dflt:
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3918 return DefWindowProc (hwnd, msg, wParam, lParam);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3919 }
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3920
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3921 /* The most common default return code for handled messages is 0. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3922 return 0;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3923 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3924
64662
605f42af1c34 (my_set_window_pos, my_show_window): Don't declare.
Juanma Barranquero <lekktu@gmail.com>
parents: 64487
diff changeset
3925 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
3926 my_create_window (struct frame * f)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3927 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3928 MSG msg;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3929
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3930 if (!PostThreadMessage (dwWindowsThreadId, WM_EMACS_CREATEWINDOW, (WPARAM)f, 0))
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
3931 abort ();
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3932 GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3933 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3934
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3935
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3936 /* Create a tooltip window. Unlike my_create_window, we do not do this
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3937 indirectly via the Window thread, as we do not need to process Window
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3938 messages for the tooltip. Creating tooltips indirectly also creates
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3939 deadlocks when tooltips are created for menu items. */
64662
605f42af1c34 (my_set_window_pos, my_show_window): Don't declare.
Juanma Barranquero <lekktu@gmail.com>
parents: 64487
diff changeset
3940 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
3941 my_create_tip_window (struct frame *f)
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3942 {
41448
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3943 RECT rect;
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3944
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3945 rect.left = rect.top = 0;
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
3946 rect.right = FRAME_PIXEL_WIDTH (f);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
3947 rect.bottom = FRAME_PIXEL_HEIGHT (f);
41448
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3948
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3949 AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3950 FRAME_EXTERNAL_MENU_BAR (f));
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3951
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3952 tip_window = FRAME_W32_WINDOW (f)
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3953 = CreateWindow (EMACS_CLASS,
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3954 f->namebuf,
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3955 f->output_data.w32->dwStyle,
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
3956 f->left_pos,
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
3957 f->top_pos,
41448
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3958 rect.right - rect.left,
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3959 rect.bottom - rect.top,
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3960 FRAME_W32_WINDOW (SELECTED_FRAME ()), /* owner */
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3961 NULL,
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3962 hinst,
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3963 NULL);
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3964
41448
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3965 if (tip_window)
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3966 {
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
3967 SetWindowLong (tip_window, WND_FONTWIDTH_INDEX, FRAME_COLUMN_WIDTH (f));
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
3968 SetWindowLong (tip_window, WND_LINEHEIGHT_INDEX, FRAME_LINE_HEIGHT (f));
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
3969 SetWindowLong (tip_window, WND_BORDER_INDEX, FRAME_INTERNAL_BORDER_WIDTH (f));
41448
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3970 SetWindowLong (tip_window, WND_BACKGROUND_INDEX, FRAME_BACKGROUND_PIXEL (f));
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3971
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3972 /* Tip frames have no scrollbars. */
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3973 SetWindowLong (tip_window, WND_SCROLLBAR_INDEX, 0);
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3974
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3975 /* Do this to discard the default setting specified by our parent. */
41448
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
3976 ShowWindow (tip_window, SW_HIDE);
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3977 }
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3978 }
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3979
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
3980
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
3981 /* Create and set up the w32 window for frame F. */
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3982
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3983 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
3984 w32_window (struct frame *f, long window_prompting, int minibuffer_only)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3985 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3986 BLOCK_INPUT;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3987
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3988 /* Use the resource name as the top-level window name
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3989 for looking up resources. Make a non-Lisp copy
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3990 for the window manager, so GC relocation won't bother it.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3991
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3992 Elsewhere we specify the window name for the window manager. */
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
3993
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3994 {
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
3995 char *str = (char *) SDATA (Vx_resource_name);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3996 f->namebuf = (char *) xmalloc (strlen (str) + 1);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3997 strcpy (f->namebuf, str);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3998 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
3999
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4000 my_create_window (f);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4001
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4002 validate_x_resource_name ();
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4003
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4004 /* x_set_name normally ignores requests to set the name if the
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4005 requested name is the same as the current name. This is the one
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4006 place where that assumption isn't correct; f->name is set, but
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4007 the server hasn't been told. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4008 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4009 Lisp_Object name;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4010 int explicit = f->explicit_name;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4011
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4012 f->explicit_name = 0;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4013 name = f->name;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4014 f->name = Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4015 x_set_name (f, name, explicit);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4016 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4017
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4018 UNBLOCK_INPUT;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4019
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4020 if (!minibuffer_only && FRAME_EXTERNAL_MENU_BAR (f))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4021 initialize_frame_menubar (f);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4022
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4023 if (FRAME_W32_WINDOW (f) == 0)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4024 error ("Unable to create window");
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4025 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4026
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4027 /* Handle the icon stuff for this window. Perhaps later we might
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4028 want an x_set_icon_position which can be called interactively as
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4029 well. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4030
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4031 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
4032 x_icon (struct frame *f, Lisp_Object parms)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4033 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4034 Lisp_Object icon_x, icon_y;
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4035 struct w32_display_info *dpyinfo = &one_w32_display_info;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4036
16884
36babc489b0c Change all uses of win95, winnt, and win32
Geoff Voelker <voelker@cs.washington.edu>
parents: 16602
diff changeset
4037 /* Set the position of the icon. Note that Windows 95 groups all
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4038 icons in the tray. */
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4039 icon_x = x_get_arg (dpyinfo, parms, Qicon_left, 0, 0, RES_TYPE_NUMBER);
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4040 icon_y = x_get_arg (dpyinfo, parms, Qicon_top, 0, 0, RES_TYPE_NUMBER);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4041 if (!EQ (icon_x, Qunbound) && !EQ (icon_y, Qunbound))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4042 {
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
4043 CHECK_NUMBER (icon_x);
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
4044 CHECK_NUMBER (icon_y);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4045 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4046 else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4047 error ("Both left and top icon corners of icon must be specified");
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4048
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4049 BLOCK_INPUT;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4050
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4051 if (! EQ (icon_x, Qunbound))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4052 x_wm_set_icon_position (f, XINT (icon_x), XINT (icon_y));
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4053
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4054 #if 0 /* TODO */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4055 /* Start up iconic or window? */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4056 x_wm_set_window_state
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4057 (f, (EQ (x_get_arg (dpyinfo, parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL), Qicon)
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4058 ? IconicState
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4059 : NormalState));
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4060
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
4061 x_text_icon (f, (char *) SDATA ((!NILP (f->icon_name)
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4062 ? f->icon_name
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
4063 : f->name)));
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4064 #endif
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4065
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4066 UNBLOCK_INPUT;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4067 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4068
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4069
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4070 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
4071 x_make_gc (struct frame *f)
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4072 {
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4073 XGCValues gc_values;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4074
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4075 BLOCK_INPUT;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4076
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4077 /* Create the GC's of this frame.
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4078 Note that many default values are used. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4079
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4080 /* Normal video */
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
4081 gc_values.font = FRAME_FONT (f);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4082
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4083 /* Cursor has cursor-color background, background-color foreground. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4084 gc_values.foreground = FRAME_BACKGROUND_PIXEL (f);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4085 gc_values.background = f->output_data.w32->cursor_pixel;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4086 f->output_data.w32->cursor_gc
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4087 = XCreateGC (NULL, FRAME_W32_WINDOW (f),
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4088 (GCFont | GCForeground | GCBackground),
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4089 &gc_values);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4090
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4091 /* Reliefs. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4092 f->output_data.w32->white_relief.gc = 0;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4093 f->output_data.w32->black_relief.gc = 0;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4094
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4095 UNBLOCK_INPUT;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4096 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4097
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4098
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4099 /* Handler for signals raised during x_create_frame and
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4100 x_create_top_frame. FRAME is the frame which is partially
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4101 constructed. */
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4102
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4103 static Lisp_Object
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
4104 unwind_create_frame (Lisp_Object frame)
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4105 {
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4106 struct frame *f = XFRAME (frame);
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4107
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4108 /* If frame is ``official'', nothing to do. */
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4109 if (!CONSP (Vframe_list) || !EQ (XCAR (Vframe_list), frame))
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4110 {
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4111 #ifdef GLYPH_DEBUG
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4112 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4113 #endif
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
4114
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4115 x_free_frame_resources (f);
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4116
99024
06856faf917a * w32fns.c (unwind_create_frame) [!GLYPH_DEBUG]: Fix xassert.
Juanma Barranquero <lekktu@gmail.com>
parents: 98240
diff changeset
4117 #if GLYPH_DEBUG
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4118 /* Check that reference counts are indeed correct. */
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4119 xassert (dpyinfo->reference_count == dpyinfo_refcount);
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4120 xassert (dpyinfo->image_cache->refcount == image_cache_refcount);
99024
06856faf917a * w32fns.c (unwind_create_frame) [!GLYPH_DEBUG]: Fix xassert.
Juanma Barranquero <lekktu@gmail.com>
parents: 98240
diff changeset
4121 #endif
34638
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34546
diff changeset
4122 return Qt;
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4123 }
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
4124
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4125 return Qnil;
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4126 }
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4127
90865
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4128 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
4129 x_default_font_parameter (struct frame *f, Lisp_Object parms)
90865
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4130 {
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4131 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (f);
96084
0623378cdbca * w32fns.c, xfnc.c (x_default_font_parameter): Only set `font-param'
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 96079
diff changeset
4132 Lisp_Object font_param = x_get_arg (dpyinfo, parms, Qfont, NULL, NULL,
0623378cdbca * w32fns.c, xfnc.c (x_default_font_parameter): Only set `font-param'
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 96079
diff changeset
4133 RES_TYPE_STRING);
0623378cdbca * w32fns.c, xfnc.c (x_default_font_parameter): Only set `font-param'
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 96079
diff changeset
4134 Lisp_Object font;
0623378cdbca * w32fns.c, xfnc.c (x_default_font_parameter): Only set `font-param'
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 96079
diff changeset
4135 if (EQ (font_param, Qunbound))
0623378cdbca * w32fns.c, xfnc.c (x_default_font_parameter): Only set `font-param'
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 96079
diff changeset
4136 font_param = Qnil;
0623378cdbca * w32fns.c, xfnc.c (x_default_font_parameter): Only set `font-param'
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 96079
diff changeset
4137 font = !NILP (font_param) ? font_param
0623378cdbca * w32fns.c, xfnc.c (x_default_font_parameter): Only set `font-param'
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 96079
diff changeset
4138 : x_get_arg (dpyinfo, parms, Qfont, "font", "Font", RES_TYPE_STRING);
90865
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4139
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4140 if (!STRINGP (font))
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4141 {
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4142 int i;
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4143 static char *names[]
90893
c36f1ca93a6e (x_default_font_parameter): Use new style font name.
Jason Rumney <jasonr@gnu.org>
parents: 90878
diff changeset
4144 = { "Courier New-10",
90865
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4145 "-*-Courier-normal-r-*-*-13-*-*-*-c-*-iso8859-1",
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4146 "-*-Fixedsys-normal-r-*-*-12-*-*-*-c-*-iso8859-1",
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4147 "Fixedsys",
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4148 NULL };
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4149
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4150 for (i = 0; names[i]; i++)
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4151 {
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4152 font = font_open_by_name (f, names[i]);
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4153 if (! NILP (font))
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4154 break;
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4155 }
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4156 if (NILP (font))
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4157 error ("No suitable font was found");
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4158 }
96084
0623378cdbca * w32fns.c, xfnc.c (x_default_font_parameter): Only set `font-param'
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 96079
diff changeset
4159 else if (!NILP (font_param))
96079
efbaf6995245 * w32fns.c, xfns.c (Qfont_param): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95894
diff changeset
4160 {
efbaf6995245 * w32fns.c, xfns.c (Qfont_param): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95894
diff changeset
4161 /* Remember the explicit font parameter, so we can re-apply it after
efbaf6995245 * w32fns.c, xfns.c (Qfont_param): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95894
diff changeset
4162 we've applied the `default' face settings. */
96084
0623378cdbca * w32fns.c, xfnc.c (x_default_font_parameter): Only set `font-param'
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 96079
diff changeset
4163 x_set_frame_parameters (f, Fcons (Fcons (Qfont_param, font_param), Qnil));
0623378cdbca * w32fns.c, xfnc.c (x_default_font_parameter): Only set `font-param'
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 96079
diff changeset
4164 }
90865
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4165 x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING);
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
4166 }
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
4167
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4168 DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame,
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4169 1, 1, 0,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4170 doc: /* Make a new window, which is called a \"frame\" in Emacs terms.
79393
09f6c4242048 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 79387
diff changeset
4171 Return an Emacs frame object.
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4172 PARAMETERS is an alist of frame parameters.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4173 If the parameters specify that the frame should not have a minibuffer,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4174 and do not specify a specific minibuffer window to use,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4175 then `default-minibuffer-frame' must be a frame whose minibuffer can
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4176 be shared by the new frame.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4177
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4178 This function is an internal primitive--use `make-frame' instead. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4179 (Lisp_Object parameters)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4180 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4181 struct frame *f;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4182 Lisp_Object frame, tem;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4183 Lisp_Object name;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4184 int minibuffer_only = 0;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4185 long window_prompting = 0;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4186 int width, height;
46285
3f111801efb4 Rename BINDING_STACK_SIZE to SPECPDL_INDEX.
Juanma Barranquero <lekktu@gmail.com>
parents: 46272
diff changeset
4187 int count = SPECPDL_INDEX ();
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4188 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4189 Lisp_Object display;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4190 struct w32_display_info *dpyinfo = NULL;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4191 Lisp_Object parent;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4192 struct kboard *kb;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4193
87478
585596662817 Make copy of frame parameters because the original parameters
Martin Rudalics <rudalics@gmx.at>
parents: 87453
diff changeset
4194 /* Make copy of frame parameters because the original is in pure
585596662817 Make copy of frame parameters because the original parameters
Martin Rudalics <rudalics@gmx.at>
parents: 87453
diff changeset
4195 storage now. */
585596662817 Make copy of frame parameters because the original parameters
Martin Rudalics <rudalics@gmx.at>
parents: 87453
diff changeset
4196 parameters = Fcopy_alist (parameters);
585596662817 Make copy of frame parameters because the original parameters
Martin Rudalics <rudalics@gmx.at>
parents: 87453
diff changeset
4197
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4198 /* Use this general default value to start with
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4199 until we know if this frame has a specified name. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4200 Vx_resource_name = Vinvocation_name;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4201
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4202 display = x_get_arg (dpyinfo, parameters, Qterminal, 0, 0, RES_TYPE_NUMBER);
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4203 if (EQ (display, Qunbound))
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4204 display = x_get_arg (dpyinfo, parameters, Qdisplay, 0, 0, RES_TYPE_STRING);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4205 if (EQ (display, Qunbound))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4206 display = Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4207 dpyinfo = check_x_display_info (display);
83619
5da6a46ddbd6 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Define here.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83618
diff changeset
4208 kb = dpyinfo->terminal->kboard;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4209
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4210 if (!dpyinfo->terminal->name)
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4211 error ("Terminal is not live, can't create new frames on it");
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4212
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4213 name = x_get_arg (dpyinfo, parameters, Qname, "name", "Name", RES_TYPE_STRING);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4214 if (!STRINGP (name)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4215 && ! EQ (name, Qunbound)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4216 && ! NILP (name))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4217 error ("Invalid frame name--not a string or nil");
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4218
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4219 if (STRINGP (name))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4220 Vx_resource_name = name;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4221
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4222 /* See if parent window is specified. */
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4223 parent = x_get_arg (dpyinfo, parameters, Qparent_id, NULL, NULL, RES_TYPE_NUMBER);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4224 if (EQ (parent, Qunbound))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4225 parent = Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4226 if (! NILP (parent))
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
4227 CHECK_NUMBER (parent);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4228
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4229 /* make_frame_without_minibuffer can run Lisp code and garbage collect. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4230 /* No need to protect DISPLAY because that's not used after passing
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4231 it to make_frame_without_minibuffer. */
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4232 frame = Qnil;
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4233 GCPRO4 (parameters, parent, name, frame);
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4234 tem = x_get_arg (dpyinfo, parameters, Qminibuffer, "minibuffer", "Minibuffer",
32669
092d2df2a6c3 (Fx_create_frame): Don't bother calling
Jason Rumney <jasonr@gnu.org>
parents: 31110
diff changeset
4235 RES_TYPE_SYMBOL);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4236 if (EQ (tem, Qnone) || NILP (tem))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4237 f = make_frame_without_minibuffer (Qnil, kb, display);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4238 else if (EQ (tem, Qonly))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4239 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4240 f = make_minibuffer_frame ();
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4241 minibuffer_only = 1;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4242 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4243 else if (WINDOWP (tem))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4244 f = make_frame_without_minibuffer (tem, kb, display);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4245 else
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4246 f = make_frame (1);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4247
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4248 XSETFRAME (frame, f);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4249
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4250 /* Note that Windows does support scroll bars. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4251 FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
50362
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
4252
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4253 /* By default, make scrollbars the system standard width. */
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
4254 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4255
83571
ca1c27e2707e (x_set_tool_bar_lines): Don't use updating_frame.
Jason Rumney <jasonr@gnu.org>
parents: 76700
diff changeset
4256 f->terminal = dpyinfo->terminal;
ca1c27e2707e (x_set_tool_bar_lines): Don't use updating_frame.
Jason Rumney <jasonr@gnu.org>
parents: 76700
diff changeset
4257 f->terminal->reference_count++;
ca1c27e2707e (x_set_tool_bar_lines): Don't use updating_frame.
Jason Rumney <jasonr@gnu.org>
parents: 76700
diff changeset
4258
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4259 f->output_method = output_w32;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4260 f->output_data.w32 =
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4261 (struct w32_output *) xmalloc (sizeof (struct w32_output));
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109160
diff changeset
4262 memset (f->output_data.w32, 0, sizeof (struct w32_output));
23506
246a14f0622f (Vx_pixel_size_width): New global variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23407
diff changeset
4263 FRAME_FONTSET (f) = -1;
246a14f0622f (Vx_pixel_size_width): New global variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23407
diff changeset
4264
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4265 f->icon_name
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4266 = x_get_arg (dpyinfo, parameters, Qicon_name, "iconName", "Title",
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4267 RES_TYPE_STRING);
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4268 if (! STRINGP (f->icon_name))
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4269 f->icon_name = Qnil;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4270
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4271 /* FRAME_W32_DISPLAY_INFO (f) = dpyinfo; */
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4272
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4273 /* With FRAME_X_DISPLAY_INFO set up, this unwind-protect is safe. */
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4274 record_unwind_protect (unwind_create_frame, frame);
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4275 #if GLYPH_DEBUG
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4276 image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount;
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4277 dpyinfo_refcount = dpyinfo->reference_count;
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4278 #endif /* GLYPH_DEBUG */
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4279
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4280 /* Specify the parent under which to make this window. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4281
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4282 if (!NILP (parent))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4283 {
32669
092d2df2a6c3 (Fx_create_frame): Don't bother calling
Jason Rumney <jasonr@gnu.org>
parents: 31110
diff changeset
4284 f->output_data.w32->parent_desc = (Window) XFASTINT (parent);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4285 f->output_data.w32->explicit_parent = 1;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4286 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4287 else
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4288 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4289 f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window;
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4290 f->output_data.w32->explicit_parent = 0;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4291 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4292
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4293 /* Set the name; the functions to which we pass f expect the name to
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4294 be set. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4295 if (EQ (name, Qunbound) || NILP (name))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4296 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4297 f->name = build_string (dpyinfo->w32_id_name);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4298 f->explicit_name = 0;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4299 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4300 else
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4301 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4302 f->name = name;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4303 f->explicit_name = 1;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4304 /* use the frame's title when getting resources for this frame. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4305 specbind (Qx_resource_name, name);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4306 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4307
90893
c36f1ca93a6e (x_default_font_parameter): Use new style font name.
Jason Rumney <jasonr@gnu.org>
parents: 90878
diff changeset
4308 f->resx = dpyinfo->resx;
c36f1ca93a6e (x_default_font_parameter): Use new style font name.
Jason Rumney <jasonr@gnu.org>
parents: 90878
diff changeset
4309 f->resy = dpyinfo->resy;
c36f1ca93a6e (x_default_font_parameter): Use new style font name.
Jason Rumney <jasonr@gnu.org>
parents: 90878
diff changeset
4310
94917
e61553aa7a73 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 94618
diff changeset
4311 if (uniscribe_available)
e61553aa7a73 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 94618
diff changeset
4312 register_font_driver (&uniscribe_font_driver, f);
e61553aa7a73 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 94618
diff changeset
4313 register_font_driver (&w32font_driver, f);
e61553aa7a73 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 94618
diff changeset
4314
e61553aa7a73 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 94618
diff changeset
4315 x_default_parameter (f, parameters, Qfont_backend, Qnil,
e61553aa7a73 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 94618
diff changeset
4316 "fontBackend", "FontBackend", RES_TYPE_STRING);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4317 /* Extract the window parameters from the supplied values
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4318 that are needed to determine window geometry. */
94917
e61553aa7a73 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 94618
diff changeset
4319 x_default_font_parameter (f, parameters);
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4320 x_default_parameter (f, parameters, Qborder_width, make_number (2),
32669
092d2df2a6c3 (Fx_create_frame): Don't bother calling
Jason Rumney <jasonr@gnu.org>
parents: 31110
diff changeset
4321 "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4322
99235
eccf5258acaf * w32fns.c (x_create_tip_frame): Prevent default foreground color for
Juanma Barranquero <lekktu@gmail.com>
parents: 99024
diff changeset
4323 /* We recognize either internalBorderWidth or internalBorder
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4324 (which is what xterm calls it). */
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4325 if (NILP (Fassq (Qinternal_border_width, parameters)))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4326 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4327 Lisp_Object value;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4328
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4329 value = x_get_arg (dpyinfo, parameters, Qinternal_border_width,
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4330 "internalBorder", "InternalBorder", RES_TYPE_NUMBER);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4331 if (! EQ (value, Qunbound))
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4332 parameters = Fcons (Fcons (Qinternal_border_width, value),
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4333 parameters);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4334 }
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4335 /* Default internalBorderWidth to 0 on Windows to match other programs. */
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4336 x_default_parameter (f, parameters, Qinternal_border_width, make_number (0),
32669
092d2df2a6c3 (Fx_create_frame): Don't bother calling
Jason Rumney <jasonr@gnu.org>
parents: 31110
diff changeset
4337 "internalBorderWidth", "InternalBorder", RES_TYPE_NUMBER);
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4338 x_default_parameter (f, parameters, Qvertical_scroll_bars, Qright,
32669
092d2df2a6c3 (Fx_create_frame): Don't bother calling
Jason Rumney <jasonr@gnu.org>
parents: 31110
diff changeset
4339 "verticalScrollBars", "ScrollBars", RES_TYPE_SYMBOL);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4340
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4341 /* Also do the stuff which must be set before the window exists. */
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4342 x_default_parameter (f, parameters, Qforeground_color, build_string ("black"),
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4343 "foreground", "Foreground", RES_TYPE_STRING);
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4344 x_default_parameter (f, parameters, Qbackground_color, build_string ("white"),
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4345 "background", "Background", RES_TYPE_STRING);
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4346 x_default_parameter (f, parameters, Qmouse_color, build_string ("black"),
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4347 "pointerColor", "Foreground", RES_TYPE_STRING);
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4348 x_default_parameter (f, parameters, Qcursor_color, build_string ("black"),
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4349 "cursorColor", "Foreground", RES_TYPE_STRING);
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4350 x_default_parameter (f, parameters, Qborder_color, build_string ("black"),
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4351 "borderColor", "BorderColor", RES_TYPE_STRING);
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4352 x_default_parameter (f, parameters, Qscreen_gamma, Qnil,
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4353 "screenGamma", "ScreenGamma", RES_TYPE_FLOAT);
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4354 x_default_parameter (f, parameters, Qline_spacing, Qnil,
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
4355 "lineSpacing", "LineSpacing", RES_TYPE_NUMBER);
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4356 x_default_parameter (f, parameters, Qleft_fringe, Qnil,
41726
2dd41afd9b55 Merged fringe width related changes from xfns.c.
Kim F. Storm <storm@cua.dk>
parents: 41638
diff changeset
4357 "leftFringe", "LeftFringe", RES_TYPE_NUMBER);
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4358 x_default_parameter (f, parameters, Qright_fringe, Qnil,
41726
2dd41afd9b55 Merged fringe width related changes from xfns.c.
Kim F. Storm <storm@cua.dk>
parents: 41638
diff changeset
4359 "rightFringe", "RightFringe", RES_TYPE_NUMBER);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4360
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4361 /* Init faces before x_default_parameter is called for scroll-bar
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4362 parameters because that function calls x_set_scroll_bar_width,
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4363 which calls change_frame_size, which calls Fset_window_buffer,
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4364 which runs hooks, which call Fvertical_motion. At the end, we
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4365 end up in init_iterator with a null face cache, which should not
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4366 happen. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4367 init_frame_faces (f);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
4368
109058
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 108303
diff changeset
4369 /* The X resources controlling the menu-bar and tool-bar are
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 108303
diff changeset
4370 processed specially at startup, and reflected in the mode
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 108303
diff changeset
4371 variables; ignore them here. */
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 108303
diff changeset
4372 x_default_parameter (f, parameters, Qmenu_bar_lines,
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 108303
diff changeset
4373 NILP (Vmenu_bar_mode)
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 108303
diff changeset
4374 ? make_number (0) : make_number (1),
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 108303
diff changeset
4375 NULL, NULL, RES_TYPE_NUMBER);
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 108303
diff changeset
4376 x_default_parameter (f, parameters, Qtool_bar_lines,
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 108303
diff changeset
4377 NILP (Vtool_bar_mode)
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 108303
diff changeset
4378 ? make_number (0) : make_number (1),
2f0720afc474 Change default-frame-alist and menu/tool-bar-mode interaction (Bug#2249).
Chong Yidong <cyd@stupidchicken.com>
parents: 108303
diff changeset
4379 NULL, NULL, RES_TYPE_NUMBER);
44109
b615e4daf825 [HAVE_IMAGES, HAVE_PBM]: Remove conditionals.
Jason Rumney <jasonr@gnu.org>
parents: 44097
diff changeset
4380
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4381 x_default_parameter (f, parameters, Qbuffer_predicate, Qnil,
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4382 "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL);
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4383 x_default_parameter (f, parameters, Qtitle, Qnil,
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4384 "title", "Title", RES_TYPE_STRING);
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4385 x_default_parameter (f, parameters, Qfullscreen, Qnil,
43398
8782b8cfed62 *** empty log message ***
Jason Rumney <jasonr@gnu.org>
parents: 43210
diff changeset
4386 "fullscreen", "Fullscreen", RES_TYPE_SYMBOL);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4387
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4388 f->output_data.w32->dwStyle = WS_OVERLAPPEDWINDOW;
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4389 f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window;
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
4390
49369
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
4391 f->output_data.w32->text_cursor = w32_load_cursor (IDC_IBEAM);
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
4392 f->output_data.w32->nontext_cursor = w32_load_cursor (IDC_ARROW);
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
4393 f->output_data.w32->modeline_cursor = w32_load_cursor (IDC_ARROW);
50229
e3a41ffa1cba Remove setup of cross_cursor (already has hand_cursor).
Kim F. Storm <storm@cua.dk>
parents: 50164
diff changeset
4394 f->output_data.w32->hand_cursor = w32_load_cursor (IDC_HAND);
49369
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
4395 f->output_data.w32->hourglass_cursor = w32_load_cursor (IDC_WAIT);
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
4396 f->output_data.w32->horizontal_drag_cursor = w32_load_cursor (IDC_SIZEWE);
5518e109ec3b 2003-01-21 Jason Rumney <jasonr@gnu.org>
Jason Rumney <jasonr@gnu.org>
parents: 49079
diff changeset
4397
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
4398 f->output_data.w32->current_cursor = f->output_data.w32->nontext_cursor;
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
4399
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4400 window_prompting = x_figure_window_size (f, parameters, 1);
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4401
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4402 tem = x_get_arg (dpyinfo, parameters, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4403 f->no_split = minibuffer_only || EQ (tem, Qt);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4404
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4405 w32_window (f, window_prompting, minibuffer_only);
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4406 x_icon (f, parameters);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4407
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4408 x_make_gc (f);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4409
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4410 /* Now consider the frame official. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4411 FRAME_W32_DISPLAY_INFO (f)->reference_count++;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4412 Vframe_list = Fcons (frame, Vframe_list);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4413
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4414 /* We need to do this after creating the window, so that the
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4415 icon-creation functions can say whose icon they're describing. */
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4416 x_default_parameter (f, parameters, Qicon_type, Qnil,
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4417 "bitmapIcon", "BitmapIcon", RES_TYPE_SYMBOL);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4418
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4419 x_default_parameter (f, parameters, Qauto_raise, Qnil,
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4420 "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4421 x_default_parameter (f, parameters, Qauto_lower, Qnil,
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4422 "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN);
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4423 x_default_parameter (f, parameters, Qcursor_type, Qbox,
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4424 "cursorType", "CursorType", RES_TYPE_SYMBOL);
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4425 x_default_parameter (f, parameters, Qscroll_bar_width, Qnil,
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4426 "scrollBarWidth", "ScrollBarWidth", RES_TYPE_NUMBER);
96403
4b6d1b55f59c * w32term.c (pfnGetFontUnicodeRanges): Remove unused function pointer.
Jason Rumney <jasonr@gnu.org>
parents: 96385
diff changeset
4427 x_default_parameter (f, parameters, Qalpha, Qnil,
4b6d1b55f59c * w32term.c (pfnGetFontUnicodeRanges): Remove unused function pointer.
Jason Rumney <jasonr@gnu.org>
parents: 96385
diff changeset
4428 "alpha", "Alpha", RES_TYPE_NUMBER);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4429
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
4430 /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4431 Change will not be effected unless different from the current
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
4432 FRAME_LINES (f). */
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
4433 width = FRAME_COLS (f);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
4434 height = FRAME_LINES (f);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
4435
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
4436 FRAME_LINES (f) = 0;
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
4437 SET_FRAME_COLS (f, 0);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4438 change_frame_size (f, height, width, 1, 0, 0);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4439
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4440 /* Tell the server what size and position, etc, we want, and how
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4441 badly we want them. This should be done after we have the menu
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4442 bar so that its size can be taken into account. */
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4443 BLOCK_INPUT;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4444 x_wm_set_size_hint (f, window_prompting, 0);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4445 UNBLOCK_INPUT;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4446
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4447 /* Make the window appear on the frame and enable display, unless
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4448 the caller says not to. However, with explicit parent, Emacs
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4449 cannot control visibility, so don't try. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4450 if (! f->output_data.w32->explicit_parent)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4451 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4452 Lisp_Object visibility;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4453
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
4454 visibility = x_get_arg (dpyinfo, parameters, Qvisibility, 0, 0, RES_TYPE_SYMBOL);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4455 if (EQ (visibility, Qunbound))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4456 visibility = Qt;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4457
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4458 if (EQ (visibility, Qicon))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4459 x_iconify_frame (f);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4460 else if (! NILP (visibility))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4461 x_make_frame_visible (f);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4462 else
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4463 /* Must have been Qnil. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4464 ;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4465 }
83616
b78afd4acd43 * term.c (init_tty): Better initialize ttys in windows.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83608
diff changeset
4466
b78afd4acd43 * term.c (init_tty): Better initialize ttys in windows.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83608
diff changeset
4467 /* Initialize `default-minibuffer-frame' in case this is the first
b78afd4acd43 * term.c (init_tty): Better initialize ttys in windows.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83608
diff changeset
4468 frame on this terminal. */
b78afd4acd43 * term.c (init_tty): Better initialize ttys in windows.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83608
diff changeset
4469 if (FRAME_HAS_MINIBUF_P (f)
b78afd4acd43 * term.c (init_tty): Better initialize ttys in windows.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83608
diff changeset
4470 && (!FRAMEP (kb->Vdefault_minibuffer_frame)
b78afd4acd43 * term.c (init_tty): Better initialize ttys in windows.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83608
diff changeset
4471 || !FRAME_LIVE_P (XFRAME (kb->Vdefault_minibuffer_frame))))
b78afd4acd43 * term.c (init_tty): Better initialize ttys in windows.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83608
diff changeset
4472 kb->Vdefault_minibuffer_frame = frame;
b78afd4acd43 * term.c (init_tty): Better initialize ttys in windows.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83608
diff changeset
4473
b78afd4acd43 * term.c (init_tty): Better initialize ttys in windows.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83608
diff changeset
4474 /* All remaining specified parameters, which have not been "used"
b78afd4acd43 * term.c (init_tty): Better initialize ttys in windows.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83608
diff changeset
4475 by x_get_arg and friends, now go in the misc. alist of the frame. */
85372
f7d19cfed7da * xselect.c (x_own_selection, x_handle_selection_clear)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85311
diff changeset
4476 for (tem = parameters; CONSP (tem); tem = XCDR (tem))
83616
b78afd4acd43 * term.c (init_tty): Better initialize ttys in windows.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83608
diff changeset
4477 if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
b78afd4acd43 * term.c (init_tty): Better initialize ttys in windows.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83608
diff changeset
4478 f->param_alist = Fcons (XCAR (tem), f->param_alist);
b78afd4acd43 * term.c (init_tty): Better initialize ttys in windows.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 83608
diff changeset
4479
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4480 UNGCPRO;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
4481
36594
756c28377036 (Fx_create_frame): Clear Vwindow_list.
Gerd Moellmann <gerd@gnu.org>
parents: 36312
diff changeset
4482 /* Make sure windows on this frame appear in calls to next-window
756c28377036 (Fx_create_frame): Clear Vwindow_list.
Gerd Moellmann <gerd@gnu.org>
parents: 36312
diff changeset
4483 and similar functions. */
756c28377036 (Fx_create_frame): Clear Vwindow_list.
Gerd Moellmann <gerd@gnu.org>
parents: 36312
diff changeset
4484 Vwindow_list = Qnil;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
4485
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4486 return unbind_to (count, frame);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4487 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4488
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4489 /* FRAME is used only to get a handle on the X display. We don't pass the
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4490 display info directly because we're called from frame.c, which doesn't
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4491 know about that structure. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4492 Lisp_Object
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
4493 x_get_focus_frame (struct frame *frame)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4494 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4495 struct w32_display_info *dpyinfo = FRAME_W32_DISPLAY_INFO (frame);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4496 Lisp_Object xfocus;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4497 if (! dpyinfo->w32_focus_frame)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4498 return Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4499
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4500 XSETFRAME (xfocus, dpyinfo->w32_focus_frame);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4501 return xfocus;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4502 }
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4503
84630
4197a953442f (Fx_focus_frame): Rename from Fw32_focus_frame.
Jason Rumney <jasonr@gnu.org>
parents: 83878
diff changeset
4504 DEFUN ("x-focus-frame", Fx_focus_frame, Sx_focus_frame, 1, 1, 0,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4505 doc: /* Give FRAME input focus, raising to foreground if necessary. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4506 (Lisp_Object frame)
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4507 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4508 x_focus_on_frame (check_x_frame (frame));
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4509 return Qnil;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4510 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4511
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4512
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 25646
diff changeset
4513 DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0,
111224
b9e560ce3ab6 Sync docs of some X, W32, NS C functions.
Glenn Morris <rgm@gnu.org>
parents: 111170
diff changeset
4514 doc: /* Internal function called by `color-defined-p', which see.
b9e560ce3ab6 Sync docs of some X, W32, NS C functions.
Glenn Morris <rgm@gnu.org>
parents: 111170
diff changeset
4515 \(Note that the Nextstep version of this function ignores FRAME.) */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4516 (Lisp_Object color, Lisp_Object frame)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4517 {
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4518 XColor foo;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4519 FRAME_PTR f = check_x_frame (frame);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4520
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
4521 CHECK_STRING (color);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4522
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
4523 if (w32_defined_color (f, SDATA (color), &foo, 0))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4524 return Qt;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4525 else
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4526 return Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4527 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4528
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 25646
diff changeset
4529 DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4530 doc: /* Internal function called by `color-values', which see. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4531 (Lisp_Object color, Lisp_Object frame)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4532 {
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4533 XColor foo;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4534 FRAME_PTR f = check_x_frame (frame);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4535
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
4536 CHECK_STRING (color);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4537
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
4538 if (w32_defined_color (f, SDATA (color), &foo, 0))
72529
892ea79efee6 (Fxw_color_values): Simplify; use list3.
Kim F. Storm <storm@cua.dk>
parents: 72274
diff changeset
4539 return list3 (make_number ((GetRValue (foo.pixel) << 8)
892ea79efee6 (Fxw_color_values): Simplify; use list3.
Kim F. Storm <storm@cua.dk>
parents: 72274
diff changeset
4540 | GetRValue (foo.pixel)),
892ea79efee6 (Fxw_color_values): Simplify; use list3.
Kim F. Storm <storm@cua.dk>
parents: 72274
diff changeset
4541 make_number ((GetGValue (foo.pixel) << 8)
892ea79efee6 (Fxw_color_values): Simplify; use list3.
Kim F. Storm <storm@cua.dk>
parents: 72274
diff changeset
4542 | GetGValue (foo.pixel)),
892ea79efee6 (Fxw_color_values): Simplify; use list3.
Kim F. Storm <storm@cua.dk>
parents: 72274
diff changeset
4543 make_number ((GetBValue (foo.pixel) << 8)
892ea79efee6 (Fxw_color_values): Simplify; use list3.
Kim F. Storm <storm@cua.dk>
parents: 72274
diff changeset
4544 | GetBValue (foo.pixel)));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4545 else
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4546 return Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4547 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4548
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 25646
diff changeset
4549 DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4550 doc: /* Internal function called by `display-color-p', which see. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4551 (Lisp_Object display)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4552 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4553 struct w32_display_info *dpyinfo = check_x_display_info (display);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4554
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4555 if ((dpyinfo->n_planes * dpyinfo->n_cbits) <= 2)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4556 return Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4557
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4558 return Qt;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4559 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4560
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4561 DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4562 Sx_display_grayscale_p, 0, 1, 0,
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4563 doc: /* Return t if DISPLAY supports shades of gray.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4564 Note that color displays do support shades of gray.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4565 The optional argument DISPLAY specifies which display to ask about.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4566 DISPLAY should be either a frame or a display name (a string).
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4567 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4568 (Lisp_Object display)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4569 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4570 struct w32_display_info *dpyinfo = check_x_display_info (display);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4571
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4572 if ((dpyinfo->n_planes * dpyinfo->n_cbits) <= 1)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4573 return Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4574
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4575 return Qt;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4576 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4577
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4578 DEFUN ("x-display-pixel-width", Fx_display_pixel_width,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4579 Sx_display_pixel_width, 0, 1, 0,
79393
09f6c4242048 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 79387
diff changeset
4580 doc: /* Return the width in pixels of DISPLAY.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4581 The optional argument DISPLAY specifies which display to ask about.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4582 DISPLAY should be either a frame or a display name (a string).
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4583 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4584 (Lisp_Object display)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4585 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4586 struct w32_display_info *dpyinfo = check_x_display_info (display);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4587
98240
5f73593cabcd * frame.c (x_fullscreen_adjust): Declare var as Display_Info.
Juanma Barranquero <lekktu@gmail.com>
parents: 97493
diff changeset
4588 return make_number (x_display_pixel_width (dpyinfo));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4589 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4590
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4591 DEFUN ("x-display-pixel-height", Fx_display_pixel_height,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4592 Sx_display_pixel_height, 0, 1, 0,
79393
09f6c4242048 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 79387
diff changeset
4593 doc: /* Return the height in pixels of DISPLAY.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4594 The optional argument DISPLAY specifies which display to ask about.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4595 DISPLAY should be either a frame or a display name (a string).
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4596 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4597 (Lisp_Object display)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4598 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4599 struct w32_display_info *dpyinfo = check_x_display_info (display);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4600
98240
5f73593cabcd * frame.c (x_fullscreen_adjust): Declare var as Display_Info.
Juanma Barranquero <lekktu@gmail.com>
parents: 97493
diff changeset
4601 return make_number (x_display_pixel_height (dpyinfo));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4602 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4603
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4604 DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4605 0, 1, 0,
79393
09f6c4242048 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 79387
diff changeset
4606 doc: /* Return the number of bitplanes of DISPLAY.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4607 The optional argument DISPLAY specifies which display to ask about.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4608 DISPLAY should be either a frame or a display name (a string).
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4609 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4610 (Lisp_Object display)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4611 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4612 struct w32_display_info *dpyinfo = check_x_display_info (display);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4613
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4614 return make_number (dpyinfo->n_planes * dpyinfo->n_cbits);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4615 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4616
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4617 DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4618 0, 1, 0,
79393
09f6c4242048 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 79387
diff changeset
4619 doc: /* Return the number of color cells of DISPLAY.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4620 The optional argument DISPLAY specifies which display to ask about.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4621 DISPLAY should be either a frame or a display name (a string).
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4622 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4623 (Lisp_Object display)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4624 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4625 struct w32_display_info *dpyinfo = check_x_display_info (display);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4626 HDC hdc;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4627 int cap;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4628
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4629 hdc = GetDC (dpyinfo->root_window);
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4630 if (dpyinfo->has_palette)
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4631 cap = GetDeviceCaps (hdc, SIZEPALETTE);
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4632 else
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
4633 cap = GetDeviceCaps (hdc, NUMCOLORS);
34998
5091928844df (Fx_display_color_cells): Determine correct value, when
Andrew Innes <andrewi@gnu.org>
parents: 34942
diff changeset
4634
43773
8d3931ead0df (Fx_display_color_cells): Force 24+ bit color depths to 24-bit.
Juanma Barranquero <lekktu@gmail.com>
parents: 43484
diff changeset
4635 /* We force 24+ bit depths to 24-bit, both to prevent an overflow
8d3931ead0df (Fx_display_color_cells): Force 24+ bit color depths to 24-bit.
Juanma Barranquero <lekktu@gmail.com>
parents: 43484
diff changeset
4636 and because probably is more meaningful on Windows anyway */
34998
5091928844df (Fx_display_color_cells): Determine correct value, when
Andrew Innes <andrewi@gnu.org>
parents: 34942
diff changeset
4637 if (cap < 0)
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
4638 cap = 1 << min (dpyinfo->n_planes * dpyinfo->n_cbits, 24);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
4639
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4640 ReleaseDC (dpyinfo->root_window, hdc);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
4641
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4642 return make_number (cap);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4643 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4644
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4645 DEFUN ("x-server-max-request-size", Fx_server_max_request_size,
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4646 Sx_server_max_request_size,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4647 0, 1, 0,
79393
09f6c4242048 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 79387
diff changeset
4648 doc: /* Return the maximum request size of the server of DISPLAY.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4649 The optional argument DISPLAY specifies which display to ask about.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4650 DISPLAY should be either a frame or a display name (a string).
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4651 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4652 (Lisp_Object display)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4653 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4654 struct w32_display_info *dpyinfo = check_x_display_info (display);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4655
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4656 return make_number (1);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4657 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4658
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4659 DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
79393
09f6c4242048 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 79387
diff changeset
4660 doc: /* Return the "vendor ID" string of the W32 system (Microsoft).
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4661 The optional argument DISPLAY specifies which display to ask about.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4662 DISPLAY should be either a frame or a display name (a string).
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4663 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4664 (Lisp_Object display)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4665 {
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
4666 return build_string ("Microsoft Corp.");
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4667 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4668
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4669 DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
79393
09f6c4242048 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 79387
diff changeset
4670 doc: /* Return the version numbers of the server of DISPLAY.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4671 The value is a list of three integers: the major and minor
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
4672 version numbers of the X Protocol in use, and the distributor-specific
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
4673 release number. See also the function `x-server-vendor'.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4674
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4675 The optional argument DISPLAY specifies which display to ask about.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4676 DISPLAY should be either a frame or a display name (a string).
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4677 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4678 (Lisp_Object display)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4679 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4680 return Fcons (make_number (w32_major_version),
33216
2eb7d429a997 (Fx_server_version): Include w32_build_number in the
Andrew Innes <andrewi@gnu.org>
parents: 32977
diff changeset
4681 Fcons (make_number (w32_minor_version),
2eb7d429a997 (Fx_server_version): Include w32_build_number in the
Andrew Innes <andrewi@gnu.org>
parents: 32977
diff changeset
4682 Fcons (make_number (w32_build_number), Qnil)));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4683 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4684
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4685 DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,
79393
09f6c4242048 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 79387
diff changeset
4686 doc: /* Return the number of screens on the server of DISPLAY.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4687 The optional argument DISPLAY specifies which display to ask about.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4688 DISPLAY should be either a frame or a display name (a string).
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4689 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4690 (Lisp_Object display)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4691 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4692 return make_number (1);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4693 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4694
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4695 DEFUN ("x-display-mm-height", Fx_display_mm_height,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4696 Sx_display_mm_height, 0, 1, 0,
79393
09f6c4242048 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 79387
diff changeset
4697 doc: /* Return the height in millimeters of DISPLAY.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4698 The optional argument DISPLAY specifies which display to ask about.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4699 DISPLAY should be either a frame or a display name (a string).
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4700 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4701 (Lisp_Object display)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4702 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4703 struct w32_display_info *dpyinfo = check_x_display_info (display);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4704 HDC hdc;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4705 int cap;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4706
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4707 hdc = GetDC (dpyinfo->root_window);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
4708
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4709 cap = GetDeviceCaps (hdc, VERTSIZE);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
4710
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4711 ReleaseDC (dpyinfo->root_window, hdc);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
4712
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4713 return make_number (cap);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4714 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4715
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4716 DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0,
79393
09f6c4242048 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 79387
diff changeset
4717 doc: /* Return the width in millimeters of DISPLAY.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4718 The optional argument DISPLAY specifies which display to ask about.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4719 DISPLAY should be either a frame or a display name (a string).
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4720 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4721 (Lisp_Object display)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4722 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4723 struct w32_display_info *dpyinfo = check_x_display_info (display);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4724
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4725 HDC hdc;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4726 int cap;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4727
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4728 hdc = GetDC (dpyinfo->root_window);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
4729
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4730 cap = GetDeviceCaps (hdc, HORZSIZE);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
4731
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4732 ReleaseDC (dpyinfo->root_window, hdc);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
4733
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4734 return make_number (cap);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4735 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4736
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4737 DEFUN ("x-display-backing-store", Fx_display_backing_store,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4738 Sx_display_backing_store, 0, 1, 0,
79393
09f6c4242048 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 79387
diff changeset
4739 doc: /* Return an indication of whether DISPLAY does backing store.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4740 The value may be `always', `when-mapped', or `not-useful'.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4741 The optional argument DISPLAY specifies which display to ask about.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4742 DISPLAY should be either a frame or a display name (a string).
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4743 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4744 (Lisp_Object display)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4745 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4746 return intern ("not-useful");
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4747 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4748
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4749 DEFUN ("x-display-visual-class", Fx_display_visual_class,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4750 Sx_display_visual_class, 0, 1, 0,
79393
09f6c4242048 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 79387
diff changeset
4751 doc: /* Return the visual class of DISPLAY.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4752 The value is one of the symbols `static-gray', `gray-scale',
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4753 `static-color', `pseudo-color', `true-color', or `direct-color'.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4754
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4755 The optional argument DISPLAY specifies which display to ask about.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4756 DISPLAY should be either a frame or a display name (a string).
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4757 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4758 (Lisp_Object display)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4759 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4760 struct w32_display_info *dpyinfo = check_x_display_info (display);
34998
5091928844df (Fx_display_color_cells): Determine correct value, when
Andrew Innes <andrewi@gnu.org>
parents: 34942
diff changeset
4761 Lisp_Object result = Qnil;
5091928844df (Fx_display_color_cells): Determine correct value, when
Andrew Innes <andrewi@gnu.org>
parents: 34942
diff changeset
4762
5091928844df (Fx_display_color_cells): Determine correct value, when
Andrew Innes <andrewi@gnu.org>
parents: 34942
diff changeset
4763 if (dpyinfo->has_palette)
5091928844df (Fx_display_color_cells): Determine correct value, when
Andrew Innes <andrewi@gnu.org>
parents: 34942
diff changeset
4764 result = intern ("pseudo-color");
5091928844df (Fx_display_color_cells): Determine correct value, when
Andrew Innes <andrewi@gnu.org>
parents: 34942
diff changeset
4765 else if (dpyinfo->n_planes * dpyinfo->n_cbits == 1)
5091928844df (Fx_display_color_cells): Determine correct value, when
Andrew Innes <andrewi@gnu.org>
parents: 34942
diff changeset
4766 result = intern ("static-grey");
5091928844df (Fx_display_color_cells): Determine correct value, when
Andrew Innes <andrewi@gnu.org>
parents: 34942
diff changeset
4767 else if (dpyinfo->n_planes * dpyinfo->n_cbits == 4)
5091928844df (Fx_display_color_cells): Determine correct value, when
Andrew Innes <andrewi@gnu.org>
parents: 34942
diff changeset
4768 result = intern ("static-color");
5091928844df (Fx_display_color_cells): Determine correct value, when
Andrew Innes <andrewi@gnu.org>
parents: 34942
diff changeset
4769 else if (dpyinfo->n_planes * dpyinfo->n_cbits > 8)
5091928844df (Fx_display_color_cells): Determine correct value, when
Andrew Innes <andrewi@gnu.org>
parents: 34942
diff changeset
4770 result = intern ("true-color");
5091928844df (Fx_display_color_cells): Determine correct value, when
Andrew Innes <andrewi@gnu.org>
parents: 34942
diff changeset
4771
5091928844df (Fx_display_color_cells): Determine correct value, when
Andrew Innes <andrewi@gnu.org>
parents: 34942
diff changeset
4772 return result;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4773 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4774
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4775 DEFUN ("x-display-save-under", Fx_display_save_under,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4776 Sx_display_save_under, 0, 1, 0,
79393
09f6c4242048 (Fx_create_frame, Fx_display_pixel_width, Fx_display_pixel_height,
Juanma Barranquero <lekktu@gmail.com>
parents: 79387
diff changeset
4777 doc: /* Return t if DISPLAY supports the save-under feature.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4778 The optional argument DISPLAY specifies which display to ask about.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4779 DISPLAY should be either a frame or a display name (a string).
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4780 If omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4781 (Lisp_Object display)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4782 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4783 return Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4784 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4785
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4786 int
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
4787 x_pixel_width (register struct frame *f)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4788 {
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
4789 return FRAME_PIXEL_WIDTH (f);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4790 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4791
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4792 int
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
4793 x_pixel_height (register struct frame *f)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4794 {
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
4795 return FRAME_PIXEL_HEIGHT (f);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4796 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4797
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4798 int
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
4799 x_char_width (register struct frame *f)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4800 {
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
4801 return FRAME_COLUMN_WIDTH (f);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4802 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4803
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4804 int
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
4805 x_char_height (register struct frame *f)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4806 {
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
4807 return FRAME_LINE_HEIGHT (f);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4808 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4809
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4810 int
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
4811 x_screen_planes (register struct frame *f)
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4812 {
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4813 return FRAME_W32_DISPLAY_INFO (f)->n_planes;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4814 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4815
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4816 /* Return the display structure for the display named NAME.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4817 Open a new connection if necessary. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4818
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4819 struct w32_display_info *
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
4820 x_display_info_for_name (Lisp_Object name)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4821 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4822 Lisp_Object names;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4823 struct w32_display_info *dpyinfo;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4824
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
4825 CHECK_STRING (name);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4826
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4827 for (dpyinfo = &one_w32_display_info, names = w32_display_name_list;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4828 dpyinfo;
25646
9154af188477 Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents: 25289
diff changeset
4829 dpyinfo = dpyinfo->next, names = XCDR (names))
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4830 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4831 Lisp_Object tem;
25646
9154af188477 Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents: 25289
diff changeset
4832 tem = Fstring_equal (XCAR (XCAR (names)), name);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4833 if (!NILP (tem))
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4834 return dpyinfo;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4835 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4836
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4837 /* Use this general default value to start with. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4838 Vx_resource_name = Vinvocation_name;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4839
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4840 validate_x_resource_name ();
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4841
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4842 dpyinfo = w32_term_init (name, (unsigned char *)0,
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
4843 (char *) SDATA (Vx_resource_name));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4844
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4845 if (dpyinfo == 0)
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
4846 error ("Cannot connect to server %s", SDATA (name));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4847
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4848 w32_in_use = 1;
100380
5111bebfbd1c (x_display_info_for_name, Fx_open_connection): Set
Jason Rumney <jasonr@gnu.org>
parents: 99235
diff changeset
4849 XSETFASTINT (Vwindow_system_version, w32_major_version);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4850
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4851 return dpyinfo;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4852 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4853
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4854 DEFUN ("x-open-connection", Fx_open_connection, Sx_open_connection,
111224
b9e560ce3ab6 Sync docs of some X, W32, NS C functions.
Glenn Morris <rgm@gnu.org>
parents: 111170
diff changeset
4855 1, 3, 0, doc: /* Open a connection to a display server.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4856 DISPLAY is the name of the display to connect to.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4857 Optional second arg XRM-STRING is a string of resources in xrdb format.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4858 If the optional third arg MUST-SUCCEED is non-nil,
111224
b9e560ce3ab6 Sync docs of some X, W32, NS C functions.
Glenn Morris <rgm@gnu.org>
parents: 111170
diff changeset
4859 terminate Emacs if we can't open the connection.
b9e560ce3ab6 Sync docs of some X, W32, NS C functions.
Glenn Morris <rgm@gnu.org>
parents: 111170
diff changeset
4860 \(In the Nextstep version, the last two arguments are currently ignored.) */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4861 (Lisp_Object display, Lisp_Object xrm_string, Lisp_Object must_succeed)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4862 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4863 unsigned char *xrm_option;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4864 struct w32_display_info *dpyinfo;
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4865
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4866 /* If initialization has already been done, return now to avoid
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4867 overwriting critical parts of one_w32_display_info. */
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4868 if (w32_in_use)
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4869 return Qnil;
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4870
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
4871 CHECK_STRING (display);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4872 if (! NILP (xrm_string))
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
4873 CHECK_STRING (xrm_string);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4874
83571
ca1c27e2707e (x_set_tool_bar_lines): Don't use updating_frame.
Jason Rumney <jasonr@gnu.org>
parents: 76700
diff changeset
4875 #if 0
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4876 if (! EQ (Vwindow_system, intern ("w32")))
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4877 error ("Not using Microsoft Windows");
83571
ca1c27e2707e (x_set_tool_bar_lines): Don't use updating_frame.
Jason Rumney <jasonr@gnu.org>
parents: 76700
diff changeset
4878 #endif
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4879
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4880 /* Allow color mapping to be defined externally; first look in user's
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4881 HOME directory, then in Emacs etc dir for a file called rgb.txt. */
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4882 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4883 Lisp_Object color_file;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4884 struct gcpro gcpro1;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4885
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
4886 color_file = build_string ("~/rgb.txt");
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4887
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4888 GCPRO1 (color_file);
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4889
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4890 if (NILP (Ffile_readable_p (color_file)))
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4891 color_file =
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4892 Fexpand_file_name (build_string ("rgb.txt"),
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4893 Fsymbol_value (intern ("data-directory")));
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4894
97194
d45e07b45d86 NS port now uses etc/rgb.txt instead of etc/Emacs.clr (now removed); function Fw32_load_color_file moved to xfaces x_load_color_file
Adrian Robert <Adrian.B.Robert@gmail.com>
parents: 97141
diff changeset
4895 Vw32_color_map = Fx_load_color_file (color_file);
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4896
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4897 UNGCPRO;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4898 }
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4899 if (NILP (Vw32_color_map))
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4900 Vw32_color_map = Fw32_default_color_map ();
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4901
51474
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
4902 /* Merge in system logical colors. */
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
4903 add_system_logical_colors_to_map (&Vw32_color_map);
0dbfd1fe2e91 (add_system_logical_colors_to_map): New function.
Jason Rumney <jasonr@gnu.org>
parents: 51211
diff changeset
4904
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4905 if (! NILP (xrm_string))
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
4906 xrm_option = (unsigned char *) SDATA (xrm_string);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4907 else
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4908 xrm_option = (unsigned char *) 0;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4909
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4910 /* Use this general default value to start with. */
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4911 /* First remove .exe suffix from invocation-name - it looks ugly. */
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4912 {
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4913 char basename[ MAX_PATH ], *str;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4914
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
4915 strcpy (basename, SDATA (Vinvocation_name));
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4916 str = strrchr (basename, '.');
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4917 if (str) *str = 0;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4918 Vinvocation_name = build_string (basename);
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
4919 }
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4920 Vx_resource_name = Vinvocation_name;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4921
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4922 validate_x_resource_name ();
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4923
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4924 /* This is what opens the connection and sets x_current_display.
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4925 This also initializes many symbols, such as those used for input. */
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4926 dpyinfo = w32_term_init (display, xrm_option,
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
4927 (char *) SDATA (Vx_resource_name));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4928
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4929 if (dpyinfo == 0)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4930 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4931 if (!NILP (must_succeed))
14353
d0d8d9d73f7f backout 1.3
Geoff Voelker <voelker@cs.washington.edu>
parents: 14243
diff changeset
4932 fatal ("Cannot connect to server %s.\n",
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
4933 SDATA (display));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4934 else
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
4935 error ("Cannot connect to server %s", SDATA (display));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4936 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4937
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4938 w32_in_use = 1;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
4939
100380
5111bebfbd1c (x_display_info_for_name, Fx_open_connection): Set
Jason Rumney <jasonr@gnu.org>
parents: 99235
diff changeset
4940 XSETFASTINT (Vwindow_system_version, w32_major_version);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4941 return Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4942 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4943
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4944 DEFUN ("x-close-connection", Fx_close_connection,
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4945 Sx_close_connection, 1, 1, 0,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4946 doc: /* Close the connection to DISPLAY's server.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4947 For DISPLAY, specify either a frame or a display name (a string).
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4948 If DISPLAY is nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4949 (Lisp_Object display)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4950 {
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
4951 struct w32_display_info *dpyinfo = check_x_display_info (display);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4952 int i;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4953
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4954 if (dpyinfo->reference_count > 0)
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4955 error ("Display still has frames on it");
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4956
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4957 BLOCK_INPUT;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4958 x_destroy_all_bitmaps (dpyinfo);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4959
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4960 x_delete_display (dpyinfo);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4961 UNBLOCK_INPUT;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4962
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4963 return Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4964 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4965
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4966 DEFUN ("x-display-list", Fx_display_list, Sx_display_list, 0, 0, 0,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
4967 doc: /* Return the list of display names that Emacs has connections to. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4968 (void)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4969 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4970 Lisp_Object tail, result;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4971
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4972 result = Qnil;
85372
f7d19cfed7da * xselect.c (x_own_selection, x_handle_selection_clear)
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 85311
diff changeset
4973 for (tail = w32_display_name_list; CONSP (tail); tail = XCDR (tail))
25646
9154af188477 Use XCAR and XCDR instead of explicit member references.
Ken Raeburn <raeburn@raeburn.org>
parents: 25289
diff changeset
4974 result = Fcons (XCAR (XCAR (tail)), result);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4975
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4976 return result;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4977 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4978
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4979 DEFUN ("x-synchronize", Fx_synchronize, Sx_synchronize, 1, 2, 0,
111170
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
4980 doc: /* If ON is non-nil, report X errors as soon as the erring request is made.
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
4981 This function only has an effect on X Windows. With MS Windows, it is
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
4982 defined but does nothing.
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
4983
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
4984 If ON is nil, allow buffering of requests.
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
4985 Turning on synchronization prohibits the Xlib routines from buffering
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
4986 requests and seriously degrades performance, but makes debugging much
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
4987 easier.
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
4988 The optional second argument TERMINAL specifies which display to act on.
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
4989 TERMINAL should be a terminal object, a frame or a display name (a string).
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
4990 If TERMINAL is omitted or nil, that stands for the selected frame's display. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
4991 (Lisp_Object on, Lisp_Object display)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4992 {
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4993 return Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4994 }
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
4995
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4996
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4997
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4998 /***********************************************************************
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
4999 Window properties
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5000 ***********************************************************************/
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5001
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5002 DEFUN ("x-change-window-property", Fx_change_window_property,
53844
0093eae529e8 macfns.c, w32fns.c (Fx_change_window_property):
Jan Djärv <jan.h.d@swipnet.se>
parents: 53798
diff changeset
5003 Sx_change_window_property, 2, 6, 0,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5004 doc: /* Change window property PROP to VALUE on the X window of FRAME.
111170
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5005 PROP must be a string. VALUE may be a string or a list of conses,
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5006 numbers and/or strings. If an element in the list is a string, it is
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5007 converted to an atom and the value of the Atom is used. If an element
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5008 is a cons, it is converted to a 32 bit number where the car is the 16
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5009 top bits and the cdr is the lower 16 bits.
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5010
53844
0093eae529e8 macfns.c, w32fns.c (Fx_change_window_property):
Jan Djärv <jan.h.d@swipnet.se>
parents: 53798
diff changeset
5011 FRAME nil or omitted means use the selected frame.
0093eae529e8 macfns.c, w32fns.c (Fx_change_window_property):
Jan Djärv <jan.h.d@swipnet.se>
parents: 53798
diff changeset
5012 If TYPE is given and non-nil, it is the name of the type of VALUE.
0093eae529e8 macfns.c, w32fns.c (Fx_change_window_property):
Jan Djärv <jan.h.d@swipnet.se>
parents: 53798
diff changeset
5013 If TYPE is not given or nil, the type is STRING.
0093eae529e8 macfns.c, w32fns.c (Fx_change_window_property):
Jan Djärv <jan.h.d@swipnet.se>
parents: 53798
diff changeset
5014 FORMAT gives the size in bits of each element if VALUE is a list.
0093eae529e8 macfns.c, w32fns.c (Fx_change_window_property):
Jan Djärv <jan.h.d@swipnet.se>
parents: 53798
diff changeset
5015 It must be one of 8, 16 or 32.
0093eae529e8 macfns.c, w32fns.c (Fx_change_window_property):
Jan Djärv <jan.h.d@swipnet.se>
parents: 53798
diff changeset
5016 If VALUE is a string or FORMAT is nil or not given, FORMAT defaults to 8.
0093eae529e8 macfns.c, w32fns.c (Fx_change_window_property):
Jan Djärv <jan.h.d@swipnet.se>
parents: 53798
diff changeset
5017 If OUTER_P is non-nil, the property is changed for the outer X window of
111170
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5018 FRAME. Default is to change on the edit X window. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
5019 (Lisp_Object prop, Lisp_Object value, Lisp_Object frame, Lisp_Object type, Lisp_Object format, Lisp_Object outer_p)
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5020 {
33387
01a10bc04233 (Qw32_charset_hangeul): Rename to match w32 headers.
Jason Rumney <jasonr@gnu.org>
parents: 33216
diff changeset
5021 #if 0 /* TODO : port window properties to W32 */
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5022 struct frame *f = check_x_frame (frame);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5023 Atom prop_atom;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5024
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
5025 CHECK_STRING (prop);
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
5026 CHECK_STRING (value);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5027
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5028 BLOCK_INPUT;
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
5029 prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5030 XChangeProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f),
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5031 prop_atom, XA_STRING, 8, PropModeReplace,
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
5032 SDATA (value), SCHARS (value));
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5033
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5034 /* Make sure the property is set when we return. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5035 XFlush (FRAME_W32_DISPLAY (f));
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5036 UNBLOCK_INPUT;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5037
33387
01a10bc04233 (Qw32_charset_hangeul): Rename to match w32 headers.
Jason Rumney <jasonr@gnu.org>
parents: 33216
diff changeset
5038 #endif /* TODO */
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5039
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5040 return value;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5041 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5042
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5043
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5044 DEFUN ("x-delete-window-property", Fx_delete_window_property,
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5045 Sx_delete_window_property, 1, 2, 0,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5046 doc: /* Remove window property PROP from X window of FRAME.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5047 FRAME nil or omitted means use the selected frame. Value is PROP. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
5048 (Lisp_Object prop, Lisp_Object frame)
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5049 {
33387
01a10bc04233 (Qw32_charset_hangeul): Rename to match w32 headers.
Jason Rumney <jasonr@gnu.org>
parents: 33216
diff changeset
5050 #if 0 /* TODO : port window properties to W32 */
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5051
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5052 struct frame *f = check_x_frame (frame);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5053 Atom prop_atom;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5054
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
5055 CHECK_STRING (prop);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5056 BLOCK_INPUT;
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
5057 prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5058 XDeleteProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), prop_atom);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5059
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5060 /* Make sure the property is removed when we return. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5061 XFlush (FRAME_W32_DISPLAY (f));
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5062 UNBLOCK_INPUT;
33387
01a10bc04233 (Qw32_charset_hangeul): Rename to match w32 headers.
Jason Rumney <jasonr@gnu.org>
parents: 33216
diff changeset
5063 #endif /* TODO */
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5064
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5065 return prop;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5066 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5067
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5068
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5069 DEFUN ("x-window-property", Fx_window_property, Sx_window_property,
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5070 1, 2, 0,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5071 doc: /* Value is the value of window property PROP on FRAME.
111170
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5072 If FRAME is nil or omitted, use the selected frame.
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5073
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5074 On MS Windows, this function only accepts the PROP and FRAME arguments.
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5075
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5076 On X Windows, the following optional arguments are also accepted:
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5077 If TYPE is nil or omitted, get the property as a string.
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5078 Otherwise TYPE is the name of the atom that denotes the type expected.
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5079 If SOURCE is non-nil, get the property on that window instead of from
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5080 FRAME. The number 0 denotes the root window.
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5081 If DELETE_P is non-nil, delete the property after retreiving it.
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5082 If VECTOR_RET_P is non-nil, don't return a string but a vector of values.
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5083
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5084 Value is nil if FRAME hasn't a property with name PROP or if PROP has
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
5085 no value of TYPE (always string in the MS Windows case). */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
5086 (Lisp_Object prop, Lisp_Object frame)
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5087 {
33387
01a10bc04233 (Qw32_charset_hangeul): Rename to match w32 headers.
Jason Rumney <jasonr@gnu.org>
parents: 33216
diff changeset
5088 #if 0 /* TODO : port window properties to W32 */
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5089
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5090 struct frame *f = check_x_frame (frame);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5091 Atom prop_atom;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5092 int rc;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5093 Lisp_Object prop_value = Qnil;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5094 char *tmp_data = NULL;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5095 Atom actual_type;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5096 int actual_format;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5097 unsigned long actual_size, bytes_remaining;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5098
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
5099 CHECK_STRING (prop);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5100 BLOCK_INPUT;
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
5101 prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5102 rc = XGetWindowProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f),
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5103 prop_atom, 0, 0, False, XA_STRING,
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5104 &actual_type, &actual_format, &actual_size,
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5105 &bytes_remaining, (unsigned char **) &tmp_data);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5106 if (rc == Success)
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5107 {
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5108 int size = bytes_remaining;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5109
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5110 XFree (tmp_data);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5111 tmp_data = NULL;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5112
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5113 rc = XGetWindowProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f),
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5114 prop_atom, 0, bytes_remaining,
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5115 False, XA_STRING,
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5116 &actual_type, &actual_format,
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5117 &actual_size, &bytes_remaining,
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5118 (unsigned char **) &tmp_data);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5119 if (rc == Success)
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5120 prop_value = make_string (tmp_data, size);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5121
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5122 XFree (tmp_data);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5123 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5124
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5125 UNBLOCK_INPUT;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5126
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5127 return prop_value;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5128
33387
01a10bc04233 (Qw32_charset_hangeul): Rename to match w32 headers.
Jason Rumney <jasonr@gnu.org>
parents: 33216
diff changeset
5129 #endif /* TODO */
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5130 return Qnil;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5131 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5132
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5133
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5134
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5135 /***********************************************************************
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5136 Busy cursor
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5137 ***********************************************************************/
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5138
96674
ff312a846b25 * w32fns.c (Fx_create_frame): Remove duplicate unwind_protect.
Jason Rumney <jasonr@gnu.org>
parents: 96664
diff changeset
5139 /* Default number of seconds to wait before displaying an hourglass
ff312a846b25 * w32fns.c (Fx_create_frame): Remove duplicate unwind_protect.
Jason Rumney <jasonr@gnu.org>
parents: 96664
diff changeset
5140 cursor. Duplicated from xdisp.c, but cannot use the version there
ff312a846b25 * w32fns.c (Fx_create_frame): Remove duplicate unwind_protect.
Jason Rumney <jasonr@gnu.org>
parents: 96664
diff changeset
5141 due to lack of atimers on w32. */
ff312a846b25 * w32fns.c (Fx_create_frame): Remove duplicate unwind_protect.
Jason Rumney <jasonr@gnu.org>
parents: 96664
diff changeset
5142 #define DEFAULT_HOURGLASS_DELAY 1
ff312a846b25 * w32fns.c (Fx_create_frame): Remove duplicate unwind_protect.
Jason Rumney <jasonr@gnu.org>
parents: 96664
diff changeset
5143 extern Lisp_Object Vhourglass_delay;
ff312a846b25 * w32fns.c (Fx_create_frame): Remove duplicate unwind_protect.
Jason Rumney <jasonr@gnu.org>
parents: 96664
diff changeset
5144
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5145 /* Return non-zero if houglass timer has been started or hourglass is shown. */
96664
b306a69b9d7f applying patch to consolidate non-GUI portion of hourglass implementation as posted at http://thread.gmane.org/gmane.emacs.devel/98341
Adrian Robert <Adrian.B.Robert@gmail.com>
parents: 96662
diff changeset
5146 /* PENDING: if W32 can use atimers (atimer.[hc]) then the common impl in
b306a69b9d7f applying patch to consolidate non-GUI portion of hourglass implementation as posted at http://thread.gmane.org/gmane.emacs.devel/98341
Adrian Robert <Adrian.B.Robert@gmail.com>
parents: 96662
diff changeset
5147 xdisp.c could be used. */
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5148
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5149 int
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
5150 hourglass_started (void)
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5151 {
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5152 return hourglass_shown_p || hourglass_timer;
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5153 }
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5154
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5155 /* Cancel a currently active hourglass timer, and start a new one. */
27936
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
5156
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
5157 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
5158 start_hourglass (void)
27936
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
5159 {
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5160 DWORD delay;
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5161 int secs, msecs = 0;
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5162 struct frame * f = SELECTED_FRAME ();
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5163
93319
a461c5c16bd5 (start_hourglass): Suppress hourglass on tty frames.
Jason Rumney <jasonr@gnu.org>
parents: 93075
diff changeset
5164 /* No cursors on non GUI frames. */
a461c5c16bd5 (start_hourglass): Suppress hourglass on tty frames.
Jason Rumney <jasonr@gnu.org>
parents: 93075
diff changeset
5165 if (!FRAME_W32_P (f))
a461c5c16bd5 (start_hourglass): Suppress hourglass on tty frames.
Jason Rumney <jasonr@gnu.org>
parents: 93075
diff changeset
5166 return;
a461c5c16bd5 (start_hourglass): Suppress hourglass on tty frames.
Jason Rumney <jasonr@gnu.org>
parents: 93075
diff changeset
5167
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5168 cancel_hourglass ();
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5169
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5170 if (INTEGERP (Vhourglass_delay)
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5171 && XINT (Vhourglass_delay) > 0)
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5172 secs = XFASTINT (Vhourglass_delay);
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5173 else if (FLOATP (Vhourglass_delay)
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5174 && XFLOAT_DATA (Vhourglass_delay) > 0)
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
5175 {
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
5176 Lisp_Object tem;
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5177 tem = Ftruncate (Vhourglass_delay, Qnil);
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
5178 secs = XFASTINT (tem);
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5179 msecs = (XFLOAT_DATA (Vhourglass_delay) - secs) * 1000;
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5180 }
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5181 else
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5182 secs = DEFAULT_HOURGLASS_DELAY;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5183
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5184 delay = secs * 1000 + msecs;
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5185 hourglass_hwnd = FRAME_W32_WINDOW (f);
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5186 hourglass_timer = SetTimer (hourglass_hwnd, HOURGLASS_ID, delay, NULL);
27936
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
5187 }
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
5188
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
5189
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5190 /* Cancel the hourglass cursor timer if active, hide an hourglass
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5191 cursor if shown. */
27936
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
5192
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
5193 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
5194 cancel_hourglass (void)
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5195 {
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5196 if (hourglass_timer)
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5197 {
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5198 KillTimer (hourglass_hwnd, hourglass_timer);
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5199 hourglass_timer = 0;
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5200 }
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5201
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5202 if (hourglass_shown_p)
96674
ff312a846b25 * w32fns.c (Fx_create_frame): Remove duplicate unwind_protect.
Jason Rumney <jasonr@gnu.org>
parents: 96664
diff changeset
5203 w32_hide_hourglass ();
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5204 }
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5205
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5206
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5207 /* Timer function of hourglass_timer.
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5208
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5209 Display an hourglass cursor. Set the hourglass_p flag in display info
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5210 to indicate that an hourglass cursor is shown. */
27936
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
5211
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
5212 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
5213 w32_show_hourglass (struct frame *f)
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5214 {
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5215 if (!hourglass_shown_p)
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5216 {
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5217 f->output_data.w32->hourglass_p = 1;
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5218 if (!menubar_in_use && !current_popup_menu)
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5219 SetCursor (f->output_data.w32->hourglass_cursor);
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5220 hourglass_shown_p = 1;
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5221 }
27936
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
5222 }
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
5223
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
5224
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5225 /* Hide the hourglass cursor on all frames, if it is currently shown. */
27936
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
5226
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
5227 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
5228 w32_hide_hourglass (void)
27936
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
5229 {
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5230 if (hourglass_shown_p)
27936
4c1ad68f8688 Bring up to date with xfns.c changes from 2000-02-25 and 2000-02-21.
Jason Rumney <jasonr@gnu.org>
parents: 27894
diff changeset
5231 {
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5232 struct frame *f = x_window_to_frame (&one_w32_display_info,
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5233 hourglass_hwnd);
101901
3447d99a0529 (w32_hide_hourglass): Handle case where frame
Jason Rumney <jasonr@gnu.org>
parents: 101276
diff changeset
5234 if (f)
3447d99a0529 (w32_hide_hourglass): Handle case where frame
Jason Rumney <jasonr@gnu.org>
parents: 101276
diff changeset
5235 f->output_data.w32->hourglass_p = 0;
3447d99a0529 (w32_hide_hourglass): Handle case where frame
Jason Rumney <jasonr@gnu.org>
parents: 101276
diff changeset
5236 else
3447d99a0529 (w32_hide_hourglass): Handle case where frame
Jason Rumney <jasonr@gnu.org>
parents: 101276
diff changeset
5237 /* If frame was deleted, restore to selected frame's cursor. */
3447d99a0529 (w32_hide_hourglass): Handle case where frame
Jason Rumney <jasonr@gnu.org>
parents: 101276
diff changeset
5238 f = SELECTED_FRAME ();
3447d99a0529 (w32_hide_hourglass): Handle case where frame
Jason Rumney <jasonr@gnu.org>
parents: 101276
diff changeset
5239
3447d99a0529 (w32_hide_hourglass): Handle case where frame
Jason Rumney <jasonr@gnu.org>
parents: 101276
diff changeset
5240 if (FRAME_W32_P (f))
3447d99a0529 (w32_hide_hourglass): Handle case where frame
Jason Rumney <jasonr@gnu.org>
parents: 101276
diff changeset
5241 SetCursor (f->output_data.w32->current_cursor);
3447d99a0529 (w32_hide_hourglass): Handle case where frame
Jason Rumney <jasonr@gnu.org>
parents: 101276
diff changeset
5242 else
3447d99a0529 (w32_hide_hourglass): Handle case where frame
Jason Rumney <jasonr@gnu.org>
parents: 101276
diff changeset
5243 /* No cursors on non GUI frames - restore to stock arrow cursor. */
3447d99a0529 (w32_hide_hourglass): Handle case where frame
Jason Rumney <jasonr@gnu.org>
parents: 101276
diff changeset
5244 SetCursor (w32_load_cursor (IDC_ARROW));
3447d99a0529 (w32_hide_hourglass): Handle case where frame
Jason Rumney <jasonr@gnu.org>
parents: 101276
diff changeset
5245
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
5246 hourglass_shown_p = 0;
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
5247 }
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5248 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5249
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5250
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5251
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5252 /***********************************************************************
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5253 Tool tips
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5254 ***********************************************************************/
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5255
109100
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
5256 static Lisp_Object x_create_tip_frame (struct w32_display_info *,
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
5257 Lisp_Object, Lisp_Object);
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
5258 static void compute_tip_xy (struct frame *, Lisp_Object, Lisp_Object,
2bc9a0c04c87 Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents: 109058
diff changeset
5259 Lisp_Object, int, int, int *, int *);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5260
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5261 /* The frame of a currently visible tooltip. */
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5262
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5263 Lisp_Object tip_frame;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5264
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5265 /* If non-nil, a timer started that hides the last tooltip when it
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5266 fires. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5267
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5268 Lisp_Object tip_timer;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5269 Window tip_window;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5270
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5271 /* If non-nil, a vector of 3 elements containing the last args
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5272 with which x-show-tip was called. See there. */
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5273
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5274 Lisp_Object last_show_tip_args;
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5275
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5276 /* Maximum size for tooltips; a cons (COLUMNS . ROWS). */
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5277
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5278 Lisp_Object Vx_max_tooltip_size;
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5279
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5280
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5281 static Lisp_Object
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
5282 unwind_create_tip_frame (Lisp_Object frame)
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5283 {
34638
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34546
diff changeset
5284 Lisp_Object deleted;
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34546
diff changeset
5285
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34546
diff changeset
5286 deleted = unwind_create_frame (frame);
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34546
diff changeset
5287 if (EQ (deleted, Qt))
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34546
diff changeset
5288 {
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34546
diff changeset
5289 tip_window = NULL;
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34546
diff changeset
5290 tip_frame = Qnil;
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34546
diff changeset
5291 }
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5292
34638
abb4510a89f6 (unwind_create_frame): Return t if frame was deleted.
Gerd Moellmann <gerd@gnu.org>
parents: 34546
diff changeset
5293 return deleted;
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5294 }
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5295
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5296
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5297 /* Create a frame for a tooltip on the display described by DPYINFO.
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5298 PARMS is a list of frame parameters. TEXT is the string to
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5299 display in the tip frame. Value is the frame.
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5300
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5301 Note that functions called here, esp. x_default_parameter can
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5302 signal errors, for instance when a specified color name is
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5303 undefined. We have to make sure that we're in a consistent state
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5304 when this happens. */
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5305
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5306 static Lisp_Object
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
5307 x_create_tip_frame (struct w32_display_info *dpyinfo,
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
5308 Lisp_Object parms, Lisp_Object text)
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5309 {
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5310 struct frame *f;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5311 Lisp_Object frame, tem;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5312 Lisp_Object name;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5313 long window_prompting = 0;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5314 int width, height;
46285
3f111801efb4 Rename BINDING_STACK_SIZE to SPECPDL_INDEX.
Juanma Barranquero <lekktu@gmail.com>
parents: 46272
diff changeset
5315 int count = SPECPDL_INDEX ();
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5316 struct gcpro gcpro1, gcpro2, gcpro3;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5317 struct kboard *kb;
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5318 int face_change_count_before = face_change_count;
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5319 Lisp_Object buffer;
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5320 struct buffer *old_buffer;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5321
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5322 check_w32 ();
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5323
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5324 /* Use this general default value to start with until we know if
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5325 this frame has a specified name. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5326 Vx_resource_name = Vinvocation_name;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5327
83878
f65f55d787ec Horizontal mouse wheel support:
Jason Rumney <jasonr@gnu.org>
parents: 83648
diff changeset
5328 kb = dpyinfo->terminal->kboard;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5329
107753
3153ca396956 Fix bug #5703.
Eli Zaretskii <eliz@gnu.org>
parents: 106815
diff changeset
5330 /* The calls to x_get_arg remove elements from PARMS, so copy it to
3153ca396956 Fix bug #5703.
Eli Zaretskii <eliz@gnu.org>
parents: 106815
diff changeset
5331 avoid destructive changes behind our caller's back. */
3153ca396956 Fix bug #5703.
Eli Zaretskii <eliz@gnu.org>
parents: 106815
diff changeset
5332 parms = Fcopy_alist (parms);
3153ca396956 Fix bug #5703.
Eli Zaretskii <eliz@gnu.org>
parents: 106815
diff changeset
5333
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5334 /* Get the name of the frame to use for resource lookup. */
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
5335 name = x_get_arg (dpyinfo, parms, Qname, "name", "Name", RES_TYPE_STRING);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5336 if (!STRINGP (name)
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5337 && !EQ (name, Qunbound)
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5338 && !NILP (name))
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5339 error ("Invalid frame name--not a string or nil");
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5340 Vx_resource_name = name;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5341
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5342 frame = Qnil;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5343 GCPRO3 (parms, name, frame);
41732
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
5344 /* Make a frame without minibuffer nor mode-line. */
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
5345 f = make_frame (0);
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
5346 f->wants_modeline = 0;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5347 XSETFRAME (frame, f);
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5348
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5349 buffer = Fget_buffer_create (build_string (" *tip*"));
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5350 Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil);
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5351 old_buffer = current_buffer;
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5352 set_buffer_internal_1 (XBUFFER (buffer));
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5353 current_buffer->truncate_lines = Qnil;
55492
43663119f752 (x_create_tip_frame): Bind inhibit-read-only and
Kenichi Handa <handa@m17n.org>
parents: 55468
diff changeset
5354 specbind (Qinhibit_read_only, Qt);
43663119f752 (x_create_tip_frame): Bind inhibit-read-only and
Kenichi Handa <handa@m17n.org>
parents: 55468
diff changeset
5355 specbind (Qinhibit_modification_hooks, Qt);
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5356 Ferase_buffer ();
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5357 Finsert (1, &text);
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5358 set_buffer_internal_1 (old_buffer);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5359
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5360 FRAME_CAN_HAVE_SCROLL_BARS (f) = 0;
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5361 record_unwind_protect (unwind_create_tip_frame, frame);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5362
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5363 /* By setting the output method, we're essentially saying that
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5364 the frame is live, as per FRAME_LIVE_P. If we get a signal
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5365 from this point on, x_destroy_window might screw up reference
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5366 counts etc. */
83608
2ad761d6b244 (x_create_tip_frame): Set terminal and ref count.
Jason Rumney <jasonr@gnu.org>
parents: 83571
diff changeset
5367 f->terminal = dpyinfo->terminal;
2ad761d6b244 (x_create_tip_frame): Set terminal and ref count.
Jason Rumney <jasonr@gnu.org>
parents: 83571
diff changeset
5368 f->terminal->reference_count++;
27516
8001542eaee2 (w32_defined_color): Check for valid frame before
Jason Rumney <jasonr@gnu.org>
parents: 27407
diff changeset
5369 f->output_method = output_w32;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5370 f->output_data.w32 =
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5371 (struct w32_output *) xmalloc (sizeof (struct w32_output));
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109160
diff changeset
5372 memset (f->output_data.w32, 0, sizeof (struct w32_output));
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5373
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5374 FRAME_FONTSET (f) = -1;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5375 f->icon_name = Qnil;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5376
100982
7c89b12c3a26 (Vx_pointer_shape, Vx_nontext_pointer_shape)
Jason Rumney <jasonr@gnu.org>
parents: 100951
diff changeset
5377 #if GLYPH_DEBUG
92109
4d9fc08769fa Consolidate the image_cache to the terminal struct.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 91327
diff changeset
5378 image_cache_refcount = FRAME_IMAGE_CACHE (f)->refcount;
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5379 dpyinfo_refcount = dpyinfo->reference_count;
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5380 #endif /* GLYPH_DEBUG */
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5381 FRAME_KBOARD (f) = kb;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5382 f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5383 f->output_data.w32->explicit_parent = 0;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5384
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5385 /* Set the name; the functions to which we pass f expect the name to
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5386 be set. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5387 if (EQ (name, Qunbound) || NILP (name))
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5388 {
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5389 f->name = build_string (dpyinfo->w32_id_name);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5390 f->explicit_name = 0;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5391 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5392 else
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5393 {
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5394 f->name = name;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5395 f->explicit_name = 1;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5396 /* use the frame's title when getting resources for this frame. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5397 specbind (Qx_resource_name, name);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5398 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5399
90893
c36f1ca93a6e (x_default_font_parameter): Use new style font name.
Jason Rumney <jasonr@gnu.org>
parents: 90878
diff changeset
5400 f->resx = dpyinfo->resx;
c36f1ca93a6e (x_default_font_parameter): Use new style font name.
Jason Rumney <jasonr@gnu.org>
parents: 90878
diff changeset
5401 f->resy = dpyinfo->resy;
c36f1ca93a6e (x_default_font_parameter): Use new style font name.
Jason Rumney <jasonr@gnu.org>
parents: 90878
diff changeset
5402
103305
ba9d933971ca (x_create_tip_frame): Use the uniscribe font backend if
Jason Rumney <jasonr@gnu.org>
parents: 102584
diff changeset
5403 if (uniscribe_available)
ba9d933971ca (x_create_tip_frame): Use the uniscribe font backend if
Jason Rumney <jasonr@gnu.org>
parents: 102584
diff changeset
5404 register_font_driver (&uniscribe_font_driver, f);
94917
e61553aa7a73 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 94618
diff changeset
5405 register_font_driver (&w32font_driver, f);
e61553aa7a73 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 94618
diff changeset
5406
e61553aa7a73 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 94618
diff changeset
5407 x_default_parameter (f, parms, Qfont_backend, Qnil,
e61553aa7a73 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 94618
diff changeset
5408 "fontBackend", "FontBackend", RES_TYPE_STRING);
90865
6d2559699bd0 [USE_FONT_BACKEND]: Port font backend changes from xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 90796
diff changeset
5409
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5410 /* Extract the window parameters from the supplied values
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5411 that are needed to determine window geometry. */
94917
e61553aa7a73 Throughout the file, delete all USE_FONT_BACKEND
Kenichi Handa <handa@m17n.org>
parents: 94618
diff changeset
5412 x_default_font_parameter (f, parms);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5413
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5414 x_default_parameter (f, parms, Qborder_width, make_number (2),
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5415 "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5416 /* This defaults to 2 in order to match xterm. We recognize either
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5417 internalBorderWidth or internalBorder (which is what xterm calls
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5418 it). */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5419 if (NILP (Fassq (Qinternal_border_width, parms)))
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5420 {
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5421 Lisp_Object value;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5422
96662
5418ff994d7c (w32_get_arg): Remove wrapper function.
Jason Rumney <jasonr@gnu.org>
parents: 96555
diff changeset
5423 value = x_get_arg (dpyinfo, parms, Qinternal_border_width,
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5424 "internalBorder", "internalBorder", RES_TYPE_NUMBER);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5425 if (! EQ (value, Qunbound))
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5426 parms = Fcons (Fcons (Qinternal_border_width, value),
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5427 parms);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5428 }
41448
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5429 x_default_parameter (f, parms, Qinternal_border_width, make_number (1),
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5430 "internalBorderWidth", "internalBorderWidth",
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5431 RES_TYPE_NUMBER);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5432
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5433 /* Also do the stuff which must be set before the window exists. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5434 x_default_parameter (f, parms, Qforeground_color, build_string ("black"),
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5435 "foreground", "Foreground", RES_TYPE_STRING);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5436 x_default_parameter (f, parms, Qbackground_color, build_string ("white"),
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5437 "background", "Background", RES_TYPE_STRING);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5438 x_default_parameter (f, parms, Qmouse_color, build_string ("black"),
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5439 "pointerColor", "Foreground", RES_TYPE_STRING);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5440 x_default_parameter (f, parms, Qcursor_color, build_string ("black"),
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5441 "cursorColor", "Foreground", RES_TYPE_STRING);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5442 x_default_parameter (f, parms, Qborder_color, build_string ("black"),
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5443 "borderColor", "BorderColor", RES_TYPE_STRING);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5444
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5445 /* Init faces before x_default_parameter is called for scroll-bar
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5446 parameters because that function calls x_set_scroll_bar_width,
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5447 which calls change_frame_size, which calls Fset_window_buffer,
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5448 which runs hooks, which call Fvertical_motion. At the end, we
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5449 end up in init_iterator with a null face cache, which should not
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5450 happen. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5451 init_frame_faces (f);
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5452
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5453 f->output_data.w32->dwStyle = WS_BORDER | WS_POPUP | WS_DISABLED;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5454 f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window;
41732
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
5455
50362
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
5456 window_prompting = x_figure_window_size (f, parms, 0);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5457
41732
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
5458 /* No fringes on tip frame. */
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5459 f->fringe_cols = 0;
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5460 f->left_fringe_width = 0;
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5461 f->right_fringe_width = 0;
41732
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
5462
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5463 BLOCK_INPUT;
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5464 my_create_tip_window (f);
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5465 UNBLOCK_INPUT;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5466
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5467 x_make_gc (f);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5468
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5469 x_default_parameter (f, parms, Qauto_raise, Qnil,
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5470 "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5471 x_default_parameter (f, parms, Qauto_lower, Qnil,
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5472 "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5473 x_default_parameter (f, parms, Qcursor_type, Qbox,
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5474 "cursorType", "CursorType", RES_TYPE_SYMBOL);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5475
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5476 /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5477 Change will not be effected unless different from the current
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5478 FRAME_LINES (f). */
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5479 width = FRAME_COLS (f);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5480 height = FRAME_LINES (f);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5481 FRAME_LINES (f) = 0;
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5482 SET_FRAME_COLS (f, 0);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5483 change_frame_size (f, height, width, 1, 0, 0);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5484
47731
755c4233cfba * frame.c (Vdelete_frame_functions): New variable.
John Paul Wallington <jpw@pobox.com>
parents: 47161
diff changeset
5485 /* Add `tooltip' frame parameter's default value. */
109290
1b5ca039f5f2 Fix faulty `if' statement in delete_frame.
Chong Yidong <cyd@stupidchicken.com>
parents: 108303
diff changeset
5486 if (NILP (Fframe_parameter (frame, Qtooltip)))
1b5ca039f5f2 Fix faulty `if' statement in delete_frame.
Chong Yidong <cyd@stupidchicken.com>
parents: 108303
diff changeset
5487 Fmodify_frame_parameters (frame, Fcons (Fcons (Qtooltip, Qt), Qnil));
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5488
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5489 /* Set up faces after all frame parameters are known. This call
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5490 also merges in face attributes specified for new frames.
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5491
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5492 Frame parameters may be changed if .Xdefaults contains
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5493 specifications for the default font. For example, if there is an
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5494 `Emacs.default.attributeBackground: pink', the `background-color'
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5495 attribute of the frame get's set, which let's the internal border
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5496 of the tooltip frame appear in pink. Prevent this. */
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5497 {
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5498 Lisp_Object bg = Fframe_parameter (frame, Qbackground_color);
99235
eccf5258acaf * w32fns.c (x_create_tip_frame): Prevent default foreground color for
Juanma Barranquero <lekktu@gmail.com>
parents: 99024
diff changeset
5499 Lisp_Object fg = Fframe_parameter (frame, Qforeground_color);
eccf5258acaf * w32fns.c (x_create_tip_frame): Prevent default foreground color for
Juanma Barranquero <lekktu@gmail.com>
parents: 99024
diff changeset
5500 Lisp_Object colors = Qnil;
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5501
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5502 /* Set tip_frame here, so that */
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5503 tip_frame = frame;
96555
0813ecd85cb5 (x_create_tip_frame): Pass parameter argument to
Chong Yidong <cyd@stupidchicken.com>
parents: 96538
diff changeset
5504 call2 (Qface_set_after_frame_default, frame, Qnil);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5505
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5506 if (!EQ (bg, Fframe_parameter (frame, Qbackground_color)))
99235
eccf5258acaf * w32fns.c (x_create_tip_frame): Prevent default foreground color for
Juanma Barranquero <lekktu@gmail.com>
parents: 99024
diff changeset
5507 colors = Fcons (Fcons (Qbackground_color, bg), colors);
eccf5258acaf * w32fns.c (x_create_tip_frame): Prevent default foreground color for
Juanma Barranquero <lekktu@gmail.com>
parents: 99024
diff changeset
5508 if (!EQ (fg, Fframe_parameter (frame, Qforeground_color)))
eccf5258acaf * w32fns.c (x_create_tip_frame): Prevent default foreground color for
Juanma Barranquero <lekktu@gmail.com>
parents: 99024
diff changeset
5509 colors = Fcons (Fcons (Qforeground_color, fg), colors);
eccf5258acaf * w32fns.c (x_create_tip_frame): Prevent default foreground color for
Juanma Barranquero <lekktu@gmail.com>
parents: 99024
diff changeset
5510
eccf5258acaf * w32fns.c (x_create_tip_frame): Prevent default foreground color for
Juanma Barranquero <lekktu@gmail.com>
parents: 99024
diff changeset
5511 if (!NILP (colors))
eccf5258acaf * w32fns.c (x_create_tip_frame): Prevent default foreground color for
Juanma Barranquero <lekktu@gmail.com>
parents: 99024
diff changeset
5512 Fmodify_frame_parameters (frame, colors);
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5513 }
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5514
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5515 f->no_split = 1;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5516
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5517 UNGCPRO;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5518
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5519 /* It is now ok to make the frame official even if we get an error
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5520 below. And the frame needs to be on Vframe_list or making it
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5521 visible won't work. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5522 Vframe_list = Fcons (frame, Vframe_list);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5523
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5524 /* Now that the frame is official, it counts as a reference to
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5525 its display. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5526 FRAME_W32_DISPLAY_INFO (f)->reference_count++;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5527
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5528 /* Setting attributes of faces of the tooltip frame from resources
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5529 and similar will increment face_change_count, which leads to the
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5530 clearing of all current matrices. Since this isn't necessary
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5531 here, avoid it by resetting face_change_count to the value it
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5532 had before we created the tip frame. */
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5533 face_change_count = face_change_count_before;
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5534
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5535 /* Discard the unwind_protect. */
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5536 return unbind_to (count, frame);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5537 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5538
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5539
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5540 /* Compute where to display tip frame F. PARMS is the list of frame
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5541 parameters for F. DX and DY are specified offsets from the current
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5542 location of the mouse. WIDTH and HEIGHT are the width and height
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5543 of the tooltip. Return coordinates relative to the root window of
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5544 the display in *ROOT_X, and *ROOT_Y. */
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5545
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5546 static void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
5547 compute_tip_xy (struct frame *f,
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
5548 Lisp_Object parms, Lisp_Object dx, Lisp_Object dy,
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
5549 int width, int height, int *root_x, int *root_y)
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5550 {
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5551 Lisp_Object left, top;
92935
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5552 int min_x, min_y, max_x, max_y;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5553
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5554 /* User-specified position? */
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5555 left = Fcdr (Fassq (Qleft, parms));
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5556 top = Fcdr (Fassq (Qtop, parms));
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5557
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5558 /* Move the tooltip window where the mouse pointer is. Resize and
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5559 show it. */
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5560 if (!INTEGERP (left) || !INTEGERP (top))
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5561 {
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5562 POINT pt;
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5563
92935
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5564 /* Default min and max values. */
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5565 min_x = 0;
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5566 min_y = 0;
98240
5f73593cabcd * frame.c (x_fullscreen_adjust): Declare var as Display_Info.
Juanma Barranquero <lekktu@gmail.com>
parents: 97493
diff changeset
5567 max_x = x_display_pixel_width (FRAME_W32_DISPLAY_INFO (f));
5f73593cabcd * frame.c (x_fullscreen_adjust): Declare var as Display_Info.
Juanma Barranquero <lekktu@gmail.com>
parents: 97493
diff changeset
5568 max_y = x_display_pixel_height (FRAME_W32_DISPLAY_INFO (f));
92935
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5569
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5570 BLOCK_INPUT;
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5571 GetCursorPos (&pt);
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5572 *root_x = pt.x;
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5573 *root_y = pt.y;
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5574 UNBLOCK_INPUT;
92935
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5575
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5576 /* If multiple monitor support is available, constrain the tip onto
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5577 the current monitor. This improves the above by allowing negative
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5578 co-ordinates if monitor positions are such that they are valid, and
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5579 snaps a tooltip onto a single monitor if we are close to the edge
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5580 where it would otherwise flow onto the other monitor (or into
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5581 nothingness if there is a gap in the overlap). */
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5582 if (monitor_from_point_fn && get_monitor_info_fn)
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5583 {
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5584 struct MONITOR_INFO info;
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5585 HMONITOR monitor
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5586 = monitor_from_point_fn (pt, MONITOR_DEFAULT_TO_NEAREST);
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5587 info.cbSize = sizeof (info);
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5588
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5589 if (get_monitor_info_fn (monitor, &info))
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5590 {
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5591 min_x = info.rcWork.left;
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5592 min_y = info.rcWork.top;
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5593 max_x = info.rcWork.right;
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5594 max_y = info.rcWork.bottom;
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5595 }
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5596 }
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5597 }
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5598
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5599 if (INTEGERP (top))
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5600 *root_y = XINT (top);
92935
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5601 else if (*root_y + XINT (dy) <= min_y)
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5602 *root_y = min_y; /* Can happen for negative dy */
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5603 else if (*root_y + XINT (dy) + height <= max_y)
67530
5b6c71adc503 * (compute_tip_xy): Calculate root_y the same way as root_x,
Jan Djärv <jan.h.d@swipnet.se>
parents: 67438
diff changeset
5604 /* It fits below the pointer */
5b6c71adc503 * (compute_tip_xy): Calculate root_y the same way as root_x,
Jan Djärv <jan.h.d@swipnet.se>
parents: 67438
diff changeset
5605 *root_y += XINT (dy);
92935
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5606 else if (height + XINT (dy) + min_y <= *root_y)
67530
5b6c71adc503 * (compute_tip_xy): Calculate root_y the same way as root_x,
Jan Djärv <jan.h.d@swipnet.se>
parents: 67438
diff changeset
5607 /* It fits above the pointer. */
5b6c71adc503 * (compute_tip_xy): Calculate root_y the same way as root_x,
Jan Djärv <jan.h.d@swipnet.se>
parents: 67438
diff changeset
5608 *root_y -= height + XINT (dy);
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5609 else
67530
5b6c71adc503 * (compute_tip_xy): Calculate root_y the same way as root_x,
Jan Djärv <jan.h.d@swipnet.se>
parents: 67438
diff changeset
5610 /* Put it on the top. */
92935
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5611 *root_y = min_y;
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5612
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5613 if (INTEGERP (left))
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5614 *root_x = XINT (left);
92935
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5615 else if (*root_x + XINT (dx) <= min_x)
67581
05d48e1da3ad * xfns.c (compute_tip_xy): Handle negative dx and dy.
Jan Djärv <jan.h.d@swipnet.se>
parents: 67530
diff changeset
5616 *root_x = 0; /* Can happen for negative dx */
92935
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5617 else if (*root_x + XINT (dx) + width <= max_x)
42537
f0e15bcba768 (compute_tip_xy): If tooltip won't fit on the screen
Jason Rumney <jasonr@gnu.org>
parents: 42007
diff changeset
5618 /* It fits to the right of the pointer. */
f0e15bcba768 (compute_tip_xy): If tooltip won't fit on the screen
Jason Rumney <jasonr@gnu.org>
parents: 42007
diff changeset
5619 *root_x += XINT (dx);
92935
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5620 else if (width + XINT (dx) + min_x <= *root_x)
42537
f0e15bcba768 (compute_tip_xy): If tooltip won't fit on the screen
Jason Rumney <jasonr@gnu.org>
parents: 42007
diff changeset
5621 /* It fits to the left of the pointer. */
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5622 *root_x -= width + XINT (dx);
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5623 else
42537
f0e15bcba768 (compute_tip_xy): If tooltip won't fit on the screen
Jason Rumney <jasonr@gnu.org>
parents: 42007
diff changeset
5624 /* Put it left justified on the screen -- it ought to fit that way. */
92935
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
5625 *root_x = min_x;
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5626 }
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5627
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5628
31110
9feda85db5d6 (max): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30601
diff changeset
5629 DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5630 doc: /* Show STRING in a \"tooltip\" window on frame FRAME.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5631 A tooltip window is a small window displaying a string.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5632
76700
742ee8b5b284 (Fx_show_tip): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 76083
diff changeset
5633 This is an internal function; Lisp code should call `tooltip-show'.
742ee8b5b284 (Fx_show_tip): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 76083
diff changeset
5634
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5635 FRAME nil or omitted means use the selected frame.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5636
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5637 PARMS is an optional list of frame parameters which can be
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5638 used to change the tooltip's appearance.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5639
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5640 Automatically hide the tooltip after TIMEOUT seconds. TIMEOUT nil
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5641 means use the default timeout of 5 seconds.
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5642
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
5643 If the list of frame parameters PARMS contains a `left' parameter,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5644 the tooltip is displayed at that x-position. Otherwise it is
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5645 displayed at the mouse position, with offset DX added (default is 5 if
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5646 DX isn't specified). Likewise for the y-position; if a `top' frame
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5647 parameter is specified, it determines the y-position of the tooltip
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5648 window, otherwise it is displayed at the mouse position, with offset
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5649 DY added (default is -10).
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5650
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5651 A tooltip's maximum size is specified by `x-max-tooltip-size'.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5652 Text larger than the specified size is clipped. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
5653 (Lisp_Object string, Lisp_Object frame, Lisp_Object parms, Lisp_Object timeout, Lisp_Object dx, Lisp_Object dy)
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5654 {
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5655 struct frame *f;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5656 struct window *w;
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5657 int root_x, root_y;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5658 struct buffer *old_buffer;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5659 struct text_pos pos;
111417
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5660 int i, width, height, seen_reversed_p;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5661 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5662 int old_windows_or_buffers_changed = windows_or_buffers_changed;
46285
3f111801efb4 Rename BINDING_STACK_SIZE to SPECPDL_INDEX.
Juanma Barranquero <lekktu@gmail.com>
parents: 46272
diff changeset
5663 int count = SPECPDL_INDEX ();
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5664
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5665 specbind (Qinhibit_redisplay, Qt);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5666
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
5667 GCPRO4 (string, parms, frame, timeout);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5668
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
5669 CHECK_STRING (string);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5670 f = check_x_frame (frame);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5671 if (NILP (timeout))
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5672 timeout = make_number (5);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5673 else
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
5674 CHECK_NATNUM (timeout);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5675
31110
9feda85db5d6 (max): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30601
diff changeset
5676 if (NILP (dx))
9feda85db5d6 (max): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30601
diff changeset
5677 dx = make_number (5);
9feda85db5d6 (max): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30601
diff changeset
5678 else
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
5679 CHECK_NUMBER (dx);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5680
31110
9feda85db5d6 (max): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30601
diff changeset
5681 if (NILP (dy))
36000
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5682 dy = make_number (-10);
31110
9feda85db5d6 (max): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30601
diff changeset
5683 else
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
5684 CHECK_NUMBER (dy);
31110
9feda85db5d6 (max): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30601
diff changeset
5685
36000
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5686 if (NILP (last_show_tip_args))
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5687 last_show_tip_args = Fmake_vector (make_number (3), Qnil);
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5688
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5689 if (!NILP (tip_frame))
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5690 {
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5691 Lisp_Object last_string = AREF (last_show_tip_args, 0);
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5692 Lisp_Object last_frame = AREF (last_show_tip_args, 1);
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5693 Lisp_Object last_parms = AREF (last_show_tip_args, 2);
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5694
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5695 if (EQ (frame, last_frame)
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5696 && !NILP (Fequal (last_string, string))
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5697 && !NILP (Fequal (last_parms, parms)))
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5698 {
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5699 struct frame *f = XFRAME (tip_frame);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5700
36000
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5701 /* Only DX and DY have changed. */
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5702 if (!NILP (tip_timer))
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5703 {
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5704 Lisp_Object timer = tip_timer;
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5705 tip_timer = Qnil;
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5706 call1 (Qcancel_timer, timer);
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5707 }
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5708
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5709 BLOCK_INPUT;
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5710 compute_tip_xy (f, parms, dx, dy, FRAME_PIXEL_WIDTH (f),
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5711 FRAME_PIXEL_HEIGHT (f), &root_x, &root_y);
43210
3df71b933c36 (w32_load_system_font): Prevent Cleartype fonts from loading.
Jason Rumney <jasonr@gnu.org>
parents: 43207
diff changeset
5712
3df71b933c36 (w32_load_system_font): Prevent Cleartype fonts from loading.
Jason Rumney <jasonr@gnu.org>
parents: 43207
diff changeset
5713 /* Put tooltip in topmost group and in position. */
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5714 SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST,
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5715 root_x, root_y, 0, 0,
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5716 SWP_NOSIZE | SWP_NOACTIVATE);
43210
3df71b933c36 (w32_load_system_font): Prevent Cleartype fonts from loading.
Jason Rumney <jasonr@gnu.org>
parents: 43207
diff changeset
5717
3df71b933c36 (w32_load_system_font): Prevent Cleartype fonts from loading.
Jason Rumney <jasonr@gnu.org>
parents: 43207
diff changeset
5718 /* Ensure tooltip is on top of other topmost windows (eg menus). */
3df71b933c36 (w32_load_system_font): Prevent Cleartype fonts from loading.
Jason Rumney <jasonr@gnu.org>
parents: 43207
diff changeset
5719 SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOP,
3df71b933c36 (w32_load_system_font): Prevent Cleartype fonts from loading.
Jason Rumney <jasonr@gnu.org>
parents: 43207
diff changeset
5720 0, 0, 0, 0,
3df71b933c36 (w32_load_system_font): Prevent Cleartype fonts from loading.
Jason Rumney <jasonr@gnu.org>
parents: 43207
diff changeset
5721 SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
3df71b933c36 (w32_load_system_font): Prevent Cleartype fonts from loading.
Jason Rumney <jasonr@gnu.org>
parents: 43207
diff changeset
5722
36000
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5723 UNBLOCK_INPUT;
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5724 goto start_timer;
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5725 }
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5726 }
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5727
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5728 /* Hide a previous tip, if any. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5729 Fx_hide_tip ();
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5730
36000
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5731 ASET (last_show_tip_args, 0, string);
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5732 ASET (last_show_tip_args, 1, frame);
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5733 ASET (last_show_tip_args, 2, parms);
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5734
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5735 /* Add default values to frame parameters. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5736 if (NILP (Fassq (Qname, parms)))
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5737 parms = Fcons (Fcons (Qname, build_string ("tooltip")), parms);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5738 if (NILP (Fassq (Qinternal_border_width, parms)))
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5739 parms = Fcons (Fcons (Qinternal_border_width, make_number (3)), parms);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5740 if (NILP (Fassq (Qborder_width, parms)))
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5741 parms = Fcons (Fcons (Qborder_width, make_number (1)), parms);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5742 if (NILP (Fassq (Qborder_color, parms)))
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5743 parms = Fcons (Fcons (Qborder_color, build_string ("lightyellow")), parms);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5744 if (NILP (Fassq (Qbackground_color, parms)))
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5745 parms = Fcons (Fcons (Qbackground_color, build_string ("lightyellow")),
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5746 parms);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5747
41480
2c71c672b3c7 (x_create_tip_frame): Set frame's fringes_extra to 0.
Jason Rumney <jasonr@gnu.org>
parents: 41448
diff changeset
5748 /* Block input until the tip has been fully drawn, to avoid crashes
2c71c672b3c7 (x_create_tip_frame): Set frame's fringes_extra to 0.
Jason Rumney <jasonr@gnu.org>
parents: 41448
diff changeset
5749 when drawing tips in menus. */
2c71c672b3c7 (x_create_tip_frame): Set frame's fringes_extra to 0.
Jason Rumney <jasonr@gnu.org>
parents: 41448
diff changeset
5750 BLOCK_INPUT;
2c71c672b3c7 (x_create_tip_frame): Set frame's fringes_extra to 0.
Jason Rumney <jasonr@gnu.org>
parents: 41448
diff changeset
5751
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5752 /* Create a frame for the tooltip, and record it in the global
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5753 variable tip_frame. */
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5754 frame = x_create_tip_frame (FRAME_W32_DISPLAY_INFO (f), parms, string);
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5755 f = XFRAME (frame);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5756
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5757 /* Set up the frame's root window. */
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5758 w = XWINDOW (FRAME_ROOT_WINDOW (f));
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5759 w->left_col = w->top_line = make_number (0);
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5760
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5761 if (CONSP (Vx_max_tooltip_size)
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5762 && INTEGERP (XCAR (Vx_max_tooltip_size))
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5763 && XINT (XCAR (Vx_max_tooltip_size)) > 0
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5764 && INTEGERP (XCDR (Vx_max_tooltip_size))
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5765 && XINT (XCDR (Vx_max_tooltip_size)) > 0)
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5766 {
51211
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5767 w->total_cols = XCAR (Vx_max_tooltip_size);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5768 w->total_lines = XCDR (Vx_max_tooltip_size);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5769 }
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5770 else
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5771 {
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5772 w->total_cols = make_number (80);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5773 w->total_lines = make_number (40);
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5774 }
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5775
28ea05de2dc5 Make (many) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents: 50377
diff changeset
5776 FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5777 adjust_glyphs (f);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5778 w->pseudo_window_p = 1;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5779
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5780 /* Display the tooltip text in a temporary buffer. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5781 old_buffer = current_buffer;
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5782 set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer));
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5783 current_buffer->truncate_lines = Qnil;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5784 clear_glyph_matrix (w->desired_matrix);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5785 clear_glyph_matrix (w->current_matrix);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5786 SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
63772
b9edfe751512 (Fx_show_tip): Pass new arg to try_window.
Richard M. Stallman <rms@gnu.org>
parents: 63704
diff changeset
5787 try_window (FRAME_ROOT_WINDOW (f), pos, 0);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5788
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5789 /* Compute width and height of the tooltip. */
111417
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5790 width = height = seen_reversed_p = 0;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5791 for (i = 0; i < w->desired_matrix->nrows; ++i)
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5792 {
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5793 struct glyph_row *row = &w->desired_matrix->rows[i];
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5794 struct glyph *last;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5795 int row_width;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5796
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5797 /* Stop at the first empty row at the end. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5798 if (!row->enabled_p || !row->displays_text_p)
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5799 break;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5800
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5801 /* Let the row go over the full width of the frame. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5802 row->full_width_p = 1;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5803
111417
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5804 row_width = row->pixel_width;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5805 if (row->used[TEXT_AREA])
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5806 {
111417
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5807 if (!row->reversed_p)
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5808 {
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5809 #ifdef TODO /* Investigate why some fonts need more width than is
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5810 calculated for some tooltips. */
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5811
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5812 /* There's a glyph at the end of rows that is used to
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5813 place the cursor there. Don't include the width of
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5814 this glyph. */
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5815 last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1];
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5816 if (INTEGERP (last->object))
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5817 row_width -= last->pixel_width;
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5818 #endif
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5819 }
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5820 else
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5821 {
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5822 /* There could be a stretch glyph at the beginning of R2L
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5823 rows that is produced by extend_face_to_end_of_line.
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5824 Don't count that glyph. */
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5825 struct glyph *g = row->glyphs[TEXT_AREA];
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5826
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5827 if (g->type == STRETCH_GLYPH && INTEGERP (g->object))
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5828 {
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5829 row_width -= g->pixel_width;
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5830 seen_reversed_p = 1;
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5831 }
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5832 }
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5833 }
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5834
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
5835 /* TODO: find why tips do not draw along baseline as instructed. */
41448
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5836 height += row->height;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5837 width = max (width, row_width);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5838 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5839
111417
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5840 /* If we've seen partial-length R2L rows, we need to re-adjust the
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5841 tool-tip frame width and redisplay it again, to avoid over-wide
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5842 tips due to the stretch glyph that extends R2L lines to full
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5843 width of the frame. */
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5844 if (seen_reversed_p)
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5845 {
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5846 /* w->total_cols and FRAME_TOTAL_COLS want the width in columns,
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5847 not in pixels. */
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5848 width /= WINDOW_FRAME_COLUMN_WIDTH (w);
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5849 w->total_cols = make_number (width);
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5850 FRAME_TOTAL_COLS (f) = width;
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5851 adjust_glyphs (f);
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5852 clear_glyph_matrix (w->desired_matrix);
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5853 clear_glyph_matrix (w->current_matrix);
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5854 try_window (FRAME_ROOT_WINDOW (f), pos, 0);
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5855 width = height = 0;
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5856 /* Recompute width and height of the tooltip. */
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5857 for (i = 0; i < w->desired_matrix->nrows; ++i)
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5858 {
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5859 struct glyph_row *row = &w->desired_matrix->rows[i];
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5860 struct glyph *last;
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5861 int row_width;
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5862
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5863 if (!row->enabled_p || !row->displays_text_p)
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5864 break;
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5865 row->full_width_p = 1;
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5866 row_width = row->pixel_width;
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5867 #ifdef TODO /* See above. */
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5868 if (row->used[TEXT_AREA] && !row->reversed_p)
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5869 {
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5870 last = &row->glyphs[TEXT_AREA][row->used[TEXT_AREA] - 1];
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5871 if (INTEGERP (last->object))
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5872 row_width -= last->pixel_width;
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5873 }
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5874 #endif
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5875
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5876 height += row->height;
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5877 width = max (width, row_width);
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5878 }
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5879 }
6316c70b291e Support R2L lines in tool-tip text.
Eli Zaretskii <eliz@gnu.org>
parents: 111224
diff changeset
5880
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5881 /* Add the frame's internal border to the width and height the X
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5882 window should have. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5883 height += 2 * FRAME_INTERNAL_BORDER_WIDTH (f);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5884 width += 2 * FRAME_INTERNAL_BORDER_WIDTH (f);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5885
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5886 /* Move the tooltip window where the mouse pointer is. Resize and
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5887 show it. */
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5888 compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y);
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
5889
41448
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5890 {
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5891 /* Adjust Window size to take border into account. */
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5892 RECT rect;
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5893 rect.left = rect.top = 0;
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5894 rect.right = width;
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5895 rect.bottom = height;
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5896 AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5897 FRAME_EXTERNAL_MENU_BAR (f));
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5898
69867
847d1fc86f9d (Fx_show_tip): Add 3 to the 5th arg of SetWindowPos.
Eli Zaretskii <eliz@gnu.org>
parents: 69547
diff changeset
5899 /* Position and size tooltip, and put it in the topmost group.
847d1fc86f9d (Fx_show_tip): Add 3 to the 5th arg of SetWindowPos.
Eli Zaretskii <eliz@gnu.org>
parents: 69547
diff changeset
5900 The add-on of 3 to the 5th argument is a kludge: without it,
847d1fc86f9d (Fx_show_tip): Add 3 to the 5th arg of SetWindowPos.
Eli Zaretskii <eliz@gnu.org>
parents: 69547
diff changeset
5901 some fonts cause the last character of the tip to be truncated,
847d1fc86f9d (Fx_show_tip): Add 3 to the 5th arg of SetWindowPos.
Eli Zaretskii <eliz@gnu.org>
parents: 69547
diff changeset
5902 for some obscure reason. */
41448
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5903 SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST,
69867
847d1fc86f9d (Fx_show_tip): Add 3 to the 5th arg of SetWindowPos.
Eli Zaretskii <eliz@gnu.org>
parents: 69547
diff changeset
5904 root_x, root_y, rect.right - rect.left + 3,
41448
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5905 rect.bottom - rect.top, SWP_NOACTIVATE);
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5906
43210
3df71b933c36 (w32_load_system_font): Prevent Cleartype fonts from loading.
Jason Rumney <jasonr@gnu.org>
parents: 43207
diff changeset
5907 /* Ensure tooltip is on top of other topmost windows (eg menus). */
3df71b933c36 (w32_load_system_font): Prevent Cleartype fonts from loading.
Jason Rumney <jasonr@gnu.org>
parents: 43207
diff changeset
5908 SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOP,
3df71b933c36 (w32_load_system_font): Prevent Cleartype fonts from loading.
Jason Rumney <jasonr@gnu.org>
parents: 43207
diff changeset
5909 0, 0, 0, 0,
3df71b933c36 (w32_load_system_font): Prevent Cleartype fonts from loading.
Jason Rumney <jasonr@gnu.org>
parents: 43207
diff changeset
5910 SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
3df71b933c36 (w32_load_system_font): Prevent Cleartype fonts from loading.
Jason Rumney <jasonr@gnu.org>
parents: 43207
diff changeset
5911
41448
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5912 /* Let redisplay know that we have made the frame visible already. */
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5913 f->async_visible = 1;
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5914
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5915 ShowWindow (FRAME_W32_WINDOW (f), SW_SHOWNOACTIVATE);
96beda35d0fa (w32_wnd_proc) <WM_MENUSELECT>: Revert last change.
Jason Rumney <jasonr@gnu.org>
parents: 41380
diff changeset
5916 }
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5917
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5918 /* Draw into the window. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5919 w->must_be_updated_p = 1;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5920 update_single_window (w, 1);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5921
41480
2c71c672b3c7 (x_create_tip_frame): Set frame's fringes_extra to 0.
Jason Rumney <jasonr@gnu.org>
parents: 41448
diff changeset
5922 UNBLOCK_INPUT;
2c71c672b3c7 (x_create_tip_frame): Set frame's fringes_extra to 0.
Jason Rumney <jasonr@gnu.org>
parents: 41448
diff changeset
5923
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5924 /* Restore original current buffer. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5925 set_buffer_internal_1 (old_buffer);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5926 windows_or_buffers_changed = old_windows_or_buffers_changed;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5927
36000
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5928 start_timer:
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5929 /* Let the tip disappear after timeout seconds. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5930 tip_timer = call3 (intern ("run-at-time"), timeout, Qnil,
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5931 intern ("x-hide-tip"));
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
5932
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5933 UNGCPRO;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5934 return unbind_to (count, Qnil);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5935 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5936
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5937
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5938 DEFUN ("x-hide-tip", Fx_hide_tip, Sx_hide_tip, 0, 0, 0,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5939 doc: /* Hide the current tooltip window, if there is any.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
5940 Value is t if tooltip was open, nil otherwise. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
5941 (void)
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5942 {
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5943 int count;
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5944 Lisp_Object deleted, frame, timer;
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5945 struct gcpro gcpro1, gcpro2;
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5946
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5947 /* Return quickly if nothing to do. */
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5948 if (NILP (tip_timer) && NILP (tip_frame))
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5949 return Qnil;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5950
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5951 frame = tip_frame;
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5952 timer = tip_timer;
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5953 GCPRO2 (frame, timer);
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5954 tip_frame = tip_timer = deleted = Qnil;
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5955
46285
3f111801efb4 Rename BINDING_STACK_SIZE to SPECPDL_INDEX.
Juanma Barranquero <lekktu@gmail.com>
parents: 46272
diff changeset
5956 count = SPECPDL_INDEX ();
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5957 specbind (Qinhibit_redisplay, Qt);
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5958 specbind (Qinhibit_quit, Qt);
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
5959
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5960 if (!NILP (timer))
36000
f4a0b086cc5d (Fx_show_tip): Fix calls to make_number.
Jason Rumney <jasonr@gnu.org>
parents: 35674
diff changeset
5961 call1 (Qcancel_timer, timer);
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5962
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5963 if (FRAMEP (frame))
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5964 {
100632
389db2f016a4 * frame.c (delete_frame): New function derived from
Martin Rudalics <rudalics@gmx.at>
parents: 100380
diff changeset
5965 delete_frame (frame, Qnil);
34546
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5966 deleted = Qt;
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5967 }
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5968
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5969 UNGCPRO;
51be06b616bf (Fx_hide_tip): Avoid unnecessary work when there's
Andrew Innes <andrewi@gnu.org>
parents: 34314
diff changeset
5970 return unbind_to (count, deleted);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5971 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5972
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5973
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5974
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5975 /***********************************************************************
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5976 File selection dialog
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5977 ***********************************************************************/
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5978 extern Lisp_Object Qfile_name_history;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
5979
96376
c3309dba6542 American English spelling fix.
Glenn Morris <rgm@gnu.org>
parents: 96133
diff changeset
5980 /* Callback for altering the behavior of the Open File dialog.
45963
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
5981 Makes the Filename text field contain "Current Directory" and be
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
5982 read-only when "Directories" is selected in the filter. This
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
5983 allows us to work around the fact that the standard Open File
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
5984 dialog does not support directories. */
110975
e0ac9a58795e src/w32*.c: Make functions static.
Juanma Barranquero <lekktu@gmail.com>
parents: 110540
diff changeset
5985 static UINT CALLBACK
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
5986 file_dialog_callback (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
45963
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
5987 {
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
5988 if (msg == WM_NOTIFY)
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
5989 {
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
5990 OFNOTIFY * notify = (OFNOTIFY *)lParam;
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
5991 /* Detect when the Filter dropdown is changed. */
56263
1b78563a75d6 (file_dialog_callback): Disable edit control if set
Jason Rumney <jasonr@gnu.org>
parents: 55892
diff changeset
5992 if (notify->hdr.code == CDN_TYPECHANGE
1b78563a75d6 (file_dialog_callback): Disable edit control if set
Jason Rumney <jasonr@gnu.org>
parents: 55892
diff changeset
5993 || notify->hdr.code == CDN_INITDONE)
45963
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
5994 {
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
5995 HWND dialog = GetParent (hwnd);
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
5996 HWND edit_control = GetDlgItem (dialog, FILE_NAME_TEXT_FIELD);
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
5997
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
5998 /* Directories is in index 2. */
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
5999 if (notify->lpOFN->nFilterIndex == 2)
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6000 {
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6001 CommDlg_OpenSave_SetControlText (dialog, FILE_NAME_TEXT_FIELD,
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6002 "Current Directory");
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6003 EnableWindow (edit_control, FALSE);
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6004 }
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6005 else
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6006 {
56263
1b78563a75d6 (file_dialog_callback): Disable edit control if set
Jason Rumney <jasonr@gnu.org>
parents: 55892
diff changeset
6007 /* Don't override default filename on init done. */
1b78563a75d6 (file_dialog_callback): Disable edit control if set
Jason Rumney <jasonr@gnu.org>
parents: 55892
diff changeset
6008 if (notify->hdr.code == CDN_TYPECHANGE)
1b78563a75d6 (file_dialog_callback): Disable edit control if set
Jason Rumney <jasonr@gnu.org>
parents: 55892
diff changeset
6009 CommDlg_OpenSave_SetControlText (dialog,
1b78563a75d6 (file_dialog_callback): Disable edit control if set
Jason Rumney <jasonr@gnu.org>
parents: 55892
diff changeset
6010 FILE_NAME_TEXT_FIELD, "");
45963
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6011 EnableWindow (edit_control, TRUE);
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6012 }
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6013 }
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6014 }
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6015 return 0;
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6016 }
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6017
63348
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6018 /* Since we compile with _WIN32_WINNT set to 0x0400 (for NT4 compatibility)
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6019 we end up with the old file dialogs. Define a big enough struct for the
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6020 new dialog to trick GetOpenFileName into giving us the new dialogs on
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6021 Windows 2000 and XP. */
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6022 typedef struct
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6023 {
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6024 OPENFILENAME real_details;
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6025 void * pReserved;
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6026 DWORD dwReserved;
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6027 DWORD FlagsEx;
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6028 } NEWOPENFILENAME;
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6029
63704
426ba3ecedd7 (check_x_frame, check_x_display_info): Follow error conventions.
Juanma Barranquero <lekktu@gmail.com>
parents: 63348
diff changeset
6030
57868
c955f6add62a * fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents: 57765
diff changeset
6031 DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 5, 0,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6032 doc: /* Read file name, prompting with PROMPT in directory DIR.
111170
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
6033 Use a file selection dialog. Select DEFAULT-FILENAME in the dialog's file
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
6034 selection box, if specified. If MUSTMATCH is non-nil, the returned file
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
6035 or directory must exist.
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
6036
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
6037 This function is only defined on MS Windows, and X Windows with the
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
6038 Motif or Gtk toolkits. With the Motif toolkit, ONLY-DIR-P is ignored.
93d41f7676cf Sync docs of some W32 and X C functions.
Glenn Morris <rgm@gnu.org>
parents: 110997
diff changeset
6039 Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
6040 (Lisp_Object prompt, Lisp_Object dir, Lisp_Object default_filename, Lisp_Object mustmatch, Lisp_Object only_dir_p)
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6041 {
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6042 struct frame *f = SELECTED_FRAME ();
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6043 Lisp_Object file = Qnil;
46293
1fb8f75062c6 Use macro SPECPDL_INDEX.
Juanma Barranquero <lekktu@gmail.com>
parents: 46285
diff changeset
6044 int count = SPECPDL_INDEX ();
57868
c955f6add62a * fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents: 57765
diff changeset
6045 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6046 char filename[MAX_PATH + 1];
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6047 char init_dir[MAX_PATH + 1];
56263
1b78563a75d6 (file_dialog_callback): Disable edit control if set
Jason Rumney <jasonr@gnu.org>
parents: 55892
diff changeset
6048 int default_filter_index = 1; /* 1: All Files, 2: Directories only */
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6049
57868
c955f6add62a * fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents: 57765
diff changeset
6050 GCPRO6 (prompt, dir, default_filename, mustmatch, only_dir_p, file);
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
6051 CHECK_STRING (prompt);
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
6052 CHECK_STRING (dir);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6053
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6054 /* Create the dialog with PROMPT as title, using DIR as initial
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6055 directory and using "*" as pattern. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6056 dir = Fexpand_file_name (dir, Qnil);
56480
5e87c40cea58 2004-07-19 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> (tiny change)
Jason Rumney <jasonr@gnu.org>
parents: 56430
diff changeset
6057 strncpy (init_dir, SDATA (ENCODE_FILE (dir)), MAX_PATH);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6058 init_dir[MAX_PATH] = '\0';
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6059 unixtodos_filename (init_dir);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6060
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6061 if (STRINGP (default_filename))
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6062 {
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6063 char *file_name_only;
56480
5e87c40cea58 2004-07-19 KOBAYASHI Yasuhiro <kobayays@otsukakj.co.jp> (tiny change)
Jason Rumney <jasonr@gnu.org>
parents: 56430
diff changeset
6064 char *full_path_name = SDATA (ENCODE_FILE (default_filename));
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6065
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6066 unixtodos_filename (full_path_name);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6067
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6068 file_name_only = strrchr (full_path_name, '\\');
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6069 if (!file_name_only)
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6070 file_name_only = full_path_name;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6071 else
56263
1b78563a75d6 (file_dialog_callback): Disable edit control if set
Jason Rumney <jasonr@gnu.org>
parents: 55892
diff changeset
6072 file_name_only++;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6073
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6074 strncpy (filename, file_name_only, MAX_PATH);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6075 filename[MAX_PATH] = '\0';
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6076 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6077 else
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6078 filename[0] = '\0';
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6079
45963
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6080 {
63348
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6081 NEWOPENFILENAME new_file_details;
63297
431c88e4a3a2 (Fx_file_dialog): Unblock input before falling back to minibuffer.
Jason Rumney <jasonr@gnu.org>
parents: 63279
diff changeset
6082 BOOL file_opened = FALSE;
63348
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6083 OPENFILENAME * file_details = &new_file_details.real_details;
63704
426ba3ecedd7 (check_x_frame, check_x_display_info): Follow error conventions.
Juanma Barranquero <lekktu@gmail.com>
parents: 63348
diff changeset
6084
45963
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6085 /* Prevent redisplay. */
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6086 specbind (Qinhibit_redisplay, Qt);
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6087 BLOCK_INPUT;
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6088
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109160
diff changeset
6089 memset (&new_file_details, 0, sizeof (new_file_details));
63348
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6090 /* Apparently NT4 crashes if you give it an unexpected size.
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6091 I'm not sure about Windows 9x, so play it safe. */
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6092 if (w32_major_version > 4 && w32_major_version < 95)
77995
04fafc2fc785 (Fx_file_dialog): Take size from struct not pointer.
Jason Rumney <jasonr@gnu.org>
parents: 76700
diff changeset
6093 file_details->lStructSize = sizeof (NEWOPENFILENAME);
63348
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6094 else
77995
04fafc2fc785 (Fx_file_dialog): Take size from struct not pointer.
Jason Rumney <jasonr@gnu.org>
parents: 76700
diff changeset
6095 file_details->lStructSize = sizeof (OPENFILENAME);
63348
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6096
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6097 file_details->hwndOwner = FRAME_W32_WINDOW (f);
45963
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6098 /* Undocumented Bug in Common File Dialog:
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6099 If a filter is not specified, shell links are not resolved. */
63348
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6100 file_details->lpstrFilter = "All Files (*.*)\0*.*\0Directories\0*|*\0\0";
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6101 file_details->lpstrFile = filename;
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6102 file_details->nMaxFile = sizeof (filename);
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6103 file_details->lpstrInitialDir = init_dir;
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6104 file_details->lpstrTitle = SDATA (prompt);
56263
1b78563a75d6 (file_dialog_callback): Disable edit control if set
Jason Rumney <jasonr@gnu.org>
parents: 55892
diff changeset
6105
57868
c955f6add62a * fileio.c (Fread_file_name): Pass Qt as fifth parameter to
Jan Djärv <jan.h.d@swipnet.se>
parents: 57765
diff changeset
6106 if (! NILP (only_dir_p))
56263
1b78563a75d6 (file_dialog_callback): Disable edit control if set
Jason Rumney <jasonr@gnu.org>
parents: 55892
diff changeset
6107 default_filter_index = 2;
1b78563a75d6 (file_dialog_callback): Disable edit control if set
Jason Rumney <jasonr@gnu.org>
parents: 55892
diff changeset
6108
63348
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6109 file_details->nFilterIndex = default_filter_index;
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6110
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6111 file_details->Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR
45963
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6112 | OFN_EXPLORER | OFN_ENABLEHOOK);
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6113 if (!NILP (mustmatch))
63348
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6114 {
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6115 /* Require that the path to the parent directory exists. */
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6116 file_details->Flags |= OFN_PATHMUSTEXIST;
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6117 /* If we are looking for a file, require that it exists. */
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6118 if (NILP (only_dir_p))
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6119 file_details->Flags |= OFN_FILEMUSTEXIST;
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6120 }
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6121
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6122 file_details->lpfnHook = (LPOFNHOOKPROC) file_dialog_callback;
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6123
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6124 file_opened = GetOpenFileName (file_details);
63297
431c88e4a3a2 (Fx_file_dialog): Unblock input before falling back to minibuffer.
Jason Rumney <jasonr@gnu.org>
parents: 63279
diff changeset
6125
431c88e4a3a2 (Fx_file_dialog): Unblock input before falling back to minibuffer.
Jason Rumney <jasonr@gnu.org>
parents: 63279
diff changeset
6126 UNBLOCK_INPUT;
431c88e4a3a2 (Fx_file_dialog): Unblock input before falling back to minibuffer.
Jason Rumney <jasonr@gnu.org>
parents: 63279
diff changeset
6127
431c88e4a3a2 (Fx_file_dialog): Unblock input before falling back to minibuffer.
Jason Rumney <jasonr@gnu.org>
parents: 63279
diff changeset
6128 if (file_opened)
45963
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6129 {
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6130 dostounix_filename (filename);
63348
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6131
abe4cbe0bdef (NEWOPENFILENAME): New struct.
Jason Rumney <jasonr@gnu.org>
parents: 63340
diff changeset
6132 if (file_details->nFilterIndex == 2)
45963
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6133 {
56263
1b78563a75d6 (file_dialog_callback): Disable edit control if set
Jason Rumney <jasonr@gnu.org>
parents: 55892
diff changeset
6134 /* "Directories" selected - strip dummy file name. */
45963
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6135 char * last = strrchr (filename, '/');
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6136 *last = '\0';
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6137 }
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6138
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6139 file = DECODE_FILE (build_string (filename));
45963
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6140 }
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6141 /* User cancelled the dialog without making a selection. */
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6142 else if (!CommDlgExtendedError ())
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6143 file = Qnil;
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6144 /* An error occurred, fallback on reading from the mini-buffer. */
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6145 else
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6146 file = Fcompleting_read (prompt, intern ("read-file-name-internal"),
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6147 dir, mustmatch, dir, Qfile_name_history,
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6148 default_filename, Qnil);
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6149
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6150 file = unbind_to (count, file);
e4d2d8c8186f (file_dialog_callback): New function.
Jason Rumney <jasonr@gnu.org>
parents: 45465
diff changeset
6151 }
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6152
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6153 UNGCPRO;
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6154
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6155 /* Make "Cancel" equivalent to C-g. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6156 if (NILP (file))
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6157 Fsignal (Qquit, Qnil);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6158
29317
2d3d5bf49d4e Format and doc changes to bring closer to xfns.c.
Jason Rumney <jasonr@gnu.org>
parents: 29021
diff changeset
6159 return unbind_to (count, file);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6160 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6161
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6162
96489
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6163 /* Moving files to the system recycle bin.
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6164 Used by `move-file-to-trash' instead of the default moving to ~/.Trash */
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6165 DEFUN ("system-move-file-to-trash", Fsystem_move_file_to_trash,
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6166 Ssystem_move_file_to_trash, 1, 1, 0,
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6167 doc: /* Move file or directory named FILENAME to the recycle bin. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
6168 (Lisp_Object filename)
96489
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6169 {
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6170 Lisp_Object handler;
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6171 Lisp_Object encoded_file;
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6172 Lisp_Object operation;
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6173
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6174 operation = Qdelete_file;
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6175 if (!NILP (Ffile_directory_p (filename))
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6176 && NILP (Ffile_symlink_p (filename)))
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6177 {
105374
28c45fa22117 * w32fns.c (Fsystem_move_file_to_trash): Use delete-directory.
Michael Albinus <michael.albinus@gmx.de>
parents: 105367
diff changeset
6178 operation = intern ("delete-directory");
96489
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6179 filename = Fdirectory_file_name (filename);
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6180 }
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6181 filename = Fexpand_file_name (filename, Qnil);
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6182
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6183 handler = Ffind_file_name_handler (filename, operation);
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6184 if (!NILP (handler))
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6185 return call2 (handler, operation, filename);
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6186
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6187 encoded_file = ENCODE_FILE (filename);
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6188
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6189 {
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6190 const char * path;
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6191 SHFILEOPSTRUCT file_op;
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6192 char tmp_path[MAX_PATH + 1];
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6193
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6194 path = map_w32_filename (SDATA (encoded_file), NULL);
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6195
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6196 /* On Windows, write permission is required to delete/move files. */
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6197 _chmod (path, 0666);
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6198
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109160
diff changeset
6199 memset (tmp_path, 0, sizeof (tmp_path));
96489
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6200 strcpy (tmp_path, path);
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6201
109165
750db9f3e6d8 Replace bcopy, bzero, bcmp by memcpy, memmove, memset, memcmp
Andreas Schwab <schwab@linux-m68k.org>
parents: 109160
diff changeset
6202 memset (&file_op, 0, sizeof (file_op));
96489
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6203 file_op.hwnd = HWND_DESKTOP;
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6204 file_op.wFunc = FO_DELETE;
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6205 file_op.pFrom = tmp_path;
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6206 file_op.fFlags = FOF_SILENT | FOF_NOCONFIRMATION | FOF_ALLOWUNDO
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6207 | FOF_NOERRORUI | FOF_NO_CONNECTED_ELEMENTS;
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6208 file_op.fAnyOperationsAborted = FALSE;
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6209
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6210 if (SHFileOperation (&file_op) != 0)
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6211 report_file_error ("Removing old name", list1 (filename));
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6212 }
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6213 return Qnil;
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6214 }
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
6215
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6216
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6217 /***********************************************************************
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6218 w32 specialized functions
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6219 ***********************************************************************/
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
6220
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6221 DEFUN ("w32-send-sys-command", Fw32_send_sys_command,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6222 Sw32_send_sys_command, 1, 2, 0,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6223 doc: /* Send frame a Windows WM_SYSCOMMAND message of type COMMAND.
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
6224 Some useful values for COMMAND are #xf030 to maximize frame (#xf020
42845
ebb3a20bc357 (w32_load_system_font, w32_to_x_charset): Use strnicmp
Jason Rumney <jasonr@gnu.org>
parents: 42833
diff changeset
6225 to minimize), #xf120 to restore frame to original size, and #xf100
ebb3a20bc357 (w32_load_system_font, w32_to_x_charset): Use strnicmp
Jason Rumney <jasonr@gnu.org>
parents: 42833
diff changeset
6226 to activate the menubar for keyboard access. #xf140 activates the
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6227 screen saver if defined.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6228
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6229 If optional parameter FRAME is not specified, use selected frame. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
6230 (Lisp_Object command, Lisp_Object frame)
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
6231 {
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
6232 FRAME_PTR f = check_x_frame (frame);
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
6233
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
6234 CHECK_NUMBER (command);
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
6235
24718
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
6236 PostMessage (FRAME_W32_WINDOW (f), WM_SYSCOMMAND, XINT (command), 0);
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
6237
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
6238 return Qnil;
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
6239 }
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
6240
24670
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
6241 DEFUN ("w32-shell-execute", Fw32_shell_execute, Sw32_shell_execute, 2, 4, 0,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6242 doc: /* Get Windows to perform OPERATION on DOCUMENT.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6243 This is a wrapper around the ShellExecute system function, which
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6244 invokes the application registered to handle OPERATION for DOCUMENT.
74350
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6245
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6246 OPERATION is either nil or a string that names a supported operation.
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6247 What operations can be used depends on the particular DOCUMENT and its
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6248 handler application, but typically it is one of the following common
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6249 operations:
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6250
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6251 \"open\" - open DOCUMENT, which could be a file, a directory, or an
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6252 executable program. If it is an application, that
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6253 application is launched in the current buffer's default
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6254 directory. Otherwise, the application associated with
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6255 DOCUMENT is launched in the buffer's default directory.
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6256 \"print\" - print DOCUMENT, which must be a file
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6257 \"explore\" - start the Windows Explorer on DOCUMENT
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6258 \"edit\" - launch an editor and open DOCUMENT for editing; which
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6259 editor is launched depends on the association for the
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6260 specified DOCUMENT
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6261 \"find\" - initiate search starting from DOCUMENT which must specify
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6262 a directory
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6263 nil - invoke the default OPERATION, or \"open\" if default is
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6264 not defined or unavailable
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6265
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6266 DOCUMENT is typically the name of a document file or a URL, but can
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6267 also be a program executable to run, or a directory to open in the
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6268 Windows Explorer.
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6269
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6270 If DOCUMENT is a program executable, the optional third arg PARAMETERS
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6271 can be a string containing command line parameters that will be passed
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6272 to the program; otherwise, PARAMETERS should be nil or unspecified.
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6273
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6274 Optional fourth argument SHOW-FLAG can be used to control how the
74350
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6275 application will be displayed when it is invoked. If SHOW-FLAG is nil
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6276 or unspecified, the application is displayed normally, otherwise it is
74350
501f287c0352 (Fw32_shell_execute): Doc fix.
Eli Zaretskii <eliz@gnu.org>
parents: 74221
diff changeset
6277 an integer representing a ShowWindow flag:
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6278
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6279 0 - start hidden
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6280 1 - start normally
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6281 3 - start maximized
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6282 6 - start minimized */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
6283 (Lisp_Object operation, Lisp_Object document, Lisp_Object parameters, Lisp_Object show_flag)
24670
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
6284 {
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
6285 Lisp_Object current_dir;
108303
36d25edeedb5 Fix bug #6126.
Eli Zaretskii <eliz@gnu.org>
parents: 107753
diff changeset
6286 char *errstr;
24670
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
6287
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
6288 CHECK_STRING (document);
24670
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
6289
80140
001f79563e5a (Fw32_shell_execute): Encode parameters.
Jason Rumney <jasonr@gnu.org>
parents: 79759
diff changeset
6290 /* Encode filename, current directory and parameters. */
24670
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
6291 current_dir = ENCODE_FILE (current_buffer->directory);
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
6292 document = ENCODE_FILE (document);
80140
001f79563e5a (Fw32_shell_execute): Encode parameters.
Jason Rumney <jasonr@gnu.org>
parents: 79759
diff changeset
6293 if (STRINGP (parameters))
001f79563e5a (Fw32_shell_execute): Encode parameters.
Jason Rumney <jasonr@gnu.org>
parents: 79759
diff changeset
6294 parameters = ENCODE_SYSTEM (parameters);
001f79563e5a (Fw32_shell_execute): Encode parameters.
Jason Rumney <jasonr@gnu.org>
parents: 79759
diff changeset
6295
24670
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
6296 if ((int) ShellExecute (NULL,
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6297 (STRINGP (operation) ?
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
6298 SDATA (operation) : NULL),
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
6299 SDATA (document),
24670
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
6300 (STRINGP (parameters) ?
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
6301 SDATA (parameters) : NULL),
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
6302 SDATA (current_dir),
24670
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
6303 (INTEGERP (show_flag) ?
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
6304 XINT (show_flag) : SW_SHOWDEFAULT))
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
6305 > 32)
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
6306 return Qt;
108303
36d25edeedb5 Fix bug #6126.
Eli Zaretskii <eliz@gnu.org>
parents: 107753
diff changeset
6307 errstr = w32_strerror (0);
36d25edeedb5 Fix bug #6126.
Eli Zaretskii <eliz@gnu.org>
parents: 107753
diff changeset
6308 /* The error string might be encoded in the locale's encoding. */
36d25edeedb5 Fix bug #6126.
Eli Zaretskii <eliz@gnu.org>
parents: 107753
diff changeset
6309 if (!NILP (Vlocale_coding_system))
36d25edeedb5 Fix bug #6126.
Eli Zaretskii <eliz@gnu.org>
parents: 107753
diff changeset
6310 {
36d25edeedb5 Fix bug #6126.
Eli Zaretskii <eliz@gnu.org>
parents: 107753
diff changeset
6311 Lisp_Object decoded =
36d25edeedb5 Fix bug #6126.
Eli Zaretskii <eliz@gnu.org>
parents: 107753
diff changeset
6312 code_convert_string_norecord (make_unibyte_string (errstr,
36d25edeedb5 Fix bug #6126.
Eli Zaretskii <eliz@gnu.org>
parents: 107753
diff changeset
6313 strlen (errstr)),
36d25edeedb5 Fix bug #6126.
Eli Zaretskii <eliz@gnu.org>
parents: 107753
diff changeset
6314 Vlocale_coding_system, 0);
36d25edeedb5 Fix bug #6126.
Eli Zaretskii <eliz@gnu.org>
parents: 107753
diff changeset
6315 errstr = (char *)SDATA (decoded);
36d25edeedb5 Fix bug #6126.
Eli Zaretskii <eliz@gnu.org>
parents: 107753
diff changeset
6316 }
36d25edeedb5 Fix bug #6126.
Eli Zaretskii <eliz@gnu.org>
parents: 107753
diff changeset
6317 error ("ShellExecute failed: %s", errstr);
24670
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
6318 }
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
6319
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6320 /* Lookup virtual keycode from string representing the name of a
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6321 non-ascii keystroke into the corresponding virtual key, using
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6322 lispy_function_keys. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6323 static int
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6324 lookup_vk_code (char *key)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6325 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6326 int i;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6327
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6328 for (i = 0; i < 256; i++)
79563
fb6105cb466b (w32_wnd_proc, Fw32_reconstruct_hot_key): Range check
Jason Rumney <jasonr@gnu.org>
parents: 79393
diff changeset
6329 if (lispy_function_keys[i]
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6330 && strcmp (lispy_function_keys[i], key) == 0)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6331 return i;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6332
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6333 return -1;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6334 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6335
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6336 /* Convert a one-element vector style key sequence to a hot key
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6337 definition. */
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6338 static Lisp_Object
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
6339 w32_parse_hot_key (Lisp_Object key)
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6340 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6341 /* Copied from Fdefine_key and store_in_keymap. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6342 register Lisp_Object c;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6343 int vk_code;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6344 int lisp_modifiers;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6345 int w32_modifiers;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6346 struct gcpro gcpro1;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6347
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
6348 CHECK_VECTOR (key);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6349
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6350 if (XFASTINT (Flength (key)) != 1)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6351 return Qnil;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6352
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6353 GCPRO1 (key);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6354
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6355 c = Faref (key, make_number (0));
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6356
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6357 if (CONSP (c) && lucid_event_type_list_p (c))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6358 c = Fevent_convert_list (c);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6359
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6360 UNGCPRO;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6361
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6362 if (! INTEGERP (c) && ! SYMBOLP (c))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6363 error ("Key definition is invalid");
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6364
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6365 /* Work out the base key and the modifiers. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6366 if (SYMBOLP (c))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6367 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6368 c = parse_modifiers (c);
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6369 lisp_modifiers = XINT (Fcar (Fcdr (c)));
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6370 c = Fcar (c);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6371 if (!SYMBOLP (c))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6372 abort ();
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
6373 vk_code = lookup_vk_code (SDATA (SYMBOL_NAME (c)));
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6374 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6375 else if (INTEGERP (c))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6376 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6377 lisp_modifiers = XINT (c) & ~CHARACTERBITS;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6378 /* Many ascii characters are their own virtual key code. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6379 vk_code = XINT (c) & CHARACTERBITS;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6380 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6381
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6382 if (vk_code < 0 || vk_code > 255)
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6383 return Qnil;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6384
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6385 if ((lisp_modifiers & meta_modifier) != 0
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6386 && !NILP (Vw32_alt_is_meta))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6387 lisp_modifiers |= alt_modifier;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6388
31110
9feda85db5d6 (max): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30601
diff changeset
6389 /* Supply defs missing from mingw32. */
9feda85db5d6 (max): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30601
diff changeset
6390 #ifndef MOD_ALT
9feda85db5d6 (max): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30601
diff changeset
6391 #define MOD_ALT 0x0001
9feda85db5d6 (max): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30601
diff changeset
6392 #define MOD_CONTROL 0x0002
9feda85db5d6 (max): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30601
diff changeset
6393 #define MOD_SHIFT 0x0004
9feda85db5d6 (max): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30601
diff changeset
6394 #define MOD_WIN 0x0008
9feda85db5d6 (max): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30601
diff changeset
6395 #endif
9feda85db5d6 (max): Define macro.
Andrew Innes <andrewi@gnu.org>
parents: 30601
diff changeset
6396
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6397 /* Convert lisp modifiers to Windows hot-key form. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6398 w32_modifiers = (lisp_modifiers & hyper_modifier) ? MOD_WIN : 0;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6399 w32_modifiers |= (lisp_modifiers & alt_modifier) ? MOD_ALT : 0;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6400 w32_modifiers |= (lisp_modifiers & ctrl_modifier) ? MOD_CONTROL : 0;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6401 w32_modifiers |= (lisp_modifiers & shift_modifier) ? MOD_SHIFT : 0;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6402
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6403 return HOTKEY (vk_code, w32_modifiers);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6404 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6405
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6406 DEFUN ("w32-register-hot-key", Fw32_register_hot_key,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6407 Sw32_register_hot_key, 1, 1, 0,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6408 doc: /* Register KEY as a hot-key combination.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6409 Certain key combinations like Alt-Tab are reserved for system use on
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6410 Windows, and therefore are normally intercepted by the system. However,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6411 most of these key combinations can be received by registering them as
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6412 hot-keys, overriding their special meaning.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6413
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6414 KEY must be a one element key definition in vector form that would be
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6415 acceptable to `define-key' (e.g. [A-tab] for Alt-Tab). The meta
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6416 modifier is interpreted as Alt if `w32-alt-is-meta' is t, and hyper
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6417 is always interpreted as the Windows modifier keys.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6418
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6419 The return value is the hotkey-id if registered, otherwise nil. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
6420 (Lisp_Object key)
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6421 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6422 key = w32_parse_hot_key (key);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6423
79381
c157297ae42e (Fw32_register_hot_key): Don't try to register
Juanma Barranquero <lekktu@gmail.com>
parents: 79213
diff changeset
6424 if (!NILP (key) && NILP (Fmemq (key, w32_grabbed_keys)))
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6425 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6426 /* Reuse an empty slot if possible. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6427 Lisp_Object item = Fmemq (Qnil, w32_grabbed_keys);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6428
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6429 /* Safe to add new key to list, even if we have focus. */
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6430 if (NILP (item))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6431 w32_grabbed_keys = Fcons (key, w32_grabbed_keys);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6432 else
39973
579177964efa Avoid (most) uses of XCAR/XCDR as lvalues, for flexibility in experimenting
Ken Raeburn <raeburn@raeburn.org>
parents: 39812
diff changeset
6433 XSETCAR (item, key);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6434
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6435 /* Notify input thread about new hot-key definition, so that it
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6436 takes effect without needing to switch focus. */
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6437 #ifdef USE_LISP_UNION_TYPE
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6438 PostThreadMessage (dwWindowsThreadId, WM_EMACS_REGISTER_HOT_KEY,
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6439 (WPARAM) key.i, 0);
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6440 #else
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6441 PostThreadMessage (dwWindowsThreadId, WM_EMACS_REGISTER_HOT_KEY,
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6442 (WPARAM) key, 0);
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6443 #endif
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6444 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6445
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6446 return key;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6447 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6448
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6449 DEFUN ("w32-unregister-hot-key", Fw32_unregister_hot_key,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6450 Sw32_unregister_hot_key, 1, 1, 0,
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
6451 doc: /* Unregister KEY as a hot-key combination. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
6452 (Lisp_Object key)
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6453 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6454 Lisp_Object item;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6455
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6456 if (!INTEGERP (key))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6457 key = w32_parse_hot_key (key);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6458
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6459 item = Fmemq (key, w32_grabbed_keys);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6460
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6461 if (!NILP (item))
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6462 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6463 /* Notify input thread about hot-key definition being removed, so
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6464 that it takes effect without needing focus switch. */
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6465 #ifdef USE_LISP_UNION_TYPE
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6466 if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY,
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6467 (WPARAM) XINT (XCAR (item)), (LPARAM) item.i))
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6468 #else
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6469 if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY,
55673
4401083a1583 Fix last change for non USE_LISP_UNION_TYPE case.
Jason Rumney <jasonr@gnu.org>
parents: 55656
diff changeset
6470 (WPARAM) XINT (XCAR (item)), (LPARAM) item))
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6471 #endif
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6472 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6473 MSG msg;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6474 GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6475 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6476 return Qt;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6477 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6478 return Qnil;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6479 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6480
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6481 DEFUN ("w32-registered-hot-keys", Fw32_registered_hot_keys,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6482 Sw32_registered_hot_keys, 0, 0, 0,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6483 doc: /* Return list of registered hot-key IDs. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
6484 (void)
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6485 {
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6486 return Fdelq (Qnil, Fcopy_sequence (w32_grabbed_keys));
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6487 }
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6488
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6489 DEFUN ("w32-reconstruct-hot-key", Fw32_reconstruct_hot_key,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6490 Sw32_reconstruct_hot_key, 1, 1, 0,
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
6491 doc: /* Convert hot-key ID to a lisp key combination.
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
6492 usage: (w32-reconstruct-hot-key ID) */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
6493 (Lisp_Object hotkeyid)
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6494 {
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6495 int vk_code, w32_modifiers;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6496 Lisp_Object key;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6497
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
6498 CHECK_NUMBER (hotkeyid);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6499
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6500 vk_code = HOTKEY_VK_CODE (hotkeyid);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6501 w32_modifiers = HOTKEY_MODIFIERS (hotkeyid);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6502
79563
fb6105cb466b (w32_wnd_proc, Fw32_reconstruct_hot_key): Range check
Jason Rumney <jasonr@gnu.org>
parents: 79393
diff changeset
6503 if (vk_code < 256 && lispy_function_keys[vk_code])
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6504 key = intern (lispy_function_keys[vk_code]);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6505 else
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6506 key = make_number (vk_code);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6507
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6508 key = Fcons (key, Qnil);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6509 if (w32_modifiers & MOD_SHIFT)
23950
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
6510 key = Fcons (Qshift, key);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6511 if (w32_modifiers & MOD_CONTROL)
23950
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
6512 key = Fcons (Qctrl, key);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6513 if (w32_modifiers & MOD_ALT)
23950
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
6514 key = Fcons (NILP (Vw32_alt_is_meta) ? Qalt : Qmeta, key);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6515 if (w32_modifiers & MOD_WIN)
23950
d8f8533db4cc (w32_msg_pump): Ignore WM_NULL message posted to thread
Andrew Innes <andrewi@gnu.org>
parents: 23803
diff changeset
6516 key = Fcons (Qhyper, key);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6517
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6518 return key;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6519 }
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6520
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6521 DEFUN ("w32-toggle-lock-key", Fw32_toggle_lock_key,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6522 Sw32_toggle_lock_key, 1, 2, 0,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6523 doc: /* Toggle the state of the lock key KEY.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6524 KEY can be `capslock', `kp-numlock', or `scroll'.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6525 If the optional parameter NEW-STATE is a number, then the state of KEY
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6526 is set to off if the low bit of NEW-STATE is zero, otherwise on. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
6527 (Lisp_Object key, Lisp_Object new_state)
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6528 {
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6529 int vk_code;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6530
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6531 if (EQ (key, intern ("capslock")))
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6532 vk_code = VK_CAPITAL;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6533 else if (EQ (key, intern ("kp-numlock")))
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6534 vk_code = VK_NUMLOCK;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6535 else if (EQ (key, intern ("scroll")))
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6536 vk_code = VK_SCROLL;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6537 else
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6538 return Qnil;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6539
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6540 if (!dwWindowsThreadId)
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6541 return make_number (w32_console_toggle_lock_key (vk_code, new_state));
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6542
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6543 #ifdef USE_LISP_UNION_TYPE
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6544 if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_TOGGLE_LOCK_KEY,
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6545 (WPARAM) vk_code, (LPARAM) new_state.i))
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6546 #else
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6547 if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_TOGGLE_LOCK_KEY,
55673
4401083a1583 Fix last change for non USE_LISP_UNION_TYPE case.
Jason Rumney <jasonr@gnu.org>
parents: 55656
diff changeset
6548 (WPARAM) vk_code, (LPARAM) new_state))
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6549 #endif
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6550 {
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6551 MSG msg;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6552 GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6553 return make_number (msg.wParam);
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6554 }
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6555 return Qnil;
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6556 }
74661
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6557
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6558 DEFUN ("w32-window-exists-p", Fw32_window_exists_p, Sw32_window_exists_p,
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6559 2, 2, 0,
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6560 doc: /* Return non-nil if a window exists with the specified CLASS and NAME.
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6561
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6562 This is a direct interface to the Windows API FindWindow function. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
6563 (Lisp_Object class, Lisp_Object name)
74661
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6564 {
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6565 HWND hnd;
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6566
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6567 if (!NILP (class))
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6568 CHECK_STRING (class);
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6569 if (!NILP (name))
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6570 CHECK_STRING (name);
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6571
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6572 hnd = FindWindow (STRINGP (class) ? ((LPCTSTR) SDATA (class)) : NULL,
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6573 STRINGP (name) ? ((LPCTSTR) SDATA (name)) : NULL);
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6574 if (!hnd)
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6575 return Qnil;
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6576 return Qt;
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6577 }
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6578
94447
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6579 DEFUN ("w32-battery-status", Fw32_battery_status, Sw32_battery_status, 0, 0, 0,
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6580 doc: /* Get power status information from Windows system.
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6581
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6582 The following %-sequences are provided:
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6583 %L AC line status (verbose)
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6584 %B Battery status (verbose)
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6585 %b Battery status, empty means high, `-' means low,
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6586 `!' means critical, and `+' means charging
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6587 %p Battery load percentage
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6588 %s Remaining time (to charge or discharge) in seconds
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6589 %m Remaining time (to charge or discharge) in minutes
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6590 %h Remaining time (to charge or discharge) in hours
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6591 %t Remaining time (to charge or discharge) in the form `h:min' */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
6592 (void)
94447
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6593 {
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6594 Lisp_Object status = Qnil;
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6595
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6596 SYSTEM_POWER_STATUS system_status;
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6597 if (GetSystemPowerStatus (&system_status))
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6598 {
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6599 Lisp_Object line_status, battery_status, battery_status_symbol;
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6600 Lisp_Object load_percentage, seconds, minutes, hours, remain;
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6601 Lisp_Object sequences[8];
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6602
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6603 long seconds_left = (long) system_status.BatteryLifeTime;
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6604
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6605 if (system_status.ACLineStatus == 0)
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6606 line_status = build_string ("off-line");
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6607 else if (system_status.ACLineStatus == 1)
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6608 line_status = build_string ("on-line");
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6609 else
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6610 line_status = build_string ("N/A");
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6611
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6612 if (system_status.BatteryFlag & 128)
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6613 {
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6614 battery_status = build_string ("N/A");
101276
dd95cb42c0aa * dbusbind.c (Fdbus_register_signal):
Juanma Barranquero <lekktu@gmail.com>
parents: 100982
diff changeset
6615 battery_status_symbol = empty_unibyte_string;
94447
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6616 }
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6617 else if (system_status.BatteryFlag & 8)
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6618 {
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6619 battery_status = build_string ("charging");
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6620 battery_status_symbol = build_string ("+");
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6621 if (system_status.BatteryFullLifeTime != -1L)
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6622 seconds_left = system_status.BatteryFullLifeTime - seconds_left;
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6623 }
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6624 else if (system_status.BatteryFlag & 4)
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6625 {
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6626 battery_status = build_string ("critical");
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6627 battery_status_symbol = build_string ("!");
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6628 }
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6629 else if (system_status.BatteryFlag & 2)
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6630 {
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6631 battery_status = build_string ("low");
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6632 battery_status_symbol = build_string ("-");
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6633 }
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6634 else if (system_status.BatteryFlag & 1)
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6635 {
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6636 battery_status = build_string ("high");
101276
dd95cb42c0aa * dbusbind.c (Fdbus_register_signal):
Juanma Barranquero <lekktu@gmail.com>
parents: 100982
diff changeset
6637 battery_status_symbol = empty_unibyte_string;
94447
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6638 }
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6639 else
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6640 {
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6641 battery_status = build_string ("medium");
101276
dd95cb42c0aa * dbusbind.c (Fdbus_register_signal):
Juanma Barranquero <lekktu@gmail.com>
parents: 100982
diff changeset
6642 battery_status_symbol = empty_unibyte_string;
94447
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6643 }
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6644
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6645 if (system_status.BatteryLifePercent > 100)
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6646 load_percentage = build_string ("N/A");
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6647 else
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6648 {
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6649 char buffer[16];
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6650 _snprintf (buffer, 16, "%d", system_status.BatteryLifePercent);
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6651 load_percentage = build_string (buffer);
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6652 }
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6653
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6654 if (seconds_left < 0)
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6655 seconds = minutes = hours = remain = build_string ("N/A");
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6656 else
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6657 {
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6658 long m;
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6659 float h;
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6660 char buffer[16];
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6661 _snprintf (buffer, 16, "%ld", seconds_left);
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6662 seconds = build_string (buffer);
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6663
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6664 m = seconds_left / 60;
94618
033cc6f89687 (Fw32_battery_status): Fix computation of %t (h:min) format.
Juanma Barranquero <lekktu@gmail.com>
parents: 94447
diff changeset
6665 _snprintf (buffer, 16, "%ld", m);
94447
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6666 minutes = build_string (buffer);
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6667
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6668 h = seconds_left / 3600.0;
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6669 _snprintf (buffer, 16, "%3.1f", h);
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6670 hours = build_string (buffer);
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6671
94618
033cc6f89687 (Fw32_battery_status): Fix computation of %t (h:min) format.
Juanma Barranquero <lekktu@gmail.com>
parents: 94447
diff changeset
6672 _snprintf (buffer, 16, "%ld:%02ld", m / 60, m % 60);
94447
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6673 remain = build_string (buffer);
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6674 }
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6675 sequences[0] = Fcons (make_number ('L'), line_status);
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6676 sequences[1] = Fcons (make_number ('B'), battery_status);
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6677 sequences[2] = Fcons (make_number ('b'), battery_status_symbol);
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6678 sequences[3] = Fcons (make_number ('p'), load_percentage);
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6679 sequences[4] = Fcons (make_number ('s'), seconds);
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6680 sequences[5] = Fcons (make_number ('m'), minutes);
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6681 sequences[6] = Fcons (make_number ('h'), hours);
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6682 sequences[7] = Fcons (make_number ('t'), remain);
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6683
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6684 status = Flist (8, sequences);
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6685 }
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6686 return status;
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
6687 }
74661
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
6688
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
6689
34643
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6690 DEFUN ("file-system-info", Ffile_system_info, Sfile_system_info, 1, 1, 0,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6691 doc: /* Return storage information about the file system FILENAME is on.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6692 Value is a list of floats (TOTAL FREE AVAIL), where TOTAL is the total
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6693 storage of the file system, FREE is the free storage, and AVAIL is the
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6694 storage available to a non-superuser. All 3 numbers are in bytes.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6695 If the underlying system call fails, value is nil. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
6696 (Lisp_Object filename)
34643
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6697 {
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6698 Lisp_Object encoded, value;
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6699
40656
cdfd4d09b79a Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents: 40528
diff changeset
6700 CHECK_STRING (filename);
34643
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6701 filename = Fexpand_file_name (filename, Qnil);
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6702 encoded = ENCODE_FILE (filename);
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6703
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6704 value = Qnil;
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6705
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6706 /* Determining the required information on Windows turns out, sadly,
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6707 to be more involved than one would hope. The original Win32 api
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6708 call for this will return bogus information on some systems, but we
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6709 must dynamically probe for the replacement api, since that was
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6710 added rather late on. */
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6711 {
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6712 HMODULE hKernel = GetModuleHandle ("kernel32");
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6713 BOOL (*pfn_GetDiskFreeSpaceEx)
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6714 (char *, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER)
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6715 = (void *) GetProcAddress (hKernel, "GetDiskFreeSpaceEx");
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6716
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6717 /* On Windows, we may need to specify the root directory of the
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6718 volume holding FILENAME. */
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6719 char rootname[MAX_PATH];
46370
40db0673e6f0 Most uses of XSTRING combined with STRING_BYTES or indirection changed to
Ken Raeburn <raeburn@raeburn.org>
parents: 46293
diff changeset
6720 char *name = SDATA (encoded);
34643
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6721
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6722 /* find the root name of the volume if given */
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6723 if (isalpha (name[0]) && name[1] == ':')
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6724 {
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6725 rootname[0] = name[0];
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6726 rootname[1] = name[1];
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6727 rootname[2] = '\\';
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6728 rootname[3] = 0;
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6729 }
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6730 else if (IS_DIRECTORY_SEP (name[0]) && IS_DIRECTORY_SEP (name[1]))
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6731 {
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6732 char *str = rootname;
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6733 int slashes = 4;
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6734 do
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6735 {
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6736 if (IS_DIRECTORY_SEP (*name) && --slashes == 0)
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6737 break;
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6738 *str++ = *name++;
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6739 }
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6740 while ( *name );
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6741
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6742 *str++ = '\\';
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6743 *str = 0;
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6744 }
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6745
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6746 if (pfn_GetDiskFreeSpaceEx)
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6747 {
44047
73645cbc79a7 (x_set_cursor_color): Set foreground of cursor, not frame.
Jason Rumney <jasonr@gnu.org>
parents: 43963
diff changeset
6748 /* Unsigned large integers cannot be cast to double, so
73645cbc79a7 (x_set_cursor_color): Set foreground of cursor, not frame.
Jason Rumney <jasonr@gnu.org>
parents: 43963
diff changeset
6749 use signed ones instead. */
34643
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6750 LARGE_INTEGER availbytes;
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6751 LARGE_INTEGER freebytes;
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6752 LARGE_INTEGER totalbytes;
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6753
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6754 if (pfn_GetDiskFreeSpaceEx (rootname,
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6755 (ULARGE_INTEGER *)&availbytes,
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6756 (ULARGE_INTEGER *)&totalbytes,
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6757 (ULARGE_INTEGER *)&freebytes))
34643
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6758 value = list3 (make_float ((double) totalbytes.QuadPart),
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6759 make_float ((double) freebytes.QuadPart),
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6760 make_float ((double) availbytes.QuadPart));
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6761 }
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6762 else
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6763 {
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6764 DWORD sectors_per_cluster;
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6765 DWORD bytes_per_sector;
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6766 DWORD free_clusters;
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6767 DWORD total_clusters;
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6768
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6769 if (GetDiskFreeSpace (rootname,
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6770 &sectors_per_cluster,
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6771 &bytes_per_sector,
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6772 &free_clusters,
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6773 &total_clusters))
34643
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6774 value = list3 (make_float ((double) total_clusters
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6775 * sectors_per_cluster * bytes_per_sector),
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6776 make_float ((double) free_clusters
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6777 * sectors_per_cluster * bytes_per_sector),
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6778 make_float ((double) free_clusters
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6779 * sectors_per_cluster * bytes_per_sector));
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6780 }
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6781 }
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6782
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6783 return value;
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6784 }
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
6785
53739
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6786 DEFUN ("default-printer-name", Fdefault_printer_name, Sdefault_printer_name,
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6787 0, 0, 0, doc: /* Return the name of Windows default printer device. */)
109179
8cfee7d2955f Convert DEFUNs to standard C.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 109165
diff changeset
6788 (void)
53739
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6789 {
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6790 static char pname_buf[256];
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6791 int err;
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6792 HANDLE hPrn;
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6793 PRINTER_INFO_2 *ppi2 = NULL;
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6794 DWORD dwNeeded = 0, dwReturned = 0;
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6795
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6796 /* Retrieve the default string from Win.ini (the registry).
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6797 * String will be in form "printername,drivername,portname".
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6798 * This is the most portable way to get the default printer. */
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6799 if (GetProfileString ("windows", "device", ",,", pname_buf, sizeof (pname_buf)) <= 0)
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6800 return Qnil;
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6801 /* printername precedes first "," character */
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6802 strtok (pname_buf, ",");
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6803 /* We want to know more than the printer name */
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6804 if (!OpenPrinter (pname_buf, &hPrn, NULL))
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6805 return Qnil;
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6806 GetPrinter (hPrn, 2, NULL, 0, &dwNeeded);
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6807 if (dwNeeded == 0)
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6808 {
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6809 ClosePrinter (hPrn);
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6810 return Qnil;
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6811 }
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6812 /* Allocate memory for the PRINTER_INFO_2 struct */
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6813 ppi2 = (PRINTER_INFO_2 *) xmalloc (dwNeeded);
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6814 if (!ppi2)
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6815 {
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6816 ClosePrinter (hPrn);
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6817 return Qnil;
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6818 }
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6819 /* Call GetPrinter again with big enouth memory block */
53739
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6820 err = GetPrinter (hPrn, 2, (LPBYTE)ppi2, dwNeeded, &dwReturned);
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6821 ClosePrinter (hPrn);
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6822 if (!err)
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6823 {
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6824 xfree (ppi2);
53739
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6825 return Qnil;
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6826 }
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6827
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6828 if (ppi2)
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6829 {
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6830 if (ppi2->Attributes & PRINTER_ATTRIBUTE_SHARED && ppi2->pServerName)
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6831 {
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6832 /* a remote printer */
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6833 if (*ppi2->pServerName == '\\')
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6834 _snprintf (pname_buf, sizeof (pname_buf), "%s\\%s", ppi2->pServerName,
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6835 ppi2->pShareName);
53739
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6836 else
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6837 _snprintf (pname_buf, sizeof (pname_buf), "\\\\%s\\%s", ppi2->pServerName,
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6838 ppi2->pShareName);
53739
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6839 pname_buf[sizeof (pname_buf) - 1] = '\0';
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6840 }
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6841 else
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6842 {
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6843 /* a local printer */
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6844 strncpy (pname_buf, ppi2->pPortName, sizeof (pname_buf));
53739
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6845 pname_buf[sizeof (pname_buf) - 1] = '\0';
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6846 /* `pPortName' can include several ports, delimited by ','.
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6847 * we only use the first one. */
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6848 strtok (pname_buf, ",");
53739
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6849 }
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
6850 xfree (ppi2);
53739
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6851 }
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6852
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6853 return build_string (pname_buf);
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6854 }
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
6855
41480
2c71c672b3c7 (x_create_tip_frame): Set frame's fringes_extra to 0.
Jason Rumney <jasonr@gnu.org>
parents: 41448
diff changeset
6856 /***********************************************************************
2c71c672b3c7 (x_create_tip_frame): Set frame's fringes_extra to 0.
Jason Rumney <jasonr@gnu.org>
parents: 41448
diff changeset
6857 Initialization
2c71c672b3c7 (x_create_tip_frame): Set frame's fringes_extra to 0.
Jason Rumney <jasonr@gnu.org>
parents: 41448
diff changeset
6858 ***********************************************************************/
2c71c672b3c7 (x_create_tip_frame): Set frame's fringes_extra to 0.
Jason Rumney <jasonr@gnu.org>
parents: 41448
diff changeset
6859
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
6860 /* Keep this list in the same order as frame_parms in frame.c.
50362
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6861 Use 0 for unsupported frame parameters. */
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6862
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6863 frame_parm_handler w32_frame_parm_handlers[] =
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6864 {
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6865 x_set_autoraise,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6866 x_set_autolower,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6867 x_set_background_color,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6868 x_set_border_color,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6869 x_set_border_width,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6870 x_set_cursor_color,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6871 x_set_cursor_type,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6872 x_set_font,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6873 x_set_foreground_color,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6874 x_set_icon_name,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6875 x_set_icon_type,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6876 x_set_internal_border_width,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6877 x_set_menu_bar_lines,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6878 x_set_mouse_color,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6879 x_explicitly_set_name,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6880 x_set_scroll_bar_width,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6881 x_set_title,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6882 x_set_unsplittable,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6883 x_set_vertical_scroll_bars,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6884 x_set_visibility,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6885 x_set_tool_bar_lines,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6886 0, /* x_set_scroll_bar_foreground, */
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6887 0, /* x_set_scroll_bar_background, */
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6888 x_set_screen_gamma,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6889 x_set_line_spacing,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6890 x_set_fringe_width,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6891 x_set_fringe_width,
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6892 0, /* x_set_wait_for_wm, */
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6893 x_set_fullscreen,
95162
4b6526b6c53a Seiji Zenitani <zenitani at mac.com>
Glenn Morris <rgm@gnu.org>
parents: 94963
diff changeset
6894 x_set_font_backend,
103674
1867be80e595 * w32fns.c (w32_frame_parm_handlers): Set 0 for sticky.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103305
diff changeset
6895 x_set_alpha,
1867be80e595 * w32fns.c (w32_frame_parm_handlers): Set 0 for sticky.
Jan Djärv <jan.h.d@swipnet.se>
parents: 103305
diff changeset
6896 0, /* x_set_sticky */
109818
0710ff9a8063 Fix bug #6796.
Eli Zaretskii <eliz@gnu.org>
parents: 109716
diff changeset
6897 0, /* x_set_tool_bar_position */
50362
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6898 };
6d942c1d5f2d * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame
Kim F. Storm <storm@cua.dk>
parents: 50229
diff changeset
6899
41480
2c71c672b3c7 (x_create_tip_frame): Set frame's fringes_extra to 0.
Jason Rumney <jasonr@gnu.org>
parents: 41448
diff changeset
6900 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
6901 syms_of_w32fns (void)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
6902 {
49455
a6825c5c7ce7 (init_jpeg_functions, jpeg_resync_to_restart_wrapper):
Jason Rumney <jasonr@gnu.org>
parents: 49448
diff changeset
6903 globals_of_w32fns ();
a6825c5c7ce7 (init_jpeg_functions, jpeg_resync_to_restart_wrapper):
Jason Rumney <jasonr@gnu.org>
parents: 49448
diff changeset
6904 /* This is zero if not using MS-Windows. */
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
6905 w32_in_use = 0;
41732
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
6906 track_mouse_window = NULL;
0d9b74cd27cd (trackmouse_window, track_mouse_event_fn): New vars.
Jason Rumney <jasonr@gnu.org>
parents: 41726
diff changeset
6907
42918
9b06036a8c5e (syms_of_w32fns): Initialize w32_visible_system_caret_hwnd.
Jason Rumney <jasonr@gnu.org>
parents: 42865
diff changeset
6908 w32_visible_system_caret_hwnd = NULL;
9b06036a8c5e (syms_of_w32fns): Initialize w32_visible_system_caret_hwnd.
Jason Rumney <jasonr@gnu.org>
parents: 42865
diff changeset
6909
90919
2f257010ddd5 (syms_of_w32fns): Use DEFSYM macro.
Jason Rumney <jasonr@gnu.org>
parents: 90918
diff changeset
6910 DEFSYM (Qnone, "none");
2f257010ddd5 (syms_of_w32fns): Use DEFSYM macro.
Jason Rumney <jasonr@gnu.org>
parents: 90918
diff changeset
6911 DEFSYM (Qsuppress_icon, "suppress-icon");
2f257010ddd5 (syms_of_w32fns): Use DEFSYM macro.
Jason Rumney <jasonr@gnu.org>
parents: 90918
diff changeset
6912 DEFSYM (Qundefined_color, "undefined-color");
2f257010ddd5 (syms_of_w32fns): Use DEFSYM macro.
Jason Rumney <jasonr@gnu.org>
parents: 90918
diff changeset
6913 DEFSYM (Qcancel_timer, "cancel-timer");
2f257010ddd5 (syms_of_w32fns): Use DEFSYM macro.
Jason Rumney <jasonr@gnu.org>
parents: 90918
diff changeset
6914 DEFSYM (Qhyper, "hyper");
2f257010ddd5 (syms_of_w32fns): Use DEFSYM macro.
Jason Rumney <jasonr@gnu.org>
parents: 90918
diff changeset
6915 DEFSYM (Qsuper, "super");
2f257010ddd5 (syms_of_w32fns): Use DEFSYM macro.
Jason Rumney <jasonr@gnu.org>
parents: 90918
diff changeset
6916 DEFSYM (Qmeta, "meta");
2f257010ddd5 (syms_of_w32fns): Use DEFSYM macro.
Jason Rumney <jasonr@gnu.org>
parents: 90918
diff changeset
6917 DEFSYM (Qalt, "alt");
2f257010ddd5 (syms_of_w32fns): Use DEFSYM macro.
Jason Rumney <jasonr@gnu.org>
parents: 90918
diff changeset
6918 DEFSYM (Qctrl, "ctrl");
2f257010ddd5 (syms_of_w32fns): Use DEFSYM macro.
Jason Rumney <jasonr@gnu.org>
parents: 90918
diff changeset
6919 DEFSYM (Qcontrol, "control");
2f257010ddd5 (syms_of_w32fns): Use DEFSYM macro.
Jason Rumney <jasonr@gnu.org>
parents: 90918
diff changeset
6920 DEFSYM (Qshift, "shift");
96079
efbaf6995245 * w32fns.c, xfns.c (Qfont_param): New var.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 95894
diff changeset
6921 DEFSYM (Qfont_param, "font-parameter");
43398
8782b8cfed62 *** empty log message ***
Jason Rumney <jasonr@gnu.org>
parents: 43210
diff changeset
6922 /* This is the end of symbol initialization. */
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6923
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6924 /* Text property `display' should be nonsticky by default. */
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6925 Vtext_property_default_nonsticky
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6926 = Fcons (Fcons (Qdisplay, Qt), Vtext_property_default_nonsticky);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6927
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
6928
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
6929 Fput (Qundefined_color, Qerror_conditions,
105877
21bdda3ded62 * xterm.c (syms_of_xterm):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105794
diff changeset
6930 pure_cons (Qundefined_color, pure_cons (Qerror, Qnil)));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
6931 Fput (Qundefined_color, Qerror_message,
105877
21bdda3ded62 * xterm.c (syms_of_xterm):
Dan Nicolaescu <dann@ics.uci.edu>
parents: 105794
diff changeset
6932 make_pure_c_string ("Undefined color"));
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
6933
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6934 staticpro (&w32_grabbed_keys);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6935 w32_grabbed_keys = Qnil;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6936
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
6937 DEFVAR_LISP ("w32-color-map", &Vw32_color_map,
55892
c12c7852c322 (Fx_display_grayscale_p, Fw32_send_sys_command, Vw32_color_map):
Juanma Barranquero <lekktu@gmail.com>
parents: 55673
diff changeset
6938 doc: /* An array of color name mappings for Windows. */);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
6939 Vw32_color_map = Qnil;
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
6940
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
6941 DEFVAR_LISP ("w32-pass-alt-to-system", &Vw32_pass_alt_to_system,
73087
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6942 doc: /* Non-nil if Alt key presses are passed on to Windows.
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6943 When non-nil, for example, Alt pressed and released and then space will
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6944 open the System menu. When nil, Emacs processes the Alt key events, and
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6945 then silently swallows them. */);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
6946 Vw32_pass_alt_to_system = Qnil;
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
6947
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
6948 DEFVAR_LISP ("w32-alt-is-meta", &Vw32_alt_is_meta,
73087
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6949 doc: /* Non-nil if the Alt key is to be considered the same as the META key.
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6950 When nil, Emacs will translate the Alt key to the ALT modifier, not to META. */);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
6951 Vw32_alt_is_meta = Qt;
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
6952
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6953 DEFVAR_INT ("w32-quit-key", &w32_quit_key,
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6954 doc: /* If non-zero, the virtual key code for an alternative quit key. */);
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6955 w32_quit_key = 0;
24339
e8b73c2ac4ec (Vw32_quit_key): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24252
diff changeset
6956
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
6957 DEFVAR_LISP ("w32-pass-lwindow-to-system",
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6958 &Vw32_pass_lwindow_to_system,
73087
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6959 doc: /* If non-nil, the left \"Windows\" key is passed on to Windows.
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6960
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6961 When non-nil, the Start menu is opened by tapping the key.
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6962 If you set this to nil, the left \"Windows\" key is processed by Emacs
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6963 according to the value of `w32-lwindow-modifier', which see.
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6964
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6965 Note that some combinations of the left \"Windows\" key with other keys are
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6966 caught by Windows at low level, and so binding them in Emacs will have no
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6967 effect. For example, <lwindow>-r always pops up the Windows Run dialog,
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6968 <lwindow>-<Pause> pops up the "System Properties" dialog, etc. However, see
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6969 the doc string of `w32-phantom-key-code'. */);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6970 Vw32_pass_lwindow_to_system = Qt;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6971
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
6972 DEFVAR_LISP ("w32-pass-rwindow-to-system",
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6973 &Vw32_pass_rwindow_to_system,
73087
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6974 doc: /* If non-nil, the right \"Windows\" key is passed on to Windows.
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6975
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6976 When non-nil, the Start menu is opened by tapping the key.
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6977 If you set this to nil, the right \"Windows\" key is processed by Emacs
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6978 according to the value of `w32-rwindow-modifier', which see.
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6979
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6980 Note that some combinations of the right \"Windows\" key with other keys are
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6981 caught by Windows at low level, and so binding them in Emacs will have no
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6982 effect. For example, <rwindow>-r always pops up the Windows Run dialog,
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6983 <rwindow>-<Pause> pops up the "System Properties" dialog, etc. However, see
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
6984 the doc string of `w32-phantom-key-code'. */);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6985 Vw32_pass_rwindow_to_system = Qt;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
6986
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6987 DEFVAR_LISP ("w32-phantom-key-code",
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6988 &Vw32_phantom_key_code,
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6989 doc: /* Virtual key code used to generate \"phantom\" key presses.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6990 Value is a number between 0 and 255.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6991
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6992 Phantom key presses are generated in order to stop the system from
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6993 acting on \"Windows\" key events when `w32-pass-lwindow-to-system' or
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
6994 `w32-pass-rwindow-to-system' is nil. */);
24718
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
6995 /* Although 255 is technically not a valid key code, it works and
547f54dfbb94 (x_to_w32_charset): Reinstall VIETNAMESE_CHARSET
Andrew Innes <andrewi@gnu.org>
parents: 24695
diff changeset
6996 means that this hack won't interfere with any real key code. */
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
6997 XSETINT (Vw32_phantom_key_code, 255);
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
6998
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
6999 DEFVAR_LISP ("w32-enable-num-lock",
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7000 &Vw32_enable_num_lock,
73087
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
7001 doc: /* If non-nil, the Num Lock key acts normally.
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
7002 Set to nil to handle Num Lock as the `kp-numlock' key. */);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7003 Vw32_enable_num_lock = Qt;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7004
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
7005 DEFVAR_LISP ("w32-enable-caps-lock",
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7006 &Vw32_enable_caps_lock,
73087
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
7007 doc: /* If non-nil, the Caps Lock key acts normally.
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
7008 Set to nil to handle Caps Lock as the `capslock' key. */);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7009 Vw32_enable_caps_lock = Qt;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7010
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7011 DEFVAR_LISP ("w32-scroll-lock-modifier",
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7012 &Vw32_scroll_lock_modifier,
73087
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
7013 doc: /* Modifier to use for the Scroll Lock ON state.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7014 The value can be hyper, super, meta, alt, control or shift for the
73087
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
7015 respective modifier, or nil to handle Scroll Lock as the `scroll' key.
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
7016 Any other value will cause the Scroll Lock key to be ignored. */);
105794
26f423968392 (syms_of_w32fns): Change default value of
Jason Rumney <jasonr@gnu.org>
parents: 105669
diff changeset
7017 Vw32_scroll_lock_modifier = Qnil;
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7018
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7019 DEFVAR_LISP ("w32-lwindow-modifier",
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7020 &Vw32_lwindow_modifier,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7021 doc: /* Modifier to use for the left \"Windows\" key.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7022 The value can be hyper, super, meta, alt, control or shift for the
73087
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
7023 respective modifier, or nil to appear as the `lwindow' key.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7024 Any other value will cause the key to be ignored. */);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7025 Vw32_lwindow_modifier = Qnil;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7026
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7027 DEFVAR_LISP ("w32-rwindow-modifier",
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7028 &Vw32_rwindow_modifier,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7029 doc: /* Modifier to use for the right \"Windows\" key.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7030 The value can be hyper, super, meta, alt, control or shift for the
73087
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
7031 respective modifier, or nil to appear as the `rwindow' key.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7032 Any other value will cause the key to be ignored. */);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7033 Vw32_rwindow_modifier = Qnil;
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7034
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7035 DEFVAR_LISP ("w32-apps-modifier",
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7036 &Vw32_apps_modifier,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7037 doc: /* Modifier to use for the \"Apps\" key.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7038 The value can be hyper, super, meta, alt, control or shift for the
73087
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
7039 respective modifier, or nil to appear as the `apps' key.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7040 Any other value will cause the key to be ignored. */);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7041 Vw32_apps_modifier = Qnil;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
7042
42845
ebb3a20bc357 (w32_load_system_font, w32_to_x_charset): Use strnicmp
Jason Rumney <jasonr@gnu.org>
parents: 42833
diff changeset
7043 DEFVAR_BOOL ("w32-enable-synthesized-fonts", &w32_enable_synthesized_fonts,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7044 doc: /* Non-nil enables selection of artificially italicized and bold fonts. */);
42845
ebb3a20bc357 (w32_load_system_font, w32_to_x_charset): Use strnicmp
Jason Rumney <jasonr@gnu.org>
parents: 42833
diff changeset
7045 w32_enable_synthesized_fonts = 0;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
7046
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
7047 DEFVAR_LISP ("w32-enable-palette", &Vw32_enable_palette,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7048 doc: /* Non-nil enables Windows palette management to map colors exactly. */);
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
7049 Vw32_enable_palette = Qt;
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
7050
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
7051 DEFVAR_INT ("w32-mouse-button-tolerance",
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
7052 &w32_mouse_button_tolerance,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7053 doc: /* Analogue of double click interval for faking middle mouse events.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7054 The value is the minimum time in milliseconds that must elapse between
73087
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
7055 left and right button down events before they are considered distinct events.
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7056 If both mouse buttons are depressed within this interval, a middle mouse
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7057 button down event is generated instead. */);
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
7058 w32_mouse_button_tolerance = GetDoubleClickTime () / 2;
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
7059
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
7060 DEFVAR_INT ("w32-mouse-move-interval",
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
7061 &w32_mouse_move_interval,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7062 doc: /* Minimum interval between mouse move events.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7063 The value is the minimum time in milliseconds that must elapse between
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7064 successive mouse move (or scroll bar drag) events before they are
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7065 reported as lisp events. */);
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
7066 w32_mouse_move_interval = 0;
15290
da73440fdb5f (Vwin32_mouse_move_interval): New lisp variable.
Karl Heuer <kwzh@gnu.org>
parents: 15280
diff changeset
7067
42719
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
7068 DEFVAR_BOOL ("w32-pass-extra-mouse-buttons-to-system",
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
7069 &w32_pass_extra_mouse_buttons_to_system,
73087
9ce57eb0c589 (w32-pass-alt-to-system, w32-alt-is-meta)
Eli Zaretskii <eliz@gnu.org>
parents: 72529
diff changeset
7070 doc: /* If non-nil, the fourth and fifth mouse buttons are passed to Windows.
42719
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
7071 Recent versions of Windows support mice with up to five buttons.
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
7072 Since most applications don't support these extra buttons, most mouse
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
7073 drivers will allow you to map them to functions at the system level.
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
7074 If this variable is non-nil, Emacs will pass them on, allowing the
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
7075 system to handle them. */);
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
7076 w32_pass_extra_mouse_buttons_to_system = 0;
70f13c4f82c7 (w32_pass_extra_mouse_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 42537
diff changeset
7077
85979
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7078 DEFVAR_BOOL ("w32-pass-multimedia-buttons-to-system",
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7079 &w32_pass_multimedia_buttons_to_system,
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7080 doc: /* If non-nil, media buttons are passed to Windows.
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7081 Some modern keyboards contain buttons for controlling media players, web
86065
2557aa084b57 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 86053
diff changeset
7082 browsers and other applications. Generally these buttons are handled on a
85979
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7083 system wide basis, but by setting this to nil they are made available
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7084 to Emacs for binding. Depending on your keyboard, additional keys that
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7085 may be available are:
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7086
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7087 browser-back, browser-forward, browser-refresh, browser-stop,
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7088 browser-search, browser-favorites, browser-home,
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7089 mail, mail-reply, mail-forward, mail-send,
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7090 app-1, app-2,
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7091 help, find, new, open, close, save, print, undo, redo, copy, cut, paste,
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7092 spell-check, correction-list, toggle-dictate-command,
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7093 media-next, media-previous, media-stop, media-play-pause, media-select,
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7094 media-play, media-pause, media-record, media-fast-forward, media-rewind,
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7095 media-channel-up, media-channel-down,
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7096 volume-mute, volume-up, volume-down,
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7097 mic-volume-mute, mic-volume-down, mic-volume-up, mic-toggle,
86065
2557aa084b57 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 86053
diff changeset
7098 bass-down, bass-boost, bass-up, treble-down, treble-up */);
85979
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7099 w32_pass_multimedia_buttons_to_system = 1;
bb1f44062552 (w32_pass_multimedia_buttons_to_system): New user option.
Jason Rumney <jasonr@gnu.org>
parents: 85614
diff changeset
7100
100982
7c89b12c3a26 (Vx_pointer_shape, Vx_nontext_pointer_shape)
Jason Rumney <jasonr@gnu.org>
parents: 100951
diff changeset
7101 #if 0 /* TODO: Mouse cursor customization. */
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7102 DEFVAR_LISP ("x-pointer-shape", &Vx_pointer_shape,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7103 doc: /* The shape of the pointer when over text.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7104 Changing the value does not affect existing frames
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7105 unless you set the mouse color. */);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7106 Vx_pointer_shape = Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7107
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7108 Vx_nontext_pointer_shape = Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7109
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7110 Vx_mode_pointer_shape = Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7111
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
7112 DEFVAR_LISP ("x-hourglass-pointer-shape", &Vx_hourglass_pointer_shape,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7113 doc: /* The shape of the pointer when Emacs is busy.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7114 This variable takes effect when you create a new frame
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7115 or when you set the mouse color. */);
36252
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
7116 Vx_hourglass_pointer_shape = Qnil;
a8630c63f7d5 Rename everything containing *busy_cursor* and similar
Gerd Moellmann <gerd@gnu.org>
parents: 36080
diff changeset
7117
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
7118 DEFVAR_LISP ("x-sensitive-text-pointer-shape",
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
7119 &Vx_sensitive_text_pointer_shape,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7120 doc: /* The shape of the pointer when over mouse-sensitive text.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7121 This variable takes effect when you create a new frame
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7122 or when you set the mouse color. */);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7123 Vx_sensitive_text_pointer_shape = Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7124
34133
f1063cc498e4 (Fx_create_frame): Reintroduce the call to face-set-after-frame-defaults.
Jason Rumney <jasonr@gnu.org>
parents: 34089
diff changeset
7125 DEFVAR_LISP ("x-window-horizontal-drag-cursor",
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
7126 &Vx_window_horizontal_drag_shape,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7127 doc: /* Pointer shape to use for indicating a window can be dragged horizontally.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7128 This variable takes effect when you create a new frame
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7129 or when you set the mouse color. */);
34133
f1063cc498e4 (Fx_create_frame): Reintroduce the call to face-set-after-frame-defaults.
Jason Rumney <jasonr@gnu.org>
parents: 34089
diff changeset
7130 Vx_window_horizontal_drag_shape = Qnil;
100982
7c89b12c3a26 (Vx_pointer_shape, Vx_nontext_pointer_shape)
Jason Rumney <jasonr@gnu.org>
parents: 100951
diff changeset
7131 #endif
34133
f1063cc498e4 (Fx_create_frame): Reintroduce the call to face-set-after-frame-defaults.
Jason Rumney <jasonr@gnu.org>
parents: 34089
diff changeset
7132
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7133 DEFVAR_LISP ("x-cursor-fore-pixel", &Vx_cursor_fore_pixel,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7134 doc: /* A string indicating the foreground color of the cursor box. */);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7135 Vx_cursor_fore_pixel = Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7136
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
7137 DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size,
41019
aa792c415dd6 Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 41008
diff changeset
7138 doc: /* Maximum size for tooltips.
109701
2cf388f16cae * w32fns.c (syms_of_w32fns) <x-max-tooltip-size>: Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 109326
diff changeset
7139 Value is a pair (COLUMNS . ROWS). Text larger than this is clipped. */);
40120
03eb905a4d8e (Fx_file_dialog): Pass a filter to GetOpenFileName.
Jason Rumney <jasonr@gnu.org>
parents: 40009
diff changeset
7140 Vx_max_tooltip_size = Fcons (make_number (80), make_number (40));
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
7141
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7142 DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7143 doc: /* Non-nil if no window manager is in use.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7144 Emacs doesn't try to figure this out; this is always nil
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7145 unless you set it to something else. */);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7146 /* We don't have any way to find this out, so set it to nil
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7147 and maybe the user would like to set it to t. */
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7148 Vx_no_window_manager = Qnil;
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7149
23506
246a14f0622f (Vx_pixel_size_width): New global variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23407
diff changeset
7150 DEFVAR_LISP ("x-pixel-size-width-font-regexp",
246a14f0622f (Vx_pixel_size_width): New global variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23407
diff changeset
7151 &Vx_pixel_size_width_font_regexp,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7152 doc: /* Regexp matching a font name whose width is the same as `PIXEL_SIZE'.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7153
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7154 Since Emacs gets width of a font matching with this regexp from
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7155 PIXEL_SIZE field of the name, font finding mechanism gets faster for
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7156 such a font. This is especially effective for such large fonts as
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7157 Chinese, Japanese, and Korean. */);
23506
246a14f0622f (Vx_pixel_size_width): New global variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23407
diff changeset
7158 Vx_pixel_size_width_font_regexp = Qnil;
246a14f0622f (Vx_pixel_size_width): New global variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23407
diff changeset
7159
24147
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
7160 DEFVAR_LISP ("w32-bdf-filename-alist",
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
7161 &Vw32_bdf_filename_alist,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7162 doc: /* List of bdf fonts and their corresponding filenames. */);
24147
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
7163 Vw32_bdf_filename_alist = Qnil;
c83b0bc4e8b9 (Vw32_bdf_filename_alist): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24130
diff changeset
7164
24481
f65692fe7dd5 (w32_strict_fontnames): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24479
diff changeset
7165 DEFVAR_BOOL ("w32-strict-fontnames",
f65692fe7dd5 (w32_strict_fontnames): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24479
diff changeset
7166 &w32_strict_fontnames,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7167 doc: /* Non-nil means only use fonts that are exact matches for those requested.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7168 Default is nil, which allows old fontnames that are not XLFD compliant,
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7169 and allows third-party CJK display to work by specifying false charset
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7170 fields to trick Emacs into translating to Big5, SJIS etc.
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7171 Setting this to t will prevent wrong fonts being selected when
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7172 fontsets are automatically created. */);
24481
f65692fe7dd5 (w32_strict_fontnames): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24479
diff changeset
7173 w32_strict_fontnames = 0;
f65692fe7dd5 (w32_strict_fontnames): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 24479
diff changeset
7174
24695
2fe2c743ce68 (w32_strict_painting): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24692
diff changeset
7175 DEFVAR_BOOL ("w32-strict-painting",
2fe2c743ce68 (w32_strict_painting): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24692
diff changeset
7176 &w32_strict_painting,
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7177 doc: /* Non-nil means use strict rules for repainting frames.
63279
091ece2ed577 (syms_of_w32fns): Fix spellings.
Juanma Barranquero <lekktu@gmail.com>
parents: 59333
diff changeset
7178 Set this to nil to get the old behavior for repainting; this should
40964
fb970d0c56eb Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents: 40873
diff changeset
7179 only be necessary if the default setting causes problems. */);
24695
2fe2c743ce68 (w32_strict_painting): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24692
diff changeset
7180 w32_strict_painting = 1;
2fe2c743ce68 (w32_strict_painting): New variable.
Andrew Innes <andrewi@gnu.org>
parents: 24692
diff changeset
7181
33387
01a10bc04233 (Qw32_charset_hangeul): Rename to match w32 headers.
Jason Rumney <jasonr@gnu.org>
parents: 33216
diff changeset
7182 #if 0 /* TODO: Port to W32 */
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
7183 defsubr (&Sx_change_window_property);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
7184 defsubr (&Sx_delete_window_property);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
7185 defsubr (&Sx_window_property);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
7186 #endif
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 25646
diff changeset
7187 defsubr (&Sxw_display_color_p);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7188 defsubr (&Sx_display_grayscale_p);
26729
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 25646
diff changeset
7189 defsubr (&Sxw_color_defined_p);
f5dded41adcc Changes for automatic remapping of X colors on terminal frames:
Eli Zaretskii <eliz@gnu.org>
parents: 25646
diff changeset
7190 defsubr (&Sxw_color_values);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7191 defsubr (&Sx_server_max_request_size);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7192 defsubr (&Sx_server_vendor);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7193 defsubr (&Sx_server_version);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7194 defsubr (&Sx_display_pixel_width);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7195 defsubr (&Sx_display_pixel_height);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7196 defsubr (&Sx_display_mm_width);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7197 defsubr (&Sx_display_mm_height);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7198 defsubr (&Sx_display_screens);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7199 defsubr (&Sx_display_planes);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7200 defsubr (&Sx_display_color_cells);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7201 defsubr (&Sx_display_visual_class);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7202 defsubr (&Sx_display_backing_store);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7203 defsubr (&Sx_display_save_under);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7204 defsubr (&Sx_create_frame);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7205 defsubr (&Sx_open_connection);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7206 defsubr (&Sx_close_connection);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7207 defsubr (&Sx_display_list);
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7208 defsubr (&Sx_synchronize);
84630
4197a953442f (Fx_focus_frame): Rename from Fw32_focus_frame.
Jason Rumney <jasonr@gnu.org>
parents: 83878
diff changeset
7209 defsubr (&Sx_focus_frame);
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7210
16588
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
7211 /* W32 specific functions */
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
7212
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
7213 defsubr (&Sw32_define_rgb_color);
481b7874a1e9 Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents: 16259
diff changeset
7214 defsubr (&Sw32_default_color_map);
19707
0181cc080316 Include limits.h and errno.h.
Geoff Voelker <voelker@cs.washington.edu>
parents: 18508
diff changeset
7215 defsubr (&Sw32_send_sys_command);
24670
045e247575d9 [andrewi]
Andrew Innes <andrewi@gnu.org>
parents: 24583
diff changeset
7216 defsubr (&Sw32_shell_execute);
23681
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7217 defsubr (&Sw32_register_hot_key);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7218 defsubr (&Sw32_unregister_hot_key);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7219 defsubr (&Sw32_registered_hot_keys);
af0276da2059 (Vw32_pass_optional_keys_to_system): Variable removed.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23637
diff changeset
7220 defsubr (&Sw32_reconstruct_hot_key);
23803
f112aa8f8f5d (Vw32_phantom_key_code): New variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23801
diff changeset
7221 defsubr (&Sw32_toggle_lock_key);
74661
0b62ec4c4929 (w32-window-exists-p): New function.
Eli Zaretskii <eliz@gnu.org>
parents: 74618
diff changeset
7222 defsubr (&Sw32_window_exists_p);
94447
45acd5e62f88 (Fw32_battery_status): New defun.
Jason Rumney <jasonr@gnu.org>
parents: 94432
diff changeset
7223 defsubr (&Sw32_battery_status);
23506
246a14f0622f (Vx_pixel_size_width): New global variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23407
diff changeset
7224
34643
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
7225 defsubr (&Sfile_system_info);
53739
5456cd83c404 * makefile.w32-in, w32fns.c: Add `default-printer-name' function.
Jason Rumney <jasonr@gnu.org>
parents: 53332
diff changeset
7226 defsubr (&Sdefault_printer_name);
34643
7108531c744b (Ffile_system_info): New function.
Andrew Innes <andrewi@gnu.org>
parents: 34638
diff changeset
7227
23506
246a14f0622f (Vx_pixel_size_width): New global variable.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23407
diff changeset
7228 check_window_system_func = check_w32;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
7229
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
7230
93075
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
7231 hourglass_timer = 0;
66248fc5b523 * w32fns.c (hourglass_timer, hourglass_hwnd): New variables.
Jason Rumney <jasonr@gnu.org>
parents: 92940
diff changeset
7232 hourglass_hwnd = NULL;
96664
b306a69b9d7f applying patch to consolidate non-GUI portion of hourglass implementation as posted at http://thread.gmane.org/gmane.emacs.devel/98341
Adrian Robert <Adrian.B.Robert@gmail.com>
parents: 96662
diff changeset
7233
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
7234 defsubr (&Sx_show_tip);
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
7235 defsubr (&Sx_hide_tip);
34729
3dc60d80125f (syms_of_w32fns): Initialize and staticpro tip_frame.
Jason Rumney <jasonr@gnu.org>
parents: 34698
diff changeset
7236 tip_timer = Qnil;
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
7237 staticpro (&tip_timer);
34729
3dc60d80125f (syms_of_w32fns): Initialize and staticpro tip_frame.
Jason Rumney <jasonr@gnu.org>
parents: 34698
diff changeset
7238 tip_frame = Qnil;
3dc60d80125f (syms_of_w32fns): Initialize and staticpro tip_frame.
Jason Rumney <jasonr@gnu.org>
parents: 34698
diff changeset
7239 staticpro (&tip_frame);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
7240
41380
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
7241 last_show_tip_args = Qnil;
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
7242 staticpro (&last_show_tip_args);
aff1b15f295b (x_window_to_frame): Remove irrelevant TODO comment.
Jason Rumney <jasonr@gnu.org>
parents: 41322
diff changeset
7243
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
7244 defsubr (&Sx_file_dialog);
96489
b76b9628d74f Changes from Toru Tsuneyoshi for using Trash can when deleting files.
Jason Rumney <jasonr@gnu.org>
parents: 96403
diff changeset
7245 defsubr (&Ssystem_move_file_to_trash);
27397
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
7246 }
d98e84b468a2 Substantial rewrite for new redisplay. Major changes:
Jason Rumney <jasonr@gnu.org>
parents: 26729
diff changeset
7247
49494
07f0ea120d7d (init_external_image_libraries): Try alternate names for the jpeg dll.
Juanma Barranquero <lekktu@gmail.com>
parents: 49455
diff changeset
7248
48888
f0df5f687c15 Revisited my earlier fix for the following entry in etc/PROBLEMS: 'Emacs built on Windows 9x/ME crashes at startup on Windows XP, or Emacs builtpart of on XP crashes at startup on Windows 9x/ME.' Fixed several Windows API errors detected by BoundsChecker
Ben Key <bkey1@tampabay.rr.com>
parents: 48483
diff changeset
7249 /*
f0df5f687c15 Revisited my earlier fix for the following entry in etc/PROBLEMS: 'Emacs built on Windows 9x/ME crashes at startup on Windows XP, or Emacs builtpart of on XP crashes at startup on Windows 9x/ME.' Fixed several Windows API errors detected by BoundsChecker
Ben Key <bkey1@tampabay.rr.com>
parents: 48483
diff changeset
7250 globals_of_w32fns is used to initialize those global variables that
f0df5f687c15 Revisited my earlier fix for the following entry in etc/PROBLEMS: 'Emacs built on Windows 9x/ME crashes at startup on Windows XP, or Emacs builtpart of on XP crashes at startup on Windows 9x/ME.' Fixed several Windows API errors detected by BoundsChecker
Ben Key <bkey1@tampabay.rr.com>
parents: 48483
diff changeset
7251 must always be initialized on startup even when the global variable
f0df5f687c15 Revisited my earlier fix for the following entry in etc/PROBLEMS: 'Emacs built on Windows 9x/ME crashes at startup on Windows XP, or Emacs builtpart of on XP crashes at startup on Windows 9x/ME.' Fixed several Windows API errors detected by BoundsChecker
Ben Key <bkey1@tampabay.rr.com>
parents: 48483
diff changeset
7252 initialized is non zero (see the function main in emacs.c).
f0df5f687c15 Revisited my earlier fix for the following entry in etc/PROBLEMS: 'Emacs built on Windows 9x/ME crashes at startup on Windows XP, or Emacs builtpart of on XP crashes at startup on Windows 9x/ME.' Fixed several Windows API errors detected by BoundsChecker
Ben Key <bkey1@tampabay.rr.com>
parents: 48483
diff changeset
7253 globals_of_w32fns is called from syms_of_w32fns when the global
f0df5f687c15 Revisited my earlier fix for the following entry in etc/PROBLEMS: 'Emacs built on Windows 9x/ME crashes at startup on Windows XP, or Emacs builtpart of on XP crashes at startup on Windows 9x/ME.' Fixed several Windows API errors detected by BoundsChecker
Ben Key <bkey1@tampabay.rr.com>
parents: 48483
diff changeset
7254 variable initialized is 0 and directly from main when initialized
f0df5f687c15 Revisited my earlier fix for the following entry in etc/PROBLEMS: 'Emacs built on Windows 9x/ME crashes at startup on Windows XP, or Emacs builtpart of on XP crashes at startup on Windows 9x/ME.' Fixed several Windows API errors detected by BoundsChecker
Ben Key <bkey1@tampabay.rr.com>
parents: 48483
diff changeset
7255 is non zero.
f0df5f687c15 Revisited my earlier fix for the following entry in etc/PROBLEMS: 'Emacs built on Windows 9x/ME crashes at startup on Windows XP, or Emacs builtpart of on XP crashes at startup on Windows 9x/ME.' Fixed several Windows API errors detected by BoundsChecker
Ben Key <bkey1@tampabay.rr.com>
parents: 48483
diff changeset
7256 */
79387
0ca197abc593 (Fw32_registered_hot_keys): Don't return the nil values corresponding
Juanma Barranquero <lekktu@gmail.com>
parents: 79381
diff changeset
7257 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
7258 globals_of_w32fns (void)
48888
f0df5f687c15 Revisited my earlier fix for the following entry in etc/PROBLEMS: 'Emacs built on Windows 9x/ME crashes at startup on Windows XP, or Emacs builtpart of on XP crashes at startup on Windows 9x/ME.' Fixed several Windows API errors detected by BoundsChecker
Ben Key <bkey1@tampabay.rr.com>
parents: 48483
diff changeset
7259 {
f0df5f687c15 Revisited my earlier fix for the following entry in etc/PROBLEMS: 'Emacs built on Windows 9x/ME crashes at startup on Windows XP, or Emacs builtpart of on XP crashes at startup on Windows 9x/ME.' Fixed several Windows API errors detected by BoundsChecker
Ben Key <bkey1@tampabay.rr.com>
parents: 48483
diff changeset
7260 HMODULE user32_lib = GetModuleHandle ("user32.dll");
51776
6a03280c654a (clipboard_sequence_fn): New variable.
Jason Rumney <jasonr@gnu.org>
parents: 51763
diff changeset
7261 /*
6a03280c654a (clipboard_sequence_fn): New variable.
Jason Rumney <jasonr@gnu.org>
parents: 51763
diff changeset
7262 TrackMouseEvent not available in all versions of Windows, so must load
6a03280c654a (clipboard_sequence_fn): New variable.
Jason Rumney <jasonr@gnu.org>
parents: 51763
diff changeset
7263 it dynamically. Do it once, here, instead of every time it is used.
48888
f0df5f687c15 Revisited my earlier fix for the following entry in etc/PROBLEMS: 'Emacs built on Windows 9x/ME crashes at startup on Windows XP, or Emacs builtpart of on XP crashes at startup on Windows 9x/ME.' Fixed several Windows API errors detected by BoundsChecker
Ben Key <bkey1@tampabay.rr.com>
parents: 48483
diff changeset
7264 */
51776
6a03280c654a (clipboard_sequence_fn): New variable.
Jason Rumney <jasonr@gnu.org>
parents: 51763
diff changeset
7265 track_mouse_event_fn = (TrackMouseEvent_Proc)
6a03280c654a (clipboard_sequence_fn): New variable.
Jason Rumney <jasonr@gnu.org>
parents: 51763
diff changeset
7266 GetProcAddress (user32_lib, "TrackMouseEvent");
92935
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
7267
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
7268 monitor_from_point_fn = (MonitorFromPoint_Proc)
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
7269 GetProcAddress (user32_lib, "MonitorFromPoint");
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
7270 get_monitor_info_fn = (GetMonitorInfo_Proc)
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
7271 GetProcAddress (user32_lib, "GetMonitorInfoA");
c99b62a964c4 (MONITOR_DEFAULT_TO_NEAREST, struct MONITOR_INFO)
Jason Rumney <jasonr@gnu.org>
parents: 92362
diff changeset
7272
91099
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
7273 {
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
7274 HMODULE imm32_lib = GetModuleHandle ("imm32.dll");
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
7275 get_composition_string_fn = (ImmGetCompositionString_Proc)
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
7276 GetProcAddress (imm32_lib, "ImmGetCompositionStringW");
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
7277 get_ime_context_fn = (ImmGetContext_Proc)
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
7278 GetProcAddress (imm32_lib, "ImmGetContext");
104030
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
7279 release_ime_context_fn = (ImmReleaseContext_Proc)
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
7280 GetProcAddress (imm32_lib, "ImmReleaseContext");
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
7281 set_ime_composition_window_fn = (ImmSetCompositionWindow_Proc)
91b945d54645 * w32fns.c (w32_wnd_proc) [WM_IME_STARTCOMPOSITION]: Position
Jason Rumney <jasonr@gnu.org>
parents: 103674
diff changeset
7282 GetProcAddress (imm32_lib, "ImmSetCompositionWindow");
91099
8bbec66c0718 Include imm.h.
Jason Rumney <jasonr@gnu.org>
parents: 91085
diff changeset
7283 }
55468
f13a7f45ce0f (Vw32_ansi_code_page): New Lisp variable.
Jason Rumney <jasonr@gnu.org>
parents: 54336
diff changeset
7284 DEFVAR_INT ("w32-ansi-code-page",
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
7285 &w32_ansi_code_page,
55468
f13a7f45ce0f (Vw32_ansi_code_page): New Lisp variable.
Jason Rumney <jasonr@gnu.org>
parents: 54336
diff changeset
7286 doc: /* The ANSI code page used by the system. */);
55656
29b250a07fe0 (Fw32_register_hot_key, Fw32_unregister_hot_key)
Jason Rumney <jasonr@gnu.org>
parents: 55592
diff changeset
7287 w32_ansi_code_page = GetACP ();
78907
90bd4f87874a (globals_of_w32fns): Init common controls.
Jason Rumney <jasonr@gnu.org>
parents: 78260
diff changeset
7288
90bd4f87874a (globals_of_w32fns): Init common controls.
Jason Rumney <jasonr@gnu.org>
parents: 78260
diff changeset
7289 /* MessageBox does not work without this when linked to comctl32.dll 6.0. */
90bd4f87874a (globals_of_w32fns): Init common controls.
Jason Rumney <jasonr@gnu.org>
parents: 78260
diff changeset
7290 InitCommonControls ();
93599
a67af10a545c (uniscribe_font_driver) [WINDOWSNT]: Declare for w32fns.c.
Jason Rumney <jasonr@gnu.org>
parents: 93319
diff changeset
7291
a67af10a545c (uniscribe_font_driver) [WINDOWSNT]: Declare for w32fns.c.
Jason Rumney <jasonr@gnu.org>
parents: 93319
diff changeset
7292 syms_of_w32uniscribe ();
48888
f0df5f687c15 Revisited my earlier fix for the following entry in etc/PROBLEMS: 'Emacs built on Windows 9x/ME crashes at startup on Windows XP, or Emacs builtpart of on XP crashes at startup on Windows 9x/ME.' Fixed several Windows API errors detected by BoundsChecker
Ben Key <bkey1@tampabay.rr.com>
parents: 48483
diff changeset
7293 }
f0df5f687c15 Revisited my earlier fix for the following entry in etc/PROBLEMS: 'Emacs built on Windows 9x/ME crashes at startup on Windows XP, or Emacs builtpart of on XP crashes at startup on Windows 9x/ME.' Fixed several Windows API errors detected by BoundsChecker
Ben Key <bkey1@tampabay.rr.com>
parents: 48483
diff changeset
7294
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7295 #undef abort
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7296
47942
080b4586492b Fix typo in comment.
Juanma Barranquero <lekktu@gmail.com>
parents: 47731
diff changeset
7297 void
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
7298 w32_abort (void)
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7299 {
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
7300 int button;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
7301 button = MessageBox (NULL,
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
7302 "A fatal error has occurred!\n\n"
63340
1cd9a44aa129 (w32_abort): Use the MB_YESNO dialog instead of
Eli Zaretskii <eliz@gnu.org>
parents: 63297
diff changeset
7303 "Would you like to attach a debugger?\n\n"
67438
2e919998931e (w32_abort) [__GNUC__]: Add instructions for attaching GDB to the abort dialog.
Eli Zaretskii <eliz@gnu.org>
parents: 67269
diff changeset
7304 "Select YES to debug, NO to abort Emacs"
2e919998931e (w32_abort) [__GNUC__]: Add instructions for attaching GDB to the abort dialog.
Eli Zaretskii <eliz@gnu.org>
parents: 67269
diff changeset
7305 #if __GNUC__
2e919998931e (w32_abort) [__GNUC__]: Add instructions for attaching GDB to the abort dialog.
Eli Zaretskii <eliz@gnu.org>
parents: 67269
diff changeset
7306 "\n\n(type \"gdb -p <emacs-PID>\" and\n"
2e919998931e (w32_abort) [__GNUC__]: Add instructions for attaching GDB to the abort dialog.
Eli Zaretskii <eliz@gnu.org>
parents: 67269
diff changeset
7307 "\"continue\" inside GDB before clicking YES.)"
2e919998931e (w32_abort) [__GNUC__]: Add instructions for attaching GDB to the abort dialog.
Eli Zaretskii <eliz@gnu.org>
parents: 67269
diff changeset
7308 #endif
2e919998931e (w32_abort) [__GNUC__]: Add instructions for attaching GDB to the abort dialog.
Eli Zaretskii <eliz@gnu.org>
parents: 67269
diff changeset
7309 , "Emacs Abort Dialog",
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
7310 MB_ICONEXCLAMATION | MB_TASKMODAL
63340
1cd9a44aa129 (w32_abort): Use the MB_YESNO dialog instead of
Eli Zaretskii <eliz@gnu.org>
parents: 63297
diff changeset
7311 | MB_SETFOREGROUND | MB_YESNO);
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
7312 switch (button)
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
7313 {
63340
1cd9a44aa129 (w32_abort): Use the MB_YESNO dialog instead of
Eli Zaretskii <eliz@gnu.org>
parents: 63297
diff changeset
7314 case IDYES:
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
7315 DebugBreak ();
63340
1cd9a44aa129 (w32_abort): Use the MB_YESNO dialog instead of
Eli Zaretskii <eliz@gnu.org>
parents: 63297
diff changeset
7316 exit (2); /* tell the compiler we will never return */
1cd9a44aa129 (w32_abort): Use the MB_YESNO dialog instead of
Eli Zaretskii <eliz@gnu.org>
parents: 63297
diff changeset
7317 case IDNO:
15147
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
7318 default:
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
7319 abort ();
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
7320 break;
38c0ce06203f (quit_char, Vwin32_enable_italics, Vwin32_enable_palette):
Geoff Voelker <voelker@cs.washington.edu>
parents: 15034
diff changeset
7321 }
13434
53ba95a88cf2 Initial revision
Geoff Voelker <voelker@cs.washington.edu>
parents:
diff changeset
7322 }
15148
220145cf7546 (continuation of previous checkin)
Geoff Voelker <voelker@cs.washington.edu>
parents: 15147
diff changeset
7323
23801
119fd94ae526 (w32_last_error): Fix cut+paste error.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23681
diff changeset
7324 /* For convenience when debugging. */
119fd94ae526 (w32_last_error): Fix cut+paste error.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23681
diff changeset
7325 int
109152
e27859da5624 src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents: 109100
diff changeset
7326 w32_last_error (void)
23801
119fd94ae526 (w32_last_error): Fix cut+paste error.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23681
diff changeset
7327 {
119fd94ae526 (w32_last_error): Fix cut+paste error.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23681
diff changeset
7328 return GetLastError ();
119fd94ae526 (w32_last_error): Fix cut+paste error.
Geoff Voelker <voelker@cs.washington.edu>
parents: 23681
diff changeset
7329 }
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 52351
diff changeset
7330