diff options
| author | Richard M. Stallman | 1995-06-21 18:44:42 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-06-21 18:44:42 +0000 |
| commit | ae6b58f9d44975c6bea3fc92ea6d609e61db2ae0 (patch) | |
| tree | e3bbe40347d7b6fe71528bd7999f0127e14aee2e | |
| parent | a18042d782dd5553db34e4f0090164b8849037ed (diff) | |
| download | emacs-ae6b58f9d44975c6bea3fc92ea6d609e61db2ae0.tar.gz emacs-ae6b58f9d44975c6bea3fc92ea6d609e61db2ae0.zip | |
(Fx_display_grayscale_p): Return t or nil.
Return t for color displays.
| -rw-r--r-- | src/xfns.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/xfns.c b/src/xfns.c index 44336bf175c..f499355efdd 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -3416,6 +3416,7 @@ If omitted or nil, that stands for the selected frame's display.") | |||
| 3416 | DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p, | 3416 | DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p, |
| 3417 | 0, 1, 0, | 3417 | 0, 1, 0, |
| 3418 | "Return t if the X display supports shades of gray.\n\ | 3418 | "Return t if the X display supports shades of gray.\n\ |
| 3419 | Note that color displays do support shades of gray.\n\ | ||
| 3419 | The optional argument DISPLAY specifies which display to ask about.\n\ | 3420 | The optional argument DISPLAY specifies which display to ask about.\n\ |
| 3420 | DISPLAY should be either a frame or a display name (a string).\n\ | 3421 | DISPLAY should be either a frame or a display name (a string).\n\ |
| 3421 | If omitted or nil, that stands for the selected frame's display.") | 3422 | If omitted or nil, that stands for the selected frame's display.") |
| @@ -3424,12 +3425,22 @@ If omitted or nil, that stands for the selected frame's display.") | |||
| 3424 | { | 3425 | { |
| 3425 | struct x_display_info *dpyinfo = check_x_display_info (display); | 3426 | struct x_display_info *dpyinfo = check_x_display_info (display); |
| 3426 | 3427 | ||
| 3427 | if (dpyinfo->n_planes <= 2) | 3428 | if (dpyinfo->n_planes <= 1) |
| 3428 | return Qnil; | 3429 | return Qnil; |
| 3429 | 3430 | ||
| 3430 | return (dpyinfo->n_planes > 1 | 3431 | switch (dpyinfo->visual->class) |
| 3431 | && (dpyinfo->visual->class == StaticGray | 3432 | { |
| 3432 | || dpyinfo->visual->class == GrayScale)); | 3433 | case StaticColor: |
| 3434 | case PseudoColor: | ||
| 3435 | case TrueColor: | ||
| 3436 | case DirectColor: | ||
| 3437 | case StaticGray: | ||
| 3438 | case GrayScale: | ||
| 3439 | return Qt; | ||
| 3440 | |||
| 3441 | default: | ||
| 3442 | return Qnil; | ||
| 3443 | } | ||
| 3433 | } | 3444 | } |
| 3434 | 3445 | ||
| 3435 | DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width, | 3446 | DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width, |