comparison src/console-msw.h @ 771:943eaba38521

[xemacs-hg @ 2002-03-13 08:51:24 by ben] The big ben-mule-21-5 check-in! Various files were added and deleted. See CHANGES-ben-mule. There are still some test suite failures. No crashes, though. Many of the failures have to do with problems in the test suite itself rather than in the actual code. I'll be addressing these in the next day or so -- none of the test suite failures are at all critical. Meanwhile I'll be trying to address the biggest issues -- i.e. build or run failures, which will almost certainly happen on various platforms. All comments should be sent to ben@xemacs.org -- use a Cc: if necessary when sending to mailing lists. There will be pre- and post- tags, something like pre-ben-mule-21-5-merge-in, and post-ben-mule-21-5-merge-in.
author ben
date Wed, 13 Mar 2002 08:54:06 +0000
parents fdefd0186b75
children 7b1f30330a19
comparison
equal deleted inserted replaced
770:336a418893b5 771:943eaba38521
1 /* Define mswindows-specific console, device, and frame object for XEmacs. 1 /* Define mswindows-specific console, device, and frame object for XEmacs.
2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. 2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
3 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois. 3 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
4 Copyright (C) 2001 Ben Wing.
4 5
5 This file is part of XEmacs. 6 This file is part of XEmacs.
6 7
7 XEmacs is free software; you can redistribute it and/or modify it 8 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 under the terms of the GNU General Public License as published by the
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */ 21 Boston, MA 02111-1307, USA. */
21 22
22 /* Synched up with: Not in FSF. */ 23 /* Synched up with: Not in FSF. */
23 24
25 /* This file essentially Mule-ized (except perhaps some Unicode splitting).
26 5-2000. */
24 27
25 /* Authorship: 28 /* Authorship:
26 29
27 Ultimately based on FSF, then later on JWZ work for Lemacs. 30 Ultimately based on FSF, then later on JWZ work for Lemacs.
28 Rewritten over time by Ben Wing and Chuck Thompson. 31 Rewritten over time by Ben Wing and Chuck Thompson.
32 #ifndef INCLUDED_console_msw_h_ 35 #ifndef INCLUDED_console_msw_h_
33 #define INCLUDED_console_msw_h_ 36 #define INCLUDED_console_msw_h_
34 37
35 #include "console.h" 38 #include "console.h"
36 #include "syswindows.h" 39 #include "syswindows.h"
37 #include "syscommctrl.h"
38 40
39 #ifdef HAVE_XPM 41 #ifdef HAVE_XPM
40 #include <X11/xpm.h> 42 #include <X11/xpm.h>
41 #endif 43 #endif
42 44
43 /* The name of the main window class */ 45 /* The name of the main window class */
44 #define XEMACS_CLASS "XEmacs" 46 #define XEMACS_CLASS "XEmacs" /* WARNING: uses of this need XETEXT */
45 47
48 /* WARNING: uses of this need XETEXT */
46 #define XEMACS_CONTROL_CLASS "XEmacsControl" 49 #define XEMACS_CONTROL_CLASS "XEmacsControl"
47 50
48 /* 51 /*
49 * Consoles 52 * Consoles
50 */ 53 */
65 typedef struct Lisp_Devmode 68 typedef struct Lisp_Devmode
66 { 69 {
67 struct lcrecord_header header; 70 struct lcrecord_header header;
68 71
69 /* Pointer to the DEVMODE structure */ 72 /* Pointer to the DEVMODE structure */
70 DEVMODE* devmode; 73 DEVMODEW *devmode;
71 74
72 /* Full printer name. It can be longer than devmode->dmDeviceName 75 /* Full printer name. It can be longer than devmode->dmDeviceName
73 can accommodate, so need to keep it separately */ 76 can accommodate, so need to keep it separately */
74 char* printer_name; 77 Lisp_Object printer_name;
75 78
76 /* Printer device this object is currently selected in, or Qnil 79 /* Printer device this object is currently selected in, or Qnil
77 if not selected */ 80 if not selected */
78 Lisp_Object device; 81 Lisp_Object device;
79 82
93 96
94 /* 97 /*
95 * Devices 98 * Devices
96 */ 99 */
97 100
98 #define MSW_FONTSIZE (LF_FACESIZE*4+12) 101 #define MSW_FONTSIZE (LF_FACESIZE * 4 + 12)
99 102
100 struct mswindows_device 103 struct mswindows_device
101 { 104 {
102 Lisp_Object fontlist; /* List of strings, device fonts */ 105 Lisp_Object fontlist; /* List of strings, device fonts */
103 HDC hcdc; /* Compatible DC */ 106 HDC hcdc; /* Compatible DC */
113 116
114 struct msprinter_device 117 struct msprinter_device
115 { 118 {
116 HDC hdc, hcdc; /* Printer and the comp. DCs */ 119 HDC hdc, hcdc; /* Printer and the comp. DCs */
117 HANDLE hprinter; 120 HANDLE hprinter;
118 char* name; 121 Lisp_Object name;
119 Lisp_Object devmode; 122 Lisp_Object devmode;
120 Lisp_Object fontlist; 123 Lisp_Object fontlist;
121 }; 124 };
122 125
123 #define DEVICE_MSPRINTER_DATA(d) DEVICE_TYPE_DATA (d, msprinter) 126 #define DEVICE_MSPRINTER_DATA(d) DEVICE_TYPE_DATA (d, msprinter)
204 207
205 /* Real character width and height of the frame. 208 /* Real character width and height of the frame.
206 FRAME_{HEIGHT,WIDTH} do not work for pixel geometry! */ 209 FRAME_{HEIGHT,WIDTH} do not work for pixel geometry! */
207 int charheight, charwidth; 210 int charheight, charwidth;
208 211
212 #ifdef MULE
213 int cursor_x;
214 int cursor_y;
215 face_index cursor_findex;
216 #endif
217
209 /* Misc flags */ 218 /* Misc flags */
210 int button2_need_lbutton : 1; 219 int button2_need_lbutton : 1;
211 int button2_need_rbutton : 1; 220 int button2_need_rbutton : 1;
212 int button2_is_down : 1; 221 int button2_is_down : 1;
213 int ignore_next_lbutton_up : 1; 222 int ignore_next_lbutton_up : 1;
216 int paint_pending : 1; /* Whether a WM_PAINT magic event has been queued */ 225 int paint_pending : 1; /* Whether a WM_PAINT magic event has been queued */
217 int popup : 1; /* frame is a popup frame */ 226 int popup : 1; /* frame is a popup frame */
218 227
219 /* Geometry, in characters, as specified by proplist during frame 228 /* Geometry, in characters, as specified by proplist during frame
220 creation. Members are set to -1 for unspecified */ 229 creation. Members are set to -1 for unspecified */
221 XEMACS_RECT_WH* target_rect; 230 XEMACS_RECT_WH *target_rect;
222 }; 231 };
223 232
224 #define FRAME_MSWINDOWS_DATA(f) FRAME_TYPE_DATA (f, mswindows) 233 #define FRAME_MSWINDOWS_DATA(f) FRAME_TYPE_DATA (f, mswindows)
225 234
226 #define FRAME_MSWINDOWS_HANDLE(f) (FRAME_MSWINDOWS_DATA (f)->hwnd) 235 #define FRAME_MSWINDOWS_HANDLE(f) (FRAME_MSWINDOWS_DATA (f)->hwnd)
239 #define FRAME_MSWINDOWS_MENU_CHECKSUM(f) (FRAME_MSWINDOWS_DATA (f)->menu_checksum) 248 #define FRAME_MSWINDOWS_MENU_CHECKSUM(f) (FRAME_MSWINDOWS_DATA (f)->menu_checksum)
240 #define FRAME_MSWINDOWS_TITLE_CHECKSUM(f) (FRAME_MSWINDOWS_DATA (f)->title_checksum) 249 #define FRAME_MSWINDOWS_TITLE_CHECKSUM(f) (FRAME_MSWINDOWS_DATA (f)->title_checksum)
241 #define FRAME_MSWINDOWS_CHARWIDTH(f) (FRAME_MSWINDOWS_DATA (f)->charwidth) 250 #define FRAME_MSWINDOWS_CHARWIDTH(f) (FRAME_MSWINDOWS_DATA (f)->charwidth)
242 #define FRAME_MSWINDOWS_CHARHEIGHT(f) (FRAME_MSWINDOWS_DATA (f)->charheight) 251 #define FRAME_MSWINDOWS_CHARHEIGHT(f) (FRAME_MSWINDOWS_DATA (f)->charheight)
243 #define FRAME_MSWINDOWS_TARGET_RECT(f) (FRAME_MSWINDOWS_DATA (f)->target_rect) 252 #define FRAME_MSWINDOWS_TARGET_RECT(f) (FRAME_MSWINDOWS_DATA (f)->target_rect)
253
244 #define FRAME_MSWINDOWS_POPUP(f) (FRAME_MSWINDOWS_DATA (f)->popup) 254 #define FRAME_MSWINDOWS_POPUP(f) (FRAME_MSWINDOWS_DATA (f)->popup)
255
256 #ifdef MULE
257 # define FRAME_MSWINDOWS_CURSOR_X(f) (FRAME_MSWINDOWS_DATA (f)->cursor_x)
258 # define FRAME_MSWINDOWS_CURSOR_Y(f) (FRAME_MSWINDOWS_DATA (f)->cursor_y)
259 # define FRAME_MSWINDOWS_CURSOR_FINDEX(f) (FRAME_MSWINDOWS_DATA (f)->cursor_findex)
260 #endif
245 261
246 /* Frame check and validation macros */ 262 /* Frame check and validation macros */
247 #define FRAME_MSWINDOWS_P(frm) CONSOLE_TYPESYM_MSWINDOWS_P (FRAME_TYPE (frm)) 263 #define FRAME_MSWINDOWS_P(frm) CONSOLE_TYPESYM_MSWINDOWS_P (FRAME_TYPE (frm))
248 #define CHECK_MSWINDOWS_FRAME(z) CHECK_FRAME_TYPE (z, mswindows) 264 #define CHECK_MSWINDOWS_FRAME(z) CHECK_FRAME_TYPE (z, mswindows)
249 #define CONCHECK_MSWINDOWS_FRAME(z) CONCHECK_FRAME_TYPE (z, mswindows) 265 #define CONCHECK_MSWINDOWS_FRAME(z) CONCHECK_FRAME_TYPE (z, mswindows)
250 266
251 /* win32 window LONG indices */ 267 /* win32 window LONG indices */
252 #define XWL_FRAMEOBJ 0 268 #define XWL_FRAMEOBJ 0
253 #define XWL_COUNT 1 /* Number of LONGs that we use */ 269 #define XWL_COUNT 1 /* Number of LONGs that we use */
254 #define MSWINDOWS_WINDOW_EXTRA_BYTES (XWL_COUNT*4) 270 #define MSWINDOWS_WINDOW_EXTRA_BYTES (XWL_COUNT * 4)
255 271
256 /* 272 /*
257 * Printer frame, aka printer job 273 * Printer frame, aka printer job
258 */ 274 */
259 275
302 UINT msg, WPARAM wParam, 318 UINT msg, WPARAM wParam,
303 LPARAM lParam); 319 LPARAM lParam);
304 320
305 void mswindows_redraw_exposed_area (struct frame *f, int x, int y, 321 void mswindows_redraw_exposed_area (struct frame *f, int x, int y,
306 int width, int height); 322 int width, int height);
307 void mswindows_size_frame_internal (struct frame* f, XEMACS_RECT_WH* dest); 323 void mswindows_size_frame_internal (struct frame *f, XEMACS_RECT_WH *dest);
308 HWND mswindows_get_selected_frame_hwnd (void); 324 HWND mswindows_get_selected_frame_hwnd (void);
309 void mswindows_enqueue_magic_event (HWND hwnd, UINT msg); 325 void mswindows_enqueue_magic_event (HWND hwnd, UINT msg);
310 int mswindows_is_dialog_msg (MSG *msg); 326 int mswindows_is_dialog_msg (MSG *msg);
311 327
312 /* win32 DDE management library */ 328 /* win32 DDE management library */
313 #define MSWINDOWS_DDE_ITEM_OPEN "Open" 329 #define MSWINDOWS_DDE_ITEM_OPEN "Open" /* WARNING: uses of this need XETEXT */
314 extern DWORD mswindows_dde_mlid; 330 extern DWORD mswindows_dde_mlid;
315 extern HSZ mswindows_dde_service; 331 extern HSZ mswindows_dde_service;
316 extern HSZ mswindows_dde_topic_system; 332 extern HSZ mswindows_dde_topic_system;
317 extern HSZ mswindows_dde_item_open; 333 extern HSZ mswindows_dde_item_open;
318 HDDEDATA CALLBACK mswindows_dde_callback (UINT uType, UINT uFmt, HCONV hconv, 334 HDDEDATA CALLBACK mswindows_dde_callback (UINT uType, UINT uFmt, HCONV hconv,
322 338
323 void mswindows_enqueue_dispatch_event (Lisp_Object event); 339 void mswindows_enqueue_dispatch_event (Lisp_Object event);
324 void mswindows_enqueue_misc_user_event (Lisp_Object channel, 340 void mswindows_enqueue_misc_user_event (Lisp_Object channel,
325 Lisp_Object function, 341 Lisp_Object function,
326 Lisp_Object object); 342 Lisp_Object object);
327 Lisp_Object mswindows_cancel_dispatch_event (Lisp_Event* event); 343 Lisp_Object mswindows_cancel_dispatch_event (Lisp_Event *event);
328 Lisp_Object mswindows_pump_outstanding_events (void); 344 Lisp_Object mswindows_pump_outstanding_events (void);
329 Lisp_Object mswindows_protect_modal_loop (Lisp_Object (*bfun) 345 Lisp_Object mswindows_protect_modal_loop (Lisp_Object (*bfun)
330 (Lisp_Object barg), 346 (Lisp_Object barg),
331 Lisp_Object barg); 347 Lisp_Object barg);
332 void mswindows_unmodalize_signal_maybe (void); 348 void mswindows_unmodalize_signal_maybe (void);
333 349
334 COLORREF mswindows_string_to_color (const char *name); 350 COLORREF mswindows_string_to_color (const Intbyte *name);
335 USID emacs_mswindows_create_stream_pair (void* inhandle, void* outhandle, 351 USID emacs_mswindows_create_stream_pair (void *inhandle, void *outhandle,
336 Lisp_Object* instream, 352 Lisp_Object *instream,
337 Lisp_Object* outstream, 353 Lisp_Object *outstream,
338 int flags); 354 int flags);
339 USID emacs_mswindows_delete_stream_pair (Lisp_Object instream, 355 USID emacs_mswindows_delete_stream_pair (Lisp_Object instream,
340 Lisp_Object outstream); 356 Lisp_Object outstream);
341 357
342 #ifdef HAVE_WIN32_PROCESSES 358 #ifdef HAVE_WIN32_PROCESSES
346 extern Lisp_Object Vmswindows_frame_being_created; 362 extern Lisp_Object Vmswindows_frame_being_created;
347 extern Lisp_Object mswindows_frame_being_created; 363 extern Lisp_Object mswindows_frame_being_created;
348 364
349 void mswindows_get_workspace_coords (RECT *rc); 365 void mswindows_get_workspace_coords (RECT *rc);
350 366
351 HWND mswindows_get_console_hwnd (void);
352 void mswindows_hide_console (void);
353 void mswindows_show_console (void);
354 int mswindows_output_console_string (CONST Extbyte *str, Bytecount len);
355
356 Lisp_Object mswindows_enumerate_fonts (HDC hdc); 367 Lisp_Object mswindows_enumerate_fonts (HDC hdc);
357 368
358 int mswindows_char_is_accelerator (struct frame *f, Emchar ch); 369 int mswindows_char_is_accelerator (struct frame *f, Emchar ch);
359 Bytecount mswindows_translate_menu_or_dialog_item (Intbyte *item, Bytecount len, 370 Lisp_Object mswindows_translate_menu_or_dialog_item (Lisp_Object item,
360 Bytecount maxlen, Emchar *accel, 371 Emchar *accel);
361 Lisp_Object error_name);
362 372
363 #ifdef HAVE_TOOLBARS 373 #ifdef HAVE_TOOLBARS
364 Lisp_Object mswindows_get_toolbar_button_text (struct frame* f, 374 Lisp_Object mswindows_get_toolbar_button_text (struct frame *f,
365 int command_id); 375 int command_id);
366 Lisp_Object mswindows_handle_toolbar_wm_command (struct frame* f, 376 Lisp_Object mswindows_handle_toolbar_wm_command (struct frame *f,
367 HWND ctrl, WORD id); 377 HWND ctrl, WORD id);
368 #endif 378 #endif
369 Lisp_Object mswindows_handle_gui_wm_command (struct frame* f, 379 Lisp_Object mswindows_handle_gui_wm_command (struct frame *f,
370 HWND ctrl, LPARAM id); 380 HWND ctrl, LPARAM id);
371 381
372 int mswindows_windows9x_p (void); 382 void mswindows_handle_destroyclipboard (void);
373
374 void mswindows_output_last_error (char *frob);
375 DOESNT_RETURN mswindows_report_process_error (const char *string,
376 Lisp_Object data,
377 int errnum);
378 Lisp_Object mswindows_lisp_error (int errnum);
379 383
380 Lisp_Object mswindows_handle_print_dialog_box (struct frame *f, 384 Lisp_Object mswindows_handle_print_dialog_box (struct frame *f,
381 Lisp_Object keys); 385 Lisp_Object keys);
382 Lisp_Object mswindows_handle_page_setup_dialog_box (struct frame *f, 386 Lisp_Object mswindows_handle_page_setup_dialog_box (struct frame *f,
383 Lisp_Object keys); 387 Lisp_Object keys);
386 void mswindows_register_popup_frame (Lisp_Object frame); 390 void mswindows_register_popup_frame (Lisp_Object frame);
387 void mswindows_unregister_popup_frame (Lisp_Object frame); 391 void mswindows_unregister_popup_frame (Lisp_Object frame);
388 392
389 void mswindows_destroy_selection (Lisp_Object selection); 393 void mswindows_destroy_selection (Lisp_Object selection);
390 394
395 int mswindows_window_is_xemacs (HWND hwnd);
396
391 Lisp_Object msprinter_default_printer (void); 397 Lisp_Object msprinter_default_printer (void);
392 398
393 Lisp_Object mswindows_find_frame (HWND hwnd); 399 Lisp_Object mswindows_find_frame (HWND hwnd);
400
401 #ifdef MULE
402 Lisp_Object mswindows_get_code_page_charset (int code_page);
403 void mswindows_start_ime_composition (struct frame *f);
404 #endif /* MULE */
394 405
395 struct mswindows_dialog_id 406 struct mswindows_dialog_id
396 { 407 {
397 struct lcrecord_header header; 408 struct lcrecord_header header;
398 409