annotate src/event-msw.h @ 234:946e7f6ce379

Added tag r20-5b15 for changeset 52952cbfc5b5
author cvs
date Mon, 13 Aug 2007 10:14:17 +0200
parents 52952cbfc5b5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1 /* mswindows-specific defines for event-handling.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
2 Copyright (C) 1997 Jonathan Harris.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
3
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
4 This file is part of XEmacs.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
5
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
9 later version.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
10
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
14 for more details.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
15
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
20
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
21 /* Synched up with: Not in FSF. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
22
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
23 /* Authorship:
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
24
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
25 Jonathan Harris, November 1997 for 20.4.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
26 */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
27
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
28 #ifndef _XEMACS_EVENT_MSW_H_
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
29 #define _XEMACS_EVENT_MSW_H_
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
30
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
31 #include <windows.h>
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
32
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
33 /*
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
34 * XXX FIXME: The following X modifier defs in events-mod.h clash with win32
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
35 * hotkey defs in winuser.h. For the moment lose the win32 versions.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
36 * Maybe we should rename all of MOD_* to something that doesn't clash.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
37 */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
38 #ifdef MOD_CONTROL
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
39 # undef MOD_CONTROL
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
40 #endif
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
41 #ifdef MOD_ALT
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
42 # undef MOD_ALT
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
43 #endif
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
44 #ifdef MOD_SHIFT
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
45 # undef MOD_SHIFT
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
46 #endif
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
47 #include "events-mod.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
48
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
49 /* The name of the main window class */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
50 #define XEMACS_CLASS "XEmacs"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
51
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 213
diff changeset
52 /* Granularity of timeouts in milliseconds & max number of active timeouts */
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 213
diff changeset
53 #define MSW_TIMEOUT_GRANULARITY 25
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 213
diff changeset
54 #define MSW_TIMEOUT_MAX 32
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 213
diff changeset
55
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
56 /* Random globals */
231
557eaa0339bf Import from CVS: tag r20-5b14
cvs
parents: 227
diff changeset
57 LRESULT WINAPI mswindows_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
557eaa0339bf Import from CVS: tag r20-5b14
cvs
parents: 227
diff changeset
58 Lisp_Object mswindows_pump_outstanding_events (void);
557eaa0339bf Import from CVS: tag r20-5b14
cvs
parents: 227
diff changeset
59 Lisp_Object mswindows_protect_modal_loop (Lisp_Object (*bfun) (Lisp_Object barg),
557eaa0339bf Import from CVS: tag r20-5b14
cvs
parents: 227
diff changeset
60 Lisp_Object barg);
557eaa0339bf Import from CVS: tag r20-5b14
cvs
parents: 227
diff changeset
61 void mswindows_unmodalize_signal_maybe (void);
557eaa0339bf Import from CVS: tag r20-5b14
cvs
parents: 227
diff changeset
62 void mswindows_enqueue_dispatch_event (Lisp_Object event);
233
52952cbfc5b5 Import from CVS: tag r20-5b15
cvs
parents: 231
diff changeset
63 void mswindows_enqueue_magic_event (HWND hwnd, UINT message);
231
557eaa0339bf Import from CVS: tag r20-5b14
cvs
parents: 227
diff changeset
64
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
65 extern int mswindows_quit_chars_count;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
66
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
67 /* These are Lisp integer variables */
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
68 /* Jonsthan, these need not to be globals after merge -- kkm */
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
69 extern int mswindows_dynamic_frame_resize;
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
70 extern int mswindows_num_mouse_buttons;
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
71 extern int mswindows_button2_max_skew_x;
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
72 extern int mswindows_button2_max_skew_y;
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
73 extern int mswindows_button2_chord_time;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
74
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
75 /*
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
76 * Event generating stuff
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
77 */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
78
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
79 /* The number of things we can wait on */
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
80 #define MAX_WAITABLE (MAXIMUM_WAIT_OBJECTS - 1)
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
81
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
82 typedef enum mswindows_waitable_type
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
83 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
84 mswindows_waitable_type_none,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
85 mswindows_waitable_type_dispatch,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
86 mswindows_waitable_type_timeout,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
87 mswindows_waitable_type_process,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
88 mswindows_waitable_type_socket
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
89 } mswindows_waitable_type;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
90
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
91 typedef struct mswindows_timeout_data
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
92 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
93 int milliseconds;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
94 int id;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
95 } mswindows_timeout_data;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
96
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
97 typedef struct mswindows_waitable_info_type
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
98 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
99 mswindows_waitable_type type;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
100 union
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
101 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
102 mswindows_timeout_data timeout;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
103 } data;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
104 } mswindows_waitable_info_type;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
105
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
106 mswindows_waitable_info_type *mswindows_add_waitable(mswindows_waitable_info_type *info);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
107 void mswindows_remove_waitable(mswindows_waitable_info_type *info);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
108
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
109 /*
219
262b8bb4a523 Import from CVS: tag r20-4b8
cvs
parents: 213
diff changeset
110 * Some random function declarations in msw-proc.c
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
111 */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
112 extern void mswindows_enqeue_dispatch_event (Lisp_Object event);
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
113 Lisp_Object mswindows_cancel_dispatch_event (struct Lisp_Event* event);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
114
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
115 /*
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
116 * Inside mswindows magic events
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
117 */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
118 #define EVENT_MSWINDOWS_MAGIC_EVENT(e) \
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
119 ((e)->event.magic.underlying_mswindows_event)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
120 #define EVENT_MSWINDOWS_MAGIC_TYPE(e) \
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
121 (EVENT_MSWINDOWS_MAGIC_EVENT(e).message)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
122 #define EVENT_MSWINDOWS_MAGIC_DATA(e) \
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
123 (*((RECT *) (&(EVENT_MSWINDOWS_MAGIC_EVENT(e).data))))
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
124
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
125 /*
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
126 * Messages and magic events IDs
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
127 */
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
128 #define XM_BUMPQUEUE (WM_USER + 101)
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
129 #define XM_MAPFRAME (WM_USER + 102)
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
130 #define XM_UNMAPFRAME (WM_USER + 103)
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
131
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
132 /*
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
133 * Window LONGs indices
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
134 */
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
135 #define XWL_FRAMEOBJ 0
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
136
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
137 /* This must be number of the above long multiplied by 4 */
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
138 #define MSWINDOWS_WINDOW_EXTRA_BYTES 4
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
139
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
140 /* Fake key modifiers which attached to a quit char event.
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
141 Removed upon dequeueing an event */
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 219
diff changeset
142 #define FAKE_MOD_QUIT 0x80
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
143
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
144 #endif /* _XEMACS_EVENT_MSW_H_ */