changeset 1701:a1e328407366

[xemacs-hg @ 2003-09-20 01:14:24 by youngs] 2003-09-20 James LewisMoss <dres@lewismoss.org> * console-impl.h (struct console_methods): add third arg to list_fonts * objects.c (Flist_fonts): Add third arg to list-fonts: maxnumber * objects-gtk.c (gtk_list_fonts): Add third (ignored) arg for maxnumber. * objects-msw.c (mswindows_list_fonts): Add third (ignored) arg for maxnumber. * objects-tty.c (tty_list_fonts): Add third (ignored) arg for maxnumber. * objects-x.c (x_list_fonts): Add third arg to specify the maximum fonts recieved from the server. 2003-09-20 James LewisMoss <dres@lewismoss.org> * font-menu.el (font-menu-max-number): New variable to specify the maximum recieved fonts. * x-font-menu.el (x-reset-device-font-menus): Use new variable (font-menu-max-number) to list-fonts.
author youngs
date Sat, 20 Sep 2003 01:14:30 +0000
parents 0a85daf64258
children 245980c04067
files lisp/ChangeLog lisp/font-menu.el lisp/x-font-menu.el src/ChangeLog src/console-impl.h src/objects-gtk.c src/objects-msw.c src/objects-tty.c src/objects-x.c src/objects.c
diffstat 10 files changed, 51 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Sep 19 17:07:07 2003 +0000
+++ b/lisp/ChangeLog	Sat Sep 20 01:14:30 2003 +0000
@@ -1,3 +1,11 @@
+2003-09-20  James LewisMoss  <dres@lewismoss.org>
+
+	* font-menu.el (font-menu-max-number): New variable to specify
+	the maximum recieved fonts.
+
+	* x-font-menu.el (x-reset-device-font-menus): Use new variable
+	(font-menu-max-number) to list-fonts.
+
 2002-09-20  James LewisMoss  <dres@lewismoss.org>
 
 	* gnuserv.el (gnuserv-edit-files): fallback to gtk if x device
--- a/lisp/font-menu.el	Fri Sep 19 17:07:07 2003 +0000
+++ b/lisp/font-menu.el	Sat Sep 20 01:14:30 2003 +0000
@@ -132,6 +132,11 @@
   :type 'boolean
   :group 'font-menu)
 
+(defcustom font-menu-max-number nil
+  "The maximum number of fonts retrieved from the server"
+  :type 'integer
+  :group 'font-menu)
+
 (defvaralias 'font-menu-max-items 'menu-max-items)
 (defvaralias 'font-menu-submenu-name-format 'menu-submenu-name-format)
 
--- a/lisp/x-font-menu.el	Fri Sep 19 17:07:07 2003 +0000
+++ b/lisp/x-font-menu.el	Sat Sep 20 01:14:30 2003 +0000
@@ -96,7 +96,8 @@
 	family size weight entry monospaced-p
 	dev-cache cache families sizes weights)
     (dolist (name (cond ((null debug)	; debugging kludge
-			 (list-fonts "*-*-*-*-*-*-*-*-*-*-*-*-*-*" device))
+			 (list-fonts "*-*-*-*-*-*-*-*-*-*-*-*-*-*" device
+				     font-menu-max-number))
 			((stringp debug) (split-string debug "\n"))
 			(t debug)))
       (when (and (string-match x-font-regexp-ascii name)
--- a/src/ChangeLog	Fri Sep 19 17:07:07 2003 +0000
+++ b/src/ChangeLog	Sat Sep 20 01:14:30 2003 +0000
@@ -1,3 +1,21 @@
+2003-09-20  James LewisMoss  <dres@lewismoss.org>
+
+	* console-impl.h (struct console_methods): add third arg to list_fonts
+
+	* objects.c (Flist_fonts): Add third arg to list-fonts: maxnumber
+
+	* objects-gtk.c (gtk_list_fonts): Add third (ignored) arg for
+	maxnumber.
+
+	* objects-msw.c (mswindows_list_fonts): Add third (ignored) arg for
+	maxnumber.
+
+	* objects-tty.c (tty_list_fonts): Add third (ignored) arg for
+	maxnumber.
+
+	* objects-x.c (x_list_fonts): Add third arg to specify the maximum
+	fonts recieved from the server.
+
 2003-09-13  Martin Buchholz  <martin@xemacs.org>
 
 	* s/sol2.h: Use OS_RELEASE=os_release_major*100+os_release_minor
--- a/src/console-impl.h	Fri Sep 19 17:07:07 2003 +0000
+++ b/src/console-impl.h	Sat Sep 20 01:14:30 2003 +0000
@@ -207,7 +207,8 @@
 						Error_Behavior errb);
   Lisp_Object (*font_instance_properties_method) (Lisp_Font_Instance *);
   Lisp_Object (*list_fonts_method) (Lisp_Object pattern,
-				    Lisp_Object device);
+				    Lisp_Object device,
+				    Lisp_Object maxnumber);
   Lisp_Object (*find_charset_font_method) (Lisp_Object device,
 					   Lisp_Object font,
 					   Lisp_Object charset,
--- a/src/objects-gtk.c	Fri Sep 19 17:07:07 2003 +0000
+++ b/src/objects-gtk.c	Sat Sep 20 01:14:30 2003 +0000
@@ -359,7 +359,7 @@
 }
 
 static Lisp_Object
