Mercurial > emacs
comparison src/w32fns.c @ 34998:5091928844df
(Fx_display_color_cells): Determine correct value, when
system doesn't tell us directly.
(Fx_display_visual_class): Implement properly.
author | Andrew Innes <andrewi@gnu.org> |
---|---|
date | Tue, 02 Jan 2001 22:44:52 +0000 |
parents | af688bd6c419 |
children | 912ea0b8e09b |
comparison
equal
deleted
inserted
replaced
34997:1fff4c29a492 | 34998:5091928844df |
---|---|
7213 hdc = GetDC (dpyinfo->root_window); | 7213 hdc = GetDC (dpyinfo->root_window); |
7214 if (dpyinfo->has_palette) | 7214 if (dpyinfo->has_palette) |
7215 cap = GetDeviceCaps (hdc,SIZEPALETTE); | 7215 cap = GetDeviceCaps (hdc,SIZEPALETTE); |
7216 else | 7216 else |
7217 cap = GetDeviceCaps (hdc,NUMCOLORS); | 7217 cap = GetDeviceCaps (hdc,NUMCOLORS); |
7218 | |
7219 if (cap < 0) | |
7220 cap = 1 << (dpyinfo->n_planes * dpyinfo->n_cbits); | |
7218 | 7221 |
7219 ReleaseDC (dpyinfo->root_window, hdc); | 7222 ReleaseDC (dpyinfo->root_window, hdc); |
7220 | 7223 |
7221 return make_number (cap); | 7224 return make_number (cap); |
7222 } | 7225 } |
7340 If omitted or nil, that stands for the selected frame's display.") | 7343 If omitted or nil, that stands for the selected frame's display.") |
7341 (display) | 7344 (display) |
7342 Lisp_Object display; | 7345 Lisp_Object display; |
7343 { | 7346 { |
7344 struct w32_display_info *dpyinfo = check_x_display_info (display); | 7347 struct w32_display_info *dpyinfo = check_x_display_info (display); |
7345 | 7348 Lisp_Object result = Qnil; |
7346 #if 0 | 7349 |
7347 switch (dpyinfo->visual->class) | 7350 if (dpyinfo->has_palette) |
7348 { | 7351 result = intern ("pseudo-color"); |
7349 case StaticGray: return (intern ("static-gray")); | 7352 else if (dpyinfo->n_planes * dpyinfo->n_cbits == 1) |
7350 case GrayScale: return (intern ("gray-scale")); | 7353 result = intern ("static-grey"); |
7351 case StaticColor: return (intern ("static-color")); | 7354 else if (dpyinfo->n_planes * dpyinfo->n_cbits == 4) |
7352 case PseudoColor: return (intern ("pseudo-color")); | 7355 result = intern ("static-color"); |
7353 case TrueColor: return (intern ("true-color")); | 7356 else if (dpyinfo->n_planes * dpyinfo->n_cbits > 8) |
7354 case DirectColor: return (intern ("direct-color")); | 7357 result = intern ("true-color"); |
7355 default: | 7358 |
7356 error ("Display has an unknown visual class"); | 7359 return result; |
7357 } | |
7358 #endif | |
7359 | |
7360 error ("Display has an unknown visual class"); | |
7361 } | 7360 } |
7362 | 7361 |
7363 DEFUN ("x-display-save-under", Fx_display_save_under, | 7362 DEFUN ("x-display-save-under", Fx_display_save_under, |
7364 Sx_display_save_under, 0, 1, 0, | 7363 Sx_display_save_under, 0, 1, 0, |
7365 "Returns t if the display DISPLAY supports the save-under feature.\n\ | 7364 "Returns t if the display DISPLAY supports the save-under feature.\n\ |