diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/elisp/display-feature-testing.html | |
new repository
Diffstat (limited to 'devdocs/elisp/display-feature-testing.html')
| -rw-r--r-- | devdocs/elisp/display-feature-testing.html | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/devdocs/elisp/display-feature-testing.html b/devdocs/elisp/display-feature-testing.html new file mode 100644 index 00000000..23e87e15 --- /dev/null +++ b/devdocs/elisp/display-feature-testing.html @@ -0,0 +1,68 @@ + <h3 class="section">Display Feature Testing</h3> <p>The functions in this section describe the basic capabilities of a particular display. Lisp programs can use them to adapt their behavior to what the display can do. For example, a program that ordinarily uses a popup menu could use the minibuffer if popup menus are not supported. </p> <p>The optional argument <var>display</var> in these functions specifies which display to ask the question about. It can be a display name, a frame (which designates the display that frame is on), or <code>nil</code> (which refers to the selected frame’s display, see <a href="input-focus">Input Focus</a>). </p> <p>See <a href="color-names">Color Names</a>, <a href="text-terminal-colors">Text Terminal Colors</a>, for other functions to obtain information about displays. </p> <dl> <dt id="display-popup-menus-p">Function: <strong>display-popup-menus-p</strong> <em>&optional display</em> +</dt> <dd><p>This function returns <code>t</code> if popup menus are supported on <var>display</var>, <code>nil</code> if not. Support for popup menus requires that the mouse be available, since the menu is popped up by clicking the mouse on some portion of the Emacs display. </p></dd> +</dl> <dl> <dt id="display-graphic-p">Function: <strong>display-graphic-p</strong> <em>&optional display</em> +</dt> <dd><p>This function returns <code>t</code> if <var>display</var> is a graphic display capable of displaying several frames and several different fonts at once. This is true for displays that use a window system such as X, and false for text terminals. </p></dd> +</dl> <dl> <dt id="display-mouse-p">Function: <strong>display-mouse-p</strong> <em>&optional display</em> +</dt> <dd> + <p>This function returns <code>t</code> if <var>display</var> has a mouse available, <code>nil</code> if not. </p> +</dd> +</dl> <dl> <dt id="display-color-p">Function: <strong>display-color-p</strong> <em>&optional display</em> +</dt> <dd> + <p>This function returns <code>t</code> if the screen is a color screen. It used to be called <code>x-display-color-p</code>, and that name is still supported as an alias. </p> +</dd> +</dl> <dl> <dt id="display-grayscale-p">Function: <strong>display-grayscale-p</strong> <em>&optional display</em> +</dt> <dd><p>This function returns <code>t</code> if the screen can display shades of gray. (All color displays can do this.) </p></dd> +</dl> <dl> <dt id="display-supports-face-attributes-p">Function: <strong>display-supports-face-attributes-p</strong> <em>attributes &optional display</em> +</dt> <dd> +<p>This function returns non-<code>nil</code> if all the face attributes in <var>attributes</var> are supported (see <a href="face-attributes">Face Attributes</a>). </p> <p>The definition of “supported” is somewhat heuristic, but basically means that a face containing all the attributes in <var>attributes</var>, when merged with the default face for display, can be represented in a way that’s </p> <ol> <li> different in appearance than the default face, and </li> +<li> close in spirit to what the attributes specify, if not exact. </li> +</ol> <p>Point (2) implies that a <code>:weight black</code> attribute will be satisfied by any display that can display bold, as will <code>:foreground "yellow"</code> as long as some yellowish color can be displayed, but <code>:slant italic</code> will <em>not</em> be satisfied by the tty display code’s automatic substitution of a dim face for italic. </p> +</dd> +</dl> <dl> <dt id="display-selections-p">Function: <strong>display-selections-p</strong> <em>&optional display</em> +</dt> <dd><p>This function returns <code>t</code> if <var>display</var> supports selections. Windowed displays normally support selections, but they may also be supported in some other cases. </p></dd> +</dl> <dl> <dt id="display-images-p">Function: <strong>display-images-p</strong> <em>&optional display</em> +</dt> <dd><p>This function returns <code>t</code> if <var>display</var> can display images. Windowed displays ought in principle to handle images, but some systems lack the support for that. On a display that does not support images, Emacs cannot display a tool bar. </p></dd> +</dl> <dl> <dt id="display-screens">Function: <strong>display-screens</strong> <em>&optional display</em> +</dt> <dd><p>This function returns the number of screens associated with the display. </p></dd> +</dl> <dl> <dt id="display-pixel-height">Function: <strong>display-pixel-height</strong> <em>&optional display</em> +</dt> <dd> +<p>This function returns the height of the screen in pixels. On a character terminal, it gives the height in characters. </p> <p>For graphical terminals, note that on multi-monitor setups this refers to the pixel height for all physical monitors associated with <var>display</var>. See <a href="multiple-terminals">Multiple Terminals</a>. </p> +</dd> +</dl> <dl> <dt id="display-pixel-width">Function: <strong>display-pixel-width</strong> <em>&optional display</em> +</dt> <dd> +<p>This function returns the width of the screen in pixels. On a character terminal, it gives the width in characters. </p> <p>For graphical terminals, note that on multi-monitor setups this refers to the pixel width for all physical monitors associated with <var>display</var>. See <a href="multiple-terminals">Multiple Terminals</a>. </p> +</dd> +</dl> <dl> <dt id="display-mm-height">Function: <strong>display-mm-height</strong> <em>&optional display</em> +</dt> <dd> +<p>This function returns the height of the screen in millimeters, or <code>nil</code> if Emacs cannot get that information. </p> <p>For graphical terminals, note that on multi-monitor setups this refers to the height for all physical monitors associated with <var>display</var>. See <a href="multiple-terminals">Multiple Terminals</a>. </p> +</dd> +</dl> <dl> <dt id="display-mm-width">Function: <strong>display-mm-width</strong> <em>&optional display</em> +</dt> <dd> +<p>This function returns the width of the screen in millimeters, or <code>nil</code> if Emacs cannot get that information. </p> <p>For graphical terminals, note that on multi-monitor setups this refers to the width for all physical monitors associated with <var>display</var>. See <a href="multiple-terminals">Multiple Terminals</a>. </p> +</dd> +</dl> <dl> <dt id="display-mm-dimensions-alist">User Option: <strong>display-mm-dimensions-alist</strong> +</dt> <dd><p>This variable allows the user to specify the dimensions of graphical displays returned by <code>display-mm-height</code> and <code>display-mm-width</code> in case the system provides incorrect values. </p></dd> +</dl> <dl> <dt id="display-backing-store">Function: <strong>display-backing-store</strong> <em>&optional display</em> +</dt> <dd> +<p>This function returns the backing store capability of the display. Backing store means recording the pixels of windows (and parts of windows) that are not exposed, so that when exposed they can be displayed very quickly. </p> <p>Values can be the symbols <code>always</code>, <code>when-mapped</code>, or <code>not-useful</code>. The function can also return <code>nil</code> when the question is inapplicable to a certain kind of display. </p> +</dd> +</dl> <dl> <dt id="display-save-under">Function: <strong>display-save-under</strong> <em>&optional display</em> +</dt> <dd><p>This function returns non-<code>nil</code> if the display supports the SaveUnder feature. That feature is used by pop-up windows to save the pixels they obscure, so that they can pop down quickly. </p></dd> +</dl> <dl> <dt id="display-planes">Function: <strong>display-planes</strong> <em>&optional display</em> +</dt> <dd><p>This function returns the number of planes the display supports. This is typically the number of bits per pixel. For a tty display, it is log to base two of the number of colors supported. </p></dd> +</dl> <dl> <dt id="display-visual-class">Function: <strong>display-visual-class</strong> <em>&optional display</em> +</dt> <dd><p>This function returns the visual class for the screen. The value is one of the symbols <code>static-gray</code> (a limited, unchangeable number of grays), <code>gray-scale</code> (a full range of grays), <code>static-color</code> (a limited, unchangeable number of colors), <code>pseudo-color</code> (a limited number of colors), <code>true-color</code> (a full range of colors), and <code>direct-color</code> (a full range of colors). </p></dd> +</dl> <dl> <dt id="display-color-cells">Function: <strong>display-color-cells</strong> <em>&optional display</em> +</dt> <dd><p>This function returns the number of color cells the screen supports. </p></dd> +</dl> <p>These functions obtain additional information about the window system in use where Emacs shows the specified <var>display</var>. (Their names begin with <code>x-</code> for historical reasons.) </p> <dl> <dt id="x-server-version">Function: <strong>x-server-version</strong> <em>&optional display</em> +</dt> <dd><p>This function returns the list of version numbers of the GUI window system running on <var>display</var>, such as the X server on GNU and Unix systems. The value is a list of three integers: the major and minor version numbers of the protocol, and the distributor-specific release number of the window system software itself. On GNU and Unix systems, these are normally the version of the X protocol and the distributor-specific release number of the X server software. On MS-Windows, this is the version of the Windows OS. </p></dd> +</dl> <dl> <dt id="x-server-vendor">Function: <strong>x-server-vendor</strong> <em>&optional display</em> +</dt> <dd> +<p>This function returns the vendor that provided the window system software (as a string). On GNU and Unix systems this really means whoever distributes the X server. On MS-Windows this is the vendor ID string of the Windows OS (Microsoft). </p> <p>When the developers of X labeled software distributors as “vendors”, they showed their false assumption that no system could ever be developed and distributed noncommercially. </p> +</dd> +</dl><div class="_attribution"> + <p class="_attribution-p"> + Copyright © 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br> + <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Display-Feature-Testing.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Display-Feature-Testing.html</a> + </p> +</div> |
