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
|
|
52 /* Random globals shared between main and message-processing thread */
|
|
53 extern DWORD mswindows_main_thread_id;
|
|
54 extern DWORD mswindows_win_thread_id;
|
|
55 extern CRITICAL_SECTION mswindows_dispatch_crit;
|
|
56
|
|
57
|
|
58 /*
|
|
59 * Communication between main and windows thread
|
|
60 */
|
|
61 #define WM_XEMACS_BASE (WM_APP + 0)
|
|
62 #define WM_XEMACS_ACK (WM_XEMACS_BASE + 0x00)
|
|
63 #define WM_XEMACS_CREATEWINDOW (WM_XEMACS_BASE + 0x01)
|
|
64 #define WM_XEMACS_SETTIMER (WM_XEMACS_BASE + 0x02)
|
|
65 #define WM_XEMACS_KILLTIMER (WM_XEMACS_BASE + 0x03)
|
|
66 #define WM_XEMACS_END (WM_XEMACS_BASE + 0x10)
|
|
67
|
|
68 typedef struct mswindows_request_type
|
|
69 {
|
|
70 void *thing1;
|
|
71 void *thing2;
|
|
72 } mswindows_request_type;
|
|
73
|
|
74 LPARAM mswindows_make_request(UINT message, WPARAM wParam, mswindows_request_type *request);
|
|
75 void mswindows_handle_request(MSG *msg);
|
|
76
|
|
77
|
|
78 /*
|
|
79 * Event generating stuff
|
|
80 */
|
|
81
|
|
82 /* The number of things we can wait on */
|
|
83 #define MAX_WAITABLE 256
|
|
84
|
|
85 typedef enum mswindows_waitable_type
|
|
86 {
|
|
87 mswindows_waitable_type_none,
|
|
88 mswindows_waitable_type_dispatch,
|
|
89 mswindows_waitable_type_timeout,
|
|
90 mswindows_waitable_type_process,
|
|
91 mswindows_waitable_type_socket
|
|
92 } mswindows_waitable_type;
|
|
93
|
|
94 typedef struct mswindows_timeout_data
|
|
95 {
|
|
96 int milliseconds;
|
|
97 int id;
|
|
98 } mswindows_timeout_data;
|
|
99
|
|
100 typedef struct mswindows_waitable_info_type
|
|
101 {
|
|
102 mswindows_waitable_type type;
|
|
103 union
|
|
104 {
|
|
105 mswindows_timeout_data timeout;
|
|
106 } data;
|
|
107 } mswindows_waitable_info_type;
|
|
108
|
|
109 mswindows_waitable_info_type *mswindows_add_waitable(mswindows_waitable_info_type *info);
|
|
110 void mswindows_remove_waitable(mswindows_waitable_info_type *info);
|
|
111
|
|
112 /*
|
|
113 * Some random function declarations in mswindows-proc.c
|
|
114 */
|
|
115 DWORD mswindows_win_thread();
|
|
116 extern void mswindows_enqeue_dispatch_event (Lisp_Object event);
|
|
117
|
|
118
|
|
119 /*
|
|
120 * Inside mswindows magic events
|
|
121 */
|
|
122 #define EVENT_MSWINDOWS_MAGIC_EVENT(e) \
|
|
123 ((e)->event.magic.underlying_mswindows_event)
|
|
124 #define EVENT_MSWINDOWS_MAGIC_TYPE(e) \
|
|
125 (EVENT_MSWINDOWS_MAGIC_EVENT(e).message)
|
|
126 #define EVENT_MSWINDOWS_MAGIC_DATA(e) \
|
|
127 (*((RECT *) (&(EVENT_MSWINDOWS_MAGIC_EVENT(e).data))))
|
|
128
|
|
129
|
|
130 #endif /* _XEMACS_EVENT_MSW_H_ */
|