annotate src/device-msw.c @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents 8626e4521993
children a86b2b5e0111
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
296
5a79be0ef6a8 Import from CVS: tag r21-0b46
cvs
parents: 294
diff changeset
1 /* device functions for mswindows.
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
3 Copyright (C) 1994, 1995 Free Software Foundation, Inc.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
4
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
5 This file is part of XEmacs.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
6
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
7 XEmacs is free software; you can redistribute it and/or modify it
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
10 later version.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
11
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
15 for more details.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
16
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
18 along with XEmacs; see the file COPYING. If not, write to
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
20 Boston, MA 02111-1307, USA. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
21
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
22 /* Synched up with: Not in FSF. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
23
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
24 /* Authorship:
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
25
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
26 Original authors: Jamie Zawinski and the FSF
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
27 Rewritten by Ben Wing and Chuck Thompson.
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 269
diff changeset
28 Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0.
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
29 */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
30
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
31
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
32 #include <config.h>
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
33 #include "lisp.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
34
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
35 #include "console-msw.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
36 #include "console-stream.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
37 #include "events.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
38 #include "faces.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
39 #include "frame.h"
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
40 #include "sysdep.h"
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
41
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
42 #include <winspool.h>
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
43
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
44 /* win32 DDE management library globals */
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
45 #ifdef HAVE_DRAGNDROP
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
46 DWORD mswindows_dde_mlid;
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
47 HSZ mswindows_dde_service;
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
48 HSZ mswindows_dde_topic_system;
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
49 HSZ mswindows_dde_item_open;
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
50 #endif
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
51
263
727739f917cb Import from CVS: tag r20-5b30
cvs
parents: 249
diff changeset
52 /* Control conversion of upper case file names to lower case.
727739f917cb Import from CVS: tag r20-5b30
cvs
parents: 249
diff changeset
53 nil means no, t means yes. */
727739f917cb Import from CVS: tag r20-5b30
cvs
parents: 249
diff changeset
54 Lisp_Object Vmswindows_downcase_file_names;
727739f917cb Import from CVS: tag r20-5b30
cvs
parents: 249
diff changeset
55
727739f917cb Import from CVS: tag r20-5b30
cvs
parents: 249
diff changeset
56 /* Control whether stat() attempts to determine file type and link count
727739f917cb Import from CVS: tag r20-5b30
cvs
parents: 249
diff changeset
57 exactly, at the expense of slower operation. Since true hard links
727739f917cb Import from CVS: tag r20-5b30
cvs
parents: 249
diff changeset
58 are supported on NTFS volumes, this is only relevant on NT. */
727739f917cb Import from CVS: tag r20-5b30
cvs
parents: 249
diff changeset
59 Lisp_Object Vmswindows_get_true_file_attributes;
727739f917cb Import from CVS: tag r20-5b30
cvs
parents: 249
diff changeset
60
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
61 Lisp_Object Qinit_pre_mswindows_win, Qinit_post_mswindows_win;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
62
296
5a79be0ef6a8 Import from CVS: tag r21-0b46
cvs
parents: 294
diff changeset
63
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
64 /************************************************************************/
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
65 /* helpers */
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
66 /************************************************************************/
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
67
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
68 static Lisp_Object
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
69 build_syscolor_string (int idx)
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
70 {
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
71 DWORD clr;
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
72 char buf[16];
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
73
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
74 if (idx < 0)
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
75 return Qnil;
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
76
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
77 clr = GetSysColor (idx);
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
78 sprintf (buf, "#%02X%02X%02X",
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
79 GetRValue (clr),
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
80 GetGValue (clr),
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
81 GetBValue (clr));
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
82 return build_string (buf);
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
83 }
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
84
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
85 static Lisp_Object
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
86 build_syscolor_cons (int index1, int index2)
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
87 {
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
88 Lisp_Object color1, color2;
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
89 struct gcpro gcpro1;
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
90 GCPRO1 (color1);
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
91 color1 = build_syscolor_string (index1);
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
92 color2 = build_syscolor_string (index2);
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
93 RETURN_UNGCPRO (Fcons (color1, color2));
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
94 }
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
95
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
96 static Lisp_Object
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
97 build_sysmetrics_cons (int index1, int index2)
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
98 {
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
99 return Fcons (index1 < 0 ? Qnil : make_int (GetSystemMetrics (index1)),
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
100 index2 < 0 ? Qnil : make_int (GetSystemMetrics (index2)));
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
101 }
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
102
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
103 static Lisp_Object
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
104 build_devicecaps_cons (HDC hdc, int index1, int index2)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
105 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
106 return Fcons (index1 < 0 ? Qnil : make_int (GetDeviceCaps (hdc, index1)),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
107 index2 < 0 ? Qnil : make_int (GetDeviceCaps (hdc, index2)));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
108 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
109
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
110
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
111
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
112 /************************************************************************/
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
113 /* display methods */
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
114 /************************************************************************/
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
115
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
116 static void
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
117 mswindows_init_device (struct device *d, Lisp_Object props)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
118 {
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
119 WNDCLASSEX wc;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
120 HDC hdc;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
121
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
122 DEVICE_CLASS (d) = Qcolor;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
123 DEVICE_INFD (d) = DEVICE_OUTFD (d) = -1;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
124 init_baud_rate (d);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
125 init_one_device (d);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
126
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
127 d->device_data = xnew_and_zero (struct mswindows_device);
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
128 hdc = CreateCompatibleDC (NULL);
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
129 assert (hdc!=NULL);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
130 DEVICE_MSWINDOWS_LOGPIXELSX(d) = GetDeviceCaps(hdc, LOGPIXELSX);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
131 DEVICE_MSWINDOWS_LOGPIXELSY(d) = GetDeviceCaps(hdc, LOGPIXELSY);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
132 DEVICE_MSWINDOWS_PLANES(d) = GetDeviceCaps(hdc, PLANES);
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
133 /* #### SIZEPALETTE only valid if RC_PALETTE bit set in RASTERCAPS,
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
134 what should we return for a non-palette-based device? */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
135 DEVICE_MSWINDOWS_CELLS(d) = GetDeviceCaps(hdc, SIZEPALETTE);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
136 DEVICE_MSWINDOWS_HORZRES(d) = GetDeviceCaps(hdc, HORZRES);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
137 DEVICE_MSWINDOWS_VERTRES(d) = GetDeviceCaps(hdc, VERTRES);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
138 DEVICE_MSWINDOWS_HORZSIZE(d) = GetDeviceCaps(hdc, HORZSIZE);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
139 DEVICE_MSWINDOWS_VERTSIZE(d) = GetDeviceCaps(hdc, VERTSIZE);
267
966663fcf606 Import from CVS: tag r20-5b32
cvs
parents: 263
diff changeset
140 DEVICE_MSWINDOWS_BITSPIXEL(d) = GetDeviceCaps(hdc, BITSPIXEL);
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
141 DEVICE_MSWINDOWS_FONTLIST (d) = mswindows_enumerate_fonts (hdc);
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 361
diff changeset
142
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
143 DeleteDC (hdc);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
144
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 217
diff changeset
145 /* Register the main window class */
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
146 wc.cbSize = sizeof (WNDCLASSEX);
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 217
diff changeset
147 wc.style = CS_OWNDC; /* One DC per window */
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 217
diff changeset
148 wc.lpfnWndProc = (WNDPROC) mswindows_wnd_proc;
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 217
diff changeset
149 wc.cbClsExtra = 0;
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 217
diff changeset
150 wc.cbWndExtra = MSWINDOWS_WINDOW_EXTRA_BYTES;
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
151 /* This must match whatever is passed to CreateWIndowEx, NULL is ok
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
152 for this. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
153 wc.hInstance = NULL;
227
0e522484dd2a Import from CVS: tag r20-5b12
cvs
parents: 223
diff changeset
154 wc.hIcon = LoadIcon (GetModuleHandle(NULL), XEMACS_CLASS);
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 217
diff changeset
155 wc.hCursor = LoadCursor (NULL, IDC_ARROW);
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 217
diff changeset
156 /* Background brush is only used during sizing, when XEmacs cannot
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 217
diff changeset
157 take over */
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 217
diff changeset
158 wc.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1);
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 217
diff changeset
159 wc.lpszMenuName = NULL;
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 284
diff changeset
160
223
2c611d1463a6 Import from CVS: tag r20-4b10
cvs
parents: 217
diff changeset
161 wc.lpszClassName = XEMACS_CLASS;
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
162 wc.hIconSm = LoadImage (GetModuleHandle (NULL), XEMACS_CLASS,
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
163 IMAGE_ICON, 16, 16, 0);
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
164 RegisterClassEx (&wc);
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
165
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
166 #ifdef HAVE_WIDGETS
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
167 xzero (wc);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
168 /* Register the main window class */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
169 wc.cbSize = sizeof (WNDCLASSEX);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
170 wc.lpfnWndProc = (WNDPROC) mswindows_control_wnd_proc;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
171 wc.lpszClassName = XEMACS_CONTROL_CLASS;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
172 wc.hInstance = NULL;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
173 RegisterClassEx (&wc);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
174 #endif
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
175
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
176 #if defined (HAVE_TOOLBARS) || defined (HAVE_WIDGETS)
278
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 272
diff changeset
177 InitCommonControls ();
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 272
diff changeset
178 #endif
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
179 }
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
180
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
181 static void
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
182 mswindows_finish_init_device (struct device *d, Lisp_Object props)
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
183 {
380
8626e4521993 Import from CVS: tag r21-2-5
cvs
parents: 373
diff changeset
184 /* Initialize DDE management library and our related globals. We execute a
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
185 * dde Open("file") by simulating a drop, so this depends on dnd support. */
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
186 #ifdef HAVE_DRAGNDROP
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
187 mswindows_dde_mlid = 0;
278
90d73dddcdc4 Import from CVS: tag r21-0b37
cvs
parents: 272
diff changeset
188 DdeInitialize (&mswindows_dde_mlid, (PFNCALLBACK)mswindows_dde_callback,
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
189 APPCMD_FILTERINITS|CBF_FAIL_SELFCONNECTIONS|CBF_FAIL_ADVISES|
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
190 CBF_FAIL_POKES|CBF_FAIL_REQUESTS|CBF_SKIP_ALLNOTIFICATIONS, 0);
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
191
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
192 mswindows_dde_service = DdeCreateStringHandle (mswindows_dde_mlid, XEMACS_CLASS, 0);
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
193 mswindows_dde_topic_system = DdeCreateStringHandle (mswindows_dde_mlid, SZDDESYS_TOPIC, 0);
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
194 mswindows_dde_item_open = DdeCreateStringHandle (mswindows_dde_mlid,
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
195 TEXT(MSWINDOWS_DDE_ITEM_OPEN), 0);
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
196 DdeNameService (mswindows_dde_mlid, mswindows_dde_service, 0L, DNS_REGISTER);
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
197 #endif
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
198 }
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
199
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
200 static void
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
201 mswindows_delete_device (struct device *d)
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
202 {
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
203 #ifdef HAVE_DRAGNDROP
371
cc15677e0335 Import from CVS: tag r21-2b1
cvs
parents: 361
diff changeset
204 DdeNameService (mswindows_dde_mlid, 0L, 0L, DNS_REGISTER);
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
205 DdeUninitialize (mswindows_dde_mlid);
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
206 #endif
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
207
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
208 free (d->device_data);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
209 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
210
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
211 static void
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
212 mswindows_mark_device (struct device *d)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
213 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
214 mark_object (DEVICE_MSWINDOWS_FONTLIST (d));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
215 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
216
282
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
217 static Lisp_Object
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
218 mswindows_device_system_metrics (struct device *d,
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
219 enum device_metrics m)
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
220 {
282
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
221 switch (m)
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
222 {
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
223 case DM_size_device:
282
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
224 return Fcons (make_int (DEVICE_MSWINDOWS_HORZRES(d)),
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
225 make_int (DEVICE_MSWINDOWS_VERTRES(d)));
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
226 break;
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
227 case DM_device_dpi:
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
228 return Fcons (make_int (DEVICE_MSWINDOWS_LOGPIXELSX(d)),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
229 make_int (DEVICE_MSWINDOWS_LOGPIXELSY(d)));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
230 break;
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
231 case DM_size_device_mm:
282
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
232 return Fcons (make_int (DEVICE_MSWINDOWS_HORZSIZE(d)),
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
233 make_int (DEVICE_MSWINDOWS_VERTSIZE(d)));
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
234 break;
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
235 case DM_num_bit_planes:
288
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 284
diff changeset
236 /* this is what X means by bitplanes therefore we ought to be
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 284
diff changeset
237 consistent. num planes is always 1 under mswindows and
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 284
diff changeset
238 therefore useless */
e11d67e05968 Import from CVS: tag r21-0b42
cvs
parents: 284
diff changeset
239 return make_int (DEVICE_MSWINDOWS_BITSPIXEL(d));
282
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
240 break;
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
241 case DM_num_color_cells:
282
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
242 return make_int (DEVICE_MSWINDOWS_CELLS(d));
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
243 break;
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
244
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
245 /*** Colors ***/
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
246 #define FROB(met, index1, index2) \
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
247 case DM_##met: \
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
248 return build_syscolor_cons (index1, index2);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
249
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
250 FROB (color_default, COLOR_WINDOW, COLOR_WINDOWTEXT);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
251 FROB (color_select, COLOR_HIGHLIGHT, COLOR_HIGHLIGHTTEXT);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
252 FROB (color_balloon, COLOR_INFOBK, COLOR_INFOTEXT);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
253 FROB (color_3d_face, COLOR_3DFACE, COLOR_BTNTEXT);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
254 FROB (color_3d_light, COLOR_3DLIGHT, COLOR_3DHILIGHT);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
255 FROB (color_3d_dark, COLOR_3DSHADOW, COLOR_3DDKSHADOW);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
256 FROB (color_menu, COLOR_MENU, COLOR_MENUTEXT);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
257 FROB (color_menu_highlight, COLOR_HIGHLIGHT, COLOR_HIGHLIGHTTEXT);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
258 FROB (color_menu_button, COLOR_MENU, COLOR_MENUTEXT);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
259 FROB (color_menu_disabled, COLOR_MENU, COLOR_GRAYTEXT);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
260 FROB (color_toolbar, COLOR_BTNFACE, COLOR_BTNTEXT);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
261 FROB (color_scrollbar, COLOR_SCROLLBAR, COLOR_CAPTIONTEXT);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
262 FROB (color_desktop, -1, COLOR_DESKTOP);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
263 FROB (color_workspace, -1, COLOR_APPWORKSPACE);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
264 #undef FROB
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
265
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
266 /*** Sizes ***/
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
267 #define FROB(met, index1, index2) \
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
268 case DM_##met: \
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
269 return build_sysmetrics_cons (index1, index2);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
270
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
271 FROB (size_cursor, SM_CXCURSOR, SM_CYCURSOR);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
272 FROB (size_scrollbar, SM_CXVSCROLL, SM_CYHSCROLL);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
273 FROB (size_menu, -1, SM_CYMENU);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
274 FROB (size_icon, SM_CXICON, SM_CYICON);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
275 FROB (size_icon_small, SM_CXSMICON, SM_CYSMICON);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
276 #undef FROB
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
277
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
278 case DM_size_workspace:
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
279 {
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
280 RECT rc;
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
281 SystemParametersInfo (SPI_GETWORKAREA, 0, &rc, 0);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
282 return Fcons (make_int (rc.right - rc.left),
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
283 make_int (rc.bottom - rc.top));
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
284 }
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
285 /*
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
286 case DM_size_toolbar:
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
287 case DM_size_toolbar_button:
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
288 case DM_size_toolbar_border:
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
289 */
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
290
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
291 /*** Features ***/
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
292 #define FROB(met, index) \
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
293 case DM_##met: \
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
294 return make_int (GetSystemMetrics (index));
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
295
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
296 FROB (mouse_buttons, SM_CMOUSEBUTTONS);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
297 FROB (swap_buttons, SM_SWAPBUTTON);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
298 FROB (show_sounds, SM_SHOWSOUNDS);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
299 FROB (slow_device, SM_SLOWMACHINE);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
300 FROB (security, SM_SECURE);
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
301 #undef FROB
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
302
282
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
303 }
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
304
282
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
305 /* Do not know such property */
284
558f606b08ae Import from CVS: tag r21-0b40
cvs
parents: 282
diff changeset
306 return Qunbound;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
307 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
308
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
309 static unsigned int
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
310 mswindows_device_implementation_flags (void)
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
311 {
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
312 return XDEVIMPF_PIXEL_GEOMETRY;
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
313 }
294
4b85ae5eabfb Import from CVS: tag r21-0b45
cvs
parents: 288
diff changeset
314
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
315
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
316 /************************************************************************/
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
317 /* printer methods */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
318 /************************************************************************/
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
319
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
320 static void
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
321 signal_open_printer_error (struct device *d)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
322 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
323 signal_simple_error ("Failed to open printer", DEVICE_CONNECTION (d));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
324 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
325
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
326 static void
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
327 msprinter_init_device (struct device *d, Lisp_Object props)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
328 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
329 char* printer_name;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
330
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
331 DEVICE_INFD (d) = DEVICE_OUTFD (d) = -1;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
332
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
333 CHECK_STRING (DEVICE_CONNECTION (d));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
334
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
335 TO_EXTERNAL_FORMAT (LISP_STRING, DEVICE_CONNECTION (d),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
336 C_STRING_ALLOCA, printer_name,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
337 Qctext);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
338
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
339 d->device_data = xnew_and_zero (struct msprinter_device);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
340
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
341 DEVICE_MSPRINTER_NAME(d) = xstrdup (printer_name);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
342
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
343 if (!OpenPrinter (printer_name, &DEVICE_MSPRINTER_HPRINTER (d), NULL))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
344 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
345 DEVICE_MSPRINTER_HPRINTER (d) = NULL;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
346 signal_open_printer_error (d);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
347 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
348
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
349 DEVICE_MSPRINTER_HDC (d) = CreateDC ("WINSPOOL", printer_name,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
350 NULL, NULL);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
351 if (DEVICE_MSPRINTER_HDC (d) == NULL)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
352 signal_open_printer_error (d);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
353
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
354 /* Determinie DEVMODE size and store the default DEVMODE */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
355 DEVICE_MSPRINTER_DEVMODE_SIZE(d) =
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
356 DocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER(d),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
357 printer_name, NULL, NULL, 0);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
358 if (DEVICE_MSPRINTER_DEVMODE_SIZE(d) <= 0)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
359 signal_open_printer_error (d);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
360
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
361 DEVICE_MSPRINTER_DEVMODE(d) = xmalloc (DEVICE_MSPRINTER_DEVMODE_SIZE(d));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
362 DocumentProperties (NULL, DEVICE_MSPRINTER_HPRINTER(d),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
363 printer_name, DEVICE_MSPRINTER_DEVMODE(d),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
364 NULL, DM_OUT_BUFFER);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
365
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
366 /* We do not use printer fon list as we do with the display
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
367 device. Rather, we allow GDI to pick the closest match to the
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
368 display font. */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
369 DEVICE_MSPRINTER_FONTLIST (d) = Qnil;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
370
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
371 DEVICE_CLASS (d) = (GetDeviceCaps (DEVICE_MSPRINTER_HDC (d), BITSPIXEL)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
372 * GetDeviceCaps (DEVICE_MSPRINTER_HDC (d), PLANES)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
373 > 1) ? Qcolor : Qmono;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
374 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
375
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
376 static Lisp_Object
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
377 msprinter_device_system_metrics (struct device *d,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
378 enum device_metrics m)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
379 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
380 switch (m)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
381 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
382 /* Device sizes - pixel and mm */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
383 #define FROB(met, index1, index2) \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
384 case DM_##met: \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
385 return build_devicecaps_cons \
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
386 (DEVICE_MSPRINTER_HDC(d), index1, index2);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
387
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
388 FROB (size_device, PHYSICALWIDTH, PHYSICALHEIGHT);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
389 FROB (size_device_mm, HORZSIZE, VERTSIZE);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
390 FROB (size_workspace, HORZRES, VERTRES);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
391 FROB (offset_workspace, PHYSICALOFFSETX, PHYSICALOFFSETY);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
392 FROB (device_dpi, LOGPIXELSX, LOGPIXELSY);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
393 #undef FROB
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
394
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
395 case DM_num_bit_planes:
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
396 /* this is what X means by bitplanes therefore we ought to be
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
397 consistent. num planes is always 1 under mswindows and
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
398 therefore useless */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
399 return make_int (GetDeviceCaps (DEVICE_MSPRINTER_HDC(d), BITSPIXEL));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
400
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
401 case DM_num_color_cells: /* Prnters are non-palette devices */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
402 case DM_slow_device: /* Animation would be a really bad idea */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
403 case DM_security: /* Not provided by windows */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
404 return Qzero;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
405 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
406
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
407 /* Do not know such property */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
408 return Qunbound;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
409 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
410
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
411 static void
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
412 msprinter_delete_device (struct device *d)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
413 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
414 if (d->device_data)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
415 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
416 if (DEVICE_MSPRINTER_HPRINTER (d))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
417 ClosePrinter (DEVICE_MSPRINTER_HPRINTER (d));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
418 if (DEVICE_MSPRINTER_HDC (d))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
419 DeleteDC (DEVICE_MSPRINTER_HDC (d));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
420 if (DEVICE_MSPRINTER_NAME (d))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
421 free (DEVICE_MSPRINTER_NAME (d));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
422 if (DEVICE_MSPRINTER_DEVMODE (d))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
423 free (DEVICE_MSPRINTER_DEVMODE (d));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
424 if (DEVICE_MSPRINTER_DEVMODE_MIRROR (d))
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
425 free (DEVICE_MSPRINTER_DEVMODE_MIRROR (d));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
426
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
427 free (d->device_data);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
428 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
429 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
430
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
431 static void
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
432 msprinter_mark_device (struct device *d)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
433 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
434 mark_object (DEVICE_MSPRINTER_FONTLIST (d));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
435 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
436
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
437 static unsigned int
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
438 msprinter_device_implementation_flags (void)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
439 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
440 return ( XDEVIMPF_PIXEL_GEOMETRY
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
441 | XDEVIMPF_IS_A_PRINTER
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
442 | XDEVIMPF_NO_AUTO_REDISPLAY
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
443 | XDEVIMPF_FRAMELESS_OK );
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
444 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
445
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
446
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
447 /************************************************************************/
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
448 /* printer external functions */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
449 /************************************************************************/
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
450
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
451 /*
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
452 * Return a copy of default DEVMODE. The copy returned is in
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
453 * a static buffer which will be overwritten by next call.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
454 */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
455 DEVMODE*
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
456 msprinter_get_devmode_copy (struct device *d)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
457 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
458 assert (DEVICE_MSPRINTER_P (d));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
459
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
460 if (DEVICE_MSPRINTER_DEVMODE_MIRROR(d) == NULL)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
461 DEVICE_MSPRINTER_DEVMODE_MIRROR(d) =
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
462 xmalloc (DEVICE_MSPRINTER_DEVMODE_SIZE(d));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
463
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
464 memcpy (DEVICE_MSPRINTER_DEVMODE_MIRROR(d),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
465 DEVICE_MSPRINTER_DEVMODE(d),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
466 DEVICE_MSPRINTER_DEVMODE_SIZE(d));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
467
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
468 return DEVICE_MSPRINTER_DEVMODE_MIRROR(d);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
469 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
470
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
471 /*
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
472 * Apply settings from the DEVMODE. The settings are considered
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
473 * incremental to the default DEVMODE, so that changes in the
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
474 * passed structure supercede parameters of the printer.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
475 *
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
476 * The passed structure is overwritten by the fuction call;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
477 * complete printer settings are returned.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
478 */
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
479 void
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
480 msprinter_apply_devmode (struct device *d, DEVMODE *devmode)
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
481 {
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
482 assert (DEVICE_MSPRINTER_P (d));
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
483
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
484 DocumentProperties (NULL,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
485 DEVICE_MSPRINTER_HPRINTER(d),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
486 DEVICE_MSPRINTER_NAME(d),
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
487 devmode, devmode,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
488 DM_IN_BUFFER | DM_OUT_BUFFER);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
489
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
490 ResetDC (DEVICE_MSPRINTER_HDC (d), devmode);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
491 }
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
492
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
493
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
494 /************************************************************************/
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
495 /* initialization */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
496 /************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
497
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
498 void
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
499 syms_of_device_mswindows (void)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
500 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
501 defsymbol (&Qinit_pre_mswindows_win, "init-pre-mswindows-win");
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
502 defsymbol (&Qinit_post_mswindows_win, "init-post-mswindows-win");
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
503 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
504
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
505 void
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
506 console_type_create_device_mswindows (void)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
507 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
508 CONSOLE_HAS_METHOD (mswindows, init_device);
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
509 CONSOLE_HAS_METHOD (mswindows, finish_init_device);
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
510 CONSOLE_HAS_METHOD (mswindows, mark_device);
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 245
diff changeset
511 CONSOLE_HAS_METHOD (mswindows, delete_device);
282
c42ec1d1cded Import from CVS: tag r21-0b39
cvs
parents: 280
diff changeset
512 CONSOLE_HAS_METHOD (mswindows, device_system_metrics);
269
b2472a1930f2 Import from CVS: tag r20-5b33
cvs
parents: 267
diff changeset
513 CONSOLE_HAS_METHOD (mswindows, device_implementation_flags);
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
514
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
515 CONSOLE_HAS_METHOD (msprinter, init_device);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
516 CONSOLE_HAS_METHOD (msprinter, mark_device);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
517 CONSOLE_HAS_METHOD (msprinter, delete_device);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
518 CONSOLE_HAS_METHOD (msprinter, device_system_metrics);
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
519 CONSOLE_HAS_METHOD (msprinter, device_implementation_flags);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
520 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
521
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
522
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
523 void
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
524 vars_of_device_mswindows (void)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
525 {
398
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
526 DEFVAR_LISP ("mswindows-downcase-file-names", &Vmswindows_downcase_file_names /*
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
527 Non-nil means convert all-upper case file names to lower case.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
528 This applies when performing completions and file name expansion.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
529 */ );
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
530 Vmswindows_downcase_file_names = Qnil;
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
531
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
532 DEFVAR_LISP ("mswindows-get-true-file-attributes", &Vmswindows_get_true_file_attributes /*
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
533 Non-nil means determine accurate link count in file-attributes.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
534 This option slows down file-attributes noticeably, so is disabled by
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
535 default. Note that it is only useful for files on NTFS volumes,
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
536 where hard links are supported.
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
537 */ );
74fd4e045ea6 Import from CVS: tag r21-2-29
cvs
parents: 380
diff changeset
538 Vmswindows_get_true_file_attributes = Qnil;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
539 }