249
|
1 /* Define mswindows-specific console, device, and frame object for XEmacs.
|
213
|
2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
|
3 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
|
|
4
|
|
5 This file is part of XEmacs.
|
|
6
|
|
7 XEmacs is free software; you can redistribute it and/or modify it
|
|
8 under the terms of the GNU General Public License as published by the
|
|
9 Free Software Foundation; either version 2, or (at your option) any
|
|
10 later version.
|
|
11
|
|
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
15 for more details.
|
|
16
|
|
17 You should have received a copy of the GNU General Public License
|
|
18 along with XEmacs; see the file COPYING. If not, write to
|
|
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
20 Boston, MA 02111-1307, USA. */
|
|
21
|
|
22 /* Synched up with: Not in FSF. */
|
|
23
|
|
24
|
|
25 /* Authorship:
|
|
26
|
|
27 Ultimately based on FSF, then later on JWZ work for Lemacs.
|
|
28 Rewritten over time by Ben Wing and Chuck Thompson.
|
|
29 Rewritten for mswindows by Jonathan Harris, November 1997 for 20.4.
|
|
30 */
|
|
31
|
|
32 #ifndef _XEMACS_CONSOLE_MSW_H_
|
|
33 #define _XEMACS_CONSOLE_MSW_H_
|
|
34
|
|
35 #include "console.h"
|
|
36
|
|
37 #include "windows.h"
|
249
|
38 #include "ddeml.h" /* DDE management library */
|
|
39 #include "shellapi.h" /* FileManager/Explorer drag and drop */
|
|
40
|
|
41 /*
|
|
42 * XXX FIXME: The following X modifier defs in events-mod.h clash with win32
|
|
43 * hotkey defs in winuser.h. For the moment lose the win32 versions.
|
|
44 * Maybe we should rename all of MOD_* to something that doesn't clash.
|
|
45 */
|
|
46 #ifdef MOD_CONTROL
|
|
47 # undef MOD_CONTROL
|
|
48 #endif
|
|
49 #ifdef MOD_ALT
|
|
50 # undef MOD_ALT
|
|
51 #endif
|
|
52 #ifdef MOD_SHIFT
|
|
53 # undef MOD_SHIFT
|
|
54 #endif
|
|
55
|
|
56
|
|
57 /* The name of the main window class */
|
|
58 #define XEMACS_CLASS "XEmacs"
|
|
59
|
|
60
|
|
61 /*
|
|
62 * Console
|
|
63 */
|
213
|
64
|
|
65 DECLARE_CONSOLE_TYPE (mswindows);
|
|
66
|
|
67 struct mswindows_console
|
|
68 {
|
|
69 int infd, outfd;
|
|
70 };
|
|
71
|
|
72
|
249
|
73 /*
|
|
74 * Device
|
|
75 */
|
|
76
|
213
|
77 struct mswindows_device
|
|
78 {
|
|
79 int logpixelsx, logpixelsy;
|
|
80 int planes, cells;
|
|
81 int horzres, vertres; /* Size in pixels */
|
|
82 int horzsize, vertsize; /* Size in mm */
|
|
83 };
|
|
84
|
|
85 #define DEVICE_MSWINDOWS_DATA(d) DEVICE_TYPE_DATA (d, mswindows)
|
|
86 #define DEVICE_MSWINDOWS_LOGPIXELSX(d) (DEVICE_MSWINDOWS_DATA (d)->logpixelsx)
|
|
87 #define DEVICE_MSWINDOWS_LOGPIXELSY(d) (DEVICE_MSWINDOWS_DATA (d)->logpixelsy)
|
|
88 #define DEVICE_MSWINDOWS_PLANES(d) (DEVICE_MSWINDOWS_DATA (d)->planes)
|
|
89 #define DEVICE_MSWINDOWS_CELLS(d) (DEVICE_MSWINDOWS_DATA (d)->cells)
|
|
90 #define DEVICE_MSWINDOWS_HORZRES(d) (DEVICE_MSWINDOWS_DATA (d)->horzres)
|
|
91 #define DEVICE_MSWINDOWS_VERTRES(d) (DEVICE_MSWINDOWS_DATA (d)->vertres)
|
|
92 #define DEVICE_MSWINDOWS_HORZSIZE(d) (DEVICE_MSWINDOWS_DATA (d)->horzsize)
|
|
93 #define DEVICE_MSWINDOWS_VERTSIZE(d) (DEVICE_MSWINDOWS_DATA (d)->vertsize)
|
|
94
|
|
95
|
249
|
96 /*
|
|
97 * Frame
|
|
98 */
|
|
99
|
213
|
100 struct mswindows_frame
|
|
101 {
|
|
102 /* win32 window handle */
|
|
103 HWND hwnd;
|
|
104
|
|
105 /* DC for this win32 window */
|
|
106 HDC hdc;
|
223
|
107
|
|
108 /* Time of last click event, for button 2 emul */
|
|
109 DWORD last_click_time;
|
|
110
|
|
111 /* Coordinates of last click event, screen-relative */
|
|
112 POINTS last_click_point;
|
|
113
|
233
|
114 /* Menu hashtable. See menubar-msw.c */
|
|
115 Lisp_Object menu_hashtable;
|
|
116
|
|
117 /* Menu checksum. See menubar-msw.c */
|
|
118 unsigned int menu_checksum;
|
231
|
119
|
223
|
120 /* Misc flags */
|
|
121 int button2_need_lbutton : 1;
|
|
122 int button2_need_rbutton : 1;
|
|
123 int button2_is_down : 1;
|
|
124 int ignore_next_lbutton_up : 1;
|
|
125 int ignore_next_rbutton_up : 1;
|
|
126 int sizing : 1;
|
213
|
127 };
|
|
128
|
|
129 #define FRAME_MSWINDOWS_DATA(f) FRAME_TYPE_DATA (f, mswindows)
|
|
130
|
233
|
131 #define FRAME_MSWINDOWS_HANDLE(f) (FRAME_MSWINDOWS_DATA (f)->hwnd)
|
|
132 #define FRAME_MSWINDOWS_DC(f) (FRAME_MSWINDOWS_DATA (f)->hdc)
|
|
133 #define FRAME_MSWINDOWS_MENU_HASHTABLE(f) (FRAME_MSWINDOWS_DATA (f)->menu_hashtable)
|
|
134 #define FRAME_MSWINDOWS_MENU_CHECKSUM(f) (FRAME_MSWINDOWS_DATA (f)->menu_checksum)
|
213
|
135
|
249
|
136 /* win32 window LONG indices */
|
|
137 #define XWL_FRAMEOBJ 0
|
|
138 #define XWL_COUNT 1 /* Number of LONGs that we use */
|
|
139 #define MSWINDOWS_WINDOW_EXTRA_BYTES (XWL_COUNT*4)
|
|
140
|
|
141
|
213
|
142 /*
|
249
|
143 * Events
|
|
144 */
|
|
145
|
|
146 /* win32 messages / magic event types */
|
|
147 #define EVENT_MSWINDOWS_MAGIC_TYPE(e) \
|
|
148 ((e)->event.magic.underlying_mswindows_event)
|
|
149 #define XM_BUMPQUEUE (WM_USER + 101)
|
|
150 #define XM_MAPFRAME (WM_USER + 102)
|
|
151 #define XM_UNMAPFRAME (WM_USER + 103)
|
|
152
|
|
153
|
|
154 /*
|
|
155 * Random globals
|
213
|
156 */
|
249
|
157
|
|
158 /* win32 "Windows" procedure */
|
|
159 LRESULT WINAPI mswindows_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam,
|
|
160 LPARAM lParam);
|
|
161
|
213
|
162 void mswindows_redraw_exposed_area (struct frame *f, int x, int y,
|
249
|
163 int width, int height);
|
|
164
|
|
165 /* win32 DDE management library */
|
|
166 #define MSWINDOWS_DDE_ITEM_OPEN "Open"
|
|
167 extern DWORD mswindows_dde_mlid;
|
|
168 extern HSZ mswindows_dde_service;
|
|
169 extern HSZ mswindows_dde_topic_system;
|
|
170 extern HSZ mswindows_dde_item_open;
|
|
171 HDDEDATA CALLBACK mswindows_dde_callback (UINT uType, UINT uFmt, HCONV hconv,
|
|
172 HSZ hszTopic, HSZ hszItem, HDDEDATA hdata,
|
|
173 DWORD dwData1, DWORD dwData2);
|
|
174
|
|
175 void mswindows_enqueue_dispatch_event (Lisp_Object event);
|
|
176 void mswindows_enqueue_magic_event (HWND hwnd, UINT message);
|
|
177 Lisp_Object mswindows_cancel_dispatch_event (struct Lisp_Event* event);
|
|
178 Lisp_Object mswindows_pump_outstanding_events (void);
|
213
|
179
|
|
180 #endif /* _XEMACS_CONSOLE_MSW_H_ */
|