-gtk_list_fonts (Lisp_Object pattern, Lisp_Object device)
+gtk_list_fonts (Lisp_Object pattern, Lisp_Object device, Lisp_Object maxnumber)
 {
   const char *patternext;
 
--- a/src/objects-msw.c	Fri Sep 19 17:07:07 2003 +0000
+++ b/src/objects-msw.c	Sat Sep 20 01:14:30 2003 +0000
@@ -1924,7 +1924,8 @@
 }
 
 static Lisp_Object
-mswindows_list_fonts (Lisp_Object pattern, Lisp_Object device)
+mswindows_list_fonts (Lisp_Object pattern, Lisp_Object device,
+		      Lisp_Object maxnumber)
 {
   struct device *d = XDEVICE (device);
   Lisp_Object font_list = Qnil, fonttail, result = Qnil;
--- a/src/objects-tty.c	Fri Sep 19 17:07:07 2003 +0000
+++ b/src/objects-tty.c	Sat Sep 20 01:14:30 2003 +0000
@@ -291,7 +291,7 @@
 }
 
 static Lisp_Object
-tty_list_fonts (Lisp_Object pattern, Lisp_Object device)
+tty_list_fonts (Lisp_Object pattern, Lisp_Object device, Lisp_Object maxnumber)
 {
   return list1 (build_string ("normal"));
 }
--- a/src/objects-x.c	Fri Sep 19 17:07:07 2003 +0000
+++ b/src/objects-x.c	Sat Sep 20 01:14:30 2003 +0000
@@ -853,17 +853,23 @@
 }
 
 static Lisp_Object
-x_list_fonts (Lisp_Object pattern, Lisp_Object device)
+x_list_fonts (Lisp_Object pattern, Lisp_Object device, Lisp_Object maxnumber)
 {
   Extbyte **names;
   int count = 0;
+  int max_number = MAX_FONT_COUNT;
   Lisp_Object result = Qnil;
   const Extbyte *patternext;
 
   LISP_STRING_TO_EXTERNAL (pattern, patternext, Qx_font_name_encoding);
 
+  if (!NILP(maxnumber) && INTP(maxnumber))
+    {
+      max_number = XINT(maxnumber);
+    }
+
   names = XListFonts (DEVICE_X_DISPLAY (XDEVICE (device)),
-		      patternext, MAX_FONT_COUNT, &count);
+		      patternext, max_number, &count);
   while (count--)
     result = Fcons (build_ext_string (names[count], Qx_font_name_encoding),
 		    result);
--- a/src/objects.c	Fri Sep 19 17:07:07 2003 +0000
+++ b/src/objects.c	Sat Sep 20 01:14:30 2003 +0000
@@ -507,17 +507,18 @@
 			     font_instance_properties, (f));
 }
 
-DEFUN ("list-fonts", Flist_fonts, 1, 2, 0, /*
+DEFUN ("list-fonts", Flist_fonts, 1, 3, 0, /*
 Return a list of font names matching the given pattern.
 DEVICE specifies which device to search for names, and defaults to the
 currently selected device.
 */
-       (pattern, device))
+       (pattern, device, maxnumber))
 {
   CHECK_STRING (pattern);
   device = wrap_device (decode_device (device));
 
-  return MAYBE_LISP_DEVMETH (XDEVICE (device), list_fonts, (pattern, device));
+  return MAYBE_LISP_DEVMETH (XDEVICE (device), list_fonts, (pattern, device,
+							    maxnumber));
 }