annotate src/console-msw.h @ 801:2b676dc88c66

[xemacs-hg @ 2002-04-01 03:58:02 by ben] bug fixes (e.g. ballooning on X windows) Makefile.in.in: Try to make the Makefile notice if its source Makefile.in.in is changed, and regenerate and run itself. Use a bigger default SHEAP_ADJUSTMENT on Cygwin; otherwise you can't compile under Mule if a Lisp file has changed. (can't run temacs) TODO.ben-mule-21-5: update. mule/mule-cmds.el: Hash the result of mswindows-get-language-environment-from-locale, since it's very expensive (and causes huge ballooning of memory under X Windows, since it's called from x-get-resource). cl-extra.el, code-files.el, files.el, simple.el, subr.el, x-faces.el: Create new string-equal-ignore-case, based on built-in compare-strings -- compare strings ignoring case without the need to generate garbage by calling downcase. Use it in equalp and elsewhere. alloc.c, bytecode.c, chartab.c, data.c, elhash.c, emacs.c, eval.c, event-Xt.c, event-unixoid.c, extents.c, file-coding.c, fileio.c, fns.c, glyphs.c, gutter.c, lisp-union.h, lisp.h, mule-charset.c, nt.c, process-unix.c, process.c, specifier.c, symbols.c, sysdep.c, sysdep.h, text.c, toolbar.c: Try to implement GC triggering based on percentage of total memory usage. Not currently activated (percentage set to 0) because not quite working. Add `memory-usage' primitive to return XEmacs' idea of its memory usage. Add primitive compare-strings, compatible with FSF 21.1 -- can compare any part of two strings, optionally ignoring case. Improve qxe() functions in text.c for text comparison. Use RETURN_NOT_REACHED to try to avoid warnings about unreachable code. Add volatile_make_int() to fix warning in unix_send_process().
author ben
date Mon, 01 Apr 2002 03:59:04 +0000
parents e38acbeb1cae
children 6728e641994e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /* Define mswindows-specific console, device, and frame object for XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
4 Copyright (C) 2001 Ben Wing.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 /* Synched up with: Not in FSF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
25 /* This file essentially Mule-ized (except perhaps some Unicode splitting).
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
26 5-2000. */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 /* Authorship:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30 Ultimately based on FSF, then later on JWZ work for Lemacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 Rewritten over time by Ben Wing and Chuck Thompson.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
35 #ifndef INCLUDED_console_msw_h_
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
36 #define INCLUDED_console_msw_h_
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 #include "console.h"
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
39 #include "syswindows.h"
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 #ifdef HAVE_XPM
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 #include <X11/xpm.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 /* The name of the main window class */
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
46 #define XEMACS_CLASS "XEmacs" /* WARNING: uses of this need XETEXT */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
48 /* WARNING: uses of this need XETEXT */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 #define XEMACS_CONTROL_CLASS "XEmacsControl"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 /*
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
52 * Consoles
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 DECLARE_CONSOLE_TYPE (mswindows);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 struct mswindows_console
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 int infd, outfd;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
62 DECLARE_CONSOLE_TYPE (msprinter);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 /*
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
65 * Printer settings, aka devmode
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
66 */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
67
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
68 typedef struct Lisp_Devmode
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
69 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
70 struct lcrecord_header header;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
71
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
72 /* Pointer to the DEVMODE structure */
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
73 DEVMODEW *devmode;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
74
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
75 /* Full printer name. It can be longer than devmode->dmDeviceName
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
76 can accommodate, so need to keep it separately */
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
77 Lisp_Object printer_name;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
78
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
79 /* Printer device this object is currently selected in, or Qnil
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
80 if not selected */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
81 Lisp_Object device;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
82
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
83 } Lisp_Devmode;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
84
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
85
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
86 DECLARE_LRECORD (devmode, Lisp_Devmode);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
87 #define XDEVMODE(x) XRECORD (x, devmode, Lisp_Devmode)
617
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 586
diff changeset
88 #define wrap_devmode(p) wrap_record (p, devmode)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
89 #define DEVMODEP(x) RECORDP (x, devmode)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
90 #define CHECK_DEVMODE(x) CHECK_RECORD (x, devmode)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
91 #define CONCHECK_DEVMODE(x) CONCHECK_RECORD (x, devmode)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
92
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
93 #define DEVMODE_SIZE(dm) ((dm)->dmSize + (dm)->dmDriverExtra)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
94 #define XDEVMODE_SIZE(x) ((x)->devmode ? DEVMODE_SIZE((x)->devmode) : 0)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
95
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
96 /*
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
97 * Devices
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
100 #define MSW_FONTSIZE (LF_FACESIZE * 4 + 12)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 struct mswindows_device
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 {
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
104 Lisp_Object fontlist; /* List of strings, device fonts */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
105 HDC hcdc; /* Compatible DC */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
106 DWORD update_tick; /* Used when device is modified through
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
107 Windows messages, see WM_DISPLAYCHANGE
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
108 in event-msw.c */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 #define DEVICE_MSWINDOWS_DATA(d) DEVICE_TYPE_DATA (d, mswindows)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
112 #define DEVICE_MSWINDOWS_FONTLIST(d) (DEVICE_MSWINDOWS_DATA (d)->fontlist)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
113 #define DEVICE_MSWINDOWS_HCDC(d) (DEVICE_MSWINDOWS_DATA (d)->hcdc)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
114 #define DEVICE_MSWINDOWS_UPDATE_TICK(d) (DEVICE_MSWINDOWS_DATA (d)->update_tick)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
116 struct msprinter_device
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
117 {
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
118 HDC hdc, hcdc; /* Printer and the comp. DCs */
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
119 HANDLE hprinter;
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
120 Lisp_Object name;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
121 Lisp_Object devmode;
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
122 Lisp_Object fontlist;
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
123 };
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
124
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
125 #define DEVICE_MSPRINTER_DATA(d) DEVICE_TYPE_DATA (d, msprinter)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
126 #define DEVICE_MSPRINTER_HDC(d) (DEVICE_MSPRINTER_DATA (d)->hdc)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
127 #define DEVICE_MSPRINTER_HCDC(d) (DEVICE_MSPRINTER_DATA (d)->hcdc)
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
128 #define DEVICE_MSPRINTER_HPRINTER(d) (DEVICE_MSPRINTER_DATA (d)->hprinter)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
129 #define DEVICE_MSPRINTER_FONTLIST(d) (DEVICE_MSPRINTER_DATA (d)->fontlist)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
130 #define DEVICE_MSPRINTER_NAME(d) (DEVICE_MSPRINTER_DATA (d)->name)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
131 #define DEVICE_MSPRINTER_DEVMODE(d) (DEVICE_MSPRINTER_DATA (d)->devmode)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
132
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
133 #define CONSOLE_TYPESYM_MSPRINTER_P(typesym) EQ (typesym, Qmsprinter)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
134 #define DEVICE_MSPRINTER_P(dev) CONSOLE_TYPESYM_MSPRINTER_P (DEVICE_TYPE (dev))
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
135 #define CHECK_MSPRINTER_DEVICE(z) CHECK_DEVICE_TYPE (z, msprinter)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
136 #define CONCHECK_MSPRINTER_DEVICE(z) CONCHECK_DEVICE_TYPE (z, msprinter)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
137
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
138 /* Printer functions in frame-msw.c */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
139 void msprinter_start_page (struct frame *f);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
140
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
141 /* Common checks */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
142
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
143 #define DEVICE_MSGDI_P(dev) (DEVICE_MSWINDOWS_P(dev) || DEVICE_MSPRINTER_P(dev))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
144 #define CHECK_MSGDI_DEVICE(d) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
145 do { \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
146 CHECK_DEVICE (d); \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
147 if (!(DEVICEP (d) && DEVICE_MSGDI_P(XDEVICE(d)))) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
148 dead_wrong_type_argument \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
149 (list3 (Qor, Qmswindows, Qmsprinter), d); \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
150 } while (0)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
151 #define CONCHECK_MSGDI_DEVICE(d) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
152 do { \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
153 CHECK_DEVICE (d); \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
154 if (!(DEVICEP (d) && DEVICE_MSGDI_P(XDEVICE(d)))) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
155 wrong_type_argument \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
156 (list3 (Qor, Qmswindows, Qmsprinter), d); \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
157 } while (0)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 /*
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
160 * Frames
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 typedef struct
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 int left;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 int top;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 int width;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 int height;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
168 } XEMACS_RECT_WH;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
169
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170 struct mswindows_frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 /* win32 window handle */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 HWND hwnd;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 /* DC for this win32 window */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 HDC hdc;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
178 /* Used with DeferWindowPos */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
179 HDWP hdwp;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 /* Time of last click event, for button 2 emul */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182 DWORD last_click_time;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
184 /* Mods of last click event */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
185 DWORD last_click_mods;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
186
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 /* Coordinates of last click event, screen-relative */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 POINTS last_click_point;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 #ifdef HAVE_TOOLBARS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 /* Toolbar hash table. See toolbar-msw.c */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 Lisp_Object toolbar_hash_table;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192 unsigned int toolbar_checksum[4];
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 /* Menu hash table. See menubar-msw.c */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 Lisp_Object menu_hash_table;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 /* Menu checksum. See menubar-msw.c */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 unsigned int menu_checksum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 /* Widget glyphs attached to this frame. See glyphs-msw.c */
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
202 Lisp_Object widget_hash_table1, widget_hash_table2, widget_hash_table3;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 /* Frame title hash value. See frame-msw.c */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205 unsigned int title_checksum;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
206
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
207 /* Real character width and height of the frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
208 FRAME_{HEIGHT,WIDTH} do not work for pixel geometry! */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
209 int charheight, charwidth;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
210
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
211 #ifdef MULE
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
212 int cursor_x;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
213 int cursor_y;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
214 face_index cursor_findex;
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
215 #endif
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
216
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
217 /* Misc flags */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
218 int button2_need_lbutton : 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
219 int button2_need_rbutton : 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
220 int button2_is_down : 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
221 int ignore_next_lbutton_up : 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
222 int ignore_next_rbutton_up : 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
223 int sizing : 1;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
224 int paint_pending : 1; /* Whether a WM_PAINT magic event has been queued */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
225 int popup : 1; /* frame is a popup frame */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
226
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
227 /* Geometry, in characters, as specified by proplist during frame
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
228 creation. Members are set to -1 for unspecified */
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
229 XEMACS_RECT_WH *target_rect;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
230 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
231
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
232 #define FRAME_MSWINDOWS_DATA(f) FRAME_TYPE_DATA (f, mswindows)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
233
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
234 #define FRAME_MSWINDOWS_HANDLE(f) (FRAME_MSWINDOWS_DATA (f)->hwnd)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
235 #define FRAME_MSWINDOWS_DC(f) (FRAME_MSWINDOWS_DATA (f)->hdc)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
236 #define FRAME_MSWINDOWS_MENU_HASH_TABLE(f) (FRAME_MSWINDOWS_DATA (f)->menu_hash_table)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
237 #define FRAME_MSWINDOWS_TOOLBAR_HASH_TABLE(f) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
238 (FRAME_MSWINDOWS_DATA (f)->toolbar_hash_table)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
239 #define FRAME_MSWINDOWS_WIDGET_HASH_TABLE1(f) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
240 (FRAME_MSWINDOWS_DATA (f)->widget_hash_table1)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
241 #define FRAME_MSWINDOWS_WIDGET_HASH_TABLE2(f) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
242 (FRAME_MSWINDOWS_DATA (f)->widget_hash_table2)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
243 #define FRAME_MSWINDOWS_WIDGET_HASH_TABLE3(f) \
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
244 (FRAME_MSWINDOWS_DATA (f)->widget_hash_table3)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
245 #define FRAME_MSWINDOWS_TOOLBAR_CHECKSUM(f,pos) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
246 (FRAME_MSWINDOWS_DATA (f)->toolbar_checksum[pos])
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
247 #define FRAME_MSWINDOWS_MENU_CHECKSUM(f) (FRAME_MSWINDOWS_DATA (f)->menu_checksum)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 #define FRAME_MSWINDOWS_TITLE_CHECKSUM(f) (FRAME_MSWINDOWS_DATA (f)->title_checksum)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249 #define FRAME_MSWINDOWS_CHARWIDTH(f) (FRAME_MSWINDOWS_DATA (f)->charwidth)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 #define FRAME_MSWINDOWS_CHARHEIGHT(f) (FRAME_MSWINDOWS_DATA (f)->charheight)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 #define FRAME_MSWINDOWS_TARGET_RECT(f) (FRAME_MSWINDOWS_DATA (f)->target_rect)
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
252
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
253 #define FRAME_MSWINDOWS_POPUP(f) (FRAME_MSWINDOWS_DATA (f)->popup)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
255 #ifdef MULE
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
256 # define FRAME_MSWINDOWS_CURSOR_X(f) (FRAME_MSWINDOWS_DATA (f)->cursor_x)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
257 # define FRAME_MSWINDOWS_CURSOR_Y(f) (FRAME_MSWINDOWS_DATA (f)->cursor_y)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
258 # define FRAME_MSWINDOWS_CURSOR_FINDEX(f) (FRAME_MSWINDOWS_DATA (f)->cursor_findex)
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
259 #endif
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
260
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
261 /* Frame check and validation macros */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
262 #define FRAME_MSWINDOWS_P(frm) CONSOLE_TYPESYM_MSWINDOWS_P (FRAME_TYPE (frm))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 #define CHECK_MSWINDOWS_FRAME(z) CHECK_FRAME_TYPE (z, mswindows)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264 #define CONCHECK_MSWINDOWS_FRAME(z) CONCHECK_FRAME_TYPE (z, mswindows)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
266 /* win32 window LONG indices */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
267 #define XWL_FRAMEOBJ 0
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
268 #define XWL_COUNT 1 /* Number of LONGs that we use */
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
269 #define MSWINDOWS_WINDOW_EXTRA_BYTES (XWL_COUNT * 4)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
270
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
271 /*
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
272 * Printer frame, aka printer job
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
273 */
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
274
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
275 struct msprinter_frame
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
276 {
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
277 int left_margin, top_margin, /* All in twips */
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
278 right_margin, bottom_margin;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
279 int charheight, charwidth; /* As per proplist or -1 if not given */
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
280 int pix_left, pix_top; /* Calculated in init_frame_*, VP offset */
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
281 int job_started : 1;
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
282 int page_started : 1;
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
283 };
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
284
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
285 #define FRAME_MSPRINTER_DATA(f) FRAME_TYPE_DATA (f, msprinter)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
286 #define FRAME_MSPRINTER_LEFT_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->left_margin)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
287 #define FRAME_MSPRINTER_RIGHT_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->top_margin)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
288 #define FRAME_MSPRINTER_TOP_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->right_margin)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
289 #define FRAME_MSPRINTER_BOTTOM_MARGIN(f) (FRAME_MSPRINTER_DATA (f)->bottom_margin)
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
290 #define FRAME_MSPRINTER_JOB_STARTED(f) (FRAME_MSPRINTER_DATA (f)->job_started)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
291 #define FRAME_MSPRINTER_PAGE_STARTED(f) (FRAME_MSPRINTER_DATA (f)->page_started)
586
b5b4308a001d [xemacs-hg @ 2001-05-29 05:11:44 by mta]
mta
parents: 563
diff changeset
292 #define FRAME_MSPRINTER_CHARWIDTH(f) (FRAME_MSPRINTER_DATA (f)->charwidth)
b5b4308a001d [xemacs-hg @ 2001-05-29 05:11:44 by mta]
mta
parents: 563
diff changeset
293 #define FRAME_MSPRINTER_CHARHEIGHT(f) (FRAME_MSPRINTER_DATA (f)->charheight)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
294 #define FRAME_MSPRINTER_PIXLEFT(f) (FRAME_MSPRINTER_DATA (f)->pix_left)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
295 #define FRAME_MSPRINTER_PIXTOP(f) (FRAME_MSPRINTER_DATA (f)->pix_top)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 * Events
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 /* win32 messages / magic event types */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 #define EVENT_MSWINDOWS_MAGIC_TYPE(e) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 ((e)->event.magic.underlying_mswindows_event)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 #define XM_BUMPQUEUE (WM_USER + 101)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 #define XM_MAPFRAME (WM_USER + 102)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 #define XM_UNMAPFRAME (WM_USER + 103)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309 /*
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310 * Random globals
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 /* win32 "Windows" procedure */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 LRESULT WINAPI mswindows_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 LPARAM lParam);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 LRESULT WINAPI mswindows_control_wnd_proc (HWND hwnd,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317 UINT msg, WPARAM wParam,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 LPARAM lParam);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
320 void mswindows_redraw_exposed_area (struct frame *f, int x, int y,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321 int width, int height);
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
322 void mswindows_size_frame_internal (struct frame *f, XEMACS_RECT_WH *dest);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
323 HWND mswindows_get_selected_frame_hwnd (void);
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
324 void mswindows_enqueue_magic_event (HWND hwnd, UINT msg);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
325 int mswindows_is_dialog_msg (MSG *msg);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 /* win32 DDE management library */
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
328 #define MSWINDOWS_DDE_ITEM_OPEN "Open" /* WARNING: uses of this need XETEXT */
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329 extern DWORD mswindows_dde_mlid;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330 extern HSZ mswindows_dde_service;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 extern HSZ mswindows_dde_topic_system;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332 extern HSZ mswindows_dde_item_open;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333 HDDEDATA CALLBACK mswindows_dde_callback (UINT uType, UINT uFmt, HCONV hconv,
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
334 HSZ hszTopic, HSZ hszItem,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
335 HDDEDATA hdata,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336 DWORD dwData1, DWORD dwData2);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
338 void mswindows_enqueue_dispatch_event (Lisp_Object event);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 void mswindows_enqueue_misc_user_event (Lisp_Object channel,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 Lisp_Object function,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
341 Lisp_Object object);
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
342 Lisp_Object mswindows_cancel_dispatch_event (Lisp_Event *event);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343 Lisp_Object mswindows_pump_outstanding_events (void);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
344 Lisp_Object mswindows_protect_modal_loop (Lisp_Object (*bfun)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
345 (Lisp_Object barg),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346 Lisp_Object barg);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 void mswindows_unmodalize_signal_maybe (void);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
349 COLORREF mswindows_string_to_color (const Intbyte *name);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
350 USID emacs_mswindows_create_stream_pair (void *inhandle, void *outhandle,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
351 Lisp_Object *instream,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
352 Lisp_Object *outstream,
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
353 int flags);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
354 USID emacs_mswindows_delete_stream_pair (Lisp_Object instream,
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
355 Lisp_Object outstream);
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
356
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357 #ifdef HAVE_WIN32_PROCESSES
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
358 HANDLE get_nt_process_handle (Lisp_Process *p);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360
791
7b1f30330a19 [xemacs-hg @ 2002-03-21 18:55:01 by adrian]
adrian
parents: 771
diff changeset
361 void mswindows_unwait_process (Lisp_Process *p);
7b1f30330a19 [xemacs-hg @ 2002-03-21 18:55:01 by adrian]
adrian
parents: 771
diff changeset
362
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 extern Lisp_Object Vmswindows_frame_being_created;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364 extern Lisp_Object mswindows_frame_being_created;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
366 void mswindows_get_workspace_coords (RECT *rc);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
367
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
368 Lisp_Object mswindows_enumerate_fonts (HDC hdc);
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
370 int mswindows_char_is_accelerator (struct frame *f, Emchar ch);
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
371 Lisp_Object mswindows_translate_menu_or_dialog_item (Lisp_Object item,
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
372 Emchar *accel);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
373
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
374 #ifdef HAVE_TOOLBARS
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
375 Lisp_Object mswindows_get_toolbar_button_text (struct frame *f,
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
376 int command_id);
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
377 Lisp_Object mswindows_handle_toolbar_wm_command (struct frame *f,
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
378 HWND ctrl, WORD id);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
379 #endif
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
380 Lisp_Object mswindows_handle_gui_wm_command (struct frame *f,
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
381 HWND ctrl, LPARAM id);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
382
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
383 void mswindows_handle_destroyclipboard (void);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
384
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
385 Lisp_Object mswindows_handle_print_dialog_box (struct frame *f,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
386 Lisp_Object keys);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
387 Lisp_Object mswindows_handle_page_setup_dialog_box (struct frame *f,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
388 Lisp_Object keys);
506
39ccc7dd8077 [xemacs-hg @ 2001-05-05 08:39:59 by ben]
ben
parents: 442
diff changeset
389 int mswindows_get_default_margin (Lisp_Object prop);
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
390
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
391 void mswindows_register_popup_frame (Lisp_Object frame);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
392 void mswindows_unregister_popup_frame (Lisp_Object frame);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
393
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
394 void mswindows_destroy_selection (Lisp_Object selection);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
395
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
396 int mswindows_window_is_xemacs (HWND hwnd);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
397
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
398 Lisp_Object msprinter_default_printer (void);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
399
546
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 510
diff changeset
400 Lisp_Object mswindows_find_frame (HWND hwnd);
666d73d6ac56 [xemacs-hg @ 2001-05-20 01:17:07 by ben]
ben
parents: 510
diff changeset
401
771
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
402 #ifdef MULE
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
403 Lisp_Object mswindows_get_code_page_charset (int code_page);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
404 void mswindows_start_ime_composition (struct frame *f);
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
405 #endif /* MULE */
943eaba38521 [xemacs-hg @ 2002-03-13 08:51:24 by ben]
ben
parents: 665
diff changeset
406
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
407 struct mswindows_dialog_id
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
408 {
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
409 struct lcrecord_header header;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
410
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
411 Lisp_Object frame;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
412 Lisp_Object callbacks;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
413 HWND hwnd;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
414 };
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
415
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
416 DECLARE_LRECORD (mswindows_dialog_id, struct mswindows_dialog_id);
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
417 #define XMSWINDOWS_DIALOG_ID(x) XRECORD (x, mswindows_dialog_id, struct mswindows_dialog_id)
617
af57a77cbc92 [xemacs-hg @ 2001-06-18 07:09:50 by ben]
ben
parents: 586
diff changeset
418 #define wrap_mswindows_dialog_id(p) wrap_record (p, mswindows_dialog_id)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
419 #define MSWINDOWS_DIALOG_IDP(x) RECORDP (x, mswindows_dialog_id)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
420 #define CHECK_MSWINDOWS_DIALOG_ID(x) CHECK_RECORD (x, mswindows_dialog_id)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
421 #define CONCHECK_MSWINDOWS_DIALOG_ID(x) CONCHECK_RECORD (x, mswindows_dialog_id)
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
422
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 430
diff changeset
423 #endif /* INCLUDED_console_msw_h_ */