aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-04-06 12:42:45 +0800
committerPo Lu2022-04-06 12:42:45 +0800
commita6f7d0f4e38555080bbdb45dbb414e15d206f548 (patch)
treec4dbcd10ca404c2728de27ab2ea6eaf96af79b65 /src
parent62eb57f43871dacb6c7ac1f6e2cdaf7add1414e2 (diff)
downloademacs-a6f7d0f4e38555080bbdb45dbb414e15d206f548.tar.gz
emacs-a6f7d0f4e38555080bbdb45dbb414e15d206f548.zip
; * src/xterm.c: Improve commentary.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 102447ad7e3..7eef2b488be 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -142,14 +142,22 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
142 draw text in inverse video, and the cursor graphics context is used 142 draw text in inverse video, and the cursor graphics context is used
143 to display the cursor in the most common case. 143 to display the cursor in the most common case.
144 144
145 N.B. that some of the other window systems supported by use an
146 emulation of graphics contexts to hold the foreground and
147 background colors used in a glyph string, while the some others
148 ports compute those colors directly based on the colors of the
149 string's face and its highlight, but only on X are graphics
150 contexts a data structure inherent to the window system.
151
145 COLOR ALLOCATION 152 COLOR ALLOCATION
146 153
147 In X, pixel values for colors are not guaranteed to correspond to 154 In (and only in) X, pixel values for colors are not guaranteed to
148 their individual components. The rules for converting colors into 155 correspond to their individual components. The rules for
149 pixel values are defined by the visual class of each display opened 156 converting colors into pixel values are defined by the visual class
150 by Emacs. When a display is opened, a suitable visual is obtained 157 of each display opened by Emacs. When a display is opened, a
151 from the X server, and a colormap is created based on that visual, 158 suitable visual is obtained from the X server, and a colormap is
152 which is then used for each frame created. 159 created based on that visual, which is then used for each frame
160 created.
153 161
154 The colormap is then used by the X server to convert pixel values 162 The colormap is then used by the X server to convert pixel values
155 from a frame created by Emacs into actual colors which are output 163 from a frame created by Emacs into actual colors which are output
@@ -202,6 +210,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
202 which is used to determine the color values for given pixel 210 which is used to determine the color values for given pixel
203 values. 211 values.
204 212
213 In other window systems supported by Emacs, color allocation is
214 handled by the window system itself, to whom Emacs simply passes 24
215 (or 32-bit) RGB values.
216
205 OPTIONAL FEATURES 217 OPTIONAL FEATURES
206 218
207 While X servers and client libraries tend to come with many 219 While X servers and client libraries tend to come with many