comparison src/w32fns.c @ 90043:e24e2e78deda

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-69 Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-643 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-649 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-650 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-651 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-655 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-656 Update from CVS: lisp/man.el (Man-xref-normal-file): Fix help-echo. * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-657 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-658 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-659 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-660 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-661 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-667 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-668 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-61 - miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-68 Update from CVS
author Miles Bader <miles@gnu.org>
date Thu, 04 Nov 2004 08:55:40 +0000
parents f3ec05478165 71ea49de0560
children cb67264d6096
comparison
equal deleted inserted replaced
90042:003d95404d71 90043:e24e2e78deda
5665 static BOOL 5665 static BOOL
5666 w32_font_match (fontname, pattern) 5666 w32_font_match (fontname, pattern)
5667 char * fontname; 5667 char * fontname;
5668 char * pattern; 5668 char * pattern;
5669 { 5669 {
5670 char *ptr;
5670 char *font_name_copy; 5671 char *font_name_copy;
5671 char *ptr;
5672 Lisp_Object encoded_font_name;
5673 char *regex = alloca (strlen (pattern) * 2 + 3); 5672 char *regex = alloca (strlen (pattern) * 2 + 3);
5674 5673
5675 /* Convert fontname to unibyte for match. */ 5674 font_name_copy = alloca (strlen (fontname) + 1);
5676 encoded_font_name = string_make_unibyte (build_string (fontname)); 5675 strcpy (font_name_copy, fontname);
5677 font_name_copy = SDATA (encoded_font_name);
5678 5676
5679 ptr = regex; 5677 ptr = regex;
5680 *ptr++ = '^'; 5678 *ptr++ = '^';
5681 5679
5682 /* Turn pattern into a regexp and do a regexp match. */ 5680 /* Turn pattern into a regexp and do a regexp match. */
5710 if the heights differ. */ 5708 if the heights differ. */
5711 if (font_height && pattern_height && (font_height != pattern_height)) 5709 if (font_height && pattern_height && (font_height != pattern_height))
5712 return FALSE; 5710 return FALSE;
5713 } 5711 }
5714 5712
5715 return (fast_c_string_match_ignore_case (build_string (regex), 5713 return (fast_string_match_ignore_case (build_string (regex),
5716 font_name_copy) >= 0); 5714 build_string(font_name_copy)) >= 0);
5717 } 5715 }
5718 5716
5719 /* Callback functions, and a structure holding info they need, for 5717 /* Callback functions, and a structure holding info they need, for
5720 listing system fonts on W32. We need one set of functions to do the 5718 listing system fonts on W32. We need one set of functions to do the
5721 job properly, but these don't work on NT 3.51 and earlier, so we 5719 job properly, but these don't work on NT 3.51 and earlier, so we
6457 6455
6458 return make_number (1); 6456 return make_number (1);
6459 } 6457 }
6460 6458
6461 DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0, 6459 DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
6462 doc: /* Returns the vendor ID string of the W32 system (Microsoft). 6460 doc: /* Returns the "vendor ID" string of the W32 system (Microsoft).
6463 The optional argument DISPLAY specifies which display to ask about. 6461 The optional argument DISPLAY specifies which display to ask about.
6464 DISPLAY should be either a frame or a display name (a string). 6462 DISPLAY should be either a frame or a display name (a string).
6465 If omitted or nil, that stands for the selected frame's display. */) 6463 If omitted or nil, that stands for the selected frame's display. */)
6466 (display) 6464 (display)
6467 Lisp_Object display; 6465 Lisp_Object display;
6470 } 6468 }
6471 6469
6472 DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0, 6470 DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
6473 doc: /* Returns the version numbers of the server of DISPLAY. 6471 doc: /* Returns the version numbers of the server of DISPLAY.
6474 The value is a list of three integers: the major and minor 6472 The value is a list of three integers: the major and minor
6475 version numbers, and the vendor-specific release 6473 version numbers of the X Protocol in use, and the distributor-specific release
6476 number. See also the function `x-server-vendor'. 6474 number. See also the function `x-server-vendor'.
6477 6475
6478 The optional argument DISPLAY specifies which display to ask about. 6476 The optional argument DISPLAY specifies which display to ask about.
6479 DISPLAY should be either a frame or a display name (a string). 6477 DISPLAY should be either a frame or a display name (a string).
6480 If omitted or nil, that stands for the selected frame's display. */) 6478 If omitted or nil, that stands for the selected frame's display. */)
7801 } 7799 }
7802 } 7800 }
7803 return 0; 7801 return 0;
7804 } 7802 }
7805 7803
7806 DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 4, 0, 7804 DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 5, 0,
7807 doc: /* Read file name, prompting with PROMPT in directory DIR. 7805 doc: /* Read file name, prompting with PROMPT in directory DIR.
7808 Use a file selection dialog. 7806 Use a file selection dialog.
7809 Select DEFAULT-FILENAME in the dialog's file selection box, if 7807 Select DEFAULT-FILENAME in the dialog's file selection box, if
7810 specified. Ensure that file exists if MUSTMATCH is non-nil. */) 7808 specified. Ensure that file exists if MUSTMATCH is non-nil.
7811 (prompt, dir, default_filename, mustmatch) 7809 If ONLY-DIR-P is non-nil, the user can only select directories. */)
7812 Lisp_Object prompt, dir, default_filename, mustmatch; 7810 (prompt, dir, default_filename, mustmatch, only_dir_p)
7811 Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p;
7813 { 7812 {
7814 struct frame *f = SELECTED_FRAME (); 7813 struct frame *f = SELECTED_FRAME ();
7815 Lisp_Object file = Qnil; 7814 Lisp_Object file = Qnil;
7816 int count = SPECPDL_INDEX (); 7815 int count = SPECPDL_INDEX ();
7817 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 7816 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
7818 char filename[MAX_PATH + 1]; 7817 char filename[MAX_PATH + 1];
7819 char init_dir[MAX_PATH + 1]; 7818 char init_dir[MAX_PATH + 1];
7820 int default_filter_index = 1; /* 1: All Files, 2: Directories only */ 7819 int default_filter_index = 1; /* 1: All Files, 2: Directories only */
7821 7820
7822 GCPRO5 (prompt, dir, default_filename, mustmatch, file); 7821 GCPRO6 (prompt, dir, default_filename, mustmatch, only_dir_p, file);
7823 CHECK_STRING (prompt); 7822 CHECK_STRING (prompt);
7824 CHECK_STRING (dir); 7823 CHECK_STRING (dir);
7825 7824
7826 /* Create the dialog with PROMPT as title, using DIR as initial 7825 /* Create the dialog with PROMPT as title, using DIR as initial
7827 directory and using "*" as pattern. */ 7826 directory and using "*" as pattern. */
7865 file_details.lpstrFile = filename; 7864 file_details.lpstrFile = filename;
7866 file_details.nMaxFile = sizeof (filename); 7865 file_details.nMaxFile = sizeof (filename);
7867 file_details.lpstrInitialDir = init_dir; 7866 file_details.lpstrInitialDir = init_dir;
7868 file_details.lpstrTitle = SDATA (prompt); 7867 file_details.lpstrTitle = SDATA (prompt);
7869 7868
7870 /* If prompt starts with Dired, default to directories only. */ 7869 if (! NILP (only_dir_p))
7871 /* A bit hacky, but there doesn't seem to be a better way to
7872 DTRT for dired. */
7873 if (strncmp (file_details.lpstrTitle, "Dired", 5) == 0)
7874 default_filter_index = 2; 7870 default_filter_index = 2;
7875 7871
7876 file_details.nFilterIndex = default_filter_index; 7872 file_details.nFilterIndex = default_filter_index;
7877 7873
7878 file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR 7874 file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR