+DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width,
+ 0, 1, 0,
+ "Returns the width in pixels of the display FRAME is on.")
+ (frame)
+ Lisp_Object frame;
+{
+ Display *dpy = x_current_display;
+ return make_number (DisplayWidth (dpy, DefaultScreen (dpy)));
+}
+
+DEFUN ("x-display-pixel-height", Fx_display_pixel_height,
+ Sx_display_pixel_height, 0, 1, 0,
+ "Returns the height in pixels of the display FRAME is on.")
+ (frame)
+ Lisp_Object frame;
+{
+ Display *dpy = x_current_display;
+ return make_number (DisplayHeight (dpy, DefaultScreen (dpy)));
+}
+
+DEFUN ("x-display-planes", Fx_display_planes, Sx_display_planes,
+ 0, 1, 0,
+ "Returns the number of bitplanes of the display FRAME is on.")
+ (frame)
+ Lisp_Object frame;
+{
+ Display *dpy = x_current_display;
+ return make_number (DisplayPlanes (dpy, DefaultScreen (dpy)));
+}
+
+DEFUN ("x-display-color-cells", Fx_display_color_cells, Sx_display_color_cells,
+ 0, 1, 0,
+ "Returns the number of color cells of the display FRAME is on.")
+ (frame)
+ Lisp_Object frame;
+{
+ Display *dpy = x_current_display;
+ return make_number (DisplayCells (dpy, DefaultScreen (dpy)));
+}
+
+DEFUN ("x-server-vendor", Fx_server_vendor, Sx_server_vendor, 0, 1, 0,
+ "Returns the vendor ID string of the X server FRAME is on.")
+ (frame)
+ Lisp_Object frame;
+{
+ Display *dpy = x_current_display;
+ char *vendor;
+ vendor = ServerVendor (dpy);
+ if (! vendor) vendor = "";
+ return build_string (vendor);
+}
+
+DEFUN ("x-server-version", Fx_server_version, Sx_server_version, 0, 1, 0,
+ "Returns the version numbers of the X server in use.\n\
+The value is a list of three integers: the major and minor\n\
+version numbers of the X Protocol in use, and the vendor-specific release\n\
+number. See also the variable `x-server-vendor'.")
+ (frame)
+ Lisp_Object frame;
+{
+ Display *dpy = x_current_display;
+ return Fcons (make_number (ProtocolVersion (dpy)),
+ Fcons (make_number (ProtocolRevision (dpy)),
+ Fcons (make_number (VendorRelease (dpy)), Qnil)));
+}
+
+DEFUN ("x-display-screens", Fx_display_screens, Sx_display_screens, 0, 1, 0,
+ "Returns the number of screens on the X server FRAME is on.")
+ (frame)
+ Lisp_Object frame;
+{
+ return make_number (ScreenCount (x_current_display));
+}
+
+DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1, 0,
+ "Returns the height in millimeters of the X screen FRAME is on.")
+ (frame)
+ Lisp_Object frame;
+{
+ return make_number (HeightMMOfScreen (x_screen));
+}
+
+DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0,
+ "Returns the width in millimeters of the X screen FRAME is on.")
+ (frame)
+ Lisp_Object frame;
+{
+ return make_number (WidthMMOfScreen (x_screen));
+}
+
+DEFUN ("x-display-backing-store", Fx_display_backing_store,
+ Sx_display_backing_store, 0, 1, 0,
+ "Returns an indication of whether the X screen FRAME is on does backing store.\n\
+The value may be `always', `when-mapped', or `not-useful'.")
+ (frame)
+ Lisp_Object frame;
+{
+ switch (DoesBackingStore (x_screen))
+ {
+ case Always:
+ return intern ("always");
+
+ case WhenMapped:
+ return intern ("when-mapped");
+
+ case NotUseful:
+ return intern ("not-useful");
+
+ default:
+ error ("Strange value for BackingStore parameter of screen");
+ }
+}
+
+DEFUN ("x-display-visual-class", Fx_display_visual_class,
+ Sx_display_visual_class, 0, 1, 0,
+ "Returns the visual class of the display `screen' is on.\n\
+The value is one of the symbols `static-gray', `gray-scale',\n\
+`static-color', `pseudo-color', `true-color', or `direct-color'.")
+ (screen)
+ Lisp_Object screen;
+{
+ switch (screen_visual->class)
+ {
+ case StaticGray: return (intern ("static-gray"));
+ case GrayScale: return (intern ("gray-scale"));
+ case StaticColor: return (intern ("static-color"));
+ case PseudoColor: return (intern ("pseudo-color"));
+ case TrueColor: return (intern ("true-color"));
+ case DirectColor: return (intern ("direct-color"));
+ default:
+ error ("Display has an unknown visual class");
+ }
+}
+
+DEFUN ("x-display-save-under", Fx_display_save_under,
+ Sx_display_save_under, 0, 1, 0,
+ "Returns t if the X screen FRAME is on supports the save-under feature.")
+ (frame)
+ Lisp_Object frame;
+{
+ if (DoesSaveUnders (x_screen) == True)
+ return Qt;
+ else
+ return Qnil;
+}
+\f