Mercurial > hg > xemacs-beta
comparison src/dialog-msw.c @ 771:943eaba38521
[xemacs-hg @ 2002-03-13 08:51:24 by ben]
The big ben-mule-21-5 check-in!
Various files were added and deleted. See CHANGES-ben-mule.
There are still some test suite failures. No crashes, though.
Many of the failures have to do with problems in the test suite itself
rather than in the actual code. I'll be addressing these in the next
day or so -- none of the test suite failures are at all critical.
Meanwhile I'll be trying to address the biggest issues -- i.e. build
or run failures, which will almost certainly happen on various platforms.
All comments should be sent to ben@xemacs.org -- use a Cc: if necessary
when sending to mailing lists. There will be pre- and post- tags,
something like
pre-ben-mule-21-5-merge-in, and
post-ben-mule-21-5-merge-in.
author | ben |
---|---|
date | Wed, 13 Mar 2002 08:54:06 +0000 |
parents | a307f9a2021d |
children | e38acbeb1cae |
comparison
equal
deleted
inserted
replaced
770:336a418893b5 | 771:943eaba38521 |
---|---|
1 /* Implements elisp-programmable dialog boxes -- MS Windows interface. | 1 /* Implements elisp-programmable dialog boxes -- MS Windows interface. |
2 Copyright (C) 1998 Kirill M. Katsnelson <kkm@kis.ru> | 2 Copyright (C) 1998 Kirill M. Katsnelson <kkm@kis.ru> |
3 Copyright (C) 2000 Ben Wing. | 3 Copyright (C) 2000, 2001, 2002 Ben Wing. |
4 | 4 |
5 This file is part of XEmacs. | 5 This file is part of XEmacs. |
6 | 6 |
7 XEmacs is free software; you can redistribute it and/or modify it | 7 XEmacs is free software; you can redistribute it and/or modify it |
8 under the terms of the GNU General Public License as published by the | 8 under the terms of the GNU General Public License as published by the |
18 along with XEmacs; see the file COPYING. If not, write to | 18 along with XEmacs; see the file COPYING. If not, write to |
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
20 Boston, MA 02111-1307, USA. */ | 20 Boston, MA 02111-1307, USA. */ |
21 | 21 |
22 /* Synched up with: Not in FSF. */ | 22 /* Synched up with: Not in FSF. */ |
23 | |
24 /* This file essentially Mule-ized (except perhaps some Unicode splitting). | |
25 5-2000. */ | |
23 | 26 |
24 /* Author: | 27 /* Author: |
25 Initially written by kkm, May 1998 | 28 Initially written by kkm, May 1998 |
26 */ | 29 */ |
27 | 30 |
32 #include "console-msw.h" | 35 #include "console-msw.h" |
33 #include "frame.h" | 36 #include "frame.h" |
34 #include "gui.h" | 37 #include "gui.h" |
35 #include "opaque.h" | 38 #include "opaque.h" |
36 | 39 |
37 #include <cderr.h> | 40 #include "sysfile.h" |
38 #include <commdlg.h> | |
39 | 41 |
40 Lisp_Object Qdialog_box_error; | 42 Lisp_Object Qdialog_box_error; |
41 | 43 |
42 static Lisp_Object Q_initial_directory; | 44 static Lisp_Object Q_initial_directory; |
43 static Lisp_Object Q_initial_filename; | 45 static Lisp_Object Q_initial_filename; |
146 int | 148 int |
147 mswindows_is_dialog_msg (MSG *msg) | 149 mswindows_is_dialog_msg (MSG *msg) |
148 { | 150 { |
149 LIST_LOOP_2 (data, Vdialog_data_list) | 151 LIST_LOOP_2 (data, Vdialog_data_list) |
150 { | 152 { |
151 if (IsDialogMessage (XMSWINDOWS_DIALOG_ID (data)->hwnd, msg)) | 153 if (qxeIsDialogMessage (XMSWINDOWS_DIALOG_ID (data)->hwnd, msg)) |
152 return 1; | 154 return 1; |
153 } | 155 } |
154 | 156 |
155 { | 157 { |
156 LIST_LOOP_2 (popup, Vpopup_frame_list) | 158 LIST_LOOP_2 (popup, Vpopup_frame_list) |
157 { | 159 { |
158 HWND hwnd = FRAME_MSWINDOWS_HANDLE (XFRAME (popup)); | 160 HWND hwnd = FRAME_MSWINDOWS_HANDLE (XFRAME (popup)); |
159 /* This is a windows feature that allows dialog type | 161 /* This is a windows feature that allows dialog type |
160 processing to be applied to standard windows containing | 162 processing to be applied to standard windows containing |
161 controls. */ | 163 controls. */ |
162 if (IsDialogMessage (hwnd, msg)) | 164 if (qxeIsDialogMessage (hwnd, msg)) |
163 return 1; | 165 return 1; |
164 } | 166 } |
165 } | 167 } |
166 return 0; | 168 return 0; |
167 } | 169 } |
184 dialog_proc (HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param) | 186 dialog_proc (HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param) |
185 { | 187 { |
186 switch (msg) | 188 switch (msg) |
187 { | 189 { |
188 case WM_INITDIALOG: | 190 case WM_INITDIALOG: |
189 SetWindowLong (hwnd, DWL_USER, l_param); | 191 qxeSetWindowLong (hwnd, DWL_USER, l_param); |
190 break; | 192 break; |
191 | 193 |
192 case WM_DESTROY: | 194 case WM_DESTROY: |
193 { | 195 { |
194 Lisp_Object data; | 196 Lisp_Object data; |
195 VOID_TO_LISP (data, GetWindowLong (hwnd, DWL_USER)); | 197 VOID_TO_LISP (data, qxeGetWindowLong (hwnd, DWL_USER)); |
196 Vdialog_data_list = delq_no_quit (data, Vdialog_data_list); | 198 Vdialog_data_list = delq_no_quit (data, Vdialog_data_list); |
197 } | 199 } |
198 break; | 200 break; |
199 | 201 |
200 case WM_COMMAND: | 202 case WM_COMMAND: |
201 { | 203 { |
202 Lisp_Object fn, arg, data; | 204 Lisp_Object fn, arg, data; |
203 struct mswindows_dialog_id *did; | 205 struct mswindows_dialog_id *did; |
204 | 206 |
205 VOID_TO_LISP (data, GetWindowLong (hwnd, DWL_USER)); | 207 VOID_TO_LISP (data, qxeGetWindowLong (hwnd, DWL_USER)); |
206 did = XMSWINDOWS_DIALOG_ID (data); | 208 did = XMSWINDOWS_DIALOG_ID (data); |
207 if (w_param != IDCANCEL) /* user pressed escape */ | 209 if (w_param != IDCANCEL) /* user pressed escape */ |
208 { | 210 { |
209 assert (w_param >= ID_ITEM_BIAS | 211 assert (w_param >= ID_ITEM_BIAS |
210 && (EMACS_INT) w_param | 212 && (EMACS_INT) w_param |
217 } | 219 } |
218 else | 220 else |
219 mswindows_enqueue_misc_user_event (did->frame, Qrun_hooks, | 221 mswindows_enqueue_misc_user_event (did->frame, Qrun_hooks, |
220 Qmenu_no_selection_hook); | 222 Qmenu_no_selection_hook); |
221 /* #### need to error-protect! will do so when i merge in | 223 /* #### need to error-protect! will do so when i merge in |
222 my working ws */ | 224 my stderr-proc ws */ |
223 va_run_hook_with_args (Qdelete_dialog_box_hook, 1, data); | 225 va_run_hook_with_args (Qdelete_dialog_box_hook, 1, data); |
224 | 226 |
225 DestroyWindow (hwnd); | 227 DestroyWindow (hwnd); |
226 } | 228 } |
227 break; | 229 break; |
233 } | 235 } |
234 | 236 |
235 /* Helper function which converts the supplied string STRING into Unicode and | 237 /* Helper function which converts the supplied string STRING into Unicode and |
236 pushes it at the end of DYNARR */ | 238 pushes it at the end of DYNARR */ |
237 static void | 239 static void |
238 push_lisp_string_as_unicode (unsigned_char_dynarr* dynarr, Lisp_Object string) | 240 push_lisp_string_as_unicode (unsigned_char_dynarr *dynarr, Lisp_Object string) |
239 { | 241 { |
240 Extbyte *mbcs_string; | 242 int length; |
241 Charcount length = XSTRING_CHAR_LENGTH (string); | 243 Extbyte *uni_string; |
242 LPWSTR uni_string; | |
243 | 244 |
244 TO_EXTERNAL_FORMAT (LISP_STRING, string, | 245 TO_EXTERNAL_FORMAT (LISP_STRING, string, |
245 C_STRING_ALLOCA, mbcs_string, | 246 ALLOCA, (uni_string, length), |
246 Qnative); | 247 Qmswindows_unicode); |
247 uni_string = alloca_array (WCHAR, length + 1); | 248 Dynarr_add_many (dynarr, uni_string, length); |
248 length = MultiByteToWideChar (CP_ACP, 0, mbcs_string, -1, | 249 Dynarr_add (dynarr, '\0'); |
249 uni_string, sizeof(WCHAR) * (length + 1)); | 250 Dynarr_add (dynarr, '\0'); |
250 Dynarr_add_many (dynarr, uni_string, sizeof(WCHAR) * length); | |
251 } | |
252 | |
253 /* Helper function which converts the supplied string STRING into Unicode and | |
254 pushes it at the end of DYNARR */ | |
255 static void | |
256 push_intbyte_string_as_unicode (unsigned_char_dynarr* dynarr, Intbyte *string, | |
257 Bytecount len) | |
258 { | |
259 Extbyte *mbcs_string; | |
260 Charcount length = bytecount_to_charcount (string, len); | |
261 LPWSTR uni_string; | |
262 | |
263 TO_EXTERNAL_FORMAT (C_STRING, string, | |
264 C_STRING_ALLOCA, mbcs_string, | |
265 Qnative); | |
266 uni_string = alloca_array (WCHAR, length + 1); | |
267 length = MultiByteToWideChar (CP_ACP, 0, mbcs_string, -1, | |
268 uni_string, sizeof(WCHAR) * (length + 1)); | |
269 Dynarr_add_many (dynarr, uni_string, sizeof(WCHAR) * length); | |
270 } | 251 } |
271 | 252 |
272 /* Given button TEXT, return button width in DLU */ | 253 /* Given button TEXT, return button width in DLU */ |
273 static int | 254 static int |
274 button_width (Lisp_Object text) | 255 button_width (Lisp_Object text) |
275 { | 256 { |
276 int width = X_DLU_PER_CHAR * XSTRING_CHAR_LENGTH (text); | 257 /* !!#### do Japanese chars count as two? */ |
258 int width = | |
259 X_DLU_PER_CHAR * | |
260 intbyte_string_displayed_columns (XSTRING_DATA (text), | |
261 XSTRING_LENGTH (text)); | |
277 return max (X_MIN_BUTTON, width); | 262 return max (X_MIN_BUTTON, width); |
278 } | 263 } |
279 | 264 |
280 /* Unwind protection routine frees a dynarr opaqued into arg */ | 265 /* Unwind protection routine frees a dynarr opaqued into arg */ |
281 static Lisp_Object | 266 static Lisp_Object |
288 /* Unwind protection decrements dialog count */ | 273 /* Unwind protection decrements dialog count */ |
289 static Lisp_Object | 274 static Lisp_Object |
290 dialog_popped_down (Lisp_Object arg) | 275 dialog_popped_down (Lisp_Object arg) |
291 { | 276 { |
292 popup_up_p--; | 277 popup_up_p--; |
278 return Qnil; | |
293 } | 279 } |
294 | 280 |
295 | 281 |
296 #define ALIGN_TEMPLATE \ | 282 #define ALIGN_TEMPLATE \ |
297 { \ | 283 { \ |
301 } | 287 } |
302 | 288 |
303 static struct | 289 static struct |
304 { | 290 { |
305 DWORD errmess; | 291 DWORD errmess; |
306 char *errname; | 292 Char_ASCII *errname; |
307 } common_dialog_errors[] = | 293 } common_dialog_errors[] = |
308 { | 294 { |
309 { CDERR_DIALOGFAILURE, "CDERR_DIALOGFAILURE" }, | 295 { CDERR_DIALOGFAILURE, "CDERR_DIALOGFAILURE" }, |
310 { CDERR_FINDRESFAILURE, "CDERR_FINDRESFAILURE" }, | 296 { CDERR_FINDRESFAILURE, "CDERR_FINDRESFAILURE" }, |
311 { CDERR_INITIALIZATION, "CDERR_INITIALIZATION" }, | 297 { CDERR_INITIALIZATION, "CDERR_INITIALIZATION" }, |
337 { FNERR_INVALIDFILENAME, "FNERR_INVALIDFILENAME" }, | 323 { FNERR_INVALIDFILENAME, "FNERR_INVALIDFILENAME" }, |
338 { FNERR_SUBCLASSFAILURE, "FNERR_SUBCLASSFAILURE" }, | 324 { FNERR_SUBCLASSFAILURE, "FNERR_SUBCLASSFAILURE" }, |
339 { FRERR_BUFFERLENGTHZERO, "FRERR_BUFFERLENGTHZERO" }, | 325 { FRERR_BUFFERLENGTHZERO, "FRERR_BUFFERLENGTHZERO" }, |
340 }; | 326 }; |
341 | 327 |
342 struct param_data { | 328 struct param_data |
343 char* fname; | 329 { |
344 char* unknown_fname; | 330 Extbyte *fname; |
331 Extbyte *unknown_fname; | |
345 int validate; | 332 int validate; |
346 }; | 333 }; |
347 | 334 |
348 static int | 335 static int |
349 CALLBACK handle_directory_proc (HWND hwnd, UINT msg, | 336 CALLBACK handle_directory_proc (HWND hwnd, UINT msg, |
350 LPARAM lParam, LPARAM lpData) | 337 LPARAM lParam, LPARAM lpData) |
351 { | 338 { |
352 TCHAR szDir[MAX_PATH]; | 339 Extbyte szDir[MAX_PATH * MAX_XETCHAR_SIZE]; |
353 struct param_data* pd = (struct param_data*)lpData; | 340 struct param_data *pd = (struct param_data *) lpData; |
354 | 341 |
355 switch(msg) { | 342 switch (msg) |
356 case BFFM_INITIALIZED: | 343 { |
357 // WParam is TRUE since you are passing a path. | 344 case BFFM_INITIALIZED: |
358 // It would be FALSE if you were passing a pidl. | 345 /* WParam is TRUE since you are passing a path. |
359 SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)pd->fname); | 346 It would be FALSE if you were passing a pidl. */ |
360 break; | 347 qxeSendMessage (hwnd, BFFM_SETSELECTION, TRUE, (LPARAM) pd->fname); |
361 | 348 break; |
362 case BFFM_SELCHANGED: | 349 |
363 // Set the status window to the currently selected path. | 350 case BFFM_SELCHANGED: |
364 if (SHGetPathFromIDList((LPITEMIDLIST) lParam, szDir)) { | 351 /* Set the status window to the currently selected path. */ |
365 SendMessage(hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM)szDir); | 352 if (qxeSHGetPathFromIDList ((LPITEMIDLIST) lParam, szDir)) |
353 qxeSendMessage (hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM) szDir); | |
354 break; | |
355 | |
356 case BFFM_VALIDATEFAILED: | |
357 if (pd->validate) | |
358 return TRUE; | |
359 else | |
360 pd->unknown_fname = xetcsdup ((Extbyte *) lParam); | |
361 break; | |
362 | |
363 default: | |
364 break; | |
366 } | 365 } |
367 break; | |
368 | |
369 case BFFM_VALIDATEFAILED: | |
370 if (pd->validate) | |
371 return TRUE; | |
372 else | |
373 pd->unknown_fname = xstrdup((char*)lParam); | |
374 break; | |
375 | |
376 default: | |
377 break; | |
378 } | |
379 return 0; | 366 return 0; |
380 } | 367 } |
381 | 368 |
382 static Lisp_Object | 369 static Lisp_Object |
383 handle_directory_dialog_box (struct frame *f, Lisp_Object keys) | 370 handle_directory_dialog_box (struct frame *f, Lisp_Object keys) |
384 { | 371 { |
385 Lisp_Object ret = Qnil; | 372 Lisp_Object ret = Qnil; |
386 BROWSEINFO bi; | 373 BROWSEINFOW bi; |
387 LPITEMIDLIST pidl; | 374 LPITEMIDLIST pidl; |
388 LPMALLOC pMalloc; | 375 LPMALLOC pMalloc; |
389 struct param_data pd; | 376 struct param_data pd; |
390 | 377 |
391 xzero(pd); | 378 xzero (pd); |
392 xzero(bi); | 379 xzero (bi); |
393 | 380 |
394 bi.lParam = (LPARAM)&pd; | 381 bi.lParam = (LPARAM) &pd; |
395 bi.hwndOwner = FRAME_MSWINDOWS_HANDLE (f); | 382 bi.hwndOwner = FRAME_MSWINDOWS_HANDLE (f); |
396 bi.pszDisplayName = 0; | 383 bi.pszDisplayName = 0; |
397 bi.pidlRoot = 0; | 384 bi.pidlRoot = 0; |
398 bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT | BIF_EDITBOX; | 385 bi.ulFlags = |
386 BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT | BIF_EDITBOX | BIF_NEWDIALOGSTYLE; | |
399 bi.lpfn = handle_directory_proc; | 387 bi.lpfn = handle_directory_proc; |
400 | 388 |
401 LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (build_string (""), Qnil), | 389 LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (build_string (""), Qnil), |
402 (char*)pd.fname); | 390 pd.fname); |
403 | 391 |
404 { | 392 { |
405 EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys) | 393 EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys) |
406 { | 394 { |
407 if (EQ (key, Q_title)) | 395 if (EQ (key, Q_title)) |
408 { | 396 { |
414 pd.fname); | 402 pd.fname); |
415 else if (EQ (key, Q_initial_filename)) | 403 else if (EQ (key, Q_initial_filename)) |
416 ; /* do nothing */ | 404 ; /* do nothing */ |
417 else if (EQ (key, Q_file_must_exist)) | 405 else if (EQ (key, Q_file_must_exist)) |
418 { | 406 { |
419 if (!NILP (value)) { | 407 if (!NILP (value)) |
420 pd.validate = TRUE; | 408 { |
421 bi.ulFlags |= BIF_VALIDATE; | 409 pd.validate = TRUE; |
422 } | 410 bi.ulFlags |= BIF_VALIDATE; |
411 } | |
423 else | 412 else |
424 bi.ulFlags &= ~BIF_VALIDATE; | 413 bi.ulFlags &= ~BIF_VALIDATE; |
425 } | 414 } |
426 else | 415 else |
427 invalid_constant ("Unrecognized directory-dialog keyword", key); | 416 invalid_constant ("Unrecognized directory-dialog keyword", key); |
428 } | 417 } |
429 } | 418 } |
430 | 419 |
431 if (SHGetMalloc(&pMalloc) == NOERROR) | 420 if (SHGetMalloc (&pMalloc) == NOERROR) |
432 { | 421 { |
433 pidl = SHBrowseForFolder(&bi); | 422 pidl = qxeSHBrowseForFolder (&bi); |
434 if (pidl) { | 423 if (pidl) |
435 TCHAR* szDir = alloca (MAX_PATH); | 424 { |
436 | 425 Extbyte *szDir = alloca_extbytes (MAX_PATH * MAX_XETCHAR_SIZE); |
437 if (SHGetPathFromIDList(pidl, szDir)) { | 426 |
438 ret = tstr_to_local_file_format (szDir); | 427 if (qxeSHGetPathFromIDList (pidl, szDir)) |
428 ret = tstr_to_local_file_format (szDir); | |
429 | |
430 XECOMCALL1 (pMalloc, Free, pidl); | |
431 XECOMCALL0 (pMalloc, Release); | |
432 return ret; | |
439 } | 433 } |
440 | 434 else if (pd.unknown_fname != 0) |
441 pMalloc->lpVtbl->Free(pMalloc, pidl); | 435 { |
442 pMalloc->lpVtbl->Release(pMalloc); | 436 ret = tstr_to_local_file_format (pd.unknown_fname); |
443 return ret; | 437 xfree (pd.unknown_fname); |
444 } | 438 } |
445 else if (pd.unknown_fname != 0) { | |
446 ret = tstr_to_local_file_format (pd.unknown_fname); | |
447 xfree(pd.unknown_fname); | |
448 } | |
449 else while (1) | 439 else while (1) |
450 signal_quit (); | 440 signal_quit (); |
451 } | 441 } |
452 else | 442 else |
453 signal_error (Qdialog_box_error, | 443 signal_error (Qdialog_box_error, |
457 } | 447 } |
458 | 448 |
459 static Lisp_Object | 449 static Lisp_Object |
460 handle_file_dialog_box (struct frame *f, Lisp_Object keys) | 450 handle_file_dialog_box (struct frame *f, Lisp_Object keys) |
461 { | 451 { |
462 OPENFILENAME ofn; | 452 OPENFILENAMEW ofn; |
463 | 453 Extbyte fnbuf[8000]; |
464 char fnbuf[8000]; | 454 |
465 | |
466 xzero (ofn); | 455 xzero (ofn); |
467 ofn.lStructSize = sizeof (ofn); | 456 ofn.lStructSize = sizeof (ofn); |
468 ofn.Flags = OFN_EXPLORER; | 457 ofn.Flags = OFN_EXPLORER; |
469 ofn.hwndOwner = FRAME_MSWINDOWS_HANDLE (f); | 458 ofn.hwndOwner = FRAME_MSWINDOWS_HANDLE (f); |
470 ofn.lpstrFile = fnbuf; | 459 ofn.lpstrFile = (XELPTSTR) fnbuf; |
471 ofn.nMaxFile = sizeof (fnbuf) / XETCHAR_SIZE; | 460 ofn.nMaxFile = sizeof (fnbuf) / XETCHAR_SIZE; |
472 xetcscpy (fnbuf, XETEXT ("")); | 461 xetcscpy (fnbuf, XETEXT ("")); |
473 | 462 |
474 LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (build_string (""), Qnil), | 463 LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (build_string (""), Qnil), |
475 ofn.lpstrInitialDir); | 464 ofn.lpstrInitialDir); |
476 | 465 |
477 { | 466 { |
478 EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys) | 467 EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys) |
479 { | 468 { |
480 if (EQ (key, Q_initial_filename)) | 469 if (EQ (key, Q_initial_filename)) |
481 { | 470 { |
482 Extbyte *fnout; | 471 Extbyte *fnout; |
483 | 472 |
484 CHECK_STRING (value); | 473 CHECK_STRING (value); |
485 LOCAL_FILE_FORMAT_TO_TSTR (value, fnout); | 474 LOCAL_FILE_FORMAT_TO_TSTR (value, fnout); |
486 xetcscpy (fnbuf, fnout); | 475 xetcscpy (fnbuf, fnout); |
487 } | 476 } |
488 else if (EQ (key, Q_title)) | 477 else if (EQ (key, Q_title)) |
489 { | 478 { |
490 CHECK_STRING (value); | 479 CHECK_STRING (value); |
491 LISP_STRING_TO_EXTERNAL (value, ofn.lpstrTitle, Qmswindows_tstr); | 480 LISP_STRING_TO_TSTR (value, ofn.lpstrTitle); |
492 } | 481 } |
493 else if (EQ (key, Q_initial_directory)) | 482 else if (EQ (key, Q_initial_directory)) |
494 LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (value, Qnil), | 483 LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (value, Qnil), |
495 ofn.lpstrInitialDir); | 484 ofn.lpstrInitialDir); |
496 else if (EQ (key, Q_file_must_exist)) | 485 else if (EQ (key, Q_file_must_exist)) |
502 } | 491 } |
503 else | 492 else |
504 invalid_constant ("Unrecognized file-dialog keyword", key); | 493 invalid_constant ("Unrecognized file-dialog keyword", key); |
505 } | 494 } |
506 } | 495 } |
507 | 496 |
508 if (!GetOpenFileName (&ofn)) | 497 if (!qxeGetOpenFileName (&ofn)) |
509 { | 498 { |
510 DWORD err = CommDlgExtendedError (); | 499 DWORD err = CommDlgExtendedError (); |
511 if (!err) | 500 if (!err) |
512 { | 501 { |
513 while (1) | 502 while (1) |
514 signal_quit (); | 503 signal_quit (); |
515 } | 504 } |
516 else | 505 else |
517 { | 506 { |
518 int i; | 507 int i; |
519 | 508 |
520 for (i = 0; i < countof (common_dialog_errors); i++) | 509 for (i = 0; i < countof (common_dialog_errors); i++) |
521 { | 510 { |
522 if (common_dialog_errors[i].errmess == err) | 511 if (common_dialog_errors[i].errmess == err) |
523 signal_error (Qdialog_box_error, | 512 signal_error (Qdialog_box_error, |
524 "Creating file-dialog-box", | 513 "Creating file-dialog-box", |
525 build_string | 514 build_msg_string |
526 (common_dialog_errors[i].errname)); | 515 (common_dialog_errors[i].errname)); |
527 } | 516 } |
528 | 517 |
529 signal_error (Qdialog_box_error, | 518 signal_error (Qdialog_box_error, |
530 "Unknown common dialog box error???", | 519 "Unknown common dialog box error???", |
531 make_int (err)); | 520 make_int (err)); |
532 } | 521 } |
533 } | 522 } |
534 | 523 |
535 return tstr_to_local_file_format (ofn.lpstrFile); | 524 return tstr_to_local_file_format ((Extbyte *) ofn.lpstrFile); |
536 } | 525 } |
537 | 526 |
538 static Lisp_Object | 527 static Lisp_Object |
539 handle_question_dialog_box (struct frame *f, Lisp_Object keys) | 528 handle_question_dialog_box (struct frame *f, Lisp_Object keys) |
540 { | 529 { |
541 Lisp_Object_dynarr *dialog_items = Dynarr_new (Lisp_Object); | 530 Lisp_Object_dynarr *dialog_items = Dynarr_new (Lisp_Object); |
542 unsigned_char_dynarr *template_ = Dynarr_new (unsigned_char); | 531 unsigned_char_dynarr *template_ = Dynarr_new (unsigned_char); |
543 int button_row_width = 0; | 532 int button_row_width = 0; |
544 int text_width, text_height; | 533 int text_width, text_height; |
545 Lisp_Object question = Qnil, title = Qnil; | 534 Lisp_Object question = Qnil, title = Qnil; |
546 | 535 |
547 int unbind_count = specpdl_depth (); | 536 int unbind_count = specpdl_depth (); |
548 record_unwind_protect (free_dynarr_opaque_ptr, | 537 record_unwind_protect (free_dynarr_opaque_ptr, |
549 make_opaque_ptr (dialog_items)); | 538 make_opaque_ptr (dialog_items)); |
550 record_unwind_protect (free_dynarr_opaque_ptr, | 539 record_unwind_protect (free_dynarr_opaque_ptr, |
551 make_opaque_ptr (template_)); | 540 make_opaque_ptr (template_)); |
552 | 541 |
553 /* A big NO NEED to GCPRO gui_items stored in the array: they are just | 542 /* A big NO NEED to GCPRO gui_items stored in the array: they are just |
554 pointers into KEYS list, which is GC-protected by the caller */ | 543 pointers into KEYS list, which is GC-protected by the caller */ |
555 | 544 |
556 { | 545 { |
557 EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys) | 546 EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys) |
558 { | 547 { |
559 if (EQ (key, Q_question)) | 548 if (EQ (key, Q_question)) |
560 { | 549 { |
567 title = value; | 556 title = value; |
568 } | 557 } |
569 else if (EQ (key, Q_buttons)) | 558 else if (EQ (key, Q_buttons)) |
570 { | 559 { |
571 Lisp_Object item_cons; | 560 Lisp_Object item_cons; |
572 | 561 |
573 /* Parse each item in the dialog into gui_item structs, | 562 /* Parse each item in the dialog into gui_item structs, |
574 and stuff a dynarr of these. Calculate button row width | 563 and stuff a dynarr of these. Calculate button row width |
575 in this loop too */ | 564 in this loop too */ |
576 EXTERNAL_LIST_LOOP (item_cons, value) | 565 EXTERNAL_LIST_LOOP (item_cons, value) |
577 { | 566 { |
582 Dynarr_add (dialog_items, gitem); | 571 Dynarr_add (dialog_items, gitem); |
583 button_row_width += button_width (XGUI_ITEM (gitem)->name) | 572 button_row_width += button_width (XGUI_ITEM (gitem)->name) |
584 + X_BUTTON_MARGIN; | 573 + X_BUTTON_MARGIN; |
585 } | 574 } |
586 } | 575 } |
587 | 576 |
588 button_row_width -= X_BUTTON_MARGIN; | 577 button_row_width -= X_BUTTON_MARGIN; |
589 } | 578 } |
590 else | 579 else |
591 invalid_constant ("Unrecognized question-dialog keyword", key); | 580 invalid_constant ("Unrecognized question-dialog keyword", key); |
592 } | 581 } |
593 } | 582 } |
594 | 583 |
595 if (Dynarr_length (dialog_items) == 0) | 584 if (Dynarr_length (dialog_items) == 0) |
596 sferror ("Dialog descriptor provides no buttons", keys); | 585 sferror ("Dialog descriptor provides no buttons", keys); |
597 | 586 |
598 if (NILP (question)) | 587 if (NILP (question)) |
599 sferror ("Dialog descriptor provides no question", keys); | 588 sferror ("Dialog descriptor provides no question", keys); |
600 | 589 |
601 /* Determine the final width layout */ | 590 /* Determine the final width layout */ |
602 { | 591 { |
603 Intbyte *p = XSTRING_DATA (question); | 592 Intbyte *p = XSTRING_DATA (question); |
604 Charcount string_max = 0, this_length = 0; | 593 Charcount string_max = 0, this_length = 0; |
605 while (1) | 594 while (1) |
612 string_max = max (this_length, string_max); | 601 string_max = max (this_length, string_max); |
613 this_length = 0; | 602 this_length = 0; |
614 } | 603 } |
615 else | 604 else |
616 ++this_length; | 605 ++this_length; |
617 | 606 |
618 if (ch == (Emchar)'\0') | 607 if (ch == (Emchar)'\0') |
619 break; | 608 break; |
620 } | 609 } |
621 | 610 |
622 if (string_max * X_DLU_PER_CHAR > max (X_MAX_TEXT, button_row_width)) | 611 if (string_max * X_DLU_PER_CHAR > max (X_MAX_TEXT, button_row_width)) |
623 text_width = X_AVE_TEXT; | 612 text_width = X_AVE_TEXT; |
624 else if (string_max * X_DLU_PER_CHAR < X_MIN_TEXT) | 613 else if (string_max * X_DLU_PER_CHAR < X_MIN_TEXT) |
625 text_width = X_MIN_TEXT; | 614 text_width = X_MIN_TEXT; |
626 else | 615 else |
646 char_pos = 0; | 635 char_pos = 0; |
647 } | 636 } |
648 } | 637 } |
649 text_height = Y_TEXT_MARGIN + Y_DLU_PER_CHAR * num_lines; | 638 text_height = Y_TEXT_MARGIN + Y_DLU_PER_CHAR * num_lines; |
650 } | 639 } |
651 | 640 |
652 /* Ok, now we are ready to stuff the dialog template and lay out controls */ | 641 /* Ok, now we are ready to stuff the dialog template and lay out controls */ |
653 { | 642 { |
654 DLGTEMPLATE dlg_tem; | 643 DLGTEMPLATE dlg_tem; |
655 DLGITEMTEMPLATE item_tem; | 644 DLGITEMTEMPLATE item_tem; |
656 int i; | 645 int i; |
657 const unsigned int zeroes = 0; | 646 const unsigned int zeroes = 0; |
658 const unsigned int ones = 0xFFFFFFFF; | 647 const unsigned int ones = 0xFFFFFFFF; |
659 const WORD static_class_id = 0x0082; | 648 const WORD static_class_id = 0x0082; |
660 const WORD button_class_id = 0x0080; | 649 const WORD button_class_id = 0x0080; |
661 | 650 |
662 /* Create and stuff in DLGTEMPLATE header */ | 651 /* Create and stuff in DLGTEMPLATE header */ |
663 dlg_tem.style = (DS_CENTER | DS_MODALFRAME | DS_SETFONT | 652 dlg_tem.style = (DS_CENTER | DS_MODALFRAME |
664 | WS_CAPTION | WS_POPUP | WS_VISIBLE); | 653 | WS_CAPTION | WS_POPUP | WS_VISIBLE); |
665 dlg_tem.dwExtendedStyle = 0; | 654 dlg_tem.dwExtendedStyle = 0; |
666 dlg_tem.cdit = Dynarr_length (dialog_items) + 1; | 655 dlg_tem.cdit = Dynarr_length (dialog_items) + 1; |
667 dlg_tem.x = 0; | 656 dlg_tem.x = 0; |
668 dlg_tem.y = 0; | 657 dlg_tem.y = 0; |
669 dlg_tem.cx = text_width + 2 * X_TEXT_FROM_EDGE; | 658 dlg_tem.cx = text_width + 2 * X_TEXT_FROM_EDGE; |
670 dlg_tem.cy = (Y_TEXT_FROM_EDGE + text_height + Y_TEXT_FROM_BUTTON | 659 dlg_tem.cy = (Y_TEXT_FROM_EDGE + text_height + Y_TEXT_FROM_BUTTON |
671 + Y_BUTTON + Y_BUTTON_FROM_EDGE); | 660 + Y_BUTTON + Y_BUTTON_FROM_EDGE); |
672 Dynarr_add_many (template_, &dlg_tem, sizeof (dlg_tem)); | 661 Dynarr_add_many (template_, &dlg_tem, sizeof (dlg_tem)); |
673 | 662 |
674 /* We want no menu and standard class */ | 663 /* We want no menu and standard class */ |
675 Dynarr_add_many (template_, &zeroes, 4); | 664 Dynarr_add_many (template_, &zeroes, 4); |
676 | 665 |
677 /* And the third is the dialog title. "XEmacs" unless one is supplied. | 666 /* And the third is the dialog title. "XEmacs" unless one is supplied. |
678 Note that the string must be in Unicode. */ | 667 Note that the string must be in Unicode. */ |
679 if (NILP (title)) | 668 if (NILP (title)) |
680 Dynarr_add_many (template_, L"XEmacs", 14); | 669 Dynarr_add_many (template_, L"XEmacs", 14); |
681 else | 670 else |
682 push_lisp_string_as_unicode (template_, title); | 671 push_lisp_string_as_unicode (template_, title); |
683 | 672 |
684 /* We want standard dialog font */ | |
685 Dynarr_add_many (template_, L"\x08MS Shell Dlg", 28); | |
686 | |
687 /* Next add text control. */ | 673 /* Next add text control. */ |
688 item_tem.style = WS_CHILD | WS_VISIBLE | SS_LEFT | SS_NOPREFIX; | 674 item_tem.style = WS_CHILD | WS_VISIBLE | SS_LEFT | SS_NOPREFIX; |
689 item_tem.dwExtendedStyle = 0; | 675 item_tem.dwExtendedStyle = 0; |
690 item_tem.x = X_TEXT_FROM_EDGE; | 676 item_tem.x = X_TEXT_FROM_EDGE; |
691 item_tem.y = Y_TEXT_FROM_EDGE; | 677 item_tem.y = Y_TEXT_FROM_EDGE; |
692 item_tem.cx = text_width; | 678 item_tem.cx = text_width; |
693 item_tem.cy = text_height; | 679 item_tem.cy = text_height; |
694 item_tem.id = 0xFFFF; | 680 item_tem.id = 0xFFFF; |
695 | 681 |
696 ALIGN_TEMPLATE; | 682 ALIGN_TEMPLATE; |
697 Dynarr_add_many (template_, &item_tem, sizeof (item_tem)); | 683 Dynarr_add_many (template_, &item_tem, sizeof (item_tem)); |
698 | 684 |
699 /* Right after class id follows */ | 685 /* Right after class id follows */ |
700 Dynarr_add_many (template_, &ones, 2); | 686 Dynarr_add_many (template_, &ones, 2); |
701 Dynarr_add_many (template_, &static_class_id, sizeof (static_class_id)); | 687 Dynarr_add_many (template_, &static_class_id, sizeof (static_class_id)); |
702 | 688 |
703 /* Next thing to add is control text, as Unicode string */ | 689 /* Next thing to add is control text, as Unicode string */ |
704 push_lisp_string_as_unicode (template_, question); | 690 push_lisp_string_as_unicode (template_, question); |
705 | 691 |
706 /* Specify 0 length creation data */ | 692 /* Specify 0 length creation data */ |
707 Dynarr_add_many (template_, &zeroes, 2); | 693 Dynarr_add_many (template_, &zeroes, 2); |
708 | 694 |
709 /* Now it's the button time */ | 695 /* Now it's the button time */ |
710 item_tem.y = Y_TEXT_FROM_EDGE + text_height + Y_TEXT_FROM_BUTTON; | 696 item_tem.y = Y_TEXT_FROM_EDGE + text_height + Y_TEXT_FROM_BUTTON; |
711 item_tem.x = X_BUTTON_FROM_EDGE + (button_row_width < text_width | 697 item_tem.x = X_BUTTON_FROM_EDGE + (button_row_width < text_width |
712 ? (text_width - button_row_width) / 2 | 698 ? (text_width - button_row_width) / 2 |
713 : 0); | 699 : 0); |
714 item_tem.cy = Y_BUTTON; | 700 item_tem.cy = Y_BUTTON; |
715 item_tem.dwExtendedStyle = 0; | 701 item_tem.dwExtendedStyle = 0; |
716 | 702 |
717 for (i = 0; i < Dynarr_length (dialog_items); ++i) | 703 for (i = 0; i < Dynarr_length (dialog_items); ++i) |
718 { | 704 { |
719 Lisp_Object* gui_item = Dynarr_atp (dialog_items, i); | 705 Lisp_Object *gui_item = Dynarr_atp (dialog_items, i); |
720 Lisp_Gui_Item *pgui_item = XGUI_ITEM (*gui_item); | 706 Lisp_Gui_Item *pgui_item = XGUI_ITEM (*gui_item); |
721 | 707 |
722 item_tem.style = (WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON | 708 item_tem.style = (WS_CHILD | WS_VISIBLE | WS_TABSTOP | BS_PUSHBUTTON |
723 | (gui_item_active_p (*gui_item) ? 0 : WS_DISABLED)); | 709 | (gui_item_active_p (*gui_item) ? 0 : WS_DISABLED)); |
724 item_tem.cx = button_width (pgui_item->name); | 710 item_tem.cx = button_width (pgui_item->name); |
725 /* Item ids are indices into dialog_items plus offset, to avoid having | 711 /* Item ids are indices into dialog_items plus offset, to avoid having |
726 items by reserved ids (IDOK, IDCANCEL) */ | 712 items by reserved ids (IDOK, IDCANCEL) */ |
727 item_tem.id = i + ID_ITEM_BIAS; | 713 item_tem.id = i + ID_ITEM_BIAS; |
728 | 714 |
729 ALIGN_TEMPLATE; | 715 ALIGN_TEMPLATE; |
730 Dynarr_add_many (template_, &item_tem, sizeof (item_tem)); | 716 Dynarr_add_many (template_, &item_tem, sizeof (item_tem)); |
731 | 717 |
732 /* Right after 0xFFFF and class id atom follows */ | 718 /* Right after 0xFFFF and class id atom follows */ |
733 Dynarr_add_many (template_, &ones, 2); | 719 Dynarr_add_many (template_, &ones, 2); |
734 Dynarr_add_many (template_, &button_class_id, | 720 Dynarr_add_many (template_, &button_class_id, |
735 sizeof (button_class_id)); | 721 sizeof (button_class_id)); |
736 | 722 |
737 /* Next thing to add is control text, as Unicode string */ | 723 /* Next thing to add is control text, as Unicode string */ |
738 { | 724 { |
739 Lisp_Object ctext = pgui_item->name; | |
740 Emchar accel_unused; | 725 Emchar accel_unused; |
741 Intbyte *trans = (Intbyte *) alloca (2 * XSTRING_LENGTH (ctext) + 3); | 726 |
742 Bytecount translen; | 727 push_lisp_string_as_unicode |
743 | 728 (template_, |
744 memcpy (trans, XSTRING_DATA (ctext), XSTRING_LENGTH (ctext) + 1); | 729 mswindows_translate_menu_or_dialog_item |
745 translen = | 730 (pgui_item->name, &accel_unused)); |
746 mswindows_translate_menu_or_dialog_item (trans, | |
747 XSTRING_LENGTH (ctext), | |
748 2 * XSTRING_LENGTH (ctext) + 3, | |
749 &accel_unused, | |
750 ctext); | |
751 push_intbyte_string_as_unicode (template_, trans, translen); | |
752 } | 731 } |
753 | 732 |
754 /* Specify 0 length creation data. */ | 733 /* Specify 0 length creation data. */ |
755 Dynarr_add_many (template_, &zeroes, 2); | 734 Dynarr_add_many (template_, &zeroes, 2); |
756 | 735 |
757 item_tem.x += item_tem.cx + X_BUTTON_SPACING; | 736 item_tem.x += item_tem.cx + X_BUTTON_SPACING; |
758 } | 737 } |
759 } | 738 } |
760 | 739 |
761 /* Now the Windows dialog structure is ready. We need to prepare a | 740 /* Now the Windows dialog structure is ready. We need to prepare a |
762 data structure for the new dialog, which will contain callbacks | 741 data structure for the new dialog, which will contain callbacks |
763 and the frame for these callbacks. This structure has to be | 742 and the frame for these callbacks. This structure has to be |
764 GC-protected and thus it is put into a statically protected | 743 GC-protected and thus it is put into a statically protected |
765 list. */ | 744 list. */ |
767 Lisp_Object dialog_data; | 746 Lisp_Object dialog_data; |
768 int i; | 747 int i; |
769 struct mswindows_dialog_id *did = | 748 struct mswindows_dialog_id *did = |
770 alloc_lcrecord_type (struct mswindows_dialog_id, | 749 alloc_lcrecord_type (struct mswindows_dialog_id, |
771 &lrecord_mswindows_dialog_id); | 750 &lrecord_mswindows_dialog_id); |
772 | 751 |
773 XSETMSWINDOWS_DIALOG_ID (dialog_data, did); | 752 XSETMSWINDOWS_DIALOG_ID (dialog_data, did); |
774 | 753 |
775 did->frame = wrap_frame (f); | 754 did->frame = wrap_frame (f); |
776 did->callbacks = make_vector (Dynarr_length (dialog_items), Qunbound); | 755 did->callbacks = make_vector (Dynarr_length (dialog_items), Qunbound); |
777 for (i = 0; i < Dynarr_length (dialog_items); i++) | 756 for (i = 0; i < Dynarr_length (dialog_items); i++) |
778 XVECTOR_DATA (did->callbacks) [i] = | 757 XVECTOR_DATA (did->callbacks) [i] = |
779 XGUI_ITEM (*Dynarr_atp (dialog_items, i))->callback; | 758 XGUI_ITEM (*Dynarr_atp (dialog_items, i))->callback; |
780 | 759 |
781 /* Woof! Everything is ready. Pop pop pop in now! */ | 760 /* Woof! Everything is ready. Pop pop pop in now! */ |
782 did->hwnd = | 761 did->hwnd = |
783 CreateDialogIndirectParam (NULL, | 762 qxeCreateDialogIndirectParam (NULL, |
784 (LPDLGTEMPLATE) Dynarr_atp (template_, 0), | 763 (LPDLGTEMPLATE) Dynarr_atp (template_, 0), |
785 FRAME_MSWINDOWS_HANDLE (f), dialog_proc, | 764 FRAME_MSWINDOWS_HANDLE (f), dialog_proc, |
786 (LPARAM) LISP_TO_VOID (dialog_data)); | 765 (LPARAM) LISP_TO_VOID (dialog_data)); |
787 if (!did->hwnd) | 766 if (!did->hwnd) |
788 /* Something went wrong creating the dialog */ | 767 /* Something went wrong creating the dialog */ |
789 signal_error (Qdialog_box_error, "Creating dialog", keys); | 768 signal_error (Qdialog_box_error, "Creating dialog", keys); |
790 | 769 |
791 Vdialog_data_list = Fcons (dialog_data, Vdialog_data_list); | 770 Vdialog_data_list = Fcons (dialog_data, Vdialog_data_list); |
792 | 771 |
793 /* Cease protection and free dynarrays */ | 772 /* Cease protection and free dynarrays */ |
794 unbind_to (unbind_count, Qnil); | 773 unbind_to (unbind_count); |
795 return dialog_data; | 774 return dialog_data; |
796 } | 775 } |
797 } | 776 } |
798 | 777 |
799 static Lisp_Object | 778 static Lisp_Object |
801 Lisp_Object keys) | 780 Lisp_Object keys) |
802 { | 781 { |
803 int unbind_count = specpdl_depth (); | 782 int unbind_count = specpdl_depth (); |
804 record_unwind_protect (dialog_popped_down, Qnil); | 783 record_unwind_protect (dialog_popped_down, Qnil); |
805 popup_up_p++; | 784 popup_up_p++; |
806 | 785 |
807 if (EQ (type, Qfile)) | 786 if (EQ (type, Qfile)) |
808 return unbind_to (unbind_count, handle_file_dialog_box (f, keys)); | 787 return unbind_to_1 (unbind_count, handle_file_dialog_box (f, keys)); |
809 else if (EQ (type, Qdirectory)) | 788 else if (EQ (type, Qdirectory)) |
810 return unbind_to (unbind_count, handle_directory_dialog_box (f, keys)); | 789 return unbind_to_1 (unbind_count, handle_directory_dialog_box (f, keys)); |
811 else if (EQ (type, Qquestion)) | 790 else if (EQ (type, Qquestion)) |
812 return unbind_to (unbind_count, handle_question_dialog_box (f, keys)); | 791 return unbind_to_1 (unbind_count, handle_question_dialog_box (f, keys)); |
813 else if (EQ (type, Qprint)) | 792 else if (EQ (type, Qprint)) |
814 return unbind_to (unbind_count, mswindows_handle_print_dialog_box (f, keys)); | 793 return unbind_to_1 (unbind_count, |
794 mswindows_handle_print_dialog_box (f, keys)); | |
815 else if (EQ (type, Qpage_setup)) | 795 else if (EQ (type, Qpage_setup)) |
816 return unbind_to (unbind_count, | 796 return unbind_to_1 (unbind_count, |
817 mswindows_handle_page_setup_dialog_box (f, keys)); | 797 mswindows_handle_page_setup_dialog_box (f, keys)); |
818 else | 798 else |
819 signal_error (Qunimplemented, "Dialog box type", type); | 799 signal_error (Qunimplemented, "Dialog box type", type); |
820 return Qnil; | 800 return Qnil; |
821 } | 801 } |
822 | 802 |
828 | 808 |
829 void | 809 void |
830 syms_of_dialog_mswindows (void) | 810 syms_of_dialog_mswindows (void) |
831 { | 811 { |
832 INIT_LRECORD_IMPLEMENTATION (mswindows_dialog_id); | 812 INIT_LRECORD_IMPLEMENTATION (mswindows_dialog_id); |
833 | 813 |
834 DEFKEYWORD (Q_initial_directory); | 814 DEFKEYWORD (Q_initial_directory); |
835 DEFKEYWORD (Q_initial_filename); | 815 DEFKEYWORD (Q_initial_filename); |
836 DEFKEYWORD (Q_filter_list); | 816 DEFKEYWORD (Q_filter_list); |
837 DEFKEYWORD (Q_title); | 817 DEFKEYWORD (Q_title); |
838 DEFKEYWORD (Q_allow_multi_select); | 818 DEFKEYWORD (Q_allow_multi_select); |
839 DEFKEYWORD (Q_create_prompt_on_nonexistent); | 819 DEFKEYWORD (Q_create_prompt_on_nonexistent); |
840 DEFKEYWORD (Q_overwrite_prompt); | 820 DEFKEYWORD (Q_overwrite_prompt); |
841 DEFKEYWORD (Q_file_must_exist); | 821 DEFKEYWORD (Q_file_must_exist); |
842 DEFKEYWORD (Q_no_network_button); | 822 DEFKEYWORD (Q_no_network_button); |
843 DEFKEYWORD (Q_no_read_only_return); | 823 DEFKEYWORD (Q_no_read_only_return); |
844 | 824 |
845 /* Errors */ | 825 /* Errors */ |
846 DEFERROR_STANDARD (Qdialog_box_error, Qgui_error); | 826 DEFERROR_STANDARD (Qdialog_box_error, Qgui_error); |
847 } | 827 } |
848 | 828 |
849 void | 829 void |
850 vars_of_dialog_mswindows (void) | 830 vars_of_dialog_mswindows (void) |
851 { | 831 { |
852 Vpopup_frame_list = Qnil; | 832 Vpopup_frame_list = Qnil; |
853 staticpro (&Vpopup_frame_list); | 833 staticpro (&Vpopup_frame_list); |
854 | 834 |
855 Vdialog_data_list = Qnil; | 835 Vdialog_data_list = Qnil; |
856 staticpro (&Vdialog_data_list); | 836 staticpro (&Vdialog_data_list); |
857 | 837 |
858 DEFVAR_LISP ("default-file-dialog-filter-alist", | 838 DEFVAR_LISP ("default-file-dialog-filter-alist", |
859 &Vdefault_file_dialog_filter_alist /* | 839 &Vdefault_file_dialog_filter_alist /* |
860 */ ); | 840 */ ); |
861 Vdefault_file_dialog_filter_alist = | 841 Vdefault_file_dialog_filter_alist = |
862 list5 (Fcons (build_string ("Text Files"), build_string ("*.txt")), | 842 list5 (Fcons (build_msg_string ("Text Files"), build_string ("*.txt")), |
863 Fcons (build_string ("C Files"), build_string ("*.c;*.h")), | 843 Fcons (build_msg_string ("C Files"), build_string ("*.c;*.h")), |
864 Fcons (build_string ("Elisp Files"), build_string ("*.el")), | 844 Fcons (build_msg_string ("Elisp Files"), build_string ("*.el")), |
865 Fcons (build_string ("HTML Files"), build_string ("*.html;*.html")), | 845 Fcons (build_msg_string ("HTML Files"), build_string ("*.html;*.html")), |
866 Fcons (build_string ("All Files"), build_string ("*.*"))); | 846 Fcons (build_msg_string ("All Files"), build_string ("*.*"))); |
867 } | 847 } |