changeset 12347:0731c1ec96ad

(Fx_display_grayscale_p): Return t or nil. Return t for color displays.
author Richard M. Stallman <rms@gnu.org>
date Wed, 21 Jun 1995 18:44:42 +0000
parents a7f7ae7ef458
children 7d39ee7e0ca3
files src/xfns.c
diffstat 1 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Wed Jun 21 18:32:45 1995 +0000
+++ b/src/xfns.c	Wed Jun 21 18:44:42 1995 +0000
@@ -3416,6 +3416,7 @@
 DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p,
   0, 1, 0,
   "Return t if the X display supports shades of gray.\n\
+Note that color displays do support shades of gray.\n\
 The optional argument DISPLAY specifies which display to ask about.\n\
 DISPLAY should be either a frame or a display name (a string).\n\
 If omitted or nil, that stands for the selected frame's display.")
@@ -3424,12 +3425,22 @@
 {
   struct x_display_info *dpyinfo = check_x_display_info (display);
 
-  if (dpyinfo->n_planes <= 2)
+  if (dpyinfo->n_planes <= 1)
     return Qnil;
 
-  return (dpyinfo->n_planes > 1
-	  && (dpyinfo->visual->class == StaticGray
-	      || dpyinfo->visual->class == GrayScale));
+  switch (dpyinfo->visual->class)
+    {
+    case StaticColor:
+    case PseudoColor:
+    case TrueColor:
+    case DirectColor:
+    case StaticGray:
+    case GrayScale:
+      return Qt;
+
+    default:
+      return Qnil;
+    }
 }
 
 DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width,