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"
|
251
|
36 #ifdef CONST /* I suspect this is safe */
|
|
37 #undef CONST
|
|
38 #endif
|
213
|
39 #include "windows.h"
|
249
|
40 #include "ddeml.h" /* DDE management library */
|
251
|
41 #ifndef __CYGWIN32__
|
249
|
42 #include "shellapi.h" /* FileManager/Explorer drag and drop */
|
251
|
43 #endif
|
249
|
44
|
|
45 /*
|
|
46 * XXX FIXME: The following X modifier defs in events-mod.h clash with win32
|
|
47 * hotkey defs in winuser.h. For the moment lose the win32 versions.
|
|
48 * Maybe we should rename all of MOD_* to something that doesn't clash.
|
|
49 */
|
|
50 #ifdef MOD_CONTROL
|
|
51 # undef MOD_CONTROL
|
|
52 #endif
|
|
53 #ifdef MOD_ALT
|
|
54 # undef MOD_ALT
|
|
55 #endif
|
|
56 #ifdef MOD_SHIFT
|
|
57 # undef MOD_SHIFT
|
|
58 #endif
|
|
59
|
|
60
|
|
61 /* The name of the main window class */
|
|
62 #define XEMACS_CLASS "XEmacs"
|
|
63
|
|
64
|
|
65 /*
|
|
66 * Console
|
|
67 */
|
213
|
68
|
|
69 DECLARE_CONSOLE_TYPE (mswindows);
|
|
70
|
|
71 struct mswindows_console
|
|
72 {
|
|
73 int infd, outfd;
|
|
74 };
|
|
75
|
|
76
|
249
|
77 /*
|
|
78 * Device
|
|
79 */
|
|
80
|
213
|
81 struct mswindows_device
|
|
82 {
|
|
83 int logpixelsx, logpixelsy;
|
|
84 int planes, cells;
|
|
85 int horzres, vertres; /* Size in pixels */
|
|
86 int horzsize, vertsize; /* Size in mm */
|
267
|
87 int bitspixel;
|
213
|
88 };
|
|
89
|
|
90 #define DEVICE_MSWINDOWS_DATA(d) DEVICE_TYPE_DATA (d, mswindows)
|
|
91 #define DEVICE_MSWINDOWS_LOGPIXELSX(d) (DEVICE_MSWINDOWS_DATA (d)->logpixelsx)
|
|
92 #define DEVICE_MSWINDOWS_LOGPIXELSY(d) (DEVICE_MSWINDOWS_DATA (d)->logpixelsy)
|
|
93 #define DEVICE_MSWINDOWS_PLANES(d) (DEVICE_MSWINDOWS_DATA (d)->planes)
|
|
94 #define DEVICE_MSWINDOWS_CELLS(d) (DEVICE_MSWINDOWS_DATA (d)->cells)
|
|
95 #define DEVICE_MSWINDOWS_HORZRES(d) (DEVICE_MSWINDOWS_DATA (d)->horzres)
|
|
96 #define DEVICE_MSWINDOWS_VERTRES(d) (DEVICE_MSWINDOWS_DATA (d)->vertres)
|
|
97 #define DEVICE_MSWINDOWS_HORZSIZE(d) (DEVICE_MSWINDOWS_DATA (d)->horzsize)
|
|
98 #define DEVICE_MSWINDOWS_VERTSIZE(d) (DEVICE_MSWINDOWS_DATA (d)->vertsize)
|
267
|
99 #define DEVICE_MSWINDOWS_BITSPIXEL(d) (DEVICE_MSWINDOWS_DATA (d)->bitspixel)
|
213
|
100
|
|
101
|
249
|
102 /*
|
|
103 * Frame
|
|
104 */
|
|
105
|
213
|
106 struct mswindows_frame
|
|
107 {
|
|
108 /* win32 window handle */
|
|
109 HWND hwnd;
|
|
110
|
|
111 /* DC for this win32 window */
|
|
112 HDC hdc;
|
223
|
113
|
|
114 /* Time of last click event, for button 2 emul */
|
|
115 DWORD last_click_time;
|
|
116
|
|
117 /* Coordinates of last click event, screen-relative */
|
|
118 POINTS last_click_point;
|
|
119
|
233
|
120 /* Menu hashtable. See menubar-msw.c */
|
|
121 Lisp_Object menu_hashtable;
|
|
122
|
|
123 /* Menu checksum. See menubar-msw.c */
|
|
124 unsigned int menu_checksum;
|
231
|
125
|
223
|
126 /* Misc flags */
|
|
127 int button2_need_lbutton : 1;
|
|
128 int button2_need_rbutton : 1;
|
|
129 int button2_is_down : 1;
|
|
130 int ignore_next_lbutton_up : 1;
|
|
131 int ignore_next_rbutton_up : 1;
|
|
132 int sizing : 1;
|
213
|
133 };
|
|
134
|
|
135 #define FRAME_MSWINDOWS_DATA(f) FRAME_TYPE_DATA (f, mswindows)
|
|
136
|
233
|
137 #define FRAME_MSWINDOWS_HANDLE(f) (FRAME_MSWINDOWS_DATA (f)->hwnd)
|
|
138 #define FRAME_MSWINDOWS_DC(f) (FRAME_MSWINDOWS_DATA (f)->hdc)
|
|
139 #define FRAME_MSWINDOWS_MENU_HASHTABLE(f) (FRAME_MSWINDOWS_DATA (f)->menu_hashtable)
|
|
140 #define FRAME_MSWINDOWS_MENU_CHECKSUM(f) (FRAME_MSWINDOWS_DATA (f)->menu_checksum)
|
213
|
141
|
249
|
142 /* win32 window LONG indices */
|
|
143 #define XWL_FRAMEOBJ 0
|
|
144 #define XWL_COUNT 1 /* Number of LONGs that we use */
|
|
145 #define MSWINDOWS_WINDOW_EXTRA_BYTES (XWL_COUNT*4)
|
|
146
|
|
147
|
213
|
148 /*
|
249
|
149 * Events
|
|
150 */
|
|
151
|
|
152 /* win32 messages / magic event types */
|
|
153 #define EVENT_MSWINDOWS_MAGIC_TYPE(e) \
|
|
154 ((e)->event.magic.underlying_mswindows_event)
|
|
155 #define XM_BUMPQUEUE (WM_USER + 101)
|
|
156 #define XM_MAPFRAME (WM_USER + 102)
|
|
157 #define XM_UNMAPFRAME (WM_USER + 103)
|
|
158
|
|
159
|
|
160 /*
|
|
161 * Random globals
|
213
|
162 */
|
249
|
163
|
|
164 /* win32 "Windows" procedure */
|
|
165 LRESULT WINAPI mswindows_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam,
|
|
166 LPARAM lParam);
|
|
167
|
213
|
168 void mswindows_redraw_exposed_area (struct frame *f, int x, int y,
|
249
|
169 int width, int height);
|
|
170
|
|
171 /* win32 DDE management library */
|
|
172 #define MSWINDOWS_DDE_ITEM_OPEN "Open"
|
|
173 extern DWORD mswindows_dde_mlid;
|
|
174 extern HSZ mswindows_dde_service;
|
|
175 extern HSZ mswindows_dde_topic_system;
|
|
176 extern HSZ mswindows_dde_item_open;
|
|
177 HDDEDATA CALLBACK mswindows_dde_callback (UINT uType, UINT uFmt, HCONV hconv,
|
|
178 HSZ hszTopic, HSZ hszItem, HDDEDATA hdata,
|
|
179 DWORD dwData1, DWORD dwData2);
|
|
180
|
|
181 void mswindows_enqueue_dispatch_event (Lisp_Object event);
|
|
182 void mswindows_enqueue_magic_event (HWND hwnd, UINT message);
|
|
183 Lisp_Object mswindows_cancel_dispatch_event (struct Lisp_Event* event);
|
|
184 Lisp_Object mswindows_pump_outstanding_events (void);
|
213
|
185
|
|
186 #endif /* _XEMACS_CONSOLE_MSW_H_ */
|