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