aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--X11/xtrans/Xtranslcl.c4
-rw-r--r--X11/xtrans/doc/xtrans.xml39
-rw-r--r--libX11/nls/en_US.UTF-8/Compose.pre10768
-rw-r--r--libX11/specs/i18n/localedb/localedb.xml5
-rw-r--r--libX11/specs/libX11/libX11.xml15
-rw-r--r--libXext/specs/dbelib.xml8
-rw-r--r--libXext/specs/dpmslib.xml4
-rw-r--r--libXext/specs/shapelib.xml2
-rw-r--r--libXext/specs/synclib.xml19
-rw-r--r--libXext/specs/xtest1.xml29
-rw-r--r--mesalib/configs/aix-64-static2
-rw-r--r--mesalib/configs/aix-static3
-rw-r--r--mesalib/configs/linux-osmesa-static1
-rw-r--r--mesalib/configs/linux-x86-64-static3
-rw-r--r--mesalib/configs/linux-x86-static2
-rw-r--r--mesalib/configure.ac3
-rw-r--r--mesalib/include/GLES2/gl2ext.h373
-rw-r--r--mesalib/scons/custom.py6
-rw-r--r--mesalib/src/SConscript8
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_blit.c1584
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_format_latc.c654
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_format_rgtc.c928
-rw-r--r--mesalib/src/glsl/Makefile8
-rw-r--r--mesalib/src/mesa/drivers/common/meta.c44
-rw-r--r--mesalib/src/mesa/drivers/dri/swrast/swrast_span.c2
-rw-r--r--mesalib/src/mesa/main/api_validate.c31
-rw-r--r--mesalib/src/mesa/main/api_validate.h5
-rw-r--r--mesalib/src/mesa/main/attrib.c4
-rw-r--r--mesalib/src/mesa/main/colormac.h135
-rw-r--r--mesalib/src/mesa/main/config.h9
-rw-r--r--mesalib/src/mesa/main/context.c2
-rw-r--r--mesalib/src/mesa/main/debug.c4
-rw-r--r--mesalib/src/mesa/main/dlist.c5
-rw-r--r--mesalib/src/mesa/main/macros.h27
-rw-r--r--mesalib/src/mesa/main/matrix.c1578
-rw-r--r--mesalib/src/mesa/main/mipmap.c40
-rw-r--r--mesalib/src/mesa/main/mipmap.h122
-rw-r--r--mesalib/src/mesa/main/mtypes.h25
-rw-r--r--mesalib/src/mesa/main/pack.c98
-rw-r--r--mesalib/src/mesa/main/pack.h4
-rw-r--r--mesalib/src/mesa/main/state.c18
-rw-r--r--mesalib/src/mesa/main/texcompress.c32
-rw-r--r--mesalib/src/mesa/main/texcompress_fxt1.c168
-rw-r--r--mesalib/src/mesa/main/texcompress_rgtc.c36
-rw-r--r--mesalib/src/mesa/main/texcompress_rgtc_tmp.h2
-rw-r--r--mesalib/src/mesa/main/texcompress_s3tc.c132
-rw-r--r--mesalib/src/mesa/main/texstore.c216
-rw-r--r--mesalib/src/mesa/main/texstore.h4
-rw-r--r--mesalib/src/mesa/math/m_translate.h2
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_texture.c3
-rw-r--r--mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp119
-rw-r--r--mesalib/src/mesa/swrast/s_span.h448
-rw-r--r--mesalib/src/mesa/swrast/s_texfetch_tmp.h2
-rw-r--r--mesalib/src/mesa/swrast/swrast.h1
-rw-r--r--mesalib/src/mesa/tnl/t_vertex.c1128
-rw-r--r--mesalib/src/mesa/tnl/t_vertex_generic.c2311
-rw-r--r--mesalib/src/mesa/tnl/t_vertex_sse.c1369
-rw-r--r--mesalib/src/mesa/vbo/vbo_attrib_tmp.h13
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec_api.c7
-rw-r--r--pixman/pixman/pixman-access.c2658
-rw-r--r--pixman/pixman/pixman-combine.c.template7
-rw-r--r--pixman/pixman/pixman-fast-path.c2
-rw-r--r--pixman/pixman/pixman-image.c41
-rw-r--r--pixman/pixman/pixman-inlines.h12
-rw-r--r--pixman/pixman/pixman-private.h62
-rw-r--r--pixman/pixman/pixman-utils.c34
-rw-r--r--pixman/pixman/pixman.c272
-rw-r--r--pixman/test/affine-test.c598
-rw-r--r--pixman/test/blitters-test.c5
-rw-r--r--xorg-server/Xext/bigreq.c155
-rw-r--r--xorg-server/Xext/dpms.c750
-rw-r--r--xorg-server/Xext/geext.c16
-rw-r--r--xorg-server/Xext/panoramiX.c74
-rw-r--r--xorg-server/Xext/panoramiXSwap.c26
-rw-r--r--xorg-server/Xext/panoramiXsrv.h2
-rw-r--r--xorg-server/Xext/saver.c3020
-rw-r--r--xorg-server/Xext/security.c2291
-rw-r--r--xorg-server/Xext/shape.c2508
-rw-r--r--xorg-server/Xext/shm.c114
-rw-r--r--xorg-server/Xext/sync.c5810
-rw-r--r--xorg-server/Xext/xcmisc.c408
-rw-r--r--xorg-server/Xext/xf86bigfont.c62
-rw-r--r--xorg-server/Xext/xres.c744
-rw-r--r--xorg-server/Xext/xselinux_ext.c64
-rw-r--r--xorg-server/Xext/xtest.c30
-rw-r--r--xorg-server/Xext/xvdisp.c407
-rw-r--r--xorg-server/Xi/allowev.c6
-rw-r--r--xorg-server/Xi/chgdctl.c15
-rw-r--r--xorg-server/Xi/chgfctl.c52
-rw-r--r--xorg-server/Xi/chgkbd.c4
-rw-r--r--xorg-server/Xi/chgkmap.c3
-rw-r--r--xorg-server/Xi/chgprop.c8
-rw-r--r--xorg-server/Xi/chgptr.c4
-rw-r--r--xorg-server/Xi/closedev.c330
-rw-r--r--xorg-server/Xi/devbell.c4
-rw-r--r--xorg-server/Xi/extinit.c238
-rw-r--r--xorg-server/Xi/getbmap.c10
-rw-r--r--xorg-server/Xi/getdctl.c33
-rw-r--r--xorg-server/Xi/getfctl.c722
-rw-r--r--xorg-server/Xi/getfocus.c14
-rw-r--r--xorg-server/Xi/getkmap.c312
-rw-r--r--xorg-server/Xi/getmmap.c270
-rw-r--r--xorg-server/Xi/getprop.c14
-rw-r--r--xorg-server/Xi/getselev.c16
-rw-r--r--xorg-server/Xi/getvers.c16
-rw-r--r--xorg-server/Xi/grabdev.c16
-rw-r--r--xorg-server/Xi/grabdevb.c10
-rw-r--r--xorg-server/Xi/grabdevk.c10
-rw-r--r--xorg-server/Xi/gtmotion.c348
-rw-r--r--xorg-server/Xi/listdev.c856
-rw-r--r--xorg-server/Xi/opendev.c338
-rw-r--r--xorg-server/Xi/queryst.c379
-rw-r--r--xorg-server/Xi/selectev.c8
-rw-r--r--xorg-server/Xi/sendexev.c311
-rw-r--r--xorg-server/Xi/setbmap.c10
-rw-r--r--xorg-server/Xi/setdval.c10
-rw-r--r--xorg-server/Xi/setfocus.c8
-rw-r--r--xorg-server/Xi/setmmap.c10
-rw-r--r--xorg-server/Xi/setmode.c288
-rw-r--r--xorg-server/Xi/ungrdev.c6
-rw-r--r--xorg-server/Xi/ungrdevb.c8
-rw-r--r--xorg-server/Xi/ungrdevk.c8
-rw-r--r--xorg-server/Xi/xiallowev.c8
-rw-r--r--xorg-server/Xi/xichangecursor.c224
-rw-r--r--xorg-server/Xi/xichangehierarchy.c11
-rw-r--r--xorg-server/Xi/xigetclientpointer.c12
-rw-r--r--xorg-server/Xi/xigrabdev.c316
-rw-r--r--xorg-server/Xi/xipassivegrab.c47
-rw-r--r--xorg-server/Xi/xiproperty.c2710
-rw-r--r--xorg-server/Xi/xiquerydevice.c66
-rw-r--r--xorg-server/Xi/xiquerypointer.c28
-rw-r--r--xorg-server/Xi/xiqueryversion.c17
-rw-r--r--xorg-server/Xi/xiselectev.c614
-rw-r--r--xorg-server/Xi/xisetclientpointer.c8
-rw-r--r--xorg-server/Xi/xisetdevfocus.c23
-rw-r--r--xorg-server/Xi/xiwarppointer.c22
-rw-r--r--xorg-server/composite/compext.c74
-rw-r--r--xorg-server/configure.ac32
-rw-r--r--xorg-server/damageext/damageext.c44
-rw-r--r--xorg-server/dbe/dbe.c63
-rw-r--r--xorg-server/devbook.am45
-rw-r--r--xorg-server/dix/colormap.c7
-rw-r--r--xorg-server/dix/cursor.c2
-rw-r--r--xorg-server/dix/dispatch.c23
-rw-r--r--xorg-server/dix/swaprep.c2537
-rw-r--r--xorg-server/dix/swapreq.c2116
-rw-r--r--xorg-server/docbook.am114
-rw-r--r--xorg-server/fb/wfbrename.h340
-rw-r--r--xorg-server/glx/glxserver.h470
-rw-r--r--xorg-server/hw/dmx/config/xdmxconfig.c23
-rw-r--r--xorg-server/hw/dmx/dmx.c2165
-rw-r--r--xorg-server/hw/dmx/dmxclient.h1
-rw-r--r--xorg-server/hw/dmx/dmxcursor.h4
-rw-r--r--xorg-server/hw/dmx/dmxextension.c2
-rw-r--r--xorg-server/hw/dmx/dmxinit.c11
-rw-r--r--xorg-server/hw/dmx/dmxprop.c695
-rw-r--r--xorg-server/hw/dmx/doc/dmx.xml6860
-rw-r--r--xorg-server/hw/dmx/examples/dmxwininfo.c3
-rw-r--r--xorg-server/hw/dmx/glxProxy/glxcmds.c41
-rw-r--r--xorg-server/hw/dmx/glxProxy/glxscreens.c703
-rw-r--r--xorg-server/hw/dmx/glxProxy/glxserver.h612
-rw-r--r--xorg-server/hw/dmx/glxProxy/render2swap.c2
-rw-r--r--xorg-server/hw/dmx/input/dmxinputinit.c6
-rw-r--r--xorg-server/hw/dmx/input/lnx-keyboard.c1980
-rw-r--r--xorg-server/hw/dmx/input/usb-common.c762
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyrdriext.c24
-rw-r--r--xorg-server/hw/kdrive/ephyr/ephyrhostproxy.c2
-rw-r--r--xorg-server/hw/vfb/InitOutput.c3
-rw-r--r--xorg-server/hw/xfree86/common/xf86.h1
-rw-r--r--xorg-server/hw/xfree86/common/xf86Config.c30
-rw-r--r--xorg-server/hw/xfree86/common/xf86Globals.c5
-rw-r--r--xorg-server/hw/xfree86/common/xf86Helper.c10
-rw-r--r--xorg-server/hw/xfree86/common/xf86Init.c12
-rw-r--r--xorg-server/hw/xfree86/common/xf86Module.h2
-rw-r--r--xorg-server/hw/xfree86/common/xf86Privstr.h335
-rw-r--r--xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c4224
-rw-r--r--xorg-server/hw/xfree86/dri/xf86dri.c24
-rw-r--r--xorg-server/hw/xfree86/dri2/dri2.c41
-rw-r--r--xorg-server/hw/xfree86/dri2/dri2.h31
-rw-r--r--xorg-server/hw/xfree86/dri2/dri2ext.c16
-rw-r--r--xorg-server/hw/xfree86/i2c/fi1236.c1280
-rw-r--r--xorg-server/hw/xfree86/int10/generic.c976
-rw-r--r--xorg-server/hw/xfree86/int10/helper_exec.c1466
-rw-r--r--xorg-server/hw/xfree86/int10/helper_mem.c651
-rw-r--r--xorg-server/hw/xfree86/man/Xorg.man7
-rw-r--r--xorg-server/hw/xfree86/man/xorg.conf.man6
-rw-r--r--xorg-server/hw/xfree86/modes/xf86Cursors.c4
-rw-r--r--xorg-server/hw/xfree86/modes/xf86Modes.c1501
-rw-r--r--xorg-server/hw/xfree86/os-support/bsd/bsd_init.c17
-rw-r--r--xorg-server/hw/xfree86/os-support/linux/lnx_init.c25
-rw-r--r--xorg-server/hw/xfree86/os-support/solaris/sun_init.c866
-rw-r--r--xorg-server/hw/xfree86/ramdac/xf86Cursor.c6
-rw-r--r--xorg-server/hw/xfree86/ramdac/xf86HWCurs.c1054
-rw-r--r--xorg-server/hw/xfree86/utils/man/cvt.man3
-rw-r--r--xorg-server/hw/xfree86/utils/man/gtf.man3
-rw-r--r--xorg-server/hw/xfree86/x86emu/sys.c2
-rw-r--r--xorg-server/hw/xnest/GC.c663
-rw-r--r--xorg-server/hw/xnest/XNCursor.h118
-rw-r--r--xorg-server/hw/xnest/XNGC.h85
-rw-r--r--xorg-server/hw/xquartz/applewm.c8
-rw-r--r--xorg-server/hw/xquartz/pseudoramiX.c933
-rw-r--r--xorg-server/hw/xquartz/xpr/appledri.c838
-rw-r--r--xorg-server/hw/xwin/winwindowswm.c1224
-rw-r--r--xorg-server/include/colormapst.h17
-rw-r--r--xorg-server/include/cursor.h280
-rw-r--r--xorg-server/include/dix-config.h.in6
-rw-r--r--xorg-server/include/dixstruct.h9
-rw-r--r--xorg-server/include/misc.h100
-rw-r--r--xorg-server/include/xorg-config.h.in287
-rw-r--r--xorg-server/mi/miarc.c7180
-rw-r--r--xorg-server/mi/mifpoly.h6
-rw-r--r--xorg-server/mi/miwideline.c4394
-rw-r--r--xorg-server/os/connection.c6
-rw-r--r--xorg-server/os/io.c2294
-rw-r--r--xorg-server/randr/rrcrtc.c100
-rw-r--r--xorg-server/randr/rrdispatch.c9
-rw-r--r--xorg-server/randr/rrmode.c763
-rw-r--r--xorg-server/randr/rroutput.c1249
-rw-r--r--xorg-server/randr/rrproperty.c48
-rw-r--r--xorg-server/randr/rrscreen.c106
-rw-r--r--xorg-server/randr/rrsdispatch.c262
-rw-r--r--xorg-server/randr/rrxinerama.c942
-rw-r--r--xorg-server/record/record.c98
-rw-r--r--xorg-server/render/mipict.c1216
-rw-r--r--xorg-server/render/render.c442
-rw-r--r--xorg-server/test/xi2/protocol-eventconvert.c110
-rw-r--r--xorg-server/test/xi2/protocol-xigetclientpointer.c12
-rw-r--r--xorg-server/test/xi2/protocol-xigetselectedevents.c17
-rw-r--r--xorg-server/test/xi2/protocol-xipassivegrabdevice.c29
-rw-r--r--xorg-server/test/xi2/protocol-xiquerydevice.c49
-rw-r--r--xorg-server/test/xi2/protocol-xiquerypointer.c24
-rw-r--r--xorg-server/test/xi2/protocol-xiqueryversion.c16
-rw-r--r--xorg-server/test/xi2/protocol-xiselectevents.c11
-rw-r--r--xorg-server/test/xi2/protocol-xisetclientpointer.c7
-rw-r--r--xorg-server/test/xi2/protocol-xiwarppointer.c19
-rw-r--r--xorg-server/xfixes/cursor.c122
-rw-r--r--xorg-server/xfixes/region.c156
-rw-r--r--xorg-server/xfixes/saveset.c143
-rw-r--r--xorg-server/xfixes/select.c579
-rw-r--r--xorg-server/xfixes/xfixes.c16
-rw-r--r--xorg-server/xkb/ddxList.c5
-rw-r--r--xorg-server/xkb/xkb.c413
-rw-r--r--xorg-server/xkb/xkbEvents.c105
-rw-r--r--xorg-server/xkb/xkbSwap.c338
244 files changed, 53719 insertions, 56086 deletions
diff --git a/X11/xtrans/Xtranslcl.c b/X11/xtrans/Xtranslcl.c
index 59762da1b..a4f3b1062 100644
--- a/X11/xtrans/Xtranslcl.c
+++ b/X11/xtrans/Xtranslcl.c
@@ -748,15 +748,11 @@ TRANS(NAMEDOpenPipe)(const char *server_path)
struct stat sbuf;
int mode;
-#if defined(sun) && defined(X11_t)
- mode = 0775; /* Solaris requires uid or gid 0 to create X11 pipes */
-#else
#ifdef HAS_STICKY_DIR_BIT
mode = 01777;
#else
mode = 0777;
#endif
-#endif
if (trans_mkdir(X_STREAMS_DIR, mode) == -1) {
PRMSG (1, "NAMEDOpenPipe: mkdir(%s) failed, errno = %d\n",
X_STREAMS_DIR, errno, 0);
diff --git a/X11/xtrans/doc/xtrans.xml b/X11/xtrans/doc/xtrans.xml
index 0fb62eb05..5b01b89be 100644
--- a/X11/xtrans/doc/xtrans.xml
+++ b/X11/xtrans/doc/xtrans.xml
@@ -11,30 +11,28 @@
<bookinfo>
<title>X Transport Interface</title>
<subtitle>X Consortium Standard</subtitle>
- <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
<authorgroup>
- <author>
- <firstname>Stuart</firstname><surname>Anderson</surname>
- <affiliation><orgname>NCR Corporation</orgname></affiliation>
- </author>
+ <author>
+ <firstname>Stuart</firstname><surname>Anderson</surname>
+ <affiliation><orgname>NCR Corporation</orgname></affiliation>
+ </author>
+ <othercredit><firstname>Ralph</firstname><surname>Mor</surname>
+ <affiliation><orgname>X Consortium</orgname></affiliation>
+ </othercredit>
+ <othercredit><firstname>Alan</firstname><surname>Coopersmith</surname>
+ <affiliation><orgname>Oracle Corp.</orgname></affiliation>
+ </othercredit>
</authorgroup>
- <othercredit><firstname>Ralph</firstname><surname>Mor</surname>
- <affiliation><orgname>X Consortium</orgname></affiliation>
- </othercredit>
- <othercredit><firstname>Alan</firstname><surname>Coopersmith</surname>
- <affiliation><orgname>Oracle Corp.</orgname></affiliation>
- </othercredit>
+ <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
<releaseinfo>Version 0.7</releaseinfo>
+ <copyright><year>1993</year><year>1994</year>
+ <holder>NCR Corporation - Dayton, Ohio, USA</holder>
+ </copyright>
<legalnotice>
-<para role="multiLicensing">
-Copyright &copy; 1993, 1994 NCR Corporation - Dayton, Ohio, USA
-</para>
-
<para>
All Rights Reserved
</para>
-
<para>
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted, provided
@@ -46,7 +44,6 @@ written prior permission. NCR makes no representations about the
suitability of this software for any purpose. It is provided "as is"
without express or implied warranty.
</para>
-
<para>
NCR DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
@@ -56,14 +53,12 @@ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
</para>
-
</legalnotice>
<legalnotice>
<para role="multiLicensing">
Copyright &copy; 1993, 1994, 2002 The Open Group
</para>
-
<para>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the &ldquo;Software&rdquo;), to deal
@@ -72,12 +67,10 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
</para>
-
<para>
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
</para>
-
<para>
THE SOFTWARE IS PROVIDED &ldquo;AS IS&rdquo;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
@@ -86,19 +79,15 @@ OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</para>
-
<para>
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
</para>
-
<para>
X Window System is a trademark of The Open Group, Inc.
</para>
-
</legalnotice>
-
</bookinfo>
<preface><title>The X Transport Interface</title>
diff --git a/libX11/nls/en_US.UTF-8/Compose.pre b/libX11/nls/en_US.UTF-8/Compose.pre
index b850db1f8..fb64cb969 100644
--- a/libX11/nls/en_US.UTF-8/Compose.pre
+++ b/libX11/nls/en_US.UTF-8/Compose.pre
@@ -1,5382 +1,5386 @@
-XCOMM UTF-8 (Unicode) compose sequence
-XCOMM David.Monniaux@ens.fr
-XCOMM
-
-XCOMM Part 1 - Manual definitions
-
-XCOMM Spacing versions of dead accents
-<dead_tilde> <space> : "~" asciitilde # TILDE
-<dead_tilde> <dead_tilde> : "~" asciitilde # TILDE
-<dead_acute> <space> : "'" apostrophe # APOSTROPHE
-<dead_acute> <dead_acute> : "´" acute # ACUTE ACCENT
-<dead_grave> <space> : "`" grave # GRAVE ACCENT
-<dead_grave> <dead_grave> : "`" grave # GRAVE ACCENT
-<dead_circumflex> <space> : "^" asciicircum # CIRCUMFLEX ACCENT
-<dead_circumflex> <dead_circumflex> : "^" asciicircum # CIRCUMFLEX ACCENT
-<dead_abovering> <space> : "°" degree # DEGREE SIGN
-<dead_abovering> <dead_abovering> : "°" degree # DEGREE SIGN
-<dead_macron> <space> : "¯" macron # MACRON
-<dead_macron> <dead_macron> : "¯" macron # MACRON
-<dead_breve> <space> : "˘" breve # BREVE
-<dead_breve> <dead_breve> : "˘" breve # BREVE
-<dead_abovedot> <space> : "˙" abovedot # DOT ABOVE
-<dead_abovedot> <dead_abovedot> : "˙" abovedot # DOT ABOVE
-<dead_diaeresis> <dead_diaeresis> : "¨" diaeresis # DIAERESIS
-<dead_diaeresis> <space> : "\"" quotedbl # REVERSE SOLIDUS
-<dead_doubleacute> <space> : "˝" U2dd # DOUBLE ACUTE ACCENT
-<dead_doubleacute> <dead_doubleacute> : "˝" U2dd # DOUBLE ACUTE ACCENT
-<dead_caron> <space> : "ˇ" caron # CARON
-<dead_caron> <dead_caron> : "ˇ" caron # CARON
-<dead_cedilla> <space> : "¸" cedilla # CEDILLA
-<dead_cedilla> <dead_cedilla> : "¸" cedilla # CEDILLA
-<dead_ogonek> <space> : "˛" ogonek # OGONEK
-<dead_ogonek> <dead_ogonek> : "˛" ogonek # OGONEK
-<dead_iota> <space> : "ͺ" U37a # GREEK YPOGEGRAMMENI
-<dead_iota> <dead_iota> : "ͺ" U37a # GREEK YPOGEGRAMMENI
-
-
-XCOMM ASCII characters that may be difficult to access
-XCOMM on some keyboards.
-<Multi_key> <plus> <plus> : "#" numbersign # NUMBER SIGN
-<Multi_key> <apostrophe> <space> : "'" apostrophe # APOSTROPHE
-<Multi_key> <space> <apostrophe> : "'" apostrophe # APOSTROPHE
-<Multi_key> <A> <T> : "@" at # COMMERCIAL AT
-<Multi_key> <parenleft> <parenleft> : "[" bracketleft # LEFT SQUARE BRACKET
-<Multi_key> <slash> <slash> : "\\" backslash # REVERSE SOLIDUS
-<Multi_key> <slash> <less> : "\\" backslash # REVERSE SOLIDUS
-<Multi_key> <less> <slash> : "\\" backslash # REVERSE SOLIDUS
-<Multi_key> <parenright> <parenright> : "]" bracketright # RIGHT SQUARE BRACKET
-
-<Multi_key> <asciicircum> <space> : "^" asciicircum # CIRCUMFLEX ACCENT
-<Multi_key> <space> <asciicircum> : "^" asciicircum # CIRCUMFLEX ACCENT
-<Multi_key> <greater> <space> : "^" asciicircum # CIRCUMFLEX ACCENT
-<Multi_key> <space> <greater> : "^" asciicircum # CIRCUMFLEX ACCENT
-
-<Multi_key> <grave> <space> : "`" grave # GRAVE ACCENT
-<Multi_key> <space> <grave> : "`" grave # GRAVE ACCENT
-
-<Multi_key> <comma> <space> : "¸" cedilla # CEDILLA
-<Multi_key> <space> <comma> : "¸" cedilla # CEDILLA
-
-<Multi_key> <parenleft> <minus> : "{" braceleft # LEFT CURLY BRACKET
-<Multi_key> <minus> <parenleft> : "{" braceleft # LEFT CURLY BRACKET
-
-<Multi_key> <slash> <asciicircum> : "|" bar # VERTICAL LINE
-<Multi_key> <asciicircum> <slash> : "|" bar # VERTICAL LINE
-<Multi_key> <V> <L> : "|" bar # VERTICAL LINE
-<Multi_key> <L> <V> : "|" bar # VERTICAL LINE
-<Multi_key> <v> <l> : "|" bar # VERTICAL LINE
-<Multi_key> <l> <v> : "|" bar # VERTICAL LINE
-
-<Multi_key> <parenright> <minus> : "}" braceright # RIGHT CURLY BRACKET
-<Multi_key> <minus> <parenright> : "}" braceright # RIGHT CURLY BRACKET
-
-<Multi_key> <asciitilde> <space> : "~" asciitilde # TILDE
-<Multi_key> <space> <asciitilde> : "~" asciitilde # TILDE
-<Multi_key> <minus> <space> : "~" asciitilde # TILDE
-<Multi_key> <space> <minus> : "~" asciitilde # TILDE
-
-XCOMM Spaces
-<Multi_key> <space> <space> : " " nobreakspace # NO-BREAK SPACE
-<Multi_key> <space> <period> : " " U2008 # PUNCTUATION SPACE
-
-<Multi_key> <o> <c> : "©" copyright # COPYRIGHT SIGN
-<Multi_key> <o> <C> : "©" copyright # COPYRIGHT SIGN
-<Multi_key> <O> <c> : "©" copyright # COPYRIGHT SIGN
-<Multi_key> <O> <C> : "©" copyright # COPYRIGHT SIGN
-
-<Multi_key> <o> <r> : "®" registered # REGISTERED SIGN
-<Multi_key> <o> <R> : "®" registered # REGISTERED SIGN
-<Multi_key> <O> <r> : "®" registered # REGISTERED SIGN
-<Multi_key> <O> <R> : "®" registered # REGISTERED SIGN
-
-<Multi_key> <period> <greater> : "›" U203a # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
-<Multi_key> <period> <less> : "‹" U2039 # SINGLE LEFT-POINTING ANGLE QUOTATION MARK
-<Multi_key> <period> <period> : "…" ellipsis # HORIZONTAL ELLIPSIS
-<Multi_key> <period> <minus> : "·" periodcentered # MIDDLE DOT
-<Multi_key> <period> <equal> : "•" enfilledcircbullet # BULLET
-<Multi_key> <exclam> <asciicircum> : "¦" brokenbar # BROKEN BAR
-<Multi_key> <exclam> <exclam> : "¡" exclamdown # INVERTED EXCLAMATION MARK
-<Multi_key> <p> <exclam> : "¶" paragraph # PILCROW SIGN
-<Multi_key> <P> <exclam> : "¶" paragraph # PILCROW SIGN
-<Multi_key> <plus> <minus> : "±" plusminus # PLUS-MINUS SIGN
-<Multi_key> <question> <question> : "¿" questiondown # INVERTED QUESTION MARK
-<Multi_key> <minus> <d> : "đ" dstroke # LATIN SMALL LETTER D WITH STROKE
-<Multi_key> <minus> <D> : "Đ" Dstroke # LATIN CAPITAL LETTER D WITH STROKE
-<Multi_key> <s> <s> : "ß" ssharp # LATIN SMALL LETTER SHARP S
-<Multi_key> <S> <S> : "ẞ" Ssharp # LATIN CAPITAL LETTER SHARP S
-
-<Multi_key> <o> <e> : "œ" oe # LATIN SMALL LIGATURE OE
-<Multi_key> <O> <E> : "Œ" OE # LATIN CAPITAL LIGATURE OE
-<Multi_key> <a> <e> : "æ" ae # LATIN SMALL LETTER AE
-<Multi_key> <A> <E> : "Æ" AE # LATIN CAPITAL LETTER AE
-
-<Multi_key> <o> <o> : "°" degree # DEGREE SIGN
-
-XCOMM Quotation marks
-<Multi_key> <quotedbl> <backslash> : "〝" U301d # REVERSED DOUBLE PRIME QUOTATION MARK
-<Multi_key> <quotedbl> <slash> : "〞" U301e # DOUBLE PRIME QUOTATION MARK
-<Multi_key> <less> <less> : "«" guillemotleft # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
-<Multi_key> <greater> <greater> : "»" guillemotright # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
-<Multi_key> <less> <apostrophe> : "‘" U2018 # LEFT SINGLE QUOTATION MARK
-<Multi_key> <apostrophe> <less> : "‘" U2018 # LEFT SINGLE QUOTATION MARK
-<Multi_key> <greater> <apostrophe> : "’" U2019 # RIGHT SINGLE QUOTATION MARK
-<Multi_key> <apostrophe> <greater> : "’" U2019 # RIGHT SINGLE QUOTATION MARK
-<Multi_key> <comma> <apostrophe> : "‚" U201a # SINGLE LOW-9 QUOTATION MARK
-<Multi_key> <apostrophe> <comma> : "‚" U201a # SINGLE LOW-9 QUOTATION MARK
-<Multi_key> <less> <quotedbl> : "“" U201c # LEFT DOUBLE QUOTATION MARK
-<Multi_key> <quotedbl> <less> : "“" U201c # LEFT DOUBLE QUOTATION MARK
-<Multi_key> <greater> <quotedbl> : "”" U201d # RIGHT DOUBLE QUOTATION MARK
-<Multi_key> <quotedbl> <greater> : "”" U201d # RIGHT DOUBLE QUOTATION MARK
-<Multi_key> <comma> <quotedbl> : "„" U201e # DOUBLE LOW-9 QUOTATION MARK
-<Multi_key> <quotedbl> <comma> : "„" U201e # DOUBLE LOW-9 QUOTATION MARK
-
-XCOMM Per xxx
-<Multi_key> <percent> <o> : "‰" U2030 # PER MILLE SIGN
-
-XCOMM Currencies
-<Multi_key> <C> <E> : "₠" U20a0 # EURO-CURRENCY SIGN
-<Multi_key> <C> <slash> : "₡" U20a1 # COLON SIGN
-<Multi_key> <slash> <C> : "₡" U20a1 # COLON SIGN
-<Multi_key> <C> <r> : "₢" U20a2 # CRUZEIRO SIGN
-<Multi_key> <F> <r> : "₣" U20a3 # FRENCH FRANC SIGN
-<Multi_key> <L> <equal> : "₤" U20a4 # LIRA SIGN
-<Multi_key> <equal> <L> : "₤" U20a4 # LIRA SIGN
-<Multi_key> <m> <slash> : "₥" U20a5 # MILL SIGN
-<Multi_key> <slash> <m> : "₥" U20a5 # MILL SIGN
-<Multi_key> <N> <equal> : "₦" U20a6 # NAIRA SIGN
-<Multi_key> <equal> <N> : "₦" U20a6 # NAIRA SIGN
-<Multi_key> <P> <t> : "₧" U20a7 # PESETA SIGN
-<Multi_key> <R> <s> : "₨" U20a8 # RUPEE SIGN
-<Multi_key> <W> <equal> : "₩" U20a9 # WON SIGN
-<Multi_key> <equal> <W> : "₩" U20a9 # WON SIGN
-XCOMM "₪" U20aa NEW SHEQEL SIGN
-<Multi_key> <d> <minus> : "₫" U20ab # DONG SIGN
-<Multi_key> <C> <equal> : "€" EuroSign # EURO SIGN
-<Multi_key> <equal> <C> : "€" EuroSign # EURO SIGN
-<Multi_key> <c> <equal> : "€" EuroSign # EURO SIGN
-<Multi_key> <equal> <c> : "€" EuroSign # EURO SIGN
-<Multi_key> <E> <equal> : "€" EuroSign # EURO SIGN
-<Multi_key> <equal> <E> : "€" EuroSign # EURO SIGN
-<Multi_key> <e> <equal> : "€" EuroSign # EURO SIGN
-<Multi_key> <equal> <e> : "€" EuroSign # EURO SIGN
-<Multi_key> <Cyrillic_ES> <equal> : "€" EuroSign # EURO SIGN
-<Multi_key> <equal> <Cyrillic_ES> : "€" EuroSign # EURO SIGN
-<Multi_key> <Cyrillic_IE> <equal> : "€" EuroSign # EURO SIGN
-<Multi_key> <equal> <Cyrillic_IE> : "€" EuroSign # EURO SIGN
-XCOMM "₭" U20ad KIP SIGN
-XCOMM "₮" U20ae TUGRIK SIGN
-XCOMM "₯" U20af DRACHMA SIGN
-XCOMM "₰" U20b0 GERMAN PENNY SIGN
-XCOMM "₱" U20b1 PESO SIGN
-XCOMM "₲" U20b2 GUARANI SIGN
-XCOMM "₳" U20b3 AUSTRAL SIGN
-XCOMM "₴" U20b4 HRYVNIA SIGN
-XCOMM "₵" U20b5 CEDI SIGN
-
-
-<Multi_key> <bar> <c> : "¢" cent # CENT SIGN
-<Multi_key> <c> <bar> : "¢" cent # CENT SIGN
-<Multi_key> <c> <slash> : "¢" cent # CENT SIGN
-<Multi_key> <slash> <c> : "¢" cent # CENT SIGN
-<Multi_key> <L> <minus> : "£" sterling # POUND SIGN
-<Multi_key> <minus> <L> : "£" sterling # POUND SIGN
-<Multi_key> <Y> <equal> : "¥" yen # YEN SIGN
-<Multi_key> <equal> <Y> : "¥" yen # YEN SIGN
-
-XCOMM Long S
-<Multi_key> <f> <s> : "ſ" U017f # LATIN SMALL LETTER LONG S
-<Multi_key> <f> <S> : "ſ" U017f # LATIN SMALL LETTER LONG S
-
-XCOMM Dashes
-<Multi_key> <minus> <minus> <period> : "–" U2013 # EN DASH
-<Multi_key> <minus> <minus> <minus> : "—" U2014 # EM DASH
-
-XCOMM Musical alterations
-<Multi_key> <numbersign> <b> : "♭" U266d # MUSIC FLAT SIGN
-<Multi_key> <numbersign> <f> : "♮" U266e # MUSIC NATURAL SIGN
-<Multi_key> <numbersign> <numbersign> : "♯" U266f # MUSIC SHARP SIGN
-
-XCOMM Other symbols
-<Multi_key> <s> <o> : "§" section # SECTION SIGN
-<Multi_key> <o> <s> : "§" section # SECTION SIGN
-<Multi_key> <Cyrillic_pe> <Cyrillic_a> : "§" section # SECTION SIGN
-
-<Multi_key> <o> <x> : "¤" currency # CURRENCY SIGN
-<Multi_key> <x> <o> : "¤" currency # CURRENCY SIGN
-
-<Multi_key> <P> <P> : "¶" paragraph # PILCROW SIGN
-
-<Multi_key> <N> <o> : "№" numerosign # NUMERO SIGN
-<Multi_key> <N> <O> : "№" numerosign # NUMERO SIGN
-<Multi_key> <Cyrillic_EN> <Cyrillic_o> : "№" numerosign # NUMERO SIGN
-<Multi_key> <Cyrillic_EN> <Cyrillic_O> : "№" numerosign # NUMERO SIGN
-
-<Multi_key> <question> <exclam> : "⸘" U2E18 # INVERTED INTERROBANG
-<Multi_key> <exclam> <question> : "‽" U203D # INTERROBANG
-
-<Multi_key> <C> <C> <C> <P> : "☭" U262D # HAMMER AND SICKLE
-<Multi_key> <O> <A> : "Ⓐ" U24B6 # CIRCLED LATIN CAPITAL LETTER A
-<Multi_key> <less> <3> : "♥" U2665 # BLACK HEART SUIT
-
-<Multi_key> <colon> <parenright> : "☺" U263A # WHITE SMILING FACE
-<Multi_key> <colon> <parenleft> : "☹" U2639 # WHITE FROWNING FACE
-
-XCOMM Part 2
-
-XCOMM Compose map for Korean Hangul(Choseongul) Conjoining Jamos automatically
-XCOMM generated from UnicodeData-2.0.14.txt at
-XCOMM ftp://ftp.unicode.org/Public/2.0-Update/UnicodeData-2.0.14.txt
-XCOMM by Jungshik Shin <jshin@jshin.net> 2002-10-17
-XCOMM There are some conflicts among sequences, but I left them alone.
-XCOMM
-XCOMM group 1: cluster jamos made of three basic jamos
-
-/* The follwing block gets overridden by later shorter compositions
- * <Multi_key> <U1107> <U1109> <U1100> : "ᄢ" U1122 # HANGUL CHOSEONG PIEUP-SIOS-KIYEOK
- * <Multi_key> <U1107> <U1109> <U1103> : "ᄣ" U1123 # HANGUL CHOSEONG PIEUP-SIOS-TIKEUT
- * <Multi_key> <U1107> <U1109> <U1107> : "ᄤ" U1124 # HANGUL CHOSEONG PIEUP-SIOS-PIEUP
- * <Multi_key> <U1107> <U1109> <U1109> : "ᄥ" U1125 # HANGUL CHOSEONG PIEUP-SSANGSIOS
- * <Multi_key> <U1107> <U1109> <U110C> : "ᄦ" U1126 # HANGUL CHOSEONG PIEUP-SIOS-CIEUC
- * <Multi_key> <U1107> <U1107> <U110B> : "ᄬ" U112c # HANGUL CHOSEONG KAPYEOUNSSANGPIEUP
- * <Multi_key> <U1109> <U1107> <U1100> : "ᄳ" U1133 # HANGUL CHOSEONG SIOS-PIEUP-KIYEOK
- * <Multi_key> <U1109> <U1109> <U1109> : "ᄴ" U1134 # HANGUL CHOSEONG SIOS-SSANGSIOS
- * <Multi_key> <U1169> <U1161> <U1175> : "ᅫ" U116b # HANGUL JUNGSEONG WAE
- * <Multi_key> <U116E> <U1165> <U1175> : "ᅰ" U1170 # HANGUL JUNGSEONG WE
- * <Multi_key> <U116E> <U1165> <U1173> : "ᆋ" U118b # HANGUL JUNGSEONG U-EO-EU
- * <Multi_key> <U11A8> <U11BA> <U11A8> : "ᇄ" U11c4 # HANGUL JONGSEONG KIYEOK-SIOS-KIYEOK
- * <Multi_key> <U11AF> <U11A8> <U11BA> : "ᇌ" U11cc # HANGUL JONGSEONG RIEUL-KIYEOK-SIOS
- * <Multi_key> <U11AF> <U11AE> <U11C2> : "ᇏ" U11cf # HANGUL JONGSEONG RIEUL-TIKEUT-HIEUH
- * <Multi_key> <U11AF> <U11B7> <U11A8> : "ᇑ" U11d1 # HANGUL JONGSEONG RIEUL-MIEUM-KIYEOK
- * <Multi_key> <U11AF> <U11B7> <U11BA> : "ᇒ" U11d2 # HANGUL JONGSEONG RIEUL-MIEUM-SIOS
- * <Multi_key> <U11AF> <U11B8> <U11BA> : "ᇓ" U11d3 # HANGUL JONGSEONG RIEUL-PIEUP-SIOS
- * <Multi_key> <U11AF> <U11B8> <U11C2> : "ᇔ" U11d4 # HANGUL JONGSEONG RIEUL-PIEUP-HIEUH
- * <Multi_key> <U11AF> <U11B8> <U11BC> : "ᇕ" U11d5 # HANGUL JONGSEONG RIEUL-KAPYEOUNPIEUP
- * <Multi_key> <U11AF> <U11BA> <U11BA> : "ᇖ" U11d6 # HANGUL JONGSEONG RIEUL-SSANGSIOS
- * <Multi_key> <U11B7> <U11BA> <U11BA> : "ᇞ" U11de # HANGUL JONGSEONG MIEUM-SSANGSIOS
- * <Multi_key> <U11BC> <U11A8> <U11A8> : "ᇭ" U11ed # HANGUL JONGSEONG IEUNG-SSANGKIYEOK
- */
-<Multi_key> <U1100> <U1100> : "ᄁ" U1101 # HANGUL CHOSEONG SSANGKIYEOK
-<Multi_key> <U1103> <U1103> : "ᄄ" U1104 # HANGUL CHOSEONG SSANGTIKEUT
-<Multi_key> <U1107> <U1107> : "ᄈ" U1108 # HANGUL CHOSEONG SSANGPIEUP
-<Multi_key> <U1109> <U1109> : "ᄊ" U110a # HANGUL CHOSEONG SSANGSIOS
-<Multi_key> <U110C> <U110C> : "ᄍ" U110d # HANGUL CHOSEONG SSANGCIEUC
-<Multi_key> <U1102> <U1100> : "ᄓ" U1113 # HANGUL CHOSEONG NIEUN-KIYEOK
-<Multi_key> <U1102> <U1102> : "ᄔ" U1114 # HANGUL CHOSEONG SSANGNIEUN
-<Multi_key> <U1102> <U1103> : "ᄕ" U1115 # HANGUL CHOSEONG NIEUN-TIKEUT
-<Multi_key> <U1102> <U1107> : "ᄖ" U1116 # HANGUL CHOSEONG NIEUN-PIEUP
-<Multi_key> <U1103> <U1100> : "ᄗ" U1117 # HANGUL CHOSEONG TIKEUT-KIYEOK
-<Multi_key> <U1105> <U1102> : "ᄘ" U1118 # HANGUL CHOSEONG RIEUL-NIEUN
-<Multi_key> <U1105> <U1105> : "ᄙ" U1119 # HANGUL CHOSEONG SSANGRIEUL
-<Multi_key> <U1105> <U1112> : "ᄚ" U111a # HANGUL CHOSEONG RIEUL-HIEUH
-<Multi_key> <U1105> <U110B> : "ᄛ" U111b # HANGUL CHOSEONG KAPYEOUNRIEUL
-<Multi_key> <U1106> <U1107> : "ᄜ" U111c # HANGUL CHOSEONG MIEUM-PIEUP
-<Multi_key> <U1106> <U110B> : "ᄝ" U111d # HANGUL CHOSEONG KAPYEOUNMIEUM
-<Multi_key> <U1107> <U1100> : "ᄞ" U111e # HANGUL CHOSEONG PIEUP-KIYEOK
-<Multi_key> <U1107> <U1102> : "ᄟ" U111f # HANGUL CHOSEONG PIEUP-NIEUN
-<Multi_key> <U1107> <U1103> : "ᄠ" U1120 # HANGUL CHOSEONG PIEUP-TIKEUT
-<Multi_key> <U1107> <U1109> : "ᄡ" U1121 # HANGUL CHOSEONG PIEUP-SIOS
-<Multi_key> <U1107> <U110C> : "ᄧ" U1127 # HANGUL CHOSEONG PIEUP-CIEUC
-<Multi_key> <U1107> <U110E> : "ᄨ" U1128 # HANGUL CHOSEONG PIEUP-CHIEUCH
-<Multi_key> <U1107> <U1110> : "ᄩ" U1129 # HANGUL CHOSEONG PIEUP-THIEUTH
-<Multi_key> <U1107> <U1111> : "ᄪ" U112a # HANGUL CHOSEONG PIEUP-PHIEUPH
-<Multi_key> <U1107> <U110B> : "ᄫ" U112b # HANGUL CHOSEONG KAPYEOUNPIEUP
-<Multi_key> <U1109> <U1100> : "ᄭ" U112d # HANGUL CHOSEONG SIOS-KIYEOK
-<Multi_key> <U1109> <U1102> : "ᄮ" U112e # HANGUL CHOSEONG SIOS-NIEUN
-<Multi_key> <U1109> <U1103> : "ᄯ" U112f # HANGUL CHOSEONG SIOS-TIKEUT
-<Multi_key> <U1109> <U1105> : "ᄰ" U1130 # HANGUL CHOSEONG SIOS-RIEUL
-<Multi_key> <U1109> <U1106> : "ᄱ" U1131 # HANGUL CHOSEONG SIOS-MIEUM
-<Multi_key> <U1109> <U1107> : "ᄲ" U1132 # HANGUL CHOSEONG SIOS-PIEUP
-<Multi_key> <U1109> <U110B> : "ᄵ" U1135 # HANGUL CHOSEONG SIOS-IEUNG
-<Multi_key> <U1109> <U110C> : "ᄶ" U1136 # HANGUL CHOSEONG SIOS-CIEUC
-<Multi_key> <U1109> <U110E> : "ᄷ" U1137 # HANGUL CHOSEONG SIOS-CHIEUCH
-<Multi_key> <U1109> <U110F> : "ᄸ" U1138 # HANGUL CHOSEONG SIOS-KHIEUKH
-<Multi_key> <U1109> <U1110> : "ᄹ" U1139 # HANGUL CHOSEONG SIOS-THIEUTH
-<Multi_key> <U1109> <U1111> : "ᄺ" U113a # HANGUL CHOSEONG SIOS-PHIEUPH
-<Multi_key> <U1109> <U1112> : "ᄻ" U113b # HANGUL CHOSEONG SIOS-HIEUH
-<Multi_key> <U113C> <U113C> : "ᄽ" U113d # HANGUL CHOSEONG CHITUEUMSSANGSIOS
-<Multi_key> <U113E> <U113E> : "ᄿ" U113f # HANGUL CHOSEONG CEONGCHIEUMSSANGSIOS
-<Multi_key> <U110B> <U1100> : "ᅁ" U1141 # HANGUL CHOSEONG IEUNG-KIYEOK
-<Multi_key> <U110B> <U1103> : "ᅂ" U1142 # HANGUL CHOSEONG IEUNG-TIKEUT
-<Multi_key> <U110B> <U1106> : "ᅃ" U1143 # HANGUL CHOSEONG IEUNG-MIEUM
-<Multi_key> <U110B> <U1107> : "ᅄ" U1144 # HANGUL CHOSEONG IEUNG-PIEUP
-<Multi_key> <U110B> <U1109> : "ᅅ" U1145 # HANGUL CHOSEONG IEUNG-SIOS
-<Multi_key> <U110B> <U1140> : "ᅆ" U1146 # HANGUL CHOSEONG IEUNG-PANSIOS
-<Multi_key> <U110B> <U110B> : "ᅇ" U1147 # HANGUL CHOSEONG SSANGIEUNG
-<Multi_key> <U110B> <U110C> : "ᅈ" U1148 # HANGUL CHOSEONG IEUNG-CIEUC
-<Multi_key> <U110B> <U110E> : "ᅉ" U1149 # HANGUL CHOSEONG IEUNG-CHIEUCH
-<Multi_key> <U110B> <U1110> : "ᅊ" U114a # HANGUL CHOSEONG IEUNG-THIEUTH
-<Multi_key> <U110B> <U1111> : "ᅋ" U114b # HANGUL CHOSEONG IEUNG-PHIEUPH
-<Multi_key> <U110C> <U110B> : "ᅍ" U114d # HANGUL CHOSEONG CIEUC-IEUNG
-<Multi_key> <U114E> <U114E> : "ᅏ" U114f # HANGUL CHOSEONG CHITUEUMSSANGCIEUC
-<Multi_key> <U1150> <U1150> : "ᅑ" U1151 # HANGUL CHOSEONG CEONGCHIEUMSSANGCIEUC
-<Multi_key> <U110E> <U110F> : "ᅒ" U1152 # HANGUL CHOSEONG CHIEUCH-KHIEUKH
-<Multi_key> <U110E> <U1112> : "ᅓ" U1153 # HANGUL CHOSEONG CHIEUCH-HIEUH
-<Multi_key> <U1111> <U1107> : "ᅖ" U1156 # HANGUL CHOSEONG PHIEUPH-PIEUP
-<Multi_key> <U1111> <U110B> : "ᅗ" U1157 # HANGUL CHOSEONG KAPYEOUNPHIEUPH
-<Multi_key> <U1112> <U1112> : "ᅘ" U1158 # HANGUL CHOSEONG SSANGHIEUH
-<Multi_key> <U1161> <U1175> : "ᅢ" U1162 # HANGUL JUNGSEONG AE
-<Multi_key> <U1163> <U1175> : "ᅤ" U1164 # HANGUL JUNGSEONG YAE
-<Multi_key> <U1165> <U1175> : "ᅦ" U1166 # HANGUL JUNGSEONG E
-<Multi_key> <U1167> <U1175> : "ᅨ" U1168 # HANGUL JUNGSEONG YE
-<Multi_key> <U1169> <U1161> : "ᅪ" U116a # HANGUL JUNGSEONG WA
-<Multi_key> <U1169> <U1175> : "ᅬ" U116c # HANGUL JUNGSEONG OE
-<Multi_key> <U116E> <U1165> : "ᅯ" U116f # HANGUL JUNGSEONG WEO
-<Multi_key> <U116E> <U1175> : "ᅱ" U1171 # HANGUL JUNGSEONG WI
-<Multi_key> <U1173> <U1175> : "ᅴ" U1174 # HANGUL JUNGSEONG YI
-<Multi_key> <U1161> <U1169> : "ᅶ" U1176 # HANGUL JUNGSEONG A-O
-<Multi_key> <U1161> <U116E> : "ᅷ" U1177 # HANGUL JUNGSEONG A-U
-<Multi_key> <U1163> <U1169> : "ᅸ" U1178 # HANGUL JUNGSEONG YA-O
-<Multi_key> <U1163> <U116D> : "ᅹ" U1179 # HANGUL JUNGSEONG YA-YO
-<Multi_key> <U1165> <U1169> : "ᅺ" U117a # HANGUL JUNGSEONG EO-O
-<Multi_key> <U1165> <U116E> : "ᅻ" U117b # HANGUL JUNGSEONG EO-U
-<Multi_key> <U1165> <U1173> : "ᅼ" U117c # HANGUL JUNGSEONG EO-EU
-<Multi_key> <U1167> <U1169> : "ᅽ" U117d # HANGUL JUNGSEONG YEO-O
-<Multi_key> <U1167> <U116E> : "ᅾ" U117e # HANGUL JUNGSEONG YEO-U
-<Multi_key> <U1169> <U1165> : "ᅿ" U117f # HANGUL JUNGSEONG O-EO
-<Multi_key> <U1169> <U1166> : "ᆀ" U1180 # HANGUL JUNGSEONG O-E
-<Multi_key> <U1169> <U1168> : "ᆁ" U1181 # HANGUL JUNGSEONG O-YE
-<Multi_key> <U1169> <U1169> : "ᆂ" U1182 # HANGUL JUNGSEONG O-O
-<Multi_key> <U1169> <U116E> : "ᆃ" U1183 # HANGUL JUNGSEONG O-U
-<Multi_key> <U116D> <U1163> : "ᆄ" U1184 # HANGUL JUNGSEONG YO-YA
-<Multi_key> <U116D> <U1164> : "ᆅ" U1185 # HANGUL JUNGSEONG YO-YAE
-<Multi_key> <U116D> <U1167> : "ᆆ" U1186 # HANGUL JUNGSEONG YO-YEO
-<Multi_key> <U116D> <U1169> : "ᆇ" U1187 # HANGUL JUNGSEONG YO-O
-<Multi_key> <U116D> <U1175> : "ᆈ" U1188 # HANGUL JUNGSEONG YO-I
-<Multi_key> <U116E> <U1161> : "ᆉ" U1189 # HANGUL JUNGSEONG U-A
-<Multi_key> <U116E> <U1162> : "ᆊ" U118a # HANGUL JUNGSEONG U-AE
-<Multi_key> <U116E> <U1168> : "ᆌ" U118c # HANGUL JUNGSEONG U-YE
-<Multi_key> <U116E> <U116E> : "ᆍ" U118d # HANGUL JUNGSEONG U-U
-<Multi_key> <U1172> <U1161> : "ᆎ" U118e # HANGUL JUNGSEONG YU-A
-<Multi_key> <U1172> <U1165> : "ᆏ" U118f # HANGUL JUNGSEONG YU-EO
-<Multi_key> <U1172> <U1166> : "ᆐ" U1190 # HANGUL JUNGSEONG YU-E
-<Multi_key> <U1172> <U1167> : "ᆑ" U1191 # HANGUL JUNGSEONG YU-YEO
-<Multi_key> <U1172> <U1168> : "ᆒ" U1192 # HANGUL JUNGSEONG YU-YE
-<Multi_key> <U1172> <U116E> : "ᆓ" U1193 # HANGUL JUNGSEONG YU-U
-<Multi_key> <U1172> <U1175> : "ᆔ" U1194 # HANGUL JUNGSEONG YU-I
-<Multi_key> <U1173> <U116E> : "ᆕ" U1195 # HANGUL JUNGSEONG EU-U
-<Multi_key> <U1173> <U1173> : "ᆖ" U1196 # HANGUL JUNGSEONG EU-EU
-<Multi_key> <U1174> <U116E> : "ᆗ" U1197 # HANGUL JUNGSEONG YI-U
-<Multi_key> <U1175> <U1161> : "ᆘ" U1198 # HANGUL JUNGSEONG I-A
-<Multi_key> <U1175> <U1163> : "ᆙ" U1199 # HANGUL JUNGSEONG I-YA
-<Multi_key> <U1175> <U1169> : "ᆚ" U119a # HANGUL JUNGSEONG I-O
-<Multi_key> <U1175> <U116E> : "ᆛ" U119b # HANGUL JUNGSEONG I-U
-<Multi_key> <U1175> <U1173> : "ᆜ" U119c # HANGUL JUNGSEONG I-EU
-<Multi_key> <U1175> <U119E> : "ᆝ" U119d # HANGUL JUNGSEONG I-ARAEA
-<Multi_key> <U119E> <U1165> : "ᆟ" U119f # HANGUL JUNGSEONG ARAEA-EO
-<Multi_key> <U119E> <U116E> : "ᆠ" U11a0 # HANGUL JUNGSEONG ARAEA-U
-<Multi_key> <U119E> <U1175> : "ᆡ" U11a1 # HANGUL JUNGSEONG ARAEA-I
-<Multi_key> <U119E> <U119E> : "ᆢ" U11a2 # HANGUL JUNGSEONG SSANGARAEA
-<Multi_key> <U11A8> <U11A8> : "ᆩ" U11a9 # HANGUL JONGSEONG SSANGKIYEOK
-<Multi_key> <U11A8> <U11BA> : "ᆪ" U11aa # HANGUL JONGSEONG KIYEOK-SIOS
-<Multi_key> <U11AB> <U11BD> : "ᆬ" U11ac # HANGUL JONGSEONG NIEUN-CIEUC
-<Multi_key> <U11AB> <U11C2> : "ᆭ" U11ad # HANGUL JONGSEONG NIEUN-HIEUH
-<Multi_key> <U11AF> <U11A8> : "ᆰ" U11b0 # HANGUL JONGSEONG RIEUL-KIYEOK
-<Multi_key> <U11AF> <U11B7> : "ᆱ" U11b1 # HANGUL JONGSEONG RIEUL-MIEUM
-<Multi_key> <U11AF> <U11B8> : "ᆲ" U11b2 # HANGUL JONGSEONG RIEUL-PIEUP
-<Multi_key> <U11AF> <U11BA> : "ᆳ" U11b3 # HANGUL JONGSEONG RIEUL-SIOS
-<Multi_key> <U11AF> <U11C0> : "ᆴ" U11b4 # HANGUL JONGSEONG RIEUL-THIEUTH
-<Multi_key> <U11AF> <U11C1> : "ᆵ" U11b5 # HANGUL JONGSEONG RIEUL-PHIEUPH
-<Multi_key> <U11AF> <U11C2> : "ᆶ" U11b6 # HANGUL JONGSEONG RIEUL-HIEUH
-<Multi_key> <U11B8> <U11BA> : "ᆹ" U11b9 # HANGUL JONGSEONG PIEUP-SIOS
-<Multi_key> <U11BA> <U11BA> : "ᆻ" U11bb # HANGUL JONGSEONG SSANGSIOS
-<Multi_key> <U11A8> <U11AF> : "ᇃ" U11c3 # HANGUL JONGSEONG KIYEOK-RIEUL
-<Multi_key> <U11AB> <U11A8> : "ᇅ" U11c5 # HANGUL JONGSEONG NIEUN-KIYEOK
-<Multi_key> <U11AB> <U11AE> : "ᇆ" U11c6 # HANGUL JONGSEONG NIEUN-TIKEUT
-<Multi_key> <U11AB> <U11BA> : "ᇇ" U11c7 # HANGUL JONGSEONG NIEUN-SIOS
-<Multi_key> <U11AB> <U11EB> : "ᇈ" U11c8 # HANGUL JONGSEONG NIEUN-PANSIOS
-<Multi_key> <U11AB> <U11C0> : "ᇉ" U11c9 # HANGUL JONGSEONG NIEUN-THIEUTH
-<Multi_key> <U11AE> <U11A8> : "ᇊ" U11ca # HANGUL JONGSEONG TIKEUT-KIYEOK
-<Multi_key> <U11AE> <U11AF> : "ᇋ" U11cb # HANGUL JONGSEONG TIKEUT-RIEUL
-<Multi_key> <U11AF> <U11AB> : "ᇍ" U11cd # HANGUL JONGSEONG RIEUL-NIEUN
-<Multi_key> <U11AF> <U11AE> : "ᇎ" U11ce # HANGUL JONGSEONG RIEUL-TIKEUT
-<Multi_key> <U11AF> <U11AF> : "ᇐ" U11d0 # HANGUL JONGSEONG SSANGRIEUL
-<Multi_key> <U11AF> <U11EB> : "ᇗ" U11d7 # HANGUL JONGSEONG RIEUL-PANSIOS
-<Multi_key> <U11AF> <U11BF> : "ᇘ" U11d8 # HANGUL JONGSEONG RIEUL-KHIEUKH
-<Multi_key> <U11AF> <U11F9> : "ᇙ" U11d9 # HANGUL JONGSEONG RIEUL-YEORINHIEUH
-<Multi_key> <U11B7> <U11A8> : "ᇚ" U11da # HANGUL JONGSEONG MIEUM-KIYEOK
-<Multi_key> <U11B7> <U11AF> : "ᇛ" U11db # HANGUL JONGSEONG MIEUM-RIEUL
-<Multi_key> <U11B7> <U11B8> : "ᇜ" U11dc # HANGUL JONGSEONG MIEUM-PIEUP
-<Multi_key> <U11B7> <U11BA> : "ᇝ" U11dd # HANGUL JONGSEONG MIEUM-SIOS
-<Multi_key> <U11B7> <U11EB> : "ᇟ" U11df # HANGUL JONGSEONG MIEUM-PANSIOS
-<Multi_key> <U11B7> <U11BE> : "ᇠ" U11e0 # HANGUL JONGSEONG MIEUM-CHIEUCH
-<Multi_key> <U11B7> <U11C2> : "ᇡ" U11e1 # HANGUL JONGSEONG MIEUM-HIEUH
-<Multi_key> <U11B7> <U11BC> : "ᇢ" U11e2 # HANGUL JONGSEONG KAPYEOUNMIEUM
-<Multi_key> <U11B8> <U11AF> : "ᇣ" U11e3 # HANGUL JONGSEONG PIEUP-RIEUL
-<Multi_key> <U11B8> <U11C1> : "ᇤ" U11e4 # HANGUL JONGSEONG PIEUP-PHIEUPH
-<Multi_key> <U11B8> <U11C2> : "ᇥ" U11e5 # HANGUL JONGSEONG PIEUP-HIEUH
-<Multi_key> <U11B8> <U11BC> : "ᇦ" U11e6 # HANGUL JONGSEONG KAPYEOUNPIEUP
-<Multi_key> <U11BA> <U11A8> : "ᇧ" U11e7 # HANGUL JONGSEONG SIOS-KIYEOK
-<Multi_key> <U11BA> <U11AE> : "ᇨ" U11e8 # HANGUL JONGSEONG SIOS-TIKEUT
-<Multi_key> <U11BA> <U11AF> : "ᇩ" U11e9 # HANGUL JONGSEONG SIOS-RIEUL
-<Multi_key> <U11BA> <U11B8> : "ᇪ" U11ea # HANGUL JONGSEONG SIOS-PIEUP
-<Multi_key> <U11BC> <U11A8> : "ᇬ" U11ec # HANGUL JONGSEONG IEUNG-KIYEOK
-<Multi_key> <U11BC> <U11BC> : "ᇮ" U11ee # HANGUL JONGSEONG SSANGIEUNG
-<Multi_key> <U11BC> <U11BF> : "ᇯ" U11ef # HANGUL JONGSEONG IEUNG-KHIEUKH
-<Multi_key> <U11F0> <U11BA> : "ᇱ" U11f1 # HANGUL JONGSEONG YESIEUNG-SIOS
-<Multi_key> <U11F0> <U11EB> : "ᇲ" U11f2 # HANGUL JONGSEONG YESIEUNG-PANSIOS
-<Multi_key> <U11C1> <U11B8> : "ᇳ" U11f3 # HANGUL JONGSEONG PHIEUPH-PIEUP
-<Multi_key> <U11C1> <U11BC> : "ᇴ" U11f4 # HANGUL JONGSEONG KAPYEOUNPHIEUPH
-<Multi_key> <U11C2> <U11AB> : "ᇵ" U11f5 # HANGUL JONGSEONG HIEUH-NIEUN
-<Multi_key> <U11C2> <U11AF> : "ᇶ" U11f6 # HANGUL JONGSEONG HIEUH-RIEUL
-<Multi_key> <U11C2> <U11B7> : "ᇷ" U11f7 # HANGUL JONGSEONG HIEUH-MIEUM
-<Multi_key> <U11C2> <U11B8> : "ᇸ" U11f8 # HANGUL JONGSEONG HIEUH-PIEUP
-<Multi_key> <U1121> <U1100> : "ᄢ" U1122 # HANGUL CHOSEONG PIEUP-SIOS-KIYEOK
-<Multi_key> <U1121> <U1103> : "ᄣ" U1123 # HANGUL CHOSEONG PIEUP-SIOS-TIKEUT
-<Multi_key> <U1121> <U1107> : "ᄤ" U1124 # HANGUL CHOSEONG PIEUP-SIOS-PIEUP
-<Multi_key> <U1121> <U1109> : "ᄥ" U1125 # HANGUL CHOSEONG PIEUP-SSANGSIOS
-<Multi_key> <U1121> <U110C> : "ᄦ" U1126 # HANGUL CHOSEONG PIEUP-SIOS-CIEUC
-<Multi_key> <U1108> <U110B> : "ᄬ" U112c # HANGUL CHOSEONG KAPYEOUNSSANGPIEUP
-<Multi_key> <U1132> <U1100> : "ᄳ" U1133 # HANGUL CHOSEONG SIOS-PIEUP-KIYEOK
-<Multi_key> <U110A> <U1109> : "ᄴ" U1134 # HANGUL CHOSEONG SIOS-SSANGSIOS
-<Multi_key> <U116A> <U1175> : "ᅫ" U116b # HANGUL JUNGSEONG WAE
-<Multi_key> <U116F> <U1175> : "ᅰ" U1170 # HANGUL JUNGSEONG WE
-<Multi_key> <U116F> <U1173> : "ᆋ" U118b # HANGUL JUNGSEONG U-EO-EU
-<Multi_key> <U11AA> <U11A8> : "ᇄ" U11c4 # HANGUL JONGSEONG KIYEOK-SIOS-KIYEOK
-<Multi_key> <U11B0> <U11BA> : "ᇌ" U11cc # HANGUL JONGSEONG RIEUL-KIYEOK-SIOS
-<Multi_key> <U11CE> <U11C2> : "ᇏ" U11cf # HANGUL JONGSEONG RIEUL-TIKEUT-HIEUH
-<Multi_key> <U11B1> <U11A8> : "ᇑ" U11d1 # HANGUL JONGSEONG RIEUL-MIEUM-KIYEOK
-<Multi_key> <U11B1> <U11BA> : "ᇒ" U11d2 # HANGUL JONGSEONG RIEUL-MIEUM-SIOS
-<Multi_key> <U11B2> <U11BA> : "ᇓ" U11d3 # HANGUL JONGSEONG RIEUL-PIEUP-SIOS
-<Multi_key> <U11B2> <U11C2> : "ᇔ" U11d4 # HANGUL JONGSEONG RIEUL-PIEUP-HIEUH
-<Multi_key> <U11B2> <U11BC> : "ᇕ" U11d5 # HANGUL JONGSEONG RIEUL-KAPYEOUNPIEUP
-<Multi_key> <U11B3> <U11BA> : "ᇖ" U11d6 # HANGUL JONGSEONG RIEUL-SSANGSIOS
-<Multi_key> <U11DD> <U11BA> : "ᇞ" U11de # HANGUL JONGSEONG MIEUM-SSANGSIOS
-<Multi_key> <U11EC> <U11A8> : "ᇭ" U11ed # HANGUL JONGSEONG IEUNG-SSANGKIYEOK
-<Multi_key> <U1107> <U112D> : "ᄢ" U1122 # HANGUL CHOSEONG PIEUP-SIOS-KIYEOK
-<Multi_key> <U1107> <U112F> : "ᄣ" U1123 # HANGUL CHOSEONG PIEUP-SIOS-TIKEUT
-<Multi_key> <U1107> <U1132> : "ᄤ" U1124 # HANGUL CHOSEONG PIEUP-SIOS-PIEUP
-<Multi_key> <U1107> <U110A> : "ᄥ" U1125 # HANGUL CHOSEONG PIEUP-SSANGSIOS
-<Multi_key> <U1107> <U1136> : "ᄦ" U1126 # HANGUL CHOSEONG PIEUP-SIOS-CIEUC
-<Multi_key> <U1107> <U112B> : "ᄬ" U112c # HANGUL CHOSEONG KAPYEOUNSSANGPIEUP
-<Multi_key> <U1109> <U111E> : "ᄳ" U1133 # HANGUL CHOSEONG SIOS-PIEUP-KIYEOK
-<Multi_key> <U1109> <U110A> : "ᄴ" U1134 # HANGUL CHOSEONG SIOS-SSANGSIOS
-<Multi_key> <U1169> <U1162> : "ᅫ" U116b # HANGUL JUNGSEONG WAE
-<Multi_key> <U116E> <U1166> : "ᅰ" U1170 # HANGUL JUNGSEONG WE
-<Multi_key> <U116E> <U117C> : "ᆋ" U118b # HANGUL JUNGSEONG U-EO-EU
-<Multi_key> <U11A8> <U11E7> : "ᇄ" U11c4 # HANGUL JONGSEONG KIYEOK-SIOS-KIYEOK
-<Multi_key> <U11AF> <U11AA> : "ᇌ" U11cc # HANGUL JONGSEONG RIEUL-KIYEOK-SIOS
-<Multi_key> <U11AF> <U11DA> : "ᇑ" U11d1 # HANGUL JONGSEONG RIEUL-MIEUM-KIYEOK
-<Multi_key> <U11AF> <U11DD> : "ᇒ" U11d2 # HANGUL JONGSEONG RIEUL-MIEUM-SIOS
-<Multi_key> <U11AF> <U11B9> : "ᇓ" U11d3 # HANGUL JONGSEONG RIEUL-PIEUP-SIOS
-<Multi_key> <U11AF> <U11E5> : "ᇔ" U11d4 # HANGUL JONGSEONG RIEUL-PIEUP-HIEUH
-<Multi_key> <U11AF> <U11E6> : "ᇕ" U11d5 # HANGUL JONGSEONG RIEUL-KAPYEOUNPIEUP
-<Multi_key> <U11AF> <U11BB> : "ᇖ" U11d6 # HANGUL JONGSEONG RIEUL-SSANGSIOS
-<Multi_key> <U11B7> <U11BB> : "ᇞ" U11de # HANGUL JONGSEONG MIEUM-SSANGSIOS
-<Multi_key> <U11BC> <U11A9> : "ᇭ" U11ed # HANGUL JONGSEONG IEUNG-SSANGKIYEOK
-
-XCOMM Part 3
-<Multi_key> <comma> <minus> : "¬" notsign # NOT SIGN
-<Multi_key> <minus> <comma> : "¬" notsign # NOT SIGN
-<dead_circumflex> <Multi_key> <underscore> <a> : "ª" ordfeminine # FEMININE ORDINAL INDICATOR
-<Multi_key> <asciicircum> <underscore> <a> : "ª" ordfeminine # FEMININE ORDINAL INDICATOR
-<dead_circumflex> <Multi_key> <underbar> <a> : "ª" ordfeminine # FEMININE ORDINAL INDICATOR
-<Multi_key> <asciicircum> <underbar> <a> : "ª" ordfeminine # FEMININE ORDINAL INDICATOR
-<dead_circumflex> <2> : "²" twosuperior # SUPERSCRIPT TWO
-<Multi_key> <asciicircum> <2> : "²" twosuperior # SUPERSCRIPT TWO
-<dead_circumflex> <KP_Space> : "²" twosuperior # SUPERSCRIPT TWO
-<Multi_key> <asciicircum> <KP_Space> : "²" twosuperior # SUPERSCRIPT TWO
-<dead_circumflex> <KP_2> : "²" twosuperior # SUPERSCRIPT TWO
-<Multi_key> <asciicircum> <KP_2> : "²" twosuperior # SUPERSCRIPT TWO
-<dead_circumflex> <3> : "³" threesuperior # SUPERSCRIPT THREE
-<Multi_key> <asciicircum> <3> : "³" threesuperior # SUPERSCRIPT THREE
-<dead_circumflex> <KP_3> : "³" threesuperior # SUPERSCRIPT THREE
-<Multi_key> <asciicircum> <KP_3> : "³" threesuperior # SUPERSCRIPT THREE
-<Multi_key> <m> <u> : "µ" mu # MICRO SIGN
-<dead_circumflex> <1> : "¹" onesuperior # SUPERSCRIPT ONE
-<Multi_key> <asciicircum> <1> : "¹" onesuperior # SUPERSCRIPT ONE
-<dead_circumflex> <KP_1> : "¹" onesuperior # SUPERSCRIPT ONE
-<Multi_key> <asciicircum> <KP_1> : "¹" onesuperior # SUPERSCRIPT ONE
-<dead_circumflex> <Multi_key> <underscore> <o> : "º" masculine # MASCULINE ORDINAL INDICATOR
-<Multi_key> <asciicircum> <underscore> <o> : "º" masculine # MASCULINE ORDINAL INDICATOR
-<dead_circumflex> <Multi_key> <underbar> <o> : "º" masculine # MASCULINE ORDINAL INDICATOR
-<Multi_key> <asciicircum> <underbar> <o> : "º" masculine # MASCULINE ORDINAL INDICATOR
-<Multi_key> <1> <4> : "¼" onequarter # VULGAR FRACTION ONE QUARTER
-<Multi_key> <1> <2> : "½" onehalf # VULGAR FRACTION ONE HALF
-<Multi_key> <3> <4> : "¾" threequarters # VULGAR FRACTION THREE QUARTERS
-<dead_grave> <A> : "À" Agrave # LATIN CAPITAL LETTER A WITH GRAVE
-<Multi_key> <grave> <A> : "À" Agrave # LATIN CAPITAL LETTER A WITH GRAVE
-<dead_acute> <A> : "Á" Aacute # LATIN CAPITAL LETTER A WITH ACUTE
-<Multi_key> <acute> <A> : "Á" Aacute # LATIN CAPITAL LETTER A WITH ACUTE
-<Multi_key> <apostrophe> <A> : "Á" Aacute # LATIN CAPITAL LETTER A WITH ACUTE
-<dead_circumflex> <A> : "Â" Acircumflex # LATIN CAPITAL LETTER A WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <A> : "Â" Acircumflex # LATIN CAPITAL LETTER A WITH CIRCUMFLEX
-<dead_tilde> <A> : "Ã" Atilde # LATIN CAPITAL LETTER A WITH TILDE
-<Multi_key> <asciitilde> <A> : "Ã" Atilde # LATIN CAPITAL LETTER A WITH TILDE
-<dead_diaeresis> <A> : "Ä" Adiaeresis # LATIN CAPITAL LETTER A WITH DIAERESIS
-<Multi_key> <quotedbl> <A> : "Ä" Adiaeresis # LATIN CAPITAL LETTER A WITH DIAERESIS
-<dead_abovering> <A> : "Å" Aring # LATIN CAPITAL LETTER A WITH RING ABOVE
-<Multi_key> <o> <A> : "Å" Aring # LATIN CAPITAL LETTER A WITH RING ABOVE
-<dead_cedilla> <C> : "Ç" Ccedilla # LATIN CAPITAL LETTER C WITH CEDILLA
-<Multi_key> <comma> <C> : "Ç" Ccedilla # LATIN CAPITAL LETTER C WITH CEDILLA
-<Multi_key> <cedilla> <C> : "Ç" Ccedilla # LATIN CAPITAL LETTER C WITH CEDILLA
-<dead_grave> <E> : "È" Egrave # LATIN CAPITAL LETTER E WITH GRAVE
-<Multi_key> <grave> <E> : "È" Egrave # LATIN CAPITAL LETTER E WITH GRAVE
-<dead_acute> <E> : "É" Eacute # LATIN CAPITAL LETTER E WITH ACUTE
-<Multi_key> <acute> <E> : "É" Eacute # LATIN CAPITAL LETTER E WITH ACUTE
-<Multi_key> <apostrophe> <E> : "É" Eacute # LATIN CAPITAL LETTER E WITH ACUTE
-<dead_circumflex> <E> : "Ê" Ecircumflex # LATIN CAPITAL LETTER E WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <E> : "Ê" Ecircumflex # LATIN CAPITAL LETTER E WITH CIRCUMFLEX
-<dead_diaeresis> <E> : "Ë" Ediaeresis # LATIN CAPITAL LETTER E WITH DIAERESIS
-<Multi_key> <quotedbl> <E> : "Ë" Ediaeresis # LATIN CAPITAL LETTER E WITH DIAERESIS
-<dead_grave> <I> : "Ì" Igrave # LATIN CAPITAL LETTER I WITH GRAVE
-<Multi_key> <grave> <I> : "Ì" Igrave # LATIN CAPITAL LETTER I WITH GRAVE
-<dead_acute> <I> : "Í" Iacute # LATIN CAPITAL LETTER I WITH ACUTE
-<Multi_key> <acute> <I> : "Í" Iacute # LATIN CAPITAL LETTER I WITH ACUTE
-<Multi_key> <apostrophe> <I> : "Í" Iacute # LATIN CAPITAL LETTER I WITH ACUTE
-<dead_circumflex> <I> : "Î" Icircumflex # LATIN CAPITAL LETTER I WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <I> : "Î" Icircumflex # LATIN CAPITAL LETTER I WITH CIRCUMFLEX
-<dead_diaeresis> <I> : "Ï" Idiaeresis # LATIN CAPITAL LETTER I WITH DIAERESIS
-<Multi_key> <quotedbl> <I> : "Ï" Idiaeresis # LATIN CAPITAL LETTER I WITH DIAERESIS
-<Multi_key> <D> <H> : "Ð" ETH # LATIN CAPITAL LETTER ETH
-<dead_tilde> <N> : "Ñ" Ntilde # LATIN CAPITAL LETTER N WITH TILDE
-<Multi_key> <asciitilde> <N> : "Ñ" Ntilde # LATIN CAPITAL LETTER N WITH TILDE
-<dead_grave> <O> : "Ò" Ograve # LATIN CAPITAL LETTER O WITH GRAVE
-<Multi_key> <grave> <O> : "Ò" Ograve # LATIN CAPITAL LETTER O WITH GRAVE
-<dead_acute> <O> : "Ó" Oacute # LATIN CAPITAL LETTER O WITH ACUTE
-<Multi_key> <acute> <O> : "Ó" Oacute # LATIN CAPITAL LETTER O WITH ACUTE
-<Multi_key> <apostrophe> <O> : "Ó" Oacute # LATIN CAPITAL LETTER O WITH ACUTE
-<dead_circumflex> <O> : "Ô" Ocircumflex # LATIN CAPITAL LETTER O WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <O> : "Ô" Ocircumflex # LATIN CAPITAL LETTER O WITH CIRCUMFLEX
-<dead_tilde> <O> : "Õ" Otilde # LATIN CAPITAL LETTER O WITH TILDE
-<Multi_key> <asciitilde> <O> : "Õ" Otilde # LATIN CAPITAL LETTER O WITH TILDE
-<dead_diaeresis> <O> : "Ö" Odiaeresis # LATIN CAPITAL LETTER O WITH DIAERESIS
-<Multi_key> <quotedbl> <O> : "Ö" Odiaeresis # LATIN CAPITAL LETTER O WITH DIAERESIS
-<Multi_key> <x> <x> : "×" multiply # MULTIPLICATION SIGN
-<dead_stroke> <O> : "Ø" Oslash # LATIN CAPITAL LETTER O WITH STROKE
-<Multi_key> <slash> <O> : "Ø" Oslash # LATIN CAPITAL LETTER O WITH STROKE
-<Multi_key> <KP_Divide> <O> : "Ø" Oslash # LATIN CAPITAL LETTER O WITH STROKE
-<dead_grave> <U> : "Ù" Ugrave # LATIN CAPITAL LETTER U WITH GRAVE
-<Multi_key> <grave> <U> : "Ù" Ugrave # LATIN CAPITAL LETTER U WITH GRAVE
-<dead_acute> <U> : "Ú" Uacute # LATIN CAPITAL LETTER U WITH ACUTE
-<Multi_key> <acute> <U> : "Ú" Uacute # LATIN CAPITAL LETTER U WITH ACUTE
-<Multi_key> <apostrophe> <U> : "Ú" Uacute # LATIN CAPITAL LETTER U WITH ACUTE
-<dead_circumflex> <U> : "Û" Ucircumflex # LATIN CAPITAL LETTER U WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <U> : "Û" Ucircumflex # LATIN CAPITAL LETTER U WITH CIRCUMFLEX
-<dead_diaeresis> <U> : "Ü" Udiaeresis # LATIN CAPITAL LETTER U WITH DIAERESIS
-<Multi_key> <quotedbl> <U> : "Ü" Udiaeresis # LATIN CAPITAL LETTER U WITH DIAERESIS
-<dead_acute> <Y> : "Ý" Yacute # LATIN CAPITAL LETTER Y WITH ACUTE
-<Multi_key> <acute> <Y> : "Ý" Yacute # LATIN CAPITAL LETTER Y WITH ACUTE
-<Multi_key> <apostrophe> <Y> : "Ý" Yacute # LATIN CAPITAL LETTER Y WITH ACUTE
-<Multi_key> <T> <H> : "Þ" THORN # LATIN CAPITAL LETTER THORN
-<dead_grave> <a> : "à" agrave # LATIN SMALL LETTER A WITH GRAVE
-<Multi_key> <grave> <a> : "à" agrave # LATIN SMALL LETTER A WITH GRAVE
-<dead_acute> <a> : "á" aacute # LATIN SMALL LETTER A WITH ACUTE
-<Multi_key> <acute> <a> : "á" aacute # LATIN SMALL LETTER A WITH ACUTE
-<Multi_key> <apostrophe> <a> : "á" aacute # LATIN SMALL LETTER A WITH ACUTE
-<dead_circumflex> <a> : "â" acircumflex # LATIN SMALL LETTER A WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <a> : "â" acircumflex # LATIN SMALL LETTER A WITH CIRCUMFLEX
-<dead_tilde> <a> : "ã" atilde # LATIN SMALL LETTER A WITH TILDE
-<Multi_key> <asciitilde> <a> : "ã" atilde # LATIN SMALL LETTER A WITH TILDE
-<dead_diaeresis> <a> : "ä" adiaeresis # LATIN SMALL LETTER A WITH DIAERESIS
-<Multi_key> <quotedbl> <a> : "ä" adiaeresis # LATIN SMALL LETTER A WITH DIAERESIS
-<dead_abovering> <a> : "å" aring # LATIN SMALL LETTER A WITH RING ABOVE
-<Multi_key> <o> <a> : "å" aring # LATIN SMALL LETTER A WITH RING ABOVE
-<dead_cedilla> <c> : "ç" ccedilla # LATIN SMALL LETTER C WITH CEDILLA
-<Multi_key> <comma> <c> : "ç" ccedilla # LATIN SMALL LETTER C WITH CEDILLA
-<Multi_key> <cedilla> <c> : "ç" ccedilla # LATIN SMALL LETTER C WITH CEDILLA
-<dead_grave> <e> : "è" egrave # LATIN SMALL LETTER E WITH GRAVE
-<Multi_key> <grave> <e> : "è" egrave # LATIN SMALL LETTER E WITH GRAVE
-<dead_acute> <e> : "é" eacute # LATIN SMALL LETTER E WITH ACUTE
-<Multi_key> <acute> <e> : "é" eacute # LATIN SMALL LETTER E WITH ACUTE
-<Multi_key> <apostrophe> <e> : "é" eacute # LATIN SMALL LETTER E WITH ACUTE
-<dead_circumflex> <e> : "ê" ecircumflex # LATIN SMALL LETTER E WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <e> : "ê" ecircumflex # LATIN SMALL LETTER E WITH CIRCUMFLEX
-<dead_diaeresis> <e> : "ë" ediaeresis # LATIN SMALL LETTER E WITH DIAERESIS
-<Multi_key> <quotedbl> <e> : "ë" ediaeresis # LATIN SMALL LETTER E WITH DIAERESIS
-<dead_grave> <i> : "ì" igrave # LATIN SMALL LETTER I WITH GRAVE
-<Multi_key> <grave> <i> : "ì" igrave # LATIN SMALL LETTER I WITH GRAVE
-<dead_acute> <i> : "í" iacute # LATIN SMALL LETTER I WITH ACUTE
-<Multi_key> <acute> <i> : "í" iacute # LATIN SMALL LETTER I WITH ACUTE
-<Multi_key> <apostrophe> <i> : "í" iacute # LATIN SMALL LETTER I WITH ACUTE
-<dead_circumflex> <i> : "î" icircumflex # LATIN SMALL LETTER I WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <i> : "î" icircumflex # LATIN SMALL LETTER I WITH CIRCUMFLEX
-<dead_diaeresis> <i> : "ï" idiaeresis # LATIN SMALL LETTER I WITH DIAERESIS
-<Multi_key> <quotedbl> <i> : "ï" idiaeresis # LATIN SMALL LETTER I WITH DIAERESIS
-<Multi_key> <d> <h> : "ð" eth # LATIN SMALL LETTER ETH
-<dead_tilde> <n> : "ñ" ntilde # LATIN SMALL LETTER N WITH TILDE
-<Multi_key> <asciitilde> <n> : "ñ" ntilde # LATIN SMALL LETTER N WITH TILDE
-<dead_grave> <o> : "ò" ograve # LATIN SMALL LETTER O WITH GRAVE
-<Multi_key> <grave> <o> : "ò" ograve # LATIN SMALL LETTER O WITH GRAVE
-<dead_acute> <o> : "ó" oacute # LATIN SMALL LETTER O WITH ACUTE
-<Multi_key> <acute> <o> : "ó" oacute # LATIN SMALL LETTER O WITH ACUTE
-<Multi_key> <apostrophe> <o> : "ó" oacute # LATIN SMALL LETTER O WITH ACUTE
-<dead_circumflex> <o> : "ô" ocircumflex # LATIN SMALL LETTER O WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <o> : "ô" ocircumflex # LATIN SMALL LETTER O WITH CIRCUMFLEX
-<dead_tilde> <o> : "õ" otilde # LATIN SMALL LETTER O WITH TILDE
-<Multi_key> <asciitilde> <o> : "õ" otilde # LATIN SMALL LETTER O WITH TILDE
-<dead_diaeresis> <o> : "ö" odiaeresis # LATIN SMALL LETTER O WITH DIAERESIS
-<Multi_key> <quotedbl> <o> : "ö" odiaeresis # LATIN SMALL LETTER O WITH DIAERESIS
-<Multi_key> <colon> <minus> : "÷" division # DIVISION SIGN
-<Multi_key> <minus> <colon> : "÷" division # DIVISION SIGN
-<dead_stroke> <o> : "ø" oslash # LATIN SMALL LETTER O WITH STROKE
-<Multi_key> <slash> <o> : "ø" oslash # LATIN SMALL LETTER O WITH STROKE
-<Multi_key> <KP_Divide> <o> : "ø" oslash # LATIN SMALL LETTER O WITH STROKE
-<dead_grave> <u> : "ù" ugrave # LATIN SMALL LETTER U WITH GRAVE
-<Multi_key> <grave> <u> : "ù" ugrave # LATIN SMALL LETTER U WITH GRAVE
-<dead_acute> <u> : "ú" uacute # LATIN SMALL LETTER U WITH ACUTE
-<Multi_key> <acute> <u> : "ú" uacute # LATIN SMALL LETTER U WITH ACUTE
-<Multi_key> <apostrophe> <u> : "ú" uacute # LATIN SMALL LETTER U WITH ACUTE
-<dead_circumflex> <u> : "û" ucircumflex # LATIN SMALL LETTER U WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <u> : "û" ucircumflex # LATIN SMALL LETTER U WITH CIRCUMFLEX
-<dead_diaeresis> <u> : "ü" udiaeresis # LATIN SMALL LETTER U WITH DIAERESIS
-<Multi_key> <quotedbl> <u> : "ü" udiaeresis # LATIN SMALL LETTER U WITH DIAERESIS
-<dead_acute> <y> : "ý" yacute # LATIN SMALL LETTER Y WITH ACUTE
-<Multi_key> <acute> <y> : "ý" yacute # LATIN SMALL LETTER Y WITH ACUTE
-<Multi_key> <apostrophe> <y> : "ý" yacute # LATIN SMALL LETTER Y WITH ACUTE
-<Multi_key> <t> <h> : "þ" thorn # LATIN SMALL LETTER THORN
-<dead_diaeresis> <y> : "ÿ" ydiaeresis # LATIN SMALL LETTER Y WITH DIAERESIS
-<Multi_key> <quotedbl> <y> : "ÿ" ydiaeresis # LATIN SMALL LETTER Y WITH DIAERESIS
-<dead_macron> <A> : "Ā" U0100 # LATIN CAPITAL LETTER A WITH MACRON
-<Multi_key> <macron> <A> : "Ā" U0100 # LATIN CAPITAL LETTER A WITH MACRON
-<Multi_key> <underscore> <A> : "Ā" U0100 # LATIN CAPITAL LETTER A WITH MACRON
-<dead_macron> <a> : "ā" U0101 # LATIN SMALL LETTER A WITH MACRON
-<Multi_key> <macron> <a> : "ā" U0101 # LATIN SMALL LETTER A WITH MACRON
-<Multi_key> <underscore> <a> : "ā" U0101 # LATIN SMALL LETTER A WITH MACRON
-<dead_breve> <A> : "Ă" U0102 # LATIN CAPITAL LETTER A WITH BREVE
-<Multi_key> <U> <A> : "Ă" U0102 # LATIN CAPITAL LETTER A WITH BREVE
-<Multi_key> <b> <A> : "Ă" U0102 # LATIN CAPITAL LETTER A WITH BREVE
-<dead_breve> <a> : "ă" U0103 # LATIN SMALL LETTER A WITH BREVE
-<Multi_key> <U> <a> : "ă" U0103 # LATIN SMALL LETTER A WITH BREVE
-<Multi_key> <b> <a> : "ă" U0103 # LATIN SMALL LETTER A WITH BREVE
-<dead_ogonek> <A> : "Ą" U0104 # LATIN CAPITAL LETTER A WITH OGONEK
-<Multi_key> <semicolon> <A> : "Ą" U0104 # LATIN CAPITAL LETTER A WITH OGONEK
-<Multi_key> <comma> <A> : "Ą" U0104 # LATIN CAPITAL LETTER A WITH OGONEK
-<dead_ogonek> <a> : "ą" U0105 # LATIN SMALL LETTER A WITH OGONEK
-<Multi_key> <semicolon> <a> : "ą" U0105 # LATIN SMALL LETTER A WITH OGONEK
-<Multi_key> <comma> <a> : "ą" U0105 # LATIN SMALL LETTER A WITH OGONEK
-<dead_acute> <C> : "Ć" U0106 # LATIN CAPITAL LETTER C WITH ACUTE
-<Multi_key> <acute> <C> : "Ć" U0106 # LATIN CAPITAL LETTER C WITH ACUTE
-<Multi_key> <apostrophe> <C> : "Ć" U0106 # LATIN CAPITAL LETTER C WITH ACUTE
-<dead_acute> <c> : "ć" U0107 # LATIN SMALL LETTER C WITH ACUTE
-<Multi_key> <acute> <c> : "ć" U0107 # LATIN SMALL LETTER C WITH ACUTE
-<Multi_key> <apostrophe> <c> : "ć" U0107 # LATIN SMALL LETTER C WITH ACUTE
-<dead_circumflex> <C> : "Ĉ" U0108 # LATIN CAPITAL LETTER C WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <C> : "Ĉ" U0108 # LATIN CAPITAL LETTER C WITH CIRCUMFLEX
-<dead_circumflex> <c> : "ĉ" U0109 # LATIN SMALL LETTER C WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <c> : "ĉ" U0109 # LATIN SMALL LETTER C WITH CIRCUMFLEX
-<dead_abovedot> <C> : "Ċ" U010A # LATIN CAPITAL LETTER C WITH DOT ABOVE
-<Multi_key> <period> <C> : "Ċ" U010A # LATIN CAPITAL LETTER C WITH DOT ABOVE
-<dead_abovedot> <c> : "ċ" U010B # LATIN SMALL LETTER C WITH DOT ABOVE
-<Multi_key> <period> <c> : "ċ" U010B # LATIN SMALL LETTER C WITH DOT ABOVE
-<dead_caron> <C> : "Č" U010C # LATIN CAPITAL LETTER C WITH CARON
-<Multi_key> <c> <C> : "Č" U010C # LATIN CAPITAL LETTER C WITH CARON
-<dead_caron> <c> : "č" U010D # LATIN SMALL LETTER C WITH CARON
-<Multi_key> <c> <c> : "č" U010D # LATIN SMALL LETTER C WITH CARON
-<dead_caron> <D> : "Ď" U010E # LATIN CAPITAL LETTER D WITH CARON
-<Multi_key> <c> <D> : "Ď" U010E # LATIN CAPITAL LETTER D WITH CARON
-<dead_caron> <d> : "ď" U010F # LATIN SMALL LETTER D WITH CARON
-<Multi_key> <c> <d> : "ď" U010F # LATIN SMALL LETTER D WITH CARON
-<dead_stroke> <D> : "Đ" U0110 # LATIN CAPITAL LETTER D WITH STROKE
-<Multi_key> <slash> <D> : "Đ" U0110 # LATIN CAPITAL LETTER D WITH STROKE
-<Multi_key> <KP_Divide> <D> : "Đ" U0110 # LATIN CAPITAL LETTER D WITH STROKE
-<dead_stroke> <d> : "đ" U0111 # LATIN SMALL LETTER D WITH STROKE
-<Multi_key> <slash> <d> : "đ" U0111 # LATIN SMALL LETTER D WITH STROKE
-<Multi_key> <KP_Divide> <d> : "đ" U0111 # LATIN SMALL LETTER D WITH STROKE
-<dead_macron> <E> : "Ē" U0112 # LATIN CAPITAL LETTER E WITH MACRON
-<Multi_key> <macron> <E> : "Ē" U0112 # LATIN CAPITAL LETTER E WITH MACRON
-<Multi_key> <underscore> <E> : "Ē" U0112 # LATIN CAPITAL LETTER E WITH MACRON
-<dead_macron> <e> : "ē" U0113 # LATIN SMALL LETTER E WITH MACRON
-<Multi_key> <macron> <e> : "ē" U0113 # LATIN SMALL LETTER E WITH MACRON
-<Multi_key> <underscore> <e> : "ē" U0113 # LATIN SMALL LETTER E WITH MACRON
-<dead_breve> <E> : "Ĕ" U0114 # LATIN CAPITAL LETTER E WITH BREVE
-<Multi_key> <U> <E> : "Ĕ" U0114 # LATIN CAPITAL LETTER E WITH BREVE
-<Multi_key> <b> <E> : "Ĕ" U0114 # LATIN CAPITAL LETTER E WITH BREVE
-<dead_breve> <e> : "ĕ" U0115 # LATIN SMALL LETTER E WITH BREVE
-<Multi_key> <U> <e> : "ĕ" U0115 # LATIN SMALL LETTER E WITH BREVE
-<Multi_key> <b> <e> : "ĕ" U0115 # LATIN SMALL LETTER E WITH BREVE
-<dead_abovedot> <E> : "Ė" U0116 # LATIN CAPITAL LETTER E WITH DOT ABOVE
-<Multi_key> <period> <E> : "Ė" U0116 # LATIN CAPITAL LETTER E WITH DOT ABOVE
-<dead_abovedot> <e> : "ė" U0117 # LATIN SMALL LETTER E WITH DOT ABOVE
-<Multi_key> <period> <e> : "ė" U0117 # LATIN SMALL LETTER E WITH DOT ABOVE
-<dead_ogonek> <E> : "Ę" U0118 # LATIN CAPITAL LETTER E WITH OGONEK
-<Multi_key> <semicolon> <E> : "Ę" U0118 # LATIN CAPITAL LETTER E WITH OGONEK
-<Multi_key> <comma> <E> : "Ę" U0118 # LATIN CAPITAL LETTER E WITH OGONEK
-<dead_ogonek> <e> : "ę" U0119 # LATIN SMALL LETTER E WITH OGONEK
-<Multi_key> <semicolon> <e> : "ę" U0119 # LATIN SMALL LETTER E WITH OGONEK
-<Multi_key> <comma> <e> : "ę" U0119 # LATIN SMALL LETTER E WITH OGONEK
-<dead_caron> <E> : "Ě" U011A # LATIN CAPITAL LETTER E WITH CARON
-<Multi_key> <c> <E> : "Ě" U011A # LATIN CAPITAL LETTER E WITH CARON
-<dead_caron> <e> : "ě" U011B # LATIN SMALL LETTER E WITH CARON
-<Multi_key> <c> <e> : "ě" U011B # LATIN SMALL LETTER E WITH CARON
-<dead_circumflex> <G> : "Ĝ" U011C # LATIN CAPITAL LETTER G WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <G> : "Ĝ" U011C # LATIN CAPITAL LETTER G WITH CIRCUMFLEX
-<dead_circumflex> <g> : "ĝ" U011D # LATIN SMALL LETTER G WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <g> : "ĝ" U011D # LATIN SMALL LETTER G WITH CIRCUMFLEX
-<dead_breve> <G> : "Ğ" U011E # LATIN CAPITAL LETTER G WITH BREVE
-<Multi_key> <U> <G> : "Ğ" U011E # LATIN CAPITAL LETTER G WITH BREVE
-<Multi_key> <b> <G> : "Ğ" U011E # LATIN CAPITAL LETTER G WITH BREVE
-<dead_breve> <g> : "ğ" U011F # LATIN SMALL LETTER G WITH BREVE
-<Multi_key> <U> <g> : "ğ" U011F # LATIN SMALL LETTER G WITH BREVE
-<Multi_key> <b> <g> : "ğ" U011F # LATIN SMALL LETTER G WITH BREVE
-<dead_abovedot> <G> : "Ġ" U0120 # LATIN CAPITAL LETTER G WITH DOT ABOVE
-<Multi_key> <period> <G> : "Ġ" U0120 # LATIN CAPITAL LETTER G WITH DOT ABOVE
-<dead_abovedot> <g> : "ġ" U0121 # LATIN SMALL LETTER G WITH DOT ABOVE
-<Multi_key> <period> <g> : "ġ" U0121 # LATIN SMALL LETTER G WITH DOT ABOVE
-<dead_cedilla> <G> : "Ģ" U0122 # LATIN CAPITAL LETTER G WITH CEDILLA
-<Multi_key> <comma> <G> : "Ģ" U0122 # LATIN CAPITAL LETTER G WITH CEDILLA
-<Multi_key> <cedilla> <G> : "Ģ" U0122 # LATIN CAPITAL LETTER G WITH CEDILLA
-<dead_cedilla> <g> : "ģ" U0123 # LATIN SMALL LETTER G WITH CEDILLA
-<Multi_key> <comma> <g> : "ģ" U0123 # LATIN SMALL LETTER G WITH CEDILLA
-<Multi_key> <cedilla> <g> : "ģ" U0123 # LATIN SMALL LETTER G WITH CEDILLA
-<dead_circumflex> <H> : "Ĥ" U0124 # LATIN CAPITAL LETTER H WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <H> : "Ĥ" U0124 # LATIN CAPITAL LETTER H WITH CIRCUMFLEX
-<dead_circumflex> <h> : "ĥ" U0125 # LATIN SMALL LETTER H WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <h> : "ĥ" U0125 # LATIN SMALL LETTER H WITH CIRCUMFLEX
-<dead_stroke> <H> : "Ħ" U0126 # LATIN CAPITAL LETTER H WITH STROKE
-<Multi_key> <slash> <H> : "Ħ" U0126 # LATIN CAPITAL LETTER H WITH STROKE
-<Multi_key> <KP_Divide> <H> : "Ħ" U0126 # LATIN CAPITAL LETTER H WITH STROKE
-<dead_stroke> <h> : "ħ" U0127 # LATIN SMALL LETTER H WITH STROKE
-<Multi_key> <slash> <h> : "ħ" U0127 # LATIN SMALL LETTER H WITH STROKE
-<Multi_key> <KP_Divide> <h> : "ħ" U0127 # LATIN SMALL LETTER H WITH STROKE
-<dead_tilde> <I> : "Ĩ" U0128 # LATIN CAPITAL LETTER I WITH TILDE
-<Multi_key> <asciitilde> <I> : "Ĩ" U0128 # LATIN CAPITAL LETTER I WITH TILDE
-<dead_tilde> <i> : "ĩ" U0129 # LATIN SMALL LETTER I WITH TILDE
-<Multi_key> <asciitilde> <i> : "ĩ" U0129 # LATIN SMALL LETTER I WITH TILDE
-<dead_macron> <I> : "Ī" U012A # LATIN CAPITAL LETTER I WITH MACRON
-<Multi_key> <macron> <I> : "Ī" U012A # LATIN CAPITAL LETTER I WITH MACRON
-<Multi_key> <underscore> <I> : "Ī" U012A # LATIN CAPITAL LETTER I WITH MACRON
-<dead_macron> <i> : "ī" U012B # LATIN SMALL LETTER I WITH MACRON
-<Multi_key> <macron> <i> : "ī" U012B # LATIN SMALL LETTER I WITH MACRON
-<Multi_key> <underscore> <i> : "ī" U012B # LATIN SMALL LETTER I WITH MACRON
-<dead_breve> <I> : "Ĭ" U012C # LATIN CAPITAL LETTER I WITH BREVE
-<Multi_key> <U> <I> : "Ĭ" U012C # LATIN CAPITAL LETTER I WITH BREVE
-<Multi_key> <b> <I> : "Ĭ" U012C # LATIN CAPITAL LETTER I WITH BREVE
-<dead_breve> <i> : "ĭ" U012D # LATIN SMALL LETTER I WITH BREVE
-<Multi_key> <U> <i> : "ĭ" U012D # LATIN SMALL LETTER I WITH BREVE
-<Multi_key> <b> <i> : "ĭ" U012D # LATIN SMALL LETTER I WITH BREVE
-<dead_ogonek> <I> : "Į" U012E # LATIN CAPITAL LETTER I WITH OGONEK
-<Multi_key> <semicolon> <I> : "Į" U012E # LATIN CAPITAL LETTER I WITH OGONEK
-<Multi_key> <comma> <I> : "Į" U012E # LATIN CAPITAL LETTER I WITH OGONEK
-<dead_ogonek> <i> : "į" U012F # LATIN SMALL LETTER I WITH OGONEK
-<Multi_key> <semicolon> <i> : "į" U012F # LATIN SMALL LETTER I WITH OGONEK
-<Multi_key> <comma> <i> : "į" U012F # LATIN SMALL LETTER I WITH OGONEK
-<dead_abovedot> <I> : "İ" U0130 # LATIN CAPITAL LETTER I WITH DOT ABOVE
-<Multi_key> <period> <I> : "İ" U0130 # LATIN CAPITAL LETTER I WITH DOT ABOVE
-<dead_abovedot> <i> : "ı" U0131 # LATIN SMALL LETTER DOTLESS I
-<Multi_key> <i> <period> : "ı" U0131 # LATIN SMALL LETTER DOTLESS I
-<dead_circumflex> <J> : "Ĵ" U0134 # LATIN CAPITAL LETTER J WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <J> : "Ĵ" U0134 # LATIN CAPITAL LETTER J WITH CIRCUMFLEX
-<dead_circumflex> <j> : "ĵ" U0135 # LATIN SMALL LETTER J WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <j> : "ĵ" U0135 # LATIN SMALL LETTER J WITH CIRCUMFLEX
-<dead_cedilla> <K> : "Ķ" U0136 # LATIN CAPITAL LETTER K WITH CEDILLA
-<Multi_key> <comma> <K> : "Ķ" U0136 # LATIN CAPITAL LETTER K WITH CEDILLA
-<Multi_key> <cedilla> <K> : "Ķ" U0136 # LATIN CAPITAL LETTER K WITH CEDILLA
-<dead_cedilla> <k> : "ķ" U0137 # LATIN SMALL LETTER K WITH CEDILLA
-<Multi_key> <comma> <k> : "ķ" U0137 # LATIN SMALL LETTER K WITH CEDILLA
-<Multi_key> <cedilla> <k> : "ķ" U0137 # LATIN SMALL LETTER K WITH CEDILLA
-<Multi_key> <k> <k> : "ĸ" U0138 # LATIN SMALL LETTER KRA
-<dead_acute> <L> : "Ĺ" U0139 # LATIN CAPITAL LETTER L WITH ACUTE
-<Multi_key> <acute> <L> : "Ĺ" U0139 # LATIN CAPITAL LETTER L WITH ACUTE
-<Multi_key> <apostrophe> <L> : "Ĺ" U0139 # LATIN CAPITAL LETTER L WITH ACUTE
-<dead_acute> <l> : "ĺ" U013A # LATIN SMALL LETTER L WITH ACUTE
-<Multi_key> <acute> <l> : "ĺ" U013A # LATIN SMALL LETTER L WITH ACUTE
-<Multi_key> <apostrophe> <l> : "ĺ" U013A # LATIN SMALL LETTER L WITH ACUTE
-<dead_cedilla> <L> : "Ļ" U013B # LATIN CAPITAL LETTER L WITH CEDILLA
-<Multi_key> <comma> <L> : "Ļ" U013B # LATIN CAPITAL LETTER L WITH CEDILLA
-<Multi_key> <cedilla> <L> : "Ļ" U013B # LATIN CAPITAL LETTER L WITH CEDILLA
-<dead_cedilla> <l> : "ļ" U013C # LATIN SMALL LETTER L WITH CEDILLA
-<Multi_key> <comma> <l> : "ļ" U013C # LATIN SMALL LETTER L WITH CEDILLA
-<Multi_key> <cedilla> <l> : "ļ" U013C # LATIN SMALL LETTER L WITH CEDILLA
-<dead_caron> <L> : "Ľ" U013D # LATIN CAPITAL LETTER L WITH CARON
-<Multi_key> <c> <L> : "Ľ" U013D # LATIN CAPITAL LETTER L WITH CARON
-<dead_caron> <l> : "ľ" U013E # LATIN SMALL LETTER L WITH CARON
-<Multi_key> <c> <l> : "ľ" U013E # LATIN SMALL LETTER L WITH CARON
-<dead_stroke> <L> : "Ł" U0141 # LATIN CAPITAL LETTER L WITH STROKE
-<Multi_key> <slash> <L> : "Ł" U0141 # LATIN CAPITAL LETTER L WITH STROKE
-<Multi_key> <KP_Divide> <L> : "Ł" U0141 # LATIN CAPITAL LETTER L WITH STROKE
-<dead_stroke> <l> : "ł" U0142 # LATIN SMALL LETTER L WITH STROKE
-<Multi_key> <slash> <l> : "ł" U0142 # LATIN SMALL LETTER L WITH STROKE
-<Multi_key> <KP_Divide> <l> : "ł" U0142 # LATIN SMALL LETTER L WITH STROKE
-<dead_acute> <N> : "Ń" U0143 # LATIN CAPITAL LETTER N WITH ACUTE
-<Multi_key> <acute> <N> : "Ń" U0143 # LATIN CAPITAL LETTER N WITH ACUTE
-<Multi_key> <apostrophe> <N> : "Ń" U0143 # LATIN CAPITAL LETTER N WITH ACUTE
-<dead_acute> <n> : "ń" U0144 # LATIN SMALL LETTER N WITH ACUTE
-<Multi_key> <acute> <n> : "ń" U0144 # LATIN SMALL LETTER N WITH ACUTE
-<Multi_key> <apostrophe> <n> : "ń" U0144 # LATIN SMALL LETTER N WITH ACUTE
-<dead_cedilla> <N> : "Ņ" U0145 # LATIN CAPITAL LETTER N WITH CEDILLA
-<Multi_key> <comma> <N> : "Ņ" U0145 # LATIN CAPITAL LETTER N WITH CEDILLA
-<Multi_key> <cedilla> <N> : "Ņ" U0145 # LATIN CAPITAL LETTER N WITH CEDILLA
-<dead_cedilla> <n> : "ņ" U0146 # LATIN SMALL LETTER N WITH CEDILLA
-<Multi_key> <comma> <n> : "ņ" U0146 # LATIN SMALL LETTER N WITH CEDILLA
-<Multi_key> <cedilla> <n> : "ņ" U0146 # LATIN SMALL LETTER N WITH CEDILLA
-<dead_caron> <N> : "Ň" U0147 # LATIN CAPITAL LETTER N WITH CARON
-<Multi_key> <c> <N> : "Ň" U0147 # LATIN CAPITAL LETTER N WITH CARON
-<dead_caron> <n> : "ň" U0148 # LATIN SMALL LETTER N WITH CARON
-<Multi_key> <c> <n> : "ň" U0148 # LATIN SMALL LETTER N WITH CARON
-<Multi_key> <N> <G> : "Ŋ" U014A # LATIN CAPITAL LETTER ENG
-<Multi_key> <n> <g> : "ŋ" U014B # LATIN SMALL LETTER ENG
-<dead_macron> <O> : "Ō" U014C # LATIN CAPITAL LETTER O WITH MACRON
-<Multi_key> <macron> <O> : "Ō" U014C # LATIN CAPITAL LETTER O WITH MACRON
-<Multi_key> <underscore> <O> : "Ō" U014C # LATIN CAPITAL LETTER O WITH MACRON
-<dead_macron> <o> : "ō" U014D # LATIN SMALL LETTER O WITH MACRON
-<Multi_key> <macron> <o> : "ō" U014D # LATIN SMALL LETTER O WITH MACRON
-<Multi_key> <underscore> <o> : "ō" U014D # LATIN SMALL LETTER O WITH MACRON
-<dead_breve> <O> : "Ŏ" U014E # LATIN CAPITAL LETTER O WITH BREVE
-<Multi_key> <U> <O> : "Ŏ" U014E # LATIN CAPITAL LETTER O WITH BREVE
-<Multi_key> <b> <O> : "Ŏ" U014E # LATIN CAPITAL LETTER O WITH BREVE
-<dead_breve> <o> : "ŏ" U014F # LATIN SMALL LETTER O WITH BREVE
-<Multi_key> <U> <o> : "ŏ" U014F # LATIN SMALL LETTER O WITH BREVE
-<Multi_key> <b> <o> : "ŏ" U014F # LATIN SMALL LETTER O WITH BREVE
-<dead_doubleacute> <O> : "Ő" U0150 # LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
-<Multi_key> <equal> <O> : "Ő" U0150 # LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
-<dead_doubleacute> <o> : "ő" U0151 # LATIN SMALL LETTER O WITH DOUBLE ACUTE
-<Multi_key> <equal> <o> : "ő" U0151 # LATIN SMALL LETTER O WITH DOUBLE ACUTE
-<dead_acute> <R> : "Ŕ" U0154 # LATIN CAPITAL LETTER R WITH ACUTE
-<Multi_key> <acute> <R> : "Ŕ" U0154 # LATIN CAPITAL LETTER R WITH ACUTE
-<Multi_key> <apostrophe> <R> : "Ŕ" U0154 # LATIN CAPITAL LETTER R WITH ACUTE
-<dead_acute> <r> : "ŕ" U0155 # LATIN SMALL LETTER R WITH ACUTE
-<Multi_key> <acute> <r> : "ŕ" U0155 # LATIN SMALL LETTER R WITH ACUTE
-<Multi_key> <apostrophe> <r> : "ŕ" U0155 # LATIN SMALL LETTER R WITH ACUTE
-<dead_cedilla> <R> : "Ŗ" U0156 # LATIN CAPITAL LETTER R WITH CEDILLA
-<Multi_key> <comma> <R> : "Ŗ" U0156 # LATIN CAPITAL LETTER R WITH CEDILLA
-<Multi_key> <cedilla> <R> : "Ŗ" U0156 # LATIN CAPITAL LETTER R WITH CEDILLA
-<dead_cedilla> <r> : "ŗ" U0157 # LATIN SMALL LETTER R WITH CEDILLA
-<Multi_key> <comma> <r> : "ŗ" U0157 # LATIN SMALL LETTER R WITH CEDILLA
-<Multi_key> <cedilla> <r> : "ŗ" U0157 # LATIN SMALL LETTER R WITH CEDILLA
-<dead_caron> <R> : "Ř" U0158 # LATIN CAPITAL LETTER R WITH CARON
-<Multi_key> <c> <R> : "Ř" U0158 # LATIN CAPITAL LETTER R WITH CARON
-<dead_caron> <r> : "ř" U0159 # LATIN SMALL LETTER R WITH CARON
-<Multi_key> <c> <r> : "ř" U0159 # LATIN SMALL LETTER R WITH CARON
-<dead_acute> <S> : "Ś" U015A # LATIN CAPITAL LETTER S WITH ACUTE
-<Multi_key> <acute> <S> : "Ś" U015A # LATIN CAPITAL LETTER S WITH ACUTE
-<Multi_key> <apostrophe> <S> : "Ś" U015A # LATIN CAPITAL LETTER S WITH ACUTE
-<dead_acute> <s> : "ś" U015B # LATIN SMALL LETTER S WITH ACUTE
-<Multi_key> <acute> <s> : "ś" U015B # LATIN SMALL LETTER S WITH ACUTE
-<Multi_key> <apostrophe> <s> : "ś" U015B # LATIN SMALL LETTER S WITH ACUTE
-<dead_circumflex> <S> : "Ŝ" U015C # LATIN CAPITAL LETTER S WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <S> : "Ŝ" U015C # LATIN CAPITAL LETTER S WITH CIRCUMFLEX
-<dead_circumflex> <s> : "ŝ" U015D # LATIN SMALL LETTER S WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <s> : "ŝ" U015D # LATIN SMALL LETTER S WITH CIRCUMFLEX
-<dead_cedilla> <S> : "Ş" U015E # LATIN CAPITAL LETTER S WITH CEDILLA
-<Multi_key> <comma> <S> : "Ş" U015E # LATIN CAPITAL LETTER S WITH CEDILLA
-<Multi_key> <cedilla> <S> : "Ş" U015E # LATIN CAPITAL LETTER S WITH CEDILLA
-<dead_cedilla> <s> : "ş" U015F # LATIN SMALL LETTER S WITH CEDILLA
-<Multi_key> <comma> <s> : "ş" U015F # LATIN SMALL LETTER S WITH CEDILLA
-<Multi_key> <cedilla> <s> : "ş" U015F # LATIN SMALL LETTER S WITH CEDILLA
-<dead_caron> <S> : "Š" U0160 # LATIN CAPITAL LETTER S WITH CARON
-<Multi_key> <c> <S> : "Š" U0160 # LATIN CAPITAL LETTER S WITH CARON
-<dead_caron> <s> : "š" U0161 # LATIN SMALL LETTER S WITH CARON
-<Multi_key> <c> <s> : "š" U0161 # LATIN SMALL LETTER S WITH CARON
-<dead_cedilla> <T> : "Ţ" U0162 # LATIN CAPITAL LETTER T WITH CEDILLA
-<Multi_key> <comma> <T> : "Ţ" U0162 # LATIN CAPITAL LETTER T WITH CEDILLA
-<Multi_key> <cedilla> <T> : "Ţ" U0162 # LATIN CAPITAL LETTER T WITH CEDILLA
-<dead_cedilla> <t> : "ţ" U0163 # LATIN SMALL LETTER T WITH CEDILLA
-<Multi_key> <comma> <t> : "ţ" U0163 # LATIN SMALL LETTER T WITH CEDILLA
-<Multi_key> <cedilla> <t> : "ţ" U0163 # LATIN SMALL LETTER T WITH CEDILLA
-<dead_caron> <T> : "Ť" U0164 # LATIN CAPITAL LETTER T WITH CARON
-<Multi_key> <c> <T> : "Ť" U0164 # LATIN CAPITAL LETTER T WITH CARON
-<dead_caron> <t> : "ť" U0165 # LATIN SMALL LETTER T WITH CARON
-<Multi_key> <c> <t> : "ť" U0165 # LATIN SMALL LETTER T WITH CARON
-<dead_stroke> <T> : "Ŧ" U0166 # LATIN CAPITAL LETTER T WITH STROKE
-<Multi_key> <slash> <T> : "Ŧ" U0166 # LATIN CAPITAL LETTER T WITH STROKE
-<Multi_key> <KP_Divide> <T> : "Ŧ" U0166 # LATIN CAPITAL LETTER T WITH STROKE
-<dead_stroke> <t> : "ŧ" U0167 # LATIN SMALL LETTER T WITH STROKE
-<Multi_key> <slash> <t> : "ŧ" U0167 # LATIN SMALL LETTER T WITH STROKE
-<Multi_key> <KP_Divide> <t> : "ŧ" U0167 # LATIN SMALL LETTER T WITH STROKE
-<dead_tilde> <U> : "Ũ" U0168 # LATIN CAPITAL LETTER U WITH TILDE
-<Multi_key> <asciitilde> <U> : "Ũ" U0168 # LATIN CAPITAL LETTER U WITH TILDE
-<dead_tilde> <u> : "ũ" U0169 # LATIN SMALL LETTER U WITH TILDE
-<Multi_key> <asciitilde> <u> : "ũ" U0169 # LATIN SMALL LETTER U WITH TILDE
-<dead_macron> <U> : "Ū" U016A # LATIN CAPITAL LETTER U WITH MACRON
-<Multi_key> <macron> <U> : "Ū" U016A # LATIN CAPITAL LETTER U WITH MACRON
-<Multi_key> <underscore> <U> : "Ū" U016A # LATIN CAPITAL LETTER U WITH MACRON
-<dead_macron> <u> : "ū" U016B # LATIN SMALL LETTER U WITH MACRON
-<Multi_key> <macron> <u> : "ū" U016B # LATIN SMALL LETTER U WITH MACRON
-<Multi_key> <underscore> <u> : "ū" U016B # LATIN SMALL LETTER U WITH MACRON
-<dead_breve> <U> : "Ŭ" U016C # LATIN CAPITAL LETTER U WITH BREVE
-<Multi_key> <U> <U> : "Ŭ" U016C # LATIN CAPITAL LETTER U WITH BREVE
-<Multi_key> <b> <U> : "Ŭ" U016C # LATIN CAPITAL LETTER U WITH BREVE
-<dead_breve> <u> : "ŭ" U016D # LATIN SMALL LETTER U WITH BREVE
-<Multi_key> <U> <u> : "ŭ" U016D # LATIN SMALL LETTER U WITH BREVE
-<Multi_key> <u> <u> : "ŭ" U016D # LATIN SMALL LETTER U WITH BREVE
-<Multi_key> <b> <u> : "ŭ" U016D # LATIN SMALL LETTER U WITH BREVE
-<dead_abovering> <U> : "Ů" U016E # LATIN CAPITAL LETTER U WITH RING ABOVE
-<Multi_key> <o> <U> : "Ů" U016E # LATIN CAPITAL LETTER U WITH RING ABOVE
-<dead_abovering> <u> : "ů" U016F # LATIN SMALL LETTER U WITH RING ABOVE
-<Multi_key> <o> <u> : "ů" U016F # LATIN SMALL LETTER U WITH RING ABOVE
-<dead_doubleacute> <U> : "Ű" U0170 # LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
-<Multi_key> <equal> <U> : "Ű" U0170 # LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
-<dead_doubleacute> <u> : "ű" U0171 # LATIN SMALL LETTER U WITH DOUBLE ACUTE
-<Multi_key> <equal> <u> : "ű" U0171 # LATIN SMALL LETTER U WITH DOUBLE ACUTE
-<dead_ogonek> <U> : "Ų" U0172 # LATIN CAPITAL LETTER U WITH OGONEK
-<Multi_key> <semicolon> <U> : "Ų" U0172 # LATIN CAPITAL LETTER U WITH OGONEK
-<Multi_key> <comma> <U> : "Ų" U0172 # LATIN CAPITAL LETTER U WITH OGONEK
-<dead_ogonek> <u> : "ų" U0173 # LATIN SMALL LETTER U WITH OGONEK
-<Multi_key> <semicolon> <u> : "ų" U0173 # LATIN SMALL LETTER U WITH OGONEK
-<Multi_key> <comma> <u> : "ų" U0173 # LATIN SMALL LETTER U WITH OGONEK
-<dead_circumflex> <W> : "Ŵ" U0174 # LATIN CAPITAL LETTER W WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <W> : "Ŵ" U0174 # LATIN CAPITAL LETTER W WITH CIRCUMFLEX
-<dead_circumflex> <w> : "ŵ" U0175 # LATIN SMALL LETTER W WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <w> : "ŵ" U0175 # LATIN SMALL LETTER W WITH CIRCUMFLEX
-<dead_circumflex> <Y> : "Ŷ" U0176 # LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <Y> : "Ŷ" U0176 # LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
-<dead_circumflex> <y> : "ŷ" U0177 # LATIN SMALL LETTER Y WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <y> : "ŷ" U0177 # LATIN SMALL LETTER Y WITH CIRCUMFLEX
-<dead_diaeresis> <Y> : "Ÿ" U0178 # LATIN CAPITAL LETTER Y WITH DIAERESIS
-<Multi_key> <quotedbl> <Y> : "Ÿ" U0178 # LATIN CAPITAL LETTER Y WITH DIAERESIS
-<dead_acute> <Z> : "Ź" U0179 # LATIN CAPITAL LETTER Z WITH ACUTE
-<Multi_key> <acute> <Z> : "Ź" U0179 # LATIN CAPITAL LETTER Z WITH ACUTE
-<Multi_key> <apostrophe> <Z> : "Ź" U0179 # LATIN CAPITAL LETTER Z WITH ACUTE
-<dead_acute> <z> : "ź" U017A # LATIN SMALL LETTER Z WITH ACUTE
-<Multi_key> <acute> <z> : "ź" U017A # LATIN SMALL LETTER Z WITH ACUTE
-<Multi_key> <apostrophe> <z> : "ź" U017A # LATIN SMALL LETTER Z WITH ACUTE
-<dead_abovedot> <Z> : "Ż" U017B # LATIN CAPITAL LETTER Z WITH DOT ABOVE
-<Multi_key> <period> <Z> : "Ż" U017B # LATIN CAPITAL LETTER Z WITH DOT ABOVE
-<dead_abovedot> <z> : "ż" U017C # LATIN SMALL LETTER Z WITH DOT ABOVE
-<Multi_key> <period> <z> : "ż" U017C # LATIN SMALL LETTER Z WITH DOT ABOVE
-<dead_caron> <Z> : "Ž" U017D # LATIN CAPITAL LETTER Z WITH CARON
-<Multi_key> <c> <Z> : "Ž" U017D # LATIN CAPITAL LETTER Z WITH CARON
-<dead_caron> <z> : "ž" U017E # LATIN SMALL LETTER Z WITH CARON
-<Multi_key> <c> <z> : "ž" U017E # LATIN SMALL LETTER Z WITH CARON
-<dead_stroke> <b> : "ƀ" U0180 # LATIN SMALL LETTER B WITH STROKE
-<Multi_key> <slash> <b> : "ƀ" U0180 # LATIN SMALL LETTER B WITH STROKE
-<Multi_key> <KP_Divide> <b> : "ƀ" U0180 # LATIN SMALL LETTER B WITH STROKE
-<dead_stroke> <I> : "Ɨ" U0197 # LATIN CAPITAL LETTER I WITH STROKE
-<Multi_key> <slash> <I> : "Ɨ" U0197 # LATIN CAPITAL LETTER I WITH STROKE
-<Multi_key> <KP_Divide> <I> : "Ɨ" U0197 # LATIN CAPITAL LETTER I WITH STROKE
-<dead_horn> <O> : "Ơ" U01A0 # LATIN CAPITAL LETTER O WITH HORN
-<Multi_key> <plus> <O> : "Ơ" U01A0 # LATIN CAPITAL LETTER O WITH HORN
-<dead_horn> <o> : "ơ" U01A1 # LATIN SMALL LETTER O WITH HORN
-<Multi_key> <plus> <o> : "ơ" U01A1 # LATIN SMALL LETTER O WITH HORN
-<dead_horn> <U> : "Ư" U01AF # LATIN CAPITAL LETTER U WITH HORN
-<Multi_key> <plus> <U> : "Ư" U01AF # LATIN CAPITAL LETTER U WITH HORN
-<dead_horn> <u> : "ư" U01B0 # LATIN SMALL LETTER U WITH HORN
-<Multi_key> <plus> <u> : "ư" U01B0 # LATIN SMALL LETTER U WITH HORN
-<dead_stroke> <Z> : "Ƶ" U01B5 # LATIN CAPITAL LETTER Z WITH STROKE
-<Multi_key> <slash> <Z> : "Ƶ" U01B5 # LATIN CAPITAL LETTER Z WITH STROKE
-<Multi_key> <KP_Divide> <Z> : "Ƶ" U01B5 # LATIN CAPITAL LETTER Z WITH STROKE
-<dead_stroke> <z> : "ƶ" U01B6 # LATIN SMALL LETTER Z WITH STROKE
-<Multi_key> <slash> <z> : "ƶ" U01B6 # LATIN SMALL LETTER Z WITH STROKE
-<Multi_key> <KP_Divide> <z> : "ƶ" U01B6 # LATIN SMALL LETTER Z WITH STROKE
-<dead_caron> <A> : "Ǎ" U01CD # LATIN CAPITAL LETTER A WITH CARON
-<Multi_key> <c> <A> : "Ǎ" U01CD # LATIN CAPITAL LETTER A WITH CARON
-<dead_caron> <a> : "ǎ" U01CE # LATIN SMALL LETTER A WITH CARON
-<Multi_key> <c> <a> : "ǎ" U01CE # LATIN SMALL LETTER A WITH CARON
-<dead_caron> <I> : "Ǐ" U01CF # LATIN CAPITAL LETTER I WITH CARON
-<Multi_key> <c> <I> : "Ǐ" U01CF # LATIN CAPITAL LETTER I WITH CARON
-<dead_caron> <i> : "ǐ" U01D0 # LATIN SMALL LETTER I WITH CARON
-<Multi_key> <c> <i> : "ǐ" U01D0 # LATIN SMALL LETTER I WITH CARON
-<dead_caron> <O> : "Ǒ" U01D1 # LATIN CAPITAL LETTER O WITH CARON
-<Multi_key> <c> <O> : "Ǒ" U01D1 # LATIN CAPITAL LETTER O WITH CARON
-<dead_caron> <o> : "ǒ" U01D2 # LATIN SMALL LETTER O WITH CARON
-<Multi_key> <c> <o> : "ǒ" U01D2 # LATIN SMALL LETTER O WITH CARON
-<dead_caron> <U> : "Ǔ" U01D3 # LATIN CAPITAL LETTER U WITH CARON
-<Multi_key> <c> <U> : "Ǔ" U01D3 # LATIN CAPITAL LETTER U WITH CARON
-<dead_caron> <u> : "ǔ" U01D4 # LATIN SMALL LETTER U WITH CARON
-<Multi_key> <c> <u> : "ǔ" U01D4 # LATIN SMALL LETTER U WITH CARON
-<dead_macron> <Udiaeresis> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <Udiaeresis> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <Udiaeresis> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
-<dead_macron> <dead_diaeresis> <U> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
-<dead_macron> <Multi_key> <quotedbl> <U> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <dead_diaeresis> <U> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <quotedbl> <U> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <dead_diaeresis> <U> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <quotedbl> <U> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
-<dead_macron> <udiaeresis> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <udiaeresis> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <udiaeresis> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
-<dead_macron> <dead_diaeresis> <u> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
-<dead_macron> <Multi_key> <quotedbl> <u> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <dead_diaeresis> <u> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <quotedbl> <u> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <dead_diaeresis> <u> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <quotedbl> <u> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
-<dead_acute> <Udiaeresis> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
-<Multi_key> <acute> <Udiaeresis> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
-<Multi_key> <apostrophe> <Udiaeresis> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
-<dead_acute> <dead_diaeresis> <U> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
-<dead_acute> <Multi_key> <quotedbl> <U> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
-<Multi_key> <acute> <dead_diaeresis> <U> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
-<Multi_key> <acute> <quotedbl> <U> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
-<Multi_key> <apostrophe> <dead_diaeresis> <U> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
-<Multi_key> <apostrophe> <quotedbl> <U> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
-<dead_acute> <udiaeresis> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
-<Multi_key> <acute> <udiaeresis> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
-<Multi_key> <apostrophe> <udiaeresis> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
-<dead_acute> <dead_diaeresis> <u> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
-<dead_acute> <Multi_key> <quotedbl> <u> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
-<Multi_key> <acute> <dead_diaeresis> <u> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
-<Multi_key> <acute> <quotedbl> <u> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
-<Multi_key> <apostrophe> <dead_diaeresis> <u> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
-<Multi_key> <apostrophe> <quotedbl> <u> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
-<dead_caron> <Udiaeresis> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
-<Multi_key> <c> <Udiaeresis> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
-<dead_caron> <dead_diaeresis> <U> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
-<dead_caron> <Multi_key> <quotedbl> <U> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
-<Multi_key> <c> <dead_diaeresis> <U> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
-<Multi_key> <c> <quotedbl> <U> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
-<dead_caron> <udiaeresis> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
-<Multi_key> <c> <udiaeresis> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
-<dead_caron> <dead_diaeresis> <u> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
-<dead_caron> <Multi_key> <quotedbl> <u> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
-<Multi_key> <c> <dead_diaeresis> <u> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
-<Multi_key> <c> <quotedbl> <u> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
-<dead_grave> <Udiaeresis> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
-<Multi_key> <grave> <Udiaeresis> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
-<dead_grave> <dead_diaeresis> <U> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
-<dead_grave> <Multi_key> <quotedbl> <U> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
-<Multi_key> <grave> <dead_diaeresis> <U> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
-<Multi_key> <grave> <quotedbl> <U> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
-<dead_grave> <udiaeresis> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
-<Multi_key> <grave> <udiaeresis> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
-<dead_grave> <dead_diaeresis> <u> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
-<dead_grave> <Multi_key> <quotedbl> <u> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
-<Multi_key> <grave> <dead_diaeresis> <u> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
-<Multi_key> <grave> <quotedbl> <u> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
-<dead_macron> <Adiaeresis> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <Adiaeresis> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <Adiaeresis> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
-<dead_macron> <dead_diaeresis> <A> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
-<dead_macron> <Multi_key> <quotedbl> <A> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <dead_diaeresis> <A> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <quotedbl> <A> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <dead_diaeresis> <A> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <quotedbl> <A> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
-<dead_macron> <adiaeresis> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <adiaeresis> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <adiaeresis> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
-<dead_macron> <dead_diaeresis> <a> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
-<dead_macron> <Multi_key> <quotedbl> <a> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <dead_diaeresis> <a> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <quotedbl> <a> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <dead_diaeresis> <a> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <quotedbl> <a> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
-<dead_macron> <U0226> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
-<Multi_key> <macron> <U0226> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
-<Multi_key> <underscore> <U0226> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
-<dead_macron> <dead_abovedot> <A> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
-<dead_macron> <Multi_key> <period> <A> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
-<Multi_key> <macron> <dead_abovedot> <A> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
-<Multi_key> <macron> <period> <A> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
-<Multi_key> <underscore> <dead_abovedot> <A> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
-<Multi_key> <underscore> <period> <A> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
-<dead_macron> <U0227> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
-<Multi_key> <macron> <U0227> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
-<Multi_key> <underscore> <U0227> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
-<dead_macron> <dead_abovedot> <a> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
-<dead_macron> <Multi_key> <period> <a> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
-<Multi_key> <macron> <dead_abovedot> <a> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
-<Multi_key> <macron> <period> <a> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
-<Multi_key> <underscore> <dead_abovedot> <a> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
-<Multi_key> <underscore> <period> <a> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
-<dead_macron> <AE> : "Ǣ" U01E2 # LATIN CAPITAL LETTER AE WITH MACRON
-<Multi_key> <macron> <AE> : "Ǣ" U01E2 # LATIN CAPITAL LETTER AE WITH MACRON
-<Multi_key> <underscore> <AE> : "Ǣ" U01E2 # LATIN CAPITAL LETTER AE WITH MACRON
-<dead_macron> <ae> : "ǣ" U01E3 # LATIN SMALL LETTER AE WITH MACRON
-<Multi_key> <macron> <ae> : "ǣ" U01E3 # LATIN SMALL LETTER AE WITH MACRON
-<Multi_key> <underscore> <ae> : "ǣ" U01E3 # LATIN SMALL LETTER AE WITH MACRON
-<dead_stroke> <G> : "Ǥ" U01E4 # LATIN CAPITAL LETTER G WITH STROKE
-<Multi_key> <slash> <G> : "Ǥ" U01E4 # LATIN CAPITAL LETTER G WITH STROKE
-<Multi_key> <KP_Divide> <G> : "Ǥ" U01E4 # LATIN CAPITAL LETTER G WITH STROKE
-<dead_stroke> <g> : "ǥ" U01E5 # LATIN SMALL LETTER G WITH STROKE
-<Multi_key> <slash> <g> : "ǥ" U01E5 # LATIN SMALL LETTER G WITH STROKE
-<Multi_key> <KP_Divide> <g> : "ǥ" U01E5 # LATIN SMALL LETTER G WITH STROKE
-<dead_caron> <G> : "Ǧ" U01E6 # LATIN CAPITAL LETTER G WITH CARON
-<Multi_key> <c> <G> : "Ǧ" U01E6 # LATIN CAPITAL LETTER G WITH CARON
-<dead_caron> <g> : "ǧ" U01E7 # LATIN SMALL LETTER G WITH CARON
-<Multi_key> <c> <g> : "ǧ" U01E7 # LATIN SMALL LETTER G WITH CARON
-<dead_caron> <K> : "Ǩ" U01E8 # LATIN CAPITAL LETTER K WITH CARON
-<Multi_key> <c> <K> : "Ǩ" U01E8 # LATIN CAPITAL LETTER K WITH CARON
-<dead_caron> <k> : "ǩ" U01E9 # LATIN SMALL LETTER K WITH CARON
-<Multi_key> <c> <k> : "ǩ" U01E9 # LATIN SMALL LETTER K WITH CARON
-<dead_ogonek> <O> : "Ǫ" U01EA # LATIN CAPITAL LETTER O WITH OGONEK
-<Multi_key> <semicolon> <O> : "Ǫ" U01EA # LATIN CAPITAL LETTER O WITH OGONEK
-<dead_ogonek> <o> : "ǫ" U01EB # LATIN SMALL LETTER O WITH OGONEK
-<Multi_key> <semicolon> <o> : "ǫ" U01EB # LATIN SMALL LETTER O WITH OGONEK
-<dead_macron> <U01EA> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
-<Multi_key> <macron> <U01EA> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
-<Multi_key> <underscore> <U01EA> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
-<dead_macron> <dead_ogonek> <O> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
-<dead_macron> <Multi_key> <semicolon> <O> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
-<Multi_key> <macron> <dead_ogonek> <O> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
-<Multi_key> <macron> <semicolon> <O> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
-<Multi_key> <underscore> <dead_ogonek> <O> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
-<Multi_key> <underscore> <semicolon> <O> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
-<dead_macron> <U01EB> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
-<Multi_key> <macron> <U01EB> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
-<Multi_key> <underscore> <U01EB> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
-<dead_macron> <dead_ogonek> <o> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
-<dead_macron> <Multi_key> <semicolon> <o> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
-<Multi_key> <macron> <dead_ogonek> <o> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
-<Multi_key> <macron> <semicolon> <o> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
-<Multi_key> <underscore> <dead_ogonek> <o> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
-<Multi_key> <underscore> <semicolon> <o> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
-<dead_caron> <U01B7> : "Ǯ" U01EE # LATIN CAPITAL LETTER EZH WITH CARON
-<Multi_key> <c> <U01B7> : "Ǯ" U01EE # LATIN CAPITAL LETTER EZH WITH CARON
-<dead_caron> <U0292> : "ǯ" U01EF # LATIN SMALL LETTER EZH WITH CARON
-<Multi_key> <c> <U0292> : "ǯ" U01EF # LATIN SMALL LETTER EZH WITH CARON
-<dead_caron> <j> : "ǰ" U01F0 # LATIN SMALL LETTER J WITH CARON
-<Multi_key> <c> <j> : "ǰ" U01F0 # LATIN SMALL LETTER J WITH CARON
-<dead_acute> <G> : "Ǵ" U01F4 # LATIN CAPITAL LETTER G WITH ACUTE
-<Multi_key> <acute> <G> : "Ǵ" U01F4 # LATIN CAPITAL LETTER G WITH ACUTE
-<Multi_key> <apostrophe> <G> : "Ǵ" U01F4 # LATIN CAPITAL LETTER G WITH ACUTE
-<dead_acute> <g> : "ǵ" U01F5 # LATIN SMALL LETTER G WITH ACUTE
-<Multi_key> <acute> <g> : "ǵ" U01F5 # LATIN SMALL LETTER G WITH ACUTE
-<Multi_key> <apostrophe> <g> : "ǵ" U01F5 # LATIN SMALL LETTER G WITH ACUTE
-<dead_grave> <N> : "Ǹ" U01F8 # LATIN CAPITAL LETTER N WITH GRAVE
-<Multi_key> <grave> <N> : "Ǹ" U01F8 # LATIN CAPITAL LETTER N WITH GRAVE
-<dead_grave> <n> : "ǹ" U01F9 # LATIN SMALL LETTER N WITH GRAVE
-<Multi_key> <grave> <n> : "ǹ" U01F9 # LATIN SMALL LETTER N WITH GRAVE
-<dead_acute> <Aring> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
-<Multi_key> <acute> <Aring> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
-<Multi_key> <apostrophe> <Aring> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
-<dead_acute> <dead_abovering> <A> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
-<dead_acute> <Multi_key> <o> <A> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
-<Multi_key> <acute> <dead_abovering> <A> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
-<Multi_key> <apostrophe> <dead_abovering> <A> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
-<Multi_key> <o> <apostrophe> <A> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
-<dead_acute> <aring> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
-<Multi_key> <acute> <aring> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
-<Multi_key> <apostrophe> <aring> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
-<dead_acute> <dead_abovering> <a> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
-<dead_acute> <Multi_key> <o> <a> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
-<Multi_key> <acute> <dead_abovering> <a> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
-<Multi_key> <apostrophe> <dead_abovering> <a> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
-<Multi_key> <o> <apostrophe> <a> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
-<dead_acute> <AE> : "Ǽ" U01FC # LATIN CAPITAL LETTER AE WITH ACUTE
-<Multi_key> <acute> <AE> : "Ǽ" U01FC # LATIN CAPITAL LETTER AE WITH ACUTE
-<Multi_key> <apostrophe> <AE> : "Ǽ" U01FC # LATIN CAPITAL LETTER AE WITH ACUTE
-<dead_acute> <ae> : "ǽ" U01FD # LATIN SMALL LETTER AE WITH ACUTE
-<Multi_key> <acute> <ae> : "ǽ" U01FD # LATIN SMALL LETTER AE WITH ACUTE
-<Multi_key> <apostrophe> <ae> : "ǽ" U01FD # LATIN SMALL LETTER AE WITH ACUTE
-<dead_acute> <Ooblique> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
-<Multi_key> <acute> <Ooblique> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
-<Multi_key> <apostrophe> <Ooblique> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
-<dead_acute> <dead_stroke> <O> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
-<dead_acute> <Multi_key> <slash> <O> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
-<Multi_key> <acute> <slash> <O> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
-<Multi_key> <apostrophe> <slash> <O> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
-<dead_acute> <Multi_key> <KP_Divide> <O> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
-<Multi_key> <acute> <KP_Divide> <O> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
-<Multi_key> <apostrophe> <KP_Divide> <O> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
-<dead_stroke> <dead_acute> <O> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
-<dead_acute> <oslash> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
-<Multi_key> <acute> <oslash> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
-<Multi_key> <apostrophe> <oslash> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
-<dead_acute> <dead_stroke> <o> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
-<dead_acute> <Multi_key> <slash> <o> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
-<Multi_key> <acute> <slash> <o> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
-<Multi_key> <apostrophe> <slash> <o> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
-<dead_acute> <Multi_key> <KP_Divide> <o> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
-<Multi_key> <acute> <KP_Divide> <o> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
-<Multi_key> <apostrophe> <KP_Divide> <o> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
-<dead_stroke> <dead_acute> <o> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
-<dead_double_grave> <A> : "Ȁ" U0200 # LATIN CAPITAL LETTER A WITH DOUBLE GRAVE
-<dead_double_grave> <a> : "ȁ" U0201 # LATIN SMALL LETTER A WITH DOUBLE GRAVE
-<dead_inverted_breve> <A> : "Ȃ" U0202 # LATIN CAPITAL LETTER A WITH INVERTED BREVE
-<dead_inverted_breve> <a> : "ȃ" U0203 # LATIN SMALL LETTER A WITH INVERTED BREVE
-<dead_double_grave> <E> : "Ȅ" U0204 # LATIN CAPITAL LETTER E WITH DOUBLE GRAVE
-<dead_double_grave> <e> : "ȅ" U0205 # LATIN SMALL LETTER E WITH DOUBLE GRAVE
-<dead_inverted_breve> <E> : "Ȇ" U0206 # LATIN CAPITAL LETTER E WITH INVERTED BREVE
-<dead_inverted_breve> <e> : "ȇ" U0207 # LATIN SMALL LETTER E WITH INVERTED BREVE
-<dead_double_grave> <I> : "Ȉ" U0208 # LATIN CAPITAL LETTER I WITH DOUBLE GRAVE
-<dead_double_grave> <i> : "ȉ" U0209 # LATIN SMALL LETTER I WITH DOUBLE GRAVE
-<dead_inverted_breve> <I> : "Ȋ" U020A # LATIN CAPITAL LETTER I WITH INVERTED BREVE
-<dead_inverted_breve> <i> : "ȋ" U020B # LATIN SMALL LETTER I WITH INVERTED BREVE
-<dead_double_grave> <O> : "Ȍ" U020C # LATIN CAPITAL LETTER O WITH DOUBLE GRAVE
-<dead_double_grave> <o> : "ȍ" U020D # LATIN SMALL LETTER O WITH DOUBLE GRAVE
-<dead_inverted_breve> <O> : "Ȏ" U020E # LATIN CAPITAL LETTER O WITH INVERTED BREVE
-<dead_inverted_breve> <o> : "ȏ" U020F # LATIN SMALL LETTER O WITH INVERTED BREVE
-<dead_double_grave> <R> : "Ȑ" U0210 # LATIN CAPITAL LETTER R WITH DOUBLE GRAVE
-<dead_double_grave> <r> : "ȑ" U0211 # LATIN SMALL LETTER R WITH DOUBLE GRAVE
-<dead_inverted_breve> <R> : "Ȓ" U0212 # LATIN CAPITAL LETTER R WITH INVERTED BREVE
-<dead_inverted_breve> <r> : "ȓ" U0213 # LATIN SMALL LETTER R WITH INVERTED BREVE
-<dead_double_grave> <U> : "Ȕ" U0214 # LATIN CAPITAL LETTER U WITH DOUBLE GRAVE
-<dead_double_grave> <u> : "ȕ" U0215 # LATIN SMALL LETTER U WITH DOUBLE GRAVE
-<dead_inverted_breve> <U> : "Ȗ" U0216 # LATIN CAPITAL LETTER U WITH INVERTED BREVE
-<dead_inverted_breve> <u> : "ȗ" U0217 # LATIN SMALL LETTER U WITH INVERTED BREVE
-<dead_caron> <H> : "Ȟ" U021E # LATIN CAPITAL LETTER H WITH CARON
-<Multi_key> <c> <H> : "Ȟ" U021E # LATIN CAPITAL LETTER H WITH CARON
-<dead_caron> <h> : "ȟ" U021F # LATIN SMALL LETTER H WITH CARON
-<Multi_key> <c> <h> : "ȟ" U021F # LATIN SMALL LETTER H WITH CARON
-<dead_abovedot> <A> : "Ȧ" U0226 # LATIN CAPITAL LETTER A WITH DOT ABOVE
-<Multi_key> <period> <A> : "Ȧ" U0226 # LATIN CAPITAL LETTER A WITH DOT ABOVE
-<dead_abovedot> <a> : "ȧ" U0227 # LATIN SMALL LETTER A WITH DOT ABOVE
-<Multi_key> <period> <a> : "ȧ" U0227 # LATIN SMALL LETTER A WITH DOT ABOVE
-<dead_cedilla> <E> : "Ȩ" U0228 # LATIN CAPITAL LETTER E WITH CEDILLA
-<Multi_key> <cedilla> <E> : "Ȩ" U0228 # LATIN CAPITAL LETTER E WITH CEDILLA
-<dead_cedilla> <e> : "ȩ" U0229 # LATIN SMALL LETTER E WITH CEDILLA
-<Multi_key> <cedilla> <e> : "ȩ" U0229 # LATIN SMALL LETTER E WITH CEDILLA
-<dead_macron> <Odiaeresis> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <Odiaeresis> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <Odiaeresis> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
-<dead_macron> <dead_diaeresis> <O> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
-<dead_macron> <Multi_key> <quotedbl> <O> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <dead_diaeresis> <O> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <quotedbl> <O> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <dead_diaeresis> <O> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <quotedbl> <O> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
-<dead_macron> <odiaeresis> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <odiaeresis> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <odiaeresis> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
-<dead_macron> <dead_diaeresis> <o> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
-<dead_macron> <Multi_key> <quotedbl> <o> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <dead_diaeresis> <o> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
-<Multi_key> <macron> <quotedbl> <o> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <dead_diaeresis> <o> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
-<Multi_key> <underscore> <quotedbl> <o> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
-<dead_macron> <Otilde> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
-<Multi_key> <macron> <Otilde> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
-<Multi_key> <underscore> <Otilde> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
-<dead_macron> <dead_tilde> <O> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
-<dead_macron> <Multi_key> <asciitilde> <O> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
-<Multi_key> <macron> <dead_tilde> <O> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
-<Multi_key> <macron> <asciitilde> <O> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
-<Multi_key> <underscore> <dead_tilde> <O> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
-<Multi_key> <underscore> <asciitilde> <O> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
-<dead_macron> <otilde> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
-<Multi_key> <macron> <otilde> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
-<Multi_key> <underscore> <otilde> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
-<dead_macron> <dead_tilde> <o> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
-<dead_macron> <Multi_key> <asciitilde> <o> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
-<Multi_key> <macron> <dead_tilde> <o> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
-<Multi_key> <macron> <asciitilde> <o> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
-<Multi_key> <underscore> <dead_tilde> <o> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
-<Multi_key> <underscore> <asciitilde> <o> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
-<dead_abovedot> <O> : "Ȯ" U022E # LATIN CAPITAL LETTER O WITH DOT ABOVE
-<Multi_key> <period> <O> : "Ȯ" U022E # LATIN CAPITAL LETTER O WITH DOT ABOVE
-<dead_abovedot> <o> : "ȯ" U022F # LATIN SMALL LETTER O WITH DOT ABOVE
-<Multi_key> <period> <o> : "ȯ" U022F # LATIN SMALL LETTER O WITH DOT ABOVE
-<dead_macron> <U022E> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
-<Multi_key> <macron> <U022E> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
-<Multi_key> <underscore> <U022E> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
-<dead_macron> <dead_abovedot> <O> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
-<dead_macron> <Multi_key> <period> <O> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
-<Multi_key> <macron> <dead_abovedot> <O> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
-<Multi_key> <macron> <period> <O> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
-<Multi_key> <underscore> <dead_abovedot> <O> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
-<Multi_key> <underscore> <period> <O> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
-<dead_macron> <U022F> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
-<Multi_key> <macron> <U022F> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
-<Multi_key> <underscore> <U022F> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
-<dead_macron> <dead_abovedot> <o> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
-<dead_macron> <Multi_key> <period> <o> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
-<Multi_key> <macron> <dead_abovedot> <o> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
-<Multi_key> <macron> <period> <o> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
-<Multi_key> <underscore> <dead_abovedot> <o> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
-<Multi_key> <underscore> <period> <o> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
-<dead_macron> <Y> : "Ȳ" U0232 # LATIN CAPITAL LETTER Y WITH MACRON
-<Multi_key> <macron> <Y> : "Ȳ" U0232 # LATIN CAPITAL LETTER Y WITH MACRON
-<Multi_key> <underscore> <Y> : "Ȳ" U0232 # LATIN CAPITAL LETTER Y WITH MACRON
-<dead_macron> <y> : "ȳ" U0233 # LATIN SMALL LETTER Y WITH MACRON
-<Multi_key> <macron> <y> : "ȳ" U0233 # LATIN SMALL LETTER Y WITH MACRON
-<Multi_key> <underscore> <y> : "ȳ" U0233 # LATIN SMALL LETTER Y WITH MACRON
-<Multi_key> <e> <e> : "ə" U0259 # LATIN SMALL LETTER SCHWA
-<dead_stroke> <i> : "ɨ" U0268 # LATIN SMALL LETTER I WITH STROKE
-<Multi_key> <slash> <i> : "ɨ" U0268 # LATIN SMALL LETTER I WITH STROKE
-<Multi_key> <KP_Divide> <i> : "ɨ" U0268 # LATIN SMALL LETTER I WITH STROKE
-<Multi_key> <slash> <U0294> : "ʡ" U02A1 # LATIN LETTER GLOTTAL STOP WITH STROKE
-<Multi_key> <KP_Divide> <U0294> : "ʡ" U02A1 # LATIN LETTER GLOTTAL STOP WITH STROKE
-<dead_circumflex> <Multi_key> <underscore> <h> : "ʰ" U02B0 # MODIFIER LETTER SMALL H
-<Multi_key> <asciicircum> <underscore> <h> : "ʰ" U02B0 # MODIFIER LETTER SMALL H
-<dead_circumflex> <Multi_key> <underbar> <h> : "ʰ" U02B0 # MODIFIER LETTER SMALL H
-<Multi_key> <asciicircum> <underbar> <h> : "ʰ" U02B0 # MODIFIER LETTER SMALL H
-<dead_circumflex> <Multi_key> <underscore> <U0266> : "ʱ" U02B1 # MODIFIER LETTER SMALL H WITH HOOK
-<Multi_key> <asciicircum> <underscore> <U0266> : "ʱ" U02B1 # MODIFIER LETTER SMALL H WITH HOOK
-<dead_circumflex> <Multi_key> <underbar> <U0266> : "ʱ" U02B1 # MODIFIER LETTER SMALL H WITH HOOK
-<Multi_key> <asciicircum> <underbar> <U0266> : "ʱ" U02B1 # MODIFIER LETTER SMALL H WITH HOOK
-<dead_circumflex> <Multi_key> <underscore> <j> : "ʲ" U02B2 # MODIFIER LETTER SMALL J
-<Multi_key> <asciicircum> <underscore> <j> : "ʲ" U02B2 # MODIFIER LETTER SMALL J
-<dead_circumflex> <Multi_key> <underbar> <j> : "ʲ" U02B2 # MODIFIER LETTER SMALL J
-<Multi_key> <asciicircum> <underbar> <j> : "ʲ" U02B2 # MODIFIER LETTER SMALL J
-<dead_circumflex> <Multi_key> <underscore> <r> : "ʳ" U02B3 # MODIFIER LETTER SMALL R
-<Multi_key> <asciicircum> <underscore> <r> : "ʳ" U02B3 # MODIFIER LETTER SMALL R
-<dead_circumflex> <Multi_key> <underbar> <r> : "ʳ" U02B3 # MODIFIER LETTER SMALL R
-<Multi_key> <asciicircum> <underbar> <r> : "ʳ" U02B3 # MODIFIER LETTER SMALL R
-<dead_circumflex> <Multi_key> <underscore> <U0279> : "ʴ" U02B4 # MODIFIER LETTER SMALL TURNED R
-<Multi_key> <asciicircum> <underscore> <U0279> : "ʴ" U02B4 # MODIFIER LETTER SMALL TURNED R
-<dead_circumflex> <Multi_key> <underbar> <U0279> : "ʴ" U02B4 # MODIFIER LETTER SMALL TURNED R
-<Multi_key> <asciicircum> <underbar> <U0279> : "ʴ" U02B4 # MODIFIER LETTER SMALL TURNED R
-<dead_circumflex> <Multi_key> <underscore> <U027B> : "ʵ" U02B5 # MODIFIER LETTER SMALL TURNED R WITH HOOK
-<Multi_key> <asciicircum> <underscore> <U027B> : "ʵ" U02B5 # MODIFIER LETTER SMALL TURNED R WITH HOOK
-<dead_circumflex> <Multi_key> <underbar> <U027B> : "ʵ" U02B5 # MODIFIER LETTER SMALL TURNED R WITH HOOK
-<Multi_key> <asciicircum> <underbar> <U027B> : "ʵ" U02B5 # MODIFIER LETTER SMALL TURNED R WITH HOOK
-<dead_circumflex> <Multi_key> <underscore> <U0281> : "ʶ" U02B6 # MODIFIER LETTER SMALL CAPITAL INVERTED R
-<Multi_key> <asciicircum> <underscore> <U0281> : "ʶ" U02B6 # MODIFIER LETTER SMALL CAPITAL INVERTED R
-<dead_circumflex> <Multi_key> <underbar> <U0281> : "ʶ" U02B6 # MODIFIER LETTER SMALL CAPITAL INVERTED R
-<Multi_key> <asciicircum> <underbar> <U0281> : "ʶ" U02B6 # MODIFIER LETTER SMALL CAPITAL INVERTED R
-<dead_circumflex> <Multi_key> <underscore> <w> : "ʷ" U02B7 # MODIFIER LETTER SMALL W
-<Multi_key> <asciicircum> <underscore> <w> : "ʷ" U02B7 # MODIFIER LETTER SMALL W
-<dead_circumflex> <Multi_key> <underbar> <w> : "ʷ" U02B7 # MODIFIER LETTER SMALL W
-<Multi_key> <asciicircum> <underbar> <w> : "ʷ" U02B7 # MODIFIER LETTER SMALL W
-<dead_circumflex> <Multi_key> <underscore> <y> : "ʸ" U02B8 # MODIFIER LETTER SMALL Y
-<Multi_key> <asciicircum> <underscore> <y> : "ʸ" U02B8 # MODIFIER LETTER SMALL Y
-<dead_circumflex> <Multi_key> <underbar> <y> : "ʸ" U02B8 # MODIFIER LETTER SMALL Y
-<Multi_key> <asciicircum> <underbar> <y> : "ʸ" U02B8 # MODIFIER LETTER SMALL Y
-<dead_circumflex> <Multi_key> <underscore> <U0263> : "ˠ" U02E0 # MODIFIER LETTER SMALL GAMMA
-<Multi_key> <asciicircum> <underscore> <U0263> : "ˠ" U02E0 # MODIFIER LETTER SMALL GAMMA
-<dead_circumflex> <Multi_key> <underbar> <U0263> : "ˠ" U02E0 # MODIFIER LETTER SMALL GAMMA
-<Multi_key> <asciicircum> <underbar> <U0263> : "ˠ" U02E0 # MODIFIER LETTER SMALL GAMMA
-<dead_circumflex> <Multi_key> <underscore> <l> : "ˡ" U02E1 # MODIFIER LETTER SMALL L
-<Multi_key> <asciicircum> <underscore> <l> : "ˡ" U02E1 # MODIFIER LETTER SMALL L
-<dead_circumflex> <Multi_key> <underbar> <l> : "ˡ" U02E1 # MODIFIER LETTER SMALL L
-<Multi_key> <asciicircum> <underbar> <l> : "ˡ" U02E1 # MODIFIER LETTER SMALL L
-<dead_circumflex> <Multi_key> <underscore> <s> : "ˢ" U02E2 # MODIFIER LETTER SMALL S
-<Multi_key> <asciicircum> <underscore> <s> : "ˢ" U02E2 # MODIFIER LETTER SMALL S
-<dead_circumflex> <Multi_key> <underbar> <s> : "ˢ" U02E2 # MODIFIER LETTER SMALL S
-<Multi_key> <asciicircum> <underbar> <s> : "ˢ" U02E2 # MODIFIER LETTER SMALL S
-<dead_circumflex> <Multi_key> <underscore> <x> : "ˣ" U02E3 # MODIFIER LETTER SMALL X
-<Multi_key> <asciicircum> <underscore> <x> : "ˣ" U02E3 # MODIFIER LETTER SMALL X
-<dead_circumflex> <Multi_key> <underbar> <x> : "ˣ" U02E3 # MODIFIER LETTER SMALL X
-<Multi_key> <asciicircum> <underbar> <x> : "ˣ" U02E3 # MODIFIER LETTER SMALL X
-<dead_circumflex> <Multi_key> <underscore> <U0295> : "ˤ" U02E4 # MODIFIER LETTER SMALL REVERSED GLOTTAL STOP
-<Multi_key> <asciicircum> <underscore> <U0295> : "ˤ" U02E4 # MODIFIER LETTER SMALL REVERSED GLOTTAL STOP
-<dead_circumflex> <Multi_key> <underbar> <U0295> : "ˤ" U02E4 # MODIFIER LETTER SMALL REVERSED GLOTTAL STOP
-<Multi_key> <asciicircum> <underbar> <U0295> : "ˤ" U02E4 # MODIFIER LETTER SMALL REVERSED GLOTTAL STOP
-<dead_diaeresis> <acute> : "̈́" U0344 # COMBINING GREEK DIALYTIKA TONOS
-<dead_diaeresis> <apostrophe> : "̈́" U0344 # COMBINING GREEK DIALYTIKA TONOS
-<Multi_key> <quotedbl> <dead_acute> : "̈́" U0344 # COMBINING GREEK DIALYTIKA TONOS
-<Multi_key> <quotedbl> <acute> : "̈́" U0344 # COMBINING GREEK DIALYTIKA TONOS
-<Multi_key> <quotedbl> <apostrophe> : "̈́" U0344 # COMBINING GREEK DIALYTIKA TONOS
-<Multi_key> <diaeresis> <dead_acute> : "΅" U0385 # GREEK DIALYTIKA TONOS
-<Multi_key> <diaeresis> <acute> : "΅" U0385 # GREEK DIALYTIKA TONOS
-<Multi_key> <diaeresis> <apostrophe> : "΅" U0385 # GREEK DIALYTIKA TONOS
-<dead_acute> <Greek_ALPHA> : "Ά" U0386 # GREEK CAPITAL LETTER ALPHA WITH TONOS
-<Multi_key> <acute> <Greek_ALPHA> : "Ά" U0386 # GREEK CAPITAL LETTER ALPHA WITH TONOS
-<Multi_key> <apostrophe> <Greek_ALPHA> : "Ά" U0386 # GREEK CAPITAL LETTER ALPHA WITH TONOS
-<dead_acute> <Greek_EPSILON> : "Έ" U0388 # GREEK CAPITAL LETTER EPSILON WITH TONOS
-<Multi_key> <acute> <Greek_EPSILON> : "Έ" U0388 # GREEK CAPITAL LETTER EPSILON WITH TONOS
-<Multi_key> <apostrophe> <Greek_EPSILON> : "Έ" U0388 # GREEK CAPITAL LETTER EPSILON WITH TONOS
-<dead_acute> <Greek_ETA> : "Ή" U0389 # GREEK CAPITAL LETTER ETA WITH TONOS
-<Multi_key> <acute> <Greek_ETA> : "Ή" U0389 # GREEK CAPITAL LETTER ETA WITH TONOS
-<Multi_key> <apostrophe> <Greek_ETA> : "Ή" U0389 # GREEK CAPITAL LETTER ETA WITH TONOS
-<dead_acute> <Greek_IOTA> : "Ί" U038A # GREEK CAPITAL LETTER IOTA WITH TONOS
-<Multi_key> <acute> <Greek_IOTA> : "Ί" U038A # GREEK CAPITAL LETTER IOTA WITH TONOS
-<Multi_key> <apostrophe> <Greek_IOTA> : "Ί" U038A # GREEK CAPITAL LETTER IOTA WITH TONOS
-<dead_acute> <Greek_OMICRON> : "Ό" U038C # GREEK CAPITAL LETTER OMICRON WITH TONOS
-<Multi_key> <acute> <Greek_OMICRON> : "Ό" U038C # GREEK CAPITAL LETTER OMICRON WITH TONOS
-<Multi_key> <apostrophe> <Greek_OMICRON> : "Ό" U038C # GREEK CAPITAL LETTER OMICRON WITH TONOS
-<dead_acute> <Greek_UPSILON> : "Ύ" U038E # GREEK CAPITAL LETTER UPSILON WITH TONOS
-<Multi_key> <acute> <Greek_UPSILON> : "Ύ" U038E # GREEK CAPITAL LETTER UPSILON WITH TONOS
-<Multi_key> <apostrophe> <Greek_UPSILON> : "Ύ" U038E # GREEK CAPITAL LETTER UPSILON WITH TONOS
-<dead_acute> <Greek_OMEGA> : "Ώ" U038F # GREEK CAPITAL LETTER OMEGA WITH TONOS
-<Multi_key> <acute> <Greek_OMEGA> : "Ώ" U038F # GREEK CAPITAL LETTER OMEGA WITH TONOS
-<Multi_key> <apostrophe> <Greek_OMEGA> : "Ώ" U038F # GREEK CAPITAL LETTER OMEGA WITH TONOS
-<dead_acute> <Greek_iotadieresis> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
-<Multi_key> <acute> <Greek_iotadieresis> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
-<Multi_key> <apostrophe> <Greek_iotadieresis> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
-<dead_acute> <dead_diaeresis> <Greek_iota> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
-<dead_acute> <Multi_key> <quotedbl> <Greek_iota> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
-<Multi_key> <acute> <dead_diaeresis> <Greek_iota> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
-<Multi_key> <acute> <quotedbl> <Greek_iota> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
-<Multi_key> <apostrophe> <dead_diaeresis> <Greek_iota> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
-<Multi_key> <apostrophe> <quotedbl> <Greek_iota> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
-<dead_diaeresis> <Greek_IOTA> : "Ϊ" U03AA # GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
-<Multi_key> <quotedbl> <Greek_IOTA> : "Ϊ" U03AA # GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
-<dead_diaeresis> <Greek_UPSILON> : "Ϋ" U03AB # GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
-<Multi_key> <quotedbl> <Greek_UPSILON> : "Ϋ" U03AB # GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
-<dead_acute> <Greek_alpha> : "ά" U03AC # GREEK SMALL LETTER ALPHA WITH TONOS
-<Multi_key> <acute> <Greek_alpha> : "ά" U03AC # GREEK SMALL LETTER ALPHA WITH TONOS
-<Multi_key> <apostrophe> <Greek_alpha> : "ά" U03AC # GREEK SMALL LETTER ALPHA WITH TONOS
-<dead_acute> <Greek_epsilon> : "έ" U03AD # GREEK SMALL LETTER EPSILON WITH TONOS
-<Multi_key> <acute> <Greek_epsilon> : "έ" U03AD # GREEK SMALL LETTER EPSILON WITH TONOS
-<Multi_key> <apostrophe> <Greek_epsilon> : "έ" U03AD # GREEK SMALL LETTER EPSILON WITH TONOS
-<dead_acute> <Greek_eta> : "ή" U03AE # GREEK SMALL LETTER ETA WITH TONOS
-<Multi_key> <acute> <Greek_eta> : "ή" U03AE # GREEK SMALL LETTER ETA WITH TONOS
-<Multi_key> <apostrophe> <Greek_eta> : "ή" U03AE # GREEK SMALL LETTER ETA WITH TONOS
-<dead_acute> <Greek_iota> : "ί" U03AF # GREEK SMALL LETTER IOTA WITH TONOS
-<Multi_key> <acute> <Greek_iota> : "ί" U03AF # GREEK SMALL LETTER IOTA WITH TONOS
-<Multi_key> <apostrophe> <Greek_iota> : "ί" U03AF # GREEK SMALL LETTER IOTA WITH TONOS
-<dead_acute> <Greek_upsilondieresis> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
-<Multi_key> <acute> <Greek_upsilondieresis> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
-<Multi_key> <apostrophe> <Greek_upsilondieresis> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
-<dead_acute> <dead_diaeresis> <Greek_upsilon> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
-<dead_acute> <Multi_key> <quotedbl> <Greek_upsilon> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
-<Multi_key> <acute> <dead_diaeresis> <Greek_upsilon> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
-<Multi_key> <acute> <quotedbl> <Greek_upsilon> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
-<Multi_key> <apostrophe> <dead_diaeresis> <Greek_upsilon> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
-<Multi_key> <apostrophe> <quotedbl> <Greek_upsilon> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
-<dead_diaeresis> <Greek_iota> : "ϊ" U03CA # GREEK SMALL LETTER IOTA WITH DIALYTIKA
-<Multi_key> <quotedbl> <Greek_iota> : "ϊ" U03CA # GREEK SMALL LETTER IOTA WITH DIALYTIKA
-<dead_diaeresis> <Greek_upsilon> : "ϋ" U03CB # GREEK SMALL LETTER UPSILON WITH DIALYTIKA
-<Multi_key> <quotedbl> <Greek_upsilon> : "ϋ" U03CB # GREEK SMALL LETTER UPSILON WITH DIALYTIKA
-<dead_acute> <Greek_omicron> : "ό" U03CC # GREEK SMALL LETTER OMICRON WITH TONOS
-<Multi_key> <acute> <Greek_omicron> : "ό" U03CC # GREEK SMALL LETTER OMICRON WITH TONOS
-<Multi_key> <apostrophe> <Greek_omicron> : "ό" U03CC # GREEK SMALL LETTER OMICRON WITH TONOS
-<dead_acute> <Greek_upsilon> : "ύ" U03CD # GREEK SMALL LETTER UPSILON WITH TONOS
-<Multi_key> <acute> <Greek_upsilon> : "ύ" U03CD # GREEK SMALL LETTER UPSILON WITH TONOS
-<Multi_key> <apostrophe> <Greek_upsilon> : "ύ" U03CD # GREEK SMALL LETTER UPSILON WITH TONOS
-<dead_acute> <Greek_omega> : "ώ" U03CE # GREEK SMALL LETTER OMEGA WITH TONOS
-<Multi_key> <acute> <Greek_omega> : "ώ" U03CE # GREEK SMALL LETTER OMEGA WITH TONOS
-<Multi_key> <apostrophe> <Greek_omega> : "ώ" U03CE # GREEK SMALL LETTER OMEGA WITH TONOS
-<Multi_key> <quotedbl> <U03D2> : "ϔ" U03D4 # GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL
-<dead_grave> <Cyrillic_IE> : "Ѐ" U0400 # CYRILLIC CAPITAL LETTER IE WITH GRAVE
-<Multi_key> <grave> <Cyrillic_IE> : "Ѐ" U0400 # CYRILLIC CAPITAL LETTER IE WITH GRAVE
-<dead_diaeresis> <Cyrillic_IE> : "Ё" U0401 # CYRILLIC CAPITAL LETTER IO
-<Multi_key> <quotedbl> <Cyrillic_IE> : "Ё" U0401 # CYRILLIC CAPITAL LETTER IO
-<dead_acute> <Cyrillic_GHE> : "Ѓ" U0403 # CYRILLIC CAPITAL LETTER GJE
-<Multi_key> <acute> <Cyrillic_GHE> : "Ѓ" U0403 # CYRILLIC CAPITAL LETTER GJE
-<Multi_key> <apostrophe> <Cyrillic_GHE> : "Ѓ" U0403 # CYRILLIC CAPITAL LETTER GJE
-<dead_diaeresis> <Ukrainian_I> : "Ї" U0407 # CYRILLIC CAPITAL LETTER YI
-<Multi_key> <quotedbl> <Ukrainian_I> : "Ї" U0407 # CYRILLIC CAPITAL LETTER YI
-<dead_acute> <Cyrillic_KA> : "Ќ" U040C # CYRILLIC CAPITAL LETTER KJE
-<Multi_key> <acute> <Cyrillic_KA> : "Ќ" U040C # CYRILLIC CAPITAL LETTER KJE
-<Multi_key> <apostrophe> <Cyrillic_KA> : "Ќ" U040C # CYRILLIC CAPITAL LETTER KJE
-<dead_grave> <Cyrillic_I> : "Ѝ" U040D # CYRILLIC CAPITAL LETTER I WITH GRAVE
-<Multi_key> <grave> <Cyrillic_I> : "Ѝ" U040D # CYRILLIC CAPITAL LETTER I WITH GRAVE
-<dead_breve> <Cyrillic_U> : "Ў" U040E # CYRILLIC CAPITAL LETTER SHORT U
-<Multi_key> <U> <Cyrillic_U> : "Ў" U040E # CYRILLIC CAPITAL LETTER SHORT U
-<Multi_key> <b> <Cyrillic_U> : "Ў" U040E # CYRILLIC CAPITAL LETTER SHORT U
-<dead_breve> <Cyrillic_I> : "Й" U0419 # CYRILLIC CAPITAL LETTER SHORT I
-<Multi_key> <U> <Cyrillic_I> : "Й" U0419 # CYRILLIC CAPITAL LETTER SHORT I
-<Multi_key> <b> <Cyrillic_I> : "Й" U0419 # CYRILLIC CAPITAL LETTER SHORT I
-<dead_breve> <Cyrillic_i> : "й" U0439 # CYRILLIC SMALL LETTER SHORT I
-<Multi_key> <U> <Cyrillic_i> : "й" U0439 # CYRILLIC SMALL LETTER SHORT I
-<Multi_key> <b> <Cyrillic_i> : "й" U0439 # CYRILLIC SMALL LETTER SHORT I
-<dead_grave> <Cyrillic_ie> : "ѐ" U0450 # CYRILLIC SMALL LETTER IE WITH GRAVE
-<Multi_key> <grave> <Cyrillic_ie> : "ѐ" U0450 # CYRILLIC SMALL LETTER IE WITH GRAVE
-<dead_diaeresis> <Cyrillic_ie> : "ё" U0451 # CYRILLIC SMALL LETTER IO
-<Multi_key> <quotedbl> <Cyrillic_ie> : "ё" U0451 # CYRILLIC SMALL LETTER IO
-<dead_acute> <Cyrillic_ghe> : "ѓ" U0453 # CYRILLIC SMALL LETTER GJE
-<Multi_key> <acute> <Cyrillic_ghe> : "ѓ" U0453 # CYRILLIC SMALL LETTER GJE
-<Multi_key> <apostrophe> <Cyrillic_ghe> : "ѓ" U0453 # CYRILLIC SMALL LETTER GJE
-<dead_diaeresis> <Ukrainian_i> : "ї" U0457 # CYRILLIC SMALL LETTER YI
-<Multi_key> <quotedbl> <Ukrainian_i> : "ї" U0457 # CYRILLIC SMALL LETTER YI
-<dead_acute> <Cyrillic_ka> : "ќ" U045C # CYRILLIC SMALL LETTER KJE
-<Multi_key> <acute> <Cyrillic_ka> : "ќ" U045C # CYRILLIC SMALL LETTER KJE
-<Multi_key> <apostrophe> <Cyrillic_ka> : "ќ" U045C # CYRILLIC SMALL LETTER KJE
-<dead_grave> <Cyrillic_i> : "ѝ" U045D # CYRILLIC SMALL LETTER I WITH GRAVE
-<Multi_key> <grave> <Cyrillic_i> : "ѝ" U045D # CYRILLIC SMALL LETTER I WITH GRAVE
-<dead_breve> <Cyrillic_u> : "ў" U045E # CYRILLIC SMALL LETTER SHORT U
-<Multi_key> <U> <Cyrillic_u> : "ў" U045E # CYRILLIC SMALL LETTER SHORT U
-<Multi_key> <b> <Cyrillic_u> : "ў" U045E # CYRILLIC SMALL LETTER SHORT U
-<dead_double_grave> <U0474> : "Ѷ" U0476 # CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT
-<dead_double_grave> <U0475> : "ѷ" U0477 # CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT
-<Multi_key> <slash> <Cyrillic_GHE> : "Ғ" U0492 # CYRILLIC CAPITAL LETTER GHE WITH STROKE
-<Multi_key> <KP_Divide> <Cyrillic_GHE> : "Ғ" U0492 # CYRILLIC CAPITAL LETTER GHE WITH STROKE
-<Multi_key> <slash> <Cyrillic_ghe> : "ғ" U0493 # CYRILLIC SMALL LETTER GHE WITH STROKE
-<Multi_key> <KP_Divide> <Cyrillic_ghe> : "ғ" U0493 # CYRILLIC SMALL LETTER GHE WITH STROKE
-<Multi_key> <slash> <Cyrillic_KA> : "Ҟ" U049E # CYRILLIC CAPITAL LETTER KA WITH STROKE
-<Multi_key> <KP_Divide> <Cyrillic_KA> : "Ҟ" U049E # CYRILLIC CAPITAL LETTER KA WITH STROKE
-<Multi_key> <slash> <Cyrillic_ka> : "ҟ" U049F # CYRILLIC SMALL LETTER KA WITH STROKE
-<Multi_key> <KP_Divide> <Cyrillic_ka> : "ҟ" U049F # CYRILLIC SMALL LETTER KA WITH STROKE
-<Multi_key> <slash> <U04AE> : "Ұ" U04B0 # CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE
-<Multi_key> <KP_Divide> <U04AE> : "Ұ" U04B0 # CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE
-<Multi_key> <slash> <U04AF> : "ұ" U04B1 # CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE
-<Multi_key> <KP_Divide> <U04AF> : "ұ" U04B1 # CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE
-<dead_breve> <Cyrillic_ZHE> : "Ӂ" U04C1 # CYRILLIC CAPITAL LETTER ZHE WITH BREVE
-<Multi_key> <U> <Cyrillic_ZHE> : "Ӂ" U04C1 # CYRILLIC CAPITAL LETTER ZHE WITH BREVE
-<Multi_key> <b> <Cyrillic_ZHE> : "Ӂ" U04C1 # CYRILLIC CAPITAL LETTER ZHE WITH BREVE
-<dead_breve> <Cyrillic_zhe> : "ӂ" U04C2 # CYRILLIC SMALL LETTER ZHE WITH BREVE
-<Multi_key> <U> <Cyrillic_zhe> : "ӂ" U04C2 # CYRILLIC SMALL LETTER ZHE WITH BREVE
-<Multi_key> <b> <Cyrillic_zhe> : "ӂ" U04C2 # CYRILLIC SMALL LETTER ZHE WITH BREVE
-<dead_breve> <Cyrillic_A> : "Ӑ" U04D0 # CYRILLIC CAPITAL LETTER A WITH BREVE
-<Multi_key> <U> <Cyrillic_A> : "Ӑ" U04D0 # CYRILLIC CAPITAL LETTER A WITH BREVE
-<Multi_key> <b> <Cyrillic_A> : "Ӑ" U04D0 # CYRILLIC CAPITAL LETTER A WITH BREVE
-<dead_breve> <Cyrillic_a> : "ӑ" U04D1 # CYRILLIC SMALL LETTER A WITH BREVE
-<Multi_key> <U> <Cyrillic_a> : "ӑ" U04D1 # CYRILLIC SMALL LETTER A WITH BREVE
-<Multi_key> <b> <Cyrillic_a> : "ӑ" U04D1 # CYRILLIC SMALL LETTER A WITH BREVE
-<dead_diaeresis> <Cyrillic_A> : "Ӓ" U04D2 # CYRILLIC CAPITAL LETTER A WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_A> : "Ӓ" U04D2 # CYRILLIC CAPITAL LETTER A WITH DIAERESIS
-<dead_diaeresis> <Cyrillic_a> : "ӓ" U04D3 # CYRILLIC SMALL LETTER A WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_a> : "ӓ" U04D3 # CYRILLIC SMALL LETTER A WITH DIAERESIS
-<dead_breve> <Cyrillic_IE> : "Ӗ" U04D6 # CYRILLIC CAPITAL LETTER IE WITH BREVE
-<Multi_key> <U> <Cyrillic_IE> : "Ӗ" U04D6 # CYRILLIC CAPITAL LETTER IE WITH BREVE
-<Multi_key> <b> <Cyrillic_IE> : "Ӗ" U04D6 # CYRILLIC CAPITAL LETTER IE WITH BREVE
-<dead_breve> <Cyrillic_ie> : "ӗ" U04D7 # CYRILLIC SMALL LETTER IE WITH BREVE
-<Multi_key> <U> <Cyrillic_ie> : "ӗ" U04D7 # CYRILLIC SMALL LETTER IE WITH BREVE
-<Multi_key> <b> <Cyrillic_ie> : "ӗ" U04D7 # CYRILLIC SMALL LETTER IE WITH BREVE
-<dead_diaeresis> <U04D8> : "Ӛ" U04DA # CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS
-<Multi_key> <quotedbl> <U04D8> : "Ӛ" U04DA # CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS
-<dead_diaeresis> <U04D9> : "ӛ" U04DB # CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS
-<Multi_key> <quotedbl> <U04D9> : "ӛ" U04DB # CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS
-<dead_diaeresis> <Cyrillic_ZHE> : "Ӝ" U04DC # CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_ZHE> : "Ӝ" U04DC # CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS
-<dead_diaeresis> <Cyrillic_zhe> : "ӝ" U04DD # CYRILLIC SMALL LETTER ZHE WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_zhe> : "ӝ" U04DD # CYRILLIC SMALL LETTER ZHE WITH DIAERESIS
-<dead_diaeresis> <Cyrillic_ZE> : "Ӟ" U04DE # CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_ZE> : "Ӟ" U04DE # CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS
-<dead_diaeresis> <Cyrillic_ze> : "ӟ" U04DF # CYRILLIC SMALL LETTER ZE WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_ze> : "ӟ" U04DF # CYRILLIC SMALL LETTER ZE WITH DIAERESIS
-<dead_macron> <Cyrillic_I> : "Ӣ" U04E2 # CYRILLIC CAPITAL LETTER I WITH MACRON
-<Multi_key> <macron> <Cyrillic_I> : "Ӣ" U04E2 # CYRILLIC CAPITAL LETTER I WITH MACRON
-<Multi_key> <underscore> <Cyrillic_I> : "Ӣ" U04E2 # CYRILLIC CAPITAL LETTER I WITH MACRON
-<dead_macron> <Cyrillic_i> : "ӣ" U04E3 # CYRILLIC SMALL LETTER I WITH MACRON
-<Multi_key> <macron> <Cyrillic_i> : "ӣ" U04E3 # CYRILLIC SMALL LETTER I WITH MACRON
-<Multi_key> <underscore> <Cyrillic_i> : "ӣ" U04E3 # CYRILLIC SMALL LETTER I WITH MACRON
-<dead_diaeresis> <Cyrillic_I> : "Ӥ" U04E4 # CYRILLIC CAPITAL LETTER I WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_I> : "Ӥ" U04E4 # CYRILLIC CAPITAL LETTER I WITH DIAERESIS
-<dead_diaeresis> <Cyrillic_i> : "ӥ" U04E5 # CYRILLIC SMALL LETTER I WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_i> : "ӥ" U04E5 # CYRILLIC SMALL LETTER I WITH DIAERESIS
-<dead_diaeresis> <Cyrillic_O> : "Ӧ" U04E6 # CYRILLIC CAPITAL LETTER O WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_O> : "Ӧ" U04E6 # CYRILLIC CAPITAL LETTER O WITH DIAERESIS
-<dead_diaeresis> <Cyrillic_o> : "ӧ" U04E7 # CYRILLIC SMALL LETTER O WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_o> : "ӧ" U04E7 # CYRILLIC SMALL LETTER O WITH DIAERESIS
-<dead_diaeresis> <U04E8> : "Ӫ" U04EA # CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS
-<Multi_key> <quotedbl> <U04E8> : "Ӫ" U04EA # CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS
-<dead_diaeresis> <U04E9> : "ӫ" U04EB # CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS
-<Multi_key> <quotedbl> <U04E9> : "ӫ" U04EB # CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS
-<dead_diaeresis> <Cyrillic_E> : "Ӭ" U04EC # CYRILLIC CAPITAL LETTER E WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_E> : "Ӭ" U04EC # CYRILLIC CAPITAL LETTER E WITH DIAERESIS
-<dead_diaeresis> <Cyrillic_e> : "ӭ" U04ED # CYRILLIC SMALL LETTER E WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_e> : "ӭ" U04ED # CYRILLIC SMALL LETTER E WITH DIAERESIS
-<dead_macron> <Cyrillic_U> : "Ӯ" U04EE # CYRILLIC CAPITAL LETTER U WITH MACRON
-<Multi_key> <macron> <Cyrillic_U> : "Ӯ" U04EE # CYRILLIC CAPITAL LETTER U WITH MACRON
-<Multi_key> <underscore> <Cyrillic_U> : "Ӯ" U04EE # CYRILLIC CAPITAL LETTER U WITH MACRON
-<dead_macron> <Cyrillic_u> : "ӯ" U04EF # CYRILLIC SMALL LETTER U WITH MACRON
-<Multi_key> <macron> <Cyrillic_u> : "ӯ" U04EF # CYRILLIC SMALL LETTER U WITH MACRON
-<Multi_key> <underscore> <Cyrillic_u> : "ӯ" U04EF # CYRILLIC SMALL LETTER U WITH MACRON
-<dead_diaeresis> <Cyrillic_U> : "Ӱ" U04F0 # CYRILLIC CAPITAL LETTER U WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_U> : "Ӱ" U04F0 # CYRILLIC CAPITAL LETTER U WITH DIAERESIS
-<dead_diaeresis> <Cyrillic_u> : "ӱ" U04F1 # CYRILLIC SMALL LETTER U WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_u> : "ӱ" U04F1 # CYRILLIC SMALL LETTER U WITH DIAERESIS
-<dead_doubleacute> <Cyrillic_U> : "Ӳ" U04F2 # CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE
-<Multi_key> <equal> <Cyrillic_U> : "Ӳ" U04F2 # CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE
-<dead_doubleacute> <Cyrillic_u> : "ӳ" U04F3 # CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE
-<Multi_key> <equal> <Cyrillic_u> : "ӳ" U04F3 # CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE
-<dead_diaeresis> <Cyrillic_CHE> : "Ӵ" U04F4 # CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_CHE> : "Ӵ" U04F4 # CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS
-<dead_diaeresis> <Cyrillic_che> : "ӵ" U04F5 # CYRILLIC SMALL LETTER CHE WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_che> : "ӵ" U04F5 # CYRILLIC SMALL LETTER CHE WITH DIAERESIS
-<dead_diaeresis> <Cyrillic_YERU> : "Ӹ" U04F8 # CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_YERU> : "Ӹ" U04F8 # CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS
-<dead_diaeresis> <Cyrillic_yeru> : "ӹ" U04F9 # CYRILLIC SMALL LETTER YERU WITH DIAERESIS
-<Multi_key> <quotedbl> <Cyrillic_yeru> : "ӹ" U04F9 # CYRILLIC SMALL LETTER YERU WITH DIAERESIS
-<Multi_key> <U0653> <Arabic_alef> : "آ" U0622 # ARABIC LETTER ALEF WITH MADDA ABOVE
-<Multi_key> <U0654> <Arabic_alef> : "أ" U0623 # ARABIC LETTER ALEF WITH HAMZA ABOVE
-<Multi_key> <U0654> <Arabic_waw> : "ؤ" U0624 # ARABIC LETTER WAW WITH HAMZA ABOVE
-<Multi_key> <U0655> <Arabic_alef> : "إ" U0625 # ARABIC LETTER ALEF WITH HAMZA BELOW
-<Multi_key> <U0654> <Arabic_yeh> : "ئ" U0626 # ARABIC LETTER YEH WITH HAMZA ABOVE
-<Multi_key> <U0654> <U06D5> : "ۀ" U06C0 # ARABIC LETTER HEH WITH YEH ABOVE
-<Multi_key> <U0654> <U06C1> : "ۂ" U06C2 # ARABIC LETTER HEH GOAL WITH HAMZA ABOVE
-<Multi_key> <U0654> <U06D2> : "ۓ" U06D3 # ARABIC LETTER YEH BARREE WITH HAMZA ABOVE
-<Multi_key> <U093C> <U0928> : "ऩ" U0929 # DEVANAGARI LETTER NNNA
-<Multi_key> <U093C> <U0930> : "ऱ" U0931 # DEVANAGARI LETTER RRA
-<Multi_key> <U093C> <U0933> : "ऴ" U0934 # DEVANAGARI LETTER LLLA
-<Multi_key> <U093C> <U0915> : "क़" U0958 # DEVANAGARI LETTER QA
-<Multi_key> <U093C> <U0916> : "ख़" U0959 # DEVANAGARI LETTER KHHA
-<Multi_key> <U093C> <U0917> : "ग़" U095A # DEVANAGARI LETTER GHHA
-<Multi_key> <U093C> <U091C> : "ज़" U095B # DEVANAGARI LETTER ZA
-<Multi_key> <U093C> <U0921> : "ड़" U095C # DEVANAGARI LETTER DDDHA
-<Multi_key> <U093C> <U0922> : "ढ़" U095D # DEVANAGARI LETTER RHA
-<Multi_key> <U093C> <U092B> : "फ़" U095E # DEVANAGARI LETTER FA
-<Multi_key> <U093C> <U092F> : "य़" U095F # DEVANAGARI LETTER YYA
-<Multi_key> <U09C7> <U09BE> : "ো" U09CB # BENGALI VOWEL SIGN O
-<Multi_key> <U09C7> <U09D7> : "ৌ" U09CC # BENGALI VOWEL SIGN AU
-<Multi_key> <U09BC> <U09A1> : "ড়" U09DC # BENGALI LETTER RRA
-<Multi_key> <U09BC> <U09A2> : "ঢ়" U09DD # BENGALI LETTER RHA
-<Multi_key> <U09BC> <U09AF> : "য়" U09DF # BENGALI LETTER YYA
-<Multi_key> <U0A3C> <U0A32> : "ਲ਼" U0A33 # GURMUKHI LETTER LLA
-<Multi_key> <U0A3C> <U0A38> : "ਸ਼" U0A36 # GURMUKHI LETTER SHA
-<Multi_key> <U0A3C> <U0A16> : "ਖ਼" U0A59 # GURMUKHI LETTER KHHA
-<Multi_key> <U0A3C> <U0A17> : "ਗ਼" U0A5A # GURMUKHI LETTER GHHA
-<Multi_key> <U0A3C> <U0A1C> : "ਜ਼" U0A5B # GURMUKHI LETTER ZA
-<Multi_key> <U0A3C> <U0A2B> : "ਫ਼" U0A5E # GURMUKHI LETTER FA
-<Multi_key> <U0B47> <U0B56> : "ୈ" U0B48 # ORIYA VOWEL SIGN AI
-<Multi_key> <U0B47> <U0B3E> : "ୋ" U0B4B # ORIYA VOWEL SIGN O
-<Multi_key> <U0B47> <U0B57> : "ୌ" U0B4C # ORIYA VOWEL SIGN AU
-<Multi_key> <U0B3C> <U0B21> : "ଡ଼" U0B5C # ORIYA LETTER RRA
-<Multi_key> <U0B3C> <U0B22> : "ଢ଼" U0B5D # ORIYA LETTER RHA
-<Multi_key> <U0BD7> <U0B92> : "ஔ" U0B94 # TAMIL LETTER AU
-<Multi_key> <U0BC6> <U0BBE> : "ொ" U0BCA # TAMIL VOWEL SIGN O
-<Multi_key> <U0BC7> <U0BBE> : "ோ" U0BCB # TAMIL VOWEL SIGN OO
-<Multi_key> <U0BC6> <U0BD7> : "ௌ" U0BCC # TAMIL VOWEL SIGN AU
-<Multi_key> <U0C46> <U0C56> : "ై" U0C48 # TELUGU VOWEL SIGN AI
-<Multi_key> <U0CBF> <U0CD5> : "ೀ" U0CC0 # KANNADA VOWEL SIGN II
-<Multi_key> <U0CC6> <U0CD5> : "ೇ" U0CC7 # KANNADA VOWEL SIGN EE
-<Multi_key> <U0CC6> <U0CD6> : "ೈ" U0CC8 # KANNADA VOWEL SIGN AI
-<Multi_key> <U0CC6> <U0CC2> : "ೊ" U0CCA # KANNADA VOWEL SIGN O
-<Multi_key> <U0CCA> <U0CD5> : "ೋ" U0CCB # KANNADA VOWEL SIGN OO
-/* <Multi_key> <U0CC6> <U0CC2> <U0CD5> : "ೋ" U0CCB # KANNADA VOWEL SIGN OO */
-<Multi_key> <U0D46> <U0D3E> : "ൊ" U0D4A # MALAYALAM VOWEL SIGN O
-<Multi_key> <U0D47> <U0D3E> : "ോ" U0D4B # MALAYALAM VOWEL SIGN OO
-<Multi_key> <U0D46> <U0D57> : "ൌ" U0D4C # MALAYALAM VOWEL SIGN AU
-<Multi_key> <U0DD9> <U0DCA> : "ේ" U0DDA # SINHALA VOWEL SIGN DIGA KOMBUVA
-<Multi_key> <U0DD9> <U0DCF> : "ො" U0DDC # SINHALA VOWEL SIGN KOMBUVA HAA AELA-PILLA
-<Multi_key> <U0DDC> <U0DCA> : "ෝ" U0DDD # SINHALA VOWEL SIGN KOMBUVA HAA DIGA AELA-PILLA
-/* <Multi_key> <U0DD9> <U0DCF> <U0DCA> : "ෝ" U0DDD # SINHALA VOWEL SIGN KOMBUVA HAA DIGA AELA-PILLA */
-<Multi_key> <U0DD9> <U0DDF> : "ෞ" U0DDE # SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA
-<Multi_key> <U0FB7> <U0F42> : "གྷ" U0F43 # TIBETAN LETTER GHA
-<Multi_key> <U0FB7> <U0F4C> : "ཌྷ" U0F4D # TIBETAN LETTER DDHA
-<Multi_key> <U0FB7> <U0F51> : "དྷ" U0F52 # TIBETAN LETTER DHA
-<Multi_key> <U0FB7> <U0F56> : "བྷ" U0F57 # TIBETAN LETTER BHA
-<Multi_key> <U0FB7> <U0F5B> : "ཛྷ" U0F5C # TIBETAN LETTER DZHA
-<Multi_key> <U0FB5> <U0F40> : "ཀྵ" U0F69 # TIBETAN LETTER KSSA
-<Multi_key> <U0F71> <U0F72> : "ཱི" U0F73 # TIBETAN VOWEL SIGN II
-<Multi_key> <U0F71> <U0F74> : "ཱུ" U0F75 # TIBETAN VOWEL SIGN UU
-<Multi_key> <U0FB2> <U0F80> : "ྲྀ" U0F76 # TIBETAN VOWEL SIGN VOCALIC R
-<Multi_key> <U0FB3> <U0F80> : "ླྀ" U0F78 # TIBETAN VOWEL SIGN VOCALIC L
-<Multi_key> <U0F71> <U0F80> : "ཱྀ" U0F81 # TIBETAN VOWEL SIGN REVERSED II
-<Multi_key> <U0F92> <U0FB7> : "ྒྷ" U0F93 # TIBETAN SUBJOINED LETTER GHA
-<Multi_key> <U0F9C> <U0FB7> : "ྜྷ" U0F9D # TIBETAN SUBJOINED LETTER DDHA
-<Multi_key> <U0FA1> <U0FB7> : "ྡྷ" U0FA2 # TIBETAN SUBJOINED LETTER DHA
-<Multi_key> <U0FA6> <U0FB7> : "ྦྷ" U0FA7 # TIBETAN SUBJOINED LETTER BHA
-<Multi_key> <U0FAB> <U0FB7> : "ྫྷ" U0FAC # TIBETAN SUBJOINED LETTER DZHA
-<Multi_key> <U0F90> <U0FB5> : "ྐྵ" U0FB9 # TIBETAN SUBJOINED LETTER KSSA
-<Multi_key> <U102E> <U1025> : "ဦ" U1026 # MYANMAR LETTER UU
-<dead_belowring> <A> : "Ḁ" U1E00 # LATIN CAPITAL LETTER A WITH RING BELOW
-<dead_belowring> <a> : "ḁ" U1E01 # LATIN SMALL LETTER A WITH RING BELOW
-<dead_abovedot> <B> : "Ḃ" U1E02 # LATIN CAPITAL LETTER B WITH DOT ABOVE
-<Multi_key> <period> <B> : "Ḃ" U1E02 # LATIN CAPITAL LETTER B WITH DOT ABOVE
-<dead_abovedot> <b> : "ḃ" U1E03 # LATIN SMALL LETTER B WITH DOT ABOVE
-<Multi_key> <period> <b> : "ḃ" U1E03 # LATIN SMALL LETTER B WITH DOT ABOVE
-<dead_belowdot> <B> : "Ḅ" U1E04 # LATIN CAPITAL LETTER B WITH DOT BELOW
-<Multi_key> <exclam> <B> : "Ḅ" U1E04 # LATIN CAPITAL LETTER B WITH DOT BELOW
-<dead_belowdot> <b> : "ḅ" U1E05 # LATIN SMALL LETTER B WITH DOT BELOW
-<Multi_key> <exclam> <b> : "ḅ" U1E05 # LATIN SMALL LETTER B WITH DOT BELOW
-<dead_belowmacron> <B> : "Ḇ" U1E06 # LATIN CAPITAL LETTER B WITH LINE BELOW
-<dead_belowmacron> <b> : "ḇ" U1E07 # LATIN SMALL LETTER B WITH LINE BELOW
-<dead_acute> <Ccedilla> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
-<Multi_key> <acute> <Ccedilla> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
-<Multi_key> <apostrophe> <Ccedilla> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
-<dead_acute> <dead_cedilla> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
-<dead_acute> <Multi_key> <comma> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
-<dead_acute> <Multi_key> <cedilla> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
-<Multi_key> <acute> <dead_cedilla> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
-<Multi_key> <acute> <comma> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
-<Multi_key> <acute> <cedilla> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
-<Multi_key> <apostrophe> <dead_cedilla> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
-<Multi_key> <apostrophe> <cedilla> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
-<dead_acute> <ccedilla> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
-<Multi_key> <acute> <ccedilla> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
-<Multi_key> <apostrophe> <ccedilla> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
-<dead_acute> <dead_cedilla> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
-<dead_acute> <Multi_key> <comma> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
-<dead_acute> <Multi_key> <cedilla> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
-<Multi_key> <acute> <dead_cedilla> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
-<Multi_key> <acute> <comma> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
-<Multi_key> <acute> <cedilla> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
-<Multi_key> <apostrophe> <dead_cedilla> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
-<Multi_key> <apostrophe> <cedilla> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
-<dead_abovedot> <D> : "Ḋ" U1E0A # LATIN CAPITAL LETTER D WITH DOT ABOVE
-<Multi_key> <period> <D> : "Ḋ" U1E0A # LATIN CAPITAL LETTER D WITH DOT ABOVE
-<dead_abovedot> <d> : "ḋ" U1E0B # LATIN SMALL LETTER D WITH DOT ABOVE
-<Multi_key> <period> <d> : "ḋ" U1E0B # LATIN SMALL LETTER D WITH DOT ABOVE
-<dead_belowdot> <D> : "Ḍ" U1E0C # LATIN CAPITAL LETTER D WITH DOT BELOW
-<Multi_key> <exclam> <D> : "Ḍ" U1E0C # LATIN CAPITAL LETTER D WITH DOT BELOW
-<dead_belowdot> <d> : "ḍ" U1E0D # LATIN SMALL LETTER D WITH DOT BELOW
-<Multi_key> <exclam> <d> : "ḍ" U1E0D # LATIN SMALL LETTER D WITH DOT BELOW
-<dead_belowmacron> <D> : "Ḏ" U1E0E # LATIN CAPITAL LETTER D WITH LINE BELOW
-<dead_belowmacron> <d> : "ḏ" U1E0F # LATIN SMALL LETTER D WITH LINE BELOW
-<dead_cedilla> <D> : "Ḑ" U1E10 # LATIN CAPITAL LETTER D WITH CEDILLA
-<Multi_key> <comma> <D> : "Ḑ" U1E10 # LATIN CAPITAL LETTER D WITH CEDILLA
-<Multi_key> <cedilla> <D> : "Ḑ" U1E10 # LATIN CAPITAL LETTER D WITH CEDILLA
-<dead_cedilla> <d> : "ḑ" U1E11 # LATIN SMALL LETTER D WITH CEDILLA
-<Multi_key> <comma> <d> : "ḑ" U1E11 # LATIN SMALL LETTER D WITH CEDILLA
-<Multi_key> <cedilla> <d> : "ḑ" U1E11 # LATIN SMALL LETTER D WITH CEDILLA
-<dead_belowcircumflex> <D> : "Ḓ" U1E12 # LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW
-<dead_belowcircumflex> <d> : "ḓ" U1E13 # LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW
-<dead_grave> <Emacron> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
-<Multi_key> <grave> <Emacron> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
-<dead_grave> <dead_macron> <E> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
-<dead_grave> <Multi_key> <macron> <E> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
-<dead_grave> <Multi_key> <underscore> <E> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
-<Multi_key> <grave> <dead_macron> <E> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
-<Multi_key> <grave> <macron> <E> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
-<Multi_key> <grave> <underscore> <E> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
-<dead_grave> <emacron> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
-<Multi_key> <grave> <emacron> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
-<dead_grave> <dead_macron> <e> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
-<dead_grave> <Multi_key> <macron> <e> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
-<dead_grave> <Multi_key> <underscore> <e> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
-<Multi_key> <grave> <dead_macron> <e> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
-<Multi_key> <grave> <macron> <e> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
-<Multi_key> <grave> <underscore> <e> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
-<dead_acute> <Emacron> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
-<Multi_key> <acute> <Emacron> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
-<Multi_key> <apostrophe> <Emacron> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
-<dead_acute> <dead_macron> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
-<dead_acute> <Multi_key> <macron> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
-<dead_acute> <Multi_key> <underscore> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
-<Multi_key> <acute> <dead_macron> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
-<Multi_key> <acute> <macron> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
-<Multi_key> <acute> <underscore> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
-<Multi_key> <apostrophe> <dead_macron> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
-<Multi_key> <apostrophe> <macron> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
-<Multi_key> <apostrophe> <underscore> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
-<dead_acute> <emacron> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
-<Multi_key> <acute> <emacron> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
-<Multi_key> <apostrophe> <emacron> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
-<dead_acute> <dead_macron> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
-<dead_acute> <Multi_key> <macron> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
-<dead_acute> <Multi_key> <underscore> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
-<Multi_key> <acute> <dead_macron> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
-<Multi_key> <acute> <macron> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
-<Multi_key> <acute> <underscore> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
-<Multi_key> <apostrophe> <dead_macron> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
-<Multi_key> <apostrophe> <macron> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
-<Multi_key> <apostrophe> <underscore> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
-<dead_belowcircumflex> <E> : "Ḙ" U1E18 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW
-<dead_belowcircumflex> <e> : "ḙ" U1E19 # LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW
-<dead_belowtilde> <E> : "Ḛ" U1E1A # LATIN CAPITAL LETTER E WITH TILDE BELOW
-<dead_belowtilde> <e> : "ḛ" U1E1B # LATIN SMALL LETTER E WITH TILDE BELOW
-<dead_breve> <U0228> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
-<Multi_key> <U> <U0228> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
-<Multi_key> <b> <U0228> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
-<dead_breve> <dead_cedilla> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
-<dead_breve> <Multi_key> <comma> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
-<dead_breve> <Multi_key> <cedilla> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
-<Multi_key> <U> <dead_cedilla> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
-<Multi_key> <U> <comma> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
-<Multi_key> <U> <cedilla> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
-<Multi_key> <b> <dead_cedilla> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
-<Multi_key> <b> <comma> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
-<Multi_key> <b> <cedilla> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
-<dead_breve> <U0229> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
-<Multi_key> <U> <U0229> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
-<Multi_key> <b> <U0229> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
-<dead_breve> <dead_cedilla> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
-<dead_breve> <Multi_key> <comma> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
-<dead_breve> <Multi_key> <cedilla> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
-<Multi_key> <U> <dead_cedilla> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
-<Multi_key> <U> <comma> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
-<Multi_key> <U> <cedilla> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
-<Multi_key> <b> <dead_cedilla> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
-<Multi_key> <b> <comma> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
-<Multi_key> <b> <cedilla> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
-<dead_abovedot> <F> : "Ḟ" U1E1E # LATIN CAPITAL LETTER F WITH DOT ABOVE
-<Multi_key> <period> <F> : "Ḟ" U1E1E # LATIN CAPITAL LETTER F WITH DOT ABOVE
-<dead_abovedot> <f> : "ḟ" U1E1F # LATIN SMALL LETTER F WITH DOT ABOVE
-<Multi_key> <period> <f> : "ḟ" U1E1F # LATIN SMALL LETTER F WITH DOT ABOVE
-<dead_macron> <G> : "Ḡ" U1E20 # LATIN CAPITAL LETTER G WITH MACRON
-<Multi_key> <macron> <G> : "Ḡ" U1E20 # LATIN CAPITAL LETTER G WITH MACRON
-<Multi_key> <underscore> <G> : "Ḡ" U1E20 # LATIN CAPITAL LETTER G WITH MACRON
-<dead_macron> <g> : "ḡ" U1E21 # LATIN SMALL LETTER G WITH MACRON
-<Multi_key> <macron> <g> : "ḡ" U1E21 # LATIN SMALL LETTER G WITH MACRON
-<Multi_key> <underscore> <g> : "ḡ" U1E21 # LATIN SMALL LETTER G WITH MACRON
-<dead_abovedot> <H> : "Ḣ" U1E22 # LATIN CAPITAL LETTER H WITH DOT ABOVE
-<Multi_key> <period> <H> : "Ḣ" U1E22 # LATIN CAPITAL LETTER H WITH DOT ABOVE
-<dead_abovedot> <h> : "ḣ" U1E23 # LATIN SMALL LETTER H WITH DOT ABOVE
-<Multi_key> <period> <h> : "ḣ" U1E23 # LATIN SMALL LETTER H WITH DOT ABOVE
-<dead_belowdot> <H> : "Ḥ" U1E24 # LATIN CAPITAL LETTER H WITH DOT BELOW
-<Multi_key> <exclam> <H> : "Ḥ" U1E24 # LATIN CAPITAL LETTER H WITH DOT BELOW
-<dead_belowdot> <h> : "ḥ" U1E25 # LATIN SMALL LETTER H WITH DOT BELOW
-<Multi_key> <exclam> <h> : "ḥ" U1E25 # LATIN SMALL LETTER H WITH DOT BELOW
-<dead_diaeresis> <H> : "Ḧ" U1E26 # LATIN CAPITAL LETTER H WITH DIAERESIS
-<Multi_key> <quotedbl> <H> : "Ḧ" U1E26 # LATIN CAPITAL LETTER H WITH DIAERESIS
-<dead_diaeresis> <h> : "ḧ" U1E27 # LATIN SMALL LETTER H WITH DIAERESIS
-<Multi_key> <quotedbl> <h> : "ḧ" U1E27 # LATIN SMALL LETTER H WITH DIAERESIS
-<dead_cedilla> <H> : "Ḩ" U1E28 # LATIN CAPITAL LETTER H WITH CEDILLA
-<Multi_key> <comma> <H> : "Ḩ" U1E28 # LATIN CAPITAL LETTER H WITH CEDILLA
-<Multi_key> <cedilla> <H> : "Ḩ" U1E28 # LATIN CAPITAL LETTER H WITH CEDILLA
-<dead_cedilla> <h> : "ḩ" U1E29 # LATIN SMALL LETTER H WITH CEDILLA
-<Multi_key> <comma> <h> : "ḩ" U1E29 # LATIN SMALL LETTER H WITH CEDILLA
-<Multi_key> <cedilla> <h> : "ḩ" U1E29 # LATIN SMALL LETTER H WITH CEDILLA
-<dead_belowbreve> <H> : "Ḫ" U1E2A # LATIN CAPITAL LETTER H WITH BREVE BELOW
-<dead_belowbreve> <h> : "ḫ" U1E2B # LATIN SMALL LETTER H WITH BREVE BELOW
-<dead_belowtilde> <I> : "Ḭ" U1E2C # LATIN CAPITAL LETTER I WITH TILDE BELOW
-<dead_belowtilde> <i> : "ḭ" U1E2D # LATIN SMALL LETTER I WITH TILDE BELOW
-<dead_acute> <Idiaeresis> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
-<Multi_key> <acute> <Idiaeresis> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
-<Multi_key> <apostrophe> <Idiaeresis> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
-<dead_acute> <dead_diaeresis> <I> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
-<dead_acute> <Multi_key> <quotedbl> <I> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
-<Multi_key> <acute> <dead_diaeresis> <I> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
-<Multi_key> <acute> <quotedbl> <I> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
-<Multi_key> <apostrophe> <dead_diaeresis> <I> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
-<Multi_key> <apostrophe> <quotedbl> <I> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
-<dead_acute> <idiaeresis> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
-<Multi_key> <acute> <idiaeresis> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
-<Multi_key> <apostrophe> <idiaeresis> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
-<dead_acute> <dead_diaeresis> <i> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
-<dead_acute> <Multi_key> <quotedbl> <i> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
-<Multi_key> <acute> <dead_diaeresis> <i> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
-<Multi_key> <acute> <quotedbl> <i> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
-<Multi_key> <apostrophe> <dead_diaeresis> <i> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
-<Multi_key> <apostrophe> <quotedbl> <i> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
-<dead_acute> <K> : "Ḱ" U1E30 # LATIN CAPITAL LETTER K WITH ACUTE
-<Multi_key> <acute> <K> : "Ḱ" U1E30 # LATIN CAPITAL LETTER K WITH ACUTE
-<Multi_key> <apostrophe> <K> : "Ḱ" U1E30 # LATIN CAPITAL LETTER K WITH ACUTE
-<dead_acute> <k> : "ḱ" U1E31 # LATIN SMALL LETTER K WITH ACUTE
-<Multi_key> <acute> <k> : "ḱ" U1E31 # LATIN SMALL LETTER K WITH ACUTE
-<Multi_key> <apostrophe> <k> : "ḱ" U1E31 # LATIN SMALL LETTER K WITH ACUTE
-<dead_belowdot> <K> : "Ḳ" U1E32 # LATIN CAPITAL LETTER K WITH DOT BELOW
-<Multi_key> <exclam> <K> : "Ḳ" U1E32 # LATIN CAPITAL LETTER K WITH DOT BELOW
-<dead_belowdot> <k> : "ḳ" U1E33 # LATIN SMALL LETTER K WITH DOT BELOW
-<Multi_key> <exclam> <k> : "ḳ" U1E33 # LATIN SMALL LETTER K WITH DOT BELOW
-<dead_belowmacron> <K> : "Ḵ" U1E34 # LATIN CAPITAL LETTER K WITH LINE BELOW
-<dead_belowmacron> <k> : "ḵ" U1E35 # LATIN SMALL LETTER K WITH LINE BELOW
-<dead_belowdot> <L> : "Ḷ" U1E36 # LATIN CAPITAL LETTER L WITH DOT BELOW
-<Multi_key> <exclam> <L> : "Ḷ" U1E36 # LATIN CAPITAL LETTER L WITH DOT BELOW
-<dead_belowdot> <l> : "ḷ" U1E37 # LATIN SMALL LETTER L WITH DOT BELOW
-<Multi_key> <exclam> <l> : "ḷ" U1E37 # LATIN SMALL LETTER L WITH DOT BELOW
-<dead_macron> <U1E36> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
-<Multi_key> <macron> <U1E36> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
-<Multi_key> <underscore> <U1E36> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
-<dead_macron> <dead_belowdot> <L> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
-<dead_macron> <Multi_key> <exclam> <L> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
-<Multi_key> <macron> <dead_belowdot> <L> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
-<Multi_key> <macron> <exclam> <L> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
-<Multi_key> <underscore> <dead_belowdot> <L> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
-<Multi_key> <underscore> <exclam> <L> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
-<dead_macron> <U1E37> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
-<Multi_key> <macron> <U1E37> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
-<Multi_key> <underscore> <U1E37> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
-<dead_macron> <dead_belowdot> <l> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
-<dead_macron> <Multi_key> <exclam> <l> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
-<Multi_key> <macron> <dead_belowdot> <l> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
-<Multi_key> <macron> <exclam> <l> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
-<Multi_key> <underscore> <dead_belowdot> <l> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
-<Multi_key> <underscore> <exclam> <l> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
-<dead_belowmacron> <L> : "Ḻ" U1E3A # LATIN CAPITAL LETTER L WITH LINE BELOW
-<dead_belowmacron> <l> : "ḻ" U1E3B # LATIN SMALL LETTER L WITH LINE BELOW
-<dead_belowcircumflex> <L> : "Ḽ" U1E3C # LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW
-<dead_belowcircumflex> <l> : "ḽ" U1E3D # LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW
-<dead_acute> <M> : "Ḿ" U1E3E # LATIN CAPITAL LETTER M WITH ACUTE
-<Multi_key> <acute> <M> : "Ḿ" U1E3E # LATIN CAPITAL LETTER M WITH ACUTE
-<Multi_key> <apostrophe> <M> : "Ḿ" U1E3E # LATIN CAPITAL LETTER M WITH ACUTE
-<dead_acute> <m> : "ḿ" U1E3F # LATIN SMALL LETTER M WITH ACUTE
-<Multi_key> <acute> <m> : "ḿ" U1E3F # LATIN SMALL LETTER M WITH ACUTE
-<Multi_key> <apostrophe> <m> : "ḿ" U1E3F # LATIN SMALL LETTER M WITH ACUTE
-<dead_abovedot> <M> : "Ṁ" U1E40 # LATIN CAPITAL LETTER M WITH DOT ABOVE
-<Multi_key> <period> <M> : "Ṁ" U1E40 # LATIN CAPITAL LETTER M WITH DOT ABOVE
-<dead_abovedot> <m> : "ṁ" U1E41 # LATIN SMALL LETTER M WITH DOT ABOVE
-<Multi_key> <period> <m> : "ṁ" U1E41 # LATIN SMALL LETTER M WITH DOT ABOVE
-<dead_belowdot> <M> : "Ṃ" U1E42 # LATIN CAPITAL LETTER M WITH DOT BELOW
-<Multi_key> <exclam> <M> : "Ṃ" U1E42 # LATIN CAPITAL LETTER M WITH DOT BELOW
-<dead_belowdot> <m> : "ṃ" U1E43 # LATIN SMALL LETTER M WITH DOT BELOW
-<Multi_key> <exclam> <m> : "ṃ" U1E43 # LATIN SMALL LETTER M WITH DOT BELOW
-<dead_abovedot> <N> : "Ṅ" U1E44 # LATIN CAPITAL LETTER N WITH DOT ABOVE
-<Multi_key> <period> <N> : "Ṅ" U1E44 # LATIN CAPITAL LETTER N WITH DOT ABOVE
-<dead_abovedot> <n> : "ṅ" U1E45 # LATIN SMALL LETTER N WITH DOT ABOVE
-<Multi_key> <period> <n> : "ṅ" U1E45 # LATIN SMALL LETTER N WITH DOT ABOVE
-<dead_belowdot> <N> : "Ṇ" U1E46 # LATIN CAPITAL LETTER N WITH DOT BELOW
-<Multi_key> <exclam> <N> : "Ṇ" U1E46 # LATIN CAPITAL LETTER N WITH DOT BELOW
-<dead_belowdot> <n> : "ṇ" U1E47 # LATIN SMALL LETTER N WITH DOT BELOW
-<Multi_key> <exclam> <n> : "ṇ" U1E47 # LATIN SMALL LETTER N WITH DOT BELOW
-<dead_belowmacron> <N> : "Ṉ" U1E48 # LATIN CAPITAL LETTER N WITH LINE BELOW
-<dead_belowmacron> <n> : "ṉ" U1E49 # LATIN SMALL LETTER N WITH LINE BELOW
-<dead_belowcircumflex> <N> : "Ṋ" U1E4A # LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW
-<dead_belowcircumflex> <n> : "ṋ" U1E4B # LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW
-<dead_acute> <Otilde> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
-<Multi_key> <acute> <Otilde> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
-<Multi_key> <apostrophe> <Otilde> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
-<dead_acute> <dead_tilde> <O> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
-<dead_acute> <Multi_key> <asciitilde> <O> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
-<Multi_key> <acute> <dead_tilde> <O> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
-<Multi_key> <acute> <asciitilde> <O> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
-<Multi_key> <apostrophe> <dead_tilde> <O> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
-<Multi_key> <apostrophe> <asciitilde> <O> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
-<dead_acute> <otilde> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
-<Multi_key> <acute> <otilde> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
-<Multi_key> <apostrophe> <otilde> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
-<dead_acute> <dead_tilde> <o> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
-<dead_acute> <Multi_key> <asciitilde> <o> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
-<Multi_key> <acute> <dead_tilde> <o> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
-<Multi_key> <acute> <asciitilde> <o> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
-<Multi_key> <apostrophe> <dead_tilde> <o> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
-<Multi_key> <apostrophe> <asciitilde> <o> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
-<dead_diaeresis> <Otilde> : "Ṏ" U1E4E # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
-<Multi_key> <quotedbl> <Otilde> : "Ṏ" U1E4E # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
-<dead_diaeresis> <dead_tilde> <O> : "Ṏ" U1E4E # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
-<dead_diaeresis> <Multi_key> <asciitilde> <O> : "Ṏ" U1E4E # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
-<Multi_key> <quotedbl> <dead_tilde> <O> : "Ṏ" U1E4E # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
-<Multi_key> <quotedbl> <asciitilde> <O> : "Ṏ" U1E4E # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
-<dead_diaeresis> <otilde> : "ṏ" U1E4F # LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
-<Multi_key> <quotedbl> <otilde> : "ṏ" U1E4F # LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
-<dead_diaeresis> <dead_tilde> <o> : "ṏ" U1E4F # LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
-<dead_diaeresis> <Multi_key> <asciitilde> <o> : "ṏ" U1E4F # LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
-<Multi_key> <quotedbl> <dead_tilde> <o> : "ṏ" U1E4F # LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
-<Multi_key> <quotedbl> <asciitilde> <o> : "ṏ" U1E4F # LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
-<dead_grave> <Omacron> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
-<Multi_key> <grave> <Omacron> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
-<dead_grave> <dead_macron> <O> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
-<dead_grave> <Multi_key> <macron> <O> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
-<dead_grave> <Multi_key> <underscore> <O> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
-<Multi_key> <grave> <dead_macron> <O> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
-<Multi_key> <grave> <macron> <O> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
-<Multi_key> <grave> <underscore> <O> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
-<dead_grave> <omacron> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
-<Multi_key> <grave> <omacron> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
-<dead_grave> <dead_macron> <o> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
-<dead_grave> <Multi_key> <macron> <o> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
-<dead_grave> <Multi_key> <underscore> <o> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
-<Multi_key> <grave> <dead_macron> <o> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
-<Multi_key> <grave> <macron> <o> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
-<Multi_key> <grave> <underscore> <o> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
-<dead_acute> <Omacron> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
-<Multi_key> <acute> <Omacron> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
-<Multi_key> <apostrophe> <Omacron> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
-<dead_acute> <dead_macron> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
-<dead_acute> <Multi_key> <macron> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
-<dead_acute> <Multi_key> <underscore> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
-<Multi_key> <acute> <dead_macron> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
-<Multi_key> <acute> <macron> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
-<Multi_key> <acute> <underscore> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
-<Multi_key> <apostrophe> <dead_macron> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
-<Multi_key> <apostrophe> <macron> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
-<Multi_key> <apostrophe> <underscore> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
-<dead_acute> <omacron> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
-<Multi_key> <acute> <omacron> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
-<Multi_key> <apostrophe> <omacron> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
-<dead_acute> <dead_macron> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
-<dead_acute> <Multi_key> <macron> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
-<dead_acute> <Multi_key> <underscore> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
-<Multi_key> <acute> <dead_macron> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
-<Multi_key> <acute> <macron> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
-<Multi_key> <acute> <underscore> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
-<Multi_key> <apostrophe> <dead_macron> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
-<Multi_key> <apostrophe> <macron> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
-<Multi_key> <apostrophe> <underscore> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
-<dead_acute> <P> : "Ṕ" U1E54 # LATIN CAPITAL LETTER P WITH ACUTE
-<Multi_key> <acute> <P> : "Ṕ" U1E54 # LATIN CAPITAL LETTER P WITH ACUTE
-<Multi_key> <apostrophe> <P> : "Ṕ" U1E54 # LATIN CAPITAL LETTER P WITH ACUTE
-<dead_acute> <p> : "ṕ" U1E55 # LATIN SMALL LETTER P WITH ACUTE
-<Multi_key> <acute> <p> : "ṕ" U1E55 # LATIN SMALL LETTER P WITH ACUTE
-<Multi_key> <apostrophe> <p> : "ṕ" U1E55 # LATIN SMALL LETTER P WITH ACUTE
-<dead_abovedot> <P> : "Ṗ" U1E56 # LATIN CAPITAL LETTER P WITH DOT ABOVE
-<Multi_key> <period> <P> : "Ṗ" U1E56 # LATIN CAPITAL LETTER P WITH DOT ABOVE
-<dead_abovedot> <p> : "ṗ" U1E57 # LATIN SMALL LETTER P WITH DOT ABOVE
-<Multi_key> <period> <p> : "ṗ" U1E57 # LATIN SMALL LETTER P WITH DOT ABOVE
-<dead_abovedot> <R> : "Ṙ" U1E58 # LATIN CAPITAL LETTER R WITH DOT ABOVE
-<Multi_key> <period> <R> : "Ṙ" U1E58 # LATIN CAPITAL LETTER R WITH DOT ABOVE
-<dead_abovedot> <r> : "ṙ" U1E59 # LATIN SMALL LETTER R WITH DOT ABOVE
-<Multi_key> <period> <r> : "ṙ" U1E59 # LATIN SMALL LETTER R WITH DOT ABOVE
-<dead_belowdot> <R> : "Ṛ" U1E5A # LATIN CAPITAL LETTER R WITH DOT BELOW
-<Multi_key> <exclam> <R> : "Ṛ" U1E5A # LATIN CAPITAL LETTER R WITH DOT BELOW
-<dead_belowdot> <r> : "ṛ" U1E5B # LATIN SMALL LETTER R WITH DOT BELOW
-<Multi_key> <exclam> <r> : "ṛ" U1E5B # LATIN SMALL LETTER R WITH DOT BELOW
-<dead_macron> <U1E5A> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
-<Multi_key> <macron> <U1E5A> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
-<Multi_key> <underscore> <U1E5A> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
-<dead_macron> <dead_belowdot> <R> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
-<dead_macron> <Multi_key> <exclam> <R> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
-<Multi_key> <macron> <dead_belowdot> <R> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
-<Multi_key> <macron> <exclam> <R> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
-<Multi_key> <underscore> <dead_belowdot> <R> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
-<Multi_key> <underscore> <exclam> <R> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
-<dead_macron> <U1E5B> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
-<Multi_key> <macron> <U1E5B> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
-<Multi_key> <underscore> <U1E5B> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
-<dead_macron> <dead_belowdot> <r> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
-<dead_macron> <Multi_key> <exclam> <r> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
-<Multi_key> <macron> <dead_belowdot> <r> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
-<Multi_key> <macron> <exclam> <r> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
-<Multi_key> <underscore> <dead_belowdot> <r> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
-<Multi_key> <underscore> <exclam> <r> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
-<dead_belowmacron> <R> : "Ṟ" U1E5E # LATIN CAPITAL LETTER R WITH LINE BELOW
-<dead_belowmacron> <r> : "ṟ" U1E5F # LATIN SMALL LETTER R WITH LINE BELOW
-<dead_abovedot> <S> : "Ṡ" U1E60 # LATIN CAPITAL LETTER S WITH DOT ABOVE
-<Multi_key> <period> <S> : "Ṡ" U1E60 # LATIN CAPITAL LETTER S WITH DOT ABOVE
-<dead_abovedot> <s> : "ṡ" U1E61 # LATIN SMALL LETTER S WITH DOT ABOVE
-<Multi_key> <period> <s> : "ṡ" U1E61 # LATIN SMALL LETTER S WITH DOT ABOVE
-<dead_belowdot> <S> : "Ṣ" U1E62 # LATIN CAPITAL LETTER S WITH DOT BELOW
-<Multi_key> <exclam> <S> : "Ṣ" U1E62 # LATIN CAPITAL LETTER S WITH DOT BELOW
-<dead_belowdot> <s> : "ṣ" U1E63 # LATIN SMALL LETTER S WITH DOT BELOW
-<Multi_key> <exclam> <s> : "ṣ" U1E63 # LATIN SMALL LETTER S WITH DOT BELOW
-<dead_abovedot> <Sacute> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
-<Multi_key> <period> <Sacute> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
-<dead_abovedot> <dead_acute> <S> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
-<dead_abovedot> <Multi_key> <acute> <S> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
-<dead_abovedot> <Multi_key> <apostrophe> <S> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
-<Multi_key> <period> <dead_acute> <S> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
-<Multi_key> <period> <acute> <S> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
-<Multi_key> <period> <apostrophe> <S> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
-<dead_abovedot> <sacute> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
-<Multi_key> <period> <sacute> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
-<dead_abovedot> <dead_acute> <s> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
-<dead_abovedot> <Multi_key> <acute> <s> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
-<dead_abovedot> <Multi_key> <apostrophe> <s> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
-<Multi_key> <period> <dead_acute> <s> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
-<Multi_key> <period> <acute> <s> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
-<Multi_key> <period> <apostrophe> <s> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
-<dead_abovedot> <Scaron> : "Ṧ" U1E66 # LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
-<Multi_key> <period> <Scaron> : "Ṧ" U1E66 # LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
-<dead_abovedot> <dead_caron> <S> : "Ṧ" U1E66 # LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
-<dead_abovedot> <Multi_key> <c> <S> : "Ṧ" U1E66 # LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
-<Multi_key> <period> <dead_caron> <S> : "Ṧ" U1E66 # LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
-<dead_abovedot> <scaron> : "ṧ" U1E67 # LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
-<Multi_key> <period> <scaron> : "ṧ" U1E67 # LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
-<dead_abovedot> <dead_caron> <s> : "ṧ" U1E67 # LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
-<dead_abovedot> <Multi_key> <c> <s> : "ṧ" U1E67 # LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
-<Multi_key> <period> <dead_caron> <s> : "ṧ" U1E67 # LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
-<dead_abovedot> <U1E62> : "Ṩ" U1E68 # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
-<Multi_key> <period> <U1E62> : "Ṩ" U1E68 # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
-<dead_abovedot> <dead_belowdot> <S> : "Ṩ" U1E68 # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
-<dead_abovedot> <Multi_key> <exclam> <S> : "Ṩ" U1E68 # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
-<Multi_key> <period> <dead_belowdot> <S> : "Ṩ" U1E68 # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
-<Multi_key> <period> <exclam> <S> : "Ṩ" U1E68 # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
-<dead_abovedot> <U1E63> : "ṩ" U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
-<Multi_key> <period> <U1E63> : "ṩ" U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
-<dead_abovedot> <dead_belowdot> <s> : "ṩ" U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
-<dead_abovedot> <Multi_key> <exclam> <s> : "ṩ" U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
-<Multi_key> <period> <dead_belowdot> <s> : "ṩ" U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
-<Multi_key> <period> <exclam> <s> : "ṩ" U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
-<dead_abovedot> <T> : "Ṫ" U1E6A # LATIN CAPITAL LETTER T WITH DOT ABOVE
-<Multi_key> <period> <T> : "Ṫ" U1E6A # LATIN CAPITAL LETTER T WITH DOT ABOVE
-<dead_abovedot> <t> : "ṫ" U1E6B # LATIN SMALL LETTER T WITH DOT ABOVE
-<Multi_key> <period> <t> : "ṫ" U1E6B # LATIN SMALL LETTER T WITH DOT ABOVE
-<dead_belowdot> <T> : "Ṭ" U1E6C # LATIN CAPITAL LETTER T WITH DOT BELOW
-<Multi_key> <exclam> <T> : "Ṭ" U1E6C # LATIN CAPITAL LETTER T WITH DOT BELOW
-<dead_belowdot> <t> : "ṭ" U1E6D # LATIN SMALL LETTER T WITH DOT BELOW
-<Multi_key> <exclam> <t> : "ṭ" U1E6D # LATIN SMALL LETTER T WITH DOT BELOW
-<dead_belowmacron> <T> : "Ṯ" U1E6E # LATIN CAPITAL LETTER T WITH LINE BELOW
-<dead_belowmacron> <t> : "ṯ" U1E6F # LATIN SMALL LETTER T WITH LINE BELOW
-<dead_belowcircumflex> <T> : "Ṱ" U1E70 # LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW
-<dead_belowcircumflex> <t> : "ṱ" U1E71 # LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW
-<dead_belowdiaeresis> <U> : "Ṳ" U1E72 # LATIN CAPITAL LETTER U WITH DIAERESIS BELOW
-<dead_belowdiaeresis> <u> : "ṳ" U1E73 # LATIN SMALL LETTER U WITH DIAERESIS BELOW
-<dead_belowtilde> <U> : "Ṵ" U1E74 # LATIN CAPITAL LETTER U WITH TILDE BELOW
-<dead_belowtilde> <u> : "ṵ" U1E75 # LATIN SMALL LETTER U WITH TILDE BELOW
-<dead_belowcircumflex> <U> : "Ṷ" U1E76 # LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW
-<dead_belowcircumflex> <u> : "ṷ" U1E77 # LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW
-<dead_acute> <Utilde> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
-<Multi_key> <acute> <Utilde> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
-<Multi_key> <apostrophe> <Utilde> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
-<dead_acute> <dead_tilde> <U> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
-<dead_acute> <Multi_key> <asciitilde> <U> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
-<Multi_key> <acute> <dead_tilde> <U> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
-<Multi_key> <acute> <asciitilde> <U> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
-<Multi_key> <apostrophe> <dead_tilde> <U> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
-<Multi_key> <apostrophe> <asciitilde> <U> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
-<dead_acute> <utilde> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
-<Multi_key> <acute> <utilde> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
-<Multi_key> <apostrophe> <utilde> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
-<dead_acute> <dead_tilde> <u> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
-<dead_acute> <Multi_key> <asciitilde> <u> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
-<Multi_key> <acute> <dead_tilde> <u> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
-<Multi_key> <acute> <asciitilde> <u> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
-<Multi_key> <apostrophe> <dead_tilde> <u> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
-<Multi_key> <apostrophe> <asciitilde> <u> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
-<dead_diaeresis> <Umacron> : "Ṻ" U1E7A # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
-<Multi_key> <quotedbl> <Umacron> : "Ṻ" U1E7A # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
-<dead_diaeresis> <dead_macron> <U> : "Ṻ" U1E7A # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
-<dead_diaeresis> <Multi_key> <macron> <U> : "Ṻ" U1E7A # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
-<dead_diaeresis> <Multi_key> <underscore> <U> : "Ṻ" U1E7A # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
-<Multi_key> <quotedbl> <dead_macron> <U> : "Ṻ" U1E7A # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
-<Multi_key> <quotedbl> <macron> <U> : "Ṻ" U1E7A # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
-<Multi_key> <quotedbl> <underscore> <U> : "Ṻ" U1E7A # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
-<dead_diaeresis> <umacron> : "ṻ" U1E7B # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
-<Multi_key> <quotedbl> <umacron> : "ṻ" U1E7B # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
-<dead_diaeresis> <dead_macron> <u> : "ṻ" U1E7B # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
-<dead_diaeresis> <Multi_key> <macron> <u> : "ṻ" U1E7B # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
-<dead_diaeresis> <Multi_key> <underscore> <u> : "ṻ" U1E7B # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
-<Multi_key> <quotedbl> <dead_macron> <u> : "ṻ" U1E7B # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
-<Multi_key> <quotedbl> <macron> <u> : "ṻ" U1E7B # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
-<Multi_key> <quotedbl> <underscore> <u> : "ṻ" U1E7B # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
-<dead_tilde> <V> : "Ṽ" U1E7C # LATIN CAPITAL LETTER V WITH TILDE
-<Multi_key> <asciitilde> <V> : "Ṽ" U1E7C # LATIN CAPITAL LETTER V WITH TILDE
-<dead_tilde> <v> : "ṽ" U1E7D # LATIN SMALL LETTER V WITH TILDE
-<Multi_key> <asciitilde> <v> : "ṽ" U1E7D # LATIN SMALL LETTER V WITH TILDE
-<dead_belowdot> <V> : "Ṿ" U1E7E # LATIN CAPITAL LETTER V WITH DOT BELOW
-<Multi_key> <exclam> <V> : "Ṿ" U1E7E # LATIN CAPITAL LETTER V WITH DOT BELOW
-<dead_belowdot> <v> : "ṿ" U1E7F # LATIN SMALL LETTER V WITH DOT BELOW
-<Multi_key> <exclam> <v> : "ṿ" U1E7F # LATIN SMALL LETTER V WITH DOT BELOW
-<dead_grave> <W> : "Ẁ" U1E80 # LATIN CAPITAL LETTER W WITH GRAVE
-<Multi_key> <grave> <W> : "Ẁ" U1E80 # LATIN CAPITAL LETTER W WITH GRAVE
-<dead_grave> <w> : "ẁ" U1E81 # LATIN SMALL LETTER W WITH GRAVE
-<Multi_key> <grave> <w> : "ẁ" U1E81 # LATIN SMALL LETTER W WITH GRAVE
-<dead_acute> <W> : "Ẃ" U1E82 # LATIN CAPITAL LETTER W WITH ACUTE
-<Multi_key> <acute> <W> : "Ẃ" U1E82 # LATIN CAPITAL LETTER W WITH ACUTE
-<Multi_key> <apostrophe> <W> : "Ẃ" U1E82 # LATIN CAPITAL LETTER W WITH ACUTE
-<dead_acute> <w> : "ẃ" U1E83 # LATIN SMALL LETTER W WITH ACUTE
-<Multi_key> <acute> <w> : "ẃ" U1E83 # LATIN SMALL LETTER W WITH ACUTE
-<Multi_key> <apostrophe> <w> : "ẃ" U1E83 # LATIN SMALL LETTER W WITH ACUTE
-<dead_diaeresis> <W> : "Ẅ" U1E84 # LATIN CAPITAL LETTER W WITH DIAERESIS
-<Multi_key> <quotedbl> <W> : "Ẅ" U1E84 # LATIN CAPITAL LETTER W WITH DIAERESIS
-<dead_diaeresis> <w> : "ẅ" U1E85 # LATIN SMALL LETTER W WITH DIAERESIS
-<Multi_key> <quotedbl> <w> : "ẅ" U1E85 # LATIN SMALL LETTER W WITH DIAERESIS
-<dead_abovedot> <W> : "Ẇ" U1E86 # LATIN CAPITAL LETTER W WITH DOT ABOVE
-<Multi_key> <period> <W> : "Ẇ" U1E86 # LATIN CAPITAL LETTER W WITH DOT ABOVE
-<dead_abovedot> <w> : "ẇ" U1E87 # LATIN SMALL LETTER W WITH DOT ABOVE
-<Multi_key> <period> <w> : "ẇ" U1E87 # LATIN SMALL LETTER W WITH DOT ABOVE
-<dead_belowdot> <W> : "Ẉ" U1E88 # LATIN CAPITAL LETTER W WITH DOT BELOW
-<Multi_key> <exclam> <W> : "Ẉ" U1E88 # LATIN CAPITAL LETTER W WITH DOT BELOW
-<dead_belowdot> <w> : "ẉ" U1E89 # LATIN SMALL LETTER W WITH DOT BELOW
-<Multi_key> <exclam> <w> : "ẉ" U1E89 # LATIN SMALL LETTER W WITH DOT BELOW
-<dead_abovedot> <X> : "Ẋ" U1E8A # LATIN CAPITAL LETTER X WITH DOT ABOVE
-<Multi_key> <period> <X> : "Ẋ" U1E8A # LATIN CAPITAL LETTER X WITH DOT ABOVE
-<dead_abovedot> <x> : "ẋ" U1E8B # LATIN SMALL LETTER X WITH DOT ABOVE
-<Multi_key> <period> <x> : "ẋ" U1E8B # LATIN SMALL LETTER X WITH DOT ABOVE
-<dead_diaeresis> <X> : "Ẍ" U1E8C # LATIN CAPITAL LETTER X WITH DIAERESIS
-<Multi_key> <quotedbl> <X> : "Ẍ" U1E8C # LATIN CAPITAL LETTER X WITH DIAERESIS
-<dead_diaeresis> <x> : "ẍ" U1E8D # LATIN SMALL LETTER X WITH DIAERESIS
-<Multi_key> <quotedbl> <x> : "ẍ" U1E8D # LATIN SMALL LETTER X WITH DIAERESIS
-<dead_abovedot> <Y> : "Ẏ" U1E8E # LATIN CAPITAL LETTER Y WITH DOT ABOVE
-<Multi_key> <period> <Y> : "Ẏ" U1E8E # LATIN CAPITAL LETTER Y WITH DOT ABOVE
-<dead_abovedot> <y> : "ẏ" U1E8F # LATIN SMALL LETTER Y WITH DOT ABOVE
-<Multi_key> <period> <y> : "ẏ" U1E8F # LATIN SMALL LETTER Y WITH DOT ABOVE
-<dead_circumflex> <Z> : "Ẑ" U1E90 # LATIN CAPITAL LETTER Z WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <Z> : "Ẑ" U1E90 # LATIN CAPITAL LETTER Z WITH CIRCUMFLEX
-<dead_circumflex> <z> : "ẑ" U1E91 # LATIN SMALL LETTER Z WITH CIRCUMFLEX
-<Multi_key> <asciicircum> <z> : "ẑ" U1E91 # LATIN SMALL LETTER Z WITH CIRCUMFLEX
-<dead_belowdot> <Z> : "Ẓ" U1E92 # LATIN CAPITAL LETTER Z WITH DOT BELOW
-<Multi_key> <exclam> <Z> : "Ẓ" U1E92 # LATIN CAPITAL LETTER Z WITH DOT BELOW
-<dead_belowdot> <z> : "ẓ" U1E93 # LATIN SMALL LETTER Z WITH DOT BELOW
-<Multi_key> <exclam> <z> : "ẓ" U1E93 # LATIN SMALL LETTER Z WITH DOT BELOW
-<dead_belowmacron> <Z> : "Ẕ" U1E94 # LATIN CAPITAL LETTER Z WITH LINE BELOW
-<dead_belowmacron> <z> : "ẕ" U1E95 # LATIN SMALL LETTER Z WITH LINE BELOW
-<dead_belowmacron> <h> : "ẖ" U1E96 # LATIN SMALL LETTER H WITH LINE BELOW
-<dead_diaeresis> <t> : "ẗ" U1E97 # LATIN SMALL LETTER T WITH DIAERESIS
-<Multi_key> <quotedbl> <t> : "ẗ" U1E97 # LATIN SMALL LETTER T WITH DIAERESIS
-<dead_abovering> <w> : "ẘ" U1E98 # LATIN SMALL LETTER W WITH RING ABOVE
-<Multi_key> <o> <w> : "ẘ" U1E98 # LATIN SMALL LETTER W WITH RING ABOVE
-<dead_abovering> <y> : "ẙ" U1E99 # LATIN SMALL LETTER Y WITH RING ABOVE
-<Multi_key> <o> <y> : "ẙ" U1E99 # LATIN SMALL LETTER Y WITH RING ABOVE
-<dead_abovedot> <U017F> : "ẛ" U1E9B # LATIN SMALL LETTER LONG S WITH DOT ABOVE
-<Multi_key> <period> <U017F> : "ẛ" U1E9B # LATIN SMALL LETTER LONG S WITH DOT ABOVE
-<dead_belowdot> <A> : "Ạ" U1EA0 # LATIN CAPITAL LETTER A WITH DOT BELOW
-<Multi_key> <exclam> <A> : "Ạ" U1EA0 # LATIN CAPITAL LETTER A WITH DOT BELOW
-<dead_belowdot> <a> : "ạ" U1EA1 # LATIN SMALL LETTER A WITH DOT BELOW
-<Multi_key> <exclam> <a> : "ạ" U1EA1 # LATIN SMALL LETTER A WITH DOT BELOW
-<dead_hook> <A> : "Ả" U1EA2 # LATIN CAPITAL LETTER A WITH HOOK ABOVE
-<Multi_key> <question> <A> : "Ả" U1EA2 # LATIN CAPITAL LETTER A WITH HOOK ABOVE
-<dead_hook> <a> : "ả" U1EA3 # LATIN SMALL LETTER A WITH HOOK ABOVE
-<Multi_key> <question> <a> : "ả" U1EA3 # LATIN SMALL LETTER A WITH HOOK ABOVE
-<dead_acute> <Acircumflex> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <Acircumflex> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <Acircumflex> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
-<dead_acute> <dead_circumflex> <A> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
-<dead_acute> <Multi_key> <asciicircum> <A> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <dead_circumflex> <A> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <asciicircum> <A> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <dead_circumflex> <A> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <asciicircum> <A> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
-<dead_acute> <acircumflex> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <acircumflex> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <acircumflex> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
-<dead_acute> <dead_circumflex> <a> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
-<dead_acute> <Multi_key> <asciicircum> <a> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <dead_circumflex> <a> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <asciicircum> <a> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <dead_circumflex> <a> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <asciicircum> <a> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
-<dead_grave> <Acircumflex> : "Ầ" U1EA6 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <Acircumflex> : "Ầ" U1EA6 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
-<dead_grave> <dead_circumflex> <A> : "Ầ" U1EA6 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
-<dead_grave> <Multi_key> <asciicircum> <A> : "Ầ" U1EA6 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <dead_circumflex> <A> : "Ầ" U1EA6 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <asciicircum> <A> : "Ầ" U1EA6 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
-<dead_grave> <acircumflex> : "ầ" U1EA7 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <acircumflex> : "ầ" U1EA7 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
-<dead_grave> <dead_circumflex> <a> : "ầ" U1EA7 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
-<dead_grave> <Multi_key> <asciicircum> <a> : "ầ" U1EA7 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <dead_circumflex> <a> : "ầ" U1EA7 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <asciicircum> <a> : "ầ" U1EA7 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
-<dead_hook> <Acircumflex> : "Ẩ" U1EA8 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <Acircumflex> : "Ẩ" U1EA8 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_hook> <dead_circumflex> <A> : "Ẩ" U1EA8 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_hook> <Multi_key> <asciicircum> <A> : "Ẩ" U1EA8 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <dead_circumflex> <A> : "Ẩ" U1EA8 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <asciicircum> <A> : "Ẩ" U1EA8 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_hook> <acircumflex> : "ẩ" U1EA9 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <acircumflex> : "ẩ" U1EA9 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_hook> <dead_circumflex> <a> : "ẩ" U1EA9 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_hook> <Multi_key> <asciicircum> <a> : "ẩ" U1EA9 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <dead_circumflex> <a> : "ẩ" U1EA9 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <asciicircum> <a> : "ẩ" U1EA9 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_tilde> <Acircumflex> : "Ẫ" U1EAA # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <Acircumflex> : "Ẫ" U1EAA # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
-<dead_tilde> <dead_circumflex> <A> : "Ẫ" U1EAA # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
-<dead_tilde> <Multi_key> <asciicircum> <A> : "Ẫ" U1EAA # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <dead_circumflex> <A> : "Ẫ" U1EAA # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <asciicircum> <A> : "Ẫ" U1EAA # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
-<dead_tilde> <acircumflex> : "ẫ" U1EAB # LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <acircumflex> : "ẫ" U1EAB # LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
-<dead_tilde> <dead_circumflex> <a> : "ẫ" U1EAB # LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
-<dead_tilde> <Multi_key> <asciicircum> <a> : "ẫ" U1EAB # LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <dead_circumflex> <a> : "ẫ" U1EAB # LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <asciicircum> <a> : "ẫ" U1EAB # LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
-<dead_circumflex> <U1EA0> : "Ậ" U1EAC # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <U1EA0> : "Ậ" U1EAC # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-<dead_circumflex> <dead_belowdot> <A> : "Ậ" U1EAC # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-<dead_circumflex> <Multi_key> <exclam> <A> : "Ậ" U1EAC # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <dead_belowdot> <A> : "Ậ" U1EAC # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <exclam> <A> : "Ậ" U1EAC # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-<dead_belowdot> <Acircumflex> : "Ậ" U1EAC # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-<dead_circumflex> <U1EA1> : "ậ" U1EAD # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <U1EA1> : "ậ" U1EAD # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-<dead_circumflex> <dead_belowdot> <a> : "ậ" U1EAD # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-<dead_circumflex> <Multi_key> <exclam> <a> : "ậ" U1EAD # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <dead_belowdot> <a> : "ậ" U1EAD # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <exclam> <a> : "ậ" U1EAD # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-<dead_belowdot> <acircumflex> : "ậ" U1EAD # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-<dead_acute> <Abreve> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
-<Multi_key> <acute> <Abreve> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
-<Multi_key> <apostrophe> <Abreve> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
-<dead_acute> <dead_breve> <A> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
-<dead_acute> <Multi_key> <U> <A> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
-<dead_acute> <Multi_key> <b> <A> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
-<Multi_key> <acute> <dead_breve> <A> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
-<Multi_key> <acute> <b> <A> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
-<Multi_key> <apostrophe> <dead_breve> <A> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
-<Multi_key> <apostrophe> <b> <A> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
-<dead_acute> <abreve> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
-<Multi_key> <acute> <abreve> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
-<Multi_key> <apostrophe> <abreve> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
-<dead_acute> <dead_breve> <a> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
-<dead_acute> <Multi_key> <U> <a> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
-<dead_acute> <Multi_key> <b> <a> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
-<Multi_key> <acute> <dead_breve> <a> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
-<Multi_key> <acute> <b> <a> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
-<Multi_key> <apostrophe> <dead_breve> <a> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
-<Multi_key> <apostrophe> <b> <a> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
-<dead_grave> <Abreve> : "Ằ" U1EB0 # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
-<Multi_key> <grave> <Abreve> : "Ằ" U1EB0 # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
-<dead_grave> <dead_breve> <A> : "Ằ" U1EB0 # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
-<dead_grave> <Multi_key> <U> <A> : "Ằ" U1EB0 # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
-<dead_grave> <Multi_key> <b> <A> : "Ằ" U1EB0 # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
-<Multi_key> <grave> <dead_breve> <A> : "Ằ" U1EB0 # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
-<Multi_key> <grave> <b> <A> : "Ằ" U1EB0 # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
-<dead_grave> <abreve> : "ằ" U1EB1 # LATIN SMALL LETTER A WITH BREVE AND GRAVE
-<Multi_key> <grave> <abreve> : "ằ" U1EB1 # LATIN SMALL LETTER A WITH BREVE AND GRAVE
-<dead_grave> <dead_breve> <a> : "ằ" U1EB1 # LATIN SMALL LETTER A WITH BREVE AND GRAVE
-<dead_grave> <Multi_key> <U> <a> : "ằ" U1EB1 # LATIN SMALL LETTER A WITH BREVE AND GRAVE
-<dead_grave> <Multi_key> <b> <a> : "ằ" U1EB1 # LATIN SMALL LETTER A WITH BREVE AND GRAVE
-<Multi_key> <grave> <dead_breve> <a> : "ằ" U1EB1 # LATIN SMALL LETTER A WITH BREVE AND GRAVE
-<Multi_key> <grave> <b> <a> : "ằ" U1EB1 # LATIN SMALL LETTER A WITH BREVE AND GRAVE
-<dead_hook> <Abreve> : "Ẳ" U1EB2 # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
-<Multi_key> <question> <Abreve> : "Ẳ" U1EB2 # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
-<dead_hook> <dead_breve> <A> : "Ẳ" U1EB2 # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
-<dead_hook> <Multi_key> <U> <A> : "Ẳ" U1EB2 # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
-<dead_hook> <Multi_key> <b> <A> : "Ẳ" U1EB2 # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
-<Multi_key> <question> <dead_breve> <A> : "Ẳ" U1EB2 # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
-<Multi_key> <question> <b> <A> : "Ẳ" U1EB2 # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
-<dead_hook> <abreve> : "ẳ" U1EB3 # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
-<Multi_key> <question> <abreve> : "ẳ" U1EB3 # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
-<dead_hook> <dead_breve> <a> : "ẳ" U1EB3 # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
-<dead_hook> <Multi_key> <U> <a> : "ẳ" U1EB3 # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
-<dead_hook> <Multi_key> <b> <a> : "ẳ" U1EB3 # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
-<Multi_key> <question> <dead_breve> <a> : "ẳ" U1EB3 # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
-<Multi_key> <question> <b> <a> : "ẳ" U1EB3 # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
-<dead_tilde> <Abreve> : "Ẵ" U1EB4 # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
-<Multi_key> <asciitilde> <Abreve> : "Ẵ" U1EB4 # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
-<dead_tilde> <dead_breve> <A> : "Ẵ" U1EB4 # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
-<dead_tilde> <Multi_key> <U> <A> : "Ẵ" U1EB4 # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
-<dead_tilde> <Multi_key> <b> <A> : "Ẵ" U1EB4 # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
-<Multi_key> <asciitilde> <dead_breve> <A> : "Ẵ" U1EB4 # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
-<Multi_key> <asciitilde> <b> <A> : "Ẵ" U1EB4 # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
-<dead_tilde> <abreve> : "ẵ" U1EB5 # LATIN SMALL LETTER A WITH BREVE AND TILDE
-<Multi_key> <asciitilde> <abreve> : "ẵ" U1EB5 # LATIN SMALL LETTER A WITH BREVE AND TILDE
-<dead_tilde> <dead_breve> <a> : "ẵ" U1EB5 # LATIN SMALL LETTER A WITH BREVE AND TILDE
-<dead_tilde> <Multi_key> <U> <a> : "ẵ" U1EB5 # LATIN SMALL LETTER A WITH BREVE AND TILDE
-<dead_tilde> <Multi_key> <b> <a> : "ẵ" U1EB5 # LATIN SMALL LETTER A WITH BREVE AND TILDE
-<Multi_key> <asciitilde> <dead_breve> <a> : "ẵ" U1EB5 # LATIN SMALL LETTER A WITH BREVE AND TILDE
-<Multi_key> <asciitilde> <b> <a> : "ẵ" U1EB5 # LATIN SMALL LETTER A WITH BREVE AND TILDE
-<dead_breve> <U1EA0> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
-<Multi_key> <U> <U1EA0> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
-<Multi_key> <b> <U1EA0> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
-<dead_breve> <dead_belowdot> <A> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
-<dead_breve> <Multi_key> <exclam> <A> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
-<Multi_key> <U> <dead_belowdot> <A> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
-<Multi_key> <U> <exclam> <A> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
-<Multi_key> <b> <dead_belowdot> <A> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
-<Multi_key> <b> <exclam> <A> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
-<dead_belowdot> <Abreve> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
-<dead_breve> <U1EA1> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
-<Multi_key> <U> <U1EA1> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
-<Multi_key> <b> <U1EA1> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
-<dead_breve> <dead_belowdot> <a> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
-<dead_breve> <Multi_key> <exclam> <a> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
-<Multi_key> <U> <dead_belowdot> <a> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
-<Multi_key> <U> <exclam> <a> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
-<Multi_key> <b> <dead_belowdot> <a> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
-<Multi_key> <b> <exclam> <a> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
-<dead_belowdot> <abreve> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
-<dead_belowdot> <E> : "Ẹ" U1EB8 # LATIN CAPITAL LETTER E WITH DOT BELOW
-<Multi_key> <exclam> <E> : "Ẹ" U1EB8 # LATIN CAPITAL LETTER E WITH DOT BELOW
-<dead_belowdot> <e> : "ẹ" U1EB9 # LATIN SMALL LETTER E WITH DOT BELOW
-<Multi_key> <exclam> <e> : "ẹ" U1EB9 # LATIN SMALL LETTER E WITH DOT BELOW
-<dead_hook> <E> : "Ẻ" U1EBA # LATIN CAPITAL LETTER E WITH HOOK ABOVE
-<Multi_key> <question> <E> : "Ẻ" U1EBA # LATIN CAPITAL LETTER E WITH HOOK ABOVE
-<dead_hook> <e> : "ẻ" U1EBB # LATIN SMALL LETTER E WITH HOOK ABOVE
-<Multi_key> <question> <e> : "ẻ" U1EBB # LATIN SMALL LETTER E WITH HOOK ABOVE
-<dead_tilde> <E> : "Ẽ" U1EBC # LATIN CAPITAL LETTER E WITH TILDE
-<Multi_key> <asciitilde> <E> : "Ẽ" U1EBC # LATIN CAPITAL LETTER E WITH TILDE
-<dead_tilde> <e> : "ẽ" U1EBD # LATIN SMALL LETTER E WITH TILDE
-<Multi_key> <asciitilde> <e> : "ẽ" U1EBD # LATIN SMALL LETTER E WITH TILDE
-<dead_acute> <Ecircumflex> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <Ecircumflex> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <Ecircumflex> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
-<dead_acute> <dead_circumflex> <E> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
-<dead_acute> <Multi_key> <asciicircum> <E> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <dead_circumflex> <E> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <asciicircum> <E> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <dead_circumflex> <E> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <asciicircum> <E> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
-<dead_acute> <ecircumflex> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <ecircumflex> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <ecircumflex> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
-<dead_acute> <dead_circumflex> <e> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
-<dead_acute> <Multi_key> <asciicircum> <e> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <dead_circumflex> <e> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <asciicircum> <e> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <dead_circumflex> <e> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <asciicircum> <e> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
-<dead_grave> <Ecircumflex> : "Ề" U1EC0 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <Ecircumflex> : "Ề" U1EC0 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
-<dead_grave> <dead_circumflex> <E> : "Ề" U1EC0 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
-<dead_grave> <Multi_key> <asciicircum> <E> : "Ề" U1EC0 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <dead_circumflex> <E> : "Ề" U1EC0 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <asciicircum> <E> : "Ề" U1EC0 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
-<dead_grave> <ecircumflex> : "ề" U1EC1 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <ecircumflex> : "ề" U1EC1 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
-<dead_grave> <dead_circumflex> <e> : "ề" U1EC1 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
-<dead_grave> <Multi_key> <asciicircum> <e> : "ề" U1EC1 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <dead_circumflex> <e> : "ề" U1EC1 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <asciicircum> <e> : "ề" U1EC1 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
-<dead_hook> <Ecircumflex> : "Ể" U1EC2 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <Ecircumflex> : "Ể" U1EC2 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_hook> <dead_circumflex> <E> : "Ể" U1EC2 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_hook> <Multi_key> <asciicircum> <E> : "Ể" U1EC2 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <dead_circumflex> <E> : "Ể" U1EC2 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <asciicircum> <E> : "Ể" U1EC2 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_hook> <ecircumflex> : "ể" U1EC3 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <ecircumflex> : "ể" U1EC3 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_hook> <dead_circumflex> <e> : "ể" U1EC3 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_hook> <Multi_key> <asciicircum> <e> : "ể" U1EC3 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <dead_circumflex> <e> : "ể" U1EC3 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <asciicircum> <e> : "ể" U1EC3 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_tilde> <Ecircumflex> : "Ễ" U1EC4 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <Ecircumflex> : "Ễ" U1EC4 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
-<dead_tilde> <dead_circumflex> <E> : "Ễ" U1EC4 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
-<dead_tilde> <Multi_key> <asciicircum> <E> : "Ễ" U1EC4 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <dead_circumflex> <E> : "Ễ" U1EC4 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <asciicircum> <E> : "Ễ" U1EC4 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
-<dead_tilde> <ecircumflex> : "ễ" U1EC5 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <ecircumflex> : "ễ" U1EC5 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
-<dead_tilde> <dead_circumflex> <e> : "ễ" U1EC5 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
-<dead_tilde> <Multi_key> <asciicircum> <e> : "ễ" U1EC5 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <dead_circumflex> <e> : "ễ" U1EC5 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <asciicircum> <e> : "ễ" U1EC5 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
-<dead_circumflex> <U1EB8> : "Ệ" U1EC6 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <U1EB8> : "Ệ" U1EC6 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-<dead_circumflex> <dead_belowdot> <E> : "Ệ" U1EC6 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-<dead_circumflex> <Multi_key> <exclam> <E> : "Ệ" U1EC6 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <dead_belowdot> <E> : "Ệ" U1EC6 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <exclam> <E> : "Ệ" U1EC6 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-<dead_belowdot> <Ecircumflex> : "Ệ" U1EC6 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-<dead_circumflex> <U1EB9> : "ệ" U1EC7 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <U1EB9> : "ệ" U1EC7 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-<dead_circumflex> <dead_belowdot> <e> : "ệ" U1EC7 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-<dead_circumflex> <Multi_key> <exclam> <e> : "ệ" U1EC7 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <dead_belowdot> <e> : "ệ" U1EC7 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <exclam> <e> : "ệ" U1EC7 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-<dead_belowdot> <ecircumflex> : "ệ" U1EC7 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-<dead_hook> <I> : "Ỉ" U1EC8 # LATIN CAPITAL LETTER I WITH HOOK ABOVE
-<Multi_key> <question> <I> : "Ỉ" U1EC8 # LATIN CAPITAL LETTER I WITH HOOK ABOVE
-<dead_hook> <i> : "ỉ" U1EC9 # LATIN SMALL LETTER I WITH HOOK ABOVE
-<Multi_key> <question> <i> : "ỉ" U1EC9 # LATIN SMALL LETTER I WITH HOOK ABOVE
-<dead_belowdot> <I> : "Ị" U1ECA # LATIN CAPITAL LETTER I WITH DOT BELOW
-<Multi_key> <exclam> <I> : "Ị" U1ECA # LATIN CAPITAL LETTER I WITH DOT BELOW
-<dead_belowdot> <i> : "ị" U1ECB # LATIN SMALL LETTER I WITH DOT BELOW
-<Multi_key> <exclam> <i> : "ị" U1ECB # LATIN SMALL LETTER I WITH DOT BELOW
-<dead_belowdot> <O> : "Ọ" U1ECC # LATIN CAPITAL LETTER O WITH DOT BELOW
-<Multi_key> <exclam> <O> : "Ọ" U1ECC # LATIN CAPITAL LETTER O WITH DOT BELOW
-<dead_belowdot> <o> : "ọ" U1ECD # LATIN SMALL LETTER O WITH DOT BELOW
-<Multi_key> <exclam> <o> : "ọ" U1ECD # LATIN SMALL LETTER O WITH DOT BELOW
-<dead_hook> <O> : "Ỏ" U1ECE # LATIN CAPITAL LETTER O WITH HOOK ABOVE
-<Multi_key> <question> <O> : "Ỏ" U1ECE # LATIN CAPITAL LETTER O WITH HOOK ABOVE
-<dead_hook> <o> : "ỏ" U1ECF # LATIN SMALL LETTER O WITH HOOK ABOVE
-<Multi_key> <question> <o> : "ỏ" U1ECF # LATIN SMALL LETTER O WITH HOOK ABOVE
-<dead_acute> <Ocircumflex> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <Ocircumflex> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <Ocircumflex> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
-<dead_acute> <dead_circumflex> <O> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
-<dead_acute> <Multi_key> <asciicircum> <O> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <dead_circumflex> <O> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <asciicircum> <O> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <dead_circumflex> <O> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <asciicircum> <O> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
-<dead_acute> <ocircumflex> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <ocircumflex> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <ocircumflex> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
-<dead_acute> <dead_circumflex> <o> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
-<dead_acute> <Multi_key> <asciicircum> <o> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <dead_circumflex> <o> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <acute> <asciicircum> <o> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <dead_circumflex> <o> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
-<Multi_key> <apostrophe> <asciicircum> <o> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
-<dead_grave> <Ocircumflex> : "Ồ" U1ED2 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <Ocircumflex> : "Ồ" U1ED2 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
-<dead_grave> <dead_circumflex> <O> : "Ồ" U1ED2 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
-<dead_grave> <Multi_key> <asciicircum> <O> : "Ồ" U1ED2 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <dead_circumflex> <O> : "Ồ" U1ED2 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <asciicircum> <O> : "Ồ" U1ED2 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
-<dead_grave> <ocircumflex> : "ồ" U1ED3 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <ocircumflex> : "ồ" U1ED3 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
-<dead_grave> <dead_circumflex> <o> : "ồ" U1ED3 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
-<dead_grave> <Multi_key> <asciicircum> <o> : "ồ" U1ED3 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <dead_circumflex> <o> : "ồ" U1ED3 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
-<Multi_key> <grave> <asciicircum> <o> : "ồ" U1ED3 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
-<dead_hook> <Ocircumflex> : "Ổ" U1ED4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <Ocircumflex> : "Ổ" U1ED4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_hook> <dead_circumflex> <O> : "Ổ" U1ED4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_hook> <Multi_key> <asciicircum> <O> : "Ổ" U1ED4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <dead_circumflex> <O> : "Ổ" U1ED4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <asciicircum> <O> : "Ổ" U1ED4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_hook> <ocircumflex> : "ổ" U1ED5 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <ocircumflex> : "ổ" U1ED5 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_hook> <dead_circumflex> <o> : "ổ" U1ED5 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_hook> <Multi_key> <asciicircum> <o> : "ổ" U1ED5 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <dead_circumflex> <o> : "ổ" U1ED5 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-<Multi_key> <question> <asciicircum> <o> : "ổ" U1ED5 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_tilde> <Ocircumflex> : "Ỗ" U1ED6 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <Ocircumflex> : "Ỗ" U1ED6 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
-<dead_tilde> <dead_circumflex> <O> : "Ỗ" U1ED6 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
-<dead_tilde> <Multi_key> <asciicircum> <O> : "Ỗ" U1ED6 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <dead_circumflex> <O> : "Ỗ" U1ED6 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <asciicircum> <O> : "Ỗ" U1ED6 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
-<dead_tilde> <ocircumflex> : "ỗ" U1ED7 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <ocircumflex> : "ỗ" U1ED7 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
-<dead_tilde> <dead_circumflex> <o> : "ỗ" U1ED7 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
-<dead_tilde> <Multi_key> <asciicircum> <o> : "ỗ" U1ED7 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <dead_circumflex> <o> : "ỗ" U1ED7 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
-<Multi_key> <asciitilde> <asciicircum> <o> : "ỗ" U1ED7 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
-<dead_circumflex> <U1ECC> : "Ộ" U1ED8 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <U1ECC> : "Ộ" U1ED8 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-<dead_circumflex> <dead_belowdot> <O> : "Ộ" U1ED8 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-<dead_circumflex> <Multi_key> <exclam> <O> : "Ộ" U1ED8 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <dead_belowdot> <O> : "Ộ" U1ED8 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <exclam> <O> : "Ộ" U1ED8 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-<dead_belowdot> <Ocircumflex> : "Ộ" U1ED8 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-<dead_circumflex> <U1ECD> : "ộ" U1ED9 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <U1ECD> : "ộ" U1ED9 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-<dead_circumflex> <dead_belowdot> <o> : "ộ" U1ED9 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-<dead_circumflex> <Multi_key> <exclam> <o> : "ộ" U1ED9 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <dead_belowdot> <o> : "ộ" U1ED9 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-<Multi_key> <asciicircum> <exclam> <o> : "ộ" U1ED9 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-<dead_belowdot> <ocircumflex> : "ộ" U1ED9 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-<dead_acute> <Ohorn> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
-<dead_acute> <U01A0> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
-<Multi_key> <acute> <Ohorn> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
-<Multi_key> <apostrophe> <Ohorn> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
-<dead_acute> <dead_horn> <O> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
-<dead_acute> <Multi_key> <plus> <O> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
-<Multi_key> <acute> <dead_horn> <O> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
-<Multi_key> <acute> <plus> <O> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
-<Multi_key> <apostrophe> <dead_horn> <O> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
-<Multi_key> <apostrophe> <plus> <O> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
-<dead_acute> <ohorn> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
-<dead_acute> <U01A1> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
-<Multi_key> <acute> <ohorn> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
-<Multi_key> <apostrophe> <ohorn> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
-<dead_acute> <dead_horn> <o> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
-<dead_acute> <Multi_key> <plus> <o> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
-<Multi_key> <acute> <dead_horn> <o> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
-<Multi_key> <acute> <plus> <o> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
-<Multi_key> <apostrophe> <dead_horn> <o> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
-<Multi_key> <apostrophe> <plus> <o> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
-<dead_grave> <Ohorn> : "Ờ" U1EDC # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
-<dead_grave> <U01A0> : "Ờ" U1EDC # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
-<Multi_key> <grave> <Ohorn> : "Ờ" U1EDC # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
-<dead_grave> <dead_horn> <O> : "Ờ" U1EDC # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
-<dead_grave> <Multi_key> <plus> <O> : "Ờ" U1EDC # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
-<Multi_key> <grave> <dead_horn> <O> : "Ờ" U1EDC # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
-<Multi_key> <grave> <plus> <O> : "Ờ" U1EDC # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
-<dead_grave> <ohorn> : "ờ" U1EDD # LATIN SMALL LETTER O WITH HORN AND GRAVE
-<dead_grave> <U01A1> : "ờ" U1EDD # LATIN SMALL LETTER O WITH HORN AND GRAVE
-<Multi_key> <grave> <ohorn> : "ờ" U1EDD # LATIN SMALL LETTER O WITH HORN AND GRAVE
-<dead_grave> <dead_horn> <o> : "ờ" U1EDD # LATIN SMALL LETTER O WITH HORN AND GRAVE
-<dead_grave> <Multi_key> <plus> <o> : "ờ" U1EDD # LATIN SMALL LETTER O WITH HORN AND GRAVE
-<Multi_key> <grave> <dead_horn> <o> : "ờ" U1EDD # LATIN SMALL LETTER O WITH HORN AND GRAVE
-<Multi_key> <grave> <plus> <o> : "ờ" U1EDD # LATIN SMALL LETTER O WITH HORN AND GRAVE
-<dead_hook> <Ohorn> : "Ở" U1EDE # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
-<dead_hook> <U01A0> : "Ở" U1EDE # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
-<Multi_key> <question> <Ohorn> : "Ở" U1EDE # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
-<dead_hook> <dead_horn> <O> : "Ở" U1EDE # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
-<dead_hook> <Multi_key> <plus> <O> : "Ở" U1EDE # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
-<Multi_key> <question> <dead_horn> <O> : "Ở" U1EDE # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
-<Multi_key> <question> <plus> <O> : "Ở" U1EDE # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
-<dead_hook> <ohorn> : "ở" U1EDF # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
-<dead_hook> <U01A1> : "ở" U1EDF # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
-<Multi_key> <question> <ohorn> : "ở" U1EDF # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
-<dead_hook> <dead_horn> <o> : "ở" U1EDF # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
-<dead_hook> <Multi_key> <plus> <o> : "ở" U1EDF # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
-<Multi_key> <question> <dead_horn> <o> : "ở" U1EDF # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
-<Multi_key> <question> <plus> <o> : "ở" U1EDF # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
-<dead_tilde> <Ohorn> : "Ỡ" U1EE0 # LATIN CAPITAL LETTER O WITH HORN AND TILDE
-<dead_tilde> <U01A0> : "Ỡ" U1EE0 # LATIN CAPITAL LETTER O WITH HORN AND TILDE
-<Multi_key> <asciitilde> <Ohorn> : "Ỡ" U1EE0 # LATIN CAPITAL LETTER O WITH HORN AND TILDE
-<dead_tilde> <dead_horn> <O> : "Ỡ" U1EE0 # LATIN CAPITAL LETTER O WITH HORN AND TILDE
-<dead_tilde> <Multi_key> <plus> <O> : "Ỡ" U1EE0 # LATIN CAPITAL LETTER O WITH HORN AND TILDE
-<Multi_key> <asciitilde> <dead_horn> <O> : "Ỡ" U1EE0 # LATIN CAPITAL LETTER O WITH HORN AND TILDE
-<Multi_key> <asciitilde> <plus> <O> : "Ỡ" U1EE0 # LATIN CAPITAL LETTER O WITH HORN AND TILDE
-<dead_tilde> <ohorn> : "ỡ" U1EE1 # LATIN SMALL LETTER O WITH HORN AND TILDE
-<dead_tilde> <U01A1> : "ỡ" U1EE1 # LATIN SMALL LETTER O WITH HORN AND TILDE
-<Multi_key> <asciitilde> <ohorn> : "ỡ" U1EE1 # LATIN SMALL LETTER O WITH HORN AND TILDE
-<dead_tilde> <dead_horn> <o> : "ỡ" U1EE1 # LATIN SMALL LETTER O WITH HORN AND TILDE
-<dead_tilde> <Multi_key> <plus> <o> : "ỡ" U1EE1 # LATIN SMALL LETTER O WITH HORN AND TILDE
-<Multi_key> <asciitilde> <dead_horn> <o> : "ỡ" U1EE1 # LATIN SMALL LETTER O WITH HORN AND TILDE
-<Multi_key> <asciitilde> <plus> <o> : "ỡ" U1EE1 # LATIN SMALL LETTER O WITH HORN AND TILDE
-<dead_belowdot> <Ohorn> : "Ợ" U1EE2 # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
-<dead_belowdot> <U01A0> : "Ợ" U1EE2 # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
-<Multi_key> <exclam> <Ohorn> : "Ợ" U1EE2 # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
-<dead_belowdot> <dead_horn> <O> : "Ợ" U1EE2 # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
-<dead_belowdot> <Multi_key> <plus> <O> : "Ợ" U1EE2 # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
-<Multi_key> <exclam> <dead_horn> <O> : "Ợ" U1EE2 # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
-<Multi_key> <exclam> <plus> <O> : "Ợ" U1EE2 # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
-<dead_belowdot> <ohorn> : "ợ" U1EE3 # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
-<dead_belowdot> <U01A1> : "ợ" U1EE3 # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
-<Multi_key> <exclam> <ohorn> : "ợ" U1EE3 # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
-<dead_belowdot> <dead_horn> <o> : "ợ" U1EE3 # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
-<dead_belowdot> <Multi_key> <plus> <o> : "ợ" U1EE3 # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
-<Multi_key> <exclam> <dead_horn> <o> : "ợ" U1EE3 # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
-<Multi_key> <exclam> <plus> <o> : "ợ" U1EE3 # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
-<dead_belowdot> <U> : "Ụ" U1EE4 # LATIN CAPITAL LETTER U WITH DOT BELOW
-<Multi_key> <exclam> <U> : "Ụ" U1EE4 # LATIN CAPITAL LETTER U WITH DOT BELOW
-<dead_belowdot> <u> : "ụ" U1EE5 # LATIN SMALL LETTER U WITH DOT BELOW
-<Multi_key> <exclam> <u> : "ụ" U1EE5 # LATIN SMALL LETTER U WITH DOT BELOW
-<dead_hook> <U> : "Ủ" U1EE6 # LATIN CAPITAL LETTER U WITH HOOK ABOVE
-<Multi_key> <question> <U> : "Ủ" U1EE6 # LATIN CAPITAL LETTER U WITH HOOK ABOVE
-<dead_hook> <u> : "ủ" U1EE7 # LATIN SMALL LETTER U WITH HOOK ABOVE
-<Multi_key> <question> <u> : "ủ" U1EE7 # LATIN SMALL LETTER U WITH HOOK ABOVE
-<dead_acute> <Uhorn> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
-<dead_acute> <U01AF> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
-<Multi_key> <acute> <Uhorn> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
-<Multi_key> <apostrophe> <Uhorn> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
-<dead_acute> <dead_horn> <U> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
-<dead_acute> <Multi_key> <plus> <U> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
-<Multi_key> <acute> <dead_horn> <U> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
-<Multi_key> <acute> <plus> <U> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
-<Multi_key> <apostrophe> <dead_horn> <U> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
-<Multi_key> <apostrophe> <plus> <U> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
-<dead_acute> <uhorn> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
-<dead_acute> <U01B0> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
-<Multi_key> <acute> <uhorn> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
-<Multi_key> <apostrophe> <uhorn> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
-<dead_acute> <dead_horn> <u> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
-<dead_acute> <Multi_key> <plus> <u> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
-<Multi_key> <acute> <dead_horn> <u> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
-<Multi_key> <acute> <plus> <u> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
-<Multi_key> <apostrophe> <dead_horn> <u> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
-<Multi_key> <apostrophe> <plus> <u> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
-<dead_grave> <Uhorn> : "Ừ" U1EEA # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
-<dead_grave> <U01AF> : "Ừ" U1EEA # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
-<Multi_key> <grave> <Uhorn> : "Ừ" U1EEA # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
-<dead_grave> <dead_horn> <U> : "Ừ" U1EEA # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
-<dead_grave> <Multi_key> <plus> <U> : "Ừ" U1EEA # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
-<Multi_key> <grave> <dead_horn> <U> : "Ừ" U1EEA # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
-<Multi_key> <grave> <plus> <U> : "Ừ" U1EEA # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
-<dead_grave> <uhorn> : "ừ" U1EEB # LATIN SMALL LETTER U WITH HORN AND GRAVE
-<dead_grave> <U01B0> : "ừ" U1EEB # LATIN SMALL LETTER U WITH HORN AND GRAVE
-<Multi_key> <grave> <uhorn> : "ừ" U1EEB # LATIN SMALL LETTER U WITH HORN AND GRAVE
-<dead_grave> <dead_horn> <u> : "ừ" U1EEB # LATIN SMALL LETTER U WITH HORN AND GRAVE
-<dead_grave> <Multi_key> <plus> <u> : "ừ" U1EEB # LATIN SMALL LETTER U WITH HORN AND GRAVE
-<Multi_key> <grave> <dead_horn> <u> : "ừ" U1EEB # LATIN SMALL LETTER U WITH HORN AND GRAVE
-<Multi_key> <grave> <plus> <u> : "ừ" U1EEB # LATIN SMALL LETTER U WITH HORN AND GRAVE
-<dead_hook> <Uhorn> : "Ử" U1EEC # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
-<dead_hook> <U01AF> : "Ử" U1EEC # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
-<Multi_key> <question> <Uhorn> : "Ử" U1EEC # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
-<dead_hook> <dead_horn> <U> : "Ử" U1EEC # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
-<dead_hook> <Multi_key> <plus> <U> : "Ử" U1EEC # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
-<Multi_key> <question> <dead_horn> <U> : "Ử" U1EEC # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
-<Multi_key> <question> <plus> <U> : "Ử" U1EEC # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
-<dead_hook> <uhorn> : "ử" U1EED # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
-<dead_hook> <U01B0> : "ử" U1EED # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
-<Multi_key> <question> <uhorn> : "ử" U1EED # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
-<dead_hook> <dead_horn> <u> : "ử" U1EED # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
-<dead_hook> <Multi_key> <plus> <u> : "ử" U1EED # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
-<Multi_key> <question> <dead_horn> <u> : "ử" U1EED # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
-<Multi_key> <question> <plus> <u> : "ử" U1EED # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
-<dead_tilde> <Uhorn> : "Ữ" U1EEE # LATIN CAPITAL LETTER U WITH HORN AND TILDE
-<dead_tilde> <U01AF> : "Ữ" U1EEE # LATIN CAPITAL LETTER U WITH HORN AND TILDE
-<Multi_key> <asciitilde> <Uhorn> : "Ữ" U1EEE # LATIN CAPITAL LETTER U WITH HORN AND TILDE
-<dead_tilde> <dead_horn> <U> : "Ữ" U1EEE # LATIN CAPITAL LETTER U WITH HORN AND TILDE
-<dead_tilde> <Multi_key> <plus> <U> : "Ữ" U1EEE # LATIN CAPITAL LETTER U WITH HORN AND TILDE
-<Multi_key> <asciitilde> <dead_horn> <U> : "Ữ" U1EEE # LATIN CAPITAL LETTER U WITH HORN AND TILDE
-<Multi_key> <asciitilde> <plus> <U> : "Ữ" U1EEE # LATIN CAPITAL LETTER U WITH HORN AND TILDE
-<dead_tilde> <uhorn> : "ữ" U1EEF # LATIN SMALL LETTER U WITH HORN AND TILDE
-<dead_tilde> <U01B0> : "ữ" U1EEF # LATIN SMALL LETTER U WITH HORN AND TILDE
-<Multi_key> <asciitilde> <uhorn> : "ữ" U1EEF # LATIN SMALL LETTER U WITH HORN AND TILDE
-<dead_tilde> <dead_horn> <u> : "ữ" U1EEF # LATIN SMALL LETTER U WITH HORN AND TILDE
-<dead_tilde> <Multi_key> <plus> <u> : "ữ" U1EEF # LATIN SMALL LETTER U WITH HORN AND TILDE
-<Multi_key> <asciitilde> <dead_horn> <u> : "ữ" U1EEF # LATIN SMALL LETTER U WITH HORN AND TILDE
-<Multi_key> <asciitilde> <plus> <u> : "ữ" U1EEF # LATIN SMALL LETTER U WITH HORN AND TILDE
-<dead_belowdot> <Uhorn> : "Ự" U1EF0 # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
-<dead_belowdot> <U01AF> : "Ự" U1EF0 # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
-<Multi_key> <exclam> <Uhorn> : "Ự" U1EF0 # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
-<dead_belowdot> <dead_horn> <U> : "Ự" U1EF0 # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
-<dead_belowdot> <Multi_key> <plus> <U> : "Ự" U1EF0 # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
-<Multi_key> <exclam> <dead_horn> <U> : "Ự" U1EF0 # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
-<Multi_key> <exclam> <plus> <U> : "Ự" U1EF0 # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
-<dead_belowdot> <uhorn> : "ự" U1EF1 # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
-<dead_belowdot> <U01B0> : "ự" U1EF1 # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
-<Multi_key> <exclam> <uhorn> : "ự" U1EF1 # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
-<dead_belowdot> <dead_horn> <u> : "ự" U1EF1 # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
-<dead_belowdot> <Multi_key> <plus> <u> : "ự" U1EF1 # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
-<Multi_key> <exclam> <dead_horn> <u> : "ự" U1EF1 # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
-<Multi_key> <exclam> <plus> <u> : "ự" U1EF1 # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
-<dead_grave> <Y> : "Ỳ" U1EF2 # LATIN CAPITAL LETTER Y WITH GRAVE
-<Multi_key> <grave> <Y> : "Ỳ" U1EF2 # LATIN CAPITAL LETTER Y WITH GRAVE
-<dead_grave> <y> : "ỳ" U1EF3 # LATIN SMALL LETTER Y WITH GRAVE
-<Multi_key> <grave> <y> : "ỳ" U1EF3 # LATIN SMALL LETTER Y WITH GRAVE
-<dead_belowdot> <Y> : "Ỵ" U1EF4 # LATIN CAPITAL LETTER Y WITH DOT BELOW
-<Multi_key> <exclam> <Y> : "Ỵ" U1EF4 # LATIN CAPITAL LETTER Y WITH DOT BELOW
-<dead_belowdot> <y> : "ỵ" U1EF5 # LATIN SMALL LETTER Y WITH DOT BELOW
-<Multi_key> <exclam> <y> : "ỵ" U1EF5 # LATIN SMALL LETTER Y WITH DOT BELOW
-<dead_hook> <Y> : "Ỷ" U1EF6 # LATIN CAPITAL LETTER Y WITH HOOK ABOVE
-<Multi_key> <question> <Y> : "Ỷ" U1EF6 # LATIN CAPITAL LETTER Y WITH HOOK ABOVE
-<dead_hook> <y> : "ỷ" U1EF7 # LATIN SMALL LETTER Y WITH HOOK ABOVE
-<Multi_key> <question> <y> : "ỷ" U1EF7 # LATIN SMALL LETTER Y WITH HOOK ABOVE
-<dead_tilde> <Y> : "Ỹ" U1EF8 # LATIN CAPITAL LETTER Y WITH TILDE
-<Multi_key> <asciitilde> <Y> : "Ỹ" U1EF8 # LATIN CAPITAL LETTER Y WITH TILDE
-<dead_tilde> <y> : "ỹ" U1EF9 # LATIN SMALL LETTER Y WITH TILDE
-<Multi_key> <asciitilde> <y> : "ỹ" U1EF9 # LATIN SMALL LETTER Y WITH TILDE
-<dead_psili> <Greek_alpha> : "ἀ" U1F00 # GREEK SMALL LETTER ALPHA WITH PSILI
-<Multi_key> <parenright> <Greek_alpha> : "ἀ" U1F00 # GREEK SMALL LETTER ALPHA WITH PSILI
-<dead_dasia> <Greek_alpha> : "ἁ" U1F01 # GREEK SMALL LETTER ALPHA WITH DASIA
-<Multi_key> <parenleft> <Greek_alpha> : "ἁ" U1F01 # GREEK SMALL LETTER ALPHA WITH DASIA
-<dead_grave> <U1F00> : "ἂ" U1F02 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA
-<Multi_key> <grave> <U1F00> : "ἂ" U1F02 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA
-<dead_grave> <dead_psili> <Greek_alpha> : "ἂ" U1F02 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA
-<dead_grave> <Multi_key> <parenright> <Greek_alpha> : "ἂ" U1F02 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA
-<Multi_key> <grave> <dead_psili> <Greek_alpha> : "ἂ" U1F02 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA
-<Multi_key> <grave> <parenright> <Greek_alpha> : "ἂ" U1F02 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA
-<dead_grave> <U1F01> : "ἃ" U1F03 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA
-<Multi_key> <grave> <U1F01> : "ἃ" U1F03 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA
-<dead_grave> <dead_dasia> <Greek_alpha> : "ἃ" U1F03 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA
-<dead_grave> <Multi_key> <parenleft> <Greek_alpha> : "ἃ" U1F03 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA
-<Multi_key> <grave> <dead_dasia> <Greek_alpha> : "ἃ" U1F03 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA
-<Multi_key> <grave> <parenleft> <Greek_alpha> : "ἃ" U1F03 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA
-<dead_acute> <U1F00> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
-<Multi_key> <acute> <U1F00> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <U1F00> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
-<dead_acute> <dead_psili> <Greek_alpha> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
-<dead_acute> <Multi_key> <parenright> <Greek_alpha> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
-<Multi_key> <acute> <dead_psili> <Greek_alpha> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
-<Multi_key> <acute> <parenright> <Greek_alpha> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <dead_psili> <Greek_alpha> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <parenright> <Greek_alpha> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
-<dead_acute> <U1F01> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
-<Multi_key> <acute> <U1F01> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <U1F01> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
-<dead_acute> <dead_dasia> <Greek_alpha> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
-<dead_acute> <Multi_key> <parenleft> <Greek_alpha> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
-<Multi_key> <acute> <dead_dasia> <Greek_alpha> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
-<Multi_key> <acute> <parenleft> <Greek_alpha> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <dead_dasia> <Greek_alpha> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <parenleft> <Greek_alpha> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
-<dead_tilde> <U1F00> : "ἆ" U1F06 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F00> : "ἆ" U1F06 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI
-<dead_tilde> <dead_psili> <Greek_alpha> : "ἆ" U1F06 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenright> <Greek_alpha> : "ἆ" U1F06 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_psili> <Greek_alpha> : "ἆ" U1F06 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <parenright> <Greek_alpha> : "ἆ" U1F06 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI
-<dead_tilde> <U1F01> : "ἇ" U1F07 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F01> : "ἇ" U1F07 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
-<dead_tilde> <dead_dasia> <Greek_alpha> : "ἇ" U1F07 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenleft> <Greek_alpha> : "ἇ" U1F07 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_dasia> <Greek_alpha> : "ἇ" U1F07 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <parenleft> <Greek_alpha> : "ἇ" U1F07 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
-<dead_psili> <Greek_ALPHA> : "Ἀ" U1F08 # GREEK CAPITAL LETTER ALPHA WITH PSILI
-<Multi_key> <parenright> <Greek_ALPHA> : "Ἀ" U1F08 # GREEK CAPITAL LETTER ALPHA WITH PSILI
-<dead_dasia> <Greek_ALPHA> : "Ἁ" U1F09 # GREEK CAPITAL LETTER ALPHA WITH DASIA
-<Multi_key> <parenleft> <Greek_ALPHA> : "Ἁ" U1F09 # GREEK CAPITAL LETTER ALPHA WITH DASIA
-<dead_grave> <U1F08> : "Ἂ" U1F0A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA
-<Multi_key> <grave> <U1F08> : "Ἂ" U1F0A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA
-<dead_grave> <dead_psili> <Greek_ALPHA> : "Ἂ" U1F0A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA
-<dead_grave> <Multi_key> <parenright> <Greek_ALPHA> : "Ἂ" U1F0A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA
-<Multi_key> <grave> <dead_psili> <Greek_ALPHA> : "Ἂ" U1F0A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA
-<Multi_key> <grave> <parenright> <Greek_ALPHA> : "Ἂ" U1F0A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA
-<dead_grave> <U1F09> : "Ἃ" U1F0B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA
-<Multi_key> <grave> <U1F09> : "Ἃ" U1F0B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA
-<dead_grave> <dead_dasia> <Greek_ALPHA> : "Ἃ" U1F0B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA
-<dead_grave> <Multi_key> <parenleft> <Greek_ALPHA> : "Ἃ" U1F0B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA
-<Multi_key> <grave> <dead_dasia> <Greek_ALPHA> : "Ἃ" U1F0B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA
-<Multi_key> <grave> <parenleft> <Greek_ALPHA> : "Ἃ" U1F0B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA
-<dead_acute> <U1F08> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
-<Multi_key> <acute> <U1F08> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <U1F08> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
-<dead_acute> <dead_psili> <Greek_ALPHA> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
-<dead_acute> <Multi_key> <parenright> <Greek_ALPHA> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
-<Multi_key> <acute> <dead_psili> <Greek_ALPHA> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
-<Multi_key> <acute> <parenright> <Greek_ALPHA> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <dead_psili> <Greek_ALPHA> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <parenright> <Greek_ALPHA> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
-<dead_acute> <U1F09> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
-<Multi_key> <acute> <U1F09> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <U1F09> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
-<dead_acute> <dead_dasia> <Greek_ALPHA> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
-<dead_acute> <Multi_key> <parenleft> <Greek_ALPHA> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
-<Multi_key> <acute> <dead_dasia> <Greek_ALPHA> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
-<Multi_key> <acute> <parenleft> <Greek_ALPHA> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <dead_dasia> <Greek_ALPHA> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <parenleft> <Greek_ALPHA> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
-<dead_tilde> <U1F08> : "Ἆ" U1F0E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F08> : "Ἆ" U1F0E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI
-<dead_tilde> <dead_psili> <Greek_ALPHA> : "Ἆ" U1F0E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenright> <Greek_ALPHA> : "Ἆ" U1F0E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_psili> <Greek_ALPHA> : "Ἆ" U1F0E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <parenright> <Greek_ALPHA> : "Ἆ" U1F0E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI
-<dead_tilde> <U1F09> : "Ἇ" U1F0F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F09> : "Ἇ" U1F0F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
-<dead_tilde> <dead_dasia> <Greek_ALPHA> : "Ἇ" U1F0F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenleft> <Greek_ALPHA> : "Ἇ" U1F0F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_dasia> <Greek_ALPHA> : "Ἇ" U1F0F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <parenleft> <Greek_ALPHA> : "Ἇ" U1F0F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
-<dead_psili> <Greek_epsilon> : "ἐ" U1F10 # GREEK SMALL LETTER EPSILON WITH PSILI
-<Multi_key> <parenright> <Greek_epsilon> : "ἐ" U1F10 # GREEK SMALL LETTER EPSILON WITH PSILI
-<dead_dasia> <Greek_epsilon> : "ἑ" U1F11 # GREEK SMALL LETTER EPSILON WITH DASIA
-<Multi_key> <parenleft> <Greek_epsilon> : "ἑ" U1F11 # GREEK SMALL LETTER EPSILON WITH DASIA
-<dead_grave> <U1F10> : "ἒ" U1F12 # GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA
-<Multi_key> <grave> <U1F10> : "ἒ" U1F12 # GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA
-<dead_grave> <dead_psili> <Greek_epsilon> : "ἒ" U1F12 # GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA
-<dead_grave> <Multi_key> <parenright> <Greek_epsilon> : "ἒ" U1F12 # GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA
-<Multi_key> <grave> <dead_psili> <Greek_epsilon> : "ἒ" U1F12 # GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA
-<Multi_key> <grave> <parenright> <Greek_epsilon> : "ἒ" U1F12 # GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA
-<dead_grave> <U1F11> : "ἓ" U1F13 # GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA
-<Multi_key> <grave> <U1F11> : "ἓ" U1F13 # GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA
-<dead_grave> <dead_dasia> <Greek_epsilon> : "ἓ" U1F13 # GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA
-<dead_grave> <Multi_key> <parenleft> <Greek_epsilon> : "ἓ" U1F13 # GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA
-<Multi_key> <grave> <dead_dasia> <Greek_epsilon> : "ἓ" U1F13 # GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA
-<Multi_key> <grave> <parenleft> <Greek_epsilon> : "ἓ" U1F13 # GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA
-<dead_acute> <U1F10> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
-<Multi_key> <acute> <U1F10> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <U1F10> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
-<dead_acute> <dead_psili> <Greek_epsilon> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
-<dead_acute> <Multi_key> <parenright> <Greek_epsilon> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
-<Multi_key> <acute> <dead_psili> <Greek_epsilon> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
-<Multi_key> <acute> <parenright> <Greek_epsilon> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <dead_psili> <Greek_epsilon> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <parenright> <Greek_epsilon> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
-<dead_acute> <U1F11> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
-<Multi_key> <acute> <U1F11> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <U1F11> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
-<dead_acute> <dead_dasia> <Greek_epsilon> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
-<dead_acute> <Multi_key> <parenleft> <Greek_epsilon> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
-<Multi_key> <acute> <dead_dasia> <Greek_epsilon> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
-<Multi_key> <acute> <parenleft> <Greek_epsilon> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <dead_dasia> <Greek_epsilon> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <parenleft> <Greek_epsilon> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
-<dead_psili> <Greek_EPSILON> : "Ἐ" U1F18 # GREEK CAPITAL LETTER EPSILON WITH PSILI
-<Multi_key> <parenright> <Greek_EPSILON> : "Ἐ" U1F18 # GREEK CAPITAL LETTER EPSILON WITH PSILI
-<dead_dasia> <Greek_EPSILON> : "Ἑ" U1F19 # GREEK CAPITAL LETTER EPSILON WITH DASIA
-<Multi_key> <parenleft> <Greek_EPSILON> : "Ἑ" U1F19 # GREEK CAPITAL LETTER EPSILON WITH DASIA
-<dead_grave> <U1F18> : "Ἒ" U1F1A # GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA
-<Multi_key> <grave> <U1F18> : "Ἒ" U1F1A # GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA
-<dead_grave> <dead_psili> <Greek_EPSILON> : "Ἒ" U1F1A # GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA
-<dead_grave> <Multi_key> <parenright> <Greek_EPSILON> : "Ἒ" U1F1A # GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA
-<Multi_key> <grave> <dead_psili> <Greek_EPSILON> : "Ἒ" U1F1A # GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA
-<Multi_key> <grave> <parenright> <Greek_EPSILON> : "Ἒ" U1F1A # GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA
-<dead_grave> <U1F19> : "Ἓ" U1F1B # GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA
-<Multi_key> <grave> <U1F19> : "Ἓ" U1F1B # GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA
-<dead_grave> <dead_dasia> <Greek_EPSILON> : "Ἓ" U1F1B # GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA
-<dead_grave> <Multi_key> <parenleft> <Greek_EPSILON> : "Ἓ" U1F1B # GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA
-<Multi_key> <grave> <dead_dasia> <Greek_EPSILON> : "Ἓ" U1F1B # GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA
-<Multi_key> <grave> <parenleft> <Greek_EPSILON> : "Ἓ" U1F1B # GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA
-<dead_acute> <U1F18> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
-<Multi_key> <acute> <U1F18> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <U1F18> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
-<dead_acute> <dead_psili> <Greek_EPSILON> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
-<dead_acute> <Multi_key> <parenright> <Greek_EPSILON> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
-<Multi_key> <acute> <dead_psili> <Greek_EPSILON> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
-<Multi_key> <acute> <parenright> <Greek_EPSILON> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <dead_psili> <Greek_EPSILON> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <parenright> <Greek_EPSILON> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
-<dead_acute> <U1F19> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
-<Multi_key> <acute> <U1F19> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <U1F19> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
-<dead_acute> <dead_dasia> <Greek_EPSILON> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
-<dead_acute> <Multi_key> <parenleft> <Greek_EPSILON> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
-<Multi_key> <acute> <dead_dasia> <Greek_EPSILON> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
-<Multi_key> <acute> <parenleft> <Greek_EPSILON> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <dead_dasia> <Greek_EPSILON> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <parenleft> <Greek_EPSILON> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
-<dead_psili> <Greek_eta> : "ἠ" U1F20 # GREEK SMALL LETTER ETA WITH PSILI
-<Multi_key> <parenright> <Greek_eta> : "ἠ" U1F20 # GREEK SMALL LETTER ETA WITH PSILI
-<dead_dasia> <Greek_eta> : "ἡ" U1F21 # GREEK SMALL LETTER ETA WITH DASIA
-<Multi_key> <parenleft> <Greek_eta> : "ἡ" U1F21 # GREEK SMALL LETTER ETA WITH DASIA
-<dead_grave> <U1F20> : "ἢ" U1F22 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA
-<Multi_key> <grave> <U1F20> : "ἢ" U1F22 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA
-<dead_grave> <dead_psili> <Greek_eta> : "ἢ" U1F22 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA
-<dead_grave> <Multi_key> <parenright> <Greek_eta> : "ἢ" U1F22 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA
-<Multi_key> <grave> <dead_psili> <Greek_eta> : "ἢ" U1F22 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA
-<Multi_key> <grave> <parenright> <Greek_eta> : "ἢ" U1F22 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA
-<dead_grave> <U1F21> : "ἣ" U1F23 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA
-<Multi_key> <grave> <U1F21> : "ἣ" U1F23 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA
-<dead_grave> <dead_dasia> <Greek_eta> : "ἣ" U1F23 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA
-<dead_grave> <Multi_key> <parenleft> <Greek_eta> : "ἣ" U1F23 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA
-<Multi_key> <grave> <dead_dasia> <Greek_eta> : "ἣ" U1F23 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA
-<Multi_key> <grave> <parenleft> <Greek_eta> : "ἣ" U1F23 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA
-<dead_acute> <U1F20> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
-<Multi_key> <acute> <U1F20> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <U1F20> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
-<dead_acute> <dead_psili> <Greek_eta> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
-<dead_acute> <Multi_key> <parenright> <Greek_eta> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
-<Multi_key> <acute> <dead_psili> <Greek_eta> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
-<Multi_key> <acute> <parenright> <Greek_eta> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <dead_psili> <Greek_eta> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <parenright> <Greek_eta> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
-<dead_acute> <U1F21> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
-<Multi_key> <acute> <U1F21> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <U1F21> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
-<dead_acute> <dead_dasia> <Greek_eta> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
-<dead_acute> <Multi_key> <parenleft> <Greek_eta> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
-<Multi_key> <acute> <dead_dasia> <Greek_eta> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
-<Multi_key> <acute> <parenleft> <Greek_eta> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <dead_dasia> <Greek_eta> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <parenleft> <Greek_eta> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
-<dead_tilde> <U1F20> : "ἦ" U1F26 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F20> : "ἦ" U1F26 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI
-<dead_tilde> <dead_psili> <Greek_eta> : "ἦ" U1F26 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenright> <Greek_eta> : "ἦ" U1F26 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_psili> <Greek_eta> : "ἦ" U1F26 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <parenright> <Greek_eta> : "ἦ" U1F26 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI
-<dead_tilde> <U1F21> : "ἧ" U1F27 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F21> : "ἧ" U1F27 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
-<dead_tilde> <dead_dasia> <Greek_eta> : "ἧ" U1F27 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenleft> <Greek_eta> : "ἧ" U1F27 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_dasia> <Greek_eta> : "ἧ" U1F27 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <parenleft> <Greek_eta> : "ἧ" U1F27 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
-<dead_psili> <Greek_ETA> : "Ἠ" U1F28 # GREEK CAPITAL LETTER ETA WITH PSILI
-<Multi_key> <parenright> <Greek_ETA> : "Ἠ" U1F28 # GREEK CAPITAL LETTER ETA WITH PSILI
-<dead_dasia> <Greek_ETA> : "Ἡ" U1F29 # GREEK CAPITAL LETTER ETA WITH DASIA
-<Multi_key> <parenleft> <Greek_ETA> : "Ἡ" U1F29 # GREEK CAPITAL LETTER ETA WITH DASIA
-<dead_grave> <U1F28> : "Ἢ" U1F2A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA
-<Multi_key> <grave> <U1F28> : "Ἢ" U1F2A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA
-<dead_grave> <dead_psili> <Greek_ETA> : "Ἢ" U1F2A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA
-<dead_grave> <Multi_key> <parenright> <Greek_ETA> : "Ἢ" U1F2A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA
-<Multi_key> <grave> <dead_psili> <Greek_ETA> : "Ἢ" U1F2A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA
-<Multi_key> <grave> <parenright> <Greek_ETA> : "Ἢ" U1F2A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA
-<dead_grave> <U1F29> : "Ἣ" U1F2B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA
-<Multi_key> <grave> <U1F29> : "Ἣ" U1F2B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA
-<dead_grave> <dead_dasia> <Greek_ETA> : "Ἣ" U1F2B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA
-<dead_grave> <Multi_key> <parenleft> <Greek_ETA> : "Ἣ" U1F2B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA
-<Multi_key> <grave> <dead_dasia> <Greek_ETA> : "Ἣ" U1F2B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA
-<Multi_key> <grave> <parenleft> <Greek_ETA> : "Ἣ" U1F2B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA
-<dead_acute> <U1F28> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
-<Multi_key> <acute> <U1F28> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <U1F28> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
-<dead_acute> <dead_psili> <Greek_ETA> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
-<dead_acute> <Multi_key> <parenright> <Greek_ETA> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
-<Multi_key> <acute> <dead_psili> <Greek_ETA> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
-<Multi_key> <acute> <parenright> <Greek_ETA> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <dead_psili> <Greek_ETA> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <parenright> <Greek_ETA> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
-<dead_acute> <U1F29> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
-<Multi_key> <acute> <U1F29> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <U1F29> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
-<dead_acute> <dead_dasia> <Greek_ETA> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
-<dead_acute> <Multi_key> <parenleft> <Greek_ETA> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
-<Multi_key> <acute> <dead_dasia> <Greek_ETA> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
-<Multi_key> <acute> <parenleft> <Greek_ETA> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <dead_dasia> <Greek_ETA> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <parenleft> <Greek_ETA> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
-<dead_tilde> <U1F28> : "Ἦ" U1F2E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F28> : "Ἦ" U1F2E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI
-<dead_tilde> <dead_psili> <Greek_ETA> : "Ἦ" U1F2E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenright> <Greek_ETA> : "Ἦ" U1F2E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_psili> <Greek_ETA> : "Ἦ" U1F2E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <parenright> <Greek_ETA> : "Ἦ" U1F2E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI
-<dead_tilde> <U1F29> : "Ἧ" U1F2F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F29> : "Ἧ" U1F2F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
-<dead_tilde> <dead_dasia> <Greek_ETA> : "Ἧ" U1F2F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenleft> <Greek_ETA> : "Ἧ" U1F2F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_dasia> <Greek_ETA> : "Ἧ" U1F2F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <parenleft> <Greek_ETA> : "Ἧ" U1F2F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
-<dead_psili> <Greek_iota> : "ἰ" U1F30 # GREEK SMALL LETTER IOTA WITH PSILI
-<Multi_key> <parenright> <Greek_iota> : "ἰ" U1F30 # GREEK SMALL LETTER IOTA WITH PSILI
-<dead_dasia> <Greek_iota> : "ἱ" U1F31 # GREEK SMALL LETTER IOTA WITH DASIA
-<Multi_key> <parenleft> <Greek_iota> : "ἱ" U1F31 # GREEK SMALL LETTER IOTA WITH DASIA
-<dead_grave> <U1F30> : "ἲ" U1F32 # GREEK SMALL LETTER IOTA WITH PSILI AND VARIA
-<Multi_key> <grave> <U1F30> : "ἲ" U1F32 # GREEK SMALL LETTER IOTA WITH PSILI AND VARIA
-<dead_grave> <dead_psili> <Greek_iota> : "ἲ" U1F32 # GREEK SMALL LETTER IOTA WITH PSILI AND VARIA
-<dead_grave> <Multi_key> <parenright> <Greek_iota> : "ἲ" U1F32 # GREEK SMALL LETTER IOTA WITH PSILI AND VARIA
-<Multi_key> <grave> <dead_psili> <Greek_iota> : "ἲ" U1F32 # GREEK SMALL LETTER IOTA WITH PSILI AND VARIA
-<Multi_key> <grave> <parenright> <Greek_iota> : "ἲ" U1F32 # GREEK SMALL LETTER IOTA WITH PSILI AND VARIA
-<dead_grave> <U1F31> : "ἳ" U1F33 # GREEK SMALL LETTER IOTA WITH DASIA AND VARIA
-<Multi_key> <grave> <U1F31> : "ἳ" U1F33 # GREEK SMALL LETTER IOTA WITH DASIA AND VARIA
-<dead_grave> <dead_dasia> <Greek_iota> : "ἳ" U1F33 # GREEK SMALL LETTER IOTA WITH DASIA AND VARIA
-<dead_grave> <Multi_key> <parenleft> <Greek_iota> : "ἳ" U1F33 # GREEK SMALL LETTER IOTA WITH DASIA AND VARIA
-<Multi_key> <grave> <dead_dasia> <Greek_iota> : "ἳ" U1F33 # GREEK SMALL LETTER IOTA WITH DASIA AND VARIA
-<Multi_key> <grave> <parenleft> <Greek_iota> : "ἳ" U1F33 # GREEK SMALL LETTER IOTA WITH DASIA AND VARIA
-<dead_acute> <U1F30> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
-<Multi_key> <acute> <U1F30> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <U1F30> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
-<dead_acute> <dead_psili> <Greek_iota> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
-<dead_acute> <Multi_key> <parenright> <Greek_iota> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
-<Multi_key> <acute> <dead_psili> <Greek_iota> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
-<Multi_key> <acute> <parenright> <Greek_iota> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <dead_psili> <Greek_iota> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <parenright> <Greek_iota> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
-<dead_acute> <U1F31> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
-<Multi_key> <acute> <U1F31> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <U1F31> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
-<dead_acute> <dead_dasia> <Greek_iota> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
-<dead_acute> <Multi_key> <parenleft> <Greek_iota> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
-<Multi_key> <acute> <dead_dasia> <Greek_iota> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
-<Multi_key> <acute> <parenleft> <Greek_iota> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <dead_dasia> <Greek_iota> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <parenleft> <Greek_iota> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
-<dead_tilde> <U1F30> : "ἶ" U1F36 # GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F30> : "ἶ" U1F36 # GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI
-<dead_tilde> <dead_psili> <Greek_iota> : "ἶ" U1F36 # GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenright> <Greek_iota> : "ἶ" U1F36 # GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_psili> <Greek_iota> : "ἶ" U1F36 # GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <parenright> <Greek_iota> : "ἶ" U1F36 # GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI
-<dead_tilde> <U1F31> : "ἷ" U1F37 # GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F31> : "ἷ" U1F37 # GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
-<dead_tilde> <dead_dasia> <Greek_iota> : "ἷ" U1F37 # GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenleft> <Greek_iota> : "ἷ" U1F37 # GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_dasia> <Greek_iota> : "ἷ" U1F37 # GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <parenleft> <Greek_iota> : "ἷ" U1F37 # GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
-<dead_psili> <Greek_IOTA> : "Ἰ" U1F38 # GREEK CAPITAL LETTER IOTA WITH PSILI
-<Multi_key> <parenright> <Greek_IOTA> : "Ἰ" U1F38 # GREEK CAPITAL LETTER IOTA WITH PSILI
-<dead_dasia> <Greek_IOTA> : "Ἱ" U1F39 # GREEK CAPITAL LETTER IOTA WITH DASIA
-<Multi_key> <parenleft> <Greek_IOTA> : "Ἱ" U1F39 # GREEK CAPITAL LETTER IOTA WITH DASIA
-<dead_grave> <U1F38> : "Ἲ" U1F3A # GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA
-<Multi_key> <grave> <U1F38> : "Ἲ" U1F3A # GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA
-<dead_grave> <dead_psili> <Greek_IOTA> : "Ἲ" U1F3A # GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA
-<dead_grave> <Multi_key> <parenright> <Greek_IOTA> : "Ἲ" U1F3A # GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA
-<Multi_key> <grave> <dead_psili> <Greek_IOTA> : "Ἲ" U1F3A # GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA
-<Multi_key> <grave> <parenright> <Greek_IOTA> : "Ἲ" U1F3A # GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA
-<dead_grave> <U1F39> : "Ἳ" U1F3B # GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA
-<Multi_key> <grave> <U1F39> : "Ἳ" U1F3B # GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA
-<dead_grave> <dead_dasia> <Greek_IOTA> : "Ἳ" U1F3B # GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA
-<dead_grave> <Multi_key> <parenleft> <Greek_IOTA> : "Ἳ" U1F3B # GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA
-<Multi_key> <grave> <dead_dasia> <Greek_IOTA> : "Ἳ" U1F3B # GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA
-<Multi_key> <grave> <parenleft> <Greek_IOTA> : "Ἳ" U1F3B # GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA
-<dead_acute> <U1F38> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
-<Multi_key> <acute> <U1F38> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <U1F38> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
-<dead_acute> <dead_psili> <Greek_IOTA> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
-<dead_acute> <Multi_key> <parenright> <Greek_IOTA> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
-<Multi_key> <acute> <dead_psili> <Greek_IOTA> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
-<Multi_key> <acute> <parenright> <Greek_IOTA> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <dead_psili> <Greek_IOTA> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <parenright> <Greek_IOTA> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
-<dead_acute> <U1F39> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
-<Multi_key> <acute> <U1F39> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <U1F39> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
-<dead_acute> <dead_dasia> <Greek_IOTA> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
-<dead_acute> <Multi_key> <parenleft> <Greek_IOTA> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
-<Multi_key> <acute> <dead_dasia> <Greek_IOTA> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
-<Multi_key> <acute> <parenleft> <Greek_IOTA> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <dead_dasia> <Greek_IOTA> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <parenleft> <Greek_IOTA> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
-<dead_tilde> <U1F38> : "Ἶ" U1F3E # GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F38> : "Ἶ" U1F3E # GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI
-<dead_tilde> <dead_psili> <Greek_IOTA> : "Ἶ" U1F3E # GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenright> <Greek_IOTA> : "Ἶ" U1F3E # GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_psili> <Greek_IOTA> : "Ἶ" U1F3E # GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <parenright> <Greek_IOTA> : "Ἶ" U1F3E # GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI
-<dead_tilde> <U1F39> : "Ἷ" U1F3F # GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F39> : "Ἷ" U1F3F # GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI
-<dead_tilde> <dead_dasia> <Greek_IOTA> : "Ἷ" U1F3F # GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenleft> <Greek_IOTA> : "Ἷ" U1F3F # GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_dasia> <Greek_IOTA> : "Ἷ" U1F3F # GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <parenleft> <Greek_IOTA> : "Ἷ" U1F3F # GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI
-<dead_psili> <Greek_omicron> : "ὀ" U1F40 # GREEK SMALL LETTER OMICRON WITH PSILI
-<Multi_key> <parenright> <Greek_omicron> : "ὀ" U1F40 # GREEK SMALL LETTER OMICRON WITH PSILI
-<dead_dasia> <Greek_omicron> : "ὁ" U1F41 # GREEK SMALL LETTER OMICRON WITH DASIA
-<Multi_key> <parenleft> <Greek_omicron> : "ὁ" U1F41 # GREEK SMALL LETTER OMICRON WITH DASIA
-<dead_grave> <U1F40> : "ὂ" U1F42 # GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA
-<Multi_key> <grave> <U1F40> : "ὂ" U1F42 # GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA
-<dead_grave> <dead_psili> <Greek_omicron> : "ὂ" U1F42 # GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA
-<dead_grave> <Multi_key> <parenright> <Greek_omicron> : "ὂ" U1F42 # GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA
-<Multi_key> <grave> <dead_psili> <Greek_omicron> : "ὂ" U1F42 # GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA
-<Multi_key> <grave> <parenright> <Greek_omicron> : "ὂ" U1F42 # GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA
-<dead_grave> <U1F41> : "ὃ" U1F43 # GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA
-<Multi_key> <grave> <U1F41> : "ὃ" U1F43 # GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA
-<dead_grave> <dead_dasia> <Greek_omicron> : "ὃ" U1F43 # GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA
-<dead_grave> <Multi_key> <parenleft> <Greek_omicron> : "ὃ" U1F43 # GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA
-<Multi_key> <grave> <dead_dasia> <Greek_omicron> : "ὃ" U1F43 # GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA
-<Multi_key> <grave> <parenleft> <Greek_omicron> : "ὃ" U1F43 # GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA
-<dead_acute> <U1F40> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
-<Multi_key> <acute> <U1F40> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <U1F40> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
-<dead_acute> <dead_psili> <Greek_omicron> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
-<dead_acute> <Multi_key> <parenright> <Greek_omicron> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
-<Multi_key> <acute> <dead_psili> <Greek_omicron> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
-<Multi_key> <acute> <parenright> <Greek_omicron> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <dead_psili> <Greek_omicron> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <parenright> <Greek_omicron> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
-<dead_acute> <U1F41> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
-<Multi_key> <acute> <U1F41> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <U1F41> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
-<dead_acute> <dead_dasia> <Greek_omicron> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
-<dead_acute> <Multi_key> <parenleft> <Greek_omicron> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
-<Multi_key> <acute> <dead_dasia> <Greek_omicron> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
-<Multi_key> <acute> <parenleft> <Greek_omicron> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <dead_dasia> <Greek_omicron> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <parenleft> <Greek_omicron> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
-<dead_psili> <Greek_OMICRON> : "Ὀ" U1F48 # GREEK CAPITAL LETTER OMICRON WITH PSILI
-<Multi_key> <parenright> <Greek_OMICRON> : "Ὀ" U1F48 # GREEK CAPITAL LETTER OMICRON WITH PSILI
-<dead_dasia> <Greek_OMICRON> : "Ὁ" U1F49 # GREEK CAPITAL LETTER OMICRON WITH DASIA
-<Multi_key> <parenleft> <Greek_OMICRON> : "Ὁ" U1F49 # GREEK CAPITAL LETTER OMICRON WITH DASIA
-<dead_grave> <U1F48> : "Ὂ" U1F4A # GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA
-<Multi_key> <grave> <U1F48> : "Ὂ" U1F4A # GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA
-<dead_grave> <dead_psili> <Greek_OMICRON> : "Ὂ" U1F4A # GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA
-<dead_grave> <Multi_key> <parenright> <Greek_OMICRON> : "Ὂ" U1F4A # GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA
-<Multi_key> <grave> <dead_psili> <Greek_OMICRON> : "Ὂ" U1F4A # GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA
-<Multi_key> <grave> <parenright> <Greek_OMICRON> : "Ὂ" U1F4A # GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA
-<dead_grave> <U1F49> : "Ὃ" U1F4B # GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA
-<Multi_key> <grave> <U1F49> : "Ὃ" U1F4B # GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA
-<dead_grave> <dead_dasia> <Greek_OMICRON> : "Ὃ" U1F4B # GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA
-<dead_grave> <Multi_key> <parenleft> <Greek_OMICRON> : "Ὃ" U1F4B # GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA
-<Multi_key> <grave> <dead_dasia> <Greek_OMICRON> : "Ὃ" U1F4B # GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA
-<Multi_key> <grave> <parenleft> <Greek_OMICRON> : "Ὃ" U1F4B # GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA
-<dead_acute> <U1F48> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
-<Multi_key> <acute> <U1F48> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <U1F48> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
-<dead_acute> <dead_psili> <Greek_OMICRON> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
-<dead_acute> <Multi_key> <parenright> <Greek_OMICRON> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
-<Multi_key> <acute> <dead_psili> <Greek_OMICRON> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
-<Multi_key> <acute> <parenright> <Greek_OMICRON> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <dead_psili> <Greek_OMICRON> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <parenright> <Greek_OMICRON> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
-<dead_acute> <U1F49> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
-<Multi_key> <acute> <U1F49> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <U1F49> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
-<dead_acute> <dead_dasia> <Greek_OMICRON> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
-<dead_acute> <Multi_key> <parenleft> <Greek_OMICRON> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
-<Multi_key> <acute> <dead_dasia> <Greek_OMICRON> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
-<Multi_key> <acute> <parenleft> <Greek_OMICRON> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <dead_dasia> <Greek_OMICRON> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <parenleft> <Greek_OMICRON> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
-<dead_psili> <Greek_upsilon> : "ὐ" U1F50 # GREEK SMALL LETTER UPSILON WITH PSILI
-<Multi_key> <parenright> <Greek_upsilon> : "ὐ" U1F50 # GREEK SMALL LETTER UPSILON WITH PSILI
-<dead_dasia> <Greek_upsilon> : "ὑ" U1F51 # GREEK SMALL LETTER UPSILON WITH DASIA
-<Multi_key> <parenleft> <Greek_upsilon> : "ὑ" U1F51 # GREEK SMALL LETTER UPSILON WITH DASIA
-<dead_grave> <U1F50> : "ὒ" U1F52 # GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA
-<Multi_key> <grave> <U1F50> : "ὒ" U1F52 # GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA
-<dead_grave> <dead_psili> <Greek_upsilon> : "ὒ" U1F52 # GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA
-<dead_grave> <Multi_key> <parenright> <Greek_upsilon> : "ὒ" U1F52 # GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA
-<Multi_key> <grave> <dead_psili> <Greek_upsilon> : "ὒ" U1F52 # GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA
-<Multi_key> <grave> <parenright> <Greek_upsilon> : "ὒ" U1F52 # GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA
-<dead_grave> <U1F51> : "ὓ" U1F53 # GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA
-<Multi_key> <grave> <U1F51> : "ὓ" U1F53 # GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA
-<dead_grave> <dead_dasia> <Greek_upsilon> : "ὓ" U1F53 # GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA
-<dead_grave> <Multi_key> <parenleft> <Greek_upsilon> : "ὓ" U1F53 # GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA
-<Multi_key> <grave> <dead_dasia> <Greek_upsilon> : "ὓ" U1F53 # GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA
-<Multi_key> <grave> <parenleft> <Greek_upsilon> : "ὓ" U1F53 # GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA
-<dead_acute> <U1F50> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
-<Multi_key> <acute> <U1F50> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <U1F50> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
-<dead_acute> <dead_psili> <Greek_upsilon> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
-<dead_acute> <Multi_key> <parenright> <Greek_upsilon> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
-<Multi_key> <acute> <dead_psili> <Greek_upsilon> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
-<Multi_key> <acute> <parenright> <Greek_upsilon> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <dead_psili> <Greek_upsilon> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <parenright> <Greek_upsilon> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
-<dead_acute> <U1F51> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
-<Multi_key> <acute> <U1F51> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <U1F51> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
-<dead_acute> <dead_dasia> <Greek_upsilon> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
-<dead_acute> <Multi_key> <parenleft> <Greek_upsilon> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
-<Multi_key> <acute> <dead_dasia> <Greek_upsilon> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
-<Multi_key> <acute> <parenleft> <Greek_upsilon> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <dead_dasia> <Greek_upsilon> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <parenleft> <Greek_upsilon> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
-<dead_tilde> <U1F50> : "ὖ" U1F56 # GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F50> : "ὖ" U1F56 # GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI
-<dead_tilde> <dead_psili> <Greek_upsilon> : "ὖ" U1F56 # GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenright> <Greek_upsilon> : "ὖ" U1F56 # GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_psili> <Greek_upsilon> : "ὖ" U1F56 # GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <parenright> <Greek_upsilon> : "ὖ" U1F56 # GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI
-<dead_tilde> <U1F51> : "ὗ" U1F57 # GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F51> : "ὗ" U1F57 # GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
-<dead_tilde> <dead_dasia> <Greek_upsilon> : "ὗ" U1F57 # GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenleft> <Greek_upsilon> : "ὗ" U1F57 # GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_dasia> <Greek_upsilon> : "ὗ" U1F57 # GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <parenleft> <Greek_upsilon> : "ὗ" U1F57 # GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
-<dead_dasia> <Greek_UPSILON> : "Ὑ" U1F59 # GREEK CAPITAL LETTER UPSILON WITH DASIA
-<Multi_key> <parenleft> <Greek_UPSILON> : "Ὑ" U1F59 # GREEK CAPITAL LETTER UPSILON WITH DASIA
-<dead_grave> <U1F59> : "Ὓ" U1F5B # GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
-<Multi_key> <grave> <U1F59> : "Ὓ" U1F5B # GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
-<dead_grave> <dead_dasia> <Greek_UPSILON> : "Ὓ" U1F5B # GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
-<dead_grave> <Multi_key> <parenleft> <Greek_UPSILON> : "Ὓ" U1F5B # GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
-<Multi_key> <grave> <dead_dasia> <Greek_UPSILON> : "Ὓ" U1F5B # GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
-<Multi_key> <grave> <parenleft> <Greek_UPSILON> : "Ὓ" U1F5B # GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
-<dead_acute> <U1F59> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
-<Multi_key> <acute> <U1F59> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <U1F59> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
-<dead_acute> <dead_dasia> <Greek_UPSILON> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
-<dead_acute> <Multi_key> <parenleft> <Greek_UPSILON> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
-<Multi_key> <acute> <dead_dasia> <Greek_UPSILON> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
-<Multi_key> <acute> <parenleft> <Greek_UPSILON> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <dead_dasia> <Greek_UPSILON> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <parenleft> <Greek_UPSILON> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
-<dead_tilde> <U1F59> : "Ὗ" U1F5F # GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F59> : "Ὗ" U1F5F # GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI
-<dead_tilde> <dead_dasia> <Greek_UPSILON> : "Ὗ" U1F5F # GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenleft> <Greek_UPSILON> : "Ὗ" U1F5F # GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_dasia> <Greek_UPSILON> : "Ὗ" U1F5F # GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <parenleft> <Greek_UPSILON> : "Ὗ" U1F5F # GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI
-<dead_psili> <Greek_omega> : "ὠ" U1F60 # GREEK SMALL LETTER OMEGA WITH PSILI
-<Multi_key> <parenright> <Greek_omega> : "ὠ" U1F60 # GREEK SMALL LETTER OMEGA WITH PSILI
-<dead_dasia> <Greek_omega> : "ὡ" U1F61 # GREEK SMALL LETTER OMEGA WITH DASIA
-<Multi_key> <parenleft> <Greek_omega> : "ὡ" U1F61 # GREEK SMALL LETTER OMEGA WITH DASIA
-<dead_grave> <U1F60> : "ὢ" U1F62 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA
-<Multi_key> <grave> <U1F60> : "ὢ" U1F62 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA
-<dead_grave> <dead_psili> <Greek_omega> : "ὢ" U1F62 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA
-<dead_grave> <Multi_key> <parenright> <Greek_omega> : "ὢ" U1F62 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA
-<Multi_key> <grave> <dead_psili> <Greek_omega> : "ὢ" U1F62 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA
-<Multi_key> <grave> <parenright> <Greek_omega> : "ὢ" U1F62 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA
-<dead_grave> <U1F61> : "ὣ" U1F63 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA
-<Multi_key> <grave> <U1F61> : "ὣ" U1F63 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA
-<dead_grave> <dead_dasia> <Greek_omega> : "ὣ" U1F63 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA
-<dead_grave> <Multi_key> <parenleft> <Greek_omega> : "ὣ" U1F63 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA
-<Multi_key> <grave> <dead_dasia> <Greek_omega> : "ὣ" U1F63 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA
-<Multi_key> <grave> <parenleft> <Greek_omega> : "ὣ" U1F63 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA
-<dead_acute> <U1F60> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
-<Multi_key> <acute> <U1F60> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <U1F60> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
-<dead_acute> <dead_psili> <Greek_omega> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
-<dead_acute> <Multi_key> <parenright> <Greek_omega> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
-<Multi_key> <acute> <dead_psili> <Greek_omega> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
-<Multi_key> <acute> <parenright> <Greek_omega> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <dead_psili> <Greek_omega> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <parenright> <Greek_omega> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
-<dead_acute> <U1F61> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
-<Multi_key> <acute> <U1F61> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <U1F61> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
-<dead_acute> <dead_dasia> <Greek_omega> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
-<dead_acute> <Multi_key> <parenleft> <Greek_omega> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
-<Multi_key> <acute> <dead_dasia> <Greek_omega> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
-<Multi_key> <acute> <parenleft> <Greek_omega> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <dead_dasia> <Greek_omega> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <parenleft> <Greek_omega> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
-<dead_tilde> <U1F60> : "ὦ" U1F66 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F60> : "ὦ" U1F66 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI
-<dead_tilde> <dead_psili> <Greek_omega> : "ὦ" U1F66 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenright> <Greek_omega> : "ὦ" U1F66 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_psili> <Greek_omega> : "ὦ" U1F66 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <parenright> <Greek_omega> : "ὦ" U1F66 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI
-<dead_tilde> <U1F61> : "ὧ" U1F67 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F61> : "ὧ" U1F67 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
-<dead_tilde> <dead_dasia> <Greek_omega> : "ὧ" U1F67 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenleft> <Greek_omega> : "ὧ" U1F67 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_dasia> <Greek_omega> : "ὧ" U1F67 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <parenleft> <Greek_omega> : "ὧ" U1F67 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
-<dead_psili> <Greek_OMEGA> : "Ὠ" U1F68 # GREEK CAPITAL LETTER OMEGA WITH PSILI
-<Multi_key> <parenright> <Greek_OMEGA> : "Ὠ" U1F68 # GREEK CAPITAL LETTER OMEGA WITH PSILI
-<dead_dasia> <Greek_OMEGA> : "Ὡ" U1F69 # GREEK CAPITAL LETTER OMEGA WITH DASIA
-<Multi_key> <parenleft> <Greek_OMEGA> : "Ὡ" U1F69 # GREEK CAPITAL LETTER OMEGA WITH DASIA
-<dead_grave> <U1F68> : "Ὢ" U1F6A # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA
-<Multi_key> <grave> <U1F68> : "Ὢ" U1F6A # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA
-<dead_grave> <dead_psili> <Greek_OMEGA> : "Ὢ" U1F6A # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA
-<dead_grave> <Multi_key> <parenright> <Greek_OMEGA> : "Ὢ" U1F6A # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA
-<Multi_key> <grave> <dead_psili> <Greek_OMEGA> : "Ὢ" U1F6A # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA
-<Multi_key> <grave> <parenright> <Greek_OMEGA> : "Ὢ" U1F6A # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA
-<dead_grave> <U1F69> : "Ὣ" U1F6B # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA
-<Multi_key> <grave> <U1F69> : "Ὣ" U1F6B # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA
-<dead_grave> <dead_dasia> <Greek_OMEGA> : "Ὣ" U1F6B # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA
-<dead_grave> <Multi_key> <parenleft> <Greek_OMEGA> : "Ὣ" U1F6B # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA
-<Multi_key> <grave> <dead_dasia> <Greek_OMEGA> : "Ὣ" U1F6B # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA
-<Multi_key> <grave> <parenleft> <Greek_OMEGA> : "Ὣ" U1F6B # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA
-<dead_acute> <U1F68> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
-<Multi_key> <acute> <U1F68> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <U1F68> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
-<dead_acute> <dead_psili> <Greek_OMEGA> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
-<dead_acute> <Multi_key> <parenright> <Greek_OMEGA> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
-<Multi_key> <acute> <dead_psili> <Greek_OMEGA> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
-<Multi_key> <acute> <parenright> <Greek_OMEGA> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <dead_psili> <Greek_OMEGA> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
-<Multi_key> <apostrophe> <parenright> <Greek_OMEGA> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
-<dead_acute> <U1F69> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
-<Multi_key> <acute> <U1F69> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <U1F69> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
-<dead_acute> <dead_dasia> <Greek_OMEGA> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
-<dead_acute> <Multi_key> <parenleft> <Greek_OMEGA> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
-<Multi_key> <acute> <dead_dasia> <Greek_OMEGA> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
-<Multi_key> <acute> <parenleft> <Greek_OMEGA> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <dead_dasia> <Greek_OMEGA> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
-<Multi_key> <apostrophe> <parenleft> <Greek_OMEGA> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
-<dead_tilde> <U1F68> : "Ὦ" U1F6E # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F68> : "Ὦ" U1F6E # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI
-<dead_tilde> <dead_psili> <Greek_OMEGA> : "Ὦ" U1F6E # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenright> <Greek_OMEGA> : "Ὦ" U1F6E # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_psili> <Greek_OMEGA> : "Ὦ" U1F6E # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI
-<Multi_key> <asciitilde> <parenright> <Greek_OMEGA> : "Ὦ" U1F6E # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI
-<dead_tilde> <U1F69> : "Ὧ" U1F6F # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <U1F69> : "Ὧ" U1F6F # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
-<dead_tilde> <dead_dasia> <Greek_OMEGA> : "Ὧ" U1F6F # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
-<dead_tilde> <Multi_key> <parenleft> <Greek_OMEGA> : "Ὧ" U1F6F # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_dasia> <Greek_OMEGA> : "Ὧ" U1F6F # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
-<Multi_key> <asciitilde> <parenleft> <Greek_OMEGA> : "Ὧ" U1F6F # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
-<dead_grave> <Greek_alpha> : "ὰ" U1F70 # GREEK SMALL LETTER ALPHA WITH VARIA
-<Multi_key> <grave> <Greek_alpha> : "ὰ" U1F70 # GREEK SMALL LETTER ALPHA WITH VARIA
-<dead_grave> <Greek_epsilon> : "ὲ" U1F72 # GREEK SMALL LETTER EPSILON WITH VARIA
-<Multi_key> <grave> <Greek_epsilon> : "ὲ" U1F72 # GREEK SMALL LETTER EPSILON WITH VARIA
-<dead_grave> <Greek_eta> : "ὴ" U1F74 # GREEK SMALL LETTER ETA WITH VARIA
-<Multi_key> <grave> <Greek_eta> : "ὴ" U1F74 # GREEK SMALL LETTER ETA WITH VARIA
-<dead_grave> <Greek_iota> : "ὶ" U1F76 # GREEK SMALL LETTER IOTA WITH VARIA
-<Multi_key> <grave> <Greek_iota> : "ὶ" U1F76 # GREEK SMALL LETTER IOTA WITH VARIA
-<dead_grave> <Greek_omicron> : "ὸ" U1F78 # GREEK SMALL LETTER OMICRON WITH VARIA
-<Multi_key> <grave> <Greek_omicron> : "ὸ" U1F78 # GREEK SMALL LETTER OMICRON WITH VARIA
-<dead_grave> <Greek_upsilon> : "ὺ" U1F7A # GREEK SMALL LETTER UPSILON WITH VARIA
-<Multi_key> <grave> <Greek_upsilon> : "ὺ" U1F7A # GREEK SMALL LETTER UPSILON WITH VARIA
-<dead_grave> <Greek_omega> : "ὼ" U1F7C # GREEK SMALL LETTER OMEGA WITH VARIA
-<Multi_key> <grave> <Greek_omega> : "ὼ" U1F7C # GREEK SMALL LETTER OMEGA WITH VARIA
-<dead_iota> <U1F00> : "ᾀ" U1F80 # GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F00> : "ᾀ" U1F80 # GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI
-<dead_iota> <dead_psili> <Greek_alpha> : "ᾀ" U1F80 # GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <parenright> <Greek_alpha> : "ᾀ" U1F80 # GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_psili> <Greek_alpha> : "ᾀ" U1F80 # GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <parenright> <Greek_alpha> : "ᾀ" U1F80 # GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI
-<dead_iota> <U1F01> : "ᾁ" U1F81 # GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F01> : "ᾁ" U1F81 # GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI
-<dead_iota> <dead_dasia> <Greek_alpha> : "ᾁ" U1F81 # GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <parenleft> <Greek_alpha> : "ᾁ" U1F81 # GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_dasia> <Greek_alpha> : "ᾁ" U1F81 # GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <parenleft> <Greek_alpha> : "ᾁ" U1F81 # GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI
-<dead_iota> <U1F02> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F02> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <U1F00> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <U1F00> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <U1F00> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <U1F00> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <dead_psili> <Greek_alpha> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <Multi_key> <parenright> <Greek_alpha> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <dead_psili> <Greek_alpha> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <parenright> <Greek_alpha> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <dead_psili> <Greek_alpha> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <parenright> <Greek_alpha> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <dead_psili> <Greek_alpha> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <parenright> <Greek_alpha> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <U1F03> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F03> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <U1F01> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <U1F01> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <U1F01> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <U1F01> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <dead_dasia> <Greek_alpha> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <Multi_key> <parenleft> <Greek_alpha> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <dead_dasia> <Greek_alpha> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <parenleft> <Greek_alpha> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <dead_dasia> <Greek_alpha> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <parenleft> <Greek_alpha> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <dead_dasia> <Greek_alpha> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <parenleft> <Greek_alpha> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <U1F04> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F04> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <U1F00> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <U1F00> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <U1F00> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <U1F00> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <U1F00> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <U1F00> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <dead_psili> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <Multi_key> <parenright> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <dead_psili> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <parenright> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <dead_psili> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <parenright> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <dead_psili> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <parenright> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <dead_psili> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <parenright> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <dead_psili> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <parenright> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <U1F05> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F05> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <U1F01> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <U1F01> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <U1F01> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <U1F01> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <U1F01> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <U1F01> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <dead_dasia> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <Multi_key> <parenleft> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <dead_dasia> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <parenleft> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <dead_dasia> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <parenleft> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <dead_dasia> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <parenleft> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <dead_dasia> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <parenleft> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <dead_dasia> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <parenleft> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <U1F06> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F06> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <U1F00> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <U1F00> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <U1F00> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <U1F00> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <dead_psili> <Greek_alpha> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <Multi_key> <parenright> <Greek_alpha> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <dead_psili> <Greek_alpha> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <parenright> <Greek_alpha> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <dead_psili> <Greek_alpha> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <parenright> <Greek_alpha> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <dead_psili> <Greek_alpha> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <parenright> <Greek_alpha> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <U1F07> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F07> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <U1F01> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <U1F01> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <U1F01> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <U1F01> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <dead_dasia> <Greek_alpha> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <Multi_key> <parenleft> <Greek_alpha> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <dead_dasia> <Greek_alpha> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <parenleft> <Greek_alpha> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <dead_dasia> <Greek_alpha> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <parenleft> <Greek_alpha> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <dead_dasia> <Greek_alpha> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <parenleft> <Greek_alpha> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <U1F08> : "ᾈ" U1F88 # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F08> : "ᾈ" U1F88 # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI
-<dead_iota> <dead_psili> <Greek_ALPHA> : "ᾈ" U1F88 # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <parenright> <Greek_ALPHA> : "ᾈ" U1F88 # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_psili> <Greek_ALPHA> : "ᾈ" U1F88 # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <parenright> <Greek_ALPHA> : "ᾈ" U1F88 # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI
-<dead_iota> <U1F09> : "ᾉ" U1F89 # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F09> : "ᾉ" U1F89 # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI
-<dead_iota> <dead_dasia> <Greek_ALPHA> : "ᾉ" U1F89 # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <parenleft> <Greek_ALPHA> : "ᾉ" U1F89 # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_dasia> <Greek_ALPHA> : "ᾉ" U1F89 # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <parenleft> <Greek_ALPHA> : "ᾉ" U1F89 # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI
-<dead_iota> <U1F0A> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F0A> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <U1F08> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <U1F08> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <U1F08> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <U1F08> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <dead_psili> <Greek_ALPHA> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <Multi_key> <parenright> <Greek_ALPHA> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <dead_psili> <Greek_ALPHA> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <parenright> <Greek_ALPHA> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <dead_psili> <Greek_ALPHA> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <parenright> <Greek_ALPHA> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <dead_psili> <Greek_ALPHA> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <parenright> <Greek_ALPHA> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <U1F0B> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F0B> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <U1F09> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <U1F09> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <U1F09> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <U1F09> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <dead_dasia> <Greek_ALPHA> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <Multi_key> <parenleft> <Greek_ALPHA> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <dead_dasia> <Greek_ALPHA> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <parenleft> <Greek_ALPHA> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <dead_dasia> <Greek_ALPHA> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <parenleft> <Greek_ALPHA> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <dead_dasia> <Greek_ALPHA> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <parenleft> <Greek_ALPHA> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <U1F0C> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F0C> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <U1F08> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <U1F08> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <U1F08> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <U1F08> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <U1F08> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <U1F08> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <dead_psili> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <Multi_key> <parenright> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <dead_psili> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <parenright> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <dead_psili> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <parenright> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <dead_psili> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <parenright> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <dead_psili> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <parenright> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <dead_psili> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <parenright> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <U1F0D> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F0D> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <U1F09> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <U1F09> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <U1F09> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <U1F09> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <U1F09> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <U1F09> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <dead_dasia> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <Multi_key> <parenleft> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <dead_dasia> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <parenleft> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <dead_dasia> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <parenleft> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <dead_dasia> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <parenleft> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <dead_dasia> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <parenleft> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <dead_dasia> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <parenleft> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <U1F0E> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F0E> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <U1F08> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <U1F08> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <U1F08> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <U1F08> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <dead_psili> <Greek_ALPHA> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <Multi_key> <parenright> <Greek_ALPHA> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <dead_psili> <Greek_ALPHA> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <parenright> <Greek_ALPHA> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <dead_psili> <Greek_ALPHA> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <parenright> <Greek_ALPHA> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <dead_psili> <Greek_ALPHA> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <parenright> <Greek_ALPHA> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <U1F0F> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F0F> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <U1F09> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <U1F09> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <U1F09> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <U1F09> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <dead_dasia> <Greek_ALPHA> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <Multi_key> <parenleft> <Greek_ALPHA> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <dead_dasia> <Greek_ALPHA> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <parenleft> <Greek_ALPHA> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <dead_dasia> <Greek_ALPHA> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <parenleft> <Greek_ALPHA> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <dead_dasia> <Greek_ALPHA> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <parenleft> <Greek_ALPHA> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <U1F20> : "ᾐ" U1F90 # GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F20> : "ᾐ" U1F90 # GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI
-<dead_iota> <dead_psili> <Greek_eta> : "ᾐ" U1F90 # GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <parenright> <Greek_eta> : "ᾐ" U1F90 # GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_psili> <Greek_eta> : "ᾐ" U1F90 # GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <parenright> <Greek_eta> : "ᾐ" U1F90 # GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI
-<dead_iota> <U1F21> : "ᾑ" U1F91 # GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F21> : "ᾑ" U1F91 # GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI
-<dead_iota> <dead_dasia> <Greek_eta> : "ᾑ" U1F91 # GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <parenleft> <Greek_eta> : "ᾑ" U1F91 # GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_dasia> <Greek_eta> : "ᾑ" U1F91 # GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <parenleft> <Greek_eta> : "ᾑ" U1F91 # GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI
-<dead_iota> <U1F22> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F22> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <U1F20> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <U1F20> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <U1F20> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <U1F20> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <dead_psili> <Greek_eta> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <Multi_key> <parenright> <Greek_eta> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <dead_psili> <Greek_eta> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <parenright> <Greek_eta> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <dead_psili> <Greek_eta> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <parenright> <Greek_eta> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <dead_psili> <Greek_eta> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <parenright> <Greek_eta> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <U1F23> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F23> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <U1F21> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <U1F21> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <U1F21> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <U1F21> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <dead_dasia> <Greek_eta> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <Multi_key> <parenleft> <Greek_eta> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <dead_dasia> <Greek_eta> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <parenleft> <Greek_eta> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <dead_dasia> <Greek_eta> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <parenleft> <Greek_eta> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <dead_dasia> <Greek_eta> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <parenleft> <Greek_eta> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <U1F24> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F24> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <U1F20> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <U1F20> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <U1F20> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <U1F20> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <U1F20> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <U1F20> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <dead_psili> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <Multi_key> <parenright> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <dead_psili> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <parenright> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <dead_psili> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <parenright> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <dead_psili> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <parenright> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <dead_psili> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <parenright> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <dead_psili> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <parenright> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <U1F25> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F25> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <U1F21> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <U1F21> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <U1F21> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <U1F21> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <U1F21> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <U1F21> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <dead_dasia> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <Multi_key> <parenleft> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <dead_dasia> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <parenleft> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <dead_dasia> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <parenleft> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <dead_dasia> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <parenleft> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <dead_dasia> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <parenleft> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <dead_dasia> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <parenleft> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <U1F26> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F26> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <U1F20> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <U1F20> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <U1F20> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <U1F20> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <dead_psili> <Greek_eta> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <Multi_key> <parenright> <Greek_eta> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <dead_psili> <Greek_eta> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <parenright> <Greek_eta> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <dead_psili> <Greek_eta> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <parenright> <Greek_eta> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <dead_psili> <Greek_eta> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <parenright> <Greek_eta> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <U1F27> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F27> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <U1F21> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <U1F21> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <U1F21> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <U1F21> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <dead_dasia> <Greek_eta> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <Multi_key> <parenleft> <Greek_eta> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <dead_dasia> <Greek_eta> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <parenleft> <Greek_eta> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <dead_dasia> <Greek_eta> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <parenleft> <Greek_eta> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <dead_dasia> <Greek_eta> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <parenleft> <Greek_eta> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <U1F28> : "ᾘ" U1F98 # GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F28> : "ᾘ" U1F98 # GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI
-<dead_iota> <dead_psili> <Greek_ETA> : "ᾘ" U1F98 # GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <parenright> <Greek_ETA> : "ᾘ" U1F98 # GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_psili> <Greek_ETA> : "ᾘ" U1F98 # GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <parenright> <Greek_ETA> : "ᾘ" U1F98 # GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI
-<dead_iota> <U1F29> : "ᾙ" U1F99 # GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F29> : "ᾙ" U1F99 # GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI
-<dead_iota> <dead_dasia> <Greek_ETA> : "ᾙ" U1F99 # GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <parenleft> <Greek_ETA> : "ᾙ" U1F99 # GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_dasia> <Greek_ETA> : "ᾙ" U1F99 # GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <parenleft> <Greek_ETA> : "ᾙ" U1F99 # GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI
-<dead_iota> <U1F2A> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F2A> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <U1F28> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <U1F28> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <U1F28> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <U1F28> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <dead_psili> <Greek_ETA> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <Multi_key> <parenright> <Greek_ETA> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <dead_psili> <Greek_ETA> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <parenright> <Greek_ETA> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <dead_psili> <Greek_ETA> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <parenright> <Greek_ETA> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <dead_psili> <Greek_ETA> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <parenright> <Greek_ETA> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <U1F2B> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F2B> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <U1F29> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <U1F29> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <U1F29> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <U1F29> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <dead_dasia> <Greek_ETA> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <Multi_key> <parenleft> <Greek_ETA> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <dead_dasia> <Greek_ETA> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <parenleft> <Greek_ETA> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <dead_dasia> <Greek_ETA> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <parenleft> <Greek_ETA> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <dead_dasia> <Greek_ETA> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <parenleft> <Greek_ETA> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <U1F2C> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F2C> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <U1F28> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <U1F28> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <U1F28> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <U1F28> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <U1F28> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <U1F28> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <dead_psili> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <Multi_key> <parenright> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <dead_psili> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <parenright> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <dead_psili> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <parenright> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <dead_psili> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <parenright> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <dead_psili> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <parenright> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <dead_psili> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <parenright> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <U1F2D> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F2D> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <U1F29> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <U1F29> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <U1F29> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <U1F29> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <U1F29> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <U1F29> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <dead_dasia> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <Multi_key> <parenleft> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <dead_dasia> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <parenleft> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <dead_dasia> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <parenleft> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <dead_dasia> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <parenleft> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <dead_dasia> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <parenleft> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <dead_dasia> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <parenleft> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <U1F2E> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F2E> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <U1F28> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <U1F28> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <U1F28> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <U1F28> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <dead_psili> <Greek_ETA> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <Multi_key> <parenright> <Greek_ETA> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <dead_psili> <Greek_ETA> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <parenright> <Greek_ETA> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <dead_psili> <Greek_ETA> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <parenright> <Greek_ETA> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <dead_psili> <Greek_ETA> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <parenright> <Greek_ETA> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <U1F2F> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F2F> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <U1F29> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <U1F29> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <U1F29> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <U1F29> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <dead_dasia> <Greek_ETA> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <Multi_key> <parenleft> <Greek_ETA> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <dead_dasia> <Greek_ETA> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <parenleft> <Greek_ETA> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <dead_dasia> <Greek_ETA> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <parenleft> <Greek_ETA> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <dead_dasia> <Greek_ETA> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <parenleft> <Greek_ETA> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <U1F60> : "ᾠ" U1FA0 # GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F60> : "ᾠ" U1FA0 # GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI
-<dead_iota> <dead_psili> <Greek_omega> : "ᾠ" U1FA0 # GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <parenright> <Greek_omega> : "ᾠ" U1FA0 # GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_psili> <Greek_omega> : "ᾠ" U1FA0 # GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <parenright> <Greek_omega> : "ᾠ" U1FA0 # GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI
-<dead_iota> <U1F61> : "ᾡ" U1FA1 # GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F61> : "ᾡ" U1FA1 # GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI
-<dead_iota> <dead_dasia> <Greek_omega> : "ᾡ" U1FA1 # GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <parenleft> <Greek_omega> : "ᾡ" U1FA1 # GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_dasia> <Greek_omega> : "ᾡ" U1FA1 # GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <parenleft> <Greek_omega> : "ᾡ" U1FA1 # GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI
-<dead_iota> <U1F62> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F62> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <U1F60> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <U1F60> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <U1F60> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <U1F60> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <dead_psili> <Greek_omega> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <Multi_key> <parenright> <Greek_omega> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <dead_psili> <Greek_omega> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <parenright> <Greek_omega> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <dead_psili> <Greek_omega> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <parenright> <Greek_omega> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <dead_psili> <Greek_omega> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <parenright> <Greek_omega> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <U1F63> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F63> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <U1F61> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <U1F61> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <U1F61> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <U1F61> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <dead_dasia> <Greek_omega> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <Multi_key> <parenleft> <Greek_omega> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <dead_dasia> <Greek_omega> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <parenleft> <Greek_omega> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <dead_dasia> <Greek_omega> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <parenleft> <Greek_omega> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <dead_dasia> <Greek_omega> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <parenleft> <Greek_omega> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
-<dead_iota> <U1F64> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F64> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <U1F60> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <U1F60> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <U1F60> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <U1F60> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <U1F60> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <U1F60> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <dead_psili> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <Multi_key> <parenright> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <dead_psili> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <parenright> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <dead_psili> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <parenright> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <dead_psili> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <parenright> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <dead_psili> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <parenright> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <dead_psili> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <parenright> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <U1F65> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F65> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <U1F61> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <U1F61> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <U1F61> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <U1F61> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <U1F61> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <U1F61> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <dead_dasia> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <Multi_key> <parenleft> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <dead_dasia> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <parenleft> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <dead_dasia> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <parenleft> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <dead_dasia> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <parenleft> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <dead_dasia> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <parenleft> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <dead_dasia> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <parenleft> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
-<dead_iota> <U1F66> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F66> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <U1F60> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <U1F60> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <U1F60> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <U1F60> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <dead_psili> <Greek_omega> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <Multi_key> <parenright> <Greek_omega> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <dead_psili> <Greek_omega> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <parenright> <Greek_omega> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <dead_psili> <Greek_omega> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <parenright> <Greek_omega> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <dead_psili> <Greek_omega> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <parenright> <Greek_omega> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <U1F67> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F67> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <U1F61> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <U1F61> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <U1F61> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <U1F61> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <dead_dasia> <Greek_omega> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <Multi_key> <parenleft> <Greek_omega> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <dead_dasia> <Greek_omega> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <parenleft> <Greek_omega> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <dead_dasia> <Greek_omega> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <parenleft> <Greek_omega> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <dead_dasia> <Greek_omega> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <parenleft> <Greek_omega> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <U1F68> : "ᾨ" U1FA8 # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F68> : "ᾨ" U1FA8 # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI
-<dead_iota> <dead_psili> <Greek_OMEGA> : "ᾨ" U1FA8 # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <parenright> <Greek_OMEGA> : "ᾨ" U1FA8 # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_psili> <Greek_OMEGA> : "ᾨ" U1FA8 # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <parenright> <Greek_OMEGA> : "ᾨ" U1FA8 # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI
-<dead_iota> <U1F69> : "ᾩ" U1FA9 # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F69> : "ᾩ" U1FA9 # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI
-<dead_iota> <dead_dasia> <Greek_OMEGA> : "ᾩ" U1FA9 # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <parenleft> <Greek_OMEGA> : "ᾩ" U1FA9 # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_dasia> <Greek_OMEGA> : "ᾩ" U1FA9 # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <parenleft> <Greek_OMEGA> : "ᾩ" U1FA9 # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI
-<dead_iota> <U1F6A> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F6A> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <U1F68> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <U1F68> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <U1F68> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <U1F68> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <dead_psili> <Greek_OMEGA> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <Multi_key> <parenright> <Greek_OMEGA> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <dead_psili> <Greek_OMEGA> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <parenright> <Greek_OMEGA> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <dead_psili> <Greek_OMEGA> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <parenright> <Greek_OMEGA> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <dead_psili> <Greek_OMEGA> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <parenright> <Greek_OMEGA> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <U1F6B> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F6B> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <U1F69> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <U1F69> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <U1F69> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <U1F69> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <dead_dasia> <Greek_OMEGA> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <dead_grave> <Multi_key> <parenleft> <Greek_OMEGA> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <dead_dasia> <Greek_OMEGA> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <parenleft> <Greek_OMEGA> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <dead_dasia> <Greek_OMEGA> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <parenleft> <Greek_OMEGA> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <dead_dasia> <Greek_OMEGA> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <parenleft> <Greek_OMEGA> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
-<dead_iota> <U1F6C> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F6C> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <U1F68> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <U1F68> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <U1F68> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <U1F68> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <U1F68> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <U1F68> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <dead_psili> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <Multi_key> <parenright> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <dead_psili> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <parenright> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <dead_psili> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <parenright> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <dead_psili> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <parenright> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <dead_psili> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <parenright> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <dead_psili> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <parenright> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <U1F6D> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F6D> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <U1F69> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <U1F69> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <U1F69> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <U1F69> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <U1F69> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <U1F69> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <dead_dasia> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <dead_acute> <Multi_key> <parenleft> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <dead_dasia> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <parenleft> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <dead_dasia> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <parenleft> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <dead_dasia> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <parenleft> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <dead_dasia> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <parenleft> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <dead_dasia> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <parenleft> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
-<dead_iota> <U1F6E> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F6E> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <U1F68> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <U1F68> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <U1F68> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <U1F68> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <dead_psili> <Greek_OMEGA> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <Multi_key> <parenright> <Greek_OMEGA> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <dead_psili> <Greek_OMEGA> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <parenright> <Greek_OMEGA> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <dead_psili> <Greek_OMEGA> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <parenright> <Greek_OMEGA> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <dead_psili> <Greek_OMEGA> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <parenright> <Greek_OMEGA> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <U1F6F> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F6F> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <U1F69> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <U1F69> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <U1F69> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <U1F69> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <dead_dasia> <Greek_OMEGA> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <dead_tilde> <Multi_key> <parenleft> <Greek_OMEGA> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <dead_dasia> <Greek_OMEGA> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <parenleft> <Greek_OMEGA> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <dead_dasia> <Greek_OMEGA> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <parenleft> <Greek_OMEGA> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <dead_dasia> <Greek_OMEGA> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <parenleft> <Greek_OMEGA> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
-<dead_breve> <Greek_alpha> : "ᾰ" U1FB0 # GREEK SMALL LETTER ALPHA WITH VRACHY
-<Multi_key> <U> <Greek_alpha> : "ᾰ" U1FB0 # GREEK SMALL LETTER ALPHA WITH VRACHY
-<Multi_key> <b> <Greek_alpha> : "ᾰ" U1FB0 # GREEK SMALL LETTER ALPHA WITH VRACHY
-<dead_macron> <Greek_alpha> : "ᾱ" U1FB1 # GREEK SMALL LETTER ALPHA WITH MACRON
-<Multi_key> <macron> <Greek_alpha> : "ᾱ" U1FB1 # GREEK SMALL LETTER ALPHA WITH MACRON
-<Multi_key> <underscore> <Greek_alpha> : "ᾱ" U1FB1 # GREEK SMALL LETTER ALPHA WITH MACRON
-<dead_iota> <U1F70> : "ᾲ" U1FB2 # GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F70> : "ᾲ" U1FB2 # GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <Greek_alpha> : "ᾲ" U1FB2 # GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <Greek_alpha> : "ᾲ" U1FB2 # GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <Greek_alpha> : "ᾲ" U1FB2 # GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <Greek_alpha> : "ᾲ" U1FB2 # GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI
-<dead_iota> <Greek_alpha> : "ᾳ" U1FB3 # GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <Greek_alpha> : "ᾳ" U1FB3 # GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI
-<dead_iota> <Greek_alphaaccent> : "ᾴ" U1FB4 # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <Greek_alphaaccent> : "ᾴ" U1FB4 # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <Greek_alpha> : "ᾴ" U1FB4 # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <Greek_alpha> : "ᾴ" U1FB4 # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <Greek_alpha> : "ᾴ" U1FB4 # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <Greek_alpha> : "ᾴ" U1FB4 # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <Greek_alpha> : "ᾴ" U1FB4 # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <Greek_alpha> : "ᾴ" U1FB4 # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
-<dead_tilde> <Greek_alpha> : "ᾶ" U1FB6 # GREEK SMALL LETTER ALPHA WITH PERISPOMENI
-<Multi_key> <asciitilde> <Greek_alpha> : "ᾶ" U1FB6 # GREEK SMALL LETTER ALPHA WITH PERISPOMENI
-<dead_iota> <U1FB6> : "ᾷ" U1FB7 # GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1FB6> : "ᾷ" U1FB7 # GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <Greek_alpha> : "ᾷ" U1FB7 # GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <Greek_alpha> : "ᾷ" U1FB7 # GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <Greek_alpha> : "ᾷ" U1FB7 # GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <Greek_alpha> : "ᾷ" U1FB7 # GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI
-<dead_breve> <Greek_ALPHA> : "Ᾰ" U1FB8 # GREEK CAPITAL LETTER ALPHA WITH VRACHY
-<Multi_key> <U> <Greek_ALPHA> : "Ᾰ" U1FB8 # GREEK CAPITAL LETTER ALPHA WITH VRACHY
-<Multi_key> <b> <Greek_ALPHA> : "Ᾰ" U1FB8 # GREEK CAPITAL LETTER ALPHA WITH VRACHY
-<dead_macron> <Greek_ALPHA> : "Ᾱ" U1FB9 # GREEK CAPITAL LETTER ALPHA WITH MACRON
-<Multi_key> <macron> <Greek_ALPHA> : "Ᾱ" U1FB9 # GREEK CAPITAL LETTER ALPHA WITH MACRON
-<Multi_key> <underscore> <Greek_ALPHA> : "Ᾱ" U1FB9 # GREEK CAPITAL LETTER ALPHA WITH MACRON
-<dead_grave> <Greek_ALPHA> : "Ὰ" U1FBA # GREEK CAPITAL LETTER ALPHA WITH VARIA
-<Multi_key> <grave> <Greek_ALPHA> : "Ὰ" U1FBA # GREEK CAPITAL LETTER ALPHA WITH VARIA
-<dead_iota> <Greek_ALPHA> : "ᾼ" U1FBC # GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <Greek_ALPHA> : "ᾼ" U1FBC # GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI
-<Multi_key> <diaeresis> <dead_tilde> : "῁" U1FC1 # GREEK DIALYTIKA AND PERISPOMENI
-<Multi_key> <diaeresis> <asciitilde> : "῁" U1FC1 # GREEK DIALYTIKA AND PERISPOMENI
-<dead_iota> <U1F74> : "ῂ" U1FC2 # GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F74> : "ῂ" U1FC2 # GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <Greek_eta> : "ῂ" U1FC2 # GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <Greek_eta> : "ῂ" U1FC2 # GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <Greek_eta> : "ῂ" U1FC2 # GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <Greek_eta> : "ῂ" U1FC2 # GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI
-<dead_iota> <Greek_eta> : "ῃ" U1FC3 # GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <Greek_eta> : "ῃ" U1FC3 # GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI
-<dead_iota> <Greek_etaaccent> : "ῄ" U1FC4 # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <Greek_etaaccent> : "ῄ" U1FC4 # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <Greek_eta> : "ῄ" U1FC4 # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <Greek_eta> : "ῄ" U1FC4 # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <Greek_eta> : "ῄ" U1FC4 # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <Greek_eta> : "ῄ" U1FC4 # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <Greek_eta> : "ῄ" U1FC4 # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <Greek_eta> : "ῄ" U1FC4 # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
-<dead_tilde> <Greek_eta> : "ῆ" U1FC6 # GREEK SMALL LETTER ETA WITH PERISPOMENI
-<Multi_key> <asciitilde> <Greek_eta> : "ῆ" U1FC6 # GREEK SMALL LETTER ETA WITH PERISPOMENI
-<dead_iota> <U1FC6> : "ῇ" U1FC7 # GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1FC6> : "ῇ" U1FC7 # GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <Greek_eta> : "ῇ" U1FC7 # GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <Greek_eta> : "ῇ" U1FC7 # GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <Greek_eta> : "ῇ" U1FC7 # GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <Greek_eta> : "ῇ" U1FC7 # GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI
-<dead_grave> <Greek_EPSILON> : "Ὲ" U1FC8 # GREEK CAPITAL LETTER EPSILON WITH VARIA
-<Multi_key> <grave> <Greek_EPSILON> : "Ὲ" U1FC8 # GREEK CAPITAL LETTER EPSILON WITH VARIA
-<dead_grave> <Greek_ETA> : "Ὴ" U1FCA # GREEK CAPITAL LETTER ETA WITH VARIA
-<Multi_key> <grave> <Greek_ETA> : "Ὴ" U1FCA # GREEK CAPITAL LETTER ETA WITH VARIA
-<dead_iota> <Greek_ETA> : "ῌ" U1FCC # GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <Greek_ETA> : "ῌ" U1FCC # GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI
-<Multi_key> <U1FBF> <dead_grave> : "῍" U1FCD # GREEK PSILI AND VARIA
-<Multi_key> <U1FBF> <grave> : "῍" U1FCD # GREEK PSILI AND VARIA
-<Multi_key> <U1FBF> <dead_acute> : "῎" U1FCE # GREEK PSILI AND OXIA
-<Multi_key> <U1FBF> <acute> : "῎" U1FCE # GREEK PSILI AND OXIA
-<Multi_key> <U1FBF> <apostrophe> : "῎" U1FCE # GREEK PSILI AND OXIA
-<Multi_key> <U1FBF> <dead_tilde> : "῏" U1FCF # GREEK PSILI AND PERISPOMENI
-<Multi_key> <U1FBF> <asciitilde> : "῏" U1FCF # GREEK PSILI AND PERISPOMENI
-<dead_breve> <Greek_iota> : "ῐ" U1FD0 # GREEK SMALL LETTER IOTA WITH VRACHY
-<Multi_key> <U> <Greek_iota> : "ῐ" U1FD0 # GREEK SMALL LETTER IOTA WITH VRACHY
-<Multi_key> <b> <Greek_iota> : "ῐ" U1FD0 # GREEK SMALL LETTER IOTA WITH VRACHY
-<dead_macron> <Greek_iota> : "ῑ" U1FD1 # GREEK SMALL LETTER IOTA WITH MACRON
-<Multi_key> <macron> <Greek_iota> : "ῑ" U1FD1 # GREEK SMALL LETTER IOTA WITH MACRON
-<Multi_key> <underscore> <Greek_iota> : "ῑ" U1FD1 # GREEK SMALL LETTER IOTA WITH MACRON
-<dead_grave> <Greek_iotadieresis> : "ῒ" U1FD2 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA
-<Multi_key> <grave> <Greek_iotadieresis> : "ῒ" U1FD2 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA
-<dead_grave> <dead_diaeresis> <Greek_iota> : "ῒ" U1FD2 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA
-<dead_grave> <Multi_key> <quotedbl> <Greek_iota> : "ῒ" U1FD2 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA
-<Multi_key> <grave> <dead_diaeresis> <Greek_iota> : "ῒ" U1FD2 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA
-<Multi_key> <grave> <quotedbl> <Greek_iota> : "ῒ" U1FD2 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA
-<dead_tilde> <Greek_iota> : "ῖ" U1FD6 # GREEK SMALL LETTER IOTA WITH PERISPOMENI
-<Multi_key> <asciitilde> <Greek_iota> : "ῖ" U1FD6 # GREEK SMALL LETTER IOTA WITH PERISPOMENI
-<dead_tilde> <Greek_iotadieresis> : "ῗ" U1FD7 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI
-<Multi_key> <asciitilde> <Greek_iotadieresis> : "ῗ" U1FD7 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI
-<dead_tilde> <dead_diaeresis> <Greek_iota> : "ῗ" U1FD7 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI
-<dead_tilde> <Multi_key> <quotedbl> <Greek_iota> : "ῗ" U1FD7 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_diaeresis> <Greek_iota> : "ῗ" U1FD7 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI
-<Multi_key> <asciitilde> <quotedbl> <Greek_iota> : "ῗ" U1FD7 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI
-<dead_breve> <Greek_IOTA> : "Ῐ" U1FD8 # GREEK CAPITAL LETTER IOTA WITH VRACHY
-<Multi_key> <U> <Greek_IOTA> : "Ῐ" U1FD8 # GREEK CAPITAL LETTER IOTA WITH VRACHY
-<Multi_key> <b> <Greek_IOTA> : "Ῐ" U1FD8 # GREEK CAPITAL LETTER IOTA WITH VRACHY
-<dead_macron> <Greek_IOTA> : "Ῑ" U1FD9 # GREEK CAPITAL LETTER IOTA WITH MACRON
-<Multi_key> <macron> <Greek_IOTA> : "Ῑ" U1FD9 # GREEK CAPITAL LETTER IOTA WITH MACRON
-<Multi_key> <underscore> <Greek_IOTA> : "Ῑ" U1FD9 # GREEK CAPITAL LETTER IOTA WITH MACRON
-<dead_grave> <Greek_IOTA> : "Ὶ" U1FDA # GREEK CAPITAL LETTER IOTA WITH VARIA
-<Multi_key> <grave> <Greek_IOTA> : "Ὶ" U1FDA # GREEK CAPITAL LETTER IOTA WITH VARIA
-<Multi_key> <U1FFE> <dead_grave> : "῝" U1FDD # GREEK DASIA AND VARIA
-<Multi_key> <U1FFE> <grave> : "῝" U1FDD # GREEK DASIA AND VARIA
-<Multi_key> <U1FFE> <dead_acute> : "῞" U1FDE # GREEK DASIA AND OXIA
-<Multi_key> <U1FFE> <acute> : "῞" U1FDE # GREEK DASIA AND OXIA
-<Multi_key> <U1FFE> <apostrophe> : "῞" U1FDE # GREEK DASIA AND OXIA
-<Multi_key> <U1FFE> <dead_tilde> : "῟" U1FDF # GREEK DASIA AND PERISPOMENI
-<Multi_key> <U1FFE> <asciitilde> : "῟" U1FDF # GREEK DASIA AND PERISPOMENI
-<dead_breve> <Greek_upsilon> : "ῠ" U1FE0 # GREEK SMALL LETTER UPSILON WITH VRACHY
-<Multi_key> <U> <Greek_upsilon> : "ῠ" U1FE0 # GREEK SMALL LETTER UPSILON WITH VRACHY
-<Multi_key> <b> <Greek_upsilon> : "ῠ" U1FE0 # GREEK SMALL LETTER UPSILON WITH VRACHY
-<dead_macron> <Greek_upsilon> : "ῡ" U1FE1 # GREEK SMALL LETTER UPSILON WITH MACRON
-<Multi_key> <macron> <Greek_upsilon> : "ῡ" U1FE1 # GREEK SMALL LETTER UPSILON WITH MACRON
-<Multi_key> <underscore> <Greek_upsilon> : "ῡ" U1FE1 # GREEK SMALL LETTER UPSILON WITH MACRON
-<dead_grave> <Greek_upsilondieresis> : "ῢ" U1FE2 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA
-<Multi_key> <grave> <Greek_upsilondieresis> : "ῢ" U1FE2 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA
-<dead_grave> <dead_diaeresis> <Greek_upsilon> : "ῢ" U1FE2 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA
-<dead_grave> <Multi_key> <quotedbl> <Greek_upsilon> : "ῢ" U1FE2 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA
-<Multi_key> <grave> <dead_diaeresis> <Greek_upsilon> : "ῢ" U1FE2 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA
-<Multi_key> <grave> <quotedbl> <Greek_upsilon> : "ῢ" U1FE2 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA
-<dead_psili> <Greek_rho> : "ῤ" U1FE4 # GREEK SMALL LETTER RHO WITH PSILI
-<Multi_key> <parenright> <Greek_rho> : "ῤ" U1FE4 # GREEK SMALL LETTER RHO WITH PSILI
-<dead_dasia> <Greek_rho> : "ῥ" U1FE5 # GREEK SMALL LETTER RHO WITH DASIA
-<Multi_key> <parenleft> <Greek_rho> : "ῥ" U1FE5 # GREEK SMALL LETTER RHO WITH DASIA
-<dead_tilde> <Greek_upsilon> : "ῦ" U1FE6 # GREEK SMALL LETTER UPSILON WITH PERISPOMENI
-<Multi_key> <asciitilde> <Greek_upsilon> : "ῦ" U1FE6 # GREEK SMALL LETTER UPSILON WITH PERISPOMENI
-<dead_tilde> <Greek_upsilondieresis> : "ῧ" U1FE7 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI
-<Multi_key> <asciitilde> <Greek_upsilondieresis> : "ῧ" U1FE7 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI
-<dead_tilde> <dead_diaeresis> <Greek_upsilon> : "ῧ" U1FE7 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI
-<dead_tilde> <Multi_key> <quotedbl> <Greek_upsilon> : "ῧ" U1FE7 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI
-<Multi_key> <asciitilde> <dead_diaeresis> <Greek_upsilon> : "ῧ" U1FE7 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI
-<Multi_key> <asciitilde> <quotedbl> <Greek_upsilon> : "ῧ" U1FE7 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI
-<dead_breve> <Greek_UPSILON> : "Ῠ" U1FE8 # GREEK CAPITAL LETTER UPSILON WITH VRACHY
-<Multi_key> <U> <Greek_UPSILON> : "Ῠ" U1FE8 # GREEK CAPITAL LETTER UPSILON WITH VRACHY
-<Multi_key> <b> <Greek_UPSILON> : "Ῠ" U1FE8 # GREEK CAPITAL LETTER UPSILON WITH VRACHY
-<dead_macron> <Greek_UPSILON> : "Ῡ" U1FE9 # GREEK CAPITAL LETTER UPSILON WITH MACRON
-<Multi_key> <macron> <Greek_UPSILON> : "Ῡ" U1FE9 # GREEK CAPITAL LETTER UPSILON WITH MACRON
-<Multi_key> <underscore> <Greek_UPSILON> : "Ῡ" U1FE9 # GREEK CAPITAL LETTER UPSILON WITH MACRON
-<dead_grave> <Greek_UPSILON> : "Ὺ" U1FEA # GREEK CAPITAL LETTER UPSILON WITH VARIA
-<Multi_key> <grave> <Greek_UPSILON> : "Ὺ" U1FEA # GREEK CAPITAL LETTER UPSILON WITH VARIA
-<dead_dasia> <Greek_RHO> : "Ῥ" U1FEC # GREEK CAPITAL LETTER RHO WITH DASIA
-<Multi_key> <parenleft> <Greek_RHO> : "Ῥ" U1FEC # GREEK CAPITAL LETTER RHO WITH DASIA
-<Multi_key> <diaeresis> <dead_grave> : "῭" U1FED # GREEK DIALYTIKA AND VARIA
-<Multi_key> <diaeresis> <grave> : "῭" U1FED # GREEK DIALYTIKA AND VARIA
-<dead_iota> <U1F7C> : "ῲ" U1FF2 # GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1F7C> : "ῲ" U1FF2 # GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI
-<dead_iota> <dead_grave> <Greek_omega> : "ῲ" U1FF2 # GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <grave> <Greek_omega> : "ῲ" U1FF2 # GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_grave> <Greek_omega> : "ῲ" U1FF2 # GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <grave> <Greek_omega> : "ῲ" U1FF2 # GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI
-<dead_iota> <Greek_omega> : "ῳ" U1FF3 # GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <Greek_omega> : "ῳ" U1FF3 # GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI
-<dead_iota> <Greek_omegaaccent> : "ῴ" U1FF4 # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <Greek_omegaaccent> : "ῴ" U1FF4 # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
-<dead_iota> <dead_acute> <Greek_omega> : "ῴ" U1FF4 # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <acute> <Greek_omega> : "ῴ" U1FF4 # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <apostrophe> <Greek_omega> : "ῴ" U1FF4 # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_acute> <Greek_omega> : "ῴ" U1FF4 # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <acute> <Greek_omega> : "ῴ" U1FF4 # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <apostrophe> <Greek_omega> : "ῴ" U1FF4 # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
-<dead_tilde> <Greek_omega> : "ῶ" U1FF6 # GREEK SMALL LETTER OMEGA WITH PERISPOMENI
-<Multi_key> <asciitilde> <Greek_omega> : "ῶ" U1FF6 # GREEK SMALL LETTER OMEGA WITH PERISPOMENI
-<dead_iota> <U1FF6> : "ῷ" U1FF7 # GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <U1FF6> : "ῷ" U1FF7 # GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <dead_tilde> <Greek_omega> : "ῷ" U1FF7 # GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI
-<dead_iota> <Multi_key> <asciitilde> <Greek_omega> : "ῷ" U1FF7 # GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <dead_tilde> <Greek_omega> : "ῷ" U1FF7 # GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI
-<Multi_key> <Greek_iota> <asciitilde> <Greek_omega> : "ῷ" U1FF7 # GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI
-<dead_grave> <Greek_OMICRON> : "Ὸ" U1FF8 # GREEK CAPITAL LETTER OMICRON WITH VARIA
-<Multi_key> <grave> <Greek_OMICRON> : "Ὸ" U1FF8 # GREEK CAPITAL LETTER OMICRON WITH VARIA
-<dead_grave> <Greek_OMEGA> : "Ὼ" U1FFA # GREEK CAPITAL LETTER OMEGA WITH VARIA
-<Multi_key> <grave> <Greek_OMEGA> : "Ὼ" U1FFA # GREEK CAPITAL LETTER OMEGA WITH VARIA
-<dead_iota> <Greek_OMEGA> : "ῼ" U1FFC # GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI
-<Multi_key> <Greek_iota> <Greek_OMEGA> : "ῼ" U1FFC # GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI
-<dead_circumflex> <0> : "⁰" U2070 # SUPERSCRIPT ZERO
-<Multi_key> <asciicircum> <0> : "⁰" U2070 # SUPERSCRIPT ZERO
-<dead_circumflex> <KP_0> : "⁰" U2070 # SUPERSCRIPT ZERO
-<Multi_key> <asciicircum> <KP_0> : "⁰" U2070 # SUPERSCRIPT ZERO
-<dead_circumflex> <Multi_key> <underscore> <i> : "ⁱ" U2071 # SUPERSCRIPT LATIN SMALL LETTER I
-<Multi_key> <asciicircum> <underscore> <i> : "ⁱ" U2071 # SUPERSCRIPT LATIN SMALL LETTER I
-<dead_circumflex> <Multi_key> <underbar> <i> : "ⁱ" U2071 # SUPERSCRIPT LATIN SMALL LETTER I
-<Multi_key> <asciicircum> <underbar> <i> : "ⁱ" U2071 # SUPERSCRIPT LATIN SMALL LETTER I
-<dead_circumflex> <4> : "⁴" U2074 # SUPERSCRIPT FOUR
-<Multi_key> <asciicircum> <4> : "⁴" U2074 # SUPERSCRIPT FOUR
-<dead_circumflex> <KP_4> : "⁴" U2074 # SUPERSCRIPT FOUR
-<Multi_key> <asciicircum> <KP_4> : "⁴" U2074 # SUPERSCRIPT FOUR
-<dead_circumflex> <5> : "⁵" U2075 # SUPERSCRIPT FIVE
-<Multi_key> <asciicircum> <5> : "⁵" U2075 # SUPERSCRIPT FIVE
-<dead_circumflex> <KP_5> : "⁵" U2075 # SUPERSCRIPT FIVE
-<Multi_key> <asciicircum> <KP_5> : "⁵" U2075 # SUPERSCRIPT FIVE
-<dead_circumflex> <6> : "⁶" U2076 # SUPERSCRIPT SIX
-<Multi_key> <asciicircum> <6> : "⁶" U2076 # SUPERSCRIPT SIX
-<dead_circumflex> <KP_6> : "⁶" U2076 # SUPERSCRIPT SIX
-<Multi_key> <asciicircum> <KP_6> : "⁶" U2076 # SUPERSCRIPT SIX
-<dead_circumflex> <7> : "⁷" U2077 # SUPERSCRIPT SEVEN
-<Multi_key> <asciicircum> <7> : "⁷" U2077 # SUPERSCRIPT SEVEN
-<dead_circumflex> <KP_7> : "⁷" U2077 # SUPERSCRIPT SEVEN
-<Multi_key> <asciicircum> <KP_7> : "⁷" U2077 # SUPERSCRIPT SEVEN
-<dead_circumflex> <8> : "⁸" U2078 # SUPERSCRIPT EIGHT
-<Multi_key> <asciicircum> <8> : "⁸" U2078 # SUPERSCRIPT EIGHT
-<dead_circumflex> <KP_8> : "⁸" U2078 # SUPERSCRIPT EIGHT
-<Multi_key> <asciicircum> <KP_8> : "⁸" U2078 # SUPERSCRIPT EIGHT
-<dead_circumflex> <9> : "⁹" U2079 # SUPERSCRIPT NINE
-<Multi_key> <asciicircum> <9> : "⁹" U2079 # SUPERSCRIPT NINE
-<dead_circumflex> <KP_9> : "⁹" U2079 # SUPERSCRIPT NINE
-<Multi_key> <asciicircum> <KP_9> : "⁹" U2079 # SUPERSCRIPT NINE
-<dead_circumflex> <plus> : "⁺" U207A # SUPERSCRIPT PLUS SIGN
-<Multi_key> <asciicircum> <plus> : "⁺" U207A # SUPERSCRIPT PLUS SIGN
-<dead_circumflex> <KP_Add> : "⁺" U207A # SUPERSCRIPT PLUS SIGN
-<Multi_key> <asciicircum> <KP_Add> : "⁺" U207A # SUPERSCRIPT PLUS SIGN
-<dead_circumflex> <U2212> : "⁻" U207B # SUPERSCRIPT MINUS
-<Multi_key> <asciicircum> <U2212> : "⁻" U207B # SUPERSCRIPT MINUS
-<dead_circumflex> <equal> : "⁼" U207C # SUPERSCRIPT EQUALS SIGN
-<Multi_key> <asciicircum> <equal> : "⁼" U207C # SUPERSCRIPT EQUALS SIGN
-<dead_circumflex> <KP_Equal> : "⁼" U207C # SUPERSCRIPT EQUALS SIGN
-<Multi_key> <asciicircum> <KP_Equal> : "⁼" U207C # SUPERSCRIPT EQUALS SIGN
-<dead_circumflex> <parenleft> : "⁽" U207D # SUPERSCRIPT LEFT PARENTHESIS
-<Multi_key> <asciicircum> <parenleft> : "⁽" U207D # SUPERSCRIPT LEFT PARENTHESIS
-<dead_circumflex> <parenright> : "⁾" U207E # SUPERSCRIPT RIGHT PARENTHESIS
-<Multi_key> <asciicircum> <parenright> : "⁾" U207E # SUPERSCRIPT RIGHT PARENTHESIS
-<dead_circumflex> <Multi_key> <underscore> <n> : "ⁿ" U207F # SUPERSCRIPT LATIN SMALL LETTER N
-<Multi_key> <asciicircum> <underscore> <n> : "ⁿ" U207F # SUPERSCRIPT LATIN SMALL LETTER N
-<dead_circumflex> <Multi_key> <underbar> <n> : "ⁿ" U207F # SUPERSCRIPT LATIN SMALL LETTER N
-<Multi_key> <asciicircum> <underbar> <n> : "ⁿ" U207F # SUPERSCRIPT LATIN SMALL LETTER N
-<Multi_key> <underscore> <0> : "₀" U2080 # SUBSCRIPT ZERO
-<Multi_key> <underscore> <KP_0> : "₀" U2080 # SUBSCRIPT ZERO
-<Multi_key> <underbar> <0> : "₀" U2080 # SUBSCRIPT ZERO
-<Multi_key> <underbar> <KP_0> : "₀" U2080 # SUBSCRIPT ZERO
-<Multi_key> <underscore> <1> : "₁" U2081 # SUBSCRIPT ONE
-<Multi_key> <underscore> <KP_1> : "₁" U2081 # SUBSCRIPT ONE
-<Multi_key> <underbar> <1> : "₁" U2081 # SUBSCRIPT ONE
-<Multi_key> <underbar> <KP_1> : "₁" U2081 # SUBSCRIPT ONE
-<Multi_key> <underscore> <2> : "₂" U2082 # SUBSCRIPT TWO
-<Multi_key> <underscore> <KP_Space> : "₂" U2082 # SUBSCRIPT TWO
-<Multi_key> <underscore> <KP_2> : "₂" U2082 # SUBSCRIPT TWO
-<Multi_key> <underbar> <2> : "₂" U2082 # SUBSCRIPT TWO
-<Multi_key> <underbar> <KP_Space> : "₂" U2082 # SUBSCRIPT TWO
-<Multi_key> <underbar> <KP_2> : "₂" U2082 # SUBSCRIPT TWO
-<Multi_key> <underscore> <3> : "₃" U2083 # SUBSCRIPT THREE
-<Multi_key> <underscore> <KP_3> : "₃" U2083 # SUBSCRIPT THREE
-<Multi_key> <underbar> <3> : "₃" U2083 # SUBSCRIPT THREE
-<Multi_key> <underbar> <KP_3> : "₃" U2083 # SUBSCRIPT THREE
-<Multi_key> <underscore> <4> : "₄" U2084 # SUBSCRIPT FOUR
-<Multi_key> <underscore> <KP_4> : "₄" U2084 # SUBSCRIPT FOUR
-<Multi_key> <underbar> <4> : "₄" U2084 # SUBSCRIPT FOUR
-<Multi_key> <underbar> <KP_4> : "₄" U2084 # SUBSCRIPT FOUR
-<Multi_key> <underscore> <5> : "₅" U2085 # SUBSCRIPT FIVE
-<Multi_key> <underscore> <KP_5> : "₅" U2085 # SUBSCRIPT FIVE
-<Multi_key> <underbar> <5> : "₅" U2085 # SUBSCRIPT FIVE
-<Multi_key> <underbar> <KP_5> : "₅" U2085 # SUBSCRIPT FIVE
-<Multi_key> <underscore> <6> : "₆" U2086 # SUBSCRIPT SIX
-<Multi_key> <underscore> <KP_6> : "₆" U2086 # SUBSCRIPT SIX
-<Multi_key> <underbar> <6> : "₆" U2086 # SUBSCRIPT SIX
-<Multi_key> <underbar> <KP_6> : "₆" U2086 # SUBSCRIPT SIX
-<Multi_key> <underscore> <7> : "₇" U2087 # SUBSCRIPT SEVEN
-<Multi_key> <underscore> <KP_7> : "₇" U2087 # SUBSCRIPT SEVEN
-<Multi_key> <underbar> <7> : "₇" U2087 # SUBSCRIPT SEVEN
-<Multi_key> <underbar> <KP_7> : "₇" U2087 # SUBSCRIPT SEVEN
-<Multi_key> <underscore> <8> : "₈" U2088 # SUBSCRIPT EIGHT
-<Multi_key> <underscore> <KP_8> : "₈" U2088 # SUBSCRIPT EIGHT
-<Multi_key> <underbar> <8> : "₈" U2088 # SUBSCRIPT EIGHT
-<Multi_key> <underbar> <KP_8> : "₈" U2088 # SUBSCRIPT EIGHT
-<Multi_key> <underscore> <9> : "₉" U2089 # SUBSCRIPT NINE
-<Multi_key> <underscore> <KP_9> : "₉" U2089 # SUBSCRIPT NINE
-<Multi_key> <underbar> <9> : "₉" U2089 # SUBSCRIPT NINE
-<Multi_key> <underbar> <KP_9> : "₉" U2089 # SUBSCRIPT NINE
-<Multi_key> <underscore> <plus> : "₊" U208A # SUBSCRIPT PLUS SIGN
-<Multi_key> <underscore> <KP_Add> : "₊" U208A # SUBSCRIPT PLUS SIGN
-<Multi_key> <underbar> <plus> : "₊" U208A # SUBSCRIPT PLUS SIGN
-<Multi_key> <underbar> <KP_Add> : "₊" U208A # SUBSCRIPT PLUS SIGN
-<Multi_key> <underscore> <U2212> : "₋" U208B # SUBSCRIPT MINUS
-<Multi_key> <underbar> <U2212> : "₋" U208B # SUBSCRIPT MINUS
-<Multi_key> <underscore> <equal> : "₌" U208C # SUBSCRIPT EQUALS SIGN
-<Multi_key> <underscore> <KP_Equal> : "₌" U208C # SUBSCRIPT EQUALS SIGN
-<Multi_key> <underbar> <equal> : "₌" U208C # SUBSCRIPT EQUALS SIGN
-<Multi_key> <underbar> <KP_Equal> : "₌" U208C # SUBSCRIPT EQUALS SIGN
-<Multi_key> <underscore> <parenleft> : "₍" U208D # SUBSCRIPT LEFT PARENTHESIS
-<Multi_key> <underbar> <parenleft> : "₍" U208D # SUBSCRIPT LEFT PARENTHESIS
-<Multi_key> <underscore> <parenright> : "₎" U208E # SUBSCRIPT RIGHT PARENTHESIS
-<Multi_key> <underbar> <parenright> : "₎" U208E # SUBSCRIPT RIGHT PARENTHESIS
-<dead_circumflex> <Multi_key> <S> <M> : "℠" U2120 # SERVICE MARK
-<Multi_key> <S> <M> : "℠" U2120 # SERVICE MARK
-<dead_circumflex> <Multi_key> <s> <M> : "℠" U2120 # SERVICE MARK
-<Multi_key> <s> <M> : "℠" U2120 # SERVICE MARK
-<dead_circumflex> <Multi_key> <S> <m> : "℠" U2120 # SERVICE MARK
-<Multi_key> <S> <m> : "℠" U2120 # SERVICE MARK
-<dead_circumflex> <Multi_key> <s> <m> : "℠" U2120 # SERVICE MARK
-<Multi_key> <s> <m> : "℠" U2120 # SERVICE MARK
-<dead_circumflex> <Multi_key> <T> <M> : "™" U2122 # TRADE MARK SIGN
-<Multi_key> <T> <M> : "™" U2122 # TRADE MARK SIGN
-<dead_circumflex> <Multi_key> <t> <M> : "™" U2122 # TRADE MARK SIGN
-<Multi_key> <t> <M> : "™" U2122 # TRADE MARK SIGN
-<dead_circumflex> <Multi_key> <T> <m> : "™" U2122 # TRADE MARK SIGN
-<Multi_key> <T> <m> : "™" U2122 # TRADE MARK SIGN
-<dead_circumflex> <Multi_key> <t> <m> : "™" U2122 # TRADE MARK SIGN
-<Multi_key> <t> <m> : "™" U2122 # TRADE MARK SIGN
-<Multi_key> <1> <3> : "⅓" U2153 # VULGAR FRACTION ONE THIRD
-<Multi_key> <2> <3> : "⅔" U2154 # VULGAR FRACTION TWO THIRDS
-<Multi_key> <1> <5> : "⅕" U2155 # VULGAR FRACTION ONE FIFTH
-<Multi_key> <2> <5> : "⅖" U2156 # VULGAR FRACTION TWO FIFTHS
-<Multi_key> <3> <5> : "⅗" U2157 # VULGAR FRACTION THREE FIFTHS
-<Multi_key> <4> <5> : "⅘" U2158 # VULGAR FRACTION FOUR FIFTHS
-<Multi_key> <1> <6> : "⅙" U2159 # VULGAR FRACTION ONE SIXTH
-<Multi_key> <5> <6> : "⅚" U215A # VULGAR FRACTION FIVE SIXTHS
-<Multi_key> <1> <8> : "⅛" U215B # VULGAR FRACTION ONE EIGHTH
-<Multi_key> <3> <8> : "⅜" U215C # VULGAR FRACTION THREE EIGHTHS
-<Multi_key> <5> <8> : "⅝" U215D # VULGAR FRACTION FIVE EIGHTHS
-<Multi_key> <7> <8> : "⅞" U215E # VULGAR FRACTION SEVEN EIGHTHS
-<Multi_key> <slash> <leftarrow> : "↚" U219A # LEFTWARDS ARROW WITH STROKE
-<Multi_key> <KP_Divide> <leftarrow> : "↚" U219A # LEFTWARDS ARROW WITH STROKE
-<Multi_key> <slash> <rightarrow> : "↛" U219B # RIGHTWARDS ARROW WITH STROKE
-<Multi_key> <KP_Divide> <rightarrow> : "↛" U219B # RIGHTWARDS ARROW WITH STROKE
-<Multi_key> <slash> <U2194> : "↮" U21AE # LEFT RIGHT ARROW WITH STROKE
-<Multi_key> <KP_Divide> <U2194> : "↮" U21AE # LEFT RIGHT ARROW WITH STROKE
-<Multi_key> <less> <minus> : "←" U2190 # LEFTWARDS ARROW
-<Multi_key> <minus> <greater> : "→" U2192 # RIGHTWARDS ARROW
-<Multi_key> <U2203> <U0338> : "∄" U2204 # THERE DOES NOT EXIST
-<Multi_key> <U2208> <U0338> : "∉" U2209 # NOT AN ELEMENT OF
-<Multi_key> <U220B> <U0338> : "∌" U220C # DOES NOT CONTAIN AS MEMBER
-<Multi_key> <U2223> <U0338> : "∤" U2224 # DOES NOT DIVIDE
-<Multi_key> <U2225> <U0338> : "∦" U2226 # NOT PARALLEL TO
-<Multi_key> <U223C> <U0338> : "≁" U2241 # NOT TILDE
-<Multi_key> <U2243> <U0338> : "≄" U2244 # NOT ASYMPTOTICALLY EQUAL TO
-<Multi_key> <approximate> <U0338> : "≇" U2247 # NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO
-<Multi_key> <U2248> <U0338> : "≉" U2249 # NOT ALMOST EQUAL TO
-<Multi_key> <slash> <equal> : "≠" U2260 # NOT EQUAL TO
-<Multi_key> <equal> <slash> : "≠" U2260 # NOT EQUAL TO
-<Multi_key> <equal> <U0338> : "≠" U2260 # NOT EQUAL TO
-<Multi_key> <KP_Equal> <U0338> : "≠" U2260 # NOT EQUAL TO
-<Multi_key> <identical> <U0338> : "≢" U2262 # NOT IDENTICAL TO
-<Multi_key> <less> <equal> : "≤" U2264 # LESS-THAN OR EQUAL TO
-<Multi_key> <greater> <equal> : "≥" U2265 # GREATER-THAN OR EQUAL TO
-<Multi_key> <U224D> <U0338> : "≭" U226D # NOT EQUIVALENT TO
-<Multi_key> <less> <U0338> : "≮" U226E # NOT LESS-THAN
-<Multi_key> <leftcaret> <U0338> : "≮" U226E # NOT LESS-THAN
-<Multi_key> <greater> <U0338> : "≯" U226F # NOT GREATER-THAN
-<Multi_key> <rightcaret> <U0338> : "≯" U226F # NOT GREATER-THAN
-<Multi_key> <lessthanequal> <U0338> : "≰" U2270 # NEITHER LESS-THAN NOR EQUAL TO
-<Multi_key> <greaterthanequal> <U0338> : "≱" U2271 # NEITHER GREATER-THAN NOR EQUAL TO
-<Multi_key> <U2272> <U0338> : "≴" U2274 # NEITHER LESS-THAN NOR EQUIVALENT TO
-<Multi_key> <U2273> <U0338> : "≵" U2275 # NEITHER GREATER-THAN NOR EQUIVALENT TO
-<Multi_key> <U2276> <U0338> : "≸" U2278 # NEITHER LESS-THAN NOR GREATER-THAN
-<Multi_key> <U2277> <U0338> : "≹" U2279 # NEITHER GREATER-THAN NOR LESS-THAN
-<Multi_key> <U227A> <U0338> : "⊀" U2280 # DOES NOT PRECEDE
-<Multi_key> <U227B> <U0338> : "⊁" U2281 # DOES NOT SUCCEED
-<Multi_key> <includedin> <U0338> : "⊄" U2284 # NOT A SUBSET OF
-<Multi_key> <leftshoe> <U0338> : "⊄" U2284 # NOT A SUBSET OF
-<Multi_key> <includes> <U0338> : "⊅" U2285 # NOT A SUPERSET OF
-<Multi_key> <rightshoe> <U0338> : "⊅" U2285 # NOT A SUPERSET OF
-<Multi_key> <U2286> <U0338> : "⊈" U2288 # NEITHER A SUBSET OF NOR EQUAL TO
-<Multi_key> <U2287> <U0338> : "⊉" U2289 # NEITHER A SUPERSET OF NOR EQUAL TO
-<Multi_key> <righttack> <U0338> : "⊬" U22AC # DOES NOT PROVE
-<Multi_key> <U22A8> <U0338> : "⊭" U22AD # NOT TRUE
-<Multi_key> <U22A9> <U0338> : "⊮" U22AE # DOES NOT FORCE
-<Multi_key> <U22AB> <U0338> : "⊯" U22AF # NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
-<Multi_key> <U227C> <U0338> : "⋠" U22E0 # DOES NOT PRECEDE OR EQUAL
-<Multi_key> <U227D> <U0338> : "⋡" U22E1 # DOES NOT SUCCEED OR EQUAL
-<Multi_key> <U2291> <U0338> : "⋢" U22E2 # NOT SQUARE IMAGE OF OR EQUAL TO
-<Multi_key> <U2292> <U0338> : "⋣" U22E3 # NOT SQUARE ORIGINAL OF OR EQUAL TO
-<Multi_key> <U22B2> <U0338> : "⋪" U22EA # NOT NORMAL SUBGROUP OF
-<Multi_key> <U22B3> <U0338> : "⋫" U22EB # DOES NOT CONTAIN AS NORMAL SUBGROUP
-<Multi_key> <U22B4> <U0338> : "⋬" U22EC # NOT NORMAL SUBGROUP OF OR EQUAL TO
-<Multi_key> <U22B5> <U0338> : "⋭" U22ED # DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL
-<Multi_key> <parenleft> <1> <parenright> : "①" U2460 # CIRCLED DIGIT ONE
-<Multi_key> <parenleft> <KP_1> <parenright> : "①" U2460 # CIRCLED DIGIT ONE
-<Multi_key> <parenleft> <2> <parenright> : "②" U2461 # CIRCLED DIGIT TWO
-<Multi_key> <parenleft> <KP_Space> <parenright> : "②" U2461 # CIRCLED DIGIT TWO
-<Multi_key> <parenleft> <KP_2> <parenright> : "②" U2461 # CIRCLED DIGIT TWO
-<Multi_key> <parenleft> <3> <parenright> : "③" U2462 # CIRCLED DIGIT THREE
-<Multi_key> <parenleft> <KP_3> <parenright> : "③" U2462 # CIRCLED DIGIT THREE
-<Multi_key> <parenleft> <4> <parenright> : "④" U2463 # CIRCLED DIGIT FOUR
-<Multi_key> <parenleft> <KP_4> <parenright> : "④" U2463 # CIRCLED DIGIT FOUR
-<Multi_key> <parenleft> <5> <parenright> : "⑤" U2464 # CIRCLED DIGIT FIVE
-<Multi_key> <parenleft> <KP_5> <parenright> : "⑤" U2464 # CIRCLED DIGIT FIVE
-<Multi_key> <parenleft> <6> <parenright> : "⑥" U2465 # CIRCLED DIGIT SIX
-<Multi_key> <parenleft> <KP_6> <parenright> : "⑥" U2465 # CIRCLED DIGIT SIX
-<Multi_key> <parenleft> <7> <parenright> : "⑦" U2466 # CIRCLED DIGIT SEVEN
-<Multi_key> <parenleft> <KP_7> <parenright> : "⑦" U2466 # CIRCLED DIGIT SEVEN
-<Multi_key> <parenleft> <8> <parenright> : "⑧" U2467 # CIRCLED DIGIT EIGHT
-<Multi_key> <parenleft> <KP_8> <parenright> : "⑧" U2467 # CIRCLED DIGIT EIGHT
-<Multi_key> <parenleft> <9> <parenright> : "⑨" U2468 # CIRCLED DIGIT NINE
-<Multi_key> <parenleft> <KP_9> <parenright> : "⑨" U2468 # CIRCLED DIGIT NINE
-<Multi_key> <parenleft> <1> <0> <parenright> : "⑩" U2469 # CIRCLED NUMBER TEN
-<Multi_key> <parenleft> <1> <KP_0> <parenright> : "⑩" U2469 # CIRCLED NUMBER TEN
-<Multi_key> <parenleft> <KP_1> <0> <parenright> : "⑩" U2469 # CIRCLED NUMBER TEN
-<Multi_key> <parenleft> <KP_1> <KP_0> <parenright> : "⑩" U2469 # CIRCLED NUMBER TEN
-<Multi_key> <parenleft> <1> <1> <parenright> : "⑪" U246A # CIRCLED NUMBER ELEVEN
-<Multi_key> <parenleft> <1> <KP_1> <parenright> : "⑪" U246A # CIRCLED NUMBER ELEVEN
-<Multi_key> <parenleft> <KP_1> <1> <parenright> : "⑪" U246A # CIRCLED NUMBER ELEVEN
-<Multi_key> <parenleft> <KP_1> <KP_1> <parenright> : "⑪" U246A # CIRCLED NUMBER ELEVEN
-<Multi_key> <parenleft> <1> <2> <parenright> : "⑫" U246B # CIRCLED NUMBER TWELVE
-<Multi_key> <parenleft> <1> <KP_Space> <parenright> : "⑫" U246B # CIRCLED NUMBER TWELVE
-<Multi_key> <parenleft> <1> <KP_2> <parenright> : "⑫" U246B # CIRCLED NUMBER TWELVE
-<Multi_key> <parenleft> <KP_1> <2> <parenright> : "⑫" U246B # CIRCLED NUMBER TWELVE
-<Multi_key> <parenleft> <KP_1> <KP_Space> <parenright> : "⑫" U246B # CIRCLED NUMBER TWELVE
-<Multi_key> <parenleft> <KP_1> <KP_2> <parenright> : "⑫" U246B # CIRCLED NUMBER TWELVE
-<Multi_key> <parenleft> <1> <3> <parenright> : "⑬" U246C # CIRCLED NUMBER THIRTEEN
-<Multi_key> <parenleft> <1> <KP_3> <parenright> : "⑬" U246C # CIRCLED NUMBER THIRTEEN
-<Multi_key> <parenleft> <KP_1> <3> <parenright> : "⑬" U246C # CIRCLED NUMBER THIRTEEN
-<Multi_key> <parenleft> <KP_1> <KP_3> <parenright> : "⑬" U246C # CIRCLED NUMBER THIRTEEN
-<Multi_key> <parenleft> <1> <4> <parenright> : "⑭" U246D # CIRCLED NUMBER FOURTEEN
-<Multi_key> <parenleft> <1> <KP_4> <parenright> : "⑭" U246D # CIRCLED NUMBER FOURTEEN
-<Multi_key> <parenleft> <KP_1> <4> <parenright> : "⑭" U246D # CIRCLED NUMBER FOURTEEN
-<Multi_key> <parenleft> <KP_1> <KP_4> <parenright> : "⑭" U246D # CIRCLED NUMBER FOURTEEN
-<Multi_key> <parenleft> <1> <5> <parenright> : "⑮" U246E # CIRCLED NUMBER FIFTEEN
-<Multi_key> <parenleft> <1> <KP_5> <parenright> : "⑮" U246E # CIRCLED NUMBER FIFTEEN
-<Multi_key> <parenleft> <KP_1> <5> <parenright> : "⑮" U246E # CIRCLED NUMBER FIFTEEN
-<Multi_key> <parenleft> <KP_1> <KP_5> <parenright> : "⑮" U246E # CIRCLED NUMBER FIFTEEN
-<Multi_key> <parenleft> <1> <6> <parenright> : "⑯" U246F # CIRCLED NUMBER SIXTEEN
-<Multi_key> <parenleft> <1> <KP_6> <parenright> : "⑯" U246F # CIRCLED NUMBER SIXTEEN
-<Multi_key> <parenleft> <KP_1> <6> <parenright> : "⑯" U246F # CIRCLED NUMBER SIXTEEN
-<Multi_key> <parenleft> <KP_1> <KP_6> <parenright> : "⑯" U246F # CIRCLED NUMBER SIXTEEN
-<Multi_key> <parenleft> <1> <7> <parenright> : "⑰" U2470 # CIRCLED NUMBER SEVENTEEN
-<Multi_key> <parenleft> <1> <KP_7> <parenright> : "⑰" U2470 # CIRCLED NUMBER SEVENTEEN
-<Multi_key> <parenleft> <KP_1> <7> <parenright> : "⑰" U2470 # CIRCLED NUMBER SEVENTEEN
-<Multi_key> <parenleft> <KP_1> <KP_7> <parenright> : "⑰" U2470 # CIRCLED NUMBER SEVENTEEN
-<Multi_key> <parenleft> <1> <8> <parenright> : "⑱" U2471 # CIRCLED NUMBER EIGHTEEN
-<Multi_key> <parenleft> <1> <KP_8> <parenright> : "⑱" U2471 # CIRCLED NUMBER EIGHTEEN
-<Multi_key> <parenleft> <KP_1> <8> <parenright> : "⑱" U2471 # CIRCLED NUMBER EIGHTEEN
-<Multi_key> <parenleft> <KP_1> <KP_8> <parenright> : "⑱" U2471 # CIRCLED NUMBER EIGHTEEN
-<Multi_key> <parenleft> <1> <9> <parenright> : "⑲" U2472 # CIRCLED NUMBER NINETEEN
-<Multi_key> <parenleft> <1> <KP_9> <parenright> : "⑲" U2472 # CIRCLED NUMBER NINETEEN
-<Multi_key> <parenleft> <KP_1> <9> <parenright> : "⑲" U2472 # CIRCLED NUMBER NINETEEN
-<Multi_key> <parenleft> <KP_1> <KP_9> <parenright> : "⑲" U2472 # CIRCLED NUMBER NINETEEN
-<Multi_key> <parenleft> <2> <0> <parenright> : "⑳" U2473 # CIRCLED NUMBER TWENTY
-<Multi_key> <parenleft> <2> <KP_0> <parenright> : "⑳" U2473 # CIRCLED NUMBER TWENTY
-<Multi_key> <parenleft> <KP_Space> <0> <parenright> : "⑳" U2473 # CIRCLED NUMBER TWENTY
-<Multi_key> <parenleft> <KP_Space> <KP_0> <parenright> : "⑳" U2473 # CIRCLED NUMBER TWENTY
-<Multi_key> <parenleft> <KP_2> <0> <parenright> : "⑳" U2473 # CIRCLED NUMBER TWENTY
-<Multi_key> <parenleft> <KP_2> <KP_0> <parenright> : "⑳" U2473 # CIRCLED NUMBER TWENTY
-<Multi_key> <parenleft> <A> <parenright> : "Ⓐ" U24B6 # CIRCLED LATIN CAPITAL LETTER A
-<Multi_key> <parenleft> <B> <parenright> : "Ⓑ" U24B7 # CIRCLED LATIN CAPITAL LETTER B
-<Multi_key> <parenleft> <C> <parenright> : "Ⓒ" U24B8 # CIRCLED LATIN CAPITAL LETTER C
-<Multi_key> <parenleft> <D> <parenright> : "Ⓓ" U24B9 # CIRCLED LATIN CAPITAL LETTER D
-<Multi_key> <parenleft> <E> <parenright> : "Ⓔ" U24BA # CIRCLED LATIN CAPITAL LETTER E
-<Multi_key> <parenleft> <F> <parenright> : "Ⓕ" U24BB # CIRCLED LATIN CAPITAL LETTER F
-<Multi_key> <parenleft> <G> <parenright> : "Ⓖ" U24BC # CIRCLED LATIN CAPITAL LETTER G
-<Multi_key> <parenleft> <H> <parenright> : "Ⓗ" U24BD # CIRCLED LATIN CAPITAL LETTER H
-<Multi_key> <parenleft> <I> <parenright> : "Ⓘ" U24BE # CIRCLED LATIN CAPITAL LETTER I
-<Multi_key> <parenleft> <J> <parenright> : "Ⓙ" U24BF # CIRCLED LATIN CAPITAL LETTER J
-<Multi_key> <parenleft> <K> <parenright> : "Ⓚ" U24C0 # CIRCLED LATIN CAPITAL LETTER K
-<Multi_key> <parenleft> <L> <parenright> : "Ⓛ" U24C1 # CIRCLED LATIN CAPITAL LETTER L
-<Multi_key> <parenleft> <M> <parenright> : "Ⓜ" U24C2 # CIRCLED LATIN CAPITAL LETTER M
-<Multi_key> <parenleft> <N> <parenright> : "Ⓝ" U24C3 # CIRCLED LATIN CAPITAL LETTER N
-<Multi_key> <parenleft> <O> <parenright> : "Ⓞ" U24C4 # CIRCLED LATIN CAPITAL LETTER O
-<Multi_key> <parenleft> <P> <parenright> : "Ⓟ" U24C5 # CIRCLED LATIN CAPITAL LETTER P
-<Multi_key> <parenleft> <Q> <parenright> : "Ⓠ" U24C6 # CIRCLED LATIN CAPITAL LETTER Q
-<Multi_key> <parenleft> <R> <parenright> : "Ⓡ" U24C7 # CIRCLED LATIN CAPITAL LETTER R
-<Multi_key> <parenleft> <S> <parenright> : "Ⓢ" U24C8 # CIRCLED LATIN CAPITAL LETTER S
-<Multi_key> <parenleft> <T> <parenright> : "Ⓣ" U24C9 # CIRCLED LATIN CAPITAL LETTER T
-<Multi_key> <parenleft> <U> <parenright> : "Ⓤ" U24CA # CIRCLED LATIN CAPITAL LETTER U
-<Multi_key> <parenleft> <V> <parenright> : "Ⓥ" U24CB # CIRCLED LATIN CAPITAL LETTER V
-<Multi_key> <parenleft> <W> <parenright> : "Ⓦ" U24CC # CIRCLED LATIN CAPITAL LETTER W
-<Multi_key> <parenleft> <X> <parenright> : "Ⓧ" U24CD # CIRCLED LATIN CAPITAL LETTER X
-<Multi_key> <parenleft> <Y> <parenright> : "Ⓨ" U24CE # CIRCLED LATIN CAPITAL LETTER Y
-<Multi_key> <parenleft> <Z> <parenright> : "Ⓩ" U24CF # CIRCLED LATIN CAPITAL LETTER Z
-<Multi_key> <parenleft> <a> <parenright> : "ⓐ" U24D0 # CIRCLED LATIN SMALL LETTER A
-<Multi_key> <parenleft> <b> <parenright> : "ⓑ" U24D1 # CIRCLED LATIN SMALL LETTER B
-<Multi_key> <parenleft> <c> <parenright> : "ⓒ" U24D2 # CIRCLED LATIN SMALL LETTER C
-<Multi_key> <parenleft> <d> <parenright> : "ⓓ" U24D3 # CIRCLED LATIN SMALL LETTER D
-<Multi_key> <parenleft> <e> <parenright> : "ⓔ" U24D4 # CIRCLED LATIN SMALL LETTER E
-<Multi_key> <parenleft> <f> <parenright> : "ⓕ" U24D5 # CIRCLED LATIN SMALL LETTER F
-<Multi_key> <parenleft> <g> <parenright> : "ⓖ" U24D6 # CIRCLED LATIN SMALL LETTER G
-<Multi_key> <parenleft> <h> <parenright> : "ⓗ" U24D7 # CIRCLED LATIN SMALL LETTER H
-<Multi_key> <parenleft> <i> <parenright> : "ⓘ" U24D8 # CIRCLED LATIN SMALL LETTER I
-<Multi_key> <parenleft> <j> <parenright> : "ⓙ" U24D9 # CIRCLED LATIN SMALL LETTER J
-<Multi_key> <parenleft> <k> <parenright> : "ⓚ" U24DA # CIRCLED LATIN SMALL LETTER K
-<Multi_key> <parenleft> <l> <parenright> : "ⓛ" U24DB # CIRCLED LATIN SMALL LETTER L
-<Multi_key> <parenleft> <m> <parenright> : "ⓜ" U24DC # CIRCLED LATIN SMALL LETTER M
-<Multi_key> <parenleft> <n> <parenright> : "ⓝ" U24DD # CIRCLED LATIN SMALL LETTER N
-<Multi_key> <parenleft> <o> <parenright> : "ⓞ" U24DE # CIRCLED LATIN SMALL LETTER O
-<Multi_key> <parenleft> <p> <parenright> : "ⓟ" U24DF # CIRCLED LATIN SMALL LETTER P
-<Multi_key> <parenleft> <q> <parenright> : "ⓠ" U24E0 # CIRCLED LATIN SMALL LETTER Q
-<Multi_key> <parenleft> <r> <parenright> : "ⓡ" U24E1 # CIRCLED LATIN SMALL LETTER R
-<Multi_key> <parenleft> <s> <parenright> : "ⓢ" U24E2 # CIRCLED LATIN SMALL LETTER S
-<Multi_key> <parenleft> <t> <parenright> : "ⓣ" U24E3 # CIRCLED LATIN SMALL LETTER T
-<Multi_key> <parenleft> <u> <parenright> : "ⓤ" U24E4 # CIRCLED LATIN SMALL LETTER U
-<Multi_key> <parenleft> <v> <parenright> : "ⓥ" U24E5 # CIRCLED LATIN SMALL LETTER V
-<Multi_key> <parenleft> <w> <parenright> : "ⓦ" U24E6 # CIRCLED LATIN SMALL LETTER W
-<Multi_key> <parenleft> <x> <parenright> : "ⓧ" U24E7 # CIRCLED LATIN SMALL LETTER X
-<Multi_key> <parenleft> <y> <parenright> : "ⓨ" U24E8 # CIRCLED LATIN SMALL LETTER Y
-<Multi_key> <parenleft> <z> <parenright> : "ⓩ" U24E9 # CIRCLED LATIN SMALL LETTER Z
-<Multi_key> <parenleft> <0> <parenright> : "⓪" U24EA # CIRCLED DIGIT ZERO
-<Multi_key> <parenleft> <KP_0> <parenright> : "⓪" U24EA # CIRCLED DIGIT ZERO
-<dead_belowdot> <plus> : "⨥" U2A25 # PLUS SIGN WITH DOT BELOW
-<dead_belowtilde> <plus> : "⨦" U2A26 # PLUS SIGN WITH TILDE BELOW
-<dead_belowdot> <minus> : "⨪" U2A2A # MINUS SIGN WITH DOT BELOW
-<dead_belowdot> <equal> : "⩦" U2A66 # EQUALS SIGN WITH DOT BELOW
-<dead_diaeresis> <dead_belowdiaeresis> <equal> : "⩷" U2A77 # EQUALS SIGN WITH TWO DOTS ABOVE AND TWO DOTS BELOW
-<dead_belowdiaeresis> <dead_diaeresis> <equal> : "⩷" U2A77 # EQUALS SIGN WITH TWO DOTS ABOVE AND TWO DOTS BELOW
-<Multi_key> <U2ADD> <U0338> : "⫝̸" U2ADC # FORKING
-<dead_belowring> <bar> : "⫰" U2AF0 # VERTICAL LINE WITH CIRCLE BELOW
-<dead_voiced_sound> <U304B> : "が" U304C # HIRAGANA LETTER GA
-<dead_voiced_sound> <U304D> : "ぎ" U304E # HIRAGANA LETTER GI
-<dead_voiced_sound> <U304F> : "ぐ" U3050 # HIRAGANA LETTER GU
-<dead_voiced_sound> <U3051> : "げ" U3052 # HIRAGANA LETTER GE
-<dead_voiced_sound> <U3053> : "ご" U3054 # HIRAGANA LETTER GO
-<dead_voiced_sound> <U3055> : "ざ" U3056 # HIRAGANA LETTER ZA
-<dead_voiced_sound> <U3057> : "じ" U3058 # HIRAGANA LETTER ZI
-<dead_voiced_sound> <U3059> : "ず" U305A # HIRAGANA LETTER ZU
-<dead_voiced_sound> <U305B> : "ぜ" U305C # HIRAGANA LETTER ZE
-<dead_voiced_sound> <U305D> : "ぞ" U305E # HIRAGANA LETTER ZO
-<dead_voiced_sound> <U305F> : "だ" U3060 # HIRAGANA LETTER DA
-<dead_voiced_sound> <U3061> : "ぢ" U3062 # HIRAGANA LETTER DI
-<dead_voiced_sound> <U3064> : "づ" U3065 # HIRAGANA LETTER DU
-<dead_voiced_sound> <U3066> : "で" U3067 # HIRAGANA LETTER DE
-<dead_voiced_sound> <U3068> : "ど" U3069 # HIRAGANA LETTER DO
-<dead_voiced_sound> <U306F> : "ば" U3070 # HIRAGANA LETTER BA
-<dead_semivoiced_sound> <U306F> : "ぱ" U3071 # HIRAGANA LETTER PA
-<dead_voiced_sound> <U3072> : "び" U3073 # HIRAGANA LETTER BI
-<dead_semivoiced_sound> <U3072> : "ぴ" U3074 # HIRAGANA LETTER PI
-<dead_voiced_sound> <U3075> : "ぶ" U3076 # HIRAGANA LETTER BU
-<dead_semivoiced_sound> <U3075> : "ぷ" U3077 # HIRAGANA LETTER PU
-<dead_voiced_sound> <U3078> : "べ" U3079 # HIRAGANA LETTER BE
-<dead_semivoiced_sound> <U3078> : "ぺ" U307A # HIRAGANA LETTER PE
-<dead_voiced_sound> <U307B> : "ぼ" U307C # HIRAGANA LETTER BO
-<dead_semivoiced_sound> <U307B> : "ぽ" U307D # HIRAGANA LETTER PO
-<dead_voiced_sound> <U3046> : "ゔ" U3094 # HIRAGANA LETTER VU
-<dead_voiced_sound> <U309D> : "ゞ" U309E # HIRAGANA VOICED ITERATION MARK
-<dead_voiced_sound> <kana_KA> : "ガ" U30AC # KATAKANA LETTER GA
-<dead_voiced_sound> <kana_KI> : "ギ" U30AE # KATAKANA LETTER GI
-<dead_voiced_sound> <kana_KU> : "グ" U30B0 # KATAKANA LETTER GU
-<dead_voiced_sound> <kana_KE> : "ゲ" U30B2 # KATAKANA LETTER GE
-<dead_voiced_sound> <kana_KO> : "ゴ" U30B4 # KATAKANA LETTER GO
-<dead_voiced_sound> <kana_SA> : "ザ" U30B6 # KATAKANA LETTER ZA
-<dead_voiced_sound> <kana_SHI> : "ジ" U30B8 # KATAKANA LETTER ZI
-<dead_voiced_sound> <kana_SU> : "ズ" U30BA # KATAKANA LETTER ZU
-<dead_voiced_sound> <kana_SE> : "ゼ" U30BC # KATAKANA LETTER ZE
-<dead_voiced_sound> <kana_SO> : "ゾ" U30BE # KATAKANA LETTER ZO
-<dead_voiced_sound> <kana_TA> : "ダ" U30C0 # KATAKANA LETTER DA
-<dead_voiced_sound> <kana_CHI> : "ヂ" U30C2 # KATAKANA LETTER DI
-<dead_voiced_sound> <kana_TSU> : "ヅ" U30C5 # KATAKANA LETTER DU
-<dead_voiced_sound> <kana_TE> : "デ" U30C7 # KATAKANA LETTER DE
-<dead_voiced_sound> <kana_TO> : "ド" U30C9 # KATAKANA LETTER DO
-<dead_voiced_sound> <kana_HA> : "バ" U30D0 # KATAKANA LETTER BA
-<dead_semivoiced_sound> <kana_HA> : "パ" U30D1 # KATAKANA LETTER PA
-<dead_voiced_sound> <kana_HI> : "ビ" U30D3 # KATAKANA LETTER BI
-<dead_semivoiced_sound> <kana_HI> : "ピ" U30D4 # KATAKANA LETTER PI
-<dead_voiced_sound> <kana_FU> : "ブ" U30D6 # KATAKANA LETTER BU
-<dead_semivoiced_sound> <kana_FU> : "プ" U30D7 # KATAKANA LETTER PU
-<dead_voiced_sound> <kana_HE> : "ベ" U30D9 # KATAKANA LETTER BE
-<dead_semivoiced_sound> <kana_HE> : "ペ" U30DA # KATAKANA LETTER PE
-<dead_voiced_sound> <kana_HO> : "ボ" U30DC # KATAKANA LETTER BO
-<dead_semivoiced_sound> <kana_HO> : "ポ" U30DD # KATAKANA LETTER PO
-<dead_voiced_sound> <kana_U> : "ヴ" U30F4 # KATAKANA LETTER VU
-<dead_voiced_sound> <kana_WA> : "ヷ" U30F7 # KATAKANA LETTER VA
-<dead_voiced_sound> <U30F0> : "ヸ" U30F8 # KATAKANA LETTER VI
-<dead_voiced_sound> <U30F1> : "ヹ" U30F9 # KATAKANA LETTER VE
-<dead_voiced_sound> <kana_WO> : "ヺ" U30FA # KATAKANA LETTER VO
-<dead_voiced_sound> <U30FD> : "ヾ" U30FE # KATAKANA VOICED ITERATION MARK
-<dead_circumflex> <U4E00> : "㆒" U3192 # IDEOGRAPHIC ANNOTATION ONE MARK
-<Multi_key> <asciicircum> <U4E00> : "㆒" U3192 # IDEOGRAPHIC ANNOTATION ONE MARK
-<dead_circumflex> <U4E8C> : "㆓" U3193 # IDEOGRAPHIC ANNOTATION TWO MARK
-<Multi_key> <asciicircum> <U4E8C> : "㆓" U3193 # IDEOGRAPHIC ANNOTATION TWO MARK
-<dead_circumflex> <U4E09> : "㆔" U3194 # IDEOGRAPHIC ANNOTATION THREE MARK
-<Multi_key> <asciicircum> <U4E09> : "㆔" U3194 # IDEOGRAPHIC ANNOTATION THREE MARK
-<dead_circumflex> <U56DB> : "㆕" U3195 # IDEOGRAPHIC ANNOTATION FOUR MARK
-<Multi_key> <asciicircum> <U56DB> : "㆕" U3195 # IDEOGRAPHIC ANNOTATION FOUR MARK
-<dead_circumflex> <U4E0A> : "㆖" U3196 # IDEOGRAPHIC ANNOTATION TOP MARK
-<Multi_key> <asciicircum> <U4E0A> : "㆖" U3196 # IDEOGRAPHIC ANNOTATION TOP MARK
-<dead_circumflex> <U4E2D> : "㆗" U3197 # IDEOGRAPHIC ANNOTATION MIDDLE MARK
-<Multi_key> <asciicircum> <U4E2D> : "㆗" U3197 # IDEOGRAPHIC ANNOTATION MIDDLE MARK
-<dead_circumflex> <U4E0B> : "㆘" U3198 # IDEOGRAPHIC ANNOTATION BOTTOM MARK
-<Multi_key> <asciicircum> <U4E0B> : "㆘" U3198 # IDEOGRAPHIC ANNOTATION BOTTOM MARK
-<dead_circumflex> <U7532> : "㆙" U3199 # IDEOGRAPHIC ANNOTATION FIRST MARK
-<Multi_key> <asciicircum> <U7532> : "㆙" U3199 # IDEOGRAPHIC ANNOTATION FIRST MARK
-<dead_circumflex> <U4E59> : "㆚" U319A # IDEOGRAPHIC ANNOTATION SECOND MARK
-<Multi_key> <asciicircum> <U4E59> : "㆚" U319A # IDEOGRAPHIC ANNOTATION SECOND MARK
-<dead_circumflex> <U4E19> : "㆛" U319B # IDEOGRAPHIC ANNOTATION THIRD MARK
-<Multi_key> <asciicircum> <U4E19> : "㆛" U319B # IDEOGRAPHIC ANNOTATION THIRD MARK
-<dead_circumflex> <U4E01> : "㆜" U319C # IDEOGRAPHIC ANNOTATION FOURTH MARK
-<Multi_key> <asciicircum> <U4E01> : "㆜" U319C # IDEOGRAPHIC ANNOTATION FOURTH MARK
-<dead_circumflex> <U5929> : "㆝" U319D # IDEOGRAPHIC ANNOTATION HEAVEN MARK
-<Multi_key> <asciicircum> <U5929> : "㆝" U319D # IDEOGRAPHIC ANNOTATION HEAVEN MARK
-<dead_circumflex> <U5730> : "㆞" U319E # IDEOGRAPHIC ANNOTATION EARTH MARK
-<Multi_key> <asciicircum> <U5730> : "㆞" U319E # IDEOGRAPHIC ANNOTATION EARTH MARK
-<dead_circumflex> <U4EBA> : "㆟" U319F # IDEOGRAPHIC ANNOTATION MAN MARK
-<Multi_key> <asciicircum> <U4EBA> : "㆟" U319F # IDEOGRAPHIC ANNOTATION MAN MARK
-<Multi_key> <parenleft> <2> <1> <parenright> : "㉑" U3251 # CIRCLED NUMBER TWENTY ONE
-<Multi_key> <parenleft> <2> <KP_1> <parenright> : "㉑" U3251 # CIRCLED NUMBER TWENTY ONE
-<Multi_key> <parenleft> <KP_Space> <1> <parenright> : "㉑" U3251 # CIRCLED NUMBER TWENTY ONE
-<Multi_key> <parenleft> <KP_Space> <KP_1> <parenright> : "㉑" U3251 # CIRCLED NUMBER TWENTY ONE
-<Multi_key> <parenleft> <KP_2> <1> <parenright> : "㉑" U3251 # CIRCLED NUMBER TWENTY ONE
-<Multi_key> <parenleft> <KP_2> <KP_1> <parenright> : "㉑" U3251 # CIRCLED NUMBER TWENTY ONE
-<Multi_key> <parenleft> <2> <2> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
-<Multi_key> <parenleft> <2> <KP_Space> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
-<Multi_key> <parenleft> <2> <KP_2> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
-<Multi_key> <parenleft> <KP_Space> <2> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
-<Multi_key> <parenleft> <KP_Space> <KP_Space> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
-<Multi_key> <parenleft> <KP_Space> <KP_2> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
-<Multi_key> <parenleft> <KP_2> <2> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
-<Multi_key> <parenleft> <KP_2> <KP_Space> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
-<Multi_key> <parenleft> <KP_2> <KP_2> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
-<Multi_key> <parenleft> <2> <3> <parenright> : "㉓" U3253 # CIRCLED NUMBER TWENTY THREE
-<Multi_key> <parenleft> <2> <KP_3> <parenright> : "㉓" U3253 # CIRCLED NUMBER TWENTY THREE
-<Multi_key> <parenleft> <KP_Space> <3> <parenright> : "㉓" U3253 # CIRCLED NUMBER TWENTY THREE
-<Multi_key> <parenleft> <KP_Space> <KP_3> <parenright> : "㉓" U3253 # CIRCLED NUMBER TWENTY THREE
-<Multi_key> <parenleft> <KP_2> <3> <parenright> : "㉓" U3253 # CIRCLED NUMBER TWENTY THREE
-<Multi_key> <parenleft> <KP_2> <KP_3> <parenright> : "㉓" U3253 # CIRCLED NUMBER TWENTY THREE
-<Multi_key> <parenleft> <2> <4> <parenright> : "㉔" U3254 # CIRCLED NUMBER TWENTY FOUR
-<Multi_key> <parenleft> <2> <KP_4> <parenright> : "㉔" U3254 # CIRCLED NUMBER TWENTY FOUR
-<Multi_key> <parenleft> <KP_Space> <4> <parenright> : "㉔" U3254 # CIRCLED NUMBER TWENTY FOUR
-<Multi_key> <parenleft> <KP_Space> <KP_4> <parenright> : "㉔" U3254 # CIRCLED NUMBER TWENTY FOUR
-<Multi_key> <parenleft> <KP_2> <4> <parenright> : "㉔" U3254 # CIRCLED NUMBER TWENTY FOUR
-<Multi_key> <parenleft> <KP_2> <KP_4> <parenright> : "㉔" U3254 # CIRCLED NUMBER TWENTY FOUR
-<Multi_key> <parenleft> <2> <5> <parenright> : "㉕" U3255 # CIRCLED NUMBER TWENTY FIVE
-<Multi_key> <parenleft> <2> <KP_5> <parenright> : "㉕" U3255 # CIRCLED NUMBER TWENTY FIVE
-<Multi_key> <parenleft> <KP_Space> <5> <parenright> : "㉕" U3255 # CIRCLED NUMBER TWENTY FIVE
-<Multi_key> <parenleft> <KP_Space> <KP_5> <parenright> : "㉕" U3255 # CIRCLED NUMBER TWENTY FIVE
-<Multi_key> <parenleft> <KP_2> <5> <parenright> : "㉕" U3255 # CIRCLED NUMBER TWENTY FIVE
-<Multi_key> <parenleft> <KP_2> <KP_5> <parenright> : "㉕" U3255 # CIRCLED NUMBER TWENTY FIVE
-<Multi_key> <parenleft> <2> <6> <parenright> : "㉖" U3256 # CIRCLED NUMBER TWENTY SIX
-<Multi_key> <parenleft> <2> <KP_6> <parenright> : "㉖" U3256 # CIRCLED NUMBER TWENTY SIX
-<Multi_key> <parenleft> <KP_Space> <6> <parenright> : "㉖" U3256 # CIRCLED NUMBER TWENTY SIX
-<Multi_key> <parenleft> <KP_Space> <KP_6> <parenright> : "㉖" U3256 # CIRCLED NUMBER TWENTY SIX
-<Multi_key> <parenleft> <KP_2> <6> <parenright> : "㉖" U3256 # CIRCLED NUMBER TWENTY SIX
-<Multi_key> <parenleft> <KP_2> <KP_6> <parenright> : "㉖" U3256 # CIRCLED NUMBER TWENTY SIX
-<Multi_key> <parenleft> <2> <7> <parenright> : "㉗" U3257 # CIRCLED NUMBER TWENTY SEVEN
-<Multi_key> <parenleft> <2> <KP_7> <parenright> : "㉗" U3257 # CIRCLED NUMBER TWENTY SEVEN
-<Multi_key> <parenleft> <KP_Space> <7> <parenright> : "㉗" U3257 # CIRCLED NUMBER TWENTY SEVEN
-<Multi_key> <parenleft> <KP_Space> <KP_7> <parenright> : "㉗" U3257 # CIRCLED NUMBER TWENTY SEVEN
-<Multi_key> <parenleft> <KP_2> <7> <parenright> : "㉗" U3257 # CIRCLED NUMBER TWENTY SEVEN
-<Multi_key> <parenleft> <KP_2> <KP_7> <parenright> : "㉗" U3257 # CIRCLED NUMBER TWENTY SEVEN
-<Multi_key> <parenleft> <2> <8> <parenright> : "㉘" U3258 # CIRCLED NUMBER TWENTY EIGHT
-<Multi_key> <parenleft> <2> <KP_8> <parenright> : "㉘" U3258 # CIRCLED NUMBER TWENTY EIGHT
-<Multi_key> <parenleft> <KP_Space> <8> <parenright> : "㉘" U3258 # CIRCLED NUMBER TWENTY EIGHT
-<Multi_key> <parenleft> <KP_Space> <KP_8> <parenright> : "㉘" U3258 # CIRCLED NUMBER TWENTY EIGHT
-<Multi_key> <parenleft> <KP_2> <8> <parenright> : "㉘" U3258 # CIRCLED NUMBER TWENTY EIGHT
-<Multi_key> <parenleft> <KP_2> <KP_8> <parenright> : "㉘" U3258 # CIRCLED NUMBER TWENTY EIGHT
-<Multi_key> <parenleft> <2> <9> <parenright> : "㉙" U3259 # CIRCLED NUMBER TWENTY NINE
-<Multi_key> <parenleft> <2> <KP_9> <parenright> : "㉙" U3259 # CIRCLED NUMBER TWENTY NINE
-<Multi_key> <parenleft> <KP_Space> <9> <parenright> : "㉙" U3259 # CIRCLED NUMBER TWENTY NINE
-<Multi_key> <parenleft> <KP_Space> <KP_9> <parenright> : "㉙" U3259 # CIRCLED NUMBER TWENTY NINE
-<Multi_key> <parenleft> <KP_2> <9> <parenright> : "㉙" U3259 # CIRCLED NUMBER TWENTY NINE
-<Multi_key> <parenleft> <KP_2> <KP_9> <parenright> : "㉙" U3259 # CIRCLED NUMBER TWENTY NINE
-<Multi_key> <parenleft> <3> <0> <parenright> : "㉚" U325A # CIRCLED NUMBER THIRTY
-<Multi_key> <parenleft> <3> <KP_0> <parenright> : "㉚" U325A # CIRCLED NUMBER THIRTY
-<Multi_key> <parenleft> <KP_3> <0> <parenright> : "㉚" U325A # CIRCLED NUMBER THIRTY
-<Multi_key> <parenleft> <KP_3> <KP_0> <parenright> : "㉚" U325A # CIRCLED NUMBER THIRTY
-<Multi_key> <parenleft> <3> <1> <parenright> : "㉛" U325B # CIRCLED NUMBER THIRTY ONE
-<Multi_key> <parenleft> <3> <KP_1> <parenright> : "㉛" U325B # CIRCLED NUMBER THIRTY ONE
-<Multi_key> <parenleft> <KP_3> <1> <parenright> : "㉛" U325B # CIRCLED NUMBER THIRTY ONE
-<Multi_key> <parenleft> <KP_3> <KP_1> <parenright> : "㉛" U325B # CIRCLED NUMBER THIRTY ONE
-<Multi_key> <parenleft> <3> <2> <parenright> : "㉜" U325C # CIRCLED NUMBER THIRTY TWO
-<Multi_key> <parenleft> <3> <KP_Space> <parenright> : "㉜" U325C # CIRCLED NUMBER THIRTY TWO
-<Multi_key> <parenleft> <3> <KP_2> <parenright> : "㉜" U325C # CIRCLED NUMBER THIRTY TWO
-<Multi_key> <parenleft> <KP_3> <2> <parenright> : "㉜" U325C # CIRCLED NUMBER THIRTY TWO
-<Multi_key> <parenleft> <KP_3> <KP_Space> <parenright> : "㉜" U325C # CIRCLED NUMBER THIRTY TWO
-<Multi_key> <parenleft> <KP_3> <KP_2> <parenright> : "㉜" U325C # CIRCLED NUMBER THIRTY TWO
-<Multi_key> <parenleft> <3> <3> <parenright> : "㉝" U325D # CIRCLED NUMBER THIRTY THREE
-<Multi_key> <parenleft> <3> <KP_3> <parenright> : "㉝" U325D # CIRCLED NUMBER THIRTY THREE
-<Multi_key> <parenleft> <KP_3> <3> <parenright> : "㉝" U325D # CIRCLED NUMBER THIRTY THREE
-<Multi_key> <parenleft> <KP_3> <KP_3> <parenright> : "㉝" U325D # CIRCLED NUMBER THIRTY THREE
-<Multi_key> <parenleft> <3> <4> <parenright> : "㉞" U325E # CIRCLED NUMBER THIRTY FOUR
-<Multi_key> <parenleft> <3> <KP_4> <parenright> : "㉞" U325E # CIRCLED NUMBER THIRTY FOUR
-<Multi_key> <parenleft> <KP_3> <4> <parenright> : "㉞" U325E # CIRCLED NUMBER THIRTY FOUR
-<Multi_key> <parenleft> <KP_3> <KP_4> <parenright> : "㉞" U325E # CIRCLED NUMBER THIRTY FOUR
-<Multi_key> <parenleft> <3> <5> <parenright> : "㉟" U325F # CIRCLED NUMBER THIRTY FIVE
-<Multi_key> <parenleft> <3> <KP_5> <parenright> : "㉟" U325F # CIRCLED NUMBER THIRTY FIVE
-<Multi_key> <parenleft> <KP_3> <5> <parenright> : "㉟" U325F # CIRCLED NUMBER THIRTY FIVE
-<Multi_key> <parenleft> <KP_3> <KP_5> <parenright> : "㉟" U325F # CIRCLED NUMBER THIRTY FIVE
-<Multi_key> <parenleft> <U1100> <parenright> : "㉠" U3260 # CIRCLED HANGUL KIYEOK
-<Multi_key> <parenleft> <U1102> <parenright> : "㉡" U3261 # CIRCLED HANGUL NIEUN
-<Multi_key> <parenleft> <U1103> <parenright> : "㉢" U3262 # CIRCLED HANGUL TIKEUT
-<Multi_key> <parenleft> <U1105> <parenright> : "㉣" U3263 # CIRCLED HANGUL RIEUL
-<Multi_key> <parenleft> <U1106> <parenright> : "㉤" U3264 # CIRCLED HANGUL MIEUM
-<Multi_key> <parenleft> <U1107> <parenright> : "㉥" U3265 # CIRCLED HANGUL PIEUP
-<Multi_key> <parenleft> <U1109> <parenright> : "㉦" U3266 # CIRCLED HANGUL SIOS
-<Multi_key> <parenleft> <U110B> <parenright> : "㉧" U3267 # CIRCLED HANGUL IEUNG
-<Multi_key> <parenleft> <U110C> <parenright> : "㉨" U3268 # CIRCLED HANGUL CIEUC
-<Multi_key> <parenleft> <U110E> <parenright> : "㉩" U3269 # CIRCLED HANGUL CHIEUCH
-<Multi_key> <parenleft> <U110F> <parenright> : "㉪" U326A # CIRCLED HANGUL KHIEUKH
-<Multi_key> <parenleft> <U1110> <parenright> : "㉫" U326B # CIRCLED HANGUL THIEUTH
-<Multi_key> <parenleft> <U1111> <parenright> : "㉬" U326C # CIRCLED HANGUL PHIEUPH
-<Multi_key> <parenleft> <U1112> <parenright> : "㉭" U326D # CIRCLED HANGUL HIEUH
-<Multi_key> <parenleft> <U1100> <U1161> <parenright> : "㉮" U326E # CIRCLED HANGUL KIYEOK A
-<Multi_key> <parenleft> <U1102> <U1161> <parenright> : "㉯" U326F # CIRCLED HANGUL NIEUN A
-<Multi_key> <parenleft> <U1103> <U1161> <parenright> : "㉰" U3270 # CIRCLED HANGUL TIKEUT A
-<Multi_key> <parenleft> <U1105> <U1161> <parenright> : "㉱" U3271 # CIRCLED HANGUL RIEUL A
-<Multi_key> <parenleft> <U1106> <U1161> <parenright> : "㉲" U3272 # CIRCLED HANGUL MIEUM A
-<Multi_key> <parenleft> <U1107> <U1161> <parenright> : "㉳" U3273 # CIRCLED HANGUL PIEUP A
-<Multi_key> <parenleft> <U1109> <U1161> <parenright> : "㉴" U3274 # CIRCLED HANGUL SIOS A
-<Multi_key> <parenleft> <U110B> <U1161> <parenright> : "㉵" U3275 # CIRCLED HANGUL IEUNG A
-<Multi_key> <parenleft> <U110C> <U1161> <parenright> : "㉶" U3276 # CIRCLED HANGUL CIEUC A
-<Multi_key> <parenleft> <U110E> <U1161> <parenright> : "㉷" U3277 # CIRCLED HANGUL CHIEUCH A
-<Multi_key> <parenleft> <U110F> <U1161> <parenright> : "㉸" U3278 # CIRCLED HANGUL KHIEUKH A
-<Multi_key> <parenleft> <U1110> <U1161> <parenright> : "㉹" U3279 # CIRCLED HANGUL THIEUTH A
-<Multi_key> <parenleft> <U1111> <U1161> <parenright> : "㉺" U327A # CIRCLED HANGUL PHIEUPH A
-<Multi_key> <parenleft> <U1112> <U1161> <parenright> : "㉻" U327B # CIRCLED HANGUL HIEUH A
-<Multi_key> <parenleft> <U4E00> <parenright> : "㊀" U3280 # CIRCLED IDEOGRAPH ONE
-<Multi_key> <parenleft> <U4E8C> <parenright> : "㊁" U3281 # CIRCLED IDEOGRAPH TWO
-<Multi_key> <parenleft> <U4E09> <parenright> : "㊂" U3282 # CIRCLED IDEOGRAPH THREE
-<Multi_key> <parenleft> <U56DB> <parenright> : "㊃" U3283 # CIRCLED IDEOGRAPH FOUR
-<Multi_key> <parenleft> <U4E94> <parenright> : "㊄" U3284 # CIRCLED IDEOGRAPH FIVE
-<Multi_key> <parenleft> <U516D> <parenright> : "㊅" U3285 # CIRCLED IDEOGRAPH SIX
-<Multi_key> <parenleft> <U4E03> <parenright> : "㊆" U3286 # CIRCLED IDEOGRAPH SEVEN
-<Multi_key> <parenleft> <U516B> <parenright> : "㊇" U3287 # CIRCLED IDEOGRAPH EIGHT
-<Multi_key> <parenleft> <U4E5D> <parenright> : "㊈" U3288 # CIRCLED IDEOGRAPH NINE
-<Multi_key> <parenleft> <U5341> <parenright> : "㊉" U3289 # CIRCLED IDEOGRAPH TEN
-<Multi_key> <parenleft> <U6708> <parenright> : "㊊" U328A # CIRCLED IDEOGRAPH MOON
-<Multi_key> <parenleft> <U706B> <parenright> : "㊋" U328B # CIRCLED IDEOGRAPH FIRE
-<Multi_key> <parenleft> <U6C34> <parenright> : "㊌" U328C # CIRCLED IDEOGRAPH WATER
-<Multi_key> <parenleft> <U6728> <parenright> : "㊍" U328D # CIRCLED IDEOGRAPH WOOD
-<Multi_key> <parenleft> <U91D1> <parenright> : "㊎" U328E # CIRCLED IDEOGRAPH METAL
-<Multi_key> <parenleft> <U571F> <parenright> : "㊏" U328F # CIRCLED IDEOGRAPH EARTH
-<Multi_key> <parenleft> <U65E5> <parenright> : "㊐" U3290 # CIRCLED IDEOGRAPH SUN
-<Multi_key> <parenleft> <U682A> <parenright> : "㊑" U3291 # CIRCLED IDEOGRAPH STOCK
-<Multi_key> <parenleft> <U6709> <parenright> : "㊒" U3292 # CIRCLED IDEOGRAPH HAVE
-<Multi_key> <parenleft> <U793E> <parenright> : "㊓" U3293 # CIRCLED IDEOGRAPH SOCIETY
-<Multi_key> <parenleft> <U540D> <parenright> : "㊔" U3294 # CIRCLED IDEOGRAPH NAME
-<Multi_key> <parenleft> <U7279> <parenright> : "㊕" U3295 # CIRCLED IDEOGRAPH SPECIAL
-<Multi_key> <parenleft> <U8CA1> <parenright> : "㊖" U3296 # CIRCLED IDEOGRAPH FINANCIAL
-<Multi_key> <parenleft> <U795D> <parenright> : "㊗" U3297 # CIRCLED IDEOGRAPH CONGRATULATION
-<Multi_key> <parenleft> <U52B4> <parenright> : "㊘" U3298 # CIRCLED IDEOGRAPH LABOR
-<Multi_key> <parenleft> <U79D8> <parenright> : "㊙" U3299 # CIRCLED IDEOGRAPH SECRET
-<Multi_key> <parenleft> <U7537> <parenright> : "㊚" U329A # CIRCLED IDEOGRAPH MALE
-<Multi_key> <parenleft> <U5973> <parenright> : "㊛" U329B # CIRCLED IDEOGRAPH FEMALE
-<Multi_key> <parenleft> <U9069> <parenright> : "㊜" U329C # CIRCLED IDEOGRAPH SUITABLE
-<Multi_key> <parenleft> <U512A> <parenright> : "㊝" U329D # CIRCLED IDEOGRAPH EXCELLENT
-<Multi_key> <parenleft> <U5370> <parenright> : "㊞" U329E # CIRCLED IDEOGRAPH PRINT
-<Multi_key> <parenleft> <U6CE8> <parenright> : "㊟" U329F # CIRCLED IDEOGRAPH ATTENTION
-<Multi_key> <parenleft> <U9805> <parenright> : "㊠" U32A0 # CIRCLED IDEOGRAPH ITEM
-<Multi_key> <parenleft> <U4F11> <parenright> : "㊡" U32A1 # CIRCLED IDEOGRAPH REST
-<Multi_key> <parenleft> <U5199> <parenright> : "㊢" U32A2 # CIRCLED IDEOGRAPH COPY
-<Multi_key> <parenleft> <U6B63> <parenright> : "㊣" U32A3 # CIRCLED IDEOGRAPH CORRECT
-<Multi_key> <parenleft> <U4E0A> <parenright> : "㊤" U32A4 # CIRCLED IDEOGRAPH HIGH
-<Multi_key> <parenleft> <U4E2D> <parenright> : "㊥" U32A5 # CIRCLED IDEOGRAPH CENTRE
-<Multi_key> <parenleft> <U4E0B> <parenright> : "㊦" U32A6 # CIRCLED IDEOGRAPH LOW
-<Multi_key> <parenleft> <U5DE6> <parenright> : "㊧" U32A7 # CIRCLED IDEOGRAPH LEFT
-<Multi_key> <parenleft> <U53F3> <parenright> : "㊨" U32A8 # CIRCLED IDEOGRAPH RIGHT
-<Multi_key> <parenleft> <U533B> <parenright> : "㊩" U32A9 # CIRCLED IDEOGRAPH MEDICINE
-<Multi_key> <parenleft> <U5B97> <parenright> : "㊪" U32AA # CIRCLED IDEOGRAPH RELIGION
-<Multi_key> <parenleft> <U5B66> <parenright> : "㊫" U32AB # CIRCLED IDEOGRAPH STUDY
-<Multi_key> <parenleft> <U76E3> <parenright> : "㊬" U32AC # CIRCLED IDEOGRAPH SUPERVISE
-<Multi_key> <parenleft> <U4F01> <parenright> : "㊭" U32AD # CIRCLED IDEOGRAPH ENTERPRISE
-<Multi_key> <parenleft> <U8CC7> <parenright> : "㊮" U32AE # CIRCLED IDEOGRAPH RESOURCE
-<Multi_key> <parenleft> <U5354> <parenright> : "㊯" U32AF # CIRCLED IDEOGRAPH ALLIANCE
-<Multi_key> <parenleft> <U591C> <parenright> : "㊰" U32B0 # CIRCLED IDEOGRAPH NIGHT
-<Multi_key> <parenleft> <3> <6> <parenright> : "㊱" U32B1 # CIRCLED NUMBER THIRTY SIX
-<Multi_key> <parenleft> <3> <KP_6> <parenright> : "㊱" U32B1 # CIRCLED NUMBER THIRTY SIX
-<Multi_key> <parenleft> <KP_3> <6> <parenright> : "㊱" U32B1 # CIRCLED NUMBER THIRTY SIX
-<Multi_key> <parenleft> <KP_3> <KP_6> <parenright> : "㊱" U32B1 # CIRCLED NUMBER THIRTY SIX
-<Multi_key> <parenleft> <3> <7> <parenright> : "㊲" U32B2 # CIRCLED NUMBER THIRTY SEVEN
-<Multi_key> <parenleft> <3> <KP_7> <parenright> : "㊲" U32B2 # CIRCLED NUMBER THIRTY SEVEN
-<Multi_key> <parenleft> <KP_3> <7> <parenright> : "㊲" U32B2 # CIRCLED NUMBER THIRTY SEVEN
-<Multi_key> <parenleft> <KP_3> <KP_7> <parenright> : "㊲" U32B2 # CIRCLED NUMBER THIRTY SEVEN
-<Multi_key> <parenleft> <3> <8> <parenright> : "㊳" U32B3 # CIRCLED NUMBER THIRTY EIGHT
-<Multi_key> <parenleft> <3> <KP_8> <parenright> : "㊳" U32B3 # CIRCLED NUMBER THIRTY EIGHT
-<Multi_key> <parenleft> <KP_3> <8> <parenright> : "㊳" U32B3 # CIRCLED NUMBER THIRTY EIGHT
-<Multi_key> <parenleft> <KP_3> <KP_8> <parenright> : "㊳" U32B3 # CIRCLED NUMBER THIRTY EIGHT
-<Multi_key> <parenleft> <3> <9> <parenright> : "㊴" U32B4 # CIRCLED NUMBER THIRTY NINE
-<Multi_key> <parenleft> <3> <KP_9> <parenright> : "㊴" U32B4 # CIRCLED NUMBER THIRTY NINE
-<Multi_key> <parenleft> <KP_3> <9> <parenright> : "㊴" U32B4 # CIRCLED NUMBER THIRTY NINE
-<Multi_key> <parenleft> <KP_3> <KP_9> <parenright> : "㊴" U32B4 # CIRCLED NUMBER THIRTY NINE
-<Multi_key> <parenleft> <4> <0> <parenright> : "㊵" U32B5 # CIRCLED NUMBER FORTY
-<Multi_key> <parenleft> <4> <KP_0> <parenright> : "㊵" U32B5 # CIRCLED NUMBER FORTY
-<Multi_key> <parenleft> <KP_4> <0> <parenright> : "㊵" U32B5 # CIRCLED NUMBER FORTY
-<Multi_key> <parenleft> <KP_4> <KP_0> <parenright> : "㊵" U32B5 # CIRCLED NUMBER FORTY
-<Multi_key> <parenleft> <4> <1> <parenright> : "㊶" U32B6 # CIRCLED NUMBER FORTY ONE
-<Multi_key> <parenleft> <4> <KP_1> <parenright> : "㊶" U32B6 # CIRCLED NUMBER FORTY ONE
-<Multi_key> <parenleft> <KP_4> <1> <parenright> : "㊶" U32B6 # CIRCLED NUMBER FORTY ONE
-<Multi_key> <parenleft> <KP_4> <KP_1> <parenright> : "㊶" U32B6 # CIRCLED NUMBER FORTY ONE
-<Multi_key> <parenleft> <4> <2> <parenright> : "㊷" U32B7 # CIRCLED NUMBER FORTY TWO
-<Multi_key> <parenleft> <4> <KP_Space> <parenright> : "㊷" U32B7 # CIRCLED NUMBER FORTY TWO
-<Multi_key> <parenleft> <4> <KP_2> <parenright> : "㊷" U32B7 # CIRCLED NUMBER FORTY TWO
-<Multi_key> <parenleft> <KP_4> <2> <parenright> : "㊷" U32B7 # CIRCLED NUMBER FORTY TWO
-<Multi_key> <parenleft> <KP_4> <KP_Space> <parenright> : "㊷" U32B7 # CIRCLED NUMBER FORTY TWO
-<Multi_key> <parenleft> <KP_4> <KP_2> <parenright> : "㊷" U32B7 # CIRCLED NUMBER FORTY TWO
-<Multi_key> <parenleft> <4> <3> <parenright> : "㊸" U32B8 # CIRCLED NUMBER FORTY THREE
-<Multi_key> <parenleft> <4> <KP_3> <parenright> : "㊸" U32B8 # CIRCLED NUMBER FORTY THREE
-<Multi_key> <parenleft> <KP_4> <3> <parenright> : "㊸" U32B8 # CIRCLED NUMBER FORTY THREE
-<Multi_key> <parenleft> <KP_4> <KP_3> <parenright> : "㊸" U32B8 # CIRCLED NUMBER FORTY THREE
-<Multi_key> <parenleft> <4> <4> <parenright> : "㊹" U32B9 # CIRCLED NUMBER FORTY FOUR
-<Multi_key> <parenleft> <4> <KP_4> <parenright> : "㊹" U32B9 # CIRCLED NUMBER FORTY FOUR
-<Multi_key> <parenleft> <KP_4> <4> <parenright> : "㊹" U32B9 # CIRCLED NUMBER FORTY FOUR
-<Multi_key> <parenleft> <KP_4> <KP_4> <parenright> : "㊹" U32B9 # CIRCLED NUMBER FORTY FOUR
-<Multi_key> <parenleft> <4> <5> <parenright> : "㊺" U32BA # CIRCLED NUMBER FORTY FIVE
-<Multi_key> <parenleft> <4> <KP_5> <parenright> : "㊺" U32BA # CIRCLED NUMBER FORTY FIVE
-<Multi_key> <parenleft> <KP_4> <5> <parenright> : "㊺" U32BA # CIRCLED NUMBER FORTY FIVE
-<Multi_key> <parenleft> <KP_4> <KP_5> <parenright> : "㊺" U32BA # CIRCLED NUMBER FORTY FIVE
-<Multi_key> <parenleft> <4> <6> <parenright> : "㊻" U32BB # CIRCLED NUMBER FORTY SIX
-<Multi_key> <parenleft> <4> <KP_6> <parenright> : "㊻" U32BB # CIRCLED NUMBER FORTY SIX
-<Multi_key> <parenleft> <KP_4> <6> <parenright> : "㊻" U32BB # CIRCLED NUMBER FORTY SIX
-<Multi_key> <parenleft> <KP_4> <KP_6> <parenright> : "㊻" U32BB # CIRCLED NUMBER FORTY SIX
-<Multi_key> <parenleft> <4> <7> <parenright> : "㊼" U32BC # CIRCLED NUMBER FORTY SEVEN
-<Multi_key> <parenleft> <4> <KP_7> <parenright> : "㊼" U32BC # CIRCLED NUMBER FORTY SEVEN
-<Multi_key> <parenleft> <KP_4> <7> <parenright> : "㊼" U32BC # CIRCLED NUMBER FORTY SEVEN
-<Multi_key> <parenleft> <KP_4> <KP_7> <parenright> : "㊼" U32BC # CIRCLED NUMBER FORTY SEVEN
-<Multi_key> <parenleft> <4> <8> <parenright> : "㊽" U32BD # CIRCLED NUMBER FORTY EIGHT
-<Multi_key> <parenleft> <4> <KP_8> <parenright> : "㊽" U32BD # CIRCLED NUMBER FORTY EIGHT
-<Multi_key> <parenleft> <KP_4> <8> <parenright> : "㊽" U32BD # CIRCLED NUMBER FORTY EIGHT
-<Multi_key> <parenleft> <KP_4> <KP_8> <parenright> : "㊽" U32BD # CIRCLED NUMBER FORTY EIGHT
-<Multi_key> <parenleft> <4> <9> <parenright> : "㊾" U32BE # CIRCLED NUMBER FORTY NINE
-<Multi_key> <parenleft> <4> <KP_9> <parenright> : "㊾" U32BE # CIRCLED NUMBER FORTY NINE
-<Multi_key> <parenleft> <KP_4> <9> <parenright> : "㊾" U32BE # CIRCLED NUMBER FORTY NINE
-<Multi_key> <parenleft> <KP_4> <KP_9> <parenright> : "㊾" U32BE # CIRCLED NUMBER FORTY NINE
-<Multi_key> <parenleft> <5> <0> <parenright> : "㊿" U32BF # CIRCLED NUMBER FIFTY
-<Multi_key> <parenleft> <5> <KP_0> <parenright> : "㊿" U32BF # CIRCLED NUMBER FIFTY
-<Multi_key> <parenleft> <KP_5> <0> <parenright> : "㊿" U32BF # CIRCLED NUMBER FIFTY
-<Multi_key> <parenleft> <KP_5> <KP_0> <parenright> : "㊿" U32BF # CIRCLED NUMBER FIFTY
-<Multi_key> <parenleft> <kana_A> <parenright> : "㋐" U32D0 # CIRCLED KATAKANA A
-<Multi_key> <parenleft> <kana_I> <parenright> : "㋑" U32D1 # CIRCLED KATAKANA I
-<Multi_key> <parenleft> <kana_U> <parenright> : "㋒" U32D2 # CIRCLED KATAKANA U
-<Multi_key> <parenleft> <kana_E> <parenright> : "㋓" U32D3 # CIRCLED KATAKANA E
-<Multi_key> <parenleft> <kana_O> <parenright> : "㋔" U32D4 # CIRCLED KATAKANA O
-<Multi_key> <parenleft> <kana_KA> <parenright> : "㋕" U32D5 # CIRCLED KATAKANA KA
-<Multi_key> <parenleft> <kana_KI> <parenright> : "㋖" U32D6 # CIRCLED KATAKANA KI
-<Multi_key> <parenleft> <kana_KU> <parenright> : "㋗" U32D7 # CIRCLED KATAKANA KU
-<Multi_key> <parenleft> <kana_KE> <parenright> : "㋘" U32D8 # CIRCLED KATAKANA KE
-<Multi_key> <parenleft> <kana_KO> <parenright> : "㋙" U32D9 # CIRCLED KATAKANA KO
-<Multi_key> <parenleft> <kana_SA> <parenright> : "㋚" U32DA # CIRCLED KATAKANA SA
-<Multi_key> <parenleft> <kana_SHI> <parenright> : "㋛" U32DB # CIRCLED KATAKANA SI
-<Multi_key> <parenleft> <kana_SU> <parenright> : "㋜" U32DC # CIRCLED KATAKANA SU
-<Multi_key> <parenleft> <kana_SE> <parenright> : "㋝" U32DD # CIRCLED KATAKANA SE
-<Multi_key> <parenleft> <kana_SO> <parenright> : "㋞" U32DE # CIRCLED KATAKANA SO
-<Multi_key> <parenleft> <kana_TA> <parenright> : "㋟" U32DF # CIRCLED KATAKANA TA
-<Multi_key> <parenleft> <kana_CHI> <parenright> : "㋠" U32E0 # CIRCLED KATAKANA TI
-<Multi_key> <parenleft> <kana_TSU> <parenright> : "㋡" U32E1 # CIRCLED KATAKANA TU
-<Multi_key> <parenleft> <kana_TE> <parenright> : "㋢" U32E2 # CIRCLED KATAKANA TE
-<Multi_key> <parenleft> <kana_TO> <parenright> : "㋣" U32E3 # CIRCLED KATAKANA TO
-<Multi_key> <parenleft> <kana_NA> <parenright> : "㋤" U32E4 # CIRCLED KATAKANA NA
-<Multi_key> <parenleft> <kana_NI> <parenright> : "㋥" U32E5 # CIRCLED KATAKANA NI
-<Multi_key> <parenleft> <kana_NU> <parenright> : "㋦" U32E6 # CIRCLED KATAKANA NU
-<Multi_key> <parenleft> <kana_NE> <parenright> : "㋧" U32E7 # CIRCLED KATAKANA NE
-<Multi_key> <parenleft> <kana_NO> <parenright> : "㋨" U32E8 # CIRCLED KATAKANA NO
-<Multi_key> <parenleft> <kana_HA> <parenright> : "㋩" U32E9 # CIRCLED KATAKANA HA
-<Multi_key> <parenleft> <kana_HI> <parenright> : "㋪" U32EA # CIRCLED KATAKANA HI
-<Multi_key> <parenleft> <kana_FU> <parenright> : "㋫" U32EB # CIRCLED KATAKANA HU
-<Multi_key> <parenleft> <kana_HE> <parenright> : "㋬" U32EC # CIRCLED KATAKANA HE
-<Multi_key> <parenleft> <kana_HO> <parenright> : "㋭" U32ED # CIRCLED KATAKANA HO
-<Multi_key> <parenleft> <kana_MA> <parenright> : "㋮" U32EE # CIRCLED KATAKANA MA
-<Multi_key> <parenleft> <kana_MI> <parenright> : "㋯" U32EF # CIRCLED KATAKANA MI
-<Multi_key> <parenleft> <kana_MU> <parenright> : "㋰" U32F0 # CIRCLED KATAKANA MU
-<Multi_key> <parenleft> <kana_ME> <parenright> : "㋱" U32F1 # CIRCLED KATAKANA ME
-<Multi_key> <parenleft> <kana_MO> <parenright> : "㋲" U32F2 # CIRCLED KATAKANA MO
-<Multi_key> <parenleft> <kana_YA> <parenright> : "㋳" U32F3 # CIRCLED KATAKANA YA
-<Multi_key> <parenleft> <kana_YU> <parenright> : "㋴" U32F4 # CIRCLED KATAKANA YU
-<Multi_key> <parenleft> <kana_YO> <parenright> : "㋵" U32F5 # CIRCLED KATAKANA YO
-<Multi_key> <parenleft> <kana_RA> <parenright> : "㋶" U32F6 # CIRCLED KATAKANA RA
-<Multi_key> <parenleft> <kana_RI> <parenright> : "㋷" U32F7 # CIRCLED KATAKANA RI
-<Multi_key> <parenleft> <kana_RU> <parenright> : "㋸" U32F8 # CIRCLED KATAKANA RU
-<Multi_key> <parenleft> <kana_RE> <parenright> : "㋹" U32F9 # CIRCLED KATAKANA RE
-<Multi_key> <parenleft> <kana_RO> <parenright> : "㋺" U32FA # CIRCLED KATAKANA RO
-<Multi_key> <parenleft> <kana_WA> <parenright> : "㋻" U32FB # CIRCLED KATAKANA WA
-<Multi_key> <parenleft> <U30F0> <parenright> : "㋼" U32FC # CIRCLED KATAKANA WI
-<Multi_key> <parenleft> <U30F1> <parenright> : "㋽" U32FD # CIRCLED KATAKANA WE
-<Multi_key> <parenleft> <kana_WO> <parenright> : "㋾" U32FE # CIRCLED KATAKANA WO
-<Multi_key> <U05B4> <hebrew_yod> : "יִ" UFB1D # HEBREW LETTER YOD WITH HIRIQ
-<Multi_key> <U05B7> <U05F2> : "ײַ" UFB1F # HEBREW LIGATURE YIDDISH YOD YOD PATAH
-<Multi_key> <U05C1> <hebrew_shin> : "שׁ" UFB2A # HEBREW LETTER SHIN WITH SHIN DOT
-<Multi_key> <U05C2> <hebrew_shin> : "שׂ" UFB2B # HEBREW LETTER SHIN WITH SIN DOT
-<Multi_key> <U05C1> <UFB49> : "שּׁ" UFB2C # HEBREW LETTER SHIN WITH DAGESH AND SHIN DOT
-<Multi_key> <U05C1> <U05BC> <hebrew_shin> : "שּׁ" UFB2C # HEBREW LETTER SHIN WITH DAGESH AND SHIN DOT
-<Multi_key> <U05C2> <UFB49> : "שּׂ" UFB2D # HEBREW LETTER SHIN WITH DAGESH AND SIN DOT
-<Multi_key> <U05C2> <U05BC> <hebrew_shin> : "שּׂ" UFB2D # HEBREW LETTER SHIN WITH DAGESH AND SIN DOT
-<Multi_key> <U05B7> <hebrew_aleph> : "אַ" UFB2E # HEBREW LETTER ALEF WITH PATAH
-<Multi_key> <U05B8> <hebrew_aleph> : "אָ" UFB2F # HEBREW LETTER ALEF WITH QAMATS
-<Multi_key> <U05BC> <hebrew_aleph> : "אּ" UFB30 # HEBREW LETTER ALEF WITH MAPIQ
-<Multi_key> <U05BC> <hebrew_bet> : "בּ" UFB31 # HEBREW LETTER BET WITH DAGESH
-<Multi_key> <U05BC> <hebrew_beth> : "בּ" UFB31 # HEBREW LETTER BET WITH DAGESH
-<Multi_key> <U05BC> <hebrew_gimel> : "גּ" UFB32 # HEBREW LETTER GIMEL WITH DAGESH
-<Multi_key> <U05BC> <hebrew_gimmel> : "גּ" UFB32 # HEBREW LETTER GIMEL WITH DAGESH
-<Multi_key> <U05BC> <hebrew_dalet> : "דּ" UFB33 # HEBREW LETTER DALET WITH DAGESH
-<Multi_key> <U05BC> <hebrew_daleth> : "דּ" UFB33 # HEBREW LETTER DALET WITH DAGESH
-<Multi_key> <U05BC> <hebrew_he> : "הּ" UFB34 # HEBREW LETTER HE WITH MAPIQ
-<Multi_key> <U05BC> <hebrew_waw> : "וּ" UFB35 # HEBREW LETTER VAV WITH DAGESH
-<Multi_key> <U05BC> <hebrew_zain> : "זּ" UFB36 # HEBREW LETTER ZAYIN WITH DAGESH
-<Multi_key> <U05BC> <hebrew_zayin> : "זּ" UFB36 # HEBREW LETTER ZAYIN WITH DAGESH
-<Multi_key> <U05BC> <hebrew_tet> : "טּ" UFB38 # HEBREW LETTER TET WITH DAGESH
-<Multi_key> <U05BC> <hebrew_teth> : "טּ" UFB38 # HEBREW LETTER TET WITH DAGESH
-<Multi_key> <U05BC> <hebrew_yod> : "יּ" UFB39 # HEBREW LETTER YOD WITH DAGESH
-<Multi_key> <U05BC> <hebrew_finalkaph> : "ךּ" UFB3A # HEBREW LETTER FINAL KAF WITH DAGESH
-<Multi_key> <U05BC> <hebrew_kaph> : "כּ" UFB3B # HEBREW LETTER KAF WITH DAGESH
-<Multi_key> <U05BC> <hebrew_lamed> : "לּ" UFB3C # HEBREW LETTER LAMED WITH DAGESH
-<Multi_key> <U05BC> <hebrew_mem> : "מּ" UFB3E # HEBREW LETTER MEM WITH DAGESH
-<Multi_key> <U05BC> <hebrew_nun> : "נּ" UFB40 # HEBREW LETTER NUN WITH DAGESH
-<Multi_key> <U05BC> <hebrew_samech> : "סּ" UFB41 # HEBREW LETTER SAMEKH WITH DAGESH
-<Multi_key> <U05BC> <hebrew_samekh> : "סּ" UFB41 # HEBREW LETTER SAMEKH WITH DAGESH
-<Multi_key> <U05BC> <hebrew_finalpe> : "ףּ" UFB43 # HEBREW LETTER FINAL PE WITH DAGESH
-<Multi_key> <U05BC> <hebrew_pe> : "פּ" UFB44 # HEBREW LETTER PE WITH DAGESH
-<Multi_key> <U05BC> <hebrew_zade> : "צּ" UFB46 # HEBREW LETTER TSADI WITH DAGESH
-<Multi_key> <U05BC> <hebrew_zadi> : "צּ" UFB46 # HEBREW LETTER TSADI WITH DAGESH
-<Multi_key> <U05BC> <hebrew_kuf> : "קּ" UFB47 # HEBREW LETTER QOF WITH DAGESH
-<Multi_key> <U05BC> <hebrew_qoph> : "קּ" UFB47 # HEBREW LETTER QOF WITH DAGESH
-<Multi_key> <U05BC> <hebrew_resh> : "רּ" UFB48 # HEBREW LETTER RESH WITH DAGESH
-<Multi_key> <U05BC> <hebrew_shin> : "שּ" UFB49 # HEBREW LETTER SHIN WITH DAGESH
-<Multi_key> <U05BC> <hebrew_taf> : "תּ" UFB4A # HEBREW LETTER TAV WITH DAGESH
-<Multi_key> <U05BC> <hebrew_taw> : "תּ" UFB4A # HEBREW LETTER TAV WITH DAGESH
-<Multi_key> <U05B9> <hebrew_waw> : "וֹ" UFB4B # HEBREW LETTER VAV WITH HOLAM
-<Multi_key> <U05BF> <hebrew_bet> : "בֿ" UFB4C # HEBREW LETTER BET WITH RAFE
-<Multi_key> <U05BF> <hebrew_beth> : "בֿ" UFB4C # HEBREW LETTER BET WITH RAFE
-<Multi_key> <U05BF> <hebrew_kaph> : "כֿ" UFB4D # HEBREW LETTER KAF WITH RAFE
-<Multi_key> <U05BF> <hebrew_pe> : "פֿ" UFB4E # HEBREW LETTER PE WITH RAFE
-<Multi_key> <U1D157> <U1D165> : "𝅗𝅥" U1D15E # MUSICAL SYMBOL HALF NOTE
-<Multi_key> <U1D158> <U1D165> : "𝅘𝅥" U1D15F # MUSICAL SYMBOL QUARTER NOTE
-<Multi_key> <U1D15F> <U1D16E> : "𝅘𝅥𝅮" U1D160 # MUSICAL SYMBOL EIGHTH NOTE
-/* <Multi_key> <U1D158> <U1D165> <U1D16E> : "𝅘𝅥𝅮" U1D160 # MUSICAL SYMBOL EIGHTH NOTE */
-<Multi_key> <U1D15F> <U1D16F> : "𝅘𝅥𝅯" U1D161 # MUSICAL SYMBOL SIXTEENTH NOTE
-/* <Multi_key> <U1D158> <U1D165> <U1D16F> : "𝅘𝅥𝅯" U1D161 # MUSICAL SYMBOL SIXTEENTH NOTE */
-<Multi_key> <U1D15F> <U1D170> : "𝅘𝅥𝅰" U1D162 # MUSICAL SYMBOL THIRTY-SECOND NOTE
-/* <Multi_key> <U1D158> <U1D165> <U1D170> : "𝅘𝅥𝅰" U1D162 # MUSICAL SYMBOL THIRTY-SECOND NOTE */
-<Multi_key> <U1D15F> <U1D171> : "𝅘𝅥𝅱" U1D163 # MUSICAL SYMBOL SIXTY-FOURTH NOTE
-/* <Multi_key> <U1D158> <U1D165> <U1D171> : "𝅘𝅥𝅱" U1D163 # MUSICAL SYMBOL SIXTY-FOURTH NOTE */
-<Multi_key> <U1D15F> <U1D172> : "𝅘𝅥𝅲" U1D164 # MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH NOTE
-/* <Multi_key> <U1D158> <U1D165> <U1D172> : "𝅘𝅥𝅲" U1D164 # MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH NOTE */
-<Multi_key> <U1D1B9> <U1D165> : "𝆹𝅥" U1D1BB # MUSICAL SYMBOL MINIMA
-<Multi_key> <U1D1BA> <U1D165> : "𝆺𝅥" U1D1BC # MUSICAL SYMBOL MINIMA BLACK
-<Multi_key> <U1D1BB> <U1D16E> : "𝆹𝅥𝅮" U1D1BD # MUSICAL SYMBOL SEMIMINIMA WHITE
-/* <Multi_key> <U1D1B9> <U1D165> <U1D16E> : "𝆹𝅥𝅮" U1D1BD # MUSICAL SYMBOL SEMIMINIMA WHITE */
-<Multi_key> <U1D1BC> <U1D16E> : "𝆺𝅥𝅮" U1D1BE # MUSICAL SYMBOL SEMIMINIMA BLACK
-/* <Multi_key> <U1D1BA> <U1D165> <U1D16E> : "𝆺𝅥𝅮" U1D1BE # MUSICAL SYMBOL SEMIMINIMA BLACK */
-<Multi_key> <U1D1BB> <U1D16F> : "𝆹𝅥𝅯" U1D1BF # MUSICAL SYMBOL FUSA WHITE
-/* <Multi_key> <U1D1B9> <U1D165> <U1D16F> : "𝆹𝅥𝅯" U1D1BF # MUSICAL SYMBOL FUSA WHITE */
-<Multi_key> <U1D1BC> <U1D16F> : "𝆺𝅥𝅯" U1D1C0 # MUSICAL SYMBOL FUSA BLACK
-/* <Multi_key> <U1D1BA> <U1D165> <U1D16F> : "𝆺𝅥𝅯" U1D1C0 # MUSICAL SYMBOL FUSA BLACK */
-
-XCOMM
-XCOMM Khmer digraphs
-XCOMM
-
-<U17ff> : "ាំ"
-<U17fe> : "ោះ"
-<U17fd> : "េះ"
-<U17fc> : "ុំ"
-<U17fb> : "ុះ"
-
-XCOMM
-XCOMM Arabic Lam-Alef ligatures
-XCOMM
-
-<UFEFB> : "لا" # ARABIC LIGATURE LAM WITH ALEF
-<UFEF7> : "لأ" # ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE
-<UFEF9> : "لإ" # ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW
-<UFEF5> : "لآ" # ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE
-
-XCOMM
-XCOMM French-Dvorak Bépo compositions
-XCOMM
-
-<dead_abovedot> <Amacron> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
-<dead_abovedot> <amacron> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
-<dead_abovedot> <j> : "ȷ" U0237 # LATIN SMALL LETTER DOTLESS J
-<dead_abovedot> <L> : "Ŀ" U013F # LATIN CAPITAL LETTER L WITH MIDDLE DOT
-<dead_abovedot> <l> : "ŀ" U0140 # LATIN SMALL LETTER L WITH MIDDLE DOT
-<dead_abovedot> <Omacron> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
-<dead_abovedot> <omacron> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
-<dead_abovedot> <nobreakspace> : "̇" U0307 # COMBINING DOT ABOVE
-<dead_acute> <Sabovedot> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
-<dead_acute> <sabovedot> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
-<dead_acute> <V> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
-<dead_acute> <v> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
-<dead_acute> <nobreakspace> : "́" U0301 # COMBINING ACUTE ACCENT
-<dead_belowdot> <Sabovedot> : "Ṩ" U1E68 # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
-<dead_belowdot> <sabovedot> : "ṩ" U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
-<dead_belowdot> <dead_belowdot> : "̣" U0323 # COMBINING DOT BELOW
-<dead_belowdot> <nobreakspace> : "̣" U0323 # COMBINING DOT BELOW
-<dead_belowdot> <space> : "̣" U0323 # COMBINING DOT BELOW
-<dead_breve> <Aacute> : "Ắ" Abreveacute # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
-<dead_breve> <Agrave> : "Ằ" Abrevegrave # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
-<dead_breve> <Ahook> : "Ẳ" Abrevehook # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
-<dead_breve> <Atilde> : "Ẵ" Abrevetilde # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
-<dead_breve> <aacute> : "ắ" abreveacute # LATIN SMALL LETTER A WITH BREVE AND ACUTE
-<dead_breve> <agrave> : "ằ" abrevegrave # LATIN SMALL LETTER A WITH BREVE AND GRAVE
-<dead_breve> <ahook> : "ẳ" abrevehook # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
-<dead_breve> <atilde> : "ẵ" abrevetilde # LATIN SMALL LETTER A WITH BREVE AND TILDE
-<dead_breve> <nobreakspace> : "̆" U0306 # COMBINING BREVE
-<dead_caron> <parenleft> : "₍" U208D # SUBSCRIPT LEFT PARENTHESIS
-<dead_caron> <parenright> : "₎" U208E # SUBSCRIPT RIGHT PARENTHESIS
-<dead_caron> <plus> : "₊" U208A # SUBSCRIPT PLUS SIGN
-<dead_caron> <minus> : "₋" U208B # SUBSCRIPT MINUS
-<dead_caron> <0> : "₀" zerosubscript # SUBSCRIPT ZERO
-<dead_caron> <1> : "₁" onesubscript # SUBSCRIPT ONE
-<dead_caron> <2> : "₂" twosubscript # SUBSCRIPT TWO
-<dead_caron> <3> : "₃" threesubscript # SUBSCRIPT THREE
-<dead_caron> <4> : "₄" foursubscript # SUBSCRIPT FOUR
-<dead_caron> <5> : "₅" fivesubscript # SUBSCRIPT FIVE
-<dead_caron> <6> : "₆" sixsubscript # SUBSCRIPT SIX
-<dead_caron> <7> : "₇" sevensubscript # SUBSCRIPT SEVEN
-<dead_caron> <8> : "₈" eightsubscript # SUBSCRIPT EIGHT
-<dead_caron> <9> : "₉" ninesubscript # SUBSCRIPT NINE
-<dead_caron> <equal> : "₌" U208C # SUBSCRIPT EQUALS SIGN
-<dead_caron> <U01F2> : "Dž" U01C5 # LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON
-<dead_caron> <Sabovedot> : "Ṧ" U1E66 # LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
-<dead_caron> <sabovedot> : "ṧ" U1E67 # LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
-<dead_caron> <V> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
-<dead_caron> <v> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
-<dead_caron> <nobreakspace> : "̌" U030C # COMBINING CARON
-<dead_cedilla> <Cacute> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
-<dead_cedilla> <ColonSign> : "₵" U20B5 # CEDI SIGN
-<dead_cedilla> <cacute> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
-<dead_cedilla> <cent> : "₵" U20B5 # CEDI SIGN
-<dead_cedilla> <U0114> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
-<dead_cedilla> <U0115> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
-<dead_cedilla> <nobreakspace> : "̧" U0327 # COMBINING CEDILLA
-<dead_circumflex> <minus> : "⁻" U207B # SUPERSCRIPT MINUS
-<dead_circumflex> <Aacute> : "Ấ" Acircumflexacute # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
-<dead_circumflex> <Agrave> : "Ầ" Acircumflexgrave # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
-<dead_circumflex> <Ahook> : "Ẩ" Acircumflexhook # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_circumflex> <Atilde> : "Ẫ" Acircumflextilde # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
-<dead_circumflex> <aacute> : "ấ" acircumflexacute # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
-<dead_circumflex> <agrave> : "ầ" acircumflexgrave # LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
-<dead_circumflex> <ahook> : "ẩ" acircumflexhook # LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_circumflex> <atilde> : "ẫ" acircumflextilde # LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
-<dead_circumflex> <Eacute> : "Ế" Ecircumflexacute # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
-<dead_circumflex> <Egrave> : "Ề" Ecircumflexgrave # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
-<dead_circumflex> <Ehook> : "Ể" Ecircumflexhook # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_circumflex> <Etilde> : "Ễ" Ecircumflextilde # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
-<dead_circumflex> <eacute> : "ế" ecircumflexacute # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
-<dead_circumflex> <egrave> : "ề" ecircumflexgrave # LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
-<dead_circumflex> <ehook> : "ể" ecircumflexhook # LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_circumflex> <etilde> : "ễ" ecircumflextilde # LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
-<dead_circumflex> <Oacute> : "Ố" Ocircumflexacute # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
-<dead_circumflex> <Ograve> : "Ồ" Ocircumflexgrave # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
-<dead_circumflex> <Ohook> : "Ổ" Ocircumflexhook # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_circumflex> <Otilde> : "Ỗ" Ocircumflextilde # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
-<dead_circumflex> <oacute> : "ố" ocircumflexacute # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
-<dead_circumflex> <ograve> : "ồ" ocircumflexgrave # LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
-<dead_circumflex> <ohook> : "ổ" ocircumflexhook # LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_circumflex> <otilde> : "ỗ" ocircumflextilde # LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
-<dead_circumflex> <nobreakspace> : "̂" U0302 # COMBINING CIRCUMFLEX ACCENT
-<dead_belowcomma> <S> : "Ș" U0218 # LATIN CAPITAL LETTER S WITH COMMA BELOW
-<dead_belowcomma> <s> : "ș" U0219 # LATIN SMALL LETTER S WITH COMMA BELOW
-<dead_belowcomma> <T> : "Ț" U021A # LATIN CAPITAL LETTER T WITH COMMA BELOW
-<dead_belowcomma> <t> : "ț" U021B # LATIN SMALL LETTER T WITH COMMA BELOW
-<dead_belowcomma> <dead_belowcomma> : "," comma # COMMA
-<dead_belowcomma> <nobreakspace> : "̦" U0326 # COMBINING COMMA BELOW
-<dead_belowcomma> <space> : "," comma # COMMA
-<dead_currency> <A> : "₳" U20B3 # AUSTRAL SIGN
-<dead_currency> <a> : "؋" U060B # AFGHANI SIGN
-<dead_currency> <B> : "₱" U20B1 # PESO SIGN
-<dead_currency> <b> : "฿" Thai_baht # THAI CURRENCY SYMBOL BAHT
-<dead_currency> <Ccedilla> : "₵" U20B5 # CEDI SIGN
-<dead_currency> <C> : "₡" ColonSign # COLON SIGN
-<dead_currency> <ccedilla> : "₵" U20B5 # CEDI SIGN
-<dead_currency> <c> : "¢" cent # CENT SIGN
-<dead_currency> <D> : "₯" U20AF # DRACHMA SIGN
-<dead_currency> <d> : "₫" DongSign # DONG SIGN
-<dead_currency> <E> : "₠" EcuSign # EURO-CURRENCY SIGN
-<dead_currency> <e> : "€" EuroSign # EURO SIGN
-<dead_currency> <F> : "₣" FFrancSign # FRENCH FRANC SIGN
-<dead_currency> <f> : "ƒ" function # LATIN SMALL LETTER F WITH HOOK
-<dead_currency> <G> : "₲" U20B2 # GUARANI SIGN
-<dead_currency> <g> : "₲" U20B2 # GUARANI SIGN
-<dead_currency> <H> : "₴" U20B4 # HRYVNIA SIGN
-<dead_currency> <h> : "₴" U20B4 # HRYVNIA SIGN
-<dead_currency> <I> : "៛" U17DB # KHMER CURRENCY SYMBOL RIEL
-<dead_currency> <i> : "﷼" UFDFC # RIAL SIGN
-<dead_currency> <K> : "₭" U20AD # KIP SIGN
-<dead_currency> <k> : "₭" U20AD # KIP SIGN
-<dead_currency> <L> : "₤" LiraSign # LIRA SIGN
-<dead_currency> <l> : "£" sterling # POUND SIGN
-<dead_currency> <M> : "ℳ" U2133 # SCRIPT CAPITAL M
-<dead_currency> <m> : "₥" MillSign # MILL SIGN
-<dead_currency> <N> : "₦" NairaSign # NAIRA SIGN
-<dead_currency> <n> : "₦" NairaSign # NAIRA SIGN
-<dead_currency> <O> : "૱" U0AF1 # GUJARATI RUPEE SIGN
-<dead_currency> <o> : "௹" U0BF9 # TAMIL RUPEE SIGN
-<dead_currency> <P> : "₧" PesetaSign # PESETA SIGN
-<dead_currency> <p> : "₰" U20B0 # GERMAN PENNY SIGN
-<dead_currency> <r> : "₢" CruzeiroSign # CRUZEIRO SIGN
-<dead_currency> <R> : "₨" RupeeSign # RUPEE SIGN
-<dead_currency> <S> : "$" dollar # DOLLAR SIGN
-<dead_currency> <s> : "₪" NewSheqelSign # NEW SHEQEL SIGN
-<dead_currency> <T> : "₮" U20AE # TUGRIK SIGN
-<dead_currency> <t> : "৳" U09F3 # BENGALI RUPEE SIGN
-<dead_currency> <THORN> : "৲" U09F2 # BENGALI RUPEE MARK
-<dead_currency> <thorn> : "৲" U09F2 # BENGALI RUPEE MARK
-<dead_currency> <U> : "圓" U5713 # YUAN / WEN
-<dead_currency> <u> : "元" U5143 # YUAN / WEN
-<dead_currency> <W> : "₩" WonSign # WON SIGN
-<dead_currency> <w> : "₩" WonSign # WON SIGN
-<dead_currency> <Y> : "円" U5186 # YEN
-<dead_currency> <y> : "¥" yen # YEN SIGN
-<dead_currency> <dead_currency> : "¤" currency # CURRENCY SIGN
-<dead_currency> <nobreakspace> : "¤" currency # CURRENCY SIGN
-<dead_currency> <space> : "¤" currency # CURRENCY SIGN
-<dead_diaeresis> <Amacron> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
-<dead_diaeresis> <amacron> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
-<dead_diaeresis> <Iacute> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
-<dead_diaeresis> <iacute> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
-<dead_diaeresis> <Omacron> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
-<dead_diaeresis> <omacron> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
-<dead_diaeresis> <Uacute> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
-<dead_diaeresis> <U01D3> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
-<dead_diaeresis> <Ugrave> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
-<dead_diaeresis> <uacute> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
-<dead_diaeresis> <U01D4> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
-<dead_diaeresis> <ugrave> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
-<dead_diaeresis> <nobreakspace> : "̈" U0308 # COMBINING DIAERESIS
-<dead_doubleacute> <nobreakspace> : "̋" U030B # COMBINING DOUBLE ACUTE ACCENT
-<dead_grave> <V> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
-<dead_grave> <v> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
-<dead_grave> <nobreakspace> : "̀" U0300 # COMBINING GRAVE ACCENT
-<dead_hook> <B> : "Ɓ" U0181 # LATIN CAPITAL LETTER B WITH HOOK
-<dead_hook> <b> : "ɓ" U0253 # LATIN SMALL LETTER B WITH HOOK
-<dead_hook> <C> : "Ƈ" U0187 # LATIN CAPITAL LETTER C WITH HOOK
-<dead_hook> <c> : "ƈ" U0188 # LATIN SMALL LETTER C WITH HOOK
-<dead_hook> <D> : "Ɗ" U018A # LATIN CAPITAL LETTER D WITH HOOK
-<dead_hook> <d> : "ɗ" U0257 # LATIN SMALL LETTER D WITH HOOK
-<dead_hook> <U0256> : "ᶑ" U1D91 # LATIN SMALL LETTER D WITH HOOK AND TAIL
-<dead_hook> <F> : "Ƒ" U0191 # LATIN CAPITAL LETTER F WITH HOOK
-<dead_hook> <f> : "ƒ" function # LATIN SMALL LETTER F WITH HOOK
-<dead_hook> <G> : "Ɠ" U0193 # LATIN CAPITAL LETTER G WITH HOOK
-<dead_hook> <g> : "ɠ" U0260 # LATIN SMALL LETTER G WITH HOOK
-<dead_hook> <h> : "ɦ" U0266 # LATIN SMALL LETTER H WITH HOOK
-<dead_hook> <U025F> : "ʄ" U0284 # LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK
-<dead_hook> <K> : "Ƙ" U0198 # LATIN CAPITAL LETTER K WITH HOOK
-<dead_hook> <k> : "ƙ" U0199 # LATIN SMALL LETTER K WITH HOOK
-<dead_hook> <M> : "Ɱ" U2C6E # LATIN CAPITAL LETTER M WITH HOOK
-<dead_hook> <m> : "ɱ" U0271 # LATIN SMALL LETTER M WITH HOOK
-<dead_hook> <N> : "Ɲ" U019D # LATIN CAPITAL LETTER N WITH LEFT HOOK
-<dead_hook> <n> : "ɲ" U0272 # LATIN SMALL LETTER N WITH LEFT HOOK
-<dead_hook> <P> : "Ƥ" U01A4 # LATIN CAPITAL LETTER P WITH HOOK
-<dead_hook> <p> : "ƥ" U01A5 # LATIN SMALL LETTER P WITH HOOK
-<dead_hook> <q> : "ʠ" U02A0 # LATIN SMALL LETTER Q WITH HOOK
-<dead_hook> <U025C> : "ɝ" U025D # LATIN SMALL LETTER REVERSED OPEN E WITH HOOK
-<dead_hook> <s> : "ʂ" U0282 # LATIN SMALL LETTER S WITH HOOK
-<dead_hook> <schwa> : "ɚ" U025A # LATIN SMALL LETTER SCHWA WITH HOOK
-<dead_hook> <T> : "Ƭ" U01AC # LATIN CAPITAL LETTER T WITH HOOK
-<dead_hook> <t> : "ƭ" U01AD # LATIN SMALL LETTER T WITH HOOK
-<dead_hook> <U0279> : "ɻ" U027B # LATIN SMALL LETTER TURNED R WITH HOOK
-<dead_hook> <V> : "Ʋ" U01B2 # LATIN CAPITAL LETTER V WITH HOOK
-<dead_hook> <v> : "ʋ" U028B # LATIN SMALL LETTER V WITH HOOK
-<dead_hook> <W> : "Ⱳ" U2C72 # LATIN CAPITAL LETTER W WITH HOOK
-<dead_hook> <w> : "ⱳ" U2C73 # LATIN SMALL LETTER W WITH HOOK
-<dead_hook> <Z> : "Ȥ" U0224 # LATIN CAPITAL LETTER Z WITH HOOK
-<dead_hook> <z> : "ȥ" U0225 # LATIN SMALL LETTER Z WITH HOOK
-<dead_hook> <dead_hook> : "̉" U0309 # COMBINING HOOK ABOVE
-<dead_hook> <nobreakspace> : "̉" U0309 # COMBINING HOOK ABOVE
-<dead_hook> <space> : "̉" U0309 # COMBINING HOOK ABOVE
-<dead_horn> <Oacute> : "Ớ" Ohornacute # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
-<dead_horn> <Obelowdot> : "Ợ" Ohornbelowdot # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
-<dead_horn> <Ograve> : "Ờ" Ohorngrave # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
-<dead_horn> <Ohook> : "Ở" Ohornhook # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
-<dead_horn> <Otilde> : "Ỡ" Ohorntilde # LATIN CAPITAL LETTER O WITH HORN AND TILDE
-<dead_horn> <oacute> : "ớ" ohornacute # LATIN SMALL LETTER O WITH HORN AND ACUTE
-<dead_horn> <obelowdot> : "ợ" ohornbelowdot # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
-<dead_horn> <ograve> : "ờ" ohorngrave # LATIN SMALL LETTER O WITH HORN AND GRAVE
-<dead_horn> <ohook> : "ở" ohornhook # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
-<dead_horn> <otilde> : "ỡ" ohorntilde # LATIN SMALL LETTER O WITH HORN AND TILDE
-<dead_horn> <Uacute> : "Ứ" Uhornacute # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
-<dead_horn> <Ubelowdot> : "Ự" Uhornbelowdot # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
-<dead_horn> <Ugrave> : "Ừ" Uhorngrave # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
-<dead_horn> <Uhook> : "Ử" Uhornhook # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
-<dead_horn> <Utilde> : "Ữ" Uhorntilde # LATIN CAPITAL LETTER U WITH HORN AND TILDE
-<dead_horn> <uacute> : "ứ" uhornacute # LATIN SMALL LETTER U WITH HORN AND ACUTE
-<dead_horn> <ubelowdot> : "ự" uhornbelowdot # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
-<dead_horn> <ugrave> : "ừ" uhorngrave # LATIN SMALL LETTER U WITH HORN AND GRAVE
-<dead_horn> <uhook> : "ử" uhornhook # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
-<dead_horn> <utilde> : "ữ" uhorntilde # LATIN SMALL LETTER U WITH HORN AND TILDE
-<dead_horn> <dead_horn> : "̛" U031B # COMBINING HORN
-<dead_horn> <nobreakspace> : "̛" U031B # COMBINING HORN
-<dead_horn> <space> : "̛" U031B # COMBINING HORN
-<dead_macron> <Eacute> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
-<dead_macron> <Egrave> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
-<dead_macron> <eacute> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
-<dead_macron> <egrave> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
-<dead_macron> <Oacute> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
-<dead_macron> <Ograve> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
-<dead_macron> <oacute> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
-<dead_macron> <ograve> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
-<dead_macron> <V> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
-<dead_macron> <v> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
-<dead_macron> <nobreakspace> : "̄" U0304 # COMBINING MACRON
-<dead_ogonek> <Omacron> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
-<dead_ogonek> <omacron> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
-<dead_ogonek> <nobreakspace> : "̨" U0328 # COMBINING OGONEK
-<dead_abovering> <Aacute> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
-<dead_abovering> <aacute> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
-<dead_abovering> <nobreakspace> : "̊" U030A # COMBINING RING ABOVE
-<dead_stroke> <2> : "ƻ" U01BB # LATIN LETTER TWO WITH STROKE
-<dead_stroke> <equal> : "≠" notequal # NOT EQUAL TO
-<dead_stroke> <A> : "Ⱥ" U023A # LATIN CAPITAL LETTER A WITH STROKE
-<dead_stroke> <a> : "ⱥ" U2C65 # LATIN SMALL LETTER A WITH STROKE
-<dead_stroke> <B> : "Ƀ" U0243 # LATIN CAPITAL LETTER B WITH STROKE
-<dead_stroke> <C> : "Ȼ" U023B # LATIN CAPITAL LETTER C WITH STROKE
-<dead_stroke> <c> : "ȼ" U023C # LATIN SMALL LETTER C WITH STROKE
-<dead_stroke> <E> : "Ɇ" U0246 # LATIN CAPITAL LETTER E WITH STROKE
-<dead_stroke> <e> : "ɇ" U0247 # LATIN SMALL LETTER E WITH STROKE
-<dead_stroke> <greater> : "≯" U226F # NOT GREATER-THAN
-<dead_stroke> <greaterthanequal> : "≱" U2271 # NEITHER GREATER-THAN NOR EQUAL TO
-<dead_stroke> <J> : "Ɉ" U0248 # LATIN CAPITAL LETTER J WITH STROKE
-<dead_stroke> <j> : "ɉ" U0249 # LATIN SMALL LETTER J WITH STROKE
-<dead_stroke> <U0269> : "ᵼ" U1D7C # LATIN SMALL LETTER IOTA WITH STROKE
-<dead_stroke> <U0237> : "ɟ" U025F # LATIN SMALL LETTER DOTLESS J WITH STROKE
-<dead_stroke> <less> : "≮" U226E # NOT LESS-THAN
-<dead_stroke> <lessthanequal> : "≰" U2270 # NEITHER LESS-THAN NOR EQUAL TO
-<dead_stroke> <Oacute> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
-<dead_stroke> <oacute> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
-<dead_stroke> <P> : "Ᵽ" U2C63 # LATIN CAPITAL LETTER P WITH STROKE
-<dead_stroke> <p> : "ᵽ" U1D7D # LATIN SMALL LETTER P WITH STROKE
-<dead_stroke> <R> : "Ɍ" U024C # LATIN CAPITAL LETTER R WITH STROKE
-<dead_stroke> <r> : "ɍ" U024D # LATIN SMALL LETTER R WITH STROKE
-<dead_stroke> <U> : "Ʉ" U0244 # LATIN CAPITAL LETTER U BAR
-<dead_stroke> <u> : "ʉ" U0289 # LATIN SMALL LETTER U BAR
-<dead_stroke> <Y> : "Ɏ" U024E # LATIN CAPITAL LETTER Y WITH STROKE
-<dead_stroke> <y> : "ɏ" U024F # LATIN SMALL LETTER Y WITH STROKE
-<dead_stroke> <dead_stroke> : "/" slash # SOLIDUS
-<dead_stroke> <nobreakspace> : "̸" U0338 # COMBINING LONG SOLIDUS OVERLAY
-<dead_stroke> <space> : "/" slash # SOLIDUS
-<dead_tilde> <Oacute> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
-<dead_tilde> <Odiaeresis> : "Ṏ" U1E4E # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
-<dead_tilde> <Omacron> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
-<dead_tilde> <oacute> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
-<dead_tilde> <odiaeresis> : "ṏ" U1E4F # LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
-<dead_tilde> <omacron> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
-<dead_tilde> <Uacute> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
-<dead_tilde> <uacute> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
-<dead_tilde> <equal> : "≃" similarequal # ASYMPTOTICALLY EQUAL TO
-<dead_tilde> <less> : "≲" U2272 # LESS-THAN OR EQUIVALENT TO
-<dead_tilde> <greater> : "≳" U2273 # GREATER-THAN OR EQUIVALENT TO
-<dead_tilde> <nobreakspace> : "̃" U0303 # COMBINING TILDE
-<dead_acute> <dead_abovedot> <S> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
-<dead_acute> <dead_abovedot> <s> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
-<dead_belowdot> <dead_abovedot> <S> : "Ṩ" U1E68 # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
-<dead_belowdot> <dead_abovedot> <s> : "ṩ" U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
-<dead_caron> <dead_abovedot> <S> : "Ṧ" U1E66 # LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
-<dead_caron> <dead_abovedot> <s> : "ṧ" U1E67 # LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
-<dead_abovedot> <dead_macron> <A> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
-<dead_abovedot> <dead_macron> <a> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
-<dead_abovedot> <dead_macron> <O> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
-<dead_abovedot> <dead_macron> <o> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
-<dead_abovedot> <dead_stroke> <j> : "ɟ" U025F # LATIN SMALL LETTER DOTLESS J WITH STROKE
-<dead_stroke> <dead_abovedot> <j> : "ɟ" U025F # LATIN SMALL LETTER DOTLESS J WITH STROKE
-<dead_breve> <dead_acute> <A> : "Ắ" Abreveacute # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
-<dead_breve> <dead_acute> <a> : "ắ" abreveacute # LATIN SMALL LETTER A WITH BREVE AND ACUTE
-<dead_cedilla> <dead_acute> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
-<dead_cedilla> <dead_acute> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
-<dead_circumflex> <dead_acute> <A> : "Ấ" Acircumflexacute # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
-<dead_circumflex> <dead_acute> <a> : "ấ" acircumflexacute # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
-<dead_circumflex> <dead_acute> <E> : "Ế" Ecircumflexacute # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
-<dead_circumflex> <dead_acute> <e> : "ế" ecircumflexacute # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
-<dead_circumflex> <dead_acute> <O> : "Ố" Ocircumflexacute # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
-<dead_circumflex> <dead_acute> <o> : "ố" ocircumflexacute # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
-<dead_diaeresis> <dead_acute> <I> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
-<dead_diaeresis> <dead_acute> <i> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
-<dead_diaeresis> <dead_acute> <U> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
-<dead_diaeresis> <dead_acute> <u> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
-<dead_horn> <dead_acute> <O> : "Ớ" Ohornacute # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
-<dead_horn> <dead_acute> <o> : "ớ" ohornacute # LATIN SMALL LETTER O WITH HORN AND ACUTE
-<dead_horn> <dead_acute> <U> : "Ứ" Uhornacute # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
-<dead_horn> <dead_acute> <u> : "ứ" uhornacute # LATIN SMALL LETTER U WITH HORN AND ACUTE
-<dead_macron> <dead_acute> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
-<dead_macron> <dead_acute> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
-<dead_macron> <dead_acute> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
-<dead_macron> <dead_acute> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
-<dead_abovering> <dead_acute> <A> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
-<dead_abovering> <dead_acute> <a> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
-<dead_tilde> <dead_acute> <O> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
-<dead_tilde> <dead_acute> <o> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
-<dead_tilde> <dead_acute> <U> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
-<dead_tilde> <dead_acute> <u> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
-<dead_belowdot> <dead_breve> <A> : "Ặ" Abrevebelowdot # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
-<dead_belowdot> <dead_breve> <a> : "ặ" abrevebelowdot # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
-<dead_belowdot> <dead_circumflex> <A> : "Ậ" Acircumflexbelowdot # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-<dead_belowdot> <dead_circumflex> <a> : "ậ" acircumflexbelowdot # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
-<dead_belowdot> <dead_circumflex> <E> : "Ệ" Ecircumflexbelowdot # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-<dead_belowdot> <dead_circumflex> <e> : "ệ" ecircumflexbelowdot # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
-<dead_belowdot> <dead_circumflex> <O> : "Ộ" Ocircumflexbelowdot # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-<dead_belowdot> <dead_circumflex> <o> : "ộ" ocircumflexbelowdot # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
-<dead_horn> <dead_belowdot> <O> : "Ợ" Ohornbelowdot # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
-<dead_horn> <dead_belowdot> <o> : "ợ" ohornbelowdot # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
-<dead_horn> <dead_belowdot> <U> : "Ự" Uhornbelowdot # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
-<dead_horn> <dead_belowdot> <u> : "ự" uhornbelowdot # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
-<dead_belowdot> <dead_macron> <L> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
-<dead_belowdot> <dead_macron> <l> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
-<dead_belowdot> <dead_macron> <R> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
-<dead_belowdot> <dead_macron> <r> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
-<dead_cedilla> <dead_breve> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
-<dead_cedilla> <dead_breve> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
-<dead_breve> <dead_grave> <A> : "Ằ" Abrevegrave # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
-<dead_breve> <dead_grave> <a> : "ằ" abrevegrave # LATIN SMALL LETTER A WITH BREVE AND GRAVE
-<dead_breve> <dead_hook> <A> : "Ẳ" Abrevehook # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
-<dead_breve> <dead_hook> <a> : "ẳ" abrevehook # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
-<dead_breve> <dead_tilde> <A> : "Ẵ" Abrevetilde # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
-<dead_breve> <dead_tilde> <a> : "ẵ" abrevetilde # LATIN SMALL LETTER A WITH BREVE AND TILDE
-<dead_diaeresis> <dead_caron> <U> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
-<dead_diaeresis> <dead_caron> <u> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
-<dead_cedilla> <dead_currency> <C> : "₵" U20B5 # CEDI SIGN
-<dead_currency> <dead_cedilla> <C> : "₵" U20B5 # CEDI SIGN
-<dead_cedilla> <dead_currency> <c> : "₵" U20B5 # CEDI SIGN
-<dead_currency> <dead_cedilla> <c> : "₵" U20B5 # CEDI SIGN
-<dead_circumflex> <dead_grave> <A> : "Ầ" Acircumflexgrave # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
-<dead_circumflex> <dead_grave> <a> : "ầ" acircumflexgrave # LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
-<dead_circumflex> <dead_grave> <E> : "Ề" Ecircumflexgrave # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
-<dead_circumflex> <dead_grave> <e> : "ề" ecircumflexgrave # LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
-<dead_circumflex> <dead_grave> <O> : "Ồ" Ocircumflexgrave # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
-<dead_circumflex> <dead_grave> <o> : "ồ" ocircumflexgrave # LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
-<dead_circumflex> <dead_hook> <A> : "Ẩ" Acircumflexhook # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_circumflex> <dead_hook> <a> : "ẩ" acircumflexhook # LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_circumflex> <dead_hook> <E> : "Ể" Ecircumflexhook # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_circumflex> <dead_hook> <e> : "ể" ecircumflexhook # LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_circumflex> <dead_hook> <O> : "Ổ" Ocircumflexhook # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_circumflex> <dead_hook> <o> : "ổ" ocircumflexhook # LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
-<dead_circumflex> <dead_tilde> <A> : "Ẫ" Acircumflextilde # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
-<dead_circumflex> <dead_tilde> <a> : "ẫ" acircumflextilde # LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
-<dead_circumflex> <dead_tilde> <E> : "Ễ" Ecircumflextilde # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
-<dead_circumflex> <dead_tilde> <e> : "ễ" ecircumflextilde # LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
-<dead_circumflex> <dead_tilde> <O> : "Ỗ" Ocircumflextilde # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
-<dead_circumflex> <dead_tilde> <o> : "ỗ" ocircumflextilde # LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
-<dead_diaeresis> <dead_grave> <U> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
-<dead_diaeresis> <dead_grave> <u> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
-<dead_diaeresis> <dead_macron> <A> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
-<dead_diaeresis> <dead_macron> <a> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
-<dead_diaeresis> <dead_macron> <O> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
-<dead_diaeresis> <dead_macron> <o> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
-<dead_tilde> <dead_diaeresis> <O> : "Ṏ" U1E4E # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
-<dead_tilde> <dead_diaeresis> <o> : "ṏ" U1E4F # LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
-<dead_horn> <dead_grave> <O> : "Ờ" Ohorngrave # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
-<dead_horn> <dead_grave> <o> : "ờ" ohorngrave # LATIN SMALL LETTER O WITH HORN AND GRAVE
-<dead_horn> <dead_grave> <U> : "Ừ" Uhorngrave # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
-<dead_horn> <dead_grave> <u> : "ừ" uhorngrave # LATIN SMALL LETTER U WITH HORN AND GRAVE
-<dead_macron> <dead_grave> <E> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
-<dead_macron> <dead_grave> <e> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
-<dead_macron> <dead_grave> <O> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
-<dead_macron> <dead_grave> <o> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
-<dead_horn> <dead_hook> <O> : "Ở" Ohornhook # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
-<dead_horn> <dead_hook> <o> : "ở" ohornhook # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
-<dead_horn> <dead_hook> <U> : "Ử" Uhornhook # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
-<dead_horn> <dead_hook> <u> : "ử" uhornhook # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
-<dead_horn> <dead_tilde> <O> : "Ỡ" Ohorntilde # LATIN CAPITAL LETTER O WITH HORN AND TILDE
-<dead_horn> <dead_tilde> <o> : "ỡ" ohorntilde # LATIN SMALL LETTER O WITH HORN AND TILDE
-<dead_horn> <dead_tilde> <U> : "Ữ" Uhorntilde # LATIN CAPITAL LETTER U WITH HORN AND TILDE
-<dead_horn> <dead_tilde> <u> : "ữ" uhorntilde # LATIN SMALL LETTER U WITH HORN AND TILDE
-<dead_ogonek> <dead_macron> <O> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
-<dead_ogonek> <dead_macron> <o> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
-<dead_tilde> <dead_macron> <O> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
-<dead_tilde> <dead_macron> <o> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
-
-XCOMM
-XCOMM Cyrillic NFDs
-XCOMM
-
-<dead_doublegrave> <Cyrillic_a> : "а̏" # CYRILLIC SMALL LETTER A WITH COMBINING DOUBLE GRAVE ACCENT
-<Multi_key> <grave> <grave> <Cyrillic_a> : "а̏" # CYRILLIC SMALL LETTER A WITH COMBINING DOUBLE GRAVE ACCENT
-
-<dead_invertedbreve> <Cyrillic_a> : "а̑" # CYRILLIC SMALL LETTER A WITH COMBINING INVERTED BREVE
-
-<dead_grave> <Cyrillic_a> : "а̀" # CYRILLIC SMALL LETTER A WITH COMBINING GRAVE ACCENT
-<Multi_key> <grave> <Cyrillic_a> : "а̀" # CYRILLIC SMALL LETTER A WITH COMBINING GRAVE ACCENT
-
-<dead_acute> <Cyrillic_a> : "а́" # CYRILLIC SMALL LETTER A WITH COMBINING ACUTE ACCENT
-<Multi_key> <acute> <Cyrillic_a> : "а́" # CYRILLIC SMALL LETTER A WITH COMBINING ACUTE ACCENT
-<Multi_key> <apostrophe> <Cyrillic_a> : "а́" # CYRILLIC SMALL LETTER A WITH COMBINING ACUTE ACCENT
-
-<dead_macron> <Cyrillic_a> : "а̄" # CYRILLIC SMALL LETTER A WITH COMBINING MACRON
-<Multi_key> <macron> <Cyrillic_a> : "а̄" # CYRILLIC SMALL LETTER A WITH COMBINING MACRON
-<Multi_key> <underscore> <Cyrillic_a> : "а̄" # CYRILLIC SMALL LETTER A WITH COMBINING MACRON
-
-<dead_circumflex> <Cyrillic_a> : "а̂" # CYRILLIC SMALL LETTER A WITH COMBINING CIRCUMFLEX ACCENT
-<Multi_key> <asciicircum> <Cyrillic_a> : "а̂" # CYRILLIC SMALL LETTER A WITH COMBINING CIRCUMFLEX ACCENT
-
-<dead_doublegrave> <Cyrillic_A> : "А̏" # CYRILLIC CAPITAL LETTER A WITH COMBINING DOUBLE GRAVE ACCENT
-<Multi_key> <grave> <grave> <Cyrillic_A> : "А̏" # CYRILLIC CAPITAL LETTER A WITH COMBINING DOUBLE GRAVE ACCENT
-
-<dead_invertedbreve> <Cyrillic_A> : "А̑" # CYRILLIC CAPITAL LETTER A WITH COMBINING INVERTED BREVE
-
-<dead_grave> <Cyrillic_A> : "А̀" # CYRILLIC CAPITAL LETTER A WITH COMBINING GRAVE ACCENT
-<Multi_key> <grave> <Cyrillic_A> : "А̀" # CYRILLIC CAPITAL LETTER A WITH COMBINING GRAVE ACCENT
-
-<dead_acute> <Cyrillic_A> : "А́" # CYRILLIC CAPITAL LETTER A WITH COMBINING ACUTE ACCENT
-<Multi_key> <acute> <Cyrillic_A> : "А́" # CYRILLIC CAPITAL LETTER A WITH COMBINING ACUTE ACCENT
-<Multi_key> <apostrophe> <Cyrillic_A> : "А́" # CYRILLIC CAPITAL LETTER A WITH COMBINING ACUTE ACCENT
-
-<dead_macron> <Cyrillic_A> : "А̄" # CYRILLIC CAPITAL LETTER A WITH COMBINING MACRON
-<Multi_key> <macron> <Cyrillic_A> : "А̄" # CYRILLIC CAPITAL LETTER A WITH COMBINING MACRON
-<Multi_key> <underscore> <Cyrillic_A> : "А̄" # CYRILLIC CAPITAL LETTER A WITH COMBINING MACRON
-
-<dead_circumflex> <Cyrillic_A> : "А̂" # CYRILLIC CAPITAL LETTER A WITH COMBINING CIRCUMFLEX ACCENT
-<Multi_key> <asciicircum> <Cyrillic_A> : "А̂" # CYRILLIC CAPITAL LETTER A WITH COMBINING CIRCUMFLEX ACCENT
-
-<dead_doublegrave> <Cyrillic_ie> : "е̏" # CYRILLIC SMALL LETTER IE WITH COMBINING DOUBLE GRAVE ACCENT
-<Multi_key> <grave> <grave> <Cyrillic_ie> : "е̏" # CYRILLIC SMALL LETTER IE WITH COMBINING DOUBLE GRAVE ACCENT
-
-<dead_invertedbreve> <Cyrillic_ie> : "е̑" # CYRILLIC SMALL LETTER IE WITH COMBINING INVERTED BREVE
-
-<dead_acute> <Cyrillic_ie> : "е́" # CYRILLIC SMALL LETTER IE WITH COMBINING ACUTE ACCENT
-<Multi_key> <acute> <Cyrillic_ie> : "е́" # CYRILLIC SMALL LETTER IE WITH COMBINING ACUTE ACCENT
-<Multi_key> <apostrophe> <Cyrillic_ie> : "е́" # CYRILLIC SMALL LETTER IE WITH COMBINING ACUTE ACCENT
-
-<dead_macron> <Cyrillic_ie> : "е̄" # CYRILLIC SMALL LETTER IE WITH COMBINING MACRON
-<Multi_key> <macron> <Cyrillic_ie> : "е̄" # CYRILLIC SMALL LETTER IE WITH COMBINING MACRON
-<Multi_key> <underscore> <Cyrillic_ie> : "е̄" # CYRILLIC SMALL LETTER IE WITH COMBINING MACRON
-
-<dead_circumflex> <Cyrillic_ie> : "е̂" # CYRILLIC SMALL LETTER IE WITH COMBINING CIRCUMFLEX ACCENT
-<Multi_key> <asciicircum> <Cyrillic_ie> : "е̂" # CYRILLIC SMALL LETTER IE WITH COMBINING CIRCUMFLEX ACCENT
-
-<dead_doublegrave> <Cyrillic_IE> : "Е̏" # CYRILLIC CAPITAL LETTER IE WITH COMBINING DOUBLE GRAVE ACCENT
-<Multi_key> <grave> <grave> <Cyrillic_IE> : "Е̏" # CYRILLIC CAPITAL LETTER IE WITH COMBINING DOUBLE GRAVE ACCENT
-
-<dead_invertedbreve> <Cyrillic_IE> : "Е̑" # CYRILLIC CAPITAL LETTER IE WITH COMBINING INVERTED BREVE
-
-<dead_acute> <Cyrillic_IE> : "Е́" # CYRILLIC CAPITAL LETTER IE WITH COMBINING ACUTE ACCENT
-<Multi_key> <acute> <Cyrillic_IE> : "Е́" # CYRILLIC CAPITAL LETTER IE WITH COMBINING ACUTE ACCENT
-<Multi_key> <apostrophe> <Cyrillic_IE> : "Е́" # CYRILLIC CAPITAL LETTER IE WITH COMBINING ACUTE ACCENT
-
-<dead_macron> <Cyrillic_IE> : "Е̄" # CYRILLIC CAPITAL LETTER IE WITH COMBINING MACRON
-<Multi_key> <macron> <Cyrillic_IE> : "Е̄" # CYRILLIC CAPITAL LETTER IE WITH COMBINING MACRON
-<Multi_key> <underscore> <Cyrillic_IE> : "Е̄" # CYRILLIC CAPITAL LETTER IE WITH COMBINING MACRON
-
-<dead_circumflex> <Cyrillic_IE> : "Е̂" # CYRILLIC CAPITAL LETTER IE WITH COMBINING CIRCUMFLEX ACCENT
-<Multi_key> <asciicircum> <Cyrillic_IE> : "Е̂" # CYRILLIC CAPITAL LETTER IE WITH COMBINING CIRCUMFLEX ACCENT
-
-<dead_doublegrave> <Cyrillic_i> : "и̏" # CYRILLIC SMALL LETTER I WITH COMBINING DOUBLE GRAVE ACCENT
-<Multi_key> <grave> <grave> <Cyrillic_i> : "и̏" # CYRILLIC SMALL LETTER I WITH COMBINING DOUBLE GRAVE ACCENT
-
-<dead_invertedbreve> <Cyrillic_i> : "и̑" # CYRILLIC SMALL LETTER I WITH COMBINING INVERTED BREVE
-
-<dead_acute> <Cyrillic_i> : "и́" # CYRILLIC SMALL LETTER I WITH COMBINING ACUTE ACCENT
-<Multi_key> <acute> <Cyrillic_i> : "и́" # CYRILLIC SMALL LETTER I WITH COMBINING ACUTE ACCENT
-<Multi_key> <apostrophe> <Cyrillic_i> : "и́" # CYRILLIC SMALL LETTER I WITH COMBINING ACUTE ACCENT
-
-<dead_circumflex> <Cyrillic_i> : "и̂" # CYRILLIC SMALL LETTER I WITH COMBINING CIRCUMFLEX ACCENT
-<Multi_key> <asciicircum> <Cyrillic_i> : "и̂" # CYRILLIC SMALL LETTER I WITH COMBINING CIRCUMFLEX ACCENT
-
-<dead_doublegrave> <Cyrillic_I> : "И̏" # CYRILLIC CAPITAL LETTER I WITH COMBINING DOUBLE GRAVE ACCENT
-<Multi_key> <grave> <grave> <Cyrillic_I> : "И̏" # CYRILLIC CAPITAL LETTER I WITH COMBINING DOUBLE GRAVE ACCENT
-
-<dead_invertedbreve> <Cyrillic_I> : "И̑" # CYRILLIC CAPITAL LETTER I WITH COMBINING INVERTED BREVE
-
-<dead_acute> <Cyrillic_I> : "И́" # CYRILLIC CAPITAL LETTER I WITH COMBINING ACUTE ACCENT
-<Multi_key> <acute> <Cyrillic_I> : "И́" # CYRILLIC CAPITAL LETTER I WITH COMBINING ACUTE ACCENT
-<Multi_key> <apostrophe> <Cyrillic_I> : "И́" # CYRILLIC CAPITAL LETTER I WITH COMBINING ACUTE ACCENT
-
-<dead_circumflex> <Cyrillic_I> : "И̂" # CYRILLIC CAPITAL LETTER I WITH COMBINING CIRCUMFLEX ACCENT
-<Multi_key> <asciicircum> <Cyrillic_I> : "И̂" # CYRILLIC CAPITAL LETTER I WITH COMBINING CIRCUMFLEX ACCENT
-
-<dead_doublegrave> <Cyrillic_o> : "о̏" # CYRILLIC SMALL LETTER O WITH COMBINING DOUBLE GRAVE ACCENT
-<Multi_key> <grave> <grave> <Cyrillic_o> : "о̏" # CYRILLIC SMALL LETTER O WITH COMBINING DOUBLE GRAVE ACCENT
-
-<dead_invertedbreve> <Cyrillic_o> : "о̑" # CYRILLIC SMALL LETTER O WITH COMBINING INVERTED BREVE
-
-<dead_grave> <Cyrillic_o> : "о̀" # CYRILLIC SMALL LETTER O WITH COMBINING GRAVE ACCENT
-<Multi_key> <grave> <Cyrillic_o> : "о̀" # CYRILLIC SMALL LETTER O WITH COMBINING GRAVE ACCENT
-
-<dead_acute> <Cyrillic_o> : "о́" # CYRILLIC SMALL LETTER O WITH COMBINING ACUTE ACCENT
-<Multi_key> <acute> <Cyrillic_o> : "о́" # CYRILLIC SMALL LETTER O WITH COMBINING ACUTE ACCENT
-<Multi_key> <apostrophe> <Cyrillic_o> : "о́" # CYRILLIC SMALL LETTER O WITH COMBINING ACUTE ACCENT
-
-<dead_macron> <Cyrillic_o> : "о̄" # CYRILLIC SMALL LETTER O WITH COMBINING MACRON
-<Multi_key> <macron> <Cyrillic_o> : "о̄" # CYRILLIC SMALL LETTER O WITH COMBINING MACRON
-<Multi_key> <underscore> <Cyrillic_o> : "о̄" # CYRILLIC SMALL LETTER O WITH COMBINING MACRON
-
-<dead_circumflex> <Cyrillic_o> : "о̂" # CYRILLIC SMALL LETTER O WITH COMBINING CIRCUMFLEX ACCENT
-<Multi_key> <asciicircum> <Cyrillic_o> : "о̂" # CYRILLIC SMALL LETTER O WITH COMBINING CIRCUMFLEX ACCENT
-
-<dead_doublegrave> <Cyrillic_O> : "О̏" # CYRILLIC CAPITAL LETTER O WITH COMBINING DOUBLE GRAVE ACCENT
-<Multi_key> <grave> <grave> <Cyrillic_O> : "О̏" # CYRILLIC CAPITAL LETTER O WITH COMBINING DOUBLE GRAVE ACCENT
-
-<dead_invertedbreve> <Cyrillic_O> : "О̑" # CYRILLIC CAPITAL LETTER O WITH COMBINING INVERTED BREVE
-
-<dead_grave> <Cyrillic_O> : "О̀" # CYRILLIC CAPITAL LETTER O WITH COMBINING GRAVE ACCENT
-<Multi_key> <grave> <Cyrillic_O> : "О̀" # CYRILLIC CAPITAL LETTER O WITH COMBINING GRAVE ACCENT
-
-<dead_acute> <Cyrillic_O> : "О́" # CYRILLIC CAPITAL LETTER O WITH COMBINING ACUTE ACCENT
-<Multi_key> <acute> <Cyrillic_O> : "О́" # CYRILLIC CAPITAL LETTER O WITH COMBINING ACUTE ACCENT
-<Multi_key> <apostrophe> <Cyrillic_O> : "О́" # CYRILLIC CAPITAL LETTER O WITH COMBINING ACUTE ACCENT
-
-<dead_macron> <Cyrillic_O> : "О̄" # CYRILLIC CAPITAL LETTER O WITH COMBINING MACRON
-<Multi_key> <macron> <Cyrillic_O> : "О̄" # CYRILLIC CAPITAL LETTER O WITH COMBINING MACRON
-<Multi_key> <underscore> <Cyrillic_O> : "О̄" # CYRILLIC CAPITAL LETTER O WITH COMBINING MACRON
-
-<dead_circumflex> <Cyrillic_O> : "О̂" # CYRILLIC CAPITAL LETTER O WITH COMBINING CIRCUMFLEX ACCENT
-<Multi_key> <asciicircum> <Cyrillic_O> : "О̂" # CYRILLIC CAPITAL LETTER O WITH COMBINING CIRCUMFLEX ACCENT
-
-<dead_doublegrave> <Cyrillic_u> : "у̏" # CYRILLIC SMALL LETTER U WITH COMBINING DOUBLE GRAVE ACCENT
-<Multi_key> <grave> <grave> <Cyrillic_u> : "у̏" # CYRILLIC SMALL LETTER U WITH COMBINING DOUBLE GRAVE ACCENT
-
-<dead_invertedbreve> <Cyrillic_u> : "у̑" # CYRILLIC SMALL LETTER U WITH COMBINING INVERTED BREVE
-
-<dead_grave> <Cyrillic_u> : "у̀" # CYRILLIC SMALL LETTER U WITH COMBINING GRAVE ACCENT
-<Multi_key> <grave> <Cyrillic_u> : "у̀" # CYRILLIC SMALL LETTER U WITH COMBINING GRAVE ACCENT
-
-<dead_acute> <Cyrillic_u> : "у́" # CYRILLIC SMALL LETTER U WITH COMBINING ACUTE ACCENT
-<Multi_key> <acute> <Cyrillic_u> : "у́" # CYRILLIC SMALL LETTER U WITH COMBINING ACUTE ACCENT
-<Multi_key> <apostrophe> <Cyrillic_u> : "у́" # CYRILLIC SMALL LETTER U WITH COMBINING ACUTE ACCENT
-
-<dead_circumflex> <Cyrillic_u> : "у̂" # CYRILLIC SMALL LETTER U WITH COMBINING CIRCUMFLEX ACCENT
-<Multi_key> <asciicircum> <Cyrillic_u> : "у̂" # CYRILLIC SMALL LETTER U WITH COMBINING CIRCUMFLEX ACCENT
-
-<dead_doublegrave> <Cyrillic_U> : "У̏" # CYRILLIC CAPITAL LETTER U WITH COMBINING DOUBLE GRAVE ACCENT
-<Multi_key> <grave> <grave> <Cyrillic_U> : "У̏" # CYRILLIC CAPITAL LETTER U WITH COMBINING DOUBLE GRAVE ACCENT
-
-<dead_invertedbreve> <Cyrillic_U> : "У̑" # CYRILLIC CAPITAL LETTER U WITH COMBINING INVERTED BREVE
-
-<dead_grave> <Cyrillic_U> : "У̀" # CYRILLIC CAPITAL LETTER U WITH COMBINING GRAVE ACCENT
-<Multi_key> <grave> <Cyrillic_U> : "У̀" # CYRILLIC CAPITAL LETTER U WITH COMBINING GRAVE ACCENT
-
-<dead_acute> <Cyrillic_U> : "У́" # CYRILLIC CAPITAL LETTER U WITH COMBINING ACUTE ACCENT
-<Multi_key> <acute> <Cyrillic_U> : "У́" # CYRILLIC CAPITAL LETTER U WITH COMBINING ACUTE ACCENT
-<Multi_key> <apostrophe> <Cyrillic_U> : "У́" # CYRILLIC CAPITAL LETTER U WITH COMBINING ACUTE ACCENT
-
-<dead_circumflex> <Cyrillic_U> : "У̂" # CYRILLIC CAPITAL LETTER U WITH COMBINING CIRCUMFLEX ACCENT
-<Multi_key> <asciicircum> <Cyrillic_U> : "У̂" # CYRILLIC CAPITAL LETTER U WITH COMBINING CIRCUMFLEX ACCENT
-
-<dead_doublegrave> <Cyrillic_er> : "р̏" # CYRILLIC SMALL LETTER ER WITH COMBINING DOUBLE GRAVE ACCENT
-<Multi_key> <grave> <grave> <Cyrillic_er> : "р̏" # CYRILLIC SMALL LETTER ER WITH COMBINING DOUBLE GRAVE ACCENT
-
-<dead_invertedbreve> <Cyrillic_er> : "р̑" # CYRILLIC SMALL LETTER ER WITH COMBINING INVERTED BREVE
-
-<dead_grave> <Cyrillic_er> : "р̀" # CYRILLIC SMALL LETTER ER WITH COMBINING GRAVE ACCENT
-<Multi_key> <grave> <Cyrillic_er> : "р̀" # CYRILLIC SMALL LETTER ER WITH COMBINING GRAVE ACCENT
-
-<dead_acute> <Cyrillic_er> : "р́" # CYRILLIC SMALL LETTER ER WITH COMBINING ACUTE ACCENT
-<Multi_key> <acute> <Cyrillic_er> : "р́" # CYRILLIC SMALL LETTER ER WITH COMBINING ACUTE ACCENT
-<Multi_key> <apostrophe> <Cyrillic_er> : "р́" # CYRILLIC SMALL LETTER ER WITH COMBINING ACUTE ACCENT
-
-<dead_macron> <Cyrillic_er> : "р̄" # CYRILLIC SMALL LETTER ER WITH COMBINING MACRON
-<Multi_key> <macron> <Cyrillic_er> : "р̄" # CYRILLIC SMALL LETTER ER WITH COMBINING MACRON
-<Multi_key> <underscore> <Cyrillic_er> : "р̄" # CYRILLIC SMALL LETTER ER WITH COMBINING MACRON
-
-<dead_circumflex> <Cyrillic_er> : "р̂" # CYRILLIC SMALL LETTER ER WITH COMBINING CIRCUMFLEX ACCENT
-<Multi_key> <asciicircum> <Cyrillic_er> : "р̂" # CYRILLIC SMALL LETTER ER WITH COMBINING CIRCUMFLEX ACCENT
-
-<dead_doublegrave> <Cyrillic_ER> : "Р̏" # CYRILLIC CAPITAL LETTER ER WITH COMBINING DOUBLE GRAVE ACCENT
-<Multi_key> <grave> <grave> <Cyrillic_ER> : "Р̏" # CYRILLIC CAPITAL LETTER ER WITH COMBINING DOUBLE GRAVE ACCENT
-
-<dead_invertedbreve> <Cyrillic_ER> : "Р̑" # CYRILLIC CAPITAL LETTER ER WITH COMBINING INVERTED BREVE
-
-<dead_grave> <Cyrillic_ER> : "Р̀" # CYRILLIC CAPITAL LETTER ER WITH COMBINING GRAVE ACCENT
-<Multi_key> <grave> <Cyrillic_ER> : "Р̀" # CYRILLIC CAPITAL LETTER ER WITH COMBINING GRAVE ACCENT
-
-<dead_acute> <Cyrillic_ER> : "Р́" # CYRILLIC CAPITAL LETTER ER WITH COMBINING ACUTE ACCENT
-<Multi_key> <acute> <Cyrillic_ER> : "Р́" # CYRILLIC CAPITAL LETTER ER WITH COMBINING ACUTE ACCENT
-<Multi_key> <apostrophe> <Cyrillic_ER> : "Р́" # CYRILLIC CAPITAL LETTER ER WITH COMBINING ACUTE ACCENT
-
-<dead_macron> <Cyrillic_ER> : "Р̄" # CYRILLIC CAPITAL LETTER ER WITH COMBINING MACRON
-<Multi_key> <macron> <Cyrillic_ER> : "Р̄" # CYRILLIC CAPITAL LETTER ER WITH COMBINING MACRON
-<Multi_key> <underscore> <Cyrillic_ER> : "Р̄" # CYRILLIC CAPITAL LETTER ER WITH COMBINING MACRON
-
-<dead_circumflex> <Cyrillic_ER> : "Р̂" # CYRILLIC CAPITAL LETTER ER WITH COMBINING CIRCUMFLEX ACCENT
-<Multi_key> <asciicircum> <Cyrillic_ER> : "Р̂" # CYRILLIC CAPITAL LETTER ER WITH COMBINING CIRCUMFLEX ACCENT
-
-<Multi_key> <backslash> <o> <slash> : "🙌" # PERSON RAISING BOTH HANDS IN CELEBRATION
+XCOMM UTF-8 (Unicode) compose sequence
+XCOMM David.Monniaux@ens.fr
+XCOMM
+
+XCOMM Part 1 - Manual definitions
+
+XCOMM Spacing versions of dead accents
+<dead_tilde> <space> : "~" asciitilde # TILDE
+<dead_tilde> <dead_tilde> : "~" asciitilde # TILDE
+<dead_acute> <space> : "'" apostrophe # APOSTROPHE
+<dead_acute> <dead_acute> : "´" acute # ACUTE ACCENT
+<dead_grave> <space> : "`" grave # GRAVE ACCENT
+<dead_grave> <dead_grave> : "`" grave # GRAVE ACCENT
+<dead_circumflex> <space> : "^" asciicircum # CIRCUMFLEX ACCENT
+<dead_circumflex> <dead_circumflex> : "^" asciicircum # CIRCUMFLEX ACCENT
+<dead_abovering> <space> : "°" degree # DEGREE SIGN
+<dead_abovering> <dead_abovering> : "°" degree # DEGREE SIGN
+<dead_macron> <space> : "¯" macron # MACRON
+<dead_macron> <dead_macron> : "¯" macron # MACRON
+<dead_breve> <space> : "˘" breve # BREVE
+<dead_breve> <dead_breve> : "˘" breve # BREVE
+<dead_abovedot> <space> : "˙" abovedot # DOT ABOVE
+<dead_abovedot> <dead_abovedot> : "˙" abovedot # DOT ABOVE
+<dead_diaeresis> <dead_diaeresis> : "¨" diaeresis # DIAERESIS
+<dead_diaeresis> <space> : "\"" quotedbl # REVERSE SOLIDUS
+<dead_doubleacute> <space> : "˝" U2dd # DOUBLE ACUTE ACCENT
+<dead_doubleacute> <dead_doubleacute> : "˝" U2dd # DOUBLE ACUTE ACCENT
+<dead_caron> <space> : "ˇ" caron # CARON
+<dead_caron> <dead_caron> : "ˇ" caron # CARON
+<dead_cedilla> <space> : "¸" cedilla # CEDILLA
+<dead_cedilla> <dead_cedilla> : "¸" cedilla # CEDILLA
+<dead_ogonek> <space> : "˛" ogonek # OGONEK
+<dead_ogonek> <dead_ogonek> : "˛" ogonek # OGONEK
+<dead_iota> <space> : "ͺ" U37a # GREEK YPOGEGRAMMENI
+<dead_iota> <dead_iota> : "ͺ" U37a # GREEK YPOGEGRAMMENI
+
+
+XCOMM ASCII characters that may be difficult to access
+XCOMM on some keyboards.
+<Multi_key> <plus> <plus> : "#" numbersign # NUMBER SIGN
+<Multi_key> <apostrophe> <space> : "'" apostrophe # APOSTROPHE
+<Multi_key> <space> <apostrophe> : "'" apostrophe # APOSTROPHE
+<Multi_key> <A> <T> : "@" at # COMMERCIAL AT
+<Multi_key> <parenleft> <parenleft> : "[" bracketleft # LEFT SQUARE BRACKET
+<Multi_key> <slash> <slash> : "\\" backslash # REVERSE SOLIDUS
+<Multi_key> <slash> <less> : "\\" backslash # REVERSE SOLIDUS
+<Multi_key> <less> <slash> : "\\" backslash # REVERSE SOLIDUS
+<Multi_key> <parenright> <parenright> : "]" bracketright # RIGHT SQUARE BRACKET
+
+<Multi_key> <asciicircum> <space> : "^" asciicircum # CIRCUMFLEX ACCENT
+<Multi_key> <space> <asciicircum> : "^" asciicircum # CIRCUMFLEX ACCENT
+<Multi_key> <greater> <space> : "^" asciicircum # CIRCUMFLEX ACCENT
+<Multi_key> <space> <greater> : "^" asciicircum # CIRCUMFLEX ACCENT
+
+<Multi_key> <grave> <space> : "`" grave # GRAVE ACCENT
+<Multi_key> <space> <grave> : "`" grave # GRAVE ACCENT
+
+<Multi_key> <comma> <space> : "¸" cedilla # CEDILLA
+<Multi_key> <space> <comma> : "¸" cedilla # CEDILLA
+
+<Multi_key> <parenleft> <minus> : "{" braceleft # LEFT CURLY BRACKET
+<Multi_key> <minus> <parenleft> : "{" braceleft # LEFT CURLY BRACKET
+
+<Multi_key> <slash> <asciicircum> : "|" bar # VERTICAL LINE
+<Multi_key> <asciicircum> <slash> : "|" bar # VERTICAL LINE
+<Multi_key> <V> <L> : "|" bar # VERTICAL LINE
+<Multi_key> <L> <V> : "|" bar # VERTICAL LINE
+<Multi_key> <v> <l> : "|" bar # VERTICAL LINE
+<Multi_key> <l> <v> : "|" bar # VERTICAL LINE
+
+<Multi_key> <parenright> <minus> : "}" braceright # RIGHT CURLY BRACKET
+<Multi_key> <minus> <parenright> : "}" braceright # RIGHT CURLY BRACKET
+
+<Multi_key> <asciitilde> <space> : "~" asciitilde # TILDE
+<Multi_key> <space> <asciitilde> : "~" asciitilde # TILDE
+<Multi_key> <minus> <space> : "~" asciitilde # TILDE
+<Multi_key> <space> <minus> : "~" asciitilde # TILDE
+
+XCOMM Spaces
+<Multi_key> <space> <space> : " " nobreakspace # NO-BREAK SPACE
+<Multi_key> <space> <period> : " " U2008 # PUNCTUATION SPACE
+
+<Multi_key> <o> <c> : "©" copyright # COPYRIGHT SIGN
+<Multi_key> <o> <C> : "©" copyright # COPYRIGHT SIGN
+<Multi_key> <O> <c> : "©" copyright # COPYRIGHT SIGN
+<Multi_key> <O> <C> : "©" copyright # COPYRIGHT SIGN
+
+<Multi_key> <o> <r> : "®" registered # REGISTERED SIGN
+<Multi_key> <o> <R> : "®" registered # REGISTERED SIGN
+<Multi_key> <O> <r> : "®" registered # REGISTERED SIGN
+<Multi_key> <O> <R> : "®" registered # REGISTERED SIGN
+
+<Multi_key> <period> <greater> : "›" U203a # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+<Multi_key> <period> <less> : "‹" U2039 # SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+<Multi_key> <period> <period> : "…" ellipsis # HORIZONTAL ELLIPSIS
+<Multi_key> <period> <minus> : "·" periodcentered # MIDDLE DOT
+<Multi_key> <period> <equal> : "•" enfilledcircbullet # BULLET
+<Multi_key> <exclam> <asciicircum> : "¦" brokenbar # BROKEN BAR
+<Multi_key> <exclam> <exclam> : "¡" exclamdown # INVERTED EXCLAMATION MARK
+<Multi_key> <p> <exclam> : "¶" paragraph # PILCROW SIGN
+<Multi_key> <P> <exclam> : "¶" paragraph # PILCROW SIGN
+<Multi_key> <plus> <minus> : "±" plusminus # PLUS-MINUS SIGN
+<Multi_key> <question> <question> : "¿" questiondown # INVERTED QUESTION MARK
+<Multi_key> <minus> <d> : "đ" dstroke # LATIN SMALL LETTER D WITH STROKE
+<Multi_key> <minus> <D> : "Đ" Dstroke # LATIN CAPITAL LETTER D WITH STROKE
+<Multi_key> <s> <s> : "ß" ssharp # LATIN SMALL LETTER SHARP S
+<Multi_key> <S> <S> : "ẞ" Ssharp # LATIN CAPITAL LETTER SHARP S
+
+<Multi_key> <o> <e> : "œ" oe # LATIN SMALL LIGATURE OE
+<Multi_key> <O> <E> : "Œ" OE # LATIN CAPITAL LIGATURE OE
+<Multi_key> <a> <e> : "æ" ae # LATIN SMALL LETTER AE
+<Multi_key> <A> <E> : "Æ" AE # LATIN CAPITAL LETTER AE
+
+<Multi_key> <o> <o> : "°" degree # DEGREE SIGN
+
+XCOMM Quotation marks
+<Multi_key> <quotedbl> <backslash> : "〝" U301d # REVERSED DOUBLE PRIME QUOTATION MARK
+<Multi_key> <quotedbl> <slash> : "〞" U301e # DOUBLE PRIME QUOTATION MARK
+<Multi_key> <less> <less> : "«" guillemotleft # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
+<Multi_key> <greater> <greater> : "»" guillemotright # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
+<Multi_key> <less> <apostrophe> : "‘" U2018 # LEFT SINGLE QUOTATION MARK
+<Multi_key> <apostrophe> <less> : "‘" U2018 # LEFT SINGLE QUOTATION MARK
+<Multi_key> <greater> <apostrophe> : "’" U2019 # RIGHT SINGLE QUOTATION MARK
+<Multi_key> <apostrophe> <greater> : "’" U2019 # RIGHT SINGLE QUOTATION MARK
+<Multi_key> <comma> <apostrophe> : "‚" U201a # SINGLE LOW-9 QUOTATION MARK
+<Multi_key> <apostrophe> <comma> : "‚" U201a # SINGLE LOW-9 QUOTATION MARK
+<Multi_key> <less> <quotedbl> : "“" U201c # LEFT DOUBLE QUOTATION MARK
+<Multi_key> <quotedbl> <less> : "“" U201c # LEFT DOUBLE QUOTATION MARK
+<Multi_key> <greater> <quotedbl> : "”" U201d # RIGHT DOUBLE QUOTATION MARK
+<Multi_key> <quotedbl> <greater> : "”" U201d # RIGHT DOUBLE QUOTATION MARK
+<Multi_key> <comma> <quotedbl> : "„" U201e # DOUBLE LOW-9 QUOTATION MARK
+<Multi_key> <quotedbl> <comma> : "„" U201e # DOUBLE LOW-9 QUOTATION MARK
+
+XCOMM Per xxx
+<Multi_key> <percent> <o> : "‰" U2030 # PER MILLE SIGN
+
+XCOMM Currencies
+<Multi_key> <C> <E> : "₠" U20a0 # EURO-CURRENCY SIGN
+<Multi_key> <C> <slash> : "₡" U20a1 # COLON SIGN
+<Multi_key> <slash> <C> : "₡" U20a1 # COLON SIGN
+<Multi_key> <C> <r> : "₢" U20a2 # CRUZEIRO SIGN
+<Multi_key> <F> <r> : "₣" U20a3 # FRENCH FRANC SIGN
+<Multi_key> <L> <equal> : "₤" U20a4 # LIRA SIGN
+<Multi_key> <equal> <L> : "₤" U20a4 # LIRA SIGN
+<Multi_key> <m> <slash> : "₥" U20a5 # MILL SIGN
+<Multi_key> <slash> <m> : "₥" U20a5 # MILL SIGN
+<Multi_key> <N> <equal> : "₦" U20a6 # NAIRA SIGN
+<Multi_key> <equal> <N> : "₦" U20a6 # NAIRA SIGN
+<Multi_key> <P> <t> : "₧" U20a7 # PESETA SIGN
+<Multi_key> <R> <s> : "₨" U20a8 # RUPEE SIGN
+<Multi_key> <W> <equal> : "₩" U20a9 # WON SIGN
+<Multi_key> <equal> <W> : "₩" U20a9 # WON SIGN
+XCOMM "₪" U20aa NEW SHEQEL SIGN
+<Multi_key> <d> <minus> : "₫" U20ab # DONG SIGN
+<Multi_key> <C> <equal> : "€" EuroSign # EURO SIGN
+<Multi_key> <equal> <C> : "€" EuroSign # EURO SIGN
+<Multi_key> <c> <equal> : "€" EuroSign # EURO SIGN
+<Multi_key> <equal> <c> : "€" EuroSign # EURO SIGN
+<Multi_key> <E> <equal> : "€" EuroSign # EURO SIGN
+<Multi_key> <equal> <E> : "€" EuroSign # EURO SIGN
+<Multi_key> <e> <equal> : "€" EuroSign # EURO SIGN
+<Multi_key> <equal> <e> : "€" EuroSign # EURO SIGN
+<Multi_key> <Cyrillic_ES> <equal> : "€" EuroSign # EURO SIGN
+<Multi_key> <equal> <Cyrillic_ES> : "€" EuroSign # EURO SIGN
+<Multi_key> <Cyrillic_IE> <equal> : "€" EuroSign # EURO SIGN
+<Multi_key> <equal> <Cyrillic_IE> : "€" EuroSign # EURO SIGN
+XCOMM "₭" U20ad KIP SIGN
+XCOMM "₮" U20ae TUGRIK SIGN
+XCOMM "₯" U20af DRACHMA SIGN
+XCOMM "₰" U20b0 GERMAN PENNY SIGN
+XCOMM "₱" U20b1 PESO SIGN
+XCOMM "₲" U20b2 GUARANI SIGN
+XCOMM "₳" U20b3 AUSTRAL SIGN
+XCOMM "₴" U20b4 HRYVNIA SIGN
+XCOMM "₵" U20b5 CEDI SIGN
+
+
+<Multi_key> <bar> <c> : "¢" cent # CENT SIGN
+<Multi_key> <c> <bar> : "¢" cent # CENT SIGN
+<Multi_key> <c> <slash> : "¢" cent # CENT SIGN
+<Multi_key> <slash> <c> : "¢" cent # CENT SIGN
+<Multi_key> <L> <minus> : "£" sterling # POUND SIGN
+<Multi_key> <minus> <L> : "£" sterling # POUND SIGN
+<Multi_key> <Y> <equal> : "¥" yen # YEN SIGN
+<Multi_key> <equal> <Y> : "¥" yen # YEN SIGN
+
+XCOMM Long S
+<Multi_key> <f> <s> : "ſ" U017f # LATIN SMALL LETTER LONG S
+<Multi_key> <f> <S> : "ſ" U017f # LATIN SMALL LETTER LONG S
+
+XCOMM Dashes
+<Multi_key> <minus> <minus> <period> : "–" U2013 # EN DASH
+<Multi_key> <minus> <minus> <minus> : "—" U2014 # EM DASH
+
+XCOMM Musical alterations
+<Multi_key> <numbersign> <b> : "♭" U266d # MUSIC FLAT SIGN
+<Multi_key> <numbersign> <f> : "♮" U266e # MUSIC NATURAL SIGN
+<Multi_key> <numbersign> <numbersign> : "♯" U266f # MUSIC SHARP SIGN
+
+XCOMM Other symbols
+<Multi_key> <s> <o> : "§" section # SECTION SIGN
+<Multi_key> <o> <s> : "§" section # SECTION SIGN
+<Multi_key> <Cyrillic_pe> <Cyrillic_a> : "§" section # SECTION SIGN
+
+<Multi_key> <o> <x> : "¤" currency # CURRENCY SIGN
+<Multi_key> <x> <o> : "¤" currency # CURRENCY SIGN
+
+<Multi_key> <P> <P> : "¶" paragraph # PILCROW SIGN
+
+<Multi_key> <N> <o> : "№" numerosign # NUMERO SIGN
+<Multi_key> <N> <O> : "№" numerosign # NUMERO SIGN
+<Multi_key> <Cyrillic_EN> <Cyrillic_o> : "№" numerosign # NUMERO SIGN
+<Multi_key> <Cyrillic_EN> <Cyrillic_O> : "№" numerosign # NUMERO SIGN
+
+<Multi_key> <question> <exclam> : "⸘" U2E18 # INVERTED INTERROBANG
+<Multi_key> <exclam> <question> : "‽" U203D # INTERROBANG
+
+<Multi_key> <C> <C> <C> <P> : "☭" U262D # HAMMER AND SICKLE
+<Multi_key> <O> <A> : "Ⓐ" U24B6 # CIRCLED LATIN CAPITAL LETTER A
+<Multi_key> <less> <3> : "♥" U2665 # BLACK HEART SUIT
+
+<Multi_key> <colon> <parenright> : "☺" U263A # WHITE SMILING FACE
+<Multi_key> <colon> <parenleft> : "☹" U2639 # WHITE FROWNING FACE
+
+XCOMM Part 2
+
+XCOMM Compose map for Korean Hangul(Choseongul) Conjoining Jamos automatically
+XCOMM generated from UnicodeData-2.0.14.txt at
+XCOMM ftp://ftp.unicode.org/Public/2.0-Update/UnicodeData-2.0.14.txt
+XCOMM by Jungshik Shin <jshin@jshin.net> 2002-10-17
+XCOMM There are some conflicts among sequences, but I left them alone.
+XCOMM
+XCOMM group 1: cluster jamos made of three basic jamos
+
+/* The follwing block gets overridden by later shorter compositions
+ * <Multi_key> <U1107> <U1109> <U1100> : "ᄢ" U1122 # HANGUL CHOSEONG PIEUP-SIOS-KIYEOK
+ * <Multi_key> <U1107> <U1109> <U1103> : "ᄣ" U1123 # HANGUL CHOSEONG PIEUP-SIOS-TIKEUT
+ * <Multi_key> <U1107> <U1109> <U1107> : "ᄤ" U1124 # HANGUL CHOSEONG PIEUP-SIOS-PIEUP
+ * <Multi_key> <U1107> <U1109> <U1109> : "ᄥ" U1125 # HANGUL CHOSEONG PIEUP-SSANGSIOS
+ * <Multi_key> <U1107> <U1109> <U110C> : "ᄦ" U1126 # HANGUL CHOSEONG PIEUP-SIOS-CIEUC
+ * <Multi_key> <U1107> <U1107> <U110B> : "ᄬ" U112c # HANGUL CHOSEONG KAPYEOUNSSANGPIEUP
+ * <Multi_key> <U1109> <U1107> <U1100> : "ᄳ" U1133 # HANGUL CHOSEONG SIOS-PIEUP-KIYEOK
+ * <Multi_key> <U1109> <U1109> <U1109> : "ᄴ" U1134 # HANGUL CHOSEONG SIOS-SSANGSIOS
+ * <Multi_key> <U1169> <U1161> <U1175> : "ᅫ" U116b # HANGUL JUNGSEONG WAE
+ * <Multi_key> <U116E> <U1165> <U1175> : "ᅰ" U1170 # HANGUL JUNGSEONG WE
+ * <Multi_key> <U116E> <U1165> <U1173> : "ᆋ" U118b # HANGUL JUNGSEONG U-EO-EU
+ * <Multi_key> <U11A8> <U11BA> <U11A8> : "ᇄ" U11c4 # HANGUL JONGSEONG KIYEOK-SIOS-KIYEOK
+ * <Multi_key> <U11AF> <U11A8> <U11BA> : "ᇌ" U11cc # HANGUL JONGSEONG RIEUL-KIYEOK-SIOS
+ * <Multi_key> <U11AF> <U11AE> <U11C2> : "ᇏ" U11cf # HANGUL JONGSEONG RIEUL-TIKEUT-HIEUH
+ * <Multi_key> <U11AF> <U11B7> <U11A8> : "ᇑ" U11d1 # HANGUL JONGSEONG RIEUL-MIEUM-KIYEOK
+ * <Multi_key> <U11AF> <U11B7> <U11BA> : "ᇒ" U11d2 # HANGUL JONGSEONG RIEUL-MIEUM-SIOS
+ * <Multi_key> <U11AF> <U11B8> <U11BA> : "ᇓ" U11d3 # HANGUL JONGSEONG RIEUL-PIEUP-SIOS
+ * <Multi_key> <U11AF> <U11B8> <U11C2> : "ᇔ" U11d4 # HANGUL JONGSEONG RIEUL-PIEUP-HIEUH
+ * <Multi_key> <U11AF> <U11B8> <U11BC> : "ᇕ" U11d5 # HANGUL JONGSEONG RIEUL-KAPYEOUNPIEUP
+ * <Multi_key> <U11AF> <U11BA> <U11BA> : "ᇖ" U11d6 # HANGUL JONGSEONG RIEUL-SSANGSIOS
+ * <Multi_key> <U11B7> <U11BA> <U11BA> : "ᇞ" U11de # HANGUL JONGSEONG MIEUM-SSANGSIOS
+ * <Multi_key> <U11BC> <U11A8> <U11A8> : "ᇭ" U11ed # HANGUL JONGSEONG IEUNG-SSANGKIYEOK
+ */
+<Multi_key> <U1100> <U1100> : "ᄁ" U1101 # HANGUL CHOSEONG SSANGKIYEOK
+<Multi_key> <U1103> <U1103> : "ᄄ" U1104 # HANGUL CHOSEONG SSANGTIKEUT
+<Multi_key> <U1107> <U1107> : "ᄈ" U1108 # HANGUL CHOSEONG SSANGPIEUP
+<Multi_key> <U1109> <U1109> : "ᄊ" U110a # HANGUL CHOSEONG SSANGSIOS
+<Multi_key> <U110C> <U110C> : "ᄍ" U110d # HANGUL CHOSEONG SSANGCIEUC
+<Multi_key> <U1102> <U1100> : "ᄓ" U1113 # HANGUL CHOSEONG NIEUN-KIYEOK
+<Multi_key> <U1102> <U1102> : "ᄔ" U1114 # HANGUL CHOSEONG SSANGNIEUN
+<Multi_key> <U1102> <U1103> : "ᄕ" U1115 # HANGUL CHOSEONG NIEUN-TIKEUT
+<Multi_key> <U1102> <U1107> : "ᄖ" U1116 # HANGUL CHOSEONG NIEUN-PIEUP
+<Multi_key> <U1103> <U1100> : "ᄗ" U1117 # HANGUL CHOSEONG TIKEUT-KIYEOK
+<Multi_key> <U1105> <U1102> : "ᄘ" U1118 # HANGUL CHOSEONG RIEUL-NIEUN
+<Multi_key> <U1105> <U1105> : "ᄙ" U1119 # HANGUL CHOSEONG SSANGRIEUL
+<Multi_key> <U1105> <U1112> : "ᄚ" U111a # HANGUL CHOSEONG RIEUL-HIEUH
+<Multi_key> <U1105> <U110B> : "ᄛ" U111b # HANGUL CHOSEONG KAPYEOUNRIEUL
+<Multi_key> <U1106> <U1107> : "ᄜ" U111c # HANGUL CHOSEONG MIEUM-PIEUP
+<Multi_key> <U1106> <U110B> : "ᄝ" U111d # HANGUL CHOSEONG KAPYEOUNMIEUM
+<Multi_key> <U1107> <U1100> : "ᄞ" U111e # HANGUL CHOSEONG PIEUP-KIYEOK
+<Multi_key> <U1107> <U1102> : "ᄟ" U111f # HANGUL CHOSEONG PIEUP-NIEUN
+<Multi_key> <U1107> <U1103> : "ᄠ" U1120 # HANGUL CHOSEONG PIEUP-TIKEUT
+<Multi_key> <U1107> <U1109> : "ᄡ" U1121 # HANGUL CHOSEONG PIEUP-SIOS
+<Multi_key> <U1107> <U110C> : "ᄧ" U1127 # HANGUL CHOSEONG PIEUP-CIEUC
+<Multi_key> <U1107> <U110E> : "ᄨ" U1128 # HANGUL CHOSEONG PIEUP-CHIEUCH
+<Multi_key> <U1107> <U1110> : "ᄩ" U1129 # HANGUL CHOSEONG PIEUP-THIEUTH
+<Multi_key> <U1107> <U1111> : "ᄪ" U112a # HANGUL CHOSEONG PIEUP-PHIEUPH
+<Multi_key> <U1107> <U110B> : "ᄫ" U112b # HANGUL CHOSEONG KAPYEOUNPIEUP
+<Multi_key> <U1109> <U1100> : "ᄭ" U112d # HANGUL CHOSEONG SIOS-KIYEOK
+<Multi_key> <U1109> <U1102> : "ᄮ" U112e # HANGUL CHOSEONG SIOS-NIEUN
+<Multi_key> <U1109> <U1103> : "ᄯ" U112f # HANGUL CHOSEONG SIOS-TIKEUT
+<Multi_key> <U1109> <U1105> : "ᄰ" U1130 # HANGUL CHOSEONG SIOS-RIEUL
+<Multi_key> <U1109> <U1106> : "ᄱ" U1131 # HANGUL CHOSEONG SIOS-MIEUM
+<Multi_key> <U1109> <U1107> : "ᄲ" U1132 # HANGUL CHOSEONG SIOS-PIEUP
+<Multi_key> <U1109> <U110B> : "ᄵ" U1135 # HANGUL CHOSEONG SIOS-IEUNG
+<Multi_key> <U1109> <U110C> : "ᄶ" U1136 # HANGUL CHOSEONG SIOS-CIEUC
+<Multi_key> <U1109> <U110E> : "ᄷ" U1137 # HANGUL CHOSEONG SIOS-CHIEUCH
+<Multi_key> <U1109> <U110F> : "ᄸ" U1138 # HANGUL CHOSEONG SIOS-KHIEUKH
+<Multi_key> <U1109> <U1110> : "ᄹ" U1139 # HANGUL CHOSEONG SIOS-THIEUTH
+<Multi_key> <U1109> <U1111> : "ᄺ" U113a # HANGUL CHOSEONG SIOS-PHIEUPH
+<Multi_key> <U1109> <U1112> : "ᄻ" U113b # HANGUL CHOSEONG SIOS-HIEUH
+<Multi_key> <U113C> <U113C> : "ᄽ" U113d # HANGUL CHOSEONG CHITUEUMSSANGSIOS
+<Multi_key> <U113E> <U113E> : "ᄿ" U113f # HANGUL CHOSEONG CEONGCHIEUMSSANGSIOS
+<Multi_key> <U110B> <U1100> : "ᅁ" U1141 # HANGUL CHOSEONG IEUNG-KIYEOK
+<Multi_key> <U110B> <U1103> : "ᅂ" U1142 # HANGUL CHOSEONG IEUNG-TIKEUT
+<Multi_key> <U110B> <U1106> : "ᅃ" U1143 # HANGUL CHOSEONG IEUNG-MIEUM
+<Multi_key> <U110B> <U1107> : "ᅄ" U1144 # HANGUL CHOSEONG IEUNG-PIEUP
+<Multi_key> <U110B> <U1109> : "ᅅ" U1145 # HANGUL CHOSEONG IEUNG-SIOS
+<Multi_key> <U110B> <U1140> : "ᅆ" U1146 # HANGUL CHOSEONG IEUNG-PANSIOS
+<Multi_key> <U110B> <U110B> : "ᅇ" U1147 # HANGUL CHOSEONG SSANGIEUNG
+<Multi_key> <U110B> <U110C> : "ᅈ" U1148 # HANGUL CHOSEONG IEUNG-CIEUC
+<Multi_key> <U110B> <U110E> : "ᅉ" U1149 # HANGUL CHOSEONG IEUNG-CHIEUCH
+<Multi_key> <U110B> <U1110> : "ᅊ" U114a # HANGUL CHOSEONG IEUNG-THIEUTH
+<Multi_key> <U110B> <U1111> : "ᅋ" U114b # HANGUL CHOSEONG IEUNG-PHIEUPH
+<Multi_key> <U110C> <U110B> : "ᅍ" U114d # HANGUL CHOSEONG CIEUC-IEUNG
+<Multi_key> <U114E> <U114E> : "ᅏ" U114f # HANGUL CHOSEONG CHITUEUMSSANGCIEUC
+<Multi_key> <U1150> <U1150> : "ᅑ" U1151 # HANGUL CHOSEONG CEONGCHIEUMSSANGCIEUC
+<Multi_key> <U110E> <U110F> : "ᅒ" U1152 # HANGUL CHOSEONG CHIEUCH-KHIEUKH
+<Multi_key> <U110E> <U1112> : "ᅓ" U1153 # HANGUL CHOSEONG CHIEUCH-HIEUH
+<Multi_key> <U1111> <U1107> : "ᅖ" U1156 # HANGUL CHOSEONG PHIEUPH-PIEUP
+<Multi_key> <U1111> <U110B> : "ᅗ" U1157 # HANGUL CHOSEONG KAPYEOUNPHIEUPH
+<Multi_key> <U1112> <U1112> : "ᅘ" U1158 # HANGUL CHOSEONG SSANGHIEUH
+<Multi_key> <U1161> <U1175> : "ᅢ" U1162 # HANGUL JUNGSEONG AE
+<Multi_key> <U1163> <U1175> : "ᅤ" U1164 # HANGUL JUNGSEONG YAE
+<Multi_key> <U1165> <U1175> : "ᅦ" U1166 # HANGUL JUNGSEONG E
+<Multi_key> <U1167> <U1175> : "ᅨ" U1168 # HANGUL JUNGSEONG YE
+<Multi_key> <U1169> <U1161> : "ᅪ" U116a # HANGUL JUNGSEONG WA
+<Multi_key> <U1169> <U1175> : "ᅬ" U116c # HANGUL JUNGSEONG OE
+<Multi_key> <U116E> <U1165> : "ᅯ" U116f # HANGUL JUNGSEONG WEO
+<Multi_key> <U116E> <U1175> : "ᅱ" U1171 # HANGUL JUNGSEONG WI
+<Multi_key> <U1173> <U1175> : "ᅴ" U1174 # HANGUL JUNGSEONG YI
+<Multi_key> <U1161> <U1169> : "ᅶ" U1176 # HANGUL JUNGSEONG A-O
+<Multi_key> <U1161> <U116E> : "ᅷ" U1177 # HANGUL JUNGSEONG A-U
+<Multi_key> <U1163> <U1169> : "ᅸ" U1178 # HANGUL JUNGSEONG YA-O
+<Multi_key> <U1163> <U116D> : "ᅹ" U1179 # HANGUL JUNGSEONG YA-YO
+<Multi_key> <U1165> <U1169> : "ᅺ" U117a # HANGUL JUNGSEONG EO-O
+<Multi_key> <U1165> <U116E> : "ᅻ" U117b # HANGUL JUNGSEONG EO-U
+<Multi_key> <U1165> <U1173> : "ᅼ" U117c # HANGUL JUNGSEONG EO-EU
+<Multi_key> <U1167> <U1169> : "ᅽ" U117d # HANGUL JUNGSEONG YEO-O
+<Multi_key> <U1167> <U116E> : "ᅾ" U117e # HANGUL JUNGSEONG YEO-U
+<Multi_key> <U1169> <U1165> : "ᅿ" U117f # HANGUL JUNGSEONG O-EO
+<Multi_key> <U1169> <U1166> : "ᆀ" U1180 # HANGUL JUNGSEONG O-E
+<Multi_key> <U1169> <U1168> : "ᆁ" U1181 # HANGUL JUNGSEONG O-YE
+<Multi_key> <U1169> <U1169> : "ᆂ" U1182 # HANGUL JUNGSEONG O-O
+<Multi_key> <U1169> <U116E> : "ᆃ" U1183 # HANGUL JUNGSEONG O-U
+<Multi_key> <U116D> <U1163> : "ᆄ" U1184 # HANGUL JUNGSEONG YO-YA
+<Multi_key> <U116D> <U1164> : "ᆅ" U1185 # HANGUL JUNGSEONG YO-YAE
+<Multi_key> <U116D> <U1167> : "ᆆ" U1186 # HANGUL JUNGSEONG YO-YEO
+<Multi_key> <U116D> <U1169> : "ᆇ" U1187 # HANGUL JUNGSEONG YO-O
+<Multi_key> <U116D> <U1175> : "ᆈ" U1188 # HANGUL JUNGSEONG YO-I
+<Multi_key> <U116E> <U1161> : "ᆉ" U1189 # HANGUL JUNGSEONG U-A
+<Multi_key> <U116E> <U1162> : "ᆊ" U118a # HANGUL JUNGSEONG U-AE
+<Multi_key> <U116E> <U1168> : "ᆌ" U118c # HANGUL JUNGSEONG U-YE
+<Multi_key> <U116E> <U116E> : "ᆍ" U118d # HANGUL JUNGSEONG U-U
+<Multi_key> <U1172> <U1161> : "ᆎ" U118e # HANGUL JUNGSEONG YU-A
+<Multi_key> <U1172> <U1165> : "ᆏ" U118f # HANGUL JUNGSEONG YU-EO
+<Multi_key> <U1172> <U1166> : "ᆐ" U1190 # HANGUL JUNGSEONG YU-E
+<Multi_key> <U1172> <U1167> : "ᆑ" U1191 # HANGUL JUNGSEONG YU-YEO
+<Multi_key> <U1172> <U1168> : "ᆒ" U1192 # HANGUL JUNGSEONG YU-YE
+<Multi_key> <U1172> <U116E> : "ᆓ" U1193 # HANGUL JUNGSEONG YU-U
+<Multi_key> <U1172> <U1175> : "ᆔ" U1194 # HANGUL JUNGSEONG YU-I
+<Multi_key> <U1173> <U116E> : "ᆕ" U1195 # HANGUL JUNGSEONG EU-U
+<Multi_key> <U1173> <U1173> : "ᆖ" U1196 # HANGUL JUNGSEONG EU-EU
+<Multi_key> <U1174> <U116E> : "ᆗ" U1197 # HANGUL JUNGSEONG YI-U
+<Multi_key> <U1175> <U1161> : "ᆘ" U1198 # HANGUL JUNGSEONG I-A
+<Multi_key> <U1175> <U1163> : "ᆙ" U1199 # HANGUL JUNGSEONG I-YA
+<Multi_key> <U1175> <U1169> : "ᆚ" U119a # HANGUL JUNGSEONG I-O
+<Multi_key> <U1175> <U116E> : "ᆛ" U119b # HANGUL JUNGSEONG I-U
+<Multi_key> <U1175> <U1173> : "ᆜ" U119c # HANGUL JUNGSEONG I-EU
+<Multi_key> <U1175> <U119E> : "ᆝ" U119d # HANGUL JUNGSEONG I-ARAEA
+<Multi_key> <U119E> <U1165> : "ᆟ" U119f # HANGUL JUNGSEONG ARAEA-EO
+<Multi_key> <U119E> <U116E> : "ᆠ" U11a0 # HANGUL JUNGSEONG ARAEA-U
+<Multi_key> <U119E> <U1175> : "ᆡ" U11a1 # HANGUL JUNGSEONG ARAEA-I
+<Multi_key> <U119E> <U119E> : "ᆢ" U11a2 # HANGUL JUNGSEONG SSANGARAEA
+<Multi_key> <U11A8> <U11A8> : "ᆩ" U11a9 # HANGUL JONGSEONG SSANGKIYEOK
+<Multi_key> <U11A8> <U11BA> : "ᆪ" U11aa # HANGUL JONGSEONG KIYEOK-SIOS
+<Multi_key> <U11AB> <U11BD> : "ᆬ" U11ac # HANGUL JONGSEONG NIEUN-CIEUC
+<Multi_key> <U11AB> <U11C2> : "ᆭ" U11ad # HANGUL JONGSEONG NIEUN-HIEUH
+<Multi_key> <U11AF> <U11A8> : "ᆰ" U11b0 # HANGUL JONGSEONG RIEUL-KIYEOK
+<Multi_key> <U11AF> <U11B7> : "ᆱ" U11b1 # HANGUL JONGSEONG RIEUL-MIEUM
+<Multi_key> <U11AF> <U11B8> : "ᆲ" U11b2 # HANGUL JONGSEONG RIEUL-PIEUP
+<Multi_key> <U11AF> <U11BA> : "ᆳ" U11b3 # HANGUL JONGSEONG RIEUL-SIOS
+<Multi_key> <U11AF> <U11C0> : "ᆴ" U11b4 # HANGUL JONGSEONG RIEUL-THIEUTH
+<Multi_key> <U11AF> <U11C1> : "ᆵ" U11b5 # HANGUL JONGSEONG RIEUL-PHIEUPH
+<Multi_key> <U11AF> <U11C2> : "ᆶ" U11b6 # HANGUL JONGSEONG RIEUL-HIEUH
+<Multi_key> <U11B8> <U11BA> : "ᆹ" U11b9 # HANGUL JONGSEONG PIEUP-SIOS
+<Multi_key> <U11BA> <U11BA> : "ᆻ" U11bb # HANGUL JONGSEONG SSANGSIOS
+<Multi_key> <U11A8> <U11AF> : "ᇃ" U11c3 # HANGUL JONGSEONG KIYEOK-RIEUL
+<Multi_key> <U11AB> <U11A8> : "ᇅ" U11c5 # HANGUL JONGSEONG NIEUN-KIYEOK
+<Multi_key> <U11AB> <U11AE> : "ᇆ" U11c6 # HANGUL JONGSEONG NIEUN-TIKEUT
+<Multi_key> <U11AB> <U11BA> : "ᇇ" U11c7 # HANGUL JONGSEONG NIEUN-SIOS
+<Multi_key> <U11AB> <U11EB> : "ᇈ" U11c8 # HANGUL JONGSEONG NIEUN-PANSIOS
+<Multi_key> <U11AB> <U11C0> : "ᇉ" U11c9 # HANGUL JONGSEONG NIEUN-THIEUTH
+<Multi_key> <U11AE> <U11A8> : "ᇊ" U11ca # HANGUL JONGSEONG TIKEUT-KIYEOK
+<Multi_key> <U11AE> <U11AF> : "ᇋ" U11cb # HANGUL JONGSEONG TIKEUT-RIEUL
+<Multi_key> <U11AF> <U11AB> : "ᇍ" U11cd # HANGUL JONGSEONG RIEUL-NIEUN
+<Multi_key> <U11AF> <U11AE> : "ᇎ" U11ce # HANGUL JONGSEONG RIEUL-TIKEUT
+<Multi_key> <U11AF> <U11AF> : "ᇐ" U11d0 # HANGUL JONGSEONG SSANGRIEUL
+<Multi_key> <U11AF> <U11EB> : "ᇗ" U11d7 # HANGUL JONGSEONG RIEUL-PANSIOS
+<Multi_key> <U11AF> <U11BF> : "ᇘ" U11d8 # HANGUL JONGSEONG RIEUL-KHIEUKH
+<Multi_key> <U11AF> <U11F9> : "ᇙ" U11d9 # HANGUL JONGSEONG RIEUL-YEORINHIEUH
+<Multi_key> <U11B7> <U11A8> : "ᇚ" U11da # HANGUL JONGSEONG MIEUM-KIYEOK
+<Multi_key> <U11B7> <U11AF> : "ᇛ" U11db # HANGUL JONGSEONG MIEUM-RIEUL
+<Multi_key> <U11B7> <U11B8> : "ᇜ" U11dc # HANGUL JONGSEONG MIEUM-PIEUP
+<Multi_key> <U11B7> <U11BA> : "ᇝ" U11dd # HANGUL JONGSEONG MIEUM-SIOS
+<Multi_key> <U11B7> <U11EB> : "ᇟ" U11df # HANGUL JONGSEONG MIEUM-PANSIOS
+<Multi_key> <U11B7> <U11BE> : "ᇠ" U11e0 # HANGUL JONGSEONG MIEUM-CHIEUCH
+<Multi_key> <U11B7> <U11C2> : "ᇡ" U11e1 # HANGUL JONGSEONG MIEUM-HIEUH
+<Multi_key> <U11B7> <U11BC> : "ᇢ" U11e2 # HANGUL JONGSEONG KAPYEOUNMIEUM
+<Multi_key> <U11B8> <U11AF> : "ᇣ" U11e3 # HANGUL JONGSEONG PIEUP-RIEUL
+<Multi_key> <U11B8> <U11C1> : "ᇤ" U11e4 # HANGUL JONGSEONG PIEUP-PHIEUPH
+<Multi_key> <U11B8> <U11C2> : "ᇥ" U11e5 # HANGUL JONGSEONG PIEUP-HIEUH
+<Multi_key> <U11B8> <U11BC> : "ᇦ" U11e6 # HANGUL JONGSEONG KAPYEOUNPIEUP
+<Multi_key> <U11BA> <U11A8> : "ᇧ" U11e7 # HANGUL JONGSEONG SIOS-KIYEOK
+<Multi_key> <U11BA> <U11AE> : "ᇨ" U11e8 # HANGUL JONGSEONG SIOS-TIKEUT
+<Multi_key> <U11BA> <U11AF> : "ᇩ" U11e9 # HANGUL JONGSEONG SIOS-RIEUL
+<Multi_key> <U11BA> <U11B8> : "ᇪ" U11ea # HANGUL JONGSEONG SIOS-PIEUP
+<Multi_key> <U11BC> <U11A8> : "ᇬ" U11ec # HANGUL JONGSEONG IEUNG-KIYEOK
+<Multi_key> <U11BC> <U11BC> : "ᇮ" U11ee # HANGUL JONGSEONG SSANGIEUNG
+<Multi_key> <U11BC> <U11BF> : "ᇯ" U11ef # HANGUL JONGSEONG IEUNG-KHIEUKH
+<Multi_key> <U11F0> <U11BA> : "ᇱ" U11f1 # HANGUL JONGSEONG YESIEUNG-SIOS
+<Multi_key> <U11F0> <U11EB> : "ᇲ" U11f2 # HANGUL JONGSEONG YESIEUNG-PANSIOS
+<Multi_key> <U11C1> <U11B8> : "ᇳ" U11f3 # HANGUL JONGSEONG PHIEUPH-PIEUP
+<Multi_key> <U11C1> <U11BC> : "ᇴ" U11f4 # HANGUL JONGSEONG KAPYEOUNPHIEUPH
+<Multi_key> <U11C2> <U11AB> : "ᇵ" U11f5 # HANGUL JONGSEONG HIEUH-NIEUN
+<Multi_key> <U11C2> <U11AF> : "ᇶ" U11f6 # HANGUL JONGSEONG HIEUH-RIEUL
+<Multi_key> <U11C2> <U11B7> : "ᇷ" U11f7 # HANGUL JONGSEONG HIEUH-MIEUM
+<Multi_key> <U11C2> <U11B8> : "ᇸ" U11f8 # HANGUL JONGSEONG HIEUH-PIEUP
+<Multi_key> <U1121> <U1100> : "ᄢ" U1122 # HANGUL CHOSEONG PIEUP-SIOS-KIYEOK
+<Multi_key> <U1121> <U1103> : "ᄣ" U1123 # HANGUL CHOSEONG PIEUP-SIOS-TIKEUT
+<Multi_key> <U1121> <U1107> : "ᄤ" U1124 # HANGUL CHOSEONG PIEUP-SIOS-PIEUP
+<Multi_key> <U1121> <U1109> : "ᄥ" U1125 # HANGUL CHOSEONG PIEUP-SSANGSIOS
+<Multi_key> <U1121> <U110C> : "ᄦ" U1126 # HANGUL CHOSEONG PIEUP-SIOS-CIEUC
+<Multi_key> <U1108> <U110B> : "ᄬ" U112c # HANGUL CHOSEONG KAPYEOUNSSANGPIEUP
+<Multi_key> <U1132> <U1100> : "ᄳ" U1133 # HANGUL CHOSEONG SIOS-PIEUP-KIYEOK
+<Multi_key> <U110A> <U1109> : "ᄴ" U1134 # HANGUL CHOSEONG SIOS-SSANGSIOS
+<Multi_key> <U116A> <U1175> : "ᅫ" U116b # HANGUL JUNGSEONG WAE
+<Multi_key> <U116F> <U1175> : "ᅰ" U1170 # HANGUL JUNGSEONG WE
+<Multi_key> <U116F> <U1173> : "ᆋ" U118b # HANGUL JUNGSEONG U-EO-EU
+<Multi_key> <U11AA> <U11A8> : "ᇄ" U11c4 # HANGUL JONGSEONG KIYEOK-SIOS-KIYEOK
+<Multi_key> <U11B0> <U11BA> : "ᇌ" U11cc # HANGUL JONGSEONG RIEUL-KIYEOK-SIOS
+<Multi_key> <U11CE> <U11C2> : "ᇏ" U11cf # HANGUL JONGSEONG RIEUL-TIKEUT-HIEUH
+<Multi_key> <U11B1> <U11A8> : "ᇑ" U11d1 # HANGUL JONGSEONG RIEUL-MIEUM-KIYEOK
+<Multi_key> <U11B1> <U11BA> : "ᇒ" U11d2 # HANGUL JONGSEONG RIEUL-MIEUM-SIOS
+<Multi_key> <U11B2> <U11BA> : "ᇓ" U11d3 # HANGUL JONGSEONG RIEUL-PIEUP-SIOS
+<Multi_key> <U11B2> <U11C2> : "ᇔ" U11d4 # HANGUL JONGSEONG RIEUL-PIEUP-HIEUH
+<Multi_key> <U11B2> <U11BC> : "ᇕ" U11d5 # HANGUL JONGSEONG RIEUL-KAPYEOUNPIEUP
+<Multi_key> <U11B3> <U11BA> : "ᇖ" U11d6 # HANGUL JONGSEONG RIEUL-SSANGSIOS
+<Multi_key> <U11DD> <U11BA> : "ᇞ" U11de # HANGUL JONGSEONG MIEUM-SSANGSIOS
+<Multi_key> <U11EC> <U11A8> : "ᇭ" U11ed # HANGUL JONGSEONG IEUNG-SSANGKIYEOK
+<Multi_key> <U1107> <U112D> : "ᄢ" U1122 # HANGUL CHOSEONG PIEUP-SIOS-KIYEOK
+<Multi_key> <U1107> <U112F> : "ᄣ" U1123 # HANGUL CHOSEONG PIEUP-SIOS-TIKEUT
+<Multi_key> <U1107> <U1132> : "ᄤ" U1124 # HANGUL CHOSEONG PIEUP-SIOS-PIEUP
+<Multi_key> <U1107> <U110A> : "ᄥ" U1125 # HANGUL CHOSEONG PIEUP-SSANGSIOS
+<Multi_key> <U1107> <U1136> : "ᄦ" U1126 # HANGUL CHOSEONG PIEUP-SIOS-CIEUC
+<Multi_key> <U1107> <U112B> : "ᄬ" U112c # HANGUL CHOSEONG KAPYEOUNSSANGPIEUP
+<Multi_key> <U1109> <U111E> : "ᄳ" U1133 # HANGUL CHOSEONG SIOS-PIEUP-KIYEOK
+<Multi_key> <U1109> <U110A> : "ᄴ" U1134 # HANGUL CHOSEONG SIOS-SSANGSIOS
+<Multi_key> <U1169> <U1162> : "ᅫ" U116b # HANGUL JUNGSEONG WAE
+<Multi_key> <U116E> <U1166> : "ᅰ" U1170 # HANGUL JUNGSEONG WE
+<Multi_key> <U116E> <U117C> : "ᆋ" U118b # HANGUL JUNGSEONG U-EO-EU
+<Multi_key> <U11A8> <U11E7> : "ᇄ" U11c4 # HANGUL JONGSEONG KIYEOK-SIOS-KIYEOK
+<Multi_key> <U11AF> <U11AA> : "ᇌ" U11cc # HANGUL JONGSEONG RIEUL-KIYEOK-SIOS
+<Multi_key> <U11AF> <U11DA> : "ᇑ" U11d1 # HANGUL JONGSEONG RIEUL-MIEUM-KIYEOK
+<Multi_key> <U11AF> <U11DD> : "ᇒ" U11d2 # HANGUL JONGSEONG RIEUL-MIEUM-SIOS
+<Multi_key> <U11AF> <U11B9> : "ᇓ" U11d3 # HANGUL JONGSEONG RIEUL-PIEUP-SIOS
+<Multi_key> <U11AF> <U11E5> : "ᇔ" U11d4 # HANGUL JONGSEONG RIEUL-PIEUP-HIEUH
+<Multi_key> <U11AF> <U11E6> : "ᇕ" U11d5 # HANGUL JONGSEONG RIEUL-KAPYEOUNPIEUP
+<Multi_key> <U11AF> <U11BB> : "ᇖ" U11d6 # HANGUL JONGSEONG RIEUL-SSANGSIOS
+<Multi_key> <U11B7> <U11BB> : "ᇞ" U11de # HANGUL JONGSEONG MIEUM-SSANGSIOS
+<Multi_key> <U11BC> <U11A9> : "ᇭ" U11ed # HANGUL JONGSEONG IEUNG-SSANGKIYEOK
+
+XCOMM Part 3
+<Multi_key> <comma> <minus> : "¬" notsign # NOT SIGN
+<Multi_key> <minus> <comma> : "¬" notsign # NOT SIGN
+<dead_circumflex> <Multi_key> <underscore> <a> : "ª" ordfeminine # FEMININE ORDINAL INDICATOR
+<Multi_key> <asciicircum> <underscore> <a> : "ª" ordfeminine # FEMININE ORDINAL INDICATOR
+<dead_circumflex> <Multi_key> <underbar> <a> : "ª" ordfeminine # FEMININE ORDINAL INDICATOR
+<Multi_key> <asciicircum> <underbar> <a> : "ª" ordfeminine # FEMININE ORDINAL INDICATOR
+<dead_circumflex> <2> : "²" twosuperior # SUPERSCRIPT TWO
+<Multi_key> <asciicircum> <2> : "²" twosuperior # SUPERSCRIPT TWO
+<dead_circumflex> <KP_Space> : "²" twosuperior # SUPERSCRIPT TWO
+<Multi_key> <asciicircum> <KP_Space> : "²" twosuperior # SUPERSCRIPT TWO
+<dead_circumflex> <KP_2> : "²" twosuperior # SUPERSCRIPT TWO
+<Multi_key> <asciicircum> <KP_2> : "²" twosuperior # SUPERSCRIPT TWO
+<dead_circumflex> <3> : "³" threesuperior # SUPERSCRIPT THREE
+<Multi_key> <asciicircum> <3> : "³" threesuperior # SUPERSCRIPT THREE
+<dead_circumflex> <KP_3> : "³" threesuperior # SUPERSCRIPT THREE
+<Multi_key> <asciicircum> <KP_3> : "³" threesuperior # SUPERSCRIPT THREE
+<Multi_key> <m> <u> : "µ" mu # MICRO SIGN
+<dead_circumflex> <1> : "¹" onesuperior # SUPERSCRIPT ONE
+<Multi_key> <asciicircum> <1> : "¹" onesuperior # SUPERSCRIPT ONE
+<dead_circumflex> <KP_1> : "¹" onesuperior # SUPERSCRIPT ONE
+<Multi_key> <asciicircum> <KP_1> : "¹" onesuperior # SUPERSCRIPT ONE
+<dead_circumflex> <Multi_key> <underscore> <o> : "º" masculine # MASCULINE ORDINAL INDICATOR
+<Multi_key> <asciicircum> <underscore> <o> : "º" masculine # MASCULINE ORDINAL INDICATOR
+<dead_circumflex> <Multi_key> <underbar> <o> : "º" masculine # MASCULINE ORDINAL INDICATOR
+<Multi_key> <asciicircum> <underbar> <o> : "º" masculine # MASCULINE ORDINAL INDICATOR
+<Multi_key> <1> <4> : "¼" onequarter # VULGAR FRACTION ONE QUARTER
+<Multi_key> <1> <2> : "½" onehalf # VULGAR FRACTION ONE HALF
+<Multi_key> <3> <4> : "¾" threequarters # VULGAR FRACTION THREE QUARTERS
+<dead_grave> <A> : "À" Agrave # LATIN CAPITAL LETTER A WITH GRAVE
+<Multi_key> <grave> <A> : "À" Agrave # LATIN CAPITAL LETTER A WITH GRAVE
+<dead_acute> <A> : "Á" Aacute # LATIN CAPITAL LETTER A WITH ACUTE
+<Multi_key> <acute> <A> : "Á" Aacute # LATIN CAPITAL LETTER A WITH ACUTE
+<Multi_key> <apostrophe> <A> : "Á" Aacute # LATIN CAPITAL LETTER A WITH ACUTE
+<dead_circumflex> <A> : "Â" Acircumflex # LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <A> : "Â" Acircumflex # LATIN CAPITAL LETTER A WITH CIRCUMFLEX
+<dead_tilde> <A> : "Ã" Atilde # LATIN CAPITAL LETTER A WITH TILDE
+<Multi_key> <asciitilde> <A> : "Ã" Atilde # LATIN CAPITAL LETTER A WITH TILDE
+<dead_diaeresis> <A> : "Ä" Adiaeresis # LATIN CAPITAL LETTER A WITH DIAERESIS
+<Multi_key> <quotedbl> <A> : "Ä" Adiaeresis # LATIN CAPITAL LETTER A WITH DIAERESIS
+<dead_abovering> <A> : "Å" Aring # LATIN CAPITAL LETTER A WITH RING ABOVE
+<Multi_key> <o> <A> : "Å" Aring # LATIN CAPITAL LETTER A WITH RING ABOVE
+<dead_cedilla> <C> : "Ç" Ccedilla # LATIN CAPITAL LETTER C WITH CEDILLA
+<Multi_key> <comma> <C> : "Ç" Ccedilla # LATIN CAPITAL LETTER C WITH CEDILLA
+<Multi_key> <cedilla> <C> : "Ç" Ccedilla # LATIN CAPITAL LETTER C WITH CEDILLA
+<dead_grave> <E> : "È" Egrave # LATIN CAPITAL LETTER E WITH GRAVE
+<Multi_key> <grave> <E> : "È" Egrave # LATIN CAPITAL LETTER E WITH GRAVE
+<dead_acute> <E> : "É" Eacute # LATIN CAPITAL LETTER E WITH ACUTE
+<Multi_key> <acute> <E> : "É" Eacute # LATIN CAPITAL LETTER E WITH ACUTE
+<Multi_key> <apostrophe> <E> : "É" Eacute # LATIN CAPITAL LETTER E WITH ACUTE
+<dead_circumflex> <E> : "Ê" Ecircumflex # LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <E> : "Ê" Ecircumflex # LATIN CAPITAL LETTER E WITH CIRCUMFLEX
+<dead_diaeresis> <E> : "Ë" Ediaeresis # LATIN CAPITAL LETTER E WITH DIAERESIS
+<Multi_key> <quotedbl> <E> : "Ë" Ediaeresis # LATIN CAPITAL LETTER E WITH DIAERESIS
+<dead_grave> <I> : "Ì" Igrave # LATIN CAPITAL LETTER I WITH GRAVE
+<Multi_key> <grave> <I> : "Ì" Igrave # LATIN CAPITAL LETTER I WITH GRAVE
+<dead_acute> <I> : "Í" Iacute # LATIN CAPITAL LETTER I WITH ACUTE
+<Multi_key> <acute> <I> : "Í" Iacute # LATIN CAPITAL LETTER I WITH ACUTE
+<Multi_key> <apostrophe> <I> : "Í" Iacute # LATIN CAPITAL LETTER I WITH ACUTE
+<dead_circumflex> <I> : "Î" Icircumflex # LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <I> : "Î" Icircumflex # LATIN CAPITAL LETTER I WITH CIRCUMFLEX
+<dead_diaeresis> <I> : "Ï" Idiaeresis # LATIN CAPITAL LETTER I WITH DIAERESIS
+<Multi_key> <quotedbl> <I> : "Ï" Idiaeresis # LATIN CAPITAL LETTER I WITH DIAERESIS
+<Multi_key> <D> <H> : "Ð" ETH # LATIN CAPITAL LETTER ETH
+<dead_tilde> <N> : "Ñ" Ntilde # LATIN CAPITAL LETTER N WITH TILDE
+<Multi_key> <asciitilde> <N> : "Ñ" Ntilde # LATIN CAPITAL LETTER N WITH TILDE
+<dead_grave> <O> : "Ò" Ograve # LATIN CAPITAL LETTER O WITH GRAVE
+<Multi_key> <grave> <O> : "Ò" Ograve # LATIN CAPITAL LETTER O WITH GRAVE
+<dead_acute> <O> : "Ó" Oacute # LATIN CAPITAL LETTER O WITH ACUTE
+<Multi_key> <acute> <O> : "Ó" Oacute # LATIN CAPITAL LETTER O WITH ACUTE
+<Multi_key> <apostrophe> <O> : "Ó" Oacute # LATIN CAPITAL LETTER O WITH ACUTE
+<dead_circumflex> <O> : "Ô" Ocircumflex # LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <O> : "Ô" Ocircumflex # LATIN CAPITAL LETTER O WITH CIRCUMFLEX
+<dead_tilde> <O> : "Õ" Otilde # LATIN CAPITAL LETTER O WITH TILDE
+<Multi_key> <asciitilde> <O> : "Õ" Otilde # LATIN CAPITAL LETTER O WITH TILDE
+<dead_diaeresis> <O> : "Ö" Odiaeresis # LATIN CAPITAL LETTER O WITH DIAERESIS
+<Multi_key> <quotedbl> <O> : "Ö" Odiaeresis # LATIN CAPITAL LETTER O WITH DIAERESIS
+<Multi_key> <x> <x> : "×" multiply # MULTIPLICATION SIGN
+<dead_stroke> <O> : "Ø" Oslash # LATIN CAPITAL LETTER O WITH STROKE
+<Multi_key> <slash> <O> : "Ø" Oslash # LATIN CAPITAL LETTER O WITH STROKE
+<Multi_key> <KP_Divide> <O> : "Ø" Oslash # LATIN CAPITAL LETTER O WITH STROKE
+<dead_grave> <U> : "Ù" Ugrave # LATIN CAPITAL LETTER U WITH GRAVE
+<Multi_key> <grave> <U> : "Ù" Ugrave # LATIN CAPITAL LETTER U WITH GRAVE
+<dead_acute> <U> : "Ú" Uacute # LATIN CAPITAL LETTER U WITH ACUTE
+<Multi_key> <acute> <U> : "Ú" Uacute # LATIN CAPITAL LETTER U WITH ACUTE
+<Multi_key> <apostrophe> <U> : "Ú" Uacute # LATIN CAPITAL LETTER U WITH ACUTE
+<dead_circumflex> <U> : "Û" Ucircumflex # LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <U> : "Û" Ucircumflex # LATIN CAPITAL LETTER U WITH CIRCUMFLEX
+<dead_diaeresis> <U> : "Ü" Udiaeresis # LATIN CAPITAL LETTER U WITH DIAERESIS
+<Multi_key> <quotedbl> <U> : "Ü" Udiaeresis # LATIN CAPITAL LETTER U WITH DIAERESIS
+<dead_acute> <Y> : "Ý" Yacute # LATIN CAPITAL LETTER Y WITH ACUTE
+<Multi_key> <acute> <Y> : "Ý" Yacute # LATIN CAPITAL LETTER Y WITH ACUTE
+<Multi_key> <apostrophe> <Y> : "Ý" Yacute # LATIN CAPITAL LETTER Y WITH ACUTE
+<Multi_key> <T> <H> : "Þ" THORN # LATIN CAPITAL LETTER THORN
+<dead_grave> <a> : "à" agrave # LATIN SMALL LETTER A WITH GRAVE
+<Multi_key> <grave> <a> : "à" agrave # LATIN SMALL LETTER A WITH GRAVE
+<dead_acute> <a> : "á" aacute # LATIN SMALL LETTER A WITH ACUTE
+<Multi_key> <acute> <a> : "á" aacute # LATIN SMALL LETTER A WITH ACUTE
+<Multi_key> <apostrophe> <a> : "á" aacute # LATIN SMALL LETTER A WITH ACUTE
+<dead_circumflex> <a> : "â" acircumflex # LATIN SMALL LETTER A WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <a> : "â" acircumflex # LATIN SMALL LETTER A WITH CIRCUMFLEX
+<dead_tilde> <a> : "ã" atilde # LATIN SMALL LETTER A WITH TILDE
+<Multi_key> <asciitilde> <a> : "ã" atilde # LATIN SMALL LETTER A WITH TILDE
+<dead_diaeresis> <a> : "ä" adiaeresis # LATIN SMALL LETTER A WITH DIAERESIS
+<Multi_key> <quotedbl> <a> : "ä" adiaeresis # LATIN SMALL LETTER A WITH DIAERESIS
+<dead_abovering> <a> : "å" aring # LATIN SMALL LETTER A WITH RING ABOVE
+<Multi_key> <o> <a> : "å" aring # LATIN SMALL LETTER A WITH RING ABOVE
+<dead_cedilla> <c> : "ç" ccedilla # LATIN SMALL LETTER C WITH CEDILLA
+<Multi_key> <comma> <c> : "ç" ccedilla # LATIN SMALL LETTER C WITH CEDILLA
+<Multi_key> <cedilla> <c> : "ç" ccedilla # LATIN SMALL LETTER C WITH CEDILLA
+<dead_grave> <e> : "è" egrave # LATIN SMALL LETTER E WITH GRAVE
+<Multi_key> <grave> <e> : "è" egrave # LATIN SMALL LETTER E WITH GRAVE
+<dead_acute> <e> : "é" eacute # LATIN SMALL LETTER E WITH ACUTE
+<Multi_key> <acute> <e> : "é" eacute # LATIN SMALL LETTER E WITH ACUTE
+<Multi_key> <apostrophe> <e> : "é" eacute # LATIN SMALL LETTER E WITH ACUTE
+<dead_circumflex> <e> : "ê" ecircumflex # LATIN SMALL LETTER E WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <e> : "ê" ecircumflex # LATIN SMALL LETTER E WITH CIRCUMFLEX
+<dead_diaeresis> <e> : "ë" ediaeresis # LATIN SMALL LETTER E WITH DIAERESIS
+<Multi_key> <quotedbl> <e> : "ë" ediaeresis # LATIN SMALL LETTER E WITH DIAERESIS
+<dead_grave> <i> : "ì" igrave # LATIN SMALL LETTER I WITH GRAVE
+<Multi_key> <grave> <i> : "ì" igrave # LATIN SMALL LETTER I WITH GRAVE
+<dead_acute> <i> : "í" iacute # LATIN SMALL LETTER I WITH ACUTE
+<Multi_key> <acute> <i> : "í" iacute # LATIN SMALL LETTER I WITH ACUTE
+<Multi_key> <apostrophe> <i> : "í" iacute # LATIN SMALL LETTER I WITH ACUTE
+<dead_circumflex> <i> : "î" icircumflex # LATIN SMALL LETTER I WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <i> : "î" icircumflex # LATIN SMALL LETTER I WITH CIRCUMFLEX
+<dead_diaeresis> <i> : "ï" idiaeresis # LATIN SMALL LETTER I WITH DIAERESIS
+<Multi_key> <quotedbl> <i> : "ï" idiaeresis # LATIN SMALL LETTER I WITH DIAERESIS
+<Multi_key> <d> <h> : "ð" eth # LATIN SMALL LETTER ETH
+<dead_tilde> <n> : "ñ" ntilde # LATIN SMALL LETTER N WITH TILDE
+<Multi_key> <asciitilde> <n> : "ñ" ntilde # LATIN SMALL LETTER N WITH TILDE
+<dead_grave> <o> : "ò" ograve # LATIN SMALL LETTER O WITH GRAVE
+<Multi_key> <grave> <o> : "ò" ograve # LATIN SMALL LETTER O WITH GRAVE
+<dead_acute> <o> : "ó" oacute # LATIN SMALL LETTER O WITH ACUTE
+<Multi_key> <acute> <o> : "ó" oacute # LATIN SMALL LETTER O WITH ACUTE
+<Multi_key> <apostrophe> <o> : "ó" oacute # LATIN SMALL LETTER O WITH ACUTE
+<dead_circumflex> <o> : "ô" ocircumflex # LATIN SMALL LETTER O WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <o> : "ô" ocircumflex # LATIN SMALL LETTER O WITH CIRCUMFLEX
+<dead_tilde> <o> : "õ" otilde # LATIN SMALL LETTER O WITH TILDE
+<Multi_key> <asciitilde> <o> : "õ" otilde # LATIN SMALL LETTER O WITH TILDE
+<dead_diaeresis> <o> : "ö" odiaeresis # LATIN SMALL LETTER O WITH DIAERESIS
+<Multi_key> <quotedbl> <o> : "ö" odiaeresis # LATIN SMALL LETTER O WITH DIAERESIS
+<Multi_key> <colon> <minus> : "÷" division # DIVISION SIGN
+<Multi_key> <minus> <colon> : "÷" division # DIVISION SIGN
+<dead_stroke> <o> : "ø" oslash # LATIN SMALL LETTER O WITH STROKE
+<Multi_key> <slash> <o> : "ø" oslash # LATIN SMALL LETTER O WITH STROKE
+<Multi_key> <KP_Divide> <o> : "ø" oslash # LATIN SMALL LETTER O WITH STROKE
+<dead_grave> <u> : "ù" ugrave # LATIN SMALL LETTER U WITH GRAVE
+<Multi_key> <grave> <u> : "ù" ugrave # LATIN SMALL LETTER U WITH GRAVE
+<dead_acute> <u> : "ú" uacute # LATIN SMALL LETTER U WITH ACUTE
+<Multi_key> <acute> <u> : "ú" uacute # LATIN SMALL LETTER U WITH ACUTE
+<Multi_key> <apostrophe> <u> : "ú" uacute # LATIN SMALL LETTER U WITH ACUTE
+<dead_circumflex> <u> : "û" ucircumflex # LATIN SMALL LETTER U WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <u> : "û" ucircumflex # LATIN SMALL LETTER U WITH CIRCUMFLEX
+<dead_diaeresis> <u> : "ü" udiaeresis # LATIN SMALL LETTER U WITH DIAERESIS
+<Multi_key> <quotedbl> <u> : "ü" udiaeresis # LATIN SMALL LETTER U WITH DIAERESIS
+<dead_acute> <y> : "ý" yacute # LATIN SMALL LETTER Y WITH ACUTE
+<Multi_key> <acute> <y> : "ý" yacute # LATIN SMALL LETTER Y WITH ACUTE
+<Multi_key> <apostrophe> <y> : "ý" yacute # LATIN SMALL LETTER Y WITH ACUTE
+<Multi_key> <t> <h> : "þ" thorn # LATIN SMALL LETTER THORN
+<dead_diaeresis> <y> : "ÿ" ydiaeresis # LATIN SMALL LETTER Y WITH DIAERESIS
+<Multi_key> <quotedbl> <y> : "ÿ" ydiaeresis # LATIN SMALL LETTER Y WITH DIAERESIS
+<dead_macron> <A> : "Ā" U0100 # LATIN CAPITAL LETTER A WITH MACRON
+<Multi_key> <macron> <A> : "Ā" U0100 # LATIN CAPITAL LETTER A WITH MACRON
+<Multi_key> <underscore> <A> : "Ā" U0100 # LATIN CAPITAL LETTER A WITH MACRON
+<dead_macron> <a> : "ā" U0101 # LATIN SMALL LETTER A WITH MACRON
+<Multi_key> <macron> <a> : "ā" U0101 # LATIN SMALL LETTER A WITH MACRON
+<Multi_key> <underscore> <a> : "ā" U0101 # LATIN SMALL LETTER A WITH MACRON
+<dead_breve> <A> : "Ă" U0102 # LATIN CAPITAL LETTER A WITH BREVE
+<Multi_key> <U> <A> : "Ă" U0102 # LATIN CAPITAL LETTER A WITH BREVE
+<Multi_key> <b> <A> : "Ă" U0102 # LATIN CAPITAL LETTER A WITH BREVE
+<dead_breve> <a> : "ă" U0103 # LATIN SMALL LETTER A WITH BREVE
+<Multi_key> <U> <a> : "ă" U0103 # LATIN SMALL LETTER A WITH BREVE
+<Multi_key> <b> <a> : "ă" U0103 # LATIN SMALL LETTER A WITH BREVE
+<dead_ogonek> <A> : "Ą" U0104 # LATIN CAPITAL LETTER A WITH OGONEK
+<Multi_key> <semicolon> <A> : "Ą" U0104 # LATIN CAPITAL LETTER A WITH OGONEK
+<Multi_key> <comma> <A> : "Ą" U0104 # LATIN CAPITAL LETTER A WITH OGONEK
+<dead_ogonek> <a> : "ą" U0105 # LATIN SMALL LETTER A WITH OGONEK
+<Multi_key> <semicolon> <a> : "ą" U0105 # LATIN SMALL LETTER A WITH OGONEK
+<Multi_key> <comma> <a> : "ą" U0105 # LATIN SMALL LETTER A WITH OGONEK
+<dead_acute> <C> : "Ć" U0106 # LATIN CAPITAL LETTER C WITH ACUTE
+<Multi_key> <acute> <C> : "Ć" U0106 # LATIN CAPITAL LETTER C WITH ACUTE
+<Multi_key> <apostrophe> <C> : "Ć" U0106 # LATIN CAPITAL LETTER C WITH ACUTE
+<dead_acute> <c> : "ć" U0107 # LATIN SMALL LETTER C WITH ACUTE
+<Multi_key> <acute> <c> : "ć" U0107 # LATIN SMALL LETTER C WITH ACUTE
+<Multi_key> <apostrophe> <c> : "ć" U0107 # LATIN SMALL LETTER C WITH ACUTE
+<dead_circumflex> <C> : "Ĉ" U0108 # LATIN CAPITAL LETTER C WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <C> : "Ĉ" U0108 # LATIN CAPITAL LETTER C WITH CIRCUMFLEX
+<dead_circumflex> <c> : "ĉ" U0109 # LATIN SMALL LETTER C WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <c> : "ĉ" U0109 # LATIN SMALL LETTER C WITH CIRCUMFLEX
+<dead_abovedot> <C> : "Ċ" U010A # LATIN CAPITAL LETTER C WITH DOT ABOVE
+<Multi_key> <period> <C> : "Ċ" U010A # LATIN CAPITAL LETTER C WITH DOT ABOVE
+<dead_abovedot> <c> : "ċ" U010B # LATIN SMALL LETTER C WITH DOT ABOVE
+<Multi_key> <period> <c> : "ċ" U010B # LATIN SMALL LETTER C WITH DOT ABOVE
+<dead_caron> <C> : "Č" U010C # LATIN CAPITAL LETTER C WITH CARON
+<Multi_key> <c> <C> : "Č" U010C # LATIN CAPITAL LETTER C WITH CARON
+<dead_caron> <c> : "č" U010D # LATIN SMALL LETTER C WITH CARON
+<Multi_key> <c> <c> : "č" U010D # LATIN SMALL LETTER C WITH CARON
+<dead_caron> <D> : "Ď" U010E # LATIN CAPITAL LETTER D WITH CARON
+<Multi_key> <c> <D> : "Ď" U010E # LATIN CAPITAL LETTER D WITH CARON
+<dead_caron> <d> : "ď" U010F # LATIN SMALL LETTER D WITH CARON
+<Multi_key> <c> <d> : "ď" U010F # LATIN SMALL LETTER D WITH CARON
+<dead_stroke> <D> : "Đ" U0110 # LATIN CAPITAL LETTER D WITH STROKE
+<Multi_key> <slash> <D> : "Đ" U0110 # LATIN CAPITAL LETTER D WITH STROKE
+<Multi_key> <KP_Divide> <D> : "Đ" U0110 # LATIN CAPITAL LETTER D WITH STROKE
+<dead_stroke> <d> : "đ" U0111 # LATIN SMALL LETTER D WITH STROKE
+<Multi_key> <slash> <d> : "đ" U0111 # LATIN SMALL LETTER D WITH STROKE
+<Multi_key> <KP_Divide> <d> : "đ" U0111 # LATIN SMALL LETTER D WITH STROKE
+<dead_macron> <E> : "Ē" U0112 # LATIN CAPITAL LETTER E WITH MACRON
+<Multi_key> <macron> <E> : "Ē" U0112 # LATIN CAPITAL LETTER E WITH MACRON
+<Multi_key> <underscore> <E> : "Ē" U0112 # LATIN CAPITAL LETTER E WITH MACRON
+<dead_macron> <e> : "ē" U0113 # LATIN SMALL LETTER E WITH MACRON
+<Multi_key> <macron> <e> : "ē" U0113 # LATIN SMALL LETTER E WITH MACRON
+<Multi_key> <underscore> <e> : "ē" U0113 # LATIN SMALL LETTER E WITH MACRON
+<dead_breve> <E> : "Ĕ" U0114 # LATIN CAPITAL LETTER E WITH BREVE
+<Multi_key> <U> <E> : "Ĕ" U0114 # LATIN CAPITAL LETTER E WITH BREVE
+<Multi_key> <b> <E> : "Ĕ" U0114 # LATIN CAPITAL LETTER E WITH BREVE
+<dead_breve> <e> : "ĕ" U0115 # LATIN SMALL LETTER E WITH BREVE
+<Multi_key> <U> <e> : "ĕ" U0115 # LATIN SMALL LETTER E WITH BREVE
+<Multi_key> <b> <e> : "ĕ" U0115 # LATIN SMALL LETTER E WITH BREVE
+<dead_abovedot> <E> : "Ė" U0116 # LATIN CAPITAL LETTER E WITH DOT ABOVE
+<Multi_key> <period> <E> : "Ė" U0116 # LATIN CAPITAL LETTER E WITH DOT ABOVE
+<dead_abovedot> <e> : "ė" U0117 # LATIN SMALL LETTER E WITH DOT ABOVE
+<Multi_key> <period> <e> : "ė" U0117 # LATIN SMALL LETTER E WITH DOT ABOVE
+<dead_ogonek> <E> : "Ę" U0118 # LATIN CAPITAL LETTER E WITH OGONEK
+<Multi_key> <semicolon> <E> : "Ę" U0118 # LATIN CAPITAL LETTER E WITH OGONEK
+<Multi_key> <comma> <E> : "Ę" U0118 # LATIN CAPITAL LETTER E WITH OGONEK
+<dead_ogonek> <e> : "ę" U0119 # LATIN SMALL LETTER E WITH OGONEK
+<Multi_key> <semicolon> <e> : "ę" U0119 # LATIN SMALL LETTER E WITH OGONEK
+<Multi_key> <comma> <e> : "ę" U0119 # LATIN SMALL LETTER E WITH OGONEK
+<dead_caron> <E> : "Ě" U011A # LATIN CAPITAL LETTER E WITH CARON
+<Multi_key> <c> <E> : "Ě" U011A # LATIN CAPITAL LETTER E WITH CARON
+<dead_caron> <e> : "ě" U011B # LATIN SMALL LETTER E WITH CARON
+<Multi_key> <c> <e> : "ě" U011B # LATIN SMALL LETTER E WITH CARON
+<dead_circumflex> <G> : "Ĝ" U011C # LATIN CAPITAL LETTER G WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <G> : "Ĝ" U011C # LATIN CAPITAL LETTER G WITH CIRCUMFLEX
+<dead_circumflex> <g> : "ĝ" U011D # LATIN SMALL LETTER G WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <g> : "ĝ" U011D # LATIN SMALL LETTER G WITH CIRCUMFLEX
+<dead_breve> <G> : "Ğ" U011E # LATIN CAPITAL LETTER G WITH BREVE
+<Multi_key> <U> <G> : "Ğ" U011E # LATIN CAPITAL LETTER G WITH BREVE
+<Multi_key> <b> <G> : "Ğ" U011E # LATIN CAPITAL LETTER G WITH BREVE
+<dead_breve> <g> : "ğ" U011F # LATIN SMALL LETTER G WITH BREVE
+<Multi_key> <U> <g> : "ğ" U011F # LATIN SMALL LETTER G WITH BREVE
+<Multi_key> <b> <g> : "ğ" U011F # LATIN SMALL LETTER G WITH BREVE
+<dead_abovedot> <G> : "Ġ" U0120 # LATIN CAPITAL LETTER G WITH DOT ABOVE
+<Multi_key> <period> <G> : "Ġ" U0120 # LATIN CAPITAL LETTER G WITH DOT ABOVE
+<dead_abovedot> <g> : "ġ" U0121 # LATIN SMALL LETTER G WITH DOT ABOVE
+<Multi_key> <period> <g> : "ġ" U0121 # LATIN SMALL LETTER G WITH DOT ABOVE
+<dead_cedilla> <G> : "Ģ" U0122 # LATIN CAPITAL LETTER G WITH CEDILLA
+<Multi_key> <comma> <G> : "Ģ" U0122 # LATIN CAPITAL LETTER G WITH CEDILLA
+<Multi_key> <cedilla> <G> : "Ģ" U0122 # LATIN CAPITAL LETTER G WITH CEDILLA
+<dead_cedilla> <g> : "ģ" U0123 # LATIN SMALL LETTER G WITH CEDILLA
+<Multi_key> <comma> <g> : "ģ" U0123 # LATIN SMALL LETTER G WITH CEDILLA
+<Multi_key> <cedilla> <g> : "ģ" U0123 # LATIN SMALL LETTER G WITH CEDILLA
+<dead_circumflex> <H> : "Ĥ" U0124 # LATIN CAPITAL LETTER H WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <H> : "Ĥ" U0124 # LATIN CAPITAL LETTER H WITH CIRCUMFLEX
+<dead_circumflex> <h> : "ĥ" U0125 # LATIN SMALL LETTER H WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <h> : "ĥ" U0125 # LATIN SMALL LETTER H WITH CIRCUMFLEX
+<dead_stroke> <H> : "Ħ" U0126 # LATIN CAPITAL LETTER H WITH STROKE
+<Multi_key> <slash> <H> : "Ħ" U0126 # LATIN CAPITAL LETTER H WITH STROKE
+<Multi_key> <KP_Divide> <H> : "Ħ" U0126 # LATIN CAPITAL LETTER H WITH STROKE
+<dead_stroke> <h> : "ħ" U0127 # LATIN SMALL LETTER H WITH STROKE
+<Multi_key> <slash> <h> : "ħ" U0127 # LATIN SMALL LETTER H WITH STROKE
+<Multi_key> <KP_Divide> <h> : "ħ" U0127 # LATIN SMALL LETTER H WITH STROKE
+<dead_tilde> <I> : "Ĩ" U0128 # LATIN CAPITAL LETTER I WITH TILDE
+<Multi_key> <asciitilde> <I> : "Ĩ" U0128 # LATIN CAPITAL LETTER I WITH TILDE
+<dead_tilde> <i> : "ĩ" U0129 # LATIN SMALL LETTER I WITH TILDE
+<Multi_key> <asciitilde> <i> : "ĩ" U0129 # LATIN SMALL LETTER I WITH TILDE
+<dead_macron> <I> : "Ī" U012A # LATIN CAPITAL LETTER I WITH MACRON
+<Multi_key> <macron> <I> : "Ī" U012A # LATIN CAPITAL LETTER I WITH MACRON
+<Multi_key> <underscore> <I> : "Ī" U012A # LATIN CAPITAL LETTER I WITH MACRON
+<dead_macron> <i> : "ī" U012B # LATIN SMALL LETTER I WITH MACRON
+<Multi_key> <macron> <i> : "ī" U012B # LATIN SMALL LETTER I WITH MACRON
+<Multi_key> <underscore> <i> : "ī" U012B # LATIN SMALL LETTER I WITH MACRON
+<dead_breve> <I> : "Ĭ" U012C # LATIN CAPITAL LETTER I WITH BREVE
+<Multi_key> <U> <I> : "Ĭ" U012C # LATIN CAPITAL LETTER I WITH BREVE
+<Multi_key> <b> <I> : "Ĭ" U012C # LATIN CAPITAL LETTER I WITH BREVE
+<dead_breve> <i> : "ĭ" U012D # LATIN SMALL LETTER I WITH BREVE
+<Multi_key> <U> <i> : "ĭ" U012D # LATIN SMALL LETTER I WITH BREVE
+<Multi_key> <b> <i> : "ĭ" U012D # LATIN SMALL LETTER I WITH BREVE
+<dead_ogonek> <I> : "Į" U012E # LATIN CAPITAL LETTER I WITH OGONEK
+<Multi_key> <semicolon> <I> : "Į" U012E # LATIN CAPITAL LETTER I WITH OGONEK
+<Multi_key> <comma> <I> : "Į" U012E # LATIN CAPITAL LETTER I WITH OGONEK
+<dead_ogonek> <i> : "į" U012F # LATIN SMALL LETTER I WITH OGONEK
+<Multi_key> <semicolon> <i> : "į" U012F # LATIN SMALL LETTER I WITH OGONEK
+<Multi_key> <comma> <i> : "į" U012F # LATIN SMALL LETTER I WITH OGONEK
+<dead_abovedot> <I> : "İ" U0130 # LATIN CAPITAL LETTER I WITH DOT ABOVE
+<Multi_key> <period> <I> : "İ" U0130 # LATIN CAPITAL LETTER I WITH DOT ABOVE
+<dead_abovedot> <i> : "ı" U0131 # LATIN SMALL LETTER DOTLESS I
+<Multi_key> <i> <period> : "ı" U0131 # LATIN SMALL LETTER DOTLESS I
+<dead_circumflex> <J> : "Ĵ" U0134 # LATIN CAPITAL LETTER J WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <J> : "Ĵ" U0134 # LATIN CAPITAL LETTER J WITH CIRCUMFLEX
+<dead_circumflex> <j> : "ĵ" U0135 # LATIN SMALL LETTER J WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <j> : "ĵ" U0135 # LATIN SMALL LETTER J WITH CIRCUMFLEX
+<dead_cedilla> <K> : "Ķ" U0136 # LATIN CAPITAL LETTER K WITH CEDILLA
+<Multi_key> <comma> <K> : "Ķ" U0136 # LATIN CAPITAL LETTER K WITH CEDILLA
+<Multi_key> <cedilla> <K> : "Ķ" U0136 # LATIN CAPITAL LETTER K WITH CEDILLA
+<dead_cedilla> <k> : "ķ" U0137 # LATIN SMALL LETTER K WITH CEDILLA
+<Multi_key> <comma> <k> : "ķ" U0137 # LATIN SMALL LETTER K WITH CEDILLA
+<Multi_key> <cedilla> <k> : "ķ" U0137 # LATIN SMALL LETTER K WITH CEDILLA
+<Multi_key> <k> <k> : "ĸ" U0138 # LATIN SMALL LETTER KRA
+<dead_acute> <L> : "Ĺ" U0139 # LATIN CAPITAL LETTER L WITH ACUTE
+<Multi_key> <acute> <L> : "Ĺ" U0139 # LATIN CAPITAL LETTER L WITH ACUTE
+<Multi_key> <apostrophe> <L> : "Ĺ" U0139 # LATIN CAPITAL LETTER L WITH ACUTE
+<dead_acute> <l> : "ĺ" U013A # LATIN SMALL LETTER L WITH ACUTE
+<Multi_key> <acute> <l> : "ĺ" U013A # LATIN SMALL LETTER L WITH ACUTE
+<Multi_key> <apostrophe> <l> : "ĺ" U013A # LATIN SMALL LETTER L WITH ACUTE
+<dead_cedilla> <L> : "Ļ" U013B # LATIN CAPITAL LETTER L WITH CEDILLA
+<Multi_key> <comma> <L> : "Ļ" U013B # LATIN CAPITAL LETTER L WITH CEDILLA
+<Multi_key> <cedilla> <L> : "Ļ" U013B # LATIN CAPITAL LETTER L WITH CEDILLA
+<dead_cedilla> <l> : "ļ" U013C # LATIN SMALL LETTER L WITH CEDILLA
+<Multi_key> <comma> <l> : "ļ" U013C # LATIN SMALL LETTER L WITH CEDILLA
+<Multi_key> <cedilla> <l> : "ļ" U013C # LATIN SMALL LETTER L WITH CEDILLA
+<dead_caron> <L> : "Ľ" U013D # LATIN CAPITAL LETTER L WITH CARON
+<Multi_key> <c> <L> : "Ľ" U013D # LATIN CAPITAL LETTER L WITH CARON
+<dead_caron> <l> : "ľ" U013E # LATIN SMALL LETTER L WITH CARON
+<Multi_key> <c> <l> : "ľ" U013E # LATIN SMALL LETTER L WITH CARON
+<dead_stroke> <L> : "Ł" U0141 # LATIN CAPITAL LETTER L WITH STROKE
+<Multi_key> <slash> <L> : "Ł" U0141 # LATIN CAPITAL LETTER L WITH STROKE
+<Multi_key> <KP_Divide> <L> : "Ł" U0141 # LATIN CAPITAL LETTER L WITH STROKE
+<dead_stroke> <l> : "ł" U0142 # LATIN SMALL LETTER L WITH STROKE
+<Multi_key> <slash> <l> : "ł" U0142 # LATIN SMALL LETTER L WITH STROKE
+<Multi_key> <KP_Divide> <l> : "ł" U0142 # LATIN SMALL LETTER L WITH STROKE
+<dead_acute> <N> : "Ń" U0143 # LATIN CAPITAL LETTER N WITH ACUTE
+<Multi_key> <acute> <N> : "Ń" U0143 # LATIN CAPITAL LETTER N WITH ACUTE
+<Multi_key> <apostrophe> <N> : "Ń" U0143 # LATIN CAPITAL LETTER N WITH ACUTE
+<dead_acute> <n> : "ń" U0144 # LATIN SMALL LETTER N WITH ACUTE
+<Multi_key> <acute> <n> : "ń" U0144 # LATIN SMALL LETTER N WITH ACUTE
+<Multi_key> <apostrophe> <n> : "ń" U0144 # LATIN SMALL LETTER N WITH ACUTE
+<dead_cedilla> <N> : "Ņ" U0145 # LATIN CAPITAL LETTER N WITH CEDILLA
+<Multi_key> <comma> <N> : "Ņ" U0145 # LATIN CAPITAL LETTER N WITH CEDILLA
+<Multi_key> <cedilla> <N> : "Ņ" U0145 # LATIN CAPITAL LETTER N WITH CEDILLA
+<dead_cedilla> <n> : "ņ" U0146 # LATIN SMALL LETTER N WITH CEDILLA
+<Multi_key> <comma> <n> : "ņ" U0146 # LATIN SMALL LETTER N WITH CEDILLA
+<Multi_key> <cedilla> <n> : "ņ" U0146 # LATIN SMALL LETTER N WITH CEDILLA
+<dead_caron> <N> : "Ň" U0147 # LATIN CAPITAL LETTER N WITH CARON
+<Multi_key> <c> <N> : "Ň" U0147 # LATIN CAPITAL LETTER N WITH CARON
+<dead_caron> <n> : "ň" U0148 # LATIN SMALL LETTER N WITH CARON
+<Multi_key> <c> <n> : "ň" U0148 # LATIN SMALL LETTER N WITH CARON
+<Multi_key> <N> <G> : "Ŋ" U014A # LATIN CAPITAL LETTER ENG
+<Multi_key> <n> <g> : "ŋ" U014B # LATIN SMALL LETTER ENG
+<dead_macron> <O> : "Ō" U014C # LATIN CAPITAL LETTER O WITH MACRON
+<Multi_key> <macron> <O> : "Ō" U014C # LATIN CAPITAL LETTER O WITH MACRON
+<Multi_key> <underscore> <O> : "Ō" U014C # LATIN CAPITAL LETTER O WITH MACRON
+<dead_macron> <o> : "ō" U014D # LATIN SMALL LETTER O WITH MACRON
+<Multi_key> <macron> <o> : "ō" U014D # LATIN SMALL LETTER O WITH MACRON
+<Multi_key> <underscore> <o> : "ō" U014D # LATIN SMALL LETTER O WITH MACRON
+<dead_breve> <O> : "Ŏ" U014E # LATIN CAPITAL LETTER O WITH BREVE
+<Multi_key> <U> <O> : "Ŏ" U014E # LATIN CAPITAL LETTER O WITH BREVE
+<Multi_key> <b> <O> : "Ŏ" U014E # LATIN CAPITAL LETTER O WITH BREVE
+<dead_breve> <o> : "ŏ" U014F # LATIN SMALL LETTER O WITH BREVE
+<Multi_key> <U> <o> : "ŏ" U014F # LATIN SMALL LETTER O WITH BREVE
+<Multi_key> <b> <o> : "ŏ" U014F # LATIN SMALL LETTER O WITH BREVE
+<dead_doubleacute> <O> : "Ő" U0150 # LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+<Multi_key> <equal> <O> : "Ő" U0150 # LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
+<dead_doubleacute> <o> : "ő" U0151 # LATIN SMALL LETTER O WITH DOUBLE ACUTE
+<Multi_key> <equal> <o> : "ő" U0151 # LATIN SMALL LETTER O WITH DOUBLE ACUTE
+<dead_acute> <R> : "Ŕ" U0154 # LATIN CAPITAL LETTER R WITH ACUTE
+<Multi_key> <acute> <R> : "Ŕ" U0154 # LATIN CAPITAL LETTER R WITH ACUTE
+<Multi_key> <apostrophe> <R> : "Ŕ" U0154 # LATIN CAPITAL LETTER R WITH ACUTE
+<dead_acute> <r> : "ŕ" U0155 # LATIN SMALL LETTER R WITH ACUTE
+<Multi_key> <acute> <r> : "ŕ" U0155 # LATIN SMALL LETTER R WITH ACUTE
+<Multi_key> <apostrophe> <r> : "ŕ" U0155 # LATIN SMALL LETTER R WITH ACUTE
+<dead_cedilla> <R> : "Ŗ" U0156 # LATIN CAPITAL LETTER R WITH CEDILLA
+<Multi_key> <comma> <R> : "Ŗ" U0156 # LATIN CAPITAL LETTER R WITH CEDILLA
+<Multi_key> <cedilla> <R> : "Ŗ" U0156 # LATIN CAPITAL LETTER R WITH CEDILLA
+<dead_cedilla> <r> : "ŗ" U0157 # LATIN SMALL LETTER R WITH CEDILLA
+<Multi_key> <comma> <r> : "ŗ" U0157 # LATIN SMALL LETTER R WITH CEDILLA
+<Multi_key> <cedilla> <r> : "ŗ" U0157 # LATIN SMALL LETTER R WITH CEDILLA
+<dead_caron> <R> : "Ř" U0158 # LATIN CAPITAL LETTER R WITH CARON
+<Multi_key> <c> <R> : "Ř" U0158 # LATIN CAPITAL LETTER R WITH CARON
+<dead_caron> <r> : "ř" U0159 # LATIN SMALL LETTER R WITH CARON
+<Multi_key> <c> <r> : "ř" U0159 # LATIN SMALL LETTER R WITH CARON
+<dead_acute> <S> : "Ś" U015A # LATIN CAPITAL LETTER S WITH ACUTE
+<Multi_key> <acute> <S> : "Ś" U015A # LATIN CAPITAL LETTER S WITH ACUTE
+<Multi_key> <apostrophe> <S> : "Ś" U015A # LATIN CAPITAL LETTER S WITH ACUTE
+<dead_acute> <s> : "ś" U015B # LATIN SMALL LETTER S WITH ACUTE
+<Multi_key> <acute> <s> : "ś" U015B # LATIN SMALL LETTER S WITH ACUTE
+<Multi_key> <apostrophe> <s> : "ś" U015B # LATIN SMALL LETTER S WITH ACUTE
+<dead_circumflex> <S> : "Ŝ" U015C # LATIN CAPITAL LETTER S WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <S> : "Ŝ" U015C # LATIN CAPITAL LETTER S WITH CIRCUMFLEX
+<dead_circumflex> <s> : "ŝ" U015D # LATIN SMALL LETTER S WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <s> : "ŝ" U015D # LATIN SMALL LETTER S WITH CIRCUMFLEX
+<dead_cedilla> <S> : "Ş" U015E # LATIN CAPITAL LETTER S WITH CEDILLA
+<Multi_key> <comma> <S> : "Ş" U015E # LATIN CAPITAL LETTER S WITH CEDILLA
+<Multi_key> <cedilla> <S> : "Ş" U015E # LATIN CAPITAL LETTER S WITH CEDILLA
+<dead_cedilla> <s> : "ş" U015F # LATIN SMALL LETTER S WITH CEDILLA
+<Multi_key> <comma> <s> : "ş" U015F # LATIN SMALL LETTER S WITH CEDILLA
+<Multi_key> <cedilla> <s> : "ş" U015F # LATIN SMALL LETTER S WITH CEDILLA
+<dead_caron> <S> : "Š" U0160 # LATIN CAPITAL LETTER S WITH CARON
+<Multi_key> <c> <S> : "Š" U0160 # LATIN CAPITAL LETTER S WITH CARON
+<dead_caron> <s> : "š" U0161 # LATIN SMALL LETTER S WITH CARON
+<Multi_key> <c> <s> : "š" U0161 # LATIN SMALL LETTER S WITH CARON
+<dead_cedilla> <T> : "Ţ" U0162 # LATIN CAPITAL LETTER T WITH CEDILLA
+<Multi_key> <comma> <T> : "Ţ" U0162 # LATIN CAPITAL LETTER T WITH CEDILLA
+<Multi_key> <cedilla> <T> : "Ţ" U0162 # LATIN CAPITAL LETTER T WITH CEDILLA
+<dead_cedilla> <t> : "ţ" U0163 # LATIN SMALL LETTER T WITH CEDILLA
+<Multi_key> <comma> <t> : "ţ" U0163 # LATIN SMALL LETTER T WITH CEDILLA
+<Multi_key> <cedilla> <t> : "ţ" U0163 # LATIN SMALL LETTER T WITH CEDILLA
+<dead_caron> <T> : "Ť" U0164 # LATIN CAPITAL LETTER T WITH CARON
+<Multi_key> <c> <T> : "Ť" U0164 # LATIN CAPITAL LETTER T WITH CARON
+<dead_caron> <t> : "ť" U0165 # LATIN SMALL LETTER T WITH CARON
+<Multi_key> <c> <t> : "ť" U0165 # LATIN SMALL LETTER T WITH CARON
+<dead_stroke> <T> : "Ŧ" U0166 # LATIN CAPITAL LETTER T WITH STROKE
+<Multi_key> <slash> <T> : "Ŧ" U0166 # LATIN CAPITAL LETTER T WITH STROKE
+<Multi_key> <KP_Divide> <T> : "Ŧ" U0166 # LATIN CAPITAL LETTER T WITH STROKE
+<dead_stroke> <t> : "ŧ" U0167 # LATIN SMALL LETTER T WITH STROKE
+<Multi_key> <slash> <t> : "ŧ" U0167 # LATIN SMALL LETTER T WITH STROKE
+<Multi_key> <KP_Divide> <t> : "ŧ" U0167 # LATIN SMALL LETTER T WITH STROKE
+<dead_tilde> <U> : "Ũ" U0168 # LATIN CAPITAL LETTER U WITH TILDE
+<Multi_key> <asciitilde> <U> : "Ũ" U0168 # LATIN CAPITAL LETTER U WITH TILDE
+<dead_tilde> <u> : "ũ" U0169 # LATIN SMALL LETTER U WITH TILDE
+<Multi_key> <asciitilde> <u> : "ũ" U0169 # LATIN SMALL LETTER U WITH TILDE
+<dead_macron> <U> : "Ū" U016A # LATIN CAPITAL LETTER U WITH MACRON
+<Multi_key> <macron> <U> : "Ū" U016A # LATIN CAPITAL LETTER U WITH MACRON
+<Multi_key> <underscore> <U> : "Ū" U016A # LATIN CAPITAL LETTER U WITH MACRON
+<dead_macron> <u> : "ū" U016B # LATIN SMALL LETTER U WITH MACRON
+<Multi_key> <macron> <u> : "ū" U016B # LATIN SMALL LETTER U WITH MACRON
+<Multi_key> <underscore> <u> : "ū" U016B # LATIN SMALL LETTER U WITH MACRON
+<dead_breve> <U> : "Ŭ" U016C # LATIN CAPITAL LETTER U WITH BREVE
+<Multi_key> <U> <U> : "Ŭ" U016C # LATIN CAPITAL LETTER U WITH BREVE
+<Multi_key> <b> <U> : "Ŭ" U016C # LATIN CAPITAL LETTER U WITH BREVE
+<dead_breve> <u> : "ŭ" U016D # LATIN SMALL LETTER U WITH BREVE
+<Multi_key> <U> <u> : "ŭ" U016D # LATIN SMALL LETTER U WITH BREVE
+<Multi_key> <u> <u> : "ŭ" U016D # LATIN SMALL LETTER U WITH BREVE
+<Multi_key> <b> <u> : "ŭ" U016D # LATIN SMALL LETTER U WITH BREVE
+<dead_abovering> <U> : "Ů" U016E # LATIN CAPITAL LETTER U WITH RING ABOVE
+<Multi_key> <o> <U> : "Ů" U016E # LATIN CAPITAL LETTER U WITH RING ABOVE
+<dead_abovering> <u> : "ů" U016F # LATIN SMALL LETTER U WITH RING ABOVE
+<Multi_key> <o> <u> : "ů" U016F # LATIN SMALL LETTER U WITH RING ABOVE
+<dead_doubleacute> <U> : "Ű" U0170 # LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+<Multi_key> <equal> <U> : "Ű" U0170 # LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
+<dead_doubleacute> <u> : "ű" U0171 # LATIN SMALL LETTER U WITH DOUBLE ACUTE
+<Multi_key> <equal> <u> : "ű" U0171 # LATIN SMALL LETTER U WITH DOUBLE ACUTE
+<dead_ogonek> <U> : "Ų" U0172 # LATIN CAPITAL LETTER U WITH OGONEK
+<Multi_key> <semicolon> <U> : "Ų" U0172 # LATIN CAPITAL LETTER U WITH OGONEK
+<Multi_key> <comma> <U> : "Ų" U0172 # LATIN CAPITAL LETTER U WITH OGONEK
+<dead_ogonek> <u> : "ų" U0173 # LATIN SMALL LETTER U WITH OGONEK
+<Multi_key> <semicolon> <u> : "ų" U0173 # LATIN SMALL LETTER U WITH OGONEK
+<Multi_key> <comma> <u> : "ų" U0173 # LATIN SMALL LETTER U WITH OGONEK
+<dead_circumflex> <W> : "Ŵ" U0174 # LATIN CAPITAL LETTER W WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <W> : "Ŵ" U0174 # LATIN CAPITAL LETTER W WITH CIRCUMFLEX
+<dead_circumflex> <w> : "ŵ" U0175 # LATIN SMALL LETTER W WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <w> : "ŵ" U0175 # LATIN SMALL LETTER W WITH CIRCUMFLEX
+<dead_circumflex> <Y> : "Ŷ" U0176 # LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <Y> : "Ŷ" U0176 # LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
+<dead_circumflex> <y> : "ŷ" U0177 # LATIN SMALL LETTER Y WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <y> : "ŷ" U0177 # LATIN SMALL LETTER Y WITH CIRCUMFLEX
+<dead_diaeresis> <Y> : "Ÿ" U0178 # LATIN CAPITAL LETTER Y WITH DIAERESIS
+<Multi_key> <quotedbl> <Y> : "Ÿ" U0178 # LATIN CAPITAL LETTER Y WITH DIAERESIS
+<dead_acute> <Z> : "Ź" U0179 # LATIN CAPITAL LETTER Z WITH ACUTE
+<Multi_key> <acute> <Z> : "Ź" U0179 # LATIN CAPITAL LETTER Z WITH ACUTE
+<Multi_key> <apostrophe> <Z> : "Ź" U0179 # LATIN CAPITAL LETTER Z WITH ACUTE
+<dead_acute> <z> : "ź" U017A # LATIN SMALL LETTER Z WITH ACUTE
+<Multi_key> <acute> <z> : "ź" U017A # LATIN SMALL LETTER Z WITH ACUTE
+<Multi_key> <apostrophe> <z> : "ź" U017A # LATIN SMALL LETTER Z WITH ACUTE
+<dead_abovedot> <Z> : "Ż" U017B # LATIN CAPITAL LETTER Z WITH DOT ABOVE
+<Multi_key> <period> <Z> : "Ż" U017B # LATIN CAPITAL LETTER Z WITH DOT ABOVE
+<dead_abovedot> <z> : "ż" U017C # LATIN SMALL LETTER Z WITH DOT ABOVE
+<Multi_key> <period> <z> : "ż" U017C # LATIN SMALL LETTER Z WITH DOT ABOVE
+<dead_caron> <Z> : "Ž" U017D # LATIN CAPITAL LETTER Z WITH CARON
+<Multi_key> <c> <Z> : "Ž" U017D # LATIN CAPITAL LETTER Z WITH CARON
+<dead_caron> <z> : "ž" U017E # LATIN SMALL LETTER Z WITH CARON
+<Multi_key> <c> <z> : "ž" U017E # LATIN SMALL LETTER Z WITH CARON
+<dead_stroke> <b> : "ƀ" U0180 # LATIN SMALL LETTER B WITH STROKE
+<Multi_key> <slash> <b> : "ƀ" U0180 # LATIN SMALL LETTER B WITH STROKE
+<Multi_key> <KP_Divide> <b> : "ƀ" U0180 # LATIN SMALL LETTER B WITH STROKE
+<dead_stroke> <I> : "Ɨ" U0197 # LATIN CAPITAL LETTER I WITH STROKE
+<Multi_key> <slash> <I> : "Ɨ" U0197 # LATIN CAPITAL LETTER I WITH STROKE
+<Multi_key> <KP_Divide> <I> : "Ɨ" U0197 # LATIN CAPITAL LETTER I WITH STROKE
+<dead_horn> <O> : "Ơ" U01A0 # LATIN CAPITAL LETTER O WITH HORN
+<Multi_key> <plus> <O> : "Ơ" U01A0 # LATIN CAPITAL LETTER O WITH HORN
+<dead_horn> <o> : "ơ" U01A1 # LATIN SMALL LETTER O WITH HORN
+<Multi_key> <plus> <o> : "ơ" U01A1 # LATIN SMALL LETTER O WITH HORN
+<dead_horn> <U> : "Ư" U01AF # LATIN CAPITAL LETTER U WITH HORN
+<Multi_key> <plus> <U> : "Ư" U01AF # LATIN CAPITAL LETTER U WITH HORN
+<dead_horn> <u> : "ư" U01B0 # LATIN SMALL LETTER U WITH HORN
+<Multi_key> <plus> <u> : "ư" U01B0 # LATIN SMALL LETTER U WITH HORN
+<dead_stroke> <Z> : "Ƶ" U01B5 # LATIN CAPITAL LETTER Z WITH STROKE
+<Multi_key> <slash> <Z> : "Ƶ" U01B5 # LATIN CAPITAL LETTER Z WITH STROKE
+<Multi_key> <KP_Divide> <Z> : "Ƶ" U01B5 # LATIN CAPITAL LETTER Z WITH STROKE
+<dead_stroke> <z> : "ƶ" U01B6 # LATIN SMALL LETTER Z WITH STROKE
+<Multi_key> <slash> <z> : "ƶ" U01B6 # LATIN SMALL LETTER Z WITH STROKE
+<Multi_key> <KP_Divide> <z> : "ƶ" U01B6 # LATIN SMALL LETTER Z WITH STROKE
+<dead_caron> <A> : "Ǎ" U01CD # LATIN CAPITAL LETTER A WITH CARON
+<Multi_key> <c> <A> : "Ǎ" U01CD # LATIN CAPITAL LETTER A WITH CARON
+<dead_caron> <a> : "ǎ" U01CE # LATIN SMALL LETTER A WITH CARON
+<Multi_key> <c> <a> : "ǎ" U01CE # LATIN SMALL LETTER A WITH CARON
+<dead_caron> <I> : "Ǐ" U01CF # LATIN CAPITAL LETTER I WITH CARON
+<Multi_key> <c> <I> : "Ǐ" U01CF # LATIN CAPITAL LETTER I WITH CARON
+<dead_caron> <i> : "ǐ" U01D0 # LATIN SMALL LETTER I WITH CARON
+<Multi_key> <c> <i> : "ǐ" U01D0 # LATIN SMALL LETTER I WITH CARON
+<dead_caron> <O> : "Ǒ" U01D1 # LATIN CAPITAL LETTER O WITH CARON
+<Multi_key> <c> <O> : "Ǒ" U01D1 # LATIN CAPITAL LETTER O WITH CARON
+<dead_caron> <o> : "ǒ" U01D2 # LATIN SMALL LETTER O WITH CARON
+<Multi_key> <c> <o> : "ǒ" U01D2 # LATIN SMALL LETTER O WITH CARON
+<dead_caron> <U> : "Ǔ" U01D3 # LATIN CAPITAL LETTER U WITH CARON
+<Multi_key> <c> <U> : "Ǔ" U01D3 # LATIN CAPITAL LETTER U WITH CARON
+<dead_caron> <u> : "ǔ" U01D4 # LATIN SMALL LETTER U WITH CARON
+<Multi_key> <c> <u> : "ǔ" U01D4 # LATIN SMALL LETTER U WITH CARON
+<dead_macron> <Udiaeresis> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <Udiaeresis> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <Udiaeresis> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
+<dead_macron> <dead_diaeresis> <U> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
+<dead_macron> <Multi_key> <quotedbl> <U> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <dead_diaeresis> <U> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <quotedbl> <U> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <dead_diaeresis> <U> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <quotedbl> <U> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
+<dead_macron> <udiaeresis> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <udiaeresis> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <udiaeresis> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
+<dead_macron> <dead_diaeresis> <u> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
+<dead_macron> <Multi_key> <quotedbl> <u> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <dead_diaeresis> <u> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <quotedbl> <u> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <dead_diaeresis> <u> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <quotedbl> <u> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
+<dead_acute> <Udiaeresis> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
+<Multi_key> <acute> <Udiaeresis> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
+<Multi_key> <apostrophe> <Udiaeresis> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
+<dead_acute> <dead_diaeresis> <U> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
+<dead_acute> <Multi_key> <quotedbl> <U> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
+<Multi_key> <acute> <dead_diaeresis> <U> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
+<Multi_key> <acute> <quotedbl> <U> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
+<Multi_key> <apostrophe> <dead_diaeresis> <U> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
+<Multi_key> <apostrophe> <quotedbl> <U> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
+<dead_acute> <udiaeresis> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
+<Multi_key> <acute> <udiaeresis> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
+<Multi_key> <apostrophe> <udiaeresis> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
+<dead_acute> <dead_diaeresis> <u> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
+<dead_acute> <Multi_key> <quotedbl> <u> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
+<Multi_key> <acute> <dead_diaeresis> <u> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
+<Multi_key> <acute> <quotedbl> <u> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
+<Multi_key> <apostrophe> <dead_diaeresis> <u> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
+<Multi_key> <apostrophe> <quotedbl> <u> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
+<dead_caron> <Udiaeresis> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
+<Multi_key> <c> <Udiaeresis> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
+<dead_caron> <dead_diaeresis> <U> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
+<dead_caron> <Multi_key> <quotedbl> <U> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
+<Multi_key> <c> <dead_diaeresis> <U> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
+<Multi_key> <c> <quotedbl> <U> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
+<dead_caron> <udiaeresis> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
+<Multi_key> <c> <udiaeresis> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
+<dead_caron> <dead_diaeresis> <u> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
+<dead_caron> <Multi_key> <quotedbl> <u> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
+<Multi_key> <c> <dead_diaeresis> <u> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
+<Multi_key> <c> <quotedbl> <u> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
+<dead_grave> <Udiaeresis> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
+<Multi_key> <grave> <Udiaeresis> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
+<dead_grave> <dead_diaeresis> <U> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
+<dead_grave> <Multi_key> <quotedbl> <U> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
+<Multi_key> <grave> <dead_diaeresis> <U> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
+<Multi_key> <grave> <quotedbl> <U> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
+<dead_grave> <udiaeresis> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
+<Multi_key> <grave> <udiaeresis> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
+<dead_grave> <dead_diaeresis> <u> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
+<dead_grave> <Multi_key> <quotedbl> <u> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
+<Multi_key> <grave> <dead_diaeresis> <u> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
+<Multi_key> <grave> <quotedbl> <u> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
+<dead_macron> <Adiaeresis> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <Adiaeresis> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <Adiaeresis> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
+<dead_macron> <dead_diaeresis> <A> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
+<dead_macron> <Multi_key> <quotedbl> <A> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <dead_diaeresis> <A> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <quotedbl> <A> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <dead_diaeresis> <A> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <quotedbl> <A> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
+<dead_macron> <adiaeresis> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <adiaeresis> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <adiaeresis> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
+<dead_macron> <dead_diaeresis> <a> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
+<dead_macron> <Multi_key> <quotedbl> <a> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <dead_diaeresis> <a> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <quotedbl> <a> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <dead_diaeresis> <a> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <quotedbl> <a> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
+<dead_macron> <U0226> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
+<Multi_key> <macron> <U0226> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
+<Multi_key> <underscore> <U0226> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
+<dead_macron> <dead_abovedot> <A> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
+<dead_macron> <Multi_key> <period> <A> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
+<Multi_key> <macron> <dead_abovedot> <A> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
+<Multi_key> <macron> <period> <A> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
+<Multi_key> <underscore> <dead_abovedot> <A> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
+<Multi_key> <underscore> <period> <A> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
+<dead_macron> <U0227> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
+<Multi_key> <macron> <U0227> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
+<Multi_key> <underscore> <U0227> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
+<dead_macron> <dead_abovedot> <a> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
+<dead_macron> <Multi_key> <period> <a> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
+<Multi_key> <macron> <dead_abovedot> <a> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
+<Multi_key> <macron> <period> <a> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
+<Multi_key> <underscore> <dead_abovedot> <a> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
+<Multi_key> <underscore> <period> <a> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
+<dead_macron> <AE> : "Ǣ" U01E2 # LATIN CAPITAL LETTER AE WITH MACRON
+<Multi_key> <macron> <AE> : "Ǣ" U01E2 # LATIN CAPITAL LETTER AE WITH MACRON
+<Multi_key> <underscore> <AE> : "Ǣ" U01E2 # LATIN CAPITAL LETTER AE WITH MACRON
+<dead_macron> <ae> : "ǣ" U01E3 # LATIN SMALL LETTER AE WITH MACRON
+<Multi_key> <macron> <ae> : "ǣ" U01E3 # LATIN SMALL LETTER AE WITH MACRON
+<Multi_key> <underscore> <ae> : "ǣ" U01E3 # LATIN SMALL LETTER AE WITH MACRON
+<dead_stroke> <G> : "Ǥ" U01E4 # LATIN CAPITAL LETTER G WITH STROKE
+<Multi_key> <slash> <G> : "Ǥ" U01E4 # LATIN CAPITAL LETTER G WITH STROKE
+<Multi_key> <KP_Divide> <G> : "Ǥ" U01E4 # LATIN CAPITAL LETTER G WITH STROKE
+<dead_stroke> <g> : "ǥ" U01E5 # LATIN SMALL LETTER G WITH STROKE
+<Multi_key> <slash> <g> : "ǥ" U01E5 # LATIN SMALL LETTER G WITH STROKE
+<Multi_key> <KP_Divide> <g> : "ǥ" U01E5 # LATIN SMALL LETTER G WITH STROKE
+<dead_caron> <G> : "Ǧ" U01E6 # LATIN CAPITAL LETTER G WITH CARON
+<Multi_key> <c> <G> : "Ǧ" U01E6 # LATIN CAPITAL LETTER G WITH CARON
+<dead_caron> <g> : "ǧ" U01E7 # LATIN SMALL LETTER G WITH CARON
+<Multi_key> <c> <g> : "ǧ" U01E7 # LATIN SMALL LETTER G WITH CARON
+<dead_caron> <K> : "Ǩ" U01E8 # LATIN CAPITAL LETTER K WITH CARON
+<Multi_key> <c> <K> : "Ǩ" U01E8 # LATIN CAPITAL LETTER K WITH CARON
+<dead_caron> <k> : "ǩ" U01E9 # LATIN SMALL LETTER K WITH CARON
+<Multi_key> <c> <k> : "ǩ" U01E9 # LATIN SMALL LETTER K WITH CARON
+<dead_ogonek> <O> : "Ǫ" U01EA # LATIN CAPITAL LETTER O WITH OGONEK
+<Multi_key> <semicolon> <O> : "Ǫ" U01EA # LATIN CAPITAL LETTER O WITH OGONEK
+<dead_ogonek> <o> : "ǫ" U01EB # LATIN SMALL LETTER O WITH OGONEK
+<Multi_key> <semicolon> <o> : "ǫ" U01EB # LATIN SMALL LETTER O WITH OGONEK
+<dead_macron> <U01EA> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
+<Multi_key> <macron> <U01EA> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
+<Multi_key> <underscore> <U01EA> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
+<dead_macron> <dead_ogonek> <O> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
+<dead_macron> <Multi_key> <semicolon> <O> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
+<Multi_key> <macron> <dead_ogonek> <O> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
+<Multi_key> <macron> <semicolon> <O> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
+<Multi_key> <underscore> <dead_ogonek> <O> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
+<Multi_key> <underscore> <semicolon> <O> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
+<dead_macron> <U01EB> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
+<Multi_key> <macron> <U01EB> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
+<Multi_key> <underscore> <U01EB> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
+<dead_macron> <dead_ogonek> <o> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
+<dead_macron> <Multi_key> <semicolon> <o> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
+<Multi_key> <macron> <dead_ogonek> <o> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
+<Multi_key> <macron> <semicolon> <o> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
+<Multi_key> <underscore> <dead_ogonek> <o> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
+<Multi_key> <underscore> <semicolon> <o> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
+<dead_caron> <U01B7> : "Ǯ" U01EE # LATIN CAPITAL LETTER EZH WITH CARON
+<Multi_key> <c> <U01B7> : "Ǯ" U01EE # LATIN CAPITAL LETTER EZH WITH CARON
+<dead_caron> <U0292> : "ǯ" U01EF # LATIN SMALL LETTER EZH WITH CARON
+<Multi_key> <c> <U0292> : "ǯ" U01EF # LATIN SMALL LETTER EZH WITH CARON
+<dead_caron> <j> : "ǰ" U01F0 # LATIN SMALL LETTER J WITH CARON
+<Multi_key> <c> <j> : "ǰ" U01F0 # LATIN SMALL LETTER J WITH CARON
+<dead_acute> <G> : "Ǵ" U01F4 # LATIN CAPITAL LETTER G WITH ACUTE
+<Multi_key> <acute> <G> : "Ǵ" U01F4 # LATIN CAPITAL LETTER G WITH ACUTE
+<Multi_key> <apostrophe> <G> : "Ǵ" U01F4 # LATIN CAPITAL LETTER G WITH ACUTE
+<dead_acute> <g> : "ǵ" U01F5 # LATIN SMALL LETTER G WITH ACUTE
+<Multi_key> <acute> <g> : "ǵ" U01F5 # LATIN SMALL LETTER G WITH ACUTE
+<Multi_key> <apostrophe> <g> : "ǵ" U01F5 # LATIN SMALL LETTER G WITH ACUTE
+<dead_grave> <N> : "Ǹ" U01F8 # LATIN CAPITAL LETTER N WITH GRAVE
+<Multi_key> <grave> <N> : "Ǹ" U01F8 # LATIN CAPITAL LETTER N WITH GRAVE
+<dead_grave> <n> : "ǹ" U01F9 # LATIN SMALL LETTER N WITH GRAVE
+<Multi_key> <grave> <n> : "ǹ" U01F9 # LATIN SMALL LETTER N WITH GRAVE
+<dead_acute> <Aring> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
+<Multi_key> <acute> <Aring> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
+<Multi_key> <apostrophe> <Aring> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
+<dead_acute> <dead_abovering> <A> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
+<dead_acute> <Multi_key> <o> <A> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
+<Multi_key> <acute> <dead_abovering> <A> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
+<Multi_key> <apostrophe> <dead_abovering> <A> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
+<Multi_key> <o> <apostrophe> <A> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
+<dead_acute> <aring> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
+<Multi_key> <acute> <aring> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
+<Multi_key> <apostrophe> <aring> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
+<dead_acute> <dead_abovering> <a> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
+<dead_acute> <Multi_key> <o> <a> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
+<Multi_key> <acute> <dead_abovering> <a> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
+<Multi_key> <apostrophe> <dead_abovering> <a> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
+<Multi_key> <o> <apostrophe> <a> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
+<dead_acute> <AE> : "Ǽ" U01FC # LATIN CAPITAL LETTER AE WITH ACUTE
+<Multi_key> <acute> <AE> : "Ǽ" U01FC # LATIN CAPITAL LETTER AE WITH ACUTE
+<Multi_key> <apostrophe> <AE> : "Ǽ" U01FC # LATIN CAPITAL LETTER AE WITH ACUTE
+<dead_acute> <ae> : "ǽ" U01FD # LATIN SMALL LETTER AE WITH ACUTE
+<Multi_key> <acute> <ae> : "ǽ" U01FD # LATIN SMALL LETTER AE WITH ACUTE
+<Multi_key> <apostrophe> <ae> : "ǽ" U01FD # LATIN SMALL LETTER AE WITH ACUTE
+<dead_acute> <Ooblique> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
+<Multi_key> <acute> <Ooblique> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
+<Multi_key> <apostrophe> <Ooblique> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
+<dead_acute> <dead_stroke> <O> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
+<dead_acute> <Multi_key> <slash> <O> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
+<Multi_key> <acute> <slash> <O> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
+<Multi_key> <apostrophe> <slash> <O> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
+<dead_acute> <Multi_key> <KP_Divide> <O> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
+<Multi_key> <acute> <KP_Divide> <O> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
+<Multi_key> <apostrophe> <KP_Divide> <O> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
+<dead_stroke> <dead_acute> <O> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
+<dead_acute> <oslash> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
+<Multi_key> <acute> <oslash> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
+<Multi_key> <apostrophe> <oslash> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
+<dead_acute> <dead_stroke> <o> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
+<dead_acute> <Multi_key> <slash> <o> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
+<Multi_key> <acute> <slash> <o> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
+<Multi_key> <apostrophe> <slash> <o> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
+<dead_acute> <Multi_key> <KP_Divide> <o> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
+<Multi_key> <acute> <KP_Divide> <o> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
+<Multi_key> <apostrophe> <KP_Divide> <o> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
+<dead_stroke> <dead_acute> <o> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
+<dead_double_grave> <A> : "Ȁ" U0200 # LATIN CAPITAL LETTER A WITH DOUBLE GRAVE
+<dead_double_grave> <a> : "ȁ" U0201 # LATIN SMALL LETTER A WITH DOUBLE GRAVE
+<dead_inverted_breve> <A> : "Ȃ" U0202 # LATIN CAPITAL LETTER A WITH INVERTED BREVE
+<dead_inverted_breve> <a> : "ȃ" U0203 # LATIN SMALL LETTER A WITH INVERTED BREVE
+<dead_double_grave> <E> : "Ȅ" U0204 # LATIN CAPITAL LETTER E WITH DOUBLE GRAVE
+<dead_double_grave> <e> : "ȅ" U0205 # LATIN SMALL LETTER E WITH DOUBLE GRAVE
+<dead_inverted_breve> <E> : "Ȇ" U0206 # LATIN CAPITAL LETTER E WITH INVERTED BREVE
+<dead_inverted_breve> <e> : "ȇ" U0207 # LATIN SMALL LETTER E WITH INVERTED BREVE
+<dead_double_grave> <I> : "Ȉ" U0208 # LATIN CAPITAL LETTER I WITH DOUBLE GRAVE
+<dead_double_grave> <i> : "ȉ" U0209 # LATIN SMALL LETTER I WITH DOUBLE GRAVE
+<dead_inverted_breve> <I> : "Ȋ" U020A # LATIN CAPITAL LETTER I WITH INVERTED BREVE
+<dead_inverted_breve> <i> : "ȋ" U020B # LATIN SMALL LETTER I WITH INVERTED BREVE
+<dead_double_grave> <O> : "Ȍ" U020C # LATIN CAPITAL LETTER O WITH DOUBLE GRAVE
+<dead_double_grave> <o> : "ȍ" U020D # LATIN SMALL LETTER O WITH DOUBLE GRAVE
+<dead_inverted_breve> <O> : "Ȏ" U020E # LATIN CAPITAL LETTER O WITH INVERTED BREVE
+<dead_inverted_breve> <o> : "ȏ" U020F # LATIN SMALL LETTER O WITH INVERTED BREVE
+<dead_double_grave> <R> : "Ȑ" U0210 # LATIN CAPITAL LETTER R WITH DOUBLE GRAVE
+<dead_double_grave> <r> : "ȑ" U0211 # LATIN SMALL LETTER R WITH DOUBLE GRAVE
+<dead_inverted_breve> <R> : "Ȓ" U0212 # LATIN CAPITAL LETTER R WITH INVERTED BREVE
+<dead_inverted_breve> <r> : "ȓ" U0213 # LATIN SMALL LETTER R WITH INVERTED BREVE
+<dead_double_grave> <U> : "Ȕ" U0214 # LATIN CAPITAL LETTER U WITH DOUBLE GRAVE
+<dead_double_grave> <u> : "ȕ" U0215 # LATIN SMALL LETTER U WITH DOUBLE GRAVE
+<dead_inverted_breve> <U> : "Ȗ" U0216 # LATIN CAPITAL LETTER U WITH INVERTED BREVE
+<dead_inverted_breve> <u> : "ȗ" U0217 # LATIN SMALL LETTER U WITH INVERTED BREVE
+<dead_caron> <H> : "Ȟ" U021E # LATIN CAPITAL LETTER H WITH CARON
+<Multi_key> <c> <H> : "Ȟ" U021E # LATIN CAPITAL LETTER H WITH CARON
+<dead_caron> <h> : "ȟ" U021F # LATIN SMALL LETTER H WITH CARON
+<Multi_key> <c> <h> : "ȟ" U021F # LATIN SMALL LETTER H WITH CARON
+<dead_abovedot> <A> : "Ȧ" U0226 # LATIN CAPITAL LETTER A WITH DOT ABOVE
+<Multi_key> <period> <A> : "Ȧ" U0226 # LATIN CAPITAL LETTER A WITH DOT ABOVE
+<dead_abovedot> <a> : "ȧ" U0227 # LATIN SMALL LETTER A WITH DOT ABOVE
+<Multi_key> <period> <a> : "ȧ" U0227 # LATIN SMALL LETTER A WITH DOT ABOVE
+<dead_cedilla> <E> : "Ȩ" U0228 # LATIN CAPITAL LETTER E WITH CEDILLA
+<Multi_key> <cedilla> <E> : "Ȩ" U0228 # LATIN CAPITAL LETTER E WITH CEDILLA
+<dead_cedilla> <e> : "ȩ" U0229 # LATIN SMALL LETTER E WITH CEDILLA
+<Multi_key> <cedilla> <e> : "ȩ" U0229 # LATIN SMALL LETTER E WITH CEDILLA
+<dead_macron> <Odiaeresis> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <Odiaeresis> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <Odiaeresis> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
+<dead_macron> <dead_diaeresis> <O> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
+<dead_macron> <Multi_key> <quotedbl> <O> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <dead_diaeresis> <O> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <quotedbl> <O> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <dead_diaeresis> <O> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <quotedbl> <O> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
+<dead_macron> <odiaeresis> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <odiaeresis> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <odiaeresis> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
+<dead_macron> <dead_diaeresis> <o> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
+<dead_macron> <Multi_key> <quotedbl> <o> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <dead_diaeresis> <o> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
+<Multi_key> <macron> <quotedbl> <o> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <dead_diaeresis> <o> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
+<Multi_key> <underscore> <quotedbl> <o> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
+<dead_macron> <Otilde> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
+<Multi_key> <macron> <Otilde> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
+<Multi_key> <underscore> <Otilde> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
+<dead_macron> <dead_tilde> <O> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
+<dead_macron> <Multi_key> <asciitilde> <O> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
+<Multi_key> <macron> <dead_tilde> <O> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
+<Multi_key> <macron> <asciitilde> <O> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
+<Multi_key> <underscore> <dead_tilde> <O> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
+<Multi_key> <underscore> <asciitilde> <O> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
+<dead_macron> <otilde> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
+<Multi_key> <macron> <otilde> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
+<Multi_key> <underscore> <otilde> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
+<dead_macron> <dead_tilde> <o> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
+<dead_macron> <Multi_key> <asciitilde> <o> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
+<Multi_key> <macron> <dead_tilde> <o> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
+<Multi_key> <macron> <asciitilde> <o> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
+<Multi_key> <underscore> <dead_tilde> <o> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
+<Multi_key> <underscore> <asciitilde> <o> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
+<dead_abovedot> <O> : "Ȯ" U022E # LATIN CAPITAL LETTER O WITH DOT ABOVE
+<Multi_key> <period> <O> : "Ȯ" U022E # LATIN CAPITAL LETTER O WITH DOT ABOVE
+<dead_abovedot> <o> : "ȯ" U022F # LATIN SMALL LETTER O WITH DOT ABOVE
+<Multi_key> <period> <o> : "ȯ" U022F # LATIN SMALL LETTER O WITH DOT ABOVE
+<dead_macron> <U022E> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
+<Multi_key> <macron> <U022E> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
+<Multi_key> <underscore> <U022E> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
+<dead_macron> <dead_abovedot> <O> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
+<dead_macron> <Multi_key> <period> <O> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
+<Multi_key> <macron> <dead_abovedot> <O> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
+<Multi_key> <macron> <period> <O> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
+<Multi_key> <underscore> <dead_abovedot> <O> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
+<Multi_key> <underscore> <period> <O> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
+<dead_macron> <U022F> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
+<Multi_key> <macron> <U022F> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
+<Multi_key> <underscore> <U022F> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
+<dead_macron> <dead_abovedot> <o> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
+<dead_macron> <Multi_key> <period> <o> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
+<Multi_key> <macron> <dead_abovedot> <o> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
+<Multi_key> <macron> <period> <o> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
+<Multi_key> <underscore> <dead_abovedot> <o> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
+<Multi_key> <underscore> <period> <o> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
+<dead_macron> <Y> : "Ȳ" U0232 # LATIN CAPITAL LETTER Y WITH MACRON
+<Multi_key> <macron> <Y> : "Ȳ" U0232 # LATIN CAPITAL LETTER Y WITH MACRON
+<Multi_key> <underscore> <Y> : "Ȳ" U0232 # LATIN CAPITAL LETTER Y WITH MACRON
+<dead_macron> <y> : "ȳ" U0233 # LATIN SMALL LETTER Y WITH MACRON
+<Multi_key> <macron> <y> : "ȳ" U0233 # LATIN SMALL LETTER Y WITH MACRON
+<Multi_key> <underscore> <y> : "ȳ" U0233 # LATIN SMALL LETTER Y WITH MACRON
+<Multi_key> <e> <e> : "ə" U0259 # LATIN SMALL LETTER SCHWA
+<dead_stroke> <i> : "ɨ" U0268 # LATIN SMALL LETTER I WITH STROKE
+<Multi_key> <slash> <i> : "ɨ" U0268 # LATIN SMALL LETTER I WITH STROKE
+<Multi_key> <KP_Divide> <i> : "ɨ" U0268 # LATIN SMALL LETTER I WITH STROKE
+<Multi_key> <slash> <U0294> : "ʡ" U02A1 # LATIN LETTER GLOTTAL STOP WITH STROKE
+<Multi_key> <KP_Divide> <U0294> : "ʡ" U02A1 # LATIN LETTER GLOTTAL STOP WITH STROKE
+<dead_circumflex> <Multi_key> <underscore> <h> : "ʰ" U02B0 # MODIFIER LETTER SMALL H
+<Multi_key> <asciicircum> <underscore> <h> : "ʰ" U02B0 # MODIFIER LETTER SMALL H
+<dead_circumflex> <Multi_key> <underbar> <h> : "ʰ" U02B0 # MODIFIER LETTER SMALL H
+<Multi_key> <asciicircum> <underbar> <h> : "ʰ" U02B0 # MODIFIER LETTER SMALL H
+<dead_circumflex> <Multi_key> <underscore> <U0266> : "ʱ" U02B1 # MODIFIER LETTER SMALL H WITH HOOK
+<Multi_key> <asciicircum> <underscore> <U0266> : "ʱ" U02B1 # MODIFIER LETTER SMALL H WITH HOOK
+<dead_circumflex> <Multi_key> <underbar> <U0266> : "ʱ" U02B1 # MODIFIER LETTER SMALL H WITH HOOK
+<Multi_key> <asciicircum> <underbar> <U0266> : "ʱ" U02B1 # MODIFIER LETTER SMALL H WITH HOOK
+<dead_circumflex> <Multi_key> <underscore> <j> : "ʲ" U02B2 # MODIFIER LETTER SMALL J
+<Multi_key> <asciicircum> <underscore> <j> : "ʲ" U02B2 # MODIFIER LETTER SMALL J
+<dead_circumflex> <Multi_key> <underbar> <j> : "ʲ" U02B2 # MODIFIER LETTER SMALL J
+<Multi_key> <asciicircum> <underbar> <j> : "ʲ" U02B2 # MODIFIER LETTER SMALL J
+<dead_circumflex> <Multi_key> <underscore> <r> : "ʳ" U02B3 # MODIFIER LETTER SMALL R
+<Multi_key> <asciicircum> <underscore> <r> : "ʳ" U02B3 # MODIFIER LETTER SMALL R
+<dead_circumflex> <Multi_key> <underbar> <r> : "ʳ" U02B3 # MODIFIER LETTER SMALL R
+<Multi_key> <asciicircum> <underbar> <r> : "ʳ" U02B3 # MODIFIER LETTER SMALL R
+<dead_circumflex> <Multi_key> <underscore> <U0279> : "ʴ" U02B4 # MODIFIER LETTER SMALL TURNED R
+<Multi_key> <asciicircum> <underscore> <U0279> : "ʴ" U02B4 # MODIFIER LETTER SMALL TURNED R
+<dead_circumflex> <Multi_key> <underbar> <U0279> : "ʴ" U02B4 # MODIFIER LETTER SMALL TURNED R
+<Multi_key> <asciicircum> <underbar> <U0279> : "ʴ" U02B4 # MODIFIER LETTER SMALL TURNED R
+<dead_circumflex> <Multi_key> <underscore> <U027B> : "ʵ" U02B5 # MODIFIER LETTER SMALL TURNED R WITH HOOK
+<Multi_key> <asciicircum> <underscore> <U027B> : "ʵ" U02B5 # MODIFIER LETTER SMALL TURNED R WITH HOOK
+<dead_circumflex> <Multi_key> <underbar> <U027B> : "ʵ" U02B5 # MODIFIER LETTER SMALL TURNED R WITH HOOK
+<Multi_key> <asciicircum> <underbar> <U027B> : "ʵ" U02B5 # MODIFIER LETTER SMALL TURNED R WITH HOOK
+<dead_circumflex> <Multi_key> <underscore> <U0281> : "ʶ" U02B6 # MODIFIER LETTER SMALL CAPITAL INVERTED R
+<Multi_key> <asciicircum> <underscore> <U0281> : "ʶ" U02B6 # MODIFIER LETTER SMALL CAPITAL INVERTED R
+<dead_circumflex> <Multi_key> <underbar> <U0281> : "ʶ" U02B6 # MODIFIER LETTER SMALL CAPITAL INVERTED R
+<Multi_key> <asciicircum> <underbar> <U0281> : "ʶ" U02B6 # MODIFIER LETTER SMALL CAPITAL INVERTED R
+<dead_circumflex> <Multi_key> <underscore> <w> : "ʷ" U02B7 # MODIFIER LETTER SMALL W
+<Multi_key> <asciicircum> <underscore> <w> : "ʷ" U02B7 # MODIFIER LETTER SMALL W
+<dead_circumflex> <Multi_key> <underbar> <w> : "ʷ" U02B7 # MODIFIER LETTER SMALL W
+<Multi_key> <asciicircum> <underbar> <w> : "ʷ" U02B7 # MODIFIER LETTER SMALL W
+<dead_circumflex> <Multi_key> <underscore> <y> : "ʸ" U02B8 # MODIFIER LETTER SMALL Y
+<Multi_key> <asciicircum> <underscore> <y> : "ʸ" U02B8 # MODIFIER LETTER SMALL Y
+<dead_circumflex> <Multi_key> <underbar> <y> : "ʸ" U02B8 # MODIFIER LETTER SMALL Y
+<Multi_key> <asciicircum> <underbar> <y> : "ʸ" U02B8 # MODIFIER LETTER SMALL Y
+<dead_circumflex> <Multi_key> <underscore> <U0263> : "ˠ" U02E0 # MODIFIER LETTER SMALL GAMMA
+<Multi_key> <asciicircum> <underscore> <U0263> : "ˠ" U02E0 # MODIFIER LETTER SMALL GAMMA
+<dead_circumflex> <Multi_key> <underbar> <U0263> : "ˠ" U02E0 # MODIFIER LETTER SMALL GAMMA
+<Multi_key> <asciicircum> <underbar> <U0263> : "ˠ" U02E0 # MODIFIER LETTER SMALL GAMMA
+<dead_circumflex> <Multi_key> <underscore> <l> : "ˡ" U02E1 # MODIFIER LETTER SMALL L
+<Multi_key> <asciicircum> <underscore> <l> : "ˡ" U02E1 # MODIFIER LETTER SMALL L
+<dead_circumflex> <Multi_key> <underbar> <l> : "ˡ" U02E1 # MODIFIER LETTER SMALL L
+<Multi_key> <asciicircum> <underbar> <l> : "ˡ" U02E1 # MODIFIER LETTER SMALL L
+<dead_circumflex> <Multi_key> <underscore> <s> : "ˢ" U02E2 # MODIFIER LETTER SMALL S
+<Multi_key> <asciicircum> <underscore> <s> : "ˢ" U02E2 # MODIFIER LETTER SMALL S
+<dead_circumflex> <Multi_key> <underbar> <s> : "ˢ" U02E2 # MODIFIER LETTER SMALL S
+<Multi_key> <asciicircum> <underbar> <s> : "ˢ" U02E2 # MODIFIER LETTER SMALL S
+<dead_circumflex> <Multi_key> <underscore> <x> : "ˣ" U02E3 # MODIFIER LETTER SMALL X
+<Multi_key> <asciicircum> <underscore> <x> : "ˣ" U02E3 # MODIFIER LETTER SMALL X
+<dead_circumflex> <Multi_key> <underbar> <x> : "ˣ" U02E3 # MODIFIER LETTER SMALL X
+<Multi_key> <asciicircum> <underbar> <x> : "ˣ" U02E3 # MODIFIER LETTER SMALL X
+<dead_circumflex> <Multi_key> <underscore> <U0295> : "ˤ" U02E4 # MODIFIER LETTER SMALL REVERSED GLOTTAL STOP
+<Multi_key> <asciicircum> <underscore> <U0295> : "ˤ" U02E4 # MODIFIER LETTER SMALL REVERSED GLOTTAL STOP
+<dead_circumflex> <Multi_key> <underbar> <U0295> : "ˤ" U02E4 # MODIFIER LETTER SMALL REVERSED GLOTTAL STOP
+<Multi_key> <asciicircum> <underbar> <U0295> : "ˤ" U02E4 # MODIFIER LETTER SMALL REVERSED GLOTTAL STOP
+<dead_diaeresis> <acute> : "̈́" U0344 # COMBINING GREEK DIALYTIKA TONOS
+<dead_diaeresis> <apostrophe> : "̈́" U0344 # COMBINING GREEK DIALYTIKA TONOS
+<Multi_key> <quotedbl> <dead_acute> : "̈́" U0344 # COMBINING GREEK DIALYTIKA TONOS
+<Multi_key> <quotedbl> <acute> : "̈́" U0344 # COMBINING GREEK DIALYTIKA TONOS
+<Multi_key> <quotedbl> <apostrophe> : "̈́" U0344 # COMBINING GREEK DIALYTIKA TONOS
+<Multi_key> <diaeresis> <dead_acute> : "΅" U0385 # GREEK DIALYTIKA TONOS
+<Multi_key> <diaeresis> <acute> : "΅" U0385 # GREEK DIALYTIKA TONOS
+<Multi_key> <diaeresis> <apostrophe> : "΅" U0385 # GREEK DIALYTIKA TONOS
+<dead_acute> <Greek_ALPHA> : "Ά" U0386 # GREEK CAPITAL LETTER ALPHA WITH TONOS
+<Multi_key> <acute> <Greek_ALPHA> : "Ά" U0386 # GREEK CAPITAL LETTER ALPHA WITH TONOS
+<Multi_key> <apostrophe> <Greek_ALPHA> : "Ά" U0386 # GREEK CAPITAL LETTER ALPHA WITH TONOS
+<dead_acute> <Greek_EPSILON> : "Έ" U0388 # GREEK CAPITAL LETTER EPSILON WITH TONOS
+<Multi_key> <acute> <Greek_EPSILON> : "Έ" U0388 # GREEK CAPITAL LETTER EPSILON WITH TONOS
+<Multi_key> <apostrophe> <Greek_EPSILON> : "Έ" U0388 # GREEK CAPITAL LETTER EPSILON WITH TONOS
+<dead_acute> <Greek_ETA> : "Ή" U0389 # GREEK CAPITAL LETTER ETA WITH TONOS
+<Multi_key> <acute> <Greek_ETA> : "Ή" U0389 # GREEK CAPITAL LETTER ETA WITH TONOS
+<Multi_key> <apostrophe> <Greek_ETA> : "Ή" U0389 # GREEK CAPITAL LETTER ETA WITH TONOS
+<dead_acute> <Greek_IOTA> : "Ί" U038A # GREEK CAPITAL LETTER IOTA WITH TONOS
+<Multi_key> <acute> <Greek_IOTA> : "Ί" U038A # GREEK CAPITAL LETTER IOTA WITH TONOS
+<Multi_key> <apostrophe> <Greek_IOTA> : "Ί" U038A # GREEK CAPITAL LETTER IOTA WITH TONOS
+<dead_acute> <Greek_OMICRON> : "Ό" U038C # GREEK CAPITAL LETTER OMICRON WITH TONOS
+<Multi_key> <acute> <Greek_OMICRON> : "Ό" U038C # GREEK CAPITAL LETTER OMICRON WITH TONOS
+<Multi_key> <apostrophe> <Greek_OMICRON> : "Ό" U038C # GREEK CAPITAL LETTER OMICRON WITH TONOS
+<dead_acute> <Greek_UPSILON> : "Ύ" U038E # GREEK CAPITAL LETTER UPSILON WITH TONOS
+<Multi_key> <acute> <Greek_UPSILON> : "Ύ" U038E # GREEK CAPITAL LETTER UPSILON WITH TONOS
+<Multi_key> <apostrophe> <Greek_UPSILON> : "Ύ" U038E # GREEK CAPITAL LETTER UPSILON WITH TONOS
+<dead_acute> <Greek_OMEGA> : "Ώ" U038F # GREEK CAPITAL LETTER OMEGA WITH TONOS
+<Multi_key> <acute> <Greek_OMEGA> : "Ώ" U038F # GREEK CAPITAL LETTER OMEGA WITH TONOS
+<Multi_key> <apostrophe> <Greek_OMEGA> : "Ώ" U038F # GREEK CAPITAL LETTER OMEGA WITH TONOS
+<dead_acute> <Greek_iotadieresis> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+<Multi_key> <acute> <Greek_iotadieresis> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+<Multi_key> <apostrophe> <Greek_iotadieresis> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+<dead_acute> <dead_diaeresis> <Greek_iota> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+<dead_acute> <Multi_key> <quotedbl> <Greek_iota> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+<Multi_key> <acute> <dead_diaeresis> <Greek_iota> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+<Multi_key> <acute> <quotedbl> <Greek_iota> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+<Multi_key> <apostrophe> <dead_diaeresis> <Greek_iota> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+<Multi_key> <apostrophe> <quotedbl> <Greek_iota> : "ΐ" U0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
+<dead_diaeresis> <Greek_IOTA> : "Ϊ" U03AA # GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
+<Multi_key> <quotedbl> <Greek_IOTA> : "Ϊ" U03AA # GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
+<dead_diaeresis> <Greek_UPSILON> : "Ϋ" U03AB # GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
+<Multi_key> <quotedbl> <Greek_UPSILON> : "Ϋ" U03AB # GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
+<dead_acute> <Greek_alpha> : "ά" U03AC # GREEK SMALL LETTER ALPHA WITH TONOS
+<Multi_key> <acute> <Greek_alpha> : "ά" U03AC # GREEK SMALL LETTER ALPHA WITH TONOS
+<Multi_key> <apostrophe> <Greek_alpha> : "ά" U03AC # GREEK SMALL LETTER ALPHA WITH TONOS
+<dead_acute> <Greek_epsilon> : "έ" U03AD # GREEK SMALL LETTER EPSILON WITH TONOS
+<Multi_key> <acute> <Greek_epsilon> : "έ" U03AD # GREEK SMALL LETTER EPSILON WITH TONOS
+<Multi_key> <apostrophe> <Greek_epsilon> : "έ" U03AD # GREEK SMALL LETTER EPSILON WITH TONOS
+<dead_acute> <Greek_eta> : "ή" U03AE # GREEK SMALL LETTER ETA WITH TONOS
+<Multi_key> <acute> <Greek_eta> : "ή" U03AE # GREEK SMALL LETTER ETA WITH TONOS
+<Multi_key> <apostrophe> <Greek_eta> : "ή" U03AE # GREEK SMALL LETTER ETA WITH TONOS
+<dead_acute> <Greek_iota> : "ί" U03AF # GREEK SMALL LETTER IOTA WITH TONOS
+<Multi_key> <acute> <Greek_iota> : "ί" U03AF # GREEK SMALL LETTER IOTA WITH TONOS
+<Multi_key> <apostrophe> <Greek_iota> : "ί" U03AF # GREEK SMALL LETTER IOTA WITH TONOS
+<dead_acute> <Greek_upsilondieresis> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+<Multi_key> <acute> <Greek_upsilondieresis> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+<Multi_key> <apostrophe> <Greek_upsilondieresis> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+<dead_acute> <dead_diaeresis> <Greek_upsilon> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+<dead_acute> <Multi_key> <quotedbl> <Greek_upsilon> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+<Multi_key> <acute> <dead_diaeresis> <Greek_upsilon> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+<Multi_key> <acute> <quotedbl> <Greek_upsilon> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+<Multi_key> <apostrophe> <dead_diaeresis> <Greek_upsilon> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+<Multi_key> <apostrophe> <quotedbl> <Greek_upsilon> : "ΰ" U03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
+<dead_diaeresis> <Greek_iota> : "ϊ" U03CA # GREEK SMALL LETTER IOTA WITH DIALYTIKA
+<Multi_key> <quotedbl> <Greek_iota> : "ϊ" U03CA # GREEK SMALL LETTER IOTA WITH DIALYTIKA
+<dead_diaeresis> <Greek_upsilon> : "ϋ" U03CB # GREEK SMALL LETTER UPSILON WITH DIALYTIKA
+<Multi_key> <quotedbl> <Greek_upsilon> : "ϋ" U03CB # GREEK SMALL LETTER UPSILON WITH DIALYTIKA
+<dead_acute> <Greek_omicron> : "ό" U03CC # GREEK SMALL LETTER OMICRON WITH TONOS
+<Multi_key> <acute> <Greek_omicron> : "ό" U03CC # GREEK SMALL LETTER OMICRON WITH TONOS
+<Multi_key> <apostrophe> <Greek_omicron> : "ό" U03CC # GREEK SMALL LETTER OMICRON WITH TONOS
+<dead_acute> <Greek_upsilon> : "ύ" U03CD # GREEK SMALL LETTER UPSILON WITH TONOS
+<Multi_key> <acute> <Greek_upsilon> : "ύ" U03CD # GREEK SMALL LETTER UPSILON WITH TONOS
+<Multi_key> <apostrophe> <Greek_upsilon> : "ύ" U03CD # GREEK SMALL LETTER UPSILON WITH TONOS
+<dead_acute> <Greek_omega> : "ώ" U03CE # GREEK SMALL LETTER OMEGA WITH TONOS
+<Multi_key> <acute> <Greek_omega> : "ώ" U03CE # GREEK SMALL LETTER OMEGA WITH TONOS
+<Multi_key> <apostrophe> <Greek_omega> : "ώ" U03CE # GREEK SMALL LETTER OMEGA WITH TONOS
+<Multi_key> <quotedbl> <U03D2> : "ϔ" U03D4 # GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL
+<dead_grave> <Cyrillic_IE> : "Ѐ" U0400 # CYRILLIC CAPITAL LETTER IE WITH GRAVE
+<Multi_key> <grave> <Cyrillic_IE> : "Ѐ" U0400 # CYRILLIC CAPITAL LETTER IE WITH GRAVE
+<dead_diaeresis> <Cyrillic_IE> : "Ё" U0401 # CYRILLIC CAPITAL LETTER IO
+<Multi_key> <quotedbl> <Cyrillic_IE> : "Ё" U0401 # CYRILLIC CAPITAL LETTER IO
+<dead_acute> <Cyrillic_GHE> : "Ѓ" U0403 # CYRILLIC CAPITAL LETTER GJE
+<Multi_key> <acute> <Cyrillic_GHE> : "Ѓ" U0403 # CYRILLIC CAPITAL LETTER GJE
+<Multi_key> <apostrophe> <Cyrillic_GHE> : "Ѓ" U0403 # CYRILLIC CAPITAL LETTER GJE
+<dead_diaeresis> <Ukrainian_I> : "Ї" U0407 # CYRILLIC CAPITAL LETTER YI
+<Multi_key> <quotedbl> <Ukrainian_I> : "Ї" U0407 # CYRILLIC CAPITAL LETTER YI
+<dead_acute> <Cyrillic_KA> : "Ќ" U040C # CYRILLIC CAPITAL LETTER KJE
+<Multi_key> <acute> <Cyrillic_KA> : "Ќ" U040C # CYRILLIC CAPITAL LETTER KJE
+<Multi_key> <apostrophe> <Cyrillic_KA> : "Ќ" U040C # CYRILLIC CAPITAL LETTER KJE
+<dead_grave> <Cyrillic_I> : "Ѝ" U040D # CYRILLIC CAPITAL LETTER I WITH GRAVE
+<Multi_key> <grave> <Cyrillic_I> : "Ѝ" U040D # CYRILLIC CAPITAL LETTER I WITH GRAVE
+<dead_breve> <Cyrillic_U> : "Ў" U040E # CYRILLIC CAPITAL LETTER SHORT U
+<Multi_key> <U> <Cyrillic_U> : "Ў" U040E # CYRILLIC CAPITAL LETTER SHORT U
+<Multi_key> <b> <Cyrillic_U> : "Ў" U040E # CYRILLIC CAPITAL LETTER SHORT U
+<dead_breve> <Cyrillic_I> : "Й" U0419 # CYRILLIC CAPITAL LETTER SHORT I
+<Multi_key> <U> <Cyrillic_I> : "Й" U0419 # CYRILLIC CAPITAL LETTER SHORT I
+<Multi_key> <b> <Cyrillic_I> : "Й" U0419 # CYRILLIC CAPITAL LETTER SHORT I
+<dead_breve> <Cyrillic_i> : "й" U0439 # CYRILLIC SMALL LETTER SHORT I
+<Multi_key> <U> <Cyrillic_i> : "й" U0439 # CYRILLIC SMALL LETTER SHORT I
+<Multi_key> <b> <Cyrillic_i> : "й" U0439 # CYRILLIC SMALL LETTER SHORT I
+<dead_grave> <Cyrillic_ie> : "ѐ" U0450 # CYRILLIC SMALL LETTER IE WITH GRAVE
+<Multi_key> <grave> <Cyrillic_ie> : "ѐ" U0450 # CYRILLIC SMALL LETTER IE WITH GRAVE
+<dead_diaeresis> <Cyrillic_ie> : "ё" U0451 # CYRILLIC SMALL LETTER IO
+<Multi_key> <quotedbl> <Cyrillic_ie> : "ё" U0451 # CYRILLIC SMALL LETTER IO
+<dead_acute> <Cyrillic_ghe> : "ѓ" U0453 # CYRILLIC SMALL LETTER GJE
+<Multi_key> <acute> <Cyrillic_ghe> : "ѓ" U0453 # CYRILLIC SMALL LETTER GJE
+<Multi_key> <apostrophe> <Cyrillic_ghe> : "ѓ" U0453 # CYRILLIC SMALL LETTER GJE
+<dead_diaeresis> <Ukrainian_i> : "ї" U0457 # CYRILLIC SMALL LETTER YI
+<Multi_key> <quotedbl> <Ukrainian_i> : "ї" U0457 # CYRILLIC SMALL LETTER YI
+<dead_acute> <Cyrillic_ka> : "ќ" U045C # CYRILLIC SMALL LETTER KJE
+<Multi_key> <acute> <Cyrillic_ka> : "ќ" U045C # CYRILLIC SMALL LETTER KJE
+<Multi_key> <apostrophe> <Cyrillic_ka> : "ќ" U045C # CYRILLIC SMALL LETTER KJE
+<dead_grave> <Cyrillic_i> : "ѝ" U045D # CYRILLIC SMALL LETTER I WITH GRAVE
+<Multi_key> <grave> <Cyrillic_i> : "ѝ" U045D # CYRILLIC SMALL LETTER I WITH GRAVE
+<dead_breve> <Cyrillic_u> : "ў" U045E # CYRILLIC SMALL LETTER SHORT U
+<Multi_key> <U> <Cyrillic_u> : "ў" U045E # CYRILLIC SMALL LETTER SHORT U
+<Multi_key> <b> <Cyrillic_u> : "ў" U045E # CYRILLIC SMALL LETTER SHORT U
+<dead_double_grave> <U0474> : "Ѷ" U0476 # CYRILLIC CAPITAL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT
+<dead_double_grave> <U0475> : "ѷ" U0477 # CYRILLIC SMALL LETTER IZHITSA WITH DOUBLE GRAVE ACCENT
+<Multi_key> <slash> <Cyrillic_GHE> : "Ғ" U0492 # CYRILLIC CAPITAL LETTER GHE WITH STROKE
+<Multi_key> <KP_Divide> <Cyrillic_GHE> : "Ғ" U0492 # CYRILLIC CAPITAL LETTER GHE WITH STROKE
+<Multi_key> <slash> <Cyrillic_ghe> : "ғ" U0493 # CYRILLIC SMALL LETTER GHE WITH STROKE
+<Multi_key> <KP_Divide> <Cyrillic_ghe> : "ғ" U0493 # CYRILLIC SMALL LETTER GHE WITH STROKE
+<Multi_key> <slash> <Cyrillic_KA> : "Ҟ" U049E # CYRILLIC CAPITAL LETTER KA WITH STROKE
+<Multi_key> <KP_Divide> <Cyrillic_KA> : "Ҟ" U049E # CYRILLIC CAPITAL LETTER KA WITH STROKE
+<Multi_key> <slash> <Cyrillic_ka> : "ҟ" U049F # CYRILLIC SMALL LETTER KA WITH STROKE
+<Multi_key> <KP_Divide> <Cyrillic_ka> : "ҟ" U049F # CYRILLIC SMALL LETTER KA WITH STROKE
+<Multi_key> <slash> <U04AE> : "Ұ" U04B0 # CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE
+<Multi_key> <KP_Divide> <U04AE> : "Ұ" U04B0 # CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE
+<Multi_key> <slash> <U04AF> : "ұ" U04B1 # CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE
+<Multi_key> <KP_Divide> <U04AF> : "ұ" U04B1 # CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE
+<dead_breve> <Cyrillic_ZHE> : "Ӂ" U04C1 # CYRILLIC CAPITAL LETTER ZHE WITH BREVE
+<Multi_key> <U> <Cyrillic_ZHE> : "Ӂ" U04C1 # CYRILLIC CAPITAL LETTER ZHE WITH BREVE
+<Multi_key> <b> <Cyrillic_ZHE> : "Ӂ" U04C1 # CYRILLIC CAPITAL LETTER ZHE WITH BREVE
+<dead_breve> <Cyrillic_zhe> : "ӂ" U04C2 # CYRILLIC SMALL LETTER ZHE WITH BREVE
+<Multi_key> <U> <Cyrillic_zhe> : "ӂ" U04C2 # CYRILLIC SMALL LETTER ZHE WITH BREVE
+<Multi_key> <b> <Cyrillic_zhe> : "ӂ" U04C2 # CYRILLIC SMALL LETTER ZHE WITH BREVE
+<dead_breve> <Cyrillic_A> : "Ӑ" U04D0 # CYRILLIC CAPITAL LETTER A WITH BREVE
+<Multi_key> <U> <Cyrillic_A> : "Ӑ" U04D0 # CYRILLIC CAPITAL LETTER A WITH BREVE
+<Multi_key> <b> <Cyrillic_A> : "Ӑ" U04D0 # CYRILLIC CAPITAL LETTER A WITH BREVE
+<dead_breve> <Cyrillic_a> : "ӑ" U04D1 # CYRILLIC SMALL LETTER A WITH BREVE
+<Multi_key> <U> <Cyrillic_a> : "ӑ" U04D1 # CYRILLIC SMALL LETTER A WITH BREVE
+<Multi_key> <b> <Cyrillic_a> : "ӑ" U04D1 # CYRILLIC SMALL LETTER A WITH BREVE
+<dead_diaeresis> <Cyrillic_A> : "Ӓ" U04D2 # CYRILLIC CAPITAL LETTER A WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_A> : "Ӓ" U04D2 # CYRILLIC CAPITAL LETTER A WITH DIAERESIS
+<dead_diaeresis> <Cyrillic_a> : "ӓ" U04D3 # CYRILLIC SMALL LETTER A WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_a> : "ӓ" U04D3 # CYRILLIC SMALL LETTER A WITH DIAERESIS
+<dead_breve> <Cyrillic_IE> : "Ӗ" U04D6 # CYRILLIC CAPITAL LETTER IE WITH BREVE
+<Multi_key> <U> <Cyrillic_IE> : "Ӗ" U04D6 # CYRILLIC CAPITAL LETTER IE WITH BREVE
+<Multi_key> <b> <Cyrillic_IE> : "Ӗ" U04D6 # CYRILLIC CAPITAL LETTER IE WITH BREVE
+<dead_breve> <Cyrillic_ie> : "ӗ" U04D7 # CYRILLIC SMALL LETTER IE WITH BREVE
+<Multi_key> <U> <Cyrillic_ie> : "ӗ" U04D7 # CYRILLIC SMALL LETTER IE WITH BREVE
+<Multi_key> <b> <Cyrillic_ie> : "ӗ" U04D7 # CYRILLIC SMALL LETTER IE WITH BREVE
+<dead_diaeresis> <U04D8> : "Ӛ" U04DA # CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS
+<Multi_key> <quotedbl> <U04D8> : "Ӛ" U04DA # CYRILLIC CAPITAL LETTER SCHWA WITH DIAERESIS
+<dead_diaeresis> <U04D9> : "ӛ" U04DB # CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS
+<Multi_key> <quotedbl> <U04D9> : "ӛ" U04DB # CYRILLIC SMALL LETTER SCHWA WITH DIAERESIS
+<dead_diaeresis> <Cyrillic_ZHE> : "Ӝ" U04DC # CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_ZHE> : "Ӝ" U04DC # CYRILLIC CAPITAL LETTER ZHE WITH DIAERESIS
+<dead_diaeresis> <Cyrillic_zhe> : "ӝ" U04DD # CYRILLIC SMALL LETTER ZHE WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_zhe> : "ӝ" U04DD # CYRILLIC SMALL LETTER ZHE WITH DIAERESIS
+<dead_diaeresis> <Cyrillic_ZE> : "Ӟ" U04DE # CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_ZE> : "Ӟ" U04DE # CYRILLIC CAPITAL LETTER ZE WITH DIAERESIS
+<dead_diaeresis> <Cyrillic_ze> : "ӟ" U04DF # CYRILLIC SMALL LETTER ZE WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_ze> : "ӟ" U04DF # CYRILLIC SMALL LETTER ZE WITH DIAERESIS
+<dead_macron> <Cyrillic_I> : "Ӣ" U04E2 # CYRILLIC CAPITAL LETTER I WITH MACRON
+<Multi_key> <macron> <Cyrillic_I> : "Ӣ" U04E2 # CYRILLIC CAPITAL LETTER I WITH MACRON
+<Multi_key> <underscore> <Cyrillic_I> : "Ӣ" U04E2 # CYRILLIC CAPITAL LETTER I WITH MACRON
+<dead_macron> <Cyrillic_i> : "ӣ" U04E3 # CYRILLIC SMALL LETTER I WITH MACRON
+<Multi_key> <macron> <Cyrillic_i> : "ӣ" U04E3 # CYRILLIC SMALL LETTER I WITH MACRON
+<Multi_key> <underscore> <Cyrillic_i> : "ӣ" U04E3 # CYRILLIC SMALL LETTER I WITH MACRON
+<dead_diaeresis> <Cyrillic_I> : "Ӥ" U04E4 # CYRILLIC CAPITAL LETTER I WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_I> : "Ӥ" U04E4 # CYRILLIC CAPITAL LETTER I WITH DIAERESIS
+<dead_diaeresis> <Cyrillic_i> : "ӥ" U04E5 # CYRILLIC SMALL LETTER I WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_i> : "ӥ" U04E5 # CYRILLIC SMALL LETTER I WITH DIAERESIS
+<dead_diaeresis> <Cyrillic_O> : "Ӧ" U04E6 # CYRILLIC CAPITAL LETTER O WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_O> : "Ӧ" U04E6 # CYRILLIC CAPITAL LETTER O WITH DIAERESIS
+<dead_diaeresis> <Cyrillic_o> : "ӧ" U04E7 # CYRILLIC SMALL LETTER O WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_o> : "ӧ" U04E7 # CYRILLIC SMALL LETTER O WITH DIAERESIS
+<dead_diaeresis> <U04E8> : "Ӫ" U04EA # CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS
+<Multi_key> <quotedbl> <U04E8> : "Ӫ" U04EA # CYRILLIC CAPITAL LETTER BARRED O WITH DIAERESIS
+<dead_diaeresis> <U04E9> : "ӫ" U04EB # CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS
+<Multi_key> <quotedbl> <U04E9> : "ӫ" U04EB # CYRILLIC SMALL LETTER BARRED O WITH DIAERESIS
+<dead_diaeresis> <Cyrillic_E> : "Ӭ" U04EC # CYRILLIC CAPITAL LETTER E WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_E> : "Ӭ" U04EC # CYRILLIC CAPITAL LETTER E WITH DIAERESIS
+<dead_diaeresis> <Cyrillic_e> : "ӭ" U04ED # CYRILLIC SMALL LETTER E WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_e> : "ӭ" U04ED # CYRILLIC SMALL LETTER E WITH DIAERESIS
+<dead_macron> <Cyrillic_U> : "Ӯ" U04EE # CYRILLIC CAPITAL LETTER U WITH MACRON
+<Multi_key> <macron> <Cyrillic_U> : "Ӯ" U04EE # CYRILLIC CAPITAL LETTER U WITH MACRON
+<Multi_key> <underscore> <Cyrillic_U> : "Ӯ" U04EE # CYRILLIC CAPITAL LETTER U WITH MACRON
+<dead_macron> <Cyrillic_u> : "ӯ" U04EF # CYRILLIC SMALL LETTER U WITH MACRON
+<Multi_key> <macron> <Cyrillic_u> : "ӯ" U04EF # CYRILLIC SMALL LETTER U WITH MACRON
+<Multi_key> <underscore> <Cyrillic_u> : "ӯ" U04EF # CYRILLIC SMALL LETTER U WITH MACRON
+<dead_diaeresis> <Cyrillic_U> : "Ӱ" U04F0 # CYRILLIC CAPITAL LETTER U WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_U> : "Ӱ" U04F0 # CYRILLIC CAPITAL LETTER U WITH DIAERESIS
+<dead_diaeresis> <Cyrillic_u> : "ӱ" U04F1 # CYRILLIC SMALL LETTER U WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_u> : "ӱ" U04F1 # CYRILLIC SMALL LETTER U WITH DIAERESIS
+<dead_doubleacute> <Cyrillic_U> : "Ӳ" U04F2 # CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE
+<Multi_key> <equal> <Cyrillic_U> : "Ӳ" U04F2 # CYRILLIC CAPITAL LETTER U WITH DOUBLE ACUTE
+<dead_doubleacute> <Cyrillic_u> : "ӳ" U04F3 # CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE
+<Multi_key> <equal> <Cyrillic_u> : "ӳ" U04F3 # CYRILLIC SMALL LETTER U WITH DOUBLE ACUTE
+<dead_diaeresis> <Cyrillic_CHE> : "Ӵ" U04F4 # CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_CHE> : "Ӵ" U04F4 # CYRILLIC CAPITAL LETTER CHE WITH DIAERESIS
+<dead_diaeresis> <Cyrillic_che> : "ӵ" U04F5 # CYRILLIC SMALL LETTER CHE WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_che> : "ӵ" U04F5 # CYRILLIC SMALL LETTER CHE WITH DIAERESIS
+<dead_diaeresis> <Cyrillic_YERU> : "Ӹ" U04F8 # CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_YERU> : "Ӹ" U04F8 # CYRILLIC CAPITAL LETTER YERU WITH DIAERESIS
+<dead_diaeresis> <Cyrillic_yeru> : "ӹ" U04F9 # CYRILLIC SMALL LETTER YERU WITH DIAERESIS
+<Multi_key> <quotedbl> <Cyrillic_yeru> : "ӹ" U04F9 # CYRILLIC SMALL LETTER YERU WITH DIAERESIS
+<Multi_key> <U0653> <Arabic_alef> : "آ" U0622 # ARABIC LETTER ALEF WITH MADDA ABOVE
+<Multi_key> <U0654> <Arabic_alef> : "أ" U0623 # ARABIC LETTER ALEF WITH HAMZA ABOVE
+<Multi_key> <U0654> <Arabic_waw> : "ؤ" U0624 # ARABIC LETTER WAW WITH HAMZA ABOVE
+<Multi_key> <U0655> <Arabic_alef> : "إ" U0625 # ARABIC LETTER ALEF WITH HAMZA BELOW
+<Multi_key> <U0654> <Arabic_yeh> : "ئ" U0626 # ARABIC LETTER YEH WITH HAMZA ABOVE
+<Multi_key> <U0654> <U06D5> : "ۀ" U06C0 # ARABIC LETTER HEH WITH YEH ABOVE
+<Multi_key> <U0654> <U06C1> : "ۂ" U06C2 # ARABIC LETTER HEH GOAL WITH HAMZA ABOVE
+<Multi_key> <U0654> <U06D2> : "ۓ" U06D3 # ARABIC LETTER YEH BARREE WITH HAMZA ABOVE
+<Multi_key> <U093C> <U0928> : "ऩ" U0929 # DEVANAGARI LETTER NNNA
+<Multi_key> <U093C> <U0930> : "ऱ" U0931 # DEVANAGARI LETTER RRA
+<Multi_key> <U093C> <U0933> : "ऴ" U0934 # DEVANAGARI LETTER LLLA
+<Multi_key> <U093C> <U0915> : "क़" U0958 # DEVANAGARI LETTER QA
+<Multi_key> <U093C> <U0916> : "ख़" U0959 # DEVANAGARI LETTER KHHA
+<Multi_key> <U093C> <U0917> : "ग़" U095A # DEVANAGARI LETTER GHHA
+<Multi_key> <U093C> <U091C> : "ज़" U095B # DEVANAGARI LETTER ZA
+<Multi_key> <U093C> <U0921> : "ड़" U095C # DEVANAGARI LETTER DDDHA
+<Multi_key> <U093C> <U0922> : "ढ़" U095D # DEVANAGARI LETTER RHA
+<Multi_key> <U093C> <U092B> : "फ़" U095E # DEVANAGARI LETTER FA
+<Multi_key> <U093C> <U092F> : "य़" U095F # DEVANAGARI LETTER YYA
+<Multi_key> <U09C7> <U09BE> : "ো" U09CB # BENGALI VOWEL SIGN O
+<Multi_key> <U09C7> <U09D7> : "ৌ" U09CC # BENGALI VOWEL SIGN AU
+<Multi_key> <U09BC> <U09A1> : "ড়" U09DC # BENGALI LETTER RRA
+<Multi_key> <U09BC> <U09A2> : "ঢ়" U09DD # BENGALI LETTER RHA
+<Multi_key> <U09BC> <U09AF> : "য়" U09DF # BENGALI LETTER YYA
+<Multi_key> <U0A3C> <U0A32> : "ਲ਼" U0A33 # GURMUKHI LETTER LLA
+<Multi_key> <U0A3C> <U0A38> : "ਸ਼" U0A36 # GURMUKHI LETTER SHA
+<Multi_key> <U0A3C> <U0A16> : "ਖ਼" U0A59 # GURMUKHI LETTER KHHA
+<Multi_key> <U0A3C> <U0A17> : "ਗ਼" U0A5A # GURMUKHI LETTER GHHA
+<Multi_key> <U0A3C> <U0A1C> : "ਜ਼" U0A5B # GURMUKHI LETTER ZA
+<Multi_key> <U0A3C> <U0A2B> : "ਫ਼" U0A5E # GURMUKHI LETTER FA
+<Multi_key> <U0B47> <U0B56> : "ୈ" U0B48 # ORIYA VOWEL SIGN AI
+<Multi_key> <U0B47> <U0B3E> : "ୋ" U0B4B # ORIYA VOWEL SIGN O
+<Multi_key> <U0B47> <U0B57> : "ୌ" U0B4C # ORIYA VOWEL SIGN AU
+<Multi_key> <U0B3C> <U0B21> : "ଡ଼" U0B5C # ORIYA LETTER RRA
+<Multi_key> <U0B3C> <U0B22> : "ଢ଼" U0B5D # ORIYA LETTER RHA
+<Multi_key> <U0BD7> <U0B92> : "ஔ" U0B94 # TAMIL LETTER AU
+<Multi_key> <U0BC6> <U0BBE> : "ொ" U0BCA # TAMIL VOWEL SIGN O
+<Multi_key> <U0BC7> <U0BBE> : "ோ" U0BCB # TAMIL VOWEL SIGN OO
+<Multi_key> <U0BC6> <U0BD7> : "ௌ" U0BCC # TAMIL VOWEL SIGN AU
+<Multi_key> <U0C46> <U0C56> : "ై" U0C48 # TELUGU VOWEL SIGN AI
+<Multi_key> <U0CBF> <U0CD5> : "ೀ" U0CC0 # KANNADA VOWEL SIGN II
+<Multi_key> <U0CC6> <U0CD5> : "ೇ" U0CC7 # KANNADA VOWEL SIGN EE
+<Multi_key> <U0CC6> <U0CD6> : "ೈ" U0CC8 # KANNADA VOWEL SIGN AI
+<Multi_key> <U0CC6> <U0CC2> : "ೊ" U0CCA # KANNADA VOWEL SIGN O
+<Multi_key> <U0CCA> <U0CD5> : "ೋ" U0CCB # KANNADA VOWEL SIGN OO
+/* <Multi_key> <U0CC6> <U0CC2> <U0CD5> : "ೋ" U0CCB # KANNADA VOWEL SIGN OO */
+<Multi_key> <U0D46> <U0D3E> : "ൊ" U0D4A # MALAYALAM VOWEL SIGN O
+<Multi_key> <U0D47> <U0D3E> : "ോ" U0D4B # MALAYALAM VOWEL SIGN OO
+<Multi_key> <U0D46> <U0D57> : "ൌ" U0D4C # MALAYALAM VOWEL SIGN AU
+<Multi_key> <U0DD9> <U0DCA> : "ේ" U0DDA # SINHALA VOWEL SIGN DIGA KOMBUVA
+<Multi_key> <U0DD9> <U0DCF> : "ො" U0DDC # SINHALA VOWEL SIGN KOMBUVA HAA AELA-PILLA
+<Multi_key> <U0DDC> <U0DCA> : "ෝ" U0DDD # SINHALA VOWEL SIGN KOMBUVA HAA DIGA AELA-PILLA
+/* <Multi_key> <U0DD9> <U0DCF> <U0DCA> : "ෝ" U0DDD # SINHALA VOWEL SIGN KOMBUVA HAA DIGA AELA-PILLA */
+<Multi_key> <U0DD9> <U0DDF> : "ෞ" U0DDE # SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA
+<Multi_key> <U0FB7> <U0F42> : "གྷ" U0F43 # TIBETAN LETTER GHA
+<Multi_key> <U0FB7> <U0F4C> : "ཌྷ" U0F4D # TIBETAN LETTER DDHA
+<Multi_key> <U0FB7> <U0F51> : "དྷ" U0F52 # TIBETAN LETTER DHA
+<Multi_key> <U0FB7> <U0F56> : "བྷ" U0F57 # TIBETAN LETTER BHA
+<Multi_key> <U0FB7> <U0F5B> : "ཛྷ" U0F5C # TIBETAN LETTER DZHA
+<Multi_key> <U0FB5> <U0F40> : "ཀྵ" U0F69 # TIBETAN LETTER KSSA
+<Multi_key> <U0F71> <U0F72> : "ཱི" U0F73 # TIBETAN VOWEL SIGN II
+<Multi_key> <U0F71> <U0F74> : "ཱུ" U0F75 # TIBETAN VOWEL SIGN UU
+<Multi_key> <U0FB2> <U0F80> : "ྲྀ" U0F76 # TIBETAN VOWEL SIGN VOCALIC R
+<Multi_key> <U0FB3> <U0F80> : "ླྀ" U0F78 # TIBETAN VOWEL SIGN VOCALIC L
+<Multi_key> <U0F71> <U0F80> : "ཱྀ" U0F81 # TIBETAN VOWEL SIGN REVERSED II
+<Multi_key> <U0F92> <U0FB7> : "ྒྷ" U0F93 # TIBETAN SUBJOINED LETTER GHA
+<Multi_key> <U0F9C> <U0FB7> : "ྜྷ" U0F9D # TIBETAN SUBJOINED LETTER DDHA
+<Multi_key> <U0FA1> <U0FB7> : "ྡྷ" U0FA2 # TIBETAN SUBJOINED LETTER DHA
+<Multi_key> <U0FA6> <U0FB7> : "ྦྷ" U0FA7 # TIBETAN SUBJOINED LETTER BHA
+<Multi_key> <U0FAB> <U0FB7> : "ྫྷ" U0FAC # TIBETAN SUBJOINED LETTER DZHA
+<Multi_key> <U0F90> <U0FB5> : "ྐྵ" U0FB9 # TIBETAN SUBJOINED LETTER KSSA
+<Multi_key> <U102E> <U1025> : "ဦ" U1026 # MYANMAR LETTER UU
+<dead_belowring> <A> : "Ḁ" U1E00 # LATIN CAPITAL LETTER A WITH RING BELOW
+<dead_belowring> <a> : "ḁ" U1E01 # LATIN SMALL LETTER A WITH RING BELOW
+<dead_abovedot> <B> : "Ḃ" U1E02 # LATIN CAPITAL LETTER B WITH DOT ABOVE
+<Multi_key> <period> <B> : "Ḃ" U1E02 # LATIN CAPITAL LETTER B WITH DOT ABOVE
+<dead_abovedot> <b> : "ḃ" U1E03 # LATIN SMALL LETTER B WITH DOT ABOVE
+<Multi_key> <period> <b> : "ḃ" U1E03 # LATIN SMALL LETTER B WITH DOT ABOVE
+<dead_belowdot> <B> : "Ḅ" U1E04 # LATIN CAPITAL LETTER B WITH DOT BELOW
+<Multi_key> <exclam> <B> : "Ḅ" U1E04 # LATIN CAPITAL LETTER B WITH DOT BELOW
+<dead_belowdot> <b> : "ḅ" U1E05 # LATIN SMALL LETTER B WITH DOT BELOW
+<Multi_key> <exclam> <b> : "ḅ" U1E05 # LATIN SMALL LETTER B WITH DOT BELOW
+<dead_belowmacron> <B> : "Ḇ" U1E06 # LATIN CAPITAL LETTER B WITH LINE BELOW
+<dead_belowmacron> <b> : "ḇ" U1E07 # LATIN SMALL LETTER B WITH LINE BELOW
+<dead_acute> <Ccedilla> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
+<Multi_key> <acute> <Ccedilla> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
+<Multi_key> <apostrophe> <Ccedilla> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
+<dead_acute> <dead_cedilla> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
+<dead_acute> <Multi_key> <comma> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
+<dead_acute> <Multi_key> <cedilla> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
+<Multi_key> <acute> <dead_cedilla> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
+<Multi_key> <acute> <comma> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
+<Multi_key> <acute> <cedilla> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
+<Multi_key> <apostrophe> <dead_cedilla> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
+<Multi_key> <apostrophe> <cedilla> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
+<dead_acute> <ccedilla> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
+<Multi_key> <acute> <ccedilla> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
+<Multi_key> <apostrophe> <ccedilla> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
+<dead_acute> <dead_cedilla> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
+<dead_acute> <Multi_key> <comma> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
+<dead_acute> <Multi_key> <cedilla> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
+<Multi_key> <acute> <dead_cedilla> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
+<Multi_key> <acute> <comma> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
+<Multi_key> <acute> <cedilla> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
+<Multi_key> <apostrophe> <dead_cedilla> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
+<Multi_key> <apostrophe> <cedilla> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
+<dead_abovedot> <D> : "Ḋ" U1E0A # LATIN CAPITAL LETTER D WITH DOT ABOVE
+<Multi_key> <period> <D> : "Ḋ" U1E0A # LATIN CAPITAL LETTER D WITH DOT ABOVE
+<dead_abovedot> <d> : "ḋ" U1E0B # LATIN SMALL LETTER D WITH DOT ABOVE
+<Multi_key> <period> <d> : "ḋ" U1E0B # LATIN SMALL LETTER D WITH DOT ABOVE
+<dead_belowdot> <D> : "Ḍ" U1E0C # LATIN CAPITAL LETTER D WITH DOT BELOW
+<Multi_key> <exclam> <D> : "Ḍ" U1E0C # LATIN CAPITAL LETTER D WITH DOT BELOW
+<dead_belowdot> <d> : "ḍ" U1E0D # LATIN SMALL LETTER D WITH DOT BELOW
+<Multi_key> <exclam> <d> : "ḍ" U1E0D # LATIN SMALL LETTER D WITH DOT BELOW
+<dead_belowmacron> <D> : "Ḏ" U1E0E # LATIN CAPITAL LETTER D WITH LINE BELOW
+<dead_belowmacron> <d> : "ḏ" U1E0F # LATIN SMALL LETTER D WITH LINE BELOW
+<dead_cedilla> <D> : "Ḑ" U1E10 # LATIN CAPITAL LETTER D WITH CEDILLA
+<Multi_key> <comma> <D> : "Ḑ" U1E10 # LATIN CAPITAL LETTER D WITH CEDILLA
+<Multi_key> <cedilla> <D> : "Ḑ" U1E10 # LATIN CAPITAL LETTER D WITH CEDILLA
+<dead_cedilla> <d> : "ḑ" U1E11 # LATIN SMALL LETTER D WITH CEDILLA
+<Multi_key> <comma> <d> : "ḑ" U1E11 # LATIN SMALL LETTER D WITH CEDILLA
+<Multi_key> <cedilla> <d> : "ḑ" U1E11 # LATIN SMALL LETTER D WITH CEDILLA
+<dead_belowcircumflex> <D> : "Ḓ" U1E12 # LATIN CAPITAL LETTER D WITH CIRCUMFLEX BELOW
+<dead_belowcircumflex> <d> : "ḓ" U1E13 # LATIN SMALL LETTER D WITH CIRCUMFLEX BELOW
+<dead_grave> <Emacron> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
+<Multi_key> <grave> <Emacron> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
+<dead_grave> <dead_macron> <E> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
+<dead_grave> <Multi_key> <macron> <E> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
+<dead_grave> <Multi_key> <underscore> <E> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
+<Multi_key> <grave> <dead_macron> <E> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
+<Multi_key> <grave> <macron> <E> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
+<Multi_key> <grave> <underscore> <E> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
+<dead_grave> <emacron> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
+<Multi_key> <grave> <emacron> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
+<dead_grave> <dead_macron> <e> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
+<dead_grave> <Multi_key> <macron> <e> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
+<dead_grave> <Multi_key> <underscore> <e> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
+<Multi_key> <grave> <dead_macron> <e> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
+<Multi_key> <grave> <macron> <e> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
+<Multi_key> <grave> <underscore> <e> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
+<dead_acute> <Emacron> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
+<Multi_key> <acute> <Emacron> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
+<Multi_key> <apostrophe> <Emacron> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
+<dead_acute> <dead_macron> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
+<dead_acute> <Multi_key> <macron> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
+<dead_acute> <Multi_key> <underscore> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
+<Multi_key> <acute> <dead_macron> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
+<Multi_key> <acute> <macron> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
+<Multi_key> <acute> <underscore> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
+<Multi_key> <apostrophe> <dead_macron> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
+<Multi_key> <apostrophe> <macron> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
+<Multi_key> <apostrophe> <underscore> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
+<dead_acute> <emacron> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
+<Multi_key> <acute> <emacron> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
+<Multi_key> <apostrophe> <emacron> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
+<dead_acute> <dead_macron> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
+<dead_acute> <Multi_key> <macron> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
+<dead_acute> <Multi_key> <underscore> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
+<Multi_key> <acute> <dead_macron> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
+<Multi_key> <acute> <macron> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
+<Multi_key> <acute> <underscore> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
+<Multi_key> <apostrophe> <dead_macron> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
+<Multi_key> <apostrophe> <macron> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
+<Multi_key> <apostrophe> <underscore> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
+<dead_belowcircumflex> <E> : "Ḙ" U1E18 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX BELOW
+<dead_belowcircumflex> <e> : "ḙ" U1E19 # LATIN SMALL LETTER E WITH CIRCUMFLEX BELOW
+<dead_belowtilde> <E> : "Ḛ" U1E1A # LATIN CAPITAL LETTER E WITH TILDE BELOW
+<dead_belowtilde> <e> : "ḛ" U1E1B # LATIN SMALL LETTER E WITH TILDE BELOW
+<dead_breve> <U0228> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
+<Multi_key> <U> <U0228> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
+<Multi_key> <b> <U0228> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
+<dead_breve> <dead_cedilla> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
+<dead_breve> <Multi_key> <comma> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
+<dead_breve> <Multi_key> <cedilla> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
+<Multi_key> <U> <dead_cedilla> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
+<Multi_key> <U> <comma> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
+<Multi_key> <U> <cedilla> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
+<Multi_key> <b> <dead_cedilla> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
+<Multi_key> <b> <comma> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
+<Multi_key> <b> <cedilla> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
+<dead_breve> <U0229> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+<Multi_key> <U> <U0229> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+<Multi_key> <b> <U0229> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+<dead_breve> <dead_cedilla> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+<dead_breve> <Multi_key> <comma> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+<dead_breve> <Multi_key> <cedilla> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+<Multi_key> <U> <dead_cedilla> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+<Multi_key> <U> <comma> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+<Multi_key> <U> <cedilla> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+<Multi_key> <b> <dead_cedilla> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+<Multi_key> <b> <comma> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+<Multi_key> <b> <cedilla> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+<dead_abovedot> <F> : "Ḟ" U1E1E # LATIN CAPITAL LETTER F WITH DOT ABOVE
+<Multi_key> <period> <F> : "Ḟ" U1E1E # LATIN CAPITAL LETTER F WITH DOT ABOVE
+<dead_abovedot> <f> : "ḟ" U1E1F # LATIN SMALL LETTER F WITH DOT ABOVE
+<Multi_key> <period> <f> : "ḟ" U1E1F # LATIN SMALL LETTER F WITH DOT ABOVE
+<dead_macron> <G> : "Ḡ" U1E20 # LATIN CAPITAL LETTER G WITH MACRON
+<Multi_key> <macron> <G> : "Ḡ" U1E20 # LATIN CAPITAL LETTER G WITH MACRON
+<Multi_key> <underscore> <G> : "Ḡ" U1E20 # LATIN CAPITAL LETTER G WITH MACRON
+<dead_macron> <g> : "ḡ" U1E21 # LATIN SMALL LETTER G WITH MACRON
+<Multi_key> <macron> <g> : "ḡ" U1E21 # LATIN SMALL LETTER G WITH MACRON
+<Multi_key> <underscore> <g> : "ḡ" U1E21 # LATIN SMALL LETTER G WITH MACRON
+<dead_abovedot> <H> : "Ḣ" U1E22 # LATIN CAPITAL LETTER H WITH DOT ABOVE
+<Multi_key> <period> <H> : "Ḣ" U1E22 # LATIN CAPITAL LETTER H WITH DOT ABOVE
+<dead_abovedot> <h> : "ḣ" U1E23 # LATIN SMALL LETTER H WITH DOT ABOVE
+<Multi_key> <period> <h> : "ḣ" U1E23 # LATIN SMALL LETTER H WITH DOT ABOVE
+<dead_belowdot> <H> : "Ḥ" U1E24 # LATIN CAPITAL LETTER H WITH DOT BELOW
+<Multi_key> <exclam> <H> : "Ḥ" U1E24 # LATIN CAPITAL LETTER H WITH DOT BELOW
+<dead_belowdot> <h> : "ḥ" U1E25 # LATIN SMALL LETTER H WITH DOT BELOW
+<Multi_key> <exclam> <h> : "ḥ" U1E25 # LATIN SMALL LETTER H WITH DOT BELOW
+<dead_diaeresis> <H> : "Ḧ" U1E26 # LATIN CAPITAL LETTER H WITH DIAERESIS
+<Multi_key> <quotedbl> <H> : "Ḧ" U1E26 # LATIN CAPITAL LETTER H WITH DIAERESIS
+<dead_diaeresis> <h> : "ḧ" U1E27 # LATIN SMALL LETTER H WITH DIAERESIS
+<Multi_key> <quotedbl> <h> : "ḧ" U1E27 # LATIN SMALL LETTER H WITH DIAERESIS
+<dead_cedilla> <H> : "Ḩ" U1E28 # LATIN CAPITAL LETTER H WITH CEDILLA
+<Multi_key> <comma> <H> : "Ḩ" U1E28 # LATIN CAPITAL LETTER H WITH CEDILLA
+<Multi_key> <cedilla> <H> : "Ḩ" U1E28 # LATIN CAPITAL LETTER H WITH CEDILLA
+<dead_cedilla> <h> : "ḩ" U1E29 # LATIN SMALL LETTER H WITH CEDILLA
+<Multi_key> <comma> <h> : "ḩ" U1E29 # LATIN SMALL LETTER H WITH CEDILLA
+<Multi_key> <cedilla> <h> : "ḩ" U1E29 # LATIN SMALL LETTER H WITH CEDILLA
+<dead_belowbreve> <H> : "Ḫ" U1E2A # LATIN CAPITAL LETTER H WITH BREVE BELOW
+<dead_belowbreve> <h> : "ḫ" U1E2B # LATIN SMALL LETTER H WITH BREVE BELOW
+<dead_belowtilde> <I> : "Ḭ" U1E2C # LATIN CAPITAL LETTER I WITH TILDE BELOW
+<dead_belowtilde> <i> : "ḭ" U1E2D # LATIN SMALL LETTER I WITH TILDE BELOW
+<dead_acute> <Idiaeresis> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
+<Multi_key> <acute> <Idiaeresis> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
+<Multi_key> <apostrophe> <Idiaeresis> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
+<dead_acute> <dead_diaeresis> <I> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
+<dead_acute> <Multi_key> <quotedbl> <I> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
+<Multi_key> <acute> <dead_diaeresis> <I> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
+<Multi_key> <acute> <quotedbl> <I> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
+<Multi_key> <apostrophe> <dead_diaeresis> <I> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
+<Multi_key> <apostrophe> <quotedbl> <I> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
+<dead_acute> <idiaeresis> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
+<Multi_key> <acute> <idiaeresis> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
+<Multi_key> <apostrophe> <idiaeresis> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
+<dead_acute> <dead_diaeresis> <i> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
+<dead_acute> <Multi_key> <quotedbl> <i> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
+<Multi_key> <acute> <dead_diaeresis> <i> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
+<Multi_key> <acute> <quotedbl> <i> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
+<Multi_key> <apostrophe> <dead_diaeresis> <i> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
+<Multi_key> <apostrophe> <quotedbl> <i> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
+<dead_acute> <K> : "Ḱ" U1E30 # LATIN CAPITAL LETTER K WITH ACUTE
+<Multi_key> <acute> <K> : "Ḱ" U1E30 # LATIN CAPITAL LETTER K WITH ACUTE
+<Multi_key> <apostrophe> <K> : "Ḱ" U1E30 # LATIN CAPITAL LETTER K WITH ACUTE
+<dead_acute> <k> : "ḱ" U1E31 # LATIN SMALL LETTER K WITH ACUTE
+<Multi_key> <acute> <k> : "ḱ" U1E31 # LATIN SMALL LETTER K WITH ACUTE
+<Multi_key> <apostrophe> <k> : "ḱ" U1E31 # LATIN SMALL LETTER K WITH ACUTE
+<dead_belowdot> <K> : "Ḳ" U1E32 # LATIN CAPITAL LETTER K WITH DOT BELOW
+<Multi_key> <exclam> <K> : "Ḳ" U1E32 # LATIN CAPITAL LETTER K WITH DOT BELOW
+<dead_belowdot> <k> : "ḳ" U1E33 # LATIN SMALL LETTER K WITH DOT BELOW
+<Multi_key> <exclam> <k> : "ḳ" U1E33 # LATIN SMALL LETTER K WITH DOT BELOW
+<dead_belowmacron> <K> : "Ḵ" U1E34 # LATIN CAPITAL LETTER K WITH LINE BELOW
+<dead_belowmacron> <k> : "ḵ" U1E35 # LATIN SMALL LETTER K WITH LINE BELOW
+<dead_belowdot> <L> : "Ḷ" U1E36 # LATIN CAPITAL LETTER L WITH DOT BELOW
+<Multi_key> <exclam> <L> : "Ḷ" U1E36 # LATIN CAPITAL LETTER L WITH DOT BELOW
+<dead_belowdot> <l> : "ḷ" U1E37 # LATIN SMALL LETTER L WITH DOT BELOW
+<Multi_key> <exclam> <l> : "ḷ" U1E37 # LATIN SMALL LETTER L WITH DOT BELOW
+<dead_macron> <U1E36> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
+<Multi_key> <macron> <U1E36> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
+<Multi_key> <underscore> <U1E36> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
+<dead_macron> <dead_belowdot> <L> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
+<dead_macron> <Multi_key> <exclam> <L> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
+<Multi_key> <macron> <dead_belowdot> <L> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
+<Multi_key> <macron> <exclam> <L> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
+<Multi_key> <underscore> <dead_belowdot> <L> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
+<Multi_key> <underscore> <exclam> <L> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
+<dead_macron> <U1E37> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
+<Multi_key> <macron> <U1E37> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
+<Multi_key> <underscore> <U1E37> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
+<dead_macron> <dead_belowdot> <l> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
+<dead_macron> <Multi_key> <exclam> <l> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
+<Multi_key> <macron> <dead_belowdot> <l> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
+<Multi_key> <macron> <exclam> <l> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
+<Multi_key> <underscore> <dead_belowdot> <l> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
+<Multi_key> <underscore> <exclam> <l> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
+<dead_belowmacron> <L> : "Ḻ" U1E3A # LATIN CAPITAL LETTER L WITH LINE BELOW
+<dead_belowmacron> <l> : "ḻ" U1E3B # LATIN SMALL LETTER L WITH LINE BELOW
+<dead_belowcircumflex> <L> : "Ḽ" U1E3C # LATIN CAPITAL LETTER L WITH CIRCUMFLEX BELOW
+<dead_belowcircumflex> <l> : "ḽ" U1E3D # LATIN SMALL LETTER L WITH CIRCUMFLEX BELOW
+<dead_acute> <M> : "Ḿ" U1E3E # LATIN CAPITAL LETTER M WITH ACUTE
+<Multi_key> <acute> <M> : "Ḿ" U1E3E # LATIN CAPITAL LETTER M WITH ACUTE
+<Multi_key> <apostrophe> <M> : "Ḿ" U1E3E # LATIN CAPITAL LETTER M WITH ACUTE
+<dead_acute> <m> : "ḿ" U1E3F # LATIN SMALL LETTER M WITH ACUTE
+<Multi_key> <acute> <m> : "ḿ" U1E3F # LATIN SMALL LETTER M WITH ACUTE
+<Multi_key> <apostrophe> <m> : "ḿ" U1E3F # LATIN SMALL LETTER M WITH ACUTE
+<dead_abovedot> <M> : "Ṁ" U1E40 # LATIN CAPITAL LETTER M WITH DOT ABOVE
+<Multi_key> <period> <M> : "Ṁ" U1E40 # LATIN CAPITAL LETTER M WITH DOT ABOVE
+<dead_abovedot> <m> : "ṁ" U1E41 # LATIN SMALL LETTER M WITH DOT ABOVE
+<Multi_key> <period> <m> : "ṁ" U1E41 # LATIN SMALL LETTER M WITH DOT ABOVE
+<dead_belowdot> <M> : "Ṃ" U1E42 # LATIN CAPITAL LETTER M WITH DOT BELOW
+<Multi_key> <exclam> <M> : "Ṃ" U1E42 # LATIN CAPITAL LETTER M WITH DOT BELOW
+<dead_belowdot> <m> : "ṃ" U1E43 # LATIN SMALL LETTER M WITH DOT BELOW
+<Multi_key> <exclam> <m> : "ṃ" U1E43 # LATIN SMALL LETTER M WITH DOT BELOW
+<dead_abovedot> <N> : "Ṅ" U1E44 # LATIN CAPITAL LETTER N WITH DOT ABOVE
+<Multi_key> <period> <N> : "Ṅ" U1E44 # LATIN CAPITAL LETTER N WITH DOT ABOVE
+<dead_abovedot> <n> : "ṅ" U1E45 # LATIN SMALL LETTER N WITH DOT ABOVE
+<Multi_key> <period> <n> : "ṅ" U1E45 # LATIN SMALL LETTER N WITH DOT ABOVE
+<dead_belowdot> <N> : "Ṇ" U1E46 # LATIN CAPITAL LETTER N WITH DOT BELOW
+<Multi_key> <exclam> <N> : "Ṇ" U1E46 # LATIN CAPITAL LETTER N WITH DOT BELOW
+<dead_belowdot> <n> : "ṇ" U1E47 # LATIN SMALL LETTER N WITH DOT BELOW
+<Multi_key> <exclam> <n> : "ṇ" U1E47 # LATIN SMALL LETTER N WITH DOT BELOW
+<dead_belowmacron> <N> : "Ṉ" U1E48 # LATIN CAPITAL LETTER N WITH LINE BELOW
+<dead_belowmacron> <n> : "ṉ" U1E49 # LATIN SMALL LETTER N WITH LINE BELOW
+<dead_belowcircumflex> <N> : "Ṋ" U1E4A # LATIN CAPITAL LETTER N WITH CIRCUMFLEX BELOW
+<dead_belowcircumflex> <n> : "ṋ" U1E4B # LATIN SMALL LETTER N WITH CIRCUMFLEX BELOW
+<dead_acute> <Otilde> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
+<Multi_key> <acute> <Otilde> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
+<Multi_key> <apostrophe> <Otilde> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
+<dead_acute> <dead_tilde> <O> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
+<dead_acute> <Multi_key> <asciitilde> <O> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
+<Multi_key> <acute> <dead_tilde> <O> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
+<Multi_key> <acute> <asciitilde> <O> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
+<Multi_key> <apostrophe> <dead_tilde> <O> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
+<Multi_key> <apostrophe> <asciitilde> <O> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
+<dead_acute> <otilde> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
+<Multi_key> <acute> <otilde> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
+<Multi_key> <apostrophe> <otilde> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
+<dead_acute> <dead_tilde> <o> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
+<dead_acute> <Multi_key> <asciitilde> <o> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
+<Multi_key> <acute> <dead_tilde> <o> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
+<Multi_key> <acute> <asciitilde> <o> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
+<Multi_key> <apostrophe> <dead_tilde> <o> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
+<Multi_key> <apostrophe> <asciitilde> <o> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
+<dead_diaeresis> <Otilde> : "Ṏ" U1E4E # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
+<Multi_key> <quotedbl> <Otilde> : "Ṏ" U1E4E # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
+<dead_diaeresis> <dead_tilde> <O> : "Ṏ" U1E4E # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
+<dead_diaeresis> <Multi_key> <asciitilde> <O> : "Ṏ" U1E4E # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
+<Multi_key> <quotedbl> <dead_tilde> <O> : "Ṏ" U1E4E # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
+<Multi_key> <quotedbl> <asciitilde> <O> : "Ṏ" U1E4E # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
+<dead_diaeresis> <otilde> : "ṏ" U1E4F # LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
+<Multi_key> <quotedbl> <otilde> : "ṏ" U1E4F # LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
+<dead_diaeresis> <dead_tilde> <o> : "ṏ" U1E4F # LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
+<dead_diaeresis> <Multi_key> <asciitilde> <o> : "ṏ" U1E4F # LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
+<Multi_key> <quotedbl> <dead_tilde> <o> : "ṏ" U1E4F # LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
+<Multi_key> <quotedbl> <asciitilde> <o> : "ṏ" U1E4F # LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
+<dead_grave> <Omacron> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
+<Multi_key> <grave> <Omacron> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
+<dead_grave> <dead_macron> <O> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
+<dead_grave> <Multi_key> <macron> <O> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
+<dead_grave> <Multi_key> <underscore> <O> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
+<Multi_key> <grave> <dead_macron> <O> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
+<Multi_key> <grave> <macron> <O> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
+<Multi_key> <grave> <underscore> <O> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
+<dead_grave> <omacron> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
+<Multi_key> <grave> <omacron> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
+<dead_grave> <dead_macron> <o> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
+<dead_grave> <Multi_key> <macron> <o> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
+<dead_grave> <Multi_key> <underscore> <o> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
+<Multi_key> <grave> <dead_macron> <o> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
+<Multi_key> <grave> <macron> <o> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
+<Multi_key> <grave> <underscore> <o> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
+<dead_acute> <Omacron> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
+<Multi_key> <acute> <Omacron> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
+<Multi_key> <apostrophe> <Omacron> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
+<dead_acute> <dead_macron> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
+<dead_acute> <Multi_key> <macron> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
+<dead_acute> <Multi_key> <underscore> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
+<Multi_key> <acute> <dead_macron> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
+<Multi_key> <acute> <macron> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
+<Multi_key> <acute> <underscore> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
+<Multi_key> <apostrophe> <dead_macron> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
+<Multi_key> <apostrophe> <macron> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
+<Multi_key> <apostrophe> <underscore> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
+<dead_acute> <omacron> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
+<Multi_key> <acute> <omacron> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
+<Multi_key> <apostrophe> <omacron> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
+<dead_acute> <dead_macron> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
+<dead_acute> <Multi_key> <macron> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
+<dead_acute> <Multi_key> <underscore> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
+<Multi_key> <acute> <dead_macron> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
+<Multi_key> <acute> <macron> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
+<Multi_key> <acute> <underscore> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
+<Multi_key> <apostrophe> <dead_macron> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
+<Multi_key> <apostrophe> <macron> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
+<Multi_key> <apostrophe> <underscore> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
+<dead_acute> <P> : "Ṕ" U1E54 # LATIN CAPITAL LETTER P WITH ACUTE
+<Multi_key> <acute> <P> : "Ṕ" U1E54 # LATIN CAPITAL LETTER P WITH ACUTE
+<Multi_key> <apostrophe> <P> : "Ṕ" U1E54 # LATIN CAPITAL LETTER P WITH ACUTE
+<dead_acute> <p> : "ṕ" U1E55 # LATIN SMALL LETTER P WITH ACUTE
+<Multi_key> <acute> <p> : "ṕ" U1E55 # LATIN SMALL LETTER P WITH ACUTE
+<Multi_key> <apostrophe> <p> : "ṕ" U1E55 # LATIN SMALL LETTER P WITH ACUTE
+<dead_abovedot> <P> : "Ṗ" U1E56 # LATIN CAPITAL LETTER P WITH DOT ABOVE
+<Multi_key> <period> <P> : "Ṗ" U1E56 # LATIN CAPITAL LETTER P WITH DOT ABOVE
+<dead_abovedot> <p> : "ṗ" U1E57 # LATIN SMALL LETTER P WITH DOT ABOVE
+<Multi_key> <period> <p> : "ṗ" U1E57 # LATIN SMALL LETTER P WITH DOT ABOVE
+<dead_abovedot> <R> : "Ṙ" U1E58 # LATIN CAPITAL LETTER R WITH DOT ABOVE
+<Multi_key> <period> <R> : "Ṙ" U1E58 # LATIN CAPITAL LETTER R WITH DOT ABOVE
+<dead_abovedot> <r> : "ṙ" U1E59 # LATIN SMALL LETTER R WITH DOT ABOVE
+<Multi_key> <period> <r> : "ṙ" U1E59 # LATIN SMALL LETTER R WITH DOT ABOVE
+<dead_belowdot> <R> : "Ṛ" U1E5A # LATIN CAPITAL LETTER R WITH DOT BELOW
+<Multi_key> <exclam> <R> : "Ṛ" U1E5A # LATIN CAPITAL LETTER R WITH DOT BELOW
+<dead_belowdot> <r> : "ṛ" U1E5B # LATIN SMALL LETTER R WITH DOT BELOW
+<Multi_key> <exclam> <r> : "ṛ" U1E5B # LATIN SMALL LETTER R WITH DOT BELOW
+<dead_macron> <U1E5A> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
+<Multi_key> <macron> <U1E5A> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
+<Multi_key> <underscore> <U1E5A> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
+<dead_macron> <dead_belowdot> <R> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
+<dead_macron> <Multi_key> <exclam> <R> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
+<Multi_key> <macron> <dead_belowdot> <R> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
+<Multi_key> <macron> <exclam> <R> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
+<Multi_key> <underscore> <dead_belowdot> <R> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
+<Multi_key> <underscore> <exclam> <R> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
+<dead_macron> <U1E5B> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
+<Multi_key> <macron> <U1E5B> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
+<Multi_key> <underscore> <U1E5B> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
+<dead_macron> <dead_belowdot> <r> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
+<dead_macron> <Multi_key> <exclam> <r> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
+<Multi_key> <macron> <dead_belowdot> <r> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
+<Multi_key> <macron> <exclam> <r> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
+<Multi_key> <underscore> <dead_belowdot> <r> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
+<Multi_key> <underscore> <exclam> <r> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
+<dead_belowmacron> <R> : "Ṟ" U1E5E # LATIN CAPITAL LETTER R WITH LINE BELOW
+<dead_belowmacron> <r> : "ṟ" U1E5F # LATIN SMALL LETTER R WITH LINE BELOW
+<dead_abovedot> <S> : "Ṡ" U1E60 # LATIN CAPITAL LETTER S WITH DOT ABOVE
+<Multi_key> <period> <S> : "Ṡ" U1E60 # LATIN CAPITAL LETTER S WITH DOT ABOVE
+<dead_abovedot> <s> : "ṡ" U1E61 # LATIN SMALL LETTER S WITH DOT ABOVE
+<Multi_key> <period> <s> : "ṡ" U1E61 # LATIN SMALL LETTER S WITH DOT ABOVE
+<dead_belowdot> <S> : "Ṣ" U1E62 # LATIN CAPITAL LETTER S WITH DOT BELOW
+<Multi_key> <exclam> <S> : "Ṣ" U1E62 # LATIN CAPITAL LETTER S WITH DOT BELOW
+<dead_belowdot> <s> : "ṣ" U1E63 # LATIN SMALL LETTER S WITH DOT BELOW
+<Multi_key> <exclam> <s> : "ṣ" U1E63 # LATIN SMALL LETTER S WITH DOT BELOW
+<dead_abovedot> <Sacute> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
+<Multi_key> <period> <Sacute> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
+<dead_abovedot> <dead_acute> <S> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
+<dead_abovedot> <Multi_key> <acute> <S> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
+<dead_abovedot> <Multi_key> <apostrophe> <S> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
+<Multi_key> <period> <dead_acute> <S> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
+<Multi_key> <period> <acute> <S> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
+<Multi_key> <period> <apostrophe> <S> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
+<dead_abovedot> <sacute> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
+<Multi_key> <period> <sacute> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
+<dead_abovedot> <dead_acute> <s> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
+<dead_abovedot> <Multi_key> <acute> <s> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
+<dead_abovedot> <Multi_key> <apostrophe> <s> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
+<Multi_key> <period> <dead_acute> <s> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
+<Multi_key> <period> <acute> <s> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
+<Multi_key> <period> <apostrophe> <s> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
+<dead_abovedot> <Scaron> : "Ṧ" U1E66 # LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
+<Multi_key> <period> <Scaron> : "Ṧ" U1E66 # LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
+<dead_abovedot> <dead_caron> <S> : "Ṧ" U1E66 # LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
+<dead_abovedot> <Multi_key> <c> <S> : "Ṧ" U1E66 # LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
+<Multi_key> <period> <dead_caron> <S> : "Ṧ" U1E66 # LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
+<dead_abovedot> <scaron> : "ṧ" U1E67 # LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
+<Multi_key> <period> <scaron> : "ṧ" U1E67 # LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
+<dead_abovedot> <dead_caron> <s> : "ṧ" U1E67 # LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
+<dead_abovedot> <Multi_key> <c> <s> : "ṧ" U1E67 # LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
+<Multi_key> <period> <dead_caron> <s> : "ṧ" U1E67 # LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
+<dead_abovedot> <U1E62> : "Ṩ" U1E68 # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
+<Multi_key> <period> <U1E62> : "Ṩ" U1E68 # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
+<dead_abovedot> <dead_belowdot> <S> : "Ṩ" U1E68 # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
+<dead_abovedot> <Multi_key> <exclam> <S> : "Ṩ" U1E68 # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
+<Multi_key> <period> <dead_belowdot> <S> : "Ṩ" U1E68 # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
+<Multi_key> <period> <exclam> <S> : "Ṩ" U1E68 # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
+<dead_abovedot> <U1E63> : "ṩ" U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
+<Multi_key> <period> <U1E63> : "ṩ" U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
+<dead_abovedot> <dead_belowdot> <s> : "ṩ" U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
+<dead_abovedot> <Multi_key> <exclam> <s> : "ṩ" U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
+<Multi_key> <period> <dead_belowdot> <s> : "ṩ" U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
+<Multi_key> <period> <exclam> <s> : "ṩ" U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
+<dead_abovedot> <T> : "Ṫ" U1E6A # LATIN CAPITAL LETTER T WITH DOT ABOVE
+<Multi_key> <period> <T> : "Ṫ" U1E6A # LATIN CAPITAL LETTER T WITH DOT ABOVE
+<dead_abovedot> <t> : "ṫ" U1E6B # LATIN SMALL LETTER T WITH DOT ABOVE
+<Multi_key> <period> <t> : "ṫ" U1E6B # LATIN SMALL LETTER T WITH DOT ABOVE
+<dead_belowdot> <T> : "Ṭ" U1E6C # LATIN CAPITAL LETTER T WITH DOT BELOW
+<Multi_key> <exclam> <T> : "Ṭ" U1E6C # LATIN CAPITAL LETTER T WITH DOT BELOW
+<dead_belowdot> <t> : "ṭ" U1E6D # LATIN SMALL LETTER T WITH DOT BELOW
+<Multi_key> <exclam> <t> : "ṭ" U1E6D # LATIN SMALL LETTER T WITH DOT BELOW
+<dead_belowmacron> <T> : "Ṯ" U1E6E # LATIN CAPITAL LETTER T WITH LINE BELOW
+<dead_belowmacron> <t> : "ṯ" U1E6F # LATIN SMALL LETTER T WITH LINE BELOW
+<dead_belowcircumflex> <T> : "Ṱ" U1E70 # LATIN CAPITAL LETTER T WITH CIRCUMFLEX BELOW
+<dead_belowcircumflex> <t> : "ṱ" U1E71 # LATIN SMALL LETTER T WITH CIRCUMFLEX BELOW
+<dead_belowdiaeresis> <U> : "Ṳ" U1E72 # LATIN CAPITAL LETTER U WITH DIAERESIS BELOW
+<dead_belowdiaeresis> <u> : "ṳ" U1E73 # LATIN SMALL LETTER U WITH DIAERESIS BELOW
+<dead_belowtilde> <U> : "Ṵ" U1E74 # LATIN CAPITAL LETTER U WITH TILDE BELOW
+<dead_belowtilde> <u> : "ṵ" U1E75 # LATIN SMALL LETTER U WITH TILDE BELOW
+<dead_belowcircumflex> <U> : "Ṷ" U1E76 # LATIN CAPITAL LETTER U WITH CIRCUMFLEX BELOW
+<dead_belowcircumflex> <u> : "ṷ" U1E77 # LATIN SMALL LETTER U WITH CIRCUMFLEX BELOW
+<dead_acute> <Utilde> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
+<Multi_key> <acute> <Utilde> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
+<Multi_key> <apostrophe> <Utilde> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
+<dead_acute> <dead_tilde> <U> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
+<dead_acute> <Multi_key> <asciitilde> <U> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
+<Multi_key> <acute> <dead_tilde> <U> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
+<Multi_key> <acute> <asciitilde> <U> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
+<Multi_key> <apostrophe> <dead_tilde> <U> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
+<Multi_key> <apostrophe> <asciitilde> <U> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
+<dead_acute> <utilde> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
+<Multi_key> <acute> <utilde> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
+<Multi_key> <apostrophe> <utilde> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
+<dead_acute> <dead_tilde> <u> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
+<dead_acute> <Multi_key> <asciitilde> <u> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
+<Multi_key> <acute> <dead_tilde> <u> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
+<Multi_key> <acute> <asciitilde> <u> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
+<Multi_key> <apostrophe> <dead_tilde> <u> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
+<Multi_key> <apostrophe> <asciitilde> <u> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
+<dead_diaeresis> <Umacron> : "Ṻ" U1E7A # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
+<Multi_key> <quotedbl> <Umacron> : "Ṻ" U1E7A # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
+<dead_diaeresis> <dead_macron> <U> : "Ṻ" U1E7A # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
+<dead_diaeresis> <Multi_key> <macron> <U> : "Ṻ" U1E7A # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
+<dead_diaeresis> <Multi_key> <underscore> <U> : "Ṻ" U1E7A # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
+<Multi_key> <quotedbl> <dead_macron> <U> : "Ṻ" U1E7A # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
+<Multi_key> <quotedbl> <macron> <U> : "Ṻ" U1E7A # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
+<Multi_key> <quotedbl> <underscore> <U> : "Ṻ" U1E7A # LATIN CAPITAL LETTER U WITH MACRON AND DIAERESIS
+<dead_diaeresis> <umacron> : "ṻ" U1E7B # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
+<Multi_key> <quotedbl> <umacron> : "ṻ" U1E7B # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
+<dead_diaeresis> <dead_macron> <u> : "ṻ" U1E7B # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
+<dead_diaeresis> <Multi_key> <macron> <u> : "ṻ" U1E7B # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
+<dead_diaeresis> <Multi_key> <underscore> <u> : "ṻ" U1E7B # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
+<Multi_key> <quotedbl> <dead_macron> <u> : "ṻ" U1E7B # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
+<Multi_key> <quotedbl> <macron> <u> : "ṻ" U1E7B # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
+<Multi_key> <quotedbl> <underscore> <u> : "ṻ" U1E7B # LATIN SMALL LETTER U WITH MACRON AND DIAERESIS
+<dead_tilde> <V> : "Ṽ" U1E7C # LATIN CAPITAL LETTER V WITH TILDE
+<Multi_key> <asciitilde> <V> : "Ṽ" U1E7C # LATIN CAPITAL LETTER V WITH TILDE
+<dead_tilde> <v> : "ṽ" U1E7D # LATIN SMALL LETTER V WITH TILDE
+<Multi_key> <asciitilde> <v> : "ṽ" U1E7D # LATIN SMALL LETTER V WITH TILDE
+<dead_belowdot> <V> : "Ṿ" U1E7E # LATIN CAPITAL LETTER V WITH DOT BELOW
+<Multi_key> <exclam> <V> : "Ṿ" U1E7E # LATIN CAPITAL LETTER V WITH DOT BELOW
+<dead_belowdot> <v> : "ṿ" U1E7F # LATIN SMALL LETTER V WITH DOT BELOW
+<Multi_key> <exclam> <v> : "ṿ" U1E7F # LATIN SMALL LETTER V WITH DOT BELOW
+<dead_grave> <W> : "Ẁ" U1E80 # LATIN CAPITAL LETTER W WITH GRAVE
+<Multi_key> <grave> <W> : "Ẁ" U1E80 # LATIN CAPITAL LETTER W WITH GRAVE
+<dead_grave> <w> : "ẁ" U1E81 # LATIN SMALL LETTER W WITH GRAVE
+<Multi_key> <grave> <w> : "ẁ" U1E81 # LATIN SMALL LETTER W WITH GRAVE
+<dead_acute> <W> : "Ẃ" U1E82 # LATIN CAPITAL LETTER W WITH ACUTE
+<Multi_key> <acute> <W> : "Ẃ" U1E82 # LATIN CAPITAL LETTER W WITH ACUTE
+<Multi_key> <apostrophe> <W> : "Ẃ" U1E82 # LATIN CAPITAL LETTER W WITH ACUTE
+<dead_acute> <w> : "ẃ" U1E83 # LATIN SMALL LETTER W WITH ACUTE
+<Multi_key> <acute> <w> : "ẃ" U1E83 # LATIN SMALL LETTER W WITH ACUTE
+<Multi_key> <apostrophe> <w> : "ẃ" U1E83 # LATIN SMALL LETTER W WITH ACUTE
+<dead_diaeresis> <W> : "Ẅ" U1E84 # LATIN CAPITAL LETTER W WITH DIAERESIS
+<Multi_key> <quotedbl> <W> : "Ẅ" U1E84 # LATIN CAPITAL LETTER W WITH DIAERESIS
+<dead_diaeresis> <w> : "ẅ" U1E85 # LATIN SMALL LETTER W WITH DIAERESIS
+<Multi_key> <quotedbl> <w> : "ẅ" U1E85 # LATIN SMALL LETTER W WITH DIAERESIS
+<dead_abovedot> <W> : "Ẇ" U1E86 # LATIN CAPITAL LETTER W WITH DOT ABOVE
+<Multi_key> <period> <W> : "Ẇ" U1E86 # LATIN CAPITAL LETTER W WITH DOT ABOVE
+<dead_abovedot> <w> : "ẇ" U1E87 # LATIN SMALL LETTER W WITH DOT ABOVE
+<Multi_key> <period> <w> : "ẇ" U1E87 # LATIN SMALL LETTER W WITH DOT ABOVE
+<dead_belowdot> <W> : "Ẉ" U1E88 # LATIN CAPITAL LETTER W WITH DOT BELOW
+<Multi_key> <exclam> <W> : "Ẉ" U1E88 # LATIN CAPITAL LETTER W WITH DOT BELOW
+<dead_belowdot> <w> : "ẉ" U1E89 # LATIN SMALL LETTER W WITH DOT BELOW
+<Multi_key> <exclam> <w> : "ẉ" U1E89 # LATIN SMALL LETTER W WITH DOT BELOW
+<dead_abovedot> <X> : "Ẋ" U1E8A # LATIN CAPITAL LETTER X WITH DOT ABOVE
+<Multi_key> <period> <X> : "Ẋ" U1E8A # LATIN CAPITAL LETTER X WITH DOT ABOVE
+<dead_abovedot> <x> : "ẋ" U1E8B # LATIN SMALL LETTER X WITH DOT ABOVE
+<Multi_key> <period> <x> : "ẋ" U1E8B # LATIN SMALL LETTER X WITH DOT ABOVE
+<dead_diaeresis> <X> : "Ẍ" U1E8C # LATIN CAPITAL LETTER X WITH DIAERESIS
+<Multi_key> <quotedbl> <X> : "Ẍ" U1E8C # LATIN CAPITAL LETTER X WITH DIAERESIS
+<dead_diaeresis> <x> : "ẍ" U1E8D # LATIN SMALL LETTER X WITH DIAERESIS
+<Multi_key> <quotedbl> <x> : "ẍ" U1E8D # LATIN SMALL LETTER X WITH DIAERESIS
+<dead_abovedot> <Y> : "Ẏ" U1E8E # LATIN CAPITAL LETTER Y WITH DOT ABOVE
+<Multi_key> <period> <Y> : "Ẏ" U1E8E # LATIN CAPITAL LETTER Y WITH DOT ABOVE
+<dead_abovedot> <y> : "ẏ" U1E8F # LATIN SMALL LETTER Y WITH DOT ABOVE
+<Multi_key> <period> <y> : "ẏ" U1E8F # LATIN SMALL LETTER Y WITH DOT ABOVE
+<dead_circumflex> <Z> : "Ẑ" U1E90 # LATIN CAPITAL LETTER Z WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <Z> : "Ẑ" U1E90 # LATIN CAPITAL LETTER Z WITH CIRCUMFLEX
+<dead_circumflex> <z> : "ẑ" U1E91 # LATIN SMALL LETTER Z WITH CIRCUMFLEX
+<Multi_key> <asciicircum> <z> : "ẑ" U1E91 # LATIN SMALL LETTER Z WITH CIRCUMFLEX
+<dead_belowdot> <Z> : "Ẓ" U1E92 # LATIN CAPITAL LETTER Z WITH DOT BELOW
+<Multi_key> <exclam> <Z> : "Ẓ" U1E92 # LATIN CAPITAL LETTER Z WITH DOT BELOW
+<dead_belowdot> <z> : "ẓ" U1E93 # LATIN SMALL LETTER Z WITH DOT BELOW
+<Multi_key> <exclam> <z> : "ẓ" U1E93 # LATIN SMALL LETTER Z WITH DOT BELOW
+<dead_belowmacron> <Z> : "Ẕ" U1E94 # LATIN CAPITAL LETTER Z WITH LINE BELOW
+<dead_belowmacron> <z> : "ẕ" U1E95 # LATIN SMALL LETTER Z WITH LINE BELOW
+<dead_belowmacron> <h> : "ẖ" U1E96 # LATIN SMALL LETTER H WITH LINE BELOW
+<dead_diaeresis> <t> : "ẗ" U1E97 # LATIN SMALL LETTER T WITH DIAERESIS
+<Multi_key> <quotedbl> <t> : "ẗ" U1E97 # LATIN SMALL LETTER T WITH DIAERESIS
+<dead_abovering> <w> : "ẘ" U1E98 # LATIN SMALL LETTER W WITH RING ABOVE
+<Multi_key> <o> <w> : "ẘ" U1E98 # LATIN SMALL LETTER W WITH RING ABOVE
+<dead_abovering> <y> : "ẙ" U1E99 # LATIN SMALL LETTER Y WITH RING ABOVE
+<Multi_key> <o> <y> : "ẙ" U1E99 # LATIN SMALL LETTER Y WITH RING ABOVE
+<dead_abovedot> <U017F> : "ẛ" U1E9B # LATIN SMALL LETTER LONG S WITH DOT ABOVE
+<Multi_key> <period> <U017F> : "ẛ" U1E9B # LATIN SMALL LETTER LONG S WITH DOT ABOVE
+<dead_belowdot> <A> : "Ạ" U1EA0 # LATIN CAPITAL LETTER A WITH DOT BELOW
+<Multi_key> <exclam> <A> : "Ạ" U1EA0 # LATIN CAPITAL LETTER A WITH DOT BELOW
+<dead_belowdot> <a> : "ạ" U1EA1 # LATIN SMALL LETTER A WITH DOT BELOW
+<Multi_key> <exclam> <a> : "ạ" U1EA1 # LATIN SMALL LETTER A WITH DOT BELOW
+<dead_hook> <A> : "Ả" U1EA2 # LATIN CAPITAL LETTER A WITH HOOK ABOVE
+<Multi_key> <question> <A> : "Ả" U1EA2 # LATIN CAPITAL LETTER A WITH HOOK ABOVE
+<dead_hook> <a> : "ả" U1EA3 # LATIN SMALL LETTER A WITH HOOK ABOVE
+<Multi_key> <question> <a> : "ả" U1EA3 # LATIN SMALL LETTER A WITH HOOK ABOVE
+<dead_acute> <Acircumflex> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <Acircumflex> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <Acircumflex> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
+<dead_acute> <dead_circumflex> <A> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
+<dead_acute> <Multi_key> <asciicircum> <A> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <dead_circumflex> <A> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <asciicircum> <A> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <dead_circumflex> <A> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <asciicircum> <A> : "Ấ" U1EA4 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
+<dead_acute> <acircumflex> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <acircumflex> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <acircumflex> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
+<dead_acute> <dead_circumflex> <a> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
+<dead_acute> <Multi_key> <asciicircum> <a> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <dead_circumflex> <a> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <asciicircum> <a> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <dead_circumflex> <a> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <asciicircum> <a> : "ấ" U1EA5 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
+<dead_grave> <Acircumflex> : "Ầ" U1EA6 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <Acircumflex> : "Ầ" U1EA6 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
+<dead_grave> <dead_circumflex> <A> : "Ầ" U1EA6 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
+<dead_grave> <Multi_key> <asciicircum> <A> : "Ầ" U1EA6 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <dead_circumflex> <A> : "Ầ" U1EA6 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <asciicircum> <A> : "Ầ" U1EA6 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
+<dead_grave> <acircumflex> : "ầ" U1EA7 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <acircumflex> : "ầ" U1EA7 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
+<dead_grave> <dead_circumflex> <a> : "ầ" U1EA7 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
+<dead_grave> <Multi_key> <asciicircum> <a> : "ầ" U1EA7 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <dead_circumflex> <a> : "ầ" U1EA7 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <asciicircum> <a> : "ầ" U1EA7 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
+<dead_hook> <Acircumflex> : "Ẩ" U1EA8 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <Acircumflex> : "Ẩ" U1EA8 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_hook> <dead_circumflex> <A> : "Ẩ" U1EA8 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_hook> <Multi_key> <asciicircum> <A> : "Ẩ" U1EA8 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <dead_circumflex> <A> : "Ẩ" U1EA8 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <asciicircum> <A> : "Ẩ" U1EA8 # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_hook> <acircumflex> : "ẩ" U1EA9 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <acircumflex> : "ẩ" U1EA9 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_hook> <dead_circumflex> <a> : "ẩ" U1EA9 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_hook> <Multi_key> <asciicircum> <a> : "ẩ" U1EA9 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <dead_circumflex> <a> : "ẩ" U1EA9 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <asciicircum> <a> : "ẩ" U1EA9 # LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_tilde> <Acircumflex> : "Ẫ" U1EAA # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <Acircumflex> : "Ẫ" U1EAA # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
+<dead_tilde> <dead_circumflex> <A> : "Ẫ" U1EAA # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
+<dead_tilde> <Multi_key> <asciicircum> <A> : "Ẫ" U1EAA # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <dead_circumflex> <A> : "Ẫ" U1EAA # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <asciicircum> <A> : "Ẫ" U1EAA # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
+<dead_tilde> <acircumflex> : "ẫ" U1EAB # LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <acircumflex> : "ẫ" U1EAB # LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
+<dead_tilde> <dead_circumflex> <a> : "ẫ" U1EAB # LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
+<dead_tilde> <Multi_key> <asciicircum> <a> : "ẫ" U1EAB # LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <dead_circumflex> <a> : "ẫ" U1EAB # LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <asciicircum> <a> : "ẫ" U1EAB # LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
+<dead_circumflex> <U1EA0> : "Ậ" U1EAC # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <U1EA0> : "Ậ" U1EAC # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+<dead_circumflex> <dead_belowdot> <A> : "Ậ" U1EAC # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+<dead_circumflex> <Multi_key> <exclam> <A> : "Ậ" U1EAC # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <dead_belowdot> <A> : "Ậ" U1EAC # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <exclam> <A> : "Ậ" U1EAC # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+<dead_belowdot> <Acircumflex> : "Ậ" U1EAC # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+<dead_circumflex> <U1EA1> : "ậ" U1EAD # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <U1EA1> : "ậ" U1EAD # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+<dead_circumflex> <dead_belowdot> <a> : "ậ" U1EAD # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+<dead_circumflex> <Multi_key> <exclam> <a> : "ậ" U1EAD # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <dead_belowdot> <a> : "ậ" U1EAD # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <exclam> <a> : "ậ" U1EAD # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+<dead_belowdot> <acircumflex> : "ậ" U1EAD # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+<dead_acute> <Abreve> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
+<Multi_key> <acute> <Abreve> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
+<Multi_key> <apostrophe> <Abreve> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
+<dead_acute> <dead_breve> <A> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
+<dead_acute> <Multi_key> <U> <A> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
+<dead_acute> <Multi_key> <b> <A> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
+<Multi_key> <acute> <dead_breve> <A> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
+<Multi_key> <acute> <b> <A> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
+<Multi_key> <apostrophe> <dead_breve> <A> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
+<Multi_key> <apostrophe> <b> <A> : "Ắ" U1EAE # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
+<dead_acute> <abreve> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
+<Multi_key> <acute> <abreve> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
+<Multi_key> <apostrophe> <abreve> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
+<dead_acute> <dead_breve> <a> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
+<dead_acute> <Multi_key> <U> <a> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
+<dead_acute> <Multi_key> <b> <a> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
+<Multi_key> <acute> <dead_breve> <a> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
+<Multi_key> <acute> <b> <a> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
+<Multi_key> <apostrophe> <dead_breve> <a> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
+<Multi_key> <apostrophe> <b> <a> : "ắ" U1EAF # LATIN SMALL LETTER A WITH BREVE AND ACUTE
+<dead_grave> <Abreve> : "Ằ" U1EB0 # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
+<Multi_key> <grave> <Abreve> : "Ằ" U1EB0 # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
+<dead_grave> <dead_breve> <A> : "Ằ" U1EB0 # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
+<dead_grave> <Multi_key> <U> <A> : "Ằ" U1EB0 # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
+<dead_grave> <Multi_key> <b> <A> : "Ằ" U1EB0 # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
+<Multi_key> <grave> <dead_breve> <A> : "Ằ" U1EB0 # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
+<Multi_key> <grave> <b> <A> : "Ằ" U1EB0 # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
+<dead_grave> <abreve> : "ằ" U1EB1 # LATIN SMALL LETTER A WITH BREVE AND GRAVE
+<Multi_key> <grave> <abreve> : "ằ" U1EB1 # LATIN SMALL LETTER A WITH BREVE AND GRAVE
+<dead_grave> <dead_breve> <a> : "ằ" U1EB1 # LATIN SMALL LETTER A WITH BREVE AND GRAVE
+<dead_grave> <Multi_key> <U> <a> : "ằ" U1EB1 # LATIN SMALL LETTER A WITH BREVE AND GRAVE
+<dead_grave> <Multi_key> <b> <a> : "ằ" U1EB1 # LATIN SMALL LETTER A WITH BREVE AND GRAVE
+<Multi_key> <grave> <dead_breve> <a> : "ằ" U1EB1 # LATIN SMALL LETTER A WITH BREVE AND GRAVE
+<Multi_key> <grave> <b> <a> : "ằ" U1EB1 # LATIN SMALL LETTER A WITH BREVE AND GRAVE
+<dead_hook> <Abreve> : "Ẳ" U1EB2 # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
+<Multi_key> <question> <Abreve> : "Ẳ" U1EB2 # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
+<dead_hook> <dead_breve> <A> : "Ẳ" U1EB2 # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
+<dead_hook> <Multi_key> <U> <A> : "Ẳ" U1EB2 # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
+<dead_hook> <Multi_key> <b> <A> : "Ẳ" U1EB2 # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
+<Multi_key> <question> <dead_breve> <A> : "Ẳ" U1EB2 # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
+<Multi_key> <question> <b> <A> : "Ẳ" U1EB2 # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
+<dead_hook> <abreve> : "ẳ" U1EB3 # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
+<Multi_key> <question> <abreve> : "ẳ" U1EB3 # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
+<dead_hook> <dead_breve> <a> : "ẳ" U1EB3 # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
+<dead_hook> <Multi_key> <U> <a> : "ẳ" U1EB3 # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
+<dead_hook> <Multi_key> <b> <a> : "ẳ" U1EB3 # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
+<Multi_key> <question> <dead_breve> <a> : "ẳ" U1EB3 # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
+<Multi_key> <question> <b> <a> : "ẳ" U1EB3 # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
+<dead_tilde> <Abreve> : "Ẵ" U1EB4 # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
+<Multi_key> <asciitilde> <Abreve> : "Ẵ" U1EB4 # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
+<dead_tilde> <dead_breve> <A> : "Ẵ" U1EB4 # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
+<dead_tilde> <Multi_key> <U> <A> : "Ẵ" U1EB4 # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
+<dead_tilde> <Multi_key> <b> <A> : "Ẵ" U1EB4 # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
+<Multi_key> <asciitilde> <dead_breve> <A> : "Ẵ" U1EB4 # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
+<Multi_key> <asciitilde> <b> <A> : "Ẵ" U1EB4 # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
+<dead_tilde> <abreve> : "ẵ" U1EB5 # LATIN SMALL LETTER A WITH BREVE AND TILDE
+<Multi_key> <asciitilde> <abreve> : "ẵ" U1EB5 # LATIN SMALL LETTER A WITH BREVE AND TILDE
+<dead_tilde> <dead_breve> <a> : "ẵ" U1EB5 # LATIN SMALL LETTER A WITH BREVE AND TILDE
+<dead_tilde> <Multi_key> <U> <a> : "ẵ" U1EB5 # LATIN SMALL LETTER A WITH BREVE AND TILDE
+<dead_tilde> <Multi_key> <b> <a> : "ẵ" U1EB5 # LATIN SMALL LETTER A WITH BREVE AND TILDE
+<Multi_key> <asciitilde> <dead_breve> <a> : "ẵ" U1EB5 # LATIN SMALL LETTER A WITH BREVE AND TILDE
+<Multi_key> <asciitilde> <b> <a> : "ẵ" U1EB5 # LATIN SMALL LETTER A WITH BREVE AND TILDE
+<dead_breve> <U1EA0> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
+<Multi_key> <U> <U1EA0> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
+<Multi_key> <b> <U1EA0> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
+<dead_breve> <dead_belowdot> <A> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
+<dead_breve> <Multi_key> <exclam> <A> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
+<Multi_key> <U> <dead_belowdot> <A> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
+<Multi_key> <U> <exclam> <A> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
+<Multi_key> <b> <dead_belowdot> <A> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
+<Multi_key> <b> <exclam> <A> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
+<dead_belowdot> <Abreve> : "Ặ" U1EB6 # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
+<dead_breve> <U1EA1> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
+<Multi_key> <U> <U1EA1> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
+<Multi_key> <b> <U1EA1> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
+<dead_breve> <dead_belowdot> <a> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
+<dead_breve> <Multi_key> <exclam> <a> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
+<Multi_key> <U> <dead_belowdot> <a> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
+<Multi_key> <U> <exclam> <a> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
+<Multi_key> <b> <dead_belowdot> <a> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
+<Multi_key> <b> <exclam> <a> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
+<dead_belowdot> <abreve> : "ặ" U1EB7 # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
+<dead_belowdot> <E> : "Ẹ" U1EB8 # LATIN CAPITAL LETTER E WITH DOT BELOW
+<Multi_key> <exclam> <E> : "Ẹ" U1EB8 # LATIN CAPITAL LETTER E WITH DOT BELOW
+<dead_belowdot> <e> : "ẹ" U1EB9 # LATIN SMALL LETTER E WITH DOT BELOW
+<Multi_key> <exclam> <e> : "ẹ" U1EB9 # LATIN SMALL LETTER E WITH DOT BELOW
+<dead_hook> <E> : "Ẻ" U1EBA # LATIN CAPITAL LETTER E WITH HOOK ABOVE
+<Multi_key> <question> <E> : "Ẻ" U1EBA # LATIN CAPITAL LETTER E WITH HOOK ABOVE
+<dead_hook> <e> : "ẻ" U1EBB # LATIN SMALL LETTER E WITH HOOK ABOVE
+<Multi_key> <question> <e> : "ẻ" U1EBB # LATIN SMALL LETTER E WITH HOOK ABOVE
+<dead_tilde> <E> : "Ẽ" U1EBC # LATIN CAPITAL LETTER E WITH TILDE
+<Multi_key> <asciitilde> <E> : "Ẽ" U1EBC # LATIN CAPITAL LETTER E WITH TILDE
+<dead_tilde> <e> : "ẽ" U1EBD # LATIN SMALL LETTER E WITH TILDE
+<Multi_key> <asciitilde> <e> : "ẽ" U1EBD # LATIN SMALL LETTER E WITH TILDE
+<dead_acute> <Ecircumflex> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <Ecircumflex> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <Ecircumflex> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
+<dead_acute> <dead_circumflex> <E> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
+<dead_acute> <Multi_key> <asciicircum> <E> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <dead_circumflex> <E> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <asciicircum> <E> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <dead_circumflex> <E> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <asciicircum> <E> : "Ế" U1EBE # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
+<dead_acute> <ecircumflex> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <ecircumflex> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <ecircumflex> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
+<dead_acute> <dead_circumflex> <e> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
+<dead_acute> <Multi_key> <asciicircum> <e> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <dead_circumflex> <e> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <asciicircum> <e> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <dead_circumflex> <e> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <asciicircum> <e> : "ế" U1EBF # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
+<dead_grave> <Ecircumflex> : "Ề" U1EC0 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <Ecircumflex> : "Ề" U1EC0 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
+<dead_grave> <dead_circumflex> <E> : "Ề" U1EC0 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
+<dead_grave> <Multi_key> <asciicircum> <E> : "Ề" U1EC0 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <dead_circumflex> <E> : "Ề" U1EC0 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <asciicircum> <E> : "Ề" U1EC0 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
+<dead_grave> <ecircumflex> : "ề" U1EC1 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <ecircumflex> : "ề" U1EC1 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
+<dead_grave> <dead_circumflex> <e> : "ề" U1EC1 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
+<dead_grave> <Multi_key> <asciicircum> <e> : "ề" U1EC1 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <dead_circumflex> <e> : "ề" U1EC1 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <asciicircum> <e> : "ề" U1EC1 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
+<dead_hook> <Ecircumflex> : "Ể" U1EC2 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <Ecircumflex> : "Ể" U1EC2 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_hook> <dead_circumflex> <E> : "Ể" U1EC2 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_hook> <Multi_key> <asciicircum> <E> : "Ể" U1EC2 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <dead_circumflex> <E> : "Ể" U1EC2 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <asciicircum> <E> : "Ể" U1EC2 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_hook> <ecircumflex> : "ể" U1EC3 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <ecircumflex> : "ể" U1EC3 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_hook> <dead_circumflex> <e> : "ể" U1EC3 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_hook> <Multi_key> <asciicircum> <e> : "ể" U1EC3 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <dead_circumflex> <e> : "ể" U1EC3 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <asciicircum> <e> : "ể" U1EC3 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_tilde> <Ecircumflex> : "Ễ" U1EC4 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <Ecircumflex> : "Ễ" U1EC4 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
+<dead_tilde> <dead_circumflex> <E> : "Ễ" U1EC4 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
+<dead_tilde> <Multi_key> <asciicircum> <E> : "Ễ" U1EC4 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <dead_circumflex> <E> : "Ễ" U1EC4 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <asciicircum> <E> : "Ễ" U1EC4 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
+<dead_tilde> <ecircumflex> : "ễ" U1EC5 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <ecircumflex> : "ễ" U1EC5 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
+<dead_tilde> <dead_circumflex> <e> : "ễ" U1EC5 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
+<dead_tilde> <Multi_key> <asciicircum> <e> : "ễ" U1EC5 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <dead_circumflex> <e> : "ễ" U1EC5 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <asciicircum> <e> : "ễ" U1EC5 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
+<dead_circumflex> <U1EB8> : "Ệ" U1EC6 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <U1EB8> : "Ệ" U1EC6 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+<dead_circumflex> <dead_belowdot> <E> : "Ệ" U1EC6 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+<dead_circumflex> <Multi_key> <exclam> <E> : "Ệ" U1EC6 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <dead_belowdot> <E> : "Ệ" U1EC6 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <exclam> <E> : "Ệ" U1EC6 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+<dead_belowdot> <Ecircumflex> : "Ệ" U1EC6 # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+<dead_circumflex> <U1EB9> : "ệ" U1EC7 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <U1EB9> : "ệ" U1EC7 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+<dead_circumflex> <dead_belowdot> <e> : "ệ" U1EC7 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+<dead_circumflex> <Multi_key> <exclam> <e> : "ệ" U1EC7 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <dead_belowdot> <e> : "ệ" U1EC7 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <exclam> <e> : "ệ" U1EC7 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+<dead_belowdot> <ecircumflex> : "ệ" U1EC7 # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+<dead_hook> <I> : "Ỉ" U1EC8 # LATIN CAPITAL LETTER I WITH HOOK ABOVE
+<Multi_key> <question> <I> : "Ỉ" U1EC8 # LATIN CAPITAL LETTER I WITH HOOK ABOVE
+<dead_hook> <i> : "ỉ" U1EC9 # LATIN SMALL LETTER I WITH HOOK ABOVE
+<Multi_key> <question> <i> : "ỉ" U1EC9 # LATIN SMALL LETTER I WITH HOOK ABOVE
+<dead_belowdot> <I> : "Ị" U1ECA # LATIN CAPITAL LETTER I WITH DOT BELOW
+<Multi_key> <exclam> <I> : "Ị" U1ECA # LATIN CAPITAL LETTER I WITH DOT BELOW
+<dead_belowdot> <i> : "ị" U1ECB # LATIN SMALL LETTER I WITH DOT BELOW
+<Multi_key> <exclam> <i> : "ị" U1ECB # LATIN SMALL LETTER I WITH DOT BELOW
+<dead_belowdot> <O> : "Ọ" U1ECC # LATIN CAPITAL LETTER O WITH DOT BELOW
+<Multi_key> <exclam> <O> : "Ọ" U1ECC # LATIN CAPITAL LETTER O WITH DOT BELOW
+<dead_belowdot> <o> : "ọ" U1ECD # LATIN SMALL LETTER O WITH DOT BELOW
+<Multi_key> <exclam> <o> : "ọ" U1ECD # LATIN SMALL LETTER O WITH DOT BELOW
+<dead_hook> <O> : "Ỏ" U1ECE # LATIN CAPITAL LETTER O WITH HOOK ABOVE
+<Multi_key> <question> <O> : "Ỏ" U1ECE # LATIN CAPITAL LETTER O WITH HOOK ABOVE
+<dead_hook> <o> : "ỏ" U1ECF # LATIN SMALL LETTER O WITH HOOK ABOVE
+<Multi_key> <question> <o> : "ỏ" U1ECF # LATIN SMALL LETTER O WITH HOOK ABOVE
+<dead_acute> <Ocircumflex> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <Ocircumflex> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <Ocircumflex> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
+<dead_acute> <dead_circumflex> <O> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
+<dead_acute> <Multi_key> <asciicircum> <O> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <dead_circumflex> <O> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <asciicircum> <O> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <dead_circumflex> <O> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <asciicircum> <O> : "Ố" U1ED0 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
+<dead_acute> <ocircumflex> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <ocircumflex> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <ocircumflex> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
+<dead_acute> <dead_circumflex> <o> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
+<dead_acute> <Multi_key> <asciicircum> <o> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <dead_circumflex> <o> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <acute> <asciicircum> <o> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <dead_circumflex> <o> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
+<Multi_key> <apostrophe> <asciicircum> <o> : "ố" U1ED1 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
+<dead_grave> <Ocircumflex> : "Ồ" U1ED2 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <Ocircumflex> : "Ồ" U1ED2 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
+<dead_grave> <dead_circumflex> <O> : "Ồ" U1ED2 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
+<dead_grave> <Multi_key> <asciicircum> <O> : "Ồ" U1ED2 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <dead_circumflex> <O> : "Ồ" U1ED2 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <asciicircum> <O> : "Ồ" U1ED2 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
+<dead_grave> <ocircumflex> : "ồ" U1ED3 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <ocircumflex> : "ồ" U1ED3 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
+<dead_grave> <dead_circumflex> <o> : "ồ" U1ED3 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
+<dead_grave> <Multi_key> <asciicircum> <o> : "ồ" U1ED3 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <dead_circumflex> <o> : "ồ" U1ED3 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
+<Multi_key> <grave> <asciicircum> <o> : "ồ" U1ED3 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
+<dead_hook> <Ocircumflex> : "Ổ" U1ED4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <Ocircumflex> : "Ổ" U1ED4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_hook> <dead_circumflex> <O> : "Ổ" U1ED4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_hook> <Multi_key> <asciicircum> <O> : "Ổ" U1ED4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <dead_circumflex> <O> : "Ổ" U1ED4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <asciicircum> <O> : "Ổ" U1ED4 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_hook> <ocircumflex> : "ổ" U1ED5 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <ocircumflex> : "ổ" U1ED5 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_hook> <dead_circumflex> <o> : "ổ" U1ED5 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_hook> <Multi_key> <asciicircum> <o> : "ổ" U1ED5 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <dead_circumflex> <o> : "ổ" U1ED5 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+<Multi_key> <question> <asciicircum> <o> : "ổ" U1ED5 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_tilde> <Ocircumflex> : "Ỗ" U1ED6 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <Ocircumflex> : "Ỗ" U1ED6 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
+<dead_tilde> <dead_circumflex> <O> : "Ỗ" U1ED6 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
+<dead_tilde> <Multi_key> <asciicircum> <O> : "Ỗ" U1ED6 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <dead_circumflex> <O> : "Ỗ" U1ED6 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <asciicircum> <O> : "Ỗ" U1ED6 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
+<dead_tilde> <ocircumflex> : "ỗ" U1ED7 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <ocircumflex> : "ỗ" U1ED7 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
+<dead_tilde> <dead_circumflex> <o> : "ỗ" U1ED7 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
+<dead_tilde> <Multi_key> <asciicircum> <o> : "ỗ" U1ED7 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <dead_circumflex> <o> : "ỗ" U1ED7 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
+<Multi_key> <asciitilde> <asciicircum> <o> : "ỗ" U1ED7 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
+<dead_circumflex> <U1ECC> : "Ộ" U1ED8 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <U1ECC> : "Ộ" U1ED8 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+<dead_circumflex> <dead_belowdot> <O> : "Ộ" U1ED8 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+<dead_circumflex> <Multi_key> <exclam> <O> : "Ộ" U1ED8 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <dead_belowdot> <O> : "Ộ" U1ED8 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <exclam> <O> : "Ộ" U1ED8 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+<dead_belowdot> <Ocircumflex> : "Ộ" U1ED8 # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+<dead_circumflex> <U1ECD> : "ộ" U1ED9 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <U1ECD> : "ộ" U1ED9 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+<dead_circumflex> <dead_belowdot> <o> : "ộ" U1ED9 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+<dead_circumflex> <Multi_key> <exclam> <o> : "ộ" U1ED9 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <dead_belowdot> <o> : "ộ" U1ED9 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+<Multi_key> <asciicircum> <exclam> <o> : "ộ" U1ED9 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+<dead_belowdot> <ocircumflex> : "ộ" U1ED9 # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+<dead_acute> <Ohorn> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
+<dead_acute> <U01A0> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
+<Multi_key> <acute> <Ohorn> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
+<Multi_key> <apostrophe> <Ohorn> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
+<dead_acute> <dead_horn> <O> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
+<dead_acute> <Multi_key> <plus> <O> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
+<Multi_key> <acute> <dead_horn> <O> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
+<Multi_key> <acute> <plus> <O> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
+<Multi_key> <apostrophe> <dead_horn> <O> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
+<Multi_key> <apostrophe> <plus> <O> : "Ớ" U1EDA # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
+<dead_acute> <ohorn> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
+<dead_acute> <U01A1> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
+<Multi_key> <acute> <ohorn> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
+<Multi_key> <apostrophe> <ohorn> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
+<dead_acute> <dead_horn> <o> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
+<dead_acute> <Multi_key> <plus> <o> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
+<Multi_key> <acute> <dead_horn> <o> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
+<Multi_key> <acute> <plus> <o> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
+<Multi_key> <apostrophe> <dead_horn> <o> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
+<Multi_key> <apostrophe> <plus> <o> : "ớ" U1EDB # LATIN SMALL LETTER O WITH HORN AND ACUTE
+<dead_grave> <Ohorn> : "Ờ" U1EDC # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
+<dead_grave> <U01A0> : "Ờ" U1EDC # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
+<Multi_key> <grave> <Ohorn> : "Ờ" U1EDC # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
+<dead_grave> <dead_horn> <O> : "Ờ" U1EDC # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
+<dead_grave> <Multi_key> <plus> <O> : "Ờ" U1EDC # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
+<Multi_key> <grave> <dead_horn> <O> : "Ờ" U1EDC # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
+<Multi_key> <grave> <plus> <O> : "Ờ" U1EDC # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
+<dead_grave> <ohorn> : "ờ" U1EDD # LATIN SMALL LETTER O WITH HORN AND GRAVE
+<dead_grave> <U01A1> : "ờ" U1EDD # LATIN SMALL LETTER O WITH HORN AND GRAVE
+<Multi_key> <grave> <ohorn> : "ờ" U1EDD # LATIN SMALL LETTER O WITH HORN AND GRAVE
+<dead_grave> <dead_horn> <o> : "ờ" U1EDD # LATIN SMALL LETTER O WITH HORN AND GRAVE
+<dead_grave> <Multi_key> <plus> <o> : "ờ" U1EDD # LATIN SMALL LETTER O WITH HORN AND GRAVE
+<Multi_key> <grave> <dead_horn> <o> : "ờ" U1EDD # LATIN SMALL LETTER O WITH HORN AND GRAVE
+<Multi_key> <grave> <plus> <o> : "ờ" U1EDD # LATIN SMALL LETTER O WITH HORN AND GRAVE
+<dead_hook> <Ohorn> : "Ở" U1EDE # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
+<dead_hook> <U01A0> : "Ở" U1EDE # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
+<Multi_key> <question> <Ohorn> : "Ở" U1EDE # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
+<dead_hook> <dead_horn> <O> : "Ở" U1EDE # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
+<dead_hook> <Multi_key> <plus> <O> : "Ở" U1EDE # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
+<Multi_key> <question> <dead_horn> <O> : "Ở" U1EDE # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
+<Multi_key> <question> <plus> <O> : "Ở" U1EDE # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
+<dead_hook> <ohorn> : "ở" U1EDF # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
+<dead_hook> <U01A1> : "ở" U1EDF # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
+<Multi_key> <question> <ohorn> : "ở" U1EDF # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
+<dead_hook> <dead_horn> <o> : "ở" U1EDF # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
+<dead_hook> <Multi_key> <plus> <o> : "ở" U1EDF # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
+<Multi_key> <question> <dead_horn> <o> : "ở" U1EDF # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
+<Multi_key> <question> <plus> <o> : "ở" U1EDF # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
+<dead_tilde> <Ohorn> : "Ỡ" U1EE0 # LATIN CAPITAL LETTER O WITH HORN AND TILDE
+<dead_tilde> <U01A0> : "Ỡ" U1EE0 # LATIN CAPITAL LETTER O WITH HORN AND TILDE
+<Multi_key> <asciitilde> <Ohorn> : "Ỡ" U1EE0 # LATIN CAPITAL LETTER O WITH HORN AND TILDE
+<dead_tilde> <dead_horn> <O> : "Ỡ" U1EE0 # LATIN CAPITAL LETTER O WITH HORN AND TILDE
+<dead_tilde> <Multi_key> <plus> <O> : "Ỡ" U1EE0 # LATIN CAPITAL LETTER O WITH HORN AND TILDE
+<Multi_key> <asciitilde> <dead_horn> <O> : "Ỡ" U1EE0 # LATIN CAPITAL LETTER O WITH HORN AND TILDE
+<Multi_key> <asciitilde> <plus> <O> : "Ỡ" U1EE0 # LATIN CAPITAL LETTER O WITH HORN AND TILDE
+<dead_tilde> <ohorn> : "ỡ" U1EE1 # LATIN SMALL LETTER O WITH HORN AND TILDE
+<dead_tilde> <U01A1> : "ỡ" U1EE1 # LATIN SMALL LETTER O WITH HORN AND TILDE
+<Multi_key> <asciitilde> <ohorn> : "ỡ" U1EE1 # LATIN SMALL LETTER O WITH HORN AND TILDE
+<dead_tilde> <dead_horn> <o> : "ỡ" U1EE1 # LATIN SMALL LETTER O WITH HORN AND TILDE
+<dead_tilde> <Multi_key> <plus> <o> : "ỡ" U1EE1 # LATIN SMALL LETTER O WITH HORN AND TILDE
+<Multi_key> <asciitilde> <dead_horn> <o> : "ỡ" U1EE1 # LATIN SMALL LETTER O WITH HORN AND TILDE
+<Multi_key> <asciitilde> <plus> <o> : "ỡ" U1EE1 # LATIN SMALL LETTER O WITH HORN AND TILDE
+<dead_belowdot> <Ohorn> : "Ợ" U1EE2 # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
+<dead_belowdot> <U01A0> : "Ợ" U1EE2 # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
+<Multi_key> <exclam> <Ohorn> : "Ợ" U1EE2 # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
+<dead_belowdot> <dead_horn> <O> : "Ợ" U1EE2 # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
+<dead_belowdot> <Multi_key> <plus> <O> : "Ợ" U1EE2 # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
+<Multi_key> <exclam> <dead_horn> <O> : "Ợ" U1EE2 # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
+<Multi_key> <exclam> <plus> <O> : "Ợ" U1EE2 # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
+<dead_belowdot> <ohorn> : "ợ" U1EE3 # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
+<dead_belowdot> <U01A1> : "ợ" U1EE3 # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
+<Multi_key> <exclam> <ohorn> : "ợ" U1EE3 # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
+<dead_belowdot> <dead_horn> <o> : "ợ" U1EE3 # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
+<dead_belowdot> <Multi_key> <plus> <o> : "ợ" U1EE3 # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
+<Multi_key> <exclam> <dead_horn> <o> : "ợ" U1EE3 # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
+<Multi_key> <exclam> <plus> <o> : "ợ" U1EE3 # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
+<dead_belowdot> <U> : "Ụ" U1EE4 # LATIN CAPITAL LETTER U WITH DOT BELOW
+<Multi_key> <exclam> <U> : "Ụ" U1EE4 # LATIN CAPITAL LETTER U WITH DOT BELOW
+<dead_belowdot> <u> : "ụ" U1EE5 # LATIN SMALL LETTER U WITH DOT BELOW
+<Multi_key> <exclam> <u> : "ụ" U1EE5 # LATIN SMALL LETTER U WITH DOT BELOW
+<dead_hook> <U> : "Ủ" U1EE6 # LATIN CAPITAL LETTER U WITH HOOK ABOVE
+<Multi_key> <question> <U> : "Ủ" U1EE6 # LATIN CAPITAL LETTER U WITH HOOK ABOVE
+<dead_hook> <u> : "ủ" U1EE7 # LATIN SMALL LETTER U WITH HOOK ABOVE
+<Multi_key> <question> <u> : "ủ" U1EE7 # LATIN SMALL LETTER U WITH HOOK ABOVE
+<dead_acute> <Uhorn> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
+<dead_acute> <U01AF> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
+<Multi_key> <acute> <Uhorn> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
+<Multi_key> <apostrophe> <Uhorn> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
+<dead_acute> <dead_horn> <U> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
+<dead_acute> <Multi_key> <plus> <U> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
+<Multi_key> <acute> <dead_horn> <U> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
+<Multi_key> <acute> <plus> <U> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
+<Multi_key> <apostrophe> <dead_horn> <U> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
+<Multi_key> <apostrophe> <plus> <U> : "Ứ" U1EE8 # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
+<dead_acute> <uhorn> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
+<dead_acute> <U01B0> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
+<Multi_key> <acute> <uhorn> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
+<Multi_key> <apostrophe> <uhorn> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
+<dead_acute> <dead_horn> <u> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
+<dead_acute> <Multi_key> <plus> <u> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
+<Multi_key> <acute> <dead_horn> <u> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
+<Multi_key> <acute> <plus> <u> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
+<Multi_key> <apostrophe> <dead_horn> <u> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
+<Multi_key> <apostrophe> <plus> <u> : "ứ" U1EE9 # LATIN SMALL LETTER U WITH HORN AND ACUTE
+<dead_grave> <Uhorn> : "Ừ" U1EEA # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
+<dead_grave> <U01AF> : "Ừ" U1EEA # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
+<Multi_key> <grave> <Uhorn> : "Ừ" U1EEA # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
+<dead_grave> <dead_horn> <U> : "Ừ" U1EEA # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
+<dead_grave> <Multi_key> <plus> <U> : "Ừ" U1EEA # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
+<Multi_key> <grave> <dead_horn> <U> : "Ừ" U1EEA # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
+<Multi_key> <grave> <plus> <U> : "Ừ" U1EEA # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
+<dead_grave> <uhorn> : "ừ" U1EEB # LATIN SMALL LETTER U WITH HORN AND GRAVE
+<dead_grave> <U01B0> : "ừ" U1EEB # LATIN SMALL LETTER U WITH HORN AND GRAVE
+<Multi_key> <grave> <uhorn> : "ừ" U1EEB # LATIN SMALL LETTER U WITH HORN AND GRAVE
+<dead_grave> <dead_horn> <u> : "ừ" U1EEB # LATIN SMALL LETTER U WITH HORN AND GRAVE
+<dead_grave> <Multi_key> <plus> <u> : "ừ" U1EEB # LATIN SMALL LETTER U WITH HORN AND GRAVE
+<Multi_key> <grave> <dead_horn> <u> : "ừ" U1EEB # LATIN SMALL LETTER U WITH HORN AND GRAVE
+<Multi_key> <grave> <plus> <u> : "ừ" U1EEB # LATIN SMALL LETTER U WITH HORN AND GRAVE
+<dead_hook> <Uhorn> : "Ử" U1EEC # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
+<dead_hook> <U01AF> : "Ử" U1EEC # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
+<Multi_key> <question> <Uhorn> : "Ử" U1EEC # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
+<dead_hook> <dead_horn> <U> : "Ử" U1EEC # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
+<dead_hook> <Multi_key> <plus> <U> : "Ử" U1EEC # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
+<Multi_key> <question> <dead_horn> <U> : "Ử" U1EEC # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
+<Multi_key> <question> <plus> <U> : "Ử" U1EEC # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
+<dead_hook> <uhorn> : "ử" U1EED # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
+<dead_hook> <U01B0> : "ử" U1EED # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
+<Multi_key> <question> <uhorn> : "ử" U1EED # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
+<dead_hook> <dead_horn> <u> : "ử" U1EED # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
+<dead_hook> <Multi_key> <plus> <u> : "ử" U1EED # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
+<Multi_key> <question> <dead_horn> <u> : "ử" U1EED # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
+<Multi_key> <question> <plus> <u> : "ử" U1EED # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
+<dead_tilde> <Uhorn> : "Ữ" U1EEE # LATIN CAPITAL LETTER U WITH HORN AND TILDE
+<dead_tilde> <U01AF> : "Ữ" U1EEE # LATIN CAPITAL LETTER U WITH HORN AND TILDE
+<Multi_key> <asciitilde> <Uhorn> : "Ữ" U1EEE # LATIN CAPITAL LETTER U WITH HORN AND TILDE
+<dead_tilde> <dead_horn> <U> : "Ữ" U1EEE # LATIN CAPITAL LETTER U WITH HORN AND TILDE
+<dead_tilde> <Multi_key> <plus> <U> : "Ữ" U1EEE # LATIN CAPITAL LETTER U WITH HORN AND TILDE
+<Multi_key> <asciitilde> <dead_horn> <U> : "Ữ" U1EEE # LATIN CAPITAL LETTER U WITH HORN AND TILDE
+<Multi_key> <asciitilde> <plus> <U> : "Ữ" U1EEE # LATIN CAPITAL LETTER U WITH HORN AND TILDE
+<dead_tilde> <uhorn> : "ữ" U1EEF # LATIN SMALL LETTER U WITH HORN AND TILDE
+<dead_tilde> <U01B0> : "ữ" U1EEF # LATIN SMALL LETTER U WITH HORN AND TILDE
+<Multi_key> <asciitilde> <uhorn> : "ữ" U1EEF # LATIN SMALL LETTER U WITH HORN AND TILDE
+<dead_tilde> <dead_horn> <u> : "ữ" U1EEF # LATIN SMALL LETTER U WITH HORN AND TILDE
+<dead_tilde> <Multi_key> <plus> <u> : "ữ" U1EEF # LATIN SMALL LETTER U WITH HORN AND TILDE
+<Multi_key> <asciitilde> <dead_horn> <u> : "ữ" U1EEF # LATIN SMALL LETTER U WITH HORN AND TILDE
+<Multi_key> <asciitilde> <plus> <u> : "ữ" U1EEF # LATIN SMALL LETTER U WITH HORN AND TILDE
+<dead_belowdot> <Uhorn> : "Ự" U1EF0 # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
+<dead_belowdot> <U01AF> : "Ự" U1EF0 # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
+<Multi_key> <exclam> <Uhorn> : "Ự" U1EF0 # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
+<dead_belowdot> <dead_horn> <U> : "Ự" U1EF0 # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
+<dead_belowdot> <Multi_key> <plus> <U> : "Ự" U1EF0 # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
+<Multi_key> <exclam> <dead_horn> <U> : "Ự" U1EF0 # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
+<Multi_key> <exclam> <plus> <U> : "Ự" U1EF0 # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
+<dead_belowdot> <uhorn> : "ự" U1EF1 # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
+<dead_belowdot> <U01B0> : "ự" U1EF1 # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
+<Multi_key> <exclam> <uhorn> : "ự" U1EF1 # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
+<dead_belowdot> <dead_horn> <u> : "ự" U1EF1 # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
+<dead_belowdot> <Multi_key> <plus> <u> : "ự" U1EF1 # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
+<Multi_key> <exclam> <dead_horn> <u> : "ự" U1EF1 # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
+<Multi_key> <exclam> <plus> <u> : "ự" U1EF1 # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
+<dead_grave> <Y> : "Ỳ" U1EF2 # LATIN CAPITAL LETTER Y WITH GRAVE
+<Multi_key> <grave> <Y> : "Ỳ" U1EF2 # LATIN CAPITAL LETTER Y WITH GRAVE
+<dead_grave> <y> : "ỳ" U1EF3 # LATIN SMALL LETTER Y WITH GRAVE
+<Multi_key> <grave> <y> : "ỳ" U1EF3 # LATIN SMALL LETTER Y WITH GRAVE
+<dead_belowdot> <Y> : "Ỵ" U1EF4 # LATIN CAPITAL LETTER Y WITH DOT BELOW
+<Multi_key> <exclam> <Y> : "Ỵ" U1EF4 # LATIN CAPITAL LETTER Y WITH DOT BELOW
+<dead_belowdot> <y> : "ỵ" U1EF5 # LATIN SMALL LETTER Y WITH DOT BELOW
+<Multi_key> <exclam> <y> : "ỵ" U1EF5 # LATIN SMALL LETTER Y WITH DOT BELOW
+<dead_hook> <Y> : "Ỷ" U1EF6 # LATIN CAPITAL LETTER Y WITH HOOK ABOVE
+<Multi_key> <question> <Y> : "Ỷ" U1EF6 # LATIN CAPITAL LETTER Y WITH HOOK ABOVE
+<dead_hook> <y> : "ỷ" U1EF7 # LATIN SMALL LETTER Y WITH HOOK ABOVE
+<Multi_key> <question> <y> : "ỷ" U1EF7 # LATIN SMALL LETTER Y WITH HOOK ABOVE
+<dead_tilde> <Y> : "Ỹ" U1EF8 # LATIN CAPITAL LETTER Y WITH TILDE
+<Multi_key> <asciitilde> <Y> : "Ỹ" U1EF8 # LATIN CAPITAL LETTER Y WITH TILDE
+<dead_tilde> <y> : "ỹ" U1EF9 # LATIN SMALL LETTER Y WITH TILDE
+<Multi_key> <asciitilde> <y> : "ỹ" U1EF9 # LATIN SMALL LETTER Y WITH TILDE
+<dead_psili> <Greek_alpha> : "ἀ" U1F00 # GREEK SMALL LETTER ALPHA WITH PSILI
+<Multi_key> <parenright> <Greek_alpha> : "ἀ" U1F00 # GREEK SMALL LETTER ALPHA WITH PSILI
+<dead_dasia> <Greek_alpha> : "ἁ" U1F01 # GREEK SMALL LETTER ALPHA WITH DASIA
+<Multi_key> <parenleft> <Greek_alpha> : "ἁ" U1F01 # GREEK SMALL LETTER ALPHA WITH DASIA
+<dead_grave> <U1F00> : "ἂ" U1F02 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA
+<Multi_key> <grave> <U1F00> : "ἂ" U1F02 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA
+<dead_grave> <dead_psili> <Greek_alpha> : "ἂ" U1F02 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA
+<dead_grave> <Multi_key> <parenright> <Greek_alpha> : "ἂ" U1F02 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA
+<Multi_key> <grave> <dead_psili> <Greek_alpha> : "ἂ" U1F02 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA
+<Multi_key> <grave> <parenright> <Greek_alpha> : "ἂ" U1F02 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA
+<dead_grave> <U1F01> : "ἃ" U1F03 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA
+<Multi_key> <grave> <U1F01> : "ἃ" U1F03 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA
+<dead_grave> <dead_dasia> <Greek_alpha> : "ἃ" U1F03 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA
+<dead_grave> <Multi_key> <parenleft> <Greek_alpha> : "ἃ" U1F03 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA
+<Multi_key> <grave> <dead_dasia> <Greek_alpha> : "ἃ" U1F03 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA
+<Multi_key> <grave> <parenleft> <Greek_alpha> : "ἃ" U1F03 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA
+<dead_acute> <U1F00> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
+<Multi_key> <acute> <U1F00> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <U1F00> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
+<dead_acute> <dead_psili> <Greek_alpha> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
+<dead_acute> <Multi_key> <parenright> <Greek_alpha> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
+<Multi_key> <acute> <dead_psili> <Greek_alpha> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
+<Multi_key> <acute> <parenright> <Greek_alpha> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <dead_psili> <Greek_alpha> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <parenright> <Greek_alpha> : "ἄ" U1F04 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA
+<dead_acute> <U1F01> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
+<Multi_key> <acute> <U1F01> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <U1F01> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
+<dead_acute> <dead_dasia> <Greek_alpha> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
+<dead_acute> <Multi_key> <parenleft> <Greek_alpha> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
+<Multi_key> <acute> <dead_dasia> <Greek_alpha> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
+<Multi_key> <acute> <parenleft> <Greek_alpha> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <dead_dasia> <Greek_alpha> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <parenleft> <Greek_alpha> : "ἅ" U1F05 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA
+<dead_tilde> <U1F00> : "ἆ" U1F06 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F00> : "ἆ" U1F06 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI
+<dead_tilde> <dead_psili> <Greek_alpha> : "ἆ" U1F06 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenright> <Greek_alpha> : "ἆ" U1F06 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_psili> <Greek_alpha> : "ἆ" U1F06 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <parenright> <Greek_alpha> : "ἆ" U1F06 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI
+<dead_tilde> <U1F01> : "ἇ" U1F07 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F01> : "ἇ" U1F07 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
+<dead_tilde> <dead_dasia> <Greek_alpha> : "ἇ" U1F07 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenleft> <Greek_alpha> : "ἇ" U1F07 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_dasia> <Greek_alpha> : "ἇ" U1F07 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <parenleft> <Greek_alpha> : "ἇ" U1F07 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI
+<dead_psili> <Greek_ALPHA> : "Ἀ" U1F08 # GREEK CAPITAL LETTER ALPHA WITH PSILI
+<Multi_key> <parenright> <Greek_ALPHA> : "Ἀ" U1F08 # GREEK CAPITAL LETTER ALPHA WITH PSILI
+<dead_dasia> <Greek_ALPHA> : "Ἁ" U1F09 # GREEK CAPITAL LETTER ALPHA WITH DASIA
+<Multi_key> <parenleft> <Greek_ALPHA> : "Ἁ" U1F09 # GREEK CAPITAL LETTER ALPHA WITH DASIA
+<dead_grave> <U1F08> : "Ἂ" U1F0A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA
+<Multi_key> <grave> <U1F08> : "Ἂ" U1F0A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA
+<dead_grave> <dead_psili> <Greek_ALPHA> : "Ἂ" U1F0A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA
+<dead_grave> <Multi_key> <parenright> <Greek_ALPHA> : "Ἂ" U1F0A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA
+<Multi_key> <grave> <dead_psili> <Greek_ALPHA> : "Ἂ" U1F0A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA
+<Multi_key> <grave> <parenright> <Greek_ALPHA> : "Ἂ" U1F0A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA
+<dead_grave> <U1F09> : "Ἃ" U1F0B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA
+<Multi_key> <grave> <U1F09> : "Ἃ" U1F0B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA
+<dead_grave> <dead_dasia> <Greek_ALPHA> : "Ἃ" U1F0B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA
+<dead_grave> <Multi_key> <parenleft> <Greek_ALPHA> : "Ἃ" U1F0B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA
+<Multi_key> <grave> <dead_dasia> <Greek_ALPHA> : "Ἃ" U1F0B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA
+<Multi_key> <grave> <parenleft> <Greek_ALPHA> : "Ἃ" U1F0B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA
+<dead_acute> <U1F08> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
+<Multi_key> <acute> <U1F08> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <U1F08> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
+<dead_acute> <dead_psili> <Greek_ALPHA> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
+<dead_acute> <Multi_key> <parenright> <Greek_ALPHA> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
+<Multi_key> <acute> <dead_psili> <Greek_ALPHA> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
+<Multi_key> <acute> <parenright> <Greek_ALPHA> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <dead_psili> <Greek_ALPHA> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <parenright> <Greek_ALPHA> : "Ἄ" U1F0C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA
+<dead_acute> <U1F09> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
+<Multi_key> <acute> <U1F09> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <U1F09> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
+<dead_acute> <dead_dasia> <Greek_ALPHA> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
+<dead_acute> <Multi_key> <parenleft> <Greek_ALPHA> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
+<Multi_key> <acute> <dead_dasia> <Greek_ALPHA> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
+<Multi_key> <acute> <parenleft> <Greek_ALPHA> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <dead_dasia> <Greek_ALPHA> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <parenleft> <Greek_ALPHA> : "Ἅ" U1F0D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA
+<dead_tilde> <U1F08> : "Ἆ" U1F0E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F08> : "Ἆ" U1F0E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI
+<dead_tilde> <dead_psili> <Greek_ALPHA> : "Ἆ" U1F0E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenright> <Greek_ALPHA> : "Ἆ" U1F0E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_psili> <Greek_ALPHA> : "Ἆ" U1F0E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <parenright> <Greek_ALPHA> : "Ἆ" U1F0E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI
+<dead_tilde> <U1F09> : "Ἇ" U1F0F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F09> : "Ἇ" U1F0F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
+<dead_tilde> <dead_dasia> <Greek_ALPHA> : "Ἇ" U1F0F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenleft> <Greek_ALPHA> : "Ἇ" U1F0F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_dasia> <Greek_ALPHA> : "Ἇ" U1F0F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <parenleft> <Greek_ALPHA> : "Ἇ" U1F0F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI
+<dead_psili> <Greek_epsilon> : "ἐ" U1F10 # GREEK SMALL LETTER EPSILON WITH PSILI
+<Multi_key> <parenright> <Greek_epsilon> : "ἐ" U1F10 # GREEK SMALL LETTER EPSILON WITH PSILI
+<dead_dasia> <Greek_epsilon> : "ἑ" U1F11 # GREEK SMALL LETTER EPSILON WITH DASIA
+<Multi_key> <parenleft> <Greek_epsilon> : "ἑ" U1F11 # GREEK SMALL LETTER EPSILON WITH DASIA
+<dead_grave> <U1F10> : "ἒ" U1F12 # GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA
+<Multi_key> <grave> <U1F10> : "ἒ" U1F12 # GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA
+<dead_grave> <dead_psili> <Greek_epsilon> : "ἒ" U1F12 # GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA
+<dead_grave> <Multi_key> <parenright> <Greek_epsilon> : "ἒ" U1F12 # GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA
+<Multi_key> <grave> <dead_psili> <Greek_epsilon> : "ἒ" U1F12 # GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA
+<Multi_key> <grave> <parenright> <Greek_epsilon> : "ἒ" U1F12 # GREEK SMALL LETTER EPSILON WITH PSILI AND VARIA
+<dead_grave> <U1F11> : "ἓ" U1F13 # GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA
+<Multi_key> <grave> <U1F11> : "ἓ" U1F13 # GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA
+<dead_grave> <dead_dasia> <Greek_epsilon> : "ἓ" U1F13 # GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA
+<dead_grave> <Multi_key> <parenleft> <Greek_epsilon> : "ἓ" U1F13 # GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA
+<Multi_key> <grave> <dead_dasia> <Greek_epsilon> : "ἓ" U1F13 # GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA
+<Multi_key> <grave> <parenleft> <Greek_epsilon> : "ἓ" U1F13 # GREEK SMALL LETTER EPSILON WITH DASIA AND VARIA
+<dead_acute> <U1F10> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
+<Multi_key> <acute> <U1F10> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <U1F10> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
+<dead_acute> <dead_psili> <Greek_epsilon> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
+<dead_acute> <Multi_key> <parenright> <Greek_epsilon> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
+<Multi_key> <acute> <dead_psili> <Greek_epsilon> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
+<Multi_key> <acute> <parenright> <Greek_epsilon> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <dead_psili> <Greek_epsilon> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <parenright> <Greek_epsilon> : "ἔ" U1F14 # GREEK SMALL LETTER EPSILON WITH PSILI AND OXIA
+<dead_acute> <U1F11> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
+<Multi_key> <acute> <U1F11> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <U1F11> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
+<dead_acute> <dead_dasia> <Greek_epsilon> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
+<dead_acute> <Multi_key> <parenleft> <Greek_epsilon> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
+<Multi_key> <acute> <dead_dasia> <Greek_epsilon> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
+<Multi_key> <acute> <parenleft> <Greek_epsilon> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <dead_dasia> <Greek_epsilon> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <parenleft> <Greek_epsilon> : "ἕ" U1F15 # GREEK SMALL LETTER EPSILON WITH DASIA AND OXIA
+<dead_psili> <Greek_EPSILON> : "Ἐ" U1F18 # GREEK CAPITAL LETTER EPSILON WITH PSILI
+<Multi_key> <parenright> <Greek_EPSILON> : "Ἐ" U1F18 # GREEK CAPITAL LETTER EPSILON WITH PSILI
+<dead_dasia> <Greek_EPSILON> : "Ἑ" U1F19 # GREEK CAPITAL LETTER EPSILON WITH DASIA
+<Multi_key> <parenleft> <Greek_EPSILON> : "Ἑ" U1F19 # GREEK CAPITAL LETTER EPSILON WITH DASIA
+<dead_grave> <U1F18> : "Ἒ" U1F1A # GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA
+<Multi_key> <grave> <U1F18> : "Ἒ" U1F1A # GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA
+<dead_grave> <dead_psili> <Greek_EPSILON> : "Ἒ" U1F1A # GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA
+<dead_grave> <Multi_key> <parenright> <Greek_EPSILON> : "Ἒ" U1F1A # GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA
+<Multi_key> <grave> <dead_psili> <Greek_EPSILON> : "Ἒ" U1F1A # GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA
+<Multi_key> <grave> <parenright> <Greek_EPSILON> : "Ἒ" U1F1A # GREEK CAPITAL LETTER EPSILON WITH PSILI AND VARIA
+<dead_grave> <U1F19> : "Ἓ" U1F1B # GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA
+<Multi_key> <grave> <U1F19> : "Ἓ" U1F1B # GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA
+<dead_grave> <dead_dasia> <Greek_EPSILON> : "Ἓ" U1F1B # GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA
+<dead_grave> <Multi_key> <parenleft> <Greek_EPSILON> : "Ἓ" U1F1B # GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA
+<Multi_key> <grave> <dead_dasia> <Greek_EPSILON> : "Ἓ" U1F1B # GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA
+<Multi_key> <grave> <parenleft> <Greek_EPSILON> : "Ἓ" U1F1B # GREEK CAPITAL LETTER EPSILON WITH DASIA AND VARIA
+<dead_acute> <U1F18> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
+<Multi_key> <acute> <U1F18> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <U1F18> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
+<dead_acute> <dead_psili> <Greek_EPSILON> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
+<dead_acute> <Multi_key> <parenright> <Greek_EPSILON> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
+<Multi_key> <acute> <dead_psili> <Greek_EPSILON> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
+<Multi_key> <acute> <parenright> <Greek_EPSILON> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <dead_psili> <Greek_EPSILON> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <parenright> <Greek_EPSILON> : "Ἔ" U1F1C # GREEK CAPITAL LETTER EPSILON WITH PSILI AND OXIA
+<dead_acute> <U1F19> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
+<Multi_key> <acute> <U1F19> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <U1F19> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
+<dead_acute> <dead_dasia> <Greek_EPSILON> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
+<dead_acute> <Multi_key> <parenleft> <Greek_EPSILON> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
+<Multi_key> <acute> <dead_dasia> <Greek_EPSILON> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
+<Multi_key> <acute> <parenleft> <Greek_EPSILON> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <dead_dasia> <Greek_EPSILON> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <parenleft> <Greek_EPSILON> : "Ἕ" U1F1D # GREEK CAPITAL LETTER EPSILON WITH DASIA AND OXIA
+<dead_psili> <Greek_eta> : "ἠ" U1F20 # GREEK SMALL LETTER ETA WITH PSILI
+<Multi_key> <parenright> <Greek_eta> : "ἠ" U1F20 # GREEK SMALL LETTER ETA WITH PSILI
+<dead_dasia> <Greek_eta> : "ἡ" U1F21 # GREEK SMALL LETTER ETA WITH DASIA
+<Multi_key> <parenleft> <Greek_eta> : "ἡ" U1F21 # GREEK SMALL LETTER ETA WITH DASIA
+<dead_grave> <U1F20> : "ἢ" U1F22 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA
+<Multi_key> <grave> <U1F20> : "ἢ" U1F22 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA
+<dead_grave> <dead_psili> <Greek_eta> : "ἢ" U1F22 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA
+<dead_grave> <Multi_key> <parenright> <Greek_eta> : "ἢ" U1F22 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA
+<Multi_key> <grave> <dead_psili> <Greek_eta> : "ἢ" U1F22 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA
+<Multi_key> <grave> <parenright> <Greek_eta> : "ἢ" U1F22 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA
+<dead_grave> <U1F21> : "ἣ" U1F23 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA
+<Multi_key> <grave> <U1F21> : "ἣ" U1F23 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA
+<dead_grave> <dead_dasia> <Greek_eta> : "ἣ" U1F23 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA
+<dead_grave> <Multi_key> <parenleft> <Greek_eta> : "ἣ" U1F23 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA
+<Multi_key> <grave> <dead_dasia> <Greek_eta> : "ἣ" U1F23 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA
+<Multi_key> <grave> <parenleft> <Greek_eta> : "ἣ" U1F23 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA
+<dead_acute> <U1F20> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
+<Multi_key> <acute> <U1F20> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <U1F20> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
+<dead_acute> <dead_psili> <Greek_eta> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
+<dead_acute> <Multi_key> <parenright> <Greek_eta> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
+<Multi_key> <acute> <dead_psili> <Greek_eta> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
+<Multi_key> <acute> <parenright> <Greek_eta> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <dead_psili> <Greek_eta> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <parenright> <Greek_eta> : "ἤ" U1F24 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA
+<dead_acute> <U1F21> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
+<Multi_key> <acute> <U1F21> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <U1F21> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
+<dead_acute> <dead_dasia> <Greek_eta> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
+<dead_acute> <Multi_key> <parenleft> <Greek_eta> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
+<Multi_key> <acute> <dead_dasia> <Greek_eta> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
+<Multi_key> <acute> <parenleft> <Greek_eta> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <dead_dasia> <Greek_eta> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <parenleft> <Greek_eta> : "ἥ" U1F25 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA
+<dead_tilde> <U1F20> : "ἦ" U1F26 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F20> : "ἦ" U1F26 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI
+<dead_tilde> <dead_psili> <Greek_eta> : "ἦ" U1F26 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenright> <Greek_eta> : "ἦ" U1F26 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_psili> <Greek_eta> : "ἦ" U1F26 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <parenright> <Greek_eta> : "ἦ" U1F26 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI
+<dead_tilde> <U1F21> : "ἧ" U1F27 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F21> : "ἧ" U1F27 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
+<dead_tilde> <dead_dasia> <Greek_eta> : "ἧ" U1F27 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenleft> <Greek_eta> : "ἧ" U1F27 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_dasia> <Greek_eta> : "ἧ" U1F27 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <parenleft> <Greek_eta> : "ἧ" U1F27 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI
+<dead_psili> <Greek_ETA> : "Ἠ" U1F28 # GREEK CAPITAL LETTER ETA WITH PSILI
+<Multi_key> <parenright> <Greek_ETA> : "Ἠ" U1F28 # GREEK CAPITAL LETTER ETA WITH PSILI
+<dead_dasia> <Greek_ETA> : "Ἡ" U1F29 # GREEK CAPITAL LETTER ETA WITH DASIA
+<Multi_key> <parenleft> <Greek_ETA> : "Ἡ" U1F29 # GREEK CAPITAL LETTER ETA WITH DASIA
+<dead_grave> <U1F28> : "Ἢ" U1F2A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA
+<Multi_key> <grave> <U1F28> : "Ἢ" U1F2A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA
+<dead_grave> <dead_psili> <Greek_ETA> : "Ἢ" U1F2A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA
+<dead_grave> <Multi_key> <parenright> <Greek_ETA> : "Ἢ" U1F2A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA
+<Multi_key> <grave> <dead_psili> <Greek_ETA> : "Ἢ" U1F2A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA
+<Multi_key> <grave> <parenright> <Greek_ETA> : "Ἢ" U1F2A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA
+<dead_grave> <U1F29> : "Ἣ" U1F2B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA
+<Multi_key> <grave> <U1F29> : "Ἣ" U1F2B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA
+<dead_grave> <dead_dasia> <Greek_ETA> : "Ἣ" U1F2B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA
+<dead_grave> <Multi_key> <parenleft> <Greek_ETA> : "Ἣ" U1F2B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA
+<Multi_key> <grave> <dead_dasia> <Greek_ETA> : "Ἣ" U1F2B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA
+<Multi_key> <grave> <parenleft> <Greek_ETA> : "Ἣ" U1F2B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA
+<dead_acute> <U1F28> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
+<Multi_key> <acute> <U1F28> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <U1F28> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
+<dead_acute> <dead_psili> <Greek_ETA> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
+<dead_acute> <Multi_key> <parenright> <Greek_ETA> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
+<Multi_key> <acute> <dead_psili> <Greek_ETA> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
+<Multi_key> <acute> <parenright> <Greek_ETA> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <dead_psili> <Greek_ETA> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <parenright> <Greek_ETA> : "Ἤ" U1F2C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA
+<dead_acute> <U1F29> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
+<Multi_key> <acute> <U1F29> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <U1F29> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
+<dead_acute> <dead_dasia> <Greek_ETA> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
+<dead_acute> <Multi_key> <parenleft> <Greek_ETA> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
+<Multi_key> <acute> <dead_dasia> <Greek_ETA> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
+<Multi_key> <acute> <parenleft> <Greek_ETA> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <dead_dasia> <Greek_ETA> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <parenleft> <Greek_ETA> : "Ἥ" U1F2D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA
+<dead_tilde> <U1F28> : "Ἦ" U1F2E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F28> : "Ἦ" U1F2E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI
+<dead_tilde> <dead_psili> <Greek_ETA> : "Ἦ" U1F2E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenright> <Greek_ETA> : "Ἦ" U1F2E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_psili> <Greek_ETA> : "Ἦ" U1F2E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <parenright> <Greek_ETA> : "Ἦ" U1F2E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI
+<dead_tilde> <U1F29> : "Ἧ" U1F2F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F29> : "Ἧ" U1F2F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
+<dead_tilde> <dead_dasia> <Greek_ETA> : "Ἧ" U1F2F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenleft> <Greek_ETA> : "Ἧ" U1F2F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_dasia> <Greek_ETA> : "Ἧ" U1F2F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <parenleft> <Greek_ETA> : "Ἧ" U1F2F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI
+<dead_psili> <Greek_iota> : "ἰ" U1F30 # GREEK SMALL LETTER IOTA WITH PSILI
+<Multi_key> <parenright> <Greek_iota> : "ἰ" U1F30 # GREEK SMALL LETTER IOTA WITH PSILI
+<dead_dasia> <Greek_iota> : "ἱ" U1F31 # GREEK SMALL LETTER IOTA WITH DASIA
+<Multi_key> <parenleft> <Greek_iota> : "ἱ" U1F31 # GREEK SMALL LETTER IOTA WITH DASIA
+<dead_grave> <U1F30> : "ἲ" U1F32 # GREEK SMALL LETTER IOTA WITH PSILI AND VARIA
+<Multi_key> <grave> <U1F30> : "ἲ" U1F32 # GREEK SMALL LETTER IOTA WITH PSILI AND VARIA
+<dead_grave> <dead_psili> <Greek_iota> : "ἲ" U1F32 # GREEK SMALL LETTER IOTA WITH PSILI AND VARIA
+<dead_grave> <Multi_key> <parenright> <Greek_iota> : "ἲ" U1F32 # GREEK SMALL LETTER IOTA WITH PSILI AND VARIA
+<Multi_key> <grave> <dead_psili> <Greek_iota> : "ἲ" U1F32 # GREEK SMALL LETTER IOTA WITH PSILI AND VARIA
+<Multi_key> <grave> <parenright> <Greek_iota> : "ἲ" U1F32 # GREEK SMALL LETTER IOTA WITH PSILI AND VARIA
+<dead_grave> <U1F31> : "ἳ" U1F33 # GREEK SMALL LETTER IOTA WITH DASIA AND VARIA
+<Multi_key> <grave> <U1F31> : "ἳ" U1F33 # GREEK SMALL LETTER IOTA WITH DASIA AND VARIA
+<dead_grave> <dead_dasia> <Greek_iota> : "ἳ" U1F33 # GREEK SMALL LETTER IOTA WITH DASIA AND VARIA
+<dead_grave> <Multi_key> <parenleft> <Greek_iota> : "ἳ" U1F33 # GREEK SMALL LETTER IOTA WITH DASIA AND VARIA
+<Multi_key> <grave> <dead_dasia> <Greek_iota> : "ἳ" U1F33 # GREEK SMALL LETTER IOTA WITH DASIA AND VARIA
+<Multi_key> <grave> <parenleft> <Greek_iota> : "ἳ" U1F33 # GREEK SMALL LETTER IOTA WITH DASIA AND VARIA
+<dead_acute> <U1F30> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
+<Multi_key> <acute> <U1F30> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <U1F30> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
+<dead_acute> <dead_psili> <Greek_iota> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
+<dead_acute> <Multi_key> <parenright> <Greek_iota> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
+<Multi_key> <acute> <dead_psili> <Greek_iota> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
+<Multi_key> <acute> <parenright> <Greek_iota> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <dead_psili> <Greek_iota> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <parenright> <Greek_iota> : "ἴ" U1F34 # GREEK SMALL LETTER IOTA WITH PSILI AND OXIA
+<dead_acute> <U1F31> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
+<Multi_key> <acute> <U1F31> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <U1F31> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
+<dead_acute> <dead_dasia> <Greek_iota> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
+<dead_acute> <Multi_key> <parenleft> <Greek_iota> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
+<Multi_key> <acute> <dead_dasia> <Greek_iota> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
+<Multi_key> <acute> <parenleft> <Greek_iota> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <dead_dasia> <Greek_iota> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <parenleft> <Greek_iota> : "ἵ" U1F35 # GREEK SMALL LETTER IOTA WITH DASIA AND OXIA
+<dead_tilde> <U1F30> : "ἶ" U1F36 # GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F30> : "ἶ" U1F36 # GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI
+<dead_tilde> <dead_psili> <Greek_iota> : "ἶ" U1F36 # GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenright> <Greek_iota> : "ἶ" U1F36 # GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_psili> <Greek_iota> : "ἶ" U1F36 # GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <parenright> <Greek_iota> : "ἶ" U1F36 # GREEK SMALL LETTER IOTA WITH PSILI AND PERISPOMENI
+<dead_tilde> <U1F31> : "ἷ" U1F37 # GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F31> : "ἷ" U1F37 # GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
+<dead_tilde> <dead_dasia> <Greek_iota> : "ἷ" U1F37 # GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenleft> <Greek_iota> : "ἷ" U1F37 # GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_dasia> <Greek_iota> : "ἷ" U1F37 # GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <parenleft> <Greek_iota> : "ἷ" U1F37 # GREEK SMALL LETTER IOTA WITH DASIA AND PERISPOMENI
+<dead_psili> <Greek_IOTA> : "Ἰ" U1F38 # GREEK CAPITAL LETTER IOTA WITH PSILI
+<Multi_key> <parenright> <Greek_IOTA> : "Ἰ" U1F38 # GREEK CAPITAL LETTER IOTA WITH PSILI
+<dead_dasia> <Greek_IOTA> : "Ἱ" U1F39 # GREEK CAPITAL LETTER IOTA WITH DASIA
+<Multi_key> <parenleft> <Greek_IOTA> : "Ἱ" U1F39 # GREEK CAPITAL LETTER IOTA WITH DASIA
+<dead_grave> <U1F38> : "Ἲ" U1F3A # GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA
+<Multi_key> <grave> <U1F38> : "Ἲ" U1F3A # GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA
+<dead_grave> <dead_psili> <Greek_IOTA> : "Ἲ" U1F3A # GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA
+<dead_grave> <Multi_key> <parenright> <Greek_IOTA> : "Ἲ" U1F3A # GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA
+<Multi_key> <grave> <dead_psili> <Greek_IOTA> : "Ἲ" U1F3A # GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA
+<Multi_key> <grave> <parenright> <Greek_IOTA> : "Ἲ" U1F3A # GREEK CAPITAL LETTER IOTA WITH PSILI AND VARIA
+<dead_grave> <U1F39> : "Ἳ" U1F3B # GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA
+<Multi_key> <grave> <U1F39> : "Ἳ" U1F3B # GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA
+<dead_grave> <dead_dasia> <Greek_IOTA> : "Ἳ" U1F3B # GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA
+<dead_grave> <Multi_key> <parenleft> <Greek_IOTA> : "Ἳ" U1F3B # GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA
+<Multi_key> <grave> <dead_dasia> <Greek_IOTA> : "Ἳ" U1F3B # GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA
+<Multi_key> <grave> <parenleft> <Greek_IOTA> : "Ἳ" U1F3B # GREEK CAPITAL LETTER IOTA WITH DASIA AND VARIA
+<dead_acute> <U1F38> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
+<Multi_key> <acute> <U1F38> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <U1F38> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
+<dead_acute> <dead_psili> <Greek_IOTA> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
+<dead_acute> <Multi_key> <parenright> <Greek_IOTA> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
+<Multi_key> <acute> <dead_psili> <Greek_IOTA> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
+<Multi_key> <acute> <parenright> <Greek_IOTA> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <dead_psili> <Greek_IOTA> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <parenright> <Greek_IOTA> : "Ἴ" U1F3C # GREEK CAPITAL LETTER IOTA WITH PSILI AND OXIA
+<dead_acute> <U1F39> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
+<Multi_key> <acute> <U1F39> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <U1F39> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
+<dead_acute> <dead_dasia> <Greek_IOTA> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
+<dead_acute> <Multi_key> <parenleft> <Greek_IOTA> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
+<Multi_key> <acute> <dead_dasia> <Greek_IOTA> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
+<Multi_key> <acute> <parenleft> <Greek_IOTA> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <dead_dasia> <Greek_IOTA> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <parenleft> <Greek_IOTA> : "Ἵ" U1F3D # GREEK CAPITAL LETTER IOTA WITH DASIA AND OXIA
+<dead_tilde> <U1F38> : "Ἶ" U1F3E # GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F38> : "Ἶ" U1F3E # GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI
+<dead_tilde> <dead_psili> <Greek_IOTA> : "Ἶ" U1F3E # GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenright> <Greek_IOTA> : "Ἶ" U1F3E # GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_psili> <Greek_IOTA> : "Ἶ" U1F3E # GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <parenright> <Greek_IOTA> : "Ἶ" U1F3E # GREEK CAPITAL LETTER IOTA WITH PSILI AND PERISPOMENI
+<dead_tilde> <U1F39> : "Ἷ" U1F3F # GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F39> : "Ἷ" U1F3F # GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI
+<dead_tilde> <dead_dasia> <Greek_IOTA> : "Ἷ" U1F3F # GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenleft> <Greek_IOTA> : "Ἷ" U1F3F # GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_dasia> <Greek_IOTA> : "Ἷ" U1F3F # GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <parenleft> <Greek_IOTA> : "Ἷ" U1F3F # GREEK CAPITAL LETTER IOTA WITH DASIA AND PERISPOMENI
+<dead_psili> <Greek_omicron> : "ὀ" U1F40 # GREEK SMALL LETTER OMICRON WITH PSILI
+<Multi_key> <parenright> <Greek_omicron> : "ὀ" U1F40 # GREEK SMALL LETTER OMICRON WITH PSILI
+<dead_dasia> <Greek_omicron> : "ὁ" U1F41 # GREEK SMALL LETTER OMICRON WITH DASIA
+<Multi_key> <parenleft> <Greek_omicron> : "ὁ" U1F41 # GREEK SMALL LETTER OMICRON WITH DASIA
+<dead_grave> <U1F40> : "ὂ" U1F42 # GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA
+<Multi_key> <grave> <U1F40> : "ὂ" U1F42 # GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA
+<dead_grave> <dead_psili> <Greek_omicron> : "ὂ" U1F42 # GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA
+<dead_grave> <Multi_key> <parenright> <Greek_omicron> : "ὂ" U1F42 # GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA
+<Multi_key> <grave> <dead_psili> <Greek_omicron> : "ὂ" U1F42 # GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA
+<Multi_key> <grave> <parenright> <Greek_omicron> : "ὂ" U1F42 # GREEK SMALL LETTER OMICRON WITH PSILI AND VARIA
+<dead_grave> <U1F41> : "ὃ" U1F43 # GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA
+<Multi_key> <grave> <U1F41> : "ὃ" U1F43 # GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA
+<dead_grave> <dead_dasia> <Greek_omicron> : "ὃ" U1F43 # GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA
+<dead_grave> <Multi_key> <parenleft> <Greek_omicron> : "ὃ" U1F43 # GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA
+<Multi_key> <grave> <dead_dasia> <Greek_omicron> : "ὃ" U1F43 # GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA
+<Multi_key> <grave> <parenleft> <Greek_omicron> : "ὃ" U1F43 # GREEK SMALL LETTER OMICRON WITH DASIA AND VARIA
+<dead_acute> <U1F40> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
+<Multi_key> <acute> <U1F40> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <U1F40> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
+<dead_acute> <dead_psili> <Greek_omicron> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
+<dead_acute> <Multi_key> <parenright> <Greek_omicron> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
+<Multi_key> <acute> <dead_psili> <Greek_omicron> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
+<Multi_key> <acute> <parenright> <Greek_omicron> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <dead_psili> <Greek_omicron> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <parenright> <Greek_omicron> : "ὄ" U1F44 # GREEK SMALL LETTER OMICRON WITH PSILI AND OXIA
+<dead_acute> <U1F41> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
+<Multi_key> <acute> <U1F41> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <U1F41> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
+<dead_acute> <dead_dasia> <Greek_omicron> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
+<dead_acute> <Multi_key> <parenleft> <Greek_omicron> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
+<Multi_key> <acute> <dead_dasia> <Greek_omicron> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
+<Multi_key> <acute> <parenleft> <Greek_omicron> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <dead_dasia> <Greek_omicron> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <parenleft> <Greek_omicron> : "ὅ" U1F45 # GREEK SMALL LETTER OMICRON WITH DASIA AND OXIA
+<dead_psili> <Greek_OMICRON> : "Ὀ" U1F48 # GREEK CAPITAL LETTER OMICRON WITH PSILI
+<Multi_key> <parenright> <Greek_OMICRON> : "Ὀ" U1F48 # GREEK CAPITAL LETTER OMICRON WITH PSILI
+<dead_dasia> <Greek_OMICRON> : "Ὁ" U1F49 # GREEK CAPITAL LETTER OMICRON WITH DASIA
+<Multi_key> <parenleft> <Greek_OMICRON> : "Ὁ" U1F49 # GREEK CAPITAL LETTER OMICRON WITH DASIA
+<dead_grave> <U1F48> : "Ὂ" U1F4A # GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA
+<Multi_key> <grave> <U1F48> : "Ὂ" U1F4A # GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA
+<dead_grave> <dead_psili> <Greek_OMICRON> : "Ὂ" U1F4A # GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA
+<dead_grave> <Multi_key> <parenright> <Greek_OMICRON> : "Ὂ" U1F4A # GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA
+<Multi_key> <grave> <dead_psili> <Greek_OMICRON> : "Ὂ" U1F4A # GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA
+<Multi_key> <grave> <parenright> <Greek_OMICRON> : "Ὂ" U1F4A # GREEK CAPITAL LETTER OMICRON WITH PSILI AND VARIA
+<dead_grave> <U1F49> : "Ὃ" U1F4B # GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA
+<Multi_key> <grave> <U1F49> : "Ὃ" U1F4B # GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA
+<dead_grave> <dead_dasia> <Greek_OMICRON> : "Ὃ" U1F4B # GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA
+<dead_grave> <Multi_key> <parenleft> <Greek_OMICRON> : "Ὃ" U1F4B # GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA
+<Multi_key> <grave> <dead_dasia> <Greek_OMICRON> : "Ὃ" U1F4B # GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA
+<Multi_key> <grave> <parenleft> <Greek_OMICRON> : "Ὃ" U1F4B # GREEK CAPITAL LETTER OMICRON WITH DASIA AND VARIA
+<dead_acute> <U1F48> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
+<Multi_key> <acute> <U1F48> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <U1F48> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
+<dead_acute> <dead_psili> <Greek_OMICRON> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
+<dead_acute> <Multi_key> <parenright> <Greek_OMICRON> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
+<Multi_key> <acute> <dead_psili> <Greek_OMICRON> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
+<Multi_key> <acute> <parenright> <Greek_OMICRON> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <dead_psili> <Greek_OMICRON> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <parenright> <Greek_OMICRON> : "Ὄ" U1F4C # GREEK CAPITAL LETTER OMICRON WITH PSILI AND OXIA
+<dead_acute> <U1F49> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
+<Multi_key> <acute> <U1F49> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <U1F49> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
+<dead_acute> <dead_dasia> <Greek_OMICRON> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
+<dead_acute> <Multi_key> <parenleft> <Greek_OMICRON> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
+<Multi_key> <acute> <dead_dasia> <Greek_OMICRON> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
+<Multi_key> <acute> <parenleft> <Greek_OMICRON> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <dead_dasia> <Greek_OMICRON> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <parenleft> <Greek_OMICRON> : "Ὅ" U1F4D # GREEK CAPITAL LETTER OMICRON WITH DASIA AND OXIA
+<dead_psili> <Greek_upsilon> : "ὐ" U1F50 # GREEK SMALL LETTER UPSILON WITH PSILI
+<Multi_key> <parenright> <Greek_upsilon> : "ὐ" U1F50 # GREEK SMALL LETTER UPSILON WITH PSILI
+<dead_dasia> <Greek_upsilon> : "ὑ" U1F51 # GREEK SMALL LETTER UPSILON WITH DASIA
+<Multi_key> <parenleft> <Greek_upsilon> : "ὑ" U1F51 # GREEK SMALL LETTER UPSILON WITH DASIA
+<dead_grave> <U1F50> : "ὒ" U1F52 # GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA
+<Multi_key> <grave> <U1F50> : "ὒ" U1F52 # GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA
+<dead_grave> <dead_psili> <Greek_upsilon> : "ὒ" U1F52 # GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA
+<dead_grave> <Multi_key> <parenright> <Greek_upsilon> : "ὒ" U1F52 # GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA
+<Multi_key> <grave> <dead_psili> <Greek_upsilon> : "ὒ" U1F52 # GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA
+<Multi_key> <grave> <parenright> <Greek_upsilon> : "ὒ" U1F52 # GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA
+<dead_grave> <U1F51> : "ὓ" U1F53 # GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA
+<Multi_key> <grave> <U1F51> : "ὓ" U1F53 # GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA
+<dead_grave> <dead_dasia> <Greek_upsilon> : "ὓ" U1F53 # GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA
+<dead_grave> <Multi_key> <parenleft> <Greek_upsilon> : "ὓ" U1F53 # GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA
+<Multi_key> <grave> <dead_dasia> <Greek_upsilon> : "ὓ" U1F53 # GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA
+<Multi_key> <grave> <parenleft> <Greek_upsilon> : "ὓ" U1F53 # GREEK SMALL LETTER UPSILON WITH DASIA AND VARIA
+<dead_acute> <U1F50> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
+<Multi_key> <acute> <U1F50> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <U1F50> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
+<dead_acute> <dead_psili> <Greek_upsilon> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
+<dead_acute> <Multi_key> <parenright> <Greek_upsilon> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
+<Multi_key> <acute> <dead_psili> <Greek_upsilon> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
+<Multi_key> <acute> <parenright> <Greek_upsilon> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <dead_psili> <Greek_upsilon> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <parenright> <Greek_upsilon> : "ὔ" U1F54 # GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA
+<dead_acute> <U1F51> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
+<Multi_key> <acute> <U1F51> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <U1F51> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
+<dead_acute> <dead_dasia> <Greek_upsilon> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
+<dead_acute> <Multi_key> <parenleft> <Greek_upsilon> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
+<Multi_key> <acute> <dead_dasia> <Greek_upsilon> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
+<Multi_key> <acute> <parenleft> <Greek_upsilon> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <dead_dasia> <Greek_upsilon> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <parenleft> <Greek_upsilon> : "ὕ" U1F55 # GREEK SMALL LETTER UPSILON WITH DASIA AND OXIA
+<dead_tilde> <U1F50> : "ὖ" U1F56 # GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F50> : "ὖ" U1F56 # GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI
+<dead_tilde> <dead_psili> <Greek_upsilon> : "ὖ" U1F56 # GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenright> <Greek_upsilon> : "ὖ" U1F56 # GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_psili> <Greek_upsilon> : "ὖ" U1F56 # GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <parenright> <Greek_upsilon> : "ὖ" U1F56 # GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI
+<dead_tilde> <U1F51> : "ὗ" U1F57 # GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F51> : "ὗ" U1F57 # GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
+<dead_tilde> <dead_dasia> <Greek_upsilon> : "ὗ" U1F57 # GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenleft> <Greek_upsilon> : "ὗ" U1F57 # GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_dasia> <Greek_upsilon> : "ὗ" U1F57 # GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <parenleft> <Greek_upsilon> : "ὗ" U1F57 # GREEK SMALL LETTER UPSILON WITH DASIA AND PERISPOMENI
+<dead_dasia> <Greek_UPSILON> : "Ὑ" U1F59 # GREEK CAPITAL LETTER UPSILON WITH DASIA
+<Multi_key> <parenleft> <Greek_UPSILON> : "Ὑ" U1F59 # GREEK CAPITAL LETTER UPSILON WITH DASIA
+<dead_grave> <U1F59> : "Ὓ" U1F5B # GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
+<Multi_key> <grave> <U1F59> : "Ὓ" U1F5B # GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
+<dead_grave> <dead_dasia> <Greek_UPSILON> : "Ὓ" U1F5B # GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
+<dead_grave> <Multi_key> <parenleft> <Greek_UPSILON> : "Ὓ" U1F5B # GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
+<Multi_key> <grave> <dead_dasia> <Greek_UPSILON> : "Ὓ" U1F5B # GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
+<Multi_key> <grave> <parenleft> <Greek_UPSILON> : "Ὓ" U1F5B # GREEK CAPITAL LETTER UPSILON WITH DASIA AND VARIA
+<dead_acute> <U1F59> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
+<Multi_key> <acute> <U1F59> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <U1F59> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
+<dead_acute> <dead_dasia> <Greek_UPSILON> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
+<dead_acute> <Multi_key> <parenleft> <Greek_UPSILON> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
+<Multi_key> <acute> <dead_dasia> <Greek_UPSILON> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
+<Multi_key> <acute> <parenleft> <Greek_UPSILON> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <dead_dasia> <Greek_UPSILON> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <parenleft> <Greek_UPSILON> : "Ὕ" U1F5D # GREEK CAPITAL LETTER UPSILON WITH DASIA AND OXIA
+<dead_tilde> <U1F59> : "Ὗ" U1F5F # GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F59> : "Ὗ" U1F5F # GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI
+<dead_tilde> <dead_dasia> <Greek_UPSILON> : "Ὗ" U1F5F # GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenleft> <Greek_UPSILON> : "Ὗ" U1F5F # GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_dasia> <Greek_UPSILON> : "Ὗ" U1F5F # GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <parenleft> <Greek_UPSILON> : "Ὗ" U1F5F # GREEK CAPITAL LETTER UPSILON WITH DASIA AND PERISPOMENI
+<dead_psili> <Greek_omega> : "ὠ" U1F60 # GREEK SMALL LETTER OMEGA WITH PSILI
+<Multi_key> <parenright> <Greek_omega> : "ὠ" U1F60 # GREEK SMALL LETTER OMEGA WITH PSILI
+<dead_dasia> <Greek_omega> : "ὡ" U1F61 # GREEK SMALL LETTER OMEGA WITH DASIA
+<Multi_key> <parenleft> <Greek_omega> : "ὡ" U1F61 # GREEK SMALL LETTER OMEGA WITH DASIA
+<dead_grave> <U1F60> : "ὢ" U1F62 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA
+<Multi_key> <grave> <U1F60> : "ὢ" U1F62 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA
+<dead_grave> <dead_psili> <Greek_omega> : "ὢ" U1F62 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA
+<dead_grave> <Multi_key> <parenright> <Greek_omega> : "ὢ" U1F62 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA
+<Multi_key> <grave> <dead_psili> <Greek_omega> : "ὢ" U1F62 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA
+<Multi_key> <grave> <parenright> <Greek_omega> : "ὢ" U1F62 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA
+<dead_grave> <U1F61> : "ὣ" U1F63 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA
+<Multi_key> <grave> <U1F61> : "ὣ" U1F63 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA
+<dead_grave> <dead_dasia> <Greek_omega> : "ὣ" U1F63 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA
+<dead_grave> <Multi_key> <parenleft> <Greek_omega> : "ὣ" U1F63 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA
+<Multi_key> <grave> <dead_dasia> <Greek_omega> : "ὣ" U1F63 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA
+<Multi_key> <grave> <parenleft> <Greek_omega> : "ὣ" U1F63 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA
+<dead_acute> <U1F60> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
+<Multi_key> <acute> <U1F60> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <U1F60> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
+<dead_acute> <dead_psili> <Greek_omega> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
+<dead_acute> <Multi_key> <parenright> <Greek_omega> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
+<Multi_key> <acute> <dead_psili> <Greek_omega> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
+<Multi_key> <acute> <parenright> <Greek_omega> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <dead_psili> <Greek_omega> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <parenright> <Greek_omega> : "ὤ" U1F64 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA
+<dead_acute> <U1F61> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
+<Multi_key> <acute> <U1F61> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <U1F61> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
+<dead_acute> <dead_dasia> <Greek_omega> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
+<dead_acute> <Multi_key> <parenleft> <Greek_omega> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
+<Multi_key> <acute> <dead_dasia> <Greek_omega> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
+<Multi_key> <acute> <parenleft> <Greek_omega> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <dead_dasia> <Greek_omega> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <parenleft> <Greek_omega> : "ὥ" U1F65 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA
+<dead_tilde> <U1F60> : "ὦ" U1F66 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F60> : "ὦ" U1F66 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI
+<dead_tilde> <dead_psili> <Greek_omega> : "ὦ" U1F66 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenright> <Greek_omega> : "ὦ" U1F66 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_psili> <Greek_omega> : "ὦ" U1F66 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <parenright> <Greek_omega> : "ὦ" U1F66 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI
+<dead_tilde> <U1F61> : "ὧ" U1F67 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F61> : "ὧ" U1F67 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
+<dead_tilde> <dead_dasia> <Greek_omega> : "ὧ" U1F67 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenleft> <Greek_omega> : "ὧ" U1F67 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_dasia> <Greek_omega> : "ὧ" U1F67 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <parenleft> <Greek_omega> : "ὧ" U1F67 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI
+<dead_psili> <Greek_OMEGA> : "Ὠ" U1F68 # GREEK CAPITAL LETTER OMEGA WITH PSILI
+<Multi_key> <parenright> <Greek_OMEGA> : "Ὠ" U1F68 # GREEK CAPITAL LETTER OMEGA WITH PSILI
+<dead_dasia> <Greek_OMEGA> : "Ὡ" U1F69 # GREEK CAPITAL LETTER OMEGA WITH DASIA
+<Multi_key> <parenleft> <Greek_OMEGA> : "Ὡ" U1F69 # GREEK CAPITAL LETTER OMEGA WITH DASIA
+<dead_grave> <U1F68> : "Ὢ" U1F6A # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA
+<Multi_key> <grave> <U1F68> : "Ὢ" U1F6A # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA
+<dead_grave> <dead_psili> <Greek_OMEGA> : "Ὢ" U1F6A # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA
+<dead_grave> <Multi_key> <parenright> <Greek_OMEGA> : "Ὢ" U1F6A # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA
+<Multi_key> <grave> <dead_psili> <Greek_OMEGA> : "Ὢ" U1F6A # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA
+<Multi_key> <grave> <parenright> <Greek_OMEGA> : "Ὢ" U1F6A # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA
+<dead_grave> <U1F69> : "Ὣ" U1F6B # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA
+<Multi_key> <grave> <U1F69> : "Ὣ" U1F6B # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA
+<dead_grave> <dead_dasia> <Greek_OMEGA> : "Ὣ" U1F6B # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA
+<dead_grave> <Multi_key> <parenleft> <Greek_OMEGA> : "Ὣ" U1F6B # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA
+<Multi_key> <grave> <dead_dasia> <Greek_OMEGA> : "Ὣ" U1F6B # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA
+<Multi_key> <grave> <parenleft> <Greek_OMEGA> : "Ὣ" U1F6B # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA
+<dead_acute> <U1F68> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
+<Multi_key> <acute> <U1F68> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <U1F68> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
+<dead_acute> <dead_psili> <Greek_OMEGA> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
+<dead_acute> <Multi_key> <parenright> <Greek_OMEGA> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
+<Multi_key> <acute> <dead_psili> <Greek_OMEGA> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
+<Multi_key> <acute> <parenright> <Greek_OMEGA> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <dead_psili> <Greek_OMEGA> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
+<Multi_key> <apostrophe> <parenright> <Greek_OMEGA> : "Ὤ" U1F6C # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA
+<dead_acute> <U1F69> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
+<Multi_key> <acute> <U1F69> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <U1F69> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
+<dead_acute> <dead_dasia> <Greek_OMEGA> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
+<dead_acute> <Multi_key> <parenleft> <Greek_OMEGA> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
+<Multi_key> <acute> <dead_dasia> <Greek_OMEGA> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
+<Multi_key> <acute> <parenleft> <Greek_OMEGA> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <dead_dasia> <Greek_OMEGA> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
+<Multi_key> <apostrophe> <parenleft> <Greek_OMEGA> : "Ὥ" U1F6D # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA
+<dead_tilde> <U1F68> : "Ὦ" U1F6E # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F68> : "Ὦ" U1F6E # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI
+<dead_tilde> <dead_psili> <Greek_OMEGA> : "Ὦ" U1F6E # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenright> <Greek_OMEGA> : "Ὦ" U1F6E # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_psili> <Greek_OMEGA> : "Ὦ" U1F6E # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI
+<Multi_key> <asciitilde> <parenright> <Greek_OMEGA> : "Ὦ" U1F6E # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI
+<dead_tilde> <U1F69> : "Ὧ" U1F6F # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <U1F69> : "Ὧ" U1F6F # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
+<dead_tilde> <dead_dasia> <Greek_OMEGA> : "Ὧ" U1F6F # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
+<dead_tilde> <Multi_key> <parenleft> <Greek_OMEGA> : "Ὧ" U1F6F # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_dasia> <Greek_OMEGA> : "Ὧ" U1F6F # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
+<Multi_key> <asciitilde> <parenleft> <Greek_OMEGA> : "Ὧ" U1F6F # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI
+<dead_grave> <Greek_alpha> : "ὰ" U1F70 # GREEK SMALL LETTER ALPHA WITH VARIA
+<Multi_key> <grave> <Greek_alpha> : "ὰ" U1F70 # GREEK SMALL LETTER ALPHA WITH VARIA
+<dead_grave> <Greek_epsilon> : "ὲ" U1F72 # GREEK SMALL LETTER EPSILON WITH VARIA
+<Multi_key> <grave> <Greek_epsilon> : "ὲ" U1F72 # GREEK SMALL LETTER EPSILON WITH VARIA
+<dead_grave> <Greek_eta> : "ὴ" U1F74 # GREEK SMALL LETTER ETA WITH VARIA
+<Multi_key> <grave> <Greek_eta> : "ὴ" U1F74 # GREEK SMALL LETTER ETA WITH VARIA
+<dead_grave> <Greek_iota> : "ὶ" U1F76 # GREEK SMALL LETTER IOTA WITH VARIA
+<Multi_key> <grave> <Greek_iota> : "ὶ" U1F76 # GREEK SMALL LETTER IOTA WITH VARIA
+<dead_grave> <Greek_omicron> : "ὸ" U1F78 # GREEK SMALL LETTER OMICRON WITH VARIA
+<Multi_key> <grave> <Greek_omicron> : "ὸ" U1F78 # GREEK SMALL LETTER OMICRON WITH VARIA
+<dead_grave> <Greek_upsilon> : "ὺ" U1F7A # GREEK SMALL LETTER UPSILON WITH VARIA
+<Multi_key> <grave> <Greek_upsilon> : "ὺ" U1F7A # GREEK SMALL LETTER UPSILON WITH VARIA
+<dead_grave> <Greek_omega> : "ὼ" U1F7C # GREEK SMALL LETTER OMEGA WITH VARIA
+<Multi_key> <grave> <Greek_omega> : "ὼ" U1F7C # GREEK SMALL LETTER OMEGA WITH VARIA
+<dead_iota> <U1F00> : "ᾀ" U1F80 # GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F00> : "ᾀ" U1F80 # GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI
+<dead_iota> <dead_psili> <Greek_alpha> : "ᾀ" U1F80 # GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <parenright> <Greek_alpha> : "ᾀ" U1F80 # GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_psili> <Greek_alpha> : "ᾀ" U1F80 # GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <parenright> <Greek_alpha> : "ᾀ" U1F80 # GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI
+<dead_iota> <U1F01> : "ᾁ" U1F81 # GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F01> : "ᾁ" U1F81 # GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI
+<dead_iota> <dead_dasia> <Greek_alpha> : "ᾁ" U1F81 # GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <parenleft> <Greek_alpha> : "ᾁ" U1F81 # GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_dasia> <Greek_alpha> : "ᾁ" U1F81 # GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <parenleft> <Greek_alpha> : "ᾁ" U1F81 # GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI
+<dead_iota> <U1F02> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F02> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <U1F00> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <U1F00> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <U1F00> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <U1F00> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <dead_psili> <Greek_alpha> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <Multi_key> <parenright> <Greek_alpha> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <dead_psili> <Greek_alpha> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <parenright> <Greek_alpha> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <dead_psili> <Greek_alpha> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <parenright> <Greek_alpha> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <dead_psili> <Greek_alpha> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <parenright> <Greek_alpha> : "ᾂ" U1F82 # GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <U1F03> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F03> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <U1F01> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <U1F01> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <U1F01> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <U1F01> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <dead_dasia> <Greek_alpha> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <Multi_key> <parenleft> <Greek_alpha> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <dead_dasia> <Greek_alpha> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <parenleft> <Greek_alpha> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <dead_dasia> <Greek_alpha> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <parenleft> <Greek_alpha> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <dead_dasia> <Greek_alpha> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <parenleft> <Greek_alpha> : "ᾃ" U1F83 # GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <U1F04> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F04> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <U1F00> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <U1F00> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <U1F00> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <U1F00> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <U1F00> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <U1F00> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <dead_psili> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <Multi_key> <parenright> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <dead_psili> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <parenright> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <dead_psili> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <parenright> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <dead_psili> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <parenright> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <dead_psili> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <parenright> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <dead_psili> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <parenright> <Greek_alpha> : "ᾄ" U1F84 # GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <U1F05> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F05> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <U1F01> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <U1F01> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <U1F01> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <U1F01> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <U1F01> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <U1F01> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <dead_dasia> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <Multi_key> <parenleft> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <dead_dasia> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <parenleft> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <dead_dasia> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <parenleft> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <dead_dasia> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <parenleft> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <dead_dasia> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <parenleft> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <dead_dasia> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <parenleft> <Greek_alpha> : "ᾅ" U1F85 # GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <U1F06> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F06> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <U1F00> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <U1F00> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <U1F00> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <U1F00> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <dead_psili> <Greek_alpha> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <Multi_key> <parenright> <Greek_alpha> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <dead_psili> <Greek_alpha> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <parenright> <Greek_alpha> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <dead_psili> <Greek_alpha> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <parenright> <Greek_alpha> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <dead_psili> <Greek_alpha> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <parenright> <Greek_alpha> : "ᾆ" U1F86 # GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <U1F07> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F07> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <U1F01> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <U1F01> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <U1F01> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <U1F01> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <dead_dasia> <Greek_alpha> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <Multi_key> <parenleft> <Greek_alpha> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <dead_dasia> <Greek_alpha> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <parenleft> <Greek_alpha> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <dead_dasia> <Greek_alpha> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <parenleft> <Greek_alpha> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <dead_dasia> <Greek_alpha> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <parenleft> <Greek_alpha> : "ᾇ" U1F87 # GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <U1F08> : "ᾈ" U1F88 # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F08> : "ᾈ" U1F88 # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI
+<dead_iota> <dead_psili> <Greek_ALPHA> : "ᾈ" U1F88 # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <parenright> <Greek_ALPHA> : "ᾈ" U1F88 # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_psili> <Greek_ALPHA> : "ᾈ" U1F88 # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <parenright> <Greek_ALPHA> : "ᾈ" U1F88 # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI
+<dead_iota> <U1F09> : "ᾉ" U1F89 # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F09> : "ᾉ" U1F89 # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI
+<dead_iota> <dead_dasia> <Greek_ALPHA> : "ᾉ" U1F89 # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <parenleft> <Greek_ALPHA> : "ᾉ" U1F89 # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_dasia> <Greek_ALPHA> : "ᾉ" U1F89 # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <parenleft> <Greek_ALPHA> : "ᾉ" U1F89 # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI
+<dead_iota> <U1F0A> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F0A> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <U1F08> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <U1F08> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <U1F08> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <U1F08> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <dead_psili> <Greek_ALPHA> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <Multi_key> <parenright> <Greek_ALPHA> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <dead_psili> <Greek_ALPHA> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <parenright> <Greek_ALPHA> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <dead_psili> <Greek_ALPHA> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <parenright> <Greek_ALPHA> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <dead_psili> <Greek_ALPHA> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <parenright> <Greek_ALPHA> : "ᾊ" U1F8A # GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <U1F0B> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F0B> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <U1F09> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <U1F09> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <U1F09> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <U1F09> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <dead_dasia> <Greek_ALPHA> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <Multi_key> <parenleft> <Greek_ALPHA> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <dead_dasia> <Greek_ALPHA> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <parenleft> <Greek_ALPHA> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <dead_dasia> <Greek_ALPHA> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <parenleft> <Greek_ALPHA> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <dead_dasia> <Greek_ALPHA> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <parenleft> <Greek_ALPHA> : "ᾋ" U1F8B # GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <U1F0C> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F0C> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <U1F08> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <U1F08> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <U1F08> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <U1F08> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <U1F08> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <U1F08> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <dead_psili> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <Multi_key> <parenright> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <dead_psili> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <parenright> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <dead_psili> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <parenright> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <dead_psili> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <parenright> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <dead_psili> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <parenright> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <dead_psili> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <parenright> <Greek_ALPHA> : "ᾌ" U1F8C # GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <U1F0D> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F0D> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <U1F09> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <U1F09> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <U1F09> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <U1F09> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <U1F09> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <U1F09> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <dead_dasia> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <Multi_key> <parenleft> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <dead_dasia> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <parenleft> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <dead_dasia> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <parenleft> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <dead_dasia> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <parenleft> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <dead_dasia> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <parenleft> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <dead_dasia> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <parenleft> <Greek_ALPHA> : "ᾍ" U1F8D # GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <U1F0E> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F0E> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <U1F08> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <U1F08> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <U1F08> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <U1F08> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <dead_psili> <Greek_ALPHA> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <Multi_key> <parenright> <Greek_ALPHA> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <dead_psili> <Greek_ALPHA> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <parenright> <Greek_ALPHA> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <dead_psili> <Greek_ALPHA> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <parenright> <Greek_ALPHA> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <dead_psili> <Greek_ALPHA> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <parenright> <Greek_ALPHA> : "ᾎ" U1F8E # GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <U1F0F> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F0F> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <U1F09> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <U1F09> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <U1F09> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <U1F09> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <dead_dasia> <Greek_ALPHA> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <Multi_key> <parenleft> <Greek_ALPHA> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <dead_dasia> <Greek_ALPHA> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <parenleft> <Greek_ALPHA> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <dead_dasia> <Greek_ALPHA> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <parenleft> <Greek_ALPHA> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <dead_dasia> <Greek_ALPHA> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <parenleft> <Greek_ALPHA> : "ᾏ" U1F8F # GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <U1F20> : "ᾐ" U1F90 # GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F20> : "ᾐ" U1F90 # GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI
+<dead_iota> <dead_psili> <Greek_eta> : "ᾐ" U1F90 # GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <parenright> <Greek_eta> : "ᾐ" U1F90 # GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_psili> <Greek_eta> : "ᾐ" U1F90 # GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <parenright> <Greek_eta> : "ᾐ" U1F90 # GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI
+<dead_iota> <U1F21> : "ᾑ" U1F91 # GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F21> : "ᾑ" U1F91 # GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI
+<dead_iota> <dead_dasia> <Greek_eta> : "ᾑ" U1F91 # GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <parenleft> <Greek_eta> : "ᾑ" U1F91 # GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_dasia> <Greek_eta> : "ᾑ" U1F91 # GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <parenleft> <Greek_eta> : "ᾑ" U1F91 # GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI
+<dead_iota> <U1F22> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F22> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <U1F20> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <U1F20> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <U1F20> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <U1F20> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <dead_psili> <Greek_eta> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <Multi_key> <parenright> <Greek_eta> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <dead_psili> <Greek_eta> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <parenright> <Greek_eta> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <dead_psili> <Greek_eta> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <parenright> <Greek_eta> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <dead_psili> <Greek_eta> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <parenright> <Greek_eta> : "ᾒ" U1F92 # GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <U1F23> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F23> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <U1F21> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <U1F21> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <U1F21> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <U1F21> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <dead_dasia> <Greek_eta> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <Multi_key> <parenleft> <Greek_eta> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <dead_dasia> <Greek_eta> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <parenleft> <Greek_eta> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <dead_dasia> <Greek_eta> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <parenleft> <Greek_eta> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <dead_dasia> <Greek_eta> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <parenleft> <Greek_eta> : "ᾓ" U1F93 # GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <U1F24> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F24> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <U1F20> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <U1F20> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <U1F20> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <U1F20> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <U1F20> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <U1F20> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <dead_psili> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <Multi_key> <parenright> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <dead_psili> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <parenright> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <dead_psili> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <parenright> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <dead_psili> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <parenright> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <dead_psili> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <parenright> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <dead_psili> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <parenright> <Greek_eta> : "ᾔ" U1F94 # GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <U1F25> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F25> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <U1F21> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <U1F21> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <U1F21> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <U1F21> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <U1F21> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <U1F21> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <dead_dasia> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <Multi_key> <parenleft> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <dead_dasia> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <parenleft> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <dead_dasia> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <parenleft> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <dead_dasia> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <parenleft> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <dead_dasia> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <parenleft> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <dead_dasia> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <parenleft> <Greek_eta> : "ᾕ" U1F95 # GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <U1F26> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F26> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <U1F20> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <U1F20> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <U1F20> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <U1F20> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <dead_psili> <Greek_eta> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <Multi_key> <parenright> <Greek_eta> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <dead_psili> <Greek_eta> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <parenright> <Greek_eta> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <dead_psili> <Greek_eta> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <parenright> <Greek_eta> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <dead_psili> <Greek_eta> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <parenright> <Greek_eta> : "ᾖ" U1F96 # GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <U1F27> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F27> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <U1F21> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <U1F21> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <U1F21> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <U1F21> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <dead_dasia> <Greek_eta> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <Multi_key> <parenleft> <Greek_eta> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <dead_dasia> <Greek_eta> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <parenleft> <Greek_eta> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <dead_dasia> <Greek_eta> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <parenleft> <Greek_eta> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <dead_dasia> <Greek_eta> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <parenleft> <Greek_eta> : "ᾗ" U1F97 # GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <U1F28> : "ᾘ" U1F98 # GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F28> : "ᾘ" U1F98 # GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI
+<dead_iota> <dead_psili> <Greek_ETA> : "ᾘ" U1F98 # GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <parenright> <Greek_ETA> : "ᾘ" U1F98 # GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_psili> <Greek_ETA> : "ᾘ" U1F98 # GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <parenright> <Greek_ETA> : "ᾘ" U1F98 # GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI
+<dead_iota> <U1F29> : "ᾙ" U1F99 # GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F29> : "ᾙ" U1F99 # GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI
+<dead_iota> <dead_dasia> <Greek_ETA> : "ᾙ" U1F99 # GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <parenleft> <Greek_ETA> : "ᾙ" U1F99 # GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_dasia> <Greek_ETA> : "ᾙ" U1F99 # GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <parenleft> <Greek_ETA> : "ᾙ" U1F99 # GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI
+<dead_iota> <U1F2A> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F2A> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <U1F28> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <U1F28> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <U1F28> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <U1F28> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <dead_psili> <Greek_ETA> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <Multi_key> <parenright> <Greek_ETA> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <dead_psili> <Greek_ETA> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <parenright> <Greek_ETA> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <dead_psili> <Greek_ETA> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <parenright> <Greek_ETA> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <dead_psili> <Greek_ETA> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <parenright> <Greek_ETA> : "ᾚ" U1F9A # GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <U1F2B> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F2B> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <U1F29> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <U1F29> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <U1F29> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <U1F29> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <dead_dasia> <Greek_ETA> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <Multi_key> <parenleft> <Greek_ETA> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <dead_dasia> <Greek_ETA> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <parenleft> <Greek_ETA> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <dead_dasia> <Greek_ETA> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <parenleft> <Greek_ETA> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <dead_dasia> <Greek_ETA> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <parenleft> <Greek_ETA> : "ᾛ" U1F9B # GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <U1F2C> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F2C> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <U1F28> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <U1F28> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <U1F28> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <U1F28> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <U1F28> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <U1F28> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <dead_psili> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <Multi_key> <parenright> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <dead_psili> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <parenright> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <dead_psili> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <parenright> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <dead_psili> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <parenright> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <dead_psili> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <parenright> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <dead_psili> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <parenright> <Greek_ETA> : "ᾜ" U1F9C # GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <U1F2D> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F2D> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <U1F29> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <U1F29> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <U1F29> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <U1F29> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <U1F29> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <U1F29> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <dead_dasia> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <Multi_key> <parenleft> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <dead_dasia> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <parenleft> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <dead_dasia> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <parenleft> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <dead_dasia> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <parenleft> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <dead_dasia> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <parenleft> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <dead_dasia> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <parenleft> <Greek_ETA> : "ᾝ" U1F9D # GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <U1F2E> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F2E> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <U1F28> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <U1F28> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <U1F28> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <U1F28> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <dead_psili> <Greek_ETA> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <Multi_key> <parenright> <Greek_ETA> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <dead_psili> <Greek_ETA> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <parenright> <Greek_ETA> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <dead_psili> <Greek_ETA> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <parenright> <Greek_ETA> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <dead_psili> <Greek_ETA> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <parenright> <Greek_ETA> : "ᾞ" U1F9E # GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <U1F2F> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F2F> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <U1F29> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <U1F29> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <U1F29> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <U1F29> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <dead_dasia> <Greek_ETA> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <Multi_key> <parenleft> <Greek_ETA> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <dead_dasia> <Greek_ETA> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <parenleft> <Greek_ETA> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <dead_dasia> <Greek_ETA> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <parenleft> <Greek_ETA> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <dead_dasia> <Greek_ETA> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <parenleft> <Greek_ETA> : "ᾟ" U1F9F # GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <U1F60> : "ᾠ" U1FA0 # GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F60> : "ᾠ" U1FA0 # GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI
+<dead_iota> <dead_psili> <Greek_omega> : "ᾠ" U1FA0 # GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <parenright> <Greek_omega> : "ᾠ" U1FA0 # GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_psili> <Greek_omega> : "ᾠ" U1FA0 # GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <parenright> <Greek_omega> : "ᾠ" U1FA0 # GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI
+<dead_iota> <U1F61> : "ᾡ" U1FA1 # GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F61> : "ᾡ" U1FA1 # GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI
+<dead_iota> <dead_dasia> <Greek_omega> : "ᾡ" U1FA1 # GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <parenleft> <Greek_omega> : "ᾡ" U1FA1 # GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_dasia> <Greek_omega> : "ᾡ" U1FA1 # GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <parenleft> <Greek_omega> : "ᾡ" U1FA1 # GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI
+<dead_iota> <U1F62> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F62> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <U1F60> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <U1F60> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <U1F60> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <U1F60> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <dead_psili> <Greek_omega> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <Multi_key> <parenright> <Greek_omega> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <dead_psili> <Greek_omega> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <parenright> <Greek_omega> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <dead_psili> <Greek_omega> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <parenright> <Greek_omega> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <dead_psili> <Greek_omega> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <parenright> <Greek_omega> : "ᾢ" U1FA2 # GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <U1F63> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F63> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <U1F61> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <U1F61> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <U1F61> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <U1F61> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <dead_dasia> <Greek_omega> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <Multi_key> <parenleft> <Greek_omega> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <dead_dasia> <Greek_omega> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <parenleft> <Greek_omega> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <dead_dasia> <Greek_omega> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <parenleft> <Greek_omega> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <dead_dasia> <Greek_omega> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <parenleft> <Greek_omega> : "ᾣ" U1FA3 # GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI
+<dead_iota> <U1F64> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F64> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <U1F60> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <U1F60> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <U1F60> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <U1F60> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <U1F60> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <U1F60> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <dead_psili> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <Multi_key> <parenright> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <dead_psili> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <parenright> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <dead_psili> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <parenright> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <dead_psili> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <parenright> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <dead_psili> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <parenright> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <dead_psili> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <parenright> <Greek_omega> : "ᾤ" U1FA4 # GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <U1F65> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F65> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <U1F61> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <U1F61> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <U1F61> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <U1F61> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <U1F61> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <U1F61> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <dead_dasia> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <Multi_key> <parenleft> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <dead_dasia> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <parenleft> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <dead_dasia> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <parenleft> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <dead_dasia> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <parenleft> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <dead_dasia> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <parenleft> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <dead_dasia> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <parenleft> <Greek_omega> : "ᾥ" U1FA5 # GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI
+<dead_iota> <U1F66> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F66> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <U1F60> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <U1F60> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <U1F60> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <U1F60> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <dead_psili> <Greek_omega> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <Multi_key> <parenright> <Greek_omega> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <dead_psili> <Greek_omega> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <parenright> <Greek_omega> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <dead_psili> <Greek_omega> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <parenright> <Greek_omega> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <dead_psili> <Greek_omega> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <parenright> <Greek_omega> : "ᾦ" U1FA6 # GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <U1F67> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F67> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <U1F61> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <U1F61> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <U1F61> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <U1F61> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <dead_dasia> <Greek_omega> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <Multi_key> <parenleft> <Greek_omega> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <dead_dasia> <Greek_omega> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <parenleft> <Greek_omega> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <dead_dasia> <Greek_omega> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <parenleft> <Greek_omega> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <dead_dasia> <Greek_omega> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <parenleft> <Greek_omega> : "ᾧ" U1FA7 # GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <U1F68> : "ᾨ" U1FA8 # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F68> : "ᾨ" U1FA8 # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI
+<dead_iota> <dead_psili> <Greek_OMEGA> : "ᾨ" U1FA8 # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <parenright> <Greek_OMEGA> : "ᾨ" U1FA8 # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_psili> <Greek_OMEGA> : "ᾨ" U1FA8 # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <parenright> <Greek_OMEGA> : "ᾨ" U1FA8 # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI
+<dead_iota> <U1F69> : "ᾩ" U1FA9 # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F69> : "ᾩ" U1FA9 # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI
+<dead_iota> <dead_dasia> <Greek_OMEGA> : "ᾩ" U1FA9 # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <parenleft> <Greek_OMEGA> : "ᾩ" U1FA9 # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_dasia> <Greek_OMEGA> : "ᾩ" U1FA9 # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <parenleft> <Greek_OMEGA> : "ᾩ" U1FA9 # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI
+<dead_iota> <U1F6A> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F6A> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <U1F68> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <U1F68> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <U1F68> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <U1F68> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <dead_psili> <Greek_OMEGA> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <Multi_key> <parenright> <Greek_OMEGA> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <dead_psili> <Greek_OMEGA> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <parenright> <Greek_OMEGA> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <dead_psili> <Greek_OMEGA> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <parenright> <Greek_OMEGA> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <dead_psili> <Greek_OMEGA> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <parenright> <Greek_OMEGA> : "ᾪ" U1FAA # GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <U1F6B> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F6B> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <U1F69> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <U1F69> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <U1F69> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <U1F69> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <dead_dasia> <Greek_OMEGA> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <dead_grave> <Multi_key> <parenleft> <Greek_OMEGA> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <dead_dasia> <Greek_OMEGA> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <parenleft> <Greek_OMEGA> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <dead_dasia> <Greek_OMEGA> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <parenleft> <Greek_OMEGA> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <dead_dasia> <Greek_OMEGA> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <parenleft> <Greek_OMEGA> : "ᾫ" U1FAB # GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI
+<dead_iota> <U1F6C> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F6C> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <U1F68> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <U1F68> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <U1F68> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <U1F68> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <U1F68> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <U1F68> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <dead_psili> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <Multi_key> <parenright> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <dead_psili> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <parenright> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <dead_psili> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <parenright> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <dead_psili> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <parenright> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <dead_psili> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <parenright> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <dead_psili> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <parenright> <Greek_OMEGA> : "ᾬ" U1FAC # GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <U1F6D> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F6D> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <U1F69> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <U1F69> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <U1F69> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <U1F69> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <U1F69> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <U1F69> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <dead_dasia> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <dead_acute> <Multi_key> <parenleft> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <dead_dasia> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <parenleft> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <dead_dasia> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <parenleft> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <dead_dasia> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <parenleft> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <dead_dasia> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <parenleft> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <dead_dasia> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <parenleft> <Greek_OMEGA> : "ᾭ" U1FAD # GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI
+<dead_iota> <U1F6E> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F6E> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <U1F68> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <U1F68> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <U1F68> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <U1F68> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <dead_psili> <Greek_OMEGA> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <Multi_key> <parenright> <Greek_OMEGA> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <dead_psili> <Greek_OMEGA> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <parenright> <Greek_OMEGA> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <dead_psili> <Greek_OMEGA> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <parenright> <Greek_OMEGA> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <dead_psili> <Greek_OMEGA> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <parenright> <Greek_OMEGA> : "ᾮ" U1FAE # GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <U1F6F> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F6F> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <U1F69> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <U1F69> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <U1F69> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <U1F69> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <dead_dasia> <Greek_OMEGA> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <dead_tilde> <Multi_key> <parenleft> <Greek_OMEGA> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <dead_dasia> <Greek_OMEGA> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <parenleft> <Greek_OMEGA> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <dead_dasia> <Greek_OMEGA> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <parenleft> <Greek_OMEGA> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <dead_dasia> <Greek_OMEGA> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <parenleft> <Greek_OMEGA> : "ᾯ" U1FAF # GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI
+<dead_breve> <Greek_alpha> : "ᾰ" U1FB0 # GREEK SMALL LETTER ALPHA WITH VRACHY
+<Multi_key> <U> <Greek_alpha> : "ᾰ" U1FB0 # GREEK SMALL LETTER ALPHA WITH VRACHY
+<Multi_key> <b> <Greek_alpha> : "ᾰ" U1FB0 # GREEK SMALL LETTER ALPHA WITH VRACHY
+<dead_macron> <Greek_alpha> : "ᾱ" U1FB1 # GREEK SMALL LETTER ALPHA WITH MACRON
+<Multi_key> <macron> <Greek_alpha> : "ᾱ" U1FB1 # GREEK SMALL LETTER ALPHA WITH MACRON
+<Multi_key> <underscore> <Greek_alpha> : "ᾱ" U1FB1 # GREEK SMALL LETTER ALPHA WITH MACRON
+<dead_iota> <U1F70> : "ᾲ" U1FB2 # GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F70> : "ᾲ" U1FB2 # GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <Greek_alpha> : "ᾲ" U1FB2 # GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <Greek_alpha> : "ᾲ" U1FB2 # GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <Greek_alpha> : "ᾲ" U1FB2 # GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <Greek_alpha> : "ᾲ" U1FB2 # GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI
+<dead_iota> <Greek_alpha> : "ᾳ" U1FB3 # GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <Greek_alpha> : "ᾳ" U1FB3 # GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI
+<dead_iota> <Greek_alphaaccent> : "ᾴ" U1FB4 # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <Greek_alphaaccent> : "ᾴ" U1FB4 # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <Greek_alpha> : "ᾴ" U1FB4 # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <Greek_alpha> : "ᾴ" U1FB4 # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <Greek_alpha> : "ᾴ" U1FB4 # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <Greek_alpha> : "ᾴ" U1FB4 # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <Greek_alpha> : "ᾴ" U1FB4 # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <Greek_alpha> : "ᾴ" U1FB4 # GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI
+<dead_tilde> <Greek_alpha> : "ᾶ" U1FB6 # GREEK SMALL LETTER ALPHA WITH PERISPOMENI
+<Multi_key> <asciitilde> <Greek_alpha> : "ᾶ" U1FB6 # GREEK SMALL LETTER ALPHA WITH PERISPOMENI
+<dead_iota> <U1FB6> : "ᾷ" U1FB7 # GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1FB6> : "ᾷ" U1FB7 # GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <Greek_alpha> : "ᾷ" U1FB7 # GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <Greek_alpha> : "ᾷ" U1FB7 # GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <Greek_alpha> : "ᾷ" U1FB7 # GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <Greek_alpha> : "ᾷ" U1FB7 # GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI
+<dead_breve> <Greek_ALPHA> : "Ᾰ" U1FB8 # GREEK CAPITAL LETTER ALPHA WITH VRACHY
+<Multi_key> <U> <Greek_ALPHA> : "Ᾰ" U1FB8 # GREEK CAPITAL LETTER ALPHA WITH VRACHY
+<Multi_key> <b> <Greek_ALPHA> : "Ᾰ" U1FB8 # GREEK CAPITAL LETTER ALPHA WITH VRACHY
+<dead_macron> <Greek_ALPHA> : "Ᾱ" U1FB9 # GREEK CAPITAL LETTER ALPHA WITH MACRON
+<Multi_key> <macron> <Greek_ALPHA> : "Ᾱ" U1FB9 # GREEK CAPITAL LETTER ALPHA WITH MACRON
+<Multi_key> <underscore> <Greek_ALPHA> : "Ᾱ" U1FB9 # GREEK CAPITAL LETTER ALPHA WITH MACRON
+<dead_grave> <Greek_ALPHA> : "Ὰ" U1FBA # GREEK CAPITAL LETTER ALPHA WITH VARIA
+<Multi_key> <grave> <Greek_ALPHA> : "Ὰ" U1FBA # GREEK CAPITAL LETTER ALPHA WITH VARIA
+<dead_iota> <Greek_ALPHA> : "ᾼ" U1FBC # GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <Greek_ALPHA> : "ᾼ" U1FBC # GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI
+<Multi_key> <diaeresis> <dead_tilde> : "῁" U1FC1 # GREEK DIALYTIKA AND PERISPOMENI
+<Multi_key> <diaeresis> <asciitilde> : "῁" U1FC1 # GREEK DIALYTIKA AND PERISPOMENI
+<dead_iota> <U1F74> : "ῂ" U1FC2 # GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F74> : "ῂ" U1FC2 # GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <Greek_eta> : "ῂ" U1FC2 # GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <Greek_eta> : "ῂ" U1FC2 # GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <Greek_eta> : "ῂ" U1FC2 # GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <Greek_eta> : "ῂ" U1FC2 # GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI
+<dead_iota> <Greek_eta> : "ῃ" U1FC3 # GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <Greek_eta> : "ῃ" U1FC3 # GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI
+<dead_iota> <Greek_etaaccent> : "ῄ" U1FC4 # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <Greek_etaaccent> : "ῄ" U1FC4 # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <Greek_eta> : "ῄ" U1FC4 # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <Greek_eta> : "ῄ" U1FC4 # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <Greek_eta> : "ῄ" U1FC4 # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <Greek_eta> : "ῄ" U1FC4 # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <Greek_eta> : "ῄ" U1FC4 # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <Greek_eta> : "ῄ" U1FC4 # GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI
+<dead_tilde> <Greek_eta> : "ῆ" U1FC6 # GREEK SMALL LETTER ETA WITH PERISPOMENI
+<Multi_key> <asciitilde> <Greek_eta> : "ῆ" U1FC6 # GREEK SMALL LETTER ETA WITH PERISPOMENI
+<dead_iota> <U1FC6> : "ῇ" U1FC7 # GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1FC6> : "ῇ" U1FC7 # GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <Greek_eta> : "ῇ" U1FC7 # GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <Greek_eta> : "ῇ" U1FC7 # GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <Greek_eta> : "ῇ" U1FC7 # GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <Greek_eta> : "ῇ" U1FC7 # GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI
+<dead_grave> <Greek_EPSILON> : "Ὲ" U1FC8 # GREEK CAPITAL LETTER EPSILON WITH VARIA
+<Multi_key> <grave> <Greek_EPSILON> : "Ὲ" U1FC8 # GREEK CAPITAL LETTER EPSILON WITH VARIA
+<dead_grave> <Greek_ETA> : "Ὴ" U1FCA # GREEK CAPITAL LETTER ETA WITH VARIA
+<Multi_key> <grave> <Greek_ETA> : "Ὴ" U1FCA # GREEK CAPITAL LETTER ETA WITH VARIA
+<dead_iota> <Greek_ETA> : "ῌ" U1FCC # GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <Greek_ETA> : "ῌ" U1FCC # GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI
+<Multi_key> <U1FBF> <dead_grave> : "῍" U1FCD # GREEK PSILI AND VARIA
+<Multi_key> <U1FBF> <grave> : "῍" U1FCD # GREEK PSILI AND VARIA
+<Multi_key> <U1FBF> <dead_acute> : "῎" U1FCE # GREEK PSILI AND OXIA
+<Multi_key> <U1FBF> <acute> : "῎" U1FCE # GREEK PSILI AND OXIA
+<Multi_key> <U1FBF> <apostrophe> : "῎" U1FCE # GREEK PSILI AND OXIA
+<Multi_key> <U1FBF> <dead_tilde> : "῏" U1FCF # GREEK PSILI AND PERISPOMENI
+<Multi_key> <U1FBF> <asciitilde> : "῏" U1FCF # GREEK PSILI AND PERISPOMENI
+<dead_breve> <Greek_iota> : "ῐ" U1FD0 # GREEK SMALL LETTER IOTA WITH VRACHY
+<Multi_key> <U> <Greek_iota> : "ῐ" U1FD0 # GREEK SMALL LETTER IOTA WITH VRACHY
+<Multi_key> <b> <Greek_iota> : "ῐ" U1FD0 # GREEK SMALL LETTER IOTA WITH VRACHY
+<dead_macron> <Greek_iota> : "ῑ" U1FD1 # GREEK SMALL LETTER IOTA WITH MACRON
+<Multi_key> <macron> <Greek_iota> : "ῑ" U1FD1 # GREEK SMALL LETTER IOTA WITH MACRON
+<Multi_key> <underscore> <Greek_iota> : "ῑ" U1FD1 # GREEK SMALL LETTER IOTA WITH MACRON
+<dead_grave> <Greek_iotadieresis> : "ῒ" U1FD2 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA
+<Multi_key> <grave> <Greek_iotadieresis> : "ῒ" U1FD2 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA
+<dead_grave> <dead_diaeresis> <Greek_iota> : "ῒ" U1FD2 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA
+<dead_grave> <Multi_key> <quotedbl> <Greek_iota> : "ῒ" U1FD2 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA
+<Multi_key> <grave> <dead_diaeresis> <Greek_iota> : "ῒ" U1FD2 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA
+<Multi_key> <grave> <quotedbl> <Greek_iota> : "ῒ" U1FD2 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA
+<dead_tilde> <Greek_iota> : "ῖ" U1FD6 # GREEK SMALL LETTER IOTA WITH PERISPOMENI
+<Multi_key> <asciitilde> <Greek_iota> : "ῖ" U1FD6 # GREEK SMALL LETTER IOTA WITH PERISPOMENI
+<dead_tilde> <Greek_iotadieresis> : "ῗ" U1FD7 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI
+<Multi_key> <asciitilde> <Greek_iotadieresis> : "ῗ" U1FD7 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI
+<dead_tilde> <dead_diaeresis> <Greek_iota> : "ῗ" U1FD7 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI
+<dead_tilde> <Multi_key> <quotedbl> <Greek_iota> : "ῗ" U1FD7 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_diaeresis> <Greek_iota> : "ῗ" U1FD7 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI
+<Multi_key> <asciitilde> <quotedbl> <Greek_iota> : "ῗ" U1FD7 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI
+<dead_breve> <Greek_IOTA> : "Ῐ" U1FD8 # GREEK CAPITAL LETTER IOTA WITH VRACHY
+<Multi_key> <U> <Greek_IOTA> : "Ῐ" U1FD8 # GREEK CAPITAL LETTER IOTA WITH VRACHY
+<Multi_key> <b> <Greek_IOTA> : "Ῐ" U1FD8 # GREEK CAPITAL LETTER IOTA WITH VRACHY
+<dead_macron> <Greek_IOTA> : "Ῑ" U1FD9 # GREEK CAPITAL LETTER IOTA WITH MACRON
+<Multi_key> <macron> <Greek_IOTA> : "Ῑ" U1FD9 # GREEK CAPITAL LETTER IOTA WITH MACRON
+<Multi_key> <underscore> <Greek_IOTA> : "Ῑ" U1FD9 # GREEK CAPITAL LETTER IOTA WITH MACRON
+<dead_grave> <Greek_IOTA> : "Ὶ" U1FDA # GREEK CAPITAL LETTER IOTA WITH VARIA
+<Multi_key> <grave> <Greek_IOTA> : "Ὶ" U1FDA # GREEK CAPITAL LETTER IOTA WITH VARIA
+<Multi_key> <U1FFE> <dead_grave> : "῝" U1FDD # GREEK DASIA AND VARIA
+<Multi_key> <U1FFE> <grave> : "῝" U1FDD # GREEK DASIA AND VARIA
+<Multi_key> <U1FFE> <dead_acute> : "῞" U1FDE # GREEK DASIA AND OXIA
+<Multi_key> <U1FFE> <acute> : "῞" U1FDE # GREEK DASIA AND OXIA
+<Multi_key> <U1FFE> <apostrophe> : "῞" U1FDE # GREEK DASIA AND OXIA
+<Multi_key> <U1FFE> <dead_tilde> : "῟" U1FDF # GREEK DASIA AND PERISPOMENI
+<Multi_key> <U1FFE> <asciitilde> : "῟" U1FDF # GREEK DASIA AND PERISPOMENI
+<dead_breve> <Greek_upsilon> : "ῠ" U1FE0 # GREEK SMALL LETTER UPSILON WITH VRACHY
+<Multi_key> <U> <Greek_upsilon> : "ῠ" U1FE0 # GREEK SMALL LETTER UPSILON WITH VRACHY
+<Multi_key> <b> <Greek_upsilon> : "ῠ" U1FE0 # GREEK SMALL LETTER UPSILON WITH VRACHY
+<dead_macron> <Greek_upsilon> : "ῡ" U1FE1 # GREEK SMALL LETTER UPSILON WITH MACRON
+<Multi_key> <macron> <Greek_upsilon> : "ῡ" U1FE1 # GREEK SMALL LETTER UPSILON WITH MACRON
+<Multi_key> <underscore> <Greek_upsilon> : "ῡ" U1FE1 # GREEK SMALL LETTER UPSILON WITH MACRON
+<dead_grave> <Greek_upsilondieresis> : "ῢ" U1FE2 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA
+<Multi_key> <grave> <Greek_upsilondieresis> : "ῢ" U1FE2 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA
+<dead_grave> <dead_diaeresis> <Greek_upsilon> : "ῢ" U1FE2 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA
+<dead_grave> <Multi_key> <quotedbl> <Greek_upsilon> : "ῢ" U1FE2 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA
+<Multi_key> <grave> <dead_diaeresis> <Greek_upsilon> : "ῢ" U1FE2 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA
+<Multi_key> <grave> <quotedbl> <Greek_upsilon> : "ῢ" U1FE2 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA
+<dead_psili> <Greek_rho> : "ῤ" U1FE4 # GREEK SMALL LETTER RHO WITH PSILI
+<Multi_key> <parenright> <Greek_rho> : "ῤ" U1FE4 # GREEK SMALL LETTER RHO WITH PSILI
+<dead_dasia> <Greek_rho> : "ῥ" U1FE5 # GREEK SMALL LETTER RHO WITH DASIA
+<Multi_key> <parenleft> <Greek_rho> : "ῥ" U1FE5 # GREEK SMALL LETTER RHO WITH DASIA
+<dead_tilde> <Greek_upsilon> : "ῦ" U1FE6 # GREEK SMALL LETTER UPSILON WITH PERISPOMENI
+<Multi_key> <asciitilde> <Greek_upsilon> : "ῦ" U1FE6 # GREEK SMALL LETTER UPSILON WITH PERISPOMENI
+<dead_tilde> <Greek_upsilondieresis> : "ῧ" U1FE7 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI
+<Multi_key> <asciitilde> <Greek_upsilondieresis> : "ῧ" U1FE7 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI
+<dead_tilde> <dead_diaeresis> <Greek_upsilon> : "ῧ" U1FE7 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI
+<dead_tilde> <Multi_key> <quotedbl> <Greek_upsilon> : "ῧ" U1FE7 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI
+<Multi_key> <asciitilde> <dead_diaeresis> <Greek_upsilon> : "ῧ" U1FE7 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI
+<Multi_key> <asciitilde> <quotedbl> <Greek_upsilon> : "ῧ" U1FE7 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI
+<dead_breve> <Greek_UPSILON> : "Ῠ" U1FE8 # GREEK CAPITAL LETTER UPSILON WITH VRACHY
+<Multi_key> <U> <Greek_UPSILON> : "Ῠ" U1FE8 # GREEK CAPITAL LETTER UPSILON WITH VRACHY
+<Multi_key> <b> <Greek_UPSILON> : "Ῠ" U1FE8 # GREEK CAPITAL LETTER UPSILON WITH VRACHY
+<dead_macron> <Greek_UPSILON> : "Ῡ" U1FE9 # GREEK CAPITAL LETTER UPSILON WITH MACRON
+<Multi_key> <macron> <Greek_UPSILON> : "Ῡ" U1FE9 # GREEK CAPITAL LETTER UPSILON WITH MACRON
+<Multi_key> <underscore> <Greek_UPSILON> : "Ῡ" U1FE9 # GREEK CAPITAL LETTER UPSILON WITH MACRON
+<dead_grave> <Greek_UPSILON> : "Ὺ" U1FEA # GREEK CAPITAL LETTER UPSILON WITH VARIA
+<Multi_key> <grave> <Greek_UPSILON> : "Ὺ" U1FEA # GREEK CAPITAL LETTER UPSILON WITH VARIA
+<dead_dasia> <Greek_RHO> : "Ῥ" U1FEC # GREEK CAPITAL LETTER RHO WITH DASIA
+<Multi_key> <parenleft> <Greek_RHO> : "Ῥ" U1FEC # GREEK CAPITAL LETTER RHO WITH DASIA
+<Multi_key> <diaeresis> <dead_grave> : "῭" U1FED # GREEK DIALYTIKA AND VARIA
+<Multi_key> <diaeresis> <grave> : "῭" U1FED # GREEK DIALYTIKA AND VARIA
+<dead_iota> <U1F7C> : "ῲ" U1FF2 # GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1F7C> : "ῲ" U1FF2 # GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI
+<dead_iota> <dead_grave> <Greek_omega> : "ῲ" U1FF2 # GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <grave> <Greek_omega> : "ῲ" U1FF2 # GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_grave> <Greek_omega> : "ῲ" U1FF2 # GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <grave> <Greek_omega> : "ῲ" U1FF2 # GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI
+<dead_iota> <Greek_omega> : "ῳ" U1FF3 # GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <Greek_omega> : "ῳ" U1FF3 # GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI
+<dead_iota> <Greek_omegaaccent> : "ῴ" U1FF4 # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <Greek_omegaaccent> : "ῴ" U1FF4 # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
+<dead_iota> <dead_acute> <Greek_omega> : "ῴ" U1FF4 # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <acute> <Greek_omega> : "ῴ" U1FF4 # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <apostrophe> <Greek_omega> : "ῴ" U1FF4 # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_acute> <Greek_omega> : "ῴ" U1FF4 # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <acute> <Greek_omega> : "ῴ" U1FF4 # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <apostrophe> <Greek_omega> : "ῴ" U1FF4 # GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI
+<dead_tilde> <Greek_omega> : "ῶ" U1FF6 # GREEK SMALL LETTER OMEGA WITH PERISPOMENI
+<Multi_key> <asciitilde> <Greek_omega> : "ῶ" U1FF6 # GREEK SMALL LETTER OMEGA WITH PERISPOMENI
+<dead_iota> <U1FF6> : "ῷ" U1FF7 # GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <U1FF6> : "ῷ" U1FF7 # GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <dead_tilde> <Greek_omega> : "ῷ" U1FF7 # GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI
+<dead_iota> <Multi_key> <asciitilde> <Greek_omega> : "ῷ" U1FF7 # GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <dead_tilde> <Greek_omega> : "ῷ" U1FF7 # GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI
+<Multi_key> <Greek_iota> <asciitilde> <Greek_omega> : "ῷ" U1FF7 # GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI
+<dead_grave> <Greek_OMICRON> : "Ὸ" U1FF8 # GREEK CAPITAL LETTER OMICRON WITH VARIA
+<Multi_key> <grave> <Greek_OMICRON> : "Ὸ" U1FF8 # GREEK CAPITAL LETTER OMICRON WITH VARIA
+<dead_grave> <Greek_OMEGA> : "Ὼ" U1FFA # GREEK CAPITAL LETTER OMEGA WITH VARIA
+<Multi_key> <grave> <Greek_OMEGA> : "Ὼ" U1FFA # GREEK CAPITAL LETTER OMEGA WITH VARIA
+<dead_iota> <Greek_OMEGA> : "ῼ" U1FFC # GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI
+<Multi_key> <Greek_iota> <Greek_OMEGA> : "ῼ" U1FFC # GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI
+<dead_circumflex> <0> : "⁰" U2070 # SUPERSCRIPT ZERO
+<Multi_key> <asciicircum> <0> : "⁰" U2070 # SUPERSCRIPT ZERO
+<dead_circumflex> <KP_0> : "⁰" U2070 # SUPERSCRIPT ZERO
+<Multi_key> <asciicircum> <KP_0> : "⁰" U2070 # SUPERSCRIPT ZERO
+<dead_circumflex> <Multi_key> <underscore> <i> : "ⁱ" U2071 # SUPERSCRIPT LATIN SMALL LETTER I
+<Multi_key> <asciicircum> <underscore> <i> : "ⁱ" U2071 # SUPERSCRIPT LATIN SMALL LETTER I
+<dead_circumflex> <Multi_key> <underbar> <i> : "ⁱ" U2071 # SUPERSCRIPT LATIN SMALL LETTER I
+<Multi_key> <asciicircum> <underbar> <i> : "ⁱ" U2071 # SUPERSCRIPT LATIN SMALL LETTER I
+<dead_circumflex> <4> : "⁴" U2074 # SUPERSCRIPT FOUR
+<Multi_key> <asciicircum> <4> : "⁴" U2074 # SUPERSCRIPT FOUR
+<dead_circumflex> <KP_4> : "⁴" U2074 # SUPERSCRIPT FOUR
+<Multi_key> <asciicircum> <KP_4> : "⁴" U2074 # SUPERSCRIPT FOUR
+<dead_circumflex> <5> : "⁵" U2075 # SUPERSCRIPT FIVE
+<Multi_key> <asciicircum> <5> : "⁵" U2075 # SUPERSCRIPT FIVE
+<dead_circumflex> <KP_5> : "⁵" U2075 # SUPERSCRIPT FIVE
+<Multi_key> <asciicircum> <KP_5> : "⁵" U2075 # SUPERSCRIPT FIVE
+<dead_circumflex> <6> : "⁶" U2076 # SUPERSCRIPT SIX
+<Multi_key> <asciicircum> <6> : "⁶" U2076 # SUPERSCRIPT SIX
+<dead_circumflex> <KP_6> : "⁶" U2076 # SUPERSCRIPT SIX
+<Multi_key> <asciicircum> <KP_6> : "⁶" U2076 # SUPERSCRIPT SIX
+<dead_circumflex> <7> : "⁷" U2077 # SUPERSCRIPT SEVEN
+<Multi_key> <asciicircum> <7> : "⁷" U2077 # SUPERSCRIPT SEVEN
+<dead_circumflex> <KP_7> : "⁷" U2077 # SUPERSCRIPT SEVEN
+<Multi_key> <asciicircum> <KP_7> : "⁷" U2077 # SUPERSCRIPT SEVEN
+<dead_circumflex> <8> : "⁸" U2078 # SUPERSCRIPT EIGHT
+<Multi_key> <asciicircum> <8> : "⁸" U2078 # SUPERSCRIPT EIGHT
+<dead_circumflex> <KP_8> : "⁸" U2078 # SUPERSCRIPT EIGHT
+<Multi_key> <asciicircum> <KP_8> : "⁸" U2078 # SUPERSCRIPT EIGHT
+<dead_circumflex> <9> : "⁹" U2079 # SUPERSCRIPT NINE
+<Multi_key> <asciicircum> <9> : "⁹" U2079 # SUPERSCRIPT NINE
+<dead_circumflex> <KP_9> : "⁹" U2079 # SUPERSCRIPT NINE
+<Multi_key> <asciicircum> <KP_9> : "⁹" U2079 # SUPERSCRIPT NINE
+<dead_circumflex> <plus> : "⁺" U207A # SUPERSCRIPT PLUS SIGN
+<Multi_key> <asciicircum> <plus> : "⁺" U207A # SUPERSCRIPT PLUS SIGN
+<dead_circumflex> <KP_Add> : "⁺" U207A # SUPERSCRIPT PLUS SIGN
+<Multi_key> <asciicircum> <KP_Add> : "⁺" U207A # SUPERSCRIPT PLUS SIGN
+<dead_circumflex> <U2212> : "⁻" U207B # SUPERSCRIPT MINUS
+<Multi_key> <asciicircum> <U2212> : "⁻" U207B # SUPERSCRIPT MINUS
+<dead_circumflex> <equal> : "⁼" U207C # SUPERSCRIPT EQUALS SIGN
+<Multi_key> <asciicircum> <equal> : "⁼" U207C # SUPERSCRIPT EQUALS SIGN
+<dead_circumflex> <KP_Equal> : "⁼" U207C # SUPERSCRIPT EQUALS SIGN
+<Multi_key> <asciicircum> <KP_Equal> : "⁼" U207C # SUPERSCRIPT EQUALS SIGN
+<dead_circumflex> <parenleft> : "⁽" U207D # SUPERSCRIPT LEFT PARENTHESIS
+<Multi_key> <asciicircum> <parenleft> : "⁽" U207D # SUPERSCRIPT LEFT PARENTHESIS
+<dead_circumflex> <parenright> : "⁾" U207E # SUPERSCRIPT RIGHT PARENTHESIS
+<Multi_key> <asciicircum> <parenright> : "⁾" U207E # SUPERSCRIPT RIGHT PARENTHESIS
+<dead_circumflex> <Multi_key> <underscore> <n> : "ⁿ" U207F # SUPERSCRIPT LATIN SMALL LETTER N
+<Multi_key> <asciicircum> <underscore> <n> : "ⁿ" U207F # SUPERSCRIPT LATIN SMALL LETTER N
+<dead_circumflex> <Multi_key> <underbar> <n> : "ⁿ" U207F # SUPERSCRIPT LATIN SMALL LETTER N
+<Multi_key> <asciicircum> <underbar> <n> : "ⁿ" U207F # SUPERSCRIPT LATIN SMALL LETTER N
+<Multi_key> <underscore> <0> : "₀" U2080 # SUBSCRIPT ZERO
+<Multi_key> <underscore> <KP_0> : "₀" U2080 # SUBSCRIPT ZERO
+<Multi_key> <underbar> <0> : "₀" U2080 # SUBSCRIPT ZERO
+<Multi_key> <underbar> <KP_0> : "₀" U2080 # SUBSCRIPT ZERO
+<Multi_key> <underscore> <1> : "₁" U2081 # SUBSCRIPT ONE
+<Multi_key> <underscore> <KP_1> : "₁" U2081 # SUBSCRIPT ONE
+<Multi_key> <underbar> <1> : "₁" U2081 # SUBSCRIPT ONE
+<Multi_key> <underbar> <KP_1> : "₁" U2081 # SUBSCRIPT ONE
+<Multi_key> <underscore> <2> : "₂" U2082 # SUBSCRIPT TWO
+<Multi_key> <underscore> <KP_Space> : "₂" U2082 # SUBSCRIPT TWO
+<Multi_key> <underscore> <KP_2> : "₂" U2082 # SUBSCRIPT TWO
+<Multi_key> <underbar> <2> : "₂" U2082 # SUBSCRIPT TWO
+<Multi_key> <underbar> <KP_Space> : "₂" U2082 # SUBSCRIPT TWO
+<Multi_key> <underbar> <KP_2> : "₂" U2082 # SUBSCRIPT TWO
+<Multi_key> <underscore> <3> : "₃" U2083 # SUBSCRIPT THREE
+<Multi_key> <underscore> <KP_3> : "₃" U2083 # SUBSCRIPT THREE
+<Multi_key> <underbar> <3> : "₃" U2083 # SUBSCRIPT THREE
+<Multi_key> <underbar> <KP_3> : "₃" U2083 # SUBSCRIPT THREE
+<Multi_key> <underscore> <4> : "₄" U2084 # SUBSCRIPT FOUR
+<Multi_key> <underscore> <KP_4> : "₄" U2084 # SUBSCRIPT FOUR
+<Multi_key> <underbar> <4> : "₄" U2084 # SUBSCRIPT FOUR
+<Multi_key> <underbar> <KP_4> : "₄" U2084 # SUBSCRIPT FOUR
+<Multi_key> <underscore> <5> : "₅" U2085 # SUBSCRIPT FIVE
+<Multi_key> <underscore> <KP_5> : "₅" U2085 # SUBSCRIPT FIVE
+<Multi_key> <underbar> <5> : "₅" U2085 # SUBSCRIPT FIVE
+<Multi_key> <underbar> <KP_5> : "₅" U2085 # SUBSCRIPT FIVE
+<Multi_key> <underscore> <6> : "₆" U2086 # SUBSCRIPT SIX
+<Multi_key> <underscore> <KP_6> : "₆" U2086 # SUBSCRIPT SIX
+<Multi_key> <underbar> <6> : "₆" U2086 # SUBSCRIPT SIX
+<Multi_key> <underbar> <KP_6> : "₆" U2086 # SUBSCRIPT SIX
+<Multi_key> <underscore> <7> : "₇" U2087 # SUBSCRIPT SEVEN
+<Multi_key> <underscore> <KP_7> : "₇" U2087 # SUBSCRIPT SEVEN
+<Multi_key> <underbar> <7> : "₇" U2087 # SUBSCRIPT SEVEN
+<Multi_key> <underbar> <KP_7> : "₇" U2087 # SUBSCRIPT SEVEN
+<Multi_key> <underscore> <8> : "₈" U2088 # SUBSCRIPT EIGHT
+<Multi_key> <underscore> <KP_8> : "₈" U2088 # SUBSCRIPT EIGHT
+<Multi_key> <underbar> <8> : "₈" U2088 # SUBSCRIPT EIGHT
+<Multi_key> <underbar> <KP_8> : "₈" U2088 # SUBSCRIPT EIGHT
+<Multi_key> <underscore> <9> : "₉" U2089 # SUBSCRIPT NINE
+<Multi_key> <underscore> <KP_9> : "₉" U2089 # SUBSCRIPT NINE
+<Multi_key> <underbar> <9> : "₉" U2089 # SUBSCRIPT NINE
+<Multi_key> <underbar> <KP_9> : "₉" U2089 # SUBSCRIPT NINE
+<Multi_key> <underscore> <plus> : "₊" U208A # SUBSCRIPT PLUS SIGN
+<Multi_key> <underscore> <KP_Add> : "₊" U208A # SUBSCRIPT PLUS SIGN
+<Multi_key> <underbar> <plus> : "₊" U208A # SUBSCRIPT PLUS SIGN
+<Multi_key> <underbar> <KP_Add> : "₊" U208A # SUBSCRIPT PLUS SIGN
+<Multi_key> <underscore> <U2212> : "₋" U208B # SUBSCRIPT MINUS
+<Multi_key> <underbar> <U2212> : "₋" U208B # SUBSCRIPT MINUS
+<Multi_key> <underscore> <equal> : "₌" U208C # SUBSCRIPT EQUALS SIGN
+<Multi_key> <underscore> <KP_Equal> : "₌" U208C # SUBSCRIPT EQUALS SIGN
+<Multi_key> <underbar> <equal> : "₌" U208C # SUBSCRIPT EQUALS SIGN
+<Multi_key> <underbar> <KP_Equal> : "₌" U208C # SUBSCRIPT EQUALS SIGN
+<Multi_key> <underscore> <parenleft> : "₍" U208D # SUBSCRIPT LEFT PARENTHESIS
+<Multi_key> <underbar> <parenleft> : "₍" U208D # SUBSCRIPT LEFT PARENTHESIS
+<Multi_key> <underscore> <parenright> : "₎" U208E # SUBSCRIPT RIGHT PARENTHESIS
+<Multi_key> <underbar> <parenright> : "₎" U208E # SUBSCRIPT RIGHT PARENTHESIS
+<dead_circumflex> <Multi_key> <S> <M> : "℠" U2120 # SERVICE MARK
+<Multi_key> <S> <M> : "℠" U2120 # SERVICE MARK
+<dead_circumflex> <Multi_key> <s> <M> : "℠" U2120 # SERVICE MARK
+<Multi_key> <s> <M> : "℠" U2120 # SERVICE MARK
+<dead_circumflex> <Multi_key> <S> <m> : "℠" U2120 # SERVICE MARK
+<Multi_key> <S> <m> : "℠" U2120 # SERVICE MARK
+<dead_circumflex> <Multi_key> <s> <m> : "℠" U2120 # SERVICE MARK
+<Multi_key> <s> <m> : "℠" U2120 # SERVICE MARK
+<dead_circumflex> <Multi_key> <T> <M> : "™" U2122 # TRADE MARK SIGN
+<Multi_key> <T> <M> : "™" U2122 # TRADE MARK SIGN
+<dead_circumflex> <Multi_key> <t> <M> : "™" U2122 # TRADE MARK SIGN
+<Multi_key> <t> <M> : "™" U2122 # TRADE MARK SIGN
+<dead_circumflex> <Multi_key> <T> <m> : "™" U2122 # TRADE MARK SIGN
+<Multi_key> <T> <m> : "™" U2122 # TRADE MARK SIGN
+<dead_circumflex> <Multi_key> <t> <m> : "™" U2122 # TRADE MARK SIGN
+<Multi_key> <t> <m> : "™" U2122 # TRADE MARK SIGN
+<Multi_key> <1> <7> : "⅐" U2150 # VULGAR FRACTION ONE SEVENTH
+<Multi_key> <1> <9> : "⅑" U2151 # VULGAR FRACTION ONE NINTH
+<Multi_key> <1> <1> <0> : "⅒" U2152 # VULGAR FRACTION ONE TENTH
+<Multi_key> <1> <3> : "⅓" U2153 # VULGAR FRACTION ONE THIRD
+<Multi_key> <2> <3> : "⅔" U2154 # VULGAR FRACTION TWO THIRDS
+<Multi_key> <1> <5> : "⅕" U2155 # VULGAR FRACTION ONE FIFTH
+<Multi_key> <2> <5> : "⅖" U2156 # VULGAR FRACTION TWO FIFTHS
+<Multi_key> <3> <5> : "⅗" U2157 # VULGAR FRACTION THREE FIFTHS
+<Multi_key> <4> <5> : "⅘" U2158 # VULGAR FRACTION FOUR FIFTHS
+<Multi_key> <1> <6> : "⅙" U2159 # VULGAR FRACTION ONE SIXTH
+<Multi_key> <5> <6> : "⅚" U215A # VULGAR FRACTION FIVE SIXTHS
+<Multi_key> <1> <8> : "⅛" U215B # VULGAR FRACTION ONE EIGHTH
+<Multi_key> <3> <8> : "⅜" U215C # VULGAR FRACTION THREE EIGHTHS
+<Multi_key> <5> <8> : "⅝" U215D # VULGAR FRACTION FIVE EIGHTHS
+<Multi_key> <7> <8> : "⅞" U215E # VULGAR FRACTION SEVEN EIGHTHS
+<Multi_key> <0> <3> : "↉" U2189 # VULGAR FRACTION ZERO THIRDS
+<Multi_key> <slash> <leftarrow> : "↚" U219A # LEFTWARDS ARROW WITH STROKE
+<Multi_key> <KP_Divide> <leftarrow> : "↚" U219A # LEFTWARDS ARROW WITH STROKE
+<Multi_key> <slash> <rightarrow> : "↛" U219B # RIGHTWARDS ARROW WITH STROKE
+<Multi_key> <KP_Divide> <rightarrow> : "↛" U219B # RIGHTWARDS ARROW WITH STROKE
+<Multi_key> <slash> <U2194> : "↮" U21AE # LEFT RIGHT ARROW WITH STROKE
+<Multi_key> <KP_Divide> <U2194> : "↮" U21AE # LEFT RIGHT ARROW WITH STROKE
+<Multi_key> <less> <minus> : "←" U2190 # LEFTWARDS ARROW
+<Multi_key> <minus> <greater> : "→" U2192 # RIGHTWARDS ARROW
+<Multi_key> <U2203> <U0338> : "∄" U2204 # THERE DOES NOT EXIST
+<Multi_key> <U2208> <U0338> : "∉" U2209 # NOT AN ELEMENT OF
+<Multi_key> <U220B> <U0338> : "∌" U220C # DOES NOT CONTAIN AS MEMBER
+<Multi_key> <U2223> <U0338> : "∤" U2224 # DOES NOT DIVIDE
+<Multi_key> <U2225> <U0338> : "∦" U2226 # NOT PARALLEL TO
+<Multi_key> <U223C> <U0338> : "≁" U2241 # NOT TILDE
+<Multi_key> <U2243> <U0338> : "≄" U2244 # NOT ASYMPTOTICALLY EQUAL TO
+<Multi_key> <approximate> <U0338> : "≇" U2247 # NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO
+<Multi_key> <U2248> <U0338> : "≉" U2249 # NOT ALMOST EQUAL TO
+<Multi_key> <slash> <equal> : "≠" U2260 # NOT EQUAL TO
+<Multi_key> <equal> <slash> : "≠" U2260 # NOT EQUAL TO
+<Multi_key> <equal> <U0338> : "≠" U2260 # NOT EQUAL TO
+<Multi_key> <KP_Equal> <U0338> : "≠" U2260 # NOT EQUAL TO
+<Multi_key> <identical> <U0338> : "≢" U2262 # NOT IDENTICAL TO
+<Multi_key> <less> <equal> : "≤" U2264 # LESS-THAN OR EQUAL TO
+<Multi_key> <greater> <equal> : "≥" U2265 # GREATER-THAN OR EQUAL TO
+<Multi_key> <U224D> <U0338> : "≭" U226D # NOT EQUIVALENT TO
+<Multi_key> <less> <U0338> : "≮" U226E # NOT LESS-THAN
+<Multi_key> <leftcaret> <U0338> : "≮" U226E # NOT LESS-THAN
+<Multi_key> <greater> <U0338> : "≯" U226F # NOT GREATER-THAN
+<Multi_key> <rightcaret> <U0338> : "≯" U226F # NOT GREATER-THAN
+<Multi_key> <lessthanequal> <U0338> : "≰" U2270 # NEITHER LESS-THAN NOR EQUAL TO
+<Multi_key> <greaterthanequal> <U0338> : "≱" U2271 # NEITHER GREATER-THAN NOR EQUAL TO
+<Multi_key> <U2272> <U0338> : "≴" U2274 # NEITHER LESS-THAN NOR EQUIVALENT TO
+<Multi_key> <U2273> <U0338> : "≵" U2275 # NEITHER GREATER-THAN NOR EQUIVALENT TO
+<Multi_key> <U2276> <U0338> : "≸" U2278 # NEITHER LESS-THAN NOR GREATER-THAN
+<Multi_key> <U2277> <U0338> : "≹" U2279 # NEITHER GREATER-THAN NOR LESS-THAN
+<Multi_key> <U227A> <U0338> : "⊀" U2280 # DOES NOT PRECEDE
+<Multi_key> <U227B> <U0338> : "⊁" U2281 # DOES NOT SUCCEED
+<Multi_key> <includedin> <U0338> : "⊄" U2284 # NOT A SUBSET OF
+<Multi_key> <leftshoe> <U0338> : "⊄" U2284 # NOT A SUBSET OF
+<Multi_key> <includes> <U0338> : "⊅" U2285 # NOT A SUPERSET OF
+<Multi_key> <rightshoe> <U0338> : "⊅" U2285 # NOT A SUPERSET OF
+<Multi_key> <U2286> <U0338> : "⊈" U2288 # NEITHER A SUBSET OF NOR EQUAL TO
+<Multi_key> <U2287> <U0338> : "⊉" U2289 # NEITHER A SUPERSET OF NOR EQUAL TO
+<Multi_key> <righttack> <U0338> : "⊬" U22AC # DOES NOT PROVE
+<Multi_key> <U22A8> <U0338> : "⊭" U22AD # NOT TRUE
+<Multi_key> <U22A9> <U0338> : "⊮" U22AE # DOES NOT FORCE
+<Multi_key> <U22AB> <U0338> : "⊯" U22AF # NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
+<Multi_key> <U227C> <U0338> : "⋠" U22E0 # DOES NOT PRECEDE OR EQUAL
+<Multi_key> <U227D> <U0338> : "⋡" U22E1 # DOES NOT SUCCEED OR EQUAL
+<Multi_key> <U2291> <U0338> : "⋢" U22E2 # NOT SQUARE IMAGE OF OR EQUAL TO
+<Multi_key> <U2292> <U0338> : "⋣" U22E3 # NOT SQUARE ORIGINAL OF OR EQUAL TO
+<Multi_key> <U22B2> <U0338> : "⋪" U22EA # NOT NORMAL SUBGROUP OF
+<Multi_key> <U22B3> <U0338> : "⋫" U22EB # DOES NOT CONTAIN AS NORMAL SUBGROUP
+<Multi_key> <U22B4> <U0338> : "⋬" U22EC # NOT NORMAL SUBGROUP OF OR EQUAL TO
+<Multi_key> <U22B5> <U0338> : "⋭" U22ED # DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL
+<Multi_key> <parenleft> <1> <parenright> : "①" U2460 # CIRCLED DIGIT ONE
+<Multi_key> <parenleft> <KP_1> <parenright> : "①" U2460 # CIRCLED DIGIT ONE
+<Multi_key> <parenleft> <2> <parenright> : "②" U2461 # CIRCLED DIGIT TWO
+<Multi_key> <parenleft> <KP_Space> <parenright> : "②" U2461 # CIRCLED DIGIT TWO
+<Multi_key> <parenleft> <KP_2> <parenright> : "②" U2461 # CIRCLED DIGIT TWO
+<Multi_key> <parenleft> <3> <parenright> : "③" U2462 # CIRCLED DIGIT THREE
+<Multi_key> <parenleft> <KP_3> <parenright> : "③" U2462 # CIRCLED DIGIT THREE
+<Multi_key> <parenleft> <4> <parenright> : "④" U2463 # CIRCLED DIGIT FOUR
+<Multi_key> <parenleft> <KP_4> <parenright> : "④" U2463 # CIRCLED DIGIT FOUR
+<Multi_key> <parenleft> <5> <parenright> : "⑤" U2464 # CIRCLED DIGIT FIVE
+<Multi_key> <parenleft> <KP_5> <parenright> : "⑤" U2464 # CIRCLED DIGIT FIVE
+<Multi_key> <parenleft> <6> <parenright> : "⑥" U2465 # CIRCLED DIGIT SIX
+<Multi_key> <parenleft> <KP_6> <parenright> : "⑥" U2465 # CIRCLED DIGIT SIX
+<Multi_key> <parenleft> <7> <parenright> : "⑦" U2466 # CIRCLED DIGIT SEVEN
+<Multi_key> <parenleft> <KP_7> <parenright> : "⑦" U2466 # CIRCLED DIGIT SEVEN
+<Multi_key> <parenleft> <8> <parenright> : "⑧" U2467 # CIRCLED DIGIT EIGHT
+<Multi_key> <parenleft> <KP_8> <parenright> : "⑧" U2467 # CIRCLED DIGIT EIGHT
+<Multi_key> <parenleft> <9> <parenright> : "⑨" U2468 # CIRCLED DIGIT NINE
+<Multi_key> <parenleft> <KP_9> <parenright> : "⑨" U2468 # CIRCLED DIGIT NINE
+<Multi_key> <parenleft> <1> <0> <parenright> : "⑩" U2469 # CIRCLED NUMBER TEN
+<Multi_key> <parenleft> <1> <KP_0> <parenright> : "⑩" U2469 # CIRCLED NUMBER TEN
+<Multi_key> <parenleft> <KP_1> <0> <parenright> : "⑩" U2469 # CIRCLED NUMBER TEN
+<Multi_key> <parenleft> <KP_1> <KP_0> <parenright> : "⑩" U2469 # CIRCLED NUMBER TEN
+<Multi_key> <parenleft> <1> <1> <parenright> : "⑪" U246A # CIRCLED NUMBER ELEVEN
+<Multi_key> <parenleft> <1> <KP_1> <parenright> : "⑪" U246A # CIRCLED NUMBER ELEVEN
+<Multi_key> <parenleft> <KP_1> <1> <parenright> : "⑪" U246A # CIRCLED NUMBER ELEVEN
+<Multi_key> <parenleft> <KP_1> <KP_1> <parenright> : "⑪" U246A # CIRCLED NUMBER ELEVEN
+<Multi_key> <parenleft> <1> <2> <parenright> : "⑫" U246B # CIRCLED NUMBER TWELVE
+<Multi_key> <parenleft> <1> <KP_Space> <parenright> : "⑫" U246B # CIRCLED NUMBER TWELVE
+<Multi_key> <parenleft> <1> <KP_2> <parenright> : "⑫" U246B # CIRCLED NUMBER TWELVE
+<Multi_key> <parenleft> <KP_1> <2> <parenright> : "⑫" U246B # CIRCLED NUMBER TWELVE
+<Multi_key> <parenleft> <KP_1> <KP_Space> <parenright> : "⑫" U246B # CIRCLED NUMBER TWELVE
+<Multi_key> <parenleft> <KP_1> <KP_2> <parenright> : "⑫" U246B # CIRCLED NUMBER TWELVE
+<Multi_key> <parenleft> <1> <3> <parenright> : "⑬" U246C # CIRCLED NUMBER THIRTEEN
+<Multi_key> <parenleft> <1> <KP_3> <parenright> : "⑬" U246C # CIRCLED NUMBER THIRTEEN
+<Multi_key> <parenleft> <KP_1> <3> <parenright> : "⑬" U246C # CIRCLED NUMBER THIRTEEN
+<Multi_key> <parenleft> <KP_1> <KP_3> <parenright> : "⑬" U246C # CIRCLED NUMBER THIRTEEN
+<Multi_key> <parenleft> <1> <4> <parenright> : "⑭" U246D # CIRCLED NUMBER FOURTEEN
+<Multi_key> <parenleft> <1> <KP_4> <parenright> : "⑭" U246D # CIRCLED NUMBER FOURTEEN
+<Multi_key> <parenleft> <KP_1> <4> <parenright> : "⑭" U246D # CIRCLED NUMBER FOURTEEN
+<Multi_key> <parenleft> <KP_1> <KP_4> <parenright> : "⑭" U246D # CIRCLED NUMBER FOURTEEN
+<Multi_key> <parenleft> <1> <5> <parenright> : "⑮" U246E # CIRCLED NUMBER FIFTEEN
+<Multi_key> <parenleft> <1> <KP_5> <parenright> : "⑮" U246E # CIRCLED NUMBER FIFTEEN
+<Multi_key> <parenleft> <KP_1> <5> <parenright> : "⑮" U246E # CIRCLED NUMBER FIFTEEN
+<Multi_key> <parenleft> <KP_1> <KP_5> <parenright> : "⑮" U246E # CIRCLED NUMBER FIFTEEN
+<Multi_key> <parenleft> <1> <6> <parenright> : "⑯" U246F # CIRCLED NUMBER SIXTEEN
+<Multi_key> <parenleft> <1> <KP_6> <parenright> : "⑯" U246F # CIRCLED NUMBER SIXTEEN
+<Multi_key> <parenleft> <KP_1> <6> <parenright> : "⑯" U246F # CIRCLED NUMBER SIXTEEN
+<Multi_key> <parenleft> <KP_1> <KP_6> <parenright> : "⑯" U246F # CIRCLED NUMBER SIXTEEN
+<Multi_key> <parenleft> <1> <7> <parenright> : "⑰" U2470 # CIRCLED NUMBER SEVENTEEN
+<Multi_key> <parenleft> <1> <KP_7> <parenright> : "⑰" U2470 # CIRCLED NUMBER SEVENTEEN
+<Multi_key> <parenleft> <KP_1> <7> <parenright> : "⑰" U2470 # CIRCLED NUMBER SEVENTEEN
+<Multi_key> <parenleft> <KP_1> <KP_7> <parenright> : "⑰" U2470 # CIRCLED NUMBER SEVENTEEN
+<Multi_key> <parenleft> <1> <8> <parenright> : "⑱" U2471 # CIRCLED NUMBER EIGHTEEN
+<Multi_key> <parenleft> <1> <KP_8> <parenright> : "⑱" U2471 # CIRCLED NUMBER EIGHTEEN
+<Multi_key> <parenleft> <KP_1> <8> <parenright> : "⑱" U2471 # CIRCLED NUMBER EIGHTEEN
+<Multi_key> <parenleft> <KP_1> <KP_8> <parenright> : "⑱" U2471 # CIRCLED NUMBER EIGHTEEN
+<Multi_key> <parenleft> <1> <9> <parenright> : "⑲" U2472 # CIRCLED NUMBER NINETEEN
+<Multi_key> <parenleft> <1> <KP_9> <parenright> : "⑲" U2472 # CIRCLED NUMBER NINETEEN
+<Multi_key> <parenleft> <KP_1> <9> <parenright> : "⑲" U2472 # CIRCLED NUMBER NINETEEN
+<Multi_key> <parenleft> <KP_1> <KP_9> <parenright> : "⑲" U2472 # CIRCLED NUMBER NINETEEN
+<Multi_key> <parenleft> <2> <0> <parenright> : "⑳" U2473 # CIRCLED NUMBER TWENTY
+<Multi_key> <parenleft> <2> <KP_0> <parenright> : "⑳" U2473 # CIRCLED NUMBER TWENTY
+<Multi_key> <parenleft> <KP_Space> <0> <parenright> : "⑳" U2473 # CIRCLED NUMBER TWENTY
+<Multi_key> <parenleft> <KP_Space> <KP_0> <parenright> : "⑳" U2473 # CIRCLED NUMBER TWENTY
+<Multi_key> <parenleft> <KP_2> <0> <parenright> : "⑳" U2473 # CIRCLED NUMBER TWENTY
+<Multi_key> <parenleft> <KP_2> <KP_0> <parenright> : "⑳" U2473 # CIRCLED NUMBER TWENTY
+<Multi_key> <parenleft> <A> <parenright> : "Ⓐ" U24B6 # CIRCLED LATIN CAPITAL LETTER A
+<Multi_key> <parenleft> <B> <parenright> : "Ⓑ" U24B7 # CIRCLED LATIN CAPITAL LETTER B
+<Multi_key> <parenleft> <C> <parenright> : "Ⓒ" U24B8 # CIRCLED LATIN CAPITAL LETTER C
+<Multi_key> <parenleft> <D> <parenright> : "Ⓓ" U24B9 # CIRCLED LATIN CAPITAL LETTER D
+<Multi_key> <parenleft> <E> <parenright> : "Ⓔ" U24BA # CIRCLED LATIN CAPITAL LETTER E
+<Multi_key> <parenleft> <F> <parenright> : "Ⓕ" U24BB # CIRCLED LATIN CAPITAL LETTER F
+<Multi_key> <parenleft> <G> <parenright> : "Ⓖ" U24BC # CIRCLED LATIN CAPITAL LETTER G
+<Multi_key> <parenleft> <H> <parenright> : "Ⓗ" U24BD # CIRCLED LATIN CAPITAL LETTER H
+<Multi_key> <parenleft> <I> <parenright> : "Ⓘ" U24BE # CIRCLED LATIN CAPITAL LETTER I
+<Multi_key> <parenleft> <J> <parenright> : "Ⓙ" U24BF # CIRCLED LATIN CAPITAL LETTER J
+<Multi_key> <parenleft> <K> <parenright> : "Ⓚ" U24C0 # CIRCLED LATIN CAPITAL LETTER K
+<Multi_key> <parenleft> <L> <parenright> : "Ⓛ" U24C1 # CIRCLED LATIN CAPITAL LETTER L
+<Multi_key> <parenleft> <M> <parenright> : "Ⓜ" U24C2 # CIRCLED LATIN CAPITAL LETTER M
+<Multi_key> <parenleft> <N> <parenright> : "Ⓝ" U24C3 # CIRCLED LATIN CAPITAL LETTER N
+<Multi_key> <parenleft> <O> <parenright> : "Ⓞ" U24C4 # CIRCLED LATIN CAPITAL LETTER O
+<Multi_key> <parenleft> <P> <parenright> : "Ⓟ" U24C5 # CIRCLED LATIN CAPITAL LETTER P
+<Multi_key> <parenleft> <Q> <parenright> : "Ⓠ" U24C6 # CIRCLED LATIN CAPITAL LETTER Q
+<Multi_key> <parenleft> <R> <parenright> : "Ⓡ" U24C7 # CIRCLED LATIN CAPITAL LETTER R
+<Multi_key> <parenleft> <S> <parenright> : "Ⓢ" U24C8 # CIRCLED LATIN CAPITAL LETTER S
+<Multi_key> <parenleft> <T> <parenright> : "Ⓣ" U24C9 # CIRCLED LATIN CAPITAL LETTER T
+<Multi_key> <parenleft> <U> <parenright> : "Ⓤ" U24CA # CIRCLED LATIN CAPITAL LETTER U
+<Multi_key> <parenleft> <V> <parenright> : "Ⓥ" U24CB # CIRCLED LATIN CAPITAL LETTER V
+<Multi_key> <parenleft> <W> <parenright> : "Ⓦ" U24CC # CIRCLED LATIN CAPITAL LETTER W
+<Multi_key> <parenleft> <X> <parenright> : "Ⓧ" U24CD # CIRCLED LATIN CAPITAL LETTER X
+<Multi_key> <parenleft> <Y> <parenright> : "Ⓨ" U24CE # CIRCLED LATIN CAPITAL LETTER Y
+<Multi_key> <parenleft> <Z> <parenright> : "Ⓩ" U24CF # CIRCLED LATIN CAPITAL LETTER Z
+<Multi_key> <parenleft> <a> <parenright> : "ⓐ" U24D0 # CIRCLED LATIN SMALL LETTER A
+<Multi_key> <parenleft> <b> <parenright> : "ⓑ" U24D1 # CIRCLED LATIN SMALL LETTER B
+<Multi_key> <parenleft> <c> <parenright> : "ⓒ" U24D2 # CIRCLED LATIN SMALL LETTER C
+<Multi_key> <parenleft> <d> <parenright> : "ⓓ" U24D3 # CIRCLED LATIN SMALL LETTER D
+<Multi_key> <parenleft> <e> <parenright> : "ⓔ" U24D4 # CIRCLED LATIN SMALL LETTER E
+<Multi_key> <parenleft> <f> <parenright> : "ⓕ" U24D5 # CIRCLED LATIN SMALL LETTER F
+<Multi_key> <parenleft> <g> <parenright> : "ⓖ" U24D6 # CIRCLED LATIN SMALL LETTER G
+<Multi_key> <parenleft> <h> <parenright> : "ⓗ" U24D7 # CIRCLED LATIN SMALL LETTER H
+<Multi_key> <parenleft> <i> <parenright> : "ⓘ" U24D8 # CIRCLED LATIN SMALL LETTER I
+<Multi_key> <parenleft> <j> <parenright> : "ⓙ" U24D9 # CIRCLED LATIN SMALL LETTER J
+<Multi_key> <parenleft> <k> <parenright> : "ⓚ" U24DA # CIRCLED LATIN SMALL LETTER K
+<Multi_key> <parenleft> <l> <parenright> : "ⓛ" U24DB # CIRCLED LATIN SMALL LETTER L
+<Multi_key> <parenleft> <m> <parenright> : "ⓜ" U24DC # CIRCLED LATIN SMALL LETTER M
+<Multi_key> <parenleft> <n> <parenright> : "ⓝ" U24DD # CIRCLED LATIN SMALL LETTER N
+<Multi_key> <parenleft> <o> <parenright> : "ⓞ" U24DE # CIRCLED LATIN SMALL LETTER O
+<Multi_key> <parenleft> <p> <parenright> : "ⓟ" U24DF # CIRCLED LATIN SMALL LETTER P
+<Multi_key> <parenleft> <q> <parenright> : "ⓠ" U24E0 # CIRCLED LATIN SMALL LETTER Q
+<Multi_key> <parenleft> <r> <parenright> : "ⓡ" U24E1 # CIRCLED LATIN SMALL LETTER R
+<Multi_key> <parenleft> <s> <parenright> : "ⓢ" U24E2 # CIRCLED LATIN SMALL LETTER S
+<Multi_key> <parenleft> <t> <parenright> : "ⓣ" U24E3 # CIRCLED LATIN SMALL LETTER T
+<Multi_key> <parenleft> <u> <parenright> : "ⓤ" U24E4 # CIRCLED LATIN SMALL LETTER U
+<Multi_key> <parenleft> <v> <parenright> : "ⓥ" U24E5 # CIRCLED LATIN SMALL LETTER V
+<Multi_key> <parenleft> <w> <parenright> : "ⓦ" U24E6 # CIRCLED LATIN SMALL LETTER W
+<Multi_key> <parenleft> <x> <parenright> : "ⓧ" U24E7 # CIRCLED LATIN SMALL LETTER X
+<Multi_key> <parenleft> <y> <parenright> : "ⓨ" U24E8 # CIRCLED LATIN SMALL LETTER Y
+<Multi_key> <parenleft> <z> <parenright> : "ⓩ" U24E9 # CIRCLED LATIN SMALL LETTER Z
+<Multi_key> <parenleft> <0> <parenright> : "⓪" U24EA # CIRCLED DIGIT ZERO
+<Multi_key> <parenleft> <KP_0> <parenright> : "⓪" U24EA # CIRCLED DIGIT ZERO
+<dead_belowdot> <plus> : "⨥" U2A25 # PLUS SIGN WITH DOT BELOW
+<dead_belowtilde> <plus> : "⨦" U2A26 # PLUS SIGN WITH TILDE BELOW
+<dead_belowdot> <minus> : "⨪" U2A2A # MINUS SIGN WITH DOT BELOW
+<dead_belowdot> <equal> : "⩦" U2A66 # EQUALS SIGN WITH DOT BELOW
+<dead_diaeresis> <dead_belowdiaeresis> <equal> : "⩷" U2A77 # EQUALS SIGN WITH TWO DOTS ABOVE AND TWO DOTS BELOW
+<dead_belowdiaeresis> <dead_diaeresis> <equal> : "⩷" U2A77 # EQUALS SIGN WITH TWO DOTS ABOVE AND TWO DOTS BELOW
+<Multi_key> <U2ADD> <U0338> : "⫝̸" U2ADC # FORKING
+<dead_belowring> <bar> : "⫰" U2AF0 # VERTICAL LINE WITH CIRCLE BELOW
+<dead_voiced_sound> <U304B> : "が" U304C # HIRAGANA LETTER GA
+<dead_voiced_sound> <U304D> : "ぎ" U304E # HIRAGANA LETTER GI
+<dead_voiced_sound> <U304F> : "ぐ" U3050 # HIRAGANA LETTER GU
+<dead_voiced_sound> <U3051> : "げ" U3052 # HIRAGANA LETTER GE
+<dead_voiced_sound> <U3053> : "ご" U3054 # HIRAGANA LETTER GO
+<dead_voiced_sound> <U3055> : "ざ" U3056 # HIRAGANA LETTER ZA
+<dead_voiced_sound> <U3057> : "じ" U3058 # HIRAGANA LETTER ZI
+<dead_voiced_sound> <U3059> : "ず" U305A # HIRAGANA LETTER ZU
+<dead_voiced_sound> <U305B> : "ぜ" U305C # HIRAGANA LETTER ZE
+<dead_voiced_sound> <U305D> : "ぞ" U305E # HIRAGANA LETTER ZO
+<dead_voiced_sound> <U305F> : "だ" U3060 # HIRAGANA LETTER DA
+<dead_voiced_sound> <U3061> : "ぢ" U3062 # HIRAGANA LETTER DI
+<dead_voiced_sound> <U3064> : "づ" U3065 # HIRAGANA LETTER DU
+<dead_voiced_sound> <U3066> : "で" U3067 # HIRAGANA LETTER DE
+<dead_voiced_sound> <U3068> : "ど" U3069 # HIRAGANA LETTER DO
+<dead_voiced_sound> <U306F> : "ば" U3070 # HIRAGANA LETTER BA
+<dead_semivoiced_sound> <U306F> : "ぱ" U3071 # HIRAGANA LETTER PA
+<dead_voiced_sound> <U3072> : "び" U3073 # HIRAGANA LETTER BI
+<dead_semivoiced_sound> <U3072> : "ぴ" U3074 # HIRAGANA LETTER PI
+<dead_voiced_sound> <U3075> : "ぶ" U3076 # HIRAGANA LETTER BU
+<dead_semivoiced_sound> <U3075> : "ぷ" U3077 # HIRAGANA LETTER PU
+<dead_voiced_sound> <U3078> : "べ" U3079 # HIRAGANA LETTER BE
+<dead_semivoiced_sound> <U3078> : "ぺ" U307A # HIRAGANA LETTER PE
+<dead_voiced_sound> <U307B> : "ぼ" U307C # HIRAGANA LETTER BO
+<dead_semivoiced_sound> <U307B> : "ぽ" U307D # HIRAGANA LETTER PO
+<dead_voiced_sound> <U3046> : "ゔ" U3094 # HIRAGANA LETTER VU
+<dead_voiced_sound> <U309D> : "ゞ" U309E # HIRAGANA VOICED ITERATION MARK
+<dead_voiced_sound> <kana_KA> : "ガ" U30AC # KATAKANA LETTER GA
+<dead_voiced_sound> <kana_KI> : "ギ" U30AE # KATAKANA LETTER GI
+<dead_voiced_sound> <kana_KU> : "グ" U30B0 # KATAKANA LETTER GU
+<dead_voiced_sound> <kana_KE> : "ゲ" U30B2 # KATAKANA LETTER GE
+<dead_voiced_sound> <kana_KO> : "ゴ" U30B4 # KATAKANA LETTER GO
+<dead_voiced_sound> <kana_SA> : "ザ" U30B6 # KATAKANA LETTER ZA
+<dead_voiced_sound> <kana_SHI> : "ジ" U30B8 # KATAKANA LETTER ZI
+<dead_voiced_sound> <kana_SU> : "ズ" U30BA # KATAKANA LETTER ZU
+<dead_voiced_sound> <kana_SE> : "ゼ" U30BC # KATAKANA LETTER ZE
+<dead_voiced_sound> <kana_SO> : "ゾ" U30BE # KATAKANA LETTER ZO
+<dead_voiced_sound> <kana_TA> : "ダ" U30C0 # KATAKANA LETTER DA
+<dead_voiced_sound> <kana_CHI> : "ヂ" U30C2 # KATAKANA LETTER DI
+<dead_voiced_sound> <kana_TSU> : "ヅ" U30C5 # KATAKANA LETTER DU
+<dead_voiced_sound> <kana_TE> : "デ" U30C7 # KATAKANA LETTER DE
+<dead_voiced_sound> <kana_TO> : "ド" U30C9 # KATAKANA LETTER DO
+<dead_voiced_sound> <kana_HA> : "バ" U30D0 # KATAKANA LETTER BA
+<dead_semivoiced_sound> <kana_HA> : "パ" U30D1 # KATAKANA LETTER PA
+<dead_voiced_sound> <kana_HI> : "ビ" U30D3 # KATAKANA LETTER BI
+<dead_semivoiced_sound> <kana_HI> : "ピ" U30D4 # KATAKANA LETTER PI
+<dead_voiced_sound> <kana_FU> : "ブ" U30D6 # KATAKANA LETTER BU
+<dead_semivoiced_sound> <kana_FU> : "プ" U30D7 # KATAKANA LETTER PU
+<dead_voiced_sound> <kana_HE> : "ベ" U30D9 # KATAKANA LETTER BE
+<dead_semivoiced_sound> <kana_HE> : "ペ" U30DA # KATAKANA LETTER PE
+<dead_voiced_sound> <kana_HO> : "ボ" U30DC # KATAKANA LETTER BO
+<dead_semivoiced_sound> <kana_HO> : "ポ" U30DD # KATAKANA LETTER PO
+<dead_voiced_sound> <kana_U> : "ヴ" U30F4 # KATAKANA LETTER VU
+<dead_voiced_sound> <kana_WA> : "ヷ" U30F7 # KATAKANA LETTER VA
+<dead_voiced_sound> <U30F0> : "ヸ" U30F8 # KATAKANA LETTER VI
+<dead_voiced_sound> <U30F1> : "ヹ" U30F9 # KATAKANA LETTER VE
+<dead_voiced_sound> <kana_WO> : "ヺ" U30FA # KATAKANA LETTER VO
+<dead_voiced_sound> <U30FD> : "ヾ" U30FE # KATAKANA VOICED ITERATION MARK
+<dead_circumflex> <U4E00> : "㆒" U3192 # IDEOGRAPHIC ANNOTATION ONE MARK
+<Multi_key> <asciicircum> <U4E00> : "㆒" U3192 # IDEOGRAPHIC ANNOTATION ONE MARK
+<dead_circumflex> <U4E8C> : "㆓" U3193 # IDEOGRAPHIC ANNOTATION TWO MARK
+<Multi_key> <asciicircum> <U4E8C> : "㆓" U3193 # IDEOGRAPHIC ANNOTATION TWO MARK
+<dead_circumflex> <U4E09> : "㆔" U3194 # IDEOGRAPHIC ANNOTATION THREE MARK
+<Multi_key> <asciicircum> <U4E09> : "㆔" U3194 # IDEOGRAPHIC ANNOTATION THREE MARK
+<dead_circumflex> <U56DB> : "㆕" U3195 # IDEOGRAPHIC ANNOTATION FOUR MARK
+<Multi_key> <asciicircum> <U56DB> : "㆕" U3195 # IDEOGRAPHIC ANNOTATION FOUR MARK
+<dead_circumflex> <U4E0A> : "㆖" U3196 # IDEOGRAPHIC ANNOTATION TOP MARK
+<Multi_key> <asciicircum> <U4E0A> : "㆖" U3196 # IDEOGRAPHIC ANNOTATION TOP MARK
+<dead_circumflex> <U4E2D> : "㆗" U3197 # IDEOGRAPHIC ANNOTATION MIDDLE MARK
+<Multi_key> <asciicircum> <U4E2D> : "㆗" U3197 # IDEOGRAPHIC ANNOTATION MIDDLE MARK
+<dead_circumflex> <U4E0B> : "㆘" U3198 # IDEOGRAPHIC ANNOTATION BOTTOM MARK
+<Multi_key> <asciicircum> <U4E0B> : "㆘" U3198 # IDEOGRAPHIC ANNOTATION BOTTOM MARK
+<dead_circumflex> <U7532> : "㆙" U3199 # IDEOGRAPHIC ANNOTATION FIRST MARK
+<Multi_key> <asciicircum> <U7532> : "㆙" U3199 # IDEOGRAPHIC ANNOTATION FIRST MARK
+<dead_circumflex> <U4E59> : "㆚" U319A # IDEOGRAPHIC ANNOTATION SECOND MARK
+<Multi_key> <asciicircum> <U4E59> : "㆚" U319A # IDEOGRAPHIC ANNOTATION SECOND MARK
+<dead_circumflex> <U4E19> : "㆛" U319B # IDEOGRAPHIC ANNOTATION THIRD MARK
+<Multi_key> <asciicircum> <U4E19> : "㆛" U319B # IDEOGRAPHIC ANNOTATION THIRD MARK
+<dead_circumflex> <U4E01> : "㆜" U319C # IDEOGRAPHIC ANNOTATION FOURTH MARK
+<Multi_key> <asciicircum> <U4E01> : "㆜" U319C # IDEOGRAPHIC ANNOTATION FOURTH MARK
+<dead_circumflex> <U5929> : "㆝" U319D # IDEOGRAPHIC ANNOTATION HEAVEN MARK
+<Multi_key> <asciicircum> <U5929> : "㆝" U319D # IDEOGRAPHIC ANNOTATION HEAVEN MARK
+<dead_circumflex> <U5730> : "㆞" U319E # IDEOGRAPHIC ANNOTATION EARTH MARK
+<Multi_key> <asciicircum> <U5730> : "㆞" U319E # IDEOGRAPHIC ANNOTATION EARTH MARK
+<dead_circumflex> <U4EBA> : "㆟" U319F # IDEOGRAPHIC ANNOTATION MAN MARK
+<Multi_key> <asciicircum> <U4EBA> : "㆟" U319F # IDEOGRAPHIC ANNOTATION MAN MARK
+<Multi_key> <parenleft> <2> <1> <parenright> : "㉑" U3251 # CIRCLED NUMBER TWENTY ONE
+<Multi_key> <parenleft> <2> <KP_1> <parenright> : "㉑" U3251 # CIRCLED NUMBER TWENTY ONE
+<Multi_key> <parenleft> <KP_Space> <1> <parenright> : "㉑" U3251 # CIRCLED NUMBER TWENTY ONE
+<Multi_key> <parenleft> <KP_Space> <KP_1> <parenright> : "㉑" U3251 # CIRCLED NUMBER TWENTY ONE
+<Multi_key> <parenleft> <KP_2> <1> <parenright> : "㉑" U3251 # CIRCLED NUMBER TWENTY ONE
+<Multi_key> <parenleft> <KP_2> <KP_1> <parenright> : "㉑" U3251 # CIRCLED NUMBER TWENTY ONE
+<Multi_key> <parenleft> <2> <2> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
+<Multi_key> <parenleft> <2> <KP_Space> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
+<Multi_key> <parenleft> <2> <KP_2> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
+<Multi_key> <parenleft> <KP_Space> <2> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
+<Multi_key> <parenleft> <KP_Space> <KP_Space> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
+<Multi_key> <parenleft> <KP_Space> <KP_2> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
+<Multi_key> <parenleft> <KP_2> <2> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
+<Multi_key> <parenleft> <KP_2> <KP_Space> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
+<Multi_key> <parenleft> <KP_2> <KP_2> <parenright> : "㉒" U3252 # CIRCLED NUMBER TWENTY TWO
+<Multi_key> <parenleft> <2> <3> <parenright> : "㉓" U3253 # CIRCLED NUMBER TWENTY THREE
+<Multi_key> <parenleft> <2> <KP_3> <parenright> : "㉓" U3253 # CIRCLED NUMBER TWENTY THREE
+<Multi_key> <parenleft> <KP_Space> <3> <parenright> : "㉓" U3253 # CIRCLED NUMBER TWENTY THREE
+<Multi_key> <parenleft> <KP_Space> <KP_3> <parenright> : "㉓" U3253 # CIRCLED NUMBER TWENTY THREE
+<Multi_key> <parenleft> <KP_2> <3> <parenright> : "㉓" U3253 # CIRCLED NUMBER TWENTY THREE
+<Multi_key> <parenleft> <KP_2> <KP_3> <parenright> : "㉓" U3253 # CIRCLED NUMBER TWENTY THREE
+<Multi_key> <parenleft> <2> <4> <parenright> : "㉔" U3254 # CIRCLED NUMBER TWENTY FOUR
+<Multi_key> <parenleft> <2> <KP_4> <parenright> : "㉔" U3254 # CIRCLED NUMBER TWENTY FOUR
+<Multi_key> <parenleft> <KP_Space> <4> <parenright> : "㉔" U3254 # CIRCLED NUMBER TWENTY FOUR
+<Multi_key> <parenleft> <KP_Space> <KP_4> <parenright> : "㉔" U3254 # CIRCLED NUMBER TWENTY FOUR
+<Multi_key> <parenleft> <KP_2> <4> <parenright> : "㉔" U3254 # CIRCLED NUMBER TWENTY FOUR
+<Multi_key> <parenleft> <KP_2> <KP_4> <parenright> : "㉔" U3254 # CIRCLED NUMBER TWENTY FOUR
+<Multi_key> <parenleft> <2> <5> <parenright> : "㉕" U3255 # CIRCLED NUMBER TWENTY FIVE
+<Multi_key> <parenleft> <2> <KP_5> <parenright> : "㉕" U3255 # CIRCLED NUMBER TWENTY FIVE
+<Multi_key> <parenleft> <KP_Space> <5> <parenright> : "㉕" U3255 # CIRCLED NUMBER TWENTY FIVE
+<Multi_key> <parenleft> <KP_Space> <KP_5> <parenright> : "㉕" U3255 # CIRCLED NUMBER TWENTY FIVE
+<Multi_key> <parenleft> <KP_2> <5> <parenright> : "㉕" U3255 # CIRCLED NUMBER TWENTY FIVE
+<Multi_key> <parenleft> <KP_2> <KP_5> <parenright> : "㉕" U3255 # CIRCLED NUMBER TWENTY FIVE
+<Multi_key> <parenleft> <2> <6> <parenright> : "㉖" U3256 # CIRCLED NUMBER TWENTY SIX
+<Multi_key> <parenleft> <2> <KP_6> <parenright> : "㉖" U3256 # CIRCLED NUMBER TWENTY SIX
+<Multi_key> <parenleft> <KP_Space> <6> <parenright> : "㉖" U3256 # CIRCLED NUMBER TWENTY SIX
+<Multi_key> <parenleft> <KP_Space> <KP_6> <parenright> : "㉖" U3256 # CIRCLED NUMBER TWENTY SIX
+<Multi_key> <parenleft> <KP_2> <6> <parenright> : "㉖" U3256 # CIRCLED NUMBER TWENTY SIX
+<Multi_key> <parenleft> <KP_2> <KP_6> <parenright> : "㉖" U3256 # CIRCLED NUMBER TWENTY SIX
+<Multi_key> <parenleft> <2> <7> <parenright> : "㉗" U3257 # CIRCLED NUMBER TWENTY SEVEN
+<Multi_key> <parenleft> <2> <KP_7> <parenright> : "㉗" U3257 # CIRCLED NUMBER TWENTY SEVEN
+<Multi_key> <parenleft> <KP_Space> <7> <parenright> : "㉗" U3257 # CIRCLED NUMBER TWENTY SEVEN
+<Multi_key> <parenleft> <KP_Space> <KP_7> <parenright> : "㉗" U3257 # CIRCLED NUMBER TWENTY SEVEN
+<Multi_key> <parenleft> <KP_2> <7> <parenright> : "㉗" U3257 # CIRCLED NUMBER TWENTY SEVEN
+<Multi_key> <parenleft> <KP_2> <KP_7> <parenright> : "㉗" U3257 # CIRCLED NUMBER TWENTY SEVEN
+<Multi_key> <parenleft> <2> <8> <parenright> : "㉘" U3258 # CIRCLED NUMBER TWENTY EIGHT
+<Multi_key> <parenleft> <2> <KP_8> <parenright> : "㉘" U3258 # CIRCLED NUMBER TWENTY EIGHT
+<Multi_key> <parenleft> <KP_Space> <8> <parenright> : "㉘" U3258 # CIRCLED NUMBER TWENTY EIGHT
+<Multi_key> <parenleft> <KP_Space> <KP_8> <parenright> : "㉘" U3258 # CIRCLED NUMBER TWENTY EIGHT
+<Multi_key> <parenleft> <KP_2> <8> <parenright> : "㉘" U3258 # CIRCLED NUMBER TWENTY EIGHT
+<Multi_key> <parenleft> <KP_2> <KP_8> <parenright> : "㉘" U3258 # CIRCLED NUMBER TWENTY EIGHT
+<Multi_key> <parenleft> <2> <9> <parenright> : "㉙" U3259 # CIRCLED NUMBER TWENTY NINE
+<Multi_key> <parenleft> <2> <KP_9> <parenright> : "㉙" U3259 # CIRCLED NUMBER TWENTY NINE
+<Multi_key> <parenleft> <KP_Space> <9> <parenright> : "㉙" U3259 # CIRCLED NUMBER TWENTY NINE
+<Multi_key> <parenleft> <KP_Space> <KP_9> <parenright> : "㉙" U3259 # CIRCLED NUMBER TWENTY NINE
+<Multi_key> <parenleft> <KP_2> <9> <parenright> : "㉙" U3259 # CIRCLED NUMBER TWENTY NINE
+<Multi_key> <parenleft> <KP_2> <KP_9> <parenright> : "㉙" U3259 # CIRCLED NUMBER TWENTY NINE
+<Multi_key> <parenleft> <3> <0> <parenright> : "㉚" U325A # CIRCLED NUMBER THIRTY
+<Multi_key> <parenleft> <3> <KP_0> <parenright> : "㉚" U325A # CIRCLED NUMBER THIRTY
+<Multi_key> <parenleft> <KP_3> <0> <parenright> : "㉚" U325A # CIRCLED NUMBER THIRTY
+<Multi_key> <parenleft> <KP_3> <KP_0> <parenright> : "㉚" U325A # CIRCLED NUMBER THIRTY
+<Multi_key> <parenleft> <3> <1> <parenright> : "㉛" U325B # CIRCLED NUMBER THIRTY ONE
+<Multi_key> <parenleft> <3> <KP_1> <parenright> : "㉛" U325B # CIRCLED NUMBER THIRTY ONE
+<Multi_key> <parenleft> <KP_3> <1> <parenright> : "㉛" U325B # CIRCLED NUMBER THIRTY ONE
+<Multi_key> <parenleft> <KP_3> <KP_1> <parenright> : "㉛" U325B # CIRCLED NUMBER THIRTY ONE
+<Multi_key> <parenleft> <3> <2> <parenright> : "㉜" U325C # CIRCLED NUMBER THIRTY TWO
+<Multi_key> <parenleft> <3> <KP_Space> <parenright> : "㉜" U325C # CIRCLED NUMBER THIRTY TWO
+<Multi_key> <parenleft> <3> <KP_2> <parenright> : "㉜" U325C # CIRCLED NUMBER THIRTY TWO
+<Multi_key> <parenleft> <KP_3> <2> <parenright> : "㉜" U325C # CIRCLED NUMBER THIRTY TWO
+<Multi_key> <parenleft> <KP_3> <KP_Space> <parenright> : "㉜" U325C # CIRCLED NUMBER THIRTY TWO
+<Multi_key> <parenleft> <KP_3> <KP_2> <parenright> : "㉜" U325C # CIRCLED NUMBER THIRTY TWO
+<Multi_key> <parenleft> <3> <3> <parenright> : "㉝" U325D # CIRCLED NUMBER THIRTY THREE
+<Multi_key> <parenleft> <3> <KP_3> <parenright> : "㉝" U325D # CIRCLED NUMBER THIRTY THREE
+<Multi_key> <parenleft> <KP_3> <3> <parenright> : "㉝" U325D # CIRCLED NUMBER THIRTY THREE
+<Multi_key> <parenleft> <KP_3> <KP_3> <parenright> : "㉝" U325D # CIRCLED NUMBER THIRTY THREE
+<Multi_key> <parenleft> <3> <4> <parenright> : "㉞" U325E # CIRCLED NUMBER THIRTY FOUR
+<Multi_key> <parenleft> <3> <KP_4> <parenright> : "㉞" U325E # CIRCLED NUMBER THIRTY FOUR
+<Multi_key> <parenleft> <KP_3> <4> <parenright> : "㉞" U325E # CIRCLED NUMBER THIRTY FOUR
+<Multi_key> <parenleft> <KP_3> <KP_4> <parenright> : "㉞" U325E # CIRCLED NUMBER THIRTY FOUR
+<Multi_key> <parenleft> <3> <5> <parenright> : "㉟" U325F # CIRCLED NUMBER THIRTY FIVE
+<Multi_key> <parenleft> <3> <KP_5> <parenright> : "㉟" U325F # CIRCLED NUMBER THIRTY FIVE
+<Multi_key> <parenleft> <KP_3> <5> <parenright> : "㉟" U325F # CIRCLED NUMBER THIRTY FIVE
+<Multi_key> <parenleft> <KP_3> <KP_5> <parenright> : "㉟" U325F # CIRCLED NUMBER THIRTY FIVE
+<Multi_key> <parenleft> <U1100> <parenright> : "㉠" U3260 # CIRCLED HANGUL KIYEOK
+<Multi_key> <parenleft> <U1102> <parenright> : "㉡" U3261 # CIRCLED HANGUL NIEUN
+<Multi_key> <parenleft> <U1103> <parenright> : "㉢" U3262 # CIRCLED HANGUL TIKEUT
+<Multi_key> <parenleft> <U1105> <parenright> : "㉣" U3263 # CIRCLED HANGUL RIEUL
+<Multi_key> <parenleft> <U1106> <parenright> : "㉤" U3264 # CIRCLED HANGUL MIEUM
+<Multi_key> <parenleft> <U1107> <parenright> : "㉥" U3265 # CIRCLED HANGUL PIEUP
+<Multi_key> <parenleft> <U1109> <parenright> : "㉦" U3266 # CIRCLED HANGUL SIOS
+<Multi_key> <parenleft> <U110B> <parenright> : "㉧" U3267 # CIRCLED HANGUL IEUNG
+<Multi_key> <parenleft> <U110C> <parenright> : "㉨" U3268 # CIRCLED HANGUL CIEUC
+<Multi_key> <parenleft> <U110E> <parenright> : "㉩" U3269 # CIRCLED HANGUL CHIEUCH
+<Multi_key> <parenleft> <U110F> <parenright> : "㉪" U326A # CIRCLED HANGUL KHIEUKH
+<Multi_key> <parenleft> <U1110> <parenright> : "㉫" U326B # CIRCLED HANGUL THIEUTH
+<Multi_key> <parenleft> <U1111> <parenright> : "㉬" U326C # CIRCLED HANGUL PHIEUPH
+<Multi_key> <parenleft> <U1112> <parenright> : "㉭" U326D # CIRCLED HANGUL HIEUH
+<Multi_key> <parenleft> <U1100> <U1161> <parenright> : "㉮" U326E # CIRCLED HANGUL KIYEOK A
+<Multi_key> <parenleft> <U1102> <U1161> <parenright> : "㉯" U326F # CIRCLED HANGUL NIEUN A
+<Multi_key> <parenleft> <U1103> <U1161> <parenright> : "㉰" U3270 # CIRCLED HANGUL TIKEUT A
+<Multi_key> <parenleft> <U1105> <U1161> <parenright> : "㉱" U3271 # CIRCLED HANGUL RIEUL A
+<Multi_key> <parenleft> <U1106> <U1161> <parenright> : "㉲" U3272 # CIRCLED HANGUL MIEUM A
+<Multi_key> <parenleft> <U1107> <U1161> <parenright> : "㉳" U3273 # CIRCLED HANGUL PIEUP A
+<Multi_key> <parenleft> <U1109> <U1161> <parenright> : "㉴" U3274 # CIRCLED HANGUL SIOS A
+<Multi_key> <parenleft> <U110B> <U1161> <parenright> : "㉵" U3275 # CIRCLED HANGUL IEUNG A
+<Multi_key> <parenleft> <U110C> <U1161> <parenright> : "㉶" U3276 # CIRCLED HANGUL CIEUC A
+<Multi_key> <parenleft> <U110E> <U1161> <parenright> : "㉷" U3277 # CIRCLED HANGUL CHIEUCH A
+<Multi_key> <parenleft> <U110F> <U1161> <parenright> : "㉸" U3278 # CIRCLED HANGUL KHIEUKH A
+<Multi_key> <parenleft> <U1110> <U1161> <parenright> : "㉹" U3279 # CIRCLED HANGUL THIEUTH A
+<Multi_key> <parenleft> <U1111> <U1161> <parenright> : "㉺" U327A # CIRCLED HANGUL PHIEUPH A
+<Multi_key> <parenleft> <U1112> <U1161> <parenright> : "㉻" U327B # CIRCLED HANGUL HIEUH A
+<Multi_key> <parenleft> <U4E00> <parenright> : "㊀" U3280 # CIRCLED IDEOGRAPH ONE
+<Multi_key> <parenleft> <U4E8C> <parenright> : "㊁" U3281 # CIRCLED IDEOGRAPH TWO
+<Multi_key> <parenleft> <U4E09> <parenright> : "㊂" U3282 # CIRCLED IDEOGRAPH THREE
+<Multi_key> <parenleft> <U56DB> <parenright> : "㊃" U3283 # CIRCLED IDEOGRAPH FOUR
+<Multi_key> <parenleft> <U4E94> <parenright> : "㊄" U3284 # CIRCLED IDEOGRAPH FIVE
+<Multi_key> <parenleft> <U516D> <parenright> : "㊅" U3285 # CIRCLED IDEOGRAPH SIX
+<Multi_key> <parenleft> <U4E03> <parenright> : "㊆" U3286 # CIRCLED IDEOGRAPH SEVEN
+<Multi_key> <parenleft> <U516B> <parenright> : "㊇" U3287 # CIRCLED IDEOGRAPH EIGHT
+<Multi_key> <parenleft> <U4E5D> <parenright> : "㊈" U3288 # CIRCLED IDEOGRAPH NINE
+<Multi_key> <parenleft> <U5341> <parenright> : "㊉" U3289 # CIRCLED IDEOGRAPH TEN
+<Multi_key> <parenleft> <U6708> <parenright> : "㊊" U328A # CIRCLED IDEOGRAPH MOON
+<Multi_key> <parenleft> <U706B> <parenright> : "㊋" U328B # CIRCLED IDEOGRAPH FIRE
+<Multi_key> <parenleft> <U6C34> <parenright> : "㊌" U328C # CIRCLED IDEOGRAPH WATER
+<Multi_key> <parenleft> <U6728> <parenright> : "㊍" U328D # CIRCLED IDEOGRAPH WOOD
+<Multi_key> <parenleft> <U91D1> <parenright> : "㊎" U328E # CIRCLED IDEOGRAPH METAL
+<Multi_key> <parenleft> <U571F> <parenright> : "㊏" U328F # CIRCLED IDEOGRAPH EARTH
+<Multi_key> <parenleft> <U65E5> <parenright> : "㊐" U3290 # CIRCLED IDEOGRAPH SUN
+<Multi_key> <parenleft> <U682A> <parenright> : "㊑" U3291 # CIRCLED IDEOGRAPH STOCK
+<Multi_key> <parenleft> <U6709> <parenright> : "㊒" U3292 # CIRCLED IDEOGRAPH HAVE
+<Multi_key> <parenleft> <U793E> <parenright> : "㊓" U3293 # CIRCLED IDEOGRAPH SOCIETY
+<Multi_key> <parenleft> <U540D> <parenright> : "㊔" U3294 # CIRCLED IDEOGRAPH NAME
+<Multi_key> <parenleft> <U7279> <parenright> : "㊕" U3295 # CIRCLED IDEOGRAPH SPECIAL
+<Multi_key> <parenleft> <U8CA1> <parenright> : "㊖" U3296 # CIRCLED IDEOGRAPH FINANCIAL
+<Multi_key> <parenleft> <U795D> <parenright> : "㊗" U3297 # CIRCLED IDEOGRAPH CONGRATULATION
+<Multi_key> <parenleft> <U52B4> <parenright> : "㊘" U3298 # CIRCLED IDEOGRAPH LABOR
+<Multi_key> <parenleft> <U79D8> <parenright> : "㊙" U3299 # CIRCLED IDEOGRAPH SECRET
+<Multi_key> <parenleft> <U7537> <parenright> : "㊚" U329A # CIRCLED IDEOGRAPH MALE
+<Multi_key> <parenleft> <U5973> <parenright> : "㊛" U329B # CIRCLED IDEOGRAPH FEMALE
+<Multi_key> <parenleft> <U9069> <parenright> : "㊜" U329C # CIRCLED IDEOGRAPH SUITABLE
+<Multi_key> <parenleft> <U512A> <parenright> : "㊝" U329D # CIRCLED IDEOGRAPH EXCELLENT
+<Multi_key> <parenleft> <U5370> <parenright> : "㊞" U329E # CIRCLED IDEOGRAPH PRINT
+<Multi_key> <parenleft> <U6CE8> <parenright> : "㊟" U329F # CIRCLED IDEOGRAPH ATTENTION
+<Multi_key> <parenleft> <U9805> <parenright> : "㊠" U32A0 # CIRCLED IDEOGRAPH ITEM
+<Multi_key> <parenleft> <U4F11> <parenright> : "㊡" U32A1 # CIRCLED IDEOGRAPH REST
+<Multi_key> <parenleft> <U5199> <parenright> : "㊢" U32A2 # CIRCLED IDEOGRAPH COPY
+<Multi_key> <parenleft> <U6B63> <parenright> : "㊣" U32A3 # CIRCLED IDEOGRAPH CORRECT
+<Multi_key> <parenleft> <U4E0A> <parenright> : "㊤" U32A4 # CIRCLED IDEOGRAPH HIGH
+<Multi_key> <parenleft> <U4E2D> <parenright> : "㊥" U32A5 # CIRCLED IDEOGRAPH CENTRE
+<Multi_key> <parenleft> <U4E0B> <parenright> : "㊦" U32A6 # CIRCLED IDEOGRAPH LOW
+<Multi_key> <parenleft> <U5DE6> <parenright> : "㊧" U32A7 # CIRCLED IDEOGRAPH LEFT
+<Multi_key> <parenleft> <U53F3> <parenright> : "㊨" U32A8 # CIRCLED IDEOGRAPH RIGHT
+<Multi_key> <parenleft> <U533B> <parenright> : "㊩" U32A9 # CIRCLED IDEOGRAPH MEDICINE
+<Multi_key> <parenleft> <U5B97> <parenright> : "㊪" U32AA # CIRCLED IDEOGRAPH RELIGION
+<Multi_key> <parenleft> <U5B66> <parenright> : "㊫" U32AB # CIRCLED IDEOGRAPH STUDY
+<Multi_key> <parenleft> <U76E3> <parenright> : "㊬" U32AC # CIRCLED IDEOGRAPH SUPERVISE
+<Multi_key> <parenleft> <U4F01> <parenright> : "㊭" U32AD # CIRCLED IDEOGRAPH ENTERPRISE
+<Multi_key> <parenleft> <U8CC7> <parenright> : "㊮" U32AE # CIRCLED IDEOGRAPH RESOURCE
+<Multi_key> <parenleft> <U5354> <parenright> : "㊯" U32AF # CIRCLED IDEOGRAPH ALLIANCE
+<Multi_key> <parenleft> <U591C> <parenright> : "㊰" U32B0 # CIRCLED IDEOGRAPH NIGHT
+<Multi_key> <parenleft> <3> <6> <parenright> : "㊱" U32B1 # CIRCLED NUMBER THIRTY SIX
+<Multi_key> <parenleft> <3> <KP_6> <parenright> : "㊱" U32B1 # CIRCLED NUMBER THIRTY SIX
+<Multi_key> <parenleft> <KP_3> <6> <parenright> : "㊱" U32B1 # CIRCLED NUMBER THIRTY SIX
+<Multi_key> <parenleft> <KP_3> <KP_6> <parenright> : "㊱" U32B1 # CIRCLED NUMBER THIRTY SIX
+<Multi_key> <parenleft> <3> <7> <parenright> : "㊲" U32B2 # CIRCLED NUMBER THIRTY SEVEN
+<Multi_key> <parenleft> <3> <KP_7> <parenright> : "㊲" U32B2 # CIRCLED NUMBER THIRTY SEVEN
+<Multi_key> <parenleft> <KP_3> <7> <parenright> : "㊲" U32B2 # CIRCLED NUMBER THIRTY SEVEN
+<Multi_key> <parenleft> <KP_3> <KP_7> <parenright> : "㊲" U32B2 # CIRCLED NUMBER THIRTY SEVEN
+<Multi_key> <parenleft> <3> <8> <parenright> : "㊳" U32B3 # CIRCLED NUMBER THIRTY EIGHT
+<Multi_key> <parenleft> <3> <KP_8> <parenright> : "㊳" U32B3 # CIRCLED NUMBER THIRTY EIGHT
+<Multi_key> <parenleft> <KP_3> <8> <parenright> : "㊳" U32B3 # CIRCLED NUMBER THIRTY EIGHT
+<Multi_key> <parenleft> <KP_3> <KP_8> <parenright> : "㊳" U32B3 # CIRCLED NUMBER THIRTY EIGHT
+<Multi_key> <parenleft> <3> <9> <parenright> : "㊴" U32B4 # CIRCLED NUMBER THIRTY NINE
+<Multi_key> <parenleft> <3> <KP_9> <parenright> : "㊴" U32B4 # CIRCLED NUMBER THIRTY NINE
+<Multi_key> <parenleft> <KP_3> <9> <parenright> : "㊴" U32B4 # CIRCLED NUMBER THIRTY NINE
+<Multi_key> <parenleft> <KP_3> <KP_9> <parenright> : "㊴" U32B4 # CIRCLED NUMBER THIRTY NINE
+<Multi_key> <parenleft> <4> <0> <parenright> : "㊵" U32B5 # CIRCLED NUMBER FORTY
+<Multi_key> <parenleft> <4> <KP_0> <parenright> : "㊵" U32B5 # CIRCLED NUMBER FORTY
+<Multi_key> <parenleft> <KP_4> <0> <parenright> : "㊵" U32B5 # CIRCLED NUMBER FORTY
+<Multi_key> <parenleft> <KP_4> <KP_0> <parenright> : "㊵" U32B5 # CIRCLED NUMBER FORTY
+<Multi_key> <parenleft> <4> <1> <parenright> : "㊶" U32B6 # CIRCLED NUMBER FORTY ONE
+<Multi_key> <parenleft> <4> <KP_1> <parenright> : "㊶" U32B6 # CIRCLED NUMBER FORTY ONE
+<Multi_key> <parenleft> <KP_4> <1> <parenright> : "㊶" U32B6 # CIRCLED NUMBER FORTY ONE
+<Multi_key> <parenleft> <KP_4> <KP_1> <parenright> : "㊶" U32B6 # CIRCLED NUMBER FORTY ONE
+<Multi_key> <parenleft> <4> <2> <parenright> : "㊷" U32B7 # CIRCLED NUMBER FORTY TWO
+<Multi_key> <parenleft> <4> <KP_Space> <parenright> : "㊷" U32B7 # CIRCLED NUMBER FORTY TWO
+<Multi_key> <parenleft> <4> <KP_2> <parenright> : "㊷" U32B7 # CIRCLED NUMBER FORTY TWO
+<Multi_key> <parenleft> <KP_4> <2> <parenright> : "㊷" U32B7 # CIRCLED NUMBER FORTY TWO
+<Multi_key> <parenleft> <KP_4> <KP_Space> <parenright> : "㊷" U32B7 # CIRCLED NUMBER FORTY TWO
+<Multi_key> <parenleft> <KP_4> <KP_2> <parenright> : "㊷" U32B7 # CIRCLED NUMBER FORTY TWO
+<Multi_key> <parenleft> <4> <3> <parenright> : "㊸" U32B8 # CIRCLED NUMBER FORTY THREE
+<Multi_key> <parenleft> <4> <KP_3> <parenright> : "㊸" U32B8 # CIRCLED NUMBER FORTY THREE
+<Multi_key> <parenleft> <KP_4> <3> <parenright> : "㊸" U32B8 # CIRCLED NUMBER FORTY THREE
+<Multi_key> <parenleft> <KP_4> <KP_3> <parenright> : "㊸" U32B8 # CIRCLED NUMBER FORTY THREE
+<Multi_key> <parenleft> <4> <4> <parenright> : "㊹" U32B9 # CIRCLED NUMBER FORTY FOUR
+<Multi_key> <parenleft> <4> <KP_4> <parenright> : "㊹" U32B9 # CIRCLED NUMBER FORTY FOUR
+<Multi_key> <parenleft> <KP_4> <4> <parenright> : "㊹" U32B9 # CIRCLED NUMBER FORTY FOUR
+<Multi_key> <parenleft> <KP_4> <KP_4> <parenright> : "㊹" U32B9 # CIRCLED NUMBER FORTY FOUR
+<Multi_key> <parenleft> <4> <5> <parenright> : "㊺" U32BA # CIRCLED NUMBER FORTY FIVE
+<Multi_key> <parenleft> <4> <KP_5> <parenright> : "㊺" U32BA # CIRCLED NUMBER FORTY FIVE
+<Multi_key> <parenleft> <KP_4> <5> <parenright> : "㊺" U32BA # CIRCLED NUMBER FORTY FIVE
+<Multi_key> <parenleft> <KP_4> <KP_5> <parenright> : "㊺" U32BA # CIRCLED NUMBER FORTY FIVE
+<Multi_key> <parenleft> <4> <6> <parenright> : "㊻" U32BB # CIRCLED NUMBER FORTY SIX
+<Multi_key> <parenleft> <4> <KP_6> <parenright> : "㊻" U32BB # CIRCLED NUMBER FORTY SIX
+<Multi_key> <parenleft> <KP_4> <6> <parenright> : "㊻" U32BB # CIRCLED NUMBER FORTY SIX
+<Multi_key> <parenleft> <KP_4> <KP_6> <parenright> : "㊻" U32BB # CIRCLED NUMBER FORTY SIX
+<Multi_key> <parenleft> <4> <7> <parenright> : "㊼" U32BC # CIRCLED NUMBER FORTY SEVEN
+<Multi_key> <parenleft> <4> <KP_7> <parenright> : "㊼" U32BC # CIRCLED NUMBER FORTY SEVEN
+<Multi_key> <parenleft> <KP_4> <7> <parenright> : "㊼" U32BC # CIRCLED NUMBER FORTY SEVEN
+<Multi_key> <parenleft> <KP_4> <KP_7> <parenright> : "㊼" U32BC # CIRCLED NUMBER FORTY SEVEN
+<Multi_key> <parenleft> <4> <8> <parenright> : "㊽" U32BD # CIRCLED NUMBER FORTY EIGHT
+<Multi_key> <parenleft> <4> <KP_8> <parenright> : "㊽" U32BD # CIRCLED NUMBER FORTY EIGHT
+<Multi_key> <parenleft> <KP_4> <8> <parenright> : "㊽" U32BD # CIRCLED NUMBER FORTY EIGHT
+<Multi_key> <parenleft> <KP_4> <KP_8> <parenright> : "㊽" U32BD # CIRCLED NUMBER FORTY EIGHT
+<Multi_key> <parenleft> <4> <9> <parenright> : "㊾" U32BE # CIRCLED NUMBER FORTY NINE
+<Multi_key> <parenleft> <4> <KP_9> <parenright> : "㊾" U32BE # CIRCLED NUMBER FORTY NINE
+<Multi_key> <parenleft> <KP_4> <9> <parenright> : "㊾" U32BE # CIRCLED NUMBER FORTY NINE
+<Multi_key> <parenleft> <KP_4> <KP_9> <parenright> : "㊾" U32BE # CIRCLED NUMBER FORTY NINE
+<Multi_key> <parenleft> <5> <0> <parenright> : "㊿" U32BF # CIRCLED NUMBER FIFTY
+<Multi_key> <parenleft> <5> <KP_0> <parenright> : "㊿" U32BF # CIRCLED NUMBER FIFTY
+<Multi_key> <parenleft> <KP_5> <0> <parenright> : "㊿" U32BF # CIRCLED NUMBER FIFTY
+<Multi_key> <parenleft> <KP_5> <KP_0> <parenright> : "㊿" U32BF # CIRCLED NUMBER FIFTY
+<Multi_key> <parenleft> <kana_A> <parenright> : "㋐" U32D0 # CIRCLED KATAKANA A
+<Multi_key> <parenleft> <kana_I> <parenright> : "㋑" U32D1 # CIRCLED KATAKANA I
+<Multi_key> <parenleft> <kana_U> <parenright> : "㋒" U32D2 # CIRCLED KATAKANA U
+<Multi_key> <parenleft> <kana_E> <parenright> : "㋓" U32D3 # CIRCLED KATAKANA E
+<Multi_key> <parenleft> <kana_O> <parenright> : "㋔" U32D4 # CIRCLED KATAKANA O
+<Multi_key> <parenleft> <kana_KA> <parenright> : "㋕" U32D5 # CIRCLED KATAKANA KA
+<Multi_key> <parenleft> <kana_KI> <parenright> : "㋖" U32D6 # CIRCLED KATAKANA KI
+<Multi_key> <parenleft> <kana_KU> <parenright> : "㋗" U32D7 # CIRCLED KATAKANA KU
+<Multi_key> <parenleft> <kana_KE> <parenright> : "㋘" U32D8 # CIRCLED KATAKANA KE
+<Multi_key> <parenleft> <kana_KO> <parenright> : "㋙" U32D9 # CIRCLED KATAKANA KO
+<Multi_key> <parenleft> <kana_SA> <parenright> : "㋚" U32DA # CIRCLED KATAKANA SA
+<Multi_key> <parenleft> <kana_SHI> <parenright> : "㋛" U32DB # CIRCLED KATAKANA SI
+<Multi_key> <parenleft> <kana_SU> <parenright> : "㋜" U32DC # CIRCLED KATAKANA SU
+<Multi_key> <parenleft> <kana_SE> <parenright> : "㋝" U32DD # CIRCLED KATAKANA SE
+<Multi_key> <parenleft> <kana_SO> <parenright> : "㋞" U32DE # CIRCLED KATAKANA SO
+<Multi_key> <parenleft> <kana_TA> <parenright> : "㋟" U32DF # CIRCLED KATAKANA TA
+<Multi_key> <parenleft> <kana_CHI> <parenright> : "㋠" U32E0 # CIRCLED KATAKANA TI
+<Multi_key> <parenleft> <kana_TSU> <parenright> : "㋡" U32E1 # CIRCLED KATAKANA TU
+<Multi_key> <parenleft> <kana_TE> <parenright> : "㋢" U32E2 # CIRCLED KATAKANA TE
+<Multi_key> <parenleft> <kana_TO> <parenright> : "㋣" U32E3 # CIRCLED KATAKANA TO
+<Multi_key> <parenleft> <kana_NA> <parenright> : "㋤" U32E4 # CIRCLED KATAKANA NA
+<Multi_key> <parenleft> <kana_NI> <parenright> : "㋥" U32E5 # CIRCLED KATAKANA NI
+<Multi_key> <parenleft> <kana_NU> <parenright> : "㋦" U32E6 # CIRCLED KATAKANA NU
+<Multi_key> <parenleft> <kana_NE> <parenright> : "㋧" U32E7 # CIRCLED KATAKANA NE
+<Multi_key> <parenleft> <kana_NO> <parenright> : "㋨" U32E8 # CIRCLED KATAKANA NO
+<Multi_key> <parenleft> <kana_HA> <parenright> : "㋩" U32E9 # CIRCLED KATAKANA HA
+<Multi_key> <parenleft> <kana_HI> <parenright> : "㋪" U32EA # CIRCLED KATAKANA HI
+<Multi_key> <parenleft> <kana_FU> <parenright> : "㋫" U32EB # CIRCLED KATAKANA HU
+<Multi_key> <parenleft> <kana_HE> <parenright> : "㋬" U32EC # CIRCLED KATAKANA HE
+<Multi_key> <parenleft> <kana_HO> <parenright> : "㋭" U32ED # CIRCLED KATAKANA HO
+<Multi_key> <parenleft> <kana_MA> <parenright> : "㋮" U32EE # CIRCLED KATAKANA MA
+<Multi_key> <parenleft> <kana_MI> <parenright> : "㋯" U32EF # CIRCLED KATAKANA MI
+<Multi_key> <parenleft> <kana_MU> <parenright> : "㋰" U32F0 # CIRCLED KATAKANA MU
+<Multi_key> <parenleft> <kana_ME> <parenright> : "㋱" U32F1 # CIRCLED KATAKANA ME
+<Multi_key> <parenleft> <kana_MO> <parenright> : "㋲" U32F2 # CIRCLED KATAKANA MO
+<Multi_key> <parenleft> <kana_YA> <parenright> : "㋳" U32F3 # CIRCLED KATAKANA YA
+<Multi_key> <parenleft> <kana_YU> <parenright> : "㋴" U32F4 # CIRCLED KATAKANA YU
+<Multi_key> <parenleft> <kana_YO> <parenright> : "㋵" U32F5 # CIRCLED KATAKANA YO
+<Multi_key> <parenleft> <kana_RA> <parenright> : "㋶" U32F6 # CIRCLED KATAKANA RA
+<Multi_key> <parenleft> <kana_RI> <parenright> : "㋷" U32F7 # CIRCLED KATAKANA RI
+<Multi_key> <parenleft> <kana_RU> <parenright> : "㋸" U32F8 # CIRCLED KATAKANA RU
+<Multi_key> <parenleft> <kana_RE> <parenright> : "㋹" U32F9 # CIRCLED KATAKANA RE
+<Multi_key> <parenleft> <kana_RO> <parenright> : "㋺" U32FA # CIRCLED KATAKANA RO
+<Multi_key> <parenleft> <kana_WA> <parenright> : "㋻" U32FB # CIRCLED KATAKANA WA
+<Multi_key> <parenleft> <U30F0> <parenright> : "㋼" U32FC # CIRCLED KATAKANA WI
+<Multi_key> <parenleft> <U30F1> <parenright> : "㋽" U32FD # CIRCLED KATAKANA WE
+<Multi_key> <parenleft> <kana_WO> <parenright> : "㋾" U32FE # CIRCLED KATAKANA WO
+<Multi_key> <U05B4> <hebrew_yod> : "יִ" UFB1D # HEBREW LETTER YOD WITH HIRIQ
+<Multi_key> <U05B7> <U05F2> : "ײַ" UFB1F # HEBREW LIGATURE YIDDISH YOD YOD PATAH
+<Multi_key> <U05C1> <hebrew_shin> : "שׁ" UFB2A # HEBREW LETTER SHIN WITH SHIN DOT
+<Multi_key> <U05C2> <hebrew_shin> : "שׂ" UFB2B # HEBREW LETTER SHIN WITH SIN DOT
+<Multi_key> <U05C1> <UFB49> : "שּׁ" UFB2C # HEBREW LETTER SHIN WITH DAGESH AND SHIN DOT
+<Multi_key> <U05C1> <U05BC> <hebrew_shin> : "שּׁ" UFB2C # HEBREW LETTER SHIN WITH DAGESH AND SHIN DOT
+<Multi_key> <U05C2> <UFB49> : "שּׂ" UFB2D # HEBREW LETTER SHIN WITH DAGESH AND SIN DOT
+<Multi_key> <U05C2> <U05BC> <hebrew_shin> : "שּׂ" UFB2D # HEBREW LETTER SHIN WITH DAGESH AND SIN DOT
+<Multi_key> <U05B7> <hebrew_aleph> : "אַ" UFB2E # HEBREW LETTER ALEF WITH PATAH
+<Multi_key> <U05B8> <hebrew_aleph> : "אָ" UFB2F # HEBREW LETTER ALEF WITH QAMATS
+<Multi_key> <U05BC> <hebrew_aleph> : "אּ" UFB30 # HEBREW LETTER ALEF WITH MAPIQ
+<Multi_key> <U05BC> <hebrew_bet> : "בּ" UFB31 # HEBREW LETTER BET WITH DAGESH
+<Multi_key> <U05BC> <hebrew_beth> : "בּ" UFB31 # HEBREW LETTER BET WITH DAGESH
+<Multi_key> <U05BC> <hebrew_gimel> : "גּ" UFB32 # HEBREW LETTER GIMEL WITH DAGESH
+<Multi_key> <U05BC> <hebrew_gimmel> : "גּ" UFB32 # HEBREW LETTER GIMEL WITH DAGESH
+<Multi_key> <U05BC> <hebrew_dalet> : "דּ" UFB33 # HEBREW LETTER DALET WITH DAGESH
+<Multi_key> <U05BC> <hebrew_daleth> : "דּ" UFB33 # HEBREW LETTER DALET WITH DAGESH
+<Multi_key> <U05BC> <hebrew_he> : "הּ" UFB34 # HEBREW LETTER HE WITH MAPIQ
+<Multi_key> <U05BC> <hebrew_waw> : "וּ" UFB35 # HEBREW LETTER VAV WITH DAGESH
+<Multi_key> <U05BC> <hebrew_zain> : "זּ" UFB36 # HEBREW LETTER ZAYIN WITH DAGESH
+<Multi_key> <U05BC> <hebrew_zayin> : "זּ" UFB36 # HEBREW LETTER ZAYIN WITH DAGESH
+<Multi_key> <U05BC> <hebrew_tet> : "טּ" UFB38 # HEBREW LETTER TET WITH DAGESH
+<Multi_key> <U05BC> <hebrew_teth> : "טּ" UFB38 # HEBREW LETTER TET WITH DAGESH
+<Multi_key> <U05BC> <hebrew_yod> : "יּ" UFB39 # HEBREW LETTER YOD WITH DAGESH
+<Multi_key> <U05BC> <hebrew_finalkaph> : "ךּ" UFB3A # HEBREW LETTER FINAL KAF WITH DAGESH
+<Multi_key> <U05BC> <hebrew_kaph> : "כּ" UFB3B # HEBREW LETTER KAF WITH DAGESH
+<Multi_key> <U05BC> <hebrew_lamed> : "לּ" UFB3C # HEBREW LETTER LAMED WITH DAGESH
+<Multi_key> <U05BC> <hebrew_mem> : "מּ" UFB3E # HEBREW LETTER MEM WITH DAGESH
+<Multi_key> <U05BC> <hebrew_nun> : "נּ" UFB40 # HEBREW LETTER NUN WITH DAGESH
+<Multi_key> <U05BC> <hebrew_samech> : "סּ" UFB41 # HEBREW LETTER SAMEKH WITH DAGESH
+<Multi_key> <U05BC> <hebrew_samekh> : "סּ" UFB41 # HEBREW LETTER SAMEKH WITH DAGESH
+<Multi_key> <U05BC> <hebrew_finalpe> : "ףּ" UFB43 # HEBREW LETTER FINAL PE WITH DAGESH
+<Multi_key> <U05BC> <hebrew_pe> : "פּ" UFB44 # HEBREW LETTER PE WITH DAGESH
+<Multi_key> <U05BC> <hebrew_zade> : "צּ" UFB46 # HEBREW LETTER TSADI WITH DAGESH
+<Multi_key> <U05BC> <hebrew_zadi> : "צּ" UFB46 # HEBREW LETTER TSADI WITH DAGESH
+<Multi_key> <U05BC> <hebrew_kuf> : "קּ" UFB47 # HEBREW LETTER QOF WITH DAGESH
+<Multi_key> <U05BC> <hebrew_qoph> : "קּ" UFB47 # HEBREW LETTER QOF WITH DAGESH
+<Multi_key> <U05BC> <hebrew_resh> : "רּ" UFB48 # HEBREW LETTER RESH WITH DAGESH
+<Multi_key> <U05BC> <hebrew_shin> : "שּ" UFB49 # HEBREW LETTER SHIN WITH DAGESH
+<Multi_key> <U05BC> <hebrew_taf> : "תּ" UFB4A # HEBREW LETTER TAV WITH DAGESH
+<Multi_key> <U05BC> <hebrew_taw> : "תּ" UFB4A # HEBREW LETTER TAV WITH DAGESH
+<Multi_key> <U05B9> <hebrew_waw> : "וֹ" UFB4B # HEBREW LETTER VAV WITH HOLAM
+<Multi_key> <U05BF> <hebrew_bet> : "בֿ" UFB4C # HEBREW LETTER BET WITH RAFE
+<Multi_key> <U05BF> <hebrew_beth> : "בֿ" UFB4C # HEBREW LETTER BET WITH RAFE
+<Multi_key> <U05BF> <hebrew_kaph> : "כֿ" UFB4D # HEBREW LETTER KAF WITH RAFE
+<Multi_key> <U05BF> <hebrew_pe> : "פֿ" UFB4E # HEBREW LETTER PE WITH RAFE
+<Multi_key> <U1D157> <U1D165> : "𝅗𝅥" U1D15E # MUSICAL SYMBOL HALF NOTE
+<Multi_key> <U1D158> <U1D165> : "𝅘𝅥" U1D15F # MUSICAL SYMBOL QUARTER NOTE
+<Multi_key> <U1D15F> <U1D16E> : "𝅘𝅥𝅮" U1D160 # MUSICAL SYMBOL EIGHTH NOTE
+/* <Multi_key> <U1D158> <U1D165> <U1D16E> : "𝅘𝅥𝅮" U1D160 # MUSICAL SYMBOL EIGHTH NOTE */
+<Multi_key> <U1D15F> <U1D16F> : "𝅘𝅥𝅯" U1D161 # MUSICAL SYMBOL SIXTEENTH NOTE
+/* <Multi_key> <U1D158> <U1D165> <U1D16F> : "𝅘𝅥𝅯" U1D161 # MUSICAL SYMBOL SIXTEENTH NOTE */
+<Multi_key> <U1D15F> <U1D170> : "𝅘𝅥𝅰" U1D162 # MUSICAL SYMBOL THIRTY-SECOND NOTE
+/* <Multi_key> <U1D158> <U1D165> <U1D170> : "𝅘𝅥𝅰" U1D162 # MUSICAL SYMBOL THIRTY-SECOND NOTE */
+<Multi_key> <U1D15F> <U1D171> : "𝅘𝅥𝅱" U1D163 # MUSICAL SYMBOL SIXTY-FOURTH NOTE
+/* <Multi_key> <U1D158> <U1D165> <U1D171> : "𝅘𝅥𝅱" U1D163 # MUSICAL SYMBOL SIXTY-FOURTH NOTE */
+<Multi_key> <U1D15F> <U1D172> : "𝅘𝅥𝅲" U1D164 # MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH NOTE
+/* <Multi_key> <U1D158> <U1D165> <U1D172> : "𝅘𝅥𝅲" U1D164 # MUSICAL SYMBOL ONE HUNDRED TWENTY-EIGHTH NOTE */
+<Multi_key> <U1D1B9> <U1D165> : "𝆹𝅥" U1D1BB # MUSICAL SYMBOL MINIMA
+<Multi_key> <U1D1BA> <U1D165> : "𝆺𝅥" U1D1BC # MUSICAL SYMBOL MINIMA BLACK
+<Multi_key> <U1D1BB> <U1D16E> : "𝆹𝅥𝅮" U1D1BD # MUSICAL SYMBOL SEMIMINIMA WHITE
+/* <Multi_key> <U1D1B9> <U1D165> <U1D16E> : "𝆹𝅥𝅮" U1D1BD # MUSICAL SYMBOL SEMIMINIMA WHITE */
+<Multi_key> <U1D1BC> <U1D16E> : "𝆺𝅥𝅮" U1D1BE # MUSICAL SYMBOL SEMIMINIMA BLACK
+/* <Multi_key> <U1D1BA> <U1D165> <U1D16E> : "𝆺𝅥𝅮" U1D1BE # MUSICAL SYMBOL SEMIMINIMA BLACK */
+<Multi_key> <U1D1BB> <U1D16F> : "𝆹𝅥𝅯" U1D1BF # MUSICAL SYMBOL FUSA WHITE
+/* <Multi_key> <U1D1B9> <U1D165> <U1D16F> : "𝆹𝅥𝅯" U1D1BF # MUSICAL SYMBOL FUSA WHITE */
+<Multi_key> <U1D1BC> <U1D16F> : "𝆺𝅥𝅯" U1D1C0 # MUSICAL SYMBOL FUSA BLACK
+/* <Multi_key> <U1D1BA> <U1D165> <U1D16F> : "𝆺𝅥𝅯" U1D1C0 # MUSICAL SYMBOL FUSA BLACK */
+
+XCOMM
+XCOMM Khmer digraphs
+XCOMM
+
+<U17ff> : "ាំ"
+<U17fe> : "ោះ"
+<U17fd> : "េះ"
+<U17fc> : "ុំ"
+<U17fb> : "ុះ"
+
+XCOMM
+XCOMM Arabic Lam-Alef ligatures
+XCOMM
+
+<UFEFB> : "لا" # ARABIC LIGATURE LAM WITH ALEF
+<UFEF7> : "لأ" # ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE
+<UFEF9> : "لإ" # ARABIC LIGATURE LAM WITH ALEF WITH HAMZA BELOW
+<UFEF5> : "لآ" # ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE
+
+XCOMM
+XCOMM French-Dvorak Bépo compositions
+XCOMM
+
+<dead_abovedot> <Amacron> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
+<dead_abovedot> <amacron> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
+<dead_abovedot> <j> : "ȷ" U0237 # LATIN SMALL LETTER DOTLESS J
+<dead_abovedot> <L> : "Ŀ" U013F # LATIN CAPITAL LETTER L WITH MIDDLE DOT
+<dead_abovedot> <l> : "ŀ" U0140 # LATIN SMALL LETTER L WITH MIDDLE DOT
+<dead_abovedot> <Omacron> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
+<dead_abovedot> <omacron> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
+<dead_abovedot> <nobreakspace> : "̇" U0307 # COMBINING DOT ABOVE
+<dead_acute> <Sabovedot> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
+<dead_acute> <sabovedot> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
+<dead_acute> <V> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
+<dead_acute> <v> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
+<dead_acute> <nobreakspace> : "́" U0301 # COMBINING ACUTE ACCENT
+<dead_belowdot> <Sabovedot> : "Ṩ" U1E68 # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
+<dead_belowdot> <sabovedot> : "ṩ" U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
+<dead_belowdot> <dead_belowdot> : "̣" U0323 # COMBINING DOT BELOW
+<dead_belowdot> <nobreakspace> : "̣" U0323 # COMBINING DOT BELOW
+<dead_belowdot> <space> : "̣" U0323 # COMBINING DOT BELOW
+<dead_breve> <Aacute> : "Ắ" Abreveacute # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
+<dead_breve> <Agrave> : "Ằ" Abrevegrave # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
+<dead_breve> <Ahook> : "Ẳ" Abrevehook # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
+<dead_breve> <Atilde> : "Ẵ" Abrevetilde # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
+<dead_breve> <aacute> : "ắ" abreveacute # LATIN SMALL LETTER A WITH BREVE AND ACUTE
+<dead_breve> <agrave> : "ằ" abrevegrave # LATIN SMALL LETTER A WITH BREVE AND GRAVE
+<dead_breve> <ahook> : "ẳ" abrevehook # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
+<dead_breve> <atilde> : "ẵ" abrevetilde # LATIN SMALL LETTER A WITH BREVE AND TILDE
+<dead_breve> <nobreakspace> : "̆" U0306 # COMBINING BREVE
+<dead_caron> <parenleft> : "₍" U208D # SUBSCRIPT LEFT PARENTHESIS
+<dead_caron> <parenright> : "₎" U208E # SUBSCRIPT RIGHT PARENTHESIS
+<dead_caron> <plus> : "₊" U208A # SUBSCRIPT PLUS SIGN
+<dead_caron> <minus> : "₋" U208B # SUBSCRIPT MINUS
+<dead_caron> <0> : "₀" zerosubscript # SUBSCRIPT ZERO
+<dead_caron> <1> : "₁" onesubscript # SUBSCRIPT ONE
+<dead_caron> <2> : "₂" twosubscript # SUBSCRIPT TWO
+<dead_caron> <3> : "₃" threesubscript # SUBSCRIPT THREE
+<dead_caron> <4> : "₄" foursubscript # SUBSCRIPT FOUR
+<dead_caron> <5> : "₅" fivesubscript # SUBSCRIPT FIVE
+<dead_caron> <6> : "₆" sixsubscript # SUBSCRIPT SIX
+<dead_caron> <7> : "₇" sevensubscript # SUBSCRIPT SEVEN
+<dead_caron> <8> : "₈" eightsubscript # SUBSCRIPT EIGHT
+<dead_caron> <9> : "₉" ninesubscript # SUBSCRIPT NINE
+<dead_caron> <equal> : "₌" U208C # SUBSCRIPT EQUALS SIGN
+<dead_caron> <U01F2> : "Dž" U01C5 # LATIN CAPITAL LETTER D WITH SMALL LETTER Z WITH CARON
+<dead_caron> <Sabovedot> : "Ṧ" U1E66 # LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
+<dead_caron> <sabovedot> : "ṧ" U1E67 # LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
+<dead_caron> <V> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
+<dead_caron> <v> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
+<dead_caron> <nobreakspace> : "̌" U030C # COMBINING CARON
+<dead_cedilla> <Cacute> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
+<dead_cedilla> <ColonSign> : "₵" U20B5 # CEDI SIGN
+<dead_cedilla> <cacute> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
+<dead_cedilla> <cent> : "₵" U20B5 # CEDI SIGN
+<dead_cedilla> <U0114> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
+<dead_cedilla> <U0115> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+<dead_cedilla> <nobreakspace> : "̧" U0327 # COMBINING CEDILLA
+<dead_circumflex> <minus> : "⁻" U207B # SUPERSCRIPT MINUS
+<dead_circumflex> <Aacute> : "Ấ" Acircumflexacute # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
+<dead_circumflex> <Agrave> : "Ầ" Acircumflexgrave # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
+<dead_circumflex> <Ahook> : "Ẩ" Acircumflexhook # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_circumflex> <Atilde> : "Ẫ" Acircumflextilde # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
+<dead_circumflex> <aacute> : "ấ" acircumflexacute # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
+<dead_circumflex> <agrave> : "ầ" acircumflexgrave # LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
+<dead_circumflex> <ahook> : "ẩ" acircumflexhook # LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_circumflex> <atilde> : "ẫ" acircumflextilde # LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
+<dead_circumflex> <Eacute> : "Ế" Ecircumflexacute # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
+<dead_circumflex> <Egrave> : "Ề" Ecircumflexgrave # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
+<dead_circumflex> <Ehook> : "Ể" Ecircumflexhook # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_circumflex> <Etilde> : "Ễ" Ecircumflextilde # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
+<dead_circumflex> <eacute> : "ế" ecircumflexacute # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
+<dead_circumflex> <egrave> : "ề" ecircumflexgrave # LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
+<dead_circumflex> <ehook> : "ể" ecircumflexhook # LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_circumflex> <etilde> : "ễ" ecircumflextilde # LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
+<dead_circumflex> <Oacute> : "Ố" Ocircumflexacute # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
+<dead_circumflex> <Ograve> : "Ồ" Ocircumflexgrave # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
+<dead_circumflex> <Ohook> : "Ổ" Ocircumflexhook # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_circumflex> <Otilde> : "Ỗ" Ocircumflextilde # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
+<dead_circumflex> <oacute> : "ố" ocircumflexacute # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
+<dead_circumflex> <ograve> : "ồ" ocircumflexgrave # LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
+<dead_circumflex> <ohook> : "ổ" ocircumflexhook # LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_circumflex> <otilde> : "ỗ" ocircumflextilde # LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
+<dead_circumflex> <nobreakspace> : "̂" U0302 # COMBINING CIRCUMFLEX ACCENT
+<dead_belowcomma> <S> : "Ș" U0218 # LATIN CAPITAL LETTER S WITH COMMA BELOW
+<dead_belowcomma> <s> : "ș" U0219 # LATIN SMALL LETTER S WITH COMMA BELOW
+<dead_belowcomma> <T> : "Ț" U021A # LATIN CAPITAL LETTER T WITH COMMA BELOW
+<dead_belowcomma> <t> : "ț" U021B # LATIN SMALL LETTER T WITH COMMA BELOW
+<dead_belowcomma> <dead_belowcomma> : "," comma # COMMA
+<dead_belowcomma> <nobreakspace> : "̦" U0326 # COMBINING COMMA BELOW
+<dead_belowcomma> <space> : "," comma # COMMA
+<dead_currency> <A> : "₳" U20B3 # AUSTRAL SIGN
+<dead_currency> <a> : "؋" U060B # AFGHANI SIGN
+<dead_currency> <B> : "₱" U20B1 # PESO SIGN
+<dead_currency> <b> : "฿" Thai_baht # THAI CURRENCY SYMBOL BAHT
+<dead_currency> <Ccedilla> : "₵" U20B5 # CEDI SIGN
+<dead_currency> <C> : "₡" ColonSign # COLON SIGN
+<dead_currency> <ccedilla> : "₵" U20B5 # CEDI SIGN
+<dead_currency> <c> : "¢" cent # CENT SIGN
+<dead_currency> <D> : "₯" U20AF # DRACHMA SIGN
+<dead_currency> <d> : "₫" DongSign # DONG SIGN
+<dead_currency> <E> : "₠" EcuSign # EURO-CURRENCY SIGN
+<dead_currency> <e> : "€" EuroSign # EURO SIGN
+<dead_currency> <F> : "₣" FFrancSign # FRENCH FRANC SIGN
+<dead_currency> <f> : "ƒ" function # LATIN SMALL LETTER F WITH HOOK
+<dead_currency> <G> : "₲" U20B2 # GUARANI SIGN
+<dead_currency> <g> : "₲" U20B2 # GUARANI SIGN
+<dead_currency> <H> : "₴" U20B4 # HRYVNIA SIGN
+<dead_currency> <h> : "₴" U20B4 # HRYVNIA SIGN
+<dead_currency> <I> : "៛" U17DB # KHMER CURRENCY SYMBOL RIEL
+<dead_currency> <i> : "﷼" UFDFC # RIAL SIGN
+<dead_currency> <K> : "₭" U20AD # KIP SIGN
+<dead_currency> <k> : "₭" U20AD # KIP SIGN
+<dead_currency> <L> : "₤" LiraSign # LIRA SIGN
+<dead_currency> <l> : "£" sterling # POUND SIGN
+<dead_currency> <M> : "ℳ" U2133 # SCRIPT CAPITAL M
+<dead_currency> <m> : "₥" MillSign # MILL SIGN
+<dead_currency> <N> : "₦" NairaSign # NAIRA SIGN
+<dead_currency> <n> : "₦" NairaSign # NAIRA SIGN
+<dead_currency> <O> : "૱" U0AF1 # GUJARATI RUPEE SIGN
+<dead_currency> <o> : "௹" U0BF9 # TAMIL RUPEE SIGN
+<dead_currency> <P> : "₧" PesetaSign # PESETA SIGN
+<dead_currency> <p> : "₰" U20B0 # GERMAN PENNY SIGN
+<dead_currency> <r> : "₢" CruzeiroSign # CRUZEIRO SIGN
+<dead_currency> <R> : "₨" RupeeSign # RUPEE SIGN
+<dead_currency> <S> : "$" dollar # DOLLAR SIGN
+<dead_currency> <s> : "₪" NewSheqelSign # NEW SHEQEL SIGN
+<dead_currency> <T> : "₮" U20AE # TUGRIK SIGN
+<dead_currency> <t> : "৳" U09F3 # BENGALI RUPEE SIGN
+<dead_currency> <THORN> : "৲" U09F2 # BENGALI RUPEE MARK
+<dead_currency> <thorn> : "৲" U09F2 # BENGALI RUPEE MARK
+<dead_currency> <U> : "圓" U5713 # YUAN / WEN
+<dead_currency> <u> : "元" U5143 # YUAN / WEN
+<dead_currency> <W> : "₩" WonSign # WON SIGN
+<dead_currency> <w> : "₩" WonSign # WON SIGN
+<dead_currency> <Y> : "円" U5186 # YEN
+<dead_currency> <y> : "¥" yen # YEN SIGN
+<dead_currency> <dead_currency> : "¤" currency # CURRENCY SIGN
+<dead_currency> <nobreakspace> : "¤" currency # CURRENCY SIGN
+<dead_currency> <space> : "¤" currency # CURRENCY SIGN
+<dead_diaeresis> <Amacron> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
+<dead_diaeresis> <amacron> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
+<dead_diaeresis> <Iacute> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
+<dead_diaeresis> <iacute> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
+<dead_diaeresis> <Omacron> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
+<dead_diaeresis> <omacron> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
+<dead_diaeresis> <Uacute> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
+<dead_diaeresis> <U01D3> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
+<dead_diaeresis> <Ugrave> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
+<dead_diaeresis> <uacute> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
+<dead_diaeresis> <U01D4> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
+<dead_diaeresis> <ugrave> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
+<dead_diaeresis> <nobreakspace> : "̈" U0308 # COMBINING DIAERESIS
+<dead_doubleacute> <nobreakspace> : "̋" U030B # COMBINING DOUBLE ACUTE ACCENT
+<dead_grave> <V> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
+<dead_grave> <v> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
+<dead_grave> <nobreakspace> : "̀" U0300 # COMBINING GRAVE ACCENT
+<dead_hook> <B> : "Ɓ" U0181 # LATIN CAPITAL LETTER B WITH HOOK
+<dead_hook> <b> : "ɓ" U0253 # LATIN SMALL LETTER B WITH HOOK
+<dead_hook> <C> : "Ƈ" U0187 # LATIN CAPITAL LETTER C WITH HOOK
+<dead_hook> <c> : "ƈ" U0188 # LATIN SMALL LETTER C WITH HOOK
+<dead_hook> <D> : "Ɗ" U018A # LATIN CAPITAL LETTER D WITH HOOK
+<dead_hook> <d> : "ɗ" U0257 # LATIN SMALL LETTER D WITH HOOK
+<dead_hook> <U0256> : "ᶑ" U1D91 # LATIN SMALL LETTER D WITH HOOK AND TAIL
+<dead_hook> <F> : "Ƒ" U0191 # LATIN CAPITAL LETTER F WITH HOOK
+<dead_hook> <f> : "ƒ" function # LATIN SMALL LETTER F WITH HOOK
+<dead_hook> <G> : "Ɠ" U0193 # LATIN CAPITAL LETTER G WITH HOOK
+<dead_hook> <g> : "ɠ" U0260 # LATIN SMALL LETTER G WITH HOOK
+<dead_hook> <h> : "ɦ" U0266 # LATIN SMALL LETTER H WITH HOOK
+<dead_hook> <U025F> : "ʄ" U0284 # LATIN SMALL LETTER DOTLESS J WITH STROKE AND HOOK
+<dead_hook> <K> : "Ƙ" U0198 # LATIN CAPITAL LETTER K WITH HOOK
+<dead_hook> <k> : "ƙ" U0199 # LATIN SMALL LETTER K WITH HOOK
+<dead_hook> <M> : "Ɱ" U2C6E # LATIN CAPITAL LETTER M WITH HOOK
+<dead_hook> <m> : "ɱ" U0271 # LATIN SMALL LETTER M WITH HOOK
+<dead_hook> <N> : "Ɲ" U019D # LATIN CAPITAL LETTER N WITH LEFT HOOK
+<dead_hook> <n> : "ɲ" U0272 # LATIN SMALL LETTER N WITH LEFT HOOK
+<dead_hook> <P> : "Ƥ" U01A4 # LATIN CAPITAL LETTER P WITH HOOK
+<dead_hook> <p> : "ƥ" U01A5 # LATIN SMALL LETTER P WITH HOOK
+<dead_hook> <q> : "ʠ" U02A0 # LATIN SMALL LETTER Q WITH HOOK
+<dead_hook> <U025C> : "ɝ" U025D # LATIN SMALL LETTER REVERSED OPEN E WITH HOOK
+<dead_hook> <s> : "ʂ" U0282 # LATIN SMALL LETTER S WITH HOOK
+<dead_hook> <schwa> : "ɚ" U025A # LATIN SMALL LETTER SCHWA WITH HOOK
+<dead_hook> <T> : "Ƭ" U01AC # LATIN CAPITAL LETTER T WITH HOOK
+<dead_hook> <t> : "ƭ" U01AD # LATIN SMALL LETTER T WITH HOOK
+<dead_hook> <U0279> : "ɻ" U027B # LATIN SMALL LETTER TURNED R WITH HOOK
+<dead_hook> <V> : "Ʋ" U01B2 # LATIN CAPITAL LETTER V WITH HOOK
+<dead_hook> <v> : "ʋ" U028B # LATIN SMALL LETTER V WITH HOOK
+<dead_hook> <W> : "Ⱳ" U2C72 # LATIN CAPITAL LETTER W WITH HOOK
+<dead_hook> <w> : "ⱳ" U2C73 # LATIN SMALL LETTER W WITH HOOK
+<dead_hook> <Z> : "Ȥ" U0224 # LATIN CAPITAL LETTER Z WITH HOOK
+<dead_hook> <z> : "ȥ" U0225 # LATIN SMALL LETTER Z WITH HOOK
+<dead_hook> <dead_hook> : "̉" U0309 # COMBINING HOOK ABOVE
+<dead_hook> <nobreakspace> : "̉" U0309 # COMBINING HOOK ABOVE
+<dead_hook> <space> : "̉" U0309 # COMBINING HOOK ABOVE
+<dead_horn> <Oacute> : "Ớ" Ohornacute # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
+<dead_horn> <Obelowdot> : "Ợ" Ohornbelowdot # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
+<dead_horn> <Ograve> : "Ờ" Ohorngrave # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
+<dead_horn> <Ohook> : "Ở" Ohornhook # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
+<dead_horn> <Otilde> : "Ỡ" Ohorntilde # LATIN CAPITAL LETTER O WITH HORN AND TILDE
+<dead_horn> <oacute> : "ớ" ohornacute # LATIN SMALL LETTER O WITH HORN AND ACUTE
+<dead_horn> <obelowdot> : "ợ" ohornbelowdot # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
+<dead_horn> <ograve> : "ờ" ohorngrave # LATIN SMALL LETTER O WITH HORN AND GRAVE
+<dead_horn> <ohook> : "ở" ohornhook # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
+<dead_horn> <otilde> : "ỡ" ohorntilde # LATIN SMALL LETTER O WITH HORN AND TILDE
+<dead_horn> <Uacute> : "Ứ" Uhornacute # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
+<dead_horn> <Ubelowdot> : "Ự" Uhornbelowdot # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
+<dead_horn> <Ugrave> : "Ừ" Uhorngrave # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
+<dead_horn> <Uhook> : "Ử" Uhornhook # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
+<dead_horn> <Utilde> : "Ữ" Uhorntilde # LATIN CAPITAL LETTER U WITH HORN AND TILDE
+<dead_horn> <uacute> : "ứ" uhornacute # LATIN SMALL LETTER U WITH HORN AND ACUTE
+<dead_horn> <ubelowdot> : "ự" uhornbelowdot # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
+<dead_horn> <ugrave> : "ừ" uhorngrave # LATIN SMALL LETTER U WITH HORN AND GRAVE
+<dead_horn> <uhook> : "ử" uhornhook # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
+<dead_horn> <utilde> : "ữ" uhorntilde # LATIN SMALL LETTER U WITH HORN AND TILDE
+<dead_horn> <dead_horn> : "̛" U031B # COMBINING HORN
+<dead_horn> <nobreakspace> : "̛" U031B # COMBINING HORN
+<dead_horn> <space> : "̛" U031B # COMBINING HORN
+<dead_macron> <Eacute> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
+<dead_macron> <Egrave> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
+<dead_macron> <eacute> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
+<dead_macron> <egrave> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
+<dead_macron> <Oacute> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
+<dead_macron> <Ograve> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
+<dead_macron> <oacute> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
+<dead_macron> <ograve> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
+<dead_macron> <V> : "Ǖ" U01D5 # LATIN CAPITAL LETTER U WITH DIAERESIS AND MACRON
+<dead_macron> <v> : "ǖ" U01D6 # LATIN SMALL LETTER U WITH DIAERESIS AND MACRON
+<dead_macron> <nobreakspace> : "̄" U0304 # COMBINING MACRON
+<dead_ogonek> <Omacron> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
+<dead_ogonek> <omacron> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
+<dead_ogonek> <nobreakspace> : "̨" U0328 # COMBINING OGONEK
+<dead_abovering> <Aacute> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
+<dead_abovering> <aacute> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
+<dead_abovering> <nobreakspace> : "̊" U030A # COMBINING RING ABOVE
+<dead_stroke> <2> : "ƻ" U01BB # LATIN LETTER TWO WITH STROKE
+<dead_stroke> <equal> : "≠" notequal # NOT EQUAL TO
+<dead_stroke> <A> : "Ⱥ" U023A # LATIN CAPITAL LETTER A WITH STROKE
+<dead_stroke> <a> : "ⱥ" U2C65 # LATIN SMALL LETTER A WITH STROKE
+<dead_stroke> <B> : "Ƀ" U0243 # LATIN CAPITAL LETTER B WITH STROKE
+<dead_stroke> <C> : "Ȼ" U023B # LATIN CAPITAL LETTER C WITH STROKE
+<dead_stroke> <c> : "ȼ" U023C # LATIN SMALL LETTER C WITH STROKE
+<dead_stroke> <E> : "Ɇ" U0246 # LATIN CAPITAL LETTER E WITH STROKE
+<dead_stroke> <e> : "ɇ" U0247 # LATIN SMALL LETTER E WITH STROKE
+<dead_stroke> <greater> : "≯" U226F # NOT GREATER-THAN
+<dead_stroke> <greaterthanequal> : "≱" U2271 # NEITHER GREATER-THAN NOR EQUAL TO
+<dead_stroke> <J> : "Ɉ" U0248 # LATIN CAPITAL LETTER J WITH STROKE
+<dead_stroke> <j> : "ɉ" U0249 # LATIN SMALL LETTER J WITH STROKE
+<dead_stroke> <U0269> : "ᵼ" U1D7C # LATIN SMALL LETTER IOTA WITH STROKE
+<dead_stroke> <U0237> : "ɟ" U025F # LATIN SMALL LETTER DOTLESS J WITH STROKE
+<dead_stroke> <less> : "≮" U226E # NOT LESS-THAN
+<dead_stroke> <lessthanequal> : "≰" U2270 # NEITHER LESS-THAN NOR EQUAL TO
+<dead_stroke> <Oacute> : "Ǿ" U01FE # LATIN CAPITAL LETTER O WITH STROKE AND ACUTE
+<dead_stroke> <oacute> : "ǿ" U01FF # LATIN SMALL LETTER O WITH STROKE AND ACUTE
+<dead_stroke> <P> : "Ᵽ" U2C63 # LATIN CAPITAL LETTER P WITH STROKE
+<dead_stroke> <p> : "ᵽ" U1D7D # LATIN SMALL LETTER P WITH STROKE
+<dead_stroke> <R> : "Ɍ" U024C # LATIN CAPITAL LETTER R WITH STROKE
+<dead_stroke> <r> : "ɍ" U024D # LATIN SMALL LETTER R WITH STROKE
+<dead_stroke> <U> : "Ʉ" U0244 # LATIN CAPITAL LETTER U BAR
+<dead_stroke> <u> : "ʉ" U0289 # LATIN SMALL LETTER U BAR
+<dead_stroke> <Y> : "Ɏ" U024E # LATIN CAPITAL LETTER Y WITH STROKE
+<dead_stroke> <y> : "ɏ" U024F # LATIN SMALL LETTER Y WITH STROKE
+<dead_stroke> <dead_stroke> : "/" slash # SOLIDUS
+<dead_stroke> <nobreakspace> : "̸" U0338 # COMBINING LONG SOLIDUS OVERLAY
+<dead_stroke> <space> : "/" slash # SOLIDUS
+<dead_tilde> <Oacute> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
+<dead_tilde> <Odiaeresis> : "Ṏ" U1E4E # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
+<dead_tilde> <Omacron> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
+<dead_tilde> <oacute> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
+<dead_tilde> <odiaeresis> : "ṏ" U1E4F # LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
+<dead_tilde> <omacron> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
+<dead_tilde> <Uacute> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
+<dead_tilde> <uacute> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
+<dead_tilde> <equal> : "≃" similarequal # ASYMPTOTICALLY EQUAL TO
+<dead_tilde> <less> : "≲" U2272 # LESS-THAN OR EQUIVALENT TO
+<dead_tilde> <greater> : "≳" U2273 # GREATER-THAN OR EQUIVALENT TO
+<dead_tilde> <nobreakspace> : "̃" U0303 # COMBINING TILDE
+<dead_acute> <dead_abovedot> <S> : "Ṥ" U1E64 # LATIN CAPITAL LETTER S WITH ACUTE AND DOT ABOVE
+<dead_acute> <dead_abovedot> <s> : "ṥ" U1E65 # LATIN SMALL LETTER S WITH ACUTE AND DOT ABOVE
+<dead_belowdot> <dead_abovedot> <S> : "Ṩ" U1E68 # LATIN CAPITAL LETTER S WITH DOT BELOW AND DOT ABOVE
+<dead_belowdot> <dead_abovedot> <s> : "ṩ" U1E69 # LATIN SMALL LETTER S WITH DOT BELOW AND DOT ABOVE
+<dead_caron> <dead_abovedot> <S> : "Ṧ" U1E66 # LATIN CAPITAL LETTER S WITH CARON AND DOT ABOVE
+<dead_caron> <dead_abovedot> <s> : "ṧ" U1E67 # LATIN SMALL LETTER S WITH CARON AND DOT ABOVE
+<dead_abovedot> <dead_macron> <A> : "Ǡ" U01E0 # LATIN CAPITAL LETTER A WITH DOT ABOVE AND MACRON
+<dead_abovedot> <dead_macron> <a> : "ǡ" U01E1 # LATIN SMALL LETTER A WITH DOT ABOVE AND MACRON
+<dead_abovedot> <dead_macron> <O> : "Ȱ" U0230 # LATIN CAPITAL LETTER O WITH DOT ABOVE AND MACRON
+<dead_abovedot> <dead_macron> <o> : "ȱ" U0231 # LATIN SMALL LETTER O WITH DOT ABOVE AND MACRON
+<dead_abovedot> <dead_stroke> <j> : "ɟ" U025F # LATIN SMALL LETTER DOTLESS J WITH STROKE
+<dead_stroke> <dead_abovedot> <j> : "ɟ" U025F # LATIN SMALL LETTER DOTLESS J WITH STROKE
+<dead_breve> <dead_acute> <A> : "Ắ" Abreveacute # LATIN CAPITAL LETTER A WITH BREVE AND ACUTE
+<dead_breve> <dead_acute> <a> : "ắ" abreveacute # LATIN SMALL LETTER A WITH BREVE AND ACUTE
+<dead_cedilla> <dead_acute> <C> : "Ḉ" U1E08 # LATIN CAPITAL LETTER C WITH CEDILLA AND ACUTE
+<dead_cedilla> <dead_acute> <c> : "ḉ" U1E09 # LATIN SMALL LETTER C WITH CEDILLA AND ACUTE
+<dead_circumflex> <dead_acute> <A> : "Ấ" Acircumflexacute # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE
+<dead_circumflex> <dead_acute> <a> : "ấ" acircumflexacute # LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE
+<dead_circumflex> <dead_acute> <E> : "Ế" Ecircumflexacute # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE
+<dead_circumflex> <dead_acute> <e> : "ế" ecircumflexacute # LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE
+<dead_circumflex> <dead_acute> <O> : "Ố" Ocircumflexacute # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE
+<dead_circumflex> <dead_acute> <o> : "ố" ocircumflexacute # LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE
+<dead_diaeresis> <dead_acute> <I> : "Ḯ" U1E2E # LATIN CAPITAL LETTER I WITH DIAERESIS AND ACUTE
+<dead_diaeresis> <dead_acute> <i> : "ḯ" U1E2F # LATIN SMALL LETTER I WITH DIAERESIS AND ACUTE
+<dead_diaeresis> <dead_acute> <U> : "Ǘ" U01D7 # LATIN CAPITAL LETTER U WITH DIAERESIS AND ACUTE
+<dead_diaeresis> <dead_acute> <u> : "ǘ" U01D8 # LATIN SMALL LETTER U WITH DIAERESIS AND ACUTE
+<dead_horn> <dead_acute> <O> : "Ớ" Ohornacute # LATIN CAPITAL LETTER O WITH HORN AND ACUTE
+<dead_horn> <dead_acute> <o> : "ớ" ohornacute # LATIN SMALL LETTER O WITH HORN AND ACUTE
+<dead_horn> <dead_acute> <U> : "Ứ" Uhornacute # LATIN CAPITAL LETTER U WITH HORN AND ACUTE
+<dead_horn> <dead_acute> <u> : "ứ" uhornacute # LATIN SMALL LETTER U WITH HORN AND ACUTE
+<dead_macron> <dead_acute> <E> : "Ḗ" U1E16 # LATIN CAPITAL LETTER E WITH MACRON AND ACUTE
+<dead_macron> <dead_acute> <e> : "ḗ" U1E17 # LATIN SMALL LETTER E WITH MACRON AND ACUTE
+<dead_macron> <dead_acute> <O> : "Ṓ" U1E52 # LATIN CAPITAL LETTER O WITH MACRON AND ACUTE
+<dead_macron> <dead_acute> <o> : "ṓ" U1E53 # LATIN SMALL LETTER O WITH MACRON AND ACUTE
+<dead_abovering> <dead_acute> <A> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
+<dead_abovering> <dead_acute> <a> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
+<dead_tilde> <dead_acute> <O> : "Ṍ" U1E4C # LATIN CAPITAL LETTER O WITH TILDE AND ACUTE
+<dead_tilde> <dead_acute> <o> : "ṍ" U1E4D # LATIN SMALL LETTER O WITH TILDE AND ACUTE
+<dead_tilde> <dead_acute> <U> : "Ṹ" U1E78 # LATIN CAPITAL LETTER U WITH TILDE AND ACUTE
+<dead_tilde> <dead_acute> <u> : "ṹ" U1E79 # LATIN SMALL LETTER U WITH TILDE AND ACUTE
+<dead_belowdot> <dead_breve> <A> : "Ặ" Abrevebelowdot # LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW
+<dead_belowdot> <dead_breve> <a> : "ặ" abrevebelowdot # LATIN SMALL LETTER A WITH BREVE AND DOT BELOW
+<dead_belowdot> <dead_circumflex> <A> : "Ậ" Acircumflexbelowdot # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+<dead_belowdot> <dead_circumflex> <a> : "ậ" acircumflexbelowdot # LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW
+<dead_belowdot> <dead_circumflex> <E> : "Ệ" Ecircumflexbelowdot # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+<dead_belowdot> <dead_circumflex> <e> : "ệ" ecircumflexbelowdot # LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW
+<dead_belowdot> <dead_circumflex> <O> : "Ộ" Ocircumflexbelowdot # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+<dead_belowdot> <dead_circumflex> <o> : "ộ" ocircumflexbelowdot # LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW
+<dead_horn> <dead_belowdot> <O> : "Ợ" Ohornbelowdot # LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW
+<dead_horn> <dead_belowdot> <o> : "ợ" ohornbelowdot # LATIN SMALL LETTER O WITH HORN AND DOT BELOW
+<dead_horn> <dead_belowdot> <U> : "Ự" Uhornbelowdot # LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW
+<dead_horn> <dead_belowdot> <u> : "ự" uhornbelowdot # LATIN SMALL LETTER U WITH HORN AND DOT BELOW
+<dead_belowdot> <dead_macron> <L> : "Ḹ" U1E38 # LATIN CAPITAL LETTER L WITH DOT BELOW AND MACRON
+<dead_belowdot> <dead_macron> <l> : "ḹ" U1E39 # LATIN SMALL LETTER L WITH DOT BELOW AND MACRON
+<dead_belowdot> <dead_macron> <R> : "Ṝ" U1E5C # LATIN CAPITAL LETTER R WITH DOT BELOW AND MACRON
+<dead_belowdot> <dead_macron> <r> : "ṝ" U1E5D # LATIN SMALL LETTER R WITH DOT BELOW AND MACRON
+<dead_cedilla> <dead_breve> <E> : "Ḝ" U1E1C # LATIN CAPITAL LETTER E WITH CEDILLA AND BREVE
+<dead_cedilla> <dead_breve> <e> : "ḝ" U1E1D # LATIN SMALL LETTER E WITH CEDILLA AND BREVE
+<dead_breve> <dead_grave> <A> : "Ằ" Abrevegrave # LATIN CAPITAL LETTER A WITH BREVE AND GRAVE
+<dead_breve> <dead_grave> <a> : "ằ" abrevegrave # LATIN SMALL LETTER A WITH BREVE AND GRAVE
+<dead_breve> <dead_hook> <A> : "Ẳ" Abrevehook # LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE
+<dead_breve> <dead_hook> <a> : "ẳ" abrevehook # LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE
+<dead_breve> <dead_tilde> <A> : "Ẵ" Abrevetilde # LATIN CAPITAL LETTER A WITH BREVE AND TILDE
+<dead_breve> <dead_tilde> <a> : "ẵ" abrevetilde # LATIN SMALL LETTER A WITH BREVE AND TILDE
+<dead_diaeresis> <dead_caron> <U> : "Ǚ" U01D9 # LATIN CAPITAL LETTER U WITH DIAERESIS AND CARON
+<dead_diaeresis> <dead_caron> <u> : "ǚ" U01DA # LATIN SMALL LETTER U WITH DIAERESIS AND CARON
+<dead_cedilla> <dead_currency> <C> : "₵" U20B5 # CEDI SIGN
+<dead_currency> <dead_cedilla> <C> : "₵" U20B5 # CEDI SIGN
+<dead_cedilla> <dead_currency> <c> : "₵" U20B5 # CEDI SIGN
+<dead_currency> <dead_cedilla> <c> : "₵" U20B5 # CEDI SIGN
+<dead_circumflex> <dead_grave> <A> : "Ầ" Acircumflexgrave # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE
+<dead_circumflex> <dead_grave> <a> : "ầ" acircumflexgrave # LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
+<dead_circumflex> <dead_grave> <E> : "Ề" Ecircumflexgrave # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE
+<dead_circumflex> <dead_grave> <e> : "ề" ecircumflexgrave # LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE
+<dead_circumflex> <dead_grave> <O> : "Ồ" Ocircumflexgrave # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE
+<dead_circumflex> <dead_grave> <o> : "ồ" ocircumflexgrave # LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE
+<dead_circumflex> <dead_hook> <A> : "Ẩ" Acircumflexhook # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_circumflex> <dead_hook> <a> : "ẩ" acircumflexhook # LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_circumflex> <dead_hook> <E> : "Ể" Ecircumflexhook # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_circumflex> <dead_hook> <e> : "ể" ecircumflexhook # LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_circumflex> <dead_hook> <O> : "Ổ" Ocircumflexhook # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_circumflex> <dead_hook> <o> : "ổ" ocircumflexhook # LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE
+<dead_circumflex> <dead_tilde> <A> : "Ẫ" Acircumflextilde # LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE
+<dead_circumflex> <dead_tilde> <a> : "ẫ" acircumflextilde # LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE
+<dead_circumflex> <dead_tilde> <E> : "Ễ" Ecircumflextilde # LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE
+<dead_circumflex> <dead_tilde> <e> : "ễ" ecircumflextilde # LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE
+<dead_circumflex> <dead_tilde> <O> : "Ỗ" Ocircumflextilde # LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE
+<dead_circumflex> <dead_tilde> <o> : "ỗ" ocircumflextilde # LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE
+<dead_diaeresis> <dead_grave> <U> : "Ǜ" U01DB # LATIN CAPITAL LETTER U WITH DIAERESIS AND GRAVE
+<dead_diaeresis> <dead_grave> <u> : "ǜ" U01DC # LATIN SMALL LETTER U WITH DIAERESIS AND GRAVE
+<dead_diaeresis> <dead_macron> <A> : "Ǟ" U01DE # LATIN CAPITAL LETTER A WITH DIAERESIS AND MACRON
+<dead_diaeresis> <dead_macron> <a> : "ǟ" U01DF # LATIN SMALL LETTER A WITH DIAERESIS AND MACRON
+<dead_diaeresis> <dead_macron> <O> : "Ȫ" U022A # LATIN CAPITAL LETTER O WITH DIAERESIS AND MACRON
+<dead_diaeresis> <dead_macron> <o> : "ȫ" U022B # LATIN SMALL LETTER O WITH DIAERESIS AND MACRON
+<dead_tilde> <dead_diaeresis> <O> : "Ṏ" U1E4E # LATIN CAPITAL LETTER O WITH TILDE AND DIAERESIS
+<dead_tilde> <dead_diaeresis> <o> : "ṏ" U1E4F # LATIN SMALL LETTER O WITH TILDE AND DIAERESIS
+<dead_horn> <dead_grave> <O> : "Ờ" Ohorngrave # LATIN CAPITAL LETTER O WITH HORN AND GRAVE
+<dead_horn> <dead_grave> <o> : "ờ" ohorngrave # LATIN SMALL LETTER O WITH HORN AND GRAVE
+<dead_horn> <dead_grave> <U> : "Ừ" Uhorngrave # LATIN CAPITAL LETTER U WITH HORN AND GRAVE
+<dead_horn> <dead_grave> <u> : "ừ" uhorngrave # LATIN SMALL LETTER U WITH HORN AND GRAVE
+<dead_macron> <dead_grave> <E> : "Ḕ" U1E14 # LATIN CAPITAL LETTER E WITH MACRON AND GRAVE
+<dead_macron> <dead_grave> <e> : "ḕ" U1E15 # LATIN SMALL LETTER E WITH MACRON AND GRAVE
+<dead_macron> <dead_grave> <O> : "Ṑ" U1E50 # LATIN CAPITAL LETTER O WITH MACRON AND GRAVE
+<dead_macron> <dead_grave> <o> : "ṑ" U1E51 # LATIN SMALL LETTER O WITH MACRON AND GRAVE
+<dead_horn> <dead_hook> <O> : "Ở" Ohornhook # LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE
+<dead_horn> <dead_hook> <o> : "ở" ohornhook # LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE
+<dead_horn> <dead_hook> <U> : "Ử" Uhornhook # LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE
+<dead_horn> <dead_hook> <u> : "ử" uhornhook # LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE
+<dead_horn> <dead_tilde> <O> : "Ỡ" Ohorntilde # LATIN CAPITAL LETTER O WITH HORN AND TILDE
+<dead_horn> <dead_tilde> <o> : "ỡ" ohorntilde # LATIN SMALL LETTER O WITH HORN AND TILDE
+<dead_horn> <dead_tilde> <U> : "Ữ" Uhorntilde # LATIN CAPITAL LETTER U WITH HORN AND TILDE
+<dead_horn> <dead_tilde> <u> : "ữ" uhorntilde # LATIN SMALL LETTER U WITH HORN AND TILDE
+<dead_ogonek> <dead_macron> <O> : "Ǭ" U01EC # LATIN CAPITAL LETTER O WITH OGONEK AND MACRON
+<dead_ogonek> <dead_macron> <o> : "ǭ" U01ED # LATIN SMALL LETTER O WITH OGONEK AND MACRON
+<dead_tilde> <dead_macron> <O> : "Ȭ" U022C # LATIN CAPITAL LETTER O WITH TILDE AND MACRON
+<dead_tilde> <dead_macron> <o> : "ȭ" U022D # LATIN SMALL LETTER O WITH TILDE AND MACRON
+
+XCOMM
+XCOMM Cyrillic NFDs
+XCOMM
+
+<dead_doublegrave> <Cyrillic_a> : "а̏" # CYRILLIC SMALL LETTER A WITH COMBINING DOUBLE GRAVE ACCENT
+<Multi_key> <grave> <grave> <Cyrillic_a> : "а̏" # CYRILLIC SMALL LETTER A WITH COMBINING DOUBLE GRAVE ACCENT
+
+<dead_invertedbreve> <Cyrillic_a> : "а̑" # CYRILLIC SMALL LETTER A WITH COMBINING INVERTED BREVE
+
+<dead_grave> <Cyrillic_a> : "а̀" # CYRILLIC SMALL LETTER A WITH COMBINING GRAVE ACCENT
+<Multi_key> <grave> <Cyrillic_a> : "а̀" # CYRILLIC SMALL LETTER A WITH COMBINING GRAVE ACCENT
+
+<dead_acute> <Cyrillic_a> : "а́" # CYRILLIC SMALL LETTER A WITH COMBINING ACUTE ACCENT
+<Multi_key> <acute> <Cyrillic_a> : "а́" # CYRILLIC SMALL LETTER A WITH COMBINING ACUTE ACCENT
+<Multi_key> <apostrophe> <Cyrillic_a> : "а́" # CYRILLIC SMALL LETTER A WITH COMBINING ACUTE ACCENT
+
+<dead_macron> <Cyrillic_a> : "а̄" # CYRILLIC SMALL LETTER A WITH COMBINING MACRON
+<Multi_key> <macron> <Cyrillic_a> : "а̄" # CYRILLIC SMALL LETTER A WITH COMBINING MACRON
+<Multi_key> <underscore> <Cyrillic_a> : "а̄" # CYRILLIC SMALL LETTER A WITH COMBINING MACRON
+
+<dead_circumflex> <Cyrillic_a> : "а̂" # CYRILLIC SMALL LETTER A WITH COMBINING CIRCUMFLEX ACCENT
+<Multi_key> <asciicircum> <Cyrillic_a> : "а̂" # CYRILLIC SMALL LETTER A WITH COMBINING CIRCUMFLEX ACCENT
+
+<dead_doublegrave> <Cyrillic_A> : "А̏" # CYRILLIC CAPITAL LETTER A WITH COMBINING DOUBLE GRAVE ACCENT
+<Multi_key> <grave> <grave> <Cyrillic_A> : "А̏" # CYRILLIC CAPITAL LETTER A WITH COMBINING DOUBLE GRAVE ACCENT
+
+<dead_invertedbreve> <Cyrillic_A> : "А̑" # CYRILLIC CAPITAL LETTER A WITH COMBINING INVERTED BREVE
+
+<dead_grave> <Cyrillic_A> : "А̀" # CYRILLIC CAPITAL LETTER A WITH COMBINING GRAVE ACCENT
+<Multi_key> <grave> <Cyrillic_A> : "А̀" # CYRILLIC CAPITAL LETTER A WITH COMBINING GRAVE ACCENT
+
+<dead_acute> <Cyrillic_A> : "А́" # CYRILLIC CAPITAL LETTER A WITH COMBINING ACUTE ACCENT
+<Multi_key> <acute> <Cyrillic_A> : "А́" # CYRILLIC CAPITAL LETTER A WITH COMBINING ACUTE ACCENT
+<Multi_key> <apostrophe> <Cyrillic_A> : "А́" # CYRILLIC CAPITAL LETTER A WITH COMBINING ACUTE ACCENT
+
+<dead_macron> <Cyrillic_A> : "А̄" # CYRILLIC CAPITAL LETTER A WITH COMBINING MACRON
+<Multi_key> <macron> <Cyrillic_A> : "А̄" # CYRILLIC CAPITAL LETTER A WITH COMBINING MACRON
+<Multi_key> <underscore> <Cyrillic_A> : "А̄" # CYRILLIC CAPITAL LETTER A WITH COMBINING MACRON
+
+<dead_circumflex> <Cyrillic_A> : "А̂" # CYRILLIC CAPITAL LETTER A WITH COMBINING CIRCUMFLEX ACCENT
+<Multi_key> <asciicircum> <Cyrillic_A> : "А̂" # CYRILLIC CAPITAL LETTER A WITH COMBINING CIRCUMFLEX ACCENT
+
+<dead_doublegrave> <Cyrillic_ie> : "е̏" # CYRILLIC SMALL LETTER IE WITH COMBINING DOUBLE GRAVE ACCENT
+<Multi_key> <grave> <grave> <Cyrillic_ie> : "е̏" # CYRILLIC SMALL LETTER IE WITH COMBINING DOUBLE GRAVE ACCENT
+
+<dead_invertedbreve> <Cyrillic_ie> : "е̑" # CYRILLIC SMALL LETTER IE WITH COMBINING INVERTED BREVE
+
+<dead_acute> <Cyrillic_ie> : "е́" # CYRILLIC SMALL LETTER IE WITH COMBINING ACUTE ACCENT
+<Multi_key> <acute> <Cyrillic_ie> : "е́" # CYRILLIC SMALL LETTER IE WITH COMBINING ACUTE ACCENT
+<Multi_key> <apostrophe> <Cyrillic_ie> : "е́" # CYRILLIC SMALL LETTER IE WITH COMBINING ACUTE ACCENT
+
+<dead_macron> <Cyrillic_ie> : "е̄" # CYRILLIC SMALL LETTER IE WITH COMBINING MACRON
+<Multi_key> <macron> <Cyrillic_ie> : "е̄" # CYRILLIC SMALL LETTER IE WITH COMBINING MACRON
+<Multi_key> <underscore> <Cyrillic_ie> : "е̄" # CYRILLIC SMALL LETTER IE WITH COMBINING MACRON
+
+<dead_circumflex> <Cyrillic_ie> : "е̂" # CYRILLIC SMALL LETTER IE WITH COMBINING CIRCUMFLEX ACCENT
+<Multi_key> <asciicircum> <Cyrillic_ie> : "е̂" # CYRILLIC SMALL LETTER IE WITH COMBINING CIRCUMFLEX ACCENT
+
+<dead_doublegrave> <Cyrillic_IE> : "Е̏" # CYRILLIC CAPITAL LETTER IE WITH COMBINING DOUBLE GRAVE ACCENT
+<Multi_key> <grave> <grave> <Cyrillic_IE> : "Е̏" # CYRILLIC CAPITAL LETTER IE WITH COMBINING DOUBLE GRAVE ACCENT
+
+<dead_invertedbreve> <Cyrillic_IE> : "Е̑" # CYRILLIC CAPITAL LETTER IE WITH COMBINING INVERTED BREVE
+
+<dead_acute> <Cyrillic_IE> : "Е́" # CYRILLIC CAPITAL LETTER IE WITH COMBINING ACUTE ACCENT
+<Multi_key> <acute> <Cyrillic_IE> : "Е́" # CYRILLIC CAPITAL LETTER IE WITH COMBINING ACUTE ACCENT
+<Multi_key> <apostrophe> <Cyrillic_IE> : "Е́" # CYRILLIC CAPITAL LETTER IE WITH COMBINING ACUTE ACCENT
+
+<dead_macron> <Cyrillic_IE> : "Е̄" # CYRILLIC CAPITAL LETTER IE WITH COMBINING MACRON
+<Multi_key> <macron> <Cyrillic_IE> : "Е̄" # CYRILLIC CAPITAL LETTER IE WITH COMBINING MACRON
+<Multi_key> <underscore> <Cyrillic_IE> : "Е̄" # CYRILLIC CAPITAL LETTER IE WITH COMBINING MACRON
+
+<dead_circumflex> <Cyrillic_IE> : "Е̂" # CYRILLIC CAPITAL LETTER IE WITH COMBINING CIRCUMFLEX ACCENT
+<Multi_key> <asciicircum> <Cyrillic_IE> : "Е̂" # CYRILLIC CAPITAL LETTER IE WITH COMBINING CIRCUMFLEX ACCENT
+
+<dead_doublegrave> <Cyrillic_i> : "и̏" # CYRILLIC SMALL LETTER I WITH COMBINING DOUBLE GRAVE ACCENT
+<Multi_key> <grave> <grave> <Cyrillic_i> : "и̏" # CYRILLIC SMALL LETTER I WITH COMBINING DOUBLE GRAVE ACCENT
+
+<dead_invertedbreve> <Cyrillic_i> : "и̑" # CYRILLIC SMALL LETTER I WITH COMBINING INVERTED BREVE
+
+<dead_acute> <Cyrillic_i> : "и́" # CYRILLIC SMALL LETTER I WITH COMBINING ACUTE ACCENT
+<Multi_key> <acute> <Cyrillic_i> : "и́" # CYRILLIC SMALL LETTER I WITH COMBINING ACUTE ACCENT
+<Multi_key> <apostrophe> <Cyrillic_i> : "и́" # CYRILLIC SMALL LETTER I WITH COMBINING ACUTE ACCENT
+
+<dead_circumflex> <Cyrillic_i> : "и̂" # CYRILLIC SMALL LETTER I WITH COMBINING CIRCUMFLEX ACCENT
+<Multi_key> <asciicircum> <Cyrillic_i> : "и̂" # CYRILLIC SMALL LETTER I WITH COMBINING CIRCUMFLEX ACCENT
+
+<dead_doublegrave> <Cyrillic_I> : "И̏" # CYRILLIC CAPITAL LETTER I WITH COMBINING DOUBLE GRAVE ACCENT
+<Multi_key> <grave> <grave> <Cyrillic_I> : "И̏" # CYRILLIC CAPITAL LETTER I WITH COMBINING DOUBLE GRAVE ACCENT
+
+<dead_invertedbreve> <Cyrillic_I> : "И̑" # CYRILLIC CAPITAL LETTER I WITH COMBINING INVERTED BREVE
+
+<dead_acute> <Cyrillic_I> : "И́" # CYRILLIC CAPITAL LETTER I WITH COMBINING ACUTE ACCENT
+<Multi_key> <acute> <Cyrillic_I> : "И́" # CYRILLIC CAPITAL LETTER I WITH COMBINING ACUTE ACCENT
+<Multi_key> <apostrophe> <Cyrillic_I> : "И́" # CYRILLIC CAPITAL LETTER I WITH COMBINING ACUTE ACCENT
+
+<dead_circumflex> <Cyrillic_I> : "И̂" # CYRILLIC CAPITAL LETTER I WITH COMBINING CIRCUMFLEX ACCENT
+<Multi_key> <asciicircum> <Cyrillic_I> : "И̂" # CYRILLIC CAPITAL LETTER I WITH COMBINING CIRCUMFLEX ACCENT
+
+<dead_doublegrave> <Cyrillic_o> : "о̏" # CYRILLIC SMALL LETTER O WITH COMBINING DOUBLE GRAVE ACCENT
+<Multi_key> <grave> <grave> <Cyrillic_o> : "о̏" # CYRILLIC SMALL LETTER O WITH COMBINING DOUBLE GRAVE ACCENT
+
+<dead_invertedbreve> <Cyrillic_o> : "о̑" # CYRILLIC SMALL LETTER O WITH COMBINING INVERTED BREVE
+
+<dead_grave> <Cyrillic_o> : "о̀" # CYRILLIC SMALL LETTER O WITH COMBINING GRAVE ACCENT
+<Multi_key> <grave> <Cyrillic_o> : "о̀" # CYRILLIC SMALL LETTER O WITH COMBINING GRAVE ACCENT
+
+<dead_acute> <Cyrillic_o> : "о́" # CYRILLIC SMALL LETTER O WITH COMBINING ACUTE ACCENT
+<Multi_key> <acute> <Cyrillic_o> : "о́" # CYRILLIC SMALL LETTER O WITH COMBINING ACUTE ACCENT
+<Multi_key> <apostrophe> <Cyrillic_o> : "о́" # CYRILLIC SMALL LETTER O WITH COMBINING ACUTE ACCENT
+
+<dead_macron> <Cyrillic_o> : "о̄" # CYRILLIC SMALL LETTER O WITH COMBINING MACRON
+<Multi_key> <macron> <Cyrillic_o> : "о̄" # CYRILLIC SMALL LETTER O WITH COMBINING MACRON
+<Multi_key> <underscore> <Cyrillic_o> : "о̄" # CYRILLIC SMALL LETTER O WITH COMBINING MACRON
+
+<dead_circumflex> <Cyrillic_o> : "о̂" # CYRILLIC SMALL LETTER O WITH COMBINING CIRCUMFLEX ACCENT
+<Multi_key> <asciicircum> <Cyrillic_o> : "о̂" # CYRILLIC SMALL LETTER O WITH COMBINING CIRCUMFLEX ACCENT
+
+<dead_doublegrave> <Cyrillic_O> : "О̏" # CYRILLIC CAPITAL LETTER O WITH COMBINING DOUBLE GRAVE ACCENT
+<Multi_key> <grave> <grave> <Cyrillic_O> : "О̏" # CYRILLIC CAPITAL LETTER O WITH COMBINING DOUBLE GRAVE ACCENT
+
+<dead_invertedbreve> <Cyrillic_O> : "О̑" # CYRILLIC CAPITAL LETTER O WITH COMBINING INVERTED BREVE
+
+<dead_grave> <Cyrillic_O> : "О̀" # CYRILLIC CAPITAL LETTER O WITH COMBINING GRAVE ACCENT
+<Multi_key> <grave> <Cyrillic_O> : "О̀" # CYRILLIC CAPITAL LETTER O WITH COMBINING GRAVE ACCENT
+
+<dead_acute> <Cyrillic_O> : "О́" # CYRILLIC CAPITAL LETTER O WITH COMBINING ACUTE ACCENT
+<Multi_key> <acute> <Cyrillic_O> : "О́" # CYRILLIC CAPITAL LETTER O WITH COMBINING ACUTE ACCENT
+<Multi_key> <apostrophe> <Cyrillic_O> : "О́" # CYRILLIC CAPITAL LETTER O WITH COMBINING ACUTE ACCENT
+
+<dead_macron> <Cyrillic_O> : "О̄" # CYRILLIC CAPITAL LETTER O WITH COMBINING MACRON
+<Multi_key> <macron> <Cyrillic_O> : "О̄" # CYRILLIC CAPITAL LETTER O WITH COMBINING MACRON
+<Multi_key> <underscore> <Cyrillic_O> : "О̄" # CYRILLIC CAPITAL LETTER O WITH COMBINING MACRON
+
+<dead_circumflex> <Cyrillic_O> : "О̂" # CYRILLIC CAPITAL LETTER O WITH COMBINING CIRCUMFLEX ACCENT
+<Multi_key> <asciicircum> <Cyrillic_O> : "О̂" # CYRILLIC CAPITAL LETTER O WITH COMBINING CIRCUMFLEX ACCENT
+
+<dead_doublegrave> <Cyrillic_u> : "у̏" # CYRILLIC SMALL LETTER U WITH COMBINING DOUBLE GRAVE ACCENT
+<Multi_key> <grave> <grave> <Cyrillic_u> : "у̏" # CYRILLIC SMALL LETTER U WITH COMBINING DOUBLE GRAVE ACCENT
+
+<dead_invertedbreve> <Cyrillic_u> : "у̑" # CYRILLIC SMALL LETTER U WITH COMBINING INVERTED BREVE
+
+<dead_grave> <Cyrillic_u> : "у̀" # CYRILLIC SMALL LETTER U WITH COMBINING GRAVE ACCENT
+<Multi_key> <grave> <Cyrillic_u> : "у̀" # CYRILLIC SMALL LETTER U WITH COMBINING GRAVE ACCENT
+
+<dead_acute> <Cyrillic_u> : "у́" # CYRILLIC SMALL LETTER U WITH COMBINING ACUTE ACCENT
+<Multi_key> <acute> <Cyrillic_u> : "у́" # CYRILLIC SMALL LETTER U WITH COMBINING ACUTE ACCENT
+<Multi_key> <apostrophe> <Cyrillic_u> : "у́" # CYRILLIC SMALL LETTER U WITH COMBINING ACUTE ACCENT
+
+<dead_circumflex> <Cyrillic_u> : "у̂" # CYRILLIC SMALL LETTER U WITH COMBINING CIRCUMFLEX ACCENT
+<Multi_key> <asciicircum> <Cyrillic_u> : "у̂" # CYRILLIC SMALL LETTER U WITH COMBINING CIRCUMFLEX ACCENT
+
+<dead_doublegrave> <Cyrillic_U> : "У̏" # CYRILLIC CAPITAL LETTER U WITH COMBINING DOUBLE GRAVE ACCENT
+<Multi_key> <grave> <grave> <Cyrillic_U> : "У̏" # CYRILLIC CAPITAL LETTER U WITH COMBINING DOUBLE GRAVE ACCENT
+
+<dead_invertedbreve> <Cyrillic_U> : "У̑" # CYRILLIC CAPITAL LETTER U WITH COMBINING INVERTED BREVE
+
+<dead_grave> <Cyrillic_U> : "У̀" # CYRILLIC CAPITAL LETTER U WITH COMBINING GRAVE ACCENT
+<Multi_key> <grave> <Cyrillic_U> : "У̀" # CYRILLIC CAPITAL LETTER U WITH COMBINING GRAVE ACCENT
+
+<dead_acute> <Cyrillic_U> : "У́" # CYRILLIC CAPITAL LETTER U WITH COMBINING ACUTE ACCENT
+<Multi_key> <acute> <Cyrillic_U> : "У́" # CYRILLIC CAPITAL LETTER U WITH COMBINING ACUTE ACCENT
+<Multi_key> <apostrophe> <Cyrillic_U> : "У́" # CYRILLIC CAPITAL LETTER U WITH COMBINING ACUTE ACCENT
+
+<dead_circumflex> <Cyrillic_U> : "У̂" # CYRILLIC CAPITAL LETTER U WITH COMBINING CIRCUMFLEX ACCENT
+<Multi_key> <asciicircum> <Cyrillic_U> : "У̂" # CYRILLIC CAPITAL LETTER U WITH COMBINING CIRCUMFLEX ACCENT
+
+<dead_doublegrave> <Cyrillic_er> : "р̏" # CYRILLIC SMALL LETTER ER WITH COMBINING DOUBLE GRAVE ACCENT
+<Multi_key> <grave> <grave> <Cyrillic_er> : "р̏" # CYRILLIC SMALL LETTER ER WITH COMBINING DOUBLE GRAVE ACCENT
+
+<dead_invertedbreve> <Cyrillic_er> : "р̑" # CYRILLIC SMALL LETTER ER WITH COMBINING INVERTED BREVE
+
+<dead_grave> <Cyrillic_er> : "р̀" # CYRILLIC SMALL LETTER ER WITH COMBINING GRAVE ACCENT
+<Multi_key> <grave> <Cyrillic_er> : "р̀" # CYRILLIC SMALL LETTER ER WITH COMBINING GRAVE ACCENT
+
+<dead_acute> <Cyrillic_er> : "р́" # CYRILLIC SMALL LETTER ER WITH COMBINING ACUTE ACCENT
+<Multi_key> <acute> <Cyrillic_er> : "р́" # CYRILLIC SMALL LETTER ER WITH COMBINING ACUTE ACCENT
+<Multi_key> <apostrophe> <Cyrillic_er> : "р́" # CYRILLIC SMALL LETTER ER WITH COMBINING ACUTE ACCENT
+
+<dead_macron> <Cyrillic_er> : "р̄" # CYRILLIC SMALL LETTER ER WITH COMBINING MACRON
+<Multi_key> <macron> <Cyrillic_er> : "р̄" # CYRILLIC SMALL LETTER ER WITH COMBINING MACRON
+<Multi_key> <underscore> <Cyrillic_er> : "р̄" # CYRILLIC SMALL LETTER ER WITH COMBINING MACRON
+
+<dead_circumflex> <Cyrillic_er> : "р̂" # CYRILLIC SMALL LETTER ER WITH COMBINING CIRCUMFLEX ACCENT
+<Multi_key> <asciicircum> <Cyrillic_er> : "р̂" # CYRILLIC SMALL LETTER ER WITH COMBINING CIRCUMFLEX ACCENT
+
+<dead_doublegrave> <Cyrillic_ER> : "Р̏" # CYRILLIC CAPITAL LETTER ER WITH COMBINING DOUBLE GRAVE ACCENT
+<Multi_key> <grave> <grave> <Cyrillic_ER> : "Р̏" # CYRILLIC CAPITAL LETTER ER WITH COMBINING DOUBLE GRAVE ACCENT
+
+<dead_invertedbreve> <Cyrillic_ER> : "Р̑" # CYRILLIC CAPITAL LETTER ER WITH COMBINING INVERTED BREVE
+
+<dead_grave> <Cyrillic_ER> : "Р̀" # CYRILLIC CAPITAL LETTER ER WITH COMBINING GRAVE ACCENT
+<Multi_key> <grave> <Cyrillic_ER> : "Р̀" # CYRILLIC CAPITAL LETTER ER WITH COMBINING GRAVE ACCENT
+
+<dead_acute> <Cyrillic_ER> : "Р́" # CYRILLIC CAPITAL LETTER ER WITH COMBINING ACUTE ACCENT
+<Multi_key> <acute> <Cyrillic_ER> : "Р́" # CYRILLIC CAPITAL LETTER ER WITH COMBINING ACUTE ACCENT
+<Multi_key> <apostrophe> <Cyrillic_ER> : "Р́" # CYRILLIC CAPITAL LETTER ER WITH COMBINING ACUTE ACCENT
+
+<dead_macron> <Cyrillic_ER> : "Р̄" # CYRILLIC CAPITAL LETTER ER WITH COMBINING MACRON
+<Multi_key> <macron> <Cyrillic_ER> : "Р̄" # CYRILLIC CAPITAL LETTER ER WITH COMBINING MACRON
+<Multi_key> <underscore> <Cyrillic_ER> : "Р̄" # CYRILLIC CAPITAL LETTER ER WITH COMBINING MACRON
+
+<dead_circumflex> <Cyrillic_ER> : "Р̂" # CYRILLIC CAPITAL LETTER ER WITH COMBINING CIRCUMFLEX ACCENT
+<Multi_key> <asciicircum> <Cyrillic_ER> : "Р̂" # CYRILLIC CAPITAL LETTER ER WITH COMBINING CIRCUMFLEX ACCENT
+
+<Multi_key> <backslash> <o> <slash> : "🙌" # PERSON RAISING BOTH HANDS IN CELEBRATION
diff --git a/libX11/specs/i18n/localedb/localedb.xml b/libX11/specs/i18n/localedb/localedb.xml
index 6b81b771c..c2feccff8 100644
--- a/libX11/specs/i18n/localedb/localedb.xml
+++ b/libX11/specs/i18n/localedb/localedb.xml
@@ -16,10 +16,9 @@
<affiliation><orgname>IBM Japan</orgname></affiliation>
</author>
</authorgroup>
+ <copyright><year>1994</year><holder>IBM Corporation</holder></copyright>
<legalnotice>
-
-<para role="multiLicensing">Copyright © 1994 IBM Corporation</para>
<para>
License to use, copy, modify, and distribute this software and its documentation for
any purpose and without fee is hereby granted, provided that the above copyright notice
@@ -36,7 +35,9 @@ OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER I
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
</para>
+</legalnotice>
+<legalnotice>
<para role="multiLicensing">Copyright © 1994 X Consortium</para>
<para>
Permission is hereby granted, free of charge, to any person obtaining a copy
diff --git a/libX11/specs/libX11/libX11.xml b/libX11/specs/libX11/libX11.xml
index 812c992bb..4fb057587 100644
--- a/libX11/specs/libX11/libX11.xml
+++ b/libX11/specs/libX11/libX11.xml
@@ -60,10 +60,12 @@
<affiliation><orgname>Fujitsu OSSI</orgname></affiliation>
</othercredit>
</authorgroup>
+ <copyright><year>1985</year><year>1986</year><year>1987</year>
+ <year>1988</year><year>1989</year><year>1991</year><year>1994</year>
+ <year>1996</year><year>2002</year><holder>The Open Group</holder>
+ </copyright>
<legalnotice>
-
-<para role="multiLicensing">Copyright © 1985, 1986, 1987, 1988, 1989, 1991, 1994, 1996, 2002 The Open Group</para>
<para>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files
@@ -73,27 +75,26 @@ distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following
conditions:
</para>
-
<para>
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
</para>
-
<para>
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+THE SOFTWARE IS PROVIDED &ldquo;AS IS&rdquo;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</para>
-
<para>
Except as contained in this notice, the name of The Open Group shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
</para>
+</legalnotice>
+<legalnotice>
<para role="multiLicensing">Copyright © 1985, 1986, 1987, 1988, 1989, 1991 Digital Equipment Corporation</para>
<para>
Permission to use, copy, modify and distribute this documentation for any
@@ -104,7 +105,7 @@ Digital and Tetronix not be used in in advertising or publicity pertaining
to distribution of the software without specific, written prior permission.
Digital and Tetronix make no representations about the suitability of the
software described herein for any purpose.
-It is provided "as is" without express or implied warranty.
+It is provided &ldquo;as is&rdquo; without express or implied warranty.
</para>
diff --git a/libXext/specs/dbelib.xml b/libXext/specs/dbelib.xml
index d3616fc36..b0001b321 100644
--- a/libXext/specs/dbelib.xml
+++ b/libXext/specs/dbelib.xml
@@ -19,11 +19,11 @@
<firstname>Ian</firstname><surname>Elliot</surname>
<affiliation><orgname>Hewlett-Packard Company</orgname></affiliation>
</author>
+ <othercredit>
+ <firstname>David</firstname><othername>P.</othername><surname>Wiggins</surname>
+ <affiliation><orgname>X Consortium, Inc</orgname></affiliation>
+ </othercredit>
</authorgroup>
- <othercredit>
- <firstname>David</firstname><othername>P.</othername><surname>Wiggins</surname>
- <affiliation><orgname>X Consortium, Inc</orgname></affiliation>
- </othercredit>
<copyright><year>1989</year>
<holder>X Consortium Inc</holder>
<holder>Digital Equipment Corporation</holder>
diff --git a/libXext/specs/dpmslib.xml b/libXext/specs/dpmslib.xml
index 93e6398c7..60565b536 100644
--- a/libXext/specs/dpmslib.xml
+++ b/libXext/specs/dpmslib.xml
@@ -33,9 +33,7 @@ of the information in this document. This documentation is
provided "as is" without express or implied warranty.
</para>
-<para>
-<emphasis remap='I'>X Window System</emphasis> is a trademark of The Open Group.
-</para>
+<para>X Window System is a trademark of The Open Group.</para>
</legalnotice>
</bookinfo>
diff --git a/libXext/specs/shapelib.xml b/libXext/specs/shapelib.xml
index 9a158ee61..525cbbe6e 100644
--- a/libXext/specs/shapelib.xml
+++ b/libXext/specs/shapelib.xml
@@ -19,7 +19,6 @@
<affiliation><orgname>MIT X Consortium</orgname></affiliation>
</author>
</authorgroup>
- <corpname>MIT X Consortium</corpname>
<copyright><year>1989</year><holder>X Consortium</holder></copyright>
<legalnotice>
@@ -54,6 +53,7 @@ Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.
</para>
+<para>X Window System is a trademark of The OpenGroup.</para>
</legalnotice>
</bookinfo>
diff --git a/libXext/specs/synclib.xml b/libXext/specs/synclib.xml
index 51b7cf5e3..12145eb2d 100644
--- a/libXext/specs/synclib.xml
+++ b/libXext/specs/synclib.xml
@@ -45,12 +45,12 @@
<affiliation><orgname>X Consortium, Inc.</orgname></affiliation>
</author>
</authorgroup>
-<legalnotice>
-
-<para>
-Copyright 1991 by Olivetti Research Limited, Cambridge England and Digital Equipment Corporation, Maynard, Massachusetts
-</para>
+ <copyright><year>1991</year>
+ <holder>Olivetti Research Limited, Cambridge England</holder>
+ <holder>Digital Equipment Corporation, Maynard, Massachusetts</holder>
+ </copyright>
+<legalnotice>
<para>
Permission to use, copy, modify, and distribute this documentation for any
purpose and without fee is hereby granted, provided that the above
@@ -62,11 +62,7 @@ is without express or implied warranty.
</legalnotice>
<legalnotice>
-
-<para>
-Copyright &copy; 1991 X Consortium, Inc.
-</para>
-
+<para role="multiLicensing">Copyright &copy; 1991 X Consortium, Inc.</para>
<para>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files
@@ -82,7 +78,7 @@ The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
</para>
-<para>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+<para>THE SOFTWARE IS PROVIDED &ldquo;AS IS&rdquo;, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
@@ -97,6 +93,7 @@ not be used in advertising or otherwise to promote the sale, use or other
dealings in this Software without prior written authorization from the
X Consortium.
</para>
+<para>X Window System is a trademark of The OpenGroup.</para>
</legalnotice>
</bookinfo>
diff --git a/libXext/specs/xtest1.xml b/libXext/specs/xtest1.xml
index 9229d273e..df05881ce 100644
--- a/libXext/specs/xtest1.xml
+++ b/libXext/specs/xtest1.xml
@@ -18,6 +18,35 @@
</authorgroup>
<copyright><year>1993</year><holder>X Consortium</holder></copyright>
+<legalnotice>
+<para>
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+</para>
+<para>
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+</para>
+<para>
+THE SOFTWARE IS PROVIDED &ldquo;AS IS&rdquo;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X
+CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+</para>
+<para>
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings in
+this Software without prior written authorization from the X Consortium.
+</para>
+<para>X Window System is a trademark of The Open Group.</para>
+</legalnotice>
+
<abstract>
<para>
This is a proposal for an extension to the X11 server and Xlib.
diff --git a/mesalib/configs/aix-64-static b/mesalib/configs/aix-64-static
index b9c878bb8..de92daf00 100644
--- a/mesalib/configs/aix-64-static
+++ b/mesalib/configs/aix-64-static
@@ -19,5 +19,3 @@ GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
- -lX11 -lXext -lXmu -lXi -lm -lpthread -lC
-
diff --git a/mesalib/configs/aix-static b/mesalib/configs/aix-static
index 0068ba413..5c36cb053 100644
--- a/mesalib/configs/aix-static
+++ b/mesalib/configs/aix-static
@@ -18,6 +18,3 @@ GLU_LIB_NAME = libGLU.a
GLW_LIB_NAME = libGLw.a
OSMESA_LIB_NAME = libOSMesa.a
- -lX11 -lXext -lXmu -lXi -lm -lpthread -lC
-
-
diff --git a/mesalib/configs/linux-osmesa-static b/mesalib/configs/linux-osmesa-static
index 00154900a..4bb15bc54 100644
--- a/mesalib/configs/linux-osmesa-static
+++ b/mesalib/configs/linux-osmesa-static
@@ -30,4 +30,3 @@ GL_LIB_DEPS =
OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLW_LIB_DEPS =
- $(EXTRA_LIB_PATH) -lX11 -lXmu -lXt -lXi -lpthread -lstdc++ -lm
diff --git a/mesalib/configs/linux-x86-64-static b/mesalib/configs/linux-x86-64-static
index dfb136f92..a066743b5 100644
--- a/mesalib/configs/linux-x86-64-static
+++ b/mesalib/configs/linux-x86-64-static
@@ -19,6 +19,3 @@ OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLW_LIB_DEPS =
-# Need to specify all libraries we may need
- -l$(GL_LIB) $(TOP)/src/mesa/pipe/softpipe/libsoftpipe.a -Wl,--end-group \
- $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXt -lXi -lpthread -lstdc++ -lm
diff --git a/mesalib/configs/linux-x86-static b/mesalib/configs/linux-x86-static
index 19151d203..255a5dd5e 100644
--- a/mesalib/configs/linux-x86-static
+++ b/mesalib/configs/linux-x86-static
@@ -19,5 +19,3 @@ OSMESA_LIB_DEPS =
GLU_LIB_DEPS =
GLW_LIB_DEPS =
-# Need to specify all libraries we may need
- -l$(GL_LIB) $(EXTRA_LIB_PATH) -lX11 -lXext -lXmu -lXt -lXi -lpthread -lstdc++ -lm
diff --git a/mesalib/configure.ac b/mesalib/configure.ac
index a686a11aa..b2606bf64 100644
--- a/mesalib/configure.ac
+++ b/mesalib/configure.ac
@@ -1636,6 +1636,9 @@ yes)
if test "$plat" = "fbdev"; then
GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/fbdev"
fi
+ if test "$plat" = "null"; then
+ GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null"
+ fi
if test "$plat" = "wayland"; then
PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \
[AC_MSG_ERROR([cannot find libwayland-client])])
diff --git a/mesalib/include/GLES2/gl2ext.h b/mesalib/include/GLES2/gl2ext.h
index 334e9cefd..4eae24635 100644
--- a/mesalib/include/GLES2/gl2ext.h
+++ b/mesalib/include/GLES2/gl2ext.h
@@ -1,7 +1,7 @@
#ifndef __gl2ext_h_
#define __gl2ext_h_
-/* $Revision: 10969 $ on $Date:: 2010-04-09 02:27:15 -0700 #$ */
+/* $Revision: 15049 $ on $Date:: 2011-07-06 17:28:16 -0700 #$ */
#ifdef __cplusplus
extern "C" {
@@ -57,6 +57,15 @@ extern "C" {
typedef void* GLeglImageOES;
#endif
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+/* GLeglImageOES defined in GL_OES_EGL_image already. */
+#define GL_TEXTURE_EXTERNAL_OES 0x8D65
+#define GL_SAMPLER_EXTERNAL_OES 0x8D66
+#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67
+#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68
+#endif
+
/* GL_OES_element_index_uint */
#ifndef GL_OES_element_index_uint
#define GL_UNSIGNED_INT 0x1405
@@ -180,6 +189,69 @@ typedef void* GLeglImageOES;
#endif
/*------------------------------------------------------------------------*
+ * ANGLE extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_ANGLE_framebuffer_blit */
+#ifndef GL_ANGLE_framebuffer_blit
+#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8
+#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA
+#endif
+
+/* GL_ANGLE_framebuffer_multisample */
+#ifndef GL_ANGLE_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56
+#define GL_MAX_SAMPLES_ANGLE 0x8D57
+#endif
+
+/*------------------------------------------------------------------------*
+ * APPLE extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_APPLE_rgb_422 */
+#ifndef GL_APPLE_rgb_422
+#define GL_RGB_422_APPLE 0x8A1F
+#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
+#endif
+
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56
+#define GL_MAX_SAMPLES_APPLE 0x8D57
+#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8
+#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA
+#endif
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_BGRA_EXT 0x80E1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_mali_shader_binary */
+#ifndef GL_ARM_mali_shader_binary
+#define GL_MALI_SHADER_BINARY_ARM 0x8F60
+#endif
+
+/* GL_ARM_rgba8 */
+/* No new tokens introduced by this extension. */
+
+/*------------------------------------------------------------------------*
* EXT extension tokens
*------------------------------------------------------------------------*/
@@ -206,6 +278,9 @@ typedef void* GLeglImageOES;
#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
#endif
+/* GL_EXT_shader_texture_lod */
+/* No new tokens introduced by this extension. */
+
/* GL_EXT_texture_filter_anisotropic */
#ifndef GL_EXT_texture_filter_anisotropic
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
@@ -228,6 +303,22 @@ typedef void* GLeglImageOES;
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
#endif
+/* GL_EXT_unpack_subimage */
+#ifndef GL_EXT_unpack_subimage
+#define GL_UNPACK_ROW_LENGTH 0x0CF2
+#define GL_UNPACK_SKIP_ROWS 0x0CF3
+#define GL_UNPACK_SKIP_PIXELS 0x0CF4
+#endif
+
+/*------------------------------------------------------------------------*
+ * DMP extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_DMP_shader_binary */
+#ifndef GL_DMP_shader_binary
+#define GL_SHADER_BINARY_DMP 0x9250
+#endif
+
/*------------------------------------------------------------------------*
* IMG extension tokens
*------------------------------------------------------------------------*/
@@ -268,13 +359,6 @@ typedef void* GLeglImageOES;
* NV extension tokens
*------------------------------------------------------------------------*/
-/* GL_NV_fence */
-#ifndef GL_NV_fence
-#define GL_ALL_COMPLETED_NV 0x84F2
-#define GL_FENCE_STATUS_NV 0x84F3
-#define GL_FENCE_CONDITION_NV 0x84F4
-#endif
-
/* GL_NV_coverage_sample */
#ifndef GL_NV_coverage_sample
#define GL_COVERAGE_COMPONENT_NV 0x8ED0
@@ -293,10 +377,90 @@ typedef void* GLeglImageOES;
#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C
#endif
+/* GL_NV_draw_buffers */
+#ifndef GL_NV_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_NV 0x8824
+#define GL_DRAW_BUFFER0_NV 0x8825
+#define GL_DRAW_BUFFER1_NV 0x8826
+#define GL_DRAW_BUFFER2_NV 0x8827
+#define GL_DRAW_BUFFER3_NV 0x8828
+#define GL_DRAW_BUFFER4_NV 0x8829
+#define GL_DRAW_BUFFER5_NV 0x882A
+#define GL_DRAW_BUFFER6_NV 0x882B
+#define GL_DRAW_BUFFER7_NV 0x882C
+#define GL_DRAW_BUFFER8_NV 0x882D
+#define GL_DRAW_BUFFER9_NV 0x882E
+#define GL_DRAW_BUFFER10_NV 0x882F
+#define GL_DRAW_BUFFER11_NV 0x8830
+#define GL_DRAW_BUFFER12_NV 0x8831
+#define GL_DRAW_BUFFER13_NV 0x8832
+#define GL_DRAW_BUFFER14_NV 0x8833
+#define GL_DRAW_BUFFER15_NV 0x8834
+#define GL_COLOR_ATTACHMENT0_NV 0x8CE0
+#define GL_COLOR_ATTACHMENT1_NV 0x8CE1
+#define GL_COLOR_ATTACHMENT2_NV 0x8CE2
+#define GL_COLOR_ATTACHMENT3_NV 0x8CE3
+#define GL_COLOR_ATTACHMENT4_NV 0x8CE4
+#define GL_COLOR_ATTACHMENT5_NV 0x8CE5
+#define GL_COLOR_ATTACHMENT6_NV 0x8CE6
+#define GL_COLOR_ATTACHMENT7_NV 0x8CE7
+#define GL_COLOR_ATTACHMENT8_NV 0x8CE8
+#define GL_COLOR_ATTACHMENT9_NV 0x8CE9
+#define GL_COLOR_ATTACHMENT10_NV 0x8CEA
+#define GL_COLOR_ATTACHMENT11_NV 0x8CEB
+#define GL_COLOR_ATTACHMENT12_NV 0x8CEC
+#define GL_COLOR_ATTACHMENT13_NV 0x8CED
+#define GL_COLOR_ATTACHMENT14_NV 0x8CEE
+#define GL_COLOR_ATTACHMENT15_NV 0x8CEF
+#endif
+
+/* GL_NV_fbo_color_attachments */
+#ifndef GL_NV_fbo_color_attachments
+#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF
+/* GL_COLOR_ATTACHMENT{0-15}_NV defined in GL_NV_draw_buffers already. */
+#endif
+
+/* GL_NV_fence */
+#ifndef GL_NV_fence
+#define GL_ALL_COMPLETED_NV 0x84F2
+#define GL_FENCE_STATUS_NV 0x84F3
+#define GL_FENCE_CONDITION_NV 0x84F4
+#endif
+
+/* GL_NV_read_buffer */
+#ifndef GL_NV_read_buffer
+#define GL_READ_BUFFER_NV 0x0C02
+#endif
+
+/* GL_NV_read_buffer_front */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_read_depth */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_read_depth_stencil */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_read_stencil */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_texture_compression_s3tc_update */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_texture_npot_2D_mipmap */
+/* No new tokens introduced by this extension. */
+
/*------------------------------------------------------------------------*
* QCOM extension tokens
*------------------------------------------------------------------------*/
+/* GL_QCOM_alpha_test */
+#ifndef GL_QCOM_alpha_test
+#define GL_ALPHA_TEST_QCOM 0x0BC0
+#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1
+#define GL_ALPHA_TEST_REF_QCOM 0x0BC2
+#endif
+
/* GL_QCOM_driver_control */
/* No new tokens introduced by this extension. */
@@ -365,6 +529,15 @@ typedef void* GLeglImageOES;
#endif
/*------------------------------------------------------------------------*
+ * VIV extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_VIV_shader_binary */
+#ifndef GL_VIV_shader_binary
+#define GL_SHADER_BINARY_VIV 0x8FC4
+#endif
+
+/*------------------------------------------------------------------------*
* End of extension tokens, start of corresponding extension functions
*------------------------------------------------------------------------*/
@@ -408,6 +581,12 @@ typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target,
typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
#endif
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+#define GL_OES_EGL_image_external 1
+/* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */
+#endif
+
/* GL_OES_element_index_uint */
#ifndef GL_OES_element_index_uint
#define GL_OES_element_index_uint 1
@@ -590,6 +769,72 @@ typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monito
#endif
/*------------------------------------------------------------------------*
+ * ANGLE extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_ANGLE_framebuffer_blit */
+#ifndef GL_ANGLE_framebuffer_blit
+#define GL_ANGLE_framebuffer_blit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+
+/* GL_ANGLE_framebuffer_multisample */
+#ifndef GL_ANGLE_framebuffer_multisample
+#define GL_ANGLE_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+
+/*------------------------------------------------------------------------*
+ * APPLE extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_APPLE_rgb_422 */
+#ifndef GL_APPLE_rgb_422
+#define GL_APPLE_rgb_422 1
+#endif
+
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_APPLE_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
+#endif
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_APPLE_texture_format_BGRA8888 1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_APPLE_texture_max_level 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_mali_shader_binary */
+#ifndef GL_ARM_mali_shader_binary
+#define GL_ARM_mali_shader_binary 1
+#endif
+
+/* GL_ARM_rgba8 */
+#ifndef GL_ARM_rgba8
+#define GL_ARM_rgba8 1
+#endif
+
+/*------------------------------------------------------------------------*
* EXT extension functions
*------------------------------------------------------------------------*/
@@ -622,6 +867,11 @@ typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GL
#define GL_EXT_read_format_bgra 1
#endif
+/* GL_EXT_shader_texture_lod */
+#ifndef GL_EXT_shader_texture_lod
+#define GL_EXT_shader_texture_lod 1
+#endif
+
/* GL_EXT_texture_filter_anisotropic */
#ifndef GL_EXT_texture_filter_anisotropic
#define GL_EXT_texture_filter_anisotropic 1
@@ -642,6 +892,20 @@ typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GL
#define GL_EXT_texture_compression_dxt1 1
#endif
+/* GL_EXT_unpack_subimage */
+#ifndef GL_EXT_unpack_subimage
+#define GL_EXT_unpack_subimage 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * DMP extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_DMP_shader_binary */
+#ifndef GL_DMP_shader_binary
+#define GL_DMP_shader_binary 1
+#endif
+
/*------------------------------------------------------------------------*
* IMG extension functions
*------------------------------------------------------------------------*/
@@ -674,13 +938,43 @@ GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum, GLsizei
GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
#endif
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
#endif
/*------------------------------------------------------------------------*
* NV extension functions
*------------------------------------------------------------------------*/
+/* GL_NV_coverage_sample */
+#ifndef GL_NV_coverage_sample
+#define GL_NV_coverage_sample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
+GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
+#endif
+typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
+typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
+#endif
+
+/* GL_NV_depth_nonlinear */
+#ifndef GL_NV_depth_nonlinear
+#define GL_NV_depth_nonlinear 1
+#endif
+
+/* GL_NV_draw_buffers */
+#ifndef GL_NV_draw_buffers
+#define GL_NV_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs);
+#endif
+typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+/* GL_NV_fbo_color_attachments */
+#ifndef GL_NV_fbo_color_attachments
+#define GL_NV_fbo_color_attachments 1
+#endif
+
/* GL_NV_fence */
#ifndef GL_NV_fence
#define GL_NV_fence 1
@@ -702,26 +996,58 @@ typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
#endif
-/* GL_NV_coverage_sample */
-#ifndef GL_NV_coverage_sample
-#define GL_NV_coverage_sample 1
+/* GL_NV_read_buffer */
+#ifndef GL_NV_read_buffer
+#define GL_NV_read_buffer 1
#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
-GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
+GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode);
#endif
-typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
-typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
+typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode);
#endif
-/* GL_NV_depth_nonlinear */
-#ifndef GL_NV_depth_nonlinear
-#define GL_NV_depth_nonlinear 1
+/* GL_NV_read_buffer_front */
+#ifndef GL_NV_read_buffer_front
+#define GL_NV_read_buffer_front 1
+#endif
+
+/* GL_NV_read_depth */
+#ifndef GL_NV_read_depth
+#define GL_NV_read_depth 1
+#endif
+
+/* GL_NV_read_depth_stencil */
+#ifndef GL_NV_read_depth_stencil
+#define GL_NV_read_depth_stencil 1
+#endif
+
+/* GL_NV_read_stencil */
+#ifndef GL_NV_read_stencil
+#define GL_NV_read_stencil 1
+#endif
+
+/* GL_NV_texture_compression_s3tc_update */
+#ifndef GL_NV_texture_compression_s3tc_update
+#define GL_NV_texture_compression_s3tc_update 1
+#endif
+
+/* GL_NV_texture_npot_2D_mipmap */
+#ifndef GL_NV_texture_npot_2D_mipmap
+#define GL_NV_texture_npot_2D_mipmap 1
#endif
/*------------------------------------------------------------------------*
* QCOM extension functions
*------------------------------------------------------------------------*/
+/* GL_QCOM_alpha_test */
+#ifndef GL_QCOM_alpha_test
+#define GL_QCOM_alpha_test 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref);
+#endif
+typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref);
+#endif
+
/* GL_QCOM_driver_control */
#ifndef GL_QCOM_driver_control
#define GL_QCOM_driver_control 1
@@ -796,6 +1122,15 @@ typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint
typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
#endif
+/*------------------------------------------------------------------------*
+ * VIV extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_VIV_shader_binary */
+#ifndef GL_VIV_shader_binary
+#define GL_VIV_shader_binary 1
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/mesalib/scons/custom.py b/mesalib/scons/custom.py
index b6d716cf4..08073162e 100644
--- a/mesalib/scons/custom.py
+++ b/mesalib/scons/custom.py
@@ -208,12 +208,10 @@ def pkg_use_modules(env, names):
prefix = name + '_'
if not 'HAVE_' + name in env:
- print 'Attempt to use unknown module %s' % name
- env.Exit(1)
+ raise Exception('Attempt to use unknown module %s' % name)
if not env['HAVE_' + name]:
- print 'Attempt to use unavailable module %s' % name
- env.Exit(1)
+ raise Exception('Attempt to use unavailable module %s' % name)
flags = {}
for flag_name, flag_value in env.Dictionary().iteritems():
diff --git a/mesalib/src/SConscript b/mesalib/src/SConscript
index 1eee8761a..0a30838de 100644
--- a/mesalib/src/SConscript
+++ b/mesalib/src/SConscript
@@ -22,9 +22,11 @@ SConscript('mesa/SConscript')
SConscript('mapi/vgapi/SConscript')
if not env['embedded']:
- SConscript('glx/SConscript')
- SConscript('egl/main/SConscript')
- SConscript('glu/sgi/SConscript')
+ if env['platform'] not in ['windows', 'darwin']:
+ SConscript('glx/SConscript')
+ if env['platform'] not in ['darwin']:
+ SConscript('egl/main/SConscript')
+ SConscript('glu/sgi/SConscript')
if env['gles']:
SConscript('mapi/shared-glapi/SConscript')
diff --git a/mesalib/src/gallium/auxiliary/util/u_blit.c b/mesalib/src/gallium/auxiliary/util/u_blit.c
index e892a4a77..87530e94a 100644
--- a/mesalib/src/gallium/auxiliary/util/u_blit.c
+++ b/mesalib/src/gallium/auxiliary/util/u_blit.c
@@ -1,790 +1,794 @@
-/**************************************************************************
- *
- * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-/**
- * @file
- * Copy/blit pixel rect between surfaces
- *
- * @author Brian Paul
- */
-
-
-#include "pipe/p_context.h"
-#include "util/u_debug.h"
-#include "pipe/p_defines.h"
-#include "util/u_inlines.h"
-#include "pipe/p_shader_tokens.h"
-#include "pipe/p_state.h"
-
-#include "util/u_blit.h"
-#include "util/u_draw_quad.h"
-#include "util/u_format.h"
-#include "util/u_math.h"
-#include "util/u_memory.h"
-#include "util/u_sampler.h"
-#include "util/u_simple_shaders.h"
-
-#include "cso_cache/cso_context.h"
-
-
-struct blit_state
-{
- struct pipe_context *pipe;
- struct cso_context *cso;
-
- struct pipe_blend_state blend;
- struct pipe_depth_stencil_alpha_state depthstencil_keep;
- struct pipe_depth_stencil_alpha_state depthstencil_write;
- struct pipe_rasterizer_state rasterizer;
- struct pipe_sampler_state sampler;
- struct pipe_viewport_state viewport;
- struct pipe_clip_state clip;
- struct pipe_vertex_element velem[2];
- enum pipe_texture_target internal_target;
-
- void *vs;
- void *fs[TGSI_WRITEMASK_XYZW + 1];
- void *fs_depth;
-
- struct pipe_resource *vbuf; /**< quad vertices */
- unsigned vbuf_slot;
-
- float vertices[4][2][4]; /**< vertex/texcoords for quad */
-};
-
-
-/**
- * Create state object for blit.
- * Intended to be created once and re-used for many blit() calls.
- */
-struct blit_state *
-util_create_blit(struct pipe_context *pipe, struct cso_context *cso)
-{
- struct blit_state *ctx;
- uint i;
-
- ctx = CALLOC_STRUCT(blit_state);
- if (!ctx)
- return NULL;
-
- ctx->pipe = pipe;
- ctx->cso = cso;
-
- /* disabled blending/masking */
- memset(&ctx->blend, 0, sizeof(ctx->blend));
- ctx->blend.rt[0].colormask = PIPE_MASK_RGBA;
-
- /* no-op depth/stencil/alpha */
- memset(&ctx->depthstencil_keep, 0, sizeof(ctx->depthstencil_keep));
- memset(&ctx->depthstencil_write, 0, sizeof(ctx->depthstencil_write));
- ctx->depthstencil_write.depth.enabled = 1;
- ctx->depthstencil_write.depth.writemask = 1;
- ctx->depthstencil_write.depth.func = PIPE_FUNC_ALWAYS;
-
- /* rasterizer */
- memset(&ctx->rasterizer, 0, sizeof(ctx->rasterizer));
- ctx->rasterizer.cull_face = PIPE_FACE_NONE;
- ctx->rasterizer.gl_rasterization_rules = 1;
-
- /* samplers */
- memset(&ctx->sampler, 0, sizeof(ctx->sampler));
- ctx->sampler.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
- ctx->sampler.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
- ctx->sampler.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
- ctx->sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NONE;
- ctx->sampler.min_img_filter = 0; /* set later */
- ctx->sampler.mag_img_filter = 0; /* set later */
-
- /* vertex elements state */
- memset(&ctx->velem[0], 0, sizeof(ctx->velem[0]) * 2);
- for (i = 0; i < 2; i++) {
- ctx->velem[i].src_offset = i * 4 * sizeof(float);
- ctx->velem[i].instance_divisor = 0;
- ctx->velem[i].vertex_buffer_index = 0;
- ctx->velem[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
- }
-
- ctx->vbuf = NULL;
-
- /* init vertex data that doesn't change */
- for (i = 0; i < 4; i++) {
- ctx->vertices[i][0][3] = 1.0f; /* w */
- ctx->vertices[i][1][2] = 0.0f; /* r */
- ctx->vertices[i][1][3] = 1.0f; /* q */
- }
-
- if(pipe->screen->get_param(pipe->screen, PIPE_CAP_NPOT_TEXTURES))
- ctx->internal_target = PIPE_TEXTURE_2D;
- else
- ctx->internal_target = PIPE_TEXTURE_RECT;
-
- return ctx;
-}
-
-
-/**
- * Destroy a blit context
- */
-void
-util_destroy_blit(struct blit_state *ctx)
-{
- struct pipe_context *pipe = ctx->pipe;
- unsigned i;
-
- if (ctx->vs)
- pipe->delete_vs_state(pipe, ctx->vs);
-
- for (i = 0; i < Elements(ctx->fs); i++)
- if (ctx->fs[i])
- pipe->delete_fs_state(pipe, ctx->fs[i]);
-
- if (ctx->fs_depth)
- pipe->delete_fs_state(pipe, ctx->fs_depth);
-
- pipe_resource_reference(&ctx->vbuf, NULL);
-
- FREE(ctx);
-}
-
-
-/**
- * Helper function to set the fragment shaders.
- */
-static INLINE void
-set_fragment_shader(struct blit_state *ctx, uint writemask)
-{
- if (!ctx->fs[writemask])
- ctx->fs[writemask] =
- util_make_fragment_tex_shader_writemask(ctx->pipe, TGSI_TEXTURE_2D,
- TGSI_INTERPOLATE_LINEAR,
- writemask);
-
- cso_set_fragment_shader_handle(ctx->cso, ctx->fs[writemask]);
-}
-
-
-/**
- * Helper function to set the depthwrite shader.
- */
-static INLINE void
-set_depth_fragment_shader(struct blit_state *ctx)
-{
- if (!ctx->fs_depth)
- ctx->fs_depth =
- util_make_fragment_tex_shader_writedepth(ctx->pipe, TGSI_TEXTURE_2D,
- TGSI_INTERPOLATE_LINEAR);
-
- cso_set_fragment_shader_handle(ctx->cso, ctx->fs_depth);
-}
-
-
-/**
- * Helper function to set the vertex shader.
- */
-static INLINE void
-set_vertex_shader(struct blit_state *ctx)
-{
- /* vertex shader - still required to provide the linkage between
- * fragment shader input semantics and vertex_element/buffers.
- */
- if (!ctx->vs) {
- const uint semantic_names[] = { TGSI_SEMANTIC_POSITION,
- TGSI_SEMANTIC_GENERIC };
- const uint semantic_indexes[] = { 0, 0 };
- ctx->vs = util_make_vertex_passthrough_shader(ctx->pipe, 2,
- semantic_names,
- semantic_indexes);
- }
-
- cso_set_vertex_shader_handle(ctx->cso, ctx->vs);
-}
-
-
-/**
- * Get offset of next free slot in vertex buffer for quad vertices.
- */
-static unsigned
-get_next_slot( struct blit_state *ctx )
-{
- const unsigned max_slots = 4096 / sizeof ctx->vertices;
-
- if (ctx->vbuf_slot >= max_slots)
- util_blit_flush( ctx );
-
- if (!ctx->vbuf) {
- ctx->vbuf = pipe_buffer_create(ctx->pipe->screen,
- PIPE_BIND_VERTEX_BUFFER,
- PIPE_USAGE_STREAM,
- max_slots * sizeof ctx->vertices);
- }
-
- return ctx->vbuf_slot++ * sizeof ctx->vertices;
-}
-
-
-
-
-/**
- * Setup vertex data for the textured quad we'll draw.
- * Note: y=0=top
- */
-static unsigned
-setup_vertex_data_tex(struct blit_state *ctx,
- float x0, float y0, float x1, float y1,
- float s0, float t0, float s1, float t1,
- float z)
-{
- unsigned offset;
-
- ctx->vertices[0][0][0] = x0;
- ctx->vertices[0][0][1] = y0;
- ctx->vertices[0][0][2] = z;
- ctx->vertices[0][1][0] = s0; /*s*/
- ctx->vertices[0][1][1] = t0; /*t*/
-
- ctx->vertices[1][0][0] = x1;
- ctx->vertices[1][0][1] = y0;
- ctx->vertices[1][0][2] = z;
- ctx->vertices[1][1][0] = s1; /*s*/
- ctx->vertices[1][1][1] = t0; /*t*/
-
- ctx->vertices[2][0][0] = x1;
- ctx->vertices[2][0][1] = y1;
- ctx->vertices[2][0][2] = z;
- ctx->vertices[2][1][0] = s1;
- ctx->vertices[2][1][1] = t1;
-
- ctx->vertices[3][0][0] = x0;
- ctx->vertices[3][0][1] = y1;
- ctx->vertices[3][0][2] = z;
- ctx->vertices[3][1][0] = s0;
- ctx->vertices[3][1][1] = t1;
-
- offset = get_next_slot( ctx );
-
- pipe_buffer_write_nooverlap(ctx->pipe, ctx->vbuf,
- offset, sizeof(ctx->vertices), ctx->vertices);
-
- return offset;
-}
-
-
-/**
- * \return TRUE if two regions overlap, FALSE otherwise
- */
-static boolean
-regions_overlap(int srcX0, int srcY0,
- int srcX1, int srcY1,
- int dstX0, int dstY0,
- int dstX1, int dstY1)
-{
- if (MAX2(srcX0, srcX1) < MIN2(dstX0, dstX1))
- return FALSE; /* src completely left of dst */
-
- if (MAX2(dstX0, dstX1) < MIN2(srcX0, srcX1))
- return FALSE; /* dst completely left of src */
-
- if (MAX2(srcY0, srcY1) < MIN2(dstY0, dstY1))
- return FALSE; /* src completely above dst */
-
- if (MAX2(dstY0, dstY1) < MIN2(srcY0, srcY1))
- return FALSE; /* dst completely above src */
-
- return TRUE; /* some overlap */
-}
-
-
-/**
- * Copy pixel block from src surface to dst surface.
- * Overlapping regions are acceptable.
- * Flipping and stretching are supported.
- * \param filter one of PIPE_TEX_MIPFILTER_NEAREST/LINEAR
- * \param writemask controls which channels in the dest surface are sourced
- * from the src surface. Disabled channels are sourced
- * from (0,0,0,1).
- * XXX need some control over blitting stencil.
- */
-void
-util_blit_pixels_writemask(struct blit_state *ctx,
- struct pipe_resource *src_tex,
- unsigned src_level,
- int srcX0, int srcY0,
- int srcX1, int srcY1,
- int srcZ0,
- struct pipe_surface *dst,
- int dstX0, int dstY0,
- int dstX1, int dstY1,
- float z, uint filter,
- uint writemask)
-{
- struct pipe_context *pipe = ctx->pipe;
- struct pipe_screen *screen = pipe->screen;
- enum pipe_format src_format, dst_format;
- struct pipe_sampler_view *sampler_view = NULL;
- struct pipe_sampler_view sv_templ;
- struct pipe_surface *dst_surface;
- struct pipe_framebuffer_state fb;
- const int srcW = abs(srcX1 - srcX0);
- const int srcH = abs(srcY1 - srcY0);
- unsigned offset;
- boolean overlap, dst_is_depth;
- float s0, t0, s1, t1;
- boolean normalized;
-
- assert(filter == PIPE_TEX_MIPFILTER_NEAREST ||
- filter == PIPE_TEX_MIPFILTER_LINEAR);
-
- assert(src_level <= src_tex->last_level);
-
- /* do the regions overlap? */
- overlap = src_tex == dst->texture &&
- dst->u.tex.level == src_level &&
- dst->u.tex.first_layer == srcZ0 &&
- regions_overlap(srcX0, srcY0, srcX1, srcY1,
- dstX0, dstY0, dstX1, dstY1);
-
- src_format = util_format_linear(src_tex->format);
- dst_format = util_format_linear(dst->format);
-
- /*
- * Check for simple case: no format conversion, no flipping, no stretching,
- * no overlapping.
- * Filter mode should not matter since there's no stretching.
- */
- if (dst_format == src_format &&
- srcX0 < srcX1 &&
- dstX0 < dstX1 &&
- srcY0 < srcY1 &&
- dstY0 < dstY1 &&
- (dstX1 - dstX0) == (srcX1 - srcX0) &&
- (dstY1 - dstY0) == (srcY1 - srcY0) &&
- !overlap) {
- struct pipe_box src_box;
- src_box.x = srcX0;
- src_box.y = srcY0;
- src_box.z = srcZ0;
- src_box.width = srcW;
- src_box.height = srcH;
- src_box.depth = 1;
- pipe->resource_copy_region(pipe,
- dst->texture, dst->u.tex.level,
- dstX0, dstY0, dst->u.tex.first_layer,/* dest */
- src_tex, src_level,
- &src_box);
- return;
- }
-
- if (dst_format == dst->format) {
- dst_surface = dst;
- } else {
- struct pipe_surface templ = *dst;
- templ.format = dst_format;
- dst_surface = pipe->create_surface(pipe, dst->texture, &templ);
- }
-
- /* Create a temporary texture when src and dest alias or when src
- * is anything other than a 2d texture.
- * XXX should just use appropriate shader to access 1d / 3d slice / cube face,
- * much like the u_blitter code does (should be pretty trivial).
- *
- * This can still be improved upon.
- */
- if ((src_tex == dst_surface->texture &&
- dst_surface->u.tex.level == src_level &&
- dst_surface->u.tex.first_layer == srcZ0) ||
- (src_tex->target != PIPE_TEXTURE_2D &&
- src_tex->target != PIPE_TEXTURE_2D &&
- src_tex->target != PIPE_TEXTURE_RECT))
- {
- struct pipe_resource texTemp;
- struct pipe_resource *tex;
- struct pipe_sampler_view sv_templ;
- struct pipe_box src_box;
- const int srcLeft = MIN2(srcX0, srcX1);
- const int srcTop = MIN2(srcY0, srcY1);
-
- if (srcLeft != srcX0) {
- /* left-right flip */
- int tmp = dstX0;
- dstX0 = dstX1;
- dstX1 = tmp;
- }
-
- if (srcTop != srcY0) {
- /* up-down flip */
- int tmp = dstY0;
- dstY0 = dstY1;
- dstY1 = tmp;
- }
-
- /* create temp texture */
- memset(&texTemp, 0, sizeof(texTemp));
- texTemp.target = ctx->internal_target;
- texTemp.format = src_format;
- texTemp.last_level = 0;
- texTemp.width0 = srcW;
- texTemp.height0 = srcH;
- texTemp.depth0 = 1;
- texTemp.array_size = 1;
- texTemp.bind = PIPE_BIND_SAMPLER_VIEW;
-
- tex = screen->resource_create(screen, &texTemp);
- if (!tex)
- return;
-
- src_box.x = srcLeft;
- src_box.y = srcTop;
- src_box.z = srcZ0;
- src_box.width = srcW;
- src_box.height = srcH;
- src_box.depth = 1;
- /* load temp texture */
- pipe->resource_copy_region(pipe,
- tex, 0, 0, 0, 0, /* dest */
- src_tex, src_level, &src_box);
-
- normalized = tex->target != PIPE_TEXTURE_RECT;
- if(normalized) {
- s0 = 0.0f;
- s1 = 1.0f;
- t0 = 0.0f;
- t1 = 1.0f;
- }
- else {
- s0 = 0;
- s1 = srcW;
- t0 = 0;
- t1 = srcH;
- }
-
- u_sampler_view_default_template(&sv_templ, tex, tex->format);
- sampler_view = pipe->create_sampler_view(pipe, tex, &sv_templ);
-
- if (!sampler_view) {
- pipe_resource_reference(&tex, NULL);
- return;
- }
- pipe_resource_reference(&tex, NULL);
- }
- else {
- u_sampler_view_default_template(&sv_templ, src_tex, src_format);
- sampler_view = pipe->create_sampler_view(pipe, src_tex, &sv_templ);
-
- if (!sampler_view) {
- return;
- }
-
- s0 = srcX0;
- s1 = srcX1;
- t0 = srcY0;
- t1 = srcY1;
- normalized = sampler_view->texture->target != PIPE_TEXTURE_RECT;
- if(normalized)
- {
- s0 /= (float)(u_minify(sampler_view->texture->width0, src_level));
- s1 /= (float)(u_minify(sampler_view->texture->width0, src_level));
- t0 /= (float)(u_minify(sampler_view->texture->height0, src_level));
- t1 /= (float)(u_minify(sampler_view->texture->height0, src_level));
- }
- }
-
- dst_is_depth = util_format_is_depth_or_stencil(dst_format);
-
- assert(screen->is_format_supported(screen, sampler_view->format, ctx->internal_target,
- sampler_view->texture->nr_samples,
- PIPE_BIND_SAMPLER_VIEW));
- assert(screen->is_format_supported(screen, dst_format, ctx->internal_target,
- dst_surface->texture->nr_samples,
- dst_is_depth ? PIPE_BIND_DEPTH_STENCIL :
- PIPE_BIND_RENDER_TARGET));
- /* save state (restored below) */
- cso_save_blend(ctx->cso);
- cso_save_depth_stencil_alpha(ctx->cso);
- cso_save_rasterizer(ctx->cso);
- cso_save_samplers(ctx->cso);
- cso_save_fragment_sampler_views(ctx->cso);
- cso_save_viewport(ctx->cso);
- cso_save_framebuffer(ctx->cso);
- cso_save_fragment_shader(ctx->cso);
- cso_save_vertex_shader(ctx->cso);
- cso_save_clip(ctx->cso);
- cso_save_vertex_elements(ctx->cso);
- cso_save_vertex_buffers(ctx->cso);
-
- /* set misc state we care about */
- cso_set_blend(ctx->cso, &ctx->blend);
- cso_set_depth_stencil_alpha(ctx->cso,
- dst_is_depth ? &ctx->depthstencil_write :
- &ctx->depthstencil_keep);
- cso_set_rasterizer(ctx->cso, &ctx->rasterizer);
- cso_set_clip(ctx->cso, &ctx->clip);
- cso_set_vertex_elements(ctx->cso, 2, ctx->velem);
-
- /* sampler */
- ctx->sampler.normalized_coords = normalized;
- ctx->sampler.min_img_filter = filter;
- ctx->sampler.mag_img_filter = filter;
- ctx->sampler.min_lod = src_level;
- ctx->sampler.max_lod = src_level;
- cso_single_sampler(ctx->cso, 0, &ctx->sampler);
- cso_single_sampler_done(ctx->cso);
-
- /* viewport */
- ctx->viewport.scale[0] = 0.5f * dst_surface->width;
- ctx->viewport.scale[1] = 0.5f * dst_surface->height;
- ctx->viewport.scale[2] = 0.5f;
- ctx->viewport.scale[3] = 1.0f;
- ctx->viewport.translate[0] = 0.5f * dst_surface->width;
- ctx->viewport.translate[1] = 0.5f * dst_surface->height;
- ctx->viewport.translate[2] = 0.5f;
- ctx->viewport.translate[3] = 0.0f;
- cso_set_viewport(ctx->cso, &ctx->viewport);
-
- /* texture */
- cso_set_fragment_sampler_views(ctx->cso, 1, &sampler_view);
-
- /* shaders */
- if (dst_is_depth) {
- set_depth_fragment_shader(ctx);
- } else {
- set_fragment_shader(ctx, writemask);
- }
- set_vertex_shader(ctx);
-
- /* drawing dest */
- memset(&fb, 0, sizeof(fb));
- fb.width = dst_surface->width;
- fb.height = dst_surface->height;
- if (dst_is_depth) {
- fb.zsbuf = dst_surface;
- } else {
- fb.nr_cbufs = 1;
- fb.cbufs[0] = dst_surface;
- }
- cso_set_framebuffer(ctx->cso, &fb);
-
- /* draw quad */
- offset = setup_vertex_data_tex(ctx,
- (float) dstX0 / dst_surface->width * 2.0f - 1.0f,
- (float) dstY0 / dst_surface->height * 2.0f - 1.0f,
- (float) dstX1 / dst_surface->width * 2.0f - 1.0f,
- (float) dstY1 / dst_surface->height * 2.0f - 1.0f,
- s0, t0,
- s1, t1,
- z);
-
- util_draw_vertex_buffer(ctx->pipe, ctx->cso, ctx->vbuf, offset,
- PIPE_PRIM_TRIANGLE_FAN,
- 4, /* verts */
- 2); /* attribs/vert */
-
- /* restore state we changed */
- cso_restore_blend(ctx->cso);
- cso_restore_depth_stencil_alpha(ctx->cso);
- cso_restore_rasterizer(ctx->cso);
- cso_restore_samplers(ctx->cso);
- cso_restore_fragment_sampler_views(ctx->cso);
- cso_restore_viewport(ctx->cso);
- cso_restore_framebuffer(ctx->cso);
- cso_restore_fragment_shader(ctx->cso);
- cso_restore_vertex_shader(ctx->cso);
- cso_restore_clip(ctx->cso);
- cso_restore_vertex_elements(ctx->cso);
- cso_restore_vertex_buffers(ctx->cso);
-
- pipe_sampler_view_reference(&sampler_view, NULL);
- if (dst_surface != dst)
- pipe_surface_reference(&dst_surface, NULL);
-}
-
-
-void
-util_blit_pixels(struct blit_state *ctx,
- struct pipe_resource *src_tex,
- unsigned src_level,
- int srcX0, int srcY0,
- int srcX1, int srcY1,
- int srcZ,
- struct pipe_surface *dst,
- int dstX0, int dstY0,
- int dstX1, int dstY1,
- float z, uint filter )
-{
- util_blit_pixels_writemask( ctx, src_tex,
- src_level,
- srcX0, srcY0,
- srcX1, srcY1,
- srcZ,
- dst,
- dstX0, dstY0,
- dstX1, dstY1,
- z, filter,
- TGSI_WRITEMASK_XYZW );
-}
-
-
-/* Release vertex buffer at end of frame to avoid synchronous
- * rendering.
- */
-void util_blit_flush( struct blit_state *ctx )
-{
- pipe_resource_reference(&ctx->vbuf, NULL);
- ctx->vbuf_slot = 0;
-}
-
-
-
-/**
- * Copy pixel block from src texture to dst surface.
- *
- * XXX Should support selection of level.
- * XXX need some control over blitting Z and/or stencil.
- */
-void
-util_blit_pixels_tex(struct blit_state *ctx,
- struct pipe_sampler_view *src_sampler_view,
- int srcX0, int srcY0,
- int srcX1, int srcY1,
- struct pipe_surface *dst,
- int dstX0, int dstY0,
- int dstX1, int dstY1,
- float z, uint filter)
-{
- boolean normalized = src_sampler_view->texture->target != PIPE_TEXTURE_RECT;
- struct pipe_framebuffer_state fb;
- float s0, t0, s1, t1;
- unsigned offset;
- struct pipe_resource *tex = src_sampler_view->texture;
-
- assert(filter == PIPE_TEX_MIPFILTER_NEAREST ||
- filter == PIPE_TEX_MIPFILTER_LINEAR);
-
- assert(tex);
- assert(tex->width0 != 0);
- assert(tex->height0 != 0);
-
- s0 = srcX0;
- s1 = srcX1;
- t0 = srcY0;
- t1 = srcY1;
-
- if(normalized)
- {
- s0 /= (float)tex->width0;
- s1 /= (float)tex->width0;
- t0 /= (float)tex->height0;
- t1 /= (float)tex->height0;
- }
-
- assert(ctx->pipe->screen->is_format_supported(ctx->pipe->screen, dst->format,
- PIPE_TEXTURE_2D,
- dst->texture->nr_samples,
- PIPE_BIND_RENDER_TARGET));
-
- /* save state (restored below) */
- cso_save_blend(ctx->cso);
- cso_save_depth_stencil_alpha(ctx->cso);
- cso_save_rasterizer(ctx->cso);
- cso_save_samplers(ctx->cso);
- cso_save_fragment_sampler_views(ctx->cso);
- cso_save_viewport(ctx->cso);
- cso_save_framebuffer(ctx->cso);
- cso_save_fragment_shader(ctx->cso);
- cso_save_vertex_shader(ctx->cso);
- cso_save_clip(ctx->cso);
- cso_save_vertex_elements(ctx->cso);
- cso_save_vertex_buffers(ctx->cso);
-
- /* set misc state we care about */
- cso_set_blend(ctx->cso, &ctx->blend);
- cso_set_depth_stencil_alpha(ctx->cso, &ctx->depthstencil_keep);
- cso_set_rasterizer(ctx->cso, &ctx->rasterizer);
- cso_set_clip(ctx->cso, &ctx->clip);
- cso_set_vertex_elements(ctx->cso, 2, ctx->velem);
-
- /* sampler */
- ctx->sampler.normalized_coords = normalized;
- ctx->sampler.min_img_filter = filter;
- ctx->sampler.mag_img_filter = filter;
- cso_single_sampler(ctx->cso, 0, &ctx->sampler);
- cso_single_sampler_done(ctx->cso);
-
- /* viewport */
- ctx->viewport.scale[0] = 0.5f * dst->width;
- ctx->viewport.scale[1] = 0.5f * dst->height;
- ctx->viewport.scale[2] = 0.5f;
- ctx->viewport.scale[3] = 1.0f;
- ctx->viewport.translate[0] = 0.5f * dst->width;
- ctx->viewport.translate[1] = 0.5f * dst->height;
- ctx->viewport.translate[2] = 0.5f;
- ctx->viewport.translate[3] = 0.0f;
- cso_set_viewport(ctx->cso, &ctx->viewport);
-
- /* texture */
- cso_set_fragment_sampler_views(ctx->cso, 1, &src_sampler_view);
-
- /* shaders */
- set_fragment_shader(ctx, TGSI_WRITEMASK_XYZW);
- set_vertex_shader(ctx);
-
- /* drawing dest */
- memset(&fb, 0, sizeof(fb));
- fb.width = dst->width;
- fb.height = dst->height;
- fb.nr_cbufs = 1;
- fb.cbufs[0] = dst;
- cso_set_framebuffer(ctx->cso, &fb);
-
- /* draw quad */
- offset = setup_vertex_data_tex(ctx,
- (float) dstX0 / dst->width * 2.0f - 1.0f,
- (float) dstY0 / dst->height * 2.0f - 1.0f,
- (float) dstX1 / dst->width * 2.0f - 1.0f,
- (float) dstY1 / dst->height * 2.0f - 1.0f,
- s0, t0, s1, t1,
- z);
-
- util_draw_vertex_buffer(ctx->pipe, ctx->cso,
- ctx->vbuf, offset,
- PIPE_PRIM_TRIANGLE_FAN,
- 4, /* verts */
- 2); /* attribs/vert */
-
- /* restore state we changed */
- cso_restore_blend(ctx->cso);
- cso_restore_depth_stencil_alpha(ctx->cso);
- cso_restore_rasterizer(ctx->cso);
- cso_restore_samplers(ctx->cso);
- cso_restore_fragment_sampler_views(ctx->cso);
- cso_restore_viewport(ctx->cso);
- cso_restore_framebuffer(ctx->cso);
- cso_restore_fragment_shader(ctx->cso);
- cso_restore_vertex_shader(ctx->cso);
- cso_restore_clip(ctx->cso);
- cso_restore_vertex_elements(ctx->cso);
- cso_restore_vertex_buffers(ctx->cso);
-}
+/**************************************************************************
+ *
+ * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+/**
+ * @file
+ * Copy/blit pixel rect between surfaces
+ *
+ * @author Brian Paul
+ */
+
+
+#include "pipe/p_context.h"
+#include "util/u_debug.h"
+#include "pipe/p_defines.h"
+#include "util/u_inlines.h"
+#include "pipe/p_shader_tokens.h"
+#include "pipe/p_state.h"
+
+#include "util/u_blit.h"
+#include "util/u_draw_quad.h"
+#include "util/u_format.h"
+#include "util/u_math.h"
+#include "util/u_memory.h"
+#include "util/u_sampler.h"
+#include "util/u_simple_shaders.h"
+
+#include "cso_cache/cso_context.h"
+
+
+struct blit_state
+{
+ struct pipe_context *pipe;
+ struct cso_context *cso;
+
+ struct pipe_blend_state blend;
+ struct pipe_depth_stencil_alpha_state depthstencil_keep;
+ struct pipe_depth_stencil_alpha_state depthstencil_write;
+ struct pipe_rasterizer_state rasterizer;
+ struct pipe_sampler_state sampler;
+ struct pipe_viewport_state viewport;
+ struct pipe_clip_state clip;
+ struct pipe_vertex_element velem[2];
+ enum pipe_texture_target internal_target;
+
+ void *vs;
+ void *fs[TGSI_WRITEMASK_XYZW + 1];
+ void *fs_depth;
+
+ struct pipe_resource *vbuf; /**< quad vertices */
+ unsigned vbuf_slot;
+
+ float vertices[4][2][4]; /**< vertex/texcoords for quad */
+};
+
+
+/**
+ * Create state object for blit.
+ * Intended to be created once and re-used for many blit() calls.
+ */
+struct blit_state *
+util_create_blit(struct pipe_context *pipe, struct cso_context *cso)
+{
+ struct blit_state *ctx;
+ uint i;
+
+ ctx = CALLOC_STRUCT(blit_state);
+ if (!ctx)
+ return NULL;
+
+ ctx->pipe = pipe;
+ ctx->cso = cso;
+
+ /* disabled blending/masking */
+ memset(&ctx->blend, 0, sizeof(ctx->blend));
+ ctx->blend.rt[0].colormask = PIPE_MASK_RGBA;
+
+ /* no-op depth/stencil/alpha */
+ memset(&ctx->depthstencil_keep, 0, sizeof(ctx->depthstencil_keep));
+ memset(&ctx->depthstencil_write, 0, sizeof(ctx->depthstencil_write));
+ ctx->depthstencil_write.depth.enabled = 1;
+ ctx->depthstencil_write.depth.writemask = 1;
+ ctx->depthstencil_write.depth.func = PIPE_FUNC_ALWAYS;
+
+ /* rasterizer */
+ memset(&ctx->rasterizer, 0, sizeof(ctx->rasterizer));
+ ctx->rasterizer.cull_face = PIPE_FACE_NONE;
+ ctx->rasterizer.gl_rasterization_rules = 1;
+
+ /* samplers */
+ memset(&ctx->sampler, 0, sizeof(ctx->sampler));
+ ctx->sampler.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
+ ctx->sampler.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
+ ctx->sampler.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
+ ctx->sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NONE;
+ ctx->sampler.min_img_filter = 0; /* set later */
+ ctx->sampler.mag_img_filter = 0; /* set later */
+
+ /* vertex elements state */
+ memset(&ctx->velem[0], 0, sizeof(ctx->velem[0]) * 2);
+ for (i = 0; i < 2; i++) {
+ ctx->velem[i].src_offset = i * 4 * sizeof(float);
+ ctx->velem[i].instance_divisor = 0;
+ ctx->velem[i].vertex_buffer_index = 0;
+ ctx->velem[i].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
+ }
+
+ ctx->vbuf = NULL;
+
+ /* init vertex data that doesn't change */
+ for (i = 0; i < 4; i++) {
+ ctx->vertices[i][0][3] = 1.0f; /* w */
+ ctx->vertices[i][1][2] = 0.0f; /* r */
+ ctx->vertices[i][1][3] = 1.0f; /* q */
+ }
+
+ if(pipe->screen->get_param(pipe->screen, PIPE_CAP_NPOT_TEXTURES))
+ ctx->internal_target = PIPE_TEXTURE_2D;
+ else
+ ctx->internal_target = PIPE_TEXTURE_RECT;
+
+ return ctx;
+}
+
+
+/**
+ * Destroy a blit context
+ */
+void
+util_destroy_blit(struct blit_state *ctx)
+{
+ struct pipe_context *pipe = ctx->pipe;
+ unsigned i;
+
+ if (ctx->vs)
+ pipe->delete_vs_state(pipe, ctx->vs);
+
+ for (i = 0; i < Elements(ctx->fs); i++)
+ if (ctx->fs[i])
+ pipe->delete_fs_state(pipe, ctx->fs[i]);
+
+ if (ctx->fs_depth)
+ pipe->delete_fs_state(pipe, ctx->fs_depth);
+
+ pipe_resource_reference(&ctx->vbuf, NULL);
+
+ FREE(ctx);
+}
+
+
+/**
+ * Helper function to set the fragment shaders.
+ */
+static INLINE void
+set_fragment_shader(struct blit_state *ctx, uint writemask)
+{
+ if (!ctx->fs[writemask])
+ ctx->fs[writemask] =
+ util_make_fragment_tex_shader_writemask(ctx->pipe, TGSI_TEXTURE_2D,
+ TGSI_INTERPOLATE_LINEAR,
+ writemask);
+
+ cso_set_fragment_shader_handle(ctx->cso, ctx->fs[writemask]);
+}
+
+
+/**
+ * Helper function to set the depthwrite shader.
+ */
+static INLINE void
+set_depth_fragment_shader(struct blit_state *ctx)
+{
+ if (!ctx->fs_depth)
+ ctx->fs_depth =
+ util_make_fragment_tex_shader_writedepth(ctx->pipe, TGSI_TEXTURE_2D,
+ TGSI_INTERPOLATE_LINEAR);
+
+ cso_set_fragment_shader_handle(ctx->cso, ctx->fs_depth);
+}
+
+
+/**
+ * Helper function to set the vertex shader.
+ */
+static INLINE void
+set_vertex_shader(struct blit_state *ctx)
+{
+ /* vertex shader - still required to provide the linkage between
+ * fragment shader input semantics and vertex_element/buffers.
+ */
+ if (!ctx->vs) {
+ const uint semantic_names[] = { TGSI_SEMANTIC_POSITION,
+ TGSI_SEMANTIC_GENERIC };
+ const uint semantic_indexes[] = { 0, 0 };
+ ctx->vs = util_make_vertex_passthrough_shader(ctx->pipe, 2,
+ semantic_names,
+ semantic_indexes);
+ }
+
+ cso_set_vertex_shader_handle(ctx->cso, ctx->vs);
+}
+
+
+/**
+ * Get offset of next free slot in vertex buffer for quad vertices.
+ */
+static unsigned
+get_next_slot( struct blit_state *ctx )
+{
+ const unsigned max_slots = 4096 / sizeof ctx->vertices;
+
+ if (ctx->vbuf_slot >= max_slots)
+ util_blit_flush( ctx );
+
+ if (!ctx->vbuf) {
+ ctx->vbuf = pipe_buffer_create(ctx->pipe->screen,
+ PIPE_BIND_VERTEX_BUFFER,
+ PIPE_USAGE_STREAM,
+ max_slots * sizeof ctx->vertices);
+ }
+
+ return ctx->vbuf_slot++ * sizeof ctx->vertices;
+}
+
+
+
+
+/**
+ * Setup vertex data for the textured quad we'll draw.
+ * Note: y=0=top
+ */
+static unsigned
+setup_vertex_data_tex(struct blit_state *ctx,
+ float x0, float y0, float x1, float y1,
+ float s0, float t0, float s1, float t1,
+ float z)
+{
+ unsigned offset;
+
+ ctx->vertices[0][0][0] = x0;
+ ctx->vertices[0][0][1] = y0;
+ ctx->vertices[0][0][2] = z;
+ ctx->vertices[0][1][0] = s0; /*s*/
+ ctx->vertices[0][1][1] = t0; /*t*/
+
+ ctx->vertices[1][0][0] = x1;
+ ctx->vertices[1][0][1] = y0;
+ ctx->vertices[1][0][2] = z;
+ ctx->vertices[1][1][0] = s1; /*s*/
+ ctx->vertices[1][1][1] = t0; /*t*/
+
+ ctx->vertices[2][0][0] = x1;
+ ctx->vertices[2][0][1] = y1;
+ ctx->vertices[2][0][2] = z;
+ ctx->vertices[2][1][0] = s1;
+ ctx->vertices[2][1][1] = t1;
+
+ ctx->vertices[3][0][0] = x0;
+ ctx->vertices[3][0][1] = y1;
+ ctx->vertices[3][0][2] = z;
+ ctx->vertices[3][1][0] = s0;
+ ctx->vertices[3][1][1] = t1;
+
+ offset = get_next_slot( ctx );
+
+ pipe_buffer_write_nooverlap(ctx->pipe, ctx->vbuf,
+ offset, sizeof(ctx->vertices), ctx->vertices);
+
+ return offset;
+}
+
+
+/**
+ * \return TRUE if two regions overlap, FALSE otherwise
+ */
+static boolean
+regions_overlap(int srcX0, int srcY0,
+ int srcX1, int srcY1,
+ int dstX0, int dstY0,
+ int dstX1, int dstY1)
+{
+ if (MAX2(srcX0, srcX1) < MIN2(dstX0, dstX1))
+ return FALSE; /* src completely left of dst */
+
+ if (MAX2(dstX0, dstX1) < MIN2(srcX0, srcX1))
+ return FALSE; /* dst completely left of src */
+
+ if (MAX2(srcY0, srcY1) < MIN2(dstY0, dstY1))
+ return FALSE; /* src completely above dst */
+
+ if (MAX2(dstY0, dstY1) < MIN2(srcY0, srcY1))
+ return FALSE; /* dst completely above src */
+
+ return TRUE; /* some overlap */
+}
+
+
+/**
+ * Copy pixel block from src surface to dst surface.
+ * Overlapping regions are acceptable.
+ * Flipping and stretching are supported.
+ * \param filter one of PIPE_TEX_MIPFILTER_NEAREST/LINEAR
+ * \param writemask controls which channels in the dest surface are sourced
+ * from the src surface. Disabled channels are sourced
+ * from (0,0,0,1).
+ * XXX need some control over blitting stencil.
+ */
+void
+util_blit_pixels_writemask(struct blit_state *ctx,
+ struct pipe_resource *src_tex,
+ unsigned src_level,
+ int srcX0, int srcY0,
+ int srcX1, int srcY1,
+ int srcZ0,
+ struct pipe_surface *dst,
+ int dstX0, int dstY0,
+ int dstX1, int dstY1,
+ float z, uint filter,
+ uint writemask)
+{
+ struct pipe_context *pipe = ctx->pipe;
+ struct pipe_screen *screen = pipe->screen;
+ enum pipe_format src_format, dst_format;
+ struct pipe_sampler_view *sampler_view = NULL;
+ struct pipe_sampler_view sv_templ;
+ struct pipe_surface *dst_surface;
+ struct pipe_framebuffer_state fb;
+ const int srcW = abs(srcX1 - srcX0);
+ const int srcH = abs(srcY1 - srcY0);
+ unsigned offset;
+ boolean overlap, dst_is_depth;
+ float s0, t0, s1, t1;
+ boolean normalized;
+
+ assert(filter == PIPE_TEX_MIPFILTER_NEAREST ||
+ filter == PIPE_TEX_MIPFILTER_LINEAR);
+
+ assert(src_level <= src_tex->last_level);
+
+ /* do the regions overlap? */
+ overlap = src_tex == dst->texture &&
+ dst->u.tex.level == src_level &&
+ dst->u.tex.first_layer == srcZ0 &&
+ regions_overlap(srcX0, srcY0, srcX1, srcY1,
+ dstX0, dstY0, dstX1, dstY1);
+
+ src_format = util_format_linear(src_tex->format);
+ dst_format = util_format_linear(dst->format);
+
+ /*
+ * Check for simple case: no format conversion, no flipping, no stretching,
+ * no overlapping.
+ * Filter mode should not matter since there's no stretching.
+ */
+ if (dst_format == src_format &&
+ srcX0 < srcX1 &&
+ dstX0 < dstX1 &&
+ srcY0 < srcY1 &&
+ dstY0 < dstY1 &&
+ (dstX1 - dstX0) == (srcX1 - srcX0) &&
+ (dstY1 - dstY0) == (srcY1 - srcY0) &&
+ !overlap) {
+ struct pipe_box src_box;
+ src_box.x = srcX0;
+ src_box.y = srcY0;
+ src_box.z = srcZ0;
+ src_box.width = srcW;
+ src_box.height = srcH;
+ src_box.depth = 1;
+ pipe->resource_copy_region(pipe,
+ dst->texture, dst->u.tex.level,
+ dstX0, dstY0, dst->u.tex.first_layer,/* dest */
+ src_tex, src_level,
+ &src_box);
+ return;
+ }
+
+ if (dst_format == dst->format) {
+ dst_surface = dst;
+ } else {
+ struct pipe_surface templ = *dst;
+ templ.format = dst_format;
+ dst_surface = pipe->create_surface(pipe, dst->texture, &templ);
+ }
+
+ /* Create a temporary texture when src and dest alias or when src
+ * is anything other than a 2d texture.
+ * XXX should just use appropriate shader to access 1d / 3d slice / cube face,
+ * much like the u_blitter code does (should be pretty trivial).
+ *
+ * This can still be improved upon.
+ */
+ if ((src_tex == dst_surface->texture &&
+ dst_surface->u.tex.level == src_level &&
+ dst_surface->u.tex.first_layer == srcZ0) ||
+ (src_tex->target != PIPE_TEXTURE_2D &&
+ src_tex->target != PIPE_TEXTURE_2D &&
+ src_tex->target != PIPE_TEXTURE_RECT))
+ {
+ struct pipe_resource texTemp;
+ struct pipe_resource *tex;
+ struct pipe_sampler_view sv_templ;
+ struct pipe_box src_box;
+ const int srcLeft = MIN2(srcX0, srcX1);
+ const int srcTop = MIN2(srcY0, srcY1);
+
+ if (srcLeft != srcX0) {
+ /* left-right flip */
+ int tmp = dstX0;
+ dstX0 = dstX1;
+ dstX1 = tmp;
+ }
+
+ if (srcTop != srcY0) {
+ /* up-down flip */
+ int tmp = dstY0;
+ dstY0 = dstY1;
+ dstY1 = tmp;
+ }
+
+ /* create temp texture */
+ memset(&texTemp, 0, sizeof(texTemp));
+ texTemp.target = ctx->internal_target;
+ texTemp.format = src_format;
+ texTemp.last_level = 0;
+ texTemp.width0 = srcW;
+ texTemp.height0 = srcH;
+ texTemp.depth0 = 1;
+ texTemp.array_size = 1;
+ texTemp.bind = PIPE_BIND_SAMPLER_VIEW;
+
+ tex = screen->resource_create(screen, &texTemp);
+ if (!tex)
+ return;
+
+ src_box.x = srcLeft;
+ src_box.y = srcTop;
+ src_box.z = srcZ0;
+ src_box.width = srcW;
+ src_box.height = srcH;
+ src_box.depth = 1;
+ /* load temp texture */
+ pipe->resource_copy_region(pipe,
+ tex, 0, 0, 0, 0, /* dest */
+ src_tex, src_level, &src_box);
+
+ normalized = tex->target != PIPE_TEXTURE_RECT;
+ if(normalized) {
+ s0 = 0.0f;
+ s1 = 1.0f;
+ t0 = 0.0f;
+ t1 = 1.0f;
+ }
+ else {
+ s0 = 0;
+ s1 = srcW;
+ t0 = 0;
+ t1 = srcH;
+ }
+
+ u_sampler_view_default_template(&sv_templ, tex, tex->format);
+ sampler_view = pipe->create_sampler_view(pipe, tex, &sv_templ);
+
+ if (!sampler_view) {
+ pipe_resource_reference(&tex, NULL);
+ return;
+ }
+ pipe_resource_reference(&tex, NULL);
+ }
+ else {
+ u_sampler_view_default_template(&sv_templ, src_tex, src_format);
+ sampler_view = pipe->create_sampler_view(pipe, src_tex, &sv_templ);
+
+ if (!sampler_view) {
+ return;
+ }
+
+ s0 = srcX0;
+ s1 = srcX1;
+ t0 = srcY0;
+ t1 = srcY1;
+ normalized = sampler_view->texture->target != PIPE_TEXTURE_RECT;
+ if(normalized)
+ {
+ s0 /= (float)(u_minify(sampler_view->texture->width0, src_level));
+ s1 /= (float)(u_minify(sampler_view->texture->width0, src_level));
+ t0 /= (float)(u_minify(sampler_view->texture->height0, src_level));
+ t1 /= (float)(u_minify(sampler_view->texture->height0, src_level));
+ }
+ }
+
+ dst_is_depth = util_format_is_depth_or_stencil(dst_format);
+
+ assert(screen->is_format_supported(screen, sampler_view->format, ctx->internal_target,
+ sampler_view->texture->nr_samples,
+ PIPE_BIND_SAMPLER_VIEW));
+ assert(screen->is_format_supported(screen, dst_format, ctx->internal_target,
+ dst_surface->texture->nr_samples,
+ dst_is_depth ? PIPE_BIND_DEPTH_STENCIL :
+ PIPE_BIND_RENDER_TARGET));
+ /* save state (restored below) */
+ cso_save_blend(ctx->cso);
+ cso_save_depth_stencil_alpha(ctx->cso);
+ cso_save_rasterizer(ctx->cso);
+ cso_save_samplers(ctx->cso);
+ cso_save_fragment_sampler_views(ctx->cso);
+ cso_save_viewport(ctx->cso);
+ cso_save_framebuffer(ctx->cso);
+ cso_save_fragment_shader(ctx->cso);
+ cso_save_vertex_shader(ctx->cso);
+ cso_save_clip(ctx->cso);
+ cso_save_vertex_elements(ctx->cso);
+ cso_save_vertex_buffers(ctx->cso);
+
+ /* set misc state we care about */
+ cso_set_blend(ctx->cso, &ctx->blend);
+ cso_set_depth_stencil_alpha(ctx->cso,
+ dst_is_depth ? &ctx->depthstencil_write :
+ &ctx->depthstencil_keep);
+ cso_set_rasterizer(ctx->cso, &ctx->rasterizer);
+ cso_set_clip(ctx->cso, &ctx->clip);
+ cso_set_vertex_elements(ctx->cso, 2, ctx->velem);
+
+ /* sampler */
+ ctx->sampler.normalized_coords = normalized;
+ ctx->sampler.min_img_filter = filter;
+ ctx->sampler.mag_img_filter = filter;
+ ctx->sampler.min_lod = src_level;
+ ctx->sampler.max_lod = src_level;
+ cso_single_sampler(ctx->cso, 0, &ctx->sampler);
+ cso_single_sampler_done(ctx->cso);
+
+ /* viewport */
+ ctx->viewport.scale[0] = 0.5f * dst_surface->width;
+ ctx->viewport.scale[1] = 0.5f * dst_surface->height;
+ ctx->viewport.scale[2] = 0.5f;
+ ctx->viewport.scale[3] = 1.0f;
+ ctx->viewport.translate[0] = 0.5f * dst_surface->width;
+ ctx->viewport.translate[1] = 0.5f * dst_surface->height;
+ ctx->viewport.translate[2] = 0.5f;
+ ctx->viewport.translate[3] = 0.0f;
+ cso_set_viewport(ctx->cso, &ctx->viewport);
+
+ /* texture */
+ cso_set_fragment_sampler_views(ctx->cso, 1, &sampler_view);
+
+ /* shaders */
+ if (dst_is_depth) {
+ set_depth_fragment_shader(ctx);
+ } else {
+ set_fragment_shader(ctx, writemask);
+ }
+ set_vertex_shader(ctx);
+
+ /* drawing dest */
+ memset(&fb, 0, sizeof(fb));
+ fb.width = dst_surface->width;
+ fb.height = dst_surface->height;
+ if (dst_is_depth) {
+ fb.zsbuf = dst_surface;
+ } else {
+ fb.nr_cbufs = 1;
+ fb.cbufs[0] = dst_surface;
+ }
+ cso_set_framebuffer(ctx->cso, &fb);
+
+ /* draw quad */
+ offset = setup_vertex_data_tex(ctx,
+ (float) dstX0 / dst_surface->width * 2.0f - 1.0f,
+ (float) dstY0 / dst_surface->height * 2.0f - 1.0f,
+ (float) dstX1 / dst_surface->width * 2.0f - 1.0f,
+ (float) dstY1 / dst_surface->height * 2.0f - 1.0f,
+ s0, t0,
+ s1, t1,
+ z);
+
+ util_draw_vertex_buffer(ctx->pipe, ctx->cso, ctx->vbuf, offset,
+ PIPE_PRIM_TRIANGLE_FAN,
+ 4, /* verts */
+ 2); /* attribs/vert */
+
+ /* restore state we changed */
+ cso_restore_blend(ctx->cso);
+ cso_restore_depth_stencil_alpha(ctx->cso);
+ cso_restore_rasterizer(ctx->cso);
+ cso_restore_samplers(ctx->cso);
+ cso_restore_fragment_sampler_views(ctx->cso);
+ cso_restore_viewport(ctx->cso);
+ cso_restore_framebuffer(ctx->cso);
+ cso_restore_fragment_shader(ctx->cso);
+ cso_restore_vertex_shader(ctx->cso);
+ cso_restore_clip(ctx->cso);
+ cso_restore_vertex_elements(ctx->cso);
+ cso_restore_vertex_buffers(ctx->cso);
+
+ pipe_sampler_view_reference(&sampler_view, NULL);
+ if (dst_surface != dst)
+ pipe_surface_reference(&dst_surface, NULL);
+}
+
+
+void
+util_blit_pixels(struct blit_state *ctx,
+ struct pipe_resource *src_tex,
+ unsigned src_level,
+ int srcX0, int srcY0,
+ int srcX1, int srcY1,
+ int srcZ,
+ struct pipe_surface *dst,
+ int dstX0, int dstY0,
+ int dstX1, int dstY1,
+ float z, uint filter )
+{
+ util_blit_pixels_writemask( ctx, src_tex,
+ src_level,
+ srcX0, srcY0,
+ srcX1, srcY1,
+ srcZ,
+ dst,
+ dstX0, dstY0,
+ dstX1, dstY1,
+ z, filter,
+ TGSI_WRITEMASK_XYZW );
+}
+
+
+/* Release vertex buffer at end of frame to avoid synchronous
+ * rendering.
+ */
+void util_blit_flush( struct blit_state *ctx )
+{
+ pipe_resource_reference(&ctx->vbuf, NULL);
+ ctx->vbuf_slot = 0;
+}
+
+
+
+/**
+ * Copy pixel block from src texture to dst surface.
+ * The sampler view's first_level field indicates the source
+ * mipmap level to use.
+ * XXX need some control over blitting Z and/or stencil.
+ */
+void
+util_blit_pixels_tex(struct blit_state *ctx,
+ struct pipe_sampler_view *src_sampler_view,
+ int srcX0, int srcY0,
+ int srcX1, int srcY1,
+ struct pipe_surface *dst,
+ int dstX0, int dstY0,
+ int dstX1, int dstY1,
+ float z, uint filter)
+{
+ boolean normalized = src_sampler_view->texture->target != PIPE_TEXTURE_RECT;
+ struct pipe_framebuffer_state fb;
+ float s0, t0, s1, t1;
+ unsigned offset;
+ struct pipe_resource *tex = src_sampler_view->texture;
+
+ assert(filter == PIPE_TEX_MIPFILTER_NEAREST ||
+ filter == PIPE_TEX_MIPFILTER_LINEAR);
+
+ assert(tex);
+ assert(tex->width0 != 0);
+ assert(tex->height0 != 0);
+
+ s0 = srcX0;
+ s1 = srcX1;
+ t0 = srcY0;
+ t1 = srcY1;
+
+ if(normalized)
+ {
+ /* normalize according to the mipmap level's size */
+ int level = src_sampler_view->u.tex.first_level;
+ float w = (float) u_minify(tex->width0, level);
+ float h = (float) u_minify(tex->height0, level);
+ s0 /= w;
+ s1 /= w;
+ t0 /= h;
+ t1 /= h;
+ }
+
+ assert(ctx->pipe->screen->is_format_supported(ctx->pipe->screen, dst->format,
+ PIPE_TEXTURE_2D,
+ dst->texture->nr_samples,
+ PIPE_BIND_RENDER_TARGET));
+
+ /* save state (restored below) */
+ cso_save_blend(ctx->cso);
+ cso_save_depth_stencil_alpha(ctx->cso);
+ cso_save_rasterizer(ctx->cso);
+ cso_save_samplers(ctx->cso);
+ cso_save_fragment_sampler_views(ctx->cso);
+ cso_save_viewport(ctx->cso);
+ cso_save_framebuffer(ctx->cso);
+ cso_save_fragment_shader(ctx->cso);
+ cso_save_vertex_shader(ctx->cso);
+ cso_save_clip(ctx->cso);
+ cso_save_vertex_elements(ctx->cso);
+ cso_save_vertex_buffers(ctx->cso);
+
+ /* set misc state we care about */
+ cso_set_blend(ctx->cso, &ctx->blend);
+ cso_set_depth_stencil_alpha(ctx->cso, &ctx->depthstencil_keep);
+ cso_set_rasterizer(ctx->cso, &ctx->rasterizer);
+ cso_set_clip(ctx->cso, &ctx->clip);
+ cso_set_vertex_elements(ctx->cso, 2, ctx->velem);
+
+ /* sampler */
+ ctx->sampler.normalized_coords = normalized;
+ ctx->sampler.min_img_filter = filter;
+ ctx->sampler.mag_img_filter = filter;
+ cso_single_sampler(ctx->cso, 0, &ctx->sampler);
+ cso_single_sampler_done(ctx->cso);
+
+ /* viewport */
+ ctx->viewport.scale[0] = 0.5f * dst->width;
+ ctx->viewport.scale[1] = 0.5f * dst->height;
+ ctx->viewport.scale[2] = 0.5f;
+ ctx->viewport.scale[3] = 1.0f;
+ ctx->viewport.translate[0] = 0.5f * dst->width;
+ ctx->viewport.translate[1] = 0.5f * dst->height;
+ ctx->viewport.translate[2] = 0.5f;
+ ctx->viewport.translate[3] = 0.0f;
+ cso_set_viewport(ctx->cso, &ctx->viewport);
+
+ /* texture */
+ cso_set_fragment_sampler_views(ctx->cso, 1, &src_sampler_view);
+
+ /* shaders */
+ set_fragment_shader(ctx, TGSI_WRITEMASK_XYZW);
+ set_vertex_shader(ctx);
+
+ /* drawing dest */
+ memset(&fb, 0, sizeof(fb));
+ fb.width = dst->width;
+ fb.height = dst->height;
+ fb.nr_cbufs = 1;
+ fb.cbufs[0] = dst;
+ cso_set_framebuffer(ctx->cso, &fb);
+
+ /* draw quad */
+ offset = setup_vertex_data_tex(ctx,
+ (float) dstX0 / dst->width * 2.0f - 1.0f,
+ (float) dstY0 / dst->height * 2.0f - 1.0f,
+ (float) dstX1 / dst->width * 2.0f - 1.0f,
+ (float) dstY1 / dst->height * 2.0f - 1.0f,
+ s0, t0, s1, t1,
+ z);
+
+ util_draw_vertex_buffer(ctx->pipe, ctx->cso,
+ ctx->vbuf, offset,
+ PIPE_PRIM_TRIANGLE_FAN,
+ 4, /* verts */
+ 2); /* attribs/vert */
+
+ /* restore state we changed */
+ cso_restore_blend(ctx->cso);
+ cso_restore_depth_stencil_alpha(ctx->cso);
+ cso_restore_rasterizer(ctx->cso);
+ cso_restore_samplers(ctx->cso);
+ cso_restore_fragment_sampler_views(ctx->cso);
+ cso_restore_viewport(ctx->cso);
+ cso_restore_framebuffer(ctx->cso);
+ cso_restore_fragment_shader(ctx->cso);
+ cso_restore_vertex_shader(ctx->cso);
+ cso_restore_clip(ctx->cso);
+ cso_restore_vertex_elements(ctx->cso);
+ cso_restore_vertex_buffers(ctx->cso);
+}
diff --git a/mesalib/src/gallium/auxiliary/util/u_format_latc.c b/mesalib/src/gallium/auxiliary/util/u_format_latc.c
index a25faf5d9..113a793e2 100644
--- a/mesalib/src/gallium/auxiliary/util/u_format_latc.c
+++ b/mesalib/src/gallium/auxiliary/util/u_format_latc.c
@@ -1,328 +1,326 @@
-/**************************************************************************
- *
- * Copyright (C) 2011 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include <stdio.h>
-#include "u_math.h"
-#include "u_format.h"
-#include "u_format_rgtc.h"
-#include "u_format_latc.h"
-
-static void u_format_unsigned_encode_rgtc_chan(uint8_t *blkaddr, uint8_t srccolors[4][4],
- int numxpixels, int numypixels);
-
-static void u_format_unsigned_fetch_texel_rgtc(unsigned srcRowStride, const uint8_t *pixdata,
- unsigned i, unsigned j, uint8_t *value, unsigned comps);
-
-static void u_format_signed_encode_rgtc_chan(int8_t *blkaddr, int8_t srccolors[4][4],
- int numxpixels, int numypixels);
-
-static void u_format_signed_fetch_texel_rgtc(unsigned srcRowStride, const int8_t *pixdata,
- unsigned i, unsigned j, int8_t *value, unsigned comps);
-
-void
-util_format_latc1_unorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
-{
- /* Fix warnings here: */
- (void) u_format_unsigned_encode_rgtc_chan;
- (void) u_format_signed_encode_rgtc_chan;
-
- u_format_unsigned_fetch_texel_rgtc(0, src, i, j, dst, 1);
-}
-
-void
-util_format_latc1_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- util_format_rgtc1_unorm_unpack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, width, height);
-}
-
-void
-util_format_latc1_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row,
- unsigned src_stride, unsigned width, unsigned height)
-{
- util_format_rgtc1_unorm_pack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, width, height);
-}
-
-void
-util_format_latc1_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- unsigned x, y, i, j;
- int block_size = 8;
-
- for(y = 0; y < height; y += 4) {
- const uint8_t *src = src_row;
- for(x = 0; x < width; x += 4) {
- for(j = 0; j < 4; ++j) {
- for(i = 0; i < 4; ++i) {
- float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
- uint8_t tmp_r;
- u_format_unsigned_fetch_texel_rgtc(0, src, i, j, &tmp_r, 1);
- dst[0] =
- dst[1] =
- dst[2] = ubyte_to_float(tmp_r);
- dst[3] = 1.0;
- }
- }
- src += block_size;
- }
- src_row += src_stride;
- }
-}
-
-void
-util_format_latc1_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- util_format_rgtc1_unorm_pack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height);
-}
-
-void
-util_format_latc1_unorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
-{
- uint8_t tmp_r;
-
- u_format_unsigned_fetch_texel_rgtc(0, src, i, j, &tmp_r, 1);
- dst[0] =
- dst[1] =
- dst[2] = ubyte_to_float(tmp_r);
- dst[3] = 1.0;
-}
-
-void
-util_format_latc1_snorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
-{
- fprintf(stderr,"%s\n", __func__);
-}
-
-void
-util_format_latc1_snorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- fprintf(stderr,"%s\n", __func__);
-}
-
-void
-util_format_latc1_snorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- fprintf(stderr,"%s\n", __func__);
-}
-
-void
-util_format_latc1_snorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- util_format_rgtc1_snorm_pack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height);
-}
-
-void
-util_format_latc1_snorm_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- unsigned x, y, i, j;
- int block_size = 8;
-
- for(y = 0; y < height; y += 4) {
- const int8_t *src = (int8_t *)src_row;
- for(x = 0; x < width; x += 4) {
- for(j = 0; j < 4; ++j) {
- for(i = 0; i < 4; ++i) {
- float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
- int8_t tmp_r;
- u_format_signed_fetch_texel_rgtc(0, src, i, j, &tmp_r, 1);
- dst[0] =
- dst[1] =
- dst[2] = byte_to_float_tex(tmp_r);
- dst[3] = 1.0;
- }
- }
- src += block_size;
- }
- src_row += src_stride;
- }
-}
-
-void
-util_format_latc1_snorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
-{
- int8_t tmp_r;
-
- u_format_signed_fetch_texel_rgtc(0, (int8_t *)src, i, j, &tmp_r, 1);
- dst[0] =
- dst[1] =
- dst[2] = byte_to_float_tex(tmp_r);
- dst[3] = 1.0;
-}
-
-
-void
-util_format_latc2_unorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
-{
- puts(__func__);
-
- u_format_unsigned_fetch_texel_rgtc(0, src, i, j, dst, 2);
- u_format_unsigned_fetch_texel_rgtc(0, src + 8, i, j, dst + 1, 2);
-}
-
-void
-util_format_latc2_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- util_format_rgtc2_unorm_unpack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, width, height);
-}
-
-void
-util_format_latc2_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- util_format_rgtc2_unorm_pack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, width, height);
-}
-
-void
-util_format_latc2_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- util_format_rxtc2_unorm_pack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height, 3);
-}
-
-void
-util_format_latc2_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- unsigned x, y, i, j;
- int block_size = 16;
-
- for(y = 0; y < height; y += 4) {
- const uint8_t *src = src_row;
- for(x = 0; x < width; x += 4) {
- for(j = 0; j < 4; ++j) {
- for(i = 0; i < 4; ++i) {
- float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
- uint8_t tmp_r, tmp_g;
- u_format_unsigned_fetch_texel_rgtc(0, src, i, j, &tmp_r, 2);
- u_format_unsigned_fetch_texel_rgtc(0, src + 8, i, j, &tmp_g, 2);
- dst[0] =
- dst[1] =
- dst[2] = ubyte_to_float(tmp_r);
- dst[3] = ubyte_to_float(tmp_g);
- }
- }
- src += block_size;
- }
- src_row += src_stride;
- }
-}
-
-void
-util_format_latc2_unorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
-{
- uint8_t tmp_r, tmp_g;
-
- u_format_unsigned_fetch_texel_rgtc(0, src, i, j, &tmp_r, 2);
- u_format_unsigned_fetch_texel_rgtc(0, src + 8, i, j, &tmp_g, 2);
- dst[0] =
- dst[1] =
- dst[2] = ubyte_to_float(tmp_r);
- dst[3] = ubyte_to_float(tmp_g);
-}
-
-
-void
-util_format_latc2_snorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
-{
- fprintf(stderr,"%s\n", __func__);
-}
-
-void
-util_format_latc2_snorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- fprintf(stderr,"%s\n", __func__);
-}
-
-void
-util_format_latc2_snorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- fprintf(stderr,"%s\n", __func__);
-}
-
-void
-util_format_latc2_snorm_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- unsigned x, y, i, j;
- int block_size = 16;
-
- for(y = 0; y < height; y += 4) {
- const int8_t *src = (int8_t *)src_row;
- for(x = 0; x < width; x += 4) {
- for(j = 0; j < 4; ++j) {
- for(i = 0; i < 4; ++i) {
- float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
- int8_t tmp_r, tmp_g;
- u_format_signed_fetch_texel_rgtc(0, src, i, j, &tmp_r, 2);
- u_format_signed_fetch_texel_rgtc(0, src + 8, i, j, &tmp_g, 2);
- dst[0] =
- dst[1] =
- dst[2] = byte_to_float_tex(tmp_r);
- dst[3] = byte_to_float_tex(tmp_g);
- }
- }
- src += block_size;
- }
- src_row += src_stride;
- }
-}
-
-void
-util_format_latc2_snorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- util_format_rxtc2_snorm_pack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height, 3);
-}
-
-void
-util_format_latc2_snorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
-{
- int8_t tmp_r, tmp_g;
-
- u_format_signed_fetch_texel_rgtc(0, (int8_t *)src, i, j, &tmp_r, 2);
- u_format_signed_fetch_texel_rgtc(0, (int8_t *)src + 8, i, j, &tmp_g, 2);
- dst[0] =
- dst[1] =
- dst[2] = byte_to_float_tex(tmp_r);
- dst[3] = byte_to_float_tex(tmp_g);
-}
-
-
-#define TAG(x) u_format_unsigned_##x
-#define TYPE uint8_t
-#define T_MIN 0
-#define T_MAX 255
-
-#include "../../../mesa/main/texcompress_rgtc_tmp.h"
-
-#undef TYPE
-#undef TAG
-#undef T_MIN
-#undef T_MAX
-
-
-#define TAG(x) u_format_signed_##x
-#define TYPE int8_t
-#define T_MIN (int8_t)-128
-#define T_MAX (int8_t)127
-
-#include "../../../mesa/main/texcompress_rgtc_tmp.h"
-
-#undef TYPE
-#undef TAG
-#undef T_MIN
-#undef T_MAX
+/**************************************************************************
+ *
+ * Copyright (C) 2011 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include <stdio.h>
+#include "u_math.h"
+#include "u_format.h"
+#include "u_format_rgtc.h"
+#include "u_format_latc.h"
+
+static void u_format_unsigned_encode_rgtc_ubyte(uint8_t *blkaddr, uint8_t srccolors[4][4],
+ int numxpixels, int numypixels);
+
+static void u_format_unsigned_fetch_texel_rgtc(unsigned srcRowStride, const uint8_t *pixdata,
+ unsigned i, unsigned j, uint8_t *value, unsigned comps);
+
+static void u_format_signed_encode_rgtc_ubyte(int8_t *blkaddr, int8_t srccolors[4][4],
+ int numxpixels, int numypixels);
+
+static void u_format_signed_fetch_texel_rgtc(unsigned srcRowStride, const int8_t *pixdata,
+ unsigned i, unsigned j, int8_t *value, unsigned comps);
+
+void
+util_format_latc1_unorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
+{
+ /* Fix warnings here: */
+ (void) u_format_unsigned_encode_rgtc_ubyte;
+ (void) u_format_signed_encode_rgtc_ubyte;
+
+ u_format_unsigned_fetch_texel_rgtc(0, src, i, j, dst, 1);
+}
+
+void
+util_format_latc1_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ util_format_rgtc1_unorm_unpack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, width, height);
+}
+
+void
+util_format_latc1_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row,
+ unsigned src_stride, unsigned width, unsigned height)
+{
+ util_format_rgtc1_unorm_pack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, width, height);
+}
+
+void
+util_format_latc1_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ unsigned x, y, i, j;
+ int block_size = 8;
+
+ for(y = 0; y < height; y += 4) {
+ const uint8_t *src = src_row;
+ for(x = 0; x < width; x += 4) {
+ for(j = 0; j < 4; ++j) {
+ for(i = 0; i < 4; ++i) {
+ float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
+ uint8_t tmp_r;
+ u_format_unsigned_fetch_texel_rgtc(0, src, i, j, &tmp_r, 1);
+ dst[0] =
+ dst[1] =
+ dst[2] = ubyte_to_float(tmp_r);
+ dst[3] = 1.0;
+ }
+ }
+ src += block_size;
+ }
+ src_row += src_stride;
+ }
+}
+
+void
+util_format_latc1_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ util_format_rgtc1_unorm_pack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height);
+}
+
+void
+util_format_latc1_unorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
+{
+ uint8_t tmp_r;
+
+ u_format_unsigned_fetch_texel_rgtc(0, src, i, j, &tmp_r, 1);
+ dst[0] =
+ dst[1] =
+ dst[2] = ubyte_to_float(tmp_r);
+ dst[3] = 1.0;
+}
+
+void
+util_format_latc1_snorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
+{
+ fprintf(stderr,"%s\n", __func__);
+}
+
+void
+util_format_latc1_snorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ fprintf(stderr,"%s\n", __func__);
+}
+
+void
+util_format_latc1_snorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ fprintf(stderr,"%s\n", __func__);
+}
+
+void
+util_format_latc1_snorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ util_format_rgtc1_snorm_pack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height);
+}
+
+void
+util_format_latc1_snorm_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ unsigned x, y, i, j;
+ int block_size = 8;
+
+ for(y = 0; y < height; y += 4) {
+ const int8_t *src = (int8_t *)src_row;
+ for(x = 0; x < width; x += 4) {
+ for(j = 0; j < 4; ++j) {
+ for(i = 0; i < 4; ++i) {
+ float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
+ int8_t tmp_r;
+ u_format_signed_fetch_texel_rgtc(0, src, i, j, &tmp_r, 1);
+ dst[0] =
+ dst[1] =
+ dst[2] = byte_to_float_tex(tmp_r);
+ dst[3] = 1.0;
+ }
+ }
+ src += block_size;
+ }
+ src_row += src_stride;
+ }
+}
+
+void
+util_format_latc1_snorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
+{
+ int8_t tmp_r;
+
+ u_format_signed_fetch_texel_rgtc(0, (int8_t *)src, i, j, &tmp_r, 1);
+ dst[0] =
+ dst[1] =
+ dst[2] = byte_to_float_tex(tmp_r);
+ dst[3] = 1.0;
+}
+
+
+void
+util_format_latc2_unorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
+{
+ u_format_unsigned_fetch_texel_rgtc(0, src, i, j, dst, 2);
+ u_format_unsigned_fetch_texel_rgtc(0, src + 8, i, j, dst + 1, 2);
+}
+
+void
+util_format_latc2_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ util_format_rgtc2_unorm_unpack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, width, height);
+}
+
+void
+util_format_latc2_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ util_format_rgtc2_unorm_pack_rgba_8unorm(dst_row, dst_stride, src_row, src_stride, width, height);
+}
+
+void
+util_format_latc2_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ util_format_rxtc2_unorm_pack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height, 3);
+}
+
+void
+util_format_latc2_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ unsigned x, y, i, j;
+ int block_size = 16;
+
+ for(y = 0; y < height; y += 4) {
+ const uint8_t *src = src_row;
+ for(x = 0; x < width; x += 4) {
+ for(j = 0; j < 4; ++j) {
+ for(i = 0; i < 4; ++i) {
+ float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
+ uint8_t tmp_r, tmp_g;
+ u_format_unsigned_fetch_texel_rgtc(0, src, i, j, &tmp_r, 2);
+ u_format_unsigned_fetch_texel_rgtc(0, src + 8, i, j, &tmp_g, 2);
+ dst[0] =
+ dst[1] =
+ dst[2] = ubyte_to_float(tmp_r);
+ dst[3] = ubyte_to_float(tmp_g);
+ }
+ }
+ src += block_size;
+ }
+ src_row += src_stride;
+ }
+}
+
+void
+util_format_latc2_unorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
+{
+ uint8_t tmp_r, tmp_g;
+
+ u_format_unsigned_fetch_texel_rgtc(0, src, i, j, &tmp_r, 2);
+ u_format_unsigned_fetch_texel_rgtc(0, src + 8, i, j, &tmp_g, 2);
+ dst[0] =
+ dst[1] =
+ dst[2] = ubyte_to_float(tmp_r);
+ dst[3] = ubyte_to_float(tmp_g);
+}
+
+
+void
+util_format_latc2_snorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
+{
+ fprintf(stderr,"%s\n", __func__);
+}
+
+void
+util_format_latc2_snorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ fprintf(stderr,"%s\n", __func__);
+}
+
+void
+util_format_latc2_snorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ fprintf(stderr,"%s\n", __func__);
+}
+
+void
+util_format_latc2_snorm_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ unsigned x, y, i, j;
+ int block_size = 16;
+
+ for(y = 0; y < height; y += 4) {
+ const int8_t *src = (int8_t *)src_row;
+ for(x = 0; x < width; x += 4) {
+ for(j = 0; j < 4; ++j) {
+ for(i = 0; i < 4; ++i) {
+ float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
+ int8_t tmp_r, tmp_g;
+ u_format_signed_fetch_texel_rgtc(0, src, i, j, &tmp_r, 2);
+ u_format_signed_fetch_texel_rgtc(0, src + 8, i, j, &tmp_g, 2);
+ dst[0] =
+ dst[1] =
+ dst[2] = byte_to_float_tex(tmp_r);
+ dst[3] = byte_to_float_tex(tmp_g);
+ }
+ }
+ src += block_size;
+ }
+ src_row += src_stride;
+ }
+}
+
+void
+util_format_latc2_snorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ util_format_rxtc2_snorm_pack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height, 3);
+}
+
+void
+util_format_latc2_snorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
+{
+ int8_t tmp_r, tmp_g;
+
+ u_format_signed_fetch_texel_rgtc(0, (int8_t *)src, i, j, &tmp_r, 2);
+ u_format_signed_fetch_texel_rgtc(0, (int8_t *)src + 8, i, j, &tmp_g, 2);
+ dst[0] =
+ dst[1] =
+ dst[2] = byte_to_float_tex(tmp_r);
+ dst[3] = byte_to_float_tex(tmp_g);
+}
+
+
+#define TAG(x) u_format_unsigned_##x
+#define TYPE uint8_t
+#define T_MIN 0
+#define T_MAX 255
+
+#include "../../../mesa/main/texcompress_rgtc_tmp.h"
+
+#undef TYPE
+#undef TAG
+#undef T_MIN
+#undef T_MAX
+
+
+#define TAG(x) u_format_signed_##x
+#define TYPE int8_t
+#define T_MIN (int8_t)-128
+#define T_MAX (int8_t)127
+
+#include "../../../mesa/main/texcompress_rgtc_tmp.h"
+
+#undef TYPE
+#undef TAG
+#undef T_MIN
+#undef T_MAX
diff --git a/mesalib/src/gallium/auxiliary/util/u_format_rgtc.c b/mesalib/src/gallium/auxiliary/util/u_format_rgtc.c
index c3fa54c74..2371bab1e 100644
--- a/mesalib/src/gallium/auxiliary/util/u_format_rgtc.c
+++ b/mesalib/src/gallium/auxiliary/util/u_format_rgtc.c
@@ -1,464 +1,464 @@
-/**************************************************************************
- *
- * Copyright (C) 2011 Red Hat Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **************************************************************************/
-
-#include <stdio.h>
-#include "u_math.h"
-#include "u_format.h"
-#include "u_format_rgtc.h"
-
-static void u_format_unsigned_encode_rgtc_chan(uint8_t *blkaddr, uint8_t srccolors[4][4],
- int numxpixels, int numypixels);
-
-static void u_format_unsigned_fetch_texel_rgtc(unsigned srcRowStride, const uint8_t *pixdata,
- unsigned i, unsigned j, uint8_t *value, unsigned comps);
-
-static void u_format_signed_encode_rgtc_chan(int8_t *blkaddr, int8_t srccolors[4][4],
- int numxpixels, int numypixels);
-
-static void u_format_signed_fetch_texel_rgtc(unsigned srcRowStride, const int8_t *pixdata,
- unsigned i, unsigned j, int8_t *value, unsigned comps);
-
-void
-util_format_rgtc1_unorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
-{
- u_format_unsigned_fetch_texel_rgtc(0, src, i, j, dst, 1);
-}
-
-void
-util_format_rgtc1_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- const unsigned bw = 4, bh = 4, comps = 4;
- unsigned x, y, i, j;
- unsigned block_size = 8;
-
- for(y = 0; y < height; y += bh) {
- const uint8_t *src = src_row;
- for(x = 0; x < width; x += bw) {
- for(j = 0; j < bh; ++j) {
- for(i = 0; i < bw; ++i) {
- uint8_t *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*comps;
- u_format_unsigned_fetch_texel_rgtc(0, src, i, j, dst, 1);
- }
- }
- src += block_size;
- }
- src_row += src_stride;
- }
-}
-
-void
-util_format_rgtc1_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row,
- unsigned src_stride, unsigned width, unsigned height)
-{
- const unsigned bw = 4, bh = 4, bytes_per_block = 8;
- unsigned x, y, i, j;
-
- for(y = 0; y < height; y += bh) {
- uint8_t *dst = dst_row;
- for(x = 0; x < width; x += bw) {
- uint8_t tmp[4][4]; /* [bh][bw][comps] */
- for(j = 0; j < bh; ++j) {
- for(i = 0; i < bw; ++i) {
- tmp[j][i] = src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4];
- }
- }
- u_format_unsigned_encode_rgtc_chan(dst, tmp, 4, 4);
- dst += bytes_per_block;
- }
- dst_row += dst_stride / sizeof(*dst_row);
- }
-}
-
-void
-util_format_rgtc1_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- unsigned x, y, i, j;
- int block_size = 8;
- for(y = 0; y < height; y += 4) {
- const uint8_t *src = src_row;
- for(x = 0; x < width; x += 4) {
- for(j = 0; j < 4; ++j) {
- for(i = 0; i < 4; ++i) {
- float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
- uint8_t tmp_r;
- u_format_unsigned_fetch_texel_rgtc(0, src, i, j, &tmp_r, 1);
- dst[0] = ubyte_to_float(tmp_r);
- dst[1] = 0.0;
- dst[2] = 0.0;
- dst[3] = 1.0;
- }
- }
- src += block_size;
- }
- src_row += src_stride;
- }
-}
-
-void
-util_format_rgtc1_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- const unsigned bw = 4, bh = 4, bytes_per_block = 8;
- unsigned x, y, i, j;
-
- for(y = 0; y < height; y += bh) {
- uint8_t *dst = dst_row;
- for(x = 0; x < width; x += bw) {
- uint8_t tmp[4][4]; /* [bh][bw][comps] */
- for(j = 0; j < bh; ++j) {
- for(i = 0; i < bw; ++i) {
- tmp[j][i] = float_to_ubyte(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4]);
- }
- }
- u_format_unsigned_encode_rgtc_chan(dst, tmp, 4, 4);
- dst += bytes_per_block;
- }
- dst_row += dst_stride / sizeof(*dst_row);
- }
-}
-
-void
-util_format_rgtc1_unorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
-{
- uint8_t tmp_r;
- u_format_unsigned_fetch_texel_rgtc(0, src, i, j, &tmp_r, 1);
- dst[0] = ubyte_to_float(tmp_r);
- dst[1] = 0.0;
- dst[2] = 0.0;
- dst[3] = 1.0;
-}
-
-void
-util_format_rgtc1_snorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
-{
- fprintf(stderr,"%s\n", __func__);
-}
-
-void
-util_format_rgtc1_snorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- fprintf(stderr,"%s\n", __func__);
-}
-
-void
-util_format_rgtc1_snorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- fprintf(stderr,"%s\n", __func__);
-}
-
-void
-util_format_rgtc1_snorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- const unsigned bw = 4, bh = 4, bytes_per_block = 8;
- unsigned x, y, i, j;
-
- for(y = 0; y < height; y += bh) {
- int8_t *dst = (int8_t *)dst_row;
- for(x = 0; x < width; x += bw) {
- int8_t tmp[4][4]; /* [bh][bw][comps] */
- for(j = 0; j < bh; ++j) {
- for(i = 0; i < bw; ++i) {
- tmp[j][i] = float_to_byte_tex(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4]);
- }
- }
- u_format_signed_encode_rgtc_chan(dst, tmp, 4, 4);
- dst += bytes_per_block;
- }
- dst_row += dst_stride / sizeof(*dst_row);
- }
-}
-
-void
-util_format_rgtc1_snorm_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- unsigned x, y, i, j;
- int block_size = 8;
- for(y = 0; y < height; y += 4) {
- const int8_t *src = (int8_t *)src_row;
- for(x = 0; x < width; x += 4) {
- for(j = 0; j < 4; ++j) {
- for(i = 0; i < 4; ++i) {
- float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
- int8_t tmp_r;
- u_format_signed_fetch_texel_rgtc(0, src, i, j, &tmp_r, 1);
- dst[0] = byte_to_float_tex(tmp_r);
- dst[1] = 0.0;
- dst[2] = 0.0;
- dst[3] = 1.0;
- }
- }
- src += block_size;
- }
- src_row += src_stride;
- }
-}
-
-void
-util_format_rgtc1_snorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
-{
- int8_t tmp_r;
- u_format_signed_fetch_texel_rgtc(0, (int8_t *)src, i, j, &tmp_r, 1);
- dst[0] = byte_to_float_tex(tmp_r);
- dst[1] = 0.0;
- dst[2] = 0.0;
- dst[3] = 1.0;
-}
-
-
-void
-util_format_rgtc2_unorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
-{
- u_format_unsigned_fetch_texel_rgtc(0, src, i, j, dst, 2);
- u_format_unsigned_fetch_texel_rgtc(0, src + 8, i, j, dst + 1, 2);
-}
-
-void
-util_format_rgtc2_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- const unsigned bw = 4, bh = 4, comps = 4;
- unsigned x, y, i, j;
- unsigned block_size = 16;
-
- for(y = 0; y < height; y += bh) {
- const uint8_t *src = src_row;
- for(x = 0; x < width; x += bw) {
- for(j = 0; j < bh; ++j) {
- for(i = 0; i < bw; ++i) {
- uint8_t *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*comps;
- u_format_unsigned_fetch_texel_rgtc(0, src, i, j, dst, 2);
- u_format_unsigned_fetch_texel_rgtc(0, src + 8, i, j, dst + 1, 2);
-
- }
- }
- src += block_size;
- }
- src_row += src_stride;
- }
-}
-
-void
-util_format_rgtc2_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- const unsigned bw = 4, bh = 4, bytes_per_block = 16;
- unsigned x, y, i, j;
-
- for(y = 0; y < height; y += bh) {
- uint8_t *dst = dst_row;
- for(x = 0; x < width; x += bw) {
- uint8_t tmp_r[4][4]; /* [bh][bw] */
- uint8_t tmp_g[4][4]; /* [bh][bw] */
- for(j = 0; j < bh; ++j) {
- for(i = 0; i < bw; ++i) {
- tmp_r[j][i] = src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4];
- tmp_g[j][i] = src_row[((y + j)*src_stride/sizeof(*src_row) + (x + i)*4) + 1];
- }
- }
- u_format_unsigned_encode_rgtc_chan(dst, tmp_r, 4, 4);
- u_format_unsigned_encode_rgtc_chan(dst + 8, tmp_g, 4, 4);
- dst += bytes_per_block;
- }
- dst_row += dst_stride / sizeof(*dst_row);
- }
-}
-
-void
-util_format_rxtc2_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height, unsigned chan2off)
-{
- const unsigned bw = 4, bh = 4, bytes_per_block = 16;
- unsigned x, y, i, j;
-
- for(y = 0; y < height; y += bh) {
- uint8_t *dst = dst_row;
- for(x = 0; x < width; x += bw) {
- uint8_t tmp_r[4][4]; /* [bh][bw][comps] */
- uint8_t tmp_g[4][4]; /* [bh][bw][comps] */
- for(j = 0; j < bh; ++j) {
- for(i = 0; i < bw; ++i) {
- tmp_r[j][i] = float_to_ubyte(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4]);
- tmp_g[j][i] = float_to_ubyte(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4 + chan2off]);
- }
- }
- u_format_unsigned_encode_rgtc_chan(dst, tmp_r, 4, 4);
- u_format_unsigned_encode_rgtc_chan(dst + 8, tmp_g, 4, 4);
- dst += bytes_per_block;
- }
- dst_row += dst_stride / sizeof(*dst_row);
- }
-}
-
-void
-util_format_rgtc2_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- util_format_rxtc2_unorm_pack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height, 1);
-}
-
-void
-util_format_rgtc2_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- unsigned x, y, i, j;
- int block_size = 16;
- for(y = 0; y < height; y += 4) {
- const uint8_t *src = src_row;
- for(x = 0; x < width; x += 4) {
- for(j = 0; j < 4; ++j) {
- for(i = 0; i < 4; ++i) {
- float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
- uint8_t tmp_r, tmp_g;
- u_format_unsigned_fetch_texel_rgtc(0, src, i, j, &tmp_r, 2);
- u_format_unsigned_fetch_texel_rgtc(0, src + 8, i, j, &tmp_g, 2);
- dst[0] = ubyte_to_float(tmp_r);
- dst[1] = ubyte_to_float(tmp_g);
- dst[2] = 0.0;
- dst[3] = 1.0;
- }
- }
- src += block_size;
- }
- src_row += src_stride;
- }
-}
-
-void
-util_format_rgtc2_unorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
-{
- uint8_t tmp_r, tmp_g;
- u_format_unsigned_fetch_texel_rgtc(0, src, i, j, &tmp_r, 2);
- u_format_unsigned_fetch_texel_rgtc(0, src + 8, i, j, &tmp_g, 2);
- dst[0] = ubyte_to_float(tmp_r);
- dst[1] = ubyte_to_float(tmp_g);
- dst[2] = 0.0;
- dst[3] = 1.0;
-}
-
-
-void
-util_format_rgtc2_snorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
-{
- fprintf(stderr,"%s\n", __func__);
-}
-
-void
-util_format_rgtc2_snorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- fprintf(stderr,"%s\n", __func__);
-}
-
-void
-util_format_rgtc2_snorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- fprintf(stderr,"%s\n", __func__);
-}
-
-void
-util_format_rgtc2_snorm_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- unsigned x, y, i, j;
- int block_size = 16;
- for(y = 0; y < height; y += 4) {
- const int8_t *src = (int8_t *)src_row;
- for(x = 0; x < width; x += 4) {
- for(j = 0; j < 4; ++j) {
- for(i = 0; i < 4; ++i) {
- float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
- int8_t tmp_r, tmp_g;
- u_format_signed_fetch_texel_rgtc(0, src, i, j, &tmp_r, 2);
- u_format_signed_fetch_texel_rgtc(0, src + 8, i, j, &tmp_g, 2);
- dst[0] = byte_to_float_tex(tmp_r);
- dst[1] = byte_to_float_tex(tmp_g);
- dst[2] = 0.0;
- dst[3] = 1.0;
- }
- }
- src += block_size;
- }
- src_row += src_stride;
- }
-}
-
-void
-util_format_rxtc2_snorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height, unsigned chan2off)
-{
- const unsigned bw = 4, bh = 4, bytes_per_block = 16;
- unsigned x, y, i, j;
-
- for(y = 0; y < height; y += bh) {
- int8_t *dst = (int8_t *)dst_row;
- for(x = 0; x < width; x += bw) {
- int8_t tmp_r[4][4]; /* [bh][bw][comps] */
- int8_t tmp_g[4][4]; /* [bh][bw][comps] */
- for(j = 0; j < bh; ++j) {
- for(i = 0; i < bw; ++i) {
- tmp_r[j][i] = float_to_byte_tex(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4]);
- tmp_g[j][i] = float_to_byte_tex(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4 + chan2off]);
- }
- }
- u_format_signed_encode_rgtc_chan(dst, tmp_r, 4, 4);
- u_format_signed_encode_rgtc_chan(dst + 8, tmp_g, 4, 4);
- dst += bytes_per_block;
- }
- dst_row += dst_stride / sizeof(*dst_row);
- }
-}
-
-void
-util_format_rgtc2_snorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
-{
- util_format_rxtc2_snorm_pack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height, 1);
-}
-
-void
-util_format_rgtc2_snorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
-{
- int8_t tmp_r, tmp_g;
- u_format_signed_fetch_texel_rgtc(0, (int8_t *)src, i, j, &tmp_r, 2);
- u_format_signed_fetch_texel_rgtc(0, (int8_t *)src + 8, i, j, &tmp_g, 2);
- dst[0] = byte_to_float_tex(tmp_r);
- dst[1] = byte_to_float_tex(tmp_g);
- dst[2] = 0.0;
- dst[3] = 1.0;
-}
-
-
-#define TAG(x) u_format_unsigned_##x
-#define TYPE uint8_t
-#define T_MIN 0
-#define T_MAX 255
-
-#include "../../../mesa/main/texcompress_rgtc_tmp.h"
-
-#undef TYPE
-#undef TAG
-#undef T_MIN
-#undef T_MAX
-
-
-#define TAG(x) u_format_signed_##x
-#define TYPE int8_t
-#define T_MIN (int8_t)-128
-#define T_MAX (int8_t)127
-
-#include "../../../mesa/main/texcompress_rgtc_tmp.h"
-
-#undef TYPE
-#undef TAG
-#undef T_MIN
-#undef T_MAX
+/**************************************************************************
+ *
+ * Copyright (C) 2011 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+#include <stdio.h>
+#include "u_math.h"
+#include "u_format.h"
+#include "u_format_rgtc.h"
+
+static void u_format_unsigned_encode_rgtc_ubyte(uint8_t *blkaddr, uint8_t srccolors[4][4],
+ int numxpixels, int numypixels);
+
+static void u_format_unsigned_fetch_texel_rgtc(unsigned srcRowStride, const uint8_t *pixdata,
+ unsigned i, unsigned j, uint8_t *value, unsigned comps);
+
+static void u_format_signed_encode_rgtc_ubyte(int8_t *blkaddr, int8_t srccolors[4][4],
+ int numxpixels, int numypixels);
+
+static void u_format_signed_fetch_texel_rgtc(unsigned srcRowStride, const int8_t *pixdata,
+ unsigned i, unsigned j, int8_t *value, unsigned comps);
+
+void
+util_format_rgtc1_unorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
+{
+ u_format_unsigned_fetch_texel_rgtc(0, src, i, j, dst, 1);
+}
+
+void
+util_format_rgtc1_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ const unsigned bw = 4, bh = 4, comps = 4;
+ unsigned x, y, i, j;
+ unsigned block_size = 8;
+
+ for(y = 0; y < height; y += bh) {
+ const uint8_t *src = src_row;
+ for(x = 0; x < width; x += bw) {
+ for(j = 0; j < bh; ++j) {
+ for(i = 0; i < bw; ++i) {
+ uint8_t *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*comps;
+ u_format_unsigned_fetch_texel_rgtc(0, src, i, j, dst, 1);
+ }
+ }
+ src += block_size;
+ }
+ src_row += src_stride;
+ }
+}
+
+void
+util_format_rgtc1_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row,
+ unsigned src_stride, unsigned width, unsigned height)
+{
+ const unsigned bw = 4, bh = 4, bytes_per_block = 8;
+ unsigned x, y, i, j;
+
+ for(y = 0; y < height; y += bh) {
+ uint8_t *dst = dst_row;
+ for(x = 0; x < width; x += bw) {
+ uint8_t tmp[4][4]; /* [bh][bw][comps] */
+ for(j = 0; j < bh; ++j) {
+ for(i = 0; i < bw; ++i) {
+ tmp[j][i] = src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4];
+ }
+ }
+ u_format_unsigned_encode_rgtc_ubyte(dst, tmp, 4, 4);
+ dst += bytes_per_block;
+ }
+ dst_row += dst_stride / sizeof(*dst_row);
+ }
+}
+
+void
+util_format_rgtc1_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ unsigned x, y, i, j;
+ int block_size = 8;
+ for(y = 0; y < height; y += 4) {
+ const uint8_t *src = src_row;
+ for(x = 0; x < width; x += 4) {
+ for(j = 0; j < 4; ++j) {
+ for(i = 0; i < 4; ++i) {
+ float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
+ uint8_t tmp_r;
+ u_format_unsigned_fetch_texel_rgtc(0, src, i, j, &tmp_r, 1);
+ dst[0] = ubyte_to_float(tmp_r);
+ dst[1] = 0.0;
+ dst[2] = 0.0;
+ dst[3] = 1.0;
+ }
+ }
+ src += block_size;
+ }
+ src_row += src_stride;
+ }
+}
+
+void
+util_format_rgtc1_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ const unsigned bw = 4, bh = 4, bytes_per_block = 8;
+ unsigned x, y, i, j;
+
+ for(y = 0; y < height; y += bh) {
+ uint8_t *dst = dst_row;
+ for(x = 0; x < width; x += bw) {
+ uint8_t tmp[4][4]; /* [bh][bw][comps] */
+ for(j = 0; j < bh; ++j) {
+ for(i = 0; i < bw; ++i) {
+ tmp[j][i] = float_to_ubyte(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4]);
+ }
+ }
+ u_format_unsigned_encode_rgtc_ubyte(dst, tmp, 4, 4);
+ dst += bytes_per_block;
+ }
+ dst_row += dst_stride / sizeof(*dst_row);
+ }
+}
+
+void
+util_format_rgtc1_unorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
+{
+ uint8_t tmp_r;
+ u_format_unsigned_fetch_texel_rgtc(0, src, i, j, &tmp_r, 1);
+ dst[0] = ubyte_to_float(tmp_r);
+ dst[1] = 0.0;
+ dst[2] = 0.0;
+ dst[3] = 1.0;
+}
+
+void
+util_format_rgtc1_snorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
+{
+ fprintf(stderr,"%s\n", __func__);
+}
+
+void
+util_format_rgtc1_snorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ fprintf(stderr,"%s\n", __func__);
+}
+
+void
+util_format_rgtc1_snorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ fprintf(stderr,"%s\n", __func__);
+}
+
+void
+util_format_rgtc1_snorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ const unsigned bw = 4, bh = 4, bytes_per_block = 8;
+ unsigned x, y, i, j;
+
+ for(y = 0; y < height; y += bh) {
+ int8_t *dst = (int8_t *)dst_row;
+ for(x = 0; x < width; x += bw) {
+ int8_t tmp[4][4]; /* [bh][bw][comps] */
+ for(j = 0; j < bh; ++j) {
+ for(i = 0; i < bw; ++i) {
+ tmp[j][i] = float_to_byte_tex(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4]);
+ }
+ }
+ u_format_signed_encode_rgtc_ubyte(dst, tmp, 4, 4);
+ dst += bytes_per_block;
+ }
+ dst_row += dst_stride / sizeof(*dst_row);
+ }
+}
+
+void
+util_format_rgtc1_snorm_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ unsigned x, y, i, j;
+ int block_size = 8;
+ for(y = 0; y < height; y += 4) {
+ const int8_t *src = (int8_t *)src_row;
+ for(x = 0; x < width; x += 4) {
+ for(j = 0; j < 4; ++j) {
+ for(i = 0; i < 4; ++i) {
+ float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
+ int8_t tmp_r;
+ u_format_signed_fetch_texel_rgtc(0, src, i, j, &tmp_r, 1);
+ dst[0] = byte_to_float_tex(tmp_r);
+ dst[1] = 0.0;
+ dst[2] = 0.0;
+ dst[3] = 1.0;
+ }
+ }
+ src += block_size;
+ }
+ src_row += src_stride;
+ }
+}
+
+void
+util_format_rgtc1_snorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
+{
+ int8_t tmp_r;
+ u_format_signed_fetch_texel_rgtc(0, (int8_t *)src, i, j, &tmp_r, 1);
+ dst[0] = byte_to_float_tex(tmp_r);
+ dst[1] = 0.0;
+ dst[2] = 0.0;
+ dst[3] = 1.0;
+}
+
+
+void
+util_format_rgtc2_unorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
+{
+ u_format_unsigned_fetch_texel_rgtc(0, src, i, j, dst, 2);
+ u_format_unsigned_fetch_texel_rgtc(0, src + 8, i, j, dst + 1, 2);
+}
+
+void
+util_format_rgtc2_unorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ const unsigned bw = 4, bh = 4, comps = 4;
+ unsigned x, y, i, j;
+ unsigned block_size = 16;
+
+ for(y = 0; y < height; y += bh) {
+ const uint8_t *src = src_row;
+ for(x = 0; x < width; x += bw) {
+ for(j = 0; j < bh; ++j) {
+ for(i = 0; i < bw; ++i) {
+ uint8_t *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*comps;
+ u_format_unsigned_fetch_texel_rgtc(0, src, i, j, dst, 2);
+ u_format_unsigned_fetch_texel_rgtc(0, src + 8, i, j, dst + 1, 2);
+
+ }
+ }
+ src += block_size;
+ }
+ src_row += src_stride;
+ }
+}
+
+void
+util_format_rgtc2_unorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ const unsigned bw = 4, bh = 4, bytes_per_block = 16;
+ unsigned x, y, i, j;
+
+ for(y = 0; y < height; y += bh) {
+ uint8_t *dst = dst_row;
+ for(x = 0; x < width; x += bw) {
+ uint8_t tmp_r[4][4]; /* [bh][bw] */
+ uint8_t tmp_g[4][4]; /* [bh][bw] */
+ for(j = 0; j < bh; ++j) {
+ for(i = 0; i < bw; ++i) {
+ tmp_r[j][i] = src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4];
+ tmp_g[j][i] = src_row[((y + j)*src_stride/sizeof(*src_row) + (x + i)*4) + 1];
+ }
+ }
+ u_format_unsigned_encode_rgtc_ubyte(dst, tmp_r, 4, 4);
+ u_format_unsigned_encode_rgtc_ubyte(dst + 8, tmp_g, 4, 4);
+ dst += bytes_per_block;
+ }
+ dst_row += dst_stride / sizeof(*dst_row);
+ }
+}
+
+void
+util_format_rxtc2_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height, unsigned chan2off)
+{
+ const unsigned bw = 4, bh = 4, bytes_per_block = 16;
+ unsigned x, y, i, j;
+
+ for(y = 0; y < height; y += bh) {
+ uint8_t *dst = dst_row;
+ for(x = 0; x < width; x += bw) {
+ uint8_t tmp_r[4][4]; /* [bh][bw][comps] */
+ uint8_t tmp_g[4][4]; /* [bh][bw][comps] */
+ for(j = 0; j < bh; ++j) {
+ for(i = 0; i < bw; ++i) {
+ tmp_r[j][i] = float_to_ubyte(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4]);
+ tmp_g[j][i] = float_to_ubyte(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4 + chan2off]);
+ }
+ }
+ u_format_unsigned_encode_rgtc_ubyte(dst, tmp_r, 4, 4);
+ u_format_unsigned_encode_rgtc_ubyte(dst + 8, tmp_g, 4, 4);
+ dst += bytes_per_block;
+ }
+ dst_row += dst_stride / sizeof(*dst_row);
+ }
+}
+
+void
+util_format_rgtc2_unorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ util_format_rxtc2_unorm_pack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height, 1);
+}
+
+void
+util_format_rgtc2_unorm_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ unsigned x, y, i, j;
+ int block_size = 16;
+ for(y = 0; y < height; y += 4) {
+ const uint8_t *src = src_row;
+ for(x = 0; x < width; x += 4) {
+ for(j = 0; j < 4; ++j) {
+ for(i = 0; i < 4; ++i) {
+ float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
+ uint8_t tmp_r, tmp_g;
+ u_format_unsigned_fetch_texel_rgtc(0, src, i, j, &tmp_r, 2);
+ u_format_unsigned_fetch_texel_rgtc(0, src + 8, i, j, &tmp_g, 2);
+ dst[0] = ubyte_to_float(tmp_r);
+ dst[1] = ubyte_to_float(tmp_g);
+ dst[2] = 0.0;
+ dst[3] = 1.0;
+ }
+ }
+ src += block_size;
+ }
+ src_row += src_stride;
+ }
+}
+
+void
+util_format_rgtc2_unorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
+{
+ uint8_t tmp_r, tmp_g;
+ u_format_unsigned_fetch_texel_rgtc(0, src, i, j, &tmp_r, 2);
+ u_format_unsigned_fetch_texel_rgtc(0, src + 8, i, j, &tmp_g, 2);
+ dst[0] = ubyte_to_float(tmp_r);
+ dst[1] = ubyte_to_float(tmp_g);
+ dst[2] = 0.0;
+ dst[3] = 1.0;
+}
+
+
+void
+util_format_rgtc2_snorm_fetch_rgba_8unorm(uint8_t *dst, const uint8_t *src, unsigned i, unsigned j)
+{
+ fprintf(stderr,"%s\n", __func__);
+}
+
+void
+util_format_rgtc2_snorm_unpack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ fprintf(stderr,"%s\n", __func__);
+}
+
+void
+util_format_rgtc2_snorm_pack_rgba_8unorm(uint8_t *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ fprintf(stderr,"%s\n", __func__);
+}
+
+void
+util_format_rgtc2_snorm_unpack_rgba_float(float *dst_row, unsigned dst_stride, const uint8_t *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ unsigned x, y, i, j;
+ int block_size = 16;
+ for(y = 0; y < height; y += 4) {
+ const int8_t *src = (int8_t *)src_row;
+ for(x = 0; x < width; x += 4) {
+ for(j = 0; j < 4; ++j) {
+ for(i = 0; i < 4; ++i) {
+ float *dst = dst_row + (y + j)*dst_stride/sizeof(*dst_row) + (x + i)*4;
+ int8_t tmp_r, tmp_g;
+ u_format_signed_fetch_texel_rgtc(0, src, i, j, &tmp_r, 2);
+ u_format_signed_fetch_texel_rgtc(0, src + 8, i, j, &tmp_g, 2);
+ dst[0] = byte_to_float_tex(tmp_r);
+ dst[1] = byte_to_float_tex(tmp_g);
+ dst[2] = 0.0;
+ dst[3] = 1.0;
+ }
+ }
+ src += block_size;
+ }
+ src_row += src_stride;
+ }
+}
+
+void
+util_format_rxtc2_snorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height, unsigned chan2off)
+{
+ const unsigned bw = 4, bh = 4, bytes_per_block = 16;
+ unsigned x, y, i, j;
+
+ for(y = 0; y < height; y += bh) {
+ int8_t *dst = (int8_t *)dst_row;
+ for(x = 0; x < width; x += bw) {
+ int8_t tmp_r[4][4]; /* [bh][bw][comps] */
+ int8_t tmp_g[4][4]; /* [bh][bw][comps] */
+ for(j = 0; j < bh; ++j) {
+ for(i = 0; i < bw; ++i) {
+ tmp_r[j][i] = float_to_byte_tex(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4]);
+ tmp_g[j][i] = float_to_byte_tex(src_row[(y + j)*src_stride/sizeof(*src_row) + (x + i)*4 + chan2off]);
+ }
+ }
+ u_format_signed_encode_rgtc_ubyte(dst, tmp_r, 4, 4);
+ u_format_signed_encode_rgtc_ubyte(dst + 8, tmp_g, 4, 4);
+ dst += bytes_per_block;
+ }
+ dst_row += dst_stride / sizeof(*dst_row);
+ }
+}
+
+void
+util_format_rgtc2_snorm_pack_rgba_float(uint8_t *dst_row, unsigned dst_stride, const float *src_row, unsigned src_stride, unsigned width, unsigned height)
+{
+ util_format_rxtc2_snorm_pack_rgba_float(dst_row, dst_stride, src_row, src_stride, width, height, 1);
+}
+
+void
+util_format_rgtc2_snorm_fetch_rgba_float(float *dst, const uint8_t *src, unsigned i, unsigned j)
+{
+ int8_t tmp_r, tmp_g;
+ u_format_signed_fetch_texel_rgtc(0, (int8_t *)src, i, j, &tmp_r, 2);
+ u_format_signed_fetch_texel_rgtc(0, (int8_t *)src + 8, i, j, &tmp_g, 2);
+ dst[0] = byte_to_float_tex(tmp_r);
+ dst[1] = byte_to_float_tex(tmp_g);
+ dst[2] = 0.0;
+ dst[3] = 1.0;
+}
+
+
+#define TAG(x) u_format_unsigned_##x
+#define TYPE uint8_t
+#define T_MIN 0
+#define T_MAX 255
+
+#include "../../../mesa/main/texcompress_rgtc_tmp.h"
+
+#undef TYPE
+#undef TAG
+#undef T_MIN
+#undef T_MAX
+
+
+#define TAG(x) u_format_signed_##x
+#define TYPE int8_t
+#define T_MIN (int8_t)-128
+#define T_MAX (int8_t)127
+
+#include "../../../mesa/main/texcompress_rgtc_tmp.h"
+
+#undef TYPE
+#undef TAG
+#undef T_MIN
+#undef T_MAX
diff --git a/mesalib/src/glsl/Makefile b/mesalib/src/glsl/Makefile
index c20a6c9ed..00b7b9164 100644
--- a/mesalib/src/glsl/Makefile
+++ b/mesalib/src/glsl/Makefile
@@ -188,11 +188,11 @@ install-dricore: default
##### RULES #####
-glsl_compiler: $(GLSL2_OBJECTS) libglsl.a builtin_stubs.o
- $(APP_CXX) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(GLSL2_OBJECTS) builtin_stubs.o $(LIBS) -o $@
+glsl_compiler: $(GLSL2_OBJECTS) libglsl.a
+ $(APP_CXX) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(GLSL2_OBJECTS) $(LIBS) -o $@
-glsl_test: $(TEST_OBJECTS) libglsl.a builtin_stubs.o
- $(APP_CXX) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(TEST_OBJECTS) builtin_stubs.o $(LIBS) -o $@
+glsl_test: $(TEST_OBJECTS) libglsl.a
+ $(APP_CXX) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $(TEST_OBJECTS) $(LIBS) -o $@
glcpp: glcpp/glcpp
glcpp/glcpp: $(GLCPP_OBJECTS)
diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c
index 1b71aa194..b6e80d70a 100644
--- a/mesalib/src/mesa/drivers/common/meta.c
+++ b/mesalib/src/mesa/drivers/common/meta.c
@@ -740,6 +740,11 @@ _mesa_meta_end(struct gl_context *ctx)
_mesa_reference_shader_program(ctx, &ctx->Shader.ActiveProgram,
save->ActiveShader);
+
+ _mesa_reference_shader_program(ctx, &save->VertexShader, NULL);
+ _mesa_reference_shader_program(ctx, &save->GeometryShader, NULL);
+ _mesa_reference_shader_program(ctx, &save->FragmentShader, NULL);
+ _mesa_reference_shader_program(ctx, &save->ActiveShader, NULL);
}
if (state & MESA_META_STENCIL_TEST) {
@@ -1223,7 +1228,7 @@ blitframebuffer_texture(struct gl_context *ctx,
GL_SKIP_DECODE_EXT);
}
if (ctx->Extensions.EXT_framebuffer_sRGB) {
- _mesa_Disable(GL_FRAMEBUFFER_SRGB_EXT);
+ _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_FALSE);
}
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
@@ -1291,7 +1296,7 @@ blitframebuffer_texture(struct gl_context *ctx,
_mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT, srgbSave);
}
if (ctx->Extensions.EXT_framebuffer_sRGB && fbo_srgb_save) {
- _mesa_Enable(GL_FRAMEBUFFER_SRGB_EXT);
+ _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_TRUE);
}
/* Done with color buffer */
@@ -2452,6 +2457,15 @@ _mesa_meta_check_generate_mipmap_fallback(struct gl_context *ctx, GLenum target,
return GL_TRUE;
}
+ if (_mesa_get_format_color_encoding(baseImage->TexFormat) == GL_SRGB &&
+ !ctx->Extensions.EXT_texture_sRGB_decode) {
+ /* The texture format is sRGB but we can't turn off sRGB->linear
+ * texture sample conversion. So we won't be able to generate the
+ * right colors when rendering. Need to use a fallback.
+ */
+ return GL_TRUE;
+ }
+
/*
* Test that we can actually render in the texture's format.
*/
@@ -2669,6 +2683,8 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
const GLenum wrapSSave = texObj->Sampler.WrapS;
const GLenum wrapTSave = texObj->Sampler.WrapT;
const GLenum wrapRSave = texObj->Sampler.WrapR;
+ const GLenum srgbDecodeSave = texObj->Sampler.sRGBDecode;
+ const GLenum srgbBufferSave = ctx->Color.sRGBEnabled;
const GLuint fboSave = ctx->DrawBuffer->Name;
const GLuint original_active_unit = ctx->Texture.CurrentUnit;
GLenum faceTarget;
@@ -2731,6 +2747,15 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
_mesa_TexParameteri(target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
+ /* We don't want to encode or decode sRGB values; treat them as linear */
+ if (ctx->Extensions.EXT_texture_sRGB_decode) {
+ _mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT,
+ GL_SKIP_DECODE_EXT);
+ }
+ if (ctx->Extensions.EXT_framebuffer_sRGB) {
+ _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_FALSE);
+ }
+
_mesa_set_enable(ctx, target, GL_TRUE);
/* setup texcoords (XXX what about border?) */
@@ -2875,6 +2900,14 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
_mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4);
}
+ if (ctx->Extensions.EXT_texture_sRGB_decode) {
+ _mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT,
+ srgbDecodeSave);
+ }
+ if (ctx->Extensions.EXT_framebuffer_sRGB && srgbBufferSave) {
+ _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_TRUE);
+ }
+
_mesa_lock_texture(ctx, texObj); /* relock */
_mesa_meta_end(ctx);
@@ -3154,7 +3187,7 @@ decompress_texture_image(struct gl_context *ctx,
/* setup texture state */
_mesa_BindTexture(target, texObj->Name);
- _mesa_Enable(target);
+ _mesa_set_enable(ctx, target, GL_TRUE);
{
/* save texture object state */
@@ -3179,7 +3212,7 @@ decompress_texture_image(struct gl_context *ctx,
GL_SKIP_DECODE_EXT);
}
if (ctx->Extensions.EXT_framebuffer_sRGB) {
- _mesa_Disable(GL_FRAMEBUFFER_SRGB_EXT);
+ _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_FALSE);
}
/* render quad w/ texture into renderbuffer */
@@ -3205,6 +3238,9 @@ decompress_texture_image(struct gl_context *ctx,
ctx->Pack.RowLength = destRowLength;
_mesa_ReadPixels(0, 0, width, height, destFormat, destType, dest);
+ /* disable texture unit */
+ _mesa_set_enable(ctx, target, GL_FALSE);
+
_mesa_meta_end(ctx);
/* restore fbo bindings */
diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast_span.c b/mesalib/src/mesa/drivers/dri/swrast/swrast_span.c
index c7d0bfdac..772d09f5a 100644
--- a/mesalib/src/mesa/drivers/dri/swrast/swrast_span.c
+++ b/mesalib/src/mesa/drivers/dri/swrast/swrast_span.c
@@ -45,7 +45,7 @@ static const GLubyte kernel[16] = {
#if DITHER
#define DITHER_COMP(X, Y) kernel[((X) & 0x3) | (((Y) & 0x3) << 2)]
-#define DITHER_CLAMP(X) (((X) < CHAN_MAX) ? (X) : CHAN_MAX)
+#define DITHER_CLAMP(X) (((X) < 255) ? (X) : 255)
#else
#define DITHER_COMP(X, Y) 0
diff --git a/mesalib/src/mesa/main/api_validate.c b/mesalib/src/mesa/main/api_validate.c
index 699b414f5..1fcf5cd68 100644
--- a/mesalib/src/mesa/main/api_validate.c
+++ b/mesalib/src/mesa/main/api_validate.c
@@ -199,6 +199,27 @@ check_index_bounds(struct gl_context *ctx, GLsizei count, GLenum type,
/**
+ * Is 'mode' a valid value for glBegin(), glDrawArrays(), glDrawElements(),
+ * etc? The set of legal values depends on whether geometry shaders/programs
+ * are supported.
+ */
+GLboolean
+_mesa_valid_prim_mode(const struct gl_context *ctx, GLenum mode)
+{
+ if (ctx->Extensions.ARB_geometry_shader4 &&
+ mode > GL_TRIANGLE_STRIP_ADJACENCY_ARB) {
+ return GL_FALSE;
+ }
+ else if (mode > GL_POLYGON) {
+ return GL_FALSE;
+ }
+ else {
+ return GL_TRUE;
+ }
+}
+
+
+/**
* Error checking for glDrawElements(). Includes parameter checking
* and VBO bounds checking.
* \return GL_TRUE if OK to render, GL_FALSE if error found
@@ -216,7 +237,7 @@ _mesa_validate_DrawElements(struct gl_context *ctx,
return GL_FALSE;
}
- if (mode > GL_TRIANGLE_STRIP_ADJACENCY_ARB) {
+ if (!_mesa_valid_prim_mode(ctx, mode)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawElements(mode)" );
return GL_FALSE;
}
@@ -273,7 +294,7 @@ _mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode,
return GL_FALSE;
}
- if (mode > GL_TRIANGLE_STRIP_ADJACENCY_ARB) {
+ if (!_mesa_valid_prim_mode(ctx, mode)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawRangeElements(mode)" );
return GL_FALSE;
}
@@ -332,7 +353,7 @@ _mesa_validate_DrawArrays(struct gl_context *ctx,
return GL_FALSE;
}
- if (mode > GL_TRIANGLE_STRIP_ADJACENCY_ARB) {
+ if (!_mesa_valid_prim_mode(ctx, mode)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glDrawArrays(mode)" );
return GL_FALSE;
}
@@ -362,7 +383,7 @@ _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint fi
return GL_FALSE;
}
- if (mode > GL_TRIANGLE_STRIP_ADJACENCY_ARB) {
+ if (!_mesa_valid_prim_mode(ctx, mode)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glDrawArraysInstanced(mode=0x%x)", mode);
return GL_FALSE;
@@ -408,7 +429,7 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
return GL_FALSE;
}
- if (mode > GL_TRIANGLE_STRIP_ADJACENCY_ARB) {
+ if (!_mesa_valid_prim_mode(ctx, mode)) {
_mesa_error(ctx, GL_INVALID_ENUM,
"glDrawElementsInstanced(mode = 0x%x)", mode);
return GL_FALSE;
diff --git a/mesalib/src/mesa/main/api_validate.h b/mesalib/src/mesa/main/api_validate.h
index 09e9522d2..7d6a66012 100644
--- a/mesalib/src/mesa/main/api_validate.h
+++ b/mesalib/src/mesa/main/api_validate.h
@@ -39,6 +39,11 @@ _mesa_max_buffer_index(struct gl_context *ctx, GLuint count, GLenum type,
const void *indices,
struct gl_buffer_object *elementBuf);
+
+extern GLboolean
+_mesa_valid_prim_mode(const struct gl_context *ctx, GLenum mode);
+
+
extern GLboolean
_mesa_validate_DrawArrays(struct gl_context *ctx,
GLenum mode, GLint start, GLsizei count);
diff --git a/mesalib/src/mesa/main/attrib.c b/mesalib/src/mesa/main/attrib.c
index 9767740a3..d38a1a466 100644
--- a/mesalib/src/mesa/main/attrib.c
+++ b/mesalib/src/mesa/main/attrib.c
@@ -493,7 +493,7 @@ pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib *enable)
}
}
- for (i=0;i<MAX_CLIP_PLANES;i++) {
+ for (i=0;i<ctx->Const.MaxClipPlanes;i++) {
const GLuint mask = 1 << i;
if ((ctx->Transform.ClipPlanesEnabled & mask) != (enable->ClipPlanes & mask))
_mesa_set_enable(ctx, (GLenum) (GL_CLIP_PLANE0 + i),
@@ -1247,7 +1247,7 @@ _mesa_PopAttrib(void)
_math_matrix_analyse( ctx->ProjectionMatrixStack.Top );
/* restore clip planes */
- for (i = 0; i < MAX_CLIP_PLANES; i++) {
+ for (i = 0; i < ctx->Const.MaxClipPlanes; i++) {
const GLuint mask = 1 << i;
const GLfloat *eyePlane = xform->EyeUserPlane[i];
COPY_4V(ctx->Transform.EyeUserPlane[i], eyePlane);
diff --git a/mesalib/src/mesa/main/colormac.h b/mesalib/src/mesa/main/colormac.h
index 4b7c3b4a0..4294f3239 100644
--- a/mesalib/src/mesa/main/colormac.h
+++ b/mesalib/src/mesa/main/colormac.h
@@ -38,137 +38,6 @@
#include "mtypes.h"
-/** \def BYTE_TO_CHAN
- * Convert from GLbyte to GLchan */
-
-/** \def UBYTE_TO_CHAN
- * Convert from GLubyte to GLchan */
-
-/** \def SHORT_TO_CHAN
- * Convert from GLshort to GLchan */
-
-/** \def USHORT_TO_CHAN
- * Convert from GLushort to GLchan */
-
-/** \def INT_TO_CHAN
- * Convert from GLint to GLchan */
-
-/** \def UINT_TO_CHAN
- * Convert from GLuint to GLchan */
-
-/** \def CHAN_TO_UBYTE
- * Convert from GLchan to GLubyte */
-
-/** \def CHAN_TO_FLOAT
- * Convert from GLchan to GLfloat */
-
-/** \def CLAMPED_FLOAT_TO_CHAN
- * Convert from GLclampf to GLchan */
-
-/** \def UNCLAMPED_FLOAT_TO_CHAN
- * Convert from GLfloat to GLchan */
-
-/** \def COPY_CHAN4
- * Copy a GLchan[4] array */
-
-#if CHAN_BITS == 8
-
-#define BYTE_TO_CHAN(b) ((b) < 0 ? 0 : (GLchan) (b))
-#define UBYTE_TO_CHAN(b) (b)
-#define SHORT_TO_CHAN(s) ((s) < 0 ? 0 : (GLchan) ((s) >> 7))
-#define USHORT_TO_CHAN(s) ((GLchan) ((s) >> 8))
-#define INT_TO_CHAN(i) ((i) < 0 ? 0 : (GLchan) ((i) >> 23))
-#define UINT_TO_CHAN(i) ((GLchan) ((i) >> 24))
-
-#define CHAN_TO_UBYTE(c) (c)
-#define CHAN_TO_USHORT(c) (((c) << 8) | (c))
-#define CHAN_TO_SHORT(c) (((c) << 7) | ((c) >> 1))
-#define CHAN_TO_FLOAT(c) UBYTE_TO_FLOAT(c)
-
-#define CLAMPED_FLOAT_TO_CHAN(c, f) CLAMPED_FLOAT_TO_UBYTE(c, f)
-#define UNCLAMPED_FLOAT_TO_CHAN(c, f) UNCLAMPED_FLOAT_TO_UBYTE(c, f)
-
-#define COPY_CHAN4(DST, SRC) COPY_4UBV(DST, SRC)
-
-#elif CHAN_BITS == 16
-
-#define BYTE_TO_CHAN(b) ((b) < 0 ? 0 : (((GLchan) (b)) * 516))
-#define UBYTE_TO_CHAN(b) ((((GLchan) (b)) << 8) | ((GLchan) (b)))
-#define SHORT_TO_CHAN(s) ((s) < 0 ? 0 : (GLchan) (s))
-#define USHORT_TO_CHAN(s) (s)
-#define INT_TO_CHAN(i) ((i) < 0 ? 0 : (GLchan) ((i) >> 15))
-#define UINT_TO_CHAN(i) ((GLchan) ((i) >> 16))
-
-#define CHAN_TO_UBYTE(c) ((c) >> 8)
-#define CHAN_TO_USHORT(c) (c)
-#define CHAN_TO_SHORT(c) ((c) >> 1)
-#define CHAN_TO_FLOAT(c) ((GLfloat) ((c) * (1.0 / CHAN_MAXF)))
-
-#define CLAMPED_FLOAT_TO_CHAN(c, f) CLAMPED_FLOAT_TO_USHORT(c, f)
-#define UNCLAMPED_FLOAT_TO_CHAN(c, f) UNCLAMPED_FLOAT_TO_USHORT(c, f)
-
-#define COPY_CHAN4(DST, SRC) COPY_4V(DST, SRC)
-
-#elif CHAN_BITS == 32
-
-/* XXX floating-point color channels not fully thought-out */
-#define BYTE_TO_CHAN(b) ((GLfloat) ((b) * (1.0F / 127.0F)))
-#define UBYTE_TO_CHAN(b) ((GLfloat) ((b) * (1.0F / 255.0F)))
-#define SHORT_TO_CHAN(s) ((GLfloat) ((s) * (1.0F / 32767.0F)))
-#define USHORT_TO_CHAN(s) ((GLfloat) ((s) * (1.0F / 65535.0F)))
-#define INT_TO_CHAN(i) ((GLfloat) ((i) * (1.0F / 2147483647.0F)))
-#define UINT_TO_CHAN(i) ((GLfloat) ((i) * (1.0F / 4294967295.0F)))
-
-#define CHAN_TO_UBYTE(c) FLOAT_TO_UBYTE(c)
-#define CHAN_TO_USHORT(c) ((GLushort) (CLAMP((c), 0.0f, 1.0f) * 65535.0))
-#define CHAN_TO_SHORT(c) ((GLshort) (CLAMP((c), 0.0f, 1.0f) * 32767.0))
-#define CHAN_TO_FLOAT(c) (c)
-
-#define CLAMPED_FLOAT_TO_CHAN(c, f) c = (f)
-#define UNCLAMPED_FLOAT_TO_CHAN(c, f) c = (f)
-
-#define COPY_CHAN4(DST, SRC) COPY_4V(DST, SRC)
-
-#else
-
-#error unexpected CHAN_BITS size
-
-#endif
-
-
-/**
- * Convert 3 channels at once.
- *
- * \param dst pointer to destination GLchan[3] array.
- * \param f pointer to source GLfloat[3] array.
- *
- * \sa #UNCLAMPED_FLOAT_TO_CHAN.
- */
-#define UNCLAMPED_FLOAT_TO_RGB_CHAN(dst, f) \
-do { \
- UNCLAMPED_FLOAT_TO_CHAN((dst)[0], (f)[0]); \
- UNCLAMPED_FLOAT_TO_CHAN((dst)[1], (f)[1]); \
- UNCLAMPED_FLOAT_TO_CHAN((dst)[2], (f)[2]); \
-} while (0)
-
-
-/**
- * Convert 4 channels at once.
- *
- * \param dst pointer to destination GLchan[4] array.
- * \param f pointer to source GLfloat[4] array.
- *
- * \sa #UNCLAMPED_FLOAT_TO_CHAN.
- */
-#define UNCLAMPED_FLOAT_TO_RGBA_CHAN(dst, f) \
-do { \
- UNCLAMPED_FLOAT_TO_CHAN((dst)[0], (f)[0]); \
- UNCLAMPED_FLOAT_TO_CHAN((dst)[1], (f)[1]); \
- UNCLAMPED_FLOAT_TO_CHAN((dst)[2], (f)[2]); \
- UNCLAMPED_FLOAT_TO_CHAN((dst)[3], (f)[3]); \
-} while (0)
-
-
/**
* Convert four float values in [0,1] to ubytes in [0,255] with clamping.
*/
@@ -205,11 +74,11 @@ _mesa_unclamped_float_rgba_to_ubyte(GLubyte dst[4], const GLfloat src[4])
#define PACK_COLOR_5551( R, G, B, A ) \
((((R) & 0xf8) << 8) | (((G) & 0xf8) << 3) | (((B) & 0xf8) >> 2) | \
- ((A) ? 1 : 0))
+ ((A) >> 7))
#define PACK_COLOR_1555( A, B, G, R ) \
((((B) & 0xf8) << 7) | (((G) & 0xf8) << 2) | (((R) & 0xf8) >> 3) | \
- ((A) ? 0x8000 : 0))
+ (((A) & 0x80) << 8))
#define PACK_COLOR_1555_REV( A, B, G, R ) \
((((B) & 0xf8) >> 1) | (((G) & 0xc0) >> 6) | (((G) & 0x38) << 10) | (((R) & 0xf8) << 5) | \
diff --git a/mesalib/src/mesa/main/config.h b/mesalib/src/mesa/main/config.h
index 91aef90b7..7b7740ebe 100644
--- a/mesalib/src/mesa/main/config.h
+++ b/mesalib/src/mesa/main/config.h
@@ -61,8 +61,11 @@
/** Maximum number of lights */
#define MAX_LIGHTS 8
-/** Maximum user-defined clipping planes */
-#define MAX_CLIP_PLANES 6
+/**
+ * Maximum number of user-defined clipping planes supported by any driver in
+ * Mesa. This is used to size arrays.
+ */
+#define MAX_CLIP_PLANES 8
/** Maximum pixel map lookup table size */
#define MAX_PIXEL_MAP_TABLE 256
@@ -329,7 +332,7 @@
/**
- * Bits per color channel: 8, 16 or 32
+ * For swrast, bits per color channel: 8, 16 or 32
*/
#ifndef CHAN_BITS
#define CHAN_BITS 8
diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c
index 0cf794735..b20063c33 100644
--- a/mesalib/src/mesa/main/context.c
+++ b/mesalib/src/mesa/main/context.c
@@ -582,7 +582,7 @@ _mesa_init_constants(struct gl_context *ctx)
ctx->Const.MaxLineWidthAA = MAX_LINE_WIDTH;
ctx->Const.LineWidthGranularity = (GLfloat) LINE_WIDTH_GRANULARITY;
ctx->Const.MaxColorTableSize = MAX_COLOR_TABLE_SIZE;
- ctx->Const.MaxClipPlanes = MAX_CLIP_PLANES;
+ ctx->Const.MaxClipPlanes = 6;
ctx->Const.MaxLights = MAX_LIGHTS;
ctx->Const.MaxShininess = 128.0;
ctx->Const.MaxSpotExponent = 128.0;
diff --git a/mesalib/src/mesa/main/debug.c b/mesalib/src/mesa/main/debug.c
index 2bb37452d..0a393e5fa 100644
--- a/mesalib/src/mesa/main/debug.c
+++ b/mesalib/src/mesa/main/debug.c
@@ -567,9 +567,6 @@ _mesa_dump_image(const char *filename, const void *image, GLuint w, GLuint h,
void
_mesa_print_texture(struct gl_context *ctx, struct gl_texture_image *img)
{
-#if CHAN_TYPE != GL_UNSIGNED_BYTE
- _mesa_problem(NULL, "PrintTexture not supported");
-#else
const GLint slice = 0;
GLint srcRowStride;
GLuint i, j, c;
@@ -626,5 +623,4 @@ _mesa_print_texture(struct gl_context *ctx, struct gl_texture_image *img)
}
ctx->Driver.UnmapTextureImage(ctx, img, slice);
-#endif
}
diff --git a/mesalib/src/mesa/main/dlist.c b/mesalib/src/mesa/main/dlist.c
index 9bba52129..f11dae9d0 100644
--- a/mesalib/src/mesa/main/dlist.c
+++ b/mesalib/src/mesa/main/dlist.c
@@ -34,6 +34,7 @@
#include "api_arrayelt.h"
#include "api_exec.h"
#include "api_loopback.h"
+#include "api_validate.h"
#if FEATURE_ATI_fragment_shader
#include "atifragshader.h"
#endif
@@ -5762,8 +5763,8 @@ save_Begin(GLenum mode)
Node *n;
GLboolean error = GL_FALSE;
- if ( /*mode < GL_POINTS || */ mode > GL_POLYGON) {
- _mesa_compile_error(ctx, GL_INVALID_ENUM, "Begin (mode)");
+ if (!_mesa_valid_prim_mode(ctx, mode)) {
+ _mesa_compile_error(ctx, GL_INVALID_ENUM, "glBegin(mode)");
error = GL_TRUE;
}
else if (ctx->Driver.CurrentSavePrimitive == PRIM_UNKNOWN) {
diff --git a/mesalib/src/mesa/main/macros.h b/mesalib/src/mesa/main/macros.h
index 01e4d20af..2a849e36a 100644
--- a/mesalib/src/mesa/main/macros.h
+++ b/mesalib/src/mesa/main/macros.h
@@ -175,10 +175,6 @@ extern GLfloat _mesa_ubyte_to_float_color_tab[256];
#define STRIDE_4UB(p, i) (p = (GLubyte (*)[4])((GLubyte *)p + i))
/** Stepping a GLfloat[4] pointer by a byte stride */
#define STRIDE_4F(p, i) (p = (GLfloat (*)[4])((GLubyte *)p + i))
-/** Stepping a GLchan[4] pointer by a byte stride */
-#define STRIDE_4CHAN(p, i) (p = (GLchan (*)[4])((GLubyte *)p + i))
-/** Stepping a GLchan pointer by a byte stride */
-#define STRIDE_CHAN(p, i) (p = (GLchan *)((GLubyte *)p + i))
/** Stepping a \p t pointer by a byte stride */
#define STRIDE_T(p, t, i) (p = (t)((GLubyte *)p + i))
@@ -602,14 +598,6 @@ do { \
UNCLAMPED_FLOAT_TO_UBYTE( dstub, dstf ); \
} while (0)
-#define INTERP_CHAN( t, dstc, outc, inc ) \
-do { \
- GLfloat inf = CHAN_TO_FLOAT( inc ); \
- GLfloat outf = CHAN_TO_FLOAT( outc ); \
- GLfloat dstf = LINTERP( t, outf, inf ); \
- UNCLAMPED_FLOAT_TO_CHAN( dstc, dstf ); \
-} while (0)
-
#define INTERP_UI( t, dstui, outui, inui ) \
dstui = (GLuint) (GLint) LINTERP( (t), (GLfloat) (outui), (GLfloat) (inui) )
@@ -631,21 +619,6 @@ do { \
dst[2] = LINTERP( (t), (out)[2], (in)[2] ); \
} while (0)
-#define INTERP_4CHAN( t, dst, out, in ) \
-do { \
- INTERP_CHAN( (t), (dst)[0], (out)[0], (in)[0] ); \
- INTERP_CHAN( (t), (dst)[1], (out)[1], (in)[1] ); \
- INTERP_CHAN( (t), (dst)[2], (out)[2], (in)[2] ); \
- INTERP_CHAN( (t), (dst)[3], (out)[3], (in)[3] ); \
-} while (0)
-
-#define INTERP_3CHAN( t, dst, out, in ) \
-do { \
- INTERP_CHAN( (t), (dst)[0], (out)[0], (in)[0] ); \
- INTERP_CHAN( (t), (dst)[1], (out)[1], (in)[1] ); \
- INTERP_CHAN( (t), (dst)[2], (out)[2], (in)[2] ); \
-} while (0)
-
#define INTERP_SZ( t, vec, to, out, in, sz ) \
do { \
switch (sz) { \
diff --git a/mesalib/src/mesa/main/matrix.c b/mesalib/src/mesa/main/matrix.c
index 2579b7384..f479a22b0 100644
--- a/mesalib/src/mesa/main/matrix.c
+++ b/mesalib/src/mesa/main/matrix.c
@@ -1,789 +1,789 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.5
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-/**
- * \file matrix.c
- * Matrix operations.
- *
- * \note
- * -# 4x4 transformation matrices are stored in memory in column major order.
- * -# Points/vertices are to be thought of as column vectors.
- * -# Transformation of a point p by a matrix M is: p' = M * p
- */
-
-
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "enums.h"
-#include "macros.h"
-#include "mfeatures.h"
-#include "matrix.h"
-#include "mtypes.h"
-#include "math/m_matrix.h"
-
-
-/**
- * Apply a perspective projection matrix.
- *
- * \param left left clipping plane coordinate.
- * \param right right clipping plane coordinate.
- * \param bottom bottom clipping plane coordinate.
- * \param top top clipping plane coordinate.
- * \param nearval distance to the near clipping plane.
- * \param farval distance to the far clipping plane.
- *
- * \sa glFrustum().
- *
- * Flushes vertices and validates parameters. Calls _math_matrix_frustum() with
- * the top matrix of the current matrix stack and sets
- * __struct gl_contextRec::NewState.
- */
-void GLAPIENTRY
-_mesa_Frustum( GLdouble left, GLdouble right,
- GLdouble bottom, GLdouble top,
- GLdouble nearval, GLdouble farval )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (nearval <= 0.0 ||
- farval <= 0.0 ||
- nearval == farval ||
- left == right ||
- top == bottom)
- {
- _mesa_error( ctx, GL_INVALID_VALUE, "glFrustum" );
- return;
- }
-
- _math_matrix_frustum( ctx->CurrentStack->Top,
- (GLfloat) left, (GLfloat) right,
- (GLfloat) bottom, (GLfloat) top,
- (GLfloat) nearval, (GLfloat) farval );
- ctx->NewState |= ctx->CurrentStack->DirtyFlag;
-}
-
-
-/**
- * Apply an orthographic projection matrix.
- *
- * \param left left clipping plane coordinate.
- * \param right right clipping plane coordinate.
- * \param bottom bottom clipping plane coordinate.
- * \param top top clipping plane coordinate.
- * \param nearval distance to the near clipping plane.
- * \param farval distance to the far clipping plane.
- *
- * \sa glOrtho().
- *
- * Flushes vertices and validates parameters. Calls _math_matrix_ortho() with
- * the top matrix of the current matrix stack and sets
- * __struct gl_contextRec::NewState.
- */
-void GLAPIENTRY
-_mesa_Ortho( GLdouble left, GLdouble right,
- GLdouble bottom, GLdouble top,
- GLdouble nearval, GLdouble farval )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glOrtho(%f, %f, %f, %f, %f, %f)\n",
- left, right, bottom, top, nearval, farval);
-
- if (left == right ||
- bottom == top ||
- nearval == farval)
- {
- _mesa_error( ctx, GL_INVALID_VALUE, "glOrtho" );
- return;
- }
-
- _math_matrix_ortho( ctx->CurrentStack->Top,
- (GLfloat) left, (GLfloat) right,
- (GLfloat) bottom, (GLfloat) top,
- (GLfloat) nearval, (GLfloat) farval );
- ctx->NewState |= ctx->CurrentStack->DirtyFlag;
-}
-
-
-/**
- * Set the current matrix stack.
- *
- * \param mode matrix stack.
- *
- * \sa glMatrixMode().
- *
- * Flushes the vertices, validates the parameter and updates
- * __struct gl_contextRec::CurrentStack and gl_transform_attrib::MatrixMode
- * with the specified matrix stack.
- */
-void GLAPIENTRY
-_mesa_MatrixMode( GLenum mode )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (ctx->Transform.MatrixMode == mode && mode != GL_TEXTURE)
- return;
- FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
-
- switch (mode) {
- case GL_MODELVIEW:
- ctx->CurrentStack = &ctx->ModelviewMatrixStack;
- break;
- case GL_PROJECTION:
- ctx->CurrentStack = &ctx->ProjectionMatrixStack;
- break;
- case GL_TEXTURE:
- /* This error check is disabled because if we're called from
- * glPopAttrib() when the active texture unit is >= MaxTextureCoordUnits
- * we'll generate an unexpected error.
- * From the GL_ARB_vertex_shader spec it sounds like we should instead
- * do error checking in other places when we actually try to access
- * texture matrices beyond MaxTextureCoordUnits.
- */
-#if 0
- if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "glMatrixMode(invalid tex unit %d)",
- ctx->Texture.CurrentUnit);
- return;
- }
-#endif
- ASSERT(ctx->Texture.CurrentUnit < Elements(ctx->TextureMatrixStack));
- ctx->CurrentStack = &ctx->TextureMatrixStack[ctx->Texture.CurrentUnit];
- break;
- case GL_MATRIX0_NV:
- case GL_MATRIX1_NV:
- case GL_MATRIX2_NV:
- case GL_MATRIX3_NV:
- case GL_MATRIX4_NV:
- case GL_MATRIX5_NV:
- case GL_MATRIX6_NV:
- case GL_MATRIX7_NV:
- if (ctx->Extensions.NV_vertex_program) {
- ctx->CurrentStack = &ctx->ProgramMatrixStack[mode - GL_MATRIX0_NV];
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glMatrixMode(mode)" );
- return;
- }
- break;
- case GL_MATRIX0_ARB:
- case GL_MATRIX1_ARB:
- case GL_MATRIX2_ARB:
- case GL_MATRIX3_ARB:
- case GL_MATRIX4_ARB:
- case GL_MATRIX5_ARB:
- case GL_MATRIX6_ARB:
- case GL_MATRIX7_ARB:
- if (ctx->Extensions.ARB_vertex_program ||
- ctx->Extensions.ARB_fragment_program) {
- const GLuint m = mode - GL_MATRIX0_ARB;
- if (m > ctx->Const.MaxProgramMatrices) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "glMatrixMode(GL_MATRIX%d_ARB)", m);
- return;
- }
- ctx->CurrentStack = &ctx->ProgramMatrixStack[m];
- }
- else {
- _mesa_error( ctx, GL_INVALID_ENUM, "glMatrixMode(mode)" );
- return;
- }
- break;
- default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glMatrixMode(mode)" );
- return;
- }
-
- ctx->Transform.MatrixMode = mode;
-}
-
-
-/**
- * Push the current matrix stack.
- *
- * \sa glPushMatrix().
- *
- * Verifies the current matrix stack is not full, and duplicates the top-most
- * matrix in the stack.
- * Marks __struct gl_contextRec::NewState with the stack dirty flag.
- */
-void GLAPIENTRY
-_mesa_PushMatrix( void )
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl_matrix_stack *stack = ctx->CurrentStack;
- ASSERT_OUTSIDE_BEGIN_END(ctx);
-
- if (MESA_VERBOSE&VERBOSE_API)
- _mesa_debug(ctx, "glPushMatrix %s\n",
- _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
-
- if (stack->Depth + 1 >= stack->MaxDepth) {
- if (ctx->Transform.MatrixMode == GL_TEXTURE) {
- _mesa_error(ctx, GL_STACK_OVERFLOW,
- "glPushMatrix(mode=GL_TEXTURE, unit=%d)",
- ctx->Texture.CurrentUnit);
- }
- else {
- _mesa_error(ctx, GL_STACK_OVERFLOW, "glPushMatrix(mode=%s)",
- _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
- }
- return;
- }
- _math_matrix_copy( &stack->Stack[stack->Depth + 1],
- &stack->Stack[stack->Depth] );
- stack->Depth++;
- stack->Top = &(stack->Stack[stack->Depth]);
- ctx->NewState |= stack->DirtyFlag;
-}
-
-
-/**
- * Pop the current matrix stack.
- *
- * \sa glPopMatrix().
- *
- * Flushes the vertices, verifies the current matrix stack is not empty, and
- * moves the stack head down.
- * Marks __struct gl_contextRec::NewState with the dirty stack flag.
- */
-void GLAPIENTRY
-_mesa_PopMatrix( void )
-{
- GET_CURRENT_CONTEXT(ctx);
- struct gl_matrix_stack *stack = ctx->CurrentStack;
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (MESA_VERBOSE&VERBOSE_API)
- _mesa_debug(ctx, "glPopMatrix %s\n",
- _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
-
- if (stack->Depth == 0) {
- if (ctx->Transform.MatrixMode == GL_TEXTURE) {
- _mesa_error(ctx, GL_STACK_UNDERFLOW,
- "glPopMatrix(mode=GL_TEXTURE, unit=%d)",
- ctx->Texture.CurrentUnit);
- }
- else {
- _mesa_error(ctx, GL_STACK_UNDERFLOW, "glPopMatrix(mode=%s)",
- _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
- }
- return;
- }
- stack->Depth--;
- stack->Top = &(stack->Stack[stack->Depth]);
- ctx->NewState |= stack->DirtyFlag;
-}
-
-
-/**
- * Replace the current matrix with the identity matrix.
- *
- * \sa glLoadIdentity().
- *
- * Flushes the vertices and calls _math_matrix_set_identity() with the
- * top-most matrix in the current stack.
- * Marks __struct gl_contextRec::NewState with the stack dirty flag.
- */
-void GLAPIENTRY
-_mesa_LoadIdentity( void )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
-
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx, "glLoadIdentity()\n");
-
- _math_matrix_set_identity( ctx->CurrentStack->Top );
- ctx->NewState |= ctx->CurrentStack->DirtyFlag;
-}
-
-
-/**
- * Replace the current matrix with a given matrix.
- *
- * \param m matrix.
- *
- * \sa glLoadMatrixf().
- *
- * Flushes the vertices and calls _math_matrix_loadf() with the top-most
- * matrix in the current stack and the given matrix.
- * Marks __struct gl_contextRec::NewState with the dirty stack flag.
- */
-void GLAPIENTRY
-_mesa_LoadMatrixf( const GLfloat *m )
-{
- GET_CURRENT_CONTEXT(ctx);
- if (!m) return;
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx,
- "glLoadMatrix(%f %f %f %f, %f %f %f %f, %f %f %f %f, %f %f %f %f\n",
- m[0], m[4], m[8], m[12],
- m[1], m[5], m[9], m[13],
- m[2], m[6], m[10], m[14],
- m[3], m[7], m[11], m[15]);
-
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- _math_matrix_loadf( ctx->CurrentStack->Top, m );
- ctx->NewState |= ctx->CurrentStack->DirtyFlag;
-}
-
-
-/**
- * Multiply the current matrix with a given matrix.
- *
- * \param m matrix.
- *
- * \sa glMultMatrixf().
- *
- * Flushes the vertices and calls _math_matrix_mul_floats() with the top-most
- * matrix in the current stack and the given matrix. Marks
- * __struct gl_contextRec::NewState with the dirty stack flag.
- */
-void GLAPIENTRY
-_mesa_MultMatrixf( const GLfloat *m )
-{
- GET_CURRENT_CONTEXT(ctx);
- if (!m) return;
- if (MESA_VERBOSE & VERBOSE_API)
- _mesa_debug(ctx,
- "glMultMatrix(%f %f %f %f, %f %f %f %f, %f %f %f %f, %f %f %f %f\n",
- m[0], m[4], m[8], m[12],
- m[1], m[5], m[9], m[13],
- m[2], m[6], m[10], m[14],
- m[3], m[7], m[11], m[15]);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- _math_matrix_mul_floats( ctx->CurrentStack->Top, m );
- ctx->NewState |= ctx->CurrentStack->DirtyFlag;
-}
-
-
-/**
- * Multiply the current matrix with a rotation matrix.
- *
- * \param angle angle of rotation, in degrees.
- * \param x rotation vector x coordinate.
- * \param y rotation vector y coordinate.
- * \param z rotation vector z coordinate.
- *
- * \sa glRotatef().
- *
- * Flushes the vertices and calls _math_matrix_rotate() with the top-most
- * matrix in the current stack and the given parameters. Marks
- * __struct gl_contextRec::NewState with the dirty stack flag.
- */
-void GLAPIENTRY
-_mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (angle != 0.0F) {
- _math_matrix_rotate( ctx->CurrentStack->Top, angle, x, y, z);
- ctx->NewState |= ctx->CurrentStack->DirtyFlag;
- }
-}
-
-
-/**
- * Multiply the current matrix with a general scaling matrix.
- *
- * \param x x axis scale factor.
- * \param y y axis scale factor.
- * \param z z axis scale factor.
- *
- * \sa glScalef().
- *
- * Flushes the vertices and calls _math_matrix_scale() with the top-most
- * matrix in the current stack and the given parameters. Marks
- * __struct gl_contextRec::NewState with the dirty stack flag.
- */
-void GLAPIENTRY
-_mesa_Scalef( GLfloat x, GLfloat y, GLfloat z )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- _math_matrix_scale( ctx->CurrentStack->Top, x, y, z);
- ctx->NewState |= ctx->CurrentStack->DirtyFlag;
-}
-
-
-/**
- * Multiply the current matrix with a translation matrix.
- *
- * \param x translation vector x coordinate.
- * \param y translation vector y coordinate.
- * \param z translation vector z coordinate.
- *
- * \sa glTranslatef().
- *
- * Flushes the vertices and calls _math_matrix_translate() with the top-most
- * matrix in the current stack and the given parameters. Marks
- * __struct gl_contextRec::NewState with the dirty stack flag.
- */
-void GLAPIENTRY
-_mesa_Translatef( GLfloat x, GLfloat y, GLfloat z )
-{
- GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- _math_matrix_translate( ctx->CurrentStack->Top, x, y, z);
- ctx->NewState |= ctx->CurrentStack->DirtyFlag;
-}
-
-
-#if _HAVE_FULL_GL
-void GLAPIENTRY
-_mesa_LoadMatrixd( const GLdouble *m )
-{
- GLint i;
- GLfloat f[16];
- if (!m) return;
- for (i = 0; i < 16; i++)
- f[i] = (GLfloat) m[i];
- _mesa_LoadMatrixf(f);
-}
-
-void GLAPIENTRY
-_mesa_MultMatrixd( const GLdouble *m )
-{
- GLint i;
- GLfloat f[16];
- if (!m) return;
- for (i = 0; i < 16; i++)
- f[i] = (GLfloat) m[i];
- _mesa_MultMatrixf( f );
-}
-
-
-void GLAPIENTRY
-_mesa_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z )
-{
- _mesa_Rotatef((GLfloat) angle, (GLfloat) x, (GLfloat) y, (GLfloat) z);
-}
-
-
-void GLAPIENTRY
-_mesa_Scaled( GLdouble x, GLdouble y, GLdouble z )
-{
- _mesa_Scalef((GLfloat) x, (GLfloat) y, (GLfloat) z);
-}
-
-
-void GLAPIENTRY
-_mesa_Translated( GLdouble x, GLdouble y, GLdouble z )
-{
- _mesa_Translatef((GLfloat) x, (GLfloat) y, (GLfloat) z);
-}
-#endif
-
-
-#if _HAVE_FULL_GL
-void GLAPIENTRY
-_mesa_LoadTransposeMatrixfARB( const GLfloat *m )
-{
- GLfloat tm[16];
- if (!m) return;
- _math_transposef(tm, m);
- _mesa_LoadMatrixf(tm);
-}
-
-
-void GLAPIENTRY
-_mesa_LoadTransposeMatrixdARB( const GLdouble *m )
-{
- GLfloat tm[16];
- if (!m) return;
- _math_transposefd(tm, m);
- _mesa_LoadMatrixf(tm);
-}
-
-
-void GLAPIENTRY
-_mesa_MultTransposeMatrixfARB( const GLfloat *m )
-{
- GLfloat tm[16];
- if (!m) return;
- _math_transposef(tm, m);
- _mesa_MultMatrixf(tm);
-}
-
-
-void GLAPIENTRY
-_mesa_MultTransposeMatrixdARB( const GLdouble *m )
-{
- GLfloat tm[16];
- if (!m) return;
- _math_transposefd(tm, m);
- _mesa_MultMatrixf(tm);
-}
-#endif
-
-
-
-/**********************************************************************/
-/** \name State management */
-/*@{*/
-
-
-/**
- * Update the projection matrix stack.
- *
- * \param ctx GL context.
- *
- * Calls _math_matrix_analyse() with the top-matrix of the projection matrix
- * stack, and recomputes user clip positions if necessary.
- *
- * \note This routine references __struct gl_contextRec::Tranform attribute
- * values to compute userclip positions in clip space, but is only called on
- * _NEW_PROJECTION. The _mesa_ClipPlane() function keeps these values up to
- * date across changes to the __struct gl_contextRec::Transform attributes.
- */
-static void
-update_projection( struct gl_context *ctx )
-{
- _math_matrix_analyse( ctx->ProjectionMatrixStack.Top );
-
-#if FEATURE_userclip
- /* Recompute clip plane positions in clipspace. This is also done
- * in _mesa_ClipPlane().
- */
- if (ctx->Transform.ClipPlanesEnabled) {
- GLuint p;
- for (p = 0; p < ctx->Const.MaxClipPlanes; p++) {
- if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
- _mesa_transform_vector( ctx->Transform._ClipUserPlane[p],
- ctx->Transform.EyeUserPlane[p],
- ctx->ProjectionMatrixStack.Top->inv );
- }
- }
- }
-#endif
-}
-
-
-/**
- * Calculate the combined modelview-projection matrix.
- *
- * \param ctx GL context.
- *
- * Multiplies the top matrices of the projection and model view stacks into
- * __struct gl_contextRec::_ModelProjectMatrix via _math_matrix_mul_matrix()
- * and analyzes the resulting matrix via _math_matrix_analyse().
- */
-static void
-calculate_model_project_matrix( struct gl_context *ctx )
-{
- _math_matrix_mul_matrix( &ctx->_ModelProjectMatrix,
- ctx->ProjectionMatrixStack.Top,
- ctx->ModelviewMatrixStack.Top );
-
- _math_matrix_analyse( &ctx->_ModelProjectMatrix );
-}
-
-
-/**
- * Updates the combined modelview-projection matrix.
- *
- * \param ctx GL context.
- * \param new_state new state bit mask.
- *
- * If there is a new model view matrix then analyzes it. If there is a new
- * projection matrix, updates it. Finally calls
- * calculate_model_project_matrix() to recalculate the modelview-projection
- * matrix.
- */
-void _mesa_update_modelview_project( struct gl_context *ctx, GLuint new_state )
-{
- if (new_state & _NEW_MODELVIEW) {
- _math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
-
- /* Bring cull position up to date.
- */
- TRANSFORM_POINT3( ctx->Transform.CullObjPos,
- ctx->ModelviewMatrixStack.Top->inv,
- ctx->Transform.CullEyePos );
- }
-
-
- if (new_state & _NEW_PROJECTION)
- update_projection( ctx );
-
- /* Keep ModelviewProject up to date always to allow tnl
- * implementations that go model->clip even when eye is required.
- */
- calculate_model_project_matrix(ctx);
-}
-
-/*@}*/
-
-
-/**********************************************************************/
-/** Matrix stack initialization */
-/*@{*/
-
-
-/**
- * Initialize a matrix stack.
- *
- * \param stack matrix stack.
- * \param maxDepth maximum stack depth.
- * \param dirtyFlag dirty flag.
- *
- * Allocates an array of \p maxDepth elements for the matrix stack and calls
- * _math_matrix_ctr() and _math_matrix_alloc_inv() for each element to
- * initialize it.
- */
-static void
-init_matrix_stack( struct gl_matrix_stack *stack,
- GLuint maxDepth, GLuint dirtyFlag )
-{
- GLuint i;
-
- stack->Depth = 0;
- stack->MaxDepth = maxDepth;
- stack->DirtyFlag = dirtyFlag;
- /* The stack */
- stack->Stack = (GLmatrix *) CALLOC(maxDepth * sizeof(GLmatrix));
- for (i = 0; i < maxDepth; i++) {
- _math_matrix_ctr(&stack->Stack[i]);
- _math_matrix_alloc_inv(&stack->Stack[i]);
- }
- stack->Top = stack->Stack;
-}
-
-/**
- * Free matrix stack.
- *
- * \param stack matrix stack.
- *
- * Calls _math_matrix_dtr() for each element of the matrix stack and
- * frees the array.
- */
-static void
-free_matrix_stack( struct gl_matrix_stack *stack )
-{
- GLuint i;
- for (i = 0; i < stack->MaxDepth; i++) {
- _math_matrix_dtr(&stack->Stack[i]);
- }
- FREE(stack->Stack);
- stack->Stack = stack->Top = NULL;
-}
-
-/*@}*/
-
-
-/**********************************************************************/
-/** \name Initialization */
-/*@{*/
-
-
-/**
- * Initialize the context matrix data.
- *
- * \param ctx GL context.
- *
- * Initializes each of the matrix stacks and the combined modelview-projection
- * matrix.
- */
-void _mesa_init_matrix( struct gl_context * ctx )
-{
- GLint i;
-
- /* Initialize matrix stacks */
- init_matrix_stack(&ctx->ModelviewMatrixStack, MAX_MODELVIEW_STACK_DEPTH,
- _NEW_MODELVIEW);
- init_matrix_stack(&ctx->ProjectionMatrixStack, MAX_PROJECTION_STACK_DEPTH,
- _NEW_PROJECTION);
- for (i = 0; i < Elements(ctx->TextureMatrixStack); i++)
- init_matrix_stack(&ctx->TextureMatrixStack[i], MAX_TEXTURE_STACK_DEPTH,
- _NEW_TEXTURE_MATRIX);
- for (i = 0; i < Elements(ctx->ProgramMatrixStack); i++)
- init_matrix_stack(&ctx->ProgramMatrixStack[i],
- MAX_PROGRAM_MATRIX_STACK_DEPTH, _NEW_TRACK_MATRIX);
- ctx->CurrentStack = &ctx->ModelviewMatrixStack;
-
- /* Init combined Modelview*Projection matrix */
- _math_matrix_ctr( &ctx->_ModelProjectMatrix );
-}
-
-
-/**
- * Free the context matrix data.
- *
- * \param ctx GL context.
- *
- * Frees each of the matrix stacks and the combined modelview-projection
- * matrix.
- */
-void _mesa_free_matrix_data( struct gl_context *ctx )
-{
- GLint i;
-
- free_matrix_stack(&ctx->ModelviewMatrixStack);
- free_matrix_stack(&ctx->ProjectionMatrixStack);
- for (i = 0; i < Elements(ctx->TextureMatrixStack); i++)
- free_matrix_stack(&ctx->TextureMatrixStack[i]);
- for (i = 0; i < Elements(ctx->ProgramMatrixStack); i++)
- free_matrix_stack(&ctx->ProgramMatrixStack[i]);
- /* combined Modelview*Projection matrix */
- _math_matrix_dtr( &ctx->_ModelProjectMatrix );
-
-}
-
-
-/**
- * Initialize the context transform attribute group.
- *
- * \param ctx GL context.
- *
- * \todo Move this to a new file with other 'transform' routines.
- */
-void _mesa_init_transform( struct gl_context *ctx )
-{
- GLint i;
-
- /* Transformation group */
- ctx->Transform.MatrixMode = GL_MODELVIEW;
- ctx->Transform.Normalize = GL_FALSE;
- ctx->Transform.RescaleNormals = GL_FALSE;
- ctx->Transform.RasterPositionUnclipped = GL_FALSE;
- for (i=0;i<MAX_CLIP_PLANES;i++) {
- ASSIGN_4V( ctx->Transform.EyeUserPlane[i], 0.0, 0.0, 0.0, 0.0 );
- }
- ctx->Transform.ClipPlanesEnabled = 0;
-
- ASSIGN_4V( ctx->Transform.CullObjPos, 0.0, 0.0, 1.0, 0.0 );
- ASSIGN_4V( ctx->Transform.CullEyePos, 0.0, 0.0, 1.0, 0.0 );
-}
-
-
-/*@}*/
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.5
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+/**
+ * \file matrix.c
+ * Matrix operations.
+ *
+ * \note
+ * -# 4x4 transformation matrices are stored in memory in column major order.
+ * -# Points/vertices are to be thought of as column vectors.
+ * -# Transformation of a point p by a matrix M is: p' = M * p
+ */
+
+
+#include "glheader.h"
+#include "imports.h"
+#include "context.h"
+#include "enums.h"
+#include "macros.h"
+#include "mfeatures.h"
+#include "matrix.h"
+#include "mtypes.h"
+#include "math/m_matrix.h"
+
+
+/**
+ * Apply a perspective projection matrix.
+ *
+ * \param left left clipping plane coordinate.
+ * \param right right clipping plane coordinate.
+ * \param bottom bottom clipping plane coordinate.
+ * \param top top clipping plane coordinate.
+ * \param nearval distance to the near clipping plane.
+ * \param farval distance to the far clipping plane.
+ *
+ * \sa glFrustum().
+ *
+ * Flushes vertices and validates parameters. Calls _math_matrix_frustum() with
+ * the top matrix of the current matrix stack and sets
+ * __struct gl_contextRec::NewState.
+ */
+void GLAPIENTRY
+_mesa_Frustum( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble nearval, GLdouble farval )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (nearval <= 0.0 ||
+ farval <= 0.0 ||
+ nearval == farval ||
+ left == right ||
+ top == bottom)
+ {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glFrustum" );
+ return;
+ }
+
+ _math_matrix_frustum( ctx->CurrentStack->Top,
+ (GLfloat) left, (GLfloat) right,
+ (GLfloat) bottom, (GLfloat) top,
+ (GLfloat) nearval, (GLfloat) farval );
+ ctx->NewState |= ctx->CurrentStack->DirtyFlag;
+}
+
+
+/**
+ * Apply an orthographic projection matrix.
+ *
+ * \param left left clipping plane coordinate.
+ * \param right right clipping plane coordinate.
+ * \param bottom bottom clipping plane coordinate.
+ * \param top top clipping plane coordinate.
+ * \param nearval distance to the near clipping plane.
+ * \param farval distance to the far clipping plane.
+ *
+ * \sa glOrtho().
+ *
+ * Flushes vertices and validates parameters. Calls _math_matrix_ortho() with
+ * the top matrix of the current matrix stack and sets
+ * __struct gl_contextRec::NewState.
+ */
+void GLAPIENTRY
+_mesa_Ortho( GLdouble left, GLdouble right,
+ GLdouble bottom, GLdouble top,
+ GLdouble nearval, GLdouble farval )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glOrtho(%f, %f, %f, %f, %f, %f)\n",
+ left, right, bottom, top, nearval, farval);
+
+ if (left == right ||
+ bottom == top ||
+ nearval == farval)
+ {
+ _mesa_error( ctx, GL_INVALID_VALUE, "glOrtho" );
+ return;
+ }
+
+ _math_matrix_ortho( ctx->CurrentStack->Top,
+ (GLfloat) left, (GLfloat) right,
+ (GLfloat) bottom, (GLfloat) top,
+ (GLfloat) nearval, (GLfloat) farval );
+ ctx->NewState |= ctx->CurrentStack->DirtyFlag;
+}
+
+
+/**
+ * Set the current matrix stack.
+ *
+ * \param mode matrix stack.
+ *
+ * \sa glMatrixMode().
+ *
+ * Flushes the vertices, validates the parameter and updates
+ * __struct gl_contextRec::CurrentStack and gl_transform_attrib::MatrixMode
+ * with the specified matrix stack.
+ */
+void GLAPIENTRY
+_mesa_MatrixMode( GLenum mode )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (ctx->Transform.MatrixMode == mode && mode != GL_TEXTURE)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
+
+ switch (mode) {
+ case GL_MODELVIEW:
+ ctx->CurrentStack = &ctx->ModelviewMatrixStack;
+ break;
+ case GL_PROJECTION:
+ ctx->CurrentStack = &ctx->ProjectionMatrixStack;
+ break;
+ case GL_TEXTURE:
+ /* This error check is disabled because if we're called from
+ * glPopAttrib() when the active texture unit is >= MaxTextureCoordUnits
+ * we'll generate an unexpected error.
+ * From the GL_ARB_vertex_shader spec it sounds like we should instead
+ * do error checking in other places when we actually try to access
+ * texture matrices beyond MaxTextureCoordUnits.
+ */
+#if 0
+ if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glMatrixMode(invalid tex unit %d)",
+ ctx->Texture.CurrentUnit);
+ return;
+ }
+#endif
+ ASSERT(ctx->Texture.CurrentUnit < Elements(ctx->TextureMatrixStack));
+ ctx->CurrentStack = &ctx->TextureMatrixStack[ctx->Texture.CurrentUnit];
+ break;
+ case GL_MATRIX0_NV:
+ case GL_MATRIX1_NV:
+ case GL_MATRIX2_NV:
+ case GL_MATRIX3_NV:
+ case GL_MATRIX4_NV:
+ case GL_MATRIX5_NV:
+ case GL_MATRIX6_NV:
+ case GL_MATRIX7_NV:
+ if (ctx->Extensions.NV_vertex_program) {
+ ctx->CurrentStack = &ctx->ProgramMatrixStack[mode - GL_MATRIX0_NV];
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glMatrixMode(mode)" );
+ return;
+ }
+ break;
+ case GL_MATRIX0_ARB:
+ case GL_MATRIX1_ARB:
+ case GL_MATRIX2_ARB:
+ case GL_MATRIX3_ARB:
+ case GL_MATRIX4_ARB:
+ case GL_MATRIX5_ARB:
+ case GL_MATRIX6_ARB:
+ case GL_MATRIX7_ARB:
+ if (ctx->Extensions.ARB_vertex_program ||
+ ctx->Extensions.ARB_fragment_program) {
+ const GLuint m = mode - GL_MATRIX0_ARB;
+ if (m > ctx->Const.MaxProgramMatrices) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glMatrixMode(GL_MATRIX%d_ARB)", m);
+ return;
+ }
+ ctx->CurrentStack = &ctx->ProgramMatrixStack[m];
+ }
+ else {
+ _mesa_error( ctx, GL_INVALID_ENUM, "glMatrixMode(mode)" );
+ return;
+ }
+ break;
+ default:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glMatrixMode(mode)" );
+ return;
+ }
+
+ ctx->Transform.MatrixMode = mode;
+}
+
+
+/**
+ * Push the current matrix stack.
+ *
+ * \sa glPushMatrix().
+ *
+ * Verifies the current matrix stack is not full, and duplicates the top-most
+ * matrix in the stack.
+ * Marks __struct gl_contextRec::NewState with the stack dirty flag.
+ */
+void GLAPIENTRY
+_mesa_PushMatrix( void )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_matrix_stack *stack = ctx->CurrentStack;
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (MESA_VERBOSE&VERBOSE_API)
+ _mesa_debug(ctx, "glPushMatrix %s\n",
+ _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
+
+ if (stack->Depth + 1 >= stack->MaxDepth) {
+ if (ctx->Transform.MatrixMode == GL_TEXTURE) {
+ _mesa_error(ctx, GL_STACK_OVERFLOW,
+ "glPushMatrix(mode=GL_TEXTURE, unit=%d)",
+ ctx->Texture.CurrentUnit);
+ }
+ else {
+ _mesa_error(ctx, GL_STACK_OVERFLOW, "glPushMatrix(mode=%s)",
+ _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
+ }
+ return;
+ }
+ _math_matrix_copy( &stack->Stack[stack->Depth + 1],
+ &stack->Stack[stack->Depth] );
+ stack->Depth++;
+ stack->Top = &(stack->Stack[stack->Depth]);
+ ctx->NewState |= stack->DirtyFlag;
+}
+
+
+/**
+ * Pop the current matrix stack.
+ *
+ * \sa glPopMatrix().
+ *
+ * Flushes the vertices, verifies the current matrix stack is not empty, and
+ * moves the stack head down.
+ * Marks __struct gl_contextRec::NewState with the dirty stack flag.
+ */
+void GLAPIENTRY
+_mesa_PopMatrix( void )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_matrix_stack *stack = ctx->CurrentStack;
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (MESA_VERBOSE&VERBOSE_API)
+ _mesa_debug(ctx, "glPopMatrix %s\n",
+ _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
+
+ if (stack->Depth == 0) {
+ if (ctx->Transform.MatrixMode == GL_TEXTURE) {
+ _mesa_error(ctx, GL_STACK_UNDERFLOW,
+ "glPopMatrix(mode=GL_TEXTURE, unit=%d)",
+ ctx->Texture.CurrentUnit);
+ }
+ else {
+ _mesa_error(ctx, GL_STACK_UNDERFLOW, "glPopMatrix(mode=%s)",
+ _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
+ }
+ return;
+ }
+ stack->Depth--;
+ stack->Top = &(stack->Stack[stack->Depth]);
+ ctx->NewState |= stack->DirtyFlag;
+}
+
+
+/**
+ * Replace the current matrix with the identity matrix.
+ *
+ * \sa glLoadIdentity().
+ *
+ * Flushes the vertices and calls _math_matrix_set_identity() with the
+ * top-most matrix in the current stack.
+ * Marks __struct gl_contextRec::NewState with the stack dirty flag.
+ */
+void GLAPIENTRY
+_mesa_LoadIdentity( void )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx, "glLoadIdentity()\n");
+
+ _math_matrix_set_identity( ctx->CurrentStack->Top );
+ ctx->NewState |= ctx->CurrentStack->DirtyFlag;
+}
+
+
+/**
+ * Replace the current matrix with a given matrix.
+ *
+ * \param m matrix.
+ *
+ * \sa glLoadMatrixf().
+ *
+ * Flushes the vertices and calls _math_matrix_loadf() with the top-most
+ * matrix in the current stack and the given matrix.
+ * Marks __struct gl_contextRec::NewState with the dirty stack flag.
+ */
+void GLAPIENTRY
+_mesa_LoadMatrixf( const GLfloat *m )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (!m) return;
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx,
+ "glLoadMatrix(%f %f %f %f, %f %f %f %f, %f %f %f %f, %f %f %f %f\n",
+ m[0], m[4], m[8], m[12],
+ m[1], m[5], m[9], m[13],
+ m[2], m[6], m[10], m[14],
+ m[3], m[7], m[11], m[15]);
+
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+ _math_matrix_loadf( ctx->CurrentStack->Top, m );
+ ctx->NewState |= ctx->CurrentStack->DirtyFlag;
+}
+
+
+/**
+ * Multiply the current matrix with a given matrix.
+ *
+ * \param m matrix.
+ *
+ * \sa glMultMatrixf().
+ *
+ * Flushes the vertices and calls _math_matrix_mul_floats() with the top-most
+ * matrix in the current stack and the given matrix. Marks
+ * __struct gl_contextRec::NewState with the dirty stack flag.
+ */
+void GLAPIENTRY
+_mesa_MultMatrixf( const GLfloat *m )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ if (!m) return;
+ if (MESA_VERBOSE & VERBOSE_API)
+ _mesa_debug(ctx,
+ "glMultMatrix(%f %f %f %f, %f %f %f %f, %f %f %f %f, %f %f %f %f\n",
+ m[0], m[4], m[8], m[12],
+ m[1], m[5], m[9], m[13],
+ m[2], m[6], m[10], m[14],
+ m[3], m[7], m[11], m[15]);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+ _math_matrix_mul_floats( ctx->CurrentStack->Top, m );
+ ctx->NewState |= ctx->CurrentStack->DirtyFlag;
+}
+
+
+/**
+ * Multiply the current matrix with a rotation matrix.
+ *
+ * \param angle angle of rotation, in degrees.
+ * \param x rotation vector x coordinate.
+ * \param y rotation vector y coordinate.
+ * \param z rotation vector z coordinate.
+ *
+ * \sa glRotatef().
+ *
+ * Flushes the vertices and calls _math_matrix_rotate() with the top-most
+ * matrix in the current stack and the given parameters. Marks
+ * __struct gl_contextRec::NewState with the dirty stack flag.
+ */
+void GLAPIENTRY
+_mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+ if (angle != 0.0F) {
+ _math_matrix_rotate( ctx->CurrentStack->Top, angle, x, y, z);
+ ctx->NewState |= ctx->CurrentStack->DirtyFlag;
+ }
+}
+
+
+/**
+ * Multiply the current matrix with a general scaling matrix.
+ *
+ * \param x x axis scale factor.
+ * \param y y axis scale factor.
+ * \param z z axis scale factor.
+ *
+ * \sa glScalef().
+ *
+ * Flushes the vertices and calls _math_matrix_scale() with the top-most
+ * matrix in the current stack and the given parameters. Marks
+ * __struct gl_contextRec::NewState with the dirty stack flag.
+ */
+void GLAPIENTRY
+_mesa_Scalef( GLfloat x, GLfloat y, GLfloat z )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+ _math_matrix_scale( ctx->CurrentStack->Top, x, y, z);
+ ctx->NewState |= ctx->CurrentStack->DirtyFlag;
+}
+
+
+/**
+ * Multiply the current matrix with a translation matrix.
+ *
+ * \param x translation vector x coordinate.
+ * \param y translation vector y coordinate.
+ * \param z translation vector z coordinate.
+ *
+ * \sa glTranslatef().
+ *
+ * Flushes the vertices and calls _math_matrix_translate() with the top-most
+ * matrix in the current stack and the given parameters. Marks
+ * __struct gl_contextRec::NewState with the dirty stack flag.
+ */
+void GLAPIENTRY
+_mesa_Translatef( GLfloat x, GLfloat y, GLfloat z )
+{
+ GET_CURRENT_CONTEXT(ctx);
+ ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+ _math_matrix_translate( ctx->CurrentStack->Top, x, y, z);
+ ctx->NewState |= ctx->CurrentStack->DirtyFlag;
+}
+
+
+#if _HAVE_FULL_GL
+void GLAPIENTRY
+_mesa_LoadMatrixd( const GLdouble *m )
+{
+ GLint i;
+ GLfloat f[16];
+ if (!m) return;
+ for (i = 0; i < 16; i++)
+ f[i] = (GLfloat) m[i];
+ _mesa_LoadMatrixf(f);
+}
+
+void GLAPIENTRY
+_mesa_MultMatrixd( const GLdouble *m )
+{
+ GLint i;
+ GLfloat f[16];
+ if (!m) return;
+ for (i = 0; i < 16; i++)
+ f[i] = (GLfloat) m[i];
+ _mesa_MultMatrixf( f );
+}
+
+
+void GLAPIENTRY
+_mesa_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z )
+{
+ _mesa_Rotatef((GLfloat) angle, (GLfloat) x, (GLfloat) y, (GLfloat) z);
+}
+
+
+void GLAPIENTRY
+_mesa_Scaled( GLdouble x, GLdouble y, GLdouble z )
+{
+ _mesa_Scalef((GLfloat) x, (GLfloat) y, (GLfloat) z);
+}
+
+
+void GLAPIENTRY
+_mesa_Translated( GLdouble x, GLdouble y, GLdouble z )
+{
+ _mesa_Translatef((GLfloat) x, (GLfloat) y, (GLfloat) z);
+}
+#endif
+
+
+#if _HAVE_FULL_GL
+void GLAPIENTRY
+_mesa_LoadTransposeMatrixfARB( const GLfloat *m )
+{
+ GLfloat tm[16];
+ if (!m) return;
+ _math_transposef(tm, m);
+ _mesa_LoadMatrixf(tm);
+}
+
+
+void GLAPIENTRY
+_mesa_LoadTransposeMatrixdARB( const GLdouble *m )
+{
+ GLfloat tm[16];
+ if (!m) return;
+ _math_transposefd(tm, m);
+ _mesa_LoadMatrixf(tm);
+}
+
+
+void GLAPIENTRY
+_mesa_MultTransposeMatrixfARB( const GLfloat *m )
+{
+ GLfloat tm[16];
+ if (!m) return;
+ _math_transposef(tm, m);
+ _mesa_MultMatrixf(tm);
+}
+
+
+void GLAPIENTRY
+_mesa_MultTransposeMatrixdARB( const GLdouble *m )
+{
+ GLfloat tm[16];
+ if (!m) return;
+ _math_transposefd(tm, m);
+ _mesa_MultMatrixf(tm);
+}
+#endif
+
+
+
+/**********************************************************************/
+/** \name State management */
+/*@{*/
+
+
+/**
+ * Update the projection matrix stack.
+ *
+ * \param ctx GL context.
+ *
+ * Calls _math_matrix_analyse() with the top-matrix of the projection matrix
+ * stack, and recomputes user clip positions if necessary.
+ *
+ * \note This routine references __struct gl_contextRec::Tranform attribute
+ * values to compute userclip positions in clip space, but is only called on
+ * _NEW_PROJECTION. The _mesa_ClipPlane() function keeps these values up to
+ * date across changes to the __struct gl_contextRec::Transform attributes.
+ */
+static void
+update_projection( struct gl_context *ctx )
+{
+ _math_matrix_analyse( ctx->ProjectionMatrixStack.Top );
+
+#if FEATURE_userclip
+ /* Recompute clip plane positions in clipspace. This is also done
+ * in _mesa_ClipPlane().
+ */
+ if (ctx->Transform.ClipPlanesEnabled) {
+ GLuint p;
+ for (p = 0; p < ctx->Const.MaxClipPlanes; p++) {
+ if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
+ _mesa_transform_vector( ctx->Transform._ClipUserPlane[p],
+ ctx->Transform.EyeUserPlane[p],
+ ctx->ProjectionMatrixStack.Top->inv );
+ }
+ }
+ }
+#endif
+}
+
+
+/**
+ * Calculate the combined modelview-projection matrix.
+ *
+ * \param ctx GL context.
+ *
+ * Multiplies the top matrices of the projection and model view stacks into
+ * __struct gl_contextRec::_ModelProjectMatrix via _math_matrix_mul_matrix()
+ * and analyzes the resulting matrix via _math_matrix_analyse().
+ */
+static void
+calculate_model_project_matrix( struct gl_context *ctx )
+{
+ _math_matrix_mul_matrix( &ctx->_ModelProjectMatrix,
+ ctx->ProjectionMatrixStack.Top,
+ ctx->ModelviewMatrixStack.Top );
+
+ _math_matrix_analyse( &ctx->_ModelProjectMatrix );
+}
+
+
+/**
+ * Updates the combined modelview-projection matrix.
+ *
+ * \param ctx GL context.
+ * \param new_state new state bit mask.
+ *
+ * If there is a new model view matrix then analyzes it. If there is a new
+ * projection matrix, updates it. Finally calls
+ * calculate_model_project_matrix() to recalculate the modelview-projection
+ * matrix.
+ */
+void _mesa_update_modelview_project( struct gl_context *ctx, GLuint new_state )
+{
+ if (new_state & _NEW_MODELVIEW) {
+ _math_matrix_analyse( ctx->ModelviewMatrixStack.Top );
+
+ /* Bring cull position up to date.
+ */
+ TRANSFORM_POINT3( ctx->Transform.CullObjPos,
+ ctx->ModelviewMatrixStack.Top->inv,
+ ctx->Transform.CullEyePos );
+ }
+
+
+ if (new_state & _NEW_PROJECTION)
+ update_projection( ctx );
+
+ /* Keep ModelviewProject up to date always to allow tnl
+ * implementations that go model->clip even when eye is required.
+ */
+ calculate_model_project_matrix(ctx);
+}
+
+/*@}*/
+
+
+/**********************************************************************/
+/** Matrix stack initialization */
+/*@{*/
+
+
+/**
+ * Initialize a matrix stack.
+ *
+ * \param stack matrix stack.
+ * \param maxDepth maximum stack depth.
+ * \param dirtyFlag dirty flag.
+ *
+ * Allocates an array of \p maxDepth elements for the matrix stack and calls
+ * _math_matrix_ctr() and _math_matrix_alloc_inv() for each element to
+ * initialize it.
+ */
+static void
+init_matrix_stack( struct gl_matrix_stack *stack,
+ GLuint maxDepth, GLuint dirtyFlag )
+{
+ GLuint i;
+
+ stack->Depth = 0;
+ stack->MaxDepth = maxDepth;
+ stack->DirtyFlag = dirtyFlag;
+ /* The stack */
+ stack->Stack = (GLmatrix *) CALLOC(maxDepth * sizeof(GLmatrix));
+ for (i = 0; i < maxDepth; i++) {
+ _math_matrix_ctr(&stack->Stack[i]);
+ _math_matrix_alloc_inv(&stack->Stack[i]);
+ }
+ stack->Top = stack->Stack;
+}
+
+/**
+ * Free matrix stack.
+ *
+ * \param stack matrix stack.
+ *
+ * Calls _math_matrix_dtr() for each element of the matrix stack and
+ * frees the array.
+ */
+static void
+free_matrix_stack( struct gl_matrix_stack *stack )
+{
+ GLuint i;
+ for (i = 0; i < stack->MaxDepth; i++) {
+ _math_matrix_dtr(&stack->Stack[i]);
+ }
+ FREE(stack->Stack);
+ stack->Stack = stack->Top = NULL;
+}
+
+/*@}*/
+
+
+/**********************************************************************/
+/** \name Initialization */
+/*@{*/
+
+
+/**
+ * Initialize the context matrix data.
+ *
+ * \param ctx GL context.
+ *
+ * Initializes each of the matrix stacks and the combined modelview-projection
+ * matrix.
+ */
+void _mesa_init_matrix( struct gl_context * ctx )
+{
+ GLint i;
+
+ /* Initialize matrix stacks */
+ init_matrix_stack(&ctx->ModelviewMatrixStack, MAX_MODELVIEW_STACK_DEPTH,
+ _NEW_MODELVIEW);
+ init_matrix_stack(&ctx->ProjectionMatrixStack, MAX_PROJECTION_STACK_DEPTH,
+ _NEW_PROJECTION);
+ for (i = 0; i < Elements(ctx->TextureMatrixStack); i++)
+ init_matrix_stack(&ctx->TextureMatrixStack[i], MAX_TEXTURE_STACK_DEPTH,
+ _NEW_TEXTURE_MATRIX);
+ for (i = 0; i < Elements(ctx->ProgramMatrixStack); i++)
+ init_matrix_stack(&ctx->ProgramMatrixStack[i],
+ MAX_PROGRAM_MATRIX_STACK_DEPTH, _NEW_TRACK_MATRIX);
+ ctx->CurrentStack = &ctx->ModelviewMatrixStack;
+
+ /* Init combined Modelview*Projection matrix */
+ _math_matrix_ctr( &ctx->_ModelProjectMatrix );
+}
+
+
+/**
+ * Free the context matrix data.
+ *
+ * \param ctx GL context.
+ *
+ * Frees each of the matrix stacks and the combined modelview-projection
+ * matrix.
+ */
+void _mesa_free_matrix_data( struct gl_context *ctx )
+{
+ GLint i;
+
+ free_matrix_stack(&ctx->ModelviewMatrixStack);
+ free_matrix_stack(&ctx->ProjectionMatrixStack);
+ for (i = 0; i < Elements(ctx->TextureMatrixStack); i++)
+ free_matrix_stack(&ctx->TextureMatrixStack[i]);
+ for (i = 0; i < Elements(ctx->ProgramMatrixStack); i++)
+ free_matrix_stack(&ctx->ProgramMatrixStack[i]);
+ /* combined Modelview*Projection matrix */
+ _math_matrix_dtr( &ctx->_ModelProjectMatrix );
+
+}
+
+
+/**
+ * Initialize the context transform attribute group.
+ *
+ * \param ctx GL context.
+ *
+ * \todo Move this to a new file with other 'transform' routines.
+ */
+void _mesa_init_transform( struct gl_context *ctx )
+{
+ GLint i;
+
+ /* Transformation group */
+ ctx->Transform.MatrixMode = GL_MODELVIEW;
+ ctx->Transform.Normalize = GL_FALSE;
+ ctx->Transform.RescaleNormals = GL_FALSE;
+ ctx->Transform.RasterPositionUnclipped = GL_FALSE;
+ for (i=0;i<ctx->Const.MaxClipPlanes;i++) {
+ ASSIGN_4V( ctx->Transform.EyeUserPlane[i], 0.0, 0.0, 0.0, 0.0 );
+ }
+ ctx->Transform.ClipPlanesEnabled = 0;
+
+ ASSIGN_4V( ctx->Transform.CullObjPos, 0.0, 0.0, 1.0, 0.0 );
+ ASSIGN_4V( ctx->Transform.CullEyePos, 0.0, 0.0, 1.0, 0.0 );
+}
+
+
+/*@}*/
diff --git a/mesalib/src/mesa/main/mipmap.c b/mesalib/src/mesa/main/mipmap.c
index f170d235a..1ead5ee10 100644
--- a/mesalib/src/mesa/main/mipmap.c
+++ b/mesalib/src/mesa/main/mipmap.c
@@ -1986,7 +1986,7 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
gl_format temp_format;
GLint components;
GLuint temp_src_stride, temp_dst_stride; /* in bytes */
- GLchan *temp_src = NULL, *temp_dst = NULL;
+ GLubyte *temp_src = NULL, *temp_dst = NULL;
GLenum temp_datatype;
GLenum temp_base_format;
@@ -2101,7 +2101,7 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
/* swap src and dest pointers */
{
- GLchan *temp = temp_src;
+ GLubyte *temp = temp_src;
temp_src = temp_dst;
temp_dst = temp;
@@ -2109,7 +2109,7 @@ generate_mipmap_compressed(struct gl_context *ctx, GLenum target,
}
} /* loop over mipmap levels */
- free((void *) temp_src);
+ free(temp_src);
free(temp_dst);
}
@@ -2218,37 +2218,3 @@ do { \
}
}
-
-/**
- * Upscale an image by replication, not (typical) stretching.
- * We use this when the image width or height is less than a
- * certain size (4, 8) and we need to upscale an image.
- */
-void
-_mesa_upscale_teximage2d(GLsizei inWidth, GLsizei inHeight,
- GLsizei outWidth, GLsizei outHeight,
- GLint comps, const GLchan *src, GLint srcRowStride,
- GLchan *dest )
-{
- GLint i, j, k;
-
- ASSERT(outWidth >= inWidth);
- ASSERT(outHeight >= inHeight);
-#if 0
- ASSERT(inWidth == 1 || inWidth == 2 || inHeight == 1 || inHeight == 2);
- ASSERT((outWidth & 3) == 0);
- ASSERT((outHeight & 3) == 0);
-#endif
-
- for (i = 0; i < outHeight; i++) {
- const GLint ii = i % inHeight;
- for (j = 0; j < outWidth; j++) {
- const GLint jj = j % inWidth;
- for (k = 0; k < comps; k++) {
- dest[(i * outWidth + j) * comps + k]
- = src[ii * srcRowStride + jj * comps + k];
- }
- }
- }
-}
-
diff --git a/mesalib/src/mesa/main/mipmap.h b/mesalib/src/mesa/main/mipmap.h
index c0c6c2592..478395021 100644
--- a/mesalib/src/mesa/main/mipmap.h
+++ b/mesalib/src/mesa/main/mipmap.h
@@ -1,64 +1,58 @@
-/*
- * Mesa 3-D graphics library
- * Version: 6.5.2
- *
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef MIPMAP_H
-#define MIPMAP_H
-
-#include "mtypes.h"
-
-
-extern void
-_mesa_generate_mipmap_level(GLenum target,
- GLenum datatype, GLuint comps,
- GLint border,
- GLint srcWidth, GLint srcHeight, GLint srcDepth,
- const GLubyte *srcData,
- GLint srcRowStride,
- GLint dstWidth, GLint dstHeight, GLint dstDepth,
- GLubyte *dstData,
- GLint dstRowStride);
-
-
-extern void
-_mesa_generate_mipmap(struct gl_context *ctx, GLenum target,
- struct gl_texture_object *texObj);
-
-
-extern void
-_mesa_rescale_teximage2d(GLuint bytesPerPixel,
- GLuint srcStrideInPixels,
- GLuint dstRowStride,
- GLint srcWidth, GLint srcHeight,
- GLint dstWidth, GLint dstHeight,
- const GLvoid *srcImage, GLvoid *dstImage);
-
-extern void
-_mesa_upscale_teximage2d(GLsizei inWidth, GLsizei inHeight,
- GLsizei outWidth, GLsizei outHeight,
- GLint comps, const GLchan *src, GLint srcRowStride,
- GLchan *dest);
-
-
-#endif /* MIPMAP_H */
+/*
+ * Mesa 3-D graphics library
+ * Version: 6.5.2
+ *
+ * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef MIPMAP_H
+#define MIPMAP_H
+
+#include "mtypes.h"
+
+
+extern void
+_mesa_generate_mipmap_level(GLenum target,
+ GLenum datatype, GLuint comps,
+ GLint border,
+ GLint srcWidth, GLint srcHeight, GLint srcDepth,
+ const GLubyte *srcData,
+ GLint srcRowStride,
+ GLint dstWidth, GLint dstHeight, GLint dstDepth,
+ GLubyte *dstData,
+ GLint dstRowStride);
+
+
+extern void
+_mesa_generate_mipmap(struct gl_context *ctx, GLenum target,
+ struct gl_texture_object *texObj);
+
+
+extern void
+_mesa_rescale_teximage2d(GLuint bytesPerPixel,
+ GLuint srcStrideInPixels,
+ GLuint dstRowStride,
+ GLint srcWidth, GLint srcHeight,
+ GLint dstWidth, GLint dstHeight,
+ const GLvoid *srcImage, GLvoid *dstImage);
+
+
+#endif /* MIPMAP_H */
diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h
index 3b44ec6d5..42831d773 100644
--- a/mesalib/src/mesa/main/mtypes.h
+++ b/mesalib/src/mesa/main/mtypes.h
@@ -44,29 +44,6 @@
/**
- * Color channel data type.
- */
-#if CHAN_BITS == 8
- typedef GLubyte GLchan;
-#define CHAN_MAX 255
-#define CHAN_MAXF 255.0F
-#define CHAN_TYPE GL_UNSIGNED_BYTE
-#elif CHAN_BITS == 16
- typedef GLushort GLchan;
-#define CHAN_MAX 65535
-#define CHAN_MAXF 65535.0F
-#define CHAN_TYPE GL_UNSIGNED_SHORT
-#elif CHAN_BITS == 32
- typedef GLfloat GLchan;
-#define CHAN_MAX 1.0
-#define CHAN_MAXF 1.0F
-#define CHAN_TYPE GL_FLOAT
-#else
-#error "illegal number of color channel bits"
-#endif
-
-
-/**
* Stencil buffer data type.
*/
#if STENCIL_BITS==8
@@ -1950,6 +1927,8 @@ struct gl_vertex_program_state
GLboolean _Enabled; /**< Enabled and _valid_ user program? */
GLboolean PointSizeEnabled; /**< GL_VERTEX_PROGRAM_POINT_SIZE_ARB/NV */
GLboolean TwoSideEnabled; /**< GL_VERTEX_PROGRAM_TWO_SIDE_ARB/NV */
+ /** Computed two sided lighting for fixed function/programs. */
+ GLboolean _TwoSideEnabled;
struct gl_vertex_program *Current; /**< User-bound vertex program */
/** Currently enabled and valid vertex program (including internal
diff --git a/mesalib/src/mesa/main/pack.c b/mesalib/src/mesa/main/pack.c
index 8388708a4..6d6ae59f4 100644
--- a/mesalib/src/mesa/main/pack.c
+++ b/mesalib/src/mesa/main/pack.c
@@ -3437,7 +3437,7 @@ extract_uint_rgba(GLuint n, GLuint rgba[][4],
/*
* Unpack a row of color image data from a client buffer according to
* the pixel unpacking parameters.
- * Return GLchan values in the specified dest image format.
+ * Return GLubyte values in the specified dest image format.
* This is used by glDrawPixels and glTexImage?D().
* \param ctx - the context
* n - number of pixels in the span
@@ -3452,8 +3452,8 @@ extract_uint_rgba(GLuint n, GLuint rgba[][4],
* XXX perhaps expand this to process whole images someday.
*/
void
-_mesa_unpack_color_span_chan( struct gl_context *ctx,
- GLuint n, GLenum dstFormat, GLchan dest[],
+_mesa_unpack_color_span_ubyte(struct gl_context *ctx,
+ GLuint n, GLenum dstFormat, GLubyte dest[],
GLenum srcFormat, GLenum srcType,
const GLvoid *source,
const struct gl_pixelstore_attrib *srcPacking,
@@ -3517,21 +3517,21 @@ _mesa_unpack_color_span_chan( struct gl_context *ctx,
/* Try simple cases first */
if (transferOps == 0) {
- if (srcType == CHAN_TYPE) {
+ if (srcType == GL_UNSIGNED_BYTE) {
if (dstFormat == GL_RGBA) {
if (srcFormat == GL_RGBA) {
- memcpy( dest, source, n * 4 * sizeof(GLchan) );
+ memcpy( dest, source, n * 4 * sizeof(GLubyte) );
return;
}
else if (srcFormat == GL_RGB) {
GLuint i;
- const GLchan *src = (const GLchan *) source;
- GLchan *dst = dest;
+ const GLubyte *src = (const GLubyte *) source;
+ GLubyte *dst = dest;
for (i = 0; i < n; i++) {
dst[0] = src[0];
dst[1] = src[1];
dst[2] = src[2];
- dst[3] = CHAN_MAX;
+ dst[3] = 255;
src += 3;
dst += 4;
}
@@ -3540,13 +3540,13 @@ _mesa_unpack_color_span_chan( struct gl_context *ctx,
}
else if (dstFormat == GL_RGB) {
if (srcFormat == GL_RGB) {
- memcpy( dest, source, n * 3 * sizeof(GLchan) );
+ memcpy( dest, source, n * 3 * sizeof(GLubyte) );
return;
}
else if (srcFormat == GL_RGBA) {
GLuint i;
- const GLchan *src = (const GLchan *) source;
- GLchan *dst = dest;
+ const GLubyte *src = (const GLubyte *) source;
+ GLubyte *dst = dest;
for (i = 0; i < n; i++) {
dst[0] = src[0];
dst[1] = src[1];
@@ -3560,7 +3560,7 @@ _mesa_unpack_color_span_chan( struct gl_context *ctx,
else if (dstFormat == srcFormat) {
GLint comps = _mesa_components_in_format(srcFormat);
assert(comps > 0);
- memcpy( dest, source, n * comps * sizeof(GLchan) );
+ memcpy( dest, source, n * comps * sizeof(GLubyte) );
return;
}
}
@@ -3573,12 +3573,12 @@ _mesa_unpack_color_span_chan( struct gl_context *ctx,
if (srcFormat == GL_RGB) {
GLuint i;
const GLubyte *src = (const GLubyte *) source;
- GLchan *dst = dest;
+ GLubyte *dst = dest;
for (i = 0; i < n; i++) {
- dst[0] = UBYTE_TO_CHAN(src[0]);
- dst[1] = UBYTE_TO_CHAN(src[1]);
- dst[2] = UBYTE_TO_CHAN(src[2]);
- dst[3] = CHAN_MAX;
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
+ dst[3] = 255;
src += 3;
dst += 4;
}
@@ -3587,12 +3587,12 @@ _mesa_unpack_color_span_chan( struct gl_context *ctx,
else if (srcFormat == GL_RGBA) {
GLuint i;
const GLubyte *src = (const GLubyte *) source;
- GLchan *dst = dest;
+ GLubyte *dst = dest;
for (i = 0; i < n; i++) {
- dst[0] = UBYTE_TO_CHAN(src[0]);
- dst[1] = UBYTE_TO_CHAN(src[1]);
- dst[2] = UBYTE_TO_CHAN(src[2]);
- dst[3] = UBYTE_TO_CHAN(src[3]);
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
+ dst[3] = src[3];
src += 4;
dst += 4;
}
@@ -3603,11 +3603,11 @@ _mesa_unpack_color_span_chan( struct gl_context *ctx,
if (srcFormat == GL_RGB) {
GLuint i;
const GLubyte *src = (const GLubyte *) source;
- GLchan *dst = dest;
+ GLubyte *dst = dest;
for (i = 0; i < n; i++) {
- dst[0] = UBYTE_TO_CHAN(src[0]);
- dst[1] = UBYTE_TO_CHAN(src[1]);
- dst[2] = UBYTE_TO_CHAN(src[2]);
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
src += 3;
dst += 3;
}
@@ -3616,11 +3616,11 @@ _mesa_unpack_color_span_chan( struct gl_context *ctx,
else if (srcFormat == GL_RGBA) {
GLuint i;
const GLubyte *src = (const GLubyte *) source;
- GLchan *dst = dest;
+ GLubyte *dst = dest;
for (i = 0; i < n; i++) {
- dst[0] = UBYTE_TO_CHAN(src[0]);
- dst[1] = UBYTE_TO_CHAN(src[1]);
- dst[2] = UBYTE_TO_CHAN(src[2]);
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
src += 4;
dst += 3;
}
@@ -3679,10 +3679,8 @@ _mesa_unpack_color_span_chan( struct gl_context *ctx,
srcPacking->SwapBytes);
}
- /* Need to clamp if returning GLubytes or GLushorts */
-#if CHAN_TYPE != GL_FLOAT
+ /* Need to clamp if returning GLubytes */
transferOps |= IMAGE_CLAMP_BIT;
-#endif
if (transferOps) {
_mesa_apply_rgba_transfer_ops(ctx, transferOps, n, rgba);
@@ -3691,61 +3689,61 @@ _mesa_unpack_color_span_chan( struct gl_context *ctx,
get_component_indexes(dstFormat,
&rDst, &gDst, &bDst, &aDst, &lDst, &iDst);
- /* Now return the GLchan data in the requested dstFormat */
+ /* Now return the GLubyte data in the requested dstFormat */
if (rDst >= 0) {
- GLchan *dst = dest;
+ GLubyte *dst = dest;
GLuint i;
for (i = 0; i < n; i++) {
- CLAMPED_FLOAT_TO_CHAN(dst[rDst], rgba[i][RCOMP]);
+ CLAMPED_FLOAT_TO_UBYTE(dst[rDst], rgba[i][RCOMP]);
dst += dstComponents;
}
}
if (gDst >= 0) {
- GLchan *dst = dest;
+ GLubyte *dst = dest;
GLuint i;
for (i = 0; i < n; i++) {
- CLAMPED_FLOAT_TO_CHAN(dst[gDst], rgba[i][GCOMP]);
+ CLAMPED_FLOAT_TO_UBYTE(dst[gDst], rgba[i][GCOMP]);
dst += dstComponents;
}
}
if (bDst >= 0) {
- GLchan *dst = dest;
+ GLubyte *dst = dest;
GLuint i;
for (i = 0; i < n; i++) {
- CLAMPED_FLOAT_TO_CHAN(dst[bDst], rgba[i][BCOMP]);
+ CLAMPED_FLOAT_TO_UBYTE(dst[bDst], rgba[i][BCOMP]);
dst += dstComponents;
}
}
if (aDst >= 0) {
- GLchan *dst = dest;
+ GLubyte *dst = dest;
GLuint i;
for (i = 0; i < n; i++) {
- CLAMPED_FLOAT_TO_CHAN(dst[aDst], rgba[i][ACOMP]);
+ CLAMPED_FLOAT_TO_UBYTE(dst[aDst], rgba[i][ACOMP]);
dst += dstComponents;
}
}
if (iDst >= 0) {
- GLchan *dst = dest;
+ GLubyte *dst = dest;
GLuint i;
assert(iDst == 0);
assert(dstComponents == 1);
for (i = 0; i < n; i++) {
/* Intensity comes from red channel */
- CLAMPED_FLOAT_TO_CHAN(dst[i], rgba[i][RCOMP]);
+ CLAMPED_FLOAT_TO_UBYTE(dst[i], rgba[i][RCOMP]);
}
}
if (lDst >= 0) {
- GLchan *dst = dest;
+ GLubyte *dst = dest;
GLuint i;
assert(lDst == 0);
for (i = 0; i < n; i++) {
/* Luminance comes from red channel */
- CLAMPED_FLOAT_TO_CHAN(dst[0], rgba[i][RCOMP]);
+ CLAMPED_FLOAT_TO_UBYTE(dst[0], rgba[i][RCOMP]);
dst += dstComponents;
}
}
@@ -3756,8 +3754,8 @@ _mesa_unpack_color_span_chan( struct gl_context *ctx,
/**
- * Same as _mesa_unpack_color_span_chan(), but return GLfloat data
- * instead of GLchan.
+ * Same as _mesa_unpack_color_span_ubyte(), but return GLfloat data
+ * instead of GLubyte.
*/
void
_mesa_unpack_color_span_float( struct gl_context *ctx,
@@ -3954,8 +3952,8 @@ _mesa_unpack_color_span_float( struct gl_context *ctx,
/**
- * Same as _mesa_unpack_color_span_chan(), but return GLuint data
- * instead of GLchan.
+ * Same as _mesa_unpack_color_span_ubyte(), but return GLuint data
+ * instead of GLubyte.
* No pixel transfer ops are applied.
*/
void
diff --git a/mesalib/src/mesa/main/pack.h b/mesalib/src/mesa/main/pack.h
index 00aab409e..7c76baae4 100644
--- a/mesalib/src/mesa/main/pack.h
+++ b/mesalib/src/mesa/main/pack.h
@@ -58,8 +58,8 @@ _mesa_pack_rgba_span_float(struct gl_context *ctx, GLuint n,
extern void
-_mesa_unpack_color_span_chan(struct gl_context *ctx,
- GLuint n, GLenum dstFormat, GLchan dest[],
+_mesa_unpack_color_span_ubyte(struct gl_context *ctx,
+ GLuint n, GLenum dstFormat, GLubyte dest[],
GLenum srcFormat, GLenum srcType,
const GLvoid *source,
const struct gl_pixelstore_attrib *srcPacking,
diff --git a/mesalib/src/mesa/main/state.c b/mesalib/src/mesa/main/state.c
index 9d9c952dc..fc25515a0 100644
--- a/mesalib/src/mesa/main/state.c
+++ b/mesalib/src/mesa/main/state.c
@@ -447,7 +447,20 @@ update_clamp_read_color(struct gl_context *ctx)
ctx->Color._ClampReadColor = ctx->Color.ClampReadColor;
}
-
+/**
+ * Update the ctx->VertexProgram._TwoSideEnabled flag.
+ */
+static void
+update_twoside(struct gl_context *ctx)
+{
+ if (ctx->Shader.CurrentVertexProgram ||
+ ctx->VertexProgram.Current) {
+ ctx->VertexProgram._TwoSideEnabled = ctx->VertexProgram.TwoSideEnabled;
+ } else {
+ ctx->VertexProgram._TwoSideEnabled = (ctx->Light.Enabled &&
+ ctx->Light.Model.TwoSide);
+ }
+}
/*
@@ -603,6 +616,9 @@ _mesa_update_state_locked( struct gl_context *ctx )
if (new_state & _NEW_LIGHT)
_mesa_update_lighting( ctx );
+ if (new_state & (_NEW_LIGHT | _NEW_PROGRAM))
+ update_twoside( ctx );
+
if (new_state & (_NEW_LIGHT | _NEW_BUFFERS))
update_clamp_vertex_color(ctx);
diff --git a/mesalib/src/mesa/main/texcompress.c b/mesalib/src/mesa/main/texcompress.c
index b49d1b1ca..03e05d5ef 100644
--- a/mesalib/src/mesa/main/texcompress.c
+++ b/mesalib/src/mesa/main/texcompress.c
@@ -264,21 +264,23 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats)
}
}
-#if FEATURE_ES1 || FEATURE_ES2
- if (formats) {
- formats[n++] = GL_PALETTE4_RGB8_OES;
- formats[n++] = GL_PALETTE4_RGBA8_OES;
- formats[n++] = GL_PALETTE4_R5_G6_B5_OES;
- formats[n++] = GL_PALETTE4_RGBA4_OES;
- formats[n++] = GL_PALETTE4_RGB5_A1_OES;
- formats[n++] = GL_PALETTE8_RGB8_OES;
- formats[n++] = GL_PALETTE8_RGBA8_OES;
- formats[n++] = GL_PALETTE8_R5_G6_B5_OES;
- formats[n++] = GL_PALETTE8_RGBA4_OES;
- formats[n++] = GL_PALETTE8_RGB5_A1_OES;
- }
- else {
- n += 10;
+#if FEATURE_ES1
+ if (ctx->API == API_OPENGLES) {
+ if (formats) {
+ formats[n++] = GL_PALETTE4_RGB8_OES;
+ formats[n++] = GL_PALETTE4_RGBA8_OES;
+ formats[n++] = GL_PALETTE4_R5_G6_B5_OES;
+ formats[n++] = GL_PALETTE4_RGBA4_OES;
+ formats[n++] = GL_PALETTE4_RGB5_A1_OES;
+ formats[n++] = GL_PALETTE8_RGB8_OES;
+ formats[n++] = GL_PALETTE8_RGBA8_OES;
+ formats[n++] = GL_PALETTE8_R5_G6_B5_OES;
+ formats[n++] = GL_PALETTE8_RGBA4_OES;
+ formats[n++] = GL_PALETTE8_RGB5_A1_OES;
+ }
+ else {
+ n += 10;
+ }
}
#endif
diff --git a/mesalib/src/mesa/main/texcompress_fxt1.c b/mesalib/src/mesa/main/texcompress_fxt1.c
index a75487ce2..0437cfcc1 100644
--- a/mesalib/src/mesa/main/texcompress_fxt1.c
+++ b/mesalib/src/mesa/main/texcompress_fxt1.c
@@ -52,7 +52,7 @@ fxt1_encode (GLuint width, GLuint height, GLint comps,
void
fxt1_decode_1 (const void *texture, GLint stride,
- GLint i, GLint j, GLchan *rgba);
+ GLint i, GLint j, GLubyte *rgba);
/**
@@ -61,11 +61,11 @@ fxt1_decode_1 (const void *texture, GLint stride,
GLboolean
_mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS)
{
- const GLchan *pixels;
+ const GLubyte *pixels;
GLint srcRowStride;
GLubyte *dst;
const GLint texWidth = dstRowStride * 8 / 16; /* a bit of a hack */
- const GLchan *tempImage = NULL;
+ const GLubyte *tempImage = NULL;
ASSERT(dstFormat == MESA_FORMAT_RGB_FXT1);
ASSERT(dstXoffset % 8 == 0);
@@ -75,11 +75,11 @@ _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS)
(void) dstImageOffsets;
if (srcFormat != GL_RGB ||
- srcType != CHAN_TYPE ||
+ srcType != GL_UNSIGNED_BYTE ||
ctx->_ImageTransferState ||
srcPacking->SwapBytes) {
- /* convert image to RGB/GLchan */
- tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ /* convert image to RGB/GLubyte */
+ tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
_mesa_get_format_base_format(dstFormat),
srcWidth, srcHeight, srcDepth,
@@ -92,9 +92,9 @@ _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS)
srcFormat = GL_RGB;
}
else {
- pixels = (const GLchan *) srcAddr;
+ pixels = (const GLubyte *) srcAddr;
srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat,
- srcType) / sizeof(GLchan);
+ srcType) / sizeof(GLubyte);
}
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
@@ -117,11 +117,11 @@ _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS)
GLboolean
_mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS)
{
- const GLchan *pixels;
+ const GLubyte *pixels;
GLint srcRowStride;
GLubyte *dst;
GLint texWidth = dstRowStride * 8 / 16; /* a bit of a hack */
- const GLchan *tempImage = NULL;
+ const GLubyte *tempImage = NULL;
ASSERT(dstFormat == MESA_FORMAT_RGBA_FXT1);
ASSERT(dstXoffset % 8 == 0);
@@ -131,11 +131,11 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS)
(void) dstImageOffsets;
if (srcFormat != GL_RGBA ||
- srcType != CHAN_TYPE ||
+ srcType != GL_UNSIGNED_BYTE ||
ctx->_ImageTransferState ||
srcPacking->SwapBytes) {
- /* convert image to RGBA/GLchan */
- tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ /* convert image to RGBA/GLubyte */
+ tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
_mesa_get_format_base_format(dstFormat),
srcWidth, srcHeight, srcDepth,
@@ -148,9 +148,9 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS)
srcFormat = GL_RGBA;
}
else {
- pixels = (const GLchan *) srcAddr;
+ pixels = (const GLubyte *) srcAddr;
srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat,
- srcType) / sizeof(GLchan);
+ srcType) / sizeof(GLubyte);
}
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
@@ -171,14 +171,14 @@ void
_mesa_fetch_texel_2d_f_rgba_fxt1( const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel )
{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
+ /* just sample as GLubyte and convert to float here */
+ GLubyte rgba[4];
(void) k;
fxt1_decode_1(texImage->Base.Data, texImage->Base.RowStride, i, j, rgba);
- texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
- texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
- texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
- texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
+ texel[RCOMP] = UBYTE_TO_FLOAT(rgba[RCOMP]);
+ texel[GCOMP] = UBYTE_TO_FLOAT(rgba[GCOMP]);
+ texel[BCOMP] = UBYTE_TO_FLOAT(rgba[BCOMP]);
+ texel[ACOMP] = UBYTE_TO_FLOAT(rgba[ACOMP]);
}
@@ -186,13 +186,13 @@ void
_mesa_fetch_texel_2d_f_rgb_fxt1( const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel )
{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
+ /* just sample as GLubyte and convert to float here */
+ GLubyte rgba[4];
(void) k;
fxt1_decode_1(texImage->Base.Data, texImage->Base.RowStride, i, j, rgba);
- texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
- texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
- texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
+ texel[RCOMP] = UBYTE_TO_FLOAT(rgba[RCOMP]);
+ texel[GCOMP] = UBYTE_TO_FLOAT(rgba[GCOMP]);
+ texel[BCOMP] = UBYTE_TO_FLOAT(rgba[BCOMP]);
texel[ACOMP] = 1.0F;
}
@@ -1289,6 +1289,41 @@ fxt1_quantize (GLuint *cc, const GLubyte *lines[], GLint comps)
}
+
+/**
+ * Upscale an image by replication, not (typical) stretching.
+ * We use this when the image width or height is less than a
+ * certain size (4, 8) and we need to upscale an image.
+ */
+static void
+upscale_teximage2d(GLsizei inWidth, GLsizei inHeight,
+ GLsizei outWidth, GLsizei outHeight,
+ GLint comps, const GLubyte *src, GLint srcRowStride,
+ GLubyte *dest )
+{
+ GLint i, j, k;
+
+ ASSERT(outWidth >= inWidth);
+ ASSERT(outHeight >= inHeight);
+#if 0
+ ASSERT(inWidth == 1 || inWidth == 2 || inHeight == 1 || inHeight == 2);
+ ASSERT((outWidth & 3) == 0);
+ ASSERT((outHeight & 3) == 0);
+#endif
+
+ for (i = 0; i < outHeight; i++) {
+ const GLint ii = i % inHeight;
+ for (j = 0; j < outWidth; j++) {
+ const GLint jj = j % inWidth;
+ for (k = 0; k < comps; k++) {
+ dest[(i * outWidth + j) * comps + k]
+ = src[ii * srcRowStride + jj * comps + k];
+ }
+ }
+ }
+}
+
+
static void
fxt1_encode (GLuint width, GLuint height, GLint comps,
const void *source, GLint srcRowStride,
@@ -1305,42 +1340,21 @@ fxt1_encode (GLuint width, GLuint height, GLint comps,
if ((width & 7) | (height & 3)) {
GLint newWidth = (width + 7) & ~7;
GLint newHeight = (height + 3) & ~3;
- newSource = malloc(comps * newWidth * newHeight * sizeof(GLchan));
+ newSource = malloc(comps * newWidth * newHeight * sizeof(GLubyte));
if (!newSource) {
GET_CURRENT_CONTEXT(ctx);
_mesa_error(ctx, GL_OUT_OF_MEMORY, "texture compression");
goto cleanUp;
}
- _mesa_upscale_teximage2d(width, height, newWidth, newHeight,
- comps, (const GLchan *) source,
- srcRowStride, (GLchan *) newSource);
+ upscale_teximage2d(width, height, newWidth, newHeight,
+ comps, (const GLubyte *) source,
+ srcRowStride, (GLubyte *) newSource);
source = newSource;
width = newWidth;
height = newHeight;
srcRowStride = comps * newWidth;
}
- /* convert from 16/32-bit channels to GLubyte if needed */
- if (CHAN_TYPE != GL_UNSIGNED_BYTE) {
- const GLuint n = width * height * comps;
- const GLchan *src = (const GLchan *) source;
- GLubyte *dest = (GLubyte *) malloc(n * sizeof(GLubyte));
- GLuint i;
- if (!dest) {
- GET_CURRENT_CONTEXT(ctx);
- _mesa_error(ctx, GL_OUT_OF_MEMORY, "texture compression");
- goto cleanUp;
- }
- for (i = 0; i < n; i++) {
- dest[i] = CHAN_TO_UBYTE(src[i]);
- }
- if (newSource != NULL) {
- free(newSource);
- }
- newSource = dest; /* we'll free this buffer before returning */
- source = dest; /* the new, GLubyte incoming image */
- }
-
data = (const GLubyte *) source;
destRowStride = (destRowStride - width * 2) / 4;
for (y = 0; y < height; y += 4) {
@@ -1402,7 +1416,7 @@ static const GLubyte _rgb_scale_6[] = {
static void
-fxt1_decode_1HI (const GLubyte *code, GLint t, GLchan *rgba)
+fxt1_decode_1HI (const GLubyte *code, GLint t, GLubyte *rgba)
{
const GLuint *cc;
@@ -1428,16 +1442,16 @@ fxt1_decode_1HI (const GLubyte *code, GLint t, GLchan *rgba)
g = LERP(6, t, UP5(CC_SEL(cc, 5)), UP5(CC_SEL(cc, 20)));
r = LERP(6, t, UP5(CC_SEL(cc, 10)), UP5(CC_SEL(cc, 25)));
}
- rgba[RCOMP] = UBYTE_TO_CHAN(r);
- rgba[GCOMP] = UBYTE_TO_CHAN(g);
- rgba[BCOMP] = UBYTE_TO_CHAN(b);
- rgba[ACOMP] = CHAN_MAX;
+ rgba[RCOMP] = r;
+ rgba[GCOMP] = g;
+ rgba[BCOMP] = b;
+ rgba[ACOMP] = 255;
}
}
static void
-fxt1_decode_1CHROMA (const GLubyte *code, GLint t, GLchan *rgba)
+fxt1_decode_1CHROMA (const GLubyte *code, GLint t, GLubyte *rgba)
{
const GLuint *cc;
GLuint kk;
@@ -1452,15 +1466,15 @@ fxt1_decode_1CHROMA (const GLubyte *code, GLint t, GLchan *rgba)
t *= 15;
cc = (const GLuint *)(code + 8 + t / 8);
kk = cc[0] >> (t & 7);
- rgba[BCOMP] = UBYTE_TO_CHAN( UP5(kk) );
- rgba[GCOMP] = UBYTE_TO_CHAN( UP5(kk >> 5) );
- rgba[RCOMP] = UBYTE_TO_CHAN( UP5(kk >> 10) );
- rgba[ACOMP] = CHAN_MAX;
+ rgba[BCOMP] = UP5(kk);
+ rgba[GCOMP] = UP5(kk >> 5);
+ rgba[RCOMP] = UP5(kk >> 10);
+ rgba[ACOMP] = 255;
}
static void
-fxt1_decode_1MIXED (const GLubyte *code, GLint t, GLchan *rgba)
+fxt1_decode_1MIXED (const GLubyte *code, GLint t, GLubyte *rgba)
{
const GLuint *cc;
GLuint col[2][3];
@@ -1515,10 +1529,10 @@ fxt1_decode_1MIXED (const GLubyte *code, GLint t, GLchan *rgba)
g = (UP5(col[0][GCOMP]) + UP6(col[1][GCOMP], glsb)) / 2;
r = (UP5(col[0][RCOMP]) + UP5(col[1][RCOMP])) / 2;
}
- rgba[RCOMP] = UBYTE_TO_CHAN(r);
- rgba[GCOMP] = UBYTE_TO_CHAN(g);
- rgba[BCOMP] = UBYTE_TO_CHAN(b);
- rgba[ACOMP] = CHAN_MAX;
+ rgba[RCOMP] = r;
+ rgba[GCOMP] = g;
+ rgba[BCOMP] = b;
+ rgba[ACOMP] = 255;
}
} else {
/* alpha[0] == 0 */
@@ -1537,16 +1551,16 @@ fxt1_decode_1MIXED (const GLubyte *code, GLint t, GLchan *rgba)
UP6(col[1][GCOMP], glsb));
r = LERP(3, t, UP5(col[0][RCOMP]), UP5(col[1][RCOMP]));
}
- rgba[RCOMP] = UBYTE_TO_CHAN(r);
- rgba[GCOMP] = UBYTE_TO_CHAN(g);
- rgba[BCOMP] = UBYTE_TO_CHAN(b);
- rgba[ACOMP] = CHAN_MAX;
+ rgba[RCOMP] = r;
+ rgba[GCOMP] = g;
+ rgba[BCOMP] = b;
+ rgba[ACOMP] = 255;
}
}
static void
-fxt1_decode_1ALPHA (const GLubyte *code, GLint t, GLchan *rgba)
+fxt1_decode_1ALPHA (const GLubyte *code, GLint t, GLubyte *rgba)
{
const GLuint *cc;
GLubyte r, g, b, a;
@@ -1613,18 +1627,18 @@ fxt1_decode_1ALPHA (const GLubyte *code, GLint t, GLchan *rgba)
r = UP5(kk >> 10);
}
}
- rgba[RCOMP] = UBYTE_TO_CHAN(r);
- rgba[GCOMP] = UBYTE_TO_CHAN(g);
- rgba[BCOMP] = UBYTE_TO_CHAN(b);
- rgba[ACOMP] = UBYTE_TO_CHAN(a);
+ rgba[RCOMP] = r;
+ rgba[GCOMP] = g;
+ rgba[BCOMP] = b;
+ rgba[ACOMP] = a;
}
void
fxt1_decode_1 (const void *texture, GLint stride, /* in pixels */
- GLint i, GLint j, GLchan *rgba)
+ GLint i, GLint j, GLubyte *rgba)
{
- static void (*decode_1[]) (const GLubyte *, GLint, GLchan *) = {
+ static void (*decode_1[]) (const GLubyte *, GLint, GLubyte *) = {
fxt1_decode_1HI, /* cc-high = "00?" */
fxt1_decode_1HI, /* cc-high = "00?" */
fxt1_decode_1CHROMA, /* cc-chroma = "010" */
diff --git a/mesalib/src/mesa/main/texcompress_rgtc.c b/mesalib/src/mesa/main/texcompress_rgtc.c
index 7af3d6762..398f61290 100644
--- a/mesalib/src/mesa/main/texcompress_rgtc.c
+++ b/mesalib/src/mesa/main/texcompress_rgtc.c
@@ -48,9 +48,9 @@
#define RGTC_DEBUG 0
-static void unsigned_encode_rgtc_chan(GLubyte *blkaddr, GLubyte srccolors[4][4],
+static void unsigned_encode_rgtc_ubyte(GLubyte *blkaddr, GLubyte srccolors[4][4],
GLint numxpixels, GLint numypixels);
-static void signed_encode_rgtc_chan(GLbyte *blkaddr, GLbyte srccolors[4][4],
+static void signed_encode_rgtc_ubyte(GLbyte *blkaddr, GLbyte srccolors[4][4],
GLint numxpixels, GLint numypixels);
static void unsigned_fetch_texel_rgtc(unsigned srcRowStride, const GLubyte *pixdata,
@@ -59,15 +59,15 @@ static void unsigned_fetch_texel_rgtc(unsigned srcRowStride, const GLubyte *pixd
static void signed_fetch_texel_rgtc(unsigned srcRowStride, const GLbyte *pixdata,
unsigned i, unsigned j, GLbyte *value, unsigned comps);
-static void extractsrc_u( GLubyte srcpixels[4][4], const GLchan *srcaddr,
+static void extractsrc_u( GLubyte srcpixels[4][4], const GLubyte *srcaddr,
GLint srcRowStride, GLint numxpixels, GLint numypixels, GLint comps)
{
GLubyte i, j;
- const GLchan *curaddr;
+ const GLubyte *curaddr;
for (j = 0; j < numypixels; j++) {
curaddr = srcaddr + j * srcRowStride * comps;
for (i = 0; i < numxpixels; i++) {
- srcpixels[j][i] = *curaddr / (CHAN_MAX / 255);
+ srcpixels[j][i] = *curaddr;
curaddr += comps;
}
}
@@ -93,10 +93,10 @@ _mesa_texstore_red_rgtc1(TEXSTORE_PARAMS)
{
GLubyte *dst;
const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */
- const GLchan *tempImage = NULL;
+ const GLubyte *tempImage = NULL;
int i, j;
int numxpixels, numypixels;
- const GLchan *srcaddr;
+ const GLubyte *srcaddr;
GLubyte srcpixels[4][4];
GLubyte *blkaddr;
GLint dstRowDiff;
@@ -109,7 +109,7 @@ _mesa_texstore_red_rgtc1(TEXSTORE_PARAMS)
(void) dstImageOffsets;
- tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
_mesa_get_format_base_format(dstFormat),
srcWidth, srcHeight, srcDepth,
@@ -132,7 +132,7 @@ _mesa_texstore_red_rgtc1(TEXSTORE_PARAMS)
if (srcWidth > i + 3) numxpixels = 4;
else numxpixels = srcWidth - i;
extractsrc_u(srcpixels, srcaddr, srcWidth, numxpixels, numypixels, 1);
- unsigned_encode_rgtc_chan(blkaddr, srcpixels, numxpixels, numypixels);
+ unsigned_encode_rgtc_ubyte(blkaddr, srcpixels, numxpixels, numypixels);
srcaddr += numxpixels;
blkaddr += 8;
}
@@ -187,7 +187,7 @@ _mesa_texstore_signed_red_rgtc1(TEXSTORE_PARAMS)
if (srcWidth > i + 3) numxpixels = 4;
else numxpixels = srcWidth - i;
extractsrc_s(srcpixels, srcaddr, srcWidth, numxpixels, numypixels, 1);
- signed_encode_rgtc_chan(blkaddr, srcpixels, numxpixels, numypixels);
+ signed_encode_rgtc_ubyte(blkaddr, srcpixels, numxpixels, numypixels);
srcaddr += numxpixels;
blkaddr += 8;
}
@@ -204,10 +204,10 @@ _mesa_texstore_rg_rgtc2(TEXSTORE_PARAMS)
{
GLubyte *dst;
const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */
- const GLchan *tempImage = NULL;
+ const GLubyte *tempImage = NULL;
int i, j;
int numxpixels, numypixels;
- const GLchan *srcaddr;
+ const GLubyte *srcaddr;
GLubyte srcpixels[4][4];
GLubyte *blkaddr;
GLint dstRowDiff;
@@ -220,7 +220,7 @@ _mesa_texstore_rg_rgtc2(TEXSTORE_PARAMS)
(void) dstZoffset;
(void) dstImageOffsets;
- tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
_mesa_get_format_base_format(dstFormat),
srcWidth, srcHeight, srcDepth,
@@ -243,11 +243,11 @@ _mesa_texstore_rg_rgtc2(TEXSTORE_PARAMS)
if (srcWidth > i + 3) numxpixels = 4;
else numxpixels = srcWidth - i;
extractsrc_u(srcpixels, srcaddr, srcWidth, numxpixels, numypixels, 2);
- unsigned_encode_rgtc_chan(blkaddr, srcpixels, numxpixels, numypixels);
+ unsigned_encode_rgtc_ubyte(blkaddr, srcpixels, numxpixels, numypixels);
blkaddr += 8;
- extractsrc_u(srcpixels, (GLchan *)srcaddr + 1, srcWidth, numxpixels, numypixels, 2);
- unsigned_encode_rgtc_chan(blkaddr, srcpixels, numxpixels, numypixels);
+ extractsrc_u(srcpixels, (GLubyte *)srcaddr + 1, srcWidth, numxpixels, numypixels, 2);
+ unsigned_encode_rgtc_ubyte(blkaddr, srcpixels, numxpixels, numypixels);
blkaddr += 8;
@@ -306,11 +306,11 @@ _mesa_texstore_signed_rg_rgtc2(TEXSTORE_PARAMS)
else numxpixels = srcWidth - i;
extractsrc_s(srcpixels, srcaddr, srcWidth, numxpixels, numypixels, 2);
- signed_encode_rgtc_chan(blkaddr, srcpixels, numxpixels, numypixels);
+ signed_encode_rgtc_ubyte(blkaddr, srcpixels, numxpixels, numypixels);
blkaddr += 8;
extractsrc_s(srcpixels, srcaddr + 1, srcWidth, numxpixels, numypixels, 2);
- signed_encode_rgtc_chan(blkaddr, srcpixels, numxpixels, numypixels);
+ signed_encode_rgtc_ubyte(blkaddr, srcpixels, numxpixels, numypixels);
blkaddr += 8;
srcaddr += numxpixels * 2;
diff --git a/mesalib/src/mesa/main/texcompress_rgtc_tmp.h b/mesalib/src/mesa/main/texcompress_rgtc_tmp.h
index 48bbd374e..277d69b17 100644
--- a/mesalib/src/mesa/main/texcompress_rgtc_tmp.h
+++ b/mesalib/src/mesa/main/texcompress_rgtc_tmp.h
@@ -73,7 +73,7 @@ static void TAG(write_rgtc_encoded_channel)(TYPE *blkaddr,
*blkaddr++ = (alphaenc[13] >> 1) | (alphaenc[14] << 2) | (alphaenc[15] << 5);
}
-static void TAG(encode_rgtc_chan)(TYPE *blkaddr, TYPE srccolors[4][4],
+static void TAG(encode_rgtc_ubyte)(TYPE *blkaddr, TYPE srccolors[4][4],
int numxpixels, int numypixels)
{
TYPE alphabase[2], alphause[2];
diff --git a/mesalib/src/mesa/main/texcompress_s3tc.c b/mesalib/src/mesa/main/texcompress_s3tc.c
index 779e1a4c8..42dc1ae2f 100644
--- a/mesalib/src/mesa/main/texcompress_s3tc.c
+++ b/mesalib/src/mesa/main/texcompress_s3tc.c
@@ -101,7 +101,7 @@ dxtFetchTexelFuncExt fetch_ext_rgba_dxt3 = NULL;
dxtFetchTexelFuncExt fetch_ext_rgba_dxt5 = NULL;
typedef void (*dxtCompressTexFuncExt)(GLint srccomps, GLint width,
- GLint height, const GLchan *srcPixData,
+ GLint height, const GLubyte *srcPixData,
GLenum destformat, GLubyte *dest,
GLint dstRowStride);
@@ -167,10 +167,10 @@ _mesa_init_texture_s3tc( struct gl_context *ctx )
GLboolean
_mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS)
{
- const GLchan *pixels;
+ const GLubyte *pixels;
GLubyte *dst;
const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */
- const GLchan *tempImage = NULL;
+ const GLubyte *tempImage = NULL;
ASSERT(dstFormat == MESA_FORMAT_RGB_DXT1 ||
dstFormat == MESA_FORMAT_SRGB_DXT1);
@@ -181,11 +181,11 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS)
(void) dstImageOffsets;
if (srcFormat != GL_RGB ||
- srcType != CHAN_TYPE ||
+ srcType != GL_UNSIGNED_BYTE ||
ctx->_ImageTransferState ||
srcPacking->SwapBytes) {
- /* convert image to RGB/GLchan */
- tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ /* convert image to RGB/GLubyte */
+ tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
_mesa_get_format_base_format(dstFormat),
srcWidth, srcHeight, srcDepth,
@@ -197,7 +197,7 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS)
srcFormat = GL_RGB;
}
else {
- pixels = (const GLchan *) srcAddr;
+ pixels = (const GLubyte *) srcAddr;
}
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
@@ -226,10 +226,10 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS)
GLboolean
_mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS)
{
- const GLchan *pixels;
+ const GLubyte *pixels;
GLubyte *dst;
const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */
- const GLchan *tempImage = NULL;
+ const GLubyte *tempImage = NULL;
ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT1 ||
dstFormat == MESA_FORMAT_SRGBA_DXT1);
@@ -240,11 +240,11 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS)
(void) dstImageOffsets;
if (srcFormat != GL_RGBA ||
- srcType != CHAN_TYPE ||
+ srcType != GL_UNSIGNED_BYTE ||
ctx->_ImageTransferState ||
srcPacking->SwapBytes) {
- /* convert image to RGBA/GLchan */
- tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ /* convert image to RGBA/GLubyte */
+ tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
_mesa_get_format_base_format(dstFormat),
srcWidth, srcHeight, srcDepth,
@@ -256,7 +256,7 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS)
srcFormat = GL_RGBA;
}
else {
- pixels = (const GLchan *) srcAddr;
+ pixels = (const GLubyte *) srcAddr;
}
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
@@ -284,10 +284,10 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS)
GLboolean
_mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS)
{
- const GLchan *pixels;
+ const GLubyte *pixels;
GLubyte *dst;
const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */
- const GLchan *tempImage = NULL;
+ const GLubyte *tempImage = NULL;
ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT3 ||
dstFormat == MESA_FORMAT_SRGBA_DXT3);
@@ -298,11 +298,11 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS)
(void) dstImageOffsets;
if (srcFormat != GL_RGBA ||
- srcType != CHAN_TYPE ||
+ srcType != GL_UNSIGNED_BYTE ||
ctx->_ImageTransferState ||
srcPacking->SwapBytes) {
- /* convert image to RGBA/GLchan */
- tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ /* convert image to RGBA/GLubyte */
+ tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
_mesa_get_format_base_format(dstFormat),
srcWidth, srcHeight, srcDepth,
@@ -313,7 +313,7 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS)
pixels = tempImage;
}
else {
- pixels = (const GLchan *) srcAddr;
+ pixels = (const GLubyte *) srcAddr;
}
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
@@ -341,10 +341,10 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS)
GLboolean
_mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS)
{
- const GLchan *pixels;
+ const GLubyte *pixels;
GLubyte *dst;
const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */
- const GLchan *tempImage = NULL;
+ const GLubyte *tempImage = NULL;
ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT5 ||
dstFormat == MESA_FORMAT_SRGBA_DXT5);
@@ -355,11 +355,11 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS)
(void) dstImageOffsets;
if (srcFormat != GL_RGBA ||
- srcType != CHAN_TYPE ||
+ srcType != GL_UNSIGNED_BYTE ||
ctx->_ImageTransferState ||
srcPacking->SwapBytes) {
- /* convert image to RGBA/GLchan */
- tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ /* convert image to RGBA/GLubyte */
+ tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
_mesa_get_format_base_format(dstFormat),
srcWidth, srcHeight, srcDepth,
@@ -370,7 +370,7 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS)
pixels = tempImage;
}
else {
- pixels = (const GLchan *) srcAddr;
+ pixels = (const GLubyte *) srcAddr;
}
dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0,
@@ -394,11 +394,10 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS)
static void
fetch_texel_2d_rgb_dxt1( const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
+ GLint i, GLint j, GLint k, GLubyte *texel )
{
(void) k;
if (fetch_ext_rgb_dxt1) {
- ASSERT (sizeof(GLchan) == sizeof(GLubyte));
fetch_ext_rgb_dxt1(texImage->Base.RowStride,
(GLubyte *)(texImage)->Base.Data, i, j, texel);
}
@@ -411,19 +410,19 @@ void
_mesa_fetch_texel_2d_f_rgb_dxt1(const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel)
{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
+ /* just sample as GLubyte and convert to float here */
+ GLubyte rgba[4];
fetch_texel_2d_rgb_dxt1(texImage, i, j, k, rgba);
- texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
- texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
- texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
- texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
+ texel[RCOMP] = UBYTE_TO_FLOAT(rgba[RCOMP]);
+ texel[GCOMP] = UBYTE_TO_FLOAT(rgba[GCOMP]);
+ texel[BCOMP] = UBYTE_TO_FLOAT(rgba[BCOMP]);
+ texel[ACOMP] = UBYTE_TO_FLOAT(rgba[ACOMP]);
}
static void
fetch_texel_2d_rgba_dxt1( const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
+ GLint i, GLint j, GLint k, GLubyte *texel )
{
(void) k;
if (fetch_ext_rgba_dxt1) {
@@ -439,23 +438,22 @@ void
_mesa_fetch_texel_2d_f_rgba_dxt1(const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel)
{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
+ /* just sample as GLubyte and convert to float here */
+ GLubyte rgba[4];
fetch_texel_2d_rgba_dxt1(texImage, i, j, k, rgba);
- texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
- texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
- texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
- texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
+ texel[RCOMP] = UBYTE_TO_FLOAT(rgba[RCOMP]);
+ texel[GCOMP] = UBYTE_TO_FLOAT(rgba[GCOMP]);
+ texel[BCOMP] = UBYTE_TO_FLOAT(rgba[BCOMP]);
+ texel[ACOMP] = UBYTE_TO_FLOAT(rgba[ACOMP]);
}
static void
fetch_texel_2d_rgba_dxt3( const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
+ GLint i, GLint j, GLint k, GLubyte *texel )
{
(void) k;
if (fetch_ext_rgba_dxt3) {
- ASSERT (sizeof(GLchan) == sizeof(GLubyte));
fetch_ext_rgba_dxt3(texImage->Base.RowStride,
(GLubyte *)(texImage)->Base.Data,
i, j, texel);
@@ -469,19 +467,19 @@ void
_mesa_fetch_texel_2d_f_rgba_dxt3(const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel)
{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
+ /* just sample as GLubyte and convert to float here */
+ GLubyte rgba[4];
fetch_texel_2d_rgba_dxt3(texImage, i, j, k, rgba);
- texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
- texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
- texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
- texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
+ texel[RCOMP] = UBYTE_TO_FLOAT(rgba[RCOMP]);
+ texel[GCOMP] = UBYTE_TO_FLOAT(rgba[GCOMP]);
+ texel[BCOMP] = UBYTE_TO_FLOAT(rgba[BCOMP]);
+ texel[ACOMP] = UBYTE_TO_FLOAT(rgba[ACOMP]);
}
static void
fetch_texel_2d_rgba_dxt5( const struct swrast_texture_image *texImage,
- GLint i, GLint j, GLint k, GLchan *texel )
+ GLint i, GLint j, GLint k, GLubyte *texel )
{
(void) k;
if (fetch_ext_rgba_dxt5) {
@@ -498,13 +496,13 @@ void
_mesa_fetch_texel_2d_f_rgba_dxt5(const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel)
{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
+ /* just sample as GLubyte and convert to float here */
+ GLubyte rgba[4];
fetch_texel_2d_rgba_dxt5(texImage, i, j, k, rgba);
- texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);
- texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);
- texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]);
- texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
+ texel[RCOMP] = UBYTE_TO_FLOAT(rgba[RCOMP]);
+ texel[GCOMP] = UBYTE_TO_FLOAT(rgba[GCOMP]);
+ texel[BCOMP] = UBYTE_TO_FLOAT(rgba[BCOMP]);
+ texel[ACOMP] = UBYTE_TO_FLOAT(rgba[ACOMP]);
}
#if FEATURE_EXT_texture_sRGB
@@ -512,52 +510,52 @@ void
_mesa_fetch_texel_2d_f_srgb_dxt1( const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel )
{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
+ /* just sample as GLubyte and convert to float here */
+ GLubyte rgba[4];
fetch_texel_2d_rgb_dxt1(texImage, i, j, k, rgba);
texel[RCOMP] = nonlinear_to_linear(rgba[RCOMP]);
texel[GCOMP] = nonlinear_to_linear(rgba[GCOMP]);
texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]);
- texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
+ texel[ACOMP] = UBYTE_TO_FLOAT(rgba[ACOMP]);
}
void
_mesa_fetch_texel_2d_f_srgba_dxt1(const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel)
{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
+ /* just sample as GLubyte and convert to float here */
+ GLubyte rgba[4];
fetch_texel_2d_rgba_dxt1(texImage, i, j, k, rgba);
texel[RCOMP] = nonlinear_to_linear(rgba[RCOMP]);
texel[GCOMP] = nonlinear_to_linear(rgba[GCOMP]);
texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]);
- texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
+ texel[ACOMP] = UBYTE_TO_FLOAT(rgba[ACOMP]);
}
void
_mesa_fetch_texel_2d_f_srgba_dxt3(const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel)
{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
+ /* just sample as GLubyte and convert to float here */
+ GLubyte rgba[4];
fetch_texel_2d_rgba_dxt3(texImage, i, j, k, rgba);
texel[RCOMP] = nonlinear_to_linear(rgba[RCOMP]);
texel[GCOMP] = nonlinear_to_linear(rgba[GCOMP]);
texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]);
- texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
+ texel[ACOMP] = UBYTE_TO_FLOAT(rgba[ACOMP]);
}
void
_mesa_fetch_texel_2d_f_srgba_dxt5(const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel)
{
- /* just sample as GLchan and convert to float here */
- GLchan rgba[4];
+ /* just sample as GLubyte and convert to float here */
+ GLubyte rgba[4];
fetch_texel_2d_rgba_dxt5(texImage, i, j, k, rgba);
texel[RCOMP] = nonlinear_to_linear(rgba[RCOMP]);
texel[GCOMP] = nonlinear_to_linear(rgba[GCOMP]);
texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]);
- texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]);
+ texel[ACOMP] = UBYTE_TO_FLOAT(rgba[ACOMP]);
}
#endif /* FEATURE_EXT_texture_sRGB */
diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c
index b958615b5..cbed26cd4 100644
--- a/mesalib/src/mesa/main/texstore.c
+++ b/mesalib/src/mesa/main/texstore.c
@@ -531,7 +531,7 @@ make_temp_uint_image(struct gl_context *ctx, GLuint dims,
/**
- * Make a temporary (color) texture image with GLchan components.
+ * Make a temporary (color) texture image with GLubyte components.
* Apply all needed pixel unpacking and pixel transfer operations.
* Note that there are both logicalBaseFormat and textureBaseFormat parameters.
* Suppose the user specifies GL_LUMINANCE as the internal texture format
@@ -551,21 +551,21 @@ make_temp_uint_image(struct gl_context *ctx, GLuint dims,
* \param srcType source image type
* \param srcAddr source image address
* \param srcPacking source image pixel packing
- * \return resulting image with format = textureBaseFormat and type = GLchan.
+ * \return resulting image with format = textureBaseFormat and type = GLubyte.
*/
-GLchan *
-_mesa_make_temp_chan_image(struct gl_context *ctx, GLuint dims,
- GLenum logicalBaseFormat,
- GLenum textureBaseFormat,
- GLint srcWidth, GLint srcHeight, GLint srcDepth,
- GLenum srcFormat, GLenum srcType,
- const GLvoid *srcAddr,
- const struct gl_pixelstore_attrib *srcPacking)
+GLubyte *
+_mesa_make_temp_ubyte_image(struct gl_context *ctx, GLuint dims,
+ GLenum logicalBaseFormat,
+ GLenum textureBaseFormat,
+ GLint srcWidth, GLint srcHeight, GLint srcDepth,
+ GLenum srcFormat, GLenum srcType,
+ const GLvoid *srcAddr,
+ const struct gl_pixelstore_attrib *srcPacking)
{
GLuint transferOps = ctx->_ImageTransferState;
const GLint components = _mesa_components_in_format(logicalBaseFormat);
GLint img, row;
- GLchan *tempImage, *dst;
+ GLubyte *tempImage, *dst;
ASSERT(dims >= 1 && dims <= 3);
@@ -588,8 +588,8 @@ _mesa_make_temp_chan_image(struct gl_context *ctx, GLuint dims,
textureBaseFormat == GL_INTENSITY);
/* unpack and transfer the source image */
- tempImage = (GLchan *) malloc(srcWidth * srcHeight * srcDepth
- * components * sizeof(GLchan));
+ tempImage = (GLubyte *) malloc(srcWidth * srcHeight * srcDepth
+ * components * sizeof(GLubyte));
if (!tempImage) {
return NULL;
}
@@ -604,9 +604,9 @@ _mesa_make_temp_chan_image(struct gl_context *ctx, GLuint dims,
srcFormat, srcType,
img, 0, 0);
for (row = 0; row < srcHeight; row++) {
- _mesa_unpack_color_span_chan(ctx, srcWidth, logicalBaseFormat, dst,
- srcFormat, srcType, src, srcPacking,
- transferOps);
+ _mesa_unpack_color_span_ubyte(ctx, srcWidth, logicalBaseFormat, dst,
+ srcFormat, srcType, src, srcPacking,
+ transferOps);
dst += srcWidth * components;
src += srcStride;
}
@@ -616,7 +616,7 @@ _mesa_make_temp_chan_image(struct gl_context *ctx, GLuint dims,
/* one more conversion step */
GLint texComponents = _mesa_components_in_format(textureBaseFormat);
GLint logComponents = _mesa_components_in_format(logicalBaseFormat);
- GLchan *newImage;
+ GLubyte *newImage;
GLint i, n;
GLubyte map[6];
@@ -629,8 +629,8 @@ _mesa_make_temp_chan_image(struct gl_context *ctx, GLuint dims,
*/
ASSERT(texComponents >= logComponents);
- newImage = (GLchan *) malloc(srcWidth * srcHeight * srcDepth
- * texComponents * sizeof(GLchan));
+ newImage = (GLubyte *) malloc(srcWidth * srcHeight * srcDepth
+ * texComponents * sizeof(GLubyte));
if (!newImage) {
free(tempImage);
return NULL;
@@ -646,7 +646,7 @@ _mesa_make_temp_chan_image(struct gl_context *ctx, GLuint dims,
if (j == ZERO)
newImage[i * texComponents + k] = 0;
else if (j == ONE)
- newImage[i * texComponents + k] = CHAN_MAX;
+ newImage[i * texComponents + k] = 255;
else
newImage[i * texComponents + k] = tempImage[i * logComponents + j];
}
@@ -1235,13 +1235,13 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS)
}
else {
/* general path */
- const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ const GLubyte *tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
baseFormat,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
srcPacking);
- const GLchan *src = tempImage;
+ const GLubyte *src = tempImage;
GLint img, row, col;
if (!tempImage)
return GL_FALSE;
@@ -1255,17 +1255,17 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS)
/* check for byteswapped format */
if (dstFormat == MESA_FORMAT_RGB565) {
for (col = 0; col < srcWidth; col++) {
- dstUS[col] = PACK_COLOR_565( CHAN_TO_UBYTE(src[RCOMP]),
- CHAN_TO_UBYTE(src[GCOMP]),
- CHAN_TO_UBYTE(src[BCOMP]) );
+ dstUS[col] = PACK_COLOR_565( src[RCOMP],
+ src[GCOMP],
+ src[BCOMP] );
src += 3;
}
}
else {
for (col = 0; col < srcWidth; col++) {
- dstUS[col] = PACK_COLOR_565_REV( CHAN_TO_UBYTE(src[RCOMP]),
- CHAN_TO_UBYTE(src[GCOMP]),
- CHAN_TO_UBYTE(src[BCOMP]) );
+ dstUS[col] = PACK_COLOR_565_REV( src[RCOMP],
+ src[GCOMP],
+ src[BCOMP] );
src += 3;
}
}
@@ -1361,13 +1361,13 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS)
}
else {
/* general path */
- const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ const GLubyte *tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
baseFormat,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
srcPacking);
- const GLchan *src = tempImage;
+ const GLubyte *src = tempImage;
GLint img, row, col;
if (!tempImage)
return GL_FALSE;
@@ -1380,19 +1380,19 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS)
GLuint *dstUI = (GLuint *) dstRow;
if (dstFormat == MESA_FORMAT_RGBA8888) {
for (col = 0; col < srcWidth; col++) {
- dstUI[col] = PACK_COLOR_8888( CHAN_TO_UBYTE(src[RCOMP]),
- CHAN_TO_UBYTE(src[GCOMP]),
- CHAN_TO_UBYTE(src[BCOMP]),
- CHAN_TO_UBYTE(src[ACOMP]) );
+ dstUI[col] = PACK_COLOR_8888( src[RCOMP],
+ src[GCOMP],
+ src[BCOMP],
+ src[ACOMP] );
src += 4;
}
}
else {
for (col = 0; col < srcWidth; col++) {
- dstUI[col] = PACK_COLOR_8888_REV( CHAN_TO_UBYTE(src[RCOMP]),
- CHAN_TO_UBYTE(src[GCOMP]),
- CHAN_TO_UBYTE(src[BCOMP]),
- CHAN_TO_UBYTE(src[ACOMP]) );
+ dstUI[col] = PACK_COLOR_8888_REV( src[RCOMP],
+ src[GCOMP],
+ src[BCOMP],
+ src[ACOMP] );
src += 4;
}
}
@@ -1561,13 +1561,13 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
}
else {
/* general path */
- const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ const GLubyte *tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
baseFormat,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
srcPacking);
- const GLchan *src = tempImage;
+ const GLubyte *src = tempImage;
GLint img, row, col;
if (!tempImage)
return GL_FALSE;
@@ -1580,28 +1580,28 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
GLuint *dstUI = (GLuint *) dstRow;
if (dstFormat == MESA_FORMAT_ARGB8888) {
for (col = 0; col < srcWidth; col++) {
- dstUI[col] = PACK_COLOR_8888( CHAN_TO_UBYTE(src[ACOMP]),
- CHAN_TO_UBYTE(src[RCOMP]),
- CHAN_TO_UBYTE(src[GCOMP]),
- CHAN_TO_UBYTE(src[BCOMP]) );
+ dstUI[col] = PACK_COLOR_8888( src[ACOMP],
+ src[RCOMP],
+ src[GCOMP],
+ src[BCOMP] );
src += 4;
}
}
else if (dstFormat == MESA_FORMAT_XRGB8888) {
for (col = 0; col < srcWidth; col++) {
dstUI[col] = PACK_COLOR_8888( 0xff,
- CHAN_TO_UBYTE(src[RCOMP]),
- CHAN_TO_UBYTE(src[GCOMP]),
- CHAN_TO_UBYTE(src[BCOMP]) );
+ src[RCOMP],
+ src[GCOMP],
+ src[BCOMP] );
src += 4;
}
}
else {
for (col = 0; col < srcWidth; col++) {
- dstUI[col] = PACK_COLOR_8888_REV( CHAN_TO_UBYTE(src[ACOMP]),
- CHAN_TO_UBYTE(src[RCOMP]),
- CHAN_TO_UBYTE(src[GCOMP]),
- CHAN_TO_UBYTE(src[BCOMP]) );
+ dstUI[col] = PACK_COLOR_8888_REV( src[ACOMP],
+ src[RCOMP],
+ src[GCOMP],
+ src[BCOMP] );
src += 4;
}
}
@@ -1690,13 +1690,13 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS)
}
else {
/* general path */
- const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ const GLubyte *tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
baseFormat,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
srcPacking);
- const GLchan *src = (const GLchan *) tempImage;
+ const GLubyte *src = (const GLubyte *) tempImage;
GLint img, row, col;
if (!tempImage)
return GL_FALSE;
@@ -1709,9 +1709,9 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS)
#if 0
if (littleEndian) {
for (col = 0; col < srcWidth; col++) {
- dstRow[col * 3 + 0] = CHAN_TO_UBYTE(src[RCOMP]);
- dstRow[col * 3 + 1] = CHAN_TO_UBYTE(src[GCOMP]);
- dstRow[col * 3 + 2] = CHAN_TO_UBYTE(src[BCOMP]);
+ dstRow[col * 3 + 0] = src[RCOMP];
+ dstRow[col * 3 + 1] = src[GCOMP];
+ dstRow[col * 3 + 2] = src[BCOMP];
srcUB += 3;
}
}
@@ -1725,9 +1725,9 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS)
}
#else
for (col = 0; col < srcWidth; col++) {
- dstRow[col * 3 + 0] = CHAN_TO_UBYTE(src[BCOMP]);
- dstRow[col * 3 + 1] = CHAN_TO_UBYTE(src[GCOMP]);
- dstRow[col * 3 + 2] = CHAN_TO_UBYTE(src[RCOMP]);
+ dstRow[col * 3 + 0] = src[BCOMP];
+ dstRow[col * 3 + 1] = src[GCOMP];
+ dstRow[col * 3 + 2] = src[RCOMP];
src += 3;
}
#endif
@@ -1816,13 +1816,13 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS)
}
else {
/* general path */
- const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ const GLubyte *tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
baseFormat,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
srcPacking);
- const GLchan *src = (const GLchan *) tempImage;
+ const GLubyte *src = (const GLubyte *) tempImage;
GLint img, row, col;
if (!tempImage)
return GL_FALSE;
@@ -1833,9 +1833,9 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS)
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
for (col = 0; col < srcWidth; col++) {
- dstRow[col * 3 + 0] = CHAN_TO_UBYTE(src[RCOMP]);
- dstRow[col * 3 + 1] = CHAN_TO_UBYTE(src[GCOMP]);
- dstRow[col * 3 + 2] = CHAN_TO_UBYTE(src[BCOMP]);
+ dstRow[col * 3 + 0] = src[RCOMP];
+ dstRow[col * 3 + 1] = src[GCOMP];
+ dstRow[col * 3 + 2] = src[BCOMP];
src += 3;
}
dstRow += dstRowStride;
@@ -1873,13 +1873,13 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS)
}
else {
/* general path */
- const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ const GLubyte *tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
baseFormat,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
srcPacking);
- const GLchan *src = tempImage;
+ const GLubyte *src = tempImage;
GLint img, row, col;
if (!tempImage)
return GL_FALSE;
@@ -1892,19 +1892,19 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS)
GLushort *dstUS = (GLushort *) dstRow;
if (dstFormat == MESA_FORMAT_ARGB4444) {
for (col = 0; col < srcWidth; col++) {
- dstUS[col] = PACK_COLOR_4444( CHAN_TO_UBYTE(src[ACOMP]),
- CHAN_TO_UBYTE(src[RCOMP]),
- CHAN_TO_UBYTE(src[GCOMP]),
- CHAN_TO_UBYTE(src[BCOMP]) );
+ dstUS[col] = PACK_COLOR_4444( src[ACOMP],
+ src[RCOMP],
+ src[GCOMP],
+ src[BCOMP] );
src += 4;
}
}
else {
for (col = 0; col < srcWidth; col++) {
- dstUS[col] = PACK_COLOR_4444_REV( CHAN_TO_UBYTE(src[ACOMP]),
- CHAN_TO_UBYTE(src[RCOMP]),
- CHAN_TO_UBYTE(src[GCOMP]),
- CHAN_TO_UBYTE(src[BCOMP]) );
+ dstUS[col] = PACK_COLOR_4444_REV( src[ACOMP],
+ src[RCOMP],
+ src[GCOMP],
+ src[BCOMP] );
src += 4;
}
}
@@ -1941,13 +1941,13 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS)
}
else {
/* general path */
- const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ const GLubyte *tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
baseFormat,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
srcPacking);
- const GLchan *src =tempImage;
+ const GLubyte *src =tempImage;
GLint img, row, col;
if (!tempImage)
return GL_FALSE;
@@ -1959,10 +1959,10 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS)
for (row = 0; row < srcHeight; row++) {
GLushort *dstUS = (GLushort *) dstRow;
for (col = 0; col < srcWidth; col++) {
- dstUS[col] = PACK_COLOR_5551( CHAN_TO_UBYTE(src[RCOMP]),
- CHAN_TO_UBYTE(src[GCOMP]),
- CHAN_TO_UBYTE(src[BCOMP]),
- CHAN_TO_UBYTE(src[ACOMP]) );
+ dstUS[col] = PACK_COLOR_5551( src[RCOMP],
+ src[GCOMP],
+ src[BCOMP],
+ src[ACOMP] );
src += 4;
}
dstRow += dstRowStride;
@@ -1999,13 +1999,13 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS)
}
else {
/* general path */
- const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ const GLubyte *tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
baseFormat,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
srcPacking);
- const GLchan *src =tempImage;
+ const GLubyte *src =tempImage;
GLint img, row, col;
if (!tempImage)
return GL_FALSE;
@@ -2018,19 +2018,19 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS)
GLushort *dstUS = (GLushort *) dstRow;
if (dstFormat == MESA_FORMAT_ARGB1555) {
for (col = 0; col < srcWidth; col++) {
- dstUS[col] = PACK_COLOR_1555( CHAN_TO_UBYTE(src[ACOMP]),
- CHAN_TO_UBYTE(src[RCOMP]),
- CHAN_TO_UBYTE(src[GCOMP]),
- CHAN_TO_UBYTE(src[BCOMP]) );
+ dstUS[col] = PACK_COLOR_1555( src[ACOMP],
+ src[RCOMP],
+ src[GCOMP],
+ src[BCOMP] );
src += 4;
}
}
else {
for (col = 0; col < srcWidth; col++) {
- dstUS[col] = PACK_COLOR_1555_REV( CHAN_TO_UBYTE(src[ACOMP]),
- CHAN_TO_UBYTE(src[RCOMP]),
- CHAN_TO_UBYTE(src[GCOMP]),
- CHAN_TO_UBYTE(src[BCOMP]) );
+ dstUS[col] = PACK_COLOR_1555_REV( src[ACOMP],
+ src[RCOMP],
+ src[GCOMP],
+ src[BCOMP] );
src += 4;
}
}
@@ -2137,13 +2137,13 @@ _mesa_texstore_unorm44(TEXSTORE_PARAMS)
{
/* general path */
- const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ const GLubyte *tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
baseFormat,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
srcPacking);
- const GLchan *src = tempImage;
+ const GLubyte *src = tempImage;
GLint img, row, col;
if (!tempImage)
return GL_FALSE;
@@ -2156,8 +2156,8 @@ _mesa_texstore_unorm44(TEXSTORE_PARAMS)
GLubyte *dstUS = (GLubyte *) dstRow;
for (col = 0; col < srcWidth; col++) {
/* src[0] is luminance, src[1] is alpha */
- dstUS[col] = PACK_COLOR_44( CHAN_TO_UBYTE(src[1]),
- CHAN_TO_UBYTE(src[0]) );
+ dstUS[col] = PACK_COLOR_44( src[1],
+ src[0] );
src += 2;
}
dstRow += dstRowStride;
@@ -2248,13 +2248,13 @@ _mesa_texstore_unorm88(TEXSTORE_PARAMS)
}
else {
/* general path */
- const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ const GLubyte *tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
baseFormat,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
srcPacking);
- const GLchan *src = tempImage;
+ const GLubyte *src = tempImage;
GLint img, row, col;
if (!tempImage)
return GL_FALSE;
@@ -2269,16 +2269,16 @@ _mesa_texstore_unorm88(TEXSTORE_PARAMS)
dstFormat == MESA_FORMAT_RG88) {
for (col = 0; col < srcWidth; col++) {
/* src[0] is luminance, src[1] is alpha */
- dstUS[col] = PACK_COLOR_88( CHAN_TO_UBYTE(src[1]),
- CHAN_TO_UBYTE(src[0]) );
+ dstUS[col] = PACK_COLOR_88( src[1],
+ src[0] );
src += 2;
}
}
else {
for (col = 0; col < srcWidth; col++) {
/* src[0] is luminance, src[1] is alpha */
- dstUS[col] = PACK_COLOR_88_REV( CHAN_TO_UBYTE(src[1]),
- CHAN_TO_UBYTE(src[0]) );
+ dstUS[col] = PACK_COLOR_88_REV( src[1],
+ src[0] );
src += 2;
}
}
@@ -2604,13 +2604,13 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS)
}
else {
/* general path */
- const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ const GLubyte *tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
baseFormat,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
srcPacking);
- const GLchan *src = tempImage;
+ const GLubyte *src = tempImage;
GLint img, row, col;
if (!tempImage)
return GL_FALSE;
@@ -2621,9 +2621,9 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS)
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
for (col = 0; col < srcWidth; col++) {
- dstRow[col] = PACK_COLOR_332( CHAN_TO_UBYTE(src[RCOMP]),
- CHAN_TO_UBYTE(src[GCOMP]),
- CHAN_TO_UBYTE(src[BCOMP]) );
+ dstRow[col] = PACK_COLOR_332( src[RCOMP],
+ src[GCOMP],
+ src[BCOMP] );
src += 3;
}
dstRow += dstRowStride;
@@ -2692,13 +2692,13 @@ _mesa_texstore_unorm8(TEXSTORE_PARAMS)
}
else {
/* general path */
- const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ const GLubyte *tempImage = _mesa_make_temp_ubyte_image(ctx, dims,
baseInternalFormat,
baseFormat,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
srcPacking);
- const GLchan *src = tempImage;
+ const GLubyte *src = tempImage;
GLint img, row, col;
if (!tempImage)
return GL_FALSE;
@@ -2709,7 +2709,7 @@ _mesa_texstore_unorm8(TEXSTORE_PARAMS)
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
for (col = 0; col < srcWidth; col++) {
- dstRow[col] = CHAN_TO_UBYTE(src[col]);
+ dstRow[col] = src[col];
}
dstRow += dstRowStride;
src += srcWidth;
diff --git a/mesalib/src/mesa/main/texstore.h b/mesalib/src/mesa/main/texstore.h
index d56318709..24a254ac4 100644
--- a/mesalib/src/mesa/main/texstore.h
+++ b/mesalib/src/mesa/main/texstore.h
@@ -72,8 +72,8 @@ extern GLboolean
_mesa_texstore(TEXSTORE_PARAMS);
-extern GLchan *
-_mesa_make_temp_chan_image(struct gl_context *ctx, GLuint dims,
+extern GLubyte *
+_mesa_make_temp_ubyte_image(struct gl_context *ctx, GLuint dims,
GLenum logicalBaseFormat,
GLenum textureBaseFormat,
GLint srcWidth, GLint srcHeight, GLint srcDepth,
diff --git a/mesalib/src/mesa/math/m_translate.h b/mesalib/src/mesa/math/m_translate.h
index 580410311..bf7485c8c 100644
--- a/mesalib/src/mesa/math/m_translate.h
+++ b/mesalib/src/mesa/math/m_translate.h
@@ -29,7 +29,7 @@
#include "main/compiler.h"
#include "main/glheader.h"
#include "main/mtypes.h" /* hack for GLchan */
-
+#include "swrast/s_chan.h"
/**
* Array translation.
diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c
index 68323a35a..97c1fabd5 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c
@@ -849,6 +849,9 @@ decompress_with_blit(struct gl_context * ctx, GLenum target, GLint level,
pipe->render_condition(pipe, NULL, 0);
}
+ /* Choose the source mipmap level */
+ src_view->u.tex.first_level = src_view->u.tex.last_level = level;
+
/* blit/render/decompress */
util_blit_pixels_tex(st->blit,
src_view, /* pipe_resource (src) */
diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 892169822..f68270d0f 100644
--- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -1528,15 +1528,45 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
st_src_reg temp = get_temp(native_integers ?
glsl_type::get_instance(ir->operands[0]->type->base_type, 4, 1) :
glsl_type::vec4_type);
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
- emit(ir, TGSI_OPCODE_SNE, st_dst_reg(temp), op[0], op[1]);
-
- /* After the dot-product, the value will be an integer on the
- * range [0,4]. Zero becomes 1.0, and positive values become zero.
- */
- emit_dp(ir, result_dst, temp, temp, vector_elements);
- if (result_dst.type == GLSL_TYPE_FLOAT) {
+ if (native_integers) {
+ st_dst_reg temp_dst = st_dst_reg(temp);
+ st_src_reg temp1 = st_src_reg(temp), temp2 = st_src_reg(temp);
+
+ emit(ir, TGSI_OPCODE_SEQ, st_dst_reg(temp), op[0], op[1]);
+
+ /* Emit 1-3 AND operations to combine the SEQ results. */
+ switch (ir->operands[0]->type->vector_elements) {
+ case 2:
+ break;
+ case 3:
+ temp_dst.writemask = WRITEMASK_Y;
+ temp1.swizzle = SWIZZLE_YYYY;
+ temp2.swizzle = SWIZZLE_ZZZZ;
+ emit(ir, TGSI_OPCODE_AND, temp_dst, temp1, temp2);
+ break;
+ case 4:
+ temp_dst.writemask = WRITEMASK_X;
+ temp1.swizzle = SWIZZLE_XXXX;
+ temp2.swizzle = SWIZZLE_YYYY;
+ emit(ir, TGSI_OPCODE_AND, temp_dst, temp1, temp2);
+ temp_dst.writemask = WRITEMASK_Y;
+ temp1.swizzle = SWIZZLE_ZZZZ;
+ temp2.swizzle = SWIZZLE_WWWW;
+ emit(ir, TGSI_OPCODE_AND, temp_dst, temp1, temp2);
+ }
+
+ temp1.swizzle = SWIZZLE_XXXX;
+ temp2.swizzle = SWIZZLE_YYYY;
+ emit(ir, TGSI_OPCODE_AND, result_dst, temp1, temp2);
+ } else {
+ emit(ir, TGSI_OPCODE_SNE, st_dst_reg(temp), op[0], op[1]);
+
+ /* After the dot-product, the value will be an integer on the
+ * range [0,4]. Zero becomes 1.0, and positive values become zero.
+ */
+ emit_dp(ir, result_dst, temp, temp, vector_elements);
+
/* Negating the result of the dot-product gives values on the range
* [-4, 0]. Zero becomes 1.0, and negative values become zero.
* This is achieved using SGE.
@@ -1544,11 +1574,6 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
st_src_reg sge_src = result_src;
sge_src.negate = ~sge_src.negate;
emit(ir, TGSI_OPCODE_SGE, result_dst, sge_src, st_src_reg_for_float(0.0));
- } else {
- /* The TGSI negate flag doesn't work for integers, so use SEQ 0
- * instead.
- */
- emit(ir, TGSI_OPCODE_SEQ, result_dst, result_src, st_src_reg_for_int(0));
}
} else {
emit(ir, TGSI_OPCODE_SEQ, result_dst, op[0], op[1]);
@@ -1561,30 +1586,56 @@ glsl_to_tgsi_visitor::visit(ir_expression *ir)
st_src_reg temp = get_temp(native_integers ?
glsl_type::get_instance(ir->operands[0]->type->base_type, 4, 1) :
glsl_type::vec4_type);
- assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
emit(ir, TGSI_OPCODE_SNE, st_dst_reg(temp), op[0], op[1]);
- /* After the dot-product, the value will be an integer on the
- * range [0,4]. Zero stays zero, and positive values become 1.0.
- */
- glsl_to_tgsi_instruction *const dp =
- emit_dp(ir, result_dst, temp, temp, vector_elements);
- if (this->prog->Target == GL_FRAGMENT_PROGRAM_ARB &&
- result_dst.type == GLSL_TYPE_FLOAT) {
- /* The clamping to [0,1] can be done for free in the fragment
- * shader with a saturate.
- */
- dp->saturate = true;
- } else if (result_dst.type == GLSL_TYPE_FLOAT) {
- /* Negating the result of the dot-product gives values on the range
- * [-4, 0]. Zero stays zero, and negative values become 1.0. This
- * achieved using SLT.
- */
- st_src_reg slt_src = result_src;
- slt_src.negate = ~slt_src.negate;
- emit(ir, TGSI_OPCODE_SLT, result_dst, slt_src, st_src_reg_for_float(0.0));
+ if (native_integers) {
+ st_dst_reg temp_dst = st_dst_reg(temp);
+ st_src_reg temp1 = st_src_reg(temp), temp2 = st_src_reg(temp);
+
+ /* Emit 1-3 OR operations to combine the SNE results. */
+ switch (ir->operands[0]->type->vector_elements) {
+ case 2:
+ break;
+ case 3:
+ temp_dst.writemask = WRITEMASK_Y;
+ temp1.swizzle = SWIZZLE_YYYY;
+ temp2.swizzle = SWIZZLE_ZZZZ;
+ emit(ir, TGSI_OPCODE_OR, temp_dst, temp1, temp2);
+ break;
+ case 4:
+ temp_dst.writemask = WRITEMASK_X;
+ temp1.swizzle = SWIZZLE_XXXX;
+ temp2.swizzle = SWIZZLE_YYYY;
+ emit(ir, TGSI_OPCODE_OR, temp_dst, temp1, temp2);
+ temp_dst.writemask = WRITEMASK_Y;
+ temp1.swizzle = SWIZZLE_ZZZZ;
+ temp2.swizzle = SWIZZLE_WWWW;
+ emit(ir, TGSI_OPCODE_OR, temp_dst, temp1, temp2);
+ }
+
+ temp1.swizzle = SWIZZLE_XXXX;
+ temp2.swizzle = SWIZZLE_YYYY;
+ emit(ir, TGSI_OPCODE_OR, result_dst, temp1, temp2);
} else {
- emit(ir, TGSI_OPCODE_SNE, result_dst, result_src, st_src_reg_for_int(0));
+ /* After the dot-product, the value will be an integer on the
+ * range [0,4]. Zero stays zero, and positive values become 1.0.
+ */
+ glsl_to_tgsi_instruction *const dp =
+ emit_dp(ir, result_dst, temp, temp, vector_elements);
+ if (this->prog->Target == GL_FRAGMENT_PROGRAM_ARB) {
+ /* The clamping to [0,1] can be done for free in the fragment
+ * shader with a saturate.
+ */
+ dp->saturate = true;
+ } else {
+ /* Negating the result of the dot-product gives values on the range
+ * [-4, 0]. Zero stays zero, and negative values become 1.0. This
+ * achieved using SLT.
+ */
+ st_src_reg slt_src = result_src;
+ slt_src.negate = ~slt_src.negate;
+ emit(ir, TGSI_OPCODE_SLT, result_dst, slt_src, st_src_reg_for_float(0.0));
+ }
}
} else {
emit(ir, TGSI_OPCODE_SNE, result_dst, op[0], op[1]);
diff --git a/mesalib/src/mesa/swrast/s_span.h b/mesalib/src/mesa/swrast/s_span.h
index d3cce304f..382c3d2eb 100644
--- a/mesalib/src/mesa/swrast/s_span.h
+++ b/mesalib/src/mesa/swrast/s_span.h
@@ -1,223 +1,225 @@
-/*
- * Mesa 3-D graphics library
- * Version: 7.5
- *
- * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
- * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-
-#ifndef S_SPAN_H
-#define S_SPAN_H
-
-
-#include "main/config.h"
-#include "main/glheader.h"
-#include "main/mtypes.h"
-
-struct gl_context;
-struct gl_renderbuffer;
-
-
-/**
- * \defgroup SpanFlags
- * Special bitflags to describe span data.
- *
- * In general, the point/line/triangle functions interpolate/emit the
- * attributes specified by swrast->_ActiveAttribs (i.e. FRAT_BIT_* values).
- * Some things don't fit into that, though, so we have these flags.
- */
-/*@{*/
-#define SPAN_RGBA 0x01 /**< interpMask and arrayMask */
-#define SPAN_Z 0x02 /**< interpMask and arrayMask */
-#define SPAN_FLAT 0x04 /**< interpMask: flat shading? */
-#define SPAN_XY 0x08 /**< array.x[], y[] valid? */
-#define SPAN_MASK 0x10 /**< was array.mask[] filled in by caller? */
-#define SPAN_LAMBDA 0x20 /**< array.lambda[] valid? */
-#define SPAN_COVERAGE 0x40 /**< array.coverage[] valid? */
-/*@}*/
-
-
-/**
- * \sw_span_arrays
- * \brief Arrays of fragment values.
- *
- * These will either be computed from the span x/xStep values or
- * filled in by glDraw/CopyPixels, etc.
- * These arrays are separated out of sw_span to conserve memory.
- */
-typedef struct sw_span_arrays
-{
- /** Per-fragment attributes (indexed by FRAG_ATTRIB_* tokens) */
- /* XXX someday look at transposing first two indexes for better memory
- * access pattern.
- */
- GLfloat attribs[FRAG_ATTRIB_MAX][MAX_WIDTH][4];
-
- /** This mask indicates which fragments are alive or culled */
- GLubyte mask[MAX_WIDTH];
-
- GLenum ChanType; /**< Color channel type, GL_UNSIGNED_BYTE, GL_FLOAT */
-
- /** Attribute arrays that don't fit into attribs[] array above */
- /*@{*/
- GLubyte rgba8[MAX_WIDTH][4];
- GLushort rgba16[MAX_WIDTH][4];
- GLchan (*rgba)[4]; /** either == rgba8 or rgba16 */
- GLint x[MAX_WIDTH]; /**< fragment X coords */
- GLint y[MAX_WIDTH]; /**< fragment Y coords */
- GLuint z[MAX_WIDTH]; /**< fragment Z coords */
- GLuint index[MAX_WIDTH]; /**< Color indexes */
- GLfloat lambda[MAX_TEXTURE_COORD_UNITS][MAX_WIDTH]; /**< Texture LOD */
- GLfloat coverage[MAX_WIDTH]; /**< Fragment coverage for AA/smoothing */
- /*@}*/
-} SWspanarrays;
-
-
-/**
- * The SWspan structure describes the colors, Z, fogcoord, texcoords,
- * etc for either a horizontal run or an array of independent pixels.
- * We can either specify a base/step to indicate interpolated values, or
- * fill in explicit arrays of values. The interpMask and arrayMask bitfields
- * indicate which attributes are active interpolants or arrays, respectively.
- *
- * It would be interesting to experiment with multiprocessor rasterization
- * with this structure. The triangle rasterizer could simply emit a
- * stream of these structures which would be consumed by one or more
- * span-processing threads which could run in parallel.
- */
-typedef struct sw_span
-{
- /** Coord of first fragment in horizontal span/run */
- GLint x, y;
-
- /** Number of fragments in the span */
- GLuint end;
-
- /** for clipping left edge of spans */
- GLuint leftClip;
-
- /** This flag indicates that mask[] array is effectively filled with ones */
- GLboolean writeAll;
-
- /** either GL_POLYGON, GL_LINE, GL_POLYGON, GL_BITMAP */
- GLenum primitive;
-
- /** 0 = front-facing span, 1 = back-facing span (for two-sided stencil) */
- GLuint facing;
-
- /**
- * This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates
- * which of the attrStart/StepX/StepY variables are relevant.
- */
- GLbitfield interpMask;
-
- /** Fragment attribute interpolants */
- GLfloat attrStart[FRAG_ATTRIB_MAX][4]; /**< initial value */
- GLfloat attrStepX[FRAG_ATTRIB_MAX][4]; /**< dvalue/dx */
- GLfloat attrStepY[FRAG_ATTRIB_MAX][4]; /**< dvalue/dy */
-
- /* XXX the rest of these will go away eventually... */
-
- /* For horizontal spans, step is the partial derivative wrt X.
- * For lines, step is the delta from one fragment to the next.
- */
- GLfixed red, redStep;
- GLfixed green, greenStep;
- GLfixed blue, blueStep;
- GLfixed alpha, alphaStep;
- GLfixed index, indexStep;
- GLfixed z, zStep; /**< XXX z should probably be GLuint */
- GLfixed intTex[2], intTexStep[2]; /**< (s,t) for unit[0] only */
-
- /**
- * This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates
- * which of the fragment arrays in the span_arrays struct are relevant.
- */
- GLbitfield arrayMask;
-
- GLbitfield arrayAttribs;
-
- /**
- * We store the arrays of fragment values in a separate struct so
- * that we can allocate sw_span structs on the stack without using
- * a lot of memory. The span_arrays struct is about 1.4MB while the
- * sw_span struct is only about 512 bytes.
- */
- SWspanarrays *array;
-} SWspan;
-
-
-
-#define INIT_SPAN(S, PRIMITIVE) \
-do { \
- (S).primitive = (PRIMITIVE); \
- (S).interpMask = 0x0; \
- (S).arrayMask = 0x0; \
- (S).arrayAttribs = 0x0; \
- (S).end = 0; \
- (S).leftClip = 0; \
- (S).facing = 0; \
- (S).array = SWRAST_CONTEXT(ctx)->SpanArrays; \
-} while (0)
-
-
-
-extern void
-_swrast_span_default_attribs(struct gl_context *ctx, SWspan *span);
-
-extern void
-_swrast_span_interpolate_z( const struct gl_context *ctx, SWspan *span );
-
-extern GLfloat
-_swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy,
- GLfloat dqdx, GLfloat dqdy, GLfloat texW, GLfloat texH,
- GLfloat s, GLfloat t, GLfloat q, GLfloat invQ);
-
-
-extern void
-_swrast_write_rgba_span( struct gl_context *ctx, SWspan *span);
-
-
-extern void
-_swrast_read_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint n, GLint x, GLint y, GLenum type, GLvoid *rgba);
-
-extern void
-_swrast_get_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, const GLint x[], const GLint y[],
- void *values, GLuint valueSize);
-
-extern void
-_swrast_put_row(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, GLint x, GLint y,
- const GLvoid *values, GLuint valueSize);
-
-extern void
-_swrast_get_row(struct gl_context *ctx, struct gl_renderbuffer *rb,
- GLuint count, GLint x, GLint y,
- GLvoid *values, GLuint valueSize);
-
-
-extern void *
-_swrast_get_dest_rgba(struct gl_context *ctx, struct gl_renderbuffer *rb,
- SWspan *span);
-
-#endif
+/*
+ * Mesa 3-D graphics library
+ * Version: 7.5
+ *
+ * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
+ * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+
+#ifndef S_SPAN_H
+#define S_SPAN_H
+
+
+#include "main/config.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "swrast/s_chan.h"
+
+
+struct gl_context;
+struct gl_renderbuffer;
+
+
+/**
+ * \defgroup SpanFlags
+ * Special bitflags to describe span data.
+ *
+ * In general, the point/line/triangle functions interpolate/emit the
+ * attributes specified by swrast->_ActiveAttribs (i.e. FRAT_BIT_* values).
+ * Some things don't fit into that, though, so we have these flags.
+ */
+/*@{*/
+#define SPAN_RGBA 0x01 /**< interpMask and arrayMask */
+#define SPAN_Z 0x02 /**< interpMask and arrayMask */
+#define SPAN_FLAT 0x04 /**< interpMask: flat shading? */
+#define SPAN_XY 0x08 /**< array.x[], y[] valid? */
+#define SPAN_MASK 0x10 /**< was array.mask[] filled in by caller? */
+#define SPAN_LAMBDA 0x20 /**< array.lambda[] valid? */
+#define SPAN_COVERAGE 0x40 /**< array.coverage[] valid? */
+/*@}*/
+
+
+/**
+ * \sw_span_arrays
+ * \brief Arrays of fragment values.
+ *
+ * These will either be computed from the span x/xStep values or
+ * filled in by glDraw/CopyPixels, etc.
+ * These arrays are separated out of sw_span to conserve memory.
+ */
+typedef struct sw_span_arrays
+{
+ /** Per-fragment attributes (indexed by FRAG_ATTRIB_* tokens) */
+ /* XXX someday look at transposing first two indexes for better memory
+ * access pattern.
+ */
+ GLfloat attribs[FRAG_ATTRIB_MAX][MAX_WIDTH][4];
+
+ /** This mask indicates which fragments are alive or culled */
+ GLubyte mask[MAX_WIDTH];
+
+ GLenum ChanType; /**< Color channel type, GL_UNSIGNED_BYTE, GL_FLOAT */
+
+ /** Attribute arrays that don't fit into attribs[] array above */
+ /*@{*/
+ GLubyte rgba8[MAX_WIDTH][4];
+ GLushort rgba16[MAX_WIDTH][4];
+ GLchan (*rgba)[4]; /** either == rgba8 or rgba16 */
+ GLint x[MAX_WIDTH]; /**< fragment X coords */
+ GLint y[MAX_WIDTH]; /**< fragment Y coords */
+ GLuint z[MAX_WIDTH]; /**< fragment Z coords */
+ GLuint index[MAX_WIDTH]; /**< Color indexes */
+ GLfloat lambda[MAX_TEXTURE_COORD_UNITS][MAX_WIDTH]; /**< Texture LOD */
+ GLfloat coverage[MAX_WIDTH]; /**< Fragment coverage for AA/smoothing */
+ /*@}*/
+} SWspanarrays;
+
+
+/**
+ * The SWspan structure describes the colors, Z, fogcoord, texcoords,
+ * etc for either a horizontal run or an array of independent pixels.
+ * We can either specify a base/step to indicate interpolated values, or
+ * fill in explicit arrays of values. The interpMask and arrayMask bitfields
+ * indicate which attributes are active interpolants or arrays, respectively.
+ *
+ * It would be interesting to experiment with multiprocessor rasterization
+ * with this structure. The triangle rasterizer could simply emit a
+ * stream of these structures which would be consumed by one or more
+ * span-processing threads which could run in parallel.
+ */
+typedef struct sw_span
+{
+ /** Coord of first fragment in horizontal span/run */
+ GLint x, y;
+
+ /** Number of fragments in the span */
+ GLuint end;
+
+ /** for clipping left edge of spans */
+ GLuint leftClip;
+
+ /** This flag indicates that mask[] array is effectively filled with ones */
+ GLboolean writeAll;
+
+ /** either GL_POLYGON, GL_LINE, GL_POLYGON, GL_BITMAP */
+ GLenum primitive;
+
+ /** 0 = front-facing span, 1 = back-facing span (for two-sided stencil) */
+ GLuint facing;
+
+ /**
+ * This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates
+ * which of the attrStart/StepX/StepY variables are relevant.
+ */
+ GLbitfield interpMask;
+
+ /** Fragment attribute interpolants */
+ GLfloat attrStart[FRAG_ATTRIB_MAX][4]; /**< initial value */
+ GLfloat attrStepX[FRAG_ATTRIB_MAX][4]; /**< dvalue/dx */
+ GLfloat attrStepY[FRAG_ATTRIB_MAX][4]; /**< dvalue/dy */
+
+ /* XXX the rest of these will go away eventually... */
+
+ /* For horizontal spans, step is the partial derivative wrt X.
+ * For lines, step is the delta from one fragment to the next.
+ */
+ GLfixed red, redStep;
+ GLfixed green, greenStep;
+ GLfixed blue, blueStep;
+ GLfixed alpha, alphaStep;
+ GLfixed index, indexStep;
+ GLfixed z, zStep; /**< XXX z should probably be GLuint */
+ GLfixed intTex[2], intTexStep[2]; /**< (s,t) for unit[0] only */
+
+ /**
+ * This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates
+ * which of the fragment arrays in the span_arrays struct are relevant.
+ */
+ GLbitfield arrayMask;
+
+ GLbitfield arrayAttribs;
+
+ /**
+ * We store the arrays of fragment values in a separate struct so
+ * that we can allocate sw_span structs on the stack without using
+ * a lot of memory. The span_arrays struct is about 1.4MB while the
+ * sw_span struct is only about 512 bytes.
+ */
+ SWspanarrays *array;
+} SWspan;
+
+
+
+#define INIT_SPAN(S, PRIMITIVE) \
+do { \
+ (S).primitive = (PRIMITIVE); \
+ (S).interpMask = 0x0; \
+ (S).arrayMask = 0x0; \
+ (S).arrayAttribs = 0x0; \
+ (S).end = 0; \
+ (S).leftClip = 0; \
+ (S).facing = 0; \
+ (S).array = SWRAST_CONTEXT(ctx)->SpanArrays; \
+} while (0)
+
+
+
+extern void
+_swrast_span_default_attribs(struct gl_context *ctx, SWspan *span);
+
+extern void
+_swrast_span_interpolate_z( const struct gl_context *ctx, SWspan *span );
+
+extern GLfloat
+_swrast_compute_lambda(GLfloat dsdx, GLfloat dsdy, GLfloat dtdx, GLfloat dtdy,
+ GLfloat dqdx, GLfloat dqdy, GLfloat texW, GLfloat texH,
+ GLfloat s, GLfloat t, GLfloat q, GLfloat invQ);
+
+
+extern void
+_swrast_write_rgba_span( struct gl_context *ctx, SWspan *span);
+
+
+extern void
+_swrast_read_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint n, GLint x, GLint y, GLenum type, GLvoid *rgba);
+
+extern void
+_swrast_get_values(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, const GLint x[], const GLint y[],
+ void *values, GLuint valueSize);
+
+extern void
+_swrast_put_row(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, GLint x, GLint y,
+ const GLvoid *values, GLuint valueSize);
+
+extern void
+_swrast_get_row(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ GLuint count, GLint x, GLint y,
+ GLvoid *values, GLuint valueSize);
+
+
+extern void *
+_swrast_get_dest_rgba(struct gl_context *ctx, struct gl_renderbuffer *rb,
+ SWspan *span);
+
+#endif
diff --git a/mesalib/src/mesa/swrast/s_texfetch_tmp.h b/mesalib/src/mesa/swrast/s_texfetch_tmp.h
index 3eebd13d7..c63b2043c 100644
--- a/mesalib/src/mesa/swrast/s_texfetch_tmp.h
+++ b/mesalib/src/mesa/swrast/s_texfetch_tmp.h
@@ -976,7 +976,7 @@ static void FETCH(f_rg88)( const struct swrast_texture_image *texImage,
static void store_texel_rg88(struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, const void *texel)
{
- const GLchan *rgba = (const GLubyte *) texel;
+ const GLchan *rgba = (const GLchan *) texel;
GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
GLubyte r = CHAN_TO_UBYTE(rgba[RCOMP]);
GLubyte g = CHAN_TO_UBYTE(rgba[GCOMP]);
diff --git a/mesalib/src/mesa/swrast/swrast.h b/mesalib/src/mesa/swrast/swrast.h
index 390b42264..06cc65158 100644
--- a/mesalib/src/mesa/swrast/swrast.h
+++ b/mesalib/src/mesa/swrast/swrast.h
@@ -33,6 +33,7 @@
#define SWRAST_H
#include "main/mtypes.h"
+#include "swrast/s_chan.h"
/**
* \struct SWvertex
diff --git a/mesalib/src/mesa/tnl/t_vertex.c b/mesalib/src/mesa/tnl/t_vertex.c
index 0ca324402..6582949a0 100644
--- a/mesalib/src/mesa/tnl/t_vertex.c
+++ b/mesalib/src/mesa/tnl/t_vertex.c
@@ -1,564 +1,564 @@
-/*
- * Copyright 2003 Tungsten Graphics, inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keithw@tungstengraphics.com>
- */
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/colormac.h"
-
-#include "t_context.h"
-#include "t_vertex.h"
-
-#define DBG 0
-
-/* Build and manage clipspace/ndc/window vertices.
- */
-
-static GLboolean match_fastpath( struct tnl_clipspace *vtx,
- const struct tnl_clipspace_fastpath *fp)
-{
- GLuint j;
-
- if (vtx->attr_count != fp->attr_count)
- return GL_FALSE;
-
- for (j = 0; j < vtx->attr_count; j++)
- if (vtx->attr[j].format != fp->attr[j].format ||
- vtx->attr[j].inputsize != fp->attr[j].size ||
- vtx->attr[j].vertoffset != fp->attr[j].offset)
- return GL_FALSE;
-
- if (fp->match_strides) {
- if (vtx->vertex_size != fp->vertex_size)
- return GL_FALSE;
-
- for (j = 0; j < vtx->attr_count; j++)
- if (vtx->attr[j].inputstride != fp->attr[j].stride)
- return GL_FALSE;
- }
-
- return GL_TRUE;
-}
-
-static GLboolean search_fastpath_emit( struct tnl_clipspace *vtx )
-{
- struct tnl_clipspace_fastpath *fp = vtx->fastpath;
-
- for ( ; fp ; fp = fp->next) {
- if (match_fastpath(vtx, fp)) {
- vtx->emit = fp->func;
- return GL_TRUE;
- }
- }
-
- return GL_FALSE;
-}
-
-void _tnl_register_fastpath( struct tnl_clipspace *vtx,
- GLboolean match_strides )
-{
- struct tnl_clipspace_fastpath *fastpath = CALLOC_STRUCT(tnl_clipspace_fastpath);
- GLuint i;
-
- fastpath->vertex_size = vtx->vertex_size;
- fastpath->attr_count = vtx->attr_count;
- fastpath->match_strides = match_strides;
- fastpath->func = vtx->emit;
- fastpath->attr = (struct tnl_attr_type *)
- malloc(vtx->attr_count * sizeof(fastpath->attr[0]));
-
- for (i = 0; i < vtx->attr_count; i++) {
- fastpath->attr[i].format = vtx->attr[i].format;
- fastpath->attr[i].stride = vtx->attr[i].inputstride;
- fastpath->attr[i].size = vtx->attr[i].inputsize;
- fastpath->attr[i].offset = vtx->attr[i].vertoffset;
- }
-
- fastpath->next = vtx->fastpath;
- vtx->fastpath = fastpath;
-}
-
-
-
-/***********************************************************************
- * Build codegen functions or return generic ones:
- */
-static void choose_emit_func( struct gl_context *ctx, GLuint count, GLubyte *dest)
-{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- struct tnl_clipspace_attr *a = vtx->attr;
- const GLuint attr_count = vtx->attr_count;
- GLuint j;
-
- for (j = 0; j < attr_count; j++) {
- GLvector4f *vptr = VB->AttribPtr[a[j].attrib];
- a[j].inputstride = vptr->stride;
- a[j].inputsize = vptr->size;
- a[j].emit = a[j].insert[vptr->size - 1]; /* not always used */
- }
-
- vtx->emit = NULL;
-
- /* Does this match an existing (hardwired, codegen or known-bad)
- * fastpath?
- */
- if (search_fastpath_emit(vtx)) {
- /* Use this result. If it is null, then it is already known
- * that the current state will fail for codegen and there is no
- * point trying again.
- */
- }
- else if (vtx->codegen_emit) {
- vtx->codegen_emit(ctx);
- }
-
- if (!vtx->emit) {
- _tnl_generate_hardwired_emit(ctx);
- }
-
- /* Otherwise use the generic version:
- */
- if (!vtx->emit)
- vtx->emit = _tnl_generic_emit;
-
- vtx->emit( ctx, count, dest );
-}
-
-
-
-static void choose_interp_func( struct gl_context *ctx,
- GLfloat t,
- GLuint edst, GLuint eout, GLuint ein,
- GLboolean force_boundary )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
-
- if (vtx->need_extras &&
- (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
- vtx->interp = _tnl_generic_interp_extras;
- } else {
- vtx->interp = _tnl_generic_interp;
- }
-
- vtx->interp( ctx, t, edst, eout, ein, force_boundary );
-}
-
-
-static void choose_copy_pv_func( struct gl_context *ctx, GLuint edst, GLuint esrc )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
-
- if (vtx->need_extras &&
- (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
- vtx->copy_pv = _tnl_generic_copy_pv_extras;
- } else {
- vtx->copy_pv = _tnl_generic_copy_pv;
- }
-
- vtx->copy_pv( ctx, edst, esrc );
-}
-
-
-/***********************************************************************
- * Public entrypoints, mostly dispatch to the above:
- */
-
-
-/* Interpolate between two vertices to produce a third:
- */
-void _tnl_interp( struct gl_context *ctx,
- GLfloat t,
- GLuint edst, GLuint eout, GLuint ein,
- GLboolean force_boundary )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- vtx->interp( ctx, t, edst, eout, ein, force_boundary );
-}
-
-/* Copy colors from one vertex to another:
- */
-void _tnl_copy_pv( struct gl_context *ctx, GLuint edst, GLuint esrc )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- vtx->copy_pv( ctx, edst, esrc );
-}
-
-
-/* Extract a named attribute from a hardware vertex. Will have to
- * reverse any viewport transformation, swizzling or other conversions
- * which may have been applied:
- */
-void _tnl_get_attr( struct gl_context *ctx, const void *vin,
- GLenum attr, GLfloat *dest )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- const struct tnl_clipspace_attr *a = vtx->attr;
- const GLuint attr_count = vtx->attr_count;
- GLuint j;
-
- for (j = 0; j < attr_count; j++) {
- if (a[j].attrib == attr) {
- a[j].extract( &a[j], dest, (GLubyte *)vin + a[j].vertoffset );
- return;
- }
- }
-
- /* Else return the value from ctx->Current.
- */
- if (attr == _TNL_ATTRIB_POINTSIZE) {
- /* If the hardware vertex doesn't have point size then use size from
- * struct gl_context. XXX this will be wrong if drawing attenuated points!
- */
- dest[0] = ctx->Point.Size;
- }
- else {
- memcpy( dest, ctx->Current.Attrib[attr], 4*sizeof(GLfloat));
- }
-}
-
-
-/* Complementary operation to the above.
- */
-void _tnl_set_attr( struct gl_context *ctx, void *vout,
- GLenum attr, const GLfloat *src )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- const struct tnl_clipspace_attr *a = vtx->attr;
- const GLuint attr_count = vtx->attr_count;
- GLuint j;
-
- for (j = 0; j < attr_count; j++) {
- if (a[j].attrib == attr) {
- a[j].insert[4-1]( &a[j], (GLubyte *)vout + a[j].vertoffset, src );
- return;
- }
- }
-}
-
-
-void *_tnl_get_vertex( struct gl_context *ctx, GLuint nr )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
-
- return vtx->vertex_buf + nr * vtx->vertex_size;
-}
-
-void _tnl_invalidate_vertex_state( struct gl_context *ctx, GLuint new_state )
-{
- if (new_state & (_DD_NEW_TRI_LIGHT_TWOSIDE|_DD_NEW_TRI_UNFILLED) ) {
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- vtx->new_inputs = ~0;
- vtx->interp = choose_interp_func;
- vtx->copy_pv = choose_copy_pv_func;
- }
-}
-
-static void invalidate_funcs( struct tnl_clipspace *vtx )
-{
- vtx->emit = choose_emit_func;
- vtx->interp = choose_interp_func;
- vtx->copy_pv = choose_copy_pv_func;
- vtx->new_inputs = ~0;
-}
-
-GLuint _tnl_install_attrs( struct gl_context *ctx, const struct tnl_attr_map *map,
- GLuint nr, const GLfloat *vp,
- GLuint unpacked_size )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- GLuint offset = 0;
- GLuint i, j;
-
- assert(nr < _TNL_ATTRIB_MAX);
- assert(nr == 0 || map[0].attrib == VERT_ATTRIB_POS);
-
- vtx->new_inputs = ~0;
- vtx->need_viewport = GL_FALSE;
-
- if (vp) {
- vtx->need_viewport = GL_TRUE;
- }
-
- for (j = 0, i = 0; i < nr; i++) {
- const GLuint format = map[i].format;
- if (format == EMIT_PAD) {
- if (DBG)
- printf("%d: pad %d, offset %d\n", i,
- map[i].offset, offset);
-
- offset += map[i].offset;
-
- }
- else {
- GLuint tmpoffset;
-
- if (unpacked_size)
- tmpoffset = map[i].offset;
- else
- tmpoffset = offset;
-
- if (vtx->attr_count != j ||
- vtx->attr[j].attrib != map[i].attrib ||
- vtx->attr[j].format != format ||
- vtx->attr[j].vertoffset != tmpoffset) {
- invalidate_funcs(vtx);
-
- vtx->attr[j].attrib = map[i].attrib;
- vtx->attr[j].format = format;
- vtx->attr[j].vp = vp;
- vtx->attr[j].insert = _tnl_format_info[format].insert;
- vtx->attr[j].extract = _tnl_format_info[format].extract;
- vtx->attr[j].vertattrsize = _tnl_format_info[format].attrsize;
- vtx->attr[j].vertoffset = tmpoffset;
- }
-
-
- if (DBG)
- printf("%d: %s, vp %p, offset %d\n", i,
- _tnl_format_info[format].name, (void *)vp,
- vtx->attr[j].vertoffset);
-
- offset += _tnl_format_info[format].attrsize;
- j++;
- }
- }
-
- vtx->attr_count = j;
-
- if (unpacked_size)
- vtx->vertex_size = unpacked_size;
- else
- vtx->vertex_size = offset;
-
- assert(vtx->vertex_size <= vtx->max_vertex_size);
- return vtx->vertex_size;
-}
-
-
-
-void _tnl_invalidate_vertices( struct gl_context *ctx, GLuint newinputs )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- vtx->new_inputs |= newinputs;
-}
-
-
-/* This event has broader use beyond this file - will move elsewhere
- * and probably invoke a driver callback.
- */
-void _tnl_notify_pipeline_output_change( struct gl_context *ctx )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- invalidate_funcs(vtx);
-}
-
-
-static void adjust_input_ptrs( struct gl_context *ctx, GLint diff)
-{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- struct tnl_clipspace_attr *a = vtx->attr;
- const GLuint count = vtx->attr_count;
- GLuint j;
-
- diff -= 1;
- for (j=0; j<count; ++j) {
- register GLvector4f *vptr = VB->AttribPtr[a->attrib];
- (a++)->inputptr += diff*vptr->stride;
- }
-}
-
-static void update_input_ptrs( struct gl_context *ctx, GLuint start )
-{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- struct tnl_clipspace_attr *a = vtx->attr;
- const GLuint count = vtx->attr_count;
- GLuint j;
-
- for (j = 0; j < count; j++) {
- GLvector4f *vptr = VB->AttribPtr[a[j].attrib];
-
- if (vtx->emit != choose_emit_func) {
- assert(a[j].inputstride == vptr->stride);
- assert(a[j].inputsize == vptr->size);
- }
-
- a[j].inputptr = ((GLubyte *)vptr->data) + start * vptr->stride;
- }
-
- if (a->vp) {
- vtx->vp_scale[0] = a->vp[MAT_SX];
- vtx->vp_scale[1] = a->vp[MAT_SY];
- vtx->vp_scale[2] = a->vp[MAT_SZ];
- vtx->vp_scale[3] = 1.0;
- vtx->vp_xlate[0] = a->vp[MAT_TX];
- vtx->vp_xlate[1] = a->vp[MAT_TY];
- vtx->vp_xlate[2] = a->vp[MAT_TZ];
- vtx->vp_xlate[3] = 0.0;
- }
-}
-
-
-void _tnl_build_vertices( struct gl_context *ctx,
- GLuint start,
- GLuint end,
- GLuint newinputs )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- update_input_ptrs( ctx, start );
- vtx->emit( ctx, end - start,
- (GLubyte *)(vtx->vertex_buf +
- start * vtx->vertex_size));
-}
-
-/* Emit VB vertices start..end to dest. Note that VB vertex at
- * postion start will be emitted to dest at position zero.
- */
-void *_tnl_emit_vertices_to_buffer( struct gl_context *ctx,
- GLuint start,
- GLuint end,
- void *dest )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
-
- update_input_ptrs(ctx, start);
- /* Note: dest should not be adjusted for non-zero 'start' values:
- */
- vtx->emit( ctx, end - start, (GLubyte*) dest );
- return (void *)((GLubyte *)dest + vtx->vertex_size * (end - start));
-}
-
-/* Emit indexed VB vertices start..end to dest. Note that VB vertex at
- * postion start will be emitted to dest at position zero.
- */
-
-void *_tnl_emit_indexed_vertices_to_buffer( struct gl_context *ctx,
- const GLuint *elts,
- GLuint start,
- GLuint end,
- void *dest )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- GLuint oldIndex;
- GLubyte *cdest = dest;
-
- update_input_ptrs(ctx, oldIndex = elts[start++]);
- vtx->emit( ctx, 1, cdest );
- cdest += vtx->vertex_size;
-
- for (; start < end; ++start) {
- adjust_input_ptrs(ctx, elts[start] - oldIndex);
- oldIndex = elts[start];
- vtx->emit( ctx, 1, cdest);
- cdest += vtx->vertex_size;
- }
-
- return (void *) cdest;
-}
-
-
-void _tnl_init_vertices( struct gl_context *ctx,
- GLuint vb_size,
- GLuint max_vertex_size )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
-
- _tnl_install_attrs( ctx, NULL, 0, NULL, 0 );
-
- vtx->need_extras = GL_TRUE;
- if (max_vertex_size > vtx->max_vertex_size) {
- _tnl_free_vertices( ctx );
- vtx->max_vertex_size = max_vertex_size;
- vtx->vertex_buf = (GLubyte *)_mesa_align_calloc(vb_size * max_vertex_size, 32 );
- invalidate_funcs(vtx);
- }
-
- switch(CHAN_TYPE) {
- case GL_UNSIGNED_BYTE:
- vtx->chan_scale[0] = 255.0;
- vtx->chan_scale[1] = 255.0;
- vtx->chan_scale[2] = 255.0;
- vtx->chan_scale[3] = 255.0;
- break;
- case GL_UNSIGNED_SHORT:
- vtx->chan_scale[0] = 65535.0;
- vtx->chan_scale[1] = 65535.0;
- vtx->chan_scale[2] = 65535.0;
- vtx->chan_scale[3] = 65535.0;
- break;
- default:
- vtx->chan_scale[0] = 1.0;
- vtx->chan_scale[1] = 1.0;
- vtx->chan_scale[2] = 1.0;
- vtx->chan_scale[3] = 1.0;
- break;
- }
-
- vtx->identity[0] = 0.0;
- vtx->identity[1] = 0.0;
- vtx->identity[2] = 0.0;
- vtx->identity[3] = 1.0;
-
- vtx->codegen_emit = NULL;
-
-#ifdef USE_SSE_ASM
- if (!_mesa_getenv("MESA_NO_CODEGEN"))
- vtx->codegen_emit = _tnl_generate_sse_emit;
-#endif
-}
-
-
-void _tnl_free_vertices( struct gl_context *ctx )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- if (tnl) {
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- struct tnl_clipspace_fastpath *fp, *tmp;
-
- if (vtx->vertex_buf) {
- _mesa_align_free(vtx->vertex_buf);
- vtx->vertex_buf = NULL;
- }
-
- for (fp = vtx->fastpath ; fp ; fp = tmp) {
- tmp = fp->next;
- FREE(fp->attr);
-
- /* KW: At the moment, fp->func is constrained to be allocated by
- * _mesa_exec_alloc(), as the hardwired fastpaths in
- * t_vertex_generic.c are handled specially. It would be nice
- * to unify them, but this probably won't change until this
- * module gets another overhaul.
- */
- _mesa_exec_free((void *) fp->func);
- FREE(fp);
- }
-
- vtx->fastpath = NULL;
- }
-}
+/*
+ * Copyright 2003 Tungsten Graphics, inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Whitwell <keithw@tungstengraphics.com>
+ */
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "swrast/s_chan.h"
+#include "t_context.h"
+#include "t_vertex.h"
+
+#define DBG 0
+
+/* Build and manage clipspace/ndc/window vertices.
+ */
+
+static GLboolean match_fastpath( struct tnl_clipspace *vtx,
+ const struct tnl_clipspace_fastpath *fp)
+{
+ GLuint j;
+
+ if (vtx->attr_count != fp->attr_count)
+ return GL_FALSE;
+
+ for (j = 0; j < vtx->attr_count; j++)
+ if (vtx->attr[j].format != fp->attr[j].format ||
+ vtx->attr[j].inputsize != fp->attr[j].size ||
+ vtx->attr[j].vertoffset != fp->attr[j].offset)
+ return GL_FALSE;
+
+ if (fp->match_strides) {
+ if (vtx->vertex_size != fp->vertex_size)
+ return GL_FALSE;
+
+ for (j = 0; j < vtx->attr_count; j++)
+ if (vtx->attr[j].inputstride != fp->attr[j].stride)
+ return GL_FALSE;
+ }
+
+ return GL_TRUE;
+}
+
+static GLboolean search_fastpath_emit( struct tnl_clipspace *vtx )
+{
+ struct tnl_clipspace_fastpath *fp = vtx->fastpath;
+
+ for ( ; fp ; fp = fp->next) {
+ if (match_fastpath(vtx, fp)) {
+ vtx->emit = fp->func;
+ return GL_TRUE;
+ }
+ }
+
+ return GL_FALSE;
+}
+
+void _tnl_register_fastpath( struct tnl_clipspace *vtx,
+ GLboolean match_strides )
+{
+ struct tnl_clipspace_fastpath *fastpath = CALLOC_STRUCT(tnl_clipspace_fastpath);
+ GLuint i;
+
+ fastpath->vertex_size = vtx->vertex_size;
+ fastpath->attr_count = vtx->attr_count;
+ fastpath->match_strides = match_strides;
+ fastpath->func = vtx->emit;
+ fastpath->attr = (struct tnl_attr_type *)
+ malloc(vtx->attr_count * sizeof(fastpath->attr[0]));
+
+ for (i = 0; i < vtx->attr_count; i++) {
+ fastpath->attr[i].format = vtx->attr[i].format;
+ fastpath->attr[i].stride = vtx->attr[i].inputstride;
+ fastpath->attr[i].size = vtx->attr[i].inputsize;
+ fastpath->attr[i].offset = vtx->attr[i].vertoffset;
+ }
+
+ fastpath->next = vtx->fastpath;
+ vtx->fastpath = fastpath;
+}
+
+
+
+/***********************************************************************
+ * Build codegen functions or return generic ones:
+ */
+static void choose_emit_func( struct gl_context *ctx, GLuint count, GLubyte *dest)
+{
+ struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ struct tnl_clipspace_attr *a = vtx->attr;
+ const GLuint attr_count = vtx->attr_count;
+ GLuint j;
+
+ for (j = 0; j < attr_count; j++) {
+ GLvector4f *vptr = VB->AttribPtr[a[j].attrib];
+ a[j].inputstride = vptr->stride;
+ a[j].inputsize = vptr->size;
+ a[j].emit = a[j].insert[vptr->size - 1]; /* not always used */
+ }
+
+ vtx->emit = NULL;
+
+ /* Does this match an existing (hardwired, codegen or known-bad)
+ * fastpath?
+ */
+ if (search_fastpath_emit(vtx)) {
+ /* Use this result. If it is null, then it is already known
+ * that the current state will fail for codegen and there is no
+ * point trying again.
+ */
+ }
+ else if (vtx->codegen_emit) {
+ vtx->codegen_emit(ctx);
+ }
+
+ if (!vtx->emit) {
+ _tnl_generate_hardwired_emit(ctx);
+ }
+
+ /* Otherwise use the generic version:
+ */
+ if (!vtx->emit)
+ vtx->emit = _tnl_generic_emit;
+
+ vtx->emit( ctx, count, dest );
+}
+
+
+
+static void choose_interp_func( struct gl_context *ctx,
+ GLfloat t,
+ GLuint edst, GLuint eout, GLuint ein,
+ GLboolean force_boundary )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+
+ if (vtx->need_extras &&
+ (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
+ vtx->interp = _tnl_generic_interp_extras;
+ } else {
+ vtx->interp = _tnl_generic_interp;
+ }
+
+ vtx->interp( ctx, t, edst, eout, ein, force_boundary );
+}
+
+
+static void choose_copy_pv_func( struct gl_context *ctx, GLuint edst, GLuint esrc )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+
+ if (vtx->need_extras &&
+ (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
+ vtx->copy_pv = _tnl_generic_copy_pv_extras;
+ } else {
+ vtx->copy_pv = _tnl_generic_copy_pv;
+ }
+
+ vtx->copy_pv( ctx, edst, esrc );
+}
+
+
+/***********************************************************************
+ * Public entrypoints, mostly dispatch to the above:
+ */
+
+
+/* Interpolate between two vertices to produce a third:
+ */
+void _tnl_interp( struct gl_context *ctx,
+ GLfloat t,
+ GLuint edst, GLuint eout, GLuint ein,
+ GLboolean force_boundary )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ vtx->interp( ctx, t, edst, eout, ein, force_boundary );
+}
+
+/* Copy colors from one vertex to another:
+ */
+void _tnl_copy_pv( struct gl_context *ctx, GLuint edst, GLuint esrc )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ vtx->copy_pv( ctx, edst, esrc );
+}
+
+
+/* Extract a named attribute from a hardware vertex. Will have to
+ * reverse any viewport transformation, swizzling or other conversions
+ * which may have been applied:
+ */
+void _tnl_get_attr( struct gl_context *ctx, const void *vin,
+ GLenum attr, GLfloat *dest )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ const struct tnl_clipspace_attr *a = vtx->attr;
+ const GLuint attr_count = vtx->attr_count;
+ GLuint j;
+
+ for (j = 0; j < attr_count; j++) {
+ if (a[j].attrib == attr) {
+ a[j].extract( &a[j], dest, (GLubyte *)vin + a[j].vertoffset );
+ return;
+ }
+ }
+
+ /* Else return the value from ctx->Current.
+ */
+ if (attr == _TNL_ATTRIB_POINTSIZE) {
+ /* If the hardware vertex doesn't have point size then use size from
+ * struct gl_context. XXX this will be wrong if drawing attenuated points!
+ */
+ dest[0] = ctx->Point.Size;
+ }
+ else {
+ memcpy( dest, ctx->Current.Attrib[attr], 4*sizeof(GLfloat));
+ }
+}
+
+
+/* Complementary operation to the above.
+ */
+void _tnl_set_attr( struct gl_context *ctx, void *vout,
+ GLenum attr, const GLfloat *src )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ const struct tnl_clipspace_attr *a = vtx->attr;
+ const GLuint attr_count = vtx->attr_count;
+ GLuint j;
+
+ for (j = 0; j < attr_count; j++) {
+ if (a[j].attrib == attr) {
+ a[j].insert[4-1]( &a[j], (GLubyte *)vout + a[j].vertoffset, src );
+ return;
+ }
+ }
+}
+
+
+void *_tnl_get_vertex( struct gl_context *ctx, GLuint nr )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+
+ return vtx->vertex_buf + nr * vtx->vertex_size;
+}
+
+void _tnl_invalidate_vertex_state( struct gl_context *ctx, GLuint new_state )
+{
+ if (new_state & (_DD_NEW_TRI_LIGHT_TWOSIDE|_DD_NEW_TRI_UNFILLED) ) {
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ vtx->new_inputs = ~0;
+ vtx->interp = choose_interp_func;
+ vtx->copy_pv = choose_copy_pv_func;
+ }
+}
+
+static void invalidate_funcs( struct tnl_clipspace *vtx )
+{
+ vtx->emit = choose_emit_func;
+ vtx->interp = choose_interp_func;
+ vtx->copy_pv = choose_copy_pv_func;
+ vtx->new_inputs = ~0;
+}
+
+GLuint _tnl_install_attrs( struct gl_context *ctx, const struct tnl_attr_map *map,
+ GLuint nr, const GLfloat *vp,
+ GLuint unpacked_size )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ GLuint offset = 0;
+ GLuint i, j;
+
+ assert(nr < _TNL_ATTRIB_MAX);
+ assert(nr == 0 || map[0].attrib == VERT_ATTRIB_POS);
+
+ vtx->new_inputs = ~0;
+ vtx->need_viewport = GL_FALSE;
+
+ if (vp) {
+ vtx->need_viewport = GL_TRUE;
+ }
+
+ for (j = 0, i = 0; i < nr; i++) {
+ const GLuint format = map[i].format;
+ if (format == EMIT_PAD) {
+ if (DBG)
+ printf("%d: pad %d, offset %d\n", i,
+ map[i].offset, offset);
+
+ offset += map[i].offset;
+
+ }
+ else {
+ GLuint tmpoffset;
+
+ if (unpacked_size)
+ tmpoffset = map[i].offset;
+ else
+ tmpoffset = offset;
+
+ if (vtx->attr_count != j ||
+ vtx->attr[j].attrib != map[i].attrib ||
+ vtx->attr[j].format != format ||
+ vtx->attr[j].vertoffset != tmpoffset) {
+ invalidate_funcs(vtx);
+
+ vtx->attr[j].attrib = map[i].attrib;
+ vtx->attr[j].format = format;
+ vtx->attr[j].vp = vp;
+ vtx->attr[j].insert = _tnl_format_info[format].insert;
+ vtx->attr[j].extract = _tnl_format_info[format].extract;
+ vtx->attr[j].vertattrsize = _tnl_format_info[format].attrsize;
+ vtx->attr[j].vertoffset = tmpoffset;
+ }
+
+
+ if (DBG)
+ printf("%d: %s, vp %p, offset %d\n", i,
+ _tnl_format_info[format].name, (void *)vp,
+ vtx->attr[j].vertoffset);
+
+ offset += _tnl_format_info[format].attrsize;
+ j++;
+ }
+ }
+
+ vtx->attr_count = j;
+
+ if (unpacked_size)
+ vtx->vertex_size = unpacked_size;
+ else
+ vtx->vertex_size = offset;
+
+ assert(vtx->vertex_size <= vtx->max_vertex_size);
+ return vtx->vertex_size;
+}
+
+
+
+void _tnl_invalidate_vertices( struct gl_context *ctx, GLuint newinputs )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ vtx->new_inputs |= newinputs;
+}
+
+
+/* This event has broader use beyond this file - will move elsewhere
+ * and probably invoke a driver callback.
+ */
+void _tnl_notify_pipeline_output_change( struct gl_context *ctx )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ invalidate_funcs(vtx);
+}
+
+
+static void adjust_input_ptrs( struct gl_context *ctx, GLint diff)
+{
+ struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ struct tnl_clipspace_attr *a = vtx->attr;
+ const GLuint count = vtx->attr_count;
+ GLuint j;
+
+ diff -= 1;
+ for (j=0; j<count; ++j) {
+ register GLvector4f *vptr = VB->AttribPtr[a->attrib];
+ (a++)->inputptr += diff*vptr->stride;
+ }
+}
+
+static void update_input_ptrs( struct gl_context *ctx, GLuint start )
+{
+ struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ struct tnl_clipspace_attr *a = vtx->attr;
+ const GLuint count = vtx->attr_count;
+ GLuint j;
+
+ for (j = 0; j < count; j++) {
+ GLvector4f *vptr = VB->AttribPtr[a[j].attrib];
+
+ if (vtx->emit != choose_emit_func) {
+ assert(a[j].inputstride == vptr->stride);
+ assert(a[j].inputsize == vptr->size);
+ }
+
+ a[j].inputptr = ((GLubyte *)vptr->data) + start * vptr->stride;
+ }
+
+ if (a->vp) {
+ vtx->vp_scale[0] = a->vp[MAT_SX];
+ vtx->vp_scale[1] = a->vp[MAT_SY];
+ vtx->vp_scale[2] = a->vp[MAT_SZ];
+ vtx->vp_scale[3] = 1.0;
+ vtx->vp_xlate[0] = a->vp[MAT_TX];
+ vtx->vp_xlate[1] = a->vp[MAT_TY];
+ vtx->vp_xlate[2] = a->vp[MAT_TZ];
+ vtx->vp_xlate[3] = 0.0;
+ }
+}
+
+
+void _tnl_build_vertices( struct gl_context *ctx,
+ GLuint start,
+ GLuint end,
+ GLuint newinputs )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ update_input_ptrs( ctx, start );
+ vtx->emit( ctx, end - start,
+ (GLubyte *)(vtx->vertex_buf +
+ start * vtx->vertex_size));
+}
+
+/* Emit VB vertices start..end to dest. Note that VB vertex at
+ * postion start will be emitted to dest at position zero.
+ */
+void *_tnl_emit_vertices_to_buffer( struct gl_context *ctx,
+ GLuint start,
+ GLuint end,
+ void *dest )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+
+ update_input_ptrs(ctx, start);
+ /* Note: dest should not be adjusted for non-zero 'start' values:
+ */
+ vtx->emit( ctx, end - start, (GLubyte*) dest );
+ return (void *)((GLubyte *)dest + vtx->vertex_size * (end - start));
+}
+
+/* Emit indexed VB vertices start..end to dest. Note that VB vertex at
+ * postion start will be emitted to dest at position zero.
+ */
+
+void *_tnl_emit_indexed_vertices_to_buffer( struct gl_context *ctx,
+ const GLuint *elts,
+ GLuint start,
+ GLuint end,
+ void *dest )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ GLuint oldIndex;
+ GLubyte *cdest = dest;
+
+ update_input_ptrs(ctx, oldIndex = elts[start++]);
+ vtx->emit( ctx, 1, cdest );
+ cdest += vtx->vertex_size;
+
+ for (; start < end; ++start) {
+ adjust_input_ptrs(ctx, elts[start] - oldIndex);
+ oldIndex = elts[start];
+ vtx->emit( ctx, 1, cdest);
+ cdest += vtx->vertex_size;
+ }
+
+ return (void *) cdest;
+}
+
+
+void _tnl_init_vertices( struct gl_context *ctx,
+ GLuint vb_size,
+ GLuint max_vertex_size )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+
+ _tnl_install_attrs( ctx, NULL, 0, NULL, 0 );
+
+ vtx->need_extras = GL_TRUE;
+ if (max_vertex_size > vtx->max_vertex_size) {
+ _tnl_free_vertices( ctx );
+ vtx->max_vertex_size = max_vertex_size;
+ vtx->vertex_buf = (GLubyte *)_mesa_align_calloc(vb_size * max_vertex_size, 32 );
+ invalidate_funcs(vtx);
+ }
+
+ switch(CHAN_TYPE) {
+ case GL_UNSIGNED_BYTE:
+ vtx->chan_scale[0] = 255.0;
+ vtx->chan_scale[1] = 255.0;
+ vtx->chan_scale[2] = 255.0;
+ vtx->chan_scale[3] = 255.0;
+ break;
+ case GL_UNSIGNED_SHORT:
+ vtx->chan_scale[0] = 65535.0;
+ vtx->chan_scale[1] = 65535.0;
+ vtx->chan_scale[2] = 65535.0;
+ vtx->chan_scale[3] = 65535.0;
+ break;
+ default:
+ vtx->chan_scale[0] = 1.0;
+ vtx->chan_scale[1] = 1.0;
+ vtx->chan_scale[2] = 1.0;
+ vtx->chan_scale[3] = 1.0;
+ break;
+ }
+
+ vtx->identity[0] = 0.0;
+ vtx->identity[1] = 0.0;
+ vtx->identity[2] = 0.0;
+ vtx->identity[3] = 1.0;
+
+ vtx->codegen_emit = NULL;
+
+#ifdef USE_SSE_ASM
+ if (!_mesa_getenv("MESA_NO_CODEGEN"))
+ vtx->codegen_emit = _tnl_generate_sse_emit;
+#endif
+}
+
+
+void _tnl_free_vertices( struct gl_context *ctx )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ if (tnl) {
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ struct tnl_clipspace_fastpath *fp, *tmp;
+
+ if (vtx->vertex_buf) {
+ _mesa_align_free(vtx->vertex_buf);
+ vtx->vertex_buf = NULL;
+ }
+
+ for (fp = vtx->fastpath ; fp ; fp = tmp) {
+ tmp = fp->next;
+ FREE(fp->attr);
+
+ /* KW: At the moment, fp->func is constrained to be allocated by
+ * _mesa_exec_alloc(), as the hardwired fastpaths in
+ * t_vertex_generic.c are handled specially. It would be nice
+ * to unify them, but this probably won't change until this
+ * module gets another overhaul.
+ */
+ _mesa_exec_free((void *) fp->func);
+ FREE(fp);
+ }
+
+ vtx->fastpath = NULL;
+ }
+}
diff --git a/mesalib/src/mesa/tnl/t_vertex_generic.c b/mesalib/src/mesa/tnl/t_vertex_generic.c
index 144b3669d..9dcecdd57 100644
--- a/mesalib/src/mesa/tnl/t_vertex_generic.c
+++ b/mesalib/src/mesa/tnl/t_vertex_generic.c
@@ -1,1155 +1,1156 @@
-
-/*
- * Copyright 2003 Tungsten Graphics, inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keithw@tungstengraphics.com>
- */
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/colormac.h"
-#include "main/simple_list.h"
-#include "t_context.h"
-#include "t_vertex.h"
-
-
-#if 0
-#define DEBUG_INSERT printf("%s\n", __FUNCTION__)
-#else
-#define DEBUG_INSERT
-#endif
-
-
-/*
- * These functions take the NDC coordinates pointed to by 'in', apply the
- * NDC->Viewport mapping and store the results at 'v'.
- */
-
-static INLINE void insert_4f_viewport_4( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)v;
- const GLfloat * const vp = a->vp;
- DEBUG_INSERT;
- out[0] = vp[0] * in[0] + vp[12];
- out[1] = vp[5] * in[1] + vp[13];
- out[2] = vp[10] * in[2] + vp[14];
- out[3] = in[3];
-}
-
-static INLINE void insert_4f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)v;
- const GLfloat * const vp = a->vp;
- DEBUG_INSERT;
- out[0] = vp[0] * in[0] + vp[12];
- out[1] = vp[5] * in[1] + vp[13];
- out[2] = vp[10] * in[2] + vp[14];
- out[3] = 1;
-}
-
-static INLINE void insert_4f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)v;
- const GLfloat * const vp = a->vp;
- DEBUG_INSERT;
- out[0] = vp[0] * in[0] + vp[12];
- out[1] = vp[5] * in[1] + vp[13];
- out[2] = vp[14];
- out[3] = 1;
-}
-
-static INLINE void insert_4f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)v;
- const GLfloat * const vp = a->vp;
- DEBUG_INSERT;
- out[0] = vp[0] * in[0] + vp[12];
- out[1] = vp[13];
- out[2] = vp[14];
- out[3] = 1;
-}
-
-static INLINE void insert_3f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)v;
- const GLfloat * const vp = a->vp;
- DEBUG_INSERT;
- out[0] = vp[0] * in[0] + vp[12];
- out[1] = vp[5] * in[1] + vp[13];
- out[2] = vp[10] * in[2] + vp[14];
-}
-
-static INLINE void insert_3f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)v;
- const GLfloat * const vp = a->vp;
- DEBUG_INSERT;
- out[0] = vp[0] * in[0] + vp[12];
- out[1] = vp[5] * in[1] + vp[13];
- out[2] = vp[14];
-}
-
-static INLINE void insert_3f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)v;
- const GLfloat * const vp = a->vp;
- DEBUG_INSERT;
- out[0] = vp[0] * in[0] + vp[12];
- out[1] = vp[13];
- out[2] = vp[14];
-}
-
-static INLINE void insert_2f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)v;
- const GLfloat * const vp = a->vp;
- DEBUG_INSERT;
- out[0] = vp[0] * in[0] + vp[12];
- out[1] = vp[5] * in[1] + vp[13];
-}
-
-static INLINE void insert_2f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)v;
- const GLfloat * const vp = a->vp;
- DEBUG_INSERT;
- out[0] = vp[0] * in[0] + vp[12];
- out[1] = vp[13];
-}
-
-
-/*
- * These functions do the same as above, except for the viewport mapping.
- */
-
-static INLINE void insert_4f_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
- (void) a;
- DEBUG_INSERT;
- out[0] = in[0];
- out[1] = in[1];
- out[2] = in[2];
- out[3] = in[3];
-}
-
-static INLINE void insert_4f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
- (void) a;
- DEBUG_INSERT;
- out[0] = in[0];
- out[1] = in[1];
- out[2] = in[2];
- out[3] = 1;
-}
-
-static INLINE void insert_4f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
- (void) a;
- DEBUG_INSERT;
- out[0] = in[0];
- out[1] = in[1];
- out[2] = 0;
- out[3] = 1;
-}
-
-static INLINE void insert_4f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
- (void) a;
- DEBUG_INSERT;
- out[0] = in[0];
- out[1] = 0;
- out[2] = 0;
- out[3] = 1;
-}
-
-static INLINE void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
- (void) a;
- DEBUG_INSERT;
- out[0] = in[0];
- out[1] = in[1];
- out[2] = in[3];
-}
-
-static INLINE void insert_3f_xyw_err( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
-{
- (void) a; (void) v; (void) in;
- DEBUG_INSERT;
- exit(1);
-}
-
-static INLINE void insert_3f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
- (void) a;
- DEBUG_INSERT;
- out[0] = in[0];
- out[1] = in[1];
- out[2] = in[2];
-}
-
-static INLINE void insert_3f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
- (void) a;
- DEBUG_INSERT;
- out[0] = in[0];
- out[1] = in[1];
- out[2] = 0;
-}
-
-static INLINE void insert_3f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
- (void) a;
- DEBUG_INSERT;
- out[0] = in[0];
- out[1] = 0;
- out[2] = 0;
-}
-
-
-static INLINE void insert_2f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
- (void) a;
- DEBUG_INSERT;
- out[0] = in[0];
- out[1] = in[1];
-}
-
-static INLINE void insert_2f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
- (void) a;
- DEBUG_INSERT;
- out[0] = in[0];
- out[1] = 0;
-}
-
-static INLINE void insert_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
-{
- GLfloat *out = (GLfloat *)(v);
- (void) a;
- DEBUG_INSERT;
- out[0] = in[0];
-}
-
-static INLINE void insert_null( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a; (void) v; (void) in;
-}
-
-static INLINE void insert_4chan_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- GLchan *c = (GLchan *)v;
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]);
- UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]);
- UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]);
- UNCLAMPED_FLOAT_TO_CHAN(c[3], in[3]);
-}
-
-static INLINE void insert_4chan_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- GLchan *c = (GLchan *)v;
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]);
- UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]);
- UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]);
- c[3] = CHAN_MAX;
-}
-
-static INLINE void insert_4chan_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- GLchan *c = (GLchan *)v;
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]);
- UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]);
- c[2] = 0;
- c[3] = CHAN_MAX;
-}
-
-static INLINE void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- GLchan *c = (GLchan *)v;
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]);
- c[1] = 0;
- c[2] = 0;
- c[3] = CHAN_MAX;
-}
-
-static INLINE void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]);
-}
-
-static INLINE void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]);
- v[3] = 0xff;
-}
-
-static INLINE void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
- v[2] = 0;
- v[3] = 0xff;
-}
-
-static INLINE void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
- v[1] = 0;
- v[2] = 0;
- v[3] = 0xff;
-}
-
-static INLINE void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]);
-}
-
-static INLINE void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]);
- v[3] = 0xff;
-}
-
-static INLINE void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
- v[0] = 0;
- v[3] = 0xff;
-}
-
-static INLINE void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
- v[1] = 0;
- v[0] = 0;
- v[3] = 0xff;
-}
-
-static INLINE void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[2]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]);
-}
-
-static INLINE void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[2]);
- v[0] = 0xff;
-}
-
-static INLINE void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
- v[3] = 0x00;
- v[0] = 0xff;
-}
-
-static INLINE void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]);
- v[2] = 0x00;
- v[3] = 0x00;
- v[0] = 0xff;
-}
-
-static INLINE void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[2]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]);
-}
-
-static INLINE void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[2]);
- v[0] = 0xff;
-}
-
-static INLINE void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
- v[1] = 0x00;
- v[0] = 0xff;
-}
-
-static INLINE void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]);
- v[2] = 0x00;
- v[1] = 0x00;
- v[0] = 0xff;
-}
-
-static INLINE void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]);
-}
-
-static INLINE void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
- v[2] = 0;
-}
-
-static INLINE void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
- v[1] = 0;
- v[2] = 0;
-}
-
-static INLINE void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]);
-}
-
-static INLINE void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
- UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
- v[0] = 0;
-}
-
-static INLINE void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
- v[1] = 0;
- v[0] = 0;
-}
-
-
-static INLINE void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v,
- const GLfloat *in )
-{
- DEBUG_INSERT;
- (void) a;
- UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
-}
-
-
-/***********************************************************************
- * Functions to perform the reverse operations to the above, for
- * swrast translation and clip-interpolation.
- *
- * Currently always extracts a full 4 floats.
- */
-
-static void extract_4f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out,
- const GLubyte *v )
-{
- const GLfloat *in = (const GLfloat *)v;
- const GLfloat * const vp = a->vp;
-
- /* Although included for completeness, the position coordinate is
- * usually handled differently during clipping.
- */
- DEBUG_INSERT;
- out[0] = (in[0] - vp[12]) / vp[0];
- out[1] = (in[1] - vp[13]) / vp[5];
- out[2] = (in[2] - vp[14]) / vp[10];
- out[3] = in[3];
-}
-
-static void extract_3f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out,
- const GLubyte *v )
-{
- const GLfloat *in = (const GLfloat *)v;
- const GLfloat * const vp = a->vp;
- DEBUG_INSERT;
- out[0] = (in[0] - vp[12]) / vp[0];
- out[1] = (in[1] - vp[13]) / vp[5];
- out[2] = (in[2] - vp[14]) / vp[10];
- out[3] = 1;
-}
-
-
-static void extract_2f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out,
- const GLubyte *v )
-{
- const GLfloat *in = (const GLfloat *)v;
- const GLfloat * const vp = a->vp;
- DEBUG_INSERT;
- out[0] = (in[0] - vp[12]) / vp[0];
- out[1] = (in[1] - vp[13]) / vp[5];
- out[2] = 0;
- out[3] = 1;
-}
-
-
-static void extract_4f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v )
-{
- const GLfloat *in = (const GLfloat *)v;
- (void) a;
-
- out[0] = in[0];
- out[1] = in[1];
- out[2] = in[2];
- out[3] = in[3];
-}
-
-static void extract_3f_xyw( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v )
-{
- const GLfloat *in = (const GLfloat *)v;
- (void) a;
-
- out[0] = in[0];
- out[1] = in[1];
- out[2] = 0;
- out[3] = in[2];
-}
-
-
-static void extract_3f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v )
-{
- const GLfloat *in = (const GLfloat *)v;
- (void) a;
-
- out[0] = in[0];
- out[1] = in[1];
- out[2] = in[2];
- out[3] = 1;
-}
-
-
-static void extract_2f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v )
-{
- const GLfloat *in = (const GLfloat *)v;
- (void) a;
-
- out[0] = in[0];
- out[1] = in[1];
- out[2] = 0;
- out[3] = 1;
-}
-
-static void extract_1f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v )
-{
- const GLfloat *in = (const GLfloat *)v;
- (void) a;
-
- out[0] = in[0];
- out[1] = 0;
- out[2] = 0;
- out[3] = 1;
-}
-
-static void extract_4chan_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *out,
- const GLubyte *v )
-{
- GLchan *c = (GLchan *)v;
- (void) a;
-
- out[0] = CHAN_TO_FLOAT(c[0]);
- out[1] = CHAN_TO_FLOAT(c[1]);
- out[2] = CHAN_TO_FLOAT(c[2]);
- out[3] = CHAN_TO_FLOAT(c[3]);
-}
-
-static void extract_4ub_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *out,
- const GLubyte *v )
-{
- (void) a;
- out[0] = UBYTE_TO_FLOAT(v[0]);
- out[1] = UBYTE_TO_FLOAT(v[1]);
- out[2] = UBYTE_TO_FLOAT(v[2]);
- out[3] = UBYTE_TO_FLOAT(v[3]);
-}
-
-static void extract_4ub_4f_bgra( const struct tnl_clipspace_attr *a, GLfloat *out,
- const GLubyte *v )
-{
- (void) a;
- out[2] = UBYTE_TO_FLOAT(v[0]);
- out[1] = UBYTE_TO_FLOAT(v[1]);
- out[0] = UBYTE_TO_FLOAT(v[2]);
- out[3] = UBYTE_TO_FLOAT(v[3]);
-}
-
-static void extract_4ub_4f_argb( const struct tnl_clipspace_attr *a, GLfloat *out,
- const GLubyte *v )
-{
- (void) a;
- out[3] = UBYTE_TO_FLOAT(v[0]);
- out[0] = UBYTE_TO_FLOAT(v[1]);
- out[1] = UBYTE_TO_FLOAT(v[2]);
- out[2] = UBYTE_TO_FLOAT(v[3]);
-}
-
-static void extract_4ub_4f_abgr( const struct tnl_clipspace_attr *a, GLfloat *out,
- const GLubyte *v )
-{
- (void) a;
- out[3] = UBYTE_TO_FLOAT(v[0]);
- out[2] = UBYTE_TO_FLOAT(v[1]);
- out[1] = UBYTE_TO_FLOAT(v[2]);
- out[0] = UBYTE_TO_FLOAT(v[3]);
-}
-
-static void extract_3ub_3f_rgb( const struct tnl_clipspace_attr *a, GLfloat *out,
- const GLubyte *v )
-{
- (void) a;
- out[0] = UBYTE_TO_FLOAT(v[0]);
- out[1] = UBYTE_TO_FLOAT(v[1]);
- out[2] = UBYTE_TO_FLOAT(v[2]);
- out[3] = 1;
-}
-
-static void extract_3ub_3f_bgr( const struct tnl_clipspace_attr *a, GLfloat *out,
- const GLubyte *v )
-{
- (void) a;
- out[2] = UBYTE_TO_FLOAT(v[0]);
- out[1] = UBYTE_TO_FLOAT(v[1]);
- out[0] = UBYTE_TO_FLOAT(v[2]);
- out[3] = 1;
-}
-
-static void extract_1ub_1f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v )
-{
- (void) a;
- out[0] = UBYTE_TO_FLOAT(v[0]);
- out[1] = 0;
- out[2] = 0;
- out[3] = 1;
-}
-
-
-const struct tnl_format_info _tnl_format_info[EMIT_MAX] =
-{
- { "1f",
- extract_1f,
- { insert_1f_1, insert_1f_1, insert_1f_1, insert_1f_1 },
- sizeof(GLfloat) },
-
- { "2f",
- extract_2f,
- { insert_2f_1, insert_2f_2, insert_2f_2, insert_2f_2 },
- 2 * sizeof(GLfloat) },
-
- { "3f",
- extract_3f,
- { insert_3f_1, insert_3f_2, insert_3f_3, insert_3f_3 },
- 3 * sizeof(GLfloat) },
-
- { "4f",
- extract_4f,
- { insert_4f_1, insert_4f_2, insert_4f_3, insert_4f_4 },
- 4 * sizeof(GLfloat) },
-
- { "2f_viewport",
- extract_2f_viewport,
- { insert_2f_viewport_1, insert_2f_viewport_2, insert_2f_viewport_2,
- insert_2f_viewport_2 },
- 2 * sizeof(GLfloat) },
-
- { "3f_viewport",
- extract_3f_viewport,
- { insert_3f_viewport_1, insert_3f_viewport_2, insert_3f_viewport_3,
- insert_3f_viewport_3 },
- 3 * sizeof(GLfloat) },
-
- { "4f_viewport",
- extract_4f_viewport,
- { insert_4f_viewport_1, insert_4f_viewport_2, insert_4f_viewport_3,
- insert_4f_viewport_4 },
- 4 * sizeof(GLfloat) },
-
- { "3f_xyw",
- extract_3f_xyw,
- { insert_3f_xyw_err, insert_3f_xyw_err, insert_3f_xyw_err,
- insert_3f_xyw_4 },
- 3 * sizeof(GLfloat) },
-
- { "1ub_1f",
- extract_1ub_1f,
- { insert_1ub_1f_1, insert_1ub_1f_1, insert_1ub_1f_1, insert_1ub_1f_1 },
- sizeof(GLubyte) },
-
- { "3ub_3f_rgb",
- extract_3ub_3f_rgb,
- { insert_3ub_3f_rgb_1, insert_3ub_3f_rgb_2, insert_3ub_3f_rgb_3,
- insert_3ub_3f_rgb_3 },
- 3 * sizeof(GLubyte) },
-
- { "3ub_3f_bgr",
- extract_3ub_3f_bgr,
- { insert_3ub_3f_bgr_1, insert_3ub_3f_bgr_2, insert_3ub_3f_bgr_3,
- insert_3ub_3f_bgr_3 },
- 3 * sizeof(GLubyte) },
-
- { "4ub_4f_rgba",
- extract_4ub_4f_rgba,
- { insert_4ub_4f_rgba_1, insert_4ub_4f_rgba_2, insert_4ub_4f_rgba_3,
- insert_4ub_4f_rgba_4 },
- 4 * sizeof(GLubyte) },
-
- { "4ub_4f_bgra",
- extract_4ub_4f_bgra,
- { insert_4ub_4f_bgra_1, insert_4ub_4f_bgra_2, insert_4ub_4f_bgra_3,
- insert_4ub_4f_bgra_4 },
- 4 * sizeof(GLubyte) },
-
- { "4ub_4f_argb",
- extract_4ub_4f_argb,
- { insert_4ub_4f_argb_1, insert_4ub_4f_argb_2, insert_4ub_4f_argb_3,
- insert_4ub_4f_argb_4 },
- 4 * sizeof(GLubyte) },
-
- { "4ub_4f_abgr",
- extract_4ub_4f_abgr,
- { insert_4ub_4f_abgr_1, insert_4ub_4f_abgr_2, insert_4ub_4f_abgr_3,
- insert_4ub_4f_abgr_4 },
- 4 * sizeof(GLubyte) },
-
- { "4chan_4f_rgba",
- extract_4chan_4f_rgba,
- { insert_4chan_4f_rgba_1, insert_4chan_4f_rgba_2, insert_4chan_4f_rgba_3,
- insert_4chan_4f_rgba_4 },
- 4 * sizeof(GLchan) },
-
- { "pad",
- NULL,
- { NULL, NULL, NULL, NULL },
- 0 }
-
-};
-
-
-
-
-/***********************************************************************
- * Hardwired fastpaths for emitting whole vertices or groups of
- * vertices
- */
-#define EMIT5(NR, F0, F1, F2, F3, F4, NAME) \
-static void NAME( struct gl_context *ctx, \
- GLuint count, \
- GLubyte *v ) \
-{ \
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); \
- struct tnl_clipspace_attr *a = vtx->attr; \
- GLuint i; \
- \
- for (i = 0 ; i < count ; i++, v += vtx->vertex_size) { \
- if (NR > 0) { \
- F0( &a[0], v + a[0].vertoffset, (GLfloat *)a[0].inputptr ); \
- a[0].inputptr += a[0].inputstride; \
- } \
- \
- if (NR > 1) { \
- F1( &a[1], v + a[1].vertoffset, (GLfloat *)a[1].inputptr ); \
- a[1].inputptr += a[1].inputstride; \
- } \
- \
- if (NR > 2) { \
- F2( &a[2], v + a[2].vertoffset, (GLfloat *)a[2].inputptr ); \
- a[2].inputptr += a[2].inputstride; \
- } \
- \
- if (NR > 3) { \
- F3( &a[3], v + a[3].vertoffset, (GLfloat *)a[3].inputptr ); \
- a[3].inputptr += a[3].inputstride; \
- } \
- \
- if (NR > 4) { \
- F4( &a[4], v + a[4].vertoffset, (GLfloat *)a[4].inputptr ); \
- a[4].inputptr += a[4].inputstride; \
- } \
- } \
-}
-
-
-#define EMIT2(F0, F1, NAME) EMIT5(2, F0, F1, insert_null, \
- insert_null, insert_null, NAME)
-
-#define EMIT3(F0, F1, F2, NAME) EMIT5(3, F0, F1, F2, insert_null, \
- insert_null, NAME)
-
-#define EMIT4(F0, F1, F2, F3, NAME) EMIT5(4, F0, F1, F2, F3, \
- insert_null, NAME)
-
-
-EMIT2(insert_3f_viewport_3, insert_4ub_4f_rgba_4, emit_viewport3_rgba4)
-EMIT2(insert_3f_viewport_3, insert_4ub_4f_bgra_4, emit_viewport3_bgra4)
-EMIT2(insert_3f_3, insert_4ub_4f_rgba_4, emit_xyz3_rgba4)
-
-EMIT3(insert_4f_viewport_4, insert_4ub_4f_rgba_4, insert_2f_2, emit_viewport4_rgba4_st2)
-EMIT3(insert_4f_viewport_4, insert_4ub_4f_bgra_4, insert_2f_2, emit_viewport4_bgra4_st2)
-EMIT3(insert_4f_4, insert_4ub_4f_rgba_4, insert_2f_2, emit_xyzw4_rgba4_st2)
-
-EMIT4(insert_4f_viewport_4, insert_4ub_4f_rgba_4, insert_2f_2, insert_2f_2, emit_viewport4_rgba4_st2_st2)
-EMIT4(insert_4f_viewport_4, insert_4ub_4f_bgra_4, insert_2f_2, insert_2f_2, emit_viewport4_bgra4_st2_st2)
-EMIT4(insert_4f_4, insert_4ub_4f_rgba_4, insert_2f_2, insert_2f_2, emit_xyzw4_rgba4_st2_st2)
-
-
-/* Use the codegen paths to select one of a number of hardwired
- * fastpaths.
- */
-void _tnl_generate_hardwired_emit( struct gl_context *ctx )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- tnl_emit_func func = NULL;
-
- /* Does it fit a hardwired fastpath? Help! this is growing out of
- * control!
- */
- switch (vtx->attr_count) {
- case 2:
- if (vtx->attr[0].emit == insert_3f_viewport_3) {
- if (vtx->attr[1].emit == insert_4ub_4f_bgra_4)
- func = emit_viewport3_bgra4;
- else if (vtx->attr[1].emit == insert_4ub_4f_rgba_4)
- func = emit_viewport3_rgba4;
- }
- else if (vtx->attr[0].emit == insert_3f_3 &&
- vtx->attr[1].emit == insert_4ub_4f_rgba_4) {
- func = emit_xyz3_rgba4;
- }
- break;
- case 3:
- if (vtx->attr[2].emit == insert_2f_2) {
- if (vtx->attr[1].emit == insert_4ub_4f_rgba_4) {
- if (vtx->attr[0].emit == insert_4f_viewport_4)
- func = emit_viewport4_rgba4_st2;
- else if (vtx->attr[0].emit == insert_4f_4)
- func = emit_xyzw4_rgba4_st2;
- }
- else if (vtx->attr[1].emit == insert_4ub_4f_bgra_4 &&
- vtx->attr[0].emit == insert_4f_viewport_4)
- func = emit_viewport4_bgra4_st2;
- }
- break;
- case 4:
- if (vtx->attr[2].emit == insert_2f_2 &&
- vtx->attr[3].emit == insert_2f_2) {
- if (vtx->attr[1].emit == insert_4ub_4f_rgba_4) {
- if (vtx->attr[0].emit == insert_4f_viewport_4)
- func = emit_viewport4_rgba4_st2_st2;
- else if (vtx->attr[0].emit == insert_4f_4)
- func = emit_xyzw4_rgba4_st2_st2;
- }
- else if (vtx->attr[1].emit == insert_4ub_4f_bgra_4 &&
- vtx->attr[0].emit == insert_4f_viewport_4)
- func = emit_viewport4_bgra4_st2_st2;
- }
- break;
- }
-
- vtx->emit = func;
-}
-
-/***********************************************************************
- * Generic (non-codegen) functions for whole vertices or groups of
- * vertices
- */
-
-void _tnl_generic_emit( struct gl_context *ctx,
- GLuint count,
- GLubyte *v )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- struct tnl_clipspace_attr *a = vtx->attr;
- const GLuint attr_count = vtx->attr_count;
- const GLuint stride = vtx->vertex_size;
- GLuint i, j;
-
- for (i = 0 ; i < count ; i++, v += stride) {
- for (j = 0; j < attr_count; j++) {
- GLfloat *in = (GLfloat *)a[j].inputptr;
- a[j].inputptr += a[j].inputstride;
- a[j].emit( &a[j], v + a[j].vertoffset, in );
- }
- }
-}
-
-
-void _tnl_generic_interp( struct gl_context *ctx,
- GLfloat t,
- GLuint edst, GLuint eout, GLuint ein,
- GLboolean force_boundary )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct vertex_buffer *VB = &tnl->vb;
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- const GLubyte *vin = vtx->vertex_buf + ein * vtx->vertex_size;
- const GLubyte *vout = vtx->vertex_buf + eout * vtx->vertex_size;
- GLubyte *vdst = vtx->vertex_buf + edst * vtx->vertex_size;
- const struct tnl_clipspace_attr *a = vtx->attr;
- const GLuint attr_count = vtx->attr_count;
- GLuint j;
- (void) force_boundary;
-
- if (tnl->NeedNdcCoords) {
- const GLfloat *dstclip = VB->ClipPtr->data[edst];
- if (dstclip[3] != 0.0) {
- const GLfloat w = 1.0f / dstclip[3];
- GLfloat pos[4];
-
- pos[0] = dstclip[0] * w;
- pos[1] = dstclip[1] * w;
- pos[2] = dstclip[2] * w;
- pos[3] = w;
-
- a[0].insert[4-1]( &a[0], vdst, pos );
- }
- }
- else {
- a[0].insert[4-1]( &a[0], vdst, VB->ClipPtr->data[edst] );
- }
-
-
- for (j = 1; j < attr_count; j++) {
- GLfloat fin[4], fout[4], fdst[4];
-
- a[j].extract( &a[j], fin, vin + a[j].vertoffset );
- a[j].extract( &a[j], fout, vout + a[j].vertoffset );
-
- INTERP_F( t, fdst[3], fout[3], fin[3] );
- INTERP_F( t, fdst[2], fout[2], fin[2] );
- INTERP_F( t, fdst[1], fout[1], fin[1] );
- INTERP_F( t, fdst[0], fout[0], fin[0] );
-
- a[j].insert[4-1]( &a[j], vdst + a[j].vertoffset, fdst );
- }
-}
-
-
-/* Extract color attributes from one vertex and insert them into
- * another. (Shortcircuit extract/insert with memcpy).
- */
-void _tnl_generic_copy_pv( struct gl_context *ctx, GLuint edst, GLuint esrc )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- GLubyte *vsrc = vtx->vertex_buf + esrc * vtx->vertex_size;
- GLubyte *vdst = vtx->vertex_buf + edst * vtx->vertex_size;
- const struct tnl_clipspace_attr *a = vtx->attr;
- const GLuint attr_count = vtx->attr_count;
- GLuint j;
-
- for (j = 0; j < attr_count; j++) {
- if (a[j].attrib == VERT_ATTRIB_COLOR0 ||
- a[j].attrib == VERT_ATTRIB_COLOR1) {
-
- memcpy( vdst + a[j].vertoffset,
- vsrc + a[j].vertoffset,
- a[j].vertattrsize );
- }
- }
-}
-
-
-/* Helper functions for hardware which doesn't put back colors and/or
- * edgeflags into vertices.
- */
-void _tnl_generic_interp_extras( struct gl_context *ctx,
- GLfloat t,
- GLuint dst, GLuint out, GLuint in,
- GLboolean force_boundary )
-{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- /* If stride is zero, BackfaceColorPtr is constant across the VB, so
- * there is no point interpolating between two values as they will
- * be identical. In all other cases, this value is generated by
- * t_vb_lighttmp.h and has a stride of 4 dwords.
- */
- if (VB->BackfaceColorPtr && VB->BackfaceColorPtr->stride) {
- assert(VB->BackfaceColorPtr->stride == 4 * sizeof(GLfloat));
-
- INTERP_4F( t,
- VB->BackfaceColorPtr->data[dst],
- VB->BackfaceColorPtr->data[out],
- VB->BackfaceColorPtr->data[in] );
- }
-
- if (VB->BackfaceSecondaryColorPtr) {
- assert(VB->BackfaceSecondaryColorPtr->stride == 4 * sizeof(GLfloat));
-
- INTERP_3F( t,
- VB->BackfaceSecondaryColorPtr->data[dst],
- VB->BackfaceSecondaryColorPtr->data[out],
- VB->BackfaceSecondaryColorPtr->data[in] );
- }
-
- if (VB->BackfaceIndexPtr) {
- VB->BackfaceIndexPtr->data[dst][0] = LINTERP( t,
- VB->BackfaceIndexPtr->data[out][0],
- VB->BackfaceIndexPtr->data[in][0] );
- }
-
- if (VB->EdgeFlag) {
- VB->EdgeFlag[dst] = VB->EdgeFlag[out] || force_boundary;
- }
-
- _tnl_generic_interp(ctx, t, dst, out, in, force_boundary);
-}
-
-void _tnl_generic_copy_pv_extras( struct gl_context *ctx,
- GLuint dst, GLuint src )
-{
- struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
-
- /* See above comment:
- */
- if (VB->BackfaceColorPtr && VB->BackfaceColorPtr->stride) {
- COPY_4FV( VB->BackfaceColorPtr->data[dst],
- VB->BackfaceColorPtr->data[src] );
- }
-
- if (VB->BackfaceSecondaryColorPtr) {
- COPY_4FV( VB->BackfaceSecondaryColorPtr->data[dst],
- VB->BackfaceSecondaryColorPtr->data[src] );
- }
-
- if (VB->BackfaceIndexPtr) {
- VB->BackfaceIndexPtr->data[dst][0] = VB->BackfaceIndexPtr->data[src][0];
- }
-
- _tnl_generic_copy_pv(ctx, dst, src);
-}
-
-
+
+/*
+ * Copyright 2003 Tungsten Graphics, inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Whitwell <keithw@tungstengraphics.com>
+ */
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/simple_list.h"
+#include "swrast/s_chan.h"
+#include "t_context.h"
+#include "t_vertex.h"
+
+
+#if 0
+#define DEBUG_INSERT printf("%s\n", __FUNCTION__)
+#else
+#define DEBUG_INSERT
+#endif
+
+
+/*
+ * These functions take the NDC coordinates pointed to by 'in', apply the
+ * NDC->Viewport mapping and store the results at 'v'.
+ */
+
+static INLINE void insert_4f_viewport_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)v;
+ const GLfloat * const vp = a->vp;
+ DEBUG_INSERT;
+ out[0] = vp[0] * in[0] + vp[12];
+ out[1] = vp[5] * in[1] + vp[13];
+ out[2] = vp[10] * in[2] + vp[14];
+ out[3] = in[3];
+}
+
+static INLINE void insert_4f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)v;
+ const GLfloat * const vp = a->vp;
+ DEBUG_INSERT;
+ out[0] = vp[0] * in[0] + vp[12];
+ out[1] = vp[5] * in[1] + vp[13];
+ out[2] = vp[10] * in[2] + vp[14];
+ out[3] = 1;
+}
+
+static INLINE void insert_4f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)v;
+ const GLfloat * const vp = a->vp;
+ DEBUG_INSERT;
+ out[0] = vp[0] * in[0] + vp[12];
+ out[1] = vp[5] * in[1] + vp[13];
+ out[2] = vp[14];
+ out[3] = 1;
+}
+
+static INLINE void insert_4f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)v;
+ const GLfloat * const vp = a->vp;
+ DEBUG_INSERT;
+ out[0] = vp[0] * in[0] + vp[12];
+ out[1] = vp[13];
+ out[2] = vp[14];
+ out[3] = 1;
+}
+
+static INLINE void insert_3f_viewport_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)v;
+ const GLfloat * const vp = a->vp;
+ DEBUG_INSERT;
+ out[0] = vp[0] * in[0] + vp[12];
+ out[1] = vp[5] * in[1] + vp[13];
+ out[2] = vp[10] * in[2] + vp[14];
+}
+
+static INLINE void insert_3f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)v;
+ const GLfloat * const vp = a->vp;
+ DEBUG_INSERT;
+ out[0] = vp[0] * in[0] + vp[12];
+ out[1] = vp[5] * in[1] + vp[13];
+ out[2] = vp[14];
+}
+
+static INLINE void insert_3f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)v;
+ const GLfloat * const vp = a->vp;
+ DEBUG_INSERT;
+ out[0] = vp[0] * in[0] + vp[12];
+ out[1] = vp[13];
+ out[2] = vp[14];
+}
+
+static INLINE void insert_2f_viewport_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)v;
+ const GLfloat * const vp = a->vp;
+ DEBUG_INSERT;
+ out[0] = vp[0] * in[0] + vp[12];
+ out[1] = vp[5] * in[1] + vp[13];
+}
+
+static INLINE void insert_2f_viewport_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)v;
+ const GLfloat * const vp = a->vp;
+ DEBUG_INSERT;
+ out[0] = vp[0] * in[0] + vp[12];
+ out[1] = vp[13];
+}
+
+
+/*
+ * These functions do the same as above, except for the viewport mapping.
+ */
+
+static INLINE void insert_4f_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)(v);
+ (void) a;
+ DEBUG_INSERT;
+ out[0] = in[0];
+ out[1] = in[1];
+ out[2] = in[2];
+ out[3] = in[3];
+}
+
+static INLINE void insert_4f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)(v);
+ (void) a;
+ DEBUG_INSERT;
+ out[0] = in[0];
+ out[1] = in[1];
+ out[2] = in[2];
+ out[3] = 1;
+}
+
+static INLINE void insert_4f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)(v);
+ (void) a;
+ DEBUG_INSERT;
+ out[0] = in[0];
+ out[1] = in[1];
+ out[2] = 0;
+ out[3] = 1;
+}
+
+static INLINE void insert_4f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)(v);
+ (void) a;
+ DEBUG_INSERT;
+ out[0] = in[0];
+ out[1] = 0;
+ out[2] = 0;
+ out[3] = 1;
+}
+
+static INLINE void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)(v);
+ (void) a;
+ DEBUG_INSERT;
+ out[0] = in[0];
+ out[1] = in[1];
+ out[2] = in[3];
+}
+
+static INLINE void insert_3f_xyw_err( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+{
+ (void) a; (void) v; (void) in;
+ DEBUG_INSERT;
+ exit(1);
+}
+
+static INLINE void insert_3f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)(v);
+ (void) a;
+ DEBUG_INSERT;
+ out[0] = in[0];
+ out[1] = in[1];
+ out[2] = in[2];
+}
+
+static INLINE void insert_3f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)(v);
+ (void) a;
+ DEBUG_INSERT;
+ out[0] = in[0];
+ out[1] = in[1];
+ out[2] = 0;
+}
+
+static INLINE void insert_3f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)(v);
+ (void) a;
+ DEBUG_INSERT;
+ out[0] = in[0];
+ out[1] = 0;
+ out[2] = 0;
+}
+
+
+static INLINE void insert_2f_2( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)(v);
+ (void) a;
+ DEBUG_INSERT;
+ out[0] = in[0];
+ out[1] = in[1];
+}
+
+static INLINE void insert_2f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)(v);
+ (void) a;
+ DEBUG_INSERT;
+ out[0] = in[0];
+ out[1] = 0;
+}
+
+static INLINE void insert_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+{
+ GLfloat *out = (GLfloat *)(v);
+ (void) a;
+ DEBUG_INSERT;
+ out[0] = in[0];
+}
+
+static INLINE void insert_null( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a; (void) v; (void) in;
+}
+
+static INLINE void insert_4chan_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ GLchan *c = (GLchan *)v;
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]);
+ UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]);
+ UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]);
+ UNCLAMPED_FLOAT_TO_CHAN(c[3], in[3]);
+}
+
+static INLINE void insert_4chan_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ GLchan *c = (GLchan *)v;
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]);
+ UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]);
+ UNCLAMPED_FLOAT_TO_CHAN(c[2], in[2]);
+ c[3] = CHAN_MAX;
+}
+
+static INLINE void insert_4chan_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ GLchan *c = (GLchan *)v;
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]);
+ UNCLAMPED_FLOAT_TO_CHAN(c[1], in[1]);
+ c[2] = 0;
+ c[3] = CHAN_MAX;
+}
+
+static INLINE void insert_4chan_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ GLchan *c = (GLchan *)v;
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_CHAN(c[0], in[0]);
+ c[1] = 0;
+ c[2] = 0;
+ c[3] = CHAN_MAX;
+}
+
+static INLINE void insert_4ub_4f_rgba_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]);
+}
+
+static INLINE void insert_4ub_4f_rgba_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]);
+ v[3] = 0xff;
+}
+
+static INLINE void insert_4ub_4f_rgba_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
+ v[2] = 0;
+ v[3] = 0xff;
+}
+
+static INLINE void insert_4ub_4f_rgba_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
+ v[1] = 0;
+ v[2] = 0;
+ v[3] = 0xff;
+}
+
+static INLINE void insert_4ub_4f_bgra_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[3]);
+}
+
+static INLINE void insert_4ub_4f_bgra_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]);
+ v[3] = 0xff;
+}
+
+static INLINE void insert_4ub_4f_bgra_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
+ v[0] = 0;
+ v[3] = 0xff;
+}
+
+static INLINE void insert_4ub_4f_bgra_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
+ v[1] = 0;
+ v[0] = 0;
+ v[3] = 0xff;
+}
+
+static INLINE void insert_4ub_4f_argb_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[2]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]);
+}
+
+static INLINE void insert_4ub_4f_argb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[2]);
+ v[0] = 0xff;
+}
+
+static INLINE void insert_4ub_4f_argb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
+ v[3] = 0x00;
+ v[0] = 0xff;
+}
+
+static INLINE void insert_4ub_4f_argb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[0]);
+ v[2] = 0x00;
+ v[3] = 0x00;
+ v[0] = 0xff;
+}
+
+static INLINE void insert_4ub_4f_abgr_4( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[2]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[3]);
+}
+
+static INLINE void insert_4ub_4f_abgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[2]);
+ v[0] = 0xff;
+}
+
+static INLINE void insert_4ub_4f_abgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[1]);
+ v[1] = 0x00;
+ v[0] = 0xff;
+}
+
+static INLINE void insert_4ub_4f_abgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[3], in[0]);
+ v[2] = 0x00;
+ v[1] = 0x00;
+ v[0] = 0xff;
+}
+
+static INLINE void insert_3ub_3f_rgb_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[2]);
+}
+
+static INLINE void insert_3ub_3f_rgb_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
+ v[2] = 0;
+}
+
+static INLINE void insert_3ub_3f_rgb_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
+ v[1] = 0;
+ v[2] = 0;
+}
+
+static INLINE void insert_3ub_3f_bgr_3( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[2]);
+}
+
+static INLINE void insert_3ub_3f_bgr_2( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
+ UNCLAMPED_FLOAT_TO_UBYTE(v[1], in[1]);
+ v[0] = 0;
+}
+
+static INLINE void insert_3ub_3f_bgr_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[2], in[0]);
+ v[1] = 0;
+ v[0] = 0;
+}
+
+
+static INLINE void insert_1ub_1f_1( const struct tnl_clipspace_attr *a, GLubyte *v,
+ const GLfloat *in )
+{
+ DEBUG_INSERT;
+ (void) a;
+ UNCLAMPED_FLOAT_TO_UBYTE(v[0], in[0]);
+}
+
+
+/***********************************************************************
+ * Functions to perform the reverse operations to the above, for
+ * swrast translation and clip-interpolation.
+ *
+ * Currently always extracts a full 4 floats.
+ */
+
+static void extract_4f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out,
+ const GLubyte *v )
+{
+ const GLfloat *in = (const GLfloat *)v;
+ const GLfloat * const vp = a->vp;
+
+ /* Although included for completeness, the position coordinate is
+ * usually handled differently during clipping.
+ */
+ DEBUG_INSERT;
+ out[0] = (in[0] - vp[12]) / vp[0];
+ out[1] = (in[1] - vp[13]) / vp[5];
+ out[2] = (in[2] - vp[14]) / vp[10];
+ out[3] = in[3];
+}
+
+static void extract_3f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out,
+ const GLubyte *v )
+{
+ const GLfloat *in = (const GLfloat *)v;
+ const GLfloat * const vp = a->vp;
+ DEBUG_INSERT;
+ out[0] = (in[0] - vp[12]) / vp[0];
+ out[1] = (in[1] - vp[13]) / vp[5];
+ out[2] = (in[2] - vp[14]) / vp[10];
+ out[3] = 1;
+}
+
+
+static void extract_2f_viewport( const struct tnl_clipspace_attr *a, GLfloat *out,
+ const GLubyte *v )
+{
+ const GLfloat *in = (const GLfloat *)v;
+ const GLfloat * const vp = a->vp;
+ DEBUG_INSERT;
+ out[0] = (in[0] - vp[12]) / vp[0];
+ out[1] = (in[1] - vp[13]) / vp[5];
+ out[2] = 0;
+ out[3] = 1;
+}
+
+
+static void extract_4f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v )
+{
+ const GLfloat *in = (const GLfloat *)v;
+ (void) a;
+
+ out[0] = in[0];
+ out[1] = in[1];
+ out[2] = in[2];
+ out[3] = in[3];
+}
+
+static void extract_3f_xyw( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v )
+{
+ const GLfloat *in = (const GLfloat *)v;
+ (void) a;
+
+ out[0] = in[0];
+ out[1] = in[1];
+ out[2] = 0;
+ out[3] = in[2];
+}
+
+
+static void extract_3f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v )
+{
+ const GLfloat *in = (const GLfloat *)v;
+ (void) a;
+
+ out[0] = in[0];
+ out[1] = in[1];
+ out[2] = in[2];
+ out[3] = 1;
+}
+
+
+static void extract_2f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v )
+{
+ const GLfloat *in = (const GLfloat *)v;
+ (void) a;
+
+ out[0] = in[0];
+ out[1] = in[1];
+ out[2] = 0;
+ out[3] = 1;
+}
+
+static void extract_1f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v )
+{
+ const GLfloat *in = (const GLfloat *)v;
+ (void) a;
+
+ out[0] = in[0];
+ out[1] = 0;
+ out[2] = 0;
+ out[3] = 1;
+}
+
+static void extract_4chan_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *out,
+ const GLubyte *v )
+{
+ GLchan *c = (GLchan *)v;
+ (void) a;
+
+ out[0] = CHAN_TO_FLOAT(c[0]);
+ out[1] = CHAN_TO_FLOAT(c[1]);
+ out[2] = CHAN_TO_FLOAT(c[2]);
+ out[3] = CHAN_TO_FLOAT(c[3]);
+}
+
+static void extract_4ub_4f_rgba( const struct tnl_clipspace_attr *a, GLfloat *out,
+ const GLubyte *v )
+{
+ (void) a;
+ out[0] = UBYTE_TO_FLOAT(v[0]);
+ out[1] = UBYTE_TO_FLOAT(v[1]);
+ out[2] = UBYTE_TO_FLOAT(v[2]);
+ out[3] = UBYTE_TO_FLOAT(v[3]);
+}
+
+static void extract_4ub_4f_bgra( const struct tnl_clipspace_attr *a, GLfloat *out,
+ const GLubyte *v )
+{
+ (void) a;
+ out[2] = UBYTE_TO_FLOAT(v[0]);
+ out[1] = UBYTE_TO_FLOAT(v[1]);
+ out[0] = UBYTE_TO_FLOAT(v[2]);
+ out[3] = UBYTE_TO_FLOAT(v[3]);
+}
+
+static void extract_4ub_4f_argb( const struct tnl_clipspace_attr *a, GLfloat *out,
+ const GLubyte *v )
+{
+ (void) a;
+ out[3] = UBYTE_TO_FLOAT(v[0]);
+ out[0] = UBYTE_TO_FLOAT(v[1]);
+ out[1] = UBYTE_TO_FLOAT(v[2]);
+ out[2] = UBYTE_TO_FLOAT(v[3]);
+}
+
+static void extract_4ub_4f_abgr( const struct tnl_clipspace_attr *a, GLfloat *out,
+ const GLubyte *v )
+{
+ (void) a;
+ out[3] = UBYTE_TO_FLOAT(v[0]);
+ out[2] = UBYTE_TO_FLOAT(v[1]);
+ out[1] = UBYTE_TO_FLOAT(v[2]);
+ out[0] = UBYTE_TO_FLOAT(v[3]);
+}
+
+static void extract_3ub_3f_rgb( const struct tnl_clipspace_attr *a, GLfloat *out,
+ const GLubyte *v )
+{
+ (void) a;
+ out[0] = UBYTE_TO_FLOAT(v[0]);
+ out[1] = UBYTE_TO_FLOAT(v[1]);
+ out[2] = UBYTE_TO_FLOAT(v[2]);
+ out[3] = 1;
+}
+
+static void extract_3ub_3f_bgr( const struct tnl_clipspace_attr *a, GLfloat *out,
+ const GLubyte *v )
+{
+ (void) a;
+ out[2] = UBYTE_TO_FLOAT(v[0]);
+ out[1] = UBYTE_TO_FLOAT(v[1]);
+ out[0] = UBYTE_TO_FLOAT(v[2]);
+ out[3] = 1;
+}
+
+static void extract_1ub_1f( const struct tnl_clipspace_attr *a, GLfloat *out, const GLubyte *v )
+{
+ (void) a;
+ out[0] = UBYTE_TO_FLOAT(v[0]);
+ out[1] = 0;
+ out[2] = 0;
+ out[3] = 1;
+}
+
+
+const struct tnl_format_info _tnl_format_info[EMIT_MAX] =
+{
+ { "1f",
+ extract_1f,
+ { insert_1f_1, insert_1f_1, insert_1f_1, insert_1f_1 },
+ sizeof(GLfloat) },
+
+ { "2f",
+ extract_2f,
+ { insert_2f_1, insert_2f_2, insert_2f_2, insert_2f_2 },
+ 2 * sizeof(GLfloat) },
+
+ { "3f",
+ extract_3f,
+ { insert_3f_1, insert_3f_2, insert_3f_3, insert_3f_3 },
+ 3 * sizeof(GLfloat) },
+
+ { "4f",
+ extract_4f,
+ { insert_4f_1, insert_4f_2, insert_4f_3, insert_4f_4 },
+ 4 * sizeof(GLfloat) },
+
+ { "2f_viewport",
+ extract_2f_viewport,
+ { insert_2f_viewport_1, insert_2f_viewport_2, insert_2f_viewport_2,
+ insert_2f_viewport_2 },
+ 2 * sizeof(GLfloat) },
+
+ { "3f_viewport",
+ extract_3f_viewport,
+ { insert_3f_viewport_1, insert_3f_viewport_2, insert_3f_viewport_3,
+ insert_3f_viewport_3 },
+ 3 * sizeof(GLfloat) },
+
+ { "4f_viewport",
+ extract_4f_viewport,
+ { insert_4f_viewport_1, insert_4f_viewport_2, insert_4f_viewport_3,
+ insert_4f_viewport_4 },
+ 4 * sizeof(GLfloat) },
+
+ { "3f_xyw",
+ extract_3f_xyw,
+ { insert_3f_xyw_err, insert_3f_xyw_err, insert_3f_xyw_err,
+ insert_3f_xyw_4 },
+ 3 * sizeof(GLfloat) },
+
+ { "1ub_1f",
+ extract_1ub_1f,
+ { insert_1ub_1f_1, insert_1ub_1f_1, insert_1ub_1f_1, insert_1ub_1f_1 },
+ sizeof(GLubyte) },
+
+ { "3ub_3f_rgb",
+ extract_3ub_3f_rgb,
+ { insert_3ub_3f_rgb_1, insert_3ub_3f_rgb_2, insert_3ub_3f_rgb_3,
+ insert_3ub_3f_rgb_3 },
+ 3 * sizeof(GLubyte) },
+
+ { "3ub_3f_bgr",
+ extract_3ub_3f_bgr,
+ { insert_3ub_3f_bgr_1, insert_3ub_3f_bgr_2, insert_3ub_3f_bgr_3,
+ insert_3ub_3f_bgr_3 },
+ 3 * sizeof(GLubyte) },
+
+ { "4ub_4f_rgba",
+ extract_4ub_4f_rgba,
+ { insert_4ub_4f_rgba_1, insert_4ub_4f_rgba_2, insert_4ub_4f_rgba_3,
+ insert_4ub_4f_rgba_4 },
+ 4 * sizeof(GLubyte) },
+
+ { "4ub_4f_bgra",
+ extract_4ub_4f_bgra,
+ { insert_4ub_4f_bgra_1, insert_4ub_4f_bgra_2, insert_4ub_4f_bgra_3,
+ insert_4ub_4f_bgra_4 },
+ 4 * sizeof(GLubyte) },
+
+ { "4ub_4f_argb",
+ extract_4ub_4f_argb,
+ { insert_4ub_4f_argb_1, insert_4ub_4f_argb_2, insert_4ub_4f_argb_3,
+ insert_4ub_4f_argb_4 },
+ 4 * sizeof(GLubyte) },
+
+ { "4ub_4f_abgr",
+ extract_4ub_4f_abgr,
+ { insert_4ub_4f_abgr_1, insert_4ub_4f_abgr_2, insert_4ub_4f_abgr_3,
+ insert_4ub_4f_abgr_4 },
+ 4 * sizeof(GLubyte) },
+
+ { "4chan_4f_rgba",
+ extract_4chan_4f_rgba,
+ { insert_4chan_4f_rgba_1, insert_4chan_4f_rgba_2, insert_4chan_4f_rgba_3,
+ insert_4chan_4f_rgba_4 },
+ 4 * sizeof(GLchan) },
+
+ { "pad",
+ NULL,
+ { NULL, NULL, NULL, NULL },
+ 0 }
+
+};
+
+
+
+
+/***********************************************************************
+ * Hardwired fastpaths for emitting whole vertices or groups of
+ * vertices
+ */
+#define EMIT5(NR, F0, F1, F2, F3, F4, NAME) \
+static void NAME( struct gl_context *ctx, \
+ GLuint count, \
+ GLubyte *v ) \
+{ \
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx); \
+ struct tnl_clipspace_attr *a = vtx->attr; \
+ GLuint i; \
+ \
+ for (i = 0 ; i < count ; i++, v += vtx->vertex_size) { \
+ if (NR > 0) { \
+ F0( &a[0], v + a[0].vertoffset, (GLfloat *)a[0].inputptr ); \
+ a[0].inputptr += a[0].inputstride; \
+ } \
+ \
+ if (NR > 1) { \
+ F1( &a[1], v + a[1].vertoffset, (GLfloat *)a[1].inputptr ); \
+ a[1].inputptr += a[1].inputstride; \
+ } \
+ \
+ if (NR > 2) { \
+ F2( &a[2], v + a[2].vertoffset, (GLfloat *)a[2].inputptr ); \
+ a[2].inputptr += a[2].inputstride; \
+ } \
+ \
+ if (NR > 3) { \
+ F3( &a[3], v + a[3].vertoffset, (GLfloat *)a[3].inputptr ); \
+ a[3].inputptr += a[3].inputstride; \
+ } \
+ \
+ if (NR > 4) { \
+ F4( &a[4], v + a[4].vertoffset, (GLfloat *)a[4].inputptr ); \
+ a[4].inputptr += a[4].inputstride; \
+ } \
+ } \
+}
+
+
+#define EMIT2(F0, F1, NAME) EMIT5(2, F0, F1, insert_null, \
+ insert_null, insert_null, NAME)
+
+#define EMIT3(F0, F1, F2, NAME) EMIT5(3, F0, F1, F2, insert_null, \
+ insert_null, NAME)
+
+#define EMIT4(F0, F1, F2, F3, NAME) EMIT5(4, F0, F1, F2, F3, \
+ insert_null, NAME)
+
+
+EMIT2(insert_3f_viewport_3, insert_4ub_4f_rgba_4, emit_viewport3_rgba4)
+EMIT2(insert_3f_viewport_3, insert_4ub_4f_bgra_4, emit_viewport3_bgra4)
+EMIT2(insert_3f_3, insert_4ub_4f_rgba_4, emit_xyz3_rgba4)
+
+EMIT3(insert_4f_viewport_4, insert_4ub_4f_rgba_4, insert_2f_2, emit_viewport4_rgba4_st2)
+EMIT3(insert_4f_viewport_4, insert_4ub_4f_bgra_4, insert_2f_2, emit_viewport4_bgra4_st2)
+EMIT3(insert_4f_4, insert_4ub_4f_rgba_4, insert_2f_2, emit_xyzw4_rgba4_st2)
+
+EMIT4(insert_4f_viewport_4, insert_4ub_4f_rgba_4, insert_2f_2, insert_2f_2, emit_viewport4_rgba4_st2_st2)
+EMIT4(insert_4f_viewport_4, insert_4ub_4f_bgra_4, insert_2f_2, insert_2f_2, emit_viewport4_bgra4_st2_st2)
+EMIT4(insert_4f_4, insert_4ub_4f_rgba_4, insert_2f_2, insert_2f_2, emit_xyzw4_rgba4_st2_st2)
+
+
+/* Use the codegen paths to select one of a number of hardwired
+ * fastpaths.
+ */
+void _tnl_generate_hardwired_emit( struct gl_context *ctx )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ tnl_emit_func func = NULL;
+
+ /* Does it fit a hardwired fastpath? Help! this is growing out of
+ * control!
+ */
+ switch (vtx->attr_count) {
+ case 2:
+ if (vtx->attr[0].emit == insert_3f_viewport_3) {
+ if (vtx->attr[1].emit == insert_4ub_4f_bgra_4)
+ func = emit_viewport3_bgra4;
+ else if (vtx->attr[1].emit == insert_4ub_4f_rgba_4)
+ func = emit_viewport3_rgba4;
+ }
+ else if (vtx->attr[0].emit == insert_3f_3 &&
+ vtx->attr[1].emit == insert_4ub_4f_rgba_4) {
+ func = emit_xyz3_rgba4;
+ }
+ break;
+ case 3:
+ if (vtx->attr[2].emit == insert_2f_2) {
+ if (vtx->attr[1].emit == insert_4ub_4f_rgba_4) {
+ if (vtx->attr[0].emit == insert_4f_viewport_4)
+ func = emit_viewport4_rgba4_st2;
+ else if (vtx->attr[0].emit == insert_4f_4)
+ func = emit_xyzw4_rgba4_st2;
+ }
+ else if (vtx->attr[1].emit == insert_4ub_4f_bgra_4 &&
+ vtx->attr[0].emit == insert_4f_viewport_4)
+ func = emit_viewport4_bgra4_st2;
+ }
+ break;
+ case 4:
+ if (vtx->attr[2].emit == insert_2f_2 &&
+ vtx->attr[3].emit == insert_2f_2) {
+ if (vtx->attr[1].emit == insert_4ub_4f_rgba_4) {
+ if (vtx->attr[0].emit == insert_4f_viewport_4)
+ func = emit_viewport4_rgba4_st2_st2;
+ else if (vtx->attr[0].emit == insert_4f_4)
+ func = emit_xyzw4_rgba4_st2_st2;
+ }
+ else if (vtx->attr[1].emit == insert_4ub_4f_bgra_4 &&
+ vtx->attr[0].emit == insert_4f_viewport_4)
+ func = emit_viewport4_bgra4_st2_st2;
+ }
+ break;
+ }
+
+ vtx->emit = func;
+}
+
+/***********************************************************************
+ * Generic (non-codegen) functions for whole vertices or groups of
+ * vertices
+ */
+
+void _tnl_generic_emit( struct gl_context *ctx,
+ GLuint count,
+ GLubyte *v )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ struct tnl_clipspace_attr *a = vtx->attr;
+ const GLuint attr_count = vtx->attr_count;
+ const GLuint stride = vtx->vertex_size;
+ GLuint i, j;
+
+ for (i = 0 ; i < count ; i++, v += stride) {
+ for (j = 0; j < attr_count; j++) {
+ GLfloat *in = (GLfloat *)a[j].inputptr;
+ a[j].inputptr += a[j].inputstride;
+ a[j].emit( &a[j], v + a[j].vertoffset, in );
+ }
+ }
+}
+
+
+void _tnl_generic_interp( struct gl_context *ctx,
+ GLfloat t,
+ GLuint edst, GLuint eout, GLuint ein,
+ GLboolean force_boundary )
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct vertex_buffer *VB = &tnl->vb;
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ const GLubyte *vin = vtx->vertex_buf + ein * vtx->vertex_size;
+ const GLubyte *vout = vtx->vertex_buf + eout * vtx->vertex_size;
+ GLubyte *vdst = vtx->vertex_buf + edst * vtx->vertex_size;
+ const struct tnl_clipspace_attr *a = vtx->attr;
+ const GLuint attr_count = vtx->attr_count;
+ GLuint j;
+ (void) force_boundary;
+
+ if (tnl->NeedNdcCoords) {
+ const GLfloat *dstclip = VB->ClipPtr->data[edst];
+ if (dstclip[3] != 0.0) {
+ const GLfloat w = 1.0f / dstclip[3];
+ GLfloat pos[4];
+
+ pos[0] = dstclip[0] * w;
+ pos[1] = dstclip[1] * w;
+ pos[2] = dstclip[2] * w;
+ pos[3] = w;
+
+ a[0].insert[4-1]( &a[0], vdst, pos );
+ }
+ }
+ else {
+ a[0].insert[4-1]( &a[0], vdst, VB->ClipPtr->data[edst] );
+ }
+
+
+ for (j = 1; j < attr_count; j++) {
+ GLfloat fin[4], fout[4], fdst[4];
+
+ a[j].extract( &a[j], fin, vin + a[j].vertoffset );
+ a[j].extract( &a[j], fout, vout + a[j].vertoffset );
+
+ INTERP_F( t, fdst[3], fout[3], fin[3] );
+ INTERP_F( t, fdst[2], fout[2], fin[2] );
+ INTERP_F( t, fdst[1], fout[1], fin[1] );
+ INTERP_F( t, fdst[0], fout[0], fin[0] );
+
+ a[j].insert[4-1]( &a[j], vdst + a[j].vertoffset, fdst );
+ }
+}
+
+
+/* Extract color attributes from one vertex and insert them into
+ * another. (Shortcircuit extract/insert with memcpy).
+ */
+void _tnl_generic_copy_pv( struct gl_context *ctx, GLuint edst, GLuint esrc )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ GLubyte *vsrc = vtx->vertex_buf + esrc * vtx->vertex_size;
+ GLubyte *vdst = vtx->vertex_buf + edst * vtx->vertex_size;
+ const struct tnl_clipspace_attr *a = vtx->attr;
+ const GLuint attr_count = vtx->attr_count;
+ GLuint j;
+
+ for (j = 0; j < attr_count; j++) {
+ if (a[j].attrib == VERT_ATTRIB_COLOR0 ||
+ a[j].attrib == VERT_ATTRIB_COLOR1) {
+
+ memcpy( vdst + a[j].vertoffset,
+ vsrc + a[j].vertoffset,
+ a[j].vertattrsize );
+ }
+ }
+}
+
+
+/* Helper functions for hardware which doesn't put back colors and/or
+ * edgeflags into vertices.
+ */
+void _tnl_generic_interp_extras( struct gl_context *ctx,
+ GLfloat t,
+ GLuint dst, GLuint out, GLuint in,
+ GLboolean force_boundary )
+{
+ struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
+
+ /* If stride is zero, BackfaceColorPtr is constant across the VB, so
+ * there is no point interpolating between two values as they will
+ * be identical. In all other cases, this value is generated by
+ * t_vb_lighttmp.h and has a stride of 4 dwords.
+ */
+ if (VB->BackfaceColorPtr && VB->BackfaceColorPtr->stride) {
+ assert(VB->BackfaceColorPtr->stride == 4 * sizeof(GLfloat));
+
+ INTERP_4F( t,
+ VB->BackfaceColorPtr->data[dst],
+ VB->BackfaceColorPtr->data[out],
+ VB->BackfaceColorPtr->data[in] );
+ }
+
+ if (VB->BackfaceSecondaryColorPtr) {
+ assert(VB->BackfaceSecondaryColorPtr->stride == 4 * sizeof(GLfloat));
+
+ INTERP_3F( t,
+ VB->BackfaceSecondaryColorPtr->data[dst],
+ VB->BackfaceSecondaryColorPtr->data[out],
+ VB->BackfaceSecondaryColorPtr->data[in] );
+ }
+
+ if (VB->BackfaceIndexPtr) {
+ VB->BackfaceIndexPtr->data[dst][0] = LINTERP( t,
+ VB->BackfaceIndexPtr->data[out][0],
+ VB->BackfaceIndexPtr->data[in][0] );
+ }
+
+ if (VB->EdgeFlag) {
+ VB->EdgeFlag[dst] = VB->EdgeFlag[out] || force_boundary;
+ }
+
+ _tnl_generic_interp(ctx, t, dst, out, in, force_boundary);
+}
+
+void _tnl_generic_copy_pv_extras( struct gl_context *ctx,
+ GLuint dst, GLuint src )
+{
+ struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
+
+ /* See above comment:
+ */
+ if (VB->BackfaceColorPtr && VB->BackfaceColorPtr->stride) {
+ COPY_4FV( VB->BackfaceColorPtr->data[dst],
+ VB->BackfaceColorPtr->data[src] );
+ }
+
+ if (VB->BackfaceSecondaryColorPtr) {
+ COPY_4FV( VB->BackfaceSecondaryColorPtr->data[dst],
+ VB->BackfaceSecondaryColorPtr->data[src] );
+ }
+
+ if (VB->BackfaceIndexPtr) {
+ VB->BackfaceIndexPtr->data[dst][0] = VB->BackfaceIndexPtr->data[src][0];
+ }
+
+ _tnl_generic_copy_pv(ctx, dst, src);
+}
+
+
diff --git a/mesalib/src/mesa/tnl/t_vertex_sse.c b/mesalib/src/mesa/tnl/t_vertex_sse.c
index f164cd77e..e0141c36f 100644
--- a/mesalib/src/mesa/tnl/t_vertex_sse.c
+++ b/mesalib/src/mesa/tnl/t_vertex_sse.c
@@ -1,684 +1,685 @@
-/*
- * Copyright 2003 Tungsten Graphics, inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- * Keith Whitwell <keithw@tungstengraphics.com>
- */
-
-#include "main/glheader.h"
-#include "main/context.h"
-#include "main/colormac.h"
-#include "main/simple_list.h"
-#include "main/enums.h"
-#include "t_context.h"
-#include "t_vertex.h"
-
-#if defined(USE_SSE_ASM)
-
-#include "x86/rtasm/x86sse.h"
-#include "x86/common_x86_asm.h"
-
-
-/**
- * Number of bytes to allocate for generated SSE functions
- */
-#define MAX_SSE_CODE_SIZE 1024
-
-
-#define X 0
-#define Y 1
-#define Z 2
-#define W 3
-
-
-struct x86_program {
- struct x86_function func;
-
- struct gl_context *ctx;
- GLboolean inputs_safe;
- GLboolean outputs_safe;
- GLboolean have_sse2;
-
- struct x86_reg identity;
- struct x86_reg chan0;
-};
-
-
-static struct x86_reg get_identity( struct x86_program *p )
-{
- return p->identity;
-}
-
-static void emit_load4f_4( struct x86_program *p,
- struct x86_reg dest,
- struct x86_reg arg0 )
-{
- sse_movups(&p->func, dest, arg0);
-}
-
-static void emit_load4f_3( struct x86_program *p,
- struct x86_reg dest,
- struct x86_reg arg0 )
-{
- /* Have to jump through some hoops:
- *
- * c 0 0 0
- * c 0 0 1
- * 0 0 c 1
- * a b c 1
- */
- sse_movss(&p->func, dest, x86_make_disp(arg0, 8));
- sse_shufps(&p->func, dest, get_identity(p), SHUF(X,Y,Z,W) );
- sse_shufps(&p->func, dest, dest, SHUF(Y,Z,X,W) );
- sse_movlps(&p->func, dest, arg0);
-}
-
-static void emit_load4f_2( struct x86_program *p,
- struct x86_reg dest,
- struct x86_reg arg0 )
-{
- /* Initialize from identity, then pull in low two words:
- */
- sse_movups(&p->func, dest, get_identity(p));
- sse_movlps(&p->func, dest, arg0);
-}
-
-static void emit_load4f_1( struct x86_program *p,
- struct x86_reg dest,
- struct x86_reg arg0 )
-{
- /* Pull in low word, then swizzle in identity */
- sse_movss(&p->func, dest, arg0);
- sse_shufps(&p->func, dest, get_identity(p), SHUF(X,Y,Z,W) );
-}
-
-
-
-static void emit_load3f_3( struct x86_program *p,
- struct x86_reg dest,
- struct x86_reg arg0 )
-{
- /* Over-reads by 1 dword - potential SEGV if input is a vertex
- * array.
- */
- if (p->inputs_safe) {
- sse_movups(&p->func, dest, arg0);
- }
- else {
- /* c 0 0 0
- * c c c c
- * a b c c
- */
- sse_movss(&p->func, dest, x86_make_disp(arg0, 8));
- sse_shufps(&p->func, dest, dest, SHUF(X,X,X,X));
- sse_movlps(&p->func, dest, arg0);
- }
-}
-
-static void emit_load3f_2( struct x86_program *p,
- struct x86_reg dest,
- struct x86_reg arg0 )
-{
- emit_load4f_2(p, dest, arg0);
-}
-
-static void emit_load3f_1( struct x86_program *p,
- struct x86_reg dest,
- struct x86_reg arg0 )
-{
- /* Loading from memory erases the upper bits. */
- sse_movss(&p->func, dest, arg0);
-}
-
-static void emit_load2f_2( struct x86_program *p,
- struct x86_reg dest,
- struct x86_reg arg0 )
-{
- sse_movlps(&p->func, dest, arg0);
-}
-
-static void emit_load2f_1( struct x86_program *p,
- struct x86_reg dest,
- struct x86_reg arg0 )
-{
- /* Loading from memory erases the upper bits. */
- sse_movss(&p->func, dest, arg0);
-}
-
-static void emit_load1f_1( struct x86_program *p,
- struct x86_reg dest,
- struct x86_reg arg0 )
-{
- sse_movss(&p->func, dest, arg0);
-}
-
-static void (*load[4][4])( struct x86_program *p,
- struct x86_reg dest,
- struct x86_reg arg0 ) = {
- { emit_load1f_1,
- emit_load1f_1,
- emit_load1f_1,
- emit_load1f_1 },
-
- { emit_load2f_1,
- emit_load2f_2,
- emit_load2f_2,
- emit_load2f_2 },
-
- { emit_load3f_1,
- emit_load3f_2,
- emit_load3f_3,
- emit_load3f_3 },
-
- { emit_load4f_1,
- emit_load4f_2,
- emit_load4f_3,
- emit_load4f_4 }
-};
-
-static void emit_load( struct x86_program *p,
- struct x86_reg dest,
- GLuint sz,
- struct x86_reg src,
- GLuint src_sz)
-{
- load[sz-1][src_sz-1](p, dest, src);
-}
-
-static void emit_store4f( struct x86_program *p,
- struct x86_reg dest,
- struct x86_reg arg0 )
-{
- sse_movups(&p->func, dest, arg0);
-}
-
-static void emit_store3f( struct x86_program *p,
- struct x86_reg dest,
- struct x86_reg arg0 )
-{
- if (p->outputs_safe) {
- /* Emit the extra dword anyway. This may hurt writecombining,
- * may cause other problems.
- */
- sse_movups(&p->func, dest, arg0);
- }
- else {
- /* Alternate strategy - emit two, shuffle, emit one.
- */
- sse_movlps(&p->func, dest, arg0);
- sse_shufps(&p->func, arg0, arg0, SHUF(Z,Z,Z,Z) ); /* NOTE! destructive */
- sse_movss(&p->func, x86_make_disp(dest,8), arg0);
- }
-}
-
-static void emit_store2f( struct x86_program *p,
- struct x86_reg dest,
- struct x86_reg arg0 )
-{
- sse_movlps(&p->func, dest, arg0);
-}
-
-static void emit_store1f( struct x86_program *p,
- struct x86_reg dest,
- struct x86_reg arg0 )
-{
- sse_movss(&p->func, dest, arg0);
-}
-
-
-static void (*store[4])( struct x86_program *p,
- struct x86_reg dest,
- struct x86_reg arg0 ) =
-{
- emit_store1f,
- emit_store2f,
- emit_store3f,
- emit_store4f
-};
-
-static void emit_store( struct x86_program *p,
- struct x86_reg dest,
- GLuint sz,
- struct x86_reg temp )
-
-{
- store[sz-1](p, dest, temp);
-}
-
-static void emit_pack_store_4ub( struct x86_program *p,
- struct x86_reg dest,
- struct x86_reg temp )
-{
- /* Scale by 255.0
- */
- sse_mulps(&p->func, temp, p->chan0);
-
- if (p->have_sse2) {
- sse2_cvtps2dq(&p->func, temp, temp);
- sse2_packssdw(&p->func, temp, temp);
- sse2_packuswb(&p->func, temp, temp);
- sse_movss(&p->func, dest, temp);
- }
- else {
- struct x86_reg mmx0 = x86_make_reg(file_MMX, 0);
- struct x86_reg mmx1 = x86_make_reg(file_MMX, 1);
- sse_cvtps2pi(&p->func, mmx0, temp);
- sse_movhlps(&p->func, temp, temp);
- sse_cvtps2pi(&p->func, mmx1, temp);
- mmx_packssdw(&p->func, mmx0, mmx1);
- mmx_packuswb(&p->func, mmx0, mmx0);
- mmx_movd(&p->func, dest, mmx0);
- }
-}
-
-static GLint get_offset( const void *a, const void *b )
-{
- return (const char *)b - (const char *)a;
-}
-
-/* Not much happens here. Eventually use this function to try and
- * avoid saving/reloading the source pointers each vertex (if some of
- * them can fit in registers).
- */
-static void get_src_ptr( struct x86_program *p,
- struct x86_reg srcREG,
- struct x86_reg vtxREG,
- struct tnl_clipspace_attr *a )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(p->ctx);
- struct x86_reg ptr_to_src = x86_make_disp(vtxREG, get_offset(vtx, &a->inputptr));
-
- /* Load current a[j].inputptr
- */
- x86_mov(&p->func, srcREG, ptr_to_src);
-}
-
-static void update_src_ptr( struct x86_program *p,
- struct x86_reg srcREG,
- struct x86_reg vtxREG,
- struct tnl_clipspace_attr *a )
-{
- if (a->inputstride) {
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(p->ctx);
- struct x86_reg ptr_to_src = x86_make_disp(vtxREG, get_offset(vtx, &a->inputptr));
-
- /* add a[j].inputstride (hardcoded value - could just as easily
- * pull the stride value from memory each time).
- */
- x86_lea(&p->func, srcREG, x86_make_disp(srcREG, a->inputstride));
-
- /* save new value of a[j].inputptr
- */
- x86_mov(&p->func, ptr_to_src, srcREG);
- }
-}
-
-
-/* Lots of hardcoding
- *
- * EAX -- pointer to current output vertex
- * ECX -- pointer to current attribute
- *
- */
-static GLboolean build_vertex_emit( struct x86_program *p )
-{
- struct gl_context *ctx = p->ctx;
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- GLuint j = 0;
-
- struct x86_reg vertexEAX = x86_make_reg(file_REG32, reg_AX);
- struct x86_reg srcECX = x86_make_reg(file_REG32, reg_CX);
- struct x86_reg countEBP = x86_make_reg(file_REG32, reg_BP);
- struct x86_reg vtxESI = x86_make_reg(file_REG32, reg_SI);
- struct x86_reg temp = x86_make_reg(file_XMM, 0);
- struct x86_reg vp0 = x86_make_reg(file_XMM, 1);
- struct x86_reg vp1 = x86_make_reg(file_XMM, 2);
- struct x86_reg temp2 = x86_make_reg(file_XMM, 3);
- GLubyte *fixup, *label;
-
- /* Push a few regs?
- */
- x86_push(&p->func, countEBP);
- x86_push(&p->func, vtxESI);
-
-
- /* Get vertex count, compare to zero
- */
- x86_xor(&p->func, srcECX, srcECX);
- x86_mov(&p->func, countEBP, x86_fn_arg(&p->func, 2));
- x86_cmp(&p->func, countEBP, srcECX);
- fixup = x86_jcc_forward(&p->func, cc_E);
-
- /* Initialize destination register.
- */
- x86_mov(&p->func, vertexEAX, x86_fn_arg(&p->func, 3));
-
- /* Dereference ctx to get tnl, then vtx:
- */
- x86_mov(&p->func, vtxESI, x86_fn_arg(&p->func, 1));
- x86_mov(&p->func, vtxESI, x86_make_disp(vtxESI, get_offset(ctx, &ctx->swtnl_context)));
- vtxESI = x86_make_disp(vtxESI, get_offset(tnl, &tnl->clipspace));
-
-
- /* Possibly load vp0, vp1 for viewport calcs:
- */
- if (vtx->need_viewport) {
- sse_movups(&p->func, vp0, x86_make_disp(vtxESI, get_offset(vtx, &vtx->vp_scale[0])));
- sse_movups(&p->func, vp1, x86_make_disp(vtxESI, get_offset(vtx, &vtx->vp_xlate[0])));
- }
-
- /* always load, needed or not:
- */
- sse_movups(&p->func, p->chan0, x86_make_disp(vtxESI, get_offset(vtx, &vtx->chan_scale[0])));
- sse_movups(&p->func, p->identity, x86_make_disp(vtxESI, get_offset(vtx, &vtx->identity[0])));
-
- /* Note address for loop jump */
- label = x86_get_label(&p->func);
-
- /* Emit code for each of the attributes. Currently routes
- * everything through SSE registers, even when it might be more
- * efficient to stick with regular old x86. No optimization or
- * other tricks - enough new ground to cover here just getting
- * things working.
- */
- while (j < vtx->attr_count) {
- struct tnl_clipspace_attr *a = &vtx->attr[j];
- struct x86_reg dest = x86_make_disp(vertexEAX, a->vertoffset);
-
- /* Now, load an XMM reg from src, perhaps transform, then save.
- * Could be shortcircuited in specific cases:
- */
- switch (a->format) {
- case EMIT_1F:
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 1, x86_deref(srcECX), a->inputsize);
- emit_store(p, dest, 1, temp);
- update_src_ptr(p, srcECX, vtxESI, a);
- break;
- case EMIT_2F:
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 2, x86_deref(srcECX), a->inputsize);
- emit_store(p, dest, 2, temp);
- update_src_ptr(p, srcECX, vtxESI, a);
- break;
- case EMIT_3F:
- /* Potentially the worst case - hardcode 2+1 copying:
- */
- if (0) {
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 3, x86_deref(srcECX), a->inputsize);
- emit_store(p, dest, 3, temp);
- update_src_ptr(p, srcECX, vtxESI, a);
- }
- else {
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 2, x86_deref(srcECX), a->inputsize);
- emit_store(p, dest, 2, temp);
- if (a->inputsize > 2) {
- emit_load(p, temp, 1, x86_make_disp(srcECX, 8), 1);
- emit_store(p, x86_make_disp(dest,8), 1, temp);
- }
- else {
- sse_movss(&p->func, x86_make_disp(dest,8), get_identity(p));
- }
- update_src_ptr(p, srcECX, vtxESI, a);
- }
- break;
- case EMIT_4F:
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
- emit_store(p, dest, 4, temp);
- update_src_ptr(p, srcECX, vtxESI, a);
- break;
- case EMIT_2F_VIEWPORT:
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 2, x86_deref(srcECX), a->inputsize);
- sse_mulps(&p->func, temp, vp0);
- sse_addps(&p->func, temp, vp1);
- emit_store(p, dest, 2, temp);
- update_src_ptr(p, srcECX, vtxESI, a);
- break;
- case EMIT_3F_VIEWPORT:
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 3, x86_deref(srcECX), a->inputsize);
- sse_mulps(&p->func, temp, vp0);
- sse_addps(&p->func, temp, vp1);
- emit_store(p, dest, 3, temp);
- update_src_ptr(p, srcECX, vtxESI, a);
- break;
- case EMIT_4F_VIEWPORT:
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
- sse_mulps(&p->func, temp, vp0);
- sse_addps(&p->func, temp, vp1);
- emit_store(p, dest, 4, temp);
- update_src_ptr(p, srcECX, vtxESI, a);
- break;
- case EMIT_3F_XYW:
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
- sse_shufps(&p->func, temp, temp, SHUF(X,Y,W,Z));
- emit_store(p, dest, 3, temp);
- update_src_ptr(p, srcECX, vtxESI, a);
- break;
-
- case EMIT_1UB_1F:
- /* Test for PAD3 + 1UB:
- */
- if (j > 0 &&
- a[-1].vertoffset + a[-1].vertattrsize <= a->vertoffset - 3)
- {
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 1, x86_deref(srcECX), a->inputsize);
- sse_shufps(&p->func, temp, temp, SHUF(X,X,X,X));
- emit_pack_store_4ub(p, x86_make_disp(dest, -3), temp); /* overkill! */
- update_src_ptr(p, srcECX, vtxESI, a);
- }
- else {
- printf("Can't emit 1ub %x %x %d\n", a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize );
- return GL_FALSE;
- }
- break;
- case EMIT_3UB_3F_RGB:
- case EMIT_3UB_3F_BGR:
- /* Test for 3UB + PAD1:
- */
- if (j == vtx->attr_count - 1 ||
- a[1].vertoffset >= a->vertoffset + 4) {
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 3, x86_deref(srcECX), a->inputsize);
- if (a->format == EMIT_3UB_3F_BGR)
- sse_shufps(&p->func, temp, temp, SHUF(Z,Y,X,W));
- emit_pack_store_4ub(p, dest, temp);
- update_src_ptr(p, srcECX, vtxESI, a);
- }
- /* Test for 3UB + 1UB:
- */
- else if (j < vtx->attr_count - 1 &&
- a[1].format == EMIT_1UB_1F &&
- a[1].vertoffset == a->vertoffset + 3) {
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 3, x86_deref(srcECX), a->inputsize);
- update_src_ptr(p, srcECX, vtxESI, a);
-
- /* Make room for incoming value:
- */
- sse_shufps(&p->func, temp, temp, SHUF(W,X,Y,Z));
-
- get_src_ptr(p, srcECX, vtxESI, &a[1]);
- emit_load(p, temp2, 1, x86_deref(srcECX), a[1].inputsize);
- sse_movss(&p->func, temp, temp2);
- update_src_ptr(p, srcECX, vtxESI, &a[1]);
-
- /* Rearrange and possibly do BGR conversion:
- */
- if (a->format == EMIT_3UB_3F_BGR)
- sse_shufps(&p->func, temp, temp, SHUF(W,Z,Y,X));
- else
- sse_shufps(&p->func, temp, temp, SHUF(Y,Z,W,X));
-
- emit_pack_store_4ub(p, dest, temp);
- j++; /* NOTE: two attrs consumed */
- }
- else {
- printf("Can't emit 3ub\n");
- return GL_FALSE; /* add this later */
- }
- break;
-
- case EMIT_4UB_4F_RGBA:
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
- emit_pack_store_4ub(p, dest, temp);
- update_src_ptr(p, srcECX, vtxESI, a);
- break;
- case EMIT_4UB_4F_BGRA:
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
- sse_shufps(&p->func, temp, temp, SHUF(Z,Y,X,W));
- emit_pack_store_4ub(p, dest, temp);
- update_src_ptr(p, srcECX, vtxESI, a);
- break;
- case EMIT_4UB_4F_ARGB:
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
- sse_shufps(&p->func, temp, temp, SHUF(W,X,Y,Z));
- emit_pack_store_4ub(p, dest, temp);
- update_src_ptr(p, srcECX, vtxESI, a);
- break;
- case EMIT_4UB_4F_ABGR:
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
- sse_shufps(&p->func, temp, temp, SHUF(W,Z,Y,X));
- emit_pack_store_4ub(p, dest, temp);
- update_src_ptr(p, srcECX, vtxESI, a);
- break;
- case EMIT_4CHAN_4F_RGBA:
- switch (CHAN_TYPE) {
- case GL_UNSIGNED_BYTE:
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
- emit_pack_store_4ub(p, dest, temp);
- update_src_ptr(p, srcECX, vtxESI, a);
- break;
- case GL_FLOAT:
- get_src_ptr(p, srcECX, vtxESI, a);
- emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
- emit_store(p, dest, 4, temp);
- update_src_ptr(p, srcECX, vtxESI, a);
- break;
- case GL_UNSIGNED_SHORT:
- default:
- printf("unknown CHAN_TYPE %s\n", _mesa_lookup_enum_by_nr(CHAN_TYPE));
- return GL_FALSE;
- }
- break;
- default:
- printf("unknown a[%d].format %d\n", j, a->format);
- return GL_FALSE; /* catch any new opcodes */
- }
-
- /* Increment j by at least 1 - may have been incremented above also:
- */
- j++;
- }
-
- /* Next vertex:
- */
- x86_lea(&p->func, vertexEAX, x86_make_disp(vertexEAX, vtx->vertex_size));
-
- /* decr count, loop if not zero
- */
- x86_dec(&p->func, countEBP);
- x86_test(&p->func, countEBP, countEBP);
- x86_jcc(&p->func, cc_NZ, label);
-
- /* Exit mmx state?
- */
- if (p->func.need_emms)
- mmx_emms(&p->func);
-
- /* Land forward jump here:
- */
- x86_fixup_fwd_jump(&p->func, fixup);
-
- /* Pop regs and return
- */
- x86_pop(&p->func, x86_get_base_reg(vtxESI));
- x86_pop(&p->func, countEBP);
- x86_ret(&p->func);
-
- assert(!vtx->emit);
- vtx->emit = (tnl_emit_func)x86_get_func(&p->func);
-
- assert( (char *) p->func.csr - (char *) p->func.store <= MAX_SSE_CODE_SIZE );
- return GL_TRUE;
-}
-
-
-
-void _tnl_generate_sse_emit( struct gl_context *ctx )
-{
- struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
- struct x86_program p;
-
- if (!cpu_has_xmm) {
- vtx->codegen_emit = NULL;
- return;
- }
-
- memset(&p, 0, sizeof(p));
-
- p.ctx = ctx;
- p.inputs_safe = 0; /* for now */
- p.outputs_safe = 0; /* for now */
- p.have_sse2 = cpu_has_xmm2;
- p.identity = x86_make_reg(file_XMM, 6);
- p.chan0 = x86_make_reg(file_XMM, 7);
-
- if (!x86_init_func_size(&p.func, MAX_SSE_CODE_SIZE)) {
- vtx->emit = NULL;
- return;
- }
-
- if (build_vertex_emit(&p)) {
- _tnl_register_fastpath( vtx, GL_TRUE );
- }
- else {
- /* Note the failure so that we don't keep trying to codegen an
- * impossible state:
- */
- _tnl_register_fastpath( vtx, GL_FALSE );
- x86_release_func(&p.func);
- }
-}
-
-#else
-
-void _tnl_generate_sse_emit( struct gl_context *ctx )
-{
- /* Dummy version for when USE_SSE_ASM not defined */
-}
-
-#endif
+/*
+ * Copyright 2003 Tungsten Graphics, inc.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * on the rights to use, copy, modify, merge, publish, distribute, sub
+ * license, and/or sell copies of the Software, and to permit persons to whom
+ * the Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * TUNGSTEN GRAPHICS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+ * USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Keith Whitwell <keithw@tungstengraphics.com>
+ */
+
+#include "main/glheader.h"
+#include "main/context.h"
+#include "main/colormac.h"
+#include "main/simple_list.h"
+#include "main/enums.h"
+#include "swrast/s_chan.h"
+#include "t_context.h"
+#include "t_vertex.h"
+
+#if defined(USE_SSE_ASM)
+
+#include "x86/rtasm/x86sse.h"
+#include "x86/common_x86_asm.h"
+
+
+/**
+ * Number of bytes to allocate for generated SSE functions
+ */
+#define MAX_SSE_CODE_SIZE 1024
+
+
+#define X 0
+#define Y 1
+#define Z 2
+#define W 3
+
+
+struct x86_program {
+ struct x86_function func;
+
+ struct gl_context *ctx;
+ GLboolean inputs_safe;
+ GLboolean outputs_safe;
+ GLboolean have_sse2;
+
+ struct x86_reg identity;
+ struct x86_reg chan0;
+};
+
+
+static struct x86_reg get_identity( struct x86_program *p )
+{
+ return p->identity;
+}
+
+static void emit_load4f_4( struct x86_program *p,
+ struct x86_reg dest,
+ struct x86_reg arg0 )
+{
+ sse_movups(&p->func, dest, arg0);
+}
+
+static void emit_load4f_3( struct x86_program *p,
+ struct x86_reg dest,
+ struct x86_reg arg0 )
+{
+ /* Have to jump through some hoops:
+ *
+ * c 0 0 0
+ * c 0 0 1
+ * 0 0 c 1
+ * a b c 1
+ */
+ sse_movss(&p->func, dest, x86_make_disp(arg0, 8));
+ sse_shufps(&p->func, dest, get_identity(p), SHUF(X,Y,Z,W) );
+ sse_shufps(&p->func, dest, dest, SHUF(Y,Z,X,W) );
+ sse_movlps(&p->func, dest, arg0);
+}
+
+static void emit_load4f_2( struct x86_program *p,
+ struct x86_reg dest,
+ struct x86_reg arg0 )
+{
+ /* Initialize from identity, then pull in low two words:
+ */
+ sse_movups(&p->func, dest, get_identity(p));
+ sse_movlps(&p->func, dest, arg0);
+}
+
+static void emit_load4f_1( struct x86_program *p,
+ struct x86_reg dest,
+ struct x86_reg arg0 )
+{
+ /* Pull in low word, then swizzle in identity */
+ sse_movss(&p->func, dest, arg0);
+ sse_shufps(&p->func, dest, get_identity(p), SHUF(X,Y,Z,W) );
+}
+
+
+
+static void emit_load3f_3( struct x86_program *p,
+ struct x86_reg dest,
+ struct x86_reg arg0 )
+{
+ /* Over-reads by 1 dword - potential SEGV if input is a vertex
+ * array.
+ */
+ if (p->inputs_safe) {
+ sse_movups(&p->func, dest, arg0);
+ }
+ else {
+ /* c 0 0 0
+ * c c c c
+ * a b c c
+ */
+ sse_movss(&p->func, dest, x86_make_disp(arg0, 8));
+ sse_shufps(&p->func, dest, dest, SHUF(X,X,X,X));
+ sse_movlps(&p->func, dest, arg0);
+ }
+}
+
+static void emit_load3f_2( struct x86_program *p,
+ struct x86_reg dest,
+ struct x86_reg arg0 )
+{
+ emit_load4f_2(p, dest, arg0);
+}
+
+static void emit_load3f_1( struct x86_program *p,
+ struct x86_reg dest,
+ struct x86_reg arg0 )
+{
+ /* Loading from memory erases the upper bits. */
+ sse_movss(&p->func, dest, arg0);
+}
+
+static void emit_load2f_2( struct x86_program *p,
+ struct x86_reg dest,
+ struct x86_reg arg0 )
+{
+ sse_movlps(&p->func, dest, arg0);
+}
+
+static void emit_load2f_1( struct x86_program *p,
+ struct x86_reg dest,
+ struct x86_reg arg0 )
+{
+ /* Loading from memory erases the upper bits. */
+ sse_movss(&p->func, dest, arg0);
+}
+
+static void emit_load1f_1( struct x86_program *p,
+ struct x86_reg dest,
+ struct x86_reg arg0 )
+{
+ sse_movss(&p->func, dest, arg0);
+}
+
+static void (*load[4][4])( struct x86_program *p,
+ struct x86_reg dest,
+ struct x86_reg arg0 ) = {
+ { emit_load1f_1,
+ emit_load1f_1,
+ emit_load1f_1,
+ emit_load1f_1 },
+
+ { emit_load2f_1,
+ emit_load2f_2,
+ emit_load2f_2,
+ emit_load2f_2 },
+
+ { emit_load3f_1,
+ emit_load3f_2,
+ emit_load3f_3,
+ emit_load3f_3 },
+
+ { emit_load4f_1,
+ emit_load4f_2,
+ emit_load4f_3,
+ emit_load4f_4 }
+};
+
+static void emit_load( struct x86_program *p,
+ struct x86_reg dest,
+ GLuint sz,
+ struct x86_reg src,
+ GLuint src_sz)
+{
+ load[sz-1][src_sz-1](p, dest, src);
+}
+
+static void emit_store4f( struct x86_program *p,
+ struct x86_reg dest,
+ struct x86_reg arg0 )
+{
+ sse_movups(&p->func, dest, arg0);
+}
+
+static void emit_store3f( struct x86_program *p,
+ struct x86_reg dest,
+ struct x86_reg arg0 )
+{
+ if (p->outputs_safe) {
+ /* Emit the extra dword anyway. This may hurt writecombining,
+ * may cause other problems.
+ */
+ sse_movups(&p->func, dest, arg0);
+ }
+ else {
+ /* Alternate strategy - emit two, shuffle, emit one.
+ */
+ sse_movlps(&p->func, dest, arg0);
+ sse_shufps(&p->func, arg0, arg0, SHUF(Z,Z,Z,Z) ); /* NOTE! destructive */
+ sse_movss(&p->func, x86_make_disp(dest,8), arg0);
+ }
+}
+
+static void emit_store2f( struct x86_program *p,
+ struct x86_reg dest,
+ struct x86_reg arg0 )
+{
+ sse_movlps(&p->func, dest, arg0);
+}
+
+static void emit_store1f( struct x86_program *p,
+ struct x86_reg dest,
+ struct x86_reg arg0 )
+{
+ sse_movss(&p->func, dest, arg0);
+}
+
+
+static void (*store[4])( struct x86_program *p,
+ struct x86_reg dest,
+ struct x86_reg arg0 ) =
+{
+ emit_store1f,
+ emit_store2f,
+ emit_store3f,
+ emit_store4f
+};
+
+static void emit_store( struct x86_program *p,
+ struct x86_reg dest,
+ GLuint sz,
+ struct x86_reg temp )
+
+{
+ store[sz-1](p, dest, temp);
+}
+
+static void emit_pack_store_4ub( struct x86_program *p,
+ struct x86_reg dest,
+ struct x86_reg temp )
+{
+ /* Scale by 255.0
+ */
+ sse_mulps(&p->func, temp, p->chan0);
+
+ if (p->have_sse2) {
+ sse2_cvtps2dq(&p->func, temp, temp);
+ sse2_packssdw(&p->func, temp, temp);
+ sse2_packuswb(&p->func, temp, temp);
+ sse_movss(&p->func, dest, temp);
+ }
+ else {
+ struct x86_reg mmx0 = x86_make_reg(file_MMX, 0);
+ struct x86_reg mmx1 = x86_make_reg(file_MMX, 1);
+ sse_cvtps2pi(&p->func, mmx0, temp);
+ sse_movhlps(&p->func, temp, temp);
+ sse_cvtps2pi(&p->func, mmx1, temp);
+ mmx_packssdw(&p->func, mmx0, mmx1);
+ mmx_packuswb(&p->func, mmx0, mmx0);
+ mmx_movd(&p->func, dest, mmx0);
+ }
+}
+
+static GLint get_offset( const void *a, const void *b )
+{
+ return (const char *)b - (const char *)a;
+}
+
+/* Not much happens here. Eventually use this function to try and
+ * avoid saving/reloading the source pointers each vertex (if some of
+ * them can fit in registers).
+ */
+static void get_src_ptr( struct x86_program *p,
+ struct x86_reg srcREG,
+ struct x86_reg vtxREG,
+ struct tnl_clipspace_attr *a )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(p->ctx);
+ struct x86_reg ptr_to_src = x86_make_disp(vtxREG, get_offset(vtx, &a->inputptr));
+
+ /* Load current a[j].inputptr
+ */
+ x86_mov(&p->func, srcREG, ptr_to_src);
+}
+
+static void update_src_ptr( struct x86_program *p,
+ struct x86_reg srcREG,
+ struct x86_reg vtxREG,
+ struct tnl_clipspace_attr *a )
+{
+ if (a->inputstride) {
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(p->ctx);
+ struct x86_reg ptr_to_src = x86_make_disp(vtxREG, get_offset(vtx, &a->inputptr));
+
+ /* add a[j].inputstride (hardcoded value - could just as easily
+ * pull the stride value from memory each time).
+ */
+ x86_lea(&p->func, srcREG, x86_make_disp(srcREG, a->inputstride));
+
+ /* save new value of a[j].inputptr
+ */
+ x86_mov(&p->func, ptr_to_src, srcREG);
+ }
+}
+
+
+/* Lots of hardcoding
+ *
+ * EAX -- pointer to current output vertex
+ * ECX -- pointer to current attribute
+ *
+ */
+static GLboolean build_vertex_emit( struct x86_program *p )
+{
+ struct gl_context *ctx = p->ctx;
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ GLuint j = 0;
+
+ struct x86_reg vertexEAX = x86_make_reg(file_REG32, reg_AX);
+ struct x86_reg srcECX = x86_make_reg(file_REG32, reg_CX);
+ struct x86_reg countEBP = x86_make_reg(file_REG32, reg_BP);
+ struct x86_reg vtxESI = x86_make_reg(file_REG32, reg_SI);
+ struct x86_reg temp = x86_make_reg(file_XMM, 0);
+ struct x86_reg vp0 = x86_make_reg(file_XMM, 1);
+ struct x86_reg vp1 = x86_make_reg(file_XMM, 2);
+ struct x86_reg temp2 = x86_make_reg(file_XMM, 3);
+ GLubyte *fixup, *label;
+
+ /* Push a few regs?
+ */
+ x86_push(&p->func, countEBP);
+ x86_push(&p->func, vtxESI);
+
+
+ /* Get vertex count, compare to zero
+ */
+ x86_xor(&p->func, srcECX, srcECX);
+ x86_mov(&p->func, countEBP, x86_fn_arg(&p->func, 2));
+ x86_cmp(&p->func, countEBP, srcECX);
+ fixup = x86_jcc_forward(&p->func, cc_E);
+
+ /* Initialize destination register.
+ */
+ x86_mov(&p->func, vertexEAX, x86_fn_arg(&p->func, 3));
+
+ /* Dereference ctx to get tnl, then vtx:
+ */
+ x86_mov(&p->func, vtxESI, x86_fn_arg(&p->func, 1));
+ x86_mov(&p->func, vtxESI, x86_make_disp(vtxESI, get_offset(ctx, &ctx->swtnl_context)));
+ vtxESI = x86_make_disp(vtxESI, get_offset(tnl, &tnl->clipspace));
+
+
+ /* Possibly load vp0, vp1 for viewport calcs:
+ */
+ if (vtx->need_viewport) {
+ sse_movups(&p->func, vp0, x86_make_disp(vtxESI, get_offset(vtx, &vtx->vp_scale[0])));
+ sse_movups(&p->func, vp1, x86_make_disp(vtxESI, get_offset(vtx, &vtx->vp_xlate[0])));
+ }
+
+ /* always load, needed or not:
+ */
+ sse_movups(&p->func, p->chan0, x86_make_disp(vtxESI, get_offset(vtx, &vtx->chan_scale[0])));
+ sse_movups(&p->func, p->identity, x86_make_disp(vtxESI, get_offset(vtx, &vtx->identity[0])));
+
+ /* Note address for loop jump */
+ label = x86_get_label(&p->func);
+
+ /* Emit code for each of the attributes. Currently routes
+ * everything through SSE registers, even when it might be more
+ * efficient to stick with regular old x86. No optimization or
+ * other tricks - enough new ground to cover here just getting
+ * things working.
+ */
+ while (j < vtx->attr_count) {
+ struct tnl_clipspace_attr *a = &vtx->attr[j];
+ struct x86_reg dest = x86_make_disp(vertexEAX, a->vertoffset);
+
+ /* Now, load an XMM reg from src, perhaps transform, then save.
+ * Could be shortcircuited in specific cases:
+ */
+ switch (a->format) {
+ case EMIT_1F:
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 1, x86_deref(srcECX), a->inputsize);
+ emit_store(p, dest, 1, temp);
+ update_src_ptr(p, srcECX, vtxESI, a);
+ break;
+ case EMIT_2F:
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 2, x86_deref(srcECX), a->inputsize);
+ emit_store(p, dest, 2, temp);
+ update_src_ptr(p, srcECX, vtxESI, a);
+ break;
+ case EMIT_3F:
+ /* Potentially the worst case - hardcode 2+1 copying:
+ */
+ if (0) {
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 3, x86_deref(srcECX), a->inputsize);
+ emit_store(p, dest, 3, temp);
+ update_src_ptr(p, srcECX, vtxESI, a);
+ }
+ else {
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 2, x86_deref(srcECX), a->inputsize);
+ emit_store(p, dest, 2, temp);
+ if (a->inputsize > 2) {
+ emit_load(p, temp, 1, x86_make_disp(srcECX, 8), 1);
+ emit_store(p, x86_make_disp(dest,8), 1, temp);
+ }
+ else {
+ sse_movss(&p->func, x86_make_disp(dest,8), get_identity(p));
+ }
+ update_src_ptr(p, srcECX, vtxESI, a);
+ }
+ break;
+ case EMIT_4F:
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
+ emit_store(p, dest, 4, temp);
+ update_src_ptr(p, srcECX, vtxESI, a);
+ break;
+ case EMIT_2F_VIEWPORT:
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 2, x86_deref(srcECX), a->inputsize);
+ sse_mulps(&p->func, temp, vp0);
+ sse_addps(&p->func, temp, vp1);
+ emit_store(p, dest, 2, temp);
+ update_src_ptr(p, srcECX, vtxESI, a);
+ break;
+ case EMIT_3F_VIEWPORT:
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 3, x86_deref(srcECX), a->inputsize);
+ sse_mulps(&p->func, temp, vp0);
+ sse_addps(&p->func, temp, vp1);
+ emit_store(p, dest, 3, temp);
+ update_src_ptr(p, srcECX, vtxESI, a);
+ break;
+ case EMIT_4F_VIEWPORT:
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
+ sse_mulps(&p->func, temp, vp0);
+ sse_addps(&p->func, temp, vp1);
+ emit_store(p, dest, 4, temp);
+ update_src_ptr(p, srcECX, vtxESI, a);
+ break;
+ case EMIT_3F_XYW:
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
+ sse_shufps(&p->func, temp, temp, SHUF(X,Y,W,Z));
+ emit_store(p, dest, 3, temp);
+ update_src_ptr(p, srcECX, vtxESI, a);
+ break;
+
+ case EMIT_1UB_1F:
+ /* Test for PAD3 + 1UB:
+ */
+ if (j > 0 &&
+ a[-1].vertoffset + a[-1].vertattrsize <= a->vertoffset - 3)
+ {
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 1, x86_deref(srcECX), a->inputsize);
+ sse_shufps(&p->func, temp, temp, SHUF(X,X,X,X));
+ emit_pack_store_4ub(p, x86_make_disp(dest, -3), temp); /* overkill! */
+ update_src_ptr(p, srcECX, vtxESI, a);
+ }
+ else {
+ printf("Can't emit 1ub %x %x %d\n", a->vertoffset, a[-1].vertoffset, a[-1].vertattrsize );
+ return GL_FALSE;
+ }
+ break;
+ case EMIT_3UB_3F_RGB:
+ case EMIT_3UB_3F_BGR:
+ /* Test for 3UB + PAD1:
+ */
+ if (j == vtx->attr_count - 1 ||
+ a[1].vertoffset >= a->vertoffset + 4) {
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 3, x86_deref(srcECX), a->inputsize);
+ if (a->format == EMIT_3UB_3F_BGR)
+ sse_shufps(&p->func, temp, temp, SHUF(Z,Y,X,W));
+ emit_pack_store_4ub(p, dest, temp);
+ update_src_ptr(p, srcECX, vtxESI, a);
+ }
+ /* Test for 3UB + 1UB:
+ */
+ else if (j < vtx->attr_count - 1 &&
+ a[1].format == EMIT_1UB_1F &&
+ a[1].vertoffset == a->vertoffset + 3) {
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 3, x86_deref(srcECX), a->inputsize);
+ update_src_ptr(p, srcECX, vtxESI, a);
+
+ /* Make room for incoming value:
+ */
+ sse_shufps(&p->func, temp, temp, SHUF(W,X,Y,Z));
+
+ get_src_ptr(p, srcECX, vtxESI, &a[1]);
+ emit_load(p, temp2, 1, x86_deref(srcECX), a[1].inputsize);
+ sse_movss(&p->func, temp, temp2);
+ update_src_ptr(p, srcECX, vtxESI, &a[1]);
+
+ /* Rearrange and possibly do BGR conversion:
+ */
+ if (a->format == EMIT_3UB_3F_BGR)
+ sse_shufps(&p->func, temp, temp, SHUF(W,Z,Y,X));
+ else
+ sse_shufps(&p->func, temp, temp, SHUF(Y,Z,W,X));
+
+ emit_pack_store_4ub(p, dest, temp);
+ j++; /* NOTE: two attrs consumed */
+ }
+ else {
+ printf("Can't emit 3ub\n");
+ return GL_FALSE; /* add this later */
+ }
+ break;
+
+ case EMIT_4UB_4F_RGBA:
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
+ emit_pack_store_4ub(p, dest, temp);
+ update_src_ptr(p, srcECX, vtxESI, a);
+ break;
+ case EMIT_4UB_4F_BGRA:
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
+ sse_shufps(&p->func, temp, temp, SHUF(Z,Y,X,W));
+ emit_pack_store_4ub(p, dest, temp);
+ update_src_ptr(p, srcECX, vtxESI, a);
+ break;
+ case EMIT_4UB_4F_ARGB:
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
+ sse_shufps(&p->func, temp, temp, SHUF(W,X,Y,Z));
+ emit_pack_store_4ub(p, dest, temp);
+ update_src_ptr(p, srcECX, vtxESI, a);
+ break;
+ case EMIT_4UB_4F_ABGR:
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
+ sse_shufps(&p->func, temp, temp, SHUF(W,Z,Y,X));
+ emit_pack_store_4ub(p, dest, temp);
+ update_src_ptr(p, srcECX, vtxESI, a);
+ break;
+ case EMIT_4CHAN_4F_RGBA:
+ switch (CHAN_TYPE) {
+ case GL_UNSIGNED_BYTE:
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
+ emit_pack_store_4ub(p, dest, temp);
+ update_src_ptr(p, srcECX, vtxESI, a);
+ break;
+ case GL_FLOAT:
+ get_src_ptr(p, srcECX, vtxESI, a);
+ emit_load(p, temp, 4, x86_deref(srcECX), a->inputsize);
+ emit_store(p, dest, 4, temp);
+ update_src_ptr(p, srcECX, vtxESI, a);
+ break;
+ case GL_UNSIGNED_SHORT:
+ default:
+ printf("unknown CHAN_TYPE %s\n", _mesa_lookup_enum_by_nr(CHAN_TYPE));
+ return GL_FALSE;
+ }
+ break;
+ default:
+ printf("unknown a[%d].format %d\n", j, a->format);
+ return GL_FALSE; /* catch any new opcodes */
+ }
+
+ /* Increment j by at least 1 - may have been incremented above also:
+ */
+ j++;
+ }
+
+ /* Next vertex:
+ */
+ x86_lea(&p->func, vertexEAX, x86_make_disp(vertexEAX, vtx->vertex_size));
+
+ /* decr count, loop if not zero
+ */
+ x86_dec(&p->func, countEBP);
+ x86_test(&p->func, countEBP, countEBP);
+ x86_jcc(&p->func, cc_NZ, label);
+
+ /* Exit mmx state?
+ */
+ if (p->func.need_emms)
+ mmx_emms(&p->func);
+
+ /* Land forward jump here:
+ */
+ x86_fixup_fwd_jump(&p->func, fixup);
+
+ /* Pop regs and return
+ */
+ x86_pop(&p->func, x86_get_base_reg(vtxESI));
+ x86_pop(&p->func, countEBP);
+ x86_ret(&p->func);
+
+ assert(!vtx->emit);
+ vtx->emit = (tnl_emit_func)x86_get_func(&p->func);
+
+ assert( (char *) p->func.csr - (char *) p->func.store <= MAX_SSE_CODE_SIZE );
+ return GL_TRUE;
+}
+
+
+
+void _tnl_generate_sse_emit( struct gl_context *ctx )
+{
+ struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
+ struct x86_program p;
+
+ if (!cpu_has_xmm) {
+ vtx->codegen_emit = NULL;
+ return;
+ }
+
+ memset(&p, 0, sizeof(p));
+
+ p.ctx = ctx;
+ p.inputs_safe = 0; /* for now */
+ p.outputs_safe = 0; /* for now */
+ p.have_sse2 = cpu_has_xmm2;
+ p.identity = x86_make_reg(file_XMM, 6);
+ p.chan0 = x86_make_reg(file_XMM, 7);
+
+ if (!x86_init_func_size(&p.func, MAX_SSE_CODE_SIZE)) {
+ vtx->emit = NULL;
+ return;
+ }
+
+ if (build_vertex_emit(&p)) {
+ _tnl_register_fastpath( vtx, GL_TRUE );
+ }
+ else {
+ /* Note the failure so that we don't keep trying to codegen an
+ * impossible state:
+ */
+ _tnl_register_fastpath( vtx, GL_FALSE );
+ x86_release_func(&p.func);
+ }
+}
+
+#else
+
+void _tnl_generate_sse_emit( struct gl_context *ctx )
+{
+ /* Dummy version for when USE_SSE_ASM not defined */
+}
+
+#endif
diff --git a/mesalib/src/mesa/vbo/vbo_attrib_tmp.h b/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
index 65717eb45..e1023834a 100644
--- a/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
+++ b/mesalib/src/mesa/vbo/vbo_attrib_tmp.h
@@ -809,6 +809,12 @@ TAG(Materialfv)(GLenum face, GLenum pname,
const GLfloat * params)
{
GET_CURRENT_CONTEXT(ctx);
+
+ if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glMaterial(invalid face)");
+ return;
+ }
+
switch (pname) {
case GL_EMISSION:
MAT(VBO_ATTRIB_MAT_FRONT_EMISSION, 4, face, params);
@@ -823,7 +829,12 @@ TAG(Materialfv)(GLenum face, GLenum pname,
MAT(VBO_ATTRIB_MAT_FRONT_SPECULAR, 4, face, params);
break;
case GL_SHININESS:
- MAT(VBO_ATTRIB_MAT_FRONT_SHININESS, 1, face, params);
+ if (*params < 0 || *params > ctx->Const.MaxShininess)
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glMaterial(invalid shininess: %f out range [0, %f])",
+ *params, ctx->Const.MaxShininess);
+ else
+ MAT(VBO_ATTRIB_MAT_FRONT_SHININESS, 1, face, params);
break;
case GL_COLOR_INDEXES:
MAT(VBO_ATTRIB_MAT_FRONT_INDEXES, 3, face, params);
diff --git a/mesalib/src/mesa/vbo/vbo_exec_api.c b/mesalib/src/mesa/vbo/vbo_exec_api.c
index cad7c4639..150589bec 100644
--- a/mesalib/src/mesa/vbo/vbo_exec_api.c
+++ b/mesalib/src/mesa/vbo/vbo_exec_api.c
@@ -42,6 +42,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/light.h"
#include "main/api_arrayelt.h"
#include "main/api_noop.h"
+#include "main/api_validate.h"
#include "main/dispatch.h"
#include "vbo_context.h"
@@ -552,6 +553,7 @@ static void GLAPIENTRY vbo_exec_EvalPoint2( GLint i, GLint j )
#endif /* FEATURE_evaluators */
+
/**
* Called via glBegin.
*/
@@ -563,6 +565,11 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode )
struct vbo_exec_context *exec = &vbo_context(ctx)->exec;
int i;
+ if (!_mesa_valid_prim_mode(ctx, mode)) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glBegin");
+ return;
+ }
+
if (ctx->NewState) {
_mesa_update_state( ctx );
diff --git a/pixman/pixman/pixman-access.c b/pixman/pixman/pixman-access.c
index 32c4d8b2c..189b19150 100644
--- a/pixman/pixman/pixman-access.c
+++ b/pixman/pixman/pixman-access.c
@@ -54,6 +54,120 @@
#define RGB24_TO_ENTRY_Y(mif,rgb24) \
((mif)->ent[CONVERT_RGB24_TO_Y15 (rgb24)])
+/* Fetch macros */
+
+#ifdef WORDS_BIGENDIAN
+#define FETCH_1(img,l,o) \
+ (((READ ((img), ((uint32_t *)(l)) + ((o) >> 5))) >> (0x1f - ((o) & 0x1f))) & 0x1)
+#else
+#define FETCH_1(img,l,o) \
+ ((((READ ((img), ((uint32_t *)(l)) + ((o) >> 5))) >> ((o) & 0x1f))) & 0x1)
+#endif
+
+#define FETCH_8(img,l,o) (READ (img, (((uint8_t *)(l)) + ((o) >> 3))))
+
+#ifdef WORDS_BIGENDIAN
+#define FETCH_4(img,l,o) \
+ (((4 * (o)) & 4) ? (FETCH_8 (img,l, 4 * (o)) & 0xf) : (FETCH_8 (img,l,(4 * (o))) >> 4))
+#else
+#define FETCH_4(img,l,o) \
+ (((4 * (o)) & 4) ? (FETCH_8 (img, l, 4 * (o)) >> 4) : (FETCH_8 (img, l, (4 * (o))) & 0xf))
+#endif
+
+#ifdef WORDS_BIGENDIAN
+#define FETCH_24(img,l,o) \
+ ((READ (img, (((uint8_t *)(l)) + ((o) * 3) + 0)) << 16) | \
+ (READ (img, (((uint8_t *)(l)) + ((o) * 3) + 1)) << 8) | \
+ (READ (img, (((uint8_t *)(l)) + ((o) * 3) + 2)) << 0))
+#else
+#define FETCH_24(img,l,o) \
+ ((READ (img, (((uint8_t *)(l)) + ((o) * 3) + 0)) << 0) | \
+ (READ (img, (((uint8_t *)(l)) + ((o) * 3) + 1)) << 8) | \
+ (READ (img, (((uint8_t *)(l)) + ((o) * 3) + 2)) << 16))
+#endif
+
+/* Store macros */
+
+#ifdef WORDS_BIGENDIAN
+#define STORE_1(img,l,o,v) \
+ do \
+ { \
+ uint32_t *__d = ((uint32_t *)(l)) + ((o) >> 5); \
+ uint32_t __m, __v; \
+ \
+ __m = 1 << (0x1f - ((o) & 0x1f)); \
+ __v = (v)? __m : 0; \
+ \
+ WRITE((img), __d, (READ((img), __d) & ~__m) | __v); \
+ } \
+ while (0)
+#else
+#define STORE_1(img,l,o,v) \
+ do \
+ { \
+ uint32_t *__d = ((uint32_t *)(l)) + ((o) >> 5); \
+ uint32_t __m, __v; \
+ \
+ __m = 1 << ((o) & 0x1f); \
+ __v = (v)? __m : 0; \
+ \
+ WRITE((img), __d, (READ((img), __d) & ~__m) | __v); \
+ } \
+ while (0)
+#endif
+
+#define STORE_8(img,l,o,v) (WRITE (img, (uint8_t *)(l) + ((o) >> 3), (v)))
+
+#ifdef WORDS_BIGENDIAN
+#define STORE_4(img,l,o,v) \
+ do \
+ { \
+ int bo = 4 * (o); \
+ int v4 = (v) & 0x0f; \
+ \
+ STORE_8 (img, l, bo, ( \
+ bo & 4 ? \
+ (FETCH_8 (img, l, bo) & 0xf0) | (v4) : \
+ (FETCH_8 (img, l, bo) & 0x0f) | (v4 << 4))); \
+ } while (0)
+#else
+#define STORE_4(img,l,o,v) \
+ do \
+ { \
+ int bo = 4 * (o); \
+ int v4 = (v) & 0x0f; \
+ \
+ STORE_8 (img, l, bo, ( \
+ bo & 4 ? \
+ (FETCH_8 (img, l, bo) & 0x0f) | (v4 << 4) : \
+ (FETCH_8 (img, l, bo) & 0xf0) | (v4))); \
+ } while (0)
+#endif
+
+#ifdef WORDS_BIGENDIAN
+#define STORE_24(img,l,o,v) \
+ do \
+ { \
+ uint8_t *__tmp = (l) + 3 * (o); \
+ \
+ WRITE ((img), __tmp++, ((v) & 0x00ff0000) >> 16); \
+ WRITE ((img), __tmp++, ((v) & 0x0000ff00) >> 8); \
+ WRITE ((img), __tmp++, ((v) & 0x000000ff) >> 0); \
+ } \
+ while (0)
+#else
+#define STORE_24(img,l,o,v) \
+ do \
+ { \
+ uint8_t *__tmp = (l) + 3 * (o); \
+ \
+ WRITE ((img), __tmp++, ((v) & 0x000000ff) >> 0); \
+ WRITE ((img), __tmp++, ((v) & 0x0000ff00) >> 8); \
+ WRITE ((img), __tmp++, ((v) & 0x00ff0000) >> 16); \
+ } \
+ while (0)
+#endif
+
/*
* YV12 setup and access macros
*/
@@ -86,195 +200,321 @@
((uint8_t *) ((bits) + offset0 + \
((stride) >> 1) * ((line) >> 1)))
-/********************************** Fetch ************************************/
+/* Misc. helpers */
+
+static force_inline void
+get_shifts (pixman_format_code_t format,
+ int *a,
+ int *r,
+ int *g,
+ int *b)
+{
+ switch (PIXMAN_FORMAT_TYPE (format))
+ {
+ case PIXMAN_TYPE_A:
+ *b = 0;
+ *g = 0;
+ *r = 0;
+ *a = 0;
+ break;
+
+ case PIXMAN_TYPE_ARGB:
+ *b = 0;
+ *g = *b + PIXMAN_FORMAT_B (format);
+ *r = *g + PIXMAN_FORMAT_G (format);
+ *a = *r + PIXMAN_FORMAT_R (format);
+ break;
+
+ case PIXMAN_TYPE_ABGR:
+ *r = 0;
+ *g = *r + PIXMAN_FORMAT_R (format);
+ *b = *g + PIXMAN_FORMAT_G (format);
+ *a = *b + PIXMAN_FORMAT_B (format);
+ break;
+
+ case PIXMAN_TYPE_BGRA:
+ /* With BGRA formats we start counting at the high end of the pixel */
+ *b = PIXMAN_FORMAT_BPP (format) - PIXMAN_FORMAT_B (format);
+ *g = *b - PIXMAN_FORMAT_B (format);
+ *r = *g - PIXMAN_FORMAT_G (format);
+ *a = *r - PIXMAN_FORMAT_R (format);
+ break;
+
+ case PIXMAN_TYPE_RGBA:
+ /* With BGRA formats we start counting at the high end of the pixel */
+ *r = PIXMAN_FORMAT_BPP (format) - PIXMAN_FORMAT_R (format);
+ *g = *r - PIXMAN_FORMAT_R (format);
+ *b = *g - PIXMAN_FORMAT_G (format);
+ *a = *b - PIXMAN_FORMAT_B (format);
+ break;
+
+ default:
+ assert (0);
+ break;
+ }
+}
+
+static force_inline uint32_t
+convert_channel (uint32_t pixel, uint32_t def_value,
+ int n_from_bits, int from_shift,
+ int n_to_bits, int to_shift)
+{
+ uint32_t v;
+
+ if (n_from_bits && n_to_bits)
+ v = unorm_to_unorm (pixel >> from_shift, n_from_bits, n_to_bits);
+ else if (n_to_bits)
+ v = def_value;
+ else
+ v = 0;
-static void
-fetch_scanline_a8r8g8b8 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
-
- MEMCPY_WRAPPED (image,
- buffer, (const uint32_t *)bits + x,
- width * sizeof(uint32_t));
+ return (v & ((1 << n_to_bits) - 1)) << to_shift;
}
-static void
-fetch_scanline_x8r8g8b8 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
+static force_inline uint32_t
+convert_pixel (pixman_format_code_t from, pixman_format_code_t to, uint32_t pixel)
{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint32_t *pixel = (const uint32_t *)bits + x;
- const uint32_t *end = pixel + width;
-
- while (pixel < end)
- *buffer++ = READ (image, pixel++) | 0xff000000;
+ int a_from_shift, r_from_shift, g_from_shift, b_from_shift;
+ int a_to_shift, r_to_shift, g_to_shift, b_to_shift;
+ uint32_t a, r, g, b;
+
+ get_shifts (from, &a_from_shift, &r_from_shift, &g_from_shift, &b_from_shift);
+ get_shifts (to, &a_to_shift, &r_to_shift, &g_to_shift, &b_to_shift);
+
+ a = convert_channel (pixel, ~0,
+ PIXMAN_FORMAT_A (from), a_from_shift,
+ PIXMAN_FORMAT_A (to), a_to_shift);
+
+ r = convert_channel (pixel, 0,
+ PIXMAN_FORMAT_R (from), r_from_shift,
+ PIXMAN_FORMAT_R (to), r_to_shift);
+
+ g = convert_channel (pixel, 0,
+ PIXMAN_FORMAT_G (from), g_from_shift,
+ PIXMAN_FORMAT_G (to), g_to_shift);
+
+ b = convert_channel (pixel, 0,
+ PIXMAN_FORMAT_B (from), b_from_shift,
+ PIXMAN_FORMAT_B (to), b_to_shift);
+
+ return a | r | g | b;
}
-static void
-fetch_scanline_a8b8g8r8 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
+static force_inline uint32_t
+convert_pixel_to_a8r8g8b8 (pixman_image_t *image,
+ pixman_format_code_t format,
+ uint32_t pixel)
{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint32_t *pixel = (uint32_t *)bits + x;
- const uint32_t *end = pixel + width;
-
- while (pixel < end)
+ if (PIXMAN_FORMAT_TYPE (format) == PIXMAN_TYPE_GRAY ||
+ PIXMAN_FORMAT_TYPE (format) == PIXMAN_TYPE_COLOR)
{
- uint32_t p = READ (image, pixel++);
-
- *buffer++ = (p & 0xff00ff00) |
- ((p >> 16) & 0xff) |
- ((p & 0xff) << 16);
+ return image->bits.indexed->rgba[pixel];
}
-}
-
-static void
-fetch_scanline_x8b8g8r8 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint32_t *pixel = (uint32_t *)bits + x;
- const uint32_t *end = pixel + width;
-
- while (pixel < end)
+ else
{
- uint32_t p = READ (image, pixel++);
-
- *buffer++ = 0xff000000 |
- (p & 0x0000ff00) |
- ((p >> 16) & 0xff) |
- ((p & 0xff) << 16);
+ return convert_pixel (format, PIXMAN_a8r8g8b8, pixel);
}
}
-static void
-fetch_scanline_b8g8r8a8 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
+static force_inline uint32_t
+convert_pixel_from_a8r8g8b8 (pixman_image_t *image,
+ pixman_format_code_t format, uint32_t pixel)
{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint32_t *pixel = (uint32_t *)bits + x;
- const uint32_t *end = pixel + width;
-
- while (pixel < end)
+ if (PIXMAN_FORMAT_TYPE (format) == PIXMAN_TYPE_GRAY)
{
- uint32_t p = READ (image, pixel++);
+ pixel = CONVERT_RGB24_TO_Y15 (pixel);
- *buffer++ = (((p & 0xff000000) >> 24) |
- ((p & 0x00ff0000) >> 8) |
- ((p & 0x0000ff00) << 8) |
- ((p & 0x000000ff) << 24));
+ return image->bits.indexed->ent[pixel & 0x7fff];
}
-}
+ else if (PIXMAN_FORMAT_TYPE (format) == PIXMAN_TYPE_COLOR)
+ {
+ pixel = convert_pixel (PIXMAN_a8r8g8b8, PIXMAN_x1r5g5b5, pixel);
-static void
-fetch_scanline_b8g8r8x8 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint32_t *pixel = (uint32_t *)bits + x;
- const uint32_t *end = pixel + width;
-
- while (pixel < end)
+ return image->bits.indexed->ent[pixel & 0x7fff];
+ }
+ else
{
- uint32_t p = READ (image, pixel++);
-
- *buffer++ = (0xff000000 |
- ((p & 0xff000000) >> 24) |
- ((p & 0x00ff0000) >> 8) |
- ((p & 0x0000ff00) << 8));
+ return convert_pixel (PIXMAN_a8r8g8b8, format, pixel);
}
}
-static void
-fetch_scanline_r8g8b8a8 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
+static force_inline uint32_t
+fetch_and_convert_pixel (pixman_image_t * image,
+ const uint8_t * bits,
+ int offset,
+ pixman_format_code_t format)
{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint32_t *pixel = (uint32_t *)bits + x;
- const uint32_t *end = pixel + width;
+ uint32_t pixel;
- while (pixel < end)
+ switch (PIXMAN_FORMAT_BPP (format))
{
- uint32_t p = READ (image, pixel++);
+ case 1:
+ pixel = FETCH_1 (image, bits, offset);
+ break;
- *buffer++ = (((p & 0x000000ff) << 24) | (p >> 8));
- }
-}
+ case 4:
+ pixel = FETCH_4 (image, bits, offset);
+ break;
-static void
-fetch_scanline_r8g8b8x8 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint32_t *pixel = (uint32_t *)bits + x;
- const uint32_t *end = pixel + width;
-
- while (pixel < end)
- {
- uint32_t p = READ (image, pixel++);
-
- *buffer++ = (0xff000000 | (p >> 8));
+ case 8:
+ pixel = READ (image, bits + offset);
+ break;
+
+ case 16:
+ pixel = READ (image, ((uint16_t *)bits + offset));
+ break;
+
+ case 24:
+ pixel = FETCH_24 (image, bits, offset);
+ break;
+
+ case 32:
+ pixel = READ (image, ((uint32_t *)bits + offset));
+ break;
+
+ default:
+ pixel = 0xffff00ff; /* As ugly as possible to detect the bug */
+ break;
}
+
+ return convert_pixel_to_a8r8g8b8 (image, format, pixel);
}
-static void
-fetch_scanline_x14r6g6b6 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
+static force_inline void
+convert_and_store_pixel (bits_image_t * image,
+ uint8_t * dest,
+ int offset,
+ pixman_format_code_t format,
+ uint32_t pixel)
{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint32_t *pixel = (const uint32_t *)bits + x;
- const uint32_t *end = pixel + width;
+ uint32_t converted = convert_pixel_from_a8r8g8b8 (
+ (pixman_image_t *)image, format, pixel);
- while (pixel < end)
+ switch (PIXMAN_FORMAT_BPP (format))
{
- uint32_t p = READ (image, pixel++);
- uint32_t r, g, b;
+ case 1:
+ STORE_1 (image, dest, offset, converted & 0x01);
+ break;
+
+ case 4:
+ STORE_4 (image, dest, offset, converted & 0xf);
+ break;
+
+ case 8:
+ WRITE (image, (dest + offset), converted & 0xff);
+ break;
+
+ case 16:
+ WRITE (image, ((uint16_t *)dest + offset), converted & 0xffff);
+ break;
+
+ case 24:
+ STORE_24 (image, dest, offset, converted);
+ break;
- r = ((p & 0x3f000) << 6) | ((p & 0x30000));
- g = ((p & 0x00fc0) << 4) | ((p & 0x00c00) >> 2);
- b = ((p & 0x0003f) << 2) | ((p & 0x00030) >> 4);
+ case 32:
+ WRITE (image, ((uint32_t *)dest + offset), converted);
+ break;
- *buffer++ = 0xff000000 | r | g | b;
+ default:
+ *dest = 0x0;
+ break;
}
}
+#define MAKE_ACCESSORS(format) \
+ static void \
+ fetch_scanline_ ## format (pixman_image_t *image, \
+ int x, \
+ int y, \
+ int width, \
+ uint32_t * buffer, \
+ const uint32_t *mask) \
+ { \
+ uint8_t *bits = \
+ (uint8_t *)(image->bits.bits + y * image->bits.rowstride); \
+ int i; \
+ \
+ for (i = 0; i < width; ++i) \
+ { \
+ *buffer++ = \
+ fetch_and_convert_pixel (image, bits, x + i, PIXMAN_ ## format); \
+ } \
+ } \
+ \
+ static void \
+ store_scanline_ ## format (bits_image_t * image, \
+ int x, \
+ int y, \
+ int width, \
+ const uint32_t *values) \
+ { \
+ uint8_t *dest = \
+ (uint8_t *)(image->bits + y * image->rowstride); \
+ int i; \
+ \
+ for (i = 0; i < width; ++i) \
+ { \
+ convert_and_store_pixel ( \
+ image, dest, i + x, PIXMAN_ ## format, values[i]); \
+ } \
+ } \
+ \
+ static uint32_t \
+ fetch_pixel_ ## format (bits_image_t *image, \
+ int offset, \
+ int line) \
+ { \
+ uint8_t *bits = \
+ (uint8_t *)(image->bits + line * image->rowstride); \
+ \
+ return fetch_and_convert_pixel ((pixman_image_t *)image, \
+ bits, offset, PIXMAN_ ## format); \
+ } \
+ \
+ static const void *const __dummy__ ## format
+
+MAKE_ACCESSORS(a8r8g8b8);
+MAKE_ACCESSORS(x8r8g8b8);
+MAKE_ACCESSORS(a8b8g8r8);
+MAKE_ACCESSORS(x8b8g8r8);
+MAKE_ACCESSORS(x14r6g6b6);
+MAKE_ACCESSORS(b8g8r8a8);
+MAKE_ACCESSORS(b8g8r8x8);
+MAKE_ACCESSORS(r8g8b8x8);
+MAKE_ACCESSORS(r8g8b8a8);
+MAKE_ACCESSORS(r8g8b8);
+MAKE_ACCESSORS(b8g8r8);
+MAKE_ACCESSORS(r5g6b5);
+MAKE_ACCESSORS(b5g6r5);
+MAKE_ACCESSORS(a1r5g5b5);
+MAKE_ACCESSORS(x1r5g5b5);
+MAKE_ACCESSORS(a1b5g5r5);
+MAKE_ACCESSORS(x1b5g5r5);
+MAKE_ACCESSORS(a4r4g4b4);
+MAKE_ACCESSORS(x4r4g4b4);
+MAKE_ACCESSORS(a4b4g4r4);
+MAKE_ACCESSORS(x4b4g4r4);
+MAKE_ACCESSORS(a8);
+MAKE_ACCESSORS(c8);
+MAKE_ACCESSORS(g8);
+MAKE_ACCESSORS(r3g3b2);
+MAKE_ACCESSORS(b2g3r3);
+MAKE_ACCESSORS(a2r2g2b2);
+MAKE_ACCESSORS(a2b2g2r2);
+MAKE_ACCESSORS(x4a4);
+MAKE_ACCESSORS(a4);
+MAKE_ACCESSORS(g4);
+MAKE_ACCESSORS(c4);
+MAKE_ACCESSORS(r1g2b1);
+MAKE_ACCESSORS(b1g2r1);
+MAKE_ACCESSORS(a1r1g1b1);
+MAKE_ACCESSORS(a1b1g1r1);
+MAKE_ACCESSORS(a1);
+MAKE_ACCESSORS(g1);
+
+/********************************** Fetch ************************************/
+
/* Expects a uint64_t buffer */
static void
fetch_scanline_a2r10g10b10 (pixman_image_t *image,
@@ -404,698 +644,6 @@ fetch_scanline_x2b10g10r10 (pixman_image_t *image,
}
static void
-fetch_scanline_r8g8b8 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint8_t *pixel = (const uint8_t *)bits + 3 * x;
- const uint8_t *end = pixel + 3 * width;
-
- while (pixel < end)
- {
- uint32_t b = 0xff000000;
-
-#ifdef WORDS_BIGENDIAN
- b |= (READ (image, pixel++) << 16);
- b |= (READ (image, pixel++) << 8);
- b |= (READ (image, pixel++));
-#else
- b |= (READ (image, pixel++));
- b |= (READ (image, pixel++) << 8);
- b |= (READ (image, pixel++) << 16);
-#endif
-
- *buffer++ = b;
- }
-}
-
-static void
-fetch_scanline_b8g8r8 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint8_t *pixel = (const uint8_t *)bits + 3 * x;
- const uint8_t *end = pixel + 3 * width;
-
- while (pixel < end)
- {
- uint32_t b = 0xff000000;
-#ifdef WORDS_BIGENDIAN
- b |= (READ (image, pixel++));
- b |= (READ (image, pixel++) << 8);
- b |= (READ (image, pixel++) << 16);
-#else
- b |= (READ (image, pixel++) << 16);
- b |= (READ (image, pixel++) << 8);
- b |= (READ (image, pixel++));
-#endif
- *buffer++ = b;
- }
-}
-
-static void
-fetch_scanline_r5g6b5 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint16_t *pixel = (const uint16_t *)bits + x;
- const uint16_t *end = pixel + width;
-
- while (pixel < end)
- {
- uint32_t p = READ (image, pixel++);
- uint32_t r = (((p) << 3) & 0xf8) |
- (((p) << 5) & 0xfc00) |
- (((p) << 8) & 0xf80000);
-
- r |= (r >> 5) & 0x70007;
- r |= (r >> 6) & 0x300;
-
- *buffer++ = 0xff000000 | r;
- }
-}
-
-static void
-fetch_scanline_b5g6r5 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint16_t *pixel = (const uint16_t *)bits + x;
- const uint16_t *end = pixel + width;
-
- while (pixel < end)
- {
- uint32_t p = READ (image, pixel++);
- uint32_t r, g, b;
-
- b = ((p & 0xf800) | ((p & 0xe000) >> 5)) >> 8;
- g = ((p & 0x07e0) | ((p & 0x0600) >> 6)) << 5;
- r = ((p & 0x001c) | ((p & 0x001f) << 5)) << 14;
-
- *buffer++ = 0xff000000 | r | g | b;
- }
-}
-
-static void
-fetch_scanline_a1r5g5b5 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint16_t *pixel = (const uint16_t *)bits + x;
- const uint16_t *end = pixel + width;
-
- while (pixel < end)
- {
- uint32_t p = READ (image, pixel++);
- uint32_t r, g, b, a;
-
- a = (uint32_t) ((uint8_t) (0 - ((p & 0x8000) >> 15))) << 24;
- r = ((p & 0x7c00) | ((p & 0x7000) >> 5)) << 9;
- g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6;
- b = ((p & 0x001c) | ((p & 0x001f) << 5)) >> 2;
-
- *buffer++ = a | r | g | b;
- }
-}
-
-static void
-fetch_scanline_x1r5g5b5 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint16_t *pixel = (const uint16_t *)bits + x;
- const uint16_t *end = pixel + width;
-
- while (pixel < end)
- {
- uint32_t p = READ (image, pixel++);
- uint32_t r, g, b;
-
- r = ((p & 0x7c00) | ((p & 0x7000) >> 5)) << 9;
- g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6;
- b = ((p & 0x001c) | ((p & 0x001f) << 5)) >> 2;
-
- *buffer++ = 0xff000000 | r | g | b;
- }
-}
-
-static void
-fetch_scanline_a1b5g5r5 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint16_t *pixel = (const uint16_t *)bits + x;
- const uint16_t *end = pixel + width;
- uint32_t r, g, b, a;
-
- while (pixel < end)
- {
- uint32_t p = READ (image, pixel++);
-
- a = (uint32_t) ((uint8_t) (0 - ((p & 0x8000) >> 15))) << 24;
- b = ((p & 0x7c00) | ((p & 0x7000) >> 5)) >> 7;
- g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6;
- r = ((p & 0x001c) | ((p & 0x001f) << 5)) << 14;
-
- *buffer++ = a | r | g | b;
- }
-}
-
-static void
-fetch_scanline_x1b5g5r5 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint16_t *pixel = (const uint16_t *)bits + x;
- const uint16_t *end = pixel + width;
-
- while (pixel < end)
- {
- uint32_t p = READ (image, pixel++);
- uint32_t r, g, b;
-
- b = ((p & 0x7c00) | ((p & 0x7000) >> 5)) >> 7;
- g = ((p & 0x03e0) | ((p & 0x0380) >> 5)) << 6;
- r = ((p & 0x001c) | ((p & 0x001f) << 5)) << 14;
-
- *buffer++ = 0xff000000 | r | g | b;
- }
-}
-
-static void
-fetch_scanline_a4r4g4b4 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint16_t *pixel = (const uint16_t *)bits + x;
- const uint16_t *end = pixel + width;
-
- while (pixel < end)
- {
- uint32_t p = READ (image, pixel++);
- uint32_t r, g, b, a;
-
- a = ((p & 0xf000) | ((p & 0xf000) >> 4)) << 16;
- r = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) << 12;
- g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8;
- b = ((p & 0x000f) | ((p & 0x000f) << 4));
-
- *buffer++ = a | r | g | b;
- }
-}
-
-static void
-fetch_scanline_x4r4g4b4 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint16_t *pixel = (const uint16_t *)bits + x;
- const uint16_t *end = pixel + width;
-
- while (pixel < end)
- {
- uint32_t p = READ (image, pixel++);
- uint32_t r, g, b;
-
- r = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) << 12;
- g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8;
- b = ((p & 0x000f) | ((p & 0x000f) << 4));
-
- *buffer++ = 0xff000000 | r | g | b;
- }
-}
-
-static void
-fetch_scanline_a4b4g4r4 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint16_t *pixel = (const uint16_t *)bits + x;
- const uint16_t *end = pixel + width;
-
- while (pixel < end)
- {
- uint32_t p = READ (image, pixel++);
- uint32_t r, g, b, a;
-
- a = ((p & 0xf000) | ((p & 0xf000) >> 4)) << 16;
- b = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) >> 4;
- g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8;
- r = ((p & 0x000f) | ((p & 0x000f) << 4)) << 16;
-
- *buffer++ = a | r | g | b;
- }
-}
-
-static void
-fetch_scanline_x4b4g4r4 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint16_t *pixel = (const uint16_t *)bits + x;
- const uint16_t *end = pixel + width;
-
- while (pixel < end)
- {
- uint32_t p = READ (image, pixel++);
- uint32_t r, g, b;
-
- b = ((p & 0x0f00) | ((p & 0x0f00) >> 4)) >> 4;
- g = ((p & 0x00f0) | ((p & 0x00f0) >> 4)) << 8;
- r = ((p & 0x000f) | ((p & 0x000f) << 4)) << 16;
-
- *buffer++ = 0xff000000 | r | g | b;
- }
-}
-
-static void
-fetch_scanline_a8 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint8_t *pixel = (const uint8_t *)bits + x;
- const uint8_t *end = pixel + width;
-
- while (pixel < end)
- *buffer++ = READ (image, pixel++) << 24;
-}
-
-static void
-fetch_scanline_r3g3b2 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint8_t *pixel = (const uint8_t *)bits + x;
- const uint8_t *end = pixel + width;
-
- while (pixel < end)
- {
- uint32_t p = READ (image, pixel++);
- uint32_t r, g, b;
-
- r = ((p & 0xe0) | ((p & 0xe0) >> 3) | ((p & 0xc0) >> 6)) << 16;
- g = ((p & 0x1c) | ((p & 0x18) >> 3) | ((p & 0x1c) << 3)) << 8;
- b = (((p & 0x03) ) |
- ((p & 0x03) << 2) |
- ((p & 0x03) << 4) |
- ((p & 0x03) << 6));
-
- *buffer++ = 0xff000000 | r | g | b;
- }
-}
-
-static void
-fetch_scanline_b2g3r3 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint8_t *pixel = (const uint8_t *)bits + x;
- const uint8_t *end = pixel + width;
-
- while (pixel < end)
- {
- uint32_t p = READ (image, pixel++);
- uint32_t r, g, b;
-
- b = p & 0xc0;
- b |= b >> 2;
- b |= b >> 4;
- b &= 0xff;
-
- g = (p & 0x38) << 10;
- g |= g >> 3;
- g |= g >> 6;
- g &= 0xff00;
-
- r = (p & 0x7) << 21;
- r |= r >> 3;
- r |= r >> 6;
- r &= 0xff0000;
-
- *buffer++ = 0xff000000 | r | g | b;
- }
-}
-
-static void
-fetch_scanline_a2r2g2b2 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint8_t *pixel = (const uint8_t *)bits + x;
- const uint8_t *end = pixel + width;
-
- while (pixel < end)
- {
- uint32_t p = READ (image, pixel++);
- uint32_t a, r, g, b;
-
- a = ((p & 0xc0) * 0x55) << 18;
- r = ((p & 0x30) * 0x55) << 12;
- g = ((p & 0x0c) * 0x55) << 6;
- b = ((p & 0x03) * 0x55);
-
- *buffer++ = a | r | g | b;
- }
-}
-
-static void
-fetch_scanline_a2b2g2r2 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint8_t *pixel = (const uint8_t *)bits + x;
- const uint8_t *end = pixel + width;
-
- while (pixel < end)
- {
- uint32_t p = READ (image, pixel++);
- uint32_t a, r, g, b;
-
- a = ((p & 0xc0) * 0x55) << 18;
- b = ((p & 0x30) * 0x55) >> 4;
- g = ((p & 0x0c) * 0x55) << 6;
- r = ((p & 0x03) * 0x55) << 16;
-
- *buffer++ = a | r | g | b;
- }
-}
-
-static void
-fetch_scanline_c8 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const pixman_indexed_t * indexed = image->bits.indexed;
- const uint8_t *pixel = (const uint8_t *)bits + x;
- const uint8_t *end = pixel + width;
-
- while (pixel < end)
- {
- uint32_t p = READ (image, pixel++);
-
- *buffer++ = indexed->rgba[p];
- }
-}
-
-static void
-fetch_scanline_x4a4 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const uint8_t *pixel = (const uint8_t *)bits + x;
- const uint8_t *end = pixel + width;
-
- while (pixel < end)
- {
- uint8_t p = READ (image, pixel++) & 0xf;
-
- *buffer++ = (p | (p << 4)) << 24;
- }
-}
-
-#define FETCH_8(img,l,o) (READ (img, (((uint8_t *)(l)) + ((o) >> 3))))
-#ifdef WORDS_BIGENDIAN
-#define FETCH_4(img,l,o) \
- (((4 * (o)) & 4) ? (FETCH_8 (img,l, 4 * (o)) & 0xf) : (FETCH_8 (img,l,(4 * (o))) >> 4))
-#else
-#define FETCH_4(img,l,o) \
- (((4 * (o)) & 4) ? (FETCH_8 (img, l, 4 * (o)) >> 4) : (FETCH_8 (img, l, (4 * (o))) & 0xf))
-#endif
-
-static void
-fetch_scanline_a4 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t p = FETCH_4 (image, bits, i + x);
-
- p |= p << 4;
-
- *buffer++ = p << 24;
- }
-}
-
-static void
-fetch_scanline_r1g2b1 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t p = FETCH_4 (image, bits, i + x);
- uint32_t r, g, b;
-
- r = ((p & 0x8) * 0xff) << 13;
- g = ((p & 0x6) * 0x55) << 7;
- b = ((p & 0x1) * 0xff);
-
- *buffer++ = 0xff000000 | r | g | b;
- }
-}
-
-static void
-fetch_scanline_b1g2r1 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t p = FETCH_4 (image, bits, i + x);
- uint32_t r, g, b;
-
- b = ((p & 0x8) * 0xff) >> 3;
- g = ((p & 0x6) * 0x55) << 7;
- r = ((p & 0x1) * 0xff) << 16;
-
- *buffer++ = 0xff000000 | r | g | b;
- }
-}
-
-static void
-fetch_scanline_a1r1g1b1 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- uint32_t a, r, g, b;
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t p = FETCH_4 (image, bits, i + x);
-
- a = ((p & 0x8) * 0xff) << 21;
- r = ((p & 0x4) * 0xff) << 14;
- g = ((p & 0x2) * 0xff) << 7;
- b = ((p & 0x1) * 0xff);
-
- *buffer++ = a | r | g | b;
- }
-}
-
-static void
-fetch_scanline_a1b1g1r1 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t p = FETCH_4 (image, bits, i + x);
- uint32_t a, r, g, b;
-
- a = ((p & 0x8) * 0xff) << 21;
- b = ((p & 0x4) * 0xff) >> 2;
- g = ((p & 0x2) * 0xff) << 7;
- r = ((p & 0x1) * 0xff) << 16;
-
- *buffer++ = a | r | g | b;
- }
-}
-
-static void
-fetch_scanline_c4 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const pixman_indexed_t * indexed = image->bits.indexed;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t p = FETCH_4 (image, bits, i + x);
-
- *buffer++ = indexed->rgba[p];
- }
-}
-
-static void
-fetch_scanline_a1 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t p = READ (image, bits + ((i + x) >> 5));
- uint32_t a;
-
-#ifdef WORDS_BIGENDIAN
- a = p >> (0x1f - ((i + x) & 0x1f));
-#else
- a = p >> ((i + x) & 0x1f);
-#endif
- a = a & 1;
- a |= a << 1;
- a |= a << 2;
- a |= a << 4;
-
- *buffer++ = a << 24;
- }
-}
-
-static void
-fetch_scanline_g1 (pixman_image_t *image,
- int x,
- int y,
- int width,
- uint32_t * buffer,
- const uint32_t *mask)
-{
- const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
- const pixman_indexed_t * indexed = image->bits.indexed;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t p = READ (image, bits + ((i + x) >> 5));
- uint32_t a;
-
-#ifdef WORDS_BIGENDIAN
- a = p >> (0x1f - ((i + x) & 0x1f));
-#else
- a = p >> ((i + x) & 0x1f);
-#endif
- a = a & 1;
-
- *buffer++ = indexed->rgba[a];
- }
-}
-
-static void
fetch_scanline_yuy2 (pixman_image_t *image,
int x,
int line,
@@ -1257,576 +805,6 @@ fetch_pixel_x2b10g10r10 (bits_image_t *image,
}
static uint32_t
-fetch_pixel_a8r8g8b8 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- return READ (image, (uint32_t *)bits + offset);
-}
-
-static uint32_t
-fetch_pixel_x8r8g8b8 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
-
- return READ (image, (uint32_t *)bits + offset) | 0xff000000;
-}
-
-static uint32_t
-fetch_pixel_a8b8g8r8 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint32_t *)bits + offset);
-
- return ((pixel & 0xff000000) |
- ((pixel >> 16) & 0xff) |
- (pixel & 0x0000ff00) |
- ((pixel & 0xff) << 16));
-}
-
-static uint32_t
-fetch_pixel_x8b8g8r8 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint32_t *)bits + offset);
-
- return ((0xff000000) |
- ((pixel >> 16) & 0xff) |
- (pixel & 0x0000ff00) |
- ((pixel & 0xff) << 16));
-}
-
-static uint32_t
-fetch_pixel_b8g8r8a8 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint32_t *)bits + offset);
-
- return ((pixel & 0xff000000) >> 24 |
- (pixel & 0x00ff0000) >> 8 |
- (pixel & 0x0000ff00) << 8 |
- (pixel & 0x000000ff) << 24);
-}
-
-static uint32_t
-fetch_pixel_b8g8r8x8 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint32_t *)bits + offset);
-
- return ((0xff000000) |
- (pixel & 0xff000000) >> 24 |
- (pixel & 0x00ff0000) >> 8 |
- (pixel & 0x0000ff00) << 8);
-}
-
-static uint32_t
-fetch_pixel_r8g8b8a8 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint32_t *)bits + offset);
-
- return (((pixel & 0x000000ff) << 24) | (pixel >> 8));
-}
-
-static uint32_t
-fetch_pixel_r8g8b8x8 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint32_t *)bits + offset);
-
- return (0xff000000 | (pixel >> 8));
-}
-
-static uint32_t
-fetch_pixel_x14r6g6b6 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint32_t *) bits + offset);
- uint32_t r, g, b;
-
- r = ((pixel & 0x3f000) << 6) | ((pixel & 0x30000));
- g = ((pixel & 0x00fc0) << 4) | ((pixel & 0x00c00) >> 2);
- b = ((pixel & 0x0003f) << 2) | ((pixel & 0x00030) >> 4);
-
- return 0xff000000 | r | g | b;
-}
-
-static uint32_t
-fetch_pixel_r8g8b8 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint8_t *pixel = ((uint8_t *) bits) + (offset * 3);
-
-#ifdef WORDS_BIGENDIAN
- return (0xff000000 |
- (READ (image, pixel + 0) << 16) |
- (READ (image, pixel + 1) << 8) |
- (READ (image, pixel + 2)));
-#else
- return (0xff000000 |
- (READ (image, pixel + 2) << 16) |
- (READ (image, pixel + 1) << 8) |
- (READ (image, pixel + 0)));
-#endif
-}
-
-static uint32_t
-fetch_pixel_b8g8r8 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint8_t *pixel = ((uint8_t *) bits) + (offset * 3);
-#ifdef WORDS_BIGENDIAN
- return (0xff000000 |
- (READ (image, pixel + 2) << 16) |
- (READ (image, pixel + 1) << 8) |
- (READ (image, pixel + 0)));
-#else
- return (0xff000000 |
- (READ (image, pixel + 0) << 16) |
- (READ (image, pixel + 1) << 8) |
- (READ (image, pixel + 2)));
-#endif
-}
-
-static uint32_t
-fetch_pixel_r5g6b5 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint16_t *) bits + offset);
- uint32_t r, g, b;
-
- r = ((pixel & 0xf800) | ((pixel & 0xe000) >> 5)) << 8;
- g = ((pixel & 0x07e0) | ((pixel & 0x0600) >> 6)) << 5;
- b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2;
-
- return (0xff000000 | r | g | b);
-}
-
-static uint32_t
-fetch_pixel_b5g6r5 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t r, g, b;
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint16_t *) bits + offset);
-
- b = ((pixel & 0xf800) | ((pixel & 0xe000) >> 5)) >> 8;
- g = ((pixel & 0x07e0) | ((pixel & 0x0600) >> 6)) << 5;
- r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14;
-
- return (0xff000000 | r | g | b);
-}
-
-static uint32_t
-fetch_pixel_a1r5g5b5 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint16_t *) bits + offset);
- uint32_t a, r, g, b;
-
- a = (uint32_t) ((uint8_t) (0 - ((pixel & 0x8000) >> 15))) << 24;
- r = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) << 9;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2;
-
- return (a | r | g | b);
-}
-
-static uint32_t
-fetch_pixel_x1r5g5b5 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint16_t *) bits + offset);
- uint32_t r, g, b;
-
- r = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) << 9;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- b = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) >> 2;
-
- return (0xff000000 | r | g | b);
-}
-
-static uint32_t
-fetch_pixel_a1b5g5r5 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint16_t *) bits + offset);
- uint32_t a, r, g, b;
-
- a = (uint32_t) ((uint8_t) (0 - ((pixel & 0x8000) >> 15))) << 24;
- b = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) >> 7;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14;
-
- return (a | r | g | b);
-}
-
-static uint32_t
-fetch_pixel_x1b5g5r5 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint16_t *) bits + offset);
- uint32_t r, g, b;
-
- b = ((pixel & 0x7c00) | ((pixel & 0x7000) >> 5)) >> 7;
- g = ((pixel & 0x03e0) | ((pixel & 0x0380) >> 5)) << 6;
- r = ((pixel & 0x001c) | ((pixel & 0x001f) << 5)) << 14;
-
- return (0xff000000 | r | g | b);
-}
-
-static uint32_t
-fetch_pixel_a4r4g4b4 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint16_t *) bits + offset);
- uint32_t a, r, g, b;
-
- a = ((pixel & 0xf000) | ((pixel & 0xf000) >> 4)) << 16;
- r = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- b = ((pixel & 0x000f) | ((pixel & 0x000f) << 4));
-
- return (a | r | g | b);
-}
-
-static uint32_t
-fetch_pixel_x4r4g4b4 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint16_t *) bits + offset);
- uint32_t r, g, b;
-
- r = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) << 12;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- b = ((pixel & 0x000f) | ((pixel & 0x000f) << 4));
-
- return (0xff000000 | r | g | b);
-}
-
-static uint32_t
-fetch_pixel_a4b4g4r4 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint16_t *) bits + offset);
- uint32_t a, r, g, b;
-
- a = ((pixel & 0xf000) | ((pixel & 0xf000) >> 4)) << 16;
- b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) >> 4;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)) << 16;
-
- return (a | r | g | b);
-}
-
-static uint32_t
-fetch_pixel_x4b4g4r4 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint16_t *) bits + offset);
- uint32_t r, g, b;
-
- b = ((pixel & 0x0f00) | ((pixel & 0x0f00) >> 4)) >> 4;
- g = ((pixel & 0x00f0) | ((pixel & 0x00f0) >> 4)) << 8;
- r = ((pixel & 0x000f) | ((pixel & 0x000f) << 4)) << 16;
-
- return (0xff000000 | r | g | b);
-}
-
-static uint32_t
-fetch_pixel_a8 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint8_t *) bits + offset);
-
- return pixel << 24;
-}
-
-static uint32_t
-fetch_pixel_r3g3b2 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint8_t *) bits + offset);
- uint32_t r, g, b;
-
- r = ((pixel & 0xe0) |
- ((pixel & 0xe0) >> 3) |
- ((pixel & 0xc0) >> 6)) << 16;
-
- g = ((pixel & 0x1c) |
- ((pixel & 0x18) >> 3) |
- ((pixel & 0x1c) << 3)) << 8;
-
- b = (((pixel & 0x03) ) |
- ((pixel & 0x03) << 2) |
- ((pixel & 0x03) << 4) |
- ((pixel & 0x03) << 6));
-
- return (0xff000000 | r | g | b);
-}
-
-static uint32_t
-fetch_pixel_b2g3r3 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t p = READ (image, (uint8_t *) bits + offset);
- uint32_t r, g, b;
-
- b = p & 0xc0;
- b |= b >> 2;
- b |= b >> 4;
- b &= 0xff;
-
- g = (p & 0x38) << 10;
- g |= g >> 3;
- g |= g >> 6;
- g &= 0xff00;
-
- r = (p & 0x7) << 21;
- r |= r >> 3;
- r |= r >> 6;
- r &= 0xff0000;
-
- return 0xff000000 | r | g | b;
-}
-
-static uint32_t
-fetch_pixel_a2r2g2b2 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint8_t *) bits + offset);
- uint32_t a, r, g, b;
-
- a = ((pixel & 0xc0) * 0x55) << 18;
- r = ((pixel & 0x30) * 0x55) << 12;
- g = ((pixel & 0x0c) * 0x55) << 6;
- b = ((pixel & 0x03) * 0x55);
-
- return a | r | g | b;
-}
-
-static uint32_t
-fetch_pixel_a2b2g2r2 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint8_t *) bits + offset);
- uint32_t a, r, g, b;
-
- a = ((pixel & 0xc0) * 0x55) << 18;
- b = ((pixel & 0x30) * 0x55) >> 4;
- g = ((pixel & 0x0c) * 0x55) << 6;
- r = ((pixel & 0x03) * 0x55) << 16;
-
- return a | r | g | b;
-}
-
-static uint32_t
-fetch_pixel_c8 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint8_t *) bits + offset);
- const pixman_indexed_t * indexed = image->indexed;
-
- return indexed->rgba[pixel];
-}
-
-static uint32_t
-fetch_pixel_x4a4 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, (uint8_t *) bits + offset);
-
- return ((pixel & 0xf) | ((pixel & 0xf) << 4)) << 24;
-}
-
-static uint32_t
-fetch_pixel_a4 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = FETCH_4 (image, bits, offset);
-
- pixel |= pixel << 4;
- return pixel << 24;
-}
-
-static uint32_t
-fetch_pixel_r1g2b1 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = FETCH_4 (image, bits, offset);
- uint32_t r, g, b;
-
- r = ((pixel & 0x8) * 0xff) << 13;
- g = ((pixel & 0x6) * 0x55) << 7;
- b = ((pixel & 0x1) * 0xff);
-
- return 0xff000000 | r | g | b;
-}
-
-static uint32_t
-fetch_pixel_b1g2r1 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = FETCH_4 (image, bits, offset);
- uint32_t r, g, b;
-
- b = ((pixel & 0x8) * 0xff) >> 3;
- g = ((pixel & 0x6) * 0x55) << 7;
- r = ((pixel & 0x1) * 0xff) << 16;
-
- return 0xff000000 | r | g | b;
-}
-
-static uint32_t
-fetch_pixel_a1r1g1b1 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = FETCH_4 (image, bits, offset);
- uint32_t a, r, g, b;
-
- a = ((pixel & 0x8) * 0xff) << 21;
- r = ((pixel & 0x4) * 0xff) << 14;
- g = ((pixel & 0x2) * 0xff) << 7;
- b = ((pixel & 0x1) * 0xff);
-
- return a | r | g | b;
-}
-
-static uint32_t
-fetch_pixel_a1b1g1r1 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = FETCH_4 (image, bits, offset);
- uint32_t a, r, g, b;
-
- a = ((pixel & 0x8) * 0xff) << 21;
- b = ((pixel & 0x4) * 0xff) >> 2;
- g = ((pixel & 0x2) * 0xff) << 7;
- r = ((pixel & 0x1) * 0xff) << 16;
-
- return a | r | g | b;
-}
-
-static uint32_t
-fetch_pixel_c4 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = FETCH_4 (image, bits, offset);
- const pixman_indexed_t * indexed = image->indexed;
-
- return indexed->rgba[pixel];
-}
-
-static uint32_t
-fetch_pixel_a1 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, bits + (offset >> 5));
- uint32_t a;
-
-#ifdef WORDS_BIGENDIAN
- a = pixel >> (0x1f - (offset & 0x1f));
-#else
- a = pixel >> (offset & 0x1f);
-#endif
- a = a & 1;
- a |= a << 1;
- a |= a << 2;
- a |= a << 4;
-
- return a << 24;
-}
-
-static uint32_t
-fetch_pixel_g1 (bits_image_t *image,
- int offset,
- int line)
-{
- uint32_t *bits = image->bits + line * image->rowstride;
- uint32_t pixel = READ (image, bits + (offset >> 5));
- const pixman_indexed_t * indexed = image->indexed;
- uint32_t a;
-
-#ifdef WORDS_BIGENDIAN
- a = pixel >> (0x1f - (offset & 0x1f));
-#else
- a = pixel >> (offset & 0x1f);
-#endif
- a = a & 1;
-
- return indexed->rgba[a];
-}
-
-static uint32_t
fetch_pixel_yuy2 (bits_image_t *image,
int offset,
int line)
@@ -1883,17 +861,6 @@ fetch_pixel_yv12 (bits_image_t *image,
/*********************************** Store ************************************/
-#define SPLIT_A(v) \
- uint32_t a = ((v) >> 24), \
- r = ((v) >> 16) & 0xff, \
- g = ((v) >> 8) & 0xff, \
- b = (v) & 0xff
-
-#define SPLIT(v) \
- uint32_t r = ((v) >> 16) & 0xff, \
- g = ((v) >> 8) & 0xff, \
- b = (v) & 0xff
-
static void
store_scanline_a2r10g10b10 (bits_image_t * image,
int x,
@@ -1980,829 +947,6 @@ store_scanline_x2b10g10r10 (bits_image_t * image,
}
}
-static void
-store_scanline_a8r8g8b8 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
-
- MEMCPY_WRAPPED (image, ((uint32_t *)bits) + x, values,
- width * sizeof(uint32_t));
-}
-
-static void
-store_scanline_x8r8g8b8 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint32_t *pixel = (uint32_t *)bits + x;
- int i;
-
- for (i = 0; i < width; ++i)
- WRITE (image, pixel++, values[i] & 0xffffff);
-}
-
-static void
-store_scanline_a8b8g8r8 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint32_t *pixel = (uint32_t *)bits + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- WRITE (image, pixel++,
- (values[i] & 0xff00ff00) |
- ((values[i] >> 16) & 0xff) |
- ((values[i] & 0xff) << 16));
- }
-}
-
-static void
-store_scanline_x8b8g8r8 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint32_t *pixel = (uint32_t *)bits + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- WRITE (image, pixel++,
- (values[i] & 0x0000ff00) |
- ((values[i] >> 16) & 0xff) |
- ((values[i] & 0xff) << 16));
- }
-}
-
-static void
-store_scanline_b8g8r8a8 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint32_t *pixel = (uint32_t *)bits + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- WRITE (image, pixel++,
- ((values[i] >> 24) & 0x000000ff) |
- ((values[i] >> 8) & 0x0000ff00) |
- ((values[i] << 8) & 0x00ff0000) |
- ((values[i] << 24) & 0xff000000));
- }
-}
-
-static void
-store_scanline_b8g8r8x8 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint32_t *pixel = (uint32_t *)bits + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- WRITE (image, pixel++,
- ((values[i] >> 8) & 0x0000ff00) |
- ((values[i] << 8) & 0x00ff0000) |
- ((values[i] << 24) & 0xff000000));
- }
-}
-
-static void
-store_scanline_r8g8b8a8 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint32_t *pixel = (uint32_t *)bits + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- WRITE (image, pixel++,
- ((values[i] >> 24) & 0x000000ff) | (values[i] << 8));
- }
-}
-
-static void
-store_scanline_r8g8b8x8 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint32_t *pixel = (uint32_t *)bits + x;
- int i;
-
- for (i = 0; i < width; ++i)
- WRITE (image, pixel++, (values[i] << 8));
-}
-
-static void
-store_scanline_x14r6g6b6 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint32_t *pixel = ((uint32_t *) bits) + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t s = values[i];
- uint32_t r, g, b;
-
- r = (s & 0xfc0000) >> 6;
- g = (s & 0x00fc00) >> 4;
- b = (s & 0x0000fc) >> 2;
-
- WRITE (image, pixel++, r | g | b);
- }
-}
-
-static void
-store_scanline_r8g8b8 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint8_t *pixel = ((uint8_t *) bits) + 3 * x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t val = values[i];
-
-#ifdef WORDS_BIGENDIAN
- WRITE (image, pixel++, (val & 0x00ff0000) >> 16);
- WRITE (image, pixel++, (val & 0x0000ff00) >> 8);
- WRITE (image, pixel++, (val & 0x000000ff) >> 0);
-#else
- WRITE (image, pixel++, (val & 0x000000ff) >> 0);
- WRITE (image, pixel++, (val & 0x0000ff00) >> 8);
- WRITE (image, pixel++, (val & 0x00ff0000) >> 16);
-#endif
- }
-}
-
-static void
-store_scanline_b8g8r8 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint8_t *pixel = ((uint8_t *) bits) + 3 * x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t val = values[i];
-
-#ifdef WORDS_BIGENDIAN
- WRITE (image, pixel++, (val & 0x000000ff) >> 0);
- WRITE (image, pixel++, (val & 0x0000ff00) >> 8);
- WRITE (image, pixel++, (val & 0x00ff0000) >> 16);
-#else
- WRITE (image, pixel++, (val & 0x00ff0000) >> 16);
- WRITE (image, pixel++, (val & 0x0000ff00) >> 8);
- WRITE (image, pixel++, (val & 0x000000ff) >> 0);
-#endif
- }
-}
-
-static void
-store_scanline_r5g6b5 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint16_t *pixel = ((uint16_t *) bits) + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t s = values[i];
-
- WRITE (image, pixel++,
- ((s >> 3) & 0x001f) |
- ((s >> 5) & 0x07e0) |
- ((s >> 8) & 0xf800));
- }
-}
-
-static void
-store_scanline_b5g6r5 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint16_t *pixel = ((uint16_t *) bits) + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- SPLIT (values[i]);
-
- WRITE (image, pixel++,
- ((b << 8) & 0xf800) |
- ((g << 3) & 0x07e0) |
- ((r >> 3) ));
- }
-}
-
-static void
-store_scanline_a1r5g5b5 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint16_t *pixel = ((uint16_t *) bits) + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- SPLIT_A (values[i]);
-
- WRITE (image, pixel++,
- ((a << 8) & 0x8000) |
- ((r << 7) & 0x7c00) |
- ((g << 2) & 0x03e0) |
- ((b >> 3) ));
- }
-}
-
-static void
-store_scanline_x1r5g5b5 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint16_t *pixel = ((uint16_t *) bits) + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- SPLIT (values[i]);
-
- WRITE (image, pixel++,
- ((r << 7) & 0x7c00) |
- ((g << 2) & 0x03e0) |
- ((b >> 3) ));
- }
-}
-
-static void
-store_scanline_a1b5g5r5 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint16_t *pixel = ((uint16_t *) bits) + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- SPLIT_A (values[i]);
-
- WRITE (image, pixel++,
- ((a << 8) & 0x8000) |
- ((b << 7) & 0x7c00) |
- ((g << 2) & 0x03e0) |
- ((r >> 3) ));
- }
-}
-
-static void
-store_scanline_x1b5g5r5 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint16_t *pixel = ((uint16_t *) bits) + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- SPLIT (values[i]);
-
- WRITE (image, pixel++, ((b << 7) & 0x7c00) |
- ((g << 2) & 0x03e0) |
- ((r >> 3) ));
- }
-}
-
-static void
-store_scanline_a4r4g4b4 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint16_t *pixel = ((uint16_t *) bits) + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- SPLIT_A (values[i]);
-
- WRITE (image, pixel++,
- ((a << 8) & 0xf000) |
- ((r << 4) & 0x0f00) |
- ((g ) & 0x00f0) |
- ((b >> 4) ));
- }
-}
-
-static void
-store_scanline_x4r4g4b4 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint16_t *pixel = ((uint16_t *) bits) + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- SPLIT (values[i]);
-
- WRITE (image, pixel++,
- ((r << 4) & 0x0f00) |
- ((g ) & 0x00f0) |
- ((b >> 4) ));
- }
-}
-
-static void
-store_scanline_a4b4g4r4 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint16_t *pixel = ((uint16_t *) bits) + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- SPLIT_A (values[i]);
- WRITE (image, pixel++, ((a << 8) & 0xf000) |
- ((b << 4) & 0x0f00) |
- ((g ) & 0x00f0) |
- ((r >> 4) ));
- }
-}
-
-static void
-store_scanline_x4b4g4r4 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint16_t *pixel = ((uint16_t *) bits) + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- SPLIT (values[i]);
-
- WRITE (image, pixel++,
- ((b << 4) & 0x0f00) |
- ((g ) & 0x00f0) |
- ((r >> 4) ));
- }
-}
-
-static void
-store_scanline_a8 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint8_t *pixel = ((uint8_t *) bits) + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- WRITE (image, pixel++, values[i] >> 24);
- }
-}
-
-static void
-store_scanline_r3g3b2 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint8_t *pixel = ((uint8_t *) bits) + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- SPLIT (values[i]);
-
- WRITE (image, pixel++,
- ((r ) & 0xe0) |
- ((g >> 3) & 0x1c) |
- ((b >> 6) ));
- }
-}
-
-static void
-store_scanline_b2g3r3 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint8_t *pixel = ((uint8_t *) bits) + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- SPLIT (values[i]);
-
- WRITE (image, pixel++,
- ((b ) & 0xc0) |
- ((g >> 2) & 0x38) |
- ((r >> 5) ));
- }
-}
-
-static void
-store_scanline_a2r2g2b2 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint8_t *pixel = ((uint8_t *) bits) + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- SPLIT_A (values[i]);
-
- WRITE (image, pixel++,
- ((a ) & 0xc0) |
- ((r >> 2) & 0x30) |
- ((g >> 4) & 0x0c) |
- ((b >> 6) ));
- }
-}
-
-static void
-store_scanline_a2b2g2r2 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint8_t *pixel = ((uint8_t *) bits) + x;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- SPLIT_A (values[i]);
-
- WRITE (image, pixel++,
- ((a ) & 0xc0) |
- ((b >> 2) & 0x30) |
- ((g >> 4) & 0x0c) |
- ((r >> 6) ));
- }
-}
-
-static void
-store_scanline_c8 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint8_t *pixel = ((uint8_t *) bits) + x;
- const pixman_indexed_t *indexed = image->indexed;
- int i;
-
- for (i = 0; i < width; ++i)
- WRITE (image, pixel++, RGB24_TO_ENTRY (indexed,values[i]));
-}
-
-static void
-store_scanline_g8 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint8_t *pixel = ((uint8_t *) bits) + x;
- const pixman_indexed_t *indexed = image->indexed;
- int i;
-
- for (i = 0; i < width; ++i)
- WRITE (image, pixel++, RGB24_TO_ENTRY_Y (indexed,values[i]));
-}
-
-static void
-store_scanline_x4a4 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- uint8_t *pixel = ((uint8_t *) bits) + x;
- int i;
-
- for (i = 0; i < width; ++i)
- WRITE (image, pixel++, values[i] >> 28);
-}
-
-#define STORE_8(img,l,o,v) (WRITE (img, (uint8_t *)(l) + ((o) >> 3), (v)))
-#ifdef WORDS_BIGENDIAN
-
-#define STORE_4(img,l,o,v) \
- do \
- { \
- int bo = 4 * (o); \
- int v4 = (v) & 0x0f; \
- \
- STORE_8 (img, l, bo, ( \
- bo & 4 ? \
- (FETCH_8 (img, l, bo) & 0xf0) | (v4) : \
- (FETCH_8 (img, l, bo) & 0x0f) | (v4 << 4))); \
- } while (0)
-#else
-
-#define STORE_4(img,l,o,v) \
- do \
- { \
- int bo = 4 * (o); \
- int v4 = (v) & 0x0f; \
- \
- STORE_8 (img, l, bo, ( \
- bo & 4 ? \
- (FETCH_8 (img, l, bo) & 0x0f) | (v4 << 4) : \
- (FETCH_8 (img, l, bo) & 0xf0) | (v4))); \
- } while (0)
-#endif
-
-static void
-store_scanline_a4 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- int i;
-
- for (i = 0; i < width; ++i)
- STORE_4 (image, bits, i + x, values[i] >> 28);
-}
-
-static void
-store_scanline_r1g2b1 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t pixel;
-
- SPLIT (values[i]);
- pixel = (((r >> 4) & 0x8) |
- ((g >> 5) & 0x6) |
- ((b >> 7) ));
- STORE_4 (image, bits, i + x, pixel);
- }
-}
-
-static void
-store_scanline_b1g2r1 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t pixel;
-
- SPLIT (values[i]);
- pixel = (((b >> 4) & 0x8) |
- ((g >> 5) & 0x6) |
- ((r >> 7) ));
- STORE_4 (image, bits, i + x, pixel);
- }
-}
-
-static void
-store_scanline_a1r1g1b1 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t pixel;
-
- SPLIT_A (values[i]);
- pixel = (((a >> 4) & 0x8) |
- ((r >> 5) & 0x4) |
- ((g >> 6) & 0x2) |
- ((b >> 7) ));
-
- STORE_4 (image, bits, i + x, pixel);
- }
-}
-
-static void
-store_scanline_a1b1g1r1 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t pixel;
-
- SPLIT_A (values[i]);
- pixel = (((a >> 4) & 0x8) |
- ((b >> 5) & 0x4) |
- ((g >> 6) & 0x2) |
- ((r >> 7) ));
-
- STORE_4 (image, bits, i + x, pixel);
- }
-}
-
-static void
-store_scanline_c4 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- const pixman_indexed_t *indexed = image->indexed;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t pixel;
-
- pixel = RGB24_TO_ENTRY (indexed, values[i]);
- STORE_4 (image, bits, i + x, pixel);
- }
-}
-
-static void
-store_scanline_g4 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- const pixman_indexed_t *indexed = image->indexed;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t pixel;
-
- pixel = RGB24_TO_ENTRY_Y (indexed, values[i]);
- STORE_4 (image, bits, i + x, pixel);
- }
-}
-
-static void
-store_scanline_a1 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t *pixel = ((uint32_t *) bits) + ((i + x) >> 5);
- uint32_t mask, v;
-
-#ifdef WORDS_BIGENDIAN
- mask = 1 << (0x1f - ((i + x) & 0x1f));
-#else
- mask = 1 << ((i + x) & 0x1f);
-#endif
- v = values[i] & 0x80000000 ? mask : 0;
-
- WRITE (image, pixel, (READ (image, pixel) & ~mask) | v);
- }
-}
-
-static void
-store_scanline_g1 (bits_image_t * image,
- int x,
- int y,
- int width,
- const uint32_t *values)
-{
- uint32_t *bits = image->bits + image->rowstride * y;
- const pixman_indexed_t *indexed = image->indexed;
- int i;
-
- for (i = 0; i < width; ++i)
- {
- uint32_t *pixel = ((uint32_t *) bits) + ((i + x) >> 5);
- uint32_t mask, v;
-
-#ifdef WORDS_BIGENDIAN
- mask = 1 << (0x1f - ((i + x) & 0x1f));
-#else
- mask = 1 << ((i + x) & 0x1f);
-#endif
- v = RGB24_TO_ENTRY_Y (indexed, values[i]) & 0x1 ? mask : 0;
-
- WRITE (image, pixel, (READ (image, pixel) & ~mask) | v);
- }
-}
-
/*
* Contracts a 64bpp image to 32bpp and then stores it using a regular 32-bit
* store proc. Despite the type, this function expects a uint64_t buffer.
@@ -2844,7 +988,7 @@ fetch_scanline_generic_64 (pixman_image_t *image,
const uint32_t *mask)
{
pixman_format_code_t format;
-
+
/* Fetch the pixels into the first half of buffer and then expand them in
* place.
*/
@@ -2858,10 +1002,10 @@ fetch_scanline_generic_64 (pixman_image_t *image,
* precision, so when expanding we shouldn't correct
* for the width of the channels
*/
-
+
format = PIXMAN_a8r8g8b8;
}
-
+
pixman_expand ((uint64_t *)buffer, buffer, format, width);
}
@@ -2883,10 +1027,10 @@ fetch_pixel_generic_64 (bits_image_t *image,
* precision, so when expanding we shouldn't correct
* for the width of the channels
*/
-
+
format = PIXMAN_a8r8g8b8;
}
-
+
pixman_expand ((uint64_t *)&result, &pixel32, format, 1);
return result;
@@ -2905,7 +1049,7 @@ fetch_pixel_generic_lossy_32 (bits_image_t *image,
{
uint64_t pixel64 = image->fetch_pixel_64 (image, offset, line);
uint32_t result;
-
+
pixman_contract (&result, &pixel64, 1);
return result;
@@ -2970,8 +1114,6 @@ static const format_info_t accessors[] =
FORMAT_INFO (c8),
-#define fetch_scanline_g8 fetch_scanline_c8
-#define fetch_pixel_g8 fetch_pixel_c8
FORMAT_INFO (g8),
#define fetch_scanline_x4c4 fetch_scanline_c8
@@ -2979,8 +1121,8 @@ static const format_info_t accessors[] =
#define store_scanline_x4c4 store_scanline_c8
FORMAT_INFO (x4c4),
-#define fetch_scanline_x4g4 fetch_scanline_c8
-#define fetch_pixel_x4g4 fetch_pixel_c8
+#define fetch_scanline_x4g4 fetch_scanline_g8
+#define fetch_pixel_x4g4 fetch_pixel_g8
#define store_scanline_x4g4 store_scanline_g8
FORMAT_INFO (x4g4),
@@ -2995,8 +1137,6 @@ static const format_info_t accessors[] =
FORMAT_INFO (c4),
-#define fetch_scanline_g4 fetch_scanline_c4
-#define fetch_pixel_g4 fetch_pixel_c4
FORMAT_INFO (g4),
/* 1bpp formats */
diff --git a/pixman/pixman/pixman-combine.c.template b/pixman/pixman/pixman-combine.c.template
index 806a18498..c17bcea5d 100644
--- a/pixman/pixman/pixman-combine.c.template
+++ b/pixman/pixman/pixman-combine.c.template
@@ -1143,9 +1143,7 @@ PDF_NON_SEPARABLE_BLEND_MODE (hsl_luminosity)
#undef CH_MIN
#undef PDF_NON_SEPARABLE_BLEND_MODE
-/* Overlay
- *
- * All of the disjoint composing functions
+/* All of the disjoint/conjoint composing functions
*
* The four entries in the first column indicate what source contributions
* come from each of the four areas of the picture -- areas covered by neither
@@ -1166,6 +1164,9 @@ PDF_NON_SEPARABLE_BLEND_MODE (hsl_luminosity)
* (0,0,B,A) max(1-(1-b)/a,0) min(1,(1-a)/b) min(1,b/a) max(1-a/b,0)
* (0,A,0,B) min(1,(1-b)/a) max(1-(1-a)/b,0) max(1-b/a,0) min(1,a/b)
* (0,A,B,0) min(1,(1-b)/a) min(1,(1-a)/b) max(1-b/a,0) max(1-a/b,0)
+ *
+ * See http://marc.info/?l=xfree-render&m=99792000027857&w=2 for more
+ * information about these operators.
*/
#define COMBINE_A_OUT 1
diff --git a/pixman/pixman/pixman-fast-path.c b/pixman/pixman/pixman-fast-path.c
index bbdc8e8b0..033efd7b1 100644
--- a/pixman/pixman/pixman-fast-path.c
+++ b/pixman/pixman/pixman-fast-path.c
@@ -1764,7 +1764,7 @@ static const pixman_fast_path_t c_fast_paths[] =
#define SIMPLE_ROTATE_FLAGS(angle) \
(FAST_PATH_ROTATE_ ## angle ## _TRANSFORM | \
FAST_PATH_NEAREST_FILTER | \
- FAST_PATH_SAMPLES_COVER_CLIP | \
+ FAST_PATH_SAMPLES_COVER_CLIP_NEAREST | \
FAST_PATH_STANDARD_FLAGS)
#define SIMPLE_ROTATE_FAST_PATH(op,s,d,suffix) \
diff --git a/pixman/pixman/pixman-image.c b/pixman/pixman/pixman-image.c
index 84bacf87e..a3bb9b63a 100644
--- a/pixman/pixman/pixman-image.c
+++ b/pixman/pixman/pixman-image.c
@@ -250,6 +250,47 @@ compute_image_info (pixman_image_t *image)
case PIXMAN_FILTER_GOOD:
case PIXMAN_FILTER_BEST:
flags |= (FAST_PATH_BILINEAR_FILTER | FAST_PATH_NO_CONVOLUTION_FILTER);
+
+ /* Here we have a chance to optimize BILINEAR filter to NEAREST if
+ * they are equivalent for the currently used transformation matrix.
+ */
+ if (flags & FAST_PATH_ID_TRANSFORM)
+ {
+ flags |= FAST_PATH_NEAREST_FILTER;
+ }
+ else if (
+ /* affine and integer translation components in matrix ... */
+ ((flags & FAST_PATH_AFFINE_TRANSFORM) &&
+ !pixman_fixed_frac (image->common.transform->matrix[0][2] |
+ image->common.transform->matrix[1][2])) &&
+ (
+ /* ... combined with a simple rotation */
+ (flags & (FAST_PATH_ROTATE_90_TRANSFORM |
+ FAST_PATH_ROTATE_180_TRANSFORM |
+ FAST_PATH_ROTATE_270_TRANSFORM)) ||
+ /* ... or combined with a simple non-rotated translation */
+ (image->common.transform->matrix[0][0] == pixman_fixed_1 &&
+ image->common.transform->matrix[1][1] == pixman_fixed_1 &&
+ image->common.transform->matrix[0][1] == 0 &&
+ image->common.transform->matrix[1][0] == 0)
+ )
+ )
+ {
+ /* FIXME: there are some affine-test failures, showing that
+ * handling of BILINEAR and NEAREST filter is not quite
+ * equivalent when getting close to 32K for the translation
+ * components of the matrix. That's likely some bug, but for
+ * now just skip BILINEAR->NEAREST optimization in this case.
+ */
+ pixman_fixed_t magic_limit = pixman_int_to_fixed (30000);
+ if (image->common.transform->matrix[0][2] <= magic_limit &&
+ image->common.transform->matrix[1][2] <= magic_limit &&
+ image->common.transform->matrix[0][2] >= -magic_limit &&
+ image->common.transform->matrix[1][2] >= -magic_limit)
+ {
+ flags |= FAST_PATH_NEAREST_FILTER;
+ }
+ }
break;
case PIXMAN_FILTER_CONVOLUTION:
diff --git a/pixman/pixman/pixman-inlines.h b/pixman/pixman/pixman-inlines.h
index f1e0cbd77..3532867a4 100644
--- a/pixman/pixman/pixman-inlines.h
+++ b/pixman/pixman/pixman-inlines.h
@@ -585,7 +585,7 @@ fast_composite_scaled_nearest ## scale_func_name (pixman_implementation_t *imp,
#define SIMPLE_NEAREST_FAST_PATH_COVER(op,s,d,func) \
{ PIXMAN_OP_ ## op, \
PIXMAN_ ## s, \
- SCALED_NEAREST_FLAGS | FAST_PATH_SAMPLES_COVER_CLIP, \
+ SCALED_NEAREST_FLAGS | FAST_PATH_SAMPLES_COVER_CLIP_NEAREST, \
PIXMAN_null, 0, \
PIXMAN_ ## d, FAST_PATH_STD_DEST_FLAGS, \
fast_composite_scaled_nearest_ ## func ## _cover ## _ ## op, \
@@ -627,7 +627,7 @@ fast_composite_scaled_nearest ## scale_func_name (pixman_implementation_t *imp,
#define SIMPLE_NEAREST_A8_MASK_FAST_PATH_COVER(op,s,d,func) \
{ PIXMAN_OP_ ## op, \
PIXMAN_ ## s, \
- SCALED_NEAREST_FLAGS | FAST_PATH_SAMPLES_COVER_CLIP, \
+ SCALED_NEAREST_FLAGS | FAST_PATH_SAMPLES_COVER_CLIP_NEAREST, \
PIXMAN_a8, MASK_FLAGS (a8, FAST_PATH_UNIFIED_ALPHA), \
PIXMAN_ ## d, FAST_PATH_STD_DEST_FLAGS, \
fast_composite_scaled_nearest_ ## func ## _cover ## _ ## op, \
@@ -669,7 +669,7 @@ fast_composite_scaled_nearest ## scale_func_name (pixman_implementation_t *imp,
#define SIMPLE_NEAREST_SOLID_MASK_FAST_PATH_COVER(op,s,d,func) \
{ PIXMAN_OP_ ## op, \
PIXMAN_ ## s, \
- SCALED_NEAREST_FLAGS | FAST_PATH_SAMPLES_COVER_CLIP, \
+ SCALED_NEAREST_FLAGS | FAST_PATH_SAMPLES_COVER_CLIP_NEAREST, \
PIXMAN_solid, MASK_FLAGS (solid, FAST_PATH_UNIFIED_ALPHA), \
PIXMAN_ ## d, FAST_PATH_STD_DEST_FLAGS, \
fast_composite_scaled_nearest_ ## func ## _cover ## _ ## op, \
@@ -1157,7 +1157,7 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
#define SIMPLE_BILINEAR_FAST_PATH_COVER(op,s,d,func) \
{ PIXMAN_OP_ ## op, \
PIXMAN_ ## s, \
- SCALED_BILINEAR_FLAGS | FAST_PATH_SAMPLES_COVER_CLIP, \
+ SCALED_BILINEAR_FLAGS | FAST_PATH_SAMPLES_COVER_CLIP_BILINEAR, \
PIXMAN_null, 0, \
PIXMAN_ ## d, FAST_PATH_STD_DEST_FLAGS, \
fast_composite_scaled_bilinear_ ## func ## _cover ## _ ## op, \
@@ -1199,7 +1199,7 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
#define SIMPLE_BILINEAR_A8_MASK_FAST_PATH_COVER(op,s,d,func) \
{ PIXMAN_OP_ ## op, \
PIXMAN_ ## s, \
- SCALED_BILINEAR_FLAGS | FAST_PATH_SAMPLES_COVER_CLIP, \
+ SCALED_BILINEAR_FLAGS | FAST_PATH_SAMPLES_COVER_CLIP_BILINEAR, \
PIXMAN_a8, MASK_FLAGS (a8, FAST_PATH_UNIFIED_ALPHA), \
PIXMAN_ ## d, FAST_PATH_STD_DEST_FLAGS, \
fast_composite_scaled_bilinear_ ## func ## _cover ## _ ## op, \
@@ -1241,7 +1241,7 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
#define SIMPLE_BILINEAR_SOLID_MASK_FAST_PATH_COVER(op,s,d,func) \
{ PIXMAN_OP_ ## op, \
PIXMAN_ ## s, \
- SCALED_BILINEAR_FLAGS | FAST_PATH_SAMPLES_COVER_CLIP, \
+ SCALED_BILINEAR_FLAGS | FAST_PATH_SAMPLES_COVER_CLIP_BILINEAR, \
PIXMAN_solid, MASK_FLAGS (solid, FAST_PATH_UNIFIED_ALPHA), \
PIXMAN_ ## d, FAST_PATH_STD_DEST_FLAGS, \
fast_composite_scaled_bilinear_ ## func ## _cover ## _ ## op, \
diff --git a/pixman/pixman/pixman-private.h b/pixman/pixman/pixman-private.h
index a25897d77..6e716c6e6 100644
--- a/pixman/pixman/pixman-private.h
+++ b/pixman/pixman/pixman-private.h
@@ -609,14 +609,15 @@ _pixman_iter_get_scanline_noop (pixman_iter_t *iter, const uint32_t *mask);
#define FAST_PATH_IS_OPAQUE (1 << 13)
#define FAST_PATH_NO_NORMAL_REPEAT (1 << 14)
#define FAST_PATH_NO_NONE_REPEAT (1 << 15)
-#define FAST_PATH_SAMPLES_COVER_CLIP (1 << 16)
-#define FAST_PATH_X_UNIT_POSITIVE (1 << 17)
-#define FAST_PATH_AFFINE_TRANSFORM (1 << 18)
-#define FAST_PATH_Y_UNIT_ZERO (1 << 19)
-#define FAST_PATH_BILINEAR_FILTER (1 << 20)
-#define FAST_PATH_ROTATE_90_TRANSFORM (1 << 21)
-#define FAST_PATH_ROTATE_180_TRANSFORM (1 << 22)
-#define FAST_PATH_ROTATE_270_TRANSFORM (1 << 23)
+#define FAST_PATH_X_UNIT_POSITIVE (1 << 16)
+#define FAST_PATH_AFFINE_TRANSFORM (1 << 17)
+#define FAST_PATH_Y_UNIT_ZERO (1 << 18)
+#define FAST_PATH_BILINEAR_FILTER (1 << 19)
+#define FAST_PATH_ROTATE_90_TRANSFORM (1 << 20)
+#define FAST_PATH_ROTATE_180_TRANSFORM (1 << 21)
+#define FAST_PATH_ROTATE_270_TRANSFORM (1 << 22)
+#define FAST_PATH_SAMPLES_COVER_CLIP_NEAREST (1 << 23)
+#define FAST_PATH_SAMPLES_COVER_CLIP_BILINEAR (1 << 24)
#define FAST_PATH_PAD_REPEAT \
(FAST_PATH_NO_NONE_REPEAT | \
@@ -652,7 +653,7 @@ _pixman_iter_get_scanline_noop (pixman_iter_t *iter, const uint32_t *mask);
#define SOURCE_FLAGS(format) \
(FAST_PATH_STANDARD_FLAGS | \
((PIXMAN_ ## format == PIXMAN_solid) ? \
- 0 : (FAST_PATH_SAMPLES_COVER_CLIP | FAST_PATH_ID_TRANSFORM)))
+ 0 : (FAST_PATH_SAMPLES_COVER_CLIP_NEAREST | FAST_PATH_NEAREST_FILTER | FAST_PATH_ID_TRANSFORM)))
#define MASK_FLAGS(format, extra) \
((PIXMAN_ ## format == PIXMAN_null) ? 0 : (SOURCE_FLAGS (format) | extra))
@@ -783,6 +784,49 @@ pixman_region16_copy_from_region32 (pixman_region16_t *dst,
# define SCREEN_SHIFT_RIGHT(x,n) ((x) << (n))
#endif
+static force_inline uint32_t
+unorm_to_unorm (uint32_t val, int from_bits, int to_bits)
+{
+ uint32_t result;
+
+ if (from_bits == 0)
+ return 0;
+
+ /* Delete any extra bits */
+ val &= ((1 << from_bits) - 1);
+
+ if (from_bits >= to_bits)
+ return val >> (from_bits - to_bits);
+
+ /* Start out with the high bit of val in the high bit of result. */
+ result = val << (to_bits - from_bits);
+
+ /* Copy the bits in result, doubling the number of bits each time, until
+ * we fill all to_bits. Unrolled manually because from_bits and to_bits
+ * are usually known statically, so the compiler can turn all of this
+ * into a few shifts.
+ */
+#define REPLICATE() \
+ do \
+ { \
+ if (from_bits < to_bits) \
+ { \
+ result |= result >> from_bits; \
+ \
+ from_bits *= 2; \
+ } \
+ } \
+ while (0)
+
+ REPLICATE();
+ REPLICATE();
+ REPLICATE();
+ REPLICATE();
+ REPLICATE();
+
+ return result;
+}
+
/*
* Various debugging code
*/
diff --git a/pixman/pixman/pixman-utils.c b/pixman/pixman/pixman-utils.c
index 49e3488aa..768ca1b89 100644
--- a/pixman/pixman/pixman-utils.c
+++ b/pixman/pixman/pixman-utils.c
@@ -72,31 +72,6 @@ pixman_malloc_abc (unsigned int a,
}
/*
- * Helper routine to expand a color component from 0 < n <= 8 bits to 16
- * bits by replication.
- */
-static inline uint64_t
-expand16 (const uint8_t val, int nbits)
-{
- /* Start out with the high bit of val in the high bit of result. */
- uint16_t result = (uint16_t)val << (16 - nbits);
-
- if (nbits == 0)
- return 0;
-
- /* Copy the bits in result, doubling the number of bits each time, until
- * we fill all 16 bits.
- */
- while (nbits < 16)
- {
- result |= result >> nbits;
- nbits *= 2;
- }
-
- return result;
-}
-
-/*
* This function expands images from ARGB8 format to ARGB16. To preserve
* precision, it needs to know the original source format. For example, if the
* source was PIXMAN_x1r5g5b5 and the red component contained bits 12345, then
@@ -137,10 +112,11 @@ pixman_expand (uint64_t * dst,
r = (pixel >> r_shift) & r_mask,
g = (pixel >> g_shift) & g_mask,
b = (pixel >> b_shift) & b_mask;
- const uint64_t a16 = a_size ? expand16 (a, a_size) : 0xffff,
- r16 = expand16 (r, r_size),
- g16 = expand16 (g, g_size),
- b16 = expand16 (b, b_size);
+ const uint64_t
+ a16 = a_size ? unorm_to_unorm (a, a_size, 16) : 0xffff,
+ r16 = unorm_to_unorm (r, r_size, 16),
+ g16 = unorm_to_unorm (g, g_size, 16),
+ b16 = unorm_to_unorm (b, b_size, 16);
dst[i] = a16 << 48 | r16 << 32 | g16 << 16 | b16;
}
diff --git a/pixman/pixman/pixman.c b/pixman/pixman/pixman.c
index 75b80c058..87f5a933a 100644
--- a/pixman/pixman/pixman.c
+++ b/pixman/pixman/pixman.c
@@ -446,109 +446,89 @@ update_cache:
return TRUE;
}
+typedef struct
+{
+ pixman_fixed_48_16_t x1;
+ pixman_fixed_48_16_t y1;
+ pixman_fixed_48_16_t x2;
+ pixman_fixed_48_16_t y2;
+} box_48_16_t;
+
static pixman_bool_t
-compute_sample_extents (pixman_transform_t *transform,
- pixman_box32_t *extents, int x, int y,
- pixman_fixed_t x_off, pixman_fixed_t y_off,
- pixman_fixed_t width, pixman_fixed_t height)
+compute_transformed_extents (pixman_transform_t *transform,
+ const pixman_box32_t *extents,
+ box_48_16_t *transformed)
{
- pixman_fixed_t x1, y1, x2, y2;
pixman_fixed_48_16_t tx1, ty1, tx2, ty2;
+ pixman_fixed_t x1, y1, x2, y2;
+ int i;
- /* We have checked earlier that (extents->x1 - x) etc. fit in a pixman_fixed_t */
- x1 = (pixman_fixed_48_16_t)pixman_int_to_fixed (extents->x1 - x) + pixman_fixed_1 / 2;
- y1 = (pixman_fixed_48_16_t)pixman_int_to_fixed (extents->y1 - y) + pixman_fixed_1 / 2;
- x2 = (pixman_fixed_48_16_t)pixman_int_to_fixed (extents->x2 - x) - pixman_fixed_1 / 2;
- y2 = (pixman_fixed_48_16_t)pixman_int_to_fixed (extents->y2 - y) - pixman_fixed_1 / 2;
+ x1 = pixman_int_to_fixed (extents->x1) + pixman_fixed_1 / 2;
+ y1 = pixman_int_to_fixed (extents->y1) + pixman_fixed_1 / 2;
+ x2 = pixman_int_to_fixed (extents->x2) - pixman_fixed_1 / 2;
+ y2 = pixman_int_to_fixed (extents->y2) - pixman_fixed_1 / 2;
if (!transform)
{
- tx1 = (pixman_fixed_48_16_t)x1;
- ty1 = (pixman_fixed_48_16_t)y1;
- tx2 = (pixman_fixed_48_16_t)x2;
- ty2 = (pixman_fixed_48_16_t)y2;
+ transformed->x1 = x1;
+ transformed->y1 = y1;
+ transformed->x2 = x2;
+ transformed->y2 = y2;
+
+ return TRUE;
}
- else
- {
- int i;
- /* Silence GCC */
- tx1 = ty1 = tx2 = ty2 = 0;
-
- for (i = 0; i < 4; ++i)
- {
- pixman_fixed_48_16_t tx, ty;
- pixman_vector_t v;
+ tx1 = ty1 = INT64_MAX;
+ tx2 = ty2 = INT64_MIN;
- v.vector[0] = (i & 0x01)? x1 : x2;
- v.vector[1] = (i & 0x02)? y1 : y2;
- v.vector[2] = pixman_fixed_1;
+ for (i = 0; i < 4; ++i)
+ {
+ pixman_fixed_48_16_t tx, ty;
+ pixman_vector_t v;
- if (!pixman_transform_point (transform, &v))
- return FALSE;
+ v.vector[0] = (i & 0x01)? x1 : x2;
+ v.vector[1] = (i & 0x02)? y1 : y2;
+ v.vector[2] = pixman_fixed_1;
- tx = (pixman_fixed_48_16_t)v.vector[0];
- ty = (pixman_fixed_48_16_t)v.vector[1];
+ if (!pixman_transform_point (transform, &v))
+ return FALSE;
- if (i == 0)
- {
- tx1 = tx;
- ty1 = ty;
- tx2 = tx;
- ty2 = ty;
- }
- else
- {
- if (tx < tx1)
- tx1 = tx;
- if (ty < ty1)
- ty1 = ty;
- if (tx > tx2)
- tx2 = tx;
- if (ty > ty2)
- ty2 = ty;
- }
- }
+ tx = (pixman_fixed_48_16_t)v.vector[0];
+ ty = (pixman_fixed_48_16_t)v.vector[1];
+
+ if (tx < tx1)
+ tx1 = tx;
+ if (ty < ty1)
+ ty1 = ty;
+ if (tx > tx2)
+ tx2 = tx;
+ if (ty > ty2)
+ ty2 = ty;
}
- /* Expand the source area by a tiny bit so account of different rounding that
- * may happen during sampling. Note that (8 * pixman_fixed_e) is very far from
- * 0.5 so this won't cause the area computed to be overly pessimistic.
- */
- tx1 += x_off - 8 * pixman_fixed_e;
- ty1 += y_off - 8 * pixman_fixed_e;
- tx2 += x_off + width + 8 * pixman_fixed_e;
- ty2 += y_off + height + 8 * pixman_fixed_e;
-
- if (tx1 < pixman_min_fixed_48_16 || tx1 > pixman_max_fixed_48_16 ||
- ty1 < pixman_min_fixed_48_16 || ty1 > pixman_max_fixed_48_16 ||
- tx2 < pixman_min_fixed_48_16 || tx2 > pixman_max_fixed_48_16 ||
- ty2 < pixman_min_fixed_48_16 || ty2 > pixman_max_fixed_48_16)
- {
- return FALSE;
- }
- else
- {
- extents->x1 = pixman_fixed_to_int (tx1);
- extents->y1 = pixman_fixed_to_int (ty1);
- extents->x2 = pixman_fixed_to_int (tx2) + 1;
- extents->y2 = pixman_fixed_to_int (ty2) + 1;
+ transformed->x1 = tx1;
+ transformed->y1 = ty1;
+ transformed->x2 = tx2;
+ transformed->y2 = ty2;
- return TRUE;
- }
+ return TRUE;
}
#define IS_16BIT(x) (((x) >= INT16_MIN) && ((x) <= INT16_MAX))
+#define ABS(f) (((f) < 0)? (-(f)) : (f))
+#define IS_16_16(f) (((f) >= pixman_min_fixed_48_16 && ((f) <= pixman_max_fixed_48_16)))
static pixman_bool_t
-analyze_extent (pixman_image_t *image, int x, int y,
- const pixman_box32_t *extents, uint32_t *flags)
+analyze_extent (pixman_image_t *image,
+ const pixman_box32_t *extents,
+ uint32_t *flags)
{
pixman_transform_t *transform;
- pixman_fixed_t *params;
pixman_fixed_t x_off, y_off;
pixman_fixed_t width, height;
- pixman_box32_t ex;
+ pixman_fixed_t *params;
+ box_48_16_t transformed;
+ pixman_box32_t exp_extents;
if (!image)
return TRUE;
@@ -558,10 +538,10 @@ analyze_extent (pixman_image_t *image, int x, int y,
* check here that the expanded-by-one source
* extents in destination space fits in 16 bits
*/
- if (!IS_16BIT (extents->x1 - x - 1) ||
- !IS_16BIT (extents->y1 - y - 1) ||
- !IS_16BIT (extents->x2 - x + 1) ||
- !IS_16BIT (extents->y2 - y + 1))
+ if (!IS_16BIT (extents->x1 - 1) ||
+ !IS_16BIT (extents->y1 - 1) ||
+ !IS_16BIT (extents->x2 + 1) ||
+ !IS_16BIT (extents->y2 + 1))
{
return FALSE;
}
@@ -576,18 +556,16 @@ analyze_extent (pixman_image_t *image, int x, int y,
if (image->bits.width >= 0x7fff || image->bits.height >= 0x7fff)
return FALSE;
-#define ID_AND_NEAREST (FAST_PATH_ID_TRANSFORM | FAST_PATH_NEAREST_FILTER)
-
- if ((image->common.flags & ID_AND_NEAREST) == ID_AND_NEAREST &&
- extents->x1 - x >= 0 &&
- extents->y1 - y >= 0 &&
- extents->x2 - x <= image->bits.width &&
- extents->y2 - y <= image->bits.height)
+ if ((image->common.flags & FAST_PATH_ID_TRANSFORM) == FAST_PATH_ID_TRANSFORM &&
+ extents->x1 >= 0 &&
+ extents->y1 >= 0 &&
+ extents->x2 <= image->bits.width &&
+ extents->y2 <= image->bits.height)
{
- *flags |= FAST_PATH_SAMPLES_COVER_CLIP;
+ *flags |= FAST_PATH_SAMPLES_COVER_CLIP_NEAREST;
return TRUE;
}
-
+
switch (image->common.filter)
{
case PIXMAN_FILTER_CONVOLUTION:
@@ -618,17 +596,6 @@ analyze_extent (pixman_image_t *image, int x, int y,
default:
return FALSE;
}
-
- /* Check whether the non-expanded, transformed extent is entirely within
- * the source image, and set the FAST_PATH_SAMPLES_COVER_CLIP if it is.
- */
- ex = *extents;
- if (compute_sample_extents (transform, &ex, x, y, x_off, y_off, width, height) &&
- ex.x1 >= 0 && ex.y1 >= 0 &&
- ex.x2 <= image->bits.width && ex.y2 <= image->bits.height)
- {
- *flags |= FAST_PATH_SAMPLES_COVER_CLIP;
- }
}
else
{
@@ -638,17 +605,57 @@ analyze_extent (pixman_image_t *image, int x, int y,
height = 0;
}
- /* Check that the extents expanded by one don't overflow. This ensures that
- * compositing functions can simply walk the source space using 16.16
- * variables without worrying about overflow.
+ if (!compute_transformed_extents (transform, extents, &transformed))
+ return FALSE;
+
+ /* Expand the source area by a tiny bit so account of different rounding that
+ * may happen during sampling. Note that (8 * pixman_fixed_e) is very far from
+ * 0.5 so this won't cause the area computed to be overly pessimistic.
*/
- ex.x1 = extents->x1 - 1;
- ex.y1 = extents->y1 - 1;
- ex.x2 = extents->x2 + 1;
- ex.y2 = extents->y2 + 1;
+ transformed.x1 -= 8 * pixman_fixed_e;
+ transformed.y1 -= 8 * pixman_fixed_e;
+ transformed.x2 += 8 * pixman_fixed_e;
+ transformed.y2 += 8 * pixman_fixed_e;
+
+ if (image->common.type == BITS)
+ {
+ if (pixman_fixed_to_int (transformed.x1) >= 0 &&
+ pixman_fixed_to_int (transformed.y1) >= 0 &&
+ pixman_fixed_to_int (transformed.x2) < image->bits.width &&
+ pixman_fixed_to_int (transformed.y2) < image->bits.height)
+ {
+ *flags |= FAST_PATH_SAMPLES_COVER_CLIP_NEAREST;
+ }
+
+ if (pixman_fixed_to_int (transformed.x1 - pixman_fixed_1 / 2) >= 0 &&
+ pixman_fixed_to_int (transformed.y1 - pixman_fixed_1 / 2) >= 0 &&
+ pixman_fixed_to_int (transformed.x2 + pixman_fixed_1 / 2) < image->bits.width &&
+ pixman_fixed_to_int (transformed.y2 + pixman_fixed_1 / 2) < image->bits.height)
+ {
+ *flags |= FAST_PATH_SAMPLES_COVER_CLIP_BILINEAR;
+ }
+ }
- if (!compute_sample_extents (transform, &ex, x, y, x_off, y_off, width, height))
+ /* Check we don't overflow when the destination extents are expanded by one.
+ * This ensures that compositing functions can simply walk the source space
+ * using 16.16 variables without worrying about overflow.
+ */
+ exp_extents = *extents;
+ exp_extents.x1 -= 1;
+ exp_extents.y1 -= 1;
+ exp_extents.x2 += 1;
+ exp_extents.y2 += 1;
+
+ if (!compute_transformed_extents (transform, &exp_extents, &transformed))
+ return FALSE;
+
+ if (!IS_16_16 (transformed.x1 + x_off - 8 * pixman_fixed_e) ||
+ !IS_16_16 (transformed.y1 + y_off - 8 * pixman_fixed_e) ||
+ !IS_16_16 (transformed.x2 + x_off + 8 * pixman_fixed_e + width) ||
+ !IS_16_16 (transformed.y2 + y_off + 8 * pixman_fixed_e + height))
+ {
return FALSE;
+ }
return TRUE;
}
@@ -689,7 +696,7 @@ pixman_image_composite32 (pixman_op_t op,
pixman_format_code_t src_format, mask_format, dest_format;
uint32_t src_flags, mask_flags, dest_flags;
pixman_region32_t region;
- pixman_box32_t *extents;
+ pixman_box32_t extents;
pixman_implementation_t *imp;
pixman_composite_func_t func;
@@ -736,25 +743,46 @@ pixman_image_composite32 (pixman_op_t op,
goto out;
}
- extents = pixman_region32_extents (&region);
+ extents = *pixman_region32_extents (&region);
+
+ extents.x1 -= dest_x - src_x;
+ extents.y1 -= dest_y - src_y;
+ extents.x2 -= dest_x - src_x;
+ extents.y2 -= dest_y - src_y;
- if (!analyze_extent (src, dest_x - src_x, dest_y - src_y, extents, &src_flags))
+ if (!analyze_extent (src, &extents, &src_flags))
goto out;
- if (!analyze_extent (mask, dest_x - mask_x, dest_y - mask_y, extents, &mask_flags))
+ extents.x1 -= src_x - mask_x;
+ extents.y1 -= src_y - mask_y;
+ extents.x2 -= src_x - mask_x;
+ extents.y2 -= src_y - mask_y;
+
+ if (!analyze_extent (mask, &extents, &mask_flags))
goto out;
- /* If the clip is within the source samples, and the samples are opaque,
- * then the source is effectively opaque.
+ /* If the clip is within the source samples, and the samples are
+ * opaque, then the source is effectively opaque.
*/
-#define BOTH (FAST_PATH_SAMPLES_OPAQUE | FAST_PATH_SAMPLES_COVER_CLIP)
-
- if ((src_flags & BOTH) == BOTH)
+#define NEAREST_OPAQUE (FAST_PATH_SAMPLES_OPAQUE | \
+ FAST_PATH_NEAREST_FILTER | \
+ FAST_PATH_SAMPLES_COVER_CLIP_NEAREST)
+#define BILINEAR_OPAQUE (FAST_PATH_SAMPLES_OPAQUE | \
+ FAST_PATH_BILINEAR_FILTER | \
+ FAST_PATH_SAMPLES_COVER_CLIP_BILINEAR)
+
+ if ((src_flags & NEAREST_OPAQUE) == NEAREST_OPAQUE ||
+ (src_flags & BILINEAR_OPAQUE) == BILINEAR_OPAQUE)
+ {
src_flags |= FAST_PATH_IS_OPAQUE;
-
- if ((mask_flags & BOTH) == BOTH)
+ }
+
+ if ((mask_flags & NEAREST_OPAQUE) == NEAREST_OPAQUE ||
+ (mask_flags & BILINEAR_OPAQUE) == BILINEAR_OPAQUE)
+ {
mask_flags |= FAST_PATH_IS_OPAQUE;
-
+ }
+
/*
* Check if we can replace our operator by a simpler one
* if the src or dest are opaque. The output operator should be
diff --git a/pixman/test/affine-test.c b/pixman/test/affine-test.c
index 529ea8f63..a4ceed3da 100644
--- a/pixman/test/affine-test.c
+++ b/pixman/test/affine-test.c
@@ -1,287 +1,311 @@
-/*
- * Test program, which can detect some problems with affine transformations
- * in pixman. Testing is done by running lots of random SRC and OVER
- * compositing operations a8r8g8b8, x8a8r8g8b8, r5g6b5 and a8 color formats
- * with random scaled, rotated and translated transforms.
- *
- * Script 'fuzzer-find-diff.pl' can be used to narrow down the problem in
- * the case of test failure.
- */
-#include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "utils.h"
-
-#define MAX_SRC_WIDTH 16
-#define MAX_SRC_HEIGHT 16
-#define MAX_DST_WIDTH 16
-#define MAX_DST_HEIGHT 16
-#define MAX_STRIDE 4
-
-/*
- * Composite operation with pseudorandom images
- */
-uint32_t
-test_composite (int testnum,
- int verbose)
-{
- int i;
- pixman_image_t * src_img;
- pixman_image_t * dst_img;
- pixman_transform_t transform;
- pixman_region16_t clip;
- int src_width, src_height;
- int dst_width, dst_height;
- int src_stride, dst_stride;
- int src_x, src_y;
- int dst_x, dst_y;
- int src_bpp;
- int dst_bpp;
- int w, h;
- pixman_fixed_t scale_x = 65536, scale_y = 65536;
- pixman_fixed_t translate_x = 0, translate_y = 0;
- pixman_op_t op;
- pixman_repeat_t repeat = PIXMAN_REPEAT_NONE;
- pixman_format_code_t src_fmt, dst_fmt;
- uint32_t * srcbuf;
- uint32_t * dstbuf;
- uint32_t crc32;
- FLOAT_REGS_CORRUPTION_DETECTOR_START ();
-
- lcg_srand (testnum);
-
- src_bpp = (lcg_rand_n (2) == 0) ? 2 : 4;
- dst_bpp = (lcg_rand_n (2) == 0) ? 2 : 4;
- op = (lcg_rand_n (2) == 0) ? PIXMAN_OP_SRC : PIXMAN_OP_OVER;
-
- src_width = lcg_rand_n (MAX_SRC_WIDTH) + 1;
- src_height = lcg_rand_n (MAX_SRC_HEIGHT) + 1;
- dst_width = lcg_rand_n (MAX_DST_WIDTH) + 1;
- dst_height = lcg_rand_n (MAX_DST_HEIGHT) + 1;
- src_stride = src_width * src_bpp + lcg_rand_n (MAX_STRIDE) * src_bpp;
- dst_stride = dst_width * dst_bpp + lcg_rand_n (MAX_STRIDE) * dst_bpp;
-
- if (src_stride & 3)
- src_stride += 2;
-
- if (dst_stride & 3)
- dst_stride += 2;
-
- src_x = -(src_width / 4) + lcg_rand_n (src_width * 3 / 2);
- src_y = -(src_height / 4) + lcg_rand_n (src_height * 3 / 2);
- dst_x = -(dst_width / 4) + lcg_rand_n (dst_width * 3 / 2);
- dst_y = -(dst_height / 4) + lcg_rand_n (dst_height * 3 / 2);
- w = lcg_rand_n (dst_width * 3 / 2 - dst_x);
- h = lcg_rand_n (dst_height * 3 / 2 - dst_y);
-
- srcbuf = (uint32_t *)malloc (src_stride * src_height);
- dstbuf = (uint32_t *)malloc (dst_stride * dst_height);
-
- for (i = 0; i < src_stride * src_height; i++)
- *((uint8_t *)srcbuf + i) = lcg_rand_n (256);
-
- for (i = 0; i < dst_stride * dst_height; i++)
- *((uint8_t *)dstbuf + i) = lcg_rand_n (256);
-
- src_fmt = src_bpp == 4 ? (lcg_rand_n (2) == 0 ?
- PIXMAN_a8r8g8b8 : PIXMAN_x8r8g8b8) : PIXMAN_r5g6b5;
-
- dst_fmt = dst_bpp == 4 ? (lcg_rand_n (2) == 0 ?
- PIXMAN_a8r8g8b8 : PIXMAN_x8r8g8b8) : PIXMAN_r5g6b5;
-
- src_img = pixman_image_create_bits (
- src_fmt, src_width, src_height, srcbuf, src_stride);
-
- dst_img = pixman_image_create_bits (
- dst_fmt, dst_width, dst_height, dstbuf, dst_stride);
-
- image_endian_swap (src_img);
- image_endian_swap (dst_img);
-
- pixman_transform_init_identity (&transform);
-
- if (lcg_rand_n (8) > 0)
- {
- scale_x = -32768 * 3 + lcg_rand_N (65536 * 5);
- scale_y = -32768 * 3 + lcg_rand_N (65536 * 5);
- translate_x = lcg_rand_N (65536);
- translate_y = lcg_rand_N (65536);
- pixman_transform_init_scale (&transform, scale_x, scale_y);
- pixman_transform_translate (&transform, NULL, translate_x, translate_y);
- }
-
- if (lcg_rand_n (4) > 0)
- {
- int c, s, tx = 0, ty = 0;
- switch (lcg_rand_n (4))
- {
- case 0:
- /* 90 degrees */
- c = 0;
- s = pixman_fixed_1;
- tx = pixman_int_to_fixed (MAX_SRC_HEIGHT);
- break;
- case 1:
- /* 180 degrees */
- c = -pixman_fixed_1;
- s = 0;
- tx = pixman_int_to_fixed (MAX_SRC_WIDTH);
- ty = pixman_int_to_fixed (MAX_SRC_HEIGHT);
- break;
- case 2:
- /* 270 degrees */
- c = 0;
- s = -pixman_fixed_1;
- ty = pixman_int_to_fixed (MAX_SRC_WIDTH);
- break;
- default:
- /* arbitrary rotation */
- c = lcg_rand_N (2 * 65536) - 65536;
- s = lcg_rand_N (2 * 65536) - 65536;
- break;
- }
- pixman_transform_rotate (&transform, NULL, c, s);
- pixman_transform_translate (&transform, NULL, tx, ty);
- }
-
- pixman_image_set_transform (src_img, &transform);
-
- switch (lcg_rand_n (4))
- {
- case 0:
- repeat = PIXMAN_REPEAT_NONE;
- break;
-
- case 1:
- repeat = PIXMAN_REPEAT_NORMAL;
- break;
-
- case 2:
- repeat = PIXMAN_REPEAT_PAD;
- break;
-
- case 3:
- repeat = PIXMAN_REPEAT_REFLECT;
- break;
-
- default:
- break;
- }
- pixman_image_set_repeat (src_img, repeat);
-
- if (lcg_rand_n (2))
- pixman_image_set_filter (src_img, PIXMAN_FILTER_NEAREST, NULL, 0);
- else
- pixman_image_set_filter (src_img, PIXMAN_FILTER_BILINEAR, NULL, 0);
-
- if (verbose)
- {
- printf ("src_fmt=%08X, dst_fmt=%08X\n", src_fmt, dst_fmt);
- printf ("op=%d, scale_x=%d, scale_y=%d, repeat=%d\n",
- op, scale_x, scale_y, repeat);
- printf ("translate_x=%d, translate_y=%d\n",
- translate_x, translate_y);
- printf ("src_width=%d, src_height=%d, dst_width=%d, dst_height=%d\n",
- src_width, src_height, dst_width, dst_height);
- printf ("src_x=%d, src_y=%d, dst_x=%d, dst_y=%d\n",
- src_x, src_y, dst_x, dst_y);
- printf ("w=%d, h=%d\n", w, h);
- }
-
- if (lcg_rand_n (8) == 0)
- {
- pixman_box16_t clip_boxes[2];
- int n = lcg_rand_n (2) + 1;
-
- for (i = 0; i < n; i++)
- {
- clip_boxes[i].x1 = lcg_rand_n (src_width);
- clip_boxes[i].y1 = lcg_rand_n (src_height);
- clip_boxes[i].x2 =
- clip_boxes[i].x1 + lcg_rand_n (src_width - clip_boxes[i].x1);
- clip_boxes[i].y2 =
- clip_boxes[i].y1 + lcg_rand_n (src_height - clip_boxes[i].y1);
-
- if (verbose)
- {
- printf ("source clip box: [%d,%d-%d,%d]\n",
- clip_boxes[i].x1, clip_boxes[i].y1,
- clip_boxes[i].x2, clip_boxes[i].y2);
- }
- }
-
- pixman_region_init_rects (&clip, clip_boxes, n);
- pixman_image_set_clip_region (src_img, &clip);
- pixman_image_set_source_clipping (src_img, 1);
- pixman_region_fini (&clip);
- }
-
- if (lcg_rand_n (8) == 0)
- {
- pixman_box16_t clip_boxes[2];
- int n = lcg_rand_n (2) + 1;
- for (i = 0; i < n; i++)
- {
- clip_boxes[i].x1 = lcg_rand_n (dst_width);
- clip_boxes[i].y1 = lcg_rand_n (dst_height);
- clip_boxes[i].x2 =
- clip_boxes[i].x1 + lcg_rand_n (dst_width - clip_boxes[i].x1);
- clip_boxes[i].y2 =
- clip_boxes[i].y1 + lcg_rand_n (dst_height - clip_boxes[i].y1);
-
- if (verbose)
- {
- printf ("destination clip box: [%d,%d-%d,%d]\n",
- clip_boxes[i].x1, clip_boxes[i].y1,
- clip_boxes[i].x2, clip_boxes[i].y2);
- }
- }
- pixman_region_init_rects (&clip, clip_boxes, n);
- pixman_image_set_clip_region (dst_img, &clip);
- pixman_region_fini (&clip);
- }
-
- pixman_image_composite (op, src_img, NULL, dst_img,
- src_x, src_y, 0, 0, dst_x, dst_y, w, h);
-
- if (dst_fmt == PIXMAN_x8r8g8b8)
- {
- /* ignore unused part */
- for (i = 0; i < dst_stride * dst_height / 4; i++)
- dstbuf[i] &= 0xFFFFFF;
- }
-
- image_endian_swap (dst_img);
-
- if (verbose)
- {
- int j;
-
- for (i = 0; i < dst_height; i++)
- {
- for (j = 0; j < dst_stride; j++)
- printf ("%02X ", *((uint8_t *)dstbuf + i * dst_stride + j));
-
- printf ("\n");
- }
- }
-
- pixman_image_unref (src_img);
- pixman_image_unref (dst_img);
-
- crc32 = compute_crc32 (0, dstbuf, dst_stride * dst_height);
- free (srcbuf);
- free (dstbuf);
-
- FLOAT_REGS_CORRUPTION_DETECTOR_FINISH ();
- return crc32;
-}
-
-int
-main (int argc, const char *argv[])
-{
- pixman_disable_out_of_bounds_workaround ();
-
- return fuzzer_test_main ("affine", 8000000, 0x4B5D1852,
- test_composite, argc, argv);
-}
+/*
+ * Test program, which can detect some problems with affine transformations
+ * in pixman. Testing is done by running lots of random SRC and OVER
+ * compositing operations a8r8g8b8, x8a8r8g8b8, r5g6b5 and a8 color formats
+ * with random scaled, rotated and translated transforms.
+ *
+ * Script 'fuzzer-find-diff.pl' can be used to narrow down the problem in
+ * the case of test failure.
+ */
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "utils.h"
+
+#define MAX_SRC_WIDTH 16
+#define MAX_SRC_HEIGHT 16
+#define MAX_DST_WIDTH 16
+#define MAX_DST_HEIGHT 16
+#define MAX_STRIDE 4
+
+/*
+ * Composite operation with pseudorandom images
+ */
+uint32_t
+test_composite (int testnum,
+ int verbose)
+{
+ int i;
+ pixman_image_t * src_img;
+ pixman_image_t * dst_img;
+ pixman_transform_t transform;
+ pixman_region16_t clip;
+ int src_width, src_height;
+ int dst_width, dst_height;
+ int src_stride, dst_stride;
+ int src_x, src_y;
+ int dst_x, dst_y;
+ int src_bpp;
+ int dst_bpp;
+ int w, h;
+ pixman_fixed_t scale_x = 65536, scale_y = 65536;
+ pixman_fixed_t translate_x = 0, translate_y = 0;
+ pixman_op_t op;
+ pixman_repeat_t repeat = PIXMAN_REPEAT_NONE;
+ pixman_format_code_t src_fmt, dst_fmt;
+ uint32_t * srcbuf;
+ uint32_t * dstbuf;
+ uint32_t crc32;
+ FLOAT_REGS_CORRUPTION_DETECTOR_START ();
+
+ lcg_srand (testnum);
+
+ src_bpp = (lcg_rand_n (2) == 0) ? 2 : 4;
+ dst_bpp = (lcg_rand_n (2) == 0) ? 2 : 4;
+ op = (lcg_rand_n (2) == 0) ? PIXMAN_OP_SRC : PIXMAN_OP_OVER;
+
+ src_width = lcg_rand_n (MAX_SRC_WIDTH) + 1;
+ src_height = lcg_rand_n (MAX_SRC_HEIGHT) + 1;
+ dst_width = lcg_rand_n (MAX_DST_WIDTH) + 1;
+ dst_height = lcg_rand_n (MAX_DST_HEIGHT) + 1;
+ src_stride = src_width * src_bpp + lcg_rand_n (MAX_STRIDE) * src_bpp;
+ dst_stride = dst_width * dst_bpp + lcg_rand_n (MAX_STRIDE) * dst_bpp;
+
+ if (src_stride & 3)
+ src_stride += 2;
+
+ if (dst_stride & 3)
+ dst_stride += 2;
+
+ src_x = -(src_width / 4) + lcg_rand_n (src_width * 3 / 2);
+ src_y = -(src_height / 4) + lcg_rand_n (src_height * 3 / 2);
+ dst_x = -(dst_width / 4) + lcg_rand_n (dst_width * 3 / 2);
+ dst_y = -(dst_height / 4) + lcg_rand_n (dst_height * 3 / 2);
+ w = lcg_rand_n (dst_width * 3 / 2 - dst_x);
+ h = lcg_rand_n (dst_height * 3 / 2 - dst_y);
+
+ srcbuf = (uint32_t *)malloc (src_stride * src_height);
+ dstbuf = (uint32_t *)malloc (dst_stride * dst_height);
+
+ for (i = 0; i < src_stride * src_height; i++)
+ *((uint8_t *)srcbuf + i) = lcg_rand_n (256);
+
+ for (i = 0; i < dst_stride * dst_height; i++)
+ *((uint8_t *)dstbuf + i) = lcg_rand_n (256);
+
+ src_fmt = src_bpp == 4 ? (lcg_rand_n (2) == 0 ?
+ PIXMAN_a8r8g8b8 : PIXMAN_x8r8g8b8) : PIXMAN_r5g6b5;
+
+ dst_fmt = dst_bpp == 4 ? (lcg_rand_n (2) == 0 ?
+ PIXMAN_a8r8g8b8 : PIXMAN_x8r8g8b8) : PIXMAN_r5g6b5;
+
+ src_img = pixman_image_create_bits (
+ src_fmt, src_width, src_height, srcbuf, src_stride);
+
+ dst_img = pixman_image_create_bits (
+ dst_fmt, dst_width, dst_height, dstbuf, dst_stride);
+
+ image_endian_swap (src_img);
+ image_endian_swap (dst_img);
+
+ pixman_transform_init_identity (&transform);
+
+ if (lcg_rand_n (3) > 0)
+ {
+ scale_x = -65536 * 3 + lcg_rand_N (65536 * 6);
+ if (lcg_rand_n (2))
+ scale_y = -65536 * 3 + lcg_rand_N (65536 * 6);
+ else
+ scale_y = scale_x;
+ pixman_transform_init_scale (&transform, scale_x, scale_y);
+ }
+ if (lcg_rand_n (3) > 0)
+ {
+ translate_x = -65536 * 3 + lcg_rand_N (6 * 65536);
+ if (lcg_rand_n (2))
+ translate_y = -65536 * 3 + lcg_rand_N (6 * 65536);
+ else
+ translate_y = translate_x;
+ pixman_transform_translate (&transform, NULL, translate_x, translate_y);
+ }
+
+ if (lcg_rand_n (4) > 0)
+ {
+ int c, s, tx = 0, ty = 0;
+ switch (lcg_rand_n (4))
+ {
+ case 0:
+ /* 90 degrees */
+ c = 0;
+ s = pixman_fixed_1;
+ tx = pixman_int_to_fixed (MAX_SRC_HEIGHT);
+ break;
+ case 1:
+ /* 180 degrees */
+ c = -pixman_fixed_1;
+ s = 0;
+ tx = pixman_int_to_fixed (MAX_SRC_WIDTH);
+ ty = pixman_int_to_fixed (MAX_SRC_HEIGHT);
+ break;
+ case 2:
+ /* 270 degrees */
+ c = 0;
+ s = -pixman_fixed_1;
+ ty = pixman_int_to_fixed (MAX_SRC_WIDTH);
+ break;
+ default:
+ /* arbitrary rotation */
+ c = lcg_rand_N (2 * 65536) - 65536;
+ s = lcg_rand_N (2 * 65536) - 65536;
+ break;
+ }
+ pixman_transform_rotate (&transform, NULL, c, s);
+ pixman_transform_translate (&transform, NULL, tx, ty);
+ }
+
+ if (lcg_rand_n (8) == 0)
+ {
+ /* Flip random bits */
+ int maxflipcount = 8;
+ while (maxflipcount--)
+ {
+ int i = lcg_rand_n (2);
+ int j = lcg_rand_n (3);
+ int bitnum = lcg_rand_n (32);
+ transform.matrix[i][j] ^= 1 << bitnum;
+ if (lcg_rand_n (2))
+ break;
+ }
+ }
+
+ pixman_image_set_transform (src_img, &transform);
+
+ switch (lcg_rand_n (4))
+ {
+ case 0:
+ repeat = PIXMAN_REPEAT_NONE;
+ break;
+
+ case 1:
+ repeat = PIXMAN_REPEAT_NORMAL;
+ break;
+
+ case 2:
+ repeat = PIXMAN_REPEAT_PAD;
+ break;
+
+ case 3:
+ repeat = PIXMAN_REPEAT_REFLECT;
+ break;
+
+ default:
+ break;
+ }
+ pixman_image_set_repeat (src_img, repeat);
+
+ if (lcg_rand_n (2))
+ pixman_image_set_filter (src_img, PIXMAN_FILTER_NEAREST, NULL, 0);
+ else
+ pixman_image_set_filter (src_img, PIXMAN_FILTER_BILINEAR, NULL, 0);
+
+ if (verbose)
+ {
+ printf ("src_fmt=%08X, dst_fmt=%08X\n", src_fmt, dst_fmt);
+ printf ("op=%d, scale_x=%d, scale_y=%d, repeat=%d\n",
+ op, scale_x, scale_y, repeat);
+ printf ("translate_x=%d, translate_y=%d\n",
+ translate_x, translate_y);
+ printf ("src_width=%d, src_height=%d, dst_width=%d, dst_height=%d\n",
+ src_width, src_height, dst_width, dst_height);
+ printf ("src_x=%d, src_y=%d, dst_x=%d, dst_y=%d\n",
+ src_x, src_y, dst_x, dst_y);
+ printf ("w=%d, h=%d\n", w, h);
+ }
+
+ if (lcg_rand_n (8) == 0)
+ {
+ pixman_box16_t clip_boxes[2];
+ int n = lcg_rand_n (2) + 1;
+
+ for (i = 0; i < n; i++)
+ {
+ clip_boxes[i].x1 = lcg_rand_n (src_width);
+ clip_boxes[i].y1 = lcg_rand_n (src_height);
+ clip_boxes[i].x2 =
+ clip_boxes[i].x1 + lcg_rand_n (src_width - clip_boxes[i].x1);
+ clip_boxes[i].y2 =
+ clip_boxes[i].y1 + lcg_rand_n (src_height - clip_boxes[i].y1);
+
+ if (verbose)
+ {
+ printf ("source clip box: [%d,%d-%d,%d]\n",
+ clip_boxes[i].x1, clip_boxes[i].y1,
+ clip_boxes[i].x2, clip_boxes[i].y2);
+ }
+ }
+
+ pixman_region_init_rects (&clip, clip_boxes, n);
+ pixman_image_set_clip_region (src_img, &clip);
+ pixman_image_set_source_clipping (src_img, 1);
+ pixman_region_fini (&clip);
+ }
+
+ if (lcg_rand_n (8) == 0)
+ {
+ pixman_box16_t clip_boxes[2];
+ int n = lcg_rand_n (2) + 1;
+ for (i = 0; i < n; i++)
+ {
+ clip_boxes[i].x1 = lcg_rand_n (dst_width);
+ clip_boxes[i].y1 = lcg_rand_n (dst_height);
+ clip_boxes[i].x2 =
+ clip_boxes[i].x1 + lcg_rand_n (dst_width - clip_boxes[i].x1);
+ clip_boxes[i].y2 =
+ clip_boxes[i].y1 + lcg_rand_n (dst_height - clip_boxes[i].y1);
+
+ if (verbose)
+ {
+ printf ("destination clip box: [%d,%d-%d,%d]\n",
+ clip_boxes[i].x1, clip_boxes[i].y1,
+ clip_boxes[i].x2, clip_boxes[i].y2);
+ }
+ }
+ pixman_region_init_rects (&clip, clip_boxes, n);
+ pixman_image_set_clip_region (dst_img, &clip);
+ pixman_region_fini (&clip);
+ }
+
+ pixman_image_composite (op, src_img, NULL, dst_img,
+ src_x, src_y, 0, 0, dst_x, dst_y, w, h);
+
+ if (dst_fmt == PIXMAN_x8r8g8b8)
+ {
+ /* ignore unused part */
+ for (i = 0; i < dst_stride * dst_height / 4; i++)
+ dstbuf[i] &= 0xFFFFFF;
+ }
+
+ image_endian_swap (dst_img);
+
+ if (verbose)
+ {
+ int j;
+
+ for (i = 0; i < dst_height; i++)
+ {
+ for (j = 0; j < dst_stride; j++)
+ printf ("%02X ", *((uint8_t *)dstbuf + i * dst_stride + j));
+
+ printf ("\n");
+ }
+ }
+
+ pixman_image_unref (src_img);
+ pixman_image_unref (dst_img);
+
+ crc32 = compute_crc32 (0, dstbuf, dst_stride * dst_height);
+ free (srcbuf);
+ free (dstbuf);
+
+ FLOAT_REGS_CORRUPTION_DETECTOR_FINISH ();
+ return crc32;
+}
+
+int
+main (int argc, const char *argv[])
+{
+ pixman_disable_out_of_bounds_workaround ();
+
+ return fuzzer_test_main ("affine", 8000000, 0x1EF2175A,
+ test_composite, argc, argv);
+}
diff --git a/pixman/test/blitters-test.c b/pixman/test/blitters-test.c
index 790a27f03..4f931c440 100644
--- a/pixman/test/blitters-test.c
+++ b/pixman/test/blitters-test.c
@@ -68,6 +68,9 @@ create_random_image (pixman_format_code_t *allowed_formats,
pixman_image_set_indexed (img, &(y_palette[PIXMAN_FORMAT_BPP (fmt)]));
}
+ if (lcg_rand_n (16) == 0)
+ pixman_image_set_filter (img, PIXMAN_FILTER_BILINEAR, NULL, 0);
+
image_endian_swap (img);
if (used_fmt) *used_fmt = fmt;
@@ -422,6 +425,6 @@ main (int argc, const char *argv[])
}
return fuzzer_test_main("blitters", 2000000,
- 0xB610300B,
+ 0x29137844,
test_composite, argc, argv);
}
diff --git a/xorg-server/Xext/bigreq.c b/xorg-server/Xext/bigreq.c
index 3dcb69579..a939e1699 100644
--- a/xorg-server/Xext/bigreq.c
+++ b/xorg-server/Xext/bigreq.c
@@ -1,78 +1,77 @@
-/*
-
-Copyright 1992, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include <X11/extensions/bigreqsproto.h>
-#include "opaque.h"
-#include "modinit.h"
-
-void BigReqExtensionInit(INITARGS);
-
-static int
-ProcBigReqDispatch (ClientPtr client)
-{
- REQUEST(xBigReqEnableReq);
- xBigReqEnableReply rep;
- int n;
-
- if (client->swapped) {
- swaps(&stuff->length, n);
- }
- if (stuff->brReqType != X_BigReqEnable)
- return BadRequest;
- REQUEST_SIZE_MATCH(xBigReqEnableReq);
- client->big_requests = TRUE;
- memset(&rep, 0, sizeof(xBigReqEnableReply));
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.max_request_size = maxBigRequestSize;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.max_request_size, n);
- }
- WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep);
- return Success;
-}
-
-void
-BigReqExtensionInit(INITARGS)
-{
- AddExtension(XBigReqExtensionName, 0, 0,
- ProcBigReqDispatch, ProcBigReqDispatch,
- NULL, StandardMinorOpcode);
-}
+/*
+
+Copyright 1992, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "os.h"
+#include "dixstruct.h"
+#include "extnsionst.h"
+#include <X11/extensions/bigreqsproto.h>
+#include "opaque.h"
+#include "modinit.h"
+
+void BigReqExtensionInit(INITARGS);
+
+static int
+ProcBigReqDispatch (ClientPtr client)
+{
+ REQUEST(xBigReqEnableReq);
+ xBigReqEnableReply rep;
+
+ if (client->swapped) {
+ swaps(&stuff->length);
+ }
+ if (stuff->brReqType != X_BigReqEnable)
+ return BadRequest;
+ REQUEST_SIZE_MATCH(xBigReqEnableReq);
+ client->big_requests = TRUE;
+ memset(&rep, 0, sizeof(xBigReqEnableReply));
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.max_request_size = maxBigRequestSize;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.max_request_size);
+ }
+ WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep);
+ return Success;
+}
+
+void
+BigReqExtensionInit(INITARGS)
+{
+ AddExtension(XBigReqExtensionName, 0, 0,
+ ProcBigReqDispatch, ProcBigReqDispatch,
+ NULL, StandardMinorOpcode);
+}
diff --git a/xorg-server/Xext/dpms.c b/xorg-server/Xext/dpms.c
index 79b2e2944..e82f495aa 100644
--- a/xorg-server/Xext/dpms.c
+++ b/xorg-server/Xext/dpms.c
@@ -1,381 +1,369 @@
-/*****************************************************************
-
-Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
-BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of Digital Equipment Corporation
-shall not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from Digital
-Equipment Corporation.
-
-******************************************************************/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#else
-#define DPMSExtension
-#endif
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "opaque.h"
-#include <X11/extensions/dpmsproto.h>
-#include "dpmsproc.h"
-#include "modinit.h"
-
-static int
-ProcDPMSGetVersion(ClientPtr client)
-{
- /* REQUEST(xDPMSGetVersionReq); */
- xDPMSGetVersionReply rep;
- int n;
-
- REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = DPMSMajorVersion;
- rep.minorVersion = DPMSMinorVersion;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *)&rep);
- return Success;
-}
-
-static int
-ProcDPMSCapable(ClientPtr client)
-{
- /* REQUEST(xDPMSCapableReq); */
- xDPMSCapableReply rep;
- int n;
-
- REQUEST_SIZE_MATCH(xDPMSCapableReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.capable = DPMSCapableFlag;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- }
- WriteToClient(client, sizeof(xDPMSCapableReply), (char *)&rep);
- return Success;
-}
-
-static int
-ProcDPMSGetTimeouts(ClientPtr client)
-{
- /* REQUEST(xDPMSGetTimeoutsReq); */
- xDPMSGetTimeoutsReply rep;
- int n;
-
- REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.standby = DPMSStandbyTime / MILLI_PER_SECOND;
- rep.suspend = DPMSSuspendTime / MILLI_PER_SECOND;
- rep.off = DPMSOffTime / MILLI_PER_SECOND;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swaps(&rep.standby, n);
- swaps(&rep.suspend, n);
- swaps(&rep.off, n);
- }
- WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *)&rep);
- return Success;
-}
-
-static int
-ProcDPMSSetTimeouts(ClientPtr client)
-{
- REQUEST(xDPMSSetTimeoutsReq);
-
- REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq);
-
- if ((stuff->off != 0)&&(stuff->off < stuff->suspend))
- {
- client->errorValue = stuff->off;
- return BadValue;
- }
- if ((stuff->suspend != 0)&&(stuff->suspend < stuff->standby))
- {
- client->errorValue = stuff->suspend;
- return BadValue;
- }
-
- DPMSStandbyTime = stuff->standby * MILLI_PER_SECOND;
- DPMSSuspendTime = stuff->suspend * MILLI_PER_SECOND;
- DPMSOffTime = stuff->off * MILLI_PER_SECOND;
- SetScreenSaverTimer();
-
- return Success;
-}
-
-static int
-ProcDPMSEnable(ClientPtr client)
-{
- Bool was_enabled = DPMSEnabled;
-
- REQUEST_SIZE_MATCH(xDPMSEnableReq);
-
- if (DPMSCapableFlag) {
- DPMSEnabled = TRUE;
- if (!was_enabled)
- SetScreenSaverTimer();
- }
-
- return Success;
-}
-
-static int
-ProcDPMSDisable(ClientPtr client)
-{
- /* REQUEST(xDPMSDisableReq); */
-
- REQUEST_SIZE_MATCH(xDPMSDisableReq);
-
- DPMSSet(client, DPMSModeOn);
-
- DPMSEnabled = FALSE;
-
- return Success;
-}
-
-static int
-ProcDPMSForceLevel(ClientPtr client)
-{
- REQUEST(xDPMSForceLevelReq);
-
- REQUEST_SIZE_MATCH(xDPMSForceLevelReq);
-
- if (!DPMSEnabled)
- return BadMatch;
-
- if (stuff->level != DPMSModeOn &&
- stuff->level != DPMSModeStandby &&
- stuff->level != DPMSModeSuspend &&
- stuff->level != DPMSModeOff) {
- client->errorValue = stuff->level;
- return BadValue;
- }
-
- DPMSSet(client, stuff->level);
-
- return Success;
-}
-
-static int
-ProcDPMSInfo(ClientPtr client)
-{
- /* REQUEST(xDPMSInfoReq); */
- xDPMSInfoReply rep;
- int n;
-
- REQUEST_SIZE_MATCH(xDPMSInfoReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.power_level = DPMSPowerLevel;
- rep.state = DPMSEnabled;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swaps(&rep.power_level, n);
- }
- WriteToClient(client, sizeof(xDPMSInfoReply), (char *)&rep);
- return Success;
-}
-
-static int
-ProcDPMSDispatch (ClientPtr client)
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
- case X_DPMSGetVersion:
- return ProcDPMSGetVersion(client);
- case X_DPMSCapable:
- return ProcDPMSCapable(client);
- case X_DPMSGetTimeouts:
- return ProcDPMSGetTimeouts(client);
- case X_DPMSSetTimeouts:
- return ProcDPMSSetTimeouts(client);
- case X_DPMSEnable:
- return ProcDPMSEnable(client);
- case X_DPMSDisable:
- return ProcDPMSDisable(client);
- case X_DPMSForceLevel:
- return ProcDPMSForceLevel(client);
- case X_DPMSInfo:
- return ProcDPMSInfo(client);
- default:
- return BadRequest;
- }
-}
-
-static int
-SProcDPMSGetVersion(ClientPtr client)
-{
- int n;
- REQUEST(xDPMSGetVersionReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
- swaps(&stuff->majorVersion, n);
- swaps(&stuff->minorVersion, n);
- return ProcDPMSGetVersion(client);
-}
-
-static int
-SProcDPMSCapable(ClientPtr client)
-{
- REQUEST(xDPMSCapableReq);
- int n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDPMSCapableReq);
-
- return ProcDPMSCapable(client);
-}
-
-static int
-SProcDPMSGetTimeouts(ClientPtr client)
-{
- REQUEST(xDPMSGetTimeoutsReq);
- int n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
-
- return ProcDPMSGetTimeouts(client);
-}
-
-static int
-SProcDPMSSetTimeouts(ClientPtr client)
-{
- REQUEST(xDPMSSetTimeoutsReq);
- int n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq);
-
- swaps(&stuff->standby, n);
- swaps(&stuff->suspend, n);
- swaps(&stuff->off, n);
- return ProcDPMSSetTimeouts(client);
-}
-
-static int
-SProcDPMSEnable(ClientPtr client)
-{
- REQUEST(xDPMSEnableReq);
- int n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDPMSEnableReq);
-
- return ProcDPMSEnable(client);
-}
-
-static int
-SProcDPMSDisable(ClientPtr client)
-{
- REQUEST(xDPMSDisableReq);
- int n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDPMSDisableReq);
-
- return ProcDPMSDisable(client);
-}
-
-static int
-SProcDPMSForceLevel(ClientPtr client)
-{
- REQUEST(xDPMSForceLevelReq);
- int n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDPMSForceLevelReq);
-
- swaps(&stuff->level, n);
-
- return ProcDPMSForceLevel(client);
-}
-
-static int
-SProcDPMSInfo(ClientPtr client)
-{
- REQUEST(xDPMSInfoReq);
- int n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDPMSInfoReq);
-
- return ProcDPMSInfo(client);
-}
-
-static int
-SProcDPMSDispatch (ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_DPMSGetVersion:
- return SProcDPMSGetVersion(client);
- case X_DPMSCapable:
- return SProcDPMSCapable(client);
- case X_DPMSGetTimeouts:
- return SProcDPMSGetTimeouts(client);
- case X_DPMSSetTimeouts:
- return SProcDPMSSetTimeouts(client);
- case X_DPMSEnable:
- return SProcDPMSEnable(client);
- case X_DPMSDisable:
- return SProcDPMSDisable(client);
- case X_DPMSForceLevel:
- return SProcDPMSForceLevel(client);
- case X_DPMSInfo:
- return SProcDPMSInfo(client);
- default:
- return BadRequest;
- }
-}
-
-void
-DPMSExtensionInit(INITARGS)
-{
- AddExtension(DPMSExtensionName, 0, 0,
- ProcDPMSDispatch, SProcDPMSDispatch,
- NULL, StandardMinorOpcode);
-}
+/*****************************************************************
+
+Copyright (c) 1996 Digital Equipment Corporation, Maynard, Massachusetts.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
+BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Digital Equipment Corporation
+shall not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from Digital
+Equipment Corporation.
+
+******************************************************************/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#else
+#define DPMSExtension
+#endif
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "os.h"
+#include "dixstruct.h"
+#include "extnsionst.h"
+#include "opaque.h"
+#include <X11/extensions/dpmsproto.h>
+#include "dpmsproc.h"
+#include "modinit.h"
+
+static int
+ProcDPMSGetVersion(ClientPtr client)
+{
+ /* REQUEST(xDPMSGetVersionReq); */
+ xDPMSGetVersionReply rep;
+
+ REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.majorVersion = DPMSMajorVersion;
+ rep.minorVersion = DPMSMinorVersion;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swaps(&rep.majorVersion);
+ swaps(&rep.minorVersion);
+ }
+ WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *)&rep);
+ return Success;
+}
+
+static int
+ProcDPMSCapable(ClientPtr client)
+{
+ /* REQUEST(xDPMSCapableReq); */
+ xDPMSCapableReply rep;
+
+ REQUEST_SIZE_MATCH(xDPMSCapableReq);
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.capable = DPMSCapableFlag;
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ }
+ WriteToClient(client, sizeof(xDPMSCapableReply), (char *)&rep);
+ return Success;
+}
+
+static int
+ProcDPMSGetTimeouts(ClientPtr client)
+{
+ /* REQUEST(xDPMSGetTimeoutsReq); */
+ xDPMSGetTimeoutsReply rep;
+
+ REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.standby = DPMSStandbyTime / MILLI_PER_SECOND;
+ rep.suspend = DPMSSuspendTime / MILLI_PER_SECOND;
+ rep.off = DPMSOffTime / MILLI_PER_SECOND;
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swaps(&rep.standby);
+ swaps(&rep.suspend);
+ swaps(&rep.off);
+ }
+ WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *)&rep);
+ return Success;
+}
+
+static int
+ProcDPMSSetTimeouts(ClientPtr client)
+{
+ REQUEST(xDPMSSetTimeoutsReq);
+
+ REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq);
+
+ if ((stuff->off != 0)&&(stuff->off < stuff->suspend))
+ {
+ client->errorValue = stuff->off;
+ return BadValue;
+ }
+ if ((stuff->suspend != 0)&&(stuff->suspend < stuff->standby))
+ {
+ client->errorValue = stuff->suspend;
+ return BadValue;
+ }
+
+ DPMSStandbyTime = stuff->standby * MILLI_PER_SECOND;
+ DPMSSuspendTime = stuff->suspend * MILLI_PER_SECOND;
+ DPMSOffTime = stuff->off * MILLI_PER_SECOND;
+ SetScreenSaverTimer();
+
+ return Success;
+}
+
+static int
+ProcDPMSEnable(ClientPtr client)
+{
+ Bool was_enabled = DPMSEnabled;
+
+ REQUEST_SIZE_MATCH(xDPMSEnableReq);
+
+ if (DPMSCapableFlag) {
+ DPMSEnabled = TRUE;
+ if (!was_enabled)
+ SetScreenSaverTimer();
+ }
+
+ return Success;
+}
+
+static int
+ProcDPMSDisable(ClientPtr client)
+{
+ /* REQUEST(xDPMSDisableReq); */
+
+ REQUEST_SIZE_MATCH(xDPMSDisableReq);
+
+ DPMSSet(client, DPMSModeOn);
+
+ DPMSEnabled = FALSE;
+
+ return Success;
+}
+
+static int
+ProcDPMSForceLevel(ClientPtr client)
+{
+ REQUEST(xDPMSForceLevelReq);
+
+ REQUEST_SIZE_MATCH(xDPMSForceLevelReq);
+
+ if (!DPMSEnabled)
+ return BadMatch;
+
+ if (stuff->level != DPMSModeOn &&
+ stuff->level != DPMSModeStandby &&
+ stuff->level != DPMSModeSuspend &&
+ stuff->level != DPMSModeOff) {
+ client->errorValue = stuff->level;
+ return BadValue;
+ }
+
+ DPMSSet(client, stuff->level);
+
+ return Success;
+}
+
+static int
+ProcDPMSInfo(ClientPtr client)
+{
+ /* REQUEST(xDPMSInfoReq); */
+ xDPMSInfoReply rep;
+
+ REQUEST_SIZE_MATCH(xDPMSInfoReq);
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.power_level = DPMSPowerLevel;
+ rep.state = DPMSEnabled;
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swaps(&rep.power_level);
+ }
+ WriteToClient(client, sizeof(xDPMSInfoReply), (char *)&rep);
+ return Success;
+}
+
+static int
+ProcDPMSDispatch (ClientPtr client)
+{
+ REQUEST(xReq);
+
+ switch (stuff->data)
+ {
+ case X_DPMSGetVersion:
+ return ProcDPMSGetVersion(client);
+ case X_DPMSCapable:
+ return ProcDPMSCapable(client);
+ case X_DPMSGetTimeouts:
+ return ProcDPMSGetTimeouts(client);
+ case X_DPMSSetTimeouts:
+ return ProcDPMSSetTimeouts(client);
+ case X_DPMSEnable:
+ return ProcDPMSEnable(client);
+ case X_DPMSDisable:
+ return ProcDPMSDisable(client);
+ case X_DPMSForceLevel:
+ return ProcDPMSForceLevel(client);
+ case X_DPMSInfo:
+ return ProcDPMSInfo(client);
+ default:
+ return BadRequest;
+ }
+}
+
+static int
+SProcDPMSGetVersion(ClientPtr client)
+{
+ REQUEST(xDPMSGetVersionReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDPMSGetVersionReq);
+ swaps(&stuff->majorVersion);
+ swaps(&stuff->minorVersion);
+ return ProcDPMSGetVersion(client);
+}
+
+static int
+SProcDPMSCapable(ClientPtr client)
+{
+ REQUEST(xDPMSCapableReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDPMSCapableReq);
+
+ return ProcDPMSCapable(client);
+}
+
+static int
+SProcDPMSGetTimeouts(ClientPtr client)
+{
+ REQUEST(xDPMSGetTimeoutsReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq);
+
+ return ProcDPMSGetTimeouts(client);
+}
+
+static int
+SProcDPMSSetTimeouts(ClientPtr client)
+{
+ REQUEST(xDPMSSetTimeoutsReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq);
+
+ swaps(&stuff->standby);
+ swaps(&stuff->suspend);
+ swaps(&stuff->off);
+ return ProcDPMSSetTimeouts(client);
+}
+
+static int
+SProcDPMSEnable(ClientPtr client)
+{
+ REQUEST(xDPMSEnableReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDPMSEnableReq);
+
+ return ProcDPMSEnable(client);
+}
+
+static int
+SProcDPMSDisable(ClientPtr client)
+{
+ REQUEST(xDPMSDisableReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDPMSDisableReq);
+
+ return ProcDPMSDisable(client);
+}
+
+static int
+SProcDPMSForceLevel(ClientPtr client)
+{
+ REQUEST(xDPMSForceLevelReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDPMSForceLevelReq);
+
+ swaps(&stuff->level);
+
+ return ProcDPMSForceLevel(client);
+}
+
+static int
+SProcDPMSInfo(ClientPtr client)
+{
+ REQUEST(xDPMSInfoReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDPMSInfoReq);
+
+ return ProcDPMSInfo(client);
+}
+
+static int
+SProcDPMSDispatch (ClientPtr client)
+{
+ REQUEST(xReq);
+ switch (stuff->data)
+ {
+ case X_DPMSGetVersion:
+ return SProcDPMSGetVersion(client);
+ case X_DPMSCapable:
+ return SProcDPMSCapable(client);
+ case X_DPMSGetTimeouts:
+ return SProcDPMSGetTimeouts(client);
+ case X_DPMSSetTimeouts:
+ return SProcDPMSSetTimeouts(client);
+ case X_DPMSEnable:
+ return SProcDPMSEnable(client);
+ case X_DPMSDisable:
+ return SProcDPMSDisable(client);
+ case X_DPMSForceLevel:
+ return SProcDPMSForceLevel(client);
+ case X_DPMSInfo:
+ return SProcDPMSInfo(client);
+ default:
+ return BadRequest;
+ }
+}
+
+void
+DPMSExtensionInit(INITARGS)
+{
+ AddExtension(DPMSExtensionName, 0, 0,
+ ProcDPMSDispatch, SProcDPMSDispatch,
+ NULL, StandardMinorOpcode);
+}
diff --git a/xorg-server/Xext/geext.c b/xorg-server/Xext/geext.c
index 18f8ffeac..a8718ccbd 100644
--- a/xorg-server/Xext/geext.c
+++ b/xorg-server/Xext/geext.c
@@ -58,7 +58,6 @@ static void SGEGenericEvent(xEvent* from, xEvent* to);
static int
ProcGEQueryVersion(ClientPtr client)
{
- int n;
GEClientInfoPtr pGEClient = GEGetClient(client);
xGEQueryVersionReply rep;
REQUEST(xGEQueryVersionReq);
@@ -80,10 +79,10 @@ ProcGEQueryVersion(ClientPtr client)
if (client->swapped)
{
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.majorVersion);
+ swaps(&rep.minorVersion);
}
WriteToClient(client, sizeof(xGEQueryVersionReply), (char*)&rep);
@@ -101,13 +100,12 @@ int (*ProcGEVector[GENumberRequests])(ClientPtr) = {
static int
SProcGEQueryVersion(ClientPtr client)
{
- int n;
REQUEST(xGEQueryVersionReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGEQueryVersionReq);
- swaps(&stuff->majorVersion, n);
- swaps(&stuff->minorVersion, n);
+ swaps(&stuff->majorVersion);
+ swaps(&stuff->minorVersion);
return(*ProcGEVector[stuff->ReqType])(client);
}
diff --git a/xorg-server/Xext/panoramiX.c b/xorg-server/Xext/panoramiX.c
index 00afe94f1..fae7c81c9 100644
--- a/xorg-server/Xext/panoramiX.c
+++ b/xorg-server/Xext/panoramiX.c
@@ -388,7 +388,7 @@ XineramaRegisterConnectionBlockCallback(void (*func)(void))
return TRUE;
}
-static void XineramaInitData(ScreenPtr pScreen)
+static void XineramaInitData(void)
{
int i, w, h;
@@ -397,7 +397,7 @@ static void XineramaInitData(ScreenPtr pScreen)
BoxRec TheBox;
RegionRec ScreenRegion;
- pScreen = screenInfo.screens[i];
+ ScreenPtr pScreen = screenInfo.screens[i];
TheBox.x1 = pScreen->x;
TheBox.x2 = TheBox.x1 + pScreen->width;
@@ -414,7 +414,7 @@ static void XineramaInitData(ScreenPtr pScreen)
PanoramiXPixHeight = screenInfo.screens[0]->y + screenInfo.screens[0]->height;
FOR_NSCREENS_FORWARD_SKIP(i) {
- pScreen = screenInfo.screens[i];
+ ScreenPtr pScreen = screenInfo.screens[i];
w = pScreen->x + pScreen->width;
h = pScreen->y + pScreen->height;
@@ -425,10 +425,10 @@ static void XineramaInitData(ScreenPtr pScreen)
}
}
-void XineramaReinitData(ScreenPtr pScreen)
+void XineramaReinitData(void)
{
RegionUninit(&PanoramiXScreenRegion);
- XineramaInitData(pScreen);
+ XineramaInitData();
}
/*
@@ -525,7 +525,7 @@ void PanoramiXExtensionInit(int argc, char *argv[])
return;
}
- XineramaInitData(pScreen);
+ XineramaInitData();
/*
* Put our processes into the ProcVector
@@ -909,7 +909,6 @@ ProcPanoramiXQueryVersion (ClientPtr client)
{
/* REQUEST(xPanoramiXQueryVersionReq); */
xPanoramiXQueryVersionReply rep;
- register int n;
REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
rep.type = X_Reply;
@@ -918,10 +917,10 @@ ProcPanoramiXQueryVersion (ClientPtr client)
rep.majorVersion = SERVER_PANORAMIX_MAJOR_VERSION;
rep.minorVersion = SERVER_PANORAMIX_MINOR_VERSION;
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.majorVersion);
+ swaps(&rep.minorVersion);
}
WriteToClient(client, sizeof (xPanoramiXQueryVersionReply), (char *)&rep);
return Success;
@@ -933,7 +932,7 @@ ProcPanoramiXGetState(ClientPtr client)
REQUEST(xPanoramiXGetStateReq);
WindowPtr pWin;
xPanoramiXGetStateReply rep;
- int n, rc;
+ int rc;
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
@@ -946,9 +945,9 @@ ProcPanoramiXGetState(ClientPtr client)
rep.state = !noPanoramiXExtension;
rep.window = stuff->window;
if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.window, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.window);
}
WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
return Success;
@@ -961,7 +960,7 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
REQUEST(xPanoramiXGetScreenCountReq);
WindowPtr pWin;
xPanoramiXGetScreenCountReply rep;
- int n, rc;
+ int rc;
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
@@ -974,9 +973,9 @@ ProcPanoramiXGetScreenCount(ClientPtr client)
rep.ScreenCount = PanoramiXNumScreens;
rep.window = stuff->window;
if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.window, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.window);
}
WriteToClient (client, sizeof (xPanoramiXGetScreenCountReply), (char *) &rep);
return Success;
@@ -988,7 +987,7 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
REQUEST(xPanoramiXGetScreenSizeReq);
WindowPtr pWin;
xPanoramiXGetScreenSizeReply rep;
- int n, rc;
+ int rc;
if (stuff->screen >= PanoramiXNumScreens)
return BadMatch;
@@ -1007,12 +1006,12 @@ ProcPanoramiXGetScreenSize(ClientPtr client)
rep.window = stuff->window;
rep.screen = stuff->screen;
if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.width, n);
- swapl (&rep.height, n);
- swapl (&rep.window, n);
- swapl (&rep.screen, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.width);
+ swapl(&rep.height);
+ swapl(&rep.window);
+ swapl(&rep.screen);
}
WriteToClient (client, sizeof (xPanoramiXGetScreenSizeReply), (char *) &rep);
return Success;
@@ -1040,10 +1039,9 @@ ProcXineramaIsActive(ClientPtr client)
rep.state = !noPanoramiXExtension;
#endif
if (client->swapped) {
- int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.state, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.state);
}
WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep);
return Success;
@@ -1063,10 +1061,9 @@ ProcXineramaQueryScreens(ClientPtr client)
rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
if (client->swapped) {
- int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.number, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.number);
}
WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep);
@@ -1081,11 +1078,10 @@ ProcXineramaQueryScreens(ClientPtr client)
scratch.height = screenInfo.screens[i]->height;
if(client->swapped) {
- int n;
- swaps (&scratch.x_org, n);
- swaps (&scratch.y_org, n);
- swaps (&scratch.width, n);
- swaps (&scratch.height, n);
+ swaps(&scratch.x_org);
+ swaps(&scratch.y_org);
+ swaps(&scratch.width);
+ swaps(&scratch.height);
}
WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch);
}
diff --git a/xorg-server/Xext/panoramiXSwap.c b/xorg-server/Xext/panoramiXSwap.c
index e1720c9ab..79277021a 100644
--- a/xorg-server/Xext/panoramiXSwap.c
+++ b/xorg-server/Xext/panoramiXSwap.c
@@ -51,9 +51,8 @@ static int
SProcPanoramiXQueryVersion (ClientPtr client)
{
REQUEST(xPanoramiXQueryVersionReq);
- int n;
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
return ProcPanoramiXQueryVersion(client);
}
@@ -62,11 +61,10 @@ static int
SProcPanoramiXGetState(ClientPtr client)
{
REQUEST(xPanoramiXGetStateReq);
- int n;
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
- swapl (&stuff->window, n);
+ swapl(&stuff->window);
return ProcPanoramiXGetState(client);
}
@@ -74,11 +72,10 @@ static int
SProcPanoramiXGetScreenCount(ClientPtr client)
{
REQUEST(xPanoramiXGetScreenCountReq);
- int n;
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
- swapl (&stuff->window, n);
+ swapl(&stuff->window);
return ProcPanoramiXGetScreenCount(client);
}
@@ -86,12 +83,11 @@ static int
SProcPanoramiXGetScreenSize(ClientPtr client)
{
REQUEST(xPanoramiXGetScreenSizeReq);
- int n;
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
- swapl (&stuff->window, n);
- swapl (&stuff->screen, n);
+ swapl(&stuff->window);
+ swapl(&stuff->screen);
return ProcPanoramiXGetScreenSize(client);
}
@@ -100,9 +96,8 @@ static int
SProcXineramaIsActive(ClientPtr client)
{
REQUEST(xXineramaIsActiveReq);
- int n;
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
return ProcXineramaIsActive(client);
}
@@ -112,9 +107,8 @@ static int
SProcXineramaQueryScreens(ClientPtr client)
{
REQUEST(xXineramaQueryScreensReq);
- int n;
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
return ProcXineramaQueryScreens(client);
}
diff --git a/xorg-server/Xext/panoramiXsrv.h b/xorg-server/Xext/panoramiXsrv.h
index 6fc903b88..39d495203 100644
--- a/xorg-server/Xext/panoramiXsrv.h
+++ b/xorg-server/Xext/panoramiXsrv.h
@@ -19,7 +19,7 @@ extern _X_EXPORT PanoramiXRes * PanoramiXFindIDByScrnum(RESTYPE, XID, int);
extern _X_EXPORT Bool XineramaRegisterConnectionBlockCallback(void (*func)(void));
extern _X_EXPORT int XineramaDeleteResource(pointer, XID);
-extern _X_EXPORT void XineramaReinitData(ScreenPtr);
+extern _X_EXPORT void XineramaReinitData(void);
extern _X_EXPORT RESTYPE XRC_DRAWABLE;
extern _X_EXPORT RESTYPE XRT_WINDOW;
diff --git a/xorg-server/Xext/saver.c b/xorg-server/Xext/saver.c
index 5fd6c895d..a3ad3398a 100644
--- a/xorg-server/Xext/saver.c
+++ b/xorg-server/Xext/saver.c
@@ -1,1517 +1,1503 @@
-/*
- *
-Copyright (c) 1992 X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
- *
- * Author: Keith Packard, MIT X Consortium
- */
-
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#else
-#define SCREENSAVER
-#endif
-
-#ifdef CreateWindow
-#undef CreateWindow
-#endif
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "misc.h"
-#include "os.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "opaque.h"
-#include <X11/extensions/saverproto.h>
-#include "gcstruct.h"
-#include "cursorstr.h"
-#include "colormapst.h"
-#include "xace.h"
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-#ifdef DPMSExtension
-#include <X11/extensions/dpmsconst.h>
-#endif
-#include "protocol-versions.h"
-
-#include <stdio.h>
-
-#include "modinit.h"
-
-static int ScreenSaverEventBase = 0;
-
-
-static Bool ScreenSaverHandle (
- ScreenPtr /* pScreen */,
- int /* xstate */,
- Bool /* force */
- );
-
-static Bool
-CreateSaverWindow (
- ScreenPtr /* pScreen */
- );
-
-static Bool
-DestroySaverWindow (
- ScreenPtr /* pScreen */
- );
-
-static void
-UninstallSaverColormap (
- ScreenPtr /* pScreen */
- );
-
-static void
-CheckScreenPrivate (
- ScreenPtr /* pScreen */
- );
-
-static void SScreenSaverNotifyEvent (
- xScreenSaverNotifyEvent * /* from */,
- xScreenSaverNotifyEvent * /* to */
- );
-
-static RESTYPE SuspendType; /* resource type for suspension records */
-
-typedef struct _ScreenSaverSuspension *ScreenSaverSuspensionPtr;
-
-/* List of clients that are suspending the screensaver. */
-static ScreenSaverSuspensionPtr suspendingClients = NULL;
-
-/*
- * clientResource is a resource ID that's added when the record is
- * allocated, so the record is freed and the screensaver resumed when
- * the client disconnects. count is the number of times the client has
- * requested the screensaver be suspended.
- */
-typedef struct _ScreenSaverSuspension
-{
- ScreenSaverSuspensionPtr next;
- ClientPtr pClient;
- XID clientResource;
- int count;
-} ScreenSaverSuspensionRec;
-
-static int ScreenSaverFreeSuspend(
- pointer /*value */,
- XID /* id */
-);
-
-/*
- * each screen has a list of clients requesting
- * ScreenSaverNotify events. Each client has a resource
- * for each screen it selects ScreenSaverNotify input for,
- * this resource is used to delete the ScreenSaverNotifyRec
- * entry from the per-screen queue.
- */
-
-static RESTYPE SaverEventType; /* resource type for event masks */
-
-typedef struct _ScreenSaverEvent *ScreenSaverEventPtr;
-
-typedef struct _ScreenSaverEvent {
- ScreenSaverEventPtr next;
- ClientPtr client;
- ScreenPtr screen;
- XID resource;
- CARD32 mask;
-} ScreenSaverEventRec;
-
-static int ScreenSaverFreeEvents(
- pointer /* value */,
- XID /* id */
-);
-
-static Bool setEventMask (
- ScreenPtr /* pScreen */,
- ClientPtr /* client */,
- unsigned long /* mask */
-);
-
-static unsigned long getEventMask (
- ScreenPtr /* pScreen */,
- ClientPtr /* client */
-);
-
-/*
- * when a client sets the screen saver attributes, a resource is
- * kept to be freed when the client exits
- */
-
-static RESTYPE AttrType; /* resource type for attributes */
-
-typedef struct _ScreenSaverAttr {
- ScreenPtr screen;
- ClientPtr client;
- XID resource;
- short x, y;
- unsigned short width, height, borderWidth;
- unsigned char class;
- unsigned char depth;
- VisualID visual;
- CursorPtr pCursor;
- PixmapPtr pBackgroundPixmap;
- PixmapPtr pBorderPixmap;
- Colormap colormap;
- unsigned long mask; /* no pixmaps or cursors */
- unsigned long *values;
-} ScreenSaverAttrRec, *ScreenSaverAttrPtr;
-
-static int ScreenSaverFreeAttr (
- pointer /* value */,
- XID /* id */
-);
-
-static void FreeAttrs (
- ScreenSaverAttrPtr /* pAttr */
-);
-
-static void FreeScreenAttr (
- ScreenSaverAttrPtr /* pAttr */
-);
-
-static void
-SendScreenSaverNotify (
- ScreenPtr /* pScreen */,
- int /* state */,
- Bool /* forced */
-);
-
-typedef struct _ScreenSaverScreenPrivate {
- ScreenSaverEventPtr events;
- ScreenSaverAttrPtr attr;
- Bool hasWindow;
- Colormap installedMap;
-} ScreenSaverScreenPrivateRec, *ScreenSaverScreenPrivatePtr;
-
-static ScreenSaverScreenPrivatePtr
-MakeScreenPrivate (
- ScreenPtr /* pScreen */
- );
-
-static DevPrivateKeyRec ScreenPrivateKeyRec;
-#define ScreenPrivateKey (&ScreenPrivateKeyRec)
-
-#define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr) \
- dixLookupPrivate(&(s)->devPrivates, ScreenPrivateKey))
-#define SetScreenPrivate(s,v) \
- dixSetPrivate(&(s)->devPrivates, ScreenPrivateKey, v);
-#define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = (s ? GetScreenPrivate(s) : NULL)
-
-#define New(t) (malloc(sizeof (t)))
-
-static void
-CheckScreenPrivate (ScreenPtr pScreen)
-{
- SetupScreen (pScreen);
-
- if (!pPriv)
- return;
- if (!pPriv->attr && !pPriv->events &&
- !pPriv->hasWindow && pPriv->installedMap == None)
- {
- free(pPriv);
- SetScreenPrivate (pScreen, NULL);
- pScreen->screensaver.ExternalScreenSaver = NULL;
- }
-}
-
-static ScreenSaverScreenPrivatePtr
-MakeScreenPrivate (ScreenPtr pScreen)
-{
- SetupScreen (pScreen);
-
- if (pPriv)
- return pPriv;
- pPriv = New (ScreenSaverScreenPrivateRec);
- if (!pPriv)
- return 0;
- pPriv->events = 0;
- pPriv->attr = 0;
- pPriv->hasWindow = FALSE;
- pPriv->installedMap = None;
- SetScreenPrivate (pScreen, pPriv);
- pScreen->screensaver.ExternalScreenSaver = ScreenSaverHandle;
- return pPriv;
-}
-
-static unsigned long
-getEventMask (ScreenPtr pScreen, ClientPtr client)
-{
- SetupScreen(pScreen);
- ScreenSaverEventPtr pEv;
-
- if (!pPriv)
- return 0;
- for (pEv = pPriv->events; pEv; pEv = pEv->next)
- if (pEv->client == client)
- return pEv->mask;
- return 0;
-}
-
-static Bool
-setEventMask (ScreenPtr pScreen, ClientPtr client, unsigned long mask)
-{
- SetupScreen(pScreen);
- ScreenSaverEventPtr pEv, *pPrev;
-
- if (getEventMask (pScreen, client) == mask)
- return TRUE;
- if (!pPriv)
- {
- pPriv = MakeScreenPrivate (pScreen);
- if (!pPriv)
- return FALSE;
- }
- for (pPrev = &pPriv->events; (pEv = *pPrev) != 0; pPrev = &pEv->next)
- if (pEv->client == client)
- break;
- if (mask == 0)
- {
- FreeResource (pEv->resource, SaverEventType);
- *pPrev = pEv->next;
- free(pEv);
- CheckScreenPrivate (pScreen);
- }
- else
- {
- if (!pEv)
- {
- pEv = New (ScreenSaverEventRec);
- if (!pEv)
- {
- CheckScreenPrivate (pScreen);
- return FALSE;
- }
- *pPrev = pEv;
- pEv->next = NULL;
- pEv->client = client;
- pEv->screen = pScreen;
- pEv->resource = FakeClientID (client->index);
- if (!AddResource (pEv->resource, SaverEventType, (pointer) pEv))
- return FALSE;
- }
- pEv->mask = mask;
- }
- return TRUE;
-}
-
-static void
-FreeAttrs (ScreenSaverAttrPtr pAttr)
-{
- PixmapPtr pPixmap;
- CursorPtr pCursor;
-
- if ((pPixmap = pAttr->pBackgroundPixmap) != 0)
- (*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap);
- if ((pPixmap = pAttr->pBorderPixmap) != 0)
- (*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap);
- if ((pCursor = pAttr->pCursor) != 0)
- FreeCursor (pCursor, (Cursor) 0);
-}
-
-static void
-FreeScreenAttr (ScreenSaverAttrPtr pAttr)
-{
- FreeAttrs (pAttr);
- free(pAttr->values);
- free(pAttr);
-}
-
-static int
-ScreenSaverFreeEvents (pointer value, XID id)
-{
- ScreenSaverEventPtr pOld = (ScreenSaverEventPtr)value;
- ScreenPtr pScreen = pOld->screen;
- SetupScreen (pScreen);
- ScreenSaverEventPtr pEv, *pPrev;
-
- if (!pPriv)
- return TRUE;
- for (pPrev = &pPriv->events; (pEv = *pPrev) != 0; pPrev = &pEv->next)
- if (pEv == pOld)
- break;
- if (!pEv)
- return TRUE;
- *pPrev = pEv->next;
- free(pEv);
- CheckScreenPrivate (pScreen);
- return TRUE;
-}
-
-static int
-ScreenSaverFreeAttr (pointer value, XID id)
-{
- ScreenSaverAttrPtr pOldAttr = (ScreenSaverAttrPtr)value;
- ScreenPtr pScreen = pOldAttr->screen;
- SetupScreen (pScreen);
-
- if (!pPriv)
- return TRUE;
- if (pPriv->attr != pOldAttr)
- return TRUE;
- FreeScreenAttr (pOldAttr);
- pPriv->attr = NULL;
- if (pPriv->hasWindow)
- {
- dixSaveScreens (serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);
- dixSaveScreens (serverClient, SCREEN_SAVER_FORCER, ScreenSaverActive);
- }
- CheckScreenPrivate (pScreen);
- return TRUE;
-}
-
-static int
-ScreenSaverFreeSuspend (pointer value, XID id)
-{
- ScreenSaverSuspensionPtr data = (ScreenSaverSuspensionPtr) value;
- ScreenSaverSuspensionPtr *prev, this;
-
- /* Unlink and free the suspension record for the client */
- for (prev = &suspendingClients; (this = *prev); prev = &this->next)
- {
- if (this == data)
- {
- *prev = this->next;
- free(this);
- break;
- }
- }
-
- /* Reenable the screensaver if this was the last client suspending it. */
- if (screenSaverSuspended && suspendingClients == NULL)
- {
- screenSaverSuspended = FALSE;
-
- /* The screensaver could be active, since suspending it (by design)
- doesn't prevent it from being forceably activated */
-#ifdef DPMSExtension
- if (screenIsSaved != SCREEN_SAVER_ON && DPMSPowerLevel == DPMSModeOn)
-#else
- if (screenIsSaved != SCREEN_SAVER_ON)
-#endif
- {
- UpdateCurrentTimeIf();
- lastDeviceEventTime = currentTime;
- SetScreenSaverTimer();
- }
- }
-
- return Success;
-}
-
-static void
-SendScreenSaverNotify (ScreenPtr pScreen, int state, Bool forced)
-{
- ScreenSaverScreenPrivatePtr pPriv;
- ScreenSaverEventPtr pEv;
- unsigned long mask;
- xScreenSaverNotifyEvent ev;
- int kind;
-
- UpdateCurrentTimeIf ();
- mask = ScreenSaverNotifyMask;
- if (state == ScreenSaverCycle)
- mask = ScreenSaverCycleMask;
- pScreen = screenInfo.screens[pScreen->myNum];
- pPriv = GetScreenPrivate(pScreen);
- if (!pPriv)
- return;
- if (pPriv->attr)
- kind = ScreenSaverExternal;
- else if (ScreenSaverBlanking != DontPreferBlanking)
- kind = ScreenSaverBlanked;
- else
- kind = ScreenSaverInternal;
- for (pEv = pPriv->events; pEv; pEv = pEv->next)
- {
- if (!(pEv->mask & mask))
- continue;
- ev.type = ScreenSaverNotify + ScreenSaverEventBase;
- ev.state = state;
- ev.timestamp = currentTime.milliseconds;
- ev.root = pScreen->root->drawable.id;
- ev.window = pScreen->screensaver.wid;
- ev.kind = kind;
- ev.forced = forced;
- WriteEventsToClient (pEv->client, 1, (xEvent *) &ev);
- }
-}
-
-static void
-SScreenSaverNotifyEvent (xScreenSaverNotifyEvent *from,
- xScreenSaverNotifyEvent *to)
-{
- to->type = from->type;
- to->state = from->state;
- cpswaps (from->sequenceNumber, to->sequenceNumber);
- cpswapl (from->timestamp, to->timestamp);
- cpswapl (from->root, to->root);
- cpswapl (from->window, to->window);
- to->kind = from->kind;
- to->forced = from->forced;
-}
-
-static void
-UninstallSaverColormap (ScreenPtr pScreen)
-{
- SetupScreen(pScreen);
- ColormapPtr pCmap;
- int rc;
-
- if (pPriv && pPriv->installedMap != None)
- {
- rc = dixLookupResourceByType((pointer *)&pCmap, pPriv->installedMap,
- RT_COLORMAP, serverClient,
- DixUninstallAccess);
- if (rc == Success)
- (*pCmap->pScreen->UninstallColormap) (pCmap);
- pPriv->installedMap = None;
- CheckScreenPrivate (pScreen);
- }
-}
-
-static Bool
-CreateSaverWindow (ScreenPtr pScreen)
-{
- SetupScreen (pScreen);
- ScreenSaverStuffPtr pSaver;
- ScreenSaverAttrPtr pAttr;
- WindowPtr pWin;
- int result;
- unsigned long mask;
- Colormap *installedMaps;
- int numInstalled;
- int i;
- Colormap wantMap;
- ColormapPtr pCmap;
-
- pSaver = &pScreen->screensaver;
- if (pSaver->pWindow)
- {
- pSaver->pWindow = NullWindow;
- FreeResource (pSaver->wid, RT_NONE);
- if (pPriv)
- {
- UninstallSaverColormap (pScreen);
- pPriv->hasWindow = FALSE;
- CheckScreenPrivate (pScreen);
- }
- }
-
- if (!pPriv || !(pAttr = pPriv->attr))
- return FALSE;
-
- pPriv->installedMap = None;
-
- if (GrabInProgress && GrabInProgress != pAttr->client->index)
- return FALSE;
-
- pWin = CreateWindow (pSaver->wid, pScreen->root,
- pAttr->x, pAttr->y, pAttr->width, pAttr->height,
- pAttr->borderWidth, pAttr->class,
- pAttr->mask, (XID *)pAttr->values,
- pAttr->depth, serverClient, pAttr->visual,
- &result);
- if (!pWin)
- return FALSE;
-
- if (!AddResource(pWin->drawable.id, RT_WINDOW, pWin))
- return FALSE;
-
- mask = 0;
- if (pAttr->pBackgroundPixmap)
- {
- pWin->backgroundState = BackgroundPixmap;
- pWin->background.pixmap = pAttr->pBackgroundPixmap;
- pAttr->pBackgroundPixmap->refcnt++;
- mask |= CWBackPixmap;
- }
- if (pAttr->pBorderPixmap)
- {
- pWin->borderIsPixel = FALSE;
- pWin->border.pixmap = pAttr->pBorderPixmap;
- pAttr->pBorderPixmap->refcnt++;
- mask |= CWBorderPixmap;
- }
- if (pAttr->pCursor)
- {
- if (!pWin->optional)
- if (!MakeWindowOptional (pWin))
- {
- FreeResource (pWin->drawable.id, RT_NONE);
- return FALSE;
- }
- pAttr->pCursor->refcnt++;
- if (pWin->optional->cursor)
- FreeCursor (pWin->optional->cursor, (Cursor)0);
- pWin->optional->cursor = pAttr->pCursor;
- pWin->cursorIsNone = FALSE;
- CheckWindowOptionalNeed (pWin);
- mask |= CWCursor;
- }
- if (mask)
- (*pScreen->ChangeWindowAttributes) (pWin, mask);
-
- if (pAttr->colormap != None)
- (void) ChangeWindowAttributes (pWin, CWColormap, &pAttr->colormap,
- serverClient);
-
- MapWindow (pWin, serverClient);
-
- pPriv->hasWindow = TRUE;
- pSaver->pWindow = pWin;
-
- /* check and install our own colormap if it isn't installed now */
- wantMap = wColormap (pWin);
- if (wantMap == None)
- return TRUE;
- installedMaps = malloc(pScreen->maxInstalledCmaps * sizeof (Colormap));
- numInstalled = (*pWin->drawable.pScreen->ListInstalledColormaps)
- (pScreen, installedMaps);
- for (i = 0; i < numInstalled; i++)
- if (installedMaps[i] == wantMap)
- break;
-
- free((char *) installedMaps);
-
- if (i < numInstalled)
- return TRUE;
-
- result = dixLookupResourceByType((pointer *)&pCmap, wantMap, RT_COLORMAP,
- serverClient, DixInstallAccess);
- if (result != Success)
- return TRUE;
-
- pPriv->installedMap = wantMap;
-
- (*pCmap->pScreen->InstallColormap) (pCmap);
-
- return TRUE;
-}
-
-static Bool
-DestroySaverWindow (ScreenPtr pScreen)
-{
- SetupScreen(pScreen);
- ScreenSaverStuffPtr pSaver;
-
- if (!pPriv || !pPriv->hasWindow)
- return FALSE;
-
- pSaver = &pScreen->screensaver;
- if (pSaver->pWindow)
- {
- pSaver->pWindow = NullWindow;
- FreeResource (pSaver->wid, RT_NONE);
- }
- pPriv->hasWindow = FALSE;
- CheckScreenPrivate (pScreen);
- UninstallSaverColormap (pScreen);
- return TRUE;
-}
-
-static Bool
-ScreenSaverHandle (ScreenPtr pScreen, int xstate, Bool force)
-{
- int state = 0;
- Bool ret = FALSE;
- ScreenSaverScreenPrivatePtr pPriv;
-
- switch (xstate)
- {
- case SCREEN_SAVER_ON:
- state = ScreenSaverOn;
- ret = CreateSaverWindow (pScreen);
- break;
- case SCREEN_SAVER_OFF:
- state = ScreenSaverOff;
- ret = DestroySaverWindow (pScreen);
- break;
- case SCREEN_SAVER_CYCLE:
- state = ScreenSaverCycle;
- pPriv = GetScreenPrivate (pScreen);
- if (pPriv && pPriv->hasWindow)
- ret = TRUE;
-
- }
-#ifdef PANORAMIX
- if(noPanoramiXExtension || !pScreen->myNum)
-#endif
- SendScreenSaverNotify (pScreen, state, force);
- return ret;
-}
-
-static int
-ProcScreenSaverQueryVersion (ClientPtr client)
-{
- xScreenSaverQueryVersionReply rep;
- int n;
-
- REQUEST_SIZE_MATCH (xScreenSaverQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = SERVER_SAVER_MAJOR_VERSION;
- rep.minorVersion = SERVER_SAVER_MINOR_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- }
- WriteToClient(client, sizeof (xScreenSaverQueryVersionReply), (char *)&rep);
- return Success;
-}
-
-static int
-ProcScreenSaverQueryInfo (ClientPtr client)
-{
- REQUEST(xScreenSaverQueryInfoReq);
- xScreenSaverQueryInfoReply rep;
- int n, rc;
- ScreenSaverStuffPtr pSaver;
- DrawablePtr pDraw;
- CARD32 lastInput;
- ScreenSaverScreenPrivatePtr pPriv;
-
- REQUEST_SIZE_MATCH (xScreenSaverQueryInfoReq);
- rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
- DixGetAttrAccess);
- if (rc != Success)
- return rc;
- rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, pDraw->pScreen,
- DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
- pSaver = &pDraw->pScreen->screensaver;
- pPriv = GetScreenPrivate (pDraw->pScreen);
-
- UpdateCurrentTime ();
- lastInput = GetTimeInMillis() - lastDeviceEventTime.milliseconds;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.window = pSaver->wid;
- if (screenIsSaved != SCREEN_SAVER_OFF)
- {
- rep.state = ScreenSaverOn;
- if (ScreenSaverTime)
- rep.tilOrSince = lastInput - ScreenSaverTime;
- else
- rep.tilOrSince = 0;
- }
- else
- {
- if (ScreenSaverTime)
- {
- rep.state = ScreenSaverOff;
- if (ScreenSaverTime < lastInput)
- rep.tilOrSince = 0;
- else
- rep.tilOrSince = ScreenSaverTime - lastInput;
- }
- else
- {
- rep.state = ScreenSaverDisabled;
- rep.tilOrSince = 0;
- }
- }
- rep.idle = lastInput;
- rep.eventMask = getEventMask (pDraw->pScreen, client);
- if (pPriv && pPriv->attr)
- rep.kind = ScreenSaverExternal;
- else if (ScreenSaverBlanking != DontPreferBlanking)
- rep.kind = ScreenSaverBlanked;
- else
- rep.kind = ScreenSaverInternal;
- if (client->swapped)
- {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.window, n);
- swapl (&rep.tilOrSince, n);
- swapl (&rep.idle, n);
- swapl (&rep.eventMask, n);
- }
- WriteToClient(client, sizeof (xScreenSaverQueryInfoReply), (char *)&rep);
- return Success;
-}
-
-static int
-ProcScreenSaverSelectInput (ClientPtr client)
-{
- REQUEST(xScreenSaverSelectInputReq);
- DrawablePtr pDraw;
- int rc;
-
- REQUEST_SIZE_MATCH (xScreenSaverSelectInputReq);
- rc = dixLookupDrawable (&pDraw, stuff->drawable, client, 0,
- DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
- rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, pDraw->pScreen,
- DixSetAttrAccess);
- if (rc != Success)
- return rc;
-
- if (!setEventMask (pDraw->pScreen, client, stuff->eventMask))
- return BadAlloc;
- return Success;
-}
-
-static int
-ScreenSaverSetAttributes (ClientPtr client)
-{
- REQUEST(xScreenSaverSetAttributesReq);
- DrawablePtr pDraw;
- WindowPtr pParent;
- ScreenPtr pScreen;
- ScreenSaverScreenPrivatePtr pPriv = 0;
- ScreenSaverAttrPtr pAttr = 0;
- int ret, len, class, bw, depth;
- unsigned long visual;
- int idepth, ivisual;
- Bool fOK;
- DepthPtr pDepth;
- WindowOptPtr ancwopt;
- unsigned int *pVlist;
- unsigned long *values = 0;
- unsigned long tmask, imask;
- unsigned long val;
- Pixmap pixID;
- PixmapPtr pPixmap;
- Cursor cursorID;
- CursorPtr pCursor;
- Colormap cmap;
- ColormapPtr pCmap;
-
- REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq);
- ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
- DixGetAttrAccess);
- if (ret != Success)
- return ret;
- pScreen = pDraw->pScreen;
- pParent = pScreen->root;
-
- ret = XaceHook(XACE_SCREENSAVER_ACCESS, client, pScreen, DixSetAttrAccess);
- if (ret != Success)
- return ret;
-
- len = stuff->length - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
- if (Ones(stuff->mask) != len)
- return BadLength;
- if (!stuff->width || !stuff->height)
- {
- client->errorValue = 0;
- return BadValue;
- }
- switch (class = stuff->c_class)
- {
- case CopyFromParent:
- case InputOnly:
- case InputOutput:
- break;
- default:
- client->errorValue = class;
- return BadValue;
- }
- bw = stuff->borderWidth;
- depth = stuff->depth;
- visual = stuff->visualID;
-
- /* copied directly from CreateWindow */
-
- if (class == CopyFromParent)
- class = pParent->drawable.class;
-
- if ((class != InputOutput) && (class != InputOnly))
- {
- client->errorValue = class;
- return BadValue;
- }
-
- if ((class != InputOnly) && (pParent->drawable.class == InputOnly))
- return BadMatch;
-
- if ((class == InputOnly) && ((bw != 0) || (depth != 0)))
- return BadMatch;
-
- if ((class == InputOutput) && (depth == 0))
- depth = pParent->drawable.depth;
- ancwopt = pParent->optional;
- if (!ancwopt)
- ancwopt = FindWindowWithOptional(pParent)->optional;
- if (visual == CopyFromParent)
- visual = ancwopt->visual;
-
- /* Find out if the depth and visual are acceptable for this Screen */
- if ((visual != ancwopt->visual) || (depth != pParent->drawable.depth))
- {
- fOK = FALSE;
- for(idepth = 0; idepth < pScreen->numDepths; idepth++)
- {
- pDepth = (DepthPtr) &pScreen->allowedDepths[idepth];
- if ((depth == pDepth->depth) || (depth == 0))
- {
- for (ivisual = 0; ivisual < pDepth->numVids; ivisual++)
- {
- if (visual == pDepth->vids[ivisual])
- {
- fOK = TRUE;
- break;
- }
- }
- }
- }
- if (fOK == FALSE)
- return BadMatch;
- }
-
- if (((stuff->mask & (CWBorderPixmap | CWBorderPixel)) == 0) &&
- (class != InputOnly) &&
- (depth != pParent->drawable.depth))
- {
- return BadMatch;
- }
-
- if (((stuff->mask & CWColormap) == 0) &&
- (class != InputOnly) &&
- ((visual != ancwopt->visual) || (ancwopt->colormap == None)))
- {
- return BadMatch;
- }
-
- /* end of errors from CreateWindow */
-
- pPriv = GetScreenPrivate (pScreen);
- if (pPriv && pPriv->attr)
- {
- if (pPriv->attr->client != client)
- return BadAccess;
- }
- if (!pPriv)
- {
- pPriv = MakeScreenPrivate (pScreen);
- if (!pPriv)
- return FALSE;
- }
- pAttr = New (ScreenSaverAttrRec);
- if (!pAttr)
- {
- ret = BadAlloc;
- goto bail;
- }
- /* over allocate for override redirect */
- values = malloc((len + 1) * sizeof (unsigned long));
- if (!values)
- {
- ret = BadAlloc;
- goto bail;
- }
- pAttr->screen = pScreen;
- pAttr->client = client;
- pAttr->x = stuff->x;
- pAttr->y = stuff->y;
- pAttr->width = stuff->width;
- pAttr->height = stuff->height;
- pAttr->borderWidth = stuff->borderWidth;
- pAttr->class = stuff->c_class;
- pAttr->depth = depth;
- pAttr->visual = visual;
- pAttr->colormap = None;
- pAttr->pCursor = NullCursor;
- pAttr->pBackgroundPixmap = NullPixmap;
- pAttr->pBorderPixmap = NullPixmap;
- pAttr->values = values;
- /*
- * go through the mask, checking the values,
- * looking up pixmaps and cursors and hold a reference
- * to them.
- */
- pAttr->mask = tmask = stuff->mask | CWOverrideRedirect;
- pVlist = (unsigned int *) (stuff + 1);
- while (tmask) {
- imask = lowbit (tmask);
- tmask &= ~imask;
- switch (imask)
- {
- case CWBackPixmap:
- pixID = (Pixmap )*pVlist;
- if (pixID == None)
- {
- *values++ = None;
- }
- else if (pixID == ParentRelative)
- {
- if (depth != pParent->drawable.depth)
- {
- ret = BadMatch;
- goto PatchUp;
- }
- *values++ = ParentRelative;
- }
- else
- {
- ret = dixLookupResourceByType((pointer *)&pPixmap, pixID, RT_PIXMAP,
- client, DixReadAccess);
- if (ret == Success)
- {
- if ((pPixmap->drawable.depth != depth) ||
- (pPixmap->drawable.pScreen != pScreen))
- {
- ret = BadMatch;
- goto PatchUp;
- }
- pAttr->pBackgroundPixmap = pPixmap;
- pPixmap->refcnt++;
- pAttr->mask &= ~CWBackPixmap;
- }
- else
- {
- client->errorValue = pixID;
- goto PatchUp;
- }
- }
- break;
- case CWBackPixel:
- *values++ = (CARD32) *pVlist;
- break;
- case CWBorderPixmap:
- pixID = (Pixmap ) *pVlist;
- if (pixID == CopyFromParent)
- {
- if (depth != pParent->drawable.depth)
- {
- ret = BadMatch;
- goto PatchUp;
- }
- *values++ = CopyFromParent;
- }
- else
- {
- ret = dixLookupResourceByType((pointer *)&pPixmap, pixID, RT_PIXMAP,
- client, DixReadAccess);
- if (ret == Success)
- {
- if ((pPixmap->drawable.depth != depth) ||
- (pPixmap->drawable.pScreen != pScreen))
- {
- ret = BadMatch;
- goto PatchUp;
- }
- pAttr->pBorderPixmap = pPixmap;
- pPixmap->refcnt++;
- pAttr->mask &= ~CWBorderPixmap;
- }
- else
- {
- client->errorValue = pixID;
- goto PatchUp;
- }
- }
- break;
- case CWBorderPixel:
- *values++ = (CARD32) *pVlist;
- break;
- case CWBitGravity:
- val = (CARD8 )*pVlist;
- if (val > StaticGravity)
- {
- ret = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- *values++ = val;
- break;
- case CWWinGravity:
- val = (CARD8 )*pVlist;
- if (val > StaticGravity)
- {
- ret = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- *values++ = val;
- break;
- case CWBackingStore:
- val = (CARD8 )*pVlist;
- if ((val != NotUseful) && (val != WhenMapped) && (val != Always))
- {
- ret = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- *values++ = val;
- break;
- case CWBackingPlanes:
- *values++ = (CARD32) *pVlist;
- break;
- case CWBackingPixel:
- *values++ = (CARD32) *pVlist;
- break;
- case CWSaveUnder:
- val = (BOOL) *pVlist;
- if ((val != xTrue) && (val != xFalse))
- {
- ret = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- *values++ = val;
- break;
- case CWEventMask:
- *values++ = (CARD32) *pVlist;
- break;
- case CWDontPropagate:
- *values++ = (CARD32) *pVlist;
- break;
- case CWOverrideRedirect:
- if (!(stuff->mask & CWOverrideRedirect))
- pVlist--;
- else
- {
- val = (BOOL ) *pVlist;
- if ((val != xTrue) && (val != xFalse))
- {
- ret = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- }
- *values++ = xTrue;
- break;
- case CWColormap:
- cmap = (Colormap) *pVlist;
- ret = dixLookupResourceByType((pointer *)&pCmap, cmap, RT_COLORMAP,
- client, DixUseAccess);
- if (ret != Success)
- {
- client->errorValue = cmap;
- goto PatchUp;
- }
- if (pCmap->pVisual->vid != visual || pCmap->pScreen != pScreen)
- {
- ret = BadMatch;
- goto PatchUp;
- }
- pAttr->colormap = cmap;
- pAttr->mask &= ~CWColormap;
- break;
- case CWCursor:
- cursorID = (Cursor ) *pVlist;
- if ( cursorID == None)
- {
- *values++ = None;
- }
- else
- {
- ret = dixLookupResourceByType((pointer *)&pCursor, cursorID,
- RT_CURSOR, client, DixUseAccess);
- if (ret != Success)
- {
- client->errorValue = cursorID;
- goto PatchUp;
- }
- pCursor->refcnt++;
- pAttr->pCursor = pCursor;
- pAttr->mask &= ~CWCursor;
- }
- break;
- default:
- ret = BadValue;
- client->errorValue = stuff->mask;
- goto PatchUp;
- }
- pVlist++;
- }
- if (pPriv->attr)
- FreeScreenAttr (pPriv->attr);
- pPriv->attr = pAttr;
- pAttr->resource = FakeClientID (client->index);
- if (!AddResource (pAttr->resource, AttrType, (pointer) pAttr))
- return BadAlloc;
- return Success;
-PatchUp:
- FreeAttrs (pAttr);
-bail:
- CheckScreenPrivate (pScreen);
- if (pAttr) free(pAttr->values);
- free(pAttr);
- return ret;
-}
-
-static int
-ScreenSaverUnsetAttributes (ClientPtr client)
-{
- REQUEST(xScreenSaverSetAttributesReq);
- DrawablePtr pDraw;
- ScreenSaverScreenPrivatePtr pPriv;
- int rc;
-
- REQUEST_SIZE_MATCH (xScreenSaverUnsetAttributesReq);
- rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
- DixGetAttrAccess);
- if (rc != Success)
- return rc;
- pPriv = GetScreenPrivate (pDraw->pScreen);
- if (pPriv && pPriv->attr && pPriv->attr->client == client)
- {
- FreeResource (pPriv->attr->resource, AttrType);
- FreeScreenAttr (pPriv->attr);
- pPriv->attr = NULL;
- CheckScreenPrivate (pDraw->pScreen);
- }
- return Success;
-}
-
-static int
-ProcScreenSaverSetAttributes (ClientPtr client)
-{
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- REQUEST(xScreenSaverSetAttributesReq);
- PanoramiXRes *draw;
- PanoramiXRes *backPix = NULL;
- PanoramiXRes *bordPix = NULL;
- PanoramiXRes *cmap = NULL;
- int i, status, len;
- int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
- XID orig_visual, tmp;
-
- REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq);
-
- status = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
- if (status != Success)
- return (status == BadValue) ? BadDrawable : status;
-
- len = stuff->length - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
- if (Ones(stuff->mask) != len)
- return BadLength;
-
- if((Mask)stuff->mask & CWBackPixmap) {
- pback_offset = Ones((Mask)stuff->mask & (CWBackPixmap - 1));
- tmp = *((CARD32 *) &stuff[1] + pback_offset);
- if ((tmp != None) && (tmp != ParentRelative)) {
- status = dixLookupResourceByType((pointer *)&backPix, tmp,
- XRT_PIXMAP, client,
- DixReadAccess);
- if (status != Success)
- return status;
- }
- }
-
- if ((Mask)stuff->mask & CWBorderPixmap) {
- pbord_offset = Ones((Mask)stuff->mask & (CWBorderPixmap - 1));
- tmp = *((CARD32 *) &stuff[1] + pbord_offset);
- if (tmp != CopyFromParent) {
- status = dixLookupResourceByType((pointer *)&bordPix, tmp,
- XRT_PIXMAP, client,
- DixReadAccess);
- if (status != Success)
- return status;
- }
- }
-
- if ((Mask)stuff->mask & CWColormap) {
- cmap_offset = Ones((Mask)stuff->mask & (CWColormap - 1));
- tmp = *((CARD32 *) &stuff[1] + cmap_offset);
- if ((tmp != CopyFromParent) && (tmp != None)) {
- status = dixLookupResourceByType((pointer *)&cmap, tmp,
- XRT_COLORMAP, client,
- DixReadAccess);
- if (status != Success)
- return status;
- }
- }
-
- orig_visual = stuff->visualID;
-
- FOR_NSCREENS_BACKWARD(i) {
- stuff->drawable = draw->info[i].id;
- if (backPix)
- *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[i].id;
- if (bordPix)
- *((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[i].id;
- if (cmap)
- *((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[i].id;
-
- if (orig_visual != CopyFromParent)
- stuff->visualID = PanoramiXTranslateVisualID(i, orig_visual);
-
- status = ScreenSaverSetAttributes(client);
- }
-
- return status;
- }
-#endif
-
- return ScreenSaverSetAttributes(client);
-}
-
-static int
-ProcScreenSaverUnsetAttributes (ClientPtr client)
-{
-#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- REQUEST(xScreenSaverUnsetAttributesReq);
- PanoramiXRes *draw;
- int rc, i;
-
- rc = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
- if (rc != Success)
- return (rc == BadValue) ? BadDrawable : rc;
-
- for(i = PanoramiXNumScreens - 1; i > 0; i--) {
- stuff->drawable = draw->info[i].id;
- ScreenSaverUnsetAttributes(client);
- }
-
- stuff->drawable = draw->info[0].id;
- }
-#endif
-
- return ScreenSaverUnsetAttributes(client);
-}
-
-static int
-ProcScreenSaverSuspend (ClientPtr client)
-{
- ScreenSaverSuspensionPtr *prev, this;
-
- REQUEST(xScreenSaverSuspendReq);
- REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
-
- /* Check if this client is suspending the screensaver */
- for (prev = &suspendingClients; (this = *prev); prev = &this->next)
- if (this->pClient == client)
- break;
-
- if (this)
- {
- if (stuff->suspend == TRUE)
- this->count++;
- else if (--this->count == 0)
- FreeResource (this->clientResource, RT_NONE);
-
- return Success;
- }
-
- /* If we get to this point, this client isn't suspending the screensaver */
- if (stuff->suspend == FALSE)
- return Success;
-
- /*
- * Allocate a suspension record for the client, and stop the screensaver
- * if it isn't already suspended by another client. We attach a resource ID
- * to the record, so the screensaver will be reenabled and the record freed
- * if the client disconnects without reenabling it first.
- */
- this = malloc(sizeof (ScreenSaverSuspensionRec));
-
- if (!this)
- return BadAlloc;
-
- this->next = NULL;
- this->pClient = client;
- this->count = 1;
- this->clientResource = FakeClientID (client->index);
-
- if (!AddResource (this->clientResource, SuspendType, (pointer) this))
- {
- free(this);
- return BadAlloc;
- }
-
- *prev = this;
- if (!screenSaverSuspended)
- {
- screenSaverSuspended = TRUE;
- FreeScreenSaverTimer();
- }
-
- return Success;
-}
-
-static int (*NormalVector[]) (ClientPtr /* client */) = {
- ProcScreenSaverQueryVersion,
- ProcScreenSaverQueryInfo,
- ProcScreenSaverSelectInput,
- ProcScreenSaverSetAttributes,
- ProcScreenSaverUnsetAttributes,
- ProcScreenSaverSuspend,
-};
-
-#define NUM_REQUESTS ((sizeof NormalVector) / (sizeof NormalVector[0]))
-
-static int
-ProcScreenSaverDispatch (ClientPtr client)
-{
- REQUEST(xReq);
-
- if (stuff->data < NUM_REQUESTS)
- return (*NormalVector[stuff->data])(client);
- return BadRequest;
-}
-
-static int
-SProcScreenSaverQueryVersion (ClientPtr client)
-{
- REQUEST(xScreenSaverQueryVersionReq);
- int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
- return ProcScreenSaverQueryVersion (client);
-}
-
-static int
-SProcScreenSaverQueryInfo (ClientPtr client)
-{
- REQUEST(xScreenSaverQueryInfoReq);
- int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq);
- swapl (&stuff->drawable, n);
- return ProcScreenSaverQueryInfo (client);
-}
-
-static int
-SProcScreenSaverSelectInput (ClientPtr client)
-{
- REQUEST(xScreenSaverSelectInputReq);
- int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq);
- swapl (&stuff->drawable, n);
- swapl (&stuff->eventMask, n);
- return ProcScreenSaverSelectInput (client);
-}
-
-static int
-SProcScreenSaverSetAttributes (ClientPtr client)
-{
- REQUEST(xScreenSaverSetAttributesReq);
- int n;
-
- swaps (&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
- swapl (&stuff->drawable, n);
- swaps (&stuff->x, n);
- swaps (&stuff->y, n);
- swaps (&stuff->width, n);
- swaps (&stuff->height, n);
- swaps (&stuff->borderWidth, n);
- swapl (&stuff->visualID, n);
- swapl (&stuff->mask, n);
- SwapRestL(stuff);
- return ProcScreenSaverSetAttributes (client);
-}
-
-static int
-SProcScreenSaverUnsetAttributes (ClientPtr client)
-{
- REQUEST(xScreenSaverUnsetAttributesReq);
- int n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
- swapl (&stuff->drawable, n);
- return ProcScreenSaverUnsetAttributes (client);
-}
-
-static int
-SProcScreenSaverSuspend (ClientPtr client)
-{
- int n;
- REQUEST(xScreenSaverSuspendReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
- swapl(&stuff->suspend, n);
- return ProcScreenSaverSuspend (client);
-}
-
-static int (*SwappedVector[]) (ClientPtr /* client */) = {
- SProcScreenSaverQueryVersion,
- SProcScreenSaverQueryInfo,
- SProcScreenSaverSelectInput,
- SProcScreenSaverSetAttributes,
- SProcScreenSaverUnsetAttributes,
- SProcScreenSaverSuspend,
-};
-
-static int
-SProcScreenSaverDispatch (ClientPtr client)
-{
- REQUEST(xReq);
-
- if (stuff->data < NUM_REQUESTS)
- return (*SwappedVector[stuff->data])(client);
- return BadRequest;
-}
-
-void
-ScreenSaverExtensionInit(INITARGS)
-{
- ExtensionEntry *extEntry;
- int i;
- ScreenPtr pScreen;
-
- if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
- return;
-
- AttrType = CreateNewResourceType(ScreenSaverFreeAttr, "SaverAttr");
- SaverEventType = CreateNewResourceType(ScreenSaverFreeEvents,
- "SaverEvent");
- SuspendType = CreateNewResourceType(ScreenSaverFreeSuspend,
- "SaverSuspend");
-
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- pScreen = screenInfo.screens[i];
- SetScreenPrivate (pScreen, NULL);
- }
- if (AttrType && SaverEventType && SuspendType &&
- (extEntry = AddExtension(ScreenSaverName, ScreenSaverNumberEvents, 0,
- ProcScreenSaverDispatch, SProcScreenSaverDispatch,
- NULL, StandardMinorOpcode)))
- {
- ScreenSaverEventBase = extEntry->eventBase;
- EventSwapVector[ScreenSaverEventBase] = (EventSwapPtr) SScreenSaverNotifyEvent;
- }
-}
+/*
+ *
+Copyright (c) 1992 X Consortium
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+ *
+ * Author: Keith Packard, MIT X Consortium
+ */
+
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#else
+#define SCREENSAVER
+#endif
+
+#ifdef CreateWindow
+#undef CreateWindow
+#endif
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "os.h"
+#include "windowstr.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "extnsionst.h"
+#include "dixstruct.h"
+#include "resource.h"
+#include "opaque.h"
+#include <X11/extensions/saverproto.h>
+#include "gcstruct.h"
+#include "cursorstr.h"
+#include "colormapst.h"
+#include "xace.h"
+#ifdef PANORAMIX
+#include "panoramiX.h"
+#include "panoramiXsrv.h"
+#endif
+#ifdef DPMSExtension
+#include <X11/extensions/dpmsconst.h>
+#endif
+#include "protocol-versions.h"
+
+#include <stdio.h>
+
+#include "modinit.h"
+
+static int ScreenSaverEventBase = 0;
+
+
+static Bool ScreenSaverHandle (
+ ScreenPtr /* pScreen */,
+ int /* xstate */,
+ Bool /* force */
+ );
+
+static Bool
+CreateSaverWindow (
+ ScreenPtr /* pScreen */
+ );
+
+static Bool
+DestroySaverWindow (
+ ScreenPtr /* pScreen */
+ );
+
+static void
+UninstallSaverColormap (
+ ScreenPtr /* pScreen */
+ );
+
+static void
+CheckScreenPrivate (
+ ScreenPtr /* pScreen */
+ );
+
+static void SScreenSaverNotifyEvent (
+ xScreenSaverNotifyEvent * /* from */,
+ xScreenSaverNotifyEvent * /* to */
+ );
+
+static RESTYPE SuspendType; /* resource type for suspension records */
+
+typedef struct _ScreenSaverSuspension *ScreenSaverSuspensionPtr;
+
+/* List of clients that are suspending the screensaver. */
+static ScreenSaverSuspensionPtr suspendingClients = NULL;
+
+/*
+ * clientResource is a resource ID that's added when the record is
+ * allocated, so the record is freed and the screensaver resumed when
+ * the client disconnects. count is the number of times the client has
+ * requested the screensaver be suspended.
+ */
+typedef struct _ScreenSaverSuspension
+{
+ ScreenSaverSuspensionPtr next;
+ ClientPtr pClient;
+ XID clientResource;
+ int count;
+} ScreenSaverSuspensionRec;
+
+static int ScreenSaverFreeSuspend(
+ pointer /*value */,
+ XID /* id */
+);
+
+/*
+ * each screen has a list of clients requesting
+ * ScreenSaverNotify events. Each client has a resource
+ * for each screen it selects ScreenSaverNotify input for,
+ * this resource is used to delete the ScreenSaverNotifyRec
+ * entry from the per-screen queue.
+ */
+
+static RESTYPE SaverEventType; /* resource type for event masks */
+
+typedef struct _ScreenSaverEvent *ScreenSaverEventPtr;
+
+typedef struct _ScreenSaverEvent {
+ ScreenSaverEventPtr next;
+ ClientPtr client;
+ ScreenPtr screen;
+ XID resource;
+ CARD32 mask;
+} ScreenSaverEventRec;
+
+static int ScreenSaverFreeEvents(
+ pointer /* value */,
+ XID /* id */
+);
+
+static Bool setEventMask (
+ ScreenPtr /* pScreen */,
+ ClientPtr /* client */,
+ unsigned long /* mask */
+);
+
+static unsigned long getEventMask (
+ ScreenPtr /* pScreen */,
+ ClientPtr /* client */
+);
+
+/*
+ * when a client sets the screen saver attributes, a resource is
+ * kept to be freed when the client exits
+ */
+
+static RESTYPE AttrType; /* resource type for attributes */
+
+typedef struct _ScreenSaverAttr {
+ ScreenPtr screen;
+ ClientPtr client;
+ XID resource;
+ short x, y;
+ unsigned short width, height, borderWidth;
+ unsigned char class;
+ unsigned char depth;
+ VisualID visual;
+ CursorPtr pCursor;
+ PixmapPtr pBackgroundPixmap;
+ PixmapPtr pBorderPixmap;
+ Colormap colormap;
+ unsigned long mask; /* no pixmaps or cursors */
+ unsigned long *values;
+} ScreenSaverAttrRec, *ScreenSaverAttrPtr;
+
+static int ScreenSaverFreeAttr (
+ pointer /* value */,
+ XID /* id */
+);
+
+static void FreeAttrs (
+ ScreenSaverAttrPtr /* pAttr */
+);
+
+static void FreeScreenAttr (
+ ScreenSaverAttrPtr /* pAttr */
+);
+
+static void
+SendScreenSaverNotify (
+ ScreenPtr /* pScreen */,
+ int /* state */,
+ Bool /* forced */
+);
+
+typedef struct _ScreenSaverScreenPrivate {
+ ScreenSaverEventPtr events;
+ ScreenSaverAttrPtr attr;
+ Bool hasWindow;
+ Colormap installedMap;
+} ScreenSaverScreenPrivateRec, *ScreenSaverScreenPrivatePtr;
+
+static ScreenSaverScreenPrivatePtr
+MakeScreenPrivate (
+ ScreenPtr /* pScreen */
+ );
+
+static DevPrivateKeyRec ScreenPrivateKeyRec;
+#define ScreenPrivateKey (&ScreenPrivateKeyRec)
+
+#define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr) \
+ dixLookupPrivate(&(s)->devPrivates, ScreenPrivateKey))
+#define SetScreenPrivate(s,v) \
+ dixSetPrivate(&(s)->devPrivates, ScreenPrivateKey, v);
+#define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = (s ? GetScreenPrivate(s) : NULL)
+
+#define New(t) (malloc(sizeof (t)))
+
+static void
+CheckScreenPrivate (ScreenPtr pScreen)
+{
+ SetupScreen (pScreen);
+
+ if (!pPriv)
+ return;
+ if (!pPriv->attr && !pPriv->events &&
+ !pPriv->hasWindow && pPriv->installedMap == None)
+ {
+ free(pPriv);
+ SetScreenPrivate (pScreen, NULL);
+ pScreen->screensaver.ExternalScreenSaver = NULL;
+ }
+}
+
+static ScreenSaverScreenPrivatePtr
+MakeScreenPrivate (ScreenPtr pScreen)
+{
+ SetupScreen (pScreen);
+
+ if (pPriv)
+ return pPriv;
+ pPriv = New (ScreenSaverScreenPrivateRec);
+ if (!pPriv)
+ return 0;
+ pPriv->events = 0;
+ pPriv->attr = 0;
+ pPriv->hasWindow = FALSE;
+ pPriv->installedMap = None;
+ SetScreenPrivate (pScreen, pPriv);
+ pScreen->screensaver.ExternalScreenSaver = ScreenSaverHandle;
+ return pPriv;
+}
+
+static unsigned long
+getEventMask (ScreenPtr pScreen, ClientPtr client)
+{
+ SetupScreen(pScreen);
+ ScreenSaverEventPtr pEv;
+
+ if (!pPriv)
+ return 0;
+ for (pEv = pPriv->events; pEv; pEv = pEv->next)
+ if (pEv->client == client)
+ return pEv->mask;
+ return 0;
+}
+
+static Bool
+setEventMask (ScreenPtr pScreen, ClientPtr client, unsigned long mask)
+{
+ SetupScreen(pScreen);
+ ScreenSaverEventPtr pEv, *pPrev;
+
+ if (getEventMask (pScreen, client) == mask)
+ return TRUE;
+ if (!pPriv)
+ {
+ pPriv = MakeScreenPrivate (pScreen);
+ if (!pPriv)
+ return FALSE;
+ }
+ for (pPrev = &pPriv->events; (pEv = *pPrev) != 0; pPrev = &pEv->next)
+ if (pEv->client == client)
+ break;
+ if (mask == 0)
+ {
+ FreeResource (pEv->resource, SaverEventType);
+ *pPrev = pEv->next;
+ free(pEv);
+ CheckScreenPrivate (pScreen);
+ }
+ else
+ {
+ if (!pEv)
+ {
+ pEv = New (ScreenSaverEventRec);
+ if (!pEv)
+ {
+ CheckScreenPrivate (pScreen);
+ return FALSE;
+ }
+ *pPrev = pEv;
+ pEv->next = NULL;
+ pEv->client = client;
+ pEv->screen = pScreen;
+ pEv->resource = FakeClientID (client->index);
+ if (!AddResource (pEv->resource, SaverEventType, (pointer) pEv))
+ return FALSE;
+ }
+ pEv->mask = mask;
+ }
+ return TRUE;
+}
+
+static void
+FreeAttrs (ScreenSaverAttrPtr pAttr)
+{
+ PixmapPtr pPixmap;
+ CursorPtr pCursor;
+
+ if ((pPixmap = pAttr->pBackgroundPixmap) != 0)
+ (*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap);
+ if ((pPixmap = pAttr->pBorderPixmap) != 0)
+ (*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap);
+ if ((pCursor = pAttr->pCursor) != 0)
+ FreeCursor (pCursor, (Cursor) 0);
+}
+
+static void
+FreeScreenAttr (ScreenSaverAttrPtr pAttr)
+{
+ FreeAttrs (pAttr);
+ free(pAttr->values);
+ free(pAttr);
+}
+
+static int
+ScreenSaverFreeEvents (pointer value, XID id)
+{
+ ScreenSaverEventPtr pOld = (ScreenSaverEventPtr)value;
+ ScreenPtr pScreen = pOld->screen;
+ SetupScreen (pScreen);
+ ScreenSaverEventPtr pEv, *pPrev;
+
+ if (!pPriv)
+ return TRUE;
+ for (pPrev = &pPriv->events; (pEv = *pPrev) != 0; pPrev = &pEv->next)
+ if (pEv == pOld)
+ break;
+ if (!pEv)
+ return TRUE;
+ *pPrev = pEv->next;
+ free(pEv);
+ CheckScreenPrivate (pScreen);
+ return TRUE;
+}
+
+static int
+ScreenSaverFreeAttr (pointer value, XID id)
+{
+ ScreenSaverAttrPtr pOldAttr = (ScreenSaverAttrPtr)value;
+ ScreenPtr pScreen = pOldAttr->screen;
+ SetupScreen (pScreen);
+
+ if (!pPriv)
+ return TRUE;
+ if (pPriv->attr != pOldAttr)
+ return TRUE;
+ FreeScreenAttr (pOldAttr);
+ pPriv->attr = NULL;
+ if (pPriv->hasWindow)
+ {
+ dixSaveScreens (serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);
+ dixSaveScreens (serverClient, SCREEN_SAVER_FORCER, ScreenSaverActive);
+ }
+ CheckScreenPrivate (pScreen);
+ return TRUE;
+}
+
+static int
+ScreenSaverFreeSuspend (pointer value, XID id)
+{
+ ScreenSaverSuspensionPtr data = (ScreenSaverSuspensionPtr) value;
+ ScreenSaverSuspensionPtr *prev, this;
+
+ /* Unlink and free the suspension record for the client */
+ for (prev = &suspendingClients; (this = *prev); prev = &this->next)
+ {
+ if (this == data)
+ {
+ *prev = this->next;
+ free(this);
+ break;
+ }
+ }
+
+ /* Reenable the screensaver if this was the last client suspending it. */
+ if (screenSaverSuspended && suspendingClients == NULL)
+ {
+ screenSaverSuspended = FALSE;
+
+ /* The screensaver could be active, since suspending it (by design)
+ doesn't prevent it from being forceably activated */
+#ifdef DPMSExtension
+ if (screenIsSaved != SCREEN_SAVER_ON && DPMSPowerLevel == DPMSModeOn)
+#else
+ if (screenIsSaved != SCREEN_SAVER_ON)
+#endif
+ {
+ UpdateCurrentTimeIf();
+ lastDeviceEventTime = currentTime;
+ SetScreenSaverTimer();
+ }
+ }
+
+ return Success;
+}
+
+static void
+SendScreenSaverNotify (ScreenPtr pScreen, int state, Bool forced)
+{
+ ScreenSaverScreenPrivatePtr pPriv;
+ ScreenSaverEventPtr pEv;
+ unsigned long mask;
+ xScreenSaverNotifyEvent ev;
+ int kind;
+
+ UpdateCurrentTimeIf ();
+ mask = ScreenSaverNotifyMask;
+ if (state == ScreenSaverCycle)
+ mask = ScreenSaverCycleMask;
+ pScreen = screenInfo.screens[pScreen->myNum];
+ pPriv = GetScreenPrivate(pScreen);
+ if (!pPriv)
+ return;
+ if (pPriv->attr)
+ kind = ScreenSaverExternal;
+ else if (ScreenSaverBlanking != DontPreferBlanking)
+ kind = ScreenSaverBlanked;
+ else
+ kind = ScreenSaverInternal;
+ for (pEv = pPriv->events; pEv; pEv = pEv->next)
+ {
+ if (!(pEv->mask & mask))
+ continue;
+ ev.type = ScreenSaverNotify + ScreenSaverEventBase;
+ ev.state = state;
+ ev.timestamp = currentTime.milliseconds;
+ ev.root = pScreen->root->drawable.id;
+ ev.window = pScreen->screensaver.wid;
+ ev.kind = kind;
+ ev.forced = forced;
+ WriteEventsToClient (pEv->client, 1, (xEvent *) &ev);
+ }
+}
+
+static void
+SScreenSaverNotifyEvent (xScreenSaverNotifyEvent *from,
+ xScreenSaverNotifyEvent *to)
+{
+ to->type = from->type;
+ to->state = from->state;
+ cpswaps (from->sequenceNumber, to->sequenceNumber);
+ cpswapl (from->timestamp, to->timestamp);
+ cpswapl (from->root, to->root);
+ cpswapl (from->window, to->window);
+ to->kind = from->kind;
+ to->forced = from->forced;
+}
+
+static void
+UninstallSaverColormap (ScreenPtr pScreen)
+{
+ SetupScreen(pScreen);
+ ColormapPtr pCmap;
+ int rc;
+
+ if (pPriv && pPriv->installedMap != None)
+ {
+ rc = dixLookupResourceByType((pointer *)&pCmap, pPriv->installedMap,
+ RT_COLORMAP, serverClient,
+ DixUninstallAccess);
+ if (rc == Success)
+ (*pCmap->pScreen->UninstallColormap) (pCmap);
+ pPriv->installedMap = None;
+ CheckScreenPrivate (pScreen);
+ }
+}
+
+static Bool
+CreateSaverWindow (ScreenPtr pScreen)
+{
+ SetupScreen (pScreen);
+ ScreenSaverStuffPtr pSaver;
+ ScreenSaverAttrPtr pAttr;
+ WindowPtr pWin;
+ int result;
+ unsigned long mask;
+ Colormap *installedMaps;
+ int numInstalled;
+ int i;
+ Colormap wantMap;
+ ColormapPtr pCmap;
+
+ pSaver = &pScreen->screensaver;
+ if (pSaver->pWindow)
+ {
+ pSaver->pWindow = NullWindow;
+ FreeResource (pSaver->wid, RT_NONE);
+ if (pPriv)
+ {
+ UninstallSaverColormap (pScreen);
+ pPriv->hasWindow = FALSE;
+ CheckScreenPrivate (pScreen);
+ }
+ }
+
+ if (!pPriv || !(pAttr = pPriv->attr))
+ return FALSE;
+
+ pPriv->installedMap = None;
+
+ if (GrabInProgress && GrabInProgress != pAttr->client->index)
+ return FALSE;
+
+ pWin = CreateWindow (pSaver->wid, pScreen->root,
+ pAttr->x, pAttr->y, pAttr->width, pAttr->height,
+ pAttr->borderWidth, pAttr->class,
+ pAttr->mask, (XID *)pAttr->values,
+ pAttr->depth, serverClient, pAttr->visual,
+ &result);
+ if (!pWin)
+ return FALSE;
+
+ if (!AddResource(pWin->drawable.id, RT_WINDOW, pWin))
+ return FALSE;
+
+ mask = 0;
+ if (pAttr->pBackgroundPixmap)
+ {
+ pWin->backgroundState = BackgroundPixmap;
+ pWin->background.pixmap = pAttr->pBackgroundPixmap;
+ pAttr->pBackgroundPixmap->refcnt++;
+ mask |= CWBackPixmap;
+ }
+ if (pAttr->pBorderPixmap)
+ {
+ pWin->borderIsPixel = FALSE;
+ pWin->border.pixmap = pAttr->pBorderPixmap;
+ pAttr->pBorderPixmap->refcnt++;
+ mask |= CWBorderPixmap;
+ }
+ if (pAttr->pCursor)
+ {
+ if (!pWin->optional)
+ if (!MakeWindowOptional (pWin))
+ {
+ FreeResource (pWin->drawable.id, RT_NONE);
+ return FALSE;
+ }
+ pAttr->pCursor->refcnt++;
+ if (pWin->optional->cursor)
+ FreeCursor (pWin->optional->cursor, (Cursor)0);
+ pWin->optional->cursor = pAttr->pCursor;
+ pWin->cursorIsNone = FALSE;
+ CheckWindowOptionalNeed (pWin);
+ mask |= CWCursor;
+ }
+ if (mask)
+ (*pScreen->ChangeWindowAttributes) (pWin, mask);
+
+ if (pAttr->colormap != None)
+ (void) ChangeWindowAttributes (pWin, CWColormap, &pAttr->colormap,
+ serverClient);
+
+ MapWindow (pWin, serverClient);
+
+ pPriv->hasWindow = TRUE;
+ pSaver->pWindow = pWin;
+
+ /* check and install our own colormap if it isn't installed now */
+ wantMap = wColormap (pWin);
+ if (wantMap == None)
+ return TRUE;
+ installedMaps = malloc(pScreen->maxInstalledCmaps * sizeof (Colormap));
+ numInstalled = (*pWin->drawable.pScreen->ListInstalledColormaps)
+ (pScreen, installedMaps);
+ for (i = 0; i < numInstalled; i++)
+ if (installedMaps[i] == wantMap)
+ break;
+
+ free((char *) installedMaps);
+
+ if (i < numInstalled)
+ return TRUE;
+
+ result = dixLookupResourceByType((pointer *)&pCmap, wantMap, RT_COLORMAP,
+ serverClient, DixInstallAccess);
+ if (result != Success)
+ return TRUE;
+
+ pPriv->installedMap = wantMap;
+
+ (*pCmap->pScreen->InstallColormap) (pCmap);
+
+ return TRUE;
+}
+
+static Bool
+DestroySaverWindow (ScreenPtr pScreen)
+{
+ SetupScreen(pScreen);
+ ScreenSaverStuffPtr pSaver;
+
+ if (!pPriv || !pPriv->hasWindow)
+ return FALSE;
+
+ pSaver = &pScreen->screensaver;
+ if (pSaver->pWindow)
+ {
+ pSaver->pWindow = NullWindow;
+ FreeResource (pSaver->wid, RT_NONE);
+ }
+ pPriv->hasWindow = FALSE;
+ CheckScreenPrivate (pScreen);
+ UninstallSaverColormap (pScreen);
+ return TRUE;
+}
+
+static Bool
+ScreenSaverHandle (ScreenPtr pScreen, int xstate, Bool force)
+{
+ int state = 0;
+ Bool ret = FALSE;
+ ScreenSaverScreenPrivatePtr pPriv;
+
+ switch (xstate)
+ {
+ case SCREEN_SAVER_ON:
+ state = ScreenSaverOn;
+ ret = CreateSaverWindow (pScreen);
+ break;
+ case SCREEN_SAVER_OFF:
+ state = ScreenSaverOff;
+ ret = DestroySaverWindow (pScreen);
+ break;
+ case SCREEN_SAVER_CYCLE:
+ state = ScreenSaverCycle;
+ pPriv = GetScreenPrivate (pScreen);
+ if (pPriv && pPriv->hasWindow)
+ ret = TRUE;
+
+ }
+#ifdef PANORAMIX
+ if(noPanoramiXExtension || !pScreen->myNum)
+#endif
+ SendScreenSaverNotify (pScreen, state, force);
+ return ret;
+}
+
+static int
+ProcScreenSaverQueryVersion (ClientPtr client)
+{
+ xScreenSaverQueryVersionReply rep;
+ REQUEST_SIZE_MATCH (xScreenSaverQueryVersionReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.majorVersion = SERVER_SAVER_MAJOR_VERSION;
+ rep.minorVersion = SERVER_SAVER_MINOR_VERSION;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ }
+ WriteToClient(client, sizeof (xScreenSaverQueryVersionReply), (char *)&rep);
+ return Success;
+}
+
+static int
+ProcScreenSaverQueryInfo (ClientPtr client)
+{
+ REQUEST(xScreenSaverQueryInfoReq);
+ xScreenSaverQueryInfoReply rep;
+ int rc;
+ ScreenSaverStuffPtr pSaver;
+ DrawablePtr pDraw;
+ CARD32 lastInput;
+ ScreenSaverScreenPrivatePtr pPriv;
+
+ REQUEST_SIZE_MATCH (xScreenSaverQueryInfoReq);
+ rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
+ DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+ rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, pDraw->pScreen,
+ DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ pSaver = &pDraw->pScreen->screensaver;
+ pPriv = GetScreenPrivate (pDraw->pScreen);
+
+ UpdateCurrentTime ();
+ lastInput = GetTimeInMillis() - lastDeviceEventTime.milliseconds;
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.window = pSaver->wid;
+ if (screenIsSaved != SCREEN_SAVER_OFF)
+ {
+ rep.state = ScreenSaverOn;
+ if (ScreenSaverTime)
+ rep.tilOrSince = lastInput - ScreenSaverTime;
+ else
+ rep.tilOrSince = 0;
+ }
+ else
+ {
+ if (ScreenSaverTime)
+ {
+ rep.state = ScreenSaverOff;
+ if (ScreenSaverTime < lastInput)
+ rep.tilOrSince = 0;
+ else
+ rep.tilOrSince = ScreenSaverTime - lastInput;
+ }
+ else
+ {
+ rep.state = ScreenSaverDisabled;
+ rep.tilOrSince = 0;
+ }
+ }
+ rep.idle = lastInput;
+ rep.eventMask = getEventMask (pDraw->pScreen, client);
+ if (pPriv && pPriv->attr)
+ rep.kind = ScreenSaverExternal;
+ else if (ScreenSaverBlanking != DontPreferBlanking)
+ rep.kind = ScreenSaverBlanked;
+ else
+ rep.kind = ScreenSaverInternal;
+ if (client->swapped)
+ {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.window);
+ swapl(&rep.tilOrSince);
+ swapl(&rep.idle);
+ swapl(&rep.eventMask);
+ }
+ WriteToClient(client, sizeof (xScreenSaverQueryInfoReply), (char *)&rep);
+ return Success;
+}
+
+static int
+ProcScreenSaverSelectInput (ClientPtr client)
+{
+ REQUEST(xScreenSaverSelectInputReq);
+ DrawablePtr pDraw;
+ int rc;
+
+ REQUEST_SIZE_MATCH (xScreenSaverSelectInputReq);
+ rc = dixLookupDrawable (&pDraw, stuff->drawable, client, 0,
+ DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, pDraw->pScreen,
+ DixSetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ if (!setEventMask (pDraw->pScreen, client, stuff->eventMask))
+ return BadAlloc;
+ return Success;
+}
+
+static int
+ScreenSaverSetAttributes (ClientPtr client)
+{
+ REQUEST(xScreenSaverSetAttributesReq);
+ DrawablePtr pDraw;
+ WindowPtr pParent;
+ ScreenPtr pScreen;
+ ScreenSaverScreenPrivatePtr pPriv = 0;
+ ScreenSaverAttrPtr pAttr = 0;
+ int ret, len, class, bw, depth;
+ unsigned long visual;
+ int idepth, ivisual;
+ Bool fOK;
+ DepthPtr pDepth;
+ WindowOptPtr ancwopt;
+ unsigned int *pVlist;
+ unsigned long *values = 0;
+ unsigned long tmask, imask;
+ unsigned long val;
+ Pixmap pixID;
+ PixmapPtr pPixmap;
+ Cursor cursorID;
+ CursorPtr pCursor;
+ Colormap cmap;
+ ColormapPtr pCmap;
+
+ REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq);
+ ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
+ DixGetAttrAccess);
+ if (ret != Success)
+ return ret;
+ pScreen = pDraw->pScreen;
+ pParent = pScreen->root;
+
+ ret = XaceHook(XACE_SCREENSAVER_ACCESS, client, pScreen, DixSetAttrAccess);
+ if (ret != Success)
+ return ret;
+
+ len = stuff->length - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
+ if (Ones(stuff->mask) != len)
+ return BadLength;
+ if (!stuff->width || !stuff->height)
+ {
+ client->errorValue = 0;
+ return BadValue;
+ }
+ switch (class = stuff->c_class)
+ {
+ case CopyFromParent:
+ case InputOnly:
+ case InputOutput:
+ break;
+ default:
+ client->errorValue = class;
+ return BadValue;
+ }
+ bw = stuff->borderWidth;
+ depth = stuff->depth;
+ visual = stuff->visualID;
+
+ /* copied directly from CreateWindow */
+
+ if (class == CopyFromParent)
+ class = pParent->drawable.class;
+
+ if ((class != InputOutput) && (class != InputOnly))
+ {
+ client->errorValue = class;
+ return BadValue;
+ }
+
+ if ((class != InputOnly) && (pParent->drawable.class == InputOnly))
+ return BadMatch;
+
+ if ((class == InputOnly) && ((bw != 0) || (depth != 0)))
+ return BadMatch;
+
+ if ((class == InputOutput) && (depth == 0))
+ depth = pParent->drawable.depth;
+ ancwopt = pParent->optional;
+ if (!ancwopt)
+ ancwopt = FindWindowWithOptional(pParent)->optional;
+ if (visual == CopyFromParent)
+ visual = ancwopt->visual;
+
+ /* Find out if the depth and visual are acceptable for this Screen */
+ if ((visual != ancwopt->visual) || (depth != pParent->drawable.depth))
+ {
+ fOK = FALSE;
+ for(idepth = 0; idepth < pScreen->numDepths; idepth++)
+ {
+ pDepth = (DepthPtr) &pScreen->allowedDepths[idepth];
+ if ((depth == pDepth->depth) || (depth == 0))
+ {
+ for (ivisual = 0; ivisual < pDepth->numVids; ivisual++)
+ {
+ if (visual == pDepth->vids[ivisual])
+ {
+ fOK = TRUE;
+ break;
+ }
+ }
+ }
+ }
+ if (fOK == FALSE)
+ return BadMatch;
+ }
+
+ if (((stuff->mask & (CWBorderPixmap | CWBorderPixel)) == 0) &&
+ (class != InputOnly) &&
+ (depth != pParent->drawable.depth))
+ {
+ return BadMatch;
+ }
+
+ if (((stuff->mask & CWColormap) == 0) &&
+ (class != InputOnly) &&
+ ((visual != ancwopt->visual) || (ancwopt->colormap == None)))
+ {
+ return BadMatch;
+ }
+
+ /* end of errors from CreateWindow */
+
+ pPriv = GetScreenPrivate (pScreen);
+ if (pPriv && pPriv->attr)
+ {
+ if (pPriv->attr->client != client)
+ return BadAccess;
+ }
+ if (!pPriv)
+ {
+ pPriv = MakeScreenPrivate (pScreen);
+ if (!pPriv)
+ return FALSE;
+ }
+ pAttr = New (ScreenSaverAttrRec);
+ if (!pAttr)
+ {
+ ret = BadAlloc;
+ goto bail;
+ }
+ /* over allocate for override redirect */
+ values = malloc((len + 1) * sizeof (unsigned long));
+ if (!values)
+ {
+ ret = BadAlloc;
+ goto bail;
+ }
+ pAttr->screen = pScreen;
+ pAttr->client = client;
+ pAttr->x = stuff->x;
+ pAttr->y = stuff->y;
+ pAttr->width = stuff->width;
+ pAttr->height = stuff->height;
+ pAttr->borderWidth = stuff->borderWidth;
+ pAttr->class = stuff->c_class;
+ pAttr->depth = depth;
+ pAttr->visual = visual;
+ pAttr->colormap = None;
+ pAttr->pCursor = NullCursor;
+ pAttr->pBackgroundPixmap = NullPixmap;
+ pAttr->pBorderPixmap = NullPixmap;
+ pAttr->values = values;
+ /*
+ * go through the mask, checking the values,
+ * looking up pixmaps and cursors and hold a reference
+ * to them.
+ */
+ pAttr->mask = tmask = stuff->mask | CWOverrideRedirect;
+ pVlist = (unsigned int *) (stuff + 1);
+ while (tmask) {
+ imask = lowbit (tmask);
+ tmask &= ~imask;
+ switch (imask)
+ {
+ case CWBackPixmap:
+ pixID = (Pixmap )*pVlist;
+ if (pixID == None)
+ {
+ *values++ = None;
+ }
+ else if (pixID == ParentRelative)
+ {
+ if (depth != pParent->drawable.depth)
+ {
+ ret = BadMatch;
+ goto PatchUp;
+ }
+ *values++ = ParentRelative;
+ }
+ else
+ {
+ ret = dixLookupResourceByType((pointer *)&pPixmap, pixID, RT_PIXMAP,
+ client, DixReadAccess);
+ if (ret == Success)
+ {
+ if ((pPixmap->drawable.depth != depth) ||
+ (pPixmap->drawable.pScreen != pScreen))
+ {
+ ret = BadMatch;
+ goto PatchUp;
+ }
+ pAttr->pBackgroundPixmap = pPixmap;
+ pPixmap->refcnt++;
+ pAttr->mask &= ~CWBackPixmap;
+ }
+ else
+ {
+ client->errorValue = pixID;
+ goto PatchUp;
+ }
+ }
+ break;
+ case CWBackPixel:
+ *values++ = (CARD32) *pVlist;
+ break;
+ case CWBorderPixmap:
+ pixID = (Pixmap ) *pVlist;
+ if (pixID == CopyFromParent)
+ {
+ if (depth != pParent->drawable.depth)
+ {
+ ret = BadMatch;
+ goto PatchUp;
+ }
+ *values++ = CopyFromParent;
+ }
+ else
+ {
+ ret = dixLookupResourceByType((pointer *)&pPixmap, pixID, RT_PIXMAP,
+ client, DixReadAccess);
+ if (ret == Success)
+ {
+ if ((pPixmap->drawable.depth != depth) ||
+ (pPixmap->drawable.pScreen != pScreen))
+ {
+ ret = BadMatch;
+ goto PatchUp;
+ }
+ pAttr->pBorderPixmap = pPixmap;
+ pPixmap->refcnt++;
+ pAttr->mask &= ~CWBorderPixmap;
+ }
+ else
+ {
+ client->errorValue = pixID;
+ goto PatchUp;
+ }
+ }
+ break;
+ case CWBorderPixel:
+ *values++ = (CARD32) *pVlist;
+ break;
+ case CWBitGravity:
+ val = (CARD8 )*pVlist;
+ if (val > StaticGravity)
+ {
+ ret = BadValue;
+ client->errorValue = val;
+ goto PatchUp;
+ }
+ *values++ = val;
+ break;
+ case CWWinGravity:
+ val = (CARD8 )*pVlist;
+ if (val > StaticGravity)
+ {
+ ret = BadValue;
+ client->errorValue = val;
+ goto PatchUp;
+ }
+ *values++ = val;
+ break;
+ case CWBackingStore:
+ val = (CARD8 )*pVlist;
+ if ((val != NotUseful) && (val != WhenMapped) && (val != Always))
+ {
+ ret = BadValue;
+ client->errorValue = val;
+ goto PatchUp;
+ }
+ *values++ = val;
+ break;
+ case CWBackingPlanes:
+ *values++ = (CARD32) *pVlist;
+ break;
+ case CWBackingPixel:
+ *values++ = (CARD32) *pVlist;
+ break;
+ case CWSaveUnder:
+ val = (BOOL) *pVlist;
+ if ((val != xTrue) && (val != xFalse))
+ {
+ ret = BadValue;
+ client->errorValue = val;
+ goto PatchUp;
+ }
+ *values++ = val;
+ break;
+ case CWEventMask:
+ *values++ = (CARD32) *pVlist;
+ break;
+ case CWDontPropagate:
+ *values++ = (CARD32) *pVlist;
+ break;
+ case CWOverrideRedirect:
+ if (!(stuff->mask & CWOverrideRedirect))
+ pVlist--;
+ else
+ {
+ val = (BOOL ) *pVlist;
+ if ((val != xTrue) && (val != xFalse))
+ {
+ ret = BadValue;
+ client->errorValue = val;
+ goto PatchUp;
+ }
+ }
+ *values++ = xTrue;
+ break;
+ case CWColormap:
+ cmap = (Colormap) *pVlist;
+ ret = dixLookupResourceByType((pointer *)&pCmap, cmap, RT_COLORMAP,
+ client, DixUseAccess);
+ if (ret != Success)
+ {
+ client->errorValue = cmap;
+ goto PatchUp;
+ }
+ if (pCmap->pVisual->vid != visual || pCmap->pScreen != pScreen)
+ {
+ ret = BadMatch;
+ goto PatchUp;
+ }
+ pAttr->colormap = cmap;
+ pAttr->mask &= ~CWColormap;
+ break;
+ case CWCursor:
+ cursorID = (Cursor ) *pVlist;
+ if ( cursorID == None)
+ {
+ *values++ = None;
+ }
+ else
+ {
+ ret = dixLookupResourceByType((pointer *)&pCursor, cursorID,
+ RT_CURSOR, client, DixUseAccess);
+ if (ret != Success)
+ {
+ client->errorValue = cursorID;
+ goto PatchUp;
+ }
+ pCursor->refcnt++;
+ pAttr->pCursor = pCursor;
+ pAttr->mask &= ~CWCursor;
+ }
+ break;
+ default:
+ ret = BadValue;
+ client->errorValue = stuff->mask;
+ goto PatchUp;
+ }
+ pVlist++;
+ }
+ if (pPriv->attr)
+ FreeScreenAttr (pPriv->attr);
+ pPriv->attr = pAttr;
+ pAttr->resource = FakeClientID (client->index);
+ if (!AddResource (pAttr->resource, AttrType, (pointer) pAttr))
+ return BadAlloc;
+ return Success;
+PatchUp:
+ FreeAttrs (pAttr);
+bail:
+ CheckScreenPrivate (pScreen);
+ if (pAttr) free(pAttr->values);
+ free(pAttr);
+ return ret;
+}
+
+static int
+ScreenSaverUnsetAttributes (ClientPtr client)
+{
+ REQUEST(xScreenSaverSetAttributesReq);
+ DrawablePtr pDraw;
+ ScreenSaverScreenPrivatePtr pPriv;
+ int rc;
+
+ REQUEST_SIZE_MATCH (xScreenSaverUnsetAttributesReq);
+ rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
+ DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+ pPriv = GetScreenPrivate (pDraw->pScreen);
+ if (pPriv && pPriv->attr && pPriv->attr->client == client)
+ {
+ FreeResource (pPriv->attr->resource, AttrType);
+ FreeScreenAttr (pPriv->attr);
+ pPriv->attr = NULL;
+ CheckScreenPrivate (pDraw->pScreen);
+ }
+ return Success;
+}
+
+static int
+ProcScreenSaverSetAttributes (ClientPtr client)
+{
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ REQUEST(xScreenSaverSetAttributesReq);
+ PanoramiXRes *draw;
+ PanoramiXRes *backPix = NULL;
+ PanoramiXRes *bordPix = NULL;
+ PanoramiXRes *cmap = NULL;
+ int i, status, len;
+ int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
+ XID orig_visual, tmp;
+
+ REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq);
+
+ status = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
+ if (status != Success)
+ return (status == BadValue) ? BadDrawable : status;
+
+ len = stuff->length - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
+ if (Ones(stuff->mask) != len)
+ return BadLength;
+
+ if((Mask)stuff->mask & CWBackPixmap) {
+ pback_offset = Ones((Mask)stuff->mask & (CWBackPixmap - 1));
+ tmp = *((CARD32 *) &stuff[1] + pback_offset);
+ if ((tmp != None) && (tmp != ParentRelative)) {
+ status = dixLookupResourceByType((pointer *)&backPix, tmp,
+ XRT_PIXMAP, client,
+ DixReadAccess);
+ if (status != Success)
+ return status;
+ }
+ }
+
+ if ((Mask)stuff->mask & CWBorderPixmap) {
+ pbord_offset = Ones((Mask)stuff->mask & (CWBorderPixmap - 1));
+ tmp = *((CARD32 *) &stuff[1] + pbord_offset);
+ if (tmp != CopyFromParent) {
+ status = dixLookupResourceByType((pointer *)&bordPix, tmp,
+ XRT_PIXMAP, client,
+ DixReadAccess);
+ if (status != Success)
+ return status;
+ }
+ }
+
+ if ((Mask)stuff->mask & CWColormap) {
+ cmap_offset = Ones((Mask)stuff->mask & (CWColormap - 1));
+ tmp = *((CARD32 *) &stuff[1] + cmap_offset);
+ if ((tmp != CopyFromParent) && (tmp != None)) {
+ status = dixLookupResourceByType((pointer *)&cmap, tmp,
+ XRT_COLORMAP, client,
+ DixReadAccess);
+ if (status != Success)
+ return status;
+ }
+ }
+
+ orig_visual = stuff->visualID;
+
+ FOR_NSCREENS_BACKWARD(i) {
+ stuff->drawable = draw->info[i].id;
+ if (backPix)
+ *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[i].id;
+ if (bordPix)
+ *((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[i].id;
+ if (cmap)
+ *((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[i].id;
+
+ if (orig_visual != CopyFromParent)
+ stuff->visualID = PanoramiXTranslateVisualID(i, orig_visual);
+
+ status = ScreenSaverSetAttributes(client);
+ }
+
+ return status;
+ }
+#endif
+
+ return ScreenSaverSetAttributes(client);
+}
+
+static int
+ProcScreenSaverUnsetAttributes (ClientPtr client)
+{
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension) {
+ REQUEST(xScreenSaverUnsetAttributesReq);
+ PanoramiXRes *draw;
+ int rc, i;
+
+ rc = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
+ if (rc != Success)
+ return (rc == BadValue) ? BadDrawable : rc;
+
+ for(i = PanoramiXNumScreens - 1; i > 0; i--) {
+ stuff->drawable = draw->info[i].id;
+ ScreenSaverUnsetAttributes(client);
+ }
+
+ stuff->drawable = draw->info[0].id;
+ }
+#endif
+
+ return ScreenSaverUnsetAttributes(client);
+}
+
+static int
+ProcScreenSaverSuspend (ClientPtr client)
+{
+ ScreenSaverSuspensionPtr *prev, this;
+
+ REQUEST(xScreenSaverSuspendReq);
+ REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
+
+ /* Check if this client is suspending the screensaver */
+ for (prev = &suspendingClients; (this = *prev); prev = &this->next)
+ if (this->pClient == client)
+ break;
+
+ if (this)
+ {
+ if (stuff->suspend == TRUE)
+ this->count++;
+ else if (--this->count == 0)
+ FreeResource (this->clientResource, RT_NONE);
+
+ return Success;
+ }
+
+ /* If we get to this point, this client isn't suspending the screensaver */
+ if (stuff->suspend == FALSE)
+ return Success;
+
+ /*
+ * Allocate a suspension record for the client, and stop the screensaver
+ * if it isn't already suspended by another client. We attach a resource ID
+ * to the record, so the screensaver will be reenabled and the record freed
+ * if the client disconnects without reenabling it first.
+ */
+ this = malloc(sizeof (ScreenSaverSuspensionRec));
+
+ if (!this)
+ return BadAlloc;
+
+ this->next = NULL;
+ this->pClient = client;
+ this->count = 1;
+ this->clientResource = FakeClientID (client->index);
+
+ if (!AddResource (this->clientResource, SuspendType, (pointer) this))
+ {
+ free(this);
+ return BadAlloc;
+ }
+
+ *prev = this;
+ if (!screenSaverSuspended)
+ {
+ screenSaverSuspended = TRUE;
+ FreeScreenSaverTimer();
+ }
+
+ return Success;
+}
+
+static int (*NormalVector[]) (ClientPtr /* client */) = {
+ ProcScreenSaverQueryVersion,
+ ProcScreenSaverQueryInfo,
+ ProcScreenSaverSelectInput,
+ ProcScreenSaverSetAttributes,
+ ProcScreenSaverUnsetAttributes,
+ ProcScreenSaverSuspend,
+};
+
+#define NUM_REQUESTS ((sizeof NormalVector) / (sizeof NormalVector[0]))
+
+static int
+ProcScreenSaverDispatch (ClientPtr client)
+{
+ REQUEST(xReq);
+
+ if (stuff->data < NUM_REQUESTS)
+ return (*NormalVector[stuff->data])(client);
+ return BadRequest;
+}
+
+static int
+SProcScreenSaverQueryVersion (ClientPtr client)
+{
+ REQUEST(xScreenSaverQueryVersionReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
+ return ProcScreenSaverQueryVersion (client);
+}
+
+static int
+SProcScreenSaverQueryInfo (ClientPtr client)
+{
+ REQUEST(xScreenSaverQueryInfoReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq);
+ swapl(&stuff->drawable);
+ return ProcScreenSaverQueryInfo (client);
+}
+
+static int
+SProcScreenSaverSelectInput (ClientPtr client)
+{
+ REQUEST(xScreenSaverSelectInputReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq);
+ swapl(&stuff->drawable);
+ swapl(&stuff->eventMask);
+ return ProcScreenSaverSelectInput (client);
+}
+
+static int
+SProcScreenSaverSetAttributes (ClientPtr client)
+{
+ REQUEST(xScreenSaverSetAttributesReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
+ swapl(&stuff->drawable);
+ swaps(&stuff->x);
+ swaps(&stuff->y);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
+ swaps(&stuff->borderWidth);
+ swapl(&stuff->visualID);
+ swapl(&stuff->mask);
+ SwapRestL(stuff);
+ return ProcScreenSaverSetAttributes (client);
+}
+
+static int
+SProcScreenSaverUnsetAttributes (ClientPtr client)
+{
+ REQUEST(xScreenSaverUnsetAttributesReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
+ swapl(&stuff->drawable);
+ return ProcScreenSaverUnsetAttributes (client);
+}
+
+static int
+SProcScreenSaverSuspend (ClientPtr client)
+{
+ REQUEST(xScreenSaverSuspendReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
+ return ProcScreenSaverSuspend (client);
+}
+
+static int (*SwappedVector[]) (ClientPtr /* client */) = {
+ SProcScreenSaverQueryVersion,
+ SProcScreenSaverQueryInfo,
+ SProcScreenSaverSelectInput,
+ SProcScreenSaverSetAttributes,
+ SProcScreenSaverUnsetAttributes,
+ SProcScreenSaverSuspend,
+};
+
+static int
+SProcScreenSaverDispatch (ClientPtr client)
+{
+ REQUEST(xReq);
+
+ if (stuff->data < NUM_REQUESTS)
+ return (*SwappedVector[stuff->data])(client);
+ return BadRequest;
+}
+
+void
+ScreenSaverExtensionInit(INITARGS)
+{
+ ExtensionEntry *extEntry;
+ int i;
+ ScreenPtr pScreen;
+
+ if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+ return;
+
+ AttrType = CreateNewResourceType(ScreenSaverFreeAttr, "SaverAttr");
+ SaverEventType = CreateNewResourceType(ScreenSaverFreeEvents,
+ "SaverEvent");
+ SuspendType = CreateNewResourceType(ScreenSaverFreeSuspend,
+ "SaverSuspend");
+
+ for (i = 0; i < screenInfo.numScreens; i++)
+ {
+ pScreen = screenInfo.screens[i];
+ SetScreenPrivate (pScreen, NULL);
+ }
+ if (AttrType && SaverEventType && SuspendType &&
+ (extEntry = AddExtension(ScreenSaverName, ScreenSaverNumberEvents, 0,
+ ProcScreenSaverDispatch, SProcScreenSaverDispatch,
+ NULL, StandardMinorOpcode)))
+ {
+ ScreenSaverEventBase = extEntry->eventBase;
+ EventSwapVector[ScreenSaverEventBase] = (EventSwapPtr) SScreenSaverNotifyEvent;
+ }
+}
diff --git a/xorg-server/Xext/security.c b/xorg-server/Xext/security.c
index ad6f9a3ef..5d2d0522f 100644
--- a/xorg-server/Xext/security.c
+++ b/xorg-server/Xext/security.c
@@ -1,1148 +1,1143 @@
-/*
-
-Copyright 1996, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-*/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#else
-#define XACE
-#endif
-
-#include "scrnintstr.h"
-#include "inputstr.h"
-#include "windowstr.h"
-#include "propertyst.h"
-#include "colormapst.h"
-#include "privates.h"
-#include "registry.h"
-#include "xacestr.h"
-#include "securitysrv.h"
-#include <X11/extensions/securproto.h>
-#include "modinit.h"
-#include "protocol-versions.h"
-
-/* Extension stuff */
-static int SecurityErrorBase; /* first Security error number */
-static int SecurityEventBase; /* first Security event number */
-
-RESTYPE SecurityAuthorizationResType; /* resource type for authorizations */
-static RESTYPE RTEventClient;
-
-static CallbackListPtr SecurityValidateGroupCallback = NULL;
-
-/* Private state record */
-static DevPrivateKeyRec stateKeyRec;
-#define stateKey (&stateKeyRec)
-
-/* This is what we store as client security state */
-typedef struct {
- int haveState;
- unsigned int trustLevel;
- XID authId;
-} SecurityStateRec;
-
-/* Extensions that untrusted clients shouldn't have access to */
-static char *SecurityTrustedExtensions[] = {
- "XC-MISC",
- "BIG-REQUESTS",
- "XpExtension",
- NULL
-};
-
-/*
- * Access modes that untrusted clients are allowed on trusted objects.
- */
-static const Mask SecurityResourceMask =
- DixGetAttrAccess | DixReceiveAccess | DixListPropAccess |
- DixGetPropAccess | DixListAccess;
-static const Mask SecurityWindowExtraMask = DixRemoveAccess;
-static const Mask SecurityRootWindowExtraMask =
- DixReceiveAccess | DixSendAccess | DixAddAccess | DixRemoveAccess;
-static const Mask SecurityDeviceMask =
- DixGetAttrAccess | DixReceiveAccess | DixGetFocusAccess |
- DixGrabAccess | DixSetAttrAccess | DixUseAccess;
-static const Mask SecurityServerMask = DixGetAttrAccess | DixGrabAccess;
-static const Mask SecurityClientMask = DixGetAttrAccess;
-
-
-/* SecurityAudit
- *
- * Arguments:
- * format is the formatting string to be used to interpret the
- * remaining arguments.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * Writes the message to the log file if security logging is on.
- */
-
-static void
-SecurityAudit(char *format, ...)
-{
- va_list args;
-
- if (auditTrailLevel < SECURITY_AUDIT_LEVEL)
- return;
- va_start(args, format);
- VAuditF(format, args);
- va_end(args);
-} /* SecurityAudit */
-
-/*
- * Performs a Security permission check.
- */
-static int
-SecurityDoCheck(SecurityStateRec *subj, SecurityStateRec *obj,
- Mask requested, Mask allowed)
-{
- if (!subj->haveState || !obj->haveState)
- return Success;
- if (subj->trustLevel == XSecurityClientTrusted)
- return Success;
- if (obj->trustLevel != XSecurityClientTrusted)
- return Success;
- if ((requested | allowed) == allowed)
- return Success;
-
- return BadAccess;
-}
-
-/*
- * Labels initial server objects.
- */
-static void
-SecurityLabelInitial(void)
-{
- SecurityStateRec *state;
-
- /* Do the serverClient */
- state = dixLookupPrivate(&serverClient->devPrivates, stateKey);
- state->trustLevel = XSecurityClientTrusted;
- state->haveState = TRUE;
-}
-
-/*
- * Looks up a request name
- */
-static _X_INLINE const char *
-SecurityLookupRequestName(ClientPtr client)
-{
- int major = ((xReq *)client->requestBuffer)->reqType;
- int minor = MinorOpcodeOfRequest(client);
- return LookupRequestName(major, minor);
-}
-
-
-/* SecurityDeleteAuthorization
- *
- * Arguments:
- * value is the authorization to delete.
- * id is its resource ID.
- *
- * Returns: Success.
- *
- * Side Effects:
- * Frees everything associated with the authorization.
- */
-
-static int
-SecurityDeleteAuthorization(
- pointer value,
- XID id)
-{
- SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)value;
- unsigned short name_len, data_len;
- char *name, *data;
- int status;
- int i;
- OtherClientsPtr pEventClient;
-
- /* Remove the auth using the os layer auth manager */
-
- status = AuthorizationFromID(pAuth->id, &name_len, &name,
- &data_len, &data);
- assert(status);
- status = RemoveAuthorization(name_len, name, data_len, data);
- assert(status);
- (void)status;
-
- /* free the auth timer if there is one */
-
- if (pAuth->timer) TimerFree(pAuth->timer);
-
- /* send revoke events */
-
- while ((pEventClient = pAuth->eventClients))
- {
- /* send revocation event event */
- xSecurityAuthorizationRevokedEvent are;
- are.type = SecurityEventBase + XSecurityAuthorizationRevoked;
- are.authId = pAuth->id;
- WriteEventsToClient(rClient(pEventClient), 1, (xEvent *)&are);
- FreeResource(pEventClient->resource, RT_NONE);
- }
-
- /* kill all clients using this auth */
-
- for (i = 1; i<currentMaxClients; i++)
- if (clients[i]) {
- SecurityStateRec *state;
- state = dixLookupPrivate(&clients[i]->devPrivates, stateKey);
- if (state->haveState && state->authId == pAuth->id)
- CloseDownClient(clients[i]);
- }
-
- SecurityAudit("revoked authorization ID %d\n", pAuth->id);
- free(pAuth);
- return Success;
-
-} /* SecurityDeleteAuthorization */
-
-
-/* resource delete function for RTEventClient */
-static int
-SecurityDeleteAuthorizationEventClient(
- pointer value,
- XID id)
-{
- OtherClientsPtr pEventClient, prev = NULL;
- SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)value;
-
- for (pEventClient = pAuth->eventClients;
- pEventClient;
- pEventClient = pEventClient->next)
- {
- if (pEventClient->resource == id)
- {
- if (prev)
- prev->next = pEventClient->next;
- else
- pAuth->eventClients = pEventClient->next;
- free(pEventClient);
- return Success;
- }
- prev = pEventClient;
- }
- /*NOTREACHED*/
- return -1; /* make compiler happy */
-} /* SecurityDeleteAuthorizationEventClient */
-
-
-/* SecurityComputeAuthorizationTimeout
- *
- * Arguments:
- * pAuth is the authorization for which we are computing the timeout
- * seconds is the number of seconds we want to wait
- *
- * Returns:
- * the number of milliseconds that the auth timer should be set to
- *
- * Side Effects:
- * Sets pAuth->secondsRemaining to any "overflow" amount of time
- * that didn't fit in 32 bits worth of milliseconds
- */
-
-static CARD32
-SecurityComputeAuthorizationTimeout(
- SecurityAuthorizationPtr pAuth,
- unsigned int seconds)
-{
- /* maxSecs is the number of full seconds that can be expressed in
- * 32 bits worth of milliseconds
- */
- CARD32 maxSecs = (CARD32)(~0) / (CARD32)MILLI_PER_SECOND;
-
- if (seconds > maxSecs)
- { /* only come here if we want to wait more than 49 days */
- pAuth->secondsRemaining = seconds - maxSecs;
- return maxSecs * MILLI_PER_SECOND;
- }
- else
- { /* by far the common case */
- pAuth->secondsRemaining = 0;
- return seconds * MILLI_PER_SECOND;
- }
-} /* SecurityStartAuthorizationTimer */
-
-/* SecurityAuthorizationExpired
- *
- * This function is passed as an argument to TimerSet and gets called from
- * the timer manager in the os layer when its time is up.
- *
- * Arguments:
- * timer is the timer for this authorization.
- * time is the current time.
- * pval is the authorization whose time is up.
- *
- * Returns:
- * A new time delay in milliseconds if the timer should wait some
- * more, else zero.
- *
- * Side Effects:
- * Frees the authorization resource if the timeout period is really
- * over, otherwise recomputes pAuth->secondsRemaining.
- */
-
-static CARD32
-SecurityAuthorizationExpired(
- OsTimerPtr timer,
- CARD32 time,
- pointer pval)
-{
- SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)pval;
-
- assert(pAuth->timer == timer);
-
- if (pAuth->secondsRemaining)
- {
- return SecurityComputeAuthorizationTimeout(pAuth,
- pAuth->secondsRemaining);
- }
- else
- {
- FreeResource(pAuth->id, RT_NONE);
- return 0;
- }
-} /* SecurityAuthorizationExpired */
-
-/* SecurityStartAuthorizationTimer
- *
- * Arguments:
- * pAuth is the authorization whose timer should be started.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * A timer is started, set to expire after the timeout period for
- * this authorization. When it expires, the function
- * SecurityAuthorizationExpired will be called.
- */
-
-static void
-SecurityStartAuthorizationTimer(
- SecurityAuthorizationPtr pAuth)
-{
- pAuth->timer = TimerSet(pAuth->timer, 0,
- SecurityComputeAuthorizationTimeout(pAuth, pAuth->timeout),
- SecurityAuthorizationExpired, pAuth);
-} /* SecurityStartAuthorizationTimer */
-
-
-/* Proc functions all take a client argument, execute the request in
- * client->requestBuffer, and return a protocol error status.
- */
-
-static int
-ProcSecurityQueryVersion(
- ClientPtr client)
-{
- /* REQUEST(xSecurityQueryVersionReq); */
- xSecurityQueryVersionReply rep;
-
- REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.majorVersion = SERVER_SECURITY_MAJOR_VERSION;
- rep.minorVersion = SERVER_SECURITY_MINOR_VERSION;
- if(client->swapped)
- {
- char n;
- swaps(&rep.sequenceNumber, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- (void)WriteToClient(client, SIZEOF(xSecurityQueryVersionReply),
- (char *)&rep);
- return Success;
-} /* ProcSecurityQueryVersion */
-
-
-static int
-SecurityEventSelectForAuthorization(
- SecurityAuthorizationPtr pAuth,
- ClientPtr client,
- Mask mask)
-{
- OtherClients *pEventClient;
-
- for (pEventClient = pAuth->eventClients;
- pEventClient;
- pEventClient = pEventClient->next)
- {
- if (SameClient(pEventClient, client))
- {
- if (mask == 0)
- FreeResource(pEventClient->resource, RT_NONE);
- else
- pEventClient->mask = mask;
- return Success;
- }
- }
-
- pEventClient = malloc(sizeof(OtherClients));
- if (!pEventClient)
- return BadAlloc;
- pEventClient->mask = mask;
- pEventClient->resource = FakeClientID(client->index);
- pEventClient->next = pAuth->eventClients;
- if (!AddResource(pEventClient->resource, RTEventClient,
- (pointer)pAuth))
- {
- free(pEventClient);
- return BadAlloc;
- }
- pAuth->eventClients = pEventClient;
-
- return Success;
-} /* SecurityEventSelectForAuthorization */
-
-
-static int
-ProcSecurityGenerateAuthorization(
- ClientPtr client)
-{
- REQUEST(xSecurityGenerateAuthorizationReq);
- int len; /* request length in CARD32s*/
- Bool removeAuth = FALSE; /* if bailout, call RemoveAuthorization? */
- SecurityAuthorizationPtr pAuth = NULL; /* auth we are creating */
- int err; /* error to return from this function */
- XID authId; /* authorization ID assigned by os layer */
- xSecurityGenerateAuthorizationReply rep; /* reply struct */
- unsigned int trustLevel; /* trust level of new auth */
- XID group; /* group of new auth */
- CARD32 timeout; /* timeout of new auth */
- CARD32 *values; /* list of supplied attributes */
- char *protoname; /* auth proto name sent in request */
- char *protodata; /* auth proto data sent in request */
- unsigned int authdata_len; /* # bytes of generated auth data */
- char *pAuthdata; /* generated auth data */
- Mask eventMask; /* what events on this auth does client want */
-
- /* check request length */
-
- REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
- len = bytes_to_int32(SIZEOF(xSecurityGenerateAuthorizationReq));
- len += bytes_to_int32(stuff->nbytesAuthProto);
- len += bytes_to_int32(stuff->nbytesAuthData);
- values = ((CARD32 *)stuff) + len;
- len += Ones(stuff->valueMask);
- if (client->req_len != len)
- return BadLength;
-
- /* check valuemask */
- if (stuff->valueMask & ~XSecurityAllAuthorizationAttributes)
- {
- client->errorValue = stuff->valueMask;
- return BadValue;
- }
-
- /* check timeout */
- timeout = 60;
- if (stuff->valueMask & XSecurityTimeout)
- {
- timeout = *values++;
- }
-
- /* check trustLevel */
- trustLevel = XSecurityClientUntrusted;
- if (stuff->valueMask & XSecurityTrustLevel)
- {
- trustLevel = *values++;
- if (trustLevel != XSecurityClientTrusted &&
- trustLevel != XSecurityClientUntrusted)
- {
- client->errorValue = trustLevel;
- return BadValue;
- }
- }
-
- /* check group */
- group = None;
- if (stuff->valueMask & XSecurityGroup)
- {
- group = *values++;
- if (SecurityValidateGroupCallback)
- {
- SecurityValidateGroupInfoRec vgi;
- vgi.group = group;
- vgi.valid = FALSE;
- CallCallbacks(&SecurityValidateGroupCallback, (pointer)&vgi);
-
- /* if nobody said they recognized it, it's an error */
-
- if (!vgi.valid)
- {
- client->errorValue = group;
- return BadValue;
- }
- }
- }
-
- /* check event mask */
- eventMask = 0;
- if (stuff->valueMask & XSecurityEventMask)
- {
- eventMask = *values++;
- if (eventMask & ~XSecurityAllEventMasks)
- {
- client->errorValue = eventMask;
- return BadValue;
- }
- }
-
- protoname = (char *)&stuff[1];
- protodata = protoname + bytes_to_int32(stuff->nbytesAuthProto);
-
- /* call os layer to generate the authorization */
-
- authId = GenerateAuthorization(stuff->nbytesAuthProto, protoname,
- stuff->nbytesAuthData, protodata,
- &authdata_len, &pAuthdata);
- if ((XID) ~0L == authId)
- {
- err = SecurityErrorBase + XSecurityBadAuthorizationProtocol;
- goto bailout;
- }
-
- /* now that we've added the auth, remember to remove it if we have to
- * abort the request for some reason (like allocation failure)
- */
- removeAuth = TRUE;
-
- /* associate additional information with this auth ID */
-
- pAuth = malloc(sizeof(SecurityAuthorizationRec));
- if (!pAuth)
- {
- err = BadAlloc;
- goto bailout;
- }
-
- /* fill in the auth fields */
-
- pAuth->id = authId;
- pAuth->timeout = timeout;
- pAuth->group = group;
- pAuth->trustLevel = trustLevel;
- pAuth->refcnt = 0; /* the auth was just created; nobody's using it yet */
- pAuth->secondsRemaining = 0;
- pAuth->timer = NULL;
- pAuth->eventClients = NULL;
-
- /* handle event selection */
- if (eventMask)
- {
- err = SecurityEventSelectForAuthorization(pAuth, client, eventMask);
- if (err != Success)
- goto bailout;
- }
-
- if (!AddResource(authId, SecurityAuthorizationResType, pAuth))
- {
- err = BadAlloc;
- goto bailout;
- }
-
- /* start the timer ticking */
-
- if (pAuth->timeout != 0)
- SecurityStartAuthorizationTimer(pAuth);
-
- /* tell client the auth id and data */
-
- rep.type = X_Reply;
- rep.length = bytes_to_int32(authdata_len);
- rep.sequenceNumber = client->sequence;
- rep.authId = authId;
- rep.dataLength = authdata_len;
-
- if (client->swapped)
- {
- char n;
- swapl(&rep.length, n);
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.authId, n);
- swaps(&rep.dataLength, n);
- }
-
- WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply),
- (char *)&rep);
- WriteToClient(client, authdata_len, pAuthdata);
-
- SecurityAudit("client %d generated authorization %d trust %d timeout %d group %d events %d\n",
- client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
- pAuth->group, eventMask);
-
- /* the request succeeded; don't call RemoveAuthorization or free pAuth */
- return Success;
-
-bailout:
- if (removeAuth)
- RemoveAuthorization(stuff->nbytesAuthProto, protoname,
- authdata_len, pAuthdata);
- free(pAuth);
- return err;
-
-} /* ProcSecurityGenerateAuthorization */
-
-static int
-ProcSecurityRevokeAuthorization(
- ClientPtr client)
-{
- REQUEST(xSecurityRevokeAuthorizationReq);
- SecurityAuthorizationPtr pAuth;
- int rc;
-
- REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
-
- rc = dixLookupResourceByType((pointer *)&pAuth, stuff->authId,
- SecurityAuthorizationResType, client,
- DixDestroyAccess);
- if (rc != Success)
- return rc;
-
- FreeResource(stuff->authId, RT_NONE);
- return Success;
-} /* ProcSecurityRevokeAuthorization */
-
-
-static int
-ProcSecurityDispatch(
- ClientPtr client)
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
- case X_SecurityQueryVersion:
- return ProcSecurityQueryVersion(client);
- case X_SecurityGenerateAuthorization:
- return ProcSecurityGenerateAuthorization(client);
- case X_SecurityRevokeAuthorization:
- return ProcSecurityRevokeAuthorization(client);
- default:
- return BadRequest;
- }
-} /* ProcSecurityDispatch */
-
-static int
-SProcSecurityQueryVersion(
- ClientPtr client)
-{
- REQUEST(xSecurityQueryVersionReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
- swaps(&stuff->majorVersion, n);
- swaps(&stuff->minorVersion,n);
- return ProcSecurityQueryVersion(client);
-} /* SProcSecurityQueryVersion */
-
-
-static int
-SProcSecurityGenerateAuthorization(
- ClientPtr client)
-{
- REQUEST(xSecurityGenerateAuthorizationReq);
- char n;
- CARD32 *values;
- unsigned long nvalues;
- int values_offset;
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
- swaps(&stuff->nbytesAuthProto, n);
- swaps(&stuff->nbytesAuthData, n);
- swapl(&stuff->valueMask, n);
- values_offset = bytes_to_int32(stuff->nbytesAuthProto) +
- bytes_to_int32(stuff->nbytesAuthData);
- if (values_offset >
- stuff->length - bytes_to_int32(sz_xSecurityGenerateAuthorizationReq))
- return BadLength;
- values = (CARD32 *)(&stuff[1]) + values_offset;
- nvalues = (((CARD32 *)stuff) + stuff->length) - values;
- SwapLongs(values, nvalues);
- return ProcSecurityGenerateAuthorization(client);
-} /* SProcSecurityGenerateAuthorization */
-
-
-static int
-SProcSecurityRevokeAuthorization(
- ClientPtr client)
-{
- REQUEST(xSecurityRevokeAuthorizationReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
- swapl(&stuff->authId, n);
- return ProcSecurityRevokeAuthorization(client);
-} /* SProcSecurityRevokeAuthorization */
-
-
-static int
-SProcSecurityDispatch(
- ClientPtr client)
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
- case X_SecurityQueryVersion:
- return SProcSecurityQueryVersion(client);
- case X_SecurityGenerateAuthorization:
- return SProcSecurityGenerateAuthorization(client);
- case X_SecurityRevokeAuthorization:
- return SProcSecurityRevokeAuthorization(client);
- default:
- return BadRequest;
- }
-} /* SProcSecurityDispatch */
-
-static void
-SwapSecurityAuthorizationRevokedEvent(
- xSecurityAuthorizationRevokedEvent *from,
- xSecurityAuthorizationRevokedEvent *to)
-{
- to->type = from->type;
- to->detail = from->detail;
- cpswaps(from->sequenceNumber, to->sequenceNumber);
- cpswapl(from->authId, to->authId);
-}
-
-/* SecurityCheckDeviceAccess
- *
- * Arguments:
- * client is the client attempting to access a device.
- * dev is the device being accessed.
- * fromRequest is TRUE if the device access is a direct result of
- * the client executing some request and FALSE if it is a
- * result of the server trying to send an event (e.g. KeymapNotify)
- * to the client.
- * Returns:
- * TRUE if the device access should be allowed, else FALSE.
- *
- * Side Effects:
- * An audit message is generated if access is denied.
- */
-
-static void
-SecurityDevice(CallbackListPtr *pcbl, pointer unused, pointer calldata)
-{
- XaceDeviceAccessRec *rec = calldata;
- SecurityStateRec *subj, *obj;
- Mask requested = rec->access_mode;
- Mask allowed = SecurityDeviceMask;
-
- subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
- obj = dixLookupPrivate(&serverClient->devPrivates, stateKey);
-
- if (rec->dev != inputInfo.keyboard)
- /* this extension only supports the core keyboard */
- allowed = requested;
-
- if (SecurityDoCheck(subj, obj, requested, allowed) != Success) {
- SecurityAudit("Security denied client %d keyboard access on request "
- "%s\n", rec->client->index,
- SecurityLookupRequestName(rec->client));
- rec->status = BadAccess;
- }
-}
-
-/* SecurityResource
- *
- * This function gets plugged into client->CheckAccess and is called from
- * SecurityLookupIDByType/Class to determine if the client can access the
- * resource.
- *
- * Arguments:
- * client is the client doing the resource access.
- * id is the resource id.
- * rtype is its type or class.
- * access_mode represents the intended use of the resource; see
- * resource.h.
- * res is a pointer to the resource structure for this resource.
- *
- * Returns:
- * If access is granted, the value of rval that was passed in, else FALSE.
- *
- * Side Effects:
- * Disallowed resource accesses are audited.
- */
-
-static void
-SecurityResource(CallbackListPtr *pcbl, pointer unused, pointer calldata)
-{
- XaceResourceAccessRec *rec = calldata;
- SecurityStateRec *subj, *obj;
- int cid = CLIENT_ID(rec->id);
- Mask requested = rec->access_mode;
- Mask allowed = SecurityResourceMask;
-
- subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
-
- /* disable background None for untrusted windows */
- if ((requested & DixCreateAccess) && (rec->rtype == RT_WINDOW))
- if (subj->haveState && subj->trustLevel != XSecurityClientTrusted)
- ((WindowPtr)rec->res)->forcedBG = TRUE;
-
- /* additional permissions for specific resource types */
- if (rec->rtype == RT_WINDOW)
- allowed |= SecurityWindowExtraMask;
-
- /* special checks for server-owned resources */
- if (cid == 0) {
- if (rec->rtype & RC_DRAWABLE)
- /* additional operations allowed on root windows */
- allowed |= SecurityRootWindowExtraMask;
-
- else if (rec->rtype == RT_COLORMAP)
- /* allow access to default colormaps */
- allowed = requested;
-
- else
- /* allow read access to other server-owned resources */
- allowed |= DixReadAccess;
- }
-
- if (clients[cid] != NULL) {
- obj = dixLookupPrivate(&clients[cid]->devPrivates, stateKey);
- if (SecurityDoCheck(subj, obj, requested, allowed) == Success)
- return;
- }
-
- SecurityAudit("Security: denied client %d access %x to resource 0x%x "
- "of client %d on request %s\n", rec->client->index,
- requested, rec->id, cid,
- SecurityLookupRequestName(rec->client));
- rec->status = BadAccess; /* deny access */
-}
-
-
-static void
-SecurityExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata)
-{
- XaceExtAccessRec *rec = calldata;
- SecurityStateRec *subj;
- int i = 0;
-
- subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
-
- if (subj->haveState && subj->trustLevel == XSecurityClientTrusted)
- return;
-
- while (SecurityTrustedExtensions[i])
- if (!strcmp(SecurityTrustedExtensions[i++], rec->ext->name))
- return;
-
- SecurityAudit("Security: denied client %d access to extension "
- "%s on request %s\n",
- rec->client->index, rec->ext->name,
- SecurityLookupRequestName(rec->client));
- rec->status = BadAccess;
-}
-
-static void
-SecurityServer(CallbackListPtr *pcbl, pointer unused, pointer calldata)
-{
- XaceServerAccessRec *rec = calldata;
- SecurityStateRec *subj, *obj;
- Mask requested = rec->access_mode;
- Mask allowed = SecurityServerMask;
-
- subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
- obj = dixLookupPrivate(&serverClient->devPrivates, stateKey);
-
- if (SecurityDoCheck(subj, obj, requested, allowed) != Success) {
- SecurityAudit("Security: denied client %d access to server "
- "configuration request %s\n", rec->client->index,
- SecurityLookupRequestName(rec->client));
- rec->status = BadAccess;
- }
-}
-
-static void
-SecurityClient(CallbackListPtr *pcbl, pointer unused, pointer calldata)
-{
- XaceClientAccessRec *rec = calldata;
- SecurityStateRec *subj, *obj;
- Mask requested = rec->access_mode;
- Mask allowed = SecurityClientMask;
-
- subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
- obj = dixLookupPrivate(&rec->target->devPrivates, stateKey);
-
- if (SecurityDoCheck(subj, obj, requested, allowed) != Success) {
- SecurityAudit("Security: denied client %d access to client %d on "
- "request %s\n", rec->client->index, rec->target->index,
- SecurityLookupRequestName(rec->client));
- rec->status = BadAccess;
- }
-}
-
-static void
-SecurityProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata)
-{
- XacePropertyAccessRec *rec = calldata;
- SecurityStateRec *subj, *obj;
- ATOM name = (*rec->ppProp)->propertyName;
- Mask requested = rec->access_mode;
- Mask allowed = SecurityResourceMask | DixReadAccess;
-
- subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
- obj = dixLookupPrivate(&wClient(rec->pWin)->devPrivates, stateKey);
-
- if (SecurityDoCheck(subj, obj, requested, allowed) != Success) {
- SecurityAudit("Security: denied client %d access to property %s "
- "(atom 0x%x) window 0x%x of client %d on request %s\n",
- rec->client->index, NameForAtom(name), name,
- rec->pWin->drawable.id, wClient(rec->pWin)->index,
- SecurityLookupRequestName(rec->client));
- rec->status = BadAccess;
- }
-}
-
-static void
-SecuritySend(CallbackListPtr *pcbl, pointer unused, pointer calldata)
-{
- XaceSendAccessRec *rec = calldata;
- SecurityStateRec *subj, *obj;
-
- if (rec->client) {
- int i;
-
- subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
- obj = dixLookupPrivate(&wClient(rec->pWin)->devPrivates, stateKey);
-
- if (SecurityDoCheck(subj, obj, DixSendAccess, 0) == Success)
- return;
-
- for (i = 0; i < rec->count; i++)
- if (rec->events[i].u.u.type != UnmapNotify &&
- rec->events[i].u.u.type != ConfigureRequest &&
- rec->events[i].u.u.type != ClientMessage) {
-
- SecurityAudit("Security: denied client %d from sending event "
- "of type %s to window 0x%x of client %d\n",
- rec->client->index,
- LookupEventName(rec->events[i].u.u.type),
- rec->pWin->drawable.id,
- wClient(rec->pWin)->index);
- rec->status = BadAccess;
- return;
- }
- }
-}
-
-static void
-SecurityReceive(CallbackListPtr *pcbl, pointer unused, pointer calldata)
-{
- XaceReceiveAccessRec *rec = calldata;
- SecurityStateRec *subj, *obj;
-
- subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
- obj = dixLookupPrivate(&wClient(rec->pWin)->devPrivates, stateKey);
-
- if (SecurityDoCheck(subj, obj, DixReceiveAccess, 0) == Success)
- return;
-
- SecurityAudit("Security: denied client %d from receiving an event "
- "sent to window 0x%x of client %d\n",
- rec->client->index, rec->pWin->drawable.id,
- wClient(rec->pWin)->index);
- rec->status = BadAccess;
-}
-
-/* SecurityClientStateCallback
- *
- * Arguments:
- * pcbl is &ClientStateCallback.
- * nullata is NULL.
- * calldata is a pointer to a NewClientInfoRec (include/dixstruct.h)
- * which contains information about client state changes.
- *
- * Returns: nothing.
- *
- * Side Effects:
- *
- * If a new client is connecting, its authorization ID is copied to
- * client->authID. If this is a generated authorization, its reference
- * count is bumped, its timer is cancelled if it was running, and its
- * trustlevel is copied to TRUSTLEVEL(client).
- *
- * If a client is disconnecting and the client was using a generated
- * authorization, the authorization's reference count is decremented, and
- * if it is now zero, the timer for this authorization is started.
- */
-
-static void
-SecurityClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
-{
- NewClientInfoRec *pci = calldata;
- SecurityStateRec *state;
- SecurityAuthorizationPtr pAuth;
- int rc;
-
- state = dixLookupPrivate(&pci->client->devPrivates, stateKey);
-
- switch (pci->client->clientState) {
- case ClientStateInitial:
- state->trustLevel = XSecurityClientTrusted;
- state->authId = None;
- state->haveState = TRUE;
- break;
-
- case ClientStateRunning:
- state->authId = AuthorizationIDOfClient(pci->client);
- rc = dixLookupResourceByType((pointer *)&pAuth, state->authId,
- SecurityAuthorizationResType, serverClient,
- DixGetAttrAccess);
- if (rc == Success) {
- /* it is a generated authorization */
- pAuth->refcnt++;
- if (pAuth->refcnt == 1 && pAuth->timer)
- TimerCancel(pAuth->timer);
-
- state->trustLevel = pAuth->trustLevel;
- }
- break;
-
- case ClientStateGone:
- case ClientStateRetained:
- rc = dixLookupResourceByType((pointer *)&pAuth, state->authId,
- SecurityAuthorizationResType, serverClient,
- DixGetAttrAccess);
- if (rc == Success) {
- /* it is a generated authorization */
- pAuth->refcnt--;
- if (pAuth->refcnt == 0)
- SecurityStartAuthorizationTimer(pAuth);
- }
- break;
-
- default:
- break;
- }
-}
-
-/* SecurityResetProc
- *
- * Arguments:
- * extEntry is the extension information for the security extension.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * Performs any cleanup needed by Security at server shutdown time.
- */
-
-static void
-SecurityResetProc(
- ExtensionEntry *extEntry)
-{
- /* Unregister callbacks */
- DeleteCallback(&ClientStateCallback, SecurityClientState, NULL);
-
- XaceDeleteCallback(XACE_EXT_DISPATCH, SecurityExtension, NULL);
- XaceDeleteCallback(XACE_RESOURCE_ACCESS, SecurityResource, NULL);
- XaceDeleteCallback(XACE_DEVICE_ACCESS, SecurityDevice, NULL);
- XaceDeleteCallback(XACE_PROPERTY_ACCESS, SecurityProperty, NULL);
- XaceDeleteCallback(XACE_SEND_ACCESS, SecuritySend, NULL);
- XaceDeleteCallback(XACE_RECEIVE_ACCESS, SecurityReceive, NULL);
- XaceDeleteCallback(XACE_CLIENT_ACCESS, SecurityClient, NULL);
- XaceDeleteCallback(XACE_EXT_ACCESS, SecurityExtension, NULL);
- XaceDeleteCallback(XACE_SERVER_ACCESS, SecurityServer, NULL);
-}
-
-
-/* SecurityExtensionInit
- *
- * Arguments: none.
- *
- * Returns: nothing.
- *
- * Side Effects:
- * Enables the Security extension if possible.
- */
-
-void
-SecurityExtensionInit(INITARGS)
-{
- ExtensionEntry *extEntry;
- int ret = TRUE;
-
- SecurityAuthorizationResType =
- CreateNewResourceType(SecurityDeleteAuthorization,
- "SecurityAuthorization");
-
- RTEventClient =
- CreateNewResourceType(SecurityDeleteAuthorizationEventClient,
- "SecurityEventClient");
-
- if (!SecurityAuthorizationResType || !RTEventClient)
- return;
-
- RTEventClient |= RC_NEVERRETAIN;
-
- /* Allocate the private storage */
- if (!dixRegisterPrivateKey(stateKey, PRIVATE_CLIENT, sizeof(SecurityStateRec)))
- FatalError("SecurityExtensionSetup: Can't allocate client private.\n");
-
- /* Register callbacks */
- ret &= AddCallback(&ClientStateCallback, SecurityClientState, NULL);
-
- ret &= XaceRegisterCallback(XACE_EXT_DISPATCH, SecurityExtension, NULL);
- ret &= XaceRegisterCallback(XACE_RESOURCE_ACCESS, SecurityResource, NULL);
- ret &= XaceRegisterCallback(XACE_DEVICE_ACCESS, SecurityDevice, NULL);
- ret &= XaceRegisterCallback(XACE_PROPERTY_ACCESS, SecurityProperty, NULL);
- ret &= XaceRegisterCallback(XACE_SEND_ACCESS, SecuritySend, NULL);
- ret &= XaceRegisterCallback(XACE_RECEIVE_ACCESS, SecurityReceive, NULL);
- ret &= XaceRegisterCallback(XACE_CLIENT_ACCESS, SecurityClient, NULL);
- ret &= XaceRegisterCallback(XACE_EXT_ACCESS, SecurityExtension, NULL);
- ret &= XaceRegisterCallback(XACE_SERVER_ACCESS, SecurityServer, NULL);
-
- if (!ret)
- FatalError("SecurityExtensionSetup: Failed to register callbacks\n");
-
- /* Add extension to server */
- extEntry = AddExtension(SECURITY_EXTENSION_NAME,
- XSecurityNumberEvents, XSecurityNumberErrors,
- ProcSecurityDispatch, SProcSecurityDispatch,
- SecurityResetProc, StandardMinorOpcode);
-
- SecurityErrorBase = extEntry->errorBase;
- SecurityEventBase = extEntry->eventBase;
-
- EventSwapVector[SecurityEventBase + XSecurityAuthorizationRevoked] =
- (EventSwapPtr)SwapSecurityAuthorizationRevokedEvent;
-
- SetResourceTypeErrorValue(SecurityAuthorizationResType, SecurityErrorBase + XSecurityBadAuthorization);
-
- /* Label objects that were created before we could register ourself */
- SecurityLabelInitial();
-}
+/*
+
+Copyright 1996, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#else
+#define XACE
+#endif
+
+#include "scrnintstr.h"
+#include "inputstr.h"
+#include "windowstr.h"
+#include "propertyst.h"
+#include "colormapst.h"
+#include "privates.h"
+#include "registry.h"
+#include "xacestr.h"
+#include "securitysrv.h"
+#include <X11/extensions/securproto.h>
+#include "modinit.h"
+#include "protocol-versions.h"
+
+/* Extension stuff */
+static int SecurityErrorBase; /* first Security error number */
+static int SecurityEventBase; /* first Security event number */
+
+RESTYPE SecurityAuthorizationResType; /* resource type for authorizations */
+static RESTYPE RTEventClient;
+
+static CallbackListPtr SecurityValidateGroupCallback = NULL;
+
+/* Private state record */
+static DevPrivateKeyRec stateKeyRec;
+#define stateKey (&stateKeyRec)
+
+/* This is what we store as client security state */
+typedef struct {
+ int haveState;
+ unsigned int trustLevel;
+ XID authId;
+} SecurityStateRec;
+
+/* Extensions that untrusted clients shouldn't have access to */
+static char *SecurityTrustedExtensions[] = {
+ "XC-MISC",
+ "BIG-REQUESTS",
+ "XpExtension",
+ NULL
+};
+
+/*
+ * Access modes that untrusted clients are allowed on trusted objects.
+ */
+static const Mask SecurityResourceMask =
+ DixGetAttrAccess | DixReceiveAccess | DixListPropAccess |
+ DixGetPropAccess | DixListAccess;
+static const Mask SecurityWindowExtraMask = DixRemoveAccess;
+static const Mask SecurityRootWindowExtraMask =
+ DixReceiveAccess | DixSendAccess | DixAddAccess | DixRemoveAccess;
+static const Mask SecurityDeviceMask =
+ DixGetAttrAccess | DixReceiveAccess | DixGetFocusAccess |
+ DixGrabAccess | DixSetAttrAccess | DixUseAccess;
+static const Mask SecurityServerMask = DixGetAttrAccess | DixGrabAccess;
+static const Mask SecurityClientMask = DixGetAttrAccess;
+
+
+/* SecurityAudit
+ *
+ * Arguments:
+ * format is the formatting string to be used to interpret the
+ * remaining arguments.
+ *
+ * Returns: nothing.
+ *
+ * Side Effects:
+ * Writes the message to the log file if security logging is on.
+ */
+
+static void
+SecurityAudit(char *format, ...)
+{
+ va_list args;
+
+ if (auditTrailLevel < SECURITY_AUDIT_LEVEL)
+ return;
+ va_start(args, format);
+ VAuditF(format, args);
+ va_end(args);
+} /* SecurityAudit */
+
+/*
+ * Performs a Security permission check.
+ */
+static int
+SecurityDoCheck(SecurityStateRec *subj, SecurityStateRec *obj,
+ Mask requested, Mask allowed)
+{
+ if (!subj->haveState || !obj->haveState)
+ return Success;
+ if (subj->trustLevel == XSecurityClientTrusted)
+ return Success;
+ if (obj->trustLevel != XSecurityClientTrusted)
+ return Success;
+ if ((requested | allowed) == allowed)
+ return Success;
+
+ return BadAccess;
+}
+
+/*
+ * Labels initial server objects.
+ */
+static void
+SecurityLabelInitial(void)
+{
+ SecurityStateRec *state;
+
+ /* Do the serverClient */
+ state = dixLookupPrivate(&serverClient->devPrivates, stateKey);
+ state->trustLevel = XSecurityClientTrusted;
+ state->haveState = TRUE;
+}
+
+/*
+ * Looks up a request name
+ */
+static _X_INLINE const char *
+SecurityLookupRequestName(ClientPtr client)
+{
+ int major = ((xReq *)client->requestBuffer)->reqType;
+ int minor = MinorOpcodeOfRequest(client);
+ return LookupRequestName(major, minor);
+}
+
+
+/* SecurityDeleteAuthorization
+ *
+ * Arguments:
+ * value is the authorization to delete.
+ * id is its resource ID.
+ *
+ * Returns: Success.
+ *
+ * Side Effects:
+ * Frees everything associated with the authorization.
+ */
+
+static int
+SecurityDeleteAuthorization(
+ pointer value,
+ XID id)
+{
+ SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)value;
+ unsigned short name_len, data_len;
+ char *name, *data;
+ int status;
+ int i;
+ OtherClientsPtr pEventClient;
+
+ /* Remove the auth using the os layer auth manager */
+
+ status = AuthorizationFromID(pAuth->id, &name_len, &name,
+ &data_len, &data);
+ assert(status);
+ status = RemoveAuthorization(name_len, name, data_len, data);
+ assert(status);
+ (void)status;
+
+ /* free the auth timer if there is one */
+
+ if (pAuth->timer) TimerFree(pAuth->timer);
+
+ /* send revoke events */
+
+ while ((pEventClient = pAuth->eventClients))
+ {
+ /* send revocation event event */
+ xSecurityAuthorizationRevokedEvent are;
+ are.type = SecurityEventBase + XSecurityAuthorizationRevoked;
+ are.authId = pAuth->id;
+ WriteEventsToClient(rClient(pEventClient), 1, (xEvent *)&are);
+ FreeResource(pEventClient->resource, RT_NONE);
+ }
+
+ /* kill all clients using this auth */
+
+ for (i = 1; i<currentMaxClients; i++)
+ if (clients[i]) {
+ SecurityStateRec *state;
+ state = dixLookupPrivate(&clients[i]->devPrivates, stateKey);
+ if (state->haveState && state->authId == pAuth->id)
+ CloseDownClient(clients[i]);
+ }
+
+ SecurityAudit("revoked authorization ID %d\n", pAuth->id);
+ free(pAuth);
+ return Success;
+
+} /* SecurityDeleteAuthorization */
+
+
+/* resource delete function for RTEventClient */
+static int
+SecurityDeleteAuthorizationEventClient(
+ pointer value,
+ XID id)
+{
+ OtherClientsPtr pEventClient, prev = NULL;
+ SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)value;
+
+ for (pEventClient = pAuth->eventClients;
+ pEventClient;
+ pEventClient = pEventClient->next)
+ {
+ if (pEventClient->resource == id)
+ {
+ if (prev)
+ prev->next = pEventClient->next;
+ else
+ pAuth->eventClients = pEventClient->next;
+ free(pEventClient);
+ return Success;
+ }
+ prev = pEventClient;
+ }
+ /*NOTREACHED*/
+ return -1; /* make compiler happy */
+} /* SecurityDeleteAuthorizationEventClient */
+
+
+/* SecurityComputeAuthorizationTimeout
+ *
+ * Arguments:
+ * pAuth is the authorization for which we are computing the timeout
+ * seconds is the number of seconds we want to wait
+ *
+ * Returns:
+ * the number of milliseconds that the auth timer should be set to
+ *
+ * Side Effects:
+ * Sets pAuth->secondsRemaining to any "overflow" amount of time
+ * that didn't fit in 32 bits worth of milliseconds
+ */
+
+static CARD32
+SecurityComputeAuthorizationTimeout(
+ SecurityAuthorizationPtr pAuth,
+ unsigned int seconds)
+{
+ /* maxSecs is the number of full seconds that can be expressed in
+ * 32 bits worth of milliseconds
+ */
+ CARD32 maxSecs = (CARD32)(~0) / (CARD32)MILLI_PER_SECOND;
+
+ if (seconds > maxSecs)
+ { /* only come here if we want to wait more than 49 days */
+ pAuth->secondsRemaining = seconds - maxSecs;
+ return maxSecs * MILLI_PER_SECOND;
+ }
+ else
+ { /* by far the common case */
+ pAuth->secondsRemaining = 0;
+ return seconds * MILLI_PER_SECOND;
+ }
+} /* SecurityStartAuthorizationTimer */
+
+/* SecurityAuthorizationExpired
+ *
+ * This function is passed as an argument to TimerSet and gets called from
+ * the timer manager in the os layer when its time is up.
+ *
+ * Arguments:
+ * timer is the timer for this authorization.
+ * time is the current time.
+ * pval is the authorization whose time is up.
+ *
+ * Returns:
+ * A new time delay in milliseconds if the timer should wait some
+ * more, else zero.
+ *
+ * Side Effects:
+ * Frees the authorization resource if the timeout period is really
+ * over, otherwise recomputes pAuth->secondsRemaining.
+ */
+
+static CARD32
+SecurityAuthorizationExpired(
+ OsTimerPtr timer,
+ CARD32 time,
+ pointer pval)
+{
+ SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)pval;
+
+ assert(pAuth->timer == timer);
+
+ if (pAuth->secondsRemaining)
+ {
+ return SecurityComputeAuthorizationTimeout(pAuth,
+ pAuth->secondsRemaining);
+ }
+ else
+ {
+ FreeResource(pAuth->id, RT_NONE);
+ return 0;
+ }
+} /* SecurityAuthorizationExpired */
+
+/* SecurityStartAuthorizationTimer
+ *
+ * Arguments:
+ * pAuth is the authorization whose timer should be started.
+ *
+ * Returns: nothing.
+ *
+ * Side Effects:
+ * A timer is started, set to expire after the timeout period for
+ * this authorization. When it expires, the function
+ * SecurityAuthorizationExpired will be called.
+ */
+
+static void
+SecurityStartAuthorizationTimer(
+ SecurityAuthorizationPtr pAuth)
+{
+ pAuth->timer = TimerSet(pAuth->timer, 0,
+ SecurityComputeAuthorizationTimeout(pAuth, pAuth->timeout),
+ SecurityAuthorizationExpired, pAuth);
+} /* SecurityStartAuthorizationTimer */
+
+
+/* Proc functions all take a client argument, execute the request in
+ * client->requestBuffer, and return a protocol error status.
+ */
+
+static int
+ProcSecurityQueryVersion(
+ ClientPtr client)
+{
+ /* REQUEST(xSecurityQueryVersionReq); */
+ xSecurityQueryVersionReply rep;
+
+ REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.majorVersion = SERVER_SECURITY_MAJOR_VERSION;
+ rep.minorVersion = SERVER_SECURITY_MINOR_VERSION;
+ if(client->swapped)
+ {
+ swaps(&rep.sequenceNumber);
+ swaps(&rep.majorVersion);
+ swaps(&rep.minorVersion);
+ }
+ (void)WriteToClient(client, SIZEOF(xSecurityQueryVersionReply),
+ (char *)&rep);
+ return Success;
+} /* ProcSecurityQueryVersion */
+
+
+static int
+SecurityEventSelectForAuthorization(
+ SecurityAuthorizationPtr pAuth,
+ ClientPtr client,
+ Mask mask)
+{
+ OtherClients *pEventClient;
+
+ for (pEventClient = pAuth->eventClients;
+ pEventClient;
+ pEventClient = pEventClient->next)
+ {
+ if (SameClient(pEventClient, client))
+ {
+ if (mask == 0)
+ FreeResource(pEventClient->resource, RT_NONE);
+ else
+ pEventClient->mask = mask;
+ return Success;
+ }
+ }
+
+ pEventClient = malloc(sizeof(OtherClients));
+ if (!pEventClient)
+ return BadAlloc;
+ pEventClient->mask = mask;
+ pEventClient->resource = FakeClientID(client->index);
+ pEventClient->next = pAuth->eventClients;
+ if (!AddResource(pEventClient->resource, RTEventClient,
+ (pointer)pAuth))
+ {
+ free(pEventClient);
+ return BadAlloc;
+ }
+ pAuth->eventClients = pEventClient;
+
+ return Success;
+} /* SecurityEventSelectForAuthorization */
+
+
+static int
+ProcSecurityGenerateAuthorization(
+ ClientPtr client)
+{
+ REQUEST(xSecurityGenerateAuthorizationReq);
+ int len; /* request length in CARD32s*/
+ Bool removeAuth = FALSE; /* if bailout, call RemoveAuthorization? */
+ SecurityAuthorizationPtr pAuth = NULL; /* auth we are creating */
+ int err; /* error to return from this function */
+ XID authId; /* authorization ID assigned by os layer */
+ xSecurityGenerateAuthorizationReply rep; /* reply struct */
+ unsigned int trustLevel; /* trust level of new auth */
+ XID group; /* group of new auth */
+ CARD32 timeout; /* timeout of new auth */
+ CARD32 *values; /* list of supplied attributes */
+ char *protoname; /* auth proto name sent in request */
+ char *protodata; /* auth proto data sent in request */
+ unsigned int authdata_len; /* # bytes of generated auth data */
+ char *pAuthdata; /* generated auth data */
+ Mask eventMask; /* what events on this auth does client want */
+
+ /* check request length */
+
+ REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
+ len = bytes_to_int32(SIZEOF(xSecurityGenerateAuthorizationReq));
+ len += bytes_to_int32(stuff->nbytesAuthProto);
+ len += bytes_to_int32(stuff->nbytesAuthData);
+ values = ((CARD32 *)stuff) + len;
+ len += Ones(stuff->valueMask);
+ if (client->req_len != len)
+ return BadLength;
+
+ /* check valuemask */
+ if (stuff->valueMask & ~XSecurityAllAuthorizationAttributes)
+ {
+ client->errorValue = stuff->valueMask;
+ return BadValue;
+ }
+
+ /* check timeout */
+ timeout = 60;
+ if (stuff->valueMask & XSecurityTimeout)
+ {
+ timeout = *values++;
+ }
+
+ /* check trustLevel */
+ trustLevel = XSecurityClientUntrusted;
+ if (stuff->valueMask & XSecurityTrustLevel)
+ {
+ trustLevel = *values++;
+ if (trustLevel != XSecurityClientTrusted &&
+ trustLevel != XSecurityClientUntrusted)
+ {
+ client->errorValue = trustLevel;
+ return BadValue;
+ }
+ }
+
+ /* check group */
+ group = None;
+ if (stuff->valueMask & XSecurityGroup)
+ {
+ group = *values++;
+ if (SecurityValidateGroupCallback)
+ {
+ SecurityValidateGroupInfoRec vgi;
+ vgi.group = group;
+ vgi.valid = FALSE;
+ CallCallbacks(&SecurityValidateGroupCallback, (pointer)&vgi);
+
+ /* if nobody said they recognized it, it's an error */
+
+ if (!vgi.valid)
+ {
+ client->errorValue = group;
+ return BadValue;
+ }
+ }
+ }
+
+ /* check event mask */
+ eventMask = 0;
+ if (stuff->valueMask & XSecurityEventMask)
+ {
+ eventMask = *values++;
+ if (eventMask & ~XSecurityAllEventMasks)
+ {
+ client->errorValue = eventMask;
+ return BadValue;
+ }
+ }
+
+ protoname = (char *)&stuff[1];
+ protodata = protoname + bytes_to_int32(stuff->nbytesAuthProto);
+
+ /* call os layer to generate the authorization */
+
+ authId = GenerateAuthorization(stuff->nbytesAuthProto, protoname,
+ stuff->nbytesAuthData, protodata,
+ &authdata_len, &pAuthdata);
+ if ((XID) ~0L == authId)
+ {
+ err = SecurityErrorBase + XSecurityBadAuthorizationProtocol;
+ goto bailout;
+ }
+
+ /* now that we've added the auth, remember to remove it if we have to
+ * abort the request for some reason (like allocation failure)
+ */
+ removeAuth = TRUE;
+
+ /* associate additional information with this auth ID */
+
+ pAuth = malloc(sizeof(SecurityAuthorizationRec));
+ if (!pAuth)
+ {
+ err = BadAlloc;
+ goto bailout;
+ }
+
+ /* fill in the auth fields */
+
+ pAuth->id = authId;
+ pAuth->timeout = timeout;
+ pAuth->group = group;
+ pAuth->trustLevel = trustLevel;
+ pAuth->refcnt = 0; /* the auth was just created; nobody's using it yet */
+ pAuth->secondsRemaining = 0;
+ pAuth->timer = NULL;
+ pAuth->eventClients = NULL;
+
+ /* handle event selection */
+ if (eventMask)
+ {
+ err = SecurityEventSelectForAuthorization(pAuth, client, eventMask);
+ if (err != Success)
+ goto bailout;
+ }
+
+ if (!AddResource(authId, SecurityAuthorizationResType, pAuth))
+ {
+ err = BadAlloc;
+ goto bailout;
+ }
+
+ /* start the timer ticking */
+
+ if (pAuth->timeout != 0)
+ SecurityStartAuthorizationTimer(pAuth);
+
+ /* tell client the auth id and data */
+
+ rep.type = X_Reply;
+ rep.length = bytes_to_int32(authdata_len);
+ rep.sequenceNumber = client->sequence;
+ rep.authId = authId;
+ rep.dataLength = authdata_len;
+
+ if (client->swapped)
+ {
+ swapl(&rep.length);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.authId);
+ swaps(&rep.dataLength);
+ }
+
+ WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply),
+ (char *)&rep);
+ WriteToClient(client, authdata_len, pAuthdata);
+
+ SecurityAudit("client %d generated authorization %d trust %d timeout %d group %d events %d\n",
+ client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
+ pAuth->group, eventMask);
+
+ /* the request succeeded; don't call RemoveAuthorization or free pAuth */
+ return Success;
+
+bailout:
+ if (removeAuth)
+ RemoveAuthorization(stuff->nbytesAuthProto, protoname,
+ authdata_len, pAuthdata);
+ free(pAuth);
+ return err;
+
+} /* ProcSecurityGenerateAuthorization */
+
+static int
+ProcSecurityRevokeAuthorization(
+ ClientPtr client)
+{
+ REQUEST(xSecurityRevokeAuthorizationReq);
+ SecurityAuthorizationPtr pAuth;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
+
+ rc = dixLookupResourceByType((pointer *)&pAuth, stuff->authId,
+ SecurityAuthorizationResType, client,
+ DixDestroyAccess);
+ if (rc != Success)
+ return rc;
+
+ FreeResource(stuff->authId, RT_NONE);
+ return Success;
+} /* ProcSecurityRevokeAuthorization */
+
+
+static int
+ProcSecurityDispatch(
+ ClientPtr client)
+{
+ REQUEST(xReq);
+
+ switch (stuff->data)
+ {
+ case X_SecurityQueryVersion:
+ return ProcSecurityQueryVersion(client);
+ case X_SecurityGenerateAuthorization:
+ return ProcSecurityGenerateAuthorization(client);
+ case X_SecurityRevokeAuthorization:
+ return ProcSecurityRevokeAuthorization(client);
+ default:
+ return BadRequest;
+ }
+} /* ProcSecurityDispatch */
+
+static int
+SProcSecurityQueryVersion(
+ ClientPtr client)
+{
+ REQUEST(xSecurityQueryVersionReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
+ swaps(&stuff->majorVersion);
+ swaps(&stuff->minorVersion);
+ return ProcSecurityQueryVersion(client);
+} /* SProcSecurityQueryVersion */
+
+
+static int
+SProcSecurityGenerateAuthorization(
+ ClientPtr client)
+{
+ REQUEST(xSecurityGenerateAuthorizationReq);
+ CARD32 *values;
+ unsigned long nvalues;
+ int values_offset;
+
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xSecurityGenerateAuthorizationReq);
+ swaps(&stuff->nbytesAuthProto);
+ swaps(&stuff->nbytesAuthData);
+ swapl(&stuff->valueMask);
+ values_offset = bytes_to_int32(stuff->nbytesAuthProto) +
+ bytes_to_int32(stuff->nbytesAuthData);
+ if (values_offset >
+ stuff->length - bytes_to_int32(sz_xSecurityGenerateAuthorizationReq))
+ return BadLength;
+ values = (CARD32 *)(&stuff[1]) + values_offset;
+ nvalues = (((CARD32 *)stuff) + stuff->length) - values;
+ SwapLongs(values, nvalues);
+ return ProcSecurityGenerateAuthorization(client);
+} /* SProcSecurityGenerateAuthorization */
+
+
+static int
+SProcSecurityRevokeAuthorization(
+ ClientPtr client)
+{
+ REQUEST(xSecurityRevokeAuthorizationReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
+ swapl(&stuff->authId);
+ return ProcSecurityRevokeAuthorization(client);
+} /* SProcSecurityRevokeAuthorization */
+
+
+static int
+SProcSecurityDispatch(
+ ClientPtr client)
+{
+ REQUEST(xReq);
+
+ switch (stuff->data)
+ {
+ case X_SecurityQueryVersion:
+ return SProcSecurityQueryVersion(client);
+ case X_SecurityGenerateAuthorization:
+ return SProcSecurityGenerateAuthorization(client);
+ case X_SecurityRevokeAuthorization:
+ return SProcSecurityRevokeAuthorization(client);
+ default:
+ return BadRequest;
+ }
+} /* SProcSecurityDispatch */
+
+static void
+SwapSecurityAuthorizationRevokedEvent(
+ xSecurityAuthorizationRevokedEvent *from,
+ xSecurityAuthorizationRevokedEvent *to)
+{
+ to->type = from->type;
+ to->detail = from->detail;
+ cpswaps(from->sequenceNumber, to->sequenceNumber);
+ cpswapl(from->authId, to->authId);
+}
+
+/* SecurityCheckDeviceAccess
+ *
+ * Arguments:
+ * client is the client attempting to access a device.
+ * dev is the device being accessed.
+ * fromRequest is TRUE if the device access is a direct result of
+ * the client executing some request and FALSE if it is a
+ * result of the server trying to send an event (e.g. KeymapNotify)
+ * to the client.
+ * Returns:
+ * TRUE if the device access should be allowed, else FALSE.
+ *
+ * Side Effects:
+ * An audit message is generated if access is denied.
+ */
+
+static void
+SecurityDevice(CallbackListPtr *pcbl, pointer unused, pointer calldata)
+{
+ XaceDeviceAccessRec *rec = calldata;
+ SecurityStateRec *subj, *obj;
+ Mask requested = rec->access_mode;
+ Mask allowed = SecurityDeviceMask;
+
+ subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
+ obj = dixLookupPrivate(&serverClient->devPrivates, stateKey);
+
+ if (rec->dev != inputInfo.keyboard)
+ /* this extension only supports the core keyboard */
+ allowed = requested;
+
+ if (SecurityDoCheck(subj, obj, requested, allowed) != Success) {
+ SecurityAudit("Security denied client %d keyboard access on request "
+ "%s\n", rec->client->index,
+ SecurityLookupRequestName(rec->client));
+ rec->status = BadAccess;
+ }
+}
+
+/* SecurityResource
+ *
+ * This function gets plugged into client->CheckAccess and is called from
+ * SecurityLookupIDByType/Class to determine if the client can access the
+ * resource.
+ *
+ * Arguments:
+ * client is the client doing the resource access.
+ * id is the resource id.
+ * rtype is its type or class.
+ * access_mode represents the intended use of the resource; see
+ * resource.h.
+ * res is a pointer to the resource structure for this resource.
+ *
+ * Returns:
+ * If access is granted, the value of rval that was passed in, else FALSE.
+ *
+ * Side Effects:
+ * Disallowed resource accesses are audited.
+ */
+
+static void
+SecurityResource(CallbackListPtr *pcbl, pointer unused, pointer calldata)
+{
+ XaceResourceAccessRec *rec = calldata;
+ SecurityStateRec *subj, *obj;
+ int cid = CLIENT_ID(rec->id);
+ Mask requested = rec->access_mode;
+ Mask allowed = SecurityResourceMask;
+
+ subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
+
+ /* disable background None for untrusted windows */
+ if ((requested & DixCreateAccess) && (rec->rtype == RT_WINDOW))
+ if (subj->haveState && subj->trustLevel != XSecurityClientTrusted)
+ ((WindowPtr)rec->res)->forcedBG = TRUE;
+
+ /* additional permissions for specific resource types */
+ if (rec->rtype == RT_WINDOW)
+ allowed |= SecurityWindowExtraMask;
+
+ /* special checks for server-owned resources */
+ if (cid == 0) {
+ if (rec->rtype & RC_DRAWABLE)
+ /* additional operations allowed on root windows */
+ allowed |= SecurityRootWindowExtraMask;
+
+ else if (rec->rtype == RT_COLORMAP)
+ /* allow access to default colormaps */
+ allowed = requested;
+
+ else
+ /* allow read access to other server-owned resources */
+ allowed |= DixReadAccess;
+ }
+
+ if (clients[cid] != NULL) {
+ obj = dixLookupPrivate(&clients[cid]->devPrivates, stateKey);
+ if (SecurityDoCheck(subj, obj, requested, allowed) == Success)
+ return;
+ }
+
+ SecurityAudit("Security: denied client %d access %x to resource 0x%x "
+ "of client %d on request %s\n", rec->client->index,
+ requested, rec->id, cid,
+ SecurityLookupRequestName(rec->client));
+ rec->status = BadAccess; /* deny access */
+}
+
+
+static void
+SecurityExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata)
+{
+ XaceExtAccessRec *rec = calldata;
+ SecurityStateRec *subj;
+ int i = 0;
+
+ subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
+
+ if (subj->haveState && subj->trustLevel == XSecurityClientTrusted)
+ return;
+
+ while (SecurityTrustedExtensions[i])
+ if (!strcmp(SecurityTrustedExtensions[i++], rec->ext->name))
+ return;
+
+ SecurityAudit("Security: denied client %d access to extension "
+ "%s on request %s\n",
+ rec->client->index, rec->ext->name,
+ SecurityLookupRequestName(rec->client));
+ rec->status = BadAccess;
+}
+
+static void
+SecurityServer(CallbackListPtr *pcbl, pointer unused, pointer calldata)
+{
+ XaceServerAccessRec *rec = calldata;
+ SecurityStateRec *subj, *obj;
+ Mask requested = rec->access_mode;
+ Mask allowed = SecurityServerMask;
+
+ subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
+ obj = dixLookupPrivate(&serverClient->devPrivates, stateKey);
+
+ if (SecurityDoCheck(subj, obj, requested, allowed) != Success) {
+ SecurityAudit("Security: denied client %d access to server "
+ "configuration request %s\n", rec->client->index,
+ SecurityLookupRequestName(rec->client));
+ rec->status = BadAccess;
+ }
+}
+
+static void
+SecurityClient(CallbackListPtr *pcbl, pointer unused, pointer calldata)
+{
+ XaceClientAccessRec *rec = calldata;
+ SecurityStateRec *subj, *obj;
+ Mask requested = rec->access_mode;
+ Mask allowed = SecurityClientMask;
+
+ subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
+ obj = dixLookupPrivate(&rec->target->devPrivates, stateKey);
+
+ if (SecurityDoCheck(subj, obj, requested, allowed) != Success) {
+ SecurityAudit("Security: denied client %d access to client %d on "
+ "request %s\n", rec->client->index, rec->target->index,
+ SecurityLookupRequestName(rec->client));
+ rec->status = BadAccess;
+ }
+}
+
+static void
+SecurityProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata)
+{
+ XacePropertyAccessRec *rec = calldata;
+ SecurityStateRec *subj, *obj;
+ ATOM name = (*rec->ppProp)->propertyName;
+ Mask requested = rec->access_mode;
+ Mask allowed = SecurityResourceMask | DixReadAccess;
+
+ subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
+ obj = dixLookupPrivate(&wClient(rec->pWin)->devPrivates, stateKey);
+
+ if (SecurityDoCheck(subj, obj, requested, allowed) != Success) {
+ SecurityAudit("Security: denied client %d access to property %s "
+ "(atom 0x%x) window 0x%x of client %d on request %s\n",
+ rec->client->index, NameForAtom(name), name,
+ rec->pWin->drawable.id, wClient(rec->pWin)->index,
+ SecurityLookupRequestName(rec->client));
+ rec->status = BadAccess;
+ }
+}
+
+static void
+SecuritySend(CallbackListPtr *pcbl, pointer unused, pointer calldata)
+{
+ XaceSendAccessRec *rec = calldata;
+ SecurityStateRec *subj, *obj;
+
+ if (rec->client) {
+ int i;
+
+ subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
+ obj = dixLookupPrivate(&wClient(rec->pWin)->devPrivates, stateKey);
+
+ if (SecurityDoCheck(subj, obj, DixSendAccess, 0) == Success)
+ return;
+
+ for (i = 0; i < rec->count; i++)
+ if (rec->events[i].u.u.type != UnmapNotify &&
+ rec->events[i].u.u.type != ConfigureRequest &&
+ rec->events[i].u.u.type != ClientMessage) {
+
+ SecurityAudit("Security: denied client %d from sending event "
+ "of type %s to window 0x%x of client %d\n",
+ rec->client->index,
+ LookupEventName(rec->events[i].u.u.type),
+ rec->pWin->drawable.id,
+ wClient(rec->pWin)->index);
+ rec->status = BadAccess;
+ return;
+ }
+ }
+}
+
+static void
+SecurityReceive(CallbackListPtr *pcbl, pointer unused, pointer calldata)
+{
+ XaceReceiveAccessRec *rec = calldata;
+ SecurityStateRec *subj, *obj;
+
+ subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
+ obj = dixLookupPrivate(&wClient(rec->pWin)->devPrivates, stateKey);
+
+ if (SecurityDoCheck(subj, obj, DixReceiveAccess, 0) == Success)
+ return;
+
+ SecurityAudit("Security: denied client %d from receiving an event "
+ "sent to window 0x%x of client %d\n",
+ rec->client->index, rec->pWin->drawable.id,
+ wClient(rec->pWin)->index);
+ rec->status = BadAccess;
+}
+
+/* SecurityClientStateCallback
+ *
+ * Arguments:
+ * pcbl is &ClientStateCallback.
+ * nullata is NULL.
+ * calldata is a pointer to a NewClientInfoRec (include/dixstruct.h)
+ * which contains information about client state changes.
+ *
+ * Returns: nothing.
+ *
+ * Side Effects:
+ *
+ * If a new client is connecting, its authorization ID is copied to
+ * client->authID. If this is a generated authorization, its reference
+ * count is bumped, its timer is cancelled if it was running, and its
+ * trustlevel is copied to TRUSTLEVEL(client).
+ *
+ * If a client is disconnecting and the client was using a generated
+ * authorization, the authorization's reference count is decremented, and
+ * if it is now zero, the timer for this authorization is started.
+ */
+
+static void
+SecurityClientState(CallbackListPtr *pcbl, pointer unused, pointer calldata)
+{
+ NewClientInfoRec *pci = calldata;
+ SecurityStateRec *state;
+ SecurityAuthorizationPtr pAuth;
+ int rc;
+
+ state = dixLookupPrivate(&pci->client->devPrivates, stateKey);
+
+ switch (pci->client->clientState) {
+ case ClientStateInitial:
+ state->trustLevel = XSecurityClientTrusted;
+ state->authId = None;
+ state->haveState = TRUE;
+ break;
+
+ case ClientStateRunning:
+ state->authId = AuthorizationIDOfClient(pci->client);
+ rc = dixLookupResourceByType((pointer *)&pAuth, state->authId,
+ SecurityAuthorizationResType, serverClient,
+ DixGetAttrAccess);
+ if (rc == Success) {
+ /* it is a generated authorization */
+ pAuth->refcnt++;
+ if (pAuth->refcnt == 1 && pAuth->timer)
+ TimerCancel(pAuth->timer);
+
+ state->trustLevel = pAuth->trustLevel;
+ }
+ break;
+
+ case ClientStateGone:
+ case ClientStateRetained:
+ rc = dixLookupResourceByType((pointer *)&pAuth, state->authId,
+ SecurityAuthorizationResType, serverClient,
+ DixGetAttrAccess);
+ if (rc == Success) {
+ /* it is a generated authorization */
+ pAuth->refcnt--;
+ if (pAuth->refcnt == 0)
+ SecurityStartAuthorizationTimer(pAuth);
+ }
+ break;
+
+ default:
+ break;
+ }
+}
+
+/* SecurityResetProc
+ *
+ * Arguments:
+ * extEntry is the extension information for the security extension.
+ *
+ * Returns: nothing.
+ *
+ * Side Effects:
+ * Performs any cleanup needed by Security at server shutdown time.
+ */
+
+static void
+SecurityResetProc(
+ ExtensionEntry *extEntry)
+{
+ /* Unregister callbacks */
+ DeleteCallback(&ClientStateCallback, SecurityClientState, NULL);
+
+ XaceDeleteCallback(XACE_EXT_DISPATCH, SecurityExtension, NULL);
+ XaceDeleteCallback(XACE_RESOURCE_ACCESS, SecurityResource, NULL);
+ XaceDeleteCallback(XACE_DEVICE_ACCESS, SecurityDevice, NULL);
+ XaceDeleteCallback(XACE_PROPERTY_ACCESS, SecurityProperty, NULL);
+ XaceDeleteCallback(XACE_SEND_ACCESS, SecuritySend, NULL);
+ XaceDeleteCallback(XACE_RECEIVE_ACCESS, SecurityReceive, NULL);
+ XaceDeleteCallback(XACE_CLIENT_ACCESS, SecurityClient, NULL);
+ XaceDeleteCallback(XACE_EXT_ACCESS, SecurityExtension, NULL);
+ XaceDeleteCallback(XACE_SERVER_ACCESS, SecurityServer, NULL);
+}
+
+
+/* SecurityExtensionInit
+ *
+ * Arguments: none.
+ *
+ * Returns: nothing.
+ *
+ * Side Effects:
+ * Enables the Security extension if possible.
+ */
+
+void
+SecurityExtensionInit(INITARGS)
+{
+ ExtensionEntry *extEntry;
+ int ret = TRUE;
+
+ SecurityAuthorizationResType =
+ CreateNewResourceType(SecurityDeleteAuthorization,
+ "SecurityAuthorization");
+
+ RTEventClient =
+ CreateNewResourceType(SecurityDeleteAuthorizationEventClient,
+ "SecurityEventClient");
+
+ if (!SecurityAuthorizationResType || !RTEventClient)
+ return;
+
+ RTEventClient |= RC_NEVERRETAIN;
+
+ /* Allocate the private storage */
+ if (!dixRegisterPrivateKey(stateKey, PRIVATE_CLIENT, sizeof(SecurityStateRec)))
+ FatalError("SecurityExtensionSetup: Can't allocate client private.\n");
+
+ /* Register callbacks */
+ ret &= AddCallback(&ClientStateCallback, SecurityClientState, NULL);
+
+ ret &= XaceRegisterCallback(XACE_EXT_DISPATCH, SecurityExtension, NULL);
+ ret &= XaceRegisterCallback(XACE_RESOURCE_ACCESS, SecurityResource, NULL);
+ ret &= XaceRegisterCallback(XACE_DEVICE_ACCESS, SecurityDevice, NULL);
+ ret &= XaceRegisterCallback(XACE_PROPERTY_ACCESS, SecurityProperty, NULL);
+ ret &= XaceRegisterCallback(XACE_SEND_ACCESS, SecuritySend, NULL);
+ ret &= XaceRegisterCallback(XACE_RECEIVE_ACCESS, SecurityReceive, NULL);
+ ret &= XaceRegisterCallback(XACE_CLIENT_ACCESS, SecurityClient, NULL);
+ ret &= XaceRegisterCallback(XACE_EXT_ACCESS, SecurityExtension, NULL);
+ ret &= XaceRegisterCallback(XACE_SERVER_ACCESS, SecurityServer, NULL);
+
+ if (!ret)
+ FatalError("SecurityExtensionSetup: Failed to register callbacks\n");
+
+ /* Add extension to server */
+ extEntry = AddExtension(SECURITY_EXTENSION_NAME,
+ XSecurityNumberEvents, XSecurityNumberErrors,
+ ProcSecurityDispatch, SProcSecurityDispatch,
+ SecurityResetProc, StandardMinorOpcode);
+
+ SecurityErrorBase = extEntry->errorBase;
+ SecurityEventBase = extEntry->eventBase;
+
+ EventSwapVector[SecurityEventBase + XSecurityAuthorizationRevoked] =
+ (EventSwapPtr)SwapSecurityAuthorizationRevokedEvent;
+
+ SetResourceTypeErrorValue(SecurityAuthorizationResType, SecurityErrorBase + XSecurityBadAuthorization);
+
+ /* Label objects that were created before we could register ourself */
+ SecurityLabelInitial();
+}
diff --git a/xorg-server/Xext/shape.c b/xorg-server/Xext/shape.c
index 6a35a0451..3263c0224 100644
--- a/xorg-server/Xext/shape.c
+++ b/xorg-server/Xext/shape.c
@@ -1,1262 +1,1246 @@
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-********************************************************/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#else
-#define SHAPE
-#endif
-
-#include <stdlib.h>
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "misc.h"
-#include "os.h"
-#include "windowstr.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "resource.h"
-#include "opaque.h"
-#include <X11/extensions/shapeproto.h>
-#include "regionstr.h"
-#include "gcstruct.h"
-#include "modinit.h"
-#include "protocol-versions.h"
-
-typedef RegionPtr (*CreateDftPtr)(
- WindowPtr /* pWin */
- );
-
-static int ShapeFreeClient(
- pointer /* data */,
- XID /* id */
- );
-static int ShapeFreeEvents(
- pointer /* data */,
- XID /* id */
- );
-static void SShapeNotifyEvent(
- xShapeNotifyEvent * /* from */,
- xShapeNotifyEvent * /* to */
- );
-
-/* SendShapeNotify, CreateBoundingShape and CreateClipShape are used
- * externally by the Xfixes extension and are now defined in window.h
- */
-
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-#include "panoramiXsrv.h"
-#endif
-
-static int ShapeEventBase = 0;
-static RESTYPE ClientType, ShapeEventType; /* resource types for event masks */
-
-/*
- * each window has a list of clients requesting
- * ShapeNotify events. Each client has a resource
- * for each window it selects ShapeNotify input for,
- * this resource is used to delete the ShapeNotifyRec
- * entry from the per-window queue.
- */
-
-typedef struct _ShapeEvent *ShapeEventPtr;
-
-typedef struct _ShapeEvent {
- ShapeEventPtr next;
- ClientPtr client;
- WindowPtr window;
- XID clientResource;
-} ShapeEventRec;
-
-/****************
- * ShapeExtensionInit
- *
- * Called from InitExtensions in main() or from QueryExtension() if the
- * extension is dynamically loaded.
- *
- ****************/
-
-static int
-RegionOperate (
- ClientPtr client,
- WindowPtr pWin,
- int kind,
- RegionPtr *destRgnp,
- RegionPtr srcRgn,
- int op,
- int xoff, int yoff,
- CreateDftPtr create)
-{
- if (srcRgn && (xoff || yoff))
- RegionTranslate(srcRgn, xoff, yoff);
- if (!pWin->parent)
- {
- if (srcRgn)
- RegionDestroy(srcRgn);
- return Success;
- }
-
- /* May/30/2001:
- * The shape.PS specs say if src is None, existing shape is to be
- * removed (and so the op-code has no meaning in such removal);
- * see shape.PS, page 3, ShapeMask.
- */
- if (srcRgn == NULL) {
- if (*destRgnp != NULL) {
- RegionDestroy(*destRgnp);
- *destRgnp = 0;
- /* go on to remove shape and generate ShapeNotify */
- }
- else {
- /* May/30/2001:
- * The target currently has no shape in effect, so nothing to
- * do here. The specs say that ShapeNotify is generated whenever
- * the client region is "modified"; since no modification is done
- * here, we do not generate that event. The specs does not say
- * "it is an error to request removal when there is no shape in
- * effect", so we return good status.
- */
- return Success;
- }
- }
- else switch (op) {
- case ShapeSet:
- if (*destRgnp)
- RegionDestroy(*destRgnp);
- *destRgnp = srcRgn;
- srcRgn = 0;
- break;
- case ShapeUnion:
- if (*destRgnp)
- RegionUnion(*destRgnp, *destRgnp, srcRgn);
- break;
- case ShapeIntersect:
- if (*destRgnp)
- RegionIntersect(*destRgnp, *destRgnp, srcRgn);
- else {
- *destRgnp = srcRgn;
- srcRgn = 0;
- }
- break;
- case ShapeSubtract:
- if (!*destRgnp)
- *destRgnp = (*create)(pWin);
- RegionSubtract(*destRgnp, *destRgnp, srcRgn);
- break;
- case ShapeInvert:
- if (!*destRgnp)
- *destRgnp = RegionCreate((BoxPtr) 0, 0);
- else
- RegionSubtract(*destRgnp, srcRgn, *destRgnp);
- break;
- default:
- client->errorValue = op;
- return BadValue;
- }
- if (srcRgn)
- RegionDestroy(srcRgn);
- (*pWin->drawable.pScreen->SetShape) (pWin, kind);
- SendShapeNotify (pWin, kind);
- return Success;
-}
-
-RegionPtr
-CreateBoundingShape (WindowPtr pWin)
-{
- BoxRec extents;
-
- extents.x1 = -wBorderWidth (pWin);
- extents.y1 = -wBorderWidth (pWin);
- extents.x2 = pWin->drawable.width + wBorderWidth (pWin);
- extents.y2 = pWin->drawable.height + wBorderWidth (pWin);
- return RegionCreate(&extents, 1);
-}
-
-RegionPtr
-CreateClipShape (WindowPtr pWin)
-{
- BoxRec extents;
-
- extents.x1 = 0;
- extents.y1 = 0;
- extents.x2 = pWin->drawable.width;
- extents.y2 = pWin->drawable.height;
- return RegionCreate(&extents, 1);
-}
-
-static int
-ProcShapeQueryVersion (ClientPtr client)
-{
- xShapeQueryVersionReply rep;
- int n;
-
- REQUEST_SIZE_MATCH (xShapeQueryVersionReq);
- memset(&rep, 0, sizeof(xShapeQueryVersionReply));
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = SERVER_SHAPE_MAJOR_VERSION;
- rep.minorVersion = SERVER_SHAPE_MINOR_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof (xShapeQueryVersionReply), (char *)&rep);
- return Success;
-}
-
-/*****************
- * ProcShapeRectangles
- *
- *****************/
-
-static int
-ProcShapeRectangles (ClientPtr client)
-{
- WindowPtr pWin;
- REQUEST(xShapeRectanglesReq);
- xRectangle *prects;
- int nrects, ctype, rc;
- RegionPtr srcRgn;
- RegionPtr *destRgn;
- CreateDftPtr createDefault;
-
- REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
- UpdateCurrentTime();
- rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess);
- if (rc != Success)
- return rc;
- switch (stuff->destKind) {
- case ShapeBounding:
- createDefault = CreateBoundingShape;
- break;
- case ShapeClip:
- createDefault = CreateClipShape;
- break;
- case ShapeInput:
- createDefault = CreateBoundingShape;
- break;
- default:
- client->errorValue = stuff->destKind;
- return BadValue;
- }
- if ((stuff->ordering != Unsorted) && (stuff->ordering != YSorted) &&
- (stuff->ordering != YXSorted) && (stuff->ordering != YXBanded))
- {
- client->errorValue = stuff->ordering;
- return BadValue;
- }
- nrects = ((stuff->length << 2) - sizeof(xShapeRectanglesReq));
- if (nrects & 4)
- return BadLength;
- nrects >>= 3;
- prects = (xRectangle *) &stuff[1];
- ctype = VerifyRectOrder(nrects, prects, (int)stuff->ordering);
- if (ctype < 0)
- return BadMatch;
- srcRgn = RegionFromRects(nrects, prects, ctype);
-
- if (!pWin->optional)
- MakeWindowOptional (pWin);
- switch (stuff->destKind) {
- case ShapeBounding:
- destRgn = &pWin->optional->boundingShape;
- break;
- case ShapeClip:
- destRgn = &pWin->optional->clipShape;
- break;
- case ShapeInput:
- destRgn = &pWin->optional->inputShape;
- break;
- default:
- return BadValue;
- }
-
- return RegionOperate (client, pWin, (int)stuff->destKind,
- destRgn, srcRgn, (int)stuff->op,
- stuff->xOff, stuff->yOff, createDefault);
-}
-
-#ifdef PANORAMIX
-static int
-ProcPanoramiXShapeRectangles(
- ClientPtr client)
-{
- REQUEST(xShapeRectanglesReq);
- PanoramiXRes *win;
- int j, result;
-
- REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
-
- result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW,
- client, DixWriteAccess);
- if (result != Success)
- return result;
-
- FOR_NSCREENS(j) {
- stuff->dest = win->info[j].id;
- result = ProcShapeRectangles (client);
- if (result != Success) break;
- }
- return result;
-}
-#endif
-
-
-/**************
- * ProcShapeMask
- **************/
-
-
-static int
-ProcShapeMask (ClientPtr client)
-{
- WindowPtr pWin;
- ScreenPtr pScreen;
- REQUEST(xShapeMaskReq);
- RegionPtr srcRgn;
- RegionPtr *destRgn;
- PixmapPtr pPixmap;
- CreateDftPtr createDefault;
- int rc;
-
- REQUEST_SIZE_MATCH (xShapeMaskReq);
- UpdateCurrentTime();
- rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess);
- if (rc != Success)
- return rc;
- switch (stuff->destKind) {
- case ShapeBounding:
- createDefault = CreateBoundingShape;
- break;
- case ShapeClip:
- createDefault = CreateClipShape;
- break;
- case ShapeInput:
- createDefault = CreateBoundingShape;
- break;
- default:
- client->errorValue = stuff->destKind;
- return BadValue;
- }
- pScreen = pWin->drawable.pScreen;
- if (stuff->src == None)
- srcRgn = 0;
- else {
- rc = dixLookupResourceByType((pointer *)&pPixmap, stuff->src, RT_PIXMAP,
- client, DixReadAccess);
- if (rc != Success)
- return rc;
- if (pPixmap->drawable.pScreen != pScreen ||
- pPixmap->drawable.depth != 1)
- return BadMatch;
- srcRgn = BitmapToRegion(pScreen, pPixmap);
- if (!srcRgn)
- return BadAlloc;
- }
-
- if (!pWin->optional)
- MakeWindowOptional (pWin);
- switch (stuff->destKind) {
- case ShapeBounding:
- destRgn = &pWin->optional->boundingShape;
- break;
- case ShapeClip:
- destRgn = &pWin->optional->clipShape;
- break;
- case ShapeInput:
- destRgn = &pWin->optional->inputShape;
- break;
- default:
- return BadValue;
- }
-
- return RegionOperate (client, pWin, (int)stuff->destKind,
- destRgn, srcRgn, (int)stuff->op,
- stuff->xOff, stuff->yOff, createDefault);
-}
-
-#ifdef PANORAMIX
-static int
-ProcPanoramiXShapeMask(
- ClientPtr client)
-{
- REQUEST(xShapeMaskReq);
- PanoramiXRes *win, *pmap;
- int j, result;
-
- REQUEST_SIZE_MATCH (xShapeMaskReq);
-
- result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW,
- client, DixWriteAccess);
- if (result != Success)
- return result;
-
- if(stuff->src != None) {
- result = dixLookupResourceByType((pointer *)&pmap, stuff->src,
- XRT_PIXMAP, client, DixReadAccess);
- if (result != Success)
- return result;
- } else
- pmap = NULL;
-
- FOR_NSCREENS(j) {
- stuff->dest = win->info[j].id;
- if(pmap)
- stuff->src = pmap->info[j].id;
- result = ProcShapeMask (client);
- if (result != Success) break;
- }
- return result;
-}
-#endif
-
-
-/************
- * ProcShapeCombine
- ************/
-
-static int
-ProcShapeCombine (ClientPtr client)
-{
- WindowPtr pSrcWin, pDestWin;
- REQUEST(xShapeCombineReq);
- RegionPtr srcRgn;
- RegionPtr *destRgn;
- CreateDftPtr createDefault;
- CreateDftPtr createSrc;
- RegionPtr tmp;
- int rc;
-
- REQUEST_SIZE_MATCH (xShapeCombineReq);
- UpdateCurrentTime();
- rc = dixLookupWindow(&pDestWin, stuff->dest, client, DixSetAttrAccess);
- if (rc != Success)
- return rc;
- if (!pDestWin->optional)
- MakeWindowOptional (pDestWin);
- switch (stuff->destKind) {
- case ShapeBounding:
- createDefault = CreateBoundingShape;
- break;
- case ShapeClip:
- createDefault = CreateClipShape;
- break;
- case ShapeInput:
- createDefault = CreateBoundingShape;
- break;
- default:
- client->errorValue = stuff->destKind;
- return BadValue;
- }
-
- rc = dixLookupWindow(&pSrcWin, stuff->src, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
- switch (stuff->srcKind) {
- case ShapeBounding:
- srcRgn = wBoundingShape (pSrcWin);
- createSrc = CreateBoundingShape;
- break;
- case ShapeClip:
- srcRgn = wClipShape (pSrcWin);
- createSrc = CreateClipShape;
- break;
- case ShapeInput:
- srcRgn = wInputShape (pSrcWin);
- createSrc = CreateBoundingShape;
- break;
- default:
- client->errorValue = stuff->srcKind;
- return BadValue;
- }
- if (pSrcWin->drawable.pScreen != pDestWin->drawable.pScreen)
- {
- return BadMatch;
- }
-
- if (srcRgn) {
- tmp = RegionCreate((BoxPtr) 0, 0);
- RegionCopy(tmp, srcRgn);
- srcRgn = tmp;
- } else
- srcRgn = (*createSrc) (pSrcWin);
-
- if (!pDestWin->optional)
- MakeWindowOptional (pDestWin);
- switch (stuff->destKind) {
- case ShapeBounding:
- destRgn = &pDestWin->optional->boundingShape;
- break;
- case ShapeClip:
- destRgn = &pDestWin->optional->clipShape;
- break;
- case ShapeInput:
- destRgn = &pDestWin->optional->inputShape;
- break;
- default:
- return BadValue;
- }
-
- return RegionOperate (client, pDestWin, (int)stuff->destKind,
- destRgn, srcRgn, (int)stuff->op,
- stuff->xOff, stuff->yOff, createDefault);
-}
-
-
-#ifdef PANORAMIX
-static int
-ProcPanoramiXShapeCombine(
- ClientPtr client)
-{
- REQUEST(xShapeCombineReq);
- PanoramiXRes *win, *win2;
- int j, result;
-
- REQUEST_AT_LEAST_SIZE (xShapeCombineReq);
-
- result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW,
- client, DixWriteAccess);
- if (result != Success)
- return result;
-
- result = dixLookupResourceByType((pointer *)&win2, stuff->src, XRT_WINDOW,
- client, DixReadAccess);
- if (result != Success)
- return result;
-
- FOR_NSCREENS(j) {
- stuff->dest = win->info[j].id;
- stuff->src = win2->info[j].id;
- result = ProcShapeCombine (client);
- if (result != Success) break;
- }
- return result;
-}
-#endif
-
-/*************
- * ProcShapeOffset
- *************/
-
-static int
-ProcShapeOffset (ClientPtr client)
-{
- WindowPtr pWin;
- REQUEST(xShapeOffsetReq);
- RegionPtr srcRgn;
- int rc;
-
- REQUEST_SIZE_MATCH (xShapeOffsetReq);
- UpdateCurrentTime();
- rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess);
- if (rc != Success)
- return rc;
- switch (stuff->destKind) {
- case ShapeBounding:
- srcRgn = wBoundingShape (pWin);
- break;
- case ShapeClip:
- srcRgn = wClipShape(pWin);
- break;
- case ShapeInput:
- srcRgn = wInputShape (pWin);
- break;
- default:
- client->errorValue = stuff->destKind;
- return BadValue;
- }
- if (srcRgn)
- {
- RegionTranslate(srcRgn, stuff->xOff, stuff->yOff);
- (*pWin->drawable.pScreen->SetShape) (pWin, stuff->destKind);
- }
- SendShapeNotify (pWin, (int)stuff->destKind);
- return Success;
-}
-
-
-#ifdef PANORAMIX
-static int
-ProcPanoramiXShapeOffset(
- ClientPtr client)
-{
- REQUEST(xShapeOffsetReq);
- PanoramiXRes *win;
- int j, result;
-
- REQUEST_AT_LEAST_SIZE (xShapeOffsetReq);
-
- result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW,
- client, DixWriteAccess);
- if (result != Success)
- return result;
-
- FOR_NSCREENS(j) {
- stuff->dest = win->info[j].id;
- result = ProcShapeOffset (client);
- if(result != Success) break;
- }
- return result;
-}
-#endif
-
-
-static int
-ProcShapeQueryExtents (ClientPtr client)
-{
- REQUEST(xShapeQueryExtentsReq);
- WindowPtr pWin;
- xShapeQueryExtentsReply rep;
- BoxRec extents, *pExtents;
- int n, rc;
- RegionPtr region;
-
- REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
- memset(&rep, 0, sizeof(xShapeQueryExtentsReply));
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.boundingShaped = (wBoundingShape(pWin) != 0);
- rep.clipShaped = (wClipShape(pWin) != 0);
- if ((region = wBoundingShape(pWin))) {
- /* this is done in two steps because of a compiler bug on SunOS 4.1.3 */
- pExtents = RegionExtents(region);
- extents = *pExtents;
- } else {
- extents.x1 = -wBorderWidth (pWin);
- extents.y1 = -wBorderWidth (pWin);
- extents.x2 = pWin->drawable.width + wBorderWidth (pWin);
- extents.y2 = pWin->drawable.height + wBorderWidth (pWin);
- }
- rep.xBoundingShape = extents.x1;
- rep.yBoundingShape = extents.y1;
- rep.widthBoundingShape = extents.x2 - extents.x1;
- rep.heightBoundingShape = extents.y2 - extents.y1;
- if ((region = wClipShape(pWin))) {
- /* this is done in two steps because of a compiler bug on SunOS 4.1.3 */
- pExtents = RegionExtents(region);
- extents = *pExtents;
- } else {
- extents.x1 = 0;
- extents.y1 = 0;
- extents.x2 = pWin->drawable.width;
- extents.y2 = pWin->drawable.height;
- }
- rep.xClipShape = extents.x1;
- rep.yClipShape = extents.y1;
- rep.widthClipShape = extents.x2 - extents.x1;
- rep.heightClipShape = extents.y2 - extents.y1;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.xBoundingShape, n);
- swaps(&rep.yBoundingShape, n);
- swaps(&rep.widthBoundingShape, n);
- swaps(&rep.heightBoundingShape, n);
- swaps(&rep.xClipShape, n);
- swaps(&rep.yClipShape, n);
- swaps(&rep.widthClipShape, n);
- swaps(&rep.heightClipShape, n);
- }
- WriteToClient(client, sizeof (xShapeQueryExtentsReply), (char *)&rep);
- return Success;
-}
-
-/*ARGSUSED*/
-static int
-ShapeFreeClient (pointer data, XID id)
-{
- ShapeEventPtr pShapeEvent;
- WindowPtr pWin;
- ShapeEventPtr *pHead, pCur, pPrev;
- int rc;
-
- pShapeEvent = (ShapeEventPtr) data;
- pWin = pShapeEvent->window;
- rc = dixLookupResourceByType((pointer *)&pHead, pWin->drawable.id,
- ShapeEventType, serverClient, DixReadAccess);
- if (rc == Success) {
- pPrev = 0;
- for (pCur = *pHead; pCur && pCur != pShapeEvent; pCur=pCur->next)
- pPrev = pCur;
- if (pCur)
- {
- if (pPrev)
- pPrev->next = pShapeEvent->next;
- else
- *pHead = pShapeEvent->next;
- }
- }
- free((pointer) pShapeEvent);
- return 1;
-}
-
-/*ARGSUSED*/
-static int
-ShapeFreeEvents (pointer data, XID id)
-{
- ShapeEventPtr *pHead, pCur, pNext;
-
- pHead = (ShapeEventPtr *) data;
- for (pCur = *pHead; pCur; pCur = pNext) {
- pNext = pCur->next;
- FreeResource (pCur->clientResource, ClientType);
- free((pointer) pCur);
- }
- free((pointer) pHead);
- return 1;
-}
-
-static int
-ProcShapeSelectInput (ClientPtr client)
-{
- REQUEST(xShapeSelectInputReq);
- WindowPtr pWin;
- ShapeEventPtr pShapeEvent, pNewShapeEvent, *pHead;
- XID clientResource;
- int rc;
-
- REQUEST_SIZE_MATCH (xShapeSelectInputReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
- if (rc != Success)
- return rc;
- rc = dixLookupResourceByType((pointer *)&pHead, pWin->drawable.id,
- ShapeEventType, client, DixWriteAccess);
- if (rc != Success && rc != BadValue)
- return rc;
-
- switch (stuff->enable) {
- case xTrue:
- if (pHead) {
-
- /* check for existing entry. */
- for (pShapeEvent = *pHead;
- pShapeEvent;
- pShapeEvent = pShapeEvent->next)
- {
- if (pShapeEvent->client == client)
- return Success;
- }
- }
-
- /* build the entry */
- pNewShapeEvent = malloc(sizeof (ShapeEventRec));
- if (!pNewShapeEvent)
- return BadAlloc;
- pNewShapeEvent->next = 0;
- pNewShapeEvent->client = client;
- pNewShapeEvent->window = pWin;
- /*
- * add a resource that will be deleted when
- * the client goes away
- */
- clientResource = FakeClientID (client->index);
- pNewShapeEvent->clientResource = clientResource;
- if (!AddResource (clientResource, ClientType, (pointer)pNewShapeEvent))
- return BadAlloc;
- /*
- * create a resource to contain a pointer to the list
- * of clients selecting input. This must be indirect as
- * the list may be arbitrarily rearranged which cannot be
- * done through the resource database.
- */
- if (!pHead)
- {
- pHead = malloc(sizeof (ShapeEventPtr));
- if (!pHead ||
- !AddResource (pWin->drawable.id, ShapeEventType, (pointer)pHead))
- {
- FreeResource (clientResource, RT_NONE);
- return BadAlloc;
- }
- *pHead = 0;
- }
- pNewShapeEvent->next = *pHead;
- *pHead = pNewShapeEvent;
- break;
- case xFalse:
- /* delete the interest */
- if (pHead) {
- pNewShapeEvent = 0;
- for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) {
- if (pShapeEvent->client == client)
- break;
- pNewShapeEvent = pShapeEvent;
- }
- if (pShapeEvent) {
- FreeResource (pShapeEvent->clientResource, ClientType);
- if (pNewShapeEvent)
- pNewShapeEvent->next = pShapeEvent->next;
- else
- *pHead = pShapeEvent->next;
- free(pShapeEvent);
- }
- }
- break;
- default:
- client->errorValue = stuff->enable;
- return BadValue;
- }
- return Success;
-}
-
-/*
- * deliver the event
- */
-
-void
-SendShapeNotify (WindowPtr pWin, int which)
-{
- ShapeEventPtr *pHead, pShapeEvent;
- xShapeNotifyEvent se;
- BoxRec extents;
- RegionPtr region;
- BYTE shaped;
- int rc;
-
- rc = dixLookupResourceByType((pointer *)&pHead, pWin->drawable.id,
- ShapeEventType, serverClient, DixReadAccess);
- if (rc != Success)
- return;
- switch (which) {
- case ShapeBounding:
- region = wBoundingShape(pWin);
- if (region) {
- extents = *RegionExtents(region);
- shaped = xTrue;
- } else {
- extents.x1 = -wBorderWidth (pWin);
- extents.y1 = -wBorderWidth (pWin);
- extents.x2 = pWin->drawable.width + wBorderWidth (pWin);
- extents.y2 = pWin->drawable.height + wBorderWidth (pWin);
- shaped = xFalse;
- }
- break;
- case ShapeClip:
- region = wClipShape(pWin);
- if (region) {
- extents = *RegionExtents(region);
- shaped = xTrue;
- } else {
- extents.x1 = 0;
- extents.y1 = 0;
- extents.x2 = pWin->drawable.width;
- extents.y2 = pWin->drawable.height;
- shaped = xFalse;
- }
- break;
- case ShapeInput:
- region = wInputShape(pWin);
- if (region) {
- extents = *RegionExtents(region);
- shaped = xTrue;
- } else {
- extents.x1 = -wBorderWidth (pWin);
- extents.y1 = -wBorderWidth (pWin);
- extents.x2 = pWin->drawable.width + wBorderWidth (pWin);
- extents.y2 = pWin->drawable.height + wBorderWidth (pWin);
- shaped = xFalse;
- }
- break;
- default:
- return;
- }
- for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) {
- se.type = ShapeNotify + ShapeEventBase;
- se.kind = which;
- se.window = pWin->drawable.id;
- se.x = extents.x1;
- se.y = extents.y1;
- se.width = extents.x2 - extents.x1;
- se.height = extents.y2 - extents.y1;
- se.time = currentTime.milliseconds;
- se.shaped = shaped;
- WriteEventsToClient (pShapeEvent->client, 1, (xEvent *) &se);
- }
-}
-
-static int
-ProcShapeInputSelected (ClientPtr client)
-{
- REQUEST(xShapeInputSelectedReq);
- WindowPtr pWin;
- ShapeEventPtr pShapeEvent, *pHead;
- int enabled, rc;
- xShapeInputSelectedReply rep;
- int n;
-
- REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
- rc = dixLookupResourceByType((pointer *)&pHead, pWin->drawable.id,
- ShapeEventType, client, DixReadAccess);
- if (rc != Success && rc != BadValue)
- return rc;
- enabled = xFalse;
- if (pHead) {
- for (pShapeEvent = *pHead;
- pShapeEvent;
- pShapeEvent = pShapeEvent->next)
- {
- if (pShapeEvent->client == client) {
- enabled = xTrue;
- break;
- }
- }
- }
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.enabled = enabled;
- if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- }
- WriteToClient (client, sizeof (xShapeInputSelectedReply), (char *) &rep);
- return Success;
-}
-
-static int
-ProcShapeGetRectangles (ClientPtr client)
-{
- REQUEST(xShapeGetRectanglesReq);
- WindowPtr pWin;
- xShapeGetRectanglesReply rep;
- xRectangle *rects;
- int nrects, i, rc;
- RegionPtr region;
- int n;
-
- REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
- switch (stuff->kind) {
- case ShapeBounding:
- region = wBoundingShape(pWin);
- break;
- case ShapeClip:
- region = wClipShape(pWin);
- break;
- case ShapeInput:
- region = wInputShape (pWin);
- break;
- default:
- client->errorValue = stuff->kind;
- return BadValue;
- }
- if (!region) {
- nrects = 1;
- rects = malloc(sizeof (xRectangle));
- if (!rects)
- return BadAlloc;
- switch (stuff->kind) {
- case ShapeBounding:
- rects->x = - (int) wBorderWidth (pWin);
- rects->y = - (int) wBorderWidth (pWin);
- rects->width = pWin->drawable.width + wBorderWidth (pWin);
- rects->height = pWin->drawable.height + wBorderWidth (pWin);
- break;
- case ShapeClip:
- rects->x = 0;
- rects->y = 0;
- rects->width = pWin->drawable.width;
- rects->height = pWin->drawable.height;
- break;
- case ShapeInput:
- rects->x = - (int) wBorderWidth (pWin);
- rects->y = - (int) wBorderWidth (pWin);
- rects->width = pWin->drawable.width + wBorderWidth (pWin);
- rects->height = pWin->drawable.height + wBorderWidth (pWin);
- break;
- }
- } else {
- BoxPtr box;
- nrects = RegionNumRects(region);
- box = RegionRects(region);
- rects = malloc(nrects * sizeof (xRectangle));
- if (!rects && nrects)
- return BadAlloc;
- for (i = 0; i < nrects; i++, box++) {
- rects[i].x = box->x1;
- rects[i].y = box->y1;
- rects[i].width = box->x2 - box->x1;
- rects[i].height = box->y2 - box->y1;
- }
- }
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = bytes_to_int32(nrects * sizeof (xRectangle));
- rep.ordering = YXBanded;
- rep.nrects = nrects;
- if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.nrects, n);
- SwapShorts ((short *)rects, (unsigned long)nrects * 4);
- }
- WriteToClient (client, sizeof (rep), (char *) &rep);
- WriteToClient (client, nrects * sizeof (xRectangle), (char *) rects);
- free(rects);
- return Success;
-}
-
-static int
-ProcShapeDispatch (ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data) {
- case X_ShapeQueryVersion:
- return ProcShapeQueryVersion (client);
- case X_ShapeRectangles:
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension )
- return ProcPanoramiXShapeRectangles (client);
- else
-#endif
- return ProcShapeRectangles (client);
- case X_ShapeMask:
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension )
- return ProcPanoramiXShapeMask (client);
- else
-#endif
- return ProcShapeMask (client);
- case X_ShapeCombine:
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension )
- return ProcPanoramiXShapeCombine (client);
- else
-#endif
- return ProcShapeCombine (client);
- case X_ShapeOffset:
-#ifdef PANORAMIX
- if ( !noPanoramiXExtension )
- return ProcPanoramiXShapeOffset (client);
- else
-#endif
- return ProcShapeOffset (client);
- case X_ShapeQueryExtents:
- return ProcShapeQueryExtents (client);
- case X_ShapeSelectInput:
- return ProcShapeSelectInput (client);
- case X_ShapeInputSelected:
- return ProcShapeInputSelected (client);
- case X_ShapeGetRectangles:
- return ProcShapeGetRectangles (client);
- default:
- return BadRequest;
- }
-}
-
-static void
-SShapeNotifyEvent(xShapeNotifyEvent *from, xShapeNotifyEvent *to)
-{
- to->type = from->type;
- to->kind = from->kind;
- cpswapl (from->window, to->window);
- cpswaps (from->sequenceNumber, to->sequenceNumber);
- cpswaps (from->x, to->x);
- cpswaps (from->y, to->y);
- cpswaps (from->width, to->width);
- cpswaps (from->height, to->height);
- cpswapl (from->time, to->time);
- to->shaped = from->shaped;
-}
-
-static int
-SProcShapeQueryVersion (ClientPtr client)
-{
- int n;
- REQUEST (xShapeQueryVersionReq);
-
- swaps (&stuff->length, n);
- return ProcShapeQueryVersion (client);
-}
-
-static int
-SProcShapeRectangles (ClientPtr client)
-{
- char n;
- REQUEST (xShapeRectanglesReq);
-
- swaps (&stuff->length, n);
- REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
- swapl (&stuff->dest, n);
- swaps (&stuff->xOff, n);
- swaps (&stuff->yOff, n);
- SwapRestS(stuff);
- return ProcShapeRectangles (client);
-}
-
-static int
-SProcShapeMask (ClientPtr client)
-{
- char n;
- REQUEST (xShapeMaskReq);
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xShapeMaskReq);
- swapl (&stuff->dest, n);
- swaps (&stuff->xOff, n);
- swaps (&stuff->yOff, n);
- swapl (&stuff->src, n);
- return ProcShapeMask (client);
-}
-
-static int
-SProcShapeCombine (ClientPtr client)
-{
- char n;
- REQUEST (xShapeCombineReq);
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xShapeCombineReq);
- swapl (&stuff->dest, n);
- swaps (&stuff->xOff, n);
- swaps (&stuff->yOff, n);
- swapl (&stuff->src, n);
- return ProcShapeCombine (client);
-}
-
-static int
-SProcShapeOffset (ClientPtr client)
-{
- char n;
- REQUEST (xShapeOffsetReq);
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xShapeOffsetReq);
- swapl (&stuff->dest, n);
- swaps (&stuff->xOff, n);
- swaps (&stuff->yOff, n);
- return ProcShapeOffset (client);
-}
-
-static int
-SProcShapeQueryExtents (ClientPtr client)
-{
- char n;
- REQUEST (xShapeQueryExtentsReq);
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
- swapl (&stuff->window, n);
- return ProcShapeQueryExtents (client);
-}
-
-static int
-SProcShapeSelectInput (ClientPtr client)
-{
- char n;
- REQUEST (xShapeSelectInputReq);
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xShapeSelectInputReq);
- swapl (&stuff->window, n);
- return ProcShapeSelectInput (client);
-}
-
-static int
-SProcShapeInputSelected (ClientPtr client)
-{
- int n;
- REQUEST (xShapeInputSelectedReq);
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
- swapl (&stuff->window, n);
- return ProcShapeInputSelected (client);
-}
-
-static int
-SProcShapeGetRectangles (ClientPtr client)
-{
- REQUEST(xShapeGetRectanglesReq);
- char n;
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
- swapl (&stuff->window, n);
- return ProcShapeGetRectangles (client);
-}
-
-static int
-SProcShapeDispatch (ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data) {
- case X_ShapeQueryVersion:
- return SProcShapeQueryVersion (client);
- case X_ShapeRectangles:
- return SProcShapeRectangles (client);
- case X_ShapeMask:
- return SProcShapeMask (client);
- case X_ShapeCombine:
- return SProcShapeCombine (client);
- case X_ShapeOffset:
- return SProcShapeOffset (client);
- case X_ShapeQueryExtents:
- return SProcShapeQueryExtents (client);
- case X_ShapeSelectInput:
- return SProcShapeSelectInput (client);
- case X_ShapeInputSelected:
- return SProcShapeInputSelected (client);
- case X_ShapeGetRectangles:
- return SProcShapeGetRectangles (client);
- default:
- return BadRequest;
- }
-}
-
-void
-ShapeExtensionInit(void)
-{
- ExtensionEntry *extEntry;
-
- ClientType = CreateNewResourceType(ShapeFreeClient, "ShapeClient");
- ShapeEventType = CreateNewResourceType(ShapeFreeEvents, "ShapeEvent");
- if (ClientType && ShapeEventType &&
- (extEntry = AddExtension(SHAPENAME, ShapeNumberEvents, 0,
- ProcShapeDispatch, SProcShapeDispatch,
- NULL, StandardMinorOpcode)))
- {
- ShapeEventBase = extEntry->eventBase;
- EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent;
- }
-}
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+********************************************************/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#else
+#define SHAPE
+#endif
+
+#include <stdlib.h>
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "os.h"
+#include "windowstr.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "extnsionst.h"
+#include "dixstruct.h"
+#include "resource.h"
+#include "opaque.h"
+#include <X11/extensions/shapeproto.h>
+#include "regionstr.h"
+#include "gcstruct.h"
+#include "modinit.h"
+#include "protocol-versions.h"
+
+typedef RegionPtr (*CreateDftPtr)(
+ WindowPtr /* pWin */
+ );
+
+static int ShapeFreeClient(
+ pointer /* data */,
+ XID /* id */
+ );
+static int ShapeFreeEvents(
+ pointer /* data */,
+ XID /* id */
+ );
+static void SShapeNotifyEvent(
+ xShapeNotifyEvent * /* from */,
+ xShapeNotifyEvent * /* to */
+ );
+
+/* SendShapeNotify, CreateBoundingShape and CreateClipShape are used
+ * externally by the Xfixes extension and are now defined in window.h
+ */
+
+
+#ifdef PANORAMIX
+#include "panoramiX.h"
+#include "panoramiXsrv.h"
+#endif
+
+static int ShapeEventBase = 0;
+static RESTYPE ClientType, ShapeEventType; /* resource types for event masks */
+
+/*
+ * each window has a list of clients requesting
+ * ShapeNotify events. Each client has a resource
+ * for each window it selects ShapeNotify input for,
+ * this resource is used to delete the ShapeNotifyRec
+ * entry from the per-window queue.
+ */
+
+typedef struct _ShapeEvent *ShapeEventPtr;
+
+typedef struct _ShapeEvent {
+ ShapeEventPtr next;
+ ClientPtr client;
+ WindowPtr window;
+ XID clientResource;
+} ShapeEventRec;
+
+/****************
+ * ShapeExtensionInit
+ *
+ * Called from InitExtensions in main() or from QueryExtension() if the
+ * extension is dynamically loaded.
+ *
+ ****************/
+
+static int
+RegionOperate (
+ ClientPtr client,
+ WindowPtr pWin,
+ int kind,
+ RegionPtr *destRgnp,
+ RegionPtr srcRgn,
+ int op,
+ int xoff, int yoff,
+ CreateDftPtr create)
+{
+ if (srcRgn && (xoff || yoff))
+ RegionTranslate(srcRgn, xoff, yoff);
+ if (!pWin->parent)
+ {
+ if (srcRgn)
+ RegionDestroy(srcRgn);
+ return Success;
+ }
+
+ /* May/30/2001:
+ * The shape.PS specs say if src is None, existing shape is to be
+ * removed (and so the op-code has no meaning in such removal);
+ * see shape.PS, page 3, ShapeMask.
+ */
+ if (srcRgn == NULL) {
+ if (*destRgnp != NULL) {
+ RegionDestroy(*destRgnp);
+ *destRgnp = 0;
+ /* go on to remove shape and generate ShapeNotify */
+ }
+ else {
+ /* May/30/2001:
+ * The target currently has no shape in effect, so nothing to
+ * do here. The specs say that ShapeNotify is generated whenever
+ * the client region is "modified"; since no modification is done
+ * here, we do not generate that event. The specs does not say
+ * "it is an error to request removal when there is no shape in
+ * effect", so we return good status.
+ */
+ return Success;
+ }
+ }
+ else switch (op) {
+ case ShapeSet:
+ if (*destRgnp)
+ RegionDestroy(*destRgnp);
+ *destRgnp = srcRgn;
+ srcRgn = 0;
+ break;
+ case ShapeUnion:
+ if (*destRgnp)
+ RegionUnion(*destRgnp, *destRgnp, srcRgn);
+ break;
+ case ShapeIntersect:
+ if (*destRgnp)
+ RegionIntersect(*destRgnp, *destRgnp, srcRgn);
+ else {
+ *destRgnp = srcRgn;
+ srcRgn = 0;
+ }
+ break;
+ case ShapeSubtract:
+ if (!*destRgnp)
+ *destRgnp = (*create)(pWin);
+ RegionSubtract(*destRgnp, *destRgnp, srcRgn);
+ break;
+ case ShapeInvert:
+ if (!*destRgnp)
+ *destRgnp = RegionCreate((BoxPtr) 0, 0);
+ else
+ RegionSubtract(*destRgnp, srcRgn, *destRgnp);
+ break;
+ default:
+ client->errorValue = op;
+ return BadValue;
+ }
+ if (srcRgn)
+ RegionDestroy(srcRgn);
+ (*pWin->drawable.pScreen->SetShape) (pWin, kind);
+ SendShapeNotify (pWin, kind);
+ return Success;
+}
+
+RegionPtr
+CreateBoundingShape (WindowPtr pWin)
+{
+ BoxRec extents;
+
+ extents.x1 = -wBorderWidth (pWin);
+ extents.y1 = -wBorderWidth (pWin);
+ extents.x2 = pWin->drawable.width + wBorderWidth (pWin);
+ extents.y2 = pWin->drawable.height + wBorderWidth (pWin);
+ return RegionCreate(&extents, 1);
+}
+
+RegionPtr
+CreateClipShape (WindowPtr pWin)
+{
+ BoxRec extents;
+
+ extents.x1 = 0;
+ extents.y1 = 0;
+ extents.x2 = pWin->drawable.width;
+ extents.y2 = pWin->drawable.height;
+ return RegionCreate(&extents, 1);
+}
+
+static int
+ProcShapeQueryVersion (ClientPtr client)
+{
+ xShapeQueryVersionReply rep;
+ REQUEST_SIZE_MATCH (xShapeQueryVersionReq);
+ memset(&rep, 0, sizeof(xShapeQueryVersionReply));
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.majorVersion = SERVER_SHAPE_MAJOR_VERSION;
+ rep.minorVersion = SERVER_SHAPE_MINOR_VERSION;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.majorVersion);
+ swaps(&rep.minorVersion);
+ }
+ WriteToClient(client, sizeof (xShapeQueryVersionReply), (char *)&rep);
+ return Success;
+}
+
+/*****************
+ * ProcShapeRectangles
+ *
+ *****************/
+
+static int
+ProcShapeRectangles (ClientPtr client)
+{
+ WindowPtr pWin;
+ REQUEST(xShapeRectanglesReq);
+ xRectangle *prects;
+ int nrects, ctype, rc;
+ RegionPtr srcRgn;
+ RegionPtr *destRgn;
+ CreateDftPtr createDefault;
+
+ REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
+ UpdateCurrentTime();
+ rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess);
+ if (rc != Success)
+ return rc;
+ switch (stuff->destKind) {
+ case ShapeBounding:
+ createDefault = CreateBoundingShape;
+ break;
+ case ShapeClip:
+ createDefault = CreateClipShape;
+ break;
+ case ShapeInput:
+ createDefault = CreateBoundingShape;
+ break;
+ default:
+ client->errorValue = stuff->destKind;
+ return BadValue;
+ }
+ if ((stuff->ordering != Unsorted) && (stuff->ordering != YSorted) &&
+ (stuff->ordering != YXSorted) && (stuff->ordering != YXBanded))
+ {
+ client->errorValue = stuff->ordering;
+ return BadValue;
+ }
+ nrects = ((stuff->length << 2) - sizeof(xShapeRectanglesReq));
+ if (nrects & 4)
+ return BadLength;
+ nrects >>= 3;
+ prects = (xRectangle *) &stuff[1];
+ ctype = VerifyRectOrder(nrects, prects, (int)stuff->ordering);
+ if (ctype < 0)
+ return BadMatch;
+ srcRgn = RegionFromRects(nrects, prects, ctype);
+
+ if (!pWin->optional)
+ MakeWindowOptional (pWin);
+ switch (stuff->destKind) {
+ case ShapeBounding:
+ destRgn = &pWin->optional->boundingShape;
+ break;
+ case ShapeClip:
+ destRgn = &pWin->optional->clipShape;
+ break;
+ case ShapeInput:
+ destRgn = &pWin->optional->inputShape;
+ break;
+ default:
+ return BadValue;
+ }
+
+ return RegionOperate (client, pWin, (int)stuff->destKind,
+ destRgn, srcRgn, (int)stuff->op,
+ stuff->xOff, stuff->yOff, createDefault);
+}
+
+#ifdef PANORAMIX
+static int
+ProcPanoramiXShapeRectangles(
+ ClientPtr client)
+{
+ REQUEST(xShapeRectanglesReq);
+ PanoramiXRes *win;
+ int j, result;
+
+ REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
+
+ result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW,
+ client, DixWriteAccess);
+ if (result != Success)
+ return result;
+
+ FOR_NSCREENS(j) {
+ stuff->dest = win->info[j].id;
+ result = ProcShapeRectangles (client);
+ if (result != Success) break;
+ }
+ return result;
+}
+#endif
+
+
+/**************
+ * ProcShapeMask
+ **************/
+
+
+static int
+ProcShapeMask (ClientPtr client)
+{
+ WindowPtr pWin;
+ ScreenPtr pScreen;
+ REQUEST(xShapeMaskReq);
+ RegionPtr srcRgn;
+ RegionPtr *destRgn;
+ PixmapPtr pPixmap;
+ CreateDftPtr createDefault;
+ int rc;
+
+ REQUEST_SIZE_MATCH (xShapeMaskReq);
+ UpdateCurrentTime();
+ rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess);
+ if (rc != Success)
+ return rc;
+ switch (stuff->destKind) {
+ case ShapeBounding:
+ createDefault = CreateBoundingShape;
+ break;
+ case ShapeClip:
+ createDefault = CreateClipShape;
+ break;
+ case ShapeInput:
+ createDefault = CreateBoundingShape;
+ break;
+ default:
+ client->errorValue = stuff->destKind;
+ return BadValue;
+ }
+ pScreen = pWin->drawable.pScreen;
+ if (stuff->src == None)
+ srcRgn = 0;
+ else {
+ rc = dixLookupResourceByType((pointer *)&pPixmap, stuff->src, RT_PIXMAP,
+ client, DixReadAccess);
+ if (rc != Success)
+ return rc;
+ if (pPixmap->drawable.pScreen != pScreen ||
+ pPixmap->drawable.depth != 1)
+ return BadMatch;
+ srcRgn = BitmapToRegion(pScreen, pPixmap);
+ if (!srcRgn)
+ return BadAlloc;
+ }
+
+ if (!pWin->optional)
+ MakeWindowOptional (pWin);
+ switch (stuff->destKind) {
+ case ShapeBounding:
+ destRgn = &pWin->optional->boundingShape;
+ break;
+ case ShapeClip:
+ destRgn = &pWin->optional->clipShape;
+ break;
+ case ShapeInput:
+ destRgn = &pWin->optional->inputShape;
+ break;
+ default:
+ return BadValue;
+ }
+
+ return RegionOperate (client, pWin, (int)stuff->destKind,
+ destRgn, srcRgn, (int)stuff->op,
+ stuff->xOff, stuff->yOff, createDefault);
+}
+
+#ifdef PANORAMIX
+static int
+ProcPanoramiXShapeMask(
+ ClientPtr client)
+{
+ REQUEST(xShapeMaskReq);
+ PanoramiXRes *win, *pmap;
+ int j, result;
+
+ REQUEST_SIZE_MATCH (xShapeMaskReq);
+
+ result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW,
+ client, DixWriteAccess);
+ if (result != Success)
+ return result;
+
+ if(stuff->src != None) {
+ result = dixLookupResourceByType((pointer *)&pmap, stuff->src,
+ XRT_PIXMAP, client, DixReadAccess);
+ if (result != Success)
+ return result;
+ } else
+ pmap = NULL;
+
+ FOR_NSCREENS(j) {
+ stuff->dest = win->info[j].id;
+ if(pmap)
+ stuff->src = pmap->info[j].id;
+ result = ProcShapeMask (client);
+ if (result != Success) break;
+ }
+ return result;
+}
+#endif
+
+
+/************
+ * ProcShapeCombine
+ ************/
+
+static int
+ProcShapeCombine (ClientPtr client)
+{
+ WindowPtr pSrcWin, pDestWin;
+ REQUEST(xShapeCombineReq);
+ RegionPtr srcRgn;
+ RegionPtr *destRgn;
+ CreateDftPtr createDefault;
+ CreateDftPtr createSrc;
+ RegionPtr tmp;
+ int rc;
+
+ REQUEST_SIZE_MATCH (xShapeCombineReq);
+ UpdateCurrentTime();
+ rc = dixLookupWindow(&pDestWin, stuff->dest, client, DixSetAttrAccess);
+ if (rc != Success)
+ return rc;
+ if (!pDestWin->optional)
+ MakeWindowOptional (pDestWin);
+ switch (stuff->destKind) {
+ case ShapeBounding:
+ createDefault = CreateBoundingShape;
+ break;
+ case ShapeClip:
+ createDefault = CreateClipShape;
+ break;
+ case ShapeInput:
+ createDefault = CreateBoundingShape;
+ break;
+ default:
+ client->errorValue = stuff->destKind;
+ return BadValue;
+ }
+
+ rc = dixLookupWindow(&pSrcWin, stuff->src, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+ switch (stuff->srcKind) {
+ case ShapeBounding:
+ srcRgn = wBoundingShape (pSrcWin);
+ createSrc = CreateBoundingShape;
+ break;
+ case ShapeClip:
+ srcRgn = wClipShape (pSrcWin);
+ createSrc = CreateClipShape;
+ break;
+ case ShapeInput:
+ srcRgn = wInputShape (pSrcWin);
+ createSrc = CreateBoundingShape;
+ break;
+ default:
+ client->errorValue = stuff->srcKind;
+ return BadValue;
+ }
+ if (pSrcWin->drawable.pScreen != pDestWin->drawable.pScreen)
+ {
+ return BadMatch;
+ }
+
+ if (srcRgn) {
+ tmp = RegionCreate((BoxPtr) 0, 0);
+ RegionCopy(tmp, srcRgn);
+ srcRgn = tmp;
+ } else
+ srcRgn = (*createSrc) (pSrcWin);
+
+ if (!pDestWin->optional)
+ MakeWindowOptional (pDestWin);
+ switch (stuff->destKind) {
+ case ShapeBounding:
+ destRgn = &pDestWin->optional->boundingShape;
+ break;
+ case ShapeClip:
+ destRgn = &pDestWin->optional->clipShape;
+ break;
+ case ShapeInput:
+ destRgn = &pDestWin->optional->inputShape;
+ break;
+ default:
+ return BadValue;
+ }
+
+ return RegionOperate (client, pDestWin, (int)stuff->destKind,
+ destRgn, srcRgn, (int)stuff->op,
+ stuff->xOff, stuff->yOff, createDefault);
+}
+
+
+#ifdef PANORAMIX
+static int
+ProcPanoramiXShapeCombine(
+ ClientPtr client)
+{
+ REQUEST(xShapeCombineReq);
+ PanoramiXRes *win, *win2;
+ int j, result;
+
+ REQUEST_AT_LEAST_SIZE (xShapeCombineReq);
+
+ result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW,
+ client, DixWriteAccess);
+ if (result != Success)
+ return result;
+
+ result = dixLookupResourceByType((pointer *)&win2, stuff->src, XRT_WINDOW,
+ client, DixReadAccess);
+ if (result != Success)
+ return result;
+
+ FOR_NSCREENS(j) {
+ stuff->dest = win->info[j].id;
+ stuff->src = win2->info[j].id;
+ result = ProcShapeCombine (client);
+ if (result != Success) break;
+ }
+ return result;
+}
+#endif
+
+/*************
+ * ProcShapeOffset
+ *************/
+
+static int
+ProcShapeOffset (ClientPtr client)
+{
+ WindowPtr pWin;
+ REQUEST(xShapeOffsetReq);
+ RegionPtr srcRgn;
+ int rc;
+
+ REQUEST_SIZE_MATCH (xShapeOffsetReq);
+ UpdateCurrentTime();
+ rc = dixLookupWindow(&pWin, stuff->dest, client, DixSetAttrAccess);
+ if (rc != Success)
+ return rc;
+ switch (stuff->destKind) {
+ case ShapeBounding:
+ srcRgn = wBoundingShape (pWin);
+ break;
+ case ShapeClip:
+ srcRgn = wClipShape(pWin);
+ break;
+ case ShapeInput:
+ srcRgn = wInputShape (pWin);
+ break;
+ default:
+ client->errorValue = stuff->destKind;
+ return BadValue;
+ }
+ if (srcRgn)
+ {
+ RegionTranslate(srcRgn, stuff->xOff, stuff->yOff);
+ (*pWin->drawable.pScreen->SetShape) (pWin, stuff->destKind);
+ }
+ SendShapeNotify (pWin, (int)stuff->destKind);
+ return Success;
+}
+
+
+#ifdef PANORAMIX
+static int
+ProcPanoramiXShapeOffset(
+ ClientPtr client)
+{
+ REQUEST(xShapeOffsetReq);
+ PanoramiXRes *win;
+ int j, result;
+
+ REQUEST_AT_LEAST_SIZE (xShapeOffsetReq);
+
+ result = dixLookupResourceByType((pointer *)&win, stuff->dest, XRT_WINDOW,
+ client, DixWriteAccess);
+ if (result != Success)
+ return result;
+
+ FOR_NSCREENS(j) {
+ stuff->dest = win->info[j].id;
+ result = ProcShapeOffset (client);
+ if(result != Success) break;
+ }
+ return result;
+}
+#endif
+
+
+static int
+ProcShapeQueryExtents (ClientPtr client)
+{
+ REQUEST(xShapeQueryExtentsReq);
+ WindowPtr pWin;
+ xShapeQueryExtentsReply rep;
+ BoxRec extents, *pExtents;
+ int rc;
+ RegionPtr region;
+
+ REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+ memset(&rep, 0, sizeof(xShapeQueryExtentsReply));
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.boundingShaped = (wBoundingShape(pWin) != 0);
+ rep.clipShaped = (wClipShape(pWin) != 0);
+ if ((region = wBoundingShape(pWin))) {
+ /* this is done in two steps because of a compiler bug on SunOS 4.1.3 */
+ pExtents = RegionExtents(region);
+ extents = *pExtents;
+ } else {
+ extents.x1 = -wBorderWidth (pWin);
+ extents.y1 = -wBorderWidth (pWin);
+ extents.x2 = pWin->drawable.width + wBorderWidth (pWin);
+ extents.y2 = pWin->drawable.height + wBorderWidth (pWin);
+ }
+ rep.xBoundingShape = extents.x1;
+ rep.yBoundingShape = extents.y1;
+ rep.widthBoundingShape = extents.x2 - extents.x1;
+ rep.heightBoundingShape = extents.y2 - extents.y1;
+ if ((region = wClipShape(pWin))) {
+ /* this is done in two steps because of a compiler bug on SunOS 4.1.3 */
+ pExtents = RegionExtents(region);
+ extents = *pExtents;
+ } else {
+ extents.x1 = 0;
+ extents.y1 = 0;
+ extents.x2 = pWin->drawable.width;
+ extents.y2 = pWin->drawable.height;
+ }
+ rep.xClipShape = extents.x1;
+ rep.yClipShape = extents.y1;
+ rep.widthClipShape = extents.x2 - extents.x1;
+ rep.heightClipShape = extents.y2 - extents.y1;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.xBoundingShape);
+ swaps(&rep.yBoundingShape);
+ swaps(&rep.widthBoundingShape);
+ swaps(&rep.heightBoundingShape);
+ swaps(&rep.xClipShape);
+ swaps(&rep.yClipShape);
+ swaps(&rep.widthClipShape);
+ swaps(&rep.heightClipShape);
+ }
+ WriteToClient(client, sizeof (xShapeQueryExtentsReply), (char *)&rep);
+ return Success;
+}
+
+/*ARGSUSED*/
+static int
+ShapeFreeClient (pointer data, XID id)
+{
+ ShapeEventPtr pShapeEvent;
+ WindowPtr pWin;
+ ShapeEventPtr *pHead, pCur, pPrev;
+ int rc;
+
+ pShapeEvent = (ShapeEventPtr) data;
+ pWin = pShapeEvent->window;
+ rc = dixLookupResourceByType((pointer *)&pHead, pWin->drawable.id,
+ ShapeEventType, serverClient, DixReadAccess);
+ if (rc == Success) {
+ pPrev = 0;
+ for (pCur = *pHead; pCur && pCur != pShapeEvent; pCur=pCur->next)
+ pPrev = pCur;
+ if (pCur)
+ {
+ if (pPrev)
+ pPrev->next = pShapeEvent->next;
+ else
+ *pHead = pShapeEvent->next;
+ }
+ }
+ free((pointer) pShapeEvent);
+ return 1;
+}
+
+/*ARGSUSED*/
+static int
+ShapeFreeEvents (pointer data, XID id)
+{
+ ShapeEventPtr *pHead, pCur, pNext;
+
+ pHead = (ShapeEventPtr *) data;
+ for (pCur = *pHead; pCur; pCur = pNext) {
+ pNext = pCur->next;
+ FreeResource (pCur->clientResource, ClientType);
+ free((pointer) pCur);
+ }
+ free((pointer) pHead);
+ return 1;
+}
+
+static int
+ProcShapeSelectInput (ClientPtr client)
+{
+ REQUEST(xShapeSelectInputReq);
+ WindowPtr pWin;
+ ShapeEventPtr pShapeEvent, pNewShapeEvent, *pHead;
+ XID clientResource;
+ int rc;
+
+ REQUEST_SIZE_MATCH (xShapeSelectInputReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixReceiveAccess);
+ if (rc != Success)
+ return rc;
+ rc = dixLookupResourceByType((pointer *)&pHead, pWin->drawable.id,
+ ShapeEventType, client, DixWriteAccess);
+ if (rc != Success && rc != BadValue)
+ return rc;
+
+ switch (stuff->enable) {
+ case xTrue:
+ if (pHead) {
+
+ /* check for existing entry. */
+ for (pShapeEvent = *pHead;
+ pShapeEvent;
+ pShapeEvent = pShapeEvent->next)
+ {
+ if (pShapeEvent->client == client)
+ return Success;
+ }
+ }
+
+ /* build the entry */
+ pNewShapeEvent = malloc(sizeof (ShapeEventRec));
+ if (!pNewShapeEvent)
+ return BadAlloc;
+ pNewShapeEvent->next = 0;
+ pNewShapeEvent->client = client;
+ pNewShapeEvent->window = pWin;
+ /*
+ * add a resource that will be deleted when
+ * the client goes away
+ */
+ clientResource = FakeClientID (client->index);
+ pNewShapeEvent->clientResource = clientResource;
+ if (!AddResource (clientResource, ClientType, (pointer)pNewShapeEvent))
+ return BadAlloc;
+ /*
+ * create a resource to contain a pointer to the list
+ * of clients selecting input. This must be indirect as
+ * the list may be arbitrarily rearranged which cannot be
+ * done through the resource database.
+ */
+ if (!pHead)
+ {
+ pHead = malloc(sizeof (ShapeEventPtr));
+ if (!pHead ||
+ !AddResource (pWin->drawable.id, ShapeEventType, (pointer)pHead))
+ {
+ FreeResource (clientResource, RT_NONE);
+ return BadAlloc;
+ }
+ *pHead = 0;
+ }
+ pNewShapeEvent->next = *pHead;
+ *pHead = pNewShapeEvent;
+ break;
+ case xFalse:
+ /* delete the interest */
+ if (pHead) {
+ pNewShapeEvent = 0;
+ for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) {
+ if (pShapeEvent->client == client)
+ break;
+ pNewShapeEvent = pShapeEvent;
+ }
+ if (pShapeEvent) {
+ FreeResource (pShapeEvent->clientResource, ClientType);
+ if (pNewShapeEvent)
+ pNewShapeEvent->next = pShapeEvent->next;
+ else
+ *pHead = pShapeEvent->next;
+ free(pShapeEvent);
+ }
+ }
+ break;
+ default:
+ client->errorValue = stuff->enable;
+ return BadValue;
+ }
+ return Success;
+}
+
+/*
+ * deliver the event
+ */
+
+void
+SendShapeNotify (WindowPtr pWin, int which)
+{
+ ShapeEventPtr *pHead, pShapeEvent;
+ xShapeNotifyEvent se;
+ BoxRec extents;
+ RegionPtr region;
+ BYTE shaped;
+ int rc;
+
+ rc = dixLookupResourceByType((pointer *)&pHead, pWin->drawable.id,
+ ShapeEventType, serverClient, DixReadAccess);
+ if (rc != Success)
+ return;
+ switch (which) {
+ case ShapeBounding:
+ region = wBoundingShape(pWin);
+ if (region) {
+ extents = *RegionExtents(region);
+ shaped = xTrue;
+ } else {
+ extents.x1 = -wBorderWidth (pWin);
+ extents.y1 = -wBorderWidth (pWin);
+ extents.x2 = pWin->drawable.width + wBorderWidth (pWin);
+ extents.y2 = pWin->drawable.height + wBorderWidth (pWin);
+ shaped = xFalse;
+ }
+ break;
+ case ShapeClip:
+ region = wClipShape(pWin);
+ if (region) {
+ extents = *RegionExtents(region);
+ shaped = xTrue;
+ } else {
+ extents.x1 = 0;
+ extents.y1 = 0;
+ extents.x2 = pWin->drawable.width;
+ extents.y2 = pWin->drawable.height;
+ shaped = xFalse;
+ }
+ break;
+ case ShapeInput:
+ region = wInputShape(pWin);
+ if (region) {
+ extents = *RegionExtents(region);
+ shaped = xTrue;
+ } else {
+ extents.x1 = -wBorderWidth (pWin);
+ extents.y1 = -wBorderWidth (pWin);
+ extents.x2 = pWin->drawable.width + wBorderWidth (pWin);
+ extents.y2 = pWin->drawable.height + wBorderWidth (pWin);
+ shaped = xFalse;
+ }
+ break;
+ default:
+ return;
+ }
+ for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) {
+ se.type = ShapeNotify + ShapeEventBase;
+ se.kind = which;
+ se.window = pWin->drawable.id;
+ se.x = extents.x1;
+ se.y = extents.y1;
+ se.width = extents.x2 - extents.x1;
+ se.height = extents.y2 - extents.y1;
+ se.time = currentTime.milliseconds;
+ se.shaped = shaped;
+ WriteEventsToClient (pShapeEvent->client, 1, (xEvent *) &se);
+ }
+}
+
+static int
+ProcShapeInputSelected (ClientPtr client)
+{
+ REQUEST(xShapeInputSelectedReq);
+ WindowPtr pWin;
+ ShapeEventPtr pShapeEvent, *pHead;
+ int enabled, rc;
+ xShapeInputSelectedReply rep;
+ REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+ rc = dixLookupResourceByType((pointer *)&pHead, pWin->drawable.id,
+ ShapeEventType, client, DixReadAccess);
+ if (rc != Success && rc != BadValue)
+ return rc;
+ enabled = xFalse;
+ if (pHead) {
+ for (pShapeEvent = *pHead;
+ pShapeEvent;
+ pShapeEvent = pShapeEvent->next)
+ {
+ if (pShapeEvent->client == client) {
+ enabled = xTrue;
+ break;
+ }
+ }
+ }
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.enabled = enabled;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ }
+ WriteToClient (client, sizeof (xShapeInputSelectedReply), (char *) &rep);
+ return Success;
+}
+
+static int
+ProcShapeGetRectangles (ClientPtr client)
+{
+ REQUEST(xShapeGetRectanglesReq);
+ WindowPtr pWin;
+ xShapeGetRectanglesReply rep;
+ xRectangle *rects;
+ int nrects, i, rc;
+ RegionPtr region;
+ REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+ switch (stuff->kind) {
+ case ShapeBounding:
+ region = wBoundingShape(pWin);
+ break;
+ case ShapeClip:
+ region = wClipShape(pWin);
+ break;
+ case ShapeInput:
+ region = wInputShape (pWin);
+ break;
+ default:
+ client->errorValue = stuff->kind;
+ return BadValue;
+ }
+ if (!region) {
+ nrects = 1;
+ rects = malloc(sizeof (xRectangle));
+ if (!rects)
+ return BadAlloc;
+ switch (stuff->kind) {
+ case ShapeBounding:
+ rects->x = - (int) wBorderWidth (pWin);
+ rects->y = - (int) wBorderWidth (pWin);
+ rects->width = pWin->drawable.width + wBorderWidth (pWin);
+ rects->height = pWin->drawable.height + wBorderWidth (pWin);
+ break;
+ case ShapeClip:
+ rects->x = 0;
+ rects->y = 0;
+ rects->width = pWin->drawable.width;
+ rects->height = pWin->drawable.height;
+ break;
+ case ShapeInput:
+ rects->x = - (int) wBorderWidth (pWin);
+ rects->y = - (int) wBorderWidth (pWin);
+ rects->width = pWin->drawable.width + wBorderWidth (pWin);
+ rects->height = pWin->drawable.height + wBorderWidth (pWin);
+ break;
+ }
+ } else {
+ BoxPtr box;
+ nrects = RegionNumRects(region);
+ box = RegionRects(region);
+ rects = malloc(nrects * sizeof (xRectangle));
+ if (!rects && nrects)
+ return BadAlloc;
+ for (i = 0; i < nrects; i++, box++) {
+ rects[i].x = box->x1;
+ rects[i].y = box->y1;
+ rects[i].width = box->x2 - box->x1;
+ rects[i].height = box->y2 - box->y1;
+ }
+ }
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = bytes_to_int32(nrects * sizeof (xRectangle));
+ rep.ordering = YXBanded;
+ rep.nrects = nrects;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.nrects);
+ SwapShorts ((short *)rects, (unsigned long)nrects * 4);
+ }
+ WriteToClient (client, sizeof (rep), (char *) &rep);
+ WriteToClient (client, nrects * sizeof (xRectangle), (char *) rects);
+ free(rects);
+ return Success;
+}
+
+static int
+ProcShapeDispatch (ClientPtr client)
+{
+ REQUEST(xReq);
+ switch (stuff->data) {
+ case X_ShapeQueryVersion:
+ return ProcShapeQueryVersion (client);
+ case X_ShapeRectangles:
+#ifdef PANORAMIX
+ if ( !noPanoramiXExtension )
+ return ProcPanoramiXShapeRectangles (client);
+ else
+#endif
+ return ProcShapeRectangles (client);
+ case X_ShapeMask:
+#ifdef PANORAMIX
+ if ( !noPanoramiXExtension )
+ return ProcPanoramiXShapeMask (client);
+ else
+#endif
+ return ProcShapeMask (client);
+ case X_ShapeCombine:
+#ifdef PANORAMIX
+ if ( !noPanoramiXExtension )
+ return ProcPanoramiXShapeCombine (client);
+ else
+#endif
+ return ProcShapeCombine (client);
+ case X_ShapeOffset:
+#ifdef PANORAMIX
+ if ( !noPanoramiXExtension )
+ return ProcPanoramiXShapeOffset (client);
+ else
+#endif
+ return ProcShapeOffset (client);
+ case X_ShapeQueryExtents:
+ return ProcShapeQueryExtents (client);
+ case X_ShapeSelectInput:
+ return ProcShapeSelectInput (client);
+ case X_ShapeInputSelected:
+ return ProcShapeInputSelected (client);
+ case X_ShapeGetRectangles:
+ return ProcShapeGetRectangles (client);
+ default:
+ return BadRequest;
+ }
+}
+
+static void
+SShapeNotifyEvent(xShapeNotifyEvent *from, xShapeNotifyEvent *to)
+{
+ to->type = from->type;
+ to->kind = from->kind;
+ cpswapl (from->window, to->window);
+ cpswaps (from->sequenceNumber, to->sequenceNumber);
+ cpswaps (from->x, to->x);
+ cpswaps (from->y, to->y);
+ cpswaps (from->width, to->width);
+ cpswaps (from->height, to->height);
+ cpswapl (from->time, to->time);
+ to->shaped = from->shaped;
+}
+
+static int
+SProcShapeQueryVersion (ClientPtr client)
+{
+ REQUEST (xShapeQueryVersionReq);
+
+ swaps(&stuff->length);
+ return ProcShapeQueryVersion (client);
+}
+
+static int
+SProcShapeRectangles (ClientPtr client)
+{
+ REQUEST (xShapeRectanglesReq);
+
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
+ swapl(&stuff->dest);
+ swaps(&stuff->xOff);
+ swaps(&stuff->yOff);
+ SwapRestS(stuff);
+ return ProcShapeRectangles (client);
+}
+
+static int
+SProcShapeMask (ClientPtr client)
+{
+ REQUEST (xShapeMaskReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xShapeMaskReq);
+ swapl(&stuff->dest);
+ swaps(&stuff->xOff);
+ swaps(&stuff->yOff);
+ swapl(&stuff->src);
+ return ProcShapeMask (client);
+}
+
+static int
+SProcShapeCombine (ClientPtr client)
+{
+ REQUEST (xShapeCombineReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xShapeCombineReq);
+ swapl(&stuff->dest);
+ swaps(&stuff->xOff);
+ swaps(&stuff->yOff);
+ swapl(&stuff->src);
+ return ProcShapeCombine (client);
+}
+
+static int
+SProcShapeOffset (ClientPtr client)
+{
+ REQUEST (xShapeOffsetReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xShapeOffsetReq);
+ swapl(&stuff->dest);
+ swaps(&stuff->xOff);
+ swaps(&stuff->yOff);
+ return ProcShapeOffset (client);
+}
+
+static int
+SProcShapeQueryExtents (ClientPtr client)
+{
+ REQUEST (xShapeQueryExtentsReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xShapeQueryExtentsReq);
+ swapl(&stuff->window);
+ return ProcShapeQueryExtents (client);
+}
+
+static int
+SProcShapeSelectInput (ClientPtr client)
+{
+ REQUEST (xShapeSelectInputReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xShapeSelectInputReq);
+ swapl(&stuff->window);
+ return ProcShapeSelectInput (client);
+}
+
+static int
+SProcShapeInputSelected (ClientPtr client)
+{
+ REQUEST (xShapeInputSelectedReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xShapeInputSelectedReq);
+ swapl(&stuff->window);
+ return ProcShapeInputSelected (client);
+}
+
+static int
+SProcShapeGetRectangles (ClientPtr client)
+{
+ REQUEST(xShapeGetRectanglesReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xShapeGetRectanglesReq);
+ swapl(&stuff->window);
+ return ProcShapeGetRectangles (client);
+}
+
+static int
+SProcShapeDispatch (ClientPtr client)
+{
+ REQUEST(xReq);
+ switch (stuff->data) {
+ case X_ShapeQueryVersion:
+ return SProcShapeQueryVersion (client);
+ case X_ShapeRectangles:
+ return SProcShapeRectangles (client);
+ case X_ShapeMask:
+ return SProcShapeMask (client);
+ case X_ShapeCombine:
+ return SProcShapeCombine (client);
+ case X_ShapeOffset:
+ return SProcShapeOffset (client);
+ case X_ShapeQueryExtents:
+ return SProcShapeQueryExtents (client);
+ case X_ShapeSelectInput:
+ return SProcShapeSelectInput (client);
+ case X_ShapeInputSelected:
+ return SProcShapeInputSelected (client);
+ case X_ShapeGetRectangles:
+ return SProcShapeGetRectangles (client);
+ default:
+ return BadRequest;
+ }
+}
+
+void
+ShapeExtensionInit(void)
+{
+ ExtensionEntry *extEntry;
+
+ ClientType = CreateNewResourceType(ShapeFreeClient, "ShapeClient");
+ ShapeEventType = CreateNewResourceType(ShapeFreeEvents, "ShapeEvent");
+ if (ClientType && ShapeEventType &&
+ (extEntry = AddExtension(SHAPENAME, ShapeNumberEvents, 0,
+ ProcShapeDispatch, SProcShapeDispatch,
+ NULL, StandardMinorOpcode)))
+ {
+ ShapeEventBase = extEntry->eventBase;
+ EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent;
+ }
+}
diff --git a/xorg-server/Xext/shm.c b/xorg-server/Xext/shm.c
index ac1ab3b56..39916df60 100644
--- a/xorg-server/Xext/shm.c
+++ b/xorg-server/Xext/shm.c
@@ -291,7 +291,6 @@ static int
ProcShmQueryVersion(ClientPtr client)
{
xShmQueryVersionReply rep;
- int n;
REQUEST_SIZE_MATCH(xShmQueryVersionReq);
memset(&rep, 0, sizeof(xShmQueryVersionReply));
@@ -307,12 +306,12 @@ ProcShmQueryVersion(ClientPtr client)
rep.gid = getegid();
#endif
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- swaps(&rep.uid, n);
- swaps(&rep.gid, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.majorVersion);
+ swaps(&rep.minorVersion);
+ swaps(&rep.uid);
+ swaps(&rep.gid);
}
WriteToClient(client, sizeof(xShmQueryVersionReply), (char *)&rep);
return Success;
@@ -652,7 +651,7 @@ ProcShmGetImage(ClientPtr client)
Mask plane = 0;
xShmGetImageReply xgi;
ShmDescPtr shmdesc;
- int n, rc;
+ int rc;
REQUEST(xShmGetImageReq);
@@ -746,10 +745,10 @@ ProcShmGetImage(ClientPtr client)
}
if (client->swapped) {
- swaps(&xgi.sequenceNumber, n);
- swapl(&xgi.length, n);
- swapl(&xgi.visual, n);
- swapl(&xgi.size, n);
+ swaps(&xgi.sequenceNumber);
+ swapl(&xgi.length);
+ swapl(&xgi.visual);
+ swapl(&xgi.size);
}
WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
@@ -916,11 +915,10 @@ ProcPanoramiXShmGetImage(ClientPtr client)
free(drawables);
if (client->swapped) {
- int n;
- swaps(&xgi.sequenceNumber, n);
- swapl(&xgi.length, n);
- swapl(&xgi.visual, n);
- swapl(&xgi.size, n);
+ swaps(&xgi.sequenceNumber);
+ swapl(&xgi.length);
+ swapl(&xgi.visual);
+ swapl(&xgi.size);
}
WriteToClient(client, sizeof(xShmGetImageReply), (char *)&xgi);
@@ -1010,7 +1008,6 @@ CreatePmap:
pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
pMap->drawable.id = newPix->info[j].id;
if (!AddResource(newPix->info[j].id, RT_PIXMAP, (pointer)pMap)) {
- (*pScreen->DestroyPixmap)(pMap);
result = BadAlloc;
break;
}
@@ -1021,10 +1018,8 @@ CreatePmap:
}
if(result == BadAlloc) {
- while(j--) {
- (*pScreen->DestroyPixmap)(pMap);
+ while(j--)
FreeResource(newPix->info[j].id, RT_NONE);
- }
free(newPix);
} else
AddResource(stuff->pid, XRT_PIXMAP, newPix);
@@ -1129,7 +1124,6 @@ CreatePmap:
{
return Success;
}
- pDraw->pScreen->DestroyPixmap(pMap);
}
return BadAlloc;
}
@@ -1184,89 +1178,83 @@ SShmCompletionEvent(xShmCompletionEvent *from, xShmCompletionEvent *to)
static int
SProcShmQueryVersion(ClientPtr client)
{
- int n;
REQUEST(xShmQueryVersionReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return ProcShmQueryVersion(client);
}
static int
SProcShmAttach(ClientPtr client)
{
- int n;
REQUEST(xShmAttachReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmAttachReq);
- swapl(&stuff->shmseg, n);
- swapl(&stuff->shmid, n);
+ swapl(&stuff->shmseg);
+ swapl(&stuff->shmid);
return ProcShmAttach(client);
}
static int
SProcShmDetach(ClientPtr client)
{
- int n;
REQUEST(xShmDetachReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmDetachReq);
- swapl(&stuff->shmseg, n);
+ swapl(&stuff->shmseg);
return ProcShmDetach(client);
}
static int
SProcShmPutImage(ClientPtr client)
{
- int n;
REQUEST(xShmPutImageReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmPutImageReq);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->totalWidth, n);
- swaps(&stuff->totalHeight, n);
- swaps(&stuff->srcX, n);
- swaps(&stuff->srcY, n);
- swaps(&stuff->srcWidth, n);
- swaps(&stuff->srcHeight, n);
- swaps(&stuff->dstX, n);
- swaps(&stuff->dstY, n);
- swapl(&stuff->shmseg, n);
- swapl(&stuff->offset, n);
+ swapl(&stuff->drawable);
+ swapl(&stuff->gc);
+ swaps(&stuff->totalWidth);
+ swaps(&stuff->totalHeight);
+ swaps(&stuff->srcX);
+ swaps(&stuff->srcY);
+ swaps(&stuff->srcWidth);
+ swaps(&stuff->srcHeight);
+ swaps(&stuff->dstX);
+ swaps(&stuff->dstY);
+ swapl(&stuff->shmseg);
+ swapl(&stuff->offset);
return ProcShmPutImage(client);
}
static int
SProcShmGetImage(ClientPtr client)
{
- int n;
REQUEST(xShmGetImageReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmGetImageReq);
- swapl(&stuff->drawable, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- swapl(&stuff->planeMask, n);
- swapl(&stuff->shmseg, n);
- swapl(&stuff->offset, n);
+ swapl(&stuff->drawable);
+ swaps(&stuff->x);
+ swaps(&stuff->y);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
+ swapl(&stuff->planeMask);
+ swapl(&stuff->shmseg);
+ swapl(&stuff->offset);
return ProcShmGetImage(client);
}
static int
SProcShmCreatePixmap(ClientPtr client)
{
- int n;
REQUEST(xShmCreatePixmapReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xShmCreatePixmapReq);
- swapl(&stuff->pid, n);
- swapl(&stuff->drawable, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- swapl(&stuff->shmseg, n);
- swapl(&stuff->offset, n);
+ swapl(&stuff->pid);
+ swapl(&stuff->drawable);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
+ swapl(&stuff->shmseg);
+ swapl(&stuff->offset);
return ProcShmCreatePixmap(client);
}
diff --git a/xorg-server/Xext/sync.c b/xorg-server/Xext/sync.c
index 60bcfe8d8..67fad2d4f 100644
--- a/xorg-server/Xext/sync.c
+++ b/xorg-server/Xext/sync.c
@@ -1,2929 +1,2881 @@
-/*
-
-Copyright 1991, 1993, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-
-Copyright 1991, 1993 by Digital Equipment Corporation, Maynard, Massachusetts,
-and Olivetti Research Limited, Cambridge, England.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the names of Digital or Olivetti
-not be used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission. Digital and Olivetti
-make no representations about the suitability of this software
-for any purpose. It is provided "as is" without express or implied warranty.
-
-DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
-SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS, IN NO EVENT SHALL THEY BE LIABLE FOR ANY SPECIAL, INDIRECT OR
-CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
-USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-
-*/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <string.h>
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/Xmd.h>
-#include "scrnintstr.h"
-#include "os.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "pixmapstr.h"
-#include "resource.h"
-#include "opaque.h"
-#include <X11/extensions/syncproto.h>
-#include "syncsrv.h"
-#include "syncsdk.h"
-#include "protocol-versions.h"
-
-#include <stdio.h>
-#if !defined(WIN32)
-#include <sys/time.h>
-#endif
-
-#include "modinit.h"
-
-/*
- * Local Global Variables
- */
-static int SyncEventBase;
-static int SyncErrorBase;
-static RESTYPE RTCounter = 0;
-static RESTYPE RTAwait;
-static RESTYPE RTAlarm;
-static RESTYPE RTAlarmClient;
-static RESTYPE RTFence;
-static int SyncNumSystemCounters = 0;
-static SyncCounter **SysCounterList = NULL;
-static int SyncNumInvalidCounterWarnings = 0;
-#define MAX_INVALID_COUNTER_WARNINGS 5
-
-static const char *WARN_INVALID_COUNTER_COMPARE =
-"Warning: Non-counter XSync object using Counter-only\n"
-" comparison. Result will never be true.\n";
-
-static const char *WARN_INVALID_COUNTER_ALARM =
-"Warning: Non-counter XSync object used in alarm. This is\n"
-" the result of a programming error in the X server.\n";
-
-#define IsSystemCounter(pCounter) \
- (pCounter && (pCounter->sync.client == NULL))
-
-/* these are all the alarm attributes that pertain to the alarm's trigger */
-#define XSyncCAAllTrigger \
- (XSyncCACounter | XSyncCAValueType | XSyncCAValue | XSyncCATestType)
-
-static void SyncComputeBracketValues(SyncCounter *);
-
-static void SyncInitServerTime(void);
-
-static void SyncInitIdleTime(void);
-
-static Bool
-SyncCheckWarnIsCounter(const SyncObject* pSync, const char *warning)
-{
- if (pSync && (SYNC_COUNTER != pSync->type))
- {
- if (SyncNumInvalidCounterWarnings++ < MAX_INVALID_COUNTER_WARNINGS)
- {
- ErrorF("%s", warning);
- ErrorF(" Counter type: %d\n", pSync->type);
- }
-
- return FALSE;
- }
-
- return TRUE;
-}
-
-/* Each counter maintains a simple linked list of triggers that are
- * interested in the counter. The two functions below are used to
- * delete and add triggers on this list.
- */
-static void
-SyncDeleteTriggerFromSyncObject(SyncTrigger *pTrigger)
-{
- SyncTriggerList *pCur;
- SyncTriggerList *pPrev;
- SyncCounter *pCounter;
-
- /* pSync needs to be stored in pTrigger before calling here. */
-
- if (!pTrigger->pSync)
- return;
-
- pPrev = NULL;
- pCur = pTrigger->pSync->pTriglist;
-
- while (pCur)
- {
- if (pCur->pTrigger == pTrigger)
- {
- if (pPrev)
- pPrev->next = pCur->next;
- else
- pTrigger->pSync->pTriglist = pCur->next;
-
- free(pCur);
- break;
- }
-
- pPrev = pCur;
- pCur = pCur->next;
- }
-
- if (SYNC_COUNTER == pTrigger->pSync->type)
- {
- pCounter = (SyncCounter *)pTrigger->pSync;
-
- if (IsSystemCounter(pCounter))
- SyncComputeBracketValues(pCounter);
- } else if (SYNC_FENCE == pTrigger->pSync->type) {
- SyncFence* pFence = (SyncFence*) pTrigger->pSync;
- pFence->funcs.DeleteTrigger(pTrigger);
- }
-}
-
-
-static int
-SyncAddTriggerToSyncObject(SyncTrigger *pTrigger)
-{
- SyncTriggerList *pCur;
- SyncCounter *pCounter;
-
- if (!pTrigger->pSync)
- return Success;
-
- /* don't do anything if it's already there */
- for (pCur = pTrigger->pSync->pTriglist; pCur; pCur = pCur->next)
- {
- if (pCur->pTrigger == pTrigger)
- return Success;
- }
-
- if (!(pCur = malloc(sizeof(SyncTriggerList))))
- return BadAlloc;
-
- pCur->pTrigger = pTrigger;
- pCur->next = pTrigger->pSync->pTriglist;
- pTrigger->pSync->pTriglist = pCur;
-
- if (SYNC_COUNTER == pTrigger->pSync->type)
- {
- pCounter = (SyncCounter *)pTrigger->pSync;
-
- if (IsSystemCounter(pCounter))
- SyncComputeBracketValues(pCounter);
- } else if (SYNC_FENCE == pTrigger->pSync->type) {
- SyncFence* pFence = (SyncFence*) pTrigger->pSync;
- pFence->funcs.AddTrigger(pTrigger);
- }
-
- return Success;
-}
-
-
-/* Below are five possible functions that can be plugged into
- * pTrigger->CheckTrigger for counter sync objects, corresponding to
- * the four possible test-types, and the one possible function that
- * can be plugged into pTrigger->CheckTrigger for fence sync objects.
- * These functions are called after the sync object's state changes
- * but are also passed the old state so they can inspect both the old
- * and new values. (PositiveTransition and NegativeTransition need to
- * see both pieces of information.) These functions return the truth
- * value of the trigger.
- *
- * All of them include the condition pTrigger->pSync == NULL.
- * This is because the spec says that a trigger with a sync value
- * of None is always TRUE.
- */
-
-static Bool
-SyncCheckTriggerPositiveComparison(SyncTrigger *pTrigger, CARD64 oldval)
-{
- SyncCounter *pCounter;
-
- /* Non-counter sync objects should never get here because they
- * never trigger this comparison. */
- if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE))
- return FALSE;
-
- pCounter = (SyncCounter *)pTrigger->pSync;
-
- return (pCounter == NULL ||
- XSyncValueGreaterOrEqual(pCounter->value, pTrigger->test_value));
-}
-
-static Bool
-SyncCheckTriggerNegativeComparison(SyncTrigger *pTrigger, CARD64 oldval)
-{
- SyncCounter *pCounter;
-
- /* Non-counter sync objects should never get here because they
- * never trigger this comparison. */
- if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE))
- return FALSE;
-
- pCounter = (SyncCounter *)pTrigger->pSync;
-
- return (pCounter == NULL ||
- XSyncValueLessOrEqual(pCounter->value, pTrigger->test_value));
-}
-
-static Bool
-SyncCheckTriggerPositiveTransition(SyncTrigger *pTrigger, CARD64 oldval)
-{
- SyncCounter *pCounter;
-
- /* Non-counter sync objects should never get here because they
- * never trigger this comparison. */
- if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE))
- return FALSE;
-
- pCounter = (SyncCounter *)pTrigger->pSync;
-
- return (pCounter == NULL ||
- (XSyncValueLessThan(oldval, pTrigger->test_value) &&
- XSyncValueGreaterOrEqual(pCounter->value, pTrigger->test_value)));
-}
-
-static Bool
-SyncCheckTriggerNegativeTransition(SyncTrigger *pTrigger, CARD64 oldval)
-{
- SyncCounter *pCounter;
-
- /* Non-counter sync objects should never get here because they
- * never trigger this comparison. */
- if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE))
- return FALSE;
-
- pCounter = (SyncCounter *)pTrigger->pSync;
-
- return (pCounter == NULL ||
- (XSyncValueGreaterThan(oldval, pTrigger->test_value) &&
- XSyncValueLessOrEqual(pCounter->value, pTrigger->test_value)));
-}
-
-static Bool
-SyncCheckTriggerFence(SyncTrigger *pTrigger, CARD64 unused)
-{
- SyncFence* pFence = (SyncFence*) pTrigger->pSync;
- (void)unused;
-
- return (pFence == NULL ||
- pFence->funcs.CheckTriggered(pFence));
-}
-
-static int
-SyncInitTrigger(ClientPtr client, SyncTrigger *pTrigger, XID syncObject,
- RESTYPE resType, Mask changes)
-{
- SyncObject *pSync = pTrigger->pSync;
- SyncCounter *pCounter = NULL;
- int rc;
- Bool newSyncObject = FALSE;
-
- if (changes & XSyncCACounter)
- {
- if (syncObject == None)
- pSync = NULL;
- else if (Success != (rc = dixLookupResourceByType ((pointer *)&pSync,
- syncObject, resType, client, DixReadAccess)))
- {
- client->errorValue = syncObject;
- return rc;
- }
- if (pSync != pTrigger->pSync)
- { /* new counter for trigger */
- SyncDeleteTriggerFromSyncObject(pTrigger);
- pTrigger->pSync = pSync;
- newSyncObject = TRUE;
- }
- }
-
- /* if system counter, ask it what the current value is */
-
- if (pSync && SYNC_COUNTER == pSync->type)
- {
- pCounter = (SyncCounter *)pSync;
-
- if (IsSystemCounter(pCounter))
- {
- (*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter,
- &pCounter->value);
- }
- }
-
- if (changes & XSyncCAValueType)
- {
- if (pTrigger->value_type != XSyncRelative &&
- pTrigger->value_type != XSyncAbsolute)
- {
- client->errorValue = pTrigger->value_type;
- return BadValue;
- }
- }
-
- if (changes & XSyncCATestType)
- {
-
- if (pSync && SYNC_FENCE == pSync->type)
- {
- pTrigger->CheckTrigger = SyncCheckTriggerFence;
- }
- else
- {
- /* select appropriate CheckTrigger function */
-
- switch (pTrigger->test_type)
- {
- case XSyncPositiveTransition:
- pTrigger->CheckTrigger = SyncCheckTriggerPositiveTransition;
- break;
- case XSyncNegativeTransition:
- pTrigger->CheckTrigger = SyncCheckTriggerNegativeTransition;
- break;
- case XSyncPositiveComparison:
- pTrigger->CheckTrigger = SyncCheckTriggerPositiveComparison;
- break;
- case XSyncNegativeComparison:
- pTrigger->CheckTrigger = SyncCheckTriggerNegativeComparison;
- break;
- default:
- client->errorValue = pTrigger->test_type;
- return BadValue;
- }
- }
- }
-
- if (changes & (XSyncCAValueType | XSyncCAValue))
- {
- if (pTrigger->value_type == XSyncAbsolute)
- pTrigger->test_value = pTrigger->wait_value;
- else /* relative */
- {
- Bool overflow;
- if (pCounter == NULL)
- return BadMatch;
-
- XSyncValueAdd(&pTrigger->test_value, pCounter->value,
- pTrigger->wait_value, &overflow);
- if (overflow)
- {
- client->errorValue = XSyncValueHigh32(pTrigger->wait_value);
- return BadValue;
- }
- }
- }
-
- /* we wait until we're sure there are no errors before registering
- * a new counter on a trigger
- */
- if (newSyncObject)
- {
- if ((rc = SyncAddTriggerToSyncObject(pTrigger)) != Success)
- return rc;
- }
- else if (pCounter && IsSystemCounter(pCounter))
- {
- SyncComputeBracketValues(pCounter);
- }
-
- return Success;
-}
-
-/* AlarmNotify events happen in response to actions taken on an Alarm or
- * the counter used by the alarm. AlarmNotify may be sent to multiple
- * clients. The alarm maintains a list of clients interested in events.
- */
-static void
-SyncSendAlarmNotifyEvents(SyncAlarm *pAlarm)
-{
- SyncAlarmClientList *pcl;
- xSyncAlarmNotifyEvent ane;
- SyncTrigger *pTrigger = &pAlarm->trigger;
- SyncCounter *pCounter;
-
- if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_ALARM))
- return;
-
- pCounter = (SyncCounter *)pTrigger->pSync;
-
- UpdateCurrentTime();
-
- ane.type = SyncEventBase + XSyncAlarmNotify;
- ane.kind = XSyncAlarmNotify;
- ane.alarm = pAlarm->alarm_id;
- if (pTrigger->pSync && SYNC_COUNTER == pTrigger->pSync->type)
- {
- ane.counter_value_hi = XSyncValueHigh32(pCounter->value);
- ane.counter_value_lo = XSyncValueLow32(pCounter->value);
- }
- else
- { /* XXX what else can we do if there's no counter? */
- ane.counter_value_hi = ane.counter_value_lo = 0;
- }
-
- ane.alarm_value_hi = XSyncValueHigh32(pTrigger->test_value);
- ane.alarm_value_lo = XSyncValueLow32(pTrigger->test_value);
- ane.time = currentTime.milliseconds;
- ane.state = pAlarm->state;
-
- /* send to owner */
- if (pAlarm->events)
- WriteEventsToClient(pAlarm->client, 1, (xEvent *) &ane);
-
- /* send to other interested clients */
- for (pcl = pAlarm->pEventClients; pcl; pcl = pcl->next)
- WriteEventsToClient(pcl->client, 1, (xEvent *) &ane);
-}
-
-
-/* CounterNotify events only occur in response to an Await. The events
- * go only to the Awaiting client.
- */
-static void
-SyncSendCounterNotifyEvents(ClientPtr client, SyncAwait **ppAwait,
- int num_events)
-{
- xSyncCounterNotifyEvent *pEvents, *pev;
- int i;
-
- if (client->clientGone)
- return;
- pev = pEvents = malloc(num_events * sizeof(xSyncCounterNotifyEvent));
- if (!pEvents)
- return;
- UpdateCurrentTime();
- for (i = 0; i < num_events; i++, ppAwait++, pev++)
- {
- SyncTrigger *pTrigger = &(*ppAwait)->trigger;
- pev->type = SyncEventBase + XSyncCounterNotify;
- pev->kind = XSyncCounterNotify;
- pev->counter = pTrigger->pSync->id;
- pev->wait_value_lo = XSyncValueLow32(pTrigger->test_value);
- pev->wait_value_hi = XSyncValueHigh32(pTrigger->test_value);
- if (SYNC_COUNTER == pTrigger->pSync->type)
- {
- SyncCounter *pCounter = (SyncCounter *)pTrigger->pSync;
-
- pev->counter_value_lo = XSyncValueLow32(pCounter->value);
- pev->counter_value_hi = XSyncValueHigh32(pCounter->value);
- }
- else
- {
- pev->counter_value_lo = 0;
- pev->counter_value_hi = 0;
- }
-
- pev->time = currentTime.milliseconds;
- pev->count = num_events - i - 1; /* events remaining */
- pev->destroyed = pTrigger->pSync->beingDestroyed;
- }
- /* swapping will be taken care of by this */
- WriteEventsToClient(client, num_events, (xEvent *)pEvents);
- free(pEvents);
-}
-
-
-/* This function is called when an alarm's counter is destroyed.
- * It is plugged into pTrigger->CounterDestroyed (for alarm triggers).
- */
-static void
-SyncAlarmCounterDestroyed(SyncTrigger *pTrigger)
-{
- SyncAlarm *pAlarm = (SyncAlarm *)pTrigger;
-
- pAlarm->state = XSyncAlarmInactive;
- SyncSendAlarmNotifyEvents(pAlarm);
- pTrigger->pSync = NULL;
-}
-
-
-/* This function is called when an alarm "goes off."
- * It is plugged into pTrigger->TriggerFired (for alarm triggers).
- */
-static void
-SyncAlarmTriggerFired(SyncTrigger *pTrigger)
-{
- SyncAlarm *pAlarm = (SyncAlarm *)pTrigger;
- SyncCounter *pCounter;
- CARD64 new_test_value;
-
- if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_ALARM))
- return;
-
- pCounter = (SyncCounter *)pTrigger->pSync;
-
- /* no need to check alarm unless it's active */
- if (pAlarm->state != XSyncAlarmActive)
- return;
-
- /* " if the counter value is None, or if the delta is 0 and
- * the test-type is PositiveComparison or NegativeComparison,
- * no change is made to value (test-value) and the alarm
- * state is changed to Inactive before the event is generated."
- */
- if (pCounter == NULL
- || (XSyncValueIsZero(pAlarm->delta)
- && (pAlarm->trigger.test_type == XSyncPositiveComparison
- || pAlarm->trigger.test_type == XSyncNegativeComparison)))
- pAlarm->state = XSyncAlarmInactive;
-
- new_test_value = pAlarm->trigger.test_value;
-
- if (pAlarm->state == XSyncAlarmActive)
- {
- Bool overflow;
- CARD64 oldvalue;
- SyncTrigger *paTrigger = &pAlarm->trigger;
- SyncCounter *paCounter;
-
- if (!SyncCheckWarnIsCounter(paTrigger->pSync,
- WARN_INVALID_COUNTER_ALARM))
- return;
-
- paCounter = (SyncCounter *)pTrigger->pSync;
-
- /* "The alarm is updated by repeatedly adding delta to the
- * value of the trigger and re-initializing it until it
- * becomes FALSE."
- */
- oldvalue = paTrigger->test_value;
-
- /* XXX really should do something smarter here */
-
- do
- {
- XSyncValueAdd(&paTrigger->test_value, paTrigger->test_value,
- pAlarm->delta, &overflow);
- } while (!overflow &&
- (*paTrigger->CheckTrigger)(paTrigger,
- paCounter->value));
-
- new_test_value = paTrigger->test_value;
- paTrigger->test_value = oldvalue;
-
- /* "If this update would cause value to fall outside the range
- * for an INT64...no change is made to value (test-value) and
- * the alarm state is changed to Inactive before the event is
- * generated."
- */
- if (overflow)
- {
- new_test_value = oldvalue;
- pAlarm->state = XSyncAlarmInactive;
- }
- }
- /* The AlarmNotify event has to have the "new state of the alarm"
- * which we can't be sure of until this point. However, it has
- * to have the "old" trigger test value. That's the reason for
- * all the newvalue/oldvalue shuffling above. After we send the
- * events, give the trigger its new test value.
- */
- SyncSendAlarmNotifyEvents(pAlarm);
- pTrigger->test_value = new_test_value;
-}
-
-
-/* This function is called when an Await unblocks, either as a result
- * of the trigger firing OR the counter being destroyed.
- * It goes into pTrigger->TriggerFired AND pTrigger->CounterDestroyed
- * (for Await triggers).
- */
-static void
-SyncAwaitTriggerFired(SyncTrigger *pTrigger)
-{
- SyncAwait *pAwait = (SyncAwait *)pTrigger;
- int numwaits;
- SyncAwaitUnion *pAwaitUnion;
- SyncAwait **ppAwait;
- int num_events = 0;
-
- pAwaitUnion = (SyncAwaitUnion *)pAwait->pHeader;
- numwaits = pAwaitUnion->header.num_waitconditions;
- ppAwait = malloc(numwaits * sizeof(SyncAwait *));
- if (!ppAwait)
- goto bail;
-
- pAwait = &(pAwaitUnion+1)->await;
-
- /* "When a client is unblocked, all the CounterNotify events for
- * the Await request are generated contiguously. If count is 0
- * there are no more events to follow for this request. If
- * count is n, there are at least n more events to follow."
- *
- * Thus, it is best to find all the counters for which events
- * need to be sent first, so that an accurate count field can
- * be stored in the events.
- */
- for ( ; numwaits; numwaits--, pAwait++)
- {
- CARD64 diff;
- Bool overflow, diffgreater, diffequal;
-
- /* "A CounterNotify event with the destroyed flag set to TRUE is
- * always generated if the counter for one of the triggers is
- * destroyed."
- */
- if (pAwait->trigger.pSync->beingDestroyed)
- {
- ppAwait[num_events++] = pAwait;
- continue;
- }
-
- if (SYNC_COUNTER == pAwait->trigger.pSync->type)
- {
- SyncCounter *pCounter = (SyncCounter *) pAwait->trigger.pSync;
-
- /* "The difference between the counter and the test value is
- * calculated by subtracting the test value from the value of
- * the counter."
- */
- XSyncValueSubtract(&diff, pCounter->value,
- pAwait->trigger.test_value, &overflow);
-
- /* "If the difference lies outside the range for an INT64, an
- * event is not generated."
- */
- if (overflow)
- continue;
- diffgreater = XSyncValueGreaterThan(diff, pAwait->event_threshold);
- diffequal = XSyncValueEqual(diff, pAwait->event_threshold);
-
- /* "If the test-type is PositiveTransition or
- * PositiveComparison, a CounterNotify event is generated if
- * the difference is at least event-threshold. If the test-type
- * is NegativeTransition or NegativeComparison, a CounterNotify
- * event is generated if the difference is at most
- * event-threshold."
- */
-
- if ( ((pAwait->trigger.test_type == XSyncPositiveComparison ||
- pAwait->trigger.test_type == XSyncPositiveTransition)
- && (diffgreater || diffequal))
- ||
- ((pAwait->trigger.test_type == XSyncNegativeComparison ||
- pAwait->trigger.test_type == XSyncNegativeTransition)
- && (!diffgreater) /* less or equal */
- )
- )
- {
- ppAwait[num_events++] = pAwait;
- }
- }
- }
- if (num_events)
- SyncSendCounterNotifyEvents(pAwaitUnion->header.client, ppAwait,
- num_events);
- free(ppAwait);
-
-bail:
- /* unblock the client */
- AttendClient(pAwaitUnion->header.client);
- /* delete the await */
- FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
-}
-
-
-/* This function should always be used to change a counter's value so that
- * any triggers depending on the counter will be checked.
- */
-void
-SyncChangeCounter(SyncCounter *pCounter, CARD64 newval)
-{
- SyncTriggerList *ptl, *pnext;
- CARD64 oldval;
-
- oldval = pCounter->value;
- pCounter->value = newval;
-
- /* run through triggers to see if any become true */
- for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext)
- {
- pnext = ptl->next;
- if ((*ptl->pTrigger->CheckTrigger)(ptl->pTrigger, oldval))
- (*ptl->pTrigger->TriggerFired)(ptl->pTrigger);
- }
-
- if (IsSystemCounter(pCounter))
- {
- SyncComputeBracketValues(pCounter);
- }
-}
-
-
-/* loosely based on dix/events.c/EventSelectForWindow */
-static Bool
-SyncEventSelectForAlarm(SyncAlarm *pAlarm, ClientPtr client, Bool wantevents)
-{
- SyncAlarmClientList *pClients;
-
- if (client == pAlarm->client) /* alarm owner */
- {
- pAlarm->events = wantevents;
- return Success;
- }
-
- /* see if the client is already on the list (has events selected) */
-
- for (pClients = pAlarm->pEventClients; pClients;
- pClients = pClients->next)
- {
- if (pClients->client == client)
- {
- /* client's presence on the list indicates desire for
- * events. If the client doesn't want events, remove it
- * from the list. If the client does want events, do
- * nothing, since it's already got them.
- */
- if (!wantevents)
- {
- FreeResource(pClients->delete_id, RT_NONE);
- }
- return Success;
- }
- }
-
- /* if we get here, this client does not currently have
- * events selected on the alarm
- */
-
- if (!wantevents)
- /* client doesn't want events, and we just discovered that it
- * doesn't have them, so there's nothing to do.
- */
- return Success;
-
- /* add new client to pAlarm->pEventClients */
-
- pClients = malloc(sizeof(SyncAlarmClientList));
- if (!pClients)
- return BadAlloc;
-
- /* register it as a resource so it will be cleaned up
- * if the client dies
- */
-
- pClients->delete_id = FakeClientID(client->index);
-
- /* link it into list after we know all the allocations succeed */
- pClients->next = pAlarm->pEventClients;
- pAlarm->pEventClients = pClients;
- pClients->client = client;
-
- if (!AddResource(pClients->delete_id, RTAlarmClient, pAlarm))
- return BadAlloc;
-
- return Success;
-}
-
-/*
- * ** SyncChangeAlarmAttributes ** This is used by CreateAlarm and ChangeAlarm
- */
-static int
-SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm *pAlarm, Mask mask,
- CARD32 *values)
-{
- int status;
- XSyncCounter counter;
- Mask origmask = mask;
-
- counter =
- pAlarm->trigger.pSync ? pAlarm->trigger.pSync->id : None;
-
- while (mask)
- {
- int index2 = lowbit(mask);
- mask &= ~index2;
- switch (index2)
- {
- case XSyncCACounter:
- mask &= ~XSyncCACounter;
- /* sanity check in SyncInitTrigger */
- counter = *values++;
- break;
-
- case XSyncCAValueType:
- mask &= ~XSyncCAValueType;
- /* sanity check in SyncInitTrigger */
- pAlarm->trigger.value_type = *values++;
- break;
-
- case XSyncCAValue:
- mask &= ~XSyncCAValue;
- XSyncIntsToValue(&pAlarm->trigger.wait_value, values[1], values[0]);
- values += 2;
- break;
-
- case XSyncCATestType:
- mask &= ~XSyncCATestType;
- /* sanity check in SyncInitTrigger */
- pAlarm->trigger.test_type = *values++;
- break;
-
- case XSyncCADelta:
- mask &= ~XSyncCADelta;
- XSyncIntsToValue(&pAlarm->delta, values[1], values[0]);
- values += 2;
- break;
-
- case XSyncCAEvents:
- mask &= ~XSyncCAEvents;
- if ((*values != xTrue) && (*values != xFalse))
- {
- client->errorValue = *values;
- return BadValue;
- }
- status = SyncEventSelectForAlarm(pAlarm, client,
- (Bool)(*values++));
- if (status != Success)
- return status;
- break;
-
- default:
- client->errorValue = mask;
- return BadValue;
- }
- }
-
- /* "If the test-type is PositiveComparison or PositiveTransition
- * and delta is less than zero, or if the test-type is
- * NegativeComparison or NegativeTransition and delta is
- * greater than zero, a Match error is generated."
- */
- if (origmask & (XSyncCADelta|XSyncCATestType))
- {
- CARD64 zero;
- XSyncIntToValue(&zero, 0);
- if ((((pAlarm->trigger.test_type == XSyncPositiveComparison) ||
- (pAlarm->trigger.test_type == XSyncPositiveTransition))
- && XSyncValueLessThan(pAlarm->delta, zero))
- ||
- (((pAlarm->trigger.test_type == XSyncNegativeComparison) ||
- (pAlarm->trigger.test_type == XSyncNegativeTransition))
- && XSyncValueGreaterThan(pAlarm->delta, zero))
- )
- {
- return BadMatch;
- }
- }
-
- /* postpone this until now, when we're sure nothing else can go wrong */
- if ((status = SyncInitTrigger(client, &pAlarm->trigger, counter, RTCounter,
- origmask & XSyncCAAllTrigger)) != Success)
- return status;
-
- /* XXX spec does not really say to do this - needs clarification */
- pAlarm->state = XSyncAlarmActive;
- return Success;
-}
-
-static SyncObject *
-SyncCreate(ClientPtr client, XID id, unsigned char type)
-{
- SyncObject *pSync;
-
- switch (type) {
- case SYNC_COUNTER:
- pSync = malloc(sizeof(SyncCounter));
- break;
- case SYNC_FENCE:
- pSync = (SyncObject*)dixAllocateObjectWithPrivates(SyncFence,
- PRIVATE_SYNC_FENCE);
- break;
- default:
- return NULL;
- }
-
- if (!pSync)
- return NULL;
-
- pSync->client = client;
- pSync->id = id;
- pSync->pTriglist = NULL;
- pSync->beingDestroyed = FALSE;
- pSync->type = type;
-
- return pSync;
-}
-
-
-static SyncCounter *
-SyncCreateCounter(ClientPtr client, XSyncCounter id, CARD64 initialvalue)
-{
- SyncCounter *pCounter;
-
- if (!(pCounter = (SyncCounter *)SyncCreate(client,
- id,
- SYNC_COUNTER)))
- return NULL;
-
- pCounter->value = initialvalue;
- pCounter->pSysCounterInfo = NULL;
-
- if (!AddResource(id, RTCounter, (pointer) pCounter))
- return NULL;
-
- return pCounter;
-}
-
-static int FreeCounter(void *, XID);
-
-/*
- * ***** System Counter utilities
- */
-
-pointer
-SyncCreateSystemCounter(
- char *name,
- CARD64 initial,
- CARD64 resolution,
- SyncCounterType counterType,
- void (*QueryValue)(pointer /* pCounter */,
- CARD64 * /* pValue_return */),
- void (*BracketValues)(pointer /* pCounter */,
- CARD64 * /* pbracket_less */,
- CARD64 * /* pbracket_greater */)
- )
-{
- SyncCounter *pCounter;
-
- SysCounterList = realloc(SysCounterList,
- (SyncNumSystemCounters+1)*sizeof(SyncCounter *));
- if (!SysCounterList)
- return NULL;
-
- /* this function may be called before SYNC has been initialized, so we
- * have to make sure RTCounter is created.
- */
- if (RTCounter == 0)
- {
- RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter");
- if (RTCounter == 0)
- {
- return NULL;
- }
- }
-
- pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial);
-
- if (pCounter)
- {
- SysCounterInfo *psci;
-
- psci = malloc(sizeof(SysCounterInfo));
- if (!psci)
- {
- FreeResource(pCounter->sync.id, RT_NONE);
- return pCounter;
- }
- pCounter->pSysCounterInfo = psci;
- psci->name = name;
- psci->resolution = resolution;
- psci->counterType = counterType;
- psci->QueryValue = QueryValue;
- psci->BracketValues = BracketValues;
- XSyncMaxValue(&psci->bracket_greater);
- XSyncMinValue(&psci->bracket_less);
- SysCounterList[SyncNumSystemCounters++] = pCounter;
- }
- return pCounter;
-}
-
-void
-SyncDestroySystemCounter(pointer pSysCounter)
-{
- SyncCounter *pCounter = (SyncCounter *)pSysCounter;
- FreeResource(pCounter->sync.id, RT_NONE);
-}
-
-static void
-SyncComputeBracketValues(SyncCounter *pCounter)
-{
- SyncTriggerList *pCur;
- SyncTrigger *pTrigger;
- SysCounterInfo *psci;
- CARD64 *pnewgtval = NULL;
- CARD64 *pnewltval = NULL;
- SyncCounterType ct;
-
- if (!pCounter)
- return;
-
- psci = pCounter->pSysCounterInfo;
- ct = pCounter->pSysCounterInfo->counterType;
- if (ct == XSyncCounterNeverChanges)
- return;
-
- XSyncMaxValue(&psci->bracket_greater);
- XSyncMinValue(&psci->bracket_less);
-
- for (pCur = pCounter->sync.pTriglist; pCur; pCur = pCur->next)
- {
- pTrigger = pCur->pTrigger;
-
- if (pTrigger->test_type == XSyncPositiveComparison &&
- ct != XSyncCounterNeverIncreases)
- {
- if (XSyncValueLessThan(pCounter->value, pTrigger->test_value) &&
- XSyncValueLessThan(pTrigger->test_value,
- psci->bracket_greater))
- {
- psci->bracket_greater = pTrigger->test_value;
- pnewgtval = &psci->bracket_greater;
- }
- }
- else if (pTrigger->test_type == XSyncNegativeComparison &&
- ct != XSyncCounterNeverDecreases)
- {
- if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) &&
- XSyncValueGreaterThan(pTrigger->test_value,
- psci->bracket_less))
- {
- psci->bracket_less = pTrigger->test_value;
- pnewltval = &psci->bracket_less;
- }
- }
- else if (pTrigger->test_type == XSyncNegativeTransition &&
- ct != XSyncCounterNeverIncreases)
- {
- if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) &&
- XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less))
- {
- psci->bracket_less = pTrigger->test_value;
- pnewltval = &psci->bracket_less;
- } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
- XSyncValueLessThan(pTrigger->test_value,
- psci->bracket_greater))
- {
- /*
- * The value is exactly equal to our threshold. We want one
- * more event in the positive direction to ensure we pick up
- * when the value *exceeds* this threshold.
- */
- psci->bracket_greater = pTrigger->test_value;
- pnewgtval = &psci->bracket_greater;
- }
- }
- else if (pTrigger->test_type == XSyncPositiveTransition &&
- ct != XSyncCounterNeverDecreases)
- {
- if (XSyncValueLessThan(pCounter->value, pTrigger->test_value) &&
- XSyncValueLessThan(pTrigger->test_value, psci->bracket_greater))
- {
- psci->bracket_greater = pTrigger->test_value;
- pnewgtval = &psci->bracket_greater;
- } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
- XSyncValueGreaterThan(pTrigger->test_value,
- psci->bracket_less))
- {
- /*
- * The value is exactly equal to our threshold. We want one
- * more event in the negative direction to ensure we pick up
- * when the value is less than this threshold.
- */
- psci->bracket_less = pTrigger->test_value;
- pnewltval = &psci->bracket_less;
- }
- }
- } /* end for each trigger */
-
- if (pnewgtval || pnewltval)
- {
- (*psci->BracketValues)((pointer)pCounter, pnewltval, pnewgtval);
- }
-}
-
-/*
- * ***** Resource delete functions
- */
-
-/* ARGSUSED */
-static int
-FreeAlarm(void *addr, XID id)
-{
- SyncAlarm *pAlarm = (SyncAlarm *) addr;
-
- pAlarm->state = XSyncAlarmDestroyed;
-
- SyncSendAlarmNotifyEvents(pAlarm);
-
- /* delete event selections */
-
- while (pAlarm->pEventClients)
- FreeResource(pAlarm->pEventClients->delete_id, RT_NONE);
-
- SyncDeleteTriggerFromSyncObject(&pAlarm->trigger);
-
- free(pAlarm);
- return Success;
-}
-
-
-/*
- * ** Cleanup after the destruction of a Counter
- */
-/* ARGSUSED */
-static int
-FreeCounter(void *env, XID id)
-{
- SyncCounter *pCounter = (SyncCounter *) env;
- SyncTriggerList *ptl, *pnext;
-
- pCounter->sync.beingDestroyed = TRUE;
- /* tell all the counter's triggers that the counter has been destroyed */
- for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext)
- {
- (*ptl->pTrigger->CounterDestroyed)(ptl->pTrigger);
- pnext = ptl->next;
- free(ptl); /* destroy the trigger list as we go */
- }
- if (IsSystemCounter(pCounter))
- {
- int i, found = 0;
-
- free(pCounter->pSysCounterInfo);
-
- /* find the counter in the list of system counters and remove it */
-
- if (SysCounterList)
- {
- for (i = 0; i < SyncNumSystemCounters; i++)
- {
- if (SysCounterList[i] == pCounter)
- {
- found = i;
- break;
- }
- }
- if (found < (SyncNumSystemCounters-1))
- {
- for (i = found; i < SyncNumSystemCounters-1; i++)
- {
- SysCounterList[i] = SysCounterList[i+1];
- }
- }
- }
- SyncNumSystemCounters--;
- }
- free(pCounter);
- return Success;
-}
-
-/*
- * ** Cleanup after Await
- */
-/* ARGSUSED */
-static int
-FreeAwait(void *addr, XID id)
-{
- SyncAwaitUnion *pAwaitUnion = (SyncAwaitUnion *) addr;
- SyncAwait *pAwait;
- int numwaits;
-
- pAwait = &(pAwaitUnion+1)->await; /* first await on list */
-
- /* remove triggers from counters */
-
- for (numwaits = pAwaitUnion->header.num_waitconditions; numwaits;
- numwaits--, pAwait++)
- {
- /* If the counter is being destroyed, FreeCounter will delete
- * the trigger list itself, so don't do it here.
- */
- SyncObject *pSync = pAwait->trigger.pSync;
- if (pSync && !pSync->beingDestroyed)
- SyncDeleteTriggerFromSyncObject(&pAwait->trigger);
- }
- free(pAwaitUnion);
- return Success;
-}
-
-#ifdef _MSC_VER
-#pragma warning(disable:4715) /* Not all control paths return a value */
-#endif
-
-/* loosely based on dix/events.c/OtherClientGone */
-static int
-FreeAlarmClient(void *value, XID id)
-{
- SyncAlarm *pAlarm = (SyncAlarm *)value;
- SyncAlarmClientList *pCur, *pPrev;
-
- for (pPrev = NULL, pCur = pAlarm->pEventClients;
- pCur;
- pPrev = pCur, pCur = pCur->next)
- {
- if (pCur->delete_id == id)
- {
- if (pPrev)
- pPrev->next = pCur->next;
- else
- pAlarm->pEventClients = pCur->next;
- free(pCur);
- return Success;
- }
- }
- FatalError("alarm client not on event list");
- /*NOTREACHED*/
-}
-
-
-/*
- * ***** Proc functions
- */
-
-
-/*
- * ** Initialize the extension
- */
-static int
-ProcSyncInitialize(ClientPtr client)
-{
- xSyncInitializeReply rep;
- int n;
-
- REQUEST_SIZE_MATCH(xSyncInitializeReq);
-
- memset(&rep, 0, sizeof(xSyncInitializeReply));
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = SERVER_SYNC_MAJOR_VERSION;
- rep.minorVersion = SERVER_SYNC_MINOR_VERSION;
- rep.length = 0;
-
- if (client->swapped)
- {
- swaps(&rep.sequenceNumber, n);
- }
- WriteToClient(client, sizeof(rep), (char *) &rep);
- return Success;
-}
-
-/*
- * ** Get list of system counters available through the extension
- */
-static int
-ProcSyncListSystemCounters(ClientPtr client)
-{
- xSyncListSystemCountersReply rep;
- int i, len;
- xSyncSystemCounter *list = NULL, *walklist = NULL;
-
- REQUEST_SIZE_MATCH(xSyncListSystemCountersReq);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.nCounters = SyncNumSystemCounters;
-
- for (i = len = 0; i < SyncNumSystemCounters; i++)
- {
- char *name = SysCounterList[i]->pSysCounterInfo->name;
- /* pad to 4 byte boundary */
- len += pad_to_int32(sz_xSyncSystemCounter + strlen(name));
- }
-
- if (len)
- {
- walklist = list = malloc(len);
- if (!list)
- return BadAlloc;
- }
-
- rep.length = bytes_to_int32(len);
-
- if (client->swapped)
- {
- char n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.nCounters, n);
- }
-
- for (i = 0; i < SyncNumSystemCounters; i++)
- {
- int namelen;
- char *pname_in_reply;
- SysCounterInfo *psci = SysCounterList[i]->pSysCounterInfo;
-
- walklist->counter = SysCounterList[i]->sync.id;
- walklist->resolution_hi = XSyncValueHigh32(psci->resolution);
- walklist->resolution_lo = XSyncValueLow32(psci->resolution);
- namelen = strlen(psci->name);
- walklist->name_length = namelen;
-
- if (client->swapped)
- {
- char n;
- swapl(&walklist->counter, n);
- swapl(&walklist->resolution_hi, n);
- swapl(&walklist->resolution_lo, n);
- swaps(&walklist->name_length, n);
- }
-
- pname_in_reply = ((char *)walklist) + sz_xSyncSystemCounter;
- strncpy(pname_in_reply, psci->name, namelen);
- walklist = (xSyncSystemCounter *) (((char *)walklist) +
- pad_to_int32(sz_xSyncSystemCounter + namelen));
- }
-
- WriteToClient(client, sizeof(rep), (char *) &rep);
- if (len)
- {
- WriteToClient(client, len, (char *) list);
- free(list);
- }
-
- return Success;
-}
-
-/*
- * ** Set client Priority
- */
-static int
-ProcSyncSetPriority(ClientPtr client)
-{
- REQUEST(xSyncSetPriorityReq);
- ClientPtr priorityclient;
- int rc;
-
- REQUEST_SIZE_MATCH(xSyncSetPriorityReq);
-
- if (stuff->id == None)
- priorityclient = client;
- else {
- rc = dixLookupClient(&priorityclient, stuff->id, client,
- DixSetAttrAccess);
- if (rc != Success)
- return rc;
- }
-
- if (priorityclient->priority != stuff->priority)
- {
- priorityclient->priority = stuff->priority;
-
- /* The following will force the server back into WaitForSomething
- * so that the change in this client's priority is immediately
- * reflected.
- */
- isItTimeToYield = TRUE;
- dispatchException |= DE_PRIORITYCHANGE;
- }
- return Success;
-}
-
-/*
- * ** Get client Priority
- */
-static int
-ProcSyncGetPriority(ClientPtr client)
-{
- REQUEST(xSyncGetPriorityReq);
- xSyncGetPriorityReply rep;
- ClientPtr priorityclient;
- int rc;
-
- REQUEST_SIZE_MATCH(xSyncGetPriorityReq);
-
- if (stuff->id == None)
- priorityclient = client;
- else {
- rc = dixLookupClient(&priorityclient, stuff->id, client,
- DixGetAttrAccess);
- if (rc != Success)
- return rc;
- }
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.priority = priorityclient->priority;
-
- if (client->swapped)
- {
- char n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.priority, n);
- }
-
- WriteToClient(client, sizeof(xSyncGetPriorityReply), (char *) &rep);
-
- return Success;
-}
-
-/*
- * ** Create a new counter
- */
-static int
-ProcSyncCreateCounter(ClientPtr client)
-{
- REQUEST(xSyncCreateCounterReq);
- CARD64 initial;
-
- REQUEST_SIZE_MATCH(xSyncCreateCounterReq);
-
- LEGAL_NEW_RESOURCE(stuff->cid, client);
-
- XSyncIntsToValue(&initial, stuff->initial_value_lo, stuff->initial_value_hi);
- if (!SyncCreateCounter(client, stuff->cid, initial))
- return BadAlloc;
-
- return Success;
-}
-
-/*
- * ** Set Counter value
- */
-static int
-ProcSyncSetCounter(ClientPtr client)
-{
- REQUEST(xSyncSetCounterReq);
- SyncCounter *pCounter;
- CARD64 newvalue;
- int rc;
-
- REQUEST_SIZE_MATCH(xSyncSetCounterReq);
-
- rc = dixLookupResourceByType((pointer *)&pCounter, stuff->cid, RTCounter,
- client, DixWriteAccess);
- if (rc != Success)
- return rc;
-
- if (IsSystemCounter(pCounter))
- {
- client->errorValue = stuff->cid;
- return BadAccess;
- }
-
- XSyncIntsToValue(&newvalue, stuff->value_lo, stuff->value_hi);
- SyncChangeCounter(pCounter, newvalue);
- return Success;
-}
-
-/*
- * ** Change Counter value
- */
-static int
-ProcSyncChangeCounter(ClientPtr client)
-{
- REQUEST(xSyncChangeCounterReq);
- SyncCounter *pCounter;
- CARD64 newvalue;
- Bool overflow;
- int rc;
-
- REQUEST_SIZE_MATCH(xSyncChangeCounterReq);
-
- rc = dixLookupResourceByType((pointer *)&pCounter, stuff->cid, RTCounter,
- client, DixWriteAccess);
- if (rc != Success)
- return rc;
-
- if (IsSystemCounter(pCounter))
- {
- client->errorValue = stuff->cid;
- return BadAccess;
- }
-
- XSyncIntsToValue(&newvalue, stuff->value_lo, stuff->value_hi);
- XSyncValueAdd(&newvalue, pCounter->value, newvalue, &overflow);
- if (overflow)
- {
- /* XXX 64 bit value can't fit in 32 bits; do the best we can */
- client->errorValue = stuff->value_hi;
- return BadValue;
- }
- SyncChangeCounter(pCounter, newvalue);
- return Success;
-}
-
-/*
- * ** Destroy a counter
- */
-static int
-ProcSyncDestroyCounter(ClientPtr client)
-{
- REQUEST(xSyncDestroyCounterReq);
- SyncCounter *pCounter;
- int rc;
-
- REQUEST_SIZE_MATCH(xSyncDestroyCounterReq);
-
- rc = dixLookupResourceByType((pointer *)&pCounter, stuff->counter, RTCounter,
- client, DixDestroyAccess);
- if (rc != Success)
- return rc;
-
- if (IsSystemCounter(pCounter))
- {
- client->errorValue = stuff->counter;
- return BadAccess;
- }
- FreeResource(pCounter->sync.id, RT_NONE);
- return Success;
-}
-
-static SyncAwaitUnion*
-SyncAwaitPrologue(ClientPtr client, int items)
-{
- SyncAwaitUnion *pAwaitUnion;
-
- /* all the memory for the entire await list is allocated
- * here in one chunk
- */
- pAwaitUnion = malloc((items+1) * sizeof(SyncAwaitUnion));
- if (!pAwaitUnion)
- return NULL;
-
- /* first item is the header, remainder are real wait conditions */
-
- pAwaitUnion->header.delete_id = FakeClientID(client->index);
- pAwaitUnion->header.client = client;
- pAwaitUnion->header.num_waitconditions = 0;
-
- if (!AddResource(pAwaitUnion->header.delete_id, RTAwait, pAwaitUnion))
- return NULL;
-
- return pAwaitUnion;
-}
-
-static void
-SyncAwaitEpilogue(ClientPtr client, int items, SyncAwaitUnion *pAwaitUnion)
-{
- SyncAwait *pAwait;
- int i;
-
- IgnoreClient(client);
-
- /* see if any of the triggers are already true */
-
- pAwait = &(pAwaitUnion+1)->await; /* skip over header */
- for (i = 0; i < items; i++, pAwait++)
- {
- CARD64 value;
-
- /* don't have to worry about NULL counters because the request
- * errors before we get here out if they occur
- */
- switch (pAwait->trigger.pSync->type) {
- case SYNC_COUNTER:
- value = ((SyncCounter *)pAwait->trigger.pSync)->value;
- break;
- default:
- XSyncIntToValue(&value, 0);
- }
-
- if ((*pAwait->trigger.CheckTrigger)(&pAwait->trigger, value))
- {
- (*pAwait->trigger.TriggerFired)(&pAwait->trigger);
- break; /* once is enough */
- }
- }
-}
-
-/*
- * ** Await
- */
-static int
-ProcSyncAwait(ClientPtr client)
-{
- REQUEST(xSyncAwaitReq);
- int len, items;
- int i;
- xSyncWaitCondition *pProtocolWaitConds;
- SyncAwaitUnion *pAwaitUnion;
- SyncAwait *pAwait;
- int status;
-
- REQUEST_AT_LEAST_SIZE(xSyncAwaitReq);
-
- len = client->req_len << 2;
- len -= sz_xSyncAwaitReq;
- items = len / sz_xSyncWaitCondition;
-
- if (items * sz_xSyncWaitCondition != len)
- {
- return BadLength;
- }
- if (items == 0)
- {
- client->errorValue = items; /* XXX protocol change */
- return BadValue;
- }
-
- if (!(pAwaitUnion = SyncAwaitPrologue(client, items)))
- return BadAlloc;
-
- /* don't need to do any more memory allocation for this request! */
-
- pProtocolWaitConds = (xSyncWaitCondition *) & stuff[1];
-
- pAwait = &(pAwaitUnion+1)->await; /* skip over header */
- for (i = 0; i < items; i++, pProtocolWaitConds++, pAwait++)
- {
- if (pProtocolWaitConds->counter == None) /* XXX protocol change */
- {
- /* this should take care of removing any triggers created by
- * this request that have already been registered on sync objects
- */
- FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
- client->errorValue = pProtocolWaitConds->counter;
- return SyncErrorBase + XSyncBadCounter;
- }
-
- /* sanity checks are in SyncInitTrigger */
- pAwait->trigger.pSync = NULL;
- pAwait->trigger.value_type = pProtocolWaitConds->value_type;
- XSyncIntsToValue(&pAwait->trigger.wait_value,
- pProtocolWaitConds->wait_value_lo,
- pProtocolWaitConds->wait_value_hi);
- pAwait->trigger.test_type = pProtocolWaitConds->test_type;
-
- status = SyncInitTrigger(client, &pAwait->trigger,
- pProtocolWaitConds->counter, RTCounter,
- XSyncCAAllTrigger);
- if (status != Success)
- {
- /* this should take care of removing any triggers created by
- * this request that have already been registered on sync objects
- */
- FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
- return status;
- }
- /* this is not a mistake -- same function works for both cases */
- pAwait->trigger.TriggerFired = SyncAwaitTriggerFired;
- pAwait->trigger.CounterDestroyed = SyncAwaitTriggerFired;
- XSyncIntsToValue(&pAwait->event_threshold,
- pProtocolWaitConds->event_threshold_lo,
- pProtocolWaitConds->event_threshold_hi);
- pAwait->pHeader = &pAwaitUnion->header;
- pAwaitUnion->header.num_waitconditions++;
- }
-
- SyncAwaitEpilogue(client, items, pAwaitUnion);
-
- return Success;
-}
-
-
-/*
- * ** Query a counter
- */
-static int
-ProcSyncQueryCounter(ClientPtr client)
-{
- REQUEST(xSyncQueryCounterReq);
- xSyncQueryCounterReply rep;
- SyncCounter *pCounter;
- int rc;
-
- REQUEST_SIZE_MATCH(xSyncQueryCounterReq);
-
- rc = dixLookupResourceByType((pointer *)&pCounter, stuff->counter,
- RTCounter, client, DixReadAccess);
- if (rc != Success)
- return rc;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- /* if system counter, ask it what the current value is */
-
- if (IsSystemCounter(pCounter))
- {
- (*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter,
- &pCounter->value);
- }
-
- rep.value_hi = XSyncValueHigh32(pCounter->value);
- rep.value_lo = XSyncValueLow32(pCounter->value);
- if (client->swapped)
- {
- char n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.value_hi, n);
- swapl(&rep.value_lo, n);
- }
- WriteToClient(client, sizeof(xSyncQueryCounterReply), (char *) &rep);
- return Success;
-}
-
-
-/*
- * ** Create Alarm
- */
-static int
-ProcSyncCreateAlarm(ClientPtr client)
-{
- REQUEST(xSyncCreateAlarmReq);
- SyncAlarm *pAlarm;
- int status;
- unsigned long len, vmask;
- SyncTrigger *pTrigger;
-
- REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq);
-
- LEGAL_NEW_RESOURCE(stuff->id, client);
-
- vmask = stuff->valueMask;
- len = client->req_len - bytes_to_int32(sizeof(xSyncCreateAlarmReq));
- /* the "extra" call to Ones accounts for the presence of 64 bit values */
- if (len != (Ones(vmask) + Ones(vmask & (XSyncCAValue|XSyncCADelta))))
- return BadLength;
-
- if (!(pAlarm = malloc(sizeof(SyncAlarm))))
- {
- return BadAlloc;
- }
-
- /* set up defaults */
-
- pTrigger = &pAlarm->trigger;
- pTrigger->pSync = NULL;
- pTrigger->value_type = XSyncAbsolute;
- XSyncIntToValue(&pTrigger->wait_value, 0L);
- pTrigger->test_type = XSyncPositiveComparison;
- pTrigger->TriggerFired = SyncAlarmTriggerFired;
- pTrigger->CounterDestroyed = SyncAlarmCounterDestroyed;
- status = SyncInitTrigger(client, pTrigger, None, RTCounter,
- XSyncCAAllTrigger);
- if (status != Success)
- {
- free(pAlarm);
- return status;
- }
-
- pAlarm->client = client;
- pAlarm->alarm_id = stuff->id;
- XSyncIntToValue(&pAlarm->delta, 1L);
- pAlarm->events = TRUE;
- pAlarm->state = XSyncAlarmInactive;
- pAlarm->pEventClients = NULL;
- status = SyncChangeAlarmAttributes(client, pAlarm, vmask,
- (CARD32 *)&stuff[1]);
- if (status != Success)
- {
- free(pAlarm);
- return status;
- }
-
- if (!AddResource(stuff->id, RTAlarm, pAlarm))
- return BadAlloc;
-
- /* see if alarm already triggered. NULL counter will not trigger
- * in CreateAlarm and sets alarm state to Inactive.
- */
-
- if (!pTrigger->pSync)
- {
- pAlarm->state = XSyncAlarmInactive; /* XXX protocol change */
- }
- else
- {
- SyncCounter *pCounter;
-
- if (!SyncCheckWarnIsCounter(pTrigger->pSync,
- WARN_INVALID_COUNTER_ALARM))
- {
- FreeResource(stuff->id, RT_NONE);
- return BadAlloc;
- }
-
- pCounter = (SyncCounter *)pTrigger->pSync;
-
- if ((*pTrigger->CheckTrigger)(pTrigger, pCounter->value))
- (*pTrigger->TriggerFired)(pTrigger);
- }
-
- return Success;
-}
-
-/*
- * ** Change Alarm
- */
-static int
-ProcSyncChangeAlarm(ClientPtr client)
-{
- REQUEST(xSyncChangeAlarmReq);
- SyncAlarm *pAlarm;
- SyncCounter *pCounter = NULL;
- long vmask;
- int len, status;
-
- REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
-
- status = dixLookupResourceByType((pointer *)&pAlarm, stuff->alarm, RTAlarm,
- client, DixWriteAccess);
- if (status != Success)
- return status;
-
- vmask = stuff->valueMask;
- len = client->req_len - bytes_to_int32(sizeof(xSyncChangeAlarmReq));
- /* the "extra" call to Ones accounts for the presence of 64 bit values */
- if (len != (Ones(vmask) + Ones(vmask & (XSyncCAValue|XSyncCADelta))))
- return BadLength;
-
- if ((status = SyncChangeAlarmAttributes(client, pAlarm, vmask,
- (CARD32 *)&stuff[1])) != Success)
- return status;
-
- if (SyncCheckWarnIsCounter(pAlarm->trigger.pSync,
- WARN_INVALID_COUNTER_ALARM))
- pCounter = (SyncCounter *)pAlarm->trigger.pSync;
-
- /* see if alarm already triggered. NULL counter WILL trigger
- * in ChangeAlarm.
- */
-
- if (!pCounter ||
- (*pAlarm->trigger.CheckTrigger)(&pAlarm->trigger, pCounter->value))
- {
- (*pAlarm->trigger.TriggerFired)(&pAlarm->trigger);
- }
- return Success;
-}
-
-static int
-ProcSyncQueryAlarm(ClientPtr client)
-{
- REQUEST(xSyncQueryAlarmReq);
- SyncAlarm *pAlarm;
- xSyncQueryAlarmReply rep;
- SyncTrigger *pTrigger;
- int rc;
-
- REQUEST_SIZE_MATCH(xSyncQueryAlarmReq);
-
- rc = dixLookupResourceByType((pointer *)&pAlarm, stuff->alarm, RTAlarm,
- client, DixReadAccess);
- if (rc != Success)
- return rc;
-
- rep.type = X_Reply;
- rep.length = bytes_to_int32(sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply));
- rep.sequenceNumber = client->sequence;
-
- pTrigger = &pAlarm->trigger;
- rep.counter = (pTrigger->pSync) ? pTrigger->pSync->id : None;
-
-#if 0 /* XXX unclear what to do, depends on whether relative value-types
- * are "consumed" immediately and are considered absolute from then
- * on.
- */
- rep.value_type = pTrigger->value_type;
- rep.wait_value_hi = XSyncValueHigh32(pTrigger->wait_value);
- rep.wait_value_lo = XSyncValueLow32(pTrigger->wait_value);
-#else
- rep.value_type = XSyncAbsolute;
- rep.wait_value_hi = XSyncValueHigh32(pTrigger->test_value);
- rep.wait_value_lo = XSyncValueLow32(pTrigger->test_value);
-#endif
-
- rep.test_type = pTrigger->test_type;
- rep.delta_hi = XSyncValueHigh32(pAlarm->delta);
- rep.delta_lo = XSyncValueLow32(pAlarm->delta);
- rep.events = pAlarm->events;
- rep.state = pAlarm->state;
-
- if (client->swapped)
- {
- char n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.counter, n);
- swapl(&rep.wait_value_hi, n);
- swapl(&rep.wait_value_lo, n);
- swapl(&rep.test_type, n);
- swapl(&rep.delta_hi, n);
- swapl(&rep.delta_lo, n);
- }
-
- WriteToClient(client, sizeof(xSyncQueryAlarmReply), (char *) &rep);
- return Success;
-}
-
-static int
-ProcSyncDestroyAlarm(ClientPtr client)
-{
- SyncAlarm *pAlarm;
- int rc;
- REQUEST(xSyncDestroyAlarmReq);
-
- REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq);
-
- rc = dixLookupResourceByType((pointer *)&pAlarm, stuff->alarm, RTAlarm,
- client, DixDestroyAccess);
- if (rc != Success)
- return rc;
-
- FreeResource(stuff->alarm, RT_NONE);
- return Success;
-}
-
-static int
-ProcSyncCreateFence(ClientPtr client)
-{
- REQUEST(xSyncCreateFenceReq);
- DrawablePtr pDraw;
- SyncFence *pFence;
- int rc;
-
- REQUEST_SIZE_MATCH(xSyncCreateFenceReq);
-
- rc = dixLookupDrawable(&pDraw, stuff->d, client, M_ANY, DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
- LEGAL_NEW_RESOURCE(stuff->fid, client);
-
- if (!(pFence = (SyncFence *)SyncCreate(client,
- stuff->fid,
- SYNC_FENCE)))
- return BadAlloc;
-
- miSyncInitFence(pDraw->pScreen, pFence, stuff->initially_triggered);
-
- if (!AddResource(stuff->fid, RTFence, (pointer) pFence))
- return BadAlloc;
-
- return client->noClientException;
-}
-
-static int
-FreeFence(void *obj, XID id)
-{
- SyncFence *pFence = (SyncFence *) obj;
-
- miSyncDestroyFence(pFence);
-
- return Success;
-}
-
-int SyncVerifyFence(SyncFence **ppSyncFence, XID fid,
- ClientPtr client, Mask mode)
-{
- int rc = dixLookupResourceByType((pointer *)ppSyncFence, fid, RTFence,
- client, mode);
-
- if (rc != Success)
- client->errorValue = fid;
-
- return rc;
-}
-
-static int
-ProcSyncTriggerFence(ClientPtr client)
-{
- REQUEST(xSyncTriggerFenceReq);
- SyncFence *pFence;
- int rc;
-
- REQUEST_SIZE_MATCH(xSyncTriggerFenceReq);
-
- rc = dixLookupResourceByType((pointer *)&pFence, stuff->fid, RTFence,
- client, DixWriteAccess);
- if (rc != Success)
- return rc;
-
- miSyncTriggerFence(pFence);
-
- return client->noClientException;
-}
-
-static int
-ProcSyncResetFence(ClientPtr client)
-{
- REQUEST(xSyncResetFenceReq);
- SyncFence *pFence;
- int rc;
-
- REQUEST_SIZE_MATCH(xSyncResetFenceReq);
-
- rc = dixLookupResourceByType((pointer *)&pFence, stuff->fid, RTFence,
- client, DixWriteAccess);
- if (rc != Success)
- return rc;
-
- if (pFence->funcs.CheckTriggered(pFence) != TRUE)
- return BadMatch;
-
- pFence->funcs.Reset(pFence);
-
- return client->noClientException;
-}
-
-static int
-ProcSyncDestroyFence(ClientPtr client)
-{
- REQUEST(xSyncDestroyFenceReq);
- SyncFence *pFence;
- int rc;
-
- REQUEST_SIZE_MATCH(xSyncDestroyFenceReq);
-
- rc = dixLookupResourceByType((pointer *)&pFence, stuff->fid, RTFence,
- client, DixDestroyAccess);
- if (rc != Success)
- return rc;
-
- FreeResource(stuff->fid, RT_NONE);
- return client->noClientException;
-}
-
-static int
-ProcSyncQueryFence(ClientPtr client)
-{
- REQUEST(xSyncQueryFenceReq);
- xSyncQueryFenceReply rep;
- SyncFence *pFence;
- int rc;
-
- REQUEST_SIZE_MATCH(xSyncQueryFenceReq);
-
- rc = dixLookupResourceByType((pointer *)&pFence, stuff->fid,
- RTFence, client, DixReadAccess);
- if (rc != Success)
- return rc;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- rep.triggered = pFence->funcs.CheckTriggered(pFence);
-
- if (client->swapped)
- {
- char n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- }
-
- WriteToClient(client, sizeof(xSyncQueryFenceReply), (char *) &rep);
- return client->noClientException;
-}
-
-static int
-ProcSyncAwaitFence(ClientPtr client)
-{
- REQUEST(xSyncAwaitFenceReq);
- SyncAwaitUnion *pAwaitUnion;
- SyncAwait *pAwait;
- /* Use CARD32 rather than XSyncFence because XIDs are hard-coded to
- * CARD32 in protocol definitions */
- CARD32 *pProtocolFences;
- int status;
- int len;
- int items;
- int i;
-
- REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq);
-
- len = client->req_len << 2;
- len -= sz_xSyncAwaitFenceReq;
- items = len / sizeof(CARD32);
-
- if (items * sizeof(CARD32) != len)
- {
- return BadLength;
- }
- if (items == 0)
- {
- client->errorValue = items;
- return BadValue;
- }
-
- if (!(pAwaitUnion = SyncAwaitPrologue(client, items)))
- return BadAlloc;
-
- /* don't need to do any more memory allocation for this request! */
-
- pProtocolFences = (CARD32 *) & stuff[1];
-
- pAwait = &(pAwaitUnion+1)->await; /* skip over header */
- for (i = 0; i < items; i++, pProtocolFences++, pAwait++)
- {
- if (*pProtocolFences == None)
- {
- /* this should take care of removing any triggers created by
- * this request that have already been registered on sync objects
- */
- FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
- client->errorValue = *pProtocolFences;
- return SyncErrorBase + XSyncBadFence;
- }
-
- pAwait->trigger.pSync = NULL;
- /* Provide acceptable values for these unused fields to
- * satisfy SyncInitTrigger's validation logic
- */
- pAwait->trigger.value_type = XSyncAbsolute;
- XSyncIntToValue(&pAwait->trigger.wait_value, 0);
- pAwait->trigger.test_type = 0;
-
- status = SyncInitTrigger(client, &pAwait->trigger,
- *pProtocolFences, RTFence,
- XSyncCAAllTrigger);
- if (status != Success)
- {
- /* this should take care of removing any triggers created by
- * this request that have already been registered on sync objects
- */
- FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
- return status;
- }
- /* this is not a mistake -- same function works for both cases */
- pAwait->trigger.TriggerFired = SyncAwaitTriggerFired;
- pAwait->trigger.CounterDestroyed = SyncAwaitTriggerFired;
- /* event_threshold is unused for fence syncs */
- XSyncIntToValue(&pAwait->event_threshold, 0);
- pAwait->pHeader = &pAwaitUnion->header;
- pAwaitUnion->header.num_waitconditions++;
- }
-
- SyncAwaitEpilogue(client, items, pAwaitUnion);
-
- return client->noClientException;
-}
-
-/*
- * ** Given an extension request, call the appropriate request procedure
- */
-static int
-ProcSyncDispatch(ClientPtr client)
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
- case X_SyncInitialize:
- return ProcSyncInitialize(client);
- case X_SyncListSystemCounters:
- return ProcSyncListSystemCounters(client);
- case X_SyncCreateCounter:
- return ProcSyncCreateCounter(client);
- case X_SyncSetCounter:
- return ProcSyncSetCounter(client);
- case X_SyncChangeCounter:
- return ProcSyncChangeCounter(client);
- case X_SyncQueryCounter:
- return ProcSyncQueryCounter(client);
- case X_SyncDestroyCounter:
- return ProcSyncDestroyCounter(client);
- case X_SyncAwait:
- return ProcSyncAwait(client);
- case X_SyncCreateAlarm:
- return ProcSyncCreateAlarm(client);
- case X_SyncChangeAlarm:
- return ProcSyncChangeAlarm(client);
- case X_SyncQueryAlarm:
- return ProcSyncQueryAlarm(client);
- case X_SyncDestroyAlarm:
- return ProcSyncDestroyAlarm(client);
- case X_SyncSetPriority:
- return ProcSyncSetPriority(client);
- case X_SyncGetPriority:
- return ProcSyncGetPriority(client);
- case X_SyncCreateFence:
- return ProcSyncCreateFence(client);
- case X_SyncTriggerFence:
- return ProcSyncTriggerFence(client);
- case X_SyncResetFence:
- return ProcSyncResetFence(client);
- case X_SyncDestroyFence:
- return ProcSyncDestroyFence(client);
- case X_SyncQueryFence:
- return ProcSyncQueryFence(client);
- case X_SyncAwaitFence:
- return ProcSyncAwaitFence(client);
- default:
- return BadRequest;
- }
-}
-
-/*
- * Boring Swapping stuff ...
- */
-
-static int
-SProcSyncInitialize(ClientPtr client)
-{
- REQUEST(xSyncInitializeReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncInitializeReq);
-
- return ProcSyncInitialize(client);
-}
-
-static int
-SProcSyncListSystemCounters(ClientPtr client)
-{
- REQUEST(xSyncListSystemCountersReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncListSystemCountersReq);
-
- return ProcSyncListSystemCounters(client);
-}
-
-static int
-SProcSyncCreateCounter(ClientPtr client)
-{
- REQUEST(xSyncCreateCounterReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncCreateCounterReq);
- swapl(&stuff->cid, n);
- swapl(&stuff->initial_value_lo, n);
- swapl(&stuff->initial_value_hi, n);
-
- return ProcSyncCreateCounter(client);
-}
-
-static int
-SProcSyncSetCounter(ClientPtr client)
-{
- REQUEST(xSyncSetCounterReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncSetCounterReq);
- swapl(&stuff->cid, n);
- swapl(&stuff->value_lo, n);
- swapl(&stuff->value_hi, n);
-
- return ProcSyncSetCounter(client);
-}
-
-static int
-SProcSyncChangeCounter(ClientPtr client)
-{
- REQUEST(xSyncChangeCounterReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncChangeCounterReq);
- swapl(&stuff->cid, n);
- swapl(&stuff->value_lo, n);
- swapl(&stuff->value_hi, n);
-
- return ProcSyncChangeCounter(client);
-}
-
-static int
-SProcSyncQueryCounter(ClientPtr client)
-{
- REQUEST(xSyncQueryCounterReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncQueryCounterReq);
- swapl(&stuff->counter, n);
-
- return ProcSyncQueryCounter(client);
-}
-
-static int
-SProcSyncDestroyCounter(ClientPtr client)
-{
- REQUEST(xSyncDestroyCounterReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncDestroyCounterReq);
- swapl(&stuff->counter, n);
-
- return ProcSyncDestroyCounter(client);
-}
-
-static int
-SProcSyncAwait(ClientPtr client)
-{
- REQUEST(xSyncAwaitReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSyncAwaitReq);
- SwapRestL(stuff);
-
- return ProcSyncAwait(client);
-}
-
-static int
-SProcSyncCreateAlarm(ClientPtr client)
-{
- REQUEST(xSyncCreateAlarmReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq);
- swapl(&stuff->id, n);
- swapl(&stuff->valueMask, n);
- SwapRestL(stuff);
-
- return ProcSyncCreateAlarm(client);
-}
-
-static int
-SProcSyncChangeAlarm(ClientPtr client)
-{
- REQUEST(xSyncChangeAlarmReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
- swapl(&stuff->alarm, n);
- swapl(&stuff->valueMask, n);
- SwapRestL(stuff);
- return ProcSyncChangeAlarm(client);
-}
-
-static int
-SProcSyncQueryAlarm(ClientPtr client)
-{
- REQUEST(xSyncQueryAlarmReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncQueryAlarmReq);
- swapl(&stuff->alarm, n);
-
- return ProcSyncQueryAlarm(client);
-}
-
-static int
-SProcSyncDestroyAlarm(ClientPtr client)
-{
- REQUEST(xSyncDestroyAlarmReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncDestroyAlarmReq);
- swapl(&stuff->alarm, n);
-
- return ProcSyncDestroyAlarm(client);
-}
-
-static int
-SProcSyncSetPriority(ClientPtr client)
-{
- REQUEST(xSyncSetPriorityReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncSetPriorityReq);
- swapl(&stuff->id, n);
- swapl(&stuff->priority, n);
-
- return ProcSyncSetPriority(client);
-}
-
-static int
-SProcSyncGetPriority(ClientPtr client)
-{
- REQUEST(xSyncGetPriorityReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncGetPriorityReq);
- swapl(&stuff->id, n);
-
- return ProcSyncGetPriority(client);
-}
-
-static int
-SProcSyncCreateFence(ClientPtr client)
-{
- REQUEST(xSyncCreateFenceReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncCreateFenceReq);
- swapl(&stuff->fid, n);
-
- return ProcSyncCreateFence(client);
-}
-
-static int
-SProcSyncTriggerFence(ClientPtr client)
-{
- REQUEST(xSyncTriggerFenceReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncTriggerFenceReq);
- swapl(&stuff->fid, n);
-
- return ProcSyncTriggerFence(client);
-}
-
-static int
-SProcSyncResetFence(ClientPtr client)
-{
- REQUEST(xSyncResetFenceReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncResetFenceReq);
- swapl(&stuff->fid, n);
-
- return ProcSyncResetFence(client);
-}
-
-static int
-SProcSyncDestroyFence(ClientPtr client)
-{
- REQUEST(xSyncDestroyFenceReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncDestroyFenceReq);
- swapl(&stuff->fid, n);
-
- return ProcSyncDestroyFence(client);
-}
-
-static int
-SProcSyncQueryFence(ClientPtr client)
-{
- REQUEST(xSyncQueryFenceReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH (xSyncQueryFenceReq);
- swapl(&stuff->fid, n);
-
- return ProcSyncQueryFence(client);
-}
-
-static int
-SProcSyncAwaitFence(ClientPtr client)
-{
- REQUEST(xSyncAwaitFenceReq);
- char n;
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq);
- SwapRestL(stuff);
-
- return ProcSyncAwaitFence(client);
-}
-
-static int
-SProcSyncDispatch(ClientPtr client)
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
- case X_SyncInitialize:
- return SProcSyncInitialize(client);
- case X_SyncListSystemCounters:
- return SProcSyncListSystemCounters(client);
- case X_SyncCreateCounter:
- return SProcSyncCreateCounter(client);
- case X_SyncSetCounter:
- return SProcSyncSetCounter(client);
- case X_SyncChangeCounter:
- return SProcSyncChangeCounter(client);
- case X_SyncQueryCounter:
- return SProcSyncQueryCounter(client);
- case X_SyncDestroyCounter:
- return SProcSyncDestroyCounter(client);
- case X_SyncAwait:
- return SProcSyncAwait(client);
- case X_SyncCreateAlarm:
- return SProcSyncCreateAlarm(client);
- case X_SyncChangeAlarm:
- return SProcSyncChangeAlarm(client);
- case X_SyncQueryAlarm:
- return SProcSyncQueryAlarm(client);
- case X_SyncDestroyAlarm:
- return SProcSyncDestroyAlarm(client);
- case X_SyncSetPriority:
- return SProcSyncSetPriority(client);
- case X_SyncGetPriority:
- return SProcSyncGetPriority(client);
- case X_SyncCreateFence:
- return SProcSyncCreateFence(client);
- case X_SyncTriggerFence:
- return SProcSyncTriggerFence(client);
- case X_SyncResetFence:
- return SProcSyncResetFence(client);
- case X_SyncDestroyFence:
- return SProcSyncDestroyFence(client);
- case X_SyncQueryFence:
- return SProcSyncQueryFence(client);
- case X_SyncAwaitFence:
- return SProcSyncAwaitFence(client);
- default:
- return BadRequest;
- }
-}
-
-/*
- * Event Swapping
- */
-
-static void
-SCounterNotifyEvent(xSyncCounterNotifyEvent *from, xSyncCounterNotifyEvent *to)
-{
- to->type = from->type;
- to->kind = from->kind;
- cpswaps(from->sequenceNumber, to->sequenceNumber);
- cpswapl(from->counter, to->counter);
- cpswapl(from->wait_value_lo, to->wait_value_lo);
- cpswapl(from->wait_value_hi, to->wait_value_hi);
- cpswapl(from->counter_value_lo, to->counter_value_lo);
- cpswapl(from->counter_value_hi, to->counter_value_hi);
- cpswapl(from->time, to->time);
- cpswaps(from->count, to->count);
- to->destroyed = from->destroyed;
-}
-
-
-static void
-SAlarmNotifyEvent(xSyncAlarmNotifyEvent *from, xSyncAlarmNotifyEvent *to)
-{
- to->type = from->type;
- to->kind = from->kind;
- cpswaps(from->sequenceNumber, to->sequenceNumber);
- cpswapl(from->alarm, to->alarm);
- cpswapl(from->counter_value_lo, to->counter_value_lo);
- cpswapl(from->counter_value_hi, to->counter_value_hi);
- cpswapl(from->alarm_value_lo, to->alarm_value_lo);
- cpswapl(from->alarm_value_hi, to->alarm_value_hi);
- cpswapl(from->time, to->time);
- to->state = from->state;
-}
-
-/*
- * ** Close everything down. ** This is fairly simple for now.
- */
-/* ARGSUSED */
-static void
-SyncResetProc(ExtensionEntry *extEntry)
-{
- free(SysCounterList);
- SysCounterList = NULL;
- RTCounter = 0;
-}
-
-/*
- * ** Initialise the extension.
- */
-void
-SyncExtensionInit(void)
-{
- ExtensionEntry *extEntry;
- int s;
-
- for (s = 0; s < screenInfo.numScreens; s++)
- miSyncSetup(screenInfo.screens[s]);
-
- if (RTCounter == 0)
- {
- RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter");
- }
- RTAlarm = CreateNewResourceType(FreeAlarm, "SyncAlarm");
- RTAwait = CreateNewResourceType(FreeAwait, "SyncAwait");
- RTFence = CreateNewResourceType(FreeFence, "SyncFence");
- if (RTAwait)
- RTAwait |= RC_NEVERRETAIN;
- RTAlarmClient = CreateNewResourceType(FreeAlarmClient, "SyncAlarmClient");
- if (RTAlarmClient)
- RTAlarmClient |= RC_NEVERRETAIN;
-
- if (RTCounter == 0 || RTAwait == 0 || RTAlarm == 0 ||
- RTAlarmClient == 0 ||
- (extEntry = AddExtension(SYNC_NAME,
- XSyncNumberEvents, XSyncNumberErrors,
- ProcSyncDispatch, SProcSyncDispatch,
- SyncResetProc,
- StandardMinorOpcode)) == NULL)
- {
- ErrorF("Sync Extension %d.%d failed to Initialise\n",
- SYNC_MAJOR_VERSION, SYNC_MINOR_VERSION);
- return;
- }
-
- SyncEventBase = extEntry->eventBase;
- SyncErrorBase = extEntry->errorBase;
- EventSwapVector[SyncEventBase + XSyncCounterNotify] = (EventSwapPtr) SCounterNotifyEvent;
- EventSwapVector[SyncEventBase + XSyncAlarmNotify] = (EventSwapPtr) SAlarmNotifyEvent;
-
- SetResourceTypeErrorValue(RTCounter, SyncErrorBase + XSyncBadCounter);
- SetResourceTypeErrorValue(RTAlarm, SyncErrorBase + XSyncBadAlarm);
- SetResourceTypeErrorValue(RTFence, SyncErrorBase + XSyncBadFence);
-
- /*
- * Although SERVERTIME is implemented by the OS layer, we initialise it
- * here because doing it in OsInit() is too early. The resource database
- * is not initialised when OsInit() is called. This is just about OK
- * because there is always a servertime counter.
- */
- SyncInitServerTime();
- SyncInitIdleTime();
-
-#ifdef DEBUG
- fprintf(stderr, "Sync Extension %d.%d\n",
- SYNC_MAJOR_VERSION, SYNC_MINOR_VERSION);
-#endif
-}
-
-
-/*
- * ***** SERVERTIME implementation - should go in its own file in OS directory?
- */
-
-
-
-static pointer ServertimeCounter;
-static XSyncValue Now;
-static XSyncValue *pnext_time;
-
-#define GetTime()\
-{\
- unsigned long millis = GetTimeInMillis();\
- unsigned long maxis = XSyncValueHigh32(Now);\
- if (millis < XSyncValueLow32(Now)) maxis++;\
- XSyncIntsToValue(&Now, millis, maxis);\
-}
-
-/*
-*** Server Block Handler
-*** code inspired by multibuffer extension (now deprecated)
- */
-/*ARGSUSED*/
-static void
-ServertimeBlockHandler(void *env, struct timeval **wt, void *LastSelectMask)
-{
- XSyncValue delay;
- unsigned long timeout;
-
- if (pnext_time)
- {
- GetTime();
-
- if (XSyncValueGreaterOrEqual(Now, *pnext_time))
- {
- timeout = 0;
- }
- else
- {
- Bool overflow;
- XSyncValueSubtract(&delay, *pnext_time, Now, &overflow);
- (void)overflow;
- timeout = XSyncValueLow32(delay);
- }
- AdjustWaitForDelay(wt, timeout); /* os/utils.c */
- }
-}
-
-/*
-*** Wakeup Handler
- */
-/*ARGSUSED*/
-static void
-ServertimeWakeupHandler(void *env, int rc, void *LastSelectMask)
-{
- if (pnext_time)
- {
- GetTime();
-
- if (XSyncValueGreaterOrEqual(Now, *pnext_time))
- {
- SyncChangeCounter(ServertimeCounter, Now);
- }
- }
-}
-
-static void
-ServertimeQueryValue(void *pCounter, CARD64 *pValue_return)
-{
- GetTime();
- *pValue_return = Now;
-}
-
-static void
-ServertimeBracketValues(void *pCounter, CARD64 *pbracket_less,
- CARD64 *pbracket_greater)
-{
- if (!pnext_time && pbracket_greater)
- {
- RegisterBlockAndWakeupHandlers(ServertimeBlockHandler,
- ServertimeWakeupHandler,
- NULL);
- }
- else if (pnext_time && !pbracket_greater)
- {
- RemoveBlockAndWakeupHandlers(ServertimeBlockHandler,
- ServertimeWakeupHandler,
- NULL);
- }
- pnext_time = pbracket_greater;
-}
-
-static void
-SyncInitServerTime(void)
-{
- CARD64 resolution;
-
- XSyncIntsToValue(&Now, GetTimeInMillis(), 0);
- XSyncIntToValue(&resolution, 4);
- ServertimeCounter = SyncCreateSystemCounter("SERVERTIME", Now, resolution,
- XSyncCounterNeverDecreases,
- ServertimeQueryValue, ServertimeBracketValues);
- pnext_time = NULL;
-}
-
-
-
-/*
- * IDLETIME implementation
- */
-
-static SyncCounter *IdleTimeCounter;
-static XSyncValue *pIdleTimeValueLess;
-static XSyncValue *pIdleTimeValueGreater;
-
-static void
-IdleTimeQueryValue (pointer pCounter, CARD64 *pValue_return)
-{
- CARD32 idle = GetTimeInMillis() - lastDeviceEventTime.milliseconds;
- XSyncIntsToValue (pValue_return, idle, 0);
-}
-
-static void
-IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask)
-{
- XSyncValue idle, old_idle;
- SyncTriggerList *list = IdleTimeCounter->sync.pTriglist;
- SyncTrigger *trig;
-
- if (!pIdleTimeValueLess && !pIdleTimeValueGreater)
- return;
-
- old_idle = IdleTimeCounter->value;
- IdleTimeQueryValue (NULL, &idle);
- IdleTimeCounter->value = idle; /* push, so CheckTrigger works */
-
- if (pIdleTimeValueLess &&
- XSyncValueLessOrEqual (idle, *pIdleTimeValueLess))
- {
- /*
- * We've been idle for less than the threshold value, and someone
- * wants to know about that, but now we need to know whether they
- * want level or edge trigger. Check the trigger list against the
- * current idle time, and if any succeed, bomb out of select()
- * immediately so we can reschedule.
- */
-
- for (list = IdleTimeCounter->sync.pTriglist; list; list = list->next) {
- trig = list->pTrigger;
- if (trig->CheckTrigger(trig, old_idle)) {
- AdjustWaitForDelay(wt, 0);
- break;
- }
- }
- /*
- * We've been called exactly on the idle time, but we have a
- * NegativeTransition trigger which requires a transition from an
- * idle time greater than this. Schedule a wakeup for the next
- * millisecond so we won't miss a transition.
- */
- if (XSyncValueEqual (idle, *pIdleTimeValueLess))
- AdjustWaitForDelay(wt, 1);
- }
- else if (pIdleTimeValueGreater)
- {
- /*
- * There's a threshold in the positive direction. If we've been
- * idle less than it, schedule a wakeup for sometime in the future.
- * If we've been idle more than it, and someone wants to know about
- * that level-triggered, schedule an immediate wakeup.
- */
- unsigned long timeout = -1;
-
- if (XSyncValueLessThan (idle, *pIdleTimeValueGreater)) {
- XSyncValue value;
- Bool overflow;
-
- XSyncValueSubtract (&value, *pIdleTimeValueGreater,
- idle, &overflow);
- timeout = min(timeout, XSyncValueLow32 (value));
- } else {
- for (list = IdleTimeCounter->sync.pTriglist; list; list = list->next) {
- trig = list->pTrigger;
- if (trig->CheckTrigger(trig, old_idle)) {
- timeout = min(timeout, 0);
- break;
- }
- }
- }
-
- AdjustWaitForDelay (wt, timeout);
- }
-
- IdleTimeCounter->value = old_idle; /* pop */
-}
-
-static void
-IdleTimeWakeupHandler (pointer env, int rc, pointer LastSelectMask)
-{
- XSyncValue idle;
-
- if (!pIdleTimeValueLess && !pIdleTimeValueGreater)
- return;
-
- IdleTimeQueryValue (NULL, &idle);
-
- if ((pIdleTimeValueGreater &&
- XSyncValueGreaterOrEqual (idle, *pIdleTimeValueGreater)) ||
- (pIdleTimeValueLess &&
- XSyncValueLessOrEqual (idle, *pIdleTimeValueLess)))
- {
- SyncChangeCounter (IdleTimeCounter, idle);
- }
-}
-
-static void
-IdleTimeBracketValues (pointer pCounter, CARD64 *pbracket_less,
- CARD64 *pbracket_greater)
-{
- Bool registered = (pIdleTimeValueLess || pIdleTimeValueGreater);
-
- if (registered && !pbracket_less && !pbracket_greater)
- {
- RemoveBlockAndWakeupHandlers(IdleTimeBlockHandler,
- IdleTimeWakeupHandler,
- NULL);
- }
- else if (!registered && (pbracket_less || pbracket_greater))
- {
- RegisterBlockAndWakeupHandlers(IdleTimeBlockHandler,
- IdleTimeWakeupHandler,
- NULL);
- }
-
- pIdleTimeValueGreater = pbracket_greater;
- pIdleTimeValueLess = pbracket_less;
-}
-
-static void
-SyncInitIdleTime (void)
-{
- CARD64 resolution;
- XSyncValue idle;
-
- IdleTimeQueryValue (NULL, &idle);
- XSyncIntToValue (&resolution, 4);
-
- IdleTimeCounter = SyncCreateSystemCounter ("IDLETIME", idle, resolution,
- XSyncCounterUnrestricted,
- IdleTimeQueryValue,
- IdleTimeBracketValues);
-
- pIdleTimeValueLess = pIdleTimeValueGreater = NULL;
-}
+/*
+
+Copyright 1991, 1993, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+
+Copyright 1991, 1993 by Digital Equipment Corporation, Maynard, Massachusetts,
+and Olivetti Research Limited, Cambridge, England.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the names of Digital or Olivetti
+not be used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission. Digital and Olivetti
+make no representations about the suitability of this software
+for any purpose. It is provided "as is" without express or implied warranty.
+
+DIGITAL AND OLIVETTI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL THEY BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
+USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <string.h>
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include <X11/Xmd.h>
+#include "scrnintstr.h"
+#include "os.h"
+#include "extnsionst.h"
+#include "dixstruct.h"
+#include "pixmapstr.h"
+#include "resource.h"
+#include "opaque.h"
+#include <X11/extensions/syncproto.h>
+#include "syncsrv.h"
+#include "syncsdk.h"
+#include "protocol-versions.h"
+
+#include <stdio.h>
+#if !defined(WIN32)
+#include <sys/time.h>
+#endif
+
+#include "modinit.h"
+
+/*
+ * Local Global Variables
+ */
+static int SyncEventBase;
+static int SyncErrorBase;
+static RESTYPE RTCounter = 0;
+static RESTYPE RTAwait;
+static RESTYPE RTAlarm;
+static RESTYPE RTAlarmClient;
+static RESTYPE RTFence;
+static int SyncNumSystemCounters = 0;
+static SyncCounter **SysCounterList = NULL;
+static int SyncNumInvalidCounterWarnings = 0;
+#define MAX_INVALID_COUNTER_WARNINGS 5
+
+static const char *WARN_INVALID_COUNTER_COMPARE =
+"Warning: Non-counter XSync object using Counter-only\n"
+" comparison. Result will never be true.\n";
+
+static const char *WARN_INVALID_COUNTER_ALARM =
+"Warning: Non-counter XSync object used in alarm. This is\n"
+" the result of a programming error in the X server.\n";
+
+#define IsSystemCounter(pCounter) \
+ (pCounter && (pCounter->sync.client == NULL))
+
+/* these are all the alarm attributes that pertain to the alarm's trigger */
+#define XSyncCAAllTrigger \
+ (XSyncCACounter | XSyncCAValueType | XSyncCAValue | XSyncCATestType)
+
+static void SyncComputeBracketValues(SyncCounter *);
+
+static void SyncInitServerTime(void);
+
+static void SyncInitIdleTime(void);
+
+static Bool
+SyncCheckWarnIsCounter(const SyncObject* pSync, const char *warning)
+{
+ if (pSync && (SYNC_COUNTER != pSync->type))
+ {
+ if (SyncNumInvalidCounterWarnings++ < MAX_INVALID_COUNTER_WARNINGS)
+ {
+ ErrorF("%s", warning);
+ ErrorF(" Counter type: %d\n", pSync->type);
+ }
+
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/* Each counter maintains a simple linked list of triggers that are
+ * interested in the counter. The two functions below are used to
+ * delete and add triggers on this list.
+ */
+static void
+SyncDeleteTriggerFromSyncObject(SyncTrigger *pTrigger)
+{
+ SyncTriggerList *pCur;
+ SyncTriggerList *pPrev;
+ SyncCounter *pCounter;
+
+ /* pSync needs to be stored in pTrigger before calling here. */
+
+ if (!pTrigger->pSync)
+ return;
+
+ pPrev = NULL;
+ pCur = pTrigger->pSync->pTriglist;
+
+ while (pCur)
+ {
+ if (pCur->pTrigger == pTrigger)
+ {
+ if (pPrev)
+ pPrev->next = pCur->next;
+ else
+ pTrigger->pSync->pTriglist = pCur->next;
+
+ free(pCur);
+ break;
+ }
+
+ pPrev = pCur;
+ pCur = pCur->next;
+ }
+
+ if (SYNC_COUNTER == pTrigger->pSync->type)
+ {
+ pCounter = (SyncCounter *)pTrigger->pSync;
+
+ if (IsSystemCounter(pCounter))
+ SyncComputeBracketValues(pCounter);
+ } else if (SYNC_FENCE == pTrigger->pSync->type) {
+ SyncFence* pFence = (SyncFence*) pTrigger->pSync;
+ pFence->funcs.DeleteTrigger(pTrigger);
+ }
+}
+
+
+static int
+SyncAddTriggerToSyncObject(SyncTrigger *pTrigger)
+{
+ SyncTriggerList *pCur;
+ SyncCounter *pCounter;
+
+ if (!pTrigger->pSync)
+ return Success;
+
+ /* don't do anything if it's already there */
+ for (pCur = pTrigger->pSync->pTriglist; pCur; pCur = pCur->next)
+ {
+ if (pCur->pTrigger == pTrigger)
+ return Success;
+ }
+
+ if (!(pCur = malloc(sizeof(SyncTriggerList))))
+ return BadAlloc;
+
+ pCur->pTrigger = pTrigger;
+ pCur->next = pTrigger->pSync->pTriglist;
+ pTrigger->pSync->pTriglist = pCur;
+
+ if (SYNC_COUNTER == pTrigger->pSync->type)
+ {
+ pCounter = (SyncCounter *)pTrigger->pSync;
+
+ if (IsSystemCounter(pCounter))
+ SyncComputeBracketValues(pCounter);
+ } else if (SYNC_FENCE == pTrigger->pSync->type) {
+ SyncFence* pFence = (SyncFence*) pTrigger->pSync;
+ pFence->funcs.AddTrigger(pTrigger);
+ }
+
+ return Success;
+}
+
+
+/* Below are five possible functions that can be plugged into
+ * pTrigger->CheckTrigger for counter sync objects, corresponding to
+ * the four possible test-types, and the one possible function that
+ * can be plugged into pTrigger->CheckTrigger for fence sync objects.
+ * These functions are called after the sync object's state changes
+ * but are also passed the old state so they can inspect both the old
+ * and new values. (PositiveTransition and NegativeTransition need to
+ * see both pieces of information.) These functions return the truth
+ * value of the trigger.
+ *
+ * All of them include the condition pTrigger->pSync == NULL.
+ * This is because the spec says that a trigger with a sync value
+ * of None is always TRUE.
+ */
+
+static Bool
+SyncCheckTriggerPositiveComparison(SyncTrigger *pTrigger, CARD64 oldval)
+{
+ SyncCounter *pCounter;
+
+ /* Non-counter sync objects should never get here because they
+ * never trigger this comparison. */
+ if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE))
+ return FALSE;
+
+ pCounter = (SyncCounter *)pTrigger->pSync;
+
+ return (pCounter == NULL ||
+ XSyncValueGreaterOrEqual(pCounter->value, pTrigger->test_value));
+}
+
+static Bool
+SyncCheckTriggerNegativeComparison(SyncTrigger *pTrigger, CARD64 oldval)
+{
+ SyncCounter *pCounter;
+
+ /* Non-counter sync objects should never get here because they
+ * never trigger this comparison. */
+ if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE))
+ return FALSE;
+
+ pCounter = (SyncCounter *)pTrigger->pSync;
+
+ return (pCounter == NULL ||
+ XSyncValueLessOrEqual(pCounter->value, pTrigger->test_value));
+}
+
+static Bool
+SyncCheckTriggerPositiveTransition(SyncTrigger *pTrigger, CARD64 oldval)
+{
+ SyncCounter *pCounter;
+
+ /* Non-counter sync objects should never get here because they
+ * never trigger this comparison. */
+ if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE))
+ return FALSE;
+
+ pCounter = (SyncCounter *)pTrigger->pSync;
+
+ return (pCounter == NULL ||
+ (XSyncValueLessThan(oldval, pTrigger->test_value) &&
+ XSyncValueGreaterOrEqual(pCounter->value, pTrigger->test_value)));
+}
+
+static Bool
+SyncCheckTriggerNegativeTransition(SyncTrigger *pTrigger, CARD64 oldval)
+{
+ SyncCounter *pCounter;
+
+ /* Non-counter sync objects should never get here because they
+ * never trigger this comparison. */
+ if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_COMPARE))
+ return FALSE;
+
+ pCounter = (SyncCounter *)pTrigger->pSync;
+
+ return (pCounter == NULL ||
+ (XSyncValueGreaterThan(oldval, pTrigger->test_value) &&
+ XSyncValueLessOrEqual(pCounter->value, pTrigger->test_value)));
+}
+
+static Bool
+SyncCheckTriggerFence(SyncTrigger *pTrigger, CARD64 unused)
+{
+ SyncFence* pFence = (SyncFence*) pTrigger->pSync;
+ (void)unused;
+
+ return (pFence == NULL ||
+ pFence->funcs.CheckTriggered(pFence));
+}
+
+static int
+SyncInitTrigger(ClientPtr client, SyncTrigger *pTrigger, XID syncObject,
+ RESTYPE resType, Mask changes)
+{
+ SyncObject *pSync = pTrigger->pSync;
+ SyncCounter *pCounter = NULL;
+ int rc;
+ Bool newSyncObject = FALSE;
+
+ if (changes & XSyncCACounter)
+ {
+ if (syncObject == None)
+ pSync = NULL;
+ else if (Success != (rc = dixLookupResourceByType ((pointer *)&pSync,
+ syncObject, resType, client, DixReadAccess)))
+ {
+ client->errorValue = syncObject;
+ return rc;
+ }
+ if (pSync != pTrigger->pSync)
+ { /* new counter for trigger */
+ SyncDeleteTriggerFromSyncObject(pTrigger);
+ pTrigger->pSync = pSync;
+ newSyncObject = TRUE;
+ }
+ }
+
+ /* if system counter, ask it what the current value is */
+
+ if (pSync && SYNC_COUNTER == pSync->type)
+ {
+ pCounter = (SyncCounter *)pSync;
+
+ if (IsSystemCounter(pCounter))
+ {
+ (*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter,
+ &pCounter->value);
+ }
+ }
+
+ if (changes & XSyncCAValueType)
+ {
+ if (pTrigger->value_type != XSyncRelative &&
+ pTrigger->value_type != XSyncAbsolute)
+ {
+ client->errorValue = pTrigger->value_type;
+ return BadValue;
+ }
+ }
+
+ if (changes & XSyncCATestType)
+ {
+
+ if (pSync && SYNC_FENCE == pSync->type)
+ {
+ pTrigger->CheckTrigger = SyncCheckTriggerFence;
+ }
+ else
+ {
+ /* select appropriate CheckTrigger function */
+
+ switch (pTrigger->test_type)
+ {
+ case XSyncPositiveTransition:
+ pTrigger->CheckTrigger = SyncCheckTriggerPositiveTransition;
+ break;
+ case XSyncNegativeTransition:
+ pTrigger->CheckTrigger = SyncCheckTriggerNegativeTransition;
+ break;
+ case XSyncPositiveComparison:
+ pTrigger->CheckTrigger = SyncCheckTriggerPositiveComparison;
+ break;
+ case XSyncNegativeComparison:
+ pTrigger->CheckTrigger = SyncCheckTriggerNegativeComparison;
+ break;
+ default:
+ client->errorValue = pTrigger->test_type;
+ return BadValue;
+ }
+ }
+ }
+
+ if (changes & (XSyncCAValueType | XSyncCAValue))
+ {
+ if (pTrigger->value_type == XSyncAbsolute)
+ pTrigger->test_value = pTrigger->wait_value;
+ else /* relative */
+ {
+ Bool overflow;
+ if (pCounter == NULL)
+ return BadMatch;
+
+ XSyncValueAdd(&pTrigger->test_value, pCounter->value,
+ pTrigger->wait_value, &overflow);
+ if (overflow)
+ {
+ client->errorValue = XSyncValueHigh32(pTrigger->wait_value);
+ return BadValue;
+ }
+ }
+ }
+
+ /* we wait until we're sure there are no errors before registering
+ * a new counter on a trigger
+ */
+ if (newSyncObject)
+ {
+ if ((rc = SyncAddTriggerToSyncObject(pTrigger)) != Success)
+ return rc;
+ }
+ else if (pCounter && IsSystemCounter(pCounter))
+ {
+ SyncComputeBracketValues(pCounter);
+ }
+
+ return Success;
+}
+
+/* AlarmNotify events happen in response to actions taken on an Alarm or
+ * the counter used by the alarm. AlarmNotify may be sent to multiple
+ * clients. The alarm maintains a list of clients interested in events.
+ */
+static void
+SyncSendAlarmNotifyEvents(SyncAlarm *pAlarm)
+{
+ SyncAlarmClientList *pcl;
+ xSyncAlarmNotifyEvent ane;
+ SyncTrigger *pTrigger = &pAlarm->trigger;
+ SyncCounter *pCounter;
+
+ if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_ALARM))
+ return;
+
+ pCounter = (SyncCounter *)pTrigger->pSync;
+
+ UpdateCurrentTime();
+
+ ane.type = SyncEventBase + XSyncAlarmNotify;
+ ane.kind = XSyncAlarmNotify;
+ ane.alarm = pAlarm->alarm_id;
+ if (pTrigger->pSync && SYNC_COUNTER == pTrigger->pSync->type)
+ {
+ ane.counter_value_hi = XSyncValueHigh32(pCounter->value);
+ ane.counter_value_lo = XSyncValueLow32(pCounter->value);
+ }
+ else
+ { /* XXX what else can we do if there's no counter? */
+ ane.counter_value_hi = ane.counter_value_lo = 0;
+ }
+
+ ane.alarm_value_hi = XSyncValueHigh32(pTrigger->test_value);
+ ane.alarm_value_lo = XSyncValueLow32(pTrigger->test_value);
+ ane.time = currentTime.milliseconds;
+ ane.state = pAlarm->state;
+
+ /* send to owner */
+ if (pAlarm->events)
+ WriteEventsToClient(pAlarm->client, 1, (xEvent *) &ane);
+
+ /* send to other interested clients */
+ for (pcl = pAlarm->pEventClients; pcl; pcl = pcl->next)
+ WriteEventsToClient(pcl->client, 1, (xEvent *) &ane);
+}
+
+
+/* CounterNotify events only occur in response to an Await. The events
+ * go only to the Awaiting client.
+ */
+static void
+SyncSendCounterNotifyEvents(ClientPtr client, SyncAwait **ppAwait,
+ int num_events)
+{
+ xSyncCounterNotifyEvent *pEvents, *pev;
+ int i;
+
+ if (client->clientGone)
+ return;
+ pev = pEvents = malloc(num_events * sizeof(xSyncCounterNotifyEvent));
+ if (!pEvents)
+ return;
+ UpdateCurrentTime();
+ for (i = 0; i < num_events; i++, ppAwait++, pev++)
+ {
+ SyncTrigger *pTrigger = &(*ppAwait)->trigger;
+ pev->type = SyncEventBase + XSyncCounterNotify;
+ pev->kind = XSyncCounterNotify;
+ pev->counter = pTrigger->pSync->id;
+ pev->wait_value_lo = XSyncValueLow32(pTrigger->test_value);
+ pev->wait_value_hi = XSyncValueHigh32(pTrigger->test_value);
+ if (SYNC_COUNTER == pTrigger->pSync->type)
+ {
+ SyncCounter *pCounter = (SyncCounter *)pTrigger->pSync;
+
+ pev->counter_value_lo = XSyncValueLow32(pCounter->value);
+ pev->counter_value_hi = XSyncValueHigh32(pCounter->value);
+ }
+ else
+ {
+ pev->counter_value_lo = 0;
+ pev->counter_value_hi = 0;
+ }
+
+ pev->time = currentTime.milliseconds;
+ pev->count = num_events - i - 1; /* events remaining */
+ pev->destroyed = pTrigger->pSync->beingDestroyed;
+ }
+ /* swapping will be taken care of by this */
+ WriteEventsToClient(client, num_events, (xEvent *)pEvents);
+ free(pEvents);
+}
+
+
+/* This function is called when an alarm's counter is destroyed.
+ * It is plugged into pTrigger->CounterDestroyed (for alarm triggers).
+ */
+static void
+SyncAlarmCounterDestroyed(SyncTrigger *pTrigger)
+{
+ SyncAlarm *pAlarm = (SyncAlarm *)pTrigger;
+
+ pAlarm->state = XSyncAlarmInactive;
+ SyncSendAlarmNotifyEvents(pAlarm);
+ pTrigger->pSync = NULL;
+}
+
+
+/* This function is called when an alarm "goes off."
+ * It is plugged into pTrigger->TriggerFired (for alarm triggers).
+ */
+static void
+SyncAlarmTriggerFired(SyncTrigger *pTrigger)
+{
+ SyncAlarm *pAlarm = (SyncAlarm *)pTrigger;
+ SyncCounter *pCounter;
+ CARD64 new_test_value;
+
+ if (!SyncCheckWarnIsCounter(pTrigger->pSync, WARN_INVALID_COUNTER_ALARM))
+ return;
+
+ pCounter = (SyncCounter *)pTrigger->pSync;
+
+ /* no need to check alarm unless it's active */
+ if (pAlarm->state != XSyncAlarmActive)
+ return;
+
+ /* " if the counter value is None, or if the delta is 0 and
+ * the test-type is PositiveComparison or NegativeComparison,
+ * no change is made to value (test-value) and the alarm
+ * state is changed to Inactive before the event is generated."
+ */
+ if (pCounter == NULL
+ || (XSyncValueIsZero(pAlarm->delta)
+ && (pAlarm->trigger.test_type == XSyncPositiveComparison
+ || pAlarm->trigger.test_type == XSyncNegativeComparison)))
+ pAlarm->state = XSyncAlarmInactive;
+
+ new_test_value = pAlarm->trigger.test_value;
+
+ if (pAlarm->state == XSyncAlarmActive)
+ {
+ Bool overflow;
+ CARD64 oldvalue;
+ SyncTrigger *paTrigger = &pAlarm->trigger;
+ SyncCounter *paCounter;
+
+ if (!SyncCheckWarnIsCounter(paTrigger->pSync,
+ WARN_INVALID_COUNTER_ALARM))
+ return;
+
+ paCounter = (SyncCounter *)pTrigger->pSync;
+
+ /* "The alarm is updated by repeatedly adding delta to the
+ * value of the trigger and re-initializing it until it
+ * becomes FALSE."
+ */
+ oldvalue = paTrigger->test_value;
+
+ /* XXX really should do something smarter here */
+
+ do
+ {
+ XSyncValueAdd(&paTrigger->test_value, paTrigger->test_value,
+ pAlarm->delta, &overflow);
+ } while (!overflow &&
+ (*paTrigger->CheckTrigger)(paTrigger,
+ paCounter->value));
+
+ new_test_value = paTrigger->test_value;
+ paTrigger->test_value = oldvalue;
+
+ /* "If this update would cause value to fall outside the range
+ * for an INT64...no change is made to value (test-value) and
+ * the alarm state is changed to Inactive before the event is
+ * generated."
+ */
+ if (overflow)
+ {
+ new_test_value = oldvalue;
+ pAlarm->state = XSyncAlarmInactive;
+ }
+ }
+ /* The AlarmNotify event has to have the "new state of the alarm"
+ * which we can't be sure of until this point. However, it has
+ * to have the "old" trigger test value. That's the reason for
+ * all the newvalue/oldvalue shuffling above. After we send the
+ * events, give the trigger its new test value.
+ */
+ SyncSendAlarmNotifyEvents(pAlarm);
+ pTrigger->test_value = new_test_value;
+}
+
+
+/* This function is called when an Await unblocks, either as a result
+ * of the trigger firing OR the counter being destroyed.
+ * It goes into pTrigger->TriggerFired AND pTrigger->CounterDestroyed
+ * (for Await triggers).
+ */
+static void
+SyncAwaitTriggerFired(SyncTrigger *pTrigger)
+{
+ SyncAwait *pAwait = (SyncAwait *)pTrigger;
+ int numwaits;
+ SyncAwaitUnion *pAwaitUnion;
+ SyncAwait **ppAwait;
+ int num_events = 0;
+
+ pAwaitUnion = (SyncAwaitUnion *)pAwait->pHeader;
+ numwaits = pAwaitUnion->header.num_waitconditions;
+ ppAwait = malloc(numwaits * sizeof(SyncAwait *));
+ if (!ppAwait)
+ goto bail;
+
+ pAwait = &(pAwaitUnion+1)->await;
+
+ /* "When a client is unblocked, all the CounterNotify events for
+ * the Await request are generated contiguously. If count is 0
+ * there are no more events to follow for this request. If
+ * count is n, there are at least n more events to follow."
+ *
+ * Thus, it is best to find all the counters for which events
+ * need to be sent first, so that an accurate count field can
+ * be stored in the events.
+ */
+ for ( ; numwaits; numwaits--, pAwait++)
+ {
+ CARD64 diff;
+ Bool overflow, diffgreater, diffequal;
+
+ /* "A CounterNotify event with the destroyed flag set to TRUE is
+ * always generated if the counter for one of the triggers is
+ * destroyed."
+ */
+ if (pAwait->trigger.pSync->beingDestroyed)
+ {
+ ppAwait[num_events++] = pAwait;
+ continue;
+ }
+
+ if (SYNC_COUNTER == pAwait->trigger.pSync->type)
+ {
+ SyncCounter *pCounter = (SyncCounter *) pAwait->trigger.pSync;
+
+ /* "The difference between the counter and the test value is
+ * calculated by subtracting the test value from the value of
+ * the counter."
+ */
+ XSyncValueSubtract(&diff, pCounter->value,
+ pAwait->trigger.test_value, &overflow);
+
+ /* "If the difference lies outside the range for an INT64, an
+ * event is not generated."
+ */
+ if (overflow)
+ continue;
+ diffgreater = XSyncValueGreaterThan(diff, pAwait->event_threshold);
+ diffequal = XSyncValueEqual(diff, pAwait->event_threshold);
+
+ /* "If the test-type is PositiveTransition or
+ * PositiveComparison, a CounterNotify event is generated if
+ * the difference is at least event-threshold. If the test-type
+ * is NegativeTransition or NegativeComparison, a CounterNotify
+ * event is generated if the difference is at most
+ * event-threshold."
+ */
+
+ if ( ((pAwait->trigger.test_type == XSyncPositiveComparison ||
+ pAwait->trigger.test_type == XSyncPositiveTransition)
+ && (diffgreater || diffequal))
+ ||
+ ((pAwait->trigger.test_type == XSyncNegativeComparison ||
+ pAwait->trigger.test_type == XSyncNegativeTransition)
+ && (!diffgreater) /* less or equal */
+ )
+ )
+ {
+ ppAwait[num_events++] = pAwait;
+ }
+ }
+ }
+ if (num_events)
+ SyncSendCounterNotifyEvents(pAwaitUnion->header.client, ppAwait,
+ num_events);
+ free(ppAwait);
+
+bail:
+ /* unblock the client */
+ AttendClient(pAwaitUnion->header.client);
+ /* delete the await */
+ FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
+}
+
+
+/* This function should always be used to change a counter's value so that
+ * any triggers depending on the counter will be checked.
+ */
+void
+SyncChangeCounter(SyncCounter *pCounter, CARD64 newval)
+{
+ SyncTriggerList *ptl, *pnext;
+ CARD64 oldval;
+
+ oldval = pCounter->value;
+ pCounter->value = newval;
+
+ /* run through triggers to see if any become true */
+ for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext)
+ {
+ pnext = ptl->next;
+ if ((*ptl->pTrigger->CheckTrigger)(ptl->pTrigger, oldval))
+ (*ptl->pTrigger->TriggerFired)(ptl->pTrigger);
+ }
+
+ if (IsSystemCounter(pCounter))
+ {
+ SyncComputeBracketValues(pCounter);
+ }
+}
+
+
+/* loosely based on dix/events.c/EventSelectForWindow */
+static Bool
+SyncEventSelectForAlarm(SyncAlarm *pAlarm, ClientPtr client, Bool wantevents)
+{
+ SyncAlarmClientList *pClients;
+
+ if (client == pAlarm->client) /* alarm owner */
+ {
+ pAlarm->events = wantevents;
+ return Success;
+ }
+
+ /* see if the client is already on the list (has events selected) */
+
+ for (pClients = pAlarm->pEventClients; pClients;
+ pClients = pClients->next)
+ {
+ if (pClients->client == client)
+ {
+ /* client's presence on the list indicates desire for
+ * events. If the client doesn't want events, remove it
+ * from the list. If the client does want events, do
+ * nothing, since it's already got them.
+ */
+ if (!wantevents)
+ {
+ FreeResource(pClients->delete_id, RT_NONE);
+ }
+ return Success;
+ }
+ }
+
+ /* if we get here, this client does not currently have
+ * events selected on the alarm
+ */
+
+ if (!wantevents)
+ /* client doesn't want events, and we just discovered that it
+ * doesn't have them, so there's nothing to do.
+ */
+ return Success;
+
+ /* add new client to pAlarm->pEventClients */
+
+ pClients = malloc(sizeof(SyncAlarmClientList));
+ if (!pClients)
+ return BadAlloc;
+
+ /* register it as a resource so it will be cleaned up
+ * if the client dies
+ */
+
+ pClients->delete_id = FakeClientID(client->index);
+
+ /* link it into list after we know all the allocations succeed */
+ pClients->next = pAlarm->pEventClients;
+ pAlarm->pEventClients = pClients;
+ pClients->client = client;
+
+ if (!AddResource(pClients->delete_id, RTAlarmClient, pAlarm))
+ return BadAlloc;
+
+ return Success;
+}
+
+/*
+ * ** SyncChangeAlarmAttributes ** This is used by CreateAlarm and ChangeAlarm
+ */
+static int
+SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm *pAlarm, Mask mask,
+ CARD32 *values)
+{
+ int status;
+ XSyncCounter counter;
+ Mask origmask = mask;
+
+ counter =
+ pAlarm->trigger.pSync ? pAlarm->trigger.pSync->id : None;
+
+ while (mask)
+ {
+ int index2 = lowbit(mask);
+ mask &= ~index2;
+ switch (index2)
+ {
+ case XSyncCACounter:
+ mask &= ~XSyncCACounter;
+ /* sanity check in SyncInitTrigger */
+ counter = *values++;
+ break;
+
+ case XSyncCAValueType:
+ mask &= ~XSyncCAValueType;
+ /* sanity check in SyncInitTrigger */
+ pAlarm->trigger.value_type = *values++;
+ break;
+
+ case XSyncCAValue:
+ mask &= ~XSyncCAValue;
+ XSyncIntsToValue(&pAlarm->trigger.wait_value, values[1], values[0]);
+ values += 2;
+ break;
+
+ case XSyncCATestType:
+ mask &= ~XSyncCATestType;
+ /* sanity check in SyncInitTrigger */
+ pAlarm->trigger.test_type = *values++;
+ break;
+
+ case XSyncCADelta:
+ mask &= ~XSyncCADelta;
+ XSyncIntsToValue(&pAlarm->delta, values[1], values[0]);
+ values += 2;
+ break;
+
+ case XSyncCAEvents:
+ mask &= ~XSyncCAEvents;
+ if ((*values != xTrue) && (*values != xFalse))
+ {
+ client->errorValue = *values;
+ return BadValue;
+ }
+ status = SyncEventSelectForAlarm(pAlarm, client,
+ (Bool)(*values++));
+ if (status != Success)
+ return status;
+ break;
+
+ default:
+ client->errorValue = mask;
+ return BadValue;
+ }
+ }
+
+ /* "If the test-type is PositiveComparison or PositiveTransition
+ * and delta is less than zero, or if the test-type is
+ * NegativeComparison or NegativeTransition and delta is
+ * greater than zero, a Match error is generated."
+ */
+ if (origmask & (XSyncCADelta|XSyncCATestType))
+ {
+ CARD64 zero;
+ XSyncIntToValue(&zero, 0);
+ if ((((pAlarm->trigger.test_type == XSyncPositiveComparison) ||
+ (pAlarm->trigger.test_type == XSyncPositiveTransition))
+ && XSyncValueLessThan(pAlarm->delta, zero))
+ ||
+ (((pAlarm->trigger.test_type == XSyncNegativeComparison) ||
+ (pAlarm->trigger.test_type == XSyncNegativeTransition))
+ && XSyncValueGreaterThan(pAlarm->delta, zero))
+ )
+ {
+ return BadMatch;
+ }
+ }
+
+ /* postpone this until now, when we're sure nothing else can go wrong */
+ if ((status = SyncInitTrigger(client, &pAlarm->trigger, counter, RTCounter,
+ origmask & XSyncCAAllTrigger)) != Success)
+ return status;
+
+ /* XXX spec does not really say to do this - needs clarification */
+ pAlarm->state = XSyncAlarmActive;
+ return Success;
+}
+
+static SyncObject *
+SyncCreate(ClientPtr client, XID id, unsigned char type)
+{
+ SyncObject *pSync;
+
+ switch (type) {
+ case SYNC_COUNTER:
+ pSync = malloc(sizeof(SyncCounter));
+ break;
+ case SYNC_FENCE:
+ pSync = (SyncObject*)dixAllocateObjectWithPrivates(SyncFence,
+ PRIVATE_SYNC_FENCE);
+ break;
+ default:
+ return NULL;
+ }
+
+ if (!pSync)
+ return NULL;
+
+ pSync->client = client;
+ pSync->id = id;
+ pSync->pTriglist = NULL;
+ pSync->beingDestroyed = FALSE;
+ pSync->type = type;
+
+ return pSync;
+}
+
+
+static SyncCounter *
+SyncCreateCounter(ClientPtr client, XSyncCounter id, CARD64 initialvalue)
+{
+ SyncCounter *pCounter;
+
+ if (!(pCounter = (SyncCounter *)SyncCreate(client,
+ id,
+ SYNC_COUNTER)))
+ return NULL;
+
+ pCounter->value = initialvalue;
+ pCounter->pSysCounterInfo = NULL;
+
+ if (!AddResource(id, RTCounter, (pointer) pCounter))
+ return NULL;
+
+ return pCounter;
+}
+
+static int FreeCounter(void *, XID);
+
+/*
+ * ***** System Counter utilities
+ */
+
+pointer
+SyncCreateSystemCounter(
+ char *name,
+ CARD64 initial,
+ CARD64 resolution,
+ SyncCounterType counterType,
+ void (*QueryValue)(pointer /* pCounter */,
+ CARD64 * /* pValue_return */),
+ void (*BracketValues)(pointer /* pCounter */,
+ CARD64 * /* pbracket_less */,
+ CARD64 * /* pbracket_greater */)
+ )
+{
+ SyncCounter *pCounter;
+
+ SysCounterList = realloc(SysCounterList,
+ (SyncNumSystemCounters+1)*sizeof(SyncCounter *));
+ if (!SysCounterList)
+ return NULL;
+
+ /* this function may be called before SYNC has been initialized, so we
+ * have to make sure RTCounter is created.
+ */
+ if (RTCounter == 0)
+ {
+ RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter");
+ if (RTCounter == 0)
+ {
+ return NULL;
+ }
+ }
+
+ pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial);
+
+ if (pCounter)
+ {
+ SysCounterInfo *psci;
+
+ psci = malloc(sizeof(SysCounterInfo));
+ if (!psci)
+ {
+ FreeResource(pCounter->sync.id, RT_NONE);
+ return pCounter;
+ }
+ pCounter->pSysCounterInfo = psci;
+ psci->name = name;
+ psci->resolution = resolution;
+ psci->counterType = counterType;
+ psci->QueryValue = QueryValue;
+ psci->BracketValues = BracketValues;
+ XSyncMaxValue(&psci->bracket_greater);
+ XSyncMinValue(&psci->bracket_less);
+ SysCounterList[SyncNumSystemCounters++] = pCounter;
+ }
+ return pCounter;
+}
+
+void
+SyncDestroySystemCounter(pointer pSysCounter)
+{
+ SyncCounter *pCounter = (SyncCounter *)pSysCounter;
+ FreeResource(pCounter->sync.id, RT_NONE);
+}
+
+static void
+SyncComputeBracketValues(SyncCounter *pCounter)
+{
+ SyncTriggerList *pCur;
+ SyncTrigger *pTrigger;
+ SysCounterInfo *psci;
+ CARD64 *pnewgtval = NULL;
+ CARD64 *pnewltval = NULL;
+ SyncCounterType ct;
+
+ if (!pCounter)
+ return;
+
+ psci = pCounter->pSysCounterInfo;
+ ct = pCounter->pSysCounterInfo->counterType;
+ if (ct == XSyncCounterNeverChanges)
+ return;
+
+ XSyncMaxValue(&psci->bracket_greater);
+ XSyncMinValue(&psci->bracket_less);
+
+ for (pCur = pCounter->sync.pTriglist; pCur; pCur = pCur->next)
+ {
+ pTrigger = pCur->pTrigger;
+
+ if (pTrigger->test_type == XSyncPositiveComparison &&
+ ct != XSyncCounterNeverIncreases)
+ {
+ if (XSyncValueLessThan(pCounter->value, pTrigger->test_value) &&
+ XSyncValueLessThan(pTrigger->test_value,
+ psci->bracket_greater))
+ {
+ psci->bracket_greater = pTrigger->test_value;
+ pnewgtval = &psci->bracket_greater;
+ }
+ }
+ else if (pTrigger->test_type == XSyncNegativeComparison &&
+ ct != XSyncCounterNeverDecreases)
+ {
+ if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) &&
+ XSyncValueGreaterThan(pTrigger->test_value,
+ psci->bracket_less))
+ {
+ psci->bracket_less = pTrigger->test_value;
+ pnewltval = &psci->bracket_less;
+ }
+ }
+ else if (pTrigger->test_type == XSyncNegativeTransition &&
+ ct != XSyncCounterNeverIncreases)
+ {
+ if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) &&
+ XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less))
+ {
+ psci->bracket_less = pTrigger->test_value;
+ pnewltval = &psci->bracket_less;
+ } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
+ XSyncValueLessThan(pTrigger->test_value,
+ psci->bracket_greater))
+ {
+ /*
+ * The value is exactly equal to our threshold. We want one
+ * more event in the positive direction to ensure we pick up
+ * when the value *exceeds* this threshold.
+ */
+ psci->bracket_greater = pTrigger->test_value;
+ pnewgtval = &psci->bracket_greater;
+ }
+ }
+ else if (pTrigger->test_type == XSyncPositiveTransition &&
+ ct != XSyncCounterNeverDecreases)
+ {
+ if (XSyncValueLessThan(pCounter->value, pTrigger->test_value) &&
+ XSyncValueLessThan(pTrigger->test_value, psci->bracket_greater))
+ {
+ psci->bracket_greater = pTrigger->test_value;
+ pnewgtval = &psci->bracket_greater;
+ } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) &&
+ XSyncValueGreaterThan(pTrigger->test_value,
+ psci->bracket_less))
+ {
+ /*
+ * The value is exactly equal to our threshold. We want one
+ * more event in the negative direction to ensure we pick up
+ * when the value is less than this threshold.
+ */
+ psci->bracket_less = pTrigger->test_value;
+ pnewltval = &psci->bracket_less;
+ }
+ }
+ } /* end for each trigger */
+
+ if (pnewgtval || pnewltval)
+ {
+ (*psci->BracketValues)((pointer)pCounter, pnewltval, pnewgtval);
+ }
+}
+
+/*
+ * ***** Resource delete functions
+ */
+
+/* ARGSUSED */
+static int
+FreeAlarm(void *addr, XID id)
+{
+ SyncAlarm *pAlarm = (SyncAlarm *) addr;
+
+ pAlarm->state = XSyncAlarmDestroyed;
+
+ SyncSendAlarmNotifyEvents(pAlarm);
+
+ /* delete event selections */
+
+ while (pAlarm->pEventClients)
+ FreeResource(pAlarm->pEventClients->delete_id, RT_NONE);
+
+ SyncDeleteTriggerFromSyncObject(&pAlarm->trigger);
+
+ free(pAlarm);
+ return Success;
+}
+
+
+/*
+ * ** Cleanup after the destruction of a Counter
+ */
+/* ARGSUSED */
+static int
+FreeCounter(void *env, XID id)
+{
+ SyncCounter *pCounter = (SyncCounter *) env;
+ SyncTriggerList *ptl, *pnext;
+
+ pCounter->sync.beingDestroyed = TRUE;
+ /* tell all the counter's triggers that the counter has been destroyed */
+ for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext)
+ {
+ (*ptl->pTrigger->CounterDestroyed)(ptl->pTrigger);
+ pnext = ptl->next;
+ free(ptl); /* destroy the trigger list as we go */
+ }
+ if (IsSystemCounter(pCounter))
+ {
+ int i, found = 0;
+
+ free(pCounter->pSysCounterInfo);
+
+ /* find the counter in the list of system counters and remove it */
+
+ if (SysCounterList)
+ {
+ for (i = 0; i < SyncNumSystemCounters; i++)
+ {
+ if (SysCounterList[i] == pCounter)
+ {
+ found = i;
+ break;
+ }
+ }
+ if (found < (SyncNumSystemCounters-1))
+ {
+ for (i = found; i < SyncNumSystemCounters-1; i++)
+ {
+ SysCounterList[i] = SysCounterList[i+1];
+ }
+ }
+ }
+ SyncNumSystemCounters--;
+ }
+ free(pCounter);
+ return Success;
+}
+
+/*
+ * ** Cleanup after Await
+ */
+/* ARGSUSED */
+static int
+FreeAwait(void *addr, XID id)
+{
+ SyncAwaitUnion *pAwaitUnion = (SyncAwaitUnion *) addr;
+ SyncAwait *pAwait;
+ int numwaits;
+
+ pAwait = &(pAwaitUnion+1)->await; /* first await on list */
+
+ /* remove triggers from counters */
+
+ for (numwaits = pAwaitUnion->header.num_waitconditions; numwaits;
+ numwaits--, pAwait++)
+ {
+ /* If the counter is being destroyed, FreeCounter will delete
+ * the trigger list itself, so don't do it here.
+ */
+ SyncObject *pSync = pAwait->trigger.pSync;
+ if (pSync && !pSync->beingDestroyed)
+ SyncDeleteTriggerFromSyncObject(&pAwait->trigger);
+ }
+ free(pAwaitUnion);
+ return Success;
+}
+
+#ifdef _MSC_VER
+#pragma warning(disable:4715) /* Not all control paths return a value */
+#endif
+
+/* loosely based on dix/events.c/OtherClientGone */
+static int
+FreeAlarmClient(void *value, XID id)
+{
+ SyncAlarm *pAlarm = (SyncAlarm *)value;
+ SyncAlarmClientList *pCur, *pPrev;
+
+ for (pPrev = NULL, pCur = pAlarm->pEventClients;
+ pCur;
+ pPrev = pCur, pCur = pCur->next)
+ {
+ if (pCur->delete_id == id)
+ {
+ if (pPrev)
+ pPrev->next = pCur->next;
+ else
+ pAlarm->pEventClients = pCur->next;
+ free(pCur);
+ return Success;
+ }
+ }
+ FatalError("alarm client not on event list");
+ /*NOTREACHED*/
+}
+
+
+/*
+ * ***** Proc functions
+ */
+
+
+/*
+ * ** Initialize the extension
+ */
+static int
+ProcSyncInitialize(ClientPtr client)
+{
+ xSyncInitializeReply rep;
+ REQUEST_SIZE_MATCH(xSyncInitializeReq);
+
+ memset(&rep, 0, sizeof(xSyncInitializeReply));
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.majorVersion = SERVER_SYNC_MAJOR_VERSION;
+ rep.minorVersion = SERVER_SYNC_MINOR_VERSION;
+ rep.length = 0;
+
+ if (client->swapped)
+ {
+ swaps(&rep.sequenceNumber);
+ }
+ WriteToClient(client, sizeof(rep), (char *) &rep);
+ return Success;
+}
+
+/*
+ * ** Get list of system counters available through the extension
+ */
+static int
+ProcSyncListSystemCounters(ClientPtr client)
+{
+ xSyncListSystemCountersReply rep;
+ int i, len;
+ xSyncSystemCounter *list = NULL, *walklist = NULL;
+
+ REQUEST_SIZE_MATCH(xSyncListSystemCountersReq);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.nCounters = SyncNumSystemCounters;
+
+ for (i = len = 0; i < SyncNumSystemCounters; i++)
+ {
+ char *name = SysCounterList[i]->pSysCounterInfo->name;
+ /* pad to 4 byte boundary */
+ len += pad_to_int32(sz_xSyncSystemCounter + strlen(name));
+ }
+
+ if (len)
+ {
+ walklist = list = malloc(len);
+ if (!list)
+ return BadAlloc;
+ }
+
+ rep.length = bytes_to_int32(len);
+
+ if (client->swapped)
+ {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.nCounters);
+ }
+
+ for (i = 0; i < SyncNumSystemCounters; i++)
+ {
+ int namelen;
+ char *pname_in_reply;
+ SysCounterInfo *psci = SysCounterList[i]->pSysCounterInfo;
+
+ walklist->counter = SysCounterList[i]->sync.id;
+ walklist->resolution_hi = XSyncValueHigh32(psci->resolution);
+ walklist->resolution_lo = XSyncValueLow32(psci->resolution);
+ namelen = strlen(psci->name);
+ walklist->name_length = namelen;
+
+ if (client->swapped)
+ {
+ swapl(&walklist->counter);
+ swapl(&walklist->resolution_hi);
+ swapl(&walklist->resolution_lo);
+ swaps(&walklist->name_length);
+ }
+
+ pname_in_reply = ((char *)walklist) + sz_xSyncSystemCounter;
+ strncpy(pname_in_reply, psci->name, namelen);
+ walklist = (xSyncSystemCounter *) (((char *)walklist) +
+ pad_to_int32(sz_xSyncSystemCounter + namelen));
+ }
+
+ WriteToClient(client, sizeof(rep), (char *) &rep);
+ if (len)
+ {
+ WriteToClient(client, len, (char *) list);
+ free(list);
+ }
+
+ return Success;
+}
+
+/*
+ * ** Set client Priority
+ */
+static int
+ProcSyncSetPriority(ClientPtr client)
+{
+ REQUEST(xSyncSetPriorityReq);
+ ClientPtr priorityclient;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xSyncSetPriorityReq);
+
+ if (stuff->id == None)
+ priorityclient = client;
+ else {
+ rc = dixLookupClient(&priorityclient, stuff->id, client,
+ DixSetAttrAccess);
+ if (rc != Success)
+ return rc;
+ }
+
+ if (priorityclient->priority != stuff->priority)
+ {
+ priorityclient->priority = stuff->priority;
+
+ /* The following will force the server back into WaitForSomething
+ * so that the change in this client's priority is immediately
+ * reflected.
+ */
+ isItTimeToYield = TRUE;
+ dispatchException |= DE_PRIORITYCHANGE;
+ }
+ return Success;
+}
+
+/*
+ * ** Get client Priority
+ */
+static int
+ProcSyncGetPriority(ClientPtr client)
+{
+ REQUEST(xSyncGetPriorityReq);
+ xSyncGetPriorityReply rep;
+ ClientPtr priorityclient;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xSyncGetPriorityReq);
+
+ if (stuff->id == None)
+ priorityclient = client;
+ else {
+ rc = dixLookupClient(&priorityclient, stuff->id, client,
+ DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+ }
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.priority = priorityclient->priority;
+
+ if (client->swapped)
+ {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.priority);
+ }
+
+ WriteToClient(client, sizeof(xSyncGetPriorityReply), (char *) &rep);
+
+ return Success;
+}
+
+/*
+ * ** Create a new counter
+ */
+static int
+ProcSyncCreateCounter(ClientPtr client)
+{
+ REQUEST(xSyncCreateCounterReq);
+ CARD64 initial;
+
+ REQUEST_SIZE_MATCH(xSyncCreateCounterReq);
+
+ LEGAL_NEW_RESOURCE(stuff->cid, client);
+
+ XSyncIntsToValue(&initial, stuff->initial_value_lo, stuff->initial_value_hi);
+ if (!SyncCreateCounter(client, stuff->cid, initial))
+ return BadAlloc;
+
+ return Success;
+}
+
+/*
+ * ** Set Counter value
+ */
+static int
+ProcSyncSetCounter(ClientPtr client)
+{
+ REQUEST(xSyncSetCounterReq);
+ SyncCounter *pCounter;
+ CARD64 newvalue;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xSyncSetCounterReq);
+
+ rc = dixLookupResourceByType((pointer *)&pCounter, stuff->cid, RTCounter,
+ client, DixWriteAccess);
+ if (rc != Success)
+ return rc;
+
+ if (IsSystemCounter(pCounter))
+ {
+ client->errorValue = stuff->cid;
+ return BadAccess;
+ }
+
+ XSyncIntsToValue(&newvalue, stuff->value_lo, stuff->value_hi);
+ SyncChangeCounter(pCounter, newvalue);
+ return Success;
+}
+
+/*
+ * ** Change Counter value
+ */
+static int
+ProcSyncChangeCounter(ClientPtr client)
+{
+ REQUEST(xSyncChangeCounterReq);
+ SyncCounter *pCounter;
+ CARD64 newvalue;
+ Bool overflow;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xSyncChangeCounterReq);
+
+ rc = dixLookupResourceByType((pointer *)&pCounter, stuff->cid, RTCounter,
+ client, DixWriteAccess);
+ if (rc != Success)
+ return rc;
+
+ if (IsSystemCounter(pCounter))
+ {
+ client->errorValue = stuff->cid;
+ return BadAccess;
+ }
+
+ XSyncIntsToValue(&newvalue, stuff->value_lo, stuff->value_hi);
+ XSyncValueAdd(&newvalue, pCounter->value, newvalue, &overflow);
+ if (overflow)
+ {
+ /* XXX 64 bit value can't fit in 32 bits; do the best we can */
+ client->errorValue = stuff->value_hi;
+ return BadValue;
+ }
+ SyncChangeCounter(pCounter, newvalue);
+ return Success;
+}
+
+/*
+ * ** Destroy a counter
+ */
+static int
+ProcSyncDestroyCounter(ClientPtr client)
+{
+ REQUEST(xSyncDestroyCounterReq);
+ SyncCounter *pCounter;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xSyncDestroyCounterReq);
+
+ rc = dixLookupResourceByType((pointer *)&pCounter, stuff->counter, RTCounter,
+ client, DixDestroyAccess);
+ if (rc != Success)
+ return rc;
+
+ if (IsSystemCounter(pCounter))
+ {
+ client->errorValue = stuff->counter;
+ return BadAccess;
+ }
+ FreeResource(pCounter->sync.id, RT_NONE);
+ return Success;
+}
+
+static SyncAwaitUnion*
+SyncAwaitPrologue(ClientPtr client, int items)
+{
+ SyncAwaitUnion *pAwaitUnion;
+
+ /* all the memory for the entire await list is allocated
+ * here in one chunk
+ */
+ pAwaitUnion = malloc((items+1) * sizeof(SyncAwaitUnion));
+ if (!pAwaitUnion)
+ return NULL;
+
+ /* first item is the header, remainder are real wait conditions */
+
+ pAwaitUnion->header.delete_id = FakeClientID(client->index);
+ pAwaitUnion->header.client = client;
+ pAwaitUnion->header.num_waitconditions = 0;
+
+ if (!AddResource(pAwaitUnion->header.delete_id, RTAwait, pAwaitUnion))
+ return NULL;
+
+ return pAwaitUnion;
+}
+
+static void
+SyncAwaitEpilogue(ClientPtr client, int items, SyncAwaitUnion *pAwaitUnion)
+{
+ SyncAwait *pAwait;
+ int i;
+
+ IgnoreClient(client);
+
+ /* see if any of the triggers are already true */
+
+ pAwait = &(pAwaitUnion+1)->await; /* skip over header */
+ for (i = 0; i < items; i++, pAwait++)
+ {
+ CARD64 value;
+
+ /* don't have to worry about NULL counters because the request
+ * errors before we get here out if they occur
+ */
+ switch (pAwait->trigger.pSync->type) {
+ case SYNC_COUNTER:
+ value = ((SyncCounter *)pAwait->trigger.pSync)->value;
+ break;
+ default:
+ XSyncIntToValue(&value, 0);
+ }
+
+ if ((*pAwait->trigger.CheckTrigger)(&pAwait->trigger, value))
+ {
+ (*pAwait->trigger.TriggerFired)(&pAwait->trigger);
+ break; /* once is enough */
+ }
+ }
+}
+
+/*
+ * ** Await
+ */
+static int
+ProcSyncAwait(ClientPtr client)
+{
+ REQUEST(xSyncAwaitReq);
+ int len, items;
+ int i;
+ xSyncWaitCondition *pProtocolWaitConds;
+ SyncAwaitUnion *pAwaitUnion;
+ SyncAwait *pAwait;
+ int status;
+
+ REQUEST_AT_LEAST_SIZE(xSyncAwaitReq);
+
+ len = client->req_len << 2;
+ len -= sz_xSyncAwaitReq;
+ items = len / sz_xSyncWaitCondition;
+
+ if (items * sz_xSyncWaitCondition != len)
+ {
+ return BadLength;
+ }
+ if (items == 0)
+ {
+ client->errorValue = items; /* XXX protocol change */
+ return BadValue;
+ }
+
+ if (!(pAwaitUnion = SyncAwaitPrologue(client, items)))
+ return BadAlloc;
+
+ /* don't need to do any more memory allocation for this request! */
+
+ pProtocolWaitConds = (xSyncWaitCondition *) & stuff[1];
+
+ pAwait = &(pAwaitUnion+1)->await; /* skip over header */
+ for (i = 0; i < items; i++, pProtocolWaitConds++, pAwait++)
+ {
+ if (pProtocolWaitConds->counter == None) /* XXX protocol change */
+ {
+ /* this should take care of removing any triggers created by
+ * this request that have already been registered on sync objects
+ */
+ FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
+ client->errorValue = pProtocolWaitConds->counter;
+ return SyncErrorBase + XSyncBadCounter;
+ }
+
+ /* sanity checks are in SyncInitTrigger */
+ pAwait->trigger.pSync = NULL;
+ pAwait->trigger.value_type = pProtocolWaitConds->value_type;
+ XSyncIntsToValue(&pAwait->trigger.wait_value,
+ pProtocolWaitConds->wait_value_lo,
+ pProtocolWaitConds->wait_value_hi);
+ pAwait->trigger.test_type = pProtocolWaitConds->test_type;
+
+ status = SyncInitTrigger(client, &pAwait->trigger,
+ pProtocolWaitConds->counter, RTCounter,
+ XSyncCAAllTrigger);
+ if (status != Success)
+ {
+ /* this should take care of removing any triggers created by
+ * this request that have already been registered on sync objects
+ */
+ FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
+ return status;
+ }
+ /* this is not a mistake -- same function works for both cases */
+ pAwait->trigger.TriggerFired = SyncAwaitTriggerFired;
+ pAwait->trigger.CounterDestroyed = SyncAwaitTriggerFired;
+ XSyncIntsToValue(&pAwait->event_threshold,
+ pProtocolWaitConds->event_threshold_lo,
+ pProtocolWaitConds->event_threshold_hi);
+ pAwait->pHeader = &pAwaitUnion->header;
+ pAwaitUnion->header.num_waitconditions++;
+ }
+
+ SyncAwaitEpilogue(client, items, pAwaitUnion);
+
+ return Success;
+}
+
+
+/*
+ * ** Query a counter
+ */
+static int
+ProcSyncQueryCounter(ClientPtr client)
+{
+ REQUEST(xSyncQueryCounterReq);
+ xSyncQueryCounterReply rep;
+ SyncCounter *pCounter;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xSyncQueryCounterReq);
+
+ rc = dixLookupResourceByType((pointer *)&pCounter, stuff->counter,
+ RTCounter, client, DixReadAccess);
+ if (rc != Success)
+ return rc;
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ /* if system counter, ask it what the current value is */
+
+ if (IsSystemCounter(pCounter))
+ {
+ (*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter,
+ &pCounter->value);
+ }
+
+ rep.value_hi = XSyncValueHigh32(pCounter->value);
+ rep.value_lo = XSyncValueLow32(pCounter->value);
+ if (client->swapped)
+ {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.value_hi);
+ swapl(&rep.value_lo);
+ }
+ WriteToClient(client, sizeof(xSyncQueryCounterReply), (char *) &rep);
+ return Success;
+}
+
+
+/*
+ * ** Create Alarm
+ */
+static int
+ProcSyncCreateAlarm(ClientPtr client)
+{
+ REQUEST(xSyncCreateAlarmReq);
+ SyncAlarm *pAlarm;
+ int status;
+ unsigned long len, vmask;
+ SyncTrigger *pTrigger;
+
+ REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq);
+
+ LEGAL_NEW_RESOURCE(stuff->id, client);
+
+ vmask = stuff->valueMask;
+ len = client->req_len - bytes_to_int32(sizeof(xSyncCreateAlarmReq));
+ /* the "extra" call to Ones accounts for the presence of 64 bit values */
+ if (len != (Ones(vmask) + Ones(vmask & (XSyncCAValue|XSyncCADelta))))
+ return BadLength;
+
+ if (!(pAlarm = malloc(sizeof(SyncAlarm))))
+ {
+ return BadAlloc;
+ }
+
+ /* set up defaults */
+
+ pTrigger = &pAlarm->trigger;
+ pTrigger->pSync = NULL;
+ pTrigger->value_type = XSyncAbsolute;
+ XSyncIntToValue(&pTrigger->wait_value, 0L);
+ pTrigger->test_type = XSyncPositiveComparison;
+ pTrigger->TriggerFired = SyncAlarmTriggerFired;
+ pTrigger->CounterDestroyed = SyncAlarmCounterDestroyed;
+ status = SyncInitTrigger(client, pTrigger, None, RTCounter,
+ XSyncCAAllTrigger);
+ if (status != Success)
+ {
+ free(pAlarm);
+ return status;
+ }
+
+ pAlarm->client = client;
+ pAlarm->alarm_id = stuff->id;
+ XSyncIntToValue(&pAlarm->delta, 1L);
+ pAlarm->events = TRUE;
+ pAlarm->state = XSyncAlarmInactive;
+ pAlarm->pEventClients = NULL;
+ status = SyncChangeAlarmAttributes(client, pAlarm, vmask,
+ (CARD32 *)&stuff[1]);
+ if (status != Success)
+ {
+ free(pAlarm);
+ return status;
+ }
+
+ if (!AddResource(stuff->id, RTAlarm, pAlarm))
+ return BadAlloc;
+
+ /* see if alarm already triggered. NULL counter will not trigger
+ * in CreateAlarm and sets alarm state to Inactive.
+ */
+
+ if (!pTrigger->pSync)
+ {
+ pAlarm->state = XSyncAlarmInactive; /* XXX protocol change */
+ }
+ else
+ {
+ SyncCounter *pCounter;
+
+ if (!SyncCheckWarnIsCounter(pTrigger->pSync,
+ WARN_INVALID_COUNTER_ALARM))
+ {
+ FreeResource(stuff->id, RT_NONE);
+ return BadAlloc;
+ }
+
+ pCounter = (SyncCounter *)pTrigger->pSync;
+
+ if ((*pTrigger->CheckTrigger)(pTrigger, pCounter->value))
+ (*pTrigger->TriggerFired)(pTrigger);
+ }
+
+ return Success;
+}
+
+/*
+ * ** Change Alarm
+ */
+static int
+ProcSyncChangeAlarm(ClientPtr client)
+{
+ REQUEST(xSyncChangeAlarmReq);
+ SyncAlarm *pAlarm;
+ SyncCounter *pCounter = NULL;
+ long vmask;
+ int len, status;
+
+ REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
+
+ status = dixLookupResourceByType((pointer *)&pAlarm, stuff->alarm, RTAlarm,
+ client, DixWriteAccess);
+ if (status != Success)
+ return status;
+
+ vmask = stuff->valueMask;
+ len = client->req_len - bytes_to_int32(sizeof(xSyncChangeAlarmReq));
+ /* the "extra" call to Ones accounts for the presence of 64 bit values */
+ if (len != (Ones(vmask) + Ones(vmask & (XSyncCAValue|XSyncCADelta))))
+ return BadLength;
+
+ if ((status = SyncChangeAlarmAttributes(client, pAlarm, vmask,
+ (CARD32 *)&stuff[1])) != Success)
+ return status;
+
+ if (SyncCheckWarnIsCounter(pAlarm->trigger.pSync,
+ WARN_INVALID_COUNTER_ALARM))
+ pCounter = (SyncCounter *)pAlarm->trigger.pSync;
+
+ /* see if alarm already triggered. NULL counter WILL trigger
+ * in ChangeAlarm.
+ */
+
+ if (!pCounter ||
+ (*pAlarm->trigger.CheckTrigger)(&pAlarm->trigger, pCounter->value))
+ {
+ (*pAlarm->trigger.TriggerFired)(&pAlarm->trigger);
+ }
+ return Success;
+}
+
+static int
+ProcSyncQueryAlarm(ClientPtr client)
+{
+ REQUEST(xSyncQueryAlarmReq);
+ SyncAlarm *pAlarm;
+ xSyncQueryAlarmReply rep;
+ SyncTrigger *pTrigger;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xSyncQueryAlarmReq);
+
+ rc = dixLookupResourceByType((pointer *)&pAlarm, stuff->alarm, RTAlarm,
+ client, DixReadAccess);
+ if (rc != Success)
+ return rc;
+
+ rep.type = X_Reply;
+ rep.length = bytes_to_int32(sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply));
+ rep.sequenceNumber = client->sequence;
+
+ pTrigger = &pAlarm->trigger;
+ rep.counter = (pTrigger->pSync) ? pTrigger->pSync->id : None;
+
+#if 0 /* XXX unclear what to do, depends on whether relative value-types
+ * are "consumed" immediately and are considered absolute from then
+ * on.
+ */
+ rep.value_type = pTrigger->value_type;
+ rep.wait_value_hi = XSyncValueHigh32(pTrigger->wait_value);
+ rep.wait_value_lo = XSyncValueLow32(pTrigger->wait_value);
+#else
+ rep.value_type = XSyncAbsolute;
+ rep.wait_value_hi = XSyncValueHigh32(pTrigger->test_value);
+ rep.wait_value_lo = XSyncValueLow32(pTrigger->test_value);
+#endif
+
+ rep.test_type = pTrigger->test_type;
+ rep.delta_hi = XSyncValueHigh32(pAlarm->delta);
+ rep.delta_lo = XSyncValueLow32(pAlarm->delta);
+ rep.events = pAlarm->events;
+ rep.state = pAlarm->state;
+
+ if (client->swapped)
+ {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.counter);
+ swapl(&rep.wait_value_hi);
+ swapl(&rep.wait_value_lo);
+ swapl(&rep.test_type);
+ swapl(&rep.delta_hi);
+ swapl(&rep.delta_lo);
+ }
+
+ WriteToClient(client, sizeof(xSyncQueryAlarmReply), (char *) &rep);
+ return Success;
+}
+
+static int
+ProcSyncDestroyAlarm(ClientPtr client)
+{
+ SyncAlarm *pAlarm;
+ int rc;
+ REQUEST(xSyncDestroyAlarmReq);
+
+ REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq);
+
+ rc = dixLookupResourceByType((pointer *)&pAlarm, stuff->alarm, RTAlarm,
+ client, DixDestroyAccess);
+ if (rc != Success)
+ return rc;
+
+ FreeResource(stuff->alarm, RT_NONE);
+ return Success;
+}
+
+static int
+ProcSyncCreateFence(ClientPtr client)
+{
+ REQUEST(xSyncCreateFenceReq);
+ DrawablePtr pDraw;
+ SyncFence *pFence;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xSyncCreateFenceReq);
+
+ rc = dixLookupDrawable(&pDraw, stuff->d, client, M_ANY, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ LEGAL_NEW_RESOURCE(stuff->fid, client);
+
+ if (!(pFence = (SyncFence *)SyncCreate(client,
+ stuff->fid,
+ SYNC_FENCE)))
+ return BadAlloc;
+
+ miSyncInitFence(pDraw->pScreen, pFence, stuff->initially_triggered);
+
+ if (!AddResource(stuff->fid, RTFence, (pointer) pFence))
+ return BadAlloc;
+
+ return client->noClientException;
+}
+
+static int
+FreeFence(void *obj, XID id)
+{
+ SyncFence *pFence = (SyncFence *) obj;
+
+ miSyncDestroyFence(pFence);
+
+ return Success;
+}
+
+int SyncVerifyFence(SyncFence **ppSyncFence, XID fid,
+ ClientPtr client, Mask mode)
+{
+ int rc = dixLookupResourceByType((pointer *)ppSyncFence, fid, RTFence,
+ client, mode);
+
+ if (rc != Success)
+ client->errorValue = fid;
+
+ return rc;
+}
+
+static int
+ProcSyncTriggerFence(ClientPtr client)
+{
+ REQUEST(xSyncTriggerFenceReq);
+ SyncFence *pFence;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xSyncTriggerFenceReq);
+
+ rc = dixLookupResourceByType((pointer *)&pFence, stuff->fid, RTFence,
+ client, DixWriteAccess);
+ if (rc != Success)
+ return rc;
+
+ miSyncTriggerFence(pFence);
+
+ return client->noClientException;
+}
+
+static int
+ProcSyncResetFence(ClientPtr client)
+{
+ REQUEST(xSyncResetFenceReq);
+ SyncFence *pFence;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xSyncResetFenceReq);
+
+ rc = dixLookupResourceByType((pointer *)&pFence, stuff->fid, RTFence,
+ client, DixWriteAccess);
+ if (rc != Success)
+ return rc;
+
+ if (pFence->funcs.CheckTriggered(pFence) != TRUE)
+ return BadMatch;
+
+ pFence->funcs.Reset(pFence);
+
+ return client->noClientException;
+}
+
+static int
+ProcSyncDestroyFence(ClientPtr client)
+{
+ REQUEST(xSyncDestroyFenceReq);
+ SyncFence *pFence;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xSyncDestroyFenceReq);
+
+ rc = dixLookupResourceByType((pointer *)&pFence, stuff->fid, RTFence,
+ client, DixDestroyAccess);
+ if (rc != Success)
+ return rc;
+
+ FreeResource(stuff->fid, RT_NONE);
+ return client->noClientException;
+}
+
+static int
+ProcSyncQueryFence(ClientPtr client)
+{
+ REQUEST(xSyncQueryFenceReq);
+ xSyncQueryFenceReply rep;
+ SyncFence *pFence;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xSyncQueryFenceReq);
+
+ rc = dixLookupResourceByType((pointer *)&pFence, stuff->fid,
+ RTFence, client, DixReadAccess);
+ if (rc != Success)
+ return rc;
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ rep.triggered = pFence->funcs.CheckTriggered(pFence);
+
+ if (client->swapped)
+ {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ }
+
+ WriteToClient(client, sizeof(xSyncQueryFenceReply), (char *) &rep);
+ return client->noClientException;
+}
+
+static int
+ProcSyncAwaitFence(ClientPtr client)
+{
+ REQUEST(xSyncAwaitFenceReq);
+ SyncAwaitUnion *pAwaitUnion;
+ SyncAwait *pAwait;
+ /* Use CARD32 rather than XSyncFence because XIDs are hard-coded to
+ * CARD32 in protocol definitions */
+ CARD32 *pProtocolFences;
+ int status;
+ int len;
+ int items;
+ int i;
+
+ REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq);
+
+ len = client->req_len << 2;
+ len -= sz_xSyncAwaitFenceReq;
+ items = len / sizeof(CARD32);
+
+ if (items * sizeof(CARD32) != len)
+ {
+ return BadLength;
+ }
+ if (items == 0)
+ {
+ client->errorValue = items;
+ return BadValue;
+ }
+
+ if (!(pAwaitUnion = SyncAwaitPrologue(client, items)))
+ return BadAlloc;
+
+ /* don't need to do any more memory allocation for this request! */
+
+ pProtocolFences = (CARD32 *) & stuff[1];
+
+ pAwait = &(pAwaitUnion+1)->await; /* skip over header */
+ for (i = 0; i < items; i++, pProtocolFences++, pAwait++)
+ {
+ if (*pProtocolFences == None)
+ {
+ /* this should take care of removing any triggers created by
+ * this request that have already been registered on sync objects
+ */
+ FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
+ client->errorValue = *pProtocolFences;
+ return SyncErrorBase + XSyncBadFence;
+ }
+
+ pAwait->trigger.pSync = NULL;
+ /* Provide acceptable values for these unused fields to
+ * satisfy SyncInitTrigger's validation logic
+ */
+ pAwait->trigger.value_type = XSyncAbsolute;
+ XSyncIntToValue(&pAwait->trigger.wait_value, 0);
+ pAwait->trigger.test_type = 0;
+
+ status = SyncInitTrigger(client, &pAwait->trigger,
+ *pProtocolFences, RTFence,
+ XSyncCAAllTrigger);
+ if (status != Success)
+ {
+ /* this should take care of removing any triggers created by
+ * this request that have already been registered on sync objects
+ */
+ FreeResource(pAwaitUnion->header.delete_id, RT_NONE);
+ return status;
+ }
+ /* this is not a mistake -- same function works for both cases */
+ pAwait->trigger.TriggerFired = SyncAwaitTriggerFired;
+ pAwait->trigger.CounterDestroyed = SyncAwaitTriggerFired;
+ /* event_threshold is unused for fence syncs */
+ XSyncIntToValue(&pAwait->event_threshold, 0);
+ pAwait->pHeader = &pAwaitUnion->header;
+ pAwaitUnion->header.num_waitconditions++;
+ }
+
+ SyncAwaitEpilogue(client, items, pAwaitUnion);
+
+ return client->noClientException;
+}
+
+/*
+ * ** Given an extension request, call the appropriate request procedure
+ */
+static int
+ProcSyncDispatch(ClientPtr client)
+{
+ REQUEST(xReq);
+
+ switch (stuff->data)
+ {
+ case X_SyncInitialize:
+ return ProcSyncInitialize(client);
+ case X_SyncListSystemCounters:
+ return ProcSyncListSystemCounters(client);
+ case X_SyncCreateCounter:
+ return ProcSyncCreateCounter(client);
+ case X_SyncSetCounter:
+ return ProcSyncSetCounter(client);
+ case X_SyncChangeCounter:
+ return ProcSyncChangeCounter(client);
+ case X_SyncQueryCounter:
+ return ProcSyncQueryCounter(client);
+ case X_SyncDestroyCounter:
+ return ProcSyncDestroyCounter(client);
+ case X_SyncAwait:
+ return ProcSyncAwait(client);
+ case X_SyncCreateAlarm:
+ return ProcSyncCreateAlarm(client);
+ case X_SyncChangeAlarm:
+ return ProcSyncChangeAlarm(client);
+ case X_SyncQueryAlarm:
+ return ProcSyncQueryAlarm(client);
+ case X_SyncDestroyAlarm:
+ return ProcSyncDestroyAlarm(client);
+ case X_SyncSetPriority:
+ return ProcSyncSetPriority(client);
+ case X_SyncGetPriority:
+ return ProcSyncGetPriority(client);
+ case X_SyncCreateFence:
+ return ProcSyncCreateFence(client);
+ case X_SyncTriggerFence:
+ return ProcSyncTriggerFence(client);
+ case X_SyncResetFence:
+ return ProcSyncResetFence(client);
+ case X_SyncDestroyFence:
+ return ProcSyncDestroyFence(client);
+ case X_SyncQueryFence:
+ return ProcSyncQueryFence(client);
+ case X_SyncAwaitFence:
+ return ProcSyncAwaitFence(client);
+ default:
+ return BadRequest;
+ }
+}
+
+/*
+ * Boring Swapping stuff ...
+ */
+
+static int
+SProcSyncInitialize(ClientPtr client)
+{
+ REQUEST(xSyncInitializeReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xSyncInitializeReq);
+
+ return ProcSyncInitialize(client);
+}
+
+static int
+SProcSyncListSystemCounters(ClientPtr client)
+{
+ REQUEST(xSyncListSystemCountersReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xSyncListSystemCountersReq);
+
+ return ProcSyncListSystemCounters(client);
+}
+
+static int
+SProcSyncCreateCounter(ClientPtr client)
+{
+ REQUEST(xSyncCreateCounterReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xSyncCreateCounterReq);
+ swapl(&stuff->cid);
+ swapl(&stuff->initial_value_lo);
+ swapl(&stuff->initial_value_hi);
+
+ return ProcSyncCreateCounter(client);
+}
+
+static int
+SProcSyncSetCounter(ClientPtr client)
+{
+ REQUEST(xSyncSetCounterReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xSyncSetCounterReq);
+ swapl(&stuff->cid);
+ swapl(&stuff->value_lo);
+ swapl(&stuff->value_hi);
+
+ return ProcSyncSetCounter(client);
+}
+
+static int
+SProcSyncChangeCounter(ClientPtr client)
+{
+ REQUEST(xSyncChangeCounterReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xSyncChangeCounterReq);
+ swapl(&stuff->cid);
+ swapl(&stuff->value_lo);
+ swapl(&stuff->value_hi);
+
+ return ProcSyncChangeCounter(client);
+}
+
+static int
+SProcSyncQueryCounter(ClientPtr client)
+{
+ REQUEST(xSyncQueryCounterReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xSyncQueryCounterReq);
+ swapl(&stuff->counter);
+
+ return ProcSyncQueryCounter(client);
+}
+
+static int
+SProcSyncDestroyCounter(ClientPtr client)
+{
+ REQUEST(xSyncDestroyCounterReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xSyncDestroyCounterReq);
+ swapl(&stuff->counter);
+
+ return ProcSyncDestroyCounter(client);
+}
+
+static int
+SProcSyncAwait(ClientPtr client)
+{
+ REQUEST(xSyncAwaitReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xSyncAwaitReq);
+ SwapRestL(stuff);
+
+ return ProcSyncAwait(client);
+}
+
+static int
+SProcSyncCreateAlarm(ClientPtr client)
+{
+ REQUEST(xSyncCreateAlarmReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq);
+ swapl(&stuff->id);
+ swapl(&stuff->valueMask);
+ SwapRestL(stuff);
+
+ return ProcSyncCreateAlarm(client);
+}
+
+static int
+SProcSyncChangeAlarm(ClientPtr client)
+{
+ REQUEST(xSyncChangeAlarmReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq);
+ swapl(&stuff->alarm);
+ swapl(&stuff->valueMask);
+ SwapRestL(stuff);
+ return ProcSyncChangeAlarm(client);
+}
+
+static int
+SProcSyncQueryAlarm(ClientPtr client)
+{
+ REQUEST(xSyncQueryAlarmReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xSyncQueryAlarmReq);
+ swapl(&stuff->alarm);
+
+ return ProcSyncQueryAlarm(client);
+}
+
+static int
+SProcSyncDestroyAlarm(ClientPtr client)
+{
+ REQUEST(xSyncDestroyAlarmReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xSyncDestroyAlarmReq);
+ swapl(&stuff->alarm);
+
+ return ProcSyncDestroyAlarm(client);
+}
+
+static int
+SProcSyncSetPriority(ClientPtr client)
+{
+ REQUEST(xSyncSetPriorityReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xSyncSetPriorityReq);
+ swapl(&stuff->id);
+ swapl(&stuff->priority);
+
+ return ProcSyncSetPriority(client);
+}
+
+static int
+SProcSyncGetPriority(ClientPtr client)
+{
+ REQUEST(xSyncGetPriorityReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xSyncGetPriorityReq);
+ swapl(&stuff->id);
+
+ return ProcSyncGetPriority(client);
+}
+
+static int
+SProcSyncCreateFence(ClientPtr client)
+{
+ REQUEST(xSyncCreateFenceReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xSyncCreateFenceReq);
+ swapl(&stuff->fid);
+
+ return ProcSyncCreateFence(client);
+}
+
+static int
+SProcSyncTriggerFence(ClientPtr client)
+{
+ REQUEST(xSyncTriggerFenceReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xSyncTriggerFenceReq);
+ swapl(&stuff->fid);
+
+ return ProcSyncTriggerFence(client);
+}
+
+static int
+SProcSyncResetFence(ClientPtr client)
+{
+ REQUEST(xSyncResetFenceReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xSyncResetFenceReq);
+ swapl(&stuff->fid);
+
+ return ProcSyncResetFence(client);
+}
+
+static int
+SProcSyncDestroyFence(ClientPtr client)
+{
+ REQUEST(xSyncDestroyFenceReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xSyncDestroyFenceReq);
+ swapl(&stuff->fid);
+
+ return ProcSyncDestroyFence(client);
+}
+
+static int
+SProcSyncQueryFence(ClientPtr client)
+{
+ REQUEST(xSyncQueryFenceReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xSyncQueryFenceReq);
+ swapl(&stuff->fid);
+
+ return ProcSyncQueryFence(client);
+}
+
+static int
+SProcSyncAwaitFence(ClientPtr client)
+{
+ REQUEST(xSyncAwaitFenceReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xSyncAwaitFenceReq);
+ SwapRestL(stuff);
+
+ return ProcSyncAwaitFence(client);
+}
+
+static int
+SProcSyncDispatch(ClientPtr client)
+{
+ REQUEST(xReq);
+
+ switch (stuff->data)
+ {
+ case X_SyncInitialize:
+ return SProcSyncInitialize(client);
+ case X_SyncListSystemCounters:
+ return SProcSyncListSystemCounters(client);
+ case X_SyncCreateCounter:
+ return SProcSyncCreateCounter(client);
+ case X_SyncSetCounter:
+ return SProcSyncSetCounter(client);
+ case X_SyncChangeCounter:
+ return SProcSyncChangeCounter(client);
+ case X_SyncQueryCounter:
+ return SProcSyncQueryCounter(client);
+ case X_SyncDestroyCounter:
+ return SProcSyncDestroyCounter(client);
+ case X_SyncAwait:
+ return SProcSyncAwait(client);
+ case X_SyncCreateAlarm:
+ return SProcSyncCreateAlarm(client);
+ case X_SyncChangeAlarm:
+ return SProcSyncChangeAlarm(client);
+ case X_SyncQueryAlarm:
+ return SProcSyncQueryAlarm(client);
+ case X_SyncDestroyAlarm:
+ return SProcSyncDestroyAlarm(client);
+ case X_SyncSetPriority:
+ return SProcSyncSetPriority(client);
+ case X_SyncGetPriority:
+ return SProcSyncGetPriority(client);
+ case X_SyncCreateFence:
+ return SProcSyncCreateFence(client);
+ case X_SyncTriggerFence:
+ return SProcSyncTriggerFence(client);
+ case X_SyncResetFence:
+ return SProcSyncResetFence(client);
+ case X_SyncDestroyFence:
+ return SProcSyncDestroyFence(client);
+ case X_SyncQueryFence:
+ return SProcSyncQueryFence(client);
+ case X_SyncAwaitFence:
+ return SProcSyncAwaitFence(client);
+ default:
+ return BadRequest;
+ }
+}
+
+/*
+ * Event Swapping
+ */
+
+static void
+SCounterNotifyEvent(xSyncCounterNotifyEvent *from, xSyncCounterNotifyEvent *to)
+{
+ to->type = from->type;
+ to->kind = from->kind;
+ cpswaps(from->sequenceNumber, to->sequenceNumber);
+ cpswapl(from->counter, to->counter);
+ cpswapl(from->wait_value_lo, to->wait_value_lo);
+ cpswapl(from->wait_value_hi, to->wait_value_hi);
+ cpswapl(from->counter_value_lo, to->counter_value_lo);
+ cpswapl(from->counter_value_hi, to->counter_value_hi);
+ cpswapl(from->time, to->time);
+ cpswaps(from->count, to->count);
+ to->destroyed = from->destroyed;
+}
+
+
+static void
+SAlarmNotifyEvent(xSyncAlarmNotifyEvent *from, xSyncAlarmNotifyEvent *to)
+{
+ to->type = from->type;
+ to->kind = from->kind;
+ cpswaps(from->sequenceNumber, to->sequenceNumber);
+ cpswapl(from->alarm, to->alarm);
+ cpswapl(from->counter_value_lo, to->counter_value_lo);
+ cpswapl(from->counter_value_hi, to->counter_value_hi);
+ cpswapl(from->alarm_value_lo, to->alarm_value_lo);
+ cpswapl(from->alarm_value_hi, to->alarm_value_hi);
+ cpswapl(from->time, to->time);
+ to->state = from->state;
+}
+
+/*
+ * ** Close everything down. ** This is fairly simple for now.
+ */
+/* ARGSUSED */
+static void
+SyncResetProc(ExtensionEntry *extEntry)
+{
+ free(SysCounterList);
+ SysCounterList = NULL;
+ RTCounter = 0;
+}
+
+/*
+ * ** Initialise the extension.
+ */
+void
+SyncExtensionInit(void)
+{
+ ExtensionEntry *extEntry;
+ int s;
+
+ for (s = 0; s < screenInfo.numScreens; s++)
+ miSyncSetup(screenInfo.screens[s]);
+
+ if (RTCounter == 0)
+ {
+ RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter");
+ }
+ RTAlarm = CreateNewResourceType(FreeAlarm, "SyncAlarm");
+ RTAwait = CreateNewResourceType(FreeAwait, "SyncAwait");
+ RTFence = CreateNewResourceType(FreeFence, "SyncFence");
+ if (RTAwait)
+ RTAwait |= RC_NEVERRETAIN;
+ RTAlarmClient = CreateNewResourceType(FreeAlarmClient, "SyncAlarmClient");
+ if (RTAlarmClient)
+ RTAlarmClient |= RC_NEVERRETAIN;
+
+ if (RTCounter == 0 || RTAwait == 0 || RTAlarm == 0 ||
+ RTAlarmClient == 0 ||
+ (extEntry = AddExtension(SYNC_NAME,
+ XSyncNumberEvents, XSyncNumberErrors,
+ ProcSyncDispatch, SProcSyncDispatch,
+ SyncResetProc,
+ StandardMinorOpcode)) == NULL)
+ {
+ ErrorF("Sync Extension %d.%d failed to Initialise\n",
+ SYNC_MAJOR_VERSION, SYNC_MINOR_VERSION);
+ return;
+ }
+
+ SyncEventBase = extEntry->eventBase;
+ SyncErrorBase = extEntry->errorBase;
+ EventSwapVector[SyncEventBase + XSyncCounterNotify] = (EventSwapPtr) SCounterNotifyEvent;
+ EventSwapVector[SyncEventBase + XSyncAlarmNotify] = (EventSwapPtr) SAlarmNotifyEvent;
+
+ SetResourceTypeErrorValue(RTCounter, SyncErrorBase + XSyncBadCounter);
+ SetResourceTypeErrorValue(RTAlarm, SyncErrorBase + XSyncBadAlarm);
+ SetResourceTypeErrorValue(RTFence, SyncErrorBase + XSyncBadFence);
+
+ /*
+ * Although SERVERTIME is implemented by the OS layer, we initialise it
+ * here because doing it in OsInit() is too early. The resource database
+ * is not initialised when OsInit() is called. This is just about OK
+ * because there is always a servertime counter.
+ */
+ SyncInitServerTime();
+ SyncInitIdleTime();
+
+#ifdef DEBUG
+ fprintf(stderr, "Sync Extension %d.%d\n",
+ SYNC_MAJOR_VERSION, SYNC_MINOR_VERSION);
+#endif
+}
+
+
+/*
+ * ***** SERVERTIME implementation - should go in its own file in OS directory?
+ */
+
+
+
+static pointer ServertimeCounter;
+static XSyncValue Now;
+static XSyncValue *pnext_time;
+
+#define GetTime()\
+{\
+ unsigned long millis = GetTimeInMillis();\
+ unsigned long maxis = XSyncValueHigh32(Now);\
+ if (millis < XSyncValueLow32(Now)) maxis++;\
+ XSyncIntsToValue(&Now, millis, maxis);\
+}
+
+/*
+*** Server Block Handler
+*** code inspired by multibuffer extension (now deprecated)
+ */
+/*ARGSUSED*/
+static void
+ServertimeBlockHandler(void *env, struct timeval **wt, void *LastSelectMask)
+{
+ XSyncValue delay;
+ unsigned long timeout;
+
+ if (pnext_time)
+ {
+ GetTime();
+
+ if (XSyncValueGreaterOrEqual(Now, *pnext_time))
+ {
+ timeout = 0;
+ }
+ else
+ {
+ Bool overflow;
+ XSyncValueSubtract(&delay, *pnext_time, Now, &overflow);
+ (void)overflow;
+ timeout = XSyncValueLow32(delay);
+ }
+ AdjustWaitForDelay(wt, timeout); /* os/utils.c */
+ }
+}
+
+/*
+*** Wakeup Handler
+ */
+/*ARGSUSED*/
+static void
+ServertimeWakeupHandler(void *env, int rc, void *LastSelectMask)
+{
+ if (pnext_time)
+ {
+ GetTime();
+
+ if (XSyncValueGreaterOrEqual(Now, *pnext_time))
+ {
+ SyncChangeCounter(ServertimeCounter, Now);
+ }
+ }
+}
+
+static void
+ServertimeQueryValue(void *pCounter, CARD64 *pValue_return)
+{
+ GetTime();
+ *pValue_return = Now;
+}
+
+static void
+ServertimeBracketValues(void *pCounter, CARD64 *pbracket_less,
+ CARD64 *pbracket_greater)
+{
+ if (!pnext_time && pbracket_greater)
+ {
+ RegisterBlockAndWakeupHandlers(ServertimeBlockHandler,
+ ServertimeWakeupHandler,
+ NULL);
+ }
+ else if (pnext_time && !pbracket_greater)
+ {
+ RemoveBlockAndWakeupHandlers(ServertimeBlockHandler,
+ ServertimeWakeupHandler,
+ NULL);
+ }
+ pnext_time = pbracket_greater;
+}
+
+static void
+SyncInitServerTime(void)
+{
+ CARD64 resolution;
+
+ XSyncIntsToValue(&Now, GetTimeInMillis(), 0);
+ XSyncIntToValue(&resolution, 4);
+ ServertimeCounter = SyncCreateSystemCounter("SERVERTIME", Now, resolution,
+ XSyncCounterNeverDecreases,
+ ServertimeQueryValue, ServertimeBracketValues);
+ pnext_time = NULL;
+}
+
+
+
+/*
+ * IDLETIME implementation
+ */
+
+static SyncCounter *IdleTimeCounter;
+static XSyncValue *pIdleTimeValueLess;
+static XSyncValue *pIdleTimeValueGreater;
+
+static void
+IdleTimeQueryValue (pointer pCounter, CARD64 *pValue_return)
+{
+ CARD32 idle = GetTimeInMillis() - lastDeviceEventTime.milliseconds;
+ XSyncIntsToValue (pValue_return, idle, 0);
+}
+
+static void
+IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask)
+{
+ XSyncValue idle, old_idle;
+ SyncTriggerList *list = IdleTimeCounter->sync.pTriglist;
+ SyncTrigger *trig;
+
+ if (!pIdleTimeValueLess && !pIdleTimeValueGreater)
+ return;
+
+ old_idle = IdleTimeCounter->value;
+ IdleTimeQueryValue (NULL, &idle);
+ IdleTimeCounter->value = idle; /* push, so CheckTrigger works */
+
+ if (pIdleTimeValueLess &&
+ XSyncValueLessOrEqual (idle, *pIdleTimeValueLess))
+ {
+ /*
+ * We've been idle for less than the threshold value, and someone
+ * wants to know about that, but now we need to know whether they
+ * want level or edge trigger. Check the trigger list against the
+ * current idle time, and if any succeed, bomb out of select()
+ * immediately so we can reschedule.
+ */
+
+ for (list = IdleTimeCounter->sync.pTriglist; list; list = list->next) {
+ trig = list->pTrigger;
+ if (trig->CheckTrigger(trig, old_idle)) {
+ AdjustWaitForDelay(wt, 0);
+ break;
+ }
+ }
+ /*
+ * We've been called exactly on the idle time, but we have a
+ * NegativeTransition trigger which requires a transition from an
+ * idle time greater than this. Schedule a wakeup for the next
+ * millisecond so we won't miss a transition.
+ */
+ if (XSyncValueEqual (idle, *pIdleTimeValueLess))
+ AdjustWaitForDelay(wt, 1);
+ }
+ else if (pIdleTimeValueGreater)
+ {
+ /*
+ * There's a threshold in the positive direction. If we've been
+ * idle less than it, schedule a wakeup for sometime in the future.
+ * If we've been idle more than it, and someone wants to know about
+ * that level-triggered, schedule an immediate wakeup.
+ */
+ unsigned long timeout = -1;
+
+ if (XSyncValueLessThan (idle, *pIdleTimeValueGreater)) {
+ XSyncValue value;
+ Bool overflow;
+
+ XSyncValueSubtract (&value, *pIdleTimeValueGreater,
+ idle, &overflow);
+ timeout = min(timeout, XSyncValueLow32 (value));
+ } else {
+ for (list = IdleTimeCounter->sync.pTriglist; list; list = list->next) {
+ trig = list->pTrigger;
+ if (trig->CheckTrigger(trig, old_idle)) {
+ timeout = min(timeout, 0);
+ break;
+ }
+ }
+ }
+
+ AdjustWaitForDelay (wt, timeout);
+ }
+
+ IdleTimeCounter->value = old_idle; /* pop */
+}
+
+static void
+IdleTimeWakeupHandler (pointer env, int rc, pointer LastSelectMask)
+{
+ XSyncValue idle;
+
+ if (!pIdleTimeValueLess && !pIdleTimeValueGreater)
+ return;
+
+ IdleTimeQueryValue (NULL, &idle);
+
+ if ((pIdleTimeValueGreater &&
+ XSyncValueGreaterOrEqual (idle, *pIdleTimeValueGreater)) ||
+ (pIdleTimeValueLess &&
+ XSyncValueLessOrEqual (idle, *pIdleTimeValueLess)))
+ {
+ SyncChangeCounter (IdleTimeCounter, idle);
+ }
+}
+
+static void
+IdleTimeBracketValues (pointer pCounter, CARD64 *pbracket_less,
+ CARD64 *pbracket_greater)
+{
+ Bool registered = (pIdleTimeValueLess || pIdleTimeValueGreater);
+
+ if (registered && !pbracket_less && !pbracket_greater)
+ {
+ RemoveBlockAndWakeupHandlers(IdleTimeBlockHandler,
+ IdleTimeWakeupHandler,
+ NULL);
+ }
+ else if (!registered && (pbracket_less || pbracket_greater))
+ {
+ RegisterBlockAndWakeupHandlers(IdleTimeBlockHandler,
+ IdleTimeWakeupHandler,
+ NULL);
+ }
+
+ pIdleTimeValueGreater = pbracket_greater;
+ pIdleTimeValueLess = pbracket_less;
+}
+
+static void
+SyncInitIdleTime (void)
+{
+ CARD64 resolution;
+ XSyncValue idle;
+
+ IdleTimeQueryValue (NULL, &idle);
+ XSyncIntToValue (&resolution, 4);
+
+ IdleTimeCounter = SyncCreateSystemCounter ("IDLETIME", idle, resolution,
+ XSyncCounterUnrestricted,
+ IdleTimeQueryValue,
+ IdleTimeBracketValues);
+
+ pIdleTimeValueLess = pIdleTimeValueGreater = NULL;
+}
diff --git a/xorg-server/Xext/xcmisc.c b/xorg-server/Xext/xcmisc.c
index 8dfe4d136..8e3c9cd80 100644
--- a/xorg-server/Xext/xcmisc.c
+++ b/xorg-server/Xext/xcmisc.c
@@ -1,207 +1,201 @@
-/*
-
-Copyright 1993, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "swaprep.h"
-#include <X11/extensions/xcmiscproto.h>
-#include "modinit.h"
-
-#if HAVE_STDINT_H
-#include <stdint.h>
-#elif !defined(UINT32_MAX)
-#define UINT32_MAX 0xffffffffU
-#endif
-
-
-static int
-ProcXCMiscGetVersion(ClientPtr client)
-{
- xXCMiscGetVersionReply rep;
- int n;
-
- REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = XCMiscMajorVersion;
- rep.minorVersion = XCMiscMinorVersion;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof(xXCMiscGetVersionReply), (char *)&rep);
- return Success;
-}
-
-static int
-ProcXCMiscGetXIDRange(ClientPtr client)
-{
- xXCMiscGetXIDRangeReply rep;
- int n;
- XID min_id, max_id;
-
- REQUEST_SIZE_MATCH(xXCMiscGetXIDRangeReq);
- GetXIDRange(client->index, FALSE, &min_id, &max_id);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.start_id = min_id;
- rep.count = max_id - min_id + 1;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.start_id, n);
- swapl(&rep.count, n);
- }
- WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), (char *)&rep);
- return Success;
-}
-
-static int
-ProcXCMiscGetXIDList(ClientPtr client)
-{
- REQUEST(xXCMiscGetXIDListReq);
- xXCMiscGetXIDListReply rep;
- int n;
- XID *pids;
- unsigned int count;
-
- REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
-
- if (stuff->count > UINT32_MAX / sizeof(XID))
- return BadAlloc;
-
- pids = (XID *)malloc(stuff->count * sizeof(XID));
- if (!pids)
- {
- return BadAlloc;
- }
- count = GetXIDList(client, stuff->count, pids);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = count;
- rep.count = count;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.count, n);
- }
- WriteToClient(client, sizeof(xXCMiscGetXIDListReply), (char *)&rep);
- if (count)
- {
- client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
- WriteSwappedDataToClient(client, count * sizeof(XID), pids);
- }
- free(pids);
- return Success;
-}
-
-static int
-ProcXCMiscDispatch (ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_XCMiscGetVersion:
- return ProcXCMiscGetVersion(client);
- case X_XCMiscGetXIDRange:
- return ProcXCMiscGetXIDRange(client);
- case X_XCMiscGetXIDList:
- return ProcXCMiscGetXIDList(client);
- default:
- return BadRequest;
- }
-}
-
-static int
-SProcXCMiscGetVersion(ClientPtr client)
-{
- int n;
- REQUEST(xXCMiscGetVersionReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
- swaps(&stuff->majorVersion, n);
- swaps(&stuff->minorVersion, n);
- return ProcXCMiscGetVersion(client);
-}
-
-static int
-SProcXCMiscGetXIDRange(ClientPtr client)
-{
- int n;
- REQUEST(xReq);
-
- swaps(&stuff->length, n);
- return ProcXCMiscGetXIDRange(client);
-}
-
-static int
-SProcXCMiscGetXIDList(ClientPtr client)
-{
- int n;
- REQUEST(xXCMiscGetXIDListReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->count, n);
- return ProcXCMiscGetXIDList(client);
-}
-
-static int
-SProcXCMiscDispatch (ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_XCMiscGetVersion:
- return SProcXCMiscGetVersion(client);
- case X_XCMiscGetXIDRange:
- return SProcXCMiscGetXIDRange(client);
- case X_XCMiscGetXIDList:
- return SProcXCMiscGetXIDList(client);
- default:
- return BadRequest;
- }
-}
-
-void
-XCMiscExtensionInit(INITARGS)
-{
- AddExtension(XCMiscExtensionName, 0, 0,
- ProcXCMiscDispatch, SProcXCMiscDispatch,
- NULL, StandardMinorOpcode);
-}
+/*
+
+Copyright 1993, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "os.h"
+#include "dixstruct.h"
+#include "extnsionst.h"
+#include "swaprep.h"
+#include <X11/extensions/xcmiscproto.h>
+#include "modinit.h"
+
+#if HAVE_STDINT_H
+#include <stdint.h>
+#elif !defined(UINT32_MAX)
+#define UINT32_MAX 0xffffffffU
+#endif
+
+
+static int
+ProcXCMiscGetVersion(ClientPtr client)
+{
+ xXCMiscGetVersionReply rep;
+
+ REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.majorVersion = XCMiscMajorVersion;
+ rep.minorVersion = XCMiscMinorVersion;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swaps(&rep.majorVersion);
+ swaps(&rep.minorVersion);
+ }
+ WriteToClient(client, sizeof(xXCMiscGetVersionReply), (char *)&rep);
+ return Success;
+}
+
+static int
+ProcXCMiscGetXIDRange(ClientPtr client)
+{
+ xXCMiscGetXIDRangeReply rep;
+ XID min_id, max_id;
+
+ REQUEST_SIZE_MATCH(xXCMiscGetXIDRangeReq);
+ GetXIDRange(client->index, FALSE, &min_id, &max_id);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.start_id = min_id;
+ rep.count = max_id - min_id + 1;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.start_id);
+ swapl(&rep.count);
+ }
+ WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), (char *)&rep);
+ return Success;
+}
+
+static int
+ProcXCMiscGetXIDList(ClientPtr client)
+{
+ REQUEST(xXCMiscGetXIDListReq);
+ xXCMiscGetXIDListReply rep;
+ XID *pids;
+ unsigned int count;
+
+ REQUEST_SIZE_MATCH(xXCMiscGetXIDListReq);
+
+ if (stuff->count > UINT32_MAX / sizeof(XID))
+ return BadAlloc;
+
+ pids = (XID *)malloc(stuff->count * sizeof(XID));
+ if (!pids)
+ {
+ return BadAlloc;
+ }
+ count = GetXIDList(client, stuff->count, pids);
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = count;
+ rep.count = count;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.count);
+ }
+ WriteToClient(client, sizeof(xXCMiscGetXIDListReply), (char *)&rep);
+ if (count)
+ {
+ client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
+ WriteSwappedDataToClient(client, count * sizeof(XID), pids);
+ }
+ free(pids);
+ return Success;
+}
+
+static int
+ProcXCMiscDispatch (ClientPtr client)
+{
+ REQUEST(xReq);
+ switch (stuff->data)
+ {
+ case X_XCMiscGetVersion:
+ return ProcXCMiscGetVersion(client);
+ case X_XCMiscGetXIDRange:
+ return ProcXCMiscGetXIDRange(client);
+ case X_XCMiscGetXIDList:
+ return ProcXCMiscGetXIDList(client);
+ default:
+ return BadRequest;
+ }
+}
+
+static int
+SProcXCMiscGetVersion(ClientPtr client)
+{
+ REQUEST(xXCMiscGetVersionReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXCMiscGetVersionReq);
+ swaps(&stuff->majorVersion);
+ swaps(&stuff->minorVersion);
+ return ProcXCMiscGetVersion(client);
+}
+
+static int
+SProcXCMiscGetXIDRange(ClientPtr client)
+{
+ REQUEST(xReq);
+
+ swaps(&stuff->length);
+ return ProcXCMiscGetXIDRange(client);
+}
+
+static int
+SProcXCMiscGetXIDList(ClientPtr client)
+{
+ REQUEST(xXCMiscGetXIDListReq);
+
+ swaps(&stuff->length);
+ swapl(&stuff->count);
+ return ProcXCMiscGetXIDList(client);
+}
+
+static int
+SProcXCMiscDispatch (ClientPtr client)
+{
+ REQUEST(xReq);
+ switch (stuff->data)
+ {
+ case X_XCMiscGetVersion:
+ return SProcXCMiscGetVersion(client);
+ case X_XCMiscGetXIDRange:
+ return SProcXCMiscGetXIDRange(client);
+ case X_XCMiscGetXIDList:
+ return SProcXCMiscGetXIDList(client);
+ default:
+ return BadRequest;
+ }
+}
+
+void
+XCMiscExtensionInit(INITARGS)
+{
+ AddExtension(XCMiscExtensionName, 0, 0,
+ ProcXCMiscDispatch, SProcXCMiscDispatch,
+ NULL, StandardMinorOpcode);
+}
diff --git a/xorg-server/Xext/xf86bigfont.c b/xorg-server/Xext/xf86bigfont.c
index de8274469..4b63a13a1 100644
--- a/xorg-server/Xext/xf86bigfont.c
+++ b/xorg-server/Xext/xf86bigfont.c
@@ -307,13 +307,13 @@ ProcXF86BigfontQueryVersion(
; /* may add more bits here in future versions */
if (client->swapped) {
char tmp;
- swaps(&reply.sequenceNumber, tmp);
- swapl(&reply.length, tmp);
- swaps(&reply.majorVersion, tmp);
- swaps(&reply.minorVersion, tmp);
- swapl(&reply.uid, tmp);
- swapl(&reply.gid, tmp);
- swapl(&reply.signature, tmp);
+ swaps(&reply.sequenceNumber);
+ swapl(&reply.length);
+ swaps(&reply.majorVersion);
+ swaps(&reply.minorVersion);
+ swapl(&reply.uid);
+ swapl(&reply.gid);
+ swapl(&reply.signature);
}
WriteToClient(client,
sizeof(xXF86BigfontQueryVersionReply), (char *)&reply);
@@ -326,12 +326,12 @@ swapCharInfo(
{
char tmp;
- swaps(&pCI->leftSideBearing, tmp);
- swaps(&pCI->rightSideBearing, tmp);
- swaps(&pCI->characterWidth, tmp);
- swaps(&pCI->ascent, tmp);
- swaps(&pCI->descent, tmp);
- swaps(&pCI->attributes, tmp);
+ swaps(&pCI->leftSideBearing);
+ swaps(&pCI->rightSideBearing);
+ swaps(&pCI->characterWidth);
+ swaps(&pCI->ascent);
+ swaps(&pCI->descent);
+ swaps(&pCI->attributes);
}
/* static CARD32 hashCI (xCharInfo *p); */
@@ -587,20 +587,20 @@ ProcXF86BigfontQueryFont(
reply->shmsegoffset = 0;
if (client->swapped) {
char tmp;
- swaps(&reply->sequenceNumber, tmp);
- swapl(&reply->length, tmp);
+ swaps(&reply->sequenceNumber);
+ swapl(&reply->length);
swapCharInfo(&reply->minBounds);
swapCharInfo(&reply->maxBounds);
- swaps(&reply->minCharOrByte2, tmp);
- swaps(&reply->maxCharOrByte2, tmp);
- swaps(&reply->defaultChar, tmp);
- swaps(&reply->nFontProps, tmp);
- swaps(&reply->fontAscent, tmp);
- swaps(&reply->fontDescent, tmp);
- swapl(&reply->nCharInfos, tmp);
- swapl(&reply->nUniqCharInfos, tmp);
- swapl(&reply->shmid, tmp);
- swapl(&reply->shmsegoffset, tmp);
+ swaps(&reply->minCharOrByte2);
+ swaps(&reply->maxCharOrByte2);
+ swaps(&reply->defaultChar);
+ swaps(&reply->nFontProps);
+ swaps(&reply->fontAscent);
+ swaps(&reply->fontDescent);
+ swapl(&reply->nCharInfos);
+ swapl(&reply->nUniqCharInfos);
+ swapl(&reply->shmid);
+ swapl(&reply->shmsegoffset);
}
p = (char*) &reply[1];
{
@@ -614,8 +614,8 @@ ProcXF86BigfontQueryFont(
prFP->value = pFP->value;
if (client->swapped) {
char tmp;
- swapl(&prFP->name, tmp);
- swapl(&prFP->value, tmp);
+ swapl(&prFP->name);
+ swapl(&prFP->value);
}
}
p = (char*) prFP;
@@ -635,7 +635,7 @@ ProcXF86BigfontQueryFont(
*ps = pIndex2UniqIndex[j];
if (client->swapped) {
char tmp;
- swaps(ps, tmp);
+ swaps(ps);
}
}
}
@@ -672,7 +672,7 @@ SProcXF86BigfontQueryVersion(
REQUEST(xXF86BigfontQueryVersionReq);
char tmp;
- swaps(&stuff->length, tmp);
+ swaps(&stuff->length);
return ProcXF86BigfontQueryVersion(client);
}
@@ -683,9 +683,9 @@ SProcXF86BigfontQueryFont(
REQUEST(xXF86BigfontQueryFontReq);
char tmp;
- swaps(&stuff->length, tmp);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
- swapl(&stuff->id, tmp);
+ swapl(&stuff->id);
return ProcXF86BigfontQueryFont(client);
}
diff --git a/xorg-server/Xext/xres.c b/xorg-server/Xext/xres.c
index 4a5bffa81..b95272882 100644
--- a/xorg-server/Xext/xres.c
+++ b/xorg-server/Xext/xres.c
@@ -1,383 +1,361 @@
-/*
- Copyright (c) 2002 XFree86 Inc
-*/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "swaprep.h"
-#include "registry.h"
-#include <X11/extensions/XResproto.h>
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "gcstruct.h"
-#include "modinit.h"
-#include "protocol-versions.h"
-
-static int
-ProcXResQueryVersion (ClientPtr client)
-{
- REQUEST(xXResQueryVersionReq);
- xXResQueryVersionReply rep;
- CARD16 client_major, client_minor; /* not used */
-
- REQUEST_SIZE_MATCH (xXResQueryVersionReq);
-
- client_major = stuff->client_major;
- client_minor = stuff->client_minor;
- (void) client_major;
- (void) client_minor;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.server_major = SERVER_XRES_MAJOR_VERSION;
- rep.server_minor = SERVER_XRES_MINOR_VERSION;
- if (client->swapped) {
- int n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.server_major, n);
- swaps(&rep.server_minor, n);
- }
- WriteToClient(client, sizeof (xXResQueryVersionReply), (char *)&rep);
- return Success;
-}
-
-static int
-ProcXResQueryClients (ClientPtr client)
-{
- /* REQUEST(xXResQueryClientsReq); */
- xXResQueryClientsReply rep;
- int *current_clients;
- int i, num_clients;
-
- REQUEST_SIZE_MATCH(xXResQueryClientsReq);
-
- current_clients = malloc(currentMaxClients * sizeof(int));
-
- num_clients = 0;
- for(i = 0; i < currentMaxClients; i++) {
- if(clients[i]) {
- current_clients[num_clients] = i;
- num_clients++;
- }
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.num_clients = num_clients;
- rep.length = bytes_to_int32(rep.num_clients * sz_xXResClient);
- if (client->swapped) {
- int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.num_clients, n);
- }
- WriteToClient (client, sizeof (xXResQueryClientsReply), (char *) &rep);
-
- if(num_clients) {
- xXResClient scratch;
-
- for(i = 0; i < num_clients; i++) {
- scratch.resource_base = clients[current_clients[i]]->clientAsMask;
- scratch.resource_mask = RESOURCE_ID_MASK;
-
- if(client->swapped) {
- int n;
- swapl (&scratch.resource_base, n);
- swapl (&scratch.resource_mask, n);
- }
- WriteToClient (client, sz_xXResClient, (char *) &scratch);
- }
- }
-
- free(current_clients);
-
- return Success;
-}
-
-
-static void
-ResFindAllRes (pointer value, XID id, RESTYPE type, pointer cdata)
-{
- int *counts = (int *)cdata;
-
- counts[(type & TypeMask) - 1]++;
-}
-
-static int
-ProcXResQueryClientResources (ClientPtr client)
-{
- REQUEST(xXResQueryClientResourcesReq);
- xXResQueryClientResourcesReply rep;
- int i, clientID, num_types;
- int *counts;
-
- REQUEST_SIZE_MATCH(xXResQueryClientResourcesReq);
-
- clientID = CLIENT_ID(stuff->xid);
-
- if((clientID >= currentMaxClients) || !clients[clientID]) {
- client->errorValue = stuff->xid;
- return BadValue;
- }
-
- counts = calloc(lastResourceType + 1, sizeof(int));
-
- FindAllClientResources(clients[clientID], ResFindAllRes, counts);
-
- num_types = 0;
-
- for(i = 0; i <= lastResourceType; i++) {
- if(counts[i]) num_types++;
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.num_types = num_types;
- rep.length = bytes_to_int32(rep.num_types * sz_xXResType);
- if (client->swapped) {
- int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.num_types, n);
- }
-
- WriteToClient (client,sizeof(xXResQueryClientResourcesReply),(char*)&rep);
-
- if(num_types) {
- xXResType scratch;
- char *name;
-
- for(i = 0; i < lastResourceType; i++) {
- if(!counts[i]) continue;
-
- name = (char *)LookupResourceName(i + 1);
- if (strcmp(name, XREGISTRY_UNKNOWN))
- scratch.resource_type = MakeAtom(name, strlen(name), TRUE);
- else {
- char buf[40];
- snprintf(buf, sizeof(buf), "Unregistered resource %i", i + 1);
- scratch.resource_type = MakeAtom(buf, strlen(buf), TRUE);
- }
-
- scratch.count = counts[i];
-
- if(client->swapped) {
- int n;
- swapl (&scratch.resource_type, n);
- swapl (&scratch.count, n);
- }
- WriteToClient (client, sz_xXResType, (char *) &scratch);
- }
- }
-
- free(counts);
-
- return Success;
-}
-
-static unsigned long
-ResGetApproxPixmapBytes (PixmapPtr pix)
-{
- unsigned long nPixels;
- int bytesPerPixel;
-
- bytesPerPixel = pix->drawable.bitsPerPixel>>3;
- nPixels = pix->drawable.width * pix->drawable.height;
-
- /* Divide by refcnt as pixmap could be shared between clients,
- * so total pixmap mem is shared between these.
- */
- return ( nPixels * bytesPerPixel ) / pix->refcnt;
-}
-
-static void
-ResFindPixmaps (pointer value, XID id, pointer cdata)
-{
- unsigned long *bytes = (unsigned long *)cdata;
- PixmapPtr pix = (PixmapPtr)value;
-
- *bytes += ResGetApproxPixmapBytes(pix);
-}
-
-static void
-ResFindWindowPixmaps (pointer value, XID id, pointer cdata)
-{
- unsigned long *bytes = (unsigned long *)cdata;
- WindowPtr pWin = (WindowPtr)value;
-
- if (pWin->backgroundState == BackgroundPixmap)
- *bytes += ResGetApproxPixmapBytes(pWin->background.pixmap);
-
- if (pWin->border.pixmap != NULL && !pWin->borderIsPixel)
- *bytes += ResGetApproxPixmapBytes(pWin->border.pixmap);
-}
-
-static void
-ResFindGCPixmaps (pointer value, XID id, pointer cdata)
-{
- unsigned long *bytes = (unsigned long *)cdata;
- GCPtr pGC = (GCPtr)value;
-
- if (pGC->stipple != NULL)
- *bytes += ResGetApproxPixmapBytes(pGC->stipple);
-
- if (pGC->tile.pixmap != NULL && !pGC->tileIsPixel)
- *bytes += ResGetApproxPixmapBytes(pGC->tile.pixmap);
-}
-
-static int
-ProcXResQueryClientPixmapBytes (ClientPtr client)
-{
- REQUEST(xXResQueryClientPixmapBytesReq);
- xXResQueryClientPixmapBytesReply rep;
- int clientID;
- unsigned long bytes;
-
- REQUEST_SIZE_MATCH(xXResQueryClientPixmapBytesReq);
-
- clientID = CLIENT_ID(stuff->xid);
-
- if((clientID >= currentMaxClients) || !clients[clientID]) {
- client->errorValue = stuff->xid;
- return BadValue;
- }
-
- bytes = 0;
-
- FindClientResourcesByType(clients[clientID], RT_PIXMAP, ResFindPixmaps,
- (pointer)(&bytes));
-
- /*
- * Make sure win background pixmaps also held to account.
- */
- FindClientResourcesByType(clients[clientID], RT_WINDOW,
- ResFindWindowPixmaps,
- (pointer)(&bytes));
-
- /*
- * GC Tile & Stipple pixmaps too.
- */
- FindClientResourcesByType(clients[clientID], RT_GC,
- ResFindGCPixmaps,
- (pointer)(&bytes));
-
-#ifdef COMPOSITE
- /* FIXME: include composite pixmaps too */
-#endif
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.bytes = bytes;
-#ifdef _XSERVER64
- rep.bytes_overflow = bytes >> 32;
-#else
- rep.bytes_overflow = 0;
-#endif
- if (client->swapped) {
- int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.bytes, n);
- swapl (&rep.bytes_overflow, n);
- }
- WriteToClient (client,sizeof(xXResQueryClientPixmapBytesReply),(char*)&rep);
-
- return Success;
-}
-
-static int
-ProcResDispatch (ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data) {
- case X_XResQueryVersion:
- return ProcXResQueryVersion(client);
- case X_XResQueryClients:
- return ProcXResQueryClients(client);
- case X_XResQueryClientResources:
- return ProcXResQueryClientResources(client);
- case X_XResQueryClientPixmapBytes:
- return ProcXResQueryClientPixmapBytes(client);
- default: break;
- }
-
- return BadRequest;
-}
-
-static int
-SProcXResQueryVersion (ClientPtr client)
-{
- REQUEST(xXResQueryVersionReq);
- int n;
-
- REQUEST_SIZE_MATCH (xXResQueryVersionReq);
- swaps(&stuff->client_major,n);
- swaps(&stuff->client_minor,n);
- return ProcXResQueryVersion(client);
-}
-
-static int
-SProcXResQueryClientResources (ClientPtr client)
-{
- REQUEST(xXResQueryClientResourcesReq);
- int n;
-
- REQUEST_SIZE_MATCH (xXResQueryClientResourcesReq);
- swaps(&stuff->xid,n);
- return ProcXResQueryClientResources(client);
-}
-
-static int
-SProcXResQueryClientPixmapBytes (ClientPtr client)
-{
- REQUEST(xXResQueryClientPixmapBytesReq);
- int n;
-
- REQUEST_SIZE_MATCH (xXResQueryClientPixmapBytesReq);
- swaps(&stuff->xid,n);
- return ProcXResQueryClientPixmapBytes(client);
-}
-
-static int
-SProcResDispatch (ClientPtr client)
-{
- REQUEST(xReq);
- int n;
-
- swaps(&stuff->length,n);
-
- switch (stuff->data) {
- case X_XResQueryVersion:
- return SProcXResQueryVersion(client);
- case X_XResQueryClients: /* nothing to swap */
- return ProcXResQueryClients(client);
- case X_XResQueryClientResources:
- return SProcXResQueryClientResources(client);
- case X_XResQueryClientPixmapBytes:
- return SProcXResQueryClientPixmapBytes(client);
- default: break;
- }
-
- return BadRequest;
-}
-
-void
-ResExtensionInit(INITARGS)
-{
- (void) AddExtension(XRES_NAME, 0, 0,
- ProcResDispatch, SProcResDispatch,
- NULL, StandardMinorOpcode);
-}
+/*
+ Copyright (c) 2002 XFree86 Inc
+*/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "os.h"
+#include "dixstruct.h"
+#include "extnsionst.h"
+#include "swaprep.h"
+#include "registry.h"
+#include <X11/extensions/XResproto.h>
+#include "pixmapstr.h"
+#include "windowstr.h"
+#include "gcstruct.h"
+#include "modinit.h"
+#include "protocol-versions.h"
+
+static int
+ProcXResQueryVersion (ClientPtr client)
+{
+ REQUEST(xXResQueryVersionReq);
+ xXResQueryVersionReply rep;
+
+ REQUEST_SIZE_MATCH (xXResQueryVersionReq);
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.server_major = SERVER_XRES_MAJOR_VERSION;
+ rep.server_minor = SERVER_XRES_MINOR_VERSION;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.server_major);
+ swaps(&rep.server_minor);
+ }
+ WriteToClient(client, sizeof (xXResQueryVersionReply), (char *)&rep);
+ return Success;
+}
+
+static int
+ProcXResQueryClients (ClientPtr client)
+{
+ /* REQUEST(xXResQueryClientsReq); */
+ xXResQueryClientsReply rep;
+ int *current_clients;
+ int i, num_clients;
+
+ REQUEST_SIZE_MATCH(xXResQueryClientsReq);
+
+ current_clients = malloc(currentMaxClients * sizeof(int));
+
+ num_clients = 0;
+ for(i = 0; i < currentMaxClients; i++) {
+ if(clients[i]) {
+ current_clients[num_clients] = i;
+ num_clients++;
+ }
+ }
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.num_clients = num_clients;
+ rep.length = bytes_to_int32(rep.num_clients * sz_xXResClient);
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.num_clients);
+ }
+ WriteToClient (client, sizeof (xXResQueryClientsReply), (char *) &rep);
+
+ if(num_clients) {
+ xXResClient scratch;
+
+ for(i = 0; i < num_clients; i++) {
+ scratch.resource_base = clients[current_clients[i]]->clientAsMask;
+ scratch.resource_mask = RESOURCE_ID_MASK;
+
+ if(client->swapped) {
+ swapl(&scratch.resource_base);
+ swapl(&scratch.resource_mask);
+ }
+ WriteToClient (client, sz_xXResClient, (char *) &scratch);
+ }
+ }
+
+ free(current_clients);
+
+ return Success;
+}
+
+
+static void
+ResFindAllRes (pointer value, XID id, RESTYPE type, pointer cdata)
+{
+ int *counts = (int *)cdata;
+
+ counts[(type & TypeMask) - 1]++;
+}
+
+static int
+ProcXResQueryClientResources (ClientPtr client)
+{
+ REQUEST(xXResQueryClientResourcesReq);
+ xXResQueryClientResourcesReply rep;
+ int i, clientID, num_types;
+ int *counts;
+
+ REQUEST_SIZE_MATCH(xXResQueryClientResourcesReq);
+
+ clientID = CLIENT_ID(stuff->xid);
+
+ if((clientID >= currentMaxClients) || !clients[clientID]) {
+ client->errorValue = stuff->xid;
+ return BadValue;
+ }
+
+ counts = calloc(lastResourceType + 1, sizeof(int));
+
+ FindAllClientResources(clients[clientID], ResFindAllRes, counts);
+
+ num_types = 0;
+
+ for(i = 0; i <= lastResourceType; i++) {
+ if(counts[i]) num_types++;
+ }
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.num_types = num_types;
+ rep.length = bytes_to_int32(rep.num_types * sz_xXResType);
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.num_types);
+ }
+
+ WriteToClient (client,sizeof(xXResQueryClientResourcesReply),(char*)&rep);
+
+ if(num_types) {
+ xXResType scratch;
+ char *name;
+
+ for(i = 0; i < lastResourceType; i++) {
+ if(!counts[i]) continue;
+
+ name = (char *)LookupResourceName(i + 1);
+ if (strcmp(name, XREGISTRY_UNKNOWN))
+ scratch.resource_type = MakeAtom(name, strlen(name), TRUE);
+ else {
+ char buf[40];
+ snprintf(buf, sizeof(buf), "Unregistered resource %i", i + 1);
+ scratch.resource_type = MakeAtom(buf, strlen(buf), TRUE);
+ }
+
+ scratch.count = counts[i];
+
+ if(client->swapped) {
+ swapl(&scratch.resource_type);
+ swapl(&scratch.count);
+ }
+ WriteToClient (client, sz_xXResType, (char *) &scratch);
+ }
+ }
+
+ free(counts);
+
+ return Success;
+}
+
+static unsigned long
+ResGetApproxPixmapBytes (PixmapPtr pix)
+{
+ unsigned long nPixels;
+ int bytesPerPixel;
+
+ bytesPerPixel = pix->drawable.bitsPerPixel>>3;
+ nPixels = pix->drawable.width * pix->drawable.height;
+
+ /* Divide by refcnt as pixmap could be shared between clients,
+ * so total pixmap mem is shared between these.
+ */
+ return ( nPixels * bytesPerPixel ) / pix->refcnt;
+}
+
+static void
+ResFindPixmaps (pointer value, XID id, pointer cdata)
+{
+ unsigned long *bytes = (unsigned long *)cdata;
+ PixmapPtr pix = (PixmapPtr)value;
+
+ *bytes += ResGetApproxPixmapBytes(pix);
+}
+
+static void
+ResFindWindowPixmaps (pointer value, XID id, pointer cdata)
+{
+ unsigned long *bytes = (unsigned long *)cdata;
+ WindowPtr pWin = (WindowPtr)value;
+
+ if (pWin->backgroundState == BackgroundPixmap)
+ *bytes += ResGetApproxPixmapBytes(pWin->background.pixmap);
+
+ if (pWin->border.pixmap != NULL && !pWin->borderIsPixel)
+ *bytes += ResGetApproxPixmapBytes(pWin->border.pixmap);
+}
+
+static void
+ResFindGCPixmaps (pointer value, XID id, pointer cdata)
+{
+ unsigned long *bytes = (unsigned long *)cdata;
+ GCPtr pGC = (GCPtr)value;
+
+ if (pGC->stipple != NULL)
+ *bytes += ResGetApproxPixmapBytes(pGC->stipple);
+
+ if (pGC->tile.pixmap != NULL && !pGC->tileIsPixel)
+ *bytes += ResGetApproxPixmapBytes(pGC->tile.pixmap);
+}
+
+static int
+ProcXResQueryClientPixmapBytes (ClientPtr client)
+{
+ REQUEST(xXResQueryClientPixmapBytesReq);
+ xXResQueryClientPixmapBytesReply rep;
+ int clientID;
+ unsigned long bytes;
+
+ REQUEST_SIZE_MATCH(xXResQueryClientPixmapBytesReq);
+
+ clientID = CLIENT_ID(stuff->xid);
+
+ if((clientID >= currentMaxClients) || !clients[clientID]) {
+ client->errorValue = stuff->xid;
+ return BadValue;
+ }
+
+ bytes = 0;
+
+ FindClientResourcesByType(clients[clientID], RT_PIXMAP, ResFindPixmaps,
+ (pointer)(&bytes));
+
+ /*
+ * Make sure win background pixmaps also held to account.
+ */
+ FindClientResourcesByType(clients[clientID], RT_WINDOW,
+ ResFindWindowPixmaps,
+ (pointer)(&bytes));
+
+ /*
+ * GC Tile & Stipple pixmaps too.
+ */
+ FindClientResourcesByType(clients[clientID], RT_GC,
+ ResFindGCPixmaps,
+ (pointer)(&bytes));
+
+#ifdef COMPOSITE
+ /* FIXME: include composite pixmaps too */
+#endif
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.bytes = bytes;
+#ifdef _XSERVER64
+ rep.bytes_overflow = bytes >> 32;
+#else
+ rep.bytes_overflow = 0;
+#endif
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.bytes);
+ swapl(&rep.bytes_overflow);
+ }
+ WriteToClient (client,sizeof(xXResQueryClientPixmapBytesReply),(char*)&rep);
+
+ return Success;
+}
+
+static int
+ProcResDispatch (ClientPtr client)
+{
+ REQUEST(xReq);
+ switch (stuff->data) {
+ case X_XResQueryVersion:
+ return ProcXResQueryVersion(client);
+ case X_XResQueryClients:
+ return ProcXResQueryClients(client);
+ case X_XResQueryClientResources:
+ return ProcXResQueryClientResources(client);
+ case X_XResQueryClientPixmapBytes:
+ return ProcXResQueryClientPixmapBytes(client);
+ default: break;
+ }
+
+ return BadRequest;
+}
+
+static int
+SProcXResQueryVersion (ClientPtr client)
+{
+ REQUEST(xXResQueryVersionReq);
+ REQUEST_SIZE_MATCH (xXResQueryVersionReq);
+ return ProcXResQueryVersion(client);
+}
+
+static int
+SProcXResQueryClientResources (ClientPtr client)
+{
+ REQUEST(xXResQueryClientResourcesReq);
+ REQUEST_SIZE_MATCH (xXResQueryClientResourcesReq);
+ swapl(&stuff->xid);
+ return ProcXResQueryClientResources(client);
+}
+
+static int
+SProcXResQueryClientPixmapBytes (ClientPtr client)
+{
+ REQUEST(xXResQueryClientPixmapBytesReq);
+ REQUEST_SIZE_MATCH (xXResQueryClientPixmapBytesReq);
+ swapl(&stuff->xid);
+ return ProcXResQueryClientPixmapBytes(client);
+}
+
+static int
+SProcResDispatch (ClientPtr client)
+{
+ REQUEST(xReq);
+ swaps(&stuff->length);
+
+ switch (stuff->data) {
+ case X_XResQueryVersion:
+ return SProcXResQueryVersion(client);
+ case X_XResQueryClients: /* nothing to swap */
+ return ProcXResQueryClients(client);
+ case X_XResQueryClientResources:
+ return SProcXResQueryClientResources(client);
+ case X_XResQueryClientPixmapBytes:
+ return SProcXResQueryClientPixmapBytes(client);
+ default: break;
+ }
+
+ return BadRequest;
+}
+
+void
+ResExtensionInit(INITARGS)
+{
+ (void) AddExtension(XRES_NAME, 0, 0,
+ ProcResDispatch, SProcResDispatch,
+ NULL, StandardMinorOpcode);
+}
diff --git a/xorg-server/Xext/xselinux_ext.c b/xorg-server/Xext/xselinux_ext.c
index 374571c4b..56f2d1ff2 100644
--- a/xorg-server/Xext/xselinux_ext.c
+++ b/xorg-server/Xext/xselinux_ext.c
@@ -71,11 +71,10 @@ ProcSELinuxQueryVersion(ClientPtr client)
rep.server_major = SELINUX_MAJOR_VERSION;
rep.server_minor = SELINUX_MINOR_VERSION;
if (client->swapped) {
- int n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.server_major, n);
- swaps(&rep.server_minor, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.server_major);
+ swaps(&rep.server_minor);
}
WriteToClient(client, sizeof(rep), (char *)&rep);
return Success;
@@ -100,10 +99,9 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid)
rep.context_len = len;
if (client->swapped) {
- int n;
- swapl(&rep.length, n);
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.context_len, n);
+ swapl(&rep.length);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.context_len);
}
WriteToClient(client, sizeof(SELinuxGetContextReply), (char *)&rep);
@@ -353,17 +351,17 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec *items,
for (k = 0; k < count; k++) {
buf[pos] = items[k].id;
if (client->swapped)
- swapl(buf + pos, n);
+ swapl(buf + pos);
pos++;
buf[pos] = items[k].octx_len * 4;
if (client->swapped)
- swapl(buf + pos, n);
+ swapl(buf + pos);
pos++;
buf[pos] = items[k].dctx_len * 4;
if (client->swapped)
- swapl(buf + pos, n);
+ swapl(buf + pos);
pos++;
memcpy((char *)(buf + pos), items[k].octx, strlen(items[k].octx) + 1);
@@ -379,9 +377,9 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec *items,
rep.count = count;
if (client->swapped) {
- swapl(&rep.length, n);
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.count, n);
+ swapl(&rep.length);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.count);
}
WriteToClient(client, sizeof(SELinuxListItemsReply), (char *)&rep);
@@ -529,11 +527,10 @@ static int
SProcSELinuxQueryVersion(ClientPtr client)
{
REQUEST(SELinuxQueryVersionReq);
- int n;
REQUEST_SIZE_MATCH(SELinuxQueryVersionReq);
- swaps(&stuff->client_major, n);
- swaps(&stuff->client_minor, n);
+ swaps(&stuff->client_major);
+ swaps(&stuff->client_minor);
return ProcSELinuxQueryVersion(client);
}
@@ -541,10 +538,9 @@ static int
SProcSELinuxSetCreateContext(ClientPtr client, unsigned offset)
{
REQUEST(SELinuxSetCreateContextReq);
- int n;
REQUEST_AT_LEAST_SIZE(SELinuxSetCreateContextReq);
- swapl(&stuff->context_len, n);
+ swapl(&stuff->context_len);
return ProcSELinuxSetCreateContext(client, offset);
}
@@ -552,11 +548,10 @@ static int
SProcSELinuxSetDeviceContext(ClientPtr client)
{
REQUEST(SELinuxSetContextReq);
- int n;
REQUEST_AT_LEAST_SIZE(SELinuxSetContextReq);
- swapl(&stuff->id, n);
- swapl(&stuff->context_len, n);
+ swapl(&stuff->id);
+ swapl(&stuff->context_len);
return ProcSELinuxSetDeviceContext(client);
}
@@ -564,10 +559,9 @@ static int
SProcSELinuxGetDeviceContext(ClientPtr client)
{
REQUEST(SELinuxGetContextReq);
- int n;
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
- swapl(&stuff->id, n);
+ swapl(&stuff->id);
return ProcSELinuxGetDeviceContext(client);
}
@@ -575,10 +569,9 @@ static int
SProcSELinuxGetDrawableContext(ClientPtr client)
{
REQUEST(SELinuxGetContextReq);
- int n;
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
- swapl(&stuff->id, n);
+ swapl(&stuff->id);
return ProcSELinuxGetDrawableContext(client);
}
@@ -586,11 +579,10 @@ static int
SProcSELinuxGetPropertyContext(ClientPtr client, pointer privKey)
{
REQUEST(SELinuxGetPropertyContextReq);
- int n;
REQUEST_SIZE_MATCH(SELinuxGetPropertyContextReq);
- swapl(&stuff->window, n);
- swapl(&stuff->property, n);
+ swapl(&stuff->window);
+ swapl(&stuff->property);
return ProcSELinuxGetPropertyContext(client, privKey);
}
@@ -598,10 +590,9 @@ static int
SProcSELinuxGetSelectionContext(ClientPtr client, pointer privKey)
{
REQUEST(SELinuxGetContextReq);
- int n;
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
- swapl(&stuff->id, n);
+ swapl(&stuff->id);
return ProcSELinuxGetSelectionContext(client, privKey);
}
@@ -609,10 +600,9 @@ static int
SProcSELinuxListProperties(ClientPtr client)
{
REQUEST(SELinuxGetContextReq);
- int n;
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
- swapl(&stuff->id, n);
+ swapl(&stuff->id);
return ProcSELinuxListProperties(client);
}
@@ -620,10 +610,9 @@ static int
SProcSELinuxGetClientContext(ClientPtr client)
{
REQUEST(SELinuxGetContextReq);
- int n;
REQUEST_SIZE_MATCH(SELinuxGetContextReq);
- swapl(&stuff->id, n);
+ swapl(&stuff->id);
return ProcSELinuxGetClientContext(client);
}
@@ -631,9 +620,8 @@ static int
SProcSELinuxDispatch(ClientPtr client)
{
REQUEST(xReq);
- int n;
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
switch (stuff->data) {
case X_SELinuxQueryVersion:
diff --git a/xorg-server/Xext/xtest.c b/xorg-server/Xext/xtest.c
index cc675c116..945e202d6 100644
--- a/xorg-server/Xext/xtest.c
+++ b/xorg-server/Xext/xtest.c
@@ -91,7 +91,6 @@ static int
ProcXTestGetVersion(ClientPtr client)
{
xXTestGetVersionReply rep;
- int n;
REQUEST_SIZE_MATCH(xXTestGetVersionReq);
rep.type = X_Reply;
@@ -100,8 +99,8 @@ ProcXTestGetVersion(ClientPtr client)
rep.majorVersion = XTestMajorVersion;
rep.minorVersion = XTestMinorVersion;
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swaps(&rep.minorVersion, n);
+ swaps(&rep.sequenceNumber);
+ swaps(&rep.minorVersion);
}
WriteToClient(client, sizeof(xXTestGetVersionReply), (char *)&rep);
return Success;
@@ -114,7 +113,7 @@ ProcXTestCompareCursor(ClientPtr client)
xXTestCompareCursorReply rep;
WindowPtr pWin;
CursorPtr pCursor;
- int n, rc;
+ int rc;
DeviceIntPtr ptr = PickPointer(client);
REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
@@ -139,7 +138,7 @@ ProcXTestCompareCursor(ClientPtr client)
rep.sequenceNumber = client->sequence;
rep.same = (wCursor(pWin) == pCursor);
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
+ swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(xXTestCompareCursorReply), (char *)&rep);
return Success;
@@ -348,7 +347,7 @@ ProcXTestFakeInput(ClientPtr client)
if (client->swapped)
{
(void) XTestSwapFakeInput(client, (xReq *)stuff);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
}
ResetCurrentRequest (client);
client->sequence--;
@@ -476,25 +475,23 @@ ProcXTestDispatch (ClientPtr client)
static int
SProcXTestGetVersion(ClientPtr client)
{
- int n;
REQUEST(xXTestGetVersionReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXTestGetVersionReq);
- swaps(&stuff->minorVersion, n);
+ swaps(&stuff->minorVersion);
return ProcXTestGetVersion(client);
}
static int
SProcXTestCompareCursor(ClientPtr client)
{
- int n;
REQUEST(xXTestCompareCursorReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXTestCompareCursorReq);
- swapl(&stuff->window, n);
- swapl(&stuff->cursor, n);
+ swapl(&stuff->window);
+ swapl(&stuff->cursor);
return ProcXTestCompareCursor(client);
}
@@ -525,10 +522,10 @@ XTestSwapFakeInput(ClientPtr client, xReq *req)
static int
SProcXTestFakeInput(ClientPtr client)
{
- int n;
+ int n;
REQUEST(xReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
n = XTestSwapFakeInput(client, stuff);
if (n != Success)
return n;
@@ -538,10 +535,9 @@ SProcXTestFakeInput(ClientPtr client)
static int
SProcXTestGrabControl(ClientPtr client)
{
- int n;
REQUEST(xXTestGrabControlReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXTestGrabControlReq);
return ProcXTestGrabControl(client);
}
diff --git a/xorg-server/Xext/xvdisp.c b/xorg-server/Xext/xvdisp.c
index b96843159..364a90cf2 100644
--- a/xorg-server/Xext/xvdisp.c
+++ b/xorg-server/Xext/xvdisp.c
@@ -59,12 +59,10 @@ SWriteQueryExtensionReply(
ClientPtr client,
xvQueryExtensionReply *rep
){
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->version, n);
- swaps(&rep->revision, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->version);
+ swaps(&rep->revision);
(void)WriteToClient(client, sz_xvQueryExtensionReply, (char *)rep);
@@ -76,11 +74,9 @@ SWriteQueryAdaptorsReply(
ClientPtr client,
xvQueryAdaptorsReply *rep
){
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_adaptors, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->num_adaptors);
(void)WriteToClient(client, sz_xvQueryAdaptorsReply, (char *)rep);
@@ -92,11 +88,9 @@ SWriteQueryEncodingsReply(
ClientPtr client,
xvQueryEncodingsReply *rep
){
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_encodings, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->num_encodings);
(void)WriteToClient(client, sz_xvQueryEncodingsReply, (char *)rep);
@@ -108,12 +102,10 @@ SWriteAdaptorInfo(
ClientPtr client,
xvAdaptorInfo *pAdaptor
){
- char n;
-
- swapl(&pAdaptor->base_id, n);
- swaps(&pAdaptor->name_size, n);
- swaps(&pAdaptor->num_ports, n);
- swaps(&pAdaptor->num_formats, n);
+ swapl(&pAdaptor->base_id);
+ swaps(&pAdaptor->name_size);
+ swaps(&pAdaptor->num_ports);
+ swaps(&pAdaptor->num_formats);
(void)WriteToClient(client, sz_xvAdaptorInfo, (char *)pAdaptor);
@@ -125,14 +117,13 @@ SWriteEncodingInfo(
ClientPtr client,
xvEncodingInfo *pEncoding
){
- char n;
- swapl(&pEncoding->encoding, n);
- swaps(&pEncoding->name_size, n);
- swaps(&pEncoding->width, n);
- swaps(&pEncoding->height, n);
- swapl(&pEncoding->rate.numerator, n);
- swapl(&pEncoding->rate.denominator, n);
+ swapl(&pEncoding->encoding);
+ swaps(&pEncoding->name_size);
+ swaps(&pEncoding->width);
+ swaps(&pEncoding->height);
+ swapl(&pEncoding->rate.numerator);
+ swapl(&pEncoding->rate.denominator);
(void)WriteToClient(client, sz_xvEncodingInfo, (char *)pEncoding);
return Success;
@@ -143,9 +134,7 @@ SWriteFormat(
ClientPtr client,
xvFormat *pFormat
){
- char n;
-
- swapl(&pFormat->visual, n);
+ swapl(&pFormat->visual);
(void)WriteToClient(client, sz_xvFormat, (char *)pFormat);
return Success;
@@ -156,12 +145,10 @@ SWriteAttributeInfo(
ClientPtr client,
xvAttributeInfo *pAtt
){
- char n;
-
- swapl(&pAtt->flags, n);
- swapl(&pAtt->size, n);
- swapl(&pAtt->min, n);
- swapl(&pAtt->max, n);
+ swapl(&pAtt->flags);
+ swapl(&pAtt->size);
+ swapl(&pAtt->min);
+ swapl(&pAtt->max);
(void)WriteToClient(client, sz_xvAttributeInfo, (char *)pAtt);
return Success;
@@ -172,21 +159,19 @@ SWriteImageFormatInfo(
ClientPtr client,
xvImageFormatInfo *pImage
){
- char n;
-
- swapl(&pImage->id, n);
- swapl(&pImage->red_mask, n);
- swapl(&pImage->green_mask, n);
- swapl(&pImage->blue_mask, n);
- swapl(&pImage->y_sample_bits, n);
- swapl(&pImage->u_sample_bits, n);
- swapl(&pImage->v_sample_bits, n);
- swapl(&pImage->horz_y_period, n);
- swapl(&pImage->horz_u_period, n);
- swapl(&pImage->horz_v_period, n);
- swapl(&pImage->vert_y_period, n);
- swapl(&pImage->vert_u_period, n);
- swapl(&pImage->vert_v_period, n);
+ swapl(&pImage->id);
+ swapl(&pImage->red_mask);
+ swapl(&pImage->green_mask);
+ swapl(&pImage->blue_mask);
+ swapl(&pImage->y_sample_bits);
+ swapl(&pImage->u_sample_bits);
+ swapl(&pImage->v_sample_bits);
+ swapl(&pImage->horz_y_period);
+ swapl(&pImage->horz_u_period);
+ swapl(&pImage->horz_v_period);
+ swapl(&pImage->vert_y_period);
+ swapl(&pImage->vert_u_period);
+ swapl(&pImage->vert_v_period);
(void)WriteToClient(client, sz_xvImageFormatInfo, (char *)pImage);
@@ -198,10 +183,8 @@ SWriteGrabPortReply(
ClientPtr client,
xvGrabPortReply *rep
){
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
(void)WriteToClient(client, sz_xvGrabPortReply, (char *)rep);
@@ -213,11 +196,9 @@ SWriteGetPortAttributeReply(
ClientPtr client,
xvGetPortAttributeReply *rep
){
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->value, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->value);
(void)WriteToClient(client, sz_xvGetPortAttributeReply, (char *)rep);
@@ -229,12 +210,10 @@ SWriteQueryBestSizeReply(
ClientPtr client,
xvQueryBestSizeReply *rep
){
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->actual_width, n);
- swaps(&rep->actual_height, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->actual_width);
+ swaps(&rep->actual_height);
(void)WriteToClient(client, sz_xvQueryBestSizeReply, (char *)rep);
@@ -246,12 +225,10 @@ SWriteQueryPortAttributesReply(
ClientPtr client,
xvQueryPortAttributesReply *rep
){
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->num_attributes, n);
- swapl(&rep->text_size, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->num_attributes);
+ swapl(&rep->text_size);
(void)WriteToClient(client, sz_xvQueryPortAttributesReply, (char *)rep);
@@ -263,14 +240,12 @@ SWriteQueryImageAttributesReply(
ClientPtr client,
xvQueryImageAttributesReply *rep
){
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->num_planes, n);
- swapl(&rep->data_size, n);
- swaps(&rep->width, n);
- swaps(&rep->height, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->num_planes);
+ swapl(&rep->data_size);
+ swaps(&rep->width);
+ swaps(&rep->height);
(void)WriteToClient(client, sz_xvQueryImageAttributesReply, (char *)rep);
@@ -282,11 +257,9 @@ SWriteListImageFormatsReply(
ClientPtr client,
xvListImageFormatsReply *rep
){
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->num_formats, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->num_formats);
(void)WriteToClient(client, sz_xvListImageFormatsReply, (char *)rep);
@@ -1278,154 +1251,144 @@ ProcXvDispatch(ClientPtr client)
static int
SProcXvQueryExtension(ClientPtr client)
{
- char n;
REQUEST(xvQueryExtensionReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return XvProcVector[xv_QueryExtension](client);
}
static int
SProcXvQueryAdaptors(ClientPtr client)
{
- char n;
REQUEST(xvQueryAdaptorsReq);
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
+ swaps(&stuff->length);
+ swapl(&stuff->window);
return XvProcVector[xv_QueryAdaptors](client);
}
static int
SProcXvQueryEncodings(ClientPtr client)
{
- char n;
REQUEST(xvQueryEncodingsReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
+ swaps(&stuff->length);
+ swapl(&stuff->port);
return XvProcVector[xv_QueryEncodings](client);
}
static int
SProcXvGrabPort(ClientPtr client)
{
- char n;
REQUEST(xvGrabPortReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->time, n);
+ swaps(&stuff->length);
+ swapl(&stuff->port);
+ swapl(&stuff->time);
return XvProcVector[xv_GrabPort](client);
}
static int
SProcXvUngrabPort(ClientPtr client)
{
- char n;
REQUEST(xvUngrabPortReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->time, n);
+ swaps(&stuff->length);
+ swapl(&stuff->port);
+ swapl(&stuff->time);
return XvProcVector[xv_UngrabPort](client);
}
static int
SProcXvPutVideo(ClientPtr client)
{
- char n;
REQUEST(xvPutVideoReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->vid_x, n);
- swaps(&stuff->vid_y, n);
- swaps(&stuff->vid_w, n);
- swaps(&stuff->vid_h, n);
- swaps(&stuff->drw_x, n);
- swaps(&stuff->drw_y, n);
- swaps(&stuff->drw_w, n);
- swaps(&stuff->drw_h, n);
+ swaps(&stuff->length);
+ swapl(&stuff->port);
+ swapl(&stuff->drawable);
+ swapl(&stuff->gc);
+ swaps(&stuff->vid_x);
+ swaps(&stuff->vid_y);
+ swaps(&stuff->vid_w);
+ swaps(&stuff->vid_h);
+ swaps(&stuff->drw_x);
+ swaps(&stuff->drw_y);
+ swaps(&stuff->drw_w);
+ swaps(&stuff->drw_h);
return XvProcVector[xv_PutVideo](client);
}
static int
SProcXvPutStill(ClientPtr client)
{
- char n;
REQUEST(xvPutStillReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->vid_x, n);
- swaps(&stuff->vid_y, n);
- swaps(&stuff->vid_w, n);
- swaps(&stuff->vid_h, n);
- swaps(&stuff->drw_x, n);
- swaps(&stuff->drw_y, n);
- swaps(&stuff->drw_w, n);
- swaps(&stuff->drw_h, n);
+ swaps(&stuff->length);
+ swapl(&stuff->port);
+ swapl(&stuff->drawable);
+ swapl(&stuff->gc);
+ swaps(&stuff->vid_x);
+ swaps(&stuff->vid_y);
+ swaps(&stuff->vid_w);
+ swaps(&stuff->vid_h);
+ swaps(&stuff->drw_x);
+ swaps(&stuff->drw_y);
+ swaps(&stuff->drw_w);
+ swaps(&stuff->drw_h);
return XvProcVector[xv_PutStill](client);
}
static int
SProcXvGetVideo(ClientPtr client)
{
- char n;
REQUEST(xvGetVideoReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->vid_x, n);
- swaps(&stuff->vid_y, n);
- swaps(&stuff->vid_w, n);
- swaps(&stuff->vid_h, n);
- swaps(&stuff->drw_x, n);
- swaps(&stuff->drw_y, n);
- swaps(&stuff->drw_w, n);
- swaps(&stuff->drw_h, n);
+ swaps(&stuff->length);
+ swapl(&stuff->port);
+ swapl(&stuff->drawable);
+ swapl(&stuff->gc);
+ swaps(&stuff->vid_x);
+ swaps(&stuff->vid_y);
+ swaps(&stuff->vid_w);
+ swaps(&stuff->vid_h);
+ swaps(&stuff->drw_x);
+ swaps(&stuff->drw_y);
+ swaps(&stuff->drw_w);
+ swaps(&stuff->drw_h);
return XvProcVector[xv_GetVideo](client);
}
static int
SProcXvGetStill(ClientPtr client)
{
- char n;
REQUEST(xvGetStillReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->vid_x, n);
- swaps(&stuff->vid_y, n);
- swaps(&stuff->vid_w, n);
- swaps(&stuff->vid_h, n);
- swaps(&stuff->drw_x, n);
- swaps(&stuff->drw_y, n);
- swaps(&stuff->drw_w, n);
- swaps(&stuff->drw_h, n);
+ swaps(&stuff->length);
+ swapl(&stuff->port);
+ swapl(&stuff->drawable);
+ swapl(&stuff->gc);
+ swaps(&stuff->vid_x);
+ swaps(&stuff->vid_y);
+ swaps(&stuff->vid_w);
+ swaps(&stuff->vid_h);
+ swaps(&stuff->drw_x);
+ swaps(&stuff->drw_y);
+ swaps(&stuff->drw_w);
+ swaps(&stuff->drw_h);
return XvProcVector[xv_GetStill](client);
}
static int
SProcXvPutImage(ClientPtr client)
{
- char n;
REQUEST(xvPutImageReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swapl(&stuff->id, n);
- swaps(&stuff->src_x, n);
- swaps(&stuff->src_y, n);
- swaps(&stuff->src_w, n);
- swaps(&stuff->src_h, n);
- swaps(&stuff->drw_x, n);
- swaps(&stuff->drw_y, n);
- swaps(&stuff->drw_w, n);
- swaps(&stuff->drw_h, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
+ swaps(&stuff->length);
+ swapl(&stuff->port);
+ swapl(&stuff->drawable);
+ swapl(&stuff->gc);
+ swapl(&stuff->id);
+ swaps(&stuff->src_x);
+ swaps(&stuff->src_y);
+ swaps(&stuff->src_w);
+ swaps(&stuff->src_h);
+ swaps(&stuff->drw_x);
+ swaps(&stuff->drw_y);
+ swaps(&stuff->drw_w);
+ swaps(&stuff->drw_h);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
return XvProcVector[xv_PutImage](client);
}
@@ -1433,25 +1396,24 @@ SProcXvPutImage(ClientPtr client)
static int
SProcXvShmPutImage(ClientPtr client)
{
- char n;
REQUEST(xvShmPutImageReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swapl(&stuff->shmseg, n);
- swapl(&stuff->id, n);
- swapl(&stuff->offset, n);
- swaps(&stuff->src_x, n);
- swaps(&stuff->src_y, n);
- swaps(&stuff->src_w, n);
- swaps(&stuff->src_h, n);
- swaps(&stuff->drw_x, n);
- swaps(&stuff->drw_y, n);
- swaps(&stuff->drw_w, n);
- swaps(&stuff->drw_h, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
+ swaps(&stuff->length);
+ swapl(&stuff->port);
+ swapl(&stuff->drawable);
+ swapl(&stuff->gc);
+ swapl(&stuff->shmseg);
+ swapl(&stuff->id);
+ swapl(&stuff->offset);
+ swaps(&stuff->src_x);
+ swaps(&stuff->src_y);
+ swaps(&stuff->src_w);
+ swaps(&stuff->src_h);
+ swaps(&stuff->drw_x);
+ swaps(&stuff->drw_y);
+ swaps(&stuff->drw_w);
+ swaps(&stuff->drw_h);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
return XvProcVector[xv_ShmPutImage](client);
}
#else /* MITSHM */
@@ -1461,101 +1423,92 @@ SProcXvShmPutImage(ClientPtr client)
static int
SProcXvSelectVideoNotify(ClientPtr client)
{
- char n;
REQUEST(xvSelectVideoNotifyReq);
- swaps(&stuff->length, n);
- swapl(&stuff->drawable, n);
+ swaps(&stuff->length);
+ swapl(&stuff->drawable);
return XvProcVector[xv_SelectVideoNotify](client);
}
static int
SProcXvSelectPortNotify(ClientPtr client)
{
- char n;
REQUEST(xvSelectPortNotifyReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
+ swaps(&stuff->length);
+ swapl(&stuff->port);
return XvProcVector[xv_SelectPortNotify](client);
}
static int
SProcXvStopVideo(ClientPtr client)
{
- char n;
REQUEST(xvStopVideoReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->drawable, n);
+ swaps(&stuff->length);
+ swapl(&stuff->port);
+ swapl(&stuff->drawable);
return XvProcVector[xv_StopVideo](client);
}
static int
SProcXvSetPortAttribute(ClientPtr client)
{
- char n;
REQUEST(xvSetPortAttributeReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->attribute, n);
- swapl(&stuff->value, n);
+ swaps(&stuff->length);
+ swapl(&stuff->port);
+ swapl(&stuff->attribute);
+ swapl(&stuff->value);
return XvProcVector[xv_SetPortAttribute](client);
}
static int
SProcXvGetPortAttribute(ClientPtr client)
{
- char n;
REQUEST(xvGetPortAttributeReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->attribute, n);
+ swaps(&stuff->length);
+ swapl(&stuff->port);
+ swapl(&stuff->attribute);
return XvProcVector[xv_GetPortAttribute](client);
}
static int
SProcXvQueryBestSize(ClientPtr client)
{
- char n;
REQUEST(xvQueryBestSizeReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swaps(&stuff->vid_w, n);
- swaps(&stuff->vid_h, n);
- swaps(&stuff->drw_w, n);
- swaps(&stuff->drw_h, n);
+ swaps(&stuff->length);
+ swapl(&stuff->port);
+ swaps(&stuff->vid_w);
+ swaps(&stuff->vid_h);
+ swaps(&stuff->drw_w);
+ swaps(&stuff->drw_h);
return XvProcVector[xv_QueryBestSize](client);
}
static int
SProcXvQueryPortAttributes(ClientPtr client)
{
- char n;
REQUEST(xvQueryPortAttributesReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
+ swaps(&stuff->length);
+ swapl(&stuff->port);
return XvProcVector[xv_QueryPortAttributes](client);
}
static int
SProcXvQueryImageAttributes(ClientPtr client)
{
- char n;
REQUEST(xvQueryImageAttributesReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
- swapl(&stuff->id, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
+ swaps(&stuff->length);
+ swapl(&stuff->port);
+ swapl(&stuff->id);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
return XvProcVector[xv_QueryImageAttributes](client);
}
static int
SProcXvListImageFormats(ClientPtr client)
{
- char n;
REQUEST(xvListImageFormatsReq);
- swaps(&stuff->length, n);
- swapl(&stuff->port, n);
+ swaps(&stuff->length);
+ swapl(&stuff->port);
return XvProcVector[xv_ListImageFormats](client);
}
diff --git a/xorg-server/Xi/allowev.c b/xorg-server/Xi/allowev.c
index 96f3b543c..ff9e667b0 100644
--- a/xorg-server/Xi/allowev.c
+++ b/xorg-server/Xi/allowev.c
@@ -72,12 +72,10 @@ SOFTWARE.
int
SProcXAllowDeviceEvents(ClientPtr client)
{
- char n;
-
REQUEST(xAllowDeviceEventsReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xAllowDeviceEventsReq);
- swapl(&stuff->time, n);
+ swapl(&stuff->time);
return (ProcXAllowDeviceEvents(client));
}
diff --git a/xorg-server/Xi/chgdctl.c b/xorg-server/Xi/chgdctl.c
index 4c4aebac6..ca697d9d8 100644
--- a/xorg-server/Xi/chgdctl.c
+++ b/xorg-server/Xi/chgdctl.c
@@ -74,16 +74,15 @@ SOFTWARE.
int
SProcXChangeDeviceControl(ClientPtr client)
{
- char n;
xDeviceCtl *ctl;
REQUEST(xChangeDeviceControlReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq);
- swaps(&stuff->control, n);
+ swaps(&stuff->control);
ctl = (xDeviceCtl*)&stuff[1];
- swaps(&ctl->control, n);
- swaps(&ctl->length, n);
+ swaps(&ctl->control);
+ swaps(&ctl->length);
switch(stuff->control) {
case DEVICE_ABS_CALIB:
case DEVICE_ABS_AREA:
@@ -230,9 +229,7 @@ void
SRepXChangeDeviceControl(ClientPtr client, int size,
xChangeDeviceControlReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/xorg-server/Xi/chgfctl.c b/xorg-server/Xi/chgfctl.c
index 9189702c1..f818cd0ce 100644
--- a/xorg-server/Xi/chgfctl.c
+++ b/xorg-server/Xi/chgfctl.c
@@ -74,12 +74,10 @@ SOFTWARE.
int
SProcXChangeFeedbackControl(ClientPtr client)
{
- char n;
-
REQUEST(xChangeFeedbackControlReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeFeedbackControlReq);
- swapl(&stuff->mask, n);
+ swapl(&stuff->mask);
return (ProcXChangeFeedbackControl(client));
}
@@ -93,17 +91,16 @@ static int
ChangeKbdFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
KbdFeedbackPtr k, xKbdFeedbackCtl * f)
{
- char n;
KeybdCtrl kctrl;
int t;
int key = DO_ALL;
if (client->swapped) {
- swaps(&f->length, n);
- swaps(&f->pitch, n);
- swaps(&f->duration, n);
- swapl(&f->led_mask, n);
- swapl(&f->led_values, n);
+ swaps(&f->length);
+ swaps(&f->pitch);
+ swaps(&f->duration);
+ swapl(&f->led_mask);
+ swapl(&f->led_values);
}
kctrl = k->ctrl;
@@ -210,14 +207,13 @@ static int
ChangePtrFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
PtrFeedbackPtr p, xPtrFeedbackCtl * f)
{
- char n;
PtrCtrl pctrl; /* might get BadValue part way through */
if (client->swapped) {
- swaps(&f->length, n);
- swaps(&f->num, n);
- swaps(&f->denom, n);
- swaps(&f->thresh, n);
+ swaps(&f->length);
+ swaps(&f->num);
+ swaps(&f->denom);
+ swaps(&f->thresh);
}
pctrl = p->ctrl;
@@ -276,11 +272,9 @@ ChangeIntegerFeedback(ClientPtr client, DeviceIntPtr dev,
long unsigned int mask, IntegerFeedbackPtr i,
xIntegerFeedbackCtl * f)
{
- char n;
-
if (client->swapped) {
- swaps(&f->length, n);
- swapl(&f->int_to_display, n);
+ swaps(&f->length);
+ swapl(&f->int_to_display);
}
i->ctrl.integer_displayed = f->int_to_display;
@@ -299,13 +293,12 @@ ChangeStringFeedback(ClientPtr client, DeviceIntPtr dev,
long unsigned int mask, StringFeedbackPtr s,
xStringFeedbackCtl * f)
{
- char n;
int i, j;
KeySym *syms, *sup_syms;
syms = (KeySym *) (f + 1);
if (client->swapped) {
- swaps(&f->length, n); /* swapped num_keysyms in calling proc */
+ swaps(&f->length); /* swapped num_keysyms in calling proc */
SwapLongs((CARD32 *) syms, f->num_keysyms);
}
@@ -339,14 +332,13 @@ ChangeBellFeedback(ClientPtr client, DeviceIntPtr dev,
long unsigned int mask, BellFeedbackPtr b,
xBellFeedbackCtl * f)
{
- char n;
int t;
BellCtrl bctrl; /* might get BadValue part way through */
if (client->swapped) {
- swaps(&f->length, n);
- swaps(&f->pitch, n);
- swaps(&f->duration, n);
+ swaps(&f->length);
+ swaps(&f->pitch);
+ swaps(&f->duration);
}
bctrl = b->ctrl;
@@ -397,13 +389,12 @@ static int
ChangeLedFeedback(ClientPtr client, DeviceIntPtr dev, long unsigned int mask,
LedFeedbackPtr l, xLedFeedbackCtl * f)
{
- char n;
LedCtrl lctrl; /* might get BadValue part way through */
if (client->swapped) {
- swaps(&f->length, n);
- swapl(&f->led_values, n);
- swapl(&f->led_mask, n);
+ swaps(&f->length);
+ swapl(&f->led_values);
+ swapl(&f->led_mask);
}
f->led_mask &= l->ctrl.led_mask; /* set only supported leds */
@@ -467,11 +458,10 @@ ProcXChangeFeedbackControl(ClientPtr client)
break;
case StringFeedbackClass:
{
- char n;
xStringFeedbackCtl *f = ((xStringFeedbackCtl *) & stuff[1]);
if (client->swapped) {
- swaps(&f->num_keysyms, n);
+ swaps(&f->num_keysyms);
}
if (len != (bytes_to_int32(sizeof(xStringFeedbackCtl)) + f->num_keysyms))
return BadLength;
diff --git a/xorg-server/Xi/chgkbd.c b/xorg-server/Xi/chgkbd.c
index f9fd09902..d8139193f 100644
--- a/xorg-server/Xi/chgkbd.c
+++ b/xorg-server/Xi/chgkbd.c
@@ -75,10 +75,8 @@ SOFTWARE.
int
SProcXChangeKeyboardDevice(ClientPtr client)
{
- char n;
-
REQUEST(xChangeKeyboardDeviceReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xChangeKeyboardDeviceReq);
return (ProcXChangeKeyboardDevice(client));
}
diff --git a/xorg-server/Xi/chgkmap.c b/xorg-server/Xi/chgkmap.c
index e4b9e154c..32caa2d02 100644
--- a/xorg-server/Xi/chgkmap.c
+++ b/xorg-server/Xi/chgkmap.c
@@ -72,11 +72,10 @@ SOFTWARE.
int
SProcXChangeDeviceKeyMapping(ClientPtr client)
{
- char n;
unsigned int count;
REQUEST(xChangeDeviceKeyMappingReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeDeviceKeyMappingReq);
count = stuff->keyCodes * stuff->keySymsPerKeyCode;
REQUEST_FIXED_SIZE(xChangeDeviceKeyMappingReq, count * sizeof(CARD32));
diff --git a/xorg-server/Xi/chgprop.c b/xorg-server/Xi/chgprop.c
index d24a24638..a9f833c25 100644
--- a/xorg-server/Xi/chgprop.c
+++ b/xorg-server/Xi/chgprop.c
@@ -74,13 +74,11 @@ SOFTWARE.
int
SProcXChangeDeviceDontPropagateList(ClientPtr client)
{
- char n;
-
REQUEST(xChangeDeviceDontPropagateListReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xChangeDeviceDontPropagateListReq);
- swapl(&stuff->window, n);
- swaps(&stuff->count, n);
+ swapl(&stuff->window);
+ swaps(&stuff->count);
REQUEST_FIXED_SIZE(xChangeDeviceDontPropagateListReq,
stuff->count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
diff --git a/xorg-server/Xi/chgptr.c b/xorg-server/Xi/chgptr.c
index 6a4fbc342..ee04ab662 100644
--- a/xorg-server/Xi/chgptr.c
+++ b/xorg-server/Xi/chgptr.c
@@ -77,10 +77,8 @@ SOFTWARE.
int
SProcXChangePointerDevice(ClientPtr client)
{
- char n;
-
REQUEST(xChangePointerDeviceReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xChangePointerDeviceReq);
return (ProcXChangePointerDevice(client));
}
diff --git a/xorg-server/Xi/closedev.c b/xorg-server/Xi/closedev.c
index 60f5aebe5..54ada55f5 100644
--- a/xorg-server/Xi/closedev.c
+++ b/xorg-server/Xi/closedev.c
@@ -1,166 +1,164 @@
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/***********************************************************************
- *
- * Extension function to close an extension input device.
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* window structure */
-#include "scrnintstr.h" /* screen structure */
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "XIstubs.h"
-#include "exglobals.h"
-
-#include "closedev.h"
-
-/***********************************************************************
- *
- * This procedure closes an input device.
- *
- */
-
-int
-SProcXCloseDevice(ClientPtr client)
-{
- char n;
-
- REQUEST(xCloseDeviceReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCloseDeviceReq);
- return (ProcXCloseDevice(client));
-}
-
-/***********************************************************************
- *
- * Clear out event selections and passive grabs from a window for the
- * specified device.
- *
- */
-
-static void
-DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
-{
- InputClientsPtr others;
- OtherInputMasks *pOthers;
- GrabPtr grab, next;
-
- if ((pOthers = wOtherInputMasks(pWin)) != 0)
- for (others = pOthers->inputClients; others; others = others->next)
- if (SameClient(others, client))
- others->mask[dev->id] = NoEventMask;
-
- for (grab = wPassiveGrabs(pWin); grab; grab = next) {
- next = grab->next;
- if ((grab->device == dev) &&
- (client->clientAsMask == CLIENT_BITS(grab->resource)))
- FreeResource(grab->resource, RT_NONE);
- }
-}
-
-/***********************************************************************
- *
- * Walk througth the window tree, deleting event selections for this client
- * from this device from all windows.
- *
- */
-
-static void
-DeleteEventsFromChildren(DeviceIntPtr dev, WindowPtr p1, ClientPtr client)
-{
- WindowPtr p2;
-
- while (p1) {
- p2 = p1->firstChild;
- DeleteDeviceEvents(dev, p1, client);
- DeleteEventsFromChildren(dev, p2, client);
- p1 = p1->nextSib;
- }
-}
-
-/***********************************************************************
- *
- * This procedure closes an input device.
- *
- */
-
-int
-ProcXCloseDevice(ClientPtr client)
-{
- int rc, i;
- WindowPtr pWin, p1;
- DeviceIntPtr d;
-
- REQUEST(xCloseDeviceReq);
- REQUEST_SIZE_MATCH(xCloseDeviceReq);
-
- rc = dixLookupDevice(&d, stuff->deviceid, client, DixUseAccess);
- if (rc != Success)
- return rc;
-
- if (d->deviceGrab.grab && SameClient(d->deviceGrab.grab, client))
- (*d->deviceGrab.DeactivateGrab) (d); /* release active grab */
-
- /* Remove event selections from all windows for events from this device
- * and selected by this client.
- * Delete passive grabs from all windows for this device. */
-
- for (i = 0; i < screenInfo.numScreens; i++) {
- pWin = screenInfo.screens[i]->root;
- DeleteDeviceEvents(d, pWin, client);
- p1 = pWin->firstChild;
- DeleteEventsFromChildren(d, p1, client);
- }
-
- return Success;
-}
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+/***********************************************************************
+ *
+ * Extension function to close an extension input device.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "inputstr.h" /* DeviceIntPtr */
+#include "windowstr.h" /* window structure */
+#include "scrnintstr.h" /* screen structure */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "XIstubs.h"
+#include "exglobals.h"
+
+#include "closedev.h"
+
+/***********************************************************************
+ *
+ * This procedure closes an input device.
+ *
+ */
+
+int
+SProcXCloseDevice(ClientPtr client)
+{
+ REQUEST(xCloseDeviceReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xCloseDeviceReq);
+ return (ProcXCloseDevice(client));
+}
+
+/***********************************************************************
+ *
+ * Clear out event selections and passive grabs from a window for the
+ * specified device.
+ *
+ */
+
+static void
+DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client)
+{
+ InputClientsPtr others;
+ OtherInputMasks *pOthers;
+ GrabPtr grab, next;
+
+ if ((pOthers = wOtherInputMasks(pWin)) != 0)
+ for (others = pOthers->inputClients; others; others = others->next)
+ if (SameClient(others, client))
+ others->mask[dev->id] = NoEventMask;
+
+ for (grab = wPassiveGrabs(pWin); grab; grab = next) {
+ next = grab->next;
+ if ((grab->device == dev) &&
+ (client->clientAsMask == CLIENT_BITS(grab->resource)))
+ FreeResource(grab->resource, RT_NONE);
+ }
+}
+
+/***********************************************************************
+ *
+ * Walk througth the window tree, deleting event selections for this client
+ * from this device from all windows.
+ *
+ */
+
+static void
+DeleteEventsFromChildren(DeviceIntPtr dev, WindowPtr p1, ClientPtr client)
+{
+ WindowPtr p2;
+
+ while (p1) {
+ p2 = p1->firstChild;
+ DeleteDeviceEvents(dev, p1, client);
+ DeleteEventsFromChildren(dev, p2, client);
+ p1 = p1->nextSib;
+ }
+}
+
+/***********************************************************************
+ *
+ * This procedure closes an input device.
+ *
+ */
+
+int
+ProcXCloseDevice(ClientPtr client)
+{
+ int rc, i;
+ WindowPtr pWin, p1;
+ DeviceIntPtr d;
+
+ REQUEST(xCloseDeviceReq);
+ REQUEST_SIZE_MATCH(xCloseDeviceReq);
+
+ rc = dixLookupDevice(&d, stuff->deviceid, client, DixUseAccess);
+ if (rc != Success)
+ return rc;
+
+ if (d->deviceGrab.grab && SameClient(d->deviceGrab.grab, client))
+ (*d->deviceGrab.DeactivateGrab) (d); /* release active grab */
+
+ /* Remove event selections from all windows for events from this device
+ * and selected by this client.
+ * Delete passive grabs from all windows for this device. */
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ pWin = screenInfo.screens[i]->root;
+ DeleteDeviceEvents(d, pWin, client);
+ p1 = pWin->firstChild;
+ DeleteEventsFromChildren(d, p1, client);
+ }
+
+ return Success;
+}
diff --git a/xorg-server/Xi/devbell.c b/xorg-server/Xi/devbell.c
index 539da1814..881524260 100644
--- a/xorg-server/Xi/devbell.c
+++ b/xorg-server/Xi/devbell.c
@@ -71,10 +71,8 @@ SOFTWARE.
int
SProcXDeviceBell(ClientPtr client)
{
- char n;
-
REQUEST(xDeviceBellReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXDeviceBell(client));
}
diff --git a/xorg-server/Xi/extinit.c b/xorg-server/Xi/extinit.c
index 0905e1877..7724f5f5a 100644
--- a/xorg-server/Xi/extinit.c
+++ b/xorg-server/Xi/extinit.c
@@ -533,43 +533,39 @@ SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep)
static void
SEventDeviceValuator(deviceValuator * from, deviceValuator * to)
{
- char n;
int i;
INT32 *ip B32;
*to = *from;
- swaps(&to->sequenceNumber, n);
- swaps(&to->device_state, n);
+ swaps(&to->sequenceNumber);
+ swaps(&to->device_state);
ip = &to->valuator0;
for (i = 0; i < 6; i++) {
- swapl((ip + i), n); /* macro - braces are required */
+ swapl(ip + i);
}
}
static void
SEventFocus(deviceFocus * from, deviceFocus * to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber, n);
- swapl(&to->time, n);
- swapl(&to->window, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->time);
+ swapl(&to->window);
}
static void
SDeviceStateNotifyEvent(deviceStateNotify * from, deviceStateNotify * to)
{
int i;
- char n;
INT32 *ip B32;
*to = *from;
- swaps(&to->sequenceNumber, n);
- swapl(&to->time, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->time);
ip = &to->valuator0;
for (i = 0; i < 3; i++) {
- swapl((ip + i), n); /* macro - braces are required */
+ swapl(ip + i);
}
}
@@ -577,93 +573,78 @@ static void
SDeviceKeyStateNotifyEvent(deviceKeyStateNotify * from,
deviceKeyStateNotify * to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber, n);
+ swaps(&to->sequenceNumber);
}
static void
SDeviceButtonStateNotifyEvent(deviceButtonStateNotify * from,
deviceButtonStateNotify * to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber, n);
+ swaps(&to->sequenceNumber);
}
static void
SChangeDeviceNotifyEvent(changeDeviceNotify * from, changeDeviceNotify * to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber, n);
- swapl(&to->time, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->time);
}
static void
SDeviceMappingNotifyEvent(deviceMappingNotify * from, deviceMappingNotify * to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber, n);
- swapl(&to->time, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->time);
}
static void
SDevicePresenceNotifyEvent (devicePresenceNotify *from, devicePresenceNotify *to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber,n);
- swapl(&to->time, n);
- swaps(&to->control, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->time);
+ swaps(&to->control);
}
static void
SDevicePropertyNotifyEvent (devicePropertyNotify *from, devicePropertyNotify *to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber,n);
- swapl(&to->time, n);
- swapl(&to->atom, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->time);
+ swapl(&to->atom);
}
static void
SDeviceLeaveNotifyEvent (xXILeaveEvent *from, xXILeaveEvent *to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber,n);
- swapl(&to->length, n);
- swaps(&to->evtype, n);
- swaps(&to->deviceid, n);
- swapl(&to->time, n);
- swapl(&to->root, n);
- swapl(&to->event, n);
- swapl(&to->child, n);
- swapl(&to->root_x, n);
- swapl(&to->root_y, n);
- swapl(&to->event_x, n);
- swapl(&to->event_y, n);
- swaps(&to->sourceid, n);
- swaps(&to->buttons_len, n);
- swapl(&to->mods.base_mods, n);
- swapl(&to->mods.latched_mods, n);
- swapl(&to->mods.locked_mods, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->length);
+ swaps(&to->evtype);
+ swaps(&to->deviceid);
+ swapl(&to->time);
+ swapl(&to->root);
+ swapl(&to->event);
+ swapl(&to->child);
+ swapl(&to->root_x);
+ swapl(&to->root_y);
+ swapl(&to->event_x);
+ swapl(&to->event_y);
+ swaps(&to->sourceid);
+ swaps(&to->buttons_len);
+ swapl(&to->mods.base_mods);
+ swapl(&to->mods.latched_mods);
+ swapl(&to->mods.locked_mods);
}
static void
SDeviceChangedEvent(xXIDeviceChangedEvent* from, xXIDeviceChangedEvent* to)
{
- char n;
int i, j;
xXIAnyInfo *any;
@@ -682,8 +663,8 @@ SDeviceChangedEvent(xXIDeviceChangedEvent* from, xXIDeviceChangedEvent* to)
xXIKeyInfo *ki = (xXIKeyInfo*)any;
uint32_t *key = (uint32_t*)&ki[1];
for (j = 0; j < ki->num_keycodes; j++, key++)
- swapl(key, n);
- swaps(&ki->num_keycodes, n);
+ swapl(key);
+ swaps(&ki->num_keycodes);
}
break;
case ButtonClass:
@@ -692,71 +673,70 @@ SDeviceChangedEvent(xXIDeviceChangedEvent* from, xXIDeviceChangedEvent* to)
Atom *labels = (Atom*)((char*)bi + sizeof(xXIButtonInfo) +
pad_to_int32(bits_to_bytes(bi->num_buttons)));
for (j = 0; j < bi->num_buttons; j++)
- swapl(&labels[j], n);
- swaps(&bi->num_buttons, n);
+ swapl(&labels[j]);
+ swaps(&bi->num_buttons);
}
break;
case ValuatorClass:
{
xXIValuatorInfo* ai = (xXIValuatorInfo*)any;
- swapl(&ai->label, n);
- swapl(&ai->min.integral, n);
- swapl(&ai->min.frac, n);
- swapl(&ai->max.integral, n);
- swapl(&ai->max.frac, n);
- swapl(&ai->resolution, n);
- swaps(&ai->number, n);
+ swapl(&ai->label);
+ swapl(&ai->min.integral);
+ swapl(&ai->min.frac);
+ swapl(&ai->max.integral);
+ swapl(&ai->max.frac);
+ swapl(&ai->resolution);
+ swaps(&ai->number);
}
break;
}
- swaps(&any->type, n);
- swaps(&any->length, n);
- swaps(&any->sourceid, n);
+ swaps(&any->type);
+ swaps(&any->length);
+ swaps(&any->sourceid);
any = (xXIAnyInfo*)((char*)any + length * 4);
}
- swaps(&to->sequenceNumber, n);
- swapl(&to->length, n);
- swaps(&to->evtype, n);
- swaps(&to->deviceid, n);
- swapl(&to->time, n);
- swaps(&to->num_classes, n);
- swaps(&to->sourceid, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->length);
+ swaps(&to->evtype);
+ swaps(&to->deviceid);
+ swapl(&to->time);
+ swaps(&to->num_classes);
+ swaps(&to->sourceid);
}
static void SDeviceEvent(xXIDeviceEvent *from, xXIDeviceEvent *to)
{
int i;
- char n;
char *ptr;
char *vmask;
memcpy(to, from, sizeof(xEvent) + from->length * 4);
- swaps(&to->sequenceNumber, n);
- swapl(&to->length, n);
- swaps(&to->evtype, n);
- swaps(&to->deviceid, n);
- swapl(&to->time, n);
- swapl(&to->detail, n);
- swapl(&to->root, n);
- swapl(&to->event, n);
- swapl(&to->child, n);
- swapl(&to->root_x, n);
- swapl(&to->root_y, n);
- swapl(&to->event_x, n);
- swapl(&to->event_y, n);
- swaps(&to->buttons_len, n);
- swaps(&to->valuators_len, n);
- swaps(&to->sourceid, n);
- swapl(&to->mods.base_mods, n);
- swapl(&to->mods.latched_mods, n);
- swapl(&to->mods.locked_mods, n);
- swapl(&to->mods.effective_mods, n);
- swapl(&to->flags, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->length);
+ swaps(&to->evtype);
+ swaps(&to->deviceid);
+ swapl(&to->time);
+ swapl(&to->detail);
+ swapl(&to->root);
+ swapl(&to->event);
+ swapl(&to->child);
+ swapl(&to->root_x);
+ swapl(&to->root_y);
+ swapl(&to->event_x);
+ swapl(&to->event_y);
+ swaps(&to->buttons_len);
+ swaps(&to->valuators_len);
+ swaps(&to->sourceid);
+ swapl(&to->mods.base_mods);
+ swapl(&to->mods.latched_mods);
+ swapl(&to->mods.locked_mods);
+ swapl(&to->mods.effective_mods);
+ swapl(&to->flags);
ptr = (char*)(&to[1]);
ptr += from->buttons_len * 4;
@@ -766,9 +746,9 @@ static void SDeviceEvent(xXIDeviceEvent *from, xXIDeviceEvent *to)
{
if (BitIsOn(vmask, i))
{
- swapl(((uint32_t*)ptr), n);
+ swapl(((uint32_t *)ptr));
ptr += 4;
- swapl(((uint32_t*)ptr), n);
+ swapl(((uint32_t *)ptr));
ptr += 4;
}
}
@@ -778,55 +758,51 @@ static void SDeviceHierarchyEvent(xXIHierarchyEvent *from,
xXIHierarchyEvent *to)
{
int i;
- char n;
xXIHierarchyInfo *info;
*to = *from;
memcpy(&to[1], &from[1], from->length * 4);
- swaps(&to->sequenceNumber, n);
- swapl(&to->length, n);
- swaps(&to->evtype, n);
- swaps(&to->deviceid, n);
- swapl(&to->time, n);
- swapl(&to->flags, n);
- swaps(&to->num_info, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->length);
+ swaps(&to->evtype);
+ swaps(&to->deviceid);
+ swapl(&to->time);
+ swapl(&to->flags);
+ swaps(&to->num_info);
info = (xXIHierarchyInfo*)&to[1];
for (i = 0; i< from->num_info; i++)
{
- swaps(&info->deviceid, n);
- swaps(&info->attachment, n);
+ swaps(&info->deviceid);
+ swaps(&info->attachment);
info++;
}
}
static void SXIPropertyEvent(xXIPropertyEvent *from, xXIPropertyEvent *to)
{
- char n;
-
*to = *from;
- swaps(&to->sequenceNumber, n);
- swapl(&to->length, n);
- swaps(&to->evtype, n);
- swaps(&to->deviceid, n);
- swapl(&to->property, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->length);
+ swaps(&to->evtype);
+ swaps(&to->deviceid);
+ swapl(&to->property);
}
static void SRawEvent(xXIRawEvent *from, xXIRawEvent *to)
{
- char n;
int i;
FP3232 *values;
unsigned char *mask;
memcpy(to, from, sizeof(xEvent) + from->length * 4);
- swaps(&to->sequenceNumber, n);
- swapl(&to->length, n);
- swaps(&to->evtype, n);
- swaps(&to->deviceid, n);
- swapl(&to->time, n);
- swapl(&to->detail, n);
+ swaps(&to->sequenceNumber);
+ swapl(&to->length);
+ swaps(&to->evtype);
+ swaps(&to->deviceid);
+ swapl(&to->time);
+ swapl(&to->detail);
mask = (unsigned char*)&to[1];
@@ -841,16 +817,16 @@ static void SRawEvent(xXIRawEvent *from, xXIRawEvent *to)
* they were in aAbBcC order because it's easier and really
* doesn't matter.
*/
- swapl(&values->integral, n);
- swapl(&values->frac, n);
+ swapl(&values->integral);
+ swapl(&values->frac);
values++;
- swapl(&values->integral, n);
- swapl(&values->frac, n);
+ swapl(&values->integral);
+ swapl(&values->frac);
values++;
}
}
- swaps(&to->valuators_len, n);
+ swaps(&to->valuators_len);
}
diff --git a/xorg-server/Xi/getbmap.c b/xorg-server/Xi/getbmap.c
index e2d58972a..b7054f7d2 100644
--- a/xorg-server/Xi/getbmap.c
+++ b/xorg-server/Xi/getbmap.c
@@ -70,10 +70,8 @@ SOFTWARE.
int
SProcXGetDeviceButtonMapping(ClientPtr client)
{
- char n;
-
REQUEST(xGetDeviceButtonMappingReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXGetDeviceButtonMapping(client));
}
@@ -126,9 +124,7 @@ void
SRepXGetDeviceButtonMapping(ClientPtr client, int size,
xGetDeviceButtonMappingReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/xorg-server/Xi/getdctl.c b/xorg-server/Xi/getdctl.c
index 4e04b8b06..6090b814a 100644
--- a/xorg-server/Xi/getdctl.c
+++ b/xorg-server/Xi/getdctl.c
@@ -71,12 +71,10 @@ SOFTWARE.
int
SProcXGetDeviceControl(ClientPtr client)
{
- char n;
-
REQUEST(xGetDeviceControlReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceControlReq);
- swaps(&stuff->control, n);
+ swaps(&stuff->control);
return (ProcXGetDeviceControl(client));
}
@@ -90,7 +88,6 @@ static void
CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
int length)
{
- char n;
AxisInfoPtr a;
xDeviceResolutionState *r;
int i, *iptr;
@@ -108,19 +105,18 @@ CopySwapDeviceResolution(ClientPtr client, ValuatorClassPtr v, char *buf,
for (i = 0, a = v->axes; i < v->numAxes; i++, a++)
*iptr++ = a->max_resolution;
if (client->swapped) {
- swaps(&r->control, n);
- swaps(&r->length, n);
- swapl(&r->num_valuators, n);
+ swaps(&r->control);
+ swaps(&r->length);
+ swapl(&r->num_valuators);
iptr = (int *)buf;
for (i = 0; i < (3 * v->numAxes); i++, iptr++) {
- swapl(iptr, n);
+ swapl(iptr);
}
}
}
static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
{
- char n;
xDeviceCoreState *c = (xDeviceCoreState *) buf;
c->control = DEVICE_CORE;
@@ -129,15 +125,13 @@ static void CopySwapDeviceCore (ClientPtr client, DeviceIntPtr dev, char *buf)
c->iscore = (dev == inputInfo.keyboard || dev == inputInfo.pointer);
if (client->swapped) {
- swaps(&c->control, n);
- swaps(&c->length, n);
- swaps(&c->status, n);
+ swaps(&c->control);
+ swaps(&c->length);
}
}
static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
{
- char n;
xDeviceEnableState *e = (xDeviceEnableState *) buf;
e->control = DEVICE_ENABLE;
@@ -145,9 +139,8 @@ static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
e->enable = dev->enabled;
if (client->swapped) {
- swaps(&e->control, n);
- swaps(&e->length, n);
- swaps(&e->enable, n);
+ swaps(&e->control);
+ swaps(&e->length);
}
}
@@ -161,10 +154,8 @@ static void CopySwapDeviceEnable (ClientPtr client, DeviceIntPtr dev, char *buf)
void
SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/xorg-server/Xi/getfctl.c b/xorg-server/Xi/getfctl.c
index 99b94158c..ea80a879d 100644
--- a/xorg-server/Xi/getfctl.c
+++ b/xorg-server/Xi/getfctl.c
@@ -1,366 +1,356 @@
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/********************************************************************
- *
- * Get feedback control attributes for an extension device.
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "inputstr.h" /* DeviceIntPtr */
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "exglobals.h"
-
-#include "getfctl.h"
-
-/***********************************************************************
- *
- * This procedure gets the control attributes for an extension device,
- * for clients on machines with a different byte ordering than the server.
- *
- */
-
-int
-SProcXGetFeedbackControl(ClientPtr client)
-{
- char n;
-
- REQUEST(xGetFeedbackControlReq);
- swaps(&stuff->length, n);
- return (ProcXGetFeedbackControl(client));
-}
-
-/***********************************************************************
- *
- * This procedure copies KbdFeedbackClass data, swapping if necessary.
- *
- */
-
-static void
-CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
-{
- int i;
- char n;
- xKbdFeedbackState *k2;
-
- k2 = (xKbdFeedbackState *) * buf;
- k2->class = KbdFeedbackClass;
- k2->length = sizeof(xKbdFeedbackState);
- k2->id = k->ctrl.id;
- k2->click = k->ctrl.click;
- k2->percent = k->ctrl.bell;
- k2->pitch = k->ctrl.bell_pitch;
- k2->duration = k->ctrl.bell_duration;
- k2->led_mask = k->ctrl.leds;
- k2->global_auto_repeat = k->ctrl.autoRepeat;
- for (i = 0; i < 32; i++)
- k2->auto_repeats[i] = k->ctrl.autoRepeats[i];
- if (client->swapped) {
- swaps(&k2->length, n);
- swaps(&k2->pitch, n);
- swaps(&k2->duration, n);
- swapl(&k2->led_mask, n);
- swapl(&k2->led_values, n);
- }
- *buf += sizeof(xKbdFeedbackState);
-}
-
-/***********************************************************************
- *
- * This procedure copies PtrFeedbackClass data, swapping if necessary.
- *
- */
-
-static void
-CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
-{
- char n;
- xPtrFeedbackState *p2;
-
- p2 = (xPtrFeedbackState *) * buf;
- p2->class = PtrFeedbackClass;
- p2->length = sizeof(xPtrFeedbackState);
- p2->id = p->ctrl.id;
- p2->accelNum = p->ctrl.num;
- p2->accelDenom = p->ctrl.den;
- p2->threshold = p->ctrl.threshold;
- if (client->swapped) {
- swaps(&p2->length, n);
- swaps(&p2->accelNum, n);
- swaps(&p2->accelDenom, n);
- swaps(&p2->threshold, n);
- }
- *buf += sizeof(xPtrFeedbackState);
-}
-
-/***********************************************************************
- *
- * This procedure copies IntegerFeedbackClass data, swapping if necessary.
- *
- */
-
-static void
-CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf)
-{
- char n;
- xIntegerFeedbackState *i2;
-
- i2 = (xIntegerFeedbackState *) * buf;
- i2->class = IntegerFeedbackClass;
- i2->length = sizeof(xIntegerFeedbackState);
- i2->id = i->ctrl.id;
- i2->resolution = i->ctrl.resolution;
- i2->min_value = i->ctrl.min_value;
- i2->max_value = i->ctrl.max_value;
- if (client->swapped) {
- swaps(&i2->length, n);
- swapl(&i2->resolution, n);
- swapl(&i2->min_value, n);
- swapl(&i2->max_value, n);
- }
- *buf += sizeof(xIntegerFeedbackState);
-}
-
-/***********************************************************************
- *
- * This procedure copies StringFeedbackClass data, swapping if necessary.
- *
- */
-
-static void
-CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
-{
- int i;
- char n;
- xStringFeedbackState *s2;
- KeySym *kptr;
-
- s2 = (xStringFeedbackState *) * buf;
- s2->class = StringFeedbackClass;
- s2->length = sizeof(xStringFeedbackState) +
- s->ctrl.num_symbols_supported * sizeof(KeySym);
- s2->id = s->ctrl.id;
- s2->max_symbols = s->ctrl.max_symbols;
- s2->num_syms_supported = s->ctrl.num_symbols_supported;
- *buf += sizeof(xStringFeedbackState);
- kptr = (KeySym *) (*buf);
- for (i = 0; i < s->ctrl.num_symbols_supported; i++)
- *kptr++ = *(s->ctrl.symbols_supported + i);
- if (client->swapped) {
- swaps(&s2->length, n);
- swaps(&s2->max_symbols, n);
- swaps(&s2->num_syms_supported, n);
- kptr = (KeySym *) (*buf);
- for (i = 0; i < s->ctrl.num_symbols_supported; i++, kptr++) {
- swapl(kptr, n);
- }
- }
- *buf += (s->ctrl.num_symbols_supported * sizeof(KeySym));
-}
-
-/***********************************************************************
- *
- * This procedure copies LedFeedbackClass data, swapping if necessary.
- *
- */
-
-static void
-CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
-{
- char n;
- xLedFeedbackState *l2;
-
- l2 = (xLedFeedbackState *) * buf;
- l2->class = LedFeedbackClass;
- l2->length = sizeof(xLedFeedbackState);
- l2->id = l->ctrl.id;
- l2->led_values = l->ctrl.led_values;
- l2->led_mask = l->ctrl.led_mask;
- if (client->swapped) {
- swaps(&l2->length, n);
- swapl(&l2->led_values, n);
- swapl(&l2->led_mask, n);
- }
- *buf += sizeof(xLedFeedbackState);
-}
-
-/***********************************************************************
- *
- * This procedure copies BellFeedbackClass data, swapping if necessary.
- *
- */
-
-static void
-CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
-{
- char n;
- xBellFeedbackState *b2;
-
- b2 = (xBellFeedbackState *) * buf;
- b2->class = BellFeedbackClass;
- b2->length = sizeof(xBellFeedbackState);
- b2->id = b->ctrl.id;
- b2->percent = b->ctrl.percent;
- b2->pitch = b->ctrl.pitch;
- b2->duration = b->ctrl.duration;
- if (client->swapped) {
- swaps(&b2->length, n);
- swaps(&b2->pitch, n);
- swaps(&b2->duration, n);
- }
- *buf += sizeof(xBellFeedbackState);
-}
-
-/***********************************************************************
- *
- * This procedure writes the reply for the xGetFeedbackControl function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXGetFeedbackControl(ClientPtr client, int size,
- xGetFeedbackControlReply * rep)
-{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_feedbacks, n);
- WriteToClient(client, size, (char *)rep);
-}
-
-/***********************************************************************
- *
- * Get the feedback control state.
- *
- */
-
-int
-ProcXGetFeedbackControl(ClientPtr client)
-{
- int rc, total_length = 0;
- char *buf, *savbuf;
- DeviceIntPtr dev;
- KbdFeedbackPtr k;
- PtrFeedbackPtr p;
- IntegerFeedbackPtr i;
- StringFeedbackPtr s;
- BellFeedbackPtr b;
- LedFeedbackPtr l;
- xGetFeedbackControlReply rep;
-
- REQUEST(xGetFeedbackControlReq);
- REQUEST_SIZE_MATCH(xGetFeedbackControlReq);
-
- rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
- rep.repType = X_Reply;
- rep.RepType = X_GetFeedbackControl;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.num_feedbacks = 0;
-
- for (k = dev->kbdfeed; k; k = k->next) {
- rep.num_feedbacks++;
- total_length += sizeof(xKbdFeedbackState);
- }
- for (p = dev->ptrfeed; p; p = p->next) {
- rep.num_feedbacks++;
- total_length += sizeof(xPtrFeedbackState);
- }
- for (s = dev->stringfeed; s; s = s->next) {
- rep.num_feedbacks++;
- total_length += sizeof(xStringFeedbackState) +
- (s->ctrl.num_symbols_supported * sizeof(KeySym));
- }
- for (i = dev->intfeed; i; i = i->next) {
- rep.num_feedbacks++;
- total_length += sizeof(xIntegerFeedbackState);
- }
- for (l = dev->leds; l; l = l->next) {
- rep.num_feedbacks++;
- total_length += sizeof(xLedFeedbackState);
- }
- for (b = dev->bell; b; b = b->next) {
- rep.num_feedbacks++;
- total_length += sizeof(xBellFeedbackState);
- }
-
- if (total_length == 0)
- return BadMatch;
-
- buf = (char *)malloc(total_length);
- if (!buf)
- return BadAlloc;
- savbuf = buf;
-
- for (k = dev->kbdfeed; k; k = k->next)
- CopySwapKbdFeedback(client, k, &buf);
- for (p = dev->ptrfeed; p; p = p->next)
- CopySwapPtrFeedback(client, p, &buf);
- for (s = dev->stringfeed; s; s = s->next)
- CopySwapStringFeedback(client, s, &buf);
- for (i = dev->intfeed; i; i = i->next)
- CopySwapIntegerFeedback(client, i, &buf);
- for (l = dev->leds; l; l = l->next)
- CopySwapLedFeedback(client, l, &buf);
- for (b = dev->bell; b; b = b->next)
- CopySwapBellFeedback(client, b, &buf);
-
- rep.length = bytes_to_int32(total_length);
- WriteReplyToClient(client, sizeof(xGetFeedbackControlReply), &rep);
- WriteToClient(client, total_length, savbuf);
- free(savbuf);
- return Success;
-}
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+/********************************************************************
+ *
+ * Get feedback control attributes for an extension device.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "inputstr.h" /* DeviceIntPtr */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "exglobals.h"
+
+#include "getfctl.h"
+
+/***********************************************************************
+ *
+ * This procedure gets the control attributes for an extension device,
+ * for clients on machines with a different byte ordering than the server.
+ *
+ */
+
+int
+SProcXGetFeedbackControl(ClientPtr client)
+{
+ REQUEST(xGetFeedbackControlReq);
+ swaps(&stuff->length);
+ return (ProcXGetFeedbackControl(client));
+}
+
+/***********************************************************************
+ *
+ * This procedure copies KbdFeedbackClass data, swapping if necessary.
+ *
+ */
+
+static void
+CopySwapKbdFeedback(ClientPtr client, KbdFeedbackPtr k, char **buf)
+{
+ int i;
+ xKbdFeedbackState *k2;
+
+ k2 = (xKbdFeedbackState *) * buf;
+ k2->class = KbdFeedbackClass;
+ k2->length = sizeof(xKbdFeedbackState);
+ k2->id = k->ctrl.id;
+ k2->click = k->ctrl.click;
+ k2->percent = k->ctrl.bell;
+ k2->pitch = k->ctrl.bell_pitch;
+ k2->duration = k->ctrl.bell_duration;
+ k2->led_mask = k->ctrl.leds;
+ k2->global_auto_repeat = k->ctrl.autoRepeat;
+ for (i = 0; i < 32; i++)
+ k2->auto_repeats[i] = k->ctrl.autoRepeats[i];
+ if (client->swapped) {
+ swaps(&k2->length);
+ swaps(&k2->pitch);
+ swaps(&k2->duration);
+ swapl(&k2->led_mask);
+ swapl(&k2->led_values);
+ }
+ *buf += sizeof(xKbdFeedbackState);
+}
+
+/***********************************************************************
+ *
+ * This procedure copies PtrFeedbackClass data, swapping if necessary.
+ *
+ */
+
+static void
+CopySwapPtrFeedback(ClientPtr client, PtrFeedbackPtr p, char **buf)
+{
+ xPtrFeedbackState *p2;
+
+ p2 = (xPtrFeedbackState *) * buf;
+ p2->class = PtrFeedbackClass;
+ p2->length = sizeof(xPtrFeedbackState);
+ p2->id = p->ctrl.id;
+ p2->accelNum = p->ctrl.num;
+ p2->accelDenom = p->ctrl.den;
+ p2->threshold = p->ctrl.threshold;
+ if (client->swapped) {
+ swaps(&p2->length);
+ swaps(&p2->accelNum);
+ swaps(&p2->accelDenom);
+ swaps(&p2->threshold);
+ }
+ *buf += sizeof(xPtrFeedbackState);
+}
+
+/***********************************************************************
+ *
+ * This procedure copies IntegerFeedbackClass data, swapping if necessary.
+ *
+ */
+
+static void
+CopySwapIntegerFeedback(ClientPtr client, IntegerFeedbackPtr i, char **buf)
+{
+ xIntegerFeedbackState *i2;
+
+ i2 = (xIntegerFeedbackState *) * buf;
+ i2->class = IntegerFeedbackClass;
+ i2->length = sizeof(xIntegerFeedbackState);
+ i2->id = i->ctrl.id;
+ i2->resolution = i->ctrl.resolution;
+ i2->min_value = i->ctrl.min_value;
+ i2->max_value = i->ctrl.max_value;
+ if (client->swapped) {
+ swaps(&i2->length);
+ swapl(&i2->resolution);
+ swapl(&i2->min_value);
+ swapl(&i2->max_value);
+ }
+ *buf += sizeof(xIntegerFeedbackState);
+}
+
+/***********************************************************************
+ *
+ * This procedure copies StringFeedbackClass data, swapping if necessary.
+ *
+ */
+
+static void
+CopySwapStringFeedback(ClientPtr client, StringFeedbackPtr s, char **buf)
+{
+ int i;
+ xStringFeedbackState *s2;
+ KeySym *kptr;
+
+ s2 = (xStringFeedbackState *) * buf;
+ s2->class = StringFeedbackClass;
+ s2->length = sizeof(xStringFeedbackState) +
+ s->ctrl.num_symbols_supported * sizeof(KeySym);
+ s2->id = s->ctrl.id;
+ s2->max_symbols = s->ctrl.max_symbols;
+ s2->num_syms_supported = s->ctrl.num_symbols_supported;
+ *buf += sizeof(xStringFeedbackState);
+ kptr = (KeySym *) (*buf);
+ for (i = 0; i < s->ctrl.num_symbols_supported; i++)
+ *kptr++ = *(s->ctrl.symbols_supported + i);
+ if (client->swapped) {
+ swaps(&s2->length);
+ swaps(&s2->max_symbols);
+ swaps(&s2->num_syms_supported);
+ kptr = (KeySym *) (*buf);
+ for (i = 0; i < s->ctrl.num_symbols_supported; i++, kptr++) {
+ swapl(kptr);
+ }
+ }
+ *buf += (s->ctrl.num_symbols_supported * sizeof(KeySym));
+}
+
+/***********************************************************************
+ *
+ * This procedure copies LedFeedbackClass data, swapping if necessary.
+ *
+ */
+
+static void
+CopySwapLedFeedback(ClientPtr client, LedFeedbackPtr l, char **buf)
+{
+ xLedFeedbackState *l2;
+
+ l2 = (xLedFeedbackState *) * buf;
+ l2->class = LedFeedbackClass;
+ l2->length = sizeof(xLedFeedbackState);
+ l2->id = l->ctrl.id;
+ l2->led_values = l->ctrl.led_values;
+ l2->led_mask = l->ctrl.led_mask;
+ if (client->swapped) {
+ swaps(&l2->length);
+ swapl(&l2->led_values);
+ swapl(&l2->led_mask);
+ }
+ *buf += sizeof(xLedFeedbackState);
+}
+
+/***********************************************************************
+ *
+ * This procedure copies BellFeedbackClass data, swapping if necessary.
+ *
+ */
+
+static void
+CopySwapBellFeedback(ClientPtr client, BellFeedbackPtr b, char **buf)
+{
+ xBellFeedbackState *b2;
+
+ b2 = (xBellFeedbackState *) * buf;
+ b2->class = BellFeedbackClass;
+ b2->length = sizeof(xBellFeedbackState);
+ b2->id = b->ctrl.id;
+ b2->percent = b->ctrl.percent;
+ b2->pitch = b->ctrl.pitch;
+ b2->duration = b->ctrl.duration;
+ if (client->swapped) {
+ swaps(&b2->length);
+ swaps(&b2->pitch);
+ swaps(&b2->duration);
+ }
+ *buf += sizeof(xBellFeedbackState);
+}
+
+/***********************************************************************
+ *
+ * This procedure writes the reply for the xGetFeedbackControl function,
+ * if the client and server have a different byte ordering.
+ *
+ */
+
+void
+SRepXGetFeedbackControl(ClientPtr client, int size,
+ xGetFeedbackControlReply * rep)
+{
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->num_feedbacks);
+ WriteToClient(client, size, (char *)rep);
+}
+
+/***********************************************************************
+ *
+ * Get the feedback control state.
+ *
+ */
+
+int
+ProcXGetFeedbackControl(ClientPtr client)
+{
+ int rc, total_length = 0;
+ char *buf, *savbuf;
+ DeviceIntPtr dev;
+ KbdFeedbackPtr k;
+ PtrFeedbackPtr p;
+ IntegerFeedbackPtr i;
+ StringFeedbackPtr s;
+ BellFeedbackPtr b;
+ LedFeedbackPtr l;
+ xGetFeedbackControlReply rep;
+
+ REQUEST(xGetFeedbackControlReq);
+ REQUEST_SIZE_MATCH(xGetFeedbackControlReq);
+
+ rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ rep.repType = X_Reply;
+ rep.RepType = X_GetFeedbackControl;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.num_feedbacks = 0;
+
+ for (k = dev->kbdfeed; k; k = k->next) {
+ rep.num_feedbacks++;
+ total_length += sizeof(xKbdFeedbackState);
+ }
+ for (p = dev->ptrfeed; p; p = p->next) {
+ rep.num_feedbacks++;
+ total_length += sizeof(xPtrFeedbackState);
+ }
+ for (s = dev->stringfeed; s; s = s->next) {
+ rep.num_feedbacks++;
+ total_length += sizeof(xStringFeedbackState) +
+ (s->ctrl.num_symbols_supported * sizeof(KeySym));
+ }
+ for (i = dev->intfeed; i; i = i->next) {
+ rep.num_feedbacks++;
+ total_length += sizeof(xIntegerFeedbackState);
+ }
+ for (l = dev->leds; l; l = l->next) {
+ rep.num_feedbacks++;
+ total_length += sizeof(xLedFeedbackState);
+ }
+ for (b = dev->bell; b; b = b->next) {
+ rep.num_feedbacks++;
+ total_length += sizeof(xBellFeedbackState);
+ }
+
+ if (total_length == 0)
+ return BadMatch;
+
+ buf = (char *)malloc(total_length);
+ if (!buf)
+ return BadAlloc;
+ savbuf = buf;
+
+ for (k = dev->kbdfeed; k; k = k->next)
+ CopySwapKbdFeedback(client, k, &buf);
+ for (p = dev->ptrfeed; p; p = p->next)
+ CopySwapPtrFeedback(client, p, &buf);
+ for (s = dev->stringfeed; s; s = s->next)
+ CopySwapStringFeedback(client, s, &buf);
+ for (i = dev->intfeed; i; i = i->next)
+ CopySwapIntegerFeedback(client, i, &buf);
+ for (l = dev->leds; l; l = l->next)
+ CopySwapLedFeedback(client, l, &buf);
+ for (b = dev->bell; b; b = b->next)
+ CopySwapBellFeedback(client, b, &buf);
+
+ rep.length = bytes_to_int32(total_length);
+ WriteReplyToClient(client, sizeof(xGetFeedbackControlReply), &rep);
+ WriteToClient(client, total_length, savbuf);
+ free(savbuf);
+ return Success;
+}
diff --git a/xorg-server/Xi/getfocus.c b/xorg-server/Xi/getfocus.c
index 69eadde87..676850df1 100644
--- a/xorg-server/Xi/getfocus.c
+++ b/xorg-server/Xi/getfocus.c
@@ -71,10 +71,8 @@ SOFTWARE.
int
SProcXGetDeviceFocus(ClientPtr client)
{
- char n;
-
REQUEST(xGetDeviceFocusReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXGetDeviceFocus(client));
}
@@ -133,11 +131,9 @@ ProcXGetDeviceFocus(ClientPtr client)
void
SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->focus, n);
- swapl(&rep->time, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->focus);
+ swapl(&rep->time);
WriteToClient(client, size, (char *)rep);
}
diff --git a/xorg-server/Xi/getkmap.c b/xorg-server/Xi/getkmap.c
index 6672ed32c..2501ec05a 100644
--- a/xorg-server/Xi/getkmap.c
+++ b/xorg-server/Xi/getkmap.c
@@ -1,158 +1,154 @@
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/********************************************************************
- *
- * Get the key mapping for an extension device.
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "inputstr.h" /* DeviceIntPtr */
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "exglobals.h"
-#include "swaprep.h"
-#include "xkbsrv.h"
-#include "xkbstr.h"
-
-#include "getkmap.h"
-
-/***********************************************************************
- *
- * This procedure gets the key mapping for an extension device,
- * for clients on machines with a different byte ordering than the server.
- *
- */
-
-int
-SProcXGetDeviceKeyMapping(ClientPtr client)
-{
- char n;
-
- REQUEST(xGetDeviceKeyMappingReq);
- swaps(&stuff->length, n);
- return (ProcXGetDeviceKeyMapping(client));
-}
-
-/***********************************************************************
- *
- * Get the device key mapping.
- *
- */
-
-int
-ProcXGetDeviceKeyMapping(ClientPtr client)
-{
- xGetDeviceKeyMappingReply rep;
- DeviceIntPtr dev;
- XkbDescPtr xkb;
- KeySymsPtr syms;
- int rc;
-
- REQUEST(xGetDeviceKeyMappingReq);
- REQUEST_SIZE_MATCH(xGetDeviceKeyMappingReq);
-
- rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
- if (dev->key == NULL)
- return BadMatch;
- xkb = dev->key->xkbInfo->desc;
-
- if (stuff->firstKeyCode < xkb->min_key_code ||
- stuff->firstKeyCode > xkb->max_key_code) {
- client->errorValue = stuff->firstKeyCode;
- return BadValue;
- }
-
- if (stuff->firstKeyCode + stuff->count > xkb->max_key_code + 1) {
- client->errorValue = stuff->count;
- return BadValue;
- }
-
- syms = XkbGetCoreMap(dev);
- if (!syms)
- return BadAlloc;
-
- rep.repType = X_Reply;
- rep.RepType = X_GetDeviceKeyMapping;
- rep.sequenceNumber = client->sequence;
- rep.keySymsPerKeyCode = syms->mapWidth;
- rep.length = (syms->mapWidth * stuff->count); /* KeySyms are 4 bytes */
- WriteReplyToClient(client, sizeof(xGetDeviceKeyMappingReply), &rep);
-
- client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
- WriteSwappedDataToClient(client,
- syms->mapWidth * stuff->count * sizeof(KeySym),
- &syms->map[syms->mapWidth * (stuff->firstKeyCode -
- syms->minKeyCode)]);
- free(syms->map);
- free(syms);
-
- return Success;
-}
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XGetDeviceKeyMapping function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXGetDeviceKeyMapping(ClientPtr client, int size,
- xGetDeviceKeyMappingReply * rep)
-{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
-}
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+/********************************************************************
+ *
+ * Get the key mapping for an extension device.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "inputstr.h" /* DeviceIntPtr */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "exglobals.h"
+#include "swaprep.h"
+#include "xkbsrv.h"
+#include "xkbstr.h"
+
+#include "getkmap.h"
+
+/***********************************************************************
+ *
+ * This procedure gets the key mapping for an extension device,
+ * for clients on machines with a different byte ordering than the server.
+ *
+ */
+
+int
+SProcXGetDeviceKeyMapping(ClientPtr client)
+{
+ REQUEST(xGetDeviceKeyMappingReq);
+ swaps(&stuff->length);
+ return (ProcXGetDeviceKeyMapping(client));
+}
+
+/***********************************************************************
+ *
+ * Get the device key mapping.
+ *
+ */
+
+int
+ProcXGetDeviceKeyMapping(ClientPtr client)
+{
+ xGetDeviceKeyMappingReply rep;
+ DeviceIntPtr dev;
+ XkbDescPtr xkb;
+ KeySymsPtr syms;
+ int rc;
+
+ REQUEST(xGetDeviceKeyMappingReq);
+ REQUEST_SIZE_MATCH(xGetDeviceKeyMappingReq);
+
+ rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+ if (dev->key == NULL)
+ return BadMatch;
+ xkb = dev->key->xkbInfo->desc;
+
+ if (stuff->firstKeyCode < xkb->min_key_code ||
+ stuff->firstKeyCode > xkb->max_key_code) {
+ client->errorValue = stuff->firstKeyCode;
+ return BadValue;
+ }
+
+ if (stuff->firstKeyCode + stuff->count > xkb->max_key_code + 1) {
+ client->errorValue = stuff->count;
+ return BadValue;
+ }
+
+ syms = XkbGetCoreMap(dev);
+ if (!syms)
+ return BadAlloc;
+
+ rep.repType = X_Reply;
+ rep.RepType = X_GetDeviceKeyMapping;
+ rep.sequenceNumber = client->sequence;
+ rep.keySymsPerKeyCode = syms->mapWidth;
+ rep.length = (syms->mapWidth * stuff->count); /* KeySyms are 4 bytes */
+ WriteReplyToClient(client, sizeof(xGetDeviceKeyMappingReply), &rep);
+
+ client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write;
+ WriteSwappedDataToClient(client,
+ syms->mapWidth * stuff->count * sizeof(KeySym),
+ &syms->map[syms->mapWidth * (stuff->firstKeyCode -
+ syms->minKeyCode)]);
+ free(syms->map);
+ free(syms);
+
+ return Success;
+}
+
+/***********************************************************************
+ *
+ * This procedure writes the reply for the XGetDeviceKeyMapping function,
+ * if the client and server have a different byte ordering.
+ *
+ */
+
+void
+SRepXGetDeviceKeyMapping(ClientPtr client, int size,
+ xGetDeviceKeyMappingReply * rep)
+{
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ WriteToClient(client, size, (char *)rep);
+}
diff --git a/xorg-server/Xi/getmmap.c b/xorg-server/Xi/getmmap.c
index 96e9643fc..4eee00679 100644
--- a/xorg-server/Xi/getmmap.c
+++ b/xorg-server/Xi/getmmap.c
@@ -1,137 +1,133 @@
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/********************************************************************
- *
- * Get the modifier mapping for an extension device.
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "inputstr.h" /* DeviceIntPtr */
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h> /* Request macro */
-#include "exglobals.h"
-
-#include "getmmap.h"
-
-/***********************************************************************
- *
- * This procedure gets the modifier mapping for an extension device,
- * for clients on machines with a different byte ordering than the server.
- *
- */
-
-int
-SProcXGetDeviceModifierMapping(ClientPtr client)
-{
- char n;
-
- REQUEST(xGetDeviceModifierMappingReq);
- swaps(&stuff->length, n);
- return (ProcXGetDeviceModifierMapping(client));
-}
-
-/***********************************************************************
- *
- * Get the device Modifier mapping.
- *
- */
-
-int
-ProcXGetDeviceModifierMapping(ClientPtr client)
-{
- DeviceIntPtr dev;
- xGetDeviceModifierMappingReply rep;
- KeyCode *modkeymap = NULL;
- int ret, max_keys_per_mod;
-
- REQUEST(xGetDeviceModifierMappingReq);
- REQUEST_SIZE_MATCH(xGetDeviceModifierMappingReq);
-
- ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
- if (ret != Success)
- return ret;
-
- ret = generate_modkeymap(client, dev, &modkeymap, &max_keys_per_mod);
- if (ret != Success)
- return ret;
-
- rep.repType = X_Reply;
- rep.RepType = X_GetDeviceModifierMapping;
- rep.numKeyPerModifier = max_keys_per_mod;
- rep.sequenceNumber = client->sequence;
- /* length counts 4 byte quantities - there are 8 modifiers 1 byte big */
- rep.length = max_keys_per_mod << 1;
-
- WriteReplyToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep);
- WriteToClient(client, max_keys_per_mod * 8, (char *) modkeymap);
-
- free(modkeymap);
-
- return Success;
-}
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XGetDeviceModifierMapping function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXGetDeviceModifierMapping(ClientPtr client, int size,
- xGetDeviceModifierMappingReply * rep)
-{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
-}
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+/********************************************************************
+ *
+ * Get the modifier mapping for an extension device.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "inputstr.h" /* DeviceIntPtr */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h> /* Request macro */
+#include "exglobals.h"
+
+#include "getmmap.h"
+
+/***********************************************************************
+ *
+ * This procedure gets the modifier mapping for an extension device,
+ * for clients on machines with a different byte ordering than the server.
+ *
+ */
+
+int
+SProcXGetDeviceModifierMapping(ClientPtr client)
+{
+ REQUEST(xGetDeviceModifierMappingReq);
+ swaps(&stuff->length);
+ return (ProcXGetDeviceModifierMapping(client));
+}
+
+/***********************************************************************
+ *
+ * Get the device Modifier mapping.
+ *
+ */
+
+int
+ProcXGetDeviceModifierMapping(ClientPtr client)
+{
+ DeviceIntPtr dev;
+ xGetDeviceModifierMappingReply rep;
+ KeyCode *modkeymap = NULL;
+ int ret, max_keys_per_mod;
+
+ REQUEST(xGetDeviceModifierMappingReq);
+ REQUEST_SIZE_MATCH(xGetDeviceModifierMappingReq);
+
+ ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
+ if (ret != Success)
+ return ret;
+
+ ret = generate_modkeymap(client, dev, &modkeymap, &max_keys_per_mod);
+ if (ret != Success)
+ return ret;
+
+ rep.repType = X_Reply;
+ rep.RepType = X_GetDeviceModifierMapping;
+ rep.numKeyPerModifier = max_keys_per_mod;
+ rep.sequenceNumber = client->sequence;
+ /* length counts 4 byte quantities - there are 8 modifiers 1 byte big */
+ rep.length = max_keys_per_mod << 1;
+
+ WriteReplyToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep);
+ WriteToClient(client, max_keys_per_mod * 8, (char *) modkeymap);
+
+ free(modkeymap);
+
+ return Success;
+}
+
+/***********************************************************************
+ *
+ * This procedure writes the reply for the XGetDeviceModifierMapping function,
+ * if the client and server have a different byte ordering.
+ *
+ */
+
+void
+SRepXGetDeviceModifierMapping(ClientPtr client, int size,
+ xGetDeviceModifierMappingReply * rep)
+{
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ WriteToClient(client, size, (char *)rep);
+}
diff --git a/xorg-server/Xi/getprop.c b/xorg-server/Xi/getprop.c
index 5e102627d..11afd3784 100644
--- a/xorg-server/Xi/getprop.c
+++ b/xorg-server/Xi/getprop.c
@@ -75,12 +75,10 @@ extern int ExtEventIndex;
int
SProcXGetDeviceDontPropagateList(ClientPtr client)
{
- char n;
-
REQUEST(xGetDeviceDontPropagateListReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq);
- swapl(&stuff->window, n);
+ swapl(&stuff->window);
return (ProcXGetDeviceDontPropagateList(client));
}
@@ -178,10 +176,8 @@ void
SRepXGetDeviceDontPropagateList(ClientPtr client, int size,
xGetDeviceDontPropagateListReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->count, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->count);
WriteToClient(client, size, (char *)rep);
}
diff --git a/xorg-server/Xi/getselev.c b/xorg-server/Xi/getselev.c
index 7304738b3..b316e2364 100644
--- a/xorg-server/Xi/getselev.c
+++ b/xorg-server/Xi/getselev.c
@@ -73,12 +73,10 @@ SOFTWARE.
int
SProcXGetSelectedExtensionEvents(ClientPtr client)
{
- char n;
-
REQUEST(xGetSelectedExtensionEventsReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq);
- swapl(&stuff->window, n);
+ swapl(&stuff->window);
return (ProcXGetSelectedExtensionEvents(client));
}
@@ -168,11 +166,9 @@ void
SRepXGetSelectedExtensionEvents(ClientPtr client, int size,
xGetSelectedExtensionEventsReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->this_client_count, n);
- swaps(&rep->all_clients_count, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->this_client_count);
+ swaps(&rep->all_clients_count);
WriteToClient(client, size, (char *)rep);
}
diff --git a/xorg-server/Xi/getvers.c b/xorg-server/Xi/getvers.c
index c8e9ebca6..8bea1c4b9 100644
--- a/xorg-server/Xi/getvers.c
+++ b/xorg-server/Xi/getvers.c
@@ -73,12 +73,10 @@ XExtensionVersion XIVersion;
int
SProcXGetExtensionVersion(ClientPtr client)
{
- char n;
-
REQUEST(xGetExtensionVersionReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGetExtensionVersionReq);
- swaps(&stuff->nbytes, n);
+ swaps(&stuff->nbytes);
return (ProcXGetExtensionVersion(client));
}
@@ -125,11 +123,9 @@ void
SRepXGetExtensionVersion(ClientPtr client, int size,
xGetExtensionVersionReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->major_version, n);
- swaps(&rep->minor_version, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->major_version);
+ swaps(&rep->minor_version);
WriteToClient(client, size, (char *)rep);
}
diff --git a/xorg-server/Xi/grabdev.c b/xorg-server/Xi/grabdev.c
index 925c9a6d2..4572c33fc 100644
--- a/xorg-server/Xi/grabdev.c
+++ b/xorg-server/Xi/grabdev.c
@@ -75,14 +75,12 @@ extern int ExtEventIndex;
int
SProcXGrabDevice(ClientPtr client)
{
- char n;
-
REQUEST(xGrabDeviceReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceReq);
- swapl(&stuff->grabWindow, n);
- swapl(&stuff->time, n);
- swaps(&stuff->event_count, n);
+ swapl(&stuff->grabWindow);
+ swapl(&stuff->time);
+ swaps(&stuff->event_count);
if (stuff->length != bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count)
return BadLength;
@@ -210,9 +208,7 @@ CreateMaskFromList(ClientPtr client, XEventClass * list, int count,
void
SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/xorg-server/Xi/grabdevb.c b/xorg-server/Xi/grabdevb.c
index e235f5313..2897d410b 100644
--- a/xorg-server/Xi/grabdevb.c
+++ b/xorg-server/Xi/grabdevb.c
@@ -74,14 +74,12 @@ SOFTWARE.
int
SProcXGrabDeviceButton(ClientPtr client)
{
- char n;
-
REQUEST(xGrabDeviceButtonReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceButtonReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
- swaps(&stuff->event_count, n);
+ swapl(&stuff->grabWindow);
+ swaps(&stuff->modifiers);
+ swaps(&stuff->event_count);
REQUEST_FIXED_SIZE(xGrabDeviceButtonReq,
stuff->event_count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
diff --git a/xorg-server/Xi/grabdevk.c b/xorg-server/Xi/grabdevk.c
index b34867b5f..cedd90d9c 100644
--- a/xorg-server/Xi/grabdevk.c
+++ b/xorg-server/Xi/grabdevk.c
@@ -74,14 +74,12 @@ SOFTWARE.
int
SProcXGrabDeviceKey(ClientPtr client)
{
- char n;
-
REQUEST(xGrabDeviceKeyReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xGrabDeviceKeyReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
- swaps(&stuff->event_count, n);
+ swapl(&stuff->grabWindow);
+ swaps(&stuff->modifiers);
+ swaps(&stuff->event_count);
REQUEST_FIXED_SIZE(xGrabDeviceKeyReq, stuff->event_count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->event_count);
return (ProcXGrabDeviceKey(client));
diff --git a/xorg-server/Xi/gtmotion.c b/xorg-server/Xi/gtmotion.c
index ae69a3c92..34f167b40 100644
--- a/xorg-server/Xi/gtmotion.c
+++ b/xorg-server/Xi/gtmotion.c
@@ -1,177 +1,171 @@
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/***********************************************************************
- *
- * Request to get the motion history from an extension device.
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "inputstr.h" /* DeviceIntPtr */
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "exevents.h"
-#include "exglobals.h"
-
-#include "gtmotion.h"
-
-/***********************************************************************
- *
- * Swap the request if server and client have different byte ordering.
- *
- */
-
-int
-SProcXGetDeviceMotionEvents(ClientPtr client)
-{
- char n;
-
- REQUEST(xGetDeviceMotionEventsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
- swapl(&stuff->start, n);
- swapl(&stuff->stop, n);
- return (ProcXGetDeviceMotionEvents(client));
-}
-
-/****************************************************************************
- *
- * Get the motion history for an extension pointer devices.
- *
- */
-
-int
-ProcXGetDeviceMotionEvents(ClientPtr client)
-{
- INT32 *coords = NULL, *bufptr;
- xGetDeviceMotionEventsReply rep;
- unsigned long i;
- int rc, num_events, axes, size = 0;
- unsigned long nEvents;
- DeviceIntPtr dev;
- TimeStamp start, stop;
- int length = 0;
- ValuatorClassPtr v;
-
- REQUEST(xGetDeviceMotionEventsReq);
-
- REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
- rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
- if (rc != Success)
- return rc;
- v = dev->valuator;
- if (v == NULL || v->numAxes == 0)
- return BadMatch;
- if (dev->valuator->motionHintWindow)
- MaybeStopDeviceHint(dev, client);
- axes = v->numAxes;
- rep.repType = X_Reply;
- rep.RepType = X_GetDeviceMotionEvents;
- rep.sequenceNumber = client->sequence;
- rep.nEvents = 0;
- rep.axes = axes;
- rep.mode = Absolute; /* XXX we don't do relative at the moment */
- rep.length = 0;
- start = ClientTimeToServerTime(stuff->start);
- stop = ClientTimeToServerTime(stuff->stop);
- if (CompareTimeStamps(start, stop) == LATER ||
- CompareTimeStamps(start, currentTime) == LATER) {
- WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
- return Success;
- }
- if (CompareTimeStamps(stop, currentTime) == LATER)
- stop = currentTime;
- num_events = v->numMotionEvents;
- if (num_events) {
- size = sizeof(Time) + (axes * sizeof(INT32));
- rep.nEvents = GetMotionHistory(dev, (xTimecoord **) &coords,/* XXX */
- start.milliseconds, stop.milliseconds,
- (ScreenPtr) NULL, FALSE);
- }
- if (rep.nEvents > 0) {
- length = bytes_to_int32(rep.nEvents * size);
- rep.length = length;
- }
- nEvents = rep.nEvents;
- WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
- if (nEvents) {
- if (client->swapped) {
- char n;
-
- bufptr = coords;
- for (i = 0; i < nEvents * (axes + 1); i++) {
- swapl(bufptr, n);
- bufptr++;
- }
- }
- WriteToClient(client, length * 4, (char *)coords);
- }
- free(coords);
- return Success;
-}
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XGetDeviceMotionEvents function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXGetDeviceMotionEvents(ClientPtr client, int size,
- xGetDeviceMotionEventsReply * rep)
-{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->nEvents, n);
- WriteToClient(client, size, (char *)rep);
-}
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+/***********************************************************************
+ *
+ * Request to get the motion history from an extension device.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "inputstr.h" /* DeviceIntPtr */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "exevents.h"
+#include "exglobals.h"
+
+#include "gtmotion.h"
+
+/***********************************************************************
+ *
+ * Swap the request if server and client have different byte ordering.
+ *
+ */
+
+int
+SProcXGetDeviceMotionEvents(ClientPtr client)
+{
+ REQUEST(xGetDeviceMotionEventsReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
+ swapl(&stuff->start);
+ swapl(&stuff->stop);
+ return (ProcXGetDeviceMotionEvents(client));
+}
+
+/****************************************************************************
+ *
+ * Get the motion history for an extension pointer devices.
+ *
+ */
+
+int
+ProcXGetDeviceMotionEvents(ClientPtr client)
+{
+ INT32 *coords = NULL, *bufptr;
+ xGetDeviceMotionEventsReply rep;
+ unsigned long i;
+ int rc, num_events, axes, size = 0;
+ unsigned long nEvents;
+ DeviceIntPtr dev;
+ TimeStamp start, stop;
+ int length = 0;
+ ValuatorClassPtr v;
+
+ REQUEST(xGetDeviceMotionEventsReq);
+
+ REQUEST_SIZE_MATCH(xGetDeviceMotionEventsReq);
+ rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
+ if (rc != Success)
+ return rc;
+ v = dev->valuator;
+ if (v == NULL || v->numAxes == 0)
+ return BadMatch;
+ if (dev->valuator->motionHintWindow)
+ MaybeStopDeviceHint(dev, client);
+ axes = v->numAxes;
+ rep.repType = X_Reply;
+ rep.RepType = X_GetDeviceMotionEvents;
+ rep.sequenceNumber = client->sequence;
+ rep.nEvents = 0;
+ rep.axes = axes;
+ rep.mode = Absolute; /* XXX we don't do relative at the moment */
+ rep.length = 0;
+ start = ClientTimeToServerTime(stuff->start);
+ stop = ClientTimeToServerTime(stuff->stop);
+ if (CompareTimeStamps(start, stop) == LATER ||
+ CompareTimeStamps(start, currentTime) == LATER) {
+ WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
+ return Success;
+ }
+ if (CompareTimeStamps(stop, currentTime) == LATER)
+ stop = currentTime;
+ num_events = v->numMotionEvents;
+ if (num_events) {
+ size = sizeof(Time) + (axes * sizeof(INT32));
+ rep.nEvents = GetMotionHistory(dev, (xTimecoord **) &coords,/* XXX */
+ start.milliseconds, stop.milliseconds,
+ (ScreenPtr) NULL, FALSE);
+ }
+ if (rep.nEvents > 0) {
+ length = bytes_to_int32(rep.nEvents * size);
+ rep.length = length;
+ }
+ nEvents = rep.nEvents;
+ WriteReplyToClient(client, sizeof(xGetDeviceMotionEventsReply), &rep);
+ if (nEvents) {
+ if (client->swapped) {
+ bufptr = coords;
+ for (i = 0; i < nEvents * (axes + 1); i++) {
+ swapl(bufptr);
+ bufptr++;
+ }
+ }
+ WriteToClient(client, length * 4, (char *)coords);
+ }
+ free(coords);
+ return Success;
+}
+
+/***********************************************************************
+ *
+ * This procedure writes the reply for the XGetDeviceMotionEvents function,
+ * if the client and server have a different byte ordering.
+ *
+ */
+
+void
+SRepXGetDeviceMotionEvents(ClientPtr client, int size,
+ xGetDeviceMotionEventsReply * rep)
+{
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->nEvents);
+ WriteToClient(client, size, (char *)rep);
+}
diff --git a/xorg-server/Xi/listdev.c b/xorg-server/Xi/listdev.c
index da7529f1e..1b3081d96 100644
--- a/xorg-server/Xi/listdev.c
+++ b/xorg-server/Xi/listdev.c
@@ -1,432 +1,424 @@
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/***********************************************************************
- *
- * Extension function to list the available input devices.
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <X11/X.h> /* for inputstr.h */
-#include <X11/Xproto.h> /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "XIstubs.h"
-#include "extnsionst.h"
-#include "exevents.h"
-#include "xace.h"
-#include "xkbsrv.h"
-#include "xkbstr.h"
-
-#include "listdev.h"
-
-
-/***********************************************************************
- *
- * This procedure lists the input devices available to the server.
- *
- */
-
-int
-SProcXListInputDevices(ClientPtr client)
-{
- char n;
-
- REQUEST(xListInputDevicesReq);
- swaps(&stuff->length, n);
- return (ProcXListInputDevices(client));
-}
-
-/***********************************************************************
- *
- * This procedure calculates the size of the information to be returned
- * for an input device.
- *
- */
-
-static void
-SizeDeviceInfo(DeviceIntPtr d, int *namesize, int *size)
-{
- int chunks;
-
- *namesize += 1;
- if (d->name)
- *namesize += strlen(d->name);
- if (d->key != NULL)
- *size += sizeof(xKeyInfo);
- if (d->button != NULL)
- *size += sizeof(xButtonInfo);
- if (d->valuator != NULL) {
- chunks = ((int)d->valuator->numAxes + 19) / VPC;
- *size += (chunks * sizeof(xValuatorInfo) +
- d->valuator->numAxes * sizeof(xAxisInfo));
- }
-}
-
-/***********************************************************************
- *
- * This procedure copies data to the DeviceInfo struct, swapping if necessary.
- *
- * We need the extra byte in the allocated buffer, because the trailing null
- * hammers one extra byte, which is overwritten by the next name except for
- * the last name copied.
- *
- */
-
-static void
-CopyDeviceName(char **namebuf, char *name)
-{
- char *nameptr = (char *)*namebuf;
-
- if (name) {
- *nameptr++ = strlen(name);
- strcpy(nameptr, name);
- *namebuf += (strlen(name) + 1);
- } else {
- *nameptr++ = 0;
- *namebuf += 1;
- }
-}
-
-/***********************************************************************
- *
- * This procedure copies ButtonClass information, swapping if necessary.
- *
- */
-
-static void
-CopySwapButtonClass(ClientPtr client, ButtonClassPtr b, char **buf)
-{
- char n;
- xButtonInfoPtr b2;
-
- b2 = (xButtonInfoPtr) * buf;
- b2->class = ButtonClass;
- b2->length = sizeof(xButtonInfo);
- b2->num_buttons = b->numButtons;
- if (client && client->swapped) {
- swaps(&b2->num_buttons, n); /* macro - braces are required */
- }
- *buf += sizeof(xButtonInfo);
-}
-
-/***********************************************************************
- *
- * This procedure copies data to the DeviceInfo struct, swapping if necessary.
- *
- */
-
-static void
-CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
- char **buf)
-{
- char n;
- xDeviceInfoPtr dev;
-
- dev = (xDeviceInfoPtr) * buf;
-
- dev->id = d->id;
- dev->type = d->xinput_type;
- dev->num_classes = num_classes;
- if (IsMaster(d) && IsKeyboardDevice(d))
- dev->use = IsXKeyboard;
- else if (IsMaster(d) && IsPointerDevice(d))
- dev->use = IsXPointer;
- else if (d->valuator && d->button)
- dev->use = IsXExtensionPointer;
- else if (d->key && d->kbdfeed)
- dev->use = IsXExtensionKeyboard;
- else
- dev->use = IsXExtensionDevice;
-
- if (client->swapped) {
- swapl(&dev->type, n); /* macro - braces are required */
- }
- *buf += sizeof(xDeviceInfo);
-}
-
-/***********************************************************************
- *
- * This procedure copies KeyClass information, swapping if necessary.
- *
- */
-
-static void
-CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf)
-{
- char n;
- xKeyInfoPtr k2;
-
- k2 = (xKeyInfoPtr) * buf;
- k2->class = KeyClass;
- k2->length = sizeof(xKeyInfo);
- k2->min_keycode = k->xkbInfo->desc->min_key_code;
- k2->max_keycode = k->xkbInfo->desc->max_key_code;
- k2->num_keys = k2->max_keycode - k2->min_keycode + 1;
- if (client && client->swapped) {
- swaps(&k2->num_keys, n);
- }
- *buf += sizeof(xKeyInfo);
-}
-
-/***********************************************************************
- *
- * This procedure copies ValuatorClass information, swapping if necessary.
- *
- * Devices may have up to 255 valuators. The length of a ValuatorClass is
- * defined to be sizeof(ValuatorClassInfo) + num_axes * sizeof (xAxisInfo).
- * The maximum length is therefore (8 + 255 * 12) = 3068. However, the
- * length field is one byte. If a device has more than 20 valuators, we
- * must therefore return multiple valuator classes to the client.
- *
- */
-
-static int
-CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf)
-{
- int i, j, axes, t_axes;
- char n;
- ValuatorClassPtr v = dev->valuator;
- xValuatorInfoPtr v2;
- AxisInfo *a;
- xAxisInfoPtr a2;
-
- for (i = 0, axes = v->numAxes; i < ((v->numAxes + 19) / VPC);
- i++, axes -= VPC) {
- t_axes = axes < VPC ? axes : VPC;
- if (t_axes < 0)
- t_axes = v->numAxes % VPC;
- v2 = (xValuatorInfoPtr) * buf;
- v2->class = ValuatorClass;
- v2->length = sizeof(xValuatorInfo) + t_axes * sizeof(xAxisInfo);
- v2->num_axes = t_axes;
- v2->mode = valuator_get_mode(dev, 0);
- v2->motion_buffer_size = v->numMotionEvents;
- if (client && client->swapped) {
- swapl(&v2->motion_buffer_size, n);
- }
- *buf += sizeof(xValuatorInfo);
- a = v->axes + (VPC * i);
- a2 = (xAxisInfoPtr) * buf;
- for (j = 0; j < t_axes; j++) {
- a2->min_value = a->min_value;
- a2->max_value = a->max_value;
- a2->resolution = a->resolution;
- if (client && client->swapped) {
- swapl(&a2->min_value, n);
- swapl(&a2->max_value, n);
- swapl(&a2->resolution, n);
- }
- a2++;
- a++;
- *buf += sizeof(xAxisInfo);
- }
- }
- return i;
-}
-
-static void
-CopySwapClasses(ClientPtr client, DeviceIntPtr dev, CARD8 *num_classes,
- char** classbuf)
-{
- if (dev->key != NULL) {
- CopySwapKeyClass(client, dev->key, classbuf);
- (*num_classes)++;
- }
- if (dev->button != NULL) {
- CopySwapButtonClass(client, dev->button, classbuf);
- (*num_classes)++;
- }
- if (dev->valuator != NULL) {
- (*num_classes) +=
- CopySwapValuatorClass(client, dev, classbuf);
- }
-}
-
-/***********************************************************************
- *
- * This procedure lists information to be returned for an input device.
- *
- */
-
-static void
-ListDeviceInfo(ClientPtr client, DeviceIntPtr d, xDeviceInfoPtr dev,
- char **devbuf, char **classbuf, char **namebuf)
-{
- CopyDeviceName(namebuf, d->name);
- CopySwapDevice(client, d, 0, devbuf);
- CopySwapClasses(client, d, &dev->num_classes, classbuf);
-}
-
-/***********************************************************************
- *
- * This procedure checks if a device should be left off the list.
- *
- */
-
-static Bool
-ShouldSkipDevice(ClientPtr client, DeviceIntPtr d)
-{
- /* don't send master devices other than VCP/VCK */
- if (!IsMaster(d) || d == inputInfo.pointer || d == inputInfo.keyboard)
- {
- int rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
- if (rc == Success)
- return FALSE;
- }
- return TRUE;
-}
-
-
-/***********************************************************************
- *
- * This procedure lists the input devices available to the server.
- *
- * If this request is called by a client that has not issued a
- * GetExtensionVersion request with major/minor version set, we don't send the
- * complete device list. Instead, we only send the VCP, the VCK and floating
- * SDs. This resembles the setup found on XI 1.x machines.
- */
-
-int
-ProcXListInputDevices(ClientPtr client)
-{
- xListInputDevicesReply rep;
- int numdevs = 0;
- int namesize = 1; /* need 1 extra byte for strcpy */
- int i = 0, size = 0;
- int total_length;
- char *devbuf, *classbuf, *namebuf, *savbuf;
- Bool *skip;
- xDeviceInfo *dev;
- DeviceIntPtr d;
-
- REQUEST_SIZE_MATCH(xListInputDevicesReq);
-
- memset(&rep, 0, sizeof(xListInputDevicesReply));
- rep.repType = X_Reply;
- rep.RepType = X_ListInputDevices;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- /* allocate space for saving skip value */
- skip = calloc(sizeof(Bool), inputInfo.numDevices);
- if (!skip)
- return BadAlloc;
-
- /* figure out which devices to skip */
- numdevs = 0;
- for (d = inputInfo.devices; d; d = d->next, i++) {
- skip[i] = ShouldSkipDevice(client, d);
- if (skip[i])
- continue;
-
- SizeDeviceInfo(d, &namesize, &size);
- numdevs++;
- }
-
- for (d = inputInfo.off_devices; d; d = d->next, i++) {
- skip[i] = ShouldSkipDevice(client, d);
- if (skip[i])
- continue;
-
- SizeDeviceInfo(d, &namesize, &size);
- numdevs++;
- }
-
- /* allocate space for reply */
- total_length = numdevs * sizeof(xDeviceInfo) + size + namesize;
- devbuf = (char *)calloc(1, total_length);
- classbuf = devbuf + (numdevs * sizeof(xDeviceInfo));
- namebuf = classbuf + size;
- savbuf = devbuf;
-
- /* fill in and send reply */
- i = 0;
- dev = (xDeviceInfoPtr) devbuf;
- for (d = inputInfo.devices; d; d = d->next, i++) {
- if (skip[i])
- continue;
-
- ListDeviceInfo(client, d, dev++, &devbuf, &classbuf, &namebuf);
- }
-
- for (d = inputInfo.off_devices; d; d = d->next, i++) {
- if (skip[i])
- continue;
-
- ListDeviceInfo(client, d, dev++, &devbuf, &classbuf, &namebuf);
- }
- rep.ndevices = numdevs;
- rep.length = bytes_to_int32(total_length);
- WriteReplyToClient(client, sizeof(xListInputDevicesReply), &rep);
- WriteToClient(client, total_length, savbuf);
- free(savbuf);
- free(skip);
- return Success;
-}
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XListInputDevices function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep)
-{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
-}
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+/***********************************************************************
+ *
+ * Extension function to list the available input devices.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h> /* for inputstr.h */
+#include <X11/Xproto.h> /* Request macro */
+#include "inputstr.h" /* DeviceIntPtr */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "XIstubs.h"
+#include "extnsionst.h"
+#include "exevents.h"
+#include "xace.h"
+#include "xkbsrv.h"
+#include "xkbstr.h"
+
+#include "listdev.h"
+
+
+/***********************************************************************
+ *
+ * This procedure lists the input devices available to the server.
+ *
+ */
+
+int
+SProcXListInputDevices(ClientPtr client)
+{
+ REQUEST(xListInputDevicesReq);
+ swaps(&stuff->length);
+ return (ProcXListInputDevices(client));
+}
+
+/***********************************************************************
+ *
+ * This procedure calculates the size of the information to be returned
+ * for an input device.
+ *
+ */
+
+static void
+SizeDeviceInfo(DeviceIntPtr d, int *namesize, int *size)
+{
+ int chunks;
+
+ *namesize += 1;
+ if (d->name)
+ *namesize += strlen(d->name);
+ if (d->key != NULL)
+ *size += sizeof(xKeyInfo);
+ if (d->button != NULL)
+ *size += sizeof(xButtonInfo);
+ if (d->valuator != NULL) {
+ chunks = ((int)d->valuator->numAxes + 19) / VPC;
+ *size += (chunks * sizeof(xValuatorInfo) +
+ d->valuator->numAxes * sizeof(xAxisInfo));
+ }
+}
+
+/***********************************************************************
+ *
+ * This procedure copies data to the DeviceInfo struct, swapping if necessary.
+ *
+ * We need the extra byte in the allocated buffer, because the trailing null
+ * hammers one extra byte, which is overwritten by the next name except for
+ * the last name copied.
+ *
+ */
+
+static void
+CopyDeviceName(char **namebuf, char *name)
+{
+ char *nameptr = (char *)*namebuf;
+
+ if (name) {
+ *nameptr++ = strlen(name);
+ strcpy(nameptr, name);
+ *namebuf += (strlen(name) + 1);
+ } else {
+ *nameptr++ = 0;
+ *namebuf += 1;
+ }
+}
+
+/***********************************************************************
+ *
+ * This procedure copies ButtonClass information, swapping if necessary.
+ *
+ */
+
+static void
+CopySwapButtonClass(ClientPtr client, ButtonClassPtr b, char **buf)
+{
+ xButtonInfoPtr b2;
+
+ b2 = (xButtonInfoPtr) * buf;
+ b2->class = ButtonClass;
+ b2->length = sizeof(xButtonInfo);
+ b2->num_buttons = b->numButtons;
+ if (client && client->swapped) {
+ swaps(&b2->num_buttons);
+ }
+ *buf += sizeof(xButtonInfo);
+}
+
+/***********************************************************************
+ *
+ * This procedure copies data to the DeviceInfo struct, swapping if necessary.
+ *
+ */
+
+static void
+CopySwapDevice(ClientPtr client, DeviceIntPtr d, int num_classes,
+ char **buf)
+{
+ xDeviceInfoPtr dev;
+
+ dev = (xDeviceInfoPtr) * buf;
+
+ dev->id = d->id;
+ dev->type = d->xinput_type;
+ dev->num_classes = num_classes;
+ if (IsMaster(d) && IsKeyboardDevice(d))
+ dev->use = IsXKeyboard;
+ else if (IsMaster(d) && IsPointerDevice(d))
+ dev->use = IsXPointer;
+ else if (d->valuator && d->button)
+ dev->use = IsXExtensionPointer;
+ else if (d->key && d->kbdfeed)
+ dev->use = IsXExtensionKeyboard;
+ else
+ dev->use = IsXExtensionDevice;
+
+ if (client->swapped) {
+ swapl(&dev->type);
+ }
+ *buf += sizeof(xDeviceInfo);
+}
+
+/***********************************************************************
+ *
+ * This procedure copies KeyClass information, swapping if necessary.
+ *
+ */
+
+static void
+CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf)
+{
+ xKeyInfoPtr k2;
+
+ k2 = (xKeyInfoPtr) * buf;
+ k2->class = KeyClass;
+ k2->length = sizeof(xKeyInfo);
+ k2->min_keycode = k->xkbInfo->desc->min_key_code;
+ k2->max_keycode = k->xkbInfo->desc->max_key_code;
+ k2->num_keys = k2->max_keycode - k2->min_keycode + 1;
+ if (client && client->swapped) {
+ swaps(&k2->num_keys);
+ }
+ *buf += sizeof(xKeyInfo);
+}
+
+/***********************************************************************
+ *
+ * This procedure copies ValuatorClass information, swapping if necessary.
+ *
+ * Devices may have up to 255 valuators. The length of a ValuatorClass is
+ * defined to be sizeof(ValuatorClassInfo) + num_axes * sizeof (xAxisInfo).
+ * The maximum length is therefore (8 + 255 * 12) = 3068. However, the
+ * length field is one byte. If a device has more than 20 valuators, we
+ * must therefore return multiple valuator classes to the client.
+ *
+ */
+
+static int
+CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf)
+{
+ int i, j, axes, t_axes;
+ ValuatorClassPtr v = dev->valuator;
+ xValuatorInfoPtr v2;
+ AxisInfo *a;
+ xAxisInfoPtr a2;
+
+ for (i = 0, axes = v->numAxes; i < ((v->numAxes + 19) / VPC);
+ i++, axes -= VPC) {
+ t_axes = axes < VPC ? axes : VPC;
+ if (t_axes < 0)
+ t_axes = v->numAxes % VPC;
+ v2 = (xValuatorInfoPtr) * buf;
+ v2->class = ValuatorClass;
+ v2->length = sizeof(xValuatorInfo) + t_axes * sizeof(xAxisInfo);
+ v2->num_axes = t_axes;
+ v2->mode = valuator_get_mode(dev, 0);
+ v2->motion_buffer_size = v->numMotionEvents;
+ if (client && client->swapped) {
+ swapl(&v2->motion_buffer_size);
+ }
+ *buf += sizeof(xValuatorInfo);
+ a = v->axes + (VPC * i);
+ a2 = (xAxisInfoPtr) * buf;
+ for (j = 0; j < t_axes; j++) {
+ a2->min_value = a->min_value;
+ a2->max_value = a->max_value;
+ a2->resolution = a->resolution;
+ if (client && client->swapped) {
+ swapl(&a2->min_value);
+ swapl(&a2->max_value);
+ swapl(&a2->resolution);
+ }
+ a2++;
+ a++;
+ *buf += sizeof(xAxisInfo);
+ }
+ }
+ return i;
+}
+
+static void
+CopySwapClasses(ClientPtr client, DeviceIntPtr dev, CARD8 *num_classes,
+ char** classbuf)
+{
+ if (dev->key != NULL) {
+ CopySwapKeyClass(client, dev->key, classbuf);
+ (*num_classes)++;
+ }
+ if (dev->button != NULL) {
+ CopySwapButtonClass(client, dev->button, classbuf);
+ (*num_classes)++;
+ }
+ if (dev->valuator != NULL) {
+ (*num_classes) +=
+ CopySwapValuatorClass(client, dev, classbuf);
+ }
+}
+
+/***********************************************************************
+ *
+ * This procedure lists information to be returned for an input device.
+ *
+ */
+
+static void
+ListDeviceInfo(ClientPtr client, DeviceIntPtr d, xDeviceInfoPtr dev,
+ char **devbuf, char **classbuf, char **namebuf)
+{
+ CopyDeviceName(namebuf, d->name);
+ CopySwapDevice(client, d, 0, devbuf);
+ CopySwapClasses(client, d, &dev->num_classes, classbuf);
+}
+
+/***********************************************************************
+ *
+ * This procedure checks if a device should be left off the list.
+ *
+ */
+
+static Bool
+ShouldSkipDevice(ClientPtr client, DeviceIntPtr d)
+{
+ /* don't send master devices other than VCP/VCK */
+ if (!IsMaster(d) || d == inputInfo.pointer || d == inputInfo.keyboard)
+ {
+ int rc = XaceHook(XACE_DEVICE_ACCESS, client, d, DixGetAttrAccess);
+ if (rc == Success)
+ return FALSE;
+ }
+ return TRUE;
+}
+
+
+/***********************************************************************
+ *
+ * This procedure lists the input devices available to the server.
+ *
+ * If this request is called by a client that has not issued a
+ * GetExtensionVersion request with major/minor version set, we don't send the
+ * complete device list. Instead, we only send the VCP, the VCK and floating
+ * SDs. This resembles the setup found on XI 1.x machines.
+ */
+
+int
+ProcXListInputDevices(ClientPtr client)
+{
+ xListInputDevicesReply rep;
+ int numdevs = 0;
+ int namesize = 1; /* need 1 extra byte for strcpy */
+ int i = 0, size = 0;
+ int total_length;
+ char *devbuf, *classbuf, *namebuf, *savbuf;
+ Bool *skip;
+ xDeviceInfo *dev;
+ DeviceIntPtr d;
+
+ REQUEST_SIZE_MATCH(xListInputDevicesReq);
+
+ memset(&rep, 0, sizeof(xListInputDevicesReply));
+ rep.repType = X_Reply;
+ rep.RepType = X_ListInputDevices;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ /* allocate space for saving skip value */
+ skip = calloc(sizeof(Bool), inputInfo.numDevices);
+ if (!skip)
+ return BadAlloc;
+
+ /* figure out which devices to skip */
+ numdevs = 0;
+ for (d = inputInfo.devices; d; d = d->next, i++) {
+ skip[i] = ShouldSkipDevice(client, d);
+ if (skip[i])
+ continue;
+
+ SizeDeviceInfo(d, &namesize, &size);
+ numdevs++;
+ }
+
+ for (d = inputInfo.off_devices; d; d = d->next, i++) {
+ skip[i] = ShouldSkipDevice(client, d);
+ if (skip[i])
+ continue;
+
+ SizeDeviceInfo(d, &namesize, &size);
+ numdevs++;
+ }
+
+ /* allocate space for reply */
+ total_length = numdevs * sizeof(xDeviceInfo) + size + namesize;
+ devbuf = (char *)calloc(1, total_length);
+ classbuf = devbuf + (numdevs * sizeof(xDeviceInfo));
+ namebuf = classbuf + size;
+ savbuf = devbuf;
+
+ /* fill in and send reply */
+ i = 0;
+ dev = (xDeviceInfoPtr) devbuf;
+ for (d = inputInfo.devices; d; d = d->next, i++) {
+ if (skip[i])
+ continue;
+
+ ListDeviceInfo(client, d, dev++, &devbuf, &classbuf, &namebuf);
+ }
+
+ for (d = inputInfo.off_devices; d; d = d->next, i++) {
+ if (skip[i])
+ continue;
+
+ ListDeviceInfo(client, d, dev++, &devbuf, &classbuf, &namebuf);
+ }
+ rep.ndevices = numdevs;
+ rep.length = bytes_to_int32(total_length);
+ WriteReplyToClient(client, sizeof(xListInputDevicesReply), &rep);
+ WriteToClient(client, total_length, savbuf);
+ free(savbuf);
+ free(skip);
+ return Success;
+}
+
+/***********************************************************************
+ *
+ * This procedure writes the reply for the XListInputDevices function,
+ * if the client and server have a different byte ordering.
+ *
+ */
+
+void
+SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep)
+{
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ WriteToClient(client, size, (char *)rep);
+}
diff --git a/xorg-server/Xi/opendev.c b/xorg-server/Xi/opendev.c
index 23a3a1b5b..c91bebbcf 100644
--- a/xorg-server/Xi/opendev.c
+++ b/xorg-server/Xi/opendev.c
@@ -1,171 +1,167 @@
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/***********************************************************************
- *
- * Request to open an extension input device.
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "inputstr.h" /* DeviceIntPtr */
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "XIstubs.h"
-#include "windowstr.h" /* window structure */
-#include "exglobals.h"
-#include "exevents.h"
-
-#include "opendev.h"
-
-extern CARD8 event_base[];
-
-/***********************************************************************
- *
- * This procedure swaps the request if the server and client have different
- * byte orderings.
- *
- */
-
-int
-SProcXOpenDevice(ClientPtr client)
-{
- char n;
-
- REQUEST(xOpenDeviceReq);
- swaps(&stuff->length, n);
- return (ProcXOpenDevice(client));
-}
-
-/***********************************************************************
- *
- * This procedure causes the server to open an input device.
- *
- */
-
-int
-ProcXOpenDevice(ClientPtr client)
-{
- xInputClassInfo evbase[numInputClasses];
- int j = 0;
- int status = Success;
- xOpenDeviceReply rep;
- DeviceIntPtr dev;
-
- REQUEST(xOpenDeviceReq);
- REQUEST_SIZE_MATCH(xOpenDeviceReq);
-
- status = dixLookupDevice(&dev, stuff->deviceid, client, DixUseAccess);
-
- if (status == BadDevice) { /* not open */
- for (dev = inputInfo.off_devices; dev; dev = dev->next)
- if (dev->id == stuff->deviceid)
- break;
- if (dev == NULL)
- return BadDevice;
- } else if (status != Success)
- return status;
-
- if (IsMaster(dev))
- return BadDevice;
-
- memset(&rep, 0, sizeof(xOpenDeviceReply));
- rep.repType = X_Reply;
- rep.RepType = X_OpenDevice;
- rep.sequenceNumber = client->sequence;
- if (dev->key != NULL) {
- evbase[j].class = KeyClass;
- evbase[j++].event_type_base = event_base[KeyClass];
- }
- if (dev->button != NULL) {
- evbase[j].class = ButtonClass;
- evbase[j++].event_type_base = event_base[ButtonClass];
- }
- if (dev->valuator != NULL) {
- evbase[j].class = ValuatorClass;
- evbase[j++].event_type_base = event_base[ValuatorClass];
- }
- if (dev->kbdfeed != NULL || dev->ptrfeed != NULL || dev->leds != NULL ||
- dev->intfeed != NULL || dev->bell != NULL || dev->stringfeed != NULL) {
- evbase[j].class = FeedbackClass;
- evbase[j++].event_type_base = event_base[FeedbackClass];
- }
- if (dev->focus != NULL) {
- evbase[j].class = FocusClass;
- evbase[j++].event_type_base = event_base[FocusClass];
- }
- if (dev->proximity != NULL) {
- evbase[j].class = ProximityClass;
- evbase[j++].event_type_base = event_base[ProximityClass];
- }
- evbase[j].class = OtherClass;
- evbase[j++].event_type_base = event_base[OtherClass];
- rep.length = bytes_to_int32(j * sizeof(xInputClassInfo));
- rep.num_classes = j;
- WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep);
- WriteToClient(client, j * sizeof(xInputClassInfo), (char *)evbase);
- return Success;
-}
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XOpenDevice function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep)
-{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
-}
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+/***********************************************************************
+ *
+ * Request to open an extension input device.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "inputstr.h" /* DeviceIntPtr */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "XIstubs.h"
+#include "windowstr.h" /* window structure */
+#include "exglobals.h"
+#include "exevents.h"
+
+#include "opendev.h"
+
+extern CARD8 event_base[];
+
+/***********************************************************************
+ *
+ * This procedure swaps the request if the server and client have different
+ * byte orderings.
+ *
+ */
+
+int
+SProcXOpenDevice(ClientPtr client)
+{
+ REQUEST(xOpenDeviceReq);
+ swaps(&stuff->length);
+ return (ProcXOpenDevice(client));
+}
+
+/***********************************************************************
+ *
+ * This procedure causes the server to open an input device.
+ *
+ */
+
+int
+ProcXOpenDevice(ClientPtr client)
+{
+ xInputClassInfo evbase[numInputClasses];
+ int j = 0;
+ int status = Success;
+ xOpenDeviceReply rep;
+ DeviceIntPtr dev;
+
+ REQUEST(xOpenDeviceReq);
+ REQUEST_SIZE_MATCH(xOpenDeviceReq);
+
+ status = dixLookupDevice(&dev, stuff->deviceid, client, DixUseAccess);
+
+ if (status == BadDevice) { /* not open */
+ for (dev = inputInfo.off_devices; dev; dev = dev->next)
+ if (dev->id == stuff->deviceid)
+ break;
+ if (dev == NULL)
+ return BadDevice;
+ } else if (status != Success)
+ return status;
+
+ if (IsMaster(dev))
+ return BadDevice;
+
+ memset(&rep, 0, sizeof(xOpenDeviceReply));
+ rep.repType = X_Reply;
+ rep.RepType = X_OpenDevice;
+ rep.sequenceNumber = client->sequence;
+ if (dev->key != NULL) {
+ evbase[j].class = KeyClass;
+ evbase[j++].event_type_base = event_base[KeyClass];
+ }
+ if (dev->button != NULL) {
+ evbase[j].class = ButtonClass;
+ evbase[j++].event_type_base = event_base[ButtonClass];
+ }
+ if (dev->valuator != NULL) {
+ evbase[j].class = ValuatorClass;
+ evbase[j++].event_type_base = event_base[ValuatorClass];
+ }
+ if (dev->kbdfeed != NULL || dev->ptrfeed != NULL || dev->leds != NULL ||
+ dev->intfeed != NULL || dev->bell != NULL || dev->stringfeed != NULL) {
+ evbase[j].class = FeedbackClass;
+ evbase[j++].event_type_base = event_base[FeedbackClass];
+ }
+ if (dev->focus != NULL) {
+ evbase[j].class = FocusClass;
+ evbase[j++].event_type_base = event_base[FocusClass];
+ }
+ if (dev->proximity != NULL) {
+ evbase[j].class = ProximityClass;
+ evbase[j++].event_type_base = event_base[ProximityClass];
+ }
+ evbase[j].class = OtherClass;
+ evbase[j++].event_type_base = event_base[OtherClass];
+ rep.length = bytes_to_int32(j * sizeof(xInputClassInfo));
+ rep.num_classes = j;
+ WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep);
+ WriteToClient(client, j * sizeof(xInputClassInfo), (char *)evbase);
+ return Success;
+}
+
+/***********************************************************************
+ *
+ * This procedure writes the reply for the XOpenDevice function,
+ * if the client and server have a different byte ordering.
+ *
+ */
+
+void
+SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep)
+{
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ WriteToClient(client, size, (char *)rep);
+}
diff --git a/xorg-server/Xi/queryst.c b/xorg-server/Xi/queryst.c
index 4810ed7f1..8c3bdcf97 100644
--- a/xorg-server/Xi/queryst.c
+++ b/xorg-server/Xi/queryst.c
@@ -1,192 +1,187 @@
-/*
-
-Copyright 1998, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-
-/***********************************************************************
- *
- * Request to query the state of an extension input device.
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* window structure */
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "exevents.h"
-#include "exglobals.h"
-#include "xkbsrv.h"
-#include "xkbstr.h"
-
-#include "queryst.h"
-
-/***********************************************************************
- *
- * This procedure allows a client to query the state of a device.
- *
- */
-
-int
-SProcXQueryDeviceState(ClientPtr client)
-{
- char n;
-
- REQUEST(xQueryDeviceStateReq);
- swaps(&stuff->length, n);
- return (ProcXQueryDeviceState(client));
-}
-
-/***********************************************************************
- *
- * This procedure allows frozen events to be routed.
- *
- */
-
-int
-ProcXQueryDeviceState(ClientPtr client)
-{
- char n;
- int rc, i;
- int num_classes = 0;
- int total_length = 0;
- char *buf, *savbuf;
- KeyClassPtr k;
- xKeyState *tk;
- ButtonClassPtr b;
- xButtonState *tb;
- ValuatorClassPtr v;
- xValuatorState *tv;
- xQueryDeviceStateReply rep;
- DeviceIntPtr dev;
- double *values;
-
- REQUEST(xQueryDeviceStateReq);
- REQUEST_SIZE_MATCH(xQueryDeviceStateReq);
-
- rep.repType = X_Reply;
- rep.RepType = X_QueryDeviceState;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
- if (rc != Success && rc != BadAccess)
- return rc;
-
- v = dev->valuator;
- if (v != NULL && v->motionHintWindow != NULL)
- MaybeStopDeviceHint(dev, client);
-
- k = dev->key;
- if (k != NULL) {
- total_length += sizeof(xKeyState);
- num_classes++;
- }
-
- b = dev->button;
- if (b != NULL) {
- total_length += sizeof(xButtonState);
- num_classes++;
- }
-
- if (v != NULL) {
- total_length += (sizeof(xValuatorState) + (v->numAxes * sizeof(int)));
- num_classes++;
- }
- buf = (char *)calloc(total_length, 1);
- if (!buf)
- return BadAlloc;
- savbuf = buf;
-
- if (k != NULL) {
- tk = (xKeyState *) buf;
- tk->class = KeyClass;
- tk->length = sizeof(xKeyState);
- tk->num_keys = k->xkbInfo->desc->max_key_code -
- k->xkbInfo->desc->min_key_code + 1;
- if (rc != BadAccess)
- for (i = 0; i < 32; i++)
- tk->keys[i] = k->down[i];
- buf += sizeof(xKeyState);
- }
-
- if (b != NULL) {
- tb = (xButtonState *) buf;
- tb->class = ButtonClass;
- tb->length = sizeof(xButtonState);
- tb->num_buttons = b->numButtons;
- if (rc != BadAccess)
- memcpy(tb->buttons, b->down, sizeof(b->down));
- buf += sizeof(xButtonState);
- }
-
- if (v != NULL) {
- tv = (xValuatorState *) buf;
- tv->class = ValuatorClass;
- tv->length = sizeof(xValuatorState) + v->numAxes * 4;
- tv->num_valuators = v->numAxes;
- tv->mode = valuator_get_mode(dev, 0);
- tv->mode |= (dev->proximity && !dev->proximity->in_proximity) ? OutOfProximity : 0;
- buf += sizeof(xValuatorState);
- for (i = 0, values = v->axisVal; i < v->numAxes; i++) {
- if (rc != BadAccess)
- *((int *)buf) = *values;
- values++;
- if (client->swapped) {
- swapl((int *)buf, n); /* macro - braces needed */
- }
- buf += sizeof(int);
- }
- }
-
- rep.num_classes = num_classes;
- rep.length = bytes_to_int32(total_length);
- WriteReplyToClient(client, sizeof(xQueryDeviceStateReply), &rep);
- if (total_length > 0)
- WriteToClient(client, total_length, savbuf);
- free(savbuf);
- return Success;
-}
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XQueryDeviceState function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep)
-{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
-}
+/*
+
+Copyright 1998, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+
+/***********************************************************************
+ *
+ * Request to query the state of an extension input device.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "inputstr.h" /* DeviceIntPtr */
+#include "windowstr.h" /* window structure */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "exevents.h"
+#include "exglobals.h"
+#include "xkbsrv.h"
+#include "xkbstr.h"
+
+#include "queryst.h"
+
+/***********************************************************************
+ *
+ * This procedure allows a client to query the state of a device.
+ *
+ */
+
+int
+SProcXQueryDeviceState(ClientPtr client)
+{
+ REQUEST(xQueryDeviceStateReq);
+ swaps(&stuff->length);
+ return (ProcXQueryDeviceState(client));
+}
+
+/***********************************************************************
+ *
+ * This procedure allows frozen events to be routed.
+ *
+ */
+
+int
+ProcXQueryDeviceState(ClientPtr client)
+{
+ int rc, i;
+ int num_classes = 0;
+ int total_length = 0;
+ char *buf, *savbuf;
+ KeyClassPtr k;
+ xKeyState *tk;
+ ButtonClassPtr b;
+ xButtonState *tb;
+ ValuatorClassPtr v;
+ xValuatorState *tv;
+ xQueryDeviceStateReply rep;
+ DeviceIntPtr dev;
+ double *values;
+
+ REQUEST(xQueryDeviceStateReq);
+ REQUEST_SIZE_MATCH(xQueryDeviceStateReq);
+
+ rep.repType = X_Reply;
+ rep.RepType = X_QueryDeviceState;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess);
+ if (rc != Success && rc != BadAccess)
+ return rc;
+
+ v = dev->valuator;
+ if (v != NULL && v->motionHintWindow != NULL)
+ MaybeStopDeviceHint(dev, client);
+
+ k = dev->key;
+ if (k != NULL) {
+ total_length += sizeof(xKeyState);
+ num_classes++;
+ }
+
+ b = dev->button;
+ if (b != NULL) {
+ total_length += sizeof(xButtonState);
+ num_classes++;
+ }
+
+ if (v != NULL) {
+ total_length += (sizeof(xValuatorState) + (v->numAxes * sizeof(int)));
+ num_classes++;
+ }
+ buf = (char *)calloc(total_length, 1);
+ if (!buf)
+ return BadAlloc;
+ savbuf = buf;
+
+ if (k != NULL) {
+ tk = (xKeyState *) buf;
+ tk->class = KeyClass;
+ tk->length = sizeof(xKeyState);
+ tk->num_keys = k->xkbInfo->desc->max_key_code -
+ k->xkbInfo->desc->min_key_code + 1;
+ if (rc != BadAccess)
+ for (i = 0; i < 32; i++)
+ tk->keys[i] = k->down[i];
+ buf += sizeof(xKeyState);
+ }
+
+ if (b != NULL) {
+ tb = (xButtonState *) buf;
+ tb->class = ButtonClass;
+ tb->length = sizeof(xButtonState);
+ tb->num_buttons = b->numButtons;
+ if (rc != BadAccess)
+ memcpy(tb->buttons, b->down, sizeof(b->down));
+ buf += sizeof(xButtonState);
+ }
+
+ if (v != NULL) {
+ tv = (xValuatorState *) buf;
+ tv->class = ValuatorClass;
+ tv->length = sizeof(xValuatorState) + v->numAxes * 4;
+ tv->num_valuators = v->numAxes;
+ tv->mode = valuator_get_mode(dev, 0);
+ tv->mode |= (dev->proximity && !dev->proximity->in_proximity) ? OutOfProximity : 0;
+ buf += sizeof(xValuatorState);
+ for (i = 0, values = v->axisVal; i < v->numAxes; i++) {
+ if (rc != BadAccess)
+ *((int *)buf) = *values;
+ values++;
+ if (client->swapped) {
+ swapl((int *)buf);
+ }
+ buf += sizeof(int);
+ }
+ }
+
+ rep.num_classes = num_classes;
+ rep.length = bytes_to_int32(total_length);
+ WriteReplyToClient(client, sizeof(xQueryDeviceStateReply), &rep);
+ if (total_length > 0)
+ WriteToClient(client, total_length, savbuf);
+ free(savbuf);
+ return Success;
+}
+
+/***********************************************************************
+ *
+ * This procedure writes the reply for the XQueryDeviceState function,
+ * if the client and server have a different byte ordering.
+ *
+ */
+
+void
+SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep)
+{
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ WriteToClient(client, size, (char *)rep);
+}
diff --git a/xorg-server/Xi/selectev.c b/xorg-server/Xi/selectev.c
index 031e602ad..4c2c2fe05 100644
--- a/xorg-server/Xi/selectev.c
+++ b/xorg-server/Xi/selectev.c
@@ -123,13 +123,11 @@ HandleDevicePresenceMask(ClientPtr client, WindowPtr win,
int
SProcXSelectExtensionEvent(ClientPtr client)
{
- char n;
-
REQUEST(xSelectExtensionEventReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xSelectExtensionEventReq);
- swapl(&stuff->window, n);
- swaps(&stuff->count, n);
+ swapl(&stuff->window);
+ swaps(&stuff->count);
REQUEST_FIXED_SIZE(xSelectExtensionEventReq,
stuff->count * sizeof(CARD32));
SwapLongs((CARD32 *) (&stuff[1]), stuff->count);
diff --git a/xorg-server/Xi/sendexev.c b/xorg-server/Xi/sendexev.c
index 59fe93db7..4770c28d1 100644
--- a/xorg-server/Xi/sendexev.c
+++ b/xorg-server/Xi/sendexev.c
@@ -1,156 +1,155 @@
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/***********************************************************************
- *
- * Request to send an extension event.
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* Window */
-#include "extnsionst.h" /* EventSwapPtr */
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "exevents.h"
-#include "exglobals.h"
-
-#include "grabdev.h"
-#include "sendexev.h"
-
-extern int lastEvent; /* Defined in extension.c */
-
-/***********************************************************************
- *
- * Handle requests from clients with a different byte order than us.
- *
- */
-
-int
-SProcXSendExtensionEvent(ClientPtr client)
-{
- char n;
- CARD32 *p;
- int i;
- xEvent eventT;
- xEvent *eventP;
- EventSwapPtr proc;
-
- REQUEST(xSendExtensionEventReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
- swapl(&stuff->destination, n);
- swaps(&stuff->count, n);
-
- if (stuff->length != bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
- bytes_to_int32(stuff->num_events * sizeof(xEvent)))
- return BadLength;
-
- eventP = (xEvent *) & stuff[1];
- for (i = 0; i < stuff->num_events; i++, eventP++) {
- proc = EventSwapVector[eventP->u.u.type & 0177];
- if (proc == NotImplemented) /* no swapping proc; invalid event type? */
- return BadValue;
- (*proc) (eventP, &eventT);
- *eventP = eventT;
- }
-
- p = (CARD32 *)(((xEvent *) & stuff[1]) + stuff->num_events);
- SwapLongs(p, stuff->count);
- return (ProcXSendExtensionEvent(client));
-}
-
-/***********************************************************************
- *
- * Send an event to some client, as if it had come from an extension input
- * device.
- *
- */
-
-int
-ProcXSendExtensionEvent(ClientPtr client)
-{
- int ret;
- DeviceIntPtr dev;
- xEvent *first;
- XEventClass *list;
- struct tmask tmp[EMASKSIZE];
-
- REQUEST(xSendExtensionEventReq);
- REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
-
- if (stuff->length != bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
- (stuff->num_events * bytes_to_int32(sizeof(xEvent))))
- return BadLength;
-
- ret = dixLookupDevice(&dev, stuff->deviceid, client, DixWriteAccess);
- if (ret != Success)
- return ret;
-
- /* The client's event type must be one defined by an extension. */
-
- first = ((xEvent *) & stuff[1]);
- if (!((EXTENSION_EVENT_BASE <= first->u.u.type) &&
- (first->u.u.type < lastEvent))) {
- client->errorValue = first->u.u.type;
- return BadValue;
- }
-
- list = (XEventClass *) (first + stuff->num_events);
- if ((ret = CreateMaskFromList(client, list, stuff->count, tmp, dev,
- X_SendExtensionEvent)) != Success)
- return ret;
-
- ret = (SendEvent(client, dev, stuff->destination,
- stuff->propagate, (xEvent *) & stuff[1],
- tmp[stuff->deviceid].mask, stuff->num_events));
-
- return ret;
-}
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+/***********************************************************************
+ *
+ * Request to send an extension event.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "inputstr.h" /* DeviceIntPtr */
+#include "windowstr.h" /* Window */
+#include "extnsionst.h" /* EventSwapPtr */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "exevents.h"
+#include "exglobals.h"
+
+#include "grabdev.h"
+#include "sendexev.h"
+
+extern int lastEvent; /* Defined in extension.c */
+
+/***********************************************************************
+ *
+ * Handle requests from clients with a different byte order than us.
+ *
+ */
+
+int
+SProcXSendExtensionEvent(ClientPtr client)
+{
+ CARD32 *p;
+ int i;
+ xEvent eventT;
+ xEvent *eventP;
+ EventSwapPtr proc;
+
+ REQUEST(xSendExtensionEventReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
+ swapl(&stuff->destination);
+ swaps(&stuff->count);
+
+ if (stuff->length != bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
+ bytes_to_int32(stuff->num_events * sizeof(xEvent)))
+ return BadLength;
+
+ eventP = (xEvent *) & stuff[1];
+ for (i = 0; i < stuff->num_events; i++, eventP++) {
+ proc = EventSwapVector[eventP->u.u.type & 0177];
+ if (proc == NotImplemented) /* no swapping proc; invalid event type? */
+ return BadValue;
+ (*proc) (eventP, &eventT);
+ *eventP = eventT;
+ }
+
+ p = (CARD32 *)(((xEvent *) & stuff[1]) + stuff->num_events);
+ SwapLongs(p, stuff->count);
+ return (ProcXSendExtensionEvent(client));
+}
+
+/***********************************************************************
+ *
+ * Send an event to some client, as if it had come from an extension input
+ * device.
+ *
+ */
+
+int
+ProcXSendExtensionEvent(ClientPtr client)
+{
+ int ret;
+ DeviceIntPtr dev;
+ xEvent *first;
+ XEventClass *list;
+ struct tmask tmp[EMASKSIZE];
+
+ REQUEST(xSendExtensionEventReq);
+ REQUEST_AT_LEAST_SIZE(xSendExtensionEventReq);
+
+ if (stuff->length != bytes_to_int32(sizeof(xSendExtensionEventReq)) + stuff->count +
+ (stuff->num_events * bytes_to_int32(sizeof(xEvent))))
+ return BadLength;
+
+ ret = dixLookupDevice(&dev, stuff->deviceid, client, DixWriteAccess);
+ if (ret != Success)
+ return ret;
+
+ /* The client's event type must be one defined by an extension. */
+
+ first = ((xEvent *) & stuff[1]);
+ if (!((EXTENSION_EVENT_BASE <= first->u.u.type) &&
+ (first->u.u.type < lastEvent))) {
+ client->errorValue = first->u.u.type;
+ return BadValue;
+ }
+
+ list = (XEventClass *) (first + stuff->num_events);
+ if ((ret = CreateMaskFromList(client, list, stuff->count, tmp, dev,
+ X_SendExtensionEvent)) != Success)
+ return ret;
+
+ ret = (SendEvent(client, dev, stuff->destination,
+ stuff->propagate, (xEvent *) & stuff[1],
+ tmp[stuff->deviceid].mask, stuff->num_events));
+
+ return ret;
+}
diff --git a/xorg-server/Xi/setbmap.c b/xorg-server/Xi/setbmap.c
index 37c40e408..2a8f5d3b7 100644
--- a/xorg-server/Xi/setbmap.c
+++ b/xorg-server/Xi/setbmap.c
@@ -71,10 +71,8 @@ SOFTWARE.
int
SProcXSetDeviceButtonMapping(ClientPtr client)
{
- char n;
-
REQUEST(xSetDeviceButtonMappingReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXSetDeviceButtonMapping(client));
}
@@ -132,9 +130,7 @@ void
SRepXSetDeviceButtonMapping(ClientPtr client, int size,
xSetDeviceButtonMappingReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/xorg-server/Xi/setdval.c b/xorg-server/Xi/setdval.c
index b384f0d3c..ea17852f7 100644
--- a/xorg-server/Xi/setdval.c
+++ b/xorg-server/Xi/setdval.c
@@ -71,10 +71,8 @@ SOFTWARE.
int
SProcXSetDeviceValuators(ClientPtr client)
{
- char n;
-
REQUEST(xSetDeviceValuatorsReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXSetDeviceValuators(client));
}
@@ -138,9 +136,7 @@ void
SRepXSetDeviceValuators(ClientPtr client, int size,
xSetDeviceValuatorsReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/xorg-server/Xi/setfocus.c b/xorg-server/Xi/setfocus.c
index 03bc37acb..feec3fc35 100644
--- a/xorg-server/Xi/setfocus.c
+++ b/xorg-server/Xi/setfocus.c
@@ -74,13 +74,11 @@ SOFTWARE.
int
SProcXSetDeviceFocus(ClientPtr client)
{
- char n;
-
REQUEST(xSetDeviceFocusReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xSetDeviceFocusReq);
- swapl(&stuff->focus, n);
- swapl(&stuff->time, n);
+ swapl(&stuff->focus);
+ swapl(&stuff->time);
return (ProcXSetDeviceFocus(client));
}
diff --git a/xorg-server/Xi/setmmap.c b/xorg-server/Xi/setmmap.c
index cbe5dc8c5..dc6d828a1 100644
--- a/xorg-server/Xi/setmmap.c
+++ b/xorg-server/Xi/setmmap.c
@@ -73,10 +73,8 @@ SOFTWARE.
int
SProcXSetDeviceModifierMapping(ClientPtr client)
{
- char n;
-
REQUEST(xSetDeviceModifierMappingReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXSetDeviceModifierMapping(client));
}
@@ -140,9 +138,7 @@ void
SRepXSetDeviceModifierMapping(ClientPtr client, int size,
xSetDeviceModifierMappingReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
WriteToClient(client, size, (char *)rep);
}
diff --git a/xorg-server/Xi/setmode.c b/xorg-server/Xi/setmode.c
index 9f88eacf6..80ee764b0 100644
--- a/xorg-server/Xi/setmode.c
+++ b/xorg-server/Xi/setmode.c
@@ -1,146 +1,142 @@
-/************************************************************
-
-Copyright 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Hewlett-Packard not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-/***********************************************************************
- *
- * Request to change the mode of an extension input device.
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "inputstr.h" /* DeviceIntPtr */
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XIproto.h>
-#include "XIstubs.h"
-#include "exglobals.h"
-
-#include "setmode.h"
-
-/***********************************************************************
- *
- * Handle a request from a client with a different byte order.
- *
- */
-
-int
-SProcXSetDeviceMode(ClientPtr client)
-{
- char n;
-
- REQUEST(xSetDeviceModeReq);
- swaps(&stuff->length, n);
- return (ProcXSetDeviceMode(client));
-}
-
-/***********************************************************************
- *
- * This procedure sets the mode of a device.
- *
- */
-
-int
-ProcXSetDeviceMode(ClientPtr client)
-{
- DeviceIntPtr dev;
- xSetDeviceModeReply rep;
- int rc;
-
- REQUEST(xSetDeviceModeReq);
- REQUEST_SIZE_MATCH(xSetDeviceModeReq);
-
- rep.repType = X_Reply;
- rep.RepType = X_SetDeviceMode;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
- if (rc != Success)
- return rc;
- if (dev->valuator == NULL)
- return BadMatch;
- if ((dev->deviceGrab.grab) && !SameClient(dev->deviceGrab.grab, client))
- rep.status = AlreadyGrabbed;
- else
- rep.status = SetDeviceMode(client, dev, stuff->mode);
-
- if (rep.status == Success)
- valuator_set_mode(dev, VALUATOR_MODE_ALL_AXES, stuff->mode);
- else if (rep.status != AlreadyGrabbed)
- {
- switch(rep.status) {
- case BadMatch:
- case BadImplementation:
- case BadAlloc:
- break;
- default:
- rep.status = BadMode;
- }
- return rep.status;
- }
-
- WriteReplyToClient(client, sizeof(xSetDeviceModeReply), &rep);
- return Success;
-}
-
-/***********************************************************************
- *
- * This procedure writes the reply for the XSetDeviceMode function,
- * if the client and server have a different byte ordering.
- *
- */
-
-void
-SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep)
-{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
-}
+/************************************************************
+
+Copyright 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Hewlett-Packard not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+/***********************************************************************
+ *
+ * Request to change the mode of an extension input device.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "inputstr.h" /* DeviceIntPtr */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XIproto.h>
+#include "XIstubs.h"
+#include "exglobals.h"
+
+#include "setmode.h"
+
+/***********************************************************************
+ *
+ * Handle a request from a client with a different byte order.
+ *
+ */
+
+int
+SProcXSetDeviceMode(ClientPtr client)
+{
+ REQUEST(xSetDeviceModeReq);
+ swaps(&stuff->length);
+ return (ProcXSetDeviceMode(client));
+}
+
+/***********************************************************************
+ *
+ * This procedure sets the mode of a device.
+ *
+ */
+
+int
+ProcXSetDeviceMode(ClientPtr client)
+{
+ DeviceIntPtr dev;
+ xSetDeviceModeReply rep;
+ int rc;
+
+ REQUEST(xSetDeviceModeReq);
+ REQUEST_SIZE_MATCH(xSetDeviceModeReq);
+
+ rep.repType = X_Reply;
+ rep.RepType = X_SetDeviceMode;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess);
+ if (rc != Success)
+ return rc;
+ if (dev->valuator == NULL)
+ return BadMatch;
+ if ((dev->deviceGrab.grab) && !SameClient(dev->deviceGrab.grab, client))
+ rep.status = AlreadyGrabbed;
+ else
+ rep.status = SetDeviceMode(client, dev, stuff->mode);
+
+ if (rep.status == Success)
+ valuator_set_mode(dev, VALUATOR_MODE_ALL_AXES, stuff->mode);
+ else if (rep.status != AlreadyGrabbed)
+ {
+ switch(rep.status) {
+ case BadMatch:
+ case BadImplementation:
+ case BadAlloc:
+ break;
+ default:
+ rep.status = BadMode;
+ }
+ return rep.status;
+ }
+
+ WriteReplyToClient(client, sizeof(xSetDeviceModeReply), &rep);
+ return Success;
+}
+
+/***********************************************************************
+ *
+ * This procedure writes the reply for the XSetDeviceMode function,
+ * if the client and server have a different byte ordering.
+ *
+ */
+
+void
+SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep)
+{
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ WriteToClient(client, size, (char *)rep);
+}
diff --git a/xorg-server/Xi/ungrdev.c b/xorg-server/Xi/ungrdev.c
index a09c3d024..bc66cfc4b 100644
--- a/xorg-server/Xi/ungrdev.c
+++ b/xorg-server/Xi/ungrdev.c
@@ -70,12 +70,10 @@ SOFTWARE.
int
SProcXUngrabDevice(ClientPtr client)
{
- char n;
-
REQUEST(xUngrabDeviceReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceReq);
- swapl(&stuff->time, n);
+ swapl(&stuff->time);
return (ProcXUngrabDevice(client));
}
diff --git a/xorg-server/Xi/ungrdevb.c b/xorg-server/Xi/ungrdevb.c
index 4e93f1ae3..9e9ece47a 100644
--- a/xorg-server/Xi/ungrdevb.c
+++ b/xorg-server/Xi/ungrdevb.c
@@ -76,13 +76,11 @@ SOFTWARE.
int
SProcXUngrabDeviceButton(ClientPtr client)
{
- char n;
-
REQUEST(xUngrabDeviceButtonReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceButtonReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
+ swapl(&stuff->grabWindow);
+ swaps(&stuff->modifiers);
return (ProcXUngrabDeviceButton(client));
}
diff --git a/xorg-server/Xi/ungrdevk.c b/xorg-server/Xi/ungrdevk.c
index 3b4d6260e..526347db4 100644
--- a/xorg-server/Xi/ungrdevk.c
+++ b/xorg-server/Xi/ungrdevk.c
@@ -78,13 +78,11 @@ SOFTWARE.
int
SProcXUngrabDeviceKey(ClientPtr client)
{
- char n;
-
REQUEST(xUngrabDeviceKeyReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xUngrabDeviceKeyReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
+ swapl(&stuff->grabWindow);
+ swaps(&stuff->modifiers);
return (ProcXUngrabDeviceKey(client));
}
diff --git a/xorg-server/Xi/xiallowev.c b/xorg-server/Xi/xiallowev.c
index 3077e1a44..0d45b3654 100644
--- a/xorg-server/Xi/xiallowev.c
+++ b/xorg-server/Xi/xiallowev.c
@@ -44,13 +44,11 @@
int
SProcXIAllowEvents(ClientPtr client)
{
- char n;
-
REQUEST(xXIAllowEventsReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->time, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->time);
return ProcXIAllowEvents(client);
}
diff --git a/xorg-server/Xi/xichangecursor.c b/xorg-server/Xi/xichangecursor.c
index 2d58fa529..48f51f3b5 100644
--- a/xorg-server/Xi/xichangecursor.c
+++ b/xorg-server/Xi/xichangecursor.c
@@ -1,113 +1,111 @@
-/*
- * Copyright 2007-2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Author: Peter Hutterer, University of South Australia, NICTA
- */
-
-/***********************************************************************
- *
- * Request to change a given device pointer's cursor.
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <X11/X.h> /* for inputstr.h */
-#include <X11/Xproto.h> /* Request macro */
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* window structure */
-#include "scrnintstr.h" /* screen structure */
-#include <X11/extensions/XI.h>
-#include <X11/extensions/XI2proto.h>
-#include "extnsionst.h"
-#include "exevents.h"
-#include "exglobals.h"
-#include "input.h"
-
-#include "xichangecursor.h"
-
-/***********************************************************************
- *
- * This procedure allows a client to set one pointer's cursor.
- *
- */
-
-int
-SProcXIChangeCursor(ClientPtr client)
-{
- char n;
-
- REQUEST(xXIChangeCursorReq);
- swaps(&stuff->length, n);
- swapl(&stuff->win, n);
- swapl(&stuff->cursor, n);
- swaps(&stuff->deviceid, n);
- REQUEST_SIZE_MATCH(xXIChangeCursorReq);
- return (ProcXIChangeCursor(client));
-}
-
-int ProcXIChangeCursor(ClientPtr client)
-{
- int rc;
- WindowPtr pWin = NULL;
- DeviceIntPtr pDev = NULL;
- CursorPtr pCursor = NULL;
-
- REQUEST(xXIChangeCursorReq);
- REQUEST_SIZE_MATCH(xXIChangeCursorReq);
-
- rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixSetAttrAccess);
- if (rc != Success)
- return rc;
-
- if (!IsMaster(pDev) || !IsPointerDevice(pDev))
- return BadDevice;
-
- if (stuff->win != None)
- {
- rc = dixLookupWindow(&pWin, stuff->win, client, DixSetAttrAccess);
- if (rc != Success)
- return rc;
- }
-
- if (stuff->cursor == None)
- {
- if (pWin == pWin->drawable.pScreen->root)
- pCursor = rootCursor;
- else
- pCursor = (CursorPtr)None;
- }
- else
- {
- rc = dixLookupResourceByType((pointer *)&pCursor, stuff->cursor,
- RT_CURSOR, client, DixUseAccess);
- if (rc != Success)
- return rc;
- }
-
- ChangeWindowDeviceCursor(pWin, pDev, pCursor);
-
- return Success;
-}
-
+/*
+ * Copyright 2007-2008 Peter Hutterer
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Peter Hutterer, University of South Australia, NICTA
+ */
+
+/***********************************************************************
+ *
+ * Request to change a given device pointer's cursor.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h> /* for inputstr.h */
+#include <X11/Xproto.h> /* Request macro */
+#include "inputstr.h" /* DeviceIntPtr */
+#include "windowstr.h" /* window structure */
+#include "scrnintstr.h" /* screen structure */
+#include <X11/extensions/XI.h>
+#include <X11/extensions/XI2proto.h>
+#include "extnsionst.h"
+#include "exevents.h"
+#include "exglobals.h"
+#include "input.h"
+
+#include "xichangecursor.h"
+
+/***********************************************************************
+ *
+ * This procedure allows a client to set one pointer's cursor.
+ *
+ */
+
+int
+SProcXIChangeCursor(ClientPtr client)
+{
+ REQUEST(xXIChangeCursorReq);
+ swaps(&stuff->length);
+ swapl(&stuff->win);
+ swapl(&stuff->cursor);
+ swaps(&stuff->deviceid);
+ REQUEST_SIZE_MATCH(xXIChangeCursorReq);
+ return (ProcXIChangeCursor(client));
+}
+
+int ProcXIChangeCursor(ClientPtr client)
+{
+ int rc;
+ WindowPtr pWin = NULL;
+ DeviceIntPtr pDev = NULL;
+ CursorPtr pCursor = NULL;
+
+ REQUEST(xXIChangeCursorReq);
+ REQUEST_SIZE_MATCH(xXIChangeCursorReq);
+
+ rc = dixLookupDevice(&pDev, stuff->deviceid, client, DixSetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ if (!IsMaster(pDev) || !IsPointerDevice(pDev))
+ return BadDevice;
+
+ if (stuff->win != None)
+ {
+ rc = dixLookupWindow(&pWin, stuff->win, client, DixSetAttrAccess);
+ if (rc != Success)
+ return rc;
+ }
+
+ if (stuff->cursor == None)
+ {
+ if (pWin == pWin->drawable.pScreen->root)
+ pCursor = rootCursor;
+ else
+ pCursor = (CursorPtr)None;
+ }
+ else
+ {
+ rc = dixLookupResourceByType((pointer *)&pCursor, stuff->cursor,
+ RT_CURSOR, client, DixUseAccess);
+ if (rc != Success)
+ return rc;
+ }
+
+ ChangeWindowDeviceCursor(pWin, pDev, pCursor);
+
+ return Success;
+}
+
diff --git a/xorg-server/Xi/xichangehierarchy.c b/xorg-server/Xi/xichangehierarchy.c
index 96ead6fcd..614d23116 100644
--- a/xorg-server/Xi/xichangehierarchy.c
+++ b/xorg-server/Xi/xichangehierarchy.c
@@ -133,10 +133,8 @@ void XISendDeviceHierarchyEvent(int flags[MAXDEVICES])
int SProcXIChangeHierarchy(ClientPtr client)
{
- char n;
-
REQUEST(xXIChangeHierarchyReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (ProcXIChangeHierarchy(client));
}
@@ -424,7 +422,6 @@ ProcXIChangeHierarchy(ClientPtr client)
{
xXIAnyHierarchyChangeInfo *any;
int required_len = sizeof(xXIChangeHierarchyReq);
- char n;
int rc = Success;
int flags[MAXDEVICES] = {0};
@@ -437,8 +434,8 @@ ProcXIChangeHierarchy(ClientPtr client)
any = (xXIAnyHierarchyChangeInfo*)&stuff[1];
while(stuff->num_changes--)
{
- SWAPIF(swapl(&any->type, n));
- SWAPIF(swaps(&any->length, n));
+ SWAPIF(swaps(&any->type));
+ SWAPIF(swaps(&any->length));
required_len += any->length;
if ((stuff->length * 4) < required_len)
@@ -449,7 +446,7 @@ ProcXIChangeHierarchy(ClientPtr client)
case XIAddMaster:
{
xXIAddMasterInfo* c = (xXIAddMasterInfo*)any;
- SWAPIF(swaps(&c->name_len, n));
+ SWAPIF(swaps(&c->name_len));
rc = add_master(client, c, flags);
if (rc != Success)
diff --git a/xorg-server/Xi/xigetclientpointer.c b/xorg-server/Xi/xigetclientpointer.c
index 401e89fb4..1124ae08c 100644
--- a/xorg-server/Xi/xigetclientpointer.c
+++ b/xorg-server/Xi/xigetclientpointer.c
@@ -49,11 +49,10 @@
int
SProcXIGetClientPointer(ClientPtr client)
{
- char n;
REQUEST(xXIGetClientPointerReq);
- swaps(&stuff->length, n);
- swapl(&stuff->win, n);
+ swaps(&stuff->length);
+ swapl(&stuff->win);
return ProcXIGetClientPointer(client);
}
@@ -97,10 +96,9 @@ void
SRepXIGetClientPointer(ClientPtr client, int size,
xXIGetClientPointerReply* rep)
{
- char n;
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->deviceid, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->deviceid);
WriteToClient(client, size, (char *)rep);
}
diff --git a/xorg-server/Xi/xigrabdev.c b/xorg-server/Xi/xigrabdev.c
index 05c732c89..a9b655c0e 100644
--- a/xorg-server/Xi/xigrabdev.c
+++ b/xorg-server/Xi/xigrabdev.c
@@ -1,161 +1,155 @@
-/*
- * Copyright © 2009 Red Hat, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Author: Peter Hutterer
- */
-
-/***********************************************************************
- *
- * Request to grab or ungrab input device.
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "inputstr.h" /* DeviceIntPtr */
-#include "windowstr.h" /* window structure */
-#include <X11/extensions/XI2.h>
-#include <X11/extensions/XI2proto.h>
-
-#include "exglobals.h" /* BadDevice */
-#include "exevents.h"
-#include "xigrabdev.h"
-
-int
-SProcXIGrabDevice(ClientPtr client)
-{
- char n;
-
- REQUEST(xXIGrabDeviceReq);
-
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->grab_window, n);
- swapl(&stuff->cursor, n);
- swapl(&stuff->time, n);
- swaps(&stuff->mask_len, n);
-
- return ProcXIGrabDevice(client);
-}
-
-int
-ProcXIGrabDevice(ClientPtr client)
-{
- DeviceIntPtr dev;
- xXIGrabDeviceReply rep;
- int ret = Success;
- uint8_t status;
- GrabMask mask;
- int mask_len;
-
- REQUEST(xXIGrabDeviceReq);
- REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq);
-
- ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
- if (ret != Success)
- return ret;
-
- if (!IsMaster(dev))
- stuff->paired_device_mode = GrabModeAsync;
-
- if (XICheckInvalidMaskBits(client, (unsigned char*)&stuff[1],
- stuff->mask_len * 4) != Success)
- return BadValue;
-
- mask_len = min(sizeof(mask.xi2mask[stuff->deviceid]), stuff->mask_len * 4);
- memset(mask.xi2mask, 0, sizeof(mask.xi2mask));
- memcpy(mask.xi2mask, (char*)&stuff[1], mask_len);
-
- ret = GrabDevice(client, dev, stuff->grab_mode,
- stuff->paired_device_mode,
- stuff->grab_window,
- stuff->owner_events,
- stuff->time,
- &mask,
- GRABTYPE_XI2,
- stuff->cursor,
- None /* confineTo */,
- &status);
-
- if (ret != Success)
- return ret;
-
- rep.repType = X_Reply;
- rep.RepType = X_XIGrabDevice;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.status = status;
-
-
- WriteReplyToClient(client, sizeof(rep), &rep);
- return ret;
-}
-
-int
-SProcXIUngrabDevice(ClientPtr client)
-{
- char n;
-
- REQUEST(xXIUngrabDeviceReq);
-
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->time, n);
-
- return ProcXIUngrabDevice(client);
-}
-
-int
-ProcXIUngrabDevice(ClientPtr client)
-{
- DeviceIntPtr dev;
- GrabPtr grab;
- int ret = Success;
- TimeStamp time;
-
- REQUEST(xXIUngrabDeviceReq);
-
- ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
- if (ret != Success)
- return ret;
-
- grab = dev->deviceGrab.grab;
-
- time = ClientTimeToServerTime(stuff->time);
- if ((CompareTimeStamps(time, currentTime) != LATER) &&
- (CompareTimeStamps(time, dev->deviceGrab.grabTime) != EARLIER) &&
- (grab) && SameClient(grab, client) && grab->grabtype == GRABTYPE_XI2)
- (*dev->deviceGrab.DeactivateGrab) (dev);
-
- return Success;
-}
-
-void SRepXIGrabDevice(ClientPtr client, int size, xXIGrabDeviceReply * rep)
-{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- WriteToClient(client, size, (char *)rep);
-}
+/*
+ * Copyright © 2009 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Peter Hutterer
+ */
+
+/***********************************************************************
+ *
+ * Request to grab or ungrab input device.
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "inputstr.h" /* DeviceIntPtr */
+#include "windowstr.h" /* window structure */
+#include <X11/extensions/XI2.h>
+#include <X11/extensions/XI2proto.h>
+
+#include "exglobals.h" /* BadDevice */
+#include "exevents.h"
+#include "xigrabdev.h"
+
+int
+SProcXIGrabDevice(ClientPtr client)
+{
+ REQUEST(xXIGrabDeviceReq);
+
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->grab_window);
+ swapl(&stuff->cursor);
+ swapl(&stuff->time);
+ swaps(&stuff->mask_len);
+
+ return ProcXIGrabDevice(client);
+}
+
+int
+ProcXIGrabDevice(ClientPtr client)
+{
+ DeviceIntPtr dev;
+ xXIGrabDeviceReply rep;
+ int ret = Success;
+ uint8_t status;
+ GrabMask mask;
+ int mask_len;
+
+ REQUEST(xXIGrabDeviceReq);
+ REQUEST_AT_LEAST_SIZE(xXIGrabDeviceReq);
+
+ ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess);
+ if (ret != Success)
+ return ret;
+
+ if (!IsMaster(dev))
+ stuff->paired_device_mode = GrabModeAsync;
+
+ if (XICheckInvalidMaskBits(client, (unsigned char*)&stuff[1],
+ stuff->mask_len * 4) != Success)
+ return BadValue;
+
+ mask_len = min(sizeof(mask.xi2mask[stuff->deviceid]), stuff->mask_len * 4);
+ memset(mask.xi2mask, 0, sizeof(mask.xi2mask));
+ memcpy(mask.xi2mask, (char*)&stuff[1], mask_len);
+
+ ret = GrabDevice(client, dev, stuff->grab_mode,
+ stuff->paired_device_mode,
+ stuff->grab_window,
+ stuff->owner_events,
+ stuff->time,
+ &mask,
+ GRABTYPE_XI2,
+ stuff->cursor,
+ None /* confineTo */,
+ &status);
+
+ if (ret != Success)
+ return ret;
+
+ rep.repType = X_Reply;
+ rep.RepType = X_XIGrabDevice;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.status = status;
+
+
+ WriteReplyToClient(client, sizeof(rep), &rep);
+ return ret;
+}
+
+int
+SProcXIUngrabDevice(ClientPtr client)
+{
+ REQUEST(xXIUngrabDeviceReq);
+
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->time);
+
+ return ProcXIUngrabDevice(client);
+}
+
+int
+ProcXIUngrabDevice(ClientPtr client)
+{
+ DeviceIntPtr dev;
+ GrabPtr grab;
+ int ret = Success;
+ TimeStamp time;
+
+ REQUEST(xXIUngrabDeviceReq);
+
+ ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
+ if (ret != Success)
+ return ret;
+
+ grab = dev->deviceGrab.grab;
+
+ time = ClientTimeToServerTime(stuff->time);
+ if ((CompareTimeStamps(time, currentTime) != LATER) &&
+ (CompareTimeStamps(time, dev->deviceGrab.grabTime) != EARLIER) &&
+ (grab) && SameClient(grab, client) && grab->grabtype == GRABTYPE_XI2)
+ (*dev->deviceGrab.DeactivateGrab) (dev);
+
+ return Success;
+}
+
+void SRepXIGrabDevice(ClientPtr client, int size, xXIGrabDeviceReply * rep)
+{
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ WriteToClient(client, size, (char *)rep);
+}
diff --git a/xorg-server/Xi/xipassivegrab.c b/xorg-server/Xi/xipassivegrab.c
index ae4343344..6b4574854 100644
--- a/xorg-server/Xi/xipassivegrab.c
+++ b/xorg-server/Xi/xipassivegrab.c
@@ -49,27 +49,26 @@ int
SProcXIPassiveGrabDevice(ClientPtr client)
{
int i;
- char n;
xXIModifierInfo *mods;
REQUEST(xXIPassiveGrabDeviceReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->grab_window, n);
- swapl(&stuff->cursor, n);
- swapl(&stuff->time, n);
- swapl(&stuff->detail, n);
- swaps(&stuff->mask_len, n);
- swaps(&stuff->num_modifiers, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->grab_window);
+ swapl(&stuff->cursor);
+ swapl(&stuff->time);
+ swapl(&stuff->detail);
+ swaps(&stuff->mask_len);
+ swaps(&stuff->num_modifiers);
mods = (xXIModifierInfo*)&stuff[1];
for (i = 0; i < stuff->num_modifiers; i++, mods++)
{
- swapl(&mods->base_mods, n);
- swapl(&mods->latched_mods, n);
- swapl(&mods->locked_mods, n);
+ swapl(&mods->base_mods);
+ swapl(&mods->latched_mods);
+ swapl(&mods->locked_mods);
}
return ProcXIPassiveGrabDevice(client);
@@ -88,7 +87,6 @@ ProcXIPassiveGrabDevice(ClientPtr client)
GrabParameters param;
void *tmp;
int mask_len;
- int n;
REQUEST(xXIPassiveGrabDeviceReq);
REQUEST_AT_LEAST_SIZE(xXIPassiveGrabDeviceReq);
@@ -198,7 +196,7 @@ ProcXIPassiveGrabDevice(ClientPtr client)
info->status = status;
info->modifiers = *modifiers;
if (client->swapped)
- swapl(&info->modifiers, n);
+ swapl(&info->modifiers);
rep.num_modifiers++;
rep.length += bytes_to_int32(sizeof(xXIGrabModifierInfo));
@@ -217,11 +215,9 @@ void
SRepXIPassiveGrabDevice(ClientPtr client, int size,
xXIPassiveGrabDeviceReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_modifiers, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->num_modifiers);
WriteToClient(client, size, (char *)rep);
}
@@ -229,22 +225,21 @@ SRepXIPassiveGrabDevice(ClientPtr client, int size,
int
SProcXIPassiveUngrabDevice(ClientPtr client)
{
- char n;
int i;
uint32_t *modifiers;
REQUEST(xXIPassiveUngrabDeviceReq);
- swaps(&stuff->length, n);
- swapl(&stuff->grab_window, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->detail, n);
- swaps(&stuff->num_modifiers, n);
+ swaps(&stuff->length);
+ swapl(&stuff->grab_window);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->detail);
+ swaps(&stuff->num_modifiers);
modifiers = (uint32_t*)&stuff[1];
for (i = 0; i < stuff->num_modifiers; i++, modifiers++)
- swapl(modifiers, n);
+ swapl(modifiers);
return ProcXIPassiveUngrabDevice(client);
}
diff --git a/xorg-server/Xi/xiproperty.c b/xorg-server/Xi/xiproperty.c
index b10891d1c..fa0d81188 100644
--- a/xorg-server/Xi/xiproperty.c
+++ b/xorg-server/Xi/xiproperty.c
@@ -1,1362 +1,1348 @@
-/*
- * Copyright © 2006 Keith Packard
- * Copyright © 2008 Peter Hutterer
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WAXIANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WAXIANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- */
-
-/* This code is a modified version of randr/rrproperty.c */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "dix.h"
-#include "inputstr.h"
-#include <X11/extensions/XI.h>
-#include <X11/Xatom.h>
-#include <X11/extensions/XIproto.h>
-#include <X11/extensions/XI2proto.h>
-#include "exglobals.h"
-#include "exevents.h"
-#include "swaprep.h"
-
-#include "xiproperty.h"
-#include "xserver-properties.h"
-
-/**
- * Properties used or alloced from inside the server.
- */
-static struct dev_properties
-{
- Atom type;
- char *name;
-} dev_properties[] = {
- {0, XI_PROP_ENABLED},
- {0, XI_PROP_XTEST_DEVICE},
- {0, XATOM_FLOAT},
- {0, ACCEL_PROP_PROFILE_NUMBER},
- {0, ACCEL_PROP_CONSTANT_DECELERATION},
- {0, ACCEL_PROP_ADAPTIVE_DECELERATION},
- {0, ACCEL_PROP_VELOCITY_SCALING},
- {0, AXIS_LABEL_PROP},
- {0, AXIS_LABEL_PROP_REL_X},
- {0, AXIS_LABEL_PROP_REL_Y},
- {0, AXIS_LABEL_PROP_REL_Z},
- {0, AXIS_LABEL_PROP_REL_RX},
- {0, AXIS_LABEL_PROP_REL_RY},
- {0, AXIS_LABEL_PROP_REL_RZ},
- {0, AXIS_LABEL_PROP_REL_HWHEEL},
- {0, AXIS_LABEL_PROP_REL_DIAL},
- {0, AXIS_LABEL_PROP_REL_WHEEL},
- {0, AXIS_LABEL_PROP_REL_MISC},
- {0, AXIS_LABEL_PROP_ABS_X},
- {0, AXIS_LABEL_PROP_ABS_Y},
- {0, AXIS_LABEL_PROP_ABS_Z},
- {0, AXIS_LABEL_PROP_ABS_RX},
- {0, AXIS_LABEL_PROP_ABS_RY},
- {0, AXIS_LABEL_PROP_ABS_RZ},
- {0, AXIS_LABEL_PROP_ABS_THROTTLE},
- {0, AXIS_LABEL_PROP_ABS_RUDDER},
- {0, AXIS_LABEL_PROP_ABS_WHEEL},
- {0, AXIS_LABEL_PROP_ABS_GAS},
- {0, AXIS_LABEL_PROP_ABS_BRAKE},
- {0, AXIS_LABEL_PROP_ABS_HAT0X},
- {0, AXIS_LABEL_PROP_ABS_HAT0Y},
- {0, AXIS_LABEL_PROP_ABS_HAT1X},
- {0, AXIS_LABEL_PROP_ABS_HAT1Y},
- {0, AXIS_LABEL_PROP_ABS_HAT2X},
- {0, AXIS_LABEL_PROP_ABS_HAT2Y},
- {0, AXIS_LABEL_PROP_ABS_HAT3X},
- {0, AXIS_LABEL_PROP_ABS_HAT3Y},
- {0, AXIS_LABEL_PROP_ABS_PRESSURE},
- {0, AXIS_LABEL_PROP_ABS_DISTANCE},
- {0, AXIS_LABEL_PROP_ABS_TILT_X},
- {0, AXIS_LABEL_PROP_ABS_TILT_Y},
- {0, AXIS_LABEL_PROP_ABS_TOOL_WIDTH},
- {0, AXIS_LABEL_PROP_ABS_VOLUME},
- {0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MAJOR},
- {0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MINOR},
- {0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MAJOR},
- {0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MINOR},
- {0, AXIS_LABEL_PROP_ABS_MT_ORIENTATION},
- {0, AXIS_LABEL_PROP_ABS_MT_POSITION_X},
- {0, AXIS_LABEL_PROP_ABS_MT_POSITION_Y},
- {0, AXIS_LABEL_PROP_ABS_MT_TOOL_TYPE},
- {0, AXIS_LABEL_PROP_ABS_MT_BLOB_ID},
- {0, AXIS_LABEL_PROP_ABS_MT_TRACKING_ID},
- {0, AXIS_LABEL_PROP_ABS_MT_PRESSURE},
- {0, AXIS_LABEL_PROP_ABS_MISC},
-
- {0, BTN_LABEL_PROP},
- {0, BTN_LABEL_PROP_BTN_UNKNOWN},
- {0, BTN_LABEL_PROP_BTN_WHEEL_UP},
- {0, BTN_LABEL_PROP_BTN_WHEEL_DOWN},
- {0, BTN_LABEL_PROP_BTN_HWHEEL_LEFT},
- {0, BTN_LABEL_PROP_BTN_HWHEEL_RIGHT},
- {0, BTN_LABEL_PROP_BTN_0},
- {0, BTN_LABEL_PROP_BTN_1},
- {0, BTN_LABEL_PROP_BTN_2},
- {0, BTN_LABEL_PROP_BTN_3},
- {0, BTN_LABEL_PROP_BTN_4},
- {0, BTN_LABEL_PROP_BTN_5},
- {0, BTN_LABEL_PROP_BTN_6},
- {0, BTN_LABEL_PROP_BTN_7},
- {0, BTN_LABEL_PROP_BTN_8},
- {0, BTN_LABEL_PROP_BTN_9},
-
- {0, BTN_LABEL_PROP_BTN_LEFT},
- {0, BTN_LABEL_PROP_BTN_RIGHT},
- {0, BTN_LABEL_PROP_BTN_MIDDLE},
- {0, BTN_LABEL_PROP_BTN_SIDE},
- {0, BTN_LABEL_PROP_BTN_EXTRA},
- {0, BTN_LABEL_PROP_BTN_FORWARD},
- {0, BTN_LABEL_PROP_BTN_BACK},
- {0, BTN_LABEL_PROP_BTN_TASK},
-
- {0, BTN_LABEL_PROP_BTN_TRIGGER},
- {0, BTN_LABEL_PROP_BTN_THUMB},
- {0, BTN_LABEL_PROP_BTN_THUMB2},
- {0, BTN_LABEL_PROP_BTN_TOP},
- {0, BTN_LABEL_PROP_BTN_TOP2},
- {0, BTN_LABEL_PROP_BTN_PINKIE},
- {0, BTN_LABEL_PROP_BTN_BASE},
- {0, BTN_LABEL_PROP_BTN_BASE2},
- {0, BTN_LABEL_PROP_BTN_BASE3},
- {0, BTN_LABEL_PROP_BTN_BASE4},
- {0, BTN_LABEL_PROP_BTN_BASE5},
- {0, BTN_LABEL_PROP_BTN_BASE6},
- {0, BTN_LABEL_PROP_BTN_DEAD},
-
- {0, BTN_LABEL_PROP_BTN_A},
- {0, BTN_LABEL_PROP_BTN_B},
- {0, BTN_LABEL_PROP_BTN_C},
- {0, BTN_LABEL_PROP_BTN_X},
- {0, BTN_LABEL_PROP_BTN_Y},
- {0, BTN_LABEL_PROP_BTN_Z},
- {0, BTN_LABEL_PROP_BTN_TL},
- {0, BTN_LABEL_PROP_BTN_TR},
- {0, BTN_LABEL_PROP_BTN_TL2},
- {0, BTN_LABEL_PROP_BTN_TR2},
- {0, BTN_LABEL_PROP_BTN_SELECT},
- {0, BTN_LABEL_PROP_BTN_START},
- {0, BTN_LABEL_PROP_BTN_MODE},
- {0, BTN_LABEL_PROP_BTN_THUMBL},
- {0, BTN_LABEL_PROP_BTN_THUMBR},
-
- {0, BTN_LABEL_PROP_BTN_TOOL_PEN},
- {0, BTN_LABEL_PROP_BTN_TOOL_RUBBER},
- {0, BTN_LABEL_PROP_BTN_TOOL_BRUSH},
- {0, BTN_LABEL_PROP_BTN_TOOL_PENCIL},
- {0, BTN_LABEL_PROP_BTN_TOOL_AIRBRUSH},
- {0, BTN_LABEL_PROP_BTN_TOOL_FINGER},
- {0, BTN_LABEL_PROP_BTN_TOOL_MOUSE},
- {0, BTN_LABEL_PROP_BTN_TOOL_LENS},
- {0, BTN_LABEL_PROP_BTN_TOUCH},
- {0, BTN_LABEL_PROP_BTN_STYLUS},
- {0, BTN_LABEL_PROP_BTN_STYLUS2},
- {0, BTN_LABEL_PROP_BTN_TOOL_DOUBLETAP},
- {0, BTN_LABEL_PROP_BTN_TOOL_TRIPLETAP},
-
- {0, BTN_LABEL_PROP_BTN_GEAR_DOWN},
- {0, BTN_LABEL_PROP_BTN_GEAR_UP},
-
- {0, XI_PROP_TRANSFORM}
-};
-
-static long XIPropHandlerID = 1;
-
-static void send_property_event(DeviceIntPtr dev, Atom property, int what)
-{
- devicePropertyNotify event;
- xXIPropertyEvent xi2;
- int state;
-
- if (what == XIPropertyDeleted)
- state = PropertyDelete;
- else
- state = PropertyNewValue;
-
- event.type = DevicePropertyNotify;
- event.deviceid = dev->id;
- event.state = state;
- event.atom = property;
- event.time = currentTime.milliseconds;
- SendEventToAllWindows(dev, DevicePropertyNotifyMask,
- (xEvent*)&event, 1);
-
- xi2.type = GenericEvent;
- xi2.extension = IReqCode;
- xi2.length = 0;
- xi2.evtype = XI_PropertyEvent;
- xi2.deviceid = dev->id;
- xi2.time = currentTime.milliseconds;
- xi2.property = property;
- xi2.what = what;
- SendEventToAllWindows(dev, GetEventFilter(dev, (xEvent*)&xi2),
- (xEvent*)&xi2, 1);
-}
-
-static int list_atoms(DeviceIntPtr dev, int *natoms, Atom **atoms_return)
-{
- XIPropertyPtr prop;
- Atom *atoms = NULL;
- int nprops = 0;
-
- for (prop = dev->properties.properties; prop; prop = prop->next)
- nprops++;
- if (nprops)
- {
- Atom *a;
-
- atoms = malloc(nprops * sizeof(Atom));
- if(!atoms)
- return BadAlloc;
- a = atoms;
- for (prop = dev->properties.properties; prop; prop = prop->next, a++)
- *a = prop->propertyName;
- }
-
- *natoms = nprops;
- *atoms_return = atoms;
- return Success;
-}
-
-static int
-get_property(ClientPtr client, DeviceIntPtr dev, Atom property, Atom type,
- BOOL delete, int offset, int length,
- int *bytes_after, Atom *type_return, int *format, int *nitems,
- int *length_return, char **data)
-{
- unsigned long n, len, ind;
- int rc;
- XIPropertyPtr prop;
- XIPropertyValuePtr prop_value;
-
- if (!ValidAtom(property))
- {
- client->errorValue = property;
- return BadAtom;
- }
- if ((delete != xTrue) && (delete != xFalse))
- {
- client->errorValue = delete;
- return BadValue;
- }
-
- if ((type != AnyPropertyType) && !ValidAtom(type))
- {
- client->errorValue = type;
- return BadAtom;
- }
-
- for (prop = dev->properties.properties; prop; prop = prop->next)
- if (prop->propertyName == property)
- break;
-
- if (!prop)
- {
- *bytes_after = 0;
- *type_return = None;
- *format = 0;
- *nitems = 0;
- *length_return = 0;
- return Success;
- }
-
- rc = XIGetDeviceProperty(dev, property, &prop_value);
- if (rc != Success)
- {
- client->errorValue = property;
- return rc;
- }
-
- /* If the request type and actual type don't match. Return the
- property information, but not the data. */
-
- if (((type != prop_value->type) && (type != AnyPropertyType)))
- {
- *bytes_after = prop_value->size;
- *format = prop_value->format;
- *length_return = 0;
- *nitems = 0;
- *type_return = prop_value->type;
- return Success;
- }
-
- /* Return type, format, value to client */
- n = (prop_value->format/8) * prop_value->size; /* size (bytes) of prop */
- ind = offset << 2;
-
- /* If offset is invalid such that it causes "len" to
- be negative, it's a value error. */
-
- if (n < ind)
- {
- client->errorValue = offset;
- return BadValue;
- }
-
- len = min(n - ind, 4 * length);
-
- *bytes_after = n - (ind + len);
- *format = prop_value->format;
- *length_return = len;
- if (prop_value->format)
- *nitems = len / (prop_value->format / 8);
- else
- *nitems = 0;
- *type_return = prop_value->type;
-
- *data = (char*)prop_value->data + ind;
-
- return Success;
-}
-
-static int
-check_change_property(ClientPtr client, Atom property, Atom type, int format,
- int mode, int nitems)
-{
- if ((mode != PropModeReplace) && (mode != PropModeAppend) &&
- (mode != PropModePrepend))
- {
- client->errorValue = mode;
- return BadValue;
- }
- if ((format != 8) && (format != 16) && (format != 32))
- {
- client->errorValue = format;
- return BadValue;
- }
-
- if (!ValidAtom(property))
- {
- client->errorValue = property;
- return BadAtom;
- }
- if (!ValidAtom(type))
- {
- client->errorValue = type;
- return BadAtom;
- }
-
- return Success;
-}
-
-static int
-change_property(ClientPtr client, DeviceIntPtr dev, Atom property, Atom type,
- int format, int mode, int len, void *data)
-{
- int rc = Success;
-
- rc = XIChangeDeviceProperty(dev, property, type, format, mode, len, data, TRUE);
- if (rc != Success)
- client->errorValue = property;
-
- return rc;
-}
-
-/**
- * Return the atom assigned to the specified string or 0 if the atom isn't known
- * to the DIX.
- *
- * If name is NULL, None is returned.
- */
-Atom
-XIGetKnownProperty(char *name)
-{
- int i;
-
- if (!name)
- return None;
-
- for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++)
- {
- if (strcmp(name, dev_properties[i].name) == 0){
- if (dev_properties[i].type == None){
- dev_properties[i].type =
- MakeAtom(dev_properties[i].name,
- strlen(dev_properties[i].name),
- TRUE);
- }
-
- return dev_properties[i].type;
- }
- }
-
- return 0;
-}
-
-void
-XIResetProperties(void)
-{
- int i;
-
- for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++)
- dev_properties[i].type = None;
-}
-
-/**
- * Convert the given property's value(s) into @nelem_return integer values and
- * store them in @buf_return. If @nelem_return is larger than the number of
- * values in the property, @nelem_return is set to the number of values in the
- * property.
- *
- * If *@buf_return is NULL and @nelem_return is 0, memory is allocated
- * automatically and must be freed by the caller.
- *
- * Possible return codes.
- * Success ... No error.
- * BadMatch ... Wrong atom type, atom is not XA_INTEGER
- * BadAlloc ... NULL passed as buffer and allocation failed.
- * BadLength ... @buff is NULL but @nelem_return is non-zero.
- *
- * @param val The property value
- * @param nelem_return The maximum number of elements to return.
- * @param buf_return Pointer to an array of at least @nelem_return values.
- * @return Success or the error code if an error occured.
- */
-_X_EXPORT int
-XIPropToInt(XIPropertyValuePtr val, int *nelem_return, int **buf_return)
-{
- int i;
- int *buf;
-
- if (val->type != XA_INTEGER)
- return BadMatch;
- if (!*buf_return && *nelem_return)
- return BadLength;
-
- switch(val->format)
- {
- case 8:
- case 16:
- case 32:
- break;
- default:
- return BadValue;
- }
-
- buf = *buf_return;
-
- if (!buf && !(*nelem_return))
- {
- buf = calloc(val->size, sizeof(int));
- if (!buf)
- return BadAlloc;
- *buf_return = buf;
- *nelem_return = val->size;
- } else if (val->size < *nelem_return)
- *nelem_return = val->size;
-
- for (i = 0; i < val->size && i < *nelem_return; i++)
- {
- switch(val->format)
- {
- case 8: buf[i] = ((CARD8*)val->data)[i]; break;
- case 16: buf[i] = ((CARD16*)val->data)[i]; break;
- case 32: buf[i] = ((CARD32*)val->data)[i]; break;
- }
- }
-
- return Success;
-}
-
-/**
- * Convert the given property's value(s) into @nelem_return float values and
- * store them in @buf_return. If @nelem_return is larger than the number of
- * values in the property, @nelem_return is set to the number of values in the
- * property.
- *
- * If *@buf_return is NULL and @nelem_return is 0, memory is allocated
- * automatically and must be freed by the caller.
- *
- * Possible errors returned:
- * Success
- * BadMatch ... Wrong atom type, atom is not XA_FLOAT
- * BadValue ... Wrong format, format is not 32
- * BadAlloc ... NULL passed as buffer and allocation failed.
- * BadLength ... @buff is NULL but @nelem_return is non-zero.
- *
- * @param val The property value
- * @param nelem_return The maximum number of elements to return.
- * @param buf_return Pointer to an array of at least @nelem_return values.
- * @return Success or the error code if an error occured.
- */
-_X_EXPORT int
-XIPropToFloat(XIPropertyValuePtr val, int *nelem_return, float **buf_return)
-{
- int i;
- float *buf;
-
- if (!val->type || val->type != XIGetKnownProperty(XATOM_FLOAT))
- return BadMatch;
-
- if (val->format != 32)
- return BadValue;
- if (!*buf_return && *nelem_return)
- return BadLength;
-
- buf = *buf_return;
-
- if (!buf && !(*nelem_return))
- {
- buf = calloc(val->size, sizeof(float));
- if (!buf)
- return BadAlloc;
- *buf_return = buf;
- *nelem_return = val->size;
- } else if (val->size < *nelem_return)
- *nelem_return = val->size;
-
- for (i = 0; i < val->size && i < *nelem_return; i++)
- buf[i] = ((float*)val->data)[i];
-
- return Success;
-}
-
-/* Registers a new property handler on the given device and returns a unique
- * identifier for this handler. This identifier is required to unregister the
- * property handler again.
- * @return The handler's identifier or 0 if an error occured.
- */
-long
-XIRegisterPropertyHandler(DeviceIntPtr dev,
- int (*SetProperty) (DeviceIntPtr dev,
- Atom property,
- XIPropertyValuePtr prop,
- BOOL checkonly),
- int (*GetProperty) (DeviceIntPtr dev,
- Atom property),
- int (*DeleteProperty) (DeviceIntPtr dev,
- Atom property))
-{
- XIPropertyHandlerPtr new_handler;
-
- new_handler = calloc(1, sizeof(XIPropertyHandler));
- if (!new_handler)
- return 0;
-
- new_handler->id = XIPropHandlerID++;
- new_handler->SetProperty = SetProperty;
- new_handler->GetProperty = GetProperty;
- new_handler->DeleteProperty = DeleteProperty;
- new_handler->next = dev->properties.handlers;
- dev->properties.handlers = new_handler;
-
- return new_handler->id;
-}
-
-void
-XIUnregisterPropertyHandler(DeviceIntPtr dev, long id)
-{
- XIPropertyHandlerPtr curr, prev = NULL;
-
- curr = dev->properties.handlers;
- while(curr && curr->id != id)
- {
- prev = curr;
- curr = curr->next;
- }
-
- if (!curr)
- return;
-
- if (!prev) /* first one */
- dev->properties.handlers = curr->next;
- else
- prev->next = curr->next;
-
- free(curr);
-}
-
-static XIPropertyPtr
-XICreateDeviceProperty (Atom property)
-{
- XIPropertyPtr prop;
-
- prop = (XIPropertyPtr)malloc(sizeof(XIPropertyRec));
- if (!prop)
- return NULL;
-
- prop->next = NULL;
- prop->propertyName = property;
- prop->value.type = None;
- prop->value.format = 0;
- prop->value.size = 0;
- prop->value.data = NULL;
- prop->deletable = TRUE;
-
- return prop;
-}
-
-static XIPropertyPtr
-XIFetchDeviceProperty(DeviceIntPtr dev, Atom property)
-{
- XIPropertyPtr prop;
-
- for (prop = dev->properties.properties; prop; prop = prop->next)
- if (prop->propertyName == property)
- return prop;
- return NULL;
-}
-
-static void
-XIDestroyDeviceProperty (XIPropertyPtr prop)
-{
- free(prop->value.data);
- free(prop);
-}
-
-/* This function destroys all of the device's property-related stuff,
- * including removing all device handlers.
- * DO NOT CALL FROM THE DRIVER.
- */
-void
-XIDeleteAllDeviceProperties (DeviceIntPtr device)
-{
- XIPropertyPtr prop, next;
- XIPropertyHandlerPtr curr_handler, next_handler;
-
- for (prop = device->properties.properties; prop; prop = next)
- {
- next = prop->next;
- send_property_event(device, prop->propertyName, XIPropertyDeleted);
- XIDestroyDeviceProperty(prop);
- }
-
- device->properties.properties = NULL;
-
- /* Now free all handlers */
- curr_handler = device->properties.handlers;
- while(curr_handler)
- {
- next_handler = curr_handler->next;
- free(curr_handler);
- curr_handler = next_handler;
- }
-
- device->properties.handlers = NULL;
-}
-
-
-int
-XIDeleteDeviceProperty (DeviceIntPtr device, Atom property, Bool fromClient)
-{
- XIPropertyPtr prop, *prev;
- int rc = Success;
-
- for (prev = &device->properties.properties; (prop = *prev); prev = &(prop->next))
- if (prop->propertyName == property)
- break;
-
- if (!prop)
- return Success;
-
- if (fromClient && !prop->deletable)
- return BadAccess;
-
- /* Ask handlers if we may delete the property */
- if (device->properties.handlers)
- {
- XIPropertyHandlerPtr handler = device->properties.handlers;
- while(handler)
- {
- if (handler->DeleteProperty)
- rc = handler->DeleteProperty(device, prop->propertyName);
- if (rc != Success)
- return rc;
- handler = handler->next;
- }
- }
-
- if (prop)
- {
- *prev = prop->next;
- send_property_event(device, prop->propertyName, XIPropertyDeleted);
- XIDestroyDeviceProperty (prop);
- }
-
- return Success;
-}
-
-int
-XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
- int format, int mode, unsigned long len,
- const pointer value, Bool sendevent)
-{
- XIPropertyPtr prop;
- int size_in_bytes;
- int total_size;
- unsigned long total_len;
- XIPropertyValuePtr prop_value;
- XIPropertyValueRec new_value;
- Bool add = FALSE;
- int rc;
-
- size_in_bytes = format >> 3;
-
- /* first see if property already exists */
- prop = XIFetchDeviceProperty (dev, property);
- if (!prop) /* just add to list */
- {
- prop = XICreateDeviceProperty (property);
- if (!prop)
- return BadAlloc;
- add = TRUE;
- mode = PropModeReplace;
- }
- prop_value = &prop->value;
-
- /* To append or prepend to a property the request format and type
- must match those of the already defined property. The
- existing format and type are irrelevant when using the mode
- "PropModeReplace" since they will be written over. */
-
- if ((format != prop_value->format) && (mode != PropModeReplace))
- return BadMatch;
- if ((prop_value->type != type) && (mode != PropModeReplace))
- return BadMatch;
- new_value = *prop_value;
- if (mode == PropModeReplace)
- total_len = len;
- else
- total_len = prop_value->size + len;
-
- if (mode == PropModeReplace || len > 0)
- {
- pointer new_data = NULL, old_data = NULL;
-
- total_size = total_len * size_in_bytes;
- new_value.data = (pointer)malloc(total_size);
- if (!new_value.data && total_size)
- {
- if (add)
- XIDestroyDeviceProperty (prop);
- return BadAlloc;
- }
- new_value.size = len;
- new_value.type = type;
- new_value.format = format;
-
- switch (mode) {
- case PropModeReplace:
- new_data = new_value.data;
- old_data = NULL;
- break;
- case PropModeAppend:
- new_data = (pointer) (((char *) new_value.data) +
- (prop_value->size * size_in_bytes));
- old_data = new_value.data;
- break;
- case PropModePrepend:
- new_data = new_value.data;
- old_data = (pointer) (((char *) new_value.data) +
- (prop_value->size * size_in_bytes));
- break;
- }
- if (new_data)
- memcpy ((char *) new_data, (char *) value, len * size_in_bytes);
- if (old_data)
- memcpy ((char *) old_data, (char *) prop_value->data,
- prop_value->size * size_in_bytes);
-
- if (dev->properties.handlers)
- {
- XIPropertyHandlerPtr handler;
- BOOL checkonly = TRUE;
- /* run through all handlers with checkonly TRUE, then again with
- * checkonly FALSE. Handlers MUST return error codes on the
- * checkonly run, errors on the second run are ignored */
- do
- {
- handler = dev->properties.handlers;
- while(handler)
- {
- if (handler->SetProperty)
- {
- rc = handler->SetProperty(dev, prop->propertyName,
- &new_value, checkonly);
- if (checkonly && rc != Success)
- {
- free(new_value.data);
- return rc;
- }
- }
- handler = handler->next;
- }
- checkonly = !checkonly;
- } while (!checkonly);
- }
- free(prop_value->data);
- *prop_value = new_value;
- } else if (len == 0)
- {
- /* do nothing */
- }
-
- if (add)
- {
- prop->next = dev->properties.properties;
- dev->properties.properties = prop;
- }
-
- if (sendevent)
- send_property_event(dev, prop->propertyName,
- (add) ? XIPropertyCreated : XIPropertyModified);
-
- return Success;
-}
-
-int
-XIGetDeviceProperty (DeviceIntPtr dev, Atom property, XIPropertyValuePtr *value)
-{
- XIPropertyPtr prop = XIFetchDeviceProperty (dev, property);
- int rc;
-
- if (!prop)
- {
- *value = NULL;
- return BadAtom;
- }
-
- /* If we can, try to update the property value first */
- if (dev->properties.handlers)
- {
- XIPropertyHandlerPtr handler = dev->properties.handlers;
- while(handler)
- {
- if (handler->GetProperty)
- {
- rc = handler->GetProperty(dev, prop->propertyName);
- if (rc != Success)
- {
- *value = NULL;
- return rc;
- }
- }
- handler = handler->next;
- }
- }
-
- *value = &prop->value;
- return Success;
-}
-
-int
-XISetDevicePropertyDeletable(DeviceIntPtr dev, Atom property, Bool deletable)
-{
- XIPropertyPtr prop = XIFetchDeviceProperty(dev, property);
-
- if (!prop)
- return BadAtom;
-
- prop->deletable = deletable;
- return Success;
-}
-
-int
-ProcXListDeviceProperties (ClientPtr client)
-{
- Atom *atoms;
- xListDevicePropertiesReply rep;
- int natoms;
- DeviceIntPtr dev;
- int rc = Success;
-
- REQUEST(xListDevicePropertiesReq);
- REQUEST_SIZE_MATCH(xListDevicePropertiesReq);
-
- rc = dixLookupDevice (&dev, stuff->deviceid, client, DixListPropAccess);
- if (rc != Success)
- return rc;
-
- rc = list_atoms(dev, &natoms, &atoms);
- if (rc != Success)
- return rc;
-
- rep.repType = X_Reply;
- rep.RepType = X_ListDeviceProperties;
- rep.length = natoms;
- rep.sequenceNumber = client->sequence;
- rep.nAtoms = natoms;
-
- WriteReplyToClient(client, sizeof(xListDevicePropertiesReply), &rep);
- if (natoms)
- {
- client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
- WriteSwappedDataToClient(client, natoms * sizeof(Atom), atoms);
- free(atoms);
- }
- return rc;
-}
-
-int
-ProcXChangeDeviceProperty (ClientPtr client)
-{
- REQUEST(xChangeDevicePropertyReq);
- DeviceIntPtr dev;
- unsigned long len;
- int totalSize;
- int rc;
-
- REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
- UpdateCurrentTime();
-
- rc = dixLookupDevice (&dev, stuff->deviceid, client, DixSetPropAccess);
- if (rc != Success)
- return rc;
-
- rc = check_change_property(client, stuff->property, stuff->type,
- stuff->format, stuff->mode, stuff->nUnits);
-
- len = stuff->nUnits;
- if (len > (bytes_to_int32(0xffffffff - sizeof(xChangeDevicePropertyReq))))
- return BadLength;
-
- totalSize = len * (stuff->format/8);
- REQUEST_FIXED_SIZE(xChangeDevicePropertyReq, totalSize);
-
- rc = change_property(client, dev, stuff->property, stuff->type,
- stuff->format, stuff->mode, len, (void*)&stuff[1]);
- return rc;
-}
-
-int
-ProcXDeleteDeviceProperty (ClientPtr client)
-{
- REQUEST(xDeleteDevicePropertyReq);
- DeviceIntPtr dev;
- int rc;
-
- REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
- UpdateCurrentTime();
- rc = dixLookupDevice (&dev, stuff->deviceid, client, DixSetPropAccess);
- if (rc != Success)
- return rc;
-
- if (!ValidAtom(stuff->property))
- {
- client->errorValue = stuff->property;
- return BadAtom;
- }
-
- rc = XIDeleteDeviceProperty(dev, stuff->property, TRUE);
- return rc;
-}
-
-int
-ProcXGetDeviceProperty (ClientPtr client)
-{
- REQUEST(xGetDevicePropertyReq);
- DeviceIntPtr dev;
- int length;
- int rc, format, nitems, bytes_after;
- char *data;
- Atom type;
- xGetDevicePropertyReply reply;
-
- REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
- if (stuff->delete)
- UpdateCurrentTime();
- rc = dixLookupDevice (&dev, stuff->deviceid, client,
- stuff->delete ? DixSetPropAccess :
- DixGetPropAccess);
- if (rc != Success)
- return rc;
-
- rc = get_property(client, dev, stuff->property, stuff->type,
- stuff->delete, stuff->longOffset, stuff->longLength,
- &bytes_after, &type, &format, &nitems, &length, &data);
-
- if (rc != Success)
- return rc;
-
- reply.repType = X_Reply;
- reply.RepType = X_GetDeviceProperty;
- reply.sequenceNumber = client->sequence;
- reply.deviceid = dev->id;
- reply.nItems = nitems;
- reply.format = format;
- reply.bytesAfter = bytes_after;
- reply.propertyType = type;
- reply.length = bytes_to_int32(length);
-
- if (stuff->delete && (reply.bytesAfter == 0))
- send_property_event(dev, stuff->property, XIPropertyDeleted);
-
- WriteReplyToClient(client, sizeof(xGenericReply), &reply);
-
- if (length)
- {
- switch (reply.format) {
- case 32: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; break;
- case 16: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write; break;
- default: client->pSwapReplyFunc = (ReplySwapPtr)WriteToClient; break;
- }
- WriteSwappedDataToClient(client, length, data);
- }
-
- /* delete the Property */
- if (stuff->delete && (reply.bytesAfter == 0))
- {
- XIPropertyPtr prop, *prev;
- for (prev = &dev->properties.properties; (prop = *prev); prev = &prop->next)
- {
- if (prop->propertyName == stuff->property)
- {
- *prev = prop->next;
- XIDestroyDeviceProperty(prop);
- break;
- }
- }
- }
- return Success;
-}
-
-
-int
-SProcXListDeviceProperties (ClientPtr client)
-{
- char n;
- REQUEST(xListDevicePropertiesReq);
-
- swaps(&stuff->length, n);
-
- REQUEST_SIZE_MATCH(xListDevicePropertiesReq);
- return (ProcXListDeviceProperties(client));
-}
-
-int
-SProcXChangeDeviceProperty (ClientPtr client)
-{
- char n;
- REQUEST(xChangeDevicePropertyReq);
-
- REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
- swaps(&stuff->length, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->nUnits, n);
- return (ProcXChangeDeviceProperty(client));
-}
-
-int
-SProcXDeleteDeviceProperty (ClientPtr client)
-{
- char n;
- REQUEST(xDeleteDevicePropertyReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->property, n);
- REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
- return (ProcXDeleteDeviceProperty(client));
-}
-
-int
-SProcXGetDeviceProperty (ClientPtr client)
-{
- char n;
- REQUEST(xGetDevicePropertyReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->longOffset, n);
- swapl(&stuff->longLength, n);
- REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
- return (ProcXGetDeviceProperty(client));
-}
-
-
-/* Reply swapping */
-
-void
-SRepXListDeviceProperties(ClientPtr client, int size,
- xListDevicePropertiesReply *rep)
-{
- char n;
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->nAtoms, n);
- /* properties will be swapped later, see ProcXListDeviceProperties */
- WriteToClient(client, size, (char*)rep);
-}
-
-void
-SRepXGetDeviceProperty(ClientPtr client, int size,
- xGetDevicePropertyReply *rep)
-{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->propertyType, n);
- swapl(&rep->bytesAfter, n);
- swapl(&rep->nItems, n);
- /* data will be swapped, see ProcXGetDeviceProperty */
- WriteToClient(client, size, (char*)rep);
-}
-
-/* XI2 Request/reply handling */
-int
-ProcXIListProperties(ClientPtr client)
-{
- Atom *atoms;
- xXIListPropertiesReply rep;
- int natoms;
- DeviceIntPtr dev;
- int rc = Success;
-
- REQUEST(xXIListPropertiesReq);
- REQUEST_SIZE_MATCH(xXIListPropertiesReq);
-
- rc = dixLookupDevice (&dev, stuff->deviceid, client, DixListPropAccess);
- if (rc != Success)
- return rc;
-
- rc = list_atoms(dev, &natoms, &atoms);
- if (rc != Success)
- return rc;
-
- rep.repType = X_Reply;
- rep.RepType = X_XIListProperties;
- rep.length = natoms;
- rep.sequenceNumber = client->sequence;
- rep.num_properties = natoms;
-
- WriteReplyToClient(client, sizeof(xXIListPropertiesReply), &rep);
- if (natoms)
- {
- client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
- WriteSwappedDataToClient(client, natoms * sizeof(Atom), atoms);
- free(atoms);
- }
- return rc;
-}
-
-int
-ProcXIChangeProperty(ClientPtr client)
-{
- int rc;
- DeviceIntPtr dev;
- int totalSize;
- unsigned long len;
-
- REQUEST(xXIChangePropertyReq);
- REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
- UpdateCurrentTime();
-
- rc = dixLookupDevice (&dev, stuff->deviceid, client, DixSetPropAccess);
- if (rc != Success)
- return rc;
-
- rc = check_change_property(client, stuff->property, stuff->type,
- stuff->format, stuff->mode, stuff->num_items);
- len = stuff->num_items;
- if (len > bytes_to_int32(0xffffffff - sizeof(xXIChangePropertyReq)))
- return BadLength;
-
- totalSize = len * (stuff->format/8);
- REQUEST_FIXED_SIZE(xXIChangePropertyReq, totalSize);
-
- rc = change_property(client, dev, stuff->property, stuff->type,
- stuff->format, stuff->mode, len, (void*)&stuff[1]);
- return rc;
-}
-
-int
-ProcXIDeleteProperty(ClientPtr client)
-{
- DeviceIntPtr dev;
- int rc;
- REQUEST(xXIDeletePropertyReq);
-
- REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
- UpdateCurrentTime();
- rc = dixLookupDevice (&dev, stuff->deviceid, client, DixSetPropAccess);
- if (rc != Success)
- return rc;
-
- if (!ValidAtom(stuff->property))
- {
- client->errorValue = stuff->property;
- return BadAtom;
- }
-
- rc = XIDeleteDeviceProperty(dev, stuff->property, TRUE);
- return rc;
-}
-
-
-int
-ProcXIGetProperty(ClientPtr client)
-{
- REQUEST(xXIGetPropertyReq);
- DeviceIntPtr dev;
- xXIGetPropertyReply reply;
- int length;
- int rc, format, nitems, bytes_after;
- char *data;
- Atom type;
-
- REQUEST_SIZE_MATCH(xXIGetPropertyReq);
- if (stuff->delete)
- UpdateCurrentTime();
- rc = dixLookupDevice (&dev, stuff->deviceid, client,
- stuff->delete ? DixSetPropAccess :
- DixGetPropAccess);
- if (rc != Success)
- return rc;
-
- rc = get_property(client, dev, stuff->property, stuff->type,
- stuff->delete, stuff->offset, stuff->len,
- &bytes_after, &type, &format, &nitems, &length, &data);
-
- if (rc != Success)
- return rc;
-
- reply.repType = X_Reply;
- reply.RepType = X_XIGetProperty;
- reply.sequenceNumber = client->sequence;
- reply.num_items = nitems;
- reply.format = format;
- reply.bytes_after = bytes_after;
- reply.type = type;
- reply.length = bytes_to_int32(length);
-
- if (length && stuff->delete && (reply.bytes_after == 0))
- send_property_event(dev, stuff->property, XIPropertyDeleted);
-
- WriteReplyToClient(client, sizeof(xXIGetPropertyReply), &reply);
-
- if (length)
- {
- switch (reply.format) {
- case 32: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; break;
- case 16: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write; break;
- default: client->pSwapReplyFunc = (ReplySwapPtr)WriteToClient; break;
- }
- WriteSwappedDataToClient(client, length, data);
- }
-
- /* delete the Property */
- if (stuff->delete && (reply.bytes_after == 0))
- {
- XIPropertyPtr prop, *prev;
- for (prev = &dev->properties.properties; (prop = *prev); prev = &prop->next)
- {
- if (prop->propertyName == stuff->property)
- {
- *prev = prop->next;
- XIDestroyDeviceProperty(prop);
- break;
- }
- }
- }
-
- return Success;
-}
-
-int
-SProcXIListProperties(ClientPtr client)
-{
- char n;
- REQUEST(xXIListPropertiesReq);
-
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
-
- REQUEST_SIZE_MATCH(xXIListPropertiesReq);
- return (ProcXIListProperties(client));
-}
-
-int
-SProcXIChangeProperty(ClientPtr client)
-{
- char n;
- REQUEST(xXIChangePropertyReq);
-
- REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->num_items, n);
- return (ProcXIChangeProperty(client));
-}
-
-int
-SProcXIDeleteProperty(ClientPtr client)
-{
- char n;
- REQUEST(xXIDeletePropertyReq);
-
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->property, n);
- REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
- return (ProcXIDeleteProperty(client));
-}
-
-int
-SProcXIGetProperty(ClientPtr client)
-{
- char n;
- REQUEST(xXIGetPropertyReq);
-
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->offset, n);
- swapl(&stuff->len, n);
- REQUEST_SIZE_MATCH(xXIGetPropertyReq);
- return (ProcXIGetProperty(client));
-}
-
-
-void
-SRepXIListProperties(ClientPtr client, int size,
- xXIListPropertiesReply *rep)
-{
- char n;
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_properties, n);
- /* properties will be swapped later, see ProcXIListProperties */
- WriteToClient(client, size, (char*)rep);
-}
-
-void
-SRepXIGetProperty(ClientPtr client, int size,
- xXIGetPropertyReply *rep)
-{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->type, n);
- swapl(&rep->bytes_after, n);
- swapl(&rep->num_items, n);
- /* data will be swapped, see ProcXIGetProperty */
- WriteToClient(client, size, (char*)rep);
-}
+/*
+ * Copyright © 2006 Keith Packard
+ * Copyright © 2008 Peter Hutterer
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WAXIANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WAXIANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/* This code is a modified version of randr/rrproperty.c */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "dix.h"
+#include "inputstr.h"
+#include <X11/extensions/XI.h>
+#include <X11/Xatom.h>
+#include <X11/extensions/XIproto.h>
+#include <X11/extensions/XI2proto.h>
+#include "exglobals.h"
+#include "exevents.h"
+#include "swaprep.h"
+
+#include "xiproperty.h"
+#include "xserver-properties.h"
+
+/**
+ * Properties used or alloced from inside the server.
+ */
+static struct dev_properties
+{
+ Atom type;
+ char *name;
+} dev_properties[] = {
+ {0, XI_PROP_ENABLED},
+ {0, XI_PROP_XTEST_DEVICE},
+ {0, XATOM_FLOAT},
+ {0, ACCEL_PROP_PROFILE_NUMBER},
+ {0, ACCEL_PROP_CONSTANT_DECELERATION},
+ {0, ACCEL_PROP_ADAPTIVE_DECELERATION},
+ {0, ACCEL_PROP_VELOCITY_SCALING},
+ {0, AXIS_LABEL_PROP},
+ {0, AXIS_LABEL_PROP_REL_X},
+ {0, AXIS_LABEL_PROP_REL_Y},
+ {0, AXIS_LABEL_PROP_REL_Z},
+ {0, AXIS_LABEL_PROP_REL_RX},
+ {0, AXIS_LABEL_PROP_REL_RY},
+ {0, AXIS_LABEL_PROP_REL_RZ},
+ {0, AXIS_LABEL_PROP_REL_HWHEEL},
+ {0, AXIS_LABEL_PROP_REL_DIAL},
+ {0, AXIS_LABEL_PROP_REL_WHEEL},
+ {0, AXIS_LABEL_PROP_REL_MISC},
+ {0, AXIS_LABEL_PROP_ABS_X},
+ {0, AXIS_LABEL_PROP_ABS_Y},
+ {0, AXIS_LABEL_PROP_ABS_Z},
+ {0, AXIS_LABEL_PROP_ABS_RX},
+ {0, AXIS_LABEL_PROP_ABS_RY},
+ {0, AXIS_LABEL_PROP_ABS_RZ},
+ {0, AXIS_LABEL_PROP_ABS_THROTTLE},
+ {0, AXIS_LABEL_PROP_ABS_RUDDER},
+ {0, AXIS_LABEL_PROP_ABS_WHEEL},
+ {0, AXIS_LABEL_PROP_ABS_GAS},
+ {0, AXIS_LABEL_PROP_ABS_BRAKE},
+ {0, AXIS_LABEL_PROP_ABS_HAT0X},
+ {0, AXIS_LABEL_PROP_ABS_HAT0Y},
+ {0, AXIS_LABEL_PROP_ABS_HAT1X},
+ {0, AXIS_LABEL_PROP_ABS_HAT1Y},
+ {0, AXIS_LABEL_PROP_ABS_HAT2X},
+ {0, AXIS_LABEL_PROP_ABS_HAT2Y},
+ {0, AXIS_LABEL_PROP_ABS_HAT3X},
+ {0, AXIS_LABEL_PROP_ABS_HAT3Y},
+ {0, AXIS_LABEL_PROP_ABS_PRESSURE},
+ {0, AXIS_LABEL_PROP_ABS_DISTANCE},
+ {0, AXIS_LABEL_PROP_ABS_TILT_X},
+ {0, AXIS_LABEL_PROP_ABS_TILT_Y},
+ {0, AXIS_LABEL_PROP_ABS_TOOL_WIDTH},
+ {0, AXIS_LABEL_PROP_ABS_VOLUME},
+ {0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MAJOR},
+ {0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MINOR},
+ {0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MAJOR},
+ {0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MINOR},
+ {0, AXIS_LABEL_PROP_ABS_MT_ORIENTATION},
+ {0, AXIS_LABEL_PROP_ABS_MT_POSITION_X},
+ {0, AXIS_LABEL_PROP_ABS_MT_POSITION_Y},
+ {0, AXIS_LABEL_PROP_ABS_MT_TOOL_TYPE},
+ {0, AXIS_LABEL_PROP_ABS_MT_BLOB_ID},
+ {0, AXIS_LABEL_PROP_ABS_MT_TRACKING_ID},
+ {0, AXIS_LABEL_PROP_ABS_MT_PRESSURE},
+ {0, AXIS_LABEL_PROP_ABS_MISC},
+
+ {0, BTN_LABEL_PROP},
+ {0, BTN_LABEL_PROP_BTN_UNKNOWN},
+ {0, BTN_LABEL_PROP_BTN_WHEEL_UP},
+ {0, BTN_LABEL_PROP_BTN_WHEEL_DOWN},
+ {0, BTN_LABEL_PROP_BTN_HWHEEL_LEFT},
+ {0, BTN_LABEL_PROP_BTN_HWHEEL_RIGHT},
+ {0, BTN_LABEL_PROP_BTN_0},
+ {0, BTN_LABEL_PROP_BTN_1},
+ {0, BTN_LABEL_PROP_BTN_2},
+ {0, BTN_LABEL_PROP_BTN_3},
+ {0, BTN_LABEL_PROP_BTN_4},
+ {0, BTN_LABEL_PROP_BTN_5},
+ {0, BTN_LABEL_PROP_BTN_6},
+ {0, BTN_LABEL_PROP_BTN_7},
+ {0, BTN_LABEL_PROP_BTN_8},
+ {0, BTN_LABEL_PROP_BTN_9},
+
+ {0, BTN_LABEL_PROP_BTN_LEFT},
+ {0, BTN_LABEL_PROP_BTN_RIGHT},
+ {0, BTN_LABEL_PROP_BTN_MIDDLE},
+ {0, BTN_LABEL_PROP_BTN_SIDE},
+ {0, BTN_LABEL_PROP_BTN_EXTRA},
+ {0, BTN_LABEL_PROP_BTN_FORWARD},
+ {0, BTN_LABEL_PROP_BTN_BACK},
+ {0, BTN_LABEL_PROP_BTN_TASK},
+
+ {0, BTN_LABEL_PROP_BTN_TRIGGER},
+ {0, BTN_LABEL_PROP_BTN_THUMB},
+ {0, BTN_LABEL_PROP_BTN_THUMB2},
+ {0, BTN_LABEL_PROP_BTN_TOP},
+ {0, BTN_LABEL_PROP_BTN_TOP2},
+ {0, BTN_LABEL_PROP_BTN_PINKIE},
+ {0, BTN_LABEL_PROP_BTN_BASE},
+ {0, BTN_LABEL_PROP_BTN_BASE2},
+ {0, BTN_LABEL_PROP_BTN_BASE3},
+ {0, BTN_LABEL_PROP_BTN_BASE4},
+ {0, BTN_LABEL_PROP_BTN_BASE5},
+ {0, BTN_LABEL_PROP_BTN_BASE6},
+ {0, BTN_LABEL_PROP_BTN_DEAD},
+
+ {0, BTN_LABEL_PROP_BTN_A},
+ {0, BTN_LABEL_PROP_BTN_B},
+ {0, BTN_LABEL_PROP_BTN_C},
+ {0, BTN_LABEL_PROP_BTN_X},
+ {0, BTN_LABEL_PROP_BTN_Y},
+ {0, BTN_LABEL_PROP_BTN_Z},
+ {0, BTN_LABEL_PROP_BTN_TL},
+ {0, BTN_LABEL_PROP_BTN_TR},
+ {0, BTN_LABEL_PROP_BTN_TL2},
+ {0, BTN_LABEL_PROP_BTN_TR2},
+ {0, BTN_LABEL_PROP_BTN_SELECT},
+ {0, BTN_LABEL_PROP_BTN_START},
+ {0, BTN_LABEL_PROP_BTN_MODE},
+ {0, BTN_LABEL_PROP_BTN_THUMBL},
+ {0, BTN_LABEL_PROP_BTN_THUMBR},
+
+ {0, BTN_LABEL_PROP_BTN_TOOL_PEN},
+ {0, BTN_LABEL_PROP_BTN_TOOL_RUBBER},
+ {0, BTN_LABEL_PROP_BTN_TOOL_BRUSH},
+ {0, BTN_LABEL_PROP_BTN_TOOL_PENCIL},
+ {0, BTN_LABEL_PROP_BTN_TOOL_AIRBRUSH},
+ {0, BTN_LABEL_PROP_BTN_TOOL_FINGER},
+ {0, BTN_LABEL_PROP_BTN_TOOL_MOUSE},
+ {0, BTN_LABEL_PROP_BTN_TOOL_LENS},
+ {0, BTN_LABEL_PROP_BTN_TOUCH},
+ {0, BTN_LABEL_PROP_BTN_STYLUS},
+ {0, BTN_LABEL_PROP_BTN_STYLUS2},
+ {0, BTN_LABEL_PROP_BTN_TOOL_DOUBLETAP},
+ {0, BTN_LABEL_PROP_BTN_TOOL_TRIPLETAP},
+
+ {0, BTN_LABEL_PROP_BTN_GEAR_DOWN},
+ {0, BTN_LABEL_PROP_BTN_GEAR_UP},
+
+ {0, XI_PROP_TRANSFORM}
+};
+
+static long XIPropHandlerID = 1;
+
+static void send_property_event(DeviceIntPtr dev, Atom property, int what)
+{
+ devicePropertyNotify event;
+ xXIPropertyEvent xi2;
+ int state;
+
+ if (what == XIPropertyDeleted)
+ state = PropertyDelete;
+ else
+ state = PropertyNewValue;
+
+ event.type = DevicePropertyNotify;
+ event.deviceid = dev->id;
+ event.state = state;
+ event.atom = property;
+ event.time = currentTime.milliseconds;
+ SendEventToAllWindows(dev, DevicePropertyNotifyMask,
+ (xEvent*)&event, 1);
+
+ xi2.type = GenericEvent;
+ xi2.extension = IReqCode;
+ xi2.length = 0;
+ xi2.evtype = XI_PropertyEvent;
+ xi2.deviceid = dev->id;
+ xi2.time = currentTime.milliseconds;
+ xi2.property = property;
+ xi2.what = what;
+ SendEventToAllWindows(dev, GetEventFilter(dev, (xEvent*)&xi2),
+ (xEvent*)&xi2, 1);
+}
+
+static int list_atoms(DeviceIntPtr dev, int *natoms, Atom **atoms_return)
+{
+ XIPropertyPtr prop;
+ Atom *atoms = NULL;
+ int nprops = 0;
+
+ for (prop = dev->properties.properties; prop; prop = prop->next)
+ nprops++;
+ if (nprops)
+ {
+ Atom *a;
+
+ atoms = malloc(nprops * sizeof(Atom));
+ if(!atoms)
+ return BadAlloc;
+ a = atoms;
+ for (prop = dev->properties.properties; prop; prop = prop->next, a++)
+ *a = prop->propertyName;
+ }
+
+ *natoms = nprops;
+ *atoms_return = atoms;
+ return Success;
+}
+
+static int
+get_property(ClientPtr client, DeviceIntPtr dev, Atom property, Atom type,
+ BOOL delete, int offset, int length,
+ int *bytes_after, Atom *type_return, int *format, int *nitems,
+ int *length_return, char **data)
+{
+ unsigned long n, len, ind;
+ int rc;
+ XIPropertyPtr prop;
+ XIPropertyValuePtr prop_value;
+
+ if (!ValidAtom(property))
+ {
+ client->errorValue = property;
+ return BadAtom;
+ }
+ if ((delete != xTrue) && (delete != xFalse))
+ {
+ client->errorValue = delete;
+ return BadValue;
+ }
+
+ if ((type != AnyPropertyType) && !ValidAtom(type))
+ {
+ client->errorValue = type;
+ return BadAtom;
+ }
+
+ for (prop = dev->properties.properties; prop; prop = prop->next)
+ if (prop->propertyName == property)
+ break;
+
+ if (!prop)
+ {
+ *bytes_after = 0;
+ *type_return = None;
+ *format = 0;
+ *nitems = 0;
+ *length_return = 0;
+ return Success;
+ }
+
+ rc = XIGetDeviceProperty(dev, property, &prop_value);
+ if (rc != Success)
+ {
+ client->errorValue = property;
+ return rc;
+ }
+
+ /* If the request type and actual type don't match. Return the
+ property information, but not the data. */
+
+ if (((type != prop_value->type) && (type != AnyPropertyType)))
+ {
+ *bytes_after = prop_value->size;
+ *format = prop_value->format;
+ *length_return = 0;
+ *nitems = 0;
+ *type_return = prop_value->type;
+ return Success;
+ }
+
+ /* Return type, format, value to client */
+ n = (prop_value->format/8) * prop_value->size; /* size (bytes) of prop */
+ ind = offset << 2;
+
+ /* If offset is invalid such that it causes "len" to
+ be negative, it's a value error. */
+
+ if (n < ind)
+ {
+ client->errorValue = offset;
+ return BadValue;
+ }
+
+ len = min(n - ind, 4 * length);
+
+ *bytes_after = n - (ind + len);
+ *format = prop_value->format;
+ *length_return = len;
+ if (prop_value->format)
+ *nitems = len / (prop_value->format / 8);
+ else
+ *nitems = 0;
+ *type_return = prop_value->type;
+
+ *data = (char*)prop_value->data + ind;
+
+ return Success;
+}
+
+static int
+check_change_property(ClientPtr client, Atom property, Atom type, int format,
+ int mode, int nitems)
+{
+ if ((mode != PropModeReplace) && (mode != PropModeAppend) &&
+ (mode != PropModePrepend))
+ {
+ client->errorValue = mode;
+ return BadValue;
+ }
+ if ((format != 8) && (format != 16) && (format != 32))
+ {
+ client->errorValue = format;
+ return BadValue;
+ }
+
+ if (!ValidAtom(property))
+ {
+ client->errorValue = property;
+ return BadAtom;
+ }
+ if (!ValidAtom(type))
+ {
+ client->errorValue = type;
+ return BadAtom;
+ }
+
+ return Success;
+}
+
+static int
+change_property(ClientPtr client, DeviceIntPtr dev, Atom property, Atom type,
+ int format, int mode, int len, void *data)
+{
+ int rc = Success;
+
+ rc = XIChangeDeviceProperty(dev, property, type, format, mode, len, data, TRUE);
+ if (rc != Success)
+ client->errorValue = property;
+
+ return rc;
+}
+
+/**
+ * Return the atom assigned to the specified string or 0 if the atom isn't known
+ * to the DIX.
+ *
+ * If name is NULL, None is returned.
+ */
+Atom
+XIGetKnownProperty(char *name)
+{
+ int i;
+
+ if (!name)
+ return None;
+
+ for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++)
+ {
+ if (strcmp(name, dev_properties[i].name) == 0){
+ if (dev_properties[i].type == None){
+ dev_properties[i].type =
+ MakeAtom(dev_properties[i].name,
+ strlen(dev_properties[i].name),
+ TRUE);
+ }
+
+ return dev_properties[i].type;
+ }
+ }
+
+ return 0;
+}
+
+void
+XIResetProperties(void)
+{
+ int i;
+
+ for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++)
+ dev_properties[i].type = None;
+}
+
+/**
+ * Convert the given property's value(s) into @nelem_return integer values and
+ * store them in @buf_return. If @nelem_return is larger than the number of
+ * values in the property, @nelem_return is set to the number of values in the
+ * property.
+ *
+ * If *@buf_return is NULL and @nelem_return is 0, memory is allocated
+ * automatically and must be freed by the caller.
+ *
+ * Possible return codes.
+ * Success ... No error.
+ * BadMatch ... Wrong atom type, atom is not XA_INTEGER
+ * BadAlloc ... NULL passed as buffer and allocation failed.
+ * BadLength ... @buff is NULL but @nelem_return is non-zero.
+ *
+ * @param val The property value
+ * @param nelem_return The maximum number of elements to return.
+ * @param buf_return Pointer to an array of at least @nelem_return values.
+ * @return Success or the error code if an error occured.
+ */
+_X_EXPORT int
+XIPropToInt(XIPropertyValuePtr val, int *nelem_return, int **buf_return)
+{
+ int i;
+ int *buf;
+
+ if (val->type != XA_INTEGER)
+ return BadMatch;
+ if (!*buf_return && *nelem_return)
+ return BadLength;
+
+ switch(val->format)
+ {
+ case 8:
+ case 16:
+ case 32:
+ break;
+ default:
+ return BadValue;
+ }
+
+ buf = *buf_return;
+
+ if (!buf && !(*nelem_return))
+ {
+ buf = calloc(val->size, sizeof(int));
+ if (!buf)
+ return BadAlloc;
+ *buf_return = buf;
+ *nelem_return = val->size;
+ } else if (val->size < *nelem_return)
+ *nelem_return = val->size;
+
+ for (i = 0; i < val->size && i < *nelem_return; i++)
+ {
+ switch(val->format)
+ {
+ case 8: buf[i] = ((CARD8*)val->data)[i]; break;
+ case 16: buf[i] = ((CARD16*)val->data)[i]; break;
+ case 32: buf[i] = ((CARD32*)val->data)[i]; break;
+ }
+ }
+
+ return Success;
+}
+
+/**
+ * Convert the given property's value(s) into @nelem_return float values and
+ * store them in @buf_return. If @nelem_return is larger than the number of
+ * values in the property, @nelem_return is set to the number of values in the
+ * property.
+ *
+ * If *@buf_return is NULL and @nelem_return is 0, memory is allocated
+ * automatically and must be freed by the caller.
+ *
+ * Possible errors returned:
+ * Success
+ * BadMatch ... Wrong atom type, atom is not XA_FLOAT
+ * BadValue ... Wrong format, format is not 32
+ * BadAlloc ... NULL passed as buffer and allocation failed.
+ * BadLength ... @buff is NULL but @nelem_return is non-zero.
+ *
+ * @param val The property value
+ * @param nelem_return The maximum number of elements to return.
+ * @param buf_return Pointer to an array of at least @nelem_return values.
+ * @return Success or the error code if an error occured.
+ */
+_X_EXPORT int
+XIPropToFloat(XIPropertyValuePtr val, int *nelem_return, float **buf_return)
+{
+ int i;
+ float *buf;
+
+ if (!val->type || val->type != XIGetKnownProperty(XATOM_FLOAT))
+ return BadMatch;
+
+ if (val->format != 32)
+ return BadValue;
+ if (!*buf_return && *nelem_return)
+ return BadLength;
+
+ buf = *buf_return;
+
+ if (!buf && !(*nelem_return))
+ {
+ buf = calloc(val->size, sizeof(float));
+ if (!buf)
+ return BadAlloc;
+ *buf_return = buf;
+ *nelem_return = val->size;
+ } else if (val->size < *nelem_return)
+ *nelem_return = val->size;
+
+ for (i = 0; i < val->size && i < *nelem_return; i++)
+ buf[i] = ((float*)val->data)[i];
+
+ return Success;
+}
+
+/* Registers a new property handler on the given device and returns a unique
+ * identifier for this handler. This identifier is required to unregister the
+ * property handler again.
+ * @return The handler's identifier or 0 if an error occured.
+ */
+long
+XIRegisterPropertyHandler(DeviceIntPtr dev,
+ int (*SetProperty) (DeviceIntPtr dev,
+ Atom property,
+ XIPropertyValuePtr prop,
+ BOOL checkonly),
+ int (*GetProperty) (DeviceIntPtr dev,
+ Atom property),
+ int (*DeleteProperty) (DeviceIntPtr dev,
+ Atom property))
+{
+ XIPropertyHandlerPtr new_handler;
+
+ new_handler = calloc(1, sizeof(XIPropertyHandler));
+ if (!new_handler)
+ return 0;
+
+ new_handler->id = XIPropHandlerID++;
+ new_handler->SetProperty = SetProperty;
+ new_handler->GetProperty = GetProperty;
+ new_handler->DeleteProperty = DeleteProperty;
+ new_handler->next = dev->properties.handlers;
+ dev->properties.handlers = new_handler;
+
+ return new_handler->id;
+}
+
+void
+XIUnregisterPropertyHandler(DeviceIntPtr dev, long id)
+{
+ XIPropertyHandlerPtr curr, prev = NULL;
+
+ curr = dev->properties.handlers;
+ while(curr && curr->id != id)
+ {
+ prev = curr;
+ curr = curr->next;
+ }
+
+ if (!curr)
+ return;
+
+ if (!prev) /* first one */
+ dev->properties.handlers = curr->next;
+ else
+ prev->next = curr->next;
+
+ free(curr);
+}
+
+static XIPropertyPtr
+XICreateDeviceProperty (Atom property)
+{
+ XIPropertyPtr prop;
+
+ prop = (XIPropertyPtr)malloc(sizeof(XIPropertyRec));
+ if (!prop)
+ return NULL;
+
+ prop->next = NULL;
+ prop->propertyName = property;
+ prop->value.type = None;
+ prop->value.format = 0;
+ prop->value.size = 0;
+ prop->value.data = NULL;
+ prop->deletable = TRUE;
+
+ return prop;
+}
+
+static XIPropertyPtr
+XIFetchDeviceProperty(DeviceIntPtr dev, Atom property)
+{
+ XIPropertyPtr prop;
+
+ for (prop = dev->properties.properties; prop; prop = prop->next)
+ if (prop->propertyName == property)
+ return prop;
+ return NULL;
+}
+
+static void
+XIDestroyDeviceProperty (XIPropertyPtr prop)
+{
+ free(prop->value.data);
+ free(prop);
+}
+
+/* This function destroys all of the device's property-related stuff,
+ * including removing all device handlers.
+ * DO NOT CALL FROM THE DRIVER.
+ */
+void
+XIDeleteAllDeviceProperties (DeviceIntPtr device)
+{
+ XIPropertyPtr prop, next;
+ XIPropertyHandlerPtr curr_handler, next_handler;
+
+ for (prop = device->properties.properties; prop; prop = next)
+ {
+ next = prop->next;
+ send_property_event(device, prop->propertyName, XIPropertyDeleted);
+ XIDestroyDeviceProperty(prop);
+ }
+
+ device->properties.properties = NULL;
+
+ /* Now free all handlers */
+ curr_handler = device->properties.handlers;
+ while(curr_handler)
+ {
+ next_handler = curr_handler->next;
+ free(curr_handler);
+ curr_handler = next_handler;
+ }
+
+ device->properties.handlers = NULL;
+}
+
+
+int
+XIDeleteDeviceProperty (DeviceIntPtr device, Atom property, Bool fromClient)
+{
+ XIPropertyPtr prop, *prev;
+ int rc = Success;
+
+ for (prev = &device->properties.properties; (prop = *prev); prev = &(prop->next))
+ if (prop->propertyName == property)
+ break;
+
+ if (!prop)
+ return Success;
+
+ if (fromClient && !prop->deletable)
+ return BadAccess;
+
+ /* Ask handlers if we may delete the property */
+ if (device->properties.handlers)
+ {
+ XIPropertyHandlerPtr handler = device->properties.handlers;
+ while(handler)
+ {
+ if (handler->DeleteProperty)
+ rc = handler->DeleteProperty(device, prop->propertyName);
+ if (rc != Success)
+ return rc;
+ handler = handler->next;
+ }
+ }
+
+ if (prop)
+ {
+ *prev = prop->next;
+ send_property_event(device, prop->propertyName, XIPropertyDeleted);
+ XIDestroyDeviceProperty (prop);
+ }
+
+ return Success;
+}
+
+int
+XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type,
+ int format, int mode, unsigned long len,
+ const pointer value, Bool sendevent)
+{
+ XIPropertyPtr prop;
+ int size_in_bytes;
+ int total_size;
+ unsigned long total_len;
+ XIPropertyValuePtr prop_value;
+ XIPropertyValueRec new_value;
+ Bool add = FALSE;
+ int rc;
+
+ size_in_bytes = format >> 3;
+
+ /* first see if property already exists */
+ prop = XIFetchDeviceProperty (dev, property);
+ if (!prop) /* just add to list */
+ {
+ prop = XICreateDeviceProperty (property);
+ if (!prop)
+ return BadAlloc;
+ add = TRUE;
+ mode = PropModeReplace;
+ }
+ prop_value = &prop->value;
+
+ /* To append or prepend to a property the request format and type
+ must match those of the already defined property. The
+ existing format and type are irrelevant when using the mode
+ "PropModeReplace" since they will be written over. */
+
+ if ((format != prop_value->format) && (mode != PropModeReplace))
+ return BadMatch;
+ if ((prop_value->type != type) && (mode != PropModeReplace))
+ return BadMatch;
+ new_value = *prop_value;
+ if (mode == PropModeReplace)
+ total_len = len;
+ else
+ total_len = prop_value->size + len;
+
+ if (mode == PropModeReplace || len > 0)
+ {
+ pointer new_data = NULL, old_data = NULL;
+
+ total_size = total_len * size_in_bytes;
+ new_value.data = (pointer)malloc(total_size);
+ if (!new_value.data && total_size)
+ {
+ if (add)
+ XIDestroyDeviceProperty (prop);
+ return BadAlloc;
+ }
+ new_value.size = len;
+ new_value.type = type;
+ new_value.format = format;
+
+ switch (mode) {
+ case PropModeReplace:
+ new_data = new_value.data;
+ old_data = NULL;
+ break;
+ case PropModeAppend:
+ new_data = (pointer) (((char *) new_value.data) +
+ (prop_value->size * size_in_bytes));
+ old_data = new_value.data;
+ break;
+ case PropModePrepend:
+ new_data = new_value.data;
+ old_data = (pointer) (((char *) new_value.data) +
+ (prop_value->size * size_in_bytes));
+ break;
+ }
+ if (new_data)
+ memcpy ((char *) new_data, (char *) value, len * size_in_bytes);
+ if (old_data)
+ memcpy ((char *) old_data, (char *) prop_value->data,
+ prop_value->size * size_in_bytes);
+
+ if (dev->properties.handlers)
+ {
+ XIPropertyHandlerPtr handler;
+ BOOL checkonly = TRUE;
+ /* run through all handlers with checkonly TRUE, then again with
+ * checkonly FALSE. Handlers MUST return error codes on the
+ * checkonly run, errors on the second run are ignored */
+ do
+ {
+ handler = dev->properties.handlers;
+ while(handler)
+ {
+ if (handler->SetProperty)
+ {
+ rc = handler->SetProperty(dev, prop->propertyName,
+ &new_value, checkonly);
+ if (checkonly && rc != Success)
+ {
+ free(new_value.data);
+ return rc;
+ }
+ }
+ handler = handler->next;
+ }
+ checkonly = !checkonly;
+ } while (!checkonly);
+ }
+ free(prop_value->data);
+ *prop_value = new_value;
+ } else if (len == 0)
+ {
+ /* do nothing */
+ }
+
+ if (add)
+ {
+ prop->next = dev->properties.properties;
+ dev->properties.properties = prop;
+ }
+
+ if (sendevent)
+ send_property_event(dev, prop->propertyName,
+ (add) ? XIPropertyCreated : XIPropertyModified);
+
+ return Success;
+}
+
+int
+XIGetDeviceProperty (DeviceIntPtr dev, Atom property, XIPropertyValuePtr *value)
+{
+ XIPropertyPtr prop = XIFetchDeviceProperty (dev, property);
+ int rc;
+
+ if (!prop)
+ {
+ *value = NULL;
+ return BadAtom;
+ }
+
+ /* If we can, try to update the property value first */
+ if (dev->properties.handlers)
+ {
+ XIPropertyHandlerPtr handler = dev->properties.handlers;
+ while(handler)
+ {
+ if (handler->GetProperty)
+ {
+ rc = handler->GetProperty(dev, prop->propertyName);
+ if (rc != Success)
+ {
+ *value = NULL;
+ return rc;
+ }
+ }
+ handler = handler->next;
+ }
+ }
+
+ *value = &prop->value;
+ return Success;
+}
+
+int
+XISetDevicePropertyDeletable(DeviceIntPtr dev, Atom property, Bool deletable)
+{
+ XIPropertyPtr prop = XIFetchDeviceProperty(dev, property);
+
+ if (!prop)
+ return BadAtom;
+
+ prop->deletable = deletable;
+ return Success;
+}
+
+int
+ProcXListDeviceProperties (ClientPtr client)
+{
+ Atom *atoms;
+ xListDevicePropertiesReply rep;
+ int natoms;
+ DeviceIntPtr dev;
+ int rc = Success;
+
+ REQUEST(xListDevicePropertiesReq);
+ REQUEST_SIZE_MATCH(xListDevicePropertiesReq);
+
+ rc = dixLookupDevice (&dev, stuff->deviceid, client, DixListPropAccess);
+ if (rc != Success)
+ return rc;
+
+ rc = list_atoms(dev, &natoms, &atoms);
+ if (rc != Success)
+ return rc;
+
+ rep.repType = X_Reply;
+ rep.RepType = X_ListDeviceProperties;
+ rep.length = natoms;
+ rep.sequenceNumber = client->sequence;
+ rep.nAtoms = natoms;
+
+ WriteReplyToClient(client, sizeof(xListDevicePropertiesReply), &rep);
+ if (natoms)
+ {
+ client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
+ WriteSwappedDataToClient(client, natoms * sizeof(Atom), atoms);
+ free(atoms);
+ }
+ return rc;
+}
+
+int
+ProcXChangeDeviceProperty (ClientPtr client)
+{
+ REQUEST(xChangeDevicePropertyReq);
+ DeviceIntPtr dev;
+ unsigned long len;
+ int totalSize;
+ int rc;
+
+ REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
+ UpdateCurrentTime();
+
+ rc = dixLookupDevice (&dev, stuff->deviceid, client, DixSetPropAccess);
+ if (rc != Success)
+ return rc;
+
+ rc = check_change_property(client, stuff->property, stuff->type,
+ stuff->format, stuff->mode, stuff->nUnits);
+
+ len = stuff->nUnits;
+ if (len > (bytes_to_int32(0xffffffff - sizeof(xChangeDevicePropertyReq))))
+ return BadLength;
+
+ totalSize = len * (stuff->format/8);
+ REQUEST_FIXED_SIZE(xChangeDevicePropertyReq, totalSize);
+
+ rc = change_property(client, dev, stuff->property, stuff->type,
+ stuff->format, stuff->mode, len, (void*)&stuff[1]);
+ return rc;
+}
+
+int
+ProcXDeleteDeviceProperty (ClientPtr client)
+{
+ REQUEST(xDeleteDevicePropertyReq);
+ DeviceIntPtr dev;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
+ UpdateCurrentTime();
+ rc = dixLookupDevice (&dev, stuff->deviceid, client, DixSetPropAccess);
+ if (rc != Success)
+ return rc;
+
+ if (!ValidAtom(stuff->property))
+ {
+ client->errorValue = stuff->property;
+ return BadAtom;
+ }
+
+ rc = XIDeleteDeviceProperty(dev, stuff->property, TRUE);
+ return rc;
+}
+
+int
+ProcXGetDeviceProperty (ClientPtr client)
+{
+ REQUEST(xGetDevicePropertyReq);
+ DeviceIntPtr dev;
+ int length;
+ int rc, format, nitems, bytes_after;
+ char *data;
+ Atom type;
+ xGetDevicePropertyReply reply;
+
+ REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
+ if (stuff->delete)
+ UpdateCurrentTime();
+ rc = dixLookupDevice (&dev, stuff->deviceid, client,
+ stuff->delete ? DixSetPropAccess :
+ DixGetPropAccess);
+ if (rc != Success)
+ return rc;
+
+ rc = get_property(client, dev, stuff->property, stuff->type,
+ stuff->delete, stuff->longOffset, stuff->longLength,
+ &bytes_after, &type, &format, &nitems, &length, &data);
+
+ if (rc != Success)
+ return rc;
+
+ reply.repType = X_Reply;
+ reply.RepType = X_GetDeviceProperty;
+ reply.sequenceNumber = client->sequence;
+ reply.deviceid = dev->id;
+ reply.nItems = nitems;
+ reply.format = format;
+ reply.bytesAfter = bytes_after;
+ reply.propertyType = type;
+ reply.length = bytes_to_int32(length);
+
+ if (stuff->delete && (reply.bytesAfter == 0))
+ send_property_event(dev, stuff->property, XIPropertyDeleted);
+
+ WriteReplyToClient(client, sizeof(xGenericReply), &reply);
+
+ if (length)
+ {
+ switch (reply.format) {
+ case 32: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; break;
+ case 16: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write; break;
+ default: client->pSwapReplyFunc = (ReplySwapPtr)WriteToClient; break;
+ }
+ WriteSwappedDataToClient(client, length, data);
+ }
+
+ /* delete the Property */
+ if (stuff->delete && (reply.bytesAfter == 0))
+ {
+ XIPropertyPtr prop, *prev;
+ for (prev = &dev->properties.properties; (prop = *prev); prev = &prop->next)
+ {
+ if (prop->propertyName == stuff->property)
+ {
+ *prev = prop->next;
+ XIDestroyDeviceProperty(prop);
+ break;
+ }
+ }
+ }
+ return Success;
+}
+
+
+int
+SProcXListDeviceProperties (ClientPtr client)
+{
+ REQUEST(xListDevicePropertiesReq);
+
+ swaps(&stuff->length);
+
+ REQUEST_SIZE_MATCH(xListDevicePropertiesReq);
+ return (ProcXListDeviceProperties(client));
+}
+
+int
+SProcXChangeDeviceProperty (ClientPtr client)
+{
+ REQUEST(xChangeDevicePropertyReq);
+
+ REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
+ swaps(&stuff->length);
+ swapl(&stuff->property);
+ swapl(&stuff->type);
+ swapl(&stuff->nUnits);
+ return (ProcXChangeDeviceProperty(client));
+}
+
+int
+SProcXDeleteDeviceProperty (ClientPtr client)
+{
+ REQUEST(xDeleteDevicePropertyReq);
+
+ swaps(&stuff->length);
+ swapl(&stuff->property);
+ REQUEST_SIZE_MATCH(xDeleteDevicePropertyReq);
+ return (ProcXDeleteDeviceProperty(client));
+}
+
+int
+SProcXGetDeviceProperty (ClientPtr client)
+{
+ REQUEST(xGetDevicePropertyReq);
+
+ swaps(&stuff->length);
+ swapl(&stuff->property);
+ swapl(&stuff->type);
+ swapl(&stuff->longOffset);
+ swapl(&stuff->longLength);
+ REQUEST_SIZE_MATCH(xGetDevicePropertyReq);
+ return (ProcXGetDeviceProperty(client));
+}
+
+
+/* Reply swapping */
+
+void
+SRepXListDeviceProperties(ClientPtr client, int size,
+ xListDevicePropertiesReply *rep)
+{
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->nAtoms);
+ /* properties will be swapped later, see ProcXListDeviceProperties */
+ WriteToClient(client, size, (char*)rep);
+}
+
+void
+SRepXGetDeviceProperty(ClientPtr client, int size,
+ xGetDevicePropertyReply *rep)
+{
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->propertyType);
+ swapl(&rep->bytesAfter);
+ swapl(&rep->nItems);
+ /* data will be swapped, see ProcXGetDeviceProperty */
+ WriteToClient(client, size, (char*)rep);
+}
+
+/* XI2 Request/reply handling */
+int
+ProcXIListProperties(ClientPtr client)
+{
+ Atom *atoms;
+ xXIListPropertiesReply rep;
+ int natoms;
+ DeviceIntPtr dev;
+ int rc = Success;
+
+ REQUEST(xXIListPropertiesReq);
+ REQUEST_SIZE_MATCH(xXIListPropertiesReq);
+
+ rc = dixLookupDevice (&dev, stuff->deviceid, client, DixListPropAccess);
+ if (rc != Success)
+ return rc;
+
+ rc = list_atoms(dev, &natoms, &atoms);
+ if (rc != Success)
+ return rc;
+
+ rep.repType = X_Reply;
+ rep.RepType = X_XIListProperties;
+ rep.length = natoms;
+ rep.sequenceNumber = client->sequence;
+ rep.num_properties = natoms;
+
+ WriteReplyToClient(client, sizeof(xXIListPropertiesReply), &rep);
+ if (natoms)
+ {
+ client->pSwapReplyFunc = (ReplySwapPtr)Swap32Write;
+ WriteSwappedDataToClient(client, natoms * sizeof(Atom), atoms);
+ free(atoms);
+ }
+ return rc;
+}
+
+int
+ProcXIChangeProperty(ClientPtr client)
+{
+ int rc;
+ DeviceIntPtr dev;
+ int totalSize;
+ unsigned long len;
+
+ REQUEST(xXIChangePropertyReq);
+ REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
+ UpdateCurrentTime();
+
+ rc = dixLookupDevice (&dev, stuff->deviceid, client, DixSetPropAccess);
+ if (rc != Success)
+ return rc;
+
+ rc = check_change_property(client, stuff->property, stuff->type,
+ stuff->format, stuff->mode, stuff->num_items);
+ len = stuff->num_items;
+ if (len > bytes_to_int32(0xffffffff - sizeof(xXIChangePropertyReq)))
+ return BadLength;
+
+ totalSize = len * (stuff->format/8);
+ REQUEST_FIXED_SIZE(xXIChangePropertyReq, totalSize);
+
+ rc = change_property(client, dev, stuff->property, stuff->type,
+ stuff->format, stuff->mode, len, (void*)&stuff[1]);
+ return rc;
+}
+
+int
+ProcXIDeleteProperty(ClientPtr client)
+{
+ DeviceIntPtr dev;
+ int rc;
+ REQUEST(xXIDeletePropertyReq);
+
+ REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
+ UpdateCurrentTime();
+ rc = dixLookupDevice (&dev, stuff->deviceid, client, DixSetPropAccess);
+ if (rc != Success)
+ return rc;
+
+ if (!ValidAtom(stuff->property))
+ {
+ client->errorValue = stuff->property;
+ return BadAtom;
+ }
+
+ rc = XIDeleteDeviceProperty(dev, stuff->property, TRUE);
+ return rc;
+}
+
+
+int
+ProcXIGetProperty(ClientPtr client)
+{
+ REQUEST(xXIGetPropertyReq);
+ DeviceIntPtr dev;
+ xXIGetPropertyReply reply;
+ int length;
+ int rc, format, nitems, bytes_after;
+ char *data;
+ Atom type;
+
+ REQUEST_SIZE_MATCH(xXIGetPropertyReq);
+ if (stuff->delete)
+ UpdateCurrentTime();
+ rc = dixLookupDevice (&dev, stuff->deviceid, client,
+ stuff->delete ? DixSetPropAccess :
+ DixGetPropAccess);
+ if (rc != Success)
+ return rc;
+
+ rc = get_property(client, dev, stuff->property, stuff->type,
+ stuff->delete, stuff->offset, stuff->len,
+ &bytes_after, &type, &format, &nitems, &length, &data);
+
+ if (rc != Success)
+ return rc;
+
+ reply.repType = X_Reply;
+ reply.RepType = X_XIGetProperty;
+ reply.sequenceNumber = client->sequence;
+ reply.num_items = nitems;
+ reply.format = format;
+ reply.bytes_after = bytes_after;
+ reply.type = type;
+ reply.length = bytes_to_int32(length);
+
+ if (length && stuff->delete && (reply.bytes_after == 0))
+ send_property_event(dev, stuff->property, XIPropertyDeleted);
+
+ WriteReplyToClient(client, sizeof(xXIGetPropertyReply), &reply);
+
+ if (length)
+ {
+ switch (reply.format) {
+ case 32: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap32Write; break;
+ case 16: client->pSwapReplyFunc = (ReplySwapPtr)CopySwap16Write; break;
+ default: client->pSwapReplyFunc = (ReplySwapPtr)WriteToClient; break;
+ }
+ WriteSwappedDataToClient(client, length, data);
+ }
+
+ /* delete the Property */
+ if (stuff->delete && (reply.bytes_after == 0))
+ {
+ XIPropertyPtr prop, *prev;
+ for (prev = &dev->properties.properties; (prop = *prev); prev = &prop->next)
+ {
+ if (prop->propertyName == stuff->property)
+ {
+ *prev = prop->next;
+ XIDestroyDeviceProperty(prop);
+ break;
+ }
+ }
+ }
+
+ return Success;
+}
+
+int
+SProcXIListProperties(ClientPtr client)
+{
+ REQUEST(xXIListPropertiesReq);
+
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+
+ REQUEST_SIZE_MATCH(xXIListPropertiesReq);
+ return (ProcXIListProperties(client));
+}
+
+int
+SProcXIChangeProperty(ClientPtr client)
+{
+ REQUEST(xXIChangePropertyReq);
+
+ REQUEST_AT_LEAST_SIZE(xXIChangePropertyReq);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->property);
+ swapl(&stuff->type);
+ swapl(&stuff->num_items);
+ return (ProcXIChangeProperty(client));
+}
+
+int
+SProcXIDeleteProperty(ClientPtr client)
+{
+ REQUEST(xXIDeletePropertyReq);
+
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->property);
+ REQUEST_SIZE_MATCH(xXIDeletePropertyReq);
+ return (ProcXIDeleteProperty(client));
+}
+
+int
+SProcXIGetProperty(ClientPtr client)
+{
+ REQUEST(xXIGetPropertyReq);
+
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->property);
+ swapl(&stuff->type);
+ swapl(&stuff->offset);
+ swapl(&stuff->len);
+ REQUEST_SIZE_MATCH(xXIGetPropertyReq);
+ return (ProcXIGetProperty(client));
+}
+
+
+void
+SRepXIListProperties(ClientPtr client, int size,
+ xXIListPropertiesReply *rep)
+{
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->num_properties);
+ /* properties will be swapped later, see ProcXIListProperties */
+ WriteToClient(client, size, (char*)rep);
+}
+
+void
+SRepXIGetProperty(ClientPtr client, int size,
+ xXIGetPropertyReply *rep)
+{
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->type);
+ swapl(&rep->bytes_after);
+ swapl(&rep->num_items);
+ /* data will be swapped, see ProcXIGetProperty */
+ WriteToClient(client, size, (char*)rep);
+}
diff --git a/xorg-server/Xi/xiquerydevice.c b/xorg-server/Xi/xiquerydevice.c
index a768d499c..902eb918c 100644
--- a/xorg-server/Xi/xiquerydevice.c
+++ b/xorg-server/Xi/xiquerydevice.c
@@ -52,12 +52,10 @@ static void SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info);
int
SProcXIQueryDevice(ClientPtr client)
{
- char n;
-
REQUEST(xXIQueryDeviceReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
return ProcXIQueryDevice(client);
}
@@ -166,11 +164,9 @@ ProcXIQueryDevice(ClientPtr client)
void
SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply *rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_devices, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->num_devices);
/* Device info is already swapped, see ProcXIQueryDevice */
@@ -278,17 +274,16 @@ ListButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info, Bool reportState)
static void
SwapButtonInfo(DeviceIntPtr dev, xXIButtonInfo* info)
{
- char n;
Atom *btn;
int i;
- swaps(&info->type, n);
- swaps(&info->length, n);
- swaps(&info->sourceid, n);
+ swaps(&info->type);
+ swaps(&info->length);
+ swaps(&info->sourceid);
for (i = 0, btn = (Atom*)&info[1]; i < info->num_buttons; i++, btn++)
- swaps(btn, n);
+ swapl(btn);
- swaps(&info->num_buttons, n);
+ swaps(&info->num_buttons);
}
/**
@@ -317,17 +312,16 @@ ListKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info)
static void
SwapKeyInfo(DeviceIntPtr dev, xXIKeyInfo* info)
{
- char n;
uint32_t *key;
int i;
- swaps(&info->type, n);
- swaps(&info->length, n);
- swaps(&info->sourceid, n);
+ swaps(&info->type);
+ swaps(&info->length);
+ swaps(&info->sourceid);
for (i = 0, key = (uint32_t*)&info[1]; i < info->num_keycodes; i++, key++)
- swapl(key, n);
+ swapl(key);
- swaps(&info->num_keycodes, n);
+ swaps(&info->num_keycodes);
}
/**
@@ -364,16 +358,15 @@ ListValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info, int axisnumber,
static void
SwapValuatorInfo(DeviceIntPtr dev, xXIValuatorInfo* info)
{
- char n;
- swaps(&info->type, n);
- swaps(&info->length, n);
- swapl(&info->label, n);
- swapl(&info->min.integral, n);
- swapl(&info->min.frac, n);
- swapl(&info->max.integral, n);
- swapl(&info->max.frac, n);
- swaps(&info->number, n);
- swaps(&info->sourceid, n);
+ swaps(&info->type);
+ swaps(&info->length);
+ swapl(&info->label);
+ swapl(&info->min.integral);
+ swapl(&info->min.frac);
+ swapl(&info->max.integral);
+ swapl(&info->max.frac);
+ swaps(&info->number);
+ swaps(&info->sourceid);
}
int GetDeviceUse(DeviceIntPtr dev, uint16_t *attachment)
@@ -471,7 +464,6 @@ ListDeviceClasses(ClientPtr client, DeviceIntPtr dev,
static void
SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info)
{
- char n;
char *any = (char*)&info[1];
int i;
@@ -497,10 +489,10 @@ SwapDeviceInfo(DeviceIntPtr dev, xXIDeviceInfo* info)
any += len * 4;
}
- swaps(&info->deviceid, n);
- swaps(&info->use, n);
- swaps(&info->attachment, n);
- swaps(&info->num_classes, n);
- swaps(&info->name_len, n);
+ swaps(&info->deviceid);
+ swaps(&info->use);
+ swaps(&info->attachment);
+ swaps(&info->num_classes);
+ swaps(&info->name_len);
}
diff --git a/xorg-server/Xi/xiquerypointer.c b/xorg-server/Xi/xiquerypointer.c
index 51317994b..9e05eff30 100644
--- a/xorg-server/Xi/xiquerypointer.c
+++ b/xorg-server/Xi/xiquerypointer.c
@@ -61,12 +61,10 @@
int
SProcXIQueryPointer(ClientPtr client)
{
- char n;
-
REQUEST(xXIQueryPointerReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->win, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->win);
return (ProcXIQueryPointer(client));
}
@@ -212,17 +210,15 @@ void
SRepXIQueryPointer(ClientPtr client, int size,
xXIQueryPointerReply * rep)
{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->root, n);
- swapl(&rep->child, n);
- swapl(&rep->root_x, n);
- swapl(&rep->root_y, n);
- swapl(&rep->win_x, n);
- swapl(&rep->win_y, n);
- swaps(&rep->buttons_len, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->root);
+ swapl(&rep->child);
+ swapl(&rep->root_x);
+ swapl(&rep->root_y);
+ swapl(&rep->win_x);
+ swapl(&rep->win_y);
+ swaps(&rep->buttons_len);
WriteToClient(client, size, (char *)rep);
}
diff --git a/xorg-server/Xi/xiqueryversion.c b/xorg-server/Xi/xiqueryversion.c
index f647f9872..a94061432 100644
--- a/xorg-server/Xi/xiqueryversion.c
+++ b/xorg-server/Xi/xiqueryversion.c
@@ -103,23 +103,20 @@ ProcXIQueryVersion(ClientPtr client)
int
SProcXIQueryVersion(ClientPtr client)
{
- char n;
-
REQUEST(xXIQueryVersionReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXIQueryVersionReq);
- swaps(&stuff->major_version, n);
- swaps(&stuff->minor_version, n);
+ swaps(&stuff->major_version);
+ swaps(&stuff->minor_version);
return (ProcXIQueryVersion(client));
}
void
SRepXIQueryVersion(ClientPtr client, int size, xXIQueryVersionReply *rep)
{
- char n;
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->major_version, n);
- swaps(&rep->minor_version, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->major_version);
+ swaps(&rep->minor_version);
WriteToClient(client, size, (char *)rep);
}
diff --git a/xorg-server/Xi/xiselectev.c b/xorg-server/Xi/xiselectev.c
index 6f26b3d08..3af4f1fb9 100644
--- a/xorg-server/Xi/xiselectev.c
+++ b/xorg-server/Xi/xiselectev.c
@@ -1,310 +1,304 @@
-/*
- * Copyright 2008 Red Hat, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Author: Peter Hutterer
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-
-#include "dixstruct.h"
-#include "windowstr.h"
-#include "exglobals.h"
-#include "exevents.h"
-#include <X11/extensions/XI2proto.h>
-
-#include "xiselectev.h"
-
-/**
- * Check the given mask (in len bytes) for invalid mask bits.
- * Invalid mask bits are any bits above XI2LastEvent.
- *
- * @return BadValue if at least one invalid bit is set or Success otherwise.
- */
-int XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len)
-{
- if (len >= XIMaskLen(XI2LASTEVENT))
- {
- int i;
- for (i = XI2LASTEVENT + 1; i < len * 8; i++)
- {
- if (BitIsOn(mask, i))
- {
- client->errorValue = i;
- return BadValue;
- }
- }
- }
-
- return Success;
-}
-
-int
-SProcXISelectEvents(ClientPtr client)
-{
- char n;
- int i;
- xXIEventMask* evmask;
-
- REQUEST(xXISelectEventsReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXISelectEventsReq);
- swapl(&stuff->win, n);
- swaps(&stuff->num_masks, n);
-
- evmask = (xXIEventMask*)&stuff[1];
- for (i = 0; i < stuff->num_masks; i++)
- {
- swaps(&evmask->deviceid, n);
- swaps(&evmask->mask_len, n);
- evmask = (xXIEventMask*)(((char*)&evmask[1]) + evmask->mask_len * 4);
- }
-
- return (ProcXISelectEvents(client));
-}
-
-int
-ProcXISelectEvents(ClientPtr client)
-{
- int rc, num_masks;
- WindowPtr win;
- DeviceIntPtr dev;
- DeviceIntRec dummy;
- xXIEventMask *evmask;
- int *types = NULL;
- int len;
-
- REQUEST(xXISelectEventsReq);
- REQUEST_AT_LEAST_SIZE(xXISelectEventsReq);
-
- if (stuff->num_masks == 0)
- return BadValue;
-
- rc = dixLookupWindow(&win, stuff->win, client, DixReceiveAccess);
- if (rc != Success)
- return rc;
-
- len = sz_xXISelectEventsReq;
-
- /* check request validity */
- evmask = (xXIEventMask*)&stuff[1];
- num_masks = stuff->num_masks;
- while(num_masks--)
- {
- len += sizeof(xXIEventMask) + evmask->mask_len * 4;
-
- if (bytes_to_int32(len) > stuff->length)
- return BadLength;
-
- if (evmask->deviceid != XIAllDevices &&
- evmask->deviceid != XIAllMasterDevices)
- rc = dixLookupDevice(&dev, evmask->deviceid, client, DixUseAccess);
- else {
- /* XXX: XACE here? */
- }
- if (rc != Success)
- return rc;
-
- /* hierarchy event mask is not allowed on devices */
- if (evmask->deviceid != XIAllDevices && evmask->mask_len >= 1)
- {
- unsigned char *bits = (unsigned char*)&evmask[1];
- if (BitIsOn(bits, XI_HierarchyChanged))
- {
- client->errorValue = XI_HierarchyChanged;
- return BadValue;
- }
- }
-
- /* Raw events may only be selected on root windows */
- if (win->parent && evmask->mask_len >= 1)
- {
- unsigned char *bits = (unsigned char*)&evmask[1];
- if (BitIsOn(bits, XI_RawKeyPress) ||
- BitIsOn(bits, XI_RawKeyRelease) ||
- BitIsOn(bits, XI_RawButtonPress) ||
- BitIsOn(bits, XI_RawButtonRelease) ||
- BitIsOn(bits, XI_RawMotion))
- {
- client->errorValue = XI_RawKeyPress;
- return BadValue;
- }
- }
-
- if (XICheckInvalidMaskBits(client, (unsigned char*)&evmask[1],
- evmask->mask_len * 4) != Success)
- return BadValue;
-
- evmask = (xXIEventMask*)(((unsigned char*)evmask) + evmask->mask_len * 4);
- evmask++;
- }
-
- if (bytes_to_int32(len) != stuff->length)
- return BadLength;
-
- /* Set masks on window */
- evmask = (xXIEventMask*)&stuff[1];
- num_masks = stuff->num_masks;
- while(num_masks--)
- {
- if (evmask->deviceid == XIAllDevices ||
- evmask->deviceid == XIAllMasterDevices)
- {
- dummy.id = evmask->deviceid;
- dev = &dummy;
- } else
- dixLookupDevice(&dev, evmask->deviceid, client, DixUseAccess);
- if (XISetEventMask(dev, win, client, evmask->mask_len * 4,
- (unsigned char*)&evmask[1]) != Success)
- return BadAlloc;
- evmask = (xXIEventMask*)(((unsigned char*)evmask) + evmask->mask_len * 4);
- evmask++;
- }
-
- RecalculateDeliverableEvents(win);
-
- free(types);
- return Success;
-}
-
-
-int
-SProcXIGetSelectedEvents(ClientPtr client)
-{
- char n;
-
- REQUEST(xXIGetSelectedEventsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq);
- swapl(&stuff->win, n);
-
- return (ProcXIGetSelectedEvents(client));
-}
-
-int
-ProcXIGetSelectedEvents(ClientPtr client)
-{
- int rc, i;
- WindowPtr win;
- char n;
- char *buffer = NULL;
- xXIGetSelectedEventsReply reply;
- OtherInputMasks *masks;
- InputClientsPtr others = NULL;
- xXIEventMask *evmask = NULL;
- DeviceIntPtr dev;
-
- REQUEST(xXIGetSelectedEventsReq);
- REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq);
-
- rc = dixLookupWindow(&win, stuff->win, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
- reply.repType = X_Reply;
- reply.RepType = X_XIGetSelectedEvents;
- reply.length = 0;
- reply.sequenceNumber = client->sequence;
- reply.num_masks = 0;
-
- masks = wOtherInputMasks(win);
- if (masks)
- {
- for (others = wOtherInputMasks(win)->inputClients; others;
- others = others->next) {
- if (SameClient(others, client)) {
- break;
- }
- }
- }
-
- if (!others)
- {
- WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &reply);
- return Success;
- }
-
- buffer = calloc(MAXDEVICES, sizeof(xXIEventMask) + pad_to_int32(XI2MASKSIZE));
- if (!buffer)
- return BadAlloc;
-
- evmask = (xXIEventMask*)buffer;
- for (i = 0; i < MAXDEVICES; i++)
- {
- int j;
- unsigned char *devmask = others->xi2mask[i];
-
- if (i > 2)
- {
- rc = dixLookupDevice(&dev, i, client, DixGetAttrAccess);
- if (rc != Success)
- continue;
- }
-
-
- for (j = XI2MASKSIZE - 1; j >= 0; j--)
- {
- if (devmask[j] != 0)
- {
- int mask_len = (j + 4)/4; /* j is an index, hence + 4, not + 3 */
- evmask->deviceid = i;
- evmask->mask_len = mask_len;
- reply.num_masks++;
- reply.length += sizeof(xXIEventMask)/4 + evmask->mask_len;
-
- if (client->swapped)
- {
- swaps(&evmask->deviceid, n);
- swaps(&evmask->mask_len, n);
- }
-
- memcpy(&evmask[1], devmask, j + 1);
- evmask = (xXIEventMask*)((char*)evmask +
- sizeof(xXIEventMask) + mask_len * 4);
- break;
- }
- }
- }
-
- WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &reply);
-
- if (reply.num_masks)
- WriteToClient(client, reply.length * 4, buffer);
-
- free(buffer);
- return Success;
-}
-
-void SRepXIGetSelectedEvents(ClientPtr client,
- int len, xXIGetSelectedEventsReply *rep)
-{
- char n;
-
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_masks, n);
- WriteToClient(client, len, (char *)rep);
-}
-
-
+/*
+ * Copyright 2008 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Peter Hutterer
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+
+#include "dixstruct.h"
+#include "windowstr.h"
+#include "exglobals.h"
+#include "exevents.h"
+#include <X11/extensions/XI2proto.h>
+
+#include "xiselectev.h"
+
+/**
+ * Check the given mask (in len bytes) for invalid mask bits.
+ * Invalid mask bits are any bits above XI2LastEvent.
+ *
+ * @return BadValue if at least one invalid bit is set or Success otherwise.
+ */
+int XICheckInvalidMaskBits(ClientPtr client, unsigned char *mask, int len)
+{
+ if (len >= XIMaskLen(XI2LASTEVENT))
+ {
+ int i;
+ for (i = XI2LASTEVENT + 1; i < len * 8; i++)
+ {
+ if (BitIsOn(mask, i))
+ {
+ client->errorValue = i;
+ return BadValue;
+ }
+ }
+ }
+
+ return Success;
+}
+
+int
+SProcXISelectEvents(ClientPtr client)
+{
+ int i;
+ xXIEventMask* evmask;
+
+ REQUEST(xXISelectEventsReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xXISelectEventsReq);
+ swapl(&stuff->win);
+ swaps(&stuff->num_masks);
+
+ evmask = (xXIEventMask*)&stuff[1];
+ for (i = 0; i < stuff->num_masks; i++)
+ {
+ swaps(&evmask->deviceid);
+ swaps(&evmask->mask_len);
+ evmask = (xXIEventMask*)(((char*)&evmask[1]) + evmask->mask_len * 4);
+ }
+
+ return (ProcXISelectEvents(client));
+}
+
+int
+ProcXISelectEvents(ClientPtr client)
+{
+ int rc, num_masks;
+ WindowPtr win;
+ DeviceIntPtr dev;
+ DeviceIntRec dummy;
+ xXIEventMask *evmask;
+ int *types = NULL;
+ int len;
+
+ REQUEST(xXISelectEventsReq);
+ REQUEST_AT_LEAST_SIZE(xXISelectEventsReq);
+
+ if (stuff->num_masks == 0)
+ return BadValue;
+
+ rc = dixLookupWindow(&win, stuff->win, client, DixReceiveAccess);
+ if (rc != Success)
+ return rc;
+
+ len = sz_xXISelectEventsReq;
+
+ /* check request validity */
+ evmask = (xXIEventMask*)&stuff[1];
+ num_masks = stuff->num_masks;
+ while(num_masks--)
+ {
+ len += sizeof(xXIEventMask) + evmask->mask_len * 4;
+
+ if (bytes_to_int32(len) > stuff->length)
+ return BadLength;
+
+ if (evmask->deviceid != XIAllDevices &&
+ evmask->deviceid != XIAllMasterDevices)
+ rc = dixLookupDevice(&dev, evmask->deviceid, client, DixUseAccess);
+ else {
+ /* XXX: XACE here? */
+ }
+ if (rc != Success)
+ return rc;
+
+ /* hierarchy event mask is not allowed on devices */
+ if (evmask->deviceid != XIAllDevices && evmask->mask_len >= 1)
+ {
+ unsigned char *bits = (unsigned char*)&evmask[1];
+ if (BitIsOn(bits, XI_HierarchyChanged))
+ {
+ client->errorValue = XI_HierarchyChanged;
+ return BadValue;
+ }
+ }
+
+ /* Raw events may only be selected on root windows */
+ if (win->parent && evmask->mask_len >= 1)
+ {
+ unsigned char *bits = (unsigned char*)&evmask[1];
+ if (BitIsOn(bits, XI_RawKeyPress) ||
+ BitIsOn(bits, XI_RawKeyRelease) ||
+ BitIsOn(bits, XI_RawButtonPress) ||
+ BitIsOn(bits, XI_RawButtonRelease) ||
+ BitIsOn(bits, XI_RawMotion))
+ {
+ client->errorValue = XI_RawKeyPress;
+ return BadValue;
+ }
+ }
+
+ if (XICheckInvalidMaskBits(client, (unsigned char*)&evmask[1],
+ evmask->mask_len * 4) != Success)
+ return BadValue;
+
+ evmask = (xXIEventMask*)(((unsigned char*)evmask) + evmask->mask_len * 4);
+ evmask++;
+ }
+
+ if (bytes_to_int32(len) != stuff->length)
+ return BadLength;
+
+ /* Set masks on window */
+ evmask = (xXIEventMask*)&stuff[1];
+ num_masks = stuff->num_masks;
+ while(num_masks--)
+ {
+ if (evmask->deviceid == XIAllDevices ||
+ evmask->deviceid == XIAllMasterDevices)
+ {
+ dummy.id = evmask->deviceid;
+ dev = &dummy;
+ } else
+ dixLookupDevice(&dev, evmask->deviceid, client, DixUseAccess);
+ if (XISetEventMask(dev, win, client, evmask->mask_len * 4,
+ (unsigned char*)&evmask[1]) != Success)
+ return BadAlloc;
+ evmask = (xXIEventMask*)(((unsigned char*)evmask) + evmask->mask_len * 4);
+ evmask++;
+ }
+
+ RecalculateDeliverableEvents(win);
+
+ free(types);
+ return Success;
+}
+
+
+int
+SProcXIGetSelectedEvents(ClientPtr client)
+{
+ REQUEST(xXIGetSelectedEventsReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq);
+ swapl(&stuff->win);
+
+ return (ProcXIGetSelectedEvents(client));
+}
+
+int
+ProcXIGetSelectedEvents(ClientPtr client)
+{
+ int rc, i;
+ WindowPtr win;
+ char *buffer = NULL;
+ xXIGetSelectedEventsReply reply;
+ OtherInputMasks *masks;
+ InputClientsPtr others = NULL;
+ xXIEventMask *evmask = NULL;
+ DeviceIntPtr dev;
+
+ REQUEST(xXIGetSelectedEventsReq);
+ REQUEST_SIZE_MATCH(xXIGetSelectedEventsReq);
+
+ rc = dixLookupWindow(&win, stuff->win, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ reply.repType = X_Reply;
+ reply.RepType = X_XIGetSelectedEvents;
+ reply.length = 0;
+ reply.sequenceNumber = client->sequence;
+ reply.num_masks = 0;
+
+ masks = wOtherInputMasks(win);
+ if (masks)
+ {
+ for (others = wOtherInputMasks(win)->inputClients; others;
+ others = others->next) {
+ if (SameClient(others, client)) {
+ break;
+ }
+ }
+ }
+
+ if (!others)
+ {
+ WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &reply);
+ return Success;
+ }
+
+ buffer = calloc(MAXDEVICES, sizeof(xXIEventMask) + pad_to_int32(XI2MASKSIZE));
+ if (!buffer)
+ return BadAlloc;
+
+ evmask = (xXIEventMask*)buffer;
+ for (i = 0; i < MAXDEVICES; i++)
+ {
+ int j;
+ unsigned char *devmask = others->xi2mask[i];
+
+ if (i > 2)
+ {
+ rc = dixLookupDevice(&dev, i, client, DixGetAttrAccess);
+ if (rc != Success)
+ continue;
+ }
+
+
+ for (j = XI2MASKSIZE - 1; j >= 0; j--)
+ {
+ if (devmask[j] != 0)
+ {
+ int mask_len = (j + 4)/4; /* j is an index, hence + 4, not + 3 */
+ evmask->deviceid = i;
+ evmask->mask_len = mask_len;
+ reply.num_masks++;
+ reply.length += sizeof(xXIEventMask)/4 + evmask->mask_len;
+
+ if (client->swapped)
+ {
+ swaps(&evmask->deviceid);
+ swaps(&evmask->mask_len);
+ }
+
+ memcpy(&evmask[1], devmask, j + 1);
+ evmask = (xXIEventMask*)((char*)evmask +
+ sizeof(xXIEventMask) + mask_len * 4);
+ break;
+ }
+ }
+ }
+
+ WriteReplyToClient(client, sizeof(xXIGetSelectedEventsReply), &reply);
+
+ if (reply.num_masks)
+ WriteToClient(client, reply.length * 4, buffer);
+
+ free(buffer);
+ return Success;
+}
+
+void SRepXIGetSelectedEvents(ClientPtr client,
+ int len, xXIGetSelectedEventsReply *rep)
+{
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->num_masks);
+ WriteToClient(client, len, (char *)rep);
+}
+
+
diff --git a/xorg-server/Xi/xisetclientpointer.c b/xorg-server/Xi/xisetclientpointer.c
index 09db8ff75..934747d30 100644
--- a/xorg-server/Xi/xisetclientpointer.c
+++ b/xorg-server/Xi/xisetclientpointer.c
@@ -51,12 +51,10 @@
int
SProcXISetClientPointer(ClientPtr client)
{
- char n;
-
REQUEST(xXISetClientPointerReq);
- swaps(&stuff->length, n);
- swapl(&stuff->win, n);
- swaps(&stuff->deviceid, n);
+ swaps(&stuff->length);
+ swapl(&stuff->win);
+ swaps(&stuff->deviceid);
REQUEST_SIZE_MATCH(xXISetClientPointerReq);
return (ProcXISetClientPointer(client));
}
diff --git a/xorg-server/Xi/xisetdevfocus.c b/xorg-server/Xi/xisetdevfocus.c
index 059424e41..294df7c32 100644
--- a/xorg-server/Xi/xisetdevfocus.c
+++ b/xorg-server/Xi/xisetdevfocus.c
@@ -43,13 +43,11 @@
int
SProcXISetFocus(ClientPtr client)
{
- char n;
-
REQUEST(xXISetFocusReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
- swapl(&stuff->focus, n);
- swapl(&stuff->time, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
+ swapl(&stuff->focus);
+ swapl(&stuff->time);
return ProcXISetFocus(client);
}
@@ -57,11 +55,9 @@ SProcXISetFocus(ClientPtr client)
int
SProcXIGetFocus(ClientPtr client)
{
- char n;
-
REQUEST(xXIGetFocusReq);
- swaps(&stuff->length, n);
- swaps(&stuff->deviceid, n);
+ swaps(&stuff->length);
+ swaps(&stuff->deviceid);
return ProcXIGetFocus(client);
}
@@ -122,9 +118,8 @@ ProcXIGetFocus(ClientPtr client)
void
SRepXIGetFocus(ClientPtr client, int len, xXIGetFocusReply *rep)
{
- char n;
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swapl(&rep->focus, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->focus);
WriteToClient(client, len, (char *)rep);
}
diff --git a/xorg-server/Xi/xiwarppointer.c b/xorg-server/Xi/xiwarppointer.c
index a463ab94d..8fcb4d16b 100644
--- a/xorg-server/Xi/xiwarppointer.c
+++ b/xorg-server/Xi/xiwarppointer.c
@@ -56,19 +56,17 @@
int
SProcXIWarpPointer(ClientPtr client)
{
- char n;
-
REQUEST(xXIWarpPointerReq);
- swaps(&stuff->length, n);
- swapl(&stuff->src_win, n);
- swapl(&stuff->dst_win, n);
- swapl(&stuff->src_x, n);
- swapl(&stuff->src_y, n);
- swaps(&stuff->src_width, n);
- swaps(&stuff->src_height, n);
- swapl(&stuff->dst_x, n);
- swapl(&stuff->dst_y, n);
- swaps(&stuff->deviceid, n);
+ swaps(&stuff->length);
+ swapl(&stuff->src_win);
+ swapl(&stuff->dst_win);
+ swapl(&stuff->src_x);
+ swapl(&stuff->src_y);
+ swaps(&stuff->src_width);
+ swaps(&stuff->src_height);
+ swapl(&stuff->dst_x);
+ swapl(&stuff->dst_y);
+ swaps(&stuff->deviceid);
return (ProcXIWarpPointer(client));
}
diff --git a/xorg-server/composite/compext.c b/xorg-server/composite/compext.c
index e0d8e75e4..722587a43 100644
--- a/xorg-server/composite/compext.c
+++ b/xorg-server/composite/compext.c
@@ -109,7 +109,6 @@ ProcCompositeQueryVersion (ClientPtr client)
{
CompositeClientPtr pCompositeClient = GetCompositeClient (client);
xCompositeQueryVersionReply rep;
- register int n;
REQUEST(xCompositeQueryVersionReq);
REQUEST_SIZE_MATCH(xCompositeQueryVersionReq);
@@ -126,10 +125,10 @@ ProcCompositeQueryVersion (ClientPtr client)
pCompositeClient->major_version = rep.majorVersion;
pCompositeClient->minor_version = rep.minorVersion;
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.majorVersion, n);
- swapl(&rep.minorVersion, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.majorVersion);
+ swapl(&rep.minorVersion);
}
WriteToClient(client, sizeof(xCompositeQueryVersionReply), (char *)&rep);
return Success;
@@ -315,10 +314,9 @@ ProcCompositeGetOverlayWindow (ClientPtr client)
if (client->swapped)
{
- int n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.overlayWin, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.overlayWin);
}
(void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep);
@@ -377,111 +375,102 @@ ProcCompositeDispatch (ClientPtr client)
static int
SProcCompositeQueryVersion (ClientPtr client)
{
- int n;
REQUEST(xCompositeQueryVersionReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeQueryVersionReq);
- swapl(&stuff->majorVersion, n);
- swapl(&stuff->minorVersion, n);
+ swapl(&stuff->majorVersion);
+ swapl(&stuff->minorVersion);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
static int
SProcCompositeRedirectWindow (ClientPtr client)
{
- int n;
REQUEST(xCompositeRedirectWindowReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeRedirectWindowReq);
- swapl (&stuff->window, n);
+ swapl(&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
static int
SProcCompositeRedirectSubwindows (ClientPtr client)
{
- int n;
REQUEST(xCompositeRedirectSubwindowsReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeRedirectSubwindowsReq);
- swapl (&stuff->window, n);
+ swapl(&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
static int
SProcCompositeUnredirectWindow (ClientPtr client)
{
- int n;
REQUEST(xCompositeUnredirectWindowReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeUnredirectWindowReq);
- swapl (&stuff->window, n);
+ swapl(&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
static int
SProcCompositeUnredirectSubwindows (ClientPtr client)
{
- int n;
REQUEST(xCompositeUnredirectSubwindowsReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeUnredirectSubwindowsReq);
- swapl (&stuff->window, n);
+ swapl(&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
static int
SProcCompositeCreateRegionFromBorderClip (ClientPtr client)
{
- int n;
REQUEST(xCompositeCreateRegionFromBorderClipReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeCreateRegionFromBorderClipReq);
- swapl (&stuff->region, n);
- swapl (&stuff->window, n);
+ swapl(&stuff->region);
+ swapl(&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
static int
SProcCompositeNameWindowPixmap (ClientPtr client)
{
- int n;
REQUEST(xCompositeNameWindowPixmapReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeNameWindowPixmapReq);
- swapl (&stuff->window, n);
- swapl (&stuff->pixmap, n);
+ swapl(&stuff->window);
+ swapl(&stuff->pixmap);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
static int
SProcCompositeGetOverlayWindow (ClientPtr client)
{
- int n;
REQUEST(xCompositeGetOverlayWindowReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq);
- swapl(&stuff->window, n);
+ swapl(&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
static int
SProcCompositeReleaseOverlayWindow (ClientPtr client)
{
- int n;
REQUEST(xCompositeReleaseOverlayWindowReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq);
- swapl(&stuff->window, n);
+ swapl(&stuff->window);
return (*ProcCompositeVector[stuff->compositeReqType]) (client);
}
@@ -839,10 +828,9 @@ PanoramiXCompositeGetOverlayWindow (ClientPtr client)
if (client->swapped)
{
- int n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.overlayWin, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.overlayWin);
}
(void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep);
diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac
index 2ac1f2ec6..b0d26435a 100644
--- a/xorg-server/configure.ac
+++ b/xorg-server/configure.ac
@@ -582,9 +582,6 @@ AC_ARG_ENABLE(install-libxf86config,
AC_ARG_ENABLE(visibility, AC_HELP_STRING([--enable-visibility], [Enable symbol visibility (default: auto)]),
[SYMBOL_VISIBILITY=$enableval],
[SYMBOL_VISIBILITY=auto])
-AC_ARG_ENABLE(pc98, AC_HELP_STRING([--enable-pc98], [Enable PC98 support in Xorg (default: auto)]),
- [SUPPORT_PC98=$enableval],
- [SUPPORT_PC98=auto])
dnl GLX build options
AC_ARG_ENABLE(aiglx, AS_HELP_STRING([--enable-aiglx], [Build accelerated indirect GLX (default: enabled)]),
@@ -608,7 +605,7 @@ AC_ARG_WITH(khronos-spec-dir, AS_HELP_STRING([--with-khronos-spec-dir=PATH], [Pa
dnl Extensions.
AC_ARG_ENABLE(registry, AS_HELP_STRING([--disable-registry], [Build string registry module (default: enabled)]), [XREGISTRY=$enableval], [XREGISTRY=yes])
AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes])
-AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-shm], [Build SHM extension (default: enabled)]), [MITSHM=$enableval], [MITSHM=yes])
+AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-mitshm], [Build SHM extension (default: enabled)]), [MITSHM=$enableval], [MITSHM=yes])
AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes])
AC_ARG_ENABLE(record, AS_HELP_STRING([--disable-record], [Build Record extension (default: enabled)]), [RECORD=$enableval], [RECORD=yes])
AC_ARG_ENABLE(xv, AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes])
@@ -705,10 +702,6 @@ AM_CONDITIONAL(SECURE_RPC, [test "x$SECURE_RPC" = xyes])
AM_CONDITIONAL(INT10_VM86, [test "x$INT10" = xvm86])
AM_CONDITIONAL(INT10_X86EMU, [test "x$INT10" = xx86emu])
AM_CONDITIONAL(INT10_STUB, [test "x$INT10" = xstub])
-if test "x$INT10" = xyes; then
- dnl VM86 headers
- AC_CHECK_HEADERS([sys/vm86.h sys/io.h])
-fi
dnl Handle installing libxf86config
AM_CONDITIONAL(INSTALL_LIBXF86CONFIG, [test "x$INSTALL_LIBXF86CONFIG" = xyes])
@@ -1573,7 +1566,6 @@ if test "x$XORG" = xyes; then
if test "x$LNXAPM" = xyes; then
XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
fi
- XORG_OS="linux"
XORG_OS_SUBDIR="linux"
xorg_bus_linuxpci="yes"
linux_acpi="no"
@@ -1593,12 +1585,10 @@ if test "x$XORG" = xyes; then
esac
;;
freebsd* | kfreebsd*-gnu | dragonfly*)
- XORG_OS="freebsd"
XORG_OS_SUBDIR="bsd"
xorg_bus_bsdpci="yes"
;;
netbsd*)
- XORG_OS="netbsd"
XORG_OS_SUBDIR="bsd"
xorg_bus_bsdpci="yes"
;;
@@ -1607,12 +1597,10 @@ if test "x$XORG" = xyes; then
-o "x$ac_cv_BSD_KQUEUE_APM" = xyes; then
XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
fi
- XORG_OS="openbsd"
XORG_OS_SUBDIR="bsd"
xorg_bus_bsdpci="yes"
;;
solaris*)
- XORG_OS="solaris"
XORG_OS_SUBDIR="solaris"
XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
# Use the same stubs as BSD for old functions, since we now
@@ -1659,19 +1647,14 @@ if test "x$XORG" = xyes; then
XORG_CFLAGS="${XORG_CFLAGS} "'$(SOLARIS_ASM_CFLAGS)'
fi
AC_SUBST([SOLARIS_ASM_CFLAGS])
- if test "x$SUPPORT_PC98" = xauto; then
- SUPPORT_PC98="no"
- fi
;;
gnu*)
- XORG_OS="gnu"
XORG_OS_SUBDIR="hurd"
# Use the same stubs as BSD for old functions, since we now
# use libpciaccess for PCI
xorg_bus_bsdpci="yes"
;;
*)
- XORG_OS="unknown"
XORG_OS_SUBDIR="unknown"
AC_MSG_ERROR([m4_text_wrap(m4_join([ ],
[Your OS is unknown. Xorg currently only supports Linux,],
@@ -1686,21 +1669,9 @@ if test "x$XORG" = xyes; then
xorg_bus_sparc="yes"
;;
i*86)
- if test "x$SUPPORT_PC98" = xauto; then
- SUPPORT_PC98="yes"
- fi
;;
esac
- if test "x$SUPPORT_PC98" = xauto; then
- SUPPORT_PC98="no"
- fi
- if test "x$SUPPORT_PC98" = xyes; then
- AC_DEFINE(SUPPORT_PC98, 1, [Support PC98])
- fi
- if test "x$XORG_OS_PCI" = x ; then
- XORG_OS_PCI=$XORG_OS
- fi
if test "x$DGA" = xauto; then
PKG_CHECK_MODULES(DGA, $DGAPROTO, [DGA=yes], [DGA=no])
fi
@@ -1729,7 +1700,6 @@ if test "x$XORG" = xyes; then
AC_SUBST([XORG_LIBS])
AC_SUBST([XORG_SYS_LIBS])
AC_SUBST([XORG_INCS])
- AC_SUBST([XORG_OS])
AC_SUBST([XORG_OS_SUBDIR])
AC_SUBST([XORG_CFLAGS])
diff --git a/xorg-server/damageext/damageext.c b/xorg-server/damageext/damageext.c
index 02db88a8e..86f880c1e 100644
--- a/xorg-server/damageext/damageext.c
+++ b/xorg-server/damageext/damageext.c
@@ -129,7 +129,6 @@ ProcDamageQueryVersion(ClientPtr client)
{
DamageClientPtr pDamageClient = GetDamageClient (client);
xDamageQueryVersionReply rep;
- register int n;
REQUEST(xDamageQueryVersionReq);
REQUEST_SIZE_MATCH(xDamageQueryVersionReq);
@@ -150,10 +149,10 @@ ProcDamageQueryVersion(ClientPtr client)
pDamageClient->major_version = rep.majorVersion;
pDamageClient->minor_version = rep.minorVersion;
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.majorVersion, n);
- swapl(&rep.minorVersion, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.majorVersion);
+ swapl(&rep.minorVersion);
}
WriteToClient(client, sizeof(xDamageQueryVersionReply), (char *)&rep);
return Success;
@@ -334,65 +333,60 @@ ProcDamageDispatch (ClientPtr client)
static int
SProcDamageQueryVersion(ClientPtr client)
{
- register int n;
REQUEST(xDamageQueryVersionReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDamageQueryVersionReq);
- swapl(&stuff->majorVersion, n);
- swapl(&stuff->minorVersion, n);
+ swapl(&stuff->majorVersion);
+ swapl(&stuff->minorVersion);
return (*ProcDamageVector[stuff->damageReqType]) (client);
}
static int
SProcDamageCreate (ClientPtr client)
{
- register int n;
REQUEST(xDamageCreateReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDamageCreateReq);
- swapl (&stuff->damage, n);
- swapl (&stuff->drawable, n);
+ swapl(&stuff->damage);
+ swapl(&stuff->drawable);
return (*ProcDamageVector[stuff->damageReqType]) (client);
}
static int
SProcDamageDestroy (ClientPtr client)
{
- register int n;
REQUEST(xDamageDestroyReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDamageDestroyReq);
- swapl (&stuff->damage, n);
+ swapl(&stuff->damage);
return (*ProcDamageVector[stuff->damageReqType]) (client);
}
static int
SProcDamageSubtract (ClientPtr client)
{
- register int n;
REQUEST(xDamageSubtractReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDamageSubtractReq);
- swapl (&stuff->damage, n);
- swapl (&stuff->repair, n);
- swapl (&stuff->parts, n);
+ swapl(&stuff->damage);
+ swapl(&stuff->repair);
+ swapl(&stuff->parts);
return (*ProcDamageVector[stuff->damageReqType]) (client);
}
static int
SProcDamageAdd (ClientPtr client)
{
- register int n;
REQUEST(xDamageAddReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDamageSubtractReq);
- swapl (&stuff->drawable, n);
- swapl (&stuff->region, n);
+ swapl(&stuff->drawable);
+ swapl(&stuff->region);
return (*ProcDamageVector[stuff->damageReqType]) (client);
}
diff --git a/xorg-server/dbe/dbe.c b/xorg-server/dbe/dbe.c
index 51bbdc6c9..86d8220b8 100644
--- a/xorg-server/dbe/dbe.c
+++ b/xorg-server/dbe/dbe.c
@@ -127,8 +127,6 @@ ProcDbeGetVersion(ClientPtr client)
{
/* REQUEST(xDbeGetVersionReq); */
xDbeGetVersionReply rep;
- register int n;
-
REQUEST_SIZE_MATCH(xDbeGetVersionReq);
@@ -140,7 +138,7 @@ ProcDbeGetVersion(ClientPtr client)
if (client->swapped)
{
- swaps(&rep.sequenceNumber, n);
+ swaps(&rep.sequenceNumber);
}
WriteToClient(client, sizeof(xDbeGetVersionReply), (char *)&rep);
@@ -656,7 +654,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
xDbeGetVisualInfoReply rep;
Drawable *drawables;
DrawablePtr *pDrawables = NULL;
- register int i, j, n, rc;
+ register int i, j, rc;
register int count; /* number of visual infos in reply */
register int length; /* length of reply */
ScreenPtr pScreen;
@@ -732,9 +730,9 @@ ProcDbeGetVisualInfo(ClientPtr client)
if (client->swapped)
{
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.m, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.m);
}
/* Send off reply. */
@@ -751,7 +749,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
if (client->swapped)
{
- swapl(&data32, n);
+ swapl(&data32);
}
WriteToClient(client, sizeof(CARD32), (char *)&data32);
@@ -772,7 +770,7 @@ ProcDbeGetVisualInfo(ClientPtr client)
if (client->swapped)
{
- swapl(&visInfo.visualID, n);
+ swapl(&visInfo.visualID);
/* We do not need to swap depth and perfLevel since they are
* already 1 byte quantities.
@@ -822,7 +820,7 @@ ProcDbeGetBackBufferAttributes(ClientPtr client)
REQUEST(xDbeGetBackBufferAttributesReq);
xDbeGetBackBufferAttributesReply rep;
DbeWindowPrivPtr pDbeWindowPriv;
- int rc, n;
+ int rc;
REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq);
@@ -845,9 +843,9 @@ ProcDbeGetBackBufferAttributes(ClientPtr client)
if (client->swapped)
{
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.attributes, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.attributes);
}
WriteToClient(client, sizeof(xDbeGetBackBufferAttributesReply),
@@ -926,10 +924,8 @@ static int
SProcDbeGetVersion(ClientPtr client)
{
REQUEST(xDbeGetVersionReq);
- register int n;
-
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return(ProcDbeGetVersion(client));
} /* SProcDbeGetVersion() */
@@ -962,13 +958,12 @@ static int
SProcDbeAllocateBackBufferName(ClientPtr client)
{
REQUEST(xDbeAllocateBackBufferNameReq);
- register int n;
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDbeAllocateBackBufferNameReq);
- swapl(&stuff->window, n);
- swapl(&stuff->buffer, n);
+ swapl(&stuff->window);
+ swapl(&stuff->buffer);
/* stuff->swapAction is a byte. We do not need to swap this field. */
return(ProcDbeAllocateBackBufferName(client));
@@ -997,13 +992,11 @@ static int
SProcDbeDeallocateBackBufferName(ClientPtr client)
{
REQUEST (xDbeDeallocateBackBufferNameReq);
- register int n;
-
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDbeDeallocateBackBufferNameReq);
- swapl(&stuff->buffer, n);
+ swapl(&stuff->buffer);
return(ProcDbeDeallocateBackBufferName(client));
@@ -1035,14 +1028,14 @@ static int
SProcDbeSwapBuffers(ClientPtr client)
{
REQUEST(xDbeSwapBuffersReq);
- register int i, n;
+ register int i;
xDbeSwapInfo *pSwapInfo;
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xDbeSwapBuffersReq);
- swapl(&stuff->n, n);
+ swapl(&stuff->n);
if (stuff->n != 0)
{
@@ -1054,7 +1047,7 @@ SProcDbeSwapBuffers(ClientPtr client)
*/
for (i = 0; i < stuff->n; i++)
{
- swapl(&pSwapInfo->window, n);
+ swapl(&pSwapInfo->window);
}
}
@@ -1083,9 +1076,8 @@ static int
SProcDbeBeginIdiom(ClientPtr client)
{
REQUEST(xDbeBeginIdiomReq);
- register int n;
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return(ProcDbeBeginIdiom(client));
} /* SProcDbeBeginIdiom() */
@@ -1112,13 +1104,11 @@ static int
SProcDbeGetVisualInfo(ClientPtr client)
{
REQUEST(xDbeGetVisualInfoReq);
- register int n;
-
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xDbeGetVisualInfoReq);
- swapl(&stuff->n, n);
+ swapl(&stuff->n);
SwapRestL(stuff);
return(ProcDbeGetVisualInfo(client));
@@ -1146,12 +1136,11 @@ static int
SProcDbeGetBackBufferAttributes(ClientPtr client)
{
REQUEST (xDbeGetBackBufferAttributesReq);
- register int n;
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDbeGetBackBufferAttributesReq);
- swapl(&stuff->buffer, n);
+ swapl(&stuff->buffer);
return(ProcDbeGetBackBufferAttributes(client));
diff --git a/xorg-server/devbook.am b/xorg-server/devbook.am
index 4e23bb78e..400b2ca55 100644
--- a/xorg-server/devbook.am
+++ b/xorg-server/devbook.am
@@ -20,43 +20,36 @@ noinst_DATA =
# DocBook/XML file with chapters, appendix and images it includes
dist_noinst_DATA = $(docbook) $(chapters)
-#
-# Generate DocBook/XML output formats with or without stylesheets
-#
-
-# Stylesheets are available if the package xorg-sgml-doctools is installed
if HAVE_STYLESHEETS
-# The location where all cross reference databases are installed
-XMLTO_FLAGS = \
- --searchpath "$(XORG_SGML_PATH)/X11" \
+XMLTO_HTML_FLAGS = \
+ --searchpath "$(XORG_SGML_PATH)/X11" \
--searchpath "$(abs_top_builddir)" \
- --stringparam current.docid="$(<:.xml=)"
-
-XMLTO_XHTML_FLAGS = \
- -m $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl \
- --stringparam html.stylesheet=$(STYLESHEET_SRCDIR)/xorg.css
-
-XMLTO_FO_FLAGS = \
- -m $(STYLESHEET_SRCDIR)/xorg-fo.xsl
-endif HAVE_STYLESHEETS
+ -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
noinst_DATA += $(docbook:.xml=.html)
%.html: %.xml $(chapters)
- $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) xhtml-nochunks $<
+ $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $<
+
+if HAVE_XMLTO_TEXT
+noinst_DATA += $(docbook:.xml=.txt)
+%.txt: %.xml $(chapters)
+ $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $<
+endif HAVE_XMLTO_TEXT
if HAVE_FOP
+XMLTO_FO_FLAGS = \
+ --searchpath "$(XORG_SGML_PATH)/X11" \
+ --searchpath "$(abs_top_builddir)" \
+ --stringparam img.src.path=$(abs_builddir)/ \
+ -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl
+
noinst_DATA += $(docbook:.xml=.pdf) $(docbook:.xml=.ps)
%.pdf: %.xml $(chapters)
- $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop pdf $<
+ $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $<
%.ps: %.xml $(chapters)
- $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop ps $<
+ $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $<
endif HAVE_FOP
-
-if HAVE_XMLTO_TEXT
-noinst_DATA += $(docbook:.xml=.txt)
-%.txt: %.xml $(chapters)
- $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) txt $<
-endif HAVE_XMLTO_TEXT
+endif HAVE_STYLESHEETS
CLEANFILES = $(noinst_DATA)
diff --git a/xorg-server/dix/colormap.c b/xorg-server/dix/colormap.c
index 7dba69d11..618da444a 100644
--- a/xorg-server/dix/colormap.c
+++ b/xorg-server/dix/colormap.c
@@ -291,13 +291,6 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
if (!pmap)
return BadAlloc;
}
-#if defined(_XSERVER64)
- pmap->pad0 = 0;
- pmap->pad1 = 0;
-#if (X_BYTE_ORDER == X_LITTLE_ENDIAN)
- pmap->pad2 = 0;
-#endif
-#endif
pmap->red = (EntryPtr)((char *)pmap + sizeof(ColormapRec));
sizebytes = size * sizeof(Entry);
pmap->clientPixelsRed = (Pixel **)((char *)pmap->red + sizebytes);
diff --git a/xorg-server/dix/cursor.c b/xorg-server/dix/cursor.c
index c191c1e88..f29cb1125 100644
--- a/xorg-server/dix/cursor.c
+++ b/xorg-server/dix/cursor.c
@@ -72,7 +72,7 @@ typedef struct _GlyphShare {
static GlyphSharePtr sharedGlyphs = (GlyphSharePtr)NULL;
-DevPrivateKeyRec cursorScreenDevPriv[MAXSCREENS];
+DevScreenPrivateKeyRec cursorScreenDevPriv;
#ifdef XFIXES
static CARD32 cursorSerial;
diff --git a/xorg-server/dix/dispatch.c b/xorg-server/dix/dispatch.c
index b2820ebf1..b305e68e1 100644
--- a/xorg-server/dix/dispatch.c
+++ b/xorg-server/dix/dispatch.c
@@ -1460,7 +1460,6 @@ CreatePmap:
}
if (AddResource(stuff->pid, RT_PIXMAP, (pointer)pMap))
return Success;
- (*pDraw->pScreen->DestroyPixmap)(pMap);
}
return BadAlloc;
}
@@ -3484,8 +3483,7 @@ CloseDownClient(ClientPtr client)
* now. If it hasn't gotten to Running, nClients has *not*
* been incremented, so *don't* decrement it.
*/
- if (client->clientState != ClientStateInitial &&
- client->clientState != ClientStateAuthenticating )
+ if (client->clientState != ClientStateInitial)
{
--nClients;
}
@@ -3625,7 +3623,7 @@ ProcInitialConnection(ClientPtr client)
bytes_to_int32(prefix->nbytesAuthString);
if (client->swapped)
{
- swaps(&stuff->length, whichbyte);
+ swaps(&stuff->length);
}
ResetCurrentRequest(client);
return Success;
@@ -3747,19 +3745,8 @@ ProcEstablishConnection(ClientPtr client)
auth_proto,
(unsigned short)prefix->nbytesAuthString,
auth_string);
- /*
- * If Kerberos is being used for this client, the clientState
- * will be set to ClientStateAuthenticating at this point.
- * More messages need to be exchanged among the X server, Kerberos
- * server, and client to figure out if everyone is authorized.
- * So we don't want to send the connection setup info yet, since
- * the auth step isn't really done.
- */
- if (client->clientState == ClientStateCheckingSecurity)
- client->clientState = ClientStateCheckedSecurity;
- else if (client->clientState != ClientStateAuthenticating)
- return(SendConnSetup(client, reason));
- return Success;
+
+ return(SendConnSetup(client, reason));
}
void
@@ -3952,7 +3939,7 @@ AddScreen(
return -1;
}
- dixRegisterPrivateKey(&cursorScreenDevPriv[i], PRIVATE_CURSOR, 0);
+ dixRegisterScreenPrivateKey(&cursorScreenDevPriv, pScreen, PRIVATE_CURSOR, 0);
return i;
}
diff --git a/xorg-server/dix/swaprep.c b/xorg-server/dix/swaprep.c
index 936da6d1c..28c354cd9 100644
--- a/xorg-server/dix/swaprep.c
+++ b/xorg-server/dix/swaprep.c
@@ -1,1308 +1,1229 @@
-/************************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "misc.h"
-#include "dixstruct.h"
-#include <X11/fonts/fontstruct.h>
-#include "scrnintstr.h"
-#include "swaprep.h"
-#include "globals.h"
-
-static void SwapFontInfo(xQueryFontReply *pr);
-
-static void SwapCharInfo(xCharInfo *pInfo);
-
-static void SwapFont(xQueryFontReply *pr, Bool hasGlyphs);
-
-/**
- * Thanks to Jack Palevich for testing and subsequently rewriting all this
- *
- * \param size size in bytes
- */
-void
-Swap32Write(ClientPtr pClient, int size, CARD32 *pbuf)
-{
- int i;
- char n;
-
- size >>= 2;
- for(i = 0; i < size; i++)
- /* brackets are mandatory here, because "swapl" macro expands
- to several statements */
- {
- swapl(&pbuf[i], n);
- }
- (void)WriteToClient(pClient, size << 2, (char *) pbuf);
-}
-
-/**
- *
- * \param size size in bytes
- */
-void
-CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf)
-{
- int bufsize = size;
- CARD32 *pbufT;
- CARD32 *from, *to, *fromLast, *toLast;
- CARD32 tmpbuf[1];
-
- /* Allocate as big a buffer as we can... */
- while (!(pbufT = malloc(bufsize)))
- {
- bufsize >>= 1;
- if (bufsize == 4)
- {
- pbufT = tmpbuf;
- break;
- }
- }
-
- /* convert lengths from # of bytes to # of longs */
- size >>= 2;
- bufsize >>= 2;
-
- from = pbuf;
- fromLast = from + size;
- while (from < fromLast) {
- int nbytes;
- to = pbufT;
- toLast = to + min (bufsize, fromLast - from);
- nbytes = (toLast - to) << 2;
- while (to < toLast) {
- /* can't write "cpswapl(*from++, *to++)" because cpswapl is a macro
- that evaulates its args more than once */
- cpswapl(*from, *to);
- from++;
- to++;
- }
- (void)WriteToClient (pClient, nbytes, (char *) pbufT);
- }
-
- if (pbufT != tmpbuf)
- free(pbufT);
-}
-
-/**
- *
- * \param size size in bytes
- */
-void
-CopySwap16Write(ClientPtr pClient, int size, short *pbuf)
-{
- int bufsize = size;
- short *pbufT;
- short *from, *to, *fromLast, *toLast;
- short tmpbuf[2];
-
- /* Allocate as big a buffer as we can... */
- while (!(pbufT = malloc(bufsize)))
- {
- bufsize >>= 1;
- if (bufsize == 4)
- {
- pbufT = tmpbuf;
- break;
- }
- }
-
- /* convert lengths from # of bytes to # of shorts */
- size >>= 1;
- bufsize >>= 1;
-
- from = pbuf;
- fromLast = from + size;
- while (from < fromLast) {
- int nbytes;
- to = pbufT;
- toLast = to + min (bufsize, fromLast - from);
- nbytes = (toLast - to) << 1;
- while (to < toLast) {
- /* can't write "cpswaps(*from++, *to++)" because cpswaps is a macro
- that evaulates its args more than once */
- cpswaps(*from, *to);
- from++;
- to++;
- }
- (void)WriteToClient (pClient, nbytes, (char *) pbufT);
- }
-
- if (pbufT != tmpbuf)
- free(pbufT);
-}
-
-
-/* Extra-small reply */
-void
-SGenericReply(ClientPtr pClient, int size, xGenericReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-/* Extra-large reply */
-void
-SGetWindowAttributesReply(ClientPtr pClient, int size,
- xGetWindowAttributesReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swapl(&pRep->visualID, n);
- swaps(&pRep->class, n);
- swapl(&pRep->backingBitPlanes, n);
- swapl(&pRep->backingPixel, n);
- swapl(&pRep->colormap, n);
- swapl(&pRep->allEventMasks, n);
- swapl(&pRep->yourEventMask, n);
- swaps(&pRep->doNotPropagateMask, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->root, n);
- swaps(&pRep->x, n);
- swaps(&pRep->y, n);
- swaps(&pRep->width, n);
- swaps(&pRep->height, n);
- swaps(&pRep->borderWidth, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swapl(&pRep->root, n);
- swapl(&pRep->parent, n);
- swaps(&pRep->nChildren, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->atom, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nameLength, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-
-void
-SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swapl(&pRep->propertyType, n);
- swapl(&pRep->bytesAfter, n);
- swapl(&pRep->nItems, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nProperties, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetSelectionOwnerReply(ClientPtr pClient, int size,
- xGetSelectionOwnerReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->owner, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-
-void
-SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->root, n);
- swapl(&pRep->child, n);
- swaps(&pRep->rootX, n);
- swaps(&pRep->rootY, n);
- swaps(&pRep->winX, n);
- swaps(&pRep->winY, n);
- swaps(&pRep->mask, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-static void
-SwapTimecoord(xTimecoord* pCoord)
-{
- char n;
-
- swapl(&pCoord->time, n);
- swaps(&pCoord->x, n);
- swaps(&pCoord->y, n);
-}
-
-void
-SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord *pRep)
-{
- int i, n;
- xTimecoord *pRepT;
-
- n = size / sizeof(xTimecoord);
- pRepT = pRep;
- for(i = 0; i < n; i++)
- {
- SwapTimecoord(pRepT);
- pRepT++;
- }
- (void)WriteToClient(pClient, size, (char *) pRep);
-
-}
-void
-SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swapl(&pRep->nEvents, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->child, n);
- swaps(&pRep->dstX, n);
- swaps(&pRep->dstY, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->focus, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-/* extra long reply */
-void
-SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-static void
-SwapCharInfo(xCharInfo *pInfo)
-{
- char n;
-
- swaps(&pInfo->leftSideBearing, n);
- swaps(&pInfo->rightSideBearing, n);
- swaps(&pInfo->characterWidth, n);
- swaps(&pInfo->ascent, n);
- swaps(&pInfo->descent, n);
- swaps(&pInfo->attributes, n);
-}
-
-static void
-SwapFontInfo(xQueryFontReply *pr)
-{
- char n;
-
- swaps(&pr->minCharOrByte2, n);
- swaps(&pr->maxCharOrByte2, n);
- swaps(&pr->defaultChar, n);
- swaps(&pr->nFontProps, n);
- swaps(&pr->fontAscent, n);
- swaps(&pr->fontDescent, n);
- SwapCharInfo( &pr->minBounds);
- SwapCharInfo( &pr->maxBounds);
- swapl(&pr->nCharInfos, n);
-}
-
-static void
-SwapFont(xQueryFontReply *pr, Bool hasGlyphs)
-{
- unsigned i;
- xCharInfo * pxci;
- unsigned nchars, nprops;
- char *pby;
- char n;
-
- swaps(&pr->sequenceNumber, n);
- swapl(&pr->length, n);
- nchars = pr->nCharInfos;
- nprops = pr->nFontProps;
- SwapFontInfo(pr);
- pby = (char *) &pr[1];
- /* Font properties are an atom and either an int32 or a CARD32, so
- * they are always 2 4 byte values */
- for(i = 0; i < nprops; i++)
- {
- swapl(pby, n);
- pby += 4;
- swapl(pby, n);
- pby += 4;
- }
- if (hasGlyphs)
- {
- pxci = (xCharInfo *)pby;
- for(i = 0; i< nchars; i++, pxci++)
- SwapCharInfo(pxci);
- }
-}
-
-void
-SQueryFontReply(ClientPtr pClient, int size, xQueryFontReply *pRep)
-{
- SwapFont(pRep, TRUE);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SQueryTextExtentsReply(ClientPtr pClient, int size, xQueryTextExtentsReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swaps(&pRep->fontAscent, n);
- swaps(&pRep->fontDescent, n);
- swaps(&pRep->overallAscent, n);
- swaps(&pRep->overallDescent, n);
- swapl(&pRep->overallWidth, n);
- swapl(&pRep->overallLeft, n);
- swapl(&pRep->overallRight, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SListFontsReply(ClientPtr pClient, int size, xListFontsReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nFonts, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SListFontsWithInfoReply(ClientPtr pClient, int size,
- xListFontsWithInfoReply *pRep)
-{
- SwapFont((xQueryFontReply *)pRep, FALSE);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nPaths, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetImageReply(ClientPtr pClient, int size, xGetImageReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swapl(&pRep->visual, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
- /* Fortunately, image doesn't need swapping */
-}
-
-void
-SListInstalledColormapsReply(ClientPtr pClient, int size,
- xListInstalledColormapsReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nColormaps, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SAllocColorReply(ClientPtr pClient, int size, xAllocColorReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swaps(&pRep->red, n);
- swaps(&pRep->green, n);
- swaps(&pRep->blue, n);
- swapl(&pRep->pixel, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->pixel, n);
- swaps(&pRep->exactRed, n);
- swaps(&pRep->exactGreen, n);
- swaps(&pRep->exactBlue, n);
- swaps(&pRep->screenRed, n);
- swaps(&pRep->screenGreen, n);
- swaps(&pRep->screenBlue, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nPixels, n);
- swaps(&pRep->nMasks, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-
-void
-SAllocColorPlanesReply(ClientPtr pClient, int size, xAllocColorPlanesReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nPixels, n);
- swapl(&pRep->redMask, n);
- swapl(&pRep->greenMask, n);
- swapl(&pRep->blueMask, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-static void
-SwapRGB(xrgb *prgb)
-{
- char n;
-
- swaps(&prgb->red, n);
- swaps(&prgb->green, n);
- swaps(&prgb->blue, n);
-}
-
-void
-SQColorsExtend(ClientPtr pClient, int size, xrgb *prgb)
-{
- int i, n;
- xrgb *prgbT;
-
- n = size / sizeof(xrgb);
- prgbT = prgb;
- for(i = 0; i < n; i++)
- {
- SwapRGB(prgbT);
- prgbT++;
- }
- (void)WriteToClient(pClient, size, (char *) prgb);
-}
-
-void
-SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply* pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nColors, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swaps(&pRep->exactRed, n);
- swaps(&pRep->exactGreen, n);
- swaps(&pRep->exactBlue, n);
- swaps(&pRep->screenRed, n);
- swaps(&pRep->screenGreen, n);
- swaps(&pRep->screenBlue, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swaps(&pRep->width, n);
- swaps(&pRep->height, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetKeyboardMappingReply(ClientPtr pClient, int size,
- xGetKeyboardMappingReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetPointerMappingReply(ClientPtr pClient, int size,
- xGetPointerMappingReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetModifierMappingReply(ClientPtr pClient, int size,
- xGetModifierMappingReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetKeyboardControlReply(ClientPtr pClient, int size, xGetKeyboardControlReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swapl(&pRep->ledMask, n);
- swaps(&pRep->bellPitch, n);
- swaps(&pRep->bellDuration, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetPointerControlReply(ClientPtr pClient, int size, xGetPointerControlReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swaps(&pRep->accelNumerator, n);
- swaps(&pRep->accelDenominator, n);
- swaps(&pRep->threshold, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swaps(&pRep->timeout, n);
- swaps(&pRep->interval, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-void
-SLHostsExtend(ClientPtr pClient, int size, char *buf)
-{
- char *bufT = buf;
- char *endbuf = buf + size;
- while (bufT < endbuf) {
- xHostEntry *host = (xHostEntry *) bufT;
- int len = host->length;
- char n;
- swaps (&host->length, n);
- bufT += sizeof (xHostEntry) + pad_to_int32(len);
- }
- (void)WriteToClient (pClient, size, buf);
-}
-
-void
-SListHostsReply(ClientPtr pClient, int size, xListHostsReply *pRep)
-{
- char n;
-
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swaps(&pRep->nHosts, n);
- (void)WriteToClient(pClient, size, (char *) pRep);
-}
-
-
-
-void
-SErrorEvent(xError *from, xError *to)
-{
- to->type = X_Error;
- to->errorCode = from->errorCode;
- cpswaps(from->sequenceNumber, to->sequenceNumber);
- cpswapl(from->resourceID, to->resourceID);
- cpswaps(from->minorCode, to->minorCode);
- to->majorCode = from->majorCode;
-}
-
-void
-SKeyButtonPtrEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- to->u.u.detail = from->u.u.detail;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.keyButtonPointer.time,
- to->u.keyButtonPointer.time);
- cpswapl(from->u.keyButtonPointer.root,
- to->u.keyButtonPointer.root);
- cpswapl(from->u.keyButtonPointer.event,
- to->u.keyButtonPointer.event);
- cpswapl(from->u.keyButtonPointer.child,
- to->u.keyButtonPointer.child);
- cpswaps(from->u.keyButtonPointer.rootX,
- to->u.keyButtonPointer.rootX);
- cpswaps(from->u.keyButtonPointer.rootY,
- to->u.keyButtonPointer.rootY);
- cpswaps(from->u.keyButtonPointer.eventX,
- to->u.keyButtonPointer.eventX);
- cpswaps(from->u.keyButtonPointer.eventY,
- to->u.keyButtonPointer.eventY);
- cpswaps(from->u.keyButtonPointer.state,
- to->u.keyButtonPointer.state);
- to->u.keyButtonPointer.sameScreen =
- from->u.keyButtonPointer.sameScreen;
-}
-
-void
-SEnterLeaveEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- to->u.u.detail = from->u.u.detail;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.enterLeave.time, to->u.enterLeave.time);
- cpswapl(from->u.enterLeave.root, to->u.enterLeave.root);
- cpswapl(from->u.enterLeave.event, to->u.enterLeave.event);
- cpswapl(from->u.enterLeave.child, to->u.enterLeave.child);
- cpswaps(from->u.enterLeave.rootX, to->u.enterLeave.rootX);
- cpswaps(from->u.enterLeave.rootY, to->u.enterLeave.rootY);
- cpswaps(from->u.enterLeave.eventX, to->u.enterLeave.eventX);
- cpswaps(from->u.enterLeave.eventY, to->u.enterLeave.eventY);
- cpswaps(from->u.enterLeave.state, to->u.enterLeave.state);
- to->u.enterLeave.mode = from->u.enterLeave.mode;
- to->u.enterLeave.flags = from->u.enterLeave.flags;
-}
-
-void
-SFocusEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- to->u.u.detail = from->u.u.detail;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.focus.window, to->u.focus.window);
- to->u.focus.mode = from->u.focus.mode;
-}
-
-void
-SExposeEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.expose.window, to->u.expose.window);
- cpswaps(from->u.expose.x, to->u.expose.x);
- cpswaps(from->u.expose.y, to->u.expose.y);
- cpswaps(from->u.expose.width, to->u.expose.width);
- cpswaps(from->u.expose.height, to->u.expose.height);
- cpswaps(from->u.expose.count, to->u.expose.count);
-}
-
-void
-SGraphicsExposureEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.graphicsExposure.drawable,
- to->u.graphicsExposure.drawable);
- cpswaps(from->u.graphicsExposure.x,
- to->u.graphicsExposure.x);
- cpswaps(from->u.graphicsExposure.y,
- to->u.graphicsExposure.y);
- cpswaps(from->u.graphicsExposure.width,
- to->u.graphicsExposure.width);
- cpswaps(from->u.graphicsExposure.height,
- to->u.graphicsExposure.height);
- cpswaps(from->u.graphicsExposure.minorEvent,
- to->u.graphicsExposure.minorEvent);
- cpswaps(from->u.graphicsExposure.count,
- to->u.graphicsExposure.count);
- to->u.graphicsExposure.majorEvent =
- from->u.graphicsExposure.majorEvent;
-}
-
-void
-SNoExposureEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.noExposure.drawable, to->u.noExposure.drawable);
- cpswaps(from->u.noExposure.minorEvent, to->u.noExposure.minorEvent);
- to->u.noExposure.majorEvent = from->u.noExposure.majorEvent;
-}
-
-void
-SVisibilityEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.visibility.window, to->u.visibility.window);
- to->u.visibility.state = from->u.visibility.state;
-}
-
-void
-SCreateNotifyEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.createNotify.window, to->u.createNotify.window);
- cpswapl(from->u.createNotify.parent, to->u.createNotify.parent);
- cpswaps(from->u.createNotify.x, to->u.createNotify.x);
- cpswaps(from->u.createNotify.y, to->u.createNotify.y);
- cpswaps(from->u.createNotify.width, to->u.createNotify.width);
- cpswaps(from->u.createNotify.height, to->u.createNotify.height);
- cpswaps(from->u.createNotify.borderWidth,
- to->u.createNotify.borderWidth);
- to->u.createNotify.override = from->u.createNotify.override;
-}
-
-void
-SDestroyNotifyEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.destroyNotify.event, to->u.destroyNotify.event);
- cpswapl(from->u.destroyNotify.window, to->u.destroyNotify.window);
-}
-
-void
-SUnmapNotifyEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.unmapNotify.event, to->u.unmapNotify.event);
- cpswapl(from->u.unmapNotify.window, to->u.unmapNotify.window);
- to->u.unmapNotify.fromConfigure = from->u.unmapNotify.fromConfigure;
-}
-
-void
-SMapNotifyEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.mapNotify.event, to->u.mapNotify.event);
- cpswapl(from->u.mapNotify.window, to->u.mapNotify.window);
- to->u.mapNotify.override = from->u.mapNotify.override;
-}
-
-void
-SMapRequestEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.mapRequest.parent, to->u.mapRequest.parent);
- cpswapl(from->u.mapRequest.window, to->u.mapRequest.window);
-}
-
-void
-SReparentEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.reparent.event, to->u.reparent.event);
- cpswapl(from->u.reparent.window, to->u.reparent.window);
- cpswapl(from->u.reparent.parent, to->u.reparent.parent);
- cpswaps(from->u.reparent.x, to->u.reparent.x);
- cpswaps(from->u.reparent.y, to->u.reparent.y);
- to->u.reparent.override = from->u.reparent.override;
-}
-
-void
-SConfigureNotifyEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.configureNotify.event,
- to->u.configureNotify.event);
- cpswapl(from->u.configureNotify.window,
- to->u.configureNotify.window);
- cpswapl(from->u.configureNotify.aboveSibling,
- to->u.configureNotify.aboveSibling);
- cpswaps(from->u.configureNotify.x, to->u.configureNotify.x);
- cpswaps(from->u.configureNotify.y, to->u.configureNotify.y);
- cpswaps(from->u.configureNotify.width, to->u.configureNotify.width);
- cpswaps(from->u.configureNotify.height,
- to->u.configureNotify.height);
- cpswaps(from->u.configureNotify.borderWidth,
- to->u.configureNotify.borderWidth);
- to->u.configureNotify.override = from->u.configureNotify.override;
-}
-
-void
-SConfigureRequestEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- to->u.u.detail = from->u.u.detail; /* actually stack-mode */
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.configureRequest.parent,
- to->u.configureRequest.parent);
- cpswapl(from->u.configureRequest.window,
- to->u.configureRequest.window);
- cpswapl(from->u.configureRequest.sibling,
- to->u.configureRequest.sibling);
- cpswaps(from->u.configureRequest.x, to->u.configureRequest.x);
- cpswaps(from->u.configureRequest.y, to->u.configureRequest.y);
- cpswaps(from->u.configureRequest.width,
- to->u.configureRequest.width);
- cpswaps(from->u.configureRequest.height,
- to->u.configureRequest.height);
- cpswaps(from->u.configureRequest.borderWidth,
- to->u.configureRequest.borderWidth);
- cpswaps(from->u.configureRequest.valueMask,
- to->u.configureRequest.valueMask);
-}
-
-
-void
-SGravityEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.gravity.event, to->u.gravity.event);
- cpswapl(from->u.gravity.window, to->u.gravity.window);
- cpswaps(from->u.gravity.x, to->u.gravity.x);
- cpswaps(from->u.gravity.y, to->u.gravity.y);
-}
-
-void
-SResizeRequestEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.resizeRequest.window, to->u.resizeRequest.window);
- cpswaps(from->u.resizeRequest.width, to->u.resizeRequest.width);
- cpswaps(from->u.resizeRequest.height, to->u.resizeRequest.height);
-}
-
-void
-SCirculateEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- to->u.u.detail = from->u.u.detail;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.circulate.event, to->u.circulate.event);
- cpswapl(from->u.circulate.window, to->u.circulate.window);
- cpswapl(from->u.circulate.parent, to->u.circulate.parent);
- to->u.circulate.place = from->u.circulate.place;
-}
-
-void
-SPropertyEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.property.window, to->u.property.window);
- cpswapl(from->u.property.atom, to->u.property.atom);
- cpswapl(from->u.property.time, to->u.property.time);
- to->u.property.state = from->u.property.state;
-}
-
-void
-SSelectionClearEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.selectionClear.time, to->u.selectionClear.time);
- cpswapl(from->u.selectionClear.window, to->u.selectionClear.window);
- cpswapl(from->u.selectionClear.atom, to->u.selectionClear.atom);
-}
-
-void
-SSelectionRequestEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.selectionRequest.time, to->u.selectionRequest.time);
- cpswapl(from->u.selectionRequest.owner,
- to->u.selectionRequest.owner);
- cpswapl(from->u.selectionRequest.requestor,
- to->u.selectionRequest.requestor);
- cpswapl(from->u.selectionRequest.selection,
- to->u.selectionRequest.selection);
- cpswapl(from->u.selectionRequest.target,
- to->u.selectionRequest.target);
- cpswapl(from->u.selectionRequest.property,
- to->u.selectionRequest.property);
-}
-
-void
-SSelectionNotifyEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.selectionNotify.time, to->u.selectionNotify.time);
- cpswapl(from->u.selectionNotify.requestor,
- to->u.selectionNotify.requestor);
- cpswapl(from->u.selectionNotify.selection,
- to->u.selectionNotify.selection);
- cpswapl(from->u.selectionNotify.target,
- to->u.selectionNotify.target);
- cpswapl(from->u.selectionNotify.property,
- to->u.selectionNotify.property);
-}
-
-void
-SColormapEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.colormap.window, to->u.colormap.window);
- cpswapl(from->u.colormap.colormap, to->u.colormap.colormap);
- to->u.colormap.new = from->u.colormap.new;
- to->u.colormap.state = from->u.colormap.state;
-}
-
-void
-SMappingEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- to->u.mappingNotify.request = from->u.mappingNotify.request;
- to->u.mappingNotify.firstKeyCode =
- from->u.mappingNotify.firstKeyCode;
- to->u.mappingNotify.count = from->u.mappingNotify.count;
-}
-
-void
-SClientMessageEvent(xEvent *from, xEvent *to)
-{
- to->u.u.type = from->u.u.type;
- to->u.u.detail = from->u.u.detail; /* actually format */
- cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
- cpswapl(from->u.clientMessage.window, to->u.clientMessage.window);
- cpswapl(from->u.clientMessage.u.l.type,
- to->u.clientMessage.u.l.type);
- switch (from->u.u.detail) {
- case 8:
- memmove(to->u.clientMessage.u.b.bytes,
- from->u.clientMessage.u.b.bytes,20);
- break;
- case 16:
- cpswaps(from->u.clientMessage.u.s.shorts0,
- to->u.clientMessage.u.s.shorts0);
- cpswaps(from->u.clientMessage.u.s.shorts1,
- to->u.clientMessage.u.s.shorts1);
- cpswaps(from->u.clientMessage.u.s.shorts2,
- to->u.clientMessage.u.s.shorts2);
- cpswaps(from->u.clientMessage.u.s.shorts3,
- to->u.clientMessage.u.s.shorts3);
- cpswaps(from->u.clientMessage.u.s.shorts4,
- to->u.clientMessage.u.s.shorts4);
- cpswaps(from->u.clientMessage.u.s.shorts5,
- to->u.clientMessage.u.s.shorts5);
- cpswaps(from->u.clientMessage.u.s.shorts6,
- to->u.clientMessage.u.s.shorts6);
- cpswaps(from->u.clientMessage.u.s.shorts7,
- to->u.clientMessage.u.s.shorts7);
- cpswaps(from->u.clientMessage.u.s.shorts8,
- to->u.clientMessage.u.s.shorts8);
- cpswaps(from->u.clientMessage.u.s.shorts9,
- to->u.clientMessage.u.s.shorts9);
- break;
- case 32:
- cpswapl(from->u.clientMessage.u.l.longs0,
- to->u.clientMessage.u.l.longs0);
- cpswapl(from->u.clientMessage.u.l.longs1,
- to->u.clientMessage.u.l.longs1);
- cpswapl(from->u.clientMessage.u.l.longs2,
- to->u.clientMessage.u.l.longs2);
- cpswapl(from->u.clientMessage.u.l.longs3,
- to->u.clientMessage.u.l.longs3);
- cpswapl(from->u.clientMessage.u.l.longs4,
- to->u.clientMessage.u.l.longs4);
- break;
- }
-}
-
-void
-SKeymapNotifyEvent(xEvent *from, xEvent *to)
-{
- /* Keymap notify events are special; they have no
- sequence number field, and contain entirely 8-bit data */
- *to = *from;
-}
-
-static void
-SwapConnSetup(xConnSetup *pConnSetup, xConnSetup *pConnSetupT)
-{
- cpswapl(pConnSetup->release, pConnSetupT->release);
- cpswapl(pConnSetup->ridBase, pConnSetupT->ridBase);
- cpswapl(pConnSetup->ridMask, pConnSetupT->ridMask);
- cpswapl(pConnSetup->motionBufferSize, pConnSetupT->motionBufferSize);
- cpswaps(pConnSetup->nbytesVendor, pConnSetupT->nbytesVendor);
- cpswaps(pConnSetup->maxRequestSize, pConnSetupT->maxRequestSize);
- pConnSetupT->minKeyCode = pConnSetup->minKeyCode;
- pConnSetupT->maxKeyCode = pConnSetup->maxKeyCode;
- pConnSetupT->numRoots = pConnSetup->numRoots;
- pConnSetupT->numFormats = pConnSetup->numFormats;
- pConnSetupT->imageByteOrder = pConnSetup->imageByteOrder;
- pConnSetupT->bitmapBitOrder = pConnSetup->bitmapBitOrder;
- pConnSetupT->bitmapScanlineUnit = pConnSetup->bitmapScanlineUnit;
- pConnSetupT->bitmapScanlinePad = pConnSetup->bitmapScanlinePad;
-}
-
-static void
-SwapWinRoot(xWindowRoot *pRoot, xWindowRoot *pRootT)
-{
- cpswapl(pRoot->windowId, pRootT->windowId);
- cpswapl(pRoot->defaultColormap, pRootT->defaultColormap);
- cpswapl(pRoot->whitePixel, pRootT->whitePixel);
- cpswapl(pRoot->blackPixel, pRootT->blackPixel);
- cpswapl(pRoot->currentInputMask, pRootT->currentInputMask);
- cpswaps(pRoot->pixWidth, pRootT->pixWidth);
- cpswaps(pRoot->pixHeight, pRootT->pixHeight);
- cpswaps(pRoot->mmWidth, pRootT->mmWidth);
- cpswaps(pRoot->mmHeight, pRootT->mmHeight);
- cpswaps(pRoot->minInstalledMaps, pRootT->minInstalledMaps);
- cpswaps(pRoot->maxInstalledMaps, pRootT->maxInstalledMaps);
- cpswapl(pRoot->rootVisualID, pRootT->rootVisualID);
- pRootT->backingStore = pRoot->backingStore;
- pRootT->saveUnders = pRoot->saveUnders;
- pRootT->rootDepth = pRoot->rootDepth;
- pRootT->nDepths = pRoot->nDepths;
-}
-
-static void
-SwapVisual(xVisualType *pVis, xVisualType *pVisT)
-{
- cpswapl(pVis->visualID, pVisT->visualID);
- pVisT->class = pVis->class;
- pVisT->bitsPerRGB = pVis->bitsPerRGB;
- cpswaps(pVis->colormapEntries, pVisT->colormapEntries);
- cpswapl(pVis->redMask, pVisT->redMask);
- cpswapl(pVis->greenMask, pVisT->greenMask);
- cpswapl(pVis->blueMask, pVisT->blueMask);
-}
-
-void
-SwapConnSetupInfo(
- char *pInfo,
- char *pInfoT
-)
-{
- int i, j, k;
- xConnSetup *pConnSetup = (xConnSetup *)pInfo;
- xDepth *depth;
- xWindowRoot *root;
-
- SwapConnSetup(pConnSetup, (xConnSetup *)pInfoT);
- pInfo += sizeof(xConnSetup);
- pInfoT += sizeof(xConnSetup);
-
- /* Copy the vendor string */
- i = pad_to_int32(pConnSetup->nbytesVendor);
- memcpy(pInfoT, pInfo, i);
- pInfo += i;
- pInfoT += i;
-
- /* The Pixmap formats don't need to be swapped, just copied. */
- i = sizeof(xPixmapFormat) * pConnSetup->numFormats;
- memcpy(pInfoT, pInfo, i);
- pInfo += i;
- pInfoT += i;
-
- for(i = 0; i < pConnSetup->numRoots; i++)
- {
- root = (xWindowRoot*)pInfo;
- SwapWinRoot(root, (xWindowRoot *)pInfoT);
- pInfo += sizeof(xWindowRoot);
- pInfoT += sizeof(xWindowRoot);
-
- for(j = 0; j < root->nDepths; j++)
- {
- depth = (xDepth*)pInfo;
- ((xDepth *)pInfoT)->depth = depth->depth;
- cpswaps(depth->nVisuals, ((xDepth *)pInfoT)->nVisuals);
- pInfo += sizeof(xDepth);
- pInfoT += sizeof(xDepth);
- for(k = 0; k < depth->nVisuals; k++)
- {
- SwapVisual((xVisualType *)pInfo, (xVisualType *)pInfoT);
- pInfo += sizeof(xVisualType);
- pInfoT += sizeof(xVisualType);
- }
- }
- }
-}
-
-void
-WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo)
-{
- char *pInfoTBase;
-
- pInfoTBase = malloc(size);
- if (!pInfoTBase)
- {
- pClient->noClientException = -1;
- return;
- }
- SwapConnSetupInfo(pInfo, pInfoTBase);
- (void)WriteToClient(pClient, (int)size, (char *) pInfoTBase);
- free(pInfoTBase);
-}
-
-void
-SwapConnSetupPrefix(xConnSetupPrefix *pcspFrom, xConnSetupPrefix *pcspTo)
-{
- pcspTo->success = pcspFrom->success;
- pcspTo->lengthReason = pcspFrom->lengthReason;
- cpswaps(pcspFrom->majorVersion, pcspTo->majorVersion);
- cpswaps(pcspFrom->minorVersion, pcspTo->minorVersion);
- cpswaps(pcspFrom->length, pcspTo->length);
-}
-
-void
-WriteSConnSetupPrefix(ClientPtr pClient, xConnSetupPrefix *pcsp)
-{
- xConnSetupPrefix cspT;
-
- SwapConnSetupPrefix(pcsp, &cspT);
- (void)WriteToClient(pClient, sizeof(cspT), (char *) &cspT);
-}
-
-/*
- * Dummy entry for ReplySwapVector[]
- */
-
-void
-ReplyNotSwappd(
- ClientPtr pClient ,
- int size ,
- void * pbuf
- )
-{
- FatalError("Not implemented");
-}
-
+/************************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "dixstruct.h"
+#include <X11/fonts/fontstruct.h>
+#include "scrnintstr.h"
+#include "swaprep.h"
+#include "globals.h"
+
+static void SwapFontInfo(xQueryFontReply *pr);
+
+static void SwapCharInfo(xCharInfo *pInfo);
+
+static void SwapFont(xQueryFontReply *pr, Bool hasGlyphs);
+
+/**
+ * Thanks to Jack Palevich for testing and subsequently rewriting all this
+ *
+ * \param size size in bytes
+ */
+void
+Swap32Write(ClientPtr pClient, int size, CARD32 *pbuf)
+{
+ int i;
+
+ size >>= 2;
+ for(i = 0; i < size; i++)
+ /* brackets are mandatory here, because "swapl" macro expands
+ to several statements */
+ {
+ swapl(&pbuf[i]);
+ }
+ (void)WriteToClient(pClient, size << 2, (char *) pbuf);
+}
+
+/**
+ *
+ * \param size size in bytes
+ */
+void
+CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf)
+{
+ int bufsize = size;
+ CARD32 *pbufT;
+ CARD32 *from, *to, *fromLast, *toLast;
+ CARD32 tmpbuf[1];
+
+ /* Allocate as big a buffer as we can... */
+ while (!(pbufT = malloc(bufsize)))
+ {
+ bufsize >>= 1;
+ if (bufsize == 4)
+ {
+ pbufT = tmpbuf;
+ break;
+ }
+ }
+
+ /* convert lengths from # of bytes to # of longs */
+ size >>= 2;
+ bufsize >>= 2;
+
+ from = pbuf;
+ fromLast = from + size;
+ while (from < fromLast) {
+ int nbytes;
+ to = pbufT;
+ toLast = to + min (bufsize, fromLast - from);
+ nbytes = (toLast - to) << 2;
+ while (to < toLast) {
+ /* can't write "cpswapl(*from++, *to++)" because cpswapl is a macro
+ that evaulates its args more than once */
+ cpswapl(*from, *to);
+ from++;
+ to++;
+ }
+ (void)WriteToClient (pClient, nbytes, (char *) pbufT);
+ }
+
+ if (pbufT != tmpbuf)
+ free(pbufT);
+}
+
+/**
+ *
+ * \param size size in bytes
+ */
+void
+CopySwap16Write(ClientPtr pClient, int size, short *pbuf)
+{
+ int bufsize = size;
+ short *pbufT;
+ short *from, *to, *fromLast, *toLast;
+ short tmpbuf[2];
+
+ /* Allocate as big a buffer as we can... */
+ while (!(pbufT = malloc(bufsize)))
+ {
+ bufsize >>= 1;
+ if (bufsize == 4)
+ {
+ pbufT = tmpbuf;
+ break;
+ }
+ }
+
+ /* convert lengths from # of bytes to # of shorts */
+ size >>= 1;
+ bufsize >>= 1;
+
+ from = pbuf;
+ fromLast = from + size;
+ while (from < fromLast) {
+ int nbytes;
+ to = pbufT;
+ toLast = to + min (bufsize, fromLast - from);
+ nbytes = (toLast - to) << 1;
+ while (to < toLast) {
+ /* can't write "cpswaps(*from++, *to++)" because cpswaps is a macro
+ that evaulates its args more than once */
+ cpswaps(*from, *to);
+ from++;
+ to++;
+ }
+ (void)WriteToClient (pClient, nbytes, (char *) pbufT);
+ }
+
+ if (pbufT != tmpbuf)
+ free(pbufT);
+}
+
+
+/* Extra-small reply */
+void
+SGenericReply(ClientPtr pClient, int size, xGenericReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+/* Extra-large reply */
+void
+SGetWindowAttributesReply(ClientPtr pClient, int size,
+ xGetWindowAttributesReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ swapl(&pRep->visualID);
+ swaps(&pRep->class);
+ swapl(&pRep->backingBitPlanes);
+ swapl(&pRep->backingPixel);
+ swapl(&pRep->colormap);
+ swapl(&pRep->allEventMasks);
+ swapl(&pRep->yourEventMask);
+ swaps(&pRep->doNotPropagateMask);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->root);
+ swaps(&pRep->x);
+ swaps(&pRep->y);
+ swaps(&pRep->width);
+ swaps(&pRep->height);
+ swaps(&pRep->borderWidth);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ swapl(&pRep->root);
+ swapl(&pRep->parent);
+ swaps(&pRep->nChildren);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->atom);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ swaps(&pRep->nameLength);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+
+void
+SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ swapl(&pRep->propertyType);
+ swapl(&pRep->bytesAfter);
+ swapl(&pRep->nItems);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ swaps(&pRep->nProperties);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SGetSelectionOwnerReply(ClientPtr pClient, int size,
+ xGetSelectionOwnerReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->owner);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+
+void
+SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->root);
+ swapl(&pRep->child);
+ swaps(&pRep->rootX);
+ swaps(&pRep->rootY);
+ swaps(&pRep->winX);
+ swaps(&pRep->winY);
+ swaps(&pRep->mask);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+static void
+SwapTimecoord(xTimecoord* pCoord)
+{
+ swapl(&pCoord->time);
+ swaps(&pCoord->x);
+ swaps(&pCoord->y);
+}
+
+void
+SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord *pRep)
+{
+ int i, n;
+ xTimecoord *pRepT;
+
+ n = size / sizeof(xTimecoord);
+ pRepT = pRep;
+ for(i = 0; i < n; i++)
+ {
+ SwapTimecoord(pRepT);
+ pRepT++;
+ }
+ (void)WriteToClient(pClient, size, (char *) pRep);
+
+}
+void
+SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ swapl(&pRep->nEvents);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->child);
+ swaps(&pRep->dstX);
+ swaps(&pRep->dstY);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->focus);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+/* extra long reply */
+void
+SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+static void
+SwapCharInfo(xCharInfo *pInfo)
+{
+ swaps(&pInfo->leftSideBearing);
+ swaps(&pInfo->rightSideBearing);
+ swaps(&pInfo->characterWidth);
+ swaps(&pInfo->ascent);
+ swaps(&pInfo->descent);
+ swaps(&pInfo->attributes);
+}
+
+static void
+SwapFontInfo(xQueryFontReply *pr)
+{
+ swaps(&pr->minCharOrByte2);
+ swaps(&pr->maxCharOrByte2);
+ swaps(&pr->defaultChar);
+ swaps(&pr->nFontProps);
+ swaps(&pr->fontAscent);
+ swaps(&pr->fontDescent);
+ SwapCharInfo( &pr->minBounds);
+ SwapCharInfo( &pr->maxBounds);
+ swapl(&pr->nCharInfos);
+}
+
+static void
+SwapFont(xQueryFontReply *pr, Bool hasGlyphs)
+{
+ unsigned i;
+ xCharInfo * pxci;
+ unsigned nchars, nprops;
+ char *pby;
+
+ swaps(&pr->sequenceNumber);
+ swapl(&pr->length);
+ nchars = pr->nCharInfos;
+ nprops = pr->nFontProps;
+ SwapFontInfo(pr);
+ pby = (char *) &pr[1];
+ /* Font properties are an atom and either an int32 or a CARD32, so
+ * they are always 2 4 byte values */
+ for(i = 0; i < nprops; i++)
+ {
+ swapl((int *)pby);
+ pby += 4;
+ swapl((int *)pby);
+ pby += 4;
+ }
+ if (hasGlyphs)
+ {
+ pxci = (xCharInfo *)pby;
+ for(i = 0; i< nchars; i++, pxci++)
+ SwapCharInfo(pxci);
+ }
+}
+
+void
+SQueryFontReply(ClientPtr pClient, int size, xQueryFontReply *pRep)
+{
+ SwapFont(pRep, TRUE);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SQueryTextExtentsReply(ClientPtr pClient, int size, xQueryTextExtentsReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swaps(&pRep->fontAscent);
+ swaps(&pRep->fontDescent);
+ swaps(&pRep->overallAscent);
+ swaps(&pRep->overallDescent);
+ swapl(&pRep->overallWidth);
+ swapl(&pRep->overallLeft);
+ swapl(&pRep->overallRight);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SListFontsReply(ClientPtr pClient, int size, xListFontsReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ swaps(&pRep->nFonts);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SListFontsWithInfoReply(ClientPtr pClient, int size,
+ xListFontsWithInfoReply *pRep)
+{
+ SwapFont((xQueryFontReply *)pRep, FALSE);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ swaps(&pRep->nPaths);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SGetImageReply(ClientPtr pClient, int size, xGetImageReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ swapl(&pRep->visual);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+ /* Fortunately, image doesn't need swapping */
+}
+
+void
+SListInstalledColormapsReply(ClientPtr pClient, int size,
+ xListInstalledColormapsReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ swaps(&pRep->nColormaps);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SAllocColorReply(ClientPtr pClient, int size, xAllocColorReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swaps(&pRep->red);
+ swaps(&pRep->green);
+ swaps(&pRep->blue);
+ swapl(&pRep->pixel);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->pixel);
+ swaps(&pRep->exactRed);
+ swaps(&pRep->exactGreen);
+ swaps(&pRep->exactBlue);
+ swaps(&pRep->screenRed);
+ swaps(&pRep->screenGreen);
+ swaps(&pRep->screenBlue);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ swaps(&pRep->nPixels);
+ swaps(&pRep->nMasks);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+
+void
+SAllocColorPlanesReply(ClientPtr pClient, int size, xAllocColorPlanesReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ swaps(&pRep->nPixels);
+ swapl(&pRep->redMask);
+ swapl(&pRep->greenMask);
+ swapl(&pRep->blueMask);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+static void
+SwapRGB(xrgb *prgb)
+{
+ swaps(&prgb->red);
+ swaps(&prgb->green);
+ swaps(&prgb->blue);
+}
+
+void
+SQColorsExtend(ClientPtr pClient, int size, xrgb *prgb)
+{
+ int i, n;
+ xrgb *prgbT;
+
+ n = size / sizeof(xrgb);
+ prgbT = prgb;
+ for(i = 0; i < n; i++)
+ {
+ SwapRGB(prgbT);
+ prgbT++;
+ }
+ (void)WriteToClient(pClient, size, (char *) prgb);
+}
+
+void
+SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply* pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ swaps(&pRep->nColors);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swaps(&pRep->exactRed);
+ swaps(&pRep->exactGreen);
+ swaps(&pRep->exactBlue);
+ swaps(&pRep->screenRed);
+ swaps(&pRep->screenGreen);
+ swaps(&pRep->screenBlue);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swaps(&pRep->width);
+ swaps(&pRep->height);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SGetKeyboardMappingReply(ClientPtr pClient, int size,
+ xGetKeyboardMappingReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SGetPointerMappingReply(ClientPtr pClient, int size,
+ xGetPointerMappingReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SGetModifierMappingReply(ClientPtr pClient, int size,
+ xGetModifierMappingReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SGetKeyboardControlReply(ClientPtr pClient, int size, xGetKeyboardControlReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ swapl(&pRep->ledMask);
+ swaps(&pRep->bellPitch);
+ swaps(&pRep->bellDuration);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SGetPointerControlReply(ClientPtr pClient, int size, xGetPointerControlReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swaps(&pRep->accelNumerator);
+ swaps(&pRep->accelDenominator);
+ swaps(&pRep->threshold);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swaps(&pRep->timeout);
+ swaps(&pRep->interval);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+void
+SLHostsExtend(ClientPtr pClient, int size, char *buf)
+{
+ char *bufT = buf;
+ char *endbuf = buf + size;
+ while (bufT < endbuf) {
+ xHostEntry *host = (xHostEntry *) bufT;
+ int len = host->length;
+ swaps(&host->length);
+ bufT += sizeof (xHostEntry) + pad_to_int32(len);
+ }
+ (void)WriteToClient (pClient, size, buf);
+}
+
+void
+SListHostsReply(ClientPtr pClient, int size, xListHostsReply *pRep)
+{
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ swaps(&pRep->nHosts);
+ (void)WriteToClient(pClient, size, (char *) pRep);
+}
+
+
+
+void
+SErrorEvent(xError *from, xError *to)
+{
+ to->type = X_Error;
+ to->errorCode = from->errorCode;
+ cpswaps(from->sequenceNumber, to->sequenceNumber);
+ cpswapl(from->resourceID, to->resourceID);
+ cpswaps(from->minorCode, to->minorCode);
+ to->majorCode = from->majorCode;
+}
+
+void
+SKeyButtonPtrEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ to->u.u.detail = from->u.u.detail;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.keyButtonPointer.time,
+ to->u.keyButtonPointer.time);
+ cpswapl(from->u.keyButtonPointer.root,
+ to->u.keyButtonPointer.root);
+ cpswapl(from->u.keyButtonPointer.event,
+ to->u.keyButtonPointer.event);
+ cpswapl(from->u.keyButtonPointer.child,
+ to->u.keyButtonPointer.child);
+ cpswaps(from->u.keyButtonPointer.rootX,
+ to->u.keyButtonPointer.rootX);
+ cpswaps(from->u.keyButtonPointer.rootY,
+ to->u.keyButtonPointer.rootY);
+ cpswaps(from->u.keyButtonPointer.eventX,
+ to->u.keyButtonPointer.eventX);
+ cpswaps(from->u.keyButtonPointer.eventY,
+ to->u.keyButtonPointer.eventY);
+ cpswaps(from->u.keyButtonPointer.state,
+ to->u.keyButtonPointer.state);
+ to->u.keyButtonPointer.sameScreen =
+ from->u.keyButtonPointer.sameScreen;
+}
+
+void
+SEnterLeaveEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ to->u.u.detail = from->u.u.detail;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.enterLeave.time, to->u.enterLeave.time);
+ cpswapl(from->u.enterLeave.root, to->u.enterLeave.root);
+ cpswapl(from->u.enterLeave.event, to->u.enterLeave.event);
+ cpswapl(from->u.enterLeave.child, to->u.enterLeave.child);
+ cpswaps(from->u.enterLeave.rootX, to->u.enterLeave.rootX);
+ cpswaps(from->u.enterLeave.rootY, to->u.enterLeave.rootY);
+ cpswaps(from->u.enterLeave.eventX, to->u.enterLeave.eventX);
+ cpswaps(from->u.enterLeave.eventY, to->u.enterLeave.eventY);
+ cpswaps(from->u.enterLeave.state, to->u.enterLeave.state);
+ to->u.enterLeave.mode = from->u.enterLeave.mode;
+ to->u.enterLeave.flags = from->u.enterLeave.flags;
+}
+
+void
+SFocusEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ to->u.u.detail = from->u.u.detail;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.focus.window, to->u.focus.window);
+ to->u.focus.mode = from->u.focus.mode;
+}
+
+void
+SExposeEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.expose.window, to->u.expose.window);
+ cpswaps(from->u.expose.x, to->u.expose.x);
+ cpswaps(from->u.expose.y, to->u.expose.y);
+ cpswaps(from->u.expose.width, to->u.expose.width);
+ cpswaps(from->u.expose.height, to->u.expose.height);
+ cpswaps(from->u.expose.count, to->u.expose.count);
+}
+
+void
+SGraphicsExposureEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.graphicsExposure.drawable,
+ to->u.graphicsExposure.drawable);
+ cpswaps(from->u.graphicsExposure.x,
+ to->u.graphicsExposure.x);
+ cpswaps(from->u.graphicsExposure.y,
+ to->u.graphicsExposure.y);
+ cpswaps(from->u.graphicsExposure.width,
+ to->u.graphicsExposure.width);
+ cpswaps(from->u.graphicsExposure.height,
+ to->u.graphicsExposure.height);
+ cpswaps(from->u.graphicsExposure.minorEvent,
+ to->u.graphicsExposure.minorEvent);
+ cpswaps(from->u.graphicsExposure.count,
+ to->u.graphicsExposure.count);
+ to->u.graphicsExposure.majorEvent =
+ from->u.graphicsExposure.majorEvent;
+}
+
+void
+SNoExposureEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.noExposure.drawable, to->u.noExposure.drawable);
+ cpswaps(from->u.noExposure.minorEvent, to->u.noExposure.minorEvent);
+ to->u.noExposure.majorEvent = from->u.noExposure.majorEvent;
+}
+
+void
+SVisibilityEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.visibility.window, to->u.visibility.window);
+ to->u.visibility.state = from->u.visibility.state;
+}
+
+void
+SCreateNotifyEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.createNotify.window, to->u.createNotify.window);
+ cpswapl(from->u.createNotify.parent, to->u.createNotify.parent);
+ cpswaps(from->u.createNotify.x, to->u.createNotify.x);
+ cpswaps(from->u.createNotify.y, to->u.createNotify.y);
+ cpswaps(from->u.createNotify.width, to->u.createNotify.width);
+ cpswaps(from->u.createNotify.height, to->u.createNotify.height);
+ cpswaps(from->u.createNotify.borderWidth,
+ to->u.createNotify.borderWidth);
+ to->u.createNotify.override = from->u.createNotify.override;
+}
+
+void
+SDestroyNotifyEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.destroyNotify.event, to->u.destroyNotify.event);
+ cpswapl(from->u.destroyNotify.window, to->u.destroyNotify.window);
+}
+
+void
+SUnmapNotifyEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.unmapNotify.event, to->u.unmapNotify.event);
+ cpswapl(from->u.unmapNotify.window, to->u.unmapNotify.window);
+ to->u.unmapNotify.fromConfigure = from->u.unmapNotify.fromConfigure;
+}
+
+void
+SMapNotifyEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.mapNotify.event, to->u.mapNotify.event);
+ cpswapl(from->u.mapNotify.window, to->u.mapNotify.window);
+ to->u.mapNotify.override = from->u.mapNotify.override;
+}
+
+void
+SMapRequestEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.mapRequest.parent, to->u.mapRequest.parent);
+ cpswapl(from->u.mapRequest.window, to->u.mapRequest.window);
+}
+
+void
+SReparentEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.reparent.event, to->u.reparent.event);
+ cpswapl(from->u.reparent.window, to->u.reparent.window);
+ cpswapl(from->u.reparent.parent, to->u.reparent.parent);
+ cpswaps(from->u.reparent.x, to->u.reparent.x);
+ cpswaps(from->u.reparent.y, to->u.reparent.y);
+ to->u.reparent.override = from->u.reparent.override;
+}
+
+void
+SConfigureNotifyEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.configureNotify.event,
+ to->u.configureNotify.event);
+ cpswapl(from->u.configureNotify.window,
+ to->u.configureNotify.window);
+ cpswapl(from->u.configureNotify.aboveSibling,
+ to->u.configureNotify.aboveSibling);
+ cpswaps(from->u.configureNotify.x, to->u.configureNotify.x);
+ cpswaps(from->u.configureNotify.y, to->u.configureNotify.y);
+ cpswaps(from->u.configureNotify.width, to->u.configureNotify.width);
+ cpswaps(from->u.configureNotify.height,
+ to->u.configureNotify.height);
+ cpswaps(from->u.configureNotify.borderWidth,
+ to->u.configureNotify.borderWidth);
+ to->u.configureNotify.override = from->u.configureNotify.override;
+}
+
+void
+SConfigureRequestEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ to->u.u.detail = from->u.u.detail; /* actually stack-mode */
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.configureRequest.parent,
+ to->u.configureRequest.parent);
+ cpswapl(from->u.configureRequest.window,
+ to->u.configureRequest.window);
+ cpswapl(from->u.configureRequest.sibling,
+ to->u.configureRequest.sibling);
+ cpswaps(from->u.configureRequest.x, to->u.configureRequest.x);
+ cpswaps(from->u.configureRequest.y, to->u.configureRequest.y);
+ cpswaps(from->u.configureRequest.width,
+ to->u.configureRequest.width);
+ cpswaps(from->u.configureRequest.height,
+ to->u.configureRequest.height);
+ cpswaps(from->u.configureRequest.borderWidth,
+ to->u.configureRequest.borderWidth);
+ cpswaps(from->u.configureRequest.valueMask,
+ to->u.configureRequest.valueMask);
+}
+
+
+void
+SGravityEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.gravity.event, to->u.gravity.event);
+ cpswapl(from->u.gravity.window, to->u.gravity.window);
+ cpswaps(from->u.gravity.x, to->u.gravity.x);
+ cpswaps(from->u.gravity.y, to->u.gravity.y);
+}
+
+void
+SResizeRequestEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.resizeRequest.window, to->u.resizeRequest.window);
+ cpswaps(from->u.resizeRequest.width, to->u.resizeRequest.width);
+ cpswaps(from->u.resizeRequest.height, to->u.resizeRequest.height);
+}
+
+void
+SCirculateEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ to->u.u.detail = from->u.u.detail;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.circulate.event, to->u.circulate.event);
+ cpswapl(from->u.circulate.window, to->u.circulate.window);
+ cpswapl(from->u.circulate.parent, to->u.circulate.parent);
+ to->u.circulate.place = from->u.circulate.place;
+}
+
+void
+SPropertyEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.property.window, to->u.property.window);
+ cpswapl(from->u.property.atom, to->u.property.atom);
+ cpswapl(from->u.property.time, to->u.property.time);
+ to->u.property.state = from->u.property.state;
+}
+
+void
+SSelectionClearEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.selectionClear.time, to->u.selectionClear.time);
+ cpswapl(from->u.selectionClear.window, to->u.selectionClear.window);
+ cpswapl(from->u.selectionClear.atom, to->u.selectionClear.atom);
+}
+
+void
+SSelectionRequestEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.selectionRequest.time, to->u.selectionRequest.time);
+ cpswapl(from->u.selectionRequest.owner,
+ to->u.selectionRequest.owner);
+ cpswapl(from->u.selectionRequest.requestor,
+ to->u.selectionRequest.requestor);
+ cpswapl(from->u.selectionRequest.selection,
+ to->u.selectionRequest.selection);
+ cpswapl(from->u.selectionRequest.target,
+ to->u.selectionRequest.target);
+ cpswapl(from->u.selectionRequest.property,
+ to->u.selectionRequest.property);
+}
+
+void
+SSelectionNotifyEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.selectionNotify.time, to->u.selectionNotify.time);
+ cpswapl(from->u.selectionNotify.requestor,
+ to->u.selectionNotify.requestor);
+ cpswapl(from->u.selectionNotify.selection,
+ to->u.selectionNotify.selection);
+ cpswapl(from->u.selectionNotify.target,
+ to->u.selectionNotify.target);
+ cpswapl(from->u.selectionNotify.property,
+ to->u.selectionNotify.property);
+}
+
+void
+SColormapEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.colormap.window, to->u.colormap.window);
+ cpswapl(from->u.colormap.colormap, to->u.colormap.colormap);
+ to->u.colormap.new = from->u.colormap.new;
+ to->u.colormap.state = from->u.colormap.state;
+}
+
+void
+SMappingEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ to->u.mappingNotify.request = from->u.mappingNotify.request;
+ to->u.mappingNotify.firstKeyCode =
+ from->u.mappingNotify.firstKeyCode;
+ to->u.mappingNotify.count = from->u.mappingNotify.count;
+}
+
+void
+SClientMessageEvent(xEvent *from, xEvent *to)
+{
+ to->u.u.type = from->u.u.type;
+ to->u.u.detail = from->u.u.detail; /* actually format */
+ cpswaps(from->u.u.sequenceNumber, to->u.u.sequenceNumber);
+ cpswapl(from->u.clientMessage.window, to->u.clientMessage.window);
+ cpswapl(from->u.clientMessage.u.l.type,
+ to->u.clientMessage.u.l.type);
+ switch (from->u.u.detail) {
+ case 8:
+ memmove(to->u.clientMessage.u.b.bytes,
+ from->u.clientMessage.u.b.bytes,20);
+ break;
+ case 16:
+ cpswaps(from->u.clientMessage.u.s.shorts0,
+ to->u.clientMessage.u.s.shorts0);
+ cpswaps(from->u.clientMessage.u.s.shorts1,
+ to->u.clientMessage.u.s.shorts1);
+ cpswaps(from->u.clientMessage.u.s.shorts2,
+ to->u.clientMessage.u.s.shorts2);
+ cpswaps(from->u.clientMessage.u.s.shorts3,
+ to->u.clientMessage.u.s.shorts3);
+ cpswaps(from->u.clientMessage.u.s.shorts4,
+ to->u.clientMessage.u.s.shorts4);
+ cpswaps(from->u.clientMessage.u.s.shorts5,
+ to->u.clientMessage.u.s.shorts5);
+ cpswaps(from->u.clientMessage.u.s.shorts6,
+ to->u.clientMessage.u.s.shorts6);
+ cpswaps(from->u.clientMessage.u.s.shorts7,
+ to->u.clientMessage.u.s.shorts7);
+ cpswaps(from->u.clientMessage.u.s.shorts8,
+ to->u.clientMessage.u.s.shorts8);
+ cpswaps(from->u.clientMessage.u.s.shorts9,
+ to->u.clientMessage.u.s.shorts9);
+ break;
+ case 32:
+ cpswapl(from->u.clientMessage.u.l.longs0,
+ to->u.clientMessage.u.l.longs0);
+ cpswapl(from->u.clientMessage.u.l.longs1,
+ to->u.clientMessage.u.l.longs1);
+ cpswapl(from->u.clientMessage.u.l.longs2,
+ to->u.clientMessage.u.l.longs2);
+ cpswapl(from->u.clientMessage.u.l.longs3,
+ to->u.clientMessage.u.l.longs3);
+ cpswapl(from->u.clientMessage.u.l.longs4,
+ to->u.clientMessage.u.l.longs4);
+ break;
+ }
+}
+
+void
+SKeymapNotifyEvent(xEvent *from, xEvent *to)
+{
+ /* Keymap notify events are special; they have no
+ sequence number field, and contain entirely 8-bit data */
+ *to = *from;
+}
+
+static void
+SwapConnSetup(xConnSetup *pConnSetup, xConnSetup *pConnSetupT)
+{
+ cpswapl(pConnSetup->release, pConnSetupT->release);
+ cpswapl(pConnSetup->ridBase, pConnSetupT->ridBase);
+ cpswapl(pConnSetup->ridMask, pConnSetupT->ridMask);
+ cpswapl(pConnSetup->motionBufferSize, pConnSetupT->motionBufferSize);
+ cpswaps(pConnSetup->nbytesVendor, pConnSetupT->nbytesVendor);
+ cpswaps(pConnSetup->maxRequestSize, pConnSetupT->maxRequestSize);
+ pConnSetupT->minKeyCode = pConnSetup->minKeyCode;
+ pConnSetupT->maxKeyCode = pConnSetup->maxKeyCode;
+ pConnSetupT->numRoots = pConnSetup->numRoots;
+ pConnSetupT->numFormats = pConnSetup->numFormats;
+ pConnSetupT->imageByteOrder = pConnSetup->imageByteOrder;
+ pConnSetupT->bitmapBitOrder = pConnSetup->bitmapBitOrder;
+ pConnSetupT->bitmapScanlineUnit = pConnSetup->bitmapScanlineUnit;
+ pConnSetupT->bitmapScanlinePad = pConnSetup->bitmapScanlinePad;
+}
+
+static void
+SwapWinRoot(xWindowRoot *pRoot, xWindowRoot *pRootT)
+{
+ cpswapl(pRoot->windowId, pRootT->windowId);
+ cpswapl(pRoot->defaultColormap, pRootT->defaultColormap);
+ cpswapl(pRoot->whitePixel, pRootT->whitePixel);
+ cpswapl(pRoot->blackPixel, pRootT->blackPixel);
+ cpswapl(pRoot->currentInputMask, pRootT->currentInputMask);
+ cpswaps(pRoot->pixWidth, pRootT->pixWidth);
+ cpswaps(pRoot->pixHeight, pRootT->pixHeight);
+ cpswaps(pRoot->mmWidth, pRootT->mmWidth);
+ cpswaps(pRoot->mmHeight, pRootT->mmHeight);
+ cpswaps(pRoot->minInstalledMaps, pRootT->minInstalledMaps);
+ cpswaps(pRoot->maxInstalledMaps, pRootT->maxInstalledMaps);
+ cpswapl(pRoot->rootVisualID, pRootT->rootVisualID);
+ pRootT->backingStore = pRoot->backingStore;
+ pRootT->saveUnders = pRoot->saveUnders;
+ pRootT->rootDepth = pRoot->rootDepth;
+ pRootT->nDepths = pRoot->nDepths;
+}
+
+static void
+SwapVisual(xVisualType *pVis, xVisualType *pVisT)
+{
+ cpswapl(pVis->visualID, pVisT->visualID);
+ pVisT->class = pVis->class;
+ pVisT->bitsPerRGB = pVis->bitsPerRGB;
+ cpswaps(pVis->colormapEntries, pVisT->colormapEntries);
+ cpswapl(pVis->redMask, pVisT->redMask);
+ cpswapl(pVis->greenMask, pVisT->greenMask);
+ cpswapl(pVis->blueMask, pVisT->blueMask);
+}
+
+void
+SwapConnSetupInfo(
+ char *pInfo,
+ char *pInfoT
+)
+{
+ int i, j, k;
+ xConnSetup *pConnSetup = (xConnSetup *)pInfo;
+ xDepth *depth;
+ xWindowRoot *root;
+
+ SwapConnSetup(pConnSetup, (xConnSetup *)pInfoT);
+ pInfo += sizeof(xConnSetup);
+ pInfoT += sizeof(xConnSetup);
+
+ /* Copy the vendor string */
+ i = pad_to_int32(pConnSetup->nbytesVendor);
+ memcpy(pInfoT, pInfo, i);
+ pInfo += i;
+ pInfoT += i;
+
+ /* The Pixmap formats don't need to be swapped, just copied. */
+ i = sizeof(xPixmapFormat) * pConnSetup->numFormats;
+ memcpy(pInfoT, pInfo, i);
+ pInfo += i;
+ pInfoT += i;
+
+ for(i = 0; i < pConnSetup->numRoots; i++)
+ {
+ root = (xWindowRoot*)pInfo;
+ SwapWinRoot(root, (xWindowRoot *)pInfoT);
+ pInfo += sizeof(xWindowRoot);
+ pInfoT += sizeof(xWindowRoot);
+
+ for(j = 0; j < root->nDepths; j++)
+ {
+ depth = (xDepth*)pInfo;
+ ((xDepth *)pInfoT)->depth = depth->depth;
+ cpswaps(depth->nVisuals, ((xDepth *)pInfoT)->nVisuals);
+ pInfo += sizeof(xDepth);
+ pInfoT += sizeof(xDepth);
+ for(k = 0; k < depth->nVisuals; k++)
+ {
+ SwapVisual((xVisualType *)pInfo, (xVisualType *)pInfoT);
+ pInfo += sizeof(xVisualType);
+ pInfoT += sizeof(xVisualType);
+ }
+ }
+ }
+}
+
+void
+WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo)
+{
+ char *pInfoTBase;
+
+ pInfoTBase = malloc(size);
+ if (!pInfoTBase)
+ {
+ pClient->noClientException = -1;
+ return;
+ }
+ SwapConnSetupInfo(pInfo, pInfoTBase);
+ (void)WriteToClient(pClient, (int)size, (char *) pInfoTBase);
+ free(pInfoTBase);
+}
+
+void
+SwapConnSetupPrefix(xConnSetupPrefix *pcspFrom, xConnSetupPrefix *pcspTo)
+{
+ pcspTo->success = pcspFrom->success;
+ pcspTo->lengthReason = pcspFrom->lengthReason;
+ cpswaps(pcspFrom->majorVersion, pcspTo->majorVersion);
+ cpswaps(pcspFrom->minorVersion, pcspTo->minorVersion);
+ cpswaps(pcspFrom->length, pcspTo->length);
+}
+
+void
+WriteSConnSetupPrefix(ClientPtr pClient, xConnSetupPrefix *pcsp)
+{
+ xConnSetupPrefix cspT;
+
+ SwapConnSetupPrefix(pcsp, &cspT);
+ (void)WriteToClient(pClient, sizeof(cspT), (char *) &cspT);
+}
+
+/*
+ * Dummy entry for ReplySwapVector[]
+ */
+
+void
+ReplyNotSwappd(
+ ClientPtr pClient ,
+ int size ,
+ void * pbuf
+ )
+{
+ FatalError("Not implemented");
+}
+
diff --git a/xorg-server/dix/swapreq.c b/xorg-server/dix/swapreq.c
index 4fbb6ebda..d07cd10d3 100644
--- a/xorg-server/dix/swapreq.c
+++ b/xorg-server/dix/swapreq.c
@@ -1,1099 +1,1017 @@
-/************************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-********************************************************/
-
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/Xprotostr.h>
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h" /* for SendEvent */
-#include "swapreq.h"
-
-/* Thanks to Jack Palevich for testing and subsequently rewriting all this */
-
-/* Byte swap a list of longs */
-void
-SwapLongs (CARD32 *list, unsigned long count)
-{
- char n;
-
- while (count >= 8) {
- swapl(list+0, n);
- swapl(list+1, n);
- swapl(list+2, n);
- swapl(list+3, n);
- swapl(list+4, n);
- swapl(list+5, n);
- swapl(list+6, n);
- swapl(list+7, n);
- list += 8;
- count -= 8;
- }
- if (count != 0) {
- do {
- swapl(list, n);
- list++;
- } while (--count != 0);
- }
-}
-
-/* Byte swap a list of shorts */
-void
-SwapShorts (short *list, unsigned long count)
-{
- char n;
-
- while (count >= 16) {
- swaps(list+0, n);
- swaps(list+1, n);
- swaps(list+2, n);
- swaps(list+3, n);
- swaps(list+4, n);
- swaps(list+5, n);
- swaps(list+6, n);
- swaps(list+7, n);
- swaps(list+8, n);
- swaps(list+9, n);
- swaps(list+10, n);
- swaps(list+11, n);
- swaps(list+12, n);
- swaps(list+13, n);
- swaps(list+14, n);
- swaps(list+15, n);
- list += 16;
- count -= 16;
- }
- if (count != 0) {
- do {
- swaps(list, n);
- list++;
- } while (--count != 0);
- }
-}
-
-/* The following is used for all requests that have
- no fields to be swapped (except "length") */
-int
-SProcSimpleReq(ClientPtr client)
-{
- char n;
-
- REQUEST(xReq);
- swaps(&stuff->length, n);
- return(*ProcVector[stuff->reqType])(client);
-}
-
-/* The following is used for all requests that have
- only a single 32-bit field to be swapped, coming
- right after the "length" field */
-int
-SProcResourceReq(ClientPtr client)
-{
- char n;
-
- REQUEST(xResourceReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xResourceReq); /* not EXACT */
- swapl(&stuff->id, n);
- return(*ProcVector[stuff->reqType])(client);
-}
-
-int
-SProcCreateWindow(ClientPtr client)
-{
- char n;
-
- REQUEST(xCreateWindowReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xCreateWindowReq);
- swapl(&stuff->wid, n);
- swapl(&stuff->parent, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- swaps(&stuff->borderWidth, n);
- swaps(&stuff->class, n);
- swapl(&stuff->visual, n);
- swapl(&stuff->mask, n);
- SwapRestL(stuff);
- return((* ProcVector[X_CreateWindow])(client));
-}
-
-int
-SProcChangeWindowAttributes(ClientPtr client)
-{
- char n;
-
- REQUEST(xChangeWindowAttributesReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
- swapl(&stuff->window, n);
- swapl(&stuff->valueMask, n);
- SwapRestL(stuff);
- return((* ProcVector[X_ChangeWindowAttributes])(client));
-}
-
-int
-SProcReparentWindow(ClientPtr client)
-{
- char n;
- REQUEST(xReparentWindowReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xReparentWindowReq);
- swapl(&stuff->window, n);
- swapl(&stuff->parent, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- return((* ProcVector[X_ReparentWindow])(client));
-}
-
-int
-SProcConfigureWindow(ClientPtr client)
-{
- char n;
- REQUEST(xConfigureWindowReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
- swapl(&stuff->window, n);
- swaps(&stuff->mask, n);
- SwapRestL(stuff);
- return((* ProcVector[X_ConfigureWindow])(client));
-
-}
-
-
-int
-SProcInternAtom(ClientPtr client)
-{
- char n;
- REQUEST(xInternAtomReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xInternAtomReq);
- swaps(&stuff->nbytes, n);
- return((* ProcVector[X_InternAtom])(client));
-}
-
-int
-SProcChangeProperty(ClientPtr client)
-{
- char n;
- REQUEST(xChangePropertyReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xChangePropertyReq);
- swapl(&stuff->window, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->nUnits, n);
- switch ( stuff->format ) {
- case 8 :
- break;
- case 16:
- SwapRestS(stuff);
- break;
- case 32:
- SwapRestL(stuff);
- break;
- }
- return((* ProcVector[X_ChangeProperty])(client));
-}
-
-int
-SProcDeleteProperty(ClientPtr client)
-{
- char n;
- REQUEST(xDeletePropertyReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDeletePropertyReq);
- swapl(&stuff->window, n);
- swapl(&stuff->property, n);
- return((* ProcVector[X_DeleteProperty])(client));
-
-}
-
-int
-SProcGetProperty(ClientPtr client)
-{
- char n;
- REQUEST(xGetPropertyReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGetPropertyReq);
- swapl(&stuff->window, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->longOffset, n);
- swapl(&stuff->longLength, n);
- return((* ProcVector[X_GetProperty])(client));
-}
-
-int
-SProcSetSelectionOwner(ClientPtr client)
-{
- char n;
- REQUEST(xSetSelectionOwnerReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xSetSelectionOwnerReq);
- swapl(&stuff->window, n);
- swapl(&stuff->selection, n);
- swapl(&stuff->time, n);
- return((* ProcVector[X_SetSelectionOwner])(client));
-}
-
-int
-SProcConvertSelection(ClientPtr client)
-{
- char n;
- REQUEST(xConvertSelectionReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xConvertSelectionReq);
- swapl(&stuff->requestor, n);
- swapl(&stuff->selection, n);
- swapl(&stuff->target, n);
- swapl(&stuff->property, n);
- swapl(&stuff->time, n);
- return((* ProcVector[X_ConvertSelection])(client));
-}
-
-int
-SProcSendEvent(ClientPtr client)
-{
- char n;
- xEvent eventT;
- EventSwapPtr proc;
- REQUEST(xSendEventReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xSendEventReq);
- swapl(&stuff->destination, n);
- swapl(&stuff->eventMask, n);
-
- /* Swap event */
- proc = EventSwapVector[stuff->event.u.u.type & 0177];
- if (!proc || proc == NotImplemented) /* no swapping proc; invalid event type? */
- return BadValue;
- (*proc)(&stuff->event, &eventT);
- stuff->event = eventT;
-
- return((* ProcVector[X_SendEvent])(client));
-}
-
-int
-SProcGrabPointer(ClientPtr client)
-{
- char n;
- REQUEST(xGrabPointerReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGrabPointerReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->eventMask, n);
- swapl(&stuff->confineTo, n);
- swapl(&stuff->cursor, n);
- swapl(&stuff->time, n);
- return((* ProcVector[X_GrabPointer])(client));
-}
-
-int
-SProcGrabButton(ClientPtr client)
-{
- char n;
- REQUEST(xGrabButtonReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGrabButtonReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->eventMask, n);
- swapl(&stuff->confineTo, n);
- swapl(&stuff->cursor, n);
- swaps(&stuff->modifiers, n);
- return((* ProcVector[X_GrabButton])(client));
-}
-
-int
-SProcUngrabButton(ClientPtr client)
-{
- char n;
- REQUEST(xUngrabButtonReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xUngrabButtonReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
- return((* ProcVector[X_UngrabButton])(client));
-}
-
-int
-SProcChangeActivePointerGrab(ClientPtr client)
-{
- char n;
- REQUEST(xChangeActivePointerGrabReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq);
- swapl(&stuff->cursor, n);
- swapl(&stuff->time, n);
- swaps(&stuff->eventMask, n);
- return((* ProcVector[X_ChangeActivePointerGrab])(client));
-}
-
-int
-SProcGrabKeyboard(ClientPtr client)
-{
- char n;
- REQUEST(xGrabKeyboardReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGrabKeyboardReq);
- swapl(&stuff->grabWindow, n);
- swapl(&stuff->time, n);
- return((* ProcVector[X_GrabKeyboard])(client));
-}
-
-int
-SProcGrabKey(ClientPtr client)
-{
- char n;
- REQUEST(xGrabKeyReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGrabKeyReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
- return((* ProcVector[X_GrabKey])(client));
-}
-
-int
-SProcUngrabKey(ClientPtr client)
-{
- char n;
- REQUEST(xUngrabKeyReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xUngrabKeyReq);
- swapl(&stuff->grabWindow, n);
- swaps(&stuff->modifiers, n);
- return((* ProcVector[X_UngrabKey])(client));
-}
-
-int
-SProcGetMotionEvents(ClientPtr client)
-{
- char n;
- REQUEST(xGetMotionEventsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGetMotionEventsReq);
- swapl(&stuff->window, n);
- swapl(&stuff->start, n);
- swapl(&stuff->stop, n);
- return((* ProcVector[X_GetMotionEvents])(client));
-}
-
-int
-SProcTranslateCoords(ClientPtr client)
-{
- char n;
- REQUEST(xTranslateCoordsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xTranslateCoordsReq);
- swapl(&stuff->srcWid, n);
- swapl(&stuff->dstWid, n);
- swaps(&stuff->srcX, n);
- swaps(&stuff->srcY, n);
- return((* ProcVector[X_TranslateCoords])(client));
-}
-
-int
-SProcWarpPointer(ClientPtr client)
-{
- char n;
- REQUEST(xWarpPointerReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xWarpPointerReq);
- swapl(&stuff->srcWid, n);
- swapl(&stuff->dstWid, n);
- swaps(&stuff->srcX, n);
- swaps(&stuff->srcY, n);
- swaps(&stuff->srcWidth, n);
- swaps(&stuff->srcHeight, n);
- swaps(&stuff->dstX, n);
- swaps(&stuff->dstY, n);
- return((* ProcVector[X_WarpPointer])(client));
-}
-
-int
-SProcSetInputFocus(ClientPtr client)
-{
- char n;
- REQUEST(xSetInputFocusReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xSetInputFocusReq);
- swapl(&stuff->focus, n);
- swapl(&stuff->time, n);
- return((* ProcVector[X_SetInputFocus])(client));
-}
-
-int
-SProcOpenFont(ClientPtr client)
-{
- char n;
- REQUEST(xOpenFontReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xOpenFontReq);
- swapl(&stuff->fid, n);
- swaps(&stuff->nbytes, n);
- return((* ProcVector[X_OpenFont])(client));
-}
-
-int
-SProcListFonts(ClientPtr client)
-{
- char n;
- REQUEST(xListFontsReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xListFontsReq);
- swaps(&stuff->maxNames, n);
- swaps(&stuff->nbytes, n);
- return((* ProcVector[X_ListFonts])(client));
-}
-
-int
-SProcListFontsWithInfo(ClientPtr client)
-{
- char n;
- REQUEST(xListFontsWithInfoReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xListFontsWithInfoReq);
- swaps(&stuff->maxNames, n);
- swaps(&stuff->nbytes, n);
- return((* ProcVector[X_ListFontsWithInfo])(client));
-}
-
-int
-SProcSetFontPath(ClientPtr client)
-{
- char n;
- REQUEST(xSetFontPathReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSetFontPathReq);
- swaps(&stuff->nFonts, n);
- return((* ProcVector[X_SetFontPath])(client));
-}
-
-int
-SProcCreatePixmap(ClientPtr client)
-{
- char n;
- REQUEST(xCreatePixmapReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCreatePixmapReq);
- swapl(&stuff->pid, n);
- swapl(&stuff->drawable, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- return((* ProcVector[X_CreatePixmap])(client));
-}
-
-int
-SProcCreateGC(ClientPtr client)
-{
- char n;
- REQUEST(xCreateGCReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xCreateGCReq);
- swapl(&stuff->gc, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->mask, n);
- SwapRestL(stuff);
- return((* ProcVector[X_CreateGC])(client));
-}
-
-int
-SProcChangeGC(ClientPtr client)
-{
- char n;
- REQUEST(xChangeGCReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xChangeGCReq);
- swapl(&stuff->gc, n);
- swapl(&stuff->mask, n);
- SwapRestL(stuff);
- return((* ProcVector[X_ChangeGC])(client));
-}
-
-int
-SProcCopyGC(ClientPtr client)
-{
- char n;
- REQUEST(xCopyGCReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCopyGCReq);
- swapl(&stuff->srcGC, n);
- swapl(&stuff->dstGC, n);
- swapl(&stuff->mask, n);
- return((* ProcVector[X_CopyGC])(client));
-}
-
-int
-SProcSetDashes(ClientPtr client)
-{
- char n;
- REQUEST(xSetDashesReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSetDashesReq);
- swapl(&stuff->gc, n);
- swaps(&stuff->dashOffset, n);
- swaps(&stuff->nDashes, n);
- return((* ProcVector[X_SetDashes])(client));
-
-}
-
-int
-SProcSetClipRectangles(ClientPtr client)
-{
- char n;
- REQUEST(xSetClipRectanglesReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq);
- swapl(&stuff->gc, n);
- swaps(&stuff->xOrigin, n);
- swaps(&stuff->yOrigin, n);
- SwapRestS(stuff);
- return((* ProcVector[X_SetClipRectangles])(client));
-}
-
-int
-SProcClearToBackground(ClientPtr client)
-{
- char n;
- REQUEST(xClearAreaReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xClearAreaReq);
- swapl(&stuff->window, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- return((* ProcVector[X_ClearArea])(client));
-}
-
-int
-SProcCopyArea(ClientPtr client)
-{
- char n;
- REQUEST(xCopyAreaReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCopyAreaReq);
- swapl(&stuff->srcDrawable, n);
- swapl(&stuff->dstDrawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->srcX, n);
- swaps(&stuff->srcY, n);
- swaps(&stuff->dstX, n);
- swaps(&stuff->dstY, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- return((* ProcVector[X_CopyArea])(client));
-}
-
-int
-SProcCopyPlane(ClientPtr client)
-{
- char n;
- REQUEST(xCopyPlaneReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCopyPlaneReq);
- swapl(&stuff->srcDrawable, n);
- swapl(&stuff->dstDrawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->srcX, n);
- swaps(&stuff->srcY, n);
- swaps(&stuff->dstX, n);
- swaps(&stuff->dstY, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- swapl(&stuff->bitPlane, n);
- return((* ProcVector[X_CopyPlane])(client));
-}
-
-/* The following routine is used for all Poly drawing requests
- (except FillPoly, which uses a different request format) */
-int
-SProcPoly(ClientPtr client)
-{
- char n;
-
- REQUEST(xPolyPointReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xPolyPointReq);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- SwapRestS(stuff);
- return((* ProcVector[stuff->reqType])(client));
-}
-
-/* cannot use SProcPoly for this one, because xFillPolyReq
- is longer than xPolyPointReq, and we don't want to swap
- the difference as shorts! */
-int
-SProcFillPoly(ClientPtr client)
-{
- char n;
-
- REQUEST(xFillPolyReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xFillPolyReq);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- SwapRestS(stuff);
- return((* ProcVector[X_FillPoly])(client));
-}
-
-int
-SProcPutImage(ClientPtr client)
-{
- char n;
- REQUEST(xPutImageReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xPutImageReq);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- swaps(&stuff->dstX, n);
- swaps(&stuff->dstY, n);
- /* Image should already be swapped */
- return((* ProcVector[X_PutImage])(client));
-
-}
-
-int
-SProcGetImage(ClientPtr client)
-{
- char n;
- REQUEST(xGetImageReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xGetImageReq);
- swapl(&stuff->drawable, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- swapl(&stuff->planeMask, n);
- return((* ProcVector[X_GetImage])(client));
-}
-
-/* ProcPolyText used for both PolyText8 and PolyText16 */
-
-int
-SProcPolyText(ClientPtr client)
-{
- char n;
- REQUEST(xPolyTextReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xPolyTextReq);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- return((* ProcVector[stuff->reqType])(client));
-}
-
-/* ProcImageText used for both ImageText8 and ImageText16 */
-
-int
-SProcImageText(ClientPtr client)
-{
- char n;
- REQUEST(xImageTextReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xImageTextReq);
- swapl(&stuff->drawable, n);
- swapl(&stuff->gc, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- return((* ProcVector[stuff->reqType])(client));
-}
-
-int
-SProcCreateColormap(ClientPtr client)
-{
- char n;
- REQUEST(xCreateColormapReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCreateColormapReq);
- swapl(&stuff->mid, n);
- swapl(&stuff->window, n);
- swapl(&stuff->visual, n);
- return((* ProcVector[X_CreateColormap])(client));
-}
-
-
-int
-SProcCopyColormapAndFree(ClientPtr client)
-{
- char n;
- REQUEST(xCopyColormapAndFreeReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq);
- swapl(&stuff->mid, n);
- swapl(&stuff->srcCmap, n);
- return((* ProcVector[X_CopyColormapAndFree])(client));
-
-}
-
-int
-SProcAllocColor(ClientPtr client)
-{
- char n;
- REQUEST(xAllocColorReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xAllocColorReq);
- swapl(&stuff->cmap, n);
- swaps(&stuff->red, n);
- swaps(&stuff->green, n);
- swaps(&stuff->blue, n);
- return((* ProcVector[X_AllocColor])(client));
-}
-
-int
-SProcAllocNamedColor(ClientPtr client)
-{
- char n;
-
- REQUEST(xAllocNamedColorReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xAllocNamedColorReq);
- swapl(&stuff->cmap, n);
- swaps(&stuff->nbytes, n);
- return((* ProcVector[X_AllocNamedColor])(client));
-}
-
-int
-SProcAllocColorCells(ClientPtr client)
-{
- char n;
- REQUEST(xAllocColorCellsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xAllocColorCellsReq);
- swapl(&stuff->cmap, n);
- swaps(&stuff->colors, n);
- swaps(&stuff->planes, n);
- return((* ProcVector[X_AllocColorCells])(client));
-}
-
-int
-SProcAllocColorPlanes(ClientPtr client)
-{
- char n;
- REQUEST(xAllocColorPlanesReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xAllocColorPlanesReq);
- swapl(&stuff->cmap, n);
- swaps(&stuff->colors, n);
- swaps(&stuff->red, n);
- swaps(&stuff->green, n);
- swaps(&stuff->blue, n);
- return((* ProcVector[X_AllocColorPlanes])(client));
-}
-
-int
-SProcFreeColors(ClientPtr client)
-{
- char n;
- REQUEST(xFreeColorsReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xFreeColorsReq);
- swapl(&stuff->cmap, n);
- swapl(&stuff->planeMask, n);
- SwapRestL(stuff);
- return((* ProcVector[X_FreeColors])(client));
-
-}
-
-void
-SwapColorItem(xColorItem *pItem)
-{
- char n;
-
- swapl(&pItem->pixel, n);
- swaps(&pItem->red, n);
- swaps(&pItem->green, n);
- swaps(&pItem->blue, n);
-}
-
-int
-SProcStoreColors(ClientPtr client)
-{
- char n;
- long count;
- xColorItem *pItem;
-
- REQUEST(xStoreColorsReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
- swapl(&stuff->cmap, n);
- pItem = (xColorItem *) &stuff[1];
- for(count = LengthRestB(stuff)/sizeof(xColorItem); --count >= 0; )
- SwapColorItem(pItem++);
- return((* ProcVector[X_StoreColors])(client));
-}
-
-int
-SProcStoreNamedColor (ClientPtr client)
-{
- char n;
- REQUEST(xStoreNamedColorReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xStoreNamedColorReq);
- swapl(&stuff->cmap, n);
- swapl(&stuff->pixel, n);
- swaps(&stuff->nbytes, n);
- return((* ProcVector[X_StoreNamedColor])(client));
-}
-
-int
-SProcQueryColors (ClientPtr client)
-{
- char n;
- REQUEST(xQueryColorsReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xQueryColorsReq);
- swapl(&stuff->cmap, n);
- SwapRestL(stuff);
- return((* ProcVector[X_QueryColors])(client));
-}
-
-int
-SProcLookupColor (ClientPtr client)
-{
- char n;
- REQUEST(xLookupColorReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xLookupColorReq);
- swapl(&stuff->cmap, n);
- swaps(&stuff->nbytes, n);
- return((* ProcVector[X_LookupColor])(client));
-}
-
-int
-SProcCreateCursor (ClientPtr client)
-{
- char n;
- REQUEST(xCreateCursorReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCreateCursorReq);
- swapl(&stuff->cid, n);
- swapl(&stuff->source, n);
- swapl(&stuff->mask, n);
- swaps(&stuff->foreRed, n);
- swaps(&stuff->foreGreen, n);
- swaps(&stuff->foreBlue, n);
- swaps(&stuff->backRed, n);
- swaps(&stuff->backGreen, n);
- swaps(&stuff->backBlue, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- return((* ProcVector[X_CreateCursor])(client));
-}
-
-int
-SProcCreateGlyphCursor (ClientPtr client)
-{
- char n;
- REQUEST(xCreateGlyphCursorReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xCreateGlyphCursorReq);
- swapl(&stuff->cid, n);
- swapl(&stuff->source, n);
- swapl(&stuff->mask, n);
- swaps(&stuff->sourceChar, n);
- swaps(&stuff->maskChar, n);
- swaps(&stuff->foreRed, n);
- swaps(&stuff->foreGreen, n);
- swaps(&stuff->foreBlue, n);
- swaps(&stuff->backRed, n);
- swaps(&stuff->backGreen, n);
- swaps(&stuff->backBlue, n);
- return((* ProcVector[X_CreateGlyphCursor])(client));
-}
-
-
-int
-SProcRecolorCursor (ClientPtr client)
-{
- char n;
- REQUEST(xRecolorCursorReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xRecolorCursorReq);
- swapl(&stuff->cursor, n);
- swaps(&stuff->foreRed, n);
- swaps(&stuff->foreGreen, n);
- swaps(&stuff->foreBlue, n);
- swaps(&stuff->backRed, n);
- swaps(&stuff->backGreen, n);
- swaps(&stuff->backBlue, n);
- return((* ProcVector[X_RecolorCursor])(client));
-}
-
-int
-SProcQueryBestSize (ClientPtr client)
-{
- char n;
- REQUEST(xQueryBestSizeReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xQueryBestSizeReq);
- swapl(&stuff->drawable, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- return((* ProcVector[X_QueryBestSize])(client));
-
-}
-
-int
-SProcQueryExtension (ClientPtr client)
-{
- char n;
- REQUEST(xQueryExtensionReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xQueryExtensionReq);
- swaps(&stuff->nbytes, n);
- return((* ProcVector[X_QueryExtension])(client));
-}
-
-int
-SProcChangeKeyboardMapping (ClientPtr client)
-{
- char n;
- REQUEST(xChangeKeyboardMappingReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq);
- SwapRestL(stuff);
- return((* ProcVector[X_ChangeKeyboardMapping])(client));
-}
-
-
-int
-SProcChangeKeyboardControl (ClientPtr client)
-{
- char n;
- REQUEST(xChangeKeyboardControlReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq);
- swapl(&stuff->mask, n);
- SwapRestL(stuff);
- return((* ProcVector[X_ChangeKeyboardControl])(client));
-}
-
-int
-SProcChangePointerControl (ClientPtr client)
-{
- char n;
- REQUEST(xChangePointerControlReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xChangePointerControlReq);
- swaps(&stuff->accelNum, n);
- swaps(&stuff->accelDenum, n);
- swaps(&stuff->threshold, n);
- return((* ProcVector[X_ChangePointerControl])(client));
-}
-
-
-int
-SProcSetScreenSaver (ClientPtr client)
-{
- char n;
- REQUEST(xSetScreenSaverReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xSetScreenSaverReq);
- swaps(&stuff->timeout, n);
- swaps(&stuff->interval, n);
- return((* ProcVector[X_SetScreenSaver])(client));
-}
-
-int
-SProcChangeHosts (ClientPtr client)
-{
- char n;
-
- REQUEST(xChangeHostsReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xChangeHostsReq);
- swaps(&stuff->hostLength, n);
- return((* ProcVector[X_ChangeHosts])(client));
-
-}
-
-int SProcRotateProperties (ClientPtr client)
-{
- char n;
- REQUEST(xRotatePropertiesReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xRotatePropertiesReq);
- swapl(&stuff->window, n);
- swaps(&stuff->nAtoms, n);
- swaps(&stuff->nPositions, n);
- SwapRestL(stuff);
- return ((* ProcVector[X_RotateProperties])(client));
-}
-
-int
-SProcNoOperation(ClientPtr client)
-{
- char n;
- REQUEST(xReq);
- swaps(&stuff->length, n);
- return ((* ProcVector[X_NoOperation])(client));
-}
-
-void
-SwapConnClientPrefix(xConnClientPrefix *pCCP)
-{
- char n;
-
- swaps(&pCCP->majorVersion, n);
- swaps(&pCCP->minorVersion, n);
- swaps(&pCCP->nbytesAuthProto, n);
- swaps(&pCCP->nbytesAuthString, n);
-}
+/************************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+********************************************************/
+
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include <X11/Xprotostr.h>
+#include "misc.h"
+#include "dixstruct.h"
+#include "extnsionst.h" /* for SendEvent */
+#include "swapreq.h"
+
+/* Thanks to Jack Palevich for testing and subsequently rewriting all this */
+
+/* Byte swap a list of longs */
+void
+SwapLongs (CARD32 *list, unsigned long count)
+{
+ while (count >= 8) {
+ swapl(list + 0);
+ swapl(list + 1);
+ swapl(list + 2);
+ swapl(list + 3);
+ swapl(list + 4);
+ swapl(list + 5);
+ swapl(list + 6);
+ swapl(list + 7);
+ list += 8;
+ count -= 8;
+ }
+ if (count != 0) {
+ do {
+ swapl(list);
+ list++;
+ } while (--count != 0);
+ }
+}
+
+/* Byte swap a list of shorts */
+void
+SwapShorts (short *list, unsigned long count)
+{
+ while (count >= 16) {
+ swaps(list + 0);
+ swaps(list + 1);
+ swaps(list + 2);
+ swaps(list + 3);
+ swaps(list + 4);
+ swaps(list + 5);
+ swaps(list + 6);
+ swaps(list + 7);
+ swaps(list + 8);
+ swaps(list + 9);
+ swaps(list + 10);
+ swaps(list + 11);
+ swaps(list + 12);
+ swaps(list + 13);
+ swaps(list + 14);
+ swaps(list + 15);
+ list += 16;
+ count -= 16;
+ }
+ if (count != 0) {
+ do {
+ swaps(list);
+ list++;
+ } while (--count != 0);
+ }
+}
+
+/* The following is used for all requests that have
+ no fields to be swapped (except "length") */
+int
+SProcSimpleReq(ClientPtr client)
+{
+ REQUEST(xReq);
+ swaps(&stuff->length);
+ return(*ProcVector[stuff->reqType])(client);
+}
+
+/* The following is used for all requests that have
+ only a single 32-bit field to be swapped, coming
+ right after the "length" field */
+int
+SProcResourceReq(ClientPtr client)
+{
+ REQUEST(xResourceReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xResourceReq); /* not EXACT */
+ swapl(&stuff->id);
+ return(*ProcVector[stuff->reqType])(client);
+}
+
+int
+SProcCreateWindow(ClientPtr client)
+{
+ REQUEST(xCreateWindowReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xCreateWindowReq);
+ swapl(&stuff->wid);
+ swapl(&stuff->parent);
+ swaps(&stuff->x);
+ swaps(&stuff->y);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
+ swaps(&stuff->borderWidth);
+ swaps(&stuff->class);
+ swapl(&stuff->visual);
+ swapl(&stuff->mask);
+ SwapRestL(stuff);
+ return((* ProcVector[X_CreateWindow])(client));
+}
+
+int
+SProcChangeWindowAttributes(ClientPtr client)
+{
+ REQUEST(xChangeWindowAttributesReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
+ swapl(&stuff->window);
+ swapl(&stuff->valueMask);
+ SwapRestL(stuff);
+ return((* ProcVector[X_ChangeWindowAttributes])(client));
+}
+
+int
+SProcReparentWindow(ClientPtr client)
+{
+ REQUEST(xReparentWindowReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xReparentWindowReq);
+ swapl(&stuff->window);
+ swapl(&stuff->parent);
+ swaps(&stuff->x);
+ swaps(&stuff->y);
+ return((* ProcVector[X_ReparentWindow])(client));
+}
+
+int
+SProcConfigureWindow(ClientPtr client)
+{
+ REQUEST(xConfigureWindowReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
+ swapl(&stuff->window);
+ swaps(&stuff->mask);
+ SwapRestL(stuff);
+ return((* ProcVector[X_ConfigureWindow])(client));
+
+}
+
+
+int
+SProcInternAtom(ClientPtr client)
+{
+ REQUEST(xInternAtomReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xInternAtomReq);
+ swaps(&stuff->nbytes);
+ return((* ProcVector[X_InternAtom])(client));
+}
+
+int
+SProcChangeProperty(ClientPtr client)
+{
+ REQUEST(xChangePropertyReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xChangePropertyReq);
+ swapl(&stuff->window);
+ swapl(&stuff->property);
+ swapl(&stuff->type);
+ swapl(&stuff->nUnits);
+ switch ( stuff->format ) {
+ case 8 :
+ break;
+ case 16:
+ SwapRestS(stuff);
+ break;
+ case 32:
+ SwapRestL(stuff);
+ break;
+ }
+ return((* ProcVector[X_ChangeProperty])(client));
+}
+
+int
+SProcDeleteProperty(ClientPtr client)
+{
+ REQUEST(xDeletePropertyReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDeletePropertyReq);
+ swapl(&stuff->window);
+ swapl(&stuff->property);
+ return((* ProcVector[X_DeleteProperty])(client));
+
+}
+
+int
+SProcGetProperty(ClientPtr client)
+{
+ REQUEST(xGetPropertyReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xGetPropertyReq);
+ swapl(&stuff->window);
+ swapl(&stuff->property);
+ swapl(&stuff->type);
+ swapl(&stuff->longOffset);
+ swapl(&stuff->longLength);
+ return((* ProcVector[X_GetProperty])(client));
+}
+
+int
+SProcSetSelectionOwner(ClientPtr client)
+{
+ REQUEST(xSetSelectionOwnerReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xSetSelectionOwnerReq);
+ swapl(&stuff->window);
+ swapl(&stuff->selection);
+ swapl(&stuff->time);
+ return((* ProcVector[X_SetSelectionOwner])(client));
+}
+
+int
+SProcConvertSelection(ClientPtr client)
+{
+ REQUEST(xConvertSelectionReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xConvertSelectionReq);
+ swapl(&stuff->requestor);
+ swapl(&stuff->selection);
+ swapl(&stuff->target);
+ swapl(&stuff->property);
+ swapl(&stuff->time);
+ return((* ProcVector[X_ConvertSelection])(client));
+}
+
+int
+SProcSendEvent(ClientPtr client)
+{
+ xEvent eventT;
+ EventSwapPtr proc;
+ REQUEST(xSendEventReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xSendEventReq);
+ swapl(&stuff->destination);
+ swapl(&stuff->eventMask);
+
+ /* Swap event */
+ proc = EventSwapVector[stuff->event.u.u.type & 0177];
+ if (!proc || proc == NotImplemented) /* no swapping proc; invalid event type? */
+ return BadValue;
+ (*proc)(&stuff->event, &eventT);
+ stuff->event = eventT;
+
+ return((* ProcVector[X_SendEvent])(client));
+}
+
+int
+SProcGrabPointer(ClientPtr client)
+{
+ REQUEST(xGrabPointerReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xGrabPointerReq);
+ swapl(&stuff->grabWindow);
+ swaps(&stuff->eventMask);
+ swapl(&stuff->confineTo);
+ swapl(&stuff->cursor);
+ swapl(&stuff->time);
+ return((* ProcVector[X_GrabPointer])(client));
+}
+
+int
+SProcGrabButton(ClientPtr client)
+{
+ REQUEST(xGrabButtonReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xGrabButtonReq);
+ swapl(&stuff->grabWindow);
+ swaps(&stuff->eventMask);
+ swapl(&stuff->confineTo);
+ swapl(&stuff->cursor);
+ swaps(&stuff->modifiers);
+ return((* ProcVector[X_GrabButton])(client));
+}
+
+int
+SProcUngrabButton(ClientPtr client)
+{
+ REQUEST(xUngrabButtonReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xUngrabButtonReq);
+ swapl(&stuff->grabWindow);
+ swaps(&stuff->modifiers);
+ return((* ProcVector[X_UngrabButton])(client));
+}
+
+int
+SProcChangeActivePointerGrab(ClientPtr client)
+{
+ REQUEST(xChangeActivePointerGrabReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq);
+ swapl(&stuff->cursor);
+ swapl(&stuff->time);
+ swaps(&stuff->eventMask);
+ return((* ProcVector[X_ChangeActivePointerGrab])(client));
+}
+
+int
+SProcGrabKeyboard(ClientPtr client)
+{
+ REQUEST(xGrabKeyboardReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xGrabKeyboardReq);
+ swapl(&stuff->grabWindow);
+ swapl(&stuff->time);
+ return((* ProcVector[X_GrabKeyboard])(client));
+}
+
+int
+SProcGrabKey(ClientPtr client)
+{
+ REQUEST(xGrabKeyReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xGrabKeyReq);
+ swapl(&stuff->grabWindow);
+ swaps(&stuff->modifiers);
+ return((* ProcVector[X_GrabKey])(client));
+}
+
+int
+SProcUngrabKey(ClientPtr client)
+{
+ REQUEST(xUngrabKeyReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xUngrabKeyReq);
+ swapl(&stuff->grabWindow);
+ swaps(&stuff->modifiers);
+ return((* ProcVector[X_UngrabKey])(client));
+}
+
+int
+SProcGetMotionEvents(ClientPtr client)
+{
+ REQUEST(xGetMotionEventsReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xGetMotionEventsReq);
+ swapl(&stuff->window);
+ swapl(&stuff->start);
+ swapl(&stuff->stop);
+ return((* ProcVector[X_GetMotionEvents])(client));
+}
+
+int
+SProcTranslateCoords(ClientPtr client)
+{
+ REQUEST(xTranslateCoordsReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xTranslateCoordsReq);
+ swapl(&stuff->srcWid);
+ swapl(&stuff->dstWid);
+ swaps(&stuff->srcX);
+ swaps(&stuff->srcY);
+ return((* ProcVector[X_TranslateCoords])(client));
+}
+
+int
+SProcWarpPointer(ClientPtr client)
+{
+ REQUEST(xWarpPointerReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xWarpPointerReq);
+ swapl(&stuff->srcWid);
+ swapl(&stuff->dstWid);
+ swaps(&stuff->srcX);
+ swaps(&stuff->srcY);
+ swaps(&stuff->srcWidth);
+ swaps(&stuff->srcHeight);
+ swaps(&stuff->dstX);
+ swaps(&stuff->dstY);
+ return((* ProcVector[X_WarpPointer])(client));
+}
+
+int
+SProcSetInputFocus(ClientPtr client)
+{
+ REQUEST(xSetInputFocusReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xSetInputFocusReq);
+ swapl(&stuff->focus);
+ swapl(&stuff->time);
+ return((* ProcVector[X_SetInputFocus])(client));
+}
+
+int
+SProcOpenFont(ClientPtr client)
+{
+ REQUEST(xOpenFontReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xOpenFontReq);
+ swapl(&stuff->fid);
+ swaps(&stuff->nbytes);
+ return((* ProcVector[X_OpenFont])(client));
+}
+
+int
+SProcListFonts(ClientPtr client)
+{
+ REQUEST(xListFontsReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xListFontsReq);
+ swaps(&stuff->maxNames);
+ swaps(&stuff->nbytes);
+ return((* ProcVector[X_ListFonts])(client));
+}
+
+int
+SProcListFontsWithInfo(ClientPtr client)
+{
+ REQUEST(xListFontsWithInfoReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xListFontsWithInfoReq);
+ swaps(&stuff->maxNames);
+ swaps(&stuff->nbytes);
+ return((* ProcVector[X_ListFontsWithInfo])(client));
+}
+
+int
+SProcSetFontPath(ClientPtr client)
+{
+ REQUEST(xSetFontPathReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xSetFontPathReq);
+ swaps(&stuff->nFonts);
+ return((* ProcVector[X_SetFontPath])(client));
+}
+
+int
+SProcCreatePixmap(ClientPtr client)
+{
+ REQUEST(xCreatePixmapReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xCreatePixmapReq);
+ swapl(&stuff->pid);
+ swapl(&stuff->drawable);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
+ return((* ProcVector[X_CreatePixmap])(client));
+}
+
+int
+SProcCreateGC(ClientPtr client)
+{
+ REQUEST(xCreateGCReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xCreateGCReq);
+ swapl(&stuff->gc);
+ swapl(&stuff->drawable);
+ swapl(&stuff->mask);
+ SwapRestL(stuff);
+ return((* ProcVector[X_CreateGC])(client));
+}
+
+int
+SProcChangeGC(ClientPtr client)
+{
+ REQUEST(xChangeGCReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xChangeGCReq);
+ swapl(&stuff->gc);
+ swapl(&stuff->mask);
+ SwapRestL(stuff);
+ return((* ProcVector[X_ChangeGC])(client));
+}
+
+int
+SProcCopyGC(ClientPtr client)
+{
+ REQUEST(xCopyGCReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xCopyGCReq);
+ swapl(&stuff->srcGC);
+ swapl(&stuff->dstGC);
+ swapl(&stuff->mask);
+ return((* ProcVector[X_CopyGC])(client));
+}
+
+int
+SProcSetDashes(ClientPtr client)
+{
+ REQUEST(xSetDashesReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xSetDashesReq);
+ swapl(&stuff->gc);
+ swaps(&stuff->dashOffset);
+ swaps(&stuff->nDashes);
+ return((* ProcVector[X_SetDashes])(client));
+
+}
+
+int
+SProcSetClipRectangles(ClientPtr client)
+{
+ REQUEST(xSetClipRectanglesReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq);
+ swapl(&stuff->gc);
+ swaps(&stuff->xOrigin);
+ swaps(&stuff->yOrigin);
+ SwapRestS(stuff);
+ return((* ProcVector[X_SetClipRectangles])(client));
+}
+
+int
+SProcClearToBackground(ClientPtr client)
+{
+ REQUEST(xClearAreaReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xClearAreaReq);
+ swapl(&stuff->window);
+ swaps(&stuff->x);
+ swaps(&stuff->y);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
+ return((* ProcVector[X_ClearArea])(client));
+}
+
+int
+SProcCopyArea(ClientPtr client)
+{
+ REQUEST(xCopyAreaReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xCopyAreaReq);
+ swapl(&stuff->srcDrawable);
+ swapl(&stuff->dstDrawable);
+ swapl(&stuff->gc);
+ swaps(&stuff->srcX);
+ swaps(&stuff->srcY);
+ swaps(&stuff->dstX);
+ swaps(&stuff->dstY);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
+ return((* ProcVector[X_CopyArea])(client));
+}
+
+int
+SProcCopyPlane(ClientPtr client)
+{
+ REQUEST(xCopyPlaneReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xCopyPlaneReq);
+ swapl(&stuff->srcDrawable);
+ swapl(&stuff->dstDrawable);
+ swapl(&stuff->gc);
+ swaps(&stuff->srcX);
+ swaps(&stuff->srcY);
+ swaps(&stuff->dstX);
+ swaps(&stuff->dstY);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
+ swapl(&stuff->bitPlane);
+ return((* ProcVector[X_CopyPlane])(client));
+}
+
+/* The following routine is used for all Poly drawing requests
+ (except FillPoly, which uses a different request format) */
+int
+SProcPoly(ClientPtr client)
+{
+ REQUEST(xPolyPointReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xPolyPointReq);
+ swapl(&stuff->drawable);
+ swapl(&stuff->gc);
+ SwapRestS(stuff);
+ return((* ProcVector[stuff->reqType])(client));
+}
+
+/* cannot use SProcPoly for this one, because xFillPolyReq
+ is longer than xPolyPointReq, and we don't want to swap
+ the difference as shorts! */
+int
+SProcFillPoly(ClientPtr client)
+{
+ REQUEST(xFillPolyReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xFillPolyReq);
+ swapl(&stuff->drawable);
+ swapl(&stuff->gc);
+ SwapRestS(stuff);
+ return((* ProcVector[X_FillPoly])(client));
+}
+
+int
+SProcPutImage(ClientPtr client)
+{
+ REQUEST(xPutImageReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xPutImageReq);
+ swapl(&stuff->drawable);
+ swapl(&stuff->gc);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
+ swaps(&stuff->dstX);
+ swaps(&stuff->dstY);
+ /* Image should already be swapped */
+ return((* ProcVector[X_PutImage])(client));
+
+}
+
+int
+SProcGetImage(ClientPtr client)
+{
+ REQUEST(xGetImageReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xGetImageReq);
+ swapl(&stuff->drawable);
+ swaps(&stuff->x);
+ swaps(&stuff->y);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
+ swapl(&stuff->planeMask);
+ return((* ProcVector[X_GetImage])(client));
+}
+
+/* ProcPolyText used for both PolyText8 and PolyText16 */
+
+int
+SProcPolyText(ClientPtr client)
+{
+ REQUEST(xPolyTextReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xPolyTextReq);
+ swapl(&stuff->drawable);
+ swapl(&stuff->gc);
+ swaps(&stuff->x);
+ swaps(&stuff->y);
+ return((* ProcVector[stuff->reqType])(client));
+}
+
+/* ProcImageText used for both ImageText8 and ImageText16 */
+
+int
+SProcImageText(ClientPtr client)
+{
+ REQUEST(xImageTextReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xImageTextReq);
+ swapl(&stuff->drawable);
+ swapl(&stuff->gc);
+ swaps(&stuff->x);
+ swaps(&stuff->y);
+ return((* ProcVector[stuff->reqType])(client));
+}
+
+int
+SProcCreateColormap(ClientPtr client)
+{
+ REQUEST(xCreateColormapReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xCreateColormapReq);
+ swapl(&stuff->mid);
+ swapl(&stuff->window);
+ swapl(&stuff->visual);
+ return((* ProcVector[X_CreateColormap])(client));
+}
+
+
+int
+SProcCopyColormapAndFree(ClientPtr client)
+{
+ REQUEST(xCopyColormapAndFreeReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq);
+ swapl(&stuff->mid);
+ swapl(&stuff->srcCmap);
+ return((* ProcVector[X_CopyColormapAndFree])(client));
+
+}
+
+int
+SProcAllocColor(ClientPtr client)
+{
+ REQUEST(xAllocColorReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xAllocColorReq);
+ swapl(&stuff->cmap);
+ swaps(&stuff->red);
+ swaps(&stuff->green);
+ swaps(&stuff->blue);
+ return((* ProcVector[X_AllocColor])(client));
+}
+
+int
+SProcAllocNamedColor(ClientPtr client)
+{
+ REQUEST(xAllocNamedColorReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xAllocNamedColorReq);
+ swapl(&stuff->cmap);
+ swaps(&stuff->nbytes);
+ return((* ProcVector[X_AllocNamedColor])(client));
+}
+
+int
+SProcAllocColorCells(ClientPtr client)
+{
+ REQUEST(xAllocColorCellsReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xAllocColorCellsReq);
+ swapl(&stuff->cmap);
+ swaps(&stuff->colors);
+ swaps(&stuff->planes);
+ return((* ProcVector[X_AllocColorCells])(client));
+}
+
+int
+SProcAllocColorPlanes(ClientPtr client)
+{
+ REQUEST(xAllocColorPlanesReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xAllocColorPlanesReq);
+ swapl(&stuff->cmap);
+ swaps(&stuff->colors);
+ swaps(&stuff->red);
+ swaps(&stuff->green);
+ swaps(&stuff->blue);
+ return((* ProcVector[X_AllocColorPlanes])(client));
+}
+
+int
+SProcFreeColors(ClientPtr client)
+{
+ REQUEST(xFreeColorsReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xFreeColorsReq);
+ swapl(&stuff->cmap);
+ swapl(&stuff->planeMask);
+ SwapRestL(stuff);
+ return((* ProcVector[X_FreeColors])(client));
+
+}
+
+void
+SwapColorItem(xColorItem *pItem)
+{
+ swapl(&pItem->pixel);
+ swaps(&pItem->red);
+ swaps(&pItem->green);
+ swaps(&pItem->blue);
+}
+
+int
+SProcStoreColors(ClientPtr client)
+{
+ long count;
+ xColorItem *pItem;
+
+ REQUEST(xStoreColorsReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
+ swapl(&stuff->cmap);
+ pItem = (xColorItem *) &stuff[1];
+ for(count = LengthRestB(stuff)/sizeof(xColorItem); --count >= 0; )
+ SwapColorItem(pItem++);
+ return((* ProcVector[X_StoreColors])(client));
+}
+
+int
+SProcStoreNamedColor (ClientPtr client)
+{
+ REQUEST(xStoreNamedColorReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xStoreNamedColorReq);
+ swapl(&stuff->cmap);
+ swapl(&stuff->pixel);
+ swaps(&stuff->nbytes);
+ return((* ProcVector[X_StoreNamedColor])(client));
+}
+
+int
+SProcQueryColors (ClientPtr client)
+{
+ REQUEST(xQueryColorsReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xQueryColorsReq);
+ swapl(&stuff->cmap);
+ SwapRestL(stuff);
+ return((* ProcVector[X_QueryColors])(client));
+}
+
+int
+SProcLookupColor (ClientPtr client)
+{
+ REQUEST(xLookupColorReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xLookupColorReq);
+ swapl(&stuff->cmap);
+ swaps(&stuff->nbytes);
+ return((* ProcVector[X_LookupColor])(client));
+}
+
+int
+SProcCreateCursor (ClientPtr client)
+{
+ REQUEST(xCreateCursorReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xCreateCursorReq);
+ swapl(&stuff->cid);
+ swapl(&stuff->source);
+ swapl(&stuff->mask);
+ swaps(&stuff->foreRed);
+ swaps(&stuff->foreGreen);
+ swaps(&stuff->foreBlue);
+ swaps(&stuff->backRed);
+ swaps(&stuff->backGreen);
+ swaps(&stuff->backBlue);
+ swaps(&stuff->x);
+ swaps(&stuff->y);
+ return((* ProcVector[X_CreateCursor])(client));
+}
+
+int
+SProcCreateGlyphCursor (ClientPtr client)
+{
+ REQUEST(xCreateGlyphCursorReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xCreateGlyphCursorReq);
+ swapl(&stuff->cid);
+ swapl(&stuff->source);
+ swapl(&stuff->mask);
+ swaps(&stuff->sourceChar);
+ swaps(&stuff->maskChar);
+ swaps(&stuff->foreRed);
+ swaps(&stuff->foreGreen);
+ swaps(&stuff->foreBlue);
+ swaps(&stuff->backRed);
+ swaps(&stuff->backGreen);
+ swaps(&stuff->backBlue);
+ return((* ProcVector[X_CreateGlyphCursor])(client));
+}
+
+
+int
+SProcRecolorCursor (ClientPtr client)
+{
+ REQUEST(xRecolorCursorReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xRecolorCursorReq);
+ swapl(&stuff->cursor);
+ swaps(&stuff->foreRed);
+ swaps(&stuff->foreGreen);
+ swaps(&stuff->foreBlue);
+ swaps(&stuff->backRed);
+ swaps(&stuff->backGreen);
+ swaps(&stuff->backBlue);
+ return((* ProcVector[X_RecolorCursor])(client));
+}
+
+int
+SProcQueryBestSize (ClientPtr client)
+{
+ REQUEST(xQueryBestSizeReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xQueryBestSizeReq);
+ swapl(&stuff->drawable);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
+ return((* ProcVector[X_QueryBestSize])(client));
+
+}
+
+int
+SProcQueryExtension (ClientPtr client)
+{
+ REQUEST(xQueryExtensionReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xQueryExtensionReq);
+ swaps(&stuff->nbytes);
+ return((* ProcVector[X_QueryExtension])(client));
+}
+
+int
+SProcChangeKeyboardMapping (ClientPtr client)
+{
+ REQUEST(xChangeKeyboardMappingReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq);
+ SwapRestL(stuff);
+ return((* ProcVector[X_ChangeKeyboardMapping])(client));
+}
+
+
+int
+SProcChangeKeyboardControl (ClientPtr client)
+{
+ REQUEST(xChangeKeyboardControlReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq);
+ swapl(&stuff->mask);
+ SwapRestL(stuff);
+ return((* ProcVector[X_ChangeKeyboardControl])(client));
+}
+
+int
+SProcChangePointerControl (ClientPtr client)
+{
+ REQUEST(xChangePointerControlReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xChangePointerControlReq);
+ swaps(&stuff->accelNum);
+ swaps(&stuff->accelDenum);
+ swaps(&stuff->threshold);
+ return((* ProcVector[X_ChangePointerControl])(client));
+}
+
+
+int
+SProcSetScreenSaver (ClientPtr client)
+{
+ REQUEST(xSetScreenSaverReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xSetScreenSaverReq);
+ swaps(&stuff->timeout);
+ swaps(&stuff->interval);
+ return((* ProcVector[X_SetScreenSaver])(client));
+}
+
+int
+SProcChangeHosts (ClientPtr client)
+{
+ REQUEST(xChangeHostsReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xChangeHostsReq);
+ swaps(&stuff->hostLength);
+ return((* ProcVector[X_ChangeHosts])(client));
+
+}
+
+int SProcRotateProperties (ClientPtr client)
+{
+ REQUEST(xRotatePropertiesReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xRotatePropertiesReq);
+ swapl(&stuff->window);
+ swaps(&stuff->nAtoms);
+ swaps(&stuff->nPositions);
+ SwapRestL(stuff);
+ return ((* ProcVector[X_RotateProperties])(client));
+}
+
+int
+SProcNoOperation(ClientPtr client)
+{
+ REQUEST(xReq);
+ swaps(&stuff->length);
+ return ((* ProcVector[X_NoOperation])(client));
+}
+
+void
+SwapConnClientPrefix(xConnClientPrefix *pCCP)
+{
+ swaps(&pCCP->majorVersion);
+ swaps(&pCCP->minorVersion);
+ swaps(&pCCP->nbytesAuthProto);
+ swaps(&pCCP->nbytesAuthString);
+}
diff --git a/xorg-server/docbook.am b/xorg-server/docbook.am
index eb3bf0c9a..bba4d5453 100644
--- a/xorg-server/docbook.am
+++ b/xorg-server/docbook.am
@@ -21,76 +21,82 @@ shelf_DATA =
dist_shelf_DATA = $(docbook) $(chapters)
if HAVE_XMLTO
-#
-# Generate DocBook/XML output formats with or without stylesheets
-#
-
-# Stylesheets are available if the package xorg-sgml-doctools is installed
if HAVE_STYLESHEETS
-# The location where all cross reference databases are installed
-sgmldbsdir = $(XORG_SGML_PATH)/X11/dbs
-masterdb = "$(sgmldbsdir)/masterdb$(suffix $@).xml"
-XMLTO_FLAGS = \
- --searchpath "$(XORG_SGML_PATH)/X11" \
- --searchpath "$(abs_top_builddir)" \
- --stringparam target.database.document=$(masterdb) \
- --stringparam current.docid="$(<:.xml=)" \
- --stringparam collect.xref.targets="no"
-
-XMLTO_XHTML_FLAGS = \
- -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl \
- --stringparam html.stylesheet=$(STYLESHEET_SRCDIR)/xorg.css
-
-XMLTO_FO_FLAGS = \
- -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl
-endif HAVE_STYLESHEETS
+XMLTO_SEARCHPATH_FLAGS = \
+ --searchpath "$(XORG_SGML_PATH)/X11" \
+ --searchpath "$(abs_top_builddir)"
+XMLTO_HTML_OLINK_FLAGS = \
+ --stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.html.xml \
+ --stringparam current.docid="$(<:.xml=)"
+XMLTO_HTML_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
+XMLTO_HTML_FLAGS = \
+ $(XMLTO_SEARCHPATH_FLAGS) \
+ $(XMLTO_HTML_STYLESHEET_FLAGS) \
+ $(XMLTO_HTML_OLINK_FLAGS)
shelf_DATA += $(docbook:.xml=.html)
-%.html: %.xml $(chapters)
- $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) xhtml-nochunks $<
-
-if HAVE_FOP
-shelf_DATA += $(docbook:.xml=.pdf) $(docbook:.xml=.ps)
-%.pdf: %.xml $(chapters)
- $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop pdf $<
-%.ps: %.xml $(chapters)
- $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_FO_FLAGS) --with-fop ps $<
-endif HAVE_FOP
+%.html: %.xml $(chapters)
+ $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $<
if HAVE_XMLTO_TEXT
+
shelf_DATA += $(docbook:.xml=.txt)
%.txt: %.xml $(chapters)
- $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) $(XMLTO_XHTML_FLAGS) txt $<
+ $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $<
endif HAVE_XMLTO_TEXT
-#
-# Generate documents cross-reference target databases
-#
+if HAVE_FOP
+XMLTO_FO_IMAGEPATH_FLAGS = --stringparam img.src.path=$(abs_builddir)/
+XMLTO_PDF_OLINK_FLAGS = \
+ --stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.pdf.xml \
+ --stringparam current.docid="$(<:.xml=)"
+XMLTO_FO_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl
+
+XMLTO_FO_FLAGS = \
+ $(XMLTO_SEARCHPATH_FLAGS) \
+ $(XMLTO_FO_STYLESHEET_FLAGS) \
+ $(XMLTO_FO_IMAGEPATH_FLAGS) \
+ $(XMLTO_PDF_OLINK_FLAGS)
+
+shelf_DATA += $(docbook:.xml=.pdf)
+%.pdf: %.xml $(chapters)
+ $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $<
-# This is only possible if the xorg-sgml-doctools package is installed
-if HAVE_STYLESHEETS
-if HAVE_XSLTPROC
+shelf_DATA += $(docbook:.xml=.ps)
+%.ps: %.xml $(chapters)
+ $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $<
+endif HAVE_FOP
-# DocBook/XML generated document cross-reference database
-shelf_DATA += $(docbook:.xml=.html.db) $(docbook:.xml=.fo.db)
+# Generate documents cross-reference target databases
+if HAVE_XSLTPROC
-# Generate DocBook/XML document cross-reference database
-# Flags for the XSL Transformation processor generating xref target databases
-XSLTPROC_FLAGS = \
+XSLT_SEARCHPATH_FLAGS = \
--path "$(XORG_SGML_PATH)/X11" \
- --path "$(abs_top_builddir)" \
- --stringparam targets.filename "$@" \
- --stringparam collect.xref.targets "only" \
- --nonet --xinclude
-
+ --path "$(abs_top_builddir)"
+XSLT_OLINK_FLAGS = \
+ --stringparam targets.filename "$@" \
+ --stringparam collect.xref.targets "only" \
+ --stringparam olink.base.uri "$(@:.db=)"
+
+XSLT_HTML_FLAGS = \
+ $(XSLT_SEARCHPATH_FLAGS) \
+ $(XSLT_OLINK_FLAGS) \
+ --nonet --xinclude \
+ $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl
+XSLT_PDF_FLAGS = \
+ $(XSLT_SEARCHPATH_FLAGS) \
+ $(XSLT_OLINK_FLAGS) \
+ --nonet --xinclude \
+ $(STYLESHEET_SRCDIR)/xorg-fo.xsl
+
+shelf_DATA += $(docbook:.xml=.html.db)
%.html.db: %.xml $(chapters)
- $(AM_V_GEN)$(XSLTPROC) $(XSLTPROC_FLAGS) \
- http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl $<
+ $(AM_V_GEN)$(XSLTPROC) $(XSLT_HTML_FLAGS) $<
-%.fo.db: %.xml $(chapters)
- $(AM_V_GEN)$(XSLTPROC) $(XSLTPROC_FLAGS) \
- http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl $<
+shelf_DATA += $(docbook:.xml=.pdf.db)
+%.pdf.db: %.xml $(chapters)
+ $(AM_V_GEN)$(XSLTPROC) $(XSLT_PDF_FLAGS) $<
endif HAVE_XSLTPROC
endif HAVE_STYLESHEETS
diff --git a/xorg-server/fb/wfbrename.h b/xorg-server/fb/wfbrename.h
index 5dee3bc4a..1a072045e 100644
--- a/xorg-server/fb/wfbrename.h
+++ b/xorg-server/fb/wfbrename.h
@@ -1,169 +1,171 @@
-#define fb16Lane wfb16Lane
-#define fb24_32CopyMtoN wfb24_32CopyMtoN
-#define fb24_32CreateScreenResources wfb24_32CreateScreenResources
-#define fb24_32GetImage wfb24_32GetImage
-#define fb24_32GetSpans wfb24_32GetSpans
-#define fb24_32ModifyPixmapHeader wfb24_32ModifyPixmapHeader
-#define fb24_32PutZImage wfb24_32PutZImage
-#define fb24_32ReformatTile wfb24_32ReformatTile
-#define fb24_32SetSpans wfb24_32SetSpans
-#define fb32Lane wfb32Lane
-#define fb8Lane wfb8Lane
-#define fbAddTraps wfbAddTraps
-#define fbAddTriangles wfbAddTriangles
-#define fbAllocatePrivates wfbAllocatePrivates
-#define fbArc16 wfbArc16
-#define fbArc24 wfbArc24
-#define fbArc32 wfbArc32
-#define fbArc8 wfbArc8
-#define fbBlt wfbBlt
-#define fbBlt24 wfbBlt24
-#define fbBltOne wfbBltOne
-#define fbBltOne24 wfbBltOne24
-#define fbBltPlane wfbBltPlane
-#define fbBltStip wfbBltStip
-#define fbBres wfbBres
-#define fbBresDash wfbBresDash
-#define fbBresDash16 wfbBresDash16
-#define fbBresDash24 wfbBresDash24
-#define fbBresDash32 wfbBresDash32
-#define fbBresDash8 wfbBresDash8
-#define fbBresFill wfbBresFill
-#define fbBresFillDash wfbBresFillDash
-#define fbBresSolid wfbBresSolid
-#define fbBresSolid16 wfbBresSolid16
-#define fbBresSolid24 wfbBresSolid24
-#define fbBresSolid32 wfbBresSolid32
-#define fbBresSolid8 wfbBresSolid8
-#define fbChangeWindowAttributes wfbChangeWindowAttributes
-#define fbClearVisualTypes wfbClearVisualTypes
-#define fbCloseScreen wfbCloseScreen
-#define fbComposite wfbComposite
-#define fbCopy1toN wfbCopy1toN
-#define fbCopyArea wfbCopyArea
-#define fbCopyNto1 wfbCopyNto1
-#define fbCopyNtoN wfbCopyNtoN
-#define fbCopyPlane wfbCopyPlane
-#define fbCopyWindow wfbCopyWindow
-#define fbCopyWindowProc wfbCopyWindowProc
-#define fbCreateDefColormap wfbCreateDefColormap
-#define fbCreateGC wfbCreateGC
-#define fbCreatePixmap wfbCreatePixmap
-#define fbCreatePixmapBpp wfbCreatePixmapBpp
-#define fbCreateWindow wfbCreateWindow
-#define fbDestroyPixmap wfbDestroyPixmap
-#define fbDestroyWindow wfbDestroyWindow
-#define fbDots wfbDots
-#define fbDots16 wfbDots16
-#define fbDots24 wfbDots24
-#define fbDots32 wfbDots32
-#define fbDots8 wfbDots8
-#define fbEvenStipple wfbEvenStipple
-#define fbEvenTile wfbEvenTile
-#define fbExpandDirectColors wfbExpandDirectColors
-#define fbFill wfbFill
-#define fbFillRegionSolid wfbFillRegionSolid
-#define fbFillSpans wfbFillSpans
-#define fbFixCoordModePrevious wfbFixCoordModePrevious
-#define fbGCFuncs wfbGCFuncs
-#define fbGCOps wfbGCOps
-#define fbGCPrivateKeyRec wfbGCPrivateKeyRec
-#define fbGeneration wfbGeneration
-#define fbGetGCPrivateKey wfbGetGCPrivateKey
-#define fbGetImage wfbGetImage
-#define fbGetScreenPrivateKey wfbGetScreenPrivateKey
-#define fbGetSpans wfbGetSpans
-#define _fbGetWindowPixmap _wfbGetWindowPixmap
-#define fbWinPrivateKeyRec wfbWinPrivateKeyRec
-#define fbGetWinPrivateKey wfbGetWinPrivateKey
-#define fbGlyph16 wfbGlyph16
-#define fbGlyph24 wfbGlyph24
-#define fbGlyph32 wfbGlyph32
-#define fbGlyph8 wfbGlyph8
-#define fbGlyphIn wfbGlyphIn
-#define fbHasVisualTypes wfbHasVisualTypes
-#define fbImageGlyphBlt wfbImageGlyphBlt
-#define fbIn wfbIn
-#define fbInitializeColormap wfbInitializeColormap
-#define fbInitVisuals wfbInitVisuals
-#define fbInstallColormap wfbInstallColormap
-#define fbLaneTable wfbLaneTable
-#define fbListInstalledColormaps wfbListInstalledColormaps
-#define fbMapWindow wfbMapWindow
-#define FbMergeRopBits wFbMergeRopBits
-#define fbOddStipple wfbOddStipple
-#define fbOddTile wfbOddTile
-#define fbOver wfbOver
-#define fbOver24 wfbOver24
-#define fbOverlayCloseScreen wfbOverlayCloseScreen
-#define fbOverlayCopyWindow wfbOverlayCopyWindow
-#define fbOverlayCreateScreenResources wfbOverlayCreateScreenResources
-#define fbOverlayCreateWindow wfbOverlayCreateWindow
-#define fbOverlayFinishScreenInit wfbOverlayFinishScreenInit
-#define fbOverlayGeneration wfbOverlayGeneration
-#define fbOverlayGetScreenPrivateKey wfbOverlayGetScreenPrivateKey
-#define fbOverlayPaintKey wfbOverlayPaintKey
-#define fbOverlaySetupScreen wfbOverlaySetupScreen
-#define fbOverlayUpdateLayerRegion wfbOverlayUpdateLayerRegion
-#define fbOverlayWindowExposures wfbOverlayWindowExposures
-#define fbOverlayWindowLayer wfbOverlayWindowLayer
-#define fbPadPixmap wfbPadPixmap
-#define fbPictureInit wfbPictureInit
-#define fbPixmapToRegion wfbPixmapToRegion
-#define fbPolyArc wfbPolyArc
-#define fbPolyFillRect wfbPolyFillRect
-#define fbPolyGlyphBlt wfbPolyGlyphBlt
-#define fbPolyLine wfbPolyLine
-#define fbPolyline16 wfbPolyline16
-#define fbPolyline24 wfbPolyline24
-#define fbPolyline32 wfbPolyline32
-#define fbPolyline8 wfbPolyline8
-#define fbPolyPoint wfbPolyPoint
-#define fbPolySegment wfbPolySegment
-#define fbPolySegment16 wfbPolySegment16
-#define fbPolySegment24 wfbPolySegment24
-#define fbPolySegment32 wfbPolySegment32
-#define fbPolySegment8 wfbPolySegment8
-#define fbPositionWindow wfbPositionWindow
-#define fbPushFill wfbPushFill
-#define fbPushImage wfbPushImage
-#define fbPushPattern wfbPushPattern
-#define fbPushPixels wfbPushPixels
-#define fbPutImage wfbPutImage
-#define fbPutXYImage wfbPutXYImage
-#define fbPutZImage wfbPutZImage
-#define fbQueryBestSize wfbQueryBestSize
-#define fbRasterizeTrapezoid wfbRasterizeTrapezoid
-#define fbRealizeFont wfbRealizeFont
-#define fbReduceRasterOp wfbReduceRasterOp
-#define fbReplicatePixel wfbReplicatePixel
-#define fbResolveColor wfbResolveColor
-#define fbScreenPrivateKeyRec wfbScreenPrivateKeyRec
-#define fbSegment wfbSegment
-#define fbSelectBres wfbSelectBres
-#define fbSetSpans wfbSetSpans
-#define fbSetupScreen wfbSetupScreen
-#define fbSetVisualTypes wfbSetVisualTypes
-#define fbSetVisualTypesAndMasks wfbSetVisualTypesAndMasks
-#define _fbSetWindowPixmap _wfbSetWindowPixmap
-#define fbSolid wfbSolid
-#define fbSolid24 wfbSolid24
-#define fbSolidBoxClipped wfbSolidBoxClipped
-#define fbStipple wfbStipple
-#define fbStipple1Bits wfbStipple1Bits
-#define fbStipple24Bits wfbStipple24Bits
-#define fbStipple2Bits wfbStipple2Bits
-#define fbStipple4Bits wfbStipple4Bits
-#define fbStipple8Bits wfbStipple8Bits
-#define fbStippleTable wfbStippleTable
-#define fbTile wfbTile
-#define fbTransparentSpan wfbTransparentSpan
-#define fbUninstallColormap wfbUninstallColormap
-#define fbUnmapWindow wfbUnmapWindow
-#define fbUnrealizeFont wfbUnrealizeFont
-#define fbValidateGC wfbValidateGC
-#define fbWinPrivateKeyRec wfbWinPrivateKeyRec
-#define fbZeroLine wfbZeroLine
-#define fbZeroSegment wfbZeroSegment
-#define free_pixman_pict wfb_free_pixman_pict
-#define image_from_pict wfb_image_from_pict
+#define fb16Lane wfb16Lane
+#define fb24_32CopyMtoN wfb24_32CopyMtoN
+#define fb24_32CreateScreenResources wfb24_32CreateScreenResources
+#define fb24_32GetImage wfb24_32GetImage
+#define fb24_32GetSpans wfb24_32GetSpans
+#define fb24_32ModifyPixmapHeader wfb24_32ModifyPixmapHeader
+#define fb24_32PutZImage wfb24_32PutZImage
+#define fb24_32ReformatTile wfb24_32ReformatTile
+#define fb24_32SetSpans wfb24_32SetSpans
+#define fb32Lane wfb32Lane
+#define fb8Lane wfb8Lane
+#define fbAddTraps wfbAddTraps
+#define fbAddTriangles wfbAddTriangles
+#define fbAllocatePrivates wfbAllocatePrivates
+#define fbArc16 wfbArc16
+#define fbArc24 wfbArc24
+#define fbArc32 wfbArc32
+#define fbArc8 wfbArc8
+#define fbBlt wfbBlt
+#define fbBlt24 wfbBlt24
+#define fbBltOne wfbBltOne
+#define fbBltOne24 wfbBltOne24
+#define fbBltPlane wfbBltPlane
+#define fbBltStip wfbBltStip
+#define fbBres wfbBres
+#define fbBresDash wfbBresDash
+#define fbBresDash16 wfbBresDash16
+#define fbBresDash24 wfbBresDash24
+#define fbBresDash32 wfbBresDash32
+#define fbBresDash8 wfbBresDash8
+#define fbBresFill wfbBresFill
+#define fbBresFillDash wfbBresFillDash
+#define fbBresSolid wfbBresSolid
+#define fbBresSolid16 wfbBresSolid16
+#define fbBresSolid24 wfbBresSolid24
+#define fbBresSolid32 wfbBresSolid32
+#define fbBresSolid8 wfbBresSolid8
+#define fbChangeWindowAttributes wfbChangeWindowAttributes
+#define fbClearVisualTypes wfbClearVisualTypes
+#define fbCloseScreen wfbCloseScreen
+#define fbComposite wfbComposite
+#define fbCopy1toN wfbCopy1toN
+#define fbCopyArea wfbCopyArea
+#define fbCopyNto1 wfbCopyNto1
+#define fbCopyNtoN wfbCopyNtoN
+#define fbCopyPlane wfbCopyPlane
+#define fbCopyWindow wfbCopyWindow
+#define fbCopyWindowProc wfbCopyWindowProc
+#define fbCreateDefColormap wfbCreateDefColormap
+#define fbCreateGC wfbCreateGC
+#define fbCreatePixmap wfbCreatePixmap
+#define fbCreatePixmapBpp wfbCreatePixmapBpp
+#define fbCreateWindow wfbCreateWindow
+#define fbDestroyPixmap wfbDestroyPixmap
+#define fbDestroyWindow wfbDestroyWindow
+#define fbDots wfbDots
+#define fbDots16 wfbDots16
+#define fbDots24 wfbDots24
+#define fbDots32 wfbDots32
+#define fbDots8 wfbDots8
+#define fbEvenStipple wfbEvenStipple
+#define fbEvenTile wfbEvenTile
+#define fbExpandDirectColors wfbExpandDirectColors
+#define fbFill wfbFill
+#define fbFillRegionSolid wfbFillRegionSolid
+#define fbFillSpans wfbFillSpans
+#define fbFixCoordModePrevious wfbFixCoordModePrevious
+#define fbGCFuncs wfbGCFuncs
+#define fbGCOps wfbGCOps
+#define fbGCPrivateKeyRec wfbGCPrivateKeyRec
+#define fbGeneration wfbGeneration
+#define fbGetGCPrivateKey wfbGetGCPrivateKey
+#define fbGetImage wfbGetImage
+#define fbGetScreenPrivateKey wfbGetScreenPrivateKey
+#define fbGetSpans wfbGetSpans
+#define _fbGetWindowPixmap _wfbGetWindowPixmap
+#define fbWinPrivateKeyRec wfbWinPrivateKeyRec
+#define fbGetWinPrivateKey wfbGetWinPrivateKey
+#define fbGlyph16 wfbGlyph16
+#define fbGlyph24 wfbGlyph24
+#define fbGlyph32 wfbGlyph32
+#define fbGlyph8 wfbGlyph8
+#define fbGlyphIn wfbGlyphIn
+#define fbHasVisualTypes wfbHasVisualTypes
+#define fbImageGlyphBlt wfbImageGlyphBlt
+#define fbIn wfbIn
+#define fbInitializeColormap wfbInitializeColormap
+#define fbInitVisuals wfbInitVisuals
+#define fbInstallColormap wfbInstallColormap
+#define fbLaneTable wfbLaneTable
+#define fbListInstalledColormaps wfbListInstalledColormaps
+#define fbMapWindow wfbMapWindow
+#define FbMergeRopBits wFbMergeRopBits
+#define fbOddStipple wfbOddStipple
+#define fbOddTile wfbOddTile
+#define fbOver wfbOver
+#define fbOver24 wfbOver24
+#define fbOverlayCloseScreen wfbOverlayCloseScreen
+#define fbOverlayCopyWindow wfbOverlayCopyWindow
+#define fbOverlayCreateScreenResources wfbOverlayCreateScreenResources
+#define fbOverlayCreateWindow wfbOverlayCreateWindow
+#define fbOverlayFinishScreenInit wfbOverlayFinishScreenInit
+#define fbOverlayGeneration wfbOverlayGeneration
+#define fbOverlayGetScreenPrivateKey wfbOverlayGetScreenPrivateKey
+#define fbOverlayPaintKey wfbOverlayPaintKey
+#define fbOverlaySetupScreen wfbOverlaySetupScreen
+#define fbOverlayUpdateLayerRegion wfbOverlayUpdateLayerRegion
+#define fbOverlayWindowExposures wfbOverlayWindowExposures
+#define fbOverlayWindowLayer wfbOverlayWindowLayer
+#define fbPadPixmap wfbPadPixmap
+#define fbPictureInit wfbPictureInit
+#define fbPixmapToRegion wfbPixmapToRegion
+#define fbPolyArc wfbPolyArc
+#define fbPolyFillRect wfbPolyFillRect
+#define fbPolyGlyphBlt wfbPolyGlyphBlt
+#define fbPolyLine wfbPolyLine
+#define fbPolyline16 wfbPolyline16
+#define fbPolyline24 wfbPolyline24
+#define fbPolyline32 wfbPolyline32
+#define fbPolyline8 wfbPolyline8
+#define fbPolyPoint wfbPolyPoint
+#define fbPolySegment wfbPolySegment
+#define fbPolySegment16 wfbPolySegment16
+#define fbPolySegment24 wfbPolySegment24
+#define fbPolySegment32 wfbPolySegment32
+#define fbPolySegment8 wfbPolySegment8
+#define fbPositionWindow wfbPositionWindow
+#define fbPushFill wfbPushFill
+#define fbPushImage wfbPushImage
+#define fbPushPattern wfbPushPattern
+#define fbPushPixels wfbPushPixels
+#define fbPutImage wfbPutImage
+#define fbPutXYImage wfbPutXYImage
+#define fbPutZImage wfbPutZImage
+#define fbQueryBestSize wfbQueryBestSize
+#define fbRasterizeTrapezoid wfbRasterizeTrapezoid
+#define fbRealizeFont wfbRealizeFont
+#define fbReduceRasterOp wfbReduceRasterOp
+#define fbReplicatePixel wfbReplicatePixel
+#define fbResolveColor wfbResolveColor
+#define fbScreenPrivateKeyRec wfbScreenPrivateKeyRec
+#define fbSegment wfbSegment
+#define fbSelectBres wfbSelectBres
+#define fbSetSpans wfbSetSpans
+#define fbSetupScreen wfbSetupScreen
+#define fbSetVisualTypes wfbSetVisualTypes
+#define fbSetVisualTypesAndMasks wfbSetVisualTypesAndMasks
+#define _fbSetWindowPixmap _wfbSetWindowPixmap
+#define fbSolid wfbSolid
+#define fbSolid24 wfbSolid24
+#define fbSolidBoxClipped wfbSolidBoxClipped
+#define fbStipple wfbStipple
+#define fbStipple1Bits wfbStipple1Bits
+#define fbStipple24Bits wfbStipple24Bits
+#define fbStipple2Bits wfbStipple2Bits
+#define fbStipple4Bits wfbStipple4Bits
+#define fbStipple8Bits wfbStipple8Bits
+#define fbStippleTable wfbStippleTable
+#define fbTile wfbTile
+#define fbTransparentSpan wfbTransparentSpan
+#define fbTrapezoids wfbTrapezoids
+#define fbTriangles wfbTriangles
+#define fbUninstallColormap wfbUninstallColormap
+#define fbUnmapWindow wfbUnmapWindow
+#define fbUnrealizeFont wfbUnrealizeFont
+#define fbValidateGC wfbValidateGC
+#define fbWinPrivateKeyRec wfbWinPrivateKeyRec
+#define fbZeroLine wfbZeroLine
+#define fbZeroSegment wfbZeroSegment
+#define free_pixman_pict wfb_free_pixman_pict
+#define image_from_pict wfb_image_from_pict
diff --git a/xorg-server/glx/glxserver.h b/xorg-server/glx/glxserver.h
index 61f9995af..40a20e372 100644
--- a/xorg-server/glx/glxserver.h
+++ b/xorg-server/glx/glxserver.h
@@ -1,238 +1,232 @@
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#ifndef _GLX_server_h_
-#define _GLX_server_h_
-
-/*
- * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
- * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
- */
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include <X11/Xmd.h>
-#include <misc.h>
-#include <dixstruct.h>
-#include <pixmapstr.h>
-#include <gcstruct.h>
-#include <extnsionst.h>
-#include <resource.h>
-#include <scrnintstr.h>
-
-/*
-** The X header misc.h defines these math functions.
-*/
-#undef abs
-#undef fabs
-
-#define GL_GLEXT_PROTOTYPES /* we want prototypes */
-#include <GL/gl.h>
-#include <GL/glext.h>
-#include <GL/glxproto.h>
-
-/*
-** GLX resources.
-*/
-typedef XID GLXContextID;
-typedef XID GLXPixmap;
-typedef XID GLXDrawable;
-
-typedef struct __GLXclientStateRec __GLXclientState;
-typedef struct __GLXdrawable __GLXdrawable;
-typedef struct __GLXcontext __GLXcontext;
-
-#include "glxscreens.h"
-#include "glxdrawable.h"
-#include "glxcontext.h"
-
-#ifndef True
-#define True 1
-#endif
-#ifndef False
-#define False 0
-#endif
-
-extern __GLXscreen *glxGetScreen(ScreenPtr pScreen);
-extern __GLXclientState *glxGetClient(ClientPtr pClient);
-
-/************************************************************************/
-
-void GlxExtensionInit(void);
-
-void GlxSetVisualConfigs(int nconfigs,
- void *configs, void **privates);
-
-void __glXScreenInitVisuals(__GLXscreen *screen);
-
-/*
-** The last context used (from the server's persective) is cached.
-*/
-extern __GLXcontext *__glXLastContext;
-extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
-
-int __glXError(int error);
-
-/************************************************************************/
-
-typedef struct __GLXprovider __GLXprovider;
-struct __GLXprovider {
- __GLXscreen *(*screenProbe)(ScreenPtr pScreen);
- const char *name;
- __GLXprovider *next;
-};
-
-void GlxPushProvider(__GLXprovider *provider);
-
-enum {
- GLX_MINIMAL_VISUALS,
- GLX_TYPICAL_VISUALS,
- GLX_ALL_VISUALS
-};
-
-void __glXsetEnterLeaveServerFuncs(void (*enter)(GLboolean),
- void (*leave)(GLboolean));
-void __glXenterServer(GLboolean rendering);
-void __glXleaveServer(GLboolean rendering);
-
-void glxSuspendClients(void);
-void glxResumeClients(void);
-
-/*
-** State kept per client.
-*/
-struct __GLXclientStateRec {
- /*
- ** Whether this structure is currently being used to support a client.
- */
- Bool inUse;
-
- /*
- ** Buffer for returned data.
- */
- GLbyte *returnBuf;
- GLint returnBufSize;
-
- /*
- ** Keep track of large rendering commands, which span multiple requests.
- */
- GLint largeCmdBytesSoFar; /* bytes received so far */
- GLint largeCmdBytesTotal; /* total bytes expected */
- GLint largeCmdRequestsSoFar; /* requests received so far */
- GLint largeCmdRequestsTotal; /* total requests expected */
- GLbyte *largeCmdBuf;
- GLint largeCmdBufSize;
-
- /* Back pointer to X client record */
- ClientPtr client;
-
- int GLClientmajorVersion;
- int GLClientminorVersion;
- char *GLClientextensions;
-};
-
-/************************************************************************/
-
-/*
-** Dispatch tables.
-*/
-typedef void (*__GLXdispatchRenderProcPtr)(GLbyte *);
-typedef int (*__GLXdispatchSingleProcPtr)(__GLXclientState *, GLbyte *);
-typedef int (*__GLXdispatchVendorPrivProcPtr)(__GLXclientState *, GLbyte *);
-
-/*
- * Dispatch for GLX commands.
- */
-typedef int (*__GLXprocPtr)(__GLXclientState *, char *pc);
-
-/*
- * Tables for computing the size of each rendering command.
- */
-typedef int (*gl_proto_size_func)(const GLbyte *, Bool);
-
-typedef struct {
- int bytes;
- gl_proto_size_func varsize;
-} __GLXrenderSizeData;
-
-/************************************************************************/
-
-/*
-** X resources.
-*/
-extern RESTYPE __glXContextRes;
-extern RESTYPE __glXClientRes;
-extern RESTYPE __glXPixmapRes;
-extern RESTYPE __glXDrawableRes;
-
-/************************************************************************/
-
-/*
-** Prototypes.
-*/
-
-extern char *__glXcombine_strings(const char *, const char *);
-
-/*
-** Routines for sending swapped replies.
-*/
-
-extern void __glXSwapMakeCurrentReply(ClientPtr client,
- xGLXMakeCurrentReply *reply);
-extern void __glXSwapIsDirectReply(ClientPtr client,
- xGLXIsDirectReply *reply);
-extern void __glXSwapQueryVersionReply(ClientPtr client,
- xGLXQueryVersionReply *reply);
-extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
- xGLXQueryContextInfoEXTReply *reply,
- int *buf);
-extern void __glXSwapGetDrawableAttributesReply(ClientPtr client,
- xGLXGetDrawableAttributesReply *reply, CARD32 *buf);
-extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
- xGLXQueryExtensionsStringReply *reply, char *buf);
-extern void glxSwapQueryServerStringReply(ClientPtr client,
- xGLXQueryServerStringReply *reply, char *buf);
-
-
-/*
- * Routines for computing the size of variably-sized rendering commands.
- */
-
-extern int __glXTypeSize(GLenum enm);
-extern int __glXImageSize(GLenum format, GLenum type,
- GLenum target, GLsizei w, GLsizei h, GLsizei d,
- GLint imageHeight, GLint rowLength, GLint skipImages, GLint skipRows,
- GLint alignment);
-
-extern unsigned glxMajorVersion;
-extern unsigned glxMinorVersion;
-
-extern int __glXEventBase;
-
-#endif /* !__GLX_server_h__ */
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#ifndef _GLX_server_h_
+#define _GLX_server_h_
+
+/*
+ * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+ * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice including the dates of first publication and
+ * either this permission notice or a reference to
+ * http://oss.sgi.com/projects/FreeB/
+ * shall be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * Except as contained in this notice, the name of Silicon Graphics, Inc.
+ * shall not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization from
+ * Silicon Graphics, Inc.
+ */
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include <X11/Xmd.h>
+#include <misc.h>
+#include <dixstruct.h>
+#include <pixmapstr.h>
+#include <gcstruct.h>
+#include <extnsionst.h>
+#include <resource.h>
+#include <scrnintstr.h>
+
+#define GL_GLEXT_PROTOTYPES /* we want prototypes */
+#include <GL/gl.h>
+#include <GL/glext.h>
+#include <GL/glxproto.h>
+
+/*
+** GLX resources.
+*/
+typedef XID GLXContextID;
+typedef XID GLXPixmap;
+typedef XID GLXDrawable;
+
+typedef struct __GLXclientStateRec __GLXclientState;
+typedef struct __GLXdrawable __GLXdrawable;
+typedef struct __GLXcontext __GLXcontext;
+
+#include "glxscreens.h"
+#include "glxdrawable.h"
+#include "glxcontext.h"
+
+#ifndef True
+#define True 1
+#endif
+#ifndef False
+#define False 0
+#endif
+
+extern __GLXscreen *glxGetScreen(ScreenPtr pScreen);
+extern __GLXclientState *glxGetClient(ClientPtr pClient);
+
+/************************************************************************/
+
+void GlxExtensionInit(void);
+
+void GlxSetVisualConfigs(int nconfigs,
+ void *configs, void **privates);
+
+void __glXScreenInitVisuals(__GLXscreen *screen);
+
+/*
+** The last context used (from the server's persective) is cached.
+*/
+extern __GLXcontext *__glXLastContext;
+extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
+
+int __glXError(int error);
+
+/************************************************************************/
+
+typedef struct __GLXprovider __GLXprovider;
+struct __GLXprovider {
+ __GLXscreen *(*screenProbe)(ScreenPtr pScreen);
+ const char *name;
+ __GLXprovider *next;
+};
+
+void GlxPushProvider(__GLXprovider *provider);
+
+enum {
+ GLX_MINIMAL_VISUALS,
+ GLX_TYPICAL_VISUALS,
+ GLX_ALL_VISUALS
+};
+
+void __glXsetEnterLeaveServerFuncs(void (*enter)(GLboolean),
+ void (*leave)(GLboolean));
+void __glXenterServer(GLboolean rendering);
+void __glXleaveServer(GLboolean rendering);
+
+void glxSuspendClients(void);
+void glxResumeClients(void);
+
+/*
+** State kept per client.
+*/
+struct __GLXclientStateRec {
+ /*
+ ** Whether this structure is currently being used to support a client.
+ */
+ Bool inUse;
+
+ /*
+ ** Buffer for returned data.
+ */
+ GLbyte *returnBuf;
+ GLint returnBufSize;
+
+ /*
+ ** Keep track of large rendering commands, which span multiple requests.
+ */
+ GLint largeCmdBytesSoFar; /* bytes received so far */
+ GLint largeCmdBytesTotal; /* total bytes expected */
+ GLint largeCmdRequestsSoFar; /* requests received so far */
+ GLint largeCmdRequestsTotal; /* total requests expected */
+ GLbyte *largeCmdBuf;
+ GLint largeCmdBufSize;
+
+ /* Back pointer to X client record */
+ ClientPtr client;
+
+ int GLClientmajorVersion;
+ int GLClientminorVersion;
+ char *GLClientextensions;
+};
+
+/************************************************************************/
+
+/*
+** Dispatch tables.
+*/
+typedef void (*__GLXdispatchRenderProcPtr)(GLbyte *);
+typedef int (*__GLXdispatchSingleProcPtr)(__GLXclientState *, GLbyte *);
+typedef int (*__GLXdispatchVendorPrivProcPtr)(__GLXclientState *, GLbyte *);
+
+/*
+ * Dispatch for GLX commands.
+ */
+typedef int (*__GLXprocPtr)(__GLXclientState *, char *pc);
+
+/*
+ * Tables for computing the size of each rendering command.
+ */
+typedef int (*gl_proto_size_func)(const GLbyte *, Bool);
+
+typedef struct {
+ int bytes;
+ gl_proto_size_func varsize;
+} __GLXrenderSizeData;
+
+/************************************************************************/
+
+/*
+** X resources.
+*/
+extern RESTYPE __glXContextRes;
+extern RESTYPE __glXClientRes;
+extern RESTYPE __glXPixmapRes;
+extern RESTYPE __glXDrawableRes;
+
+/************************************************************************/
+
+/*
+** Prototypes.
+*/
+
+extern char *__glXcombine_strings(const char *, const char *);
+
+/*
+** Routines for sending swapped replies.
+*/
+
+extern void __glXSwapMakeCurrentReply(ClientPtr client,
+ xGLXMakeCurrentReply *reply);
+extern void __glXSwapIsDirectReply(ClientPtr client,
+ xGLXIsDirectReply *reply);
+extern void __glXSwapQueryVersionReply(ClientPtr client,
+ xGLXQueryVersionReply *reply);
+extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
+ xGLXQueryContextInfoEXTReply *reply,
+ int *buf);
+extern void __glXSwapGetDrawableAttributesReply(ClientPtr client,
+ xGLXGetDrawableAttributesReply *reply, CARD32 *buf);
+extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
+ xGLXQueryExtensionsStringReply *reply, char *buf);
+extern void glxSwapQueryServerStringReply(ClientPtr client,
+ xGLXQueryServerStringReply *reply, char *buf);
+
+
+/*
+ * Routines for computing the size of variably-sized rendering commands.
+ */
+
+extern int __glXTypeSize(GLenum enm);
+extern int __glXImageSize(GLenum format, GLenum type,
+ GLenum target, GLsizei w, GLsizei h, GLsizei d,
+ GLint imageHeight, GLint rowLength, GLint skipImages, GLint skipRows,
+ GLint alignment);
+
+extern unsigned glxMajorVersion;
+extern unsigned glxMinorVersion;
+
+extern int __glXEventBase;
+
+#endif /* !__GLX_server_h__ */
diff --git a/xorg-server/hw/dmx/config/xdmxconfig.c b/xorg-server/hw/dmx/config/xdmxconfig.c
index 2de7f2b85..3165ba000 100644
--- a/xorg-server/hw/dmx/config/xdmxconfig.c
+++ b/xorg-server/hw/dmx/config/xdmxconfig.c
@@ -49,7 +49,6 @@
#include <X11/Xaw/Viewport.h>
#include <X11/Xaw/Dialog.h>
#include <X11/keysym.h>
-#include <X11/Xmu/SysUtil.h>
#include "Canvas.h"
#include "dmxparse.h"
@@ -199,8 +198,8 @@ static void dmxConfigDataUpdate(void)
XtVaSetValues(ndbutton1, XtNsensitive, False, NULL);
} else {
name = dmxConfigCurrent->name;
- XmuSnprintf(cnambuf, sizeof(cnambuf), "%s", name ? name : "");
- XmuSnprintf(cdimbuf, sizeof(cdimbuf), "%dx%d",
+ snprintf(cnambuf, sizeof(cnambuf), "%s", name ? name : "");
+ snprintf(cdimbuf, sizeof(cdimbuf), "%dx%d",
dmxConfigWallWidth, dmxConfigWallHeight);
XtVaSetValues(cnamebox, XtNlabel, cnambuf, XtNsensitive, True, NULL);
XtVaSetValues(cdimbox, XtNlabel, cdimbuf, XtNsensitive, True, NULL);
@@ -219,22 +218,22 @@ static void dmxConfigDataUpdate(void)
XtVaSetValues(ddbutton, XtNsensitive, False, NULL);
} else {
name = dmxConfigCurrentDisplay->name;
- XmuSnprintf(nambuf, sizeof(nambuf), "%s", name ? name : "");
- XmuSnprintf(dimbuf, sizeof(dimbuf), "%dx%d%c%d%c%d",
+ snprintf(nambuf, sizeof(nambuf), "%s", name ? name : "");
+ snprintf(dimbuf, sizeof(dimbuf), "%dx%d%c%d%c%d",
dmxConfigCurrentDisplay->scrnWidth,
dmxConfigCurrentDisplay->scrnHeight,
dmxConfigCurrentDisplay->scrnXSign < 0 ? '-' : '+',
dmxConfigCurrentDisplay->scrnX,
dmxConfigCurrentDisplay->scrnYSign < 0 ? '-' : '+',
dmxConfigCurrentDisplay->scrnY);
- XmuSnprintf(rtbuf, sizeof(dimbuf), "%dx%d%c%d%c%d",
+ snprintf(rtbuf, sizeof(dimbuf), "%dx%d%c%d%c%d",
dmxConfigCurrentDisplay->rootWidth,
dmxConfigCurrentDisplay->rootHeight,
dmxConfigCurrentDisplay->rootXSign < 0 ? '-' : '+',
dmxConfigCurrentDisplay->rootX,
dmxConfigCurrentDisplay->rootYSign < 0 ? '-' : '+',
dmxConfigCurrentDisplay->rootY);
- XmuSnprintf(offbuf, sizeof(offbuf), "@%dx%d",
+ snprintf(offbuf, sizeof(offbuf), "@%dx%d",
dmxConfigCurrentDisplay->rootXOrigin,
dmxConfigCurrentDisplay->rootYOrigin);
XtVaSetValues(namebox, XtNlabel, nambuf, XtNsensitive, True, NULL);
@@ -596,14 +595,14 @@ static void dmxConfigCanCallback(Widget w, XtPointer closure,
static void dmxConfigECCallback(Widget w, XtPointer closure,
XtPointer callData)
{
- char buf[256]; /* RATS: Only used in XmuSnprintf */
+ char buf[256]; /* RATS: Only used in snprintf */
if (!dmxConfigCurrent) return;
dmxConfigSetPopupPosition(ecpopup);
XtVaSetValues(ecdialog0, XtNvalue,
dmxConfigCurrent->name ? dmxConfigCurrent->name : "",
NULL);
- XmuSnprintf(buf, sizeof(buf), "%dx%d",
+ snprintf(buf, sizeof(buf), "%dx%d",
dmxConfigCurrent->width, dmxConfigCurrent->height);
XtVaSetValues(ecdialog1, XtNvalue, buf, NULL);
XtPopup(ecpopup, XtGrabExclusive);
@@ -692,7 +691,7 @@ static void dmxConfigECCanCallback(Widget w, XtPointer closure,
static void dmxConfigEDCallback(Widget w, XtPointer closure,
XtPointer callData)
{
- char buf[256]; /* RATS: Only used in XmuSnprintf */
+ char buf[256]; /* RATS: Only used in snprintf */
if (!dmxConfigCurrent || !dmxConfigCurrentDisplay) return;
dmxConfigSetPopupPosition(edpopup);
@@ -701,7 +700,7 @@ static void dmxConfigEDCallback(Widget w, XtPointer closure,
? dmxConfigCurrentDisplay->name
: "",
NULL);
- XmuSnprintf(buf, sizeof(buf), "%dx%d%c%d%c%d",
+ snprintf(buf, sizeof(buf), "%dx%d%c%d%c%d",
dmxConfigCurrentDisplay->scrnWidth,
dmxConfigCurrentDisplay->scrnHeight,
dmxConfigCurrentDisplay->scrnXSign < 0 ? '-' : '+',
@@ -709,7 +708,7 @@ static void dmxConfigEDCallback(Widget w, XtPointer closure,
dmxConfigCurrentDisplay->scrnYSign < 0 ? '-' : '+',
dmxConfigCurrentDisplay->scrnY);
XtVaSetValues(eddialog1, XtNvalue, buf, NULL);
- XmuSnprintf(buf, sizeof(buf), "@%dx%d",
+ snprintf(buf, sizeof(buf), "@%dx%d",
dmxConfigCurrentDisplay->rootXOrigin,
dmxConfigCurrentDisplay->rootYOrigin);
XtVaSetValues(eddialog2, XtNvalue, buf, NULL);
diff --git a/xorg-server/hw/dmx/dmx.c b/xorg-server/hw/dmx/dmx.c
index 5de565f85..01a744849 100644
--- a/xorg-server/hw/dmx/dmx.c
+++ b/xorg-server/hw/dmx/dmx.c
@@ -1,1097 +1,1068 @@
-/*
- * Copyright 2002-2004 Red Hat Inc., Durham, North Carolina.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation on the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial
- * portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-/*
- * Authors:
- * Rickard E. (Rik) Faith <faith@redhat.com>
- *
- */
-
-/** \file
- * This file implements the server-side part of the DMX protocol. A
- * vector of fucntions is provided at extension initialization time, so
- * most all of the useful functions in this file are declared static and
- * do not appear in the doxygen documentation.
- *
- * Much of the low-level work is done by functions in \a dmxextension.c
- *
- * Please see the Client-to-Server DMX Extension to the X Protocol
- * document for details about the protocol. */
-
-#ifdef HAVE_DMX_CONFIG_H
-#include <dmx-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "misc.h"
-#include "os.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "opaque.h"
-
-#include "dmxextension.h"
-#include <X11/extensions/dmxproto.h>
-#include <X11/extensions/dmx.h>
-#include "protocol-versions.h"
-
-#ifdef PANORAMIX
-#include "panoramiX.h"
-extern unsigned long XRT_WINDOW;
-extern int PanoramiXNumScreens;
-#endif
-
-extern void DMXExtensionInit(void);
-
-static unsigned char DMXCode;
-
-
-
-static int _DMXXineramaActive(void)
-{
-#ifdef PANORAMIX
- return !noPanoramiXExtension;
-#endif
- return 0;
-}
-
-static void dmxSetScreenAttribute(int bit, DMXScreenAttributesPtr attr,
- CARD32 value)
-{
- switch (1 << bit) {
- case DMXScreenWindowWidth: attr->screenWindowWidth = value; break;
- case DMXScreenWindowHeight: attr->screenWindowHeight = value; break;
- case DMXScreenWindowXoffset: attr->screenWindowXoffset = value; break;
- case DMXScreenWindowYoffset: attr->screenWindowYoffset = value; break;
- case DMXRootWindowWidth: attr->rootWindowWidth = value; break;
- case DMXRootWindowHeight: attr->rootWindowHeight = value; break;
- case DMXRootWindowXoffset: attr->rootWindowXoffset = value; break;
- case DMXRootWindowYoffset: attr->rootWindowYoffset = value; break;
- case DMXRootWindowXorigin: attr->rootWindowXorigin = value; break;
- case DMXRootWindowYorigin: attr->rootWindowYorigin = value; break;
- }
-}
-
-static int dmxFetchScreenAttributes(unsigned int mask,
- DMXScreenAttributesPtr attr,
- CARD32 *value_list)
-{
- int i;
- CARD32 *value = value_list;
- int count = 0;
-
- for (i = 0; i < 32; i++) {
- if (mask & (1 << i)) {
- dmxSetScreenAttribute(i, attr, *value);
- ++value;
- ++count;
- }
- }
- return count;
-}
-
-static void dmxSetDesktopAttribute(int bit, DMXDesktopAttributesPtr attr,
- CARD32 value)
-{
- switch (1 << bit) {
- case DMXDesktopWidth: attr->width = value; break;
- case DMXDesktopHeight: attr->height = value; break;
- case DMXDesktopShiftX: attr->shiftX = value; break;
- case DMXDesktopShiftY: attr->shiftY = value; break;
- }
-}
-
-static int dmxFetchDesktopAttributes(unsigned int mask,
- DMXDesktopAttributesPtr attr,
- CARD32 *value_list)
-{
- int i;
- CARD32 *value = value_list;
- int count = 0;
-
- for (i = 0; i < 32; i++) {
- if (mask & (1 << i)) {
- dmxSetDesktopAttribute(i, attr, *value);
- ++value;
- ++count;
- }
- }
- return count;
-}
-
-static void dmxSetInputAttribute(int bit, DMXInputAttributesPtr attr,
- CARD32 value)
-{
- switch (1 << bit) {
- case DMXInputType: attr->inputType = value; break;
- case DMXInputPhysicalScreen: attr->physicalScreen = value; break;
- case DMXInputSendsCore: attr->sendsCore = !!value; break;
- }
-}
-
-static int dmxFetchInputAttributes(unsigned int mask,
- DMXInputAttributesPtr attr,
- CARD32 *value_list)
-{
- int i;
- CARD32 *value = value_list;
- int count = 0;
-
- for (i = 0; i < 32; i++) {
- if (mask & (1 << i)) {
- dmxSetInputAttribute(i, attr, *value);
- ++value;
- ++count;
- }
- }
- return count;
-}
-
-static int ProcDMXQueryVersion(ClientPtr client)
-{
- xDMXQueryVersionReply rep;
- int n;
-
- REQUEST_SIZE_MATCH(xDMXQueryVersionReq);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.majorVersion = SERVER_DMX_MAJOR_VERSION;
- rep.minorVersion = SERVER_DMX_MINOR_VERSION;
- rep.patchVersion = SERVER_DMX_PATCH_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.majorVersion, n);
- swapl(&rep.minorVersion, n);
- swapl(&rep.patchVersion, n);
- }
- WriteToClient(client, sizeof(xDMXQueryVersionReply), (char *)&rep);
- return Success;
-}
-
-static int ProcDMXSync(ClientPtr client)
-{
- xDMXSyncReply rep;
- int n;
-
- REQUEST_SIZE_MATCH(xDMXSyncReq);
-
- dmxFlushPendingSyncs();
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = 0;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.status, n);
- }
- WriteToClient(client, sizeof(xDMXSyncReply), (char *)&rep);
- return Success;
-}
-
-static int ProcDMXForceWindowCreation(ClientPtr client)
-{
- xDMXForceWindowCreationReply rep;
- REQUEST(xDMXForceWindowCreationReq);
- WindowPtr pWin;
- int n;
-
- REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq);
-
-#ifdef PANORAMIX
- if (!noPanoramiXExtension) {
- PanoramiXRes *win;
- int i;
-
- if (Success != dixLookupResourceByType((pointer*) &win,
- stuff->window, XRT_WINDOW,
- client, DixReadAccess))
- return -1; /* BadWindow */
-
- FOR_NSCREENS(i) {
- if (Success != dixLookupWindow(&pWin, win->info[i].id, client,
- DixReadAccess))
- return -1; /* BadWindow */
-
- dmxForceWindowCreation(pWin);
- }
- goto doreply;
- }
-#endif
-
- if (Success != dixLookupWindow(&pWin, stuff->window, client,
- DixReadAccess))
- return -1; /* BadWindow */
-
- dmxForceWindowCreation(pWin);
- doreply:
- dmxFlushPendingSyncs();
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = 0;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.status, n);
- }
- WriteToClient(client, sizeof(xDMXForceWindowCreationReply), (char *)&rep);
- return Success;
-}
-
-static int ProcDMXGetScreenCount(ClientPtr client)
-{
- xDMXGetScreenCountReply rep;
- int n;
-
- REQUEST_SIZE_MATCH(xDMXGetScreenCountReq);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.screenCount = dmxGetNumScreens();
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.screenCount, n);
- }
- WriteToClient(client, sizeof(xDMXGetScreenCountReply), (char *)&rep);
- return Success;
-}
-
-static int ProcDMXGetScreenAttributes(ClientPtr client)
-{
- REQUEST(xDMXGetScreenAttributesReq);
- xDMXGetScreenAttributesReply rep;
- int n;
- int length;
- int paddedLength;
- DMXScreenAttributesRec attr;
-
- REQUEST_SIZE_MATCH(xDMXGetScreenAttributesReq);
-
- if (stuff->physicalScreen < 0
- || stuff->physicalScreen >= dmxGetNumScreens()) return BadValue;
-
- if (!dmxGetScreenAttributes(stuff->physicalScreen, &attr))
- return BadValue;
-
- rep.logicalScreen = attr.logicalScreen;
- rep.screenWindowWidth = attr.screenWindowWidth;
- rep.screenWindowHeight = attr.screenWindowHeight;
- rep.screenWindowXoffset = attr.screenWindowXoffset;
- rep.screenWindowYoffset = attr.screenWindowYoffset;
- rep.rootWindowWidth = attr.rootWindowWidth;
- rep.rootWindowHeight = attr.rootWindowHeight;
- rep.rootWindowXoffset = attr.rootWindowXoffset;
- rep.rootWindowYoffset = attr.rootWindowYoffset;
- rep.rootWindowXorigin = attr.rootWindowXorigin;
- rep.rootWindowYorigin = attr.rootWindowYorigin;
-
- length = attr.displayName ? strlen(attr.displayName) : 0;
- paddedLength = pad_to_int32(length);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = bytes_to_int32((sizeof(xDMXGetScreenAttributesReply) - sizeof(xGenericReply))
- + paddedLength);
- rep.displayNameLength = length;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.displayNameLength, n);
- swapl(&rep.logicalScreen, n);
- swaps(&rep.screenWindowWidth, n);
- swaps(&rep.screenWindowHeight, n);
- swaps(&rep.screenWindowXoffset, n);
- swaps(&rep.screenWindowYoffset, n);
- swaps(&rep.rootWindowWidth, n);
- swaps(&rep.rootWindowHeight, n);
- swaps(&rep.rootWindowXoffset, n);
- swaps(&rep.rootWindowYoffset, n);
- swaps(&rep.rootWindowXorigin, n);
- swaps(&rep.rootWindowYorigin, n);
- }
- WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), (char *)&rep);
- if (length) WriteToClient(client, length, (char *)attr.displayName);
- return Success;
-}
-
-static int ProcDMXChangeScreensAttributes(ClientPtr client)
-{
- REQUEST(xDMXChangeScreensAttributesReq);
- xDMXChangeScreensAttributesReply rep;
- int n;
- int status = DMX_BAD_XINERAMA;
- unsigned int mask = 0;
- unsigned int i;
- CARD32 *screen_list;
- CARD32 *mask_list;
- CARD32 *value_list;
- DMXScreenAttributesPtr attribs;
- int errorScreen = 0;
- unsigned int len;
- int ones = 0;
-
-
- REQUEST_AT_LEAST_SIZE(xDMXChangeScreensAttributesReq);
- len = client->req_len - bytes_to_int32(sizeof(xDMXChangeScreensAttributesReq));
- if (len < stuff->screenCount + stuff->maskCount)
- return BadLength;
-
- screen_list = (CARD32 *)(stuff + 1);
- mask_list = &screen_list[stuff->screenCount];
- value_list = &mask_list[stuff->maskCount];
-
- for (i = 0; i < stuff->maskCount; i++) ones += Ones(mask_list[i]);
- if (len != stuff->screenCount + stuff->maskCount + ones)
- return BadLength;
-
- if (!_DMXXineramaActive()) goto noxinerama;
-
- if (!(attribs = malloc(stuff->screenCount * sizeof(*attribs))))
- return BadAlloc;
-
- for (i = 0; i < stuff->screenCount; i++) {
- int count;
-
- if (i < stuff->maskCount) mask = mask_list[i];
- dmxGetScreenAttributes(screen_list[i], &attribs[i]);
- count = dmxFetchScreenAttributes(mask, &attribs[i], value_list);
- value_list += count;
- }
-
-#if PANORAMIX
- status = dmxConfigureScreenWindows(stuff->screenCount,
- screen_list,
- attribs,
- &errorScreen);
-#endif
-
- free(attribs);
-
- if (status == BadValue) return status;
-
- noxinerama:
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
- rep.errorScreen = errorScreen;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.status, n);
- swapl(&rep.errorScreen, n);
- }
- WriteToClient(client,
- sizeof(xDMXChangeScreensAttributesReply),
- (char *)&rep);
- return Success;
-}
-
-static int ProcDMXAddScreen(ClientPtr client)
-{
- REQUEST(xDMXAddScreenReq);
- xDMXAddScreenReply rep;
- int n;
- int status = 0;
- CARD32 *value_list;
- DMXScreenAttributesRec attr;
- int count;
- char *name;
- int len;
- int paddedLength;
-
- REQUEST_AT_LEAST_SIZE(xDMXAddScreenReq);
- paddedLength = pad_to_int32(stuff->displayNameLength);
- len = client->req_len - bytes_to_int32(sizeof(xDMXAddScreenReq));
- if (len != Ones(stuff->valueMask) + paddedLength/4)
- return BadLength;
-
- memset(&attr, 0, sizeof(attr));
- dmxGetScreenAttributes(stuff->physicalScreen, &attr);
- value_list = (CARD32 *)(stuff + 1);
- count = dmxFetchScreenAttributes(stuff->valueMask, &attr, value_list);
-
- if (!(name = malloc(stuff->displayNameLength + 1 + 4)))
- return BadAlloc;
- memcpy(name, &value_list[count], stuff->displayNameLength);
- name[stuff->displayNameLength] = '\0';
- attr.displayName = name;
-
- status = dmxAttachScreen(stuff->physicalScreen, &attr);
-
- free(name);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
- rep.physicalScreen = stuff->physicalScreen;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.status, n);
- swapl(&rep.physicalScreen, n);
- }
- WriteToClient(client,
- sizeof(xDMXAddScreenReply),
- (char *)&rep);
- return Success;
-}
-
-static int ProcDMXRemoveScreen(ClientPtr client)
-{
- REQUEST(xDMXRemoveScreenReq);
- xDMXRemoveScreenReply rep;
- int n;
- int status = 0;
-
- REQUEST_SIZE_MATCH(xDMXRemoveScreenReq);
-
- status = dmxDetachScreen(stuff->physicalScreen);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.status, n);
- }
- WriteToClient(client,
- sizeof(xDMXRemoveScreenReply),
- (char *)&rep);
- return Success;
-}
-
-
-#ifdef PANORAMIX
-static int dmxPopulatePanoramiX(ClientPtr client, Window window,
- CARD32 *screens, CARD32 *windows,
- xRectangle *pos, xRectangle *vis)
-{
- WindowPtr pWin;
- PanoramiXRes *win;
- int i;
- int count = 0;
- DMXWindowAttributesRec attr;
-
- if (Success != dixLookupResourceByType((pointer*) &win,
- window, XRT_WINDOW,
- client, DixReadAccess))
- return -1; /* BadWindow */
-
- FOR_NSCREENS(i) {
- if (Success != dixLookupWindow(&pWin, win->info[i].id, client,
- DixReadAccess))
- return -1; /* BadWindow */
- if (dmxGetWindowAttributes(pWin, &attr)) {
- screens[count] = attr.screen;
- windows[count] = attr.window;
- pos[count] = attr.pos;
- vis[count] = attr.vis;
- ++count; /* Only count existing windows */
- }
- }
- return count;
-}
-#endif
-
-static int dmxPopulate(ClientPtr client, Window window, CARD32 *screens,
- CARD32 *windows, xRectangle *pos, xRectangle *vis)
-{
- WindowPtr pWin;
- DMXWindowAttributesRec attr;
-
-#ifdef PANORAMIX
- if (!noPanoramiXExtension)
- return dmxPopulatePanoramiX(client, window, screens, windows,
- pos, vis);
-#endif
-
- if (Success != dixLookupWindow(&pWin, window, client, DixReadAccess))
- return -1; /* BadWindow */
-
- dmxGetWindowAttributes(pWin, &attr);
- *screens = attr.screen;
- *windows = attr.window;
- *pos = attr.pos;
- *vis = attr.vis;
- return 1;
-}
-
-static int dmxMaxNumScreens(void)
-{
-#ifdef PANORAMIX
- if (!noPanoramiXExtension) return PanoramiXNumScreens;
-#endif
- return 1;
-}
-
-static int ProcDMXGetWindowAttributes(ClientPtr client)
-{
- REQUEST(xDMXGetWindowAttributesReq);
- xDMXGetWindowAttributesReply rep;
- int i, n;
- CARD32 *screens;
- CARD32 *windows;
- xRectangle *pos, *vis;
- int count = dmxMaxNumScreens();
-
- REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq);
-
- if (!(screens = malloc(count * sizeof(*screens))))
- return BadAlloc;
- if (!(windows = malloc(count * sizeof(*windows)))) {
- free(screens);
- return BadAlloc;
- }
- if (!(pos = malloc(count * sizeof(*pos)))) {
- free(windows);
- free(screens);
- return BadAlloc;
- }
- if (!(vis = malloc(count * sizeof(*vis)))) {
- free(pos);
- free(windows);
- free(screens);
- return BadAlloc;
- }
-
- if ((count = dmxPopulate(client, stuff->window, screens, windows,
- pos, vis)) < 0) {
- free(vis);
- free(pos);
- free(windows);
- free(screens);
- return BadWindow;
- }
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = count * 6;
- rep.screenCount = count;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.screenCount, n);
- for (i = 0; i < count; i++) {
- swapl(&screens[i], n);
- swapl(&windows[i], n);
-
- swaps(&pos[i].x, n);
- swaps(&pos[i].y, n);
- swaps(&pos[i].width, n);
- swaps(&pos[i].height, n);
-
- swaps(&vis[i].x, n);
- swaps(&vis[i].y, n);
- swaps(&vis[i].width, n);
- swaps(&vis[i].height, n);
- }
- }
-
- dmxFlushPendingSyncs();
-
- WriteToClient(client, sizeof(xDMXGetWindowAttributesReply), (char *)&rep);
- if (count) {
- WriteToClient(client, count * sizeof(*screens), (char *)screens);
- WriteToClient(client, count * sizeof(*windows), (char *)windows);
- WriteToClient(client, count * sizeof(*pos), (char *)pos);
- WriteToClient(client, count * sizeof(*vis), (char *)vis);
- }
-
- free(vis);
- free(pos);
- free(windows);
- free(screens);
-
- return Success;
-}
-
-static int ProcDMXGetDesktopAttributes(ClientPtr client)
-{
- xDMXGetDesktopAttributesReply rep;
- int n;
- DMXDesktopAttributesRec attr;
-
- REQUEST_SIZE_MATCH(xDMXGetDesktopAttributesReq);
-
- dmxGetDesktopAttributes(&attr);
-
- rep.width = attr.width;
- rep.height = attr.height;
- rep.shiftX = attr.shiftX;
- rep.shiftY = attr.shiftY;
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.width, n);
- swapl(&rep.height, n);
- swapl(&rep.shiftX, n);
- swapl(&rep.shiftY, n);
- }
- WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), (char *)&rep);
- return Success;
-}
-
-static int ProcDMXChangeDesktopAttributes(ClientPtr client)
-{
- REQUEST(xDMXChangeDesktopAttributesReq);
- xDMXChangeDesktopAttributesReply rep;
- int n;
- int status = DMX_BAD_XINERAMA;
- CARD32 *value_list;
- DMXDesktopAttributesRec attr;
- int len;
-
- REQUEST_AT_LEAST_SIZE(xDMXChangeDesktopAttributesReq);
- len = client->req_len - (sizeof(xDMXChangeDesktopAttributesReq) >> 2);
- if (len != Ones(stuff->valueMask))
- return BadLength;
-
- if (!_DMXXineramaActive()) goto noxinerama;
-
- value_list = (CARD32 *)(stuff + 1);
-
- dmxGetDesktopAttributes(&attr);
- dmxFetchDesktopAttributes(stuff->valueMask, &attr, value_list);
-
-#if PANORAMIX
- status = dmxConfigureDesktop(&attr);
-#endif
- if (status == BadValue) return status;
-
- noxinerama:
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.status, n);
- }
- WriteToClient(client,
- sizeof(xDMXChangeDesktopAttributesReply),
- (char *)&rep);
- return Success;
-}
-
-static int ProcDMXGetInputCount(ClientPtr client)
-{
- xDMXGetInputCountReply rep;
- int n;
-
- REQUEST_SIZE_MATCH(xDMXGetInputCountReq);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.inputCount = dmxGetInputCount();
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.inputCount, n);
- }
- WriteToClient(client, sizeof(xDMXGetInputCountReply), (char *)&rep);
- return Success;
-}
-
-static int ProcDMXGetInputAttributes(ClientPtr client)
-{
- REQUEST(xDMXGetInputAttributesReq);
- xDMXGetInputAttributesReply rep;
- int n;
- int length;
- int paddedLength;
- DMXInputAttributesRec attr;
-
- REQUEST_SIZE_MATCH(xDMXGetInputAttributesReq);
-
- if (dmxGetInputAttributes(stuff->deviceId, &attr)) return BadValue;
- rep.inputType = attr.inputType;
- rep.physicalScreen = attr.physicalScreen;
- rep.physicalId = attr.physicalId;
- rep.isCore = attr.isCore;
- rep.sendsCore = attr.sendsCore;
- rep.detached = attr.detached;
-
- length = attr.name ? strlen(attr.name) : 0;
- paddedLength = pad_to_int32(length);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = bytes_to_int32(paddedLength);
- rep.nameLength = length;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.inputType, n);
- swapl(&rep.physicalScreen, n);
- swapl(&rep.physicalId, n);
- swapl(&rep.nameLength, n);
- }
- WriteToClient(client, sizeof(xDMXGetInputAttributesReply), (char *)&rep);
- if (length) WriteToClient(client, length, (char *)attr.name);
- return Success;
-}
-
-static int ProcDMXAddInput(ClientPtr client)
-{
- REQUEST(xDMXAddInputReq);
- xDMXAddInputReply rep;
- int n;
- int status = 0;
- CARD32 *value_list;
- DMXInputAttributesRec attr;
- int count;
- char *name;
- int len;
- int paddedLength;
- int id = -1;
-
- REQUEST_AT_LEAST_SIZE(xDMXAddInputReq);
- paddedLength = pad_to_int32(stuff->displayNameLength);
- len = client->req_len - (sizeof(xDMXAddInputReq) >> 2);
- if (len != Ones(stuff->valueMask) + paddedLength/4)
- return BadLength;
-
- memset(&attr, 0, sizeof(attr));
- value_list = (CARD32 *)(stuff + 1);
- count = dmxFetchInputAttributes(stuff->valueMask, &attr, value_list);
-
- if (!(name = malloc(stuff->displayNameLength + 1 + 4)))
- return BadAlloc;
- memcpy(name, &value_list[count], stuff->displayNameLength);
- name[stuff->displayNameLength] = '\0';
- attr.name = name;
-
- status = dmxAddInput(&attr, &id);
-
- free(name);
-
- if (status) return status;
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
- rep.physicalId = id;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.status, n);
- swapl(&rep.physicalId, n);
- }
- WriteToClient(client, sizeof(xDMXAddInputReply), (char *)&rep);
- return Success;
-}
-
-static int ProcDMXRemoveInput(ClientPtr client)
-{
- REQUEST(xDMXRemoveInputReq);
- xDMXRemoveInputReply rep;
- int n;
- int status = 0;
-
- REQUEST_SIZE_MATCH(xDMXRemoveInputReq);
-
- status = dmxRemoveInput(stuff->physicalId);
-
- if (status) return status;
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.status = status;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.status, n);
- }
- WriteToClient(client, sizeof(xDMXRemoveInputReply), (char *)&rep);
- return Success;
-}
-
-static int ProcDMXDispatch(ClientPtr client)
-{
- REQUEST(xReq);
-
- switch (stuff->data) {
- case X_DMXQueryVersion: return ProcDMXQueryVersion(client);
- case X_DMXSync: return ProcDMXSync(client);
- case X_DMXForceWindowCreation: return ProcDMXForceWindowCreation(client);
- case X_DMXGetScreenCount: return ProcDMXGetScreenCount(client);
- case X_DMXGetScreenAttributes: return ProcDMXGetScreenAttributes(client);
- case X_DMXChangeScreensAttributes:
- return ProcDMXChangeScreensAttributes(client);
- case X_DMXAddScreen: return ProcDMXAddScreen(client);
- case X_DMXRemoveScreen: return ProcDMXRemoveScreen(client);
- case X_DMXGetWindowAttributes: return ProcDMXGetWindowAttributes(client);
- case X_DMXGetDesktopAttributes: return ProcDMXGetDesktopAttributes(client);
- case X_DMXChangeDesktopAttributes:
- return ProcDMXChangeDesktopAttributes(client);
- case X_DMXGetInputCount: return ProcDMXGetInputCount(client);
- case X_DMXGetInputAttributes: return ProcDMXGetInputAttributes(client);
- case X_DMXAddInput: return ProcDMXAddInput(client);
- case X_DMXRemoveInput: return ProcDMXRemoveInput(client);
-
- case X_DMXGetScreenInformationDEPRECATED:
- case X_DMXForceWindowCreationDEPRECATED:
- case X_DMXReconfigureScreenDEPRECATED:
- return BadImplementation;
-
- default: return BadRequest;
- }
-}
-
-static int SProcDMXQueryVersion(ClientPtr client)
-{
- int n;
- REQUEST(xDMXQueryVersionReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDMXQueryVersionReq);
- return ProcDMXQueryVersion(client);
-}
-
-static int SProcDMXSync(ClientPtr client)
-{
- int n;
- REQUEST(xDMXSyncReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDMXSyncReq);
- return ProcDMXSync(client);
-}
-
-static int SProcDMXForceWindowCreation(ClientPtr client)
-{
- int n;
- REQUEST(xDMXForceWindowCreationReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq);
- swaps(&stuff->window, n);
- return ProcDMXForceWindowCreation(client);
-}
-
-static int SProcDMXGetScreenCount(ClientPtr client)
-{
- int n;
- REQUEST(xDMXGetScreenCountReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDMXGetScreenCountReq);
- return ProcDMXGetScreenCount(client);
-}
-
-static int SProcDMXGetScreenAttributes(ClientPtr client)
-{
- int n;
- REQUEST(xDMXGetScreenAttributesReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDMXGetScreenAttributesReq);
- swapl(&stuff->physicalScreen, n);
- return ProcDMXGetScreenAttributes(client);
-}
-
-static int SProcDMXChangeScreensAttributes(ClientPtr client)
-{
- int n;
- REQUEST(xDMXChangeScreensAttributesReq);
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xDMXGetScreenAttributesReq);
- swapl(&stuff->screenCount, n);
- swapl(&stuff->maskCount, n);
- SwapRestL(stuff);
- return ProcDMXGetScreenAttributes(client);
-}
-
-static int SProcDMXAddScreen(ClientPtr client)
-{
- int n;
- int paddedLength;
- REQUEST(xDMXAddScreenReq);
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xDMXAddScreenReq);
- swapl(&stuff->displayNameLength, n);
- swapl(&stuff->valueMask, n);
- paddedLength = pad_to_int32(stuff->displayNameLength);
- SwapLongs((CARD32 *)(stuff+1), LengthRestL(stuff) - paddedLength/4);
- return ProcDMXAddScreen(client);
-}
-
-static int SProcDMXRemoveScreen(ClientPtr client)
-{
- int n;
- REQUEST(xDMXRemoveScreenReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDMXRemoveScreenReq);
- swapl(&stuff->physicalScreen, n);
- return ProcDMXRemoveScreen(client);
-}
-
-static int SProcDMXGetWindowAttributes(ClientPtr client)
-{
- int n;
- REQUEST(xDMXGetWindowAttributesReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq);
- swapl(&stuff->window, n);
- return ProcDMXGetWindowAttributes(client);
-}
-
-static int SProcDMXGetDesktopAttributes(ClientPtr client)
-{
- int n;
- REQUEST(xDMXGetDesktopAttributesReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDMXGetDesktopAttributesReq);
- return ProcDMXGetDesktopAttributes(client);
-}
-
-static int SProcDMXChangeDesktopAttributes(ClientPtr client)
-{
- int n;
- REQUEST(xDMXChangeDesktopAttributesReq);
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xDMXChangeDesktopAttributesReq);
- swapl(&stuff->valueMask, n);
- SwapRestL(stuff);
- return ProcDMXChangeDesktopAttributes(client);
-}
-
-static int SProcDMXGetInputCount(ClientPtr client)
-{
- int n;
- REQUEST(xDMXGetInputCountReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDMXGetInputCountReq);
- return ProcDMXGetInputCount(client);
-}
-
-static int SProcDMXGetInputAttributes(ClientPtr client)
-{
- int n;
- REQUEST(xDMXGetInputAttributesReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDMXGetInputAttributesReq);
- swapl(&stuff->deviceId, n);
- return ProcDMXGetInputAttributes(client);
-}
-
-static int SProcDMXAddInput(ClientPtr client)
-{
- int n;
- int paddedLength;
- REQUEST(xDMXAddInputReq);
-
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xDMXAddInputReq);
- swapl(&stuff->displayNameLength, n);
- swapl(&stuff->valueMask, n);
- paddedLength = pad_to_int32(stuff->displayNameLength);
- SwapLongs((CARD32 *)(stuff+1), LengthRestL(stuff) - paddedLength/4);
- return ProcDMXAddInput(client);
-}
-
-static int SProcDMXRemoveInput(ClientPtr client)
-{
- int n;
- REQUEST(xDMXRemoveInputReq);
-
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xDMXRemoveInputReq);
- swapl(&stuff->physicalId, n);
- return ProcDMXRemoveInput(client);
-}
-
-static int SProcDMXDispatch (ClientPtr client)
-{
- REQUEST(xReq);
-
- switch (stuff->data) {
- case X_DMXQueryVersion: return SProcDMXQueryVersion(client);
- case X_DMXSync: return SProcDMXSync(client);
- case X_DMXForceWindowCreation: return SProcDMXForceWindowCreation(client);
- case X_DMXGetScreenCount: return SProcDMXGetScreenCount(client);
- case X_DMXGetScreenAttributes: return SProcDMXGetScreenAttributes(client);
- case X_DMXChangeScreensAttributes:
- return SProcDMXChangeScreensAttributes(client);
- case X_DMXAddScreen: return SProcDMXAddScreen(client);
- case X_DMXRemoveScreen: return SProcDMXRemoveScreen(client);
- case X_DMXGetWindowAttributes: return SProcDMXGetWindowAttributes(client);
- case X_DMXGetDesktopAttributes:
- return SProcDMXGetDesktopAttributes(client);
- case X_DMXChangeDesktopAttributes:
- return SProcDMXChangeDesktopAttributes(client);
- case X_DMXGetInputCount: return SProcDMXGetInputCount(client);
- case X_DMXGetInputAttributes: return SProcDMXGetInputAttributes(client);
- case X_DMXAddInput: return SProcDMXAddInput(client);
- case X_DMXRemoveInput: return SProcDMXRemoveInput(client);
-
- case X_DMXGetScreenInformationDEPRECATED:
- case X_DMXForceWindowCreationDEPRECATED:
- case X_DMXReconfigureScreenDEPRECATED:
- return BadImplementation;
-
- default: return BadRequest;
- }
-}
-
-/** Initialize the extension. */
-void DMXExtensionInit(void)
-{
- ExtensionEntry *extEntry;
-
- if ((extEntry = AddExtension(DMX_EXTENSION_NAME, 0, 0,
- ProcDMXDispatch, SProcDMXDispatch,
- NULL, StandardMinorOpcode)))
- DMXCode = extEntry->base;
-}
+/*
+ * Copyright 2002-2004 Red Hat Inc., Durham, North Carolina.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation on the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/*
+ * Authors:
+ * Rickard E. (Rik) Faith <faith@redhat.com>
+ *
+ */
+
+/** \file
+ * This file implements the server-side part of the DMX protocol. A
+ * vector of fucntions is provided at extension initialization time, so
+ * most all of the useful functions in this file are declared static and
+ * do not appear in the doxygen documentation.
+ *
+ * Much of the low-level work is done by functions in \a dmxextension.c
+ *
+ * Please see the Client-to-Server DMX Extension to the X Protocol
+ * document for details about the protocol. */
+
+#ifdef HAVE_DMX_CONFIG_H
+#include <dmx-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "os.h"
+#include "dixstruct.h"
+#include "extnsionst.h"
+#include "opaque.h"
+
+#include "dmxextension.h"
+#include <X11/extensions/dmxproto.h>
+#include <X11/extensions/dmx.h>
+#include "protocol-versions.h"
+
+#ifdef PANORAMIX
+#include "panoramiX.h"
+extern unsigned long XRT_WINDOW;
+extern int PanoramiXNumScreens;
+#endif
+
+extern void DMXExtensionInit(void);
+
+static unsigned char DMXCode;
+
+
+
+static int _DMXXineramaActive(void)
+{
+#ifdef PANORAMIX
+ return !noPanoramiXExtension;
+#endif
+ return 0;
+}
+
+static void dmxSetScreenAttribute(int bit, DMXScreenAttributesPtr attr,
+ CARD32 value)
+{
+ switch (1 << bit) {
+ case DMXScreenWindowWidth: attr->screenWindowWidth = value; break;
+ case DMXScreenWindowHeight: attr->screenWindowHeight = value; break;
+ case DMXScreenWindowXoffset: attr->screenWindowXoffset = value; break;
+ case DMXScreenWindowYoffset: attr->screenWindowYoffset = value; break;
+ case DMXRootWindowWidth: attr->rootWindowWidth = value; break;
+ case DMXRootWindowHeight: attr->rootWindowHeight = value; break;
+ case DMXRootWindowXoffset: attr->rootWindowXoffset = value; break;
+ case DMXRootWindowYoffset: attr->rootWindowYoffset = value; break;
+ case DMXRootWindowXorigin: attr->rootWindowXorigin = value; break;
+ case DMXRootWindowYorigin: attr->rootWindowYorigin = value; break;
+ }
+}
+
+static int dmxFetchScreenAttributes(unsigned int mask,
+ DMXScreenAttributesPtr attr,
+ CARD32 *value_list)
+{
+ int i;
+ CARD32 *value = value_list;
+ int count = 0;
+
+ for (i = 0; i < 32; i++) {
+ if (mask & (1 << i)) {
+ dmxSetScreenAttribute(i, attr, *value);
+ ++value;
+ ++count;
+ }
+ }
+ return count;
+}
+
+static void dmxSetDesktopAttribute(int bit, DMXDesktopAttributesPtr attr,
+ CARD32 value)
+{
+ switch (1 << bit) {
+ case DMXDesktopWidth: attr->width = value; break;
+ case DMXDesktopHeight: attr->height = value; break;
+ case DMXDesktopShiftX: attr->shiftX = value; break;
+ case DMXDesktopShiftY: attr->shiftY = value; break;
+ }
+}
+
+static int dmxFetchDesktopAttributes(unsigned int mask,
+ DMXDesktopAttributesPtr attr,
+ CARD32 *value_list)
+{
+ int i;
+ CARD32 *value = value_list;
+ int count = 0;
+
+ for (i = 0; i < 32; i++) {
+ if (mask & (1 << i)) {
+ dmxSetDesktopAttribute(i, attr, *value);
+ ++value;
+ ++count;
+ }
+ }
+ return count;
+}
+
+static void dmxSetInputAttribute(int bit, DMXInputAttributesPtr attr,
+ CARD32 value)
+{
+ switch (1 << bit) {
+ case DMXInputType: attr->inputType = value; break;
+ case DMXInputPhysicalScreen: attr->physicalScreen = value; break;
+ case DMXInputSendsCore: attr->sendsCore = !!value; break;
+ }
+}
+
+static int dmxFetchInputAttributes(unsigned int mask,
+ DMXInputAttributesPtr attr,
+ CARD32 *value_list)
+{
+ int i;
+ CARD32 *value = value_list;
+ int count = 0;
+
+ for (i = 0; i < 32; i++) {
+ if (mask & (1 << i)) {
+ dmxSetInputAttribute(i, attr, *value);
+ ++value;
+ ++count;
+ }
+ }
+ return count;
+}
+
+static int ProcDMXQueryVersion(ClientPtr client)
+{
+ xDMXQueryVersionReply rep;
+
+ REQUEST_SIZE_MATCH(xDMXQueryVersionReq);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.majorVersion = SERVER_DMX_MAJOR_VERSION;
+ rep.minorVersion = SERVER_DMX_MINOR_VERSION;
+ rep.patchVersion = SERVER_DMX_PATCH_VERSION;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.majorVersion);
+ swapl(&rep.minorVersion);
+ swapl(&rep.patchVersion);
+ }
+ WriteToClient(client, sizeof(xDMXQueryVersionReply), (char *)&rep);
+ return Success;
+}
+
+static int ProcDMXSync(ClientPtr client)
+{
+ xDMXSyncReply rep;
+
+ REQUEST_SIZE_MATCH(xDMXSyncReq);
+
+ dmxFlushPendingSyncs();
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.status = 0;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.status);
+ }
+ WriteToClient(client, sizeof(xDMXSyncReply), (char *)&rep);
+ return Success;
+}
+
+static int ProcDMXForceWindowCreation(ClientPtr client)
+{
+ xDMXForceWindowCreationReply rep;
+ REQUEST(xDMXForceWindowCreationReq);
+ WindowPtr pWin;
+
+ REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq);
+
+#ifdef PANORAMIX
+ if (!noPanoramiXExtension) {
+ PanoramiXRes *win;
+ int i;
+
+ if (Success != dixLookupResourceByType((pointer*) &win,
+ stuff->window, XRT_WINDOW,
+ client, DixReadAccess))
+ return -1; /* BadWindow */
+
+ FOR_NSCREENS(i) {
+ if (Success != dixLookupWindow(&pWin, win->info[i].id, client,
+ DixReadAccess))
+ return -1; /* BadWindow */
+
+ dmxForceWindowCreation(pWin);
+ }
+ goto doreply;
+ }
+#endif
+
+ if (Success != dixLookupWindow(&pWin, stuff->window, client,
+ DixReadAccess))
+ return -1; /* BadWindow */
+
+ dmxForceWindowCreation(pWin);
+ doreply:
+ dmxFlushPendingSyncs();
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.status = 0;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.status);
+ }
+ WriteToClient(client, sizeof(xDMXForceWindowCreationReply), (char *)&rep);
+ return Success;
+}
+
+static int ProcDMXGetScreenCount(ClientPtr client)
+{
+ xDMXGetScreenCountReply rep;
+
+ REQUEST_SIZE_MATCH(xDMXGetScreenCountReq);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.screenCount = dmxGetNumScreens();
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.screenCount);
+ }
+ WriteToClient(client, sizeof(xDMXGetScreenCountReply), (char *)&rep);
+ return Success;
+}
+
+static int ProcDMXGetScreenAttributes(ClientPtr client)
+{
+ REQUEST(xDMXGetScreenAttributesReq);
+ xDMXGetScreenAttributesReply rep;
+ int length;
+ int paddedLength;
+ DMXScreenAttributesRec attr;
+
+ REQUEST_SIZE_MATCH(xDMXGetScreenAttributesReq);
+
+ if (stuff->physicalScreen < 0
+ || stuff->physicalScreen >= dmxGetNumScreens()) return BadValue;
+
+ if (!dmxGetScreenAttributes(stuff->physicalScreen, &attr))
+ return BadValue;
+
+ rep.logicalScreen = attr.logicalScreen;
+ rep.screenWindowWidth = attr.screenWindowWidth;
+ rep.screenWindowHeight = attr.screenWindowHeight;
+ rep.screenWindowXoffset = attr.screenWindowXoffset;
+ rep.screenWindowYoffset = attr.screenWindowYoffset;
+ rep.rootWindowWidth = attr.rootWindowWidth;
+ rep.rootWindowHeight = attr.rootWindowHeight;
+ rep.rootWindowXoffset = attr.rootWindowXoffset;
+ rep.rootWindowYoffset = attr.rootWindowYoffset;
+ rep.rootWindowXorigin = attr.rootWindowXorigin;
+ rep.rootWindowYorigin = attr.rootWindowYorigin;
+
+ length = attr.displayName ? strlen(attr.displayName) : 0;
+ paddedLength = pad_to_int32(length);
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = bytes_to_int32((sizeof(xDMXGetScreenAttributesReply) - sizeof(xGenericReply))
+ + paddedLength);
+ rep.displayNameLength = length;
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.displayNameLength);
+ swapl(&rep.logicalScreen);
+ swaps(&rep.screenWindowWidth);
+ swaps(&rep.screenWindowHeight);
+ swaps(&rep.screenWindowXoffset);
+ swaps(&rep.screenWindowYoffset);
+ swaps(&rep.rootWindowWidth);
+ swaps(&rep.rootWindowHeight);
+ swaps(&rep.rootWindowXoffset);
+ swaps(&rep.rootWindowYoffset);
+ swaps(&rep.rootWindowXorigin);
+ swaps(&rep.rootWindowYorigin);
+ }
+ WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), (char *)&rep);
+ if (length) WriteToClient(client, length, (char *)attr.displayName);
+ return Success;
+}
+
+static int ProcDMXChangeScreensAttributes(ClientPtr client)
+{
+ REQUEST(xDMXChangeScreensAttributesReq);
+ xDMXChangeScreensAttributesReply rep;
+ int status = DMX_BAD_XINERAMA;
+ unsigned int mask = 0;
+ unsigned int i;
+ CARD32 *screen_list;
+ CARD32 *mask_list;
+ CARD32 *value_list;
+ DMXScreenAttributesPtr attribs;
+ int errorScreen = 0;
+ unsigned int len;
+ int ones = 0;
+
+
+ REQUEST_AT_LEAST_SIZE(xDMXChangeScreensAttributesReq);
+ len = client->req_len - bytes_to_int32(sizeof(xDMXChangeScreensAttributesReq));
+ if (len < stuff->screenCount + stuff->maskCount)
+ return BadLength;
+
+ screen_list = (CARD32 *)(stuff + 1);
+ mask_list = &screen_list[stuff->screenCount];
+ value_list = &mask_list[stuff->maskCount];
+
+ for (i = 0; i < stuff->maskCount; i++) ones += Ones(mask_list[i]);
+ if (len != stuff->screenCount + stuff->maskCount + ones)
+ return BadLength;
+
+ if (!_DMXXineramaActive()) goto noxinerama;
+
+ if (!(attribs = malloc(stuff->screenCount * sizeof(*attribs))))
+ return BadAlloc;
+
+ for (i = 0; i < stuff->screenCount; i++) {
+ int count;
+
+ if (i < stuff->maskCount) mask = mask_list[i];
+ dmxGetScreenAttributes(screen_list[i], &attribs[i]);
+ count = dmxFetchScreenAttributes(mask, &attribs[i], value_list);
+ value_list += count;
+ }
+
+#if PANORAMIX
+ status = dmxConfigureScreenWindows(stuff->screenCount,
+ screen_list,
+ attribs,
+ &errorScreen);
+#endif
+
+ free(attribs);
+
+ if (status == BadValue) return status;
+
+ noxinerama:
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.status = status;
+ rep.errorScreen = errorScreen;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.status);
+ swapl(&rep.errorScreen);
+ }
+ WriteToClient(client,
+ sizeof(xDMXChangeScreensAttributesReply),
+ (char *)&rep);
+ return Success;
+}
+
+static int ProcDMXAddScreen(ClientPtr client)
+{
+ REQUEST(xDMXAddScreenReq);
+ xDMXAddScreenReply rep;
+ int status = 0;
+ CARD32 *value_list;
+ DMXScreenAttributesRec attr;
+ int count;
+ char *name;
+ int len;
+ int paddedLength;
+
+ REQUEST_AT_LEAST_SIZE(xDMXAddScreenReq);
+ paddedLength = pad_to_int32(stuff->displayNameLength);
+ len = client->req_len - bytes_to_int32(sizeof(xDMXAddScreenReq));
+ if (len != Ones(stuff->valueMask) + paddedLength/4)
+ return BadLength;
+
+ memset(&attr, 0, sizeof(attr));
+ dmxGetScreenAttributes(stuff->physicalScreen, &attr);
+ value_list = (CARD32 *)(stuff + 1);
+ count = dmxFetchScreenAttributes(stuff->valueMask, &attr, value_list);
+
+ if (!(name = malloc(stuff->displayNameLength + 1 + 4)))
+ return BadAlloc;
+ memcpy(name, &value_list[count], stuff->displayNameLength);
+ name[stuff->displayNameLength] = '\0';
+ attr.displayName = name;
+
+ status = dmxAttachScreen(stuff->physicalScreen, &attr);
+
+ free(name);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.status = status;
+ rep.physicalScreen = stuff->physicalScreen;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.status);
+ swapl(&rep.physicalScreen);
+ }
+ WriteToClient(client,
+ sizeof(xDMXAddScreenReply),
+ (char *)&rep);
+ return Success;
+}
+
+static int ProcDMXRemoveScreen(ClientPtr client)
+{
+ REQUEST(xDMXRemoveScreenReq);
+ xDMXRemoveScreenReply rep;
+ int status = 0;
+
+ REQUEST_SIZE_MATCH(xDMXRemoveScreenReq);
+
+ status = dmxDetachScreen(stuff->physicalScreen);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.status = status;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.status);
+ }
+ WriteToClient(client,
+ sizeof(xDMXRemoveScreenReply),
+ (char *)&rep);
+ return Success;
+}
+
+
+#ifdef PANORAMIX
+static int dmxPopulatePanoramiX(ClientPtr client, Window window,
+ CARD32 *screens, CARD32 *windows,
+ xRectangle *pos, xRectangle *vis)
+{
+ WindowPtr pWin;
+ PanoramiXRes *win;
+ int i;
+ int count = 0;
+ DMXWindowAttributesRec attr;
+
+ if (Success != dixLookupResourceByType((pointer*) &win,
+ window, XRT_WINDOW,
+ client, DixReadAccess))
+ return -1; /* BadWindow */
+
+ FOR_NSCREENS(i) {
+ if (Success != dixLookupWindow(&pWin, win->info[i].id, client,
+ DixReadAccess))
+ return -1; /* BadWindow */
+ if (dmxGetWindowAttributes(pWin, &attr)) {
+ screens[count] = attr.screen;
+ windows[count] = attr.window;
+ pos[count] = attr.pos;
+ vis[count] = attr.vis;
+ ++count; /* Only count existing windows */
+ }
+ }
+ return count;
+}
+#endif
+
+static int dmxPopulate(ClientPtr client, Window window, CARD32 *screens,
+ CARD32 *windows, xRectangle *pos, xRectangle *vis)
+{
+ WindowPtr pWin;
+ DMXWindowAttributesRec attr;
+
+#ifdef PANORAMIX
+ if (!noPanoramiXExtension)
+ return dmxPopulatePanoramiX(client, window, screens, windows,
+ pos, vis);
+#endif
+
+ if (Success != dixLookupWindow(&pWin, window, client, DixReadAccess))
+ return -1; /* BadWindow */
+
+ dmxGetWindowAttributes(pWin, &attr);
+ *screens = attr.screen;
+ *windows = attr.window;
+ *pos = attr.pos;
+ *vis = attr.vis;
+ return 1;
+}
+
+static int dmxMaxNumScreens(void)
+{
+#ifdef PANORAMIX
+ if (!noPanoramiXExtension) return PanoramiXNumScreens;
+#endif
+ return 1;
+}
+
+static int ProcDMXGetWindowAttributes(ClientPtr client)
+{
+ REQUEST(xDMXGetWindowAttributesReq);
+ xDMXGetWindowAttributesReply rep;
+ int i;
+ CARD32 *screens;
+ CARD32 *windows;
+ xRectangle *pos, *vis;
+ int count = dmxMaxNumScreens();
+
+ REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq);
+
+ if (!(screens = malloc(count * sizeof(*screens))))
+ return BadAlloc;
+ if (!(windows = malloc(count * sizeof(*windows)))) {
+ free(screens);
+ return BadAlloc;
+ }
+ if (!(pos = malloc(count * sizeof(*pos)))) {
+ free(windows);
+ free(screens);
+ return BadAlloc;
+ }
+ if (!(vis = malloc(count * sizeof(*vis)))) {
+ free(pos);
+ free(windows);
+ free(screens);
+ return BadAlloc;
+ }
+
+ if ((count = dmxPopulate(client, stuff->window, screens, windows,
+ pos, vis)) < 0) {
+ free(vis);
+ free(pos);
+ free(windows);
+ free(screens);
+ return BadWindow;
+ }
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = count * 6;
+ rep.screenCount = count;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.screenCount);
+ for (i = 0; i < count; i++) {
+ swapl(&screens[i]);
+ swapl(&windows[i]);
+
+ swaps(&pos[i].x);
+ swaps(&pos[i].y);
+ swaps(&pos[i].width);
+ swaps(&pos[i].height);
+
+ swaps(&vis[i].x);
+ swaps(&vis[i].y);
+ swaps(&vis[i].width);
+ swaps(&vis[i].height);
+ }
+ }
+
+ dmxFlushPendingSyncs();
+
+ WriteToClient(client, sizeof(xDMXGetWindowAttributesReply), (char *)&rep);
+ if (count) {
+ WriteToClient(client, count * sizeof(*screens), (char *)screens);
+ WriteToClient(client, count * sizeof(*windows), (char *)windows);
+ WriteToClient(client, count * sizeof(*pos), (char *)pos);
+ WriteToClient(client, count * sizeof(*vis), (char *)vis);
+ }
+
+ free(vis);
+ free(pos);
+ free(windows);
+ free(screens);
+
+ return Success;
+}
+
+static int ProcDMXGetDesktopAttributes(ClientPtr client)
+{
+ xDMXGetDesktopAttributesReply rep;
+ DMXDesktopAttributesRec attr;
+
+ REQUEST_SIZE_MATCH(xDMXGetDesktopAttributesReq);
+
+ dmxGetDesktopAttributes(&attr);
+
+ rep.width = attr.width;
+ rep.height = attr.height;
+ rep.shiftX = attr.shiftX;
+ rep.shiftY = attr.shiftY;
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.width);
+ swaps(&rep.height);
+ swaps(&rep.shiftX);
+ swaps(&rep.shiftY);
+ }
+ WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), (char *)&rep);
+ return Success;
+}
+
+static int ProcDMXChangeDesktopAttributes(ClientPtr client)
+{
+ REQUEST(xDMXChangeDesktopAttributesReq);
+ xDMXChangeDesktopAttributesReply rep;
+ int status = DMX_BAD_XINERAMA;
+ CARD32 *value_list;
+ DMXDesktopAttributesRec attr;
+ int len;
+
+ REQUEST_AT_LEAST_SIZE(xDMXChangeDesktopAttributesReq);
+ len = client->req_len - (sizeof(xDMXChangeDesktopAttributesReq) >> 2);
+ if (len != Ones(stuff->valueMask))
+ return BadLength;
+
+ if (!_DMXXineramaActive()) goto noxinerama;
+
+ value_list = (CARD32 *)(stuff + 1);
+
+ dmxGetDesktopAttributes(&attr);
+ dmxFetchDesktopAttributes(stuff->valueMask, &attr, value_list);
+
+#if PANORAMIX
+ status = dmxConfigureDesktop(&attr);
+#endif
+ if (status == BadValue) return status;
+
+ noxinerama:
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.status = status;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.status);
+ }
+ WriteToClient(client,
+ sizeof(xDMXChangeDesktopAttributesReply),
+ (char *)&rep);
+ return Success;
+}
+
+static int ProcDMXGetInputCount(ClientPtr client)
+{
+ xDMXGetInputCountReply rep;
+
+ REQUEST_SIZE_MATCH(xDMXGetInputCountReq);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.inputCount = dmxGetInputCount();
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.inputCount);
+ }
+ WriteToClient(client, sizeof(xDMXGetInputCountReply), (char *)&rep);
+ return Success;
+}
+
+static int ProcDMXGetInputAttributes(ClientPtr client)
+{
+ REQUEST(xDMXGetInputAttributesReq);
+ xDMXGetInputAttributesReply rep;
+ int length;
+ int paddedLength;
+ DMXInputAttributesRec attr;
+
+ REQUEST_SIZE_MATCH(xDMXGetInputAttributesReq);
+
+ if (dmxGetInputAttributes(stuff->deviceId, &attr)) return BadValue;
+ rep.inputType = attr.inputType;
+ rep.physicalScreen = attr.physicalScreen;
+ rep.physicalId = attr.physicalId;
+ rep.isCore = attr.isCore;
+ rep.sendsCore = attr.sendsCore;
+ rep.detached = attr.detached;
+
+ length = attr.name ? strlen(attr.name) : 0;
+ paddedLength = pad_to_int32(length);
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = bytes_to_int32(paddedLength);
+ rep.nameLength = length;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.inputType);
+ swapl(&rep.physicalScreen);
+ swapl(&rep.physicalId);
+ swapl(&rep.nameLength);
+ }
+ WriteToClient(client, sizeof(xDMXGetInputAttributesReply), (char *)&rep);
+ if (length) WriteToClient(client, length, (char *)attr.name);
+ return Success;
+}
+
+static int ProcDMXAddInput(ClientPtr client)
+{
+ REQUEST(xDMXAddInputReq);
+ xDMXAddInputReply rep;
+ int status = 0;
+ CARD32 *value_list;
+ DMXInputAttributesRec attr;
+ int count;
+ char *name;
+ int len;
+ int paddedLength;
+ int id = -1;
+
+ REQUEST_AT_LEAST_SIZE(xDMXAddInputReq);
+ paddedLength = pad_to_int32(stuff->displayNameLength);
+ len = client->req_len - (sizeof(xDMXAddInputReq) >> 2);
+ if (len != Ones(stuff->valueMask) + paddedLength/4)
+ return BadLength;
+
+ memset(&attr, 0, sizeof(attr));
+ value_list = (CARD32 *)(stuff + 1);
+ count = dmxFetchInputAttributes(stuff->valueMask, &attr, value_list);
+
+ if (!(name = malloc(stuff->displayNameLength + 1 + 4)))
+ return BadAlloc;
+ memcpy(name, &value_list[count], stuff->displayNameLength);
+ name[stuff->displayNameLength] = '\0';
+ attr.name = name;
+
+ status = dmxAddInput(&attr, &id);
+
+ free(name);
+
+ if (status) return status;
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.status = status;
+ rep.physicalId = id;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.status);
+ swapl(&rep.physicalId);
+ }
+ WriteToClient(client, sizeof(xDMXAddInputReply), (char *)&rep);
+ return Success;
+}
+
+static int ProcDMXRemoveInput(ClientPtr client)
+{
+ REQUEST(xDMXRemoveInputReq);
+ xDMXRemoveInputReply rep;
+ int status = 0;
+
+ REQUEST_SIZE_MATCH(xDMXRemoveInputReq);
+
+ status = dmxRemoveInput(stuff->physicalId);
+
+ if (status) return status;
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.status = status;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.status);
+ }
+ WriteToClient(client, sizeof(xDMXRemoveInputReply), (char *)&rep);
+ return Success;
+}
+
+static int ProcDMXDispatch(ClientPtr client)
+{
+ REQUEST(xReq);
+
+ switch (stuff->data) {
+ case X_DMXQueryVersion: return ProcDMXQueryVersion(client);
+ case X_DMXSync: return ProcDMXSync(client);
+ case X_DMXForceWindowCreation: return ProcDMXForceWindowCreation(client);
+ case X_DMXGetScreenCount: return ProcDMXGetScreenCount(client);
+ case X_DMXGetScreenAttributes: return ProcDMXGetScreenAttributes(client);
+ case X_DMXChangeScreensAttributes:
+ return ProcDMXChangeScreensAttributes(client);
+ case X_DMXAddScreen: return ProcDMXAddScreen(client);
+ case X_DMXRemoveScreen: return ProcDMXRemoveScreen(client);
+ case X_DMXGetWindowAttributes: return ProcDMXGetWindowAttributes(client);
+ case X_DMXGetDesktopAttributes: return ProcDMXGetDesktopAttributes(client);
+ case X_DMXChangeDesktopAttributes:
+ return ProcDMXChangeDesktopAttributes(client);
+ case X_DMXGetInputCount: return ProcDMXGetInputCount(client);
+ case X_DMXGetInputAttributes: return ProcDMXGetInputAttributes(client);
+ case X_DMXAddInput: return ProcDMXAddInput(client);
+ case X_DMXRemoveInput: return ProcDMXRemoveInput(client);
+
+ case X_DMXGetScreenInformationDEPRECATED:
+ case X_DMXForceWindowCreationDEPRECATED:
+ case X_DMXReconfigureScreenDEPRECATED:
+ return BadImplementation;
+
+ default: return BadRequest;
+ }
+}
+
+static int SProcDMXQueryVersion(ClientPtr client)
+{
+ REQUEST(xDMXQueryVersionReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDMXQueryVersionReq);
+ return ProcDMXQueryVersion(client);
+}
+
+static int SProcDMXSync(ClientPtr client)
+{
+ REQUEST(xDMXSyncReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDMXSyncReq);
+ return ProcDMXSync(client);
+}
+
+static int SProcDMXForceWindowCreation(ClientPtr client)
+{
+ REQUEST(xDMXForceWindowCreationReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDMXForceWindowCreationReq);
+ swapl(&stuff->window);
+ return ProcDMXForceWindowCreation(client);
+}
+
+static int SProcDMXGetScreenCount(ClientPtr client)
+{
+ REQUEST(xDMXGetScreenCountReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDMXGetScreenCountReq);
+ return ProcDMXGetScreenCount(client);
+}
+
+static int SProcDMXGetScreenAttributes(ClientPtr client)
+{
+ REQUEST(xDMXGetScreenAttributesReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDMXGetScreenAttributesReq);
+ swapl(&stuff->physicalScreen);
+ return ProcDMXGetScreenAttributes(client);
+}
+
+static int SProcDMXChangeScreensAttributes(ClientPtr client)
+{
+ REQUEST(xDMXChangeScreensAttributesReq);
+
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xDMXGetScreenAttributesReq);
+ swapl(&stuff->screenCount);
+ swapl(&stuff->maskCount);
+ SwapRestL(stuff);
+ return ProcDMXGetScreenAttributes(client);
+}
+
+static int SProcDMXAddScreen(ClientPtr client)
+{
+ int paddedLength;
+ REQUEST(xDMXAddScreenReq);
+
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xDMXAddScreenReq);
+ swapl(&stuff->displayNameLength);
+ swapl(&stuff->valueMask);
+ paddedLength = pad_to_int32(stuff->displayNameLength);
+ SwapLongs((CARD32 *)(stuff+1), LengthRestL(stuff) - paddedLength/4);
+ return ProcDMXAddScreen(client);
+}
+
+static int SProcDMXRemoveScreen(ClientPtr client)
+{
+ REQUEST(xDMXRemoveScreenReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDMXRemoveScreenReq);
+ swapl(&stuff->physicalScreen);
+ return ProcDMXRemoveScreen(client);
+}
+
+static int SProcDMXGetWindowAttributes(ClientPtr client)
+{
+ REQUEST(xDMXGetWindowAttributesReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDMXGetWindowAttributesReq);
+ swapl(&stuff->window);
+ return ProcDMXGetWindowAttributes(client);
+}
+
+static int SProcDMXGetDesktopAttributes(ClientPtr client)
+{
+ REQUEST(xDMXGetDesktopAttributesReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDMXGetDesktopAttributesReq);
+ return ProcDMXGetDesktopAttributes(client);
+}
+
+static int SProcDMXChangeDesktopAttributes(ClientPtr client)
+{
+ REQUEST(xDMXChangeDesktopAttributesReq);
+
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xDMXChangeDesktopAttributesReq);
+ swapl(&stuff->valueMask);
+ SwapRestL(stuff);
+ return ProcDMXChangeDesktopAttributes(client);
+}
+
+static int SProcDMXGetInputCount(ClientPtr client)
+{
+ REQUEST(xDMXGetInputCountReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDMXGetInputCountReq);
+ return ProcDMXGetInputCount(client);
+}
+
+static int SProcDMXGetInputAttributes(ClientPtr client)
+{
+ REQUEST(xDMXGetInputAttributesReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDMXGetInputAttributesReq);
+ swapl(&stuff->deviceId);
+ return ProcDMXGetInputAttributes(client);
+}
+
+static int SProcDMXAddInput(ClientPtr client)
+{
+ int paddedLength;
+ REQUEST(xDMXAddInputReq);
+
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xDMXAddInputReq);
+ swapl(&stuff->displayNameLength);
+ swapl(&stuff->valueMask);
+ paddedLength = pad_to_int32(stuff->displayNameLength);
+ SwapLongs((CARD32 *)(stuff+1), LengthRestL(stuff) - paddedLength/4);
+ return ProcDMXAddInput(client);
+}
+
+static int SProcDMXRemoveInput(ClientPtr client)
+{
+ REQUEST(xDMXRemoveInputReq);
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xDMXRemoveInputReq);
+ swapl(&stuff->physicalId);
+ return ProcDMXRemoveInput(client);
+}
+
+static int SProcDMXDispatch (ClientPtr client)
+{
+ REQUEST(xReq);
+
+ switch (stuff->data) {
+ case X_DMXQueryVersion: return SProcDMXQueryVersion(client);
+ case X_DMXSync: return SProcDMXSync(client);
+ case X_DMXForceWindowCreation: return SProcDMXForceWindowCreation(client);
+ case X_DMXGetScreenCount: return SProcDMXGetScreenCount(client);
+ case X_DMXGetScreenAttributes: return SProcDMXGetScreenAttributes(client);
+ case X_DMXChangeScreensAttributes:
+ return SProcDMXChangeScreensAttributes(client);
+ case X_DMXAddScreen: return SProcDMXAddScreen(client);
+ case X_DMXRemoveScreen: return SProcDMXRemoveScreen(client);
+ case X_DMXGetWindowAttributes: return SProcDMXGetWindowAttributes(client);
+ case X_DMXGetDesktopAttributes:
+ return SProcDMXGetDesktopAttributes(client);
+ case X_DMXChangeDesktopAttributes:
+ return SProcDMXChangeDesktopAttributes(client);
+ case X_DMXGetInputCount: return SProcDMXGetInputCount(client);
+ case X_DMXGetInputAttributes: return SProcDMXGetInputAttributes(client);
+ case X_DMXAddInput: return SProcDMXAddInput(client);
+ case X_DMXRemoveInput: return SProcDMXRemoveInput(client);
+
+ case X_DMXGetScreenInformationDEPRECATED:
+ case X_DMXForceWindowCreationDEPRECATED:
+ case X_DMXReconfigureScreenDEPRECATED:
+ return BadImplementation;
+
+ default: return BadRequest;
+ }
+}
+
+/** Initialize the extension. */
+void DMXExtensionInit(void)
+{
+ ExtensionEntry *extEntry;
+
+ if ((extEntry = AddExtension(DMX_EXTENSION_NAME, 0, 0,
+ ProcDMXDispatch, SProcDMXDispatch,
+ NULL, StandardMinorOpcode)))
+ DMXCode = extEntry->base;
+}
diff --git a/xorg-server/hw/dmx/dmxclient.h b/xorg-server/hw/dmx/dmxclient.h
index c45f71fc0..f0f235f61 100644
--- a/xorg-server/hw/dmx/dmxclient.h
+++ b/xorg-server/hw/dmx/dmxclient.h
@@ -82,7 +82,6 @@ typedef XID KeySym64;
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/cursorfont.h>
-#include <X11/Xmu/SysUtil.h> /* For XmuSnprintf */
#include <X11/extensions/shape.h>
diff --git a/xorg-server/hw/dmx/dmxcursor.h b/xorg-server/hw/dmx/dmxcursor.h
index 5242268c1..fc2e118e0 100644
--- a/xorg-server/hw/dmx/dmxcursor.h
+++ b/xorg-server/hw/dmx/dmxcursor.h
@@ -64,9 +64,9 @@ extern void dmxBECreateCursor(ScreenPtr pScreen, CursorPtr pCursor);
extern Bool dmxBEFreeCursor(ScreenPtr pScreen, CursorPtr pCursor);
#define DMX_GET_CURSOR_PRIV(_pCursor, _pScreen) ((dmxCursorPrivPtr) \
- dixLookupPrivate(&(_pCursor)->devPrivates, CursorScreenKey(_pScreen)))
+ dixLookupScreenPrivate(&(_pCursor)->devPrivates, CursorScreenKey, _pScreen))
#define DMX_SET_CURSOR_PRIV(_pCursor, _pScreen, v) \
- dixSetPrivate(&(_pCursor)->devPrivates, CursorScreenKey(_pScreen), v)
+ dixSetScreenPrivate(&(_pCursor)->devPrivates, CursorScreenKey, _pScreen, v)
#endif /* DMXCURSOR_H */
diff --git a/xorg-server/hw/dmx/dmxextension.c b/xorg-server/hw/dmx/dmxextension.c
index db5709ee6..80d11ee89 100644
--- a/xorg-server/hw/dmx/dmxextension.c
+++ b/xorg-server/hw/dmx/dmxextension.c
@@ -455,7 +455,7 @@ static void dmxSetRootWindowOrigin(int idx, int x, int y)
pScreen->y = dmxScreen->rootYOrigin;
/* Recalculate the Xinerama regions and data structs */
- XineramaReinitData(pScreen);
+ XineramaReinitData();
/* Adjust each of the root window's children */
if (!idx) ReinitializeRootWindow(screenInfo.screens[0]->root, xoff, yoff);
diff --git a/xorg-server/hw/dmx/dmxinit.c b/xorg-server/hw/dmx/dmxinit.c
index a8399bc75..359ba9f2f 100644
--- a/xorg-server/hw/dmx/dmxinit.c
+++ b/xorg-server/hw/dmx/dmxinit.c
@@ -56,6 +56,7 @@
#include "dmxpict.h"
#include <X11/Xos.h> /* For gettimeofday */
+#include <X11/Xmu/SysUtil.h> /* For XmuGetHostname */
#include "dixstruct.h"
#ifdef PANORAMIX
#include "panoramiXsrv.h"
@@ -131,7 +132,7 @@ static int dmxErrorHandler(Display *dpy, XErrorEvent *ev)
/* Find major opcode name */
if (ev->request_code < 128) {
- XmuSnprintf(request, sizeof(request), "%d", ev->request_code);
+ snprintf(request, sizeof(request), "%d", ev->request_code);
XGetErrorDatabaseText(dpy, "XRequest", request, "", buf, sizeof(buf));
} else {
for (ext = dpy->ext_procs;
@@ -145,8 +146,8 @@ static int dmxErrorHandler(Display *dpy, XErrorEvent *ev)
/* Find minor opcode name */
if (ev->request_code >= 128 && ext) {
- XmuSnprintf(request, sizeof(request), "%d", ev->request_code);
- XmuSnprintf(request, sizeof(request), "%s.%d",
+ snprintf(request, sizeof(request), "%d", ev->request_code);
+ snprintf(request, sizeof(request), "%s.%d",
ext->name, ev->minor_code);
XGetErrorDatabaseText(dpy, "XRequest", request, "", buf, sizeof(buf));
dmxLog(dmxWarning, " Minor opcode: %d (%s)\n",
@@ -515,7 +516,7 @@ static const char *dmxExecOS(void)
if (!initialized++) {
memset(buffer, 0, sizeof(buffer));
uname(&u);
- XmuSnprintf(buffer, sizeof(buffer)-1, "%s %s %s",
+ snprintf(buffer, sizeof(buffer)-1, "%s %s %s",
u.sysname, u.release, u.version);
}
return buffer;
@@ -530,7 +531,7 @@ static const char *dmxBuildCompiler(void)
if (!initialized++) {
memset(buffer, 0, sizeof(buffer));
#if defined(__GNUC__) && defined(__GNUC_MINOR__) &&defined(__GNUC_PATCHLEVEL__)
- XmuSnprintf(buffer, sizeof(buffer)-1, "gcc %d.%d.%d",
+ snprintf(buffer, sizeof(buffer)-1, "gcc %d.%d.%d",
__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
#endif
}
diff --git a/xorg-server/hw/dmx/dmxprop.c b/xorg-server/hw/dmx/dmxprop.c
index 95efcb0e0..b4695dd5d 100644
--- a/xorg-server/hw/dmx/dmxprop.c
+++ b/xorg-server/hw/dmx/dmxprop.c
@@ -1,347 +1,348 @@
-/*
- * Copyright 2002-2003 Red Hat Inc., Durham, North Carolina.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation on the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial
- * portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-/*
- * Authors:
- * Rickard E. (Rik) Faith <faith@redhat.com>
- *
- */
-
-/** \file
- *
- * It is possible for one of the DMX "backend displays" to actually be
- * smaller than the dimensions of the backend X server. Therefore, it
- * is possible for more than one of the DMX "backend displays" to be
- * physically located on the same backend X server. This situation must
- * be detected so that cursor motion can be handled in an expected
- * fashion.
- *
- * We could analyze the names used for the DMX "backend displays" (e.g.,
- * the names passed to the -display command-line parameter), but there
- * are many possible names for a single X display, and failing to detect
- * sameness leads to very unexpected results. Therefore, whenever the
- * DMX server opens a window on a backend X server, a property value is
- * queried and set on that backend to detect when another window is
- * already open on that server.
- *
- * Further, it is possible that two different DMX server instantiations
- * both have windows on the same physical backend X server. This case
- * is also detected so that pointer input is not taken from that
- * particular backend X server.
- *
- * The routines in this file handle the property management. */
-
-#ifdef HAVE_DMX_CONFIG_H
-#include <dmx-config.h>
-#endif
-
-#include "dmx.h"
-#include "dmxprop.h"
-#include "dmxlog.h"
-
-/** Holds the window id of all DMX windows on the backend X server. */
-#define DMX_ATOMNAME "DMX_NAME"
-
-/** The identification string of this DMX server */
-#define DMX_IDENT "Xdmx"
-
-extern char *display;
-
-static int dmxPropertyErrorHandler(Display *dpy, XErrorEvent *ev)
-{
- return 0;
-}
-
-static const unsigned char *dmxPropertyIdentifier(void)
-{
- /* RATS: These buffers are only used in
- * length-limited calls. */
- char hostname[256];
- static char buf[128];
- static int initialized = 0;
-
- if (initialized++) return (unsigned char *)buf;
-
- XmuGetHostname(hostname, sizeof(hostname));
- XmuSnprintf(buf, sizeof(buf), "%s:%s:%s", DMX_IDENT, hostname, display);
- return (unsigned char *)buf;
-}
-
-/** Starting with the \a start screen, iterate over all of the screens
- * on the same physical X server as \a start, calling \a f with the
- * screen and the \a closure. (The common case is that \a start is the
- * only DMX window on the backend X server.) */
-void *dmxPropertyIterate(DMXScreenInfo *start,
- void *(*f)(DMXScreenInfo *dmxScreen, void *),
- void *closure)
-{
- DMXScreenInfo *pt;
-
- if (!start->next) {
- if (!start->beDisplay) return NULL;
- return f(start, closure);
- }
-
- for (pt = start->next; /* condition at end of loop */; pt = pt->next) {
- void *retval;
- /* beDisplay ban be NULL if a screen was detached */
- dmxLog(dmxDebug, "pt = %p\n", pt);
- dmxLog(dmxDebug, "pt->beDisplay = %p\n", pt->beDisplay);
- if (pt->beDisplay && (retval = f(pt, closure))) return retval;
- if (pt == start) break;
- }
- return NULL;
-}
-
-/** Returns 0 if this is the only Xdmx session on the display; 1
- * otherwise. */
-static int dmxPropertyCheckOtherServers(DMXScreenInfo *dmxScreen, Atom atom)
-{
- Display *dpy = dmxScreen->beDisplay;
- XTextProperty tp;
- XTextProperty tproot;
- const char *pt;
- int retcode = 0;
- char **list = NULL;
- int count = 0;
- int i;
- int (*dmxOldHandler)(Display *, XErrorEvent *);
-
- if (!dpy)
- return 0;
-
- if (!XGetTextProperty(dpy, RootWindow(dpy,0), &tproot, atom)
- || !tproot.nitems) return 0;
-
- /* Ignore BadWindow errors for this
- * routine because the window id stored
- * in the property might be old */
- dmxOldHandler = XSetErrorHandler(dmxPropertyErrorHandler);
- for (pt = (const char *)tproot.value; pt && *pt; pt = pt ? pt + 1 : NULL) {
- if ((pt = strchr(pt, ','))) {
- Window win = strtol(pt+1, NULL, 10);
- if (XGetTextProperty(dpy, win, &tp, atom) && tp.nitems) {
- if (!strncmp((char *)tp.value, DMX_IDENT, strlen(DMX_IDENT))) {
- int flag = 0;
- for (i = 0; i < count; i++)
- if (!strcmp(list[i], (char *)tp.value)) {
- ++flag;
- break;
- }
- if (flag) continue;
- ++retcode;
- dmxLogOutputWarning(dmxScreen,
- "%s also running on %s\n",
- tp.value, dmxScreen->name);
- list = realloc(list, ++count * sizeof(*list));
- list[count-1] = malloc(tp.nitems + 2);
- strncpy(list[count-1], (char *)tp.value, tp.nitems + 1);
- }
- XFree(tp.value);
- }
- }
- }
- XSetErrorHandler(dmxOldHandler);
-
- for (i = 0; i < count; i++) free(list[i]);
- free(list);
- XFree(tproot.value);
- if (!retcode)
- dmxLogOutput(dmxScreen, "No Xdmx server running on backend\n");
- return retcode;
-}
-
-/** Returns NULL if this is the only Xdmx window on the display.
- * Otherwise, returns a pointer to the dmxScreen of the other windows on
- * the display. */
-static DMXScreenInfo *dmxPropertyCheckOtherWindows(DMXScreenInfo *dmxScreen,
- Atom atom)
-{
- Display *dpy = dmxScreen->beDisplay;
- const unsigned char *id = dmxPropertyIdentifier();
- XTextProperty tproot;
- XTextProperty tp;
- const char *pt;
- int (*dmxOldHandler)(Display *, XErrorEvent *);
-
- if (!dpy)
- return NULL;
-
- if (!XGetTextProperty(dpy, RootWindow(dpy,0), &tproot, atom)
- || !tproot.nitems) return 0;
-
- /* Ignore BadWindow errors for this
- * routine because the window id stored
- * in the property might be old */
- dmxOldHandler = XSetErrorHandler(dmxPropertyErrorHandler);
- for (pt = (const char *)tproot.value; pt && *pt; pt = pt ? pt + 1 : NULL) {
- if ((pt = strchr(pt, ','))) {
- Window win = strtol(pt+1, NULL, 10);
- if (XGetTextProperty(dpy, win, &tp, atom) && tp.nitems) {
- dmxLog(dmxDebug,"On %s/%lu: %s\n",
- dmxScreen->name, win, tp.value);
- if (!strncmp((char *)tp.value, (char *)id,
- strlen((char *)id))) {
- int idx;
-
- if (!(pt = strchr((char *)tp.value, ','))) continue;
- idx = strtol(pt+1, NULL, 10);
- if (idx < 0 || idx >= dmxNumScreens) continue;
- if (dmxScreens[idx].scrnWin != win) continue;
- XSetErrorHandler(dmxOldHandler);
- return &dmxScreens[idx];
- }
- XFree(tp.value);
- }
- }
- }
- XSetErrorHandler(dmxOldHandler);
- XFree(tproot.value);
- return 0;
-}
-
-/** Returns 0 if this is the only Xdmx session on the display; 1
- * otherwise. */
-int dmxPropertyDisplay(DMXScreenInfo *dmxScreen)
-{
- Atom atom;
- const unsigned char *id = dmxPropertyIdentifier();
- Display *dpy = dmxScreen->beDisplay;
-
- if (!dpy)
- return 0;
-
- atom = XInternAtom(dpy, DMX_ATOMNAME, False);
- if (dmxPropertyCheckOtherServers(dmxScreen, atom)) {
- dmxScreen->shared = 1;
- return 1;
- }
- XChangeProperty(dpy, RootWindow(dpy,0), atom, XA_STRING, 8,
- PropModeReplace, id, strlen((char *)id));
- return 0;
-}
-
-/** Returns 1 if the dmxScreen and the display in \a name are on the
- * same display, or 0 otherwise. We can't just compare the display
- * names because there can be multiple synonyms for the same display,
- * some of which cannot be determined without accessing the display
- * itself (e.g., domain aliases or machines with multiple NICs). */
-int dmxPropertySameDisplay(DMXScreenInfo *dmxScreen, const char *name)
-{
- Display *dpy0 = dmxScreen->beDisplay;
- Atom atom0;
- XTextProperty tp0;
- Display *dpy1 = NULL;
- Atom atom1;
- XTextProperty tp1;
- int retval = 0;
-
- if (!dpy0)
- return 0;
-
- tp0.nitems = 0;
- tp1.nitems = 0;
-
- if ((atom0 = XInternAtom(dpy0, DMX_ATOMNAME, True)) == None) {
- dmxLog(dmxWarning, "No atom on %s\n", dmxScreen->name);
- return 0;
- }
- if (!XGetTextProperty(dpy0, RootWindow(dpy0,0), &tp0, atom0)
- || !tp0.nitems) {
- dmxLog(dmxWarning, "No text property on %s\n", dmxScreen->name);
- return 0;
- }
-
- if (!(dpy1 = XOpenDisplay(name))) {
- dmxLog(dmxWarning, "Cannot open %s\n", name);
- goto cleanup;
- }
- atom1 = XInternAtom(dpy1, DMX_ATOMNAME, True);
- if (atom1 == None) {
- dmxLog(dmxDebug, "No atom on %s\n", name);
- goto cleanup;
- }
- if (!XGetTextProperty(dpy1, RootWindow(dpy1,0), &tp1, atom1)
- || !tp1.nitems) {
- dmxLog(dmxDebug, "No text property on %s\n", name);
- goto cleanup;
- }
- if (!strcmp((char *)tp0.value, (char *)tp1.value)) retval = 1;
-
- cleanup:
- if (tp0.nitems) XFree(tp0.value);
- if (tp1.nitems) XFree(tp1.value);
- if (dpy1) XCloseDisplay(dpy1);
- return retval;
-}
-
-/** Prints a log message if \a dmxScreen is on the same backend X server
- * as some other DMX backend (output) screen. Modifies the property
- * (#DMX_ATOMNAME) on the backend X server to reflect the creation of \a
- * dmxScreen.
- *
- * The root window of the backend X server holds a list of window ids
- * for all DMX windows (on this DMX server or some other DMX server).
- *
- * This list can then be iterated, and the property for each window can
- * be examined. This property contains the following tuple (no quotes):
- *
- * "#DMX_IDENT:<hostname running DMX>:<display name of DMX>,<screen number>"
- */
-void dmxPropertyWindow(DMXScreenInfo *dmxScreen)
-{
- Atom atom;
- const unsigned char *id = dmxPropertyIdentifier();
- Display *dpy = dmxScreen->beDisplay;
- Window win = dmxScreen->scrnWin;
- DMXScreenInfo *other;
- char buf[128]; /* RATS: only used with XmuSnprintf */
-
- if (!dpy)
- return; /* FIXME: What should be done here if Xdmx is started
- * with this screen initially detached?
- */
-
- atom = XInternAtom(dpy, DMX_ATOMNAME, False);
- if ((other = dmxPropertyCheckOtherWindows(dmxScreen, atom))) {
- DMXScreenInfo *tmp = dmxScreen->next;
- dmxScreen->next = (other->next ? other->next : other);
- other->next = (tmp ? tmp : dmxScreen);
- dmxLog(dmxDebug, "%d/%s/%lu and %d/%s/%lu are on the same backend\n",
- dmxScreen->index, dmxScreen->name, dmxScreen->scrnWin,
- other->index, other->name, other->scrnWin);
- }
-
- XmuSnprintf(buf, sizeof(buf), ".%d,%lu", dmxScreen->index,
- (long unsigned)win);
- XChangeProperty(dpy, RootWindow(dpy,0), atom, XA_STRING, 8,
- PropModeAppend, (unsigned char *)buf, strlen(buf));
-
- XmuSnprintf(buf, sizeof(buf), "%s,%d", id, dmxScreen->index);
- XChangeProperty(dpy, win, atom, XA_STRING, 8,
- PropModeAppend, (unsigned char *)buf, strlen(buf));
-}
+/*
+ * Copyright 2002-2003 Red Hat Inc., Durham, North Carolina.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation on the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/*
+ * Authors:
+ * Rickard E. (Rik) Faith <faith@redhat.com>
+ *
+ */
+
+/** \file
+ *
+ * It is possible for one of the DMX "backend displays" to actually be
+ * smaller than the dimensions of the backend X server. Therefore, it
+ * is possible for more than one of the DMX "backend displays" to be
+ * physically located on the same backend X server. This situation must
+ * be detected so that cursor motion can be handled in an expected
+ * fashion.
+ *
+ * We could analyze the names used for the DMX "backend displays" (e.g.,
+ * the names passed to the -display command-line parameter), but there
+ * are many possible names for a single X display, and failing to detect
+ * sameness leads to very unexpected results. Therefore, whenever the
+ * DMX server opens a window on a backend X server, a property value is
+ * queried and set on that backend to detect when another window is
+ * already open on that server.
+ *
+ * Further, it is possible that two different DMX server instantiations
+ * both have windows on the same physical backend X server. This case
+ * is also detected so that pointer input is not taken from that
+ * particular backend X server.
+ *
+ * The routines in this file handle the property management. */
+
+#ifdef HAVE_DMX_CONFIG_H
+#include <dmx-config.h>
+#endif
+
+#include "dmx.h"
+#include "dmxprop.h"
+#include "dmxlog.h"
+#include <X11/Xmu/SysUtil.h> /* For XmuGetHostname */
+
+/** Holds the window id of all DMX windows on the backend X server. */
+#define DMX_ATOMNAME "DMX_NAME"
+
+/** The identification string of this DMX server */
+#define DMX_IDENT "Xdmx"
+
+extern char *display;
+
+static int dmxPropertyErrorHandler(Display *dpy, XErrorEvent *ev)
+{
+ return 0;
+}
+
+static const unsigned char *dmxPropertyIdentifier(void)
+{
+ /* RATS: These buffers are only used in
+ * length-limited calls. */
+ char hostname[256];
+ static char buf[128];
+ static int initialized = 0;
+
+ if (initialized++) return (unsigned char *)buf;
+
+ XmuGetHostname(hostname, sizeof(hostname));
+ snprintf(buf, sizeof(buf), "%s:%s:%s", DMX_IDENT, hostname, display);
+ return (unsigned char *)buf;
+}
+
+/** Starting with the \a start screen, iterate over all of the screens
+ * on the same physical X server as \a start, calling \a f with the
+ * screen and the \a closure. (The common case is that \a start is the
+ * only DMX window on the backend X server.) */
+void *dmxPropertyIterate(DMXScreenInfo *start,
+ void *(*f)(DMXScreenInfo *dmxScreen, void *),
+ void *closure)
+{
+ DMXScreenInfo *pt;
+
+ if (!start->next) {
+ if (!start->beDisplay) return NULL;
+ return f(start, closure);
+ }
+
+ for (pt = start->next; /* condition at end of loop */; pt = pt->next) {
+ void *retval;
+ /* beDisplay ban be NULL if a screen was detached */
+ dmxLog(dmxDebug, "pt = %p\n", pt);
+ dmxLog(dmxDebug, "pt->beDisplay = %p\n", pt->beDisplay);
+ if (pt->beDisplay && (retval = f(pt, closure))) return retval;
+ if (pt == start) break;
+ }
+ return NULL;
+}
+
+/** Returns 0 if this is the only Xdmx session on the display; 1
+ * otherwise. */
+static int dmxPropertyCheckOtherServers(DMXScreenInfo *dmxScreen, Atom atom)
+{
+ Display *dpy = dmxScreen->beDisplay;
+ XTextProperty tp;
+ XTextProperty tproot;
+ const char *pt;
+ int retcode = 0;
+ char **list = NULL;
+ int count = 0;
+ int i;
+ int (*dmxOldHandler)(Display *, XErrorEvent *);
+
+ if (!dpy)
+ return 0;
+
+ if (!XGetTextProperty(dpy, RootWindow(dpy,0), &tproot, atom)
+ || !tproot.nitems) return 0;
+
+ /* Ignore BadWindow errors for this
+ * routine because the window id stored
+ * in the property might be old */
+ dmxOldHandler = XSetErrorHandler(dmxPropertyErrorHandler);
+ for (pt = (const char *)tproot.value; pt && *pt; pt = pt ? pt + 1 : NULL) {
+ if ((pt = strchr(pt, ','))) {
+ Window win = strtol(pt+1, NULL, 10);
+ if (XGetTextProperty(dpy, win, &tp, atom) && tp.nitems) {
+ if (!strncmp((char *)tp.value, DMX_IDENT, strlen(DMX_IDENT))) {
+ int flag = 0;
+ for (i = 0; i < count; i++)
+ if (!strcmp(list[i], (char *)tp.value)) {
+ ++flag;
+ break;
+ }
+ if (flag) continue;
+ ++retcode;
+ dmxLogOutputWarning(dmxScreen,
+ "%s also running on %s\n",
+ tp.value, dmxScreen->name);
+ list = realloc(list, ++count * sizeof(*list));
+ list[count-1] = malloc(tp.nitems + 2);
+ strncpy(list[count-1], (char *)tp.value, tp.nitems + 1);
+ }
+ XFree(tp.value);
+ }
+ }
+ }
+ XSetErrorHandler(dmxOldHandler);
+
+ for (i = 0; i < count; i++) free(list[i]);
+ free(list);
+ XFree(tproot.value);
+ if (!retcode)
+ dmxLogOutput(dmxScreen, "No Xdmx server running on backend\n");
+ return retcode;
+}
+
+/** Returns NULL if this is the only Xdmx window on the display.
+ * Otherwise, returns a pointer to the dmxScreen of the other windows on
+ * the display. */
+static DMXScreenInfo *dmxPropertyCheckOtherWindows(DMXScreenInfo *dmxScreen,
+ Atom atom)
+{
+ Display *dpy = dmxScreen->beDisplay;
+ const unsigned char *id = dmxPropertyIdentifier();
+ XTextProperty tproot;
+ XTextProperty tp;
+ const char *pt;
+ int (*dmxOldHandler)(Display *, XErrorEvent *);
+
+ if (!dpy)
+ return NULL;
+
+ if (!XGetTextProperty(dpy, RootWindow(dpy,0), &tproot, atom)
+ || !tproot.nitems) return 0;
+
+ /* Ignore BadWindow errors for this
+ * routine because the window id stored
+ * in the property might be old */
+ dmxOldHandler = XSetErrorHandler(dmxPropertyErrorHandler);
+ for (pt = (const char *)tproot.value; pt && *pt; pt = pt ? pt + 1 : NULL) {
+ if ((pt = strchr(pt, ','))) {
+ Window win = strtol(pt+1, NULL, 10);
+ if (XGetTextProperty(dpy, win, &tp, atom) && tp.nitems) {
+ dmxLog(dmxDebug,"On %s/%lu: %s\n",
+ dmxScreen->name, win, tp.value);
+ if (!strncmp((char *)tp.value, (char *)id,
+ strlen((char *)id))) {
+ int idx;
+
+ if (!(pt = strchr((char *)tp.value, ','))) continue;
+ idx = strtol(pt+1, NULL, 10);
+ if (idx < 0 || idx >= dmxNumScreens) continue;
+ if (dmxScreens[idx].scrnWin != win) continue;
+ XSetErrorHandler(dmxOldHandler);
+ return &dmxScreens[idx];
+ }
+ XFree(tp.value);
+ }
+ }
+ }
+ XSetErrorHandler(dmxOldHandler);
+ XFree(tproot.value);
+ return 0;
+}
+
+/** Returns 0 if this is the only Xdmx session on the display; 1
+ * otherwise. */
+int dmxPropertyDisplay(DMXScreenInfo *dmxScreen)
+{
+ Atom atom;
+ const unsigned char *id = dmxPropertyIdentifier();
+ Display *dpy = dmxScreen->beDisplay;
+
+ if (!dpy)
+ return 0;
+
+ atom = XInternAtom(dpy, DMX_ATOMNAME, False);
+ if (dmxPropertyCheckOtherServers(dmxScreen, atom)) {
+ dmxScreen->shared = 1;
+ return 1;
+ }
+ XChangeProperty(dpy, RootWindow(dpy,0), atom, XA_STRING, 8,
+ PropModeReplace, id, strlen((char *)id));
+ return 0;
+}
+
+/** Returns 1 if the dmxScreen and the display in \a name are on the
+ * same display, or 0 otherwise. We can't just compare the display
+ * names because there can be multiple synonyms for the same display,
+ * some of which cannot be determined without accessing the display
+ * itself (e.g., domain aliases or machines with multiple NICs). */
+int dmxPropertySameDisplay(DMXScreenInfo *dmxScreen, const char *name)
+{
+ Display *dpy0 = dmxScreen->beDisplay;
+ Atom atom0;
+ XTextProperty tp0;
+ Display *dpy1 = NULL;
+ Atom atom1;
+ XTextProperty tp1;
+ int retval = 0;
+
+ if (!dpy0)
+ return 0;
+
+ tp0.nitems = 0;
+ tp1.nitems = 0;
+
+ if ((atom0 = XInternAtom(dpy0, DMX_ATOMNAME, True)) == None) {
+ dmxLog(dmxWarning, "No atom on %s\n", dmxScreen->name);
+ return 0;
+ }
+ if (!XGetTextProperty(dpy0, RootWindow(dpy0,0), &tp0, atom0)
+ || !tp0.nitems) {
+ dmxLog(dmxWarning, "No text property on %s\n", dmxScreen->name);
+ return 0;
+ }
+
+ if (!(dpy1 = XOpenDisplay(name))) {
+ dmxLog(dmxWarning, "Cannot open %s\n", name);
+ goto cleanup;
+ }
+ atom1 = XInternAtom(dpy1, DMX_ATOMNAME, True);
+ if (atom1 == None) {
+ dmxLog(dmxDebug, "No atom on %s\n", name);
+ goto cleanup;
+ }
+ if (!XGetTextProperty(dpy1, RootWindow(dpy1,0), &tp1, atom1)
+ || !tp1.nitems) {
+ dmxLog(dmxDebug, "No text property on %s\n", name);
+ goto cleanup;
+ }
+ if (!strcmp((char *)tp0.value, (char *)tp1.value)) retval = 1;
+
+ cleanup:
+ if (tp0.nitems) XFree(tp0.value);
+ if (tp1.nitems) XFree(tp1.value);
+ if (dpy1) XCloseDisplay(dpy1);
+ return retval;
+}
+
+/** Prints a log message if \a dmxScreen is on the same backend X server
+ * as some other DMX backend (output) screen. Modifies the property
+ * (#DMX_ATOMNAME) on the backend X server to reflect the creation of \a
+ * dmxScreen.
+ *
+ * The root window of the backend X server holds a list of window ids
+ * for all DMX windows (on this DMX server or some other DMX server).
+ *
+ * This list can then be iterated, and the property for each window can
+ * be examined. This property contains the following tuple (no quotes):
+ *
+ * "#DMX_IDENT:<hostname running DMX>:<display name of DMX>,<screen number>"
+ */
+void dmxPropertyWindow(DMXScreenInfo *dmxScreen)
+{
+ Atom atom;
+ const unsigned char *id = dmxPropertyIdentifier();
+ Display *dpy = dmxScreen->beDisplay;
+ Window win = dmxScreen->scrnWin;
+ DMXScreenInfo *other;
+ char buf[128]; /* RATS: only used with snprintf */
+
+ if (!dpy)
+ return; /* FIXME: What should be done here if Xdmx is started
+ * with this screen initially detached?
+ */
+
+ atom = XInternAtom(dpy, DMX_ATOMNAME, False);
+ if ((other = dmxPropertyCheckOtherWindows(dmxScreen, atom))) {
+ DMXScreenInfo *tmp = dmxScreen->next;
+ dmxScreen->next = (other->next ? other->next : other);
+ other->next = (tmp ? tmp : dmxScreen);
+ dmxLog(dmxDebug, "%d/%s/%lu and %d/%s/%lu are on the same backend\n",
+ dmxScreen->index, dmxScreen->name, dmxScreen->scrnWin,
+ other->index, other->name, other->scrnWin);
+ }
+
+ snprintf(buf, sizeof(buf), ".%d,%lu", dmxScreen->index,
+ (long unsigned)win);
+ XChangeProperty(dpy, RootWindow(dpy,0), atom, XA_STRING, 8,
+ PropModeAppend, (unsigned char *)buf, strlen(buf));
+
+ snprintf(buf, sizeof(buf), "%s,%d", id, dmxScreen->index);
+ XChangeProperty(dpy, win, atom, XA_STRING, 8,
+ PropModeAppend, (unsigned char *)buf, strlen(buf));
+}
diff --git a/xorg-server/hw/dmx/doc/dmx.xml b/xorg-server/hw/dmx/doc/dmx.xml
index c998485bc..ce472c2bf 100644
--- a/xorg-server/hw/dmx/doc/dmx.xml
+++ b/xorg-server/hw/dmx/doc/dmx.xml
@@ -1,3430 +1,3430 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
- "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
-]>
-
-<article>
-
- <articleinfo>
- <!-- Title information -->
- <title>Distributed Multihead X design</title>
- <authorgroup>
- <author><firstname>Kevin E.</firstname><surname>Martin</surname></author>
- <author><firstname>David H.</firstname><surname>Dawes</surname></author>
- <author><firstname>Rickard E.</firstname><surname>Faith</surname></author>
- </authorgroup>
- <pubdate>29 June 2004 (created 25 July 2001)</pubdate>
- <abstract><para>
- This document covers the motivation, background, design, and
- implementation of the distributed multihead X (DMX) system. It
- is a living document and describes the current design and
- implementation details of the DMX system. As the project
- progresses, this document will be continually updated to reflect
- the changes in the code and/or design. <emphasis remap="it">Copyright 2001 by VA
- Linux Systems, Inc., Fremont, California. Copyright 2001-2004
- by Red Hat, Inc., Raleigh, North Carolina</emphasis>
- </para></abstract>
- </articleinfo>
-
-<!-- Begin the document -->
-<sect1>
-<title>Introduction</title>
-
-<sect2>
-<title>The Distributed Multihead X Server</title>
-
-<para>Current Open Source multihead solutions are limited to a single
-physical machine. A single X server controls multiple display devices,
-which can be arranged as independent heads or unified into a single
-desktop (with Xinerama). These solutions are limited to the number of
-physical devices that can co-exist in a single machine (e.g., due to the
-number of AGP/PCI slots available for graphics cards). Thus, large
-tiled displays are not currently possible. The work described in this
-paper will eliminate the requirement that the display devices reside in
-the same physical machine. This will be accomplished by developing a
-front-end proxy X server that will control multiple back-end X servers
-that make up the large display.
-</para>
-
-<para>The overall structure of the distributed multihead X (DMX) project is
-as follows: A single front-end X server will act as a proxy to a set of
-back-end X servers, which handle all of the visible rendering. X
-clients will connect to the front-end server just as they normally would
-to a regular X server. The front-end server will present an abstracted
-view to the client of a single large display. This will ensure that all
-standard X clients will continue to operate without modification
-(limited, as always, by the visuals and extensions provided by the X
-server). Clients that are DMX-aware will be able to use an extension to
-obtain information about the back-end servers (e.g., for placement of
-pop-up windows, window alignments by the window manager, etc.).
-</para>
-
-<para>The architecture of the DMX server is divided into two main sections:
-input (e.g., mouse and keyboard events) and output (e.g., rendering and
-windowing requests). Each of these are describe briefly below, and the
-rest of this design document will describe them in greater detail.
-</para>
-
-<para>The DMX server can receive input from three general types of input
-devices: "local" devices that are physically attached to the machine on
-which DMX is running, "backend" devices that are physically attached to
-one or more of the back-end X servers (and that generate events via the
-X protocol stream from the backend), and "console" devices that can be
-abstracted from any non-back-end X server. Backend and console devices
-are treated differently because the pointer device on the back-end X
-server also controls the location of the hardware X cursor. Full
-support for XInput extension devices is provided.
-</para>
-
-<para>Rendering requests will be accepted by the front-end server; however,
-rendering to visible windows will be broken down as needed and sent to
-the appropriate back-end server(s) via X11 library calls for actual
-rendering. The basic framework will follow a Xnest-style approach. GC
-state will be managed in the front-end server and sent to the
-appropriate back-end server(s) as required. Pixmap rendering will (at
-least initially) be handled by the front-end X server. Windowing
-requests (e.g., ordering, mapping, moving, etc.) will handled in the
-front-end server. If the request requires a visible change, the
-windowing operation will be translated into requests for the appropriate
-back-end server(s). Window state will be mirrored in the back-end
-server(s) as needed.
-</para>
-</sect2>
-
-<sect2>
-<title>Layout of Paper</title>
-
-<para>The next section describes the general development plan that was
-actually used for implementation. The final section discusses
-outstanding issues at the conclusion of development. The first appendix
-provides low-level technical detail that may be of interest to those
-intimately familiar with the X server architecture. The final appendix
-describes the four phases of development that were performed during the
-first two years of development.
-</para>
-
-<para>The final year of work was divided into 9 tasks that are not
-described in specific sections of this document. The major tasks during
-that time were the enhancement of the reconfiguration ability added in
-Phase IV, addition of support for a dynamic number of back-end displays
-(instead of a hard-coded limit), and the support for back-end display
-and input removal and addition. This work is mentioned in this paper,
-but is not covered in detail.
-</para>
-</sect2>
-</sect1>
-
-<!-- ============================================================ -->
-<sect1>
-<title>Development plan</title>
-
-<para>This section describes the development plan from approximately June
-2001 through July 2003.
-</para>
-
-<sect2>
-<title>Bootstrap code</title>
-
-<para>To allow for rapid development of the DMX server by multiple
-developers during the first development stage, the problem will be
-broken down into three tasks: the overall DMX framework, back-end
-rendering services and input device handling services. However, before
-the work begins on these tasks, a simple framework that each developer
-could use was implemented to bootstrap the development effort. This
-framework renders to a single back-end server and provides dummy input
-devices (i.e., the keyboard and mouse). The simple back-end rendering
-service was implemented using the shadow framebuffer support currently
-available in the XFree86 environment.
-</para>
-
-<para>Using this bootstrapping framework, each developer has been able to
-work on each of the tasks listed above independently as follows: the
-framework will be extended to handle arbitrary back-end server
-configurations; the back-end rendering services will be transitioned to
-the more efficient Xnest-style implementation; and, an input device
-framework to handle various input devices via the input extension will
-be developed.
-</para>
-
-<para>Status: The boot strap code is complete. <!-- August 2001 -->
-</para>
-
-</sect2>
-
-<sect2>
-<title>Input device handling</title>
-
-<para>An X server (including the front-end X server) requires two core
-input devices -- a keyboard and a pointer (mouse). These core devices
-are handled and required by the core X11 protocol. Additional types of
-input devices may be attached and utilized via the XInput extension.
-These are usually referred to as ``XInput extension devices'',
-</para>
-
-<para>There are some options as to how the front-end X server gets its core
-input devices:
-
-<orderedlist>
-<listitem>
- <para>Local Input. The physical input devices (e.g., keyboard and
- mouse) can be attached directly to the front-end X server. In this
- case, the keyboard and mouse on the machine running the front-end X
- server will be used. The front-end will have drivers to read the
- raw input from those devices and convert it into the required X
- input events (e.g., key press/release, pointer button press/release,
- pointer motion). The front-end keyboard driver will keep track of
- keyboard properties such as key and modifier mappings, autorepeat
- state, keyboard sound and led state. Similarly the front-end
- pointer driver will keep track if pointer properties such as the
- button mapping and movement acceleration parameters. With this
- option, input is handled fully in the front-end X server, and the
- back-end X servers are used in a display-only mode. This option was
- implemented and works for a limited number of Linux-specific
- devices. Adding additional local input devices for other
- architectures is expected to be relatively simple.
-</para>
-
- <para>The following options are available for implementing local input
- devices:
-
-<orderedlist>
-<listitem>
- <para>The XFree86 X server has modular input drivers that could
- be adapted for this purpose. The mouse driver supports a wide
- range of mouse types and interfaces, as well as a range of
- Operating System platforms. The keyboard driver in XFree86 is
- not currently as modular as the mouse driver, but could be made
- so. The XFree86 X server also has a range of other input
- drivers for extended input devices such as tablets and touch
- screens. Unfortunately, the XFree86 drivers are generally
- complex, often simultaneously providing support for multiple
- devices across multiple architectures; and rely so heavily on
- XFree86-specific helper-functions, that this option was not
- pursued.
-</para>
-</listitem>
-
-<listitem>
- <para>The <command>kdrive</command> X server in XFree86 has built-in drivers that
- support PS/2 mice and keyboard under Linux. The mouse driver
- can indirectly handle other mouse types if the Linux utility
- <command>gpm</command> is used as to translate the native mouse protocol into
- PS/2 mouse format. These drivers could be adapted and built in
- to the front-end X server if this range of hardware and OS
- support is sufficient. While much simpler than the XFree86
- drivers, the <command>kdrive</command> drivers were not used for the DMX
- implementation.
-</para>
-</listitem>
-
-<listitem>
- <para>Reimplementation of keyboard and mouse drivers from
- scratch for the DMX framework. Because keyboard and mouse
- drivers are relatively trivial to implement, this pathway was
- selected. Other drivers in the X source tree were referenced,
- and significant contributions from other drivers are noted in
- the DMX source code.
-</para>
-</listitem>
-</orderedlist>
-</para>
-</listitem>
-
-<listitem>
- <para>Backend Input. The front-end can make use of the core input
- devices attached to one or more of the back-end X servers. Core
- input events from multiple back-ends are merged into a single input
- event stream. This can work sanely when only a single set of input
- devices is used at any given time. The keyboard and pointer state
- will be handled in the front-end, with changes propagated to the
- back-end servers as needed. This option was implemented and works
- well. Because the core pointer on a back-end controls the hardware
- mouse on that back-end, core pointers cannot be treated as XInput
- extension devices. However, all back-end XInput extensions devices
- can be mapped to either DMX core or DMX XInput extension devices.
-</para>
-</listitem>
-
-<listitem>
- <para>Console Input. The front-end server could create a console
- window that is displayed on an X server independent of the back-end
- X servers. This console window could display things like the
- physical screen layout, and the front-end could get its core input
- events from events delivered to the console window. This option was
- implemented and works well. To help the human navigate, window
- outlines are also displayed in the console window. Further, console
- windows can be used as either core or XInput extension devices.
-</para>
-</listitem>
-
-<listitem>
- <para>Other options were initially explored, but they were all
- partial subsets of the options listed above and, hence, are
- irrelevant.
-</para>
-</listitem>
-
-</orderedlist>
-</para>
-
-<para>Although extended input devices are not specifically mentioned in the
-Distributed X requirements, the options above were all implemented so
-that XInput extension devices were supported.
-</para>
-
-<para>The bootstrap code (Xdmx) had dummy input devices, and these are
-still supported in the final version. These do the necessary
-initialization to satisfy the X server's requirements for core pointer
-and keyboard devices, but no input events are ever generated.
-</para>
-
-<para>Status: The input code is complete. Because of the complexity of the
-XFree86 input device drivers (and their heavy reliance on XFree86
-infrastructure), separate low-level device drivers were implemented for
-Xdmx. The following kinds of drivers are supported (in general, the
-devices can be treated arbitrarily as "core" input devices or as XInput
-"extension" devices; and multiple instances of different kinds of
-devices can be simultaneously available):
-<orderedlist>
-<listitem>
- <para> A "dummy" device drive that never generates events.
-</para>
-</listitem>
-
-<listitem>
- <para> "Local" input is from the low-level hardware on which the
- Xdmx binary is running. This is the only area where using the
- XFree86 driver infrastructure would have been helpful, and then
- only partially, since good support for generic USB devices does
- not yet exist in XFree86 (in any case, XFree86 and kdrive driver
- code was used where possible). Currently, the following local
- devices are supported under Linux (porting to other operating
- systems should be fairly straightforward):
- <itemizedlist>
- <listitem><para>Linux keyboard</para></listitem>
- <listitem><para>Linux serial mouse (MS)</para></listitem>
- <listitem><para>Linux PS/2 mouse</para></listitem>
- <listitem><para>USB keyboard</para></listitem>
- <listitem><para>USB mouse</para></listitem>
- <listitem><para>USB generic device (e.g., joystick, gamepad, etc.)</para></listitem>
- </itemizedlist>
-</para>
-</listitem>
-
-<listitem>
- <para> "Backend" input is taken from one or more of the back-end
- displays. In this case, events are taken from the back-end X
- server and are converted to Xdmx events. Care must be taken so
- that the sprite moves properly on the display from which input
- is being taken.
-</para>
-</listitem>
-
-<listitem>
- <para> "Console" input is taken from an X window that Xdmx
- creates on the operator's display (i.e., on the machine running
- the Xdmx binary). When the operator's mouse is inside the
- console window, then those events are converted to Xdmx events.
- Several special features are available: the console can display
- outlines of windows that are on the Xdmx display (to facilitate
- navigation), the cursor can be confined to the console, and a
- "fine" mode can be activated to allow very precise cursor
- positioning.
-</para>
-</listitem>
-</orderedlist>
-
-</para>
-
-</sect2>
-
-<!-- May 2002; July 2003 -->
-
-<sect2>
-<title>Output device handling</title>
-
-<para>The output of the DMX system displays rendering and windowing
-requests across multiple screens. The screens are typically arranged in
-a grid such that together they represent a single large display.
-</para>
-
-<para>The output section of the DMX code consists of two parts. The first
-is in the front-end proxy X server (Xdmx), which accepts client
-connections, manages the windows, and potentially renders primitives but
-does not actually display any of the drawing primitives. The second
-part is the back-end X server(s), which accept commands from the
-front-end server and display the results on their screens.
-</para>
-
-<sect3>
-<title>Initialization</title>
-
-<para>The DMX front-end must first initialize its screens by connecting to
-each of the back-end X servers and collecting information about each of
-these screens. However, the information collected from the back-end X
-servers might be inconsistent. Handling these cases can be difficult
-and/or inefficient. For example, a two screen system has one back-end X
-server running at 16bpp while the second is running at 32bpp.
-Converting rendering requests (e.g., XPutImage() or XGetImage()
-requests) to the appropriate bit depth can be very time consuming.
-Analyzing these cases to determine how or even if it is possible to
-handle them is required. The current Xinerama code handles many of
-these cases (e.g., in PanoramiXConsolidate()) and will be used as a
-starting point. In general, the best solution is to use homogeneous X
-servers and display devices. Using back-end servers with the same depth
-is a requirement of the final DMX implementation.
-</para>
-
-<para>Once this screen consolidation is finished, the relative position of
-each back-end X server's screen in the unified screen is initialized. A
-full-screen window is opened on each of the back-end X servers, and the
-cursor on each screen is turned off. The final DMX implementation can
-also make use of a partial-screen window, or multiple windows per
-back-end screen.
-</para>
-</sect3>
-
-<sect3>
-<title>Handling rendering requests</title>
-
-<para>After initialization, X applications connect to the front-end server.
-There are two possible implementations of how rendering and windowing
-requests are handled in the DMX system:
-
-<orderedlist>
-<listitem>
- <para>A shadow framebuffer is used in the front-end server as the
- render target. In this option, all protocol requests are completely
- handled in the front-end server. All state and resources are
- maintained in the front-end including a shadow copy of the entire
- framebuffer. The framebuffers attached to the back-end servers are
- updated by XPutImage() calls with data taken directly from the
- shadow framebuffer.
-</para>
-
- <para>This solution suffers from two main problems. First, it does not
- take advantage of any accelerated hardware available in the system.
- Second, the size of the XPutImage() calls can be quite large and
- thus will be limited by the bandwidth available.
-</para>
-
- <para>The initial DMX implementation used a shadow framebuffer by
- default.
-</para>
-</listitem>
-
-<listitem>
- <para>Rendering requests are sent to each back-end server for
- handling (as is done in the Xnest server described above). In this
- option, certain protocol requests are handled in the front-end
- server and certain requests are repackaged and then sent to the
- back-end servers. The framebuffer is distributed across the
- multiple back-end servers. Rendering to the framebuffer is handled
- on each back-end and can take advantage of any acceleration
- available on the back-end servers' graphics display device. State
- is maintained both in the front and back-end servers.
-</para>
-
- <para>This solution suffers from two main drawbacks. First, protocol
- requests are sent to all back-end servers -- even those that will
- completely clip the rendering primitive -- which wastes bandwidth
- and processing time. Second, state is maintained both in the front-
- and back-end servers. These drawbacks are not as severe as in
- option 1 (above) and can either be overcome through optimizations or
- are acceptable. Therefore, this option will be used in the final
- implementation.
-</para>
-
- <para>The final DMX implementation defaults to this mechanism, but also
- supports the shadow framebuffer mechanism. Several optimizations
- were implemented to eliminate the drawbacks of the default
- mechanism. These optimizations are described the section below and
- in Phase II of the Development Results (see appendix).
-</para>
-</listitem>
-
-</orderedlist>
-</para>
-
-<para>Status: Both the shadow framebuffer and Xnest-style code is complete.
-<!-- May 2002 -->
-</para>
-
-</sect3>
-</sect2>
-
-<sect2>
-<title>Optimizing DMX</title>
-
-<para>Initially, the Xnest-style solution's performance will be measured
-and analyzed to determine where the performance bottlenecks exist.
-There are four main areas that will be addressed.
-</para>
-
-<para>First, to obtain reasonable interactivity with the first development
-phase, XSync() was called after each protocol request. The XSync()
-function flushes any pending protocol requests. It then waits for the
-back-end to process the request and send a reply that the request has
-completed. This happens with each back-end server and performance
-greatly suffers. As a result of the way XSync() is called in the first
-development phase, the batching that the X11 library performs is
-effectively defeated. The XSync() call usage will be analyzed and
-optimized by batching calls and performing them at regular intervals,
-except where interactivity will suffer (e.g., on cursor movements).
-</para>
-
-<para>Second, the initial Xnest-style solution described above sends the
-repackaged protocol requests to all back-end servers regardless of
-whether or not they would be completely clipped out. The requests that
-are trivially rejected on the back-end server wastes the limited
-bandwidth available. By tracking clipping changes in the DMX X server's
-windowing code (e.g., by opening, closing, moving or resizing windows),
-we can determine whether or not back-end windows are visible so that
-trivial tests in the front-end server's GC ops drawing functions can
-eliminate these unnecessary protocol requests.
-</para>
-
-<para>Third, each protocol request will be analyzed to determine if it is
-possible to break the request into smaller pieces at display boundaries.
-The initial ones to be analyzed are put and get image requests since
-they will require the greatest bandwidth to transmit data between the
-front and back-end servers. Other protocol requests will be analyzed
-and those that will benefit from breaking them into smaller requests
-will be implemented.
-</para>
-
-<para>Fourth, an extension is being considered that will allow font glyphs to
-be transferred from the front-end DMX X server to each back-end server.
-This extension will permit the front-end to handle all font requests and
-eliminate the requirement that all back-end X servers share the exact
-same fonts as the front-end server. We are investigating the
-feasibility of this extension during this development phase.
-</para>
-
-<para>Other potential optimizations will be determined from the performance
-analysis.
-</para>
-
-<para>Please note that in our initial design, we proposed optimizing BLT
-operations (e.g., XCopyArea() and window moves) by developing an
-extension that would allow individual back-end servers to directly copy
-pixel data to other back-end servers. This potential optimization was
-in response to the simple image movement implementation that required
-potentially many calls to GetImage() and PutImage(). However, the
-current Xinerama implementation handles these BLT operations
-differently. Instead of copying data to and from screens, they generate
-expose events -- just as happens in the case when a window is moved from
-off a screen to on screen. This approach saves the limited bandwidth
-available between front and back-end servers and is being standardized
-with Xinerama. It also eliminates the potential setup problems and
-security issues resulting from having each back-end server open
-connections to all other back-end servers. Therefore, we suggest
-accepting Xinerama's expose event solution.
-</para>
-
-<para>Also note that the approach proposed in the second and third
-optimizations might cause backing store algorithms in the back-end to be
-defeated, so a DMX X server configuration flag will be added to disable
-these optimizations.
-</para>
-
-<para>Status: The optimizations proposed above are complete. It was
-determined that the using the xfs font server was sufficient and
-creating a new mechanism to pass glyphs was redundant; therefore, the
-fourth optimization proposed above was not included in DMX.
-<!-- September 2002 -->
-</para>
-
-</sect2>
-
-<sect2>
-<title>DMX X extension support</title>
-
-<para>The DMX X server keeps track of all the windowing information on the
-back-end X servers, but does not currently export this information to
-any client applications. An extension will be developed to pass the
-screen information and back-end window IDs to DMX-aware clients. These
-clients can then use this information to directly connect to and render
-to the back-end windows. Bypassing the DMX X server allows DMX-aware
-clients to break up complex rendering requests on their own and send
-them directly to the windows on the back-end server's screens. An
-example of a client that can make effective use of this extension is
-Chromium.
-</para>
-
-<para>Status: The extension, as implemented, is fully documented in
-"Client-to-Server DMX Extension to the X Protocol". Future changes
-might be required based on feedback and other proposed enhancements to
-DMX. Currently, the following facilities are supported:
-<orderedlist>
-<listitem><para>
- Screen information (clipping rectangle for each screen relative
- to the virtual screen)
-</para></listitem>
-<listitem><para>
- Window information (window IDs and clipping information for each
- back-end window that corresponds to each DMX window)
-</para></listitem>
-<listitem><para>
- Input device information (mappings from DMX device IDs to
- back-end device IDs)
-</para></listitem>
-<listitem><para>
- Force window creation (so that a client can override the
- server-side lazy window creation optimization)
-</para></listitem>
-<listitem><para>
- Reconfiguration (so that a client can request that a screen
- position be changed)
-</para></listitem>
-<listitem><para>
- Addition and removal of back-end servers and back-end and
- console inputs.
-</para></listitem>
-</orderedlist>
-</para>
-<!-- September 2002; July 2003 -->
-
-</sect2>
-
-<sect2>
-<title>Common X extension support</title>
-
-<para>The XInput, XKeyboard and Shape extensions are commonly used
-extensions to the base X11 protocol. XInput allows multiple and
-non-standard input devices to be accessed simultaneously. These input
-devices can be connected to either the front-end or back-end servers.
-XKeyboard allows much better keyboard mappings control. Shape adds
-support for arbitrarily shaped windows and is used by various window
-managers. Nearly all potential back-end X servers make these extensions
-available, and support for each one will be added to the DMX system.
-</para>
-
-<para>In addition to the extensions listed above, support for the X
-Rendering extension (Render) is being developed. Render adds digital
-image composition to the rendering model used by the X Window System.
-While this extension is still under development by Keith Packard of HP,
-support for the current version will be added to the DMX system.
-</para>
-
-<para>Support for the XTest extension was added during the first
-development phase.
-</para>
-
-<!-- WARNING: this list is duplicated in the Phase IV discussion -->
-<para>Status: The following extensions are supported and are discussed in
-more detail in Phase IV of the Development Results (see appendix):
- BIG-REQUESTS,
- DEC-XTRAP,
- DMX,
- DPMS,
- Extended-Visual-Information,
- GLX,
- LBX,
- RECORD,
- RENDER,
- SECURITY,
- SHAPE,
- SYNC,
- X-Resource,
- XC-APPGROUP,
- XC-MISC,
- XFree86-Bigfont,
- XINERAMA,
- XInputExtension,
- XKEYBOARD, and
- XTEST.
-<!-- November 2002; updated February 2003, July 2003 -->
-</para>
-</sect2>
-
-<sect2>
-<title>OpenGL support</title>
-
-<para>OpenGL support using the Mesa code base exists in XFree86 release 4
-and later. Currently, the direct rendering infrastructure (DRI)
-provides accelerated OpenGL support for local clients and unaccelerated
-OpenGL support (i.e., software rendering) is provided for non-local
-clients.
-</para>
-
-<para>The single head OpenGL support in XFree86 4.x will be extended to use
-the DMX system. When the front and back-end servers are on the same
-physical hardware, it is possible to use the DRI to directly render to
-the back-end servers. First, the existing DRI will be extended to
-support multiple display heads, and then to support the DMX system.
-OpenGL rendering requests will be direct rendering to each back-end X
-server. The DRI will request the screen layout (either from the
-existing Xinerama extension or a DMX-specific extension). Support for
-synchronized swap buffers will also be added (on hardware that supports
-it). Note that a single front-end server with a single back-end server
-on the same physical machine can emulate accelerated indirect rendering.
-</para>
-
-<para>When the front and back-end servers are on different physical
-hardware or are using non-XFree86 4.x X servers, a mechanism to render
-primitives across the back-end servers will be provided. There are
-several options as to how this can be implemented.
-</para>
-
-<orderedlist>
-<listitem>
- <para>The existing OpenGL support in each back-end server can be
- used by repackaging rendering primitives and sending them to each
- back-end server. This option is similar to the unoptimized
- Xnest-style approach mentioned above. Optimization of this solution
- is beyond the scope of this project and is better suited to other
- distributed rendering systems.
-</para></listitem>
-
-<listitem>
- <para>Rendering to a pixmap in the front-end server using the
- current XFree86 4.x code, and then displaying to the back-ends via
- calls to XPutImage() is another option. This option is similar to
- the shadow frame buffer approach mentioned above. It is slower and
- bandwidth intensive, but has the advantage that the back-end servers
- are not required to have OpenGL support.
-</para></listitem>
-</orderedlist>
-
-<para>These, and other, options will be investigated in this phase of the
-work.
-</para>
-
-<para>Work by others have made Chromium DMX-aware. Chromium will use the
-DMX X protocol extension to obtain information about the back-end
-servers and will render directly to those servers, bypassing DMX.
-</para>
-
-<para>Status: OpenGL support by the glxProxy extension was implemented by
-SGI and has been integrated into the DMX code base.
-</para>
-<!-- May 2003-->
-</sect2>
-
-</sect1>
-
-<!-- ============================================================ -->
-<sect1>
-<title>Current issues</title>
-
-<para>In this sections the current issues are outlined that require further
-investigation.
-</para>
-
-<sect2>
-<title>Fonts</title>
-
-<para>The font path and glyphs need to be the same for the front-end and
-each of the back-end servers. Font glyphs could be sent to the back-end
-servers as necessary but this would consume a significant amount of
-available bandwidth during font rendering for clients that use many
-different fonts (e.g., Netscape). Initially, the font server (xfs) will
-be used to provide the fonts to both the front-end and back-end servers.
-Other possibilities will be investigated during development.
-</para>
-</sect2>
-
-<sect2>
-<title>Zero width rendering primitives</title>
-
-<para>To allow pixmap and on-screen rendering to be pixel perfect, all
-back-end servers must render zero width primitives exactly the same as
-the front-end renders the primitives to pixmaps. For those back-end
-servers that do not exactly match, zero width primitives will be
-automatically converted to one width primitives. This can be handled in
-the front-end server via the GC state.
-</para>
-</sect2>
-
-<sect2>
-<title>Output scaling</title>
-
-<para>With very large tiled displays, it might be difficult to read the
-information on the standard X desktop. In particular, the cursor can be
-easily lost and fonts could be difficult to read. Automatic primitive
-scaling might prove to be very useful. We will investigate the
-possibility of scaling the cursor and providing a set of alternate
-pre-scaled fonts to replace the standard fonts that many applications
-use (e.g., fixed). Other options for automatic scaling will also be
-investigated.
-</para>
-</sect2>
-
-<sect2>
-<title>Per-screen colormaps</title>
-
-<para>Each screen's default colormap in the set of back-end X servers
-should be able to be adjusted via a configuration utility. This support
-is would allow the back-end screens to be calibrated via custom gamma
-tables. On 24-bit systems that support a DirectColor visual, this type
-of correction can be accommodated. One possible implementation would be
-to advertise to X client of the DMX server a TrueColor visual while
-using DirectColor visuals on the back-end servers to implement this type
-of color correction. Other options will be investigated.
-</para>
-</sect2>
-</sect1>
-
-<!-- ============================================================ -->
-<appendix>
-<title>Appendix</title>
-
-<sect1>
-<title>Background</title>
-
-<para>This section describes the existing Open Source architectures that
-can be used to handle multiple screens and upon which this development
-project is based. This section was written before the implementation
-was finished, and may not reflect actual details of the implementation.
-It is left for historical interest only.
-</para>
-
-<sect2>
-<title>Core input device handling</title>
-
-<para>The following is a description of how core input devices are handled
-by an X server.
-</para>
-
-<sect3>
-<title>InitInput()</title>
-
-<para>InitInput() is a DDX function that is called at the start of each
-server generation from the X server's main() function. Its purpose is
-to determine what input devices are connected to the X server, register
-them with the DIX and MI layers, and initialize the input event queue.
-InitInput() does not have a return value, but the X server will abort if
-either a core keyboard device or a core pointer device are not
-registered. Extended input (XInput) devices can also be registered in
-InitInput().
-</para>
-
-<para>InitInput() usually has implementation specific code to determine
-which input devices are available. For each input device it will be
-using, it calls AddInputDevice():
-
-<variablelist>
-<varlistentry>
-<term>AddInputDevice()</term>
-<listitem><para>This DIX function allocates the device structure,
-registers a callback function (which handles device init, close, on and
-off), and returns the input handle, which can be treated as opaque. It
-is called once for each input device.
-</para></listitem>
-</varlistentry>
-</variablelist>
-</para>
-
-<para>Once input handles for core keyboard and core pointer devices have
-been obtained from AddInputDevice(). If both core devices are not
-registered, then the X server will exit with a fatal error when it
-attempts to start the input devices in InitAndStartDevices(), which is
-called directly after InitInput() (see below).
-</para>
-
-<para>The core pointer device is then registered with the miPointer code
-(which does the high level cursor handling). While this registration
-is not necessary for correct miPointer operation in the current XFree86
-code, it is still done mostly for compatibility reasons.
-</para>
-
-<para><variablelist>
-
-<varlistentry>
-<term>miRegisterPointerDevice()</term>
-<listitem><para>This MI function registers the core
-pointer's input handle with with the miPointer code.
-</para></listitem></varlistentry>
-</variablelist>
-</para>
-
-<para>The final part of InitInput() is the initialization of the input
-event queue handling. In most cases, the event queue handling provided
-in the MI layer is used. The primary XFree86 X server uses its own
-event queue handling to support some special cases related to the XInput
-extension and the XFree86-specific DGA extension. For our purposes, the
-MI event queue handling should be suitable. It is initialized by
-calling mieqInit():
-
-<variablelist>
-<varlistentry>
-<term>mieqInit()</term>
-<listitem><para>This MI function initializes the MI event queue for the
-core devices, and is passed the public component of the input handles
-for the two core devices.
-</para></listitem></varlistentry>
-</variablelist>
-</para>
-
-<para>If a wakeup handler is required to deliver synchronous input
-events, it can be registered here by calling the DIX function
-RegisterBlockAndWakeupHandlers(). (See the devReadInput() description
-below.)
-</para>
-</sect3>
-
-<sect3>
-<title>InitAndStartDevices()</title>
-
-<para>InitAndStartDevices() is a DIX function that is called immediately
-after InitInput() from the X server's main() function. Its purpose is
-to initialize each input device that was registered with
-AddInputDevice(), enable each input device that was successfully
-initialized, and create the list of enabled input devices. Once each
-registered device is processed in this way, the list of enabled input
-devices is checked to make sure that both a core keyboard device and
-core pointer device were registered and successfully enabled. If not,
-InitAndStartDevices() returns failure, and results in the the X server
-exiting with a fatal error.
-</para>
-
-<para>Each registered device is initialized by calling its callback
-(dev-&gt;deviceProc) with the DEVICE_INIT argument:
-
-<variablelist>
-<varlistentry>
-<term>(*dev-&gt;deviceProc)(dev, DEVICE_INIT)</term>
-<listitem>
-<para>This function initializes the
-device structs with core information relevant to the device.
-</para>
-
-<para>For pointer devices, this means specifying the number of buttons,
-default button mapping, the function used to get motion events (usually
-miPointerGetMotionEvents()), the function used to change/control the
-core pointer motion parameters (acceleration and threshold), and the
-motion buffer size.
-</para>
-
-<para>For keyboard devices, this means specifying the keycode range,
-default keycode to keysym mapping, default modifier mapping, and the
-functions used to sound the keyboard bell and modify/control the
-keyboard parameters (LEDs, bell pitch and duration, key click, which
-keys are auto-repeating, etc).
-</para></listitem></varlistentry>
-</variablelist>
-</para>
-
-<para>Each initialized device is enabled by calling EnableDevice():
-
-<variablelist>
-<varlistentry>
-<term>EnableDevice()</term>
-<listitem>
-<para>EnableDevice() calls the device callback with
-DEVICE_ON:
- <variablelist>
- <varlistentry>
- <term>(*dev-&gt;deviceProc)(dev, DEVICE_ON)</term>
- <listitem>
- <para>This typically opens and
- initializes the relevant physical device, and when appropriate,
- registers the device's file descriptor (or equivalent) as a valid
- input source.
- </para></listitem></varlistentry>
- </variablelist>
- </para>
-
- <para>EnableDevice() then adds the device handle to the X server's
- global list of enabled devices.
-</para></listitem></varlistentry>
-</variablelist>
-</para>
-
-<para>InitAndStartDevices() then verifies that a valid core keyboard and
-pointer has been initialized and enabled. It returns failure if either
-are missing.
-</para>
-</sect3>
-
-<sect3>
-<title>devReadInput()</title>
-
-<para>Each device will have some function that gets called to read its
-physical input. These may be called in a number of different ways. In
-the case of synchronous I/O, they will be called from a DDX
-wakeup-handler that gets called after the server detects that new input is
-available. In the case of asynchronous I/O, they will be called from a
-(SIGIO) signal handler triggered when new input is available. This
-function should do at least two things: make sure that input events get
-enqueued, and make sure that the cursor gets moved for motion events
-(except if these are handled later by the driver's own event queue
-processing function, which cannot be done when using the MI event queue
-handling).
-</para>
-
-<para>Events are queued by calling mieqEnqueue():
-
-<variablelist>
-<varlistentry>
-<term>mieqEnqueue()</term>
-<listitem>
-<para>This MI function is used to add input events to the
-event queue. It is simply passed the event to be queued.
-</para></listitem></varlistentry>
-</variablelist>
-</para>
-
-<para>The cursor position should be updated when motion events are
-enqueued, by calling either miPointerAbsoluteCursor() or
-miPointerDeltaCursor():
-
-<variablelist>
-<varlistentry>
-<term>miPointerAbsoluteCursor()</term>
-<listitem>
-<para>This MI function is used to move the
-cursor to the absolute coordinates provided.
-</para></listitem></varlistentry>
-<varlistentry>
-<term>miPointerDeltaCursor()</term>
-<listitem>
-<para>This MI function is used to move the cursor
-relative to its current position.
-</para></listitem></varlistentry>
-</variablelist>
-</para>
-</sect3>
-
-<sect3>
-<title>ProcessInputEvents()</title>
-
-<para>ProcessInputEvents() is a DDX function that is called from the X
-server's main dispatch loop when new events are available in the input
-event queue. It typically processes the enqueued events, and updates
-the cursor/pointer position. It may also do other DDX-specific event
-processing.
-</para>
-
-<para>Enqueued events are processed by mieqProcessInputEvents() and passed
-to the DIX layer for transmission to clients:
-
-<variablelist>
-<varlistentry>
-<term>mieqProcessInputEvents()</term>
-<listitem>
-<para>This function processes each event in the
-event queue, and passes it to the device's input processing function.
-The DIX layer provides default functions to do this processing, and they
-handle the task of getting the events passed back to the relevant
-clients.
-</para></listitem></varlistentry>
-<varlistentry>
-<term>miPointerUpdate()</term>
-<listitem>
-<para>This function resynchronized the cursor position
-with the new pointer position. It also takes care of moving the cursor
-between screens when needed in multi-head configurations.
-</para></listitem></varlistentry>
-</variablelist>
-</para>
-
-</sect3>
-
-<sect3>
-<title>DisableDevice()</title>
-
-<para>DisableDevice is a DIX function that removes an input device from the
-list of enabled devices. The result of this is that the device no
-longer generates input events. The device's data structures are kept in
-place, and disabling a device like this can be reversed by calling
-EnableDevice(). DisableDevice() may be called from the DDX when it is
-desirable to do so (e.g., the XFree86 server does this when VT
-switching). Except for special cases, this is not normally called for
-core input devices.
-</para>
-
-<para>DisableDevice() calls the device's callback function with
-<constant>DEVICE_OFF</constant>:
-
-<variablelist>
-<varlistentry>
-<term>(*dev-&gt;deviceProc)(dev, DEVICE_OFF)</term>
-<listitem>
-<para>This typically closes the
-relevant physical device, and when appropriate, unregisters the device's
-file descriptor (or equivalent) as a valid input source.
-</para></listitem></varlistentry>
-</variablelist>
-</para>
-
-<para>DisableDevice() then removes the device handle from the X server's
-global list of enabled devices.
-</para>
-
-</sect3>
-
-<sect3>
-<title>CloseDevice()</title>
-
-<para>CloseDevice is a DIX function that removes an input device from the
-list of available devices. It disables input from the device and frees
-all data structures associated with the device. This function is
-usually called from CloseDownDevices(), which is called from main() at
-the end of each server generation to close all input devices.
-</para>
-
-<para>CloseDevice() calls the device's callback function with
-<constant>DEVICE_CLOSE</constant>:
-
-<variablelist>
-<varlistentry>
-<term>(*dev-&gt;deviceProc)(dev, DEVICE_CLOSE)</term>
-<listitem>
-<para>This typically closes the
-relevant physical device, and when appropriate, unregisters the device's
-file descriptor (or equivalent) as a valid input source. If any device
-specific data structures were allocated when the device was initialized,
-they are freed here.
-</para></listitem></varlistentry>
-</variablelist>
-</para>
-
-<para>CloseDevice() then frees the data structures that were allocated
-for the device when it was registered/initialized.
-</para>
-
-</sect3>
-
-<sect3>
-<title>LegalModifier()</title>
-<!-- dmx/dmxinput.c - currently returns TRUE -->
-<para>LegalModifier() is a required DDX function that can be used to
-restrict which keys may be modifier keys. This seems to be present for
-historical reasons, so this function should simply return TRUE
-unconditionally.
-</para>
-
-</sect3>
-</sect2>
-
-<sect2>
-<title>Output handling</title>
-
-<para>The following sections describe the main functions required to
-initialize, use and close the output device(s) for each screen in the X
-server.
-</para>
-
-<sect3>
-<title>InitOutput()</title>
-
-<para>This DDX function is called near the start of each server generation
-from the X server's main() function. InitOutput()'s main purpose is to
-initialize each screen and fill in the global screenInfo structure for
-each screen. It is passed three arguments: a pointer to the screenInfo
-struct, which it is to initialize, and argc and argv from main(), which
-can be used to determine additional configuration information.
-</para>
-
-<para>The primary tasks for this function are outlined below:
-
-<orderedlist>
-<listitem>
- <para><emphasis remap="bf">Parse configuration info:</emphasis> The first task of InitOutput()
- is to parses any configuration information from the configuration
- file. In addition to the XF86Config file, other configuration
- information can be taken from the command line. The command line
- options can be gathered either in InitOutput() or earlier in the
- ddxProcessArgument() function, which is called by
- ProcessCommandLine(). The configuration information determines the
- characteristics of the screen(s). For example, in the XFree86 X
- server, the XF86Config file specifies the monitor information, the
- screen resolution, the graphics devices and slots in which they are
- located, and, for Xinerama, the screens' layout.
-</para>
-</listitem>
-
-<listitem>
- <para><emphasis remap="bf">Initialize screen info:</emphasis> The next task is to initialize
- the screen-dependent internal data structures. For example, part of
- what the XFree86 X server does is to allocate its screen and pixmap
- private indices, probe for graphics devices, compare the probed
- devices to the ones listed in the XF86Config file, and add the ones that
- match to the internal xf86Screens&lsqb;&rsqb; structure.
-</para>
-</listitem>
-
-<listitem>
- <para><emphasis remap="bf">Set pixmap formats:</emphasis> The next task is to initialize the
- screenInfo's image byte order, bitmap bit order and bitmap scanline
- unit/pad. The screenInfo's pixmap format's depth, bits per pixel
- and scanline padding is also initialized at this stage.
-</para>
-</listitem>
-
-<listitem>
- <para><emphasis remap="bf">Unify screen info:</emphasis> An optional task that might be done at
- this stage is to compare all of the information from the various
- screens and determines if they are compatible (i.e., if the set of
- screens can be unified into a single desktop). This task has
- potential to be useful to the DMX front-end server, if Xinerama's
- PanoramiXConsolidate() function is not sufficient.
-</para>
-</listitem>
-</orderedlist>
-</para>
-
-<para>Once these tasks are complete, the valid screens are known and each
-of these screens can be initialized by calling AddScreen().
-</para>
-</sect3>
-
-<sect3>
-<title>AddScreen()</title>
-
-<para>This DIX function is called from InitOutput(), in the DDX layer, to
-add each new screen to the screenInfo structure. The DDX screen
-initialization function and command line arguments (i.e., argc and argv)
-are passed to it as arguments.
-</para>
-
-<para>This function first allocates a new Screen structure and any privates
-that are required. It then initializes some of the fields in the Screen
-struct and sets up the pixmap padding information. Finally, it calls
-the DDX screen initialization function ScreenInit(), which is described
-below. It returns the number of the screen that were just added, or -1
-if there is insufficient memory to add the screen or if the DDX screen
-initialization fails.
-</para>
-</sect3>
-
-<sect3>
-<title>ScreenInit()</title>
-
-<para>This DDX function initializes the rest of the Screen structure with
-either generic or screen-specific functions (as necessary). It also
-fills in various screen attributes (e.g., width and height in
-millimeters, black and white pixel values).
-</para>
-
-<para>The screen init function usually calls several functions to perform
-certain screen initialization functions. They are described below:
-
-<variablelist>
-<varlistentry>
-<term>{mi,*fb}ScreenInit()</term>
-<listitem>
-<para>The DDX layer's ScreenInit() function usually
-calls another layer's ScreenInit() function (e.g., miScreenInit() or
-fbScreenInit()) to initialize the fallbacks that the DDX driver does not
-specifically handle.
-</para>
-
-<para>After calling another layer's ScreenInit() function, any
-screen-specific functions either wrap or replace the other layer's
-function pointers. If a function is to be wrapped, each of the old
-function pointers from the other layer are stored in a screen private
-area. Common functions to wrap are CloseScreen() and SaveScreen().
-</para></listitem></varlistentry>
-
-<varlistentry>
-<term>miInitializeBackingStore()</term>
-<listitem>
-<para>This MI function initializes the
-screen's backing storage functions, which are used to save areas of
-windows that are currently covered by other windows.
-</para></listitem></varlistentry>
-
-<varlistentry>
-<term>miDCInitialize()</term>
-<listitem>
-<para>This MI function initializes the MI cursor
-display structures and function pointers. If a hardware cursor is used,
-the DDX layer's ScreenInit() function will wrap additional screen and
-the MI cursor display function pointers.
-</para></listitem></varlistentry>
-</variablelist>
-</para>
-
-<para>Another common task for ScreenInit() function is to initialize the
-output device state. For example, in the XFree86 X server, the
-ScreenInit() function saves the original state of the video card and
-then initializes the video mode of the graphics device.
-</para>
-</sect3>
-
-<sect3>
-<title>CloseScreen()</title>
-
-<para>This function restores any wrapped screen functions (and in
-particular the wrapped CloseScreen() function) and restores the state of
-the output device to its original state. It should also free any
-private data it created during the screen initialization.
-</para>
-</sect3>
-
-<sect3>
-<title>GC operations</title>
-
-<para>When the X server is requested to render drawing primitives, it does
-so by calling drawing functions through the graphics context's operation
-function pointer table (i.e., the GCOps functions). These functions
-render the basic graphics operations such as drawing rectangles, lines,
-text or copying pixmaps. Default routines are provided either by the MI
-layer, which draws indirectly through a simple span interface, or by the
-framebuffer layers (e.g., CFB, MFB, FB), which draw directly to a
-linearly mapped frame buffer.
-</para>
-
-<para>To take advantage of special hardware on the graphics device,
-specific GCOps functions can be replaced by device specific code.
-However, many times the graphics devices can handle only a subset of the
-possible states of the GC, so during graphics context validation,
-appropriate routines are selected based on the state and capabilities of
-the hardware. For example, some graphics hardware can accelerate single
-pixel width lines with certain dash patterns. Thus, for dash patterns
-that are not supported by hardware or for width 2 or greater lines, the
-default routine is chosen during GC validation.
-</para>
-
-<para>Note that some pointers to functions that draw to the screen are
-stored in the Screen structure. They include GetImage(), GetSpans(),
-CopyWindow() and RestoreAreas().
-</para>
-</sect3>
-
-<sect3>
-<title>Xnest</title>
-
-<para>The Xnest X server is a special proxy X server that relays the X
-protocol requests that it receives to a ``real'' X server that then
-processes the requests and displays the results, if applicable. To the X
-applications, Xnest appears as if it is a regular X server. However,
-Xnest is both server to the X application and client of the real X
-server, which will actually handle the requests.
-</para>
-
-<para>The Xnest server implements all of the standard input and output
-initialization steps outlined above.
-</para>
-
-<para><variablelist>
-<varlistentry>
-<term>InitOutput()</term>
-<listitem>
-<para>Xnest takes its configuration information from
-command line arguments via ddxProcessArguments(). This information
-includes the real X server display to connect to, its default visual
-class, the screen depth, the Xnest window's geometry, etc. Xnest then
-connects to the real X server and gathers visual, colormap, depth and
-pixmap information about that server's display, creates a window on that
-server, which will be used as the root window for Xnest.
-</para>
-
-<para>Next, Xnest initializes its internal data structures and uses the
-data from the real X server's pixmaps to initialize its own pixmap
-formats. Finally, it calls AddScreen(xnestOpenScreen, argc, argv) to
-initialize each of its screens.
-</para></listitem></varlistentry>
-
-<varlistentry>
-<term>ScreenInit()</term>
-<listitem>
-<para>Xnest's ScreenInit() function is called
-xnestOpenScreen(). This function initializes its screen's depth and
-visual information, and then calls miScreenInit() to set up the default
-screen functions. It then calls miInitializeBackingStore() and
-miDCInitialize() to initialize backing store and the software cursor.
-Finally, it replaces many of the screen functions with its own
-functions that repackage and send the requests to the real X server to
-which Xnest is attached.
-</para></listitem></varlistentry>
-
-<varlistentry>
-<term>CloseScreen()</term>
-<listitem>
-<para>This function frees its internal data structure
-allocations. Since it replaces instead of wrapping screen functions,
-there are no function pointers to unwrap. This can potentially lead to
-problems during server regeneration.
-</para></listitem></varlistentry>
-
-<varlistentry>
-<term>GC operations</term>
-<listitem>
-<para>The GC operations in Xnest are very simple since
-they leave all of the drawing to the real X server to which Xnest is
-attached. Each of the GCOps takes the request and sends it to the
-real X server using standard Xlib calls. For example, the X
-application issues a XDrawLines() call. This function turns into a
-protocol request to Xnest, which calls the xnestPolylines() function
-through Xnest's GCOps function pointer table. The xnestPolylines()
-function is only a single line, which calls XDrawLines() using the same
-arguments that were passed into it. Other GCOps functions are very
-similar. Two exceptions to the simple GCOps functions described above
-are the image functions and the BLT operations.
-</para>
-
-<para>The image functions, GetImage() and PutImage(), must use a temporary
-image to hold the image to be put of the image that was just grabbed
-from the screen while it is in transit to the real X server or the
-client. When the image has been transmitted, the temporary image is
-destroyed.
-</para>
-
-<para>The BLT operations, CopyArea() and CopyPlane(), handle not only the
-copy function, which is the same as the simple cases described above,
-but also the graphics exposures that result when the GC's graphics
-exposure bit is set to True. Graphics exposures are handled in a helper
-function, xnestBitBlitHelper(). This function collects the exposure
-events from the real X server and, if any resulting in regions being
-exposed, then those regions are passed back to the MI layer so that it
-can generate exposure events for the X application.
-</para></listitem></varlistentry>
-</variablelist>
-</para>
-
-<para>The Xnest server takes its input from the X server to which it is
-connected. When the mouse is in the Xnest server's window, keyboard and
-mouse events are received by the Xnest server, repackaged and sent back
-to any client that requests those events.
-</para>
-</sect3>
-
-<sect3>
-<title>Shadow framebuffer</title>
-
-<para>The most common type of framebuffer is a linear array memory that
-maps to the video memory on the graphics device. However, accessing
-that video memory over an I/O bus (e.g., ISA or PCI) can be slow. The
-shadow framebuffer layer allows the developer to keep the entire
-framebuffer in main memory and copy it back to video memory at regular
-intervals. It also has been extended to handle planar video memory and
-rotated framebuffers.
-</para>
-
-<para>There are two main entry points to the shadow framebuffer code:
-
-<variablelist>
-<varlistentry>
-<term>shadowAlloc(width, height, bpp)</term>
-<listitem>
-<para>This function allocates the in
-memory copy of the framebuffer of size width*height*bpp. It returns a
-pointer to that memory, which will be used by the framebuffer
-ScreenInit() code during the screen's initialization.
-</para></listitem></varlistentry>
-
-<varlistentry>
-<term>shadowInit(pScreen, updateProc, windowProc)</term>
-<listitem>
-<para>This function
-initializes the shadow framebuffer layer. It wraps several screen
-drawing functions, and registers a block handler that will update the
-screen. The updateProc is a function that will copy the damaged regions
-to the screen, and the windowProc is a function that is used when the
-entire linear video memory range cannot be accessed simultaneously so
-that only a window into that memory is available (e.g., when using the
-VGA aperture).
-</para></listitem></varlistentry>
-</variablelist>
-</para>
-
-<para>The shadow framebuffer code keeps track of the damaged area of each
-screen by calculating the bounding box of all drawing operations that
-have occurred since the last screen update. Then, when the block handler
-is next called, only the damaged portion of the screen is updated.
-</para>
-
-<para>Note that since the shadow framebuffer is kept in main memory, all
-drawing operations are performed by the CPU and, thus, no accelerated
-hardware drawing operations are possible.
-</para>
-
-</sect3>
-</sect2>
-
-<sect2>
-<title>Xinerama</title>
-
-<para>Xinerama is an X extension that allows multiple physical screens
-controlled by a single X server to appear as a single screen. Although
-the extension allows clients to find the physical screen layout via
-extension requests, it is completely transparent to clients at the core
-X11 protocol level. The original public implementation of Xinerama came
-from Digital/Compaq. XFree86 rewrote it, filling in some missing pieces
-and improving both X11 core protocol compliance and performance. The
-Xinerama extension will be passing through X.Org's standardization
-process in the near future, and the sample implementation will be based
-on this rewritten version.
-</para>
-
-<para>The current implementation of Xinerama is based primarily in the DIX
-(device independent) and MI (machine independent) layers of the X
-server. With few exceptions the DDX layers do not need any changes to
-support Xinerama. X server extensions often do need modifications to
-provide full Xinerama functionality.
-</para>
-
-<para>The following is a code-level description of how Xinerama functions.
-</para>
-
-<para>Note: Because the Xinerama extension was originally called the
-PanoramiX extension, many of the Xinerama functions still have the
-PanoramiX prefix.
-</para>
-
-<variablelist>
-<varlistentry>
-<term>PanoramiXExtensionInit()</term>
-<listitem>
- <para>PanoramiXExtensionInit() is a
- device-independent extension function that is called at the start of
- each server generation from InitExtensions(), which is called from
- the X server's main() function after all output devices have been
- initialized, but before any input devices have been initialized.
- </para>
-
- <para>PanoramiXNumScreens is set to the number of physical screens. If
- only one physical screen is present, the extension is disabled, and
- PanoramiXExtensionInit() returns without doing anything else.
- </para>
-
- <para>The Xinerama extension is registered by calling AddExtension().
- </para>
-
- <para>GC and Screen private
- indexes are allocated, and both GC and Screen private areas are
- allocated for each physical screen. These hold Xinerama-specific
- per-GC and per-Screen data. Each screen's CreateGC and CloseScreen
- functions are wrapped by XineramaCreateGC() and
- XineramaCloseScreen() respectively. Some new resource classes are
- created for Xinerama drawables and GCs, and resource types for
- Xinerama windows, pixmaps and colormaps.
- </para>
-
- <para>A region (PanoramiXScreenRegion) is
- initialized to be the union of the screen regions.
- The relative positioning information for the
- physical screens is taken from the ScreenRec x and y members, which
- the DDX layer must initialize in InitOutput(). The bounds of the
- combined screen is also calculated (PanoramiXPixWidth and
- PanoramiXPixHeight).
- </para>
-
- <para>The DIX layer has a list of function pointers
- (ProcVector&lsqb;&rsqb;) that
- holds the entry points for the functions that process core protocol
- requests. The requests that Xinerama must intercept and break up
- into physical screen-specific requests are wrapped. The original
- set is copied to SavedProcVector&lsqb;&rsqb;. The types of requests
- intercepted are Window requests, GC requests, colormap requests,
- drawing requests, and some geometry-related requests. This wrapping
- allows the bulk of the protocol request processing to be handled
- transparently to the DIX layer. Some operations cannot be dealt with
- in this way and are handled with Xinerama-specific code within the
- DIX layer.
- </para>
-</listitem></varlistentry>
-
-<varlistentry>
-<term>PanoramiXConsolidate()</term>
-<listitem>
- <para>PanoramiXConsolidate() is a
- device-independent extension function that is called directly from
- the X server's main() function after extensions and input/output
- devices have been initialized, and before the root windows are
- defined and initialized.
-</para>
-
- <para>This function finds the set of depths (PanoramiXDepths&lsqb;&rsqb;) and
- visuals (PanoramiXVisuals&lsqb;&rsqb;)
- common to all of the physical screens.
- PanoramiXNumDepths is set to the number of common depths, and
- PanoramiXNumVisuals is set to the number of common visuals.
- Resources are created for the single root window and the default
- colormap. Each of these resources has per-physical screen entries.
- </para>
-</listitem></varlistentry>
-
-<varlistentry>
-<term>PanoramiXCreateConnectionBlock()</term>
-<listitem>
- <para>PanoramiXConsolidate() is a
- device-independent extension function that is called directly from
- the X server's main() function after the per-physical screen root
- windows are created. It is called instead of the standard DIX
- CreateConnectionBlock() function. If this function returns FALSE,
- the X server exits with a fatal error. This function will return
- FALSE if no common depths were found in PanoramiXConsolidate().
- With no common depths, Xinerama mode is not possible.
- </para>
-
- <para>The connection block holds the information that clients get when
- they open a connection to the X server. It includes information
- such as the supported pixmap formats, number of screens and the
- sizes, depths, visuals, default colormap information, etc, for each
- of the screens (much of information that <command>xdpyinfo</command> shows). The
- connection block is initialized with the combined single screen
- values that were calculated in the above two functions.
- </para>
-
- <para>The Xinerama extension allows the registration of connection
- block callback functions. The purpose of these is to allow other
- extensions to do processing at this point. These callbacks can be
- registered by calling XineramaRegisterConnectionBlockCallback() from
- the other extension's ExtensionInit() function. Each registered
- connection block callback is called at the end of
- PanoramiXCreateConnectionBlock().
- </para>
-</listitem></varlistentry>
-</variablelist>
-
-<sect3>
-<title>Xinerama-specific changes to the DIX code</title>
-
-<para>There are a few types of Xinerama-specific changes within the DIX
-code. The main ones are described here.
-</para>
-
-<para>Functions that deal with colormap or GC -related operations outside of
-the intercepted protocol requests have a test added to only do the
-processing for screen numbers &gt; 0. This is because they are handled for
-the single Xinerama screen and the processing is done once for screen 0.
-</para>
-
-<para>The handling of motion events does some coordinate translation between
-the physical screen's origin and screen zero's origin. Also, motion
-events must be reported relative to the composite screen origin rather
-than the physical screen origins.
-</para>
-
-<para>There is some special handling for cursor, window and event processing
-that cannot (either not at all or not conveniently) be done via the
-intercepted protocol requests. A particular case is the handling of
-pointers moving between physical screens.
-</para>
-</sect3>
-
-<sect3>
-<title>Xinerama-specific changes to the MI code</title>
-
-<para>The only Xinerama-specific change to the MI code is in miSendExposures()
-to handle the coordinate (and window ID) translation for expose events.
-</para>
-</sect3>
-
-<sect3>
-<title>Intercepted DIX core requests</title>
-
-<para>Xinerama breaks up drawing requests for dispatch to each physical
-screen. It also breaks up windows into pieces for each physical screen.
-GCs are translated into per-screen GCs. Colormaps are replicated on
-each physical screen. The functions handling the intercepted requests
-take care of breaking the requests and repackaging them so that they can
-be passed to the standard request handling functions for each screen in
-turn. In addition, and to aid the repackaging, the information from
-many of the intercepted requests is used to keep up to date the
-necessary state information for the single composite screen. Requests
-(usually those with replies) that can be satisfied completely from this
-stored state information do not call the standard request handling
-functions.
-</para>
-
-</sect3>
-
-</sect2>
-
-</sect1>
-
-<!-- ============================================================ -->
-
-<sect1>
-<title>Development Results</title>
-
-<para>In this section the results of each phase of development are
-discussed. This development took place between approximately June 2001
-and July 2003.
-</para>
-
-<sect2>
-<title>Phase I</title>
-
-<para>The initial development phase dealt with the basic implementation
-including the bootstrap code, which used the shadow framebuffer, and the
-unoptimized implementation, based on an Xnest-style implementation.
-</para>
-
-<sect3>
-<title>Scope</title>
-
-<para>The goal of Phase I is to provide fundamental functionality that can
-act as a foundation for ongoing work:
-<orderedlist>
-<listitem>
- <para>Develop the proxy X server
- <itemizedlist>
- <listitem>
- <para>The proxy X server will operate on the X11 protocol and
- relay requests as necessary to correctly perform the request.
- </para></listitem>
- <listitem>
- <para>Work will be based on the existing work for Xinerama and
- Xnest.
- </para></listitem>
- <listitem>
- <para>Input events and windowing operations are handled in the
- proxy server and rendering requests are repackaged and sent to
- each of the back-end servers for display.
- </para></listitem>
- <listitem>
- <para>The multiple screen layout (including support for
- overlapping screens) will be user configurable via a
- configuration file or through the configuration tool.
- </para></listitem>
- </itemizedlist>
- </para></listitem>
- <listitem>
- <para>Develop graphical configuration tool
- <itemizedlist>
- <listitem>
- <para>There will be potentially a large number of X servers to
- configure into a single display. The tool will allow the user
- to specify which servers are involved in the configuration and
- how they should be laid out.
- </para></listitem>
- </itemizedlist>
- </para></listitem>
- <listitem>
- <para>Pass the X Test Suite
- <itemizedlist>
- <listitem>
- <para>The X Test Suite covers the basic X11 operations. All
- tests known to succeed must correctly operate in the distributed
- X environment.
- </para></listitem>
- </itemizedlist>
- </para></listitem>
-</orderedlist>
-
-</para>
-
-<para>For this phase, the back-end X servers are assumed to be unmodified X
-servers that do not support any DMX-related protocol extensions; future
-optimization pathways are considered, but are not implemented; and the
-configuration tool is assumed to rely only on libraries in the X source
-tree (e.g., Xt).
-</para>
-</sect3>
-
-<sect3>
-<title>Results</title>
-
-<para>The proxy X server, Xdmx, was developed to distribute X11 protocol
-requests to the set of back-end X servers. It opens a window on each
-back-end server, which represents the part of the front-end's root
-window that is visible on that screen. It mirrors window, pixmap and
-other state in each back-end server. Drawing requests are sent to
-either windows or pixmaps on each back-end server. This code is based
-on Xnest and uses the existing Xinerama extension.
-</para>
-
-<para>Input events can be taken from (1) devices attached to the back-end
-server, (2) core devices attached directly to the Xdmx server, or (3)
-from a ``console'' window on another X server. Events for these devices
-are gathered, processed and delivered to clients attached to the Xdmx
-server.
-</para>
-
-<para>An intuitive configuration format was developed to help the user
-easily configure the multiple back-end X servers. It was defined (see
-grammar in Xdmx man page) and a parser was implemented that is used by
-the Xdmx server and by a standalone xdmxconfig utility. The parsing
-support was implemented such that it can be easily factored out of the X
-source tree for use with other tools (e.g., vdl). Support for
-converting legacy vdl-format configuration files to the DMX format is
-provided by the vdltodmx utility.
-</para>
-
-<para>Originally, the configuration file was going to be a subsection of
-XFree86's XF86Config file, but that was not possible since Xdmx is a
-completely separate X server. Thus, a separate config file format was
-developed. In addition, a graphical configuration
-tool, xdmxconfig, was developed to allow the user to create and arrange
-the screens in the configuration file. The <emphasis remap="bf">-configfile</emphasis> and <emphasis remap="bf">-config</emphasis>
-command-line options can be used to start Xdmx using a configuration
-file.
-</para>
-
-<para>An extension that enables remote input testing is required for the X
-Test Suite to function. During this phase, this extension (XTEST) was
-implemented in the Xdmx server. The results from running the X Test
-Suite are described in detail below.
-</para>
-</sect3>
-
-<sect3>
-<title>X Test Suite</title>
-
- <sect4>
- <title>Introduction</title>
- <para>
- The X Test Suite contains tests that verify Xlib functions
- operate correctly. The test suite is designed to run on a
- single X server; however, since X applications will not be
- able to tell the difference between the DMX server and a
- standard X server, the X Test Suite should also run on the
- DMX server.
- </para>
- <para>
- The Xdmx server was tested with the X Test Suite, and the
- existing failures are noted in this section. To put these
- results in perspective, we first discuss expected X Test
- failures and how errors in underlying systems can impact
- Xdmx test results.
- </para>
- </sect4>
-
- <sect4>
- <title>Expected Failures for a Single Head</title>
- <para>
- A correctly implemented X server with a single screen is
- expected to fail certain X Test tests. The following
- well-known errors occur because of rounding error in the X
- server code:
- <literallayout>
-XDrawArc: Tests 42, 63, 66, 73
-XDrawArcs: Tests 45, 66, 69, 76
- </literallayout>
- </para>
- <para>
- The following failures occur because of the high-level X
- server implementation:
- <literallayout>
-XLoadQueryFont: Test 1
-XListFontsWithInfo: Tests 3, 4
-XQueryFont: Tests 1, 2
- </literallayout>
- </para>
- <para>
- The following test fails when running the X server as root
- under Linux because of the way directory modes are
- interpreted:
- <literallayout>
-XWriteBitmapFile: Test 3
- </literallayout>
- </para>
- <para>
- Depending on the video card used for the back-end, other
- failures may also occur because of bugs in the low-level
- driver implementation. Over time, failures of this kind
- are usually fixed by XFree86, but will show up in Xdmx
- testing until then.
- </para>
- </sect4>
-
- <sect4>
- <title>Expected Failures for Xinerama</title>
- <para>
- Xinerama fails several X Test Suite tests because of
- design decisions made for the current implementation of
- Xinerama. Over time, many of these errors will be
- corrected by XFree86 and the group working on a new
- Xinerama implementation. Therefore, Xdmx will also share
- X Suite Test failures with Xinerama.
- </para>
-
- <para>
- We may be able to fix or work-around some of these
- failures at the Xdmx level, but this will require
- additional exploration that was not part of Phase I.
- </para>
-
- <para>
- Xinerama is constantly improving, and the list of
- Xinerama-related failures depends on XFree86 version and
- the underlying graphics hardware. We tested with a
- variety of hardware, including nVidia, S3, ATI Radeon,
- and Matrox G400 (in dual-head mode). The list below
- includes only those failures that appear to be from the
- Xinerama layer, and does not include failures listed in
- the previous section, or failures that appear to be from
- the low-level graphics driver itself:
- </para>
-
- <para>
- These failures were noted with multiple Xinerama
- configurations:
- <literallayout>
-XCopyPlane: Tests 13, 22, 31 (well-known Xinerama implementation issue)
-XSetFontPath: Test 4
-XGetDefault: Test 5
-XMatchVisualInfo: Test 1
- </literallayout>
- </para>
- <para>
- These failures were noted only when using one dual-head
- video card with a 4.2.99.x XFree86 server:
- <literallayout>
-XListPixmapFormats: Test 1
-XDrawRectangles: Test 45
- </literallayout>
- </para>
- <para>
- These failures were noted only when using two video cards
- from different vendors with a 4.1.99.x XFree86 server:
- <literallayout>
-XChangeWindowAttributes: Test 32
-XCreateWindow: Test 30
-XDrawLine: Test 22
-XFillArc: Test 22
-XChangeKeyboardControl: Tests 9, 10
-XRebindKeysym: Test 1
- </literallayout>
- </para>
- </sect4>
-
- <sect4>
- <title>Additional Failures from Xdmx</title>
-
- <para>
- When running Xdmx, no unexpected failures were noted.
- Since the Xdmx server is based on Xinerama, we expect to
- have most of the Xinerama failures present in the Xdmx
- server. Similarly, since the Xdmx server must rely on the
- low-level device drivers on each back-end server, we also
- expect that Xdmx will exhibit most of the back-end
- failures. Here is a summary:
- <literallayout>
-XListPixmapFormats: Test 1 (configuration dependent)
-XChangeWindowAttributes: Test 32
-XCreateWindow: Test 30
-XCopyPlane: Test 13, 22, 31
-XSetFontPath: Test 4
-XGetDefault: Test 5 (configuration dependent)
-XMatchVisualInfo: Test 1
-XRebindKeysym: Test 1 (configuration dependent)
- </literallayout>
- </para>
- <para>
- Note that this list is shorter than the combined list for
- Xinerama because Xdmx uses different code paths to perform
- some Xinerama operations. Further, some Xinerama failures
- have been fixed in the XFree86 4.2.99.x CVS repository.
- </para>
- </sect4>
-
- <sect4>
- <title>Summary and Future Work</title>
-
- <para>
- Running the X Test Suite on Xdmx does not produce any
- failures that cannot be accounted for by the underlying
- Xinerama subsystem used by the front-end or by the
- low-level device-driver code running on the back-end X
- servers. The Xdmx server therefore is as ``correct'' as
- possible with respect to the standard set of X Test Suite
- tests.
- </para>
-
- <para>
- During the following phases, we will continue to verify
- Xdmx correctness using the X Test Suite. We may also use
- other tests suites or write additional tests that run
- under the X Test Suite that specifically verify the
- expected behavior of DMX.
- </para>
- </sect4>
-</sect3>
-
-<sect3>
-<title>Fonts</title>
-
-<para>In Phase I, fonts are handled directly by both the front-end and the
-back-end servers, which is required since we must treat each back-end
-server during this phase as a ``black box''. What this requires is that
-<emphasis remap="bf">the front- and back-end servers must share the exact same font
-path</emphasis>. There are two ways to help make sure that all servers share the
-same font path:
-
-<orderedlist>
- <listitem>
- <para>First, each server can be configured to use the same font
- server. The font server, xfs, can be configured to serve fonts to
- multiple X servers via TCP.
- </para></listitem>
-
- <listitem>
- <para>Second, each server can be configured to use the same font
- path and either those font paths can be copied to each back-end
- machine or they can be mounted (e.g., via NFS) on each back-end
- machine.
- </para></listitem>
-</orderedlist>
-</para>
-
-<para>One additional concern is that a client program can set its own font
-path, and if it does so, then that font path must be available on each
-back-end machine.
-</para>
-
-<para>The -fontpath command line option was added to allow users to
-initialize the font path of the front end server. This font path is
-propagated to each back-end server when the default font is loaded. If
-there are any problems, an error message is printed, which will describe
-the problem and list the current font path. For more information about
-setting the font path, see the -fontpath option description in the man
-page.
-</para>
-</sect3>
-
-<sect3>
-<title>Performance</title>
-
-<para>Phase I of development was not intended to optimize performance. Its
-focus was on completely and correctly handling the base X11 protocol in
-the Xdmx server. However, several insights were gained during Phase I,
-which are listed here for reference during the next phase of
-development.
-</para>
-
-<orderedlist>
- <listitem>
- <para>Calls to XSync() can slow down rendering since it requires a
- complete round trip to and from a back-end server. This is
- especially problematic when communicating over long haul networks.
- </para></listitem>
-
- <listitem>
- <para>Sending drawing requests to only the screens that they overlap
- should improve performance.
- </para></listitem>
-</orderedlist>
-</sect3>
-
-<sect3>
-<title>Pixmaps</title>
-
-<para>Pixmaps were originally expected to be handled entirely in the
-front-end X server; however, it was found that this overly complicated
-the rendering code and would have required sending potentially large
-images to each back server that required them when copying from pixmap
-to screen. Thus, pixmap state is mirrored in the back-end server just
-as it is with regular window state. With this implementation, the same
-rendering code that draws to windows can be used to draw to pixmaps on
-the back-end server, and no large image transfers are required to copy
-from pixmap to window.
-</para>
-
-</sect3>
-
-</sect2>
-
-<!-- ============================================================ -->
-<sect2>
-<title>Phase II</title>
-
-<para>The second phase of development concentrates on performance
-optimizations. These optimizations are documented here, with
-<command>x11perf</command> data to show how the optimizations improve performance.
-</para>
-
-<para>All benchmarks were performed by running Xdmx on a dual processor
-1.4GHz AMD Athlon machine with 1GB of RAM connecting over 100baseT to
-two single-processor 1GHz Pentium III machines with 256MB of RAM and ATI
-Rage 128 (RF) video cards. The front end was running Linux
-2.4.20-pre1-ac1 and the back ends were running Linux 2.4.7-10 and
-version 4.2.99.1 of XFree86 pulled from the XFree86 CVS repository on
-August 7, 2002. All systems were running Red Hat Linux 7.2.
-</para>
-
-<sect3>
-<title>Moving from XFree86 4.1.99.1 to 4.2.0.0</title>
-
-<para>For phase II, the working source tree was moved to the branch tagged
-with dmx-1-0-branch and was updated from version 4.1.99.1 (20 August
-2001) of the XFree86 sources to version 4.2.0.0 (18 January 2002).
-After this update, the following tests were noted to be more than 10%
-faster:
-<screen>
-1.13 Fill 300x300 opaque stippled trapezoid (161x145 stipple)
-1.16 Fill 1x1 tiled trapezoid (161x145 tile)
-1.13 Fill 10x10 tiled trapezoid (161x145 tile)
-1.17 Fill 100x100 tiled trapezoid (161x145 tile)
-1.16 Fill 1x1 tiled trapezoid (216x208 tile)
-1.20 Fill 10x10 tiled trapezoid (216x208 tile)
-1.15 Fill 100x100 tiled trapezoid (216x208 tile)
-1.37 Circulate Unmapped window (200 kids)
-</screen>
-And the following tests were noted to be more than 10% slower:
-<screen>
-0.88 Unmap window via parent (25 kids)
-0.75 Circulate Unmapped window (4 kids)
-0.79 Circulate Unmapped window (16 kids)
-0.80 Circulate Unmapped window (25 kids)
-0.82 Circulate Unmapped window (50 kids)
-0.85 Circulate Unmapped window (75 kids)
-</screen>
-</para>
-
-<para>These changes were not caused by any changes in the DMX system, and
-may point to changes in the XFree86 tree or to tests that have more
-"jitter" than most other <command>x11perf</command> tests.
-</para>
-</sect3>
-
-<sect3>
-<title>Global changes</title>
-
-<para>During the development of the Phase II DMX server, several global
-changes were made. These changes were also compared with the Phase I
-server. The following tests were noted to be more than 10% faster:
-<screen>
-1.13 Fill 300x300 opaque stippled trapezoid (161x145 stipple)
-1.15 Fill 1x1 tiled trapezoid (161x145 tile)
-1.13 Fill 10x10 tiled trapezoid (161x145 tile)
-1.17 Fill 100x100 tiled trapezoid (161x145 tile)
-1.16 Fill 1x1 tiled trapezoid (216x208 tile)
-1.19 Fill 10x10 tiled trapezoid (216x208 tile)
-1.15 Fill 100x100 tiled trapezoid (216x208 tile)
-1.15 Circulate Unmapped window (4 kids)
-</screen>
-</para>
-
-<para>The following tests were noted to be more than 10% slower:
-<screen>
-0.69 Scroll 10x10 pixels
-0.68 Scroll 100x100 pixels
-0.68 Copy 10x10 from window to window
-0.68 Copy 100x100 from window to window
-0.76 Circulate Unmapped window (75 kids)
-0.83 Circulate Unmapped window (100 kids)
-</screen>
-</para>
-
-<para>For the remainder of this analysis, the baseline of comparison will
-be the Phase II deliverable with all optimizations disabled (unless
-otherwise noted). This will highlight how the optimizations in
-isolation impact performance.
-</para>
-</sect3>
-
-<sect3>
-<title>XSync() Batching</title>
-
-<para>During the Phase I implementation, XSync() was called after every
-protocol request made by the DMX server. This provided the DMX server
-with an interactive feel, but defeated X11's protocol buffering system
-and introduced round-trip wire latency into every operation. During
-Phase II, DMX was changed so that protocol requests are no longer
-followed by calls to XSync(). Instead, the need for an XSync() is
-noted, and XSync() calls are only made every 100mS or when the DMX
-server specifically needs to make a call to guarantee interactivity.
-With this new system, X11 buffers protocol as much as possible during a
-100mS interval, and many unnecessary XSync() calls are avoided.
-</para>
-
-<para>Out of more than 300 <command>x11perf</command> tests, 8 tests became more than 100
-times faster, with 68 more than 50X faster, 114 more than 10X faster,
-and 181 more than 2X faster. See table below for summary.
-</para>
-
-<para>The following tests were noted to be more than 10% slower with
-XSync() batching on:
-<screen>
-0.88 500x500 tiled rectangle (161x145 tile)
-0.89 Copy 500x500 from window to window
-</screen>
-</para>
-</sect3>
-
-<sect3>
-<title>Offscreen Optimization</title>
-
-<para>Windows span one or more of the back-end servers' screens; however,
-during Phase I development, windows were created on every back-end
-server and every rendering request was sent to every window regardless
-of whether or not that window was visible. With the offscreen
-optimization, the DMX server tracks when a window is completely off of a
-back-end server's screen and, in that case, it does not send rendering
-requests to those back-end windows. This optimization saves bandwidth
-between the front and back-end servers, and it reduces the number of
-XSync() calls. The performance tests were run on a DMX system with only
-two back-end servers. Greater performance gains will be had as the
-number of back-end servers increases.
-</para>
-
-<para>Out of more than 300 <command>x11perf</command> tests, 3 tests were at least twice as
-fast, and 146 tests were at least 10% faster. Two tests were more than
-10% slower with the offscreen optimization:
-<screen>
-0.88 Hide/expose window via popup (4 kids)
-0.89 Resize unmapped window (75 kids)
-</screen>
-</para>
-</sect3>
-
-<sect3>
-<title>Lazy Window Creation Optimization</title>
-
-<para>As mentioned above, during Phase I, windows were created on every
-back-end server even if they were not visible on that back-end. With
-the lazy window creation optimization, the DMX server does not create
-windows on a back-end server until they are either visible or they
-become the parents of a visible window. This optimization builds on the
-offscreen optimization (described above) and requires it to be enabled.
-</para>
-
-<para>The lazy window creation optimization works by creating the window
-data structures in the front-end server when a client creates a window,
-but delays creation of the window on the back-end server(s). A private
-window structure in the DMX server saves the relevant window data and
-tracks changes to the window's attributes and stacking order for later
-use. The only times a window is created on a back-end server are (1)
-when it is mapped and is at least partially overlapping the back-end
-server's screen (tracked by the offscreen optimization), or (2) when the
-window becomes the parent of a previously visible window. The first
-case occurs when a window is mapped or when a visible window is copied,
-moved or resized and now overlaps the back-end server's screen. The
-second case occurs when starting a window manager after having created
-windows to which the window manager needs to add decorations.
-</para>
-
-<para>When either case occurs, a window on the back-end server is created
-using the data saved in the DMX server's window private data structure.
-The stacking order is then adjusted to correctly place the window on the
-back-end and lastly the window is mapped. From this time forward, the
-window is handled exactly as if the window had been created at the time
-of the client's request.
-</para>
-
-<para>Note that when a window is no longer visible on a back-end server's
-screen (e.g., it is moved offscreen), the window is not destroyed;
-rather, it is kept and reused later if the window once again becomes
-visible on the back-end server's screen. Originally with this
-optimization, destroying windows was implemented but was later rejected
-because it increased bandwidth when windows were opaquely moved or
-resized, which is common in many window managers.
-</para>
-
-<para>The performance tests were run on a DMX system with only two back-end
-servers. Greater performance gains will be had as the number of
-back-end servers increases.
-</para>
-
-<para>This optimization improved the following <command>x11perf</command> tests by more
-than 10%:
-<screen>
-1.10 500x500 rectangle outline
-1.12 Fill 100x100 stippled trapezoid (161x145 stipple)
-1.20 Circulate Unmapped window (50 kids)
-1.19 Circulate Unmapped window (75 kids)
-</screen>
-</para>
-</sect3>
-
-<sect3>
-<title>Subdividing Rendering Primitives</title>
-
-<para>X11 imaging requests transfer significant data between the client and
-the X server. During Phase I, the DMX server would then transfer the
-image data to each back-end server. Even with the offscreen
-optimization (above), these requests still required transferring
-significant data to each back-end server that contained a visible
-portion of the window. For example, if the client uses XPutImage() to
-copy an image to a window that overlaps the entire DMX screen, then the
-entire image is copied by the DMX server to every back-end server.
-</para>
-
-<para>To reduce the amount of data transferred between the DMX server and
-the back-end servers when XPutImage() is called, the image data is
-subdivided and only the data that will be visible on a back-end server's
-screen is sent to that back-end server. Xinerama already implements a
-subdivision algorithm for XGetImage() and no further optimization was
-needed.
-</para>
-
-<para>Other rendering primitives were analyzed, but the time required to
-subdivide these primitives was a significant proportion of the time
-required to send the entire rendering request to the back-end server, so
-this optimization was rejected for the other rendering primitives.
-</para>
-
-<para>Again, the performance tests were run on a DMX system with only two
-back-end servers. Greater performance gains will be had as the number
-of back-end servers increases.
-</para>
-
-<para>This optimization improved the following <command>x11perf</command> tests by more
-than 10%:
-<screen>
-1.12 Fill 100x100 stippled trapezoid (161x145 stipple)
-1.26 PutImage 10x10 square
-1.83 PutImage 100x100 square
-1.91 PutImage 500x500 square
-1.40 PutImage XY 10x10 square
-1.48 PutImage XY 100x100 square
-1.50 PutImage XY 500x500 square
-1.45 Circulate Unmapped window (75 kids)
-1.74 Circulate Unmapped window (100 kids)
-</screen>
-</para>
-
-<para>The following test was noted to be more than 10% slower with this
-optimization:
-<screen>
-0.88 10-pixel fill chord partial circle
-</screen>
-</para>
-</sect3>
-
-<sect3>
-<title>Summary of x11perf Data</title>
-
-<para>With all of the optimizations on, 53 <command>x11perf</command> tests are more than
-100X faster than the unoptimized Phase II deliverable, with 69 more than
-50X faster, 73 more than 10X faster, and 199 more than twice as fast.
-No tests were more than 10% slower than the unoptimized Phase II
-deliverable. (Compared with the Phase I deliverable, only Circulate
-Unmapped window (100 kids) was more than 10% slower than the Phase II
-deliverable. As noted above, this test seems to have wider variability
-than other <command>x11perf</command> tests.)
-</para>
-
-<para>The following table summarizes relative <command>x11perf</command> test changes for
-all optimizations individually and collectively. Note that some of the
-optimizations have a synergistic effect when used together.
-<screen>
-
-1: XSync() batching only
-2: Off screen optimizations only
-3: Window optimizations only
-4: Subdivprims only
-5: All optimizations
-
- 1 2 3 4 5 Operation
------- ---- ---- ---- ------ ---------
- 2.14 1.85 1.00 1.00 4.13 Dot
- 1.67 1.80 1.00 1.00 3.31 1x1 rectangle
- 2.38 1.43 1.00 1.00 2.44 10x10 rectangle
- 1.00 1.00 0.92 0.98 1.00 100x100 rectangle
- 1.00 1.00 1.00 1.00 1.00 500x500 rectangle
- 1.83 1.85 1.05 1.06 3.54 1x1 stippled rectangle (8x8 stipple)
- 2.43 1.43 1.00 1.00 2.41 10x10 stippled rectangle (8x8 stipple)
- 0.98 1.00 1.00 1.00 1.00 100x100 stippled rectangle (8x8 stipple)
- 1.00 1.00 1.00 1.00 0.98 500x500 stippled rectangle (8x8 stipple)
- 1.75 1.75 1.00 1.00 3.40 1x1 opaque stippled rectangle (8x8 stipple)
- 2.38 1.42 1.00 1.00 2.34 10x10 opaque stippled rectangle (8x8 stipple)
- 1.00 1.00 0.97 0.97 1.00 100x100 opaque stippled rectangle (8x8 stipple)
- 1.00 1.00 1.00 1.00 0.99 500x500 opaque stippled rectangle (8x8 stipple)
- 1.82 1.82 1.04 1.04 3.56 1x1 tiled rectangle (4x4 tile)
- 2.33 1.42 1.00 1.00 2.37 10x10 tiled rectangle (4x4 tile)
- 1.00 0.92 1.00 1.00 1.00 100x100 tiled rectangle (4x4 tile)
- 1.00 1.00 1.00 1.00 1.00 500x500 tiled rectangle (4x4 tile)
- 1.94 1.62 1.00 1.00 3.66 1x1 stippled rectangle (17x15 stipple)
- 1.74 1.28 1.00 1.00 1.73 10x10 stippled rectangle (17x15 stipple)
- 1.00 1.00 1.00 0.89 0.98 100x100 stippled rectangle (17x15 stipple)
- 1.00 1.00 1.00 1.00 0.98 500x500 stippled rectangle (17x15 stipple)
- 1.94 1.62 1.00 1.00 3.67 1x1 opaque stippled rectangle (17x15 stipple)
- 1.69 1.26 1.00 1.00 1.66 10x10 opaque stippled rectangle (17x15 stipple)
- 1.00 0.95 1.00 1.00 1.00 100x100 opaque stippled rectangle (17x15 stipple)
- 1.00 1.00 1.00 1.00 0.97 500x500 opaque stippled rectangle (17x15 stipple)
- 1.93 1.61 0.99 0.99 3.69 1x1 tiled rectangle (17x15 tile)
- 1.73 1.27 1.00 1.00 1.72 10x10 tiled rectangle (17x15 tile)
- 1.00 1.00 1.00 1.00 0.98 100x100 tiled rectangle (17x15 tile)
- 1.00 1.00 0.97 0.97 1.00 500x500 tiled rectangle (17x15 tile)
- 1.95 1.63 1.00 1.00 3.83 1x1 stippled rectangle (161x145 stipple)
- 1.80 1.30 1.00 1.00 1.83 10x10 stippled rectangle (161x145 stipple)
- 0.97 1.00 1.00 1.00 1.01 100x100 stippled rectangle (161x145 stipple)
- 1.00 1.00 1.00 1.00 0.98 500x500 stippled rectangle (161x145 stipple)
- 1.95 1.63 1.00 1.00 3.56 1x1 opaque stippled rectangle (161x145 stipple)
- 1.65 1.25 1.00 1.00 1.68 10x10 opaque stippled rectangle (161x145 stipple)
- 1.00 1.00 1.00 1.00 1.01 100x100 opaque stippled rectangle (161x145...
- 1.00 1.00 1.00 1.00 0.97 500x500 opaque stippled rectangle (161x145...
- 1.95 1.63 0.98 0.99 3.80 1x1 tiled rectangle (161x145 tile)
- 1.67 1.26 1.00 1.00 1.67 10x10 tiled rectangle (161x145 tile)
- 1.13 1.14 1.14 1.14 1.14 100x100 tiled rectangle (161x145 tile)
- 0.88 1.00 1.00 1.00 0.99 500x500 tiled rectangle (161x145 tile)
- 1.93 1.63 1.00 1.00 3.53 1x1 tiled rectangle (216x208 tile)
- 1.69 1.26 1.00 1.00 1.66 10x10 tiled rectangle (216x208 tile)
- 1.00 1.00 1.00 1.00 1.00 100x100 tiled rectangle (216x208 tile)
- 1.00 1.00 1.00 1.00 1.00 500x500 tiled rectangle (216x208 tile)
- 1.82 1.70 1.00 1.00 3.38 1-pixel line segment
- 2.07 1.56 0.90 1.00 3.31 10-pixel line segment
- 1.29 1.10 1.00 1.00 1.27 100-pixel line segment
- 1.05 1.06 1.03 1.03 1.09 500-pixel line segment
- 1.30 1.13 1.00 1.00 1.29 100-pixel line segment (1 kid)
- 1.32 1.15 1.00 1.00 1.32 100-pixel line segment (2 kids)
- 1.33 1.16 1.00 1.00 1.33 100-pixel line segment (3 kids)
- 1.92 1.64 1.00 1.00 3.73 10-pixel dashed segment
- 1.34 1.16 1.00 1.00 1.34 100-pixel dashed segment
- 1.24 1.11 0.99 0.97 1.23 100-pixel double-dashed segment
- 1.72 1.77 1.00 1.00 3.25 10-pixel horizontal line segment
- 1.83 1.66 1.01 1.00 3.54 100-pixel horizontal line segment
- 1.86 1.30 1.00 1.00 1.84 500-pixel horizontal line segment
- 2.11 1.52 1.00 0.99 3.02 10-pixel vertical line segment
- 1.21 1.10 1.00 1.00 1.20 100-pixel vertical line segment
- 1.03 1.03 1.00 1.00 1.02 500-pixel vertical line segment
- 4.42 1.68 1.00 1.01 4.64 10x1 wide horizontal line segment
- 1.83 1.31 1.00 1.00 1.83 100x10 wide horizontal line segment
- 1.07 1.00 0.96 1.00 1.07 500x50 wide horizontal line segment
- 4.10 1.67 1.00 1.00 4.62 10x1 wide vertical line segment
- 1.50 1.24 1.06 1.06 1.48 100x10 wide vertical line segment
- 1.06 1.03 1.00 1.00 1.05 500x50 wide vertical line segment
- 2.54 1.61 1.00 1.00 3.61 1-pixel line
- 2.71 1.48 1.00 1.00 2.67 10-pixel line
- 1.19 1.09 1.00 1.00 1.19 100-pixel line
- 1.04 1.02 1.00 1.00 1.03 500-pixel line
- 2.68 1.51 0.98 1.00 3.17 10-pixel dashed line
- 1.23 1.11 0.99 0.99 1.23 100-pixel dashed line
- 1.15 1.08 1.00 1.00 1.15 100-pixel double-dashed line
- 2.27 1.39 1.00 1.00 2.23 10x1 wide line
- 1.20 1.09 1.00 1.00 1.20 100x10 wide line
- 1.04 1.02 1.00 1.00 1.04 500x50 wide line
- 1.52 1.45 1.00 1.00 1.52 100x10 wide dashed line
- 1.54 1.47 1.00 1.00 1.54 100x10 wide double-dashed line
- 1.97 1.30 0.96 0.95 1.95 10x10 rectangle outline
- 1.44 1.27 1.00 1.00 1.43 100x100 rectangle outline
- 3.22 2.16 1.10 1.09 3.61 500x500 rectangle outline
- 1.95 1.34 1.00 1.00 1.90 10x10 wide rectangle outline
- 1.14 1.14 1.00 1.00 1.13 100x100 wide rectangle outline
- 1.00 1.00 1.00 1.00 1.00 500x500 wide rectangle outline
- 1.57 1.72 1.00 1.00 3.03 1-pixel circle
- 1.96 1.35 1.00 1.00 1.92 10-pixel circle
- 1.21 1.07 0.86 0.97 1.20 100-pixel circle
- 1.08 1.04 1.00 1.00 1.08 500-pixel circle
- 1.39 1.19 1.03 1.03 1.38 100-pixel dashed circle
- 1.21 1.11 1.00 1.00 1.23 100-pixel double-dashed circle
- 1.59 1.28 1.00 1.00 1.58 10-pixel wide circle
- 1.22 1.12 0.99 1.00 1.22 100-pixel wide circle
- 1.06 1.04 1.00 1.00 1.05 500-pixel wide circle
- 1.87 1.84 1.00 1.00 1.85 100-pixel wide dashed circle
- 1.90 1.93 1.01 1.01 1.90 100-pixel wide double-dashed circle
- 2.13 1.43 1.00 1.00 2.32 10-pixel partial circle
- 1.42 1.18 1.00 1.00 1.42 100-pixel partial circle
- 1.92 1.85 1.01 1.01 1.89 10-pixel wide partial circle
- 1.73 1.67 1.00 1.00 1.73 100-pixel wide partial circle
- 1.36 1.95 1.00 1.00 2.64 1-pixel solid circle
- 2.02 1.37 1.00 1.00 2.03 10-pixel solid circle
- 1.19 1.09 1.00 1.00 1.19 100-pixel solid circle
- 1.02 0.99 1.00 1.00 1.01 500-pixel solid circle
- 1.74 1.28 1.00 0.88 1.73 10-pixel fill chord partial circle
- 1.31 1.13 1.00 1.00 1.31 100-pixel fill chord partial circle
- 1.67 1.31 1.03 1.03 1.72 10-pixel fill slice partial circle
- 1.30 1.13 1.00 1.00 1.28 100-pixel fill slice partial circle
- 2.45 1.49 1.01 1.00 2.71 10-pixel ellipse
- 1.22 1.10 1.00 1.00 1.22 100-pixel ellipse
- 1.09 1.04 1.00 1.00 1.09 500-pixel ellipse
- 1.90 1.28 1.00 1.00 1.89 100-pixel dashed ellipse
- 1.62 1.24 0.96 0.97 1.61 100-pixel double-dashed ellipse
- 2.43 1.50 1.00 1.00 2.42 10-pixel wide ellipse
- 1.61 1.28 1.03 1.03 1.60 100-pixel wide ellipse
- 1.08 1.05 1.00 1.00 1.08 500-pixel wide ellipse
- 1.93 1.88 1.00 1.00 1.88 100-pixel wide dashed ellipse
- 1.94 1.89 1.01 1.00 1.94 100-pixel wide double-dashed ellipse
- 2.31 1.48 1.00 1.00 2.67 10-pixel partial ellipse
- 1.38 1.17 1.00 1.00 1.38 100-pixel partial ellipse
- 2.00 1.85 0.98 0.97 1.98 10-pixel wide partial ellipse
- 1.89 1.86 1.00 1.00 1.89 100-pixel wide partial ellipse
- 3.49 1.60 1.00 1.00 3.65 10-pixel filled ellipse
- 1.67 1.26 1.00 1.00 1.67 100-pixel filled ellipse
- 1.06 1.04 1.00 1.00 1.06 500-pixel filled ellipse
- 2.38 1.43 1.01 1.00 2.32 10-pixel fill chord partial ellipse
- 2.06 1.30 1.00 1.00 2.05 100-pixel fill chord partial ellipse
- 2.27 1.41 1.00 1.00 2.27 10-pixel fill slice partial ellipse
- 1.98 1.33 1.00 0.97 1.97 100-pixel fill slice partial ellipse
- 57.46 1.99 1.01 1.00 114.92 Fill 1x1 equivalent triangle
- 56.94 1.98 1.01 1.00 73.89 Fill 10x10 equivalent triangle
- 6.07 1.75 1.00 1.00 6.07 Fill 100x100 equivalent triangle
- 51.12 1.98 1.00 1.00 102.81 Fill 1x1 trapezoid
- 51.42 1.82 1.01 1.00 94.89 Fill 10x10 trapezoid
- 6.47 1.80 1.00 1.00 6.44 Fill 100x100 trapezoid
- 1.56 1.28 1.00 0.99 1.56 Fill 300x300 trapezoid
- 51.27 1.97 0.96 0.97 102.54 Fill 1x1 stippled trapezoid (8x8 stipple)
- 51.73 2.00 1.02 1.02 67.92 Fill 10x10 stippled trapezoid (8x8 stipple)
- 5.36 1.72 1.00 1.00 5.36 Fill 100x100 stippled trapezoid (8x8 stipple)
- 1.54 1.26 1.00 1.00 1.59 Fill 300x300 stippled trapezoid (8x8 stipple)
- 51.41 1.94 1.01 1.00 102.82 Fill 1x1 opaque stippled trapezoid (8x8 stipple)
- 50.71 1.95 0.99 1.00 65.44 Fill 10x10 opaque stippled trapezoid (8x8...
- 5.33 1.73 1.00 1.00 5.36 Fill 100x100 opaque stippled trapezoid (8x8...
- 1.58 1.25 1.00 1.00 1.58 Fill 300x300 opaque stippled trapezoid (8x8...
- 51.56 1.96 0.99 0.90 103.68 Fill 1x1 tiled trapezoid (4x4 tile)
- 51.59 1.99 1.01 1.01 62.25 Fill 10x10 tiled trapezoid (4x4 tile)
- 5.38 1.72 1.00 1.00 5.38 Fill 100x100 tiled trapezoid (4x4 tile)
- 1.54 1.25 1.00 0.99 1.58 Fill 300x300 tiled trapezoid (4x4 tile)
- 51.70 1.98 1.01 1.01 103.98 Fill 1x1 stippled trapezoid (17x15 stipple)
- 44.86 1.97 1.00 1.00 44.86 Fill 10x10 stippled trapezoid (17x15 stipple)
- 2.74 1.56 1.00 1.00 2.73 Fill 100x100 stippled trapezoid (17x15 stipple)
- 1.29 1.14 1.00 1.00 1.27 Fill 300x300 stippled trapezoid (17x15 stipple)
- 51.41 1.96 0.96 0.95 103.39 Fill 1x1 opaque stippled trapezoid (17x15...
- 45.14 1.96 1.01 1.00 45.14 Fill 10x10 opaque stippled trapezoid (17x15...
- 2.68 1.56 1.00 1.00 2.68 Fill 100x100 opaque stippled trapezoid (17x15...
- 1.26 1.10 1.00 1.00 1.28 Fill 300x300 opaque stippled trapezoid (17x15...
- 51.13 1.97 1.00 0.99 103.39 Fill 1x1 tiled trapezoid (17x15 tile)
- 47.58 1.96 1.00 1.00 47.86 Fill 10x10 tiled trapezoid (17x15 tile)
- 2.74 1.56 1.00 1.00 2.74 Fill 100x100 tiled trapezoid (17x15 tile)
- 1.29 1.14 1.00 1.00 1.28 Fill 300x300 tiled trapezoid (17x15 tile)
- 51.13 1.97 0.99 0.97 103.39 Fill 1x1 stippled trapezoid (161x145 stipple)
- 45.14 1.97 1.00 1.00 44.29 Fill 10x10 stippled trapezoid (161x145 stipple)
- 3.02 1.77 1.12 1.12 3.38 Fill 100x100 stippled trapezoid (161x145 stipple)
- 1.31 1.13 1.00 1.00 1.30 Fill 300x300 stippled trapezoid (161x145 stipple)
- 51.27 1.97 1.00 1.00 103.10 Fill 1x1 opaque stippled trapezoid (161x145...
- 45.01 1.97 1.00 1.00 45.01 Fill 10x10 opaque stippled trapezoid (161x145...
- 2.67 1.56 1.00 1.00 2.69 Fill 100x100 opaque stippled trapezoid (161x145..
- 1.29 1.13 1.00 1.01 1.27 Fill 300x300 opaque stippled trapezoid (161x145..
- 51.41 1.96 1.00 0.99 103.39 Fill 1x1 tiled trapezoid (161x145 tile)
- 45.01 1.96 0.98 1.00 45.01 Fill 10x10 tiled trapezoid (161x145 tile)
- 2.62 1.36 1.00 1.00 2.69 Fill 100x100 tiled trapezoid (161x145 tile)
- 1.27 1.13 1.00 1.00 1.22 Fill 300x300 tiled trapezoid (161x145 tile)
- 51.13 1.98 1.00 1.00 103.39 Fill 1x1 tiled trapezoid (216x208 tile)
- 45.14 1.97 1.01 0.99 45.14 Fill 10x10 tiled trapezoid (216x208 tile)
- 2.62 1.55 1.00 1.00 2.71 Fill 100x100 tiled trapezoid (216x208 tile)
- 1.28 1.13 1.00 1.00 1.20 Fill 300x300 tiled trapezoid (216x208 tile)
- 50.71 1.95 1.00 1.00 54.70 Fill 10x10 equivalent complex polygon
- 5.51 1.71 0.96 0.98 5.47 Fill 100x100 equivalent complex polygons
- 8.39 1.97 1.00 1.00 16.75 Fill 10x10 64-gon (Convex)
- 8.38 1.83 1.00 1.00 8.43 Fill 100x100 64-gon (Convex)
- 8.50 1.96 1.00 1.00 16.64 Fill 10x10 64-gon (Complex)
- 8.26 1.83 1.00 1.00 8.35 Fill 100x100 64-gon (Complex)
- 14.09 1.87 1.00 1.00 14.05 Char in 80-char line (6x13)
- 11.91 1.87 1.00 1.00 11.95 Char in 70-char line (8x13)
- 11.16 1.85 1.01 1.00 11.10 Char in 60-char line (9x15)
- 10.09 1.78 1.00 1.00 10.09 Char16 in 40-char line (k14)
- 6.15 1.75 1.00 1.00 6.31 Char16 in 23-char line (k24)
- 11.92 1.90 1.03 1.03 11.88 Char in 80-char line (TR 10)
- 8.18 1.78 1.00 0.99 8.17 Char in 30-char line (TR 24)
- 42.83 1.44 1.01 1.00 42.11 Char in 20/40/20 line (6x13, TR 10)
- 27.45 1.43 1.01 1.01 27.45 Char16 in 7/14/7 line (k14, k24)
- 12.13 1.85 1.00 1.00 12.05 Char in 80-char image line (6x13)
- 10.00 1.84 1.00 1.00 10.00 Char in 70-char image line (8x13)
- 9.18 1.83 1.00 1.00 9.12 Char in 60-char image line (9x15)
- 9.66 1.82 0.98 0.95 9.66 Char16 in 40-char image line (k14)
- 5.82 1.72 1.00 1.00 5.99 Char16 in 23-char image line (k24)
- 8.70 1.80 1.00 1.00 8.65 Char in 80-char image line (TR 10)
- 4.67 1.66 1.00 1.00 4.67 Char in 30-char image line (TR 24)
- 84.43 1.47 1.00 1.00 124.18 Scroll 10x10 pixels
- 3.73 1.50 1.00 0.98 3.73 Scroll 100x100 pixels
- 1.00 1.00 1.00 1.00 1.00 Scroll 500x500 pixels
- 84.43 1.51 1.00 1.00 134.02 Copy 10x10 from window to window
- 3.62 1.51 0.98 0.98 3.62 Copy 100x100 from window to window
- 0.89 1.00 1.00 1.00 1.00 Copy 500x500 from window to window
- 57.06 1.99 1.00 1.00 88.64 Copy 10x10 from pixmap to window
- 2.49 2.00 1.00 1.00 2.48 Copy 100x100 from pixmap to window
- 1.00 0.91 1.00 1.00 0.98 Copy 500x500 from pixmap to window
- 2.04 1.01 1.00 1.00 2.03 Copy 10x10 from window to pixmap
- 1.05 1.00 1.00 1.00 1.05 Copy 100x100 from window to pixmap
- 1.00 1.00 0.93 1.00 1.04 Copy 500x500 from window to pixmap
- 58.52 1.03 1.03 1.02 57.95 Copy 10x10 from pixmap to pixmap
- 2.40 1.00 1.00 1.00 2.45 Copy 100x100 from pixmap to pixmap
- 1.00 1.00 1.00 1.00 1.00 Copy 500x500 from pixmap to pixmap
- 51.57 1.92 1.00 1.00 85.75 Copy 10x10 1-bit deep plane
- 6.37 1.75 1.01 1.01 6.37 Copy 100x100 1-bit deep plane
- 1.26 1.11 1.00 1.00 1.24 Copy 500x500 1-bit deep plane
- 4.23 1.63 0.98 0.97 4.38 Copy 10x10 n-bit deep plane
- 1.04 1.02 1.00 1.00 1.04 Copy 100x100 n-bit deep plane
- 1.00 1.00 1.00 1.00 1.00 Copy 500x500 n-bit deep plane
- 6.45 1.98 1.00 1.26 12.80 PutImage 10x10 square
- 1.10 1.87 1.00 1.83 2.11 PutImage 100x100 square
- 1.02 1.93 1.00 1.91 1.91 PutImage 500x500 square
- 4.17 1.78 1.00 1.40 7.18 PutImage XY 10x10 square
- 1.27 1.49 0.97 1.48 2.10 PutImage XY 100x100 square
- 1.00 1.50 1.00 1.50 1.52 PutImage XY 500x500 square
- 1.07 1.01 1.00 1.00 1.06 GetImage 10x10 square
- 1.01 1.00 1.00 1.00 1.01 GetImage 100x100 square
- 1.00 1.00 1.00 1.00 1.00 GetImage 500x500 square
- 1.56 1.00 0.99 0.97 1.56 GetImage XY 10x10 square
- 1.02 1.00 1.00 1.00 1.02 GetImage XY 100x100 square
- 1.00 1.00 1.00 1.00 1.00 GetImage XY 500x500 square
- 1.00 1.00 1.01 0.98 0.95 X protocol NoOperation
- 1.02 1.03 1.04 1.03 1.00 QueryPointer
- 1.03 1.02 1.04 1.03 1.00 GetProperty
-100.41 1.51 1.00 1.00 198.76 Change graphics context
- 45.81 1.00 0.99 0.97 57.10 Create and map subwindows (4 kids)
- 78.45 1.01 1.02 1.02 63.07 Create and map subwindows (16 kids)
- 73.91 1.01 1.00 1.00 56.37 Create and map subwindows (25 kids)
- 73.22 1.00 1.00 1.00 49.07 Create and map subwindows (50 kids)
- 72.36 1.01 0.99 1.00 32.14 Create and map subwindows (75 kids)
- 70.34 1.00 1.00 1.00 30.12 Create and map subwindows (100 kids)
- 55.00 1.00 1.00 0.99 23.75 Create and map subwindows (200 kids)
- 55.30 1.01 1.00 1.00 141.03 Create unmapped window (4 kids)
- 55.38 1.01 1.01 1.00 163.25 Create unmapped window (16 kids)
- 54.75 0.96 1.00 0.99 166.95 Create unmapped window (25 kids)
- 54.83 1.00 1.00 0.99 178.81 Create unmapped window (50 kids)
- 55.38 1.01 1.01 1.00 181.20 Create unmapped window (75 kids)
- 55.38 1.01 1.01 1.00 181.20 Create unmapped window (100 kids)
- 54.87 1.01 1.01 1.00 182.05 Create unmapped window (200 kids)
- 28.13 1.00 1.00 1.00 30.75 Map window via parent (4 kids)
- 36.14 1.01 1.01 1.01 32.58 Map window via parent (16 kids)
- 26.13 1.00 0.98 0.95 29.85 Map window via parent (25 kids)
- 40.07 1.00 1.01 1.00 27.57 Map window via parent (50 kids)
- 23.26 0.99 1.00 1.00 18.23 Map window via parent (75 kids)
- 22.91 0.99 1.00 0.99 16.52 Map window via parent (100 kids)
- 27.79 1.00 1.00 0.99 12.50 Map window via parent (200 kids)
- 22.35 1.00 1.00 1.00 56.19 Unmap window via parent (4 kids)
- 9.57 1.00 0.99 1.00 89.78 Unmap window via parent (16 kids)
- 80.77 1.01 1.00 1.00 103.85 Unmap window via parent (25 kids)
- 96.34 1.00 1.00 1.00 116.06 Unmap window via parent (50 kids)
- 99.72 1.00 1.00 1.00 124.93 Unmap window via parent (75 kids)
-112.36 1.00 1.00 1.00 125.27 Unmap window via parent (100 kids)
-105.41 1.00 1.00 0.99 120.00 Unmap window via parent (200 kids)
- 51.29 1.03 1.02 1.02 74.19 Destroy window via parent (4 kids)
- 86.75 0.99 0.99 0.99 116.87 Destroy window via parent (16 kids)
-106.43 1.01 1.01 1.01 127.49 Destroy window via parent (25 kids)
-120.34 1.01 1.01 1.00 140.11 Destroy window via parent (50 kids)
-126.67 1.00 0.99 0.99 145.00 Destroy window via parent (75 kids)
-126.11 1.01 1.01 1.00 140.56 Destroy window via parent (100 kids)
-128.57 1.01 1.00 1.00 137.91 Destroy window via parent (200 kids)
- 16.04 0.88 1.00 1.00 20.36 Hide/expose window via popup (4 kids)
- 19.04 1.01 1.00 1.00 23.48 Hide/expose window via popup (16 kids)
- 19.22 1.00 1.00 1.00 20.44 Hide/expose window via popup (25 kids)
- 17.41 1.00 0.91 0.97 17.68 Hide/expose window via popup (50 kids)
- 17.29 1.01 1.00 1.01 17.07 Hide/expose window via popup (75 kids)
- 16.74 1.00 1.00 1.00 16.17 Hide/expose window via popup (100 kids)
- 10.30 1.00 1.00 1.00 10.51 Hide/expose window via popup (200 kids)
- 16.48 1.01 1.00 1.00 26.05 Move window (4 kids)
- 17.01 0.95 1.00 1.00 23.97 Move window (16 kids)
- 16.95 1.00 1.00 1.00 22.90 Move window (25 kids)
- 16.05 1.01 1.00 1.00 21.32 Move window (50 kids)
- 15.58 1.00 0.98 0.98 19.44 Move window (75 kids)
- 14.98 1.02 1.03 1.03 18.17 Move window (100 kids)
- 10.90 1.01 1.01 1.00 12.68 Move window (200 kids)
- 49.42 1.00 1.00 1.00 198.27 Moved unmapped window (4 kids)
- 50.72 0.97 1.00 1.00 193.66 Moved unmapped window (16 kids)
- 50.87 1.00 0.99 1.00 195.09 Moved unmapped window (25 kids)
- 50.72 1.00 1.00 1.00 189.34 Moved unmapped window (50 kids)
- 50.87 1.00 1.00 1.00 191.33 Moved unmapped window (75 kids)
- 50.87 1.00 1.00 0.90 186.71 Moved unmapped window (100 kids)
- 50.87 1.00 1.00 1.00 179.19 Moved unmapped window (200 kids)
- 41.04 1.00 1.00 1.00 56.61 Move window via parent (4 kids)
- 69.81 1.00 1.00 1.00 130.82 Move window via parent (16 kids)
- 95.81 1.00 1.00 1.00 141.92 Move window via parent (25 kids)
- 95.98 1.00 1.00 1.00 149.43 Move window via parent (50 kids)
- 96.59 1.01 1.01 1.00 153.98 Move window via parent (75 kids)
- 97.19 1.00 1.00 1.00 157.30 Move window via parent (100 kids)
- 96.67 1.00 0.99 0.96 159.44 Move window via parent (200 kids)
- 17.75 1.01 1.00 1.00 27.61 Resize window (4 kids)
- 17.94 1.00 1.00 0.99 25.42 Resize window (16 kids)
- 17.92 1.01 1.00 1.00 24.47 Resize window (25 kids)
- 17.24 0.97 1.00 1.00 24.14 Resize window (50 kids)
- 16.81 1.00 1.00 0.99 22.75 Resize window (75 kids)
- 16.08 1.00 1.00 1.00 21.20 Resize window (100 kids)
- 12.92 1.00 0.99 1.00 16.26 Resize window (200 kids)
- 52.94 1.01 1.00 1.00 327.12 Resize unmapped window (4 kids)
- 53.60 1.01 1.01 1.01 333.71 Resize unmapped window (16 kids)
- 52.99 1.00 1.00 1.00 337.29 Resize unmapped window (25 kids)
- 51.98 1.00 1.00 1.00 329.38 Resize unmapped window (50 kids)
- 53.05 0.89 1.00 1.00 322.60 Resize unmapped window (75 kids)
- 53.05 1.00 1.00 1.00 318.08 Resize unmapped window (100 kids)
- 53.11 1.00 1.00 0.99 306.21 Resize unmapped window (200 kids)
- 16.76 1.00 0.96 1.00 19.46 Circulate window (4 kids)
- 17.24 1.00 1.00 0.97 16.24 Circulate window (16 kids)
- 16.30 1.03 1.03 1.03 15.85 Circulate window (25 kids)
- 13.45 1.00 1.00 1.00 14.90 Circulate window (50 kids)
- 12.91 1.00 1.00 1.00 13.06 Circulate window (75 kids)
- 11.30 0.98 1.00 1.00 11.03 Circulate window (100 kids)
- 7.58 1.01 1.01 0.99 7.47 Circulate window (200 kids)
- 1.01 1.01 0.98 1.00 0.95 Circulate Unmapped window (4 kids)
- 1.07 1.07 1.01 1.07 1.02 Circulate Unmapped window (16 kids)
- 1.04 1.09 1.06 1.05 0.97 Circulate Unmapped window (25 kids)
- 1.04 1.23 1.20 1.18 1.05 Circulate Unmapped window (50 kids)
- 1.18 1.53 1.19 1.45 1.24 Circulate Unmapped window (75 kids)
- 1.08 1.02 1.01 1.74 1.01 Circulate Unmapped window (100 kids)
- 1.01 1.12 0.98 0.91 0.97 Circulate Unmapped window (200 kids)
-</screen>
-</para>
-</sect3>
-
-<sect3>
-<title>Profiling with OProfile</title>
-
-<para>OProfile (available from http://oprofile.sourceforge.net/) is a
-system-wide profiler for Linux systems that uses processor-level
-counters to collect sampling data. OProfile can provide information
-that is similar to that provided by <command>gprof</command>, but without the
-necessity of recompiling the program with special instrumentation (i.e.,
-OProfile can collect statistical profiling information about optimized
-programs). A test harness was developed to collect OProfile data for
-each <command>x11perf</command> test individually.
-</para>
-
-<para>Test runs were performed using the RETIRED_INSNS counter on the AMD
-Athlon and the CPU_CLK_HALTED counter on the Intel Pentium III (with a
-test configuration different from the one described above). We have
-examined OProfile output and have compared it with <command>gprof</command> output.
-This investigation has not produced results that yield performance
-increases in <command>x11perf</command> numbers.
-</para>
-
-</sect3>
-
-<!--
-<sect3>Retired Instructions
-
-<p>The initial tests using OProfile were done using the RETIRED_INSNS
-counter with DMX running on the dual-processor AMD Athlon machine - the
-same test configuration that was described above and that was used for
-other tests. The RETIRED_INSNS counter counts retired instructions and
-showed drawing, text, copying, and image tests to be dominated (&gt;
-30%) by calls to Hash(), SecurityLookupIDByClass(),
-SecurityLookupIDByType(), and StandardReadRequestFromClient(). Some of
-these tests also executed significant instructions in
-WaitForSomething().
-
-<p>In contrast, the window tests executed significant
-instructions in SecurityLookupIDByType(), Hash(),
-StandardReadRequestFromClient(), but also executed significant
-instructions in other routines, such as ConfigureWindow(). Some time
-was spent looking at Hash() function, but optimizations in this routine
-did not lead to a dramatic increase in <tt/x11perf/ performance.
--->
-
-<!--
-<sect3>Clock Cycles
-
-<p>Retired instructions can be misleading because Intel/AMD instructions
-execute in variable amounts of time. The OProfile tests were repeated
-using the Intel CPU_CLK_HALTED counter with DMX running on the second
-back-end machine. Note that this is a different test configuration that
-the one described above. However, these tests show the amount of time
-(as measured in CPU cycles) that are spent in each routine. Because
-<tt/x11perf/ was running on the first back-end machine and because
-window optimizations were on, the load on the second back-end machine
-was not significant.
-
-<p>Using CPU_CLK_HALTED, DMX showed simple drawing
-tests spending more than 10% of their time in
-StandardReadRequestFromClient(), with significant time (&gt; 20% total)
-spent in SecurityLookupIDByClass(), WaitForSomething(), and Dispatch().
-For these tests, &lt; 5% of the time was spent in Hash(), which explains
-why optimizing the Hash() routine did not impact <tt/x11perf/ results.
-
-<p>The trapezoid, text, scrolling, copying, and image tests were
-dominated by time in ProcFillPoly(), PanoramiXFillPoly(), dmxFillPolygon(),
-SecurityLookupIDByClass(), SecurityLookupIDByType(), and
-StandardReadRequestFromClient(). Hash() time was generally above 5% but
-less than 10% of total time.
--->
-
-<sect3>
-<title>X Test Suite</title>
-
-<para>The X Test Suite was run on the fully optimized DMX server using the
-configuration described above. The following failures were noted:
-<screen>
-XListPixmapFormats: Test 1 [1]
-XChangeWindowAttributes: Test 32 [1]
-XCreateWindow: Test 30 [1]
-XFreeColors: Test 4 [3]
-XCopyArea: Test 13, 17, 21, 25, 30 [2]
-XCopyPlane: Test 11, 15, 27, 31 [2]
-XSetFontPath: Test 4 [1]
-XChangeKeyboardControl: Test 9, 10 [1]
-
-[1] Previously documented errors expected from the Xinerama
- implementation (see Phase I discussion).
-[2] Newly noted errors that have been verified as expected
- behavior of the Xinerama implementation.
-[3] Newly noted error that has been verified as a Xinerama
- implementation bug.
-</screen>
-</para>
-
-</sect3>
-
-</sect2>
-
-<!-- ============================================================ -->
-<sect2>
-<title>Phase III</title>
-
-<para>During the third phase of development, support was provided for the
-following extensions: SHAPE, RENDER, XKEYBOARD, XInput.
-</para>
-
-<sect3>
-<title>SHAPE</title>
-
-<para>The SHAPE extension is supported. Test applications (e.g., xeyes and
-oclock) and window managers that make use of the SHAPE extension will
-work as expected.
-</para>
-</sect3>
-
-<sect3>
-<title>RENDER</title>
-
-<para>The RENDER extension is supported. The version included in the DMX
-CVS tree is version 0.2, and this version is fully supported by Xdmx.
-Applications using only version 0.2 functions will work correctly;
-however, some apps that make use of functions from later versions do not
-properly check the extension's major/minor version numbers. These apps
-will fail with a Bad Implementation error when using post-version 0.2
-functions. This is expected behavior. When the DMX CVS tree is updated
-to include newer versions of RENDER, support for these newer functions
-will be added to the DMX X server.
-</para>
-</sect3>
-
-<sect3>
-<title>XKEYBOARD</title>
-
-<para>The XKEYBOARD extension is supported. If present on the back-end X
-servers, the XKEYBOARD extension will be used to obtain information
-about the type of the keyboard for initialization. Otherwise, the
-keyboard will be initialized using defaults. Note that this departs
-from older behavior: when Xdmx is compiled without XKEYBOARD support,
-the map from the back-end X server will be preserved. With XKEYBOARD
-support, the map is not preserved because better information and control
-of the keyboard is available.
-</para>
-</sect3>
-
-<sect3>
-<title>XInput</title>
-
-<para>The XInput extension is supported. Any device can be used as a core
-device and be used as an XInput extension device, with the exception of
-core devices on the back-end servers. This limitation is present
-because cursor handling on the back-end requires that the back-end
-cursor sometimes track the Xdmx core cursor -- behavior that is
-incompatible with using the back-end pointer as a non-core device.
-</para>
-
-<para>Currently, back-end extension devices are not available as Xdmx
-extension devices, but this limitation should be removed in the future.
-</para>
-
-<para>To demonstrate the XInput extension, and to provide more examples for
-low-level input device driver writers, USB device drivers have been
-written for mice (usb-mou), keyboards (usb-kbd), and
-non-mouse/non-keyboard USB devices (usb-oth). Please see the man page
-for information on Linux kernel drivers that are required for using
-these Xdmx drivers.
-</para>
-</sect3>
-
-<sect3>
-<title>DPMS</title>
-
-<para>The DPMS extension is exported but does not do anything at this time.
-</para>
-
-</sect3>
-
-<sect3>
-<title>Other Extensions</title>
-
-<para>The LBX,
- SECURITY,
- XC-APPGROUP, and
- XFree86-Bigfont
-extensions do not require any special Xdmx support and have been exported.
-</para>
-
-<para>The
- BIG-REQUESTS,
- DEC-XTRAP,
- DOUBLE-BUFFER,
- Extended-Visual-Information,
- FontCache,
- GLX,
- MIT-SCREEN-SAVER,
- MIT-SHM,
- MIT-SUNDRY-NONSTANDARD,
- RECORD,
- SECURITY,
- SGI-GLX,
- SYNC,
- TOG-CUP,
- X-Resource,
- XC-MISC,
- XFree86-DGA,
- XFree86-DRI,
- XFree86-Misc,
- XFree86-VidModeExtension, and
- XVideo
-extensions are <emphasis remap="it">not</emphasis> supported at this time, but will be evaluated
-for inclusion in future DMX releases. <emphasis remap="bf">See below for additional work
-on extensions after Phase III.</emphasis>
-</para>
-</sect3>
-</sect2>
-
-<sect2>
-<title>Phase IV</title>
-
-<sect3>
-<title>Moving to XFree86 4.3.0</title>
-
-<para>For Phase IV, the recent release of XFree86 4.3.0 (27 February 2003)
-was merged onto the dmx.sourceforge.net CVS trunk and all work is
-proceeding using this tree.
-</para>
-</sect3>
-
-<sect3>
-<title>Extensions </title>
-
-<sect4>
-<title>XC-MISC (supported)</title>
-
-<para>XC-MISC is used internally by the X library to recycle XIDs from the
-X server. This is important for long-running X server sessions. Xdmx
-supports this extension. The X Test Suite passed and failed the exact
-same tests before and after this extension was enabled.
-<!-- Tested February/March 2003 -->
-</para>
-</sect4>
-
-<sect4>
-<title>Extended-Visual-Information (supported)</title>
-
-<para>The Extended-Visual-Information extension provides a method for an X
-client to obtain detailed visual information. Xdmx supports this
-extension. It was tested using the <filename>hw/dmx/examples/evi</filename> example
-program. <emphasis remap="bf">Note that this extension is not Xinerama-aware</emphasis> -- it will
-return visual information for each screen even though Xinerama is
-causing the X server to export a single logical screen.
-<!-- Tested March 2003 -->
-</para>
-</sect4>
-
-<sect4>
-<title>RES (supported)</title>
-
-<para>The X-Resource extension provides a mechanism for a client to obtain
-detailed information about the resources used by other clients. This
-extension was tested with the <filename>hw/dmx/examples/res</filename> program. The
-X Test Suite passed and failed the exact same tests before and after
-this extension was enabled.
-<!-- Tested March 2003 -->
-</para>
-</sect4>
-
-<sect4>
-<title>BIG-REQUESTS (supported)</title>
-
-<para>This extension enables the X11 protocol to handle requests longer
-than 262140 bytes. The X Test Suite passed and failed the exact same
-tests before and after this extension was enabled.
-<!-- Tested March 2003 -->
-</para>
-</sect4>
-
-<sect4>
-<title>XSYNC (supported)</title>
-
-<para>This extension provides facilities for two different X clients to
-synchronize their requests. This extension was minimally tested with
-<command>xdpyinfo</command> and the X Test Suite passed and failed the exact same
-tests before and after this extension was enabled.
-<!-- Tested March 2003 -->
-</para>
-</sect4>
-
-<sect4>
-<title>XTEST, RECORD, DEC-XTRAP (supported) and XTestExtension1 (not supported)</title>
-
-<para>The XTEST and RECORD extension were developed by the X Consortium for
-use in the X Test Suite and are supported as a standard in the X11R6
-tree. They are also supported in Xdmx. When X Test Suite tests that
-make use of the XTEST extension are run, Xdmx passes and fails exactly
-the same tests as does a standard XFree86 X server. When the
-<literal remap="tt">rcrdtest</literal> test (a part of the X Test Suite that verifies the RECORD
-extension) is run, Xdmx passes and fails exactly the same tests as does
-a standard XFree86 X server. <!-- Tested February/March 2003 -->
-</para>
-
-<para>There are two older XTEST-like extensions: DEC-XTRAP and
-XTestExtension1. The XTestExtension1 extension was developed for use by
-the X Testing Consortium for use with a test suite that eventually
-became (part of?) the X Test Suite. Unlike XTEST, which only allows
-events to be sent to the server, the XTestExtension1 extension also
-allowed events to be recorded (similar to the RECORD extension). The
-second is the DEC-XTRAP extension that was developed by the Digital
-Equipment Corporation.
-</para>
-
-<para>The DEC-XTRAP extension is available from Xdmx and has been tested
-with the <command>xtrap*</command> tools which are distributed as standard X11R6
-clients. <!-- Tested March 2003 -->
-</para>
-
-<para>The XTestExtension1 is <emphasis>not</emphasis> supported because it does not appear
-to be used by any modern X clients (the few that support it also support
-XTEST) and because there are no good methods available for testing that
-it functions correctly (unlike XTEST and DEC-XTRAP, the code for
-XTestExtension1 is not part of the standard X server source tree, so
-additional testing is important). <!-- Tested March 2003 -->
-</para>
-
-<para>Most of these extensions are documented in the X11R6 source tree.
-Further, several original papers exist that this author was unable to
-locate -- for completeness and historical interest, citations are
-provide:
-<variablelist>
-<varlistentry>
-<term>XRECORD</term>
-<listitem>
-<para>Martha Zimet. Extending X For Recording. 8th Annual X
-Technical Conference Boston, MA January 24-26, 1994.
-</para></listitem></varlistentry>
-<varlistentry>
-<term>DEC-XTRAP</term>
-<listitem>
-<para>Dick Annicchiarico, Robert Chesler, Alan Jamison. XTrap
-Architecture. Digital Equipment Corporation, July 1991.
-</para></listitem></varlistentry>
-<varlistentry>
-<term>XTestExtension1</term>
-<listitem>
-<para>Larry Woestman. X11 Input Synthesis Extension
-Proposal. Hewlett Packard, November 1991.
-</para></listitem></varlistentry>
-</variablelist>
-</para>
-</sect4>
-
-<sect4>
-<title>MIT-MISC (not supported)</title>
-
-<para>The MIT-MISC extension is used to control a bug-compatibility flag
-that provides compatibility with xterm programs from X11R1 and X11R2.
-There does not appear to be a single client available that makes use of
-this extension and there is not way to verify that it works correctly.
-The Xdmx server does <emphasis>not</emphasis> support MIT-MISC.
-</para>
-</sect4>
-
-<sect4>
-<title>SCREENSAVER (not supported)</title>
-
-<para>This extension provides special support for the X screen saver. It
-was tested with beforelight, which appears to be the only client that
-works with it. When Xinerama was not active, <command>beforelight</command> behaved
-as expected. However, when Xinerama was active, <command>beforelight</command> did
-not behave as expected. Further, when this extension is not active,
-<command>xscreensaver</command> (a widely-used X screen saver program) did not behave
-as expected. Since this extension is not Xinerama-aware and is not
-commonly used with expected results by clients, we have left this
-extension disabled at this time.
-</para>
-</sect4>
-
-<sect4>
-<title>GLX (supported)</title>
-
-<para>The GLX extension provides OpenGL and GLX windowing support. In
-Xdmx, the extension is called glxProxy, and it is Xinerama aware. It
-works by either feeding requests forward through Xdmx to each of the
-back-end servers or handling them locally. All rendering requests are
-handled on the back-end X servers. This code was donated to the DMX
-project by SGI. For the X Test Suite results comparison, see below.
-</para>
-</sect4>
-
-<sect4>
-<title>RENDER (supported)</title>
-
-<para>The X Rendering Extension (RENDER) provides support for digital image
-composition. Geometric and text rendering are supported. RENDER is
-partially Xinerama-aware, with text and the most basic compositing
-operator; however, its higher level primitives (triangles, triangle
-strips, and triangle fans) are not yet Xinerama-aware. The RENDER
-extension is still under development, and is currently at version 0.8.
-Additional support will be required in DMX as more primitives and/or
-requests are added to the extension.
-</para>
-
-<para>There is currently no test suite for the X Rendering Extension;
-however, there has been discussion of developing a test suite as the
-extension matures. When that test suite becomes available, additional
-testing can be performed with Xdmx. The X Test Suite passed and failed
-the exact same tests before and after this extension was enabled.
-</para>
-</sect4>
-
-<sect4>
-<title>Summary</title>
-
-<!-- WARNING: this list is duplicated in the "Common X extension
-support" section -->
-<para>To summarize, the following extensions are currently supported:
- BIG-REQUESTS,
- DEC-XTRAP,
- DMX,
- DPMS,
- Extended-Visual-Information,
- GLX,
- LBX,
- RECORD,
- RENDER,
- SECURITY,
- SHAPE,
- SYNC,
- X-Resource,
- XC-APPGROUP,
- XC-MISC,
- XFree86-Bigfont,
- XINERAMA,
- XInputExtension,
- XKEYBOARD, and
- XTEST.
-</para>
-
-<para>The following extensions are <emphasis>not</emphasis> supported at this time:
- DOUBLE-BUFFER,
- FontCache,
- MIT-SCREEN-SAVER,
- MIT-SHM,
- MIT-SUNDRY-NONSTANDARD,
- TOG-CUP,
- XFree86-DGA,
- XFree86-Misc,
- XFree86-VidModeExtension,
- XTestExtensionExt1, and
- XVideo.
-</para>
-</sect4>
-</sect3>
-
-<sect3>
-<title>Additional Testing with the X Test Suite</title>
-
-<sect4>
-<title>XFree86 without XTEST</title>
-
-<para>After the release of XFree86 4.3.0, we retested the XFree86 X server
-with and without using the XTEST extension. When the XTEST extension
-was <emphasis>not</emphasis> used for testing, the XFree86 4.3.0 server running on our
-usual test system with a Radeon VE card reported unexpected failures in
-the following tests:
-<literallayout>
-XListPixmapFormats: Test 1
-XChangeKeyboardControl: Tests 9, 10
-XGetDefault: Test 5
-XRebindKeysym: Test 1
-</literallayout>
-</para>
-</sect4>
-
-<sect4>
-<title>XFree86 with XTEST</title>
-
-<para>When using the XTEST extension, the XFree86 4.3.0 server reported the
-following errors:
-<literallayout>
-XListPixmapFormats: Test 1
-XChangeKeyboardControl: Tests 9, 10
-XGetDefault: Test 5
-XRebindKeysym: Test 1
-
-XAllowEvents: Tests 20, 21, 24
-XGrabButton: Tests 5, 9-12, 14, 16, 19, 21-25
-XGrabKey: Test 8
-XSetPointerMapping: Test 3
-XUngrabButton: Test 4
-</literallayout>
-</para>
-
-<para>While these errors may be important, they will probably be fixed
-eventually in the XFree86 source tree. We are particularly interested
-in demonstrating that the Xdmx server does not introduce additional
-failures that are not known Xinerama failures.
-</para>
-</sect4>
-
-<sect4>
-<title>Xdmx with XTEST, without Xinerama, without GLX</title>
-
-<para>Without Xinerama, but using the XTEST extension, the following errors
-were reported from Xdmx (note that these are the same as for the XFree86
-4.3.0, except that XGetDefault no longer fails):
-<literallayout>
-XListPixmapFormats: Test 1
-XChangeKeyboardControl: Tests 9, 10
-XRebindKeysym: Test 1
-
-XAllowEvents: Tests 20, 21, 24
-XGrabButton: Tests 5, 9-12, 14, 16, 19, 21-25
-XGrabKey: Test 8
-XSetPointerMapping: Test 3
-XUngrabButton: Test 4
-</literallayout>
-</para>
-</sect4>
-
-<sect4>
-<title>Xdmx with XTEST, with Xinerama, without GLX</title>
-
-<para>With Xinerama, using the XTEST extension, the following errors
-were reported from Xdmx:
-<literallayout>
-XListPixmapFormats: Test 1
-XChangeKeyboardControl: Tests 9, 10
-XRebindKeysym: Test 1
-
-XAllowEvents: Tests 20, 21, 24
-XGrabButton: Tests 5, 9-12, 14, 16, 19, 21-25
-XGrabKey: Test 8
-XSetPointerMapping: Test 3
-XUngrabButton: Test 4
-
-XCopyPlane: Tests 13, 22, 31 (well-known XTEST/Xinerama interaction issue)
-XDrawLine: Test 67
-XDrawLines: Test 91
-XDrawSegments: Test 68
-</literallayout>
-Note that the first two sets of errors are the same as for the XFree86
-4.3.0 server, and that the XCopyPlane error is a well-known error
-resulting from an XTEST/Xinerama interaction when the request crosses a
-screen boundary. The XDraw* errors are resolved when the tests are run
-individually and they do not cross a screen boundary. We will
-investigate these errors further to determine their cause.
-</para>
-</sect4>
-
-<sect4>
-<title>Xdmx with XTEST, with Xinerama, with GLX</title>
-
-<para>With GLX enabled, using the XTEST extension, the following errors
-were reported from Xdmx (these results are from early during the Phase
-IV development, but were confirmed with a late Phase IV snapshot):
-<literallayout>
-XListPixmapFormats: Test 1
-XChangeKeyboardControl: Tests 9, 10
-XRebindKeysym: Test 1
-
-XAllowEvents: Tests 20, 21, 24
-XGrabButton: Tests 5, 9-12, 14, 16, 19, 21-25
-XGrabKey: Test 8
-XSetPointerMapping: Test 3
-XUngrabButton: Test 4
-
-XClearArea: Test 8
-XCopyArea: Tests 4, 5, 11, 14, 17, 23, 25, 27, 30
-XCopyPlane: Tests 6, 7, 10, 19, 22, 31
-XDrawArcs: Tests 89, 100, 102
-XDrawLine: Test 67
-XDrawSegments: Test 68
-</literallayout>
-Note that the first two sets of errors are the same as for the XFree86
-4.3.0 server, and that the third set has different failures than when
-Xdmx does not include GLX support. Since the GLX extension adds new
-visuals to support GLX's visual configs and the X Test Suite runs tests
-over the entire set of visuals, additional rendering tests were run and
-presumably more of them crossed a screen boundary. This conclusion is
-supported by the fact that nearly all of the rendering errors reported
-are resolved when the tests are run individually and they do no cross a
-screen boundary.
-</para>
-
-<para>Further, when hardware rendering is disabled on the back-end displays,
-many of the errors in the third set are eliminated, leaving only:
-<literallayout>
-XClearArea: Test 8
-XCopyArea: Test 4, 5, 11, 14, 17, 23, 25, 27, 30
-XCopyPlane: Test 6, 7, 10, 19, 22, 31
-</literallayout>
-</para>
-</sect4>
-
-<sect4>
-<title>Conclusion</title>
-
-<para>We conclude that all of the X Test Suite errors reported for Xdmx are
-the result of errors in the back-end X server or the Xinerama
-implementation. Further, all of these errors that can be reasonably
-fixed at the Xdmx layer have been. (Where appropriate, we have
-submitted patches to the XFree86 and Xinerama upstream maintainers.)
-</para>
-</sect4>
-</sect3>
-
-<sect3>
-<title>Dynamic Reconfiguration</title>
-
-<para>During this development phase, dynamic reconfiguration support was
-added to DMX. This support allows an application to change the position
-and offset of a back-end server's screen. For example, if the
-application would like to shift a screen slightly to the left, it could
-query Xdmx for the screen's &lt;x,y&gt; position and then dynamically
-reconfigure that screen to be at position &lt;x+10,y&gt;. When a screen
-is dynamically reconfigured, input handling and a screen's root window
-dimensions are adjusted as needed. These adjustments are transparent to
-the user.
-</para>
-
-<sect4>
-<title>Dynamic reconfiguration extension</title>
-
-<para>The application interface to DMX's dynamic reconfiguration is through
-a function in the DMX extension library:
-<programlisting>
-Bool DMXReconfigureScreen(Display *dpy, int screen, int x, int y)
-</programlisting>
-where <parameter>dpy</parameter> is DMX server's display, <parameter>screen</parameter> is the number of the
-screen to be reconfigured, and <parameter>x</parameter> and <parameter>y</parameter> are the new upper,
-left-hand coordinates of the screen to be reconfigured.
-</para>
-
-<para>The coordinates are not limited other than as required by the X
-protocol, which limits all coordinates to a signed 16 bit number. In
-addition, all coordinates within a screen must also be legal values.
-Therefore, setting a screen's upper, left-hand coordinates such that the
-right or bottom edges of the screen is greater than 32,767 is illegal.
-</para>
-</sect4>
-
-<sect4>
-<title>Bounding box</title>
-
-<para>When the Xdmx server is started, a bounding box is calculated from
-the screens' layout given either on the command line or in the
-configuration file. This bounding box is currently fixed for the
-lifetime of the Xdmx server.
-</para>
-
-<para>While it is possible to move a screen outside of the bounding box, it
-is currently not possible to change the dimensions of the bounding box.
-For example, it is possible to specify coordinates of &lt;-100,-100&gt;
-for the upper, left-hand corner of the bounding box, which was
-previously at coordinates &lt;0,0&gt;. As expected, the screen is moved
-down and to the right; however, since the bounding box is fixed, the
-left side and upper portions of the screen exposed by the
-reconfiguration are no longer accessible on that screen. Those
-inaccessible regions are filled with black.
-</para>
-
-<para>This fixed bounding box limitation will be addressed in a future
-development phase.
-</para>
-</sect4>
-
-<sect4>
-<title>Sample applications</title>
-
-<para>An example of where this extension is useful is in setting up a video
-wall. It is not always possible to get everything perfectly aligned,
-and sometimes the positions are changed (e.g., someone might bump into a
-projector). Instead of physically moving projectors or monitors, it is
-now possible to adjust the positions of the back-end server's screens
-using the dynamic reconfiguration support in DMX.
-</para>
-
-<para>Other applications, such as automatic setup and calibration tools,
-can make use of dynamic reconfiguration to correct for projector
-alignment problems, as long as the projectors are still arranged
-rectilinearly. Horizontal and vertical keystone correction could be
-applied to projectors to correct for non-rectilinear alignment problems;
-however, this must be done external to Xdmx.
-</para>
-
-<para>A sample test program is included in the DMX server's examples
-directory to demonstrate the interface and how an application might use
-dynamic reconfiguration. See <filename>dmxreconfig.c</filename> for details.
-</para>
-</sect4>
-
-<sect4>
-<title>Additional notes</title>
-
-<para>In the original development plan, Phase IV was primarily devoted to
-adding OpenGL support to DMX; however, SGI became interested in the DMX
-project and developed code to support OpenGL/GLX. This code was later
-donated to the DMX project and integrated into the DMX code base, which
-freed the DMX developers to concentrate on dynamic reconfiguration (as
-described above).
-</para>
-</sect4>
-</sect3>
-
-<sect3>
-<title>Doxygen documentation</title>
-
-<para>Doxygen is an open-source (GPL) documentation system for generating
-browseable documentation from stylized comments in the source code. We
-have placed all of the Xdmx server and DMX protocol source code files
-under Doxygen so that comprehensive documentation for the Xdmx source
-code is available in an easily browseable format.
-</para>
-</sect3>
-
-<sect3>
-<title>Valgrind</title>
-
-<para>Valgrind, an open-source (GPL) memory debugger for Linux, was used to
-search for memory management errors. Several memory leaks were detected
-and repaired. The following errors were not addressed:
-<orderedlist>
- <listitem><para>
- When the X11 transport layer sends a reply to the client, only
- those fields that are required by the protocol are filled in --
- unused fields are left as uninitialized memory and are therefore
- noted by valgrind. These instances are not errors and were not
- repaired.
- </para></listitem>
- <listitem><para>
- At each server generation, glxInitVisuals allocates memory that
- is never freed. The amount of memory lost each generation
- approximately equal to 128 bytes for each back-end visual.
- Because the code involved is automatically generated, this bug
- has not been fixed and will be referred to SGI.
- </para></listitem>
- <listitem><para>
- At each server generation, dmxRealizeFont calls XLoadQueryFont,
- which allocates a font structure that is not freed.
- dmxUnrealizeFont can free the font structure for the first
- screen, but cannot free it for the other screens since they are
- already closed by the time dmxUnrealizeFont could free them.
- The amount of memory lost each generation is approximately equal
- to 80 bytes per font per back-end. When this bug is fixed in
- the the X server's device-independent (dix) code, DMX will be
- able to properly free the memory allocated by XLoadQueryFont.
- </para></listitem>
-</orderedlist>
-</para>
-</sect3>
-
-<sect3>
-<title>RATS</title>
-
-<para>RATS (Rough Auditing Tool for Security) is an open-source (GPL)
-security analysis tool that scans source code for common
-security-related programming errors (e.g., buffer overflows and TOCTOU
-races). RATS was used to audit all of the code in the hw/dmx directory
-and all "High" notations were checked manually. The code was either
-re-written to eliminate the warning, or a comment containing "RATS" was
-inserted on the line to indicate that a human had checked the code.
-Unrepaired warnings are as follows:
-<orderedlist>
- <listitem><para>
- Fixed-size buffers are used in many areas, but code has been
- added to protect against buffer overflows (e.g., XmuSnprint).
- The only instances that have not yet been fixed are in
- config/xdmxconfig.c (which is not part of the Xdmx server) and
- input/usb-common.c.
- </para></listitem>
- <listitem><para>
- vprintf and vfprintf are used in the logging routines. In
- general, all uses of these functions (e.g., dmxLog) provide a
- constant format string from a trusted source, so the use is
- relatively benign.
- </para></listitem>
- <listitem><para>
- glxProxy/glxscreens.c uses getenv and strcat. The use of these
- functions is safe and will remain safe as long as
- ExtensionsString is longer then GLXServerExtensions (ensuring
- this may not be ovious to the casual programmer, but this is in
- automatically generated code, so we hope that the generator
- enforces this constraint).
- </para></listitem>
-</orderedlist>
-
-</para>
-
-</sect3>
-
-</sect2>
-
-</sect1>
-
-</appendix>
-
- </article>
-
- <!-- Local Variables: -->
- <!-- fill-column: 72 -->
- <!-- End: -->
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+ "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+]>
+
+<article>
+
+ <articleinfo>
+ <!-- Title information -->
+ <title>Distributed Multihead X design</title>
+ <authorgroup>
+ <author><firstname>Kevin E.</firstname><surname>Martin</surname></author>
+ <author><firstname>David H.</firstname><surname>Dawes</surname></author>
+ <author><firstname>Rickard E.</firstname><surname>Faith</surname></author>
+ </authorgroup>
+ <pubdate>29 June 2004 (created 25 July 2001)</pubdate>
+ <abstract><para>
+ This document covers the motivation, background, design, and
+ implementation of the distributed multihead X (DMX) system. It
+ is a living document and describes the current design and
+ implementation details of the DMX system. As the project
+ progresses, this document will be continually updated to reflect
+ the changes in the code and/or design. <emphasis remap="it">Copyright 2001 by VA
+ Linux Systems, Inc., Fremont, California. Copyright 2001-2004
+ by Red Hat, Inc., Raleigh, North Carolina</emphasis>
+ </para></abstract>
+ </articleinfo>
+
+<!-- Begin the document -->
+<sect1>
+<title>Introduction</title>
+
+<sect2>
+<title>The Distributed Multihead X Server</title>
+
+<para>Current Open Source multihead solutions are limited to a single
+physical machine. A single X server controls multiple display devices,
+which can be arranged as independent heads or unified into a single
+desktop (with Xinerama). These solutions are limited to the number of
+physical devices that can co-exist in a single machine (e.g., due to the
+number of AGP/PCI slots available for graphics cards). Thus, large
+tiled displays are not currently possible. The work described in this
+paper will eliminate the requirement that the display devices reside in
+the same physical machine. This will be accomplished by developing a
+front-end proxy X server that will control multiple back-end X servers
+that make up the large display.
+</para>
+
+<para>The overall structure of the distributed multihead X (DMX) project is
+as follows: A single front-end X server will act as a proxy to a set of
+back-end X servers, which handle all of the visible rendering. X
+clients will connect to the front-end server just as they normally would
+to a regular X server. The front-end server will present an abstracted
+view to the client of a single large display. This will ensure that all
+standard X clients will continue to operate without modification
+(limited, as always, by the visuals and extensions provided by the X
+server). Clients that are DMX-aware will be able to use an extension to
+obtain information about the back-end servers (e.g., for placement of
+pop-up windows, window alignments by the window manager, etc.).
+</para>
+
+<para>The architecture of the DMX server is divided into two main sections:
+input (e.g., mouse and keyboard events) and output (e.g., rendering and
+windowing requests). Each of these are describe briefly below, and the
+rest of this design document will describe them in greater detail.
+</para>
+
+<para>The DMX server can receive input from three general types of input
+devices: "local" devices that are physically attached to the machine on
+which DMX is running, "backend" devices that are physically attached to
+one or more of the back-end X servers (and that generate events via the
+X protocol stream from the backend), and "console" devices that can be
+abstracted from any non-back-end X server. Backend and console devices
+are treated differently because the pointer device on the back-end X
+server also controls the location of the hardware X cursor. Full
+support for XInput extension devices is provided.
+</para>
+
+<para>Rendering requests will be accepted by the front-end server; however,
+rendering to visible windows will be broken down as needed and sent to
+the appropriate back-end server(s) via X11 library calls for actual
+rendering. The basic framework will follow a Xnest-style approach. GC
+state will be managed in the front-end server and sent to the
+appropriate back-end server(s) as required. Pixmap rendering will (at
+least initially) be handled by the front-end X server. Windowing
+requests (e.g., ordering, mapping, moving, etc.) will handled in the
+front-end server. If the request requires a visible change, the
+windowing operation will be translated into requests for the appropriate
+back-end server(s). Window state will be mirrored in the back-end
+server(s) as needed.
+</para>
+</sect2>
+
+<sect2>
+<title>Layout of Paper</title>
+
+<para>The next section describes the general development plan that was
+actually used for implementation. The final section discusses
+outstanding issues at the conclusion of development. The first appendix
+provides low-level technical detail that may be of interest to those
+intimately familiar with the X server architecture. The final appendix
+describes the four phases of development that were performed during the
+first two years of development.
+</para>
+
+<para>The final year of work was divided into 9 tasks that are not
+described in specific sections of this document. The major tasks during
+that time were the enhancement of the reconfiguration ability added in
+Phase IV, addition of support for a dynamic number of back-end displays
+(instead of a hard-coded limit), and the support for back-end display
+and input removal and addition. This work is mentioned in this paper,
+but is not covered in detail.
+</para>
+</sect2>
+</sect1>
+
+<!-- ============================================================ -->
+<sect1>
+<title>Development plan</title>
+
+<para>This section describes the development plan from approximately June
+2001 through July 2003.
+</para>
+
+<sect2>
+<title>Bootstrap code</title>
+
+<para>To allow for rapid development of the DMX server by multiple
+developers during the first development stage, the problem will be
+broken down into three tasks: the overall DMX framework, back-end
+rendering services and input device handling services. However, before
+the work begins on these tasks, a simple framework that each developer
+could use was implemented to bootstrap the development effort. This
+framework renders to a single back-end server and provides dummy input
+devices (i.e., the keyboard and mouse). The simple back-end rendering
+service was implemented using the shadow framebuffer support currently
+available in the XFree86 environment.
+</para>
+
+<para>Using this bootstrapping framework, each developer has been able to
+work on each of the tasks listed above independently as follows: the
+framework will be extended to handle arbitrary back-end server
+configurations; the back-end rendering services will be transitioned to
+the more efficient Xnest-style implementation; and, an input device
+framework to handle various input devices via the input extension will
+be developed.
+</para>
+
+<para>Status: The boot strap code is complete. <!-- August 2001 -->
+</para>
+
+</sect2>
+
+<sect2>
+<title>Input device handling</title>
+
+<para>An X server (including the front-end X server) requires two core
+input devices -- a keyboard and a pointer (mouse). These core devices
+are handled and required by the core X11 protocol. Additional types of
+input devices may be attached and utilized via the XInput extension.
+These are usually referred to as ``XInput extension devices'',
+</para>
+
+<para>There are some options as to how the front-end X server gets its core
+input devices:
+
+<orderedlist>
+<listitem>
+ <para>Local Input. The physical input devices (e.g., keyboard and
+ mouse) can be attached directly to the front-end X server. In this
+ case, the keyboard and mouse on the machine running the front-end X
+ server will be used. The front-end will have drivers to read the
+ raw input from those devices and convert it into the required X
+ input events (e.g., key press/release, pointer button press/release,
+ pointer motion). The front-end keyboard driver will keep track of
+ keyboard properties such as key and modifier mappings, autorepeat
+ state, keyboard sound and led state. Similarly the front-end
+ pointer driver will keep track if pointer properties such as the
+ button mapping and movement acceleration parameters. With this
+ option, input is handled fully in the front-end X server, and the
+ back-end X servers are used in a display-only mode. This option was
+ implemented and works for a limited number of Linux-specific
+ devices. Adding additional local input devices for other
+ architectures is expected to be relatively simple.
+</para>
+
+ <para>The following options are available for implementing local input
+ devices:
+
+<orderedlist>
+<listitem>
+ <para>The XFree86 X server has modular input drivers that could
+ be adapted for this purpose. The mouse driver supports a wide
+ range of mouse types and interfaces, as well as a range of
+ Operating System platforms. The keyboard driver in XFree86 is
+ not currently as modular as the mouse driver, but could be made
+ so. The XFree86 X server also has a range of other input
+ drivers for extended input devices such as tablets and touch
+ screens. Unfortunately, the XFree86 drivers are generally
+ complex, often simultaneously providing support for multiple
+ devices across multiple architectures; and rely so heavily on
+ XFree86-specific helper-functions, that this option was not
+ pursued.
+</para>
+</listitem>
+
+<listitem>
+ <para>The <command>kdrive</command> X server in XFree86 has built-in drivers that
+ support PS/2 mice and keyboard under Linux. The mouse driver
+ can indirectly handle other mouse types if the Linux utility
+ <command>gpm</command> is used as to translate the native mouse protocol into
+ PS/2 mouse format. These drivers could be adapted and built in
+ to the front-end X server if this range of hardware and OS
+ support is sufficient. While much simpler than the XFree86
+ drivers, the <command>kdrive</command> drivers were not used for the DMX
+ implementation.
+</para>
+</listitem>
+
+<listitem>
+ <para>Reimplementation of keyboard and mouse drivers from
+ scratch for the DMX framework. Because keyboard and mouse
+ drivers are relatively trivial to implement, this pathway was
+ selected. Other drivers in the X source tree were referenced,
+ and significant contributions from other drivers are noted in
+ the DMX source code.
+</para>
+</listitem>
+</orderedlist>
+</para>
+</listitem>
+
+<listitem>
+ <para>Backend Input. The front-end can make use of the core input
+ devices attached to one or more of the back-end X servers. Core
+ input events from multiple back-ends are merged into a single input
+ event stream. This can work sanely when only a single set of input
+ devices is used at any given time. The keyboard and pointer state
+ will be handled in the front-end, with changes propagated to the
+ back-end servers as needed. This option was implemented and works
+ well. Because the core pointer on a back-end controls the hardware
+ mouse on that back-end, core pointers cannot be treated as XInput
+ extension devices. However, all back-end XInput extensions devices
+ can be mapped to either DMX core or DMX XInput extension devices.
+</para>
+</listitem>
+
+<listitem>
+ <para>Console Input. The front-end server could create a console
+ window that is displayed on an X server independent of the back-end
+ X servers. This console window could display things like the
+ physical screen layout, and the front-end could get its core input
+ events from events delivered to the console window. This option was
+ implemented and works well. To help the human navigate, window
+ outlines are also displayed in the console window. Further, console
+ windows can be used as either core or XInput extension devices.
+</para>
+</listitem>
+
+<listitem>
+ <para>Other options were initially explored, but they were all
+ partial subsets of the options listed above and, hence, are
+ irrelevant.
+</para>
+</listitem>
+
+</orderedlist>
+</para>
+
+<para>Although extended input devices are not specifically mentioned in the
+Distributed X requirements, the options above were all implemented so
+that XInput extension devices were supported.
+</para>
+
+<para>The bootstrap code (Xdmx) had dummy input devices, and these are
+still supported in the final version. These do the necessary
+initialization to satisfy the X server's requirements for core pointer
+and keyboard devices, but no input events are ever generated.
+</para>
+
+<para>Status: The input code is complete. Because of the complexity of the
+XFree86 input device drivers (and their heavy reliance on XFree86
+infrastructure), separate low-level device drivers were implemented for
+Xdmx. The following kinds of drivers are supported (in general, the
+devices can be treated arbitrarily as "core" input devices or as XInput
+"extension" devices; and multiple instances of different kinds of
+devices can be simultaneously available):
+<orderedlist>
+<listitem>
+ <para> A "dummy" device drive that never generates events.
+</para>
+</listitem>
+
+<listitem>
+ <para> "Local" input is from the low-level hardware on which the
+ Xdmx binary is running. This is the only area where using the
+ XFree86 driver infrastructure would have been helpful, and then
+ only partially, since good support for generic USB devices does
+ not yet exist in XFree86 (in any case, XFree86 and kdrive driver
+ code was used where possible). Currently, the following local
+ devices are supported under Linux (porting to other operating
+ systems should be fairly straightforward):
+ <itemizedlist>
+ <listitem><para>Linux keyboard</para></listitem>
+ <listitem><para>Linux serial mouse (MS)</para></listitem>
+ <listitem><para>Linux PS/2 mouse</para></listitem>
+ <listitem><para>USB keyboard</para></listitem>
+ <listitem><para>USB mouse</para></listitem>
+ <listitem><para>USB generic device (e.g., joystick, gamepad, etc.)</para></listitem>
+ </itemizedlist>
+</para>
+</listitem>
+
+<listitem>
+ <para> "Backend" input is taken from one or more of the back-end
+ displays. In this case, events are taken from the back-end X
+ server and are converted to Xdmx events. Care must be taken so
+ that the sprite moves properly on the display from which input
+ is being taken.
+</para>
+</listitem>
+
+<listitem>
+ <para> "Console" input is taken from an X window that Xdmx
+ creates on the operator's display (i.e., on the machine running
+ the Xdmx binary). When the operator's mouse is inside the
+ console window, then those events are converted to Xdmx events.
+ Several special features are available: the console can display
+ outlines of windows that are on the Xdmx display (to facilitate
+ navigation), the cursor can be confined to the console, and a
+ "fine" mode can be activated to allow very precise cursor
+ positioning.
+</para>
+</listitem>
+</orderedlist>
+
+</para>
+
+</sect2>
+
+<!-- May 2002; July 2003 -->
+
+<sect2>
+<title>Output device handling</title>
+
+<para>The output of the DMX system displays rendering and windowing
+requests across multiple screens. The screens are typically arranged in
+a grid such that together they represent a single large display.
+</para>
+
+<para>The output section of the DMX code consists of two parts. The first
+is in the front-end proxy X server (Xdmx), which accepts client
+connections, manages the windows, and potentially renders primitives but
+does not actually display any of the drawing primitives. The second
+part is the back-end X server(s), which accept commands from the
+front-end server and display the results on their screens.
+</para>
+
+<sect3>
+<title>Initialization</title>
+
+<para>The DMX front-end must first initialize its screens by connecting to
+each of the back-end X servers and collecting information about each of
+these screens. However, the information collected from the back-end X
+servers might be inconsistent. Handling these cases can be difficult
+and/or inefficient. For example, a two screen system has one back-end X
+server running at 16bpp while the second is running at 32bpp.
+Converting rendering requests (e.g., XPutImage() or XGetImage()
+requests) to the appropriate bit depth can be very time consuming.
+Analyzing these cases to determine how or even if it is possible to
+handle them is required. The current Xinerama code handles many of
+these cases (e.g., in PanoramiXConsolidate()) and will be used as a
+starting point. In general, the best solution is to use homogeneous X
+servers and display devices. Using back-end servers with the same depth
+is a requirement of the final DMX implementation.
+</para>
+
+<para>Once this screen consolidation is finished, the relative position of
+each back-end X server's screen in the unified screen is initialized. A
+full-screen window is opened on each of the back-end X servers, and the
+cursor on each screen is turned off. The final DMX implementation can
+also make use of a partial-screen window, or multiple windows per
+back-end screen.
+</para>
+</sect3>
+
+<sect3>
+<title>Handling rendering requests</title>
+
+<para>After initialization, X applications connect to the front-end server.
+There are two possible implementations of how rendering and windowing
+requests are handled in the DMX system:
+
+<orderedlist>
+<listitem>
+ <para>A shadow framebuffer is used in the front-end server as the
+ render target. In this option, all protocol requests are completely
+ handled in the front-end server. All state and resources are
+ maintained in the front-end including a shadow copy of the entire
+ framebuffer. The framebuffers attached to the back-end servers are
+ updated by XPutImage() calls with data taken directly from the
+ shadow framebuffer.
+</para>
+
+ <para>This solution suffers from two main problems. First, it does not
+ take advantage of any accelerated hardware available in the system.
+ Second, the size of the XPutImage() calls can be quite large and
+ thus will be limited by the bandwidth available.
+</para>
+
+ <para>The initial DMX implementation used a shadow framebuffer by
+ default.
+</para>
+</listitem>
+
+<listitem>
+ <para>Rendering requests are sent to each back-end server for
+ handling (as is done in the Xnest server described above). In this
+ option, certain protocol requests are handled in the front-end
+ server and certain requests are repackaged and then sent to the
+ back-end servers. The framebuffer is distributed across the
+ multiple back-end servers. Rendering to the framebuffer is handled
+ on each back-end and can take advantage of any acceleration
+ available on the back-end servers' graphics display device. State
+ is maintained both in the front and back-end servers.
+</para>
+
+ <para>This solution suffers from two main drawbacks. First, protocol
+ requests are sent to all back-end servers -- even those that will
+ completely clip the rendering primitive -- which wastes bandwidth
+ and processing time. Second, state is maintained both in the front-
+ and back-end servers. These drawbacks are not as severe as in
+ option 1 (above) and can either be overcome through optimizations or
+ are acceptable. Therefore, this option will be used in the final
+ implementation.
+</para>
+
+ <para>The final DMX implementation defaults to this mechanism, but also
+ supports the shadow framebuffer mechanism. Several optimizations
+ were implemented to eliminate the drawbacks of the default
+ mechanism. These optimizations are described the section below and
+ in Phase II of the Development Results (see appendix).
+</para>
+</listitem>
+
+</orderedlist>
+</para>
+
+<para>Status: Both the shadow framebuffer and Xnest-style code is complete.
+<!-- May 2002 -->
+</para>
+
+</sect3>
+</sect2>
+
+<sect2>
+<title>Optimizing DMX</title>
+
+<para>Initially, the Xnest-style solution's performance will be measured
+and analyzed to determine where the performance bottlenecks exist.
+There are four main areas that will be addressed.
+</para>
+
+<para>First, to obtain reasonable interactivity with the first development
+phase, XSync() was called after each protocol request. The XSync()
+function flushes any pending protocol requests. It then waits for the
+back-end to process the request and send a reply that the request has
+completed. This happens with each back-end server and performance
+greatly suffers. As a result of the way XSync() is called in the first
+development phase, the batching that the X11 library performs is
+effectively defeated. The XSync() call usage will be analyzed and
+optimized by batching calls and performing them at regular intervals,
+except where interactivity will suffer (e.g., on cursor movements).
+</para>
+
+<para>Second, the initial Xnest-style solution described above sends the
+repackaged protocol requests to all back-end servers regardless of
+whether or not they would be completely clipped out. The requests that
+are trivially rejected on the back-end server wastes the limited
+bandwidth available. By tracking clipping changes in the DMX X server's
+windowing code (e.g., by opening, closing, moving or resizing windows),
+we can determine whether or not back-end windows are visible so that
+trivial tests in the front-end server's GC ops drawing functions can
+eliminate these unnecessary protocol requests.
+</para>
+
+<para>Third, each protocol request will be analyzed to determine if it is
+possible to break the request into smaller pieces at display boundaries.
+The initial ones to be analyzed are put and get image requests since
+they will require the greatest bandwidth to transmit data between the
+front and back-end servers. Other protocol requests will be analyzed
+and those that will benefit from breaking them into smaller requests
+will be implemented.
+</para>
+
+<para>Fourth, an extension is being considered that will allow font glyphs to
+be transferred from the front-end DMX X server to each back-end server.
+This extension will permit the front-end to handle all font requests and
+eliminate the requirement that all back-end X servers share the exact
+same fonts as the front-end server. We are investigating the
+feasibility of this extension during this development phase.
+</para>
+
+<para>Other potential optimizations will be determined from the performance
+analysis.
+</para>
+
+<para>Please note that in our initial design, we proposed optimizing BLT
+operations (e.g., XCopyArea() and window moves) by developing an
+extension that would allow individual back-end servers to directly copy
+pixel data to other back-end servers. This potential optimization was
+in response to the simple image movement implementation that required
+potentially many calls to GetImage() and PutImage(). However, the
+current Xinerama implementation handles these BLT operations
+differently. Instead of copying data to and from screens, they generate
+expose events -- just as happens in the case when a window is moved from
+off a screen to on screen. This approach saves the limited bandwidth
+available between front and back-end servers and is being standardized
+with Xinerama. It also eliminates the potential setup problems and
+security issues resulting from having each back-end server open
+connections to all other back-end servers. Therefore, we suggest
+accepting Xinerama's expose event solution.
+</para>
+
+<para>Also note that the approach proposed in the second and third
+optimizations might cause backing store algorithms in the back-end to be
+defeated, so a DMX X server configuration flag will be added to disable
+these optimizations.
+</para>
+
+<para>Status: The optimizations proposed above are complete. It was
+determined that the using the xfs font server was sufficient and
+creating a new mechanism to pass glyphs was redundant; therefore, the
+fourth optimization proposed above was not included in DMX.
+<!-- September 2002 -->
+</para>
+
+</sect2>
+
+<sect2>
+<title>DMX X extension support</title>
+
+<para>The DMX X server keeps track of all the windowing information on the
+back-end X servers, but does not currently export this information to
+any client applications. An extension will be developed to pass the
+screen information and back-end window IDs to DMX-aware clients. These
+clients can then use this information to directly connect to and render
+to the back-end windows. Bypassing the DMX X server allows DMX-aware
+clients to break up complex rendering requests on their own and send
+them directly to the windows on the back-end server's screens. An
+example of a client that can make effective use of this extension is
+Chromium.
+</para>
+
+<para>Status: The extension, as implemented, is fully documented in
+"Client-to-Server DMX Extension to the X Protocol". Future changes
+might be required based on feedback and other proposed enhancements to
+DMX. Currently, the following facilities are supported:
+<orderedlist>
+<listitem><para>
+ Screen information (clipping rectangle for each screen relative
+ to the virtual screen)
+</para></listitem>
+<listitem><para>
+ Window information (window IDs and clipping information for each
+ back-end window that corresponds to each DMX window)
+</para></listitem>
+<listitem><para>
+ Input device information (mappings from DMX device IDs to
+ back-end device IDs)
+</para></listitem>
+<listitem><para>
+ Force window creation (so that a client can override the
+ server-side lazy window creation optimization)
+</para></listitem>
+<listitem><para>
+ Reconfiguration (so that a client can request that a screen
+ position be changed)
+</para></listitem>
+<listitem><para>
+ Addition and removal of back-end servers and back-end and
+ console inputs.
+</para></listitem>
+</orderedlist>
+</para>
+<!-- September 2002; July 2003 -->
+
+</sect2>
+
+<sect2>
+<title>Common X extension support</title>
+
+<para>The XInput, XKeyboard and Shape extensions are commonly used
+extensions to the base X11 protocol. XInput allows multiple and
+non-standard input devices to be accessed simultaneously. These input
+devices can be connected to either the front-end or back-end servers.
+XKeyboard allows much better keyboard mappings control. Shape adds
+support for arbitrarily shaped windows and is used by various window
+managers. Nearly all potential back-end X servers make these extensions
+available, and support for each one will be added to the DMX system.
+</para>
+
+<para>In addition to the extensions listed above, support for the X
+Rendering extension (Render) is being developed. Render adds digital
+image composition to the rendering model used by the X Window System.
+While this extension is still under development by Keith Packard of HP,
+support for the current version will be added to the DMX system.
+</para>
+
+<para>Support for the XTest extension was added during the first
+development phase.
+</para>
+
+<!-- WARNING: this list is duplicated in the Phase IV discussion -->
+<para>Status: The following extensions are supported and are discussed in
+more detail in Phase IV of the Development Results (see appendix):
+ BIG-REQUESTS,
+ DEC-XTRAP,
+ DMX,
+ DPMS,
+ Extended-Visual-Information,
+ GLX,
+ LBX,
+ RECORD,
+ RENDER,
+ SECURITY,
+ SHAPE,
+ SYNC,
+ X-Resource,
+ XC-APPGROUP,
+ XC-MISC,
+ XFree86-Bigfont,
+ XINERAMA,
+ XInputExtension,
+ XKEYBOARD, and
+ XTEST.
+<!-- November 2002; updated February 2003, July 2003 -->
+</para>
+</sect2>
+
+<sect2>
+<title>OpenGL support</title>
+
+<para>OpenGL support using the Mesa code base exists in XFree86 release 4
+and later. Currently, the direct rendering infrastructure (DRI)
+provides accelerated OpenGL support for local clients and unaccelerated
+OpenGL support (i.e., software rendering) is provided for non-local
+clients.
+</para>
+
+<para>The single head OpenGL support in XFree86 4.x will be extended to use
+the DMX system. When the front and back-end servers are on the same
+physical hardware, it is possible to use the DRI to directly render to
+the back-end servers. First, the existing DRI will be extended to
+support multiple display heads, and then to support the DMX system.
+OpenGL rendering requests will be direct rendering to each back-end X
+server. The DRI will request the screen layout (either from the
+existing Xinerama extension or a DMX-specific extension). Support for
+synchronized swap buffers will also be added (on hardware that supports
+it). Note that a single front-end server with a single back-end server
+on the same physical machine can emulate accelerated indirect rendering.
+</para>
+
+<para>When the front and back-end servers are on different physical
+hardware or are using non-XFree86 4.x X servers, a mechanism to render
+primitives across the back-end servers will be provided. There are
+several options as to how this can be implemented.
+</para>
+
+<orderedlist>
+<listitem>
+ <para>The existing OpenGL support in each back-end server can be
+ used by repackaging rendering primitives and sending them to each
+ back-end server. This option is similar to the unoptimized
+ Xnest-style approach mentioned above. Optimization of this solution
+ is beyond the scope of this project and is better suited to other
+ distributed rendering systems.
+</para></listitem>
+
+<listitem>
+ <para>Rendering to a pixmap in the front-end server using the
+ current XFree86 4.x code, and then displaying to the back-ends via
+ calls to XPutImage() is another option. This option is similar to
+ the shadow frame buffer approach mentioned above. It is slower and
+ bandwidth intensive, but has the advantage that the back-end servers
+ are not required to have OpenGL support.
+</para></listitem>
+</orderedlist>
+
+<para>These, and other, options will be investigated in this phase of the
+work.
+</para>
+
+<para>Work by others have made Chromium DMX-aware. Chromium will use the
+DMX X protocol extension to obtain information about the back-end
+servers and will render directly to those servers, bypassing DMX.
+</para>
+
+<para>Status: OpenGL support by the glxProxy extension was implemented by
+SGI and has been integrated into the DMX code base.
+</para>
+<!-- May 2003-->
+</sect2>
+
+</sect1>
+
+<!-- ============================================================ -->
+<sect1>
+<title>Current issues</title>
+
+<para>In this sections the current issues are outlined that require further
+investigation.
+</para>
+
+<sect2>
+<title>Fonts</title>
+
+<para>The font path and glyphs need to be the same for the front-end and
+each of the back-end servers. Font glyphs could be sent to the back-end
+servers as necessary but this would consume a significant amount of
+available bandwidth during font rendering for clients that use many
+different fonts (e.g., Netscape). Initially, the font server (xfs) will
+be used to provide the fonts to both the front-end and back-end servers.
+Other possibilities will be investigated during development.
+</para>
+</sect2>
+
+<sect2>
+<title>Zero width rendering primitives</title>
+
+<para>To allow pixmap and on-screen rendering to be pixel perfect, all
+back-end servers must render zero width primitives exactly the same as
+the front-end renders the primitives to pixmaps. For those back-end
+servers that do not exactly match, zero width primitives will be
+automatically converted to one width primitives. This can be handled in
+the front-end server via the GC state.
+</para>
+</sect2>
+
+<sect2>
+<title>Output scaling</title>
+
+<para>With very large tiled displays, it might be difficult to read the
+information on the standard X desktop. In particular, the cursor can be
+easily lost and fonts could be difficult to read. Automatic primitive
+scaling might prove to be very useful. We will investigate the
+possibility of scaling the cursor and providing a set of alternate
+pre-scaled fonts to replace the standard fonts that many applications
+use (e.g., fixed). Other options for automatic scaling will also be
+investigated.
+</para>
+</sect2>
+
+<sect2>
+<title>Per-screen colormaps</title>
+
+<para>Each screen's default colormap in the set of back-end X servers
+should be able to be adjusted via a configuration utility. This support
+is would allow the back-end screens to be calibrated via custom gamma
+tables. On 24-bit systems that support a DirectColor visual, this type
+of correction can be accommodated. One possible implementation would be
+to advertise to X client of the DMX server a TrueColor visual while
+using DirectColor visuals on the back-end servers to implement this type
+of color correction. Other options will be investigated.
+</para>
+</sect2>
+</sect1>
+
+<!-- ============================================================ -->
+<appendix>
+<title>Appendix</title>
+
+<sect1>
+<title>Background</title>
+
+<para>This section describes the existing Open Source architectures that
+can be used to handle multiple screens and upon which this development
+project is based. This section was written before the implementation
+was finished, and may not reflect actual details of the implementation.
+It is left for historical interest only.
+</para>
+
+<sect2>
+<title>Core input device handling</title>
+
+<para>The following is a description of how core input devices are handled
+by an X server.
+</para>
+
+<sect3>
+<title>InitInput()</title>
+
+<para>InitInput() is a DDX function that is called at the start of each
+server generation from the X server's main() function. Its purpose is
+to determine what input devices are connected to the X server, register
+them with the DIX and MI layers, and initialize the input event queue.
+InitInput() does not have a return value, but the X server will abort if
+either a core keyboard device or a core pointer device are not
+registered. Extended input (XInput) devices can also be registered in
+InitInput().
+</para>
+
+<para>InitInput() usually has implementation specific code to determine
+which input devices are available. For each input device it will be
+using, it calls AddInputDevice():
+
+<variablelist>
+<varlistentry>
+<term>AddInputDevice()</term>
+<listitem><para>This DIX function allocates the device structure,
+registers a callback function (which handles device init, close, on and
+off), and returns the input handle, which can be treated as opaque. It
+is called once for each input device.
+</para></listitem>
+</varlistentry>
+</variablelist>
+</para>
+
+<para>Once input handles for core keyboard and core pointer devices have
+been obtained from AddInputDevice(). If both core devices are not
+registered, then the X server will exit with a fatal error when it
+attempts to start the input devices in InitAndStartDevices(), which is
+called directly after InitInput() (see below).
+</para>
+
+<para>The core pointer device is then registered with the miPointer code
+(which does the high level cursor handling). While this registration
+is not necessary for correct miPointer operation in the current XFree86
+code, it is still done mostly for compatibility reasons.
+</para>
+
+<para><variablelist>
+
+<varlistentry>
+<term>miRegisterPointerDevice()</term>
+<listitem><para>This MI function registers the core
+pointer's input handle with with the miPointer code.
+</para></listitem></varlistentry>
+</variablelist>
+</para>
+
+<para>The final part of InitInput() is the initialization of the input
+event queue handling. In most cases, the event queue handling provided
+in the MI layer is used. The primary XFree86 X server uses its own
+event queue handling to support some special cases related to the XInput
+extension and the XFree86-specific DGA extension. For our purposes, the
+MI event queue handling should be suitable. It is initialized by
+calling mieqInit():
+
+<variablelist>
+<varlistentry>
+<term>mieqInit()</term>
+<listitem><para>This MI function initializes the MI event queue for the
+core devices, and is passed the public component of the input handles
+for the two core devices.
+</para></listitem></varlistentry>
+</variablelist>
+</para>
+
+<para>If a wakeup handler is required to deliver synchronous input
+events, it can be registered here by calling the DIX function
+RegisterBlockAndWakeupHandlers(). (See the devReadInput() description
+below.)
+</para>
+</sect3>
+
+<sect3>
+<title>InitAndStartDevices()</title>
+
+<para>InitAndStartDevices() is a DIX function that is called immediately
+after InitInput() from the X server's main() function. Its purpose is
+to initialize each input device that was registered with
+AddInputDevice(), enable each input device that was successfully
+initialized, and create the list of enabled input devices. Once each
+registered device is processed in this way, the list of enabled input
+devices is checked to make sure that both a core keyboard device and
+core pointer device were registered and successfully enabled. If not,
+InitAndStartDevices() returns failure, and results in the the X server
+exiting with a fatal error.
+</para>
+
+<para>Each registered device is initialized by calling its callback
+(dev-&gt;deviceProc) with the DEVICE_INIT argument:
+
+<variablelist>
+<varlistentry>
+<term>(*dev-&gt;deviceProc)(dev, DEVICE_INIT)</term>
+<listitem>
+<para>This function initializes the
+device structs with core information relevant to the device.
+</para>
+
+<para>For pointer devices, this means specifying the number of buttons,
+default button mapping, the function used to get motion events (usually
+miPointerGetMotionEvents()), the function used to change/control the
+core pointer motion parameters (acceleration and threshold), and the
+motion buffer size.
+</para>
+
+<para>For keyboard devices, this means specifying the keycode range,
+default keycode to keysym mapping, default modifier mapping, and the
+functions used to sound the keyboard bell and modify/control the
+keyboard parameters (LEDs, bell pitch and duration, key click, which
+keys are auto-repeating, etc).
+</para></listitem></varlistentry>
+</variablelist>
+</para>
+
+<para>Each initialized device is enabled by calling EnableDevice():
+
+<variablelist>
+<varlistentry>
+<term>EnableDevice()</term>
+<listitem>
+<para>EnableDevice() calls the device callback with
+DEVICE_ON:
+ <variablelist>
+ <varlistentry>
+ <term>(*dev-&gt;deviceProc)(dev, DEVICE_ON)</term>
+ <listitem>
+ <para>This typically opens and
+ initializes the relevant physical device, and when appropriate,
+ registers the device's file descriptor (or equivalent) as a valid
+ input source.
+ </para></listitem></varlistentry>
+ </variablelist>
+ </para>
+
+ <para>EnableDevice() then adds the device handle to the X server's
+ global list of enabled devices.
+</para></listitem></varlistentry>
+</variablelist>
+</para>
+
+<para>InitAndStartDevices() then verifies that a valid core keyboard and
+pointer has been initialized and enabled. It returns failure if either
+are missing.
+</para>
+</sect3>
+
+<sect3>
+<title>devReadInput()</title>
+
+<para>Each device will have some function that gets called to read its
+physical input. These may be called in a number of different ways. In
+the case of synchronous I/O, they will be called from a DDX
+wakeup-handler that gets called after the server detects that new input is
+available. In the case of asynchronous I/O, they will be called from a
+(SIGIO) signal handler triggered when new input is available. This
+function should do at least two things: make sure that input events get
+enqueued, and make sure that the cursor gets moved for motion events
+(except if these are handled later by the driver's own event queue
+processing function, which cannot be done when using the MI event queue
+handling).
+</para>
+
+<para>Events are queued by calling mieqEnqueue():
+
+<variablelist>
+<varlistentry>
+<term>mieqEnqueue()</term>
+<listitem>
+<para>This MI function is used to add input events to the
+event queue. It is simply passed the event to be queued.
+</para></listitem></varlistentry>
+</variablelist>
+</para>
+
+<para>The cursor position should be updated when motion events are
+enqueued, by calling either miPointerAbsoluteCursor() or
+miPointerDeltaCursor():
+
+<variablelist>
+<varlistentry>
+<term>miPointerAbsoluteCursor()</term>
+<listitem>
+<para>This MI function is used to move the
+cursor to the absolute coordinates provided.
+</para></listitem></varlistentry>
+<varlistentry>
+<term>miPointerDeltaCursor()</term>
+<listitem>
+<para>This MI function is used to move the cursor
+relative to its current position.
+</para></listitem></varlistentry>
+</variablelist>
+</para>
+</sect3>
+
+<sect3>
+<title>ProcessInputEvents()</title>
+
+<para>ProcessInputEvents() is a DDX function that is called from the X
+server's main dispatch loop when new events are available in the input
+event queue. It typically processes the enqueued events, and updates
+the cursor/pointer position. It may also do other DDX-specific event
+processing.
+</para>
+
+<para>Enqueued events are processed by mieqProcessInputEvents() and passed
+to the DIX layer for transmission to clients:
+
+<variablelist>
+<varlistentry>
+<term>mieqProcessInputEvents()</term>
+<listitem>
+<para>This function processes each event in the
+event queue, and passes it to the device's input processing function.
+The DIX layer provides default functions to do this processing, and they
+handle the task of getting the events passed back to the relevant
+clients.
+</para></listitem></varlistentry>
+<varlistentry>
+<term>miPointerUpdate()</term>
+<listitem>
+<para>This function resynchronized the cursor position
+with the new pointer position. It also takes care of moving the cursor
+between screens when needed in multi-head configurations.
+</para></listitem></varlistentry>
+</variablelist>
+</para>
+
+</sect3>
+
+<sect3>
+<title>DisableDevice()</title>
+
+<para>DisableDevice is a DIX function that removes an input device from the
+list of enabled devices. The result of this is that the device no
+longer generates input events. The device's data structures are kept in
+place, and disabling a device like this can be reversed by calling
+EnableDevice(). DisableDevice() may be called from the DDX when it is
+desirable to do so (e.g., the XFree86 server does this when VT
+switching). Except for special cases, this is not normally called for
+core input devices.
+</para>
+
+<para>DisableDevice() calls the device's callback function with
+<constant>DEVICE_OFF</constant>:
+
+<variablelist>
+<varlistentry>
+<term>(*dev-&gt;deviceProc)(dev, DEVICE_OFF)</term>
+<listitem>
+<para>This typically closes the
+relevant physical device, and when appropriate, unregisters the device's
+file descriptor (or equivalent) as a valid input source.
+</para></listitem></varlistentry>
+</variablelist>
+</para>
+
+<para>DisableDevice() then removes the device handle from the X server's
+global list of enabled devices.
+</para>
+
+</sect3>
+
+<sect3>
+<title>CloseDevice()</title>
+
+<para>CloseDevice is a DIX function that removes an input device from the
+list of available devices. It disables input from the device and frees
+all data structures associated with the device. This function is
+usually called from CloseDownDevices(), which is called from main() at
+the end of each server generation to close all input devices.
+</para>
+
+<para>CloseDevice() calls the device's callback function with
+<constant>DEVICE_CLOSE</constant>:
+
+<variablelist>
+<varlistentry>
+<term>(*dev-&gt;deviceProc)(dev, DEVICE_CLOSE)</term>
+<listitem>
+<para>This typically closes the
+relevant physical device, and when appropriate, unregisters the device's
+file descriptor (or equivalent) as a valid input source. If any device
+specific data structures were allocated when the device was initialized,
+they are freed here.
+</para></listitem></varlistentry>
+</variablelist>
+</para>
+
+<para>CloseDevice() then frees the data structures that were allocated
+for the device when it was registered/initialized.
+</para>
+
+</sect3>
+
+<sect3>
+<title>LegalModifier()</title>
+<!-- dmx/dmxinput.c - currently returns TRUE -->
+<para>LegalModifier() is a required DDX function that can be used to
+restrict which keys may be modifier keys. This seems to be present for
+historical reasons, so this function should simply return TRUE
+unconditionally.
+</para>
+
+</sect3>
+</sect2>
+
+<sect2>
+<title>Output handling</title>
+
+<para>The following sections describe the main functions required to
+initialize, use and close the output device(s) for each screen in the X
+server.
+</para>
+
+<sect3>
+<title>InitOutput()</title>
+
+<para>This DDX function is called near the start of each server generation
+from the X server's main() function. InitOutput()'s main purpose is to
+initialize each screen and fill in the global screenInfo structure for
+each screen. It is passed three arguments: a pointer to the screenInfo
+struct, which it is to initialize, and argc and argv from main(), which
+can be used to determine additional configuration information.
+</para>
+
+<para>The primary tasks for this function are outlined below:
+
+<orderedlist>
+<listitem>
+ <para><emphasis remap="bf">Parse configuration info:</emphasis> The first task of InitOutput()
+ is to parses any configuration information from the configuration
+ file. In addition to the XF86Config file, other configuration
+ information can be taken from the command line. The command line
+ options can be gathered either in InitOutput() or earlier in the
+ ddxProcessArgument() function, which is called by
+ ProcessCommandLine(). The configuration information determines the
+ characteristics of the screen(s). For example, in the XFree86 X
+ server, the XF86Config file specifies the monitor information, the
+ screen resolution, the graphics devices and slots in which they are
+ located, and, for Xinerama, the screens' layout.
+</para>
+</listitem>
+
+<listitem>
+ <para><emphasis remap="bf">Initialize screen info:</emphasis> The next task is to initialize
+ the screen-dependent internal data structures. For example, part of
+ what the XFree86 X server does is to allocate its screen and pixmap
+ private indices, probe for graphics devices, compare the probed
+ devices to the ones listed in the XF86Config file, and add the ones that
+ match to the internal xf86Screens&lsqb;&rsqb; structure.
+</para>
+</listitem>
+
+<listitem>
+ <para><emphasis remap="bf">Set pixmap formats:</emphasis> The next task is to initialize the
+ screenInfo's image byte order, bitmap bit order and bitmap scanline
+ unit/pad. The screenInfo's pixmap format's depth, bits per pixel
+ and scanline padding is also initialized at this stage.
+</para>
+</listitem>
+
+<listitem>
+ <para><emphasis remap="bf">Unify screen info:</emphasis> An optional task that might be done at
+ this stage is to compare all of the information from the various
+ screens and determines if they are compatible (i.e., if the set of
+ screens can be unified into a single desktop). This task has
+ potential to be useful to the DMX front-end server, if Xinerama's
+ PanoramiXConsolidate() function is not sufficient.
+</para>
+</listitem>
+</orderedlist>
+</para>
+
+<para>Once these tasks are complete, the valid screens are known and each
+of these screens can be initialized by calling AddScreen().
+</para>
+</sect3>
+
+<sect3>
+<title>AddScreen()</title>
+
+<para>This DIX function is called from InitOutput(), in the DDX layer, to
+add each new screen to the screenInfo structure. The DDX screen
+initialization function and command line arguments (i.e., argc and argv)
+are passed to it as arguments.
+</para>
+
+<para>This function first allocates a new Screen structure and any privates
+that are required. It then initializes some of the fields in the Screen
+struct and sets up the pixmap padding information. Finally, it calls
+the DDX screen initialization function ScreenInit(), which is described
+below. It returns the number of the screen that were just added, or -1
+if there is insufficient memory to add the screen or if the DDX screen
+initialization fails.
+</para>
+</sect3>
+
+<sect3>
+<title>ScreenInit()</title>
+
+<para>This DDX function initializes the rest of the Screen structure with
+either generic or screen-specific functions (as necessary). It also
+fills in various screen attributes (e.g., width and height in
+millimeters, black and white pixel values).
+</para>
+
+<para>The screen init function usually calls several functions to perform
+certain screen initialization functions. They are described below:
+
+<variablelist>
+<varlistentry>
+<term>{mi,*fb}ScreenInit()</term>
+<listitem>
+<para>The DDX layer's ScreenInit() function usually
+calls another layer's ScreenInit() function (e.g., miScreenInit() or
+fbScreenInit()) to initialize the fallbacks that the DDX driver does not
+specifically handle.
+</para>
+
+<para>After calling another layer's ScreenInit() function, any
+screen-specific functions either wrap or replace the other layer's
+function pointers. If a function is to be wrapped, each of the old
+function pointers from the other layer are stored in a screen private
+area. Common functions to wrap are CloseScreen() and SaveScreen().
+</para></listitem></varlistentry>
+
+<varlistentry>
+<term>miInitializeBackingStore()</term>
+<listitem>
+<para>This MI function initializes the
+screen's backing storage functions, which are used to save areas of
+windows that are currently covered by other windows.
+</para></listitem></varlistentry>
+
+<varlistentry>
+<term>miDCInitialize()</term>
+<listitem>
+<para>This MI function initializes the MI cursor
+display structures and function pointers. If a hardware cursor is used,
+the DDX layer's ScreenInit() function will wrap additional screen and
+the MI cursor display function pointers.
+</para></listitem></varlistentry>
+</variablelist>
+</para>
+
+<para>Another common task for ScreenInit() function is to initialize the
+output device state. For example, in the XFree86 X server, the
+ScreenInit() function saves the original state of the video card and
+then initializes the video mode of the graphics device.
+</para>
+</sect3>
+
+<sect3>
+<title>CloseScreen()</title>
+
+<para>This function restores any wrapped screen functions (and in
+particular the wrapped CloseScreen() function) and restores the state of
+the output device to its original state. It should also free any
+private data it created during the screen initialization.
+</para>
+</sect3>
+
+<sect3>
+<title>GC operations</title>
+
+<para>When the X server is requested to render drawing primitives, it does
+so by calling drawing functions through the graphics context's operation
+function pointer table (i.e., the GCOps functions). These functions
+render the basic graphics operations such as drawing rectangles, lines,
+text or copying pixmaps. Default routines are provided either by the MI
+layer, which draws indirectly through a simple span interface, or by the
+framebuffer layers (e.g., CFB, MFB, FB), which draw directly to a
+linearly mapped frame buffer.
+</para>
+
+<para>To take advantage of special hardware on the graphics device,
+specific GCOps functions can be replaced by device specific code.
+However, many times the graphics devices can handle only a subset of the
+possible states of the GC, so during graphics context validation,
+appropriate routines are selected based on the state and capabilities of
+the hardware. For example, some graphics hardware can accelerate single
+pixel width lines with certain dash patterns. Thus, for dash patterns
+that are not supported by hardware or for width 2 or greater lines, the
+default routine is chosen during GC validation.
+</para>
+
+<para>Note that some pointers to functions that draw to the screen are
+stored in the Screen structure. They include GetImage(), GetSpans(),
+CopyWindow() and RestoreAreas().
+</para>
+</sect3>
+
+<sect3>
+<title>Xnest</title>
+
+<para>The Xnest X server is a special proxy X server that relays the X
+protocol requests that it receives to a ``real'' X server that then
+processes the requests and displays the results, if applicable. To the X
+applications, Xnest appears as if it is a regular X server. However,
+Xnest is both server to the X application and client of the real X
+server, which will actually handle the requests.
+</para>
+
+<para>The Xnest server implements all of the standard input and output
+initialization steps outlined above.
+</para>
+
+<para><variablelist>
+<varlistentry>
+<term>InitOutput()</term>
+<listitem>
+<para>Xnest takes its configuration information from
+command line arguments via ddxProcessArguments(). This information
+includes the real X server display to connect to, its default visual
+class, the screen depth, the Xnest window's geometry, etc. Xnest then
+connects to the real X server and gathers visual, colormap, depth and
+pixmap information about that server's display, creates a window on that
+server, which will be used as the root window for Xnest.
+</para>
+
+<para>Next, Xnest initializes its internal data structures and uses the
+data from the real X server's pixmaps to initialize its own pixmap
+formats. Finally, it calls AddScreen(xnestOpenScreen, argc, argv) to
+initialize each of its screens.
+</para></listitem></varlistentry>
+
+<varlistentry>
+<term>ScreenInit()</term>
+<listitem>
+<para>Xnest's ScreenInit() function is called
+xnestOpenScreen(). This function initializes its screen's depth and
+visual information, and then calls miScreenInit() to set up the default
+screen functions. It then calls miInitializeBackingStore() and
+miDCInitialize() to initialize backing store and the software cursor.
+Finally, it replaces many of the screen functions with its own
+functions that repackage and send the requests to the real X server to
+which Xnest is attached.
+</para></listitem></varlistentry>
+
+<varlistentry>
+<term>CloseScreen()</term>
+<listitem>
+<para>This function frees its internal data structure
+allocations. Since it replaces instead of wrapping screen functions,
+there are no function pointers to unwrap. This can potentially lead to
+problems during server regeneration.
+</para></listitem></varlistentry>
+
+<varlistentry>
+<term>GC operations</term>
+<listitem>
+<para>The GC operations in Xnest are very simple since
+they leave all of the drawing to the real X server to which Xnest is
+attached. Each of the GCOps takes the request and sends it to the
+real X server using standard Xlib calls. For example, the X
+application issues a XDrawLines() call. This function turns into a
+protocol request to Xnest, which calls the xnestPolylines() function
+through Xnest's GCOps function pointer table. The xnestPolylines()
+function is only a single line, which calls XDrawLines() using the same
+arguments that were passed into it. Other GCOps functions are very
+similar. Two exceptions to the simple GCOps functions described above
+are the image functions and the BLT operations.
+</para>
+
+<para>The image functions, GetImage() and PutImage(), must use a temporary
+image to hold the image to be put of the image that was just grabbed
+from the screen while it is in transit to the real X server or the
+client. When the image has been transmitted, the temporary image is
+destroyed.
+</para>
+
+<para>The BLT operations, CopyArea() and CopyPlane(), handle not only the
+copy function, which is the same as the simple cases described above,
+but also the graphics exposures that result when the GC's graphics
+exposure bit is set to True. Graphics exposures are handled in a helper
+function, xnestBitBlitHelper(). This function collects the exposure
+events from the real X server and, if any resulting in regions being
+exposed, then those regions are passed back to the MI layer so that it
+can generate exposure events for the X application.
+</para></listitem></varlistentry>
+</variablelist>
+</para>
+
+<para>The Xnest server takes its input from the X server to which it is
+connected. When the mouse is in the Xnest server's window, keyboard and
+mouse events are received by the Xnest server, repackaged and sent back
+to any client that requests those events.
+</para>
+</sect3>
+
+<sect3>
+<title>Shadow framebuffer</title>
+
+<para>The most common type of framebuffer is a linear array memory that
+maps to the video memory on the graphics device. However, accessing
+that video memory over an I/O bus (e.g., ISA or PCI) can be slow. The
+shadow framebuffer layer allows the developer to keep the entire
+framebuffer in main memory and copy it back to video memory at regular
+intervals. It also has been extended to handle planar video memory and
+rotated framebuffers.
+</para>
+
+<para>There are two main entry points to the shadow framebuffer code:
+
+<variablelist>
+<varlistentry>
+<term>shadowAlloc(width, height, bpp)</term>
+<listitem>
+<para>This function allocates the in
+memory copy of the framebuffer of size width*height*bpp. It returns a
+pointer to that memory, which will be used by the framebuffer
+ScreenInit() code during the screen's initialization.
+</para></listitem></varlistentry>
+
+<varlistentry>
+<term>shadowInit(pScreen, updateProc, windowProc)</term>
+<listitem>
+<para>This function
+initializes the shadow framebuffer layer. It wraps several screen
+drawing functions, and registers a block handler that will update the
+screen. The updateProc is a function that will copy the damaged regions
+to the screen, and the windowProc is a function that is used when the
+entire linear video memory range cannot be accessed simultaneously so
+that only a window into that memory is available (e.g., when using the
+VGA aperture).
+</para></listitem></varlistentry>
+</variablelist>
+</para>
+
+<para>The shadow framebuffer code keeps track of the damaged area of each
+screen by calculating the bounding box of all drawing operations that
+have occurred since the last screen update. Then, when the block handler
+is next called, only the damaged portion of the screen is updated.
+</para>
+
+<para>Note that since the shadow framebuffer is kept in main memory, all
+drawing operations are performed by the CPU and, thus, no accelerated
+hardware drawing operations are possible.
+</para>
+
+</sect3>
+</sect2>
+
+<sect2>
+<title>Xinerama</title>
+
+<para>Xinerama is an X extension that allows multiple physical screens
+controlled by a single X server to appear as a single screen. Although
+the extension allows clients to find the physical screen layout via
+extension requests, it is completely transparent to clients at the core
+X11 protocol level. The original public implementation of Xinerama came
+from Digital/Compaq. XFree86 rewrote it, filling in some missing pieces
+and improving both X11 core protocol compliance and performance. The
+Xinerama extension will be passing through X.Org's standardization
+process in the near future, and the sample implementation will be based
+on this rewritten version.
+</para>
+
+<para>The current implementation of Xinerama is based primarily in the DIX
+(device independent) and MI (machine independent) layers of the X
+server. With few exceptions the DDX layers do not need any changes to
+support Xinerama. X server extensions often do need modifications to
+provide full Xinerama functionality.
+</para>
+
+<para>The following is a code-level description of how Xinerama functions.
+</para>
+
+<para>Note: Because the Xinerama extension was originally called the
+PanoramiX extension, many of the Xinerama functions still have the
+PanoramiX prefix.
+</para>
+
+<variablelist>
+<varlistentry>
+<term>PanoramiXExtensionInit()</term>
+<listitem>
+ <para>PanoramiXExtensionInit() is a
+ device-independent extension function that is called at the start of
+ each server generation from InitExtensions(), which is called from
+ the X server's main() function after all output devices have been
+ initialized, but before any input devices have been initialized.
+ </para>
+
+ <para>PanoramiXNumScreens is set to the number of physical screens. If
+ only one physical screen is present, the extension is disabled, and
+ PanoramiXExtensionInit() returns without doing anything else.
+ </para>
+
+ <para>The Xinerama extension is registered by calling AddExtension().
+ </para>
+
+ <para>GC and Screen private
+ indexes are allocated, and both GC and Screen private areas are
+ allocated for each physical screen. These hold Xinerama-specific
+ per-GC and per-Screen data. Each screen's CreateGC and CloseScreen
+ functions are wrapped by XineramaCreateGC() and
+ XineramaCloseScreen() respectively. Some new resource classes are
+ created for Xinerama drawables and GCs, and resource types for
+ Xinerama windows, pixmaps and colormaps.
+ </para>
+
+ <para>A region (PanoramiXScreenRegion) is
+ initialized to be the union of the screen regions.
+ The relative positioning information for the
+ physical screens is taken from the ScreenRec x and y members, which
+ the DDX layer must initialize in InitOutput(). The bounds of the
+ combined screen is also calculated (PanoramiXPixWidth and
+ PanoramiXPixHeight).
+ </para>
+
+ <para>The DIX layer has a list of function pointers
+ (ProcVector&lsqb;&rsqb;) that
+ holds the entry points for the functions that process core protocol
+ requests. The requests that Xinerama must intercept and break up
+ into physical screen-specific requests are wrapped. The original
+ set is copied to SavedProcVector&lsqb;&rsqb;. The types of requests
+ intercepted are Window requests, GC requests, colormap requests,
+ drawing requests, and some geometry-related requests. This wrapping
+ allows the bulk of the protocol request processing to be handled
+ transparently to the DIX layer. Some operations cannot be dealt with
+ in this way and are handled with Xinerama-specific code within the
+ DIX layer.
+ </para>
+</listitem></varlistentry>
+
+<varlistentry>
+<term>PanoramiXConsolidate()</term>
+<listitem>
+ <para>PanoramiXConsolidate() is a
+ device-independent extension function that is called directly from
+ the X server's main() function after extensions and input/output
+ devices have been initialized, and before the root windows are
+ defined and initialized.
+</para>
+
+ <para>This function finds the set of depths (PanoramiXDepths&lsqb;&rsqb;) and
+ visuals (PanoramiXVisuals&lsqb;&rsqb;)
+ common to all of the physical screens.
+ PanoramiXNumDepths is set to the number of common depths, and
+ PanoramiXNumVisuals is set to the number of common visuals.
+ Resources are created for the single root window and the default
+ colormap. Each of these resources has per-physical screen entries.
+ </para>
+</listitem></varlistentry>
+
+<varlistentry>
+<term>PanoramiXCreateConnectionBlock()</term>
+<listitem>
+ <para>PanoramiXConsolidate() is a
+ device-independent extension function that is called directly from
+ the X server's main() function after the per-physical screen root
+ windows are created. It is called instead of the standard DIX
+ CreateConnectionBlock() function. If this function returns FALSE,
+ the X server exits with a fatal error. This function will return
+ FALSE if no common depths were found in PanoramiXConsolidate().
+ With no common depths, Xinerama mode is not possible.
+ </para>
+
+ <para>The connection block holds the information that clients get when
+ they open a connection to the X server. It includes information
+ such as the supported pixmap formats, number of screens and the
+ sizes, depths, visuals, default colormap information, etc, for each
+ of the screens (much of information that <command>xdpyinfo</command> shows). The
+ connection block is initialized with the combined single screen
+ values that were calculated in the above two functions.
+ </para>
+
+ <para>The Xinerama extension allows the registration of connection
+ block callback functions. The purpose of these is to allow other
+ extensions to do processing at this point. These callbacks can be
+ registered by calling XineramaRegisterConnectionBlockCallback() from
+ the other extension's ExtensionInit() function. Each registered
+ connection block callback is called at the end of
+ PanoramiXCreateConnectionBlock().
+ </para>
+</listitem></varlistentry>
+</variablelist>
+
+<sect3>
+<title>Xinerama-specific changes to the DIX code</title>
+
+<para>There are a few types of Xinerama-specific changes within the DIX
+code. The main ones are described here.
+</para>
+
+<para>Functions that deal with colormap or GC -related operations outside of
+the intercepted protocol requests have a test added to only do the
+processing for screen numbers &gt; 0. This is because they are handled for
+the single Xinerama screen and the processing is done once for screen 0.
+</para>
+
+<para>The handling of motion events does some coordinate translation between
+the physical screen's origin and screen zero's origin. Also, motion
+events must be reported relative to the composite screen origin rather
+than the physical screen origins.
+</para>
+
+<para>There is some special handling for cursor, window and event processing
+that cannot (either not at all or not conveniently) be done via the
+intercepted protocol requests. A particular case is the handling of
+pointers moving between physical screens.
+</para>
+</sect3>
+
+<sect3>
+<title>Xinerama-specific changes to the MI code</title>
+
+<para>The only Xinerama-specific change to the MI code is in miSendExposures()
+to handle the coordinate (and window ID) translation for expose events.
+</para>
+</sect3>
+
+<sect3>
+<title>Intercepted DIX core requests</title>
+
+<para>Xinerama breaks up drawing requests for dispatch to each physical
+screen. It also breaks up windows into pieces for each physical screen.
+GCs are translated into per-screen GCs. Colormaps are replicated on
+each physical screen. The functions handling the intercepted requests
+take care of breaking the requests and repackaging them so that they can
+be passed to the standard request handling functions for each screen in
+turn. In addition, and to aid the repackaging, the information from
+many of the intercepted requests is used to keep up to date the
+necessary state information for the single composite screen. Requests
+(usually those with replies) that can be satisfied completely from this
+stored state information do not call the standard request handling
+functions.
+</para>
+
+</sect3>
+
+</sect2>
+
+</sect1>
+
+<!-- ============================================================ -->
+
+<sect1>
+<title>Development Results</title>
+
+<para>In this section the results of each phase of development are
+discussed. This development took place between approximately June 2001
+and July 2003.
+</para>
+
+<sect2>
+<title>Phase I</title>
+
+<para>The initial development phase dealt with the basic implementation
+including the bootstrap code, which used the shadow framebuffer, and the
+unoptimized implementation, based on an Xnest-style implementation.
+</para>
+
+<sect3>
+<title>Scope</title>
+
+<para>The goal of Phase I is to provide fundamental functionality that can
+act as a foundation for ongoing work:
+<orderedlist>
+<listitem>
+ <para>Develop the proxy X server
+ <itemizedlist>
+ <listitem>
+ <para>The proxy X server will operate on the X11 protocol and
+ relay requests as necessary to correctly perform the request.
+ </para></listitem>
+ <listitem>
+ <para>Work will be based on the existing work for Xinerama and
+ Xnest.
+ </para></listitem>
+ <listitem>
+ <para>Input events and windowing operations are handled in the
+ proxy server and rendering requests are repackaged and sent to
+ each of the back-end servers for display.
+ </para></listitem>
+ <listitem>
+ <para>The multiple screen layout (including support for
+ overlapping screens) will be user configurable via a
+ configuration file or through the configuration tool.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem>
+ <para>Develop graphical configuration tool
+ <itemizedlist>
+ <listitem>
+ <para>There will be potentially a large number of X servers to
+ configure into a single display. The tool will allow the user
+ to specify which servers are involved in the configuration and
+ how they should be laid out.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+ <listitem>
+ <para>Pass the X Test Suite
+ <itemizedlist>
+ <listitem>
+ <para>The X Test Suite covers the basic X11 operations. All
+ tests known to succeed must correctly operate in the distributed
+ X environment.
+ </para></listitem>
+ </itemizedlist>
+ </para></listitem>
+</orderedlist>
+
+</para>
+
+<para>For this phase, the back-end X servers are assumed to be unmodified X
+servers that do not support any DMX-related protocol extensions; future
+optimization pathways are considered, but are not implemented; and the
+configuration tool is assumed to rely only on libraries in the X source
+tree (e.g., Xt).
+</para>
+</sect3>
+
+<sect3>
+<title>Results</title>
+
+<para>The proxy X server, Xdmx, was developed to distribute X11 protocol
+requests to the set of back-end X servers. It opens a window on each
+back-end server, which represents the part of the front-end's root
+window that is visible on that screen. It mirrors window, pixmap and
+other state in each back-end server. Drawing requests are sent to
+either windows or pixmaps on each back-end server. This code is based
+on Xnest and uses the existing Xinerama extension.
+</para>
+
+<para>Input events can be taken from (1) devices attached to the back-end
+server, (2) core devices attached directly to the Xdmx server, or (3)
+from a ``console'' window on another X server. Events for these devices
+are gathered, processed and delivered to clients attached to the Xdmx
+server.
+</para>
+
+<para>An intuitive configuration format was developed to help the user
+easily configure the multiple back-end X servers. It was defined (see
+grammar in Xdmx man page) and a parser was implemented that is used by
+the Xdmx server and by a standalone xdmxconfig utility. The parsing
+support was implemented such that it can be easily factored out of the X
+source tree for use with other tools (e.g., vdl). Support for
+converting legacy vdl-format configuration files to the DMX format is
+provided by the vdltodmx utility.
+</para>
+
+<para>Originally, the configuration file was going to be a subsection of
+XFree86's XF86Config file, but that was not possible since Xdmx is a
+completely separate X server. Thus, a separate config file format was
+developed. In addition, a graphical configuration
+tool, xdmxconfig, was developed to allow the user to create and arrange
+the screens in the configuration file. The <emphasis remap="bf">-configfile</emphasis> and <emphasis remap="bf">-config</emphasis>
+command-line options can be used to start Xdmx using a configuration
+file.
+</para>
+
+<para>An extension that enables remote input testing is required for the X
+Test Suite to function. During this phase, this extension (XTEST) was
+implemented in the Xdmx server. The results from running the X Test
+Suite are described in detail below.
+</para>
+</sect3>
+
+<sect3>
+<title>X Test Suite</title>
+
+ <sect4>
+ <title>Introduction</title>
+ <para>
+ The X Test Suite contains tests that verify Xlib functions
+ operate correctly. The test suite is designed to run on a
+ single X server; however, since X applications will not be
+ able to tell the difference between the DMX server and a
+ standard X server, the X Test Suite should also run on the
+ DMX server.
+ </para>
+ <para>
+ The Xdmx server was tested with the X Test Suite, and the
+ existing failures are noted in this section. To put these
+ results in perspective, we first discuss expected X Test
+ failures and how errors in underlying systems can impact
+ Xdmx test results.
+ </para>
+ </sect4>
+
+ <sect4>
+ <title>Expected Failures for a Single Head</title>
+ <para>
+ A correctly implemented X server with a single screen is
+ expected to fail certain X Test tests. The following
+ well-known errors occur because of rounding error in the X
+ server code:
+ <literallayout>
+XDrawArc: Tests 42, 63, 66, 73
+XDrawArcs: Tests 45, 66, 69, 76
+ </literallayout>
+ </para>
+ <para>
+ The following failures occur because of the high-level X
+ server implementation:
+ <literallayout>
+XLoadQueryFont: Test 1
+XListFontsWithInfo: Tests 3, 4
+XQueryFont: Tests 1, 2
+ </literallayout>
+ </para>
+ <para>
+ The following test fails when running the X server as root
+ under Linux because of the way directory modes are
+ interpreted:
+ <literallayout>
+XWriteBitmapFile: Test 3
+ </literallayout>
+ </para>
+ <para>
+ Depending on the video card used for the back-end, other
+ failures may also occur because of bugs in the low-level
+ driver implementation. Over time, failures of this kind
+ are usually fixed by XFree86, but will show up in Xdmx
+ testing until then.
+ </para>
+ </sect4>
+
+ <sect4>
+ <title>Expected Failures for Xinerama</title>
+ <para>
+ Xinerama fails several X Test Suite tests because of
+ design decisions made for the current implementation of
+ Xinerama. Over time, many of these errors will be
+ corrected by XFree86 and the group working on a new
+ Xinerama implementation. Therefore, Xdmx will also share
+ X Suite Test failures with Xinerama.
+ </para>
+
+ <para>
+ We may be able to fix or work-around some of these
+ failures at the Xdmx level, but this will require
+ additional exploration that was not part of Phase I.
+ </para>
+
+ <para>
+ Xinerama is constantly improving, and the list of
+ Xinerama-related failures depends on XFree86 version and
+ the underlying graphics hardware. We tested with a
+ variety of hardware, including nVidia, S3, ATI Radeon,
+ and Matrox G400 (in dual-head mode). The list below
+ includes only those failures that appear to be from the
+ Xinerama layer, and does not include failures listed in
+ the previous section, or failures that appear to be from
+ the low-level graphics driver itself:
+ </para>
+
+ <para>
+ These failures were noted with multiple Xinerama
+ configurations:
+ <literallayout>
+XCopyPlane: Tests 13, 22, 31 (well-known Xinerama implementation issue)
+XSetFontPath: Test 4
+XGetDefault: Test 5
+XMatchVisualInfo: Test 1
+ </literallayout>
+ </para>
+ <para>
+ These failures were noted only when using one dual-head
+ video card with a 4.2.99.x XFree86 server:
+ <literallayout>
+XListPixmapFormats: Test 1
+XDrawRectangles: Test 45
+ </literallayout>
+ </para>
+ <para>
+ These failures were noted only when using two video cards
+ from different vendors with a 4.1.99.x XFree86 server:
+ <literallayout>
+XChangeWindowAttributes: Test 32
+XCreateWindow: Test 30
+XDrawLine: Test 22
+XFillArc: Test 22
+XChangeKeyboardControl: Tests 9, 10
+XRebindKeysym: Test 1
+ </literallayout>
+ </para>
+ </sect4>
+
+ <sect4>
+ <title>Additional Failures from Xdmx</title>
+
+ <para>
+ When running Xdmx, no unexpected failures were noted.
+ Since the Xdmx server is based on Xinerama, we expect to
+ have most of the Xinerama failures present in the Xdmx
+ server. Similarly, since the Xdmx server must rely on the
+ low-level device drivers on each back-end server, we also
+ expect that Xdmx will exhibit most of the back-end
+ failures. Here is a summary:
+ <literallayout>
+XListPixmapFormats: Test 1 (configuration dependent)
+XChangeWindowAttributes: Test 32
+XCreateWindow: Test 30
+XCopyPlane: Test 13, 22, 31
+XSetFontPath: Test 4
+XGetDefault: Test 5 (configuration dependent)
+XMatchVisualInfo: Test 1
+XRebindKeysym: Test 1 (configuration dependent)
+ </literallayout>
+ </para>
+ <para>
+ Note that this list is shorter than the combined list for
+ Xinerama because Xdmx uses different code paths to perform
+ some Xinerama operations. Further, some Xinerama failures
+ have been fixed in the XFree86 4.2.99.x CVS repository.
+ </para>
+ </sect4>
+
+ <sect4>
+ <title>Summary and Future Work</title>
+
+ <para>
+ Running the X Test Suite on Xdmx does not produce any
+ failures that cannot be accounted for by the underlying
+ Xinerama subsystem used by the front-end or by the
+ low-level device-driver code running on the back-end X
+ servers. The Xdmx server therefore is as ``correct'' as
+ possible with respect to the standard set of X Test Suite
+ tests.
+ </para>
+
+ <para>
+ During the following phases, we will continue to verify
+ Xdmx correctness using the X Test Suite. We may also use
+ other tests suites or write additional tests that run
+ under the X Test Suite that specifically verify the
+ expected behavior of DMX.
+ </para>
+ </sect4>
+</sect3>
+
+<sect3>
+<title>Fonts</title>
+
+<para>In Phase I, fonts are handled directly by both the front-end and the
+back-end servers, which is required since we must treat each back-end
+server during this phase as a ``black box''. What this requires is that
+<emphasis remap="bf">the front- and back-end servers must share the exact same font
+path</emphasis>. There are two ways to help make sure that all servers share the
+same font path:
+
+<orderedlist>
+ <listitem>
+ <para>First, each server can be configured to use the same font
+ server. The font server, xfs, can be configured to serve fonts to
+ multiple X servers via TCP.
+ </para></listitem>
+
+ <listitem>
+ <para>Second, each server can be configured to use the same font
+ path and either those font paths can be copied to each back-end
+ machine or they can be mounted (e.g., via NFS) on each back-end
+ machine.
+ </para></listitem>
+</orderedlist>
+</para>
+
+<para>One additional concern is that a client program can set its own font
+path, and if it does so, then that font path must be available on each
+back-end machine.
+</para>
+
+<para>The -fontpath command line option was added to allow users to
+initialize the font path of the front end server. This font path is
+propagated to each back-end server when the default font is loaded. If
+there are any problems, an error message is printed, which will describe
+the problem and list the current font path. For more information about
+setting the font path, see the -fontpath option description in the man
+page.
+</para>
+</sect3>
+
+<sect3>
+<title>Performance</title>
+
+<para>Phase I of development was not intended to optimize performance. Its
+focus was on completely and correctly handling the base X11 protocol in
+the Xdmx server. However, several insights were gained during Phase I,
+which are listed here for reference during the next phase of
+development.
+</para>
+
+<orderedlist>
+ <listitem>
+ <para>Calls to XSync() can slow down rendering since it requires a
+ complete round trip to and from a back-end server. This is
+ especially problematic when communicating over long haul networks.
+ </para></listitem>
+
+ <listitem>
+ <para>Sending drawing requests to only the screens that they overlap
+ should improve performance.
+ </para></listitem>
+</orderedlist>
+</sect3>
+
+<sect3>
+<title>Pixmaps</title>
+
+<para>Pixmaps were originally expected to be handled entirely in the
+front-end X server; however, it was found that this overly complicated
+the rendering code and would have required sending potentially large
+images to each back server that required them when copying from pixmap
+to screen. Thus, pixmap state is mirrored in the back-end server just
+as it is with regular window state. With this implementation, the same
+rendering code that draws to windows can be used to draw to pixmaps on
+the back-end server, and no large image transfers are required to copy
+from pixmap to window.
+</para>
+
+</sect3>
+
+</sect2>
+
+<!-- ============================================================ -->
+<sect2>
+<title>Phase II</title>
+
+<para>The second phase of development concentrates on performance
+optimizations. These optimizations are documented here, with
+<command>x11perf</command> data to show how the optimizations improve performance.
+</para>
+
+<para>All benchmarks were performed by running Xdmx on a dual processor
+1.4GHz AMD Athlon machine with 1GB of RAM connecting over 100baseT to
+two single-processor 1GHz Pentium III machines with 256MB of RAM and ATI
+Rage 128 (RF) video cards. The front end was running Linux
+2.4.20-pre1-ac1 and the back ends were running Linux 2.4.7-10 and
+version 4.2.99.1 of XFree86 pulled from the XFree86 CVS repository on
+August 7, 2002. All systems were running Red Hat Linux 7.2.
+</para>
+
+<sect3>
+<title>Moving from XFree86 4.1.99.1 to 4.2.0.0</title>
+
+<para>For phase II, the working source tree was moved to the branch tagged
+with dmx-1-0-branch and was updated from version 4.1.99.1 (20 August
+2001) of the XFree86 sources to version 4.2.0.0 (18 January 2002).
+After this update, the following tests were noted to be more than 10%
+faster:
+<screen>
+1.13 Fill 300x300 opaque stippled trapezoid (161x145 stipple)
+1.16 Fill 1x1 tiled trapezoid (161x145 tile)
+1.13 Fill 10x10 tiled trapezoid (161x145 tile)
+1.17 Fill 100x100 tiled trapezoid (161x145 tile)
+1.16 Fill 1x1 tiled trapezoid (216x208 tile)
+1.20 Fill 10x10 tiled trapezoid (216x208 tile)
+1.15 Fill 100x100 tiled trapezoid (216x208 tile)
+1.37 Circulate Unmapped window (200 kids)
+</screen>
+And the following tests were noted to be more than 10% slower:
+<screen>
+0.88 Unmap window via parent (25 kids)
+0.75 Circulate Unmapped window (4 kids)
+0.79 Circulate Unmapped window (16 kids)
+0.80 Circulate Unmapped window (25 kids)
+0.82 Circulate Unmapped window (50 kids)
+0.85 Circulate Unmapped window (75 kids)
+</screen>
+</para>
+
+<para>These changes were not caused by any changes in the DMX system, and
+may point to changes in the XFree86 tree or to tests that have more
+"jitter" than most other <command>x11perf</command> tests.
+</para>
+</sect3>
+
+<sect3>
+<title>Global changes</title>
+
+<para>During the development of the Phase II DMX server, several global
+changes were made. These changes were also compared with the Phase I
+server. The following tests were noted to be more than 10% faster:
+<screen>
+1.13 Fill 300x300 opaque stippled trapezoid (161x145 stipple)
+1.15 Fill 1x1 tiled trapezoid (161x145 tile)
+1.13 Fill 10x10 tiled trapezoid (161x145 tile)
+1.17 Fill 100x100 tiled trapezoid (161x145 tile)
+1.16 Fill 1x1 tiled trapezoid (216x208 tile)
+1.19 Fill 10x10 tiled trapezoid (216x208 tile)
+1.15 Fill 100x100 tiled trapezoid (216x208 tile)
+1.15 Circulate Unmapped window (4 kids)
+</screen>
+</para>
+
+<para>The following tests were noted to be more than 10% slower:
+<screen>
+0.69 Scroll 10x10 pixels
+0.68 Scroll 100x100 pixels
+0.68 Copy 10x10 from window to window
+0.68 Copy 100x100 from window to window
+0.76 Circulate Unmapped window (75 kids)
+0.83 Circulate Unmapped window (100 kids)
+</screen>
+</para>
+
+<para>For the remainder of this analysis, the baseline of comparison will
+be the Phase II deliverable with all optimizations disabled (unless
+otherwise noted). This will highlight how the optimizations in
+isolation impact performance.
+</para>
+</sect3>
+
+<sect3>
+<title>XSync() Batching</title>
+
+<para>During the Phase I implementation, XSync() was called after every
+protocol request made by the DMX server. This provided the DMX server
+with an interactive feel, but defeated X11's protocol buffering system
+and introduced round-trip wire latency into every operation. During
+Phase II, DMX was changed so that protocol requests are no longer
+followed by calls to XSync(). Instead, the need for an XSync() is
+noted, and XSync() calls are only made every 100mS or when the DMX
+server specifically needs to make a call to guarantee interactivity.
+With this new system, X11 buffers protocol as much as possible during a
+100mS interval, and many unnecessary XSync() calls are avoided.
+</para>
+
+<para>Out of more than 300 <command>x11perf</command> tests, 8 tests became more than 100
+times faster, with 68 more than 50X faster, 114 more than 10X faster,
+and 181 more than 2X faster. See table below for summary.
+</para>
+
+<para>The following tests were noted to be more than 10% slower with
+XSync() batching on:
+<screen>
+0.88 500x500 tiled rectangle (161x145 tile)
+0.89 Copy 500x500 from window to window
+</screen>
+</para>
+</sect3>
+
+<sect3>
+<title>Offscreen Optimization</title>
+
+<para>Windows span one or more of the back-end servers' screens; however,
+during Phase I development, windows were created on every back-end
+server and every rendering request was sent to every window regardless
+of whether or not that window was visible. With the offscreen
+optimization, the DMX server tracks when a window is completely off of a
+back-end server's screen and, in that case, it does not send rendering
+requests to those back-end windows. This optimization saves bandwidth
+between the front and back-end servers, and it reduces the number of
+XSync() calls. The performance tests were run on a DMX system with only
+two back-end servers. Greater performance gains will be had as the
+number of back-end servers increases.
+</para>
+
+<para>Out of more than 300 <command>x11perf</command> tests, 3 tests were at least twice as
+fast, and 146 tests were at least 10% faster. Two tests were more than
+10% slower with the offscreen optimization:
+<screen>
+0.88 Hide/expose window via popup (4 kids)
+0.89 Resize unmapped window (75 kids)
+</screen>
+</para>
+</sect3>
+
+<sect3>
+<title>Lazy Window Creation Optimization</title>
+
+<para>As mentioned above, during Phase I, windows were created on every
+back-end server even if they were not visible on that back-end. With
+the lazy window creation optimization, the DMX server does not create
+windows on a back-end server until they are either visible or they
+become the parents of a visible window. This optimization builds on the
+offscreen optimization (described above) and requires it to be enabled.
+</para>
+
+<para>The lazy window creation optimization works by creating the window
+data structures in the front-end server when a client creates a window,
+but delays creation of the window on the back-end server(s). A private
+window structure in the DMX server saves the relevant window data and
+tracks changes to the window's attributes and stacking order for later
+use. The only times a window is created on a back-end server are (1)
+when it is mapped and is at least partially overlapping the back-end
+server's screen (tracked by the offscreen optimization), or (2) when the
+window becomes the parent of a previously visible window. The first
+case occurs when a window is mapped or when a visible window is copied,
+moved or resized and now overlaps the back-end server's screen. The
+second case occurs when starting a window manager after having created
+windows to which the window manager needs to add decorations.
+</para>
+
+<para>When either case occurs, a window on the back-end server is created
+using the data saved in the DMX server's window private data structure.
+The stacking order is then adjusted to correctly place the window on the
+back-end and lastly the window is mapped. From this time forward, the
+window is handled exactly as if the window had been created at the time
+of the client's request.
+</para>
+
+<para>Note that when a window is no longer visible on a back-end server's
+screen (e.g., it is moved offscreen), the window is not destroyed;
+rather, it is kept and reused later if the window once again becomes
+visible on the back-end server's screen. Originally with this
+optimization, destroying windows was implemented but was later rejected
+because it increased bandwidth when windows were opaquely moved or
+resized, which is common in many window managers.
+</para>
+
+<para>The performance tests were run on a DMX system with only two back-end
+servers. Greater performance gains will be had as the number of
+back-end servers increases.
+</para>
+
+<para>This optimization improved the following <command>x11perf</command> tests by more
+than 10%:
+<screen>
+1.10 500x500 rectangle outline
+1.12 Fill 100x100 stippled trapezoid (161x145 stipple)
+1.20 Circulate Unmapped window (50 kids)
+1.19 Circulate Unmapped window (75 kids)
+</screen>
+</para>
+</sect3>
+
+<sect3>
+<title>Subdividing Rendering Primitives</title>
+
+<para>X11 imaging requests transfer significant data between the client and
+the X server. During Phase I, the DMX server would then transfer the
+image data to each back-end server. Even with the offscreen
+optimization (above), these requests still required transferring
+significant data to each back-end server that contained a visible
+portion of the window. For example, if the client uses XPutImage() to
+copy an image to a window that overlaps the entire DMX screen, then the
+entire image is copied by the DMX server to every back-end server.
+</para>
+
+<para>To reduce the amount of data transferred between the DMX server and
+the back-end servers when XPutImage() is called, the image data is
+subdivided and only the data that will be visible on a back-end server's
+screen is sent to that back-end server. Xinerama already implements a
+subdivision algorithm for XGetImage() and no further optimization was
+needed.
+</para>
+
+<para>Other rendering primitives were analyzed, but the time required to
+subdivide these primitives was a significant proportion of the time
+required to send the entire rendering request to the back-end server, so
+this optimization was rejected for the other rendering primitives.
+</para>
+
+<para>Again, the performance tests were run on a DMX system with only two
+back-end servers. Greater performance gains will be had as the number
+of back-end servers increases.
+</para>
+
+<para>This optimization improved the following <command>x11perf</command> tests by more
+than 10%:
+<screen>
+1.12 Fill 100x100 stippled trapezoid (161x145 stipple)
+1.26 PutImage 10x10 square
+1.83 PutImage 100x100 square
+1.91 PutImage 500x500 square
+1.40 PutImage XY 10x10 square
+1.48 PutImage XY 100x100 square
+1.50 PutImage XY 500x500 square
+1.45 Circulate Unmapped window (75 kids)
+1.74 Circulate Unmapped window (100 kids)
+</screen>
+</para>
+
+<para>The following test was noted to be more than 10% slower with this
+optimization:
+<screen>
+0.88 10-pixel fill chord partial circle
+</screen>
+</para>
+</sect3>
+
+<sect3>
+<title>Summary of x11perf Data</title>
+
+<para>With all of the optimizations on, 53 <command>x11perf</command> tests are more than
+100X faster than the unoptimized Phase II deliverable, with 69 more than
+50X faster, 73 more than 10X faster, and 199 more than twice as fast.
+No tests were more than 10% slower than the unoptimized Phase II
+deliverable. (Compared with the Phase I deliverable, only Circulate
+Unmapped window (100 kids) was more than 10% slower than the Phase II
+deliverable. As noted above, this test seems to have wider variability
+than other <command>x11perf</command> tests.)
+</para>
+
+<para>The following table summarizes relative <command>x11perf</command> test changes for
+all optimizations individually and collectively. Note that some of the
+optimizations have a synergistic effect when used together.
+<screen>
+
+1: XSync() batching only
+2: Off screen optimizations only
+3: Window optimizations only
+4: Subdivprims only
+5: All optimizations
+
+ 1 2 3 4 5 Operation
+------ ---- ---- ---- ------ ---------
+ 2.14 1.85 1.00 1.00 4.13 Dot
+ 1.67 1.80 1.00 1.00 3.31 1x1 rectangle
+ 2.38 1.43 1.00 1.00 2.44 10x10 rectangle
+ 1.00 1.00 0.92 0.98 1.00 100x100 rectangle
+ 1.00 1.00 1.00 1.00 1.00 500x500 rectangle
+ 1.83 1.85 1.05 1.06 3.54 1x1 stippled rectangle (8x8 stipple)
+ 2.43 1.43 1.00 1.00 2.41 10x10 stippled rectangle (8x8 stipple)
+ 0.98 1.00 1.00 1.00 1.00 100x100 stippled rectangle (8x8 stipple)
+ 1.00 1.00 1.00 1.00 0.98 500x500 stippled rectangle (8x8 stipple)
+ 1.75 1.75 1.00 1.00 3.40 1x1 opaque stippled rectangle (8x8 stipple)
+ 2.38 1.42 1.00 1.00 2.34 10x10 opaque stippled rectangle (8x8 stipple)
+ 1.00 1.00 0.97 0.97 1.00 100x100 opaque stippled rectangle (8x8 stipple)
+ 1.00 1.00 1.00 1.00 0.99 500x500 opaque stippled rectangle (8x8 stipple)
+ 1.82 1.82 1.04 1.04 3.56 1x1 tiled rectangle (4x4 tile)
+ 2.33 1.42 1.00 1.00 2.37 10x10 tiled rectangle (4x4 tile)
+ 1.00 0.92 1.00 1.00 1.00 100x100 tiled rectangle (4x4 tile)
+ 1.00 1.00 1.00 1.00 1.00 500x500 tiled rectangle (4x4 tile)
+ 1.94 1.62 1.00 1.00 3.66 1x1 stippled rectangle (17x15 stipple)
+ 1.74 1.28 1.00 1.00 1.73 10x10 stippled rectangle (17x15 stipple)
+ 1.00 1.00 1.00 0.89 0.98 100x100 stippled rectangle (17x15 stipple)
+ 1.00 1.00 1.00 1.00 0.98 500x500 stippled rectangle (17x15 stipple)
+ 1.94 1.62 1.00 1.00 3.67 1x1 opaque stippled rectangle (17x15 stipple)
+ 1.69 1.26 1.00 1.00 1.66 10x10 opaque stippled rectangle (17x15 stipple)
+ 1.00 0.95 1.00 1.00 1.00 100x100 opaque stippled rectangle (17x15 stipple)
+ 1.00 1.00 1.00 1.00 0.97 500x500 opaque stippled rectangle (17x15 stipple)
+ 1.93 1.61 0.99 0.99 3.69 1x1 tiled rectangle (17x15 tile)
+ 1.73 1.27 1.00 1.00 1.72 10x10 tiled rectangle (17x15 tile)
+ 1.00 1.00 1.00 1.00 0.98 100x100 tiled rectangle (17x15 tile)
+ 1.00 1.00 0.97 0.97 1.00 500x500 tiled rectangle (17x15 tile)
+ 1.95 1.63 1.00 1.00 3.83 1x1 stippled rectangle (161x145 stipple)
+ 1.80 1.30 1.00 1.00 1.83 10x10 stippled rectangle (161x145 stipple)
+ 0.97 1.00 1.00 1.00 1.01 100x100 stippled rectangle (161x145 stipple)
+ 1.00 1.00 1.00 1.00 0.98 500x500 stippled rectangle (161x145 stipple)
+ 1.95 1.63 1.00 1.00 3.56 1x1 opaque stippled rectangle (161x145 stipple)
+ 1.65 1.25 1.00 1.00 1.68 10x10 opaque stippled rectangle (161x145 stipple)
+ 1.00 1.00 1.00 1.00 1.01 100x100 opaque stippled rectangle (161x145...
+ 1.00 1.00 1.00 1.00 0.97 500x500 opaque stippled rectangle (161x145...
+ 1.95 1.63 0.98 0.99 3.80 1x1 tiled rectangle (161x145 tile)
+ 1.67 1.26 1.00 1.00 1.67 10x10 tiled rectangle (161x145 tile)
+ 1.13 1.14 1.14 1.14 1.14 100x100 tiled rectangle (161x145 tile)
+ 0.88 1.00 1.00 1.00 0.99 500x500 tiled rectangle (161x145 tile)
+ 1.93 1.63 1.00 1.00 3.53 1x1 tiled rectangle (216x208 tile)
+ 1.69 1.26 1.00 1.00 1.66 10x10 tiled rectangle (216x208 tile)
+ 1.00 1.00 1.00 1.00 1.00 100x100 tiled rectangle (216x208 tile)
+ 1.00 1.00 1.00 1.00 1.00 500x500 tiled rectangle (216x208 tile)
+ 1.82 1.70 1.00 1.00 3.38 1-pixel line segment
+ 2.07 1.56 0.90 1.00 3.31 10-pixel line segment
+ 1.29 1.10 1.00 1.00 1.27 100-pixel line segment
+ 1.05 1.06 1.03 1.03 1.09 500-pixel line segment
+ 1.30 1.13 1.00 1.00 1.29 100-pixel line segment (1 kid)
+ 1.32 1.15 1.00 1.00 1.32 100-pixel line segment (2 kids)
+ 1.33 1.16 1.00 1.00 1.33 100-pixel line segment (3 kids)
+ 1.92 1.64 1.00 1.00 3.73 10-pixel dashed segment
+ 1.34 1.16 1.00 1.00 1.34 100-pixel dashed segment
+ 1.24 1.11 0.99 0.97 1.23 100-pixel double-dashed segment
+ 1.72 1.77 1.00 1.00 3.25 10-pixel horizontal line segment
+ 1.83 1.66 1.01 1.00 3.54 100-pixel horizontal line segment
+ 1.86 1.30 1.00 1.00 1.84 500-pixel horizontal line segment
+ 2.11 1.52 1.00 0.99 3.02 10-pixel vertical line segment
+ 1.21 1.10 1.00 1.00 1.20 100-pixel vertical line segment
+ 1.03 1.03 1.00 1.00 1.02 500-pixel vertical line segment
+ 4.42 1.68 1.00 1.01 4.64 10x1 wide horizontal line segment
+ 1.83 1.31 1.00 1.00 1.83 100x10 wide horizontal line segment
+ 1.07 1.00 0.96 1.00 1.07 500x50 wide horizontal line segment
+ 4.10 1.67 1.00 1.00 4.62 10x1 wide vertical line segment
+ 1.50 1.24 1.06 1.06 1.48 100x10 wide vertical line segment
+ 1.06 1.03 1.00 1.00 1.05 500x50 wide vertical line segment
+ 2.54 1.61 1.00 1.00 3.61 1-pixel line
+ 2.71 1.48 1.00 1.00 2.67 10-pixel line
+ 1.19 1.09 1.00 1.00 1.19 100-pixel line
+ 1.04 1.02 1.00 1.00 1.03 500-pixel line
+ 2.68 1.51 0.98 1.00 3.17 10-pixel dashed line
+ 1.23 1.11 0.99 0.99 1.23 100-pixel dashed line
+ 1.15 1.08 1.00 1.00 1.15 100-pixel double-dashed line
+ 2.27 1.39 1.00 1.00 2.23 10x1 wide line
+ 1.20 1.09 1.00 1.00 1.20 100x10 wide line
+ 1.04 1.02 1.00 1.00 1.04 500x50 wide line
+ 1.52 1.45 1.00 1.00 1.52 100x10 wide dashed line
+ 1.54 1.47 1.00 1.00 1.54 100x10 wide double-dashed line
+ 1.97 1.30 0.96 0.95 1.95 10x10 rectangle outline
+ 1.44 1.27 1.00 1.00 1.43 100x100 rectangle outline
+ 3.22 2.16 1.10 1.09 3.61 500x500 rectangle outline
+ 1.95 1.34 1.00 1.00 1.90 10x10 wide rectangle outline
+ 1.14 1.14 1.00 1.00 1.13 100x100 wide rectangle outline
+ 1.00 1.00 1.00 1.00 1.00 500x500 wide rectangle outline
+ 1.57 1.72 1.00 1.00 3.03 1-pixel circle
+ 1.96 1.35 1.00 1.00 1.92 10-pixel circle
+ 1.21 1.07 0.86 0.97 1.20 100-pixel circle
+ 1.08 1.04 1.00 1.00 1.08 500-pixel circle
+ 1.39 1.19 1.03 1.03 1.38 100-pixel dashed circle
+ 1.21 1.11 1.00 1.00 1.23 100-pixel double-dashed circle
+ 1.59 1.28 1.00 1.00 1.58 10-pixel wide circle
+ 1.22 1.12 0.99 1.00 1.22 100-pixel wide circle
+ 1.06 1.04 1.00 1.00 1.05 500-pixel wide circle
+ 1.87 1.84 1.00 1.00 1.85 100-pixel wide dashed circle
+ 1.90 1.93 1.01 1.01 1.90 100-pixel wide double-dashed circle
+ 2.13 1.43 1.00 1.00 2.32 10-pixel partial circle
+ 1.42 1.18 1.00 1.00 1.42 100-pixel partial circle
+ 1.92 1.85 1.01 1.01 1.89 10-pixel wide partial circle
+ 1.73 1.67 1.00 1.00 1.73 100-pixel wide partial circle
+ 1.36 1.95 1.00 1.00 2.64 1-pixel solid circle
+ 2.02 1.37 1.00 1.00 2.03 10-pixel solid circle
+ 1.19 1.09 1.00 1.00 1.19 100-pixel solid circle
+ 1.02 0.99 1.00 1.00 1.01 500-pixel solid circle
+ 1.74 1.28 1.00 0.88 1.73 10-pixel fill chord partial circle
+ 1.31 1.13 1.00 1.00 1.31 100-pixel fill chord partial circle
+ 1.67 1.31 1.03 1.03 1.72 10-pixel fill slice partial circle
+ 1.30 1.13 1.00 1.00 1.28 100-pixel fill slice partial circle
+ 2.45 1.49 1.01 1.00 2.71 10-pixel ellipse
+ 1.22 1.10 1.00 1.00 1.22 100-pixel ellipse
+ 1.09 1.04 1.00 1.00 1.09 500-pixel ellipse
+ 1.90 1.28 1.00 1.00 1.89 100-pixel dashed ellipse
+ 1.62 1.24 0.96 0.97 1.61 100-pixel double-dashed ellipse
+ 2.43 1.50 1.00 1.00 2.42 10-pixel wide ellipse
+ 1.61 1.28 1.03 1.03 1.60 100-pixel wide ellipse
+ 1.08 1.05 1.00 1.00 1.08 500-pixel wide ellipse
+ 1.93 1.88 1.00 1.00 1.88 100-pixel wide dashed ellipse
+ 1.94 1.89 1.01 1.00 1.94 100-pixel wide double-dashed ellipse
+ 2.31 1.48 1.00 1.00 2.67 10-pixel partial ellipse
+ 1.38 1.17 1.00 1.00 1.38 100-pixel partial ellipse
+ 2.00 1.85 0.98 0.97 1.98 10-pixel wide partial ellipse
+ 1.89 1.86 1.00 1.00 1.89 100-pixel wide partial ellipse
+ 3.49 1.60 1.00 1.00 3.65 10-pixel filled ellipse
+ 1.67 1.26 1.00 1.00 1.67 100-pixel filled ellipse
+ 1.06 1.04 1.00 1.00 1.06 500-pixel filled ellipse
+ 2.38 1.43 1.01 1.00 2.32 10-pixel fill chord partial ellipse
+ 2.06 1.30 1.00 1.00 2.05 100-pixel fill chord partial ellipse
+ 2.27 1.41 1.00 1.00 2.27 10-pixel fill slice partial ellipse
+ 1.98 1.33 1.00 0.97 1.97 100-pixel fill slice partial ellipse
+ 57.46 1.99 1.01 1.00 114.92 Fill 1x1 equivalent triangle
+ 56.94 1.98 1.01 1.00 73.89 Fill 10x10 equivalent triangle
+ 6.07 1.75 1.00 1.00 6.07 Fill 100x100 equivalent triangle
+ 51.12 1.98 1.00 1.00 102.81 Fill 1x1 trapezoid
+ 51.42 1.82 1.01 1.00 94.89 Fill 10x10 trapezoid
+ 6.47 1.80 1.00 1.00 6.44 Fill 100x100 trapezoid
+ 1.56 1.28 1.00 0.99 1.56 Fill 300x300 trapezoid
+ 51.27 1.97 0.96 0.97 102.54 Fill 1x1 stippled trapezoid (8x8 stipple)
+ 51.73 2.00 1.02 1.02 67.92 Fill 10x10 stippled trapezoid (8x8 stipple)
+ 5.36 1.72 1.00 1.00 5.36 Fill 100x100 stippled trapezoid (8x8 stipple)
+ 1.54 1.26 1.00 1.00 1.59 Fill 300x300 stippled trapezoid (8x8 stipple)
+ 51.41 1.94 1.01 1.00 102.82 Fill 1x1 opaque stippled trapezoid (8x8 stipple)
+ 50.71 1.95 0.99 1.00 65.44 Fill 10x10 opaque stippled trapezoid (8x8...
+ 5.33 1.73 1.00 1.00 5.36 Fill 100x100 opaque stippled trapezoid (8x8...
+ 1.58 1.25 1.00 1.00 1.58 Fill 300x300 opaque stippled trapezoid (8x8...
+ 51.56 1.96 0.99 0.90 103.68 Fill 1x1 tiled trapezoid (4x4 tile)
+ 51.59 1.99 1.01 1.01 62.25 Fill 10x10 tiled trapezoid (4x4 tile)
+ 5.38 1.72 1.00 1.00 5.38 Fill 100x100 tiled trapezoid (4x4 tile)
+ 1.54 1.25 1.00 0.99 1.58 Fill 300x300 tiled trapezoid (4x4 tile)
+ 51.70 1.98 1.01 1.01 103.98 Fill 1x1 stippled trapezoid (17x15 stipple)
+ 44.86 1.97 1.00 1.00 44.86 Fill 10x10 stippled trapezoid (17x15 stipple)
+ 2.74 1.56 1.00 1.00 2.73 Fill 100x100 stippled trapezoid (17x15 stipple)
+ 1.29 1.14 1.00 1.00 1.27 Fill 300x300 stippled trapezoid (17x15 stipple)
+ 51.41 1.96 0.96 0.95 103.39 Fill 1x1 opaque stippled trapezoid (17x15...
+ 45.14 1.96 1.01 1.00 45.14 Fill 10x10 opaque stippled trapezoid (17x15...
+ 2.68 1.56 1.00 1.00 2.68 Fill 100x100 opaque stippled trapezoid (17x15...
+ 1.26 1.10 1.00 1.00 1.28 Fill 300x300 opaque stippled trapezoid (17x15...
+ 51.13 1.97 1.00 0.99 103.39 Fill 1x1 tiled trapezoid (17x15 tile)
+ 47.58 1.96 1.00 1.00 47.86 Fill 10x10 tiled trapezoid (17x15 tile)
+ 2.74 1.56 1.00 1.00 2.74 Fill 100x100 tiled trapezoid (17x15 tile)
+ 1.29 1.14 1.00 1.00 1.28 Fill 300x300 tiled trapezoid (17x15 tile)
+ 51.13 1.97 0.99 0.97 103.39 Fill 1x1 stippled trapezoid (161x145 stipple)
+ 45.14 1.97 1.00 1.00 44.29 Fill 10x10 stippled trapezoid (161x145 stipple)
+ 3.02 1.77 1.12 1.12 3.38 Fill 100x100 stippled trapezoid (161x145 stipple)
+ 1.31 1.13 1.00 1.00 1.30 Fill 300x300 stippled trapezoid (161x145 stipple)
+ 51.27 1.97 1.00 1.00 103.10 Fill 1x1 opaque stippled trapezoid (161x145...
+ 45.01 1.97 1.00 1.00 45.01 Fill 10x10 opaque stippled trapezoid (161x145...
+ 2.67 1.56 1.00 1.00 2.69 Fill 100x100 opaque stippled trapezoid (161x145..
+ 1.29 1.13 1.00 1.01 1.27 Fill 300x300 opaque stippled trapezoid (161x145..
+ 51.41 1.96 1.00 0.99 103.39 Fill 1x1 tiled trapezoid (161x145 tile)
+ 45.01 1.96 0.98 1.00 45.01 Fill 10x10 tiled trapezoid (161x145 tile)
+ 2.62 1.36 1.00 1.00 2.69 Fill 100x100 tiled trapezoid (161x145 tile)
+ 1.27 1.13 1.00 1.00 1.22 Fill 300x300 tiled trapezoid (161x145 tile)
+ 51.13 1.98 1.00 1.00 103.39 Fill 1x1 tiled trapezoid (216x208 tile)
+ 45.14 1.97 1.01 0.99 45.14 Fill 10x10 tiled trapezoid (216x208 tile)
+ 2.62 1.55 1.00 1.00 2.71 Fill 100x100 tiled trapezoid (216x208 tile)
+ 1.28 1.13 1.00 1.00 1.20 Fill 300x300 tiled trapezoid (216x208 tile)
+ 50.71 1.95 1.00 1.00 54.70 Fill 10x10 equivalent complex polygon
+ 5.51 1.71 0.96 0.98 5.47 Fill 100x100 equivalent complex polygons
+ 8.39 1.97 1.00 1.00 16.75 Fill 10x10 64-gon (Convex)
+ 8.38 1.83 1.00 1.00 8.43 Fill 100x100 64-gon (Convex)
+ 8.50 1.96 1.00 1.00 16.64 Fill 10x10 64-gon (Complex)
+ 8.26 1.83 1.00 1.00 8.35 Fill 100x100 64-gon (Complex)
+ 14.09 1.87 1.00 1.00 14.05 Char in 80-char line (6x13)
+ 11.91 1.87 1.00 1.00 11.95 Char in 70-char line (8x13)
+ 11.16 1.85 1.01 1.00 11.10 Char in 60-char line (9x15)
+ 10.09 1.78 1.00 1.00 10.09 Char16 in 40-char line (k14)
+ 6.15 1.75 1.00 1.00 6.31 Char16 in 23-char line (k24)
+ 11.92 1.90 1.03 1.03 11.88 Char in 80-char line (TR 10)
+ 8.18 1.78 1.00 0.99 8.17 Char in 30-char line (TR 24)
+ 42.83 1.44 1.01 1.00 42.11 Char in 20/40/20 line (6x13, TR 10)
+ 27.45 1.43 1.01 1.01 27.45 Char16 in 7/14/7 line (k14, k24)
+ 12.13 1.85 1.00 1.00 12.05 Char in 80-char image line (6x13)
+ 10.00 1.84 1.00 1.00 10.00 Char in 70-char image line (8x13)
+ 9.18 1.83 1.00 1.00 9.12 Char in 60-char image line (9x15)
+ 9.66 1.82 0.98 0.95 9.66 Char16 in 40-char image line (k14)
+ 5.82 1.72 1.00 1.00 5.99 Char16 in 23-char image line (k24)
+ 8.70 1.80 1.00 1.00 8.65 Char in 80-char image line (TR 10)
+ 4.67 1.66 1.00 1.00 4.67 Char in 30-char image line (TR 24)
+ 84.43 1.47 1.00 1.00 124.18 Scroll 10x10 pixels
+ 3.73 1.50 1.00 0.98 3.73 Scroll 100x100 pixels
+ 1.00 1.00 1.00 1.00 1.00 Scroll 500x500 pixels
+ 84.43 1.51 1.00 1.00 134.02 Copy 10x10 from window to window
+ 3.62 1.51 0.98 0.98 3.62 Copy 100x100 from window to window
+ 0.89 1.00 1.00 1.00 1.00 Copy 500x500 from window to window
+ 57.06 1.99 1.00 1.00 88.64 Copy 10x10 from pixmap to window
+ 2.49 2.00 1.00 1.00 2.48 Copy 100x100 from pixmap to window
+ 1.00 0.91 1.00 1.00 0.98 Copy 500x500 from pixmap to window
+ 2.04 1.01 1.00 1.00 2.03 Copy 10x10 from window to pixmap
+ 1.05 1.00 1.00 1.00 1.05 Copy 100x100 from window to pixmap
+ 1.00 1.00 0.93 1.00 1.04 Copy 500x500 from window to pixmap
+ 58.52 1.03 1.03 1.02 57.95 Copy 10x10 from pixmap to pixmap
+ 2.40 1.00 1.00 1.00 2.45 Copy 100x100 from pixmap to pixmap
+ 1.00 1.00 1.00 1.00 1.00 Copy 500x500 from pixmap to pixmap
+ 51.57 1.92 1.00 1.00 85.75 Copy 10x10 1-bit deep plane
+ 6.37 1.75 1.01 1.01 6.37 Copy 100x100 1-bit deep plane
+ 1.26 1.11 1.00 1.00 1.24 Copy 500x500 1-bit deep plane
+ 4.23 1.63 0.98 0.97 4.38 Copy 10x10 n-bit deep plane
+ 1.04 1.02 1.00 1.00 1.04 Copy 100x100 n-bit deep plane
+ 1.00 1.00 1.00 1.00 1.00 Copy 500x500 n-bit deep plane
+ 6.45 1.98 1.00 1.26 12.80 PutImage 10x10 square
+ 1.10 1.87 1.00 1.83 2.11 PutImage 100x100 square
+ 1.02 1.93 1.00 1.91 1.91 PutImage 500x500 square
+ 4.17 1.78 1.00 1.40 7.18 PutImage XY 10x10 square
+ 1.27 1.49 0.97 1.48 2.10 PutImage XY 100x100 square
+ 1.00 1.50 1.00 1.50 1.52 PutImage XY 500x500 square
+ 1.07 1.01 1.00 1.00 1.06 GetImage 10x10 square
+ 1.01 1.00 1.00 1.00 1.01 GetImage 100x100 square
+ 1.00 1.00 1.00 1.00 1.00 GetImage 500x500 square
+ 1.56 1.00 0.99 0.97 1.56 GetImage XY 10x10 square
+ 1.02 1.00 1.00 1.00 1.02 GetImage XY 100x100 square
+ 1.00 1.00 1.00 1.00 1.00 GetImage XY 500x500 square
+ 1.00 1.00 1.01 0.98 0.95 X protocol NoOperation
+ 1.02 1.03 1.04 1.03 1.00 QueryPointer
+ 1.03 1.02 1.04 1.03 1.00 GetProperty
+100.41 1.51 1.00 1.00 198.76 Change graphics context
+ 45.81 1.00 0.99 0.97 57.10 Create and map subwindows (4 kids)
+ 78.45 1.01 1.02 1.02 63.07 Create and map subwindows (16 kids)
+ 73.91 1.01 1.00 1.00 56.37 Create and map subwindows (25 kids)
+ 73.22 1.00 1.00 1.00 49.07 Create and map subwindows (50 kids)
+ 72.36 1.01 0.99 1.00 32.14 Create and map subwindows (75 kids)
+ 70.34 1.00 1.00 1.00 30.12 Create and map subwindows (100 kids)
+ 55.00 1.00 1.00 0.99 23.75 Create and map subwindows (200 kids)
+ 55.30 1.01 1.00 1.00 141.03 Create unmapped window (4 kids)
+ 55.38 1.01 1.01 1.00 163.25 Create unmapped window (16 kids)
+ 54.75 0.96 1.00 0.99 166.95 Create unmapped window (25 kids)
+ 54.83 1.00 1.00 0.99 178.81 Create unmapped window (50 kids)
+ 55.38 1.01 1.01 1.00 181.20 Create unmapped window (75 kids)
+ 55.38 1.01 1.01 1.00 181.20 Create unmapped window (100 kids)
+ 54.87 1.01 1.01 1.00 182.05 Create unmapped window (200 kids)
+ 28.13 1.00 1.00 1.00 30.75 Map window via parent (4 kids)
+ 36.14 1.01 1.01 1.01 32.58 Map window via parent (16 kids)
+ 26.13 1.00 0.98 0.95 29.85 Map window via parent (25 kids)
+ 40.07 1.00 1.01 1.00 27.57 Map window via parent (50 kids)
+ 23.26 0.99 1.00 1.00 18.23 Map window via parent (75 kids)
+ 22.91 0.99 1.00 0.99 16.52 Map window via parent (100 kids)
+ 27.79 1.00 1.00 0.99 12.50 Map window via parent (200 kids)
+ 22.35 1.00 1.00 1.00 56.19 Unmap window via parent (4 kids)
+ 9.57 1.00 0.99 1.00 89.78 Unmap window via parent (16 kids)
+ 80.77 1.01 1.00 1.00 103.85 Unmap window via parent (25 kids)
+ 96.34 1.00 1.00 1.00 116.06 Unmap window via parent (50 kids)
+ 99.72 1.00 1.00 1.00 124.93 Unmap window via parent (75 kids)
+112.36 1.00 1.00 1.00 125.27 Unmap window via parent (100 kids)
+105.41 1.00 1.00 0.99 120.00 Unmap window via parent (200 kids)
+ 51.29 1.03 1.02 1.02 74.19 Destroy window via parent (4 kids)
+ 86.75 0.99 0.99 0.99 116.87 Destroy window via parent (16 kids)
+106.43 1.01 1.01 1.01 127.49 Destroy window via parent (25 kids)
+120.34 1.01 1.01 1.00 140.11 Destroy window via parent (50 kids)
+126.67 1.00 0.99 0.99 145.00 Destroy window via parent (75 kids)
+126.11 1.01 1.01 1.00 140.56 Destroy window via parent (100 kids)
+128.57 1.01 1.00 1.00 137.91 Destroy window via parent (200 kids)
+ 16.04 0.88 1.00 1.00 20.36 Hide/expose window via popup (4 kids)
+ 19.04 1.01 1.00 1.00 23.48 Hide/expose window via popup (16 kids)
+ 19.22 1.00 1.00 1.00 20.44 Hide/expose window via popup (25 kids)
+ 17.41 1.00 0.91 0.97 17.68 Hide/expose window via popup (50 kids)
+ 17.29 1.01 1.00 1.01 17.07 Hide/expose window via popup (75 kids)
+ 16.74 1.00 1.00 1.00 16.17 Hide/expose window via popup (100 kids)
+ 10.30 1.00 1.00 1.00 10.51 Hide/expose window via popup (200 kids)
+ 16.48 1.01 1.00 1.00 26.05 Move window (4 kids)
+ 17.01 0.95 1.00 1.00 23.97 Move window (16 kids)
+ 16.95 1.00 1.00 1.00 22.90 Move window (25 kids)
+ 16.05 1.01 1.00 1.00 21.32 Move window (50 kids)
+ 15.58 1.00 0.98 0.98 19.44 Move window (75 kids)
+ 14.98 1.02 1.03 1.03 18.17 Move window (100 kids)
+ 10.90 1.01 1.01 1.00 12.68 Move window (200 kids)
+ 49.42 1.00 1.00 1.00 198.27 Moved unmapped window (4 kids)
+ 50.72 0.97 1.00 1.00 193.66 Moved unmapped window (16 kids)
+ 50.87 1.00 0.99 1.00 195.09 Moved unmapped window (25 kids)
+ 50.72 1.00 1.00 1.00 189.34 Moved unmapped window (50 kids)
+ 50.87 1.00 1.00 1.00 191.33 Moved unmapped window (75 kids)
+ 50.87 1.00 1.00 0.90 186.71 Moved unmapped window (100 kids)
+ 50.87 1.00 1.00 1.00 179.19 Moved unmapped window (200 kids)
+ 41.04 1.00 1.00 1.00 56.61 Move window via parent (4 kids)
+ 69.81 1.00 1.00 1.00 130.82 Move window via parent (16 kids)
+ 95.81 1.00 1.00 1.00 141.92 Move window via parent (25 kids)
+ 95.98 1.00 1.00 1.00 149.43 Move window via parent (50 kids)
+ 96.59 1.01 1.01 1.00 153.98 Move window via parent (75 kids)
+ 97.19 1.00 1.00 1.00 157.30 Move window via parent (100 kids)
+ 96.67 1.00 0.99 0.96 159.44 Move window via parent (200 kids)
+ 17.75 1.01 1.00 1.00 27.61 Resize window (4 kids)
+ 17.94 1.00 1.00 0.99 25.42 Resize window (16 kids)
+ 17.92 1.01 1.00 1.00 24.47 Resize window (25 kids)
+ 17.24 0.97 1.00 1.00 24.14 Resize window (50 kids)
+ 16.81 1.00 1.00 0.99 22.75 Resize window (75 kids)
+ 16.08 1.00 1.00 1.00 21.20 Resize window (100 kids)
+ 12.92 1.00 0.99 1.00 16.26 Resize window (200 kids)
+ 52.94 1.01 1.00 1.00 327.12 Resize unmapped window (4 kids)
+ 53.60 1.01 1.01 1.01 333.71 Resize unmapped window (16 kids)
+ 52.99 1.00 1.00 1.00 337.29 Resize unmapped window (25 kids)
+ 51.98 1.00 1.00 1.00 329.38 Resize unmapped window (50 kids)
+ 53.05 0.89 1.00 1.00 322.60 Resize unmapped window (75 kids)
+ 53.05 1.00 1.00 1.00 318.08 Resize unmapped window (100 kids)
+ 53.11 1.00 1.00 0.99 306.21 Resize unmapped window (200 kids)
+ 16.76 1.00 0.96 1.00 19.46 Circulate window (4 kids)
+ 17.24 1.00 1.00 0.97 16.24 Circulate window (16 kids)
+ 16.30 1.03 1.03 1.03 15.85 Circulate window (25 kids)
+ 13.45 1.00 1.00 1.00 14.90 Circulate window (50 kids)
+ 12.91 1.00 1.00 1.00 13.06 Circulate window (75 kids)
+ 11.30 0.98 1.00 1.00 11.03 Circulate window (100 kids)
+ 7.58 1.01 1.01 0.99 7.47 Circulate window (200 kids)
+ 1.01 1.01 0.98 1.00 0.95 Circulate Unmapped window (4 kids)
+ 1.07 1.07 1.01 1.07 1.02 Circulate Unmapped window (16 kids)
+ 1.04 1.09 1.06 1.05 0.97 Circulate Unmapped window (25 kids)
+ 1.04 1.23 1.20 1.18 1.05 Circulate Unmapped window (50 kids)
+ 1.18 1.53 1.19 1.45 1.24 Circulate Unmapped window (75 kids)
+ 1.08 1.02 1.01 1.74 1.01 Circulate Unmapped window (100 kids)
+ 1.01 1.12 0.98 0.91 0.97 Circulate Unmapped window (200 kids)
+</screen>
+</para>
+</sect3>
+
+<sect3>
+<title>Profiling with OProfile</title>
+
+<para>OProfile (available from http://oprofile.sourceforge.net/) is a
+system-wide profiler for Linux systems that uses processor-level
+counters to collect sampling data. OProfile can provide information
+that is similar to that provided by <command>gprof</command>, but without the
+necessity of recompiling the program with special instrumentation (i.e.,
+OProfile can collect statistical profiling information about optimized
+programs). A test harness was developed to collect OProfile data for
+each <command>x11perf</command> test individually.
+</para>
+
+<para>Test runs were performed using the RETIRED_INSNS counter on the AMD
+Athlon and the CPU_CLK_HALTED counter on the Intel Pentium III (with a
+test configuration different from the one described above). We have
+examined OProfile output and have compared it with <command>gprof</command> output.
+This investigation has not produced results that yield performance
+increases in <command>x11perf</command> numbers.
+</para>
+
+</sect3>
+
+<!--
+<sect3>Retired Instructions
+
+<p>The initial tests using OProfile were done using the RETIRED_INSNS
+counter with DMX running on the dual-processor AMD Athlon machine - the
+same test configuration that was described above and that was used for
+other tests. The RETIRED_INSNS counter counts retired instructions and
+showed drawing, text, copying, and image tests to be dominated (&gt;
+30%) by calls to Hash(), SecurityLookupIDByClass(),
+SecurityLookupIDByType(), and StandardReadRequestFromClient(). Some of
+these tests also executed significant instructions in
+WaitForSomething().
+
+<p>In contrast, the window tests executed significant
+instructions in SecurityLookupIDByType(), Hash(),
+StandardReadRequestFromClient(), but also executed significant
+instructions in other routines, such as ConfigureWindow(). Some time
+was spent looking at Hash() function, but optimizations in this routine
+did not lead to a dramatic increase in <tt/x11perf/ performance.
+-->
+
+<!--
+<sect3>Clock Cycles
+
+<p>Retired instructions can be misleading because Intel/AMD instructions
+execute in variable amounts of time. The OProfile tests were repeated
+using the Intel CPU_CLK_HALTED counter with DMX running on the second
+back-end machine. Note that this is a different test configuration that
+the one described above. However, these tests show the amount of time
+(as measured in CPU cycles) that are spent in each routine. Because
+<tt/x11perf/ was running on the first back-end machine and because
+window optimizations were on, the load on the second back-end machine
+was not significant.
+
+<p>Using CPU_CLK_HALTED, DMX showed simple drawing
+tests spending more than 10% of their time in
+StandardReadRequestFromClient(), with significant time (&gt; 20% total)
+spent in SecurityLookupIDByClass(), WaitForSomething(), and Dispatch().
+For these tests, &lt; 5% of the time was spent in Hash(), which explains
+why optimizing the Hash() routine did not impact <tt/x11perf/ results.
+
+<p>The trapezoid, text, scrolling, copying, and image tests were
+dominated by time in ProcFillPoly(), PanoramiXFillPoly(), dmxFillPolygon(),
+SecurityLookupIDByClass(), SecurityLookupIDByType(), and
+StandardReadRequestFromClient(). Hash() time was generally above 5% but
+less than 10% of total time.
+-->
+
+<sect3>
+<title>X Test Suite</title>
+
+<para>The X Test Suite was run on the fully optimized DMX server using the
+configuration described above. The following failures were noted:
+<screen>
+XListPixmapFormats: Test 1 [1]
+XChangeWindowAttributes: Test 32 [1]
+XCreateWindow: Test 30 [1]
+XFreeColors: Test 4 [3]
+XCopyArea: Test 13, 17, 21, 25, 30 [2]
+XCopyPlane: Test 11, 15, 27, 31 [2]
+XSetFontPath: Test 4 [1]
+XChangeKeyboardControl: Test 9, 10 [1]
+
+[1] Previously documented errors expected from the Xinerama
+ implementation (see Phase I discussion).
+[2] Newly noted errors that have been verified as expected
+ behavior of the Xinerama implementation.
+[3] Newly noted error that has been verified as a Xinerama
+ implementation bug.
+</screen>
+</para>
+
+</sect3>
+
+</sect2>
+
+<!-- ============================================================ -->
+<sect2>
+<title>Phase III</title>
+
+<para>During the third phase of development, support was provided for the
+following extensions: SHAPE, RENDER, XKEYBOARD, XInput.
+</para>
+
+<sect3>
+<title>SHAPE</title>
+
+<para>The SHAPE extension is supported. Test applications (e.g., xeyes and
+oclock) and window managers that make use of the SHAPE extension will
+work as expected.
+</para>
+</sect3>
+
+<sect3>
+<title>RENDER</title>
+
+<para>The RENDER extension is supported. The version included in the DMX
+CVS tree is version 0.2, and this version is fully supported by Xdmx.
+Applications using only version 0.2 functions will work correctly;
+however, some apps that make use of functions from later versions do not
+properly check the extension's major/minor version numbers. These apps
+will fail with a Bad Implementation error when using post-version 0.2
+functions. This is expected behavior. When the DMX CVS tree is updated
+to include newer versions of RENDER, support for these newer functions
+will be added to the DMX X server.
+</para>
+</sect3>
+
+<sect3>
+<title>XKEYBOARD</title>
+
+<para>The XKEYBOARD extension is supported. If present on the back-end X
+servers, the XKEYBOARD extension will be used to obtain information
+about the type of the keyboard for initialization. Otherwise, the
+keyboard will be initialized using defaults. Note that this departs
+from older behavior: when Xdmx is compiled without XKEYBOARD support,
+the map from the back-end X server will be preserved. With XKEYBOARD
+support, the map is not preserved because better information and control
+of the keyboard is available.
+</para>
+</sect3>
+
+<sect3>
+<title>XInput</title>
+
+<para>The XInput extension is supported. Any device can be used as a core
+device and be used as an XInput extension device, with the exception of
+core devices on the back-end servers. This limitation is present
+because cursor handling on the back-end requires that the back-end
+cursor sometimes track the Xdmx core cursor -- behavior that is
+incompatible with using the back-end pointer as a non-core device.
+</para>
+
+<para>Currently, back-end extension devices are not available as Xdmx
+extension devices, but this limitation should be removed in the future.
+</para>
+
+<para>To demonstrate the XInput extension, and to provide more examples for
+low-level input device driver writers, USB device drivers have been
+written for mice (usb-mou), keyboards (usb-kbd), and
+non-mouse/non-keyboard USB devices (usb-oth). Please see the man page
+for information on Linux kernel drivers that are required for using
+these Xdmx drivers.
+</para>
+</sect3>
+
+<sect3>
+<title>DPMS</title>
+
+<para>The DPMS extension is exported but does not do anything at this time.
+</para>
+
+</sect3>
+
+<sect3>
+<title>Other Extensions</title>
+
+<para>The LBX,
+ SECURITY,
+ XC-APPGROUP, and
+ XFree86-Bigfont
+extensions do not require any special Xdmx support and have been exported.
+</para>
+
+<para>The
+ BIG-REQUESTS,
+ DEC-XTRAP,
+ DOUBLE-BUFFER,
+ Extended-Visual-Information,
+ FontCache,
+ GLX,
+ MIT-SCREEN-SAVER,
+ MIT-SHM,
+ MIT-SUNDRY-NONSTANDARD,
+ RECORD,
+ SECURITY,
+ SGI-GLX,
+ SYNC,
+ TOG-CUP,
+ X-Resource,
+ XC-MISC,
+ XFree86-DGA,
+ XFree86-DRI,
+ XFree86-Misc,
+ XFree86-VidModeExtension, and
+ XVideo
+extensions are <emphasis remap="it">not</emphasis> supported at this time, but will be evaluated
+for inclusion in future DMX releases. <emphasis remap="bf">See below for additional work
+on extensions after Phase III.</emphasis>
+</para>
+</sect3>
+</sect2>
+
+<sect2>
+<title>Phase IV</title>
+
+<sect3>
+<title>Moving to XFree86 4.3.0</title>
+
+<para>For Phase IV, the recent release of XFree86 4.3.0 (27 February 2003)
+was merged onto the dmx.sourceforge.net CVS trunk and all work is
+proceeding using this tree.
+</para>
+</sect3>
+
+<sect3>
+<title>Extensions </title>
+
+<sect4>
+<title>XC-MISC (supported)</title>
+
+<para>XC-MISC is used internally by the X library to recycle XIDs from the
+X server. This is important for long-running X server sessions. Xdmx
+supports this extension. The X Test Suite passed and failed the exact
+same tests before and after this extension was enabled.
+<!-- Tested February/March 2003 -->
+</para>
+</sect4>
+
+<sect4>
+<title>Extended-Visual-Information (supported)</title>
+
+<para>The Extended-Visual-Information extension provides a method for an X
+client to obtain detailed visual information. Xdmx supports this
+extension. It was tested using the <filename>hw/dmx/examples/evi</filename> example
+program. <emphasis remap="bf">Note that this extension is not Xinerama-aware</emphasis> -- it will
+return visual information for each screen even though Xinerama is
+causing the X server to export a single logical screen.
+<!-- Tested March 2003 -->
+</para>
+</sect4>
+
+<sect4>
+<title>RES (supported)</title>
+
+<para>The X-Resource extension provides a mechanism for a client to obtain
+detailed information about the resources used by other clients. This
+extension was tested with the <filename>hw/dmx/examples/res</filename> program. The
+X Test Suite passed and failed the exact same tests before and after
+this extension was enabled.
+<!-- Tested March 2003 -->
+</para>
+</sect4>
+
+<sect4>
+<title>BIG-REQUESTS (supported)</title>
+
+<para>This extension enables the X11 protocol to handle requests longer
+than 262140 bytes. The X Test Suite passed and failed the exact same
+tests before and after this extension was enabled.
+<!-- Tested March 2003 -->
+</para>
+</sect4>
+
+<sect4>
+<title>XSYNC (supported)</title>
+
+<para>This extension provides facilities for two different X clients to
+synchronize their requests. This extension was minimally tested with
+<command>xdpyinfo</command> and the X Test Suite passed and failed the exact same
+tests before and after this extension was enabled.
+<!-- Tested March 2003 -->
+</para>
+</sect4>
+
+<sect4>
+<title>XTEST, RECORD, DEC-XTRAP (supported) and XTestExtension1 (not supported)</title>
+
+<para>The XTEST and RECORD extension were developed by the X Consortium for
+use in the X Test Suite and are supported as a standard in the X11R6
+tree. They are also supported in Xdmx. When X Test Suite tests that
+make use of the XTEST extension are run, Xdmx passes and fails exactly
+the same tests as does a standard XFree86 X server. When the
+<literal remap="tt">rcrdtest</literal> test (a part of the X Test Suite that verifies the RECORD
+extension) is run, Xdmx passes and fails exactly the same tests as does
+a standard XFree86 X server. <!-- Tested February/March 2003 -->
+</para>
+
+<para>There are two older XTEST-like extensions: DEC-XTRAP and
+XTestExtension1. The XTestExtension1 extension was developed for use by
+the X Testing Consortium for use with a test suite that eventually
+became (part of?) the X Test Suite. Unlike XTEST, which only allows
+events to be sent to the server, the XTestExtension1 extension also
+allowed events to be recorded (similar to the RECORD extension). The
+second is the DEC-XTRAP extension that was developed by the Digital
+Equipment Corporation.
+</para>
+
+<para>The DEC-XTRAP extension is available from Xdmx and has been tested
+with the <command>xtrap*</command> tools which are distributed as standard X11R6
+clients. <!-- Tested March 2003 -->
+</para>
+
+<para>The XTestExtension1 is <emphasis>not</emphasis> supported because it does not appear
+to be used by any modern X clients (the few that support it also support
+XTEST) and because there are no good methods available for testing that
+it functions correctly (unlike XTEST and DEC-XTRAP, the code for
+XTestExtension1 is not part of the standard X server source tree, so
+additional testing is important). <!-- Tested March 2003 -->
+</para>
+
+<para>Most of these extensions are documented in the X11R6 source tree.
+Further, several original papers exist that this author was unable to
+locate -- for completeness and historical interest, citations are
+provide:
+<variablelist>
+<varlistentry>
+<term>XRECORD</term>
+<listitem>
+<para>Martha Zimet. Extending X For Recording. 8th Annual X
+Technical Conference Boston, MA January 24-26, 1994.
+</para></listitem></varlistentry>
+<varlistentry>
+<term>DEC-XTRAP</term>
+<listitem>
+<para>Dick Annicchiarico, Robert Chesler, Alan Jamison. XTrap
+Architecture. Digital Equipment Corporation, July 1991.
+</para></listitem></varlistentry>
+<varlistentry>
+<term>XTestExtension1</term>
+<listitem>
+<para>Larry Woestman. X11 Input Synthesis Extension
+Proposal. Hewlett Packard, November 1991.
+</para></listitem></varlistentry>
+</variablelist>
+</para>
+</sect4>
+
+<sect4>
+<title>MIT-MISC (not supported)</title>
+
+<para>The MIT-MISC extension is used to control a bug-compatibility flag
+that provides compatibility with xterm programs from X11R1 and X11R2.
+There does not appear to be a single client available that makes use of
+this extension and there is not way to verify that it works correctly.
+The Xdmx server does <emphasis>not</emphasis> support MIT-MISC.
+</para>
+</sect4>
+
+<sect4>
+<title>SCREENSAVER (not supported)</title>
+
+<para>This extension provides special support for the X screen saver. It
+was tested with beforelight, which appears to be the only client that
+works with it. When Xinerama was not active, <command>beforelight</command> behaved
+as expected. However, when Xinerama was active, <command>beforelight</command> did
+not behave as expected. Further, when this extension is not active,
+<command>xscreensaver</command> (a widely-used X screen saver program) did not behave
+as expected. Since this extension is not Xinerama-aware and is not
+commonly used with expected results by clients, we have left this
+extension disabled at this time.
+</para>
+</sect4>
+
+<sect4>
+<title>GLX (supported)</title>
+
+<para>The GLX extension provides OpenGL and GLX windowing support. In
+Xdmx, the extension is called glxProxy, and it is Xinerama aware. It
+works by either feeding requests forward through Xdmx to each of the
+back-end servers or handling them locally. All rendering requests are
+handled on the back-end X servers. This code was donated to the DMX
+project by SGI. For the X Test Suite results comparison, see below.
+</para>
+</sect4>
+
+<sect4>
+<title>RENDER (supported)</title>
+
+<para>The X Rendering Extension (RENDER) provides support for digital image
+composition. Geometric and text rendering are supported. RENDER is
+partially Xinerama-aware, with text and the most basic compositing
+operator; however, its higher level primitives (triangles, triangle
+strips, and triangle fans) are not yet Xinerama-aware. The RENDER
+extension is still under development, and is currently at version 0.8.
+Additional support will be required in DMX as more primitives and/or
+requests are added to the extension.
+</para>
+
+<para>There is currently no test suite for the X Rendering Extension;
+however, there has been discussion of developing a test suite as the
+extension matures. When that test suite becomes available, additional
+testing can be performed with Xdmx. The X Test Suite passed and failed
+the exact same tests before and after this extension was enabled.
+</para>
+</sect4>
+
+<sect4>
+<title>Summary</title>
+
+<!-- WARNING: this list is duplicated in the "Common X extension
+support" section -->
+<para>To summarize, the following extensions are currently supported:
+ BIG-REQUESTS,
+ DEC-XTRAP,
+ DMX,
+ DPMS,
+ Extended-Visual-Information,
+ GLX,
+ LBX,
+ RECORD,
+ RENDER,
+ SECURITY,
+ SHAPE,
+ SYNC,
+ X-Resource,
+ XC-APPGROUP,
+ XC-MISC,
+ XFree86-Bigfont,
+ XINERAMA,
+ XInputExtension,
+ XKEYBOARD, and
+ XTEST.
+</para>
+
+<para>The following extensions are <emphasis>not</emphasis> supported at this time:
+ DOUBLE-BUFFER,
+ FontCache,
+ MIT-SCREEN-SAVER,
+ MIT-SHM,
+ MIT-SUNDRY-NONSTANDARD,
+ TOG-CUP,
+ XFree86-DGA,
+ XFree86-Misc,
+ XFree86-VidModeExtension,
+ XTestExtensionExt1, and
+ XVideo.
+</para>
+</sect4>
+</sect3>
+
+<sect3>
+<title>Additional Testing with the X Test Suite</title>
+
+<sect4>
+<title>XFree86 without XTEST</title>
+
+<para>After the release of XFree86 4.3.0, we retested the XFree86 X server
+with and without using the XTEST extension. When the XTEST extension
+was <emphasis>not</emphasis> used for testing, the XFree86 4.3.0 server running on our
+usual test system with a Radeon VE card reported unexpected failures in
+the following tests:
+<literallayout>
+XListPixmapFormats: Test 1
+XChangeKeyboardControl: Tests 9, 10
+XGetDefault: Test 5
+XRebindKeysym: Test 1
+</literallayout>
+</para>
+</sect4>
+
+<sect4>
+<title>XFree86 with XTEST</title>
+
+<para>When using the XTEST extension, the XFree86 4.3.0 server reported the
+following errors:
+<literallayout>
+XListPixmapFormats: Test 1
+XChangeKeyboardControl: Tests 9, 10
+XGetDefault: Test 5
+XRebindKeysym: Test 1
+
+XAllowEvents: Tests 20, 21, 24
+XGrabButton: Tests 5, 9-12, 14, 16, 19, 21-25
+XGrabKey: Test 8
+XSetPointerMapping: Test 3
+XUngrabButton: Test 4
+</literallayout>
+</para>
+
+<para>While these errors may be important, they will probably be fixed
+eventually in the XFree86 source tree. We are particularly interested
+in demonstrating that the Xdmx server does not introduce additional
+failures that are not known Xinerama failures.
+</para>
+</sect4>
+
+<sect4>
+<title>Xdmx with XTEST, without Xinerama, without GLX</title>
+
+<para>Without Xinerama, but using the XTEST extension, the following errors
+were reported from Xdmx (note that these are the same as for the XFree86
+4.3.0, except that XGetDefault no longer fails):
+<literallayout>
+XListPixmapFormats: Test 1
+XChangeKeyboardControl: Tests 9, 10
+XRebindKeysym: Test 1
+
+XAllowEvents: Tests 20, 21, 24
+XGrabButton: Tests 5, 9-12, 14, 16, 19, 21-25
+XGrabKey: Test 8
+XSetPointerMapping: Test 3
+XUngrabButton: Test 4
+</literallayout>
+</para>
+</sect4>
+
+<sect4>
+<title>Xdmx with XTEST, with Xinerama, without GLX</title>
+
+<para>With Xinerama, using the XTEST extension, the following errors
+were reported from Xdmx:
+<literallayout>
+XListPixmapFormats: Test 1
+XChangeKeyboardControl: Tests 9, 10
+XRebindKeysym: Test 1
+
+XAllowEvents: Tests 20, 21, 24
+XGrabButton: Tests 5, 9-12, 14, 16, 19, 21-25
+XGrabKey: Test 8
+XSetPointerMapping: Test 3
+XUngrabButton: Test 4
+
+XCopyPlane: Tests 13, 22, 31 (well-known XTEST/Xinerama interaction issue)
+XDrawLine: Test 67
+XDrawLines: Test 91
+XDrawSegments: Test 68
+</literallayout>
+Note that the first two sets of errors are the same as for the XFree86
+4.3.0 server, and that the XCopyPlane error is a well-known error
+resulting from an XTEST/Xinerama interaction when the request crosses a
+screen boundary. The XDraw* errors are resolved when the tests are run
+individually and they do not cross a screen boundary. We will
+investigate these errors further to determine their cause.
+</para>
+</sect4>
+
+<sect4>
+<title>Xdmx with XTEST, with Xinerama, with GLX</title>
+
+<para>With GLX enabled, using the XTEST extension, the following errors
+were reported from Xdmx (these results are from early during the Phase
+IV development, but were confirmed with a late Phase IV snapshot):
+<literallayout>
+XListPixmapFormats: Test 1
+XChangeKeyboardControl: Tests 9, 10
+XRebindKeysym: Test 1
+
+XAllowEvents: Tests 20, 21, 24
+XGrabButton: Tests 5, 9-12, 14, 16, 19, 21-25
+XGrabKey: Test 8
+XSetPointerMapping: Test 3
+XUngrabButton: Test 4
+
+XClearArea: Test 8
+XCopyArea: Tests 4, 5, 11, 14, 17, 23, 25, 27, 30
+XCopyPlane: Tests 6, 7, 10, 19, 22, 31
+XDrawArcs: Tests 89, 100, 102
+XDrawLine: Test 67
+XDrawSegments: Test 68
+</literallayout>
+Note that the first two sets of errors are the same as for the XFree86
+4.3.0 server, and that the third set has different failures than when
+Xdmx does not include GLX support. Since the GLX extension adds new
+visuals to support GLX's visual configs and the X Test Suite runs tests
+over the entire set of visuals, additional rendering tests were run and
+presumably more of them crossed a screen boundary. This conclusion is
+supported by the fact that nearly all of the rendering errors reported
+are resolved when the tests are run individually and they do no cross a
+screen boundary.
+</para>
+
+<para>Further, when hardware rendering is disabled on the back-end displays,
+many of the errors in the third set are eliminated, leaving only:
+<literallayout>
+XClearArea: Test 8
+XCopyArea: Test 4, 5, 11, 14, 17, 23, 25, 27, 30
+XCopyPlane: Test 6, 7, 10, 19, 22, 31
+</literallayout>
+</para>
+</sect4>
+
+<sect4>
+<title>Conclusion</title>
+
+<para>We conclude that all of the X Test Suite errors reported for Xdmx are
+the result of errors in the back-end X server or the Xinerama
+implementation. Further, all of these errors that can be reasonably
+fixed at the Xdmx layer have been. (Where appropriate, we have
+submitted patches to the XFree86 and Xinerama upstream maintainers.)
+</para>
+</sect4>
+</sect3>
+
+<sect3>
+<title>Dynamic Reconfiguration</title>
+
+<para>During this development phase, dynamic reconfiguration support was
+added to DMX. This support allows an application to change the position
+and offset of a back-end server's screen. For example, if the
+application would like to shift a screen slightly to the left, it could
+query Xdmx for the screen's &lt;x,y&gt; position and then dynamically
+reconfigure that screen to be at position &lt;x+10,y&gt;. When a screen
+is dynamically reconfigured, input handling and a screen's root window
+dimensions are adjusted as needed. These adjustments are transparent to
+the user.
+</para>
+
+<sect4>
+<title>Dynamic reconfiguration extension</title>
+
+<para>The application interface to DMX's dynamic reconfiguration is through
+a function in the DMX extension library:
+<programlisting>
+Bool DMXReconfigureScreen(Display *dpy, int screen, int x, int y)
+</programlisting>
+where <parameter>dpy</parameter> is DMX server's display, <parameter>screen</parameter> is the number of the
+screen to be reconfigured, and <parameter>x</parameter> and <parameter>y</parameter> are the new upper,
+left-hand coordinates of the screen to be reconfigured.
+</para>
+
+<para>The coordinates are not limited other than as required by the X
+protocol, which limits all coordinates to a signed 16 bit number. In
+addition, all coordinates within a screen must also be legal values.
+Therefore, setting a screen's upper, left-hand coordinates such that the
+right or bottom edges of the screen is greater than 32,767 is illegal.
+</para>
+</sect4>
+
+<sect4>
+<title>Bounding box</title>
+
+<para>When the Xdmx server is started, a bounding box is calculated from
+the screens' layout given either on the command line or in the
+configuration file. This bounding box is currently fixed for the
+lifetime of the Xdmx server.
+</para>
+
+<para>While it is possible to move a screen outside of the bounding box, it
+is currently not possible to change the dimensions of the bounding box.
+For example, it is possible to specify coordinates of &lt;-100,-100&gt;
+for the upper, left-hand corner of the bounding box, which was
+previously at coordinates &lt;0,0&gt;. As expected, the screen is moved
+down and to the right; however, since the bounding box is fixed, the
+left side and upper portions of the screen exposed by the
+reconfiguration are no longer accessible on that screen. Those
+inaccessible regions are filled with black.
+</para>
+
+<para>This fixed bounding box limitation will be addressed in a future
+development phase.
+</para>
+</sect4>
+
+<sect4>
+<title>Sample applications</title>
+
+<para>An example of where this extension is useful is in setting up a video
+wall. It is not always possible to get everything perfectly aligned,
+and sometimes the positions are changed (e.g., someone might bump into a
+projector). Instead of physically moving projectors or monitors, it is
+now possible to adjust the positions of the back-end server's screens
+using the dynamic reconfiguration support in DMX.
+</para>
+
+<para>Other applications, such as automatic setup and calibration tools,
+can make use of dynamic reconfiguration to correct for projector
+alignment problems, as long as the projectors are still arranged
+rectilinearly. Horizontal and vertical keystone correction could be
+applied to projectors to correct for non-rectilinear alignment problems;
+however, this must be done external to Xdmx.
+</para>
+
+<para>A sample test program is included in the DMX server's examples
+directory to demonstrate the interface and how an application might use
+dynamic reconfiguration. See <filename>dmxreconfig.c</filename> for details.
+</para>
+</sect4>
+
+<sect4>
+<title>Additional notes</title>
+
+<para>In the original development plan, Phase IV was primarily devoted to
+adding OpenGL support to DMX; however, SGI became interested in the DMX
+project and developed code to support OpenGL/GLX. This code was later
+donated to the DMX project and integrated into the DMX code base, which
+freed the DMX developers to concentrate on dynamic reconfiguration (as
+described above).
+</para>
+</sect4>
+</sect3>
+
+<sect3>
+<title>Doxygen documentation</title>
+
+<para>Doxygen is an open-source (GPL) documentation system for generating
+browseable documentation from stylized comments in the source code. We
+have placed all of the Xdmx server and DMX protocol source code files
+under Doxygen so that comprehensive documentation for the Xdmx source
+code is available in an easily browseable format.
+</para>
+</sect3>
+
+<sect3>
+<title>Valgrind</title>
+
+<para>Valgrind, an open-source (GPL) memory debugger for Linux, was used to
+search for memory management errors. Several memory leaks were detected
+and repaired. The following errors were not addressed:
+<orderedlist>
+ <listitem><para>
+ When the X11 transport layer sends a reply to the client, only
+ those fields that are required by the protocol are filled in --
+ unused fields are left as uninitialized memory and are therefore
+ noted by valgrind. These instances are not errors and were not
+ repaired.
+ </para></listitem>
+ <listitem><para>
+ At each server generation, glxInitVisuals allocates memory that
+ is never freed. The amount of memory lost each generation
+ approximately equal to 128 bytes for each back-end visual.
+ Because the code involved is automatically generated, this bug
+ has not been fixed and will be referred to SGI.
+ </para></listitem>
+ <listitem><para>
+ At each server generation, dmxRealizeFont calls XLoadQueryFont,
+ which allocates a font structure that is not freed.
+ dmxUnrealizeFont can free the font structure for the first
+ screen, but cannot free it for the other screens since they are
+ already closed by the time dmxUnrealizeFont could free them.
+ The amount of memory lost each generation is approximately equal
+ to 80 bytes per font per back-end. When this bug is fixed in
+ the the X server's device-independent (dix) code, DMX will be
+ able to properly free the memory allocated by XLoadQueryFont.
+ </para></listitem>
+</orderedlist>
+</para>
+</sect3>
+
+<sect3>
+<title>RATS</title>
+
+<para>RATS (Rough Auditing Tool for Security) is an open-source (GPL)
+security analysis tool that scans source code for common
+security-related programming errors (e.g., buffer overflows and TOCTOU
+races). RATS was used to audit all of the code in the hw/dmx directory
+and all "High" notations were checked manually. The code was either
+re-written to eliminate the warning, or a comment containing "RATS" was
+inserted on the line to indicate that a human had checked the code.
+Unrepaired warnings are as follows:
+<orderedlist>
+ <listitem><para>
+ Fixed-size buffers are used in many areas, but code has been
+ added to protect against buffer overflows (e.g., snprintf).
+ The only instances that have not yet been fixed are in
+ config/xdmxconfig.c (which is not part of the Xdmx server) and
+ input/usb-common.c.
+ </para></listitem>
+ <listitem><para>
+ vprintf and vfprintf are used in the logging routines. In
+ general, all uses of these functions (e.g., dmxLog) provide a
+ constant format string from a trusted source, so the use is
+ relatively benign.
+ </para></listitem>
+ <listitem><para>
+ glxProxy/glxscreens.c uses getenv and strcat. The use of these
+ functions is safe and will remain safe as long as
+ ExtensionsString is longer then GLXServerExtensions (ensuring
+ this may not be ovious to the casual programmer, but this is in
+ automatically generated code, so we hope that the generator
+ enforces this constraint).
+ </para></listitem>
+</orderedlist>
+
+</para>
+
+</sect3>
+
+</sect2>
+
+</sect1>
+
+</appendix>
+
+ </article>
+
+ <!-- Local Variables: -->
+ <!-- fill-column: 72 -->
+ <!-- End: -->
diff --git a/xorg-server/hw/dmx/examples/dmxwininfo.c b/xorg-server/hw/dmx/examples/dmxwininfo.c
index 6cf1d411e..3d027d530 100644
--- a/xorg-server/hw/dmx/examples/dmxwininfo.c
+++ b/xorg-server/hw/dmx/examples/dmxwininfo.c
@@ -39,7 +39,6 @@
#include <string.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
-#include <X11/Xmu/SysUtil.h>
#include <X11/extensions/dmxext.h>
static const char *FontName = "fixed";
@@ -80,7 +79,7 @@ EventLoop(Display *dpy, Window win, GC gc)
y += 20;
for (i = 0; i < count; i++) {
char str[500];
- XmuSnprintf(str, sizeof(str),
+ snprintf(str, sizeof(str),
"screen %d: pos: %dx%d+%d+%d visible: %dx%d+%d+%d",
winInfo[i].screen,
winInfo[i].pos.width, winInfo[i].pos.height,
diff --git a/xorg-server/hw/dmx/glxProxy/glxcmds.c b/xorg-server/hw/dmx/glxProxy/glxcmds.c
index f79264ea9..a76201da0 100644
--- a/xorg-server/hw/dmx/glxProxy/glxcmds.c
+++ b/xorg-server/hw/dmx/glxProxy/glxcmds.c
@@ -59,9 +59,6 @@
extern __GLXFBConfig **__glXFBConfigs;
extern int __glXNumFBConfigs;
-extern __GLXFBConfig *glxLookupFBConfig( GLXFBConfigID id );
-extern __GLXFBConfig *glxLookupFBConfigByVID( VisualID vid );
-extern __GLXFBConfig *glxLookupBackEndFBConfig( GLXFBConfigID id, int screen );
extern int glxIsExtensionSupported( char *ext );
extern int __glXGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc);
@@ -70,6 +67,44 @@ extern int __glXGetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc);
(x) - dmxScreen->glxErrorBase + __glXerrorBase \
: (x) )
+static __GLXFBConfig *glxLookupFBConfig( GLXFBConfigID id )
+{
+ int i,j;
+
+ for (i=0, j=0; i<__glXNumFBConfigs; i++,j+=(__glXNumActiveScreens+1) ) {
+ if ( __glXFBConfigs[j]->id == id)
+ return __glXFBConfigs[j];
+ }
+
+ return NULL;
+}
+
+static __GLXFBConfig *glxLookupFBConfigByVID( VisualID vid )
+{
+ int i,j;
+
+ for (i=0, j=0; i<__glXNumFBConfigs; i++,j+=(__glXNumActiveScreens+1) ) {
+ if ( __glXFBConfigs[j]->associatedVisualId == vid)
+ return __glXFBConfigs[j];
+ }
+
+ return NULL;
+}
+
+static __GLXFBConfig *glxLookupBackEndFBConfig( GLXFBConfigID id, int screen )
+{
+ int i;
+ int j;
+
+ for (i=0, j=0; i<__glXNumFBConfigs; i++,j+=(__glXNumActiveScreens+1) ) {
+ if ( __glXFBConfigs[j]->id == id)
+ return __glXFBConfigs[j+screen+1];
+ }
+
+ return NULL;
+
+}
+
Display *GetBackEndDisplay( __GLXclientState *cl, int s )
{
if (! cl->be_displays[s] ) {
diff --git a/xorg-server/hw/dmx/glxProxy/glxscreens.c b/xorg-server/hw/dmx/glxProxy/glxscreens.c
index df49fe50d..01e041c8f 100644
--- a/xorg-server/hw/dmx/glxProxy/glxscreens.c
+++ b/xorg-server/hw/dmx/glxProxy/glxscreens.c
@@ -1,371 +1,332 @@
-/*
- * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
- * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
- */
-
-#ifdef HAVE_DMX_CONFIG_H
-#include <dmx-config.h>
-#endif
-
-#include "dmx.h"
-#include "dmxlog.h"
-
-#include "glxserver.h"
-
-#include <windowstr.h>
-
-#include "glxfbconfig.h"
-
-#ifdef PANORAMIX
-#include "panoramiXsrv.h"
-#endif
-
-__GLXscreenInfo *__glXActiveScreens;
-GLint __glXNumActiveScreens;
-
-__GLXFBConfig **__glXFBConfigs;
-int __glXNumFBConfigs;
-
-static char GLXServerVendorName[] = "SGI DMX/glxProxy";
-static char GLXServerVersion[64];
-static char GLXServerExtensions[] =
- "GLX_EXT_visual_info "
- "GLX_EXT_visual_rating "
- "GLX_EXT_import_context "
- "GLX_SGIX_fbconfig "
- "GLX_SGI_make_current_read "
- "GLX_SGI_swap_control "
- ;
-
-static char ExtensionsString[1024];
-
-static void CalcServerVersionAndExtensions( void )
-{
- int s;
- xGLXQueryVersionReq *req;
- xGLXQueryVersionReply reply;
- char **be_extensions;
- char *ext;
- char *denied_extensions;
-
- /*
- * set the server glx version to be the minimum version
- * supported by all back-end servers
- */
- __glXVersionMajor = 0;
- __glXVersionMinor = 0;
- for (s=0; s<__glXNumActiveScreens; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = dmxScreen->beDisplay;
-
- /* Send the glXQueryVersion request */
- LockDisplay(dpy);
- GetReq(GLXQueryVersion,req);
- req->reqType = dmxScreen->glxMajorOpcode;
- req->glxCode = X_GLXQueryVersion;
- req->majorVersion = GLX_SERVER_MAJOR_VERSION;
- req->minorVersion = GLX_SERVER_MINOR_VERSION;
- _XReply(dpy, (xReply*) &reply, 0, False);
- UnlockDisplay(dpy);
- SyncHandle();
-
- if (s == 0) {
- __glXVersionMajor = reply.majorVersion;
- __glXVersionMinor = reply.minorVersion;
- }
- else {
- if (reply.majorVersion < __glXVersionMajor) {
- __glXVersionMajor = reply.majorVersion;
- __glXVersionMinor = reply.minorVersion;
- }
- else if ( (reply.majorVersion == __glXVersionMajor) &&
- (reply.minorVersion < __glXVersionMinor) ) {
- __glXVersionMinor = reply.minorVersion;
- }
- }
-
- }
-
- if (GLX_SERVER_MAJOR_VERSION < __glXVersionMajor) {
- __glXVersionMajor = GLX_SERVER_MAJOR_VERSION;
- __glXVersionMinor = GLX_SERVER_MINOR_VERSION;
- }
- else if ( (GLX_SERVER_MAJOR_VERSION == __glXVersionMajor) &&
- (GLX_SERVER_MINOR_VERSION < __glXVersionMinor) ) {
- __glXVersionMinor = GLX_SERVER_MINOR_VERSION;
- }
-
- sprintf(GLXServerVersion, "%d.%d DMX %d back-end server(s)",
- __glXVersionMajor, __glXVersionMinor, __glXNumActiveScreens );
- /*
- * set the ExtensionsString to the minimum extensions string
- */
- ExtensionsString[0] = '\0';
-
- /*
- * read extensions strings of all back-end servers
- */
- be_extensions = (char **)malloc( __glXNumActiveScreens * sizeof(char *) );
- if (!be_extensions)
- return;
-
- for (s=0; s<__glXNumActiveScreens; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
- Display *dpy = dmxScreen->beDisplay;
- xGLXQueryServerStringReq *req;
- xGLXQueryServerStringReply reply;
- int length, numbytes, slop;
-
- /* Send the glXQueryServerString request */
- LockDisplay(dpy);
- GetReq(GLXQueryServerString,req);
- req->reqType = dmxScreen->glxMajorOpcode;
- req->glxCode = X_GLXQueryServerString;
- req->screen = DefaultScreen(dpy);
- req->name = GLX_EXTENSIONS;
- _XReply(dpy, (xReply*) &reply, 0, False);
-
- length = (int)reply.length;
- numbytes = (int)reply.n;
- slop = numbytes * __GLX_SIZE_INT8 & 3;
- be_extensions[s] = (char *)malloc(numbytes);
- if (!be_extensions[s]) {
- /* Throw data on the floor */
- _XEatData(dpy, length);
- } else {
- _XRead(dpy, (char *)be_extensions[s], numbytes);
- if (slop) _XEatData(dpy,4-slop);
- }
- UnlockDisplay(dpy);
- SyncHandle();
- }
-
- /*
- * extensions string will include only extensions that our
- * server supports as well as all back-end servers supports.
- * extensions that are in the DMX_DENY_EXTENSIONS string will
- * not be supported.
- */
- denied_extensions = getenv("DMX_DENY_GLX_EXTENSIONS");
- ext = strtok(GLXServerExtensions, " ");
- while( ext ) {
- int supported = 1;
-
- if (denied_extensions && strstr(denied_extensions, ext)) {
- supported = 0;
- }
- else {
- for (s=0; s<__glXNumActiveScreens && supported; s++) {
- if ( !strstr(be_extensions[s], ext) ) {
- supported = 0;
- }
- }
- }
-
- if (supported) {
- strcat(ExtensionsString, ext);
- strcat(ExtensionsString, " ");
- }
-
- ext = strtok(NULL, " ");
- }
-
- /*
- * release temporary storage
- */
- for (s=0; s<__glXNumActiveScreens; s++) {
- free(be_extensions[s]);
- }
- free( be_extensions );
-
- if (dmxGLXSwapGroupSupport) {
- if (!denied_extensions ||
- !strstr(denied_extensions, "GLX_SGIX_swap_group")) {
- strcat(ExtensionsString, "GLX_SGIX_swap_group");
- if (!denied_extensions ||
- !strstr(denied_extensions, "GLX_SGIX_swap_barrier")) {
- strcat(ExtensionsString, " GLX_SGIX_swap_barrier");
- }
- }
- }
-
-}
-
-void __glXScreenInit(GLint numscreens)
-{
- int s;
- int c;
- DMXScreenInfo *dmxScreen0 = &dmxScreens[0];
- __glXNumActiveScreens = numscreens;
-
-
- CalcServerVersionAndExtensions();
-
-
- __glXFBConfigs = NULL;
- __glXNumFBConfigs = 0;
-
- if ( (__glXVersionMajor == 1 && __glXVersionMinor >= 3) ||
- (__glXVersionMajor > 1) ||
- ( strstr(ExtensionsString, "GLX_SGIX_fbconfig") ) ) {
-
- /*
- // Initialize FBConfig info.
- // find the set of FBConfigs that are present on all back-end
- // servers - only those configs will be supported
- */
- __glXFBConfigs = (__GLXFBConfig **)malloc( dmxScreen0->numFBConfigs *
- (numscreens+1) * sizeof(__GLXFBConfig *) );
- __glXNumFBConfigs = 0;
-
- for (c=0; c<dmxScreen0->numFBConfigs; c++) {
- __GLXFBConfig *cfg = NULL;
-
- if (numscreens > 1) {
- for (s=1; s<numscreens; s++) {
- DMXScreenInfo *dmxScreen = &dmxScreens[s];
-
- cfg = FindMatchingFBConfig( &dmxScreen0->fbconfigs[c],
- dmxScreen->fbconfigs,
- dmxScreen->numFBConfigs );
- __glXFBConfigs[ __glXNumFBConfigs * (numscreens+1) + s + 1 ] = cfg;
- if (!cfg) {
- dmxLog(dmxInfo,"screen0 FBConfig 0x%x is missing on screen#%d\n", dmxScreen0->fbconfigs[c].id, s);
- break;
- }
- else {
- dmxLog(dmxInfo,"screen0 FBConfig 0x%x matched to 0x%x on screen#%d\n", dmxScreen0->fbconfigs[c].id, cfg->id, s);
- }
- }
- }
- else {
- cfg = &dmxScreen0->fbconfigs[c];
- }
-
- if (cfg) {
-
- /* filter out overlay visuals */
- if (cfg->level == 0) {
- __GLXFBConfig *proxy_cfg;
-
- __glXFBConfigs[ __glXNumFBConfigs * (numscreens+1) + 1 ] =
- &dmxScreen0->fbconfigs[c];
-
- proxy_cfg = malloc( sizeof(__GLXFBConfig) );
- memcpy( proxy_cfg, cfg, sizeof(__GLXFBConfig) );
- proxy_cfg->id = FakeClientID(0);
- /* visual will be associated later in __glXGetFBConfigs */
- proxy_cfg->associatedVisualId = (unsigned int)-1;
-
- __glXFBConfigs[ __glXNumFBConfigs * (numscreens+1) + 0 ] = proxy_cfg;
-
- __glXNumFBConfigs++;
- }
-
- }
-
- }
-
- }
-
-}
-
-void __glXScreenReset(void)
-{
- __glXNumActiveScreens = 0;
-}
-
-char *__glXGetServerString( unsigned int name )
-{
- char *ret = NULL;
-
- switch( name) {
-
- case GLX_VENDOR:
- ret = GLXServerVendorName;
- break;
-
- case GLX_VERSION:
- ret = GLXServerVersion;
- break;
-
- case GLX_EXTENSIONS:
- ret = ExtensionsString;
- break;
-
- default:
- break;
- }
-
- return ret;
-
-}
-
-
-__GLXFBConfig *glxLookupFBConfig( GLXFBConfigID id )
-{
- int i,j;
-
- for (i=0, j=0; i<__glXNumFBConfigs; i++,j+=(__glXNumActiveScreens+1) ) {
- if ( __glXFBConfigs[j]->id == id)
- return __glXFBConfigs[j];
- }
-
- return NULL;
-}
-
-__GLXFBConfig *glxLookupFBConfigByVID( VisualID vid )
-{
- int i,j;
-
- for (i=0, j=0; i<__glXNumFBConfigs; i++,j+=(__glXNumActiveScreens+1) ) {
- if ( __glXFBConfigs[j]->associatedVisualId == vid)
- return __glXFBConfigs[j];
- }
-
- return NULL;
-}
-
-__GLXFBConfig *glxLookupBackEndFBConfig( GLXFBConfigID id, int screen )
-{
- int i;
- int j;
-
- for (i=0, j=0; i<__glXNumFBConfigs; i++,j+=(__glXNumActiveScreens+1) ) {
- if ( __glXFBConfigs[j]->id == id)
- return __glXFBConfigs[j+screen+1];
- }
-
- return NULL;
-
-}
-
-int glxIsExtensionSupported( char *ext )
-{
- return( strstr(ExtensionsString, ext) != NULL );
-}
+/*
+ * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+ * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice including the dates of first publication and
+ * either this permission notice or a reference to
+ * http://oss.sgi.com/projects/FreeB/
+ * shall be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * Except as contained in this notice, the name of Silicon Graphics, Inc.
+ * shall not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization from
+ * Silicon Graphics, Inc.
+ */
+
+#ifdef HAVE_DMX_CONFIG_H
+#include <dmx-config.h>
+#endif
+
+#include "dmx.h"
+#include "dmxlog.h"
+
+#include "glxserver.h"
+
+#include <windowstr.h>
+
+#include "glxfbconfig.h"
+
+#ifdef PANORAMIX
+#include "panoramiXsrv.h"
+#endif
+
+__GLXscreenInfo *__glXActiveScreens;
+GLint __glXNumActiveScreens;
+
+__GLXFBConfig **__glXFBConfigs;
+int __glXNumFBConfigs;
+
+static char GLXServerVendorName[] = "SGI DMX/glxProxy";
+static char GLXServerVersion[64];
+static char GLXServerExtensions[] =
+ "GLX_EXT_visual_info "
+ "GLX_EXT_visual_rating "
+ "GLX_EXT_import_context "
+ "GLX_SGIX_fbconfig "
+ "GLX_SGI_make_current_read "
+ "GLX_SGI_swap_control "
+ ;
+
+static char ExtensionsString[1024];
+
+static void CalcServerVersionAndExtensions( void )
+{
+ int s;
+ xGLXQueryVersionReq *req;
+ xGLXQueryVersionReply reply;
+ char **be_extensions;
+ char *ext;
+ char *denied_extensions;
+
+ /*
+ * set the server glx version to be the minimum version
+ * supported by all back-end servers
+ */
+ __glXVersionMajor = 0;
+ __glXVersionMinor = 0;
+ for (s=0; s<__glXNumActiveScreens; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = dmxScreen->beDisplay;
+
+ /* Send the glXQueryVersion request */
+ LockDisplay(dpy);
+ GetReq(GLXQueryVersion,req);
+ req->reqType = dmxScreen->glxMajorOpcode;
+ req->glxCode = X_GLXQueryVersion;
+ req->majorVersion = GLX_SERVER_MAJOR_VERSION;
+ req->minorVersion = GLX_SERVER_MINOR_VERSION;
+ _XReply(dpy, (xReply*) &reply, 0, False);
+ UnlockDisplay(dpy);
+ SyncHandle();
+
+ if (s == 0) {
+ __glXVersionMajor = reply.majorVersion;
+ __glXVersionMinor = reply.minorVersion;
+ }
+ else {
+ if (reply.majorVersion < __glXVersionMajor) {
+ __glXVersionMajor = reply.majorVersion;
+ __glXVersionMinor = reply.minorVersion;
+ }
+ else if ( (reply.majorVersion == __glXVersionMajor) &&
+ (reply.minorVersion < __glXVersionMinor) ) {
+ __glXVersionMinor = reply.minorVersion;
+ }
+ }
+
+ }
+
+ if (GLX_SERVER_MAJOR_VERSION < __glXVersionMajor) {
+ __glXVersionMajor = GLX_SERVER_MAJOR_VERSION;
+ __glXVersionMinor = GLX_SERVER_MINOR_VERSION;
+ }
+ else if ( (GLX_SERVER_MAJOR_VERSION == __glXVersionMajor) &&
+ (GLX_SERVER_MINOR_VERSION < __glXVersionMinor) ) {
+ __glXVersionMinor = GLX_SERVER_MINOR_VERSION;
+ }
+
+ sprintf(GLXServerVersion, "%d.%d DMX %d back-end server(s)",
+ __glXVersionMajor, __glXVersionMinor, __glXNumActiveScreens );
+ /*
+ * set the ExtensionsString to the minimum extensions string
+ */
+ ExtensionsString[0] = '\0';
+
+ /*
+ * read extensions strings of all back-end servers
+ */
+ be_extensions = (char **)malloc( __glXNumActiveScreens * sizeof(char *) );
+ if (!be_extensions)
+ return;
+
+ for (s=0; s<__glXNumActiveScreens; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+ Display *dpy = dmxScreen->beDisplay;
+ xGLXQueryServerStringReq *req;
+ xGLXQueryServerStringReply reply;
+ int length, numbytes, slop;
+
+ /* Send the glXQueryServerString request */
+ LockDisplay(dpy);
+ GetReq(GLXQueryServerString,req);
+ req->reqType = dmxScreen->glxMajorOpcode;
+ req->glxCode = X_GLXQueryServerString;
+ req->screen = DefaultScreen(dpy);
+ req->name = GLX_EXTENSIONS;
+ _XReply(dpy, (xReply*) &reply, 0, False);
+
+ length = (int)reply.length;
+ numbytes = (int)reply.n;
+ slop = numbytes * __GLX_SIZE_INT8 & 3;
+ be_extensions[s] = (char *)malloc(numbytes);
+ if (!be_extensions[s]) {
+ /* Throw data on the floor */
+ _XEatData(dpy, length);
+ } else {
+ _XRead(dpy, (char *)be_extensions[s], numbytes);
+ if (slop) _XEatData(dpy,4-slop);
+ }
+ UnlockDisplay(dpy);
+ SyncHandle();
+ }
+
+ /*
+ * extensions string will include only extensions that our
+ * server supports as well as all back-end servers supports.
+ * extensions that are in the DMX_DENY_EXTENSIONS string will
+ * not be supported.
+ */
+ denied_extensions = getenv("DMX_DENY_GLX_EXTENSIONS");
+ ext = strtok(GLXServerExtensions, " ");
+ while( ext ) {
+ int supported = 1;
+
+ if (denied_extensions && strstr(denied_extensions, ext)) {
+ supported = 0;
+ }
+ else {
+ for (s=0; s<__glXNumActiveScreens && supported; s++) {
+ if ( !strstr(be_extensions[s], ext) ) {
+ supported = 0;
+ }
+ }
+ }
+
+ if (supported) {
+ strcat(ExtensionsString, ext);
+ strcat(ExtensionsString, " ");
+ }
+
+ ext = strtok(NULL, " ");
+ }
+
+ /*
+ * release temporary storage
+ */
+ for (s=0; s<__glXNumActiveScreens; s++) {
+ free(be_extensions[s]);
+ }
+ free( be_extensions );
+
+ if (dmxGLXSwapGroupSupport) {
+ if (!denied_extensions ||
+ !strstr(denied_extensions, "GLX_SGIX_swap_group")) {
+ strcat(ExtensionsString, "GLX_SGIX_swap_group");
+ if (!denied_extensions ||
+ !strstr(denied_extensions, "GLX_SGIX_swap_barrier")) {
+ strcat(ExtensionsString, " GLX_SGIX_swap_barrier");
+ }
+ }
+ }
+
+}
+
+void __glXScreenInit(GLint numscreens)
+{
+ int s;
+ int c;
+ DMXScreenInfo *dmxScreen0 = &dmxScreens[0];
+ __glXNumActiveScreens = numscreens;
+
+
+ CalcServerVersionAndExtensions();
+
+
+ __glXFBConfigs = NULL;
+ __glXNumFBConfigs = 0;
+
+ if ( (__glXVersionMajor == 1 && __glXVersionMinor >= 3) ||
+ (__glXVersionMajor > 1) ||
+ ( strstr(ExtensionsString, "GLX_SGIX_fbconfig") ) ) {
+
+ /*
+ // Initialize FBConfig info.
+ // find the set of FBConfigs that are present on all back-end
+ // servers - only those configs will be supported
+ */
+ __glXFBConfigs = (__GLXFBConfig **)malloc( dmxScreen0->numFBConfigs *
+ (numscreens+1) * sizeof(__GLXFBConfig *) );
+ __glXNumFBConfigs = 0;
+
+ for (c=0; c<dmxScreen0->numFBConfigs; c++) {
+ __GLXFBConfig *cfg = NULL;
+
+ if (numscreens > 1) {
+ for (s=1; s<numscreens; s++) {
+ DMXScreenInfo *dmxScreen = &dmxScreens[s];
+
+ cfg = FindMatchingFBConfig( &dmxScreen0->fbconfigs[c],
+ dmxScreen->fbconfigs,
+ dmxScreen->numFBConfigs );
+ __glXFBConfigs[ __glXNumFBConfigs * (numscreens+1) + s + 1 ] = cfg;
+ if (!cfg) {
+ dmxLog(dmxInfo,"screen0 FBConfig 0x%x is missing on screen#%d\n", dmxScreen0->fbconfigs[c].id, s);
+ break;
+ }
+ else {
+ dmxLog(dmxInfo,"screen0 FBConfig 0x%x matched to 0x%x on screen#%d\n", dmxScreen0->fbconfigs[c].id, cfg->id, s);
+ }
+ }
+ }
+ else {
+ cfg = &dmxScreen0->fbconfigs[c];
+ }
+
+ if (cfg) {
+
+ /* filter out overlay visuals */
+ if (cfg->level == 0) {
+ __GLXFBConfig *proxy_cfg;
+
+ __glXFBConfigs[ __glXNumFBConfigs * (numscreens+1) + 1 ] =
+ &dmxScreen0->fbconfigs[c];
+
+ proxy_cfg = malloc( sizeof(__GLXFBConfig) );
+ memcpy( proxy_cfg, cfg, sizeof(__GLXFBConfig) );
+ proxy_cfg->id = FakeClientID(0);
+ /* visual will be associated later in __glXGetFBConfigs */
+ proxy_cfg->associatedVisualId = (unsigned int)-1;
+
+ __glXFBConfigs[ __glXNumFBConfigs * (numscreens+1) + 0 ] = proxy_cfg;
+
+ __glXNumFBConfigs++;
+ }
+
+ }
+
+ }
+
+ }
+
+}
+
+void __glXScreenReset(void)
+{
+ __glXNumActiveScreens = 0;
+}
+
+char *__glXGetServerString( unsigned int name )
+{
+ char *ret = NULL;
+
+ switch( name) {
+
+ case GLX_VENDOR:
+ ret = GLXServerVendorName;
+ break;
+
+ case GLX_VERSION:
+ ret = GLXServerVersion;
+ break;
+
+ case GLX_EXTENSIONS:
+ ret = ExtensionsString;
+ break;
+
+ default:
+ break;
+ }
+
+ return ret;
+
+}
+
+int glxIsExtensionSupported( char *ext )
+{
+ return( strstr(ExtensionsString, ext) != NULL );
+}
diff --git a/xorg-server/hw/dmx/glxProxy/glxserver.h b/xorg-server/hw/dmx/glxProxy/glxserver.h
index b2be58219..03e95b865 100644
--- a/xorg-server/hw/dmx/glxProxy/glxserver.h
+++ b/xorg-server/hw/dmx/glxProxy/glxserver.h
@@ -1,309 +1,303 @@
-#ifndef _GLX_server_h_
-#define _GLX_server_h_
-
-/*
- * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
- * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice including the dates of first publication and
- * either this permission notice or a reference to
- * http://oss.sgi.com/projects/FreeB/
- * shall be included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
- * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Except as contained in this notice, the name of Silicon Graphics, Inc.
- * shall not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization from
- * Silicon Graphics, Inc.
- */
-
-#include "dmx.h"
-
-#include <misc.h>
-#include <dixstruct.h>
-#include <pixmapstr.h>
-#include <gcstruct.h>
-#include <extnsionst.h>
-#include <resource.h>
-#include <scrnintstr.h>
-
-
-/*
-** The X header misc.h defines these math functions.
-*/
-#undef abs
-#undef fabs
-
-#define GL_GLEXT_PROTOTYPES /* we want prototypes */
-#include <GL/gl.h>
-#include <GL/glxproto.h>
-#include <GL/glxint.h>
-
-#include "glxscreens.h"
-#include "glxdrawable.h"
-#include "glxcontext.h"
-#include "glxerror.h"
-
-
-#define GLX_SERVER_MAJOR_VERSION 1
-#define GLX_SERVER_MINOR_VERSION 3
-
-#ifndef True
-#define True 1
-#endif
-#ifndef False
-#define False 0
-#endif
-
-/*
-** GLX resources.
-typedef XID GLXContextID;
-typedef XID GLXPixmap;
-typedef XID GLXDrawable;
-typedef XID GLXWindow;
-typedef XID GLXPbuffer;
-
-typedef struct __GLXcontextRec *GLXContext;
-*/
-typedef struct __GLXclientStateRec __GLXclientState;
-
-extern __GLXscreenInfo *__glXActiveScreens;
-extern GLint __glXNumActiveScreens;
-
-/************************************************************************/
-
-/*
-** The last context used (from the server's persective) is cached.
-*/
-extern __GLXcontext *__glXLastContext;
-extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
-
-/************************************************************************/
-
-typedef struct {
- int elem_size; /* element size in bytes */
- int nelems; /* number of elements to swap */
- void (*swapfunc)(GLbyte *pc);
-} __GLXRenderSwapInfo;
-
-/*
-** State kept per client.
-*/
-struct __GLXclientStateRec {
- /*
- ** Whether this structure is currently being used to support a client.
- */
- Bool inUse;
-
- /*
- ** Buffer for returned data.
- */
- GLbyte *returnBuf;
- GLint returnBufSize;
-
- /*
- ** Keep a list of all the contexts that are current for this client's
- ** threads.
- */
- __GLXcontext **currentContexts;
- DrawablePtr *currentDrawables;
- GLint numCurrentContexts;
-
- /* Back pointer to X client record */
- ClientPtr client;
-
- int GLClientmajorVersion;
- int GLClientminorVersion;
- char *GLClientextensions;
-
- GLXContextTag *be_currentCTag;
- Display **be_displays;
-
- /*
- ** Keep track of large rendering commands, which span multiple requests.
- */
- GLint largeCmdBytesSoFar; /* bytes received so far */
- GLint largeCmdBytesTotal; /* total bytes expected */
- GLint largeCmdRequestsSoFar; /* requests received so far */
- GLint largeCmdRequestsTotal; /* total requests expected */
- void (*largeCmdRequestsSwapProc)(GLbyte *);
- __GLXRenderSwapInfo *largeCmdRequestsSwap_info;
- GLbyte *largeCmdBuf;
- GLint largeCmdBufSize;
- GLint largeCmdMaxReqDataSize;
-
-};
-
-extern __GLXclientState *__glXClients[];
-
-/************************************************************************/
-
-/*
-** Dispatch tables.
-*/
-typedef void (*__GLXdispatchRenderProcPtr)(GLbyte *);
-typedef int (*__GLXdispatchSingleProcPtr)(__GLXclientState *, GLbyte *);
-typedef int (*__GLXdispatchVendorPrivProcPtr)(__GLXclientState *, GLbyte *);
-extern __GLXdispatchSingleProcPtr __glXSingleTable[];
-extern __GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[];
-extern __GLXdispatchSingleProcPtr __glXSwapSingleTable[];
-extern __GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[];
-extern __GLXdispatchRenderProcPtr __glXSwapRenderTable[];
-
-extern __GLXRenderSwapInfo __glXSwapRenderTable_EXT[];
-
-/*
- * Dispatch for GLX commands.
- */
-typedef int (*__GLXprocPtr)(__GLXclientState *, char *pc);
-extern __GLXprocPtr __glXProcTable[];
-
-/*
- * Tables for computing the size of each rendering command.
- */
-typedef struct {
- int bytes;
- int (*varsize)(GLbyte *pc, Bool swap);
-} __GLXrenderSizeData;
-extern __GLXrenderSizeData __glXRenderSizeTable[];
-extern __GLXrenderSizeData __glXRenderSizeTable_EXT[];
-
-/************************************************************************/
-
-/*
-** X resources.
-*/
-extern RESTYPE __glXContextRes;
-extern RESTYPE __glXClientRes;
-extern RESTYPE __glXPixmapRes;
-extern RESTYPE __glXDrawableRes;
-extern RESTYPE __glXWindowRes;
-extern RESTYPE __glXPbufferRes;
-
-/************************************************************************/
-
-/*
-** Prototypes.
-*/
-
-
-extern char *__glXcombine_strings(const char *, const char *);
-
-extern void __glXDisp_DrawArrays(GLbyte*);
-extern void __glXDispSwap_DrawArrays(GLbyte*);
-
-
-/*
-** Routines for sending swapped replies.
-*/
-
-extern void __glXSwapMakeCurrentReply(ClientPtr client,
- xGLXMakeCurrentReadSGIReply *reply);
-
-extern void __glXSwapIsDirectReply(ClientPtr client,
- xGLXIsDirectReply *reply);
-extern void __glXSwapQueryVersionReply(ClientPtr client,
- xGLXQueryVersionReply *reply);
-extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
- xGLXQueryContextInfoEXTReply *reply,
- int *buf);
-extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
- xGLXQueryExtensionsStringReply *reply, char *buf);
-extern void glxSwapQueryServerStringReply(ClientPtr client,
- xGLXQueryServerStringReply *reply, char *buf);
-extern void __glXSwapQueryContextReply(ClientPtr client,
- xGLXQueryContextReply *reply, int *buf);
-extern void __glXSwapGetDrawableAttributesReply(ClientPtr client,
- xGLXGetDrawableAttributesReply *reply, int *buf);
-extern void __glXSwapQueryMaxSwapBarriersSGIXReply(ClientPtr client,
- xGLXQueryMaxSwapBarriersSGIXReply *reply);
-
-/*
- * Routines for computing the size of variably-sized rendering commands.
- */
-
-extern int __glXTypeSize(GLenum enm);
-extern int __glXImageSize(GLenum format, GLenum type, GLsizei w, GLsizei h,
- GLint rowLength, GLint skipRows, GLint alignment);
-extern int __glXImage3DSize(GLenum format, GLenum type,
- GLsizei w, GLsizei h, GLsizei d,
- GLint imageHeight, GLint rowLength,
- GLint skipImages, GLint skipRows,
- GLint alignment);
-
-extern int __glXCallListsReqSize(GLbyte *pc, Bool swap);
-extern int __glXBitmapReqSize(GLbyte *pc, Bool swap);
-extern int __glXFogfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXFogivReqSize(GLbyte *pc, Bool swap);
-extern int __glXLightfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXLightivReqSize(GLbyte *pc, Bool swap);
-extern int __glXLightModelfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXLightModelivReqSize(GLbyte *pc, Bool swap);
-extern int __glXMaterialfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXMaterialivReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexParameterfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexParameterivReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexImage1DReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexImage2DReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexEnvfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexEnvivReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexGendvReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexGenfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexGenivReqSize(GLbyte *pc, Bool swap);
-extern int __glXMap1dReqSize(GLbyte *pc, Bool swap);
-extern int __glXMap1fReqSize(GLbyte *pc, Bool swap);
-extern int __glXMap2dReqSize(GLbyte *pc, Bool swap);
-extern int __glXMap2fReqSize(GLbyte *pc, Bool swap);
-extern int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXPixelMapuivReqSize(GLbyte *pc, Bool swap);
-extern int __glXPixelMapusvReqSize(GLbyte *pc, Bool swap);
-extern int __glXDrawPixelsReqSize(GLbyte *pc, Bool swap);
-extern int __glXDrawArraysSize(GLbyte *pc, Bool swap);
-extern int __glXPrioritizeTexturesReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexSubImage1DReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexSubImage2DReqSize(GLbyte *pc, Bool swap);
-extern int __glXTexImage3DReqSize(GLbyte *pc, Bool swap );
-extern int __glXTexSubImage3DReqSize(GLbyte *pc, Bool swap);
-extern int __glXConvolutionFilter1DReqSize(GLbyte *pc, Bool swap);
-extern int __glXConvolutionFilter2DReqSize(GLbyte *pc, Bool swap);
-extern int __glXConvolutionParameterivReqSize(GLbyte *pc, Bool swap);
-extern int __glXConvolutionParameterfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXSeparableFilter2DReqSize(GLbyte *pc, Bool swap);
-extern int __glXColorTableReqSize(GLbyte *pc, Bool swap);
-extern int __glXColorSubTableReqSize(GLbyte *pc, Bool swap);
-extern int __glXColorTableParameterfvReqSize(GLbyte *pc, Bool swap);
-extern int __glXColorTableParameterivReqSize(GLbyte *pc, Bool swap);
-
-/*
- * Routines for computing the size of returned data.
- */
-extern int __glXConvolutionParameterivSize(GLenum pname);
-extern int __glXConvolutionParameterfvSize(GLenum pname);
-extern int __glXColorTableParameterfvSize(GLenum pname);
-extern int __glXColorTableParameterivSize(GLenum pname);
-
-extern void __glXFreeGLXWindow(__glXWindow *pGlxWindow);
-extern void __glXFreeGLXPbuffer(__glXPbuffer *pGlxPbuffer);
-
-extern int __glXVersionMajor;
-extern int __glXVersionMinor;
-
-#define __GLX_IS_VERSION_SUPPORTED(major,minor) \
- ( (__glXVersionMajor > (major)) || \
- ((__glXVersionMajor == (major)) && (__glXVersionMinor >= (minor))) )
-
-#endif /* !__GLX_server_h__ */
+#ifndef _GLX_server_h_
+#define _GLX_server_h_
+
+/*
+ * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
+ * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice including the dates of first publication and
+ * either this permission notice or a reference to
+ * http://oss.sgi.com/projects/FreeB/
+ * shall be included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ *
+ * Except as contained in this notice, the name of Silicon Graphics, Inc.
+ * shall not be used in advertising or otherwise to promote the sale, use or
+ * other dealings in this Software without prior written authorization from
+ * Silicon Graphics, Inc.
+ */
+
+#include "dmx.h"
+
+#include <misc.h>
+#include <dixstruct.h>
+#include <pixmapstr.h>
+#include <gcstruct.h>
+#include <extnsionst.h>
+#include <resource.h>
+#include <scrnintstr.h>
+
+
+#define GL_GLEXT_PROTOTYPES /* we want prototypes */
+#include <GL/gl.h>
+#include <GL/glxproto.h>
+#include <GL/glxint.h>
+
+#include "glxscreens.h"
+#include "glxdrawable.h"
+#include "glxcontext.h"
+#include "glxerror.h"
+
+
+#define GLX_SERVER_MAJOR_VERSION 1
+#define GLX_SERVER_MINOR_VERSION 3
+
+#ifndef True
+#define True 1
+#endif
+#ifndef False
+#define False 0
+#endif
+
+/*
+** GLX resources.
+typedef XID GLXContextID;
+typedef XID GLXPixmap;
+typedef XID GLXDrawable;
+typedef XID GLXWindow;
+typedef XID GLXPbuffer;
+
+typedef struct __GLXcontextRec *GLXContext;
+*/
+typedef struct __GLXclientStateRec __GLXclientState;
+
+extern __GLXscreenInfo *__glXActiveScreens;
+extern GLint __glXNumActiveScreens;
+
+/************************************************************************/
+
+/*
+** The last context used (from the server's persective) is cached.
+*/
+extern __GLXcontext *__glXLastContext;
+extern __GLXcontext *__glXForceCurrent(__GLXclientState*, GLXContextTag, int*);
+
+/************************************************************************/
+
+typedef struct {
+ int elem_size; /* element size in bytes */
+ int nelems; /* number of elements to swap */
+ void (*swapfunc)(GLbyte *pc);
+} __GLXRenderSwapInfo;
+
+/*
+** State kept per client.
+*/
+struct __GLXclientStateRec {
+ /*
+ ** Whether this structure is currently being used to support a client.
+ */
+ Bool inUse;
+
+ /*
+ ** Buffer for returned data.
+ */
+ GLbyte *returnBuf;
+ GLint returnBufSize;
+
+ /*
+ ** Keep a list of all the contexts that are current for this client's
+ ** threads.
+ */
+ __GLXcontext **currentContexts;
+ DrawablePtr *currentDrawables;
+ GLint numCurrentContexts;
+
+ /* Back pointer to X client record */
+ ClientPtr client;
+
+ int GLClientmajorVersion;
+ int GLClientminorVersion;
+ char *GLClientextensions;
+
+ GLXContextTag *be_currentCTag;
+ Display **be_displays;
+
+ /*
+ ** Keep track of large rendering commands, which span multiple requests.
+ */
+ GLint largeCmdBytesSoFar; /* bytes received so far */
+ GLint largeCmdBytesTotal; /* total bytes expected */
+ GLint largeCmdRequestsSoFar; /* requests received so far */
+ GLint largeCmdRequestsTotal; /* total requests expected */
+ void (*largeCmdRequestsSwapProc)(GLbyte *);
+ __GLXRenderSwapInfo *largeCmdRequestsSwap_info;
+ GLbyte *largeCmdBuf;
+ GLint largeCmdBufSize;
+ GLint largeCmdMaxReqDataSize;
+
+};
+
+extern __GLXclientState *__glXClients[];
+
+/************************************************************************/
+
+/*
+** Dispatch tables.
+*/
+typedef void (*__GLXdispatchRenderProcPtr)(GLbyte *);
+typedef int (*__GLXdispatchSingleProcPtr)(__GLXclientState *, GLbyte *);
+typedef int (*__GLXdispatchVendorPrivProcPtr)(__GLXclientState *, GLbyte *);
+extern __GLXdispatchSingleProcPtr __glXSingleTable[];
+extern __GLXdispatchVendorPrivProcPtr __glXVendorPrivTable_EXT[];
+extern __GLXdispatchSingleProcPtr __glXSwapSingleTable[];
+extern __GLXdispatchVendorPrivProcPtr __glXSwapVendorPrivTable_EXT[];
+extern __GLXdispatchRenderProcPtr __glXSwapRenderTable[];
+
+extern __GLXRenderSwapInfo __glXSwapRenderTable_EXT[];
+
+/*
+ * Dispatch for GLX commands.
+ */
+typedef int (*__GLXprocPtr)(__GLXclientState *, char *pc);
+extern __GLXprocPtr __glXProcTable[];
+
+/*
+ * Tables for computing the size of each rendering command.
+ */
+typedef struct {
+ int bytes;
+ int (*varsize)(GLbyte *pc, Bool swap);
+} __GLXrenderSizeData;
+extern __GLXrenderSizeData __glXRenderSizeTable[];
+extern __GLXrenderSizeData __glXRenderSizeTable_EXT[];
+
+/************************************************************************/
+
+/*
+** X resources.
+*/
+extern RESTYPE __glXContextRes;
+extern RESTYPE __glXClientRes;
+extern RESTYPE __glXPixmapRes;
+extern RESTYPE __glXDrawableRes;
+extern RESTYPE __glXWindowRes;
+extern RESTYPE __glXPbufferRes;
+
+/************************************************************************/
+
+/*
+** Prototypes.
+*/
+
+
+extern char *__glXcombine_strings(const char *, const char *);
+
+extern void __glXDisp_DrawArrays(GLbyte*);
+extern void __glXDispSwap_DrawArrays(GLbyte*);
+
+
+/*
+** Routines for sending swapped replies.
+*/
+
+extern void __glXSwapMakeCurrentReply(ClientPtr client,
+ xGLXMakeCurrentReadSGIReply *reply);
+
+extern void __glXSwapIsDirectReply(ClientPtr client,
+ xGLXIsDirectReply *reply);
+extern void __glXSwapQueryVersionReply(ClientPtr client,
+ xGLXQueryVersionReply *reply);
+extern void __glXSwapQueryContextInfoEXTReply(ClientPtr client,
+ xGLXQueryContextInfoEXTReply *reply,
+ int *buf);
+extern void glxSwapQueryExtensionsStringReply(ClientPtr client,
+ xGLXQueryExtensionsStringReply *reply, char *buf);
+extern void glxSwapQueryServerStringReply(ClientPtr client,
+ xGLXQueryServerStringReply *reply, char *buf);
+extern void __glXSwapQueryContextReply(ClientPtr client,
+ xGLXQueryContextReply *reply, int *buf);
+extern void __glXSwapGetDrawableAttributesReply(ClientPtr client,
+ xGLXGetDrawableAttributesReply *reply, int *buf);
+extern void __glXSwapQueryMaxSwapBarriersSGIXReply(ClientPtr client,
+ xGLXQueryMaxSwapBarriersSGIXReply *reply);
+
+/*
+ * Routines for computing the size of variably-sized rendering commands.
+ */
+
+extern int __glXTypeSize(GLenum enm);
+extern int __glXImageSize(GLenum format, GLenum type, GLsizei w, GLsizei h,
+ GLint rowLength, GLint skipRows, GLint alignment);
+extern int __glXImage3DSize(GLenum format, GLenum type,
+ GLsizei w, GLsizei h, GLsizei d,
+ GLint imageHeight, GLint rowLength,
+ GLint skipImages, GLint skipRows,
+ GLint alignment);
+
+extern int __glXCallListsReqSize(GLbyte *pc, Bool swap);
+extern int __glXBitmapReqSize(GLbyte *pc, Bool swap);
+extern int __glXFogfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXFogivReqSize(GLbyte *pc, Bool swap);
+extern int __glXLightfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXLightivReqSize(GLbyte *pc, Bool swap);
+extern int __glXLightModelfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXLightModelivReqSize(GLbyte *pc, Bool swap);
+extern int __glXMaterialfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXMaterialivReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexParameterfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexParameterivReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexImage1DReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexImage2DReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexEnvfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexEnvivReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexGendvReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexGenfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexGenivReqSize(GLbyte *pc, Bool swap);
+extern int __glXMap1dReqSize(GLbyte *pc, Bool swap);
+extern int __glXMap1fReqSize(GLbyte *pc, Bool swap);
+extern int __glXMap2dReqSize(GLbyte *pc, Bool swap);
+extern int __glXMap2fReqSize(GLbyte *pc, Bool swap);
+extern int __glXPixelMapfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXPixelMapuivReqSize(GLbyte *pc, Bool swap);
+extern int __glXPixelMapusvReqSize(GLbyte *pc, Bool swap);
+extern int __glXDrawPixelsReqSize(GLbyte *pc, Bool swap);
+extern int __glXDrawArraysSize(GLbyte *pc, Bool swap);
+extern int __glXPrioritizeTexturesReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexSubImage1DReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexSubImage2DReqSize(GLbyte *pc, Bool swap);
+extern int __glXTexImage3DReqSize(GLbyte *pc, Bool swap );
+extern int __glXTexSubImage3DReqSize(GLbyte *pc, Bool swap);
+extern int __glXConvolutionFilter1DReqSize(GLbyte *pc, Bool swap);
+extern int __glXConvolutionFilter2DReqSize(GLbyte *pc, Bool swap);
+extern int __glXConvolutionParameterivReqSize(GLbyte *pc, Bool swap);
+extern int __glXConvolutionParameterfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXSeparableFilter2DReqSize(GLbyte *pc, Bool swap);
+extern int __glXColorTableReqSize(GLbyte *pc, Bool swap);
+extern int __glXColorSubTableReqSize(GLbyte *pc, Bool swap);
+extern int __glXColorTableParameterfvReqSize(GLbyte *pc, Bool swap);
+extern int __glXColorTableParameterivReqSize(GLbyte *pc, Bool swap);
+
+/*
+ * Routines for computing the size of returned data.
+ */
+extern int __glXConvolutionParameterivSize(GLenum pname);
+extern int __glXConvolutionParameterfvSize(GLenum pname);
+extern int __glXColorTableParameterfvSize(GLenum pname);
+extern int __glXColorTableParameterivSize(GLenum pname);
+
+extern void __glXFreeGLXWindow(__glXWindow *pGlxWindow);
+extern void __glXFreeGLXPbuffer(__glXPbuffer *pGlxPbuffer);
+
+extern int __glXVersionMajor;
+extern int __glXVersionMinor;
+
+#define __GLX_IS_VERSION_SUPPORTED(major,minor) \
+ ( (__glXVersionMajor > (major)) || \
+ ((__glXVersionMajor == (major)) && (__glXVersionMinor >= (minor))) )
+
+#endif /* !__GLX_server_h__ */
diff --git a/xorg-server/hw/dmx/glxProxy/render2swap.c b/xorg-server/hw/dmx/glxProxy/render2swap.c
index 81bb501ea..da9b565de 100644
--- a/xorg-server/hw/dmx/glxProxy/render2swap.c
+++ b/xorg-server/hw/dmx/glxProxy/render2swap.c
@@ -32,7 +32,7 @@
#include "unpack.h"
#include "g_disptab.h"
-GLint __glEvalComputeK(GLenum target)
+static GLint __glEvalComputeK(GLenum target)
{
switch (target) {
case GL_MAP1_VERTEX_4:
diff --git a/xorg-server/hw/dmx/input/dmxinputinit.c b/xorg-server/hw/dmx/input/dmxinputinit.c
index 1b067c725..16ecae38d 100644
--- a/xorg-server/hw/dmx/input/dmxinputinit.c
+++ b/xorg-server/hw/dmx/input/dmxinputinit.c
@@ -671,9 +671,9 @@ static char *dmxMakeUniqueDeviceName(DMXLocalInputInfoPtr dmxLocal)
}
switch (dmxLocal->type) {
- case DMX_LOCAL_KEYBOARD: XmuSnprintf(buf, LEN, "Keyboard%d", k++); break;
- case DMX_LOCAL_MOUSE: XmuSnprintf(buf, LEN, "Mouse%d", m++); break;
- default: XmuSnprintf(buf, LEN, "Other%d", o++); break;
+ case DMX_LOCAL_KEYBOARD: snprintf(buf, LEN, "Keyboard%d", k++); break;
+ case DMX_LOCAL_MOUSE: snprintf(buf, LEN, "Mouse%d", m++); break;
+ default: snprintf(buf, LEN, "Other%d", o++); break;
}
return buf;
diff --git a/xorg-server/hw/dmx/input/lnx-keyboard.c b/xorg-server/hw/dmx/input/lnx-keyboard.c
index 269e84435..06e9ec722 100644
--- a/xorg-server/hw/dmx/input/lnx-keyboard.c
+++ b/xorg-server/hw/dmx/input/lnx-keyboard.c
@@ -1,990 +1,990 @@
-/* Portions of this file were derived from the following files:
- *
- **********************************************************************
- *
- * xfree86/common/{xf86Io.c,xf86Kbd.c,xf86Events.c}
- *
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Thomas Roell not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Thomas Roell makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- **********************************************************************
- *
- * xfree86/common/xf86KbdLnx.c
- *
- * Linux version of keymapping setup. The kernel (since 0.99.14) has support
- * for fully remapping the keyboard, but there are some differences between
- * the Linux map and the SVR4 map (esp. in the extended keycodes). We also
- * remove the restriction on what keycodes can be remapped.
- * Orest Zborowski.
- *
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Thomas Roell not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Thomas Roell makes no representations
- * about the suitability of this software for any purpose. It is provided
- * "as is" without express or implied warranty.
- *
- * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- *
- **********************************************************************
- *
- * xfree86/os-support/linux/lnx_io.c
- *
- * Copyright 1992 by Orest Zborowski <obz@Kodak.com>
- * Copyright 1993 by David Dawes <dawes@xfree86.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the names of Orest Zborowski and David Dawes
- * not be used in advertising or publicity pertaining to distribution of
- * the software without specific, written prior permission. Orest Zborowski
- * and David Dawes make no representations about the suitability of this
- * software for any purpose. It is provided "as is" without express or
- * implied warranty.
- *
- * OREST ZBOROWSKI AND DAVID DAWES DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI OR DAVID DAWES BE LIABLE
- * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- */
-
-/*
- * Copyright 2001-2003 Red Hat Inc., Durham, North Carolina.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation on the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial
- * portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-/*
- * Authors:
- * Rickard E. (Rik) Faith <faith@redhat.com>
- *
- */
-
-/** \file
- *
- * This code implements a low-level device driver for the Linux
- * keyboard. The code is derived from code by Thomas Roell, Orest
- * Zborowski, and David Dawes (see the source code for complete
- * references). */
-
-#ifdef HAVE_DMX_CONFIG_H
-#include <dmx-config.h>
-#endif
-
-/*****************************************************************************/
-/* Define some macros to make it easier to move this file to another
- * part of the Xserver tree. All calls to the dmx* layer are #defined
- * here for the .c file. The .h file will also have to be edited. */
-#include "dmxinputinit.h"
-#include "lnx-keyboard.h"
-
-#define GETPRIV myPrivate *priv \
- = ((DMXLocalInputInfoPtr)(pDev->devicePrivate))->private
-
-#define LOG0(f) dmxLog(dmxDebug,f)
-#define LOG1(f,a) dmxLog(dmxDebug,f,a)
-#define LOG2(f,a,b) dmxLog(dmxDebug,f,a,b)
-#define LOG3(f,a,b,c) dmxLog(dmxDebug,f,a,b,c)
-#define FATAL0(f) dmxLog(dmxFatal,f)
-#define FATAL1(f,a) dmxLog(dmxFatal,f,a)
-#define FATAL2(f,a,b) dmxLog(dmxFatal,f,a,b)
-#define MOTIONPROC dmxMotionProcPtr
-#define ENQUEUEPROC dmxEnqueueProcPtr
-#define CHECKPROC dmxCheckSpecialProcPtr
-#define SWITCHRETPROC dmxVTSwitchReturnProcPtr
-#define BLOCK DMXBlockType
-#define MESSAGE "\033c\n\n\nDMX taking input from this console..."
-#define FINALMESSAGE "\033cDMX terminated."
-
-/* End of interface definitions. */
-/*****************************************************************************/
-
-#include "inputstr.h"
-#include <X11/Xos.h>
-#include <sys/ioctl.h>
-#include <errno.h>
-#include <signal.h>
-#include <sys/vt.h>
-#include <sys/kd.h>
-#include <termios.h>
-#include "atKeynames.h"
-#if 00
-#include "xf86Keymap.h"
-#endif
-#include <linux/keyboard.h>
-#include <xkbsrv.h>
-
-#define NUM_AT2LNX (sizeof(at2lnx) / sizeof(at2lnx[0]))
-#define NUM_STATE_ENTRIES (256/32)
-
-
-/* Private area for Linux-style keyboards. */
-typedef struct _myPrivate {
- int fd;
- int vtno;
- int vtcurrent;
- int kbdtrans;
- struct termios kbdtty;
- int kbdType;
- CARD32 kbdState[NUM_STATE_ENTRIES];
- DeviceIntPtr pKeyboard;
- unsigned char prefix;
-
- int switched;
- SWITCHRETPROC switch_return;
- void *switch_return_data;
-
- /* For bell */
- int pitch;
- unsigned long duration;
-} myPrivate;
-
-static myPrivate *PRIV = NULL;
-
-#undef SYSCALL
-#define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
-
-static int kbdLinuxKeyDown(myPrivate *priv, int keyCode)
-{
- CARD8 byte = keyCode >> 5;
- CARD32 bit = 1 << (keyCode & 0x1f);
-
- if (byte > NUM_STATE_ENTRIES) return 0;
- return priv->kbdState[byte] & bit;
-}
-
-static void kbdLinuxKeyState(myPrivate *priv, int type, int keyCode)
-{
- CARD8 byte = keyCode >> 5;
- CARD32 bit = 1 << (keyCode & 0x1f);
-
- if (byte > NUM_STATE_ENTRIES) return;
- if (type == KeyPress) priv->kbdState[byte] |= bit;
- else priv->kbdState[byte] &= ~bit;
-}
-
-static KeySym linux_to_x[256] = {
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, XK_Escape,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
- XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
- XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
- XK_comma, XK_minus, XK_period, XK_slash,
- XK_0, XK_1, XK_2, XK_3,
- XK_4, XK_5, XK_6, XK_7,
- XK_8, XK_9, XK_colon, XK_semicolon,
- XK_less, XK_equal, XK_greater, XK_question,
- XK_at, XK_A, XK_B, XK_C,
- XK_D, XK_E, XK_F, XK_G,
- XK_H, XK_I, XK_J, XK_K,
- XK_L, XK_M, XK_N, XK_O,
- XK_P, XK_Q, XK_R, XK_S,
- XK_T, XK_U, XK_V, XK_W,
- XK_X, XK_Y, XK_Z, XK_bracketleft,
- XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
- XK_grave, XK_a, XK_b, XK_c,
- XK_d, XK_e, XK_f, XK_g,
- XK_h, XK_i, XK_j, XK_k,
- XK_l, XK_m, XK_n, XK_o,
- XK_p, XK_q, XK_r, XK_s,
- XK_t, XK_u, XK_v, XK_w,
- XK_x, XK_y, XK_z, XK_braceleft,
- XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- NoSymbol, NoSymbol, NoSymbol, NoSymbol,
- XK_nobreakspace,XK_exclamdown, XK_cent, XK_sterling,
- XK_currency, XK_yen, XK_brokenbar, XK_section,
- XK_diaeresis, XK_copyright, XK_ordfeminine, XK_guillemotleft,
- XK_notsign, XK_hyphen, XK_registered, XK_macron,
- XK_degree, XK_plusminus, XK_twosuperior, XK_threesuperior,
- XK_acute, XK_mu, XK_paragraph, XK_periodcentered,
- XK_cedilla, XK_onesuperior, XK_masculine, XK_guillemotright,
- XK_onequarter, XK_onehalf, XK_threequarters,XK_questiondown,
- XK_Agrave, XK_Aacute, XK_Acircumflex, XK_Atilde,
- XK_Adiaeresis, XK_Aring, XK_AE, XK_Ccedilla,
- XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis,
- XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis,
- XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute,
- XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_multiply,
- XK_Ooblique, XK_Ugrave, XK_Uacute, XK_Ucircumflex,
- XK_Udiaeresis, XK_Yacute, XK_THORN, XK_ssharp,
- XK_agrave, XK_aacute, XK_acircumflex, XK_atilde,
- XK_adiaeresis, XK_aring, XK_ae, XK_ccedilla,
- XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis,
- XK_igrave, XK_iacute, XK_icircumflex, XK_idiaeresis,
- XK_eth, XK_ntilde, XK_ograve, XK_oacute,
- XK_ocircumflex, XK_otilde, XK_odiaeresis, XK_division,
- XK_oslash, XK_ugrave, XK_uacute, XK_ucircumflex,
- XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis
-};
-
-/*
- * Maps the AT keycodes to Linux keycodes
- */
-static unsigned char at2lnx[NUM_KEYCODES] =
-{
- 0x01, /* KEY_Escape */ 0x02, /* KEY_1 */
- 0x03, /* KEY_2 */ 0x04, /* KEY_3 */
- 0x05, /* KEY_4 */ 0x06, /* KEY_5 */
- 0x07, /* KEY_6 */ 0x08, /* KEY_7 */
- 0x09, /* KEY_8 */ 0x0a, /* KEY_9 */
- 0x0b, /* KEY_0 */ 0x0c, /* KEY_Minus */
- 0x0d, /* KEY_Equal */ 0x0e, /* KEY_BackSpace */
- 0x0f, /* KEY_Tab */ 0x10, /* KEY_Q */
- 0x11, /* KEY_W */ 0x12, /* KEY_E */
- 0x13, /* KEY_R */ 0x14, /* KEY_T */
- 0x15, /* KEY_Y */ 0x16, /* KEY_U */
- 0x17, /* KEY_I */ 0x18, /* KEY_O */
- 0x19, /* KEY_P */ 0x1a, /* KEY_LBrace */
- 0x1b, /* KEY_RBrace */ 0x1c, /* KEY_Enter */
- 0x1d, /* KEY_LCtrl */ 0x1e, /* KEY_A */
- 0x1f, /* KEY_S */ 0x20, /* KEY_D */
- 0x21, /* KEY_F */ 0x22, /* KEY_G */
- 0x23, /* KEY_H */ 0x24, /* KEY_J */
- 0x25, /* KEY_K */ 0x26, /* KEY_L */
- 0x27, /* KEY_SemiColon */ 0x28, /* KEY_Quote */
- 0x29, /* KEY_Tilde */ 0x2a, /* KEY_ShiftL */
- 0x2b, /* KEY_BSlash */ 0x2c, /* KEY_Z */
- 0x2d, /* KEY_X */ 0x2e, /* KEY_C */
- 0x2f, /* KEY_V */ 0x30, /* KEY_B */
- 0x31, /* KEY_N */ 0x32, /* KEY_M */
- 0x33, /* KEY_Comma */ 0x34, /* KEY_Period */
- 0x35, /* KEY_Slash */ 0x36, /* KEY_ShiftR */
- 0x37, /* KEY_KP_Multiply */ 0x38, /* KEY_Alt */
- 0x39, /* KEY_Space */ 0x3a, /* KEY_CapsLock */
- 0x3b, /* KEY_F1 */ 0x3c, /* KEY_F2 */
- 0x3d, /* KEY_F3 */ 0x3e, /* KEY_F4 */
- 0x3f, /* KEY_F5 */ 0x40, /* KEY_F6 */
- 0x41, /* KEY_F7 */ 0x42, /* KEY_F8 */
- 0x43, /* KEY_F9 */ 0x44, /* KEY_F10 */
- 0x45, /* KEY_NumLock */ 0x46, /* KEY_ScrollLock */
- 0x47, /* KEY_KP_7 */ 0x48, /* KEY_KP_8 */
- 0x49, /* KEY_KP_9 */ 0x4a, /* KEY_KP_Minus */
- 0x4b, /* KEY_KP_4 */ 0x4c, /* KEY_KP_5 */
- 0x4d, /* KEY_KP_6 */ 0x4e, /* KEY_KP_Plus */
- 0x4f, /* KEY_KP_1 */ 0x50, /* KEY_KP_2 */
- 0x51, /* KEY_KP_3 */ 0x52, /* KEY_KP_0 */
- 0x53, /* KEY_KP_Decimal */ 0x54, /* KEY_SysReqest */
- 0x00, /* 0x55 */ 0x56, /* KEY_Less */
- 0x57, /* KEY_F11 */ 0x58, /* KEY_F12 */
- 0x66, /* KEY_Home */ 0x67, /* KEY_Up */
- 0x68, /* KEY_PgUp */ 0x69, /* KEY_Left */
- 0x5d, /* KEY_Begin */ 0x6a, /* KEY_Right */
- 0x6b, /* KEY_End */ 0x6c, /* KEY_Down */
- 0x6d, /* KEY_PgDown */ 0x6e, /* KEY_Insert */
- 0x6f, /* KEY_Delete */ 0x60, /* KEY_KP_Enter */
- 0x61, /* KEY_RCtrl */ 0x77, /* KEY_Pause */
- 0x63, /* KEY_Print */ 0x62, /* KEY_KP_Divide */
- 0x64, /* KEY_AltLang */ 0x65, /* KEY_Break */
- 0x00, /* KEY_LMeta */ 0x00, /* KEY_RMeta */
- 0x7A, /* KEY_Menu/FOCUS_PF11*/0x00, /* 0x6e */
- 0x7B, /* FOCUS_PF12 */ 0x00, /* 0x70 */
- 0x00, /* 0x71 */ 0x00, /* 0x72 */
- 0x59, /* FOCUS_PF2 */ 0x78, /* FOCUS_PF9 */
- 0x00, /* 0x75 */ 0x00, /* 0x76 */
- 0x5A, /* FOCUS_PF3 */ 0x5B, /* FOCUS_PF4 */
- 0x5C, /* FOCUS_PF5 */ 0x5D, /* FOCUS_PF6 */
- 0x5E, /* FOCUS_PF7 */ 0x5F, /* FOCUS_PF8 */
- 0x7C, /* JAP_86 */ 0x79, /* FOCUS_PF10 */
- 0x00, /* 0x7f */
-};
-
-/** Create a private structure for use within this file. */
-pointer kbdLinuxCreatePrivate(DeviceIntPtr pKeyboard)
-{
- myPrivate *priv = calloc(1, sizeof(*priv));
- priv->fd = -1;
- priv->pKeyboard = pKeyboard;
- return priv;
-}
-
-/** Destroy a private structure. */
-void kbdLinuxDestroyPrivate(pointer priv)
-{
- free(priv);
-}
-
-/** Ring the bell.
- *
- * Note: we completely ignore the \a volume, since Linux's ioctl()
- * interface does not provide a way to control it. If it did, the XBell
- * manpage tells how the actual volume is a function of the percent and
- * the (base) volume.
- *
- * Note that most of the other PC-based bell drivers compute the
- * duration for KDMKTONE as a function of the volume and the duration.
- * For some drivers, the duration is only measured in mS if the volume
- * is 50, and is scaled by the volume for other values. This seems
- * confusing and possibly incorrect (the xset man page says that the
- * bell will be "as closely as it can to the user's specifications" --
- * if we ignore the volume and set the duration correctly, then we'll
- * get one parameter "wrong" -- but if we use the volume to scale the
- * duration, then we'll get both parameters "wrong"). */
-void kbdLinuxBell(DevicePtr pDev, int percent,
- int volume, int pitch, int duration)
-{
- GETPRIV;
-
- if (duration && pitch) {
- ioctl(priv->fd,
- KDMKTONE,
- ((1193190 / pitch) & 0xffff) /* Low bits specify cycle time */
- | (duration << 16)); /* High bits are duration in msec */
- }
-}
-
-/** Set the LEDs. */
-void kbdLinuxCtrl(DevicePtr pDev, KeybdCtrl *ctrl)
-{
- GETPRIV;
-
- ioctl(priv->fd, KDSETLED, ctrl->leds & 0x07);
-}
-
-static int kbdLinuxGetFreeVTNumber(void)
-{
- int fd = -1;
- int vtno;
- int i;
- const char *tty0[] = { "/dev/tty0", "/dev/vc/0", NULL };
-
- for (i = 0; tty0[i]; i++)
- if ((fd = open(tty0[i], O_WRONLY, 0)) >= 0) break;
- if (fd < 0)
- FATAL1("kbdLinuxGetFreeVTNumber: Cannot open tty0 (%s)\n",
- strerror(errno));
- if (ioctl(fd, VT_OPENQRY, &vtno) < 0 || vtno < 0)
- FATAL0("kbdLinuxGetFreeVTNumber: Cannot find a free VT\n");
- return vtno;
-}
-
-static int kbdLinuxOpenVT(int vtno)
-{
- int fd = -1;
- int i;
- const char *vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL };
- char name[64]; /* RATS: Only used in XmuSnprintf */
-
- for (i = 0; vcs[i]; i++) {
- XmuSnprintf(name, sizeof(name), vcs[i], vtno);
- if ((fd = open(name, O_RDWR | O_NONBLOCK, 0)) >= 0) break;
- }
- if (fd < 0)
- FATAL2("kbdLinuxOpenVT: Cannot open VT %d (%s)\n",
- vtno, strerror(errno));
- return fd;
-}
-
-static int kbdLinuxGetCurrentVTNumber(int fd)
-{
- struct vt_stat vts;
-
- if (!ioctl(fd, VT_GETSTATE, &vts)) return vts.v_active;
- return -1;
-}
-
-static int kbdLinuxActivate(int fd, int vtno, int setSig);
-
-/** Currently unused hook called prior to an VT switch. */
-void kbdLinuxVTPreSwitch(pointer p)
-{
-}
-
-/** Currently unused hook called after returning from a VT switch. */
-void kbdLinuxVTPostSwitch(pointer p)
-{
-}
-
-/** Tell the operating system to switch to \a vt. The \a switch_return
- * function is called with the \a switch_return_data when the VT is
- * switched back to the pre-switch VT (i.e., the user returns to the DMX
- * session). */
-int kbdLinuxVTSwitch(pointer p, int vt,
- void (*switch_return)(pointer),
- pointer switch_return_data)
-{
- myPrivate *priv = p;
-
- if (priv->switched) FATAL0("kbdLinuxVTSwitch: already switched...\n");
- if (priv->vtno == vt) return 0;
-
- PRIV = priv;
- priv->switched = 0; /* Will switch to 1 in handler */
- priv->switch_return = switch_return;
- priv->switch_return_data = switch_return_data;
- kbdLinuxActivate(priv->fd, vt, 0);
- return 1;
-}
-
-/* RATS: This function is only ever used to handle SIGUSR1. */
-static void kbdLinuxVTSignalHandler(int sig)
-{
- myPrivate *priv = PRIV;
-
- signal(sig, kbdLinuxVTSignalHandler);
- if (priv) {
- ioctl(priv->fd, VT_RELDISP, VT_ACKACQ);
- priv->switched = !priv->switched;
- LOG2("kbdLinuxVTSignalHandler: got signal %d, switched = %d\n",
- sig, priv->switched);
- if (!priv->switched && priv->switch_return)
- priv->switch_return(priv->switch_return_data);
- }
-}
-
-static int kbdLinuxActivate(int fd, int vtno, int setSig)
-{
- int result;
- struct vt_mode VT;
-
- SYSCALL(result = ioctl(fd, VT_ACTIVATE, vtno));
- if (result) FATAL0("kbdLinuxActivate: VT_ACTIVATE failed\n");
- SYSCALL(result = ioctl(fd, VT_WAITACTIVE, vtno));
- if (result) FATAL0("kbdLinuxActivate: VT_WAITACTIVE failed\n");
- if (setSig) {
- SYSCALL(result = ioctl(fd, VT_GETMODE, &VT));
- if (result < 0) FATAL0("kbdLinuxActivate: VT_GETMODE failed\n");
- VT.mode = VT_PROCESS;
- VT.relsig = SIGUSR1;
- VT.acqsig = SIGUSR1;
- if (ioctl(fd, VT_SETMODE, &VT))
- FATAL0("kbdLinuxActivate: VT_SETMODE VT_PROCESS failed\n");
- signal(SIGUSR1, kbdLinuxVTSignalHandler);
- }
- return Success;
-}
-
-static void kbdLinuxOpenConsole(DevicePtr pDev)
-{
- GETPRIV;
- const char *msg = MESSAGE;
-
- if (priv->fd >= 0) return;
- priv->vtno = kbdLinuxGetFreeVTNumber();
- priv->fd = kbdLinuxOpenVT(priv->vtno);
- priv->vtcurrent = kbdLinuxGetCurrentVTNumber(priv->fd);
- LOG2("kbdLinuxOpenConsole: current VT %d; using free VT %d\n",
- priv->vtcurrent, priv->vtno);
- kbdLinuxActivate(priv->fd, priv->vtno, 1);
- ioctl(priv->fd, KDSETMODE, KD_GRAPHICS); /* To turn off gpm */
- if (msg) write(priv->fd, msg, strlen(msg));
-}
-
-static void kbdLinuxCloseConsole(DevicePtr pDev)
-{
- GETPRIV;
- struct vt_mode VT;
- const char *msg = FINALMESSAGE;
-
- if (priv->fd < 0) return;
-
- ioctl(priv->fd, KDSETMODE, KD_TEXT);
- if (msg) write(priv->fd, msg, strlen(msg));
- if (ioctl(priv->fd, VT_GETMODE, &VT) != -1) {
- VT.mode = VT_AUTO;
- ioctl(priv->fd, VT_SETMODE, &VT);
- }
-
- LOG1("kbdLinuxCloseConsole: switching to VT %d\n", priv->vtcurrent);
- if (priv->vtcurrent >= 0) kbdLinuxActivate(priv->fd, priv->vtcurrent, 0);
-
- close(priv->fd);
- priv->fd = -1;
-}
-
-/** Initialize the \a pDev as a Linux keyboard. */
-void kbdLinuxInit(DevicePtr pDev)
-{
- GETPRIV;
-
- if (priv->fd <= 0) kbdLinuxOpenConsole(pDev);
-
- ioctl(priv->fd, KDGKBMODE, &priv->kbdtrans);
- if (tcgetattr(priv->fd, &priv->kbdtty) < 0)
- FATAL1("kbdLinuxInit: tcgetattr failed (%s)\n", strerror(errno));
-}
-
-static int kbdLinuxPrefix0Mapping(unsigned char *scanCode)
-{
- /* Table from xfree86/common/xf86Events.c */
- switch (*scanCode) {
- case KEY_KP_7: *scanCode = KEY_Home; break; /* curs home */
- case KEY_KP_8: *scanCode = KEY_Up; break; /* curs up */
- case KEY_KP_9: *scanCode = KEY_PgUp; break; /* curs pgup */
- case KEY_KP_4: *scanCode = KEY_Left; break; /* curs left */
- case KEY_KP_5: *scanCode = KEY_Begin; break; /* curs begin */
- case KEY_KP_6: *scanCode = KEY_Right; break; /* curs right */
- case KEY_KP_1: *scanCode = KEY_End; break; /* curs end */
- case KEY_KP_2: *scanCode = KEY_Down; break; /* curs down */
- case KEY_KP_3: *scanCode = KEY_PgDown; break; /* curs pgdown */
- case KEY_KP_0: *scanCode = KEY_Insert; break; /* curs insert */
- case KEY_KP_Decimal: *scanCode = KEY_Delete; break; /* curs delete */
- case KEY_Enter: *scanCode = KEY_KP_Enter; break; /* keypad enter */
- case KEY_LCtrl: *scanCode = KEY_RCtrl; break; /* right ctrl */
- case KEY_KP_Multiply: *scanCode = KEY_Print; break; /* print */
- case KEY_Slash: *scanCode = KEY_KP_Divide; break; /* keyp divide */
- case KEY_Alt: *scanCode = KEY_AltLang; break; /* right alt */
- case KEY_ScrollLock: *scanCode = KEY_Break; break; /* curs break */
- case 0x5b: *scanCode = KEY_LMeta; break;
- case 0x5c: *scanCode = KEY_RMeta; break;
- case 0x5d: *scanCode = KEY_Menu; break;
- case KEY_F3: *scanCode = KEY_F13; break;
- case KEY_F4: *scanCode = KEY_F14; break;
- case KEY_F5: *scanCode = KEY_F15; break;
- case KEY_F6: *scanCode = KEY_F16; break;
- case KEY_F7: *scanCode = KEY_F17; break;
- case KEY_KP_Plus: *scanCode = KEY_KP_DEC; break;
- /*
- * Ignore virtual shifts (E0 2A, E0 AA, E0 36, E0 B6)
- */
- case 0x2A:
- case 0x36:
- return 1;
- default:
- /*
- * "Internet" keyboards are generating lots of new codes.
- * Let them pass. There is little consistency between them,
- * so don't bother with symbolic names at this level.
- */
- scanCode += 0x78;
- }
- return 0;
-}
-
-static int kbdLinuxPrefixMapping(myPrivate *priv, unsigned char *scanCode)
-{
- int pressed = *scanCode & 0x80;
- unsigned char code = *scanCode & 0x7f;
-
- /* If we don't have a prefix, check for one */
- if (!priv->prefix) {
- switch (code) {
- case KEY_Prefix0:
- case KEY_Prefix1:
- priv->prefix = code;
- return 1;
- }
- return 0; /* No change */
- }
-
- /* We have a prefix from the last scanCode */
- switch (priv->prefix) {
- case KEY_Prefix0:
- priv->prefix = 0;
- if (kbdLinuxPrefix0Mapping(&code)) return 1; /* Skip sequence */
- break;
- case KEY_Prefix1:
- priv->prefix = (code = KEY_LCtrl) ? KEY_LCtrl : 0;
- return 1; /* Use new prefix */
- case KEY_LCtrl:
- priv->prefix = 0;
- if (code != KEY_NumLock) return 1; /* Skip sequence*/
- code = KEY_Pause;
- break;
- }
-
- *scanCode = code | (pressed ? 0x80 : 0x00);
- return 0; /* Use old scanCode */
-}
-
-static void kbdLinuxConvert(DevicePtr pDev,
- unsigned char scanCode,
- ENQUEUEPROC enqueue,
- CHECKPROC checkspecial,
- BLOCK block)
-{
- GETPRIV;
- XkbSrvInfoPtr xkbi = priv->pKeyboard->key->xkbInfo;
- int type;
- KeySym keySym = NoSymbol;
- int keyCode;
- int switching;
-
- /* Do special PC/AT prefix mapping -- may change scanCode! */
- if (kbdLinuxPrefixMapping(priv, &scanCode)) return;
-
- type = (scanCode & 0x80) ? KeyRelease : KeyPress;
- keyCode = (scanCode & 0x7f) + MIN_KEYCODE;
-
- /* Handle repeats */
-
- if (keyCode >= xkbi->desc->min_key_code &&
- keyCode <= xkbi->desc->max_key_code) {
-
- int effectiveGroup = XkbGetEffectiveGroup(xkbi,
- &xkbi->state,
- scanCode);
- keySym = XkbKeySym(xkbi->desc, scanCode, effectiveGroup);
-#if 0
- switch (keySym) {
- case XK_Num_Lock:
- case XK_Scroll_Lock:
- case XK_Shift_Lock:
- case XK_Caps_Lock:
- /* Ignore releases and all but first press */
- if (kbdLinuxModIgnore(priv, &xE, keySym)) return;
- if (kbdLinuxKeyDown(priv, &xE)) xE.u.u.type = KeyRelease;
- else xE.u.u.type = KeyPress;
- break;
- }
-#endif
-
- /* If key is already down, ignore or autorepeat */
- if (type == KeyPress && kbdLinuxKeyDown(priv, keyCode)) {
- KbdFeedbackClassRec *feed = priv->pKeyboard->kbdfeed;
-
- /* No auto-repeat? */
- if ((feed && !feed->ctrl.autoRepeat)
- || priv->pKeyboard->key->xkbInfo->desc->map->modmap[keyCode]
- || (feed
- && !(feed->ctrl.autoRepeats[keyCode >> 3]
- & (1 << (keyCode & 7))))) return; /* Ignore */
-
- /* Do auto-repeat */
- enqueue(pDev, KeyRelease, keyCode, keySym, NULL, block);
- type = KeyPress;
- }
-
- /* If key is already up, ignore */
- if (type == KeyRelease && !kbdLinuxKeyDown(priv, keyCode)) return;
- }
-
- switching = 0;
- if (checkspecial && type == KeyPress)
- switching = checkspecial(pDev, keySym);
- if (!switching) {
- if (enqueue)
- enqueue(pDev, type, keyCode, keySym, NULL, block);
- kbdLinuxKeyState(priv, type, keyCode); /* Update our state bitmap */
- }
-}
-
-/** Read an event from the \a pDev device. If the event is a motion
- * event, enqueue it with the \a motion function. Otherwise, check for
- * special keys with the \a checkspecial function and enqueue the event
- * with the \a enqueue function. The \a block type is passed to the
- * functions so that they may block SIGIO handling as appropriate to the
- * caller of this function. */
-void kbdLinuxRead(DevicePtr pDev,
- MOTIONPROC motion,
- ENQUEUEPROC enqueue,
- CHECKPROC checkspecial,
- BLOCK block)
-{
- GETPRIV;
- unsigned char buf[256]; /* RATS: Only used in length-limited call */
- unsigned char *pt;
- int n;
-
- while ((n = read(priv->fd, buf, sizeof(buf))) > 0)
- for (pt = buf; n; --n, ++pt)
- kbdLinuxConvert(pDev, *pt, enqueue, checkspecial, block);
-}
-
-/** Turn \a pDev on (i.e., take input from \a pDev). */
-int kbdLinuxOn(DevicePtr pDev)
-{
- GETPRIV;
- struct termios nTty;
-
- ioctl(priv->fd, KDSKBMODE, K_RAW);
-
- nTty = priv->kbdtty;
- nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
- nTty.c_oflag = 0;
- nTty.c_cflag = CREAD | CS8;
- nTty.c_lflag = 0;
- nTty.c_cc[VTIME] = 0;
- nTty.c_cc[VMIN] = 1;
- cfsetispeed(&nTty, B9600);
- cfsetospeed(&nTty, B9600);
- if (tcsetattr(priv->fd, TCSANOW, &nTty) < 0)
- FATAL1("kbdLinuxOn: tcsetattr failed (%s)\n", strerror(errno));
- return priv->fd;
-}
-
-/** Turn \a pDev off (i.e., stop taking input from \a pDev). */
-void kbdLinuxOff(DevicePtr pDev)
-{
- GETPRIV;
-
- ioctl(priv->fd, KDSKBMODE, priv->kbdtrans);
- tcsetattr(priv->fd, TCSANOW, &priv->kbdtty);
- kbdLinuxCloseConsole(pDev);
-}
-
-
-static void kbdLinuxReadKernelMapping(int fd, KeySymsPtr pKeySyms)
-{
- KeySym *k;
- int i;
- int maxkey;
- static unsigned char tbl[GLYPHS_PER_KEY] = { /* RATS: Use ok */
- 0, /* unshifted */
- 1, /* shifted */
- 0, /* modeswitch unshifted */
- 0 /* modeswitch shifted */
- };
-
- /*
- * Read the mapping from the kernel.
- * Since we're still using the XFree86 scancode->AT keycode mapping
- * routines, we need to convert the AT keycodes to Linux keycodes,
- * then translate the Linux keysyms into X keysyms.
- *
- * First, figure out which tables to use for the modeswitch columns
- * above, from the XF86Config fields.
- */
- tbl[2] = 8; /* alt */
- tbl[3] = tbl[2] | 1;
-
-#if 00/*BP*/
- k = map+GLYPHS_PER_KEY;
-#else
- ErrorF("kbdLinuxReadKernelMapping() is broken/no-op'd\n");
- return;
-#endif
- maxkey = NUM_AT2LNX;
-
- for (i = 0; i < maxkey; ++i) {
- struct kbentry kbe;
- int j;
-
- kbe.kb_index = at2lnx[i];
-
- for (j = 0; j < GLYPHS_PER_KEY; ++j, ++k) {
- unsigned short kval;
-
- *k = NoSymbol;
-
- kbe.kb_table = tbl[j];
- if (kbe.kb_index == 0 || ioctl(fd, KDGKBENT, &kbe)) continue;
-
- kval = KVAL(kbe.kb_value);
- switch (KTYP(kbe.kb_value)) {
- case KT_LATIN:
- case KT_LETTER: *k = linux_to_x[kval]; break;
- case KT_FN:
- if (kval <= 19) *k = XK_F1 + kval;
- else switch (kbe.kb_value) {
- case K_FIND: *k = XK_Home; /* or XK_Find */ break;
- case K_INSERT: *k = XK_Insert; break;
- case K_REMOVE: *k = XK_Delete; break;
- case K_SELECT: *k = XK_End; /* or XK_Select */ break;
- case K_PGUP: *k = XK_Prior; break;
- case K_PGDN: *k = XK_Next; break;
- case K_HELP: *k = XK_Help; break;
- case K_DO: *k = XK_Execute; break;
- case K_PAUSE: *k = XK_Pause; break;
- case K_MACRO: *k = XK_Menu; break;
- default: break;
- }
- break;
- case KT_SPEC:
- switch (kbe.kb_value) {
- case K_ENTER: *k = XK_Return; break;
- case K_BREAK: *k = XK_Break; break;
- case K_CAPS: *k = XK_Caps_Lock; break;
- case K_NUM: *k = XK_Num_Lock; break;
- case K_HOLD: *k = XK_Scroll_Lock; break;
- case K_COMPOSE: *k = XK_Multi_key; break;
- default: break;
- }
- break;
- case KT_PAD:
- switch (kbe.kb_value) {
- case K_PPLUS: *k = XK_KP_Add; break;
- case K_PMINUS: *k = XK_KP_Subtract; break;
- case K_PSTAR: *k = XK_KP_Multiply; break;
- case K_PSLASH: *k = XK_KP_Divide; break;
- case K_PENTER: *k = XK_KP_Enter; break;
- case K_PCOMMA: *k = XK_KP_Separator; break;
- case K_PDOT: *k = XK_KP_Decimal; break;
- case K_PPLUSMINUS: *k = XK_KP_Subtract; break;
- default: if (kval <= 9) *k = XK_KP_0 + kval; break;
- }
- break;
- case KT_DEAD:
- /* KT_DEAD keys are for accelerated diacritical creation. */
- switch (kbe.kb_value) {
- case K_DGRAVE: *k = XK_dead_grave; break;
- case K_DACUTE: *k = XK_dead_acute; break;
- case K_DCIRCM: *k = XK_dead_circumflex; break;
- case K_DTILDE: *k = XK_dead_tilde; break;
- case K_DDIERE: *k = XK_dead_diaeresis; break;
- }
- break;
- case KT_CUR:
- switch (kbe.kb_value) {
- case K_DOWN: *k = XK_Down; break;
- case K_LEFT: *k = XK_Left; break;
- case K_RIGHT: *k = XK_Right; break;
- case K_UP: *k = XK_Up; break;
- }
- break;
- case KT_SHIFT:
- switch (kbe.kb_value) {
- case K_ALTGR: *k = XK_Alt_R; break;
- case K_ALT:
- *k = (kbe.kb_index == 0x64 ? XK_Alt_R : XK_Alt_L);
- break;
- case K_CTRL:
- *k = (kbe.kb_index == 0x61 ? XK_Control_R : XK_Control_L);
- break;
- case K_CTRLL: *k = XK_Control_L; break;
- case K_CTRLR: *k = XK_Control_R; break;
- case K_SHIFT:
- *k = (kbe.kb_index == 0x36 ? XK_Shift_R : XK_Shift_L);
- break;
- case K_SHIFTL: *k = XK_Shift_L; break;
- case K_SHIFTR: *k = XK_Shift_R; break;
- default: break;
- }
- break;
- case KT_ASCII:
- /* KT_ASCII keys accumulate a 3 digit decimal number that
- * gets emitted when the shift state changes. We can't
- * emulate that.
- */
- break;
- case KT_LOCK:
- if (kbe.kb_value == K_SHIFTLOCK) *k = XK_Shift_Lock;
- break;
- default: break;
- }
- }
-
- if (k[-1] == k[-2]) k[-1] = NoSymbol;
- if (k[-2] == k[-3]) k[-2] = NoSymbol;
- if (k[-3] == k[-4]) k[-3] = NoSymbol;
- if (k[-4] == k[-2] && k[-3] == k[-1]) k[-2] = k[-1] = NoSymbol;
- if (k[-1] == k[-4] && k[-2] == k[-3]
- && k[-2] == NoSymbol) k[-1] = NoSymbol;
- }
-}
-
-static void kbdLinuxGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
-{
- GETPRIV;
- KeySym *k, *mapCopy;
- char type;
- int i;
-
-#if 00/*BP*/
- mapCopy = malloc(sizeof(map));
- memcpy(mapCopy, map, sizeof(map));
-#else
- ErrorF("kbdLinuxGetMap() is broken/no-op'd\n");
- return;
-#endif
-
- kbdLinuxReadKernelMapping(priv->fd, pKeySyms);
-
- /* compute the modifier map */
- for (i = 0; i < MAP_LENGTH; i++)
- pModMap[i] = NoSymbol; /* make sure it is restored */
-
- for (k = mapCopy, i = MIN_KEYCODE;
- i < NUM_KEYCODES + MIN_KEYCODE;
- i++, k += 4) {
- switch(*k) {
- case XK_Shift_L:
- case XK_Shift_R: pModMap[i] = ShiftMask; break;
- case XK_Control_L:
- case XK_Control_R: pModMap[i] = ControlMask; break;
- case XK_Caps_Lock: pModMap[i] = LockMask; break;
- case XK_Alt_L:
- case XK_Alt_R: pModMap[i] = AltMask; break;
- case XK_Num_Lock: pModMap[i] = NumLockMask; break;
- case XK_Scroll_Lock: pModMap[i] = ScrollLockMask; break;
- case XK_Kana_Lock:
- case XK_Kana_Shift: pModMap[i] = KanaMask; break;
- case XK_Mode_switch: pModMap[i] = AltLangMask; break;
- }
- }
-
- priv->kbdType = (ioctl(priv->fd, KDGKBTYPE, &type) < 0) ? KB_101 : type;
-
- pKeySyms->map = mapCopy; /* Must be XFree'able */
- pKeySyms->mapWidth = GLYPHS_PER_KEY;
- pKeySyms->minKeyCode = MIN_KEYCODE;
- pKeySyms->maxKeyCode = MAX_KEYCODE;
-}
-
-/** Fill the \a info structure with information needed to initialize \a
- * pDev. */
-void kbdLinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
-{
- info->keyboard = 1;
- info->keyClass = 1;
- kbdLinuxGetMap(pDev, &info->keySyms, info->modMap);
- info->focusClass = 1;
- info->kbdFeedbackClass = 1;
-}
+/* Portions of this file were derived from the following files:
+ *
+ **********************************************************************
+ *
+ * xfree86/common/{xf86Io.c,xf86Kbd.c,xf86Events.c}
+ *
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Thomas Roell not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Thomas Roell makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ *
+ **********************************************************************
+ *
+ * xfree86/common/xf86KbdLnx.c
+ *
+ * Linux version of keymapping setup. The kernel (since 0.99.14) has support
+ * for fully remapping the keyboard, but there are some differences between
+ * the Linux map and the SVR4 map (esp. in the extended keycodes). We also
+ * remove the restriction on what keycodes can be remapped.
+ * Orest Zborowski.
+ *
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Thomas Roell not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Thomas Roell makes no representations
+ * about the suitability of this software for any purpose. It is provided
+ * "as is" without express or implied warranty.
+ *
+ * THOMAS ROELL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THOMAS ROELL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ *
+ **********************************************************************
+ *
+ * xfree86/os-support/linux/lnx_io.c
+ *
+ * Copyright 1992 by Orest Zborowski <obz@Kodak.com>
+ * Copyright 1993 by David Dawes <dawes@xfree86.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the names of Orest Zborowski and David Dawes
+ * not be used in advertising or publicity pertaining to distribution of
+ * the software without specific, written prior permission. Orest Zborowski
+ * and David Dawes make no representations about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ *
+ * OREST ZBOROWSKI AND DAVID DAWES DISCLAIMS ALL WARRANTIES WITH REGARD
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI OR DAVID DAWES BE LIABLE
+ * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+/*
+ * Copyright 2001-2003 Red Hat Inc., Durham, North Carolina.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation on the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/*
+ * Authors:
+ * Rickard E. (Rik) Faith <faith@redhat.com>
+ *
+ */
+
+/** \file
+ *
+ * This code implements a low-level device driver for the Linux
+ * keyboard. The code is derived from code by Thomas Roell, Orest
+ * Zborowski, and David Dawes (see the source code for complete
+ * references). */
+
+#ifdef HAVE_DMX_CONFIG_H
+#include <dmx-config.h>
+#endif
+
+/*****************************************************************************/
+/* Define some macros to make it easier to move this file to another
+ * part of the Xserver tree. All calls to the dmx* layer are #defined
+ * here for the .c file. The .h file will also have to be edited. */
+#include "dmxinputinit.h"
+#include "lnx-keyboard.h"
+
+#define GETPRIV myPrivate *priv \
+ = ((DMXLocalInputInfoPtr)(pDev->devicePrivate))->private
+
+#define LOG0(f) dmxLog(dmxDebug,f)
+#define LOG1(f,a) dmxLog(dmxDebug,f,a)
+#define LOG2(f,a,b) dmxLog(dmxDebug,f,a,b)
+#define LOG3(f,a,b,c) dmxLog(dmxDebug,f,a,b,c)
+#define FATAL0(f) dmxLog(dmxFatal,f)
+#define FATAL1(f,a) dmxLog(dmxFatal,f,a)
+#define FATAL2(f,a,b) dmxLog(dmxFatal,f,a,b)
+#define MOTIONPROC dmxMotionProcPtr
+#define ENQUEUEPROC dmxEnqueueProcPtr
+#define CHECKPROC dmxCheckSpecialProcPtr
+#define SWITCHRETPROC dmxVTSwitchReturnProcPtr
+#define BLOCK DMXBlockType
+#define MESSAGE "\033c\n\n\nDMX taking input from this console..."
+#define FINALMESSAGE "\033cDMX terminated."
+
+/* End of interface definitions. */
+/*****************************************************************************/
+
+#include "inputstr.h"
+#include <X11/Xos.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <signal.h>
+#include <sys/vt.h>
+#include <sys/kd.h>
+#include <termios.h>
+#include "atKeynames.h"
+#if 00
+#include "xf86Keymap.h"
+#endif
+#include <linux/keyboard.h>
+#include <xkbsrv.h>
+
+#define NUM_AT2LNX (sizeof(at2lnx) / sizeof(at2lnx[0]))
+#define NUM_STATE_ENTRIES (256/32)
+
+
+/* Private area for Linux-style keyboards. */
+typedef struct _myPrivate {
+ int fd;
+ int vtno;
+ int vtcurrent;
+ int kbdtrans;
+ struct termios kbdtty;
+ int kbdType;
+ CARD32 kbdState[NUM_STATE_ENTRIES];
+ DeviceIntPtr pKeyboard;
+ unsigned char prefix;
+
+ int switched;
+ SWITCHRETPROC switch_return;
+ void *switch_return_data;
+
+ /* For bell */
+ int pitch;
+ unsigned long duration;
+} myPrivate;
+
+static myPrivate *PRIV = NULL;
+
+#undef SYSCALL
+#define SYSCALL(call) while(((call) == -1) && (errno == EINTR))
+
+static int kbdLinuxKeyDown(myPrivate *priv, int keyCode)
+{
+ CARD8 byte = keyCode >> 5;
+ CARD32 bit = 1 << (keyCode & 0x1f);
+
+ if (byte > NUM_STATE_ENTRIES) return 0;
+ return priv->kbdState[byte] & bit;
+}
+
+static void kbdLinuxKeyState(myPrivate *priv, int type, int keyCode)
+{
+ CARD8 byte = keyCode >> 5;
+ CARD32 bit = 1 << (keyCode & 0x1f);
+
+ if (byte > NUM_STATE_ENTRIES) return;
+ if (type == KeyPress) priv->kbdState[byte] |= bit;
+ else priv->kbdState[byte] &= ~bit;
+}
+
+static KeySym linux_to_x[256] = {
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_BackSpace, XK_Tab, XK_Linefeed, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, XK_Escape,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_space, XK_exclam, XK_quotedbl, XK_numbersign,
+ XK_dollar, XK_percent, XK_ampersand, XK_apostrophe,
+ XK_parenleft, XK_parenright, XK_asterisk, XK_plus,
+ XK_comma, XK_minus, XK_period, XK_slash,
+ XK_0, XK_1, XK_2, XK_3,
+ XK_4, XK_5, XK_6, XK_7,
+ XK_8, XK_9, XK_colon, XK_semicolon,
+ XK_less, XK_equal, XK_greater, XK_question,
+ XK_at, XK_A, XK_B, XK_C,
+ XK_D, XK_E, XK_F, XK_G,
+ XK_H, XK_I, XK_J, XK_K,
+ XK_L, XK_M, XK_N, XK_O,
+ XK_P, XK_Q, XK_R, XK_S,
+ XK_T, XK_U, XK_V, XK_W,
+ XK_X, XK_Y, XK_Z, XK_bracketleft,
+ XK_backslash, XK_bracketright,XK_asciicircum, XK_underscore,
+ XK_grave, XK_a, XK_b, XK_c,
+ XK_d, XK_e, XK_f, XK_g,
+ XK_h, XK_i, XK_j, XK_k,
+ XK_l, XK_m, XK_n, XK_o,
+ XK_p, XK_q, XK_r, XK_s,
+ XK_t, XK_u, XK_v, XK_w,
+ XK_x, XK_y, XK_z, XK_braceleft,
+ XK_bar, XK_braceright, XK_asciitilde, XK_BackSpace,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ NoSymbol, NoSymbol, NoSymbol, NoSymbol,
+ XK_nobreakspace,XK_exclamdown, XK_cent, XK_sterling,
+ XK_currency, XK_yen, XK_brokenbar, XK_section,
+ XK_diaeresis, XK_copyright, XK_ordfeminine, XK_guillemotleft,
+ XK_notsign, XK_hyphen, XK_registered, XK_macron,
+ XK_degree, XK_plusminus, XK_twosuperior, XK_threesuperior,
+ XK_acute, XK_mu, XK_paragraph, XK_periodcentered,
+ XK_cedilla, XK_onesuperior, XK_masculine, XK_guillemotright,
+ XK_onequarter, XK_onehalf, XK_threequarters,XK_questiondown,
+ XK_Agrave, XK_Aacute, XK_Acircumflex, XK_Atilde,
+ XK_Adiaeresis, XK_Aring, XK_AE, XK_Ccedilla,
+ XK_Egrave, XK_Eacute, XK_Ecircumflex, XK_Ediaeresis,
+ XK_Igrave, XK_Iacute, XK_Icircumflex, XK_Idiaeresis,
+ XK_ETH, XK_Ntilde, XK_Ograve, XK_Oacute,
+ XK_Ocircumflex, XK_Otilde, XK_Odiaeresis, XK_multiply,
+ XK_Ooblique, XK_Ugrave, XK_Uacute, XK_Ucircumflex,
+ XK_Udiaeresis, XK_Yacute, XK_THORN, XK_ssharp,
+ XK_agrave, XK_aacute, XK_acircumflex, XK_atilde,
+ XK_adiaeresis, XK_aring, XK_ae, XK_ccedilla,
+ XK_egrave, XK_eacute, XK_ecircumflex, XK_ediaeresis,
+ XK_igrave, XK_iacute, XK_icircumflex, XK_idiaeresis,
+ XK_eth, XK_ntilde, XK_ograve, XK_oacute,
+ XK_ocircumflex, XK_otilde, XK_odiaeresis, XK_division,
+ XK_oslash, XK_ugrave, XK_uacute, XK_ucircumflex,
+ XK_udiaeresis, XK_yacute, XK_thorn, XK_ydiaeresis
+};
+
+/*
+ * Maps the AT keycodes to Linux keycodes
+ */
+static unsigned char at2lnx[NUM_KEYCODES] =
+{
+ 0x01, /* KEY_Escape */ 0x02, /* KEY_1 */
+ 0x03, /* KEY_2 */ 0x04, /* KEY_3 */
+ 0x05, /* KEY_4 */ 0x06, /* KEY_5 */
+ 0x07, /* KEY_6 */ 0x08, /* KEY_7 */
+ 0x09, /* KEY_8 */ 0x0a, /* KEY_9 */
+ 0x0b, /* KEY_0 */ 0x0c, /* KEY_Minus */
+ 0x0d, /* KEY_Equal */ 0x0e, /* KEY_BackSpace */
+ 0x0f, /* KEY_Tab */ 0x10, /* KEY_Q */
+ 0x11, /* KEY_W */ 0x12, /* KEY_E */
+ 0x13, /* KEY_R */ 0x14, /* KEY_T */
+ 0x15, /* KEY_Y */ 0x16, /* KEY_U */
+ 0x17, /* KEY_I */ 0x18, /* KEY_O */
+ 0x19, /* KEY_P */ 0x1a, /* KEY_LBrace */
+ 0x1b, /* KEY_RBrace */ 0x1c, /* KEY_Enter */
+ 0x1d, /* KEY_LCtrl */ 0x1e, /* KEY_A */
+ 0x1f, /* KEY_S */ 0x20, /* KEY_D */
+ 0x21, /* KEY_F */ 0x22, /* KEY_G */
+ 0x23, /* KEY_H */ 0x24, /* KEY_J */
+ 0x25, /* KEY_K */ 0x26, /* KEY_L */
+ 0x27, /* KEY_SemiColon */ 0x28, /* KEY_Quote */
+ 0x29, /* KEY_Tilde */ 0x2a, /* KEY_ShiftL */
+ 0x2b, /* KEY_BSlash */ 0x2c, /* KEY_Z */
+ 0x2d, /* KEY_X */ 0x2e, /* KEY_C */
+ 0x2f, /* KEY_V */ 0x30, /* KEY_B */
+ 0x31, /* KEY_N */ 0x32, /* KEY_M */
+ 0x33, /* KEY_Comma */ 0x34, /* KEY_Period */
+ 0x35, /* KEY_Slash */ 0x36, /* KEY_ShiftR */
+ 0x37, /* KEY_KP_Multiply */ 0x38, /* KEY_Alt */
+ 0x39, /* KEY_Space */ 0x3a, /* KEY_CapsLock */
+ 0x3b, /* KEY_F1 */ 0x3c, /* KEY_F2 */
+ 0x3d, /* KEY_F3 */ 0x3e, /* KEY_F4 */
+ 0x3f, /* KEY_F5 */ 0x40, /* KEY_F6 */
+ 0x41, /* KEY_F7 */ 0x42, /* KEY_F8 */
+ 0x43, /* KEY_F9 */ 0x44, /* KEY_F10 */
+ 0x45, /* KEY_NumLock */ 0x46, /* KEY_ScrollLock */
+ 0x47, /* KEY_KP_7 */ 0x48, /* KEY_KP_8 */
+ 0x49, /* KEY_KP_9 */ 0x4a, /* KEY_KP_Minus */
+ 0x4b, /* KEY_KP_4 */ 0x4c, /* KEY_KP_5 */
+ 0x4d, /* KEY_KP_6 */ 0x4e, /* KEY_KP_Plus */
+ 0x4f, /* KEY_KP_1 */ 0x50, /* KEY_KP_2 */
+ 0x51, /* KEY_KP_3 */ 0x52, /* KEY_KP_0 */
+ 0x53, /* KEY_KP_Decimal */ 0x54, /* KEY_SysReqest */
+ 0x00, /* 0x55 */ 0x56, /* KEY_Less */
+ 0x57, /* KEY_F11 */ 0x58, /* KEY_F12 */
+ 0x66, /* KEY_Home */ 0x67, /* KEY_Up */
+ 0x68, /* KEY_PgUp */ 0x69, /* KEY_Left */
+ 0x5d, /* KEY_Begin */ 0x6a, /* KEY_Right */
+ 0x6b, /* KEY_End */ 0x6c, /* KEY_Down */
+ 0x6d, /* KEY_PgDown */ 0x6e, /* KEY_Insert */
+ 0x6f, /* KEY_Delete */ 0x60, /* KEY_KP_Enter */
+ 0x61, /* KEY_RCtrl */ 0x77, /* KEY_Pause */
+ 0x63, /* KEY_Print */ 0x62, /* KEY_KP_Divide */
+ 0x64, /* KEY_AltLang */ 0x65, /* KEY_Break */
+ 0x00, /* KEY_LMeta */ 0x00, /* KEY_RMeta */
+ 0x7A, /* KEY_Menu/FOCUS_PF11*/0x00, /* 0x6e */
+ 0x7B, /* FOCUS_PF12 */ 0x00, /* 0x70 */
+ 0x00, /* 0x71 */ 0x00, /* 0x72 */
+ 0x59, /* FOCUS_PF2 */ 0x78, /* FOCUS_PF9 */
+ 0x00, /* 0x75 */ 0x00, /* 0x76 */
+ 0x5A, /* FOCUS_PF3 */ 0x5B, /* FOCUS_PF4 */
+ 0x5C, /* FOCUS_PF5 */ 0x5D, /* FOCUS_PF6 */
+ 0x5E, /* FOCUS_PF7 */ 0x5F, /* FOCUS_PF8 */
+ 0x7C, /* JAP_86 */ 0x79, /* FOCUS_PF10 */
+ 0x00, /* 0x7f */
+};
+
+/** Create a private structure for use within this file. */
+pointer kbdLinuxCreatePrivate(DeviceIntPtr pKeyboard)
+{
+ myPrivate *priv = calloc(1, sizeof(*priv));
+ priv->fd = -1;
+ priv->pKeyboard = pKeyboard;
+ return priv;
+}
+
+/** Destroy a private structure. */
+void kbdLinuxDestroyPrivate(pointer priv)
+{
+ free(priv);
+}
+
+/** Ring the bell.
+ *
+ * Note: we completely ignore the \a volume, since Linux's ioctl()
+ * interface does not provide a way to control it. If it did, the XBell
+ * manpage tells how the actual volume is a function of the percent and
+ * the (base) volume.
+ *
+ * Note that most of the other PC-based bell drivers compute the
+ * duration for KDMKTONE as a function of the volume and the duration.
+ * For some drivers, the duration is only measured in mS if the volume
+ * is 50, and is scaled by the volume for other values. This seems
+ * confusing and possibly incorrect (the xset man page says that the
+ * bell will be "as closely as it can to the user's specifications" --
+ * if we ignore the volume and set the duration correctly, then we'll
+ * get one parameter "wrong" -- but if we use the volume to scale the
+ * duration, then we'll get both parameters "wrong"). */
+void kbdLinuxBell(DevicePtr pDev, int percent,
+ int volume, int pitch, int duration)
+{
+ GETPRIV;
+
+ if (duration && pitch) {
+ ioctl(priv->fd,
+ KDMKTONE,
+ ((1193190 / pitch) & 0xffff) /* Low bits specify cycle time */
+ | (duration << 16)); /* High bits are duration in msec */
+ }
+}
+
+/** Set the LEDs. */
+void kbdLinuxCtrl(DevicePtr pDev, KeybdCtrl *ctrl)
+{
+ GETPRIV;
+
+ ioctl(priv->fd, KDSETLED, ctrl->leds & 0x07);
+}
+
+static int kbdLinuxGetFreeVTNumber(void)
+{
+ int fd = -1;
+ int vtno;
+ int i;
+ const char *tty0[] = { "/dev/tty0", "/dev/vc/0", NULL };
+
+ for (i = 0; tty0[i]; i++)
+ if ((fd = open(tty0[i], O_WRONLY, 0)) >= 0) break;
+ if (fd < 0)
+ FATAL1("kbdLinuxGetFreeVTNumber: Cannot open tty0 (%s)\n",
+ strerror(errno));
+ if (ioctl(fd, VT_OPENQRY, &vtno) < 0 || vtno < 0)
+ FATAL0("kbdLinuxGetFreeVTNumber: Cannot find a free VT\n");
+ return vtno;
+}
+
+static int kbdLinuxOpenVT(int vtno)
+{
+ int fd = -1;
+ int i;
+ const char *vcs[] = { "/dev/vc/", "/dev/tty", NULL };
+ char name[64]; /* RATS: Only used in snprintf */
+
+ for (i = 0; vcs[i]; i++) {
+ snprintf(name, sizeof(name), "%s%d", vcs[i], vtno);
+ if ((fd = open(name, O_RDWR | O_NONBLOCK, 0)) >= 0) break;
+ }
+ if (fd < 0)
+ FATAL2("kbdLinuxOpenVT: Cannot open VT %d (%s)\n",
+ vtno, strerror(errno));
+ return fd;
+}
+
+static int kbdLinuxGetCurrentVTNumber(int fd)
+{
+ struct vt_stat vts;
+
+ if (!ioctl(fd, VT_GETSTATE, &vts)) return vts.v_active;
+ return -1;
+}
+
+static int kbdLinuxActivate(int fd, int vtno, int setSig);
+
+/** Currently unused hook called prior to an VT switch. */
+void kbdLinuxVTPreSwitch(pointer p)
+{
+}
+
+/** Currently unused hook called after returning from a VT switch. */
+void kbdLinuxVTPostSwitch(pointer p)
+{
+}
+
+/** Tell the operating system to switch to \a vt. The \a switch_return
+ * function is called with the \a switch_return_data when the VT is
+ * switched back to the pre-switch VT (i.e., the user returns to the DMX
+ * session). */
+int kbdLinuxVTSwitch(pointer p, int vt,
+ void (*switch_return)(pointer),
+ pointer switch_return_data)
+{
+ myPrivate *priv = p;
+
+ if (priv->switched) FATAL0("kbdLinuxVTSwitch: already switched...\n");
+ if (priv->vtno == vt) return 0;
+
+ PRIV = priv;
+ priv->switched = 0; /* Will switch to 1 in handler */
+ priv->switch_return = switch_return;
+ priv->switch_return_data = switch_return_data;
+ kbdLinuxActivate(priv->fd, vt, 0);
+ return 1;
+}
+
+/* RATS: This function is only ever used to handle SIGUSR1. */
+static void kbdLinuxVTSignalHandler(int sig)
+{
+ myPrivate *priv = PRIV;
+
+ signal(sig, kbdLinuxVTSignalHandler);
+ if (priv) {
+ ioctl(priv->fd, VT_RELDISP, VT_ACKACQ);
+ priv->switched = !priv->switched;
+ LOG2("kbdLinuxVTSignalHandler: got signal %d, switched = %d\n",
+ sig, priv->switched);
+ if (!priv->switched && priv->switch_return)
+ priv->switch_return(priv->switch_return_data);
+ }
+}
+
+static int kbdLinuxActivate(int fd, int vtno, int setSig)
+{
+ int result;
+ struct vt_mode VT;
+
+ SYSCALL(result = ioctl(fd, VT_ACTIVATE, vtno));
+ if (result) FATAL0("kbdLinuxActivate: VT_ACTIVATE failed\n");
+ SYSCALL(result = ioctl(fd, VT_WAITACTIVE, vtno));
+ if (result) FATAL0("kbdLinuxActivate: VT_WAITACTIVE failed\n");
+ if (setSig) {
+ SYSCALL(result = ioctl(fd, VT_GETMODE, &VT));
+ if (result < 0) FATAL0("kbdLinuxActivate: VT_GETMODE failed\n");
+ VT.mode = VT_PROCESS;
+ VT.relsig = SIGUSR1;
+ VT.acqsig = SIGUSR1;
+ if (ioctl(fd, VT_SETMODE, &VT))
+ FATAL0("kbdLinuxActivate: VT_SETMODE VT_PROCESS failed\n");
+ signal(SIGUSR1, kbdLinuxVTSignalHandler);
+ }
+ return Success;
+}
+
+static void kbdLinuxOpenConsole(DevicePtr pDev)
+{
+ GETPRIV;
+ const char *msg = MESSAGE;
+
+ if (priv->fd >= 0) return;
+ priv->vtno = kbdLinuxGetFreeVTNumber();
+ priv->fd = kbdLinuxOpenVT(priv->vtno);
+ priv->vtcurrent = kbdLinuxGetCurrentVTNumber(priv->fd);
+ LOG2("kbdLinuxOpenConsole: current VT %d; using free VT %d\n",
+ priv->vtcurrent, priv->vtno);
+ kbdLinuxActivate(priv->fd, priv->vtno, 1);
+ ioctl(priv->fd, KDSETMODE, KD_GRAPHICS); /* To turn off gpm */
+ if (msg) write(priv->fd, msg, strlen(msg));
+}
+
+static void kbdLinuxCloseConsole(DevicePtr pDev)
+{
+ GETPRIV;
+ struct vt_mode VT;
+ const char *msg = FINALMESSAGE;
+
+ if (priv->fd < 0) return;
+
+ ioctl(priv->fd, KDSETMODE, KD_TEXT);
+ if (msg) write(priv->fd, msg, strlen(msg));
+ if (ioctl(priv->fd, VT_GETMODE, &VT) != -1) {
+ VT.mode = VT_AUTO;
+ ioctl(priv->fd, VT_SETMODE, &VT);
+ }
+
+ LOG1("kbdLinuxCloseConsole: switching to VT %d\n", priv->vtcurrent);
+ if (priv->vtcurrent >= 0) kbdLinuxActivate(priv->fd, priv->vtcurrent, 0);
+
+ close(priv->fd);
+ priv->fd = -1;
+}
+
+/** Initialize the \a pDev as a Linux keyboard. */
+void kbdLinuxInit(DevicePtr pDev)
+{
+ GETPRIV;
+
+ if (priv->fd <= 0) kbdLinuxOpenConsole(pDev);
+
+ ioctl(priv->fd, KDGKBMODE, &priv->kbdtrans);
+ if (tcgetattr(priv->fd, &priv->kbdtty) < 0)
+ FATAL1("kbdLinuxInit: tcgetattr failed (%s)\n", strerror(errno));
+}
+
+static int kbdLinuxPrefix0Mapping(unsigned char *scanCode)
+{
+ /* Table from xfree86/common/xf86Events.c */
+ switch (*scanCode) {
+ case KEY_KP_7: *scanCode = KEY_Home; break; /* curs home */
+ case KEY_KP_8: *scanCode = KEY_Up; break; /* curs up */
+ case KEY_KP_9: *scanCode = KEY_PgUp; break; /* curs pgup */
+ case KEY_KP_4: *scanCode = KEY_Left; break; /* curs left */
+ case KEY_KP_5: *scanCode = KEY_Begin; break; /* curs begin */
+ case KEY_KP_6: *scanCode = KEY_Right; break; /* curs right */
+ case KEY_KP_1: *scanCode = KEY_End; break; /* curs end */
+ case KEY_KP_2: *scanCode = KEY_Down; break; /* curs down */
+ case KEY_KP_3: *scanCode = KEY_PgDown; break; /* curs pgdown */
+ case KEY_KP_0: *scanCode = KEY_Insert; break; /* curs insert */
+ case KEY_KP_Decimal: *scanCode = KEY_Delete; break; /* curs delete */
+ case KEY_Enter: *scanCode = KEY_KP_Enter; break; /* keypad enter */
+ case KEY_LCtrl: *scanCode = KEY_RCtrl; break; /* right ctrl */
+ case KEY_KP_Multiply: *scanCode = KEY_Print; break; /* print */
+ case KEY_Slash: *scanCode = KEY_KP_Divide; break; /* keyp divide */
+ case KEY_Alt: *scanCode = KEY_AltLang; break; /* right alt */
+ case KEY_ScrollLock: *scanCode = KEY_Break; break; /* curs break */
+ case 0x5b: *scanCode = KEY_LMeta; break;
+ case 0x5c: *scanCode = KEY_RMeta; break;
+ case 0x5d: *scanCode = KEY_Menu; break;
+ case KEY_F3: *scanCode = KEY_F13; break;
+ case KEY_F4: *scanCode = KEY_F14; break;
+ case KEY_F5: *scanCode = KEY_F15; break;
+ case KEY_F6: *scanCode = KEY_F16; break;
+ case KEY_F7: *scanCode = KEY_F17; break;
+ case KEY_KP_Plus: *scanCode = KEY_KP_DEC; break;
+ /*
+ * Ignore virtual shifts (E0 2A, E0 AA, E0 36, E0 B6)
+ */
+ case 0x2A:
+ case 0x36:
+ return 1;
+ default:
+ /*
+ * "Internet" keyboards are generating lots of new codes.
+ * Let them pass. There is little consistency between them,
+ * so don't bother with symbolic names at this level.
+ */
+ scanCode += 0x78;
+ }
+ return 0;
+}
+
+static int kbdLinuxPrefixMapping(myPrivate *priv, unsigned char *scanCode)
+{
+ int pressed = *scanCode & 0x80;
+ unsigned char code = *scanCode & 0x7f;
+
+ /* If we don't have a prefix, check for one */
+ if (!priv->prefix) {
+ switch (code) {
+ case KEY_Prefix0:
+ case KEY_Prefix1:
+ priv->prefix = code;
+ return 1;
+ }
+ return 0; /* No change */
+ }
+
+ /* We have a prefix from the last scanCode */
+ switch (priv->prefix) {
+ case KEY_Prefix0:
+ priv->prefix = 0;
+ if (kbdLinuxPrefix0Mapping(&code)) return 1; /* Skip sequence */
+ break;
+ case KEY_Prefix1:
+ priv->prefix = (code = KEY_LCtrl) ? KEY_LCtrl : 0;
+ return 1; /* Use new prefix */
+ case KEY_LCtrl:
+ priv->prefix = 0;
+ if (code != KEY_NumLock) return 1; /* Skip sequence*/
+ code = KEY_Pause;
+ break;
+ }
+
+ *scanCode = code | (pressed ? 0x80 : 0x00);
+ return 0; /* Use old scanCode */
+}
+
+static void kbdLinuxConvert(DevicePtr pDev,
+ unsigned char scanCode,
+ ENQUEUEPROC enqueue,
+ CHECKPROC checkspecial,
+ BLOCK block)
+{
+ GETPRIV;
+ XkbSrvInfoPtr xkbi = priv->pKeyboard->key->xkbInfo;
+ int type;
+ KeySym keySym = NoSymbol;
+ int keyCode;
+ int switching;
+
+ /* Do special PC/AT prefix mapping -- may change scanCode! */
+ if (kbdLinuxPrefixMapping(priv, &scanCode)) return;
+
+ type = (scanCode & 0x80) ? KeyRelease : KeyPress;
+ keyCode = (scanCode & 0x7f) + MIN_KEYCODE;
+
+ /* Handle repeats */
+
+ if (keyCode >= xkbi->desc->min_key_code &&
+ keyCode <= xkbi->desc->max_key_code) {
+
+ int effectiveGroup = XkbGetEffectiveGroup(xkbi,
+ &xkbi->state,
+ scanCode);
+ keySym = XkbKeySym(xkbi->desc, scanCode, effectiveGroup);
+#if 0
+ switch (keySym) {
+ case XK_Num_Lock:
+ case XK_Scroll_Lock:
+ case XK_Shift_Lock:
+ case XK_Caps_Lock:
+ /* Ignore releases and all but first press */
+ if (kbdLinuxModIgnore(priv, &xE, keySym)) return;
+ if (kbdLinuxKeyDown(priv, &xE)) xE.u.u.type = KeyRelease;
+ else xE.u.u.type = KeyPress;
+ break;
+ }
+#endif
+
+ /* If key is already down, ignore or autorepeat */
+ if (type == KeyPress && kbdLinuxKeyDown(priv, keyCode)) {
+ KbdFeedbackClassRec *feed = priv->pKeyboard->kbdfeed;
+
+ /* No auto-repeat? */
+ if ((feed && !feed->ctrl.autoRepeat)
+ || priv->pKeyboard->key->xkbInfo->desc->map->modmap[keyCode]
+ || (feed
+ && !(feed->ctrl.autoRepeats[keyCode >> 3]
+ & (1 << (keyCode & 7))))) return; /* Ignore */
+
+ /* Do auto-repeat */
+ enqueue(pDev, KeyRelease, keyCode, keySym, NULL, block);
+ type = KeyPress;
+ }
+
+ /* If key is already up, ignore */
+ if (type == KeyRelease && !kbdLinuxKeyDown(priv, keyCode)) return;
+ }
+
+ switching = 0;
+ if (checkspecial && type == KeyPress)
+ switching = checkspecial(pDev, keySym);
+ if (!switching) {
+ if (enqueue)
+ enqueue(pDev, type, keyCode, keySym, NULL, block);
+ kbdLinuxKeyState(priv, type, keyCode); /* Update our state bitmap */
+ }
+}
+
+/** Read an event from the \a pDev device. If the event is a motion
+ * event, enqueue it with the \a motion function. Otherwise, check for
+ * special keys with the \a checkspecial function and enqueue the event
+ * with the \a enqueue function. The \a block type is passed to the
+ * functions so that they may block SIGIO handling as appropriate to the
+ * caller of this function. */
+void kbdLinuxRead(DevicePtr pDev,
+ MOTIONPROC motion,
+ ENQUEUEPROC enqueue,
+ CHECKPROC checkspecial,
+ BLOCK block)
+{
+ GETPRIV;
+ unsigned char buf[256]; /* RATS: Only used in length-limited call */
+ unsigned char *pt;
+ int n;
+
+ while ((n = read(priv->fd, buf, sizeof(buf))) > 0)
+ for (pt = buf; n; --n, ++pt)
+ kbdLinuxConvert(pDev, *pt, enqueue, checkspecial, block);
+}
+
+/** Turn \a pDev on (i.e., take input from \a pDev). */
+int kbdLinuxOn(DevicePtr pDev)
+{
+ GETPRIV;
+ struct termios nTty;
+
+ ioctl(priv->fd, KDSKBMODE, K_RAW);
+
+ nTty = priv->kbdtty;
+ nTty.c_iflag = (IGNPAR | IGNBRK) & (~PARMRK) & (~ISTRIP);
+ nTty.c_oflag = 0;
+ nTty.c_cflag = CREAD | CS8;
+ nTty.c_lflag = 0;
+ nTty.c_cc[VTIME] = 0;
+ nTty.c_cc[VMIN] = 1;
+ cfsetispeed(&nTty, B9600);
+ cfsetospeed(&nTty, B9600);
+ if (tcsetattr(priv->fd, TCSANOW, &nTty) < 0)
+ FATAL1("kbdLinuxOn: tcsetattr failed (%s)\n", strerror(errno));
+ return priv->fd;
+}
+
+/** Turn \a pDev off (i.e., stop taking input from \a pDev). */
+void kbdLinuxOff(DevicePtr pDev)
+{
+ GETPRIV;
+
+ ioctl(priv->fd, KDSKBMODE, priv->kbdtrans);
+ tcsetattr(priv->fd, TCSANOW, &priv->kbdtty);
+ kbdLinuxCloseConsole(pDev);
+}
+
+
+static void kbdLinuxReadKernelMapping(int fd, KeySymsPtr pKeySyms)
+{
+ KeySym *k;
+ int i;
+ int maxkey;
+ static unsigned char tbl[GLYPHS_PER_KEY] = { /* RATS: Use ok */
+ 0, /* unshifted */
+ 1, /* shifted */
+ 0, /* modeswitch unshifted */
+ 0 /* modeswitch shifted */
+ };
+
+ /*
+ * Read the mapping from the kernel.
+ * Since we're still using the XFree86 scancode->AT keycode mapping
+ * routines, we need to convert the AT keycodes to Linux keycodes,
+ * then translate the Linux keysyms into X keysyms.
+ *
+ * First, figure out which tables to use for the modeswitch columns
+ * above, from the XF86Config fields.
+ */
+ tbl[2] = 8; /* alt */
+ tbl[3] = tbl[2] | 1;
+
+#if 00/*BP*/
+ k = map+GLYPHS_PER_KEY;
+#else
+ ErrorF("kbdLinuxReadKernelMapping() is broken/no-op'd\n");
+ return;
+#endif
+ maxkey = NUM_AT2LNX;
+
+ for (i = 0; i < maxkey; ++i) {
+ struct kbentry kbe;
+ int j;
+
+ kbe.kb_index = at2lnx[i];
+
+ for (j = 0; j < GLYPHS_PER_KEY; ++j, ++k) {
+ unsigned short kval;
+
+ *k = NoSymbol;
+
+ kbe.kb_table = tbl[j];
+ if (kbe.kb_index == 0 || ioctl(fd, KDGKBENT, &kbe)) continue;
+
+ kval = KVAL(kbe.kb_value);
+ switch (KTYP(kbe.kb_value)) {
+ case KT_LATIN:
+ case KT_LETTER: *k = linux_to_x[kval]; break;
+ case KT_FN:
+ if (kval <= 19) *k = XK_F1 + kval;
+ else switch (kbe.kb_value) {
+ case K_FIND: *k = XK_Home; /* or XK_Find */ break;
+ case K_INSERT: *k = XK_Insert; break;
+ case K_REMOVE: *k = XK_Delete; break;
+ case K_SELECT: *k = XK_End; /* or XK_Select */ break;
+ case K_PGUP: *k = XK_Prior; break;
+ case K_PGDN: *k = XK_Next; break;
+ case K_HELP: *k = XK_Help; break;
+ case K_DO: *k = XK_Execute; break;
+ case K_PAUSE: *k = XK_Pause; break;
+ case K_MACRO: *k = XK_Menu; break;
+ default: break;
+ }
+ break;
+ case KT_SPEC:
+ switch (kbe.kb_value) {
+ case K_ENTER: *k = XK_Return; break;
+ case K_BREAK: *k = XK_Break; break;
+ case K_CAPS: *k = XK_Caps_Lock; break;
+ case K_NUM: *k = XK_Num_Lock; break;
+ case K_HOLD: *k = XK_Scroll_Lock; break;
+ case K_COMPOSE: *k = XK_Multi_key; break;
+ default: break;
+ }
+ break;
+ case KT_PAD:
+ switch (kbe.kb_value) {
+ case K_PPLUS: *k = XK_KP_Add; break;
+ case K_PMINUS: *k = XK_KP_Subtract; break;
+ case K_PSTAR: *k = XK_KP_Multiply; break;
+ case K_PSLASH: *k = XK_KP_Divide; break;
+ case K_PENTER: *k = XK_KP_Enter; break;
+ case K_PCOMMA: *k = XK_KP_Separator; break;
+ case K_PDOT: *k = XK_KP_Decimal; break;
+ case K_PPLUSMINUS: *k = XK_KP_Subtract; break;
+ default: if (kval <= 9) *k = XK_KP_0 + kval; break;
+ }
+ break;
+ case KT_DEAD:
+ /* KT_DEAD keys are for accelerated diacritical creation. */
+ switch (kbe.kb_value) {
+ case K_DGRAVE: *k = XK_dead_grave; break;
+ case K_DACUTE: *k = XK_dead_acute; break;
+ case K_DCIRCM: *k = XK_dead_circumflex; break;
+ case K_DTILDE: *k = XK_dead_tilde; break;
+ case K_DDIERE: *k = XK_dead_diaeresis; break;
+ }
+ break;
+ case KT_CUR:
+ switch (kbe.kb_value) {
+ case K_DOWN: *k = XK_Down; break;
+ case K_LEFT: *k = XK_Left; break;
+ case K_RIGHT: *k = XK_Right; break;
+ case K_UP: *k = XK_Up; break;
+ }
+ break;
+ case KT_SHIFT:
+ switch (kbe.kb_value) {
+ case K_ALTGR: *k = XK_Alt_R; break;
+ case K_ALT:
+ *k = (kbe.kb_index == 0x64 ? XK_Alt_R : XK_Alt_L);
+ break;
+ case K_CTRL:
+ *k = (kbe.kb_index == 0x61 ? XK_Control_R : XK_Control_L);
+ break;
+ case K_CTRLL: *k = XK_Control_L; break;
+ case K_CTRLR: *k = XK_Control_R; break;
+ case K_SHIFT:
+ *k = (kbe.kb_index == 0x36 ? XK_Shift_R : XK_Shift_L);
+ break;
+ case K_SHIFTL: *k = XK_Shift_L; break;
+ case K_SHIFTR: *k = XK_Shift_R; break;
+ default: break;
+ }
+ break;
+ case KT_ASCII:
+ /* KT_ASCII keys accumulate a 3 digit decimal number that
+ * gets emitted when the shift state changes. We can't
+ * emulate that.
+ */
+ break;
+ case KT_LOCK:
+ if (kbe.kb_value == K_SHIFTLOCK) *k = XK_Shift_Lock;
+ break;
+ default: break;
+ }
+ }
+
+ if (k[-1] == k[-2]) k[-1] = NoSymbol;
+ if (k[-2] == k[-3]) k[-2] = NoSymbol;
+ if (k[-3] == k[-4]) k[-3] = NoSymbol;
+ if (k[-4] == k[-2] && k[-3] == k[-1]) k[-2] = k[-1] = NoSymbol;
+ if (k[-1] == k[-4] && k[-2] == k[-3]
+ && k[-2] == NoSymbol) k[-1] = NoSymbol;
+ }
+}
+
+static void kbdLinuxGetMap(DevicePtr pDev, KeySymsPtr pKeySyms, CARD8 *pModMap)
+{
+ GETPRIV;
+ KeySym *k, *mapCopy;
+ char type;
+ int i;
+
+#if 00/*BP*/
+ mapCopy = malloc(sizeof(map));
+ memcpy(mapCopy, map, sizeof(map));
+#else
+ ErrorF("kbdLinuxGetMap() is broken/no-op'd\n");
+ return;
+#endif
+
+ kbdLinuxReadKernelMapping(priv->fd, pKeySyms);
+
+ /* compute the modifier map */
+ for (i = 0; i < MAP_LENGTH; i++)
+ pModMap[i] = NoSymbol; /* make sure it is restored */
+
+ for (k = mapCopy, i = MIN_KEYCODE;
+ i < NUM_KEYCODES + MIN_KEYCODE;
+ i++, k += 4) {
+ switch(*k) {
+ case XK_Shift_L:
+ case XK_Shift_R: pModMap[i] = ShiftMask; break;
+ case XK_Control_L:
+ case XK_Control_R: pModMap[i] = ControlMask; break;
+ case XK_Caps_Lock: pModMap[i] = LockMask; break;
+ case XK_Alt_L:
+ case XK_Alt_R: pModMap[i] = AltMask; break;
+ case XK_Num_Lock: pModMap[i] = NumLockMask; break;
+ case XK_Scroll_Lock: pModMap[i] = ScrollLockMask; break;
+ case XK_Kana_Lock:
+ case XK_Kana_Shift: pModMap[i] = KanaMask; break;
+ case XK_Mode_switch: pModMap[i] = AltLangMask; break;
+ }
+ }
+
+ priv->kbdType = (ioctl(priv->fd, KDGKBTYPE, &type) < 0) ? KB_101 : type;
+
+ pKeySyms->map = mapCopy; /* Must be XFree'able */
+ pKeySyms->mapWidth = GLYPHS_PER_KEY;
+ pKeySyms->minKeyCode = MIN_KEYCODE;
+ pKeySyms->maxKeyCode = MAX_KEYCODE;
+}
+
+/** Fill the \a info structure with information needed to initialize \a
+ * pDev. */
+void kbdLinuxGetInfo(DevicePtr pDev, DMXLocalInitInfoPtr info)
+{
+ info->keyboard = 1;
+ info->keyClass = 1;
+ kbdLinuxGetMap(pDev, &info->keySyms, info->modMap);
+ info->focusClass = 1;
+ info->kbdFeedbackClass = 1;
+}
diff --git a/xorg-server/hw/dmx/input/usb-common.c b/xorg-server/hw/dmx/input/usb-common.c
index c655a2984..944033eba 100644
--- a/xorg-server/hw/dmx/input/usb-common.c
+++ b/xorg-server/hw/dmx/input/usb-common.c
@@ -1,381 +1,381 @@
-/*
- * Copyright 2002-2003 Red Hat Inc., Durham, North Carolina.
- *
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation on the rights to use, copy, modify, merge,
- * publish, distribute, sublicense, and/or sell copies of the Software,
- * and to permit persons to whom the Software is furnished to do so,
- * subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial
- * portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-/*
- * Authors:
- * Rickard E. (Rik) Faith <faith@redhat.com>
- *
- */
-
-/** \file
- *
- * Routines that are common between \a usb-keyboard.c, \a usb-mouse.c, and
- * \a usb-other.c */
-
-#ifdef HAVE_DMX_CONFIG_H
-#include <dmx-config.h>
-#endif
-
-#include "usb-private.h"
-
-#define USB_COMMON_DEBUG 1
-
-/*****************************************************************************/
-/* Define some macros to make it easier to move this file to another
- * part of the Xserver tree. All calls to the dmx* layer are #defined
- * here for the .c file. The .h file will also have to be edited. */
-#include "usb-mouse.h"
-
-#define GETPRIV myPrivate *priv \
- = ((DMXLocalInputInfoPtr)(pDev->devicePrivate))->private
-
-#define GETNAME ((DMXLocalInputInfoPtr)(pDevice->public.devicePrivate)) \
- ->name
-
-#define LOG0(f) dmxLog(dmxDebug,f)
-#define LOG1(f,a) dmxLog(dmxDebug,f,a)
-#define LOG2(f,a,b) dmxLog(dmxDebug,f,a,b)
-#define LOG3(f,a,b,c) dmxLog(dmxDebug,f,a,b,c)
-#define LOG1INPUT(p,f,a) dmxLogInput(p->dmxInput,f,a)
-#define LOG3INPUT(p,f,a,b,c) dmxLogInput(p->dmxInput,f,a,b,c)
-#define LOG5INPUT(p,f,a,b,c,d,e) dmxLogInput(p->dmxInput,f,a,b,c,d,e)
-#define FATAL0(f) dmxLog(dmxFatal,f)
-#define FATAL1(f,a) dmxLog(dmxFatal,f,a)
-#define FATAL2(f,a,b) dmxLog(dmxFatal,f,a,b)
-#define MOTIONPROC dmxMotionProcPtr
-#define ENQUEUEPROC dmxEnqueueProcPtr
-#define CHECKPROC dmxCheckSpecialProcPtr
-#define BLOCK DMXBlockType
-
-/* End of interface definitions. */
-/*****************************************************************************/
-
-
-/** Read an event from the \a pDev device. If the event is a motion
- * event, enqueue it with the \a motion function. Otherwise, enqueue
- * the event with the \a enqueue function. The \a block type is passed
- * to the functions so that they may block SIGIO handling as appropriate
- * to the caller of this function.
- *
- * Since USB devices return EV_KEY events for buttons and keys, \a
- * minButton is used to decide if a Button or Key event should be
- * queued.*/
-void usbRead(DevicePtr pDev,
- MOTIONPROC motion,
- ENQUEUEPROC enqueue,
- int minButton,
- BLOCK block)
-{
- GETPRIV;
- struct input_event raw;
- int v[DMX_MAX_AXES];
- int axis;
-
-#define PRESS(b) \
- do { \
- enqueue(pDev, ButtonPress, 0, 0, NULL, block); \
- } while (0)
-
-#define RELEASE(b) \
- do { \
- enqueue(pDev, ButtonRelease, 0, 0, NULL, block); \
- } while (0)
-
- while (read(priv->fd, &raw, sizeof(raw)) > 0) {
-#if USB_COMMON_DEBUG > 1
- LOG3("USB: type = %d, code = 0x%02x, value = %d\n",
- raw.type, raw.code, raw.value);
-#endif
- switch (raw.type) {
- case EV_KEY:
- /* raw.value = 1 for first, 2 for repeat */
- if (raw.code > minButton) {
- if (raw.value) PRESS((raw.code & 0x0f) + 1);
- else RELEASE((raw.code & 0x0f) + 1);
- } else {
- enqueue(pDev, raw.value ? KeyPress : KeyRelease,
- 0, 0, NULL, block);
- }
- break;
- case EV_REL:
- switch (raw.code) {
- case REL_X:
- v[0] = -raw.value;
- v[1] = 0;
- motion(pDev, v, 0, 2, DMX_RELATIVE, block);
- break;
- case REL_Y:
- v[0] = 0;
- v[1] = -raw.value;
- motion(pDev, v, 0, 2, DMX_RELATIVE, block);
- break;
- case REL_WHEEL:
- if ((int)raw.value > 0) {
- PRESS(4);
- RELEASE(4);
- } else if ((int)raw.value < 0) {
- PRESS(5);
- RELEASE(5);
- }
- break;
- default:
- memset(v, 0, sizeof(v));
- axis = priv->relmap[raw.code];
- v[axis] = raw.value;
- motion(pDev, v, axis, 1, DMX_RELATIVE, block);
- }
- break;
- case EV_ABS:
- memset(v, 0, sizeof(v));
- axis = priv->absmap[raw.code];
- v[axis] = raw.value;
- motion(pDev, v, axis, 1, DMX_ABSOLUTE, block);
- break;
- }
- }
-}
-
-#define test_bit(bit) (priv->mask[(bit)/8] & (1 << ((bit)%8)))
-#define test_bits(bit) (bits[(bit)/8] & (1 << ((bit)%8)))
-
-static void usbPrint(myPrivate *priv,
- const char *filename, const char *devname, int fd)
-{
- int j, k;
- DeviceIntPtr pDevice = priv->pDevice;
- unsigned char bits[KEY_MAX/8 + 1]; /* RATS: Use ok assuming that
- * KEY_MAX is greater than
- * REL_MAX, ABS_MAX, SND_MAX, and
- * LED_MAX. */
-
- LOG3INPUT(priv, "%s (%s) using %s\n", pDevice->name, GETNAME, filename);
- LOG1INPUT(priv, " %s\n", devname);
- for (j = 0; j < EV_MAX; j++) {
- if (test_bit(j)) {
- const char *type = "unknown";
- char extra[256]; /* FIXME: may cause buffer overflow */
- extra[0] = '\0';
- switch(j) {
- case EV_KEY: type = "keys/buttons"; break;
- case EV_REL: type = "relative";
- memset(bits, 0, sizeof(bits));
- ioctl(priv->fd, EVIOCGBIT(EV_REL, sizeof(bits)), bits);
- for (k = 0; k < REL_MAX; k++) {
- if (test_bits(k)) switch (k) {
- case REL_X: strcat(extra, " X"); break;
- case REL_Y: strcat(extra, " Y"); break;
- case REL_Z: strcat(extra, " Z"); break;
- case REL_HWHEEL: strcat(extra, " HWheel"); break;
- case REL_DIAL: strcat(extra, " Dial"); break;
- case REL_WHEEL: strcat(extra, " Wheel"); break;
- case REL_MISC: strcat(extra, " Misc"); break;
- }
- }
- break;
- case EV_ABS: type = "absolute";
- memset(bits, 0, sizeof(bits));
- ioctl(priv->fd, EVIOCGBIT(EV_ABS, sizeof(bits)), bits);
- for (k = 0; k < ABS_MAX; k++) {
- if (test_bits(k)) switch (k) {
- case ABS_X: strcat(extra," X"); break;
- case ABS_Y: strcat(extra," Y"); break;
- case ABS_Z: strcat(extra," Z"); break;
- case ABS_RX: strcat(extra," RX"); break;
- case ABS_RY: strcat(extra," RY"); break;
- case ABS_RZ: strcat(extra," RZ"); break;
- case ABS_THROTTLE: strcat(extra," Throttle");break;
- case ABS_RUDDER: strcat(extra," Rudder"); break;
- case ABS_WHEEL: strcat(extra," Wheel"); break;
- case ABS_GAS: strcat(extra," Gas"); break;
- case ABS_BRAKE: strcat(extra," Break"); break;
- case ABS_HAT0X: strcat(extra," Hat0X"); break;
- case ABS_HAT0Y: strcat(extra," Hat0Y"); break;
- case ABS_HAT1X: strcat(extra," Hat1X"); break;
- case ABS_HAT1Y: strcat(extra," Hat1Y"); break;
- case ABS_HAT2X: strcat(extra," Hat2X"); break;
- case ABS_HAT2Y: strcat(extra," Hat2Y"); break;
- case ABS_HAT3X: strcat(extra," Hat3X"); break;
- case ABS_HAT3Y: strcat(extra," Hat3Y"); break;
- case ABS_PRESSURE: strcat(extra," Pressure");break;
- case ABS_DISTANCE: strcat(extra," Distance");break;
- case ABS_TILT_X: strcat(extra," TiltX"); break;
- case ABS_TILT_Y: strcat(extra," TiltY"); break;
- case ABS_MISC: strcat(extra," Misc"); break;
- }
- }
- break;
- case EV_MSC: type = "reserved"; break;
- case EV_LED: type = "leds";
- memset(bits, 0, sizeof(bits));
- ioctl(priv->fd, EVIOCGBIT(EV_LED, sizeof(bits)), bits);
- for (k = 0; k < LED_MAX; k++) {
- if (test_bits(k)) switch (k) {
- case LED_NUML: strcat(extra," NumLock"); break;
- case LED_CAPSL: strcat(extra," CapsLock"); break;
- case LED_SCROLLL: strcat(extra," ScrlLock"); break;
- case LED_COMPOSE: strcat(extra," Compose"); break;
- case LED_KANA: strcat(extra," Kana"); break;
- case LED_SLEEP: strcat(extra," Sleep"); break;
- case LED_SUSPEND: strcat(extra," Suspend"); break;
- case LED_MUTE: strcat(extra," Mute"); break;
- case LED_MISC: strcat(extra," Misc"); break;
- }
- }
- break;
- case EV_SND: type = "sound";
- memset(bits, 0, sizeof(bits));
- ioctl(priv->fd, EVIOCGBIT(EV_SND, sizeof(bits)), bits);
- for (k = 0; k < SND_MAX; k++) {
- if (test_bits(k)) switch (k) {
- case SND_CLICK: strcat(extra," Click"); break;
- case SND_BELL: strcat(extra," Bell"); break;
- }
- }
- break;
- case EV_REP: type = "repeat"; break;
- case EV_FF: type = "feedback"; break;
- }
- LOG5INPUT(priv, " Feature 0x%02x = %s%s%s%s\n", j, type,
- extra[0] ? " [" : "",
- extra[0] ? extra+1 : "",
- extra[0] ? "]" : "");
- }
- }
-}
-
-/** Initialized \a pDev as a \a usbMouse, \a usbKeyboard, or \a usbOther
-device. */
-void usbInit(DevicePtr pDev, usbType type)
-{
- GETPRIV;
- char name[64]; /* RATS: Only used in XmuSnprintf */
- int i, j, k;
- char buf[256] = { 0, }; /* RATS: Use ok */
- int version;
- unsigned char bits[KEY_MAX/8 + 1]; /* RATS: Use ok assuming that
- * KEY_MAX is greater than
- * REL_MAX, ABS_MAX, SND_MAX, and
- * LED_MAX. */
-
- if (priv->fd >=0) return;
-
- for (i = 0; i < 32; i++) {
- XmuSnprintf(name, sizeof(name), "/dev/input/event%d", i);
- if ((priv->fd = open(name, O_RDWR | O_NONBLOCK, 0)) >= 0) {
- ioctl(priv->fd, EVIOCGVERSION, &version);
- ioctl(priv->fd, EVIOCGNAME(sizeof(buf)), buf);
- memset(priv->mask, 0, sizeof(priv->mask));
- ioctl(priv->fd, EVIOCGBIT(0, sizeof(priv->mask)), priv->mask);
-
- for (j = 0; j < EV_MAX; j++) {
- if (test_bit(j)) {
- switch(j) {
- case EV_REL:
- memset(bits, 0, sizeof(bits));
- ioctl(priv->fd, EVIOCGBIT(EV_REL, sizeof(bits)), bits);
- for (k = 0; k < REL_MAX; k++) {
- if (test_bits(k)) {
- if (k == REL_X) priv->relmap[k] = 0;
- else if (k == REL_Y) priv->relmap[k] = 1;
- else priv->relmap[k] = 2 + priv->numAbs;
- ++priv->numRel;
- }
- }
- break;
- case EV_ABS:
- memset(bits, 0, sizeof(bits));
- ioctl(priv->fd, EVIOCGBIT(EV_ABS, sizeof(bits)), bits);
- for (k = 0; k < ABS_MAX; k++) {
- if (test_bits(k)) {
- priv->absmap[k] = priv->numAbs;
- ++priv->numAbs;
- }
- }
- break;
- case EV_LED:
- memset(bits, 0, sizeof(bits));
- ioctl(priv->fd, EVIOCGBIT(EV_LED, sizeof(bits)), bits);
- for (k = 0; k < LED_MAX; k++) {
- if (test_bits(k)) ++priv->numLeds;
- }
- break;
- }
- }
- }
- switch (type) {
- case usbMouse:
- if (test_bit(EV_REL) && test_bit(EV_KEY))
- goto found;
- break;
- case usbKeyboard:
- if (test_bit(EV_KEY) && test_bit(EV_LED) && !test_bit(EV_ABS))
- goto found;
- break;
- case usbOther:
- if (!(test_bit(EV_REL) && test_bit(EV_KEY))
- && !(test_bit(EV_KEY) && test_bit(EV_LED)
- && !test_bit(EV_ABS)))
- goto found;
- break;
- }
- close(priv->fd);
- priv->fd = -1;
- }
- }
- if (priv->fd < 0)
- FATAL1("usbInit: Cannot open /dev/input/event* port (%s)\n"
- " If you have not done so, you may need to:\n"
- " rmmod mousedev; rmmod keybdev\n"
- " modprobe evdev\n",
- strerror(errno));
- found:
- usbPrint(priv, name, buf, priv->fd);
-}
-
-/** Turn \a pDev off (i.e., stop taking input from \a pDev). */
-void usbOff(DevicePtr pDev)
-{
- GETPRIV;
-
- if (priv->fd >= 0) close(priv->fd);
- priv->fd = -1;
-}
-
-/** Create a private structure for use within this file. */
-pointer usbCreatePrivate(DeviceIntPtr pDevice)
-{
- myPrivate *priv = calloc(1, sizeof(*priv));
- priv->fd = -1;
- priv->pDevice = pDevice;
- return priv;
-}
-
-/** Destroy a private structure. */
-void usbDestroyPrivate(pointer priv)
-{
- free(priv);
-}
+/*
+ * Copyright 2002-2003 Red Hat Inc., Durham, North Carolina.
+ *
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation on the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/*
+ * Authors:
+ * Rickard E. (Rik) Faith <faith@redhat.com>
+ *
+ */
+
+/** \file
+ *
+ * Routines that are common between \a usb-keyboard.c, \a usb-mouse.c, and
+ * \a usb-other.c */
+
+#ifdef HAVE_DMX_CONFIG_H
+#include <dmx-config.h>
+#endif
+
+#include "usb-private.h"
+
+#define USB_COMMON_DEBUG 1
+
+/*****************************************************************************/
+/* Define some macros to make it easier to move this file to another
+ * part of the Xserver tree. All calls to the dmx* layer are #defined
+ * here for the .c file. The .h file will also have to be edited. */
+#include "usb-mouse.h"
+
+#define GETPRIV myPrivate *priv \
+ = ((DMXLocalInputInfoPtr)(pDev->devicePrivate))->private
+
+#define GETNAME ((DMXLocalInputInfoPtr)(pDevice->public.devicePrivate)) \
+ ->name
+
+#define LOG0(f) dmxLog(dmxDebug,f)
+#define LOG1(f,a) dmxLog(dmxDebug,f,a)
+#define LOG2(f,a,b) dmxLog(dmxDebug,f,a,b)
+#define LOG3(f,a,b,c) dmxLog(dmxDebug,f,a,b,c)
+#define LOG1INPUT(p,f,a) dmxLogInput(p->dmxInput,f,a)
+#define LOG3INPUT(p,f,a,b,c) dmxLogInput(p->dmxInput,f,a,b,c)
+#define LOG5INPUT(p,f,a,b,c,d,e) dmxLogInput(p->dmxInput,f,a,b,c,d,e)
+#define FATAL0(f) dmxLog(dmxFatal,f)
+#define FATAL1(f,a) dmxLog(dmxFatal,f,a)
+#define FATAL2(f,a,b) dmxLog(dmxFatal,f,a,b)
+#define MOTIONPROC dmxMotionProcPtr
+#define ENQUEUEPROC dmxEnqueueProcPtr
+#define CHECKPROC dmxCheckSpecialProcPtr
+#define BLOCK DMXBlockType
+
+/* End of interface definitions. */
+/*****************************************************************************/
+
+
+/** Read an event from the \a pDev device. If the event is a motion
+ * event, enqueue it with the \a motion function. Otherwise, enqueue
+ * the event with the \a enqueue function. The \a block type is passed
+ * to the functions so that they may block SIGIO handling as appropriate
+ * to the caller of this function.
+ *
+ * Since USB devices return EV_KEY events for buttons and keys, \a
+ * minButton is used to decide if a Button or Key event should be
+ * queued.*/
+void usbRead(DevicePtr pDev,
+ MOTIONPROC motion,
+ ENQUEUEPROC enqueue,
+ int minButton,
+ BLOCK block)
+{
+ GETPRIV;
+ struct input_event raw;
+ int v[DMX_MAX_AXES];
+ int axis;
+
+#define PRESS(b) \
+ do { \
+ enqueue(pDev, ButtonPress, 0, 0, NULL, block); \
+ } while (0)
+
+#define RELEASE(b) \
+ do { \
+ enqueue(pDev, ButtonRelease, 0, 0, NULL, block); \
+ } while (0)
+
+ while (read(priv->fd, &raw, sizeof(raw)) > 0) {
+#if USB_COMMON_DEBUG > 1
+ LOG3("USB: type = %d, code = 0x%02x, value = %d\n",
+ raw.type, raw.code, raw.value);
+#endif
+ switch (raw.type) {
+ case EV_KEY:
+ /* raw.value = 1 for first, 2 for repeat */
+ if (raw.code > minButton) {
+ if (raw.value) PRESS((raw.code & 0x0f) + 1);
+ else RELEASE((raw.code & 0x0f) + 1);
+ } else {
+ enqueue(pDev, raw.value ? KeyPress : KeyRelease,
+ 0, 0, NULL, block);
+ }
+ break;
+ case EV_REL:
+ switch (raw.code) {
+ case REL_X:
+ v[0] = -raw.value;
+ v[1] = 0;
+ motion(pDev, v, 0, 2, DMX_RELATIVE, block);
+ break;
+ case REL_Y:
+ v[0] = 0;
+ v[1] = -raw.value;
+ motion(pDev, v, 0, 2, DMX_RELATIVE, block);
+ break;
+ case REL_WHEEL:
+ if ((int)raw.value > 0) {
+ PRESS(4);
+ RELEASE(4);
+ } else if ((int)raw.value < 0) {
+ PRESS(5);
+ RELEASE(5);
+ }
+ break;
+ default:
+ memset(v, 0, sizeof(v));
+ axis = priv->relmap[raw.code];
+ v[axis] = raw.value;
+ motion(pDev, v, axis, 1, DMX_RELATIVE, block);
+ }
+ break;
+ case EV_ABS:
+ memset(v, 0, sizeof(v));
+ axis = priv->absmap[raw.code];
+ v[axis] = raw.value;
+ motion(pDev, v, axis, 1, DMX_ABSOLUTE, block);
+ break;
+ }
+ }
+}
+
+#define test_bit(bit) (priv->mask[(bit)/8] & (1 << ((bit)%8)))
+#define test_bits(bit) (bits[(bit)/8] & (1 << ((bit)%8)))
+
+static void usbPrint(myPrivate *priv,
+ const char *filename, const char *devname, int fd)
+{
+ int j, k;
+ DeviceIntPtr pDevice = priv->pDevice;
+ unsigned char bits[KEY_MAX/8 + 1]; /* RATS: Use ok assuming that
+ * KEY_MAX is greater than
+ * REL_MAX, ABS_MAX, SND_MAX, and
+ * LED_MAX. */
+
+ LOG3INPUT(priv, "%s (%s) using %s\n", pDevice->name, GETNAME, filename);
+ LOG1INPUT(priv, " %s\n", devname);
+ for (j = 0; j < EV_MAX; j++) {
+ if (test_bit(j)) {
+ const char *type = "unknown";
+ char extra[256]; /* FIXME: may cause buffer overflow */
+ extra[0] = '\0';
+ switch(j) {
+ case EV_KEY: type = "keys/buttons"; break;
+ case EV_REL: type = "relative";
+ memset(bits, 0, sizeof(bits));
+ ioctl(priv->fd, EVIOCGBIT(EV_REL, sizeof(bits)), bits);
+ for (k = 0; k < REL_MAX; k++) {
+ if (test_bits(k)) switch (k) {
+ case REL_X: strcat(extra, " X"); break;
+ case REL_Y: strcat(extra, " Y"); break;
+ case REL_Z: strcat(extra, " Z"); break;
+ case REL_HWHEEL: strcat(extra, " HWheel"); break;
+ case REL_DIAL: strcat(extra, " Dial"); break;
+ case REL_WHEEL: strcat(extra, " Wheel"); break;
+ case REL_MISC: strcat(extra, " Misc"); break;
+ }
+ }
+ break;
+ case EV_ABS: type = "absolute";
+ memset(bits, 0, sizeof(bits));
+ ioctl(priv->fd, EVIOCGBIT(EV_ABS, sizeof(bits)), bits);
+ for (k = 0; k < ABS_MAX; k++) {
+ if (test_bits(k)) switch (k) {
+ case ABS_X: strcat(extra," X"); break;
+ case ABS_Y: strcat(extra," Y"); break;
+ case ABS_Z: strcat(extra," Z"); break;
+ case ABS_RX: strcat(extra," RX"); break;
+ case ABS_RY: strcat(extra," RY"); break;
+ case ABS_RZ: strcat(extra," RZ"); break;
+ case ABS_THROTTLE: strcat(extra," Throttle");break;
+ case ABS_RUDDER: strcat(extra," Rudder"); break;
+ case ABS_WHEEL: strcat(extra," Wheel"); break;
+ case ABS_GAS: strcat(extra," Gas"); break;
+ case ABS_BRAKE: strcat(extra," Break"); break;
+ case ABS_HAT0X: strcat(extra," Hat0X"); break;
+ case ABS_HAT0Y: strcat(extra," Hat0Y"); break;
+ case ABS_HAT1X: strcat(extra," Hat1X"); break;
+ case ABS_HAT1Y: strcat(extra," Hat1Y"); break;
+ case ABS_HAT2X: strcat(extra," Hat2X"); break;
+ case ABS_HAT2Y: strcat(extra," Hat2Y"); break;
+ case ABS_HAT3X: strcat(extra," Hat3X"); break;
+ case ABS_HAT3Y: strcat(extra," Hat3Y"); break;
+ case ABS_PRESSURE: strcat(extra," Pressure");break;
+ case ABS_DISTANCE: strcat(extra," Distance");break;
+ case ABS_TILT_X: strcat(extra," TiltX"); break;
+ case ABS_TILT_Y: strcat(extra," TiltY"); break;
+ case ABS_MISC: strcat(extra," Misc"); break;
+ }
+ }
+ break;
+ case EV_MSC: type = "reserved"; break;
+ case EV_LED: type = "leds";
+ memset(bits, 0, sizeof(bits));
+ ioctl(priv->fd, EVIOCGBIT(EV_LED, sizeof(bits)), bits);
+ for (k = 0; k < LED_MAX; k++) {
+ if (test_bits(k)) switch (k) {
+ case LED_NUML: strcat(extra," NumLock"); break;
+ case LED_CAPSL: strcat(extra," CapsLock"); break;
+ case LED_SCROLLL: strcat(extra," ScrlLock"); break;
+ case LED_COMPOSE: strcat(extra," Compose"); break;
+ case LED_KANA: strcat(extra," Kana"); break;
+ case LED_SLEEP: strcat(extra," Sleep"); break;
+ case LED_SUSPEND: strcat(extra," Suspend"); break;
+ case LED_MUTE: strcat(extra," Mute"); break;
+ case LED_MISC: strcat(extra," Misc"); break;
+ }
+ }
+ break;
+ case EV_SND: type = "sound";
+ memset(bits, 0, sizeof(bits));
+ ioctl(priv->fd, EVIOCGBIT(EV_SND, sizeof(bits)), bits);
+ for (k = 0; k < SND_MAX; k++) {
+ if (test_bits(k)) switch (k) {
+ case SND_CLICK: strcat(extra," Click"); break;
+ case SND_BELL: strcat(extra," Bell"); break;
+ }
+ }
+ break;
+ case EV_REP: type = "repeat"; break;
+ case EV_FF: type = "feedback"; break;
+ }
+ LOG5INPUT(priv, " Feature 0x%02x = %s%s%s%s\n", j, type,
+ extra[0] ? " [" : "",
+ extra[0] ? extra+1 : "",
+ extra[0] ? "]" : "");
+ }
+ }
+}
+
+/** Initialized \a pDev as a \a usbMouse, \a usbKeyboard, or \a usbOther
+device. */
+void usbInit(DevicePtr pDev, usbType type)
+{
+ GETPRIV;
+ char name[64]; /* RATS: Only used in snprintf */
+ int i, j, k;
+ char buf[256] = { 0, }; /* RATS: Use ok */
+ int version;
+ unsigned char bits[KEY_MAX/8 + 1]; /* RATS: Use ok assuming that
+ * KEY_MAX is greater than
+ * REL_MAX, ABS_MAX, SND_MAX, and
+ * LED_MAX. */
+
+ if (priv->fd >=0) return;
+
+ for (i = 0; i < 32; i++) {
+ snprintf(name, sizeof(name), "/dev/input/event%d", i);
+ if ((priv->fd = open(name, O_RDWR | O_NONBLOCK, 0)) >= 0) {
+ ioctl(priv->fd, EVIOCGVERSION, &version);
+ ioctl(priv->fd, EVIOCGNAME(sizeof(buf)), buf);
+ memset(priv->mask, 0, sizeof(priv->mask));
+ ioctl(priv->fd, EVIOCGBIT(0, sizeof(priv->mask)), priv->mask);
+
+ for (j = 0; j < EV_MAX; j++) {
+ if (test_bit(j)) {
+ switch(j) {
+ case EV_REL:
+ memset(bits, 0, sizeof(bits));
+ ioctl(priv->fd, EVIOCGBIT(EV_REL, sizeof(bits)), bits);
+ for (k = 0; k < REL_MAX; k++) {
+ if (test_bits(k)) {
+ if (k == REL_X) priv->relmap[k] = 0;
+ else if (k == REL_Y) priv->relmap[k] = 1;
+ else priv->relmap[k] = 2 + priv->numAbs;
+ ++priv->numRel;
+ }
+ }
+ break;
+ case EV_ABS:
+ memset(bits, 0, sizeof(bits));
+ ioctl(priv->fd, EVIOCGBIT(EV_ABS, sizeof(bits)), bits);
+ for (k = 0; k < ABS_MAX; k++) {
+ if (test_bits(k)) {
+ priv->absmap[k] = priv->numAbs;
+ ++priv->numAbs;
+ }
+ }
+ break;
+ case EV_LED:
+ memset(bits, 0, sizeof(bits));
+ ioctl(priv->fd, EVIOCGBIT(EV_LED, sizeof(bits)), bits);
+ for (k = 0; k < LED_MAX; k++) {
+ if (test_bits(k)) ++priv->numLeds;
+ }
+ break;
+ }
+ }
+ }
+ switch (type) {
+ case usbMouse:
+ if (test_bit(EV_REL) && test_bit(EV_KEY))
+ goto found;
+ break;
+ case usbKeyboard:
+ if (test_bit(EV_KEY) && test_bit(EV_LED) && !test_bit(EV_ABS))
+ goto found;
+ break;
+ case usbOther:
+ if (!(test_bit(EV_REL) && test_bit(EV_KEY))
+ && !(test_bit(EV_KEY) && test_bit(EV_LED)
+ && !test_bit(EV_ABS)))
+ goto found;
+ break;
+ }
+ close(priv->fd);
+ priv->fd = -1;
+ }
+ }
+ if (priv->fd < 0)
+ FATAL1("usbInit: Cannot open /dev/input/event* port (%s)\n"
+ " If you have not done so, you may need to:\n"
+ " rmmod mousedev; rmmod keybdev\n"
+ " modprobe evdev\n",
+ strerror(errno));
+ found:
+ usbPrint(priv, name, buf, priv->fd);
+}
+
+/** Turn \a pDev off (i.e., stop taking input from \a pDev). */
+void usbOff(DevicePtr pDev)
+{
+ GETPRIV;
+
+ if (priv->fd >= 0) close(priv->fd);
+ priv->fd = -1;
+}
+
+/** Create a private structure for use within this file. */
+pointer usbCreatePrivate(DeviceIntPtr pDevice)
+{
+ myPrivate *priv = calloc(1, sizeof(*priv));
+ priv->fd = -1;
+ priv->pDevice = pDevice;
+ return priv;
+}
+
+/** Destroy a private structure. */
+void usbDestroyPrivate(pointer priv)
+{
+ free(priv);
+}
diff --git a/xorg-server/hw/kdrive/ephyr/ephyrdriext.c b/xorg-server/hw/kdrive/ephyr/ephyrdriext.c
index 0bd51b2c7..0741a7294 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyrdriext.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyrdriext.c
@@ -541,7 +541,6 @@ static int
ProcXF86DRIQueryVersion (register ClientPtr client)
{
xXF86DRIQueryVersionReply rep;
- register int n;
REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq);
EPHYR_LOG ("enter\n") ;
@@ -553,11 +552,11 @@ ProcXF86DRIQueryVersion (register ClientPtr client)
rep.minorVersion = SERVER_XF86DRI_MINOR_VERSION;
rep.patchVersion = SERVER_XF86DRI_PATCH_VERSION;
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- swapl(&rep.patchVersion, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.majorVersion);
+ swaps(&rep.minorVersion);
+ swapl(&rep.patchVersion);
}
WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep);
EPHYR_LOG ("leave\n") ;
@@ -569,7 +568,6 @@ ProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client)
{
xXF86DRIQueryDirectRenderingCapableReply rep;
Bool isCapable;
- register int n;
REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq);
@@ -592,8 +590,8 @@ ProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client)
rep.isCapable = 0;
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
}
WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply), (char *)&rep);
@@ -1311,19 +1309,17 @@ ProcXF86DRIDispatch (register ClientPtr client)
static int
SProcXF86DRIQueryVersion (register ClientPtr client)
{
- register int n;
REQUEST(xXF86DRIQueryVersionReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return ProcXF86DRIQueryVersion(client);
}
static int
SProcXF86DRIQueryDirectRenderingCapable (register ClientPtr client)
{
- register int n;
REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
- swaps(&stuff->length, n);
- swapl(&stuff->screen, n);
+ swaps(&stuff->length);
+ swapl(&stuff->screen);
return ProcXF86DRIQueryDirectRenderingCapable(client);
}
diff --git a/xorg-server/hw/kdrive/ephyr/ephyrhostproxy.c b/xorg-server/hw/kdrive/ephyr/ephyrhostproxy.c
index ce3f01852..3137055ca 100644
--- a/xorg-server/hw/kdrive/ephyr/ephyrhostproxy.c
+++ b/xorg-server/hw/kdrive/ephyr/ephyrhostproxy.c
@@ -68,7 +68,7 @@ ephyrHostProxyDoForward (pointer a_request_buffer,
EPHYR_LOG ("enter\n") ;
if (a_do_swap) {
- swaps (&in_req->length, n) ;
+ swaps(&in_req->length) ;
}
EPHYR_LOG ("Req {type:%d, data:%d, length:%d}\n",
in_req->reqType, in_req->data, in_req->length) ;
diff --git a/xorg-server/hw/vfb/InitOutput.c b/xorg-server/hw/vfb/InitOutput.c
index 31ed50533..0e701e518 100644
--- a/xorg-server/hw/vfb/InitOutput.c
+++ b/xorg-server/hw/vfb/InitOutput.c
@@ -760,8 +760,7 @@ vfbWriteXWDFileHeader(ScreenPtr pScreen)
SwapLongs((CARD32 *)pXWDHeader, SIZEOF(XWDheader)/4);
for (i = 0; i < pvfb->ncolors; i++)
{
- register char n;
- swapl(&pvfb->pXWDCmap[i].pixel, n);
+ swapl(&pvfb->pXWDCmap[i].pixel);
}
}
}
diff --git a/xorg-server/hw/xfree86/common/xf86.h b/xorg-server/hw/xfree86/common/xf86.h
index 54332e381..e1e0cd7e0 100644
--- a/xorg-server/hw/xfree86/common/xf86.h
+++ b/xorg-server/hw/xfree86/common/xf86.h
@@ -263,7 +263,6 @@ extern _X_EXPORT Bool xf86GetVidModeEnabled(void);
extern _X_EXPORT Bool xf86GetModInDevAllowNonLocal(void);
extern _X_EXPORT Bool xf86GetModInDevEnabled(void);
extern _X_EXPORT Bool xf86GetAllowMouseOpenFail(void);
-extern _X_EXPORT Bool xf86IsPc98(void);
extern _X_EXPORT void xf86DisableRandR(void);
extern _X_EXPORT CARD32 xorgGetVersion(void);
extern _X_EXPORT CARD32 xf86GetModuleVersion(pointer module);
diff --git a/xorg-server/hw/xfree86/common/xf86Config.c b/xorg-server/hw/xfree86/common/xf86Config.c
index 58b30dd68..3aa923a28 100644
--- a/xorg-server/hw/xfree86/common/xf86Config.c
+++ b/xorg-server/hw/xfree86/common/xf86Config.c
@@ -676,7 +676,6 @@ typedef enum {
FLAG_DPMS_SUSPENDTIME,
FLAG_DPMS_OFFTIME,
FLAG_PIXMAP,
- FLAG_PC98,
FLAG_NOPM,
FLAG_XINERAMA,
FLAG_LOG,
@@ -724,8 +723,6 @@ static OptionInfoRec FlagOptions[] = {
{0}, FALSE },
{ FLAG_PIXMAP, "Pixmap", OPTV_INTEGER,
{0}, FALSE },
- { FLAG_PC98, "PC98", OPTV_BOOLEAN,
- {0}, FALSE },
{ FLAG_NOPM, "NoPM", OPTV_BOOLEAN,
{0}, FALSE },
{ FLAG_XINERAMA, "Xinerama", OPTV_BOOLEAN,
@@ -756,21 +753,6 @@ static OptionInfoRec FlagOptions[] = {
{0}, FALSE },
};
-#ifdef SUPPORT_PC98
-static Bool
-detectPC98(void)
-{
- unsigned char buf[2];
-
- if (xf86ReadBIOS(0xf8000, 0xe80, buf, 2) != 2)
- return FALSE;
- if ((buf[0] == 0x98) && (buf[1] == 0x21))
- return TRUE;
- else
- return FALSE;
-}
-#endif
-
static Bool
configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
{
@@ -1026,18 +1008,6 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
xf86Info.pixmap24 = Pix24DontCare;
xf86Info.pix24From = X_DEFAULT;
}
-#ifdef SUPPORT_PC98
- if (xf86GetOptValBool(FlagOptions, FLAG_PC98, &value)) {
- xf86Info.pc98 = value;
- if (value) {
- xf86Msg(X_CONFIG, "Japanese PC98 architecture\n");
- }
- } else
- if (detectPC98()) {
- xf86Info.pc98 = TRUE;
- xf86Msg(X_PROBED, "Japanese PC98 architecture\n");
- }
-#endif
#ifdef PANORAMIX
from = X_DEFAULT;
diff --git a/xorg-server/hw/xfree86/common/xf86Globals.c b/xorg-server/hw/xfree86/common/xf86Globals.c
index 16d55577e..93533ec80 100644
--- a/xorg-server/hw/xfree86/common/xf86Globals.c
+++ b/xorg-server/hw/xfree86/common/xf86Globals.c
@@ -103,6 +103,8 @@ xf86InfoRec xf86Info = {
.vtPendingNum = -1,
#endif
.dontVTSwitch = FALSE,
+ .autoVTSwitch = TRUE,
+ .ShareVTs = FALSE,
.dontZap = FALSE,
.dontZoom = FALSE,
.notrapSignals = FALSE,
@@ -119,9 +121,6 @@ xf86InfoRec xf86Info = {
.miscModInDevAllowNonLocal = FALSE,
.pixmap24 = Pix24DontCare,
.pix24From = X_DEFAULT,
-#ifdef SUPPORT_PC98
- .pc98 = FALSE,
-#endif
.pmFlag = TRUE,
.log = LogNone,
.disableRandR = FALSE,
diff --git a/xorg-server/hw/xfree86/common/xf86Helper.c b/xorg-server/hw/xfree86/common/xf86Helper.c
index f8e6c8b41..7c76fa8ec 100644
--- a/xorg-server/hw/xfree86/common/xf86Helper.c
+++ b/xorg-server/hw/xfree86/common/xf86Helper.c
@@ -1583,16 +1583,6 @@ xf86GetAllowMouseOpenFail(void)
}
-Bool
-xf86IsPc98(void)
-{
-#if SUPPORT_PC98
- return xf86Info.pc98;
-#else
- return FALSE;
-#endif
-}
-
void
xf86DisableRandR(void)
{
diff --git a/xorg-server/hw/xfree86/common/xf86Init.c b/xorg-server/hw/xfree86/common/xf86Init.c
index 71926f8e7..93ea333bf 100644
--- a/xorg-server/hw/xfree86/common/xf86Init.c
+++ b/xorg-server/hw/xfree86/common/xf86Init.c
@@ -1352,6 +1352,16 @@ ddxProcessArgument(int argc, char **argv, int i)
xf86xkbdirFlag = TRUE;
return 0;
}
+ if (!strcmp(argv[i], "-novtswitch"))
+ {
+ xf86Info.autoVTSwitch = FALSE;
+ return 1;
+ }
+ if (!strcmp(argv[i], "-sharevts"))
+ {
+ xf86Info.ShareVTs = TRUE;
+ return 1;
+ }
/* OS-specific processing */
return xf86ProcessArgument(argc, argv, i);
@@ -1408,6 +1418,8 @@ ddxUseMsg(void)
ErrorF("-version show the server version\n");
ErrorF("-showDefaultModulePath show the server default module path\n");
ErrorF("-showDefaultLibPath show the server default library path\n");
+ ErrorF("-novtswitch don't automatically switch VT at reset & exit\n");
+ ErrorF("-sharevts share VTs with another X server\n");
/* OS-specific usage */
xf86UseMsg();
ErrorF("\n");
diff --git a/xorg-server/hw/xfree86/common/xf86Module.h b/xorg-server/hw/xfree86/common/xf86Module.h
index 2a5c805c4..3038c0404 100644
--- a/xorg-server/hw/xfree86/common/xf86Module.h
+++ b/xorg-server/hw/xfree86/common/xf86Module.h
@@ -84,7 +84,7 @@ typedef enum {
#define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4)
#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(11, 0)
#define ABI_XINPUT_VERSION SET_ABI_VERSION(13, 0)
-#define ABI_EXTENSION_VERSION SET_ABI_VERSION(5, 0)
+#define ABI_EXTENSION_VERSION SET_ABI_VERSION(6, 0)
#define ABI_FONT_VERSION SET_ABI_VERSION(0, 6)
#define MODINFOSTRING1 0xef23fdc5
diff --git a/xorg-server/hw/xfree86/common/xf86Privstr.h b/xorg-server/hw/xfree86/common/xf86Privstr.h
index 66a73d32b..14cd56a26 100644
--- a/xorg-server/hw/xfree86/common/xf86Privstr.h
+++ b/xorg-server/hw/xfree86/common/xf86Privstr.h
@@ -1,168 +1,167 @@
-
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-/*
- * This file contains definitions of the private XFree86 data structures/types.
- * None of the data structures here should be used by video drivers.
- */
-
-#ifndef _XF86PRIVSTR_H
-#define _XF86PRIVSTR_H
-
-#include "xf86str.h"
-
-typedef enum {
- LogNone,
- LogFlush,
- LogSync
-} Log;
-
-typedef enum {
- XF86_GlxVisualsMinimal,
- XF86_GlxVisualsTypical,
- XF86_GlxVisualsAll,
-} XF86_GlxVisuals;
-
-/*
- * xf86InfoRec contains global parameters which the video drivers never
- * need to access. Global parameters which the video drivers do need
- * should be individual globals.
- */
-
-typedef struct {
- int consoleFd;
- int vtno;
- Bool vtSysreq;
-
- /* event handler part */
- int lastEventTime;
- Bool vtRequestsPending;
-#ifdef sun
- int vtPendingNum;
-#endif
- Bool dontVTSwitch;
- Bool dontZap;
- Bool dontZoom;
- Bool notrapSignals; /* don't exit cleanly - die at fault */
- Bool caughtSignal;
-
- /* graphics part */
- ScreenPtr currentScreen;
-#if defined(CSRG_BASED) || defined(__FreeBSD_kernel__)
- int screenFd; /* fd for memory mapped access to
- * vga card */
- int consType; /* Which console driver? */
-#endif
-
- /* Other things */
- Bool allowMouseOpenFail;
- Bool vidModeEnabled; /* VidMode extension enabled */
- Bool vidModeAllowNonLocal; /* allow non-local VidMode
- * connections */
- Bool miscModInDevEnabled; /* Allow input devices to be
- * changed */
- Bool miscModInDevAllowNonLocal;
- Bool useSIGIO; /* Use SIGIO for handling
- input device events */
- Pix24Flags pixmap24;
- MessageType pix24From;
-#ifdef SUPPORT_PC98
- Bool pc98;
-#endif
- Bool pmFlag;
- Log log;
- Bool disableRandR;
- MessageType randRFrom;
- Bool aiglx;
- MessageType aiglxFrom;
- XF86_GlxVisuals glxVisuals;
- MessageType glxVisualsFrom;
-
- Bool useDefaultFontPath;
- MessageType useDefaultFontPathFrom;
- Bool ignoreABI;
-
- Bool forceInputDevices; /* force xorg.conf or built-in input devices */
- Bool autoAddDevices; /* Whether to succeed NIDR, or ignore. */
- Bool autoEnableDevices; /* Whether to enable, or let the client
- * control. */
-
- Bool dri2;
- MessageType dri2From;
-} xf86InfoRec, *xf86InfoPtr;
-
-#ifdef DPMSExtension
-/* Private info for DPMS */
-typedef struct {
- CloseScreenProcPtr CloseScreen;
- Bool Enabled;
- int Flags;
-} DPMSRec, *DPMSPtr;
-#endif
-
-#ifdef XF86VIDMODE
-/* Private info for Video Mode Extentsion */
-typedef struct {
- DisplayModePtr First;
- DisplayModePtr Next;
- int Flags;
- CloseScreenProcPtr CloseScreen;
-} VidModeRec, *VidModePtr;
-#endif
-
-/* Information for root window properties. */
-typedef struct _RootWinProp {
- struct _RootWinProp * next;
- char * name;
- Atom type;
- short format;
- long size;
- pointer data;
-} RootWinProp, *RootWinPropPtr;
-
-/* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */
-#define XLED1 ((unsigned long) 0x00000001)
-#define XLED2 ((unsigned long) 0x00000002)
-#define XLED3 ((unsigned long) 0x00000004)
-#define XLED4 ((unsigned long) 0x00000008)
-#define XCAPS ((unsigned long) 0x20000000)
-#define XNUM ((unsigned long) 0x40000000)
-#define XSCR ((unsigned long) 0x80000000)
-#define XCOMP ((unsigned long) 0x00008000)
-
-/* BSD console driver types (consType) */
-#if defined(CSRG_BASED) || defined(__FreeBSD_kernel__)
-#define PCCONS 0
-#define CODRV011 1
-#define CODRV01X 2
-#define SYSCONS 8
-#define PCVT 16
-#define WSCONS 32
-#endif
-
-#endif /* _XF86PRIVSTR_H */
+
+/*
+ * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+/*
+ * This file contains definitions of the private XFree86 data structures/types.
+ * None of the data structures here should be used by video drivers.
+ */
+
+#ifndef _XF86PRIVSTR_H
+#define _XF86PRIVSTR_H
+
+#include "xf86str.h"
+
+typedef enum {
+ LogNone,
+ LogFlush,
+ LogSync
+} Log;
+
+typedef enum {
+ XF86_GlxVisualsMinimal,
+ XF86_GlxVisualsTypical,
+ XF86_GlxVisualsAll,
+} XF86_GlxVisuals;
+
+/*
+ * xf86InfoRec contains global parameters which the video drivers never
+ * need to access. Global parameters which the video drivers do need
+ * should be individual globals.
+ */
+
+typedef struct {
+ int consoleFd;
+ int vtno;
+ Bool vtSysreq;
+
+ /* event handler part */
+ int lastEventTime;
+ Bool vtRequestsPending;
+#ifdef sun
+ int vtPendingNum;
+#endif
+ Bool dontVTSwitch;
+ Bool autoVTSwitch;
+ Bool ShareVTs;
+ Bool dontZap;
+ Bool dontZoom;
+ Bool notrapSignals; /* don't exit cleanly - die at fault */
+ Bool caughtSignal;
+
+ /* graphics part */
+ ScreenPtr currentScreen;
+#if defined(CSRG_BASED) || defined(__FreeBSD_kernel__)
+ int screenFd; /* fd for memory mapped access to
+ * vga card */
+ int consType; /* Which console driver? */
+#endif
+
+ /* Other things */
+ Bool allowMouseOpenFail;
+ Bool vidModeEnabled; /* VidMode extension enabled */
+ Bool vidModeAllowNonLocal; /* allow non-local VidMode
+ * connections */
+ Bool miscModInDevEnabled; /* Allow input devices to be
+ * changed */
+ Bool miscModInDevAllowNonLocal;
+ Bool useSIGIO; /* Use SIGIO for handling
+ input device events */
+ Pix24Flags pixmap24;
+ MessageType pix24From;
+ Bool pmFlag;
+ Log log;
+ Bool disableRandR;
+ MessageType randRFrom;
+ Bool aiglx;
+ MessageType aiglxFrom;
+ XF86_GlxVisuals glxVisuals;
+ MessageType glxVisualsFrom;
+
+ Bool useDefaultFontPath;
+ MessageType useDefaultFontPathFrom;
+ Bool ignoreABI;
+
+ Bool forceInputDevices; /* force xorg.conf or built-in input devices */
+ Bool autoAddDevices; /* Whether to succeed NIDR, or ignore. */
+ Bool autoEnableDevices; /* Whether to enable, or let the client
+ * control. */
+
+ Bool dri2;
+ MessageType dri2From;
+} xf86InfoRec, *xf86InfoPtr;
+
+#ifdef DPMSExtension
+/* Private info for DPMS */
+typedef struct {
+ CloseScreenProcPtr CloseScreen;
+ Bool Enabled;
+ int Flags;
+} DPMSRec, *DPMSPtr;
+#endif
+
+#ifdef XF86VIDMODE
+/* Private info for Video Mode Extentsion */
+typedef struct {
+ DisplayModePtr First;
+ DisplayModePtr Next;
+ int Flags;
+ CloseScreenProcPtr CloseScreen;
+} VidModeRec, *VidModePtr;
+#endif
+
+/* Information for root window properties. */
+typedef struct _RootWinProp {
+ struct _RootWinProp * next;
+ char * name;
+ Atom type;
+ short format;
+ long size;
+ pointer data;
+} RootWinProp, *RootWinPropPtr;
+
+/* ISC's cc can't handle ~ of UL constants, so explicitly type cast them. */
+#define XLED1 ((unsigned long) 0x00000001)
+#define XLED2 ((unsigned long) 0x00000002)
+#define XLED3 ((unsigned long) 0x00000004)
+#define XLED4 ((unsigned long) 0x00000008)
+#define XCAPS ((unsigned long) 0x20000000)
+#define XNUM ((unsigned long) 0x40000000)
+#define XSCR ((unsigned long) 0x80000000)
+#define XCOMP ((unsigned long) 0x00008000)
+
+/* BSD console driver types (consType) */
+#if defined(CSRG_BASED) || defined(__FreeBSD_kernel__)
+#define PCCONS 0
+#define CODRV011 1
+#define CODRV01X 2
+#define SYSCONS 8
+#define PCVT 16
+#define WSCONS 32
+#endif
+
+#endif /* _XF86PRIVSTR_H */
diff --git a/xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c b/xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c
index 25980b02b..6d3d5fcbc 100644
--- a/xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c
+++ b/xorg-server/hw/xfree86/dixmods/extmod/xf86vmode.c
@@ -1,2126 +1,2098 @@
-
-/*
-
-Copyright 1995 Kaleb S. KEITHLEY
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES
-OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of Kaleb S. KEITHLEY
-shall not be used in advertising or otherwise to promote the sale, use
-or other dealings in this Software without prior written authorization
-from Kaleb S. KEITHLEY
-
-*/
-/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-#include <X11/extensions/xf86vmproto.h>
-#include "swaprep.h"
-#include "xf86.h"
-#include "vidmodeproc.h"
-#include "globals.h"
-#include "protocol-versions.h"
-
-#define DEFAULT_XF86VIDMODE_VERBOSITY 3
-
-static int VidModeErrorBase;
-static DevPrivateKeyRec VidModeClientPrivateKeyRec;
-#define VidModeClientPrivateKey (&VidModeClientPrivateKeyRec)
-
-/* This holds the client's version information */
-typedef struct {
- int major;
- int minor;
-} VidModePrivRec, *VidModePrivPtr;
-
-#define VM_GETPRIV(c) ((VidModePrivPtr) \
- dixLookupPrivate(&(c)->devPrivates, VidModeClientPrivateKey))
-#define VM_SETPRIV(c,p) \
- dixSetPrivate(&(c)->devPrivates, VidModeClientPrivateKey, p)
-
-
-#if 0
-static unsigned char XF86VidModeReqCode = 0;
-#endif
-
-/* The XF86VIDMODE_EVENTS code is far from complete */
-
-#ifdef XF86VIDMODE_EVENTS
-static int XF86VidModeEventBase = 0;
-
-static void SXF86VidModeNotifyEvent();
- xXF86VidModeNotifyEvent * /* from */,
- xXF86VidModeNotifyEvent * /* to */
-);
-
-static RESTYPE EventType; /* resource type for event masks */
-
-typedef struct _XF86VidModeEvent *XF86VidModeEventPtr;
-
-typedef struct _XF86VidModeEvent {
- XF86VidModeEventPtr next;
- ClientPtr client;
- ScreenPtr screen;
- XID resource;
- CARD32 mask;
-} XF86VidModeEventRec;
-
-static int XF86VidModeFreeEvents();
-
-typedef struct _XF86VidModeScreenPrivate {
- XF86VidModeEventPtr events;
- Bool hasWindow;
-} XF86VidModeScreenPrivateRec, *XF86VidModeScreenPrivatePtr;
-
-static DevPrivateKeyRec ScreenPrivateKeyRec;
-#define ScreenPrivateKey (&ScreenPrivateKeyRec)
-
-#define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr) \
- dixLookupPrivate(&(s)->devPrivates, ScreenPrivateKey))
-#define SetScreenPrivate(s,v) \
- dixSetPrivate(&(s)->devPrivates, ScreenPrivateKey, v)
-#define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = GetScreenPrivate(s)
-
-#define New(t) (malloc(sizeof (t)))
-#endif
-
-#ifdef DEBUG
-# define DEBUG_P(x) ErrorF(x"\n");
-#else
-# define DEBUG_P(x) /**/
-#endif
-
-static int
-ClientMajorVersion(ClientPtr client)
-{
- VidModePrivPtr pPriv;
-
- pPriv = VM_GETPRIV(client);
- if (!pPriv)
- return 0;
- else
- return pPriv->major;
-}
-
-#ifdef XF86VIDMODE_EVENTS
-static void
-CheckScreenPrivate (pScreen)
- ScreenPtr pScreen;
-{
- SetupScreen (pScreen);
-
- if (!pPriv)
- return;
- if (!pPriv->events && !pPriv->hasWindow) {
- free(pPriv);
- SetScreenPrivate (pScreen, NULL);
- }
-}
-
-static XF86VidModeScreenPrivatePtr
-MakeScreenPrivate (pScreen)
- ScreenPtr pScreen;
-{
- SetupScreen (pScreen);
-
- if (pPriv)
- return pPriv;
- pPriv = New (XF86VidModeScreenPrivateRec);
- if (!pPriv)
- return 0;
- pPriv->events = 0;
- pPriv->hasWindow = FALSE;
- SetScreenPrivate (pScreen, pPriv);
- return pPriv;
-}
-
-static unsigned long
-getEventMask (ScreenPtr pScreen, ClientPtr client)
-{
- SetupScreen(pScreen);
- XF86VidModeEventPtr pEv;
-
- if (!pPriv)
- return 0;
- for (pEv = pPriv->events; pEv; pEv = pEv->next)
- if (pEv->client == client)
- return pEv->mask;
- return 0;
-}
-
-static Bool
-setEventMask (ScreenPtr pScreen, ClientPtr client, unsigned long mask)
-{
- SetupScreen(pScreen);
- XF86VidModeEventPtr pEv, *pPrev;
-
- if (getEventMask (pScreen, client) == mask)
- return TRUE;
- if (!pPriv) {
- pPriv = MakeScreenPrivate (pScreen);
- if (!pPriv)
- return FALSE;
- }
- for (pPrev = &pPriv->events; pEv = *pPrev; pPrev = &pEv->next)
- if (pEv->client == client)
- break;
- if (mask == 0) {
- *pPrev = pEv->next;
- free(pEv);
- CheckScreenPrivate (pScreen);
- } else {
- if (!pEv) {
- pEv = New (ScreenSaverEventRec);
- if (!pEv) {
- CheckScreenPrivate (pScreen);
- return FALSE;
- }
- *pPrev = pEv;
- pEv->next = NULL;
- pEv->client = client;
- pEv->screen = pScreen;
- pEv->resource = FakeClientID (client->index);
- }
- pEv->mask = mask;
- }
- return TRUE;
-}
-
-static int
-XF86VidModeFreeEvents(pointer value, XID id)
-{
- XF86VidModeEventPtr pOld = (XF86VidModeEventPtr)value;
- ScreenPtr pScreen = pOld->screen;
- SetupScreen (pScreen);
- XF86VidModeEventPtr pEv, *pPrev;
-
- if (!pPriv)
- return TRUE;
- for (pPrev = &pPriv->events; pEv = *pPrev; pPrev = &pEv->next)
- if (pEv == pOld)
- break;
- if (!pEv)
- return TRUE;
- *pPrev = pEv->next;
- free(pEv);
- CheckScreenPrivate (pScreen);
- return TRUE;
-}
-
-static void
-SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced)
-{
- XF86VidModeScreenPrivatePtr pPriv;
- XF86VidModeEventPtr pEv;
- unsigned long mask;
- xXF86VidModeNotifyEvent ev;
- int kind;
-
- UpdateCurrentTimeIf ();
- mask = XF86VidModeNotifyMask;
- pScreen = screenInfo.screens[pScreen->myNum];
- pPriv = GetScreenPrivate(pScreen);
- if (!pPriv)
- return;
- kind = XF86VidModeModeChange;
- for (pEv = pPriv->events; pEv; pEv = pEv->next)
- {
- if (!(pEv->mask & mask))
- continue;
- ev.type = XF86VidModeNotify + XF86VidModeEventBase;
- ev.state = state;
- ev.timestamp = currentTime.milliseconds;
- ev.root = pScreen->root->drawable.id;
- ev.kind = kind;
- ev.forced = forced;
- WriteEventsToClient (pEv->client, 1, (xEvent *) &ev);
- }
-}
-
-static void
-SXF86VidModeNotifyEvent(xXF86VidModeNotifyEvent *from,
- xXF86VidModeNotifyEvent *to)
-{
- to->type = from->type;
- to->state = from->state;
- cpswaps (from->sequenceNumber, to->sequenceNumber);
- cpswapl (from->timestamp, to->timestamp);
- cpswapl (from->root, to->root);
- to->kind = from->kind;
- to->forced = from->forced;
-}
-#endif
-
-static int
-ProcXF86VidModeQueryVersion(ClientPtr client)
-{
- xXF86VidModeQueryVersionReply rep;
- register int n;
-
- DEBUG_P("XF86VidModeQueryVersion");
-
- REQUEST_SIZE_MATCH(xXF86VidModeQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = SERVER_XF86VIDMODE_MAJOR_VERSION;
- rep.minorVersion = SERVER_XF86VIDMODE_MINOR_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof(xXF86VidModeQueryVersionReply), (char *)&rep);
- return Success;
-}
-
-static int
-ProcXF86VidModeGetModeLine(ClientPtr client)
-{
- REQUEST(xXF86VidModeGetModeLineReq);
- xXF86VidModeGetModeLineReply rep;
- xXF86OldVidModeGetModeLineReply oldrep;
- pointer mode;
- register int n;
- int dotClock;
- int ver;
-
- DEBUG_P("XF86VidModeGetModeline");
-
- ver = ClientMajorVersion(client);
- REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq);
- rep.type = X_Reply;
- if (ver < 2) {
- rep.length = bytes_to_int32(SIZEOF(xXF86OldVidModeGetModeLineReply) -
- SIZEOF(xGenericReply));
- } else {
- rep.length = bytes_to_int32(SIZEOF(xXF86VidModeGetModeLineReply) -
- SIZEOF(xGenericReply));
- }
- rep.sequenceNumber = client->sequence;
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
- return BadValue;
-
- rep.dotclock = dotClock;
- rep.hdisplay = VidModeGetModeValue(mode, VIDMODE_H_DISPLAY);
- rep.hsyncstart = VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART);
- rep.hsyncend = VidModeGetModeValue(mode, VIDMODE_H_SYNCEND);
- rep.htotal = VidModeGetModeValue(mode, VIDMODE_H_TOTAL);
- rep.hskew = VidModeGetModeValue(mode, VIDMODE_H_SKEW);
- rep.vdisplay = VidModeGetModeValue(mode, VIDMODE_V_DISPLAY);
- rep.vsyncstart = VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART);
- rep.vsyncend = VidModeGetModeValue(mode, VIDMODE_V_SYNCEND);
- rep.vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL);
- rep.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS);
-
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("GetModeLine - scrn: %d clock: %ld\n",
- stuff->screen, (unsigned long)rep.dotclock);
- ErrorF("GetModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
- rep.hdisplay, rep.hsyncstart,
- rep.hsyncend, rep.htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- rep.vdisplay, rep.vsyncstart, rep.vsyncend,
- rep.vtotal, (unsigned long)rep.flags);
- }
-
- /*
- * Older servers sometimes had server privates that the VidMode
- * extention made available. So to be compatiable pretend that
- * there are no server privates to pass to the client
- */
- rep.privsize = 0;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.dotclock, n);
- swaps(&rep.hdisplay, n);
- swaps(&rep.hsyncstart, n);
- swaps(&rep.hsyncend, n);
- swaps(&rep.htotal, n);
- swaps(&rep.hskew, n);
- swaps(&rep.vdisplay, n);
- swaps(&rep.vsyncstart, n);
- swaps(&rep.vsyncend, n);
- swaps(&rep.vtotal, n);
- swapl(&rep.flags, n);
- swapl(&rep.privsize, n);
- }
- if (ver < 2) {
- oldrep.type = rep.type;
- oldrep.sequenceNumber = rep.sequenceNumber;
- oldrep.length = rep.length;
- oldrep.dotclock = rep.dotclock;
- oldrep.hdisplay = rep.hdisplay;
- oldrep.hsyncstart = rep.hsyncstart;
- oldrep.hsyncend = rep.hsyncend;
- oldrep.htotal = rep.htotal;
- oldrep.vdisplay = rep.vdisplay;
- oldrep.vsyncstart = rep.vsyncstart;
- oldrep.vsyncend = rep.vsyncend;
- oldrep.vtotal = rep.vtotal;
- oldrep.flags = rep.flags;
- oldrep.privsize = rep.privsize;
- WriteToClient(client, sizeof(xXF86OldVidModeGetModeLineReply),
- (char *)&oldrep);
- } else {
- WriteToClient(client, sizeof(xXF86VidModeGetModeLineReply),
- (char *)&rep);
- }
- return Success;
-}
-
-static int
-ProcXF86VidModeGetAllModeLines(ClientPtr client)
-{
- REQUEST(xXF86VidModeGetAllModeLinesReq);
- xXF86VidModeGetAllModeLinesReply rep;
- xXF86VidModeModeInfo mdinf;
- xXF86OldVidModeModeInfo oldmdinf;
- pointer mode;
- int modecount, dotClock;
- register int n;
- int ver;
-
- DEBUG_P("XF86VidModeGetAllModelines");
-
- REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- ver = ClientMajorVersion(client);
-
- modecount = VidModeGetNumOfModes(stuff->screen);
- if (modecount < 1)
- return VidModeErrorBase + XF86VidModeExtensionDisabled;
-
- if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock))
- return BadValue;
-
- rep.type = X_Reply;
- rep.length = SIZEOF(xXF86VidModeGetAllModeLinesReply) -
- SIZEOF(xGenericReply);
- if (ver < 2)
- rep.length += modecount * sizeof(xXF86OldVidModeModeInfo);
- else
- rep.length += modecount * sizeof(xXF86VidModeModeInfo);
- rep.length >>= 2;
- rep.sequenceNumber = client->sequence;
- rep.modecount = modecount;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.modecount, n);
- }
- WriteToClient(client, sizeof(xXF86VidModeGetAllModeLinesReply), (char *)&rep);
-
- do {
- mdinf.dotclock = dotClock;
- mdinf.hdisplay = VidModeGetModeValue(mode, VIDMODE_H_DISPLAY);
- mdinf.hsyncstart = VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART);
- mdinf.hsyncend = VidModeGetModeValue(mode, VIDMODE_H_SYNCEND);
- mdinf.htotal = VidModeGetModeValue(mode, VIDMODE_H_TOTAL);
- mdinf.hskew = VidModeGetModeValue(mode, VIDMODE_H_SKEW);
- mdinf.vdisplay = VidModeGetModeValue(mode, VIDMODE_V_DISPLAY);
- mdinf.vsyncstart = VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART);
- mdinf.vsyncend = VidModeGetModeValue(mode, VIDMODE_V_SYNCEND);
- mdinf.vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL);
- mdinf.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS);
- mdinf.privsize = 0;
- if (client->swapped) {
- swapl(&mdinf.dotclock, n);
- swaps(&mdinf.hdisplay, n);
- swaps(&mdinf.hsyncstart, n);
- swaps(&mdinf.hsyncend, n);
- swaps(&mdinf.htotal, n);
- swaps(&mdinf.hskew, n);
- swaps(&mdinf.vdisplay, n);
- swaps(&mdinf.vsyncstart, n);
- swaps(&mdinf.vsyncend, n);
- swaps(&mdinf.vtotal, n);
- swapl(&mdinf.flags, n);
- swapl(&mdinf.privsize, n);
- }
- if (ver < 2) {
- oldmdinf.dotclock = mdinf.dotclock;
- oldmdinf.hdisplay = mdinf.hdisplay;
- oldmdinf.hsyncstart = mdinf.hsyncstart;
- oldmdinf.hsyncend = mdinf.hsyncend;
- oldmdinf.htotal = mdinf.htotal;
- oldmdinf.vdisplay = mdinf.vdisplay;
- oldmdinf.vsyncstart = mdinf.vsyncstart;
- oldmdinf.vsyncend = mdinf.vsyncend;
- oldmdinf.vtotal = mdinf.vtotal;
- oldmdinf.flags = mdinf.flags;
- oldmdinf.privsize = mdinf.privsize;
- WriteToClient(client, sizeof(xXF86OldVidModeModeInfo),
- (char *)&oldmdinf);
- } else {
- WriteToClient(client, sizeof(xXF86VidModeModeInfo), (char *)&mdinf);
- }
-
- } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
-
- return Success;
-}
-
-#define MODEMATCH(mode,stuff) \
- (VidModeGetModeValue(mode, VIDMODE_H_DISPLAY) == stuff->hdisplay \
- && VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART) == stuff->hsyncstart \
- && VidModeGetModeValue(mode, VIDMODE_H_SYNCEND) == stuff->hsyncend \
- && VidModeGetModeValue(mode, VIDMODE_H_TOTAL) == stuff->htotal \
- && VidModeGetModeValue(mode, VIDMODE_V_DISPLAY) == stuff->vdisplay \
- && VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART) == stuff->vsyncstart \
- && VidModeGetModeValue(mode, VIDMODE_V_SYNCEND) == stuff->vsyncend \
- && VidModeGetModeValue(mode, VIDMODE_V_TOTAL) == stuff->vtotal \
- && VidModeGetModeValue(mode, VIDMODE_FLAGS) == stuff->flags )
-
-static int
-ProcXF86VidModeAddModeLine(ClientPtr client)
-{
- REQUEST(xXF86VidModeAddModeLineReq);
- xXF86OldVidModeAddModeLineReq *oldstuff =
- (xXF86OldVidModeAddModeLineReq *)client->requestBuffer;
- xXF86VidModeAddModeLineReq newstuff;
- pointer mode;
- int len;
- int dotClock;
- int ver;
-
- DEBUG_P("XF86VidModeAddModeline");
-
- ver = ClientMajorVersion(client);
- if (ver < 2) {
- /* convert from old format */
- stuff = &newstuff;
- stuff->length = oldstuff->length;
- stuff->screen = oldstuff->screen;
- stuff->dotclock = oldstuff->dotclock;
- stuff->hdisplay = oldstuff->hdisplay;
- stuff->hsyncstart = oldstuff->hsyncstart;
- stuff->hsyncend = oldstuff->hsyncend;
- stuff->htotal = oldstuff->htotal;
- stuff->hskew = 0;
- stuff->vdisplay = oldstuff->vdisplay;
- stuff->vsyncstart = oldstuff->vsyncstart;
- stuff->vsyncend = oldstuff->vsyncend;
- stuff->vtotal = oldstuff->vtotal;
- stuff->flags = oldstuff->flags;
- stuff->privsize = oldstuff->privsize;
- stuff->after_dotclock = oldstuff->after_dotclock;
- stuff->after_hdisplay = oldstuff->after_hdisplay;
- stuff->after_hsyncstart = oldstuff->after_hsyncstart;
- stuff->after_hsyncend = oldstuff->after_hsyncend;
- stuff->after_htotal = oldstuff->after_htotal;
- stuff->after_hskew = 0;
- stuff->after_vdisplay = oldstuff->after_vdisplay;
- stuff->after_vsyncstart = oldstuff->after_vsyncstart;
- stuff->after_vsyncend = oldstuff->after_vsyncend;
- stuff->after_vtotal = oldstuff->after_vtotal;
- stuff->after_flags = oldstuff->after_flags;
- }
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("AddModeLine - scrn: %d clock: %ld\n",
- (int)stuff->screen, (unsigned long)stuff->dotclock);
- ErrorF("AddModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, (unsigned long)stuff->flags);
- ErrorF(" after - scrn: %d clock: %ld\n",
- (int)stuff->screen, (unsigned long)stuff->after_dotclock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->after_hdisplay, stuff->after_hsyncstart,
- stuff->after_hsyncend, stuff->after_htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->after_vdisplay, stuff->after_vsyncstart,
- stuff->after_vsyncend, stuff->after_vtotal,
- (unsigned long)stuff->after_flags);
- }
-
- if (ver < 2) {
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq);
- len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeAddModeLineReq));
- } else {
- REQUEST_AT_LEAST_SIZE(xXF86VidModeAddModeLineReq);
- len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeAddModeLineReq));
- }
- if (len != stuff->privsize)
- return BadLength;
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (stuff->hsyncstart < stuff->hdisplay ||
- stuff->hsyncend < stuff->hsyncstart ||
- stuff->htotal < stuff->hsyncend ||
- stuff->vsyncstart < stuff->vdisplay ||
- stuff->vsyncend < stuff->vsyncstart ||
- stuff->vtotal < stuff->vsyncend)
- return BadValue;
-
- if (stuff->after_hsyncstart < stuff->after_hdisplay ||
- stuff->after_hsyncend < stuff->after_hsyncstart ||
- stuff->after_htotal < stuff->after_hsyncend ||
- stuff->after_vsyncstart < stuff->after_vdisplay ||
- stuff->after_vsyncend < stuff->after_vsyncstart ||
- stuff->after_vtotal < stuff->after_vsyncend)
- return BadValue;
-
- if (stuff->after_htotal != 0 || stuff->after_vtotal != 0) {
- Bool found = FALSE;
- if (VidModeGetFirstModeline(stuff->screen, &mode, &dotClock)) {
- do {
- if ((VidModeGetDotClock(stuff->screen, stuff->dotclock)
- == dotClock) && MODEMATCH(mode, stuff)) {
- found = TRUE;
- break;
- }
- } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
- }
- if (!found)
- return BadValue;
- }
-
-
- mode = VidModeCreateMode();
- if (mode == NULL)
- return BadValue;
-
- VidModeSetModeValue(mode, VIDMODE_CLOCK, stuff->dotclock);
- VidModeSetModeValue(mode, VIDMODE_H_DISPLAY, stuff->hdisplay);
- VidModeSetModeValue(mode, VIDMODE_H_SYNCSTART, stuff->hsyncstart);
- VidModeSetModeValue(mode, VIDMODE_H_SYNCEND, stuff->hsyncend);
- VidModeSetModeValue(mode, VIDMODE_H_TOTAL, stuff->htotal);
- VidModeSetModeValue(mode, VIDMODE_H_SKEW, stuff->hskew);
- VidModeSetModeValue(mode, VIDMODE_V_DISPLAY, stuff->vdisplay);
- VidModeSetModeValue(mode, VIDMODE_V_SYNCSTART, stuff->vsyncstart);
- VidModeSetModeValue(mode, VIDMODE_V_SYNCEND, stuff->vsyncend);
- VidModeSetModeValue(mode, VIDMODE_V_TOTAL, stuff->vtotal);
- VidModeSetModeValue(mode, VIDMODE_FLAGS, stuff->flags);
-
- if (stuff->privsize)
- ErrorF("AddModeLine - Privates in request have been ignored\n");
-
- /* Check that the mode is consistent with the monitor specs */
- switch (VidModeCheckModeForMonitor(stuff->screen, mode)) {
- case MODE_OK:
- break;
- case MODE_HSYNC:
- case MODE_H_ILLEGAL:
- free(mode);
- return VidModeErrorBase + XF86VidModeBadHTimings;
- case MODE_VSYNC:
- case MODE_V_ILLEGAL:
- free(mode);
- return VidModeErrorBase + XF86VidModeBadVTimings;
- default:
- free(mode);
- return VidModeErrorBase + XF86VidModeModeUnsuitable;
- }
-
- /* Check that the driver is happy with the mode */
- if (VidModeCheckModeForDriver(stuff->screen, mode) != MODE_OK) {
- free(mode);
- return VidModeErrorBase + XF86VidModeModeUnsuitable;
- }
-
- VidModeSetCrtcForMode(stuff->screen, mode);
-
- VidModeAddModeline(stuff->screen, mode);
-
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
- ErrorF("AddModeLine - Succeeded\n");
- return Success;
-}
-
-static int
-ProcXF86VidModeDeleteModeLine(ClientPtr client)
-{
- REQUEST(xXF86VidModeDeleteModeLineReq);
- xXF86OldVidModeDeleteModeLineReq *oldstuff =
- (xXF86OldVidModeDeleteModeLineReq *)client->requestBuffer;
- xXF86VidModeDeleteModeLineReq newstuff;
- pointer mode;
- int len, dotClock;
- int ver;
-
- DEBUG_P("XF86VidModeDeleteModeline");
-
- ver = ClientMajorVersion(client);
- if (ver < 2) {
- /* convert from old format */
- stuff = &newstuff;
- stuff->length = oldstuff->length;
- stuff->screen = oldstuff->screen;
- stuff->dotclock = oldstuff->dotclock;
- stuff->hdisplay = oldstuff->hdisplay;
- stuff->hsyncstart = oldstuff->hsyncstart;
- stuff->hsyncend = oldstuff->hsyncend;
- stuff->htotal = oldstuff->htotal;
- stuff->hskew = 0;
- stuff->vdisplay = oldstuff->vdisplay;
- stuff->vsyncstart = oldstuff->vsyncstart;
- stuff->vsyncend = oldstuff->vsyncend;
- stuff->vtotal = oldstuff->vtotal;
- stuff->flags = oldstuff->flags;
- stuff->privsize = oldstuff->privsize;
- }
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("DeleteModeLine - scrn: %d clock: %ld\n",
- (int)stuff->screen, (unsigned long)stuff->dotclock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, (unsigned long)stuff->flags);
- }
-
- if (ver < 2) {
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeDeleteModeLineReq);
- len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeDeleteModeLineReq));
- } else {
- REQUEST_AT_LEAST_SIZE(xXF86VidModeDeleteModeLineReq);
- len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeDeleteModeLineReq));
- }
- if (len != stuff->privsize) {
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("req_len = %ld, sizeof(Req) = %d, privsize = %ld, "
- "len = %d, length = %d\n",
- (unsigned long)client->req_len,
- (int)sizeof(xXF86VidModeDeleteModeLineReq)>>2,
- (unsigned long)stuff->privsize, len, stuff->length);
- }
- return BadLength;
- }
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
- return BadValue;
-
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("Checking against clock: %d (%d)\n",
- VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
- VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
- VidModeGetModeValue(mode, VIDMODE_FLAGS));
- }
- if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) &&
- MODEMATCH(mode, stuff))
- return BadValue;
-
- if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock))
- return BadValue;
-
- do {
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("Checking against clock: %d (%d)\n",
- VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
- VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
- VidModeGetModeValue(mode, VIDMODE_FLAGS));
- }
- if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) &&
- MODEMATCH(mode, stuff)) {
- VidModeDeleteModeline(stuff->screen, mode);
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
- ErrorF("DeleteModeLine - Succeeded\n");
- return Success;
- }
- } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
-
- return BadValue;
-}
-
-static int
-ProcXF86VidModeModModeLine(ClientPtr client)
-{
- REQUEST(xXF86VidModeModModeLineReq);
- xXF86OldVidModeModModeLineReq *oldstuff =
- (xXF86OldVidModeModModeLineReq *)client->requestBuffer;
- xXF86VidModeModModeLineReq newstuff;
- pointer mode, modetmp;
- int len, dotClock;
- int ver;
-
- DEBUG_P("XF86VidModeModModeline");
-
- ver = ClientMajorVersion(client);
- if (ver < 2 ) {
- /* convert from old format */
- stuff = &newstuff;
- stuff->length = oldstuff->length;
- stuff->screen = oldstuff->screen;
- stuff->hdisplay = oldstuff->hdisplay;
- stuff->hsyncstart = oldstuff->hsyncstart;
- stuff->hsyncend = oldstuff->hsyncend;
- stuff->htotal = oldstuff->htotal;
- stuff->hskew = 0;
- stuff->vdisplay = oldstuff->vdisplay;
- stuff->vsyncstart = oldstuff->vsyncstart;
- stuff->vsyncend = oldstuff->vsyncend;
- stuff->vtotal = oldstuff->vtotal;
- stuff->flags = oldstuff->flags;
- stuff->privsize = oldstuff->privsize;
- }
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("ModModeLine - scrn: %d hdsp: %d hbeg: %d hend: %d httl: %d\n",
- (int)stuff->screen, stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, (unsigned long)stuff->flags);
- }
-
- if (ver < 2) {
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq);
- len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeModModeLineReq));
- } else {
- REQUEST_AT_LEAST_SIZE(xXF86VidModeModModeLineReq);
- len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeModModeLineReq));
- }
- if (len != stuff->privsize)
- return BadLength;
-
- if (stuff->hsyncstart < stuff->hdisplay ||
- stuff->hsyncend < stuff->hsyncstart ||
- stuff->htotal < stuff->hsyncend ||
- stuff->vsyncstart < stuff->vdisplay ||
- stuff->vsyncend < stuff->vsyncstart ||
- stuff->vtotal < stuff->vsyncend)
- return BadValue;
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
- return BadValue;
-
- modetmp = VidModeCreateMode();
- VidModeCopyMode(mode, modetmp);
-
- VidModeSetModeValue(modetmp, VIDMODE_H_DISPLAY, stuff->hdisplay);
- VidModeSetModeValue(modetmp, VIDMODE_H_SYNCSTART, stuff->hsyncstart);
- VidModeSetModeValue(modetmp, VIDMODE_H_SYNCEND, stuff->hsyncend);
- VidModeSetModeValue(modetmp, VIDMODE_H_TOTAL, stuff->htotal);
- VidModeSetModeValue(modetmp, VIDMODE_H_SKEW, stuff->hskew);
- VidModeSetModeValue(modetmp, VIDMODE_V_DISPLAY, stuff->vdisplay);
- VidModeSetModeValue(modetmp, VIDMODE_V_SYNCSTART, stuff->vsyncstart);
- VidModeSetModeValue(modetmp, VIDMODE_V_SYNCEND, stuff->vsyncend);
- VidModeSetModeValue(modetmp, VIDMODE_V_TOTAL, stuff->vtotal);
- VidModeSetModeValue(modetmp, VIDMODE_FLAGS, stuff->flags);
-
- if (stuff->privsize)
- ErrorF("ModModeLine - Privates in request have been ignored\n");
-
- /* Check that the mode is consistent with the monitor specs */
- switch (VidModeCheckModeForMonitor(stuff->screen, modetmp)) {
- case MODE_OK:
- break;
- case MODE_HSYNC:
- case MODE_H_ILLEGAL:
- free(modetmp);
- return VidModeErrorBase + XF86VidModeBadHTimings;
- case MODE_VSYNC:
- case MODE_V_ILLEGAL:
- free(modetmp);
- return VidModeErrorBase + XF86VidModeBadVTimings;
- default:
- free(modetmp);
- return VidModeErrorBase + XF86VidModeModeUnsuitable;
- }
-
- /* Check that the driver is happy with the mode */
- if (VidModeCheckModeForDriver(stuff->screen, modetmp) != MODE_OK) {
- free(modetmp);
- return VidModeErrorBase + XF86VidModeModeUnsuitable;
- }
- free(modetmp);
-
- VidModeSetModeValue(mode, VIDMODE_H_DISPLAY, stuff->hdisplay);
- VidModeSetModeValue(mode, VIDMODE_H_SYNCSTART, stuff->hsyncstart);
- VidModeSetModeValue(mode, VIDMODE_H_SYNCEND, stuff->hsyncend);
- VidModeSetModeValue(mode, VIDMODE_H_TOTAL, stuff->htotal);
- VidModeSetModeValue(mode, VIDMODE_H_SKEW, stuff->hskew);
- VidModeSetModeValue(mode, VIDMODE_V_DISPLAY, stuff->vdisplay);
- VidModeSetModeValue(mode, VIDMODE_V_SYNCSTART, stuff->vsyncstart);
- VidModeSetModeValue(mode, VIDMODE_V_SYNCEND, stuff->vsyncend);
- VidModeSetModeValue(mode, VIDMODE_V_TOTAL, stuff->vtotal);
- VidModeSetModeValue(mode, VIDMODE_FLAGS, stuff->flags);
-
- VidModeSetCrtcForMode(stuff->screen, mode);
- VidModeSwitchMode(stuff->screen, mode);
-
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
- ErrorF("ModModeLine - Succeeded\n");
- return Success;
-}
-
-static int
-ProcXF86VidModeValidateModeLine(ClientPtr client)
-{
- REQUEST(xXF86VidModeValidateModeLineReq);
- xXF86OldVidModeValidateModeLineReq *oldstuff =
- (xXF86OldVidModeValidateModeLineReq *)client->requestBuffer;
- xXF86VidModeValidateModeLineReq newstuff;
- xXF86VidModeValidateModeLineReply rep;
- pointer mode, modetmp = NULL;
- int len, status, dotClock;
- int ver;
-
- DEBUG_P("XF86VidModeValidateModeline");
-
- ver = ClientMajorVersion(client);
- if (ver < 2) {
- /* convert from old format */
- stuff = &newstuff;
- stuff->length = oldstuff->length;
- stuff->screen = oldstuff->screen;
- stuff->dotclock = oldstuff->dotclock;
- stuff->hdisplay = oldstuff->hdisplay;
- stuff->hsyncstart = oldstuff->hsyncstart;
- stuff->hsyncend = oldstuff->hsyncend;
- stuff->htotal = oldstuff->htotal;
- stuff->hskew = 0;
- stuff->vdisplay = oldstuff->vdisplay;
- stuff->vsyncstart = oldstuff->vsyncstart;
- stuff->vsyncend = oldstuff->vsyncend;
- stuff->vtotal = oldstuff->vtotal;
- stuff->flags = oldstuff->flags;
- stuff->privsize = oldstuff->privsize;
- }
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("ValidateModeLine - scrn: %d clock: %ld\n",
- (int)stuff->screen, (unsigned long)stuff->dotclock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, (unsigned long)stuff->flags);
- }
-
- if (ver < 2) {
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeValidateModeLineReq);
- len = client->req_len -
- bytes_to_int32(sizeof(xXF86OldVidModeValidateModeLineReq));
- } else {
- REQUEST_AT_LEAST_SIZE(xXF86VidModeValidateModeLineReq);
- len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeValidateModeLineReq));
- }
- if (len != stuff->privsize)
- return BadLength;
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- status = MODE_OK;
-
- if (stuff->hsyncstart < stuff->hdisplay ||
- stuff->hsyncend < stuff->hsyncstart ||
- stuff->htotal < stuff->hsyncend ||
- stuff->vsyncstart < stuff->vdisplay ||
- stuff->vsyncend < stuff->vsyncstart ||
- stuff->vtotal < stuff->vsyncend)
- {
- status = MODE_BAD;
- goto status_reply;
- }
-
- if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
- return BadValue;
-
- modetmp = VidModeCreateMode();
- VidModeCopyMode(mode, modetmp);
-
- VidModeSetModeValue(modetmp, VIDMODE_H_DISPLAY, stuff->hdisplay);
- VidModeSetModeValue(modetmp, VIDMODE_H_SYNCSTART, stuff->hsyncstart);
- VidModeSetModeValue(modetmp, VIDMODE_H_SYNCEND, stuff->hsyncend);
- VidModeSetModeValue(modetmp, VIDMODE_H_TOTAL, stuff->htotal);
- VidModeSetModeValue(modetmp, VIDMODE_H_SKEW, stuff->hskew);
- VidModeSetModeValue(modetmp, VIDMODE_V_DISPLAY, stuff->vdisplay);
- VidModeSetModeValue(modetmp, VIDMODE_V_SYNCSTART, stuff->vsyncstart);
- VidModeSetModeValue(modetmp, VIDMODE_V_SYNCEND, stuff->vsyncend);
- VidModeSetModeValue(modetmp, VIDMODE_V_TOTAL, stuff->vtotal);
- VidModeSetModeValue(modetmp, VIDMODE_FLAGS, stuff->flags);
- if (stuff->privsize)
- ErrorF("ValidateModeLine - Privates in request have been ignored\n");
-
- /* Check that the mode is consistent with the monitor specs */
- if ((status = VidModeCheckModeForMonitor(stuff->screen, modetmp)) != MODE_OK)
- goto status_reply;
-
- /* Check that the driver is happy with the mode */
- status = VidModeCheckModeForDriver(stuff->screen, modetmp);
-
-status_reply:
- free(modetmp);
-
- rep.type = X_Reply;
- rep.length = bytes_to_int32(SIZEOF(xXF86VidModeValidateModeLineReply)
- - SIZEOF(xGenericReply));
- rep.sequenceNumber = client->sequence;
- rep.status = status;
- if (client->swapped) {
- register int n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.status, n);
- }
- WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply), (char *)&rep);
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
- ErrorF("ValidateModeLine - Succeeded (status = %d)\n", status);
- return Success;
-}
-
-static int
-ProcXF86VidModeSwitchMode(ClientPtr client)
-{
- REQUEST(xXF86VidModeSwitchModeReq);
-
- DEBUG_P("XF86VidModeSwitchMode");
-
- REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- VidModeZoomViewport(stuff->screen, (short)stuff->zoom);
-
- return Success;
-}
-
-static int
-ProcXF86VidModeSwitchToMode(ClientPtr client)
-{
- REQUEST(xXF86VidModeSwitchToModeReq);
- xXF86OldVidModeSwitchToModeReq *oldstuff =
- (xXF86OldVidModeSwitchToModeReq *)client->requestBuffer;
- xXF86VidModeSwitchToModeReq newstuff;
- pointer mode;
- int len, dotClock;
- int ver;
-
- DEBUG_P("XF86VidModeSwitchToMode");
-
- ver = ClientMajorVersion(client);
- if (ver < 2) {
- /* convert from old format */
- stuff = &newstuff;
- stuff->length = oldstuff->length;
- stuff->screen = oldstuff->screen;
- stuff->dotclock = oldstuff->dotclock;
- stuff->hdisplay = oldstuff->hdisplay;
- stuff->hsyncstart = oldstuff->hsyncstart;
- stuff->hsyncend = oldstuff->hsyncend;
- stuff->htotal = oldstuff->htotal;
- stuff->hskew = 0;
- stuff->vdisplay = oldstuff->vdisplay;
- stuff->vsyncstart = oldstuff->vsyncstart;
- stuff->vsyncend = oldstuff->vsyncend;
- stuff->vtotal = oldstuff->vtotal;
- stuff->flags = oldstuff->flags;
- stuff->privsize = oldstuff->privsize;
- }
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("SwitchToMode - scrn: %d clock: %ld\n",
- (int)stuff->screen, (unsigned long)stuff->dotclock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- stuff->hdisplay, stuff->hsyncstart,
- stuff->hsyncend, stuff->htotal);
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
- stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
- stuff->vtotal, (unsigned long)stuff->flags);
- }
-
- if (ver < 2) {
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeSwitchToModeReq);
- len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeSwitchToModeReq));
- } else {
- REQUEST_AT_LEAST_SIZE(xXF86VidModeSwitchToModeReq);
- len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeSwitchToModeReq));
- }
- if (len != stuff->privsize)
- return BadLength;
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
- return BadValue;
-
- if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock)
- && MODEMATCH(mode, stuff))
- return Success;
-
- if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock))
- return BadValue;
-
- do {
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
- ErrorF("Checking against clock: %d (%d)\n",
- VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
- ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
- VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
- ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
- VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
- VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
- VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
- VidModeGetModeValue(mode, VIDMODE_FLAGS));
- }
- if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) &&
- MODEMATCH(mode, stuff)) {
-
- if (!VidModeSwitchMode(stuff->screen, mode))
- return BadValue;
-
- if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
- ErrorF("SwitchToMode - Succeeded\n");
- return Success;
- }
- } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
-
- return BadValue;
-}
-
-static int
-ProcXF86VidModeLockModeSwitch(ClientPtr client)
-{
- REQUEST(xXF86VidModeLockModeSwitchReq);
-
- REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq);
-
- DEBUG_P("XF86VidModeLockModeSwitch");
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (!VidModeLockZoom(stuff->screen, (short)stuff->lock))
- return VidModeErrorBase + XF86VidModeZoomLocked;
-
- return Success;
-}
-
-static int
-ProcXF86VidModeGetMonitor(ClientPtr client)
-{
- REQUEST(xXF86VidModeGetMonitorReq);
- xXF86VidModeGetMonitorReply rep;
- register int n;
- CARD32 *hsyncdata, *vsyncdata;
- int i, nHsync, nVrefresh;
- pointer monitor;
-
- DEBUG_P("XF86VidModeGetMonitor");
-
- REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (!VidModeGetMonitor(stuff->screen, &monitor))
- return BadValue;
-
- nHsync = VidModeGetMonitorValue(monitor, VIDMODE_MON_NHSYNC, 0).i;
- nVrefresh = VidModeGetMonitorValue(monitor, VIDMODE_MON_NVREFRESH, 0).i;
-
- rep.type = X_Reply;
- if ((char *)(VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, 0)).ptr)
- rep.vendorLength = strlen((char *)(VidModeGetMonitorValue(monitor,
- VIDMODE_MON_VENDOR, 0)).ptr);
- else
- rep.vendorLength = 0;
- if ((char *)(VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr)
- rep.modelLength = strlen((char *)(VidModeGetMonitorValue(monitor,
- VIDMODE_MON_MODEL, 0)).ptr);
- else
- rep.modelLength = 0;
- rep.length = bytes_to_int32(SIZEOF(xXF86VidModeGetMonitorReply) - SIZEOF(xGenericReply) +
- (nHsync + nVrefresh) * sizeof(CARD32) +
- pad_to_int32(rep.vendorLength) +
- pad_to_int32(rep.modelLength));
- rep.sequenceNumber = client->sequence;
- rep.nhsync = nHsync;
- rep.nvsync = nVrefresh;
- hsyncdata = malloc(nHsync * sizeof(CARD32));
- if (!hsyncdata) {
- return BadAlloc;
- }
-
- vsyncdata = malloc(nVrefresh * sizeof(CARD32));
- if (!vsyncdata) {
- free(hsyncdata);
- return BadAlloc;
- }
-
- for (i = 0; i < nHsync; i++) {
- hsyncdata[i] = (unsigned short)(VidModeGetMonitorValue(monitor,
- VIDMODE_MON_HSYNC_LO, i)).f |
- (unsigned short)(VidModeGetMonitorValue(monitor,
- VIDMODE_MON_HSYNC_HI, i)).f << 16;
- }
- for (i = 0; i < nVrefresh; i++) {
- vsyncdata[i] = (unsigned short)(VidModeGetMonitorValue(monitor,
- VIDMODE_MON_VREFRESH_LO, i)).f |
- (unsigned short)(VidModeGetMonitorValue(monitor,
- VIDMODE_MON_VREFRESH_HI, i)).f << 16;
- }
-
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- }
- WriteToClient(client, SIZEOF(xXF86VidModeGetMonitorReply), (char *)&rep);
- client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
- WriteSwappedDataToClient(client, nHsync * sizeof(CARD32),
- hsyncdata);
- WriteSwappedDataToClient(client, nVrefresh * sizeof(CARD32),
- vsyncdata);
- if (rep.vendorLength)
- WriteToClient(client, rep.vendorLength, (char *)(VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, 0)).ptr);
- if (rep.modelLength)
- WriteToClient(client, rep.modelLength, (char *)(VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr);
-
- free(hsyncdata);
- free(vsyncdata);
-
- return Success;
-}
-
-static int
-ProcXF86VidModeGetViewPort(ClientPtr client)
-{
- REQUEST(xXF86VidModeGetViewPortReq);
- xXF86VidModeGetViewPortReply rep;
- int x, y, n;
-
- DEBUG_P("XF86VidModeGetViewPort");
-
- REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- VidModeGetViewPort(stuff->screen, &x, &y);
- rep.x = x;
- rep.y = y;
-
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.x, n);
- swapl(&rep.y, n);
- }
- WriteToClient(client, SIZEOF(xXF86VidModeGetViewPortReply), (char *)&rep);
- return Success;
-}
-
-static int
-ProcXF86VidModeSetViewPort(ClientPtr client)
-{
- REQUEST(xXF86VidModeSetViewPortReq);
-
- DEBUG_P("XF86VidModeSetViewPort");
-
- REQUEST_SIZE_MATCH(xXF86VidModeSetViewPortReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (!VidModeSetViewPort(stuff->screen, stuff->x, stuff->y))
- return BadValue;
-
- return Success;
-}
-
-static int
-ProcXF86VidModeGetDotClocks(ClientPtr client)
-{
- REQUEST(xXF86VidModeGetDotClocksReq);
- xXF86VidModeGetDotClocksReply rep;
- register int n;
- int numClocks;
- CARD32 dotclock;
- int *Clocks = NULL;
- Bool ClockProg;
-
- DEBUG_P("XF86VidModeGetDotClocks");
-
- REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- numClocks = VidModeGetNumOfClocks(stuff->screen, &ClockProg);
-
- rep.type = X_Reply;
- rep.length = bytes_to_int32(SIZEOF(xXF86VidModeGetDotClocksReply)
- - SIZEOF(xGenericReply) + numClocks);
- rep.sequenceNumber = client->sequence;
- rep.clocks = numClocks;
- rep.maxclocks = MAXCLOCKS;
- rep.flags = 0;
-
- if (!ClockProg) {
- Clocks = malloc(numClocks * sizeof(int));
- if (!Clocks)
- return BadValue;
- if (!VidModeGetClocks(stuff->screen, Clocks)) {
- free(Clocks);
- return BadValue;
- }
- }
-
- if (ClockProg) {
- rep.flags |= CLKFLAG_PROGRAMABLE;
- }
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.clocks, n);
- swapl(&rep.maxclocks, n);
- swapl(&rep.flags, n);
- }
- WriteToClient(client, sizeof(xXF86VidModeGetDotClocksReply), (char *)&rep);
- if (!ClockProg) {
- for (n = 0; n < numClocks; n++) {
- dotclock = *Clocks++;
- if (client->swapped) {
- WriteSwappedDataToClient(client, 4, (char *)&dotclock);
- } else {
- WriteToClient(client, 4, (char *)&dotclock);
- }
- }
- }
-
- free(Clocks);
- return Success;
-}
-
-static int
-ProcXF86VidModeSetGamma(ClientPtr client)
-{
- REQUEST(xXF86VidModeSetGammaReq);
-
- DEBUG_P("XF86VidModeSetGamma");
-
- REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if (!VidModeSetGamma(stuff->screen, ((float)stuff->red)/10000.,
- ((float)stuff->green)/10000., ((float)stuff->blue)/10000.))
- return BadValue;
-
- return Success;
-}
-
-static int
-ProcXF86VidModeGetGamma(ClientPtr client)
-{
- REQUEST(xXF86VidModeGetGammaReq);
- xXF86VidModeGetGammaReply rep;
- register int n;
- float red, green, blue;
-
- DEBUG_P("XF86VidModeGetGamma");
-
- REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- if (!VidModeGetGamma(stuff->screen, &red, &green, &blue))
- return BadValue;
- rep.red = (CARD32)(red * 10000.);
- rep.green = (CARD32)(green * 10000.);
- rep.blue = (CARD32)(blue * 10000.);
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.red, n);
- swapl(&rep.green, n);
- swapl(&rep.blue, n);
- }
- WriteToClient(client, sizeof(xXF86VidModeGetGammaReply), (char *)&rep);
- return Success;
-}
-
-static int
-ProcXF86VidModeSetGammaRamp(ClientPtr client)
-{
- CARD16 *r, *g, *b;
- int length;
- REQUEST(xXF86VidModeSetGammaRampReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if(stuff->size != VidModeGetGammaRampSize(stuff->screen))
- return BadValue;
-
- length = (stuff->size + 1) & ~1;
-
- REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length * 6);
-
- r = (CARD16*)&stuff[1];
- g = r + length;
- b = g + length;
-
- if (!VidModeSetGammaRamp(stuff->screen, stuff->size, r, g, b))
- return BadValue;
-
- return Success;
-}
-
-static int
-ProcXF86VidModeGetGammaRamp(ClientPtr client)
-{
- CARD16 *ramp = NULL;
- int n, length;
- size_t ramplen = 0;
- xXF86VidModeGetGammaRampReply rep;
- REQUEST(xXF86VidModeGetGammaRampReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- if(stuff->size != VidModeGetGammaRampSize(stuff->screen))
- return BadValue;
-
- REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
-
- length = (stuff->size + 1) & ~1;
-
- if(stuff->size) {
- ramplen = length * 3 * sizeof(CARD16);
- if (!(ramp = malloc(ramplen)))
- return BadAlloc;
-
- if (!VidModeGetGammaRamp(stuff->screen, stuff->size,
- ramp, ramp + length, ramp + (length * 2))) {
- free(ramp);
- return BadValue;
- }
- }
-
- rep.type = X_Reply;
- rep.length = (length >> 1) * 3;
- rep.sequenceNumber = client->sequence;
- rep.size = stuff->size;
- if(client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.size, n);
- SwapShorts((short*)ramp, length * 3);
- }
- WriteToClient(client, sizeof(xXF86VidModeGetGammaRampReply), (char *)&rep);
-
- if(stuff->size) {
- WriteToClient(client, ramplen, (char*)ramp);
- free(ramp);
- }
-
- return Success;
-}
-
-
-static int
-ProcXF86VidModeGetGammaRampSize(ClientPtr client)
-{
- xXF86VidModeGetGammaRampSizeReply rep;
- int n;
- REQUEST(xXF86VidModeGetGammaRampSizeReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.size = VidModeGetGammaRampSize(stuff->screen);
- if(client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.size, n);
- }
- WriteToClient(client,sizeof(xXF86VidModeGetGammaRampSizeReply),(char*)&rep);
-
- return Success;
-}
-
-static int
-ProcXF86VidModeGetPermissions(ClientPtr client)
-{
- xXF86VidModeGetPermissionsReply rep;
- int n;
- REQUEST(xXF86VidModeGetPermissionsReq);
-
- if(stuff->screen >= screenInfo.numScreens)
- return BadValue;
-
- REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.permissions = XF86VM_READ_PERMISSION;
- if (xf86GetVidModeEnabled() &&
- (xf86GetVidModeAllowNonLocal() || LocalClient (client))) {
- rep.permissions |= XF86VM_WRITE_PERMISSION;
- }
- if(client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.permissions, n);
- }
- WriteToClient(client,sizeof(xXF86VidModeGetPermissionsReply),(char*)&rep);
-
- return Success;
-}
-
-
-static int
-ProcXF86VidModeSetClientVersion(ClientPtr client)
-{
- REQUEST(xXF86VidModeSetClientVersionReq);
-
- VidModePrivPtr pPriv;
-
- DEBUG_P("XF86VidModeSetClientVersion");
-
- REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq);
-
- if ((pPriv = VM_GETPRIV(client)) == NULL) {
- pPriv = malloc(sizeof(VidModePrivRec));
- if (!pPriv)
- return BadAlloc;
- VM_SETPRIV(client, pPriv);
- }
- pPriv->major = stuff->major;
- pPriv->minor = stuff->minor;
-
- return Success;
-}
-
-static int
-ProcXF86VidModeDispatch(ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_XF86VidModeQueryVersion:
- return ProcXF86VidModeQueryVersion(client);
- case X_XF86VidModeGetModeLine:
- return ProcXF86VidModeGetModeLine(client);
- case X_XF86VidModeGetMonitor:
- return ProcXF86VidModeGetMonitor(client);
- case X_XF86VidModeGetAllModeLines:
- return ProcXF86VidModeGetAllModeLines(client);
- case X_XF86VidModeValidateModeLine:
- return ProcXF86VidModeValidateModeLine(client);
- case X_XF86VidModeGetViewPort:
- return ProcXF86VidModeGetViewPort(client);
- case X_XF86VidModeGetDotClocks:
- return ProcXF86VidModeGetDotClocks(client);
- case X_XF86VidModeSetClientVersion:
- return ProcXF86VidModeSetClientVersion(client);
- case X_XF86VidModeGetGamma:
- return ProcXF86VidModeGetGamma(client);
- case X_XF86VidModeGetGammaRamp:
- return ProcXF86VidModeGetGammaRamp(client);
- case X_XF86VidModeGetGammaRampSize:
- return ProcXF86VidModeGetGammaRampSize(client);
- case X_XF86VidModeGetPermissions:
- return ProcXF86VidModeGetPermissions(client);
- default:
- if (!xf86GetVidModeEnabled())
- return VidModeErrorBase + XF86VidModeExtensionDisabled;
- if (xf86GetVidModeAllowNonLocal() || LocalClient (client)) {
- switch (stuff->data) {
- case X_XF86VidModeAddModeLine:
- return ProcXF86VidModeAddModeLine(client);
- case X_XF86VidModeDeleteModeLine:
- return ProcXF86VidModeDeleteModeLine(client);
- case X_XF86VidModeModModeLine:
- return ProcXF86VidModeModModeLine(client);
- case X_XF86VidModeSwitchMode:
- return ProcXF86VidModeSwitchMode(client);
- case X_XF86VidModeSwitchToMode:
- return ProcXF86VidModeSwitchToMode(client);
- case X_XF86VidModeLockModeSwitch:
- return ProcXF86VidModeLockModeSwitch(client);
- case X_XF86VidModeSetViewPort:
- return ProcXF86VidModeSetViewPort(client);
- case X_XF86VidModeSetGamma:
- return ProcXF86VidModeSetGamma(client);
- case X_XF86VidModeSetGammaRamp:
- return ProcXF86VidModeSetGammaRamp(client);
- default:
- return BadRequest;
- }
- } else
- return VidModeErrorBase + XF86VidModeClientNotLocal;
- }
-}
-
-static int
-SProcXF86VidModeQueryVersion(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeQueryVersionReq);
- swaps(&stuff->length, n);
- return ProcXF86VidModeQueryVersion(client);
-}
-
-static int
-SProcXF86VidModeGetModeLine(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeGetModeLineReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetModeLine(client);
-}
-
-static int
-SProcXF86VidModeGetAllModeLines(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeGetAllModeLinesReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetAllModeLines(client);
-}
-
-static int
-SProcXF86VidModeAddModeLine(ClientPtr client)
-{
- xXF86OldVidModeAddModeLineReq *oldstuff =
- (xXF86OldVidModeAddModeLineReq *)client->requestBuffer;
- int ver;
- register int n;
-
- REQUEST(xXF86VidModeAddModeLineReq);
- ver = ClientMajorVersion(client);
- if (ver < 2) {
- swaps(&oldstuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq);
- swapl(&oldstuff->screen, n);
- swaps(&oldstuff->hdisplay, n);
- swaps(&oldstuff->hsyncstart, n);
- swaps(&oldstuff->hsyncend, n);
- swaps(&oldstuff->htotal, n);
- swaps(&oldstuff->vdisplay, n);
- swaps(&oldstuff->vsyncstart, n);
- swaps(&oldstuff->vsyncend, n);
- swaps(&oldstuff->vtotal, n);
- swapl(&oldstuff->flags, n);
- swapl(&oldstuff->privsize, n);
- SwapRestL(oldstuff);
- } else {
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86VidModeAddModeLineReq);
- swapl(&stuff->screen, n);
- swaps(&stuff->hdisplay, n);
- swaps(&stuff->hsyncstart, n);
- swaps(&stuff->hsyncend, n);
- swaps(&stuff->htotal, n);
- swaps(&stuff->hskew, n);
- swaps(&stuff->vdisplay, n);
- swaps(&stuff->vsyncstart, n);
- swaps(&stuff->vsyncend, n);
- swaps(&stuff->vtotal, n);
- swapl(&stuff->flags, n);
- swapl(&stuff->privsize, n);
- SwapRestL(stuff);
- }
- return ProcXF86VidModeAddModeLine(client);
-}
-
-static int
-SProcXF86VidModeDeleteModeLine(ClientPtr client)
-{
- xXF86OldVidModeDeleteModeLineReq *oldstuff =
- (xXF86OldVidModeDeleteModeLineReq *)client->requestBuffer;
- int ver;
- register int n;
-
- REQUEST(xXF86VidModeDeleteModeLineReq);
- ver = ClientMajorVersion(client);
- if (ver < 2) {
- swaps(&oldstuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeDeleteModeLineReq);
- swapl(&oldstuff->screen, n);
- swaps(&oldstuff->hdisplay, n);
- swaps(&oldstuff->hsyncstart, n);
- swaps(&oldstuff->hsyncend, n);
- swaps(&oldstuff->htotal, n);
- swaps(&oldstuff->vdisplay, n);
- swaps(&oldstuff->vsyncstart, n);
- swaps(&oldstuff->vsyncend, n);
- swaps(&oldstuff->vtotal, n);
- swapl(&oldstuff->flags, n);
- swapl(&oldstuff->privsize, n);
- SwapRestL(oldstuff);
- } else {
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86VidModeDeleteModeLineReq);
- swapl(&stuff->screen, n);
- swaps(&stuff->hdisplay, n);
- swaps(&stuff->hsyncstart, n);
- swaps(&stuff->hsyncend, n);
- swaps(&stuff->htotal, n);
- swaps(&stuff->hskew, n);
- swaps(&stuff->vdisplay, n);
- swaps(&stuff->vsyncstart, n);
- swaps(&stuff->vsyncend, n);
- swaps(&stuff->vtotal, n);
- swapl(&stuff->flags, n);
- swapl(&stuff->privsize, n);
- SwapRestL(stuff);
- }
- return ProcXF86VidModeDeleteModeLine(client);
-}
-
-static int
-SProcXF86VidModeModModeLine(ClientPtr client)
-{
- xXF86OldVidModeModModeLineReq *oldstuff =
- (xXF86OldVidModeModModeLineReq *)client->requestBuffer;
- int ver;
- register int n;
-
- REQUEST(xXF86VidModeModModeLineReq);
- ver = ClientMajorVersion(client);
- if (ver < 2) {
- swaps(&oldstuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq);
- swapl(&oldstuff->screen, n);
- swaps(&oldstuff->hdisplay, n);
- swaps(&oldstuff->hsyncstart, n);
- swaps(&oldstuff->hsyncend, n);
- swaps(&oldstuff->htotal, n);
- swaps(&oldstuff->vdisplay, n);
- swaps(&oldstuff->vsyncstart, n);
- swaps(&oldstuff->vsyncend, n);
- swaps(&oldstuff->vtotal, n);
- swapl(&oldstuff->flags, n);
- swapl(&oldstuff->privsize, n);
- SwapRestL(oldstuff);
- } else {
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86VidModeModModeLineReq);
- swapl(&stuff->screen, n);
- swaps(&stuff->hdisplay, n);
- swaps(&stuff->hsyncstart, n);
- swaps(&stuff->hsyncend, n);
- swaps(&stuff->htotal, n);
- swaps(&stuff->hskew, n);
- swaps(&stuff->vdisplay, n);
- swaps(&stuff->vsyncstart, n);
- swaps(&stuff->vsyncend, n);
- swaps(&stuff->vtotal, n);
- swapl(&stuff->flags, n);
- swapl(&stuff->privsize, n);
- SwapRestL(stuff);
- }
- return ProcXF86VidModeModModeLine(client);
-}
-
-static int
-SProcXF86VidModeValidateModeLine(ClientPtr client)
-{
- xXF86OldVidModeValidateModeLineReq *oldstuff =
- (xXF86OldVidModeValidateModeLineReq *)client->requestBuffer;
- int ver;
- register int n;
-
- REQUEST(xXF86VidModeValidateModeLineReq);
- ver = ClientMajorVersion(client);
- if (ver < 2) {
- swaps(&oldstuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86OldVidModeValidateModeLineReq);
- swapl(&oldstuff->screen, n);
- swaps(&oldstuff->hdisplay, n);
- swaps(&oldstuff->hsyncstart, n);
- swaps(&oldstuff->hsyncend, n);
- swaps(&oldstuff->htotal, n);
- swaps(&oldstuff->vdisplay, n);
- swaps(&oldstuff->vsyncstart, n);
- swaps(&oldstuff->vsyncend, n);
- swaps(&oldstuff->vtotal, n);
- swapl(&oldstuff->flags, n);
- swapl(&oldstuff->privsize, n);
- SwapRestL(oldstuff);
- } else {
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86VidModeValidateModeLineReq);
- swapl(&stuff->screen, n);
- swaps(&stuff->hdisplay, n);
- swaps(&stuff->hsyncstart, n);
- swaps(&stuff->hsyncend, n);
- swaps(&stuff->htotal, n);
- swaps(&stuff->hskew, n);
- swaps(&stuff->vdisplay, n);
- swaps(&stuff->vsyncstart, n);
- swaps(&stuff->vsyncend, n);
- swaps(&stuff->vtotal, n);
- swapl(&stuff->flags, n);
- swapl(&stuff->privsize, n);
- SwapRestL(stuff);
- }
- return ProcXF86VidModeValidateModeLine(client);
-}
-
-static int
-SProcXF86VidModeSwitchMode(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeSwitchModeReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq);
- swaps(&stuff->screen, n);
- swaps(&stuff->zoom, n);
- return ProcXF86VidModeSwitchMode(client);
-}
-
-static int
-SProcXF86VidModeSwitchToMode(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeSwitchToModeReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeSwitchToModeReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeSwitchToMode(client);
-}
-
-static int
-SProcXF86VidModeLockModeSwitch(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeLockModeSwitchReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq);
- swaps(&stuff->screen, n);
- swaps(&stuff->lock, n);
- return ProcXF86VidModeLockModeSwitch(client);
-}
-
-static int
-SProcXF86VidModeGetMonitor(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeGetMonitorReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetMonitor(client);
-}
-
-static int
-SProcXF86VidModeGetViewPort(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeGetViewPortReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetViewPort(client);
-}
-
-static int
-SProcXF86VidModeSetViewPort(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeSetViewPortReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeSetViewPortReq);
- swaps(&stuff->screen, n);
- swapl(&stuff->x, n);
- swapl(&stuff->y, n);
- return ProcXF86VidModeSetViewPort(client);
-}
-
-static int
-SProcXF86VidModeGetDotClocks(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeGetDotClocksReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetDotClocks(client);
-}
-
-static int
-SProcXF86VidModeSetClientVersion(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeSetClientVersionReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq);
- swaps(&stuff->major, n);
- swaps(&stuff->minor, n);
- return ProcXF86VidModeSetClientVersion(client);
-}
-
-static int
-SProcXF86VidModeSetGamma(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeSetGammaReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq);
- swaps(&stuff->screen, n);
- swapl(&stuff->red, n);
- swapl(&stuff->green, n);
- swapl(&stuff->blue, n);
- return ProcXF86VidModeSetGamma(client);
-}
-
-static int
-SProcXF86VidModeGetGamma(ClientPtr client)
-{
- register int n;
- REQUEST(xXF86VidModeGetGammaReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetGamma(client);
-}
-
-static int
-SProcXF86VidModeSetGammaRamp(ClientPtr client)
-{
- int length, n;
- REQUEST(xXF86VidModeSetGammaRampReq);
- swaps(&stuff->length, n);
- REQUEST_AT_LEAST_SIZE(xXF86VidModeSetGammaRampReq);
- swaps(&stuff->size, n);
- swaps(&stuff->screen, n);
- length = ((stuff->size + 1) & ~1) * 6;
- REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length);
- SwapRestS(stuff);
- return ProcXF86VidModeSetGammaRamp(client);
-}
-
-static int
-SProcXF86VidModeGetGammaRamp(ClientPtr client)
-{
- int n;
- REQUEST(xXF86VidModeGetGammaRampReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
- swaps(&stuff->size, n);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetGammaRamp(client);
-}
-
-static int
-SProcXF86VidModeGetGammaRampSize(ClientPtr client)
-{
- int n;
- REQUEST(xXF86VidModeGetGammaRampSizeReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetGammaRampSize(client);
-}
-
-static int
-SProcXF86VidModeGetPermissions(ClientPtr client)
-{
- int n;
- REQUEST(xXF86VidModeGetPermissionsReq);
- swaps(&stuff->length, n);
- REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq);
- swaps(&stuff->screen, n);
- return ProcXF86VidModeGetPermissions(client);
-}
-
-
-static int
-SProcXF86VidModeDispatch(ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data)
- {
- case X_XF86VidModeQueryVersion:
- return SProcXF86VidModeQueryVersion(client);
- case X_XF86VidModeGetModeLine:
- return SProcXF86VidModeGetModeLine(client);
- case X_XF86VidModeGetMonitor:
- return SProcXF86VidModeGetMonitor(client);
- case X_XF86VidModeGetAllModeLines:
- return SProcXF86VidModeGetAllModeLines(client);
- case X_XF86VidModeGetViewPort:
- return SProcXF86VidModeGetViewPort(client);
- case X_XF86VidModeValidateModeLine:
- return SProcXF86VidModeValidateModeLine(client);
- case X_XF86VidModeGetDotClocks:
- return SProcXF86VidModeGetDotClocks(client);
- case X_XF86VidModeSetClientVersion:
- return SProcXF86VidModeSetClientVersion(client);
- case X_XF86VidModeGetGamma:
- return SProcXF86VidModeGetGamma(client);
- case X_XF86VidModeGetGammaRamp:
- return SProcXF86VidModeGetGammaRamp(client);
- case X_XF86VidModeGetGammaRampSize:
- return SProcXF86VidModeGetGammaRampSize(client);
- case X_XF86VidModeGetPermissions:
- return SProcXF86VidModeGetPermissions(client);
- default:
- if (!xf86GetVidModeEnabled())
- return VidModeErrorBase + XF86VidModeExtensionDisabled;
- if (xf86GetVidModeAllowNonLocal() || LocalClient(client)) {
- switch (stuff->data) {
- case X_XF86VidModeAddModeLine:
- return SProcXF86VidModeAddModeLine(client);
- case X_XF86VidModeDeleteModeLine:
- return SProcXF86VidModeDeleteModeLine(client);
- case X_XF86VidModeModModeLine:
- return SProcXF86VidModeModModeLine(client);
- case X_XF86VidModeSwitchMode:
- return SProcXF86VidModeSwitchMode(client);
- case X_XF86VidModeSwitchToMode:
- return SProcXF86VidModeSwitchToMode(client);
- case X_XF86VidModeLockModeSwitch:
- return SProcXF86VidModeLockModeSwitch(client);
- case X_XF86VidModeSetViewPort:
- return SProcXF86VidModeSetViewPort(client);
- case X_XF86VidModeSetGamma:
- return SProcXF86VidModeSetGamma(client);
- case X_XF86VidModeSetGammaRamp:
- return SProcXF86VidModeSetGammaRamp(client);
- default:
- return BadRequest;
- }
- } else
- return VidModeErrorBase + XF86VidModeClientNotLocal;
- }
-}
-
-void
-XFree86VidModeExtensionInit(void)
-{
- ExtensionEntry* extEntry;
- ScreenPtr pScreen;
- int i;
- Bool enabled = FALSE;
-
- DEBUG_P("XFree86VidModeExtensionInit");
-
- if (!dixRegisterPrivateKey(&VidModeClientPrivateKeyRec, PRIVATE_CLIENT, 0))
- return;
-#ifdef XF86VIDMODE_EVENTS
- if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
- return;
-#endif
-
-#ifdef XF86VIDMODE_EVENTS
- EventType = CreateNewResourceType(XF86VidModeFreeEvents, "VidModeEvent");
-#endif
-
- for(i = 0; i < screenInfo.numScreens; i++) {
- pScreen = screenInfo.screens[i];
- if (VidModeExtensionInit(pScreen))
- enabled = TRUE;
- }
- /* This means that the DDX doesn't want the vidmode extension enabled */
- if (!enabled)
- return;
-
- if (
-#ifdef XF86VIDMODE_EVENTS
- EventType &&
-#endif
- (extEntry = AddExtension(XF86VIDMODENAME,
- XF86VidModeNumberEvents,
- XF86VidModeNumberErrors,
- ProcXF86VidModeDispatch,
- SProcXF86VidModeDispatch,
- NULL,
- StandardMinorOpcode))) {
-#if 0
- XF86VidModeReqCode = (unsigned char)extEntry->base;
-#endif
- VidModeErrorBase = extEntry->errorBase;
-#ifdef XF86VIDMODE_EVENTS
- XF86VidModeEventBase = extEntry->eventBase;
- EventSwapVector[XF86VidModeEventBase] = (EventSwapPtr)SXF86VidModeNotifyEvent;
-#endif
- }
-}
+
+/*
+
+Copyright 1995 Kaleb S. KEITHLEY
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES
+OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Kaleb S. KEITHLEY
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+from Kaleb S. KEITHLEY
+
+*/
+/* THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "dixstruct.h"
+#include "extnsionst.h"
+#include "scrnintstr.h"
+#include "servermd.h"
+#include <X11/extensions/xf86vmproto.h>
+#include "swaprep.h"
+#include "xf86.h"
+#include "vidmodeproc.h"
+#include "globals.h"
+#include "protocol-versions.h"
+
+#define DEFAULT_XF86VIDMODE_VERBOSITY 3
+
+static int VidModeErrorBase;
+static DevPrivateKeyRec VidModeClientPrivateKeyRec;
+#define VidModeClientPrivateKey (&VidModeClientPrivateKeyRec)
+
+/* This holds the client's version information */
+typedef struct {
+ int major;
+ int minor;
+} VidModePrivRec, *VidModePrivPtr;
+
+#define VM_GETPRIV(c) ((VidModePrivPtr) \
+ dixLookupPrivate(&(c)->devPrivates, VidModeClientPrivateKey))
+#define VM_SETPRIV(c,p) \
+ dixSetPrivate(&(c)->devPrivates, VidModeClientPrivateKey, p)
+
+
+#if 0
+static unsigned char XF86VidModeReqCode = 0;
+#endif
+
+/* The XF86VIDMODE_EVENTS code is far from complete */
+
+#ifdef XF86VIDMODE_EVENTS
+static int XF86VidModeEventBase = 0;
+
+static void SXF86VidModeNotifyEvent();
+ xXF86VidModeNotifyEvent * /* from */,
+ xXF86VidModeNotifyEvent * /* to */
+);
+
+static RESTYPE EventType; /* resource type for event masks */
+
+typedef struct _XF86VidModeEvent *XF86VidModeEventPtr;
+
+typedef struct _XF86VidModeEvent {
+ XF86VidModeEventPtr next;
+ ClientPtr client;
+ ScreenPtr screen;
+ XID resource;
+ CARD32 mask;
+} XF86VidModeEventRec;
+
+static int XF86VidModeFreeEvents();
+
+typedef struct _XF86VidModeScreenPrivate {
+ XF86VidModeEventPtr events;
+ Bool hasWindow;
+} XF86VidModeScreenPrivateRec, *XF86VidModeScreenPrivatePtr;
+
+static DevPrivateKeyRec ScreenPrivateKeyRec;
+#define ScreenPrivateKey (&ScreenPrivateKeyRec)
+
+#define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr) \
+ dixLookupPrivate(&(s)->devPrivates, ScreenPrivateKey))
+#define SetScreenPrivate(s,v) \
+ dixSetPrivate(&(s)->devPrivates, ScreenPrivateKey, v)
+#define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = GetScreenPrivate(s)
+
+#define New(t) (malloc(sizeof (t)))
+#endif
+
+#ifdef DEBUG
+# define DEBUG_P(x) ErrorF(x"\n");
+#else
+# define DEBUG_P(x) /**/
+#endif
+
+static int
+ClientMajorVersion(ClientPtr client)
+{
+ VidModePrivPtr pPriv;
+
+ pPriv = VM_GETPRIV(client);
+ if (!pPriv)
+ return 0;
+ else
+ return pPriv->major;
+}
+
+#ifdef XF86VIDMODE_EVENTS
+static void
+CheckScreenPrivate (pScreen)
+ ScreenPtr pScreen;
+{
+ SetupScreen (pScreen);
+
+ if (!pPriv)
+ return;
+ if (!pPriv->events && !pPriv->hasWindow) {
+ free(pPriv);
+ SetScreenPrivate (pScreen, NULL);
+ }
+}
+
+static XF86VidModeScreenPrivatePtr
+MakeScreenPrivate (pScreen)
+ ScreenPtr pScreen;
+{
+ SetupScreen (pScreen);
+
+ if (pPriv)
+ return pPriv;
+ pPriv = New (XF86VidModeScreenPrivateRec);
+ if (!pPriv)
+ return 0;
+ pPriv->events = 0;
+ pPriv->hasWindow = FALSE;
+ SetScreenPrivate (pScreen, pPriv);
+ return pPriv;
+}
+
+static unsigned long
+getEventMask (ScreenPtr pScreen, ClientPtr client)
+{
+ SetupScreen(pScreen);
+ XF86VidModeEventPtr pEv;
+
+ if (!pPriv)
+ return 0;
+ for (pEv = pPriv->events; pEv; pEv = pEv->next)
+ if (pEv->client == client)
+ return pEv->mask;
+ return 0;
+}
+
+static Bool
+setEventMask (ScreenPtr pScreen, ClientPtr client, unsigned long mask)
+{
+ SetupScreen(pScreen);
+ XF86VidModeEventPtr pEv, *pPrev;
+
+ if (getEventMask (pScreen, client) == mask)
+ return TRUE;
+ if (!pPriv) {
+ pPriv = MakeScreenPrivate (pScreen);
+ if (!pPriv)
+ return FALSE;
+ }
+ for (pPrev = &pPriv->events; pEv = *pPrev; pPrev = &pEv->next)
+ if (pEv->client == client)
+ break;
+ if (mask == 0) {
+ *pPrev = pEv->next;
+ free(pEv);
+ CheckScreenPrivate (pScreen);
+ } else {
+ if (!pEv) {
+ pEv = New (ScreenSaverEventRec);
+ if (!pEv) {
+ CheckScreenPrivate (pScreen);
+ return FALSE;
+ }
+ *pPrev = pEv;
+ pEv->next = NULL;
+ pEv->client = client;
+ pEv->screen = pScreen;
+ pEv->resource = FakeClientID (client->index);
+ }
+ pEv->mask = mask;
+ }
+ return TRUE;
+}
+
+static int
+XF86VidModeFreeEvents(pointer value, XID id)
+{
+ XF86VidModeEventPtr pOld = (XF86VidModeEventPtr)value;
+ ScreenPtr pScreen = pOld->screen;
+ SetupScreen (pScreen);
+ XF86VidModeEventPtr pEv, *pPrev;
+
+ if (!pPriv)
+ return TRUE;
+ for (pPrev = &pPriv->events; pEv = *pPrev; pPrev = &pEv->next)
+ if (pEv == pOld)
+ break;
+ if (!pEv)
+ return TRUE;
+ *pPrev = pEv->next;
+ free(pEv);
+ CheckScreenPrivate (pScreen);
+ return TRUE;
+}
+
+static void
+SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced)
+{
+ XF86VidModeScreenPrivatePtr pPriv;
+ XF86VidModeEventPtr pEv;
+ unsigned long mask;
+ xXF86VidModeNotifyEvent ev;
+ int kind;
+
+ UpdateCurrentTimeIf ();
+ mask = XF86VidModeNotifyMask;
+ pScreen = screenInfo.screens[pScreen->myNum];
+ pPriv = GetScreenPrivate(pScreen);
+ if (!pPriv)
+ return;
+ kind = XF86VidModeModeChange;
+ for (pEv = pPriv->events; pEv; pEv = pEv->next)
+ {
+ if (!(pEv->mask & mask))
+ continue;
+ ev.type = XF86VidModeNotify + XF86VidModeEventBase;
+ ev.state = state;
+ ev.timestamp = currentTime.milliseconds;
+ ev.root = pScreen->root->drawable.id;
+ ev.kind = kind;
+ ev.forced = forced;
+ WriteEventsToClient (pEv->client, 1, (xEvent *) &ev);
+ }
+}
+
+static void
+SXF86VidModeNotifyEvent(xXF86VidModeNotifyEvent *from,
+ xXF86VidModeNotifyEvent *to)
+{
+ to->type = from->type;
+ to->state = from->state;
+ cpswaps (from->sequenceNumber, to->sequenceNumber);
+ cpswapl (from->timestamp, to->timestamp);
+ cpswapl (from->root, to->root);
+ to->kind = from->kind;
+ to->forced = from->forced;
+}
+#endif
+
+static int
+ProcXF86VidModeQueryVersion(ClientPtr client)
+{
+ xXF86VidModeQueryVersionReply rep;
+
+ DEBUG_P("XF86VidModeQueryVersion");
+
+ REQUEST_SIZE_MATCH(xXF86VidModeQueryVersionReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.majorVersion = SERVER_XF86VIDMODE_MAJOR_VERSION;
+ rep.minorVersion = SERVER_XF86VIDMODE_MINOR_VERSION;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.majorVersion);
+ swaps(&rep.minorVersion);
+ }
+ WriteToClient(client, sizeof(xXF86VidModeQueryVersionReply), (char *)&rep);
+ return Success;
+}
+
+static int
+ProcXF86VidModeGetModeLine(ClientPtr client)
+{
+ REQUEST(xXF86VidModeGetModeLineReq);
+ xXF86VidModeGetModeLineReply rep;
+ xXF86OldVidModeGetModeLineReply oldrep;
+ pointer mode;
+ int dotClock;
+ int ver;
+
+ DEBUG_P("XF86VidModeGetModeline");
+
+ ver = ClientMajorVersion(client);
+ REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq);
+ rep.type = X_Reply;
+ if (ver < 2) {
+ rep.length = bytes_to_int32(SIZEOF(xXF86OldVidModeGetModeLineReply) -
+ SIZEOF(xGenericReply));
+ } else {
+ rep.length = bytes_to_int32(SIZEOF(xXF86VidModeGetModeLineReply) -
+ SIZEOF(xGenericReply));
+ }
+ rep.sequenceNumber = client->sequence;
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
+ return BadValue;
+
+ rep.dotclock = dotClock;
+ rep.hdisplay = VidModeGetModeValue(mode, VIDMODE_H_DISPLAY);
+ rep.hsyncstart = VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART);
+ rep.hsyncend = VidModeGetModeValue(mode, VIDMODE_H_SYNCEND);
+ rep.htotal = VidModeGetModeValue(mode, VIDMODE_H_TOTAL);
+ rep.hskew = VidModeGetModeValue(mode, VIDMODE_H_SKEW);
+ rep.vdisplay = VidModeGetModeValue(mode, VIDMODE_V_DISPLAY);
+ rep.vsyncstart = VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART);
+ rep.vsyncend = VidModeGetModeValue(mode, VIDMODE_V_SYNCEND);
+ rep.vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL);
+ rep.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS);
+
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
+ ErrorF("GetModeLine - scrn: %d clock: %ld\n",
+ stuff->screen, (unsigned long)rep.dotclock);
+ ErrorF("GetModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ rep.hdisplay, rep.hsyncstart,
+ rep.hsyncend, rep.htotal);
+ ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ rep.vdisplay, rep.vsyncstart, rep.vsyncend,
+ rep.vtotal, (unsigned long)rep.flags);
+ }
+
+ /*
+ * Older servers sometimes had server privates that the VidMode
+ * extention made available. So to be compatiable pretend that
+ * there are no server privates to pass to the client
+ */
+ rep.privsize = 0;
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.dotclock);
+ swaps(&rep.hdisplay);
+ swaps(&rep.hsyncstart);
+ swaps(&rep.hsyncend);
+ swaps(&rep.htotal);
+ swaps(&rep.hskew);
+ swaps(&rep.vdisplay);
+ swaps(&rep.vsyncstart);
+ swaps(&rep.vsyncend);
+ swaps(&rep.vtotal);
+ swapl(&rep.flags);
+ swapl(&rep.privsize);
+ }
+ if (ver < 2) {
+ oldrep.type = rep.type;
+ oldrep.sequenceNumber = rep.sequenceNumber;
+ oldrep.length = rep.length;
+ oldrep.dotclock = rep.dotclock;
+ oldrep.hdisplay = rep.hdisplay;
+ oldrep.hsyncstart = rep.hsyncstart;
+ oldrep.hsyncend = rep.hsyncend;
+ oldrep.htotal = rep.htotal;
+ oldrep.vdisplay = rep.vdisplay;
+ oldrep.vsyncstart = rep.vsyncstart;
+ oldrep.vsyncend = rep.vsyncend;
+ oldrep.vtotal = rep.vtotal;
+ oldrep.flags = rep.flags;
+ oldrep.privsize = rep.privsize;
+ WriteToClient(client, sizeof(xXF86OldVidModeGetModeLineReply),
+ (char *)&oldrep);
+ } else {
+ WriteToClient(client, sizeof(xXF86VidModeGetModeLineReply),
+ (char *)&rep);
+ }
+ return Success;
+}
+
+static int
+ProcXF86VidModeGetAllModeLines(ClientPtr client)
+{
+ REQUEST(xXF86VidModeGetAllModeLinesReq);
+ xXF86VidModeGetAllModeLinesReply rep;
+ xXF86VidModeModeInfo mdinf;
+ xXF86OldVidModeModeInfo oldmdinf;
+ pointer mode;
+ int modecount, dotClock;
+ int ver;
+
+ DEBUG_P("XF86VidModeGetAllModelines");
+
+ REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ ver = ClientMajorVersion(client);
+
+ modecount = VidModeGetNumOfModes(stuff->screen);
+ if (modecount < 1)
+ return VidModeErrorBase + XF86VidModeExtensionDisabled;
+
+ if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock))
+ return BadValue;
+
+ rep.type = X_Reply;
+ rep.length = SIZEOF(xXF86VidModeGetAllModeLinesReply) -
+ SIZEOF(xGenericReply);
+ if (ver < 2)
+ rep.length += modecount * sizeof(xXF86OldVidModeModeInfo);
+ else
+ rep.length += modecount * sizeof(xXF86VidModeModeInfo);
+ rep.length >>= 2;
+ rep.sequenceNumber = client->sequence;
+ rep.modecount = modecount;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.modecount);
+ }
+ WriteToClient(client, sizeof(xXF86VidModeGetAllModeLinesReply), (char *)&rep);
+
+ do {
+ mdinf.dotclock = dotClock;
+ mdinf.hdisplay = VidModeGetModeValue(mode, VIDMODE_H_DISPLAY);
+ mdinf.hsyncstart = VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART);
+ mdinf.hsyncend = VidModeGetModeValue(mode, VIDMODE_H_SYNCEND);
+ mdinf.htotal = VidModeGetModeValue(mode, VIDMODE_H_TOTAL);
+ mdinf.hskew = VidModeGetModeValue(mode, VIDMODE_H_SKEW);
+ mdinf.vdisplay = VidModeGetModeValue(mode, VIDMODE_V_DISPLAY);
+ mdinf.vsyncstart = VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART);
+ mdinf.vsyncend = VidModeGetModeValue(mode, VIDMODE_V_SYNCEND);
+ mdinf.vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL);
+ mdinf.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS);
+ mdinf.privsize = 0;
+ if (client->swapped) {
+ swapl(&mdinf.dotclock);
+ swaps(&mdinf.hdisplay);
+ swaps(&mdinf.hsyncstart);
+ swaps(&mdinf.hsyncend);
+ swaps(&mdinf.htotal);
+ swapl(&mdinf.hskew);
+ swaps(&mdinf.vdisplay);
+ swaps(&mdinf.vsyncstart);
+ swaps(&mdinf.vsyncend);
+ swaps(&mdinf.vtotal);
+ swapl(&mdinf.flags);
+ swapl(&mdinf.privsize);
+ }
+ if (ver < 2) {
+ oldmdinf.dotclock = mdinf.dotclock;
+ oldmdinf.hdisplay = mdinf.hdisplay;
+ oldmdinf.hsyncstart = mdinf.hsyncstart;
+ oldmdinf.hsyncend = mdinf.hsyncend;
+ oldmdinf.htotal = mdinf.htotal;
+ oldmdinf.vdisplay = mdinf.vdisplay;
+ oldmdinf.vsyncstart = mdinf.vsyncstart;
+ oldmdinf.vsyncend = mdinf.vsyncend;
+ oldmdinf.vtotal = mdinf.vtotal;
+ oldmdinf.flags = mdinf.flags;
+ oldmdinf.privsize = mdinf.privsize;
+ WriteToClient(client, sizeof(xXF86OldVidModeModeInfo),
+ (char *)&oldmdinf);
+ } else {
+ WriteToClient(client, sizeof(xXF86VidModeModeInfo), (char *)&mdinf);
+ }
+
+ } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
+
+ return Success;
+}
+
+#define MODEMATCH(mode,stuff) \
+ (VidModeGetModeValue(mode, VIDMODE_H_DISPLAY) == stuff->hdisplay \
+ && VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART) == stuff->hsyncstart \
+ && VidModeGetModeValue(mode, VIDMODE_H_SYNCEND) == stuff->hsyncend \
+ && VidModeGetModeValue(mode, VIDMODE_H_TOTAL) == stuff->htotal \
+ && VidModeGetModeValue(mode, VIDMODE_V_DISPLAY) == stuff->vdisplay \
+ && VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART) == stuff->vsyncstart \
+ && VidModeGetModeValue(mode, VIDMODE_V_SYNCEND) == stuff->vsyncend \
+ && VidModeGetModeValue(mode, VIDMODE_V_TOTAL) == stuff->vtotal \
+ && VidModeGetModeValue(mode, VIDMODE_FLAGS) == stuff->flags )
+
+static int
+ProcXF86VidModeAddModeLine(ClientPtr client)
+{
+ REQUEST(xXF86VidModeAddModeLineReq);
+ xXF86OldVidModeAddModeLineReq *oldstuff =
+ (xXF86OldVidModeAddModeLineReq *)client->requestBuffer;
+ xXF86VidModeAddModeLineReq newstuff;
+ pointer mode;
+ int len;
+ int dotClock;
+ int ver;
+
+ DEBUG_P("XF86VidModeAddModeline");
+
+ ver = ClientMajorVersion(client);
+ if (ver < 2) {
+ /* convert from old format */
+ stuff = &newstuff;
+ stuff->length = oldstuff->length;
+ stuff->screen = oldstuff->screen;
+ stuff->dotclock = oldstuff->dotclock;
+ stuff->hdisplay = oldstuff->hdisplay;
+ stuff->hsyncstart = oldstuff->hsyncstart;
+ stuff->hsyncend = oldstuff->hsyncend;
+ stuff->htotal = oldstuff->htotal;
+ stuff->hskew = 0;
+ stuff->vdisplay = oldstuff->vdisplay;
+ stuff->vsyncstart = oldstuff->vsyncstart;
+ stuff->vsyncend = oldstuff->vsyncend;
+ stuff->vtotal = oldstuff->vtotal;
+ stuff->flags = oldstuff->flags;
+ stuff->privsize = oldstuff->privsize;
+ stuff->after_dotclock = oldstuff->after_dotclock;
+ stuff->after_hdisplay = oldstuff->after_hdisplay;
+ stuff->after_hsyncstart = oldstuff->after_hsyncstart;
+ stuff->after_hsyncend = oldstuff->after_hsyncend;
+ stuff->after_htotal = oldstuff->after_htotal;
+ stuff->after_hskew = 0;
+ stuff->after_vdisplay = oldstuff->after_vdisplay;
+ stuff->after_vsyncstart = oldstuff->after_vsyncstart;
+ stuff->after_vsyncend = oldstuff->after_vsyncend;
+ stuff->after_vtotal = oldstuff->after_vtotal;
+ stuff->after_flags = oldstuff->after_flags;
+ }
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
+ ErrorF("AddModeLine - scrn: %d clock: %ld\n",
+ (int)stuff->screen, (unsigned long)stuff->dotclock);
+ ErrorF("AddModeLine - hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ stuff->hdisplay, stuff->hsyncstart,
+ stuff->hsyncend, stuff->htotal);
+ ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
+ stuff->vtotal, (unsigned long)stuff->flags);
+ ErrorF(" after - scrn: %d clock: %ld\n",
+ (int)stuff->screen, (unsigned long)stuff->after_dotclock);
+ ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ stuff->after_hdisplay, stuff->after_hsyncstart,
+ stuff->after_hsyncend, stuff->after_htotal);
+ ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->after_vdisplay, stuff->after_vsyncstart,
+ stuff->after_vsyncend, stuff->after_vtotal,
+ (unsigned long)stuff->after_flags);
+ }
+
+ if (ver < 2) {
+ REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq);
+ len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeAddModeLineReq));
+ } else {
+ REQUEST_AT_LEAST_SIZE(xXF86VidModeAddModeLineReq);
+ len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeAddModeLineReq));
+ }
+ if (len != stuff->privsize)
+ return BadLength;
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ if (stuff->hsyncstart < stuff->hdisplay ||
+ stuff->hsyncend < stuff->hsyncstart ||
+ stuff->htotal < stuff->hsyncend ||
+ stuff->vsyncstart < stuff->vdisplay ||
+ stuff->vsyncend < stuff->vsyncstart ||
+ stuff->vtotal < stuff->vsyncend)
+ return BadValue;
+
+ if (stuff->after_hsyncstart < stuff->after_hdisplay ||
+ stuff->after_hsyncend < stuff->after_hsyncstart ||
+ stuff->after_htotal < stuff->after_hsyncend ||
+ stuff->after_vsyncstart < stuff->after_vdisplay ||
+ stuff->after_vsyncend < stuff->after_vsyncstart ||
+ stuff->after_vtotal < stuff->after_vsyncend)
+ return BadValue;
+
+ if (stuff->after_htotal != 0 || stuff->after_vtotal != 0) {
+ Bool found = FALSE;
+ if (VidModeGetFirstModeline(stuff->screen, &mode, &dotClock)) {
+ do {
+ if ((VidModeGetDotClock(stuff->screen, stuff->dotclock)
+ == dotClock) && MODEMATCH(mode, stuff)) {
+ found = TRUE;
+ break;
+ }
+ } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
+ }
+ if (!found)
+ return BadValue;
+ }
+
+
+ mode = VidModeCreateMode();
+ if (mode == NULL)
+ return BadValue;
+
+ VidModeSetModeValue(mode, VIDMODE_CLOCK, stuff->dotclock);
+ VidModeSetModeValue(mode, VIDMODE_H_DISPLAY, stuff->hdisplay);
+ VidModeSetModeValue(mode, VIDMODE_H_SYNCSTART, stuff->hsyncstart);
+ VidModeSetModeValue(mode, VIDMODE_H_SYNCEND, stuff->hsyncend);
+ VidModeSetModeValue(mode, VIDMODE_H_TOTAL, stuff->htotal);
+ VidModeSetModeValue(mode, VIDMODE_H_SKEW, stuff->hskew);
+ VidModeSetModeValue(mode, VIDMODE_V_DISPLAY, stuff->vdisplay);
+ VidModeSetModeValue(mode, VIDMODE_V_SYNCSTART, stuff->vsyncstart);
+ VidModeSetModeValue(mode, VIDMODE_V_SYNCEND, stuff->vsyncend);
+ VidModeSetModeValue(mode, VIDMODE_V_TOTAL, stuff->vtotal);
+ VidModeSetModeValue(mode, VIDMODE_FLAGS, stuff->flags);
+
+ if (stuff->privsize)
+ ErrorF("AddModeLine - Privates in request have been ignored\n");
+
+ /* Check that the mode is consistent with the monitor specs */
+ switch (VidModeCheckModeForMonitor(stuff->screen, mode)) {
+ case MODE_OK:
+ break;
+ case MODE_HSYNC:
+ case MODE_H_ILLEGAL:
+ free(mode);
+ return VidModeErrorBase + XF86VidModeBadHTimings;
+ case MODE_VSYNC:
+ case MODE_V_ILLEGAL:
+ free(mode);
+ return VidModeErrorBase + XF86VidModeBadVTimings;
+ default:
+ free(mode);
+ return VidModeErrorBase + XF86VidModeModeUnsuitable;
+ }
+
+ /* Check that the driver is happy with the mode */
+ if (VidModeCheckModeForDriver(stuff->screen, mode) != MODE_OK) {
+ free(mode);
+ return VidModeErrorBase + XF86VidModeModeUnsuitable;
+ }
+
+ VidModeSetCrtcForMode(stuff->screen, mode);
+
+ VidModeAddModeline(stuff->screen, mode);
+
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
+ ErrorF("AddModeLine - Succeeded\n");
+ return Success;
+}
+
+static int
+ProcXF86VidModeDeleteModeLine(ClientPtr client)
+{
+ REQUEST(xXF86VidModeDeleteModeLineReq);
+ xXF86OldVidModeDeleteModeLineReq *oldstuff =
+ (xXF86OldVidModeDeleteModeLineReq *)client->requestBuffer;
+ xXF86VidModeDeleteModeLineReq newstuff;
+ pointer mode;
+ int len, dotClock;
+ int ver;
+
+ DEBUG_P("XF86VidModeDeleteModeline");
+
+ ver = ClientMajorVersion(client);
+ if (ver < 2) {
+ /* convert from old format */
+ stuff = &newstuff;
+ stuff->length = oldstuff->length;
+ stuff->screen = oldstuff->screen;
+ stuff->dotclock = oldstuff->dotclock;
+ stuff->hdisplay = oldstuff->hdisplay;
+ stuff->hsyncstart = oldstuff->hsyncstart;
+ stuff->hsyncend = oldstuff->hsyncend;
+ stuff->htotal = oldstuff->htotal;
+ stuff->hskew = 0;
+ stuff->vdisplay = oldstuff->vdisplay;
+ stuff->vsyncstart = oldstuff->vsyncstart;
+ stuff->vsyncend = oldstuff->vsyncend;
+ stuff->vtotal = oldstuff->vtotal;
+ stuff->flags = oldstuff->flags;
+ stuff->privsize = oldstuff->privsize;
+ }
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
+ ErrorF("DeleteModeLine - scrn: %d clock: %ld\n",
+ (int)stuff->screen, (unsigned long)stuff->dotclock);
+ ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ stuff->hdisplay, stuff->hsyncstart,
+ stuff->hsyncend, stuff->htotal);
+ ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
+ stuff->vtotal, (unsigned long)stuff->flags);
+ }
+
+ if (ver < 2) {
+ REQUEST_AT_LEAST_SIZE(xXF86OldVidModeDeleteModeLineReq);
+ len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeDeleteModeLineReq));
+ } else {
+ REQUEST_AT_LEAST_SIZE(xXF86VidModeDeleteModeLineReq);
+ len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeDeleteModeLineReq));
+ }
+ if (len != stuff->privsize) {
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
+ ErrorF("req_len = %ld, sizeof(Req) = %d, privsize = %ld, "
+ "len = %d, length = %d\n",
+ (unsigned long)client->req_len,
+ (int)sizeof(xXF86VidModeDeleteModeLineReq)>>2,
+ (unsigned long)stuff->privsize, len, stuff->length);
+ }
+ return BadLength;
+ }
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
+ return BadValue;
+
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
+ ErrorF("Checking against clock: %d (%d)\n",
+ VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
+ ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
+ VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
+ VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
+ VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
+ ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
+ VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
+ VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
+ VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
+ VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
+ VidModeGetModeValue(mode, VIDMODE_FLAGS));
+ }
+ if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) &&
+ MODEMATCH(mode, stuff))
+ return BadValue;
+
+ if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock))
+ return BadValue;
+
+ do {
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
+ ErrorF("Checking against clock: %d (%d)\n",
+ VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
+ ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
+ VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
+ VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
+ VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
+ ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
+ VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
+ VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
+ VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
+ VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
+ VidModeGetModeValue(mode, VIDMODE_FLAGS));
+ }
+ if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) &&
+ MODEMATCH(mode, stuff)) {
+ VidModeDeleteModeline(stuff->screen, mode);
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
+ ErrorF("DeleteModeLine - Succeeded\n");
+ return Success;
+ }
+ } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
+
+ return BadValue;
+}
+
+static int
+ProcXF86VidModeModModeLine(ClientPtr client)
+{
+ REQUEST(xXF86VidModeModModeLineReq);
+ xXF86OldVidModeModModeLineReq *oldstuff =
+ (xXF86OldVidModeModModeLineReq *)client->requestBuffer;
+ xXF86VidModeModModeLineReq newstuff;
+ pointer mode, modetmp;
+ int len, dotClock;
+ int ver;
+
+ DEBUG_P("XF86VidModeModModeline");
+
+ ver = ClientMajorVersion(client);
+ if (ver < 2 ) {
+ /* convert from old format */
+ stuff = &newstuff;
+ stuff->length = oldstuff->length;
+ stuff->screen = oldstuff->screen;
+ stuff->hdisplay = oldstuff->hdisplay;
+ stuff->hsyncstart = oldstuff->hsyncstart;
+ stuff->hsyncend = oldstuff->hsyncend;
+ stuff->htotal = oldstuff->htotal;
+ stuff->hskew = 0;
+ stuff->vdisplay = oldstuff->vdisplay;
+ stuff->vsyncstart = oldstuff->vsyncstart;
+ stuff->vsyncend = oldstuff->vsyncend;
+ stuff->vtotal = oldstuff->vtotal;
+ stuff->flags = oldstuff->flags;
+ stuff->privsize = oldstuff->privsize;
+ }
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
+ ErrorF("ModModeLine - scrn: %d hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ (int)stuff->screen, stuff->hdisplay, stuff->hsyncstart,
+ stuff->hsyncend, stuff->htotal);
+ ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
+ stuff->vtotal, (unsigned long)stuff->flags);
+ }
+
+ if (ver < 2) {
+ REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq);
+ len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeModModeLineReq));
+ } else {
+ REQUEST_AT_LEAST_SIZE(xXF86VidModeModModeLineReq);
+ len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeModModeLineReq));
+ }
+ if (len != stuff->privsize)
+ return BadLength;
+
+ if (stuff->hsyncstart < stuff->hdisplay ||
+ stuff->hsyncend < stuff->hsyncstart ||
+ stuff->htotal < stuff->hsyncend ||
+ stuff->vsyncstart < stuff->vdisplay ||
+ stuff->vsyncend < stuff->vsyncstart ||
+ stuff->vtotal < stuff->vsyncend)
+ return BadValue;
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
+ return BadValue;
+
+ modetmp = VidModeCreateMode();
+ VidModeCopyMode(mode, modetmp);
+
+ VidModeSetModeValue(modetmp, VIDMODE_H_DISPLAY, stuff->hdisplay);
+ VidModeSetModeValue(modetmp, VIDMODE_H_SYNCSTART, stuff->hsyncstart);
+ VidModeSetModeValue(modetmp, VIDMODE_H_SYNCEND, stuff->hsyncend);
+ VidModeSetModeValue(modetmp, VIDMODE_H_TOTAL, stuff->htotal);
+ VidModeSetModeValue(modetmp, VIDMODE_H_SKEW, stuff->hskew);
+ VidModeSetModeValue(modetmp, VIDMODE_V_DISPLAY, stuff->vdisplay);
+ VidModeSetModeValue(modetmp, VIDMODE_V_SYNCSTART, stuff->vsyncstart);
+ VidModeSetModeValue(modetmp, VIDMODE_V_SYNCEND, stuff->vsyncend);
+ VidModeSetModeValue(modetmp, VIDMODE_V_TOTAL, stuff->vtotal);
+ VidModeSetModeValue(modetmp, VIDMODE_FLAGS, stuff->flags);
+
+ if (stuff->privsize)
+ ErrorF("ModModeLine - Privates in request have been ignored\n");
+
+ /* Check that the mode is consistent with the monitor specs */
+ switch (VidModeCheckModeForMonitor(stuff->screen, modetmp)) {
+ case MODE_OK:
+ break;
+ case MODE_HSYNC:
+ case MODE_H_ILLEGAL:
+ free(modetmp);
+ return VidModeErrorBase + XF86VidModeBadHTimings;
+ case MODE_VSYNC:
+ case MODE_V_ILLEGAL:
+ free(modetmp);
+ return VidModeErrorBase + XF86VidModeBadVTimings;
+ default:
+ free(modetmp);
+ return VidModeErrorBase + XF86VidModeModeUnsuitable;
+ }
+
+ /* Check that the driver is happy with the mode */
+ if (VidModeCheckModeForDriver(stuff->screen, modetmp) != MODE_OK) {
+ free(modetmp);
+ return VidModeErrorBase + XF86VidModeModeUnsuitable;
+ }
+ free(modetmp);
+
+ VidModeSetModeValue(mode, VIDMODE_H_DISPLAY, stuff->hdisplay);
+ VidModeSetModeValue(mode, VIDMODE_H_SYNCSTART, stuff->hsyncstart);
+ VidModeSetModeValue(mode, VIDMODE_H_SYNCEND, stuff->hsyncend);
+ VidModeSetModeValue(mode, VIDMODE_H_TOTAL, stuff->htotal);
+ VidModeSetModeValue(mode, VIDMODE_H_SKEW, stuff->hskew);
+ VidModeSetModeValue(mode, VIDMODE_V_DISPLAY, stuff->vdisplay);
+ VidModeSetModeValue(mode, VIDMODE_V_SYNCSTART, stuff->vsyncstart);
+ VidModeSetModeValue(mode, VIDMODE_V_SYNCEND, stuff->vsyncend);
+ VidModeSetModeValue(mode, VIDMODE_V_TOTAL, stuff->vtotal);
+ VidModeSetModeValue(mode, VIDMODE_FLAGS, stuff->flags);
+
+ VidModeSetCrtcForMode(stuff->screen, mode);
+ VidModeSwitchMode(stuff->screen, mode);
+
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
+ ErrorF("ModModeLine - Succeeded\n");
+ return Success;
+}
+
+static int
+ProcXF86VidModeValidateModeLine(ClientPtr client)
+{
+ REQUEST(xXF86VidModeValidateModeLineReq);
+ xXF86OldVidModeValidateModeLineReq *oldstuff =
+ (xXF86OldVidModeValidateModeLineReq *)client->requestBuffer;
+ xXF86VidModeValidateModeLineReq newstuff;
+ xXF86VidModeValidateModeLineReply rep;
+ pointer mode, modetmp = NULL;
+ int len, status, dotClock;
+ int ver;
+
+ DEBUG_P("XF86VidModeValidateModeline");
+
+ ver = ClientMajorVersion(client);
+ if (ver < 2) {
+ /* convert from old format */
+ stuff = &newstuff;
+ stuff->length = oldstuff->length;
+ stuff->screen = oldstuff->screen;
+ stuff->dotclock = oldstuff->dotclock;
+ stuff->hdisplay = oldstuff->hdisplay;
+ stuff->hsyncstart = oldstuff->hsyncstart;
+ stuff->hsyncend = oldstuff->hsyncend;
+ stuff->htotal = oldstuff->htotal;
+ stuff->hskew = 0;
+ stuff->vdisplay = oldstuff->vdisplay;
+ stuff->vsyncstart = oldstuff->vsyncstart;
+ stuff->vsyncend = oldstuff->vsyncend;
+ stuff->vtotal = oldstuff->vtotal;
+ stuff->flags = oldstuff->flags;
+ stuff->privsize = oldstuff->privsize;
+ }
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
+ ErrorF("ValidateModeLine - scrn: %d clock: %ld\n",
+ (int)stuff->screen, (unsigned long)stuff->dotclock);
+ ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ stuff->hdisplay, stuff->hsyncstart,
+ stuff->hsyncend, stuff->htotal);
+ ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
+ stuff->vtotal, (unsigned long)stuff->flags);
+ }
+
+ if (ver < 2) {
+ REQUEST_AT_LEAST_SIZE(xXF86OldVidModeValidateModeLineReq);
+ len = client->req_len -
+ bytes_to_int32(sizeof(xXF86OldVidModeValidateModeLineReq));
+ } else {
+ REQUEST_AT_LEAST_SIZE(xXF86VidModeValidateModeLineReq);
+ len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeValidateModeLineReq));
+ }
+ if (len != stuff->privsize)
+ return BadLength;
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ status = MODE_OK;
+
+ if (stuff->hsyncstart < stuff->hdisplay ||
+ stuff->hsyncend < stuff->hsyncstart ||
+ stuff->htotal < stuff->hsyncend ||
+ stuff->vsyncstart < stuff->vdisplay ||
+ stuff->vsyncend < stuff->vsyncstart ||
+ stuff->vtotal < stuff->vsyncend)
+ {
+ status = MODE_BAD;
+ goto status_reply;
+ }
+
+ if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
+ return BadValue;
+
+ modetmp = VidModeCreateMode();
+ VidModeCopyMode(mode, modetmp);
+
+ VidModeSetModeValue(modetmp, VIDMODE_H_DISPLAY, stuff->hdisplay);
+ VidModeSetModeValue(modetmp, VIDMODE_H_SYNCSTART, stuff->hsyncstart);
+ VidModeSetModeValue(modetmp, VIDMODE_H_SYNCEND, stuff->hsyncend);
+ VidModeSetModeValue(modetmp, VIDMODE_H_TOTAL, stuff->htotal);
+ VidModeSetModeValue(modetmp, VIDMODE_H_SKEW, stuff->hskew);
+ VidModeSetModeValue(modetmp, VIDMODE_V_DISPLAY, stuff->vdisplay);
+ VidModeSetModeValue(modetmp, VIDMODE_V_SYNCSTART, stuff->vsyncstart);
+ VidModeSetModeValue(modetmp, VIDMODE_V_SYNCEND, stuff->vsyncend);
+ VidModeSetModeValue(modetmp, VIDMODE_V_TOTAL, stuff->vtotal);
+ VidModeSetModeValue(modetmp, VIDMODE_FLAGS, stuff->flags);
+ if (stuff->privsize)
+ ErrorF("ValidateModeLine - Privates in request have been ignored\n");
+
+ /* Check that the mode is consistent with the monitor specs */
+ if ((status = VidModeCheckModeForMonitor(stuff->screen, modetmp)) != MODE_OK)
+ goto status_reply;
+
+ /* Check that the driver is happy with the mode */
+ status = VidModeCheckModeForDriver(stuff->screen, modetmp);
+
+status_reply:
+ free(modetmp);
+
+ rep.type = X_Reply;
+ rep.length = bytes_to_int32(SIZEOF(xXF86VidModeValidateModeLineReply)
+ - SIZEOF(xGenericReply));
+ rep.sequenceNumber = client->sequence;
+ rep.status = status;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.status);
+ }
+ WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply), (char *)&rep);
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
+ ErrorF("ValidateModeLine - Succeeded (status = %d)\n", status);
+ return Success;
+}
+
+static int
+ProcXF86VidModeSwitchMode(ClientPtr client)
+{
+ REQUEST(xXF86VidModeSwitchModeReq);
+
+ DEBUG_P("XF86VidModeSwitchMode");
+
+ REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ VidModeZoomViewport(stuff->screen, (short)stuff->zoom);
+
+ return Success;
+}
+
+static int
+ProcXF86VidModeSwitchToMode(ClientPtr client)
+{
+ REQUEST(xXF86VidModeSwitchToModeReq);
+ xXF86OldVidModeSwitchToModeReq *oldstuff =
+ (xXF86OldVidModeSwitchToModeReq *)client->requestBuffer;
+ xXF86VidModeSwitchToModeReq newstuff;
+ pointer mode;
+ int len, dotClock;
+ int ver;
+
+ DEBUG_P("XF86VidModeSwitchToMode");
+
+ ver = ClientMajorVersion(client);
+ if (ver < 2) {
+ /* convert from old format */
+ stuff = &newstuff;
+ stuff->length = oldstuff->length;
+ stuff->screen = oldstuff->screen;
+ stuff->dotclock = oldstuff->dotclock;
+ stuff->hdisplay = oldstuff->hdisplay;
+ stuff->hsyncstart = oldstuff->hsyncstart;
+ stuff->hsyncend = oldstuff->hsyncend;
+ stuff->htotal = oldstuff->htotal;
+ stuff->hskew = 0;
+ stuff->vdisplay = oldstuff->vdisplay;
+ stuff->vsyncstart = oldstuff->vsyncstart;
+ stuff->vsyncend = oldstuff->vsyncend;
+ stuff->vtotal = oldstuff->vtotal;
+ stuff->flags = oldstuff->flags;
+ stuff->privsize = oldstuff->privsize;
+ }
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
+ ErrorF("SwitchToMode - scrn: %d clock: %ld\n",
+ (int)stuff->screen, (unsigned long)stuff->dotclock);
+ ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ stuff->hdisplay, stuff->hsyncstart,
+ stuff->hsyncend, stuff->htotal);
+ ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %ld\n",
+ stuff->vdisplay, stuff->vsyncstart, stuff->vsyncend,
+ stuff->vtotal, (unsigned long)stuff->flags);
+ }
+
+ if (ver < 2) {
+ REQUEST_AT_LEAST_SIZE(xXF86OldVidModeSwitchToModeReq);
+ len = client->req_len - bytes_to_int32(sizeof(xXF86OldVidModeSwitchToModeReq));
+ } else {
+ REQUEST_AT_LEAST_SIZE(xXF86VidModeSwitchToModeReq);
+ len = client->req_len - bytes_to_int32(sizeof(xXF86VidModeSwitchToModeReq));
+ }
+ if (len != stuff->privsize)
+ return BadLength;
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock))
+ return BadValue;
+
+ if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock)
+ && MODEMATCH(mode, stuff))
+ return Success;
+
+ if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock))
+ return BadValue;
+
+ do {
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) {
+ ErrorF("Checking against clock: %d (%d)\n",
+ VidModeGetModeValue(mode, VIDMODE_CLOCK), dotClock);
+ ErrorF(" hdsp: %d hbeg: %d hend: %d httl: %d\n",
+ VidModeGetModeValue(mode, VIDMODE_H_DISPLAY),
+ VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART),
+ VidModeGetModeValue(mode, VIDMODE_H_SYNCEND),
+ VidModeGetModeValue(mode, VIDMODE_H_TOTAL));
+ ErrorF(" vdsp: %d vbeg: %d vend: %d vttl: %d flags: %d\n",
+ VidModeGetModeValue(mode, VIDMODE_V_DISPLAY),
+ VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART),
+ VidModeGetModeValue(mode, VIDMODE_V_SYNCEND),
+ VidModeGetModeValue(mode, VIDMODE_V_TOTAL),
+ VidModeGetModeValue(mode, VIDMODE_FLAGS));
+ }
+ if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) &&
+ MODEMATCH(mode, stuff)) {
+
+ if (!VidModeSwitchMode(stuff->screen, mode))
+ return BadValue;
+
+ if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY)
+ ErrorF("SwitchToMode - Succeeded\n");
+ return Success;
+ }
+ } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock));
+
+ return BadValue;
+}
+
+static int
+ProcXF86VidModeLockModeSwitch(ClientPtr client)
+{
+ REQUEST(xXF86VidModeLockModeSwitchReq);
+
+ REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq);
+
+ DEBUG_P("XF86VidModeLockModeSwitch");
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ if (!VidModeLockZoom(stuff->screen, (short)stuff->lock))
+ return VidModeErrorBase + XF86VidModeZoomLocked;
+
+ return Success;
+}
+
+static int
+ProcXF86VidModeGetMonitor(ClientPtr client)
+{
+ REQUEST(xXF86VidModeGetMonitorReq);
+ xXF86VidModeGetMonitorReply rep;
+ CARD32 *hsyncdata, *vsyncdata;
+ int i, nHsync, nVrefresh;
+ pointer monitor;
+
+ DEBUG_P("XF86VidModeGetMonitor");
+
+ REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ if (!VidModeGetMonitor(stuff->screen, &monitor))
+ return BadValue;
+
+ nHsync = VidModeGetMonitorValue(monitor, VIDMODE_MON_NHSYNC, 0).i;
+ nVrefresh = VidModeGetMonitorValue(monitor, VIDMODE_MON_NVREFRESH, 0).i;
+
+ rep.type = X_Reply;
+ if ((char *)(VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, 0)).ptr)
+ rep.vendorLength = strlen((char *)(VidModeGetMonitorValue(monitor,
+ VIDMODE_MON_VENDOR, 0)).ptr);
+ else
+ rep.vendorLength = 0;
+ if ((char *)(VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr)
+ rep.modelLength = strlen((char *)(VidModeGetMonitorValue(monitor,
+ VIDMODE_MON_MODEL, 0)).ptr);
+ else
+ rep.modelLength = 0;
+ rep.length = bytes_to_int32(SIZEOF(xXF86VidModeGetMonitorReply) - SIZEOF(xGenericReply) +
+ (nHsync + nVrefresh) * sizeof(CARD32) +
+ pad_to_int32(rep.vendorLength) +
+ pad_to_int32(rep.modelLength));
+ rep.sequenceNumber = client->sequence;
+ rep.nhsync = nHsync;
+ rep.nvsync = nVrefresh;
+ hsyncdata = malloc(nHsync * sizeof(CARD32));
+ if (!hsyncdata) {
+ return BadAlloc;
+ }
+
+ vsyncdata = malloc(nVrefresh * sizeof(CARD32));
+ if (!vsyncdata) {
+ free(hsyncdata);
+ return BadAlloc;
+ }
+
+ for (i = 0; i < nHsync; i++) {
+ hsyncdata[i] = (unsigned short)(VidModeGetMonitorValue(monitor,
+ VIDMODE_MON_HSYNC_LO, i)).f |
+ (unsigned short)(VidModeGetMonitorValue(monitor,
+ VIDMODE_MON_HSYNC_HI, i)).f << 16;
+ }
+ for (i = 0; i < nVrefresh; i++) {
+ vsyncdata[i] = (unsigned short)(VidModeGetMonitorValue(monitor,
+ VIDMODE_MON_VREFRESH_LO, i)).f |
+ (unsigned short)(VidModeGetMonitorValue(monitor,
+ VIDMODE_MON_VREFRESH_HI, i)).f << 16;
+ }
+
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ }
+ WriteToClient(client, SIZEOF(xXF86VidModeGetMonitorReply), (char *)&rep);
+ client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
+ WriteSwappedDataToClient(client, nHsync * sizeof(CARD32),
+ hsyncdata);
+ WriteSwappedDataToClient(client, nVrefresh * sizeof(CARD32),
+ vsyncdata);
+ if (rep.vendorLength)
+ WriteToClient(client, rep.vendorLength, (char *)(VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, 0)).ptr);
+ if (rep.modelLength)
+ WriteToClient(client, rep.modelLength, (char *)(VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr);
+
+ free(hsyncdata);
+ free(vsyncdata);
+
+ return Success;
+}
+
+static int
+ProcXF86VidModeGetViewPort(ClientPtr client)
+{
+ REQUEST(xXF86VidModeGetViewPortReq);
+ xXF86VidModeGetViewPortReply rep;
+ int x, y;
+
+ DEBUG_P("XF86VidModeGetViewPort");
+
+ REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ VidModeGetViewPort(stuff->screen, &x, &y);
+ rep.x = x;
+ rep.y = y;
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.x);
+ swapl(&rep.y);
+ }
+ WriteToClient(client, SIZEOF(xXF86VidModeGetViewPortReply), (char *)&rep);
+ return Success;
+}
+
+static int
+ProcXF86VidModeSetViewPort(ClientPtr client)
+{
+ REQUEST(xXF86VidModeSetViewPortReq);
+
+ DEBUG_P("XF86VidModeSetViewPort");
+
+ REQUEST_SIZE_MATCH(xXF86VidModeSetViewPortReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ if (!VidModeSetViewPort(stuff->screen, stuff->x, stuff->y))
+ return BadValue;
+
+ return Success;
+}
+
+static int
+ProcXF86VidModeGetDotClocks(ClientPtr client)
+{
+ REQUEST(xXF86VidModeGetDotClocksReq);
+ xXF86VidModeGetDotClocksReply rep;
+ int n;
+ int numClocks;
+ CARD32 dotclock;
+ int *Clocks = NULL;
+ Bool ClockProg;
+
+ DEBUG_P("XF86VidModeGetDotClocks");
+
+ REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ numClocks = VidModeGetNumOfClocks(stuff->screen, &ClockProg);
+
+ rep.type = X_Reply;
+ rep.length = bytes_to_int32(SIZEOF(xXF86VidModeGetDotClocksReply)
+ - SIZEOF(xGenericReply) + numClocks);
+ rep.sequenceNumber = client->sequence;
+ rep.clocks = numClocks;
+ rep.maxclocks = MAXCLOCKS;
+ rep.flags = 0;
+
+ if (!ClockProg) {
+ Clocks = malloc(numClocks * sizeof(int));
+ if (!Clocks)
+ return BadValue;
+ if (!VidModeGetClocks(stuff->screen, Clocks)) {
+ free(Clocks);
+ return BadValue;
+ }
+ }
+
+ if (ClockProg) {
+ rep.flags |= CLKFLAG_PROGRAMABLE;
+ }
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.clocks);
+ swapl(&rep.maxclocks);
+ swapl(&rep.flags);
+ }
+ WriteToClient(client, sizeof(xXF86VidModeGetDotClocksReply), (char *)&rep);
+ if (!ClockProg) {
+ for (n = 0; n < numClocks; n++) {
+ dotclock = *Clocks++;
+ if (client->swapped) {
+ WriteSwappedDataToClient(client, 4, (char *)&dotclock);
+ } else {
+ WriteToClient(client, 4, (char *)&dotclock);
+ }
+ }
+ }
+
+ free(Clocks);
+ return Success;
+}
+
+static int
+ProcXF86VidModeSetGamma(ClientPtr client)
+{
+ REQUEST(xXF86VidModeSetGammaReq);
+
+ DEBUG_P("XF86VidModeSetGamma");
+
+ REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ if (!VidModeSetGamma(stuff->screen, ((float)stuff->red)/10000.,
+ ((float)stuff->green)/10000., ((float)stuff->blue)/10000.))
+ return BadValue;
+
+ return Success;
+}
+
+static int
+ProcXF86VidModeGetGamma(ClientPtr client)
+{
+ REQUEST(xXF86VidModeGetGammaReq);
+ xXF86VidModeGetGammaReply rep;
+ float red, green, blue;
+
+ DEBUG_P("XF86VidModeGetGamma");
+
+ REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ if (!VidModeGetGamma(stuff->screen, &red, &green, &blue))
+ return BadValue;
+ rep.red = (CARD32)(red * 10000.);
+ rep.green = (CARD32)(green * 10000.);
+ rep.blue = (CARD32)(blue * 10000.);
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.red);
+ swapl(&rep.green);
+ swapl(&rep.blue);
+ }
+ WriteToClient(client, sizeof(xXF86VidModeGetGammaReply), (char *)&rep);
+ return Success;
+}
+
+static int
+ProcXF86VidModeSetGammaRamp(ClientPtr client)
+{
+ CARD16 *r, *g, *b;
+ int length;
+ REQUEST(xXF86VidModeSetGammaRampReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ if(stuff->size != VidModeGetGammaRampSize(stuff->screen))
+ return BadValue;
+
+ length = (stuff->size + 1) & ~1;
+
+ REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length * 6);
+
+ r = (CARD16*)&stuff[1];
+ g = r + length;
+ b = g + length;
+
+ if (!VidModeSetGammaRamp(stuff->screen, stuff->size, r, g, b))
+ return BadValue;
+
+ return Success;
+}
+
+static int
+ProcXF86VidModeGetGammaRamp(ClientPtr client)
+{
+ CARD16 *ramp = NULL;
+ int length;
+ size_t ramplen = 0;
+ xXF86VidModeGetGammaRampReply rep;
+ REQUEST(xXF86VidModeGetGammaRampReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ if(stuff->size != VidModeGetGammaRampSize(stuff->screen))
+ return BadValue;
+
+ REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
+
+ length = (stuff->size + 1) & ~1;
+
+ if(stuff->size) {
+ ramplen = length * 3 * sizeof(CARD16);
+ if (!(ramp = malloc(ramplen)))
+ return BadAlloc;
+
+ if (!VidModeGetGammaRamp(stuff->screen, stuff->size,
+ ramp, ramp + length, ramp + (length * 2))) {
+ free(ramp);
+ return BadValue;
+ }
+ }
+
+ rep.type = X_Reply;
+ rep.length = (length >> 1) * 3;
+ rep.sequenceNumber = client->sequence;
+ rep.size = stuff->size;
+ if(client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.size);
+ SwapShorts((short*)ramp, length * 3);
+ }
+ WriteToClient(client, sizeof(xXF86VidModeGetGammaRampReply), (char *)&rep);
+
+ if(stuff->size) {
+ WriteToClient(client, ramplen, (char*)ramp);
+ free(ramp);
+ }
+
+ return Success;
+}
+
+
+static int
+ProcXF86VidModeGetGammaRampSize(ClientPtr client)
+{
+ xXF86VidModeGetGammaRampSizeReply rep;
+ REQUEST(xXF86VidModeGetGammaRampSizeReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.size = VidModeGetGammaRampSize(stuff->screen);
+ if(client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.size);
+ }
+ WriteToClient(client,sizeof(xXF86VidModeGetGammaRampSizeReply),(char*)&rep);
+
+ return Success;
+}
+
+static int
+ProcXF86VidModeGetPermissions(ClientPtr client)
+{
+ xXF86VidModeGetPermissionsReply rep;
+ REQUEST(xXF86VidModeGetPermissionsReq);
+
+ if(stuff->screen >= screenInfo.numScreens)
+ return BadValue;
+
+ REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq);
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.permissions = XF86VM_READ_PERMISSION;
+ if (xf86GetVidModeEnabled() &&
+ (xf86GetVidModeAllowNonLocal() || LocalClient (client))) {
+ rep.permissions |= XF86VM_WRITE_PERMISSION;
+ }
+ if(client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.permissions);
+ }
+ WriteToClient(client,sizeof(xXF86VidModeGetPermissionsReply),(char*)&rep);
+
+ return Success;
+}
+
+
+static int
+ProcXF86VidModeSetClientVersion(ClientPtr client)
+{
+ REQUEST(xXF86VidModeSetClientVersionReq);
+
+ VidModePrivPtr pPriv;
+
+ DEBUG_P("XF86VidModeSetClientVersion");
+
+ REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq);
+
+ if ((pPriv = VM_GETPRIV(client)) == NULL) {
+ pPriv = malloc(sizeof(VidModePrivRec));
+ if (!pPriv)
+ return BadAlloc;
+ VM_SETPRIV(client, pPriv);
+ }
+ pPriv->major = stuff->major;
+ pPriv->minor = stuff->minor;
+
+ return Success;
+}
+
+static int
+ProcXF86VidModeDispatch(ClientPtr client)
+{
+ REQUEST(xReq);
+ switch (stuff->data)
+ {
+ case X_XF86VidModeQueryVersion:
+ return ProcXF86VidModeQueryVersion(client);
+ case X_XF86VidModeGetModeLine:
+ return ProcXF86VidModeGetModeLine(client);
+ case X_XF86VidModeGetMonitor:
+ return ProcXF86VidModeGetMonitor(client);
+ case X_XF86VidModeGetAllModeLines:
+ return ProcXF86VidModeGetAllModeLines(client);
+ case X_XF86VidModeValidateModeLine:
+ return ProcXF86VidModeValidateModeLine(client);
+ case X_XF86VidModeGetViewPort:
+ return ProcXF86VidModeGetViewPort(client);
+ case X_XF86VidModeGetDotClocks:
+ return ProcXF86VidModeGetDotClocks(client);
+ case X_XF86VidModeSetClientVersion:
+ return ProcXF86VidModeSetClientVersion(client);
+ case X_XF86VidModeGetGamma:
+ return ProcXF86VidModeGetGamma(client);
+ case X_XF86VidModeGetGammaRamp:
+ return ProcXF86VidModeGetGammaRamp(client);
+ case X_XF86VidModeGetGammaRampSize:
+ return ProcXF86VidModeGetGammaRampSize(client);
+ case X_XF86VidModeGetPermissions:
+ return ProcXF86VidModeGetPermissions(client);
+ default:
+ if (!xf86GetVidModeEnabled())
+ return VidModeErrorBase + XF86VidModeExtensionDisabled;
+ if (xf86GetVidModeAllowNonLocal() || LocalClient (client)) {
+ switch (stuff->data) {
+ case X_XF86VidModeAddModeLine:
+ return ProcXF86VidModeAddModeLine(client);
+ case X_XF86VidModeDeleteModeLine:
+ return ProcXF86VidModeDeleteModeLine(client);
+ case X_XF86VidModeModModeLine:
+ return ProcXF86VidModeModModeLine(client);
+ case X_XF86VidModeSwitchMode:
+ return ProcXF86VidModeSwitchMode(client);
+ case X_XF86VidModeSwitchToMode:
+ return ProcXF86VidModeSwitchToMode(client);
+ case X_XF86VidModeLockModeSwitch:
+ return ProcXF86VidModeLockModeSwitch(client);
+ case X_XF86VidModeSetViewPort:
+ return ProcXF86VidModeSetViewPort(client);
+ case X_XF86VidModeSetGamma:
+ return ProcXF86VidModeSetGamma(client);
+ case X_XF86VidModeSetGammaRamp:
+ return ProcXF86VidModeSetGammaRamp(client);
+ default:
+ return BadRequest;
+ }
+ } else
+ return VidModeErrorBase + XF86VidModeClientNotLocal;
+ }
+}
+
+static int
+SProcXF86VidModeQueryVersion(ClientPtr client)
+{
+ REQUEST(xXF86VidModeQueryVersionReq);
+ swaps(&stuff->length);
+ return ProcXF86VidModeQueryVersion(client);
+}
+
+static int
+SProcXF86VidModeGetModeLine(ClientPtr client)
+{
+ REQUEST(xXF86VidModeGetModeLineReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq);
+ swaps(&stuff->screen);
+ return ProcXF86VidModeGetModeLine(client);
+}
+
+static int
+SProcXF86VidModeGetAllModeLines(ClientPtr client)
+{
+ REQUEST(xXF86VidModeGetAllModeLinesReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXF86VidModeGetAllModeLinesReq);
+ swaps(&stuff->screen);
+ return ProcXF86VidModeGetAllModeLines(client);
+}
+
+static int
+SProcXF86VidModeAddModeLine(ClientPtr client)
+{
+ xXF86OldVidModeAddModeLineReq *oldstuff =
+ (xXF86OldVidModeAddModeLineReq *)client->requestBuffer;
+ int ver;
+
+ REQUEST(xXF86VidModeAddModeLineReq);
+ ver = ClientMajorVersion(client);
+ if (ver < 2) {
+ swaps(&oldstuff->length);
+ REQUEST_AT_LEAST_SIZE(xXF86OldVidModeAddModeLineReq);
+ swapl(&oldstuff->screen);
+ swaps(&oldstuff->hdisplay);
+ swaps(&oldstuff->hsyncstart);
+ swaps(&oldstuff->hsyncend);
+ swaps(&oldstuff->htotal);
+ swaps(&oldstuff->vdisplay);
+ swaps(&oldstuff->vsyncstart);
+ swaps(&oldstuff->vsyncend);
+ swaps(&oldstuff->vtotal);
+ swapl(&oldstuff->flags);
+ swapl(&oldstuff->privsize);
+ SwapRestL(oldstuff);
+ } else {
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xXF86VidModeAddModeLineReq);
+ swapl(&stuff->screen);
+ swaps(&stuff->hdisplay);
+ swaps(&stuff->hsyncstart);
+ swaps(&stuff->hsyncend);
+ swaps(&stuff->htotal);
+ swaps(&stuff->hskew);
+ swaps(&stuff->vdisplay);
+ swaps(&stuff->vsyncstart);
+ swaps(&stuff->vsyncend);
+ swaps(&stuff->vtotal);
+ swapl(&stuff->flags);
+ swapl(&stuff->privsize);
+ SwapRestL(stuff);
+ }
+ return ProcXF86VidModeAddModeLine(client);
+}
+
+static int
+SProcXF86VidModeDeleteModeLine(ClientPtr client)
+{
+ xXF86OldVidModeDeleteModeLineReq *oldstuff =
+ (xXF86OldVidModeDeleteModeLineReq *)client->requestBuffer;
+ int ver;
+
+ REQUEST(xXF86VidModeDeleteModeLineReq);
+ ver = ClientMajorVersion(client);
+ if (ver < 2) {
+ swaps(&oldstuff->length);
+ REQUEST_AT_LEAST_SIZE(xXF86OldVidModeDeleteModeLineReq);
+ swapl(&oldstuff->screen);
+ swaps(&oldstuff->hdisplay);
+ swaps(&oldstuff->hsyncstart);
+ swaps(&oldstuff->hsyncend);
+ swaps(&oldstuff->htotal);
+ swaps(&oldstuff->vdisplay);
+ swaps(&oldstuff->vsyncstart);
+ swaps(&oldstuff->vsyncend);
+ swaps(&oldstuff->vtotal);
+ swapl(&oldstuff->flags);
+ swapl(&oldstuff->privsize);
+ SwapRestL(oldstuff);
+ } else {
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xXF86VidModeDeleteModeLineReq);
+ swapl(&stuff->screen);
+ swaps(&stuff->hdisplay);
+ swaps(&stuff->hsyncstart);
+ swaps(&stuff->hsyncend);
+ swaps(&stuff->htotal);
+ swaps(&stuff->hskew);
+ swaps(&stuff->vdisplay);
+ swaps(&stuff->vsyncstart);
+ swaps(&stuff->vsyncend);
+ swaps(&stuff->vtotal);
+ swapl(&stuff->flags);
+ swapl(&stuff->privsize);
+ SwapRestL(stuff);
+ }
+ return ProcXF86VidModeDeleteModeLine(client);
+}
+
+static int
+SProcXF86VidModeModModeLine(ClientPtr client)
+{
+ xXF86OldVidModeModModeLineReq *oldstuff =
+ (xXF86OldVidModeModModeLineReq *)client->requestBuffer;
+ int ver;
+
+ REQUEST(xXF86VidModeModModeLineReq);
+ ver = ClientMajorVersion(client);
+ if (ver < 2) {
+ swaps(&oldstuff->length);
+ REQUEST_AT_LEAST_SIZE(xXF86OldVidModeModModeLineReq);
+ swapl(&oldstuff->screen);
+ swaps(&oldstuff->hdisplay);
+ swaps(&oldstuff->hsyncstart);
+ swaps(&oldstuff->hsyncend);
+ swaps(&oldstuff->htotal);
+ swaps(&oldstuff->vdisplay);
+ swaps(&oldstuff->vsyncstart);
+ swaps(&oldstuff->vsyncend);
+ swaps(&oldstuff->vtotal);
+ swapl(&oldstuff->flags);
+ swapl(&oldstuff->privsize);
+ SwapRestL(oldstuff);
+ } else {
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xXF86VidModeModModeLineReq);
+ swapl(&stuff->screen);
+ swaps(&stuff->hdisplay);
+ swaps(&stuff->hsyncstart);
+ swaps(&stuff->hsyncend);
+ swaps(&stuff->htotal);
+ swaps(&stuff->hskew);
+ swaps(&stuff->vdisplay);
+ swaps(&stuff->vsyncstart);
+ swaps(&stuff->vsyncend);
+ swaps(&stuff->vtotal);
+ swapl(&stuff->flags);
+ swapl(&stuff->privsize);
+ SwapRestL(stuff);
+ }
+ return ProcXF86VidModeModModeLine(client);
+}
+
+static int
+SProcXF86VidModeValidateModeLine(ClientPtr client)
+{
+ xXF86OldVidModeValidateModeLineReq *oldstuff =
+ (xXF86OldVidModeValidateModeLineReq *)client->requestBuffer;
+ int ver;
+
+ REQUEST(xXF86VidModeValidateModeLineReq);
+ ver = ClientMajorVersion(client);
+ if (ver < 2) {
+ swaps(&oldstuff->length);
+ REQUEST_AT_LEAST_SIZE(xXF86OldVidModeValidateModeLineReq);
+ swapl(&oldstuff->screen);
+ swaps(&oldstuff->hdisplay);
+ swaps(&oldstuff->hsyncstart);
+ swaps(&oldstuff->hsyncend);
+ swaps(&oldstuff->htotal);
+ swaps(&oldstuff->vdisplay);
+ swaps(&oldstuff->vsyncstart);
+ swaps(&oldstuff->vsyncend);
+ swaps(&oldstuff->vtotal);
+ swapl(&oldstuff->flags);
+ swapl(&oldstuff->privsize);
+ SwapRestL(oldstuff);
+ } else {
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xXF86VidModeValidateModeLineReq);
+ swapl(&stuff->screen);
+ swaps(&stuff->hdisplay);
+ swaps(&stuff->hsyncstart);
+ swaps(&stuff->hsyncend);
+ swaps(&stuff->htotal);
+ swaps(&stuff->hskew);
+ swaps(&stuff->vdisplay);
+ swaps(&stuff->vsyncstart);
+ swaps(&stuff->vsyncend);
+ swaps(&stuff->vtotal);
+ swapl(&stuff->flags);
+ swapl(&stuff->privsize);
+ SwapRestL(stuff);
+ }
+ return ProcXF86VidModeValidateModeLine(client);
+}
+
+static int
+SProcXF86VidModeSwitchMode(ClientPtr client)
+{
+ REQUEST(xXF86VidModeSwitchModeReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXF86VidModeSwitchModeReq);
+ swaps(&stuff->screen);
+ swaps(&stuff->zoom);
+ return ProcXF86VidModeSwitchMode(client);
+}
+
+static int
+SProcXF86VidModeSwitchToMode(ClientPtr client)
+{
+ REQUEST(xXF86VidModeSwitchToModeReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXF86VidModeSwitchToModeReq);
+ swapl(&stuff->screen);
+ return ProcXF86VidModeSwitchToMode(client);
+}
+
+static int
+SProcXF86VidModeLockModeSwitch(ClientPtr client)
+{
+ REQUEST(xXF86VidModeLockModeSwitchReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXF86VidModeLockModeSwitchReq);
+ swaps(&stuff->screen);
+ swaps(&stuff->lock);
+ return ProcXF86VidModeLockModeSwitch(client);
+}
+
+static int
+SProcXF86VidModeGetMonitor(ClientPtr client)
+{
+ REQUEST(xXF86VidModeGetMonitorReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXF86VidModeGetMonitorReq);
+ swaps(&stuff->screen);
+ return ProcXF86VidModeGetMonitor(client);
+}
+
+static int
+SProcXF86VidModeGetViewPort(ClientPtr client)
+{
+ REQUEST(xXF86VidModeGetViewPortReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXF86VidModeGetViewPortReq);
+ swaps(&stuff->screen);
+ return ProcXF86VidModeGetViewPort(client);
+}
+
+static int
+SProcXF86VidModeSetViewPort(ClientPtr client)
+{
+ REQUEST(xXF86VidModeSetViewPortReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXF86VidModeSetViewPortReq);
+ swaps(&stuff->screen);
+ swapl(&stuff->x);
+ swapl(&stuff->y);
+ return ProcXF86VidModeSetViewPort(client);
+}
+
+static int
+SProcXF86VidModeGetDotClocks(ClientPtr client)
+{
+ REQUEST(xXF86VidModeGetDotClocksReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXF86VidModeGetDotClocksReq);
+ swaps(&stuff->screen);
+ return ProcXF86VidModeGetDotClocks(client);
+}
+
+static int
+SProcXF86VidModeSetClientVersion(ClientPtr client)
+{
+ REQUEST(xXF86VidModeSetClientVersionReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXF86VidModeSetClientVersionReq);
+ swaps(&stuff->major);
+ swaps(&stuff->minor);
+ return ProcXF86VidModeSetClientVersion(client);
+}
+
+static int
+SProcXF86VidModeSetGamma(ClientPtr client)
+{
+ REQUEST(xXF86VidModeSetGammaReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXF86VidModeSetGammaReq);
+ swaps(&stuff->screen);
+ swapl(&stuff->red);
+ swapl(&stuff->green);
+ swapl(&stuff->blue);
+ return ProcXF86VidModeSetGamma(client);
+}
+
+static int
+SProcXF86VidModeGetGamma(ClientPtr client)
+{
+ REQUEST(xXF86VidModeGetGammaReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXF86VidModeGetGammaReq);
+ swaps(&stuff->screen);
+ return ProcXF86VidModeGetGamma(client);
+}
+
+static int
+SProcXF86VidModeSetGammaRamp(ClientPtr client)
+{
+ int length;
+ REQUEST(xXF86VidModeSetGammaRampReq);
+ swaps(&stuff->length);
+ REQUEST_AT_LEAST_SIZE(xXF86VidModeSetGammaRampReq);
+ swaps(&stuff->size);
+ swaps(&stuff->screen);
+ length = ((stuff->size + 1) & ~1) * 6;
+ REQUEST_FIXED_SIZE(xXF86VidModeSetGammaRampReq, length);
+ SwapRestS(stuff);
+ return ProcXF86VidModeSetGammaRamp(client);
+}
+
+static int
+SProcXF86VidModeGetGammaRamp(ClientPtr client)
+{
+ REQUEST(xXF86VidModeGetGammaRampReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq);
+ swaps(&stuff->size);
+ swaps(&stuff->screen);
+ return ProcXF86VidModeGetGammaRamp(client);
+}
+
+static int
+SProcXF86VidModeGetGammaRampSize(ClientPtr client)
+{
+ REQUEST(xXF86VidModeGetGammaRampSizeReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq);
+ swaps(&stuff->screen);
+ return ProcXF86VidModeGetGammaRampSize(client);
+}
+
+static int
+SProcXF86VidModeGetPermissions(ClientPtr client)
+{
+ REQUEST(xXF86VidModeGetPermissionsReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq);
+ swaps(&stuff->screen);
+ return ProcXF86VidModeGetPermissions(client);
+}
+
+
+static int
+SProcXF86VidModeDispatch(ClientPtr client)
+{
+ REQUEST(xReq);
+ switch (stuff->data)
+ {
+ case X_XF86VidModeQueryVersion:
+ return SProcXF86VidModeQueryVersion(client);
+ case X_XF86VidModeGetModeLine:
+ return SProcXF86VidModeGetModeLine(client);
+ case X_XF86VidModeGetMonitor:
+ return SProcXF86VidModeGetMonitor(client);
+ case X_XF86VidModeGetAllModeLines:
+ return SProcXF86VidModeGetAllModeLines(client);
+ case X_XF86VidModeGetViewPort:
+ return SProcXF86VidModeGetViewPort(client);
+ case X_XF86VidModeValidateModeLine:
+ return SProcXF86VidModeValidateModeLine(client);
+ case X_XF86VidModeGetDotClocks:
+ return SProcXF86VidModeGetDotClocks(client);
+ case X_XF86VidModeSetClientVersion:
+ return SProcXF86VidModeSetClientVersion(client);
+ case X_XF86VidModeGetGamma:
+ return SProcXF86VidModeGetGamma(client);
+ case X_XF86VidModeGetGammaRamp:
+ return SProcXF86VidModeGetGammaRamp(client);
+ case X_XF86VidModeGetGammaRampSize:
+ return SProcXF86VidModeGetGammaRampSize(client);
+ case X_XF86VidModeGetPermissions:
+ return SProcXF86VidModeGetPermissions(client);
+ default:
+ if (!xf86GetVidModeEnabled())
+ return VidModeErrorBase + XF86VidModeExtensionDisabled;
+ if (xf86GetVidModeAllowNonLocal() || LocalClient(client)) {
+ switch (stuff->data) {
+ case X_XF86VidModeAddModeLine:
+ return SProcXF86VidModeAddModeLine(client);
+ case X_XF86VidModeDeleteModeLine:
+ return SProcXF86VidModeDeleteModeLine(client);
+ case X_XF86VidModeModModeLine:
+ return SProcXF86VidModeModModeLine(client);
+ case X_XF86VidModeSwitchMode:
+ return SProcXF86VidModeSwitchMode(client);
+ case X_XF86VidModeSwitchToMode:
+ return SProcXF86VidModeSwitchToMode(client);
+ case X_XF86VidModeLockModeSwitch:
+ return SProcXF86VidModeLockModeSwitch(client);
+ case X_XF86VidModeSetViewPort:
+ return SProcXF86VidModeSetViewPort(client);
+ case X_XF86VidModeSetGamma:
+ return SProcXF86VidModeSetGamma(client);
+ case X_XF86VidModeSetGammaRamp:
+ return SProcXF86VidModeSetGammaRamp(client);
+ default:
+ return BadRequest;
+ }
+ } else
+ return VidModeErrorBase + XF86VidModeClientNotLocal;
+ }
+}
+
+void
+XFree86VidModeExtensionInit(void)
+{
+ ExtensionEntry* extEntry;
+ ScreenPtr pScreen;
+ int i;
+ Bool enabled = FALSE;
+
+ DEBUG_P("XFree86VidModeExtensionInit");
+
+ if (!dixRegisterPrivateKey(&VidModeClientPrivateKeyRec, PRIVATE_CLIENT, 0))
+ return;
+#ifdef XF86VIDMODE_EVENTS
+ if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
+ return;
+#endif
+
+#ifdef XF86VIDMODE_EVENTS
+ EventType = CreateNewResourceType(XF86VidModeFreeEvents, "VidModeEvent");
+#endif
+
+ for(i = 0; i < screenInfo.numScreens; i++) {
+ pScreen = screenInfo.screens[i];
+ if (VidModeExtensionInit(pScreen))
+ enabled = TRUE;
+ }
+ /* This means that the DDX doesn't want the vidmode extension enabled */
+ if (!enabled)
+ return;
+
+ if (
+#ifdef XF86VIDMODE_EVENTS
+ EventType &&
+#endif
+ (extEntry = AddExtension(XF86VIDMODENAME,
+ XF86VidModeNumberEvents,
+ XF86VidModeNumberErrors,
+ ProcXF86VidModeDispatch,
+ SProcXF86VidModeDispatch,
+ NULL,
+ StandardMinorOpcode))) {
+#if 0
+ XF86VidModeReqCode = (unsigned char)extEntry->base;
+#endif
+ VidModeErrorBase = extEntry->errorBase;
+#ifdef XF86VIDMODE_EVENTS
+ XF86VidModeEventBase = extEntry->eventBase;
+ EventSwapVector[XF86VidModeEventBase] = (EventSwapPtr)SXF86VidModeNotifyEvent;
+#endif
+ }
+}
diff --git a/xorg-server/hw/xfree86/dri/xf86dri.c b/xorg-server/hw/xfree86/dri/xf86dri.c
index e02644a30..c35ba2f94 100644
--- a/xorg-server/hw/xfree86/dri/xf86dri.c
+++ b/xorg-server/hw/xfree86/dri/xf86dri.c
@@ -86,7 +86,6 @@ ProcXF86DRIQueryVersion(
)
{
xXF86DRIQueryVersionReply rep;
- register int n;
REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq);
rep.type = X_Reply;
@@ -96,11 +95,11 @@ ProcXF86DRIQueryVersion(
rep.minorVersion = SERVER_XF86DRI_MINOR_VERSION;
rep.patchVersion = SERVER_XF86DRI_PATCH_VERSION;
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- swapl(&rep.patchVersion, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.majorVersion);
+ swaps(&rep.minorVersion);
+ swapl(&rep.patchVersion);
}
WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *)&rep);
return Success;
@@ -113,7 +112,6 @@ ProcXF86DRIQueryDirectRenderingCapable(
{
xXF86DRIQueryDirectRenderingCapableReply rep;
Bool isCapable;
- register int n;
REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
REQUEST_SIZE_MATCH(xXF86DRIQueryDirectRenderingCapableReq);
@@ -136,8 +134,8 @@ ProcXF86DRIQueryDirectRenderingCapable(
rep.isCapable = 0;
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
}
WriteToClient(client,
@@ -595,9 +593,8 @@ SProcXF86DRIQueryVersion(
register ClientPtr client
)
{
- register int n;
REQUEST(xXF86DRIQueryVersionReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return ProcXF86DRIQueryVersion(client);
}
@@ -606,10 +603,9 @@ SProcXF86DRIQueryDirectRenderingCapable(
register ClientPtr client
)
{
- register int n;
REQUEST(xXF86DRIQueryDirectRenderingCapableReq);
- swaps(&stuff->length, n);
- swapl(&stuff->screen, n);
+ swaps(&stuff->length);
+ swapl(&stuff->screen);
return ProcXF86DRIQueryDirectRenderingCapable(client);
}
diff --git a/xorg-server/hw/xfree86/dri2/dri2.c b/xorg-server/hw/xfree86/dri2/dri2.c
index af3bcaefe..a97508d21 100644
--- a/xorg-server/hw/xfree86/dri2/dri2.c
+++ b/xorg-server/hw/xfree86/dri2/dri2.c
@@ -102,6 +102,8 @@ typedef struct _DRI2Screen {
DRI2GetMSCProcPtr GetMSC;
DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC;
DRI2AuthMagicProcPtr AuthMagic;
+ DRI2ReuseBufferNotifyProcPtr ReuseBufferNotify;
+ DRI2SwapLimitValidateProcPtr SwapLimitValidate;
HandleExposuresProcPtr HandleExposures;
@@ -191,6 +193,36 @@ DRI2AllocateDrawable(DrawablePtr pDraw)
return pPriv;
}
+Bool
+DRI2SwapLimit(DrawablePtr pDraw, int swap_limit)
+{
+ DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw);
+ DRI2ScreenPtr ds;
+ if (!pPriv)
+ return FALSE;
+
+ ds = pPriv->dri2_screen;
+
+ if (!ds->SwapLimitValidate
+ || !ds->SwapLimitValidate(pDraw, swap_limit))
+ return FALSE;
+
+ pPriv->swap_limit = swap_limit;
+
+ /* Check throttling */
+ if (pPriv->swapsPending >= pPriv->swap_limit)
+ return TRUE;
+
+ if (pPriv->target_sbc == -1 && !pPriv->blockedOnMsc) {
+ if (pPriv->blockedClient) {
+ AttendClient(pPriv->blockedClient);
+ pPriv->blockedClient = NULL;
+ }
+ }
+
+ return TRUE;
+}
+
typedef struct DRI2DrawableRefRec {
XID id;
XID dri2_id;
@@ -352,6 +384,10 @@ allocate_or_reuse_buffer(DrawablePtr pDraw, DRI2ScreenPtr ds,
} else {
*buffer = pPriv->buffers[old_buf];
+
+ if (ds->ReuseBufferNotify)
+ (*ds->ReuseBufferNotify)(pDraw, *buffer);
+
pPriv->buffers[old_buf] = NULL;
return FALSE;
}
@@ -1128,6 +1164,11 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
ds->AuthMagic = info->AuthMagic;
}
+ if (info->version >= 6) {
+ ds->ReuseBufferNotify = info->ReuseBufferNotify;
+ ds->SwapLimitValidate = info->SwapLimitValidate;
+ }
+
/*
* if the driver doesn't provide an AuthMagic function or the info struct
* version is too low, it relies on the old method (using libdrm) or fail
diff --git a/xorg-server/hw/xfree86/dri2/dri2.h b/xorg-server/hw/xfree86/dri2/dri2.h
index 2a41ead5b..9c93209d1 100644
--- a/xorg-server/hw/xfree86/dri2/dri2.h
+++ b/xorg-server/hw/xfree86/dri2/dri2.h
@@ -110,6 +110,16 @@ typedef DRI2BufferPtr (*DRI2CreateBufferProcPtr)(DrawablePtr pDraw,
typedef void (*DRI2DestroyBufferProcPtr)(DrawablePtr pDraw,
DRI2BufferPtr buffer);
/**
+ * Notifies driver when DRI2GetBuffers reuses a dri2 buffer.
+ *
+ * Driver may rename the dri2 buffer in this notify if it is required.
+ *
+ * \param pDraw drawable whose count we want
+ * \param buffer buffer that will be returned to client
+ */
+typedef void (*DRI2ReuseBufferNotifyProcPtr)(DrawablePtr pDraw,
+ DRI2BufferPtr buffer);
+/**
* Get current media stamp counter values
*
* This callback is used to support the SGI_video_sync and OML_sync_control
@@ -159,9 +169,22 @@ typedef void (*DRI2InvalidateProcPtr)(DrawablePtr pDraw,
void *data);
/**
+ * DRI2 calls this hook when ever swap_limit is going to be changed. Default
+ * implementation for the hook only accepts one as swap_limit. If driver can
+ * support other swap_limits it has to implement supported limits with this
+ * callback.
+ *
+ * \param pDraw drawable whos swap_limit is going to be changed
+ * \param swap_limit new swap_limit that going to be set
+ * \return TRUE if limit is support, FALSE if not.
+ */
+typedef Bool (*DRI2SwapLimitValidateProcPtr)(DrawablePtr pDraw,
+ int swap_limit);
+
+/**
* Version of the DRI2InfoRec structure defined in this header
*/
-#define DRI2INFOREC_VERSION 5
+#define DRI2INFOREC_VERSION 6
typedef struct {
unsigned int version; /**< Version of this struct */
@@ -189,6 +212,11 @@ typedef struct {
/* added in version 5 */
DRI2AuthMagicProcPtr AuthMagic;
+
+ /* added in version 6 */
+
+ DRI2ReuseBufferNotifyProcPtr ReuseBufferNotify;
+ DRI2SwapLimitValidateProcPtr SwapLimitValidate;
} DRI2InfoRec, *DRI2InfoPtr;
extern _X_EXPORT int DRI2EventBase;
@@ -251,6 +279,7 @@ extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffersWithFormat(DrawablePtr pDraw,
int *out_count);
extern _X_EXPORT void DRI2SwapInterval(DrawablePtr pDrawable, int interval);
+extern _X_EXPORT Bool DRI2SwapLimit(DrawablePtr pDraw, int swap_limit);
extern _X_EXPORT int DRI2SwapBuffers(ClientPtr client, DrawablePtr pDrawable,
CARD64 target_msc, CARD64 divisor,
CARD64 remainder, CARD64 *swap_target,
diff --git a/xorg-server/hw/xfree86/dri2/dri2ext.c b/xorg-server/hw/xfree86/dri2/dri2ext.c
index 552b26b7c..934abf6de 100644
--- a/xorg-server/hw/xfree86/dri2/dri2ext.c
+++ b/xorg-server/hw/xfree86/dri2/dri2ext.c
@@ -71,10 +71,9 @@ ProcDRI2QueryVersion(ClientPtr client)
{
REQUEST(xDRI2QueryVersionReq);
xDRI2QueryVersionReply rep;
- int n;
if (client->swapped)
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xDRI2QueryVersionReq);
rep.type = X_Reply;
@@ -84,10 +83,10 @@ ProcDRI2QueryVersion(ClientPtr client)
rep.minorVersion = dri2_minor;
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.majorVersion, n);
- swapl(&rep.minorVersion, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.majorVersion);
+ swapl(&rep.minorVersion);
}
WriteToClient(client, sizeof(xDRI2QueryVersionReply), &rep);
@@ -585,16 +584,15 @@ SProcDRI2Connect(ClientPtr client)
{
REQUEST(xDRI2ConnectReq);
xDRI2ConnectReply rep;
- int n;
/* If the client is swapped, it's not local. Talk to the hand. */
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
if (sizeof(*stuff) / 4 != client->req_len)
return BadLength;
rep.sequenceNumber = client->sequence;
- swaps(&rep.sequenceNumber, n);
+ swaps(&rep.sequenceNumber);
rep.length = 0;
rep.driverNameLength = 0;
rep.deviceNameLength = 0;
diff --git a/xorg-server/hw/xfree86/i2c/fi1236.c b/xorg-server/hw/xfree86/i2c/fi1236.c
index 531b64aed..0bc50e566 100644
--- a/xorg-server/hw/xfree86/i2c/fi1236.c
+++ b/xorg-server/hw/xfree86/i2c/fi1236.c
@@ -1,605 +1,675 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#include "xf86.h"
-#include "xf86i2c.h"
-#include "fi1236.h"
-#include "tda9885.h"
-#include "i2c_def.h"
-
-#define NUM_TUNERS 8
-
-const FI1236_parameters tuner_parms[NUM_TUNERS] =
-{
- /* 0 - FI1236 */
- { 733 ,884 ,12820 ,2516 ,7220 ,0xA2 ,0x94, 0x34, 0x8e },
- /* !!!based on documentation - it should be:
- {733 ,16*55.25 ,16*801.25 ,16*160 ,16*454 ,0xA0 ,0x90, 0x30, 0x8e},*/
-
- /* 1 - FI1216 */
- { 623 ,16*48.75 ,16*855.25 ,16*170 ,16*450 ,0xA0 ,0x90, 0x30, 0x8e },
- /* 2 - TEMIC FN5AL */
- { 623 ,16*45.75 ,16*855.25 ,16*169 ,16*454 ,0xA0 ,0x90, 0x30, 0x8e },
- /* 3 - MT2032.. */
- { 733 ,768 ,13760 , 0 , 0 , 0 , 0, 0, 0 },
- /* 4 - FI1246 */
- { 623 ,16*45.75 ,16*855.25 ,16*170 ,16*450 ,0xA0 ,0x90, 0x30, 0x8e },
- /* 5 - FI1256 */
- { 623 ,16*49.75 ,16*863.25 ,16*170 ,16*450 ,0xA0 ,0x90, 0x30, 0x8e },
- /* 6 - FI1236W */
- /*{ 733 ,884 ,12820 ,2516 ,7220 ,0x1 ,0x2, 0x4, 0x8e },*/
- { 732, 16*55.25, 16*801.25, 16*160, 16*442, 0x1, 0x2, 0x4, 0x8e },
- /* 7 - FM1216ME */
- { 623 ,16*48.25 ,16*863.25 ,16*158.00 ,16*442.00 ,0x1 ,0x2, 0x4, 0x8e }
-};
-
-
-FI1236Ptr Detect_FI1236(I2CBusPtr b, I2CSlaveAddr addr)
-{
- FI1236Ptr f;
- I2CByte a;
-
- f = calloc(1,sizeof(FI1236Rec));
- if(f == NULL) return NULL;
- f->d.DevName = strdup("FI12xx Tuner");
- f->d.SlaveAddr = addr;
- f->d.pI2CBus = b;
- f->d.NextDev = NULL;
- f->d.StartTimeout = b->StartTimeout;
- f->d.BitTimeout = b->BitTimeout;
- f->d.AcknTimeout = b->AcknTimeout;
- f->d.ByteTimeout = b->ByteTimeout;
- f->type=TUNER_TYPE_FI1236;
- f->afc_timer_installed=FALSE;
- f->last_afc_hint=TUNER_OFF;
- f->video_if=45.7812;
-
- if(!I2C_WriteRead(&(f->d), NULL, 0, &a, 1))
- {
- free(f);
- return NULL;
- }
- FI1236_set_tuner_type(f, TUNER_TYPE_FI1236);
- if(!I2CDevInit(&(f->d)))
- {
- free(f);
- return NULL;
- }
- return f;
-}
-
-static void MT2032_dump_parameters(FI1236Ptr f, MT2032_parameters *m)
-{
-xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "MT2032: input f_rf=%g f_if1=%g f_if2=%g f_ref=%g f_ifbw=%g f_step=%g\n",
- m->f_rf, m->f_if1, m->f_if2, m->f_ref, m->f_ifbw, m->f_step);
-
-xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "MT2032: computed f_lo1=%g f_lo2=%g LO1I=%d LO2I=%d SEL=%d STEP=%d NUM=%d\n",
- m->f_lo1, m->f_lo2, m->LO1I, m->LO2I, m->SEL, m->STEP, m->NUM);
-}
-
-
-static void MT2032_getid(FI1236Ptr f)
-{
-CARD8 out[4];
-CARD8 in;
-
-in=0x11;
-I2C_WriteRead(&(f->d), (I2CByte *)&in, 1, out, 4);
-xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "MT2032: Company code 0x%02x%02x, part code 0x%02x, revision code 0x%02x\n",
- out[0], out[1], out[2], out[3]);
-
-}
-
-/* might be buggy */
-#if 0
-static void MT2032_shutdown(FI1236Ptr f)
-{
-CARD8 data[10];
-
-data[0]=0x00; /* start with register 0x00 */
-data[1]=0x1A;
-data[2]=0x44;
-data[3]=0x20;
-
-I2C_WriteRead(&(f->d), (I2CByte *)data, 4, NULL, 0);
-
-data[0]=0x05; /* now start with register 0x05 */
-data[1]=0xD7;
-data[2]=0x14;
-data[3]=0x05;
-I2C_WriteRead(&(f->d), (I2CByte *)data, 4, NULL, 0);
-
-data[0]=0x0B; /* now start with register 0x05 */
-data[1]=0x8F;
-data[2]=0x07;
-data[3]=0x43;
-I2C_WriteRead(&(f->d), (I2CByte *)data, 4, NULL, 0);
-
-usleep(15000);
-}
-#endif
-
-static void MT2032_dump_status(FI1236Ptr f);
-
-static void MT2032_init(FI1236Ptr f)
-{
-CARD8 data[10];
-CARD8 value;
-CARD8 xogc = 0x00;
-
-MT2032_getid(f);
-
-data[0]=0x02; /* start with register 0x02 */
-data[1]=0xFF;
-data[2]=0x0F;
-data[3]=0x1F;
-
-I2C_WriteRead(&(f->d), (I2CByte *)data, 4, NULL, 0);
-
-data[0]=0x06; /* now start with register 0x06 */
-data[1]=0xE4;
-data[2]=0x8F;
-data[3]=0xC3;
-data[4]=0x4E;
-data[5]=0xEC;
-I2C_WriteRead(&(f->d), (I2CByte *)data, 6, NULL, 0);
-
-data[0]=0x0d; /* now start with register 0x0d */
-data[1]=0x32;
-I2C_WriteRead(&(f->d), (I2CByte *)data, 2, NULL, 0);
-
-while(1) {
- usleep(15000); /* wait 15 milliseconds */
-
- data[0]=0x0e; /* register number 7, status */
- value=0xFF;
- if(!I2C_WriteRead(&(f->d), (I2CByte *)data, 1, &value, 1))
- xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "MT2032: failed to read XOK\n");
- xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "MT2032: XOK=%d\n", value & 0x01);
- if(value & 1) break;
-
- data[0]=0x07;
- if(!I2C_WriteRead(&(f->d), (I2CByte *)data, 1, &value, 1))
- xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "MT2032: failed to read XOGC\n");
-
- xogc=value & 0x7;
- if(xogc==4){
- break; /* XOGC has reached 4.. stop */
- }
- xogc--;
- xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "MT2032: try XOGC=%d\n", xogc);
- usleep(15000);
- data[0]=0x07; /* register number 7, control byte 2 */
- data[1]=0x08 | xogc;
- I2C_WriteRead(&(f->d), (I2CByte *)data, 2, NULL, 0);
- }
-f->xogc=xogc;
-/* wait before continuing */
-usleep(15000); /* wait 50 milliseconds */
-MT2032_dump_status(f);
-}
-
-static int MT2032_no_spur_in_band(MT2032_parameters *m)
-{
-int n_max, n1, n2;
-double f_test;
-n_max=5;
-n1=1;
-while(1){
- n2=-n1;
- f_test=n1*(m->f_lo1-m->f_lo2);
- while(1){
- n2--;
- f_test=f_test-m->f_lo2;
- xf86DrvMsg(0, X_INFO, "testing f_test=%g n1=%d n2=%d f_lo1=%g f_lo2=%g f_if2=%g\n", f_test, n1, n2, m->f_lo1, m->f_lo2, m->f_if2);
- xf86DrvMsg(0, X_INFO, "d_f=%g f_ifbw=%g\n",fabs(fabs(f_test)-m->f_if2), m->f_ifbw);
- if((fabs(fabs(f_test)-m->f_if2)*2.0)<=m->f_ifbw)return 0;
- if(n2<=-n_max)break;
- /* this line in the manual is bogus. I say it is faster
- and more correct to go over all harmonics.. */
- #if 0
- if(f_test<(m->f_lo2-m->f_if2-m->f_ifbw))break;
- #endif
- }
- n1++;
- if(n1>=n_max)return 1;
- }
-
-}
-
-static void MT2032_calculate_register_settings(MT2032_parameters *m, double f_rf, double f_if1, double f_if2, double f_ref, double f_ifbw, double f_step)
-{
-int n;
-m->f_rf=f_rf;
-m->f_if1=f_if1;
-m->f_if2=f_if2;
-m->f_ref=f_ref;
-m->f_ifbw=f_ifbw;
-m->f_step=f_step;
-
-m->f_lo1=f_rf+f_if1;
-m->LO1I=lrint(m->f_lo1/f_ref);
-m->f_lo1=f_ref*m->LO1I;
-
-m->f_lo2=m->f_lo1-f_rf-f_if2;
-
-/* check for spurs */
-n=1;
-while(n<3){
- if(MT2032_no_spur_in_band(m))break;
- if(m->f_lo1<(f_rf+f_if1)){
- m->LO1I+=n;
- } else {
- m->LO1I-=n;
- }
- m->f_lo1=m->LO1I*f_ref;
- m->f_lo2=m->f_lo1-f_rf-f_if2;
- n++;
- }
-/* xf86DrvMsg(0, X_INFO, "MT2032: n=%d\n", n); */
-/* select VCO */
-
-/* m->f_lo1>1100.0 */
-if(m->f_lo1<1370.0)m->SEL=4;
- else
-if(m->f_lo1<1530.0)m->SEL=3;
- else
-if(m->f_lo1<1720.0)m->SEL=2;
- else
-if(m->f_lo1<1890.0)m->SEL=1;
- else /* m->f_lo1 < 1958.0 */
- m->SEL=0;
-
-/* calculate the rest of the registers */
-m->LO2I=floor(m->f_lo2/f_ref);
-m->STEP=floor(3780.0*f_step/f_ref);
-m->NUM=floor(3780.0*(m->f_lo2/f_ref-m->LO2I));
-m->NUM=m->STEP*lrint((1.0*m->NUM)/(1.0*m->STEP));
-}
-
-static int MT2032_wait_for_lock(FI1236Ptr f)
-{
-int n;
-CARD8 data[10];
-CARD8 value;
-
-n=12;
-while(1){
- data[0]=0x0e; /* register number 7, status */
- I2C_WriteRead(&(f->d), (I2CByte *)data, 1, &value, 1);
-/* xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "MT2032: LO1LK=%d LO2LK=%d\n", (value & 0x04)>>2, (value & 0x02)>>1); */
- if((value & 6)==6) break;
- usleep(1500);
- n--;
- if(n<0)break;
- }
-if(n<0){
- xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "MT2032: failed to set frequency\n");
- return 0;
- }
-return 1;
-}
-
-static void MT2032_implement_settings(FI1236Ptr f, MT2032_parameters *m)
-{
-CARD8 data[10];
-CARD8 value;
-
-data[0]=0x00; /* start with register 0x00 */
-data[1]=(m->LO1I>>3)-1;
-data[2]=(m->SEL<<4)|(m->LO1I & 0x7);
-data[3]=0x86;
-I2C_WriteRead(&(f->d), (I2CByte *)data, 4, NULL, 0);
-
-data[0]=0x05; /* start with register 0x05 */
-data[1]=((m->LO2I & 0x7)<<5)|((m->LO2I>>3)-1);
-if(m->f_rf<400.0)data[2]=0xe4;
- else data[2]=0xf4;
-I2C_WriteRead(&(f->d), (I2CByte *)data, 3, NULL, 0);
-
-data[0]=0x07; /* register number 7, control byte 2 */
-I2C_WriteRead(&(f->d), (I2CByte *)data, 1, &value, 1);
-xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "MT2032: using XOGC=%d\n", (value & 0x07));
-data[1]=8 | (value & 0x7);
-I2C_WriteRead(&(f->d), (I2CByte *)data, 2, NULL, 0);
-
-data[0]=0x0b; /* start with register 0x0b */
-data[1]=m->NUM & 0xff;
-data[2]=(1<<7)|((m->NUM >> 8) & 0x0f);
-I2C_WriteRead(&(f->d), (I2CByte *)data, 3, NULL, 0);
-
-MT2032_wait_for_lock(f);
-}
-
-static void MT2032_optimize_VCO(FI1236Ptr f, MT2032_parameters *m)
-{
-CARD8 data[10];
-CARD8 value;
-CARD8 TAD1;
-
-data[0]=0x0f; /* register number 7, status */
-I2C_WriteRead(&(f->d), (I2CByte *)data, 1, &value, 1);
-TAD1=value & 0x07;
-xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "MT2032: TAD1=%d SEL=%d\n", TAD1, m->SEL);
-if(TAD1 < 2)return;
-if(TAD1==2){
- if(m->SEL==0)return;
- m->SEL--;
- } else {
- if(m->SEL>=4)return;
- m->SEL++;
- }
-data[0]=0x01; /* start with register 1 */
-data[1]=(m->SEL<<4)|(m->LO1I & 0x7);
-I2C_WriteRead(&(f->d), (I2CByte *)data, 2, NULL, 0);
-
-}
-
-static int FI1236_get_afc_hint(FI1236Ptr f)
-{
- CARD8 out;
- CARD8 AFC;
-
- if ((f->type == TUNER_TYPE_FM1216ME) || (f->type == TUNER_TYPE_FI1236W))
- {
- TDA9885Ptr t = (TDA9885Ptr)f->afc_source;
- if (t == NULL)
- return TUNER_OFF;
-
- tda9885_getstatus(t);
- tda9885_dumpstatus(t);
- AFC = t->afc_status & 0x0f;
-
- xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "AFC: FI1236_get_afc_hint: %i\n", AFC);
- if (AFC == 0) return TUNER_TUNED;
- else if (AFC <= 0x07)return TUNER_JUST_BELOW;
- else if (AFC < 0x0f )return TUNER_JUST_ABOVE;
- else if (AFC == 0x0f)return TUNER_TUNED;
- }
- else
- {
- I2C_WriteRead(&(f->d), NULL, 0, &out, 1);
- AFC=out & 0x7;
- xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "AFC: FI1236_get_afc_hint: %i\n", AFC);
- if(AFC==2)return TUNER_TUNED;
- if(AFC==3)return TUNER_JUST_BELOW;
- if(AFC==1)return TUNER_JUST_ABOVE;
- return TUNER_OFF;
- }
- return TUNER_OFF;
-}
-
-static int MT2032_get_afc_hint(FI1236Ptr f)
-{
-CARD8 in;
-CARD8 out[2];
-CARD8 AFC;
-in=0x0e;
-I2C_WriteRead(&(f->d), (I2CByte *)&in, 1, out, 2);
-AFC=(out[0]>>4) & 0x7;
-#if 0
-xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "AFC=%d TAD1=%d TAD2=%d\n", AFC, out[1] & 0x7, (out[1]>>4)& 0x07);
-#endif
-if(AFC==2)return TUNER_TUNED;
-if(AFC==3)return TUNER_JUST_BELOW;
-if(AFC==1)return TUNER_JUST_ABOVE;
-return TUNER_OFF;
-}
-
-/* this function is for external use only */
-int TUNER_get_afc_hint(FI1236Ptr f)
-{
-if(f->afc_timer_installed)return TUNER_STILL_TUNING;
-return f->last_afc_hint;
-}
-
-static void MT2032_dump_status(FI1236Ptr f)
-{
-CARD8 in;
-CARD8 out[2];
-CARD8 AFC;
-CARD8 LDONrb;
-CARD8 LO1LK, LO2LK, XOK;
-CARD8 TAD2, TAD1;
-
-in=0x0e;
-I2C_WriteRead(&(f->d), (I2CByte *)&in, 1, out, 2);
-XOK=out[0] & 1;
-LO1LK=(out[0]>>2) &1;
-LO2LK=(out[0]>>1) &1;
-LDONrb=(out[0]>>3) &1;
-
-AFC=(out[0]>>4) & 0x7;
-
-TAD1=(out[1] & 0x7);
-TAD2=(out[1]>>4) & 0x7;
-
-xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "MT2032: status: XOK=%d LO1LK=%d LO2LK=%d LDONrb=%d AFC=%d TAD1=%d TAD2=%d\n",
- XOK, LO1LK, LO2LK, LDONrb, AFC, TAD1, TAD2);
-xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "MT2032: status: OSCILLATOR:%s PLL1:%s PLL2:%s\n",
- XOK ? "ok":"off", LO1LK ? "locked" : "off" , LO2LK ? "locked" : "off");
-
-}
-
-static void MT2032_tune(FI1236Ptr f, double freq, double step)
-{
-MT2032_parameters m;
-CARD8 data[10];
-int i;
-/* NTSC IF is 44mhz.. but 733/16=45.8125 and all TDAXXXX docs mention
- 45.75, 39, 58.75 and 30. */
-#if 0
-MT2032_calculate_register_settings(&m, freq, 1090.0, 45.125, 5.25, 6.0, step);
-MT2032_calculate_register_settings(&m, freq, 1090.0, 45.74, 5.25, 6.0, step);
-#endif
-MT2032_calculate_register_settings(&m, freq, 1090.0, f->video_if, 5.25, 3.0, step);
-MT2032_dump_parameters(f, &m);
-MT2032_implement_settings(f, &m);
-/* MT2032_dump_parameters(f, &m); */
-for(i=0;i<3;i++){
- MT2032_optimize_VCO(f, &m);
- if(MT2032_wait_for_lock(f)){
- data[0]=0x02; /* LO Gain control register 0x02 */
- data[1]=0x20;
- I2C_WriteRead(&(f->d), (I2CByte *)data, 2, NULL, 0);
- return;
- }
- data[0]=0x07;
- data[1]=0x88|f->xogc;
- I2C_WriteRead(&(f->d), (I2CByte *)data, 2, NULL, 0);
- usleep(15000);
- data[1]=0x08|f->xogc;
- I2C_WriteRead(&(f->d), (I2CByte *)data, 2, NULL, 0);
- }
-xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "MT2032: failed to set frequency\n");
-}
-
-void FI1236_set_tuner_type(FI1236Ptr f, int type)
-{
-f->type=type;
-if(type>=NUM_TUNERS)type = NUM_TUNERS-1;
-if(type<0)type = 0;
-memcpy(&(f->parm), &(tuner_parms[type]), sizeof(FI1236_parameters));
-f->original_frequency=f->parm.min_freq;
-f->afc_delta=0;
-if(type==TUNER_TYPE_MT2032){
- MT2032_init(f);
- return;
- }
-}
-
-
-static CARD32 AFC_TimerCallback(OsTimerPtr timer, CARD32 time, pointer data){
-FI1236Ptr f=(FI1236Ptr)data;
-if(FI1236_AFC(f))return 150;
- else {
- f->afc_timer_installed=FALSE;
- f->afc_count=0;
- return 0;
- }
-}
-
-void FI1236_tune(FI1236Ptr f, CARD32 frequency)
-{
- CARD16 divider;
- CARD8 data;
-
- if(frequency < f->parm.min_freq) frequency = f->parm.min_freq;
- if(frequency > f->parm.max_freq) frequency = f->parm.max_freq;
-
- divider = (f->parm.fcar+(CARD16)frequency) & 0x7fff;
- f->tuner_data.div1 = (CARD8)((divider>>8)&0x7f);
- f->tuner_data.div2 = (CARD8)(divider & 0xff);
- f->tuner_data.control = f->parm.control;
-
- if(frequency < f->parm.threshold1)
- {
- f->tuner_data.band = f->parm.band_low;
- }
- else if (frequency < f->parm.threshold2)
- {
- f->tuner_data.band = f->parm.band_mid;
- }
- else
- {
- f->tuner_data.band = f->parm.band_high;
- }
-
- xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "Setting tuner band to %d\n", f->tuner_data.band);
-
- xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "Setting tuner frequency to %d\n", (int)frequency);
-
- if ((f->type == TUNER_TYPE_FM1216ME) || (f->type == TUNER_TYPE_FI1236W))
- {
- f->tuner_data.aux = 0x20;
- I2C_WriteRead(&(f->d), (I2CByte *)&(f->tuner_data), 5, NULL, 0);
- I2C_WriteRead(&(f->d), NULL, 0, &data, 1);
- xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "Tuner status %x\n", data);
-
- }
- else
- I2C_WriteRead(&(f->d), (I2CByte *)&(f->tuner_data), 4, NULL, 0);
-}
-
-void TUNER_set_frequency(FI1236Ptr f, CARD32 frequency)
-{
- if(frequency < f->parm.min_freq) frequency = f->parm.min_freq;
- if(frequency > f->parm.max_freq) frequency = f->parm.max_freq;
-
- f->afc_delta=0;
- f->original_frequency=frequency;
-
- if(f->type==TUNER_TYPE_MT2032)
- {
- MT2032_tune(f, (1.0*frequency)/16.0, 0.0625);
- } else
- {
- FI1236_tune(f, frequency);
- }
-
- if(!f->afc_timer_installed)
- {
- f->afc_timer_installed=TRUE;
-/* RegisterBlockAndWakeupHandlers(FI1236_BlockHandler, AFCWakeup, f); */
- TimerSet(NULL, 0, 300, AFC_TimerCallback, f);
- }
-
-}
-
-
-int FI1236_AFC(FI1236Ptr f)
-{
- #if 0
- xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "AFC: f=%p f->count=%d f->original_frequency=%d f->afc_delta=%d\n", f, f->afc_count, f->original_frequency, f->afc_delta);
- #endif
- f->afc_count++;
- if(f->type==TUNER_TYPE_MT2032)
- {
- f->last_afc_hint=MT2032_get_afc_hint(f);
- xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "AFC: afc_hint=%d\n", f->last_afc_hint);
- if(f->last_afc_hint==TUNER_TUNED)return 0;
- if(f->afc_count>3)f->last_afc_hint=TUNER_OFF;
- if(f->last_afc_hint==TUNER_OFF)
- {
- f->afc_delta=0;
- } else
- f->afc_delta+=f->last_afc_hint;
- xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "AFC: Setting tuner frequency to %g\n", (0.5*(2*f->original_frequency+f->afc_delta))/16.0);
- MT2032_tune(f, (1.0*f->original_frequency+0.5*f->afc_delta)/16.0, 0.03125);
- if(f->last_afc_hint==TUNER_OFF)return 0;
- return 1; /* call me again */
- } else
- {
- f->last_afc_hint=FI1236_get_afc_hint(f);
- if(f->last_afc_hint==TUNER_TUNED)
- {
- xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "AFC: TUNER_TUNNED\n");
- return 0;
- }
- if(f->afc_count>3)f->last_afc_hint=TUNER_OFF;
- if(f->last_afc_hint==TUNER_OFF)
- {
- f->afc_delta=0;
- } else
- f->afc_delta+=f->last_afc_hint;
- xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "AFC: Setting tuner frequency to %g\n", (0.5*(2*f->original_frequency+f->afc_delta))/16.0);
- FI1236_tune(f, f->original_frequency+f->afc_delta);
- if(f->last_afc_hint==TUNER_OFF)return 0;
- return 1; /* call me again */
- }
- return 0; /* done */
-}
-
-void fi1236_dump_status(FI1236Ptr f)
-{
-if(f->type==TUNER_TYPE_MT2032){
- MT2032_dump_status(f);
- }
-}
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#include "xf86.h"
+#include "xf86i2c.h"
+#include "fi1236.h"
+#include "tda9885.h"
+#include "i2c_def.h"
+
+#define NUM_TUNERS 8
+
+const FI1236_parameters tuner_parms[NUM_TUNERS] =
+{
+ /* 0 - FI1236 */
+ { 733, 884, 12820, 2516, 7220, 0xA2, 0x94, 0x34, 0x8e },
+ /* !!!based on documentation - it should be:
+ {733, 16*55.25, 16*801.25, 16*160, 16*454, 0xA0, 0x90, 0x30, 0x8e},*/
+
+ /* 1 - FI1216 */
+ { 623, 16*48.75, 16*855.25, 16*170, 16*450, 0xA0, 0x90, 0x30, 0x8e },
+ /* 2 - TEMIC FN5AL */
+ { 623, 16*45.75, 16*855.25, 16*169, 16*454, 0xA0, 0x90, 0x30, 0x8e },
+ /* 3 - MT2032.. */
+ { 733, 768, 13760, 0, 0, 0, 0, 0, 0 },
+ /* 4 - FI1246 */
+ { 623, 16*45.75, 16*855.25, 16*170, 16*450, 0xA0, 0x90, 0x30, 0x8e },
+ /* 5 - FI1256 */
+ { 623, 16*49.75, 16*863.25, 16*170, 16*450, 0xA0, 0x90, 0x30, 0x8e },
+ /* 6 - FI1236W */
+ /*{ 733, 884, 12820, 2516, 7220, 0x1, 0x2, 0x4, 0x8e },*/
+ { 732, 16*55.25, 16*801.25, 16*160, 16*442, 0x1, 0x2, 0x4, 0x8e },
+ /* 7 - FM1216ME */
+ { 623, 16*48.25, 16*863.25, 16*158.00, 16*442.00, 0x1, 0x2, 0x4, 0x8e }
+};
+
+
+FI1236Ptr
+Detect_FI1236 (I2CBusPtr b, I2CSlaveAddr addr)
+{
+ FI1236Ptr f;
+ I2CByte a;
+
+ f = calloc(1,sizeof(FI1236Rec));
+ if (f == NULL)
+ return NULL;
+ f->d.DevName = strdup("FI12xx Tuner");
+ f->d.SlaveAddr = addr;
+ f->d.pI2CBus = b;
+ f->d.NextDev = NULL;
+ f->d.StartTimeout = b->StartTimeout;
+ f->d.BitTimeout = b->BitTimeout;
+ f->d.AcknTimeout = b->AcknTimeout;
+ f->d.ByteTimeout = b->ByteTimeout;
+ f->type=TUNER_TYPE_FI1236;
+ f->afc_timer_installed=FALSE;
+ f->last_afc_hint=TUNER_OFF;
+ f->video_if=45.7812;
+
+ if (!I2C_WriteRead(&(f->d), NULL, 0, &a, 1)) {
+ free(f);
+ return NULL;
+ }
+ FI1236_set_tuner_type(f, TUNER_TYPE_FI1236);
+ if (!I2CDevInit(&(f->d))) {
+ free(f);
+ return NULL;
+ }
+ return f;
+}
+
+static void
+MT2032_dump_parameters (FI1236Ptr f, MT2032_parameters *m)
+{
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "MT2032: input f_rf=%g f_if1=%g f_if2=%g f_ref=%g f_ifbw=%g f_step=%g\n",
+ m->f_rf, m->f_if1, m->f_if2, m->f_ref, m->f_ifbw, m->f_step);
+
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "MT2032: computed f_lo1=%g f_lo2=%g LO1I=%d LO2I=%d SEL=%d STEP=%d NUM=%d\n",
+ m->f_lo1, m->f_lo2, m->LO1I, m->LO2I, m->SEL, m->STEP, m->NUM);
+}
+
+
+static void
+MT2032_getid (FI1236Ptr f)
+{
+ CARD8 out[4];
+ CARD8 in;
+
+ in = 0x11;
+ I2C_WriteRead(&(f->d), (I2CByte *)&in, 1, out, 4);
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "MT2032: Company code 0x%02x%02x, part code 0x%02x, revision code 0x%02x\n",
+ out[0], out[1], out[2], out[3]);
+
+}
+
+/* might be buggy */
+#if 0
+static void
+MT2032_shutdown (FI1236Ptr f)
+{
+ CARD8 data[10];
+
+ data[0] = 0x00; /* start with register 0x00 */
+ data[1] = 0x1A;
+ data[2] = 0x44;
+ data[3] = 0x20;
+
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 4, NULL, 0);
+
+ data[0] = 0x05; /* now start with register 0x05 */
+ data[1] = 0xD7;
+ data[2] = 0x14;
+ data[3] = 0x05;
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 4, NULL, 0);
+
+ data[0] = 0x0B; /* now start with register 0x05 */
+ data[1] = 0x8F;
+ data[2] = 0x07;
+ data[3] = 0x43;
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 4, NULL, 0);
+
+ usleep(15000);
+}
+#endif
+
+static void MT2032_dump_status (FI1236Ptr f);
+
+static void
+MT2032_init (FI1236Ptr f)
+{
+ CARD8 data[10];
+ CARD8 value;
+ CARD8 xogc = 0x00;
+
+ MT2032_getid(f);
+
+ data[0] = 0x02; /* start with register 0x02 */
+ data[1] = 0xFF;
+ data[2] = 0x0F;
+ data[3] = 0x1F;
+
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 4, NULL, 0);
+
+ data[0] = 0x06; /* now start with register 0x06 */
+ data[1] = 0xE4;
+ data[2] = 0x8F;
+ data[3] = 0xC3;
+ data[4] = 0x4E;
+ data[5] = 0xEC;
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 6, NULL, 0);
+
+ data[0] = 0x0d; /* now start with register 0x0d */
+ data[1] = 0x32;
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 2, NULL, 0);
+
+ while (1) {
+ usleep(15000); /* wait 15 milliseconds */
+
+ data[0] = 0x0e; /* register number 7, status */
+ value = 0xFF;
+ if (!I2C_WriteRead(&(f->d), (I2CByte *)data, 1, &value, 1))
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "MT2032: failed to read XOK\n");
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "MT2032: XOK=%d\n", value & 0x01);
+ if (value & 1)
+ break;
+
+ data[0] = 0x07;
+ if (!I2C_WriteRead(&(f->d), (I2CByte *)data, 1, &value, 1))
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "MT2032: failed to read XOGC\n");
+
+ xogc=value & 0x7;
+ if (xogc == 4)
+ break; /* XOGC has reached 4.. stop */
+ xogc--;
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "MT2032: try XOGC=%d\n", xogc);
+ usleep(15000);
+ data[0] = 0x07; /* register number 7, control byte 2 */
+ data[1] = 0x08 | xogc;
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 2, NULL, 0);
+ }
+ f->xogc = xogc;
+ /* wait before continuing */
+ usleep(15000); /* wait 50 milliseconds */
+ MT2032_dump_status(f);
+}
+
+static int
+MT2032_no_spur_in_band (MT2032_parameters *m)
+{
+ int n_max, n1, n2;
+ double f_test;
+ n_max = 5;
+ n1 = 1;
+ while (1) {
+ n2 = -n1;
+ f_test = n1 * (m->f_lo1 - m->f_lo2);
+ while (1) {
+ n2--;
+ f_test = f_test - m->f_lo2;
+ xf86DrvMsg(0, X_INFO,
+ "testing f_test=%g n1=%d n2=%d f_lo1=%g f_lo2=%g f_if2=%g\n",
+ f_test, n1, n2, m->f_lo1, m->f_lo2, m->f_if2);
+ xf86DrvMsg(0, X_INFO, "d_f=%g f_ifbw=%g\n",
+ fabs(fabs(f_test) - m->f_if2), m->f_ifbw);
+ if ((fabs(fabs(f_test) - m->f_if2) * 2.0) <= m->f_ifbw)
+ return 0;
+ if (n2 <= -n_max)
+ break;
+ /* this line in the manual is bogus. I say it is faster
+ and more correct to go over all harmonics.. */
+#if 0
+ if (f_test < (m->f_lo2 - m->f_if2 - m->f_ifbw))
+ break;
+#endif
+ }
+ n1++;
+ if (n1 >= n_max)
+ return 1;
+ }
+
+}
+
+static void
+MT2032_calculate_register_settings (MT2032_parameters *m, double f_rf,
+ double f_if1, double f_if2, double f_ref, double f_ifbw, double f_step)
+{
+ int n;
+ m->f_rf = f_rf;
+ m->f_if1 = f_if1;
+ m->f_if2 = f_if2;
+ m->f_ref = f_ref;
+ m->f_ifbw = f_ifbw;
+ m->f_step = f_step;
+
+ m->f_lo1 = f_rf+f_if1;
+ m->LO1I = lrint(m->f_lo1 / f_ref);
+ m->f_lo1 = f_ref * m->LO1I;
+
+ m->f_lo2 = m->f_lo1 - f_rf - f_if2;
+
+ /* check for spurs */
+ n = 1;
+ while (n < 3) {
+ if (MT2032_no_spur_in_band(m))
+ break;
+
+ if (m->f_lo1 < (f_rf + f_if1))
+ m->LO1I += n;
+ else
+ m->LO1I -= n;
+
+ m->f_lo1 = m->LO1I * f_ref;
+ m->f_lo2 = m->f_lo1 - f_rf - f_if2;
+ n++;
+ }
+ /* xf86DrvMsg(0, X_INFO, "MT2032: n=%d\n", n); */
+ /* select VCO */
+
+ /* m->f_lo1>1100.0 */
+ if (m->f_lo1 < 1370.0)
+ m->SEL = 4;
+ else if (m->f_lo1 < 1530.0)
+ m->SEL = 3;
+ else if (m->f_lo1 < 1720.0)
+ m->SEL = 2;
+ else if (m->f_lo1 < 1890.0)
+ m->SEL = 1;
+ else /* m->f_lo1 < 1958.0 */
+ m->SEL = 0;
+
+ /* calculate the rest of the registers */
+ m->LO2I = floor(m->f_lo2 / f_ref);
+ m->STEP = floor(3780.0 * f_step / f_ref);
+ m->NUM = floor(3780.0 * (m->f_lo2 / f_ref - m->LO2I));
+ m->NUM = m->STEP * lrint((1.0 * m->NUM) / (1.0 * m->STEP));
+}
+
+static int
+MT2032_wait_for_lock (FI1236Ptr f)
+{
+ int n;
+ CARD8 data[10];
+ CARD8 value;
+
+ n=12;
+ while(1) {
+ data[0] = 0x0e; /* register number 7, status */
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 1, &value, 1);
+ /* xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "MT2032: LO1LK=%d LO2LK=%d\n",
+ (value & 0x04)>>2, (value & 0x02)>>1); */
+ if ((value & 6)==6)
+ break;
+ usleep (1500);
+ n--;
+ if (n < 0)
+ break;
+ }
+ if (n < 0) {
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "MT2032: failed to set frequency\n");
+ return 0;
+ }
+ return 1;
+}
+
+static void
+MT2032_implement_settings (FI1236Ptr f, MT2032_parameters *m)
+{
+ CARD8 data[10];
+ CARD8 value;
+
+ data[0] = 0x00; /* start with register 0x00 */
+ data[1] = (m->LO1I >> 3) - 1;
+ data[2] = (m->SEL << 4) | (m->LO1I & 0x7);
+ data[3] = 0x86;
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 4, NULL, 0);
+
+ data[0] = 0x05; /* start with register 0x05 */
+ data[1] = ((m->LO2I & 0x7) << 5) | ((m->LO2I >> 3) - 1);
+ if (m->f_rf < 400.0)
+ data[2] = 0xe4;
+ else
+ data[2] = 0xf4;
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 3, NULL, 0);
+
+ data[0] = 0x07; /* register number 7, control byte 2 */
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 1, &value, 1);
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "MT2032: using XOGC=%d\n", (value & 0x07));
+ data[1] = 8 | (value & 0x7);
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 2, NULL, 0);
+
+ data[0] = 0x0b; /* start with register 0x0b */
+ data[1] = m->NUM & 0xff;
+ data[2] = (1<<7) | ((m->NUM >> 8) & 0x0f);
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 3, NULL, 0);
+
+ MT2032_wait_for_lock(f);
+}
+
+static void
+MT2032_optimize_VCO (FI1236Ptr f, MT2032_parameters *m)
+{
+ CARD8 data[10];
+ CARD8 value;
+ CARD8 TAD1;
+
+ data[0] = 0x0f; /* register number 7, status */
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 1, &value, 1);
+ TAD1=value & 0x07;
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "MT2032: TAD1=%d SEL=%d\n", TAD1, m->SEL);
+ if (TAD1 < 2)
+ return;
+ if (TAD1 == 2) {
+ if (m->SEL == 0)
+ return;
+ m->SEL--;
+ } else {
+ if (m->SEL >= 4)
+ return;
+ m->SEL++;
+ }
+ data[0] = 0x01; /* start with register 1 */
+ data[1] = (m->SEL << 4) | (m->LO1I & 0x7);
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 2, NULL, 0);
+
+}
+
+static int
+FI1236_get_afc_hint (FI1236Ptr f)
+{
+ CARD8 out;
+ CARD8 AFC;
+
+ if ((f->type == TUNER_TYPE_FM1216ME) || (f->type == TUNER_TYPE_FI1236W)) {
+ TDA9885Ptr t = (TDA9885Ptr)f->afc_source;
+ if (t == NULL)
+ return TUNER_OFF;
+
+ tda9885_getstatus(t);
+ tda9885_dumpstatus(t);
+ AFC = t->afc_status & 0x0f;
+
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "AFC: FI1236_get_afc_hint: %i\n", AFC);
+ if (AFC == 0)
+ return TUNER_TUNED;
+ else if (AFC <= 0x07)
+ return TUNER_JUST_BELOW;
+ else if (AFC < 0x0f)
+ return TUNER_JUST_ABOVE;
+ else if (AFC == 0x0f)
+ return TUNER_TUNED;
+ } else {
+ I2C_WriteRead(&(f->d), NULL, 0, &out, 1);
+ AFC = out & 0x7;
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "AFC: FI1236_get_afc_hint: %i\n", AFC);
+ if (AFC == 2)
+ return TUNER_TUNED;
+ if (AFC == 3)
+ return TUNER_JUST_BELOW;
+ if (AFC == 1)
+ return TUNER_JUST_ABOVE;
+ return TUNER_OFF;
+ }
+ return TUNER_OFF;
+}
+
+static int
+MT2032_get_afc_hint (FI1236Ptr f)
+{
+ CARD8 in;
+ CARD8 out[2];
+ CARD8 AFC;
+ in = 0x0e;
+ I2C_WriteRead(&(f->d), (I2CByte *)&in, 1, out, 2);
+ AFC = (out[0] >> 4) & 0x7;
+#if 0
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "AFC=%d TAD1=%d TAD2=%d\n",
+ AFC, out[1] & 0x7, (out[1]>>4)& 0x07);
+#endif
+ if (AFC == 2)
+ return TUNER_TUNED;
+ if (AFC == 3)
+ return TUNER_JUST_BELOW;
+ if (AFC == 1)
+ return TUNER_JUST_ABOVE;
+ return TUNER_OFF;
+}
+
+/* this function is for external use only */
+int
+TUNER_get_afc_hint (FI1236Ptr f)
+{
+ if (f->afc_timer_installed)
+ return TUNER_STILL_TUNING;
+ return f->last_afc_hint;
+}
+
+static void
+MT2032_dump_status (FI1236Ptr f)
+{
+ CARD8 in;
+ CARD8 out[2];
+ CARD8 AFC;
+ CARD8 LDONrb;
+ CARD8 LO1LK, LO2LK, XOK;
+ CARD8 TAD2, TAD1;
+
+ in = 0x0e;
+ I2C_WriteRead(&(f->d), (I2CByte *)&in, 1, out, 2);
+ XOK = out[0] & 1;
+ LO1LK = (out[0] >> 2) & 1;
+ LO2LK = (out[0] >> 1) & 1;
+ LDONrb = (out[0] >> 3) & 1;
+
+ AFC = (out[0] >> 4) & 0x7;
+
+ TAD1 = (out[1] & 0x7);
+ TAD2 = (out[1] >> 4) & 0x7;
+
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "MT2032: status: XOK=%d LO1LK=%d LO2LK=%d LDONrb=%d AFC=%d TAD1=%d TAD2=%d\n",
+ XOK, LO1LK, LO2LK, LDONrb, AFC, TAD1, TAD2);
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "MT2032: status: OSCILLATOR:%s PLL1:%s PLL2:%s\n",
+ XOK ? "ok" : "off",
+ LO1LK ? "locked" : "off",
+ LO2LK ? "locked" : "off");
+
+}
+
+static void MT2032_tune(FI1236Ptr f, double freq, double step)
+{
+ MT2032_parameters m;
+ CARD8 data[10];
+ int i;
+
+ /* NTSC IF is 44mhz.. but 733/16=45.8125 and all TDAXXXX docs mention
+ 45.75, 39, 58.75 and 30. */
+#if 0
+ MT2032_calculate_register_settings(&m, freq, 1090.0, 45.125, 5.25, 6.0, step);
+ MT2032_calculate_register_settings(&m, freq, 1090.0, 45.74, 5.25, 6.0, step);
+#endif
+ MT2032_calculate_register_settings(&m, freq, 1090.0, f->video_if, 5.25, 3.0, step);
+ MT2032_dump_parameters(f, &m);
+ MT2032_implement_settings(f, &m);
+ /* MT2032_dump_parameters(f, &m); */
+ for (i = 0; i < 3; i++) {
+ MT2032_optimize_VCO(f, &m);
+ if (MT2032_wait_for_lock(f)) {
+ data[0] = 0x02; /* LO Gain control register 0x02 */
+ data[1] = 0x20;
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 2, NULL, 0);
+ return;
+ }
+ data[0] = 0x07;
+ data[1] = 0x88 | f->xogc;
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 2, NULL, 0);
+ usleep(15000);
+ data[1] = 0x08 | f->xogc;
+ I2C_WriteRead(&(f->d), (I2CByte *)data, 2, NULL, 0);
+ }
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "MT2032: failed to set frequency\n");
+}
+
+void
+FI1236_set_tuner_type (FI1236Ptr f, int type)
+{
+ f->type = type;
+ if (type >= NUM_TUNERS)
+ type = NUM_TUNERS-1;
+ if (type < 0)
+ type = 0;
+ memcpy(&(f->parm), &(tuner_parms[type]), sizeof(FI1236_parameters));
+ f->original_frequency = f->parm.min_freq;
+ f->afc_delta = 0;
+ if (type == TUNER_TYPE_MT2032) {
+ MT2032_init(f);
+ return;
+ }
+}
+
+
+static CARD32
+AFC_TimerCallback(OsTimerPtr timer, CARD32 time, pointer data)
+{
+ FI1236Ptr f = (FI1236Ptr)data;
+ if (FI1236_AFC(f))
+ return 150;
+ else {
+ f->afc_timer_installed = FALSE;
+ f->afc_count = 0;
+ return 0;
+ }
+}
+
+void
+FI1236_tune(FI1236Ptr f, CARD32 frequency)
+{
+ CARD16 divider;
+ CARD8 data;
+
+ if (frequency < f->parm.min_freq) frequency = f->parm.min_freq;
+ if (frequency > f->parm.max_freq) frequency = f->parm.max_freq;
+
+ divider = (f->parm.fcar + (CARD16)frequency) & 0x7fff;
+ f->tuner_data.div1 = (CARD8)((divider >> 8)&0x7f);
+ f->tuner_data.div2 = (CARD8)(divider & 0xff);
+ f->tuner_data.control = f->parm.control;
+
+ if (frequency < f->parm.threshold1)
+ f->tuner_data.band = f->parm.band_low;
+ else if (frequency < f->parm.threshold2)
+ f->tuner_data.band = f->parm.band_mid;
+ else
+ f->tuner_data.band = f->parm.band_high;
+
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "Setting tuner band to %d\n", f->tuner_data.band);
+
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "Setting tuner frequency to %d\n", (int)frequency);
+
+ if ((f->type == TUNER_TYPE_FM1216ME) || (f->type == TUNER_TYPE_FI1236W)) {
+ f->tuner_data.aux = 0x20;
+ I2C_WriteRead(&(f->d), (I2CByte *)&(f->tuner_data), 5, NULL, 0);
+ I2C_WriteRead(&(f->d), NULL, 0, &data, 1);
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "Tuner status %x\n", data);
+ }
+ else
+ I2C_WriteRead(&(f->d), (I2CByte *)&(f->tuner_data), 4, NULL, 0);
+}
+
+void
+TUNER_set_frequency(FI1236Ptr f, CARD32 frequency)
+{
+ if (frequency < f->parm.min_freq) frequency = f->parm.min_freq;
+ if (frequency > f->parm.max_freq) frequency = f->parm.max_freq;
+
+ f->afc_delta=0;
+ f->original_frequency=frequency;
+
+ if (f->type == TUNER_TYPE_MT2032)
+ MT2032_tune(f, (1.0*frequency)/16.0, 0.0625);
+ else
+ FI1236_tune(f, frequency);
+
+ if (!f->afc_timer_installed) {
+ f->afc_timer_installed=TRUE;
+/* RegisterBlockAndWakeupHandlers(FI1236_BlockHandler, AFCWakeup, f); */
+ TimerSet(NULL, 0, 300, AFC_TimerCallback, f);
+ }
+
+}
+
+
+int
+FI1236_AFC(FI1236Ptr f)
+{
+#if 0
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "AFC: f=%p f->count=%d f->original_frequency=%d f->afc_delta=%d\n",
+ f, f->afc_count, f->original_frequency, f->afc_delta);
+#endif
+ f->afc_count++;
+ if (f->type == TUNER_TYPE_MT2032) {
+ f->last_afc_hint = MT2032_get_afc_hint(f);
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "AFC: afc_hint=%d\n", f->last_afc_hint);
+ if (f->last_afc_hint == TUNER_TUNED)
+ return 0;
+ if (f->afc_count > 3)
+ f->last_afc_hint = TUNER_OFF;
+ if (f->last_afc_hint == TUNER_OFF)
+ f->afc_delta = 0;
+ else
+ f->afc_delta += f->last_afc_hint;
+
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "AFC: Setting tuner frequency to %g\n",
+ (0.5 * (2 * f->original_frequency + f->afc_delta)) / 16.0);
+ MT2032_tune(f,
+ (1.0 * f->original_frequency+ 0.5 * f->afc_delta) / 16.0,
+ 0.03125);
+ if (f->last_afc_hint == TUNER_OFF)
+ return 0;
+ return 1; /* call me again */
+ } else {
+ f->last_afc_hint = FI1236_get_afc_hint(f);
+ if (f->last_afc_hint == TUNER_TUNED) {
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "AFC: TUNER_TUNNED\n");
+ return 0;
+ }
+ if (f->afc_count > 3)
+ f->last_afc_hint = TUNER_OFF;
+
+ if (f->last_afc_hint == TUNER_OFF)
+ f->afc_delta=0;
+ else
+ f->afc_delta+=f->last_afc_hint;
+
+ xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO,
+ "AFC: Setting tuner frequency to %g\n",
+ (0.5 * (2 * f->original_frequency + f->afc_delta)) / 16.0);
+ FI1236_tune(f, f->original_frequency + f->afc_delta);
+ if (f->last_afc_hint == TUNER_OFF)
+ return 0;
+ return 1; /* call me again */
+ }
+ return 0; /* done */
+}
+
+void
+fi1236_dump_status(FI1236Ptr f)
+{
+ if (f->type == TUNER_TYPE_MT2032)
+ MT2032_dump_status(f);
+}
diff --git a/xorg-server/hw/xfree86/int10/generic.c b/xorg-server/hw/xfree86/int10/generic.c
index c242405cc..994085493 100644
--- a/xorg-server/hw/xfree86/int10/generic.c
+++ b/xorg-server/hw/xfree86/int10/generic.c
@@ -1,494 +1,482 @@
-/*
- * XFree86 int10 module
- * execute BIOS int 10h calls in x86 real mode environment
- * Copyright 1999 Egbert Eich
- */
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <string.h>
-#include <unistd.h>
-
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "compiler.h"
-#define _INT10_PRIVATE
-#include "xf86int10.h"
-#include "int10Defines.h"
-#include "Pci.h"
-
-#define ALLOC_ENTRIES(x) ((V_RAM / x) - 1)
-
-static CARD8 read_b(xf86Int10InfoPtr pInt,int addr);
-static CARD16 read_w(xf86Int10InfoPtr pInt,int addr);
-static CARD32 read_l(xf86Int10InfoPtr pInt,int addr);
-static void write_b(xf86Int10InfoPtr pInt,int addr, CARD8 val);
-static void write_w(xf86Int10InfoPtr pInt,int addr, CARD16 val);
-static void write_l(xf86Int10InfoPtr pInt,int addr, CARD32 val);
-
-/*
- * the emulator cannot pass a pointer to the current xf86Int10InfoRec
- * to the memory access functions therefore store it here.
- */
-
-typedef struct {
- int shift;
- int entries;
- void* base;
- void* vRam;
- int highMemory;
- void* sysMem;
- char* alloc;
-} genericInt10Priv;
-
-#define INTPriv(x) ((genericInt10Priv*)x->private)
-
-int10MemRec genericMem = {
- read_b,
- read_w,
- read_l,
- write_b,
- write_w,
- write_l
-};
-
-static void MapVRam(xf86Int10InfoPtr pInt);
-static void UnmapVRam(xf86Int10InfoPtr pInt);
-#ifdef _PC
-#define GET_HIGH_BASE(x) (((V_BIOS + (x) + getpagesize() - 1)/getpagesize()) \
- * getpagesize())
-#endif
-
-static void *sysMem = NULL;
-
-/**
- * Read legacy VGA video BIOS associated with specified domain.
- *
- * Attempts to read up to 128KiB of legacy VGA video BIOS.
- *
- * \return
- * The number of bytes read on success or -1 on failure.
- *
- * \bug
- * PCI ROMs can contain multiple BIOS images (e.g., OpenFirmware, x86 VGA,
- * etc.). How do we know that \c pci_device_read_rom will return the
- * legacy VGA BIOS image?
- */
-#ifndef _PC
-static int
-read_legacy_video_BIOS(struct pci_device *dev, unsigned char *Buf)
-{
- const ADDRESS Base = 0xC0000;
- const int Len = 0x10000 * 2;
- const int pagemask = getpagesize() - 1;
- const ADDRESS offset = Base & ~pagemask;
- const unsigned long size = ((Base + Len + pagemask) & ~pagemask) - offset;
- unsigned char *ptr, *src;
- int len;
-
-
- /* Try to use the civilized PCI interface first.
- */
- if (pci_device_read_rom(dev, Buf) == 0) {
- return dev->rom_size;
- }
-
- ptr = xf86MapDomainMemory(-1, VIDMEM_READONLY, dev, offset, size);
-
- if (!ptr)
- return -1;
-
- /* Using memcpy() here can hang the system */
- src = ptr + (Base - offset);
- for (len = 0; len < (Len / 2); len++) {
- Buf[len] = src[len];
- }
-
- if ((Buf[0] == 0x55) && (Buf[1] == 0xAA) && (Buf[2] > 0x80)) {
- for ( /* empty */ ; len < Len; len++) {
- Buf[len] = src[len];
- }
- }
-
- xf86UnMapVidMem(-1, ptr, size);
-
- return Len;
-}
-#endif /* _PC */
-
-
-xf86Int10InfoPtr
-xf86ExtendedInitInt10(int entityIndex, int Flags)
-{
- xf86Int10InfoPtr pInt;
- void* base = 0;
- void* vbiosMem = 0;
- void* options = NULL;
- int screen;
- legacyVGARec vga;
-
-#if 0
- CARD32 cs;
-#endif
-
- screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex;
-
- options = xf86HandleInt10Options(xf86Screens[screen],entityIndex);
-
- if (int10skip(options)) {
- free(options);
- return NULL;
- }
-
- pInt = (xf86Int10InfoPtr)xnfcalloc(1, sizeof(xf86Int10InfoRec));
- pInt->entityIndex = entityIndex;
- if (!xf86Int10ExecSetup(pInt))
- goto error0;
- pInt->mem = &genericMem;
- pInt->private = (pointer)xnfcalloc(1, sizeof(genericInt10Priv));
- INTPriv(pInt)->alloc = (pointer)xnfcalloc(1, ALLOC_ENTRIES(getpagesize()));
- pInt->scrnIndex = screen;
- base = INTPriv(pInt)->base = xnfalloc(SYS_BIOS);
-
- /* FIXME: Shouldn't this be a failure case? Leaving dev as NULL seems like
- * FIXME: an error
- */
- pInt->dev = xf86GetPciInfoForEntity(entityIndex);
-
- /*
- * we need to map video RAM MMIO as some chipsets map mmio
- * registers into this range.
- */
- MapVRam(pInt);
-#ifdef _PC
- if (!sysMem)
- sysMem = xf86MapVidMem(screen, VIDMEM_MMIO, V_BIOS,
- BIOS_SIZE + SYS_BIOS - V_BIOS);
- INTPriv(pInt)->sysMem = sysMem;
-
- if (xf86ReadBIOS(0, 0, base, LOW_PAGE_SIZE) < 0) {
- xf86DrvMsg(screen, X_ERROR, "Cannot read int vect\n");
- goto error1;
- }
-
- /*
- * Retrieve everything between V_BIOS and SYS_BIOS as some system BIOSes
- * have executable code there. Note that xf86ReadBIOS() can only read in
- * 64kB at a time.
- */
- memset((char *)base + V_BIOS, 0, SYS_BIOS - V_BIOS);
-#if 0
- for (cs = V_BIOS; cs < SYS_BIOS; cs += V_BIOS_SIZE)
- if (xf86ReadBIOS(cs, 0, (unsigned char *)base + cs, V_BIOS_SIZE) <
- V_BIOS_SIZE)
- xf86DrvMsg(screen, X_WARNING,
- "Unable to retrieve all of segment 0x%06X.\n", cs);
-#endif
- INTPriv(pInt)->highMemory = V_BIOS;
-
- if (xf86IsEntityPrimary(entityIndex) && !(initPrimary(options))) {
- if (!xf86int10GetBiosSegment(pInt, (unsigned char *)sysMem - V_BIOS))
- goto error1;
-
- set_return_trap(pInt);
-
- pInt->Flags = Flags & (SET_BIOS_SCRATCH | RESTORE_BIOS_SCRATCH);
- if (! (pInt->Flags & SET_BIOS_SCRATCH))
- pInt->Flags &= ~RESTORE_BIOS_SCRATCH;
- xf86Int10SaveRestoreBIOSVars(pInt, TRUE);
-
- } else {
- const BusType location_type = xf86int10GetBiosLocationType(pInt);
- int bios_location = V_BIOS;
-
- reset_int_vect(pInt);
- set_return_trap(pInt);
-
- switch (location_type) {
- case BUS_PCI: {
- int err;
- struct pci_device *rom_device =
- xf86GetPciInfoForEntity(pInt->entityIndex);
-
- vbiosMem = (unsigned char *)base + bios_location;
- err = pci_device_read_rom(rom_device, vbiosMem);
- if (err) {
- xf86DrvMsg(screen,X_ERROR,"Cannot read V_BIOS (3) %s\n",
- strerror(err));
- goto error1;
- }
- INTPriv(pInt)->highMemory = GET_HIGH_BASE(rom_device->rom_size);
- break;
- }
- default:
- goto error1;
- }
- pInt->BIOSseg = V_BIOS >> 4;
- pInt->num = 0xe6;
- LockLegacyVGA(pInt, &vga);
- xf86ExecX86int10(pInt);
- UnlockLegacyVGA(pInt, &vga);
- }
-#else
- if (!sysMem) {
- sysMem = xnfalloc(BIOS_SIZE);
- setup_system_bios(sysMem);
- }
- INTPriv(pInt)->sysMem = sysMem;
- setup_int_vect(pInt);
- set_return_trap(pInt);
-
- /* Retrieve the entire legacy video BIOS segment. This can be upto
- * 128KiB.
- */
- vbiosMem = (char *)base + V_BIOS;
- memset(vbiosMem, 0, 2 * V_BIOS_SIZE);
- if (read_legacy_video_BIOS(pInt->dev, vbiosMem) < V_BIOS_SIZE) {
- xf86DrvMsg(screen, X_WARNING,
- "Unable to retrieve all of segment 0x0C0000.\n");
- }
-
- /*
- * If this adapter is the primary, use its post-init BIOS (if we can find
- * it).
- */
- {
- int bios_location = V_BIOS;
- Bool done = FALSE;
- vbiosMem = (unsigned char *)base + bios_location;
-
- if (xf86IsEntityPrimary(entityIndex)) {
- if (int10_check_bios(screen, bios_location >> 4, vbiosMem))
- done = TRUE;
- else
- xf86DrvMsg(screen,X_INFO,
- "No legacy BIOS found -- trying PCI\n");
- }
- if (!done) {
- int err;
- struct pci_device *rom_device =
- xf86GetPciInfoForEntity(pInt->entityIndex);
-
- err = pci_device_read_rom(rom_device, vbiosMem);
- if (err) {
- xf86DrvMsg(screen,X_ERROR,"Cannot read V_BIOS (5) %s\n",
- strerror(err));
- goto error1;
- }
- }
- }
-
- pInt->BIOSseg = V_BIOS >> 4;
- pInt->num = 0xe6;
- LockLegacyVGA(pInt, &vga);
- xf86ExecX86int10(pInt);
- UnlockLegacyVGA(pInt, &vga);
-#endif
- free(options);
- return pInt;
-
- error1:
- free(base);
- UnmapVRam(pInt);
- free(INTPriv(pInt)->alloc);
- free(pInt->private);
- error0:
- free(pInt);
- free(options);
-
- return NULL;
-}
-
-static void
-MapVRam(xf86Int10InfoPtr pInt)
-{
- int pagesize = getpagesize();
- int size = ((VRAM_SIZE + pagesize - 1) / pagesize) * pagesize;
-
- INTPriv(pInt)->vRam = xf86MapDomainMemory(pInt->scrnIndex, VIDMEM_MMIO,
- pInt->dev, V_RAM, size);
-
- pInt->ioBase = xf86Screens[pInt->scrnIndex]->domainIOBase;
-}
-
-static void
-UnmapVRam(xf86Int10InfoPtr pInt)
-{
- int screen = pInt->scrnIndex;
- int pagesize = getpagesize();
- int size = ((VRAM_SIZE + pagesize - 1)/pagesize) * pagesize;
-
- xf86UnMapVidMem(screen, INTPriv(pInt)->vRam, size);
-}
-
-Bool
-MapCurrentInt10(xf86Int10InfoPtr pInt)
-{
- /* nothing to do here */
- return TRUE;
-}
-
-void
-xf86FreeInt10(xf86Int10InfoPtr pInt)
-{
- if (!pInt)
- return;
-#if defined (_PC)
- xf86Int10SaveRestoreBIOSVars(pInt, FALSE);
-#endif
- if (Int10Current == pInt)
- Int10Current = NULL;
- free(INTPriv(pInt)->base);
- UnmapVRam(pInt);
- free(INTPriv(pInt)->alloc);
- free(pInt->private);
- free(pInt);
-}
-
-void *
-xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off)
-{
- int pagesize = getpagesize();
- int num_pages = ALLOC_ENTRIES(pagesize);
- int i,j;
-
- for (i = 0; i < (num_pages - num); i++) {
- if (INTPriv(pInt)->alloc[i] == 0) {
- for (j = i; j < (num + i); j++)
- if (INTPriv(pInt)->alloc[j] != 0)
- break;
- if (j == (num + i))
- break;
- i += num;
- }
- }
- if (i == (num_pages - num))
- return NULL;
-
- for (j = i; j < (i + num); j++)
- INTPriv(pInt)->alloc[j] = 1;
-
- *off = (i + 1) * pagesize;
-
- return (char *)INTPriv(pInt)->base + *off;
-}
-
-void
-xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num)
-{
- int pagesize = getpagesize();
- int first = (((char *)pbase - (char *)INTPriv(pInt)->base) / pagesize) - 1;
- int i;
-
- for (i = first; i < (first + num); i++)
- INTPriv(pInt)->alloc[i] = 0;
-}
-
-#define OFF(addr) ((addr) & 0xffff)
-#if defined _PC
-# define HIGH_OFFSET (INTPriv(pInt)->highMemory)
-# define HIGH_BASE V_BIOS
-#else
-# define HIGH_OFFSET SYS_BIOS
-# define HIGH_BASE SYS_BIOS
-#endif
-# define SYS(addr) ((addr) >= HIGH_OFFSET)
-#define V_ADDR(addr) \
- (SYS(addr) ? ((char*)INTPriv(pInt)->sysMem) + (addr - HIGH_BASE) \
- : (((char*)(INTPriv(pInt)->base) + addr)))
-#define VRAM_ADDR(addr) (addr - V_RAM)
-#define VRAM_BASE (INTPriv(pInt)->vRam)
-
-#define VRAM(addr) ((addr >= V_RAM) && (addr < (V_RAM + VRAM_SIZE)))
-#define V_ADDR_RB(addr) \
- (VRAM(addr)) ? MMIO_IN8((CARD8*)VRAM_BASE,VRAM_ADDR(addr)) \
- : *(CARD8*) V_ADDR(addr)
-#define V_ADDR_RW(addr) \
- (VRAM(addr)) ? MMIO_IN16((CARD16*)VRAM_BASE,VRAM_ADDR(addr)) \
- : ldw_u((pointer)V_ADDR(addr))
-#define V_ADDR_RL(addr) \
- (VRAM(addr)) ? MMIO_IN32((CARD32*)VRAM_BASE,VRAM_ADDR(addr)) \
- : ldl_u((pointer)V_ADDR(addr))
-
-#define V_ADDR_WB(addr,val) \
- if(VRAM(addr)) \
- MMIO_OUT8((CARD8*)VRAM_BASE,VRAM_ADDR(addr),val); \
- else \
- *(CARD8*) V_ADDR(addr) = val;
-#define V_ADDR_WW(addr,val) \
- if(VRAM(addr)) \
- MMIO_OUT16((CARD16*)VRAM_BASE,VRAM_ADDR(addr),val); \
- else \
- stw_u((val),(pointer)(V_ADDR(addr)));
-
-#define V_ADDR_WL(addr,val) \
- if (VRAM(addr)) \
- MMIO_OUT32((CARD32*)VRAM_BASE,VRAM_ADDR(addr),val); \
- else \
- stl_u(val,(pointer)(V_ADDR(addr)));
-
-static CARD8
-read_b(xf86Int10InfoPtr pInt, int addr)
-{
- return V_ADDR_RB(addr);
-}
-
-static CARD16
-read_w(xf86Int10InfoPtr pInt, int addr)
-{
-#if X_BYTE_ORDER == X_LITTLE_ENDIAN
- if (OFF(addr + 1) > 0)
- return V_ADDR_RW(addr);
-#endif
- return V_ADDR_RB(addr) | (V_ADDR_RB(addr + 1) << 8);
-}
-
-static CARD32
-read_l(xf86Int10InfoPtr pInt, int addr)
-{
-#if X_BYTE_ORDER == X_LITTLE_ENDIAN
- if (OFF(addr + 3) > 2)
- return V_ADDR_RL(addr);
-#endif
- return V_ADDR_RB(addr) |
- (V_ADDR_RB(addr + 1) << 8) |
- (V_ADDR_RB(addr + 2) << 16) |
- (V_ADDR_RB(addr + 3) << 24);
-}
-
-static void
-write_b(xf86Int10InfoPtr pInt, int addr, CARD8 val)
-{
- V_ADDR_WB(addr,val);
-}
-
-static void
-write_w(xf86Int10InfoPtr pInt, int addr, CARD16 val)
-{
-#if X_BYTE_ORDER == X_LITTLE_ENDIAN
- if (OFF(addr + 1) > 0)
- { V_ADDR_WW(addr, val); }
-#endif
- V_ADDR_WB(addr, val);
- V_ADDR_WB(addr + 1, val >> 8);
-}
-
-static void
-write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val)
-{
-#if X_BYTE_ORDER == X_LITTLE_ENDIAN
- if (OFF(addr + 3) > 2)
- { V_ADDR_WL(addr, val); }
-#endif
- V_ADDR_WB(addr, val);
- V_ADDR_WB(addr + 1, val >> 8);
- V_ADDR_WB(addr + 2, val >> 16);
- V_ADDR_WB(addr + 3, val >> 24);
-}
-
-pointer
-xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr)
-{
- return V_ADDR(addr);
-}
+/*
+ * XFree86 int10 module
+ * execute BIOS int 10h calls in x86 real mode environment
+ * Copyright 1999 Egbert Eich
+ */
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <string.h>
+#include <unistd.h>
+
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "compiler.h"
+#define _INT10_PRIVATE
+#include "xf86int10.h"
+#include "int10Defines.h"
+#include "Pci.h"
+
+#define ALLOC_ENTRIES(x) ((V_RAM / x) - 1)
+
+static CARD8 read_b(xf86Int10InfoPtr pInt,int addr);
+static CARD16 read_w(xf86Int10InfoPtr pInt,int addr);
+static CARD32 read_l(xf86Int10InfoPtr pInt,int addr);
+static void write_b(xf86Int10InfoPtr pInt,int addr, CARD8 val);
+static void write_w(xf86Int10InfoPtr pInt,int addr, CARD16 val);
+static void write_l(xf86Int10InfoPtr pInt,int addr, CARD32 val);
+
+/*
+ * the emulator cannot pass a pointer to the current xf86Int10InfoRec
+ * to the memory access functions therefore store it here.
+ */
+
+typedef struct {
+ int shift;
+ int entries;
+ void* base;
+ void* vRam;
+ int highMemory;
+ void* sysMem;
+ char* alloc;
+} genericInt10Priv;
+
+#define INTPriv(x) ((genericInt10Priv*)x->private)
+
+int10MemRec genericMem = {
+ read_b,
+ read_w,
+ read_l,
+ write_b,
+ write_w,
+ write_l
+};
+
+static void MapVRam(xf86Int10InfoPtr pInt);
+static void UnmapVRam(xf86Int10InfoPtr pInt);
+#ifdef _PC
+#define GET_HIGH_BASE(x) (((V_BIOS + (x) + getpagesize() - 1)/getpagesize()) \
+ * getpagesize())
+#endif
+
+static void *sysMem = NULL;
+
+/**
+ * Read legacy VGA video BIOS associated with specified domain.
+ *
+ * Attempts to read up to 128KiB of legacy VGA video BIOS.
+ *
+ * \return
+ * The number of bytes read on success or -1 on failure.
+ *
+ * \bug
+ * PCI ROMs can contain multiple BIOS images (e.g., OpenFirmware, x86 VGA,
+ * etc.). How do we know that \c pci_device_read_rom will return the
+ * legacy VGA BIOS image?
+ */
+#ifndef _PC
+static int
+read_legacy_video_BIOS(struct pci_device *dev, unsigned char *Buf)
+{
+ const ADDRESS Base = 0xC0000;
+ const int Len = 0x10000 * 2;
+ const int pagemask = getpagesize() - 1;
+ const ADDRESS offset = Base & ~pagemask;
+ const unsigned long size = ((Base + Len + pagemask) & ~pagemask) - offset;
+ unsigned char *ptr, *src;
+ int len;
+
+
+ /* Try to use the civilized PCI interface first.
+ */
+ if (pci_device_read_rom(dev, Buf) == 0) {
+ return dev->rom_size;
+ }
+
+ ptr = xf86MapDomainMemory(-1, VIDMEM_READONLY, dev, offset, size);
+
+ if (!ptr)
+ return -1;
+
+ /* Using memcpy() here can hang the system */
+ src = ptr + (Base - offset);
+ for (len = 0; len < (Len / 2); len++) {
+ Buf[len] = src[len];
+ }
+
+ if ((Buf[0] == 0x55) && (Buf[1] == 0xAA) && (Buf[2] > 0x80)) {
+ for ( /* empty */ ; len < Len; len++) {
+ Buf[len] = src[len];
+ }
+ }
+
+ xf86UnMapVidMem(-1, ptr, size);
+
+ return Len;
+}
+#endif /* _PC */
+
+
+xf86Int10InfoPtr
+xf86ExtendedInitInt10(int entityIndex, int Flags)
+{
+ xf86Int10InfoPtr pInt;
+ void* base = 0;
+ void* vbiosMem = 0;
+ void* options = NULL;
+ int screen;
+ legacyVGARec vga;
+
+ screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex;
+
+ options = xf86HandleInt10Options(xf86Screens[screen],entityIndex);
+
+ if (int10skip(options)) {
+ free(options);
+ return NULL;
+ }
+
+ pInt = (xf86Int10InfoPtr)xnfcalloc(1, sizeof(xf86Int10InfoRec));
+ pInt->entityIndex = entityIndex;
+ if (!xf86Int10ExecSetup(pInt))
+ goto error0;
+ pInt->mem = &genericMem;
+ pInt->private = (pointer)xnfcalloc(1, sizeof(genericInt10Priv));
+ INTPriv(pInt)->alloc = (pointer)xnfcalloc(1, ALLOC_ENTRIES(getpagesize()));
+ pInt->scrnIndex = screen;
+ base = INTPriv(pInt)->base = xnfalloc(SYS_BIOS);
+
+ /* FIXME: Shouldn't this be a failure case? Leaving dev as NULL seems like
+ * FIXME: an error
+ */
+ pInt->dev = xf86GetPciInfoForEntity(entityIndex);
+
+ /*
+ * we need to map video RAM MMIO as some chipsets map mmio
+ * registers into this range.
+ */
+ MapVRam(pInt);
+#ifdef _PC
+ if (!sysMem)
+ sysMem = xf86MapVidMem(screen, VIDMEM_MMIO, V_BIOS,
+ BIOS_SIZE + SYS_BIOS - V_BIOS);
+ INTPriv(pInt)->sysMem = sysMem;
+
+ if (xf86ReadBIOS(0, 0, base, LOW_PAGE_SIZE) < 0) {
+ xf86DrvMsg(screen, X_ERROR, "Cannot read int vect\n");
+ goto error1;
+ }
+
+ /*
+ * Retrieve everything between V_BIOS and SYS_BIOS as some system BIOSes
+ * have executable code there.
+ */
+ memset((char *)base + V_BIOS, 0, SYS_BIOS - V_BIOS);
+ INTPriv(pInt)->highMemory = V_BIOS;
+
+ if (xf86IsEntityPrimary(entityIndex) && !(initPrimary(options))) {
+ if (!xf86int10GetBiosSegment(pInt, (unsigned char *)sysMem - V_BIOS))
+ goto error1;
+
+ set_return_trap(pInt);
+
+ pInt->Flags = Flags & (SET_BIOS_SCRATCH | RESTORE_BIOS_SCRATCH);
+ if (! (pInt->Flags & SET_BIOS_SCRATCH))
+ pInt->Flags &= ~RESTORE_BIOS_SCRATCH;
+ xf86Int10SaveRestoreBIOSVars(pInt, TRUE);
+
+ } else {
+ const BusType location_type = xf86int10GetBiosLocationType(pInt);
+ int bios_location = V_BIOS;
+
+ reset_int_vect(pInt);
+ set_return_trap(pInt);
+
+ switch (location_type) {
+ case BUS_PCI: {
+ int err;
+ struct pci_device *rom_device =
+ xf86GetPciInfoForEntity(pInt->entityIndex);
+
+ vbiosMem = (unsigned char *)base + bios_location;
+ err = pci_device_read_rom(rom_device, vbiosMem);
+ if (err) {
+ xf86DrvMsg(screen,X_ERROR,"Cannot read V_BIOS (3) %s\n",
+ strerror(err));
+ goto error1;
+ }
+ INTPriv(pInt)->highMemory = GET_HIGH_BASE(rom_device->rom_size);
+ break;
+ }
+ default:
+ goto error1;
+ }
+ pInt->BIOSseg = V_BIOS >> 4;
+ pInt->num = 0xe6;
+ LockLegacyVGA(pInt, &vga);
+ xf86ExecX86int10(pInt);
+ UnlockLegacyVGA(pInt, &vga);
+ }
+#else
+ if (!sysMem) {
+ sysMem = xnfalloc(BIOS_SIZE);
+ setup_system_bios(sysMem);
+ }
+ INTPriv(pInt)->sysMem = sysMem;
+ setup_int_vect(pInt);
+ set_return_trap(pInt);
+
+ /* Retrieve the entire legacy video BIOS segment. This can be upto
+ * 128KiB.
+ */
+ vbiosMem = (char *)base + V_BIOS;
+ memset(vbiosMem, 0, 2 * V_BIOS_SIZE);
+ if (read_legacy_video_BIOS(pInt->dev, vbiosMem) < V_BIOS_SIZE) {
+ xf86DrvMsg(screen, X_WARNING,
+ "Unable to retrieve all of segment 0x0C0000.\n");
+ }
+
+ /*
+ * If this adapter is the primary, use its post-init BIOS (if we can find
+ * it).
+ */
+ {
+ int bios_location = V_BIOS;
+ Bool done = FALSE;
+ vbiosMem = (unsigned char *)base + bios_location;
+
+ if (xf86IsEntityPrimary(entityIndex)) {
+ if (int10_check_bios(screen, bios_location >> 4, vbiosMem))
+ done = TRUE;
+ else
+ xf86DrvMsg(screen,X_INFO,
+ "No legacy BIOS found -- trying PCI\n");
+ }
+ if (!done) {
+ int err;
+ struct pci_device *rom_device =
+ xf86GetPciInfoForEntity(pInt->entityIndex);
+
+ err = pci_device_read_rom(rom_device, vbiosMem);
+ if (err) {
+ xf86DrvMsg(screen,X_ERROR,"Cannot read V_BIOS (5) %s\n",
+ strerror(err));
+ goto error1;
+ }
+ }
+ }
+
+ pInt->BIOSseg = V_BIOS >> 4;
+ pInt->num = 0xe6;
+ LockLegacyVGA(pInt, &vga);
+ xf86ExecX86int10(pInt);
+ UnlockLegacyVGA(pInt, &vga);
+#endif
+ free(options);
+ return pInt;
+
+ error1:
+ free(base);
+ UnmapVRam(pInt);
+ free(INTPriv(pInt)->alloc);
+ free(pInt->private);
+ error0:
+ free(pInt);
+ free(options);
+
+ return NULL;
+}
+
+static void
+MapVRam(xf86Int10InfoPtr pInt)
+{
+ int pagesize = getpagesize();
+ int size = ((VRAM_SIZE + pagesize - 1) / pagesize) * pagesize;
+
+ INTPriv(pInt)->vRam = xf86MapDomainMemory(pInt->scrnIndex, VIDMEM_MMIO,
+ pInt->dev, V_RAM, size);
+
+ pInt->ioBase = xf86Screens[pInt->scrnIndex]->domainIOBase;
+}
+
+static void
+UnmapVRam(xf86Int10InfoPtr pInt)
+{
+ int screen = pInt->scrnIndex;
+ int pagesize = getpagesize();
+ int size = ((VRAM_SIZE + pagesize - 1)/pagesize) * pagesize;
+
+ xf86UnMapVidMem(screen, INTPriv(pInt)->vRam, size);
+}
+
+Bool
+MapCurrentInt10(xf86Int10InfoPtr pInt)
+{
+ /* nothing to do here */
+ return TRUE;
+}
+
+void
+xf86FreeInt10(xf86Int10InfoPtr pInt)
+{
+ if (!pInt)
+ return;
+#if defined (_PC)
+ xf86Int10SaveRestoreBIOSVars(pInt, FALSE);
+#endif
+ if (Int10Current == pInt)
+ Int10Current = NULL;
+ free(INTPriv(pInt)->base);
+ UnmapVRam(pInt);
+ free(INTPriv(pInt)->alloc);
+ free(pInt->private);
+ free(pInt);
+}
+
+void *
+xf86Int10AllocPages(xf86Int10InfoPtr pInt, int num, int *off)
+{
+ int pagesize = getpagesize();
+ int num_pages = ALLOC_ENTRIES(pagesize);
+ int i,j;
+
+ for (i = 0; i < (num_pages - num); i++) {
+ if (INTPriv(pInt)->alloc[i] == 0) {
+ for (j = i; j < (num + i); j++)
+ if (INTPriv(pInt)->alloc[j] != 0)
+ break;
+ if (j == (num + i))
+ break;
+ i += num;
+ }
+ }
+ if (i == (num_pages - num))
+ return NULL;
+
+ for (j = i; j < (i + num); j++)
+ INTPriv(pInt)->alloc[j] = 1;
+
+ *off = (i + 1) * pagesize;
+
+ return (char *)INTPriv(pInt)->base + *off;
+}
+
+void
+xf86Int10FreePages(xf86Int10InfoPtr pInt, void *pbase, int num)
+{
+ int pagesize = getpagesize();
+ int first = (((char *)pbase - (char *)INTPriv(pInt)->base) / pagesize) - 1;
+ int i;
+
+ for (i = first; i < (first + num); i++)
+ INTPriv(pInt)->alloc[i] = 0;
+}
+
+#define OFF(addr) ((addr) & 0xffff)
+#if defined _PC
+# define HIGH_OFFSET (INTPriv(pInt)->highMemory)
+# define HIGH_BASE V_BIOS
+#else
+# define HIGH_OFFSET SYS_BIOS
+# define HIGH_BASE SYS_BIOS
+#endif
+# define SYS(addr) ((addr) >= HIGH_OFFSET)
+#define V_ADDR(addr) \
+ (SYS(addr) ? ((char*)INTPriv(pInt)->sysMem) + (addr - HIGH_BASE) \
+ : (((char*)(INTPriv(pInt)->base) + addr)))
+#define VRAM_ADDR(addr) (addr - V_RAM)
+#define VRAM_BASE (INTPriv(pInt)->vRam)
+
+#define VRAM(addr) ((addr >= V_RAM) && (addr < (V_RAM + VRAM_SIZE)))
+#define V_ADDR_RB(addr) \
+ (VRAM(addr)) ? MMIO_IN8((CARD8*)VRAM_BASE,VRAM_ADDR(addr)) \
+ : *(CARD8*) V_ADDR(addr)
+#define V_ADDR_RW(addr) \
+ (VRAM(addr)) ? MMIO_IN16((CARD16*)VRAM_BASE,VRAM_ADDR(addr)) \
+ : ldw_u((pointer)V_ADDR(addr))
+#define V_ADDR_RL(addr) \
+ (VRAM(addr)) ? MMIO_IN32((CARD32*)VRAM_BASE,VRAM_ADDR(addr)) \
+ : ldl_u((pointer)V_ADDR(addr))
+
+#define V_ADDR_WB(addr,val) \
+ if(VRAM(addr)) \
+ MMIO_OUT8((CARD8*)VRAM_BASE,VRAM_ADDR(addr),val); \
+ else \
+ *(CARD8*) V_ADDR(addr) = val;
+#define V_ADDR_WW(addr,val) \
+ if(VRAM(addr)) \
+ MMIO_OUT16((CARD16*)VRAM_BASE,VRAM_ADDR(addr),val); \
+ else \
+ stw_u((val),(pointer)(V_ADDR(addr)));
+
+#define V_ADDR_WL(addr,val) \
+ if (VRAM(addr)) \
+ MMIO_OUT32((CARD32*)VRAM_BASE,VRAM_ADDR(addr),val); \
+ else \
+ stl_u(val,(pointer)(V_ADDR(addr)));
+
+static CARD8
+read_b(xf86Int10InfoPtr pInt, int addr)
+{
+ return V_ADDR_RB(addr);
+}
+
+static CARD16
+read_w(xf86Int10InfoPtr pInt, int addr)
+{
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+ if (OFF(addr + 1) > 0)
+ return V_ADDR_RW(addr);
+#endif
+ return V_ADDR_RB(addr) | (V_ADDR_RB(addr + 1) << 8);
+}
+
+static CARD32
+read_l(xf86Int10InfoPtr pInt, int addr)
+{
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+ if (OFF(addr + 3) > 2)
+ return V_ADDR_RL(addr);
+#endif
+ return V_ADDR_RB(addr) |
+ (V_ADDR_RB(addr + 1) << 8) |
+ (V_ADDR_RB(addr + 2) << 16) |
+ (V_ADDR_RB(addr + 3) << 24);
+}
+
+static void
+write_b(xf86Int10InfoPtr pInt, int addr, CARD8 val)
+{
+ V_ADDR_WB(addr,val);
+}
+
+static void
+write_w(xf86Int10InfoPtr pInt, int addr, CARD16 val)
+{
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+ if (OFF(addr + 1) > 0)
+ { V_ADDR_WW(addr, val); }
+#endif
+ V_ADDR_WB(addr, val);
+ V_ADDR_WB(addr + 1, val >> 8);
+}
+
+static void
+write_l(xf86Int10InfoPtr pInt, int addr, CARD32 val)
+{
+#if X_BYTE_ORDER == X_LITTLE_ENDIAN
+ if (OFF(addr + 3) > 2)
+ { V_ADDR_WL(addr, val); }
+#endif
+ V_ADDR_WB(addr, val);
+ V_ADDR_WB(addr + 1, val >> 8);
+ V_ADDR_WB(addr + 2, val >> 16);
+ V_ADDR_WB(addr + 3, val >> 24);
+}
+
+pointer
+xf86int10Addr(xf86Int10InfoPtr pInt, CARD32 addr)
+{
+ return V_ADDR(addr);
+}
diff --git a/xorg-server/hw/xfree86/int10/helper_exec.c b/xorg-server/hw/xfree86/int10/helper_exec.c
index 1043fcde7..44d8a7fcd 100644
--- a/xorg-server/hw/xfree86/int10/helper_exec.c
+++ b/xorg-server/hw/xfree86/int10/helper_exec.c
@@ -1,733 +1,733 @@
-/*
- * XFree86 int10 module
- * execute BIOS int 10h calls in x86 real mode environment
- * Copyright 1999 Egbert Eich
- *
- * Part of this code was inspired by the VBIOS POSTing code in DOSEMU
- * developed by the "DOSEMU-Development-Team"
- */
-
-/*
- * To debug port accesses define PRINT_PORT to 1.
- * Note! You also have to comment out ioperm()
- * in xf86EnableIO(). Otherwise we won't trap
- * on PIO.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#define PRINT_PORT 0
-
-#include <unistd.h>
-
-#include <X11/Xos.h>
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "compiler.h"
-#define _INT10_PRIVATE
-#include "int10Defines.h"
-#include "xf86int10.h"
-#include "Pci.h"
-#ifdef _X86EMU
-#include "x86emu/x86emui.h"
-#else
-#define DEBUG_IO_TRACE() 0
-#endif
-#include <pciaccess.h>
-
-static int pciCfg1in(CARD16 addr, CARD32 *val);
-static int pciCfg1out(CARD16 addr, CARD32 val);
-static int pciCfg1inw(CARD16 addr, CARD16 *val);
-static int pciCfg1outw(CARD16 addr, CARD16 val);
-static int pciCfg1inb(CARD16 addr, CARD8 *val);
-static int pciCfg1outb(CARD16 addr, CARD8 val);
-#if defined (_PC)
-static void SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set);
-#endif
-
-#define REG pInt
-
-int
-setup_int(xf86Int10InfoPtr pInt)
-{
- if (pInt != Int10Current) {
- if (!MapCurrentInt10(pInt))
- return -1;
- Int10Current = pInt;
- }
- X86_EAX = (CARD32) pInt->ax;
- X86_EBX = (CARD32) pInt->bx;
- X86_ECX = (CARD32) pInt->cx;
- X86_EDX = (CARD32) pInt->dx;
- X86_ESI = (CARD32) pInt->si;
- X86_EDI = (CARD32) pInt->di;
- X86_EBP = (CARD32) pInt->bp;
- X86_ESP = 0x1000; X86_SS = pInt->stackseg >> 4;
- X86_EIP = 0x0600; X86_CS = 0x0; /* address of 'hlt' */
- X86_DS = 0x40; /* standard pc ds */
- X86_ES = pInt->es;
- X86_FS = 0;
- X86_GS = 0;
- X86_EFLAGS = X86_IF_MASK | X86_IOPL_MASK;
-#if defined (_PC)
- if (pInt->Flags & SET_BIOS_SCRATCH)
- SetResetBIOSVars(pInt, TRUE);
-#endif
- OsBlockSignals();
- return 0;
-}
-
-void
-finish_int(xf86Int10InfoPtr pInt, int sig)
-{
- OsReleaseSignals();
- pInt->ax = (CARD32) X86_EAX;
- pInt->bx = (CARD32) X86_EBX;
- pInt->cx = (CARD32) X86_ECX;
- pInt->dx = (CARD32) X86_EDX;
- pInt->si = (CARD32) X86_ESI;
- pInt->di = (CARD32) X86_EDI;
- pInt->es = (CARD16) X86_ES;
- pInt->bp = (CARD32) X86_EBP;
- pInt->flags = (CARD32) X86_FLAGS;
-#if defined (_PC)
- if (pInt->Flags & RESTORE_BIOS_SCRATCH)
- SetResetBIOSVars(pInt, FALSE);
-#endif
-}
-
-/* general software interrupt handler */
-CARD32
-getIntVect(xf86Int10InfoPtr pInt,int num)
-{
- return MEM_RW(pInt, num << 2) + (MEM_RW(pInt, (num << 2) + 2) << 4);
-}
-
-void
-pushw(xf86Int10InfoPtr pInt, CARD16 val)
-{
- X86_ESP -= 2;
- MEM_WW(pInt, ((CARD32) X86_SS << 4) + X86_SP, val);
-}
-
-int
-run_bios_int(int num, xf86Int10InfoPtr pInt)
-{
- CARD32 eflags;
-#ifndef _PC
- /* check if bios vector is initialized */
- if (MEM_RW(pInt, (num << 2) + 2) == (SYS_BIOS >> 4)) { /* SYS_BIOS_SEG ?*/
-
- if (num == 21 && X86_AH == 0x4e) {
- xf86DrvMsg(pInt->scrnIndex, X_NOTICE,
- "Failing Find-Matching-File on non-PC"
- " (int 21, func 4e)\n");
- X86_AX = 2;
- SET_FLAG(F_CF);
- return 1;
- } else {
- xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
- "Ignoring int 0x%02x call\n", num);
- if (xf86GetVerbosity() > 3) {
- dump_registers(pInt);
- stack_trace(pInt);
- }
- return 1;
- }
- }
-#endif
-#ifdef PRINT_INT
- ErrorF("calling card BIOS at: ");
-#endif
- eflags = X86_EFLAGS;
-#if 0
- eflags = eflags | IF_MASK;
- X86_EFLAGS = X86_EFLAGS & ~(VIF_MASK | TF_MASK | IF_MASK | NT_MASK);
-#endif
- pushw(pInt, eflags);
- pushw(pInt, X86_CS);
- pushw(pInt, X86_IP);
- X86_CS = MEM_RW(pInt, (num << 2) + 2);
- X86_IP = MEM_RW(pInt, num << 2);
-#ifdef PRINT_INT
- ErrorF("0x%x:%lx\n", X86_CS, X86_EIP);
-#endif
- return 1;
-}
-
-/* Debugging stuff */
-void
-dump_code(xf86Int10InfoPtr pInt)
-{
- int i;
- unsigned long lina = SEG_ADR((CARD32), X86_CS, IP);
-
- xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, "code at 0x%8.8lx:\n", lina);
- for (i=0; i<0x10; i++)
- xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i));
- xf86ErrorFVerb(3, "\n");
- for (; i<0x20; i++)
- xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i));
- xf86ErrorFVerb(3, "\n");
-}
-
-void
-dump_registers(xf86Int10InfoPtr pInt)
-{
- xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
- "EAX=0x%8.8lx, EBX=0x%8.8lx, ECX=0x%8.8lx, EDX=0x%8.8lx\n",
- (unsigned long)X86_EAX, (unsigned long)X86_EBX,
- (unsigned long)X86_ECX, (unsigned long)X86_EDX);
- xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
- "ESP=0x%8.8lx, EBP=0x%8.8lx, ESI=0x%8.8lx, EDI=0x%8.8lx\n",
- (unsigned long)X86_ESP, (unsigned long)X86_EBP,
- (unsigned long)X86_ESI, (unsigned long)X86_EDI);
- xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
- "CS=0x%4.4x, SS=0x%4.4x,"
- " DS=0x%4.4x, ES=0x%4.4x, FS=0x%4.4x, GS=0x%4.4x\n",
- X86_CS, X86_SS, X86_DS, X86_ES, X86_FS, X86_GS);
- xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
- "EIP=0x%8.8lx, EFLAGS=0x%8.8lx\n",
- (unsigned long)X86_EIP, (unsigned long)X86_EFLAGS);
-}
-
-void
-stack_trace(xf86Int10InfoPtr pInt)
-{
- int i = 0;
- unsigned long stack = SEG_ADR((CARD32), X86_SS, SP);
- unsigned long tail = (CARD32)((X86_SS << 4) + 0x1000);
-
- if (stack >= tail) return;
-
- xf86MsgVerb(X_INFO, 3, "stack at 0x%8.8lx:\n", stack);
- for (; stack < tail; stack++) {
- xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, stack));
- i = (i + 1) % 0x10;
- if (!i)
- xf86ErrorFVerb(3, "\n");
- }
- if (i)
- xf86ErrorFVerb(3, "\n");
-}
-
-int
-port_rep_inb(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count)
-{
- register int inc = d_f ? -1 : 1;
- CARD32 dst = base;
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" rep_insb(%#x) %ld bytes at %8.8lx %s\n",
- port, count, base, d_f ? "up" : "down");
- while (count--) {
- MEM_WB(pInt, dst, x_inb(port));
- dst += inc;
- }
- return dst - base;
-}
-
-int
-port_rep_inw(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count)
-{
- register int inc = d_f ? -2 : 2;
- CARD32 dst = base;
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" rep_insw(%#x) %ld bytes at %8.8lx %s\n",
- port, count, base, d_f ? "up" : "down");
- while (count--) {
- MEM_WW(pInt, dst, x_inw(port));
- dst += inc;
- }
- return dst - base;
-}
-
-int
-port_rep_inl(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count)
-{
- register int inc = d_f ? -4 : 4;
- CARD32 dst = base;
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" rep_insl(%#x) %ld bytes at %8.8lx %s\n",
- port, count, base, d_f ? "up" : "down");
- while (count--) {
- MEM_WL(pInt, dst, x_inl(port));
- dst += inc;
- }
- return dst - base;
-}
-
-int
-port_rep_outb(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count)
-{
- register int inc = d_f ? -1 : 1;
- CARD32 dst = base;
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" rep_outb(%#x) %ld bytes at %8.8lx %s\n",
- port, count, base, d_f ? "up" : "down");
- while (count--) {
- x_outb(port, MEM_RB(pInt, dst));
- dst += inc;
- }
- return dst - base;
-}
-
-int
-port_rep_outw(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count)
-{
- register int inc = d_f ? -2 : 2;
- CARD32 dst = base;
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" rep_outw(%#x) %ld bytes at %8.8lx %s\n",
- port, count, base, d_f ? "up" : "down");
- while (count--) {
- x_outw(port, MEM_RW(pInt, dst));
- dst += inc;
- }
- return dst - base;
-}
-
-int
-port_rep_outl(xf86Int10InfoPtr pInt,
- CARD16 port, CARD32 base, int d_f, CARD32 count)
-{
- register int inc = d_f ? -4 : 4;
- CARD32 dst = base;
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" rep_outl(%#x) %ld bytes at %8.8lx %s\n",
- port, count, base, d_f ? "up" : "down");
- while (count--) {
- x_outl(port, MEM_RL(pInt, dst));
- dst += inc;
- }
- return dst - base;
-}
-
-CARD8
-x_inb(CARD16 port)
-{
- CARD8 val;
-
- if (port == 0x40) {
- Int10Current->inb40time++;
- val = (CARD8)(Int10Current->inb40time >>
- ((Int10Current->inb40time & 1) << 3));
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" inb(%#x) = %2.2x\n", port, val);
-#ifdef __NOT_YET__
- } else if (port < 0x0100) { /* Don't interfere with mainboard */
- val = 0;
- xf86DrvMsgVerb(Int10Current->scrnIndex, X_NOT_IMPLEMENTED, 2,
- "inb 0x%4.4x\n", port);
- if (xf86GetVerbosity() > 3) {
- dump_registers(Int10Current);
- stack_trace(Int10Current);
- }
-#endif /* __NOT_YET__ */
- } else if (!pciCfg1inb(port, &val)) {
- val = inb(Int10Current->ioBase + port);
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" inb(%#x) = %2.2x\n", port, val);
- }
- return val;
-}
-
-CARD16
-x_inw(CARD16 port)
-{
- CARD16 val;
-
- if (port == 0x5c) {
- struct timeval tv;
-
- /*
- * Emulate a PC98's timer. Typical resolution is 3.26 usec.
- * Approximate this by dividing by 3.
- */
- X_GETTIMEOFDAY(&tv);
- val = (CARD16)(tv.tv_usec / 3);
- } else if (!pciCfg1inw(port, &val)) {
- val = inw(Int10Current->ioBase + port);
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" inw(%#x) = %4.4x\n", port, val);
- }
- return val;
-}
-
-void
-x_outb(CARD16 port, CARD8 val)
-{
- if ((port == 0x43) && (val == 0)) {
- struct timeval tv;
- /*
- * Emulate a PC's timer 0. Such timers typically have a resolution of
- * some .838 usec per tick, but this can only provide 1 usec per tick.
- * (Not that this matters much, given inherent emulation delays.) Use
- * the bottom bit as a byte select. See inb(0x40) above.
- */
- X_GETTIMEOFDAY(&tv);
- Int10Current->inb40time = (CARD16)(tv.tv_usec | 1);
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" outb(%#x, %2.2x)\n", port, val);
-#ifdef __NOT_YET__
- } else if (port < 0x0100) { /* Don't interfere with mainboard */
- xf86DrvMsgVerb(Int10Current->scrnIndex, X_NOT_IMPLEMENTED, 2,
- "outb 0x%4.4x,0x%2.2x\n", port, val);
- if (xf86GetVerbosity() > 3) {
- dump_registers(Int10Current);
- stack_trace(Int10Current);
- }
-#endif /* __NOT_YET__ */
- } else if (!pciCfg1outb(port, val)) {
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" outb(%#x, %2.2x)\n", port, val);
- outb(Int10Current->ioBase + port, val);
- }
-}
-
-void
-x_outw(CARD16 port, CARD16 val)
-{
-
- if (!pciCfg1outw(port, val)) {
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" outw(%#x, %4.4x)\n", port, val);
- outw(Int10Current->ioBase + port, val);
- }
-}
-
-CARD32
-x_inl(CARD16 port)
-{
- CARD32 val;
-
- if (!pciCfg1in(port, &val)) {
- val = inl(Int10Current->ioBase + port);
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" inl(%#x) = %8.8lx\n", port, val);
- }
- return val;
-}
-
-void
-x_outl(CARD16 port, CARD32 val)
-{
- if (!pciCfg1out(port, val)) {
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" outl(%#x, %8.8lx)\n", port, val);
- outl(Int10Current->ioBase + port, val);
- }
-}
-
-CARD8
-Mem_rb(CARD32 addr)
-{
- return (*Int10Current->mem->rb)(Int10Current, addr);
-}
-
-CARD16
-Mem_rw(CARD32 addr)
-{
- return (*Int10Current->mem->rw)(Int10Current, addr);
-}
-
-CARD32
-Mem_rl(CARD32 addr)
-{
- return (*Int10Current->mem->rl)(Int10Current, addr);
-}
-
-void
-Mem_wb(CARD32 addr, CARD8 val)
-{
- (*Int10Current->mem->wb)(Int10Current, addr, val);
-}
-
-void
-Mem_ww(CARD32 addr, CARD16 val)
-{
- (*Int10Current->mem->ww)(Int10Current, addr, val);
-}
-
-void
-Mem_wl(CARD32 addr, CARD32 val)
-{
- (*Int10Current->mem->wl)(Int10Current, addr, val);
-}
-
-static CARD32 PciCfg1Addr = 0;
-
-#define PCI_DOM_FROM_TAG(tag) (((tag) >> 24) & (PCI_DOM_MASK))
-#define PCI_BUS_FROM_TAG(tag) (((tag) >> 16) & (PCI_DOMBUS_MASK))
-#define PCI_DEV_FROM_TAG(tag) (((tag) & 0x0000f800u) >> 11)
-#define PCI_FUNC_FROM_TAG(tag) (((tag) & 0x00000700u) >> 8)
-
-#define PCI_OFFSET(x) ((x) & 0x000000ff)
-#define PCI_TAG(x) ((x) & 0x7fffff00)
-
-static struct pci_device*
-pci_device_for_cfg_address (CARD32 addr)
-{
- struct pci_device *dev = NULL;
- PCITAG tag = PCI_TAG(addr);
- struct pci_slot_match slot_match = {
- .domain = PCI_DOM_FROM_TAG(tag),
- .bus = PCI_BUS_NO_DOMAIN(PCI_BUS_FROM_TAG(tag)),
- .dev = PCI_DEV_FROM_TAG(tag),
- .func = PCI_FUNC_FROM_TAG(tag),
- .match_data = 0
- };
-
- struct pci_device_iterator *iter =
- pci_slot_match_iterator_create (&slot_match);
-
- if (iter)
- dev = pci_device_next(iter);
-
- pci_iterator_destroy(iter);
-
- return dev;
-}
-
-static int
-pciCfg1in(CARD16 addr, CARD32 *val)
-{
- if (addr == 0xCF8) {
- *val = PciCfg1Addr;
- return 1;
- }
- if (addr == 0xCFC) {
- pci_device_cfg_read_u32(pci_device_for_cfg_address(PciCfg1Addr),
- (uint32_t *)val, PCI_OFFSET(PciCfg1Addr));
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" cfg_inl(%#lx) = %8.8lx\n", PciCfg1Addr, *val);
- return 1;
- }
- return 0;
-}
-
-static int
-pciCfg1out(CARD16 addr, CARD32 val)
-{
- if (addr == 0xCF8) {
- PciCfg1Addr = val;
- return 1;
- }
- if (addr == 0xCFC) {
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" cfg_outl(%#lx, %8.8lx)\n", PciCfg1Addr, val);
- pci_device_cfg_write_u32(pci_device_for_cfg_address(PciCfg1Addr),
- val, PCI_OFFSET(PciCfg1Addr));
- return 1;
- }
- return 0;
-}
-
-static int
-pciCfg1inw(CARD16 addr, CARD16 *val)
-{
- int shift;
-
- if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
- shift = (addr - 0xCF8) * 8;
- *val = (PciCfg1Addr >> shift) & 0xffff;
- return 1;
- }
- if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
- const unsigned offset = addr - 0xCFC;
-
- pci_device_cfg_read_u16(pci_device_for_cfg_address(PciCfg1Addr),
- val, PCI_OFFSET(PciCfg1Addr) + offset);
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" cfg_inw(%#lx) = %4.4x\n", PciCfg1Addr + offset, *val);
- return 1;
- }
- return 0;
-}
-
-static int
-pciCfg1outw(CARD16 addr, CARD16 val)
-{
- int shift;
-
- if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
- shift = (addr - 0xCF8) * 8;
- PciCfg1Addr &= ~(0xffff << shift);
- PciCfg1Addr |= ((CARD32) val) << shift;
- return 1;
- }
- if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
- const unsigned offset = addr - 0xCFC;
-
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" cfg_outw(%#lx, %4.4x)\n", PciCfg1Addr + offset, val);
- pci_device_cfg_write_u16(pci_device_for_cfg_address(PciCfg1Addr),
- val, PCI_OFFSET(PciCfg1Addr) + offset);
- return 1;
- }
- return 0;
-}
-
-static int
-pciCfg1inb(CARD16 addr, CARD8 *val)
-{
- int shift;
-
- if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
- shift = (addr - 0xCF8) * 8;
- *val = (PciCfg1Addr >> shift) & 0xff;
- return 1;
- }
- if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
- const unsigned offset = addr - 0xCFC;
-
- pci_device_cfg_read_u8(pci_device_for_cfg_address(PciCfg1Addr),
- val, PCI_OFFSET(PciCfg1Addr) + offset);
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" cfg_inb(%#lx) = %2.2x\n", PciCfg1Addr + offset, *val);
- return 1;
- }
- return 0;
-}
-
-static int
-pciCfg1outb(CARD16 addr, CARD8 val)
-{
- int shift;
-
- if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
- shift = (addr - 0xCF8) * 8;
- PciCfg1Addr &= ~(0xff << shift);
- PciCfg1Addr |= ((CARD32) val) << shift;
- return 1;
- }
- if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
- const unsigned offset = addr - 0xCFC;
-
- if (PRINT_PORT && DEBUG_IO_TRACE())
- ErrorF(" cfg_outb(%#lx, %2.2x)\n", PciCfg1Addr + offset, val);
- pci_device_cfg_write_u8(pci_device_for_cfg_address(PciCfg1Addr),
- val, PCI_OFFSET(PciCfg1Addr) + offset);
- return 1;
- }
- return 0;
-}
-
-CARD8
-bios_checksum(const CARD8 *start, int size)
-{
- CARD8 sum = 0;
-
- while (size-- > 0)
- sum += *start++;
- return sum;
-}
-
-/*
- * Lock/Unlock legacy VGA. Some Bioses try to be very clever and make
- * an attempt to detect a legacy ISA card. If they find one they might
- * act very strange: for example they might configure the card as a
- * monochrome card. This might cause some drivers to choke.
- * To avoid this we attempt legacy VGA by writing to all know VGA
- * disable registers before we call the BIOS initialization and
- * restore the original values afterwards. In beween we hold our
- * breath. To get to a (possibly exising) ISA card need to disable
- * our current PCI card.
- */
-/*
- * This is just for booting: we just want to catch pure
- * legacy vga therefore we don't worry about mmio etc.
- * This stuff should really go into vgaHW.c. However then
- * the driver would have to load the vga-module prior to
- * doing int10.
- */
-void
-LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga)
-{
- vga->save_msr = inb(pInt->ioBase + 0x03CC);
- vga->save_vse = inb(pInt->ioBase + 0x03C3);
-#ifndef __ia64__
- vga->save_46e8 = inb(pInt->ioBase + 0x46E8);
-#endif
- vga->save_pos102 = inb(pInt->ioBase + 0x0102);
- outb(pInt->ioBase + 0x03C2, ~(CARD8)0x03 & vga->save_msr);
- outb(pInt->ioBase + 0x03C3, ~(CARD8)0x01 & vga->save_vse);
-#ifndef __ia64__
- outb(pInt->ioBase + 0x46E8, ~(CARD8)0x08 & vga->save_46e8);
-#endif
- outb(pInt->ioBase + 0x0102, ~(CARD8)0x01 & vga->save_pos102);
-}
-
-void
-UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga)
-{
- outb(pInt->ioBase + 0x0102, vga->save_pos102);
-#ifndef __ia64__
- outb(pInt->ioBase + 0x46E8, vga->save_46e8);
-#endif
- outb(pInt->ioBase + 0x03C3, vga->save_vse);
- outb(pInt->ioBase + 0x03C2, vga->save_msr);
-}
-
-#if defined (_PC)
-static void
-SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set)
-{
- int pagesize = getpagesize();
- unsigned char* base = xf86MapVidMem(pInt->scrnIndex,
- VIDMEM_MMIO, 0, pagesize);
- int i;
-
- if (set) {
- for (i = BIOS_SCRATCH_OFF; i < BIOS_SCRATCH_END; i++)
- MEM_WW(pInt, i, *(base + i));
- } else {
- for (i = BIOS_SCRATCH_OFF; i < BIOS_SCRATCH_END; i++)
- *(base + i) = MEM_RW(pInt, i);
- }
-
- xf86UnMapVidMem(pInt->scrnIndex,base,pagesize);
-}
-
-void
-xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save)
-{
- int pagesize = getpagesize();
- unsigned char* base;
- int i;
-
- if (!xf86IsEntityPrimary(pInt->entityIndex)
- || (!save && !pInt->BIOSScratch))
- return;
-
- base = xf86MapVidMem(pInt->scrnIndex, VIDMEM_MMIO, 0, pagesize);
- base += BIOS_SCRATCH_OFF;
- if (save) {
- if ((pInt->BIOSScratch
- = xnfalloc(BIOS_SCRATCH_LEN)))
- for (i = 0; i < BIOS_SCRATCH_LEN; i++)
- *(((char*)pInt->BIOSScratch + i)) = *(base + i);
- } else {
- if (pInt->BIOSScratch) {
- for (i = 0; i < BIOS_SCRATCH_LEN; i++)
- *(base + i) = *(pInt->BIOSScratch + i);
- free(pInt->BIOSScratch);
- pInt->BIOSScratch = NULL;
- }
- }
-
- xf86UnMapVidMem(pInt->scrnIndex,base - BIOS_SCRATCH_OFF ,pagesize);
-}
-#endif
-
-xf86Int10InfoPtr
-xf86InitInt10(int entityIndex)
-{
- return xf86ExtendedInitInt10(entityIndex, 0);
-}
+/*
+ * XFree86 int10 module
+ * execute BIOS int 10h calls in x86 real mode environment
+ * Copyright 1999 Egbert Eich
+ *
+ * Part of this code was inspired by the VBIOS POSTing code in DOSEMU
+ * developed by the "DOSEMU-Development-Team"
+ */
+
+/*
+ * To debug port accesses define PRINT_PORT to 1.
+ * Note! You also have to comment out ioperm()
+ * in xf86EnableIO(). Otherwise we won't trap
+ * on PIO.
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#define PRINT_PORT 0
+
+#include <unistd.h>
+
+#include <X11/Xos.h>
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "compiler.h"
+#define _INT10_PRIVATE
+#include "int10Defines.h"
+#include "xf86int10.h"
+#include "Pci.h"
+#ifdef _X86EMU
+#include "x86emu/x86emui.h"
+#else
+#define DEBUG_IO_TRACE() 0
+#endif
+#include <pciaccess.h>
+
+static int pciCfg1in(CARD16 addr, CARD32 *val);
+static int pciCfg1out(CARD16 addr, CARD32 val);
+static int pciCfg1inw(CARD16 addr, CARD16 *val);
+static int pciCfg1outw(CARD16 addr, CARD16 val);
+static int pciCfg1inb(CARD16 addr, CARD8 *val);
+static int pciCfg1outb(CARD16 addr, CARD8 val);
+#if defined (_PC)
+static void SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set);
+#endif
+
+#define REG pInt
+
+int
+setup_int(xf86Int10InfoPtr pInt)
+{
+ if (pInt != Int10Current) {
+ if (!MapCurrentInt10(pInt))
+ return -1;
+ Int10Current = pInt;
+ }
+ X86_EAX = (CARD32) pInt->ax;
+ X86_EBX = (CARD32) pInt->bx;
+ X86_ECX = (CARD32) pInt->cx;
+ X86_EDX = (CARD32) pInt->dx;
+ X86_ESI = (CARD32) pInt->si;
+ X86_EDI = (CARD32) pInt->di;
+ X86_EBP = (CARD32) pInt->bp;
+ X86_ESP = 0x1000; X86_SS = pInt->stackseg >> 4;
+ X86_EIP = 0x0600; X86_CS = 0x0; /* address of 'hlt' */
+ X86_DS = 0x40; /* standard pc ds */
+ X86_ES = pInt->es;
+ X86_FS = 0;
+ X86_GS = 0;
+ X86_EFLAGS = X86_IF_MASK | X86_IOPL_MASK;
+#if defined (_PC)
+ if (pInt->Flags & SET_BIOS_SCRATCH)
+ SetResetBIOSVars(pInt, TRUE);
+#endif
+ OsBlockSignals();
+ return 0;
+}
+
+void
+finish_int(xf86Int10InfoPtr pInt, int sig)
+{
+ OsReleaseSignals();
+ pInt->ax = (CARD32) X86_EAX;
+ pInt->bx = (CARD32) X86_EBX;
+ pInt->cx = (CARD32) X86_ECX;
+ pInt->dx = (CARD32) X86_EDX;
+ pInt->si = (CARD32) X86_ESI;
+ pInt->di = (CARD32) X86_EDI;
+ pInt->es = (CARD16) X86_ES;
+ pInt->bp = (CARD32) X86_EBP;
+ pInt->flags = (CARD32) X86_FLAGS;
+#if defined (_PC)
+ if (pInt->Flags & RESTORE_BIOS_SCRATCH)
+ SetResetBIOSVars(pInt, FALSE);
+#endif
+}
+
+/* general software interrupt handler */
+CARD32
+getIntVect(xf86Int10InfoPtr pInt,int num)
+{
+ return MEM_RW(pInt, num << 2) + (MEM_RW(pInt, (num << 2) + 2) << 4);
+}
+
+void
+pushw(xf86Int10InfoPtr pInt, CARD16 val)
+{
+ X86_ESP -= 2;
+ MEM_WW(pInt, ((CARD32) X86_SS << 4) + X86_SP, val);
+}
+
+int
+run_bios_int(int num, xf86Int10InfoPtr pInt)
+{
+ CARD32 eflags;
+#ifndef _PC
+ /* check if bios vector is initialized */
+ if (MEM_RW(pInt, (num << 2) + 2) == (SYS_BIOS >> 4)) { /* SYS_BIOS_SEG ?*/
+
+ if (num == 21 && X86_AH == 0x4e) {
+ xf86DrvMsg(pInt->scrnIndex, X_NOTICE,
+ "Failing Find-Matching-File on non-PC"
+ " (int 21, func 4e)\n");
+ X86_AX = 2;
+ SET_FLAG(F_CF);
+ return 1;
+ } else {
+ xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2,
+ "Ignoring int 0x%02x call\n", num);
+ if (xf86GetVerbosity() > 3) {
+ dump_registers(pInt);
+ stack_trace(pInt);
+ }
+ return 1;
+ }
+ }
+#endif
+#ifdef PRINT_INT
+ ErrorF("calling card BIOS at: ");
+#endif
+ eflags = X86_EFLAGS;
+#if 0
+ eflags = eflags | IF_MASK;
+ X86_EFLAGS = X86_EFLAGS & ~(VIF_MASK | TF_MASK | IF_MASK | NT_MASK);
+#endif
+ pushw(pInt, eflags);
+ pushw(pInt, X86_CS);
+ pushw(pInt, X86_IP);
+ X86_CS = MEM_RW(pInt, (num << 2) + 2);
+ X86_IP = MEM_RW(pInt, num << 2);
+#ifdef PRINT_INT
+ ErrorF("0x%x:%lx\n", X86_CS, X86_EIP);
+#endif
+ return 1;
+}
+
+/* Debugging stuff */
+void
+dump_code(xf86Int10InfoPtr pInt)
+{
+ int i;
+ CARD32 lina = SEG_ADR((CARD32), X86_CS, IP);
+
+ xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, "code at 0x%8.8" PRIx32 ":\n", lina);
+ for (i=0; i<0x10; i++)
+ xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i));
+ xf86ErrorFVerb(3, "\n");
+ for (; i<0x20; i++)
+ xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i));
+ xf86ErrorFVerb(3, "\n");
+}
+
+void
+dump_registers(xf86Int10InfoPtr pInt)
+{
+ xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
+ "EAX=0x%8.8lx, EBX=0x%8.8lx, ECX=0x%8.8lx, EDX=0x%8.8lx\n",
+ (unsigned long)X86_EAX, (unsigned long)X86_EBX,
+ (unsigned long)X86_ECX, (unsigned long)X86_EDX);
+ xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
+ "ESP=0x%8.8lx, EBP=0x%8.8lx, ESI=0x%8.8lx, EDI=0x%8.8lx\n",
+ (unsigned long)X86_ESP, (unsigned long)X86_EBP,
+ (unsigned long)X86_ESI, (unsigned long)X86_EDI);
+ xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
+ "CS=0x%4.4x, SS=0x%4.4x,"
+ " DS=0x%4.4x, ES=0x%4.4x, FS=0x%4.4x, GS=0x%4.4x\n",
+ X86_CS, X86_SS, X86_DS, X86_ES, X86_FS, X86_GS);
+ xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3,
+ "EIP=0x%8.8lx, EFLAGS=0x%8.8lx\n",
+ (unsigned long)X86_EIP, (unsigned long)X86_EFLAGS);
+}
+
+void
+stack_trace(xf86Int10InfoPtr pInt)
+{
+ int i = 0;
+ unsigned long stack = SEG_ADR((CARD32), X86_SS, SP);
+ unsigned long tail = (CARD32)((X86_SS << 4) + 0x1000);
+
+ if (stack >= tail) return;
+
+ xf86MsgVerb(X_INFO, 3, "stack at 0x%8.8lx:\n", stack);
+ for (; stack < tail; stack++) {
+ xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, stack));
+ i = (i + 1) % 0x10;
+ if (!i)
+ xf86ErrorFVerb(3, "\n");
+ }
+ if (i)
+ xf86ErrorFVerb(3, "\n");
+}
+
+int
+port_rep_inb(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count)
+{
+ register int inc = d_f ? -1 : 1;
+ CARD32 dst = base;
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" rep_insb(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
+ port, count, base, d_f ? "up" : "down");
+ while (count--) {
+ MEM_WB(pInt, dst, x_inb(port));
+ dst += inc;
+ }
+ return dst - base;
+}
+
+int
+port_rep_inw(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count)
+{
+ register int inc = d_f ? -2 : 2;
+ CARD32 dst = base;
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" rep_insw(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
+ port, count, base, d_f ? "up" : "down");
+ while (count--) {
+ MEM_WW(pInt, dst, x_inw(port));
+ dst += inc;
+ }
+ return dst - base;
+}
+
+int
+port_rep_inl(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count)
+{
+ register int inc = d_f ? -4 : 4;
+ CARD32 dst = base;
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" rep_insl(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
+ port, count, base, d_f ? "up" : "down");
+ while (count--) {
+ MEM_WL(pInt, dst, x_inl(port));
+ dst += inc;
+ }
+ return dst - base;
+}
+
+int
+port_rep_outb(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count)
+{
+ register int inc = d_f ? -1 : 1;
+ CARD32 dst = base;
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" rep_outb(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
+ port, count, base, d_f ? "up" : "down");
+ while (count--) {
+ x_outb(port, MEM_RB(pInt, dst));
+ dst += inc;
+ }
+ return dst - base;
+}
+
+int
+port_rep_outw(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count)
+{
+ register int inc = d_f ? -2 : 2;
+ CARD32 dst = base;
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" rep_outw(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
+ port, count, base, d_f ? "up" : "down");
+ while (count--) {
+ x_outw(port, MEM_RW(pInt, dst));
+ dst += inc;
+ }
+ return dst - base;
+}
+
+int
+port_rep_outl(xf86Int10InfoPtr pInt,
+ CARD16 port, CARD32 base, int d_f, CARD32 count)
+{
+ register int inc = d_f ? -4 : 4;
+ CARD32 dst = base;
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" rep_outl(%#x) %" PRIu32 " bytes at %8.8" PRIx32 " %s\n",
+ port, count, base, d_f ? "up" : "down");
+ while (count--) {
+ x_outl(port, MEM_RL(pInt, dst));
+ dst += inc;
+ }
+ return dst - base;
+}
+
+CARD8
+x_inb(CARD16 port)
+{
+ CARD8 val;
+
+ if (port == 0x40) {
+ Int10Current->inb40time++;
+ val = (CARD8)(Int10Current->inb40time >>
+ ((Int10Current->inb40time & 1) << 3));
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" inb(%#x) = %2.2x\n", port, val);
+#ifdef __NOT_YET__
+ } else if (port < 0x0100) { /* Don't interfere with mainboard */
+ val = 0;
+ xf86DrvMsgVerb(Int10Current->scrnIndex, X_NOT_IMPLEMENTED, 2,
+ "inb 0x%4.4x\n", port);
+ if (xf86GetVerbosity() > 3) {
+ dump_registers(Int10Current);
+ stack_trace(Int10Current);
+ }
+#endif /* __NOT_YET__ */
+ } else if (!pciCfg1inb(port, &val)) {
+ val = inb(Int10Current->ioBase + port);
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" inb(%#x) = %2.2x\n", port, val);
+ }
+ return val;
+}
+
+CARD16
+x_inw(CARD16 port)
+{
+ CARD16 val;
+
+ if (port == 0x5c) {
+ struct timeval tv;
+
+ /*
+ * Emulate a PC's timer. Typical resolution is 3.26 usec.
+ * Approximate this by dividing by 3.
+ */
+ X_GETTIMEOFDAY(&tv);
+ val = (CARD16)(tv.tv_usec / 3);
+ } else if (!pciCfg1inw(port, &val)) {
+ val = inw(Int10Current->ioBase + port);
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" inw(%#x) = %4.4x\n", port, val);
+ }
+ return val;
+}
+
+void
+x_outb(CARD16 port, CARD8 val)
+{
+ if ((port == 0x43) && (val == 0)) {
+ struct timeval tv;
+ /*
+ * Emulate a PC's timer 0. Such timers typically have a resolution of
+ * some .838 usec per tick, but this can only provide 1 usec per tick.
+ * (Not that this matters much, given inherent emulation delays.) Use
+ * the bottom bit as a byte select. See inb(0x40) above.
+ */
+ X_GETTIMEOFDAY(&tv);
+ Int10Current->inb40time = (CARD16)(tv.tv_usec | 1);
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" outb(%#x, %2.2x)\n", port, val);
+#ifdef __NOT_YET__
+ } else if (port < 0x0100) { /* Don't interfere with mainboard */
+ xf86DrvMsgVerb(Int10Current->scrnIndex, X_NOT_IMPLEMENTED, 2,
+ "outb 0x%4.4x,0x%2.2x\n", port, val);
+ if (xf86GetVerbosity() > 3) {
+ dump_registers(Int10Current);
+ stack_trace(Int10Current);
+ }
+#endif /* __NOT_YET__ */
+ } else if (!pciCfg1outb(port, val)) {
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" outb(%#x, %2.2x)\n", port, val);
+ outb(Int10Current->ioBase + port, val);
+ }
+}
+
+void
+x_outw(CARD16 port, CARD16 val)
+{
+
+ if (!pciCfg1outw(port, val)) {
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" outw(%#x, %4.4x)\n", port, val);
+ outw(Int10Current->ioBase + port, val);
+ }
+}
+
+CARD32
+x_inl(CARD16 port)
+{
+ CARD32 val;
+
+ if (!pciCfg1in(port, &val)) {
+ val = inl(Int10Current->ioBase + port);
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" inl(%#x) = %8.8" PRIx32 "\n", port, val);
+ }
+ return val;
+}
+
+void
+x_outl(CARD16 port, CARD32 val)
+{
+ if (!pciCfg1out(port, val)) {
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" outl(%#x, %8.8" PRIx32 ")\n", port, val);
+ outl(Int10Current->ioBase + port, val);
+ }
+}
+
+CARD8
+Mem_rb(CARD32 addr)
+{
+ return (*Int10Current->mem->rb)(Int10Current, addr);
+}
+
+CARD16
+Mem_rw(CARD32 addr)
+{
+ return (*Int10Current->mem->rw)(Int10Current, addr);
+}
+
+CARD32
+Mem_rl(CARD32 addr)
+{
+ return (*Int10Current->mem->rl)(Int10Current, addr);
+}
+
+void
+Mem_wb(CARD32 addr, CARD8 val)
+{
+ (*Int10Current->mem->wb)(Int10Current, addr, val);
+}
+
+void
+Mem_ww(CARD32 addr, CARD16 val)
+{
+ (*Int10Current->mem->ww)(Int10Current, addr, val);
+}
+
+void
+Mem_wl(CARD32 addr, CARD32 val)
+{
+ (*Int10Current->mem->wl)(Int10Current, addr, val);
+}
+
+static CARD32 PciCfg1Addr = 0;
+
+#define PCI_DOM_FROM_TAG(tag) (((tag) >> 24) & (PCI_DOM_MASK))
+#define PCI_BUS_FROM_TAG(tag) (((tag) >> 16) & (PCI_DOMBUS_MASK))
+#define PCI_DEV_FROM_TAG(tag) (((tag) & 0x0000f800u) >> 11)
+#define PCI_FUNC_FROM_TAG(tag) (((tag) & 0x00000700u) >> 8)
+
+#define PCI_OFFSET(x) ((x) & 0x000000ff)
+#define PCI_TAG(x) ((x) & 0x7fffff00)
+
+static struct pci_device*
+pci_device_for_cfg_address (CARD32 addr)
+{
+ struct pci_device *dev = NULL;
+ PCITAG tag = PCI_TAG(addr);
+ struct pci_slot_match slot_match = {
+ .domain = PCI_DOM_FROM_TAG(tag),
+ .bus = PCI_BUS_NO_DOMAIN(PCI_BUS_FROM_TAG(tag)),
+ .dev = PCI_DEV_FROM_TAG(tag),
+ .func = PCI_FUNC_FROM_TAG(tag),
+ .match_data = 0
+ };
+
+ struct pci_device_iterator *iter =
+ pci_slot_match_iterator_create (&slot_match);
+
+ if (iter)
+ dev = pci_device_next(iter);
+
+ pci_iterator_destroy(iter);
+
+ return dev;
+}
+
+static int
+pciCfg1in(CARD16 addr, CARD32 *val)
+{
+ if (addr == 0xCF8) {
+ *val = PciCfg1Addr;
+ return 1;
+ }
+ if (addr == 0xCFC) {
+ pci_device_cfg_read_u32(pci_device_for_cfg_address(PciCfg1Addr),
+ (uint32_t *)val, PCI_OFFSET(PciCfg1Addr));
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" cfg_inl(%#" PRIx32 ") = %8.8" PRIx32 "\n", PciCfg1Addr, *val);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+pciCfg1out(CARD16 addr, CARD32 val)
+{
+ if (addr == 0xCF8) {
+ PciCfg1Addr = val;
+ return 1;
+ }
+ if (addr == 0xCFC) {
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" cfg_outl(%#" PRIx32 ", %8.8" PRIx32 ")\n", PciCfg1Addr, val);
+ pci_device_cfg_write_u32(pci_device_for_cfg_address(PciCfg1Addr),
+ val, PCI_OFFSET(PciCfg1Addr));
+ return 1;
+ }
+ return 0;
+}
+
+static int
+pciCfg1inw(CARD16 addr, CARD16 *val)
+{
+ int shift;
+
+ if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
+ shift = (addr - 0xCF8) * 8;
+ *val = (PciCfg1Addr >> shift) & 0xffff;
+ return 1;
+ }
+ if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
+ const unsigned offset = addr - 0xCFC;
+
+ pci_device_cfg_read_u16(pci_device_for_cfg_address(PciCfg1Addr),
+ val, PCI_OFFSET(PciCfg1Addr) + offset);
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" cfg_inw(%#" PRIx32 ") = %4.4x\n", PciCfg1Addr + offset, *val);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+pciCfg1outw(CARD16 addr, CARD16 val)
+{
+ int shift;
+
+ if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
+ shift = (addr - 0xCF8) * 8;
+ PciCfg1Addr &= ~(0xffff << shift);
+ PciCfg1Addr |= ((CARD32) val) << shift;
+ return 1;
+ }
+ if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
+ const unsigned offset = addr - 0xCFC;
+
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" cfg_outw(%#" PRIx32 ", %4.4x)\n", PciCfg1Addr + offset, val);
+ pci_device_cfg_write_u16(pci_device_for_cfg_address(PciCfg1Addr),
+ val, PCI_OFFSET(PciCfg1Addr) + offset);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+pciCfg1inb(CARD16 addr, CARD8 *val)
+{
+ int shift;
+
+ if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
+ shift = (addr - 0xCF8) * 8;
+ *val = (PciCfg1Addr >> shift) & 0xff;
+ return 1;
+ }
+ if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
+ const unsigned offset = addr - 0xCFC;
+
+ pci_device_cfg_read_u8(pci_device_for_cfg_address(PciCfg1Addr),
+ val, PCI_OFFSET(PciCfg1Addr) + offset);
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" cfg_inb(%#" PRIx32 ") = %2.2x\n", PciCfg1Addr + offset, *val);
+ return 1;
+ }
+ return 0;
+}
+
+static int
+pciCfg1outb(CARD16 addr, CARD8 val)
+{
+ int shift;
+
+ if ((addr >= 0xCF8) && (addr <= 0xCFB)) {
+ shift = (addr - 0xCF8) * 8;
+ PciCfg1Addr &= ~(0xff << shift);
+ PciCfg1Addr |= ((CARD32) val) << shift;
+ return 1;
+ }
+ if ((addr >= 0xCFC) && (addr <= 0xCFF)) {
+ const unsigned offset = addr - 0xCFC;
+
+ if (PRINT_PORT && DEBUG_IO_TRACE())
+ ErrorF(" cfg_outb(%#" PRIx32 ", %2.2x)\n", PciCfg1Addr + offset, val);
+ pci_device_cfg_write_u8(pci_device_for_cfg_address(PciCfg1Addr),
+ val, PCI_OFFSET(PciCfg1Addr) + offset);
+ return 1;
+ }
+ return 0;
+}
+
+CARD8
+bios_checksum(const CARD8 *start, int size)
+{
+ CARD8 sum = 0;
+
+ while (size-- > 0)
+ sum += *start++;
+ return sum;
+}
+
+/*
+ * Lock/Unlock legacy VGA. Some Bioses try to be very clever and make
+ * an attempt to detect a legacy ISA card. If they find one they might
+ * act very strange: for example they might configure the card as a
+ * monochrome card. This might cause some drivers to choke.
+ * To avoid this we attempt legacy VGA by writing to all know VGA
+ * disable registers before we call the BIOS initialization and
+ * restore the original values afterwards. In beween we hold our
+ * breath. To get to a (possibly exising) ISA card need to disable
+ * our current PCI card.
+ */
+/*
+ * This is just for booting: we just want to catch pure
+ * legacy vga therefore we don't worry about mmio etc.
+ * This stuff should really go into vgaHW.c. However then
+ * the driver would have to load the vga-module prior to
+ * doing int10.
+ */
+void
+LockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga)
+{
+ vga->save_msr = inb(pInt->ioBase + 0x03CC);
+ vga->save_vse = inb(pInt->ioBase + 0x03C3);
+#ifndef __ia64__
+ vga->save_46e8 = inb(pInt->ioBase + 0x46E8);
+#endif
+ vga->save_pos102 = inb(pInt->ioBase + 0x0102);
+ outb(pInt->ioBase + 0x03C2, ~(CARD8)0x03 & vga->save_msr);
+ outb(pInt->ioBase + 0x03C3, ~(CARD8)0x01 & vga->save_vse);
+#ifndef __ia64__
+ outb(pInt->ioBase + 0x46E8, ~(CARD8)0x08 & vga->save_46e8);
+#endif
+ outb(pInt->ioBase + 0x0102, ~(CARD8)0x01 & vga->save_pos102);
+}
+
+void
+UnlockLegacyVGA(xf86Int10InfoPtr pInt, legacyVGAPtr vga)
+{
+ outb(pInt->ioBase + 0x0102, vga->save_pos102);
+#ifndef __ia64__
+ outb(pInt->ioBase + 0x46E8, vga->save_46e8);
+#endif
+ outb(pInt->ioBase + 0x03C3, vga->save_vse);
+ outb(pInt->ioBase + 0x03C2, vga->save_msr);
+}
+
+#if defined (_PC)
+static void
+SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set)
+{
+ int pagesize = getpagesize();
+ unsigned char* base = xf86MapVidMem(pInt->scrnIndex,
+ VIDMEM_MMIO, 0, pagesize);
+ int i;
+
+ if (set) {
+ for (i = BIOS_SCRATCH_OFF; i < BIOS_SCRATCH_END; i++)
+ MEM_WW(pInt, i, *(base + i));
+ } else {
+ for (i = BIOS_SCRATCH_OFF; i < BIOS_SCRATCH_END; i++)
+ *(base + i) = MEM_RW(pInt, i);
+ }
+
+ xf86UnMapVidMem(pInt->scrnIndex,base,pagesize);
+}
+
+void
+xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save)
+{
+ int pagesize = getpagesize();
+ unsigned char* base;
+ int i;
+
+ if (!xf86IsEntityPrimary(pInt->entityIndex)
+ || (!save && !pInt->BIOSScratch))
+ return;
+
+ base = xf86MapVidMem(pInt->scrnIndex, VIDMEM_MMIO, 0, pagesize);
+ base += BIOS_SCRATCH_OFF;
+ if (save) {
+ if ((pInt->BIOSScratch
+ = xnfalloc(BIOS_SCRATCH_LEN)))
+ for (i = 0; i < BIOS_SCRATCH_LEN; i++)
+ *(((char*)pInt->BIOSScratch + i)) = *(base + i);
+ } else {
+ if (pInt->BIOSScratch) {
+ for (i = 0; i < BIOS_SCRATCH_LEN; i++)
+ *(base + i) = *(pInt->BIOSScratch + i);
+ free(pInt->BIOSScratch);
+ pInt->BIOSScratch = NULL;
+ }
+ }
+
+ xf86UnMapVidMem(pInt->scrnIndex,base - BIOS_SCRATCH_OFF ,pagesize);
+}
+#endif
+
+xf86Int10InfoPtr
+xf86InitInt10(int entityIndex)
+{
+ return xf86ExtendedInitInt10(entityIndex, 0);
+}
diff --git a/xorg-server/hw/xfree86/int10/helper_mem.c b/xorg-server/hw/xfree86/int10/helper_mem.c
index 610cd42ac..9088298a9 100644
--- a/xorg-server/hw/xfree86/int10/helper_mem.c
+++ b/xorg-server/hw/xfree86/int10/helper_mem.c
@@ -1,327 +1,324 @@
-/*
- * XFree86 int10 module
- * execute BIOS int 10h calls in x86 real mode environment
- * Copyright 1999 Egbert Eich
- */
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <string.h>
-#include <stdlib.h>
-
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "compiler.h"
-#include "xf86Pci.h"
-#define _INT10_PRIVATE
-#if 0
-#include "int10Defines.h"
-#endif
-#include "xf86int10.h"
-
-#define REG pInt
-
-typedef enum {
- OPT_NOINT10,
- OPT_INIT_PRIMARY,
-} INT10Opts;
-
-static const OptionInfoRec INT10Options[] = {
- {OPT_NOINT10, "NoINT10", OPTV_BOOLEAN, {0}, FALSE },
- {OPT_INIT_PRIMARY, "InitPrimary", OPTV_BOOLEAN, {0}, FALSE },
- { -1, NULL, OPTV_NONE, {0}, FALSE },
-};
-
-#ifdef DEBUG
-void
-dprint(unsigned long start, unsigned long size)
-{
- int i,j;
- char *c = (char *)start;
-
- for (j = 0; j < (size >> 4); j++) {
- char *d = c;
- ErrorF("\n0x%lx: ",(unsigned long)c);
- for (i = 0; i<16; i++)
- ErrorF("%2.2x ",(unsigned char) (*(c++)));
- c = d;
- for (i = 0; i<16; i++) {
- ErrorF("%c",((((CARD8)(*c)) > 32) && (((CARD8)(*c)) < 128)) ?
- (unsigned char) (*(c)): '.');
- c++;
- }
- }
- ErrorF("\n");
-}
-#endif
-
-#ifndef _PC
-/*
- * here we are really paranoid about faking a "real"
- * BIOS. Most of this information was pulled from
- * dosemu.
- */
-void
-setup_int_vect(xf86Int10InfoPtr pInt)
-{
- int i;
-
- /* let the int vects point to the SYS_BIOS seg */
- for (i = 0; i < 0x80; i++) {
- MEM_WW(pInt, i << 2, 0);
- MEM_WW(pInt, (i << 2) + 2, SYS_BIOS >> 4);
- }
-
- reset_int_vect(pInt);
- /* font tables default location (int 1F) */
- MEM_WW(pInt,0x1f<<2,0xfa6e);
-
- /* int 11 default location (Get Equipment Configuration) */
- MEM_WW(pInt, 0x11 << 2, 0xf84d);
- /* int 12 default location (Get Conventional Memory Size) */
- MEM_WW(pInt, 0x12 << 2, 0xf841);
- /* int 15 default location (I/O System Extensions) */
- MEM_WW(pInt, 0x15 << 2, 0xf859);
- /* int 1A default location (RTC, PCI and others) */
- MEM_WW(pInt, 0x1a << 2, 0xff6e);
- /* int 05 default location (Bound Exceeded) */
- MEM_WW(pInt, 0x05 << 2, 0xff54);
- /* int 08 default location (Double Fault) */
- MEM_WW(pInt, 0x08 << 2, 0xfea5);
- /* int 13 default location (Disk) */
- MEM_WW(pInt, 0x13 << 2, 0xec59);
- /* int 0E default location (Page Fault) */
- MEM_WW(pInt, 0x0e << 2, 0xef57);
- /* int 17 default location (Parallel Port) */
- MEM_WW(pInt, 0x17 << 2, 0xefd2);
- /* fdd table default location (int 1e) */
- MEM_WW(pInt, 0x1e << 2, 0xefc7);
-
- /* Set Equipment flag to VGA */
- i = MEM_RB(pInt, 0x0410) & 0xCF;
- MEM_WB(pInt, 0x0410, i);
- /* XXX Perhaps setup more of the BDA here. See also int42(0x00). */
-}
-#endif
-
-int
-setup_system_bios(void *base_addr)
-{
- char *base = (char *) base_addr;
-
- /*
- * we trap the "industry standard entry points" to the BIOS
- * and all other locations by filling them with "hlt"
- * TODO: implement hlt-handler for these
- */
- memset(base, 0xf4, 0x10000);
-
- /* set bios date */
- strcpy(base + 0x0FFF5, "06/11/99");
- /* set up eisa ident string */
- strcpy(base + 0x0FFD9, "PCI_ISA");
- /* write system model id for IBM-AT */
- *((unsigned char *)(base + 0x0FFFE)) = 0xfc;
-
- return 1;
-}
-
-void
-reset_int_vect(xf86Int10InfoPtr pInt)
-{
- /*
- * This table is normally located at 0xF000:0xF0A4. However, int 0x42,
- * function 0 (Mode Set) expects it (or a copy) somewhere in the bottom
- * 64kB. Note that because this data doesn't survive POST, int 0x42 should
- * only be used during EGA/VGA BIOS initialisation.
- */
- static const CARD8 VideoParms[] = {
- /* Timing for modes 0x00 & 0x01 */
- 0x38, 0x28, 0x2d, 0x0a, 0x1f, 0x06, 0x19, 0x1c,
- 0x02, 0x07, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00,
- /* Timing for modes 0x02 & 0x03 */
- 0x71, 0x50, 0x5a, 0x0a, 0x1f, 0x06, 0x19, 0x1c,
- 0x02, 0x07, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00,
- /* Timing for modes 0x04, 0x05 & 0x06 */
- 0x38, 0x28, 0x2d, 0x0a, 0x7f, 0x06, 0x64, 0x70,
- 0x02, 0x01, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00,
- /* Timing for mode 0x07 */
- 0x61, 0x50, 0x52, 0x0f, 0x19, 0x06, 0x19, 0x19,
- 0x02, 0x0d, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00,
- /* Display page lengths in little endian order */
- 0x00, 0x08, /* Modes 0x00 and 0x01 */
- 0x00, 0x10, /* Modes 0x02 and 0x03 */
- 0x00, 0x40, /* Modes 0x04 and 0x05 */
- 0x00, 0x40, /* Modes 0x06 and 0x07 */
- /* Number of columns for each mode */
- 40, 40, 80, 80, 40, 40, 80, 80,
- /* CGA Mode register value for each mode */
- 0x2c, 0x28, 0x2d, 0x29, 0x2a, 0x2e, 0x1e, 0x29,
- /* Padding */
- 0x00, 0x00, 0x00, 0x00
- };
- int i;
-
- for (i = 0; i < sizeof(VideoParms); i++)
- MEM_WB(pInt, i + (0x1000 - sizeof(VideoParms)), VideoParms[i]);
- MEM_WW(pInt, 0x1d << 2, 0x1000 - sizeof(VideoParms));
- MEM_WW(pInt, (0x1d << 2) + 2, 0);
-
- MEM_WW(pInt, 0x10 << 2, 0xf065);
- MEM_WW(pInt, (0x10 << 2) + 2, SYS_BIOS >> 4);
- MEM_WW(pInt, 0x42 << 2, 0xf065);
- MEM_WW(pInt, (0x42 << 2) + 2, SYS_BIOS >> 4);
- MEM_WW(pInt, 0x6D << 2, 0xf065);
- MEM_WW(pInt, (0x6D << 2) + 2, SYS_BIOS >> 4);
-}
-
-void
-set_return_trap(xf86Int10InfoPtr pInt)
-{
- /*
- * Here we set the exit condition: We return when we encounter
- * 'hlt' (=0xf4), which we locate at address 0x600 in x86 memory.
- */
- MEM_WB(pInt, 0x0600, 0xf4);
-
- /*
- * Allocate a segment for the stack
- */
- xf86Int10AllocPages(pInt, 1, &pInt->stackseg);
-}
-
-void *
-xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex)
-{
- EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
- OptionInfoPtr options = NULL;
-
- if (pEnt->device) {
- pointer configOptions = NULL;
-
- /* Check if xf86CollectOptions() has already been called */
- if (((pEnt->index < 0) ||
- !pScrn ||
- !(configOptions = pScrn->options)) &&
- pEnt->device)
- configOptions = pEnt->device->options;
-
- if (configOptions) {
- if (!(options = (OptionInfoPtr) malloc(sizeof(INT10Options))))
- return NULL;
-
- (void)memcpy(options, INT10Options, sizeof(INT10Options));
- xf86ProcessOptions(pScrn->scrnIndex, configOptions, options);
- }
- }
- free(pEnt);
-
- return options;
-}
-
-Bool
-int10skip(const void* options)
-{
- Bool noint10 = FALSE;
-
- if (!options) return FALSE;
-
- xf86GetOptValBool(options, OPT_NOINT10, &noint10);
- return noint10;
-}
-
-Bool
-int10_check_bios(int scrnIndex, int codeSeg, const unsigned char* vbiosMem)
-{
- int size;
-
- if ((codeSeg & 0x1f) || /* Not 512-byte aligned otherwise */
- ((codeSeg << 4) < V_BIOS) ||
- ((codeSeg << 4) >= SYS_SIZE))
- return FALSE;
-
- if (xf86IsPc98())
- return FALSE;
-
- if ((*vbiosMem != 0x55) || (*(vbiosMem+1) != 0xAA) || !*(vbiosMem+2))
- return FALSE;
-
- size = *(vbiosMem + 2) * 512;
-
- if ((size + (codeSeg << 4)) > SYS_SIZE)
- return FALSE;
-
- if (bios_checksum(vbiosMem, size))
- xf86DrvMsg(scrnIndex, X_INFO, "Bad V_BIOS checksum\n");
-
- return TRUE;
-}
-
-Bool
-initPrimary(const void* options)
-{
- Bool initPrimary = FALSE;
-
- if (!options) return FALSE;
-
- xf86GetOptValBool(options, OPT_INIT_PRIMARY, &initPrimary);
- return initPrimary;
-}
-
-BusType
-xf86int10GetBiosLocationType(const xf86Int10InfoPtr pInt)
-{
- BusType location_type;
-
- EntityInfoPtr pEnt = xf86GetEntityInfo(pInt->entityIndex);
- location_type = pEnt->location.type;
- free(pEnt);
-
- return location_type;
-}
-
-
-#define CHECK_V_SEGMENT_RANGE(x) \
- if (((x) << 4) < V_BIOS) { \
- xf86DrvMsg(pInt->scrnIndex, X_ERROR, \
- "V_BIOS address 0x%lx out of range\n", \
- (unsigned long)(x) << 4); \
- return FALSE; \
- }
-
-Bool
-xf86int10GetBiosSegment(xf86Int10InfoPtr pInt, void *base)
-{
- unsigned i;
- int cs = ~0;
- int segments[4];
-
- segments[0] = MEM_RW(pInt, (0x10 << 2) + 2);
- segments[1] = MEM_RW(pInt, (0x42 << 2) + 2);
- segments[2] = V_BIOS >> 4;
- segments[3] = ~0;
-
- for (i = 0; segments[i] != ~0; i++) {
- unsigned char * vbiosMem;
-
- cs = segments[i];
-
- CHECK_V_SEGMENT_RANGE(cs);
- vbiosMem = (unsigned char *)base + (cs << 4);
- if (int10_check_bios(pInt->scrnIndex, cs, vbiosMem)) {
- break;
- }
- }
-
- if (segments[i] == ~0) {
- xf86DrvMsg(pInt->scrnIndex, X_ERROR, "No V_BIOS found\n");
- return FALSE;
- }
-
- xf86DrvMsg(pInt->scrnIndex, X_INFO, "Primary V_BIOS segment is: 0x%lx\n",
- (unsigned long)cs);
-
- pInt->BIOSseg = cs;
- return TRUE;
-}
+/*
+ * XFree86 int10 module
+ * execute BIOS int 10h calls in x86 real mode environment
+ * Copyright 1999 Egbert Eich
+ */
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <string.h>
+#include <stdlib.h>
+
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include "compiler.h"
+#include "xf86Pci.h"
+#define _INT10_PRIVATE
+#if 0
+#include "int10Defines.h"
+#endif
+#include "xf86int10.h"
+
+#define REG pInt
+
+typedef enum {
+ OPT_NOINT10,
+ OPT_INIT_PRIMARY,
+} INT10Opts;
+
+static const OptionInfoRec INT10Options[] = {
+ {OPT_NOINT10, "NoINT10", OPTV_BOOLEAN, {0}, FALSE },
+ {OPT_INIT_PRIMARY, "InitPrimary", OPTV_BOOLEAN, {0}, FALSE },
+ { -1, NULL, OPTV_NONE, {0}, FALSE },
+};
+
+#ifdef DEBUG
+void
+dprint(unsigned long start, unsigned long size)
+{
+ int i,j;
+ char *c = (char *)start;
+
+ for (j = 0; j < (size >> 4); j++) {
+ char *d = c;
+ ErrorF("\n0x%lx: ",(unsigned long)c);
+ for (i = 0; i<16; i++)
+ ErrorF("%2.2x ",(unsigned char) (*(c++)));
+ c = d;
+ for (i = 0; i<16; i++) {
+ ErrorF("%c",((((CARD8)(*c)) > 32) && (((CARD8)(*c)) < 128)) ?
+ (unsigned char) (*(c)): '.');
+ c++;
+ }
+ }
+ ErrorF("\n");
+}
+#endif
+
+#ifndef _PC
+/*
+ * here we are really paranoid about faking a "real"
+ * BIOS. Most of this information was pulled from
+ * dosemu.
+ */
+void
+setup_int_vect(xf86Int10InfoPtr pInt)
+{
+ int i;
+
+ /* let the int vects point to the SYS_BIOS seg */
+ for (i = 0; i < 0x80; i++) {
+ MEM_WW(pInt, i << 2, 0);
+ MEM_WW(pInt, (i << 2) + 2, SYS_BIOS >> 4);
+ }
+
+ reset_int_vect(pInt);
+ /* font tables default location (int 1F) */
+ MEM_WW(pInt,0x1f<<2,0xfa6e);
+
+ /* int 11 default location (Get Equipment Configuration) */
+ MEM_WW(pInt, 0x11 << 2, 0xf84d);
+ /* int 12 default location (Get Conventional Memory Size) */
+ MEM_WW(pInt, 0x12 << 2, 0xf841);
+ /* int 15 default location (I/O System Extensions) */
+ MEM_WW(pInt, 0x15 << 2, 0xf859);
+ /* int 1A default location (RTC, PCI and others) */
+ MEM_WW(pInt, 0x1a << 2, 0xff6e);
+ /* int 05 default location (Bound Exceeded) */
+ MEM_WW(pInt, 0x05 << 2, 0xff54);
+ /* int 08 default location (Double Fault) */
+ MEM_WW(pInt, 0x08 << 2, 0xfea5);
+ /* int 13 default location (Disk) */
+ MEM_WW(pInt, 0x13 << 2, 0xec59);
+ /* int 0E default location (Page Fault) */
+ MEM_WW(pInt, 0x0e << 2, 0xef57);
+ /* int 17 default location (Parallel Port) */
+ MEM_WW(pInt, 0x17 << 2, 0xefd2);
+ /* fdd table default location (int 1e) */
+ MEM_WW(pInt, 0x1e << 2, 0xefc7);
+
+ /* Set Equipment flag to VGA */
+ i = MEM_RB(pInt, 0x0410) & 0xCF;
+ MEM_WB(pInt, 0x0410, i);
+ /* XXX Perhaps setup more of the BDA here. See also int42(0x00). */
+}
+#endif
+
+int
+setup_system_bios(void *base_addr)
+{
+ char *base = (char *) base_addr;
+
+ /*
+ * we trap the "industry standard entry points" to the BIOS
+ * and all other locations by filling them with "hlt"
+ * TODO: implement hlt-handler for these
+ */
+ memset(base, 0xf4, 0x10000);
+
+ /* set bios date */
+ strcpy(base + 0x0FFF5, "06/11/99");
+ /* set up eisa ident string */
+ strcpy(base + 0x0FFD9, "PCI_ISA");
+ /* write system model id for IBM-AT */
+ *((unsigned char *)(base + 0x0FFFE)) = 0xfc;
+
+ return 1;
+}
+
+void
+reset_int_vect(xf86Int10InfoPtr pInt)
+{
+ /*
+ * This table is normally located at 0xF000:0xF0A4. However, int 0x42,
+ * function 0 (Mode Set) expects it (or a copy) somewhere in the bottom
+ * 64kB. Note that because this data doesn't survive POST, int 0x42 should
+ * only be used during EGA/VGA BIOS initialisation.
+ */
+ static const CARD8 VideoParms[] = {
+ /* Timing for modes 0x00 & 0x01 */
+ 0x38, 0x28, 0x2d, 0x0a, 0x1f, 0x06, 0x19, 0x1c,
+ 0x02, 0x07, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00,
+ /* Timing for modes 0x02 & 0x03 */
+ 0x71, 0x50, 0x5a, 0x0a, 0x1f, 0x06, 0x19, 0x1c,
+ 0x02, 0x07, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00,
+ /* Timing for modes 0x04, 0x05 & 0x06 */
+ 0x38, 0x28, 0x2d, 0x0a, 0x7f, 0x06, 0x64, 0x70,
+ 0x02, 0x01, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00,
+ /* Timing for mode 0x07 */
+ 0x61, 0x50, 0x52, 0x0f, 0x19, 0x06, 0x19, 0x19,
+ 0x02, 0x0d, 0x0b, 0x0c, 0x00, 0x00, 0x00, 0x00,
+ /* Display page lengths in little endian order */
+ 0x00, 0x08, /* Modes 0x00 and 0x01 */
+ 0x00, 0x10, /* Modes 0x02 and 0x03 */
+ 0x00, 0x40, /* Modes 0x04 and 0x05 */
+ 0x00, 0x40, /* Modes 0x06 and 0x07 */
+ /* Number of columns for each mode */
+ 40, 40, 80, 80, 40, 40, 80, 80,
+ /* CGA Mode register value for each mode */
+ 0x2c, 0x28, 0x2d, 0x29, 0x2a, 0x2e, 0x1e, 0x29,
+ /* Padding */
+ 0x00, 0x00, 0x00, 0x00
+ };
+ int i;
+
+ for (i = 0; i < sizeof(VideoParms); i++)
+ MEM_WB(pInt, i + (0x1000 - sizeof(VideoParms)), VideoParms[i]);
+ MEM_WW(pInt, 0x1d << 2, 0x1000 - sizeof(VideoParms));
+ MEM_WW(pInt, (0x1d << 2) + 2, 0);
+
+ MEM_WW(pInt, 0x10 << 2, 0xf065);
+ MEM_WW(pInt, (0x10 << 2) + 2, SYS_BIOS >> 4);
+ MEM_WW(pInt, 0x42 << 2, 0xf065);
+ MEM_WW(pInt, (0x42 << 2) + 2, SYS_BIOS >> 4);
+ MEM_WW(pInt, 0x6D << 2, 0xf065);
+ MEM_WW(pInt, (0x6D << 2) + 2, SYS_BIOS >> 4);
+}
+
+void
+set_return_trap(xf86Int10InfoPtr pInt)
+{
+ /*
+ * Here we set the exit condition: We return when we encounter
+ * 'hlt' (=0xf4), which we locate at address 0x600 in x86 memory.
+ */
+ MEM_WB(pInt, 0x0600, 0xf4);
+
+ /*
+ * Allocate a segment for the stack
+ */
+ xf86Int10AllocPages(pInt, 1, &pInt->stackseg);
+}
+
+void *
+xf86HandleInt10Options(ScrnInfoPtr pScrn, int entityIndex)
+{
+ EntityInfoPtr pEnt = xf86GetEntityInfo(entityIndex);
+ OptionInfoPtr options = NULL;
+
+ if (pEnt->device) {
+ pointer configOptions = NULL;
+
+ /* Check if xf86CollectOptions() has already been called */
+ if (((pEnt->index < 0) ||
+ !pScrn ||
+ !(configOptions = pScrn->options)) &&
+ pEnt->device)
+ configOptions = pEnt->device->options;
+
+ if (configOptions) {
+ if (!(options = (OptionInfoPtr) malloc(sizeof(INT10Options))))
+ return NULL;
+
+ (void)memcpy(options, INT10Options, sizeof(INT10Options));
+ xf86ProcessOptions(pScrn->scrnIndex, configOptions, options);
+ }
+ }
+ free(pEnt);
+
+ return options;
+}
+
+Bool
+int10skip(const void* options)
+{
+ Bool noint10 = FALSE;
+
+ if (!options) return FALSE;
+
+ xf86GetOptValBool(options, OPT_NOINT10, &noint10);
+ return noint10;
+}
+
+Bool
+int10_check_bios(int scrnIndex, int codeSeg, const unsigned char* vbiosMem)
+{
+ int size;
+
+ if ((codeSeg & 0x1f) || /* Not 512-byte aligned otherwise */
+ ((codeSeg << 4) < V_BIOS) ||
+ ((codeSeg << 4) >= SYS_SIZE))
+ return FALSE;
+
+ if ((*vbiosMem != 0x55) || (*(vbiosMem+1) != 0xAA) || !*(vbiosMem+2))
+ return FALSE;
+
+ size = *(vbiosMem + 2) * 512;
+
+ if ((size + (codeSeg << 4)) > SYS_SIZE)
+ return FALSE;
+
+ if (bios_checksum(vbiosMem, size))
+ xf86DrvMsg(scrnIndex, X_INFO, "Bad V_BIOS checksum\n");
+
+ return TRUE;
+}
+
+Bool
+initPrimary(const void* options)
+{
+ Bool initPrimary = FALSE;
+
+ if (!options) return FALSE;
+
+ xf86GetOptValBool(options, OPT_INIT_PRIMARY, &initPrimary);
+ return initPrimary;
+}
+
+BusType
+xf86int10GetBiosLocationType(const xf86Int10InfoPtr pInt)
+{
+ BusType location_type;
+
+ EntityInfoPtr pEnt = xf86GetEntityInfo(pInt->entityIndex);
+ location_type = pEnt->location.type;
+ free(pEnt);
+
+ return location_type;
+}
+
+
+#define CHECK_V_SEGMENT_RANGE(x) \
+ if (((x) << 4) < V_BIOS) { \
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR, \
+ "V_BIOS address 0x%lx out of range\n", \
+ (unsigned long)(x) << 4); \
+ return FALSE; \
+ }
+
+Bool
+xf86int10GetBiosSegment(xf86Int10InfoPtr pInt, void *base)
+{
+ unsigned i;
+ int cs = ~0;
+ int segments[4];
+
+ segments[0] = MEM_RW(pInt, (0x10 << 2) + 2);
+ segments[1] = MEM_RW(pInt, (0x42 << 2) + 2);
+ segments[2] = V_BIOS >> 4;
+ segments[3] = ~0;
+
+ for (i = 0; segments[i] != ~0; i++) {
+ unsigned char * vbiosMem;
+
+ cs = segments[i];
+
+ CHECK_V_SEGMENT_RANGE(cs);
+ vbiosMem = (unsigned char *)base + (cs << 4);
+ if (int10_check_bios(pInt->scrnIndex, cs, vbiosMem)) {
+ break;
+ }
+ }
+
+ if (segments[i] == ~0) {
+ xf86DrvMsg(pInt->scrnIndex, X_ERROR, "No V_BIOS found\n");
+ return FALSE;
+ }
+
+ xf86DrvMsg(pInt->scrnIndex, X_INFO, "Primary V_BIOS segment is: 0x%lx\n",
+ (unsigned long)cs);
+
+ pInt->BIOSseg = cs;
+ return TRUE;
+}
diff --git a/xorg-server/hw/xfree86/man/Xorg.man b/xorg-server/hw/xfree86/man/Xorg.man
index c89b5ee68..2fa72d672 100644
--- a/xorg-server/hw/xfree86/man/Xorg.man
+++ b/xorg-server/hw/xfree86/man/Xorg.man
@@ -334,6 +334,10 @@ as root (i.e, with real-uid 0).
.B \-nosilk
Disable Silken Mouse support.
.TP 8
+.B \-novtswitch
+Disable the automatic switching on X server reset and shutdown to the
+VT that was active when the server started, if supported by the OS.
+.TP 8
.B \-pixmap24
Set the internal pixmap format for depth 24 pixmaps to 24 bits per pixel.
The default is usually 32 bits per pixel. There is normally little
@@ -376,6 +380,9 @@ and
.B \-ggamma
options.
.TP 8
+.B \-sharevts
+Share virtual terminals with another X server, if supported by the OS.
+.TP 8
.BI \-screen " screen-name"
Use the __xconfigfile__(__filemansuffix__) file
.B Screen
diff --git a/xorg-server/hw/xfree86/man/xorg.conf.man b/xorg-server/hw/xfree86/man/xorg.conf.man
index f406f82bb..8f14efb64 100644
--- a/xorg-server/hw/xfree86/man/xorg.conf.man
+++ b/xorg-server/hw/xfree86/man/xorg.conf.man
@@ -634,12 +634,6 @@ are 24 and 32.
Default: 32 unless driver constraints don't allow this (which is rare).
Note: some clients don't behave well when this value is set to 24.
.TP 7
-.BI "Option \*qPC98\*q \*q" boolean \*q
-Specify that the machine is a Japanese PC\-98 machine.
-This should not be enabled for anything other than the Japanese\-specific
-PC\-98 architecture.
-Default: auto\-detected.
-.TP 7
.BI "Option \*qNoPM\*q \*q" boolean \*q
Disables something to do with power management events.
Default: PM enabled on platforms that support it.
diff --git a/xorg-server/hw/xfree86/modes/xf86Cursors.c b/xorg-server/hw/xfree86/modes/xf86Cursors.c
index 066744744..23c48eb9e 100644
--- a/xorg-server/hw/xfree86/modes/xf86Cursors.c
+++ b/xorg-server/hw/xfree86/modes/xf86Cursors.c
@@ -252,7 +252,7 @@ xf86_set_cursor_colors (ScrnInfoPtr scrn, int bg, int fg)
CursorPtr cursor = xf86_config->cursor;
int c;
CARD8 *bits = cursor ?
- dixLookupPrivate(&cursor->devPrivates, CursorScreenKey(screen))
+ dixLookupScreenPrivate(&cursor->devPrivates, CursorScreenKey, screen)
: NULL;
/* Save ARGB versions of these colors */
@@ -650,7 +650,7 @@ xf86_reload_cursors (ScreenPtr screen)
if (cursor)
{
- void *src = dixLookupPrivate(&cursor->devPrivates, CursorScreenKey(screen));
+ void *src = dixLookupScreenPrivate(&cursor->devPrivates, CursorScreenKey, screen);
#ifdef ARGB_CURSOR
if (cursor->bits->argb && cursor_info->LoadCursorARGB)
(*cursor_info->LoadCursorARGB) (scrn, cursor);
diff --git a/xorg-server/hw/xfree86/modes/xf86Modes.c b/xorg-server/hw/xfree86/modes/xf86Modes.c
index 45308f484..dcd3a2805 100644
--- a/xorg-server/hw/xfree86/modes/xf86Modes.c
+++ b/xorg-server/hw/xfree86/modes/xf86Modes.c
@@ -1,730 +1,771 @@
-/*
- * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Except as contained in this notice, the name of the copyright holder(s)
- * and author(s) shall not be used in advertising or otherwise to promote
- * the sale, use or other dealings in this Software without prior written
- * authorization from the copyright holder(s) and author(s).
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#else
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#endif
-
-#include "xf86Modes.h"
-#include "xf86Priv.h"
-
-extern XF86ConfigPtr xf86configptr;
-
-/**
- * Calculates the horizontal sync rate of a mode.
- */
-double
-xf86ModeHSync(const DisplayModeRec *mode)
-{
- double hsync = 0.0;
-
- if (mode->HSync > 0.0)
- hsync = mode->HSync;
- else if (mode->HTotal > 0)
- hsync = (float)mode->Clock / (float)mode->HTotal;
-
- return hsync;
-}
-
-/**
- * Calculates the vertical refresh rate of a mode.
- */
-double
-xf86ModeVRefresh(const DisplayModeRec *mode)
-{
- double refresh = 0.0;
-
- if (mode->VRefresh > 0.0)
- refresh = mode->VRefresh;
- else if (mode->HTotal > 0 && mode->VTotal > 0) {
- refresh = mode->Clock * 1000.0 / mode->HTotal / mode->VTotal;
- if (mode->Flags & V_INTERLACE)
- refresh *= 2.0;
- if (mode->Flags & V_DBLSCAN)
- refresh /= 2.0;
- if (mode->VScan > 1)
- refresh /= (float)(mode->VScan);
- }
- return refresh;
-}
-
-int
-xf86ModeWidth (const DisplayModeRec *mode, Rotation rotation)
-{
- switch (rotation & 0xf) {
- case RR_Rotate_0:
- case RR_Rotate_180:
- return mode->HDisplay;
- case RR_Rotate_90:
- case RR_Rotate_270:
- return mode->VDisplay;
- default:
- return 0;
- }
-}
-
-int
-xf86ModeHeight (const DisplayModeRec *mode, Rotation rotation)
-{
- switch (rotation & 0xf) {
- case RR_Rotate_0:
- case RR_Rotate_180:
- return mode->VDisplay;
- case RR_Rotate_90:
- case RR_Rotate_270:
- return mode->HDisplay;
- default:
- return 0;
- }
-}
-
-/** Calculates the memory bandwidth (in MiB/sec) of a mode. */
-unsigned int
-xf86ModeBandwidth(DisplayModePtr mode, int depth)
-{
- float a_active, a_total, active_percent, pixels_per_second;
- int bytes_per_pixel = bits_to_bytes(depth);
-
- if (!mode->HTotal || !mode->VTotal || !mode->Clock)
- return 0;
-
- a_active = mode->HDisplay * mode->VDisplay;
- a_total = mode->HTotal * mode->VTotal;
- active_percent = a_active / a_total;
- pixels_per_second = active_percent * mode->Clock * 1000.0;
-
- return (unsigned int)(pixels_per_second * bytes_per_pixel / (1024 * 1024));
-}
-
-/** Sets a default mode name of <width>x<height> on a mode. */
-void
-xf86SetModeDefaultName(DisplayModePtr mode)
-{
- Bool interlaced = !!(mode->Flags & V_INTERLACE);
-
- free(mode->name);
-
- XNFasprintf(&mode->name, "%dx%d%s", mode->HDisplay, mode->VDisplay,
- interlaced ? "i" : "");
-}
-
-/*
- * xf86SetModeCrtc
- *
- * Initialises the Crtc parameters for a mode. The initialisation includes
- * adjustments for interlaced and double scan modes.
- */
-void
-xf86SetModeCrtc(DisplayModePtr p, int adjustFlags)
-{
- if ((p == NULL) || ((p->type & M_T_CRTC_C) == M_T_BUILTIN))
- return;
-
- p->CrtcHDisplay = p->HDisplay;
- p->CrtcHSyncStart = p->HSyncStart;
- p->CrtcHSyncEnd = p->HSyncEnd;
- p->CrtcHTotal = p->HTotal;
- p->CrtcHSkew = p->HSkew;
- p->CrtcVDisplay = p->VDisplay;
- p->CrtcVSyncStart = p->VSyncStart;
- p->CrtcVSyncEnd = p->VSyncEnd;
- p->CrtcVTotal = p->VTotal;
- if (p->Flags & V_INTERLACE) {
- if (adjustFlags & INTERLACE_HALVE_V) {
- p->CrtcVDisplay /= 2;
- p->CrtcVSyncStart /= 2;
- p->CrtcVSyncEnd /= 2;
- p->CrtcVTotal /= 2;
- }
- /* Force interlaced modes to have an odd VTotal */
- /* maybe we should only do this when INTERLACE_HALVE_V is set? */
- p->CrtcVTotal |= 1;
- }
-
- if (p->Flags & V_DBLSCAN) {
- p->CrtcVDisplay *= 2;
- p->CrtcVSyncStart *= 2;
- p->CrtcVSyncEnd *= 2;
- p->CrtcVTotal *= 2;
- }
- if (p->VScan > 1) {
- p->CrtcVDisplay *= p->VScan;
- p->CrtcVSyncStart *= p->VScan;
- p->CrtcVSyncEnd *= p->VScan;
- p->CrtcVTotal *= p->VScan;
- }
- p->CrtcVBlankStart = min(p->CrtcVSyncStart, p->CrtcVDisplay);
- p->CrtcVBlankEnd = max(p->CrtcVSyncEnd, p->CrtcVTotal);
- p->CrtcHBlankStart = min(p->CrtcHSyncStart, p->CrtcHDisplay);
- p->CrtcHBlankEnd = max(p->CrtcHSyncEnd, p->CrtcHTotal);
-
- p->CrtcHAdjusted = FALSE;
- p->CrtcVAdjusted = FALSE;
-}
-
-/**
- * Allocates and returns a copy of pMode, including pointers within pMode.
- */
-DisplayModePtr
-xf86DuplicateMode(const DisplayModeRec *pMode)
-{
- DisplayModePtr pNew;
-
- pNew = xnfalloc(sizeof(DisplayModeRec));
- *pNew = *pMode;
- pNew->next = NULL;
- pNew->prev = NULL;
-
- if (pMode->name == NULL)
- xf86SetModeDefaultName(pNew);
- else
- pNew->name = xnfstrdup(pMode->name);
-
- return pNew;
-}
-
-/**
- * Duplicates every mode in the given list and returns a pointer to the first
- * mode.
- *
- * \param modeList doubly-linked mode list
- */
-DisplayModePtr
-xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList)
-{
- DisplayModePtr first = NULL, last = NULL;
- DisplayModePtr mode;
-
- for (mode = modeList; mode != NULL; mode = mode->next) {
- DisplayModePtr new;
-
- new = xf86DuplicateMode(mode);
-
- /* Insert pNew into modeList */
- if (last) {
- last->next = new;
- new->prev = last;
- } else {
- first = new;
- new->prev = NULL;
- }
- new->next = NULL;
- last = new;
- }
-
- return first;
-}
-
-/**
- * Returns true if the given modes should program to the same timings.
- *
- * This doesn't use Crtc values, as it might be used on ModeRecs without the
- * Crtc values set. So, it's assumed that the other numbers are enough.
- */
-Bool
-xf86ModesEqual(const DisplayModeRec *pMode1, const DisplayModeRec *pMode2)
-{
- if (pMode1->Clock == pMode2->Clock &&
- pMode1->HDisplay == pMode2->HDisplay &&
- pMode1->HSyncStart == pMode2->HSyncStart &&
- pMode1->HSyncEnd == pMode2->HSyncEnd &&
- pMode1->HTotal == pMode2->HTotal &&
- pMode1->HSkew == pMode2->HSkew &&
- pMode1->VDisplay == pMode2->VDisplay &&
- pMode1->VSyncStart == pMode2->VSyncStart &&
- pMode1->VSyncEnd == pMode2->VSyncEnd &&
- pMode1->VTotal == pMode2->VTotal &&
- pMode1->VScan == pMode2->VScan &&
- pMode1->Flags == pMode2->Flags)
- {
- return TRUE;
- } else {
- return FALSE;
- }
-}
-
-static void
-add(char **p, char *new)
-{
- *p = xnfrealloc(*p, strlen(*p) + strlen(new) + 2);
- strcat(*p, " ");
- strcat(*p, new);
-}
-
-/**
- * Print out a modeline.
- */
-void
-xf86PrintModeline(int scrnIndex,DisplayModePtr mode)
-{
- char tmp[256];
- char *flags = xnfcalloc(1, 1);
-
- if (mode->HSkew) {
- snprintf(tmp, 256, "hskew %i", mode->HSkew);
- add(&flags, tmp);
- }
- if (mode->VScan) {
- snprintf(tmp, 256, "vscan %i", mode->VScan);
- add(&flags, tmp);
- }
- if (mode->Flags & V_INTERLACE) add(&flags, "interlace");
- if (mode->Flags & V_CSYNC) add(&flags, "composite");
- if (mode->Flags & V_DBLSCAN) add(&flags, "doublescan");
- if (mode->Flags & V_BCAST) add(&flags, "bcast");
- if (mode->Flags & V_PHSYNC) add(&flags, "+hsync");
- if (mode->Flags & V_NHSYNC) add(&flags, "-hsync");
- if (mode->Flags & V_PVSYNC) add(&flags, "+vsync");
- if (mode->Flags & V_NVSYNC) add(&flags, "-vsync");
- if (mode->Flags & V_PCSYNC) add(&flags, "+csync");
- if (mode->Flags & V_NCSYNC) add(&flags, "-csync");
-#if 0
- if (mode->Flags & V_CLKDIV2) add(&flags, "vclk/2");
-#endif
- xf86DrvMsg(scrnIndex, X_INFO,
- "Modeline \"%s\"x%.01f %6.2f %i %i %i %i %i %i %i %i%s "
- "(%.01f kHz)\n",
- mode->name, mode->VRefresh, mode->Clock/1000., mode->HDisplay,
- mode->HSyncStart, mode->HSyncEnd, mode->HTotal,
- mode->VDisplay, mode->VSyncStart, mode->VSyncEnd,
- mode->VTotal, flags, xf86ModeHSync(mode));
- free(flags);
-}
-
-/**
- * Marks as bad any modes with unsupported flags.
- *
- * \param modeList doubly-linked list of modes.
- * \param flags flags supported by the driver.
- *
- * \bug only V_INTERLACE and V_DBLSCAN are supported. Is that enough?
- */
-void
-xf86ValidateModesFlags(ScrnInfoPtr pScrn, DisplayModePtr modeList,
- int flags)
-{
- DisplayModePtr mode;
-
- if (flags == (V_INTERLACE | V_DBLSCAN))
- return;
-
- for (mode = modeList; mode != NULL; mode = mode->next) {
- if (mode->Flags & V_INTERLACE && !(flags & V_INTERLACE))
- mode->status = MODE_NO_INTERLACE;
- if (mode->Flags & V_DBLSCAN && !(flags & V_DBLSCAN))
- mode->status = MODE_NO_DBLESCAN;
- }
-}
-
-/**
- * Marks as bad any modes extending beyond the given max X, Y, or pitch.
- *
- * \param modeList doubly-linked list of modes.
- */
-void
-xf86ValidateModesSize(ScrnInfoPtr pScrn, DisplayModePtr modeList,
- int maxX, int maxY, int maxPitch)
-{
- DisplayModePtr mode;
-
- if (maxPitch <= 0)
- maxPitch = MAXINT;
- if (maxX <= 0)
- maxX = MAXINT;
- if (maxY <= 0)
- maxY = MAXINT;
-
- for (mode = modeList; mode != NULL; mode = mode->next) {
- if ((xf86ModeWidth(mode, RR_Rotate_0) > maxPitch ||
- xf86ModeWidth(mode, RR_Rotate_0) > maxX ||
- xf86ModeHeight(mode, RR_Rotate_0) > maxY) &&
- (xf86ModeWidth(mode, RR_Rotate_90) > maxPitch ||
- xf86ModeWidth(mode, RR_Rotate_90) > maxX ||
- xf86ModeHeight(mode, RR_Rotate_90) > maxY)) {
- if (xf86ModeWidth(mode, RR_Rotate_0) > maxPitch ||
- xf86ModeWidth(mode, RR_Rotate_90) > maxPitch)
- mode->status = MODE_BAD_WIDTH;
-
- if (xf86ModeWidth(mode, RR_Rotate_0) > maxX ||
- xf86ModeWidth(mode, RR_Rotate_90) > maxX)
- mode->status = MODE_VIRTUAL_X;
-
- if (xf86ModeHeight(mode, RR_Rotate_0) > maxY ||
- xf86ModeHeight(mode, RR_Rotate_90) > maxY)
- mode->status = MODE_VIRTUAL_Y;
- }
-
- if (mode->next == modeList)
- break;
- }
-}
-
-/**
- * Marks as bad any modes that aren't supported by the given monitor's
- * hsync and vrefresh ranges.
- *
- * \param modeList doubly-linked list of modes.
- */
-void
-xf86ValidateModesSync(ScrnInfoPtr pScrn, DisplayModePtr modeList,
- MonPtr mon)
-{
- DisplayModePtr mode;
-
- for (mode = modeList; mode != NULL; mode = mode->next) {
- Bool bad;
- int i;
-
- bad = TRUE;
- for (i = 0; i < mon->nHsync; i++) {
- if (xf86ModeHSync(mode) >= mon->hsync[i].lo * (1-SYNC_TOLERANCE) &&
- xf86ModeHSync(mode) <= mon->hsync[i].hi * (1+SYNC_TOLERANCE))
- {
- bad = FALSE;
- }
- }
- if (bad)
- mode->status = MODE_HSYNC;
-
- bad = TRUE;
- for (i = 0; i < mon->nVrefresh; i++) {
- if (xf86ModeVRefresh(mode) >= mon->vrefresh[i].lo * (1-SYNC_TOLERANCE) &&
- xf86ModeVRefresh(mode) <= mon->vrefresh[i].hi * (1+SYNC_TOLERANCE))
- {
- bad = FALSE;
- }
- }
- if (bad)
- mode->status = MODE_VSYNC;
-
- if (mode->next == modeList)
- break;
- }
-}
-
-/**
- * Marks as bad any modes extending beyond outside of the given clock ranges.
- *
- * \param modeList doubly-linked list of modes.
- * \param min pointer to minimums of clock ranges
- * \param max pointer to maximums of clock ranges
- * \param n_ranges number of ranges.
- */
-void
-xf86ValidateModesClocks(ScrnInfoPtr pScrn, DisplayModePtr modeList,
- int *min, int *max, int n_ranges)
-{
- DisplayModePtr mode;
- int i;
-
- for (mode = modeList; mode != NULL; mode = mode->next) {
- Bool good = FALSE;
- for (i = 0; i < n_ranges; i++) {
- if (mode->Clock >= min[i] * (1-SYNC_TOLERANCE) &&
- mode->Clock <= max[i] * (1+SYNC_TOLERANCE)) {
- good = TRUE;
- break;
- }
- }
- if (!good)
- mode->status = MODE_CLOCK_RANGE;
- }
-}
-
-/**
- * If the user has specified a set of mode names to use, mark as bad any modes
- * not listed.
- *
- * The user mode names specified are prefixes to names of modes, so "1024x768"
- * will match modes named "1024x768", "1024x768x75", "1024x768-good", but
- * "1024x768x75" would only match "1024x768x75" from that list.
- *
- * MODE_BAD is used as the rejection flag, for lack of a better flag.
- *
- * \param modeList doubly-linked list of modes.
- */
-void
-xf86ValidateModesUserConfig(ScrnInfoPtr pScrn, DisplayModePtr modeList)
-{
- DisplayModePtr mode;
-
- if (pScrn->display->modes[0] == NULL)
- return;
-
- for (mode = modeList; mode != NULL; mode = mode->next) {
- int i;
- Bool good = FALSE;
-
- for (i = 0; pScrn->display->modes[i] != NULL; i++) {
- if (strncmp(pScrn->display->modes[i], mode->name,
- strlen(pScrn->display->modes[i])) == 0) {
- good = TRUE;
- break;
- }
- }
- if (!good)
- mode->status = MODE_BAD;
- }
-}
-
-
-/**
- * Marks as bad any modes exceeding the given bandwidth.
- *
- * \param modeList doubly-linked list of modes.
- * \param bandwidth bandwidth in MHz.
- * \param depth color depth.
- */
-void
-xf86ValidateModesBandwidth(ScrnInfoPtr pScrn, DisplayModePtr modeList,
- unsigned int bandwidth, int depth)
-{
- DisplayModePtr mode;
-
- for (mode = modeList; mode != NULL; mode = mode->next) {
- if (xf86ModeBandwidth(mode, depth) > bandwidth)
- mode->status = MODE_BANDWIDTH;
- }
-}
-
-Bool
-xf86ModeIsReduced(const DisplayModeRec *mode)
-{
- if ((((mode->HDisplay * 5 / 4) & ~0x07) > mode->HTotal) &&
- ((mode->HTotal - mode->HDisplay) == 160) &&
- ((mode->HSyncEnd - mode->HDisplay) == 80) &&
- ((mode->HSyncEnd - mode->HSyncStart) == 32) &&
- ((mode->VSyncStart - mode->VDisplay) == 3))
- return TRUE;
- return FALSE;
-}
-
-/**
- * Marks as bad any reduced-blanking modes.
- *
- * \param modeList doubly-linked list of modes.
- */
-void
-xf86ValidateModesReducedBlanking(ScrnInfoPtr pScrn, DisplayModePtr modeList)
-{
- for (; modeList != NULL; modeList = modeList->next)
- if (xf86ModeIsReduced(modeList))
- modeList->status = MODE_NO_REDUCED;
-}
-
-/**
- * Frees any modes from the list with a status other than MODE_OK.
- *
- * \param modeList pointer to a doubly-linked or circular list of modes.
- * \param verbose determines whether the reason for mode invalidation is
- * printed.
- */
-void
-xf86PruneInvalidModes(ScrnInfoPtr pScrn, DisplayModePtr *modeList,
- Bool verbose)
-{
- DisplayModePtr mode;
-
- for (mode = *modeList; mode != NULL;) {
- DisplayModePtr next = mode->next, first = *modeList;
-
- if (mode->status != MODE_OK) {
- if (verbose) {
- char *type = "";
- if (mode->type & M_T_BUILTIN)
- type = "built-in ";
- else if (mode->type & M_T_DEFAULT)
- type = "default ";
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Not using %smode \"%s\" (%s)\n", type, mode->name,
- xf86ModeStatusToString(mode->status));
- }
- xf86DeleteMode(modeList, mode);
- }
-
- if (next == first)
- break;
- mode = next;
- }
-}
-
-/**
- * Adds the new mode into the mode list, and returns the new list
- *
- * \param modes doubly-linked mode list.
- */
-DisplayModePtr
-xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new)
-{
- if (modes == NULL)
- return new;
-
- if (new) {
- DisplayModePtr mode = modes;
-
- while (mode->next)
- mode = mode->next;
-
- mode->next = new;
- new->prev = mode;
- }
-
- return modes;
-}
-
-/**
- * Build a mode list from a list of config file modes
- */
-static DisplayModePtr
-xf86GetConfigModes (XF86ConfModeLinePtr conf_mode)
-{
- DisplayModePtr head = NULL, prev = NULL, mode;
-
- for (; conf_mode; conf_mode = (XF86ConfModeLinePtr) conf_mode->list.next)
- {
- mode = calloc(1, sizeof(DisplayModeRec));
- if (!mode)
- continue;
- mode->name = xstrdup(conf_mode->ml_identifier);
- if (!mode->name)
- {
- free(mode);
- continue;
- }
- mode->type = 0;
- mode->Clock = conf_mode->ml_clock;
- mode->HDisplay = conf_mode->ml_hdisplay;
- mode->HSyncStart = conf_mode->ml_hsyncstart;
- mode->HSyncEnd = conf_mode->ml_hsyncend;
- mode->HTotal = conf_mode->ml_htotal;
- mode->VDisplay = conf_mode->ml_vdisplay;
- mode->VSyncStart = conf_mode->ml_vsyncstart;
- mode->VSyncEnd = conf_mode->ml_vsyncend;
- mode->VTotal = conf_mode->ml_vtotal;
- mode->Flags = conf_mode->ml_flags;
- mode->HSkew = conf_mode->ml_hskew;
- mode->VScan = conf_mode->ml_vscan;
-
- mode->prev = prev;
- mode->next = NULL;
- if (prev)
- prev->next = mode;
- else
- head = mode;
- prev = mode;
- }
- return head;
-}
-
-/**
- * Build a mode list from a monitor configuration
- */
-DisplayModePtr
-xf86GetMonitorModes (ScrnInfoPtr pScrn, XF86ConfMonitorPtr conf_monitor)
-{
- DisplayModePtr modes = NULL;
- XF86ConfModesLinkPtr modes_link;
-
- if (!conf_monitor)
- return NULL;
-
- /*
- * first we collect the mode lines from the UseModes directive
- */
- for (modes_link = conf_monitor->mon_modes_sect_lst;
- modes_link;
- modes_link = modes_link->list.next)
- {
- /* If this modes link hasn't been resolved, go look it up now */
- if (!modes_link->ml_modes)
- modes_link->ml_modes = xf86findModes (modes_link->ml_modes_str,
- xf86configptr->conf_modes_lst);
- if (modes_link->ml_modes)
- modes = xf86ModesAdd (modes,
- xf86GetConfigModes (modes_link->ml_modes->mon_modeline_lst));
- }
-
- return xf86ModesAdd (modes,
- xf86GetConfigModes (conf_monitor->mon_modeline_lst));
-}
-
-/**
- * Build a mode list containing all of the default modes
- */
-DisplayModePtr
-xf86GetDefaultModes (void)
-{
- DisplayModePtr head = NULL, mode;
- int i;
-
- for (i = 0; i < xf86NumDefaultModes; i++)
- {
- const DisplayModeRec *defMode = &xf86DefaultModes[i];
-
- mode = xf86DuplicateMode(defMode);
- head = xf86ModesAdd(head, mode);
- }
- return head;
-}
-
-/*
- * Walk a mode list and prune out duplicates. Will preserve the preferred
- * mode of an otherwise-duplicate pair.
- *
- * Probably best to call this on lists that are all of a single class
- * (driver, default, user, etc.), otherwise, which mode gets deleted is
- * not especially well defined.
- *
- * Returns the new list.
- */
-
-DisplayModePtr
-xf86PruneDuplicateModes(DisplayModePtr modes)
-{
- DisplayModePtr m, n, o;
-
-top:
- for (m = modes; m; m = m->next) {
- for (n = m->next; n; n = o) {
- o = n->next;
- if (xf86ModesEqual(m, n)) {
- if (n->type & M_T_PREFERRED) {
- xf86DeleteMode(&modes, m);
- goto top;
- }
- else
- xf86DeleteMode(&modes, n);
- }
- }
- }
-
- return modes;
-}
+/*
+ * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of the copyright holder(s)
+ * and author(s) shall not be used in advertising or otherwise to promote
+ * the sale, use or other dealings in this Software without prior written
+ * authorization from the copyright holder(s) and author(s).
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#else
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#endif
+
+#include "xf86Modes.h"
+#include "xf86Priv.h"
+
+extern XF86ConfigPtr xf86configptr;
+
+/**
+ * Calculates the horizontal sync rate of a mode.
+ */
+double
+xf86ModeHSync(const DisplayModeRec *mode)
+{
+ double hsync = 0.0;
+
+ if (mode->HSync > 0.0)
+ hsync = mode->HSync;
+ else if (mode->HTotal > 0)
+ hsync = (float)mode->Clock / (float)mode->HTotal;
+
+ return hsync;
+}
+
+/**
+ * Calculates the vertical refresh rate of a mode.
+ */
+double
+xf86ModeVRefresh(const DisplayModeRec *mode)
+{
+ double refresh = 0.0;
+
+ if (mode->VRefresh > 0.0)
+ refresh = mode->VRefresh;
+ else if (mode->HTotal > 0 && mode->VTotal > 0) {
+ refresh = mode->Clock * 1000.0 / mode->HTotal / mode->VTotal;
+ if (mode->Flags & V_INTERLACE)
+ refresh *= 2.0;
+ if (mode->Flags & V_DBLSCAN)
+ refresh /= 2.0;
+ if (mode->VScan > 1)
+ refresh /= (float)(mode->VScan);
+ }
+ return refresh;
+}
+
+int
+xf86ModeWidth (const DisplayModeRec *mode, Rotation rotation)
+{
+ switch (rotation & 0xf) {
+ case RR_Rotate_0:
+ case RR_Rotate_180:
+ return mode->HDisplay;
+ case RR_Rotate_90:
+ case RR_Rotate_270:
+ return mode->VDisplay;
+ default:
+ return 0;
+ }
+}
+
+int
+xf86ModeHeight (const DisplayModeRec *mode, Rotation rotation)
+{
+ switch (rotation & 0xf) {
+ case RR_Rotate_0:
+ case RR_Rotate_180:
+ return mode->VDisplay;
+ case RR_Rotate_90:
+ case RR_Rotate_270:
+ return mode->HDisplay;
+ default:
+ return 0;
+ }
+}
+
+/** Calculates the memory bandwidth (in MiB/sec) of a mode. */
+unsigned int
+xf86ModeBandwidth(DisplayModePtr mode, int depth)
+{
+ float a_active, a_total, active_percent, pixels_per_second;
+ int bytes_per_pixel = bits_to_bytes(depth);
+
+ if (!mode->HTotal || !mode->VTotal || !mode->Clock)
+ return 0;
+
+ a_active = mode->HDisplay * mode->VDisplay;
+ a_total = mode->HTotal * mode->VTotal;
+ active_percent = a_active / a_total;
+ pixels_per_second = active_percent * mode->Clock * 1000.0;
+
+ return (unsigned int)(pixels_per_second * bytes_per_pixel / (1024 * 1024));
+}
+
+/** Sets a default mode name of <width>x<height> on a mode. */
+void
+xf86SetModeDefaultName(DisplayModePtr mode)
+{
+ Bool interlaced = !!(mode->Flags & V_INTERLACE);
+
+ free(mode->name);
+
+ XNFasprintf(&mode->name, "%dx%d%s", mode->HDisplay, mode->VDisplay,
+ interlaced ? "i" : "");
+}
+
+/*
+ * xf86SetModeCrtc
+ *
+ * Initialises the Crtc parameters for a mode. The initialisation includes
+ * adjustments for interlaced and double scan modes.
+ */
+void
+xf86SetModeCrtc(DisplayModePtr p, int adjustFlags)
+{
+ if ((p == NULL) || ((p->type & M_T_CRTC_C) == M_T_BUILTIN))
+ return;
+
+ p->CrtcHDisplay = p->HDisplay;
+ p->CrtcHSyncStart = p->HSyncStart;
+ p->CrtcHSyncEnd = p->HSyncEnd;
+ p->CrtcHTotal = p->HTotal;
+ p->CrtcHSkew = p->HSkew;
+ p->CrtcVDisplay = p->VDisplay;
+ p->CrtcVSyncStart = p->VSyncStart;
+ p->CrtcVSyncEnd = p->VSyncEnd;
+ p->CrtcVTotal = p->VTotal;
+ if (p->Flags & V_INTERLACE) {
+ if (adjustFlags & INTERLACE_HALVE_V) {
+ p->CrtcVDisplay /= 2;
+ p->CrtcVSyncStart /= 2;
+ p->CrtcVSyncEnd /= 2;
+ p->CrtcVTotal /= 2;
+ }
+ /* Force interlaced modes to have an odd VTotal */
+ /* maybe we should only do this when INTERLACE_HALVE_V is set? */
+ p->CrtcVTotal |= 1;
+ }
+
+ if (p->Flags & V_DBLSCAN) {
+ p->CrtcVDisplay *= 2;
+ p->CrtcVSyncStart *= 2;
+ p->CrtcVSyncEnd *= 2;
+ p->CrtcVTotal *= 2;
+ }
+ if (p->VScan > 1) {
+ p->CrtcVDisplay *= p->VScan;
+ p->CrtcVSyncStart *= p->VScan;
+ p->CrtcVSyncEnd *= p->VScan;
+ p->CrtcVTotal *= p->VScan;
+ }
+ p->CrtcVBlankStart = min(p->CrtcVSyncStart, p->CrtcVDisplay);
+ p->CrtcVBlankEnd = max(p->CrtcVSyncEnd, p->CrtcVTotal);
+ p->CrtcHBlankStart = min(p->CrtcHSyncStart, p->CrtcHDisplay);
+ p->CrtcHBlankEnd = max(p->CrtcHSyncEnd, p->CrtcHTotal);
+
+ p->CrtcHAdjusted = FALSE;
+ p->CrtcVAdjusted = FALSE;
+}
+
+/**
+ * Allocates and returns a copy of pMode, including pointers within pMode.
+ */
+DisplayModePtr
+xf86DuplicateMode(const DisplayModeRec *pMode)
+{
+ DisplayModePtr pNew;
+
+ pNew = xnfalloc(sizeof(DisplayModeRec));
+ *pNew = *pMode;
+ pNew->next = NULL;
+ pNew->prev = NULL;
+
+ if (pMode->name == NULL)
+ xf86SetModeDefaultName(pNew);
+ else
+ pNew->name = xnfstrdup(pMode->name);
+
+ return pNew;
+}
+
+/**
+ * Duplicates every mode in the given list and returns a pointer to the first
+ * mode.
+ *
+ * \param modeList doubly-linked mode list
+ */
+DisplayModePtr
+xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList)
+{
+ DisplayModePtr first = NULL, last = NULL;
+ DisplayModePtr mode;
+
+ for (mode = modeList; mode != NULL; mode = mode->next) {
+ DisplayModePtr new;
+
+ new = xf86DuplicateMode(mode);
+
+ /* Insert pNew into modeList */
+ if (last) {
+ last->next = new;
+ new->prev = last;
+ } else {
+ first = new;
+ new->prev = NULL;
+ }
+ new->next = NULL;
+ last = new;
+ }
+
+ return first;
+}
+
+/**
+ * Returns true if the given modes should program to the same timings.
+ *
+ * This doesn't use Crtc values, as it might be used on ModeRecs without the
+ * Crtc values set. So, it's assumed that the other numbers are enough.
+ */
+Bool
+xf86ModesEqual(const DisplayModeRec *pMode1, const DisplayModeRec *pMode2)
+{
+ if (pMode1->Clock == pMode2->Clock &&
+ pMode1->HDisplay == pMode2->HDisplay &&
+ pMode1->HSyncStart == pMode2->HSyncStart &&
+ pMode1->HSyncEnd == pMode2->HSyncEnd &&
+ pMode1->HTotal == pMode2->HTotal &&
+ pMode1->HSkew == pMode2->HSkew &&
+ pMode1->VDisplay == pMode2->VDisplay &&
+ pMode1->VSyncStart == pMode2->VSyncStart &&
+ pMode1->VSyncEnd == pMode2->VSyncEnd &&
+ pMode1->VTotal == pMode2->VTotal &&
+ pMode1->VScan == pMode2->VScan &&
+ pMode1->Flags == pMode2->Flags)
+ {
+ return TRUE;
+ } else {
+ return FALSE;
+ }
+}
+
+static void
+add(char **p, char *new)
+{
+ *p = xnfrealloc(*p, strlen(*p) + strlen(new) + 2);
+ strcat(*p, " ");
+ strcat(*p, new);
+}
+
+/**
+ * Print out a modeline.
+ *
+ * The mode type bits are informational except for the capitalized U
+ * and P bits which give sort order priority. Letter map:
+ *
+ * USERPREF, U, user preferred is set from the xorg.conf Monitor
+ * Option "PreferredMode" or from the Screen Display Modes statement.
+ * This unique modeline is moved to the head of the list after sorting.
+ *
+ * DRIVER, e, is set by the video driver, EDID or flat panel native.
+ *
+ * USERDEF, z, a configured zoom mode Ctrl+Alt+Keypad-{Plus,Minus}.
+ *
+ * DEFAULT, d, a compiled-in default.
+ *
+ * PREFERRED, P, driver preferred is set by the video device driver,
+ * e.g. the EDID detailed timing modeline. This is a true sort
+ * priority and multiple P modes form a sorted sublist at the list
+ * head.
+ *
+ * BUILTIN, b, a hardware fixed CRTC mode.
+ *
+ * See modes/xf86Crtc.c: xf86ProbeOutputModes().
+ */
+void
+xf86PrintModeline(int scrnIndex, DisplayModePtr mode)
+{
+ char tmp[256];
+ char *flags = xnfcalloc(1, 1);
+#define TBITS 6
+ const char tchar[TBITS+1] = "UezdPb";
+ int tbit[TBITS] = {
+ M_T_USERPREF, M_T_DRIVER, M_T_USERDEF,
+ M_T_DEFAULT, M_T_PREFERRED, M_T_BUILTIN
+ };
+ char type[TBITS+2]; /* +1 for leading space */
+#undef TBITS
+ int tlen = 0;
+
+ if (mode->type) {
+ int i;
+
+ type[tlen++] = ' ';
+ for (i = 0; tchar[i]; i++)
+ if (mode->type & tbit[i])
+ type[tlen++] = tchar[i];
+ }
+ type[tlen] = '\0';
+
+ if (mode->HSkew) {
+ snprintf(tmp, 256, "hskew %i", mode->HSkew);
+ add(&flags, tmp);
+ }
+ if (mode->VScan) {
+ snprintf(tmp, 256, "vscan %i", mode->VScan);
+ add(&flags, tmp);
+ }
+ if (mode->Flags & V_INTERLACE) add(&flags, "interlace");
+ if (mode->Flags & V_CSYNC) add(&flags, "composite");
+ if (mode->Flags & V_DBLSCAN) add(&flags, "doublescan");
+ if (mode->Flags & V_BCAST) add(&flags, "bcast");
+ if (mode->Flags & V_PHSYNC) add(&flags, "+hsync");
+ if (mode->Flags & V_NHSYNC) add(&flags, "-hsync");
+ if (mode->Flags & V_PVSYNC) add(&flags, "+vsync");
+ if (mode->Flags & V_NVSYNC) add(&flags, "-vsync");
+ if (mode->Flags & V_PCSYNC) add(&flags, "+csync");
+ if (mode->Flags & V_NCSYNC) add(&flags, "-csync");
+#if 0
+ if (mode->Flags & V_CLKDIV2) add(&flags, "vclk/2");
+#endif
+ xf86DrvMsg(scrnIndex, X_INFO,
+ "Modeline \"%s\"x%.01f %6.2f %i %i %i %i %i %i %i %i%s"
+ " (%.01f kHz%s)\n",
+ mode->name, mode->VRefresh, mode->Clock/1000.,
+ mode->HDisplay, mode->HSyncStart, mode->HSyncEnd, mode->HTotal,
+ mode->VDisplay, mode->VSyncStart, mode->VSyncEnd, mode->VTotal,
+ flags, xf86ModeHSync(mode), type);
+ free(flags);
+}
+
+/**
+ * Marks as bad any modes with unsupported flags.
+ *
+ * \param modeList doubly-linked list of modes.
+ * \param flags flags supported by the driver.
+ *
+ * \bug only V_INTERLACE and V_DBLSCAN are supported. Is that enough?
+ */
+void
+xf86ValidateModesFlags(ScrnInfoPtr pScrn, DisplayModePtr modeList,
+ int flags)
+{
+ DisplayModePtr mode;
+
+ if (flags == (V_INTERLACE | V_DBLSCAN))
+ return;
+
+ for (mode = modeList; mode != NULL; mode = mode->next) {
+ if (mode->Flags & V_INTERLACE && !(flags & V_INTERLACE))
+ mode->status = MODE_NO_INTERLACE;
+ if (mode->Flags & V_DBLSCAN && !(flags & V_DBLSCAN))
+ mode->status = MODE_NO_DBLESCAN;
+ }
+}
+
+/**
+ * Marks as bad any modes extending beyond the given max X, Y, or pitch.
+ *
+ * \param modeList doubly-linked list of modes.
+ */
+void
+xf86ValidateModesSize(ScrnInfoPtr pScrn, DisplayModePtr modeList,
+ int maxX, int maxY, int maxPitch)
+{
+ DisplayModePtr mode;
+
+ if (maxPitch <= 0)
+ maxPitch = MAXINT;
+ if (maxX <= 0)
+ maxX = MAXINT;
+ if (maxY <= 0)
+ maxY = MAXINT;
+
+ for (mode = modeList; mode != NULL; mode = mode->next) {
+ if ((xf86ModeWidth(mode, RR_Rotate_0) > maxPitch ||
+ xf86ModeWidth(mode, RR_Rotate_0) > maxX ||
+ xf86ModeHeight(mode, RR_Rotate_0) > maxY) &&
+ (xf86ModeWidth(mode, RR_Rotate_90) > maxPitch ||
+ xf86ModeWidth(mode, RR_Rotate_90) > maxX ||
+ xf86ModeHeight(mode, RR_Rotate_90) > maxY)) {
+ if (xf86ModeWidth(mode, RR_Rotate_0) > maxPitch ||
+ xf86ModeWidth(mode, RR_Rotate_90) > maxPitch)
+ mode->status = MODE_BAD_WIDTH;
+
+ if (xf86ModeWidth(mode, RR_Rotate_0) > maxX ||
+ xf86ModeWidth(mode, RR_Rotate_90) > maxX)
+ mode->status = MODE_VIRTUAL_X;
+
+ if (xf86ModeHeight(mode, RR_Rotate_0) > maxY ||
+ xf86ModeHeight(mode, RR_Rotate_90) > maxY)
+ mode->status = MODE_VIRTUAL_Y;
+ }
+
+ if (mode->next == modeList)
+ break;
+ }
+}
+
+/**
+ * Marks as bad any modes that aren't supported by the given monitor's
+ * hsync and vrefresh ranges.
+ *
+ * \param modeList doubly-linked list of modes.
+ */
+void
+xf86ValidateModesSync(ScrnInfoPtr pScrn, DisplayModePtr modeList,
+ MonPtr mon)
+{
+ DisplayModePtr mode;
+
+ for (mode = modeList; mode != NULL; mode = mode->next) {
+ Bool bad;
+ int i;
+
+ bad = TRUE;
+ for (i = 0; i < mon->nHsync; i++) {
+ if (xf86ModeHSync(mode) >= mon->hsync[i].lo * (1-SYNC_TOLERANCE) &&
+ xf86ModeHSync(mode) <= mon->hsync[i].hi * (1+SYNC_TOLERANCE))
+ {
+ bad = FALSE;
+ }
+ }
+ if (bad)
+ mode->status = MODE_HSYNC;
+
+ bad = TRUE;
+ for (i = 0; i < mon->nVrefresh; i++) {
+ if (xf86ModeVRefresh(mode) >= mon->vrefresh[i].lo * (1-SYNC_TOLERANCE) &&
+ xf86ModeVRefresh(mode) <= mon->vrefresh[i].hi * (1+SYNC_TOLERANCE))
+ {
+ bad = FALSE;
+ }
+ }
+ if (bad)
+ mode->status = MODE_VSYNC;
+
+ if (mode->next == modeList)
+ break;
+ }
+}
+
+/**
+ * Marks as bad any modes extending beyond outside of the given clock ranges.
+ *
+ * \param modeList doubly-linked list of modes.
+ * \param min pointer to minimums of clock ranges
+ * \param max pointer to maximums of clock ranges
+ * \param n_ranges number of ranges.
+ */
+void
+xf86ValidateModesClocks(ScrnInfoPtr pScrn, DisplayModePtr modeList,
+ int *min, int *max, int n_ranges)
+{
+ DisplayModePtr mode;
+ int i;
+
+ for (mode = modeList; mode != NULL; mode = mode->next) {
+ Bool good = FALSE;
+ for (i = 0; i < n_ranges; i++) {
+ if (mode->Clock >= min[i] * (1-SYNC_TOLERANCE) &&
+ mode->Clock <= max[i] * (1+SYNC_TOLERANCE)) {
+ good = TRUE;
+ break;
+ }
+ }
+ if (!good)
+ mode->status = MODE_CLOCK_RANGE;
+ }
+}
+
+/**
+ * If the user has specified a set of mode names to use, mark as bad any modes
+ * not listed.
+ *
+ * The user mode names specified are prefixes to names of modes, so "1024x768"
+ * will match modes named "1024x768", "1024x768x75", "1024x768-good", but
+ * "1024x768x75" would only match "1024x768x75" from that list.
+ *
+ * MODE_BAD is used as the rejection flag, for lack of a better flag.
+ *
+ * \param modeList doubly-linked list of modes.
+ */
+void
+xf86ValidateModesUserConfig(ScrnInfoPtr pScrn, DisplayModePtr modeList)
+{
+ DisplayModePtr mode;
+
+ if (pScrn->display->modes[0] == NULL)
+ return;
+
+ for (mode = modeList; mode != NULL; mode = mode->next) {
+ int i;
+ Bool good = FALSE;
+
+ for (i = 0; pScrn->display->modes[i] != NULL; i++) {
+ if (strncmp(pScrn->display->modes[i], mode->name,
+ strlen(pScrn->display->modes[i])) == 0) {
+ good = TRUE;
+ break;
+ }
+ }
+ if (!good)
+ mode->status = MODE_BAD;
+ }
+}
+
+
+/**
+ * Marks as bad any modes exceeding the given bandwidth.
+ *
+ * \param modeList doubly-linked list of modes.
+ * \param bandwidth bandwidth in MHz.
+ * \param depth color depth.
+ */
+void
+xf86ValidateModesBandwidth(ScrnInfoPtr pScrn, DisplayModePtr modeList,
+ unsigned int bandwidth, int depth)
+{
+ DisplayModePtr mode;
+
+ for (mode = modeList; mode != NULL; mode = mode->next) {
+ if (xf86ModeBandwidth(mode, depth) > bandwidth)
+ mode->status = MODE_BANDWIDTH;
+ }
+}
+
+Bool
+xf86ModeIsReduced(const DisplayModeRec *mode)
+{
+ if ((((mode->HDisplay * 5 / 4) & ~0x07) > mode->HTotal) &&
+ ((mode->HTotal - mode->HDisplay) == 160) &&
+ ((mode->HSyncEnd - mode->HDisplay) == 80) &&
+ ((mode->HSyncEnd - mode->HSyncStart) == 32) &&
+ ((mode->VSyncStart - mode->VDisplay) == 3))
+ return TRUE;
+ return FALSE;
+}
+
+/**
+ * Marks as bad any reduced-blanking modes.
+ *
+ * \param modeList doubly-linked list of modes.
+ */
+void
+xf86ValidateModesReducedBlanking(ScrnInfoPtr pScrn, DisplayModePtr modeList)
+{
+ for (; modeList != NULL; modeList = modeList->next)
+ if (xf86ModeIsReduced(modeList))
+ modeList->status = MODE_NO_REDUCED;
+}
+
+/**
+ * Frees any modes from the list with a status other than MODE_OK.
+ *
+ * \param modeList pointer to a doubly-linked or circular list of modes.
+ * \param verbose determines whether the reason for mode invalidation is
+ * printed.
+ */
+void
+xf86PruneInvalidModes(ScrnInfoPtr pScrn, DisplayModePtr *modeList,
+ Bool verbose)
+{
+ DisplayModePtr mode;
+
+ for (mode = *modeList; mode != NULL;) {
+ DisplayModePtr next = mode->next, first = *modeList;
+
+ if (mode->status != MODE_OK) {
+ if (verbose) {
+ char *type = "";
+ if (mode->type & M_T_BUILTIN)
+ type = "built-in ";
+ else if (mode->type & M_T_DEFAULT)
+ type = "default ";
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Not using %smode \"%s\" (%s)\n", type, mode->name,
+ xf86ModeStatusToString(mode->status));
+ }
+ xf86DeleteMode(modeList, mode);
+ }
+
+ if (next == first)
+ break;
+ mode = next;
+ }
+}
+
+/**
+ * Adds the new mode into the mode list, and returns the new list
+ *
+ * \param modes doubly-linked mode list.
+ */
+DisplayModePtr
+xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new)
+{
+ if (modes == NULL)
+ return new;
+
+ if (new) {
+ DisplayModePtr mode = modes;
+
+ while (mode->next)
+ mode = mode->next;
+
+ mode->next = new;
+ new->prev = mode;
+ }
+
+ return modes;
+}
+
+/**
+ * Build a mode list from a list of config file modes
+ */
+static DisplayModePtr
+xf86GetConfigModes (XF86ConfModeLinePtr conf_mode)
+{
+ DisplayModePtr head = NULL, prev = NULL, mode;
+
+ for (; conf_mode; conf_mode = (XF86ConfModeLinePtr) conf_mode->list.next)
+ {
+ mode = calloc(1, sizeof(DisplayModeRec));
+ if (!mode)
+ continue;
+ mode->name = xstrdup(conf_mode->ml_identifier);
+ if (!mode->name)
+ {
+ free(mode);
+ continue;
+ }
+ mode->type = 0;
+ mode->Clock = conf_mode->ml_clock;
+ mode->HDisplay = conf_mode->ml_hdisplay;
+ mode->HSyncStart = conf_mode->ml_hsyncstart;
+ mode->HSyncEnd = conf_mode->ml_hsyncend;
+ mode->HTotal = conf_mode->ml_htotal;
+ mode->VDisplay = conf_mode->ml_vdisplay;
+ mode->VSyncStart = conf_mode->ml_vsyncstart;
+ mode->VSyncEnd = conf_mode->ml_vsyncend;
+ mode->VTotal = conf_mode->ml_vtotal;
+ mode->Flags = conf_mode->ml_flags;
+ mode->HSkew = conf_mode->ml_hskew;
+ mode->VScan = conf_mode->ml_vscan;
+
+ mode->prev = prev;
+ mode->next = NULL;
+ if (prev)
+ prev->next = mode;
+ else
+ head = mode;
+ prev = mode;
+ }
+ return head;
+}
+
+/**
+ * Build a mode list from a monitor configuration
+ */
+DisplayModePtr
+xf86GetMonitorModes (ScrnInfoPtr pScrn, XF86ConfMonitorPtr conf_monitor)
+{
+ DisplayModePtr modes = NULL;
+ XF86ConfModesLinkPtr modes_link;
+
+ if (!conf_monitor)
+ return NULL;
+
+ /*
+ * first we collect the mode lines from the UseModes directive
+ */
+ for (modes_link = conf_monitor->mon_modes_sect_lst;
+ modes_link;
+ modes_link = modes_link->list.next)
+ {
+ /* If this modes link hasn't been resolved, go look it up now */
+ if (!modes_link->ml_modes)
+ modes_link->ml_modes = xf86findModes (modes_link->ml_modes_str,
+ xf86configptr->conf_modes_lst);
+ if (modes_link->ml_modes)
+ modes = xf86ModesAdd (modes,
+ xf86GetConfigModes (modes_link->ml_modes->mon_modeline_lst));
+ }
+
+ return xf86ModesAdd (modes,
+ xf86GetConfigModes (conf_monitor->mon_modeline_lst));
+}
+
+/**
+ * Build a mode list containing all of the default modes
+ */
+DisplayModePtr
+xf86GetDefaultModes (void)
+{
+ DisplayModePtr head = NULL, mode;
+ int i;
+
+ for (i = 0; i < xf86NumDefaultModes; i++)
+ {
+ const DisplayModeRec *defMode = &xf86DefaultModes[i];
+
+ mode = xf86DuplicateMode(defMode);
+ head = xf86ModesAdd(head, mode);
+ }
+ return head;
+}
+
+/*
+ * Walk a mode list and prune out duplicates. Will preserve the preferred
+ * mode of an otherwise-duplicate pair.
+ *
+ * Probably best to call this on lists that are all of a single class
+ * (driver, default, user, etc.), otherwise, which mode gets deleted is
+ * not especially well defined.
+ *
+ * Returns the new list.
+ */
+
+DisplayModePtr
+xf86PruneDuplicateModes(DisplayModePtr modes)
+{
+ DisplayModePtr m, n, o;
+
+top:
+ for (m = modes; m; m = m->next) {
+ for (n = m->next; n; n = o) {
+ o = n->next;
+ if (xf86ModesEqual(m, n)) {
+ if (n->type & M_T_PREFERRED) {
+ xf86DeleteMode(&modes, m);
+ goto top;
+ }
+ else
+ xf86DeleteMode(&modes, n);
+ }
+ }
+ }
+
+ return modes;
+}
diff --git a/xorg-server/hw/xfree86/os-support/bsd/bsd_init.c b/xorg-server/hw/xfree86/os-support/bsd/bsd_init.c
index 123eb17d1..837a2f4d1 100644
--- a/xorg-server/hw/xfree86/os-support/bsd/bsd_init.c
+++ b/xorg-server/hw/xfree86/os-support/bsd/bsd_init.c
@@ -45,7 +45,6 @@ static int devConsoleFd = -1;
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
static int VTnum = -1;
static int initialVT = -1;
-static Bool ShareVTs = FALSE;
#endif
#ifdef PCCONS_SUPPORT
@@ -266,7 +265,7 @@ xf86OpenConsole()
}
#endif
acquire_vt:
- if (!ShareVTs) {
+ if (!xf86Info.ShareVTs) {
/*
* now get the VT
*/
@@ -304,7 +303,7 @@ acquire_vt:
{
FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed");
}
- } else { /* ShareVTs */
+ } else { /* xf86Info.ShareVTs */
close(xf86Info.consoleFd);
}
break;
@@ -320,7 +319,8 @@ acquire_vt:
{
/* serverGeneration != 1 */
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- if (!ShareVTs) if (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT)
+ if (!xf86Info.ShareVTs &&
+ (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT))
{
if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
{
@@ -393,7 +393,7 @@ xf86OpenSyscons()
if (ioctl(fd, VT_GETACTIVE, &initialVT) < 0)
initialVT = -1;
#endif
- if (ShareVTs)
+ if (xf86Info.ShareVTs)
xf86Info.vtno = initialVT;
if (xf86Info.vtno == -1)
@@ -655,7 +655,7 @@ xf86CloseConsole()
struct vt_mode VT;
#endif
- if (ShareVTs) return;
+ if (xf86Info.ShareVTs) return;
switch (xf86Info.consType)
{
@@ -723,11 +723,6 @@ xf86ProcessArgument(int argc, char *argv[], int i)
return 1;
}
#if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT)
- if (!strcmp(argv[i], "-sharevts"))
- {
- ShareVTs = TRUE;
- return 1;
- }
if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
{
if (sscanf(argv[i], "vt%2d", &VTnum) == 0 ||
diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_init.c b/xorg-server/hw/xfree86/os-support/linux/lnx_init.c
index 77dfb2f16..9c9174034 100644
--- a/xorg-server/hw/xfree86/os-support/linux/lnx_init.c
+++ b/xorg-server/hw/xfree86/os-support/linux/lnx_init.c
@@ -39,8 +39,6 @@
#include <sys/stat.h>
static Bool KeepTty = FALSE;
-static Bool VTSwitch = TRUE;
-static Bool ShareVTs = FALSE;
static int activeVT = -1;
static char vtname[11];
@@ -109,7 +107,7 @@ xf86OpenConsole(void)
"xf86OpenConsole: Cannot open /dev/tty0 (%s)\n",
strerror(errno));
- if (ShareVTs)
+ if (xf86Info.ShareVTs)
{
SYSCALL(ret = ioctl(fd, VT_GETSTATE, &vts));
if (ret < 0)
@@ -184,7 +182,7 @@ xf86OpenConsole(void)
}
#endif
- if (!ShareVTs)
+ if (!xf86Info.ShareVTs)
{
struct termios nTty;
@@ -240,7 +238,7 @@ xf86OpenConsole(void)
* of Init?$#*&Device(). So I just place it here */
}
} else { /* serverGeneration != 1 */
- if (!ShareVTs && VTSwitch)
+ if (!xf86Info.ShareVTs && xf86Info.autoVTSwitch)
{
/* now get the VT */
switch_to(xf86Info.vtno, "xf86OpenConsole");
@@ -254,7 +252,7 @@ xf86CloseConsole(void)
struct vt_mode VT;
int ret;
- if (ShareVTs) {
+ if (xf86Info.ShareVTs) {
close(xf86Info.consoleFd);
return;
}
@@ -286,7 +284,7 @@ xf86CloseConsole(void)
strerror(errno));
}
- if (VTSwitch)
+ if (xf86Info.autoVTSwitch)
{
/*
* Perform a switch back to the active VT when we were started
@@ -311,16 +309,7 @@ xf86ProcessArgument(int argc, char *argv[], int i)
KeepTty = TRUE;
return 1;
}
- if (!strcmp(argv[i], "-novtswitch"))
- {
- VTSwitch = FALSE;
- return 1;
- }
- if (!strcmp(argv[i], "-sharevts"))
- {
- ShareVTs = TRUE;
- return 1;
- }
+
if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
{
if (sscanf(argv[i], "vt%2d", &xf86Info.vtno) == 0)
@@ -340,6 +329,4 @@ xf86UseMsg(void)
ErrorF("vtXX use the specified VT number\n");
ErrorF("-keeptty ");
ErrorF("don't detach controlling tty (for debugging only)\n");
- ErrorF("-novtswitch don't immediately switch to new VT\n");
- ErrorF("-sharevts share VTs with another X server\n");
}
diff --git a/xorg-server/hw/xfree86/os-support/solaris/sun_init.c b/xorg-server/hw/xfree86/os-support/solaris/sun_init.c
index ae9adee4b..800fc1c3d 100644
--- a/xorg-server/hw/xfree86/os-support/solaris/sun_init.c
+++ b/xorg-server/hw/xfree86/os-support/solaris/sun_init.c
@@ -1,424 +1,442 @@
-/*
- * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
- * Copyright 1993 by David Wexelblat <dwex@goblin.org>
- * Copyright 1999 by David Holland <davidh@iquest.net>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the names of the copyright holders not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. The copyright holders make no representations
- * about the suitability of this software for any purpose. It is provided "as
- * is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
- * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#ifdef HAVE_SYS_KD_H
-# include <sys/kd.h>
-#endif
-
-/*
- * Applications see VT number as consecutive integers starting from 1.
- * VT number VT device
- * -------------------------------------------------------
- * 1 : /dev/vt/0 (Alt + Ctrl + F1)
- * 2 : /dev/vt/2 (Alt + Ctrl + F2)
- * 3 : /dev/vt/3 (Alt + Ctrl + F3)
- * ... ...
- */
-#define CONSOLE_VTNO 1
-#define SOL_CONSOLE_DEV "/dev/console"
-
-static Bool KeepTty = FALSE;
-static Bool Protect0 = FALSE;
-static Bool UseConsole = FALSE;
-#ifdef HAS_USL_VTS
-static int VTnum = -1;
-static int xf86StartVT = -1;
-static int vtEnabled = 0;
-extern void xf86VTAcquire(int);
-extern void xf86VTRelease(int);
-#endif
-
-/* Device to open as xf86Info.consoleFd */
-static char consoleDev[PATH_MAX] = "/dev/fb";
-
-/* Set by -dev argument on CLI
- Used by hw/xfree86/common/xf86AutoConfig.c for VIS_GETIDENTIFIER */
-_X_HIDDEN char xf86SolarisFbDev[PATH_MAX] = "/dev/fb";
-
-void
-xf86OpenConsole(void)
-{
- int i;
-#ifdef HAS_USL_VTS
- int fd;
- struct vt_mode VT;
- struct vt_stat vtinfo;
- MessageType from = X_PROBED;
-#endif
-
- if (serverGeneration == 1)
- {
- /* Check if we're run with euid==0 */
- if (geteuid() != 0)
- FatalError("xf86OpenConsole: Server must be suid root\n");
-
- /* Protect page 0 to help find NULL dereferencing */
- /* mprotect() doesn't seem to work */
- if (Protect0)
- {
- int fd = -1;
-
- if ((fd = open("/dev/zero", O_RDONLY, 0)) < 0)
- {
- xf86Msg(X_WARNING,
- "xf86OpenConsole: cannot open /dev/zero (%s)\n",
- strerror(errno));
- }
- else
- {
- if (mmap(0, 0x1000, PROT_NONE,
- MAP_FIXED | MAP_SHARED, fd, 0) == MAP_FAILED)
- xf86Msg(X_WARNING,
- "xf86OpenConsole: failed to protect page 0 (%s)\n",
- strerror(errno));
-
- close(fd);
- }
- }
-
-#ifdef HAS_USL_VTS
-
- /*
- * Setup the virtual terminal manager
- */
- if ((fd = open("/dev/vt/0",O_RDWR,0)) == -1)
- {
- xf86ErrorF("xf86OpenConsole: Cannot open /dev/vt/0 (%s)\n",
- strerror(errno));
- vtEnabled = 0;
- }
- else
- {
- if (ioctl(fd, VT_ENABLED, &vtEnabled) < 0)
- {
- xf86ErrorF("xf86OpenConsole: VT_ENABLED failed (%s)\n",
- strerror(errno));
- vtEnabled = 0;
- }
- }
-#endif /* HAS_USL_VTS */
-
- if (UseConsole)
- {
- strlcpy(consoleDev, SOL_CONSOLE_DEV, sizeof(consoleDev));
-
-#ifdef HAS_USL_VTS
- xf86Info.vtno = CONSOLE_VTNO;
-
- if (vtEnabled == 0)
- {
- xf86StartVT = 0;
- }
- else
- {
- if (ioctl(fd, VT_GETSTATE, &vtinfo) < 0)
- FatalError("xf86OpenConsole: Cannot determine current VT\n");
- xf86StartVT = vtinfo.v_active;
- }
-#endif /* HAS_USL_VTS */
- goto OPENCONSOLE;
- }
-
-#ifdef HAS_USL_VTS
- if (vtEnabled == 0)
- {
- /* VT not enabled - kernel too old or Sparc platforms
- without visual_io support */
- xf86Msg(from, "VT infrastructure is not available\n");
-
- xf86StartVT = 0;
- xf86Info.vtno = 0;
- strlcpy(consoleDev, xf86SolarisFbDev, sizeof(consoleDev));
- goto OPENCONSOLE;
- }
-
- if (ioctl(fd, VT_GETSTATE, &vtinfo) < 0)
- FatalError("xf86OpenConsole: Cannot determine current VT\n");
-
- xf86StartVT = vtinfo.v_active;
-
- if (VTnum != -1)
- {
- xf86Info.vtno = VTnum;
- from = X_CMDLINE;
- }
- else
- {
- if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
- (xf86Info.vtno == -1))
- {
- FatalError("xf86OpenConsole: Cannot find a free VT\n");
- }
- }
-
- xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
- snprintf(consoleDev, PATH_MAX, "/dev/vt/%d", xf86Info.vtno);
-
- if (fd != -1)
- {
- close(fd);
- }
-
-#endif /* HAS_USL_VTS */
-
-OPENCONSOLE:
- if (!KeepTty)
- setpgrp();
-
- if (((xf86Info.consoleFd = open(consoleDev, O_RDWR | O_NDELAY, 0)) < 0))
- FatalError("xf86OpenConsole: Cannot open %s (%s)\n",
- consoleDev, strerror(errno));
-
- /* Change ownership of the vt or console */
- chown(consoleDev, getuid(), getgid());
-
-#ifdef HAS_USL_VTS
- if (vtEnabled)
- {
- /*
- * Now get the VT
- */
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
-
- if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
-
-#ifdef VT_SET_CONSUSER /* added in snv_139 */
- if (strcmp(display, "0") == 0)
- if (ioctl(xf86Info.consoleFd, VT_SET_CONSUSER) != 0)
- xf86Msg(X_WARNING,
- "xf86OpenConsole: VT_SET_CONSUSER failed\n");
-#endif
-
- if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
- FatalError("xf86OpenConsole: VT_GETMODE failed\n");
-
- OsSignal(SIGUSR1, xf86VTAcquire);
- OsSignal(SIGUSR2, xf86VTRelease);
-
- VT.mode = VT_PROCESS;
- VT.acqsig = SIGUSR1;
- VT.relsig = SIGUSR2;
-
- if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
- FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
-
- if (ioctl(xf86Info.consoleFd, VT_SETDISPINFO, atoi(display)) < 0)
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_SETDISPINFO failed\n");
- }
-#endif
-
-#ifdef KDSETMODE
- SYSCALL(i = ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS));
- if (i < 0) {
- xf86Msg(X_WARNING,
- "xf86OpenConsole: KDSETMODE KD_GRAPHICS failed on %s (%s)\n",
- consoleDev, strerror(errno));
- }
-#endif
- }
- else /* serverGeneration != 1 */
- {
-#ifdef HAS_USL_VTS
- if (vtEnabled)
- {
- /*
- * Now re-get the VT
- */
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) != 0)
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n");
-
- if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) != 0)
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed\n");
-
-#ifdef VT_SET_CONSUSER /* added in snv_139 */
- if (strcmp(display, "0") == 0)
- if (ioctl(xf86Info.consoleFd, VT_SET_CONSUSER) != 0)
- xf86Msg(X_WARNING,
- "xf86OpenConsole: VT_SET_CONSUSER failed\n");
-#endif
-
- /*
- * If the server doesn't have the VT when the reset occurs,
- * this is to make sure we don't continue until the activate
- * signal is received.
- */
- if (!xf86Screens[0]->vtSema)
- sleep(5);
- }
-#endif /* HAS_USL_VTS */
-
- }
-}
-
-void
-xf86CloseConsole(void)
-{
-#ifdef HAS_USL_VTS
- struct vt_mode VT;
-#endif
-
-#if !defined(__i386__) && !defined(__i386) && !defined(__x86)
-
- if (!xf86DoConfigure) {
- int fd;
-
- /*
- * Wipe out framebuffer just like the non-SI Xsun server does. This
- * could be improved by saving framebuffer contents in
- * xf86OpenConsole() above and restoring them here. Also, it's unclear
- * at this point whether this should be done for all framebuffers in
- * the system, rather than only the console.
- */
- if ((fd = open(xf86SolarisFbDev, O_RDWR, 0)) < 0) {
- xf86Msg(X_WARNING,
- "xf86CloseConsole(): unable to open framebuffer (%s)\n",
- strerror(errno));
- } else {
- struct fbgattr fbattr;
-
- if ((ioctl(fd, FBIOGATTR, &fbattr) < 0) &&
- (ioctl(fd, FBIOGTYPE, &fbattr.fbtype) < 0)) {
- xf86Msg(X_WARNING,
- "xf86CloseConsole(): unable to retrieve framebuffer"
- " attributes (%s)\n", strerror(errno));
- } else {
- pointer fbdata;
-
- fbdata = mmap(NULL, fbattr.fbtype.fb_size,
- PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
- if (fbdata == MAP_FAILED) {
- xf86Msg(X_WARNING,
- "xf86CloseConsole(): unable to mmap framebuffer"
- " (%s)\n", strerror(errno));
- } else {
- memset(fbdata, 0, fbattr.fbtype.fb_size);
- munmap(fbdata, fbattr.fbtype.fb_size);
- }
- }
-
- close(fd);
- }
- }
-
-#endif
-
-#ifdef KDSETMODE
- /* Reset the display back to text mode */
- SYSCALL(ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT));
-#endif
-
-#ifdef HAS_USL_VTS
- if (vtEnabled)
- {
- if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1)
- {
- VT.mode = VT_AUTO; /* Set default vt handling */
- ioctl(xf86Info.consoleFd, VT_SETMODE, &VT);
- }
-
- /* Activate the VT that X was started on */
- ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86StartVT);
- }
-#endif /* HAS_USL_VTS */
-
- close(xf86Info.consoleFd);
-}
-
-int
-xf86ProcessArgument(int argc, char **argv, int i)
-{
- /*
- * Keep server from detaching from controlling tty. This is useful when
- * debugging, so the server can receive keyboard signals.
- */
- if (!strcmp(argv[i], "-keeptty"))
- {
- KeepTty = TRUE;
- return 1;
- }
-
- /*
- * Undocumented flag to protect page 0 from read/write to help catch NULL
- * pointer dereferences. This is purely a debugging flag.
- */
- if (!strcmp(argv[i], "-protect0"))
- {
- Protect0 = TRUE;
- return 1;
- }
-
- /*
- * Use /dev/console as the console device.
- */
- if (!strcmp(argv[i], "-C"))
- {
- UseConsole = TRUE;
- return 1;
- }
-
-#ifdef HAS_USL_VTS
-
- if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
- {
- if (sscanf(argv[i], "vt%d", &VTnum) == 0)
- {
- UseMsg();
- VTnum = -1;
- return 0;
- }
-
- return 1;
- }
-
-#endif /* HAS_USL_VTS */
-
- if ((i + 1) < argc) {
- if (!strcmp(argv[i], "-dev")) {
- strlcpy(xf86SolarisFbDev, argv[i+1], sizeof(xf86SolarisFbDev));
- return 2;
- }
- }
-
- return 0;
-}
-
-void xf86UseMsg(void)
-{
-#ifdef HAS_USL_VTS
- ErrorF("vtX Use the specified VT number\n");
-#endif
- ErrorF("-dev <fb> Framebuffer device\n");
- ErrorF("-keeptty Don't detach controlling tty\n");
- ErrorF(" (for debugging only)\n");
- ErrorF("-C Use /dev/console as the console device\n");
-}
+/*
+ * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ * Copyright 1999 by David Holland <davidh@iquest.net>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the names of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, AND IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#ifdef HAVE_SYS_KD_H
+# include <sys/kd.h>
+#endif
+
+/*
+ * Applications see VT number as consecutive integers starting from 1.
+ * VT number VT device
+ * -------------------------------------------------------
+ * 1 : /dev/vt/0 (Alt + Ctrl + F1)
+ * 2 : /dev/vt/2 (Alt + Ctrl + F2)
+ * 3 : /dev/vt/3 (Alt + Ctrl + F3)
+ * ... ...
+ */
+#define CONSOLE_VTNO 1
+#define SOL_CONSOLE_DEV "/dev/console"
+
+static Bool KeepTty = FALSE;
+static Bool Protect0 = FALSE;
+static Bool UseConsole = FALSE;
+#ifdef HAS_USL_VTS
+static int VTnum = -1;
+static int xf86StartVT = -1;
+static int vtEnabled = 0;
+extern void xf86VTAcquire(int);
+extern void xf86VTRelease(int);
+#endif
+
+/* Device to open as xf86Info.consoleFd */
+static char consoleDev[PATH_MAX] = "/dev/fb";
+
+/* Set by -dev argument on CLI
+ Used by hw/xfree86/common/xf86AutoConfig.c for VIS_GETIDENTIFIER */
+_X_HIDDEN char xf86SolarisFbDev[PATH_MAX] = "/dev/fb";
+
+static void
+switch_to(int vt, const char *from)
+{
+ int ret;
+
+ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, vt));
+ if (ret != 0)
+ xf86Msg(X_WARNING, "%s: VT_ACTIVATE failed: %s\n",
+ from, strerror(errno));
+
+ SYSCALL(ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, vt));
+ if (ret != 0)
+ xf86Msg(X_WARNING, "%s: VT_WAITACTIVE failed: %s\n",
+ from, strerror(errno));
+}
+
+void
+xf86OpenConsole(void)
+{
+ int i;
+#ifdef HAS_USL_VTS
+ int fd;
+ struct vt_mode VT;
+ struct vt_stat vtinfo;
+ MessageType from = X_PROBED;
+#endif
+
+ if (serverGeneration == 1)
+ {
+ /* Check if we're run with euid==0 */
+ if (geteuid() != 0)
+ FatalError("xf86OpenConsole: Server must be suid root\n");
+
+ /* Protect page 0 to help find NULL dereferencing */
+ /* mprotect() doesn't seem to work */
+ if (Protect0)
+ {
+ int fd = -1;
+
+ if ((fd = open("/dev/zero", O_RDONLY, 0)) < 0)
+ {
+ xf86Msg(X_WARNING,
+ "xf86OpenConsole: cannot open /dev/zero (%s)\n",
+ strerror(errno));
+ }
+ else
+ {
+ if (mmap(0, 0x1000, PROT_NONE,
+ MAP_FIXED | MAP_SHARED, fd, 0) == MAP_FAILED)
+ xf86Msg(X_WARNING,
+ "xf86OpenConsole: failed to protect page 0 (%s)\n",
+ strerror(errno));
+
+ close(fd);
+ }
+ }
+
+#ifdef HAS_USL_VTS
+
+ /*
+ * Setup the virtual terminal manager
+ */
+ if ((fd = open("/dev/vt/0",O_RDWR,0)) == -1)
+ {
+ xf86ErrorF("xf86OpenConsole: Cannot open /dev/vt/0 (%s)\n",
+ strerror(errno));
+ vtEnabled = 0;
+ }
+ else
+ {
+ if (ioctl(fd, VT_ENABLED, &vtEnabled) < 0)
+ {
+ xf86ErrorF("xf86OpenConsole: VT_ENABLED failed (%s)\n",
+ strerror(errno));
+ vtEnabled = 0;
+ }
+ }
+#endif /* HAS_USL_VTS */
+
+ if (UseConsole)
+ {
+ strlcpy(consoleDev, SOL_CONSOLE_DEV, sizeof(consoleDev));
+
+#ifdef HAS_USL_VTS
+ xf86Info.vtno = CONSOLE_VTNO;
+
+ if (vtEnabled == 0)
+ {
+ xf86StartVT = 0;
+ }
+ else
+ {
+ if (ioctl(fd, VT_GETSTATE, &vtinfo) < 0)
+ FatalError("xf86OpenConsole: Cannot determine current VT\n");
+ xf86StartVT = vtinfo.v_active;
+ }
+#endif /* HAS_USL_VTS */
+ goto OPENCONSOLE;
+ }
+
+#ifdef HAS_USL_VTS
+ if (vtEnabled == 0)
+ {
+ /* VT not enabled - kernel too old or Sparc platforms
+ without visual_io support */
+ xf86Msg(from, "VT infrastructure is not available\n");
+
+ xf86StartVT = 0;
+ xf86Info.vtno = 0;
+ strlcpy(consoleDev, xf86SolarisFbDev, sizeof(consoleDev));
+ goto OPENCONSOLE;
+ }
+
+ if (ioctl(fd, VT_GETSTATE, &vtinfo) < 0)
+ FatalError("xf86OpenConsole: Cannot determine current VT\n");
+
+ xf86StartVT = vtinfo.v_active;
+
+ if (VTnum != -1)
+ {
+ xf86Info.vtno = VTnum;
+ from = X_CMDLINE;
+ }
+ else if (xf86Info.ShareVTs)
+ {
+ xf86Info.vtno = vtinfo.v_active;
+ from = X_CMDLINE;
+ }
+ else
+ {
+ if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
+ (xf86Info.vtno == -1))
+ {
+ FatalError("xf86OpenConsole: Cannot find a free VT\n");
+ }
+ }
+
+ xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno);
+ snprintf(consoleDev, PATH_MAX, "/dev/vt/%d", xf86Info.vtno);
+
+ if (fd != -1)
+ {
+ close(fd);
+ }
+
+#endif /* HAS_USL_VTS */
+
+OPENCONSOLE:
+ if (!KeepTty)
+ setpgrp();
+
+ if (((xf86Info.consoleFd = open(consoleDev, O_RDWR | O_NDELAY, 0)) < 0))
+ FatalError("xf86OpenConsole: Cannot open %s (%s)\n",
+ consoleDev, strerror(errno));
+
+ /* Change ownership of the vt or console */
+ chown(consoleDev, getuid(), getgid());
+
+#ifdef HAS_USL_VTS
+ if (xf86Info.ShareVTs)
+ return;
+
+ if (vtEnabled)
+ {
+ /*
+ * Now get the VT
+ */
+ switch_to(xf86Info.vtno, "xf86OpenConsole");
+
+#ifdef VT_SET_CONSUSER /* added in snv_139 */
+ if (strcmp(display, "0") == 0)
+ if (ioctl(xf86Info.consoleFd, VT_SET_CONSUSER) != 0)
+ xf86Msg(X_WARNING,
+ "xf86OpenConsole: VT_SET_CONSUSER failed\n");
+#endif
+
+ if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
+ FatalError("xf86OpenConsole: VT_GETMODE failed\n");
+
+ OsSignal(SIGUSR1, xf86VTAcquire);
+ OsSignal(SIGUSR2, xf86VTRelease);
+
+ VT.mode = VT_PROCESS;
+ VT.acqsig = SIGUSR1;
+ VT.relsig = SIGUSR2;
+
+ if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
+ FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
+
+ if (ioctl(xf86Info.consoleFd, VT_SETDISPINFO, atoi(display)) < 0)
+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_SETDISPINFO failed\n");
+ }
+#endif
+
+#ifdef KDSETMODE
+ SYSCALL(i = ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS));
+ if (i < 0) {
+ xf86Msg(X_WARNING,
+ "xf86OpenConsole: KDSETMODE KD_GRAPHICS failed on %s (%s)\n",
+ consoleDev, strerror(errno));
+ }
+#endif
+ }
+ else /* serverGeneration != 1 */
+ {
+#ifdef HAS_USL_VTS
+ if (vtEnabled && !xf86Info.ShareVTs)
+ {
+ /*
+ * Now re-get the VT
+ */
+ if (xf86Info.autoVTSwitch)
+ switch_to(xf86Info.vtno, "xf86OpenConsole");
+
+#ifdef VT_SET_CONSUSER /* added in snv_139 */
+ if (strcmp(display, "0") == 0)
+ if (ioctl(xf86Info.consoleFd, VT_SET_CONSUSER) != 0)
+ xf86Msg(X_WARNING,
+ "xf86OpenConsole: VT_SET_CONSUSER failed\n");
+#endif
+
+ /*
+ * If the server doesn't have the VT when the reset occurs,
+ * this is to make sure we don't continue until the activate
+ * signal is received.
+ */
+ if (!xf86Screens[0]->vtSema)
+ sleep(5);
+ }
+#endif /* HAS_USL_VTS */
+
+ }
+}
+
+void
+xf86CloseConsole(void)
+{
+#ifdef HAS_USL_VTS
+ struct vt_mode VT;
+#endif
+
+#if !defined(__i386__) && !defined(__i386) && !defined(__x86)
+
+ if (!xf86DoConfigure) {
+ int fd;
+
+ /*
+ * Wipe out framebuffer just like the non-SI Xsun server does. This
+ * could be improved by saving framebuffer contents in
+ * xf86OpenConsole() above and restoring them here. Also, it's unclear
+ * at this point whether this should be done for all framebuffers in
+ * the system, rather than only the console.
+ */
+ if ((fd = open(xf86SolarisFbDev, O_RDWR, 0)) < 0) {
+ xf86Msg(X_WARNING,
+ "xf86CloseConsole(): unable to open framebuffer (%s)\n",
+ strerror(errno));
+ } else {
+ struct fbgattr fbattr;
+
+ if ((ioctl(fd, FBIOGATTR, &fbattr) < 0) &&
+ (ioctl(fd, FBIOGTYPE, &fbattr.fbtype) < 0)) {
+ xf86Msg(X_WARNING,
+ "xf86CloseConsole(): unable to retrieve framebuffer"
+ " attributes (%s)\n", strerror(errno));
+ } else {
+ pointer fbdata;
+
+ fbdata = mmap(NULL, fbattr.fbtype.fb_size,
+ PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+ if (fbdata == MAP_FAILED) {
+ xf86Msg(X_WARNING,
+ "xf86CloseConsole(): unable to mmap framebuffer"
+ " (%s)\n", strerror(errno));
+ } else {
+ memset(fbdata, 0, fbattr.fbtype.fb_size);
+ munmap(fbdata, fbattr.fbtype.fb_size);
+ }
+ }
+
+ close(fd);
+ }
+ }
+
+#endif
+
+#ifdef KDSETMODE
+ /* Reset the display back to text mode */
+ SYSCALL(ioctl(xf86Info.consoleFd, KDSETMODE, KD_TEXT));
+#endif
+
+#ifdef HAS_USL_VTS
+ if (vtEnabled)
+ {
+ if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1)
+ {
+ VT.mode = VT_AUTO; /* Set default vt handling */
+ ioctl(xf86Info.consoleFd, VT_SETMODE, &VT);
+ }
+
+ /* Activate the VT that X was started on */
+ if (xf86Info.autoVTSwitch)
+ switch_to(xf86StartVT, "xf86CloseConsole");
+ }
+#endif /* HAS_USL_VTS */
+
+ close(xf86Info.consoleFd);
+}
+
+int
+xf86ProcessArgument(int argc, char **argv, int i)
+{
+ /*
+ * Keep server from detaching from controlling tty. This is useful when
+ * debugging, so the server can receive keyboard signals.
+ */
+ if (!strcmp(argv[i], "-keeptty"))
+ {
+ KeepTty = TRUE;
+ return 1;
+ }
+
+ /*
+ * Undocumented flag to protect page 0 from read/write to help catch NULL
+ * pointer dereferences. This is purely a debugging flag.
+ */
+ if (!strcmp(argv[i], "-protect0"))
+ {
+ Protect0 = TRUE;
+ return 1;
+ }
+
+ /*
+ * Use /dev/console as the console device.
+ */
+ if (!strcmp(argv[i], "-C"))
+ {
+ UseConsole = TRUE;
+ return 1;
+ }
+
+#ifdef HAS_USL_VTS
+
+ if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
+ {
+ if (sscanf(argv[i], "vt%d", &VTnum) == 0)
+ {
+ UseMsg();
+ VTnum = -1;
+ return 0;
+ }
+
+ return 1;
+ }
+
+#endif /* HAS_USL_VTS */
+
+ if ((i + 1) < argc) {
+ if (!strcmp(argv[i], "-dev")) {
+ strlcpy(xf86SolarisFbDev, argv[i+1], sizeof(xf86SolarisFbDev));
+ return 2;
+ }
+ }
+
+ return 0;
+}
+
+void xf86UseMsg(void)
+{
+#ifdef HAS_USL_VTS
+ ErrorF("vtX Use the specified VT number\n");
+#endif
+ ErrorF("-dev <fb> Framebuffer device\n");
+ ErrorF("-keeptty Don't detach controlling tty\n");
+ ErrorF(" (for debugging only)\n");
+ ErrorF("-C Use /dev/console as the console device\n");
+}
diff --git a/xorg-server/hw/xfree86/ramdac/xf86Cursor.c b/xorg-server/hw/xfree86/ramdac/xf86Cursor.c
index 24c91cc37..1e0f7e0b7 100644
--- a/xorg-server/hw/xfree86/ramdac/xf86Cursor.c
+++ b/xorg-server/hw/xfree86/ramdac/xf86Cursor.c
@@ -273,7 +273,7 @@ xf86CursorRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs)
&pScreen->devPrivates, xf86CursorScreenKey);
if (pCurs->refcnt <= 1)
- dixSetPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen), NULL);
+ dixSetScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen, NULL);
return (*ScreenPriv->spriteFuncs->RealizeCursor)(pDev, pScreen, pCurs);
}
@@ -286,8 +286,8 @@ xf86CursorUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
&pScreen->devPrivates, xf86CursorScreenKey);
if (pCurs->refcnt <= 1) {
- free(dixLookupPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen)));
- dixSetPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen), NULL);
+ free(dixLookupScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen));
+ dixSetScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen, NULL);
}
return (*ScreenPriv->spriteFuncs->UnrealizeCursor)(pDev, pScreen, pCurs);
diff --git a/xorg-server/hw/xfree86/ramdac/xf86HWCurs.c b/xorg-server/hw/xfree86/ramdac/xf86HWCurs.c
index 43f28ef8e..f9b09fc9a 100644
--- a/xorg-server/hw/xfree86/ramdac/xf86HWCurs.c
+++ b/xorg-server/hw/xfree86/ramdac/xf86HWCurs.c
@@ -1,527 +1,527 @@
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <string.h>
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-
-#include <X11/X.h>
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "xf86str.h"
-#include "cursorstr.h"
-#include "mi.h"
-#include "mipointer.h"
-#include "xf86CursorPriv.h"
-
-#include "servermd.h"
-
-#if BITMAP_SCANLINE_PAD == 64
-
-#if 1
-/* Cursors might be only 32 wide. Give'em a chance */
-#define SCANLINE CARD32
-#define CUR_BITMAP_SCANLINE_PAD 32
-#define CUR_LOG2_BITMAP_PAD 5
-#define REVERSE_BIT_ORDER(w) xf86ReverseBitOrder(w)
-#else
-#define SCANLINE CARD64
-#define CUR_BITMAP_SCANLINE_PAD BITMAP_SCANLINE_PAD
-#define CUR_LOG2_BITMAP_PAD LOG2_BITMAP_PAD
-#define REVERSE_BIT_ORDER(w) xf86CARD64ReverseBits(w)
-static CARD64 xf86CARD64ReverseBits(CARD64 w);
-
-static CARD64
-xf86CARD64ReverseBits(CARD64 w)
-{
- unsigned char *p = (unsigned char *)&w;
-
- p[0] = byte_reversed[p[0]];
- p[1] = byte_reversed[p[1]];
- p[2] = byte_reversed[p[2]];
- p[3] = byte_reversed[p[3]];
- p[4] = byte_reversed[p[4]];
- p[5] = byte_reversed[p[5]];
- p[6] = byte_reversed[p[6]];
- p[7] = byte_reversed[p[7]];
-
- return w;
-}
-#endif
-
-#else
-
-#define SCANLINE CARD32
-#define CUR_BITMAP_SCANLINE_PAD BITMAP_SCANLINE_PAD
-#define CUR_LOG2_BITMAP_PAD LOG2_BITMAP_PAD
-#define REVERSE_BIT_ORDER(w) xf86ReverseBitOrder(w)
-
-#endif /* BITMAP_SCANLINE_PAD == 64 */
-
-static unsigned char* RealizeCursorInterleave0(xf86CursorInfoPtr, CursorPtr);
-static unsigned char* RealizeCursorInterleave1(xf86CursorInfoPtr, CursorPtr);
-static unsigned char* RealizeCursorInterleave8(xf86CursorInfoPtr, CursorPtr);
-static unsigned char* RealizeCursorInterleave16(xf86CursorInfoPtr, CursorPtr);
-static unsigned char* RealizeCursorInterleave32(xf86CursorInfoPtr, CursorPtr);
-static unsigned char* RealizeCursorInterleave64(xf86CursorInfoPtr, CursorPtr);
-
-Bool
-xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr)
-{
- if ((infoPtr->MaxWidth <= 0) || (infoPtr->MaxHeight <= 0))
- return FALSE;
-
- /* These are required for now */
- if (!infoPtr->SetCursorPosition ||
- !infoPtr->LoadCursorImage ||
- !infoPtr->HideCursor ||
- !infoPtr->ShowCursor ||
- !infoPtr->SetCursorColors)
- return FALSE;
-
- if (infoPtr->RealizeCursor) {
- /* Don't overwrite a driver provided Realize Cursor function */
- } else
- if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 & infoPtr->Flags) {
- infoPtr->RealizeCursor = RealizeCursorInterleave1;
- } else
- if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8 & infoPtr->Flags) {
- infoPtr->RealizeCursor = RealizeCursorInterleave8;
- } else
- if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16 & infoPtr->Flags) {
- infoPtr->RealizeCursor = RealizeCursorInterleave16;
- } else
- if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 & infoPtr->Flags) {
- infoPtr->RealizeCursor = RealizeCursorInterleave32;
- } else
- if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 & infoPtr->Flags) {
- infoPtr->RealizeCursor = RealizeCursorInterleave64;
- } else { /* not interleaved */
- infoPtr->RealizeCursor = RealizeCursorInterleave0;
- }
-
- infoPtr->pScrn = xf86Screens[pScreen->myNum];
-
- return TRUE;
-}
-
-void
-xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
-{
- xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
- &pScreen->devPrivates, xf86CursorScreenKey);
- xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
- unsigned char *bits;
-
- if (pCurs == NullCursor) {
- (*infoPtr->HideCursor)(infoPtr->pScrn);
- return;
- }
-
- bits = dixLookupPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen));
-
- x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX;
- y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
-
-#ifdef ARGB_CURSOR
- if (!pCurs->bits->argb || !infoPtr->LoadCursorARGB)
-#endif
- if (!bits) {
- bits = (*infoPtr->RealizeCursor)(infoPtr, pCurs);
- dixSetPrivate(&pCurs->devPrivates, CursorScreenKey(pScreen), bits);
- }
-
- if (!(infoPtr->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
- (*infoPtr->HideCursor)(infoPtr->pScrn);
-
-#ifdef ARGB_CURSOR
- if (pCurs->bits->argb && infoPtr->LoadCursorARGB)
- (*infoPtr->LoadCursorARGB) (infoPtr->pScrn, pCurs);
- else
-#endif
- if (bits)
- (*infoPtr->LoadCursorImage)(infoPtr->pScrn, bits);
-
- xf86RecolorCursor(pScreen, pCurs, 1);
-
- (*infoPtr->SetCursorPosition)(infoPtr->pScrn, x, y);
-
- (*infoPtr->ShowCursor)(infoPtr->pScrn);
-}
-
-void
-xf86SetTransparentCursor(ScreenPtr pScreen)
-{
- xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
- &pScreen->devPrivates, xf86CursorScreenKey);
- xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
-
- if (!ScreenPriv->transparentData)
- ScreenPriv->transparentData =
- (*infoPtr->RealizeCursor)(infoPtr, NullCursor);
-
- if (!(infoPtr->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
- (*infoPtr->HideCursor)(infoPtr->pScrn);
-
- if (ScreenPriv->transparentData)
- (*infoPtr->LoadCursorImage)(infoPtr->pScrn,
- ScreenPriv->transparentData);
-
- (*infoPtr->ShowCursor)(infoPtr->pScrn);
-}
-
-void
-xf86MoveCursor(ScreenPtr pScreen, int x, int y)
-{
- xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
- &pScreen->devPrivates, xf86CursorScreenKey);
- xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
-
- x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX;
- y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
-
- (*infoPtr->SetCursorPosition)(infoPtr->pScrn, x, y);
-}
-
-void
-xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed)
-{
- xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
- &pScreen->devPrivates, xf86CursorScreenKey);
- xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
-
-#ifdef ARGB_CURSOR
- /* recoloring isn't applicable to ARGB cursors and drivers
- shouldn't have to ignore SetCursorColors requests */
- if (pCurs->bits->argb)
- return;
-#endif
-
- if (ScreenPriv->PalettedCursor) {
- xColorItem sourceColor, maskColor;
- ColormapPtr pmap = ScreenPriv->pInstalledMap;
-
- if (!pmap)
- return;
-
- sourceColor.red = pCurs->foreRed;
- sourceColor.green = pCurs->foreGreen;
- sourceColor.blue = pCurs->foreBlue;
- FakeAllocColor(pmap, &sourceColor);
- maskColor.red = pCurs->backRed;
- maskColor.green = pCurs->backGreen;
- maskColor.blue = pCurs->backBlue;
- FakeAllocColor(pmap, &maskColor);
- FakeFreeColor(pmap, sourceColor.pixel);
- FakeFreeColor(pmap, maskColor.pixel);
- (*infoPtr->SetCursorColors)(infoPtr->pScrn,
- maskColor.pixel, sourceColor.pixel);
- } else { /* Pass colors in 8-8-8 RGB format */
- (*infoPtr->SetCursorColors)(infoPtr->pScrn,
- (pCurs->backBlue >> 8) |
- ((pCurs->backGreen >> 8) << 8) |
- ((pCurs->backRed >> 8) << 16),
- (pCurs->foreBlue >> 8) |
- ((pCurs->foreGreen >> 8) << 8) |
- ((pCurs->foreRed >> 8) << 16)
- );
- }
-}
-
-/* These functions assume that MaxWidth is a multiple of 32 */
-static unsigned char*
-RealizeCursorInterleave0(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
-{
-
- SCANLINE *SrcS, *SrcM, *DstS, *DstM;
- SCANLINE *pSrc, *pMsk;
- unsigned char *mem;
- int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
- int SrcPitch, DstPitch, Pitch, y, x;
- /* how many words are in the source or mask */
- int words = size / (CUR_BITMAP_SCANLINE_PAD / 4);
-
-
- if (!(mem = calloc(1, size)))
- return NULL;
-
- if (pCurs == NullCursor) {
- if (infoPtr->Flags & HARDWARE_CURSOR_INVERT_MASK) {
- DstM = (SCANLINE*)mem;
- if (!(infoPtr->Flags & HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK))
- DstM += words;
- memset(DstM, -1, words * sizeof(SCANLINE));
- }
- return mem;
- }
-
- /* SrcPitch == the number of scanlines wide the cursor image is */
- SrcPitch = (pCurs->bits->width + (BITMAP_SCANLINE_PAD - 1)) >>
- CUR_LOG2_BITMAP_PAD;
-
- /* DstPitch is the width of the hw cursor in scanlines */
- DstPitch = infoPtr->MaxWidth >> CUR_LOG2_BITMAP_PAD;
- Pitch = SrcPitch < DstPitch ? SrcPitch : DstPitch;
-
- SrcS = (SCANLINE*)pCurs->bits->source;
- SrcM = (SCANLINE*)pCurs->bits->mask;
- DstS = (SCANLINE*)mem;
- DstM = DstS + words;
-
- if (infoPtr->Flags & HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK) {
- SCANLINE *tmp;
- tmp = DstS; DstS = DstM; DstM = tmp;
- }
-
- if (infoPtr->Flags & HARDWARE_CURSOR_AND_SOURCE_WITH_MASK) {
- for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM;
- y--;
- pSrc+=DstPitch, pMsk+=DstPitch, SrcS+=SrcPitch, SrcM+=SrcPitch) {
- for(x = 0; x < Pitch; x++) {
- pSrc[x] = SrcS[x] & SrcM[x];
- pMsk[x] = SrcM[x];
- }
- }
- } else {
- for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM;
- y--;
- pSrc+=DstPitch, pMsk+=DstPitch, SrcS+=SrcPitch, SrcM+=SrcPitch) {
- for(x = 0; x < Pitch; x++) {
- pSrc[x] = SrcS[x];
- pMsk[x] = SrcM[x];
- }
- }
- }
-
- if (infoPtr->Flags & HARDWARE_CURSOR_NIBBLE_SWAPPED) {
- int count = size;
- unsigned char* pntr1 = (unsigned char *)DstS;
- unsigned char* pntr2 = (unsigned char *)DstM;
- unsigned char a, b;
- while (count) {
-
- a = *pntr1;
- b = *pntr2;
- *pntr1 = ((a & 0xF0) >> 4) | ((a & 0x0F) << 4);
- *pntr2 = ((b & 0xF0) >> 4) | ((b & 0x0F) << 4);
- pntr1++; pntr2++;
- count-=2;
- }
- }
-
- /*
- * Must be _after_ HARDWARE_CURSOR_AND_SOURCE_WITH_MASK to avoid wiping
- * out entire source mask.
- */
- if (infoPtr->Flags & HARDWARE_CURSOR_INVERT_MASK) {
- int count = words;
- SCANLINE* pntr = DstM;
- while (count--) {
- *pntr = ~(*pntr);
- pntr++;
- }
- }
-
- if (infoPtr->Flags & HARDWARE_CURSOR_BIT_ORDER_MSBFIRST) {
- for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM;
- y--;
- pSrc+=DstPitch, pMsk+=DstPitch) {
- for(x = 0; x < Pitch; x++) {
- pSrc[x] = REVERSE_BIT_ORDER(pSrc[x]);
- pMsk[x] = REVERSE_BIT_ORDER(pMsk[x]);
- }
- }
- }
-
- return mem;
-}
-
-static unsigned char*
-RealizeCursorInterleave1(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
-{
- unsigned char *DstS, *DstM;
- unsigned char *pntr;
- unsigned char *mem, *mem2;
- int count;
- int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
-
- /* Realize the cursor without interleaving */
- if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
- return NULL;
-
- if (!(mem = calloc(1, size))) {
- free(mem2);
- return NULL;
- }
-
- /* 1 bit interleave */
- DstS = mem2;
- DstM = DstS + (size >> 1);
- pntr = mem;
- count = size;
- while (count) {
- *pntr++ = ((*DstS&0x01) ) | ((*DstM&0x01) << 1) |
- ((*DstS&0x02) << 1) | ((*DstM&0x02) << 2) |
- ((*DstS&0x04) << 2) | ((*DstM&0x04) << 3) |
- ((*DstS&0x08) << 3) | ((*DstM&0x08) << 4);
- *pntr++ = ((*DstS&0x10) >> 4) | ((*DstM&0x10) >> 3) |
- ((*DstS&0x20) >> 3) | ((*DstM&0x20) >> 2) |
- ((*DstS&0x40) >> 2) | ((*DstM&0x40) >> 1) |
- ((*DstS&0x80) >> 1) | ((*DstM&0x80) );
- DstS++;
- DstM++;
- count-=2;
- }
-
- /* Free the uninterleaved cursor */
- free(mem2);
-
- return mem;
-}
-
-static unsigned char*
-RealizeCursorInterleave8(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
-{
- unsigned char *DstS, *DstM;
- unsigned char *pntr;
- unsigned char *mem, *mem2;
- int count;
- int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
-
- /* Realize the cursor without interleaving */
- if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
- return NULL;
-
- if (!(mem = calloc(1, size))) {
- free(mem2);
- return NULL;
- }
-
- /* 8 bit interleave */
- DstS = mem2;
- DstM = DstS + (size >> 1);
- pntr = mem;
- count = size;
- while (count) {
- *pntr++ = *DstS++;
- *pntr++ = *DstM++;
- count-=2;
- }
-
- /* Free the uninterleaved cursor */
- free(mem2);
-
- return mem;
-}
-
-static unsigned char*
-RealizeCursorInterleave16(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
-{
- unsigned short *DstS, *DstM;
- unsigned short *pntr;
- unsigned char *mem, *mem2;
- int count;
- int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
-
- /* Realize the cursor without interleaving */
- if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
- return NULL;
-
- if (!(mem = calloc(1, size))) {
- free(mem2);
- return NULL;
- }
-
- /* 16 bit interleave */
- DstS = (pointer)mem2;
- DstM = DstS + (size >> 2);
- pntr = (pointer)mem;
- count = (size >> 1);
- while (count) {
- *pntr++ = *DstS++;
- *pntr++ = *DstM++;
- count-=2;
- }
-
- /* Free the uninterleaved cursor */
- free(mem2);
-
- return mem;
-}
-
-static unsigned char*
-RealizeCursorInterleave32(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
-{
- CARD32 *DstS, *DstM;
- CARD32 *pntr;
- unsigned char *mem, *mem2;
- int count;
- int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
-
- /* Realize the cursor without interleaving */
- if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
- return NULL;
-
- if (!(mem = calloc(1, size))) {
- free(mem2);
- return NULL;
- }
-
- /* 32 bit interleave */
- DstS = (pointer)mem2;
- DstM = DstS + (size >> 3);
- pntr = (pointer)mem;
- count = (size >> 2);
- while (count) {
- *pntr++ = *DstS++;
- *pntr++ = *DstM++;
- count-=2;
- }
-
- /* Free the uninterleaved cursor */
- free(mem2);
-
- return mem;
-}
-
-static unsigned char*
-RealizeCursorInterleave64(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
-{
- CARD32 *DstS, *DstM;
- CARD32 *pntr;
- unsigned char *mem, *mem2;
- int count;
- int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
-
- /* Realize the cursor without interleaving */
- if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
- return NULL;
-
- if (!(mem = calloc(1, size))) {
- free(mem2);
- return NULL;
- }
-
- /* 64 bit interleave */
- DstS = (pointer)mem2;
- DstM = DstS + (size >> 3);
- pntr = (pointer)mem;
- count = (size >> 2);
- while (count) {
- *pntr++ = *DstS++;
- *pntr++ = *DstS++;
- *pntr++ = *DstM++;
- *pntr++ = *DstM++;
- count-=4;
- }
-
- /* Free the uninterleaved cursor */
- free(mem2);
-
- return mem;
-}
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <string.h>
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_OSproc.h"
+
+#include <X11/X.h>
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "windowstr.h"
+#include "xf86str.h"
+#include "cursorstr.h"
+#include "mi.h"
+#include "mipointer.h"
+#include "xf86CursorPriv.h"
+
+#include "servermd.h"
+
+#if BITMAP_SCANLINE_PAD == 64
+
+#if 1
+/* Cursors might be only 32 wide. Give'em a chance */
+#define SCANLINE CARD32
+#define CUR_BITMAP_SCANLINE_PAD 32
+#define CUR_LOG2_BITMAP_PAD 5
+#define REVERSE_BIT_ORDER(w) xf86ReverseBitOrder(w)
+#else
+#define SCANLINE CARD64
+#define CUR_BITMAP_SCANLINE_PAD BITMAP_SCANLINE_PAD
+#define CUR_LOG2_BITMAP_PAD LOG2_BITMAP_PAD
+#define REVERSE_BIT_ORDER(w) xf86CARD64ReverseBits(w)
+static CARD64 xf86CARD64ReverseBits(CARD64 w);
+
+static CARD64
+xf86CARD64ReverseBits(CARD64 w)
+{
+ unsigned char *p = (unsigned char *)&w;
+
+ p[0] = byte_reversed[p[0]];
+ p[1] = byte_reversed[p[1]];
+ p[2] = byte_reversed[p[2]];
+ p[3] = byte_reversed[p[3]];
+ p[4] = byte_reversed[p[4]];
+ p[5] = byte_reversed[p[5]];
+ p[6] = byte_reversed[p[6]];
+ p[7] = byte_reversed[p[7]];
+
+ return w;
+}
+#endif
+
+#else
+
+#define SCANLINE CARD32
+#define CUR_BITMAP_SCANLINE_PAD BITMAP_SCANLINE_PAD
+#define CUR_LOG2_BITMAP_PAD LOG2_BITMAP_PAD
+#define REVERSE_BIT_ORDER(w) xf86ReverseBitOrder(w)
+
+#endif /* BITMAP_SCANLINE_PAD == 64 */
+
+static unsigned char* RealizeCursorInterleave0(xf86CursorInfoPtr, CursorPtr);
+static unsigned char* RealizeCursorInterleave1(xf86CursorInfoPtr, CursorPtr);
+static unsigned char* RealizeCursorInterleave8(xf86CursorInfoPtr, CursorPtr);
+static unsigned char* RealizeCursorInterleave16(xf86CursorInfoPtr, CursorPtr);
+static unsigned char* RealizeCursorInterleave32(xf86CursorInfoPtr, CursorPtr);
+static unsigned char* RealizeCursorInterleave64(xf86CursorInfoPtr, CursorPtr);
+
+Bool
+xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr)
+{
+ if ((infoPtr->MaxWidth <= 0) || (infoPtr->MaxHeight <= 0))
+ return FALSE;
+
+ /* These are required for now */
+ if (!infoPtr->SetCursorPosition ||
+ !infoPtr->LoadCursorImage ||
+ !infoPtr->HideCursor ||
+ !infoPtr->ShowCursor ||
+ !infoPtr->SetCursorColors)
+ return FALSE;
+
+ if (infoPtr->RealizeCursor) {
+ /* Don't overwrite a driver provided Realize Cursor function */
+ } else
+ if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 & infoPtr->Flags) {
+ infoPtr->RealizeCursor = RealizeCursorInterleave1;
+ } else
+ if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8 & infoPtr->Flags) {
+ infoPtr->RealizeCursor = RealizeCursorInterleave8;
+ } else
+ if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16 & infoPtr->Flags) {
+ infoPtr->RealizeCursor = RealizeCursorInterleave16;
+ } else
+ if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32 & infoPtr->Flags) {
+ infoPtr->RealizeCursor = RealizeCursorInterleave32;
+ } else
+ if (HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 & infoPtr->Flags) {
+ infoPtr->RealizeCursor = RealizeCursorInterleave64;
+ } else { /* not interleaved */
+ infoPtr->RealizeCursor = RealizeCursorInterleave0;
+ }
+
+ infoPtr->pScrn = xf86Screens[pScreen->myNum];
+
+ return TRUE;
+}
+
+void
+xf86SetCursor(ScreenPtr pScreen, CursorPtr pCurs, int x, int y)
+{
+ xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, xf86CursorScreenKey);
+ xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
+ unsigned char *bits;
+
+ if (pCurs == NullCursor) {
+ (*infoPtr->HideCursor)(infoPtr->pScrn);
+ return;
+ }
+
+ bits = dixLookupScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen);
+
+ x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX;
+ y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
+
+#ifdef ARGB_CURSOR
+ if (!pCurs->bits->argb || !infoPtr->LoadCursorARGB)
+#endif
+ if (!bits) {
+ bits = (*infoPtr->RealizeCursor)(infoPtr, pCurs);
+ dixSetScreenPrivate(&pCurs->devPrivates, CursorScreenKey, pScreen, bits);
+ }
+
+ if (!(infoPtr->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
+ (*infoPtr->HideCursor)(infoPtr->pScrn);
+
+#ifdef ARGB_CURSOR
+ if (pCurs->bits->argb && infoPtr->LoadCursorARGB)
+ (*infoPtr->LoadCursorARGB) (infoPtr->pScrn, pCurs);
+ else
+#endif
+ if (bits)
+ (*infoPtr->LoadCursorImage)(infoPtr->pScrn, bits);
+
+ xf86RecolorCursor(pScreen, pCurs, 1);
+
+ (*infoPtr->SetCursorPosition)(infoPtr->pScrn, x, y);
+
+ (*infoPtr->ShowCursor)(infoPtr->pScrn);
+}
+
+void
+xf86SetTransparentCursor(ScreenPtr pScreen)
+{
+ xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, xf86CursorScreenKey);
+ xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
+
+ if (!ScreenPriv->transparentData)
+ ScreenPriv->transparentData =
+ (*infoPtr->RealizeCursor)(infoPtr, NullCursor);
+
+ if (!(infoPtr->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
+ (*infoPtr->HideCursor)(infoPtr->pScrn);
+
+ if (ScreenPriv->transparentData)
+ (*infoPtr->LoadCursorImage)(infoPtr->pScrn,
+ ScreenPriv->transparentData);
+
+ (*infoPtr->ShowCursor)(infoPtr->pScrn);
+}
+
+void
+xf86MoveCursor(ScreenPtr pScreen, int x, int y)
+{
+ xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, xf86CursorScreenKey);
+ xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
+
+ x -= infoPtr->pScrn->frameX0 + ScreenPriv->HotX;
+ y -= infoPtr->pScrn->frameY0 + ScreenPriv->HotY;
+
+ (*infoPtr->SetCursorPosition)(infoPtr->pScrn, x, y);
+}
+
+void
+xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed)
+{
+ xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr)dixLookupPrivate(
+ &pScreen->devPrivates, xf86CursorScreenKey);
+ xf86CursorInfoPtr infoPtr = ScreenPriv->CursorInfoPtr;
+
+#ifdef ARGB_CURSOR
+ /* recoloring isn't applicable to ARGB cursors and drivers
+ shouldn't have to ignore SetCursorColors requests */
+ if (pCurs->bits->argb)
+ return;
+#endif
+
+ if (ScreenPriv->PalettedCursor) {
+ xColorItem sourceColor, maskColor;
+ ColormapPtr pmap = ScreenPriv->pInstalledMap;
+
+ if (!pmap)
+ return;
+
+ sourceColor.red = pCurs->foreRed;
+ sourceColor.green = pCurs->foreGreen;
+ sourceColor.blue = pCurs->foreBlue;
+ FakeAllocColor(pmap, &sourceColor);
+ maskColor.red = pCurs->backRed;
+ maskColor.green = pCurs->backGreen;
+ maskColor.blue = pCurs->backBlue;
+ FakeAllocColor(pmap, &maskColor);
+ FakeFreeColor(pmap, sourceColor.pixel);
+ FakeFreeColor(pmap, maskColor.pixel);
+ (*infoPtr->SetCursorColors)(infoPtr->pScrn,
+ maskColor.pixel, sourceColor.pixel);
+ } else { /* Pass colors in 8-8-8 RGB format */
+ (*infoPtr->SetCursorColors)(infoPtr->pScrn,
+ (pCurs->backBlue >> 8) |
+ ((pCurs->backGreen >> 8) << 8) |
+ ((pCurs->backRed >> 8) << 16),
+ (pCurs->foreBlue >> 8) |
+ ((pCurs->foreGreen >> 8) << 8) |
+ ((pCurs->foreRed >> 8) << 16)
+ );
+ }
+}
+
+/* These functions assume that MaxWidth is a multiple of 32 */
+static unsigned char*
+RealizeCursorInterleave0(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
+{
+
+ SCANLINE *SrcS, *SrcM, *DstS, *DstM;
+ SCANLINE *pSrc, *pMsk;
+ unsigned char *mem;
+ int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
+ int SrcPitch, DstPitch, Pitch, y, x;
+ /* how many words are in the source or mask */
+ int words = size / (CUR_BITMAP_SCANLINE_PAD / 4);
+
+
+ if (!(mem = calloc(1, size)))
+ return NULL;
+
+ if (pCurs == NullCursor) {
+ if (infoPtr->Flags & HARDWARE_CURSOR_INVERT_MASK) {
+ DstM = (SCANLINE*)mem;
+ if (!(infoPtr->Flags & HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK))
+ DstM += words;
+ memset(DstM, -1, words * sizeof(SCANLINE));
+ }
+ return mem;
+ }
+
+ /* SrcPitch == the number of scanlines wide the cursor image is */
+ SrcPitch = (pCurs->bits->width + (BITMAP_SCANLINE_PAD - 1)) >>
+ CUR_LOG2_BITMAP_PAD;
+
+ /* DstPitch is the width of the hw cursor in scanlines */
+ DstPitch = infoPtr->MaxWidth >> CUR_LOG2_BITMAP_PAD;
+ Pitch = SrcPitch < DstPitch ? SrcPitch : DstPitch;
+
+ SrcS = (SCANLINE*)pCurs->bits->source;
+ SrcM = (SCANLINE*)pCurs->bits->mask;
+ DstS = (SCANLINE*)mem;
+ DstM = DstS + words;
+
+ if (infoPtr->Flags & HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK) {
+ SCANLINE *tmp;
+ tmp = DstS; DstS = DstM; DstM = tmp;
+ }
+
+ if (infoPtr->Flags & HARDWARE_CURSOR_AND_SOURCE_WITH_MASK) {
+ for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM;
+ y--;
+ pSrc+=DstPitch, pMsk+=DstPitch, SrcS+=SrcPitch, SrcM+=SrcPitch) {
+ for(x = 0; x < Pitch; x++) {
+ pSrc[x] = SrcS[x] & SrcM[x];
+ pMsk[x] = SrcM[x];
+ }
+ }
+ } else {
+ for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM;
+ y--;
+ pSrc+=DstPitch, pMsk+=DstPitch, SrcS+=SrcPitch, SrcM+=SrcPitch) {
+ for(x = 0; x < Pitch; x++) {
+ pSrc[x] = SrcS[x];
+ pMsk[x] = SrcM[x];
+ }
+ }
+ }
+
+ if (infoPtr->Flags & HARDWARE_CURSOR_NIBBLE_SWAPPED) {
+ int count = size;
+ unsigned char* pntr1 = (unsigned char *)DstS;
+ unsigned char* pntr2 = (unsigned char *)DstM;
+ unsigned char a, b;
+ while (count) {
+
+ a = *pntr1;
+ b = *pntr2;
+ *pntr1 = ((a & 0xF0) >> 4) | ((a & 0x0F) << 4);
+ *pntr2 = ((b & 0xF0) >> 4) | ((b & 0x0F) << 4);
+ pntr1++; pntr2++;
+ count-=2;
+ }
+ }
+
+ /*
+ * Must be _after_ HARDWARE_CURSOR_AND_SOURCE_WITH_MASK to avoid wiping
+ * out entire source mask.
+ */
+ if (infoPtr->Flags & HARDWARE_CURSOR_INVERT_MASK) {
+ int count = words;
+ SCANLINE* pntr = DstM;
+ while (count--) {
+ *pntr = ~(*pntr);
+ pntr++;
+ }
+ }
+
+ if (infoPtr->Flags & HARDWARE_CURSOR_BIT_ORDER_MSBFIRST) {
+ for(y = pCurs->bits->height, pSrc = DstS, pMsk = DstM;
+ y--;
+ pSrc+=DstPitch, pMsk+=DstPitch) {
+ for(x = 0; x < Pitch; x++) {
+ pSrc[x] = REVERSE_BIT_ORDER(pSrc[x]);
+ pMsk[x] = REVERSE_BIT_ORDER(pMsk[x]);
+ }
+ }
+ }
+
+ return mem;
+}
+
+static unsigned char*
+RealizeCursorInterleave1(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
+{
+ unsigned char *DstS, *DstM;
+ unsigned char *pntr;
+ unsigned char *mem, *mem2;
+ int count;
+ int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
+
+ /* Realize the cursor without interleaving */
+ if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
+ return NULL;
+
+ if (!(mem = calloc(1, size))) {
+ free(mem2);
+ return NULL;
+ }
+
+ /* 1 bit interleave */
+ DstS = mem2;
+ DstM = DstS + (size >> 1);
+ pntr = mem;
+ count = size;
+ while (count) {
+ *pntr++ = ((*DstS&0x01) ) | ((*DstM&0x01) << 1) |
+ ((*DstS&0x02) << 1) | ((*DstM&0x02) << 2) |
+ ((*DstS&0x04) << 2) | ((*DstM&0x04) << 3) |
+ ((*DstS&0x08) << 3) | ((*DstM&0x08) << 4);
+ *pntr++ = ((*DstS&0x10) >> 4) | ((*DstM&0x10) >> 3) |
+ ((*DstS&0x20) >> 3) | ((*DstM&0x20) >> 2) |
+ ((*DstS&0x40) >> 2) | ((*DstM&0x40) >> 1) |
+ ((*DstS&0x80) >> 1) | ((*DstM&0x80) );
+ DstS++;
+ DstM++;
+ count-=2;
+ }
+
+ /* Free the uninterleaved cursor */
+ free(mem2);
+
+ return mem;
+}
+
+static unsigned char*
+RealizeCursorInterleave8(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
+{
+ unsigned char *DstS, *DstM;
+ unsigned char *pntr;
+ unsigned char *mem, *mem2;
+ int count;
+ int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
+
+ /* Realize the cursor without interleaving */
+ if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
+ return NULL;
+
+ if (!(mem = calloc(1, size))) {
+ free(mem2);
+ return NULL;
+ }
+
+ /* 8 bit interleave */
+ DstS = mem2;
+ DstM = DstS + (size >> 1);
+ pntr = mem;
+ count = size;
+ while (count) {
+ *pntr++ = *DstS++;
+ *pntr++ = *DstM++;
+ count-=2;
+ }
+
+ /* Free the uninterleaved cursor */
+ free(mem2);
+
+ return mem;
+}
+
+static unsigned char*
+RealizeCursorInterleave16(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
+{
+ unsigned short *DstS, *DstM;
+ unsigned short *pntr;
+ unsigned char *mem, *mem2;
+ int count;
+ int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
+
+ /* Realize the cursor without interleaving */
+ if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
+ return NULL;
+
+ if (!(mem = calloc(1, size))) {
+ free(mem2);
+ return NULL;
+ }
+
+ /* 16 bit interleave */
+ DstS = (pointer)mem2;
+ DstM = DstS + (size >> 2);
+ pntr = (pointer)mem;
+ count = (size >> 1);
+ while (count) {
+ *pntr++ = *DstS++;
+ *pntr++ = *DstM++;
+ count-=2;
+ }
+
+ /* Free the uninterleaved cursor */
+ free(mem2);
+
+ return mem;
+}
+
+static unsigned char*
+RealizeCursorInterleave32(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
+{
+ CARD32 *DstS, *DstM;
+ CARD32 *pntr;
+ unsigned char *mem, *mem2;
+ int count;
+ int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
+
+ /* Realize the cursor without interleaving */
+ if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
+ return NULL;
+
+ if (!(mem = calloc(1, size))) {
+ free(mem2);
+ return NULL;
+ }
+
+ /* 32 bit interleave */
+ DstS = (pointer)mem2;
+ DstM = DstS + (size >> 3);
+ pntr = (pointer)mem;
+ count = (size >> 2);
+ while (count) {
+ *pntr++ = *DstS++;
+ *pntr++ = *DstM++;
+ count-=2;
+ }
+
+ /* Free the uninterleaved cursor */
+ free(mem2);
+
+ return mem;
+}
+
+static unsigned char*
+RealizeCursorInterleave64(xf86CursorInfoPtr infoPtr, CursorPtr pCurs)
+{
+ CARD32 *DstS, *DstM;
+ CARD32 *pntr;
+ unsigned char *mem, *mem2;
+ int count;
+ int size = (infoPtr->MaxWidth * infoPtr->MaxHeight) >> 2;
+
+ /* Realize the cursor without interleaving */
+ if (!(mem2 = RealizeCursorInterleave0(infoPtr, pCurs)))
+ return NULL;
+
+ if (!(mem = calloc(1, size))) {
+ free(mem2);
+ return NULL;
+ }
+
+ /* 64 bit interleave */
+ DstS = (pointer)mem2;
+ DstM = DstS + (size >> 3);
+ pntr = (pointer)mem;
+ count = (size >> 2);
+ while (count) {
+ *pntr++ = *DstS++;
+ *pntr++ = *DstS++;
+ *pntr++ = *DstM++;
+ *pntr++ = *DstM++;
+ count-=4;
+ }
+
+ /* Free the uninterleaved cursor */
+ free(mem2);
+
+ return mem;
+}
diff --git a/xorg-server/hw/xfree86/utils/man/cvt.man b/xorg-server/hw/xfree86/utils/man/cvt.man
index b380171ee..f5075f5bf 100644
--- a/xorg-server/hw/xfree86/utils/man/cvt.man
+++ b/xorg-server/hw/xfree86/utils/man/cvt.man
@@ -1,4 +1,3 @@
-.\" $XFree86$
.TH CVT 1 __vendorversion__
.SH NAME
cvt - calculate VESA CVT mode lines
@@ -32,7 +31,7 @@ Create a mode with reduced blanking. This allows for higher frequency signals,
with a lower or equal dotclock. Not for Cathode Ray Tube based displays though.
.SH "SEE ALSO"
-__xconfigfile__(__filemansuffix__)
+__xconfigfile__(__filemansuffix__), gtf(__appmansuffix__)
.SH AUTHOR
Luc Verhaegen.
.PP
diff --git a/xorg-server/hw/xfree86/utils/man/gtf.man b/xorg-server/hw/xfree86/utils/man/gtf.man
index 74ade74cb..8e83650aa 100644
--- a/xorg-server/hw/xfree86/utils/man/gtf.man
+++ b/xorg-server/hw/xfree86/utils/man/gtf.man
@@ -1,4 +1,3 @@
-.\" $XFree86$
.TH GTF 1 __vendorversion__
.SH NAME
gtf - calculate VESA GTF mode lines
@@ -35,7 +34,7 @@ default format.
Print the mode parameters in a format suitable for
.BR fbset(8) .
.SH "SEE ALSO"
-__xconfigfile__(__filemansuffix__)
+__xconfigfile__(__filemansuffix__), cvt(__appmansuffix__)
.SH AUTHOR
Andy Ritger.
.PP
diff --git a/xorg-server/hw/xfree86/x86emu/sys.c b/xorg-server/hw/xfree86/x86emu/sys.c
index 602b0bbee..f389767f1 100644
--- a/xorg-server/hw/xfree86/x86emu/sys.c
+++ b/xorg-server/hw/xfree86/x86emu/sys.c
@@ -49,7 +49,6 @@
#include <string.h>
#endif
-# ifndef NO_INLINE
# ifdef __GNUC__
/* Define some packed structures to use with unaligned accesses */
@@ -139,7 +138,6 @@ static __inline__ void stw_u(u16 val, u16 *p)
}
# endif /* __GNUC__ */
-# endif /* NO_INLINE */
/*------------------------- Global Variables ------------------------------*/
X86EMU_sysEnv _X86EMU_env; /* Global emulator machine state */
diff --git a/xorg-server/hw/xnest/GC.c b/xorg-server/hw/xnest/GC.c
index 0aaef6904..48fe4dcbc 100644
--- a/xorg-server/hw/xnest/GC.c
+++ b/xorg-server/hw/xnest/GC.c
@@ -1,333 +1,330 @@
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-
-#ifdef HAVE_XNEST_CONFIG_H
-#include <xnest-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "gcstruct.h"
-#include "windowstr.h"
-#include "pixmapstr.h"
-#include "scrnintstr.h"
-#include <X11/fonts/fontstruct.h>
-#include "mistruct.h"
-#include "region.h"
-
-#include "Xnest.h"
-
-#include "Display.h"
-#include "XNGC.h"
-#include "GCOps.h"
-#include "Drawable.h"
-#include "XNFont.h"
-#include "Color.h"
-
-DevPrivateKeyRec xnestGCPrivateKeyRec;
-
-static GCFuncs xnestFuncs = {
- xnestValidateGC,
- xnestChangeGC,
- xnestCopyGC,
- xnestDestroyGC,
- xnestChangeClip,
- xnestDestroyClip,
- xnestCopyClip,
-};
-
-static GCOps xnestOps = {
- xnestFillSpans,
- xnestSetSpans,
- xnestPutImage,
- xnestCopyArea,
- xnestCopyPlane,
- xnestPolyPoint,
- xnestPolylines,
- xnestPolySegment,
- xnestPolyRectangle,
- xnestPolyArc,
- xnestFillPolygon,
- xnestPolyFillRect,
- xnestPolyFillArc,
- xnestPolyText8,
- xnestPolyText16,
- xnestImageText8,
- xnestImageText16,
- xnestImageGlyphBlt,
- xnestPolyGlyphBlt,
- xnestPushPixels
-};
-
-Bool
-xnestCreateGC(GCPtr pGC)
-{
- pGC->funcs = &xnestFuncs;
- pGC->ops = &xnestOps;
-
- pGC->miTranslate = 1;
-
- xnestGCPriv(pGC)->gc = XCreateGC(xnestDisplay,
- xnestDefaultDrawables[pGC->depth],
- 0L, NULL);
- xnestGCPriv(pGC)->nClipRects = 0;
-
- return True;
-}
-
-void
-xnestValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
-{
-}
-
-void
-xnestChangeGC(GCPtr pGC, unsigned long mask)
-{
- XGCValues values;
-
- if (mask & GCFunction)
- values.function = pGC->alu;
-
- if (mask & GCPlaneMask)
- values.plane_mask = pGC->planemask;
-
- if (mask & GCForeground)
- values.foreground = xnestPixel(pGC->fgPixel);
-
- if (mask & GCBackground)
- values.background = xnestPixel(pGC->bgPixel);
-
- if (mask & GCLineWidth)
- values.line_width = pGC->lineWidth;
-
- if (mask & GCLineStyle)
- values.line_style = pGC->lineStyle;
-
- if (mask & GCCapStyle)
- values.cap_style = pGC->capStyle;
-
- if (mask & GCJoinStyle)
- values.join_style = pGC->joinStyle;
-
- if (mask & GCFillStyle)
- values.fill_style = pGC->fillStyle;
-
- if (mask & GCFillRule)
- values.fill_rule = pGC->fillRule;
-
- if (mask & GCTile) {
- if (pGC->tileIsPixel)
- mask &= ~GCTile;
- else
- values.tile = xnestPixmap(pGC->tile.pixmap);
- }
-
- if (mask & GCStipple)
- values.stipple = xnestPixmap(pGC->stipple);
-
- if (mask & GCTileStipXOrigin)
- values.ts_x_origin = pGC->patOrg.x;
-
- if (mask & GCTileStipYOrigin)
- values.ts_y_origin = pGC->patOrg.y;
-
- if (mask & GCFont)
- values.font = xnestFont(pGC->font);
-
- if (mask & GCSubwindowMode)
- values.subwindow_mode = pGC->subWindowMode;
-
- if (mask & GCGraphicsExposures)
- values.graphics_exposures = pGC->graphicsExposures;
-
- if (mask & GCClipXOrigin)
- values.clip_x_origin = pGC->clipOrg.x;
-
- if (mask & GCClipYOrigin)
- values.clip_y_origin = pGC->clipOrg.y;
-
- if (mask & GCClipMask) /* this is handled in change clip */
- mask &= ~GCClipMask;
-
- if (mask & GCDashOffset)
- values.dash_offset = pGC->dashOffset;
-
- if (mask & GCDashList) {
- mask &= ~GCDashList;
- XSetDashes(xnestDisplay, xnestGC(pGC),
- pGC->dashOffset, (char *)pGC->dash, pGC->numInDashList);
- }
-
- if (mask & GCArcMode)
- values.arc_mode = pGC->arcMode;
-
- if (mask)
- XChangeGC(xnestDisplay, xnestGC(pGC), mask, &values);
-}
-
-void
-xnestCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst)
-{
- XCopyGC(xnestDisplay, xnestGC(pGCSrc), mask, xnestGC(pGCDst));
-}
-
-void
-xnestDestroyGC(GCPtr pGC)
-{
- XFreeGC(xnestDisplay, xnestGC(pGC));
-}
-
-void
-xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects)
-{
- int i, size;
- BoxPtr pBox;
- XRectangle *pRects;
-
- xnestDestroyClipHelper(pGC);
-
- switch(type)
- {
- case CT_NONE:
- XSetClipMask(xnestDisplay, xnestGC(pGC), None);
- break;
-
- case CT_REGION:
- nRects = RegionNumRects((RegionPtr)pValue);
- size = nRects * sizeof(*pRects);
- pRects = (XRectangle *) malloc(size);
- pBox = RegionRects((RegionPtr)pValue);
- for (i = nRects; i-- > 0; ) {
- pRects[i].x = pBox[i].x1;
- pRects[i].y = pBox[i].y1;
- pRects[i].width = pBox[i].x2 - pBox[i].x1;
- pRects[i].height = pBox[i].y2 - pBox[i].y1;
- }
- XSetClipRectangles(xnestDisplay, xnestGC(pGC), 0, 0,
- pRects, nRects, Unsorted);
- free((char *) pRects);
- break;
-
- case CT_PIXMAP:
- XSetClipMask(xnestDisplay, xnestGC(pGC),
- xnestPixmap((PixmapPtr)pValue));
- /*
- * Need to change into region, so subsequent uses are with
- * current pixmap contents.
- */
- pGC->clientClip = (pointer) (*pGC->pScreen->BitmapToRegion)((PixmapPtr)pValue);
- (*pGC->pScreen->DestroyPixmap)((PixmapPtr)pValue);
- pValue = pGC->clientClip;
- type = CT_REGION;
- break;
-
- case CT_UNSORTED:
- XSetClipRectangles(xnestDisplay, xnestGC(pGC),
- pGC->clipOrg.x, pGC->clipOrg.y,
- (XRectangle *)pValue, nRects, Unsorted);
- break;
-
- case CT_YSORTED:
- XSetClipRectangles(xnestDisplay, xnestGC(pGC),
- pGC->clipOrg.x, pGC->clipOrg.y,
- (XRectangle *)pValue, nRects, YSorted);
- break;
-
- case CT_YXSORTED:
- XSetClipRectangles(xnestDisplay, xnestGC(pGC),
- pGC->clipOrg.x, pGC->clipOrg.y,
- (XRectangle *)pValue, nRects, YXSorted);
- break;
-
- case CT_YXBANDED:
- XSetClipRectangles(xnestDisplay, xnestGC(pGC),
- pGC->clipOrg.x, pGC->clipOrg.y,
- (XRectangle *)pValue, nRects, YXBanded);
- break;
- }
-
- switch(type)
- {
- default:
- break;
-
- case CT_UNSORTED:
- case CT_YSORTED:
- case CT_YXSORTED:
- case CT_YXBANDED:
-
- /*
- * other parts of server can only deal with CT_NONE,
- * CT_PIXMAP and CT_REGION client clips.
- */
- pGC->clientClip = (pointer) RegionFromRects(nRects,
- (xRectangle *)pValue, type);
- free(pValue);
- pValue = pGC->clientClip;
- type = CT_REGION;
-
- break;
- }
-
- pGC->clientClipType = type;
- pGC->clientClip = pValue;
- xnestGCPriv(pGC)->nClipRects = nRects;
-}
-
-void
-xnestDestroyClip(GCPtr pGC)
-{
- xnestDestroyClipHelper(pGC);
-
- XSetClipMask(xnestDisplay, xnestGC(pGC), None);
-
- pGC->clientClipType = CT_NONE;
- pGC->clientClip = NULL;
- xnestGCPriv(pGC)->nClipRects = 0;
-}
-
-void
-xnestDestroyClipHelper(GCPtr pGC)
-{
- switch (pGC->clientClipType)
- {
- default:
- case CT_NONE:
- break;
-
- case CT_REGION:
- RegionDestroy(pGC->clientClip);
- break;
- }
-}
-
-void
-xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc)
-{
- RegionPtr pRgn;
-
- switch (pGCSrc->clientClipType)
- {
- default:
- case CT_NONE:
- xnestDestroyClip(pGCDst);
- break;
-
- case CT_REGION:
- pRgn = RegionCreate(NULL, 1);
- RegionCopy(pRgn, pGCSrc->clientClip);
- xnestChangeClip(pGCDst, CT_REGION, pRgn, 0);
- break;
- }
-}
+/*
+
+Copyright 1993 by Davor Matic
+
+Permission to use, copy, modify, distribute, and sell this software
+and its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation. Davor Matic makes no representations about
+the suitability of this software for any purpose. It is provided "as
+is" without express or implied warranty.
+
+*/
+
+#ifdef HAVE_XNEST_CONFIG_H
+#include <xnest-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "gcstruct.h"
+#include "windowstr.h"
+#include "pixmapstr.h"
+#include "scrnintstr.h"
+#include <X11/fonts/fontstruct.h>
+#include "mistruct.h"
+#include "region.h"
+
+#include "Xnest.h"
+
+#include "Display.h"
+#include "XNGC.h"
+#include "GCOps.h"
+#include "Drawable.h"
+#include "XNFont.h"
+#include "Color.h"
+
+DevPrivateKeyRec xnestGCPrivateKeyRec;
+
+static GCFuncs xnestFuncs = {
+ xnestValidateGC,
+ xnestChangeGC,
+ xnestCopyGC,
+ xnestDestroyGC,
+ xnestChangeClip,
+ xnestDestroyClip,
+ xnestCopyClip,
+};
+
+static GCOps xnestOps = {
+ xnestFillSpans,
+ xnestSetSpans,
+ xnestPutImage,
+ xnestCopyArea,
+ xnestCopyPlane,
+ xnestPolyPoint,
+ xnestPolylines,
+ xnestPolySegment,
+ xnestPolyRectangle,
+ xnestPolyArc,
+ xnestFillPolygon,
+ xnestPolyFillRect,
+ xnestPolyFillArc,
+ xnestPolyText8,
+ xnestPolyText16,
+ xnestImageText8,
+ xnestImageText16,
+ xnestImageGlyphBlt,
+ xnestPolyGlyphBlt,
+ xnestPushPixels
+};
+
+Bool
+xnestCreateGC(GCPtr pGC)
+{
+ pGC->funcs = &xnestFuncs;
+ pGC->ops = &xnestOps;
+
+ pGC->miTranslate = 1;
+
+ xnestGCPriv(pGC)->gc = XCreateGC(xnestDisplay,
+ xnestDefaultDrawables[pGC->depth],
+ 0L, NULL);
+
+ return True;
+}
+
+void
+xnestValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
+{
+}
+
+void
+xnestChangeGC(GCPtr pGC, unsigned long mask)
+{
+ XGCValues values;
+
+ if (mask & GCFunction)
+ values.function = pGC->alu;
+
+ if (mask & GCPlaneMask)
+ values.plane_mask = pGC->planemask;
+
+ if (mask & GCForeground)
+ values.foreground = xnestPixel(pGC->fgPixel);
+
+ if (mask & GCBackground)
+ values.background = xnestPixel(pGC->bgPixel);
+
+ if (mask & GCLineWidth)
+ values.line_width = pGC->lineWidth;
+
+ if (mask & GCLineStyle)
+ values.line_style = pGC->lineStyle;
+
+ if (mask & GCCapStyle)
+ values.cap_style = pGC->capStyle;
+
+ if (mask & GCJoinStyle)
+ values.join_style = pGC->joinStyle;
+
+ if (mask & GCFillStyle)
+ values.fill_style = pGC->fillStyle;
+
+ if (mask & GCFillRule)
+ values.fill_rule = pGC->fillRule;
+
+ if (mask & GCTile) {
+ if (pGC->tileIsPixel)
+ mask &= ~GCTile;
+ else
+ values.tile = xnestPixmap(pGC->tile.pixmap);
+ }
+
+ if (mask & GCStipple)
+ values.stipple = xnestPixmap(pGC->stipple);
+
+ if (mask & GCTileStipXOrigin)
+ values.ts_x_origin = pGC->patOrg.x;
+
+ if (mask & GCTileStipYOrigin)
+ values.ts_y_origin = pGC->patOrg.y;
+
+ if (mask & GCFont)
+ values.font = xnestFont(pGC->font);
+
+ if (mask & GCSubwindowMode)
+ values.subwindow_mode = pGC->subWindowMode;
+
+ if (mask & GCGraphicsExposures)
+ values.graphics_exposures = pGC->graphicsExposures;
+
+ if (mask & GCClipXOrigin)
+ values.clip_x_origin = pGC->clipOrg.x;
+
+ if (mask & GCClipYOrigin)
+ values.clip_y_origin = pGC->clipOrg.y;
+
+ if (mask & GCClipMask) /* this is handled in change clip */
+ mask &= ~GCClipMask;
+
+ if (mask & GCDashOffset)
+ values.dash_offset = pGC->dashOffset;
+
+ if (mask & GCDashList) {
+ mask &= ~GCDashList;
+ XSetDashes(xnestDisplay, xnestGC(pGC),
+ pGC->dashOffset, (char *)pGC->dash, pGC->numInDashList);
+ }
+
+ if (mask & GCArcMode)
+ values.arc_mode = pGC->arcMode;
+
+ if (mask)
+ XChangeGC(xnestDisplay, xnestGC(pGC), mask, &values);
+}
+
+void
+xnestCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst)
+{
+ XCopyGC(xnestDisplay, xnestGC(pGCSrc), mask, xnestGC(pGCDst));
+}
+
+void
+xnestDestroyGC(GCPtr pGC)
+{
+ XFreeGC(xnestDisplay, xnestGC(pGC));
+}
+
+void
+xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects)
+{
+ int i, size;
+ BoxPtr pBox;
+ XRectangle *pRects;
+
+ xnestDestroyClipHelper(pGC);
+
+ switch(type)
+ {
+ case CT_NONE:
+ XSetClipMask(xnestDisplay, xnestGC(pGC), None);
+ break;
+
+ case CT_REGION:
+ nRects = RegionNumRects((RegionPtr)pValue);
+ size = nRects * sizeof(*pRects);
+ pRects = (XRectangle *) malloc(size);
+ pBox = RegionRects((RegionPtr)pValue);
+ for (i = nRects; i-- > 0; ) {
+ pRects[i].x = pBox[i].x1;
+ pRects[i].y = pBox[i].y1;
+ pRects[i].width = pBox[i].x2 - pBox[i].x1;
+ pRects[i].height = pBox[i].y2 - pBox[i].y1;
+ }
+ XSetClipRectangles(xnestDisplay, xnestGC(pGC), 0, 0,
+ pRects, nRects, Unsorted);
+ free((char *) pRects);
+ break;
+
+ case CT_PIXMAP:
+ XSetClipMask(xnestDisplay, xnestGC(pGC),
+ xnestPixmap((PixmapPtr)pValue));
+ /*
+ * Need to change into region, so subsequent uses are with
+ * current pixmap contents.
+ */
+ pGC->clientClip = (pointer) (*pGC->pScreen->BitmapToRegion)((PixmapPtr)pValue);
+ (*pGC->pScreen->DestroyPixmap)((PixmapPtr)pValue);
+ pValue = pGC->clientClip;
+ type = CT_REGION;
+ break;
+
+ case CT_UNSORTED:
+ XSetClipRectangles(xnestDisplay, xnestGC(pGC),
+ pGC->clipOrg.x, pGC->clipOrg.y,
+ (XRectangle *)pValue, nRects, Unsorted);
+ break;
+
+ case CT_YSORTED:
+ XSetClipRectangles(xnestDisplay, xnestGC(pGC),
+ pGC->clipOrg.x, pGC->clipOrg.y,
+ (XRectangle *)pValue, nRects, YSorted);
+ break;
+
+ case CT_YXSORTED:
+ XSetClipRectangles(xnestDisplay, xnestGC(pGC),
+ pGC->clipOrg.x, pGC->clipOrg.y,
+ (XRectangle *)pValue, nRects, YXSorted);
+ break;
+
+ case CT_YXBANDED:
+ XSetClipRectangles(xnestDisplay, xnestGC(pGC),
+ pGC->clipOrg.x, pGC->clipOrg.y,
+ (XRectangle *)pValue, nRects, YXBanded);
+ break;
+ }
+
+ switch(type)
+ {
+ default:
+ break;
+
+ case CT_UNSORTED:
+ case CT_YSORTED:
+ case CT_YXSORTED:
+ case CT_YXBANDED:
+
+ /*
+ * other parts of server can only deal with CT_NONE,
+ * CT_PIXMAP and CT_REGION client clips.
+ */
+ pGC->clientClip = (pointer) RegionFromRects(nRects,
+ (xRectangle *)pValue, type);
+ free(pValue);
+ pValue = pGC->clientClip;
+ type = CT_REGION;
+
+ break;
+ }
+
+ pGC->clientClipType = type;
+ pGC->clientClip = pValue;
+}
+
+void
+xnestDestroyClip(GCPtr pGC)
+{
+ xnestDestroyClipHelper(pGC);
+
+ XSetClipMask(xnestDisplay, xnestGC(pGC), None);
+
+ pGC->clientClipType = CT_NONE;
+ pGC->clientClip = NULL;
+}
+
+void
+xnestDestroyClipHelper(GCPtr pGC)
+{
+ switch (pGC->clientClipType)
+ {
+ default:
+ case CT_NONE:
+ break;
+
+ case CT_REGION:
+ RegionDestroy(pGC->clientClip);
+ break;
+ }
+}
+
+void
+xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc)
+{
+ RegionPtr pRgn;
+
+ switch (pGCSrc->clientClipType)
+ {
+ default:
+ case CT_NONE:
+ xnestDestroyClip(pGCDst);
+ break;
+
+ case CT_REGION:
+ pRgn = RegionCreate(NULL, 1);
+ RegionCopy(pRgn, pGCSrc->clientClip);
+ xnestChangeClip(pGCDst, CT_REGION, pRgn, 0);
+ break;
+ }
+}
diff --git a/xorg-server/hw/xnest/XNCursor.h b/xorg-server/hw/xnest/XNCursor.h
index c50b79d1d..473b2017f 100644
--- a/xorg-server/hw/xnest/XNCursor.h
+++ b/xorg-server/hw/xnest/XNCursor.h
@@ -1,59 +1,59 @@
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-
-#ifndef XNESTCURSOR_H
-#define XNESTCURSOR_H
-
-#include "mipointrst.h"
-
-typedef struct {
- miPointerSpriteFuncPtr spriteFuncs;
-} xnestCursorFuncRec, *xnestCursorFuncPtr;
-
-extern DevPrivateKeyRec xnestCursorScreenKeyRec;
-#define xnestCursorScreenKey (&xnestCursorScreenKeyRec)
-extern xnestCursorFuncRec xnestCursorFuncs;
-
-typedef struct {
- Cursor cursor;
-} xnestPrivCursor;
-
-#define xnestGetCursorPriv(pCursor, pScreen) ((xnestPrivCursor *) \
- dixLookupPrivate(&(pCursor)->devPrivates, CursorScreenKey(pScreen)))
-
-#define xnestSetCursorPriv(pCursor, pScreen, v) \
- dixSetPrivate(&(pCursor)->devPrivates, CursorScreenKey(pScreen), v)
-
-#define xnestCursor(pCursor, pScreen) \
- (xnestGetCursorPriv(pCursor, pScreen)->cursor)
-
-Bool xnestRealizeCursor(DeviceIntPtr pDev,
- ScreenPtr pScreen,
- CursorPtr pCursor);
-Bool xnestUnrealizeCursor(DeviceIntPtr pDev,
- ScreenPtr pScreen,
- CursorPtr pCursor);
-void xnestRecolorCursor(ScreenPtr pScreen,
- CursorPtr pCursor,
- Bool displayed);
-void xnestSetCursor (DeviceIntPtr pDev,
- ScreenPtr pScreen,
- CursorPtr pCursor,
- int x, int y);
-void xnestMoveCursor (DeviceIntPtr pDev,
- ScreenPtr pScreen,
- int x, int y);
-Bool xnestDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen);
-void xnestDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen);
-#endif /* XNESTCURSOR_H */
+/*
+
+Copyright 1993 by Davor Matic
+
+Permission to use, copy, modify, distribute, and sell this software
+and its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation. Davor Matic makes no representations about
+the suitability of this software for any purpose. It is provided "as
+is" without express or implied warranty.
+
+*/
+
+#ifndef XNESTCURSOR_H
+#define XNESTCURSOR_H
+
+#include "mipointrst.h"
+
+typedef struct {
+ miPointerSpriteFuncPtr spriteFuncs;
+} xnestCursorFuncRec, *xnestCursorFuncPtr;
+
+extern DevPrivateKeyRec xnestCursorScreenKeyRec;
+#define xnestCursorScreenKey (&xnestCursorScreenKeyRec)
+extern xnestCursorFuncRec xnestCursorFuncs;
+
+typedef struct {
+ Cursor cursor;
+} xnestPrivCursor;
+
+#define xnestGetCursorPriv(pCursor, pScreen) ((xnestPrivCursor *) \
+ dixLookupScreenPrivate(&(pCursor)->devPrivates, CursorScreenKey, pScreen))
+
+#define xnestSetCursorPriv(pCursor, pScreen, v) \
+ dixSetScreenPrivate(&(pCursor)->devPrivates, CursorScreenKey, pScreen, v)
+
+#define xnestCursor(pCursor, pScreen) \
+ (xnestGetCursorPriv(pCursor, pScreen)->cursor)
+
+Bool xnestRealizeCursor(DeviceIntPtr pDev,
+ ScreenPtr pScreen,
+ CursorPtr pCursor);
+Bool xnestUnrealizeCursor(DeviceIntPtr pDev,
+ ScreenPtr pScreen,
+ CursorPtr pCursor);
+void xnestRecolorCursor(ScreenPtr pScreen,
+ CursorPtr pCursor,
+ Bool displayed);
+void xnestSetCursor (DeviceIntPtr pDev,
+ ScreenPtr pScreen,
+ CursorPtr pCursor,
+ int x, int y);
+void xnestMoveCursor (DeviceIntPtr pDev,
+ ScreenPtr pScreen,
+ int x, int y);
+Bool xnestDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen);
+void xnestDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen);
+#endif /* XNESTCURSOR_H */
diff --git a/xorg-server/hw/xnest/XNGC.h b/xorg-server/hw/xnest/XNGC.h
index 2eb89533d..c4a6cef77 100644
--- a/xorg-server/hw/xnest/XNGC.h
+++ b/xorg-server/hw/xnest/XNGC.h
@@ -1,43 +1,42 @@
-/*
-
-Copyright 1993 by Davor Matic
-
-Permission to use, copy, modify, distribute, and sell this software
-and its documentation for any purpose is hereby granted without fee,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation. Davor Matic makes no representations about
-the suitability of this software for any purpose. It is provided "as
-is" without express or implied warranty.
-
-*/
-
-#ifndef XNESTGC_H
-#define XNESTGC_H
-
-/* This file uses the GC definition form Xlib.h as XlibGC. */
-
-typedef struct {
- XlibGC gc;
- int nClipRects;
-} xnestPrivGC;
-
-extern DevPrivateKeyRec xnestGCPrivateKeyRec;
-#define xnestGCPrivateKey (&xnestGCPrivateKeyRec)
-
-#define xnestGCPriv(pGC) ((xnestPrivGC *) \
- dixLookupPrivate(&(pGC)->devPrivates, xnestGCPrivateKey))
-
-#define xnestGC(pGC) (xnestGCPriv(pGC)->gc)
-
-Bool xnestCreateGC(GCPtr pGC);
-void xnestValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable);
-void xnestChangeGC(GCPtr pGC, unsigned long mask);
-void xnestCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
-void xnestDestroyGC(GCPtr pGC);
-void xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects);
-void xnestDestroyClip(GCPtr pGC);
-void xnestDestroyClipHelper(GCPtr pGC);
-void xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc);
-
-#endif /* XNESTGC_H */
+/*
+
+Copyright 1993 by Davor Matic
+
+Permission to use, copy, modify, distribute, and sell this software
+and its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation. Davor Matic makes no representations about
+the suitability of this software for any purpose. It is provided "as
+is" without express or implied warranty.
+
+*/
+
+#ifndef XNESTGC_H
+#define XNESTGC_H
+
+/* This file uses the GC definition form Xlib.h as XlibGC. */
+
+typedef struct {
+ XlibGC gc;
+} xnestPrivGC;
+
+extern DevPrivateKeyRec xnestGCPrivateKeyRec;
+#define xnestGCPrivateKey (&xnestGCPrivateKeyRec)
+
+#define xnestGCPriv(pGC) ((xnestPrivGC *) \
+ dixLookupPrivate(&(pGC)->devPrivates, xnestGCPrivateKey))
+
+#define xnestGC(pGC) (xnestGCPriv(pGC)->gc)
+
+Bool xnestCreateGC(GCPtr pGC);
+void xnestValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable);
+void xnestChangeGC(GCPtr pGC, unsigned long mask);
+void xnestCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
+void xnestDestroyGC(GCPtr pGC);
+void xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects);
+void xnestDestroyClip(GCPtr pGC);
+void xnestDestroyClipHelper(GCPtr pGC);
+void xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc);
+
+#endif /* XNESTGC_H */
diff --git a/xorg-server/hw/xquartz/applewm.c b/xorg-server/hw/xquartz/applewm.c
index 2f26e61d9..27fb125d3 100644
--- a/xorg-server/hw/xquartz/applewm.c
+++ b/xorg-server/hw/xquartz/applewm.c
@@ -147,7 +147,6 @@ ProcAppleWMQueryVersion(
)
{
xAppleWMQueryVersionReply rep;
- register int n;
REQUEST_SIZE_MATCH(xAppleWMQueryVersionReq);
rep.type = X_Reply;
@@ -157,8 +156,8 @@ ProcAppleWMQueryVersion(
rep.minorVersion = SERVER_APPLEWM_MINOR_VERSION;
rep.patchVersion = SERVER_APPLEWM_PATCH_VERSION;
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
}
WriteToClient(client, sizeof(xAppleWMQueryVersionReply), (char *)&rep);
return Success;
@@ -681,9 +680,8 @@ SProcAppleWMQueryVersion(
register ClientPtr client
)
{
- register int n;
REQUEST(xAppleWMQueryVersionReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return ProcAppleWMQueryVersion(client);
}
diff --git a/xorg-server/hw/xquartz/pseudoramiX.c b/xorg-server/hw/xquartz/pseudoramiX.c
index ded242d07..5a5b9c2e7 100644
--- a/xorg-server/hw/xquartz/pseudoramiX.c
+++ b/xorg-server/hw/xquartz/pseudoramiX.c
@@ -1,471 +1,462 @@
-/*
- * Minimal implementation of PanoramiX/Xinerama
- *
- * This is used in rootless mode where the underlying window server
- * already provides an abstracted view of multiple screens as one
- * large screen area.
- *
- * This code is largely based on panoramiX.c, which contains the
- * following copyright notice:
- */
-/*****************************************************************
-Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
-BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of Digital Equipment Corporation
-shall not be used in advertising or otherwise to promote the sale, use or other
-dealings in this Software without prior written authorization from Digital
-Equipment Corporation.
-******************************************************************/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "darwin.h"
-#include "pseudoramiX.h"
-#include "extnsionst.h"
-#include "dixstruct.h"
-#include "window.h"
-#include <X11/extensions/panoramiXproto.h>
-#include "globals.h"
-
-Bool noPseudoramiXExtension = FALSE;
-
-extern int ProcPanoramiXQueryVersion (ClientPtr client);
-
-static void PseudoramiXResetProc(ExtensionEntry *extEntry);
-
-static int ProcPseudoramiXQueryVersion(ClientPtr client);
-static int ProcPseudoramiXGetState(ClientPtr client);
-static int ProcPseudoramiXGetScreenCount(ClientPtr client);
-static int ProcPseudoramiXGetScreenSize(ClientPtr client);
-static int ProcPseudoramiXIsActive(ClientPtr client);
-static int ProcPseudoramiXQueryScreens(ClientPtr client);
-static int ProcPseudoramiXDispatch(ClientPtr client);
-
-static int SProcPseudoramiXQueryVersion(ClientPtr client);
-static int SProcPseudoramiXGetState(ClientPtr client);
-static int SProcPseudoramiXGetScreenCount(ClientPtr client);
-static int SProcPseudoramiXGetScreenSize(ClientPtr client);
-static int SProcPseudoramiXIsActive(ClientPtr client);
-static int SProcPseudoramiXQueryScreens(ClientPtr client);
-static int SProcPseudoramiXDispatch(ClientPtr client);
-
-
-typedef struct {
- int x;
- int y;
- int w;
- int h;
-} PseudoramiXScreenRec;
-
-static PseudoramiXScreenRec *pseudoramiXScreens = NULL;
-static int pseudoramiXScreensAllocated = 0;
-static int pseudoramiXNumScreens = 0;
-static unsigned long pseudoramiXGeneration = 0;
-
-
-// Add a PseudoramiX screen.
-// The rest of the X server will know nothing about this screen.
-// Can be called before or after extension init.
-// Screens must be re-added once per generation.
-void
-PseudoramiXAddScreen(int x, int y, int w, int h)
-{
- PseudoramiXScreenRec *s;
-
- if (noPseudoramiXExtension) return;
-
- if (pseudoramiXNumScreens == pseudoramiXScreensAllocated) {
- pseudoramiXScreensAllocated += pseudoramiXScreensAllocated + 1;
- pseudoramiXScreens = realloc(pseudoramiXScreens,
- pseudoramiXScreensAllocated *
- sizeof(PseudoramiXScreenRec));
- }
-
- DEBUG_LOG("x: %d, y: %d, w: %d, h: %d\n", x, y, w, h);
-
- s = &pseudoramiXScreens[pseudoramiXNumScreens++];
- s->x = x;
- s->y = y;
- s->w = w;
- s->h = h;
-}
-
-
-// Initialize PseudoramiX.
-// Copied from PanoramiXExtensionInit
-void PseudoramiXExtensionInit(int argc, char *argv[])
-{
- Bool success = FALSE;
- ExtensionEntry *extEntry;
-
- if (noPseudoramiXExtension) return;
-
- TRACE();
-
- /* Even with only one screen we need to enable PseudoramiX to allow
- dynamic screen configuration changes. */
-#if 0
- if (pseudoramiXNumScreens == 1) {
- // Only one screen - disable Xinerama extension.
- noPseudoramiXExtension = TRUE;
- return;
- }
-#endif
-
- if (pseudoramiXGeneration != serverGeneration) {
- extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0,
- ProcPseudoramiXDispatch,
- SProcPseudoramiXDispatch,
- PseudoramiXResetProc,
- StandardMinorOpcode);
- if (!extEntry) {
- ErrorF("PseudoramiXExtensionInit(): AddExtension failed\n");
- } else {
- pseudoramiXGeneration = serverGeneration;
- success = TRUE;
- }
- }
-
- if (!success) {
- ErrorF("%s Extension (PseudoramiX) failed to initialize\n",
- PANORAMIX_PROTOCOL_NAME);
- return;
- }
-}
-
-
-void PseudoramiXResetScreens(void)
-{
- TRACE();
-
- pseudoramiXNumScreens = 0;
-}
-
-
-static void PseudoramiXResetProc(ExtensionEntry *extEntry)
-{
- TRACE();
-
- PseudoramiXResetScreens();
-}
-
-
-// was PanoramiX
-static int ProcPseudoramiXQueryVersion(ClientPtr client)
-{
- TRACE();
-
- return ProcPanoramiXQueryVersion(client);
-}
-
-
-// was PanoramiX
-static int ProcPseudoramiXGetState(ClientPtr client)
-{
- REQUEST(xPanoramiXGetStateReq);
- WindowPtr pWin;
- xPanoramiXGetStateReply rep;
- register int n, rc;
-
- TRACE();
-
- REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.state = !noPseudoramiXExtension;
- if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swaps (&rep.state, n);
- }
- WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
- return Success;
-}
-
-
-// was PanoramiX
-static int ProcPseudoramiXGetScreenCount(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenCountReq);
- WindowPtr pWin;
- xPanoramiXGetScreenCountReply rep;
- register int n, rc;
-
- TRACE();
-
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.ScreenCount = pseudoramiXNumScreens;
- if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swaps (&rep.ScreenCount, n);
- }
- WriteToClient (client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep);
- return Success;
-}
-
-
-// was PanoramiX
-static int ProcPseudoramiXGetScreenSize(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenSizeReq);
- WindowPtr pWin;
- xPanoramiXGetScreenSizeReply rep;
- register int n, rc;
-
- TRACE();
-
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- /* screen dimensions */
- rep.width = pseudoramiXScreens[stuff->screen].w;
- // was screenInfo.screens[stuff->screen]->width;
- rep.height = pseudoramiXScreens[stuff->screen].h;
- // was screenInfo.screens[stuff->screen]->height;
- if (client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swaps (&rep.width, n);
- swaps (&rep.height, n);
- }
- WriteToClient (client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep);
- return Success;
-}
-
-
-// was Xinerama
-static int ProcPseudoramiXIsActive(ClientPtr client)
-{
- /* REQUEST(xXineramaIsActiveReq); */
- xXineramaIsActiveReply rep;
-
- TRACE();
-
- REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.state = !noPseudoramiXExtension;
- if (client->swapped) {
- register int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.state, n);
- }
- WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep);
- return Success;
-}
-
-
-// was Xinerama
-static int ProcPseudoramiXQueryScreens(ClientPtr client)
-{
- /* REQUEST(xXineramaQueryScreensReq); */
- xXineramaQueryScreensReply rep;
-
- DEBUG_LOG("noPseudoramiXExtension=%d, pseudoramiXNumScreens=%d\n", noPseudoramiXExtension, pseudoramiXNumScreens);
-
- REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.number = noPseudoramiXExtension ? 0 : pseudoramiXNumScreens;
- rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
- if (client->swapped) {
- register int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.number, n);
- }
- WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep);
-
- if (!noPseudoramiXExtension) {
- xXineramaScreenInfo scratch;
- int i;
-
- for(i = 0; i < pseudoramiXNumScreens; i++) {
- scratch.x_org = pseudoramiXScreens[i].x;
- scratch.y_org = pseudoramiXScreens[i].y;
- scratch.width = pseudoramiXScreens[i].w;
- scratch.height = pseudoramiXScreens[i].h;
-
- if(client->swapped) {
- register int n;
- swaps (&scratch.x_org, n);
- swaps (&scratch.y_org, n);
- swaps (&scratch.width, n);
- swaps (&scratch.height, n);
- }
- WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch);
- }
- }
-
- return Success;
-}
-
-
-// was PanoramiX
-static int ProcPseudoramiXDispatch (ClientPtr client)
-{ REQUEST(xReq);
- TRACE();
- switch (stuff->data)
- {
- case X_PanoramiXQueryVersion:
- return ProcPseudoramiXQueryVersion(client);
- case X_PanoramiXGetState:
- return ProcPseudoramiXGetState(client);
- case X_PanoramiXGetScreenCount:
- return ProcPseudoramiXGetScreenCount(client);
- case X_PanoramiXGetScreenSize:
- return ProcPseudoramiXGetScreenSize(client);
- case X_XineramaIsActive:
- return ProcPseudoramiXIsActive(client);
- case X_XineramaQueryScreens:
- return ProcPseudoramiXQueryScreens(client);
- }
- return BadRequest;
-}
-
-
-
-static int
-SProcPseudoramiXQueryVersion (ClientPtr client)
-{
- REQUEST(xPanoramiXQueryVersionReq);
- register int n;
-
- TRACE();
-
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
- return ProcPseudoramiXQueryVersion(client);
-}
-
-static int
-SProcPseudoramiXGetState(ClientPtr client)
-{
- REQUEST(xPanoramiXGetStateReq);
- register int n;
-
- TRACE();
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
- return ProcPseudoramiXGetState(client);
-}
-
-static int
-SProcPseudoramiXGetScreenCount(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenCountReq);
- register int n;
-
- TRACE();
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
- return ProcPseudoramiXGetScreenCount(client);
-}
-
-static int
-SProcPseudoramiXGetScreenSize(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenSizeReq);
- register int n;
-
- TRACE();
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
- return ProcPseudoramiXGetScreenSize(client);
-}
-
-
-static int
-SProcPseudoramiXIsActive(ClientPtr client)
-{
- REQUEST(xXineramaIsActiveReq);
- register int n;
-
- TRACE();
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
- return ProcPseudoramiXIsActive(client);
-}
-
-
-static int
-SProcPseudoramiXQueryScreens(ClientPtr client)
-{
- REQUEST(xXineramaQueryScreensReq);
- register int n;
-
- TRACE();
-
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
- return ProcPseudoramiXQueryScreens(client);
-}
-
-
-static int
-SProcPseudoramiXDispatch (ClientPtr client)
-{ REQUEST(xReq);
-
- TRACE();
-
- switch (stuff->data)
- {
- case X_PanoramiXQueryVersion:
- return SProcPseudoramiXQueryVersion(client);
- case X_PanoramiXGetState:
- return SProcPseudoramiXGetState(client);
- case X_PanoramiXGetScreenCount:
- return SProcPseudoramiXGetScreenCount(client);
- case X_PanoramiXGetScreenSize:
- return SProcPseudoramiXGetScreenSize(client);
- case X_XineramaIsActive:
- return SProcPseudoramiXIsActive(client);
- case X_XineramaQueryScreens:
- return SProcPseudoramiXQueryScreens(client);
- }
- return BadRequest;
-}
+/*
+ * Minimal implementation of PanoramiX/Xinerama
+ *
+ * This is used in rootless mode where the underlying window server
+ * already provides an abstracted view of multiple screens as one
+ * large screen area.
+ *
+ * This code is largely based on panoramiX.c, which contains the
+ * following copyright notice:
+ */
+/*****************************************************************
+Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING,
+BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of Digital Equipment Corporation
+shall not be used in advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization from Digital
+Equipment Corporation.
+******************************************************************/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "darwin.h"
+#include "pseudoramiX.h"
+#include "extnsionst.h"
+#include "dixstruct.h"
+#include "window.h"
+#include <X11/extensions/panoramiXproto.h>
+#include "globals.h"
+
+Bool noPseudoramiXExtension = FALSE;
+
+extern int ProcPanoramiXQueryVersion (ClientPtr client);
+
+static void PseudoramiXResetProc(ExtensionEntry *extEntry);
+
+static int ProcPseudoramiXQueryVersion(ClientPtr client);
+static int ProcPseudoramiXGetState(ClientPtr client);
+static int ProcPseudoramiXGetScreenCount(ClientPtr client);
+static int ProcPseudoramiXGetScreenSize(ClientPtr client);
+static int ProcPseudoramiXIsActive(ClientPtr client);
+static int ProcPseudoramiXQueryScreens(ClientPtr client);
+static int ProcPseudoramiXDispatch(ClientPtr client);
+
+static int SProcPseudoramiXQueryVersion(ClientPtr client);
+static int SProcPseudoramiXGetState(ClientPtr client);
+static int SProcPseudoramiXGetScreenCount(ClientPtr client);
+static int SProcPseudoramiXGetScreenSize(ClientPtr client);
+static int SProcPseudoramiXIsActive(ClientPtr client);
+static int SProcPseudoramiXQueryScreens(ClientPtr client);
+static int SProcPseudoramiXDispatch(ClientPtr client);
+
+
+typedef struct {
+ int x;
+ int y;
+ int w;
+ int h;
+} PseudoramiXScreenRec;
+
+static PseudoramiXScreenRec *pseudoramiXScreens = NULL;
+static int pseudoramiXScreensAllocated = 0;
+static int pseudoramiXNumScreens = 0;
+static unsigned long pseudoramiXGeneration = 0;
+
+
+// Add a PseudoramiX screen.
+// The rest of the X server will know nothing about this screen.
+// Can be called before or after extension init.
+// Screens must be re-added once per generation.
+void
+PseudoramiXAddScreen(int x, int y, int w, int h)
+{
+ PseudoramiXScreenRec *s;
+
+ if (noPseudoramiXExtension) return;
+
+ if (pseudoramiXNumScreens == pseudoramiXScreensAllocated) {
+ pseudoramiXScreensAllocated += pseudoramiXScreensAllocated + 1;
+ pseudoramiXScreens = realloc(pseudoramiXScreens,
+ pseudoramiXScreensAllocated *
+ sizeof(PseudoramiXScreenRec));
+ }
+
+ DEBUG_LOG("x: %d, y: %d, w: %d, h: %d\n", x, y, w, h);
+
+ s = &pseudoramiXScreens[pseudoramiXNumScreens++];
+ s->x = x;
+ s->y = y;
+ s->w = w;
+ s->h = h;
+}
+
+
+// Initialize PseudoramiX.
+// Copied from PanoramiXExtensionInit
+void PseudoramiXExtensionInit(int argc, char *argv[])
+{
+ Bool success = FALSE;
+ ExtensionEntry *extEntry;
+
+ if (noPseudoramiXExtension) return;
+
+ TRACE();
+
+ /* Even with only one screen we need to enable PseudoramiX to allow
+ dynamic screen configuration changes. */
+#if 0
+ if (pseudoramiXNumScreens == 1) {
+ // Only one screen - disable Xinerama extension.
+ noPseudoramiXExtension = TRUE;
+ return;
+ }
+#endif
+
+ if (pseudoramiXGeneration != serverGeneration) {
+ extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0,
+ ProcPseudoramiXDispatch,
+ SProcPseudoramiXDispatch,
+ PseudoramiXResetProc,
+ StandardMinorOpcode);
+ if (!extEntry) {
+ ErrorF("PseudoramiXExtensionInit(): AddExtension failed\n");
+ } else {
+ pseudoramiXGeneration = serverGeneration;
+ success = TRUE;
+ }
+ }
+
+ if (!success) {
+ ErrorF("%s Extension (PseudoramiX) failed to initialize\n",
+ PANORAMIX_PROTOCOL_NAME);
+ return;
+ }
+}
+
+
+void PseudoramiXResetScreens(void)
+{
+ TRACE();
+
+ pseudoramiXNumScreens = 0;
+}
+
+
+static void PseudoramiXResetProc(ExtensionEntry *extEntry)
+{
+ TRACE();
+
+ PseudoramiXResetScreens();
+}
+
+
+// was PanoramiX
+static int ProcPseudoramiXQueryVersion(ClientPtr client)
+{
+ TRACE();
+
+ return ProcPanoramiXQueryVersion(client);
+}
+
+
+// was PanoramiX
+static int ProcPseudoramiXGetState(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetStateReq);
+ WindowPtr pWin;
+ xPanoramiXGetStateReply rep;
+ register int rc;
+
+ TRACE();
+
+ REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.state = !noPseudoramiXExtension;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.state);
+ }
+ WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
+ return Success;
+}
+
+
+// was PanoramiX
+static int ProcPseudoramiXGetScreenCount(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetScreenCountReq);
+ WindowPtr pWin;
+ xPanoramiXGetScreenCountReply rep;
+ register int rc;
+
+ TRACE();
+
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.ScreenCount = pseudoramiXNumScreens;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.ScreenCount);
+ }
+ WriteToClient (client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep);
+ return Success;
+}
+
+
+// was PanoramiX
+static int ProcPseudoramiXGetScreenSize(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetScreenSizeReq);
+ WindowPtr pWin;
+ xPanoramiXGetScreenSizeReply rep;
+ register int n, rc;
+
+ TRACE();
+
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ /* screen dimensions */
+ rep.width = pseudoramiXScreens[stuff->screen].w;
+ // was screenInfo.screens[stuff->screen]->width;
+ rep.height = pseudoramiXScreens[stuff->screen].h;
+ // was screenInfo.screens[stuff->screen]->height;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.width);
+ swaps(&rep.height);
+ }
+ WriteToClient (client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep);
+ return Success;
+}
+
+
+// was Xinerama
+static int ProcPseudoramiXIsActive(ClientPtr client)
+{
+ /* REQUEST(xXineramaIsActiveReq); */
+ xXineramaIsActiveReply rep;
+
+ TRACE();
+
+ REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.state = !noPseudoramiXExtension;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.state);
+ }
+ WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep);
+ return Success;
+}
+
+
+// was Xinerama
+static int ProcPseudoramiXQueryScreens(ClientPtr client)
+{
+ /* REQUEST(xXineramaQueryScreensReq); */
+ xXineramaQueryScreensReply rep;
+
+ DEBUG_LOG("noPseudoramiXExtension=%d, pseudoramiXNumScreens=%d\n", noPseudoramiXExtension, pseudoramiXNumScreens);
+
+ REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.number = noPseudoramiXExtension ? 0 : pseudoramiXNumScreens;
+ rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.number);
+ }
+ WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep);
+
+ if (!noPseudoramiXExtension) {
+ xXineramaScreenInfo scratch;
+ int i;
+
+ for(i = 0; i < pseudoramiXNumScreens; i++) {
+ scratch.x_org = pseudoramiXScreens[i].x;
+ scratch.y_org = pseudoramiXScreens[i].y;
+ scratch.width = pseudoramiXScreens[i].w;
+ scratch.height = pseudoramiXScreens[i].h;
+
+ if(client->swapped) {
+ swaps(&scratch.x_org);
+ swaps(&scratch.y_org);
+ swaps(&scratch.width);
+ swaps(&scratch.height);
+ }
+ WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch);
+ }
+ }
+
+ return Success;
+}
+
+
+// was PanoramiX
+static int ProcPseudoramiXDispatch (ClientPtr client)
+{ REQUEST(xReq);
+ TRACE();
+ switch (stuff->data)
+ {
+ case X_PanoramiXQueryVersion:
+ return ProcPseudoramiXQueryVersion(client);
+ case X_PanoramiXGetState:
+ return ProcPseudoramiXGetState(client);
+ case X_PanoramiXGetScreenCount:
+ return ProcPseudoramiXGetScreenCount(client);
+ case X_PanoramiXGetScreenSize:
+ return ProcPseudoramiXGetScreenSize(client);
+ case X_XineramaIsActive:
+ return ProcPseudoramiXIsActive(client);
+ case X_XineramaQueryScreens:
+ return ProcPseudoramiXQueryScreens(client);
+ }
+ return BadRequest;
+}
+
+
+
+static int
+SProcPseudoramiXQueryVersion (ClientPtr client)
+{
+ REQUEST(xPanoramiXQueryVersionReq);
+
+ TRACE();
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
+ return ProcPseudoramiXQueryVersion(client);
+}
+
+static int
+SProcPseudoramiXGetState(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetStateReq);
+
+ TRACE();
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
+ return ProcPseudoramiXGetState(client);
+}
+
+static int
+SProcPseudoramiXGetScreenCount(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetScreenCountReq);
+
+ TRACE();
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
+ return ProcPseudoramiXGetScreenCount(client);
+}
+
+static int
+SProcPseudoramiXGetScreenSize(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetScreenSizeReq);
+
+ TRACE();
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
+ return ProcPseudoramiXGetScreenSize(client);
+}
+
+
+static int
+SProcPseudoramiXIsActive(ClientPtr client)
+{
+ REQUEST(xXineramaIsActiveReq);
+
+ TRACE();
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
+ return ProcPseudoramiXIsActive(client);
+}
+
+
+static int
+SProcPseudoramiXQueryScreens(ClientPtr client)
+{
+ REQUEST(xXineramaQueryScreensReq);
+
+ TRACE();
+
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
+ return ProcPseudoramiXQueryScreens(client);
+}
+
+
+static int
+SProcPseudoramiXDispatch (ClientPtr client)
+{ REQUEST(xReq);
+
+ TRACE();
+
+ switch (stuff->data)
+ {
+ case X_PanoramiXQueryVersion:
+ return SProcPseudoramiXQueryVersion(client);
+ case X_PanoramiXGetState:
+ return SProcPseudoramiXGetState(client);
+ case X_PanoramiXGetScreenCount:
+ return SProcPseudoramiXGetScreenCount(client);
+ case X_PanoramiXGetScreenSize:
+ return SProcPseudoramiXGetScreenSize(client);
+ case X_XineramaIsActive:
+ return SProcPseudoramiXIsActive(client);
+ case X_XineramaQueryScreens:
+ return SProcPseudoramiXQueryScreens(client);
+ }
+ return BadRequest;
+}
diff --git a/xorg-server/hw/xquartz/xpr/appledri.c b/xorg-server/hw/xquartz/xpr/appledri.c
index d42661c22..1304d5a43 100644
--- a/xorg-server/hw/xquartz/xpr/appledri.c
+++ b/xorg-server/hw/xquartz/xpr/appledri.c
@@ -1,420 +1,418 @@
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-Copyright 2000 VA Linux Systems, Inc.
-Copyright (c) 2002, 2009 Apple Computer, Inc.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Authors:
- * Kevin E. Martin <martin@valinux.com>
- * Jens Owen <jens@valinux.com>
- * Rickard E. (Rik) Faith <faith@valinux.com>
- *
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-#define _APPLEDRI_SERVER_
-#include "appledristr.h"
-#include "swaprep.h"
-#include "dri.h"
-#include "dristruct.h"
-#include "xpr.h"
-#include "x-hash.h"
-#include "protocol-versions.h"
-
-static int DRIErrorBase = 0;
-
-
-static void AppleDRIResetProc(ExtensionEntry* extEntry);
-static int ProcAppleDRICreatePixmap(ClientPtr client);
-
-static unsigned char DRIReqCode = 0;
-static int DRIEventBase = 0;
-
-static void SNotifyEvent(xAppleDRINotifyEvent *from, xAppleDRINotifyEvent *to);
-
-typedef struct _DRIEvent *DRIEventPtr;
-typedef struct _DRIEvent {
- DRIEventPtr next;
- ClientPtr client;
- XID clientResource;
- unsigned int mask;
-} DRIEventRec;
-
-/*ARGSUSED*/
-static void
-AppleDRIResetProc (
- ExtensionEntry* extEntry
-)
-{
- DRIReset();
-}
-
-static int
-ProcAppleDRIQueryVersion(
- register ClientPtr client
-)
-{
- xAppleDRIQueryVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xAppleDRIQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = SERVER_APPLEDRI_MAJOR_VERSION;
- rep.minorVersion = SERVER_APPLEDRI_MINOR_VERSION;
- rep.patchVersion = SERVER_APPLEDRI_PATCH_VERSION;
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- }
- WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), (char *)&rep);
- return Success;
-}
-
-
-/* surfaces */
-
-static int
-ProcAppleDRIQueryDirectRenderingCapable(
- register ClientPtr client
-)
-{
- xAppleDRIQueryDirectRenderingCapableReply rep;
- Bool isCapable;
-
- REQUEST(xAppleDRIQueryDirectRenderingCapableReq);
- REQUEST_SIZE_MATCH(xAppleDRIQueryDirectRenderingCapableReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- if (!DRIQueryDirectRenderingCapable( screenInfo.screens[stuff->screen],
- &isCapable)) {
- return BadValue;
- }
- rep.isCapable = isCapable;
-
- if (!LocalClient(client))
- rep.isCapable = 0;
-
- WriteToClient(client,
- sizeof(xAppleDRIQueryDirectRenderingCapableReply), (char *)&rep);
- return Success;
-}
-
-static int
-ProcAppleDRIAuthConnection(
- register ClientPtr client
-)
-{
- xAppleDRIAuthConnectionReply rep;
-
- REQUEST(xAppleDRIAuthConnectionReq);
- REQUEST_SIZE_MATCH(xAppleDRIAuthConnectionReq);
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.authenticated = 1;
-
- if (!DRIAuthConnection( screenInfo.screens[stuff->screen], stuff->magic)) {
- ErrorF("Failed to authenticate %u\n", (unsigned int)stuff->magic);
- rep.authenticated = 0;
- }
- WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), (char *)&rep);
- return Success;
-}
-
-static void surface_notify(
- void *_arg,
- void *data
-)
-{
- DRISurfaceNotifyArg *arg = _arg;
- int client_index = (int) x_cvt_vptr_to_uint(data);
- xAppleDRINotifyEvent se;
-
- if (client_index < 0 || client_index >= currentMaxClients)
- return;
-
- se.type = DRIEventBase + AppleDRISurfaceNotify;
- se.kind = arg->kind;
- se.arg = arg->id;
- se.time = currentTime.milliseconds;
- WriteEventsToClient (clients[client_index], 1, (xEvent *) &se);
-}
-
-static int
-ProcAppleDRICreateSurface(
- ClientPtr client
-)
-{
- xAppleDRICreateSurfaceReply rep;
- DrawablePtr pDrawable;
- xp_surface_id sid;
- unsigned int key[2];
- int rc;
-
- REQUEST(xAppleDRICreateSurfaceReq);
- REQUEST_SIZE_MATCH(xAppleDRICreateSurfaceReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
- DixReadAccess);
- if (rc != Success)
- return rc;
-
- rep.key_0 = rep.key_1 = rep.uid = 0;
-
- if (!DRICreateSurface( screenInfo.screens[stuff->screen],
- (Drawable)stuff->drawable, pDrawable,
- stuff->client_id, &sid, key,
- surface_notify,
- x_cvt_uint_to_vptr(client->index))) {
- return BadValue;
- }
-
- rep.key_0 = key[0];
- rep.key_1 = key[1];
- rep.uid = sid;
-
- WriteToClient(client, sizeof(xAppleDRICreateSurfaceReply), (char *)&rep);
- return Success;
-}
-
-static int
-ProcAppleDRIDestroySurface(
- register ClientPtr client
-)
-{
- int rc;
- REQUEST(xAppleDRIDestroySurfaceReq);
- DrawablePtr pDrawable;
- REQUEST_SIZE_MATCH(xAppleDRIDestroySurfaceReq);
-
- rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
- DixReadAccess);
- if (rc != Success)
- return rc;
-
- if (!DRIDestroySurface( screenInfo.screens[stuff->screen],
- (Drawable)stuff->drawable,
- pDrawable, NULL, NULL)) {
- return BadValue;
- }
-
- return Success;
-}
-
-static int
-ProcAppleDRICreatePixmap(ClientPtr client)
-{
- REQUEST(xAppleDRICreatePixmapReq);
- DrawablePtr pDrawable;
- int rc;
- char path[PATH_MAX];
- xAppleDRICreatePixmapReply rep;
- int width, height, pitch, bpp;
- void *ptr;
-
- REQUEST_SIZE_MATCH(xAppleDRICreatePixmapReq);
-
- rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
- DixReadAccess);
-
- if(rc != Success)
- return rc;
-
- if(!DRICreatePixmap(screenInfo.screens[stuff->screen],
- (Drawable)stuff->drawable,
- pDrawable,
- path, PATH_MAX)) {
- return BadValue;
- }
-
- if(!DRIGetPixmapData(pDrawable, &width, &height,
- &pitch, &bpp, &ptr)) {
- return BadValue;
- }
-
- rep.stringLength = strlen(path) + 1;
-
- /* No need for swapping, because this only runs if LocalClient is true. */
- rep.type = X_Reply;
- rep.length = sizeof(rep) + rep.stringLength;
- rep.sequenceNumber = client->sequence;
- rep.width = width;
- rep.height = height;
- rep.pitch = pitch;
- rep.bpp = bpp;
- rep.size = pitch * height;
-
- if(sizeof(rep) != sz_xAppleDRICreatePixmapReply)
- ErrorF("error sizeof(rep) is %zu\n", sizeof(rep));
-
- WriteReplyToClient(client, sizeof(rep), &rep);
- (void)WriteToClient(client, rep.stringLength, path);
-
- return Success;
-}
-
-static int
-ProcAppleDRIDestroyPixmap(ClientPtr client)
-{
- DrawablePtr pDrawable;
- int rc;
- REQUEST(xAppleDRIDestroyPixmapReq);
- REQUEST_SIZE_MATCH(xAppleDRIDestroyPixmapReq);
-
- rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
- DixReadAccess);
-
- if(rc != Success)
- return rc;
-
- DRIDestroyPixmap(pDrawable);
-
- return Success;
-}
-
-/* dispatch */
-
-static int
-ProcAppleDRIDispatch (
- register ClientPtr client
-)
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
- case X_AppleDRIQueryVersion:
- return ProcAppleDRIQueryVersion(client);
- case X_AppleDRIQueryDirectRenderingCapable:
- return ProcAppleDRIQueryDirectRenderingCapable(client);
- }
-
- if (!LocalClient(client))
- return DRIErrorBase + AppleDRIClientNotLocal;
-
- switch (stuff->data)
- {
- case X_AppleDRIAuthConnection:
- return ProcAppleDRIAuthConnection(client);
- case X_AppleDRICreateSurface:
- return ProcAppleDRICreateSurface(client);
- case X_AppleDRIDestroySurface:
- return ProcAppleDRIDestroySurface(client);
- case X_AppleDRICreatePixmap:
- return ProcAppleDRICreatePixmap(client);
- case X_AppleDRIDestroyPixmap:
- return ProcAppleDRIDestroyPixmap(client);
-
- default:
- return BadRequest;
- }
-}
-
-static void
-SNotifyEvent(
- xAppleDRINotifyEvent *from,
- xAppleDRINotifyEvent *to
-)
-{
- to->type = from->type;
- to->kind = from->kind;
- cpswaps (from->sequenceNumber, to->sequenceNumber);
- cpswapl (from->time, to->time);
- cpswapl (from->arg, to->arg);
-}
-
-static int
-SProcAppleDRIQueryVersion(
- register ClientPtr client
-)
-{
- register int n;
- REQUEST(xAppleDRIQueryVersionReq);
- swaps(&stuff->length, n);
- return ProcAppleDRIQueryVersion(client);
-}
-
-static int
-SProcAppleDRIDispatch (
- register ClientPtr client
-)
-{
- REQUEST(xReq);
-
- /* It is bound to be non-local when there is byte swapping */
- if (!LocalClient(client))
- return DRIErrorBase + AppleDRIClientNotLocal;
-
- /* only local clients are allowed DRI access */
- switch (stuff->data)
- {
- case X_AppleDRIQueryVersion:
- return SProcAppleDRIQueryVersion(client);
- default:
- return BadRequest;
- }
-}
-
-void
-AppleDRIExtensionInit(void)
-{
- ExtensionEntry* extEntry;
-
- if (DRIExtensionInit() &&
- (extEntry = AddExtension(APPLEDRINAME,
- AppleDRINumberEvents,
- AppleDRINumberErrors,
- ProcAppleDRIDispatch,
- SProcAppleDRIDispatch,
- AppleDRIResetProc,
- StandardMinorOpcode))) {
- DRIReqCode = (unsigned char)extEntry->base;
- DRIErrorBase = extEntry->errorBase;
- DRIEventBase = extEntry->eventBase;
- EventSwapVector[DRIEventBase] = (EventSwapPtr) SNotifyEvent;
- }
-}
+/**************************************************************************
+
+Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
+Copyright 2000 VA Linux Systems, Inc.
+Copyright (c) 2002, 2009 Apple Computer, Inc.
+All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+/*
+ * Authors:
+ * Kevin E. Martin <martin@valinux.com>
+ * Jens Owen <jens@valinux.com>
+ * Rickard E. (Rik) Faith <faith@valinux.com>
+ *
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "misc.h"
+#include "dixstruct.h"
+#include "extnsionst.h"
+#include "colormapst.h"
+#include "cursorstr.h"
+#include "scrnintstr.h"
+#include "servermd.h"
+#define _APPLEDRI_SERVER_
+#include "appledristr.h"
+#include "swaprep.h"
+#include "dri.h"
+#include "dristruct.h"
+#include "xpr.h"
+#include "x-hash.h"
+#include "protocol-versions.h"
+
+static int DRIErrorBase = 0;
+
+
+static void AppleDRIResetProc(ExtensionEntry* extEntry);
+static int ProcAppleDRICreatePixmap(ClientPtr client);
+
+static unsigned char DRIReqCode = 0;
+static int DRIEventBase = 0;
+
+static void SNotifyEvent(xAppleDRINotifyEvent *from, xAppleDRINotifyEvent *to);
+
+typedef struct _DRIEvent *DRIEventPtr;
+typedef struct _DRIEvent {
+ DRIEventPtr next;
+ ClientPtr client;
+ XID clientResource;
+ unsigned int mask;
+} DRIEventRec;
+
+/*ARGSUSED*/
+static void
+AppleDRIResetProc (
+ ExtensionEntry* extEntry
+)
+{
+ DRIReset();
+}
+
+static int
+ProcAppleDRIQueryVersion(
+ register ClientPtr client
+)
+{
+ xAppleDRIQueryVersionReply rep;
+
+ REQUEST_SIZE_MATCH(xAppleDRIQueryVersionReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.majorVersion = SERVER_APPLEDRI_MAJOR_VERSION;
+ rep.minorVersion = SERVER_APPLEDRI_MINOR_VERSION;
+ rep.patchVersion = SERVER_APPLEDRI_PATCH_VERSION;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ }
+ WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), (char *)&rep);
+ return Success;
+}
+
+
+/* surfaces */
+
+static int
+ProcAppleDRIQueryDirectRenderingCapable(
+ register ClientPtr client
+)
+{
+ xAppleDRIQueryDirectRenderingCapableReply rep;
+ Bool isCapable;
+
+ REQUEST(xAppleDRIQueryDirectRenderingCapableReq);
+ REQUEST_SIZE_MATCH(xAppleDRIQueryDirectRenderingCapableReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ if (!DRIQueryDirectRenderingCapable( screenInfo.screens[stuff->screen],
+ &isCapable)) {
+ return BadValue;
+ }
+ rep.isCapable = isCapable;
+
+ if (!LocalClient(client))
+ rep.isCapable = 0;
+
+ WriteToClient(client,
+ sizeof(xAppleDRIQueryDirectRenderingCapableReply), (char *)&rep);
+ return Success;
+}
+
+static int
+ProcAppleDRIAuthConnection(
+ register ClientPtr client
+)
+{
+ xAppleDRIAuthConnectionReply rep;
+
+ REQUEST(xAppleDRIAuthConnectionReq);
+ REQUEST_SIZE_MATCH(xAppleDRIAuthConnectionReq);
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.authenticated = 1;
+
+ if (!DRIAuthConnection( screenInfo.screens[stuff->screen], stuff->magic)) {
+ ErrorF("Failed to authenticate %u\n", (unsigned int)stuff->magic);
+ rep.authenticated = 0;
+ }
+ WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), (char *)&rep);
+ return Success;
+}
+
+static void surface_notify(
+ void *_arg,
+ void *data
+)
+{
+ DRISurfaceNotifyArg *arg = _arg;
+ int client_index = (int) x_cvt_vptr_to_uint(data);
+ xAppleDRINotifyEvent se;
+
+ if (client_index < 0 || client_index >= currentMaxClients)
+ return;
+
+ se.type = DRIEventBase + AppleDRISurfaceNotify;
+ se.kind = arg->kind;
+ se.arg = arg->id;
+ se.time = currentTime.milliseconds;
+ WriteEventsToClient (clients[client_index], 1, (xEvent *) &se);
+}
+
+static int
+ProcAppleDRICreateSurface(
+ ClientPtr client
+)
+{
+ xAppleDRICreateSurfaceReply rep;
+ DrawablePtr pDrawable;
+ xp_surface_id sid;
+ unsigned int key[2];
+ int rc;
+
+ REQUEST(xAppleDRICreateSurfaceReq);
+ REQUEST_SIZE_MATCH(xAppleDRICreateSurfaceReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
+ DixReadAccess);
+ if (rc != Success)
+ return rc;
+
+ rep.key_0 = rep.key_1 = rep.uid = 0;
+
+ if (!DRICreateSurface( screenInfo.screens[stuff->screen],
+ (Drawable)stuff->drawable, pDrawable,
+ stuff->client_id, &sid, key,
+ surface_notify,
+ x_cvt_uint_to_vptr(client->index))) {
+ return BadValue;
+ }
+
+ rep.key_0 = key[0];
+ rep.key_1 = key[1];
+ rep.uid = sid;
+
+ WriteToClient(client, sizeof(xAppleDRICreateSurfaceReply), (char *)&rep);
+ return Success;
+}
+
+static int
+ProcAppleDRIDestroySurface(
+ register ClientPtr client
+)
+{
+ int rc;
+ REQUEST(xAppleDRIDestroySurfaceReq);
+ DrawablePtr pDrawable;
+ REQUEST_SIZE_MATCH(xAppleDRIDestroySurfaceReq);
+
+ rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
+ DixReadAccess);
+ if (rc != Success)
+ return rc;
+
+ if (!DRIDestroySurface( screenInfo.screens[stuff->screen],
+ (Drawable)stuff->drawable,
+ pDrawable, NULL, NULL)) {
+ return BadValue;
+ }
+
+ return Success;
+}
+
+static int
+ProcAppleDRICreatePixmap(ClientPtr client)
+{
+ REQUEST(xAppleDRICreatePixmapReq);
+ DrawablePtr pDrawable;
+ int rc;
+ char path[PATH_MAX];
+ xAppleDRICreatePixmapReply rep;
+ int width, height, pitch, bpp;
+ void *ptr;
+
+ REQUEST_SIZE_MATCH(xAppleDRICreatePixmapReq);
+
+ rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
+ DixReadAccess);
+
+ if(rc != Success)
+ return rc;
+
+ if(!DRICreatePixmap(screenInfo.screens[stuff->screen],
+ (Drawable)stuff->drawable,
+ pDrawable,
+ path, PATH_MAX)) {
+ return BadValue;
+ }
+
+ if(!DRIGetPixmapData(pDrawable, &width, &height,
+ &pitch, &bpp, &ptr)) {
+ return BadValue;
+ }
+
+ rep.stringLength = strlen(path) + 1;
+
+ /* No need for swapping, because this only runs if LocalClient is true. */
+ rep.type = X_Reply;
+ rep.length = sizeof(rep) + rep.stringLength;
+ rep.sequenceNumber = client->sequence;
+ rep.width = width;
+ rep.height = height;
+ rep.pitch = pitch;
+ rep.bpp = bpp;
+ rep.size = pitch * height;
+
+ if(sizeof(rep) != sz_xAppleDRICreatePixmapReply)
+ ErrorF("error sizeof(rep) is %zu\n", sizeof(rep));
+
+ WriteReplyToClient(client, sizeof(rep), &rep);
+ (void)WriteToClient(client, rep.stringLength, path);
+
+ return Success;
+}
+
+static int
+ProcAppleDRIDestroyPixmap(ClientPtr client)
+{
+ DrawablePtr pDrawable;
+ int rc;
+ REQUEST(xAppleDRIDestroyPixmapReq);
+ REQUEST_SIZE_MATCH(xAppleDRIDestroyPixmapReq);
+
+ rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
+ DixReadAccess);
+
+ if(rc != Success)
+ return rc;
+
+ DRIDestroyPixmap(pDrawable);
+
+ return Success;
+}
+
+/* dispatch */
+
+static int
+ProcAppleDRIDispatch (
+ register ClientPtr client
+)
+{
+ REQUEST(xReq);
+
+ switch (stuff->data)
+ {
+ case X_AppleDRIQueryVersion:
+ return ProcAppleDRIQueryVersion(client);
+ case X_AppleDRIQueryDirectRenderingCapable:
+ return ProcAppleDRIQueryDirectRenderingCapable(client);
+ }
+
+ if (!LocalClient(client))
+ return DRIErrorBase + AppleDRIClientNotLocal;
+
+ switch (stuff->data)
+ {
+ case X_AppleDRIAuthConnection:
+ return ProcAppleDRIAuthConnection(client);
+ case X_AppleDRICreateSurface:
+ return ProcAppleDRICreateSurface(client);
+ case X_AppleDRIDestroySurface:
+ return ProcAppleDRIDestroySurface(client);
+ case X_AppleDRICreatePixmap:
+ return ProcAppleDRICreatePixmap(client);
+ case X_AppleDRIDestroyPixmap:
+ return ProcAppleDRIDestroyPixmap(client);
+
+ default:
+ return BadRequest;
+ }
+}
+
+static void
+SNotifyEvent(
+ xAppleDRINotifyEvent *from,
+ xAppleDRINotifyEvent *to
+)
+{
+ to->type = from->type;
+ to->kind = from->kind;
+ cpswaps (from->sequenceNumber, to->sequenceNumber);
+ cpswapl (from->time, to->time);
+ cpswapl (from->arg, to->arg);
+}
+
+static int
+SProcAppleDRIQueryVersion(
+ register ClientPtr client
+)
+{
+ REQUEST(xAppleDRIQueryVersionReq);
+ swaps(&stuff->length);
+ return ProcAppleDRIQueryVersion(client);
+}
+
+static int
+SProcAppleDRIDispatch (
+ register ClientPtr client
+)
+{
+ REQUEST(xReq);
+
+ /* It is bound to be non-local when there is byte swapping */
+ if (!LocalClient(client))
+ return DRIErrorBase + AppleDRIClientNotLocal;
+
+ /* only local clients are allowed DRI access */
+ switch (stuff->data)
+ {
+ case X_AppleDRIQueryVersion:
+ return SProcAppleDRIQueryVersion(client);
+ default:
+ return BadRequest;
+ }
+}
+
+void
+AppleDRIExtensionInit(void)
+{
+ ExtensionEntry* extEntry;
+
+ if (DRIExtensionInit() &&
+ (extEntry = AddExtension(APPLEDRINAME,
+ AppleDRINumberEvents,
+ AppleDRINumberErrors,
+ ProcAppleDRIDispatch,
+ SProcAppleDRIDispatch,
+ AppleDRIResetProc,
+ StandardMinorOpcode))) {
+ DRIReqCode = (unsigned char)extEntry->base;
+ DRIErrorBase = extEntry->errorBase;
+ DRIEventBase = extEntry->eventBase;
+ EventSwapVector[DRIEventBase] = (EventSwapPtr) SNotifyEvent;
+ }
+}
diff --git a/xorg-server/hw/xwin/winwindowswm.c b/xorg-server/hw/xwin/winwindowswm.c
index f839171e9..07e928874 100644
--- a/xorg-server/hw/xwin/winwindowswm.c
+++ b/xorg-server/hw/xwin/winwindowswm.c
@@ -1,612 +1,612 @@
-/* WindowsWM extension is based on AppleWM extension */
-/**************************************************************************
-
-Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
-Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-#ifdef HAVE_XWIN_CONFIG_H
-#include <xwin-config.h>
-#endif
-#include "win.h"
-
-#include "misc.h"
-#include "dixstruct.h"
-#include "extnsionst.h"
-#include "colormapst.h"
-#include "cursorstr.h"
-#include "scrnintstr.h"
-#include "servermd.h"
-#include "swaprep.h"
-#define _WINDOWSWM_SERVER_
-#include <X11/extensions/windowswmstr.h>
-#include "protocol-versions.h"
-
-static int WMErrorBase;
-static unsigned char WMReqCode = 0;
-static int WMEventBase = 0;
-
-static RESTYPE ClientType, eventResourceType; /* resource types for event masks */
-static XID eventResource;
-
-/* Currently selected events */
-static unsigned int eventMask = 0;
-
-static int WMFreeClient (pointer data, XID id);
-static int WMFreeEvents (pointer data, XID id);
-static void SNotifyEvent(xWindowsWMNotifyEvent *from, xWindowsWMNotifyEvent *to);
-
-typedef struct _WMEvent *WMEventPtr;
-typedef struct _WMEvent {
- WMEventPtr next;
- ClientPtr client;
- XID clientResource;
- unsigned int mask;
-} WMEventRec;
-
-static inline BoxRec
-make_box (int x, int y, int w, int h)
-{
- BoxRec r;
- r.x1 = x;
- r.y1 = y;
- r.x2 = x + w;
- r.y2 = y + h;
- return r;
-}
-
-static int
-ProcWindowsWMQueryVersion(ClientPtr client)
-{
- xWindowsWMQueryVersionReply rep;
- int n;
-
- REQUEST_SIZE_MATCH(xWindowsWMQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = SERVER_WINDOWSWM_MAJOR_VERSION;
- rep.minorVersion = SERVER_WINDOWSWM_MINOR_VERSION;
- rep.patchVersion = SERVER_WINDOWSWM_PATCH_VERSION;
- if (client->swapped)
- {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- }
- WriteToClient(client, sizeof(xWindowsWMQueryVersionReply), (char *)&rep);
- return Success;
-}
-
-
-/* events */
-
-static inline void
-updateEventMask (WMEventPtr *pHead)
-{
- WMEventPtr pCur;
-
- eventMask = 0;
- for (pCur = *pHead; pCur != NULL; pCur = pCur->next)
- eventMask |= pCur->mask;
-}
-
-/*ARGSUSED*/
-static int
-WMFreeClient (pointer data, XID id)
-{
- WMEventPtr pEvent;
- WMEventPtr *pHead, pCur, pPrev;
-
- pEvent = (WMEventPtr) data;
- dixLookupResourceByType((pointer) &pHead, eventResource, eventResourceType,
- NullClient, DixUnknownAccess);
- if (pHead)
- {
- pPrev = 0;
- for (pCur = *pHead; pCur && pCur != pEvent; pCur=pCur->next)
- pPrev = pCur;
- if (pCur)
- {
- if (pPrev)
- pPrev->next = pEvent->next;
- else
- *pHead = pEvent->next;
- }
- updateEventMask (pHead);
- }
- free((pointer) pEvent);
- return 1;
-}
-
-/*ARGSUSED*/
-static int
-WMFreeEvents (pointer data, XID id)
-{
- WMEventPtr *pHead, pCur, pNext;
-
- pHead = (WMEventPtr *) data;
- for (pCur = *pHead; pCur; pCur = pNext)
- {
- pNext = pCur->next;
- FreeResource (pCur->clientResource, ClientType);
- free((pointer) pCur);
- }
- free((pointer) pHead);
- eventMask = 0;
- return 1;
-}
-
-static int
-ProcWindowsWMSelectInput (ClientPtr client)
-{
- REQUEST(xWindowsWMSelectInputReq);
- WMEventPtr pEvent, pNewEvent, *pHead;
- XID clientResource;
-
- REQUEST_SIZE_MATCH (xWindowsWMSelectInputReq);
- dixLookupResourceByType((pointer) &pHead, eventResource, eventResourceType, client, DixWriteAccess);
- if (stuff->mask != 0)
- {
- if (pHead)
- {
- /* check for existing entry. */
- for (pEvent = *pHead; pEvent; pEvent = pEvent->next)
- {
- if (pEvent->client == client)
- {
- pEvent->mask = stuff->mask;
- updateEventMask (pHead);
- return Success;
- }
- }
- }
-
- /* build the entry */
- pNewEvent = (WMEventPtr) malloc(sizeof (WMEventRec));
- if (!pNewEvent)
- return BadAlloc;
- pNewEvent->next = 0;
- pNewEvent->client = client;
- pNewEvent->mask = stuff->mask;
- /*
- * add a resource that will be deleted when
- * the client goes away
- */
- clientResource = FakeClientID (client->index);
- pNewEvent->clientResource = clientResource;
- if (!AddResource (clientResource, ClientType, (pointer)pNewEvent))
- return BadAlloc;
- /*
- * create a resource to contain a pointer to the list
- * of clients selecting input. This must be indirect as
- * the list may be arbitrarily rearranged which cannot be
- * done through the resource database.
- */
- if (!pHead)
- {
- pHead = (WMEventPtr *) malloc(sizeof (WMEventPtr));
- if (!pHead ||
- !AddResource (eventResource, eventResourceType, (pointer)pHead))
- {
- FreeResource (clientResource, RT_NONE);
- return BadAlloc;
- }
- *pHead = 0;
- }
- pNewEvent->next = *pHead;
- *pHead = pNewEvent;
- updateEventMask (pHead);
- }
- else if (stuff->mask == 0)
- {
- /* delete the interest */
- if (pHead)
- {
- pNewEvent = 0;
- for (pEvent = *pHead; pEvent; pEvent = pEvent->next)
- {
- if (pEvent->client == client)
- break;
- pNewEvent = pEvent;
- }
- if (pEvent)
- {
- FreeResource (pEvent->clientResource, ClientType);
- if (pNewEvent)
- pNewEvent->next = pEvent->next;
- else
- *pHead = pEvent->next;
- free(pEvent);
- updateEventMask (pHead);
- }
- }
- }
- else
- {
- client->errorValue = stuff->mask;
- return BadValue;
- }
- return Success;
-}
-
-/*
- * deliver the event
- */
-
-void
-winWindowsWMSendEvent (int type, unsigned int mask, int which, int arg,
- Window window, int x, int y, int w, int h)
-{
- WMEventPtr *pHead, pEvent;
- ClientPtr client;
- xWindowsWMNotifyEvent se;
- winDebug ("winWindowsWMSendEvent %d %d %d %d, %d %d - %d %d\n",
- type, mask, which, arg, x, y, w, h);
- dixLookupResourceByType((pointer) &pHead, eventResource, eventResourceType,
- NullClient, DixUnknownAccess);
- if (!pHead)
- return;
- for (pEvent = *pHead; pEvent; pEvent = pEvent->next)
- {
- client = pEvent->client;
- winDebug ("winWindowsWMSendEvent - x%08x\n", (int) client);
- if ((pEvent->mask & mask) == 0)
- {
- continue;
- }
- winDebug ("winWindowsWMSendEvent - send\n");
-
- se.type = type + WMEventBase;
- se.kind = which;
- se.window = window;
- se.arg = arg;
- se.x = x;
- se.y = y;
- se.w = w;
- se.h = h;
- se.time = currentTime.milliseconds;
- WriteEventsToClient (client, 1, (xEvent *) &se);
- }
-}
-
-/* general utility functions */
-
-static int
-ProcWindowsWMDisableUpdate (ClientPtr client)
-{
- REQUEST_SIZE_MATCH(xWindowsWMDisableUpdateReq);
-
- //winDisableUpdate();
-
- return Success;
-}
-
-static int
-ProcWindowsWMReenableUpdate (ClientPtr client)
-{
- REQUEST_SIZE_MATCH(xWindowsWMReenableUpdateReq);
-
- //winEnableUpdate();
-
- return Success;
-}
-
-
-/* window functions */
-
-static int
-ProcWindowsWMSetFrontProcess (ClientPtr client)
-{
- REQUEST_SIZE_MATCH(xWindowsWMSetFrontProcessReq);
-
- //QuartzMessageMainThread(kWindowsSetFrontProcess, NULL, 0);
-
- return Success;
-}
-
-
-/* frame functions */
-
-static int
-ProcWindowsWMFrameGetRect (ClientPtr client)
-{
- xWindowsWMFrameGetRectReply rep;
- BoxRec ir;
- RECT rcNew;
- REQUEST(xWindowsWMFrameGetRectReq);
-
- winDebug ("ProcWindowsWMFrameGetRect %d %d\n",
- (sizeof(xWindowsWMFrameGetRectReq) >> 2), (int) client->req_len);
-
- REQUEST_SIZE_MATCH(xWindowsWMFrameGetRectReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
-
- ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih);
-
- if (stuff->frame_rect != 0)
- {
- ErrorF ("ProcWindowsWMFrameGetRect - stuff->frame_rect != 0\n");
- return BadValue;
- }
-
- /* Store the origin, height, and width in a rectangle structure */
- SetRect (&rcNew, stuff->ix, stuff->iy,
- stuff->ix + stuff->iw, stuff->iy + stuff->ih);
-
- winDebug ("ProcWindowsWMFrameGetRect - %d %d %d %d\n",
- stuff->ix, stuff->iy, stuff->ix + stuff->iw, stuff->iy + stuff->ih);
-
- /*
- * Calculate the required size of the Windows window rectangle,
- * given the size of the Windows window client area.
- */
- AdjustWindowRectEx (&rcNew, stuff->frame_style, FALSE, stuff->frame_style_ex);
- rep.x = rcNew.left;
- rep.y = rcNew.top;
- rep.w = rcNew.right - rcNew.left;
- rep.h = rcNew.bottom - rcNew.top;
- winDebug ("ProcWindowsWMFrameGetRect - %d %d %d %d\n",
- rep.x, rep.y, rep.w, rep.h);
-
- WriteToClient(client, sizeof(xWindowsWMFrameGetRectReply), (char *)&rep);
- return Success;
-}
-
-
-static int
-ProcWindowsWMFrameDraw (ClientPtr client)
-{
- REQUEST(xWindowsWMFrameDrawReq);
- WindowPtr pWin;
- win32RootlessWindowPtr pRLWinPriv;
- RECT rcNew;
- int nCmdShow, rc;
- RegionRec newShape;
-
- REQUEST_SIZE_MATCH (xWindowsWMFrameDrawReq);
-
- winDebug ("ProcWindowsWMFrameDraw\n");
-
- rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
- if (rc != Success)
- return rc;
-
- winDebug ("ProcWindowsWMFrameDraw - Window found\n");
-
- pRLWinPriv = (win32RootlessWindowPtr) RootlessFrameForWindow (pWin, TRUE);
- if (pRLWinPriv == 0) return BadWindow;
-
- winDebug ("ProcWindowsWMFrameDraw - HWND 0x%08x 0x%08x 0x%08x\n",
- (int) pRLWinPriv->hWnd, (int) stuff->frame_style,
- (int) stuff->frame_style_ex);
- winDebug ("ProcWindowsWMFrameDraw - %d %d %d %d\n",
- stuff->ix, stuff->iy, stuff->iw, stuff->ih);
-
- /* Store the origin, height, and width in a rectangle structure */
- SetRect (&rcNew, stuff->ix, stuff->iy,
- stuff->ix + stuff->iw, stuff->iy + stuff->ih);
-
- /*
- * Calculate the required size of the Windows window rectangle,
- * given the size of the Windows window client area.
- */
- AdjustWindowRectEx (&rcNew, stuff->frame_style, FALSE, stuff->frame_style_ex);
-
- /* Set the window extended style flags */
- if (!SetWindowLongPtr (pRLWinPriv->hWnd, GWL_EXSTYLE, stuff->frame_style_ex))
- {
- return BadValue;
- }
-
- /* Set the window standard style flags */
- if (!SetWindowLongPtr (pRLWinPriv->hWnd, GWL_STYLE, stuff->frame_style))
- {
- return BadValue;
- }
-
- /* Flush the window style */
- if (!SetWindowPos (pRLWinPriv->hWnd, NULL,
- rcNew.left, rcNew.top,
- rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
- SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOACTIVATE))
- {
- return BadValue;
- }
- if (!IsWindowVisible(pRLWinPriv->hWnd))
- nCmdShow = SW_HIDE;
- else
- nCmdShow = SW_SHOWNA;
-
- ShowWindow (pRLWinPriv->hWnd, nCmdShow);
-
- winMWExtWMUpdateIcon (pWin->drawable.id);
-
- if (wBoundingShape(pWin) != NULL)
- {
- /* wBoundingShape is relative to *inner* origin of window.
- Translate by borderWidth to get the outside-relative position. */
-
- RegionNull(&newShape);
- RegionCopy(&newShape, wBoundingShape(pWin));
- RegionTranslate(&newShape, pWin->borderWidth, pWin->borderWidth);
- winMWExtWMReshapeFrame (pRLWinPriv, &newShape);
- RegionUninit(&newShape);
- }
- winDebug ("ProcWindowsWMFrameDraw - done\n");
-
- return Success;
-}
-
-static int
-ProcWindowsWMFrameSetTitle(ClientPtr client)
-{
- unsigned int title_length, title_max;
- char *title_bytes;
- REQUEST(xWindowsWMFrameSetTitleReq);
- WindowPtr pWin;
- win32RootlessWindowPtr pRLWinPriv;
- int rc;
-
- winDebug ("ProcWindowsWMFrameSetTitle\n");
-
- REQUEST_AT_LEAST_SIZE(xWindowsWMFrameSetTitleReq);
-
- rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
- if (rc != Success)
- return rc;
- winDebug ("ProcWindowsWMFrameSetTitle - Window found\n");
-
- title_length = stuff->title_length;
- title_max = (stuff->length << 2) - sizeof(xWindowsWMFrameSetTitleReq);
-
- if (title_max < title_length)
- return BadValue;
-
- winDebug ("ProcWindowsWMFrameSetTitle - length is valid\n");
-
- title_bytes = malloc (title_length+1);
- strncpy (title_bytes, (unsigned char *) &stuff[1], title_length);
- title_bytes[title_length] = '\0';
-
- pRLWinPriv = (win32RootlessWindowPtr) RootlessFrameForWindow (pWin, FALSE);
-
- if (pRLWinPriv == 0)
- {
- free (title_bytes);
- return BadWindow;
- }
-
- /* Flush the window style */
- SetWindowText (pRLWinPriv->hWnd, title_bytes);
-
- free (title_bytes);
-
- winDebug ("ProcWindowsWMFrameSetTitle - done\n");
-
- return Success;
-}
-
-
-/* dispatch */
-
-static int
-ProcWindowsWMDispatch (ClientPtr client)
-{
- REQUEST(xReq);
-
- switch (stuff->data)
- {
- case X_WindowsWMQueryVersion:
- return ProcWindowsWMQueryVersion(client);
- }
-
- if (!LocalClient(client))
- return WMErrorBase + WindowsWMClientNotLocal;
-
- switch (stuff->data)
- {
- case X_WindowsWMSelectInput:
- return ProcWindowsWMSelectInput(client);
- case X_WindowsWMDisableUpdate:
- return ProcWindowsWMDisableUpdate(client);
- case X_WindowsWMReenableUpdate:
- return ProcWindowsWMReenableUpdate(client);
- case X_WindowsWMSetFrontProcess:
- return ProcWindowsWMSetFrontProcess(client);
- case X_WindowsWMFrameGetRect:
- return ProcWindowsWMFrameGetRect(client);
- case X_WindowsWMFrameDraw:
- return ProcWindowsWMFrameDraw(client);
- case X_WindowsWMFrameSetTitle:
- return ProcWindowsWMFrameSetTitle(client);
- default:
- return BadRequest;
- }
-}
-
-static void
-SNotifyEvent (xWindowsWMNotifyEvent *from, xWindowsWMNotifyEvent *to)
-{
- to->type = from->type;
- to->kind = from->kind;
- cpswaps (from->sequenceNumber, to->sequenceNumber);
- cpswapl (from->window, to->window);
- cpswapl (from->time, to->time);
- cpswapl (from->arg, to->arg);
-}
-
-static int
-SProcWindowsWMQueryVersion (ClientPtr client)
-{
- int n;
- REQUEST(xWindowsWMQueryVersionReq);
- swaps(&stuff->length, n);
- return ProcWindowsWMQueryVersion(client);
-}
-
-static int
-SProcWindowsWMDispatch (ClientPtr client)
-{
- REQUEST(xReq);
-
- /* It is bound to be non-local when there is byte swapping */
- if (!LocalClient(client))
- return WMErrorBase + WindowsWMClientNotLocal;
-
- /* only local clients are allowed WM access */
- switch (stuff->data)
- {
- case X_WindowsWMQueryVersion:
- return SProcWindowsWMQueryVersion(client);
- default:
- return BadRequest;
- }
-}
-
-void
-winWindowsWMExtensionInit (void)
-{
- ExtensionEntry* extEntry;
-
- ClientType = CreateNewResourceType(WMFreeClient, "WMClient");
- eventResourceType = CreateNewResourceType(WMFreeEvents, "WMEvent");
- eventResource = FakeClientID(0);
-
- if (ClientType && eventResourceType &&
- (extEntry = AddExtension(WINDOWSWMNAME,
- WindowsWMNumberEvents,
- WindowsWMNumberErrors,
- ProcWindowsWMDispatch,
- SProcWindowsWMDispatch,
- NULL,
- StandardMinorOpcode)))
- {
- WMReqCode = (unsigned char)extEntry->base;
- WMErrorBase = extEntry->errorBase;
- WMEventBase = extEntry->eventBase;
- EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent;
- }
-}
+/* WindowsWM extension is based on AppleWM extension */
+/**************************************************************************
+
+Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
+Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+#include "win.h"
+
+#include "misc.h"
+#include "dixstruct.h"
+#include "extnsionst.h"
+#include "colormapst.h"
+#include "cursorstr.h"
+#include "scrnintstr.h"
+#include "servermd.h"
+#include "swaprep.h"
+#define _WINDOWSWM_SERVER_
+#include <X11/extensions/windowswmstr.h>
+#include "protocol-versions.h"
+
+static int WMErrorBase;
+static unsigned char WMReqCode = 0;
+static int WMEventBase = 0;
+
+static RESTYPE ClientType, eventResourceType; /* resource types for event masks */
+static XID eventResource;
+
+/* Currently selected events */
+static unsigned int eventMask = 0;
+
+static int WMFreeClient (pointer data, XID id);
+static int WMFreeEvents (pointer data, XID id);
+static void SNotifyEvent(xWindowsWMNotifyEvent *from, xWindowsWMNotifyEvent *to);
+
+typedef struct _WMEvent *WMEventPtr;
+typedef struct _WMEvent {
+ WMEventPtr next;
+ ClientPtr client;
+ XID clientResource;
+ unsigned int mask;
+} WMEventRec;
+
+static inline BoxRec
+make_box (int x, int y, int w, int h)
+{
+ BoxRec r;
+ r.x1 = x;
+ r.y1 = y;
+ r.x2 = x + w;
+ r.y2 = y + h;
+ return r;
+}
+
+static int
+ProcWindowsWMQueryVersion(ClientPtr client)
+{
+ xWindowsWMQueryVersionReply rep;
+ int n;
+
+ REQUEST_SIZE_MATCH(xWindowsWMQueryVersionReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.majorVersion = SERVER_WINDOWSWM_MAJOR_VERSION;
+ rep.minorVersion = SERVER_WINDOWSWM_MINOR_VERSION;
+ rep.patchVersion = SERVER_WINDOWSWM_PATCH_VERSION;
+ if (client->swapped)
+ {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ }
+ WriteToClient(client, sizeof(xWindowsWMQueryVersionReply), (char *)&rep);
+ return Success;
+}
+
+
+/* events */
+
+static inline void
+updateEventMask (WMEventPtr *pHead)
+{
+ WMEventPtr pCur;
+
+ eventMask = 0;
+ for (pCur = *pHead; pCur != NULL; pCur = pCur->next)
+ eventMask |= pCur->mask;
+}
+
+/*ARGSUSED*/
+static int
+WMFreeClient (pointer data, XID id)
+{
+ WMEventPtr pEvent;
+ WMEventPtr *pHead, pCur, pPrev;
+
+ pEvent = (WMEventPtr) data;
+ dixLookupResourceByType((pointer) &pHead, eventResource, eventResourceType,
+ NullClient, DixUnknownAccess);
+ if (pHead)
+ {
+ pPrev = 0;
+ for (pCur = *pHead; pCur && pCur != pEvent; pCur=pCur->next)
+ pPrev = pCur;
+ if (pCur)
+ {
+ if (pPrev)
+ pPrev->next = pEvent->next;
+ else
+ *pHead = pEvent->next;
+ }
+ updateEventMask (pHead);
+ }
+ free((pointer) pEvent);
+ return 1;
+}
+
+/*ARGSUSED*/
+static int
+WMFreeEvents (pointer data, XID id)
+{
+ WMEventPtr *pHead, pCur, pNext;
+
+ pHead = (WMEventPtr *) data;
+ for (pCur = *pHead; pCur; pCur = pNext)
+ {
+ pNext = pCur->next;
+ FreeResource (pCur->clientResource, ClientType);
+ free((pointer) pCur);
+ }
+ free((pointer) pHead);
+ eventMask = 0;
+ return 1;
+}
+
+static int
+ProcWindowsWMSelectInput (ClientPtr client)
+{
+ REQUEST(xWindowsWMSelectInputReq);
+ WMEventPtr pEvent, pNewEvent, *pHead;
+ XID clientResource;
+
+ REQUEST_SIZE_MATCH (xWindowsWMSelectInputReq);
+ dixLookupResourceByType((pointer) &pHead, eventResource, eventResourceType, client, DixWriteAccess);
+ if (stuff->mask != 0)
+ {
+ if (pHead)
+ {
+ /* check for existing entry. */
+ for (pEvent = *pHead; pEvent; pEvent = pEvent->next)
+ {
+ if (pEvent->client == client)
+ {
+ pEvent->mask = stuff->mask;
+ updateEventMask (pHead);
+ return Success;
+ }
+ }
+ }
+
+ /* build the entry */
+ pNewEvent = (WMEventPtr) malloc(sizeof (WMEventRec));
+ if (!pNewEvent)
+ return BadAlloc;
+ pNewEvent->next = 0;
+ pNewEvent->client = client;
+ pNewEvent->mask = stuff->mask;
+ /*
+ * add a resource that will be deleted when
+ * the client goes away
+ */
+ clientResource = FakeClientID (client->index);
+ pNewEvent->clientResource = clientResource;
+ if (!AddResource (clientResource, ClientType, (pointer)pNewEvent))
+ return BadAlloc;
+ /*
+ * create a resource to contain a pointer to the list
+ * of clients selecting input. This must be indirect as
+ * the list may be arbitrarily rearranged which cannot be
+ * done through the resource database.
+ */
+ if (!pHead)
+ {
+ pHead = (WMEventPtr *) malloc(sizeof (WMEventPtr));
+ if (!pHead ||
+ !AddResource (eventResource, eventResourceType, (pointer)pHead))
+ {
+ FreeResource (clientResource, RT_NONE);
+ return BadAlloc;
+ }
+ *pHead = 0;
+ }
+ pNewEvent->next = *pHead;
+ *pHead = pNewEvent;
+ updateEventMask (pHead);
+ }
+ else if (stuff->mask == 0)
+ {
+ /* delete the interest */
+ if (pHead)
+ {
+ pNewEvent = 0;
+ for (pEvent = *pHead; pEvent; pEvent = pEvent->next)
+ {
+ if (pEvent->client == client)
+ break;
+ pNewEvent = pEvent;
+ }
+ if (pEvent)
+ {
+ FreeResource (pEvent->clientResource, ClientType);
+ if (pNewEvent)
+ pNewEvent->next = pEvent->next;
+ else
+ *pHead = pEvent->next;
+ free(pEvent);
+ updateEventMask (pHead);
+ }
+ }
+ }
+ else
+ {
+ client->errorValue = stuff->mask;
+ return BadValue;
+ }
+ return Success;
+}
+
+/*
+ * deliver the event
+ */
+
+void
+winWindowsWMSendEvent (int type, unsigned int mask, int which, int arg,
+ Window window, int x, int y, int w, int h)
+{
+ WMEventPtr *pHead, pEvent;
+ ClientPtr client;
+ xWindowsWMNotifyEvent se;
+ winDebug ("winWindowsWMSendEvent %d %d %d %d, %d %d - %d %d\n",
+ type, mask, which, arg, x, y, w, h);
+ dixLookupResourceByType((pointer) &pHead, eventResource, eventResourceType,
+ NullClient, DixUnknownAccess);
+ if (!pHead)
+ return;
+ for (pEvent = *pHead; pEvent; pEvent = pEvent->next)
+ {
+ client = pEvent->client;
+ winDebug ("winWindowsWMSendEvent - x%08x\n", (int) client);
+ if ((pEvent->mask & mask) == 0)
+ {
+ continue;
+ }
+ winDebug ("winWindowsWMSendEvent - send\n");
+
+ se.type = type + WMEventBase;
+ se.kind = which;
+ se.window = window;
+ se.arg = arg;
+ se.x = x;
+ se.y = y;
+ se.w = w;
+ se.h = h;
+ se.time = currentTime.milliseconds;
+ WriteEventsToClient (client, 1, (xEvent *) &se);
+ }
+}
+
+/* general utility functions */
+
+static int
+ProcWindowsWMDisableUpdate (ClientPtr client)
+{
+ REQUEST_SIZE_MATCH(xWindowsWMDisableUpdateReq);
+
+ //winDisableUpdate();
+
+ return Success;
+}
+
+static int
+ProcWindowsWMReenableUpdate (ClientPtr client)
+{
+ REQUEST_SIZE_MATCH(xWindowsWMReenableUpdateReq);
+
+ //winEnableUpdate();
+
+ return Success;
+}
+
+
+/* window functions */
+
+static int
+ProcWindowsWMSetFrontProcess (ClientPtr client)
+{
+ REQUEST_SIZE_MATCH(xWindowsWMSetFrontProcessReq);
+
+ //QuartzMessageMainThread(kWindowsSetFrontProcess, NULL, 0);
+
+ return Success;
+}
+
+
+/* frame functions */
+
+static int
+ProcWindowsWMFrameGetRect (ClientPtr client)
+{
+ xWindowsWMFrameGetRectReply rep;
+ BoxRec ir;
+ RECT rcNew;
+ REQUEST(xWindowsWMFrameGetRectReq);
+
+ winDebug ("ProcWindowsWMFrameGetRect %d %d\n",
+ (sizeof(xWindowsWMFrameGetRectReq) >> 2), (int) client->req_len);
+
+ REQUEST_SIZE_MATCH(xWindowsWMFrameGetRectReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+
+ ir = make_box (stuff->ix, stuff->iy, stuff->iw, stuff->ih);
+
+ if (stuff->frame_rect != 0)
+ {
+ ErrorF ("ProcWindowsWMFrameGetRect - stuff->frame_rect != 0\n");
+ return BadValue;
+ }
+
+ /* Store the origin, height, and width in a rectangle structure */
+ SetRect (&rcNew, stuff->ix, stuff->iy,
+ stuff->ix + stuff->iw, stuff->iy + stuff->ih);
+
+ winDebug ("ProcWindowsWMFrameGetRect - %d %d %d %d\n",
+ stuff->ix, stuff->iy, stuff->ix + stuff->iw, stuff->iy + stuff->ih);
+
+ /*
+ * Calculate the required size of the Windows window rectangle,
+ * given the size of the Windows window client area.
+ */
+ AdjustWindowRectEx (&rcNew, stuff->frame_style, FALSE, stuff->frame_style_ex);
+ rep.x = rcNew.left;
+ rep.y = rcNew.top;
+ rep.w = rcNew.right - rcNew.left;
+ rep.h = rcNew.bottom - rcNew.top;
+ winDebug ("ProcWindowsWMFrameGetRect - %d %d %d %d\n",
+ rep.x, rep.y, rep.w, rep.h);
+
+ WriteToClient(client, sizeof(xWindowsWMFrameGetRectReply), (char *)&rep);
+ return Success;
+}
+
+
+static int
+ProcWindowsWMFrameDraw (ClientPtr client)
+{
+ REQUEST(xWindowsWMFrameDrawReq);
+ WindowPtr pWin;
+ win32RootlessWindowPtr pRLWinPriv;
+ RECT rcNew;
+ int nCmdShow, rc;
+ RegionRec newShape;
+
+ REQUEST_SIZE_MATCH (xWindowsWMFrameDrawReq);
+
+ winDebug ("ProcWindowsWMFrameDraw\n");
+
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
+ if (rc != Success)
+ return rc;
+
+ winDebug ("ProcWindowsWMFrameDraw - Window found\n");
+
+ pRLWinPriv = (win32RootlessWindowPtr) RootlessFrameForWindow (pWin, TRUE);
+ if (pRLWinPriv == 0) return BadWindow;
+
+ winDebug ("ProcWindowsWMFrameDraw - HWND 0x%08x 0x%08x 0x%08x\n",
+ (int) pRLWinPriv->hWnd, (int) stuff->frame_style,
+ (int) stuff->frame_style_ex);
+ winDebug ("ProcWindowsWMFrameDraw - %d %d %d %d\n",
+ stuff->ix, stuff->iy, stuff->iw, stuff->ih);
+
+ /* Store the origin, height, and width in a rectangle structure */
+ SetRect (&rcNew, stuff->ix, stuff->iy,
+ stuff->ix + stuff->iw, stuff->iy + stuff->ih);
+
+ /*
+ * Calculate the required size of the Windows window rectangle,
+ * given the size of the Windows window client area.
+ */
+ AdjustWindowRectEx (&rcNew, stuff->frame_style, FALSE, stuff->frame_style_ex);
+
+ /* Set the window extended style flags */
+ if (!SetWindowLongPtr (pRLWinPriv->hWnd, GWL_EXSTYLE, stuff->frame_style_ex))
+ {
+ return BadValue;
+ }
+
+ /* Set the window standard style flags */
+ if (!SetWindowLongPtr (pRLWinPriv->hWnd, GWL_STYLE, stuff->frame_style))
+ {
+ return BadValue;
+ }
+
+ /* Flush the window style */
+ if (!SetWindowPos (pRLWinPriv->hWnd, NULL,
+ rcNew.left, rcNew.top,
+ rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
+ SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOACTIVATE))
+ {
+ return BadValue;
+ }
+ if (!IsWindowVisible(pRLWinPriv->hWnd))
+ nCmdShow = SW_HIDE;
+ else
+ nCmdShow = SW_SHOWNA;
+
+ ShowWindow (pRLWinPriv->hWnd, nCmdShow);
+
+ winMWExtWMUpdateIcon (pWin->drawable.id);
+
+ if (wBoundingShape(pWin) != NULL)
+ {
+ /* wBoundingShape is relative to *inner* origin of window.
+ Translate by borderWidth to get the outside-relative position. */
+
+ RegionNull(&newShape);
+ RegionCopy(&newShape, wBoundingShape(pWin));
+ RegionTranslate(&newShape, pWin->borderWidth, pWin->borderWidth);
+ winMWExtWMReshapeFrame (pRLWinPriv, &newShape);
+ RegionUninit(&newShape);
+ }
+ winDebug ("ProcWindowsWMFrameDraw - done\n");
+
+ return Success;
+}
+
+static int
+ProcWindowsWMFrameSetTitle(ClientPtr client)
+{
+ unsigned int title_length, title_max;
+ char *title_bytes;
+ REQUEST(xWindowsWMFrameSetTitleReq);
+ WindowPtr pWin;
+ win32RootlessWindowPtr pRLWinPriv;
+ int rc;
+
+ winDebug ("ProcWindowsWMFrameSetTitle\n");
+
+ REQUEST_AT_LEAST_SIZE(xWindowsWMFrameSetTitleReq);
+
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
+ if (rc != Success)
+ return rc;
+ winDebug ("ProcWindowsWMFrameSetTitle - Window found\n");
+
+ title_length = stuff->title_length;
+ title_max = (stuff->length << 2) - sizeof(xWindowsWMFrameSetTitleReq);
+
+ if (title_max < title_length)
+ return BadValue;
+
+ winDebug ("ProcWindowsWMFrameSetTitle - length is valid\n");
+
+ title_bytes = malloc (title_length+1);
+ strncpy (title_bytes, (unsigned char *) &stuff[1], title_length);
+ title_bytes[title_length] = '\0';
+
+ pRLWinPriv = (win32RootlessWindowPtr) RootlessFrameForWindow (pWin, FALSE);
+
+ if (pRLWinPriv == 0)
+ {
+ free (title_bytes);
+ return BadWindow;
+ }
+
+ /* Flush the window style */
+ SetWindowText (pRLWinPriv->hWnd, title_bytes);
+
+ free (title_bytes);
+
+ winDebug ("ProcWindowsWMFrameSetTitle - done\n");
+
+ return Success;
+}
+
+
+/* dispatch */
+
+static int
+ProcWindowsWMDispatch (ClientPtr client)
+{
+ REQUEST(xReq);
+
+ switch (stuff->data)
+ {
+ case X_WindowsWMQueryVersion:
+ return ProcWindowsWMQueryVersion(client);
+ }
+
+ if (!LocalClient(client))
+ return WMErrorBase + WindowsWMClientNotLocal;
+
+ switch (stuff->data)
+ {
+ case X_WindowsWMSelectInput:
+ return ProcWindowsWMSelectInput(client);
+ case X_WindowsWMDisableUpdate:
+ return ProcWindowsWMDisableUpdate(client);
+ case X_WindowsWMReenableUpdate:
+ return ProcWindowsWMReenableUpdate(client);
+ case X_WindowsWMSetFrontProcess:
+ return ProcWindowsWMSetFrontProcess(client);
+ case X_WindowsWMFrameGetRect:
+ return ProcWindowsWMFrameGetRect(client);
+ case X_WindowsWMFrameDraw:
+ return ProcWindowsWMFrameDraw(client);
+ case X_WindowsWMFrameSetTitle:
+ return ProcWindowsWMFrameSetTitle(client);
+ default:
+ return BadRequest;
+ }
+}
+
+static void
+SNotifyEvent (xWindowsWMNotifyEvent *from, xWindowsWMNotifyEvent *to)
+{
+ to->type = from->type;
+ to->kind = from->kind;
+ cpswaps (from->sequenceNumber, to->sequenceNumber);
+ cpswapl (from->window, to->window);
+ cpswapl (from->time, to->time);
+ cpswapl (from->arg, to->arg);
+}
+
+static int
+SProcWindowsWMQueryVersion (ClientPtr client)
+{
+ int n;
+ REQUEST(xWindowsWMQueryVersionReq);
+ swaps(&stuff->length);
+ return ProcWindowsWMQueryVersion(client);
+}
+
+static int
+SProcWindowsWMDispatch (ClientPtr client)
+{
+ REQUEST(xReq);
+
+ /* It is bound to be non-local when there is byte swapping */
+ if (!LocalClient(client))
+ return WMErrorBase + WindowsWMClientNotLocal;
+
+ /* only local clients are allowed WM access */
+ switch (stuff->data)
+ {
+ case X_WindowsWMQueryVersion:
+ return SProcWindowsWMQueryVersion(client);
+ default:
+ return BadRequest;
+ }
+}
+
+void
+winWindowsWMExtensionInit (void)
+{
+ ExtensionEntry* extEntry;
+
+ ClientType = CreateNewResourceType(WMFreeClient, "WMClient");
+ eventResourceType = CreateNewResourceType(WMFreeEvents, "WMEvent");
+ eventResource = FakeClientID(0);
+
+ if (ClientType && eventResourceType &&
+ (extEntry = AddExtension(WINDOWSWMNAME,
+ WindowsWMNumberEvents,
+ WindowsWMNumberErrors,
+ ProcWindowsWMDispatch,
+ SProcWindowsWMDispatch,
+ NULL,
+ StandardMinorOpcode)))
+ {
+ WMReqCode = (unsigned char)extEntry->base;
+ WMErrorBase = extEntry->errorBase;
+ WMEventBase = extEntry->eventBase;
+ EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent;
+ }
+}
diff --git a/xorg-server/include/colormapst.h b/xorg-server/include/colormapst.h
index b597e2c60..bb79c86d2 100644
--- a/xorg-server/include/colormapst.h
+++ b/xorg-server/include/colormapst.h
@@ -48,8 +48,6 @@ SOFTWARE.
#ifndef CMAPSTRUCT_H
#define CMAPSTRUCT_H 1
-#include <X11/Xarch.h>
-
#include "colormap.h"
#include "screenint.h"
#include "privates.h"
@@ -91,26 +89,15 @@ typedef struct _CMEntry
Bool fShared;
} Entry;
-/*
- * COLORMAPs can be used for either Direct or Pseudo color. PseudoColor
+/* COLORMAPs can be used for either Direct or Pseudo color. PseudoColor
* only needs one cell table, we arbitrarily pick red. We keep track
- * of that table with freeRed, numPixelsRed, and clientPixelsRed
- *
- * The padN variables are unfortunate ABI BC. See fdo bug #6924.
- */
+ * of that table with freeRed, numPixelsRed, and clientPixelsRed */
typedef struct _ColormapRec
{
VisualPtr pVisual;
short class; /* PseudoColor or DirectColor */
-#if defined(_LP64)
- short pad0;
- XID pad1;
-#endif
XID mid; /* client's name for colormap */
-#if defined(_LP64) && (X_BYTE_ORDER == X_LITTLE_ENDIAN)
- XID pad2;
-#endif
ScreenPtr pScreen; /* screen map is associated with */
short flags; /* 1 = IsDefault
* 2 = AllAllocated */
diff --git a/xorg-server/include/cursor.h b/xorg-server/include/cursor.h
index 39d829769..394383a04 100644
--- a/xorg-server/include/cursor.h
+++ b/xorg-server/include/cursor.h
@@ -1,140 +1,140 @@
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-
-#ifndef CURSOR_H
-#define CURSOR_H
-
-#include "misc.h"
-#include "screenint.h"
-#include "window.h"
-#include "privates.h"
-
-#define NullCursor ((CursorPtr)NULL)
-
-/* Provide support for alpha composited cursors */
-#define ARGB_CURSOR
-
-struct _DeviceIntRec;
-
-typedef struct _Cursor *CursorPtr;
-typedef struct _CursorMetric *CursorMetricPtr;
-
-extern _X_EXPORT DevPrivateKeyRec cursorScreenDevPriv[MAXSCREENS];
-#define CursorScreenKey(pScreen) (cursorScreenDevPriv + (pScreen)->myNum)
-
-extern _X_EXPORT CursorPtr rootCursor;
-
-extern _X_EXPORT int FreeCursor(
- pointer /*pCurs*/,
- XID /*cid*/);
-
-extern _X_EXPORT int AllocARGBCursor(
- unsigned char* /*psrcbits*/,
- unsigned char* /*pmaskbits*/,
- CARD32* /*argb*/,
- CursorMetricPtr /*cm*/,
- unsigned /*foreRed*/,
- unsigned /*foreGreen*/,
- unsigned /*foreBlue*/,
- unsigned /*backRed*/,
- unsigned /*backGreen*/,
- unsigned /*backBlue*/,
- CursorPtr* /*ppCurs*/,
- ClientPtr /*client*/,
- XID /*cid*/);
-
-extern _X_EXPORT int AllocGlyphCursor(
- Font /*source*/,
- unsigned int /*sourceChar*/,
- Font /*mask*/,
- unsigned int /*maskChar*/,
- unsigned /*foreRed*/,
- unsigned /*foreGreen*/,
- unsigned /*foreBlue*/,
- unsigned /*backRed*/,
- unsigned /*backGreen*/,
- unsigned /*backBlue*/,
- CursorPtr* /*ppCurs*/,
- ClientPtr /*client*/,
- XID /*cid*/);
-
-extern _X_EXPORT CursorPtr CreateRootCursor(
- char* /*pfilename*/,
- unsigned int /*glyph*/);
-
-extern _X_EXPORT int ServerBitsFromGlyph(
- FontPtr /*pfont*/,
- unsigned int /*ch*/,
- CursorMetricPtr /*cm*/,
- unsigned char ** /*ppbits*/);
-
-extern _X_EXPORT Bool CursorMetricsFromGlyph(
- FontPtr /*pfont*/,
- unsigned /*ch*/,
- CursorMetricPtr /*cm*/);
-
-extern _X_EXPORT void CheckCursorConfinement(
- WindowPtr /*pWin*/);
-
-extern _X_EXPORT void NewCurrentScreen(
- struct _DeviceIntRec* /*pDev*/,
- ScreenPtr /*newScreen*/,
- int /*x*/,
- int /*y*/);
-
-extern _X_EXPORT Bool PointerConfinedToScreen(struct _DeviceIntRec* /* pDev */);
-
-extern _X_EXPORT void GetSpritePosition(
- struct _DeviceIntRec* /* pDev */,
- int * /*px*/,
- int * /*py*/);
-
-#ifdef PANORAMIX
-extern _X_EXPORT int XineramaGetCursorScreen(struct _DeviceIntRec* pDev);
-#endif /* PANORAMIX */
-
-#endif /* CURSOR_H */
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+
+#ifndef CURSOR_H
+#define CURSOR_H
+
+#include "misc.h"
+#include "screenint.h"
+#include "window.h"
+#include "privates.h"
+
+#define NullCursor ((CursorPtr)NULL)
+
+/* Provide support for alpha composited cursors */
+#define ARGB_CURSOR
+
+struct _DeviceIntRec;
+
+typedef struct _Cursor *CursorPtr;
+typedef struct _CursorMetric *CursorMetricPtr;
+
+extern _X_EXPORT DevScreenPrivateKeyRec cursorScreenDevPriv;
+#define CursorScreenKey (&cursorScreenDevPriv)
+
+extern _X_EXPORT CursorPtr rootCursor;
+
+extern _X_EXPORT int FreeCursor(
+ pointer /*pCurs*/,
+ XID /*cid*/);
+
+extern _X_EXPORT int AllocARGBCursor(
+ unsigned char* /*psrcbits*/,
+ unsigned char* /*pmaskbits*/,
+ CARD32* /*argb*/,
+ CursorMetricPtr /*cm*/,
+ unsigned /*foreRed*/,
+ unsigned /*foreGreen*/,
+ unsigned /*foreBlue*/,
+ unsigned /*backRed*/,
+ unsigned /*backGreen*/,
+ unsigned /*backBlue*/,
+ CursorPtr* /*ppCurs*/,
+ ClientPtr /*client*/,
+ XID /*cid*/);
+
+extern _X_EXPORT int AllocGlyphCursor(
+ Font /*source*/,
+ unsigned int /*sourceChar*/,
+ Font /*mask*/,
+ unsigned int /*maskChar*/,
+ unsigned /*foreRed*/,
+ unsigned /*foreGreen*/,
+ unsigned /*foreBlue*/,
+ unsigned /*backRed*/,
+ unsigned /*backGreen*/,
+ unsigned /*backBlue*/,
+ CursorPtr* /*ppCurs*/,
+ ClientPtr /*client*/,
+ XID /*cid*/);
+
+extern _X_EXPORT CursorPtr CreateRootCursor(
+ char* /*pfilename*/,
+ unsigned int /*glyph*/);
+
+extern _X_EXPORT int ServerBitsFromGlyph(
+ FontPtr /*pfont*/,
+ unsigned int /*ch*/,
+ CursorMetricPtr /*cm*/,
+ unsigned char ** /*ppbits*/);
+
+extern _X_EXPORT Bool CursorMetricsFromGlyph(
+ FontPtr /*pfont*/,
+ unsigned /*ch*/,
+ CursorMetricPtr /*cm*/);
+
+extern _X_EXPORT void CheckCursorConfinement(
+ WindowPtr /*pWin*/);
+
+extern _X_EXPORT void NewCurrentScreen(
+ struct _DeviceIntRec* /*pDev*/,
+ ScreenPtr /*newScreen*/,
+ int /*x*/,
+ int /*y*/);
+
+extern _X_EXPORT Bool PointerConfinedToScreen(struct _DeviceIntRec* /* pDev */);
+
+extern _X_EXPORT void GetSpritePosition(
+ struct _DeviceIntRec* /* pDev */,
+ int * /*px*/,
+ int * /*py*/);
+
+#ifdef PANORAMIX
+extern _X_EXPORT int XineramaGetCursorScreen(struct _DeviceIntRec* pDev);
+#endif /* PANORAMIX */
+
+#endif /* CURSOR_H */
diff --git a/xorg-server/include/dix-config.h.in b/xorg-server/include/dix-config.h.in
index 4710ef881..5facb1106 100644
--- a/xorg-server/include/dix-config.h.in
+++ b/xorg-server/include/dix-config.h.in
@@ -209,9 +209,6 @@
*/
#undef HAVE_SYS_DIR_H
-/* Define to 1 if you have the <sys/io.h> header file. */
-#undef HAVE_SYS_IO_H
-
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
#undef HAVE_SYS_NDIR_H
@@ -225,9 +222,6 @@
/* Define to 1 if you have the <sys/utsname.h> header file. */
#undef HAVE_SYS_UTSNAME_H
-/* Define to 1 if you have the <sys/vm86.h> header file. */
-#undef HAVE_SYS_VM86_H
-
/* Define to 1 if you have the <tslib.h> header file. */
#undef HAVE_TSLIB_H
diff --git a/xorg-server/include/dixstruct.h b/xorg-server/include/dixstruct.h
index 2349893e9..10adc2c0e 100644
--- a/xorg-server/include/dixstruct.h
+++ b/xorg-server/include/dixstruct.h
@@ -57,12 +57,11 @@ extern _X_EXPORT void ReplyNotSwappd (
void * /* pbuf */) _X_NORETURN;
typedef enum {ClientStateInitial,
- ClientStateAuthenticating,
- ClientStateRunning,
+ /* 1 is unused now, was ClientStateAuthenticating */
+ ClientStateRunning = 2,
ClientStateRetained,
- ClientStateGone,
- ClientStateCheckingSecurity,
- ClientStateCheckedSecurity} ClientState;
+ ClientStateGone
+} ClientState;
#ifdef XFIXES
typedef struct _saveSet {
diff --git a/xorg-server/include/misc.h b/xorg-server/include/misc.h
index f0c92abeb..f437ef451 100644
--- a/xorg-server/include/misc.h
+++ b/xorg-server/include/misc.h
@@ -127,13 +127,19 @@ typedef struct _xReq *xReqPtr;
/* byte swap a 32-bit literal */
-#define lswapl(x) ((((x) & 0xff) << 24) |\
- (((x) & 0xff00) << 8) |\
- (((x) & 0xff0000) >> 8) |\
- (((x) >> 24) & 0xff))
+static inline uint32_t lswapl(uint32_t x)
+{
+ return ((x & 0xff) << 24) |
+ ((x & 0xff00) << 8) |
+ ((x & 0xff0000) >> 8) |
+ ((x >> 24) & 0xff);
+}
-/* byte swap a short literal */
-#define lswaps(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff))
+/* byte swap a 16-bit literal */
+static inline uint16_t lswaps(uint16_t x)
+{
+ return ((x & 0xff) << 8) | ((x >> 8) & 0xff);
+}
#undef min
#undef max
@@ -144,9 +150,6 @@ typedef struct _xReq *xReqPtr;
* it in case we haven't done that yet.
*/
#include <stdlib.h>
-#ifndef Fabs
-#define Fabs(a) ((a) > 0.0 ? (a) : -(a)) /* floating absolute value */
-#endif
#define sign(x) ((x) < 0 ? -1 : ((x) > 0 ? 1 : 0))
/* this assumes b > 0 */
#define modulus(a, b, d) if (((d) = (a) % (b)) < 0) (d) += (b)
@@ -263,32 +266,69 @@ version_compare(uint16_t a_major, uint16_t a_minor,
#define SwapRestL(stuff) \
SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff))
+#ifdef __GNUC__
+void __attribute__((error("wrong sized variable passed to swap"))) wrong_size(void);
+#else
+static inline void wrong_size(void)
+{
+}
+
+static inline void __builtin_constant_p(int x)
+{
+ return 0;
+}
+#endif
+
/* byte swap a 32-bit value */
-#define swapl(x, n) { \
- n = ((char *) (x))[0];\
- ((char *) (x))[0] = ((char *) (x))[3];\
- ((char *) (x))[3] = n;\
- n = ((char *) (x))[1];\
- ((char *) (x))[1] = ((char *) (x))[2];\
- ((char *) (x))[2] = n; }
-
-/* byte swap a short */
-#define swaps(x, n) { \
- n = ((char *) (x))[0];\
- ((char *) (x))[0] = ((char *) (x))[1];\
- ((char *) (x))[1] = n; }
+static inline void swap_uint32(uint32_t *x)
+{
+ char n = ((char *) &x)[0];
+ ((char *) x)[0] = ((char *) x)[3];
+ ((char *) x)[3] = n;
+ n = ((char *) x)[1];
+ ((char *) x)[1] = ((char *) x)[2];
+ ((char *) x)[2] = n;
+}
+
+#define swapl(x) do { \
+ if (sizeof(*(x)) != 4) \
+ wrong_size(); \
+ if (__builtin_constant_p((uintptr_t)(x) & 3) && ((uintptr_t)(x) & 3) == 0) \
+ *(x) = lswapl(*(x)); \
+ else \
+ swap_uint32((uint32_t *)(x)); \
+ } while (0)
+
+/* byte swap a 16-bit value */
+static inline void swap_uint16(uint16_t *x)
+{
+ char n = ((char *) x)[0];
+ ((char *) x)[0] = ((char *) x)[1];
+ ((char *) x)[1] = n;
+}
+
+#define swaps(x) do { \
+ if (sizeof(*(x)) != 2) \
+ wrong_size(); \
+ if (__builtin_constant_p((uintptr_t)(x) & 1) && ((uintptr_t)(x) & 1) == 0) \
+ *(x) = lswaps(*(x)); \
+ else \
+ swap_uint16((uint16_t *)(x)); \
+ } while (0)
/* copy 32-bit value from src to dst byteswapping on the way */
-#define cpswapl(src, dst) { \
- ((char *)&(dst))[0] = ((char *) &(src))[3];\
- ((char *)&(dst))[1] = ((char *) &(src))[2];\
- ((char *)&(dst))[2] = ((char *) &(src))[1];\
- ((char *)&(dst))[3] = ((char *) &(src))[0]; }
+#define cpswapl(src, dst) do { \
+ if (sizeof((src)) != 4 || sizeof((dst)) != 4) \
+ wrong_size(); \
+ (dst) = lswapl((src)); \
+ } while (0)
/* copy short from src to dst byteswapping on the way */
-#define cpswaps(src, dst) { \
- ((char *) &(dst))[0] = ((char *) &(src))[1];\
- ((char *) &(dst))[1] = ((char *) &(src))[0]; }
+#define cpswaps(src, dst) do { \
+ if (sizeof((src)) != 2 || sizeof((dst)) != 2) \
+ wrong_size(); \
+ (dst) = lswaps((src)); \
+ } while (0)
extern _X_EXPORT void SwapLongs(
CARD32 *list,
diff --git a/xorg-server/include/xorg-config.h.in b/xorg-server/include/xorg-config.h.in
index f2494af78..0d1ea9142 100644
--- a/xorg-server/include/xorg-config.h.in
+++ b/xorg-server/include/xorg-config.h.in
@@ -1,145 +1,142 @@
-/* xorg-config.h.in: not at all generated. -*- c -*-
- *
- * This file differs from xorg-server.h.in in that -server is installed
- * with the rest of the SDK for external drivers/modules to use, whereas
- * -config is for internal use only (i.e. building the DDX).
- *
- */
-
-#ifndef _XORG_CONFIG_H_
-#define _XORG_CONFIG_H_
-
-#include <dix-config.h>
-#include <xkb-config.h>
-
-/* Building Xorg server. */
-#undef XORGSERVER
-
-/* Current X.Org version. */
-#undef XORG_VERSION_CURRENT
-
-/* Name of X server. */
-#undef __XSERVERNAME__
-
-/* URL to go to for support. */
-#undef __VENDORDWEBSUPPORT__
-
-/* Built-in output drivers. */
-#undef DRIVERS
-
-/* Built-in input drivers. */
-#undef IDRIVERS
-
-/* Path to configuration file. */
-#undef XF86CONFIGFILE
-
-/* Path to configuration file. */
-#undef __XCONFIGFILE__
-
-/* Name of configuration directory. */
-#undef __XCONFIGDIR__
-
-/* Path to loadable modules. */
-#undef DEFAULT_MODULE_PATH
-
-/* Path to installed libraries. */
-#undef DEFAULT_LIBRARY_PATH
-
-/* Path to server log file. */
-#undef DEFAULT_LOGPREFIX
-
-/* Building DRI-capable DDX. */
-#undef XF86DRI
-
-/* Build DRI2 extension */
-#undef DRI2
-
-/* Define to 1 if you have the <stropts.h> header file. */
-#undef HAVE_STROPTS_H
-
-/* Define to 1 if you have the <sys/kd.h> header file. */
-#undef HAVE_SYS_KD_H
-
-/* Define to 1 if you have the <sys/vt.h> header file. */
-#undef HAVE_SYS_VT_H
-
-/* Define to 1 if you have the `walkcontext' function (used on Solaris for
- xorg_backtrace in hw/xfree86/common/xf86Events.c */
-#undef HAVE_WALKCONTEXT
-
-/* Define to 1 if unsigned long is 64 bits. */
-#undef _XSERVER64
-
-/* Building vgahw module */
-#undef WITH_VGAHW
-
-/* Define to 1 if NetBSD built-in MTRR support is available */
-#undef HAS_MTRR_BUILTIN
-
-/* Define to 1 if BSD MTRR support is available */
-#undef HAS_MTRR_SUPPORT
-
-/* NetBSD PIO alpha IO */
-#undef USE_ALPHA_PIO
-
-/* BSD AMD64 iopl */
-#undef USE_AMD64_IOPL
-
-/* BSD /dev/io */
-#undef USE_DEV_IO
-
-/* BSD i386 iopl */
-#undef USE_I386_IOPL
-
-/* System is BSD-like */
-#undef CSRG_BASED
-
-/* System has PC console */
-#undef PCCONS_SUPPORT
-
-/* System has PCVT console */
-#undef PCVT_SUPPORT
-
-/* System has syscons console */
-#undef SYSCONS_SUPPORT
-
-/* System has wscons console */
-#undef WSCONS_SUPPORT
-
-/* System has /dev/xf86 aperture driver */
-#undef HAS_APERTURE_DRV
-
-/* Has backtrace support */
-#undef HAVE_BACKTRACE
-
-/* Name of the period field in struct kbd_repeat */
-#undef LNX_KBD_PERIOD_NAME
-
-/* Have execinfo.h */
-#undef HAVE_EXECINFO_H
-
-/* Have pci_system_init_dev_mem() */
-#undef HAVE_PCI_SYSTEM_INIT_DEV_MEM
-
-/* Define to 1 if you have the `pci_device_is_boot_vga' function. */
-#undef HAVE_PCI_DEVICE_IS_BOOT_VGA
-
-/* Have pci_enable_device */
-#undef HAVE_PCI_DEVICE_ENABLE
-
-/* Define to 1 if you have the `pci_device_vgaarb_init' function. */
-#undef HAVE_PCI_DEVICE_VGAARB_INIT
-
-/* Path to text files containing PCI IDs */
-#undef PCI_TXT_IDS_PATH
-
-/* Use SIGIO handlers for input device events by default */
-#undef USE_SIGIO_BY_DEFAULT
-
-/* Support PC98 */
-#undef SUPPORT_PC98
-
-/* Build with libdrm support */
-#undef WITH_LIBDRM
-
-#endif /* _XORG_CONFIG_H_ */
+/* xorg-config.h.in: not at all generated. -*- c -*-
+ *
+ * This file differs from xorg-server.h.in in that -server is installed
+ * with the rest of the SDK for external drivers/modules to use, whereas
+ * -config is for internal use only (i.e. building the DDX).
+ *
+ */
+
+#ifndef _XORG_CONFIG_H_
+#define _XORG_CONFIG_H_
+
+#include <dix-config.h>
+#include <xkb-config.h>
+
+/* Building Xorg server. */
+#undef XORGSERVER
+
+/* Current X.Org version. */
+#undef XORG_VERSION_CURRENT
+
+/* Name of X server. */
+#undef __XSERVERNAME__
+
+/* URL to go to for support. */
+#undef __VENDORDWEBSUPPORT__
+
+/* Built-in output drivers. */
+#undef DRIVERS
+
+/* Built-in input drivers. */
+#undef IDRIVERS
+
+/* Path to configuration file. */
+#undef XF86CONFIGFILE
+
+/* Path to configuration file. */
+#undef __XCONFIGFILE__
+
+/* Name of configuration directory. */
+#undef __XCONFIGDIR__
+
+/* Path to loadable modules. */
+#undef DEFAULT_MODULE_PATH
+
+/* Path to installed libraries. */
+#undef DEFAULT_LIBRARY_PATH
+
+/* Path to server log file. */
+#undef DEFAULT_LOGPREFIX
+
+/* Building DRI-capable DDX. */
+#undef XF86DRI
+
+/* Build DRI2 extension */
+#undef DRI2
+
+/* Define to 1 if you have the <stropts.h> header file. */
+#undef HAVE_STROPTS_H
+
+/* Define to 1 if you have the <sys/kd.h> header file. */
+#undef HAVE_SYS_KD_H
+
+/* Define to 1 if you have the <sys/vt.h> header file. */
+#undef HAVE_SYS_VT_H
+
+/* Define to 1 if you have the `walkcontext' function (used on Solaris for
+ xorg_backtrace in hw/xfree86/common/xf86Events.c */
+#undef HAVE_WALKCONTEXT
+
+/* Define to 1 if unsigned long is 64 bits. */
+#undef _XSERVER64
+
+/* Building vgahw module */
+#undef WITH_VGAHW
+
+/* Define to 1 if NetBSD built-in MTRR support is available */
+#undef HAS_MTRR_BUILTIN
+
+/* Define to 1 if BSD MTRR support is available */
+#undef HAS_MTRR_SUPPORT
+
+/* NetBSD PIO alpha IO */
+#undef USE_ALPHA_PIO
+
+/* BSD AMD64 iopl */
+#undef USE_AMD64_IOPL
+
+/* BSD /dev/io */
+#undef USE_DEV_IO
+
+/* BSD i386 iopl */
+#undef USE_I386_IOPL
+
+/* System is BSD-like */
+#undef CSRG_BASED
+
+/* System has PC console */
+#undef PCCONS_SUPPORT
+
+/* System has PCVT console */
+#undef PCVT_SUPPORT
+
+/* System has syscons console */
+#undef SYSCONS_SUPPORT
+
+/* System has wscons console */
+#undef WSCONS_SUPPORT
+
+/* System has /dev/xf86 aperture driver */
+#undef HAS_APERTURE_DRV
+
+/* Has backtrace support */
+#undef HAVE_BACKTRACE
+
+/* Name of the period field in struct kbd_repeat */
+#undef LNX_KBD_PERIOD_NAME
+
+/* Have execinfo.h */
+#undef HAVE_EXECINFO_H
+
+/* Have pci_system_init_dev_mem() */
+#undef HAVE_PCI_SYSTEM_INIT_DEV_MEM
+
+/* Define to 1 if you have the `pci_device_is_boot_vga' function. */
+#undef HAVE_PCI_DEVICE_IS_BOOT_VGA
+
+/* Have pci_enable_device */
+#undef HAVE_PCI_DEVICE_ENABLE
+
+/* Define to 1 if you have the `pci_device_vgaarb_init' function. */
+#undef HAVE_PCI_DEVICE_VGAARB_INIT
+
+/* Path to text files containing PCI IDs */
+#undef PCI_TXT_IDS_PATH
+
+/* Use SIGIO handlers for input device events by default */
+#undef USE_SIGIO_BY_DEFAULT
+
+/* Build with libdrm support */
+#undef WITH_LIBDRM
+
+#endif /* _XORG_CONFIG_H_ */
diff --git a/xorg-server/mi/miarc.c b/xorg-server/mi/miarc.c
index 06fc4085b..9fc8f478c 100644
--- a/xorg-server/mi/miarc.c
+++ b/xorg-server/mi/miarc.c
@@ -1,3590 +1,3590 @@
-/***********************************************************
-
-Copyright 1987, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-******************************************************************/
-/* Author: Keith Packard and Bob Scheifler */
-/* Warning: this code is toxic, do not dally very long here. */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <math.h>
-#include <X11/X.h>
-#include <X11/Xprotostr.h>
-#include "misc.h"
-#include "gcstruct.h"
-#include "scrnintstr.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "mifpoly.h"
-#include "mi.h"
-#include "mifillarc.h"
-#include <X11/Xfuncproto.h>
-
-#ifdef _MSC_VER
-#define hypot _hypot
-#endif
-
-static double miDsin(double a);
-static double miDcos(double a);
-static double miDasin(double v);
-static double miDatan2(double dy, double dx);
-
-#ifndef HAVE_CBRT
-static double
-cbrt(double x)
-{
- if (x > 0.0)
- return pow(x, 1.0/3.0);
- else
- return -pow(-x, 1.0/3.0);
-}
-#endif
-
-/*
- * some interesting sematic interpretation of the protocol:
- *
- * Self intersecting arcs (i.e. those spanning 360 degrees)
- * never join with other arcs, and are drawn without caps
- * (unless on/off dashed, in which case each dash segment
- * is capped, except when the last segment meets the
- * first segment, when no caps are drawn)
- *
- * double dash arcs are drawn in two parts, first the
- * odd dashes (drawn in background) then the even dashes
- * (drawn in foreground). This means that overlapping
- * sections of foreground/background are drawn twice,
- * first in background then in foreground. The double-draw
- * occurs even when the function uses the destination values
- * (e.g. xor mode). This is the same way the wide-line
- * code works and should be "fixed".
- *
- */
-
-#undef max
-#undef min
-
-_X_INLINE static int max (const int x, const int y)
-{
- return x>y? x:y;
-}
-
-_X_INLINE static int min (const int x, const int y)
-{
- return x<y? x:y;
-}
-
-struct bound {
- double min, max;
-};
-
-struct ibound {
- int min, max;
-};
-
-#define boundedLe(value, bounds)\
- ((bounds).min <= (value) && (value) <= (bounds).max)
-
-struct line {
- double m, b;
- int valid;
-};
-
-#define intersectLine(y,line) (line.m * (y) + line.b)
-
-/*
- * these are all y value bounds
- */
-
-struct arc_bound {
- struct bound ellipse;
- struct bound inner;
- struct bound outer;
- struct bound right;
- struct bound left;
- struct ibound inneri;
- struct ibound outeri;
-};
-
-struct accelerators {
- double tail_y;
- double h2;
- double w2;
- double h4;
- double w4;
- double h2mw2;
- double h2l;
- double w2l;
- double fromIntX;
- double fromIntY;
- struct line left, right;
- int yorgu;
- int yorgl;
- int xorg;
-};
-
-struct arc_def {
- double w, h, l;
- double a0, a1;
-};
-
-# define todeg(xAngle) (((double) (xAngle)) / 64.0)
-
-# define RIGHT_END 0
-# define LEFT_END 1
-
-typedef struct _miArcJoin {
- int arcIndex0, arcIndex1;
- int phase0, phase1;
- int end0, end1;
-} miArcJoinRec, *miArcJoinPtr;
-
-typedef struct _miArcCap {
- int arcIndex;
- int end;
-} miArcCapRec, *miArcCapPtr;
-
-typedef struct _miArcFace {
- SppPointRec clock;
- SppPointRec center;
- SppPointRec counterClock;
-} miArcFaceRec, *miArcFacePtr;
-
-typedef struct _miArcData {
- xArc arc;
- int render; /* non-zero means render after drawing */
- int join; /* related join */
- int cap; /* related cap */
- int selfJoin; /* final dash meets first dash */
- miArcFaceRec bounds[2];
- double x0, y0, x1, y1;
-} miArcDataRec, *miArcDataPtr;
-
-/*
- * This is an entire sequence of arcs, computed and categorized according
- * to operation. miDashArcs generates either one or two of these.
- */
-
-typedef struct _miPolyArc {
- int narcs;
- miArcDataPtr arcs;
- int ncaps;
- miArcCapPtr caps;
- int njoins;
- miArcJoinPtr joins;
-} miPolyArcRec, *miPolyArcPtr;
-
-static void fillSpans(DrawablePtr pDrawable, GCPtr pGC);
-static void newFinalSpan(int y, int xmin, int xmax);
-static void drawArc(xArc *tarc, int l, int a0, int a1, miArcFacePtr right,
- miArcFacePtr left);
-static void drawZeroArc(DrawablePtr pDraw, GCPtr pGC, xArc *tarc, int lw,
- miArcFacePtr left, miArcFacePtr right);
-static void miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft,
- miArcFacePtr pRight, int xOrgLeft, int yOrgLeft,
- double xFtransLeft, double yFtransLeft,
- int xOrgRight, int yOrgRight,
- double xFtransRight, double yFtransRight);
-static void miArcCap(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pFace,
- int end, int xOrg, int yOrg, double xFtrans,
- double yFtrans);
-static void miRoundCap(DrawablePtr pDraw, GCPtr pGC, SppPointRec pCenter,
- SppPointRec pEnd, SppPointRec pCorner,
- SppPointRec pOtherCorner, int fLineEnd,
- int xOrg, int yOrg, double xFtrans, double yFtrans);
-static void miFreeArcs(miPolyArcPtr arcs, GCPtr pGC);
-static miPolyArcPtr miComputeArcs(xArc *parcs, int narcs, GCPtr pGC);
-static int miGetArcPts(SppArcPtr parc, int cpt, SppPointPtr *ppPts);
-
-# define CUBED_ROOT_2 1.2599210498948732038115849718451499938964
-# define CUBED_ROOT_4 1.5874010519681993173435330390930175781250
-
-/*
- * draw one segment of the arc using the arc spans generation routines
- */
-
-static void
-miArcSegment(
- DrawablePtr pDraw,
- GCPtr pGC,
- xArc tarc,
- miArcFacePtr right,
- miArcFacePtr left)
-{
- int l = pGC->lineWidth;
- int a0, a1, startAngle, endAngle;
- miArcFacePtr temp;
-
- if (!l)
- l = 1;
-
- if (tarc.width == 0 || tarc.height == 0) {
- drawZeroArc (pDraw, pGC, &tarc, l, left, right);
- return;
- }
-
- if (pGC->miTranslate) {
- tarc.x += pDraw->x;
- tarc.y += pDraw->y;
- }
-
- a0 = tarc.angle1;
- a1 = tarc.angle2;
- if (a1 > FULLCIRCLE)
- a1 = FULLCIRCLE;
- else if (a1 < -FULLCIRCLE)
- a1 = -FULLCIRCLE;
- if (a1 < 0) {
- startAngle = a0 + a1;
- endAngle = a0;
- temp = right;
- right = left;
- left = temp;
- } else {
- startAngle = a0;
- endAngle = a0 + a1;
- }
- /*
- * bounds check the two angles
- */
- if (startAngle < 0)
- startAngle = FULLCIRCLE - (-startAngle) % FULLCIRCLE;
- if (startAngle >= FULLCIRCLE)
- startAngle = startAngle % FULLCIRCLE;
- if (endAngle < 0)
- endAngle = FULLCIRCLE - (-endAngle) % FULLCIRCLE;
- if (endAngle > FULLCIRCLE)
- endAngle = (endAngle-1) % FULLCIRCLE + 1;
- if ((startAngle == endAngle) && a1) {
- startAngle = 0;
- endAngle = FULLCIRCLE;
- }
-
- drawArc (&tarc, l, startAngle, endAngle, right, left);
-}
-
-/*
-
-Three equations combine to describe the boundaries of the arc
-
-x^2/w^2 + y^2/h^2 = 1 ellipse itself
-(X-x)^2 + (Y-y)^2 = r^2 circle at (x, y) on the ellipse
-(Y-y) = (X-x)*w^2*y/(h^2*x) normal at (x, y) on the ellipse
-
-These lead to a quartic relating Y and y
-
-y^4 - (2Y)y^3 + (Y^2 + (h^4 - w^2*r^2)/(w^2 - h^2))y^2
- - (2Y*h^4/(w^2 - h^2))y + (Y^2*h^4)/(w^2 - h^2) = 0
-
-The reducible cubic obtained from this quartic is
-
-z^3 - (3N)z^2 - 2V = 0
-
-where
-
-N = (Y^2 + (h^4 - w^2*r^2/(w^2 - h^2)))/6
-V = w^2*r^2*Y^2*h^4/(4 *(w^2 - h^2)^2)
-
-Let
-
-t = z - N
-p = -N^2
-q = -N^3 - V
-
-Then we get
-
-t^3 + 3pt + 2q = 0
-
-The discriminant of this cubic is
-
-D = q^2 + p^3
-
-When D > 0, a real root is obtained as
-
-z = N + cbrt(-q+sqrt(D)) + cbrt(-q-sqrt(D))
-
-When D < 0, a real root is obtained as
-
-z = N - 2m*cos(acos(-q/m^3)/3)
-
-where
-
-m = sqrt(|p|) * sign(q)
-
-Given a real root Z of the cubic, the roots of the quartic are the roots
-of the two quadratics
-
-y^2 + ((b+A)/2)y + (Z + (bZ - d)/A) = 0
-
-where
-
-A = +/- sqrt(8Z + b^2 - 4c)
-b, c, d are the cubic, quadratic, and linear coefficients of the quartic
-
-Some experimentation is then required to determine which solutions
-correspond to the inner and outer boundaries.
-
-*/
-
-typedef struct {
- short lx, lw, rx, rw;
-} miArcSpan;
-
-typedef struct {
- miArcSpan *spans;
- int count1, count2, k;
- char top, bot, hole;
-} miArcSpanData;
-
-static void drawQuadrant(struct arc_def *def, struct accelerators *acc,
- int a0, int a1, int mask, miArcFacePtr right,
- miArcFacePtr left, miArcSpanData *spdata);
-
-static void
-miComputeCircleSpans(
- int lw,
- xArc *parc,
- miArcSpanData *spdata)
-{
- miArcSpan *span;
- int doinner;
- int x, y, e;
- int xk, yk, xm, ym, dx, dy;
- int slw, inslw;
- int inx = 0, iny, ine = 0;
- int inxk = 0, inyk = 0, inxm = 0, inym = 0;
-
- doinner = -lw;
- slw = parc->width - doinner;
- y = parc->height >> 1;
- dy = parc->height & 1;
- dx = 1 - dy;
- MIWIDEARCSETUP(x, y, dy, slw, e, xk, xm, yk, ym);
- inslw = parc->width + doinner;
- if (inslw > 0)
- {
- spdata->hole = spdata->top;
- MIWIDEARCSETUP(inx, iny, dy, inslw, ine, inxk, inxm, inyk, inym);
- }
- else
- {
- spdata->hole = FALSE;
- doinner = -y;
- }
- spdata->count1 = -doinner - spdata->top;
- spdata->count2 = y + doinner;
- span = spdata->spans;
- while (y)
- {
- MIFILLARCSTEP(slw);
- span->lx = dy - x;
- if (++doinner <= 0)
- {
- span->lw = slw;
- span->rx = 0;
- span->rw = span->lx + slw;
- }
- else
- {
- MIFILLINARCSTEP(inslw);
- span->lw = x - inx;
- span->rx = dy - inx + inslw;
- span->rw = inx - x + slw - inslw;
- }
- span++;
- }
- if (spdata->bot)
- {
- if (spdata->count2)
- spdata->count2--;
- else
- {
- if (lw > (int)parc->height)
- span[-1].rx = span[-1].rw = -((lw - (int)parc->height) >> 1);
- else
- span[-1].rw = 0;
- spdata->count1--;
- }
- }
-}
-
-static void
-miComputeEllipseSpans(
- int lw,
- xArc *parc,
- miArcSpanData *spdata)
-{
- miArcSpan *span;
- double w, h, r, xorg;
- double Hs, Hf, WH, K, Vk, Nk, Fk, Vr, N, Nc, Z, rs;
- double A, T, b, d, x, y, t, inx, outx = 0.0, hepp, hepm;
- int flip, solution;
-
- w = (double)parc->width / 2.0;
- h = (double)parc->height / 2.0;
- r = lw / 2.0;
- rs = r * r;
- Hs = h * h;
- WH = w * w - Hs;
- Nk = w * r;
- Vk = (Nk * Hs) / (WH + WH);
- Hf = Hs * Hs;
- Nk = (Hf - Nk * Nk) / WH;
- Fk = Hf / WH;
- hepp = h + EPSILON;
- hepm = h - EPSILON;
- K = h + ((lw - 1) >> 1);
- span = spdata->spans;
- if (parc->width & 1)
- xorg = .5;
- else
- xorg = 0.0;
- if (spdata->top)
- {
- span->lx = 0;
- span->lw = 1;
- span++;
- }
- spdata->count1 = 0;
- spdata->count2 = 0;
- spdata->hole = (spdata->top &&
- (int)parc->height * lw <= (int)(parc->width * parc->width) &&
- lw < (int)parc->height);
- for (; K > 0.0; K -= 1.0)
- {
- N = (K * K + Nk) / 6.0;
- Nc = N * N * N;
- Vr = Vk * K;
- t = Nc + Vr * Vr;
- d = Nc + t;
- if (d < 0.0) {
- d = Nc;
- b = N;
- if ( (b < 0.0) == (t < 0.0) )
- {
- b = -b;
- d = -d;
- }
- Z = N - 2.0 * b * cos(acos(-t / d) / 3.0);
- if ( (Z < 0.0) == (Vr < 0.0) )
- flip = 2;
- else
- flip = 1;
- }
- else
- {
- d = Vr * sqrt(d);
- Z = N + cbrt(t + d) + cbrt(t - d);
- flip = 0;
- }
- A = sqrt((Z + Z) - Nk);
- T = (Fk - Z) * K / A;
- inx = 0.0;
- solution = FALSE;
- b = -A + K;
- d = b * b - 4 * (Z + T);
- if (d >= 0)
- {
- d = sqrt(d);
- y = (b + d) / 2;
- if ((y >= 0.0) && (y < hepp))
- {
- solution = TRUE;
- if (y > hepm)
- y = h;
- t = y / h;
- x = w * sqrt(1 - (t * t));
- t = K - y;
- if (rs - (t * t) >= 0)
- t = sqrt(rs - (t * t));
- else
- t = 0;
- if (flip == 2)
- inx = x - t;
- else
- outx = x + t;
- }
- }
- b = A + K;
- d = b * b - 4 * (Z - T);
- /* Because of the large magnitudes involved, we lose enough precision
- * that sometimes we end up with a negative value near the axis, when
- * it should be positive. This is a workaround.
- */
- if (d < 0 && !solution)
- d = 0.0;
- if (d >= 0) {
- d = sqrt(d);
- y = (b + d) / 2;
- if (y < hepp)
- {
- if (y > hepm)
- y = h;
- t = y / h;
- x = w * sqrt(1 - (t * t));
- t = K - y;
- if (rs - (t * t) >= 0)
- inx = x - sqrt(rs - (t * t));
- else
- inx = x;
- }
- y = (b - d) / 2;
- if (y >= 0.0)
- {
- if (y > hepm)
- y = h;
- t = y / h;
- x = w * sqrt(1 - (t * t));
- t = K - y;
- if (rs - (t * t) >= 0)
- t = sqrt(rs - (t * t));
- else
- t = 0;
- if (flip == 1)
- inx = x - t;
- else
- outx = x + t;
- }
- }
- span->lx = ICEIL(xorg - outx);
- if (inx <= 0.0)
- {
- spdata->count1++;
- span->lw = ICEIL(xorg + outx) - span->lx;
- span->rx = ICEIL(xorg + inx);
- span->rw = -ICEIL(xorg - inx);
- }
- else
- {
- spdata->count2++;
- span->lw = ICEIL(xorg - inx) - span->lx;
- span->rx = ICEIL(xorg + inx);
- span->rw = ICEIL(xorg + outx) - span->rx;
- }
- span++;
- }
- if (spdata->bot)
- {
- outx = w + r;
- if (r >= h && r <= w)
- inx = 0.0;
- else if (Nk < 0.0 && -Nk < Hs)
- {
- inx = w * sqrt(1 + Nk / Hs) - sqrt(rs + Nk);
- if (inx > w - r)
- inx = w - r;
- }
- else
- inx = w - r;
- span->lx = ICEIL(xorg - outx);
- if (inx <= 0.0)
- {
- span->lw = ICEIL(xorg + outx) - span->lx;
- span->rx = ICEIL(xorg + inx);
- span->rw = -ICEIL(xorg - inx);
- }
- else
- {
- span->lw = ICEIL(xorg - inx) - span->lx;
- span->rx = ICEIL(xorg + inx);
- span->rw = ICEIL(xorg + outx) - span->rx;
- }
- }
- if (spdata->hole)
- {
- span = &spdata->spans[spdata->count1];
- span->lw = -span->lx;
- span->rx = 1;
- span->rw = span->lw;
- spdata->count1--;
- spdata->count2++;
- }
-}
-
-static double
-tailX(
- double K,
- struct arc_def *def,
- struct arc_bound *bounds,
- struct accelerators *acc)
-{
- double w, h, r;
- double Hs, Hf, WH, Vk, Nk, Fk, Vr, N, Nc, Z, rs;
- double A, T, b, d, x, y, t, hepp, hepm;
- int flip, solution;
- double xs[2];
- double *xp;
-
- w = def->w;
- h = def->h;
- r = def->l;
- rs = r * r;
- Hs = acc->h2;
- WH = -acc->h2mw2;
- Nk = def->w * r;
- Vk = (Nk * Hs) / (WH + WH);
- Hf = acc->h4;
- Nk = (Hf - Nk * Nk) / WH;
- if (K == 0.0) {
- if (Nk < 0.0 && -Nk < Hs) {
- xs[0] = w * sqrt(1 + Nk / Hs) - sqrt(rs + Nk);
- xs[1] = w - r;
- if (acc->left.valid && boundedLe(K, bounds->left) &&
- !boundedLe(K, bounds->outer) && xs[0] >= 0.0 && xs[1] >= 0.0)
- return xs[1];
- if (acc->right.valid && boundedLe(K, bounds->right) &&
- !boundedLe(K, bounds->inner) && xs[0] <= 0.0 && xs[1] <= 0.0)
- return xs[1];
- return xs[0];
- }
- return w - r;
- }
- Fk = Hf / WH;
- hepp = h + EPSILON;
- hepm = h - EPSILON;
- N = (K * K + Nk) / 6.0;
- Nc = N * N * N;
- Vr = Vk * K;
- xp = xs;
- xs[0] = 0.0;
- t = Nc + Vr * Vr;
- d = Nc + t;
- if (d < 0.0) {
- d = Nc;
- b = N;
- if ( (b < 0.0) == (t < 0.0) )
- {
- b = -b;
- d = -d;
- }
- Z = N - 2.0 * b * cos(acos(-t / d) / 3.0);
- if ( (Z < 0.0) == (Vr < 0.0) )
- flip = 2;
- else
- flip = 1;
- }
- else
- {
- d = Vr * sqrt(d);
- Z = N + cbrt(t + d) + cbrt(t - d);
- flip = 0;
- }
- A = sqrt((Z + Z) - Nk);
- T = (Fk - Z) * K / A;
- solution = FALSE;
- b = -A + K;
- d = b * b - 4 * (Z + T);
- if (d >= 0 && flip == 2)
- {
- d = sqrt(d);
- y = (b + d) / 2;
- if ((y >= 0.0) && (y < hepp))
- {
- solution = TRUE;
- if (y > hepm)
- y = h;
- t = y / h;
- x = w * sqrt(1 - (t * t));
- t = K - y;
- if (rs - (t * t) >= 0)
- t = sqrt(rs - (t * t));
- else
- t = 0;
- *xp++ = x - t;
- }
- }
- b = A + K;
- d = b * b - 4 * (Z - T);
- /* Because of the large magnitudes involved, we lose enough precision
- * that sometimes we end up with a negative value near the axis, when
- * it should be positive. This is a workaround.
- */
- if (d < 0 && !solution)
- d = 0.0;
- if (d >= 0) {
- d = sqrt(d);
- y = (b + d) / 2;
- if (y < hepp)
- {
- if (y > hepm)
- y = h;
- t = y / h;
- x = w * sqrt(1 - (t * t));
- t = K - y;
- if (rs - (t * t) >= 0)
- *xp++ = x - sqrt(rs - (t * t));
- else
- *xp++ = x;
- }
- y = (b - d) / 2;
- if (y >= 0.0 && flip == 1)
- {
- if (y > hepm)
- y = h;
- t = y / h;
- x = w * sqrt(1 - (t * t));
- t = K - y;
- if (rs - (t * t) >= 0)
- t = sqrt(rs - (t * t));
- else
- t = 0;
- *xp++ = x - t;
- }
- }
- if (xp > &xs[1]) {
- if (acc->left.valid && boundedLe(K, bounds->left) &&
- !boundedLe(K, bounds->outer) && xs[0] >= 0.0 && xs[1] >= 0.0)
- return xs[1];
- if (acc->right.valid && boundedLe(K, bounds->right) &&
- !boundedLe(K, bounds->inner) && xs[0] <= 0.0 && xs[1] <= 0.0)
- return xs[1];
- }
- return xs[0];
-}
-
-static miArcSpanData *
-miComputeWideEllipse(int lw, xArc *parc)
-{
- miArcSpanData *spdata = NULL;
- int k;
-
- if (!lw)
- lw = 1;
- k = (parc->height >> 1) + ((lw - 1) >> 1);
- spdata = malloc(sizeof(miArcSpanData) + sizeof(miArcSpan) * (k + 2));
- if (!spdata)
- return NULL;
- spdata->spans = (miArcSpan *)(spdata + 1);
- spdata->k = k;
- spdata->top = !(lw & 1) && !(parc->width & 1);
- spdata->bot = !(parc->height & 1);
- if (parc->width == parc->height)
- miComputeCircleSpans(lw, parc, spdata);
- else
- miComputeEllipseSpans(lw, parc, spdata);
- return spdata;
-}
-
-static void
-miFillWideEllipse(
- DrawablePtr pDraw,
- GCPtr pGC,
- xArc *parc)
-{
- DDXPointPtr points;
- DDXPointPtr pts;
- int *widths;
- int *wids;
- miArcSpanData *spdata;
- miArcSpan *span;
- int xorg, yorgu, yorgl;
- int n;
-
- yorgu = parc->height + pGC->lineWidth;
- n = (sizeof(int) * 2) * yorgu;
- widths = malloc(n + (sizeof(DDXPointRec) * 2) * yorgu);
- if (!widths)
- return;
- points = (DDXPointPtr)((char *)widths + n);
- spdata = miComputeWideEllipse((int)pGC->lineWidth, parc);
- if (!spdata)
- {
- free(widths);
- return;
- }
- pts = points;
- wids = widths;
- span = spdata->spans;
- xorg = parc->x + (parc->width >> 1);
- yorgu = parc->y + (parc->height >> 1);
- yorgl = yorgu + (parc->height & 1);
- if (pGC->miTranslate)
- {
- xorg += pDraw->x;
- yorgu += pDraw->y;
- yorgl += pDraw->y;
- }
- yorgu -= spdata->k;
- yorgl += spdata->k;
- if (spdata->top)
- {
- pts->x = xorg;
- pts->y = yorgu - 1;
- pts++;
- *wids++ = 1;
- span++;
- }
- for (n = spdata->count1; --n >= 0; )
- {
- pts[0].x = xorg + span->lx;
- pts[0].y = yorgu;
- wids[0] = span->lw;
- pts[1].x = pts[0].x;
- pts[1].y = yorgl;
- wids[1] = wids[0];
- yorgu++;
- yorgl--;
- pts += 2;
- wids += 2;
- span++;
- }
- if (spdata->hole)
- {
- pts[0].x = xorg;
- pts[0].y = yorgl;
- wids[0] = 1;
- pts++;
- wids++;
- }
- for (n = spdata->count2; --n >= 0; )
- {
- pts[0].x = xorg + span->lx;
- pts[0].y = yorgu;
- wids[0] = span->lw;
- pts[1].x = xorg + span->rx;
- pts[1].y = pts[0].y;
- wids[1] = span->rw;
- pts[2].x = pts[0].x;
- pts[2].y = yorgl;
- wids[2] = wids[0];
- pts[3].x = pts[1].x;
- pts[3].y = pts[2].y;
- wids[3] = wids[1];
- yorgu++;
- yorgl--;
- pts += 4;
- wids += 4;
- span++;
- }
- if (spdata->bot)
- {
- if (span->rw <= 0)
- {
- pts[0].x = xorg + span->lx;
- pts[0].y = yorgu;
- wids[0] = span->lw;
- pts++;
- wids++;
- }
- else
- {
- pts[0].x = xorg + span->lx;
- pts[0].y = yorgu;
- wids[0] = span->lw;
- pts[1].x = xorg + span->rx;
- pts[1].y = pts[0].y;
- wids[1] = span->rw;
- pts += 2;
- wids += 2;
- }
- }
- free(spdata);
- (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE);
-
- free(widths);
-}
-
-/*
- * miPolyArc strategy:
- *
- * If arc is zero width and solid, we don't have to worry about the rasterop
- * or join styles. For wide solid circles, we use a fast integer algorithm.
- * For wide solid ellipses, we use special case floating point code.
- * Otherwise, we set up pDrawTo and pGCTo according to the rasterop, then
- * draw using pGCTo and pDrawTo. If the raster-op was "tricky," that is,
- * if it involves the destination, then we use PushPixels to move the bits
- * from the scratch drawable to pDraw. (See the wide line code for a
- * fuller explanation of this.)
- */
-
-void
-miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
-{
- int i;
- xArc *parc;
- int xMin, xMax, yMin, yMax;
- int pixmapWidth = 0, pixmapHeight = 0;
- int xOrg = 0, yOrg = 0;
- int width;
- Bool fTricky;
- DrawablePtr pDrawTo;
- CARD32 fg, bg;
- GCPtr pGCTo;
- miPolyArcPtr polyArcs;
- int cap[2], join[2];
- int iphase;
- int halfWidth;
-
- width = pGC->lineWidth;
- if(width == 0 && pGC->lineStyle == LineSolid)
- {
- for(i = narcs, parc = parcs; --i >= 0; parc++)
- miArcSegment( pDraw, pGC, *parc,
- (miArcFacePtr) 0, (miArcFacePtr) 0 );
- fillSpans (pDraw, pGC);
- }
- else
- {
- if ((pGC->lineStyle == LineSolid) && narcs)
- {
- while (parcs->width && parcs->height &&
- (parcs->angle2 >= FULLCIRCLE ||
- parcs->angle2 <= -FULLCIRCLE))
- {
- miFillWideEllipse(pDraw, pGC, parcs);
- if (!--narcs)
- return;
- parcs++;
- }
- }
-
- /* Set up pDrawTo and pGCTo based on the rasterop */
- switch(pGC->alu)
- {
- case GXclear: /* 0 */
- case GXcopy: /* src */
- case GXcopyInverted: /* NOT src */
- case GXset: /* 1 */
- fTricky = FALSE;
- pDrawTo = pDraw;
- pGCTo = pGC;
- break;
- default:
- fTricky = TRUE;
-
- /* find bounding box around arcs */
- xMin = yMin = MAXSHORT;
- xMax = yMax = MINSHORT;
-
- for(i = narcs, parc = parcs; --i >= 0; parc++)
- {
- xMin = min (xMin, parc->x);
- yMin = min (yMin, parc->y);
- xMax = max (xMax, (parc->x + (int) parc->width));
- yMax = max (yMax, (parc->y + (int) parc->height));
- }
-
- /* expand box to deal with line widths */
- halfWidth = (width + 1)/2;
- xMin -= halfWidth;
- yMin -= halfWidth;
- xMax += halfWidth;
- yMax += halfWidth;
-
- /* compute pixmap size; limit it to size of drawable */
- xOrg = max(xMin, 0);
- yOrg = max(yMin, 0);
- pixmapWidth = min(xMax, pDraw->width) - xOrg;
- pixmapHeight = min(yMax, pDraw->height) - yOrg;
-
- /* if nothing left, return */
- if ( (pixmapWidth <= 0) || (pixmapHeight <= 0) ) return;
-
- for(i = narcs, parc = parcs; --i >= 0; parc++)
- {
- parc->x -= xOrg;
- parc->y -= yOrg;
- }
- if (pGC->miTranslate)
- {
- xOrg += pDraw->x;
- yOrg += pDraw->y;
- }
-
- /* set up scratch GC */
-
- pGCTo = GetScratchGC(1, pDraw->pScreen);
- if (!pGCTo)
- return;
- {
- ChangeGCVal gcvals[6];
- gcvals[0].val = GXcopy;
- gcvals[1].val = 1;
- gcvals[2].val = 0;
- gcvals[3].val = pGC->lineWidth;
- gcvals[4].val = pGC->capStyle;
- gcvals[5].val = pGC->joinStyle;
- ChangeGC(NullClient, pGCTo, GCFunction |
- GCForeground | GCBackground | GCLineWidth |
- GCCapStyle | GCJoinStyle, gcvals);
- }
-
- /* allocate a 1 bit deep pixmap of the appropriate size, and
- * validate it */
- pDrawTo = (DrawablePtr)(*pDraw->pScreen->CreatePixmap)
- (pDraw->pScreen, pixmapWidth, pixmapHeight, 1,
- CREATE_PIXMAP_USAGE_SCRATCH);
- if (!pDrawTo)
- {
- FreeScratchGC(pGCTo);
- return;
- }
- ValidateGC(pDrawTo, pGCTo);
- miClearDrawable(pDrawTo, pGCTo);
- }
-
- fg = pGC->fgPixel;
- bg = pGC->bgPixel;
- if ((pGC->fillStyle == FillTiled) ||
- (pGC->fillStyle == FillOpaqueStippled))
- bg = fg; /* the protocol sez these don't cause color changes */
-
- polyArcs = miComputeArcs (parcs, narcs, pGC);
-
- if (!polyArcs)
- {
- if (fTricky) {
- (*pDraw->pScreen->DestroyPixmap) ((PixmapPtr)pDrawTo);
- FreeScratchGC (pGCTo);
- }
- return;
- }
-
- cap[0] = cap[1] = 0;
- join[0] = join[1] = 0;
- for (iphase = ((pGC->lineStyle == LineDoubleDash) ? 1 : 0);
- iphase >= 0;
- iphase--)
- {
- ChangeGCVal gcval;
- if (iphase == 1) {
- gcval.val = bg;
- ChangeGC (NullClient, pGC, GCForeground, &gcval);
- ValidateGC (pDraw, pGC);
- } else if (pGC->lineStyle == LineDoubleDash) {
- gcval.val = fg;
- ChangeGC (NullClient, pGC, GCForeground, &gcval);
- ValidateGC (pDraw, pGC);
- }
- for (i = 0; i < polyArcs[iphase].narcs; i++) {
- miArcDataPtr arcData;
-
- arcData = &polyArcs[iphase].arcs[i];
- miArcSegment(pDrawTo, pGCTo, arcData->arc,
- &arcData->bounds[RIGHT_END],
- &arcData->bounds[LEFT_END]);
- if (polyArcs[iphase].arcs[i].render) {
- fillSpans (pDrawTo, pGCTo);
- /*
- * don't cap self-joining arcs
- */
- if (polyArcs[iphase].arcs[i].selfJoin &&
- cap[iphase] < polyArcs[iphase].arcs[i].cap)
- cap[iphase]++;
- while (cap[iphase] < polyArcs[iphase].arcs[i].cap) {
- int arcIndex, end;
- miArcDataPtr arcData0;
-
- arcIndex = polyArcs[iphase].caps[cap[iphase]].arcIndex;
- end = polyArcs[iphase].caps[cap[iphase]].end;
- arcData0 = &polyArcs[iphase].arcs[arcIndex];
- miArcCap (pDrawTo, pGCTo,
- &arcData0->bounds[end], end,
- arcData0->arc.x, arcData0->arc.y,
- (double) arcData0->arc.width / 2.0,
- (double) arcData0->arc.height / 2.0);
- ++cap[iphase];
- }
- while (join[iphase] < polyArcs[iphase].arcs[i].join) {
- int arcIndex0, arcIndex1, end0, end1;
- int phase0, phase1;
- miArcDataPtr arcData0, arcData1;
- miArcJoinPtr joinp;
-
- joinp = &polyArcs[iphase].joins[join[iphase]];
- arcIndex0 = joinp->arcIndex0;
- end0 = joinp->end0;
- arcIndex1 = joinp->arcIndex1;
- end1 = joinp->end1;
- phase0 = joinp->phase0;
- phase1 = joinp->phase1;
- arcData0 = &polyArcs[phase0].arcs[arcIndex0];
- arcData1 = &polyArcs[phase1].arcs[arcIndex1];
- miArcJoin (pDrawTo, pGCTo,
- &arcData0->bounds[end0],
- &arcData1->bounds[end1],
- arcData0->arc.x, arcData0->arc.y,
- (double) arcData0->arc.width / 2.0,
- (double) arcData0->arc.height / 2.0,
- arcData1->arc.x, arcData1->arc.y,
- (double) arcData1->arc.width / 2.0,
- (double) arcData1->arc.height / 2.0);
- ++join[iphase];
- }
- if (fTricky) {
- if (pGC->serialNumber != pDraw->serialNumber)
- ValidateGC (pDraw, pGC);
- (*pGC->ops->PushPixels) (pGC, (PixmapPtr)pDrawTo,
- pDraw, pixmapWidth, pixmapHeight, xOrg, yOrg);
- miClearDrawable ((DrawablePtr) pDrawTo, pGCTo);
- }
- }
- }
- }
- miFreeArcs(polyArcs, pGC);
-
- if(fTricky)
- {
- (*pGCTo->pScreen->DestroyPixmap)((PixmapPtr)pDrawTo);
- FreeScratchGC(pGCTo);
- }
- }
-}
-
-static double
-angleBetween (SppPointRec center, SppPointRec point1, SppPointRec point2)
-{
- double a1, a2, a;
-
- /*
- * reflect from X coordinates back to ellipse
- * coordinates -- y increasing upwards
- */
- a1 = miDatan2 (- (point1.y - center.y), point1.x - center.x);
- a2 = miDatan2 (- (point2.y - center.y), point2.x - center.x);
- a = a2 - a1;
- if (a <= -180.0)
- a += 360.0;
- else if (a > 180.0)
- a -= 360.0;
- return a;
-}
-
-static void
-translateBounds (
- miArcFacePtr b,
- int x,
- int y,
- double fx,
- double fy)
-{
- fx += x;
- fy += y;
- b->clock.x -= fx;
- b->clock.y -= fy;
- b->center.x -= fx;
- b->center.y -= fy;
- b->counterClock.x -= fx;
- b->counterClock.y -= fy;
-}
-
-static void
-miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft,
- miArcFacePtr pRight, int xOrgLeft, int yOrgLeft,
- double xFtransLeft, double yFtransLeft,
- int xOrgRight, int yOrgRight,
- double xFtransRight, double yFtransRight)
-{
- SppPointRec center, corner, otherCorner;
- SppPointRec poly[5], e;
- SppPointPtr pArcPts;
- int cpt;
- SppArcRec arc;
- miArcFaceRec Right, Left;
- int polyLen = 0;
- int xOrg, yOrg;
- double xFtrans, yFtrans;
- double a;
- double ae, ac2, ec2, bc2, de;
- double width;
-
- xOrg = (xOrgRight + xOrgLeft) / 2;
- yOrg = (yOrgRight + yOrgLeft) / 2;
- xFtrans = (xFtransLeft + xFtransRight) / 2;
- yFtrans = (yFtransLeft + yFtransRight) / 2;
- Right = *pRight;
- translateBounds (&Right, xOrg - xOrgRight, yOrg - yOrgRight,
- xFtrans - xFtransRight, yFtrans - yFtransRight);
- Left = *pLeft;
- translateBounds (&Left, xOrg - xOrgLeft, yOrg - yOrgLeft,
- xFtrans - xFtransLeft, yFtrans - yFtransLeft);
- pRight = &Right;
- pLeft = &Left;
-
- if (pRight->clock.x == pLeft->counterClock.x &&
- pRight->clock.y == pLeft->counterClock.y)
- return;
- center = pRight->center;
- if (0 <= (a = angleBetween (center, pRight->clock, pLeft->counterClock))
- && a <= 180.0)
- {
- corner = pRight->clock;
- otherCorner = pLeft->counterClock;
- } else {
- a = angleBetween (center, pLeft->clock, pRight->counterClock);
- corner = pLeft->clock;
- otherCorner = pRight->counterClock;
- }
- switch (pGC->joinStyle) {
- case JoinRound:
- width = (pGC->lineWidth ? (double)pGC->lineWidth : (double)1);
-
- arc.x = center.x - width/2;
- arc.y = center.y - width/2;
- arc.width = width;
- arc.height = width;
- arc.angle1 = -miDatan2 (corner.y - center.y, corner.x - center.x);
- arc.angle2 = a;
- pArcPts = malloc(3 * sizeof (SppPointRec));
- if (!pArcPts)
- return;
- pArcPts[0].x = otherCorner.x;
- pArcPts[0].y = otherCorner.y;
- pArcPts[1].x = center.x;
- pArcPts[1].y = center.y;
- pArcPts[2].x = corner.x;
- pArcPts[2].y = corner.y;
- if( (cpt = miGetArcPts(&arc, 3, &pArcPts)) )
- {
- /* by drawing with miFillSppPoly and setting the endpoints of the arc
- * to be the corners, we assure that the cap will meet up with the
- * rest of the line */
- miFillSppPoly(pDraw, pGC, cpt, pArcPts, xOrg, yOrg, xFtrans, yFtrans);
- }
- free(pArcPts);
- return;
- case JoinMiter:
- /*
- * don't miter arcs with less than 11 degrees between them
- */
- if (a < 169.0) {
- poly[0] = corner;
- poly[1] = center;
- poly[2] = otherCorner;
- bc2 = (corner.x - otherCorner.x) * (corner.x - otherCorner.x) +
- (corner.y - otherCorner.y) * (corner.y - otherCorner.y);
- ec2 = bc2 / 4;
- ac2 = (corner.x - center.x) * (corner.x - center.x) +
- (corner.y - center.y) * (corner.y - center.y);
- ae = sqrt (ac2 - ec2);
- de = ec2 / ae;
- e.x = (corner.x + otherCorner.x) / 2;
- e.y = (corner.y + otherCorner.y) / 2;
- poly[3].x = e.x + de * (e.x - center.x) / ae;
- poly[3].y = e.y + de * (e.y - center.y) / ae;
- poly[4] = corner;
- polyLen = 5;
- break;
- }
- case JoinBevel:
- poly[0] = corner;
- poly[1] = center;
- poly[2] = otherCorner;
- poly[3] = corner;
- polyLen = 4;
- break;
- }
- miFillSppPoly (pDraw, pGC, polyLen, poly, xOrg, yOrg, xFtrans, yFtrans);
-}
-
-/*ARGSUSED*/
-static void
-miArcCap (
- DrawablePtr pDraw,
- GCPtr pGC,
- miArcFacePtr pFace,
- int end,
- int xOrg,
- int yOrg,
- double xFtrans,
- double yFtrans)
-{
- SppPointRec corner, otherCorner, center, endPoint, poly[5];
-
- corner = pFace->clock;
- otherCorner = pFace->counterClock;
- center = pFace->center;
- switch (pGC->capStyle) {
- case CapProjecting:
- poly[0].x = otherCorner.x;
- poly[0].y = otherCorner.y;
- poly[1].x = corner.x;
- poly[1].y = corner.y;
- poly[2].x = corner.x -
- (center.y - corner.y);
- poly[2].y = corner.y +
- (center.x - corner.x);
- poly[3].x = otherCorner.x -
- (otherCorner.y - center.y);
- poly[3].y = otherCorner.y +
- (otherCorner.x - center.x);
- poly[4].x = otherCorner.x;
- poly[4].y = otherCorner.y;
- miFillSppPoly (pDraw, pGC, 5, poly, xOrg, yOrg, xFtrans, yFtrans);
- break;
- case CapRound:
- /*
- * miRoundCap just needs these to be unequal.
- */
- endPoint = center;
- endPoint.x = endPoint.x + 100;
- miRoundCap (pDraw, pGC, center, endPoint, corner, otherCorner, 0,
- -xOrg, -yOrg, xFtrans, yFtrans);
- break;
- }
-}
-
-/* MIROUNDCAP -- a private helper function
- * Put Rounded cap on end. pCenter is the center of this end of the line
- * pEnd is the center of the other end of the line. pCorner is one of the
- * two corners at this end of the line.
- * NOTE: pOtherCorner must be counter-clockwise from pCorner.
- */
-/*ARGSUSED*/
-static void
-miRoundCap(
- DrawablePtr pDraw,
- GCPtr pGC,
- SppPointRec pCenter,
- SppPointRec pEnd,
- SppPointRec pCorner,
- SppPointRec pOtherCorner,
- int fLineEnd,
- int xOrg,
- int yOrg,
- double xFtrans,
- double yFtrans)
-{
- int cpt;
- double width;
- SppArcRec arc;
- SppPointPtr pArcPts;
-
- width = (pGC->lineWidth ? (double)pGC->lineWidth : (double)1);
-
- arc.x = pCenter.x - width/2;
- arc.y = pCenter.y - width/2;
- arc.width = width;
- arc.height = width;
- arc.angle1 = -miDatan2 (pCorner.y - pCenter.y, pCorner.x - pCenter.x);
- if(PTISEQUAL(pCenter, pEnd))
- arc.angle2 = - 180.0;
- else {
- arc.angle2 = -miDatan2 (pOtherCorner.y - pCenter.y, pOtherCorner.x - pCenter.x) - arc.angle1;
- if (arc.angle2 < 0)
- arc.angle2 += 360.0;
- }
- pArcPts = (SppPointPtr) NULL;
- if( (cpt = miGetArcPts(&arc, 0, &pArcPts)) )
- {
- /* by drawing with miFillSppPoly and setting the endpoints of the arc
- * to be the corners, we assure that the cap will meet up with the
- * rest of the line */
- miFillSppPoly(pDraw, pGC, cpt, pArcPts, -xOrg, -yOrg, xFtrans, yFtrans);
- }
- free(pArcPts);
-}
-
-/*
- * To avoid inaccuracy at the cardinal points, use trig functions
- * which are exact for those angles
- */
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-#ifndef M_PI_2
-#define M_PI_2 1.57079632679489661923
-#endif
-
-# define Dsin(d) ((d) == 0.0 ? 0.0 : ((d) == 90.0 ? 1.0 : sin(d*M_PI/180.0)))
-# define Dcos(d) ((d) == 0.0 ? 1.0 : ((d) == 90.0 ? 0.0 : cos(d*M_PI/180.0)))
-# define mod(a,b) ((a) >= 0 ? (a) % (b) : (b) - (-(a)) % (b))
-
-static double
-miDcos (double a)
-{
- int i;
-
- if (floor (a/90) == a/90) {
- i = (int) (a/90.0);
- switch (mod (i, 4)) {
- case 0: return 1;
- case 1: return 0;
- case 2: return -1;
- case 3: return 0;
- }
- }
- return cos (a * M_PI / 180.0);
-}
-
-static double
-miDsin (double a)
-{
- int i;
-
- if (floor (a/90) == a/90) {
- i = (int) (a/90.0);
- switch (mod (i, 4)) {
- case 0: return 0;
- case 1: return 1;
- case 2: return 0;
- case 3: return -1;
- }
- }
- return sin (a * M_PI / 180.0);
-}
-
-static double
-miDasin (double v)
-{
- if (v == 0)
- return 0.0;
- if (v == 1.0)
- return 90.0;
- if (v == -1.0)
- return -90.0;
- return asin(v) * (180.0 / M_PI);
-}
-
-static double
-miDatan2 (double dy, double dx)
-{
- if (dy == 0) {
- if (dx >= 0)
- return 0.0;
- return 180.0;
- } else if (dx == 0) {
- if (dy > 0)
- return 90.0;
- return -90.0;
- } else if (Fabs (dy) == Fabs (dx)) {
- if (dy > 0) {
- if (dx > 0)
- return 45.0;
- return 135.0;
- } else {
- if (dx > 0)
- return 315.0;
- return 225.0;
- }
- } else {
- return atan2 (dy, dx) * (180.0 / M_PI);
- }
-}
-
-/* MIGETARCPTS -- Converts an arc into a set of line segments -- a helper
- * routine for filled arc and line (round cap) code.
- * Returns the number of points in the arc. Note that it takes a pointer
- * to a pointer to where it should put the points and an index (cpt).
- * This procedure allocates the space necessary to fit the arc points.
- * Sometimes it's convenient for those points to be at the end of an existing
- * array. (For example, if we want to leave a spare point to make sectors
- * instead of segments.) So we pass in the malloc()ed chunk that contains the
- * array and an index saying where we should start stashing the points.
- * If there isn't an array already, we just pass in a null pointer and
- * count on realloc() to handle the null pointer correctly.
- */
-static int
-miGetArcPts(
- SppArcPtr parc, /* points to an arc */
- int cpt, /* number of points already in arc list */
- SppPointPtr *ppPts) /* pointer to pointer to arc-list -- modified */
-{
- double st, /* Start Theta, start angle */
- et, /* End Theta, offset from start theta */
- dt, /* Delta Theta, angle to sweep ellipse */
- cdt, /* Cos Delta Theta, actually 2 cos(dt) */
- x0, y0, /* the recurrence formula needs two points to start */
- x1, y1,
- x2, y2, /* this will be the new point generated */
- xc, yc; /* the center point */
- int count, i;
- SppPointPtr poly;
-
- /* The spec says that positive angles indicate counterclockwise motion.
- * Given our coordinate system (with 0,0 in the upper left corner),
- * the screen appears flipped in Y. The easiest fix is to negate the
- * angles given */
-
- st = - parc->angle1;
-
- et = - parc->angle2;
-
- /* Try to get a delta theta that is within 1/2 pixel. Then adjust it
- * so that it divides evenly into the total.
- * I'm just using cdt 'cause I'm lazy.
- */
- cdt = parc->width;
- if (parc->height > cdt)
- cdt = parc->height;
- cdt /= 2.0;
- if(cdt <= 0)
- return 0;
- if (cdt < 1.0)
- cdt = 1.0;
- dt = miDasin ( 1.0 / cdt ); /* minimum step necessary */
- count = et/dt;
- count = abs(count) + 1;
- dt = et/count;
- count++;
-
- cdt = 2 * miDcos(dt);
- if (!(poly = (SppPointPtr) realloc((pointer)*ppPts,
- (cpt + count) * sizeof(SppPointRec))))
- return 0;
- *ppPts = poly;
-
- xc = parc->width/2.0; /* store half width and half height */
- yc = parc->height/2.0;
-
- x0 = xc * miDcos(st);
- y0 = yc * miDsin(st);
- x1 = xc * miDcos(st + dt);
- y1 = yc * miDsin(st + dt);
- xc += parc->x; /* by adding initial point, these become */
- yc += parc->y; /* the center point */
-
- poly[cpt].x = (xc + x0);
- poly[cpt].y = (yc + y0);
- poly[cpt + 1].x = (xc + x1);
- poly[cpt + 1].y = (yc + y1);
-
- for(i = 2; i < count; i++)
- {
- x2 = cdt * x1 - x0;
- y2 = cdt * y1 - y0;
-
- poly[cpt + i].x = (xc + x2);
- poly[cpt + i].y = (yc + y2);
-
- x0 = x1; y0 = y1;
- x1 = x2; y1 = y2;
- }
- /* adjust the last point */
- if (abs(parc->angle2) >= 360.0)
- poly[cpt +i -1] = poly[0];
- else {
- poly[cpt +i -1].x = (miDcos(st + et) * parc->width/2.0 + xc);
- poly[cpt +i -1].y = (miDsin(st + et) * parc->height/2.0 + yc);
- }
-
- return count;
-}
-
-struct arcData {
- double x0, y0, x1, y1;
- int selfJoin;
-};
-
-# define ADD_REALLOC_STEP 20
-
-static void
-addCap (
- miArcCapPtr *capsp,
- int *ncapsp,
- int *sizep,
- int end,
- int arcIndex)
-{
- int newsize;
- miArcCapPtr cap;
-
- if (*ncapsp == *sizep)
- {
- newsize = *sizep + ADD_REALLOC_STEP;
- cap = (miArcCapPtr) realloc(*capsp,
- newsize * sizeof (**capsp));
- if (!cap)
- return;
- *sizep = newsize;
- *capsp = cap;
- }
- cap = &(*capsp)[*ncapsp];
- cap->end = end;
- cap->arcIndex = arcIndex;
- ++*ncapsp;
-}
-
-static void
-addJoin (
- miArcJoinPtr *joinsp,
- int *njoinsp,
- int *sizep,
- int end0,
- int index0,
- int phase0,
- int end1,
- int index1,
- int phase1)
-{
- int newsize;
- miArcJoinPtr join;
-
- if (*njoinsp == *sizep)
- {
- newsize = *sizep + ADD_REALLOC_STEP;
- join = (miArcJoinPtr) realloc(*joinsp,
- newsize * sizeof (**joinsp));
- if (!join)
- return;
- *sizep = newsize;
- *joinsp = join;
- }
- join = &(*joinsp)[*njoinsp];
- join->end0 = end0;
- join->arcIndex0 = index0;
- join->phase0 = phase0;
- join->end1 = end1;
- join->arcIndex1 = index1;
- join->phase1 = phase1;
- ++*njoinsp;
-}
-
-static miArcDataPtr
-addArc (
- miArcDataPtr *arcsp,
- int *narcsp,
- int *sizep,
- xArc *xarc)
-{
- int newsize;
- miArcDataPtr arc;
-
- if (*narcsp == *sizep)
- {
- newsize = *sizep + ADD_REALLOC_STEP;
- arc = (miArcDataPtr) realloc(*arcsp,
- newsize * sizeof (**arcsp));
- if (!arc)
- return NULL;
- *sizep = newsize;
- *arcsp = arc;
- }
- arc = &(*arcsp)[*narcsp];
- arc->arc = *xarc;
- ++*narcsp;
- return arc;
-}
-
-static void
-miFreeArcs(
- miPolyArcPtr arcs,
- GCPtr pGC)
-{
- int iphase;
-
- for (iphase = ((pGC->lineStyle == LineDoubleDash) ? 1 : 0);
- iphase >= 0;
- iphase--)
- {
- if (arcs[iphase].narcs > 0)
- free(arcs[iphase].arcs);
- if (arcs[iphase].njoins > 0)
- free(arcs[iphase].joins);
- if (arcs[iphase].ncaps > 0)
- free(arcs[iphase].caps);
- }
- free(arcs);
-}
-
-/*
- * map angles to radial distance. This only deals with the first quadrant
- */
-
-/*
- * a polygonal approximation to the arc for computing arc lengths
- */
-
-# define DASH_MAP_SIZE 91
-
-# define dashIndexToAngle(di) ((((double) (di)) * 90.0) / ((double) DASH_MAP_SIZE - 1))
-# define xAngleToDashIndex(xa) ((((long) (xa)) * (DASH_MAP_SIZE - 1)) / (90 * 64))
-# define dashIndexToXAngle(di) ((((long) (di)) * (90 * 64)) / (DASH_MAP_SIZE - 1))
-# define dashXAngleStep (((double) (90 * 64)) / ((double) (DASH_MAP_SIZE - 1)))
-
-typedef struct {
- double map[DASH_MAP_SIZE];
-} dashMap;
-
-static int computeAngleFromPath(int startAngle, int endAngle, dashMap *map,
- int *lenp, int backwards);
-
-static void
-computeDashMap (
- xArc *arcp,
- dashMap *map)
-{
- int di;
- double a, x, y, prevx = 0.0, prevy = 0.0, dist;
-
- for (di = 0; di < DASH_MAP_SIZE; di++) {
- a = dashIndexToAngle (di);
- x = ((double) arcp->width / 2.0) * miDcos (a);
- y = ((double) arcp->height / 2.0) * miDsin (a);
- if (di == 0) {
- map->map[di] = 0.0;
- } else {
- dist = hypot (x - prevx, y - prevy);
- map->map[di] = map->map[di - 1] + dist;
- }
- prevx = x;
- prevy = y;
- }
-}
-
-typedef enum {HORIZONTAL, VERTICAL, OTHER} arcTypes;
-
-/* this routine is a bit gory */
-
-static miPolyArcPtr
-miComputeArcs (
- xArc *parcs,
- int narcs,
- GCPtr pGC)
-{
- int isDashed, isDoubleDash;
- int dashOffset;
- miPolyArcPtr arcs;
- int start, i, j, k = 0, nexti, nextk = 0;
- int joinSize[2];
- int capSize[2];
- int arcSize[2];
- int angle2;
- double a0, a1;
- struct arcData *data;
- miArcDataPtr arc;
- xArc xarc;
- int iphase, prevphase = 0, joinphase;
- int arcsJoin;
- int selfJoin;
-
- int iDash = 0, dashRemaining = 0;
- int iDashStart = 0, dashRemainingStart = 0, iphaseStart;
- int startAngle, spanAngle, endAngle, backwards = 0;
- int prevDashAngle, dashAngle;
- dashMap map;
-
- isDashed = !(pGC->lineStyle == LineSolid);
- isDoubleDash = (pGC->lineStyle == LineDoubleDash);
- dashOffset = pGC->dashOffset;
-
- data = malloc(narcs * sizeof (struct arcData));
- if (!data)
- return NULL;
- arcs = malloc(sizeof (*arcs) * (isDoubleDash ? 2 : 1));
- if (!arcs)
- {
- free(data);
- return NULL;
- }
- for (i = 0; i < narcs; i++) {
- a0 = todeg (parcs[i].angle1);
- angle2 = parcs[i].angle2;
- if (angle2 > FULLCIRCLE)
- angle2 = FULLCIRCLE;
- else if (angle2 < -FULLCIRCLE)
- angle2 = -FULLCIRCLE;
- data[i].selfJoin = angle2 == FULLCIRCLE || angle2 == -FULLCIRCLE;
- a1 = todeg (parcs[i].angle1 + angle2);
- data[i].x0 = parcs[i].x + (double) parcs[i].width / 2 * (1 + miDcos (a0));
- data[i].y0 = parcs[i].y + (double) parcs[i].height / 2 * (1 - miDsin (a0));
- data[i].x1 = parcs[i].x + (double) parcs[i].width / 2 * (1 + miDcos (a1));
- data[i].y1 = parcs[i].y + (double) parcs[i].height / 2 * (1 - miDsin (a1));
- }
-
- for (iphase = 0; iphase < (isDoubleDash ? 2 : 1); iphase++) {
- arcs[iphase].njoins = 0;
- arcs[iphase].joins = 0;
- joinSize[iphase] = 0;
-
- arcs[iphase].ncaps = 0;
- arcs[iphase].caps = 0;
- capSize[iphase] = 0;
-
- arcs[iphase].narcs = 0;
- arcs[iphase].arcs = 0;
- arcSize[iphase] = 0;
- }
-
- iphase = 0;
- if (isDashed) {
- iDash = 0;
- dashRemaining = pGC->dash[0];
- while (dashOffset > 0) {
- if (dashOffset >= dashRemaining) {
- dashOffset -= dashRemaining;
- iphase = iphase ? 0 : 1;
- iDash++;
- if (iDash == pGC->numInDashList)
- iDash = 0;
- dashRemaining = pGC->dash[iDash];
- } else {
- dashRemaining -= dashOffset;
- dashOffset = 0;
- }
- }
- iDashStart = iDash;
- dashRemainingStart = dashRemaining;
- }
- iphaseStart = iphase;
-
- for (i = narcs - 1; i >= 0; i--) {
- j = i + 1;
- if (j == narcs)
- j = 0;
- if (data[i].selfJoin || i == j ||
- (UNEQUAL (data[i].x1, data[j].x0) ||
- UNEQUAL (data[i].y1, data[j].y0)))
- {
- if (iphase == 0 || isDoubleDash)
- addCap (&arcs[iphase].caps, &arcs[iphase].ncaps,
- &capSize[iphase], RIGHT_END, 0);
- break;
- }
- }
- start = i + 1;
- if (start == narcs)
- start = 0;
- i = start;
- for (;;) {
- j = i + 1;
- if (j == narcs)
- j = 0;
- nexti = i+1;
- if (nexti == narcs)
- nexti = 0;
- if (isDashed) {
- /*
- ** deal with dashed arcs. Use special rules for certain 0 area arcs.
- ** Presumably, the other 0 area arcs still aren't done right.
- */
- arcTypes arcType = OTHER;
- CARD16 thisLength;
-
- if (parcs[i].height == 0
- && (parcs[i].angle1 % FULLCIRCLE) == 0x2d00
- && parcs[i].angle2 == 0x2d00)
- arcType = HORIZONTAL;
- else if (parcs[i].width == 0
- && (parcs[i].angle1 % FULLCIRCLE) == 0x1680
- && parcs[i].angle2 == 0x2d00)
- arcType = VERTICAL;
- if (arcType == OTHER) {
- /*
- * precompute an approximation map
- */
- computeDashMap (&parcs[i], &map);
- /*
- * compute each individual dash segment using the path
- * length function
- */
- startAngle = parcs[i].angle1;
- spanAngle = parcs[i].angle2;
- if (spanAngle > FULLCIRCLE)
- spanAngle = FULLCIRCLE;
- else if (spanAngle < -FULLCIRCLE)
- spanAngle = -FULLCIRCLE;
- if (startAngle < 0)
- startAngle = FULLCIRCLE - (-startAngle) % FULLCIRCLE;
- if (startAngle >= FULLCIRCLE)
- startAngle = startAngle % FULLCIRCLE;
- endAngle = startAngle + spanAngle;
- backwards = spanAngle < 0;
- } else {
- xarc = parcs[i];
- if (arcType == VERTICAL) {
- xarc.angle1 = 0x1680;
- startAngle = parcs[i].y;
- endAngle = startAngle + parcs[i].height;
- } else {
- xarc.angle1 = 0x2d00;
- startAngle = parcs[i].x;
- endAngle = startAngle + parcs[i].width;
- }
- }
- dashAngle = startAngle;
- selfJoin = data[i].selfJoin &&
- (iphase == 0 || isDoubleDash);
- /*
- * add dashed arcs to each bucket
- */
- arc = 0;
- while (dashAngle != endAngle) {
- prevDashAngle = dashAngle;
- if (arcType == OTHER) {
- dashAngle = computeAngleFromPath (prevDashAngle, endAngle,
- &map, &dashRemaining, backwards);
- /* avoid troubles with huge arcs and small dashes */
- if (dashAngle == prevDashAngle) {
- if (backwards)
- dashAngle--;
- else
- dashAngle++;
- }
- } else {
- thisLength = (dashAngle + dashRemaining <= endAngle) ?
- dashRemaining : endAngle - dashAngle;
- if (arcType == VERTICAL) {
- xarc.y = dashAngle;
- xarc.height = thisLength;
- } else {
- xarc.x = dashAngle;
- xarc.width = thisLength;
- }
- dashAngle += thisLength;
- dashRemaining -= thisLength;
- }
- if (iphase == 0 || isDoubleDash) {
- if (arcType == OTHER) {
- xarc = parcs[i];
- spanAngle = prevDashAngle;
- if (spanAngle < 0)
- spanAngle = FULLCIRCLE - (-spanAngle) % FULLCIRCLE;
- if (spanAngle >= FULLCIRCLE)
- spanAngle = spanAngle % FULLCIRCLE;
- xarc.angle1 = spanAngle;
- spanAngle = dashAngle - prevDashAngle;
- if (backwards) {
- if (dashAngle > prevDashAngle)
- spanAngle = - FULLCIRCLE + spanAngle;
- } else {
- if (dashAngle < prevDashAngle)
- spanAngle = FULLCIRCLE + spanAngle;
- }
- if (spanAngle > FULLCIRCLE)
- spanAngle = FULLCIRCLE;
- if (spanAngle < -FULLCIRCLE)
- spanAngle = -FULLCIRCLE;
- xarc.angle2 = spanAngle;
- }
- arc = addArc (&arcs[iphase].arcs, &arcs[iphase].narcs,
- &arcSize[iphase], &xarc);
- if (!arc)
- goto arcfail;
- /*
- * cap each end of an on/off dash
- */
- if (!isDoubleDash) {
- if (prevDashAngle != startAngle) {
- addCap (&arcs[iphase].caps,
- &arcs[iphase].ncaps,
- &capSize[iphase], RIGHT_END,
- arc - arcs[iphase].arcs);
-
- }
- if (dashAngle != endAngle) {
- addCap (&arcs[iphase].caps,
- &arcs[iphase].ncaps,
- &capSize[iphase], LEFT_END,
- arc - arcs[iphase].arcs);
- }
- }
- arc->cap = arcs[iphase].ncaps;
- arc->join = arcs[iphase].njoins;
- arc->render = 0;
- arc->selfJoin = 0;
- if (dashAngle == endAngle)
- arc->selfJoin = selfJoin;
- }
- prevphase = iphase;
- if (dashRemaining <= 0) {
- ++iDash;
- if (iDash == pGC->numInDashList)
- iDash = 0;
- iphase = iphase ? 0:1;
- dashRemaining = pGC->dash[iDash];
- }
- }
- /*
- * make sure a place exists for the position data when
- * drawing a zero-length arc
- */
- if (startAngle == endAngle) {
- prevphase = iphase;
- if (!isDoubleDash && iphase == 1)
- prevphase = 0;
- arc = addArc (&arcs[prevphase].arcs, &arcs[prevphase].narcs,
- &arcSize[prevphase], &parcs[i]);
- if (!arc)
- goto arcfail;
- arc->join = arcs[prevphase].njoins;
- arc->cap = arcs[prevphase].ncaps;
- arc->selfJoin = data[i].selfJoin;
- }
- } else {
- arc = addArc (&arcs[iphase].arcs, &arcs[iphase].narcs,
- &arcSize[iphase], &parcs[i]);
- if (!arc)
- goto arcfail;
- arc->join = arcs[iphase].njoins;
- arc->cap = arcs[iphase].ncaps;
- arc->selfJoin = data[i].selfJoin;
- prevphase = iphase;
- }
- if (prevphase == 0 || isDoubleDash)
- k = arcs[prevphase].narcs - 1;
- if (iphase == 0 || isDoubleDash)
- nextk = arcs[iphase].narcs;
- if (nexti == start) {
- nextk = 0;
- if (isDashed) {
- iDash = iDashStart;
- iphase = iphaseStart;
- dashRemaining = dashRemainingStart;
- }
- }
- arcsJoin = narcs > 1 && i != j &&
- ISEQUAL (data[i].x1, data[j].x0) &&
- ISEQUAL (data[i].y1, data[j].y0) &&
- !data[i].selfJoin && !data[j].selfJoin;
- if (arc)
- {
- if (arcsJoin)
- arc->render = 0;
- else
- arc->render = 1;
- }
- if (arcsJoin &&
- (prevphase == 0 || isDoubleDash) &&
- (iphase == 0 || isDoubleDash))
- {
- joinphase = iphase;
- if (isDoubleDash) {
- if (nexti == start)
- joinphase = iphaseStart;
- /*
- * if the join is right at the dash,
- * draw the join in foreground
- * This is because the foreground
- * arcs are computed second, the results
- * of which are needed to draw the join
- */
- if (joinphase != prevphase)
- joinphase = 0;
- }
- if (joinphase == 0 || isDoubleDash) {
- addJoin (&arcs[joinphase].joins,
- &arcs[joinphase].njoins,
- &joinSize[joinphase],
- LEFT_END, k, prevphase,
- RIGHT_END, nextk, iphase);
- arc->join = arcs[prevphase].njoins;
- }
- } else {
- /*
- * cap the left end of this arc
- * unless it joins itself
- */
- if ((prevphase == 0 || isDoubleDash) &&
- !arc->selfJoin)
- {
- addCap (&arcs[prevphase].caps, &arcs[prevphase].ncaps,
- &capSize[prevphase], LEFT_END, k);
- arc->cap = arcs[prevphase].ncaps;
- }
- if (isDashed && !arcsJoin) {
- iDash = iDashStart;
- iphase = iphaseStart;
- dashRemaining = dashRemainingStart;
- }
- nextk = arcs[iphase].narcs;
- if (nexti == start) {
- nextk = 0;
- iDash = iDashStart;
- iphase = iphaseStart;
- dashRemaining = dashRemainingStart;
- }
- /*
- * cap the right end of the next arc. If the
- * next arc is actually the first arc, only
- * cap it if it joins with this arc. This
- * case will occur when the final dash segment
- * of an on/off dash is off. Of course, this
- * cap will be drawn at a strange time, but that
- * hardly matters...
- */
- if ((iphase == 0 || isDoubleDash) &&
- (nexti != start || (arcsJoin && isDashed)))
- addCap (&arcs[iphase].caps, &arcs[iphase].ncaps,
- &capSize[iphase], RIGHT_END, nextk);
- }
- i = nexti;
- if (i == start)
- break;
- }
- /*
- * make sure the last section is rendered
- */
- for (iphase = 0; iphase < (isDoubleDash ? 2 : 1); iphase++)
- if (arcs[iphase].narcs > 0) {
- arcs[iphase].arcs[arcs[iphase].narcs-1].render = 1;
- arcs[iphase].arcs[arcs[iphase].narcs-1].join =
- arcs[iphase].njoins;
- arcs[iphase].arcs[arcs[iphase].narcs-1].cap =
- arcs[iphase].ncaps;
- }
- free(data);
- return arcs;
-arcfail:
- miFreeArcs(arcs, pGC);
- free(data);
- return NULL;
-}
-
-static double
-angleToLength (
- int angle,
- dashMap *map)
-{
- double len, excesslen, sidelen = map->map[DASH_MAP_SIZE - 1], totallen;
- int di;
- int excess;
- Bool oddSide = FALSE;
-
- totallen = 0;
- if (angle >= 0) {
- while (angle >= 90 * 64) {
- angle -= 90 * 64;
- totallen += sidelen;
- oddSide = !oddSide;
- }
- } else {
- while (angle < 0) {
- angle += 90 * 64;
- totallen -= sidelen;
- oddSide = !oddSide;
- }
- }
- if (oddSide)
- angle = 90 * 64 - angle;
-
- di = xAngleToDashIndex (angle);
- excess = angle - dashIndexToXAngle (di);
-
- len = map->map[di];
- /*
- * linearly interpolate between this point and the next
- */
- if (excess > 0) {
- excesslen = (map->map[di + 1] - map->map[di]) *
- ((double) excess) / dashXAngleStep;
- len += excesslen;
- }
- if (oddSide)
- totallen += (sidelen - len);
- else
- totallen += len;
- return totallen;
-}
-
-/*
- * len is along the arc, but may be more than one rotation
- */
-
-static int
-lengthToAngle (
- double len,
- dashMap *map)
-{
- double sidelen = map->map[DASH_MAP_SIZE - 1];
- int angle, angleexcess;
- Bool oddSide = FALSE;
- int a0, a1, a;
-
- angle = 0;
- /*
- * step around the ellipse, subtracting sidelens and
- * adding 90 degrees. oddSide will tell if the
- * map should be interpolated in reverse
- */
- if (len >= 0) {
- if (sidelen == 0)
- return 2 * FULLCIRCLE; /* infinity */
- while (len >= sidelen) {
- angle += 90 * 64;
- len -= sidelen;
- oddSide = !oddSide;
- }
- } else {
- if (sidelen == 0)
- return -2 * FULLCIRCLE; /* infinity */
- while (len < 0) {
- angle -= 90 * 64;
- len += sidelen;
- oddSide = !oddSide;
- }
- }
- if (oddSide)
- len = sidelen - len;
- a0 = 0;
- a1 = DASH_MAP_SIZE - 1;
- /*
- * binary search for the closest pre-computed length
- */
- while (a1 - a0 > 1) {
- a = (a0 + a1) / 2;
- if (len > map->map[a])
- a0 = a;
- else
- a1 = a;
- }
- angleexcess = dashIndexToXAngle (a0);
- /*
- * linearly interpolate to the next point
- */
- angleexcess += (len - map->map[a0]) /
- (map->map[a0+1] - map->map[a0]) * dashXAngleStep;
- if (oddSide)
- angle += (90 * 64) - angleexcess;
- else
- angle += angleexcess;
- return angle;
-}
-
-/*
- * compute the angle of an ellipse which cooresponds to
- * the given path length. Note that the correct solution
- * to this problem is an eliptic integral, we'll punt and
- * approximate (it's only for dashes anyway). This
- * approximation uses a polygon.
- *
- * The remaining portion of len is stored in *lenp -
- * this will be negative if the arc extends beyond
- * len and positive if len extends beyond the arc.
- */
-
-static int
-computeAngleFromPath (
- int startAngle,
- int endAngle, /* normalized absolute angles in *64 degrees */
- dashMap *map,
- int *lenp,
- int backwards)
-{
- int a0, a1, a;
- double len0;
- int len;
-
- a0 = startAngle;
- a1 = endAngle;
- len = *lenp;
- if (backwards) {
- /*
- * flip the problem around to always be
- * forwards
- */
- a0 = FULLCIRCLE - a0;
- a1 = FULLCIRCLE - a1;
- }
- if (a1 < a0)
- a1 += FULLCIRCLE;
- len0 = angleToLength (a0, map);
- a = lengthToAngle (len0 + len, map);
- if (a > a1) {
- a = a1;
- len -= angleToLength (a1, map) - len0;
- } else
- len = 0;
- if (backwards)
- a = FULLCIRCLE - a;
- *lenp = len;
- return a;
-}
-
-/*
- * scan convert wide arcs.
- */
-
-/*
- * draw zero width/height arcs
- */
-
-static void
-drawZeroArc (
- DrawablePtr pDraw,
- GCPtr pGC,
- xArc *tarc,
- int lw,
- miArcFacePtr left,
- miArcFacePtr right)
-{
- double x0 = 0.0, y0 = 0.0, x1 = 0.0, y1 = 0.0, w, h, x, y;
- double xmax, ymax, xmin, ymin;
- int a0, a1;
- double a, startAngle, endAngle;
- double l, lx, ly;
-
- l = lw / 2.0;
- a0 = tarc->angle1;
- a1 = tarc->angle2;
- if (a1 > FULLCIRCLE)
- a1 = FULLCIRCLE;
- else if (a1 < -FULLCIRCLE)
- a1 = -FULLCIRCLE;
- w = (double)tarc->width / 2.0;
- h = (double)tarc->height / 2.0;
- /*
- * play in X coordinates right away
- */
- startAngle = - ((double) a0 / 64.0);
- endAngle = - ((double) (a0 + a1) / 64.0);
-
- xmax = -w;
- xmin = w;
- ymax = -h;
- ymin = h;
- a = startAngle;
- for (;;)
- {
- x = w * miDcos(a);
- y = h * miDsin(a);
- if (a == startAngle)
- {
- x0 = x;
- y0 = y;
- }
- if (a == endAngle)
- {
- x1 = x;
- y1 = y;
- }
- if (x > xmax)
- xmax = x;
- if (x < xmin)
- xmin = x;
- if (y > ymax)
- ymax = y;
- if (y < ymin)
- ymin = y;
- if (a == endAngle)
- break;
- if (a1 < 0) /* clockwise */
- {
- if (floor (a / 90.0) == floor (endAngle / 90.0))
- a = endAngle;
- else
- a = 90 * (floor (a/90.0) + 1);
- }
- else
- {
- if (ceil (a / 90.0) == ceil (endAngle / 90.0))
- a = endAngle;
- else
- a = 90 * (ceil (a/90.0) - 1);
- }
- }
- lx = ly = l;
- if ((x1 - x0) + (y1 - y0) < 0)
- lx = ly = -l;
- if (h)
- {
- ly = 0.0;
- lx = -lx;
- }
- else
- lx = 0.0;
- if (right)
- {
- right->center.x = x0;
- right->center.y = y0;
- right->clock.x = x0 - lx;
- right->clock.y = y0 - ly;
- right->counterClock.x = x0 + lx;
- right->counterClock.y = y0 + ly;
- }
- if (left)
- {
- left->center.x = x1;
- left->center.y = y1;
- left->clock.x = x1 + lx;
- left->clock.y = y1 + ly;
- left->counterClock.x = x1 - lx;
- left->counterClock.y = y1 - ly;
- }
-
- x0 = xmin;
- x1 = xmax;
- y0 = ymin;
- y1 = ymax;
- if (ymin != y1) {
- xmin = -l;
- xmax = l;
- } else {
- ymin = -l;
- ymax = l;
- }
- if (xmax != xmin && ymax != ymin) {
- int minx, maxx, miny, maxy;
- xRectangle rect;
-
- minx = ICEIL (xmin + w) + tarc->x;
- maxx = ICEIL (xmax + w) + tarc->x;
- miny = ICEIL (ymin + h) + tarc->y;
- maxy = ICEIL (ymax + h) + tarc->y;
- rect.x = minx;
- rect.y = miny;
- rect.width = maxx - minx;
- rect.height = maxy - miny;
- (*pGC->ops->PolyFillRect) (pDraw, pGC, 1, &rect);
- }
-}
-
-/*
- * this computes the ellipse y value associated with the
- * bottom of the tail.
- */
-
-static void
-tailEllipseY (
- struct arc_def *def,
- struct accelerators *acc)
-{
- double t;
-
- acc->tail_y = 0.0;
- if (def->w == def->h)
- return;
- t = def->l * def->w;
- if (def->w > def->h) {
- if (t < acc->h2)
- return;
- } else {
- if (t > acc->h2)
- return;
- }
- t = 2.0 * def->h * t;
- t = (CUBED_ROOT_4 * acc->h2 - cbrt(t * t)) / acc->h2mw2;
- if (t > 0.0)
- acc->tail_y = def->h / CUBED_ROOT_2 * sqrt(t);
-}
-
-/*
- * inverse functions -- compute edge coordinates
- * from the ellipse
- */
-
-static double
-outerXfromXY (
- double x,
- double y,
- struct arc_def *def,
- struct accelerators *acc)
-{
- return x + (x * acc->h2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
-}
-
-static double
-outerYfromXY (
- double x,
- double y,
- struct arc_def *def,
- struct accelerators *acc)
-{
- return y + (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
-}
-
-static double
-innerXfromXY (
- double x,
- double y,
- struct arc_def *def,
- struct accelerators *acc)
-{
- return x - (x * acc->h2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
-}
-
-static double
-innerYfromXY (
- double x,
- double y,
- struct arc_def *def,
- struct accelerators *acc)
-{
- return y - (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
-}
-
-static double
-innerYfromY (
- double y,
- struct arc_def *def,
- struct accelerators *acc)
-{
- double x;
-
- x = (def->w / def->h) * sqrt (acc->h2 - y*y);
-
- return y - (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
-}
-
-static void
-computeLine (
- double x1,
- double y1,
- double x2,
- double y2,
- struct line *line)
-{
- if (y1 == y2)
- line->valid = 0;
- else {
- line->m = (x1 - x2) / (y1 - y2);
- line->b = x1 - y1 * line->m;
- line->valid = 1;
- }
-}
-
-/*
- * compute various accelerators for an ellipse. These
- * are simply values that are used repeatedly in
- * the computations
- */
-
-static void
-computeAcc (
- xArc *tarc,
- int lw,
- struct arc_def *def,
- struct accelerators *acc)
-{
- def->w = ((double) tarc->width) / 2.0;
- def->h = ((double) tarc->height) / 2.0;
- def->l = ((double) lw) / 2.0;
- acc->h2 = def->h * def->h;
- acc->w2 = def->w * def->w;
- acc->h4 = acc->h2 * acc->h2;
- acc->w4 = acc->w2 * acc->w2;
- acc->h2l = acc->h2 * def->l;
- acc->w2l = acc->w2 * def->l;
- acc->h2mw2 = acc->h2 - acc->w2;
- acc->fromIntX = (tarc->width & 1) ? 0.5 : 0.0;
- acc->fromIntY = (tarc->height & 1) ? 0.5 : 0.0;
- acc->xorg = tarc->x + (tarc->width >> 1);
- acc->yorgu = tarc->y + (tarc->height >> 1);
- acc->yorgl = acc->yorgu + (tarc->height & 1);
- tailEllipseY (def, acc);
-}
-
-/*
- * compute y value bounds of various portions of the arc,
- * the outer edge, the ellipse and the inner edge.
- */
-
-static void
-computeBound (
- struct arc_def *def,
- struct arc_bound *bound,
- struct accelerators *acc,
- miArcFacePtr right,
- miArcFacePtr left)
-{
- double t;
- double innerTaily;
- double tail_y;
- struct bound innerx, outerx;
- struct bound ellipsex;
-
- bound->ellipse.min = Dsin (def->a0) * def->h;
- bound->ellipse.max = Dsin (def->a1) * def->h;
- if (def->a0 == 45 && def->w == def->h)
- ellipsex.min = bound->ellipse.min;
- else
- ellipsex.min = Dcos (def->a0) * def->w;
- if (def->a1 == 45 && def->w == def->h)
- ellipsex.max = bound->ellipse.max;
- else
- ellipsex.max = Dcos (def->a1) * def->w;
- bound->outer.min = outerYfromXY (ellipsex.min, bound->ellipse.min, def, acc);
- bound->outer.max = outerYfromXY (ellipsex.max, bound->ellipse.max, def, acc);
- bound->inner.min = innerYfromXY (ellipsex.min, bound->ellipse.min, def, acc);
- bound->inner.max = innerYfromXY (ellipsex.max, bound->ellipse.max, def, acc);
-
- outerx.min = outerXfromXY (ellipsex.min, bound->ellipse.min, def, acc);
- outerx.max = outerXfromXY (ellipsex.max, bound->ellipse.max, def, acc);
- innerx.min = innerXfromXY (ellipsex.min, bound->ellipse.min, def, acc);
- innerx.max = innerXfromXY (ellipsex.max, bound->ellipse.max, def, acc);
-
- /*
- * save the line end points for the
- * cap code to use. Careful here, these are
- * in cartesean coordinates (y increasing upwards)
- * while the cap code uses inverted coordinates
- * (y increasing downwards)
- */
-
- if (right) {
- right->counterClock.y = bound->outer.min;
- right->counterClock.x = outerx.min;
- right->center.y = bound->ellipse.min;
- right->center.x = ellipsex.min;
- right->clock.y = bound->inner.min;
- right->clock.x = innerx.min;
- }
-
- if (left) {
- left->clock.y = bound->outer.max;
- left->clock.x = outerx.max;
- left->center.y = bound->ellipse.max;
- left->center.x = ellipsex.max;
- left->counterClock.y = bound->inner.max;
- left->counterClock.x = innerx.max;
- }
-
- bound->left.min = bound->inner.max;
- bound->left.max = bound->outer.max;
- bound->right.min = bound->inner.min;
- bound->right.max = bound->outer.min;
-
- computeLine (innerx.min, bound->inner.min, outerx.min, bound->outer.min,
- &acc->right);
- computeLine (innerx.max, bound->inner.max, outerx.max, bound->outer.max,
- &acc->left);
-
- if (bound->inner.min > bound->inner.max) {
- t = bound->inner.min;
- bound->inner.min = bound->inner.max;
- bound->inner.max = t;
- }
- tail_y = acc->tail_y;
- if (tail_y > bound->ellipse.max)
- tail_y = bound->ellipse.max;
- else if (tail_y < bound->ellipse.min)
- tail_y = bound->ellipse.min;
- innerTaily = innerYfromY (tail_y, def, acc);
- if (bound->inner.min > innerTaily)
- bound->inner.min = innerTaily;
- if (bound->inner.max < innerTaily)
- bound->inner.max = innerTaily;
- bound->inneri.min = ICEIL(bound->inner.min - acc->fromIntY);
- bound->inneri.max = floor(bound->inner.max - acc->fromIntY);
- bound->outeri.min = ICEIL(bound->outer.min - acc->fromIntY);
- bound->outeri.max = floor(bound->outer.max - acc->fromIntY);
-}
-
-/*
- * this section computes the x value of the span at y
- * intersected with the specified face of the ellipse.
- *
- * this is the min/max X value over the set of normal
- * lines to the entire ellipse, the equation of the
- * normal lines is:
- *
- * ellipse_x h^2 h^2
- * x = ------------ y + ellipse_x (1 - --- )
- * ellipse_y w^2 w^2
- *
- * compute the derivative with-respect-to ellipse_y and solve
- * for zero:
- *
- * (w^2 - h^2) ellipse_y^3 + h^4 y
- * 0 = - ----------------------------------
- * h w ellipse_y^2 sqrt (h^2 - ellipse_y^2)
- *
- * ( h^4 y )
- * ellipse_y = ( ---------- ) ^ (1/3)
- * ( (h^2 - w^2) )
- *
- * The other two solutions to the equation are imaginary.
- *
- * This gives the position on the ellipse which generates
- * the normal with the largest/smallest x intersection point.
- *
- * Now compute the second derivative to check whether
- * the intersection is a minimum or maximum:
- *
- * h (y0^3 (w^2 - h^2) + h^2 y (3y0^2 - 2h^2))
- * - -------------------------------------------
- * w y0^3 (sqrt (h^2 - y^2)) ^ 3
- *
- * as we only care about the sign,
- *
- * - (y0^3 (w^2 - h^2) + h^2 y (3y0^2 - 2h^2))
- *
- * or (to use accelerators),
- *
- * y0^3 (h^2 - w^2) - h^2 y (3y0^2 - 2h^2)
- *
- */
-
-/*
- * computes the position on the ellipse whose normal line
- * intersects the given scan line maximally
- */
-
-static double
-hookEllipseY (
- double scan_y,
- struct arc_bound *bound,
- struct accelerators *acc,
- int left)
-{
- double ret;
-
- if (acc->h2mw2 == 0) {
- if ( (scan_y > 0 && !left) || (scan_y < 0 && left) )
- return bound->ellipse.min;
- return bound->ellipse.max;
- }
- ret = (acc->h4 * scan_y) / (acc->h2mw2);
- if (ret >= 0)
- return cbrt (ret);
- else
- return -cbrt (-ret);
-}
-
-/*
- * computes the X value of the intersection of the
- * given scan line with the right side of the lower hook
- */
-
-static double
-hookX (
- double scan_y,
- struct arc_def *def,
- struct arc_bound *bound,
- struct accelerators *acc,
- int left)
-{
- double ellipse_y, x;
- double maxMin;
-
- if (def->w != def->h) {
- ellipse_y = hookEllipseY (scan_y, bound, acc, left);
- if (boundedLe (ellipse_y, bound->ellipse)) {
- /*
- * compute the value of the second
- * derivative
- */
- maxMin = ellipse_y*ellipse_y*ellipse_y * acc->h2mw2 -
- acc->h2 * scan_y * (3 * ellipse_y*ellipse_y - 2*acc->h2);
- if ((left && maxMin > 0) || (!left && maxMin < 0)) {
- if (ellipse_y == 0)
- return def->w + left ? -def->l : def->l;
- x = (acc->h2 * scan_y - ellipse_y * acc->h2mw2) *
- sqrt (acc->h2 - ellipse_y * ellipse_y) /
- (def->h * def->w * ellipse_y);
- return x;
- }
- }
- }
- if (left) {
- if (acc->left.valid && boundedLe (scan_y, bound->left)) {
- x = intersectLine (scan_y, acc->left);
- } else {
- if (acc->right.valid)
- x = intersectLine (scan_y, acc->right);
- else
- x = def->w - def->l;
- }
- } else {
- if (acc->right.valid && boundedLe (scan_y, bound->right)) {
- x = intersectLine (scan_y, acc->right);
- } else {
- if (acc->left.valid)
- x = intersectLine (scan_y, acc->left);
- else
- x = def->w - def->l;
- }
- }
- return x;
-}
-
-/*
- * generate the set of spans with
- * the given y coordinate
- */
-
-static void
-arcSpan (
- int y,
- int lx,
- int lw,
- int rx,
- int rw,
- struct arc_def *def,
- struct arc_bound *bounds,
- struct accelerators *acc,
- int mask)
-{
- int linx, loutx, rinx, routx;
- double x, altx;
-
- if (boundedLe (y, bounds->inneri)) {
- linx = -(lx + lw);
- rinx = rx;
- } else {
- /*
- * intersection with left face
- */
- x = hookX (y + acc->fromIntY, def, bounds, acc, 1);
- if (acc->right.valid &&
- boundedLe (y + acc->fromIntY, bounds->right))
- {
- altx = intersectLine (y + acc->fromIntY, acc->right);
- if (altx < x)
- x = altx;
- }
- linx = -ICEIL(acc->fromIntX - x);
- rinx = ICEIL(acc->fromIntX + x);
- }
- if (boundedLe (y, bounds->outeri)) {
- loutx = -lx;
- routx = rx + rw;
- } else {
- /*
- * intersection with right face
- */
- x = hookX (y + acc->fromIntY, def, bounds, acc, 0);
- if (acc->left.valid &&
- boundedLe (y + acc->fromIntY, bounds->left))
- {
- altx = x;
- x = intersectLine (y + acc->fromIntY, acc->left);
- if (x < altx)
- x = altx;
- }
- loutx = -ICEIL(acc->fromIntX - x);
- routx = ICEIL(acc->fromIntX + x);
- }
- if (routx > rinx) {
- if (mask & 1)
- newFinalSpan (acc->yorgu - y,
- acc->xorg + rinx, acc->xorg + routx);
- if (mask & 8)
- newFinalSpan (acc->yorgl + y,
- acc->xorg + rinx, acc->xorg + routx);
- }
- if (loutx > linx) {
- if (mask & 2)
- newFinalSpan (acc->yorgu - y,
- acc->xorg - loutx, acc->xorg - linx);
- if (mask & 4)
- newFinalSpan (acc->yorgl + y,
- acc->xorg - loutx, acc->xorg - linx);
- }
-}
-
-static void
-arcSpan0 (
- int lx,
- int lw,
- int rx,
- int rw,
- struct arc_def *def,
- struct arc_bound *bounds,
- struct accelerators *acc,
- int mask)
-{
- double x;
-
- if (boundedLe (0, bounds->inneri) &&
- acc->left.valid && boundedLe (0, bounds->left) &&
- acc->left.b > 0)
- {
- x = def->w - def->l;
- if (acc->left.b < x)
- x = acc->left.b;
- lw = ICEIL(acc->fromIntX - x) - lx;
- rw += rx;
- rx = ICEIL(acc->fromIntX + x);
- rw -= rx;
- }
- arcSpan (0, lx, lw, rx, rw, def, bounds, acc, mask);
-}
-
-static void
-tailSpan (
- int y,
- int lw,
- int rw,
- struct arc_def *def,
- struct arc_bound *bounds,
- struct accelerators *acc,
- int mask)
-{
- double yy, xalt, x, lx, rx;
- int n;
-
- if (boundedLe(y, bounds->outeri))
- arcSpan (y, 0, lw, -rw, rw, def, bounds, acc, mask);
- else if (def->w != def->h) {
- yy = y + acc->fromIntY;
- x = tailX(yy, def, bounds, acc);
- if (yy == 0.0 && x == -rw - acc->fromIntX)
- return;
- if (acc->right.valid && boundedLe (yy, bounds->right)) {
- rx = x;
- lx = -x;
- xalt = intersectLine (yy, acc->right);
- if (xalt >= -rw - acc->fromIntX && xalt <= rx)
- rx = xalt;
- n = ICEIL(acc->fromIntX + lx);
- if (lw > n) {
- if (mask & 2)
- newFinalSpan (acc->yorgu - y,
- acc->xorg + n, acc->xorg + lw);
- if (mask & 4)
- newFinalSpan (acc->yorgl + y,
- acc->xorg + n, acc->xorg + lw);
- }
- n = ICEIL(acc->fromIntX + rx);
- if (n > -rw) {
- if (mask & 1)
- newFinalSpan (acc->yorgu - y,
- acc->xorg - rw, acc->xorg + n);
- if (mask & 8)
- newFinalSpan (acc->yorgl + y,
- acc->xorg - rw, acc->xorg + n);
- }
- }
- arcSpan (y,
- ICEIL(acc->fromIntX - x), 0,
- ICEIL(acc->fromIntX + x), 0,
- def, bounds, acc, mask);
- }
-}
-
-/*
- * create whole arcs out of pieces. This code is
- * very bad.
- */
-
-static struct finalSpan **finalSpans = NULL;
-static int finalMiny = 0, finalMaxy = -1;
-static int finalSize = 0;
-
-static int nspans = 0; /* total spans, not just y coords */
-
-struct finalSpan {
- struct finalSpan *next;
- int min, max; /* x values */
-};
-
-static struct finalSpan *freeFinalSpans, *tmpFinalSpan;
-
-# define allocFinalSpan() (freeFinalSpans ?\
- ((tmpFinalSpan = freeFinalSpans), \
- (freeFinalSpans = freeFinalSpans->next), \
- (tmpFinalSpan->next = 0), \
- tmpFinalSpan) : \
- realAllocSpan ())
-
-# define SPAN_CHUNK_SIZE 128
-
-struct finalSpanChunk {
- struct finalSpan data[SPAN_CHUNK_SIZE];
- struct finalSpanChunk *next;
-};
-
-static struct finalSpanChunk *chunks;
-
-static struct finalSpan *
-realAllocSpan (void)
-{
- struct finalSpanChunk *newChunk;
- struct finalSpan *span;
- int i;
-
- newChunk = malloc(sizeof (struct finalSpanChunk));
- if (!newChunk)
- return (struct finalSpan *) NULL;
- newChunk->next = chunks;
- chunks = newChunk;
- freeFinalSpans = span = newChunk->data + 1;
- for (i = 1; i < SPAN_CHUNK_SIZE-1; i++) {
- span->next = span+1;
- span++;
- }
- span->next = 0;
- span = newChunk->data;
- span->next = 0;
- return span;
-}
-
-static void
-disposeFinalSpans (void)
-{
- struct finalSpanChunk *chunk, *next;
-
- for (chunk = chunks; chunk; chunk = next) {
- next = chunk->next;
- free(chunk);
- }
- chunks = 0;
- freeFinalSpans = 0;
- free(finalSpans);
- finalSpans = 0;
-}
-
-static void
-fillSpans (
- DrawablePtr pDrawable,
- GCPtr pGC)
-{
- struct finalSpan *span;
- DDXPointPtr xSpan;
- int *xWidth;
- int i;
- struct finalSpan **f;
- int spany;
- DDXPointPtr xSpans;
- int *xWidths;
-
- if (nspans == 0)
- return;
- xSpan = xSpans = malloc(nspans * sizeof (DDXPointRec));
- xWidth = xWidths = malloc(nspans * sizeof (int));
- if (xSpans && xWidths)
- {
- i = 0;
- f = finalSpans;
- for (spany = finalMiny; spany <= finalMaxy; spany++, f++) {
- for (span = *f; span; span=span->next) {
- if (span->max <= span->min)
- continue;
- xSpan->x = span->min;
- xSpan->y = spany;
- ++xSpan;
- *xWidth++ = span->max - span->min;
- ++i;
- }
- }
- (*pGC->ops->FillSpans) (pDrawable, pGC, i, xSpans, xWidths, TRUE);
- }
- disposeFinalSpans ();
- free(xSpans);
- free(xWidths);
- finalMiny = 0;
- finalMaxy = -1;
- finalSize = 0;
- nspans = 0;
-}
-
-# define SPAN_REALLOC 100
-
-# define findSpan(y) ((finalMiny <= (y) && (y) <= finalMaxy) ? \
- &finalSpans[(y) - finalMiny] : \
- realFindSpan (y))
-
-static struct finalSpan **
-realFindSpan (int y)
-{
- struct finalSpan **newSpans;
- int newSize, newMiny, newMaxy;
- int change;
- int i;
-
- if (y < finalMiny || y > finalMaxy) {
- if (!finalSize) {
- finalMiny = y;
- finalMaxy = y - 1;
- }
- if (y < finalMiny)
- change = finalMiny - y;
- else
- change = y - finalMaxy;
- if (change >= SPAN_REALLOC)
- change += SPAN_REALLOC;
- else
- change = SPAN_REALLOC;
- newSize = finalSize + change;
- newSpans = malloc(newSize * sizeof (struct finalSpan *));
- if (!newSpans)
- return NULL;
- newMiny = finalMiny;
- newMaxy = finalMaxy;
- if (y < finalMiny)
- newMiny = finalMiny - change;
- else
- newMaxy = finalMaxy + change;
- if (finalSpans) {
- memmove(((char *) newSpans) + (finalMiny-newMiny) * sizeof (struct finalSpan *),
- (char *) finalSpans,
- finalSize * sizeof (struct finalSpan *));
- free(finalSpans);
- }
- if ((i = finalMiny - newMiny) > 0)
- memset((char *)newSpans, 0, i * sizeof (struct finalSpan *));
- if ((i = newMaxy - finalMaxy) > 0)
- memset((char *)(newSpans + newSize - i), 0,
- i * sizeof (struct finalSpan *));
- finalSpans = newSpans;
- finalMaxy = newMaxy;
- finalMiny = newMiny;
- finalSize = newSize;
- }
- return &finalSpans[y - finalMiny];
-}
-
-static void
-newFinalSpan (
- int y,
- int xmin,
- int xmax)
-{
- struct finalSpan *x;
- struct finalSpan **f;
- struct finalSpan *oldx;
- struct finalSpan *prev;
-
- f = findSpan (y);
- if (!f)
- return;
- oldx = 0;
- for (;;) {
- prev = 0;
- for (x = *f; x; x=x->next) {
- if (x == oldx) {
- prev = x;
- continue;
- }
- if (x->min <= xmax && xmin <= x->max) {
- if (oldx) {
- oldx->min = min (x->min, xmin);
- oldx->max = max (x->max, xmax);
- if (prev)
- prev->next = x->next;
- else
- *f = x->next;
- --nspans;
- } else {
- x->min = min (x->min, xmin);
- x->max = max (x->max, xmax);
- oldx = x;
- }
- xmin = oldx->min;
- xmax = oldx->max;
- break;
- }
- prev = x;
- }
- if (!x)
- break;
- }
- if (!oldx) {
- x = allocFinalSpan ();
- if (x)
- {
- x->min = xmin;
- x->max = xmax;
- x->next = *f;
- *f = x;
- ++nspans;
- }
- }
-}
-
-static void
-mirrorSppPoint (
- int quadrant,
- SppPointPtr sppPoint)
-{
- switch (quadrant) {
- case 0:
- break;
- case 1:
- sppPoint->x = -sppPoint->x;
- break;
- case 2:
- sppPoint->x = -sppPoint->x;
- sppPoint->y = -sppPoint->y;
- break;
- case 3:
- sppPoint->y = -sppPoint->y;
- break;
- }
- /*
- * and translate to X coordinate system
- */
- sppPoint->y = -sppPoint->y;
-}
-
-/*
- * split an arc into pieces which are scan-converted
- * in the first-quadrant and mirrored into position.
- * This is necessary as the scan-conversion code can
- * only deal with arcs completely contained in the
- * first quadrant.
- */
-
-static void
-drawArc (
- xArc *tarc,
- int l,
- int a0,
- int a1,
- miArcFacePtr right,
- miArcFacePtr left) /* save end line points */
-{
- struct arc_def def;
- struct accelerators acc;
- int startq, endq, curq;
- int rightq, leftq = 0, righta = 0, lefta = 0;
- miArcFacePtr passRight, passLeft;
- int q0 = 0, q1 = 0, mask;
- struct band {
- int a0, a1;
- int mask;
- } band[5], sweep[20];
- int bandno, sweepno;
- int i, j;
- int flipRight = 0, flipLeft = 0;
- int copyEnd = 0;
- miArcSpanData *spdata;
-
- spdata = miComputeWideEllipse(l, tarc);
- if (!spdata)
- return;
-
- if (a1 < a0)
- a1 += 360 * 64;
- startq = a0 / (90 * 64);
- if (a0 == a1)
- endq = startq;
- else
- endq = (a1-1) / (90 * 64);
- bandno = 0;
- curq = startq;
- rightq = -1;
- for (;;) {
- switch (curq) {
- case 0:
- if (a0 > 90 * 64)
- q0 = 0;
- else
- q0 = a0;
- if (a1 < 360 * 64)
- q1 = min (a1, 90 * 64);
- else
- q1 = 90 * 64;
- if (curq == startq && a0 == q0 && rightq < 0) {
- righta = q0;
- rightq = curq;
- }
- if (curq == endq && a1 == q1) {
- lefta = q1;
- leftq = curq;
- }
- break;
- case 1:
- if (a1 < 90 * 64)
- q0 = 0;
- else
- q0 = 180 * 64 - min (a1, 180 * 64);
- if (a0 > 180 * 64)
- q1 = 90 * 64;
- else
- q1 = 180 * 64 - max (a0, 90 * 64);
- if (curq == startq && 180 * 64 - a0 == q1) {
- righta = q1;
- rightq = curq;
- }
- if (curq == endq && 180 * 64 - a1 == q0) {
- lefta = q0;
- leftq = curq;
- }
- break;
- case 2:
- if (a0 > 270 * 64)
- q0 = 0;
- else
- q0 = max (a0, 180 * 64) - 180 * 64;
- if (a1 < 180 * 64)
- q1 = 90 * 64;
- else
- q1 = min (a1, 270 * 64) - 180 * 64;
- if (curq == startq && a0 - 180*64 == q0) {
- righta = q0;
- rightq = curq;
- }
- if (curq == endq && a1 - 180 * 64 == q1) {
- lefta = q1;
- leftq = curq;
- }
- break;
- case 3:
- if (a1 < 270 * 64)
- q0 = 0;
- else
- q0 = 360 * 64 - min (a1, 360 * 64);
- q1 = 360 * 64 - max (a0, 270 * 64);
- if (curq == startq && 360 * 64 - a0 == q1) {
- righta = q1;
- rightq = curq;
- }
- if (curq == endq && 360 * 64 - a1 == q0) {
- lefta = q0;
- leftq = curq;
- }
- break;
- }
- band[bandno].a0 = q0;
- band[bandno].a1 = q1;
- band[bandno].mask = 1 << curq;
- bandno++;
- if (curq == endq)
- break;
- curq++;
- if (curq == 4) {
- a0 = 0;
- a1 -= 360 * 64;
- curq = 0;
- endq -= 4;
- }
- }
- sweepno = 0;
- for (;;) {
- q0 = 90 * 64;
- mask = 0;
- /*
- * find left-most point
- */
- for (i = 0; i < bandno; i++)
- if (band[i].a0 <= q0) {
- q0 = band[i].a0;
- q1 = band[i].a1;
- mask = band[i].mask;
- }
- if (!mask)
- break;
- /*
- * locate next point of change
- */
- for (i = 0; i < bandno; i++)
- if (!(mask & band[i].mask)) {
- if (band[i].a0 == q0) {
- if (band[i].a1 < q1)
- q1 = band[i].a1;
- mask |= band[i].mask;
- } else if (band[i].a0 < q1)
- q1 = band[i].a0;
- }
- /*
- * create a new sweep
- */
- sweep[sweepno].a0 = q0;
- sweep[sweepno].a1 = q1;
- sweep[sweepno].mask = mask;
- sweepno++;
- /*
- * subtract the sweep from the affected bands
- */
- for (i = 0; i < bandno; i++)
- if (band[i].a0 == q0) {
- band[i].a0 = q1;
- /*
- * check if this band is empty
- */
- if (band[i].a0 == band[i].a1)
- band[i].a1 = band[i].a0 = 90 * 64 + 1;
- }
- }
- computeAcc (tarc, l, &def, &acc);
- for (j = 0; j < sweepno; j++) {
- mask = sweep[j].mask;
- passRight = passLeft = 0;
- if (mask & (1 << rightq)) {
- if (sweep[j].a0 == righta)
- passRight = right;
- else if (sweep[j].a1 == righta) {
- passLeft = right;
- flipRight = 1;
- }
- }
- if (mask & (1 << leftq)) {
- if (sweep[j].a1 == lefta)
- {
- if (passLeft)
- copyEnd = 1;
- passLeft = left;
- }
- else if (sweep[j].a0 == lefta) {
- if (passRight)
- copyEnd = 1;
- passRight = left;
- flipLeft = 1;
- }
- }
- drawQuadrant (&def, &acc, sweep[j].a0, sweep[j].a1, mask,
- passRight, passLeft, spdata);
- }
- /*
- * when copyEnd is set, both ends of the arc were computed
- * at the same time; drawQuadrant only takes one end though,
- * so the left end will be the only one holding the data. Copy
- * it from there.
- */
- if (copyEnd)
- *right = *left;
- /*
- * mirror the coordinates generated for the
- * faces of the arc
- */
- if (right) {
- mirrorSppPoint (rightq, &right->clock);
- mirrorSppPoint (rightq, &right->center);
- mirrorSppPoint (rightq, &right->counterClock);
- if (flipRight) {
- SppPointRec temp;
-
- temp = right->clock;
- right->clock = right->counterClock;
- right->counterClock = temp;
- }
- }
- if (left) {
- mirrorSppPoint (leftq, &left->counterClock);
- mirrorSppPoint (leftq, &left->center);
- mirrorSppPoint (leftq, &left->clock);
- if (flipLeft) {
- SppPointRec temp;
-
- temp = left->clock;
- left->clock = left->counterClock;
- left->counterClock = temp;
- }
- }
- free(spdata);
-}
-
-static void
-drawQuadrant (
- struct arc_def *def,
- struct accelerators *acc,
- int a0,
- int a1,
- int mask,
- miArcFacePtr right,
- miArcFacePtr left,
- miArcSpanData *spdata)
-{
- struct arc_bound bound;
- double yy, x, xalt;
- int y, miny, maxy;
- int n;
- miArcSpan *span;
-
- def->a0 = ((double) a0) / 64.0;
- def->a1 = ((double) a1) / 64.0;
- computeBound (def, &bound, acc, right, left);
- yy = bound.inner.min;
- if (bound.outer.min < yy)
- yy = bound.outer.min;
- miny = ICEIL(yy - acc->fromIntY);
- yy = bound.inner.max;
- if (bound.outer.max > yy)
- yy = bound.outer.max;
- maxy = floor(yy - acc->fromIntY);
- y = spdata->k;
- span = spdata->spans;
- if (spdata->top)
- {
- if (a1 == 90 * 64 && (mask & 1))
- newFinalSpan (acc->yorgu - y - 1, acc->xorg, acc->xorg + 1);
- span++;
- }
- for (n = spdata->count1; --n >= 0; )
- {
- if (y < miny)
- return;
- if (y <= maxy) {
- arcSpan (y,
- span->lx, -span->lx, 0, span->lx + span->lw,
- def, &bound, acc, mask);
- if (span->rw + span->rx)
- tailSpan (y, -span->rw, -span->rx, def, &bound, acc, mask);
- }
- y--;
- span++;
- }
- if (y < miny)
- return;
- if (spdata->hole)
- {
- if (y <= maxy)
- arcSpan (y, 0, 0, 0, 1, def, &bound, acc, mask & 0xc);
- }
- for (n = spdata->count2; --n >= 0; )
- {
- if (y < miny)
- return;
- if (y <= maxy)
- arcSpan (y, span->lx, span->lw, span->rx, span->rw,
- def, &bound, acc, mask);
- y--;
- span++;
- }
- if (spdata->bot && miny <= y && y <= maxy)
- {
- n = mask;
- if (y == miny)
- n &= 0xc;
- if (span->rw <= 0) {
- arcSpan0 (span->lx, -span->lx, 0, span->lx + span->lw,
- def, &bound, acc, n);
- if (span->rw + span->rx)
- tailSpan (y, -span->rw, -span->rx, def, &bound, acc, n);
- }
- else
- arcSpan0 (span->lx, span->lw, span->rx, span->rw,
- def, &bound, acc, n);
- y--;
- }
- while (y >= miny) {
- yy = y + acc->fromIntY;
- if (def->w == def->h) {
- xalt = def->w - def->l;
- x = -sqrt(xalt * xalt - yy * yy);
- } else {
- x = tailX(yy, def, &bound, acc);
- if (acc->left.valid && boundedLe (yy, bound.left)) {
- xalt = intersectLine (yy, acc->left);
- if (xalt < x)
- x = xalt;
- }
- if (acc->right.valid && boundedLe (yy, bound.right)) {
- xalt = intersectLine (yy, acc->right);
- if (xalt < x)
- x = xalt;
- }
- }
- arcSpan (y,
- ICEIL(acc->fromIntX - x), 0,
- ICEIL(acc->fromIntX + x), 0,
- def, &bound, acc, mask);
- y--;
- }
-}
+/***********************************************************
+
+Copyright 1987, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+******************************************************************/
+/* Author: Keith Packard and Bob Scheifler */
+/* Warning: this code is toxic, do not dally very long here. */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <math.h>
+#include <X11/X.h>
+#include <X11/Xprotostr.h>
+#include "misc.h"
+#include "gcstruct.h"
+#include "scrnintstr.h"
+#include "pixmapstr.h"
+#include "windowstr.h"
+#include "mifpoly.h"
+#include "mi.h"
+#include "mifillarc.h"
+#include <X11/Xfuncproto.h>
+
+#ifdef _MSC_VER
+#define hypot _hypot
+#endif
+
+static double miDsin(double a);
+static double miDcos(double a);
+static double miDasin(double v);
+static double miDatan2(double dy, double dx);
+
+#ifndef HAVE_CBRT
+static double
+cbrt(double x)
+{
+ if (x > 0.0)
+ return pow(x, 1.0/3.0);
+ else
+ return -pow(-x, 1.0/3.0);
+}
+#endif
+
+/*
+ * some interesting sematic interpretation of the protocol:
+ *
+ * Self intersecting arcs (i.e. those spanning 360 degrees)
+ * never join with other arcs, and are drawn without caps
+ * (unless on/off dashed, in which case each dash segment
+ * is capped, except when the last segment meets the
+ * first segment, when no caps are drawn)
+ *
+ * double dash arcs are drawn in two parts, first the
+ * odd dashes (drawn in background) then the even dashes
+ * (drawn in foreground). This means that overlapping
+ * sections of foreground/background are drawn twice,
+ * first in background then in foreground. The double-draw
+ * occurs even when the function uses the destination values
+ * (e.g. xor mode). This is the same way the wide-line
+ * code works and should be "fixed".
+ *
+ */
+
+#undef max
+#undef min
+
+_X_INLINE static int max (const int x, const int y)
+{
+ return x>y? x:y;
+}
+
+_X_INLINE static int min (const int x, const int y)
+{
+ return x<y? x:y;
+}
+
+struct bound {
+ double min, max;
+};
+
+struct ibound {
+ int min, max;
+};
+
+#define boundedLe(value, bounds)\
+ ((bounds).min <= (value) && (value) <= (bounds).max)
+
+struct line {
+ double m, b;
+ int valid;
+};
+
+#define intersectLine(y,line) (line.m * (y) + line.b)
+
+/*
+ * these are all y value bounds
+ */
+
+struct arc_bound {
+ struct bound ellipse;
+ struct bound inner;
+ struct bound outer;
+ struct bound right;
+ struct bound left;
+ struct ibound inneri;
+ struct ibound outeri;
+};
+
+struct accelerators {
+ double tail_y;
+ double h2;
+ double w2;
+ double h4;
+ double w4;
+ double h2mw2;
+ double h2l;
+ double w2l;
+ double fromIntX;
+ double fromIntY;
+ struct line left, right;
+ int yorgu;
+ int yorgl;
+ int xorg;
+};
+
+struct arc_def {
+ double w, h, l;
+ double a0, a1;
+};
+
+# define todeg(xAngle) (((double) (xAngle)) / 64.0)
+
+# define RIGHT_END 0
+# define LEFT_END 1
+
+typedef struct _miArcJoin {
+ int arcIndex0, arcIndex1;
+ int phase0, phase1;
+ int end0, end1;
+} miArcJoinRec, *miArcJoinPtr;
+
+typedef struct _miArcCap {
+ int arcIndex;
+ int end;
+} miArcCapRec, *miArcCapPtr;
+
+typedef struct _miArcFace {
+ SppPointRec clock;
+ SppPointRec center;
+ SppPointRec counterClock;
+} miArcFaceRec, *miArcFacePtr;
+
+typedef struct _miArcData {
+ xArc arc;
+ int render; /* non-zero means render after drawing */
+ int join; /* related join */
+ int cap; /* related cap */
+ int selfJoin; /* final dash meets first dash */
+ miArcFaceRec bounds[2];
+ double x0, y0, x1, y1;
+} miArcDataRec, *miArcDataPtr;
+
+/*
+ * This is an entire sequence of arcs, computed and categorized according
+ * to operation. miDashArcs generates either one or two of these.
+ */
+
+typedef struct _miPolyArc {
+ int narcs;
+ miArcDataPtr arcs;
+ int ncaps;
+ miArcCapPtr caps;
+ int njoins;
+ miArcJoinPtr joins;
+} miPolyArcRec, *miPolyArcPtr;
+
+static void fillSpans(DrawablePtr pDrawable, GCPtr pGC);
+static void newFinalSpan(int y, int xmin, int xmax);
+static void drawArc(xArc *tarc, int l, int a0, int a1, miArcFacePtr right,
+ miArcFacePtr left);
+static void drawZeroArc(DrawablePtr pDraw, GCPtr pGC, xArc *tarc, int lw,
+ miArcFacePtr left, miArcFacePtr right);
+static void miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft,
+ miArcFacePtr pRight, int xOrgLeft, int yOrgLeft,
+ double xFtransLeft, double yFtransLeft,
+ int xOrgRight, int yOrgRight,
+ double xFtransRight, double yFtransRight);
+static void miArcCap(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pFace,
+ int end, int xOrg, int yOrg, double xFtrans,
+ double yFtrans);
+static void miRoundCap(DrawablePtr pDraw, GCPtr pGC, SppPointRec pCenter,
+ SppPointRec pEnd, SppPointRec pCorner,
+ SppPointRec pOtherCorner, int fLineEnd,
+ int xOrg, int yOrg, double xFtrans, double yFtrans);
+static void miFreeArcs(miPolyArcPtr arcs, GCPtr pGC);
+static miPolyArcPtr miComputeArcs(xArc *parcs, int narcs, GCPtr pGC);
+static int miGetArcPts(SppArcPtr parc, int cpt, SppPointPtr *ppPts);
+
+# define CUBED_ROOT_2 1.2599210498948732038115849718451499938964
+# define CUBED_ROOT_4 1.5874010519681993173435330390930175781250
+
+/*
+ * draw one segment of the arc using the arc spans generation routines
+ */
+
+static void
+miArcSegment(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ xArc tarc,
+ miArcFacePtr right,
+ miArcFacePtr left)
+{
+ int l = pGC->lineWidth;
+ int a0, a1, startAngle, endAngle;
+ miArcFacePtr temp;
+
+ if (!l)
+ l = 1;
+
+ if (tarc.width == 0 || tarc.height == 0) {
+ drawZeroArc (pDraw, pGC, &tarc, l, left, right);
+ return;
+ }
+
+ if (pGC->miTranslate) {
+ tarc.x += pDraw->x;
+ tarc.y += pDraw->y;
+ }
+
+ a0 = tarc.angle1;
+ a1 = tarc.angle2;
+ if (a1 > FULLCIRCLE)
+ a1 = FULLCIRCLE;
+ else if (a1 < -FULLCIRCLE)
+ a1 = -FULLCIRCLE;
+ if (a1 < 0) {
+ startAngle = a0 + a1;
+ endAngle = a0;
+ temp = right;
+ right = left;
+ left = temp;
+ } else {
+ startAngle = a0;
+ endAngle = a0 + a1;
+ }
+ /*
+ * bounds check the two angles
+ */
+ if (startAngle < 0)
+ startAngle = FULLCIRCLE - (-startAngle) % FULLCIRCLE;
+ if (startAngle >= FULLCIRCLE)
+ startAngle = startAngle % FULLCIRCLE;
+ if (endAngle < 0)
+ endAngle = FULLCIRCLE - (-endAngle) % FULLCIRCLE;
+ if (endAngle > FULLCIRCLE)
+ endAngle = (endAngle-1) % FULLCIRCLE + 1;
+ if ((startAngle == endAngle) && a1) {
+ startAngle = 0;
+ endAngle = FULLCIRCLE;
+ }
+
+ drawArc (&tarc, l, startAngle, endAngle, right, left);
+}
+
+/*
+
+Three equations combine to describe the boundaries of the arc
+
+x^2/w^2 + y^2/h^2 = 1 ellipse itself
+(X-x)^2 + (Y-y)^2 = r^2 circle at (x, y) on the ellipse
+(Y-y) = (X-x)*w^2*y/(h^2*x) normal at (x, y) on the ellipse
+
+These lead to a quartic relating Y and y
+
+y^4 - (2Y)y^3 + (Y^2 + (h^4 - w^2*r^2)/(w^2 - h^2))y^2
+ - (2Y*h^4/(w^2 - h^2))y + (Y^2*h^4)/(w^2 - h^2) = 0
+
+The reducible cubic obtained from this quartic is
+
+z^3 - (3N)z^2 - 2V = 0
+
+where
+
+N = (Y^2 + (h^4 - w^2*r^2/(w^2 - h^2)))/6
+V = w^2*r^2*Y^2*h^4/(4 *(w^2 - h^2)^2)
+
+Let
+
+t = z - N
+p = -N^2
+q = -N^3 - V
+
+Then we get
+
+t^3 + 3pt + 2q = 0
+
+The discriminant of this cubic is
+
+D = q^2 + p^3
+
+When D > 0, a real root is obtained as
+
+z = N + cbrt(-q+sqrt(D)) + cbrt(-q-sqrt(D))
+
+When D < 0, a real root is obtained as
+
+z = N - 2m*cos(acos(-q/m^3)/3)
+
+where
+
+m = sqrt(|p|) * sign(q)
+
+Given a real root Z of the cubic, the roots of the quartic are the roots
+of the two quadratics
+
+y^2 + ((b+A)/2)y + (Z + (bZ - d)/A) = 0
+
+where
+
+A = +/- sqrt(8Z + b^2 - 4c)
+b, c, d are the cubic, quadratic, and linear coefficients of the quartic
+
+Some experimentation is then required to determine which solutions
+correspond to the inner and outer boundaries.
+
+*/
+
+typedef struct {
+ short lx, lw, rx, rw;
+} miArcSpan;
+
+typedef struct {
+ miArcSpan *spans;
+ int count1, count2, k;
+ char top, bot, hole;
+} miArcSpanData;
+
+static void drawQuadrant(struct arc_def *def, struct accelerators *acc,
+ int a0, int a1, int mask, miArcFacePtr right,
+ miArcFacePtr left, miArcSpanData *spdata);
+
+static void
+miComputeCircleSpans(
+ int lw,
+ xArc *parc,
+ miArcSpanData *spdata)
+{
+ miArcSpan *span;
+ int doinner;
+ int x, y, e;
+ int xk, yk, xm, ym, dx, dy;
+ int slw, inslw;
+ int inx = 0, iny, ine = 0;
+ int inxk = 0, inyk = 0, inxm = 0, inym = 0;
+
+ doinner = -lw;
+ slw = parc->width - doinner;
+ y = parc->height >> 1;
+ dy = parc->height & 1;
+ dx = 1 - dy;
+ MIWIDEARCSETUP(x, y, dy, slw, e, xk, xm, yk, ym);
+ inslw = parc->width + doinner;
+ if (inslw > 0)
+ {
+ spdata->hole = spdata->top;
+ MIWIDEARCSETUP(inx, iny, dy, inslw, ine, inxk, inxm, inyk, inym);
+ }
+ else
+ {
+ spdata->hole = FALSE;
+ doinner = -y;
+ }
+ spdata->count1 = -doinner - spdata->top;
+ spdata->count2 = y + doinner;
+ span = spdata->spans;
+ while (y)
+ {
+ MIFILLARCSTEP(slw);
+ span->lx = dy - x;
+ if (++doinner <= 0)
+ {
+ span->lw = slw;
+ span->rx = 0;
+ span->rw = span->lx + slw;
+ }
+ else
+ {
+ MIFILLINARCSTEP(inslw);
+ span->lw = x - inx;
+ span->rx = dy - inx + inslw;
+ span->rw = inx - x + slw - inslw;
+ }
+ span++;
+ }
+ if (spdata->bot)
+ {
+ if (spdata->count2)
+ spdata->count2--;
+ else
+ {
+ if (lw > (int)parc->height)
+ span[-1].rx = span[-1].rw = -((lw - (int)parc->height) >> 1);
+ else
+ span[-1].rw = 0;
+ spdata->count1--;
+ }
+ }
+}
+
+static void
+miComputeEllipseSpans(
+ int lw,
+ xArc *parc,
+ miArcSpanData *spdata)
+{
+ miArcSpan *span;
+ double w, h, r, xorg;
+ double Hs, Hf, WH, K, Vk, Nk, Fk, Vr, N, Nc, Z, rs;
+ double A, T, b, d, x, y, t, inx, outx = 0.0, hepp, hepm;
+ int flip, solution;
+
+ w = (double)parc->width / 2.0;
+ h = (double)parc->height / 2.0;
+ r = lw / 2.0;
+ rs = r * r;
+ Hs = h * h;
+ WH = w * w - Hs;
+ Nk = w * r;
+ Vk = (Nk * Hs) / (WH + WH);
+ Hf = Hs * Hs;
+ Nk = (Hf - Nk * Nk) / WH;
+ Fk = Hf / WH;
+ hepp = h + EPSILON;
+ hepm = h - EPSILON;
+ K = h + ((lw - 1) >> 1);
+ span = spdata->spans;
+ if (parc->width & 1)
+ xorg = .5;
+ else
+ xorg = 0.0;
+ if (spdata->top)
+ {
+ span->lx = 0;
+ span->lw = 1;
+ span++;
+ }
+ spdata->count1 = 0;
+ spdata->count2 = 0;
+ spdata->hole = (spdata->top &&
+ (int)parc->height * lw <= (int)(parc->width * parc->width) &&
+ lw < (int)parc->height);
+ for (; K > 0.0; K -= 1.0)
+ {
+ N = (K * K + Nk) / 6.0;
+ Nc = N * N * N;
+ Vr = Vk * K;
+ t = Nc + Vr * Vr;
+ d = Nc + t;
+ if (d < 0.0) {
+ d = Nc;
+ b = N;
+ if ( (b < 0.0) == (t < 0.0) )
+ {
+ b = -b;
+ d = -d;
+ }
+ Z = N - 2.0 * b * cos(acos(-t / d) / 3.0);
+ if ( (Z < 0.0) == (Vr < 0.0) )
+ flip = 2;
+ else
+ flip = 1;
+ }
+ else
+ {
+ d = Vr * sqrt(d);
+ Z = N + cbrt(t + d) + cbrt(t - d);
+ flip = 0;
+ }
+ A = sqrt((Z + Z) - Nk);
+ T = (Fk - Z) * K / A;
+ inx = 0.0;
+ solution = FALSE;
+ b = -A + K;
+ d = b * b - 4 * (Z + T);
+ if (d >= 0)
+ {
+ d = sqrt(d);
+ y = (b + d) / 2;
+ if ((y >= 0.0) && (y < hepp))
+ {
+ solution = TRUE;
+ if (y > hepm)
+ y = h;
+ t = y / h;
+ x = w * sqrt(1 - (t * t));
+ t = K - y;
+ if (rs - (t * t) >= 0)
+ t = sqrt(rs - (t * t));
+ else
+ t = 0;
+ if (flip == 2)
+ inx = x - t;
+ else
+ outx = x + t;
+ }
+ }
+ b = A + K;
+ d = b * b - 4 * (Z - T);
+ /* Because of the large magnitudes involved, we lose enough precision
+ * that sometimes we end up with a negative value near the axis, when
+ * it should be positive. This is a workaround.
+ */
+ if (d < 0 && !solution)
+ d = 0.0;
+ if (d >= 0) {
+ d = sqrt(d);
+ y = (b + d) / 2;
+ if (y < hepp)
+ {
+ if (y > hepm)
+ y = h;
+ t = y / h;
+ x = w * sqrt(1 - (t * t));
+ t = K - y;
+ if (rs - (t * t) >= 0)
+ inx = x - sqrt(rs - (t * t));
+ else
+ inx = x;
+ }
+ y = (b - d) / 2;
+ if (y >= 0.0)
+ {
+ if (y > hepm)
+ y = h;
+ t = y / h;
+ x = w * sqrt(1 - (t * t));
+ t = K - y;
+ if (rs - (t * t) >= 0)
+ t = sqrt(rs - (t * t));
+ else
+ t = 0;
+ if (flip == 1)
+ inx = x - t;
+ else
+ outx = x + t;
+ }
+ }
+ span->lx = ICEIL(xorg - outx);
+ if (inx <= 0.0)
+ {
+ spdata->count1++;
+ span->lw = ICEIL(xorg + outx) - span->lx;
+ span->rx = ICEIL(xorg + inx);
+ span->rw = -ICEIL(xorg - inx);
+ }
+ else
+ {
+ spdata->count2++;
+ span->lw = ICEIL(xorg - inx) - span->lx;
+ span->rx = ICEIL(xorg + inx);
+ span->rw = ICEIL(xorg + outx) - span->rx;
+ }
+ span++;
+ }
+ if (spdata->bot)
+ {
+ outx = w + r;
+ if (r >= h && r <= w)
+ inx = 0.0;
+ else if (Nk < 0.0 && -Nk < Hs)
+ {
+ inx = w * sqrt(1 + Nk / Hs) - sqrt(rs + Nk);
+ if (inx > w - r)
+ inx = w - r;
+ }
+ else
+ inx = w - r;
+ span->lx = ICEIL(xorg - outx);
+ if (inx <= 0.0)
+ {
+ span->lw = ICEIL(xorg + outx) - span->lx;
+ span->rx = ICEIL(xorg + inx);
+ span->rw = -ICEIL(xorg - inx);
+ }
+ else
+ {
+ span->lw = ICEIL(xorg - inx) - span->lx;
+ span->rx = ICEIL(xorg + inx);
+ span->rw = ICEIL(xorg + outx) - span->rx;
+ }
+ }
+ if (spdata->hole)
+ {
+ span = &spdata->spans[spdata->count1];
+ span->lw = -span->lx;
+ span->rx = 1;
+ span->rw = span->lw;
+ spdata->count1--;
+ spdata->count2++;
+ }
+}
+
+static double
+tailX(
+ double K,
+ struct arc_def *def,
+ struct arc_bound *bounds,
+ struct accelerators *acc)
+{
+ double w, h, r;
+ double Hs, Hf, WH, Vk, Nk, Fk, Vr, N, Nc, Z, rs;
+ double A, T, b, d, x, y, t, hepp, hepm;
+ int flip, solution;
+ double xs[2];
+ double *xp;
+
+ w = def->w;
+ h = def->h;
+ r = def->l;
+ rs = r * r;
+ Hs = acc->h2;
+ WH = -acc->h2mw2;
+ Nk = def->w * r;
+ Vk = (Nk * Hs) / (WH + WH);
+ Hf = acc->h4;
+ Nk = (Hf - Nk * Nk) / WH;
+ if (K == 0.0) {
+ if (Nk < 0.0 && -Nk < Hs) {
+ xs[0] = w * sqrt(1 + Nk / Hs) - sqrt(rs + Nk);
+ xs[1] = w - r;
+ if (acc->left.valid && boundedLe(K, bounds->left) &&
+ !boundedLe(K, bounds->outer) && xs[0] >= 0.0 && xs[1] >= 0.0)
+ return xs[1];
+ if (acc->right.valid && boundedLe(K, bounds->right) &&
+ !boundedLe(K, bounds->inner) && xs[0] <= 0.0 && xs[1] <= 0.0)
+ return xs[1];
+ return xs[0];
+ }
+ return w - r;
+ }
+ Fk = Hf / WH;
+ hepp = h + EPSILON;
+ hepm = h - EPSILON;
+ N = (K * K + Nk) / 6.0;
+ Nc = N * N * N;
+ Vr = Vk * K;
+ xp = xs;
+ xs[0] = 0.0;
+ t = Nc + Vr * Vr;
+ d = Nc + t;
+ if (d < 0.0) {
+ d = Nc;
+ b = N;
+ if ( (b < 0.0) == (t < 0.0) )
+ {
+ b = -b;
+ d = -d;
+ }
+ Z = N - 2.0 * b * cos(acos(-t / d) / 3.0);
+ if ( (Z < 0.0) == (Vr < 0.0) )
+ flip = 2;
+ else
+ flip = 1;
+ }
+ else
+ {
+ d = Vr * sqrt(d);
+ Z = N + cbrt(t + d) + cbrt(t - d);
+ flip = 0;
+ }
+ A = sqrt((Z + Z) - Nk);
+ T = (Fk - Z) * K / A;
+ solution = FALSE;
+ b = -A + K;
+ d = b * b - 4 * (Z + T);
+ if (d >= 0 && flip == 2)
+ {
+ d = sqrt(d);
+ y = (b + d) / 2;
+ if ((y >= 0.0) && (y < hepp))
+ {
+ solution = TRUE;
+ if (y > hepm)
+ y = h;
+ t = y / h;
+ x = w * sqrt(1 - (t * t));
+ t = K - y;
+ if (rs - (t * t) >= 0)
+ t = sqrt(rs - (t * t));
+ else
+ t = 0;
+ *xp++ = x - t;
+ }
+ }
+ b = A + K;
+ d = b * b - 4 * (Z - T);
+ /* Because of the large magnitudes involved, we lose enough precision
+ * that sometimes we end up with a negative value near the axis, when
+ * it should be positive. This is a workaround.
+ */
+ if (d < 0 && !solution)
+ d = 0.0;
+ if (d >= 0) {
+ d = sqrt(d);
+ y = (b + d) / 2;
+ if (y < hepp)
+ {
+ if (y > hepm)
+ y = h;
+ t = y / h;
+ x = w * sqrt(1 - (t * t));
+ t = K - y;
+ if (rs - (t * t) >= 0)
+ *xp++ = x - sqrt(rs - (t * t));
+ else
+ *xp++ = x;
+ }
+ y = (b - d) / 2;
+ if (y >= 0.0 && flip == 1)
+ {
+ if (y > hepm)
+ y = h;
+ t = y / h;
+ x = w * sqrt(1 - (t * t));
+ t = K - y;
+ if (rs - (t * t) >= 0)
+ t = sqrt(rs - (t * t));
+ else
+ t = 0;
+ *xp++ = x - t;
+ }
+ }
+ if (xp > &xs[1]) {
+ if (acc->left.valid && boundedLe(K, bounds->left) &&
+ !boundedLe(K, bounds->outer) && xs[0] >= 0.0 && xs[1] >= 0.0)
+ return xs[1];
+ if (acc->right.valid && boundedLe(K, bounds->right) &&
+ !boundedLe(K, bounds->inner) && xs[0] <= 0.0 && xs[1] <= 0.0)
+ return xs[1];
+ }
+ return xs[0];
+}
+
+static miArcSpanData *
+miComputeWideEllipse(int lw, xArc *parc)
+{
+ miArcSpanData *spdata = NULL;
+ int k;
+
+ if (!lw)
+ lw = 1;
+ k = (parc->height >> 1) + ((lw - 1) >> 1);
+ spdata = malloc(sizeof(miArcSpanData) + sizeof(miArcSpan) * (k + 2));
+ if (!spdata)
+ return NULL;
+ spdata->spans = (miArcSpan *)(spdata + 1);
+ spdata->k = k;
+ spdata->top = !(lw & 1) && !(parc->width & 1);
+ spdata->bot = !(parc->height & 1);
+ if (parc->width == parc->height)
+ miComputeCircleSpans(lw, parc, spdata);
+ else
+ miComputeEllipseSpans(lw, parc, spdata);
+ return spdata;
+}
+
+static void
+miFillWideEllipse(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ xArc *parc)
+{
+ DDXPointPtr points;
+ DDXPointPtr pts;
+ int *widths;
+ int *wids;
+ miArcSpanData *spdata;
+ miArcSpan *span;
+ int xorg, yorgu, yorgl;
+ int n;
+
+ yorgu = parc->height + pGC->lineWidth;
+ n = (sizeof(int) * 2) * yorgu;
+ widths = malloc(n + (sizeof(DDXPointRec) * 2) * yorgu);
+ if (!widths)
+ return;
+ points = (DDXPointPtr)((char *)widths + n);
+ spdata = miComputeWideEllipse((int)pGC->lineWidth, parc);
+ if (!spdata)
+ {
+ free(widths);
+ return;
+ }
+ pts = points;
+ wids = widths;
+ span = spdata->spans;
+ xorg = parc->x + (parc->width >> 1);
+ yorgu = parc->y + (parc->height >> 1);
+ yorgl = yorgu + (parc->height & 1);
+ if (pGC->miTranslate)
+ {
+ xorg += pDraw->x;
+ yorgu += pDraw->y;
+ yorgl += pDraw->y;
+ }
+ yorgu -= spdata->k;
+ yorgl += spdata->k;
+ if (spdata->top)
+ {
+ pts->x = xorg;
+ pts->y = yorgu - 1;
+ pts++;
+ *wids++ = 1;
+ span++;
+ }
+ for (n = spdata->count1; --n >= 0; )
+ {
+ pts[0].x = xorg + span->lx;
+ pts[0].y = yorgu;
+ wids[0] = span->lw;
+ pts[1].x = pts[0].x;
+ pts[1].y = yorgl;
+ wids[1] = wids[0];
+ yorgu++;
+ yorgl--;
+ pts += 2;
+ wids += 2;
+ span++;
+ }
+ if (spdata->hole)
+ {
+ pts[0].x = xorg;
+ pts[0].y = yorgl;
+ wids[0] = 1;
+ pts++;
+ wids++;
+ }
+ for (n = spdata->count2; --n >= 0; )
+ {
+ pts[0].x = xorg + span->lx;
+ pts[0].y = yorgu;
+ wids[0] = span->lw;
+ pts[1].x = xorg + span->rx;
+ pts[1].y = pts[0].y;
+ wids[1] = span->rw;
+ pts[2].x = pts[0].x;
+ pts[2].y = yorgl;
+ wids[2] = wids[0];
+ pts[3].x = pts[1].x;
+ pts[3].y = pts[2].y;
+ wids[3] = wids[1];
+ yorgu++;
+ yorgl--;
+ pts += 4;
+ wids += 4;
+ span++;
+ }
+ if (spdata->bot)
+ {
+ if (span->rw <= 0)
+ {
+ pts[0].x = xorg + span->lx;
+ pts[0].y = yorgu;
+ wids[0] = span->lw;
+ pts++;
+ wids++;
+ }
+ else
+ {
+ pts[0].x = xorg + span->lx;
+ pts[0].y = yorgu;
+ wids[0] = span->lw;
+ pts[1].x = xorg + span->rx;
+ pts[1].y = pts[0].y;
+ wids[1] = span->rw;
+ pts += 2;
+ wids += 2;
+ }
+ }
+ free(spdata);
+ (*pGC->ops->FillSpans)(pDraw, pGC, pts - points, points, widths, FALSE);
+
+ free(widths);
+}
+
+/*
+ * miPolyArc strategy:
+ *
+ * If arc is zero width and solid, we don't have to worry about the rasterop
+ * or join styles. For wide solid circles, we use a fast integer algorithm.
+ * For wide solid ellipses, we use special case floating point code.
+ * Otherwise, we set up pDrawTo and pGCTo according to the rasterop, then
+ * draw using pGCTo and pDrawTo. If the raster-op was "tricky," that is,
+ * if it involves the destination, then we use PushPixels to move the bits
+ * from the scratch drawable to pDraw. (See the wide line code for a
+ * fuller explanation of this.)
+ */
+
+void
+miPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
+{
+ int i;
+ xArc *parc;
+ int xMin, xMax, yMin, yMax;
+ int pixmapWidth = 0, pixmapHeight = 0;
+ int xOrg = 0, yOrg = 0;
+ int width;
+ Bool fTricky;
+ DrawablePtr pDrawTo;
+ CARD32 fg, bg;
+ GCPtr pGCTo;
+ miPolyArcPtr polyArcs;
+ int cap[2], join[2];
+ int iphase;
+ int halfWidth;
+
+ width = pGC->lineWidth;
+ if(width == 0 && pGC->lineStyle == LineSolid)
+ {
+ for(i = narcs, parc = parcs; --i >= 0; parc++)
+ miArcSegment( pDraw, pGC, *parc,
+ (miArcFacePtr) 0, (miArcFacePtr) 0 );
+ fillSpans (pDraw, pGC);
+ }
+ else
+ {
+ if ((pGC->lineStyle == LineSolid) && narcs)
+ {
+ while (parcs->width && parcs->height &&
+ (parcs->angle2 >= FULLCIRCLE ||
+ parcs->angle2 <= -FULLCIRCLE))
+ {
+ miFillWideEllipse(pDraw, pGC, parcs);
+ if (!--narcs)
+ return;
+ parcs++;
+ }
+ }
+
+ /* Set up pDrawTo and pGCTo based on the rasterop */
+ switch(pGC->alu)
+ {
+ case GXclear: /* 0 */
+ case GXcopy: /* src */
+ case GXcopyInverted: /* NOT src */
+ case GXset: /* 1 */
+ fTricky = FALSE;
+ pDrawTo = pDraw;
+ pGCTo = pGC;
+ break;
+ default:
+ fTricky = TRUE;
+
+ /* find bounding box around arcs */
+ xMin = yMin = MAXSHORT;
+ xMax = yMax = MINSHORT;
+
+ for(i = narcs, parc = parcs; --i >= 0; parc++)
+ {
+ xMin = min (xMin, parc->x);
+ yMin = min (yMin, parc->y);
+ xMax = max (xMax, (parc->x + (int) parc->width));
+ yMax = max (yMax, (parc->y + (int) parc->height));
+ }
+
+ /* expand box to deal with line widths */
+ halfWidth = (width + 1)/2;
+ xMin -= halfWidth;
+ yMin -= halfWidth;
+ xMax += halfWidth;
+ yMax += halfWidth;
+
+ /* compute pixmap size; limit it to size of drawable */
+ xOrg = max(xMin, 0);
+ yOrg = max(yMin, 0);
+ pixmapWidth = min(xMax, pDraw->width) - xOrg;
+ pixmapHeight = min(yMax, pDraw->height) - yOrg;
+
+ /* if nothing left, return */
+ if ( (pixmapWidth <= 0) || (pixmapHeight <= 0) ) return;
+
+ for(i = narcs, parc = parcs; --i >= 0; parc++)
+ {
+ parc->x -= xOrg;
+ parc->y -= yOrg;
+ }
+ if (pGC->miTranslate)
+ {
+ xOrg += pDraw->x;
+ yOrg += pDraw->y;
+ }
+
+ /* set up scratch GC */
+
+ pGCTo = GetScratchGC(1, pDraw->pScreen);
+ if (!pGCTo)
+ return;
+ {
+ ChangeGCVal gcvals[6];
+ gcvals[0].val = GXcopy;
+ gcvals[1].val = 1;
+ gcvals[2].val = 0;
+ gcvals[3].val = pGC->lineWidth;
+ gcvals[4].val = pGC->capStyle;
+ gcvals[5].val = pGC->joinStyle;
+ ChangeGC(NullClient, pGCTo, GCFunction |
+ GCForeground | GCBackground | GCLineWidth |
+ GCCapStyle | GCJoinStyle, gcvals);
+ }
+
+ /* allocate a 1 bit deep pixmap of the appropriate size, and
+ * validate it */
+ pDrawTo = (DrawablePtr)(*pDraw->pScreen->CreatePixmap)
+ (pDraw->pScreen, pixmapWidth, pixmapHeight, 1,
+ CREATE_PIXMAP_USAGE_SCRATCH);
+ if (!pDrawTo)
+ {
+ FreeScratchGC(pGCTo);
+ return;
+ }
+ ValidateGC(pDrawTo, pGCTo);
+ miClearDrawable(pDrawTo, pGCTo);
+ }
+
+ fg = pGC->fgPixel;
+ bg = pGC->bgPixel;
+ if ((pGC->fillStyle == FillTiled) ||
+ (pGC->fillStyle == FillOpaqueStippled))
+ bg = fg; /* the protocol sez these don't cause color changes */
+
+ polyArcs = miComputeArcs (parcs, narcs, pGC);
+
+ if (!polyArcs)
+ {
+ if (fTricky) {
+ (*pDraw->pScreen->DestroyPixmap) ((PixmapPtr)pDrawTo);
+ FreeScratchGC (pGCTo);
+ }
+ return;
+ }
+
+ cap[0] = cap[1] = 0;
+ join[0] = join[1] = 0;
+ for (iphase = ((pGC->lineStyle == LineDoubleDash) ? 1 : 0);
+ iphase >= 0;
+ iphase--)
+ {
+ ChangeGCVal gcval;
+ if (iphase == 1) {
+ gcval.val = bg;
+ ChangeGC (NullClient, pGC, GCForeground, &gcval);
+ ValidateGC (pDraw, pGC);
+ } else if (pGC->lineStyle == LineDoubleDash) {
+ gcval.val = fg;
+ ChangeGC (NullClient, pGC, GCForeground, &gcval);
+ ValidateGC (pDraw, pGC);
+ }
+ for (i = 0; i < polyArcs[iphase].narcs; i++) {
+ miArcDataPtr arcData;
+
+ arcData = &polyArcs[iphase].arcs[i];
+ miArcSegment(pDrawTo, pGCTo, arcData->arc,
+ &arcData->bounds[RIGHT_END],
+ &arcData->bounds[LEFT_END]);
+ if (polyArcs[iphase].arcs[i].render) {
+ fillSpans (pDrawTo, pGCTo);
+ /*
+ * don't cap self-joining arcs
+ */
+ if (polyArcs[iphase].arcs[i].selfJoin &&
+ cap[iphase] < polyArcs[iphase].arcs[i].cap)
+ cap[iphase]++;
+ while (cap[iphase] < polyArcs[iphase].arcs[i].cap) {
+ int arcIndex, end;
+ miArcDataPtr arcData0;
+
+ arcIndex = polyArcs[iphase].caps[cap[iphase]].arcIndex;
+ end = polyArcs[iphase].caps[cap[iphase]].end;
+ arcData0 = &polyArcs[iphase].arcs[arcIndex];
+ miArcCap (pDrawTo, pGCTo,
+ &arcData0->bounds[end], end,
+ arcData0->arc.x, arcData0->arc.y,
+ (double) arcData0->arc.width / 2.0,
+ (double) arcData0->arc.height / 2.0);
+ ++cap[iphase];
+ }
+ while (join[iphase] < polyArcs[iphase].arcs[i].join) {
+ int arcIndex0, arcIndex1, end0, end1;
+ int phase0, phase1;
+ miArcDataPtr arcData0, arcData1;
+ miArcJoinPtr joinp;
+
+ joinp = &polyArcs[iphase].joins[join[iphase]];
+ arcIndex0 = joinp->arcIndex0;
+ end0 = joinp->end0;
+ arcIndex1 = joinp->arcIndex1;
+ end1 = joinp->end1;
+ phase0 = joinp->phase0;
+ phase1 = joinp->phase1;
+ arcData0 = &polyArcs[phase0].arcs[arcIndex0];
+ arcData1 = &polyArcs[phase1].arcs[arcIndex1];
+ miArcJoin (pDrawTo, pGCTo,
+ &arcData0->bounds[end0],
+ &arcData1->bounds[end1],
+ arcData0->arc.x, arcData0->arc.y,
+ (double) arcData0->arc.width / 2.0,
+ (double) arcData0->arc.height / 2.0,
+ arcData1->arc.x, arcData1->arc.y,
+ (double) arcData1->arc.width / 2.0,
+ (double) arcData1->arc.height / 2.0);
+ ++join[iphase];
+ }
+ if (fTricky) {
+ if (pGC->serialNumber != pDraw->serialNumber)
+ ValidateGC (pDraw, pGC);
+ (*pGC->ops->PushPixels) (pGC, (PixmapPtr)pDrawTo,
+ pDraw, pixmapWidth, pixmapHeight, xOrg, yOrg);
+ miClearDrawable ((DrawablePtr) pDrawTo, pGCTo);
+ }
+ }
+ }
+ }
+ miFreeArcs(polyArcs, pGC);
+
+ if(fTricky)
+ {
+ (*pGCTo->pScreen->DestroyPixmap)((PixmapPtr)pDrawTo);
+ FreeScratchGC(pGCTo);
+ }
+ }
+}
+
+static double
+angleBetween (SppPointRec center, SppPointRec point1, SppPointRec point2)
+{
+ double a1, a2, a;
+
+ /*
+ * reflect from X coordinates back to ellipse
+ * coordinates -- y increasing upwards
+ */
+ a1 = miDatan2 (- (point1.y - center.y), point1.x - center.x);
+ a2 = miDatan2 (- (point2.y - center.y), point2.x - center.x);
+ a = a2 - a1;
+ if (a <= -180.0)
+ a += 360.0;
+ else if (a > 180.0)
+ a -= 360.0;
+ return a;
+}
+
+static void
+translateBounds (
+ miArcFacePtr b,
+ int x,
+ int y,
+ double fx,
+ double fy)
+{
+ fx += x;
+ fy += y;
+ b->clock.x -= fx;
+ b->clock.y -= fy;
+ b->center.x -= fx;
+ b->center.y -= fy;
+ b->counterClock.x -= fx;
+ b->counterClock.y -= fy;
+}
+
+static void
+miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft,
+ miArcFacePtr pRight, int xOrgLeft, int yOrgLeft,
+ double xFtransLeft, double yFtransLeft,
+ int xOrgRight, int yOrgRight,
+ double xFtransRight, double yFtransRight)
+{
+ SppPointRec center, corner, otherCorner;
+ SppPointRec poly[5], e;
+ SppPointPtr pArcPts;
+ int cpt;
+ SppArcRec arc;
+ miArcFaceRec Right, Left;
+ int polyLen = 0;
+ int xOrg, yOrg;
+ double xFtrans, yFtrans;
+ double a;
+ double ae, ac2, ec2, bc2, de;
+ double width;
+
+ xOrg = (xOrgRight + xOrgLeft) / 2;
+ yOrg = (yOrgRight + yOrgLeft) / 2;
+ xFtrans = (xFtransLeft + xFtransRight) / 2;
+ yFtrans = (yFtransLeft + yFtransRight) / 2;
+ Right = *pRight;
+ translateBounds (&Right, xOrg - xOrgRight, yOrg - yOrgRight,
+ xFtrans - xFtransRight, yFtrans - yFtransRight);
+ Left = *pLeft;
+ translateBounds (&Left, xOrg - xOrgLeft, yOrg - yOrgLeft,
+ xFtrans - xFtransLeft, yFtrans - yFtransLeft);
+ pRight = &Right;
+ pLeft = &Left;
+
+ if (pRight->clock.x == pLeft->counterClock.x &&
+ pRight->clock.y == pLeft->counterClock.y)
+ return;
+ center = pRight->center;
+ if (0 <= (a = angleBetween (center, pRight->clock, pLeft->counterClock))
+ && a <= 180.0)
+ {
+ corner = pRight->clock;
+ otherCorner = pLeft->counterClock;
+ } else {
+ a = angleBetween (center, pLeft->clock, pRight->counterClock);
+ corner = pLeft->clock;
+ otherCorner = pRight->counterClock;
+ }
+ switch (pGC->joinStyle) {
+ case JoinRound:
+ width = (pGC->lineWidth ? (double)pGC->lineWidth : (double)1);
+
+ arc.x = center.x - width/2;
+ arc.y = center.y - width/2;
+ arc.width = width;
+ arc.height = width;
+ arc.angle1 = -miDatan2 (corner.y - center.y, corner.x - center.x);
+ arc.angle2 = a;
+ pArcPts = malloc(3 * sizeof (SppPointRec));
+ if (!pArcPts)
+ return;
+ pArcPts[0].x = otherCorner.x;
+ pArcPts[0].y = otherCorner.y;
+ pArcPts[1].x = center.x;
+ pArcPts[1].y = center.y;
+ pArcPts[2].x = corner.x;
+ pArcPts[2].y = corner.y;
+ if( (cpt = miGetArcPts(&arc, 3, &pArcPts)) )
+ {
+ /* by drawing with miFillSppPoly and setting the endpoints of the arc
+ * to be the corners, we assure that the cap will meet up with the
+ * rest of the line */
+ miFillSppPoly(pDraw, pGC, cpt, pArcPts, xOrg, yOrg, xFtrans, yFtrans);
+ }
+ free(pArcPts);
+ return;
+ case JoinMiter:
+ /*
+ * don't miter arcs with less than 11 degrees between them
+ */
+ if (a < 169.0) {
+ poly[0] = corner;
+ poly[1] = center;
+ poly[2] = otherCorner;
+ bc2 = (corner.x - otherCorner.x) * (corner.x - otherCorner.x) +
+ (corner.y - otherCorner.y) * (corner.y - otherCorner.y);
+ ec2 = bc2 / 4;
+ ac2 = (corner.x - center.x) * (corner.x - center.x) +
+ (corner.y - center.y) * (corner.y - center.y);
+ ae = sqrt (ac2 - ec2);
+ de = ec2 / ae;
+ e.x = (corner.x + otherCorner.x) / 2;
+ e.y = (corner.y + otherCorner.y) / 2;
+ poly[3].x = e.x + de * (e.x - center.x) / ae;
+ poly[3].y = e.y + de * (e.y - center.y) / ae;
+ poly[4] = corner;
+ polyLen = 5;
+ break;
+ }
+ case JoinBevel:
+ poly[0] = corner;
+ poly[1] = center;
+ poly[2] = otherCorner;
+ poly[3] = corner;
+ polyLen = 4;
+ break;
+ }
+ miFillSppPoly (pDraw, pGC, polyLen, poly, xOrg, yOrg, xFtrans, yFtrans);
+}
+
+/*ARGSUSED*/
+static void
+miArcCap (
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ miArcFacePtr pFace,
+ int end,
+ int xOrg,
+ int yOrg,
+ double xFtrans,
+ double yFtrans)
+{
+ SppPointRec corner, otherCorner, center, endPoint, poly[5];
+
+ corner = pFace->clock;
+ otherCorner = pFace->counterClock;
+ center = pFace->center;
+ switch (pGC->capStyle) {
+ case CapProjecting:
+ poly[0].x = otherCorner.x;
+ poly[0].y = otherCorner.y;
+ poly[1].x = corner.x;
+ poly[1].y = corner.y;
+ poly[2].x = corner.x -
+ (center.y - corner.y);
+ poly[2].y = corner.y +
+ (center.x - corner.x);
+ poly[3].x = otherCorner.x -
+ (otherCorner.y - center.y);
+ poly[3].y = otherCorner.y +
+ (otherCorner.x - center.x);
+ poly[4].x = otherCorner.x;
+ poly[4].y = otherCorner.y;
+ miFillSppPoly (pDraw, pGC, 5, poly, xOrg, yOrg, xFtrans, yFtrans);
+ break;
+ case CapRound:
+ /*
+ * miRoundCap just needs these to be unequal.
+ */
+ endPoint = center;
+ endPoint.x = endPoint.x + 100;
+ miRoundCap (pDraw, pGC, center, endPoint, corner, otherCorner, 0,
+ -xOrg, -yOrg, xFtrans, yFtrans);
+ break;
+ }
+}
+
+/* MIROUNDCAP -- a private helper function
+ * Put Rounded cap on end. pCenter is the center of this end of the line
+ * pEnd is the center of the other end of the line. pCorner is one of the
+ * two corners at this end of the line.
+ * NOTE: pOtherCorner must be counter-clockwise from pCorner.
+ */
+/*ARGSUSED*/
+static void
+miRoundCap(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ SppPointRec pCenter,
+ SppPointRec pEnd,
+ SppPointRec pCorner,
+ SppPointRec pOtherCorner,
+ int fLineEnd,
+ int xOrg,
+ int yOrg,
+ double xFtrans,
+ double yFtrans)
+{
+ int cpt;
+ double width;
+ SppArcRec arc;
+ SppPointPtr pArcPts;
+
+ width = (pGC->lineWidth ? (double)pGC->lineWidth : (double)1);
+
+ arc.x = pCenter.x - width/2;
+ arc.y = pCenter.y - width/2;
+ arc.width = width;
+ arc.height = width;
+ arc.angle1 = -miDatan2 (pCorner.y - pCenter.y, pCorner.x - pCenter.x);
+ if(PTISEQUAL(pCenter, pEnd))
+ arc.angle2 = - 180.0;
+ else {
+ arc.angle2 = -miDatan2 (pOtherCorner.y - pCenter.y, pOtherCorner.x - pCenter.x) - arc.angle1;
+ if (arc.angle2 < 0)
+ arc.angle2 += 360.0;
+ }
+ pArcPts = (SppPointPtr) NULL;
+ if( (cpt = miGetArcPts(&arc, 0, &pArcPts)) )
+ {
+ /* by drawing with miFillSppPoly and setting the endpoints of the arc
+ * to be the corners, we assure that the cap will meet up with the
+ * rest of the line */
+ miFillSppPoly(pDraw, pGC, cpt, pArcPts, -xOrg, -yOrg, xFtrans, yFtrans);
+ }
+ free(pArcPts);
+}
+
+/*
+ * To avoid inaccuracy at the cardinal points, use trig functions
+ * which are exact for those angles
+ */
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+#ifndef M_PI_2
+#define M_PI_2 1.57079632679489661923
+#endif
+
+# define Dsin(d) ((d) == 0.0 ? 0.0 : ((d) == 90.0 ? 1.0 : sin(d*M_PI/180.0)))
+# define Dcos(d) ((d) == 0.0 ? 1.0 : ((d) == 90.0 ? 0.0 : cos(d*M_PI/180.0)))
+# define mod(a,b) ((a) >= 0 ? (a) % (b) : (b) - (-(a)) % (b))
+
+static double
+miDcos (double a)
+{
+ int i;
+
+ if (floor (a/90) == a/90) {
+ i = (int) (a/90.0);
+ switch (mod (i, 4)) {
+ case 0: return 1;
+ case 1: return 0;
+ case 2: return -1;
+ case 3: return 0;
+ }
+ }
+ return cos (a * M_PI / 180.0);
+}
+
+static double
+miDsin (double a)
+{
+ int i;
+
+ if (floor (a/90) == a/90) {
+ i = (int) (a/90.0);
+ switch (mod (i, 4)) {
+ case 0: return 0;
+ case 1: return 1;
+ case 2: return 0;
+ case 3: return -1;
+ }
+ }
+ return sin (a * M_PI / 180.0);
+}
+
+static double
+miDasin (double v)
+{
+ if (v == 0)
+ return 0.0;
+ if (v == 1.0)
+ return 90.0;
+ if (v == -1.0)
+ return -90.0;
+ return asin(v) * (180.0 / M_PI);
+}
+
+static double
+miDatan2 (double dy, double dx)
+{
+ if (dy == 0) {
+ if (dx >= 0)
+ return 0.0;
+ return 180.0;
+ } else if (dx == 0) {
+ if (dy > 0)
+ return 90.0;
+ return -90.0;
+ } else if (fabs (dy) == fabs (dx)) {
+ if (dy > 0) {
+ if (dx > 0)
+ return 45.0;
+ return 135.0;
+ } else {
+ if (dx > 0)
+ return 315.0;
+ return 225.0;
+ }
+ } else {
+ return atan2 (dy, dx) * (180.0 / M_PI);
+ }
+}
+
+/* MIGETARCPTS -- Converts an arc into a set of line segments -- a helper
+ * routine for filled arc and line (round cap) code.
+ * Returns the number of points in the arc. Note that it takes a pointer
+ * to a pointer to where it should put the points and an index (cpt).
+ * This procedure allocates the space necessary to fit the arc points.
+ * Sometimes it's convenient for those points to be at the end of an existing
+ * array. (For example, if we want to leave a spare point to make sectors
+ * instead of segments.) So we pass in the malloc()ed chunk that contains the
+ * array and an index saying where we should start stashing the points.
+ * If there isn't an array already, we just pass in a null pointer and
+ * count on realloc() to handle the null pointer correctly.
+ */
+static int
+miGetArcPts(
+ SppArcPtr parc, /* points to an arc */
+ int cpt, /* number of points already in arc list */
+ SppPointPtr *ppPts) /* pointer to pointer to arc-list -- modified */
+{
+ double st, /* Start Theta, start angle */
+ et, /* End Theta, offset from start theta */
+ dt, /* Delta Theta, angle to sweep ellipse */
+ cdt, /* Cos Delta Theta, actually 2 cos(dt) */
+ x0, y0, /* the recurrence formula needs two points to start */
+ x1, y1,
+ x2, y2, /* this will be the new point generated */
+ xc, yc; /* the center point */
+ int count, i;
+ SppPointPtr poly;
+
+ /* The spec says that positive angles indicate counterclockwise motion.
+ * Given our coordinate system (with 0,0 in the upper left corner),
+ * the screen appears flipped in Y. The easiest fix is to negate the
+ * angles given */
+
+ st = - parc->angle1;
+
+ et = - parc->angle2;
+
+ /* Try to get a delta theta that is within 1/2 pixel. Then adjust it
+ * so that it divides evenly into the total.
+ * I'm just using cdt 'cause I'm lazy.
+ */
+ cdt = parc->width;
+ if (parc->height > cdt)
+ cdt = parc->height;
+ cdt /= 2.0;
+ if(cdt <= 0)
+ return 0;
+ if (cdt < 1.0)
+ cdt = 1.0;
+ dt = miDasin ( 1.0 / cdt ); /* minimum step necessary */
+ count = et/dt;
+ count = abs(count) + 1;
+ dt = et/count;
+ count++;
+
+ cdt = 2 * miDcos(dt);
+ if (!(poly = (SppPointPtr) realloc((pointer)*ppPts,
+ (cpt + count) * sizeof(SppPointRec))))
+ return 0;
+ *ppPts = poly;
+
+ xc = parc->width/2.0; /* store half width and half height */
+ yc = parc->height/2.0;
+
+ x0 = xc * miDcos(st);
+ y0 = yc * miDsin(st);
+ x1 = xc * miDcos(st + dt);
+ y1 = yc * miDsin(st + dt);
+ xc += parc->x; /* by adding initial point, these become */
+ yc += parc->y; /* the center point */
+
+ poly[cpt].x = (xc + x0);
+ poly[cpt].y = (yc + y0);
+ poly[cpt + 1].x = (xc + x1);
+ poly[cpt + 1].y = (yc + y1);
+
+ for(i = 2; i < count; i++)
+ {
+ x2 = cdt * x1 - x0;
+ y2 = cdt * y1 - y0;
+
+ poly[cpt + i].x = (xc + x2);
+ poly[cpt + i].y = (yc + y2);
+
+ x0 = x1; y0 = y1;
+ x1 = x2; y1 = y2;
+ }
+ /* adjust the last point */
+ if (abs(parc->angle2) >= 360.0)
+ poly[cpt +i -1] = poly[0];
+ else {
+ poly[cpt +i -1].x = (miDcos(st + et) * parc->width/2.0 + xc);
+ poly[cpt +i -1].y = (miDsin(st + et) * parc->height/2.0 + yc);
+ }
+
+ return count;
+}
+
+struct arcData {
+ double x0, y0, x1, y1;
+ int selfJoin;
+};
+
+# define ADD_REALLOC_STEP 20
+
+static void
+addCap (
+ miArcCapPtr *capsp,
+ int *ncapsp,
+ int *sizep,
+ int end,
+ int arcIndex)
+{
+ int newsize;
+ miArcCapPtr cap;
+
+ if (*ncapsp == *sizep)
+ {
+ newsize = *sizep + ADD_REALLOC_STEP;
+ cap = (miArcCapPtr) realloc(*capsp,
+ newsize * sizeof (**capsp));
+ if (!cap)
+ return;
+ *sizep = newsize;
+ *capsp = cap;
+ }
+ cap = &(*capsp)[*ncapsp];
+ cap->end = end;
+ cap->arcIndex = arcIndex;
+ ++*ncapsp;
+}
+
+static void
+addJoin (
+ miArcJoinPtr *joinsp,
+ int *njoinsp,
+ int *sizep,
+ int end0,
+ int index0,
+ int phase0,
+ int end1,
+ int index1,
+ int phase1)
+{
+ int newsize;
+ miArcJoinPtr join;
+
+ if (*njoinsp == *sizep)
+ {
+ newsize = *sizep + ADD_REALLOC_STEP;
+ join = (miArcJoinPtr) realloc(*joinsp,
+ newsize * sizeof (**joinsp));
+ if (!join)
+ return;
+ *sizep = newsize;
+ *joinsp = join;
+ }
+ join = &(*joinsp)[*njoinsp];
+ join->end0 = end0;
+ join->arcIndex0 = index0;
+ join->phase0 = phase0;
+ join->end1 = end1;
+ join->arcIndex1 = index1;
+ join->phase1 = phase1;
+ ++*njoinsp;
+}
+
+static miArcDataPtr
+addArc (
+ miArcDataPtr *arcsp,
+ int *narcsp,
+ int *sizep,
+ xArc *xarc)
+{
+ int newsize;
+ miArcDataPtr arc;
+
+ if (*narcsp == *sizep)
+ {
+ newsize = *sizep + ADD_REALLOC_STEP;
+ arc = (miArcDataPtr) realloc(*arcsp,
+ newsize * sizeof (**arcsp));
+ if (!arc)
+ return NULL;
+ *sizep = newsize;
+ *arcsp = arc;
+ }
+ arc = &(*arcsp)[*narcsp];
+ arc->arc = *xarc;
+ ++*narcsp;
+ return arc;
+}
+
+static void
+miFreeArcs(
+ miPolyArcPtr arcs,
+ GCPtr pGC)
+{
+ int iphase;
+
+ for (iphase = ((pGC->lineStyle == LineDoubleDash) ? 1 : 0);
+ iphase >= 0;
+ iphase--)
+ {
+ if (arcs[iphase].narcs > 0)
+ free(arcs[iphase].arcs);
+ if (arcs[iphase].njoins > 0)
+ free(arcs[iphase].joins);
+ if (arcs[iphase].ncaps > 0)
+ free(arcs[iphase].caps);
+ }
+ free(arcs);
+}
+
+/*
+ * map angles to radial distance. This only deals with the first quadrant
+ */
+
+/*
+ * a polygonal approximation to the arc for computing arc lengths
+ */
+
+# define DASH_MAP_SIZE 91
+
+# define dashIndexToAngle(di) ((((double) (di)) * 90.0) / ((double) DASH_MAP_SIZE - 1))
+# define xAngleToDashIndex(xa) ((((long) (xa)) * (DASH_MAP_SIZE - 1)) / (90 * 64))
+# define dashIndexToXAngle(di) ((((long) (di)) * (90 * 64)) / (DASH_MAP_SIZE - 1))
+# define dashXAngleStep (((double) (90 * 64)) / ((double) (DASH_MAP_SIZE - 1)))
+
+typedef struct {
+ double map[DASH_MAP_SIZE];
+} dashMap;
+
+static int computeAngleFromPath(int startAngle, int endAngle, dashMap *map,
+ int *lenp, int backwards);
+
+static void
+computeDashMap (
+ xArc *arcp,
+ dashMap *map)
+{
+ int di;
+ double a, x, y, prevx = 0.0, prevy = 0.0, dist;
+
+ for (di = 0; di < DASH_MAP_SIZE; di++) {
+ a = dashIndexToAngle (di);
+ x = ((double) arcp->width / 2.0) * miDcos (a);
+ y = ((double) arcp->height / 2.0) * miDsin (a);
+ if (di == 0) {
+ map->map[di] = 0.0;
+ } else {
+ dist = hypot (x - prevx, y - prevy);
+ map->map[di] = map->map[di - 1] + dist;
+ }
+ prevx = x;
+ prevy = y;
+ }
+}
+
+typedef enum {HORIZONTAL, VERTICAL, OTHER} arcTypes;
+
+/* this routine is a bit gory */
+
+static miPolyArcPtr
+miComputeArcs (
+ xArc *parcs,
+ int narcs,
+ GCPtr pGC)
+{
+ int isDashed, isDoubleDash;
+ int dashOffset;
+ miPolyArcPtr arcs;
+ int start, i, j, k = 0, nexti, nextk = 0;
+ int joinSize[2];
+ int capSize[2];
+ int arcSize[2];
+ int angle2;
+ double a0, a1;
+ struct arcData *data;
+ miArcDataPtr arc;
+ xArc xarc;
+ int iphase, prevphase = 0, joinphase;
+ int arcsJoin;
+ int selfJoin;
+
+ int iDash = 0, dashRemaining = 0;
+ int iDashStart = 0, dashRemainingStart = 0, iphaseStart;
+ int startAngle, spanAngle, endAngle, backwards = 0;
+ int prevDashAngle, dashAngle;
+ dashMap map;
+
+ isDashed = !(pGC->lineStyle == LineSolid);
+ isDoubleDash = (pGC->lineStyle == LineDoubleDash);
+ dashOffset = pGC->dashOffset;
+
+ data = malloc(narcs * sizeof (struct arcData));
+ if (!data)
+ return NULL;
+ arcs = malloc(sizeof (*arcs) * (isDoubleDash ? 2 : 1));
+ if (!arcs)
+ {
+ free(data);
+ return NULL;
+ }
+ for (i = 0; i < narcs; i++) {
+ a0 = todeg (parcs[i].angle1);
+ angle2 = parcs[i].angle2;
+ if (angle2 > FULLCIRCLE)
+ angle2 = FULLCIRCLE;
+ else if (angle2 < -FULLCIRCLE)
+ angle2 = -FULLCIRCLE;
+ data[i].selfJoin = angle2 == FULLCIRCLE || angle2 == -FULLCIRCLE;
+ a1 = todeg (parcs[i].angle1 + angle2);
+ data[i].x0 = parcs[i].x + (double) parcs[i].width / 2 * (1 + miDcos (a0));
+ data[i].y0 = parcs[i].y + (double) parcs[i].height / 2 * (1 - miDsin (a0));
+ data[i].x1 = parcs[i].x + (double) parcs[i].width / 2 * (1 + miDcos (a1));
+ data[i].y1 = parcs[i].y + (double) parcs[i].height / 2 * (1 - miDsin (a1));
+ }
+
+ for (iphase = 0; iphase < (isDoubleDash ? 2 : 1); iphase++) {
+ arcs[iphase].njoins = 0;
+ arcs[iphase].joins = 0;
+ joinSize[iphase] = 0;
+
+ arcs[iphase].ncaps = 0;
+ arcs[iphase].caps = 0;
+ capSize[iphase] = 0;
+
+ arcs[iphase].narcs = 0;
+ arcs[iphase].arcs = 0;
+ arcSize[iphase] = 0;
+ }
+
+ iphase = 0;
+ if (isDashed) {
+ iDash = 0;
+ dashRemaining = pGC->dash[0];
+ while (dashOffset > 0) {
+ if (dashOffset >= dashRemaining) {
+ dashOffset -= dashRemaining;
+ iphase = iphase ? 0 : 1;
+ iDash++;
+ if (iDash == pGC->numInDashList)
+ iDash = 0;
+ dashRemaining = pGC->dash[iDash];
+ } else {
+ dashRemaining -= dashOffset;
+ dashOffset = 0;
+ }
+ }
+ iDashStart = iDash;
+ dashRemainingStart = dashRemaining;
+ }
+ iphaseStart = iphase;
+
+ for (i = narcs - 1; i >= 0; i--) {
+ j = i + 1;
+ if (j == narcs)
+ j = 0;
+ if (data[i].selfJoin || i == j ||
+ (UNEQUAL (data[i].x1, data[j].x0) ||
+ UNEQUAL (data[i].y1, data[j].y0)))
+ {
+ if (iphase == 0 || isDoubleDash)
+ addCap (&arcs[iphase].caps, &arcs[iphase].ncaps,
+ &capSize[iphase], RIGHT_END, 0);
+ break;
+ }
+ }
+ start = i + 1;
+ if (start == narcs)
+ start = 0;
+ i = start;
+ for (;;) {
+ j = i + 1;
+ if (j == narcs)
+ j = 0;
+ nexti = i+1;
+ if (nexti == narcs)
+ nexti = 0;
+ if (isDashed) {
+ /*
+ ** deal with dashed arcs. Use special rules for certain 0 area arcs.
+ ** Presumably, the other 0 area arcs still aren't done right.
+ */
+ arcTypes arcType = OTHER;
+ CARD16 thisLength;
+
+ if (parcs[i].height == 0
+ && (parcs[i].angle1 % FULLCIRCLE) == 0x2d00
+ && parcs[i].angle2 == 0x2d00)
+ arcType = HORIZONTAL;
+ else if (parcs[i].width == 0
+ && (parcs[i].angle1 % FULLCIRCLE) == 0x1680
+ && parcs[i].angle2 == 0x2d00)
+ arcType = VERTICAL;
+ if (arcType == OTHER) {
+ /*
+ * precompute an approximation map
+ */
+ computeDashMap (&parcs[i], &map);
+ /*
+ * compute each individual dash segment using the path
+ * length function
+ */
+ startAngle = parcs[i].angle1;
+ spanAngle = parcs[i].angle2;
+ if (spanAngle > FULLCIRCLE)
+ spanAngle = FULLCIRCLE;
+ else if (spanAngle < -FULLCIRCLE)
+ spanAngle = -FULLCIRCLE;
+ if (startAngle < 0)
+ startAngle = FULLCIRCLE - (-startAngle) % FULLCIRCLE;
+ if (startAngle >= FULLCIRCLE)
+ startAngle = startAngle % FULLCIRCLE;
+ endAngle = startAngle + spanAngle;
+ backwards = spanAngle < 0;
+ } else {
+ xarc = parcs[i];
+ if (arcType == VERTICAL) {
+ xarc.angle1 = 0x1680;
+ startAngle = parcs[i].y;
+ endAngle = startAngle + parcs[i].height;
+ } else {
+ xarc.angle1 = 0x2d00;
+ startAngle = parcs[i].x;
+ endAngle = startAngle + parcs[i].width;
+ }
+ }
+ dashAngle = startAngle;
+ selfJoin = data[i].selfJoin &&
+ (iphase == 0 || isDoubleDash);
+ /*
+ * add dashed arcs to each bucket
+ */
+ arc = 0;
+ while (dashAngle != endAngle) {
+ prevDashAngle = dashAngle;
+ if (arcType == OTHER) {
+ dashAngle = computeAngleFromPath (prevDashAngle, endAngle,
+ &map, &dashRemaining, backwards);
+ /* avoid troubles with huge arcs and small dashes */
+ if (dashAngle == prevDashAngle) {
+ if (backwards)
+ dashAngle--;
+ else
+ dashAngle++;
+ }
+ } else {
+ thisLength = (dashAngle + dashRemaining <= endAngle) ?
+ dashRemaining : endAngle - dashAngle;
+ if (arcType == VERTICAL) {
+ xarc.y = dashAngle;
+ xarc.height = thisLength;
+ } else {
+ xarc.x = dashAngle;
+ xarc.width = thisLength;
+ }
+ dashAngle += thisLength;
+ dashRemaining -= thisLength;
+ }
+ if (iphase == 0 || isDoubleDash) {
+ if (arcType == OTHER) {
+ xarc = parcs[i];
+ spanAngle = prevDashAngle;
+ if (spanAngle < 0)
+ spanAngle = FULLCIRCLE - (-spanAngle) % FULLCIRCLE;
+ if (spanAngle >= FULLCIRCLE)
+ spanAngle = spanAngle % FULLCIRCLE;
+ xarc.angle1 = spanAngle;
+ spanAngle = dashAngle - prevDashAngle;
+ if (backwards) {
+ if (dashAngle > prevDashAngle)
+ spanAngle = - FULLCIRCLE + spanAngle;
+ } else {
+ if (dashAngle < prevDashAngle)
+ spanAngle = FULLCIRCLE + spanAngle;
+ }
+ if (spanAngle > FULLCIRCLE)
+ spanAngle = FULLCIRCLE;
+ if (spanAngle < -FULLCIRCLE)
+ spanAngle = -FULLCIRCLE;
+ xarc.angle2 = spanAngle;
+ }
+ arc = addArc (&arcs[iphase].arcs, &arcs[iphase].narcs,
+ &arcSize[iphase], &xarc);
+ if (!arc)
+ goto arcfail;
+ /*
+ * cap each end of an on/off dash
+ */
+ if (!isDoubleDash) {
+ if (prevDashAngle != startAngle) {
+ addCap (&arcs[iphase].caps,
+ &arcs[iphase].ncaps,
+ &capSize[iphase], RIGHT_END,
+ arc - arcs[iphase].arcs);
+
+ }
+ if (dashAngle != endAngle) {
+ addCap (&arcs[iphase].caps,
+ &arcs[iphase].ncaps,
+ &capSize[iphase], LEFT_END,
+ arc - arcs[iphase].arcs);
+ }
+ }
+ arc->cap = arcs[iphase].ncaps;
+ arc->join = arcs[iphase].njoins;
+ arc->render = 0;
+ arc->selfJoin = 0;
+ if (dashAngle == endAngle)
+ arc->selfJoin = selfJoin;
+ }
+ prevphase = iphase;
+ if (dashRemaining <= 0) {
+ ++iDash;
+ if (iDash == pGC->numInDashList)
+ iDash = 0;
+ iphase = iphase ? 0:1;
+ dashRemaining = pGC->dash[iDash];
+ }
+ }
+ /*
+ * make sure a place exists for the position data when
+ * drawing a zero-length arc
+ */
+ if (startAngle == endAngle) {
+ prevphase = iphase;
+ if (!isDoubleDash && iphase == 1)
+ prevphase = 0;
+ arc = addArc (&arcs[prevphase].arcs, &arcs[prevphase].narcs,
+ &arcSize[prevphase], &parcs[i]);
+ if (!arc)
+ goto arcfail;
+ arc->join = arcs[prevphase].njoins;
+ arc->cap = arcs[prevphase].ncaps;
+ arc->selfJoin = data[i].selfJoin;
+ }
+ } else {
+ arc = addArc (&arcs[iphase].arcs, &arcs[iphase].narcs,
+ &arcSize[iphase], &parcs[i]);
+ if (!arc)
+ goto arcfail;
+ arc->join = arcs[iphase].njoins;
+ arc->cap = arcs[iphase].ncaps;
+ arc->selfJoin = data[i].selfJoin;
+ prevphase = iphase;
+ }
+ if (prevphase == 0 || isDoubleDash)
+ k = arcs[prevphase].narcs - 1;
+ if (iphase == 0 || isDoubleDash)
+ nextk = arcs[iphase].narcs;
+ if (nexti == start) {
+ nextk = 0;
+ if (isDashed) {
+ iDash = iDashStart;
+ iphase = iphaseStart;
+ dashRemaining = dashRemainingStart;
+ }
+ }
+ arcsJoin = narcs > 1 && i != j &&
+ ISEQUAL (data[i].x1, data[j].x0) &&
+ ISEQUAL (data[i].y1, data[j].y0) &&
+ !data[i].selfJoin && !data[j].selfJoin;
+ if (arc)
+ {
+ if (arcsJoin)
+ arc->render = 0;
+ else
+ arc->render = 1;
+ }
+ if (arcsJoin &&
+ (prevphase == 0 || isDoubleDash) &&
+ (iphase == 0 || isDoubleDash))
+ {
+ joinphase = iphase;
+ if (isDoubleDash) {
+ if (nexti == start)
+ joinphase = iphaseStart;
+ /*
+ * if the join is right at the dash,
+ * draw the join in foreground
+ * This is because the foreground
+ * arcs are computed second, the results
+ * of which are needed to draw the join
+ */
+ if (joinphase != prevphase)
+ joinphase = 0;
+ }
+ if (joinphase == 0 || isDoubleDash) {
+ addJoin (&arcs[joinphase].joins,
+ &arcs[joinphase].njoins,
+ &joinSize[joinphase],
+ LEFT_END, k, prevphase,
+ RIGHT_END, nextk, iphase);
+ arc->join = arcs[prevphase].njoins;
+ }
+ } else {
+ /*
+ * cap the left end of this arc
+ * unless it joins itself
+ */
+ if ((prevphase == 0 || isDoubleDash) &&
+ !arc->selfJoin)
+ {
+ addCap (&arcs[prevphase].caps, &arcs[prevphase].ncaps,
+ &capSize[prevphase], LEFT_END, k);
+ arc->cap = arcs[prevphase].ncaps;
+ }
+ if (isDashed && !arcsJoin) {
+ iDash = iDashStart;
+ iphase = iphaseStart;
+ dashRemaining = dashRemainingStart;
+ }
+ nextk = arcs[iphase].narcs;
+ if (nexti == start) {
+ nextk = 0;
+ iDash = iDashStart;
+ iphase = iphaseStart;
+ dashRemaining = dashRemainingStart;
+ }
+ /*
+ * cap the right end of the next arc. If the
+ * next arc is actually the first arc, only
+ * cap it if it joins with this arc. This
+ * case will occur when the final dash segment
+ * of an on/off dash is off. Of course, this
+ * cap will be drawn at a strange time, but that
+ * hardly matters...
+ */
+ if ((iphase == 0 || isDoubleDash) &&
+ (nexti != start || (arcsJoin && isDashed)))
+ addCap (&arcs[iphase].caps, &arcs[iphase].ncaps,
+ &capSize[iphase], RIGHT_END, nextk);
+ }
+ i = nexti;
+ if (i == start)
+ break;
+ }
+ /*
+ * make sure the last section is rendered
+ */
+ for (iphase = 0; iphase < (isDoubleDash ? 2 : 1); iphase++)
+ if (arcs[iphase].narcs > 0) {
+ arcs[iphase].arcs[arcs[iphase].narcs-1].render = 1;
+ arcs[iphase].arcs[arcs[iphase].narcs-1].join =
+ arcs[iphase].njoins;
+ arcs[iphase].arcs[arcs[iphase].narcs-1].cap =
+ arcs[iphase].ncaps;
+ }
+ free(data);
+ return arcs;
+arcfail:
+ miFreeArcs(arcs, pGC);
+ free(data);
+ return NULL;
+}
+
+static double
+angleToLength (
+ int angle,
+ dashMap *map)
+{
+ double len, excesslen, sidelen = map->map[DASH_MAP_SIZE - 1], totallen;
+ int di;
+ int excess;
+ Bool oddSide = FALSE;
+
+ totallen = 0;
+ if (angle >= 0) {
+ while (angle >= 90 * 64) {
+ angle -= 90 * 64;
+ totallen += sidelen;
+ oddSide = !oddSide;
+ }
+ } else {
+ while (angle < 0) {
+ angle += 90 * 64;
+ totallen -= sidelen;
+ oddSide = !oddSide;
+ }
+ }
+ if (oddSide)
+ angle = 90 * 64 - angle;
+
+ di = xAngleToDashIndex (angle);
+ excess = angle - dashIndexToXAngle (di);
+
+ len = map->map[di];
+ /*
+ * linearly interpolate between this point and the next
+ */
+ if (excess > 0) {
+ excesslen = (map->map[di + 1] - map->map[di]) *
+ ((double) excess) / dashXAngleStep;
+ len += excesslen;
+ }
+ if (oddSide)
+ totallen += (sidelen - len);
+ else
+ totallen += len;
+ return totallen;
+}
+
+/*
+ * len is along the arc, but may be more than one rotation
+ */
+
+static int
+lengthToAngle (
+ double len,
+ dashMap *map)
+{
+ double sidelen = map->map[DASH_MAP_SIZE - 1];
+ int angle, angleexcess;
+ Bool oddSide = FALSE;
+ int a0, a1, a;
+
+ angle = 0;
+ /*
+ * step around the ellipse, subtracting sidelens and
+ * adding 90 degrees. oddSide will tell if the
+ * map should be interpolated in reverse
+ */
+ if (len >= 0) {
+ if (sidelen == 0)
+ return 2 * FULLCIRCLE; /* infinity */
+ while (len >= sidelen) {
+ angle += 90 * 64;
+ len -= sidelen;
+ oddSide = !oddSide;
+ }
+ } else {
+ if (sidelen == 0)
+ return -2 * FULLCIRCLE; /* infinity */
+ while (len < 0) {
+ angle -= 90 * 64;
+ len += sidelen;
+ oddSide = !oddSide;
+ }
+ }
+ if (oddSide)
+ len = sidelen - len;
+ a0 = 0;
+ a1 = DASH_MAP_SIZE - 1;
+ /*
+ * binary search for the closest pre-computed length
+ */
+ while (a1 - a0 > 1) {
+ a = (a0 + a1) / 2;
+ if (len > map->map[a])
+ a0 = a;
+ else
+ a1 = a;
+ }
+ angleexcess = dashIndexToXAngle (a0);
+ /*
+ * linearly interpolate to the next point
+ */
+ angleexcess += (len - map->map[a0]) /
+ (map->map[a0+1] - map->map[a0]) * dashXAngleStep;
+ if (oddSide)
+ angle += (90 * 64) - angleexcess;
+ else
+ angle += angleexcess;
+ return angle;
+}
+
+/*
+ * compute the angle of an ellipse which cooresponds to
+ * the given path length. Note that the correct solution
+ * to this problem is an eliptic integral, we'll punt and
+ * approximate (it's only for dashes anyway). This
+ * approximation uses a polygon.
+ *
+ * The remaining portion of len is stored in *lenp -
+ * this will be negative if the arc extends beyond
+ * len and positive if len extends beyond the arc.
+ */
+
+static int
+computeAngleFromPath (
+ int startAngle,
+ int endAngle, /* normalized absolute angles in *64 degrees */
+ dashMap *map,
+ int *lenp,
+ int backwards)
+{
+ int a0, a1, a;
+ double len0;
+ int len;
+
+ a0 = startAngle;
+ a1 = endAngle;
+ len = *lenp;
+ if (backwards) {
+ /*
+ * flip the problem around to always be
+ * forwards
+ */
+ a0 = FULLCIRCLE - a0;
+ a1 = FULLCIRCLE - a1;
+ }
+ if (a1 < a0)
+ a1 += FULLCIRCLE;
+ len0 = angleToLength (a0, map);
+ a = lengthToAngle (len0 + len, map);
+ if (a > a1) {
+ a = a1;
+ len -= angleToLength (a1, map) - len0;
+ } else
+ len = 0;
+ if (backwards)
+ a = FULLCIRCLE - a;
+ *lenp = len;
+ return a;
+}
+
+/*
+ * scan convert wide arcs.
+ */
+
+/*
+ * draw zero width/height arcs
+ */
+
+static void
+drawZeroArc (
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ xArc *tarc,
+ int lw,
+ miArcFacePtr left,
+ miArcFacePtr right)
+{
+ double x0 = 0.0, y0 = 0.0, x1 = 0.0, y1 = 0.0, w, h, x, y;
+ double xmax, ymax, xmin, ymin;
+ int a0, a1;
+ double a, startAngle, endAngle;
+ double l, lx, ly;
+
+ l = lw / 2.0;
+ a0 = tarc->angle1;
+ a1 = tarc->angle2;
+ if (a1 > FULLCIRCLE)
+ a1 = FULLCIRCLE;
+ else if (a1 < -FULLCIRCLE)
+ a1 = -FULLCIRCLE;
+ w = (double)tarc->width / 2.0;
+ h = (double)tarc->height / 2.0;
+ /*
+ * play in X coordinates right away
+ */
+ startAngle = - ((double) a0 / 64.0);
+ endAngle = - ((double) (a0 + a1) / 64.0);
+
+ xmax = -w;
+ xmin = w;
+ ymax = -h;
+ ymin = h;
+ a = startAngle;
+ for (;;)
+ {
+ x = w * miDcos(a);
+ y = h * miDsin(a);
+ if (a == startAngle)
+ {
+ x0 = x;
+ y0 = y;
+ }
+ if (a == endAngle)
+ {
+ x1 = x;
+ y1 = y;
+ }
+ if (x > xmax)
+ xmax = x;
+ if (x < xmin)
+ xmin = x;
+ if (y > ymax)
+ ymax = y;
+ if (y < ymin)
+ ymin = y;
+ if (a == endAngle)
+ break;
+ if (a1 < 0) /* clockwise */
+ {
+ if (floor (a / 90.0) == floor (endAngle / 90.0))
+ a = endAngle;
+ else
+ a = 90 * (floor (a/90.0) + 1);
+ }
+ else
+ {
+ if (ceil (a / 90.0) == ceil (endAngle / 90.0))
+ a = endAngle;
+ else
+ a = 90 * (ceil (a/90.0) - 1);
+ }
+ }
+ lx = ly = l;
+ if ((x1 - x0) + (y1 - y0) < 0)
+ lx = ly = -l;
+ if (h)
+ {
+ ly = 0.0;
+ lx = -lx;
+ }
+ else
+ lx = 0.0;
+ if (right)
+ {
+ right->center.x = x0;
+ right->center.y = y0;
+ right->clock.x = x0 - lx;
+ right->clock.y = y0 - ly;
+ right->counterClock.x = x0 + lx;
+ right->counterClock.y = y0 + ly;
+ }
+ if (left)
+ {
+ left->center.x = x1;
+ left->center.y = y1;
+ left->clock.x = x1 + lx;
+ left->clock.y = y1 + ly;
+ left->counterClock.x = x1 - lx;
+ left->counterClock.y = y1 - ly;
+ }
+
+ x0 = xmin;
+ x1 = xmax;
+ y0 = ymin;
+ y1 = ymax;
+ if (ymin != y1) {
+ xmin = -l;
+ xmax = l;
+ } else {
+ ymin = -l;
+ ymax = l;
+ }
+ if (xmax != xmin && ymax != ymin) {
+ int minx, maxx, miny, maxy;
+ xRectangle rect;
+
+ minx = ICEIL (xmin + w) + tarc->x;
+ maxx = ICEIL (xmax + w) + tarc->x;
+ miny = ICEIL (ymin + h) + tarc->y;
+ maxy = ICEIL (ymax + h) + tarc->y;
+ rect.x = minx;
+ rect.y = miny;
+ rect.width = maxx - minx;
+ rect.height = maxy - miny;
+ (*pGC->ops->PolyFillRect) (pDraw, pGC, 1, &rect);
+ }
+}
+
+/*
+ * this computes the ellipse y value associated with the
+ * bottom of the tail.
+ */
+
+static void
+tailEllipseY (
+ struct arc_def *def,
+ struct accelerators *acc)
+{
+ double t;
+
+ acc->tail_y = 0.0;
+ if (def->w == def->h)
+ return;
+ t = def->l * def->w;
+ if (def->w > def->h) {
+ if (t < acc->h2)
+ return;
+ } else {
+ if (t > acc->h2)
+ return;
+ }
+ t = 2.0 * def->h * t;
+ t = (CUBED_ROOT_4 * acc->h2 - cbrt(t * t)) / acc->h2mw2;
+ if (t > 0.0)
+ acc->tail_y = def->h / CUBED_ROOT_2 * sqrt(t);
+}
+
+/*
+ * inverse functions -- compute edge coordinates
+ * from the ellipse
+ */
+
+static double
+outerXfromXY (
+ double x,
+ double y,
+ struct arc_def *def,
+ struct accelerators *acc)
+{
+ return x + (x * acc->h2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
+}
+
+static double
+outerYfromXY (
+ double x,
+ double y,
+ struct arc_def *def,
+ struct accelerators *acc)
+{
+ return y + (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
+}
+
+static double
+innerXfromXY (
+ double x,
+ double y,
+ struct arc_def *def,
+ struct accelerators *acc)
+{
+ return x - (x * acc->h2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
+}
+
+static double
+innerYfromXY (
+ double x,
+ double y,
+ struct arc_def *def,
+ struct accelerators *acc)
+{
+ return y - (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
+}
+
+static double
+innerYfromY (
+ double y,
+ struct arc_def *def,
+ struct accelerators *acc)
+{
+ double x;
+
+ x = (def->w / def->h) * sqrt (acc->h2 - y*y);
+
+ return y - (y * acc->w2l) / sqrt (x*x * acc->h4 + y*y * acc->w4);
+}
+
+static void
+computeLine (
+ double x1,
+ double y1,
+ double x2,
+ double y2,
+ struct line *line)
+{
+ if (y1 == y2)
+ line->valid = 0;
+ else {
+ line->m = (x1 - x2) / (y1 - y2);
+ line->b = x1 - y1 * line->m;
+ line->valid = 1;
+ }
+}
+
+/*
+ * compute various accelerators for an ellipse. These
+ * are simply values that are used repeatedly in
+ * the computations
+ */
+
+static void
+computeAcc (
+ xArc *tarc,
+ int lw,
+ struct arc_def *def,
+ struct accelerators *acc)
+{
+ def->w = ((double) tarc->width) / 2.0;
+ def->h = ((double) tarc->height) / 2.0;
+ def->l = ((double) lw) / 2.0;
+ acc->h2 = def->h * def->h;
+ acc->w2 = def->w * def->w;
+ acc->h4 = acc->h2 * acc->h2;
+ acc->w4 = acc->w2 * acc->w2;
+ acc->h2l = acc->h2 * def->l;
+ acc->w2l = acc->w2 * def->l;
+ acc->h2mw2 = acc->h2 - acc->w2;
+ acc->fromIntX = (tarc->width & 1) ? 0.5 : 0.0;
+ acc->fromIntY = (tarc->height & 1) ? 0.5 : 0.0;
+ acc->xorg = tarc->x + (tarc->width >> 1);
+ acc->yorgu = tarc->y + (tarc->height >> 1);
+ acc->yorgl = acc->yorgu + (tarc->height & 1);
+ tailEllipseY (def, acc);
+}
+
+/*
+ * compute y value bounds of various portions of the arc,
+ * the outer edge, the ellipse and the inner edge.
+ */
+
+static void
+computeBound (
+ struct arc_def *def,
+ struct arc_bound *bound,
+ struct accelerators *acc,
+ miArcFacePtr right,
+ miArcFacePtr left)
+{
+ double t;
+ double innerTaily;
+ double tail_y;
+ struct bound innerx, outerx;
+ struct bound ellipsex;
+
+ bound->ellipse.min = Dsin (def->a0) * def->h;
+ bound->ellipse.max = Dsin (def->a1) * def->h;
+ if (def->a0 == 45 && def->w == def->h)
+ ellipsex.min = bound->ellipse.min;
+ else
+ ellipsex.min = Dcos (def->a0) * def->w;
+ if (def->a1 == 45 && def->w == def->h)
+ ellipsex.max = bound->ellipse.max;
+ else
+ ellipsex.max = Dcos (def->a1) * def->w;
+ bound->outer.min = outerYfromXY (ellipsex.min, bound->ellipse.min, def, acc);
+ bound->outer.max = outerYfromXY (ellipsex.max, bound->ellipse.max, def, acc);
+ bound->inner.min = innerYfromXY (ellipsex.min, bound->ellipse.min, def, acc);
+ bound->inner.max = innerYfromXY (ellipsex.max, bound->ellipse.max, def, acc);
+
+ outerx.min = outerXfromXY (ellipsex.min, bound->ellipse.min, def, acc);
+ outerx.max = outerXfromXY (ellipsex.max, bound->ellipse.max, def, acc);
+ innerx.min = innerXfromXY (ellipsex.min, bound->ellipse.min, def, acc);
+ innerx.max = innerXfromXY (ellipsex.max, bound->ellipse.max, def, acc);
+
+ /*
+ * save the line end points for the
+ * cap code to use. Careful here, these are
+ * in cartesean coordinates (y increasing upwards)
+ * while the cap code uses inverted coordinates
+ * (y increasing downwards)
+ */
+
+ if (right) {
+ right->counterClock.y = bound->outer.min;
+ right->counterClock.x = outerx.min;
+ right->center.y = bound->ellipse.min;
+ right->center.x = ellipsex.min;
+ right->clock.y = bound->inner.min;
+ right->clock.x = innerx.min;
+ }
+
+ if (left) {
+ left->clock.y = bound->outer.max;
+ left->clock.x = outerx.max;
+ left->center.y = bound->ellipse.max;
+ left->center.x = ellipsex.max;
+ left->counterClock.y = bound->inner.max;
+ left->counterClock.x = innerx.max;
+ }
+
+ bound->left.min = bound->inner.max;
+ bound->left.max = bound->outer.max;
+ bound->right.min = bound->inner.min;
+ bound->right.max = bound->outer.min;
+
+ computeLine (innerx.min, bound->inner.min, outerx.min, bound->outer.min,
+ &acc->right);
+ computeLine (innerx.max, bound->inner.max, outerx.max, bound->outer.max,
+ &acc->left);
+
+ if (bound->inner.min > bound->inner.max) {
+ t = bound->inner.min;
+ bound->inner.min = bound->inner.max;
+ bound->inner.max = t;
+ }
+ tail_y = acc->tail_y;
+ if (tail_y > bound->ellipse.max)
+ tail_y = bound->ellipse.max;
+ else if (tail_y < bound->ellipse.min)
+ tail_y = bound->ellipse.min;
+ innerTaily = innerYfromY (tail_y, def, acc);
+ if (bound->inner.min > innerTaily)
+ bound->inner.min = innerTaily;
+ if (bound->inner.max < innerTaily)
+ bound->inner.max = innerTaily;
+ bound->inneri.min = ICEIL(bound->inner.min - acc->fromIntY);
+ bound->inneri.max = floor(bound->inner.max - acc->fromIntY);
+ bound->outeri.min = ICEIL(bound->outer.min - acc->fromIntY);
+ bound->outeri.max = floor(bound->outer.max - acc->fromIntY);
+}
+
+/*
+ * this section computes the x value of the span at y
+ * intersected with the specified face of the ellipse.
+ *
+ * this is the min/max X value over the set of normal
+ * lines to the entire ellipse, the equation of the
+ * normal lines is:
+ *
+ * ellipse_x h^2 h^2
+ * x = ------------ y + ellipse_x (1 - --- )
+ * ellipse_y w^2 w^2
+ *
+ * compute the derivative with-respect-to ellipse_y and solve
+ * for zero:
+ *
+ * (w^2 - h^2) ellipse_y^3 + h^4 y
+ * 0 = - ----------------------------------
+ * h w ellipse_y^2 sqrt (h^2 - ellipse_y^2)
+ *
+ * ( h^4 y )
+ * ellipse_y = ( ---------- ) ^ (1/3)
+ * ( (h^2 - w^2) )
+ *
+ * The other two solutions to the equation are imaginary.
+ *
+ * This gives the position on the ellipse which generates
+ * the normal with the largest/smallest x intersection point.
+ *
+ * Now compute the second derivative to check whether
+ * the intersection is a minimum or maximum:
+ *
+ * h (y0^3 (w^2 - h^2) + h^2 y (3y0^2 - 2h^2))
+ * - -------------------------------------------
+ * w y0^3 (sqrt (h^2 - y^2)) ^ 3
+ *
+ * as we only care about the sign,
+ *
+ * - (y0^3 (w^2 - h^2) + h^2 y (3y0^2 - 2h^2))
+ *
+ * or (to use accelerators),
+ *
+ * y0^3 (h^2 - w^2) - h^2 y (3y0^2 - 2h^2)
+ *
+ */
+
+/*
+ * computes the position on the ellipse whose normal line
+ * intersects the given scan line maximally
+ */
+
+static double
+hookEllipseY (
+ double scan_y,
+ struct arc_bound *bound,
+ struct accelerators *acc,
+ int left)
+{
+ double ret;
+
+ if (acc->h2mw2 == 0) {
+ if ( (scan_y > 0 && !left) || (scan_y < 0 && left) )
+ return bound->ellipse.min;
+ return bound->ellipse.max;
+ }
+ ret = (acc->h4 * scan_y) / (acc->h2mw2);
+ if (ret >= 0)
+ return cbrt (ret);
+ else
+ return -cbrt (-ret);
+}
+
+/*
+ * computes the X value of the intersection of the
+ * given scan line with the right side of the lower hook
+ */
+
+static double
+hookX (
+ double scan_y,
+ struct arc_def *def,
+ struct arc_bound *bound,
+ struct accelerators *acc,
+ int left)
+{
+ double ellipse_y, x;
+ double maxMin;
+
+ if (def->w != def->h) {
+ ellipse_y = hookEllipseY (scan_y, bound, acc, left);
+ if (boundedLe (ellipse_y, bound->ellipse)) {
+ /*
+ * compute the value of the second
+ * derivative
+ */
+ maxMin = ellipse_y*ellipse_y*ellipse_y * acc->h2mw2 -
+ acc->h2 * scan_y * (3 * ellipse_y*ellipse_y - 2*acc->h2);
+ if ((left && maxMin > 0) || (!left && maxMin < 0)) {
+ if (ellipse_y == 0)
+ return def->w + left ? -def->l : def->l;
+ x = (acc->h2 * scan_y - ellipse_y * acc->h2mw2) *
+ sqrt (acc->h2 - ellipse_y * ellipse_y) /
+ (def->h * def->w * ellipse_y);
+ return x;
+ }
+ }
+ }
+ if (left) {
+ if (acc->left.valid && boundedLe (scan_y, bound->left)) {
+ x = intersectLine (scan_y, acc->left);
+ } else {
+ if (acc->right.valid)
+ x = intersectLine (scan_y, acc->right);
+ else
+ x = def->w - def->l;
+ }
+ } else {
+ if (acc->right.valid && boundedLe (scan_y, bound->right)) {
+ x = intersectLine (scan_y, acc->right);
+ } else {
+ if (acc->left.valid)
+ x = intersectLine (scan_y, acc->left);
+ else
+ x = def->w - def->l;
+ }
+ }
+ return x;
+}
+
+/*
+ * generate the set of spans with
+ * the given y coordinate
+ */
+
+static void
+arcSpan (
+ int y,
+ int lx,
+ int lw,
+ int rx,
+ int rw,
+ struct arc_def *def,
+ struct arc_bound *bounds,
+ struct accelerators *acc,
+ int mask)
+{
+ int linx, loutx, rinx, routx;
+ double x, altx;
+
+ if (boundedLe (y, bounds->inneri)) {
+ linx = -(lx + lw);
+ rinx = rx;
+ } else {
+ /*
+ * intersection with left face
+ */
+ x = hookX (y + acc->fromIntY, def, bounds, acc, 1);
+ if (acc->right.valid &&
+ boundedLe (y + acc->fromIntY, bounds->right))
+ {
+ altx = intersectLine (y + acc->fromIntY, acc->right);
+ if (altx < x)
+ x = altx;
+ }
+ linx = -ICEIL(acc->fromIntX - x);
+ rinx = ICEIL(acc->fromIntX + x);
+ }
+ if (boundedLe (y, bounds->outeri)) {
+ loutx = -lx;
+ routx = rx + rw;
+ } else {
+ /*
+ * intersection with right face
+ */
+ x = hookX (y + acc->fromIntY, def, bounds, acc, 0);
+ if (acc->left.valid &&
+ boundedLe (y + acc->fromIntY, bounds->left))
+ {
+ altx = x;
+ x = intersectLine (y + acc->fromIntY, acc->left);
+ if (x < altx)
+ x = altx;
+ }
+ loutx = -ICEIL(acc->fromIntX - x);
+ routx = ICEIL(acc->fromIntX + x);
+ }
+ if (routx > rinx) {
+ if (mask & 1)
+ newFinalSpan (acc->yorgu - y,
+ acc->xorg + rinx, acc->xorg + routx);
+ if (mask & 8)
+ newFinalSpan (acc->yorgl + y,
+ acc->xorg + rinx, acc->xorg + routx);
+ }
+ if (loutx > linx) {
+ if (mask & 2)
+ newFinalSpan (acc->yorgu - y,
+ acc->xorg - loutx, acc->xorg - linx);
+ if (mask & 4)
+ newFinalSpan (acc->yorgl + y,
+ acc->xorg - loutx, acc->xorg - linx);
+ }
+}
+
+static void
+arcSpan0 (
+ int lx,
+ int lw,
+ int rx,
+ int rw,
+ struct arc_def *def,
+ struct arc_bound *bounds,
+ struct accelerators *acc,
+ int mask)
+{
+ double x;
+
+ if (boundedLe (0, bounds->inneri) &&
+ acc->left.valid && boundedLe (0, bounds->left) &&
+ acc->left.b > 0)
+ {
+ x = def->w - def->l;
+ if (acc->left.b < x)
+ x = acc->left.b;
+ lw = ICEIL(acc->fromIntX - x) - lx;
+ rw += rx;
+ rx = ICEIL(acc->fromIntX + x);
+ rw -= rx;
+ }
+ arcSpan (0, lx, lw, rx, rw, def, bounds, acc, mask);
+}
+
+static void
+tailSpan (
+ int y,
+ int lw,
+ int rw,
+ struct arc_def *def,
+ struct arc_bound *bounds,
+ struct accelerators *acc,
+ int mask)
+{
+ double yy, xalt, x, lx, rx;
+ int n;
+
+ if (boundedLe(y, bounds->outeri))
+ arcSpan (y, 0, lw, -rw, rw, def, bounds, acc, mask);
+ else if (def->w != def->h) {
+ yy = y + acc->fromIntY;
+ x = tailX(yy, def, bounds, acc);
+ if (yy == 0.0 && x == -rw - acc->fromIntX)
+ return;
+ if (acc->right.valid && boundedLe (yy, bounds->right)) {
+ rx = x;
+ lx = -x;
+ xalt = intersectLine (yy, acc->right);
+ if (xalt >= -rw - acc->fromIntX && xalt <= rx)
+ rx = xalt;
+ n = ICEIL(acc->fromIntX + lx);
+ if (lw > n) {
+ if (mask & 2)
+ newFinalSpan (acc->yorgu - y,
+ acc->xorg + n, acc->xorg + lw);
+ if (mask & 4)
+ newFinalSpan (acc->yorgl + y,
+ acc->xorg + n, acc->xorg + lw);
+ }
+ n = ICEIL(acc->fromIntX + rx);
+ if (n > -rw) {
+ if (mask & 1)
+ newFinalSpan (acc->yorgu - y,
+ acc->xorg - rw, acc->xorg + n);
+ if (mask & 8)
+ newFinalSpan (acc->yorgl + y,
+ acc->xorg - rw, acc->xorg + n);
+ }
+ }
+ arcSpan (y,
+ ICEIL(acc->fromIntX - x), 0,
+ ICEIL(acc->fromIntX + x), 0,
+ def, bounds, acc, mask);
+ }
+}
+
+/*
+ * create whole arcs out of pieces. This code is
+ * very bad.
+ */
+
+static struct finalSpan **finalSpans = NULL;
+static int finalMiny = 0, finalMaxy = -1;
+static int finalSize = 0;
+
+static int nspans = 0; /* total spans, not just y coords */
+
+struct finalSpan {
+ struct finalSpan *next;
+ int min, max; /* x values */
+};
+
+static struct finalSpan *freeFinalSpans, *tmpFinalSpan;
+
+# define allocFinalSpan() (freeFinalSpans ?\
+ ((tmpFinalSpan = freeFinalSpans), \
+ (freeFinalSpans = freeFinalSpans->next), \
+ (tmpFinalSpan->next = 0), \
+ tmpFinalSpan) : \
+ realAllocSpan ())
+
+# define SPAN_CHUNK_SIZE 128
+
+struct finalSpanChunk {
+ struct finalSpan data[SPAN_CHUNK_SIZE];
+ struct finalSpanChunk *next;
+};
+
+static struct finalSpanChunk *chunks;
+
+static struct finalSpan *
+realAllocSpan (void)
+{
+ struct finalSpanChunk *newChunk;
+ struct finalSpan *span;
+ int i;
+
+ newChunk = malloc(sizeof (struct finalSpanChunk));
+ if (!newChunk)
+ return (struct finalSpan *) NULL;
+ newChunk->next = chunks;
+ chunks = newChunk;
+ freeFinalSpans = span = newChunk->data + 1;
+ for (i = 1; i < SPAN_CHUNK_SIZE-1; i++) {
+ span->next = span+1;
+ span++;
+ }
+ span->next = 0;
+ span = newChunk->data;
+ span->next = 0;
+ return span;
+}
+
+static void
+disposeFinalSpans (void)
+{
+ struct finalSpanChunk *chunk, *next;
+
+ for (chunk = chunks; chunk; chunk = next) {
+ next = chunk->next;
+ free(chunk);
+ }
+ chunks = 0;
+ freeFinalSpans = 0;
+ free(finalSpans);
+ finalSpans = 0;
+}
+
+static void
+fillSpans (
+ DrawablePtr pDrawable,
+ GCPtr pGC)
+{
+ struct finalSpan *span;
+ DDXPointPtr xSpan;
+ int *xWidth;
+ int i;
+ struct finalSpan **f;
+ int spany;
+ DDXPointPtr xSpans;
+ int *xWidths;
+
+ if (nspans == 0)
+ return;
+ xSpan = xSpans = malloc(nspans * sizeof (DDXPointRec));
+ xWidth = xWidths = malloc(nspans * sizeof (int));
+ if (xSpans && xWidths)
+ {
+ i = 0;
+ f = finalSpans;
+ for (spany = finalMiny; spany <= finalMaxy; spany++, f++) {
+ for (span = *f; span; span=span->next) {
+ if (span->max <= span->min)
+ continue;
+ xSpan->x = span->min;
+ xSpan->y = spany;
+ ++xSpan;
+ *xWidth++ = span->max - span->min;
+ ++i;
+ }
+ }
+ (*pGC->ops->FillSpans) (pDrawable, pGC, i, xSpans, xWidths, TRUE);
+ }
+ disposeFinalSpans ();
+ free(xSpans);
+ free(xWidths);
+ finalMiny = 0;
+ finalMaxy = -1;
+ finalSize = 0;
+ nspans = 0;
+}
+
+# define SPAN_REALLOC 100
+
+# define findSpan(y) ((finalMiny <= (y) && (y) <= finalMaxy) ? \
+ &finalSpans[(y) - finalMiny] : \
+ realFindSpan (y))
+
+static struct finalSpan **
+realFindSpan (int y)
+{
+ struct finalSpan **newSpans;
+ int newSize, newMiny, newMaxy;
+ int change;
+ int i;
+
+ if (y < finalMiny || y > finalMaxy) {
+ if (!finalSize) {
+ finalMiny = y;
+ finalMaxy = y - 1;
+ }
+ if (y < finalMiny)
+ change = finalMiny - y;
+ else
+ change = y - finalMaxy;
+ if (change >= SPAN_REALLOC)
+ change += SPAN_REALLOC;
+ else
+ change = SPAN_REALLOC;
+ newSize = finalSize + change;
+ newSpans = malloc(newSize * sizeof (struct finalSpan *));
+ if (!newSpans)
+ return NULL;
+ newMiny = finalMiny;
+ newMaxy = finalMaxy;
+ if (y < finalMiny)
+ newMiny = finalMiny - change;
+ else
+ newMaxy = finalMaxy + change;
+ if (finalSpans) {
+ memmove(((char *) newSpans) + (finalMiny-newMiny) * sizeof (struct finalSpan *),
+ (char *) finalSpans,
+ finalSize * sizeof (struct finalSpan *));
+ free(finalSpans);
+ }
+ if ((i = finalMiny - newMiny) > 0)
+ memset((char *)newSpans, 0, i * sizeof (struct finalSpan *));
+ if ((i = newMaxy - finalMaxy) > 0)
+ memset((char *)(newSpans + newSize - i), 0,
+ i * sizeof (struct finalSpan *));
+ finalSpans = newSpans;
+ finalMaxy = newMaxy;
+ finalMiny = newMiny;
+ finalSize = newSize;
+ }
+ return &finalSpans[y - finalMiny];
+}
+
+static void
+newFinalSpan (
+ int y,
+ int xmin,
+ int xmax)
+{
+ struct finalSpan *x;
+ struct finalSpan **f;
+ struct finalSpan *oldx;
+ struct finalSpan *prev;
+
+ f = findSpan (y);
+ if (!f)
+ return;
+ oldx = 0;
+ for (;;) {
+ prev = 0;
+ for (x = *f; x; x=x->next) {
+ if (x == oldx) {
+ prev = x;
+ continue;
+ }
+ if (x->min <= xmax && xmin <= x->max) {
+ if (oldx) {
+ oldx->min = min (x->min, xmin);
+ oldx->max = max (x->max, xmax);
+ if (prev)
+ prev->next = x->next;
+ else
+ *f = x->next;
+ --nspans;
+ } else {
+ x->min = min (x->min, xmin);
+ x->max = max (x->max, xmax);
+ oldx = x;
+ }
+ xmin = oldx->min;
+ xmax = oldx->max;
+ break;
+ }
+ prev = x;
+ }
+ if (!x)
+ break;
+ }
+ if (!oldx) {
+ x = allocFinalSpan ();
+ if (x)
+ {
+ x->min = xmin;
+ x->max = xmax;
+ x->next = *f;
+ *f = x;
+ ++nspans;
+ }
+ }
+}
+
+static void
+mirrorSppPoint (
+ int quadrant,
+ SppPointPtr sppPoint)
+{
+ switch (quadrant) {
+ case 0:
+ break;
+ case 1:
+ sppPoint->x = -sppPoint->x;
+ break;
+ case 2:
+ sppPoint->x = -sppPoint->x;
+ sppPoint->y = -sppPoint->y;
+ break;
+ case 3:
+ sppPoint->y = -sppPoint->y;
+ break;
+ }
+ /*
+ * and translate to X coordinate system
+ */
+ sppPoint->y = -sppPoint->y;
+}
+
+/*
+ * split an arc into pieces which are scan-converted
+ * in the first-quadrant and mirrored into position.
+ * This is necessary as the scan-conversion code can
+ * only deal with arcs completely contained in the
+ * first quadrant.
+ */
+
+static void
+drawArc (
+ xArc *tarc,
+ int l,
+ int a0,
+ int a1,
+ miArcFacePtr right,
+ miArcFacePtr left) /* save end line points */
+{
+ struct arc_def def;
+ struct accelerators acc;
+ int startq, endq, curq;
+ int rightq, leftq = 0, righta = 0, lefta = 0;
+ miArcFacePtr passRight, passLeft;
+ int q0 = 0, q1 = 0, mask;
+ struct band {
+ int a0, a1;
+ int mask;
+ } band[5], sweep[20];
+ int bandno, sweepno;
+ int i, j;
+ int flipRight = 0, flipLeft = 0;
+ int copyEnd = 0;
+ miArcSpanData *spdata;
+
+ spdata = miComputeWideEllipse(l, tarc);
+ if (!spdata)
+ return;
+
+ if (a1 < a0)
+ a1 += 360 * 64;
+ startq = a0 / (90 * 64);
+ if (a0 == a1)
+ endq = startq;
+ else
+ endq = (a1-1) / (90 * 64);
+ bandno = 0;
+ curq = startq;
+ rightq = -1;
+ for (;;) {
+ switch (curq) {
+ case 0:
+ if (a0 > 90 * 64)
+ q0 = 0;
+ else
+ q0 = a0;
+ if (a1 < 360 * 64)
+ q1 = min (a1, 90 * 64);
+ else
+ q1 = 90 * 64;
+ if (curq == startq && a0 == q0 && rightq < 0) {
+ righta = q0;
+ rightq = curq;
+ }
+ if (curq == endq && a1 == q1) {
+ lefta = q1;
+ leftq = curq;
+ }
+ break;
+ case 1:
+ if (a1 < 90 * 64)
+ q0 = 0;
+ else
+ q0 = 180 * 64 - min (a1, 180 * 64);
+ if (a0 > 180 * 64)
+ q1 = 90 * 64;
+ else
+ q1 = 180 * 64 - max (a0, 90 * 64);
+ if (curq == startq && 180 * 64 - a0 == q1) {
+ righta = q1;
+ rightq = curq;
+ }
+ if (curq == endq && 180 * 64 - a1 == q0) {
+ lefta = q0;
+ leftq = curq;
+ }
+ break;
+ case 2:
+ if (a0 > 270 * 64)
+ q0 = 0;
+ else
+ q0 = max (a0, 180 * 64) - 180 * 64;
+ if (a1 < 180 * 64)
+ q1 = 90 * 64;
+ else
+ q1 = min (a1, 270 * 64) - 180 * 64;
+ if (curq == startq && a0 - 180*64 == q0) {
+ righta = q0;
+ rightq = curq;
+ }
+ if (curq == endq && a1 - 180 * 64 == q1) {
+ lefta = q1;
+ leftq = curq;
+ }
+ break;
+ case 3:
+ if (a1 < 270 * 64)
+ q0 = 0;
+ else
+ q0 = 360 * 64 - min (a1, 360 * 64);
+ q1 = 360 * 64 - max (a0, 270 * 64);
+ if (curq == startq && 360 * 64 - a0 == q1) {
+ righta = q1;
+ rightq = curq;
+ }
+ if (curq == endq && 360 * 64 - a1 == q0) {
+ lefta = q0;
+ leftq = curq;
+ }
+ break;
+ }
+ band[bandno].a0 = q0;
+ band[bandno].a1 = q1;
+ band[bandno].mask = 1 << curq;
+ bandno++;
+ if (curq == endq)
+ break;
+ curq++;
+ if (curq == 4) {
+ a0 = 0;
+ a1 -= 360 * 64;
+ curq = 0;
+ endq -= 4;
+ }
+ }
+ sweepno = 0;
+ for (;;) {
+ q0 = 90 * 64;
+ mask = 0;
+ /*
+ * find left-most point
+ */
+ for (i = 0; i < bandno; i++)
+ if (band[i].a0 <= q0) {
+ q0 = band[i].a0;
+ q1 = band[i].a1;
+ mask = band[i].mask;
+ }
+ if (!mask)
+ break;
+ /*
+ * locate next point of change
+ */
+ for (i = 0; i < bandno; i++)
+ if (!(mask & band[i].mask)) {
+ if (band[i].a0 == q0) {
+ if (band[i].a1 < q1)
+ q1 = band[i].a1;
+ mask |= band[i].mask;
+ } else if (band[i].a0 < q1)
+ q1 = band[i].a0;
+ }
+ /*
+ * create a new sweep
+ */
+ sweep[sweepno].a0 = q0;
+ sweep[sweepno].a1 = q1;
+ sweep[sweepno].mask = mask;
+ sweepno++;
+ /*
+ * subtract the sweep from the affected bands
+ */
+ for (i = 0; i < bandno; i++)
+ if (band[i].a0 == q0) {
+ band[i].a0 = q1;
+ /*
+ * check if this band is empty
+ */
+ if (band[i].a0 == band[i].a1)
+ band[i].a1 = band[i].a0 = 90 * 64 + 1;
+ }
+ }
+ computeAcc (tarc, l, &def, &acc);
+ for (j = 0; j < sweepno; j++) {
+ mask = sweep[j].mask;
+ passRight = passLeft = 0;
+ if (mask & (1 << rightq)) {
+ if (sweep[j].a0 == righta)
+ passRight = right;
+ else if (sweep[j].a1 == righta) {
+ passLeft = right;
+ flipRight = 1;
+ }
+ }
+ if (mask & (1 << leftq)) {
+ if (sweep[j].a1 == lefta)
+ {
+ if (passLeft)
+ copyEnd = 1;
+ passLeft = left;
+ }
+ else if (sweep[j].a0 == lefta) {
+ if (passRight)
+ copyEnd = 1;
+ passRight = left;
+ flipLeft = 1;
+ }
+ }
+ drawQuadrant (&def, &acc, sweep[j].a0, sweep[j].a1, mask,
+ passRight, passLeft, spdata);
+ }
+ /*
+ * when copyEnd is set, both ends of the arc were computed
+ * at the same time; drawQuadrant only takes one end though,
+ * so the left end will be the only one holding the data. Copy
+ * it from there.
+ */
+ if (copyEnd)
+ *right = *left;
+ /*
+ * mirror the coordinates generated for the
+ * faces of the arc
+ */
+ if (right) {
+ mirrorSppPoint (rightq, &right->clock);
+ mirrorSppPoint (rightq, &right->center);
+ mirrorSppPoint (rightq, &right->counterClock);
+ if (flipRight) {
+ SppPointRec temp;
+
+ temp = right->clock;
+ right->clock = right->counterClock;
+ right->counterClock = temp;
+ }
+ }
+ if (left) {
+ mirrorSppPoint (leftq, &left->counterClock);
+ mirrorSppPoint (leftq, &left->center);
+ mirrorSppPoint (leftq, &left->clock);
+ if (flipLeft) {
+ SppPointRec temp;
+
+ temp = left->clock;
+ left->clock = left->counterClock;
+ left->counterClock = temp;
+ }
+ }
+ free(spdata);
+}
+
+static void
+drawQuadrant (
+ struct arc_def *def,
+ struct accelerators *acc,
+ int a0,
+ int a1,
+ int mask,
+ miArcFacePtr right,
+ miArcFacePtr left,
+ miArcSpanData *spdata)
+{
+ struct arc_bound bound;
+ double yy, x, xalt;
+ int y, miny, maxy;
+ int n;
+ miArcSpan *span;
+
+ def->a0 = ((double) a0) / 64.0;
+ def->a1 = ((double) a1) / 64.0;
+ computeBound (def, &bound, acc, right, left);
+ yy = bound.inner.min;
+ if (bound.outer.min < yy)
+ yy = bound.outer.min;
+ miny = ICEIL(yy - acc->fromIntY);
+ yy = bound.inner.max;
+ if (bound.outer.max > yy)
+ yy = bound.outer.max;
+ maxy = floor(yy - acc->fromIntY);
+ y = spdata->k;
+ span = spdata->spans;
+ if (spdata->top)
+ {
+ if (a1 == 90 * 64 && (mask & 1))
+ newFinalSpan (acc->yorgu - y - 1, acc->xorg, acc->xorg + 1);
+ span++;
+ }
+ for (n = spdata->count1; --n >= 0; )
+ {
+ if (y < miny)
+ return;
+ if (y <= maxy) {
+ arcSpan (y,
+ span->lx, -span->lx, 0, span->lx + span->lw,
+ def, &bound, acc, mask);
+ if (span->rw + span->rx)
+ tailSpan (y, -span->rw, -span->rx, def, &bound, acc, mask);
+ }
+ y--;
+ span++;
+ }
+ if (y < miny)
+ return;
+ if (spdata->hole)
+ {
+ if (y <= maxy)
+ arcSpan (y, 0, 0, 0, 1, def, &bound, acc, mask & 0xc);
+ }
+ for (n = spdata->count2; --n >= 0; )
+ {
+ if (y < miny)
+ return;
+ if (y <= maxy)
+ arcSpan (y, span->lx, span->lw, span->rx, span->rw,
+ def, &bound, acc, mask);
+ y--;
+ span++;
+ }
+ if (spdata->bot && miny <= y && y <= maxy)
+ {
+ n = mask;
+ if (y == miny)
+ n &= 0xc;
+ if (span->rw <= 0) {
+ arcSpan0 (span->lx, -span->lx, 0, span->lx + span->lw,
+ def, &bound, acc, n);
+ if (span->rw + span->rx)
+ tailSpan (y, -span->rw, -span->rx, def, &bound, acc, n);
+ }
+ else
+ arcSpan0 (span->lx, span->lw, span->rx, span->rw,
+ def, &bound, acc, n);
+ y--;
+ }
+ while (y >= miny) {
+ yy = y + acc->fromIntY;
+ if (def->w == def->h) {
+ xalt = def->w - def->l;
+ x = -sqrt(xalt * xalt - yy * yy);
+ } else {
+ x = tailX(yy, def, &bound, acc);
+ if (acc->left.valid && boundedLe (yy, bound.left)) {
+ xalt = intersectLine (yy, acc->left);
+ if (xalt < x)
+ x = xalt;
+ }
+ if (acc->right.valid && boundedLe (yy, bound.right)) {
+ xalt = intersectLine (yy, acc->right);
+ if (xalt < x)
+ x = xalt;
+ }
+ }
+ arcSpan (y,
+ ICEIL(acc->fromIntX - x), 0,
+ ICEIL(acc->fromIntX + x), 0,
+ def, &bound, acc, mask);
+ y--;
+ }
+}
diff --git a/xorg-server/mi/mifpoly.h b/xorg-server/mi/mifpoly.h
index ffd19a341..cc779c946 100644
--- a/xorg-server/mi/mifpoly.h
+++ b/xorg-server/mi/mifpoly.h
@@ -51,12 +51,12 @@ SOFTWARE.
#include <X11/Xfuncproto.h>
#define EPSILON 0.000001
-#define ISEQUAL(a,b) (Fabs((a) - (b)) <= EPSILON)
-#define UNEQUAL(a,b) (Fabs((a) - (b)) > EPSILON)
+#define ISEQUAL(a,b) (fabs((a) - (b)) <= EPSILON)
+#define UNEQUAL(a,b) (fabs((a) - (b)) > EPSILON)
#define WITHINHALF(a, b) (((a) - (b) > 0.0) ? (a) - (b) < 0.5 : \
(b) - (a) <= 0.5)
#define ROUNDTOINT(x) ((int) (((x) > 0.0) ? ((x) + 0.5) : ((x) - 0.5)))
-#define ISZERO(x) (Fabs((x)) <= EPSILON)
+#define ISZERO(x) (fabs((x)) <= EPSILON)
#define PTISEQUAL(a,b) (ISEQUAL(a.x,b.x) && ISEQUAL(a.y,b.y))
#define PTUNEQUAL(a,b) (UNEQUAL(a.x,b.x) || UNEQUAL(a.y,b.y))
#define PtEqual(a, b) (((a).x == (b).x) && ((a).y == (b).y))
diff --git a/xorg-server/mi/miwideline.c b/xorg-server/mi/miwideline.c
index 2d27dd7dc..122566f38 100644
--- a/xorg-server/mi/miwideline.c
+++ b/xorg-server/mi/miwideline.c
@@ -1,2197 +1,2197 @@
-/*
-
-Copyright 1988, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall
-not be used in advertising or otherwise to promote the sale, use or
-other dealings in this Software without prior written authorization
-from The Open Group.
-
-*/
-
-/* Author: Keith Packard, MIT X Consortium */
-
-/*
- * Mostly integer wideline code. Uses a technique similar to
- * bresenham zero-width lines, except walks an X edge
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include <stdio.h>
-#ifdef _XOPEN_SOURCE
-#include <math.h>
-#else
-#define _XOPEN_SOURCE /* to get prototype for hypot on some systems */
-#include <math.h>
-#undef _XOPEN_SOURCE
-#endif
-#ifdef _MSC_VER
-#define hypot _hypot
-#endif
-
-#include <X11/X.h>
-#include "windowstr.h"
-#include "gcstruct.h"
-#include "regionstr.h"
-#include "miwideline.h"
-#include "mi.h"
-
-static Bool
-InitSpans(Spans *spans, size_t nspans)
-{
- spans->points = malloc(nspans * sizeof (*spans->points));
- if (!spans->points)
- return FALSE;
- spans->widths = malloc(nspans * sizeof (*spans->widths));
- if (!spans->widths)
- {
- free(spans->points);
- return FALSE;
- }
- return TRUE;
-}
-
-/*
- * interface data to span-merging polygon filler
- */
-
-typedef struct _SpanData {
- SpanGroup fgGroup, bgGroup;
-} SpanDataRec, *SpanDataPtr;
-
-static void
-AppendSpanGroup(GCPtr pGC, unsigned long pixel, Spans *spanPtr, SpanDataPtr spanData)
-{
- SpanGroup *group, *othergroup = NULL;
- if (pixel == pGC->fgPixel)
- {
- group = &spanData->fgGroup;
- if (pGC->lineStyle == LineDoubleDash)
- othergroup = &spanData->bgGroup;
- }
- else
- {
- group = &spanData->bgGroup;
- othergroup = &spanData->fgGroup;
- }
- miAppendSpans (group, othergroup, spanPtr);
-}
-
-
-static void miLineArc(DrawablePtr pDraw, GCPtr pGC,
- unsigned long pixel, SpanDataPtr spanData,
- LineFacePtr leftFace,
- LineFacePtr rightFace,
- double xorg, double yorg, Bool isInt);
-
-
-/*
- * spans-based polygon filler
- */
-
-static void
-fillSpans(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, Spans *spans, SpanDataPtr spanData)
-{
- if (!spanData)
- {
- ChangeGCVal oldPixel, tmpPixel;
- oldPixel.val = pGC->fgPixel;
- if (pixel != oldPixel.val)
- {
- tmpPixel.val = (XID)pixel;
- ChangeGC (NullClient, pGC, GCForeground, &tmpPixel);
- ValidateGC (pDrawable, pGC);
- }
- (*pGC->ops->FillSpans) (pDrawable, pGC, spans->count, spans->points, spans->widths, TRUE);
- free(spans->widths);
- free(spans->points);
- if (pixel != oldPixel.val)
- {
- ChangeGC (NullClient, pGC, GCForeground, &oldPixel);
- ValidateGC (pDrawable, pGC);
- }
- }
- else
- AppendSpanGroup (pGC, pixel, spans, spanData);
-}
-
-static void
-miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
- SpanDataPtr spanData, int y, int overall_height,
- PolyEdgePtr left, PolyEdgePtr right,
- int left_count, int right_count)
-{
- int left_x = 0, left_e = 0;
- int left_stepx = 0;
- int left_signdx = 0;
- int left_dy = 0, left_dx = 0;
-
- int right_x = 0, right_e = 0;
- int right_stepx = 0;
- int right_signdx = 0;
- int right_dy = 0, right_dx = 0;
-
- int height = 0;
- int left_height = 0, right_height = 0;
-
- DDXPointPtr ppt;
- int *pwidth;
- int xorg;
- Spans spanRec;
-
- if (!InitSpans(&spanRec, overall_height))
- return;
- ppt = spanRec.points;
- pwidth = spanRec.widths;
-
- xorg = 0;
- if (pGC->miTranslate)
- {
- y += pDrawable->y;
- xorg = pDrawable->x;
- }
- while ((left_count || left_height) &&
- (right_count || right_height))
- {
- if (!left_height && left_count)
- {
- left_height = left->height;
- left_x = left->x;
- left_stepx = left->stepx;
- left_signdx = left->signdx;
- left_e = left->e;
- left_dy = left->dy;
- left_dx = left->dx;
- --left_count;
- ++left;
- }
-
- if (!right_height && right_count)
- {
- right_height = right->height;
- right_x = right->x;
- right_stepx = right->stepx;
- right_signdx = right->signdx;
- right_e = right->e;
- right_dy = right->dy;
- right_dx = right->dx;
- --right_count;
- ++right;
- }
-
- height = left_height;
- if (height > right_height)
- height = right_height;
-
- left_height -= height;
- right_height -= height;
-
- while (--height >= 0)
- {
- if (right_x >= left_x)
- {
- ppt->y = y;
- ppt->x = left_x + xorg;
- ppt++;
- *pwidth++ = right_x - left_x + 1;
- }
- y++;
-
- left_x += left_stepx;
- left_e += left_dx;
- if (left_e > 0)
- {
- left_x += left_signdx;
- left_e -= left_dy;
- }
-
- right_x += right_stepx;
- right_e += right_dx;
- if (right_e > 0)
- {
- right_x += right_signdx;
- right_e -= right_dy;
- }
- }
- }
- spanRec.count = ppt - spanRec.points;
- fillSpans (pDrawable, pGC, pixel, &spanRec, spanData);
-}
-
-static void
-miFillRectPolyHelper (
- DrawablePtr pDrawable,
- GCPtr pGC,
- unsigned long pixel,
- SpanDataPtr spanData,
- int x,
- int y,
- int w,
- int h)
-{
- DDXPointPtr ppt;
- int *pwidth;
- ChangeGCVal oldPixel, tmpPixel;
- Spans spanRec;
- xRectangle rect;
-
- if (!spanData)
- {
- rect.x = x;
- rect.y = y;
- rect.width = w;
- rect.height = h;
- oldPixel.val = pGC->fgPixel;
- if (pixel != oldPixel.val)
- {
- tmpPixel.val = (XID)pixel;
- ChangeGC (NullClient, pGC, GCForeground, &tmpPixel);
- ValidateGC (pDrawable, pGC);
- }
- (*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &rect);
- if (pixel != oldPixel.val)
- {
- ChangeGC (NullClient, pGC, GCForeground, &oldPixel);
- ValidateGC (pDrawable, pGC);
- }
- }
- else
- {
- if (!InitSpans(&spanRec, h))
- return;
- ppt = spanRec.points;
- pwidth = spanRec.widths;
-
- if (pGC->miTranslate)
- {
- y += pDrawable->y;
- x += pDrawable->x;
- }
- while (h--)
- {
- ppt->x = x;
- ppt->y = y;
- ppt++;
- *pwidth++ = w;
- y++;
- }
- spanRec.count = ppt - spanRec.points;
- AppendSpanGroup (pGC, pixel, &spanRec, spanData);
- }
-}
-
-/* static */ int
-miPolyBuildEdge (
- double x0,
- double y0,
- double k, /* x0 * dy - y0 * dx */
- int dx,
- int dy,
- int xi,
- int yi,
- int left,
- PolyEdgePtr edge)
-{
- int x, y, e;
- int xady;
-
- if (dy < 0)
- {
- dy = -dy;
- dx = -dx;
- k = -k;
- }
-
-#ifdef NOTDEF
- {
- double realk, kerror;
- realk = x0 * dy - y0 * dx;
- kerror = Fabs (realk - k);
- if (kerror > .1)
- printf ("realk: %g k: %g\n", realk, k);
- }
-#endif
- y = ICEIL (y0);
- xady = ICEIL (k) + y * dx;
-
- if (xady <= 0)
- x = - (-xady / dy) - 1;
- else
- x = (xady - 1) / dy;
-
- e = xady - x * dy;
-
- if (dx >= 0)
- {
- edge->signdx = 1;
- edge->stepx = dx / dy;
- edge->dx = dx % dy;
- }
- else
- {
- edge->signdx = -1;
- edge->stepx = - (-dx / dy);
- edge->dx = -dx % dy;
- e = dy - e + 1;
- }
- edge->dy = dy;
- edge->x = x + left + xi;
- edge->e = e - dy; /* bias to compare against 0 instead of dy */
- return y + yi;
-}
-
-#define StepAround(v, incr, max) (((v) + (incr) < 0) ? (max - 1) : ((v) + (incr) == max) ? 0 : ((v) + (incr)))
-
-/* static */ int
-miPolyBuildPoly (
- PolyVertexPtr vertices,
- PolySlopePtr slopes,
- int count,
- int xi,
- int yi,
- PolyEdgePtr left,
- PolyEdgePtr right,
- int *pnleft,
- int *pnright,
- int *h)
-{
- int top, bottom;
- double miny, maxy;
- int i;
- int j;
- int clockwise;
- int slopeoff;
- int s;
- int nright, nleft;
- int y, lasty = 0, bottomy, topy = 0;
-
- /* find the top of the polygon */
- maxy = miny = vertices[0].y;
- bottom = top = 0;
- for (i = 1; i < count; i++)
- {
- if (vertices[i].y < miny)
- {
- top = i;
- miny = vertices[i].y;
- }
- if (vertices[i].y >= maxy)
- {
- bottom = i;
- maxy = vertices[i].y;
- }
- }
- clockwise = 1;
- slopeoff = 0;
-
- i = top;
- j = StepAround (top, -1, count);
-
- if ((int64_t)slopes[j].dy * slopes[i].dx > (int64_t)slopes[i].dy * slopes[j].dx)
- {
- clockwise = -1;
- slopeoff = -1;
- }
-
- bottomy = ICEIL (maxy) + yi;
-
- nright = 0;
-
- s = StepAround (top, slopeoff, count);
- i = top;
- while (i != bottom)
- {
- if (slopes[s].dy != 0)
- {
- y = miPolyBuildEdge (vertices[i].x, vertices[i].y,
- slopes[s].k,
- slopes[s].dx, slopes[s].dy,
- xi, yi, 0,
- &right[nright]);
- if (nright != 0)
- right[nright-1].height = y - lasty;
- else
- topy = y;
- nright++;
- lasty = y;
- }
-
- i = StepAround (i, clockwise, count);
- s = StepAround (s, clockwise, count);
- }
- if (nright != 0)
- right[nright-1].height = bottomy - lasty;
-
- if (slopeoff == 0)
- slopeoff = -1;
- else
- slopeoff = 0;
-
- nleft = 0;
- s = StepAround (top, slopeoff, count);
- i = top;
- while (i != bottom)
- {
- if (slopes[s].dy != 0)
- {
- y = miPolyBuildEdge (vertices[i].x, vertices[i].y,
- slopes[s].k,
- slopes[s].dx, slopes[s].dy, xi, yi, 1,
- &left[nleft]);
-
- if (nleft != 0)
- left[nleft-1].height = y - lasty;
- nleft++;
- lasty = y;
- }
- i = StepAround (i, -clockwise, count);
- s = StepAround (s, -clockwise, count);
- }
- if (nleft != 0)
- left[nleft-1].height = bottomy - lasty;
- *pnleft = nleft;
- *pnright = nright;
- *h = bottomy - topy;
- return topy;
-}
-
-static void
-miLineOnePoint (
- DrawablePtr pDrawable,
- GCPtr pGC,
- unsigned long pixel,
- SpanDataPtr spanData,
- int x,
- int y)
-{
- DDXPointRec pt;
- int wid;
- unsigned long oldPixel;
-
- MILINESETPIXEL (pDrawable, pGC, pixel, oldPixel);
- if (pGC->fillStyle == FillSolid)
- {
- pt.x = x;
- pt.y = y;
- (*pGC->ops->PolyPoint) (pDrawable, pGC, CoordModeOrigin, 1, &pt);
- }
- else
- {
- wid = 1;
- if (pGC->miTranslate)
- {
- x += pDrawable->x;
- y += pDrawable->y;
- }
- pt.x = x;
- pt.y = y;
- (*pGC->ops->FillSpans) (pDrawable, pGC, 1, &pt, &wid, TRUE);
- }
- MILINERESETPIXEL (pDrawable, pGC, pixel, oldPixel);
-}
-
-static void
-miLineJoin (
- DrawablePtr pDrawable,
- GCPtr pGC,
- unsigned long pixel,
- SpanDataPtr spanData,
- LineFacePtr pLeft,
- LineFacePtr pRight)
-{
- double mx = 0, my = 0;
- double denom = 0.0;
- PolyVertexRec vertices[4];
- PolySlopeRec slopes[4];
- int edgecount;
- PolyEdgeRec left[4], right[4];
- int nleft, nright;
- int y, height;
- int swapslopes;
- int joinStyle = pGC->joinStyle;
- int lw = pGC->lineWidth;
-
- if (lw == 1 && !spanData) {
- /* See if one of the lines will draw the joining pixel */
- if (pLeft->dx > 0 || (pLeft->dx == 0 && pLeft->dy > 0))
- return;
- if (pRight->dx > 0 || (pRight->dx == 0 && pRight->dy > 0))
- return;
- if (joinStyle != JoinRound) {
- denom = - pLeft->dx * (double)pRight->dy + pRight->dx * (double)pLeft->dy;
- if (denom == 0)
- return; /* no join to draw */
- }
- if (joinStyle != JoinMiter) {
- miLineOnePoint (pDrawable, pGC, pixel, spanData, pLeft->x, pLeft->y);
- return;
- }
- } else {
- if (joinStyle == JoinRound)
- {
- miLineArc(pDrawable, pGC, pixel, spanData,
- pLeft, pRight,
- (double)0.0, (double)0.0, TRUE);
- return;
- }
- denom = - pLeft->dx * (double)pRight->dy + pRight->dx * (double)pLeft->dy;
- if (denom == 0.0)
- return; /* no join to draw */
- }
-
- swapslopes = 0;
- if (denom > 0)
- {
- pLeft->xa = -pLeft->xa;
- pLeft->ya = -pLeft->ya;
- pLeft->dx = -pLeft->dx;
- pLeft->dy = -pLeft->dy;
- }
- else
- {
- swapslopes = 1;
- pRight->xa = -pRight->xa;
- pRight->ya = -pRight->ya;
- pRight->dx = -pRight->dx;
- pRight->dy = -pRight->dy;
- }
-
- vertices[0].x = pRight->xa;
- vertices[0].y = pRight->ya;
- slopes[0].dx = -pRight->dy;
- slopes[0].dy = pRight->dx;
- slopes[0].k = 0;
-
- vertices[1].x = 0;
- vertices[1].y = 0;
- slopes[1].dx = pLeft->dy;
- slopes[1].dy = -pLeft->dx;
- slopes[1].k = 0;
-
- vertices[2].x = pLeft->xa;
- vertices[2].y = pLeft->ya;
-
- if (joinStyle == JoinMiter)
- {
- my = (pLeft->dy * (pRight->xa * pRight->dy - pRight->ya * pRight->dx) -
- pRight->dy * (pLeft->xa * pLeft->dy - pLeft->ya * pLeft->dx )) /
- denom;
- if (pLeft->dy != 0)
- {
- mx = pLeft->xa + (my - pLeft->ya) *
- (double) pLeft->dx / (double) pLeft->dy;
- }
- else
- {
- mx = pRight->xa + (my - pRight->ya) *
- (double) pRight->dx / (double) pRight->dy;
- }
- /* check miter limit */
- if ((mx * mx + my * my) * 4 > SQSECANT * lw * lw)
- joinStyle = JoinBevel;
- }
-
- if (joinStyle == JoinMiter)
- {
- slopes[2].dx = pLeft->dx;
- slopes[2].dy = pLeft->dy;
- slopes[2].k = pLeft->k;
- if (swapslopes)
- {
- slopes[2].dx = -slopes[2].dx;
- slopes[2].dy = -slopes[2].dy;
- slopes[2].k = -slopes[2].k;
- }
- vertices[3].x = mx;
- vertices[3].y = my;
- slopes[3].dx = pRight->dx;
- slopes[3].dy = pRight->dy;
- slopes[3].k = pRight->k;
- if (swapslopes)
- {
- slopes[3].dx = -slopes[3].dx;
- slopes[3].dy = -slopes[3].dy;
- slopes[3].k = -slopes[3].k;
- }
- edgecount = 4;
- }
- else
- {
- double scale, dx, dy, adx, ady;
-
- adx = dx = pRight->xa - pLeft->xa;
- ady = dy = pRight->ya - pLeft->ya;
- if (adx < 0)
- adx = -adx;
- if (ady < 0)
- ady = -ady;
- scale = ady;
- if (adx > ady)
- scale = adx;
- slopes[2].dx = (dx * 65536) / scale;
- slopes[2].dy = (dy * 65536) / scale;
- slopes[2].k = ((pLeft->xa + pRight->xa) * slopes[2].dy -
- (pLeft->ya + pRight->ya) * slopes[2].dx) / 2.0;
- edgecount = 3;
- }
-
- y = miPolyBuildPoly (vertices, slopes, edgecount, pLeft->x, pLeft->y,
- left, right, &nleft, &nright, &height);
- miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, height, left, right, nleft, nright);
-}
-
-static int
-miLineArcI (
- DrawablePtr pDraw,
- GCPtr pGC,
- int xorg,
- int yorg,
- DDXPointPtr points,
- int *widths)
-{
- DDXPointPtr tpts, bpts;
- int *twids, *bwids;
- int x, y, e, ex, slw;
-
- tpts = points;
- twids = widths;
- if (pGC->miTranslate)
- {
- xorg += pDraw->x;
- yorg += pDraw->y;
- }
- slw = pGC->lineWidth;
- if (slw == 1)
- {
- tpts->x = xorg;
- tpts->y = yorg;
- *twids = 1;
- return 1;
- }
- bpts = tpts + slw;
- bwids = twids + slw;
- y = (slw >> 1) + 1;
- if (slw & 1)
- e = - ((y << 2) + 3);
- else
- e = - (y << 3);
- ex = -4;
- x = 0;
- while (y)
- {
- e += (y << 3) - 4;
- while (e >= 0)
- {
- x++;
- e += (ex = -((x << 3) + 4));
- }
- y--;
- slw = (x << 1) + 1;
- if ((e == ex) && (slw > 1))
- slw--;
- tpts->x = xorg - x;
- tpts->y = yorg - y;
- tpts++;
- *twids++ = slw;
- if ((y != 0) && ((slw > 1) || (e != ex)))
- {
- bpts--;
- bpts->x = xorg - x;
- bpts->y = yorg + y;
- *--bwids = slw;
- }
- }
- return pGC->lineWidth;
-}
-
-#define CLIPSTEPEDGE(edgey,edge,edgeleft) \
- if (ybase == edgey) \
- { \
- if (edgeleft) \
- { \
- if (edge->x > xcl) \
- xcl = edge->x; \
- } \
- else \
- { \
- if (edge->x < xcr) \
- xcr = edge->x; \
- } \
- edgey++; \
- edge->x += edge->stepx; \
- edge->e += edge->dx; \
- if (edge->e > 0) \
- { \
- edge->x += edge->signdx; \
- edge->e -= edge->dy; \
- } \
- }
-
-static int
-miLineArcD (
- DrawablePtr pDraw,
- GCPtr pGC,
- double xorg,
- double yorg,
- DDXPointPtr points,
- int *widths,
- PolyEdgePtr edge1,
- int edgey1,
- Bool edgeleft1,
- PolyEdgePtr edge2,
- int edgey2,
- Bool edgeleft2)
-{
- DDXPointPtr pts;
- int *wids;
- double radius, x0, y0, el, er, yk, xlk, xrk, k;
- int xbase, ybase, y, boty, xl, xr, xcl, xcr;
- int ymin, ymax;
- Bool edge1IsMin, edge2IsMin;
- int ymin1, ymin2;
-
- pts = points;
- wids = widths;
- xbase = floor(xorg);
- x0 = xorg - xbase;
- ybase = ICEIL (yorg);
- y0 = yorg - ybase;
- if (pGC->miTranslate)
- {
- xbase += pDraw->x;
- ybase += pDraw->y;
- edge1->x += pDraw->x;
- edge2->x += pDraw->x;
- edgey1 += pDraw->y;
- edgey2 += pDraw->y;
- }
- xlk = x0 + x0 + 1.0;
- xrk = x0 + x0 - 1.0;
- yk = y0 + y0 - 1.0;
- radius = ((double)pGC->lineWidth) / 2.0;
- y = floor(radius - y0 + 1.0);
- ybase -= y;
- ymin = ybase;
- ymax = 65536;
- edge1IsMin = FALSE;
- ymin1 = edgey1;
- if (edge1->dy >= 0)
- {
- if (!edge1->dy)
- {
- if (edgeleft1)
- edge1IsMin = TRUE;
- else
- ymax = edgey1;
- edgey1 = 65536;
- }
- else
- {
- if ((edge1->signdx < 0) == edgeleft1)
- edge1IsMin = TRUE;
- }
- }
- edge2IsMin = FALSE;
- ymin2 = edgey2;
- if (edge2->dy >= 0)
- {
- if (!edge2->dy)
- {
- if (edgeleft2)
- edge2IsMin = TRUE;
- else
- ymax = edgey2;
- edgey2 = 65536;
- }
- else
- {
- if ((edge2->signdx < 0) == edgeleft2)
- edge2IsMin = TRUE;
- }
- }
- if (edge1IsMin)
- {
- ymin = ymin1;
- if (edge2IsMin && ymin1 > ymin2)
- ymin = ymin2;
- } else if (edge2IsMin)
- ymin = ymin2;
- el = radius * radius - ((y + y0) * (y + y0)) - (x0 * x0);
- er = el + xrk;
- xl = 1;
- xr = 0;
- if (x0 < 0.5)
- {
- xl = 0;
- el -= xlk;
- }
- boty = (y0 < -0.5) ? 1 : 0;
- if (ybase + y - boty > ymax)
- boty = ymax - ybase - y;
- while (y > boty)
- {
- k = (y << 1) + yk;
- er += k;
- while (er > 0.0)
- {
- xr++;
- er += xrk - (xr << 1);
- }
- el += k;
- while (el >= 0.0)
- {
- xl--;
- el += (xl << 1) - xlk;
- }
- y--;
- ybase++;
- if (ybase < ymin)
- continue;
- xcl = xl + xbase;
- xcr = xr + xbase;
- CLIPSTEPEDGE(edgey1, edge1, edgeleft1);
- CLIPSTEPEDGE(edgey2, edge2, edgeleft2);
- if (xcr >= xcl)
- {
- pts->x = xcl;
- pts->y = ybase;
- pts++;
- *wids++ = xcr - xcl + 1;
- }
- }
- er = xrk - (xr << 1) - er;
- el = (xl << 1) - xlk - el;
- boty = floor(-y0 - radius + 1.0);
- if (ybase + y - boty > ymax)
- boty = ymax - ybase - y;
- while (y > boty)
- {
- k = (y << 1) + yk;
- er -= k;
- while ((er >= 0.0) && (xr >= 0))
- {
- xr--;
- er += xrk - (xr << 1);
- }
- el -= k;
- while ((el > 0.0) && (xl <= 0))
- {
- xl++;
- el += (xl << 1) - xlk;
- }
- y--;
- ybase++;
- if (ybase < ymin)
- continue;
- xcl = xl + xbase;
- xcr = xr + xbase;
- CLIPSTEPEDGE(edgey1, edge1, edgeleft1);
- CLIPSTEPEDGE(edgey2, edge2, edgeleft2);
- if (xcr >= xcl)
- {
- pts->x = xcl;
- pts->y = ybase;
- pts++;
- *wids++ = xcr - xcl + 1;
- }
- }
- return pts - points;
-}
-
-static int
-miRoundJoinFace (LineFacePtr face, PolyEdgePtr edge, Bool *leftEdge)
-{
- int y;
- int dx, dy;
- double xa, ya;
- Bool left;
-
- dx = -face->dy;
- dy = face->dx;
- xa = face->xa;
- ya = face->ya;
- left = 1;
- if (ya > 0)
- {
- ya = 0.0;
- xa = 0.0;
- }
- if (dy < 0 || (dy == 0 && dx > 0))
- {
- dx = -dx;
- dy = -dy;
- left = !left;
- }
- if (dx == 0 && dy == 0)
- dy = 1;
- if (dy == 0)
- {
- y = ICEIL (face->ya) + face->y;
- edge->x = -32767;
- edge->stepx = 0;
- edge->signdx = 0;
- edge->e = -1;
- edge->dy = 0;
- edge->dx = 0;
- edge->height = 0;
- }
- else
- {
- y = miPolyBuildEdge (xa, ya, 0.0, dx, dy, face->x, face->y, !left, edge);
- edge->height = 32767;
- }
- *leftEdge = !left;
- return y;
-}
-
-void
-miRoundJoinClip (LineFacePtr pLeft, LineFacePtr pRight,
- PolyEdgePtr edge1, PolyEdgePtr edge2,
- int *y1, int *y2, Bool *left1, Bool *left2)
-{
- double denom;
-
- denom = - pLeft->dx * (double)pRight->dy + pRight->dx * (double)pLeft->dy;
-
- if (denom >= 0)
- {
- pLeft->xa = -pLeft->xa;
- pLeft->ya = -pLeft->ya;
- }
- else
- {
- pRight->xa = -pRight->xa;
- pRight->ya = -pRight->ya;
- }
- *y1 = miRoundJoinFace (pLeft, edge1, left1);
- *y2 = miRoundJoinFace (pRight, edge2, left2);
-}
-
-int
-miRoundCapClip (LineFacePtr face, Bool isInt, PolyEdgePtr edge, Bool *leftEdge)
-{
- int y;
- int dx, dy;
- double xa, ya, k;
- Bool left;
-
- dx = -face->dy;
- dy = face->dx;
- xa = face->xa;
- ya = face->ya;
- k = 0.0;
- if (!isInt)
- k = face->k;
- left = 1;
- if (dy < 0 || (dy == 0 && dx > 0))
- {
- dx = -dx;
- dy = -dy;
- xa = -xa;
- ya = -ya;
- left = !left;
- }
- if (dx == 0 && dy == 0)
- dy = 1;
- if (dy == 0)
- {
- y = ICEIL (face->ya) + face->y;
- edge->x = -32767;
- edge->stepx = 0;
- edge->signdx = 0;
- edge->e = -1;
- edge->dy = 0;
- edge->dx = 0;
- edge->height = 0;
- }
- else
- {
- y = miPolyBuildEdge (xa, ya, k, dx, dy, face->x, face->y, !left, edge);
- edge->height = 32767;
- }
- *leftEdge = !left;
- return y;
-}
-
-static void
-miLineArc (
- DrawablePtr pDraw,
- GCPtr pGC,
- unsigned long pixel,
- SpanDataPtr spanData,
- LineFacePtr leftFace,
- LineFacePtr rightFace,
- double xorg,
- double yorg,
- Bool isInt)
-{
- int xorgi = 0, yorgi = 0;
- Spans spanRec;
- int n;
- PolyEdgeRec edge1, edge2;
- int edgey1, edgey2;
- Bool edgeleft1, edgeleft2;
-
- if (isInt)
- {
- xorgi = leftFace ? leftFace->x : rightFace->x;
- yorgi = leftFace ? leftFace->y : rightFace->y;
- }
- edgey1 = 65536;
- edgey2 = 65536;
- edge1.x = 0; /* not used, keep memory checkers happy */
- edge1.dy = -1;
- edge2.x = 0; /* not used, keep memory checkers happy */
- edge2.dy = -1;
- edgeleft1 = FALSE;
- edgeleft2 = FALSE;
- if ((pGC->lineStyle != LineSolid || pGC->lineWidth > 2) &&
- ((pGC->capStyle == CapRound && pGC->joinStyle != JoinRound) ||
- (pGC->joinStyle == JoinRound && pGC->capStyle == CapButt)))
- {
- if (isInt)
- {
- xorg = (double) xorgi;
- yorg = (double) yorgi;
- }
- if (leftFace && rightFace)
- {
- miRoundJoinClip (leftFace, rightFace, &edge1, &edge2,
- &edgey1, &edgey2, &edgeleft1, &edgeleft2);
- }
- else if (leftFace)
- {
- edgey1 = miRoundCapClip (leftFace, isInt, &edge1, &edgeleft1);
- }
- else if (rightFace)
- {
- edgey2 = miRoundCapClip (rightFace, isInt, &edge2, &edgeleft2);
- }
- isInt = FALSE;
- }
- if (!InitSpans(&spanRec, pGC->lineWidth))
- return;
- if (isInt)
- n = miLineArcI(pDraw, pGC, xorgi, yorgi, spanRec.points, spanRec.widths);
- else
- n = miLineArcD(pDraw, pGC, xorg, yorg, spanRec.points, spanRec.widths,
- &edge1, edgey1, edgeleft1,
- &edge2, edgey2, edgeleft2);
- spanRec.count = n;
- fillSpans (pDraw, pGC, pixel, &spanRec, spanData);
-}
-
-static void
-miLineProjectingCap (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
- SpanDataPtr spanData, LineFacePtr face, Bool isLeft,
- double xorg, double yorg, Bool isInt)
-{
- int xorgi = 0, yorgi = 0;
- int lw;
- PolyEdgeRec lefts[2], rights[2];
- int lefty, righty, topy, bottomy;
- PolyEdgePtr left, right;
- PolyEdgePtr top, bottom;
- double xa,ya;
- double k;
- double xap, yap;
- int dx, dy;
- double projectXoff, projectYoff;
- double maxy;
- int finaly;
-
- if (isInt)
- {
- xorgi = face->x;
- yorgi = face->y;
- }
- lw = pGC->lineWidth;
- dx = face->dx;
- dy = face->dy;
- k = face->k;
- if (dy == 0)
- {
- lefts[0].height = lw;
- lefts[0].x = xorgi;
- if (isLeft)
- lefts[0].x -= (lw >> 1);
- lefts[0].stepx = 0;
- lefts[0].signdx = 1;
- lefts[0].e = -lw;
- lefts[0].dx = 0;
- lefts[0].dy = lw;
- rights[0].height = lw;
- rights[0].x = xorgi;
- if (!isLeft)
- rights[0].x += ((lw + 1) >> 1);
- rights[0].stepx = 0;
- rights[0].signdx = 1;
- rights[0].e = -lw;
- rights[0].dx = 0;
- rights[0].dy = lw;
- miFillPolyHelper (pDrawable, pGC, pixel, spanData, yorgi - (lw >> 1), lw,
- lefts, rights, 1, 1);
- }
- else if (dx == 0)
- {
- if (dy < 0) {
- dy = -dy;
- isLeft = !isLeft;
- }
- topy = yorgi;
- bottomy = yorgi + dy;
- if (isLeft)
- topy -= (lw >> 1);
- else
- bottomy += (lw >> 1);
- lefts[0].height = bottomy - topy;
- lefts[0].x = xorgi - (lw >> 1);
- lefts[0].stepx = 0;
- lefts[0].signdx = 1;
- lefts[0].e = -dy;
- lefts[0].dx = dx;
- lefts[0].dy = dy;
-
- rights[0].height = bottomy - topy;
- rights[0].x = lefts[0].x + (lw-1);
- rights[0].stepx = 0;
- rights[0].signdx = 1;
- rights[0].e = -dy;
- rights[0].dx = dx;
- rights[0].dy = dy;
- miFillPolyHelper (pDrawable, pGC, pixel, spanData, topy, bottomy - topy, lefts, rights, 1, 1);
- }
- else
- {
- xa = face->xa;
- ya = face->ya;
- projectXoff = -ya;
- projectYoff = xa;
- if (dx < 0)
- {
- right = &rights[1];
- left = &lefts[0];
- top = &rights[0];
- bottom = &lefts[1];
- }
- else
- {
- right = &rights[0];
- left = &lefts[1];
- top = &lefts[0];
- bottom = &rights[1];
- }
- if (isLeft)
- {
- righty = miPolyBuildEdge (xa, ya,
- k, dx, dy, xorgi, yorgi, 0, right);
-
- xa = -xa;
- ya = -ya;
- k = -k;
- lefty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff,
- k, dx, dy, xorgi, yorgi, 1, left);
- if (dx > 0)
- {
- ya = -ya;
- xa = -xa;
- }
- xap = xa - projectXoff;
- yap = ya - projectYoff;
- topy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy,
- -dy, dx, xorgi, yorgi, dx > 0, top);
- bottomy = miPolyBuildEdge (xa, ya,
- 0.0, -dy, dx, xorgi, yorgi, dx < 0, bottom);
- maxy = -ya;
- }
- else
- {
- righty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff,
- k, dx, dy, xorgi, yorgi, 0, right);
-
- xa = -xa;
- ya = -ya;
- k = -k;
- lefty = miPolyBuildEdge (xa, ya,
- k, dx, dy, xorgi, yorgi, 1, left);
- if (dx > 0)
- {
- ya = -ya;
- xa = -xa;
- }
- xap = xa - projectXoff;
- yap = ya - projectYoff;
- topy = miPolyBuildEdge (xa, ya, 0.0, -dy, dx, xorgi, xorgi, dx > 0, top);
- bottomy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy,
- -dy, dx, xorgi, xorgi, dx < 0, bottom);
- maxy = -ya + projectYoff;
- }
- finaly = ICEIL(maxy) + yorgi;
- if (dx < 0)
- {
- left->height = bottomy - lefty;
- right->height = finaly - righty;
- top->height = righty - topy;
- }
- else
- {
- right->height = bottomy - righty;
- left->height = finaly - lefty;
- top->height = lefty - topy;
- }
- bottom->height = finaly - bottomy;
- miFillPolyHelper (pDrawable, pGC, pixel, spanData, topy,
- bottom->height + bottomy - topy, lefts, rights, 2, 2);
- }
-}
-
-static void
-miWideSegment (
- DrawablePtr pDrawable,
- GCPtr pGC,
- unsigned long pixel,
- SpanDataPtr spanData,
- int x1,
- int y1,
- int x2,
- int y2,
- Bool projectLeft,
- Bool projectRight,
- LineFacePtr leftFace,
- LineFacePtr rightFace)
-{
- double l, L, r;
- double xa, ya;
- double projectXoff = 0.0, projectYoff = 0.0;
- double k;
- double maxy;
- int x, y;
- int dx, dy;
- int finaly;
- PolyEdgePtr left, right;
- PolyEdgePtr top, bottom;
- int lefty, righty, topy, bottomy;
- int signdx;
- PolyEdgeRec lefts[2], rights[2];
- LineFacePtr tface;
- int lw = pGC->lineWidth;
-
- /* draw top-to-bottom always */
- if (y2 < y1 || (y2 == y1 && x2 < x1))
- {
- x = x1;
- x1 = x2;
- x2 = x;
-
- y = y1;
- y1 = y2;
- y2 = y;
-
- x = projectLeft;
- projectLeft = projectRight;
- projectRight = x;
-
- tface = leftFace;
- leftFace = rightFace;
- rightFace = tface;
- }
-
- dy = y2 - y1;
- signdx = 1;
- dx = x2 - x1;
- if (dx < 0)
- signdx = -1;
-
- leftFace->x = x1;
- leftFace->y = y1;
- leftFace->dx = dx;
- leftFace->dy = dy;
-
- rightFace->x = x2;
- rightFace->y = y2;
- rightFace->dx = -dx;
- rightFace->dy = -dy;
-
- if (dy == 0)
- {
- rightFace->xa = 0;
- rightFace->ya = (double) lw / 2.0;
- rightFace->k = -(double) (lw * dx) / 2.0;
- leftFace->xa = 0;
- leftFace->ya = -rightFace->ya;
- leftFace->k = rightFace->k;
- x = x1;
- if (projectLeft)
- x -= (lw >> 1);
- y = y1 - (lw >> 1);
- dx = x2 - x;
- if (projectRight)
- dx += ((lw + 1) >> 1);
- dy = lw;
- miFillRectPolyHelper (pDrawable, pGC, pixel, spanData,
- x, y, dx, dy);
- }
- else if (dx == 0)
- {
- leftFace->xa = (double) lw / 2.0;
- leftFace->ya = 0;
- leftFace->k = (double) (lw * dy) / 2.0;
- rightFace->xa = -leftFace->xa;
- rightFace->ya = 0;
- rightFace->k = leftFace->k;
- y = y1;
- if (projectLeft)
- y -= lw >> 1;
- x = x1 - (lw >> 1);
- dy = y2 - y;
- if (projectRight)
- dy += ((lw + 1) >> 1);
- dx = lw;
- miFillRectPolyHelper (pDrawable, pGC, pixel, spanData,
- x, y, dx, dy);
- }
- else
- {
- l = ((double) lw) / 2.0;
- L = hypot ((double) dx, (double) dy);
-
- if (dx < 0)
- {
- right = &rights[1];
- left = &lefts[0];
- top = &rights[0];
- bottom = &lefts[1];
- }
- else
- {
- right = &rights[0];
- left = &lefts[1];
- top = &lefts[0];
- bottom = &rights[1];
- }
- r = l / L;
-
- /* coord of upper bound at integral y */
- ya = -r * dx;
- xa = r * dy;
-
- if (projectLeft | projectRight)
- {
- projectXoff = -ya;
- projectYoff = xa;
- }
-
- /* xa * dy - ya * dx */
- k = l * L;
-
- leftFace->xa = xa;
- leftFace->ya = ya;
- leftFace->k = k;
- rightFace->xa = -xa;
- rightFace->ya = -ya;
- rightFace->k = k;
-
- if (projectLeft)
- righty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff,
- k, dx, dy, x1, y1, 0, right);
- else
- righty = miPolyBuildEdge (xa, ya,
- k, dx, dy, x1, y1, 0, right);
-
- /* coord of lower bound at integral y */
- ya = -ya;
- xa = -xa;
-
- /* xa * dy - ya * dx */
- k = - k;
-
- if (projectLeft)
- lefty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff,
- k, dx, dy, x1, y1, 1, left);
- else
- lefty = miPolyBuildEdge (xa, ya,
- k, dx, dy, x1, y1, 1, left);
-
- /* coord of top face at integral y */
-
- if (signdx > 0)
- {
- ya = -ya;
- xa = -xa;
- }
-
- if (projectLeft)
- {
- double xap = xa - projectXoff;
- double yap = ya - projectYoff;
- topy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy,
- -dy, dx, x1, y1, dx > 0, top);
- }
- else
- topy = miPolyBuildEdge (xa, ya, 0.0, -dy, dx, x1, y1, dx > 0, top);
-
- /* coord of bottom face at integral y */
-
- if (projectRight)
- {
- double xap = xa + projectXoff;
- double yap = ya + projectYoff;
- bottomy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy,
- -dy, dx, x2, y2, dx < 0, bottom);
- maxy = -ya + projectYoff;
- }
- else
- {
- bottomy = miPolyBuildEdge (xa, ya,
- 0.0, -dy, dx, x2, y2, dx < 0, bottom);
- maxy = -ya;
- }
-
- finaly = ICEIL (maxy) + y2;
-
- if (dx < 0)
- {
- left->height = bottomy - lefty;
- right->height = finaly - righty;
- top->height = righty - topy;
- }
- else
- {
- right->height = bottomy - righty;
- left->height = finaly - lefty;
- top->height = lefty - topy;
- }
- bottom->height = finaly - bottomy;
- miFillPolyHelper (pDrawable, pGC, pixel, spanData, topy,
- bottom->height + bottomy - topy, lefts, rights, 2, 2);
- }
-}
-
-static SpanDataPtr
-miSetupSpanData (GCPtr pGC, SpanDataPtr spanData, int npt)
-{
- if ((npt < 3 && pGC->capStyle != CapRound) || miSpansEasyRop(pGC->alu))
- return (SpanDataPtr) NULL;
- if (pGC->lineStyle == LineDoubleDash)
- miInitSpanGroup (&spanData->bgGroup);
- miInitSpanGroup (&spanData->fgGroup);
- return spanData;
-}
-
-static void
-miCleanupSpanData (DrawablePtr pDrawable, GCPtr pGC, SpanDataPtr spanData)
-{
- if (pGC->lineStyle == LineDoubleDash)
- {
- ChangeGCVal oldPixel, pixel;
- pixel.val = pGC->bgPixel;
- oldPixel.val = pGC->fgPixel;
- if (pixel.val != oldPixel.val)
- {
- ChangeGC (NullClient, pGC, GCForeground, &pixel);
- ValidateGC (pDrawable, pGC);
- }
- miFillUniqueSpanGroup (pDrawable, pGC, &spanData->bgGroup);
- miFreeSpanGroup (&spanData->bgGroup);
- if (pixel.val != oldPixel.val)
- {
- ChangeGC (NullClient, pGC, GCForeground, &oldPixel);
- ValidateGC (pDrawable, pGC);
- }
- }
- miFillUniqueSpanGroup (pDrawable, pGC, &spanData->fgGroup);
- miFreeSpanGroup (&spanData->fgGroup);
-}
-
-void
-miWideLine (DrawablePtr pDrawable, GCPtr pGC,
- int mode, int npt, DDXPointPtr pPts)
-{
- int x1, y1, x2, y2;
- SpanDataRec spanDataRec;
- SpanDataPtr spanData;
- long pixel;
- Bool projectLeft, projectRight;
- LineFaceRec leftFace, rightFace, prevRightFace;
- LineFaceRec firstFace;
- int first;
- Bool somethingDrawn = FALSE;
- Bool selfJoin;
-
- spanData = miSetupSpanData (pGC, &spanDataRec, npt);
- pixel = pGC->fgPixel;
- x2 = pPts->x;
- y2 = pPts->y;
- first = TRUE;
- selfJoin = FALSE;
- if (npt > 1)
- {
- if (mode == CoordModePrevious)
- {
- int nptTmp;
- DDXPointPtr pPtsTmp;
-
- x1 = x2;
- y1 = y2;
- nptTmp = npt;
- pPtsTmp = pPts + 1;
- while (--nptTmp)
- {
- x1 += pPtsTmp->x;
- y1 += pPtsTmp->y;
- ++pPtsTmp;
- }
- if (x2 == x1 && y2 == y1)
- selfJoin = TRUE;
- }
- else if (x2 == pPts[npt-1].x && y2 == pPts[npt-1].y)
- {
- selfJoin = TRUE;
- }
- }
- projectLeft = pGC->capStyle == CapProjecting && !selfJoin;
- projectRight = FALSE;
- while (--npt)
- {
- x1 = x2;
- y1 = y2;
- ++pPts;
- x2 = pPts->x;
- y2 = pPts->y;
- if (mode == CoordModePrevious)
- {
- x2 += x1;
- y2 += y1;
- }
- if (x1 != x2 || y1 != y2)
- {
- somethingDrawn = TRUE;
- if (npt == 1 && pGC->capStyle == CapProjecting && !selfJoin)
- projectRight = TRUE;
- miWideSegment (pDrawable, pGC, pixel, spanData, x1, y1, x2, y2,
- projectLeft, projectRight, &leftFace, &rightFace);
- if (first)
- {
- if (selfJoin)
- firstFace = leftFace;
- else if (pGC->capStyle == CapRound)
- {
- if (pGC->lineWidth == 1 && !spanData)
- miLineOnePoint (pDrawable, pGC, pixel, spanData, x1, y1);
- else
- miLineArc (pDrawable, pGC, pixel, spanData,
- &leftFace, (LineFacePtr) NULL,
- (double)0.0, (double)0.0,
- TRUE);
- }
- }
- else
- {
- miLineJoin (pDrawable, pGC, pixel, spanData, &leftFace,
- &prevRightFace);
- }
- prevRightFace = rightFace;
- first = FALSE;
- projectLeft = FALSE;
- }
- if (npt == 1 && somethingDrawn)
- {
- if (selfJoin)
- miLineJoin (pDrawable, pGC, pixel, spanData, &firstFace,
- &rightFace);
- else if (pGC->capStyle == CapRound)
- {
- if (pGC->lineWidth == 1 && !spanData)
- miLineOnePoint (pDrawable, pGC, pixel, spanData, x2, y2);
- else
- miLineArc (pDrawable, pGC, pixel, spanData,
- (LineFacePtr) NULL, &rightFace,
- (double)0.0, (double)0.0,
- TRUE);
- }
- }
- }
- /* handle crock where all points are coincedent */
- if (!somethingDrawn)
- {
- projectLeft = pGC->capStyle == CapProjecting;
- miWideSegment (pDrawable, pGC, pixel, spanData,
- x2, y2, x2, y2, projectLeft, projectLeft,
- &leftFace, &rightFace);
- if (pGC->capStyle == CapRound)
- {
- miLineArc (pDrawable, pGC, pixel, spanData,
- &leftFace, (LineFacePtr) NULL,
- (double)0.0, (double)0.0,
- TRUE);
- rightFace.dx = -1; /* sleezy hack to make it work */
- miLineArc (pDrawable, pGC, pixel, spanData,
- (LineFacePtr) NULL, &rightFace,
- (double)0.0, (double)0.0,
- TRUE);
- }
- }
- if (spanData)
- miCleanupSpanData (pDrawable, pGC, spanData);
-}
-
-#define V_TOP 0
-#define V_RIGHT 1
-#define V_BOTTOM 2
-#define V_LEFT 3
-
-static void
-miWideDashSegment (
- DrawablePtr pDrawable,
- GCPtr pGC,
- SpanDataPtr spanData,
- int *pDashOffset,
- int *pDashIndex,
- int x1,
- int y1,
- int x2,
- int y2,
- Bool projectLeft,
- Bool projectRight,
- LineFacePtr leftFace,
- LineFacePtr rightFace)
-{
- int dashIndex, dashRemain;
- unsigned char *pDash;
- double L, l;
- double k;
- PolyVertexRec vertices[4];
- PolyVertexRec saveRight, saveBottom;
- PolySlopeRec slopes[4];
- PolyEdgeRec left[2], right[2];
- LineFaceRec lcapFace, rcapFace;
- int nleft, nright;
- int h;
- int y;
- int dy, dx;
- unsigned long pixel;
- double LRemain;
- double r;
- double rdx, rdy;
- double dashDx, dashDy;
- double saveK = 0.0;
- Bool first = TRUE;
- double lcenterx, lcentery, rcenterx = 0.0, rcentery = 0.0;
- unsigned long fgPixel, bgPixel;
-
- dx = x2 - x1;
- dy = y2 - y1;
- dashIndex = *pDashIndex;
- pDash = pGC->dash;
- dashRemain = pDash[dashIndex] - *pDashOffset;
- fgPixel = pGC->fgPixel;
- bgPixel = pGC->bgPixel;
- if (pGC->fillStyle == FillOpaqueStippled ||
- pGC->fillStyle == FillTiled)
- {
- bgPixel = fgPixel;
- }
-
- l = ((double) pGC->lineWidth) / 2.0;
- if (dx == 0)
- {
- L = dy;
- rdx = 0;
- rdy = l;
- if (dy < 0)
- {
- L = -dy;
- rdy = -l;
- }
- }
- else if (dy == 0)
- {
- L = dx;
- rdx = l;
- rdy = 0;
- if (dx < 0)
- {
- L = -dx;
- rdx = -l;
- }
- }
- else
- {
- L = hypot ((double) dx, (double) dy);
- r = l / L;
-
- rdx = r * dx;
- rdy = r * dy;
- }
- k = l * L;
- LRemain = L;
- /* All position comments are relative to a line with dx and dy > 0,
- * but the code does not depend on this */
- /* top */
- slopes[V_TOP].dx = dx;
- slopes[V_TOP].dy = dy;
- slopes[V_TOP].k = k;
- /* right */
- slopes[V_RIGHT].dx = -dy;
- slopes[V_RIGHT].dy = dx;
- slopes[V_RIGHT].k = 0;
- /* bottom */
- slopes[V_BOTTOM].dx = -dx;
- slopes[V_BOTTOM].dy = -dy;
- slopes[V_BOTTOM].k = k;
- /* left */
- slopes[V_LEFT].dx = dy;
- slopes[V_LEFT].dy = -dx;
- slopes[V_LEFT].k = 0;
-
- /* preload the start coordinates */
- vertices[V_RIGHT].x = vertices[V_TOP].x = rdy;
- vertices[V_RIGHT].y = vertices[V_TOP].y = -rdx;
-
- vertices[V_BOTTOM].x = vertices[V_LEFT].x = -rdy;
- vertices[V_BOTTOM].y = vertices[V_LEFT].y = rdx;
-
- if (projectLeft)
- {
- vertices[V_TOP].x -= rdx;
- vertices[V_TOP].y -= rdy;
-
- vertices[V_LEFT].x -= rdx;
- vertices[V_LEFT].y -= rdy;
-
- slopes[V_LEFT].k = rdx * dx + rdy * dy;
- }
-
- lcenterx = x1;
- lcentery = y1;
-
- if (pGC->capStyle == CapRound)
- {
- lcapFace.dx = dx;
- lcapFace.dy = dy;
- lcapFace.x = x1;
- lcapFace.y = y1;
-
- rcapFace.dx = -dx;
- rcapFace.dy = -dy;
- rcapFace.x = x1;
- rcapFace.y = y1;
- }
- while (LRemain > dashRemain)
- {
- dashDx = (dashRemain * dx) / L;
- dashDy = (dashRemain * dy) / L;
-
- rcenterx = lcenterx + dashDx;
- rcentery = lcentery + dashDy;
-
- vertices[V_RIGHT].x += dashDx;
- vertices[V_RIGHT].y += dashDy;
-
- vertices[V_BOTTOM].x += dashDx;
- vertices[V_BOTTOM].y += dashDy;
-
- slopes[V_RIGHT].k = vertices[V_RIGHT].x * dx + vertices[V_RIGHT].y * dy;
-
- if (pGC->lineStyle == LineDoubleDash || !(dashIndex & 1))
- {
- if (pGC->lineStyle == LineOnOffDash &&
- pGC->capStyle == CapProjecting)
- {
- saveRight = vertices[V_RIGHT];
- saveBottom = vertices[V_BOTTOM];
- saveK = slopes[V_RIGHT].k;
-
- if (!first)
- {
- vertices[V_TOP].x -= rdx;
- vertices[V_TOP].y -= rdy;
-
- vertices[V_LEFT].x -= rdx;
- vertices[V_LEFT].y -= rdy;
-
- slopes[V_LEFT].k = vertices[V_LEFT].x *
- slopes[V_LEFT].dy -
- vertices[V_LEFT].y *
- slopes[V_LEFT].dx;
- }
-
- vertices[V_RIGHT].x += rdx;
- vertices[V_RIGHT].y += rdy;
-
- vertices[V_BOTTOM].x += rdx;
- vertices[V_BOTTOM].y += rdy;
-
- slopes[V_RIGHT].k = vertices[V_RIGHT].x *
- slopes[V_RIGHT].dy -
- vertices[V_RIGHT].y *
- slopes[V_RIGHT].dx;
- }
- y = miPolyBuildPoly (vertices, slopes, 4, x1, y1,
- left, right, &nleft, &nright, &h);
- pixel = (dashIndex & 1) ? bgPixel : fgPixel;
- miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, h, left, right, nleft, nright);
-
- if (pGC->lineStyle == LineOnOffDash)
- {
- switch (pGC->capStyle)
- {
- case CapProjecting:
- vertices[V_BOTTOM] = saveBottom;
- vertices[V_RIGHT] = saveRight;
- slopes[V_RIGHT].k = saveK;
- break;
- case CapRound:
- if (!first)
- {
- if (dx < 0)
- {
- lcapFace.xa = -vertices[V_LEFT].x;
- lcapFace.ya = -vertices[V_LEFT].y;
- lcapFace.k = slopes[V_LEFT].k;
- }
- else
- {
- lcapFace.xa = vertices[V_TOP].x;
- lcapFace.ya = vertices[V_TOP].y;
- lcapFace.k = -slopes[V_LEFT].k;
- }
- miLineArc (pDrawable, pGC, pixel, spanData,
- &lcapFace, (LineFacePtr) NULL,
- lcenterx, lcentery, FALSE);
- }
- if (dx < 0)
- {
- rcapFace.xa = vertices[V_BOTTOM].x;
- rcapFace.ya = vertices[V_BOTTOM].y;
- rcapFace.k = slopes[V_RIGHT].k;
- }
- else
- {
- rcapFace.xa = -vertices[V_RIGHT].x;
- rcapFace.ya = -vertices[V_RIGHT].y;
- rcapFace.k = -slopes[V_RIGHT].k;
- }
- miLineArc (pDrawable, pGC, pixel, spanData,
- (LineFacePtr) NULL, &rcapFace,
- rcenterx, rcentery, FALSE);
- break;
- }
- }
- }
- LRemain -= dashRemain;
- ++dashIndex;
- if (dashIndex == pGC->numInDashList)
- dashIndex = 0;
- dashRemain = pDash[dashIndex];
-
- lcenterx = rcenterx;
- lcentery = rcentery;
-
- vertices[V_TOP] = vertices[V_RIGHT];
- vertices[V_LEFT] = vertices[V_BOTTOM];
- slopes[V_LEFT].k = -slopes[V_RIGHT].k;
- first = FALSE;
- }
-
- if (pGC->lineStyle == LineDoubleDash || !(dashIndex & 1))
- {
- vertices[V_TOP].x -= dx;
- vertices[V_TOP].y -= dy;
-
- vertices[V_LEFT].x -= dx;
- vertices[V_LEFT].y -= dy;
-
- vertices[V_RIGHT].x = rdy;
- vertices[V_RIGHT].y = -rdx;
-
- vertices[V_BOTTOM].x = -rdy;
- vertices[V_BOTTOM].y = rdx;
-
-
- if (projectRight)
- {
- vertices[V_RIGHT].x += rdx;
- vertices[V_RIGHT].y += rdy;
-
- vertices[V_BOTTOM].x += rdx;
- vertices[V_BOTTOM].y += rdy;
- slopes[V_RIGHT].k = vertices[V_RIGHT].x *
- slopes[V_RIGHT].dy -
- vertices[V_RIGHT].y *
- slopes[V_RIGHT].dx;
- }
- else
- slopes[V_RIGHT].k = 0;
-
- if (!first && pGC->lineStyle == LineOnOffDash &&
- pGC->capStyle == CapProjecting)
- {
- vertices[V_TOP].x -= rdx;
- vertices[V_TOP].y -= rdy;
-
- vertices[V_LEFT].x -= rdx;
- vertices[V_LEFT].y -= rdy;
- slopes[V_LEFT].k = vertices[V_LEFT].x *
- slopes[V_LEFT].dy -
- vertices[V_LEFT].y *
- slopes[V_LEFT].dx;
- }
- else
- slopes[V_LEFT].k += dx * dx + dy * dy;
-
-
- y = miPolyBuildPoly (vertices, slopes, 4, x2, y2,
- left, right, &nleft, &nright, &h);
-
- pixel = (dashIndex & 1) ? pGC->bgPixel : pGC->fgPixel;
- miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, h, left, right, nleft, nright);
- if (!first && pGC->lineStyle == LineOnOffDash &&
- pGC->capStyle == CapRound)
- {
- lcapFace.x = x2;
- lcapFace.y = y2;
- if (dx < 0)
- {
- lcapFace.xa = -vertices[V_LEFT].x;
- lcapFace.ya = -vertices[V_LEFT].y;
- lcapFace.k = slopes[V_LEFT].k;
- }
- else
- {
- lcapFace.xa = vertices[V_TOP].x;
- lcapFace.ya = vertices[V_TOP].y;
- lcapFace.k = -slopes[V_LEFT].k;
- }
- miLineArc (pDrawable, pGC, pixel, spanData,
- &lcapFace, (LineFacePtr) NULL,
- rcenterx, rcentery, FALSE);
- }
- }
- dashRemain = ((double) dashRemain) - LRemain;
- if (dashRemain == 0)
- {
- dashIndex++;
- if (dashIndex == pGC->numInDashList)
- dashIndex = 0;
- dashRemain = pDash[dashIndex];
- }
-
- leftFace->x = x1;
- leftFace->y = y1;
- leftFace->dx = dx;
- leftFace->dy = dy;
- leftFace->xa = rdy;
- leftFace->ya = -rdx;
- leftFace->k = k;
-
- rightFace->x = x2;
- rightFace->y = y2;
- rightFace->dx = -dx;
- rightFace->dy = -dy;
- rightFace->xa = -rdy;
- rightFace->ya = rdx;
- rightFace->k = k;
-
- *pDashIndex = dashIndex;
- *pDashOffset = pDash[dashIndex] - dashRemain;
-}
-
-void
-miWideDash (DrawablePtr pDrawable, GCPtr pGC,
- int mode, int npt, DDXPointPtr pPts)
-{
- int x1, y1, x2, y2;
- unsigned long pixel;
- Bool projectLeft, projectRight;
- LineFaceRec leftFace, rightFace, prevRightFace;
- LineFaceRec firstFace;
- int first;
- int dashIndex, dashOffset;
- int prevDashIndex;
- SpanDataRec spanDataRec;
- SpanDataPtr spanData;
- Bool somethingDrawn = FALSE;
- Bool selfJoin;
- Bool endIsFg = FALSE, startIsFg = FALSE;
- Bool firstIsFg = FALSE, prevIsFg = FALSE;
-
-#if 0
- /* XXX backward compatibility */
- if (pGC->lineWidth == 0)
- {
- miZeroDashLine (pDrawable, pGC, mode, npt, pPts);
- return;
- }
-#endif
- if (pGC->lineStyle == LineDoubleDash &&
- (pGC->fillStyle == FillOpaqueStippled || pGC->fillStyle == FillTiled))
- {
- miWideLine (pDrawable, pGC, mode, npt, pPts);
- return;
- }
- if (npt == 0)
- return;
- spanData = miSetupSpanData (pGC, &spanDataRec, npt);
- x2 = pPts->x;
- y2 = pPts->y;
- first = TRUE;
- selfJoin = FALSE;
- if (mode == CoordModePrevious)
- {
- int nptTmp;
- DDXPointPtr pPtsTmp;
-
- x1 = x2;
- y1 = y2;
- nptTmp = npt;
- pPtsTmp = pPts + 1;
- while (--nptTmp)
- {
- x1 += pPtsTmp->x;
- y1 += pPtsTmp->y;
- ++pPtsTmp;
- }
- if (x2 == x1 && y2 == y1)
- selfJoin = TRUE;
- }
- else if (x2 == pPts[npt-1].x && y2 == pPts[npt-1].y)
- {
- selfJoin = TRUE;
- }
- projectLeft = pGC->capStyle == CapProjecting && !selfJoin;
- projectRight = FALSE;
- dashIndex = 0;
- dashOffset = 0;
- miStepDash ((int)pGC->dashOffset, &dashIndex,
- pGC->dash, (int)pGC->numInDashList, &dashOffset);
- while (--npt)
- {
- x1 = x2;
- y1 = y2;
- ++pPts;
- x2 = pPts->x;
- y2 = pPts->y;
- if (mode == CoordModePrevious)
- {
- x2 += x1;
- y2 += y1;
- }
- if (x1 != x2 || y1 != y2)
- {
- somethingDrawn = TRUE;
- if (npt == 1 && pGC->capStyle == CapProjecting &&
- (!selfJoin || !firstIsFg))
- projectRight = TRUE;
- prevDashIndex = dashIndex;
- miWideDashSegment (pDrawable, pGC, spanData, &dashOffset, &dashIndex,
- x1, y1, x2, y2,
- projectLeft, projectRight, &leftFace, &rightFace);
- startIsFg = !(prevDashIndex & 1);
- endIsFg = (dashIndex & 1) ^ (dashOffset != 0);
- if (pGC->lineStyle == LineDoubleDash || startIsFg)
- {
- pixel = startIsFg ? pGC->fgPixel : pGC->bgPixel;
- if (first || (pGC->lineStyle == LineOnOffDash && !prevIsFg))
- {
- if (first && selfJoin)
- {
- firstFace = leftFace;
- firstIsFg = startIsFg;
- }
- else if (pGC->capStyle == CapRound)
- miLineArc (pDrawable, pGC, pixel, spanData,
- &leftFace, (LineFacePtr) NULL,
- (double)0.0, (double)0.0, TRUE);
- }
- else
- {
- miLineJoin (pDrawable, pGC, pixel, spanData, &leftFace,
- &prevRightFace);
- }
- }
- prevRightFace = rightFace;
- prevIsFg = endIsFg;
- first = FALSE;
- projectLeft = FALSE;
- }
- if (npt == 1 && somethingDrawn)
- {
- if (pGC->lineStyle == LineDoubleDash || endIsFg)
- {
- pixel = endIsFg ? pGC->fgPixel : pGC->bgPixel;
- if (selfJoin && (pGC->lineStyle == LineDoubleDash || firstIsFg))
- {
- miLineJoin (pDrawable, pGC, pixel, spanData, &firstFace,
- &rightFace);
- }
- else
- {
- if (pGC->capStyle == CapRound)
- miLineArc (pDrawable, pGC, pixel, spanData,
- (LineFacePtr) NULL, &rightFace,
- (double)0.0, (double)0.0, TRUE);
- }
- }
- else
- {
- /* glue a cap to the start of the line if
- * we're OnOffDash and ended on odd dash
- */
- if (selfJoin && firstIsFg)
- {
- pixel = pGC->fgPixel;
- if (pGC->capStyle == CapProjecting)
- miLineProjectingCap (pDrawable, pGC, pixel, spanData,
- &firstFace, TRUE,
- (double)0.0, (double)0.0, TRUE);
- else if (pGC->capStyle == CapRound)
- miLineArc (pDrawable, pGC, pixel, spanData,
- &firstFace, (LineFacePtr) NULL,
- (double)0.0, (double)0.0, TRUE);
- }
- }
- }
- }
- /* handle crock where all points are coincident */
- if (!somethingDrawn && (pGC->lineStyle == LineDoubleDash || !(dashIndex & 1)))
- {
- /* not the same as endIsFg computation above */
- pixel = (dashIndex & 1) ? pGC->bgPixel : pGC->fgPixel;
- switch (pGC->capStyle) {
- case CapRound:
- miLineArc (pDrawable, pGC, pixel, spanData,
- (LineFacePtr) NULL, (LineFacePtr) NULL,
- (double)x2, (double)y2,
- FALSE);
- break;
- case CapProjecting:
- x1 = pGC->lineWidth;
- miFillRectPolyHelper (pDrawable, pGC, pixel, spanData,
- x2 - (x1 >> 1), y2 - (x1 >> 1), x1, x1);
- break;
- }
- }
- if (spanData)
- miCleanupSpanData (pDrawable, pGC, spanData);
-}
+/*
+
+Copyright 1988, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall
+not be used in advertising or otherwise to promote the sale, use or
+other dealings in this Software without prior written authorization
+from The Open Group.
+
+*/
+
+/* Author: Keith Packard, MIT X Consortium */
+
+/*
+ * Mostly integer wideline code. Uses a technique similar to
+ * bresenham zero-width lines, except walks an X edge
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include <stdio.h>
+#ifdef _XOPEN_SOURCE
+#include <math.h>
+#else
+#define _XOPEN_SOURCE /* to get prototype for hypot on some systems */
+#include <math.h>
+#undef _XOPEN_SOURCE
+#endif
+#ifdef _MSC_VER
+#define hypot _hypot
+#endif
+
+#include <X11/X.h>
+#include "windowstr.h"
+#include "gcstruct.h"
+#include "regionstr.h"
+#include "miwideline.h"
+#include "mi.h"
+
+static Bool
+InitSpans(Spans *spans, size_t nspans)
+{
+ spans->points = malloc(nspans * sizeof (*spans->points));
+ if (!spans->points)
+ return FALSE;
+ spans->widths = malloc(nspans * sizeof (*spans->widths));
+ if (!spans->widths)
+ {
+ free(spans->points);
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/*
+ * interface data to span-merging polygon filler
+ */
+
+typedef struct _SpanData {
+ SpanGroup fgGroup, bgGroup;
+} SpanDataRec, *SpanDataPtr;
+
+static void
+AppendSpanGroup(GCPtr pGC, unsigned long pixel, Spans *spanPtr, SpanDataPtr spanData)
+{
+ SpanGroup *group, *othergroup = NULL;
+ if (pixel == pGC->fgPixel)
+ {
+ group = &spanData->fgGroup;
+ if (pGC->lineStyle == LineDoubleDash)
+ othergroup = &spanData->bgGroup;
+ }
+ else
+ {
+ group = &spanData->bgGroup;
+ othergroup = &spanData->fgGroup;
+ }
+ miAppendSpans (group, othergroup, spanPtr);
+}
+
+
+static void miLineArc(DrawablePtr pDraw, GCPtr pGC,
+ unsigned long pixel, SpanDataPtr spanData,
+ LineFacePtr leftFace,
+ LineFacePtr rightFace,
+ double xorg, double yorg, Bool isInt);
+
+
+/*
+ * spans-based polygon filler
+ */
+
+static void
+fillSpans(DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel, Spans *spans, SpanDataPtr spanData)
+{
+ if (!spanData)
+ {
+ ChangeGCVal oldPixel, tmpPixel;
+ oldPixel.val = pGC->fgPixel;
+ if (pixel != oldPixel.val)
+ {
+ tmpPixel.val = (XID)pixel;
+ ChangeGC (NullClient, pGC, GCForeground, &tmpPixel);
+ ValidateGC (pDrawable, pGC);
+ }
+ (*pGC->ops->FillSpans) (pDrawable, pGC, spans->count, spans->points, spans->widths, TRUE);
+ free(spans->widths);
+ free(spans->points);
+ if (pixel != oldPixel.val)
+ {
+ ChangeGC (NullClient, pGC, GCForeground, &oldPixel);
+ ValidateGC (pDrawable, pGC);
+ }
+ }
+ else
+ AppendSpanGroup (pGC, pixel, spans, spanData);
+}
+
+static void
+miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
+ SpanDataPtr spanData, int y, int overall_height,
+ PolyEdgePtr left, PolyEdgePtr right,
+ int left_count, int right_count)
+{
+ int left_x = 0, left_e = 0;
+ int left_stepx = 0;
+ int left_signdx = 0;
+ int left_dy = 0, left_dx = 0;
+
+ int right_x = 0, right_e = 0;
+ int right_stepx = 0;
+ int right_signdx = 0;
+ int right_dy = 0, right_dx = 0;
+
+ int height = 0;
+ int left_height = 0, right_height = 0;
+
+ DDXPointPtr ppt;
+ int *pwidth;
+ int xorg;
+ Spans spanRec;
+
+ if (!InitSpans(&spanRec, overall_height))
+ return;
+ ppt = spanRec.points;
+ pwidth = spanRec.widths;
+
+ xorg = 0;
+ if (pGC->miTranslate)
+ {
+ y += pDrawable->y;
+ xorg = pDrawable->x;
+ }
+ while ((left_count || left_height) &&
+ (right_count || right_height))
+ {
+ if (!left_height && left_count)
+ {
+ left_height = left->height;
+ left_x = left->x;
+ left_stepx = left->stepx;
+ left_signdx = left->signdx;
+ left_e = left->e;
+ left_dy = left->dy;
+ left_dx = left->dx;
+ --left_count;
+ ++left;
+ }
+
+ if (!right_height && right_count)
+ {
+ right_height = right->height;
+ right_x = right->x;
+ right_stepx = right->stepx;
+ right_signdx = right->signdx;
+ right_e = right->e;
+ right_dy = right->dy;
+ right_dx = right->dx;
+ --right_count;
+ ++right;
+ }
+
+ height = left_height;
+ if (height > right_height)
+ height = right_height;
+
+ left_height -= height;
+ right_height -= height;
+
+ while (--height >= 0)
+ {
+ if (right_x >= left_x)
+ {
+ ppt->y = y;
+ ppt->x = left_x + xorg;
+ ppt++;
+ *pwidth++ = right_x - left_x + 1;
+ }
+ y++;
+
+ left_x += left_stepx;
+ left_e += left_dx;
+ if (left_e > 0)
+ {
+ left_x += left_signdx;
+ left_e -= left_dy;
+ }
+
+ right_x += right_stepx;
+ right_e += right_dx;
+ if (right_e > 0)
+ {
+ right_x += right_signdx;
+ right_e -= right_dy;
+ }
+ }
+ }
+ spanRec.count = ppt - spanRec.points;
+ fillSpans (pDrawable, pGC, pixel, &spanRec, spanData);
+}
+
+static void
+miFillRectPolyHelper (
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ unsigned long pixel,
+ SpanDataPtr spanData,
+ int x,
+ int y,
+ int w,
+ int h)
+{
+ DDXPointPtr ppt;
+ int *pwidth;
+ ChangeGCVal oldPixel, tmpPixel;
+ Spans spanRec;
+ xRectangle rect;
+
+ if (!spanData)
+ {
+ rect.x = x;
+ rect.y = y;
+ rect.width = w;
+ rect.height = h;
+ oldPixel.val = pGC->fgPixel;
+ if (pixel != oldPixel.val)
+ {
+ tmpPixel.val = (XID)pixel;
+ ChangeGC (NullClient, pGC, GCForeground, &tmpPixel);
+ ValidateGC (pDrawable, pGC);
+ }
+ (*pGC->ops->PolyFillRect) (pDrawable, pGC, 1, &rect);
+ if (pixel != oldPixel.val)
+ {
+ ChangeGC (NullClient, pGC, GCForeground, &oldPixel);
+ ValidateGC (pDrawable, pGC);
+ }
+ }
+ else
+ {
+ if (!InitSpans(&spanRec, h))
+ return;
+ ppt = spanRec.points;
+ pwidth = spanRec.widths;
+
+ if (pGC->miTranslate)
+ {
+ y += pDrawable->y;
+ x += pDrawable->x;
+ }
+ while (h--)
+ {
+ ppt->x = x;
+ ppt->y = y;
+ ppt++;
+ *pwidth++ = w;
+ y++;
+ }
+ spanRec.count = ppt - spanRec.points;
+ AppendSpanGroup (pGC, pixel, &spanRec, spanData);
+ }
+}
+
+/* static */ int
+miPolyBuildEdge (
+ double x0,
+ double y0,
+ double k, /* x0 * dy - y0 * dx */
+ int dx,
+ int dy,
+ int xi,
+ int yi,
+ int left,
+ PolyEdgePtr edge)
+{
+ int x, y, e;
+ int xady;
+
+ if (dy < 0)
+ {
+ dy = -dy;
+ dx = -dx;
+ k = -k;
+ }
+
+#ifdef NOTDEF
+ {
+ double realk, kerror;
+ realk = x0 * dy - y0 * dx;
+ kerror = fabs (realk - k);
+ if (kerror > .1)
+ printf ("realk: %g k: %g\n", realk, k);
+ }
+#endif
+ y = ICEIL (y0);
+ xady = ICEIL (k) + y * dx;
+
+ if (xady <= 0)
+ x = - (-xady / dy) - 1;
+ else
+ x = (xady - 1) / dy;
+
+ e = xady - x * dy;
+
+ if (dx >= 0)
+ {
+ edge->signdx = 1;
+ edge->stepx = dx / dy;
+ edge->dx = dx % dy;
+ }
+ else
+ {
+ edge->signdx = -1;
+ edge->stepx = - (-dx / dy);
+ edge->dx = -dx % dy;
+ e = dy - e + 1;
+ }
+ edge->dy = dy;
+ edge->x = x + left + xi;
+ edge->e = e - dy; /* bias to compare against 0 instead of dy */
+ return y + yi;
+}
+
+#define StepAround(v, incr, max) (((v) + (incr) < 0) ? (max - 1) : ((v) + (incr) == max) ? 0 : ((v) + (incr)))
+
+/* static */ int
+miPolyBuildPoly (
+ PolyVertexPtr vertices,
+ PolySlopePtr slopes,
+ int count,
+ int xi,
+ int yi,
+ PolyEdgePtr left,
+ PolyEdgePtr right,
+ int *pnleft,
+ int *pnright,
+ int *h)
+{
+ int top, bottom;
+ double miny, maxy;
+ int i;
+ int j;
+ int clockwise;
+ int slopeoff;
+ int s;
+ int nright, nleft;
+ int y, lasty = 0, bottomy, topy = 0;
+
+ /* find the top of the polygon */
+ maxy = miny = vertices[0].y;
+ bottom = top = 0;
+ for (i = 1; i < count; i++)
+ {
+ if (vertices[i].y < miny)
+ {
+ top = i;
+ miny = vertices[i].y;
+ }
+ if (vertices[i].y >= maxy)
+ {
+ bottom = i;
+ maxy = vertices[i].y;
+ }
+ }
+ clockwise = 1;
+ slopeoff = 0;
+
+ i = top;
+ j = StepAround (top, -1, count);
+
+ if ((int64_t)slopes[j].dy * slopes[i].dx > (int64_t)slopes[i].dy * slopes[j].dx)
+ {
+ clockwise = -1;
+ slopeoff = -1;
+ }
+
+ bottomy = ICEIL (maxy) + yi;
+
+ nright = 0;
+
+ s = StepAround (top, slopeoff, count);
+ i = top;
+ while (i != bottom)
+ {
+ if (slopes[s].dy != 0)
+ {
+ y = miPolyBuildEdge (vertices[i].x, vertices[i].y,
+ slopes[s].k,
+ slopes[s].dx, slopes[s].dy,
+ xi, yi, 0,
+ &right[nright]);
+ if (nright != 0)
+ right[nright-1].height = y - lasty;
+ else
+ topy = y;
+ nright++;
+ lasty = y;
+ }
+
+ i = StepAround (i, clockwise, count);
+ s = StepAround (s, clockwise, count);
+ }
+ if (nright != 0)
+ right[nright-1].height = bottomy - lasty;
+
+ if (slopeoff == 0)
+ slopeoff = -1;
+ else
+ slopeoff = 0;
+
+ nleft = 0;
+ s = StepAround (top, slopeoff, count);
+ i = top;
+ while (i != bottom)
+ {
+ if (slopes[s].dy != 0)
+ {
+ y = miPolyBuildEdge (vertices[i].x, vertices[i].y,
+ slopes[s].k,
+ slopes[s].dx, slopes[s].dy, xi, yi, 1,
+ &left[nleft]);
+
+ if (nleft != 0)
+ left[nleft-1].height = y - lasty;
+ nleft++;
+ lasty = y;
+ }
+ i = StepAround (i, -clockwise, count);
+ s = StepAround (s, -clockwise, count);
+ }
+ if (nleft != 0)
+ left[nleft-1].height = bottomy - lasty;
+ *pnleft = nleft;
+ *pnright = nright;
+ *h = bottomy - topy;
+ return topy;
+}
+
+static void
+miLineOnePoint (
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ unsigned long pixel,
+ SpanDataPtr spanData,
+ int x,
+ int y)
+{
+ DDXPointRec pt;
+ int wid;
+ unsigned long oldPixel;
+
+ MILINESETPIXEL (pDrawable, pGC, pixel, oldPixel);
+ if (pGC->fillStyle == FillSolid)
+ {
+ pt.x = x;
+ pt.y = y;
+ (*pGC->ops->PolyPoint) (pDrawable, pGC, CoordModeOrigin, 1, &pt);
+ }
+ else
+ {
+ wid = 1;
+ if (pGC->miTranslate)
+ {
+ x += pDrawable->x;
+ y += pDrawable->y;
+ }
+ pt.x = x;
+ pt.y = y;
+ (*pGC->ops->FillSpans) (pDrawable, pGC, 1, &pt, &wid, TRUE);
+ }
+ MILINERESETPIXEL (pDrawable, pGC, pixel, oldPixel);
+}
+
+static void
+miLineJoin (
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ unsigned long pixel,
+ SpanDataPtr spanData,
+ LineFacePtr pLeft,
+ LineFacePtr pRight)
+{
+ double mx = 0, my = 0;
+ double denom = 0.0;
+ PolyVertexRec vertices[4];
+ PolySlopeRec slopes[4];
+ int edgecount;
+ PolyEdgeRec left[4], right[4];
+ int nleft, nright;
+ int y, height;
+ int swapslopes;
+ int joinStyle = pGC->joinStyle;
+ int lw = pGC->lineWidth;
+
+ if (lw == 1 && !spanData) {
+ /* See if one of the lines will draw the joining pixel */
+ if (pLeft->dx > 0 || (pLeft->dx == 0 && pLeft->dy > 0))
+ return;
+ if (pRight->dx > 0 || (pRight->dx == 0 && pRight->dy > 0))
+ return;
+ if (joinStyle != JoinRound) {
+ denom = - pLeft->dx * (double)pRight->dy + pRight->dx * (double)pLeft->dy;
+ if (denom == 0)
+ return; /* no join to draw */
+ }
+ if (joinStyle != JoinMiter) {
+ miLineOnePoint (pDrawable, pGC, pixel, spanData, pLeft->x, pLeft->y);
+ return;
+ }
+ } else {
+ if (joinStyle == JoinRound)
+ {
+ miLineArc(pDrawable, pGC, pixel, spanData,
+ pLeft, pRight,
+ (double)0.0, (double)0.0, TRUE);
+ return;
+ }
+ denom = - pLeft->dx * (double)pRight->dy + pRight->dx * (double)pLeft->dy;
+ if (denom == 0.0)
+ return; /* no join to draw */
+ }
+
+ swapslopes = 0;
+ if (denom > 0)
+ {
+ pLeft->xa = -pLeft->xa;
+ pLeft->ya = -pLeft->ya;
+ pLeft->dx = -pLeft->dx;
+ pLeft->dy = -pLeft->dy;
+ }
+ else
+ {
+ swapslopes = 1;
+ pRight->xa = -pRight->xa;
+ pRight->ya = -pRight->ya;
+ pRight->dx = -pRight->dx;
+ pRight->dy = -pRight->dy;
+ }
+
+ vertices[0].x = pRight->xa;
+ vertices[0].y = pRight->ya;
+ slopes[0].dx = -pRight->dy;
+ slopes[0].dy = pRight->dx;
+ slopes[0].k = 0;
+
+ vertices[1].x = 0;
+ vertices[1].y = 0;
+ slopes[1].dx = pLeft->dy;
+ slopes[1].dy = -pLeft->dx;
+ slopes[1].k = 0;
+
+ vertices[2].x = pLeft->xa;
+ vertices[2].y = pLeft->ya;
+
+ if (joinStyle == JoinMiter)
+ {
+ my = (pLeft->dy * (pRight->xa * pRight->dy - pRight->ya * pRight->dx) -
+ pRight->dy * (pLeft->xa * pLeft->dy - pLeft->ya * pLeft->dx )) /
+ denom;
+ if (pLeft->dy != 0)
+ {
+ mx = pLeft->xa + (my - pLeft->ya) *
+ (double) pLeft->dx / (double) pLeft->dy;
+ }
+ else
+ {
+ mx = pRight->xa + (my - pRight->ya) *
+ (double) pRight->dx / (double) pRight->dy;
+ }
+ /* check miter limit */
+ if ((mx * mx + my * my) * 4 > SQSECANT * lw * lw)
+ joinStyle = JoinBevel;
+ }
+
+ if (joinStyle == JoinMiter)
+ {
+ slopes[2].dx = pLeft->dx;
+ slopes[2].dy = pLeft->dy;
+ slopes[2].k = pLeft->k;
+ if (swapslopes)
+ {
+ slopes[2].dx = -slopes[2].dx;
+ slopes[2].dy = -slopes[2].dy;
+ slopes[2].k = -slopes[2].k;
+ }
+ vertices[3].x = mx;
+ vertices[3].y = my;
+ slopes[3].dx = pRight->dx;
+ slopes[3].dy = pRight->dy;
+ slopes[3].k = pRight->k;
+ if (swapslopes)
+ {
+ slopes[3].dx = -slopes[3].dx;
+ slopes[3].dy = -slopes[3].dy;
+ slopes[3].k = -slopes[3].k;
+ }
+ edgecount = 4;
+ }
+ else
+ {
+ double scale, dx, dy, adx, ady;
+
+ adx = dx = pRight->xa - pLeft->xa;
+ ady = dy = pRight->ya - pLeft->ya;
+ if (adx < 0)
+ adx = -adx;
+ if (ady < 0)
+ ady = -ady;
+ scale = ady;
+ if (adx > ady)
+ scale = adx;
+ slopes[2].dx = (dx * 65536) / scale;
+ slopes[2].dy = (dy * 65536) / scale;
+ slopes[2].k = ((pLeft->xa + pRight->xa) * slopes[2].dy -
+ (pLeft->ya + pRight->ya) * slopes[2].dx) / 2.0;
+ edgecount = 3;
+ }
+
+ y = miPolyBuildPoly (vertices, slopes, edgecount, pLeft->x, pLeft->y,
+ left, right, &nleft, &nright, &height);
+ miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, height, left, right, nleft, nright);
+}
+
+static int
+miLineArcI (
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ int xorg,
+ int yorg,
+ DDXPointPtr points,
+ int *widths)
+{
+ DDXPointPtr tpts, bpts;
+ int *twids, *bwids;
+ int x, y, e, ex, slw;
+
+ tpts = points;
+ twids = widths;
+ if (pGC->miTranslate)
+ {
+ xorg += pDraw->x;
+ yorg += pDraw->y;
+ }
+ slw = pGC->lineWidth;
+ if (slw == 1)
+ {
+ tpts->x = xorg;
+ tpts->y = yorg;
+ *twids = 1;
+ return 1;
+ }
+ bpts = tpts + slw;
+ bwids = twids + slw;
+ y = (slw >> 1) + 1;
+ if (slw & 1)
+ e = - ((y << 2) + 3);
+ else
+ e = - (y << 3);
+ ex = -4;
+ x = 0;
+ while (y)
+ {
+ e += (y << 3) - 4;
+ while (e >= 0)
+ {
+ x++;
+ e += (ex = -((x << 3) + 4));
+ }
+ y--;
+ slw = (x << 1) + 1;
+ if ((e == ex) && (slw > 1))
+ slw--;
+ tpts->x = xorg - x;
+ tpts->y = yorg - y;
+ tpts++;
+ *twids++ = slw;
+ if ((y != 0) && ((slw > 1) || (e != ex)))
+ {
+ bpts--;
+ bpts->x = xorg - x;
+ bpts->y = yorg + y;
+ *--bwids = slw;
+ }
+ }
+ return pGC->lineWidth;
+}
+
+#define CLIPSTEPEDGE(edgey,edge,edgeleft) \
+ if (ybase == edgey) \
+ { \
+ if (edgeleft) \
+ { \
+ if (edge->x > xcl) \
+ xcl = edge->x; \
+ } \
+ else \
+ { \
+ if (edge->x < xcr) \
+ xcr = edge->x; \
+ } \
+ edgey++; \
+ edge->x += edge->stepx; \
+ edge->e += edge->dx; \
+ if (edge->e > 0) \
+ { \
+ edge->x += edge->signdx; \
+ edge->e -= edge->dy; \
+ } \
+ }
+
+static int
+miLineArcD (
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ double xorg,
+ double yorg,
+ DDXPointPtr points,
+ int *widths,
+ PolyEdgePtr edge1,
+ int edgey1,
+ Bool edgeleft1,
+ PolyEdgePtr edge2,
+ int edgey2,
+ Bool edgeleft2)
+{
+ DDXPointPtr pts;
+ int *wids;
+ double radius, x0, y0, el, er, yk, xlk, xrk, k;
+ int xbase, ybase, y, boty, xl, xr, xcl, xcr;
+ int ymin, ymax;
+ Bool edge1IsMin, edge2IsMin;
+ int ymin1, ymin2;
+
+ pts = points;
+ wids = widths;
+ xbase = floor(xorg);
+ x0 = xorg - xbase;
+ ybase = ICEIL (yorg);
+ y0 = yorg - ybase;
+ if (pGC->miTranslate)
+ {
+ xbase += pDraw->x;
+ ybase += pDraw->y;
+ edge1->x += pDraw->x;
+ edge2->x += pDraw->x;
+ edgey1 += pDraw->y;
+ edgey2 += pDraw->y;
+ }
+ xlk = x0 + x0 + 1.0;
+ xrk = x0 + x0 - 1.0;
+ yk = y0 + y0 - 1.0;
+ radius = ((double)pGC->lineWidth) / 2.0;
+ y = floor(radius - y0 + 1.0);
+ ybase -= y;
+ ymin = ybase;
+ ymax = 65536;
+ edge1IsMin = FALSE;
+ ymin1 = edgey1;
+ if (edge1->dy >= 0)
+ {
+ if (!edge1->dy)
+ {
+ if (edgeleft1)
+ edge1IsMin = TRUE;
+ else
+ ymax = edgey1;
+ edgey1 = 65536;
+ }
+ else
+ {
+ if ((edge1->signdx < 0) == edgeleft1)
+ edge1IsMin = TRUE;
+ }
+ }
+ edge2IsMin = FALSE;
+ ymin2 = edgey2;
+ if (edge2->dy >= 0)
+ {
+ if (!edge2->dy)
+ {
+ if (edgeleft2)
+ edge2IsMin = TRUE;
+ else
+ ymax = edgey2;
+ edgey2 = 65536;
+ }
+ else
+ {
+ if ((edge2->signdx < 0) == edgeleft2)
+ edge2IsMin = TRUE;
+ }
+ }
+ if (edge1IsMin)
+ {
+ ymin = ymin1;
+ if (edge2IsMin && ymin1 > ymin2)
+ ymin = ymin2;
+ } else if (edge2IsMin)
+ ymin = ymin2;
+ el = radius * radius - ((y + y0) * (y + y0)) - (x0 * x0);
+ er = el + xrk;
+ xl = 1;
+ xr = 0;
+ if (x0 < 0.5)
+ {
+ xl = 0;
+ el -= xlk;
+ }
+ boty = (y0 < -0.5) ? 1 : 0;
+ if (ybase + y - boty > ymax)
+ boty = ymax - ybase - y;
+ while (y > boty)
+ {
+ k = (y << 1) + yk;
+ er += k;
+ while (er > 0.0)
+ {
+ xr++;
+ er += xrk - (xr << 1);
+ }
+ el += k;
+ while (el >= 0.0)
+ {
+ xl--;
+ el += (xl << 1) - xlk;
+ }
+ y--;
+ ybase++;
+ if (ybase < ymin)
+ continue;
+ xcl = xl + xbase;
+ xcr = xr + xbase;
+ CLIPSTEPEDGE(edgey1, edge1, edgeleft1);
+ CLIPSTEPEDGE(edgey2, edge2, edgeleft2);
+ if (xcr >= xcl)
+ {
+ pts->x = xcl;
+ pts->y = ybase;
+ pts++;
+ *wids++ = xcr - xcl + 1;
+ }
+ }
+ er = xrk - (xr << 1) - er;
+ el = (xl << 1) - xlk - el;
+ boty = floor(-y0 - radius + 1.0);
+ if (ybase + y - boty > ymax)
+ boty = ymax - ybase - y;
+ while (y > boty)
+ {
+ k = (y << 1) + yk;
+ er -= k;
+ while ((er >= 0.0) && (xr >= 0))
+ {
+ xr--;
+ er += xrk - (xr << 1);
+ }
+ el -= k;
+ while ((el > 0.0) && (xl <= 0))
+ {
+ xl++;
+ el += (xl << 1) - xlk;
+ }
+ y--;
+ ybase++;
+ if (ybase < ymin)
+ continue;
+ xcl = xl + xbase;
+ xcr = xr + xbase;
+ CLIPSTEPEDGE(edgey1, edge1, edgeleft1);
+ CLIPSTEPEDGE(edgey2, edge2, edgeleft2);
+ if (xcr >= xcl)
+ {
+ pts->x = xcl;
+ pts->y = ybase;
+ pts++;
+ *wids++ = xcr - xcl + 1;
+ }
+ }
+ return pts - points;
+}
+
+static int
+miRoundJoinFace (LineFacePtr face, PolyEdgePtr edge, Bool *leftEdge)
+{
+ int y;
+ int dx, dy;
+ double xa, ya;
+ Bool left;
+
+ dx = -face->dy;
+ dy = face->dx;
+ xa = face->xa;
+ ya = face->ya;
+ left = 1;
+ if (ya > 0)
+ {
+ ya = 0.0;
+ xa = 0.0;
+ }
+ if (dy < 0 || (dy == 0 && dx > 0))
+ {
+ dx = -dx;
+ dy = -dy;
+ left = !left;
+ }
+ if (dx == 0 && dy == 0)
+ dy = 1;
+ if (dy == 0)
+ {
+ y = ICEIL (face->ya) + face->y;
+ edge->x = -32767;
+ edge->stepx = 0;
+ edge->signdx = 0;
+ edge->e = -1;
+ edge->dy = 0;
+ edge->dx = 0;
+ edge->height = 0;
+ }
+ else
+ {
+ y = miPolyBuildEdge (xa, ya, 0.0, dx, dy, face->x, face->y, !left, edge);
+ edge->height = 32767;
+ }
+ *leftEdge = !left;
+ return y;
+}
+
+void
+miRoundJoinClip (LineFacePtr pLeft, LineFacePtr pRight,
+ PolyEdgePtr edge1, PolyEdgePtr edge2,
+ int *y1, int *y2, Bool *left1, Bool *left2)
+{
+ double denom;
+
+ denom = - pLeft->dx * (double)pRight->dy + pRight->dx * (double)pLeft->dy;
+
+ if (denom >= 0)
+ {
+ pLeft->xa = -pLeft->xa;
+ pLeft->ya = -pLeft->ya;
+ }
+ else
+ {
+ pRight->xa = -pRight->xa;
+ pRight->ya = -pRight->ya;
+ }
+ *y1 = miRoundJoinFace (pLeft, edge1, left1);
+ *y2 = miRoundJoinFace (pRight, edge2, left2);
+}
+
+int
+miRoundCapClip (LineFacePtr face, Bool isInt, PolyEdgePtr edge, Bool *leftEdge)
+{
+ int y;
+ int dx, dy;
+ double xa, ya, k;
+ Bool left;
+
+ dx = -face->dy;
+ dy = face->dx;
+ xa = face->xa;
+ ya = face->ya;
+ k = 0.0;
+ if (!isInt)
+ k = face->k;
+ left = 1;
+ if (dy < 0 || (dy == 0 && dx > 0))
+ {
+ dx = -dx;
+ dy = -dy;
+ xa = -xa;
+ ya = -ya;
+ left = !left;
+ }
+ if (dx == 0 && dy == 0)
+ dy = 1;
+ if (dy == 0)
+ {
+ y = ICEIL (face->ya) + face->y;
+ edge->x = -32767;
+ edge->stepx = 0;
+ edge->signdx = 0;
+ edge->e = -1;
+ edge->dy = 0;
+ edge->dx = 0;
+ edge->height = 0;
+ }
+ else
+ {
+ y = miPolyBuildEdge (xa, ya, k, dx, dy, face->x, face->y, !left, edge);
+ edge->height = 32767;
+ }
+ *leftEdge = !left;
+ return y;
+}
+
+static void
+miLineArc (
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ unsigned long pixel,
+ SpanDataPtr spanData,
+ LineFacePtr leftFace,
+ LineFacePtr rightFace,
+ double xorg,
+ double yorg,
+ Bool isInt)
+{
+ int xorgi = 0, yorgi = 0;
+ Spans spanRec;
+ int n;
+ PolyEdgeRec edge1, edge2;
+ int edgey1, edgey2;
+ Bool edgeleft1, edgeleft2;
+
+ if (isInt)
+ {
+ xorgi = leftFace ? leftFace->x : rightFace->x;
+ yorgi = leftFace ? leftFace->y : rightFace->y;
+ }
+ edgey1 = 65536;
+ edgey2 = 65536;
+ edge1.x = 0; /* not used, keep memory checkers happy */
+ edge1.dy = -1;
+ edge2.x = 0; /* not used, keep memory checkers happy */
+ edge2.dy = -1;
+ edgeleft1 = FALSE;
+ edgeleft2 = FALSE;
+ if ((pGC->lineStyle != LineSolid || pGC->lineWidth > 2) &&
+ ((pGC->capStyle == CapRound && pGC->joinStyle != JoinRound) ||
+ (pGC->joinStyle == JoinRound && pGC->capStyle == CapButt)))
+ {
+ if (isInt)
+ {
+ xorg = (double) xorgi;
+ yorg = (double) yorgi;
+ }
+ if (leftFace && rightFace)
+ {
+ miRoundJoinClip (leftFace, rightFace, &edge1, &edge2,
+ &edgey1, &edgey2, &edgeleft1, &edgeleft2);
+ }
+ else if (leftFace)
+ {
+ edgey1 = miRoundCapClip (leftFace, isInt, &edge1, &edgeleft1);
+ }
+ else if (rightFace)
+ {
+ edgey2 = miRoundCapClip (rightFace, isInt, &edge2, &edgeleft2);
+ }
+ isInt = FALSE;
+ }
+ if (!InitSpans(&spanRec, pGC->lineWidth))
+ return;
+ if (isInt)
+ n = miLineArcI(pDraw, pGC, xorgi, yorgi, spanRec.points, spanRec.widths);
+ else
+ n = miLineArcD(pDraw, pGC, xorg, yorg, spanRec.points, spanRec.widths,
+ &edge1, edgey1, edgeleft1,
+ &edge2, edgey2, edgeleft2);
+ spanRec.count = n;
+ fillSpans (pDraw, pGC, pixel, &spanRec, spanData);
+}
+
+static void
+miLineProjectingCap (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
+ SpanDataPtr spanData, LineFacePtr face, Bool isLeft,
+ double xorg, double yorg, Bool isInt)
+{
+ int xorgi = 0, yorgi = 0;
+ int lw;
+ PolyEdgeRec lefts[2], rights[2];
+ int lefty, righty, topy, bottomy;
+ PolyEdgePtr left, right;
+ PolyEdgePtr top, bottom;
+ double xa,ya;
+ double k;
+ double xap, yap;
+ int dx, dy;
+ double projectXoff, projectYoff;
+ double maxy;
+ int finaly;
+
+ if (isInt)
+ {
+ xorgi = face->x;
+ yorgi = face->y;
+ }
+ lw = pGC->lineWidth;
+ dx = face->dx;
+ dy = face->dy;
+ k = face->k;
+ if (dy == 0)
+ {
+ lefts[0].height = lw;
+ lefts[0].x = xorgi;
+ if (isLeft)
+ lefts[0].x -= (lw >> 1);
+ lefts[0].stepx = 0;
+ lefts[0].signdx = 1;
+ lefts[0].e = -lw;
+ lefts[0].dx = 0;
+ lefts[0].dy = lw;
+ rights[0].height = lw;
+ rights[0].x = xorgi;
+ if (!isLeft)
+ rights[0].x += ((lw + 1) >> 1);
+ rights[0].stepx = 0;
+ rights[0].signdx = 1;
+ rights[0].e = -lw;
+ rights[0].dx = 0;
+ rights[0].dy = lw;
+ miFillPolyHelper (pDrawable, pGC, pixel, spanData, yorgi - (lw >> 1), lw,
+ lefts, rights, 1, 1);
+ }
+ else if (dx == 0)
+ {
+ if (dy < 0) {
+ dy = -dy;
+ isLeft = !isLeft;
+ }
+ topy = yorgi;
+ bottomy = yorgi + dy;
+ if (isLeft)
+ topy -= (lw >> 1);
+ else
+ bottomy += (lw >> 1);
+ lefts[0].height = bottomy - topy;
+ lefts[0].x = xorgi - (lw >> 1);
+ lefts[0].stepx = 0;
+ lefts[0].signdx = 1;
+ lefts[0].e = -dy;
+ lefts[0].dx = dx;
+ lefts[0].dy = dy;
+
+ rights[0].height = bottomy - topy;
+ rights[0].x = lefts[0].x + (lw-1);
+ rights[0].stepx = 0;
+ rights[0].signdx = 1;
+ rights[0].e = -dy;
+ rights[0].dx = dx;
+ rights[0].dy = dy;
+ miFillPolyHelper (pDrawable, pGC, pixel, spanData, topy, bottomy - topy, lefts, rights, 1, 1);
+ }
+ else
+ {
+ xa = face->xa;
+ ya = face->ya;
+ projectXoff = -ya;
+ projectYoff = xa;
+ if (dx < 0)
+ {
+ right = &rights[1];
+ left = &lefts[0];
+ top = &rights[0];
+ bottom = &lefts[1];
+ }
+ else
+ {
+ right = &rights[0];
+ left = &lefts[1];
+ top = &lefts[0];
+ bottom = &rights[1];
+ }
+ if (isLeft)
+ {
+ righty = miPolyBuildEdge (xa, ya,
+ k, dx, dy, xorgi, yorgi, 0, right);
+
+ xa = -xa;
+ ya = -ya;
+ k = -k;
+ lefty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff,
+ k, dx, dy, xorgi, yorgi, 1, left);
+ if (dx > 0)
+ {
+ ya = -ya;
+ xa = -xa;
+ }
+ xap = xa - projectXoff;
+ yap = ya - projectYoff;
+ topy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy,
+ -dy, dx, xorgi, yorgi, dx > 0, top);
+ bottomy = miPolyBuildEdge (xa, ya,
+ 0.0, -dy, dx, xorgi, yorgi, dx < 0, bottom);
+ maxy = -ya;
+ }
+ else
+ {
+ righty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff,
+ k, dx, dy, xorgi, yorgi, 0, right);
+
+ xa = -xa;
+ ya = -ya;
+ k = -k;
+ lefty = miPolyBuildEdge (xa, ya,
+ k, dx, dy, xorgi, yorgi, 1, left);
+ if (dx > 0)
+ {
+ ya = -ya;
+ xa = -xa;
+ }
+ xap = xa - projectXoff;
+ yap = ya - projectYoff;
+ topy = miPolyBuildEdge (xa, ya, 0.0, -dy, dx, xorgi, xorgi, dx > 0, top);
+ bottomy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy,
+ -dy, dx, xorgi, xorgi, dx < 0, bottom);
+ maxy = -ya + projectYoff;
+ }
+ finaly = ICEIL(maxy) + yorgi;
+ if (dx < 0)
+ {
+ left->height = bottomy - lefty;
+ right->height = finaly - righty;
+ top->height = righty - topy;
+ }
+ else
+ {
+ right->height = bottomy - righty;
+ left->height = finaly - lefty;
+ top->height = lefty - topy;
+ }
+ bottom->height = finaly - bottomy;
+ miFillPolyHelper (pDrawable, pGC, pixel, spanData, topy,
+ bottom->height + bottomy - topy, lefts, rights, 2, 2);
+ }
+}
+
+static void
+miWideSegment (
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ unsigned long pixel,
+ SpanDataPtr spanData,
+ int x1,
+ int y1,
+ int x2,
+ int y2,
+ Bool projectLeft,
+ Bool projectRight,
+ LineFacePtr leftFace,
+ LineFacePtr rightFace)
+{
+ double l, L, r;
+ double xa, ya;
+ double projectXoff = 0.0, projectYoff = 0.0;
+ double k;
+ double maxy;
+ int x, y;
+ int dx, dy;
+ int finaly;
+ PolyEdgePtr left, right;
+ PolyEdgePtr top, bottom;
+ int lefty, righty, topy, bottomy;
+ int signdx;
+ PolyEdgeRec lefts[2], rights[2];
+ LineFacePtr tface;
+ int lw = pGC->lineWidth;
+
+ /* draw top-to-bottom always */
+ if (y2 < y1 || (y2 == y1 && x2 < x1))
+ {
+ x = x1;
+ x1 = x2;
+ x2 = x;
+
+ y = y1;
+ y1 = y2;
+ y2 = y;
+
+ x = projectLeft;
+ projectLeft = projectRight;
+ projectRight = x;
+
+ tface = leftFace;
+ leftFace = rightFace;
+ rightFace = tface;
+ }
+
+ dy = y2 - y1;
+ signdx = 1;
+ dx = x2 - x1;
+ if (dx < 0)
+ signdx = -1;
+
+ leftFace->x = x1;
+ leftFace->y = y1;
+ leftFace->dx = dx;
+ leftFace->dy = dy;
+
+ rightFace->x = x2;
+ rightFace->y = y2;
+ rightFace->dx = -dx;
+ rightFace->dy = -dy;
+
+ if (dy == 0)
+ {
+ rightFace->xa = 0;
+ rightFace->ya = (double) lw / 2.0;
+ rightFace->k = -(double) (lw * dx) / 2.0;
+ leftFace->xa = 0;
+ leftFace->ya = -rightFace->ya;
+ leftFace->k = rightFace->k;
+ x = x1;
+ if (projectLeft)
+ x -= (lw >> 1);
+ y = y1 - (lw >> 1);
+ dx = x2 - x;
+ if (projectRight)
+ dx += ((lw + 1) >> 1);
+ dy = lw;
+ miFillRectPolyHelper (pDrawable, pGC, pixel, spanData,
+ x, y, dx, dy);
+ }
+ else if (dx == 0)
+ {
+ leftFace->xa = (double) lw / 2.0;
+ leftFace->ya = 0;
+ leftFace->k = (double) (lw * dy) / 2.0;
+ rightFace->xa = -leftFace->xa;
+ rightFace->ya = 0;
+ rightFace->k = leftFace->k;
+ y = y1;
+ if (projectLeft)
+ y -= lw >> 1;
+ x = x1 - (lw >> 1);
+ dy = y2 - y;
+ if (projectRight)
+ dy += ((lw + 1) >> 1);
+ dx = lw;
+ miFillRectPolyHelper (pDrawable, pGC, pixel, spanData,
+ x, y, dx, dy);
+ }
+ else
+ {
+ l = ((double) lw) / 2.0;
+ L = hypot ((double) dx, (double) dy);
+
+ if (dx < 0)
+ {
+ right = &rights[1];
+ left = &lefts[0];
+ top = &rights[0];
+ bottom = &lefts[1];
+ }
+ else
+ {
+ right = &rights[0];
+ left = &lefts[1];
+ top = &lefts[0];
+ bottom = &rights[1];
+ }
+ r = l / L;
+
+ /* coord of upper bound at integral y */
+ ya = -r * dx;
+ xa = r * dy;
+
+ if (projectLeft | projectRight)
+ {
+ projectXoff = -ya;
+ projectYoff = xa;
+ }
+
+ /* xa * dy - ya * dx */
+ k = l * L;
+
+ leftFace->xa = xa;
+ leftFace->ya = ya;
+ leftFace->k = k;
+ rightFace->xa = -xa;
+ rightFace->ya = -ya;
+ rightFace->k = k;
+
+ if (projectLeft)
+ righty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff,
+ k, dx, dy, x1, y1, 0, right);
+ else
+ righty = miPolyBuildEdge (xa, ya,
+ k, dx, dy, x1, y1, 0, right);
+
+ /* coord of lower bound at integral y */
+ ya = -ya;
+ xa = -xa;
+
+ /* xa * dy - ya * dx */
+ k = - k;
+
+ if (projectLeft)
+ lefty = miPolyBuildEdge (xa - projectXoff, ya - projectYoff,
+ k, dx, dy, x1, y1, 1, left);
+ else
+ lefty = miPolyBuildEdge (xa, ya,
+ k, dx, dy, x1, y1, 1, left);
+
+ /* coord of top face at integral y */
+
+ if (signdx > 0)
+ {
+ ya = -ya;
+ xa = -xa;
+ }
+
+ if (projectLeft)
+ {
+ double xap = xa - projectXoff;
+ double yap = ya - projectYoff;
+ topy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy,
+ -dy, dx, x1, y1, dx > 0, top);
+ }
+ else
+ topy = miPolyBuildEdge (xa, ya, 0.0, -dy, dx, x1, y1, dx > 0, top);
+
+ /* coord of bottom face at integral y */
+
+ if (projectRight)
+ {
+ double xap = xa + projectXoff;
+ double yap = ya + projectYoff;
+ bottomy = miPolyBuildEdge (xap, yap, xap * dx + yap * dy,
+ -dy, dx, x2, y2, dx < 0, bottom);
+ maxy = -ya + projectYoff;
+ }
+ else
+ {
+ bottomy = miPolyBuildEdge (xa, ya,
+ 0.0, -dy, dx, x2, y2, dx < 0, bottom);
+ maxy = -ya;
+ }
+
+ finaly = ICEIL (maxy) + y2;
+
+ if (dx < 0)
+ {
+ left->height = bottomy - lefty;
+ right->height = finaly - righty;
+ top->height = righty - topy;
+ }
+ else
+ {
+ right->height = bottomy - righty;
+ left->height = finaly - lefty;
+ top->height = lefty - topy;
+ }
+ bottom->height = finaly - bottomy;
+ miFillPolyHelper (pDrawable, pGC, pixel, spanData, topy,
+ bottom->height + bottomy - topy, lefts, rights, 2, 2);
+ }
+}
+
+static SpanDataPtr
+miSetupSpanData (GCPtr pGC, SpanDataPtr spanData, int npt)
+{
+ if ((npt < 3 && pGC->capStyle != CapRound) || miSpansEasyRop(pGC->alu))
+ return (SpanDataPtr) NULL;
+ if (pGC->lineStyle == LineDoubleDash)
+ miInitSpanGroup (&spanData->bgGroup);
+ miInitSpanGroup (&spanData->fgGroup);
+ return spanData;
+}
+
+static void
+miCleanupSpanData (DrawablePtr pDrawable, GCPtr pGC, SpanDataPtr spanData)
+{
+ if (pGC->lineStyle == LineDoubleDash)
+ {
+ ChangeGCVal oldPixel, pixel;
+ pixel.val = pGC->bgPixel;
+ oldPixel.val = pGC->fgPixel;
+ if (pixel.val != oldPixel.val)
+ {
+ ChangeGC (NullClient, pGC, GCForeground, &pixel);
+ ValidateGC (pDrawable, pGC);
+ }
+ miFillUniqueSpanGroup (pDrawable, pGC, &spanData->bgGroup);
+ miFreeSpanGroup (&spanData->bgGroup);
+ if (pixel.val != oldPixel.val)
+ {
+ ChangeGC (NullClient, pGC, GCForeground, &oldPixel);
+ ValidateGC (pDrawable, pGC);
+ }
+ }
+ miFillUniqueSpanGroup (pDrawable, pGC, &spanData->fgGroup);
+ miFreeSpanGroup (&spanData->fgGroup);
+}
+
+void
+miWideLine (DrawablePtr pDrawable, GCPtr pGC,
+ int mode, int npt, DDXPointPtr pPts)
+{
+ int x1, y1, x2, y2;
+ SpanDataRec spanDataRec;
+ SpanDataPtr spanData;
+ long pixel;
+ Bool projectLeft, projectRight;
+ LineFaceRec leftFace, rightFace, prevRightFace;
+ LineFaceRec firstFace;
+ int first;
+ Bool somethingDrawn = FALSE;
+ Bool selfJoin;
+
+ spanData = miSetupSpanData (pGC, &spanDataRec, npt);
+ pixel = pGC->fgPixel;
+ x2 = pPts->x;
+ y2 = pPts->y;
+ first = TRUE;
+ selfJoin = FALSE;
+ if (npt > 1)
+ {
+ if (mode == CoordModePrevious)
+ {
+ int nptTmp;
+ DDXPointPtr pPtsTmp;
+
+ x1 = x2;
+ y1 = y2;
+ nptTmp = npt;
+ pPtsTmp = pPts + 1;
+ while (--nptTmp)
+ {
+ x1 += pPtsTmp->x;
+ y1 += pPtsTmp->y;
+ ++pPtsTmp;
+ }
+ if (x2 == x1 && y2 == y1)
+ selfJoin = TRUE;
+ }
+ else if (x2 == pPts[npt-1].x && y2 == pPts[npt-1].y)
+ {
+ selfJoin = TRUE;
+ }
+ }
+ projectLeft = pGC->capStyle == CapProjecting && !selfJoin;
+ projectRight = FALSE;
+ while (--npt)
+ {
+ x1 = x2;
+ y1 = y2;
+ ++pPts;
+ x2 = pPts->x;
+ y2 = pPts->y;
+ if (mode == CoordModePrevious)
+ {
+ x2 += x1;
+ y2 += y1;
+ }
+ if (x1 != x2 || y1 != y2)
+ {
+ somethingDrawn = TRUE;
+ if (npt == 1 && pGC->capStyle == CapProjecting && !selfJoin)
+ projectRight = TRUE;
+ miWideSegment (pDrawable, pGC, pixel, spanData, x1, y1, x2, y2,
+ projectLeft, projectRight, &leftFace, &rightFace);
+ if (first)
+ {
+ if (selfJoin)
+ firstFace = leftFace;
+ else if (pGC->capStyle == CapRound)
+ {
+ if (pGC->lineWidth == 1 && !spanData)
+ miLineOnePoint (pDrawable, pGC, pixel, spanData, x1, y1);
+ else
+ miLineArc (pDrawable, pGC, pixel, spanData,
+ &leftFace, (LineFacePtr) NULL,
+ (double)0.0, (double)0.0,
+ TRUE);
+ }
+ }
+ else
+ {
+ miLineJoin (pDrawable, pGC, pixel, spanData, &leftFace,
+ &prevRightFace);
+ }
+ prevRightFace = rightFace;
+ first = FALSE;
+ projectLeft = FALSE;
+ }
+ if (npt == 1 && somethingDrawn)
+ {
+ if (selfJoin)
+ miLineJoin (pDrawable, pGC, pixel, spanData, &firstFace,
+ &rightFace);
+ else if (pGC->capStyle == CapRound)
+ {
+ if (pGC->lineWidth == 1 && !spanData)
+ miLineOnePoint (pDrawable, pGC, pixel, spanData, x2, y2);
+ else
+ miLineArc (pDrawable, pGC, pixel, spanData,
+ (LineFacePtr) NULL, &rightFace,
+ (double)0.0, (double)0.0,
+ TRUE);
+ }
+ }
+ }
+ /* handle crock where all points are coincedent */
+ if (!somethingDrawn)
+ {
+ projectLeft = pGC->capStyle == CapProjecting;
+ miWideSegment (pDrawable, pGC, pixel, spanData,
+ x2, y2, x2, y2, projectLeft, projectLeft,
+ &leftFace, &rightFace);
+ if (pGC->capStyle == CapRound)
+ {
+ miLineArc (pDrawable, pGC, pixel, spanData,
+ &leftFace, (LineFacePtr) NULL,
+ (double)0.0, (double)0.0,
+ TRUE);
+ rightFace.dx = -1; /* sleezy hack to make it work */
+ miLineArc (pDrawable, pGC, pixel, spanData,
+ (LineFacePtr) NULL, &rightFace,
+ (double)0.0, (double)0.0,
+ TRUE);
+ }
+ }
+ if (spanData)
+ miCleanupSpanData (pDrawable, pGC, spanData);
+}
+
+#define V_TOP 0
+#define V_RIGHT 1
+#define V_BOTTOM 2
+#define V_LEFT 3
+
+static void
+miWideDashSegment (
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ SpanDataPtr spanData,
+ int *pDashOffset,
+ int *pDashIndex,
+ int x1,
+ int y1,
+ int x2,
+ int y2,
+ Bool projectLeft,
+ Bool projectRight,
+ LineFacePtr leftFace,
+ LineFacePtr rightFace)
+{
+ int dashIndex, dashRemain;
+ unsigned char *pDash;
+ double L, l;
+ double k;
+ PolyVertexRec vertices[4];
+ PolyVertexRec saveRight, saveBottom;
+ PolySlopeRec slopes[4];
+ PolyEdgeRec left[2], right[2];
+ LineFaceRec lcapFace, rcapFace;
+ int nleft, nright;
+ int h;
+ int y;
+ int dy, dx;
+ unsigned long pixel;
+ double LRemain;
+ double r;
+ double rdx, rdy;
+ double dashDx, dashDy;
+ double saveK = 0.0;
+ Bool first = TRUE;
+ double lcenterx, lcentery, rcenterx = 0.0, rcentery = 0.0;
+ unsigned long fgPixel, bgPixel;
+
+ dx = x2 - x1;
+ dy = y2 - y1;
+ dashIndex = *pDashIndex;
+ pDash = pGC->dash;
+ dashRemain = pDash[dashIndex] - *pDashOffset;
+ fgPixel = pGC->fgPixel;
+ bgPixel = pGC->bgPixel;
+ if (pGC->fillStyle == FillOpaqueStippled ||
+ pGC->fillStyle == FillTiled)
+ {
+ bgPixel = fgPixel;
+ }
+
+ l = ((double) pGC->lineWidth) / 2.0;
+ if (dx == 0)
+ {
+ L = dy;
+ rdx = 0;
+ rdy = l;
+ if (dy < 0)
+ {
+ L = -dy;
+ rdy = -l;
+ }
+ }
+ else if (dy == 0)
+ {
+ L = dx;
+ rdx = l;
+ rdy = 0;
+ if (dx < 0)
+ {
+ L = -dx;
+ rdx = -l;
+ }
+ }
+ else
+ {
+ L = hypot ((double) dx, (double) dy);
+ r = l / L;
+
+ rdx = r * dx;
+ rdy = r * dy;
+ }
+ k = l * L;
+ LRemain = L;
+ /* All position comments are relative to a line with dx and dy > 0,
+ * but the code does not depend on this */
+ /* top */
+ slopes[V_TOP].dx = dx;
+ slopes[V_TOP].dy = dy;
+ slopes[V_TOP].k = k;
+ /* right */
+ slopes[V_RIGHT].dx = -dy;
+ slopes[V_RIGHT].dy = dx;
+ slopes[V_RIGHT].k = 0;
+ /* bottom */
+ slopes[V_BOTTOM].dx = -dx;
+ slopes[V_BOTTOM].dy = -dy;
+ slopes[V_BOTTOM].k = k;
+ /* left */
+ slopes[V_LEFT].dx = dy;
+ slopes[V_LEFT].dy = -dx;
+ slopes[V_LEFT].k = 0;
+
+ /* preload the start coordinates */
+ vertices[V_RIGHT].x = vertices[V_TOP].x = rdy;
+ vertices[V_RIGHT].y = vertices[V_TOP].y = -rdx;
+
+ vertices[V_BOTTOM].x = vertices[V_LEFT].x = -rdy;
+ vertices[V_BOTTOM].y = vertices[V_LEFT].y = rdx;
+
+ if (projectLeft)
+ {
+ vertices[V_TOP].x -= rdx;
+ vertices[V_TOP].y -= rdy;
+
+ vertices[V_LEFT].x -= rdx;
+ vertices[V_LEFT].y -= rdy;
+
+ slopes[V_LEFT].k = rdx * dx + rdy * dy;
+ }
+
+ lcenterx = x1;
+ lcentery = y1;
+
+ if (pGC->capStyle == CapRound)
+ {
+ lcapFace.dx = dx;
+ lcapFace.dy = dy;
+ lcapFace.x = x1;
+ lcapFace.y = y1;
+
+ rcapFace.dx = -dx;
+ rcapFace.dy = -dy;
+ rcapFace.x = x1;
+ rcapFace.y = y1;
+ }
+ while (LRemain > dashRemain)
+ {
+ dashDx = (dashRemain * dx) / L;
+ dashDy = (dashRemain * dy) / L;
+
+ rcenterx = lcenterx + dashDx;
+ rcentery = lcentery + dashDy;
+
+ vertices[V_RIGHT].x += dashDx;
+ vertices[V_RIGHT].y += dashDy;
+
+ vertices[V_BOTTOM].x += dashDx;
+ vertices[V_BOTTOM].y += dashDy;
+
+ slopes[V_RIGHT].k = vertices[V_RIGHT].x * dx + vertices[V_RIGHT].y * dy;
+
+ if (pGC->lineStyle == LineDoubleDash || !(dashIndex & 1))
+ {
+ if (pGC->lineStyle == LineOnOffDash &&
+ pGC->capStyle == CapProjecting)
+ {
+ saveRight = vertices[V_RIGHT];
+ saveBottom = vertices[V_BOTTOM];
+ saveK = slopes[V_RIGHT].k;
+
+ if (!first)
+ {
+ vertices[V_TOP].x -= rdx;
+ vertices[V_TOP].y -= rdy;
+
+ vertices[V_LEFT].x -= rdx;
+ vertices[V_LEFT].y -= rdy;
+
+ slopes[V_LEFT].k = vertices[V_LEFT].x *
+ slopes[V_LEFT].dy -
+ vertices[V_LEFT].y *
+ slopes[V_LEFT].dx;
+ }
+
+ vertices[V_RIGHT].x += rdx;
+ vertices[V_RIGHT].y += rdy;
+
+ vertices[V_BOTTOM].x += rdx;
+ vertices[V_BOTTOM].y += rdy;
+
+ slopes[V_RIGHT].k = vertices[V_RIGHT].x *
+ slopes[V_RIGHT].dy -
+ vertices[V_RIGHT].y *
+ slopes[V_RIGHT].dx;
+ }
+ y = miPolyBuildPoly (vertices, slopes, 4, x1, y1,
+ left, right, &nleft, &nright, &h);
+ pixel = (dashIndex & 1) ? bgPixel : fgPixel;
+ miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, h, left, right, nleft, nright);
+
+ if (pGC->lineStyle == LineOnOffDash)
+ {
+ switch (pGC->capStyle)
+ {
+ case CapProjecting:
+ vertices[V_BOTTOM] = saveBottom;
+ vertices[V_RIGHT] = saveRight;
+ slopes[V_RIGHT].k = saveK;
+ break;
+ case CapRound:
+ if (!first)
+ {
+ if (dx < 0)
+ {
+ lcapFace.xa = -vertices[V_LEFT].x;
+ lcapFace.ya = -vertices[V_LEFT].y;
+ lcapFace.k = slopes[V_LEFT].k;
+ }
+ else
+ {
+ lcapFace.xa = vertices[V_TOP].x;
+ lcapFace.ya = vertices[V_TOP].y;
+ lcapFace.k = -slopes[V_LEFT].k;
+ }
+ miLineArc (pDrawable, pGC, pixel, spanData,
+ &lcapFace, (LineFacePtr) NULL,
+ lcenterx, lcentery, FALSE);
+ }
+ if (dx < 0)
+ {
+ rcapFace.xa = vertices[V_BOTTOM].x;
+ rcapFace.ya = vertices[V_BOTTOM].y;
+ rcapFace.k = slopes[V_RIGHT].k;
+ }
+ else
+ {
+ rcapFace.xa = -vertices[V_RIGHT].x;
+ rcapFace.ya = -vertices[V_RIGHT].y;
+ rcapFace.k = -slopes[V_RIGHT].k;
+ }
+ miLineArc (pDrawable, pGC, pixel, spanData,
+ (LineFacePtr) NULL, &rcapFace,
+ rcenterx, rcentery, FALSE);
+ break;
+ }
+ }
+ }
+ LRemain -= dashRemain;
+ ++dashIndex;
+ if (dashIndex == pGC->numInDashList)
+ dashIndex = 0;
+ dashRemain = pDash[dashIndex];
+
+ lcenterx = rcenterx;
+ lcentery = rcentery;
+
+ vertices[V_TOP] = vertices[V_RIGHT];
+ vertices[V_LEFT] = vertices[V_BOTTOM];
+ slopes[V_LEFT].k = -slopes[V_RIGHT].k;
+ first = FALSE;
+ }
+
+ if (pGC->lineStyle == LineDoubleDash || !(dashIndex & 1))
+ {
+ vertices[V_TOP].x -= dx;
+ vertices[V_TOP].y -= dy;
+
+ vertices[V_LEFT].x -= dx;
+ vertices[V_LEFT].y -= dy;
+
+ vertices[V_RIGHT].x = rdy;
+ vertices[V_RIGHT].y = -rdx;
+
+ vertices[V_BOTTOM].x = -rdy;
+ vertices[V_BOTTOM].y = rdx;
+
+
+ if (projectRight)
+ {
+ vertices[V_RIGHT].x += rdx;
+ vertices[V_RIGHT].y += rdy;
+
+ vertices[V_BOTTOM].x += rdx;
+ vertices[V_BOTTOM].y += rdy;
+ slopes[V_RIGHT].k = vertices[V_RIGHT].x *
+ slopes[V_RIGHT].dy -
+ vertices[V_RIGHT].y *
+ slopes[V_RIGHT].dx;
+ }
+ else
+ slopes[V_RIGHT].k = 0;
+
+ if (!first && pGC->lineStyle == LineOnOffDash &&
+ pGC->capStyle == CapProjecting)
+ {
+ vertices[V_TOP].x -= rdx;
+ vertices[V_TOP].y -= rdy;
+
+ vertices[V_LEFT].x -= rdx;
+ vertices[V_LEFT].y -= rdy;
+ slopes[V_LEFT].k = vertices[V_LEFT].x *
+ slopes[V_LEFT].dy -
+ vertices[V_LEFT].y *
+ slopes[V_LEFT].dx;
+ }
+ else
+ slopes[V_LEFT].k += dx * dx + dy * dy;
+
+
+ y = miPolyBuildPoly (vertices, slopes, 4, x2, y2,
+ left, right, &nleft, &nright, &h);
+
+ pixel = (dashIndex & 1) ? pGC->bgPixel : pGC->fgPixel;
+ miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, h, left, right, nleft, nright);
+ if (!first && pGC->lineStyle == LineOnOffDash &&
+ pGC->capStyle == CapRound)
+ {
+ lcapFace.x = x2;
+ lcapFace.y = y2;
+ if (dx < 0)
+ {
+ lcapFace.xa = -vertices[V_LEFT].x;
+ lcapFace.ya = -vertices[V_LEFT].y;
+ lcapFace.k = slopes[V_LEFT].k;
+ }
+ else
+ {
+ lcapFace.xa = vertices[V_TOP].x;
+ lcapFace.ya = vertices[V_TOP].y;
+ lcapFace.k = -slopes[V_LEFT].k;
+ }
+ miLineArc (pDrawable, pGC, pixel, spanData,
+ &lcapFace, (LineFacePtr) NULL,
+ rcenterx, rcentery, FALSE);
+ }
+ }
+ dashRemain = ((double) dashRemain) - LRemain;
+ if (dashRemain == 0)
+ {
+ dashIndex++;
+ if (dashIndex == pGC->numInDashList)
+ dashIndex = 0;
+ dashRemain = pDash[dashIndex];
+ }
+
+ leftFace->x = x1;
+ leftFace->y = y1;
+ leftFace->dx = dx;
+ leftFace->dy = dy;
+ leftFace->xa = rdy;
+ leftFace->ya = -rdx;
+ leftFace->k = k;
+
+ rightFace->x = x2;
+ rightFace->y = y2;
+ rightFace->dx = -dx;
+ rightFace->dy = -dy;
+ rightFace->xa = -rdy;
+ rightFace->ya = rdx;
+ rightFace->k = k;
+
+ *pDashIndex = dashIndex;
+ *pDashOffset = pDash[dashIndex] - dashRemain;
+}
+
+void
+miWideDash (DrawablePtr pDrawable, GCPtr pGC,
+ int mode, int npt, DDXPointPtr pPts)
+{
+ int x1, y1, x2, y2;
+ unsigned long pixel;
+ Bool projectLeft, projectRight;
+ LineFaceRec leftFace, rightFace, prevRightFace;
+ LineFaceRec firstFace;
+ int first;
+ int dashIndex, dashOffset;
+ int prevDashIndex;
+ SpanDataRec spanDataRec;
+ SpanDataPtr spanData;
+ Bool somethingDrawn = FALSE;
+ Bool selfJoin;
+ Bool endIsFg = FALSE, startIsFg = FALSE;
+ Bool firstIsFg = FALSE, prevIsFg = FALSE;
+
+#if 0
+ /* XXX backward compatibility */
+ if (pGC->lineWidth == 0)
+ {
+ miZeroDashLine (pDrawable, pGC, mode, npt, pPts);
+ return;
+ }
+#endif
+ if (pGC->lineStyle == LineDoubleDash &&
+ (pGC->fillStyle == FillOpaqueStippled || pGC->fillStyle == FillTiled))
+ {
+ miWideLine (pDrawable, pGC, mode, npt, pPts);
+ return;
+ }
+ if (npt == 0)
+ return;
+ spanData = miSetupSpanData (pGC, &spanDataRec, npt);
+ x2 = pPts->x;
+ y2 = pPts->y;
+ first = TRUE;
+ selfJoin = FALSE;
+ if (mode == CoordModePrevious)
+ {
+ int nptTmp;
+ DDXPointPtr pPtsTmp;
+
+ x1 = x2;
+ y1 = y2;
+ nptTmp = npt;
+ pPtsTmp = pPts + 1;
+ while (--nptTmp)
+ {
+ x1 += pPtsTmp->x;
+ y1 += pPtsTmp->y;
+ ++pPtsTmp;
+ }
+ if (x2 == x1 && y2 == y1)
+ selfJoin = TRUE;
+ }
+ else if (x2 == pPts[npt-1].x && y2 == pPts[npt-1].y)
+ {
+ selfJoin = TRUE;
+ }
+ projectLeft = pGC->capStyle == CapProjecting && !selfJoin;
+ projectRight = FALSE;
+ dashIndex = 0;
+ dashOffset = 0;
+ miStepDash ((int)pGC->dashOffset, &dashIndex,
+ pGC->dash, (int)pGC->numInDashList, &dashOffset);
+ while (--npt)
+ {
+ x1 = x2;
+ y1 = y2;
+ ++pPts;
+ x2 = pPts->x;
+ y2 = pPts->y;
+ if (mode == CoordModePrevious)
+ {
+ x2 += x1;
+ y2 += y1;
+ }
+ if (x1 != x2 || y1 != y2)
+ {
+ somethingDrawn = TRUE;
+ if (npt == 1 && pGC->capStyle == CapProjecting &&
+ (!selfJoin || !firstIsFg))
+ projectRight = TRUE;
+ prevDashIndex = dashIndex;
+ miWideDashSegment (pDrawable, pGC, spanData, &dashOffset, &dashIndex,
+ x1, y1, x2, y2,
+ projectLeft, projectRight, &leftFace, &rightFace);
+ startIsFg = !(prevDashIndex & 1);
+ endIsFg = (dashIndex & 1) ^ (dashOffset != 0);
+ if (pGC->lineStyle == LineDoubleDash || startIsFg)
+ {
+ pixel = startIsFg ? pGC->fgPixel : pGC->bgPixel;
+ if (first || (pGC->lineStyle == LineOnOffDash && !prevIsFg))
+ {
+ if (first && selfJoin)
+ {
+ firstFace = leftFace;
+ firstIsFg = startIsFg;
+ }
+ else if (pGC->capStyle == CapRound)
+ miLineArc (pDrawable, pGC, pixel, spanData,
+ &leftFace, (LineFacePtr) NULL,
+ (double)0.0, (double)0.0, TRUE);
+ }
+ else
+ {
+ miLineJoin (pDrawable, pGC, pixel, spanData, &leftFace,
+ &prevRightFace);
+ }
+ }
+ prevRightFace = rightFace;
+ prevIsFg = endIsFg;
+ first = FALSE;
+ projectLeft = FALSE;
+ }
+ if (npt == 1 && somethingDrawn)
+ {
+ if (pGC->lineStyle == LineDoubleDash || endIsFg)
+ {
+ pixel = endIsFg ? pGC->fgPixel : pGC->bgPixel;
+ if (selfJoin && (pGC->lineStyle == LineDoubleDash || firstIsFg))
+ {
+ miLineJoin (pDrawable, pGC, pixel, spanData, &firstFace,
+ &rightFace);
+ }
+ else
+ {
+ if (pGC->capStyle == CapRound)
+ miLineArc (pDrawable, pGC, pixel, spanData,
+ (LineFacePtr) NULL, &rightFace,
+ (double)0.0, (double)0.0, TRUE);
+ }
+ }
+ else
+ {
+ /* glue a cap to the start of the line if
+ * we're OnOffDash and ended on odd dash
+ */
+ if (selfJoin && firstIsFg)
+ {
+ pixel = pGC->fgPixel;
+ if (pGC->capStyle == CapProjecting)
+ miLineProjectingCap (pDrawable, pGC, pixel, spanData,
+ &firstFace, TRUE,
+ (double)0.0, (double)0.0, TRUE);
+ else if (pGC->capStyle == CapRound)
+ miLineArc (pDrawable, pGC, pixel, spanData,
+ &firstFace, (LineFacePtr) NULL,
+ (double)0.0, (double)0.0, TRUE);
+ }
+ }
+ }
+ }
+ /* handle crock where all points are coincident */
+ if (!somethingDrawn && (pGC->lineStyle == LineDoubleDash || !(dashIndex & 1)))
+ {
+ /* not the same as endIsFg computation above */
+ pixel = (dashIndex & 1) ? pGC->bgPixel : pGC->fgPixel;
+ switch (pGC->capStyle) {
+ case CapRound:
+ miLineArc (pDrawable, pGC, pixel, spanData,
+ (LineFacePtr) NULL, (LineFacePtr) NULL,
+ (double)x2, (double)y2,
+ FALSE);
+ break;
+ case CapProjecting:
+ x1 = pGC->lineWidth;
+ miFillRectPolyHelper (pDrawable, pGC, pixel, spanData,
+ x2 - (x1 >> 1), y2 - (x1 >> 1), x1, x1);
+ break;
+ }
+ }
+ if (spanData)
+ miCleanupSpanData (pDrawable, pGC, spanData);
+}
diff --git a/xorg-server/os/connection.c b/xorg-server/os/connection.c
index 9fe171cb8..cc5a4d3f5 100644
--- a/xorg-server/os/connection.c
+++ b/xorg-server/os/connection.c
@@ -934,9 +934,9 @@ ErrorConnMax(XtransConnInfo trans_conn)
if (((*(char *) &whichbyte) && (byteOrder == 'B')) ||
(!(*(char *) &whichbyte) && (byteOrder == 'l')))
{
- swaps(&csp.majorVersion, whichbyte);
- swaps(&csp.minorVersion, whichbyte);
- swaps(&csp.length, whichbyte);
+ swaps(&csp.majorVersion);
+ swaps(&csp.minorVersion);
+ swaps(&csp.length);
}
iov[0].iov_len = sz_xConnSetupPrefix;
iov[0].iov_base = (char *) &csp;
diff --git a/xorg-server/os/io.c b/xorg-server/os/io.c
index d2eb04649..b30f20767 100644
--- a/xorg-server/os/io.c
+++ b/xorg-server/os/io.c
@@ -1,1148 +1,1146 @@
-/***********************************************************
-
-Copyright 1987, 1989, 1998 The Open Group
-
-Permission to use, copy, modify, distribute, and sell this software and its
-documentation for any purpose is hereby granted without fee, provided that
-the above copyright notice appear in all copies and that both that
-copyright notice and this permission notice appear in supporting
-documentation.
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of The Open Group shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from The Open Group.
-
-
-Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
-
- All Rights Reserved
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose and without fee is hereby granted,
-provided that the above copyright notice appear in all copies and that
-both that copyright notice and this permission notice appear in
-supporting documentation, and that the name of Digital not be
-used in advertising or publicity pertaining to distribution of the
-software without specific, written prior permission.
-
-DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
-ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
-DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-SOFTWARE.
-
-
-******************************************************************/
-/*****************************************************************
- * i/o functions
- *
- * WriteToClient, ReadRequestFromClient
- * InsertFakeRequest, ResetCurrentRequest
- *
- *****************************************************************/
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#undef DEBUG_COMMUNICATION
-
-#ifdef WIN32
-#include <X11/Xwinsock.h>
-#endif
-#include <stdio.h>
-#define XSERV_t
-#define TRANS_SERVER
-#define TRANS_REOPEN
-#include <X11/Xtrans/Xtrans.h>
-#include <X11/Xmd.h>
-#include <errno.h>
-#if !defined(WIN32)
-#include <sys/uio.h>
-#endif
-#include <X11/X.h>
-#include <X11/Xproto.h>
-#include "os.h"
-#include "osdep.h"
-#include <X11/Xpoll.h>
-#include "opaque.h"
-#include "dixstruct.h"
-#include "misc.h"
-
-CallbackListPtr ReplyCallback;
-CallbackListPtr FlushCallback;
-
-static ConnectionInputPtr AllocateInputBuffer(void);
-static ConnectionOutputPtr AllocateOutputBuffer(void);
-
-/* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX
- * systems are broken and return EWOULDBLOCK when they should return EAGAIN
- */
-#ifndef WIN32
-#define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK)
-#else /* WIN32 The socket errorcodes differ from the normal errors*/
-#define ETEST(err) (err == EAGAIN || err == WSAEWOULDBLOCK)
-#endif
-
-static Bool CriticalOutputPending;
-static int timesThisConnection = 0;
-static ConnectionInputPtr FreeInputs = (ConnectionInputPtr)NULL;
-static ConnectionOutputPtr FreeOutputs = (ConnectionOutputPtr)NULL;
-static OsCommPtr AvailableInput = (OsCommPtr)NULL;
-
-#define get_req_len(req,cli) ((cli)->swapped ? \
- lswaps((req)->length) : (req)->length)
-
-#include <X11/extensions/bigreqsproto.h>
-
-#define get_big_req_len(req,cli) ((cli)->swapped ? \
- lswapl(((xBigReq *)(req))->length) : \
- ((xBigReq *)(req))->length)
-
-#define MAX_TIMES_PER 10
-
-/*
- * A lot of the code in this file manipulates a ConnectionInputPtr:
- *
- * -----------------------------------------------
- * |------- bufcnt ------->| | |
- * | |- gotnow ->| | |
- * | |-------- needed ------>| |
- * |-----------+--------- size --------+---------->|
- * -----------------------------------------------
- * ^ ^
- * | |
- * buffer bufptr
- *
- * buffer is a pointer to the start of the buffer.
- * bufptr points to the start of the current request.
- * bufcnt counts how many bytes are in the buffer.
- * size is the size of the buffer in bytes.
- *
- * In several of the functions, gotnow and needed are local variables
- * that do the following:
- *
- * gotnow is the number of bytes of the request that we're
- * trying to read that are currently in the buffer.
- * Typically, gotnow = (buffer + bufcnt) - bufptr
- *
- * needed = the length of the request that we're trying to
- * read. Watch out: needed sometimes counts bytes and sometimes
- * counts CARD32's.
- */
-
-
-/*****************************************************************
- * ReadRequestFromClient
- * Returns one request in client->requestBuffer. The request
- * length will be in client->req_len. Return status is:
- *
- * > 0 if successful, specifies length in bytes of the request
- * = 0 if entire request is not yet available
- * < 0 if client should be terminated
- *
- * The request returned must be contiguous so that it can be
- * cast in the dispatcher to the correct request type. Because requests
- * are variable length, ReadRequestFromClient() must look at the first 4
- * or 8 bytes of a request to determine the length (the request length is
- * in the 3rd and 4th bytes of the request unless it is a Big Request
- * (see the Big Request Extension), in which case the 3rd and 4th bytes
- * are zero and the following 4 bytes are the request length.
- *
- * Note: in order to make the server scheduler (WaitForSomething())
- * "fair", the ClientsWithInput mask is used. This mask tells which
- * clients have FULL requests left in their buffers. Clients with
- * partial requests require a read. Basically, client buffers
- * are drained before select() is called again. But, we can't keep
- * reading from a client that is sending buckets of data (or has
- * a partial request) because others clients need to be scheduled.
- *****************************************************************/
-
-static void
-YieldControl(void)
-{
- isItTimeToYield = TRUE;
- timesThisConnection = 0;
-}
-
-static void
-YieldControlNoInput(int fd)
-{
- YieldControl();
- FD_CLR(fd, &ClientsWithInput);
-}
-
-static void
-YieldControlDeath(void)
-{
- timesThisConnection = 0;
-}
-
-int
-ReadRequestFromClient(ClientPtr client)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- ConnectionInputPtr oci = oc->input;
- int fd = oc->fd;
- unsigned int gotnow, needed;
- int result;
- register xReq *request;
- Bool need_header;
- Bool move_header;
-
- /* If an input buffer was empty, either free it if it is too big
- * or link it into our list of free input buffers. This means that
- * different clients can share the same input buffer (at different
- * times). This was done to save memory.
- */
-
- if (AvailableInput)
- {
- if (AvailableInput != oc)
- {
- register ConnectionInputPtr aci = AvailableInput->input;
- if (aci->size > BUFWATERMARK)
- {
- free(aci->buffer);
- free(aci);
- }
- else
- {
- aci->next = FreeInputs;
- FreeInputs = aci;
- }
- AvailableInput->input = (ConnectionInputPtr)NULL;
- }
- AvailableInput = (OsCommPtr)NULL;
- }
-
- /* make sure we have an input buffer */
-
- if (!oci)
- {
- if ((oci = FreeInputs))
- {
- FreeInputs = oci->next;
- }
- else if (!(oci = AllocateInputBuffer()))
- {
- YieldControlDeath();
- return -1;
- }
- oc->input = oci;
- }
-
- /* advance to start of next request */
-
- oci->bufptr += oci->lenLastReq;
-
- need_header = FALSE;
- move_header = FALSE;
- gotnow = oci->bufcnt + oci->buffer - oci->bufptr;
-
- if (oci->ignoreBytes > 0) {
- if (oci->ignoreBytes > oci->size)
- needed = oci->size;
- else
- needed = oci->ignoreBytes;
- }
- else if (gotnow < sizeof(xReq))
- {
- /* We don't have an entire xReq yet. Can't tell how big
- * the request will be until we get the whole xReq.
- */
- needed = sizeof(xReq);
- need_header = TRUE;
- }
- else
- {
- /* We have a whole xReq. We can tell how big the whole
- * request will be unless it is a Big Request.
- */
- request = (xReq *)oci->bufptr;
- needed = get_req_len(request, client);
- if (!needed && client->big_requests)
- {
- /* It's a Big Request. */
- move_header = TRUE;
- if (gotnow < sizeof(xBigReq))
- {
- /* Still need more data to tell just how big. */
- needed = bytes_to_int32(sizeof(xBigReq)); /* needed is in CARD32s now */
- need_header = TRUE;
- }
- else
- needed = get_big_req_len(request, client);
- }
- client->req_len = needed;
- needed <<= 2; /* needed is in bytes now */
- }
- if (gotnow < needed)
- {
- /* Need to read more data, either so that we can get a
- * complete xReq (if need_header is TRUE), a complete
- * xBigReq (if move_header is TRUE), or the rest of the
- * request (if need_header and move_header are both FALSE).
- */
-
- oci->lenLastReq = 0;
- if (needed > maxBigRequestSize << 2)
- {
- /* request is too big for us to handle */
- /*
- * Mark the rest of it as needing to be ignored, and then return
- * the full size. Dispatch() will turn it into a BadLength error.
- */
- oci->ignoreBytes = needed - gotnow;
- oci->lenLastReq = gotnow;
- return needed;
- }
- if ((gotnow == 0) ||
- ((oci->bufptr - oci->buffer + needed) > oci->size))
- {
- /* no data, or the request is too big to fit in the buffer */
-
- if ((gotnow > 0) && (oci->bufptr != oci->buffer))
- /* save the data we've already read */
- memmove(oci->buffer, oci->bufptr, gotnow);
- if (needed > oci->size)
- {
- /* make buffer bigger to accomodate request */
- char *ibuf;
-
- ibuf = (char *)realloc(oci->buffer, needed);
- if (!ibuf)
- {
- YieldControlDeath();
- return -1;
- }
- oci->size = needed;
- oci->buffer = ibuf;
- }
- oci->bufptr = oci->buffer;
- oci->bufcnt = gotnow;
- }
- /* XXX this is a workaround. This function is sometimes called
- * after the trans_conn has been freed. In this case trans_conn
- * will be null. Really ought to restructure things so that we
- * never get here in those circumstances.
- */
- if (!oc->trans_conn)
- {
- /* treat as if an error occured on the read, which is what
- * used to happen
- */
- YieldControlDeath();
- return -1;
- }
- result = _XSERVTransRead(oc->trans_conn, oci->buffer + oci->bufcnt,
- oci->size - oci->bufcnt);
- if (result <= 0)
- {
- if ((result < 0) && ETEST(errno))
- {
-#if defined(SVR4) && defined(__i386__) && !defined(sun)
- if (0)
-#endif
- {
- YieldControlNoInput(fd);
- return 0;
- }
- }
- YieldControlDeath();
- return -1;
- }
- oci->bufcnt += result;
- gotnow += result;
- /* free up some space after huge requests */
- if ((oci->size > BUFWATERMARK) &&
- (oci->bufcnt < BUFSIZE) && (needed < BUFSIZE))
- {
- char *ibuf;
-
- ibuf = (char *)realloc(oci->buffer, BUFSIZE);
- if (ibuf)
- {
- oci->size = BUFSIZE;
- oci->buffer = ibuf;
- oci->bufptr = ibuf + oci->bufcnt - gotnow;
- }
- }
- if (need_header && gotnow >= needed)
- {
- /* We wanted an xReq, now we've gotten it. */
- request = (xReq *)oci->bufptr;
- needed = get_req_len(request, client);
- if (!needed && client->big_requests)
- {
- move_header = TRUE;
- if (gotnow < sizeof(xBigReq))
- needed = bytes_to_int32(sizeof(xBigReq));
- else
- needed = get_big_req_len(request, client);
- }
- client->req_len = needed;
- needed <<= 2;
- }
- if (gotnow < needed)
- {
- /* Still don't have enough; punt. */
- YieldControlNoInput(fd);
- return 0;
- }
- }
- if (needed == 0)
- {
- if (client->big_requests)
- needed = sizeof(xBigReq);
- else
- needed = sizeof(xReq);
- }
-
- /* If there are bytes to ignore, ignore them now. */
-
- if (oci->ignoreBytes > 0) {
- assert(needed == oci->ignoreBytes || needed == oci->size);
- /*
- * The _XSERVTransRead call above may return more or fewer bytes than we
- * want to ignore. Ignore the smaller of the two sizes.
- */
- if (gotnow < needed) {
- oci->ignoreBytes -= gotnow;
- oci->bufptr += gotnow;
- gotnow = 0;
- } else {
- oci->ignoreBytes -= needed;
- oci->bufptr += needed;
- gotnow -= needed;
- }
- needed = 0;
- }
-
- oci->lenLastReq = needed;
-
- /*
- * Check to see if client has at least one whole request in the
- * buffer beyond the request we're returning to the caller.
- * If there is only a partial request, treat like buffer
- * is empty so that select() will be called again and other clients
- * can get into the queue.
- */
-
- gotnow -= needed;
- if (gotnow >= sizeof(xReq))
- {
- request = (xReq *)(oci->bufptr + needed);
- if (gotnow >= (result = (get_req_len(request, client) << 2))
- && (result ||
- (client->big_requests &&
- (gotnow >= sizeof(xBigReq) &&
- gotnow >= (get_big_req_len(request, client) << 2))))
- )
- FD_SET(fd, &ClientsWithInput);
- else
- {
- if (!SmartScheduleDisable)
- FD_CLR(fd, &ClientsWithInput);
- else
- YieldControlNoInput(fd);
- }
- }
- else
- {
- if (!gotnow)
- AvailableInput = oc;
- if (!SmartScheduleDisable)
- FD_CLR(fd, &ClientsWithInput);
- else
- YieldControlNoInput(fd);
- }
- if (SmartScheduleDisable)
- if (++timesThisConnection >= MAX_TIMES_PER)
- YieldControl();
- if (move_header)
- {
- request = (xReq *)oci->bufptr;
- oci->bufptr += (sizeof(xBigReq) - sizeof(xReq));
- *(xReq *)oci->bufptr = *request;
- oci->lenLastReq -= (sizeof(xBigReq) - sizeof(xReq));
- client->req_len -= bytes_to_int32(sizeof(xBigReq) - sizeof(xReq));
- }
- client->requestBuffer = (pointer)oci->bufptr;
-#ifdef DEBUG_COMMUNICATION
- {
- xReq *req = client->requestBuffer;
- ErrorF("REQUEST: ClientIDX: %i, type: 0x%x data: 0x%x len: %i\n",
- client->index,req->reqType,req->data,req->length);
- }
-#endif
- return needed;
-}
-
-/*****************************************************************
- * InsertFakeRequest
- * Splice a consed up (possibly partial) request in as the next request.
- *
- **********************/
-
-Bool
-InsertFakeRequest(ClientPtr client, char *data, int count)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- ConnectionInputPtr oci = oc->input;
- int fd = oc->fd;
- int gotnow, moveup;
-
- if (AvailableInput)
- {
- if (AvailableInput != oc)
- {
- ConnectionInputPtr aci = AvailableInput->input;
- if (aci->size > BUFWATERMARK)
- {
- free(aci->buffer);
- free(aci);
- }
- else
- {
- aci->next = FreeInputs;
- FreeInputs = aci;
- }
- AvailableInput->input = (ConnectionInputPtr)NULL;
- }
- AvailableInput = (OsCommPtr)NULL;
- }
- if (!oci)
- {
- if ((oci = FreeInputs))
- FreeInputs = oci->next;
- else if (!(oci = AllocateInputBuffer()))
- return FALSE;
- oc->input = oci;
- }
- oci->bufptr += oci->lenLastReq;
- oci->lenLastReq = 0;
- gotnow = oci->bufcnt + oci->buffer - oci->bufptr;
- if ((gotnow + count) > oci->size)
- {
- char *ibuf;
-
- ibuf = (char *)realloc(oci->buffer, gotnow + count);
- if (!ibuf)
- return FALSE;
- oci->size = gotnow + count;
- oci->buffer = ibuf;
- oci->bufptr = ibuf + oci->bufcnt - gotnow;
- }
- moveup = count - (oci->bufptr - oci->buffer);
- if (moveup > 0)
- {
- if (gotnow > 0)
- memmove(oci->bufptr + moveup, oci->bufptr, gotnow);
- oci->bufptr += moveup;
- oci->bufcnt += moveup;
- }
- memmove(oci->bufptr - count, data, count);
- oci->bufptr -= count;
- gotnow += count;
- if ((gotnow >= sizeof(xReq)) &&
- (gotnow >= (int)(get_req_len((xReq *)oci->bufptr, client) << 2)))
- FD_SET(fd, &ClientsWithInput);
- else
- YieldControlNoInput(fd);
- return TRUE;
-}
-
-/*****************************************************************
- * ResetRequestFromClient
- * Reset to reexecute the current request, and yield.
- *
- **********************/
-
-void
-ResetCurrentRequest(ClientPtr client)
-{
- OsCommPtr oc = (OsCommPtr)client->osPrivate;
- register ConnectionInputPtr oci = oc->input;
- int fd = oc->fd;
- register xReq *request;
- int gotnow, needed;
- if (AvailableInput == oc)
- AvailableInput = (OsCommPtr)NULL;
- oci->lenLastReq = 0;
- gotnow = oci->bufcnt + oci->buffer - oci->bufptr;
- if (gotnow < sizeof(xReq))
- {
- YieldControlNoInput(fd);
- }
- else
- {
- request = (xReq *)oci->bufptr;
- needed = get_req_len(request, client);
- if (!needed && client->big_requests)
- {
- oci->bufptr -= sizeof(xBigReq) - sizeof(xReq);
- *(xReq *)oci->bufptr = *request;
- ((xBigReq *)oci->bufptr)->length = client->req_len;
- if (client->swapped)
- {
- char n;
- swapl(&((xBigReq *)oci->bufptr)->length, n);
- }
- }
- if (gotnow >= (needed << 2))
- {
- if (FD_ISSET(fd, &AllClients))
- {
- FD_SET(fd, &ClientsWithInput);
- }
- else
- {
- FD_SET(fd, &IgnoredClientsWithInput);
- }
- YieldControl();
- }
- else
- YieldControlNoInput(fd);
- }
-}
-
-static const int padlength[4] = {0, 3, 2, 1};
-
- /********************
- * FlushAllOutput()
- * Flush all clients with output. However, if some client still
- * has input in the queue (more requests), then don't flush. This
- * will prevent the output queue from being flushed every time around
- * the round robin queue. Now, some say that it SHOULD be flushed
- * every time around, but...
- *
- **********************/
-
-void
-FlushAllOutput(void)
-{
- register int index, base;
- register fd_mask mask; /* raphael */
- OsCommPtr oc;
- register ClientPtr client;
- Bool newoutput = NewOutputPending;
-#if defined(WIN32)
- fd_set newOutputPending;
-#endif
-
- if (FlushCallback)
- CallCallbacks(&FlushCallback, NULL);
-
- if (!newoutput)
- return;
-
- /*
- * It may be that some client still has critical output pending,
- * but he is not yet ready to receive it anyway, so we will
- * simply wait for the select to tell us when he's ready to receive.
- */
- CriticalOutputPending = FALSE;
- NewOutputPending = FALSE;
-
-#ifndef WIN32
- for (base = 0; base < howmany(XFD_SETSIZE, NFDBITS); base++)
- {
- mask = OutputPending.fds_bits[ base ];
- OutputPending.fds_bits[ base ] = 0;
- while (mask)
- {
- index = ffs(mask) - 1;
- mask &= ~lowbit(mask);
- if ((index = ConnectionTranslation[(base * (sizeof(fd_mask)*8)) + index]) == 0)
- continue;
- client = clients[index];
- if (client->clientGone)
- continue;
- oc = (OsCommPtr)client->osPrivate;
- if (FD_ISSET(oc->fd, &ClientsWithInput))
- {
- FD_SET(oc->fd, &OutputPending); /* set the bit again */
- NewOutputPending = TRUE;
- }
- else
- (void)FlushClient(client, oc, (char *)NULL, 0);
- }
- }
-#else /* WIN32 */
- FD_ZERO(&newOutputPending);
- for (base = 0; base < XFD_SETCOUNT(&OutputPending); base++)
- {
- index = XFD_FD(&OutputPending, base);
- if ((index = GetConnectionTranslation(index)) == 0)
- continue;
- client = clients[index];
- if (client->clientGone)
- continue;
- oc = (OsCommPtr)client->osPrivate;
- if (FD_ISSET(oc->fd, &ClientsWithInput))
- {
- FD_SET(oc->fd, &newOutputPending); /* set the bit again */
- NewOutputPending = TRUE;
- }
- else
- (void)FlushClient(client, oc, (char *)NULL, 0);
- }
- XFD_COPYSET(&newOutputPending, &OutputPending);
-#endif /* WIN32 */
-}
-
-void
-FlushIfCriticalOutputPending(void)
-{
- if (CriticalOutputPending)
- FlushAllOutput();
-}
-
-void
-SetCriticalOutputPending(void)
-{
- CriticalOutputPending = TRUE;
-}
-
-/*****************
- * WriteToClient
- * Copies buf into ClientPtr.buf if it fits (with padding), else
- * flushes ClientPtr.buf and buf to client. As of this writing,
- * every use of WriteToClient is cast to void, and the result
- * is ignored. Potentially, this could be used by requests
- * that are sending several chunks of data and want to break
- * out of a loop on error. Thus, we will leave the type of
- * this routine as int.
- *****************/
-
-int
-WriteToClient (ClientPtr who, int count, const void *__buf)
-{
- OsCommPtr oc;
- ConnectionOutputPtr oco;
- int padBytes;
- const char *buf = __buf;
-#ifdef DEBUG_COMMUNICATION
- Bool multicount = FALSE;
-#endif
- if (!count || !who || who == serverClient || who->clientGone)
- return 0;
- oc = who->osPrivate;
- oco = oc->output;
-#ifdef DEBUG_COMMUNICATION
- {
- char info[128];
- xError *err;
- xGenericReply *rep;
- xEvent *ev;
-
- if (!who->replyBytesRemaining) {
- switch(buf[0]) {
- case X_Reply:
- rep = (xGenericReply*)buf;
- if (rep->sequenceNumber == who->sequence) {
- snprintf(info,127,"Xreply: type: 0x%x data: 0x%x "
- "len: %i seq#: 0x%x", rep->type, rep->data1,
- rep->length, rep->sequenceNumber);
- multicount = TRUE;
- }
- break;
- case X_Error:
- err = (xError*)buf;
- snprintf(info,127,"Xerror: Code: 0x%x resID: 0x%x maj: 0x%x "
- "min: %x", err->errorCode,err->resourceID,
- err->minorCode,err->majorCode);
- break;
- default:
- if ((buf[0] & 0x7f) == KeymapNotify)
- snprintf(info,127,"KeymapNotifyEvent: %i",buf[0]);
- else {
- ev = (xEvent*)buf;
- snprintf(info,127,"XEvent: type: 0x%x detail: 0x%x "
- "seq#: 0x%x", ev->u.u.type, ev->u.u.detail,
- ev->u.u.sequenceNumber);
- }
- }
- ErrorF("REPLY: ClientIDX: %i %s\n",who->index, info);
- } else
- multicount = TRUE;
- }
-#endif
-
- if (!oco)
- {
- if ((oco = FreeOutputs))
- {
- FreeOutputs = oco->next;
- }
- else if (!(oco = AllocateOutputBuffer()))
- {
- if (oc->trans_conn) {
- _XSERVTransDisconnect(oc->trans_conn);
- _XSERVTransClose(oc->trans_conn);
- oc->trans_conn = NULL;
- }
- MarkClientException(who);
- return -1;
- }
- oc->output = oco;
- }
-
- padBytes = padlength[count & 3];
-
- if(ReplyCallback)
- {
- ReplyInfoRec replyinfo;
-
- replyinfo.client = who;
- replyinfo.replyData = buf;
- replyinfo.dataLenBytes = count + padBytes;
- if (who->replyBytesRemaining)
- { /* still sending data of an earlier reply */
- who->replyBytesRemaining -= count + padBytes;
- replyinfo.startOfReply = FALSE;
- replyinfo.bytesRemaining = who->replyBytesRemaining;
- CallCallbacks((&ReplyCallback), (pointer)&replyinfo);
- }
- else if (who->clientState == ClientStateRunning
- && buf[0] == X_Reply)
- { /* start of new reply */
- CARD32 replylen;
- unsigned long bytesleft;
- char n;
-
- replylen = ((xGenericReply *)buf)->length;
- if (who->swapped)
- swapl(&replylen, n);
- bytesleft = (replylen * 4) + SIZEOF(xReply) - count - padBytes;
- replyinfo.startOfReply = TRUE;
- replyinfo.bytesRemaining = who->replyBytesRemaining = bytesleft;
- CallCallbacks((&ReplyCallback), (pointer)&replyinfo);
- }
- }
-#ifdef DEBUG_COMMUNICATION
- else if (multicount) {
- if (who->replyBytesRemaining) {
- who->replyBytesRemaining -= (count + padBytes);
- } else {
- CARD32 replylen;
- replylen = ((xGenericReply *)buf)->length;
- who->replyBytesRemaining =
- (replylen * 4) + SIZEOF(xReply) - count - padBytes;
- }
- }
-#endif
- if (oco->count + count + padBytes > oco->size)
- {
- FD_CLR(oc->fd, &OutputPending);
- if(!XFD_ANYSET(&OutputPending)) {
- CriticalOutputPending = FALSE;
- NewOutputPending = FALSE;
- }
-
- if (FlushCallback)
- CallCallbacks(&FlushCallback, NULL);
-
- return FlushClient(who, oc, buf, count);
- }
-
- NewOutputPending = TRUE;
- FD_SET(oc->fd, &OutputPending);
- memmove((char *)oco->buf + oco->count, buf, count);
- oco->count += count + padBytes;
- return count;
-}
-
- /********************
- * FlushClient()
- * If the client isn't keeping up with us, then we try to continue
- * buffering the data and set the apropriate bit in ClientsWritable
- * (which is used by WaitFor in the select). If the connection yields
- * a permanent error, or we can't allocate any more space, we then
- * close the connection.
- *
- **********************/
-
-int
-FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
-{
- ConnectionOutputPtr oco = oc->output;
- int connection = oc->fd;
- XtransConnInfo trans_conn = oc->trans_conn;
- struct iovec iov[3];
- static char padBuffer[3];
- const char *extraBuf = __extraBuf;
- long written;
- long padsize;
- long notWritten;
- long todo;
-
- if (!oco)
- return 0;
- written = 0;
- padsize = padlength[extraCount & 3];
- notWritten = oco->count + extraCount + padsize;
- todo = notWritten;
- while (notWritten) {
- long before = written; /* amount of whole thing written */
- long remain = todo; /* amount to try this time, <= notWritten */
- int i = 0;
- long len;
-
- /* You could be very general here and have "in" and "out" iovecs
- * and write a loop without using a macro, but what the heck. This
- * translates to:
- *
- * how much of this piece is new?
- * if more new then we are trying this time, clamp
- * if nothing new
- * then bump down amount already written, for next piece
- * else put new stuff in iovec, will need all of next piece
- *
- * Note that todo had better be at least 1 or else we'll end up
- * writing 0 iovecs.
- */
-#define InsertIOV(pointer, length) \
- len = (length) - before; \
- if (len > remain) \
- len = remain; \
- if (len <= 0) { \
- before = (-len); \
- } else { \
- iov[i].iov_len = len; \
- iov[i].iov_base = (pointer) + before; \
- i++; \
- remain -= len; \
- before = 0; \
- }
-
- InsertIOV ((char *)oco->buf, oco->count)
- InsertIOV ((char *)extraBuf, extraCount)
- InsertIOV (padBuffer, padsize)
-
- errno = 0;
- if (trans_conn && (len = _XSERVTransWritev(trans_conn, iov, i)) >= 0)
- {
- written += len;
- notWritten -= len;
- todo = notWritten;
- }
- else if (ETEST(errno)
-#ifdef SUNSYSV /* check for another brain-damaged OS bug */
- || (errno == 0)
-#endif
-#ifdef EMSGSIZE /* check for another brain-damaged OS bug */
- || ((errno == EMSGSIZE) && (todo == 1))
-#endif
- )
- {
- /* If we've arrived here, then the client is stuffed to the gills
- and not ready to accept more. Make a note of it and buffer
- the rest. */
- errno=0;
- FD_SET(connection, &ClientsWriteBlocked);
- AnyClientsWriteBlocked = TRUE;
-
- if (written < oco->count)
- {
- if (written > 0)
- {
- oco->count -= written;
- memmove((char *)oco->buf,
- (char *)oco->buf + written,
- oco->count);
- written = 0;
- }
- }
- else
- {
- written -= oco->count;
- oco->count = 0;
- }
-
- if (notWritten > oco->size)
- {
- unsigned char *obuf;
-
- obuf = (unsigned char *)realloc(oco->buf,
- notWritten + BUFSIZE);
- if (!obuf)
- {
- _XSERVTransDisconnect(oc->trans_conn);
- _XSERVTransClose(oc->trans_conn);
- oc->trans_conn = NULL;
- MarkClientException(who);
- oco->count = 0;
- return -1;
- }
- oco->size = notWritten + BUFSIZE;
- oco->buf = obuf;
- }
-
- /* If the amount written extended into the padBuffer, then the
- difference "extraCount - written" may be less than 0 */
- if ((len = extraCount - written) > 0)
- memmove ((char *)oco->buf + oco->count,
- extraBuf + written,
- len);
-
- oco->count = notWritten; /* this will include the pad */
- /* return only the amount explicitly requested */
- return extraCount;
- }
-#ifdef EMSGSIZE /* check for another brain-damaged OS bug */
- else if (errno == EMSGSIZE)
- {
- todo >>= 1;
- }
-#endif
- else
- {
- if (oc->trans_conn)
- {
- _XSERVTransDisconnect(oc->trans_conn);
- _XSERVTransClose(oc->trans_conn);
- oc->trans_conn = NULL;
- }
- MarkClientException(who);
- oco->count = 0;
- return -1;
- }
- }
-
- /* everything was flushed out */
- oco->count = 0;
- /* check to see if this client was write blocked */
- if (AnyClientsWriteBlocked)
- {
- FD_CLR(oc->fd, &ClientsWriteBlocked);
- if (! XFD_ANYSET(&ClientsWriteBlocked))
- AnyClientsWriteBlocked = FALSE;
- }
- if (oco->size > BUFWATERMARK)
- {
- free(oco->buf);
- free(oco);
- }
- else
- {
- oco->next = FreeOutputs;
- FreeOutputs = oco;
- }
- oc->output = (ConnectionOutputPtr)NULL;
- return extraCount; /* return only the amount explicitly requested */
-}
-
-static ConnectionInputPtr
-AllocateInputBuffer(void)
-{
- ConnectionInputPtr oci;
-
- oci = malloc(sizeof(ConnectionInput));
- if (!oci)
- return NULL;
- oci->buffer = malloc(BUFSIZE);
- if (!oci->buffer)
- {
- free(oci);
- return NULL;
- }
- oci->size = BUFSIZE;
- oci->bufptr = oci->buffer;
- oci->bufcnt = 0;
- oci->lenLastReq = 0;
- oci->ignoreBytes = 0;
- return oci;
-}
-
-static ConnectionOutputPtr
-AllocateOutputBuffer(void)
-{
- ConnectionOutputPtr oco;
-
- oco = malloc(sizeof(ConnectionOutput));
- if (!oco)
- return NULL;
- oco->buf = calloc(1, BUFSIZE);
- if (!oco->buf)
- {
- free(oco);
- return NULL;
- }
- oco->size = BUFSIZE;
- oco->count = 0;
- return oco;
-}
-
-void
-FreeOsBuffers(OsCommPtr oc)
-{
- ConnectionInputPtr oci;
- ConnectionOutputPtr oco;
-
- if (AvailableInput == oc)
- AvailableInput = (OsCommPtr)NULL;
- if ((oci = oc->input))
- {
- if (FreeInputs)
- {
- free(oci->buffer);
- free(oci);
- }
- else
- {
- FreeInputs = oci;
- oci->next = (ConnectionInputPtr)NULL;
- oci->bufptr = oci->buffer;
- oci->bufcnt = 0;
- oci->lenLastReq = 0;
- }
- }
- if ((oco = oc->output))
- {
- if (FreeOutputs)
- {
- free(oco->buf);
- free(oco);
- }
- else
- {
- FreeOutputs = oco;
- oco->next = (ConnectionOutputPtr)NULL;
- oco->count = 0;
- }
- }
-}
-
-void
-ResetOsBuffers(void)
-{
- ConnectionInputPtr oci;
- ConnectionOutputPtr oco;
-
- while ((oci = FreeInputs))
- {
- FreeInputs = oci->next;
- free(oci->buffer);
- free(oci);
- }
- while ((oco = FreeOutputs))
- {
- FreeOutputs = oco->next;
- free(oco->buf);
- free(oco);
- }
-}
+/***********************************************************
+
+Copyright 1987, 1989, 1998 The Open Group
+
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that
+copyright notice and this permission notice appear in supporting
+documentation.
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of The Open Group shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from The Open Group.
+
+
+Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
+
+ All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Digital not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission.
+
+DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+SOFTWARE.
+
+
+******************************************************************/
+/*****************************************************************
+ * i/o functions
+ *
+ * WriteToClient, ReadRequestFromClient
+ * InsertFakeRequest, ResetCurrentRequest
+ *
+ *****************************************************************/
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#undef DEBUG_COMMUNICATION
+
+#ifdef WIN32
+#include <X11/Xwinsock.h>
+#endif
+#include <stdio.h>
+#define XSERV_t
+#define TRANS_SERVER
+#define TRANS_REOPEN
+#include <X11/Xtrans/Xtrans.h>
+#include <X11/Xmd.h>
+#include <errno.h>
+#if !defined(WIN32)
+#include <sys/uio.h>
+#endif
+#include <X11/X.h>
+#include <X11/Xproto.h>
+#include "os.h"
+#include "osdep.h"
+#include <X11/Xpoll.h>
+#include "opaque.h"
+#include "dixstruct.h"
+#include "misc.h"
+
+CallbackListPtr ReplyCallback;
+CallbackListPtr FlushCallback;
+
+static ConnectionInputPtr AllocateInputBuffer(void);
+static ConnectionOutputPtr AllocateOutputBuffer(void);
+
+/* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX
+ * systems are broken and return EWOULDBLOCK when they should return EAGAIN
+ */
+#ifndef WIN32
+#define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK)
+#else /* WIN32 The socket errorcodes differ from the normal errors*/
+#define ETEST(err) (err == EAGAIN || err == WSAEWOULDBLOCK)
+#endif
+
+static Bool CriticalOutputPending;
+static int timesThisConnection = 0;
+static ConnectionInputPtr FreeInputs = (ConnectionInputPtr)NULL;
+static ConnectionOutputPtr FreeOutputs = (ConnectionOutputPtr)NULL;
+static OsCommPtr AvailableInput = (OsCommPtr)NULL;
+
+#define get_req_len(req,cli) ((cli)->swapped ? \
+ lswaps((req)->length) : (req)->length)
+
+#include <X11/extensions/bigreqsproto.h>
+
+#define get_big_req_len(req,cli) ((cli)->swapped ? \
+ lswapl(((xBigReq *)(req))->length) : \
+ ((xBigReq *)(req))->length)
+
+#define MAX_TIMES_PER 10
+
+/*
+ * A lot of the code in this file manipulates a ConnectionInputPtr:
+ *
+ * -----------------------------------------------
+ * |------- bufcnt ------->| | |
+ * | |- gotnow ->| | |
+ * | |-------- needed ------>| |
+ * |-----------+--------- size --------+---------->|
+ * -----------------------------------------------
+ * ^ ^
+ * | |
+ * buffer bufptr
+ *
+ * buffer is a pointer to the start of the buffer.
+ * bufptr points to the start of the current request.
+ * bufcnt counts how many bytes are in the buffer.
+ * size is the size of the buffer in bytes.
+ *
+ * In several of the functions, gotnow and needed are local variables
+ * that do the following:
+ *
+ * gotnow is the number of bytes of the request that we're
+ * trying to read that are currently in the buffer.
+ * Typically, gotnow = (buffer + bufcnt) - bufptr
+ *
+ * needed = the length of the request that we're trying to
+ * read. Watch out: needed sometimes counts bytes and sometimes
+ * counts CARD32's.
+ */
+
+
+/*****************************************************************
+ * ReadRequestFromClient
+ * Returns one request in client->requestBuffer. The request
+ * length will be in client->req_len. Return status is:
+ *
+ * > 0 if successful, specifies length in bytes of the request
+ * = 0 if entire request is not yet available
+ * < 0 if client should be terminated
+ *
+ * The request returned must be contiguous so that it can be
+ * cast in the dispatcher to the correct request type. Because requests
+ * are variable length, ReadRequestFromClient() must look at the first 4
+ * or 8 bytes of a request to determine the length (the request length is
+ * in the 3rd and 4th bytes of the request unless it is a Big Request
+ * (see the Big Request Extension), in which case the 3rd and 4th bytes
+ * are zero and the following 4 bytes are the request length.
+ *
+ * Note: in order to make the server scheduler (WaitForSomething())
+ * "fair", the ClientsWithInput mask is used. This mask tells which
+ * clients have FULL requests left in their buffers. Clients with
+ * partial requests require a read. Basically, client buffers
+ * are drained before select() is called again. But, we can't keep
+ * reading from a client that is sending buckets of data (or has
+ * a partial request) because others clients need to be scheduled.
+ *****************************************************************/
+
+static void
+YieldControl(void)
+{
+ isItTimeToYield = TRUE;
+ timesThisConnection = 0;
+}
+
+static void
+YieldControlNoInput(int fd)
+{
+ YieldControl();
+ FD_CLR(fd, &ClientsWithInput);
+}
+
+static void
+YieldControlDeath(void)
+{
+ timesThisConnection = 0;
+}
+
+int
+ReadRequestFromClient(ClientPtr client)
+{
+ OsCommPtr oc = (OsCommPtr)client->osPrivate;
+ ConnectionInputPtr oci = oc->input;
+ int fd = oc->fd;
+ unsigned int gotnow, needed;
+ int result;
+ register xReq *request;
+ Bool need_header;
+ Bool move_header;
+
+ /* If an input buffer was empty, either free it if it is too big
+ * or link it into our list of free input buffers. This means that
+ * different clients can share the same input buffer (at different
+ * times). This was done to save memory.
+ */
+
+ if (AvailableInput)
+ {
+ if (AvailableInput != oc)
+ {
+ register ConnectionInputPtr aci = AvailableInput->input;
+ if (aci->size > BUFWATERMARK)
+ {
+ free(aci->buffer);
+ free(aci);
+ }
+ else
+ {
+ aci->next = FreeInputs;
+ FreeInputs = aci;
+ }
+ AvailableInput->input = (ConnectionInputPtr)NULL;
+ }
+ AvailableInput = (OsCommPtr)NULL;
+ }
+
+ /* make sure we have an input buffer */
+
+ if (!oci)
+ {
+ if ((oci = FreeInputs))
+ {
+ FreeInputs = oci->next;
+ }
+ else if (!(oci = AllocateInputBuffer()))
+ {
+ YieldControlDeath();
+ return -1;
+ }
+ oc->input = oci;
+ }
+
+ /* advance to start of next request */
+
+ oci->bufptr += oci->lenLastReq;
+
+ need_header = FALSE;
+ move_header = FALSE;
+ gotnow = oci->bufcnt + oci->buffer - oci->bufptr;
+
+ if (oci->ignoreBytes > 0) {
+ if (oci->ignoreBytes > oci->size)
+ needed = oci->size;
+ else
+ needed = oci->ignoreBytes;
+ }
+ else if (gotnow < sizeof(xReq))
+ {
+ /* We don't have an entire xReq yet. Can't tell how big
+ * the request will be until we get the whole xReq.
+ */
+ needed = sizeof(xReq);
+ need_header = TRUE;
+ }
+ else
+ {
+ /* We have a whole xReq. We can tell how big the whole
+ * request will be unless it is a Big Request.
+ */
+ request = (xReq *)oci->bufptr;
+ needed = get_req_len(request, client);
+ if (!needed && client->big_requests)
+ {
+ /* It's a Big Request. */
+ move_header = TRUE;
+ if (gotnow < sizeof(xBigReq))
+ {
+ /* Still need more data to tell just how big. */
+ needed = bytes_to_int32(sizeof(xBigReq)); /* needed is in CARD32s now */
+ need_header = TRUE;
+ }
+ else
+ needed = get_big_req_len(request, client);
+ }
+ client->req_len = needed;
+ needed <<= 2; /* needed is in bytes now */
+ }
+ if (gotnow < needed)
+ {
+ /* Need to read more data, either so that we can get a
+ * complete xReq (if need_header is TRUE), a complete
+ * xBigReq (if move_header is TRUE), or the rest of the
+ * request (if need_header and move_header are both FALSE).
+ */
+
+ oci->lenLastReq = 0;
+ if (needed > maxBigRequestSize << 2)
+ {
+ /* request is too big for us to handle */
+ /*
+ * Mark the rest of it as needing to be ignored, and then return
+ * the full size. Dispatch() will turn it into a BadLength error.
+ */
+ oci->ignoreBytes = needed - gotnow;
+ oci->lenLastReq = gotnow;
+ return needed;
+ }
+ if ((gotnow == 0) ||
+ ((oci->bufptr - oci->buffer + needed) > oci->size))
+ {
+ /* no data, or the request is too big to fit in the buffer */
+
+ if ((gotnow > 0) && (oci->bufptr != oci->buffer))
+ /* save the data we've already read */
+ memmove(oci->buffer, oci->bufptr, gotnow);
+ if (needed > oci->size)
+ {
+ /* make buffer bigger to accomodate request */
+ char *ibuf;
+
+ ibuf = (char *)realloc(oci->buffer, needed);
+ if (!ibuf)
+ {
+ YieldControlDeath();
+ return -1;
+ }
+ oci->size = needed;
+ oci->buffer = ibuf;
+ }
+ oci->bufptr = oci->buffer;
+ oci->bufcnt = gotnow;
+ }
+ /* XXX this is a workaround. This function is sometimes called
+ * after the trans_conn has been freed. In this case trans_conn
+ * will be null. Really ought to restructure things so that we
+ * never get here in those circumstances.
+ */
+ if (!oc->trans_conn)
+ {
+ /* treat as if an error occured on the read, which is what
+ * used to happen
+ */
+ YieldControlDeath();
+ return -1;
+ }
+ result = _XSERVTransRead(oc->trans_conn, oci->buffer + oci->bufcnt,
+ oci->size - oci->bufcnt);
+ if (result <= 0)
+ {
+ if ((result < 0) && ETEST(errno))
+ {
+#if defined(SVR4) && defined(__i386__) && !defined(sun)
+ if (0)
+#endif
+ {
+ YieldControlNoInput(fd);
+ return 0;
+ }
+ }
+ YieldControlDeath();
+ return -1;
+ }
+ oci->bufcnt += result;
+ gotnow += result;
+ /* free up some space after huge requests */
+ if ((oci->size > BUFWATERMARK) &&
+ (oci->bufcnt < BUFSIZE) && (needed < BUFSIZE))
+ {
+ char *ibuf;
+
+ ibuf = (char *)realloc(oci->buffer, BUFSIZE);
+ if (ibuf)
+ {
+ oci->size = BUFSIZE;
+ oci->buffer = ibuf;
+ oci->bufptr = ibuf + oci->bufcnt - gotnow;
+ }
+ }
+ if (need_header && gotnow >= needed)
+ {
+ /* We wanted an xReq, now we've gotten it. */
+ request = (xReq *)oci->bufptr;
+ needed = get_req_len(request, client);
+ if (!needed && client->big_requests)
+ {
+ move_header = TRUE;
+ if (gotnow < sizeof(xBigReq))
+ needed = bytes_to_int32(sizeof(xBigReq));
+ else
+ needed = get_big_req_len(request, client);
+ }
+ client->req_len = needed;
+ needed <<= 2;
+ }
+ if (gotnow < needed)
+ {
+ /* Still don't have enough; punt. */
+ YieldControlNoInput(fd);
+ return 0;
+ }
+ }
+ if (needed == 0)
+ {
+ if (client->big_requests)
+ needed = sizeof(xBigReq);
+ else
+ needed = sizeof(xReq);
+ }
+
+ /* If there are bytes to ignore, ignore them now. */
+
+ if (oci->ignoreBytes > 0) {
+ assert(needed == oci->ignoreBytes || needed == oci->size);
+ /*
+ * The _XSERVTransRead call above may return more or fewer bytes than we
+ * want to ignore. Ignore the smaller of the two sizes.
+ */
+ if (gotnow < needed) {
+ oci->ignoreBytes -= gotnow;
+ oci->bufptr += gotnow;
+ gotnow = 0;
+ } else {
+ oci->ignoreBytes -= needed;
+ oci->bufptr += needed;
+ gotnow -= needed;
+ }
+ needed = 0;
+ }
+
+ oci->lenLastReq = needed;
+
+ /*
+ * Check to see if client has at least one whole request in the
+ * buffer beyond the request we're returning to the caller.
+ * If there is only a partial request, treat like buffer
+ * is empty so that select() will be called again and other clients
+ * can get into the queue.
+ */
+
+ gotnow -= needed;
+ if (gotnow >= sizeof(xReq))
+ {
+ request = (xReq *)(oci->bufptr + needed);
+ if (gotnow >= (result = (get_req_len(request, client) << 2))
+ && (result ||
+ (client->big_requests &&
+ (gotnow >= sizeof(xBigReq) &&
+ gotnow >= (get_big_req_len(request, client) << 2))))
+ )
+ FD_SET(fd, &ClientsWithInput);
+ else
+ {
+ if (!SmartScheduleDisable)
+ FD_CLR(fd, &ClientsWithInput);
+ else
+ YieldControlNoInput(fd);
+ }
+ }
+ else
+ {
+ if (!gotnow)
+ AvailableInput = oc;
+ if (!SmartScheduleDisable)
+ FD_CLR(fd, &ClientsWithInput);
+ else
+ YieldControlNoInput(fd);
+ }
+ if (SmartScheduleDisable)
+ if (++timesThisConnection >= MAX_TIMES_PER)
+ YieldControl();
+ if (move_header)
+ {
+ request = (xReq *)oci->bufptr;
+ oci->bufptr += (sizeof(xBigReq) - sizeof(xReq));
+ *(xReq *)oci->bufptr = *request;
+ oci->lenLastReq -= (sizeof(xBigReq) - sizeof(xReq));
+ client->req_len -= bytes_to_int32(sizeof(xBigReq) - sizeof(xReq));
+ }
+ client->requestBuffer = (pointer)oci->bufptr;
+#ifdef DEBUG_COMMUNICATION
+ {
+ xReq *req = client->requestBuffer;
+ ErrorF("REQUEST: ClientIDX: %i, type: 0x%x data: 0x%x len: %i\n",
+ client->index,req->reqType,req->data,req->length);
+ }
+#endif
+ return needed;
+}
+
+/*****************************************************************
+ * InsertFakeRequest
+ * Splice a consed up (possibly partial) request in as the next request.
+ *
+ **********************/
+
+Bool
+InsertFakeRequest(ClientPtr client, char *data, int count)
+{
+ OsCommPtr oc = (OsCommPtr)client->osPrivate;
+ ConnectionInputPtr oci = oc->input;
+ int fd = oc->fd;
+ int gotnow, moveup;
+
+ if (AvailableInput)
+ {
+ if (AvailableInput != oc)
+ {
+ ConnectionInputPtr aci = AvailableInput->input;
+ if (aci->size > BUFWATERMARK)
+ {
+ free(aci->buffer);
+ free(aci);
+ }
+ else
+ {
+ aci->next = FreeInputs;
+ FreeInputs = aci;
+ }
+ AvailableInput->input = (ConnectionInputPtr)NULL;
+ }
+ AvailableInput = (OsCommPtr)NULL;
+ }
+ if (!oci)
+ {
+ if ((oci = FreeInputs))
+ FreeInputs = oci->next;
+ else if (!(oci = AllocateInputBuffer()))
+ return FALSE;
+ oc->input = oci;
+ }
+ oci->bufptr += oci->lenLastReq;
+ oci->lenLastReq = 0;
+ gotnow = oci->bufcnt + oci->buffer - oci->bufptr;
+ if ((gotnow + count) > oci->size)
+ {
+ char *ibuf;
+
+ ibuf = (char *)realloc(oci->buffer, gotnow + count);
+ if (!ibuf)
+ return FALSE;
+ oci->size = gotnow + count;
+ oci->buffer = ibuf;
+ oci->bufptr = ibuf + oci->bufcnt - gotnow;
+ }
+ moveup = count - (oci->bufptr - oci->buffer);
+ if (moveup > 0)
+ {
+ if (gotnow > 0)
+ memmove(oci->bufptr + moveup, oci->bufptr, gotnow);
+ oci->bufptr += moveup;
+ oci->bufcnt += moveup;
+ }
+ memmove(oci->bufptr - count, data, count);
+ oci->bufptr -= count;
+ gotnow += count;
+ if ((gotnow >= sizeof(xReq)) &&
+ (gotnow >= (int)(get_req_len((xReq *)oci->bufptr, client) << 2)))
+ FD_SET(fd, &ClientsWithInput);
+ else
+ YieldControlNoInput(fd);
+ return TRUE;
+}
+
+/*****************************************************************
+ * ResetRequestFromClient
+ * Reset to reexecute the current request, and yield.
+ *
+ **********************/
+
+void
+ResetCurrentRequest(ClientPtr client)
+{
+ OsCommPtr oc = (OsCommPtr)client->osPrivate;
+ register ConnectionInputPtr oci = oc->input;
+ int fd = oc->fd;
+ register xReq *request;
+ int gotnow, needed;
+ if (AvailableInput == oc)
+ AvailableInput = (OsCommPtr)NULL;
+ oci->lenLastReq = 0;
+ gotnow = oci->bufcnt + oci->buffer - oci->bufptr;
+ if (gotnow < sizeof(xReq))
+ {
+ YieldControlNoInput(fd);
+ }
+ else
+ {
+ request = (xReq *)oci->bufptr;
+ needed = get_req_len(request, client);
+ if (!needed && client->big_requests)
+ {
+ oci->bufptr -= sizeof(xBigReq) - sizeof(xReq);
+ *(xReq *)oci->bufptr = *request;
+ ((xBigReq *)oci->bufptr)->length = client->req_len;
+ if (client->swapped)
+ {
+ swapl(&((xBigReq *)oci->bufptr)->length);
+ }
+ }
+ if (gotnow >= (needed << 2))
+ {
+ if (FD_ISSET(fd, &AllClients))
+ {
+ FD_SET(fd, &ClientsWithInput);
+ }
+ else
+ {
+ FD_SET(fd, &IgnoredClientsWithInput);
+ }
+ YieldControl();
+ }
+ else
+ YieldControlNoInput(fd);
+ }
+}
+
+static const int padlength[4] = {0, 3, 2, 1};
+
+ /********************
+ * FlushAllOutput()
+ * Flush all clients with output. However, if some client still
+ * has input in the queue (more requests), then don't flush. This
+ * will prevent the output queue from being flushed every time around
+ * the round robin queue. Now, some say that it SHOULD be flushed
+ * every time around, but...
+ *
+ **********************/
+
+void
+FlushAllOutput(void)
+{
+ register int index, base;
+ register fd_mask mask; /* raphael */
+ OsCommPtr oc;
+ register ClientPtr client;
+ Bool newoutput = NewOutputPending;
+#if defined(WIN32)
+ fd_set newOutputPending;
+#endif
+
+ if (FlushCallback)
+ CallCallbacks(&FlushCallback, NULL);
+
+ if (!newoutput)
+ return;
+
+ /*
+ * It may be that some client still has critical output pending,
+ * but he is not yet ready to receive it anyway, so we will
+ * simply wait for the select to tell us when he's ready to receive.
+ */
+ CriticalOutputPending = FALSE;
+ NewOutputPending = FALSE;
+
+#ifndef WIN32
+ for (base = 0; base < howmany(XFD_SETSIZE, NFDBITS); base++)
+ {
+ mask = OutputPending.fds_bits[ base ];
+ OutputPending.fds_bits[ base ] = 0;
+ while (mask)
+ {
+ index = ffs(mask) - 1;
+ mask &= ~lowbit(mask);
+ if ((index = ConnectionTranslation[(base * (sizeof(fd_mask)*8)) + index]) == 0)
+ continue;
+ client = clients[index];
+ if (client->clientGone)
+ continue;
+ oc = (OsCommPtr)client->osPrivate;
+ if (FD_ISSET(oc->fd, &ClientsWithInput))
+ {
+ FD_SET(oc->fd, &OutputPending); /* set the bit again */
+ NewOutputPending = TRUE;
+ }
+ else
+ (void)FlushClient(client, oc, (char *)NULL, 0);
+ }
+ }
+#else /* WIN32 */
+ FD_ZERO(&newOutputPending);
+ for (base = 0; base < XFD_SETCOUNT(&OutputPending); base++)
+ {
+ index = XFD_FD(&OutputPending, base);
+ if ((index = GetConnectionTranslation(index)) == 0)
+ continue;
+ client = clients[index];
+ if (client->clientGone)
+ continue;
+ oc = (OsCommPtr)client->osPrivate;
+ if (FD_ISSET(oc->fd, &ClientsWithInput))
+ {
+ FD_SET(oc->fd, &newOutputPending); /* set the bit again */
+ NewOutputPending = TRUE;
+ }
+ else
+ (void)FlushClient(client, oc, (char *)NULL, 0);
+ }
+ XFD_COPYSET(&newOutputPending, &OutputPending);
+#endif /* WIN32 */
+}
+
+void
+FlushIfCriticalOutputPending(void)
+{
+ if (CriticalOutputPending)
+ FlushAllOutput();
+}
+
+void
+SetCriticalOutputPending(void)
+{
+ CriticalOutputPending = TRUE;
+}
+
+/*****************
+ * WriteToClient
+ * Copies buf into ClientPtr.buf if it fits (with padding), else
+ * flushes ClientPtr.buf and buf to client. As of this writing,
+ * every use of WriteToClient is cast to void, and the result
+ * is ignored. Potentially, this could be used by requests
+ * that are sending several chunks of data and want to break
+ * out of a loop on error. Thus, we will leave the type of
+ * this routine as int.
+ *****************/
+
+int
+WriteToClient (ClientPtr who, int count, const void *__buf)
+{
+ OsCommPtr oc;
+ ConnectionOutputPtr oco;
+ int padBytes;
+ const char *buf = __buf;
+#ifdef DEBUG_COMMUNICATION
+ Bool multicount = FALSE;
+#endif
+ if (!count || !who || who == serverClient || who->clientGone)
+ return 0;
+ oc = who->osPrivate;
+ oco = oc->output;
+#ifdef DEBUG_COMMUNICATION
+ {
+ char info[128];
+ xError *err;
+ xGenericReply *rep;
+ xEvent *ev;
+
+ if (!who->replyBytesRemaining) {
+ switch(buf[0]) {
+ case X_Reply:
+ rep = (xGenericReply*)buf;
+ if (rep->sequenceNumber == who->sequence) {
+ snprintf(info,127,"Xreply: type: 0x%x data: 0x%x "
+ "len: %i seq#: 0x%x", rep->type, rep->data1,
+ rep->length, rep->sequenceNumber);
+ multicount = TRUE;
+ }
+ break;
+ case X_Error:
+ err = (xError*)buf;
+ snprintf(info,127,"Xerror: Code: 0x%x resID: 0x%x maj: 0x%x "
+ "min: %x", err->errorCode,err->resourceID,
+ err->minorCode,err->majorCode);
+ break;
+ default:
+ if ((buf[0] & 0x7f) == KeymapNotify)
+ snprintf(info,127,"KeymapNotifyEvent: %i",buf[0]);
+ else {
+ ev = (xEvent*)buf;
+ snprintf(info,127,"XEvent: type: 0x%x detail: 0x%x "
+ "seq#: 0x%x", ev->u.u.type, ev->u.u.detail,
+ ev->u.u.sequenceNumber);
+ }
+ }
+ ErrorF("REPLY: ClientIDX: %i %s\n",who->index, info);
+ } else
+ multicount = TRUE;
+ }
+#endif
+
+ if (!oco)
+ {
+ if ((oco = FreeOutputs))
+ {
+ FreeOutputs = oco->next;
+ }
+ else if (!(oco = AllocateOutputBuffer()))
+ {
+ if (oc->trans_conn) {
+ _XSERVTransDisconnect(oc->trans_conn);
+ _XSERVTransClose(oc->trans_conn);
+ oc->trans_conn = NULL;
+ }
+ MarkClientException(who);
+ return -1;
+ }
+ oc->output = oco;
+ }
+
+ padBytes = padlength[count & 3];
+
+ if(ReplyCallback)
+ {
+ ReplyInfoRec replyinfo;
+
+ replyinfo.client = who;
+ replyinfo.replyData = buf;
+ replyinfo.dataLenBytes = count + padBytes;
+ if (who->replyBytesRemaining)
+ { /* still sending data of an earlier reply */
+ who->replyBytesRemaining -= count + padBytes;
+ replyinfo.startOfReply = FALSE;
+ replyinfo.bytesRemaining = who->replyBytesRemaining;
+ CallCallbacks((&ReplyCallback), (pointer)&replyinfo);
+ }
+ else if (who->clientState == ClientStateRunning
+ && buf[0] == X_Reply)
+ { /* start of new reply */
+ CARD32 replylen;
+ unsigned long bytesleft;
+
+ replylen = ((xGenericReply *)buf)->length;
+ if (who->swapped)
+ swapl(&replylen);
+ bytesleft = (replylen * 4) + SIZEOF(xReply) - count - padBytes;
+ replyinfo.startOfReply = TRUE;
+ replyinfo.bytesRemaining = who->replyBytesRemaining = bytesleft;
+ CallCallbacks((&ReplyCallback), (pointer)&replyinfo);
+ }
+ }
+#ifdef DEBUG_COMMUNICATION
+ else if (multicount) {
+ if (who->replyBytesRemaining) {
+ who->replyBytesRemaining -= (count + padBytes);
+ } else {
+ CARD32 replylen;
+ replylen = ((xGenericReply *)buf)->length;
+ who->replyBytesRemaining =
+ (replylen * 4) + SIZEOF(xReply) - count - padBytes;
+ }
+ }
+#endif
+ if (oco->count + count + padBytes > oco->size)
+ {
+ FD_CLR(oc->fd, &OutputPending);
+ if(!XFD_ANYSET(&OutputPending)) {
+ CriticalOutputPending = FALSE;
+ NewOutputPending = FALSE;
+ }
+
+ if (FlushCallback)
+ CallCallbacks(&FlushCallback, NULL);
+
+ return FlushClient(who, oc, buf, count);
+ }
+
+ NewOutputPending = TRUE;
+ FD_SET(oc->fd, &OutputPending);
+ memmove((char *)oco->buf + oco->count, buf, count);
+ oco->count += count + padBytes;
+ return count;
+}
+
+ /********************
+ * FlushClient()
+ * If the client isn't keeping up with us, then we try to continue
+ * buffering the data and set the apropriate bit in ClientsWritable
+ * (which is used by WaitFor in the select). If the connection yields
+ * a permanent error, or we can't allocate any more space, we then
+ * close the connection.
+ *
+ **********************/
+
+int
+FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount)
+{
+ ConnectionOutputPtr oco = oc->output;
+ int connection = oc->fd;
+ XtransConnInfo trans_conn = oc->trans_conn;
+ struct iovec iov[3];
+ static char padBuffer[3];
+ const char *extraBuf = __extraBuf;
+ long written;
+ long padsize;
+ long notWritten;
+ long todo;
+
+ if (!oco)
+ return 0;
+ written = 0;
+ padsize = padlength[extraCount & 3];
+ notWritten = oco->count + extraCount + padsize;
+ todo = notWritten;
+ while (notWritten) {
+ long before = written; /* amount of whole thing written */
+ long remain = todo; /* amount to try this time, <= notWritten */
+ int i = 0;
+ long len;
+
+ /* You could be very general here and have "in" and "out" iovecs
+ * and write a loop without using a macro, but what the heck. This
+ * translates to:
+ *
+ * how much of this piece is new?
+ * if more new then we are trying this time, clamp
+ * if nothing new
+ * then bump down amount already written, for next piece
+ * else put new stuff in iovec, will need all of next piece
+ *
+ * Note that todo had better be at least 1 or else we'll end up
+ * writing 0 iovecs.
+ */
+#define InsertIOV(pointer, length) \
+ len = (length) - before; \
+ if (len > remain) \
+ len = remain; \
+ if (len <= 0) { \
+ before = (-len); \
+ } else { \
+ iov[i].iov_len = len; \
+ iov[i].iov_base = (pointer) + before; \
+ i++; \
+ remain -= len; \
+ before = 0; \
+ }
+
+ InsertIOV ((char *)oco->buf, oco->count)
+ InsertIOV ((char *)extraBuf, extraCount)
+ InsertIOV (padBuffer, padsize)
+
+ errno = 0;
+ if (trans_conn && (len = _XSERVTransWritev(trans_conn, iov, i)) >= 0)
+ {
+ written += len;
+ notWritten -= len;
+ todo = notWritten;
+ }
+ else if (ETEST(errno)
+#ifdef SUNSYSV /* check for another brain-damaged OS bug */
+ || (errno == 0)
+#endif
+#ifdef EMSGSIZE /* check for another brain-damaged OS bug */
+ || ((errno == EMSGSIZE) && (todo == 1))
+#endif
+ )
+ {
+ /* If we've arrived here, then the client is stuffed to the gills
+ and not ready to accept more. Make a note of it and buffer
+ the rest. */
+ errno=0;
+ FD_SET(connection, &ClientsWriteBlocked);
+ AnyClientsWriteBlocked = TRUE;
+
+ if (written < oco->count)
+ {
+ if (written > 0)
+ {
+ oco->count -= written;
+ memmove((char *)oco->buf,
+ (char *)oco->buf + written,
+ oco->count);
+ written = 0;
+ }
+ }
+ else
+ {
+ written -= oco->count;
+ oco->count = 0;
+ }
+
+ if (notWritten > oco->size)
+ {
+ unsigned char *obuf;
+
+ obuf = (unsigned char *)realloc(oco->buf,
+ notWritten + BUFSIZE);
+ if (!obuf)
+ {
+ _XSERVTransDisconnect(oc->trans_conn);
+ _XSERVTransClose(oc->trans_conn);
+ oc->trans_conn = NULL;
+ MarkClientException(who);
+ oco->count = 0;
+ return -1;
+ }
+ oco->size = notWritten + BUFSIZE;
+ oco->buf = obuf;
+ }
+
+ /* If the amount written extended into the padBuffer, then the
+ difference "extraCount - written" may be less than 0 */
+ if ((len = extraCount - written) > 0)
+ memmove ((char *)oco->buf + oco->count,
+ extraBuf + written,
+ len);
+
+ oco->count = notWritten; /* this will include the pad */
+ /* return only the amount explicitly requested */
+ return extraCount;
+ }
+#ifdef EMSGSIZE /* check for another brain-damaged OS bug */
+ else if (errno == EMSGSIZE)
+ {
+ todo >>= 1;
+ }
+#endif
+ else
+ {
+ if (oc->trans_conn)
+ {
+ _XSERVTransDisconnect(oc->trans_conn);
+ _XSERVTransClose(oc->trans_conn);
+ oc->trans_conn = NULL;
+ }
+ MarkClientException(who);
+ oco->count = 0;
+ return -1;
+ }
+ }
+
+ /* everything was flushed out */
+ oco->count = 0;
+ /* check to see if this client was write blocked */
+ if (AnyClientsWriteBlocked)
+ {
+ FD_CLR(oc->fd, &ClientsWriteBlocked);
+ if (! XFD_ANYSET(&ClientsWriteBlocked))
+ AnyClientsWriteBlocked = FALSE;
+ }
+ if (oco->size > BUFWATERMARK)
+ {
+ free(oco->buf);
+ free(oco);
+ }
+ else
+ {
+ oco->next = FreeOutputs;
+ FreeOutputs = oco;
+ }
+ oc->output = (ConnectionOutputPtr)NULL;
+ return extraCount; /* return only the amount explicitly requested */
+}
+
+static ConnectionInputPtr
+AllocateInputBuffer(void)
+{
+ ConnectionInputPtr oci;
+
+ oci = malloc(sizeof(ConnectionInput));
+ if (!oci)
+ return NULL;
+ oci->buffer = malloc(BUFSIZE);
+ if (!oci->buffer)
+ {
+ free(oci);
+ return NULL;
+ }
+ oci->size = BUFSIZE;
+ oci->bufptr = oci->buffer;
+ oci->bufcnt = 0;
+ oci->lenLastReq = 0;
+ oci->ignoreBytes = 0;
+ return oci;
+}
+
+static ConnectionOutputPtr
+AllocateOutputBuffer(void)
+{
+ ConnectionOutputPtr oco;
+
+ oco = malloc(sizeof(ConnectionOutput));
+ if (!oco)
+ return NULL;
+ oco->buf = calloc(1, BUFSIZE);
+ if (!oco->buf)
+ {
+ free(oco);
+ return NULL;
+ }
+ oco->size = BUFSIZE;
+ oco->count = 0;
+ return oco;
+}
+
+void
+FreeOsBuffers(OsCommPtr oc)
+{
+ ConnectionInputPtr oci;
+ ConnectionOutputPtr oco;
+
+ if (AvailableInput == oc)
+ AvailableInput = (OsCommPtr)NULL;
+ if ((oci = oc->input))
+ {
+ if (FreeInputs)
+ {
+ free(oci->buffer);
+ free(oci);
+ }
+ else
+ {
+ FreeInputs = oci;
+ oci->next = (ConnectionInputPtr)NULL;
+ oci->bufptr = oci->buffer;
+ oci->bufcnt = 0;
+ oci->lenLastReq = 0;
+ }
+ }
+ if ((oco = oc->output))
+ {
+ if (FreeOutputs)
+ {
+ free(oco->buf);
+ free(oco);
+ }
+ else
+ {
+ FreeOutputs = oco;
+ oco->next = (ConnectionOutputPtr)NULL;
+ oco->count = 0;
+ }
+ }
+}
+
+void
+ResetOsBuffers(void)
+{
+ ConnectionInputPtr oci;
+ ConnectionOutputPtr oco;
+
+ while ((oci = FreeInputs))
+ {
+ FreeInputs = oci->next;
+ free(oci->buffer);
+ free(oci);
+ }
+ while ((oco = FreeOutputs))
+ {
+ FreeOutputs = oco->next;
+ free(oco->buf);
+ free(oco);
+ }
+}
diff --git a/xorg-server/randr/rrcrtc.c b/xorg-server/randr/rrcrtc.c
index 0437795c4..e6a38ae60 100644
--- a/xorg-server/randr/rrcrtc.c
+++ b/xorg-server/randr/rrcrtc.c
@@ -751,7 +751,7 @@ ProcRRGetCrtcInfo (ClientPtr client)
RRModePtr mode;
RROutput *outputs;
RROutput *possible;
- int i, j, k, n;
+ int i, j, k;
int width, height;
BoxRec panned_area;
@@ -818,7 +818,7 @@ ProcRRGetCrtcInfo (ClientPtr client)
{
outputs[i] = crtc->outputs[i]->id;
if (client->swapped)
- swapl (&outputs[i], n);
+ swapl(&outputs[i]);
}
k = 0;
for (i = 0; i < pScrPriv->numOutputs; i++)
@@ -827,23 +827,23 @@ ProcRRGetCrtcInfo (ClientPtr client)
{
possible[k] = pScrPriv->outputs[i]->id;
if (client->swapped)
- swapl (&possible[k], n);
+ swapl(&possible[k]);
k++;
}
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.timestamp, n);
- swaps(&rep.x, n);
- swaps(&rep.y, n);
- swaps(&rep.width, n);
- swaps(&rep.height, n);
- swapl(&rep.mode, n);
- swaps(&rep.rotation, n);
- swaps(&rep.rotations, n);
- swaps(&rep.nOutput, n);
- swaps(&rep.nPossibleOutput, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.timestamp);
+ swaps(&rep.x);
+ swaps(&rep.y);
+ swaps(&rep.width);
+ swaps(&rep.height);
+ swapl(&rep.mode);
+ swaps(&rep.rotation);
+ swaps(&rep.rotations);
+ swaps(&rep.nOutput);
+ swaps(&rep.nPossibleOutput);
}
WriteToClient(client, sizeof(xRRGetCrtcInfoReply), (char *)&rep);
if (extraLen)
@@ -1058,10 +1058,9 @@ sendReply:
if (client->swapped)
{
- int n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.newTimestamp, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.newTimestamp);
}
WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *)&rep);
@@ -1079,7 +1078,6 @@ ProcRRGetPanning (ClientPtr client)
BoxRec total;
BoxRec tracking;
INT16 border[4];
- int n;
REQUEST_SIZE_MATCH(xRRGetPanningReq);
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
@@ -1117,21 +1115,21 @@ ProcRRGetPanning (ClientPtr client)
}
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.timestamp, n);
- swaps(&rep.left, n);
- swaps(&rep.top, n);
- swaps(&rep.width, n);
- swaps(&rep.height, n);
- swaps(&rep.track_left, n);
- swaps(&rep.track_top, n);
- swaps(&rep.track_width, n);
- swaps(&rep.track_height, n);
- swaps(&rep.border_left, n);
- swaps(&rep.border_top, n);
- swaps(&rep.border_right, n);
- swaps(&rep.border_bottom, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.timestamp);
+ swaps(&rep.left);
+ swaps(&rep.top);
+ swaps(&rep.width);
+ swaps(&rep.height);
+ swaps(&rep.track_left);
+ swaps(&rep.track_top);
+ swaps(&rep.track_width);
+ swaps(&rep.track_height);
+ swaps(&rep.border_left);
+ swaps(&rep.border_top);
+ swaps(&rep.border_right);
+ swaps(&rep.border_bottom);
}
WriteToClient(client, sizeof(xRRGetPanningReply), (char *)&rep);
return Success;
@@ -1149,7 +1147,6 @@ ProcRRSetPanning (ClientPtr client)
BoxRec total;
BoxRec tracking;
INT16 border[4];
- int n;
REQUEST_SIZE_MATCH(xRRSetPanningReq);
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
@@ -1198,9 +1195,9 @@ sendReply:
rep.newTimestamp = pScrPriv->lastSetTime.milliseconds;
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.newTimestamp, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.newTimestamp);
}
WriteToClient(client, sizeof(xRRSetPanningReply), (char *)&rep);
return Success;
@@ -1212,7 +1209,6 @@ ProcRRGetCrtcGammaSize (ClientPtr client)
REQUEST(xRRGetCrtcGammaSizeReq);
xRRGetCrtcGammaSizeReply reply;
RRCrtcPtr crtc;
- int n;
REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq);
VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess);
@@ -1226,9 +1222,9 @@ ProcRRGetCrtcGammaSize (ClientPtr client)
reply.length = 0;
reply.size = crtc->gammaSize;
if (client->swapped) {
- swaps (&reply.sequenceNumber, n);
- swapl (&reply.length, n);
- swaps (&reply.size, n);
+ swaps(&reply.sequenceNumber);
+ swapl(&reply.length);
+ swaps(&reply.size);
}
WriteToClient (client, sizeof (xRRGetCrtcGammaSizeReply), (char *) &reply);
return Success;
@@ -1240,7 +1236,6 @@ ProcRRGetCrtcGamma (ClientPtr client)
REQUEST(xRRGetCrtcGammaReq);
xRRGetCrtcGammaReply reply;
RRCrtcPtr crtc;
- int n;
unsigned long len;
char *extra = NULL;
@@ -1264,9 +1259,9 @@ ProcRRGetCrtcGamma (ClientPtr client)
reply.length = bytes_to_int32(len);
reply.size = crtc->gammaSize;
if (client->swapped) {
- swaps (&reply.sequenceNumber, n);
- swapl (&reply.length, n);
- swaps (&reply.size, n);
+ swaps(&reply.sequenceNumber);
+ swapl(&reply.length);
+ swaps(&reply.size);
}
WriteToClient (client, sizeof (xRRGetCrtcGammaReply), (char *) &reply);
if (crtc->gammaSize)
@@ -1361,7 +1356,6 @@ transform_filter_encode (ClientPtr client, char *output,
RRTransformPtr transform)
{
int nbytes, nparams;
- int n;
if (transform->filter == NULL) {
*nbytesFilter = 0;
@@ -1377,8 +1371,8 @@ transform_filter_encode (ClientPtr client, char *output,
output[nbytes++] = 0;
memcpy (output + nbytes, transform->params, nparams * sizeof (xFixed));
if (client->swapped) {
- swaps (nbytesFilter, n);
- swaps (nparamsFilter, n);
+ swaps(nbytesFilter);
+ swaps(nparamsFilter);
SwapLongs ((CARD32 *) (output + nbytes), nparams);
}
nbytes += nparams * sizeof (xFixed);
@@ -1399,7 +1393,7 @@ ProcRRGetCrtcTransform (ClientPtr client)
REQUEST(xRRGetCrtcTransformReq);
xRRGetCrtcTransformReply *reply;
RRCrtcPtr crtc;
- int n, nextra;
+ int nextra;
RRTransformPtr current, pending;
char *extra;
@@ -1436,8 +1430,8 @@ ProcRRGetCrtcTransform (ClientPtr client)
current);
if (client->swapped) {
- swaps (&reply->sequenceNumber, n);
- swapl (&reply->length, n);
+ swaps(&reply->sequenceNumber);
+ swapl(&reply->length);
}
WriteToClient (client, sizeof (xRRGetCrtcTransformReply) + nextra, (char *) reply);
free(reply);
diff --git a/xorg-server/randr/rrdispatch.c b/xorg-server/randr/rrdispatch.c
index d1c99c288..5a6a85287 100644
--- a/xorg-server/randr/rrdispatch.c
+++ b/xorg-server/randr/rrdispatch.c
@@ -36,7 +36,6 @@ static int
ProcRRQueryVersion (ClientPtr client)
{
xRRQueryVersionReply rep = {0};
- register int n;
REQUEST(xRRQueryVersionReq);
rrClientPriv(client);
@@ -59,10 +58,10 @@ ProcRRQueryVersion (ClientPtr client)
}
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.majorVersion, n);
- swapl(&rep.minorVersion, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.majorVersion);
+ swapl(&rep.minorVersion);
}
WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep);
return Success;
diff --git a/xorg-server/randr/rrmode.c b/xorg-server/randr/rrmode.c
index ae7939909..63a2d2a74 100644
--- a/xorg-server/randr/rrmode.c
+++ b/xorg-server/randr/rrmode.c
@@ -1,382 +1,381 @@
-/*
- * Copyright © 2006 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of the copyright holders not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. The copyright holders make no representations
- * about the suitability of this software for any purpose. It is provided "as
- * is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include "randrstr.h"
-
-RESTYPE RRModeType;
-
-static Bool
-RRModeEqual (xRRModeInfo *a, xRRModeInfo *b)
-{
- if (a->width != b->width) return FALSE;
- if (a->height != b->height) return FALSE;
- if (a->dotClock != b->dotClock) return FALSE;
- if (a->hSyncStart != b->hSyncStart) return FALSE;
- if (a->hSyncEnd != b->hSyncEnd) return FALSE;
- if (a->hTotal != b->hTotal) return FALSE;
- if (a->hSkew != b->hSkew) return FALSE;
- if (a->vSyncStart != b->vSyncStart) return FALSE;
- if (a->vSyncEnd != b->vSyncEnd) return FALSE;
- if (a->vTotal != b->vTotal) return FALSE;
- if (a->nameLength != b->nameLength) return FALSE;
- if (a->modeFlags != b->modeFlags) return FALSE;
- return TRUE;
-}
-
-/*
- * Keep a list so it's easy to find modes in the resource database.
- */
-static int num_modes;
-static RRModePtr *modes;
-
-static RRModePtr
-RRModeCreate (xRRModeInfo *modeInfo,
- const char *name,
- ScreenPtr userScreen)
-{
- RRModePtr mode, *newModes;
-
- if (!RRInit ())
- return NULL;
-
- mode = malloc(sizeof (RRModeRec) + modeInfo->nameLength + 1);
- if (!mode)
- return NULL;
- mode->refcnt = 1;
- mode->mode = *modeInfo;
- mode->name = (char *) (mode + 1);
- memcpy (mode->name, name, modeInfo->nameLength);
- mode->name[modeInfo->nameLength] = '\0';
- mode->userScreen = userScreen;
-
- if (num_modes)
- newModes = realloc(modes, (num_modes + 1) * sizeof (RRModePtr));
- else
- newModes = malloc(sizeof (RRModePtr));
-
- if (!newModes)
- {
- free(mode);
- return NULL;
- }
-
- mode->mode.id = FakeClientID(0);
- if (!AddResource (mode->mode.id, RRModeType, (pointer) mode))
- return NULL;
- modes = newModes;
- modes[num_modes++] = mode;
-
- /*
- * give the caller a reference to this mode
- */
- ++mode->refcnt;
- return mode;
-}
-
-static RRModePtr
-RRModeFindByName (const char *name,
- CARD16 nameLength)
-{
- int i;
- RRModePtr mode;
-
- for (i = 0; i < num_modes; i++)
- {
- mode = modes[i];
- if (mode->mode.nameLength == nameLength &&
- !memcmp (name, mode->name, nameLength))
- {
- return mode;
- }
- }
- return NULL;
-}
-
-RRModePtr
-RRModeGet (xRRModeInfo *modeInfo,
- const char *name)
-{
- int i;
-
- for (i = 0; i < num_modes; i++)
- {
- RRModePtr mode = modes[i];
- if (RRModeEqual (&mode->mode, modeInfo) &&
- !memcmp (name, mode->name, modeInfo->nameLength))
- {
- ++mode->refcnt;
- return mode;
- }
- }
-
- return RRModeCreate (modeInfo, name, NULL);
-}
-
-static RRModePtr
-RRModeCreateUser (ScreenPtr pScreen,
- xRRModeInfo *modeInfo,
- const char *name,
- int *error)
-{
- RRModePtr mode;
-
- mode = RRModeFindByName (name, modeInfo->nameLength);
- if (mode)
- {
- *error = BadName;
- return NULL;
- }
-
- mode = RRModeCreate (modeInfo, name, pScreen);
- if (!mode)
- {
- *error = BadAlloc;
- return NULL;
- }
- *error = Success;
- return mode;
-}
-
-RRModePtr *
-RRModesForScreen (ScreenPtr pScreen, int *num_ret)
-{
- rrScrPriv(pScreen);
- int o, c, m;
- RRModePtr *screen_modes;
- int num_screen_modes = 0;
-
- screen_modes = malloc((num_modes ? num_modes : 1) * sizeof (RRModePtr));
- if (!screen_modes)
- return NULL;
-
- /*
- * Add modes from all outputs
- */
- for (o = 0; o < pScrPriv->numOutputs; o++)
- {
- RROutputPtr output = pScrPriv->outputs[o];
- int m, n;
-
- for (m = 0; m < output->numModes + output->numUserModes; m++)
- {
- RRModePtr mode = (m < output->numModes ?
- output->modes[m] :
- output->userModes[m-output->numModes]);
- for (n = 0; n < num_screen_modes; n++)
- if (screen_modes[n] == mode)
- break;
- if (n == num_screen_modes)
- screen_modes[num_screen_modes++] = mode;
- }
- }
- /*
- * Add modes from all crtcs. The goal is to
- * make sure all available and active modes
- * are visible to the client
- */
- for (c = 0; c < pScrPriv->numCrtcs; c++)
- {
- RRCrtcPtr crtc = pScrPriv->crtcs[c];
- RRModePtr mode = crtc->mode;
- int n;
-
- if (!mode) continue;
- for (n = 0; n < num_screen_modes; n++)
- if (screen_modes[n] == mode)
- break;
- if (n == num_screen_modes)
- screen_modes[num_screen_modes++] = mode;
- }
- /*
- * Add all user modes for this screen
- */
- for (m = 0; m < num_modes; m++)
- {
- RRModePtr mode = modes[m];
- int n;
-
- if (mode->userScreen != pScreen)
- continue;
- for (n = 0; n < num_screen_modes; n++)
- if (screen_modes[n] == mode)
- break;
- if (n == num_screen_modes)
- screen_modes[num_screen_modes++] = mode;
- }
-
- *num_ret = num_screen_modes;
- return screen_modes;
-}
-
-void
-RRModeDestroy (RRModePtr mode)
-{
- int m;
-
- if (--mode->refcnt > 0)
- return;
- for (m = 0; m < num_modes; m++)
- {
- if (modes[m] == mode)
- {
- memmove (modes + m, modes + m + 1,
- (num_modes - m - 1) * sizeof (RRModePtr));
- num_modes--;
- if (!num_modes)
- {
- free(modes);
- modes = NULL;
- }
- break;
- }
- }
-
- free(mode);
-}
-
-static int
-RRModeDestroyResource (pointer value, XID pid)
-{
- RRModeDestroy ((RRModePtr) value);
- return 1;
-}
-
-/*
- * Initialize mode type
- */
-Bool
-RRModeInit (void)
-{
- assert (num_modes == 0);
- assert (modes == NULL);
- RRModeType = CreateNewResourceType (RRModeDestroyResource, "MODE");
- if (!RRModeType)
- return FALSE;
-
- return TRUE;
-}
-
-/*
- * Initialize mode type error value
- */
-void
-RRModeInitErrorValue(void)
-{
- SetResourceTypeErrorValue(RRModeType, RRErrorBase + BadRRMode);
-}
-
-int
-ProcRRCreateMode (ClientPtr client)
-{
- REQUEST(xRRCreateModeReq);
- xRRCreateModeReply rep = {0};
- WindowPtr pWin;
- ScreenPtr pScreen;
- rrScrPrivPtr pScrPriv;
- xRRModeInfo *modeInfo;
- long units_after;
- char *name;
- int error, rc;
- RRModePtr mode;
-
- REQUEST_AT_LEAST_SIZE (xRRCreateModeReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
- pScreen = pWin->drawable.pScreen;
- pScrPriv = rrGetScrPriv(pScreen);
-
- modeInfo = &stuff->modeInfo;
- name = (char *) (stuff + 1);
- units_after = (stuff->length - bytes_to_int32(sizeof (xRRCreateModeReq)));
-
- /* check to make sure requested name fits within the data provided */
- if (bytes_to_int32(modeInfo->nameLength) > units_after)
- return BadLength;
-
- mode = RRModeCreateUser (pScreen, modeInfo, name, &error);
- if (!mode)
- return error;
-
- rep.type = X_Reply;
- rep.pad0 = 0;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.mode = mode->mode.id;
- if (client->swapped)
- {
- int n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.mode, n);
- }
- WriteToClient(client, sizeof(xRRCreateModeReply), (char *)&rep);
- /* Drop out reference to this mode */
- RRModeDestroy (mode);
- return Success;
-}
-
-int
-ProcRRDestroyMode (ClientPtr client)
-{
- REQUEST(xRRDestroyModeReq);
- RRModePtr mode;
-
- REQUEST_SIZE_MATCH(xRRDestroyModeReq);
- VERIFY_RR_MODE(stuff->mode, mode, DixDestroyAccess);
-
- if (!mode->userScreen)
- return BadMatch;
- if (mode->refcnt > 1)
- return BadAccess;
- FreeResource (stuff->mode, 0);
- return Success;
-}
-
-int
-ProcRRAddOutputMode (ClientPtr client)
-{
- REQUEST(xRRAddOutputModeReq);
- RRModePtr mode;
- RROutputPtr output;
-
- REQUEST_SIZE_MATCH(xRRAddOutputModeReq);
- VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
- VERIFY_RR_MODE(stuff->mode, mode, DixUseAccess);
-
- return RROutputAddUserMode (output, mode);
-}
-
-int
-ProcRRDeleteOutputMode (ClientPtr client)
-{
- REQUEST(xRRDeleteOutputModeReq);
- RRModePtr mode;
- RROutputPtr output;
-
- REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq);
- VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
- VERIFY_RR_MODE(stuff->mode, mode, DixUseAccess);
-
- return RROutputDeleteUserMode (output, mode);
-}
+/*
+ * Copyright © 2006 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include "randrstr.h"
+
+RESTYPE RRModeType;
+
+static Bool
+RRModeEqual (xRRModeInfo *a, xRRModeInfo *b)
+{
+ if (a->width != b->width) return FALSE;
+ if (a->height != b->height) return FALSE;
+ if (a->dotClock != b->dotClock) return FALSE;
+ if (a->hSyncStart != b->hSyncStart) return FALSE;
+ if (a->hSyncEnd != b->hSyncEnd) return FALSE;
+ if (a->hTotal != b->hTotal) return FALSE;
+ if (a->hSkew != b->hSkew) return FALSE;
+ if (a->vSyncStart != b->vSyncStart) return FALSE;
+ if (a->vSyncEnd != b->vSyncEnd) return FALSE;
+ if (a->vTotal != b->vTotal) return FALSE;
+ if (a->nameLength != b->nameLength) return FALSE;
+ if (a->modeFlags != b->modeFlags) return FALSE;
+ return TRUE;
+}
+
+/*
+ * Keep a list so it's easy to find modes in the resource database.
+ */
+static int num_modes;
+static RRModePtr *modes;
+
+static RRModePtr
+RRModeCreate (xRRModeInfo *modeInfo,
+ const char *name,
+ ScreenPtr userScreen)
+{
+ RRModePtr mode, *newModes;
+
+ if (!RRInit ())
+ return NULL;
+
+ mode = malloc(sizeof (RRModeRec) + modeInfo->nameLength + 1);
+ if (!mode)
+ return NULL;
+ mode->refcnt = 1;
+ mode->mode = *modeInfo;
+ mode->name = (char *) (mode + 1);
+ memcpy (mode->name, name, modeInfo->nameLength);
+ mode->name[modeInfo->nameLength] = '\0';
+ mode->userScreen = userScreen;
+
+ if (num_modes)
+ newModes = realloc(modes, (num_modes + 1) * sizeof (RRModePtr));
+ else
+ newModes = malloc(sizeof (RRModePtr));
+
+ if (!newModes)
+ {
+ free(mode);
+ return NULL;
+ }
+
+ mode->mode.id = FakeClientID(0);
+ if (!AddResource (mode->mode.id, RRModeType, (pointer) mode))
+ return NULL;
+ modes = newModes;
+ modes[num_modes++] = mode;
+
+ /*
+ * give the caller a reference to this mode
+ */
+ ++mode->refcnt;
+ return mode;
+}
+
+static RRModePtr
+RRModeFindByName (const char *name,
+ CARD16 nameLength)
+{
+ int i;
+ RRModePtr mode;
+
+ for (i = 0; i < num_modes; i++)
+ {
+ mode = modes[i];
+ if (mode->mode.nameLength == nameLength &&
+ !memcmp (name, mode->name, nameLength))
+ {
+ return mode;
+ }
+ }
+ return NULL;
+}
+
+RRModePtr
+RRModeGet (xRRModeInfo *modeInfo,
+ const char *name)
+{
+ int i;
+
+ for (i = 0; i < num_modes; i++)
+ {
+ RRModePtr mode = modes[i];
+ if (RRModeEqual (&mode->mode, modeInfo) &&
+ !memcmp (name, mode->name, modeInfo->nameLength))
+ {
+ ++mode->refcnt;
+ return mode;
+ }
+ }
+
+ return RRModeCreate (modeInfo, name, NULL);
+}
+
+static RRModePtr
+RRModeCreateUser (ScreenPtr pScreen,
+ xRRModeInfo *modeInfo,
+ const char *name,
+ int *error)
+{
+ RRModePtr mode;
+
+ mode = RRModeFindByName (name, modeInfo->nameLength);
+ if (mode)
+ {
+ *error = BadName;
+ return NULL;
+ }
+
+ mode = RRModeCreate (modeInfo, name, pScreen);
+ if (!mode)
+ {
+ *error = BadAlloc;
+ return NULL;
+ }
+ *error = Success;
+ return mode;
+}
+
+RRModePtr *
+RRModesForScreen (ScreenPtr pScreen, int *num_ret)
+{
+ rrScrPriv(pScreen);
+ int o, c, m;
+ RRModePtr *screen_modes;
+ int num_screen_modes = 0;
+
+ screen_modes = malloc((num_modes ? num_modes : 1) * sizeof (RRModePtr));
+ if (!screen_modes)
+ return NULL;
+
+ /*
+ * Add modes from all outputs
+ */
+ for (o = 0; o < pScrPriv->numOutputs; o++)
+ {
+ RROutputPtr output = pScrPriv->outputs[o];
+ int m, n;
+
+ for (m = 0; m < output->numModes + output->numUserModes; m++)
+ {
+ RRModePtr mode = (m < output->numModes ?
+ output->modes[m] :
+ output->userModes[m-output->numModes]);
+ for (n = 0; n < num_screen_modes; n++)
+ if (screen_modes[n] == mode)
+ break;
+ if (n == num_screen_modes)
+ screen_modes[num_screen_modes++] = mode;
+ }
+ }
+ /*
+ * Add modes from all crtcs. The goal is to
+ * make sure all available and active modes
+ * are visible to the client
+ */
+ for (c = 0; c < pScrPriv->numCrtcs; c++)
+ {
+ RRCrtcPtr crtc = pScrPriv->crtcs[c];
+ RRModePtr mode = crtc->mode;
+ int n;
+
+ if (!mode) continue;
+ for (n = 0; n < num_screen_modes; n++)
+ if (screen_modes[n] == mode)
+ break;
+ if (n == num_screen_modes)
+ screen_modes[num_screen_modes++] = mode;
+ }
+ /*
+ * Add all user modes for this screen
+ */
+ for (m = 0; m < num_modes; m++)
+ {
+ RRModePtr mode = modes[m];
+ int n;
+
+ if (mode->userScreen != pScreen)
+ continue;
+ for (n = 0; n < num_screen_modes; n++)
+ if (screen_modes[n] == mode)
+ break;
+ if (n == num_screen_modes)
+ screen_modes[num_screen_modes++] = mode;
+ }
+
+ *num_ret = num_screen_modes;
+ return screen_modes;
+}
+
+void
+RRModeDestroy (RRModePtr mode)
+{
+ int m;
+
+ if (--mode->refcnt > 0)
+ return;
+ for (m = 0; m < num_modes; m++)
+ {
+ if (modes[m] == mode)
+ {
+ memmove (modes + m, modes + m + 1,
+ (num_modes - m - 1) * sizeof (RRModePtr));
+ num_modes--;
+ if (!num_modes)
+ {
+ free(modes);
+ modes = NULL;
+ }
+ break;
+ }
+ }
+
+ free(mode);
+}
+
+static int
+RRModeDestroyResource (pointer value, XID pid)
+{
+ RRModeDestroy ((RRModePtr) value);
+ return 1;
+}
+
+/*
+ * Initialize mode type
+ */
+Bool
+RRModeInit (void)
+{
+ assert (num_modes == 0);
+ assert (modes == NULL);
+ RRModeType = CreateNewResourceType (RRModeDestroyResource, "MODE");
+ if (!RRModeType)
+ return FALSE;
+
+ return TRUE;
+}
+
+/*
+ * Initialize mode type error value
+ */
+void
+RRModeInitErrorValue(void)
+{
+ SetResourceTypeErrorValue(RRModeType, RRErrorBase + BadRRMode);
+}
+
+int
+ProcRRCreateMode (ClientPtr client)
+{
+ REQUEST(xRRCreateModeReq);
+ xRRCreateModeReply rep = {0};
+ WindowPtr pWin;
+ ScreenPtr pScreen;
+ rrScrPrivPtr pScrPriv;
+ xRRModeInfo *modeInfo;
+ long units_after;
+ char *name;
+ int error, rc;
+ RRModePtr mode;
+
+ REQUEST_AT_LEAST_SIZE (xRRCreateModeReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ pScreen = pWin->drawable.pScreen;
+ pScrPriv = rrGetScrPriv(pScreen);
+
+ modeInfo = &stuff->modeInfo;
+ name = (char *) (stuff + 1);
+ units_after = (stuff->length - bytes_to_int32(sizeof (xRRCreateModeReq)));
+
+ /* check to make sure requested name fits within the data provided */
+ if (bytes_to_int32(modeInfo->nameLength) > units_after)
+ return BadLength;
+
+ mode = RRModeCreateUser (pScreen, modeInfo, name, &error);
+ if (!mode)
+ return error;
+
+ rep.type = X_Reply;
+ rep.pad0 = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.mode = mode->mode.id;
+ if (client->swapped)
+ {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.mode);
+ }
+ WriteToClient(client, sizeof(xRRCreateModeReply), (char *)&rep);
+ /* Drop out reference to this mode */
+ RRModeDestroy (mode);
+ return Success;
+}
+
+int
+ProcRRDestroyMode (ClientPtr client)
+{
+ REQUEST(xRRDestroyModeReq);
+ RRModePtr mode;
+
+ REQUEST_SIZE_MATCH(xRRDestroyModeReq);
+ VERIFY_RR_MODE(stuff->mode, mode, DixDestroyAccess);
+
+ if (!mode->userScreen)
+ return BadMatch;
+ if (mode->refcnt > 1)
+ return BadAccess;
+ FreeResource (stuff->mode, 0);
+ return Success;
+}
+
+int
+ProcRRAddOutputMode (ClientPtr client)
+{
+ REQUEST(xRRAddOutputModeReq);
+ RRModePtr mode;
+ RROutputPtr output;
+
+ REQUEST_SIZE_MATCH(xRRAddOutputModeReq);
+ VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
+ VERIFY_RR_MODE(stuff->mode, mode, DixUseAccess);
+
+ return RROutputAddUserMode (output, mode);
+}
+
+int
+ProcRRDeleteOutputMode (ClientPtr client)
+{
+ REQUEST(xRRDeleteOutputModeReq);
+ RRModePtr mode;
+ RROutputPtr output;
+
+ REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq);
+ VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
+ VERIFY_RR_MODE(stuff->mode, mode, DixUseAccess);
+
+ return RROutputDeleteUserMode (output, mode);
+}
diff --git a/xorg-server/randr/rroutput.c b/xorg-server/randr/rroutput.c
index 8f661a383..b57be198f 100644
--- a/xorg-server/randr/rroutput.c
+++ b/xorg-server/randr/rroutput.c
@@ -1,625 +1,624 @@
-/*
- * Copyright © 2006 Keith Packard
- * Copyright © 2008 Red Hat, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of the copyright holders not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. The copyright holders make no representations
- * about the suitability of this software for any purpose. It is provided "as
- * is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-
-#include "randrstr.h"
-
-RESTYPE RROutputType;
-
-/*
- * Notify the output of some change
- */
-void
-RROutputChanged (RROutputPtr output, Bool configChanged)
-{
- ScreenPtr pScreen = output->pScreen;
-
- output->changed = TRUE;
- if (pScreen)
- {
- rrScrPriv (pScreen);
- pScrPriv->changed = TRUE;
- if (configChanged)
- pScrPriv->configChanged = TRUE;
- }
-}
-
-/*
- * Create an output
- */
-
-RROutputPtr
-RROutputCreate (ScreenPtr pScreen,
- const char *name,
- int nameLength,
- void *devPrivate)
-{
- RROutputPtr output;
- RROutputPtr *outputs;
- rrScrPrivPtr pScrPriv;
-
- if (!RRInit())
- return NULL;
-
- pScrPriv = rrGetScrPriv(pScreen);
-
- if (pScrPriv->numOutputs)
- outputs = realloc(pScrPriv->outputs,
- (pScrPriv->numOutputs + 1) * sizeof (RROutputPtr));
- else
- outputs = malloc(sizeof (RROutputPtr));
- if (!outputs)
- return FALSE;
-
- pScrPriv->outputs = outputs;
-
- output = malloc(sizeof (RROutputRec) + nameLength + 1);
- if (!output)
- return NULL;
- output->id = FakeClientID (0);
- output->pScreen = pScreen;
- output->name = (char *) (output + 1);
- output->nameLength = nameLength;
- memcpy (output->name, name, nameLength);
- output->name[nameLength] = '\0';
- output->connection = RR_UnknownConnection;
- output->subpixelOrder = SubPixelUnknown;
- output->mmWidth = 0;
- output->mmHeight = 0;
- output->crtc = NULL;
- output->numCrtcs = 0;
- output->crtcs = NULL;
- output->numClones = 0;
- output->clones = NULL;
- output->numModes = 0;
- output->numPreferred = 0;
- output->modes = NULL;
- output->numUserModes = 0;
- output->userModes = NULL;
- output->properties = NULL;
- output->pendingProperties = FALSE;
- output->changed = FALSE;
- output->devPrivate = devPrivate;
-
- if (!AddResource (output->id, RROutputType, (pointer) output))
- return NULL;
-
- pScrPriv->outputs[pScrPriv->numOutputs++] = output;
- return output;
-}
-
-/*
- * Notify extension that output parameters have been changed
- */
-Bool
-RROutputSetClones (RROutputPtr output,
- RROutputPtr *clones,
- int numClones)
-{
- RROutputPtr *newClones;
- int i;
-
- if (numClones == output->numClones)
- {
- for (i = 0; i < numClones; i++)
- if (output->clones[i] != clones[i])
- break;
- if (i == numClones)
- return TRUE;
- }
- if (numClones)
- {
- newClones = malloc(numClones * sizeof (RROutputPtr));
- if (!newClones)
- return FALSE;
- }
- else
- newClones = NULL;
- free(output->clones);
- memcpy (newClones, clones, numClones * sizeof (RROutputPtr));
- output->clones = newClones;
- output->numClones = numClones;
- RROutputChanged (output, TRUE);
- return TRUE;
-}
-
-Bool
-RROutputSetModes (RROutputPtr output,
- RRModePtr *modes,
- int numModes,
- int numPreferred)
-{
- RRModePtr *newModes;
- int i;
-
- if (numModes == output->numModes && numPreferred == output->numPreferred)
- {
- for (i = 0; i < numModes; i++)
- if (output->modes[i] != modes[i])
- break;
- if (i == numModes)
- {
- for (i = 0; i < numModes; i++)
- RRModeDestroy (modes[i]);
- return TRUE;
- }
- }
-
- if (numModes)
- {
- newModes = malloc(numModes * sizeof (RRModePtr));
- if (!newModes)
- return FALSE;
- }
- else
- newModes = NULL;
- if (output->modes)
- {
- for (i = 0; i < output->numModes; i++)
- RRModeDestroy (output->modes[i]);
- free(output->modes);
- }
- memcpy (newModes, modes, numModes * sizeof (RRModePtr));
- output->modes = newModes;
- output->numModes = numModes;
- output->numPreferred = numPreferred;
- RROutputChanged (output, TRUE);
- return TRUE;
-}
-
-int
-RROutputAddUserMode (RROutputPtr output,
- RRModePtr mode)
-{
- int m;
- ScreenPtr pScreen = output->pScreen;
- rrScrPriv(pScreen);
- RRModePtr *newModes;
-
- /* Check to see if this mode is already listed for this output */
- for (m = 0; m < output->numModes + output->numUserModes; m++)
- {
- RRModePtr e = (m < output->numModes ?
- output->modes[m] :
- output->userModes[m - output->numModes]);
- if (mode == e)
- return Success;
- }
-
- /* Check with the DDX to see if this mode is OK */
- if (pScrPriv->rrOutputValidateMode)
- if (!pScrPriv->rrOutputValidateMode (pScreen, output, mode))
- return BadMatch;
-
- if (output->userModes)
- newModes = realloc(output->userModes,
- (output->numUserModes + 1) * sizeof (RRModePtr));
- else
- newModes = malloc(sizeof (RRModePtr));
- if (!newModes)
- return BadAlloc;
-
- output->userModes = newModes;
- output->userModes[output->numUserModes++] = mode;
- ++mode->refcnt;
- RROutputChanged (output, TRUE);
- RRTellChanged (pScreen);
- return Success;
-}
-
-int
-RROutputDeleteUserMode (RROutputPtr output,
- RRModePtr mode)
-{
- int m;
-
- /* Find this mode in the user mode list */
- for (m = 0; m < output->numUserModes; m++)
- {
- RRModePtr e = output->userModes[m];
-
- if (mode == e)
- break;
- }
- /* Not there, access error */
- if (m == output->numUserModes)
- return BadAccess;
-
- /* make sure the mode isn't active for this output */
- if (output->crtc && output->crtc->mode == mode)
- return BadMatch;
-
- memmove (output->userModes + m, output->userModes + m + 1,
- (output->numUserModes - m - 1) * sizeof (RRModePtr));
- output->numUserModes--;
- RRModeDestroy (mode);
- return Success;
-}
-
-Bool
-RROutputSetCrtcs (RROutputPtr output,
- RRCrtcPtr *crtcs,
- int numCrtcs)
-{
- RRCrtcPtr *newCrtcs;
- int i;
-
- if (numCrtcs == output->numCrtcs)
- {
- for (i = 0; i < numCrtcs; i++)
- if (output->crtcs[i] != crtcs[i])
- break;
- if (i == numCrtcs)
- return TRUE;
- }
- if (numCrtcs)
- {
- newCrtcs = malloc(numCrtcs * sizeof (RRCrtcPtr));
- if (!newCrtcs)
- return FALSE;
- }
- else
- newCrtcs = NULL;
- free(output->crtcs);
- memcpy (newCrtcs, crtcs, numCrtcs * sizeof (RRCrtcPtr));
- output->crtcs = newCrtcs;
- output->numCrtcs = numCrtcs;
- RROutputChanged (output, TRUE);
- return TRUE;
-}
-
-Bool
-RROutputSetConnection (RROutputPtr output,
- CARD8 connection)
-{
- if (output->connection == connection)
- return TRUE;
- output->connection = connection;
- RROutputChanged (output, TRUE);
- return TRUE;
-}
-
-Bool
-RROutputSetSubpixelOrder (RROutputPtr output,
- int subpixelOrder)
-{
- if (output->subpixelOrder == subpixelOrder)
- return TRUE;
-
- output->subpixelOrder = subpixelOrder;
- RROutputChanged (output, FALSE);
- return TRUE;
-}
-
-Bool
-RROutputSetPhysicalSize (RROutputPtr output,
- int mmWidth,
- int mmHeight)
-{
- if (output->mmWidth == mmWidth && output->mmHeight == mmHeight)
- return TRUE;
- output->mmWidth = mmWidth;
- output->mmHeight = mmHeight;
- RROutputChanged (output, FALSE);
- return TRUE;
-}
-
-
-void
-RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output)
-{
- ScreenPtr pScreen = pWin->drawable.pScreen;
- rrScrPriv (pScreen);
- xRROutputChangeNotifyEvent oe;
- RRCrtcPtr crtc = output->crtc;
- RRModePtr mode = crtc ? crtc->mode : 0;
-
- oe.type = RRNotify + RREventBase;
- oe.subCode = RRNotify_OutputChange;
- oe.timestamp = pScrPriv->lastSetTime.milliseconds;
- oe.configTimestamp = pScrPriv->lastConfigTime.milliseconds;
- oe.window = pWin->drawable.id;
- oe.output = output->id;
- if (crtc)
- {
- oe.crtc = crtc->id;
- oe.mode = mode ? mode->mode.id : None;
- oe.rotation = crtc->rotation;
- }
- else
- {
- oe.crtc = None;
- oe.mode = None;
- oe.rotation = RR_Rotate_0;
- }
- oe.connection = output->connection;
- oe.subpixelOrder = output->subpixelOrder;
- WriteEventsToClient (client, 1, (xEvent *) &oe);
-}
-
-/*
- * Destroy a Output at shutdown
- */
-void
-RROutputDestroy (RROutputPtr output)
-{
- FreeResource (output->id, 0);
-}
-
-static int
-RROutputDestroyResource (pointer value, XID pid)
-{
- RROutputPtr output = (RROutputPtr) value;
- ScreenPtr pScreen = output->pScreen;
- int m;
-
- if (pScreen)
- {
- rrScrPriv(pScreen);
- int i;
-
- if (pScrPriv->primaryOutput == output)
- pScrPriv->primaryOutput = NULL;
-
- for (i = 0; i < pScrPriv->numOutputs; i++)
- {
- if (pScrPriv->outputs[i] == output)
- {
- memmove (pScrPriv->outputs + i, pScrPriv->outputs + i + 1,
- (pScrPriv->numOutputs - (i + 1)) * sizeof (RROutputPtr));
- --pScrPriv->numOutputs;
- break;
- }
- }
- }
- if (output->modes)
- {
- for (m = 0; m < output->numModes; m++)
- RRModeDestroy (output->modes[m]);
- free(output->modes);
- }
-
- for (m = 0; m < output->numUserModes; m++)
- RRModeDestroy (output->userModes[m]);
- free(output->userModes);
-
- free(output->crtcs);
- free(output->clones);
- RRDeleteAllOutputProperties (output);
- free(output);
- return 1;
-}
-
-/*
- * Initialize output type
- */
-Bool
-RROutputInit (void)
-{
- RROutputType = CreateNewResourceType (RROutputDestroyResource, "OUTPUT");
- if (!RROutputType)
- return FALSE;
-
- return TRUE;
-}
-
-/*
- * Initialize output type error value
- */
-void
-RROutputInitErrorValue(void)
-{
- SetResourceTypeErrorValue(RROutputType, RRErrorBase + BadRROutput);
-}
-
-#define OutputInfoExtra (SIZEOF(xRRGetOutputInfoReply) - 32)
-
-int
-ProcRRGetOutputInfo (ClientPtr client)
-{
- REQUEST(xRRGetOutputInfoReq);
- xRRGetOutputInfoReply rep;
- RROutputPtr output;
- CARD8 *extra;
- unsigned long extraLen;
- ScreenPtr pScreen;
- rrScrPrivPtr pScrPriv;
- RRCrtc *crtcs;
- RRMode *modes;
- RROutput *clones;
- char *name;
- int i, n;
-
- REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
- VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
-
- pScreen = output->pScreen;
- pScrPriv = rrGetScrPriv(pScreen);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = bytes_to_int32(OutputInfoExtra);
- rep.timestamp = pScrPriv->lastSetTime.milliseconds;
- rep.crtc = output->crtc ? output->crtc->id : None;
- rep.mmWidth = output->mmWidth;
- rep.mmHeight = output->mmHeight;
- rep.connection = output->connection;
- rep.subpixelOrder = output->subpixelOrder;
- rep.nCrtcs = output->numCrtcs;
- rep.nModes = output->numModes + output->numUserModes;
- rep.nPreferred = output->numPreferred;
- rep.nClones = output->numClones;
- rep.nameLength = output->nameLength;
-
- extraLen = ((output->numCrtcs +
- output->numModes + output->numUserModes +
- output->numClones +
- bytes_to_int32(rep.nameLength)) << 2);
-
- if (extraLen)
- {
- rep.length += bytes_to_int32(extraLen);
- extra = malloc(extraLen);
- if (!extra)
- return BadAlloc;
- }
- else
- extra = NULL;
-
- crtcs = (RRCrtc *) extra;
- modes = (RRMode *) (crtcs + output->numCrtcs);
- clones = (RROutput *) (modes + output->numModes + output->numUserModes);
- name = (char *) (clones + output->numClones);
-
- for (i = 0; i < output->numCrtcs; i++)
- {
- crtcs[i] = output->crtcs[i]->id;
- if (client->swapped)
- swapl (&crtcs[i], n);
- }
- for (i = 0; i < output->numModes + output->numUserModes; i++)
- {
- if (i < output->numModes)
- modes[i] = output->modes[i]->mode.id;
- else
- modes[i] = output->userModes[i - output->numModes]->mode.id;
- if (client->swapped)
- swapl (&modes[i], n);
- }
- for (i = 0; i < output->numClones; i++)
- {
- clones[i] = output->clones[i]->id;
- if (client->swapped)
- swapl (&clones[i], n);
- }
- memcpy (name, output->name, output->nameLength);
- if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.timestamp, n);
- swapl(&rep.crtc, n);
- swapl(&rep.mmWidth, n);
- swapl(&rep.mmHeight, n);
- swaps(&rep.nCrtcs, n);
- swaps(&rep.nModes, n);
- swaps(&rep.nClones, n);
- swaps(&rep.nameLength, n);
- }
- WriteToClient(client, sizeof(xRRGetOutputInfoReply), (char *)&rep);
- if (extraLen)
- {
- WriteToClient (client, extraLen, (char *) extra);
- free(extra);
- }
-
- return Success;
-}
-
-static void
-RRSetPrimaryOutput(ScreenPtr pScreen, rrScrPrivPtr pScrPriv,
- RROutputPtr output)
-{
- if (pScrPriv->primaryOutput == output)
- return;
-
- /* clear the old primary */
- if (pScrPriv->primaryOutput) {
- RROutputChanged(pScrPriv->primaryOutput, 0);
- pScrPriv->primaryOutput = NULL;
- }
-
- /* set the new primary */
- if (output) {
- pScrPriv->primaryOutput = output;
- RROutputChanged(output, 0);
- }
-
- pScrPriv->layoutChanged = TRUE;
-
- RRTellChanged(pScreen);
-}
-
-int
-ProcRRSetOutputPrimary(ClientPtr client)
-{
- REQUEST(xRRSetOutputPrimaryReq);
- RROutputPtr output = NULL;
- WindowPtr pWin;
- rrScrPrivPtr pScrPriv;
- int rc;
-
- REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq);
-
- rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
- if (stuff->output) {
- VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
-
- if (output->pScreen != pWin->drawable.pScreen) {
- client->errorValue = stuff->window;
- return BadMatch;
- }
- }
-
- pScrPriv = rrGetScrPriv(pWin->drawable.pScreen);
- RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output);
-
- return Success;
-}
-
-int
-ProcRRGetOutputPrimary(ClientPtr client)
-{
- REQUEST(xRRGetOutputPrimaryReq);
- WindowPtr pWin;
- rrScrPrivPtr pScrPriv;
- xRRGetOutputPrimaryReply rep;
- RROutputPtr primary = NULL;
- int rc;
-
- REQUEST_SIZE_MATCH(xRRGetOutputPrimaryReq);
-
- rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
- pScrPriv = rrGetScrPriv(pWin->drawable.pScreen);
- if (pScrPriv)
- primary = pScrPriv->primaryOutput;
-
- memset(&rep, 0, sizeof(rep));
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.output = primary ? primary->id : None;
-
- if (client->swapped) {
- int n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.output, n);
- }
-
- WriteToClient(client, sizeof(xRRGetOutputPrimaryReply), &rep);
-
- return Success;
-}
+/*
+ * Copyright © 2006 Keith Packard
+ * Copyright © 2008 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+#include "randrstr.h"
+
+RESTYPE RROutputType;
+
+/*
+ * Notify the output of some change
+ */
+void
+RROutputChanged (RROutputPtr output, Bool configChanged)
+{
+ ScreenPtr pScreen = output->pScreen;
+
+ output->changed = TRUE;
+ if (pScreen)
+ {
+ rrScrPriv (pScreen);
+ pScrPriv->changed = TRUE;
+ if (configChanged)
+ pScrPriv->configChanged = TRUE;
+ }
+}
+
+/*
+ * Create an output
+ */
+
+RROutputPtr
+RROutputCreate (ScreenPtr pScreen,
+ const char *name,
+ int nameLength,
+ void *devPrivate)
+{
+ RROutputPtr output;
+ RROutputPtr *outputs;
+ rrScrPrivPtr pScrPriv;
+
+ if (!RRInit())
+ return NULL;
+
+ pScrPriv = rrGetScrPriv(pScreen);
+
+ if (pScrPriv->numOutputs)
+ outputs = realloc(pScrPriv->outputs,
+ (pScrPriv->numOutputs + 1) * sizeof (RROutputPtr));
+ else
+ outputs = malloc(sizeof (RROutputPtr));
+ if (!outputs)
+ return FALSE;
+
+ pScrPriv->outputs = outputs;
+
+ output = malloc(sizeof (RROutputRec) + nameLength + 1);
+ if (!output)
+ return NULL;
+ output->id = FakeClientID (0);
+ output->pScreen = pScreen;
+ output->name = (char *) (output + 1);
+ output->nameLength = nameLength;
+ memcpy (output->name, name, nameLength);
+ output->name[nameLength] = '\0';
+ output->connection = RR_UnknownConnection;
+ output->subpixelOrder = SubPixelUnknown;
+ output->mmWidth = 0;
+ output->mmHeight = 0;
+ output->crtc = NULL;
+ output->numCrtcs = 0;
+ output->crtcs = NULL;
+ output->numClones = 0;
+ output->clones = NULL;
+ output->numModes = 0;
+ output->numPreferred = 0;
+ output->modes = NULL;
+ output->numUserModes = 0;
+ output->userModes = NULL;
+ output->properties = NULL;
+ output->pendingProperties = FALSE;
+ output->changed = FALSE;
+ output->devPrivate = devPrivate;
+
+ if (!AddResource (output->id, RROutputType, (pointer) output))
+ return NULL;
+
+ pScrPriv->outputs[pScrPriv->numOutputs++] = output;
+ return output;
+}
+
+/*
+ * Notify extension that output parameters have been changed
+ */
+Bool
+RROutputSetClones (RROutputPtr output,
+ RROutputPtr *clones,
+ int numClones)
+{
+ RROutputPtr *newClones;
+ int i;
+
+ if (numClones == output->numClones)
+ {
+ for (i = 0; i < numClones; i++)
+ if (output->clones[i] != clones[i])
+ break;
+ if (i == numClones)
+ return TRUE;
+ }
+ if (numClones)
+ {
+ newClones = malloc(numClones * sizeof (RROutputPtr));
+ if (!newClones)
+ return FALSE;
+ }
+ else
+ newClones = NULL;
+ free(output->clones);
+ memcpy (newClones, clones, numClones * sizeof (RROutputPtr));
+ output->clones = newClones;
+ output->numClones = numClones;
+ RROutputChanged (output, TRUE);
+ return TRUE;
+}
+
+Bool
+RROutputSetModes (RROutputPtr output,
+ RRModePtr *modes,
+ int numModes,
+ int numPreferred)
+{
+ RRModePtr *newModes;
+ int i;
+
+ if (numModes == output->numModes && numPreferred == output->numPreferred)
+ {
+ for (i = 0; i < numModes; i++)
+ if (output->modes[i] != modes[i])
+ break;
+ if (i == numModes)
+ {
+ for (i = 0; i < numModes; i++)
+ RRModeDestroy (modes[i]);
+ return TRUE;
+ }
+ }
+
+ if (numModes)
+ {
+ newModes = malloc(numModes * sizeof (RRModePtr));
+ if (!newModes)
+ return FALSE;
+ }
+ else
+ newModes = NULL;
+ if (output->modes)
+ {
+ for (i = 0; i < output->numModes; i++)
+ RRModeDestroy (output->modes[i]);
+ free(output->modes);
+ }
+ memcpy (newModes, modes, numModes * sizeof (RRModePtr));
+ output->modes = newModes;
+ output->numModes = numModes;
+ output->numPreferred = numPreferred;
+ RROutputChanged (output, TRUE);
+ return TRUE;
+}
+
+int
+RROutputAddUserMode (RROutputPtr output,
+ RRModePtr mode)
+{
+ int m;
+ ScreenPtr pScreen = output->pScreen;
+ rrScrPriv(pScreen);
+ RRModePtr *newModes;
+
+ /* Check to see if this mode is already listed for this output */
+ for (m = 0; m < output->numModes + output->numUserModes; m++)
+ {
+ RRModePtr e = (m < output->numModes ?
+ output->modes[m] :
+ output->userModes[m - output->numModes]);
+ if (mode == e)
+ return Success;
+ }
+
+ /* Check with the DDX to see if this mode is OK */
+ if (pScrPriv->rrOutputValidateMode)
+ if (!pScrPriv->rrOutputValidateMode (pScreen, output, mode))
+ return BadMatch;
+
+ if (output->userModes)
+ newModes = realloc(output->userModes,
+ (output->numUserModes + 1) * sizeof (RRModePtr));
+ else
+ newModes = malloc(sizeof (RRModePtr));
+ if (!newModes)
+ return BadAlloc;
+
+ output->userModes = newModes;
+ output->userModes[output->numUserModes++] = mode;
+ ++mode->refcnt;
+ RROutputChanged (output, TRUE);
+ RRTellChanged (pScreen);
+ return Success;
+}
+
+int
+RROutputDeleteUserMode (RROutputPtr output,
+ RRModePtr mode)
+{
+ int m;
+
+ /* Find this mode in the user mode list */
+ for (m = 0; m < output->numUserModes; m++)
+ {
+ RRModePtr e = output->userModes[m];
+
+ if (mode == e)
+ break;
+ }
+ /* Not there, access error */
+ if (m == output->numUserModes)
+ return BadAccess;
+
+ /* make sure the mode isn't active for this output */
+ if (output->crtc && output->crtc->mode == mode)
+ return BadMatch;
+
+ memmove (output->userModes + m, output->userModes + m + 1,
+ (output->numUserModes - m - 1) * sizeof (RRModePtr));
+ output->numUserModes--;
+ RRModeDestroy (mode);
+ return Success;
+}
+
+Bool
+RROutputSetCrtcs (RROutputPtr output,
+ RRCrtcPtr *crtcs,
+ int numCrtcs)
+{
+ RRCrtcPtr *newCrtcs;
+ int i;
+
+ if (numCrtcs == output->numCrtcs)
+ {
+ for (i = 0; i < numCrtcs; i++)
+ if (output->crtcs[i] != crtcs[i])
+ break;
+ if (i == numCrtcs)
+ return TRUE;
+ }
+ if (numCrtcs)
+ {
+ newCrtcs = malloc(numCrtcs * sizeof (RRCrtcPtr));
+ if (!newCrtcs)
+ return FALSE;
+ }
+ else
+ newCrtcs = NULL;
+ free(output->crtcs);
+ memcpy (newCrtcs, crtcs, numCrtcs * sizeof (RRCrtcPtr));
+ output->crtcs = newCrtcs;
+ output->numCrtcs = numCrtcs;
+ RROutputChanged (output, TRUE);
+ return TRUE;
+}
+
+Bool
+RROutputSetConnection (RROutputPtr output,
+ CARD8 connection)
+{
+ if (output->connection == connection)
+ return TRUE;
+ output->connection = connection;
+ RROutputChanged (output, TRUE);
+ return TRUE;
+}
+
+Bool
+RROutputSetSubpixelOrder (RROutputPtr output,
+ int subpixelOrder)
+{
+ if (output->subpixelOrder == subpixelOrder)
+ return TRUE;
+
+ output->subpixelOrder = subpixelOrder;
+ RROutputChanged (output, FALSE);
+ return TRUE;
+}
+
+Bool
+RROutputSetPhysicalSize (RROutputPtr output,
+ int mmWidth,
+ int mmHeight)
+{
+ if (output->mmWidth == mmWidth && output->mmHeight == mmHeight)
+ return TRUE;
+ output->mmWidth = mmWidth;
+ output->mmHeight = mmHeight;
+ RROutputChanged (output, FALSE);
+ return TRUE;
+}
+
+
+void
+RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ rrScrPriv (pScreen);
+ xRROutputChangeNotifyEvent oe;
+ RRCrtcPtr crtc = output->crtc;
+ RRModePtr mode = crtc ? crtc->mode : 0;
+
+ oe.type = RRNotify + RREventBase;
+ oe.subCode = RRNotify_OutputChange;
+ oe.timestamp = pScrPriv->lastSetTime.milliseconds;
+ oe.configTimestamp = pScrPriv->lastConfigTime.milliseconds;
+ oe.window = pWin->drawable.id;
+ oe.output = output->id;
+ if (crtc)
+ {
+ oe.crtc = crtc->id;
+ oe.mode = mode ? mode->mode.id : None;
+ oe.rotation = crtc->rotation;
+ }
+ else
+ {
+ oe.crtc = None;
+ oe.mode = None;
+ oe.rotation = RR_Rotate_0;
+ }
+ oe.connection = output->connection;
+ oe.subpixelOrder = output->subpixelOrder;
+ WriteEventsToClient (client, 1, (xEvent *) &oe);
+}
+
+/*
+ * Destroy a Output at shutdown
+ */
+void
+RROutputDestroy (RROutputPtr output)
+{
+ FreeResource (output->id, 0);
+}
+
+static int
+RROutputDestroyResource (pointer value, XID pid)
+{
+ RROutputPtr output = (RROutputPtr) value;
+ ScreenPtr pScreen = output->pScreen;
+ int m;
+
+ if (pScreen)
+ {
+ rrScrPriv(pScreen);
+ int i;
+
+ if (pScrPriv->primaryOutput == output)
+ pScrPriv->primaryOutput = NULL;
+
+ for (i = 0; i < pScrPriv->numOutputs; i++)
+ {
+ if (pScrPriv->outputs[i] == output)
+ {
+ memmove (pScrPriv->outputs + i, pScrPriv->outputs + i + 1,
+ (pScrPriv->numOutputs - (i + 1)) * sizeof (RROutputPtr));
+ --pScrPriv->numOutputs;
+ break;
+ }
+ }
+ }
+ if (output->modes)
+ {
+ for (m = 0; m < output->numModes; m++)
+ RRModeDestroy (output->modes[m]);
+ free(output->modes);
+ }
+
+ for (m = 0; m < output->numUserModes; m++)
+ RRModeDestroy (output->userModes[m]);
+ free(output->userModes);
+
+ free(output->crtcs);
+ free(output->clones);
+ RRDeleteAllOutputProperties (output);
+ free(output);
+ return 1;
+}
+
+/*
+ * Initialize output type
+ */
+Bool
+RROutputInit (void)
+{
+ RROutputType = CreateNewResourceType (RROutputDestroyResource, "OUTPUT");
+ if (!RROutputType)
+ return FALSE;
+
+ return TRUE;
+}
+
+/*
+ * Initialize output type error value
+ */
+void
+RROutputInitErrorValue(void)
+{
+ SetResourceTypeErrorValue(RROutputType, RRErrorBase + BadRROutput);
+}
+
+#define OutputInfoExtra (SIZEOF(xRRGetOutputInfoReply) - 32)
+
+int
+ProcRRGetOutputInfo (ClientPtr client)
+{
+ REQUEST(xRRGetOutputInfoReq);
+ xRRGetOutputInfoReply rep;
+ RROutputPtr output;
+ CARD8 *extra;
+ unsigned long extraLen;
+ ScreenPtr pScreen;
+ rrScrPrivPtr pScrPriv;
+ RRCrtc *crtcs;
+ RRMode *modes;
+ RROutput *clones;
+ char *name;
+ int i;
+
+ REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
+ VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
+
+ pScreen = output->pScreen;
+ pScrPriv = rrGetScrPriv(pScreen);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = bytes_to_int32(OutputInfoExtra);
+ rep.timestamp = pScrPriv->lastSetTime.milliseconds;
+ rep.crtc = output->crtc ? output->crtc->id : None;
+ rep.mmWidth = output->mmWidth;
+ rep.mmHeight = output->mmHeight;
+ rep.connection = output->connection;
+ rep.subpixelOrder = output->subpixelOrder;
+ rep.nCrtcs = output->numCrtcs;
+ rep.nModes = output->numModes + output->numUserModes;
+ rep.nPreferred = output->numPreferred;
+ rep.nClones = output->numClones;
+ rep.nameLength = output->nameLength;
+
+ extraLen = ((output->numCrtcs +
+ output->numModes + output->numUserModes +
+ output->numClones +
+ bytes_to_int32(rep.nameLength)) << 2);
+
+ if (extraLen)
+ {
+ rep.length += bytes_to_int32(extraLen);
+ extra = malloc(extraLen);
+ if (!extra)
+ return BadAlloc;
+ }
+ else
+ extra = NULL;
+
+ crtcs = (RRCrtc *) extra;
+ modes = (RRMode *) (crtcs + output->numCrtcs);
+ clones = (RROutput *) (modes + output->numModes + output->numUserModes);
+ name = (char *) (clones + output->numClones);
+
+ for (i = 0; i < output->numCrtcs; i++)
+ {
+ crtcs[i] = output->crtcs[i]->id;
+ if (client->swapped)
+ swapl(&crtcs[i]);
+ }
+ for (i = 0; i < output->numModes + output->numUserModes; i++)
+ {
+ if (i < output->numModes)
+ modes[i] = output->modes[i]->mode.id;
+ else
+ modes[i] = output->userModes[i - output->numModes]->mode.id;
+ if (client->swapped)
+ swapl(&modes[i]);
+ }
+ for (i = 0; i < output->numClones; i++)
+ {
+ clones[i] = output->clones[i]->id;
+ if (client->swapped)
+ swapl(&clones[i]);
+ }
+ memcpy (name, output->name, output->nameLength);
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.timestamp);
+ swapl(&rep.crtc);
+ swapl(&rep.mmWidth);
+ swapl(&rep.mmHeight);
+ swaps(&rep.nCrtcs);
+ swaps(&rep.nModes);
+ swaps(&rep.nClones);
+ swaps(&rep.nameLength);
+ }
+ WriteToClient(client, sizeof(xRRGetOutputInfoReply), (char *)&rep);
+ if (extraLen)
+ {
+ WriteToClient (client, extraLen, (char *) extra);
+ free(extra);
+ }
+
+ return Success;
+}
+
+static void
+RRSetPrimaryOutput(ScreenPtr pScreen, rrScrPrivPtr pScrPriv,
+ RROutputPtr output)
+{
+ if (pScrPriv->primaryOutput == output)
+ return;
+
+ /* clear the old primary */
+ if (pScrPriv->primaryOutput) {
+ RROutputChanged(pScrPriv->primaryOutput, 0);
+ pScrPriv->primaryOutput = NULL;
+ }
+
+ /* set the new primary */
+ if (output) {
+ pScrPriv->primaryOutput = output;
+ RROutputChanged(output, 0);
+ }
+
+ pScrPriv->layoutChanged = TRUE;
+
+ RRTellChanged(pScreen);
+}
+
+int
+ProcRRSetOutputPrimary(ClientPtr client)
+{
+ REQUEST(xRRSetOutputPrimaryReq);
+ RROutputPtr output = NULL;
+ WindowPtr pWin;
+ rrScrPrivPtr pScrPriv;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq);
+
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ if (stuff->output) {
+ VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
+
+ if (output->pScreen != pWin->drawable.pScreen) {
+ client->errorValue = stuff->window;
+ return BadMatch;
+ }
+ }
+
+ pScrPriv = rrGetScrPriv(pWin->drawable.pScreen);
+ RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output);
+
+ return Success;
+}
+
+int
+ProcRRGetOutputPrimary(ClientPtr client)
+{
+ REQUEST(xRRGetOutputPrimaryReq);
+ WindowPtr pWin;
+ rrScrPrivPtr pScrPriv;
+ xRRGetOutputPrimaryReply rep;
+ RROutputPtr primary = NULL;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xRRGetOutputPrimaryReq);
+
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ pScrPriv = rrGetScrPriv(pWin->drawable.pScreen);
+ if (pScrPriv)
+ primary = pScrPriv->primaryOutput;
+
+ memset(&rep, 0, sizeof(rep));
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.output = primary ? primary->id : None;
+
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.output);
+ }
+
+ WriteToClient(client, sizeof(xRRGetOutputPrimaryReply), &rep);
+
+ return Success;
+}
diff --git a/xorg-server/randr/rrproperty.c b/xorg-server/randr/rrproperty.c
index 61e7bb45a..6ed24d3aa 100644
--- a/xorg-server/randr/rrproperty.c
+++ b/xorg-server/randr/rrproperty.c
@@ -409,10 +409,9 @@ ProcRRListOutputProperties (ClientPtr client)
rep.nAtoms = numProps;
if (client->swapped)
{
- int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swaps (&rep.nAtoms, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.nAtoms);
}
temppAtoms = pAtoms;
for (prop = output->properties; prop; prop = prop->next)
@@ -458,9 +457,8 @@ ProcRRQueryOutputProperty (ClientPtr client)
rep.immutable = prop->immutable;
if (client->swapped)
{
- int n;
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
}
WriteToClient (client, sizeof (xRRQueryOutputPropertyReply), (char*)&rep);
if (prop->num_valid)
@@ -615,13 +613,11 @@ ProcRRGetOutputProperty (ClientPtr client)
reply.propertyType = None;
reply.format = 0;
if (client->swapped) {
- int n;
-
- swaps(&reply.sequenceNumber, n);
- swapl(&reply.length, n);
- swapl(&reply.propertyType, n);
- swapl(&reply.bytesAfter, n);
- swapl(&reply.nItems, n);
+ swaps(&reply.sequenceNumber);
+ swapl(&reply.length);
+ swapl(&reply.propertyType);
+ swapl(&reply.bytesAfter);
+ swapl(&reply.nItems);
}
WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply);
return Success;
@@ -647,13 +643,11 @@ ProcRRGetOutputProperty (ClientPtr client)
reply.nItems = 0;
reply.propertyType = prop_value->type;
if (client->swapped) {
- int n;
-
- swaps(&reply.sequenceNumber, n);
- swapl(&reply.length, n);
- swapl(&reply.propertyType, n);
- swapl(&reply.bytesAfter, n);
- swapl(&reply.nItems, n);
+ swaps(&reply.sequenceNumber);
+ swapl(&reply.length);
+ swapl(&reply.propertyType);
+ swapl(&reply.bytesAfter);
+ swapl(&reply.nItems);
}
WriteToClient(client, sizeof(xRRGetOutputPropertyReply), &reply);
return Success;
@@ -704,13 +698,11 @@ ProcRRGetOutputProperty (ClientPtr client)
}
if (client->swapped) {
- int n;
-
- swaps(&reply.sequenceNumber, n);
- swapl(&reply.length, n);
- swapl(&reply.propertyType, n);
- swapl(&reply.bytesAfter, n);
- swapl(&reply.nItems, n);
+ swaps(&reply.sequenceNumber);
+ swapl(&reply.length);
+ swapl(&reply.propertyType);
+ swapl(&reply.bytesAfter);
+ swapl(&reply.nItems);
}
WriteToClient(client, sizeof(xGenericReply), &reply);
if (len)
diff --git a/xorg-server/randr/rrscreen.c b/xorg-server/randr/rrscreen.c
index da6d48d6e..ab4675734 100644
--- a/xorg-server/randr/rrscreen.c
+++ b/xorg-server/randr/rrscreen.c
@@ -232,14 +232,12 @@ ProcRRGetScreenSizeRange (ClientPtr client)
}
if (client->swapped)
{
- int n;
-
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.minWidth, n);
- swaps(&rep.minHeight, n);
- swaps(&rep.maxWidth, n);
- swaps(&rep.maxHeight, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.minWidth);
+ swaps(&rep.minHeight);
+ swaps(&rep.maxWidth);
+ swaps(&rep.maxHeight);
}
WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), (char *)&rep);
return Success;
@@ -318,7 +316,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
rrScrPrivPtr pScrPriv;
CARD8 *extra;
unsigned long extraLen;
- int i, n, rc, has_primary = 0;
+ int i, rc, has_primary = 0;
RRCrtc *crtcs;
RROutput *outputs;
xRRModeInfo *modeinfos;
@@ -401,7 +399,7 @@ rrGetScreenResources(ClientPtr client, Bool query)
has_primary = 1;
crtcs[0] = pScrPriv->primaryOutput->crtc->id;
if (client->swapped)
- swapl (&crtcs[0], n);
+ swapl(&crtcs[0]);
}
for (i = 0; i < pScrPriv->numCrtcs; i++)
@@ -414,14 +412,14 @@ rrGetScreenResources(ClientPtr client, Bool query)
}
crtcs[i + has_primary] = pScrPriv->crtcs[i]->id;
if (client->swapped)
- swapl (&crtcs[i + has_primary], n);
+ swapl(&crtcs[i + has_primary]);
}
for (i = 0; i < pScrPriv->numOutputs; i++)
{
outputs[i] = pScrPriv->outputs[i]->id;
if (client->swapped)
- swapl (&outputs[i], n);
+ swapl(&outputs[i]);
}
for (i = 0; i < num_modes; i++)
@@ -430,19 +428,19 @@ rrGetScreenResources(ClientPtr client, Bool query)
modeinfos[i] = mode->mode;
if (client->swapped)
{
- swapl (&modeinfos[i].id, n);
- swaps (&modeinfos[i].width, n);
- swaps (&modeinfos[i].height, n);
- swapl (&modeinfos[i].dotClock, n);
- swaps (&modeinfos[i].hSyncStart, n);
- swaps (&modeinfos[i].hSyncEnd, n);
- swaps (&modeinfos[i].hTotal, n);
- swaps (&modeinfos[i].hSkew, n);
- swaps (&modeinfos[i].vSyncStart, n);
- swaps (&modeinfos[i].vSyncEnd, n);
- swaps (&modeinfos[i].vTotal, n);
- swaps (&modeinfos[i].nameLength, n);
- swapl (&modeinfos[i].modeFlags, n);
+ swapl(&modeinfos[i].id);
+ swaps(&modeinfos[i].width);
+ swaps(&modeinfos[i].height);
+ swapl(&modeinfos[i].dotClock);
+ swaps(&modeinfos[i].hSyncStart);
+ swaps(&modeinfos[i].hSyncEnd);
+ swaps(&modeinfos[i].hTotal);
+ swaps(&modeinfos[i].hSkew);
+ swaps(&modeinfos[i].vSyncStart);
+ swaps(&modeinfos[i].vSyncEnd);
+ swaps(&modeinfos[i].vTotal);
+ swaps(&modeinfos[i].nameLength);
+ swapl(&modeinfos[i].modeFlags);
}
memcpy (names, mode->name,
mode->mode.nameLength);
@@ -453,14 +451,14 @@ rrGetScreenResources(ClientPtr client, Bool query)
}
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.timestamp, n);
- swapl(&rep.configTimestamp, n);
- swaps(&rep.nCrtcs, n);
- swaps(&rep.nOutputs, n);
- swaps(&rep.nModes, n);
- swaps(&rep.nbytesNames, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.timestamp);
+ swapl(&rep.configTimestamp);
+ swaps(&rep.nCrtcs);
+ swaps(&rep.nOutputs);
+ swaps(&rep.nModes);
+ swaps(&rep.nbytesNames);
}
WriteToClient(client, sizeof(xRRGetScreenResourcesReply), (char *)&rep);
if (extraLen)
@@ -592,7 +590,7 @@ ProcRRGetScreenInfo (ClientPtr client)
REQUEST(xRRGetScreenInfoReq);
xRRGetScreenInfoReply rep;
WindowPtr pWin;
- int n, rc;
+ int rc;
ScreenPtr pScreen;
rrScrPrivPtr pScrPriv;
CARD8 *extra;
@@ -688,10 +686,10 @@ ProcRRGetScreenInfo (ClientPtr client)
size->heightInMillimeters = pSize->mmHeight;
if (client->swapped)
{
- swaps (&size->widthInPixels, n);
- swaps (&size->heightInPixels, n);
- swaps (&size->widthInMillimeters, n);
- swaps (&size->heightInMillimeters, n);
+ swaps(&size->widthInPixels);
+ swaps(&size->heightInPixels);
+ swaps(&size->widthInMillimeters);
+ swaps(&size->heightInMillimeters);
}
size++;
if (has_rate)
@@ -699,7 +697,7 @@ ProcRRGetScreenInfo (ClientPtr client)
*rates = pSize->nRates;
if (client->swapped)
{
- swaps (rates, n);
+ swaps(rates);
}
rates++;
for (j = 0; j < pSize->nRates; j++)
@@ -707,7 +705,7 @@ ProcRRGetScreenInfo (ClientPtr client)
*rates = pSize->pRates[j].rate;
if (client->swapped)
{
- swaps (rates, n);
+ swaps(rates);
}
rates++;
}
@@ -723,14 +721,14 @@ ProcRRGetScreenInfo (ClientPtr client)
rep.length = bytes_to_int32(extraLen);
}
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.timestamp, n);
- swaps(&rep.rotation, n);
- swaps(&rep.nSizes, n);
- swaps(&rep.sizeID, n);
- swaps(&rep.rate, n);
- swaps(&rep.nrateEnts, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.timestamp);
+ swaps(&rep.rotation);
+ swaps(&rep.nSizes);
+ swaps(&rep.sizeID);
+ swaps(&rep.rate);
+ swaps(&rep.nrateEnts);
}
WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *)&rep);
if (extraLen)
@@ -747,7 +745,7 @@ ProcRRSetScreenConfig (ClientPtr client)
REQUEST(xRRSetScreenConfigReq);
xRRSetScreenConfigReply rep;
DrawablePtr pDraw;
- int n, rc;
+ int rc;
ScreenPtr pScreen;
rrScrPrivPtr pScrPriv;
TimeStamp time;
@@ -976,11 +974,11 @@ sendReply:
if (client->swapped)
{
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.newTimestamp, n);
- swapl(&rep.newConfigTimestamp, n);
- swapl(&rep.root, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.newTimestamp);
+ swapl(&rep.newConfigTimestamp);
+ swapl(&rep.root);
}
WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep);
diff --git a/xorg-server/randr/rrsdispatch.c b/xorg-server/randr/rrsdispatch.c
index e16090a41..543fc9022 100644
--- a/xorg-server/randr/rrsdispatch.c
+++ b/xorg-server/randr/rrsdispatch.c
@@ -25,149 +25,138 @@
static int
SProcRRQueryVersion (ClientPtr client)
{
- register int n;
REQUEST(xRRQueryVersionReq);
- swaps(&stuff->length, n);
- swapl(&stuff->majorVersion, n);
- swapl(&stuff->minorVersion, n);
+ swaps(&stuff->length);
+ swapl(&stuff->majorVersion);
+ swapl(&stuff->minorVersion);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRGetScreenInfo (ClientPtr client)
{
- register int n;
REQUEST(xRRGetScreenInfoReq);
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
+ swaps(&stuff->length);
+ swapl(&stuff->window);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRSetScreenConfig (ClientPtr client)
{
- register int n;
REQUEST(xRRSetScreenConfigReq);
if (RRClientKnowsRates (client))
{
REQUEST_SIZE_MATCH (xRRSetScreenConfigReq);
- swaps (&stuff->rate, n);
+ swaps(&stuff->rate);
}
else
{
REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq);
}
- swaps(&stuff->length, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->timestamp, n);
- swaps(&stuff->sizeID, n);
- swaps(&stuff->rotation, n);
+ swaps(&stuff->length);
+ swapl(&stuff->drawable);
+ swapl(&stuff->timestamp);
+ swaps(&stuff->sizeID);
+ swaps(&stuff->rotation);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRSelectInput (ClientPtr client)
{
- register int n;
REQUEST(xRRSelectInputReq);
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
- swaps(&stuff->enable, n);
+ swaps(&stuff->length);
+ swapl(&stuff->window);
+ swaps(&stuff->enable);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRGetScreenSizeRange (ClientPtr client)
{
- int n;
REQUEST(xRRGetScreenSizeRangeReq);
REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq);
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
+ swaps(&stuff->length);
+ swapl(&stuff->window);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRSetScreenSize (ClientPtr client)
{
- int n;
REQUEST(xRRSetScreenSizeReq);
REQUEST_SIZE_MATCH(xRRSetScreenSizeReq);
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- swapl(&stuff->widthInMillimeters, n);
- swapl(&stuff->heightInMillimeters, n);
+ swaps(&stuff->length);
+ swapl(&stuff->window);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
+ swapl(&stuff->widthInMillimeters);
+ swapl(&stuff->heightInMillimeters);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRGetScreenResources (ClientPtr client)
{
- int n;
REQUEST(xRRGetScreenResourcesReq);
REQUEST_SIZE_MATCH(xRRGetScreenResourcesReq);
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
+ swaps(&stuff->length);
+ swapl(&stuff->window);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRGetOutputInfo (ClientPtr client)
{
- int n;
REQUEST(xRRGetOutputInfoReq);
REQUEST_SIZE_MATCH(xRRGetOutputInfoReq);
- swaps(&stuff->length, n);
- swapl(&stuff->output, n);
- swapl(&stuff->configTimestamp, n);
+ swaps(&stuff->length);
+ swapl(&stuff->output);
+ swapl(&stuff->configTimestamp);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRListOutputProperties (ClientPtr client)
{
- int n;
REQUEST(xRRListOutputPropertiesReq);
REQUEST_SIZE_MATCH(xRRListOutputPropertiesReq);
- swaps(&stuff->length, n);
- swapl(&stuff->output, n);
+ swaps(&stuff->length);
+ swapl(&stuff->output);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRQueryOutputProperty (ClientPtr client)
{
- int n;
REQUEST(xRRQueryOutputPropertyReq);
REQUEST_SIZE_MATCH(xRRQueryOutputPropertyReq);
- swaps(&stuff->length, n);
- swapl(&stuff->output, n);
- swapl(&stuff->property, n);
+ swaps(&stuff->length);
+ swapl(&stuff->output);
+ swapl(&stuff->property);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRConfigureOutputProperty (ClientPtr client)
{
- int n;
REQUEST(xRRConfigureOutputPropertyReq);
- swaps(&stuff->length, n);
- swapl(&stuff->output, n);
- swapl(&stuff->property, n);
+ swaps(&stuff->length);
+ swapl(&stuff->output);
+ swapl(&stuff->property);
SwapRestL(stuff);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
@@ -175,15 +164,14 @@ SProcRRConfigureOutputProperty (ClientPtr client)
static int
SProcRRChangeOutputProperty (ClientPtr client)
{
- int n;
REQUEST(xRRChangeOutputPropertyReq);
REQUEST_AT_LEAST_SIZE (xRRChangeOutputPropertyReq);
- swaps(&stuff->length, n);
- swapl(&stuff->output, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->nUnits, n);
+ swaps(&stuff->length);
+ swapl(&stuff->output);
+ swapl(&stuff->property);
+ swapl(&stuff->type);
+ swapl(&stuff->nUnits);
switch(stuff->format) {
case 8:
break;
@@ -203,125 +191,117 @@ SProcRRChangeOutputProperty (ClientPtr client)
static int
SProcRRDeleteOutputProperty (ClientPtr client)
{
- int n;
REQUEST(xRRDeleteOutputPropertyReq);
REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq);
- swaps(&stuff->length, n);
- swapl(&stuff->output, n);
- swapl(&stuff->property, n);
+ swaps(&stuff->length);
+ swapl(&stuff->output);
+ swapl(&stuff->property);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRGetOutputProperty (ClientPtr client)
{
- int n;
REQUEST(xRRGetOutputPropertyReq);
REQUEST_SIZE_MATCH(xRRGetOutputPropertyReq);
- swaps(&stuff->length, n);
- swapl(&stuff->output, n);
- swapl(&stuff->property, n);
- swapl(&stuff->type, n);
- swapl(&stuff->longOffset, n);
- swapl(&stuff->longLength, n);
+ swaps(&stuff->length);
+ swapl(&stuff->output);
+ swapl(&stuff->property);
+ swapl(&stuff->type);
+ swapl(&stuff->longOffset);
+ swapl(&stuff->longLength);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRCreateMode (ClientPtr client)
{
- int n;
xRRModeInfo *modeinfo;
REQUEST(xRRCreateModeReq);
REQUEST_AT_LEAST_SIZE(xRRCreateModeReq);
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
+ swaps(&stuff->length);
+ swapl(&stuff->window);
modeinfo = &stuff->modeInfo;
- swapl(&modeinfo->id, n);
- swaps(&modeinfo->width, n);
- swaps(&modeinfo->height, n);
- swapl(&modeinfo->dotClock, n);
- swaps(&modeinfo->hSyncStart, n);
- swaps(&modeinfo->hSyncEnd, n);
- swaps(&modeinfo->hTotal, n);
- swaps(&modeinfo->vSyncStart, n);
- swaps(&modeinfo->vSyncEnd, n);
- swaps(&modeinfo->vTotal, n);
- swaps(&modeinfo->nameLength, n);
- swapl(&modeinfo->modeFlags, n);
+ swapl(&modeinfo->id);
+ swaps(&modeinfo->width);
+ swaps(&modeinfo->height);
+ swapl(&modeinfo->dotClock);
+ swaps(&modeinfo->hSyncStart);
+ swaps(&modeinfo->hSyncEnd);
+ swaps(&modeinfo->hTotal);
+ swaps(&modeinfo->vSyncStart);
+ swaps(&modeinfo->vSyncEnd);
+ swaps(&modeinfo->vTotal);
+ swaps(&modeinfo->nameLength);
+ swapl(&modeinfo->modeFlags);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRDestroyMode (ClientPtr client)
{
- int n;
REQUEST(xRRDestroyModeReq);
REQUEST_SIZE_MATCH(xRRDestroyModeReq);
- swaps(&stuff->length, n);
- swapl(&stuff->mode, n);
+ swaps(&stuff->length);
+ swapl(&stuff->mode);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRAddOutputMode (ClientPtr client)
{
- int n;
REQUEST(xRRAddOutputModeReq);
REQUEST_SIZE_MATCH(xRRAddOutputModeReq);
- swaps(&stuff->length, n);
- swapl(&stuff->output, n);
- swapl(&stuff->mode, n);
+ swaps(&stuff->length);
+ swapl(&stuff->output);
+ swapl(&stuff->mode);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRDeleteOutputMode (ClientPtr client)
{
- int n;
REQUEST(xRRDeleteOutputModeReq);
REQUEST_SIZE_MATCH(xRRDeleteOutputModeReq);
- swaps(&stuff->length, n);
- swapl(&stuff->output, n);
- swapl(&stuff->mode, n);
+ swaps(&stuff->length);
+ swapl(&stuff->output);
+ swapl(&stuff->mode);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRGetCrtcInfo (ClientPtr client)
{
- int n;
REQUEST(xRRGetCrtcInfoReq);
REQUEST_SIZE_MATCH(xRRGetCrtcInfoReq);
- swaps(&stuff->length, n);
- swapl(&stuff->crtc, n);
- swapl(&stuff->configTimestamp, n);
+ swaps(&stuff->length);
+ swapl(&stuff->crtc);
+ swapl(&stuff->configTimestamp);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRSetCrtcConfig (ClientPtr client)
{
- int n;
REQUEST(xRRSetCrtcConfigReq);
REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq);
- swaps(&stuff->length, n);
- swapl(&stuff->crtc, n);
- swapl(&stuff->timestamp, n);
- swapl(&stuff->configTimestamp, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
- swapl(&stuff->mode, n);
- swaps(&stuff->rotation, n);
+ swaps(&stuff->length);
+ swapl(&stuff->crtc);
+ swapl(&stuff->timestamp);
+ swapl(&stuff->configTimestamp);
+ swaps(&stuff->x);
+ swaps(&stuff->y);
+ swapl(&stuff->mode);
+ swaps(&stuff->rotation);
SwapRestL(stuff);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
@@ -329,37 +309,34 @@ SProcRRSetCrtcConfig (ClientPtr client)
static int
SProcRRGetCrtcGammaSize (ClientPtr client)
{
- int n;
REQUEST(xRRGetCrtcGammaSizeReq);
REQUEST_SIZE_MATCH(xRRGetCrtcGammaSizeReq);
- swaps(&stuff->length, n);
- swapl(&stuff->crtc, n);
+ swaps(&stuff->length);
+ swapl(&stuff->crtc);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRGetCrtcGamma (ClientPtr client)
{
- int n;
REQUEST(xRRGetCrtcGammaReq);
REQUEST_SIZE_MATCH(xRRGetCrtcGammaReq);
- swaps(&stuff->length, n);
- swapl(&stuff->crtc, n);
+ swaps(&stuff->length);
+ swapl(&stuff->crtc);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRSetCrtcGamma (ClientPtr client)
{
- int n;
REQUEST(xRRSetCrtcGammaReq);
REQUEST_AT_LEAST_SIZE(xRRSetCrtcGammaReq);
- swaps(&stuff->length, n);
- swapl(&stuff->crtc, n);
- swaps(&stuff->size, n);
+ swaps(&stuff->length);
+ swapl(&stuff->crtc);
+ swaps(&stuff->size);
SwapRestS(stuff);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
@@ -367,16 +344,16 @@ SProcRRSetCrtcGamma (ClientPtr client)
static int
SProcRRSetCrtcTransform (ClientPtr client)
{
- int n, nparams;
+ int nparams;
char *filter;
CARD32 *params;
REQUEST(xRRSetCrtcTransformReq);
REQUEST_AT_LEAST_SIZE(xRRSetCrtcTransformReq);
- swaps(&stuff->length, n);
- swapl(&stuff->crtc, n);
+ swaps(&stuff->length);
+ swapl(&stuff->crtc);
SwapLongs((CARD32 *)&stuff->transform, bytes_to_int32(sizeof(xRenderTransform)));
- swaps(&stuff->nbytesFilter, n);
+ swaps(&stuff->nbytesFilter);
filter = (char *)(stuff + 1);
params = (CARD32 *) (filter + pad_to_int32(stuff->nbytesFilter));
nparams = ((CARD32 *) stuff + client->req_len) - params;
@@ -390,74 +367,69 @@ SProcRRSetCrtcTransform (ClientPtr client)
static int
SProcRRGetCrtcTransform (ClientPtr client)
{
- int n;
REQUEST(xRRGetCrtcTransformReq);
REQUEST_SIZE_MATCH(xRRGetCrtcTransformReq);
- swaps(&stuff->length, n);
- swapl(&stuff->crtc, n);
+ swaps(&stuff->length);
+ swapl(&stuff->crtc);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRGetPanning (ClientPtr client)
{
- int n;
REQUEST(xRRGetPanningReq);
REQUEST_SIZE_MATCH(xRRGetPanningReq);
- swaps(&stuff->length, n);
- swapl(&stuff->crtc, n);
+ swaps(&stuff->length);
+ swapl(&stuff->crtc);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRSetPanning (ClientPtr client)
{
- int n;
REQUEST(xRRSetPanningReq);
REQUEST_SIZE_MATCH(xRRSetPanningReq);
- swaps(&stuff->length, n);
- swapl(&stuff->crtc, n);
- swapl(&stuff->timestamp, n);
- swaps(&stuff->left, n);
- swaps(&stuff->top, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
- swaps(&stuff->track_left, n);
- swaps(&stuff->track_top, n);
- swaps(&stuff->track_width, n);
- swaps(&stuff->track_height, n);
- swaps(&stuff->border_left, n);
- swaps(&stuff->border_top, n);
- swaps(&stuff->border_right, n);
- swaps(&stuff->border_bottom, n);
+ swaps(&stuff->length);
+ swapl(&stuff->crtc);
+ swapl(&stuff->timestamp);
+ swaps(&stuff->left);
+ swaps(&stuff->top);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
+ swaps(&stuff->track_left);
+ swaps(&stuff->track_top);
+ swaps(&stuff->track_width);
+ swaps(&stuff->track_height);
+ swaps(&stuff->border_left);
+ swaps(&stuff->border_top);
+ swaps(&stuff->border_right);
+ swaps(&stuff->border_bottom);
return (*ProcRandrVector[stuff->randrReqType]) (client);
}
static int
SProcRRSetOutputPrimary (ClientPtr client)
{
- int n;
REQUEST(xRRSetOutputPrimaryReq);
REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq);
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
- swapl(&stuff->output, n);
+ swaps(&stuff->length);
+ swapl(&stuff->window);
+ swapl(&stuff->output);
return ProcRandrVector[stuff->randrReqType](client);
}
static int
SProcRRGetOutputPrimary (ClientPtr client)
{
- int n;
REQUEST(xRRGetOutputPrimaryReq);
REQUEST_SIZE_MATCH(xRRGetOutputPrimaryReq);
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
+ swaps(&stuff->length);
+ swapl(&stuff->window);
return ProcRandrVector[stuff->randrReqType](client);
}
diff --git a/xorg-server/randr/rrxinerama.c b/xorg-server/randr/rrxinerama.c
index 1dee6ca22..6d4519043 100644
--- a/xorg-server/randr/rrxinerama.c
+++ b/xorg-server/randr/rrxinerama.c
@@ -1,476 +1,466 @@
-/*
- * Copyright © 2006 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that copyright
- * notice and this permission notice appear in supporting documentation, and
- * that the name of the copyright holders not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. The copyright holders make no representations
- * about the suitability of this software for any purpose. It is provided "as
- * is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
- * OF THIS SOFTWARE.
- */
-/*
- * This Xinerama implementation comes from the SiS driver which has
- * the following notice:
- */
-/*
- * SiS driver main code
- *
- * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1) Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2) Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3) The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Author: Thomas Winischhofer <thomas@winischhofer.net>
- * - driver entirely rewritten since 2001, only basic structure taken from
- * old code (except sis_dri.c, sis_shadow.c, sis_accel.c and parts of
- * sis_dga.c; these were mostly taken over; sis_dri.c was changed for
- * new versions of the DRI layer)
- *
- * This notice covers the entire driver code unless indicated otherwise.
- *
- * Formerly based on code which was
- * Copyright (C) 1998, 1999 by Alan Hourihane, Wigan, England.
- * Written by:
- * Alan Hourihane <alanh@fairlite.demon.co.uk>,
- * Mike Chapman <mike@paranoia.com>,
- * Juanjo Santamarta <santamarta@ctv.es>,
- * Mitani Hiroshi <hmitani@drl.mei.co.jp>,
- * David Thomas <davtom@dream.org.uk>.
- */
-
-#include "randrstr.h"
-#include "swaprep.h"
-#include <X11/extensions/panoramiXproto.h>
-#include "protocol-versions.h"
-
-/* Xinerama is not multi-screen capable; just report about screen 0 */
-#define RR_XINERAMA_SCREEN 0
-
-static int ProcRRXineramaQueryVersion(ClientPtr client);
-static int ProcRRXineramaGetState(ClientPtr client);
-static int ProcRRXineramaGetScreenCount(ClientPtr client);
-static int ProcRRXineramaGetScreenSize(ClientPtr client);
-static int ProcRRXineramaIsActive(ClientPtr client);
-static int ProcRRXineramaQueryScreens(ClientPtr client);
-static int SProcRRXineramaDispatch(ClientPtr client);
-
-/* Proc */
-
-int
-ProcRRXineramaQueryVersion(ClientPtr client)
-{
- xPanoramiXQueryVersionReply rep;
- register int n;
-
- REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.majorVersion = SERVER_RRXINERAMA_MAJOR_VERSION;
- rep.minorVersion = SERVER_RRXINERAMA_MINOR_VERSION;
- if(client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
- }
- WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *)&rep);
- return Success;
-}
-
-int
-ProcRRXineramaGetState(ClientPtr client)
-{
- REQUEST(xPanoramiXGetStateReq);
- WindowPtr pWin;
- xPanoramiXGetStateReply rep;
- register int n, rc;
- ScreenPtr pScreen;
- rrScrPrivPtr pScrPriv;
- Bool active = FALSE;
-
- REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
- if(rc != Success)
- return rc;
-
- pScreen = pWin->drawable.pScreen;
- pScrPriv = rrGetScrPriv(pScreen);
- if (pScrPriv)
- {
- /* XXX do we need more than this? */
- active = TRUE;
- }
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.state = active;
- rep.window = stuff->window;
- if(client->swapped) {
- swaps (&rep.sequenceNumber, n);
- swapl (&rep.length, n);
- swapl (&rep.window, n);
- }
- WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *)&rep);
- return Success;
-}
-
-static Bool
-RRXineramaCrtcActive (RRCrtcPtr crtc)
-{
- return crtc->mode != NULL && crtc->numOutputs > 0;
-}
-
-static int
-RRXineramaScreenCount (ScreenPtr pScreen)
-{
- int i, n;
-
- n = 0;
- if (rrGetScrPriv (pScreen))
- {
- rrScrPriv(pScreen);
- for (i = 0; i < pScrPriv->numCrtcs; i++)
- if (RRXineramaCrtcActive (pScrPriv->crtcs[i]))
- n++;
- }
- return n;
-}
-
-static Bool
-RRXineramaScreenActive (ScreenPtr pScreen)
-{
- return RRXineramaScreenCount (pScreen) > 0;
-}
-
-int
-ProcRRXineramaGetScreenCount(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenCountReq);
- WindowPtr pWin;
- xPanoramiXGetScreenCountReply rep;
- register int n, rc;
-
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.ScreenCount = RRXineramaScreenCount (pWin->drawable.pScreen);
- rep.window = stuff->window;
- if(client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.window, n);
- }
- WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep);
- return Success;
-}
-
-int
-ProcRRXineramaGetScreenSize(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenSizeReq);
- WindowPtr pWin, pRoot;
- ScreenPtr pScreen;
- xPanoramiXGetScreenSizeReply rep;
- register int n, rc;
-
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
- pScreen = pWin->drawable.pScreen;
- pRoot = pScreen->root;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.width = pRoot->drawable.width;
- rep.height = pRoot->drawable.height;
- rep.window = stuff->window;
- rep.screen = stuff->screen;
- if(client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.width, n);
- swapl(&rep.height, n);
- swapl(&rep.window, n);
- swapl(&rep.screen, n);
- }
- WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep);
- return Success;
-}
-
-int
-ProcRRXineramaIsActive(ClientPtr client)
-{
- xXineramaIsActiveReply rep;
-
- REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
-
- memset(&rep, 0, sizeof(xXineramaIsActiveReply));
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.state = RRXineramaScreenActive (screenInfo.screens[RR_XINERAMA_SCREEN]);
- if(client->swapped) {
- register int n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.state, n);
- }
- WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep);
- return Success;
-}
-
-static void
-RRXineramaWriteCrtc(ClientPtr client, RRCrtcPtr crtc)
-{
- xXineramaScreenInfo scratch;
-
- if (RRXineramaCrtcActive (crtc))
- {
- ScreenPtr pScreen = crtc->pScreen;
- rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen);
- BoxRec panned_area;
-
- /* Check to see if crtc is panned and return the full area when applicable. */
- if (pScrPriv && pScrPriv->rrGetPanning &&
- pScrPriv->rrGetPanning (pScreen, crtc, &panned_area, NULL, NULL) &&
- (panned_area.x2 > panned_area.x1) && (panned_area.y2 > panned_area.y1)) {
- scratch.x_org = panned_area.x1;
- scratch.y_org = panned_area.y1;
- scratch.width = panned_area.x2 - panned_area.x1;
- scratch.height = panned_area.y2 - panned_area.y1;
- } else {
- int width, height;
- RRCrtcGetScanoutSize (crtc, &width, &height);
- scratch.x_org = crtc->x;
- scratch.y_org = crtc->y;
- scratch.width = width;
- scratch.height = height;
- }
- if(client->swapped) {
- register int n;
- swaps(&scratch.x_org, n);
- swaps(&scratch.y_org, n);
- swaps(&scratch.width, n);
- swaps(&scratch.height, n);
- }
- WriteToClient(client, sz_XineramaScreenInfo, &scratch);
- }
-}
-
-int
-ProcRRXineramaQueryScreens(ClientPtr client)
-{
- xXineramaQueryScreensReply rep;
- ScreenPtr pScreen = screenInfo.screens[RR_XINERAMA_SCREEN];
-
- REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
-
- if (RRXineramaScreenActive (pScreen))
- RRGetInfo (pScreen, FALSE);
-
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.number = RRXineramaScreenCount (pScreen);
- rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
- if(client->swapped) {
- register int n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.number, n);
- }
- WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *)&rep);
-
- if(rep.number) {
- rrScrPriv(pScreen);
- int i;
- int has_primary = 0;
-
- if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) {
- has_primary = 1;
- RRXineramaWriteCrtc(client, pScrPriv->primaryOutput->crtc);
- }
-
- for(i = 0; i < pScrPriv->numCrtcs; i++) {
- if (has_primary &&
- pScrPriv->primaryOutput->crtc == pScrPriv->crtcs[i])
- {
- has_primary = 0;
- continue;
- }
- RRXineramaWriteCrtc(client, pScrPriv->crtcs[i]);
- }
- }
-
- return Success;
-}
-
-static int
-ProcRRXineramaDispatch(ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data) {
- case X_PanoramiXQueryVersion:
- return ProcRRXineramaQueryVersion(client);
- case X_PanoramiXGetState:
- return ProcRRXineramaGetState(client);
- case X_PanoramiXGetScreenCount:
- return ProcRRXineramaGetScreenCount(client);
- case X_PanoramiXGetScreenSize:
- return ProcRRXineramaGetScreenSize(client);
- case X_XineramaIsActive:
- return ProcRRXineramaIsActive(client);
- case X_XineramaQueryScreens:
- return ProcRRXineramaQueryScreens(client);
- }
- return BadRequest;
-}
-
-/* SProc */
-
-static int
-SProcRRXineramaQueryVersion (ClientPtr client)
-{
- REQUEST(xPanoramiXQueryVersionReq);
- register int n;
- swaps(&stuff->length,n);
- REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
- return ProcRRXineramaQueryVersion(client);
-}
-
-static int
-SProcRRXineramaGetState(ClientPtr client)
-{
- REQUEST(xPanoramiXGetStateReq);
- register int n;
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
- swapl (&stuff->window, n);
- return ProcRRXineramaGetState(client);
-}
-
-static int
-SProcRRXineramaGetScreenCount(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenCountReq);
- register int n;
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
- swapl (&stuff->window, n);
- return ProcRRXineramaGetScreenCount(client);
-}
-
-static int
-SProcRRXineramaGetScreenSize(ClientPtr client)
-{
- REQUEST(xPanoramiXGetScreenSizeReq);
- register int n;
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
- swapl (&stuff->window, n);
- swapl (&stuff->screen, n);
- return ProcRRXineramaGetScreenSize(client);
-}
-
-static int
-SProcRRXineramaIsActive(ClientPtr client)
-{
- REQUEST(xXineramaIsActiveReq);
- register int n;
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
- return ProcRRXineramaIsActive(client);
-}
-
-static int
-SProcRRXineramaQueryScreens(ClientPtr client)
-{
- REQUEST(xXineramaQueryScreensReq);
- register int n;
- swaps (&stuff->length, n);
- REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
- return ProcRRXineramaQueryScreens(client);
-}
-
-int
-SProcRRXineramaDispatch(ClientPtr client)
-{
- REQUEST(xReq);
- switch (stuff->data) {
- case X_PanoramiXQueryVersion:
- return SProcRRXineramaQueryVersion(client);
- case X_PanoramiXGetState:
- return SProcRRXineramaGetState(client);
- case X_PanoramiXGetScreenCount:
- return SProcRRXineramaGetScreenCount(client);
- case X_PanoramiXGetScreenSize:
- return SProcRRXineramaGetScreenSize(client);
- case X_XineramaIsActive:
- return SProcRRXineramaIsActive(client);
- case X_XineramaQueryScreens:
- return SProcRRXineramaQueryScreens(client);
- }
- return BadRequest;
-}
-
-void
-RRXineramaExtensionInit(void)
-{
-#ifdef PANORAMIX
- if(!noPanoramiXExtension)
- return;
-#endif
-
- /*
- * Xinerama isn't capable enough to have multiple protocol screens each
- * with their own output geometry. So if there's more than one protocol
- * screen, just don't even try.
- */
- if (screenInfo.numScreens > 1)
- return;
-
- (void) AddExtension(PANORAMIX_PROTOCOL_NAME, 0,0,
- ProcRRXineramaDispatch,
- SProcRRXineramaDispatch,
- NULL,
- StandardMinorOpcode);
-}
+/*
+ * Copyright © 2006 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+/*
+ * This Xinerama implementation comes from the SiS driver which has
+ * the following notice:
+ */
+/*
+ * SiS driver main code
+ *
+ * Copyright (C) 2001-2005 by Thomas Winischhofer, Vienna, Austria.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1) Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2) Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3) The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Author: Thomas Winischhofer <thomas@winischhofer.net>
+ * - driver entirely rewritten since 2001, only basic structure taken from
+ * old code (except sis_dri.c, sis_shadow.c, sis_accel.c and parts of
+ * sis_dga.c; these were mostly taken over; sis_dri.c was changed for
+ * new versions of the DRI layer)
+ *
+ * This notice covers the entire driver code unless indicated otherwise.
+ *
+ * Formerly based on code which was
+ * Copyright (C) 1998, 1999 by Alan Hourihane, Wigan, England.
+ * Written by:
+ * Alan Hourihane <alanh@fairlite.demon.co.uk>,
+ * Mike Chapman <mike@paranoia.com>,
+ * Juanjo Santamarta <santamarta@ctv.es>,
+ * Mitani Hiroshi <hmitani@drl.mei.co.jp>,
+ * David Thomas <davtom@dream.org.uk>.
+ */
+
+#include "randrstr.h"
+#include "swaprep.h"
+#include <X11/extensions/panoramiXproto.h>
+#include "protocol-versions.h"
+
+/* Xinerama is not multi-screen capable; just report about screen 0 */
+#define RR_XINERAMA_SCREEN 0
+
+static int ProcRRXineramaQueryVersion(ClientPtr client);
+static int ProcRRXineramaGetState(ClientPtr client);
+static int ProcRRXineramaGetScreenCount(ClientPtr client);
+static int ProcRRXineramaGetScreenSize(ClientPtr client);
+static int ProcRRXineramaIsActive(ClientPtr client);
+static int ProcRRXineramaQueryScreens(ClientPtr client);
+static int SProcRRXineramaDispatch(ClientPtr client);
+
+/* Proc */
+
+int
+ProcRRXineramaQueryVersion(ClientPtr client)
+{
+ xPanoramiXQueryVersionReply rep;
+
+ REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.majorVersion = SERVER_RRXINERAMA_MAJOR_VERSION;
+ rep.minorVersion = SERVER_RRXINERAMA_MINOR_VERSION;
+ if(client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.majorVersion);
+ swaps(&rep.minorVersion);
+ }
+ WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *)&rep);
+ return Success;
+}
+
+int
+ProcRRXineramaGetState(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetStateReq);
+ WindowPtr pWin;
+ xPanoramiXGetStateReply rep;
+ register int rc;
+ ScreenPtr pScreen;
+ rrScrPrivPtr pScrPriv;
+ Bool active = FALSE;
+
+ REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if(rc != Success)
+ return rc;
+
+ pScreen = pWin->drawable.pScreen;
+ pScrPriv = rrGetScrPriv(pScreen);
+ if (pScrPriv)
+ {
+ /* XXX do we need more than this? */
+ active = TRUE;
+ }
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.state = active;
+ rep.window = stuff->window;
+ if(client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.window);
+ }
+ WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *)&rep);
+ return Success;
+}
+
+static Bool
+RRXineramaCrtcActive (RRCrtcPtr crtc)
+{
+ return crtc->mode != NULL && crtc->numOutputs > 0;
+}
+
+static int
+RRXineramaScreenCount (ScreenPtr pScreen)
+{
+ int i, n;
+
+ n = 0;
+ if (rrGetScrPriv (pScreen))
+ {
+ rrScrPriv(pScreen);
+ for (i = 0; i < pScrPriv->numCrtcs; i++)
+ if (RRXineramaCrtcActive (pScrPriv->crtcs[i]))
+ n++;
+ }
+ return n;
+}
+
+static Bool
+RRXineramaScreenActive (ScreenPtr pScreen)
+{
+ return RRXineramaScreenCount (pScreen) > 0;
+}
+
+int
+ProcRRXineramaGetScreenCount(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetScreenCountReq);
+ WindowPtr pWin;
+ xPanoramiXGetScreenCountReply rep;
+ register int rc;
+
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.ScreenCount = RRXineramaScreenCount (pWin->drawable.pScreen);
+ rep.window = stuff->window;
+ if(client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.window);
+ }
+ WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep);
+ return Success;
+}
+
+int
+ProcRRXineramaGetScreenSize(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetScreenSizeReq);
+ WindowPtr pWin, pRoot;
+ ScreenPtr pScreen;
+ xPanoramiXGetScreenSizeReply rep;
+ register int rc;
+
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ pScreen = pWin->drawable.pScreen;
+ pRoot = pScreen->root;
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.width = pRoot->drawable.width;
+ rep.height = pRoot->drawable.height;
+ rep.window = stuff->window;
+ rep.screen = stuff->screen;
+ if(client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.width);
+ swapl(&rep.height);
+ swapl(&rep.window);
+ swapl(&rep.screen);
+ }
+ WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep);
+ return Success;
+}
+
+int
+ProcRRXineramaIsActive(ClientPtr client)
+{
+ xXineramaIsActiveReply rep;
+
+ REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
+
+ memset(&rep, 0, sizeof(xXineramaIsActiveReply));
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.state = RRXineramaScreenActive (screenInfo.screens[RR_XINERAMA_SCREEN]);
+ if(client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.state);
+ }
+ WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep);
+ return Success;
+}
+
+static void
+RRXineramaWriteCrtc(ClientPtr client, RRCrtcPtr crtc)
+{
+ xXineramaScreenInfo scratch;
+
+ if (RRXineramaCrtcActive (crtc))
+ {
+ ScreenPtr pScreen = crtc->pScreen;
+ rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen);
+ BoxRec panned_area;
+
+ /* Check to see if crtc is panned and return the full area when applicable. */
+ if (pScrPriv && pScrPriv->rrGetPanning &&
+ pScrPriv->rrGetPanning (pScreen, crtc, &panned_area, NULL, NULL) &&
+ (panned_area.x2 > panned_area.x1) && (panned_area.y2 > panned_area.y1)) {
+ scratch.x_org = panned_area.x1;
+ scratch.y_org = panned_area.y1;
+ scratch.width = panned_area.x2 - panned_area.x1;
+ scratch.height = panned_area.y2 - panned_area.y1;
+ } else {
+ int width, height;
+ RRCrtcGetScanoutSize (crtc, &width, &height);
+ scratch.x_org = crtc->x;
+ scratch.y_org = crtc->y;
+ scratch.width = width;
+ scratch.height = height;
+ }
+ if(client->swapped) {
+ swaps(&scratch.x_org);
+ swaps(&scratch.y_org);
+ swaps(&scratch.width);
+ swaps(&scratch.height);
+ }
+ WriteToClient(client, sz_XineramaScreenInfo, &scratch);
+ }
+}
+
+int
+ProcRRXineramaQueryScreens(ClientPtr client)
+{
+ xXineramaQueryScreensReply rep;
+ ScreenPtr pScreen = screenInfo.screens[RR_XINERAMA_SCREEN];
+
+ REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
+
+ if (RRXineramaScreenActive (pScreen))
+ RRGetInfo (pScreen, FALSE);
+
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.number = RRXineramaScreenCount (pScreen);
+ rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
+ if(client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.number);
+ }
+ WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *)&rep);
+
+ if(rep.number) {
+ rrScrPriv(pScreen);
+ int i;
+ int has_primary = 0;
+
+ if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) {
+ has_primary = 1;
+ RRXineramaWriteCrtc(client, pScrPriv->primaryOutput->crtc);
+ }
+
+ for(i = 0; i < pScrPriv->numCrtcs; i++) {
+ if (has_primary &&
+ pScrPriv->primaryOutput->crtc == pScrPriv->crtcs[i])
+ {
+ has_primary = 0;
+ continue;
+ }
+ RRXineramaWriteCrtc(client, pScrPriv->crtcs[i]);
+ }
+ }
+
+ return Success;
+}
+
+static int
+ProcRRXineramaDispatch(ClientPtr client)
+{
+ REQUEST(xReq);
+ switch (stuff->data) {
+ case X_PanoramiXQueryVersion:
+ return ProcRRXineramaQueryVersion(client);
+ case X_PanoramiXGetState:
+ return ProcRRXineramaGetState(client);
+ case X_PanoramiXGetScreenCount:
+ return ProcRRXineramaGetScreenCount(client);
+ case X_PanoramiXGetScreenSize:
+ return ProcRRXineramaGetScreenSize(client);
+ case X_XineramaIsActive:
+ return ProcRRXineramaIsActive(client);
+ case X_XineramaQueryScreens:
+ return ProcRRXineramaQueryScreens(client);
+ }
+ return BadRequest;
+}
+
+/* SProc */
+
+static int
+SProcRRXineramaQueryVersion (ClientPtr client)
+{
+ REQUEST(xPanoramiXQueryVersionReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
+ return ProcRRXineramaQueryVersion(client);
+}
+
+static int
+SProcRRXineramaGetState(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetStateReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
+ swapl(&stuff->window);
+ return ProcRRXineramaGetState(client);
+}
+
+static int
+SProcRRXineramaGetScreenCount(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetScreenCountReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
+ swapl(&stuff->window);
+ return ProcRRXineramaGetScreenCount(client);
+}
+
+static int
+SProcRRXineramaGetScreenSize(ClientPtr client)
+{
+ REQUEST(xPanoramiXGetScreenSizeReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
+ swapl(&stuff->window);
+ swapl(&stuff->screen);
+ return ProcRRXineramaGetScreenSize(client);
+}
+
+static int
+SProcRRXineramaIsActive(ClientPtr client)
+{
+ REQUEST(xXineramaIsActiveReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
+ return ProcRRXineramaIsActive(client);
+}
+
+static int
+SProcRRXineramaQueryScreens(ClientPtr client)
+{
+ REQUEST(xXineramaQueryScreensReq);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
+ return ProcRRXineramaQueryScreens(client);
+}
+
+int
+SProcRRXineramaDispatch(ClientPtr client)
+{
+ REQUEST(xReq);
+ switch (stuff->data) {
+ case X_PanoramiXQueryVersion:
+ return SProcRRXineramaQueryVersion(client);
+ case X_PanoramiXGetState:
+ return SProcRRXineramaGetState(client);
+ case X_PanoramiXGetScreenCount:
+ return SProcRRXineramaGetScreenCount(client);
+ case X_PanoramiXGetScreenSize:
+ return SProcRRXineramaGetScreenSize(client);
+ case X_XineramaIsActive:
+ return SProcRRXineramaIsActive(client);
+ case X_XineramaQueryScreens:
+ return SProcRRXineramaQueryScreens(client);
+ }
+ return BadRequest;
+}
+
+void
+RRXineramaExtensionInit(void)
+{
+#ifdef PANORAMIX
+ if(!noPanoramiXExtension)
+ return;
+#endif
+
+ /*
+ * Xinerama isn't capable enough to have multiple protocol screens each
+ * with their own output geometry. So if there's more than one protocol
+ * screen, just don't even try.
+ */
+ if (screenInfo.numScreens > 1)
+ return;
+
+ (void) AddExtension(PANORAMIX_PROTOCOL_NAME, 0,0,
+ ProcRRXineramaDispatch,
+ SProcRRXineramaDispatch,
+ NULL,
+ StandardMinorOpcode);
+}
diff --git a/xorg-server/record/record.c b/xorg-server/record/record.c
index 69fca727e..68311ac8f 100644
--- a/xorg-server/record/record.c
+++ b/xorg-server/record/record.c
@@ -295,7 +295,6 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
CARD32 elemHeaderData[2];
int numElemHeaders = 0;
Bool recordingClientSwapped = pContext->pRecordingClient->swapped;
- int n;
CARD32 serverTime = 0;
Bool gotServerTime = FALSE;
int replylen;
@@ -339,11 +338,11 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
if (recordingClientSwapped)
{
- swaps(&pRep->sequenceNumber, n);
- swapl(&pRep->length, n);
- swapl(&pRep->idBase, n);
- swapl(&pRep->serverTime, n);
- swapl(&pRep->recordedSequenceNumber, n);
+ swaps(&pRep->sequenceNumber);
+ swapl(&pRep->length);
+ swapl(&pRep->idBase);
+ swapl(&pRep->serverTime);
+ swapl(&pRep->recordedSequenceNumber);
}
pContext->numBufBytes = SIZEOF(xRecordEnableContextReply);
}
@@ -361,7 +360,7 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
else
elemHeaderData[numElemHeaders] = GetTimeInMillis();
if (recordingClientSwapped)
- swapl(&elemHeaderData[numElemHeaders], n);
+ swapl(&elemHeaderData[numElemHeaders]);
numElemHeaders++;
}
@@ -371,17 +370,17 @@ RecordAProtocolElement(RecordContextPtr pContext, ClientPtr pClient,
{
elemHeaderData[numElemHeaders] = pClient->sequence;
if (recordingClientSwapped)
- swapl(&elemHeaderData[numElemHeaders], n);
+ swapl(&elemHeaderData[numElemHeaders]);
numElemHeaders++;
}
/* adjust reply length */
replylen = pRep->length;
- if (recordingClientSwapped) swapl(&replylen, n);
+ if (recordingClientSwapped) swapl(&replylen);
replylen += numElemHeaders + bytes_to_int32(datalen) +
bytes_to_int32(futurelen);
- if (recordingClientSwapped) swapl(&replylen, n);
+ if (recordingClientSwapped) swapl(&replylen);
pRep->length = replylen;
} /* end if not continued reply */
@@ -473,7 +472,6 @@ static void
RecordABigRequest(RecordContextPtr pContext, ClientPtr client, xReq *stuff)
{
CARD32 bigLength;
- char n;
int bytesLeft;
/* note: client->req_len has been frobbed by ReadRequestFromClient
@@ -490,7 +488,7 @@ RecordABigRequest(RecordContextPtr pContext, ClientPtr client, xReq *stuff)
/* reinsert the extended length field that was squished out */
bigLength = client->req_len + bytes_to_int32(sizeof(bigLength));
if (client->swapped)
- swapl(&bigLength, n);
+ swapl(&bigLength);
RecordAProtocolElement(pContext, client, XRecordFromClient,
(pointer)&bigLength, sizeof(bigLength), /* continuation */ -1);
bytesLeft -= sizeof(bigLength);
@@ -1892,7 +1890,6 @@ ProcRecordQueryVersion(ClientPtr client)
{
/* REQUEST(xRecordQueryVersionReq); */
xRecordQueryVersionReply rep;
- int n;
REQUEST_SIZE_MATCH(xRecordQueryVersionReq);
rep.type = X_Reply;
@@ -1902,9 +1899,9 @@ ProcRecordQueryVersion(ClientPtr client)
rep.minorVersion = SERVER_RECORD_MINOR_VERSION;
if(client->swapped)
{
- swaps(&rep.sequenceNumber, n);
- swaps(&rep.majorVersion, n);
- swaps(&rep.minorVersion, n);
+ swaps(&rep.sequenceNumber);
+ swaps(&rep.majorVersion);
+ swaps(&rep.minorVersion);
}
(void)WriteToClient(client, sizeof(xRecordQueryVersionReply),
(char *)&rep);
@@ -2207,13 +2204,12 @@ static void
RecordSwapRanges(xRecordRange *pRanges, int nRanges)
{
int i;
- register char n;
for (i = 0; i < nRanges; i++, pRanges++)
{
- swaps(&pRanges->extRequestsMinorFirst, n);
- swaps(&pRanges->extRequestsMinorLast, n);
- swaps(&pRanges->extRepliesMinorFirst, n);
- swaps(&pRanges->extRepliesMinorLast, n);
+ swaps(&pRanges->extRequestsMinorFirst);
+ swaps(&pRanges->extRequestsMinorLast);
+ swaps(&pRanges->extRepliesMinorFirst);
+ swaps(&pRanges->extRepliesMinorLast);
}
} /* RecordSwapRanges */
@@ -2224,7 +2220,6 @@ ProcRecordGetContext(ClientPtr client)
RecordContextPtr pContext;
REQUEST(xRecordGetContextReq);
xRecordGetContextReply rep;
- int n;
RecordClientsAndProtocolPtr pRCAP;
int nRCAPs = 0;
GetContextRangeInfoPtr pRangeInfo;
@@ -2323,9 +2318,9 @@ ProcRecordGetContext(ClientPtr client)
rep.elementHeader = pContext->elemHeaders;
if(client->swapped)
{
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.nClients, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.nClients);
}
(void)WriteToClient(client, sizeof(xRecordGetContextReply),
(char *)&rep);
@@ -2340,13 +2335,13 @@ ProcRecordGetContext(ClientPtr client)
rci.nRanges = pri->nRanges;
if (client->swapped)
{
- swapl(&rci.nRanges, n);
+ swapl(&rci.nRanges);
RecordSwapRanges(pri->pRanges, pri->nRanges);
}
for (i = 0; i < pRCAP->numClients; i++)
{
rci.clientResource = pRCAP->pClientIDs[i];
- if (client->swapped) swapl(&rci.clientResource, n);
+ if (client->swapped) swapl(&rci.clientResource);
WriteToClient(client, sizeof(xRecordClientInfo), (char *)&rci);
WriteToClient(client, sizeof(xRecordRange) * pri->nRanges,
(char *)pri->pRanges);
@@ -2590,12 +2585,11 @@ static int
SProcRecordQueryVersion(ClientPtr client)
{
REQUEST(xRecordQueryVersionReq);
- register char n;
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xRecordQueryVersionReq);
- swaps(&stuff->majorVersion, n);
- swaps(&stuff->minorVersion,n);
+ swaps(&stuff->majorVersion);
+ swaps(&stuff->minorVersion);
return ProcRecordQueryVersion(client);
} /* SProcRecordQueryVersion */
@@ -2603,19 +2597,18 @@ SProcRecordQueryVersion(ClientPtr client)
static int
SwapCreateRegister(xRecordRegisterClientsReq *stuff)
{
- register char n;
int i;
XID *pClientID;
- swapl(&stuff->context, n);
- swapl(&stuff->nClients, n);
- swapl(&stuff->nRanges, n);
+ swapl(&stuff->context);
+ swapl(&stuff->nClients);
+ swapl(&stuff->nRanges);
pClientID = (XID *)&stuff[1];
if (stuff->nClients > stuff->length - bytes_to_int32(sz_xRecordRegisterClientsReq))
return BadLength;
for (i = 0; i < stuff->nClients; i++, pClientID++)
{
- swapl(pClientID, n);
+ swapl(pClientID);
}
if (stuff->nRanges > stuff->length - bytes_to_int32(sz_xRecordRegisterClientsReq)
- stuff->nClients)
@@ -2630,9 +2623,8 @@ SProcRecordCreateContext(ClientPtr client)
{
REQUEST(xRecordCreateContextReq);
int status;
- register char n;
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xRecordCreateContextReq);
if ((status = SwapCreateRegister((pointer)stuff)) != Success)
return status;
@@ -2645,9 +2637,8 @@ SProcRecordRegisterClients(ClientPtr client)
{
REQUEST(xRecordRegisterClientsReq);
int status;
- register char n;
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xRecordRegisterClientsReq);
if ((status = SwapCreateRegister((pointer)stuff)) != Success)
return status;
@@ -2659,12 +2650,11 @@ static int
SProcRecordUnregisterClients(ClientPtr client)
{
REQUEST(xRecordUnregisterClientsReq);
- register char n;
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xRecordUnregisterClientsReq);
- swapl(&stuff->context, n);
- swapl(&stuff->nClients, n);
+ swapl(&stuff->context);
+ swapl(&stuff->nClients);
SwapRestL(stuff);
return ProcRecordUnregisterClients(client);
} /* SProcRecordUnregisterClients */
@@ -2674,11 +2664,10 @@ static int
SProcRecordGetContext(ClientPtr client)
{
REQUEST(xRecordGetContextReq);
- register char n;
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xRecordGetContextReq);
- swapl(&stuff->context, n);
+ swapl(&stuff->context);
return ProcRecordGetContext(client);
} /* SProcRecordGetContext */
@@ -2686,11 +2675,10 @@ static int
SProcRecordEnableContext(ClientPtr client)
{
REQUEST(xRecordEnableContextReq);
- register char n;
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xRecordEnableContextReq);
- swapl(&stuff->context, n);
+ swapl(&stuff->context);
return ProcRecordEnableContext(client);
} /* SProcRecordEnableContext */
@@ -2699,11 +2687,10 @@ static int
SProcRecordDisableContext(ClientPtr client)
{
REQUEST(xRecordDisableContextReq);
- register char n;
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xRecordDisableContextReq);
- swapl(&stuff->context, n);
+ swapl(&stuff->context);
return ProcRecordDisableContext(client);
} /* SProcRecordDisableContext */
@@ -2712,11 +2699,10 @@ static int
SProcRecordFreeContext(ClientPtr client)
{
REQUEST(xRecordFreeContextReq);
- register char n;
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xRecordFreeContextReq);
- swapl(&stuff->context, n);
+ swapl(&stuff->context);
return ProcRecordFreeContext(client);
} /* SProcRecordFreeContext */
diff --git a/xorg-server/render/mipict.c b/xorg-server/render/mipict.c
index 8445f5c6f..61b368472 100644
--- a/xorg-server/render/mipict.c
+++ b/xorg-server/render/mipict.c
@@ -1,610 +1,606 @@
-/*
- *
- * Copyright © 1999 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "scrnintstr.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "windowstr.h"
-#include "mi.h"
-#include "picturestr.h"
-#include "mipict.h"
-
-#ifndef __GNUC__
-#define __inline
-#endif
-
-int
-miCreatePicture (PicturePtr pPicture)
-{
- return Success;
-}
-
-void
-miDestroyPicture (PicturePtr pPicture)
-{
- if (pPicture->freeCompClip)
- RegionDestroy(pPicture->pCompositeClip);
-}
-
-void
-miDestroyPictureClip (PicturePtr pPicture)
-{
- switch (pPicture->clientClipType) {
- case CT_NONE:
- return;
- case CT_PIXMAP:
- (*pPicture->pDrawable->pScreen->DestroyPixmap) ((PixmapPtr) (pPicture->clientClip));
- break;
- default:
- /*
- * we know we'll never have a list of rectangles, since ChangeClip
- * immediately turns them into a region
- */
- RegionDestroy(pPicture->clientClip);
- break;
- }
- pPicture->clientClip = NULL;
- pPicture->clientClipType = CT_NONE;
-}
-
-int
-miChangePictureClip (PicturePtr pPicture,
- int type,
- pointer value,
- int n)
-{
- ScreenPtr pScreen = pPicture->pDrawable->pScreen;
- PictureScreenPtr ps = GetPictureScreen(pScreen);
- pointer clientClip;
- int clientClipType;
-
- switch (type) {
- case CT_PIXMAP:
- /* convert the pixmap to a region */
- clientClip = (pointer) BitmapToRegion(pScreen, (PixmapPtr) value);
- if (!clientClip)
- return BadAlloc;
- clientClipType = CT_REGION;
- (*pScreen->DestroyPixmap) ((PixmapPtr) value);
- break;
- case CT_REGION:
- clientClip = value;
- clientClipType = CT_REGION;
- break;
- case CT_NONE:
- clientClip = 0;
- clientClipType = CT_NONE;
- break;
- default:
- clientClip = (pointer) RegionFromRects(n,
- (xRectangle *) value,
- type);
- if (!clientClip)
- return BadAlloc;
- clientClipType = CT_REGION;
- free(value);
- break;
- }
- (*ps->DestroyPictureClip) (pPicture);
- pPicture->clientClip = clientClip;
- pPicture->clientClipType = clientClipType;
- pPicture->stateChanges |= CPClipMask;
- return Success;
-}
-
-void
-miChangePicture (PicturePtr pPicture,
- Mask mask)
-{
- return;
-}
-
-void
-miValidatePicture (PicturePtr pPicture,
- Mask mask)
-{
- DrawablePtr pDrawable = pPicture->pDrawable;
-
- if ((mask & (CPClipXOrigin|CPClipYOrigin|CPClipMask|CPSubwindowMode)) ||
- (pDrawable->serialNumber != (pPicture->serialNumber & DRAWABLE_SERIAL_BITS)))
- {
- if (pDrawable->type == DRAWABLE_WINDOW)
- {
- WindowPtr pWin = (WindowPtr) pDrawable;
- RegionPtr pregWin;
- Bool freeTmpClip, freeCompClip;
-
- if (pPicture->subWindowMode == IncludeInferiors)
- {
- pregWin = NotClippedByChildren(pWin);
- freeTmpClip = TRUE;
- }
- else
- {
- pregWin = &pWin->clipList;
- freeTmpClip = FALSE;
- }
- freeCompClip = pPicture->freeCompClip;
-
- /*
- * if there is no client clip, we can get by with just keeping the
- * pointer we got, and remembering whether or not should destroy
- * (or maybe re-use) it later. this way, we avoid unnecessary
- * copying of regions. (this wins especially if many clients clip
- * by children and have no client clip.)
- */
- if (pPicture->clientClipType == CT_NONE)
- {
- if (freeCompClip)
- RegionDestroy(pPicture->pCompositeClip);
- pPicture->pCompositeClip = pregWin;
- pPicture->freeCompClip = freeTmpClip;
- }
- else
- {
- /*
- * we need one 'real' region to put into the composite clip. if
- * pregWin the current composite clip are real, we can get rid of
- * one. if pregWin is real and the current composite clip isn't,
- * use pregWin for the composite clip. if the current composite
- * clip is real and pregWin isn't, use the current composite
- * clip. if neither is real, create a new region.
- */
-
- RegionTranslate(pPicture->clientClip,
- pDrawable->x + pPicture->clipOrigin.x,
- pDrawable->y + pPicture->clipOrigin.y);
-
- if (freeCompClip)
- {
- RegionIntersect(pPicture->pCompositeClip,
- pregWin, pPicture->clientClip);
- if (freeTmpClip)
- RegionDestroy(pregWin);
- }
- else if (freeTmpClip)
- {
- RegionIntersect(pregWin, pregWin, pPicture->clientClip);
- pPicture->pCompositeClip = pregWin;
- }
- else
- {
- pPicture->pCompositeClip = RegionCreate(NullBox, 0);
- RegionIntersect(pPicture->pCompositeClip,
- pregWin, pPicture->clientClip);
- }
- pPicture->freeCompClip = TRUE;
- RegionTranslate(pPicture->clientClip,
- -(pDrawable->x + pPicture->clipOrigin.x),
- -(pDrawable->y + pPicture->clipOrigin.y));
- }
- } /* end of composite clip for a window */
- else
- {
- BoxRec pixbounds;
-
- /* XXX should we translate by drawable.x/y here ? */
- /* If you want pixmaps in offscreen memory, yes */
- pixbounds.x1 = pDrawable->x;
- pixbounds.y1 = pDrawable->y;
- pixbounds.x2 = pDrawable->x + pDrawable->width;
- pixbounds.y2 = pDrawable->y + pDrawable->height;
-
- if (pPicture->freeCompClip)
- {
- RegionReset(pPicture->pCompositeClip, &pixbounds);
- }
- else
- {
- pPicture->freeCompClip = TRUE;
- pPicture->pCompositeClip = RegionCreate(&pixbounds, 1);
- }
-
- if (pPicture->clientClipType == CT_REGION)
- {
- if(pDrawable->x || pDrawable->y) {
- RegionTranslate(pPicture->clientClip,
- pDrawable->x + pPicture->clipOrigin.x,
- pDrawable->y + pPicture->clipOrigin.y);
- RegionIntersect(pPicture->pCompositeClip,
- pPicture->pCompositeClip, pPicture->clientClip);
- RegionTranslate(pPicture->clientClip,
- -(pDrawable->x + pPicture->clipOrigin.x),
- -(pDrawable->y + pPicture->clipOrigin.y));
- } else {
- RegionTranslate(pPicture->pCompositeClip,
- -pPicture->clipOrigin.x, -pPicture->clipOrigin.y);
- RegionIntersect(pPicture->pCompositeClip,
- pPicture->pCompositeClip, pPicture->clientClip);
- RegionTranslate(pPicture->pCompositeClip,
- pPicture->clipOrigin.x, pPicture->clipOrigin.y);
- }
- }
- } /* end of composite clip for pixmap */
- }
-}
-
-int
-miChangePictureTransform (PicturePtr pPicture,
- PictTransform *transform)
-{
- return Success;
-}
-
-int
-miChangePictureFilter (PicturePtr pPicture,
- int filter,
- xFixed *params,
- int nparams)
-{
- return Success;
-}
-
-#define BOUND(v) (INT16) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v))
-
-static __inline pixman_bool_t
-miClipPictureReg (pixman_region16_t * pRegion,
- pixman_region16_t * pClip,
- int dx,
- int dy)
-{
- if (pixman_region_n_rects(pRegion) == 1 &&
- pixman_region_n_rects(pClip) == 1)
- {
- pixman_box16_t * pRbox = pixman_region_rectangles(pRegion, NULL);
- pixman_box16_t * pCbox = pixman_region_rectangles(pClip, NULL);
- int v;
-
- if (pRbox->x1 < (v = pCbox->x1 + dx))
- pRbox->x1 = BOUND(v);
- if (pRbox->x2 > (v = pCbox->x2 + dx))
- pRbox->x2 = BOUND(v);
- if (pRbox->y1 < (v = pCbox->y1 + dy))
- pRbox->y1 = BOUND(v);
- if (pRbox->y2 > (v = pCbox->y2 + dy))
- pRbox->y2 = BOUND(v);
- if (pRbox->x1 >= pRbox->x2 ||
- pRbox->y1 >= pRbox->y2)
- {
- pixman_region_init (pRegion);
- }
- }
- else if (!pixman_region_not_empty (pClip))
- return FALSE;
- else
- {
- if (dx || dy)
- pixman_region_translate (pRegion, -dx, -dy);
- if (!pixman_region_intersect (pRegion, pRegion, pClip))
- return FALSE;
- if (dx || dy)
- pixman_region_translate(pRegion, dx, dy);
- }
- return pixman_region_not_empty(pRegion);
-}
-
-static __inline Bool
-miClipPictureSrc (RegionPtr pRegion,
- PicturePtr pPicture,
- int dx,
- int dy)
-{
- if (pPicture->clientClipType != CT_NONE)
- {
- Bool result;
-
- pixman_region_translate ( pPicture->clientClip,
- pPicture->clipOrigin.x + dx,
- pPicture->clipOrigin.y + dy);
-
- result = RegionIntersect(pRegion, pRegion, pPicture->clientClip);
-
- pixman_region_translate ( pPicture->clientClip,
- - (pPicture->clipOrigin.x + dx),
- - (pPicture->clipOrigin.y + dy));
-
- if (!result)
- return FALSE;
- }
- return TRUE;
-}
-
-static void
-SourceValidateOnePicture (PicturePtr pPicture)
-{
- DrawablePtr pDrawable = pPicture->pDrawable;
- ScreenPtr pScreen;
-
- if (!pDrawable)
- return;
-
- pScreen = pDrawable->pScreen;
-
- if (pScreen->SourceValidate)
- {
- pScreen->SourceValidate (
- pDrawable, 0, 0, pDrawable->width, pDrawable->height, pPicture->subWindowMode);
- }
-}
-
-void
-miCompositeSourceValidate (PicturePtr pPicture)
-{
- SourceValidateOnePicture (pPicture);
- if (pPicture->alphaMap)
- SourceValidateOnePicture (pPicture->alphaMap);
-}
-
-/*
- * returns FALSE if the final region is empty. Indistinguishable from
- * an allocation failure, but rendering ignores those anyways.
- */
-
-Bool
-miComputeCompositeRegion (RegionPtr pRegion,
- PicturePtr pSrc,
- PicturePtr pMask,
- PicturePtr pDst,
- INT16 xSrc,
- INT16 ySrc,
- INT16 xMask,
- INT16 yMask,
- INT16 xDst,
- INT16 yDst,
- CARD16 width,
- CARD16 height)
-{
-
- int v;
-
- pRegion->extents.x1 = xDst;
- v = xDst + width;
- pRegion->extents.x2 = BOUND(v);
- pRegion->extents.y1 = yDst;
- v = yDst + height;
- pRegion->extents.y2 = BOUND(v);
- pRegion->data = 0;
- /* Check for empty operation */
- if (pRegion->extents.x1 >= pRegion->extents.x2 ||
- pRegion->extents.y1 >= pRegion->extents.y2)
- {
- pixman_region_init (pRegion);
- return FALSE;
- }
- /* clip against dst */
- if (!miClipPictureReg (pRegion, pDst->pCompositeClip, 0, 0))
- {
- pixman_region_fini (pRegion);
- return FALSE;
- }
- if (pDst->alphaMap)
- {
- if (!miClipPictureReg (pRegion, pDst->alphaMap->pCompositeClip,
- -pDst->alphaOrigin.x,
- -pDst->alphaOrigin.y))
- {
- pixman_region_fini (pRegion);
- return FALSE;
- }
- }
- /* clip against src */
- if (!miClipPictureSrc (pRegion, pSrc, xDst - xSrc, yDst - ySrc))
- {
- pixman_region_fini (pRegion);
- return FALSE;
- }
- if (pSrc->alphaMap)
- {
- if (!miClipPictureSrc (pRegion, pSrc->alphaMap,
- xDst - (xSrc - pSrc->alphaOrigin.x),
- yDst - (ySrc - pSrc->alphaOrigin.y)))
- {
- pixman_region_fini (pRegion);
- return FALSE;
- }
- }
- /* clip against mask */
- if (pMask)
- {
- if (!miClipPictureSrc (pRegion, pMask, xDst - xMask, yDst - yMask))
- {
- pixman_region_fini (pRegion);
- return FALSE;
- }
- if (pMask->alphaMap)
- {
- if (!miClipPictureSrc (pRegion, pMask->alphaMap,
- xDst - (xMask - pMask->alphaOrigin.x),
- yDst - (yMask - pMask->alphaOrigin.y)))
- {
- pixman_region_fini (pRegion);
- return FALSE;
- }
- }
- }
-
-
- miCompositeSourceValidate (pSrc);
- if (pMask)
- miCompositeSourceValidate (pMask);
-
- return TRUE;
-}
-
-void
-miRenderColorToPixel (PictFormatPtr format,
- xRenderColor *color,
- CARD32 *pixel)
-{
- CARD32 r, g, b, a;
- miIndexedPtr pIndexed;
-
- switch (format->type) {
- case PictTypeDirect:
- r = color->red >> (16 - Ones (format->direct.redMask));
- g = color->green >> (16 - Ones (format->direct.greenMask));
- b = color->blue >> (16 - Ones (format->direct.blueMask));
- a = color->alpha >> (16 - Ones (format->direct.alphaMask));
- r = r << format->direct.red;
- g = g << format->direct.green;
- b = b << format->direct.blue;
- a = a << format->direct.alpha;
- *pixel = r|g|b|a;
- break;
- case PictTypeIndexed:
- pIndexed = (miIndexedPtr) (format->index.devPrivate);
- if (pIndexed->color)
- {
- r = color->red >> 11;
- g = color->green >> 11;
- b = color->blue >> 11;
- *pixel = miIndexToEnt15 (pIndexed, (r << 10) | (g << 5) | b);
- }
- else
- {
- r = color->red >> 8;
- g = color->green >> 8;
- b = color->blue >> 8;
- *pixel = miIndexToEntY24 (pIndexed, (r << 16) | (g << 8) | b);
- }
- break;
- }
-}
-
-static CARD16
-miFillColor (CARD32 pixel, int bits)
-{
- while (bits < 16)
- {
- pixel |= pixel << bits;
- bits <<= 1;
- }
- return (CARD16) pixel;
-}
-
-Bool
-miIsSolidAlpha (PicturePtr pSrc)
-{
- ScreenPtr pScreen;
- char line[1];
-
- if (!pSrc->pDrawable)
- return FALSE;
-
- pScreen = pSrc->pDrawable->pScreen;
-
- /* Alpha-only */
- if (PICT_FORMAT_TYPE (pSrc->format) != PICT_TYPE_A)
- return FALSE;
- /* repeat */
- if (!pSrc->repeat)
- return FALSE;
- /* 1x1 */
- if (pSrc->pDrawable->width != 1 || pSrc->pDrawable->height != 1)
- return FALSE;
- line[0] = 1;
- (*pScreen->GetImage) (pSrc->pDrawable, 0, 0, 1, 1, ZPixmap, ~0L, line);
- switch (pSrc->pDrawable->bitsPerPixel) {
- case 1:
- return (CARD8) line[0] == 1 || (CARD8) line[0] == 0x80;
- case 4:
- return (CARD8) line[0] == 0xf || (CARD8) line[0] == 0xf0;
- case 8:
- return (CARD8) line[0] == 0xff;
- default:
- return FALSE;
- }
-}
-
-void
-miRenderPixelToColor (PictFormatPtr format,
- CARD32 pixel,
- xRenderColor *color)
-{
- CARD32 r, g, b, a;
- miIndexedPtr pIndexed;
-
- switch (format->type) {
- case PictTypeDirect:
- r = (pixel >> format->direct.red) & format->direct.redMask;
- g = (pixel >> format->direct.green) & format->direct.greenMask;
- b = (pixel >> format->direct.blue) & format->direct.blueMask;
- a = (pixel >> format->direct.alpha) & format->direct.alphaMask;
- color->red = miFillColor (r, Ones (format->direct.redMask));
- color->green = miFillColor (g, Ones (format->direct.greenMask));
- color->blue = miFillColor (b, Ones (format->direct.blueMask));
- color->alpha = miFillColor (a, Ones (format->direct.alphaMask));
- break;
- case PictTypeIndexed:
- pIndexed = (miIndexedPtr) (format->index.devPrivate);
- pixel = pIndexed->rgba[pixel & (MI_MAX_INDEXED-1)];
- r = (pixel >> 16) & 0xff;
- g = (pixel >> 8) & 0xff;
- b = (pixel ) & 0xff;
- color->red = miFillColor (r, 8);
- color->green = miFillColor (g, 8);
- color->blue = miFillColor (b, 8);
- color->alpha = 0xffff;
- break;
- }
-}
-
-Bool
-miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
-{
- PictureScreenPtr ps;
-
- if (!PictureInit (pScreen, formats, nformats))
- return FALSE;
- ps = GetPictureScreen(pScreen);
- ps->CreatePicture = miCreatePicture;
- ps->DestroyPicture = miDestroyPicture;
- ps->ChangePictureClip = miChangePictureClip;
- ps->DestroyPictureClip = miDestroyPictureClip;
- ps->ChangePicture = miChangePicture;
- ps->ValidatePicture = miValidatePicture;
- ps->InitIndexed = miInitIndexed;
- ps->CloseIndexed = miCloseIndexed;
- ps->UpdateIndexed = miUpdateIndexed;
- ps->ChangePictureTransform = miChangePictureTransform;
- ps->ChangePictureFilter = miChangePictureFilter;
- ps->RealizeGlyph = miRealizeGlyph;
- ps->UnrealizeGlyph = miUnrealizeGlyph;
-
- /* MI rendering routines */
- ps->Composite = 0; /* requires DDX support */
- ps->Glyphs = miGlyphs;
- ps->CompositeRects = miCompositeRects;
- ps->Trapezoids = 0;
- ps->Triangles = 0;
-
- ps->RasterizeTrapezoid = 0; /* requires DDX support */
- ps->AddTraps = 0; /* requires DDX support */
- ps->AddTriangles = 0; /* requires DDX support */
-
- return TRUE;
-}
+/*
+ *
+ * Copyright © 1999 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "scrnintstr.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+#include "windowstr.h"
+#include "mi.h"
+#include "picturestr.h"
+#include "mipict.h"
+
+int
+miCreatePicture (PicturePtr pPicture)
+{
+ return Success;
+}
+
+void
+miDestroyPicture (PicturePtr pPicture)
+{
+ if (pPicture->freeCompClip)
+ RegionDestroy(pPicture->pCompositeClip);
+}
+
+void
+miDestroyPictureClip (PicturePtr pPicture)
+{
+ switch (pPicture->clientClipType) {
+ case CT_NONE:
+ return;
+ case CT_PIXMAP:
+ (*pPicture->pDrawable->pScreen->DestroyPixmap) ((PixmapPtr) (pPicture->clientClip));
+ break;
+ default:
+ /*
+ * we know we'll never have a list of rectangles, since ChangeClip
+ * immediately turns them into a region
+ */
+ RegionDestroy(pPicture->clientClip);
+ break;
+ }
+ pPicture->clientClip = NULL;
+ pPicture->clientClipType = CT_NONE;
+}
+
+int
+miChangePictureClip (PicturePtr pPicture,
+ int type,
+ pointer value,
+ int n)
+{
+ ScreenPtr pScreen = pPicture->pDrawable->pScreen;
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+ pointer clientClip;
+ int clientClipType;
+
+ switch (type) {
+ case CT_PIXMAP:
+ /* convert the pixmap to a region */
+ clientClip = (pointer) BitmapToRegion(pScreen, (PixmapPtr) value);
+ if (!clientClip)
+ return BadAlloc;
+ clientClipType = CT_REGION;
+ (*pScreen->DestroyPixmap) ((PixmapPtr) value);
+ break;
+ case CT_REGION:
+ clientClip = value;
+ clientClipType = CT_REGION;
+ break;
+ case CT_NONE:
+ clientClip = 0;
+ clientClipType = CT_NONE;
+ break;
+ default:
+ clientClip = (pointer) RegionFromRects(n,
+ (xRectangle *) value,
+ type);
+ if (!clientClip)
+ return BadAlloc;
+ clientClipType = CT_REGION;
+ free(value);
+ break;
+ }
+ (*ps->DestroyPictureClip) (pPicture);
+ pPicture->clientClip = clientClip;
+ pPicture->clientClipType = clientClipType;
+ pPicture->stateChanges |= CPClipMask;
+ return Success;
+}
+
+void
+miChangePicture (PicturePtr pPicture,
+ Mask mask)
+{
+ return;
+}
+
+void
+miValidatePicture (PicturePtr pPicture,
+ Mask mask)
+{
+ DrawablePtr pDrawable = pPicture->pDrawable;
+
+ if ((mask & (CPClipXOrigin|CPClipYOrigin|CPClipMask|CPSubwindowMode)) ||
+ (pDrawable->serialNumber != (pPicture->serialNumber & DRAWABLE_SERIAL_BITS)))
+ {
+ if (pDrawable->type == DRAWABLE_WINDOW)
+ {
+ WindowPtr pWin = (WindowPtr) pDrawable;
+ RegionPtr pregWin;
+ Bool freeTmpClip, freeCompClip;
+
+ if (pPicture->subWindowMode == IncludeInferiors)
+ {
+ pregWin = NotClippedByChildren(pWin);
+ freeTmpClip = TRUE;
+ }
+ else
+ {
+ pregWin = &pWin->clipList;
+ freeTmpClip = FALSE;
+ }
+ freeCompClip = pPicture->freeCompClip;
+
+ /*
+ * if there is no client clip, we can get by with just keeping the
+ * pointer we got, and remembering whether or not should destroy
+ * (or maybe re-use) it later. this way, we avoid unnecessary
+ * copying of regions. (this wins especially if many clients clip
+ * by children and have no client clip.)
+ */
+ if (pPicture->clientClipType == CT_NONE)
+ {
+ if (freeCompClip)
+ RegionDestroy(pPicture->pCompositeClip);
+ pPicture->pCompositeClip = pregWin;
+ pPicture->freeCompClip = freeTmpClip;
+ }
+ else
+ {
+ /*
+ * we need one 'real' region to put into the composite clip. if
+ * pregWin the current composite clip are real, we can get rid of
+ * one. if pregWin is real and the current composite clip isn't,
+ * use pregWin for the composite clip. if the current composite
+ * clip is real and pregWin isn't, use the current composite
+ * clip. if neither is real, create a new region.
+ */
+
+ RegionTranslate(pPicture->clientClip,
+ pDrawable->x + pPicture->clipOrigin.x,
+ pDrawable->y + pPicture->clipOrigin.y);
+
+ if (freeCompClip)
+ {
+ RegionIntersect(pPicture->pCompositeClip,
+ pregWin, pPicture->clientClip);
+ if (freeTmpClip)
+ RegionDestroy(pregWin);
+ }
+ else if (freeTmpClip)
+ {
+ RegionIntersect(pregWin, pregWin, pPicture->clientClip);
+ pPicture->pCompositeClip = pregWin;
+ }
+ else
+ {
+ pPicture->pCompositeClip = RegionCreate(NullBox, 0);
+ RegionIntersect(pPicture->pCompositeClip,
+ pregWin, pPicture->clientClip);
+ }
+ pPicture->freeCompClip = TRUE;
+ RegionTranslate(pPicture->clientClip,
+ -(pDrawable->x + pPicture->clipOrigin.x),
+ -(pDrawable->y + pPicture->clipOrigin.y));
+ }
+ } /* end of composite clip for a window */
+ else
+ {
+ BoxRec pixbounds;
+
+ /* XXX should we translate by drawable.x/y here ? */
+ /* If you want pixmaps in offscreen memory, yes */
+ pixbounds.x1 = pDrawable->x;
+ pixbounds.y1 = pDrawable->y;
+ pixbounds.x2 = pDrawable->x + pDrawable->width;
+ pixbounds.y2 = pDrawable->y + pDrawable->height;
+
+ if (pPicture->freeCompClip)
+ {
+ RegionReset(pPicture->pCompositeClip, &pixbounds);
+ }
+ else
+ {
+ pPicture->freeCompClip = TRUE;
+ pPicture->pCompositeClip = RegionCreate(&pixbounds, 1);
+ }
+
+ if (pPicture->clientClipType == CT_REGION)
+ {
+ if(pDrawable->x || pDrawable->y) {
+ RegionTranslate(pPicture->clientClip,
+ pDrawable->x + pPicture->clipOrigin.x,
+ pDrawable->y + pPicture->clipOrigin.y);
+ RegionIntersect(pPicture->pCompositeClip,
+ pPicture->pCompositeClip, pPicture->clientClip);
+ RegionTranslate(pPicture->clientClip,
+ -(pDrawable->x + pPicture->clipOrigin.x),
+ -(pDrawable->y + pPicture->clipOrigin.y));
+ } else {
+ RegionTranslate(pPicture->pCompositeClip,
+ -pPicture->clipOrigin.x, -pPicture->clipOrigin.y);
+ RegionIntersect(pPicture->pCompositeClip,
+ pPicture->pCompositeClip, pPicture->clientClip);
+ RegionTranslate(pPicture->pCompositeClip,
+ pPicture->clipOrigin.x, pPicture->clipOrigin.y);
+ }
+ }
+ } /* end of composite clip for pixmap */
+ }
+}
+
+int
+miChangePictureTransform (PicturePtr pPicture,
+ PictTransform *transform)
+{
+ return Success;
+}
+
+int
+miChangePictureFilter (PicturePtr pPicture,
+ int filter,
+ xFixed *params,
+ int nparams)
+{
+ return Success;
+}
+
+#define BOUND(v) (INT16) ((v) < MINSHORT ? MINSHORT : (v) > MAXSHORT ? MAXSHORT : (v))
+
+static __inline pixman_bool_t
+miClipPictureReg (pixman_region16_t * pRegion,
+ pixman_region16_t * pClip,
+ int dx,
+ int dy)
+{
+ if (pixman_region_n_rects(pRegion) == 1 &&
+ pixman_region_n_rects(pClip) == 1)
+ {
+ pixman_box16_t * pRbox = pixman_region_rectangles(pRegion, NULL);
+ pixman_box16_t * pCbox = pixman_region_rectangles(pClip, NULL);
+ int v;
+
+ if (pRbox->x1 < (v = pCbox->x1 + dx))
+ pRbox->x1 = BOUND(v);
+ if (pRbox->x2 > (v = pCbox->x2 + dx))
+ pRbox->x2 = BOUND(v);
+ if (pRbox->y1 < (v = pCbox->y1 + dy))
+ pRbox->y1 = BOUND(v);
+ if (pRbox->y2 > (v = pCbox->y2 + dy))
+ pRbox->y2 = BOUND(v);
+ if (pRbox->x1 >= pRbox->x2 ||
+ pRbox->y1 >= pRbox->y2)
+ {
+ pixman_region_init (pRegion);
+ }
+ }
+ else if (!pixman_region_not_empty (pClip))
+ return FALSE;
+ else
+ {
+ if (dx || dy)
+ pixman_region_translate (pRegion, -dx, -dy);
+ if (!pixman_region_intersect (pRegion, pRegion, pClip))
+ return FALSE;
+ if (dx || dy)
+ pixman_region_translate(pRegion, dx, dy);
+ }
+ return pixman_region_not_empty(pRegion);
+}
+
+static inline Bool
+miClipPictureSrc (RegionPtr pRegion,
+ PicturePtr pPicture,
+ int dx,
+ int dy)
+{
+ if (pPicture->clientClipType != CT_NONE)
+ {
+ Bool result;
+
+ pixman_region_translate ( pPicture->clientClip,
+ pPicture->clipOrigin.x + dx,
+ pPicture->clipOrigin.y + dy);
+
+ result = RegionIntersect(pRegion, pRegion, pPicture->clientClip);
+
+ pixman_region_translate ( pPicture->clientClip,
+ - (pPicture->clipOrigin.x + dx),
+ - (pPicture->clipOrigin.y + dy));
+
+ if (!result)
+ return FALSE;
+ }
+ return TRUE;
+}
+
+static void
+SourceValidateOnePicture (PicturePtr pPicture)
+{
+ DrawablePtr pDrawable = pPicture->pDrawable;
+ ScreenPtr pScreen;
+
+ if (!pDrawable)
+ return;
+
+ pScreen = pDrawable->pScreen;
+
+ if (pScreen->SourceValidate)
+ {
+ pScreen->SourceValidate (
+ pDrawable, 0, 0, pDrawable->width, pDrawable->height, pPicture->subWindowMode);
+ }
+}
+
+void
+miCompositeSourceValidate (PicturePtr pPicture)
+{
+ SourceValidateOnePicture (pPicture);
+ if (pPicture->alphaMap)
+ SourceValidateOnePicture (pPicture->alphaMap);
+}
+
+/*
+ * returns FALSE if the final region is empty. Indistinguishable from
+ * an allocation failure, but rendering ignores those anyways.
+ */
+
+Bool
+miComputeCompositeRegion (RegionPtr pRegion,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height)
+{
+
+ int v;
+
+ pRegion->extents.x1 = xDst;
+ v = xDst + width;
+ pRegion->extents.x2 = BOUND(v);
+ pRegion->extents.y1 = yDst;
+ v = yDst + height;
+ pRegion->extents.y2 = BOUND(v);
+ pRegion->data = 0;
+ /* Check for empty operation */
+ if (pRegion->extents.x1 >= pRegion->extents.x2 ||
+ pRegion->extents.y1 >= pRegion->extents.y2)
+ {
+ pixman_region_init (pRegion);
+ return FALSE;
+ }
+ /* clip against dst */
+ if (!miClipPictureReg (pRegion, pDst->pCompositeClip, 0, 0))
+ {
+ pixman_region_fini (pRegion);
+ return FALSE;
+ }
+ if (pDst->alphaMap)
+ {
+ if (!miClipPictureReg (pRegion, pDst->alphaMap->pCompositeClip,
+ -pDst->alphaOrigin.x,
+ -pDst->alphaOrigin.y))
+ {
+ pixman_region_fini (pRegion);
+ return FALSE;
+ }
+ }
+ /* clip against src */
+ if (!miClipPictureSrc (pRegion, pSrc, xDst - xSrc, yDst - ySrc))
+ {
+ pixman_region_fini (pRegion);
+ return FALSE;
+ }
+ if (pSrc->alphaMap)
+ {
+ if (!miClipPictureSrc (pRegion, pSrc->alphaMap,
+ xDst - (xSrc - pSrc->alphaOrigin.x),
+ yDst - (ySrc - pSrc->alphaOrigin.y)))
+ {
+ pixman_region_fini (pRegion);
+ return FALSE;
+ }
+ }
+ /* clip against mask */
+ if (pMask)
+ {
+ if (!miClipPictureSrc (pRegion, pMask, xDst - xMask, yDst - yMask))
+ {
+ pixman_region_fini (pRegion);
+ return FALSE;
+ }
+ if (pMask->alphaMap)
+ {
+ if (!miClipPictureSrc (pRegion, pMask->alphaMap,
+ xDst - (xMask - pMask->alphaOrigin.x),
+ yDst - (yMask - pMask->alphaOrigin.y)))
+ {
+ pixman_region_fini (pRegion);
+ return FALSE;
+ }
+ }
+ }
+
+
+ miCompositeSourceValidate (pSrc);
+ if (pMask)
+ miCompositeSourceValidate (pMask);
+
+ return TRUE;
+}
+
+void
+miRenderColorToPixel (PictFormatPtr format,
+ xRenderColor *color,
+ CARD32 *pixel)
+{
+ CARD32 r, g, b, a;
+ miIndexedPtr pIndexed;
+
+ switch (format->type) {
+ case PictTypeDirect:
+ r = color->red >> (16 - Ones (format->direct.redMask));
+ g = color->green >> (16 - Ones (format->direct.greenMask));
+ b = color->blue >> (16 - Ones (format->direct.blueMask));
+ a = color->alpha >> (16 - Ones (format->direct.alphaMask));
+ r = r << format->direct.red;
+ g = g << format->direct.green;
+ b = b << format->direct.blue;
+ a = a << format->direct.alpha;
+ *pixel = r|g|b|a;
+ break;
+ case PictTypeIndexed:
+ pIndexed = (miIndexedPtr) (format->index.devPrivate);
+ if (pIndexed->color)
+ {
+ r = color->red >> 11;
+ g = color->green >> 11;
+ b = color->blue >> 11;
+ *pixel = miIndexToEnt15 (pIndexed, (r << 10) | (g << 5) | b);
+ }
+ else
+ {
+ r = color->red >> 8;
+ g = color->green >> 8;
+ b = color->blue >> 8;
+ *pixel = miIndexToEntY24 (pIndexed, (r << 16) | (g << 8) | b);
+ }
+ break;
+ }
+}
+
+static CARD16
+miFillColor (CARD32 pixel, int bits)
+{
+ while (bits < 16)
+ {
+ pixel |= pixel << bits;
+ bits <<= 1;
+ }
+ return (CARD16) pixel;
+}
+
+Bool
+miIsSolidAlpha (PicturePtr pSrc)
+{
+ ScreenPtr pScreen;
+ char line[1];
+
+ if (!pSrc->pDrawable)
+ return FALSE;
+
+ pScreen = pSrc->pDrawable->pScreen;
+
+ /* Alpha-only */
+ if (PICT_FORMAT_TYPE (pSrc->format) != PICT_TYPE_A)
+ return FALSE;
+ /* repeat */
+ if (!pSrc->repeat)
+ return FALSE;
+ /* 1x1 */
+ if (pSrc->pDrawable->width != 1 || pSrc->pDrawable->height != 1)
+ return FALSE;
+ line[0] = 1;
+ (*pScreen->GetImage) (pSrc->pDrawable, 0, 0, 1, 1, ZPixmap, ~0L, line);
+ switch (pSrc->pDrawable->bitsPerPixel) {
+ case 1:
+ return (CARD8) line[0] == 1 || (CARD8) line[0] == 0x80;
+ case 4:
+ return (CARD8) line[0] == 0xf || (CARD8) line[0] == 0xf0;
+ case 8:
+ return (CARD8) line[0] == 0xff;
+ default:
+ return FALSE;
+ }
+}
+
+void
+miRenderPixelToColor (PictFormatPtr format,
+ CARD32 pixel,
+ xRenderColor *color)
+{
+ CARD32 r, g, b, a;
+ miIndexedPtr pIndexed;
+
+ switch (format->type) {
+ case PictTypeDirect:
+ r = (pixel >> format->direct.red) & format->direct.redMask;
+ g = (pixel >> format->direct.green) & format->direct.greenMask;
+ b = (pixel >> format->direct.blue) & format->direct.blueMask;
+ a = (pixel >> format->direct.alpha) & format->direct.alphaMask;
+ color->red = miFillColor (r, Ones (format->direct.redMask));
+ color->green = miFillColor (g, Ones (format->direct.greenMask));
+ color->blue = miFillColor (b, Ones (format->direct.blueMask));
+ color->alpha = miFillColor (a, Ones (format->direct.alphaMask));
+ break;
+ case PictTypeIndexed:
+ pIndexed = (miIndexedPtr) (format->index.devPrivate);
+ pixel = pIndexed->rgba[pixel & (MI_MAX_INDEXED-1)];
+ r = (pixel >> 16) & 0xff;
+ g = (pixel >> 8) & 0xff;
+ b = (pixel ) & 0xff;
+ color->red = miFillColor (r, 8);
+ color->green = miFillColor (g, 8);
+ color->blue = miFillColor (b, 8);
+ color->alpha = 0xffff;
+ break;
+ }
+}
+
+Bool
+miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
+{
+ PictureScreenPtr ps;
+
+ if (!PictureInit (pScreen, formats, nformats))
+ return FALSE;
+ ps = GetPictureScreen(pScreen);
+ ps->CreatePicture = miCreatePicture;
+ ps->DestroyPicture = miDestroyPicture;
+ ps->ChangePictureClip = miChangePictureClip;
+ ps->DestroyPictureClip = miDestroyPictureClip;
+ ps->ChangePicture = miChangePicture;
+ ps->ValidatePicture = miValidatePicture;
+ ps->InitIndexed = miInitIndexed;
+ ps->CloseIndexed = miCloseIndexed;
+ ps->UpdateIndexed = miUpdateIndexed;
+ ps->ChangePictureTransform = miChangePictureTransform;
+ ps->ChangePictureFilter = miChangePictureFilter;
+ ps->RealizeGlyph = miRealizeGlyph;
+ ps->UnrealizeGlyph = miUnrealizeGlyph;
+
+ /* MI rendering routines */
+ ps->Composite = 0; /* requires DDX support */
+ ps->Glyphs = miGlyphs;
+ ps->CompositeRects = miCompositeRects;
+ ps->Trapezoids = 0;
+ ps->Triangles = 0;
+
+ ps->RasterizeTrapezoid = 0; /* requires DDX support */
+ ps->AddTraps = 0; /* requires DDX support */
+ ps->AddTriangles = 0; /* requires DDX support */
+
+ return TRUE;
+}
diff --git a/xorg-server/render/render.c b/xorg-server/render/render.c
index ebb1d630a..cc13dbc2a 100644
--- a/xorg-server/render/render.c
+++ b/xorg-server/render/render.c
@@ -276,7 +276,6 @@ ProcRenderQueryVersion (ClientPtr client)
{
RenderClientPtr pRenderClient = GetRenderClient (client);
xRenderQueryVersionReply rep;
- register int n;
REQUEST(xRenderQueryVersionReq);
pRenderClient->major_version = stuff->majorVersion;
@@ -300,10 +299,10 @@ ProcRenderQueryVersion (ClientPtr client)
}
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.majorVersion, n);
- swapl(&rep.minorVersion, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.majorVersion);
+ swapl(&rep.minorVersion);
}
WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *)&rep);
return Success;
@@ -345,7 +344,6 @@ ProcRenderQueryPictFormats (ClientPtr client)
int nvisual;
int rlength;
int s;
- int n;
int numScreens;
int numSubpixel;
/* REQUEST(xRenderQueryPictFormatsReq); */
@@ -432,16 +430,16 @@ ProcRenderQueryPictFormats (ClientPtr client)
pictForm->colormap = None;
if (client->swapped)
{
- swapl (&pictForm->id, n);
- swaps (&pictForm->direct.red, n);
- swaps (&pictForm->direct.redMask, n);
- swaps (&pictForm->direct.green, n);
- swaps (&pictForm->direct.greenMask, n);
- swaps (&pictForm->direct.blue, n);
- swaps (&pictForm->direct.blueMask, n);
- swaps (&pictForm->direct.alpha, n);
- swaps (&pictForm->direct.alphaMask, n);
- swapl (&pictForm->colormap, n);
+ swapl(&pictForm->id);
+ swaps(&pictForm->direct.red);
+ swaps(&pictForm->direct.redMask);
+ swaps(&pictForm->direct.green);
+ swaps(&pictForm->direct.greenMask);
+ swaps(&pictForm->direct.blue);
+ swaps(&pictForm->direct.blueMask);
+ swaps(&pictForm->direct.alpha);
+ swaps(&pictForm->direct.alphaMask);
+ swapl(&pictForm->colormap);
}
pictForm++;
}
@@ -471,8 +469,8 @@ ProcRenderQueryPictFormats (ClientPtr client)
pictVisual->format = pFormat->id;
if (client->swapped)
{
- swapl (&pictVisual->visual, n);
- swapl (&pictVisual->format, n);
+ swapl(&pictVisual->visual);
+ swapl(&pictVisual->format);
}
pictVisual++;
nvisual++;
@@ -482,7 +480,7 @@ ProcRenderQueryPictFormats (ClientPtr client)
pictDepth->nPictVisuals = nvisual;
if (client->swapped)
{
- swaps (&pictDepth->nPictVisuals, n);
+ swaps(&pictDepth->nPictVisuals);
}
ndepth++;
pictDepth = (xPictDepth *) pictVisual;
@@ -495,8 +493,8 @@ ProcRenderQueryPictFormats (ClientPtr client)
pictScreen->fallback = 0;
if (client->swapped)
{
- swapl (&pictScreen->nDepth, n);
- swapl (&pictScreen->fallback, n);
+ swapl(&pictScreen->nDepth);
+ swapl(&pictScreen->fallback);
}
pictScreen = (xPictScreen *) pictDepth;
}
@@ -512,20 +510,20 @@ ProcRenderQueryPictFormats (ClientPtr client)
*pictSubpixel = SubPixelUnknown;
if (client->swapped)
{
- swapl (pictSubpixel, n);
+ swapl(pictSubpixel);
}
++pictSubpixel;
}
if (client->swapped)
{
- swaps (&reply->sequenceNumber, n);
- swapl (&reply->length, n);
- swapl (&reply->numFormats, n);
- swapl (&reply->numScreens, n);
- swapl (&reply->numDepths, n);
- swapl (&reply->numVisuals, n);
- swapl (&reply->numSubpixel, n);
+ swaps(&reply->sequenceNumber);
+ swapl(&reply->length);
+ swapl(&reply->numFormats);
+ swapl(&reply->numScreens);
+ swapl(&reply->numDepths);
+ swapl(&reply->numVisuals);
+ swapl(&reply->numSubpixel);
}
WriteToClient(client, rlength, (char *) reply);
free(reply);
@@ -538,7 +536,7 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
PictFormatPtr pFormat;
int rc, num;
int rlength;
- int i, n;
+ int i;
REQUEST(xRenderQueryPictIndexValuesReq);
xRenderQueryPictIndexValuesReply *reply;
xIndexValue *values;
@@ -575,15 +573,15 @@ ProcRenderQueryPictIndexValues (ClientPtr client)
{
for (i = 0; i < num; i++)
{
- swapl (&values[i].pixel, n);
- swaps (&values[i].red, n);
- swaps (&values[i].green, n);
- swaps (&values[i].blue, n);
- swaps (&values[i].alpha, n);
+ swapl(&values[i].pixel);
+ swaps(&values[i].red);
+ swaps(&values[i].green);
+ swaps(&values[i].blue);
+ swaps(&values[i].alpha);
}
- swaps (&reply->sequenceNumber, n);
- swapl (&reply->length, n);
- swapl (&reply->numIndexValues, n);
+ swaps(&reply->sequenceNumber);
+ swapl(&reply->length);
+ swapl(&reply->numIndexValues);
}
WriteToClient(client, rlength, (char *) reply);
@@ -1822,16 +1820,14 @@ ProcRenderQueryFilters (ClientPtr client)
if (client->swapped)
{
- register int n;
-
for (i = 0; i < reply->numAliases; i++)
{
- swaps (&aliases[i], n);
+ swaps(&aliases[i]);
}
- swaps(&reply->sequenceNumber, n);
- swapl(&reply->length, n);
- swapl(&reply->numAliases, n);
- swapl(&reply->numFilters, n);
+ swaps(&reply->sequenceNumber);
+ swapl(&reply->length);
+ swapl(&reply->numAliases);
+ swapl(&reply->numFilters);
}
WriteToClient(client, total_bytes, (char *) reply);
free(reply);
@@ -2068,31 +2064,28 @@ ProcRenderDispatch (ClientPtr client)
static int
SProcRenderQueryVersion (ClientPtr client)
{
- register int n;
REQUEST(xRenderQueryVersionReq);
- swaps(&stuff->length, n);
- swapl(&stuff->majorVersion, n);
- swapl(&stuff->minorVersion, n);
+ swaps(&stuff->length);
+ swapl(&stuff->majorVersion);
+ swapl(&stuff->minorVersion);
return (*ProcRenderVector[stuff->renderReqType])(client);
}
static int
SProcRenderQueryPictFormats (ClientPtr client)
{
- register int n;
REQUEST(xRenderQueryPictFormatsReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
SProcRenderQueryPictIndexValues (ClientPtr client)
{
- register int n;
REQUEST(xRenderQueryPictIndexValuesReq);
- swaps(&stuff->length, n);
- swapl(&stuff->format, n);
+ swaps(&stuff->length);
+ swapl(&stuff->format);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
@@ -2105,13 +2098,12 @@ SProcRenderQueryDithers (ClientPtr client)
static int
SProcRenderCreatePicture (ClientPtr client)
{
- register int n;
REQUEST(xRenderCreatePictureReq);
- swaps(&stuff->length, n);
- swapl(&stuff->pid, n);
- swapl(&stuff->drawable, n);
- swapl(&stuff->format, n);
- swapl(&stuff->mask, n);
+ swaps(&stuff->length);
+ swapl(&stuff->pid);
+ swapl(&stuff->drawable);
+ swapl(&stuff->format);
+ swapl(&stuff->mask);
SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
@@ -2119,11 +2111,10 @@ SProcRenderCreatePicture (ClientPtr client)
static int
SProcRenderChangePicture (ClientPtr client)
{
- register int n;
REQUEST(xRenderChangePictureReq);
- swaps(&stuff->length, n);
- swapl(&stuff->picture, n);
- swapl(&stuff->mask, n);
+ swaps(&stuff->length);
+ swapl(&stuff->picture);
+ swapl(&stuff->mask);
SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
@@ -2131,12 +2122,11 @@ SProcRenderChangePicture (ClientPtr client)
static int
SProcRenderSetPictureClipRectangles (ClientPtr client)
{
- register int n;
REQUEST(xRenderSetPictureClipRectanglesReq);
- swaps(&stuff->length, n);
- swapl(&stuff->picture, n);
- swaps(&stuff->xOrigin, n);
- swaps(&stuff->yOrigin, n);
+ swaps(&stuff->length);
+ swapl(&stuff->picture);
+ swaps(&stuff->xOrigin);
+ swaps(&stuff->yOrigin);
SwapRestS(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
@@ -2144,65 +2134,61 @@ SProcRenderSetPictureClipRectangles (ClientPtr client)
static int
SProcRenderFreePicture (ClientPtr client)
{
- register int n;
REQUEST(xRenderFreePictureReq);
- swaps(&stuff->length, n);
- swapl(&stuff->picture, n);
+ swaps(&stuff->length);
+ swapl(&stuff->picture);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
SProcRenderComposite (ClientPtr client)
{
- register int n;
REQUEST(xRenderCompositeReq);
- swaps(&stuff->length, n);
- swapl(&stuff->src, n);
- swapl(&stuff->mask, n);
- swapl(&stuff->dst, n);
- swaps(&stuff->xSrc, n);
- swaps(&stuff->ySrc, n);
- swaps(&stuff->xMask, n);
- swaps(&stuff->yMask, n);
- swaps(&stuff->xDst, n);
- swaps(&stuff->yDst, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
+ swaps(&stuff->length);
+ swapl(&stuff->src);
+ swapl(&stuff->mask);
+ swapl(&stuff->dst);
+ swaps(&stuff->xSrc);
+ swaps(&stuff->ySrc);
+ swaps(&stuff->xMask);
+ swaps(&stuff->yMask);
+ swaps(&stuff->xDst);
+ swaps(&stuff->yDst);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
SProcRenderScale (ClientPtr client)
{
- register int n;
REQUEST(xRenderScaleReq);
- swaps(&stuff->length, n);
- swapl(&stuff->src, n);
- swapl(&stuff->dst, n);
- swapl(&stuff->colorScale, n);
- swapl(&stuff->alphaScale, n);
- swaps(&stuff->xSrc, n);
- swaps(&stuff->ySrc, n);
- swaps(&stuff->xDst, n);
- swaps(&stuff->yDst, n);
- swaps(&stuff->width, n);
- swaps(&stuff->height, n);
+ swaps(&stuff->length);
+ swapl(&stuff->src);
+ swapl(&stuff->dst);
+ swapl(&stuff->colorScale);
+ swapl(&stuff->alphaScale);
+ swaps(&stuff->xSrc);
+ swaps(&stuff->ySrc);
+ swaps(&stuff->xDst);
+ swaps(&stuff->yDst);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
SProcRenderTrapezoids (ClientPtr client)
{
- register int n;
REQUEST(xRenderTrapezoidsReq);
REQUEST_AT_LEAST_SIZE(xRenderTrapezoidsReq);
- swaps (&stuff->length, n);
- swapl (&stuff->src, n);
- swapl (&stuff->dst, n);
- swapl (&stuff->maskFormat, n);
- swaps (&stuff->xSrc, n);
- swaps (&stuff->ySrc, n);
+ swaps(&stuff->length);
+ swapl(&stuff->src);
+ swapl(&stuff->dst);
+ swapl(&stuff->maskFormat);
+ swaps(&stuff->xSrc);
+ swaps(&stuff->ySrc);
SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
@@ -2210,16 +2196,15 @@ SProcRenderTrapezoids (ClientPtr client)
static int
SProcRenderTriangles (ClientPtr client)
{
- register int n;
REQUEST(xRenderTrianglesReq);
REQUEST_AT_LEAST_SIZE(xRenderTrianglesReq);
- swaps (&stuff->length, n);
- swapl (&stuff->src, n);
- swapl (&stuff->dst, n);
- swapl (&stuff->maskFormat, n);
- swaps (&stuff->xSrc, n);
- swaps (&stuff->ySrc, n);
+ swaps(&stuff->length);
+ swapl(&stuff->src);
+ swapl(&stuff->dst);
+ swapl(&stuff->maskFormat);
+ swaps(&stuff->xSrc);
+ swaps(&stuff->ySrc);
SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
@@ -2227,16 +2212,15 @@ SProcRenderTriangles (ClientPtr client)
static int
SProcRenderTriStrip (ClientPtr client)
{
- register int n;
REQUEST(xRenderTriStripReq);
REQUEST_AT_LEAST_SIZE(xRenderTriStripReq);
- swaps (&stuff->length, n);
- swapl (&stuff->src, n);
- swapl (&stuff->dst, n);
- swapl (&stuff->maskFormat, n);
- swaps (&stuff->xSrc, n);
- swaps (&stuff->ySrc, n);
+ swaps(&stuff->length);
+ swapl(&stuff->src);
+ swapl(&stuff->dst);
+ swapl(&stuff->maskFormat);
+ swaps(&stuff->xSrc);
+ swaps(&stuff->ySrc);
SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
@@ -2244,16 +2228,15 @@ SProcRenderTriStrip (ClientPtr client)
static int
SProcRenderTriFan (ClientPtr client)
{
- register int n;
REQUEST(xRenderTriFanReq);
REQUEST_AT_LEAST_SIZE(xRenderTriFanReq);
- swaps (&stuff->length, n);
- swapl (&stuff->src, n);
- swapl (&stuff->dst, n);
- swapl (&stuff->maskFormat, n);
- swaps (&stuff->xSrc, n);
- swaps (&stuff->ySrc, n);
+ swaps(&stuff->length);
+ swapl(&stuff->src);
+ swapl(&stuff->dst);
+ swapl(&stuff->maskFormat);
+ swaps(&stuff->xSrc);
+ swaps(&stuff->ySrc);
SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
@@ -2279,47 +2262,43 @@ SProcRenderTransform (ClientPtr client)
static int
SProcRenderCreateGlyphSet (ClientPtr client)
{
- register int n;
REQUEST(xRenderCreateGlyphSetReq);
- swaps(&stuff->length, n);
- swapl(&stuff->gsid, n);
- swapl(&stuff->format, n);
+ swaps(&stuff->length);
+ swapl(&stuff->gsid);
+ swapl(&stuff->format);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
SProcRenderReferenceGlyphSet (ClientPtr client)
{
- register int n;
REQUEST(xRenderReferenceGlyphSetReq);
- swaps(&stuff->length, n);
- swapl(&stuff->gsid, n);
- swapl(&stuff->existing, n);
+ swaps(&stuff->length);
+ swapl(&stuff->gsid);
+ swapl(&stuff->existing);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
SProcRenderFreeGlyphSet (ClientPtr client)
{
- register int n;
REQUEST(xRenderFreeGlyphSetReq);
- swaps(&stuff->length, n);
- swapl(&stuff->glyphset, n);
+ swaps(&stuff->length);
+ swapl(&stuff->glyphset);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
SProcRenderAddGlyphs (ClientPtr client)
{
- register int n;
register int i;
CARD32 *gids;
void *end;
xGlyphInfo *gi;
REQUEST(xRenderAddGlyphsReq);
- swaps(&stuff->length, n);
- swapl(&stuff->glyphset, n);
- swapl(&stuff->nglyphs, n);
+ swaps(&stuff->length);
+ swapl(&stuff->glyphset);
+ swapl(&stuff->nglyphs);
if (stuff->nglyphs & 0xe0000000)
return BadLength;
end = (CARD8 *) stuff + (client->req_len << 2);
@@ -2331,13 +2310,13 @@ SProcRenderAddGlyphs (ClientPtr client)
return BadLength;
for (i = 0; i < stuff->nglyphs; i++)
{
- swapl (&gids[i], n);
- swaps (&gi[i].width, n);
- swaps (&gi[i].height, n);
- swaps (&gi[i].x, n);
- swaps (&gi[i].y, n);
- swaps (&gi[i].xOff, n);
- swaps (&gi[i].yOff, n);
+ swapl(&gids[i]);
+ swaps(&gi[i].width);
+ swaps(&gi[i].height);
+ swaps(&gi[i].x);
+ swaps(&gi[i].y);
+ swaps(&gi[i].xOff);
+ swaps(&gi[i].yOff);
}
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
@@ -2351,10 +2330,9 @@ SProcRenderAddGlyphsFromPicture (ClientPtr client)
static int
SProcRenderFreeGlyphs (ClientPtr client)
{
- register int n;
REQUEST(xRenderFreeGlyphsReq);
- swaps(&stuff->length, n);
- swapl(&stuff->glyphset, n);
+ swaps(&stuff->length);
+ swapl(&stuff->glyphset);
SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
@@ -2362,7 +2340,6 @@ SProcRenderFreeGlyphs (ClientPtr client)
static int
SProcRenderCompositeGlyphs (ClientPtr client)
{
- register int n;
xGlyphElt *elt;
CARD8 *buffer;
CARD8 *end;
@@ -2378,13 +2355,13 @@ SProcRenderCompositeGlyphs (ClientPtr client)
case X_RenderCompositeGlyphs32: size = 4; break;
}
- swaps(&stuff->length, n);
- swapl(&stuff->src, n);
- swapl(&stuff->dst, n);
- swapl(&stuff->maskFormat, n);
- swapl(&stuff->glyphset, n);
- swaps(&stuff->xSrc, n);
- swaps(&stuff->ySrc, n);
+ swaps(&stuff->length);
+ swapl(&stuff->src);
+ swapl(&stuff->dst);
+ swapl(&stuff->maskFormat);
+ swapl(&stuff->glyphset);
+ swaps(&stuff->xSrc);
+ swaps(&stuff->ySrc);
buffer = (CARD8 *) (stuff + 1);
end = (CARD8 *) stuff + (client->req_len << 2);
while (buffer + sizeof (xGlyphElt) < end)
@@ -2392,13 +2369,13 @@ SProcRenderCompositeGlyphs (ClientPtr client)
elt = (xGlyphElt *) buffer;
buffer += sizeof (xGlyphElt);
- swaps (&elt->deltax, n);
- swaps (&elt->deltay, n);
+ swaps(&elt->deltax);
+ swaps(&elt->deltay);
i = elt->len;
if (i == 0xff)
{
- swapl (buffer, n);
+ swapl((int *)buffer);
buffer += 4;
}
else
@@ -2411,14 +2388,14 @@ SProcRenderCompositeGlyphs (ClientPtr client)
case 2:
while (i--)
{
- swaps (buffer, n);
+ swaps((short *)buffer);
buffer += 2;
}
break;
case 4:
while (i--)
{
- swapl (buffer, n);
+ swapl((int *)buffer);
buffer += 4;
}
break;
@@ -2433,16 +2410,15 @@ SProcRenderCompositeGlyphs (ClientPtr client)
static int
SProcRenderFillRectangles (ClientPtr client)
{
- register int n;
REQUEST(xRenderFillRectanglesReq);
REQUEST_AT_LEAST_SIZE (xRenderFillRectanglesReq);
- swaps(&stuff->length, n);
- swapl(&stuff->dst, n);
- swaps(&stuff->color.red, n);
- swaps(&stuff->color.green, n);
- swaps(&stuff->color.blue, n);
- swaps(&stuff->color.alpha, n);
+ swaps(&stuff->length);
+ swapl(&stuff->dst);
+ swaps(&stuff->color.red);
+ swaps(&stuff->color.green);
+ swaps(&stuff->color.blue);
+ swaps(&stuff->color.alpha);
SwapRestS(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
@@ -2450,73 +2426,68 @@ SProcRenderFillRectangles (ClientPtr client)
static int
SProcRenderCreateCursor (ClientPtr client)
{
- register int n;
REQUEST(xRenderCreateCursorReq);
REQUEST_SIZE_MATCH (xRenderCreateCursorReq);
- swaps(&stuff->length, n);
- swapl(&stuff->cid, n);
- swapl(&stuff->src, n);
- swaps(&stuff->x, n);
- swaps(&stuff->y, n);
+ swaps(&stuff->length);
+ swapl(&stuff->cid);
+ swapl(&stuff->src);
+ swaps(&stuff->x);
+ swaps(&stuff->y);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
SProcRenderSetPictureTransform (ClientPtr client)
{
- register int n;
REQUEST(xRenderSetPictureTransformReq);
REQUEST_SIZE_MATCH(xRenderSetPictureTransformReq);
- swaps(&stuff->length, n);
- swapl(&stuff->picture, n);
- swapl(&stuff->transform.matrix11, n);
- swapl(&stuff->transform.matrix12, n);
- swapl(&stuff->transform.matrix13, n);
- swapl(&stuff->transform.matrix21, n);
- swapl(&stuff->transform.matrix22, n);
- swapl(&stuff->transform.matrix23, n);
- swapl(&stuff->transform.matrix31, n);
- swapl(&stuff->transform.matrix32, n);
- swapl(&stuff->transform.matrix33, n);
+ swaps(&stuff->length);
+ swapl(&stuff->picture);
+ swapl(&stuff->transform.matrix11);
+ swapl(&stuff->transform.matrix12);
+ swapl(&stuff->transform.matrix13);
+ swapl(&stuff->transform.matrix21);
+ swapl(&stuff->transform.matrix22);
+ swapl(&stuff->transform.matrix23);
+ swapl(&stuff->transform.matrix31);
+ swapl(&stuff->transform.matrix32);
+ swapl(&stuff->transform.matrix33);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
SProcRenderQueryFilters (ClientPtr client)
{
- register int n;
REQUEST (xRenderQueryFiltersReq);
REQUEST_SIZE_MATCH (xRenderQueryFiltersReq);
- swaps(&stuff->length, n);
- swapl(&stuff->drawable, n);
+ swaps(&stuff->length);
+ swapl(&stuff->drawable);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
SProcRenderSetPictureFilter (ClientPtr client)
{
- register int n;
REQUEST (xRenderSetPictureFilterReq);
REQUEST_AT_LEAST_SIZE (xRenderSetPictureFilterReq);
- swaps(&stuff->length, n);
- swapl(&stuff->picture, n);
- swaps(&stuff->nbytes, n);
+ swaps(&stuff->length);
+ swapl(&stuff->picture);
+ swaps(&stuff->nbytes);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static int
SProcRenderCreateAnimCursor (ClientPtr client)
{
- register int n;
REQUEST (xRenderCreateAnimCursorReq);
REQUEST_AT_LEAST_SIZE (xRenderCreateAnimCursorReq);
- swaps(&stuff->length, n);
- swapl(&stuff->cid, n);
+ swaps(&stuff->length);
+ swapl(&stuff->cid);
SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
@@ -2524,14 +2495,13 @@ SProcRenderCreateAnimCursor (ClientPtr client)
static int
SProcRenderAddTraps (ClientPtr client)
{
- register int n;
REQUEST (xRenderAddTrapsReq);
REQUEST_AT_LEAST_SIZE (xRenderAddTrapsReq);
- swaps(&stuff->length, n);
- swapl(&stuff->picture, n);
- swaps(&stuff->xOff, n);
- swaps(&stuff->yOff, n);
+ swaps(&stuff->length);
+ swapl(&stuff->picture);
+ swaps(&stuff->xOff);
+ swaps(&stuff->yOff);
SwapRestL(stuff);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
@@ -2539,32 +2509,31 @@ SProcRenderAddTraps (ClientPtr client)
static int
SProcRenderCreateSolidFill(ClientPtr client)
{
- register int n;
REQUEST (xRenderCreateSolidFillReq);
REQUEST_AT_LEAST_SIZE (xRenderCreateSolidFillReq);
- swaps(&stuff->length, n);
- swapl(&stuff->pid, n);
- swaps(&stuff->color.alpha, n);
- swaps(&stuff->color.red, n);
- swaps(&stuff->color.green, n);
- swaps(&stuff->color.blue, n);
+ swaps(&stuff->length);
+ swapl(&stuff->pid);
+ swaps(&stuff->color.alpha);
+ swaps(&stuff->color.red);
+ swaps(&stuff->color.green);
+ swaps(&stuff->color.blue);
return (*ProcRenderVector[stuff->renderReqType]) (client);
}
static void swapStops(void *stuff, int num)
{
- int i, n;
+ int i;
CARD32 *stops;
CARD16 *colors;
stops = (CARD32 *)(stuff);
for (i = 0; i < num; ++i) {
- swapl(stops, n);
+ swapl(stops);
++stops;
}
colors = (CARD16 *)(stops);
for (i = 0; i < 4*num; ++i) {
- swaps(colors, n);
+ swaps(colors);
++colors;
}
}
@@ -2572,18 +2541,17 @@ static void swapStops(void *stuff, int num)
static int
SProcRenderCreateLinearGradient (ClientPtr client)
{
- register int n;
int len;
REQUEST (xRenderCreateLinearGradientReq);
REQUEST_AT_LEAST_SIZE (xRenderCreateLinearGradientReq);
- swaps(&stuff->length, n);
- swapl(&stuff->pid, n);
- swapl(&stuff->p1.x, n);
- swapl(&stuff->p1.y, n);
- swapl(&stuff->p2.x, n);
- swapl(&stuff->p2.y, n);
- swapl(&stuff->nStops, n);
+ swaps(&stuff->length);
+ swapl(&stuff->pid);
+ swapl(&stuff->p1.x);
+ swapl(&stuff->p1.y);
+ swapl(&stuff->p2.x);
+ swapl(&stuff->p2.y);
+ swapl(&stuff->nStops);
len = (client->req_len << 2) - sizeof(xRenderCreateLinearGradientReq);
if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
@@ -2599,20 +2567,19 @@ SProcRenderCreateLinearGradient (ClientPtr client)
static int
SProcRenderCreateRadialGradient (ClientPtr client)
{
- register int n;
int len;
REQUEST (xRenderCreateRadialGradientReq);
REQUEST_AT_LEAST_SIZE (xRenderCreateRadialGradientReq);
- swaps(&stuff->length, n);
- swapl(&stuff->pid, n);
- swapl(&stuff->inner.x, n);
- swapl(&stuff->inner.y, n);
- swapl(&stuff->outer.x, n);
- swapl(&stuff->outer.y, n);
- swapl(&stuff->inner_radius, n);
- swapl(&stuff->outer_radius, n);
- swapl(&stuff->nStops, n);
+ swaps(&stuff->length);
+ swapl(&stuff->pid);
+ swapl(&stuff->inner.x);
+ swapl(&stuff->inner.y);
+ swapl(&stuff->outer.x);
+ swapl(&stuff->outer.y);
+ swapl(&stuff->inner_radius);
+ swapl(&stuff->outer_radius);
+ swapl(&stuff->nStops);
len = (client->req_len << 2) - sizeof(xRenderCreateRadialGradientReq);
if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
@@ -2628,17 +2595,16 @@ SProcRenderCreateRadialGradient (ClientPtr client)
static int
SProcRenderCreateConicalGradient (ClientPtr client)
{
- register int n;
int len;
REQUEST (xRenderCreateConicalGradientReq);
REQUEST_AT_LEAST_SIZE (xRenderCreateConicalGradientReq);
- swaps(&stuff->length, n);
- swapl(&stuff->pid, n);
- swapl(&stuff->center.x, n);
- swapl(&stuff->center.y, n);
- swapl(&stuff->angle, n);
- swapl(&stuff->nStops, n);
+ swaps(&stuff->length);
+ swapl(&stuff->pid);
+ swapl(&stuff->center.x);
+ swapl(&stuff->center.y);
+ swapl(&stuff->angle);
+ swapl(&stuff->nStops);
len = (client->req_len << 2) - sizeof(xRenderCreateConicalGradientReq);
if (stuff->nStops > UINT32_MAX/(sizeof(xFixed) + sizeof(xRenderColor)))
diff --git a/xorg-server/test/xi2/protocol-eventconvert.c b/xorg-server/test/xi2/protocol-eventconvert.c
index 6e61d74b4..6ec94be6c 100644
--- a/xorg-server/test/xi2/protocol-eventconvert.c
+++ b/xorg-server/test/xi2/protocol-eventconvert.c
@@ -44,15 +44,13 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
if (swap)
{
- char n;
-
- swaps(&out->sequenceNumber, n);
- swapl(&out->length, n);
- swaps(&out->evtype, n);
- swaps(&out->deviceid, n);
- swapl(&out->time, n);
- swapl(&out->detail, n);
- swaps(&out->valuators_len, n);
+ swaps(&out->sequenceNumber);
+ swapl(&out->length);
+ swaps(&out->evtype);
+ swaps(&out->deviceid);
+ swapl(&out->time);
+ swapl(&out->detail);
+ swaps(&out->valuators_len);
}
@@ -101,9 +99,8 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
vo.frac = value->frac;
if (swap)
{
- char n;
- swapl(&vo.integral, n);
- swapl(&vo.frac, n);
+ swapl(&vo.integral);
+ swapl(&vo.frac);
}
assert(vi.integral == vo.integral);
@@ -118,9 +115,8 @@ static void test_values_XIRawEvent(RawDeviceEvent *in, xXIRawEvent *out,
vo.frac = raw_value->frac;
if (swap)
{
- char n;
- swapl(&vo.integral, n);
- swapl(&vo.frac, n);
+ swapl(&vo.integral);
+ swapl(&vo.frac);
}
assert(vi.integral == vo.integral);
@@ -276,29 +272,27 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out,
FP3232 *values;
if (swap) {
- char n;
-
- swaps(&out->sequenceNumber, n);
- swapl(&out->length, n);
- swaps(&out->evtype, n);
- swaps(&out->deviceid, n);
- swaps(&out->sourceid, n);
- swapl(&out->time, n);
- swapl(&out->detail, n);
- swapl(&out->root, n);
- swapl(&out->event, n);
- swapl(&out->child, n);
- swapl(&out->root_x, n);
- swapl(&out->root_y, n);
- swapl(&out->event_x, n);
- swapl(&out->event_y, n);
- swaps(&out->buttons_len, n);
- swaps(&out->valuators_len, n);
- swapl(&out->mods.base_mods, n);
- swapl(&out->mods.latched_mods, n);
- swapl(&out->mods.locked_mods, n);
- swapl(&out->mods.effective_mods, n);
- swapl(&out->flags, n);
+ swaps(&out->sequenceNumber);
+ swapl(&out->length);
+ swaps(&out->evtype);
+ swaps(&out->deviceid);
+ swaps(&out->sourceid);
+ swapl(&out->time);
+ swapl(&out->detail);
+ swapl(&out->root);
+ swapl(&out->event);
+ swapl(&out->child);
+ swapl(&out->root_x);
+ swapl(&out->root_y);
+ swapl(&out->event_x);
+ swapl(&out->event_y);
+ swaps(&out->buttons_len);
+ swaps(&out->valuators_len);
+ swapl(&out->mods.base_mods);
+ swapl(&out->mods.latched_mods);
+ swapl(&out->mods.locked_mods);
+ swapl(&out->mods.effective_mods);
+ swapl(&out->flags);
}
assert(out->extension == 0); /* IReqCode defaults to 0 */
@@ -388,9 +382,8 @@ static void test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent *out,
if (swap)
{
- char n;
- swapl(&vo.integral, n);
- swapl(&vo.frac, n);
+ swapl(&vo.integral);
+ swapl(&vo.frac);
}
@@ -647,15 +640,13 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
if (swap)
{
- char n;
-
- swaps(&out->sequenceNumber, n);
- swapl(&out->length, n);
- swaps(&out->evtype, n);
- swaps(&out->deviceid, n);
- swaps(&out->sourceid, n);
- swapl(&out->time, n);
- swaps(&out->num_classes, n);
+ swaps(&out->sequenceNumber);
+ swapl(&out->length);
+ swaps(&out->evtype);
+ swaps(&out->deviceid);
+ swaps(&out->sourceid);
+ swapl(&out->time);
+ swaps(&out->num_classes);
}
assert(out->type == GenericEvent);
@@ -672,10 +663,9 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
if (swap)
{
- char n;
- swaps(&any->length, n);
- swaps(&any->type, n);
- swaps(&any->sourceid, n);
+ swaps(&any->length);
+ swaps(&any->type);
+ swaps(&any->sourceid);
}
switch(any->type)
@@ -687,8 +677,7 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
if (swap)
{
- char n;
- swaps(&b->num_buttons, n);
+ swaps(&b->num_buttons);
}
assert(b->length ==
@@ -703,8 +692,7 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
{
if (swap)
{
- char n;
- swapl(&names[j], n);
+ swapl(&names[j]);
}
assert(names[j] == in->buttons.names[j]);
}
@@ -717,8 +705,7 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
if (swap)
{
- char n;
- swaps(&k->num_keycodes, n);
+ swaps(&k->num_keycodes);
}
assert(k->length ==
@@ -732,8 +719,7 @@ static void test_values_XIDeviceChangedEvent(DeviceChangedEvent *in,
{
if (swap)
{
- char n;
- swapl(&kc[j], n);
+ swapl(&kc[j]);
}
assert(kc[j] >= in->keys.min_keycode);
assert(kc[j] <= in->keys.max_keycode);
diff --git a/xorg-server/test/xi2/protocol-xigetclientpointer.c b/xorg-server/test/xi2/protocol-xigetclientpointer.c
index 5e45e7b32..aec58908d 100644
--- a/xorg-server/test/xi2/protocol-xigetclientpointer.c
+++ b/xorg-server/test/xi2/protocol-xigetclientpointer.c
@@ -70,10 +70,9 @@ static void reply_XIGetClientPointer(ClientPtr client, int len, char *data, void
if (client->swapped)
{
- char n;
- swapl(&rep->length, n);
- swaps(&rep->sequenceNumber, n);
- swaps(&rep->deviceid, n);
+ swapl(&rep->length);
+ swaps(&rep->sequenceNumber);
+ swaps(&rep->deviceid);
}
reply_check_defaults(rep, len, XIGetClientPointer);
@@ -85,7 +84,6 @@ static void reply_XIGetClientPointer(ClientPtr client, int len, char *data, void
static void request_XIGetClientPointer(ClientPtr client, xXIGetClientPointerReq* req, int error)
{
- char n;
int rc;
test_data.win = req->win;
@@ -97,8 +95,8 @@ static void request_XIGetClientPointer(ClientPtr client, xXIGetClientPointerReq*
assert(client_request.errorValue == req->win);
client_request.swapped = TRUE;
- swapl(&req->win, n);
- swaps(&req->length, n);
+ swapl(&req->win);
+ swaps(&req->length);
rc = SProcXIGetClientPointer(&client_request);
assert(rc == error);
diff --git a/xorg-server/test/xi2/protocol-xigetselectedevents.c b/xorg-server/test/xi2/protocol-xigetselectedevents.c
index 55de77356..a78fb2655 100644
--- a/xorg-server/test/xi2/protocol-xigetselectedevents.c
+++ b/xorg-server/test/xi2/protocol-xigetselectedevents.c
@@ -91,10 +91,9 @@ static void reply_XIGetSelectedEvents(ClientPtr client, int len, char *data, voi
if (client->swapped)
{
- char n;
- swapl(&rep->length, n);
- swaps(&rep->sequenceNumber, n);
- swaps(&rep->num_masks, n);
+ swapl(&rep->length);
+ swaps(&rep->sequenceNumber);
+ swaps(&rep->num_masks);
}
reply_check_defaults(rep, len, XIGetSelectedEvents);
@@ -115,9 +114,8 @@ static void reply_XIGetSelectedEvents_data(ClientPtr client, int len, char *data
{
if (client->swapped)
{
- char n;
- swaps(&mask->deviceid, n);
- swaps(&mask->mask_len, n);
+ swaps(&mask->deviceid);
+ swaps(&mask->mask_len);
}
assert(mask->deviceid < 6);
@@ -136,7 +134,6 @@ static void reply_XIGetSelectedEvents_data(ClientPtr client, int len, char *data
static void request_XIGetSelectedEvents(xXIGetSelectedEventsReq* req, int error)
{
- char n;
int rc;
ClientRec client;
client = init_client(req->length, req);
@@ -148,8 +145,8 @@ static void request_XIGetSelectedEvents(xXIGetSelectedEventsReq* req, int error)
reply_handler = reply_XIGetSelectedEvents;
client.swapped = TRUE;
- swapl(&req->win, n);
- swaps(&req->length, n);
+ swapl(&req->win);
+ swaps(&req->length);
rc = SProcXIGetSelectedEvents(&client);
assert(rc == error);
}
diff --git a/xorg-server/test/xi2/protocol-xipassivegrabdevice.c b/xorg-server/test/xi2/protocol-xipassivegrabdevice.c
index a61c1549c..1ffcdee97 100644
--- a/xorg-server/test/xi2/protocol-xipassivegrabdevice.c
+++ b/xorg-server/test/xi2/protocol-xipassivegrabdevice.c
@@ -85,10 +85,9 @@ static void reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, voi
if (client->swapped)
{
- char n;
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->length, n);
- swaps(&rep->num_modifiers, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->num_modifiers);
testdata.num_modifiers = rep->num_modifiers;
}
@@ -104,14 +103,13 @@ static void reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, voi
static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len, char *data, void *userdata)
{
int i;
- int n;
xXIGrabModifierInfo *mods = (xXIGrabModifierInfo*)data;
for (i = 0; i < testdata.num_modifiers; i++, mods++)
{
if (client->swapped)
- swapl(&mods->modifiers, n);
+ swapl(&mods->modifiers);
/* 1 - 7 is the range we use for the global modifiers array
* above */
@@ -128,7 +126,6 @@ static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len, char *data
static void request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceReq* req, int error, int errval)
{
- char n;
int rc;
int modifiers;
@@ -139,20 +136,20 @@ static void request_XIPassiveGrabDevice(ClientPtr client, xXIPassiveGrabDeviceRe
assert(client_request.errorValue == errval);
client_request.swapped = TRUE;
- swaps(&req->length, n);
- swapl(&req->time, n);
- swapl(&req->grab_window, n);
- swapl(&req->cursor, n);
- swapl(&req->detail, n);
- swaps(&req->deviceid, n);
+ swaps(&req->length);
+ swapl(&req->time);
+ swapl(&req->grab_window);
+ swapl(&req->cursor);
+ swapl(&req->detail);
+ swaps(&req->deviceid);
modifiers = req->num_modifiers;
- swaps(&req->num_modifiers, n);
- swaps(&req->mask_len, n);
+ swaps(&req->num_modifiers);
+ swaps(&req->mask_len);
while(modifiers--)
{
CARD32 *mod = ((CARD32*)(req + 1)) + modifiers;
- swapl(mod, n);
+ swapl(mod);
}
rc = SProcXIPassiveGrabDevice(&client_request);
diff --git a/xorg-server/test/xi2/protocol-xiquerydevice.c b/xorg-server/test/xi2/protocol-xiquerydevice.c
index cb1cc8130..47eb5b14c 100644
--- a/xorg-server/test/xi2/protocol-xiquerydevice.c
+++ b/xorg-server/test/xi2/protocol-xiquerydevice.c
@@ -64,10 +64,9 @@ static void reply_XIQueryDevice(ClientPtr client, int len, char* data, void *use
if (client->swapped)
{
- char n;
- swapl(&rep->length, n);
- swaps(&rep->sequenceNumber, n);
- swaps(&rep->num_devices, n);
+ swapl(&rep->length);
+ swaps(&rep->sequenceNumber);
+ swaps(&rep->num_devices);
}
reply_check_defaults(rep, len, XIQueryDevice);
@@ -86,7 +85,6 @@ static void reply_XIQueryDevice(ClientPtr client, int len, char* data, void *use
/* reply handling for the trailing bytes that constitute the device info */
static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *userdata)
{
- char n;
int i, j;
struct test_data *querydata = (struct test_data*)userdata;
@@ -98,11 +96,11 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void
{
if (client->swapped)
{
- swaps(&info->deviceid, n);
- swaps(&info->attachment, n);
- swaps(&info->use, n);
- swaps(&info->num_classes, n);
- swaps(&info->name_len, n);
+ swaps(&info->deviceid);
+ swaps(&info->attachment);
+ swaps(&info->use);
+ swaps(&info->num_classes);
+ swaps(&info->name_len);
}
if (querydata->which_device > XIAllMasterDevices)
@@ -152,9 +150,9 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void
{
if (client->swapped)
{
- swaps(&any->type, n);
- swaps(&any->length, n);
- swaps(&any->sourceid, n);
+ swaps(&any->type);
+ swaps(&any->length);
+ swaps(&any->sourceid);
}
switch(info->deviceid)
@@ -168,7 +166,7 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void
uint32_t *kc;
if (client->swapped)
- swaps(&ki->num_keycodes, n);
+ swaps(&ki->num_keycodes);
assert(any->type == XIKeyClass);
assert(ki->num_keycodes == (xkb->max_key_code - xkb->min_key_code + 1));
@@ -178,7 +176,7 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void
for (k = 0; k < ki->num_keycodes; k++, kc++)
{
if (client->swapped)
- swapl(kc, n);
+ swapl(kc);
assert(*kc >= xkb->min_key_code);
assert(*kc <= xkb->max_key_code);
@@ -197,7 +195,7 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void
xXIButtonInfo *bi = (xXIButtonInfo*)any;
if (client->swapped)
- swaps(&bi->num_buttons, n);
+ swaps(&bi->num_buttons);
assert(bi->num_buttons == devices.vcp->button->numButtons);
@@ -209,13 +207,13 @@ static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void
if (client->swapped)
{
- swaps(&vi->number, n);
- swapl(&vi->label, n);
- swapl(&vi->min.integral, n);
- swapl(&vi->min.frac, n);
- swapl(&vi->max.integral, n);
- swapl(&vi->max.frac, n);
- swapl(&vi->resolution, n);
+ swaps(&vi->number);
+ swapl(&vi->label);
+ swapl(&vi->min.integral);
+ swapl(&vi->min.frac);
+ swapl(&vi->max.integral);
+ swapl(&vi->max.frac);
+ swapl(&vi->resolution);
}
assert(vi->length == 11);
@@ -244,7 +242,6 @@ static void request_XIQueryDevice(struct test_data *querydata,
int deviceid, int error)
{
int rc;
- char n;
ClientRec client;
xXIQueryDeviceReq request;
@@ -264,8 +261,8 @@ static void request_XIQueryDevice(struct test_data *querydata,
reply_handler = reply_XIQueryDevice;
client.swapped = TRUE;
- swaps(&request.length, n);
- swaps(&request.deviceid, n);
+ swaps(&request.length);
+ swaps(&request.deviceid);
rc = SProcXIQueryDevice(&client);
assert(rc == error);
diff --git a/xorg-server/test/xi2/protocol-xiquerypointer.c b/xorg-server/test/xi2/protocol-xiquerypointer.c
index 0985ec70d..65346ab5d 100644
--- a/xorg-server/test/xi2/protocol-xiquerypointer.c
+++ b/xorg-server/test/xi2/protocol-xiquerypointer.c
@@ -81,16 +81,15 @@ static void reply_XIQueryPointer(ClientPtr client, int len, char *data,
if (client->swapped)
{
- char n;
- swapl(&rep->length, n);
- swaps(&rep->sequenceNumber, n);
- swapl(&rep->root, n);
- swapl(&rep->child, n);
- swapl(&rep->root_x, n);
- swapl(&rep->root_y, n);
- swapl(&rep->win_x, n);
- swapl(&rep->win_y, n);
- swaps(&rep->buttons_len, n);
+ swapl(&rep->length);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->root);
+ swapl(&rep->child);
+ swapl(&rep->root_x);
+ swapl(&rep->root_y);
+ swapl(&rep->win_x);
+ swapl(&rep->win_y);
+ swaps(&rep->buttons_len);
}
reply_check_defaults(rep, len, XIQueryPointer);
@@ -132,7 +131,6 @@ static void reply_XIQueryPointer_data(ClientPtr client, int len, char *data, voi
static void request_XIQueryPointer(ClientPtr client, xXIQueryPointerReq* req, int error)
{
- char n;
int rc;
rc = ProcXIQueryPointer(&client_request);
@@ -142,8 +140,8 @@ static void request_XIQueryPointer(ClientPtr client, xXIQueryPointerReq* req, in
assert(client_request.errorValue == req->deviceid);
client_request.swapped = TRUE;
- swaps(&req->deviceid, n);
- swaps(&req->length, n);
+ swaps(&req->deviceid);
+ swaps(&req->length);
rc = SProcXIQueryPointer(&client_request);
assert(rc == error);
diff --git a/xorg-server/test/xi2/protocol-xiqueryversion.c b/xorg-server/test/xi2/protocol-xiqueryversion.c
index 3bb356e7f..d60d16b9d 100644
--- a/xorg-server/test/xi2/protocol-xiqueryversion.c
+++ b/xorg-server/test/xi2/protocol-xiqueryversion.c
@@ -64,11 +64,10 @@ static void reply_XIQueryVersion(ClientPtr client, int len, char* data, void *us
if (client->swapped)
{
- char n;
- swapl(&rep->length, n);
- swaps(&rep->sequenceNumber, n);
- swaps(&rep->major_version, n);
- swaps(&rep->minor_version, n);
+ swapl(&rep->length);
+ swaps(&rep->sequenceNumber);
+ swaps(&rep->major_version);
+ swaps(&rep->minor_version);
}
reply_check_defaults(rep, len, XIQueryVersion);
@@ -91,7 +90,6 @@ static void reply_XIQueryVersion(ClientPtr client, int len, char* data, void *us
*/
static void request_XIQueryVersion(int smaj, int smin, int cmaj, int cmin, int error)
{
- char n;
int rc;
struct test_data versions;
xXIQueryVersionReq request;
@@ -118,9 +116,9 @@ static void request_XIQueryVersion(int smaj, int smin, int cmaj, int cmin, int e
client.swapped = TRUE;
- swaps(&request.length, n);
- swaps(&request.major_version, n);
- swaps(&request.minor_version, n);
+ swaps(&request.length);
+ swaps(&request.major_version);
+ swaps(&request.minor_version);
rc = SProcXIQueryVersion(&client);
assert(rc == error);
diff --git a/xorg-server/test/xi2/protocol-xiselectevents.c b/xorg-server/test/xi2/protocol-xiselectevents.c
index fa422e2cb..4eaf839fa 100644
--- a/xorg-server/test/xi2/protocol-xiselectevents.c
+++ b/xorg-server/test/xi2/protocol-xiselectevents.c
@@ -89,7 +89,6 @@ int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access
static void request_XISelectEvent(xXISelectEventsReq *req, int error)
{
- char n;
int i;
int rc;
ClientRec client;
@@ -114,14 +113,14 @@ static void request_XISelectEvent(xXISelectEventsReq *req, int error)
for (i = 0; i < req->num_masks; i++)
{
next = (xXIEventMask*)((char*)&mask[1] + mask->mask_len * 4);
- swaps(&mask->deviceid, n);
- swaps(&mask->mask_len, n);
+ swaps(&mask->deviceid);
+ swaps(&mask->mask_len);
mask = next;
}
- swapl(&req->win, n);
- swaps(&req->length, n);
- swaps(&req->num_masks, n);
+ swapl(&req->win);
+ swaps(&req->length);
+ swaps(&req->num_masks);
rc = SProcXISelectEvents(&client);
assert(rc == error);
}
diff --git a/xorg-server/test/xi2/protocol-xisetclientpointer.c b/xorg-server/test/xi2/protocol-xisetclientpointer.c
index c266b6560..d9620e336 100644
--- a/xorg-server/test/xi2/protocol-xisetclientpointer.c
+++ b/xorg-server/test/xi2/protocol-xisetclientpointer.c
@@ -66,7 +66,6 @@ int __wrap_dixLookupClient(ClientPtr *pClient, XID rid, ClientPtr client, Mask a
static void request_XISetClientPointer(xXISetClientPointerReq* req, int error)
{
- char n;
int rc;
client_request = init_client(req->length, req);
@@ -77,9 +76,9 @@ static void request_XISetClientPointer(xXISetClientPointerReq* req, int error)
assert(client_request.errorValue == req->deviceid);
client_request.swapped = TRUE;
- swapl(&req->win, n);
- swaps(&req->length, n);
- swaps(&req->deviceid, n);
+ swapl(&req->win);
+ swaps(&req->length);
+ swaps(&req->deviceid);
rc = SProcXISetClientPointer(&client_request);
assert(rc == error);
diff --git a/xorg-server/test/xi2/protocol-xiwarppointer.c b/xorg-server/test/xi2/protocol-xiwarppointer.c
index 0c8db453d..2b40f63f9 100644
--- a/xorg-server/test/xi2/protocol-xiwarppointer.c
+++ b/xorg-server/test/xi2/protocol-xiwarppointer.c
@@ -78,7 +78,6 @@ static Bool ScreenSetCursorPosition(DeviceIntPtr dev, ScreenPtr screen,
static void request_XIWarpPointer(ClientPtr client, xXIWarpPointerReq* req,
int error)
{
- char n;
int rc;
rc = ProcXIWarpPointer(client);
@@ -93,15 +92,15 @@ static void request_XIWarpPointer(ClientPtr client, xXIWarpPointerReq* req,
client->swapped = TRUE;
- swapl(&req->src_win, n);
- swapl(&req->dst_win, n);
- swapl(&req->src_x, n);
- swapl(&req->src_y, n);
- swapl(&req->dst_x, n);
- swapl(&req->dst_y, n);
- swaps(&req->src_width, n);
- swaps(&req->src_height, n);
- swaps(&req->deviceid, n);
+ swapl(&req->src_win);
+ swapl(&req->dst_win);
+ swapl(&req->src_x);
+ swapl(&req->src_y);
+ swapl(&req->dst_x);
+ swapl(&req->dst_y);
+ swaps(&req->src_width);
+ swaps(&req->src_height);
+ swaps(&req->deviceid);
rc = SProcXIWarpPointer(client);
assert(rc == error);
diff --git a/xorg-server/xfixes/cursor.c b/xorg-server/xfixes/cursor.c
index 5d7a44ea5..ed3babcb4 100644
--- a/xorg-server/xfixes/cursor.c
+++ b/xorg-server/xfixes/cursor.c
@@ -311,12 +311,11 @@ GetBit (unsigned char *line, int x)
int
SProcXFixesSelectCursorInput (ClientPtr client)
{
- register int n;
REQUEST(xXFixesSelectCursorInputReq);
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
- swapl(&stuff->eventMask, n);
+ swaps(&stuff->length);
+ swapl(&stuff->window);
+ swapl(&stuff->eventMask);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -420,16 +419,15 @@ ProcXFixesGetCursorImage (ClientPtr client)
CopyCursorToImage (pCursor, image);
if (client->swapped)
{
- int n;
- swaps (&rep->sequenceNumber, n);
- swapl (&rep->length, n);
- swaps (&rep->x, n);
- swaps (&rep->y, n);
- swaps (&rep->width, n);
- swaps (&rep->height, n);
- swaps (&rep->xhot, n);
- swaps (&rep->yhot, n);
- swapl (&rep->cursorSerial, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->x);
+ swaps(&rep->y);
+ swaps(&rep->width);
+ swaps(&rep->height);
+ swaps(&rep->xhot);
+ swaps(&rep->yhot);
+ swapl(&rep->cursorSerial);
SwapLongs (image, npixels);
}
WriteToClient(client, sizeof (xXFixesGetCursorImageReply) +
@@ -441,9 +439,8 @@ ProcXFixesGetCursorImage (ClientPtr client)
int
SProcXFixesGetCursorImage (ClientPtr client)
{
- int n;
REQUEST(xXFixesGetCursorImageReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -469,13 +466,12 @@ ProcXFixesSetCursorName (ClientPtr client)
int
SProcXFixesSetCursorName (ClientPtr client)
{
- int n;
REQUEST(xXFixesSetCursorNameReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXFixesSetCursorNameReq);
- swapl (&stuff->cursor, n);
- swaps (&stuff->nbytes, n);
+ swapl(&stuff->cursor);
+ swaps(&stuff->nbytes);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -503,11 +499,10 @@ ProcXFixesGetCursorName (ClientPtr client)
reply.nbytes = len;
if (client->swapped)
{
- int n;
- swaps (&reply.sequenceNumber, n);
- swapl (&reply.length, n);
- swapl (&reply.atom, n);
- swaps (&reply.nbytes, n);
+ swaps(&reply.sequenceNumber);
+ swapl(&reply.length);
+ swapl(&reply.atom);
+ swaps(&reply.nbytes);
}
WriteReplyToClient(client, sizeof(xXFixesGetCursorNameReply), &reply);
WriteToClient(client, len, str);
@@ -518,12 +513,11 @@ ProcXFixesGetCursorName (ClientPtr client)
int
SProcXFixesGetCursorName (ClientPtr client)
{
- int n;
REQUEST(xXFixesGetCursorNameReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesGetCursorNameReq);
- swapl (&stuff->cursor, n);
+ swapl(&stuff->cursor);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -578,18 +572,17 @@ ProcXFixesGetCursorImageAndName (ClientPtr client)
memcpy ((image + npixels), name, nbytes);
if (client->swapped)
{
- int n;
- swaps (&rep->sequenceNumber, n);
- swapl (&rep->length, n);
- swaps (&rep->x, n);
- swaps (&rep->y, n);
- swaps (&rep->width, n);
- swaps (&rep->height, n);
- swaps (&rep->xhot, n);
- swaps (&rep->yhot, n);
- swapl (&rep->cursorSerial, n);
- swapl (&rep->cursorName, n);
- swaps (&rep->nbytes, n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->x);
+ swaps(&rep->y);
+ swaps(&rep->width);
+ swaps(&rep->height);
+ swaps(&rep->xhot);
+ swaps(&rep->yhot);
+ swapl(&rep->cursorSerial);
+ swapl(&rep->cursorName);
+ swaps(&rep->nbytes);
SwapLongs (image, npixels);
}
WriteToClient(client, sizeof (xXFixesGetCursorImageAndNameReply) +
@@ -601,9 +594,8 @@ ProcXFixesGetCursorImageAndName (ClientPtr client)
int
SProcXFixesGetCursorImageAndName (ClientPtr client)
{
- int n;
REQUEST(xXFixesGetCursorImageAndNameReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -736,13 +728,12 @@ ProcXFixesChangeCursor (ClientPtr client)
int
SProcXFixesChangeCursor (ClientPtr client)
{
- int n;
REQUEST(xXFixesChangeCursorReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesChangeCursorReq);
- swapl (&stuff->source, n);
- swapl (&stuff->destination, n);
+ swapl(&stuff->source);
+ swapl(&stuff->destination);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -774,13 +765,12 @@ ProcXFixesChangeCursorByName (ClientPtr client)
int
SProcXFixesChangeCursorByName (ClientPtr client)
{
- int n;
REQUEST(xXFixesChangeCursorByNameReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE (xXFixesChangeCursorByNameReq);
- swapl (&stuff->source, n);
- swaps (&stuff->nbytes, n);
+ swapl(&stuff->source);
+ swaps(&stuff->nbytes);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -935,12 +925,11 @@ ProcXFixesHideCursor (ClientPtr client)
int
SProcXFixesHideCursor (ClientPtr client)
{
- int n;
REQUEST(xXFixesHideCursorReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH (xXFixesHideCursorReq);
- swapl (&stuff->window, n);
+ swapl(&stuff->window);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -986,12 +975,11 @@ ProcXFixesShowCursor (ClientPtr client)
int
SProcXFixesShowCursor (ClientPtr client)
{
- int n;
REQUEST(xXFixesShowCursorReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH (xXFixesShowCursorReq);
- swapl (&stuff->window, n);
+ swapl(&stuff->window);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -1352,18 +1340,17 @@ ProcXFixesCreatePointerBarrier (ClientPtr client)
int
SProcXFixesCreatePointerBarrier (ClientPtr client)
{
- int n;
REQUEST(xXFixesCreatePointerBarrierReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesCreatePointerBarrierReq);
- swapl(&stuff->barrier, n);
- swapl(&stuff->window, n);
- swaps(&stuff->x1, n);
- swaps(&stuff->y1, n);
- swaps(&stuff->x2, n);
- swaps(&stuff->y2, n);
- swapl(&stuff->directions, n);
+ swapl(&stuff->barrier);
+ swapl(&stuff->window);
+ swaps(&stuff->x1);
+ swaps(&stuff->y1);
+ swaps(&stuff->x2);
+ swaps(&stuff->y2);
+ swapl(&stuff->directions);
return ProcXFixesVector[stuff->xfixesReqType](client);
}
@@ -1414,12 +1401,11 @@ ProcXFixesDestroyPointerBarrier (ClientPtr client)
int
SProcXFixesDestroyPointerBarrier (ClientPtr client)
{
- int n;
REQUEST(xXFixesDestroyPointerBarrierReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesDestroyPointerBarrierReq);
- swapl(&stuff->barrier, n);
+ swapl(&stuff->barrier);
return ProcXFixesVector[stuff->xfixesReqType](client);
}
diff --git a/xorg-server/xfixes/region.c b/xorg-server/xfixes/region.c
index be2d391dd..4c2263702 100644
--- a/xorg-server/xfixes/region.c
+++ b/xorg-server/xfixes/region.c
@@ -93,12 +93,11 @@ ProcXFixesCreateRegion (ClientPtr client)
int
SProcXFixesCreateRegion (ClientPtr client)
{
- register int n;
REQUEST(xXFixesCreateRegionReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXFixesCreateRegionReq);
- swapl(&stuff->region, n);
+ swapl(&stuff->region);
SwapRestS(stuff);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -138,13 +137,12 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client)
int
SProcXFixesCreateRegionFromBitmap (ClientPtr client)
{
- int n;
REQUEST (xXFixesCreateRegionFromBitmapReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH (xXFixesCreateRegionFromBitmapReq);
- swapl(&stuff->region, n);
- swapl(&stuff->bitmap, n);
+ swapl(&stuff->region);
+ swapl(&stuff->bitmap);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -200,13 +198,12 @@ ProcXFixesCreateRegionFromWindow (ClientPtr client)
int
SProcXFixesCreateRegionFromWindow (ClientPtr client)
{
- int n;
REQUEST (xXFixesCreateRegionFromWindowReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH (xXFixesCreateRegionFromWindowReq);
- swapl(&stuff->region, n);
- swapl(&stuff->window, n);
+ swapl(&stuff->region);
+ swapl(&stuff->window);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -250,13 +247,12 @@ ProcXFixesCreateRegionFromGC (ClientPtr client)
int
SProcXFixesCreateRegionFromGC (ClientPtr client)
{
- int n;
REQUEST (xXFixesCreateRegionFromGCReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH (xXFixesCreateRegionFromGCReq);
- swapl(&stuff->region, n);
- swapl(&stuff->gc, n);
+ swapl(&stuff->region);
+ swapl(&stuff->gc);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -297,13 +293,12 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client)
int
SProcXFixesCreateRegionFromPicture (ClientPtr client)
{
- int n;
REQUEST (xXFixesCreateRegionFromPictureReq);
- swaps(&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH (xXFixesCreateRegionFromPictureReq);
- swapl(&stuff->region, n);
- swapl(&stuff->picture, n);
+ swapl(&stuff->region);
+ swapl(&stuff->picture);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -322,12 +317,11 @@ ProcXFixesDestroyRegion (ClientPtr client)
int
SProcXFixesDestroyRegion (ClientPtr client)
{
- int n;
REQUEST (xXFixesDestroyRegionReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesDestroyRegionReq);
- swapl (&stuff->region, n);
+ swapl(&stuff->region);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -361,12 +355,11 @@ ProcXFixesSetRegion (ClientPtr client)
int
SProcXFixesSetRegion (ClientPtr client)
{
- int n;
REQUEST (xXFixesSetRegionReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXFixesSetRegionReq);
- swapl (&stuff->region, n);
+ swapl(&stuff->region);
SwapRestS(stuff);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -389,13 +382,12 @@ ProcXFixesCopyRegion (ClientPtr client)
int
SProcXFixesCopyRegion (ClientPtr client)
{
- int n;
REQUEST (xXFixesCopyRegionReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xXFixesCopyRegionReq);
- swapl (&stuff->source, n);
- swapl (&stuff->destination, n);
+ swapl(&stuff->source);
+ swapl(&stuff->destination);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -431,14 +423,13 @@ ProcXFixesCombineRegion (ClientPtr client)
int
SProcXFixesCombineRegion (ClientPtr client)
{
- int n;
REQUEST (xXFixesCombineRegionReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH (xXFixesCombineRegionReq);
- swapl (&stuff->source1, n);
- swapl (&stuff->source2, n);
- swapl (&stuff->destination, n);
+ swapl(&stuff->source1);
+ swapl(&stuff->source2);
+ swapl(&stuff->destination);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -475,17 +466,16 @@ ProcXFixesInvertRegion (ClientPtr client)
int
SProcXFixesInvertRegion (ClientPtr client)
{
- int n;
REQUEST(xXFixesInvertRegionReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesInvertRegionReq);
- swapl (&stuff->source, n);
- swaps (&stuff->x, n);
- swaps (&stuff->y, n);
- swaps (&stuff->width, n);
- swaps (&stuff->height, n);
- swapl (&stuff->destination, n);
+ swapl(&stuff->source);
+ swaps(&stuff->x);
+ swaps(&stuff->y);
+ swaps(&stuff->width);
+ swaps(&stuff->height);
+ swapl(&stuff->destination);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -505,14 +495,13 @@ ProcXFixesTranslateRegion (ClientPtr client)
int
SProcXFixesTranslateRegion (ClientPtr client)
{
- int n;
REQUEST(xXFixesTranslateRegionReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq);
- swapl (&stuff->region, n);
- swaps (&stuff->dx, n);
- swaps (&stuff->dy, n);
+ swapl(&stuff->region);
+ swaps(&stuff->dx);
+ swaps(&stuff->dy);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -534,13 +523,12 @@ ProcXFixesRegionExtents (ClientPtr client)
int
SProcXFixesRegionExtents (ClientPtr client)
{
- int n;
REQUEST(xXFixesRegionExtentsReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesRegionExtentsReq);
- swapl (&stuff->source, n);
- swapl (&stuff->destination, n);
+ swapl(&stuff->source);
+ swapl(&stuff->destination);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -584,13 +572,12 @@ ProcXFixesFetchRegion (ClientPtr client)
}
if (client->swapped)
{
- int n;
- swaps (&reply->sequenceNumber, n);
- swapl (&reply->length, n);
- swaps (&reply->x, n);
- swaps (&reply->y, n);
- swaps (&reply->width, n);
- swaps (&reply->height, n);
+ swaps(&reply->sequenceNumber);
+ swapl(&reply->length);
+ swaps(&reply->x);
+ swaps(&reply->y);
+ swaps(&reply->width);
+ swaps(&reply->height);
SwapShorts ((INT16 *) pRect, nBox * 4);
}
(void) WriteToClient(client, sizeof (xXFixesFetchRegionReply) +
@@ -602,12 +589,11 @@ ProcXFixesFetchRegion (ClientPtr client)
int
SProcXFixesFetchRegion (ClientPtr client)
{
- int n;
REQUEST(xXFixesFetchRegionReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesFetchRegionReq);
- swapl (&stuff->region, n);
+ swapl(&stuff->region);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -645,15 +631,14 @@ ProcXFixesSetGCClipRegion (ClientPtr client)
int
SProcXFixesSetGCClipRegion (ClientPtr client)
{
- int n;
REQUEST(xXFixesSetGCClipRegionReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesSetGCClipRegionReq);
- swapl (&stuff->gc, n);
- swapl (&stuff->region, n);
- swaps (&stuff->xOrigin, n);
- swaps (&stuff->yOrigin, n);
+ swapl(&stuff->gc);
+ swapl(&stuff->region);
+ swaps(&stuff->xOrigin);
+ swaps(&stuff->yOrigin);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -739,15 +724,14 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client)
int
SProcXFixesSetWindowShapeRegion (ClientPtr client)
{
- int n;
REQUEST(xXFixesSetWindowShapeRegionReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xXFixesSetWindowShapeRegionReq);
- swapl (&stuff->dest, n);
- swaps (&stuff->xOff, n);
- swaps (&stuff->yOff, n);
- swapl (&stuff->region, n);
+ swapl(&stuff->dest);
+ swaps(&stuff->xOff);
+ swaps(&stuff->yOff);
+ swapl(&stuff->region);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -769,15 +753,14 @@ ProcXFixesSetPictureClipRegion (ClientPtr client)
int
SProcXFixesSetPictureClipRegion (ClientPtr client)
{
- int n;
REQUEST(xXFixesSetPictureClipRegionReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq);
- swapl (&stuff->picture, n);
- swapl (&stuff->region, n);
- swaps (&stuff->xOrigin, n);
- swaps (&stuff->yOrigin, n);
+ swapl(&stuff->picture);
+ swapl(&stuff->region);
+ swaps(&stuff->xOrigin);
+ swaps(&stuff->yOrigin);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
@@ -824,17 +807,16 @@ ProcXFixesExpandRegion (ClientPtr client)
int
SProcXFixesExpandRegion (ClientPtr client)
{
- int n;
REQUEST (xXFixesExpandRegionReq);
- swaps (&stuff->length, n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH (xXFixesExpandRegionReq);
- swapl (&stuff->source, n);
- swapl (&stuff->destination, n);
- swaps (&stuff->left, n);
- swaps (&stuff->right, n);
- swaps (&stuff->top, n);
- swaps (&stuff->bottom, n);
+ swapl(&stuff->source);
+ swapl(&stuff->destination);
+ swaps(&stuff->left);
+ swaps(&stuff->right);
+ swaps(&stuff->top);
+ swaps(&stuff->bottom);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
diff --git a/xorg-server/xfixes/saveset.c b/xorg-server/xfixes/saveset.c
index dcd66792a..ba959c22b 100644
--- a/xorg-server/xfixes/saveset.c
+++ b/xorg-server/xfixes/saveset.c
@@ -1,72 +1,71 @@
-/*
- * Copyright © 2002 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "xfixesint.h"
-
-int
-ProcXFixesChangeSaveSet(ClientPtr client)
-{
- Bool toRoot, map;
- int result;
- WindowPtr pWin;
- REQUEST(xXFixesChangeSaveSetReq);
-
- REQUEST_SIZE_MATCH(xXFixesChangeSaveSetReq);
- result = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess);
- if (result != Success)
- return result;
- if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id)))
- return BadMatch;
- if ((stuff->mode != SetModeInsert) && (stuff->mode != SetModeDelete))
- {
- client->errorValue = stuff->mode;
- return BadValue;
- }
- if ((stuff->target != SaveSetNearest) && (stuff->target != SaveSetRoot))
- {
- client->errorValue = stuff->target;
- return BadValue;
- }
- if ((stuff->map != SaveSetMap) && (stuff->map != SaveSetUnmap))
- {
- client->errorValue = stuff->map;
- return BadValue;
- }
- toRoot = (stuff->target == SaveSetRoot);
- map = (stuff->map == SaveSetMap);
- return AlterSaveSetForClient(client, pWin, stuff->mode, toRoot, map);
-}
-
-int
-SProcXFixesChangeSaveSet(ClientPtr client)
-{
- register int n;
- REQUEST(xXFixesChangeSaveSetReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
- return (*ProcXFixesVector[stuff->xfixesReqType])(client);
-}
+/*
+ * Copyright © 2002 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "xfixesint.h"
+
+int
+ProcXFixesChangeSaveSet(ClientPtr client)
+{
+ Bool toRoot, map;
+ int result;
+ WindowPtr pWin;
+ REQUEST(xXFixesChangeSaveSetReq);
+
+ REQUEST_SIZE_MATCH(xXFixesChangeSaveSetReq);
+ result = dixLookupWindow(&pWin, stuff->window, client, DixManageAccess);
+ if (result != Success)
+ return result;
+ if (client->clientAsMask == (CLIENT_BITS(pWin->drawable.id)))
+ return BadMatch;
+ if ((stuff->mode != SetModeInsert) && (stuff->mode != SetModeDelete))
+ {
+ client->errorValue = stuff->mode;
+ return BadValue;
+ }
+ if ((stuff->target != SaveSetNearest) && (stuff->target != SaveSetRoot))
+ {
+ client->errorValue = stuff->target;
+ return BadValue;
+ }
+ if ((stuff->map != SaveSetMap) && (stuff->map != SaveSetUnmap))
+ {
+ client->errorValue = stuff->map;
+ return BadValue;
+ }
+ toRoot = (stuff->target == SaveSetRoot);
+ map = (stuff->map == SaveSetMap);
+ return AlterSaveSetForClient(client, pWin, stuff->mode, toRoot, map);
+}
+
+int
+SProcXFixesChangeSaveSet(ClientPtr client)
+{
+ REQUEST(xXFixesChangeSaveSetReq);
+
+ swaps(&stuff->length);
+ swapl(&stuff->window);
+ return (*ProcXFixesVector[stuff->xfixesReqType])(client);
+}
diff --git a/xorg-server/xfixes/select.c b/xorg-server/xfixes/select.c
index 1343ea737..2bf13f3fd 100644
--- a/xorg-server/xfixes/select.c
+++ b/xorg-server/xfixes/select.c
@@ -1,290 +1,289 @@
-/*
- * Copyright © 2002 Keith Packard
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Keith Packard not be used in
- * advertising or publicity pertaining to distribution of the software without
- * specific, written prior permission. Keith Packard makes no
- * representations about the suitability of this software for any purpose. It
- * is provided "as is" without express or implied warranty.
- *
- * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "xfixesint.h"
-#include "xace.h"
-
-static RESTYPE SelectionClientType, SelectionWindowType;
-static Bool SelectionCallbackRegistered = FALSE;
-
-/*
- * There is a global list of windows selecting for selection events
- * on every selection. This should be plenty efficient for the
- * expected usage, if it does become a problem, it should be easily
- * replaced with a hash table of some kind keyed off the selection atom
- */
-
-typedef struct _SelectionEvent *SelectionEventPtr;
-
-typedef struct _SelectionEvent {
- SelectionEventPtr next;
- Atom selection;
- CARD32 eventMask;
- ClientPtr pClient;
- WindowPtr pWindow;
- XID clientResource;
-} SelectionEventRec;
-
-static SelectionEventPtr selectionEvents;
-
-static void
-XFixesSelectionCallback (CallbackListPtr *callbacks, pointer data, pointer args)
-{
- SelectionEventPtr e;
- SelectionInfoRec *info = (SelectionInfoRec *) args;
- Selection *selection = info->selection;
- int subtype;
- CARD32 eventMask;
-
- switch (info->kind) {
- case SelectionSetOwner:
- subtype = XFixesSetSelectionOwnerNotify;
- eventMask = XFixesSetSelectionOwnerNotifyMask;
- break;
- case SelectionWindowDestroy:
- subtype = XFixesSelectionWindowDestroyNotify;
- eventMask = XFixesSelectionWindowDestroyNotifyMask;
- break;
- case SelectionClientClose:
- subtype = XFixesSelectionClientCloseNotify;
- eventMask = XFixesSelectionClientCloseNotifyMask;
- break;
- default:
- return;
- }
- for (e = selectionEvents; e; e = e->next)
- {
- if (e->selection == selection->selection &&
- (e->eventMask & eventMask))
- {
- xXFixesSelectionNotifyEvent ev;
-
- memset(&ev, 0, sizeof(xXFixesSelectionNotifyEvent));
- ev.type = XFixesEventBase + XFixesSelectionNotify;
- ev.subtype = subtype;
- ev.window = e->pWindow->drawable.id;
- if (subtype == XFixesSetSelectionOwnerNotify)
- ev.owner = selection->window;
- else
- ev.owner = 0;
- ev.selection = e->selection;
- ev.timestamp = currentTime.milliseconds;
- ev.selectionTimestamp = selection->lastTimeChanged.milliseconds;
- WriteEventsToClient (e->pClient, 1, (xEvent *) &ev);
- }
- }
-}
-
-static Bool
-CheckSelectionCallback (void)
-{
- if (selectionEvents)
- {
- if (!SelectionCallbackRegistered)
- {
- if (!AddCallback (&SelectionCallback, XFixesSelectionCallback, NULL))
- return FALSE;
- SelectionCallbackRegistered = TRUE;
- }
- }
- else
- {
- if (SelectionCallbackRegistered)
- {
- DeleteCallback (&SelectionCallback, XFixesSelectionCallback, NULL);
- SelectionCallbackRegistered = FALSE;
- }
- }
- return TRUE;
-}
-
-#define SelectionAllEvents (XFixesSetSelectionOwnerNotifyMask |\
- XFixesSelectionWindowDestroyNotifyMask |\
- XFixesSelectionClientCloseNotifyMask)
-
-static int
-XFixesSelectSelectionInput (ClientPtr pClient,
- Atom selection,
- WindowPtr pWindow,
- CARD32 eventMask)
-{
- pointer val;
- int rc;
- SelectionEventPtr *prev, e;
-
- rc = XaceHook(XACE_SELECTION_ACCESS, pClient, selection, DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
- for (prev = &selectionEvents; (e = *prev); prev = &e->next)
- {
- if (e->selection == selection &&
- e->pClient == pClient &&
- e->pWindow == pWindow)
- {
- break;
- }
- }
- if (!eventMask)
- {
- if (e)
- {
- FreeResource (e->clientResource, 0);
- }
- return Success;
- }
- if (!e)
- {
- e = (SelectionEventPtr) malloc(sizeof (SelectionEventRec));
- if (!e)
- return BadAlloc;
-
- e->next = 0;
- e->selection = selection;
- e->pClient = pClient;
- e->pWindow = pWindow;
- e->clientResource = FakeClientID(pClient->index);
-
- /*
- * Add a resource hanging from the window to
- * catch window destroy
- */
- rc = dixLookupResourceByType (&val, pWindow->drawable.id,
- SelectionWindowType, serverClient,
- DixGetAttrAccess);
- if (rc != Success)
- if (!AddResource (pWindow->drawable.id, SelectionWindowType,
- (pointer) pWindow))
- {
- free(e);
- return BadAlloc;
- }
-
- if (!AddResource (e->clientResource, SelectionClientType, (pointer) e))
- return BadAlloc;
-
- *prev = e;
- if (!CheckSelectionCallback ())
- {
- FreeResource (e->clientResource, 0);
- return BadAlloc;
- }
- }
- e->eventMask = eventMask;
- return Success;
-}
-
-int
-ProcXFixesSelectSelectionInput (ClientPtr client)
-{
- REQUEST (xXFixesSelectSelectionInputReq);
- WindowPtr pWin;
- int rc;
-
- REQUEST_SIZE_MATCH (xXFixesSelectSelectionInputReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
- if (stuff->eventMask & ~SelectionAllEvents)
- {
- client->errorValue = stuff->eventMask;
- return BadValue;
- }
- return XFixesSelectSelectionInput (client, stuff->selection,
- pWin, stuff->eventMask);
-}
-
-int
-SProcXFixesSelectSelectionInput (ClientPtr client)
-{
- register int n;
- REQUEST(xXFixesSelectSelectionInputReq);
-
- swaps(&stuff->length, n);
- swapl(&stuff->window, n);
- swapl(&stuff->selection, n);
- swapl(&stuff->eventMask, n);
- return (*ProcXFixesVector[stuff->xfixesReqType])(client);
-}
-
-void
-SXFixesSelectionNotifyEvent (xXFixesSelectionNotifyEvent *from,
- xXFixesSelectionNotifyEvent *to)
-{
- to->type = from->type;
- cpswaps (from->sequenceNumber, to->sequenceNumber);
- cpswapl (from->window, to->window);
- cpswapl (from->owner, to->owner);
- cpswapl (from->selection, to->selection);
- cpswapl (from->timestamp, to->timestamp);
- cpswapl (from->selectionTimestamp, to->selectionTimestamp);
-}
-
-static int
-SelectionFreeClient (pointer data, XID id)
-{
- SelectionEventPtr old = (SelectionEventPtr) data;
- SelectionEventPtr *prev, e;
-
- for (prev = &selectionEvents; (e = *prev); prev = &e->next)
- {
- if (e == old)
- {
- *prev = e->next;
- free(e);
- CheckSelectionCallback ();
- break;
- }
- }
- return 1;
-}
-
-static int
-SelectionFreeWindow (pointer data, XID id)
-{
- WindowPtr pWindow = (WindowPtr) data;
- SelectionEventPtr e, next;
-
- for (e = selectionEvents; e; e = next)
- {
- next = e->next;
- if (e->pWindow == pWindow)
- {
- FreeResource (e->clientResource, 0);
- }
- }
- return 1;
-}
-
-Bool
-XFixesSelectionInit (void)
-{
- SelectionClientType = CreateNewResourceType(SelectionFreeClient,
- "XFixesSelectionClient");
- SelectionWindowType = CreateNewResourceType(SelectionFreeWindow,
- "XFixesSelectionWindow");
- return SelectionClientType && SelectionWindowType;
-}
+/*
+ * Copyright © 2002 Keith Packard
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Keith Packard not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. Keith Packard makes no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "xfixesint.h"
+#include "xace.h"
+
+static RESTYPE SelectionClientType, SelectionWindowType;
+static Bool SelectionCallbackRegistered = FALSE;
+
+/*
+ * There is a global list of windows selecting for selection events
+ * on every selection. This should be plenty efficient for the
+ * expected usage, if it does become a problem, it should be easily
+ * replaced with a hash table of some kind keyed off the selection atom
+ */
+
+typedef struct _SelectionEvent *SelectionEventPtr;
+
+typedef struct _SelectionEvent {
+ SelectionEventPtr next;
+ Atom selection;
+ CARD32 eventMask;
+ ClientPtr pClient;
+ WindowPtr pWindow;
+ XID clientResource;
+} SelectionEventRec;
+
+static SelectionEventPtr selectionEvents;
+
+static void
+XFixesSelectionCallback (CallbackListPtr *callbacks, pointer data, pointer args)
+{
+ SelectionEventPtr e;
+ SelectionInfoRec *info = (SelectionInfoRec *) args;
+ Selection *selection = info->selection;
+ int subtype;
+ CARD32 eventMask;
+
+ switch (info->kind) {
+ case SelectionSetOwner:
+ subtype = XFixesSetSelectionOwnerNotify;
+ eventMask = XFixesSetSelectionOwnerNotifyMask;
+ break;
+ case SelectionWindowDestroy:
+ subtype = XFixesSelectionWindowDestroyNotify;
+ eventMask = XFixesSelectionWindowDestroyNotifyMask;
+ break;
+ case SelectionClientClose:
+ subtype = XFixesSelectionClientCloseNotify;
+ eventMask = XFixesSelectionClientCloseNotifyMask;
+ break;
+ default:
+ return;
+ }
+ for (e = selectionEvents; e; e = e->next)
+ {
+ if (e->selection == selection->selection &&
+ (e->eventMask & eventMask))
+ {
+ xXFixesSelectionNotifyEvent ev;
+
+ memset(&ev, 0, sizeof(xXFixesSelectionNotifyEvent));
+ ev.type = XFixesEventBase + XFixesSelectionNotify;
+ ev.subtype = subtype;
+ ev.window = e->pWindow->drawable.id;
+ if (subtype == XFixesSetSelectionOwnerNotify)
+ ev.owner = selection->window;
+ else
+ ev.owner = 0;
+ ev.selection = e->selection;
+ ev.timestamp = currentTime.milliseconds;
+ ev.selectionTimestamp = selection->lastTimeChanged.milliseconds;
+ WriteEventsToClient (e->pClient, 1, (xEvent *) &ev);
+ }
+ }
+}
+
+static Bool
+CheckSelectionCallback (void)
+{
+ if (selectionEvents)
+ {
+ if (!SelectionCallbackRegistered)
+ {
+ if (!AddCallback (&SelectionCallback, XFixesSelectionCallback, NULL))
+ return FALSE;
+ SelectionCallbackRegistered = TRUE;
+ }
+ }
+ else
+ {
+ if (SelectionCallbackRegistered)
+ {
+ DeleteCallback (&SelectionCallback, XFixesSelectionCallback, NULL);
+ SelectionCallbackRegistered = FALSE;
+ }
+ }
+ return TRUE;
+}
+
+#define SelectionAllEvents (XFixesSetSelectionOwnerNotifyMask |\
+ XFixesSelectionWindowDestroyNotifyMask |\
+ XFixesSelectionClientCloseNotifyMask)
+
+static int
+XFixesSelectSelectionInput (ClientPtr pClient,
+ Atom selection,
+ WindowPtr pWindow,
+ CARD32 eventMask)
+{
+ pointer val;
+ int rc;
+ SelectionEventPtr *prev, e;
+
+ rc = XaceHook(XACE_SELECTION_ACCESS, pClient, selection, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ for (prev = &selectionEvents; (e = *prev); prev = &e->next)
+ {
+ if (e->selection == selection &&
+ e->pClient == pClient &&
+ e->pWindow == pWindow)
+ {
+ break;
+ }
+ }
+ if (!eventMask)
+ {
+ if (e)
+ {
+ FreeResource (e->clientResource, 0);
+ }
+ return Success;
+ }
+ if (!e)
+ {
+ e = (SelectionEventPtr) malloc(sizeof (SelectionEventRec));
+ if (!e)
+ return BadAlloc;
+
+ e->next = 0;
+ e->selection = selection;
+ e->pClient = pClient;
+ e->pWindow = pWindow;
+ e->clientResource = FakeClientID(pClient->index);
+
+ /*
+ * Add a resource hanging from the window to
+ * catch window destroy
+ */
+ rc = dixLookupResourceByType (&val, pWindow->drawable.id,
+ SelectionWindowType, serverClient,
+ DixGetAttrAccess);
+ if (rc != Success)
+ if (!AddResource (pWindow->drawable.id, SelectionWindowType,
+ (pointer) pWindow))
+ {
+ free(e);
+ return BadAlloc;
+ }
+
+ if (!AddResource (e->clientResource, SelectionClientType, (pointer) e))
+ return BadAlloc;
+
+ *prev = e;
+ if (!CheckSelectionCallback ())
+ {
+ FreeResource (e->clientResource, 0);
+ return BadAlloc;
+ }
+ }
+ e->eventMask = eventMask;
+ return Success;
+}
+
+int
+ProcXFixesSelectSelectionInput (ClientPtr client)
+{
+ REQUEST (xXFixesSelectSelectionInputReq);
+ WindowPtr pWin;
+ int rc;
+
+ REQUEST_SIZE_MATCH (xXFixesSelectSelectionInputReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+ if (stuff->eventMask & ~SelectionAllEvents)
+ {
+ client->errorValue = stuff->eventMask;
+ return BadValue;
+ }
+ return XFixesSelectSelectionInput (client, stuff->selection,
+ pWin, stuff->eventMask);
+}
+
+int
+SProcXFixesSelectSelectionInput (ClientPtr client)
+{
+ REQUEST(xXFixesSelectSelectionInputReq);
+
+ swaps(&stuff->length);
+ swapl(&stuff->window);
+ swapl(&stuff->selection);
+ swapl(&stuff->eventMask);
+ return (*ProcXFixesVector[stuff->xfixesReqType])(client);
+}
+
+void
+SXFixesSelectionNotifyEvent (xXFixesSelectionNotifyEvent *from,
+ xXFixesSelectionNotifyEvent *to)
+{
+ to->type = from->type;
+ cpswaps (from->sequenceNumber, to->sequenceNumber);
+ cpswapl (from->window, to->window);
+ cpswapl (from->owner, to->owner);
+ cpswapl (from->selection, to->selection);
+ cpswapl (from->timestamp, to->timestamp);
+ cpswapl (from->selectionTimestamp, to->selectionTimestamp);
+}
+
+static int
+SelectionFreeClient (pointer data, XID id)
+{
+ SelectionEventPtr old = (SelectionEventPtr) data;
+ SelectionEventPtr *prev, e;
+
+ for (prev = &selectionEvents; (e = *prev); prev = &e->next)
+ {
+ if (e == old)
+ {
+ *prev = e->next;
+ free(e);
+ CheckSelectionCallback ();
+ break;
+ }
+ }
+ return 1;
+}
+
+static int
+SelectionFreeWindow (pointer data, XID id)
+{
+ WindowPtr pWindow = (WindowPtr) data;
+ SelectionEventPtr e, next;
+
+ for (e = selectionEvents; e; e = next)
+ {
+ next = e->next;
+ if (e->pWindow == pWindow)
+ {
+ FreeResource (e->clientResource, 0);
+ }
+ }
+ return 1;
+}
+
+Bool
+XFixesSelectionInit (void)
+{
+ SelectionClientType = CreateNewResourceType(SelectionFreeClient,
+ "XFixesSelectionClient");
+ SelectionWindowType = CreateNewResourceType(SelectionFreeWindow,
+ "XFixesSelectionWindow");
+ return SelectionClientType && SelectionWindowType;
+}
diff --git a/xorg-server/xfixes/xfixes.c b/xorg-server/xfixes/xfixes.c
index e0ebedd80..96d33c00b 100644
--- a/xorg-server/xfixes/xfixes.c
+++ b/xorg-server/xfixes/xfixes.c
@@ -61,7 +61,6 @@ ProcXFixesQueryVersion(ClientPtr client)
{
XFixesClientPtr pXFixesClient = GetXFixesClient (client);
xXFixesQueryVersionReply rep;
- register int n;
REQUEST(xXFixesQueryVersionReq);
REQUEST_SIZE_MATCH(xXFixesQueryVersionReq);
@@ -83,10 +82,10 @@ ProcXFixesQueryVersion(ClientPtr client)
pXFixesClient->major_version = rep.majorVersion;
pXFixesClient->minor_version = rep.minorVersion;
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length, n);
- swapl(&rep.majorVersion, n);
- swapl(&rep.minorVersion, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.majorVersion);
+ swapl(&rep.minorVersion);
}
WriteToClient(client, sizeof(xXFixesQueryVersionReply), (char *)&rep);
return Success;
@@ -161,12 +160,11 @@ ProcXFixesDispatch (ClientPtr client)
static int
SProcXFixesQueryVersion(ClientPtr client)
{
- register int n;
REQUEST(xXFixesQueryVersionReq);
- swaps(&stuff->length, n);
- swapl(&stuff->majorVersion, n);
- swapl(&stuff->minorVersion, n);
+ swaps(&stuff->length);
+ swapl(&stuff->majorVersion);
+ swapl(&stuff->minorVersion);
return (*ProcXFixesVector[stuff->xfixesReqType]) (client);
}
diff --git a/xorg-server/xkb/ddxList.c b/xorg-server/xkb/ddxList.c
index 7aebd3b17..9e67d71e4 100644
--- a/xorg-server/xkb/ddxList.c
+++ b/xorg-server/xkb/ddxList.c
@@ -107,9 +107,8 @@ char * tmp;
wire16[1]= slen;
memcpy(wire8,str,slen);
if (client->swapped) {
- register int n;
- swaps(&wire16[0],n);
- swaps(&wire16[1],n);
+ swaps(&wire16[0]);
+ swaps(&wire16[1]);
}
list->nPool+= wlen;
list->nFound[what]++;
diff --git a/xorg-server/xkb/xkb.c b/xorg-server/xkb/xkb.c
index 203e4609b..260f4a067 100644
--- a/xorg-server/xkb/xkb.c
+++ b/xorg-server/xkb/xkb.c
@@ -158,7 +158,6 @@ ProcXkbUseExtension(ClientPtr client)
{
REQUEST(xkbUseExtensionReq);
xkbUseExtensionReply rep;
- register int n;
int supported;
REQUEST_SIZE_MATCH(xkbUseExtensionReq);
@@ -189,9 +188,9 @@ ProcXkbUseExtension(ClientPtr client)
rep.serverMajor = SERVER_XKB_MAJOR_VERSION;
rep.serverMinor = SERVER_XKB_MINOR_VERSION;
if ( client->swapped ) {
- swaps(&rep.sequenceNumber, n);
- swaps(&rep.serverMajor, n);
- swaps(&rep.serverMinor, n);
+ swaps(&rep.sequenceNumber);
+ swaps(&rep.serverMajor);
+ swaps(&rep.serverMinor);
}
WriteToClient(client,SIZEOF(xkbUseExtensionReply), (char *)&rep);
return Success;
@@ -574,9 +573,8 @@ ProcXkbGetState(ClientPtr client)
rep.compatState = xkb->compat_state;
rep.ptrBtnState = xkb->ptr_buttons;
if (client->swapped) {
- register int n;
- swaps(&rep.sequenceNumber,n);
- swaps(&rep.ptrBtnState,n);
+ swaps(&rep.sequenceNumber);
+ swaps(&rep.ptrBtnState);
}
WriteToClient(client, SIZEOF(xkbGetStateReply), (char *)&rep);
return Success;
@@ -658,7 +656,6 @@ ProcXkbGetControls(ClientPtr client)
xkbGetControlsReply rep;
XkbControlsPtr xkb;
DeviceIntPtr dev;
- register int n;
REQUEST(xkbGetControlsReq);
REQUEST_SIZE_MATCH(xkbGetControlsReq);
@@ -701,26 +698,26 @@ ProcXkbGetControls(ClientPtr client)
rep.axOptions = xkb->ax_options;
memcpy(rep.perKeyRepeat,xkb->per_key_repeat,XkbPerKeyBitArraySize);
if (client->swapped) {
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.length,n);
- swaps(&rep.internalVMods, n);
- swaps(&rep.ignoreLockVMods, n);
- swapl(&rep.enabledCtrls, n);
- swaps(&rep.repeatDelay, n);
- swaps(&rep.repeatInterval, n);
- swaps(&rep.slowKeysDelay, n);
- swaps(&rep.debounceDelay, n);
- swaps(&rep.mkDelay, n);
- swaps(&rep.mkInterval, n);
- swaps(&rep.mkTimeToMax, n);
- swaps(&rep.mkMaxSpeed, n);
- swaps(&rep.mkCurve, n);
- swaps(&rep.axTimeout, n);
- swapl(&rep.axtCtrlsMask, n);
- swapl(&rep.axtCtrlsValues, n);
- swaps(&rep.axtOptsMask, n);
- swaps(&rep.axtOptsValues, n);
- swaps(&rep.axOptions, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.internalVMods);
+ swaps(&rep.ignoreLockVMods);
+ swapl(&rep.enabledCtrls);
+ swaps(&rep.repeatDelay);
+ swaps(&rep.repeatInterval);
+ swaps(&rep.slowKeysDelay);
+ swaps(&rep.debounceDelay);
+ swaps(&rep.mkDelay);
+ swaps(&rep.mkInterval);
+ swaps(&rep.mkTimeToMax);
+ swaps(&rep.mkMaxSpeed);
+ swaps(&rep.mkCurve);
+ swaps(&rep.axTimeout);
+ swapl(&rep.axtCtrlsMask);
+ swapl(&rep.axtCtrlsValues);
+ swaps(&rep.axtOptsMask);
+ swaps(&rep.axtOptsValues);
+ swaps(&rep.axOptions);
}
WriteToClient(client, SIZEOF(xkbGetControlsReply), (char *)&rep);
return Success;
@@ -999,8 +996,7 @@ XkbWriteKeyTypes( XkbDescPtr xkb,
wire->nMapEntries = type->map_count;
wire->preserve = (type->preserve!=NULL);
if (client->swapped) {
- register int n;
- swaps(&wire->virtualMods,n);
+ swaps(&wire->virtualMods);
}
buf= (char *)&wire[1];
@@ -1016,8 +1012,7 @@ XkbWriteKeyTypes( XkbDescPtr xkb,
wire->realMods= entry->mods.real_mods;
wire->virtualMods= entry->mods.vmods;
if (client->swapped) {
- register int n;
- swaps(&wire->virtualMods,n);
+ swaps(&wire->virtualMods);
}
}
buf= (char *)wire;
@@ -1031,8 +1026,7 @@ XkbWriteKeyTypes( XkbDescPtr xkb,
pwire->realMods= preserve->real_mods;
pwire->virtualMods= preserve->vmods;
if (client->swapped) {
- register int n;
- swaps(&pwire->virtualMods,n);
+ swaps(&pwire->virtualMods);
}
}
buf= (char *)pwire;
@@ -1112,10 +1106,10 @@ register unsigned i;
pSym = &xkb->map->syms[symMap->offset];
memcpy((char *)buf,(char *)pSym,outMap->nSyms*4);
if (client->swapped) {
- register int n,nSyms= outMap->nSyms;
- swaps(&outMap->nSyms,n);
+ register int nSyms= outMap->nSyms;
+ swaps(&outMap->nSyms);
while (nSyms-->0) {
- swapl(buf,n);
+ swapl((int *)buf);
buf+= 4;
}
}
@@ -1402,12 +1396,11 @@ char *desc,*start;
len, (unsigned long)(desc-start));
}
if (client->swapped) {
- register int n;
- swaps(&rep->sequenceNumber,n);
- swapl(&rep->length,n);
- swaps(&rep->present,n);
- swaps(&rep->totalSyms,n);
- swaps(&rep->totalActs,n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->present);
+ swaps(&rep->totalSyms);
+ swaps(&rep->totalActs);
}
WriteToClient(client, (i=SIZEOF(xkbGetMapReply)), (char *)rep);
WriteToClient(client, len, start);
@@ -1589,8 +1582,7 @@ register xkbKeyTypeWireDesc *wire = *wireRtrn;
for (i=0;i<req->nTypes;i++) {
unsigned width;
if (client->swapped) {
- register int s;
- swaps(&wire->virtualMods,s);
+ swaps(&wire->virtualMods);
}
n= i+req->firstType;
width= wire->numLevels;
@@ -1616,8 +1608,7 @@ register xkbKeyTypeWireDesc *wire = *wireRtrn;
preWire= (xkbModsWireDesc *)&mapWire[wire->nMapEntries];
for (n=0;n<wire->nMapEntries;n++) {
if (client->swapped) {
- register int s;
- swaps(&mapWire[n].virtualMods,s);
+ swaps(&mapWire[n].virtualMods);
}
if (mapWire[n].realMods&(~wire->realMods)) {
*nMapsRtrn= _XkbErrCode4(0x06,n,mapWire[n].realMods,
@@ -1635,8 +1626,7 @@ register xkbKeyTypeWireDesc *wire = *wireRtrn;
}
if (wire->preserve) {
if (client->swapped) {
- register int s;
- swaps(&preWire[n].virtualMods,s);
+ swaps(&preWire[n].virtualMods);
}
if (preWire[n].realMods&(~mapWire[n].realMods)) {
*nMapsRtrn= _XkbErrCode4(0x09,n,preWire[n].realMods,
@@ -1686,7 +1676,7 @@ xkbSymMapWireDesc* wire = *wireRtrn;
KeySym *pSyms;
register unsigned nG;
if (client->swapped) {
- swaps(&wire->nSyms,nG);
+ swaps(&wire->nSyms);
}
nG = XkbNumGroups(wire->groupInfo);
if (nG>XkbNumKbdGroups) {
@@ -2066,9 +2056,8 @@ unsigned first,last;
newSyms[s]= pSyms[s];
}
if (client->swapped) {
- int n;
for (s=0;s<wire->nSyms;s++) {
- swapl(&newSyms[s],n);
+ swapl(&newSyms[s]);
}
}
}
@@ -2654,8 +2643,7 @@ int size;
wire->flags= sym->flags;
memcpy((char*)&wire->act,(char*)&sym->act,sz_xkbActionWireDesc);
if (client->swapped) {
- register int n;
- swapl(&wire->sym,n);
+ swapl(&wire->sym);
}
}
if (rep->groups) {
@@ -2666,8 +2654,7 @@ int size;
grp->realMods= compat->groups[i].real_mods;
grp->virtualMods= compat->groups[i].vmods;
if (client->swapped) {
- register int n;
- swaps(&grp->virtualMods,n);
+ swaps(&grp->virtualMods);
}
grp++;
}
@@ -2680,12 +2667,11 @@ int size;
else data= NULL;
if (client->swapped) {
- register int n;
- swaps(&rep->sequenceNumber,n);
- swapl(&rep->length,n);
- swaps(&rep->firstSI,n);
- swaps(&rep->nSI,n);
- swaps(&rep->nTotalSI,n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swaps(&rep->firstSI);
+ swaps(&rep->nSI);
+ swaps(&rep->nTotalSI);
}
WriteToClient(client, SIZEOF(xkbGetCompatMapReply), (char *)rep);
@@ -2802,8 +2788,7 @@ _XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev,
sym = &compat->sym_interpret[req->firstSI];
for (i=0;i<req->nSI;i++,wire++) {
if (client->swapped) {
- int n;
- swapl(&wire->sym,n);
+ swapl(&wire->sym);
}
if (wire->sym == NoSymbol && wire->match == XkbSI_AnyOfOrNone &&
(wire->mods & 0xff) == 0xff &&
@@ -2841,8 +2826,7 @@ _XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev,
for (i = 0, bit = 1; i < XkbNumKbdGroups; i++, bit <<= 1) {
if (req->groups & bit) {
if (client->swapped) {
- int n;
- swaps(&wire->virtualMods,n);
+ swaps(&wire->virtualMods);
}
compat->groups[i].mask= wire->realMods;
compat->groups[i].real_mods= wire->realMods;
@@ -2962,7 +2946,6 @@ ProcXkbGetIndicatorState(ClientPtr client)
xkbGetIndicatorStateReply rep;
XkbSrvLedInfoPtr sli;
DeviceIntPtr dev;
- register int i;
REQUEST(xkbGetIndicatorStateReq);
REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq);
@@ -2984,8 +2967,8 @@ ProcXkbGetIndicatorState(ClientPtr client)
rep.state = sli->effectiveState;
if (client->swapped) {
- swaps(&rep.sequenceNumber,i);
- swapl(&rep.state,i);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.state);
}
WriteToClient(client, SIZEOF(xkbGetIndicatorStateReply), (char *)&rep);
return Success;
@@ -3037,9 +3020,8 @@ register unsigned bit;
wire->virtualMods= indicators->maps[i].mods.vmods;
wire->ctrls= indicators->maps[i].ctrls;
if (client->swapped) {
- register int n;
- swaps(&wire->virtualMods,n);
- swapl(&wire->ctrls,n);
+ swaps(&wire->virtualMods);
+ swapl(&wire->ctrls);
}
wire++;
}
@@ -3055,10 +3037,10 @@ register unsigned bit;
}
else map = NULL;
if (client->swapped) {
- swaps(&rep->sequenceNumber,i);
- swapl(&rep->length,i);
- swapl(&rep->which,i);
- swapl(&rep->realIndicators,i);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->which);
+ swapl(&rep->realIndicators);
}
WriteToClient(client, SIZEOF(xkbGetIndicatorMapReply), (char *)rep);
if (map) {
@@ -3174,9 +3156,8 @@ ProcXkbSetIndicatorMap(ClientPtr client)
for (i=0,bit=1;i<XkbNumIndicators;i++,bit<<=1) {
if (stuff->which&bit) {
if (client->swapped) {
- int n;
- swaps(&from->virtualMods,n);
- swapl(&from->ctrls,n);
+ swaps(&from->virtualMods);
+ swapl(&from->ctrls);
}
CHK_MASK_LEGAL(i,from->whichGroups,XkbIM_UseAnyGroup);
CHK_MASK_LEGAL(i,from->whichMods,XkbIM_UseAnyMods);
@@ -3277,12 +3258,11 @@ ProcXkbGetNamedIndicator(ClientPtr client)
rep.supported= TRUE;
}
if ( client->swapped ) {
- register int n;
- swapl(&rep.length,n);
- swaps(&rep.sequenceNumber,n);
- swapl(&rep.indicator,n);
- swaps(&rep.virtualMods,n);
- swapl(&rep.ctrls,n);
+ swapl(&rep.length);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.indicator);
+ swaps(&rep.virtualMods);
+ swapl(&rep.ctrls);
}
WriteToClient(client,SIZEOF(xkbGetNamedIndicatorReply), (char *)&rep);
@@ -3529,8 +3509,7 @@ Atom *atm;
if (atoms[i]!=None) {
*atm= atoms[i];
if (swap) {
- register int n;
- swapl(atm,n);
+ swapl(atm);
}
atm++;
}
@@ -3649,16 +3628,15 @@ XkbSendNames(ClientPtr client,XkbDescPtr xkb,xkbGetNamesReply *rep)
register unsigned i,length,which;
char * start;
char * desc;
-register int n;
length= rep->length*4;
which= rep->which;
if (client->swapped) {
- swaps(&rep->sequenceNumber,n);
- swapl(&rep->length,n);
- swapl(&rep->which,n);
- swaps(&rep->virtualMods,n);
- swapl(&rep->indicators,n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->which);
+ swaps(&rep->virtualMods);
+ swapl(&rep->indicators);
}
start = desc = calloc(1, length);
@@ -3668,21 +3646,21 @@ register int n;
if (which&XkbKeycodesNameMask) {
*((CARD32 *)desc)= xkb->names->keycodes;
if (client->swapped) {
- swapl(desc,n);
+ swapl((int *)desc);
}
desc+= 4;
}
if (which&XkbGeometryNameMask) {
*((CARD32 *)desc)= xkb->names->geometry;
if (client->swapped) {
- swapl(desc,n);
+ swapl((int *)desc);
}
desc+= 4;
}
if (which&XkbSymbolsNameMask) {
*((CARD32 *)desc)= xkb->names->symbols;
if (client->swapped) {
- swapl(desc,n);
+ swapl((int *)desc);
}
desc+= 4;
}
@@ -3690,21 +3668,21 @@ register int n;
register CARD32 *atm= (CARD32 *)desc;
atm[0]= (CARD32)xkb->names->phys_symbols;
if (client->swapped) {
- swapl(&atm[0],n);
+ swapl(&atm[0]);
}
desc+= 4;
}
if (which&XkbTypesNameMask) {
*((CARD32 *)desc)= (CARD32)xkb->names->types;
if (client->swapped) {
- swapl(desc,n);
+ swapl((int *)desc);
}
desc+= 4;
}
if (which&XkbCompatNameMask) {
*((CARD32 *)desc)= (CARD32)xkb->names->compat;
if (client->swapped) {
- swapl(desc,n);
+ swapl((int *)desc);
}
desc+= 4;
}
@@ -3715,7 +3693,7 @@ register int n;
for (i=0;i<xkb->map->num_types;i++,atm++,type++) {
*atm= (CARD32)type->name;
if (client->swapped) {
- swapl(atm,n);
+ swapl(atm);
}
}
desc= (char *)atm;
@@ -3736,7 +3714,7 @@ register int n;
for (l=0;l<type->num_levels;l++,atm++) {
*atm= type->level_names[l];
if (client->swapped) {
- swapl(atm,n);
+ swapl(atm);
}
}
desc+= type->num_levels*4;
@@ -3772,7 +3750,7 @@ register int n;
for (i=0;i<rep->nRadioGroups;i++,atm++) {
*atm= (CARD32)xkb->names->radio_groups[i];
if (client->swapped) {
- swapl(atm,n);
+ swapl(atm);
}
}
desc+= rep->nRadioGroups*4;
@@ -3835,8 +3813,7 @@ register int i;
for (i=0;i<nAtoms;i++,wire++) {
if (swapped) {
- register int n;
- swapl(wire,n);
+ swapl(wire);
}
if ((((Atom)*wire)!=None)&&(!ValidAtom((Atom)*wire))) {
*pError= ((Atom)*wire);
@@ -3856,8 +3833,7 @@ register unsigned i,bit;
if ((present&bit)==0)
continue;
if (swapped) {
- register int n;
- swapl(wire,n);
+ swapl(wire);
}
if ((((Atom)*wire)!=None)&&(!ValidAtom(((Atom)*wire)))) {
*pError= (Atom)*wire;
@@ -4347,8 +4323,7 @@ XkbWriteCountedString(char *wire,char *str,Bool swap)
pLen= (CARD16 *)wire;
*pLen= len;
if (swap) {
- register int n;
- swaps(pLen,n);
+ swaps(pLen);
}
paddedLen= pad_to_int32(sizeof(len)+len)-sizeof(len);
strncpy(&wire[sizeof(len)],str,paddedLen);
@@ -4465,8 +4440,7 @@ xkbShapeWireDesc * shapeWire;
else shapeWire->approxNdx= XkbNoShape;
shapeWire->pad= 0;
if (swap) {
- register int n;
- swapl(&shapeWire->name,n);
+ swapl(&shapeWire->name);
}
wire= (char *)&shapeWire[1];
for (o=0,ol=shape->outlines;o<shape->num_outlines;o++,ol++) {
@@ -4483,9 +4457,8 @@ xkbShapeWireDesc * shapeWire;
ptWire[p].x= pt->x;
ptWire[p].y= pt->y;
if (swap) {
- register int n;
- swaps(&ptWire[p].x,n);
- swaps(&ptWire[p].y,n);
+ swaps(&ptWire[p].x);
+ swaps(&ptWire[p].y);
}
}
wire= (char *)&ptWire[ol->num_points];
@@ -4528,10 +4501,9 @@ xkbDoodadWireDesc * doodadWire;
doodadWire->any.top= doodad->any.top;
doodadWire->any.left= doodad->any.left;
if (swap) {
- register int n;
- swapl(&doodadWire->any.name,n);
- swaps(&doodadWire->any.top,n);
- swaps(&doodadWire->any.left,n);
+ swapl(&doodadWire->any.name);
+ swaps(&doodadWire->any.top);
+ swaps(&doodadWire->any.left);
}
switch (doodad->any.type) {
case XkbOutlineDoodad:
@@ -4540,8 +4512,7 @@ xkbDoodadWireDesc * doodadWire;
doodadWire->shape.colorNdx= doodad->shape.color_ndx;
doodadWire->shape.shapeNdx= doodad->shape.shape_ndx;
if (swap) {
- register int n;
- swaps(&doodadWire->shape.angle,n);
+ swaps(&doodadWire->shape.angle);
}
break;
case XkbTextDoodad:
@@ -4550,10 +4521,9 @@ xkbDoodadWireDesc * doodadWire;
doodadWire->text.height= doodad->text.height;
doodadWire->text.colorNdx= doodad->text.color_ndx;
if (swap) {
- register int n;
- swaps(&doodadWire->text.angle,n);
- swaps(&doodadWire->text.width,n);
- swaps(&doodadWire->text.height,n);
+ swaps(&doodadWire->text.angle);
+ swaps(&doodadWire->text.width);
+ swaps(&doodadWire->text.height);
}
wire= XkbWriteCountedString(wire,doodad->text.text,swap);
wire= XkbWriteCountedString(wire,doodad->text.font,swap);
@@ -4593,8 +4563,7 @@ xkbOverlayWireDesc * olWire;
olWire->pad1= 0;
olWire->pad2= 0;
if (swap) {
- register int n;
- swapl(&olWire->name,n);
+ swapl(&olWire->name);
}
wire= (char *)&olWire[1];
for (r=0,row=ol->rows;r<ol->num_rows;r++,row++) {
@@ -4673,13 +4642,12 @@ xkbSectionWireDesc * sectionWire;
sectionWire->nOverlays= section->num_overlays;
sectionWire->pad= 0;
if (swap) {
- register int n;
- swapl(&sectionWire->name,n);
- swaps(&sectionWire->top,n);
- swaps(&sectionWire->left,n);
- swaps(&sectionWire->width,n);
- swaps(&sectionWire->height,n);
- swaps(&sectionWire->angle,n);
+ swapl(&sectionWire->name);
+ swaps(&sectionWire->top);
+ swaps(&sectionWire->left);
+ swaps(&sectionWire->width);
+ swaps(&sectionWire->height);
+ swaps(&sectionWire->angle);
}
wire= (char *)&sectionWire[1];
if (section->rows) {
@@ -4694,9 +4662,8 @@ xkbSectionWireDesc * sectionWire;
rowWire->vertical= row->vertical;
rowWire->pad= 0;
if (swap) {
- register int n;
- swaps(&rowWire->top,n);
- swaps(&rowWire->left,n);
+ swaps(&rowWire->top);
+ swaps(&rowWire->left);
}
wire= (char *)&rowWire[1];
if (row->keys) {
@@ -4710,8 +4677,7 @@ xkbSectionWireDesc * sectionWire;
keyWire[k].shapeNdx= key->shape_ndx;
keyWire[k].colorNdx= key->color_ndx;
if (swap) {
- register int n;
- swaps(&keyWire[k].gap,n);
+ swaps(&keyWire[k].gap);
}
}
wire= (char *)&keyWire[row->num_keys];
@@ -4813,18 +4779,17 @@ XkbSendGeometry( ClientPtr client,
start= NULL;
}
if (client->swapped) {
- register int n;
- swaps(&rep->sequenceNumber,n);
- swapl(&rep->length,n);
- swapl(&rep->name,n);
- swaps(&rep->widthMM,n);
- swaps(&rep->heightMM,n);
- swaps(&rep->nProperties,n);
- swaps(&rep->nColors,n);
- swaps(&rep->nShapes,n);
- swaps(&rep->nSections,n);
- swaps(&rep->nDoodads,n);
- swaps(&rep->nKeyAliases,n);
+ swaps(&rep->sequenceNumber);
+ swapl(&rep->length);
+ swapl(&rep->name);
+ swaps(&rep->widthMM);
+ swaps(&rep->heightMM);
+ swaps(&rep->nProperties);
+ swaps(&rep->nColors);
+ swaps(&rep->nShapes);
+ swaps(&rep->nSections);
+ swaps(&rep->nDoodads);
+ swaps(&rep->nKeyAliases);
}
WriteToClient(client, SIZEOF(xkbGetGeometryReply), (char *)rep);
if (len>0)
@@ -4876,8 +4841,7 @@ CARD16 len,*plen;
wire= *wire_inout;
plen= (CARD16 *)wire;
if (swap) {
- register int n;
- swaps(plen,n);
+ swaps(plen);
}
len= *plen;
str= malloc(len+1);
@@ -4903,11 +4867,10 @@ XkbDoodadPtr doodad;
dWire= (xkbDoodadWireDesc *)(*wire_inout);
wire= (char *)&dWire[1];
if (client->swapped) {
- register int n;
- swapl(&dWire->any.name,n);
- swaps(&dWire->any.top,n);
- swaps(&dWire->any.left,n);
- swaps(&dWire->any.angle,n);
+ swapl(&dWire->any.name);
+ swaps(&dWire->any.top);
+ swaps(&dWire->any.left);
+ swaps(&dWire->any.angle);
}
CHK_ATOM_ONLY(dWire->any.name);
doodad= XkbAddGeomDoodad(geom,section,dWire->any.name);
@@ -4941,9 +4904,8 @@ XkbDoodadPtr doodad;
return BadMatch;
}
if (client->swapped) {
- register int n;
- swaps(&dWire->text.width,n);
- swaps(&dWire->text.height,n);
+ swaps(&dWire->text.width);
+ swaps(&dWire->text.height);
}
doodad->text.width= dWire->text.width;
doodad->text.height= dWire->text.height;
@@ -5009,8 +4971,7 @@ xkbOverlayRowWireDesc * rWire;
wire= *wire_inout;
olWire= (xkbOverlayWireDesc *)wire;
if (client->swapped) {
- register int n;
- swapl(&olWire->name,n);
+ swapl(&olWire->name);
}
CHK_ATOM_ONLY(olWire->name);
ol= XkbAddGeomOverlay(section,olWire->name,olWire->nRows);
@@ -5062,13 +5023,12 @@ XkbSectionPtr section;
register int r;
xkbRowWireDesc * rWire;
if (client->swapped) {
- register int n;
- swapl(&sWire->name,n);
- swaps(&sWire->top,n);
- swaps(&sWire->left,n);
- swaps(&sWire->width,n);
- swaps(&sWire->height,n);
- swaps(&sWire->angle,n);
+ swapl(&sWire->name);
+ swaps(&sWire->top);
+ swaps(&sWire->left);
+ swaps(&sWire->width);
+ swaps(&sWire->height);
+ swaps(&sWire->angle);
}
CHK_ATOM_ONLY(sWire->name);
section= XkbAddGeomSection(geom,sWire->name,sWire->nRows,
@@ -5087,9 +5047,8 @@ XkbSectionPtr section;
XkbRowPtr row;
xkbKeyWireDesc * kWire;
if (client->swapped) {
- register int n;
- swaps(&rWire->top,n);
- swaps(&rWire->left,n);
+ swaps(&rWire->top);
+ swaps(&rWire->left);
}
row= XkbAddGeomRow(section,rWire->nKeys);
if (!row)
@@ -5184,9 +5143,8 @@ char * wire;
pt->x= ptWire[p].x;
pt->y= ptWire[p].y;
if (client->swapped) {
- register int n;
- swaps(&pt->x,n);
- swaps(&pt->y,n);
+ swaps(&pt->x);
+ swaps(&pt->y);
}
}
ol->num_points= olWire->nPoints;
@@ -5453,12 +5411,11 @@ ProcXkbPerClientFlags(ClientPtr client)
rep.autoCtrls= rep.autoCtrlValues= 0;
}
if ( client->swapped ) {
- register int n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.supported,n);
- swapl(&rep.value,n);
- swapl(&rep.autoCtrls,n);
- swapl(&rep.autoCtrlValues,n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.supported);
+ swapl(&rep.value);
+ swapl(&rep.autoCtrls);
+ swapl(&rep.autoCtrlValues);
}
WriteToClient(client,SIZEOF(xkbPerClientFlagsReply), (char *)&rep);
return Success;
@@ -5576,16 +5533,15 @@ ProcXkbListComponents(ClientPtr client)
if (list.nTotal>list.maxRtrn)
rep.extra = (list.nTotal-list.maxRtrn);
if (client->swapped) {
- register int n;
- swaps(&rep.sequenceNumber,n);
- swapl(&rep.length,n);
- swaps(&rep.nKeymaps,n);
- swaps(&rep.nKeycodes,n);
- swaps(&rep.nTypes,n);
- swaps(&rep.nCompatMaps,n);
- swaps(&rep.nSymbols,n);
- swaps(&rep.nGeometries,n);
- swaps(&rep.extra,n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.nKeymaps);
+ swaps(&rep.nKeycodes);
+ swaps(&rep.nTypes);
+ swaps(&rep.nCompatMaps);
+ swaps(&rep.nSymbols);
+ swaps(&rep.nGeometries);
+ swaps(&rep.extra);
}
WriteToClient(client,SIZEOF(xkbListComponentsReply),(char *)&rep);
if (list.nPool && list.pool) {
@@ -5851,11 +5807,10 @@ ProcXkbGetKbdByName(ClientPtr client)
reported= rep.reported;
if ( client->swapped ) {
- register int n;
- swaps(&rep.sequenceNumber,n);
- swapl(&rep.length,n);
- swaps(&rep.found,n);
- swaps(&rep.reported,n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.found);
+ swaps(&rep.reported);
}
WriteToClient(client,SIZEOF(xkbGetKbdByNameReply), (char *)&rep);
if (reported&(XkbGBN_SymbolsMask|XkbGBN_TypesMask))
@@ -6040,13 +5995,12 @@ int length;
wire.physIndicators= sli->physIndicators;
wire.state= sli->effectiveState;
if (client->swapped) {
- register int n;
- swaps(&wire.ledClass,n);
- swaps(&wire.ledID,n);
- swapl(&wire.namesPresent,n);
- swapl(&wire.mapsPresent,n);
- swapl(&wire.physIndicators,n);
- swapl(&wire.state,n);
+ swaps(&wire.ledClass);
+ swaps(&wire.ledID);
+ swapl(&wire.namesPresent);
+ swapl(&wire.mapsPresent);
+ swapl(&wire.physIndicators);
+ swapl(&wire.state);
}
WriteToClient(client,SIZEOF(xkbDeviceLedsWireDesc),(char *)&wire);
length+= SIZEOF(xkbDeviceLedsWireDesc);
@@ -6058,8 +6012,7 @@ int length;
if (sli->namesPresent&bit) {
awire= (CARD32)sli->names[i];
if (client->swapped) {
- register int n;
- swapl(&awire,n);
+ swapl(&awire);
}
WriteToClient(client,4,(char *)&awire);
length+= 4;
@@ -6079,9 +6032,8 @@ int length;
iwire.virtualMods= sli->maps[i].mods.vmods;
iwire.ctrls= sli->maps[i].ctrls;
if (client->swapped) {
- register int n;
- swaps(&iwire.virtualMods,n);
- swapl(&iwire.ctrls,n);
+ swaps(&iwire.virtualMods);
+ swapl(&iwire.ctrls);
}
WriteToClient(client,SIZEOF(xkbIndicatorMapWireDesc),
(char *)&iwire);
@@ -6234,14 +6186,15 @@ char * str;
length= rep.length*4;
nDeviceLedFBs = rep.nDeviceLedFBs;
if (client->swapped) {
- register int n;
- swaps(&rep.sequenceNumber,n);
- swapl(&rep.length,n);
- swaps(&rep.present,n);
- swaps(&rep.supported,n);
- swaps(&rep.unsupported,n);
- swaps(&rep.nDeviceLedFBs,n);
- swapl(&rep.type,n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.present);
+ swaps(&rep.supported);
+ swaps(&rep.unsupported);
+ swaps(&rep.nDeviceLedFBs);
+ swaps(&rep.dfltKbdFB);
+ swaps(&rep.dfltLedFB);
+ swapl(&rep.devType);
}
WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), (char *)&rep);
@@ -6288,12 +6241,11 @@ XkbSrvLedInfoPtr sli;
ledWire= (xkbDeviceLedsWireDesc *)wire;
for (i=0;i<num;i++) {
if (client->swapped) {
- register int n;
- swaps(&ledWire->ledClass,n);
- swaps(&ledWire->ledID,n);
- swapl(&ledWire->namesPresent,n);
- swapl(&ledWire->mapsPresent,n);
- swapl(&ledWire->physIndicators,n);
+ swaps(&ledWire->ledClass);
+ swaps(&ledWire->ledID);
+ swapl(&ledWire->namesPresent);
+ swapl(&ledWire->mapsPresent);
+ swapl(&ledWire->physIndicators);
}
sli= XkbFindSrvLedInfo(dev,ledWire->ledClass,ledWire->ledID,
@@ -6316,8 +6268,7 @@ XkbSrvLedInfoPtr sli;
if (nNames>0) {
for (n=0;n<nNames;n++) {
if (client->swapped) {
- register int t;
- swapl(atomWire,t);
+ swapl(atomWire);
}
CHK_ATOM_OR_NONE3(((Atom)(*atomWire)),client->errorValue,
*status_rtrn,NULL);
@@ -6328,9 +6279,8 @@ XkbSrvLedInfoPtr sli;
if (nMaps>0) {
for (n=0;n<nMaps;n++) {
if (client->swapped) {
- register int t;
- swaps(&mapWire->virtualMods,t);
- swapl(&mapWire->ctrls,t);
+ swaps(&mapWire->virtualMods);
+ swapl(&mapWire->ctrls);
}
CHK_MASK_LEGAL3(0x21,mapWire->whichGroups,
XkbIM_UseAnyGroup,
@@ -6651,12 +6601,11 @@ int rc;
rep.supportedFlags = ~0;
rep.supportedCtrls = ~0;
if ( client->swapped ) {
- register int n;
- swaps(&rep.sequenceNumber, n);
- swapl(&rep.currentFlags, n);
- swapl(&rep.currentCtrls, n);
- swapl(&rep.supportedFlags, n);
- swapl(&rep.supportedCtrls, n);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.currentFlags);
+ swapl(&rep.currentCtrls);
+ swapl(&rep.supportedFlags);
+ swapl(&rep.supportedCtrls);
}
WriteToClient(client,SIZEOF(xkbSetDebuggingFlagsReply), (char *)&rep);
return Success;
diff --git a/xorg-server/xkb/xkbEvents.c b/xorg-server/xkb/xkbEvents.c
index dfbf7f2b3..347f0f8a4 100644
--- a/xorg-server/xkb/xkbEvents.c
+++ b/xorg-server/xkb/xkbEvents.c
@@ -172,10 +172,9 @@ XkbSendNewKeyboardNotify(DeviceIntPtr kbd,xkbNewKeyboardNotify *pNKN)
pNKN->time = time;
pNKN->changed = changed;
if (clients[i]->swapped) {
- int n;
- swaps(&pNKN->sequenceNumber,n);
- swapl(&pNKN->time,n);
- swaps(&pNKN->changed,n);
+ swaps(&pNKN->sequenceNumber);
+ swapl(&pNKN->time);
+ swaps(&pNKN->changed);
}
WriteToClient(clients[i], sizeof(xEvent), pNKN);
@@ -239,11 +238,10 @@ register CARD16 changed,bState;
pSN->changed = changed;
pSN->ptrBtnState = bState;
if ( interest->client->swapped ) {
- register int n;
- swaps(&pSN->sequenceNumber,n);
- swapl(&pSN->time,n);
- swaps(&pSN->changed,n);
- swaps(&pSN->ptrBtnState,n);
+ swaps(&pSN->sequenceNumber);
+ swapl(&pSN->time);
+ swaps(&pSN->changed);
+ swaps(&pSN->ptrBtnState);
}
WriteToClient(interest->client, sizeof(xEvent), (char *)pSN);
}
@@ -285,10 +283,9 @@ XkbSendMapNotify(DeviceIntPtr kbd, xkbMapNotify *pMN)
pMN->changed = changed;
if (clients[i]->swapped) {
- int n;
- swaps(&pMN->sequenceNumber, n);
- swapl(&pMN->time, n);
- swaps(&pMN->changed, n);
+ swaps(&pMN->sequenceNumber);
+ swapl(&pMN->time);
+ swaps(&pMN->changed);
}
WriteToClient(clients[i], sizeof(xEvent), pMN);
}
@@ -413,12 +410,11 @@ Time time = 0;
pCN->sequenceNumber = interest->client->sequence;
pCN->time = time;
if ( interest->client->swapped ) {
- register int n;
- swaps(&pCN->sequenceNumber,n);
- swapl(&pCN->changedControls,n);
- swapl(&pCN->enabledControls,n);
- swapl(&pCN->enabledControlChanges,n);
- swapl(&pCN->time,n);
+ swaps(&pCN->sequenceNumber);
+ swapl(&pCN->changedControls);
+ swapl(&pCN->enabledControls);
+ swapl(&pCN->enabledControlChanges);
+ swapl(&pCN->time);
}
WriteToClient(interest->client, sizeof(xEvent), (char *)pCN);
}
@@ -462,11 +458,10 @@ CARD32 state,changed;
pEv->changed = changed;
pEv->state = state;
if ( interest->client->swapped ) {
- register int n;
- swaps(&pEv->sequenceNumber,n);
- swapl(&pEv->time,n);
- swapl(&pEv->changed,n);
- swapl(&pEv->state,n);
+ swaps(&pEv->sequenceNumber);
+ swapl(&pEv->time);
+ swapl(&pEv->changed);
+ swapl(&pEv->state);
}
WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
}
@@ -549,13 +544,12 @@ XID winID = 0;
bn.name = name;
bn.window= winID;
if ( interest->client->swapped ) {
- register int n;
- swaps(&bn.sequenceNumber,n);
- swapl(&bn.time,n);
- swaps(&bn.pitch,n);
- swaps(&bn.duration,n);
- swapl(&bn.name,n);
- swapl(&bn.window,n);
+ swaps(&bn.sequenceNumber);
+ swapl(&bn.time);
+ swaps(&bn.pitch);
+ swaps(&bn.duration);
+ swapl(&bn.name);
+ swapl(&bn.window);
}
WriteToClient(interest->client, sizeof(xEvent), (char *)&bn);
}
@@ -596,11 +590,10 @@ CARD16 sk_delay,db_delay;
pEv->slowKeysDelay = sk_delay;
pEv->debounceDelay = db_delay;
if ( interest->client->swapped ) {
- register int n;
- swaps(&pEv->sequenceNumber,n);
- swapl(&pEv->time,n);
- swaps(&pEv->slowKeysDelay,n);
- swaps(&pEv->debounceDelay,n);
+ swaps(&pEv->sequenceNumber);
+ swapl(&pEv->time);
+ swaps(&pEv->slowKeysDelay);
+ swaps(&pEv->debounceDelay);
}
WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
}
@@ -644,12 +637,11 @@ CARD32 changedIndicators;
pEv->changedIndicators = changedIndicators;
pEv->changedVirtualMods= changedVirtualMods;
if ( interest->client->swapped ) {
- register int n;
- swaps(&pEv->sequenceNumber,n);
- swapl(&pEv->time,n);
- swaps(&pEv->changed,n);
- swapl(&pEv->changedIndicators,n);
- swaps(&pEv->changedVirtualMods,n);
+ swaps(&pEv->sequenceNumber);
+ swapl(&pEv->time);
+ swaps(&pEv->changed);
+ swapl(&pEv->changedIndicators);
+ swaps(&pEv->changedVirtualMods);
}
WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
}
@@ -692,12 +684,11 @@ CARD16 firstSI = 0, nSI = 0, nTotalSI = 0;
pEv->nSI = nSI;
pEv->nTotalSI = nTotalSI;
if ( interest->client->swapped ) {
- register int n;
- swaps(&pEv->sequenceNumber,n);
- swapl(&pEv->time,n);
- swaps(&pEv->firstSI,n);
- swaps(&pEv->nSI,n);
- swaps(&pEv->nTotalSI,n);
+ swaps(&pEv->sequenceNumber);
+ swapl(&pEv->time);
+ swaps(&pEv->firstSI);
+ swaps(&pEv->nSI);
+ swaps(&pEv->nTotalSI);
}
WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
}
@@ -739,9 +730,8 @@ Time time = 0;
pEv->sequenceNumber = interest->client->sequence;
pEv->time = time;
if ( interest->client->swapped ) {
- register int n;
- swaps(&pEv->sequenceNumber,n);
- swapl(&pEv->time,n);
+ swaps(&pEv->sequenceNumber);
+ swapl(&pEv->time);
}
WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
}
@@ -791,13 +781,12 @@ CARD16 reason;
pEv->supported= XkbXI_AllFeaturesMask;
}
if ( interest->client->swapped ) {
- register int n;
- swaps(&pEv->sequenceNumber,n);
- swapl(&pEv->time,n);
- swapl(&pEv->ledsDefined,n);
- swapl(&pEv->ledState,n);
- swaps(&pEv->reason,n);
- swaps(&pEv->supported,n);
+ swaps(&pEv->sequenceNumber);
+ swapl(&pEv->time);
+ swapl(&pEv->ledsDefined);
+ swapl(&pEv->ledState);
+ swaps(&pEv->reason);
+ swaps(&pEv->supported);
}
WriteToClient(interest->client, sizeof(xEvent), (char *)pEv);
}
diff --git a/xorg-server/xkb/xkbSwap.c b/xorg-server/xkb/xkbSwap.c
index ffd66b563..fcae918a9 100644
--- a/xorg-server/xkb/xkbSwap.c
+++ b/xorg-server/xkb/xkbSwap.c
@@ -44,32 +44,28 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
static int
SProcXkbUseExtension(ClientPtr client)
{
-register int n;
-
REQUEST(xkbUseExtensionReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbUseExtensionReq);
- swaps(&stuff->wantedMajor,n);
- swaps(&stuff->wantedMinor,n);
+ swaps(&stuff->wantedMajor);
+ swaps(&stuff->wantedMinor);
return ProcXkbUseExtension(client);
}
static int
SProcXkbSelectEvents(ClientPtr client)
{
-register int n;
-
REQUEST(xkbSelectEventsReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbSelectEventsReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->affectWhich,n);
- swaps(&stuff->clear,n);
- swaps(&stuff->selectAll,n);
- swaps(&stuff->affectMap,n);
- swaps(&stuff->map,n);
+ swaps(&stuff->deviceSpec);
+ swaps(&stuff->affectWhich);
+ swaps(&stuff->clear);
+ swaps(&stuff->selectAll);
+ swaps(&stuff->affectMap);
+ swaps(&stuff->map);
if ((stuff->affectWhich&(~XkbMapNotifyMask))!=0) {
union {
BOOL *b;
@@ -113,12 +109,12 @@ register int n;
if (dataLeft<(size*2))
return BadLength;
if (size==2) {
- swaps(&from.c16[0],n);
- swaps(&from.c16[1],n);
+ swaps(&from.c16[0]);
+ swaps(&from.c16[1]);
}
else if (size==4) {
- swapl(&from.c32[0],n);
- swapl(&from.c32[1],n);
+ swapl(&from.c32[0]);
+ swapl(&from.c32[1]);
}
else {
size= 2;
@@ -137,128 +133,114 @@ register int n;
static int
SProcXkbBell(ClientPtr client)
{
-register int n;
-
REQUEST(xkbBellReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbBellReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->bellClass,n);
- swaps(&stuff->bellID,n);
- swapl(&stuff->name,n);
- swapl(&stuff->window,n);
- swaps(&stuff->pitch,n);
- swaps(&stuff->duration,n);
+ swaps(&stuff->deviceSpec);
+ swaps(&stuff->bellClass);
+ swaps(&stuff->bellID);
+ swapl(&stuff->name);
+ swapl(&stuff->window);
+ swaps(&stuff->pitch);
+ swaps(&stuff->duration);
return ProcXkbBell(client);
}
static int
SProcXkbGetState(ClientPtr client)
{
-register int n;
-
REQUEST(xkbGetStateReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetStateReq);
- swaps(&stuff->deviceSpec,n);
+ swaps(&stuff->deviceSpec);
return ProcXkbGetState(client);
}
static int
SProcXkbLatchLockState(ClientPtr client)
{
-register int n;
-
REQUEST(xkbLatchLockStateReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbLatchLockStateReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->groupLatch,n);
+ swaps(&stuff->deviceSpec);
+ swaps(&stuff->groupLatch);
return ProcXkbLatchLockState(client);
}
static int
SProcXkbGetControls(ClientPtr client)
{
-register int n;
-
REQUEST(xkbGetControlsReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetControlsReq);
- swaps(&stuff->deviceSpec,n);
+ swaps(&stuff->deviceSpec);
return ProcXkbGetControls(client);
}
static int
SProcXkbSetControls(ClientPtr client)
{
-register int n;
-
REQUEST(xkbSetControlsReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbSetControlsReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->affectInternalVMods,n);
- swaps(&stuff->internalVMods,n);
- swaps(&stuff->affectIgnoreLockVMods,n);
- swaps(&stuff->ignoreLockVMods,n);
- swaps(&stuff->axOptions,n);
- swapl(&stuff->affectEnabledCtrls,n);
- swapl(&stuff->enabledCtrls,n);
- swapl(&stuff->changeCtrls,n);
- swaps(&stuff->repeatDelay,n);
- swaps(&stuff->repeatInterval,n);
- swaps(&stuff->slowKeysDelay,n);
- swaps(&stuff->debounceDelay,n);
- swaps(&stuff->mkDelay,n);
- swaps(&stuff->mkInterval,n);
- swaps(&stuff->mkTimeToMax,n);
- swaps(&stuff->mkMaxSpeed,n);
- swaps(&stuff->mkCurve,n);
- swaps(&stuff->axTimeout,n);
- swapl(&stuff->axtCtrlsMask,n);
- swapl(&stuff->axtCtrlsValues,n);
- swaps(&stuff->axtOptsMask,n);
- swaps(&stuff->axtOptsValues,n);
+ swaps(&stuff->deviceSpec);
+ swaps(&stuff->affectInternalVMods);
+ swaps(&stuff->internalVMods);
+ swaps(&stuff->affectIgnoreLockVMods);
+ swaps(&stuff->ignoreLockVMods);
+ swaps(&stuff->axOptions);
+ swapl(&stuff->affectEnabledCtrls);
+ swapl(&stuff->enabledCtrls);
+ swapl(&stuff->changeCtrls);
+ swaps(&stuff->repeatDelay);
+ swaps(&stuff->repeatInterval);
+ swaps(&stuff->slowKeysDelay);
+ swaps(&stuff->debounceDelay);
+ swaps(&stuff->mkDelay);
+ swaps(&stuff->mkInterval);
+ swaps(&stuff->mkTimeToMax);
+ swaps(&stuff->mkMaxSpeed);
+ swaps(&stuff->mkCurve);
+ swaps(&stuff->axTimeout);
+ swapl(&stuff->axtCtrlsMask);
+ swapl(&stuff->axtCtrlsValues);
+ swaps(&stuff->axtOptsMask);
+ swaps(&stuff->axtOptsValues);
return ProcXkbSetControls(client);
}
static int
SProcXkbGetMap(ClientPtr client)
{
-register int n;
-
REQUEST(xkbGetMapReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetMapReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->full,n);
- swaps(&stuff->partial,n);
- swaps(&stuff->virtualMods,n);
+ swaps(&stuff->deviceSpec);
+ swaps(&stuff->full);
+ swaps(&stuff->partial);
+ swaps(&stuff->virtualMods);
return ProcXkbGetMap(client);
}
static int
SProcXkbSetMap(ClientPtr client)
{
-register int n;
-
REQUEST(xkbSetMapReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbSetMapReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->present,n);
- swaps(&stuff->flags,n);
- swaps(&stuff->totalSyms,n);
- swaps(&stuff->totalActs,n);
- swaps(&stuff->virtualMods,n);
+ swaps(&stuff->deviceSpec);
+ swaps(&stuff->present);
+ swaps(&stuff->flags);
+ swaps(&stuff->totalSyms);
+ swaps(&stuff->totalActs);
+ swaps(&stuff->virtualMods);
return ProcXkbSetMap(client);
}
@@ -266,105 +248,91 @@ register int n;
static int
SProcXkbGetCompatMap(ClientPtr client)
{
-register int n;
-
REQUEST(xkbGetCompatMapReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetCompatMapReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->firstSI,n);
- swaps(&stuff->nSI,n);
+ swaps(&stuff->deviceSpec);
+ swaps(&stuff->firstSI);
+ swaps(&stuff->nSI);
return ProcXkbGetCompatMap(client);
}
static int
SProcXkbSetCompatMap(ClientPtr client)
{
-register int n;
-
REQUEST(xkbSetCompatMapReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbSetCompatMapReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->firstSI,n);
- swaps(&stuff->nSI,n);
+ swaps(&stuff->deviceSpec);
+ swaps(&stuff->firstSI);
+ swaps(&stuff->nSI);
return ProcXkbSetCompatMap(client);
}
static int
SProcXkbGetIndicatorState(ClientPtr client)
{
-register int n;
-
REQUEST(xkbGetIndicatorStateReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq);
- swaps(&stuff->deviceSpec,n);
+ swaps(&stuff->deviceSpec);
return ProcXkbGetIndicatorState(client);
}
static int
SProcXkbGetIndicatorMap(ClientPtr client)
{
-register int n;
-
REQUEST(xkbGetIndicatorMapReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetIndicatorMapReq);
- swaps(&stuff->deviceSpec,n);
- swapl(&stuff->which,n);
+ swaps(&stuff->deviceSpec);
+ swapl(&stuff->which);
return ProcXkbGetIndicatorMap(client);
}
static int
SProcXkbSetIndicatorMap(ClientPtr client)
{
-register int n;
-
REQUEST(xkbSetIndicatorMapReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbSetIndicatorMapReq);
- swaps(&stuff->deviceSpec,n);
- swapl(&stuff->which,n);
+ swaps(&stuff->deviceSpec);
+ swapl(&stuff->which);
return ProcXkbSetIndicatorMap(client);
}
static int
SProcXkbGetNamedIndicator(ClientPtr client)
{
-register int n;
-
REQUEST(xkbGetNamedIndicatorReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetNamedIndicatorReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->ledClass,n);
- swaps(&stuff->ledID,n);
- swapl(&stuff->indicator,n);
+ swaps(&stuff->deviceSpec);
+ swaps(&stuff->ledClass);
+ swaps(&stuff->ledID);
+ swapl(&stuff->indicator);
return ProcXkbGetNamedIndicator(client);
}
static int
SProcXkbSetNamedIndicator(ClientPtr client)
{
-register int n;
-
REQUEST(xkbSetNamedIndicatorReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbSetNamedIndicatorReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->ledClass,n);
- swaps(&stuff->ledID,n);
- swapl(&stuff->indicator,n);
- swaps(&stuff->virtualMods,n);
- swapl(&stuff->ctrls,n);
+ swaps(&stuff->deviceSpec);
+ swaps(&stuff->ledClass);
+ swaps(&stuff->ledID);
+ swapl(&stuff->indicator);
+ swaps(&stuff->virtualMods);
+ swapl(&stuff->ctrls);
return ProcXkbSetNamedIndicator(client);
}
@@ -372,160 +340,140 @@ register int n;
static int
SProcXkbGetNames(ClientPtr client)
{
-register int n;
-
REQUEST(xkbGetNamesReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetNamesReq);
- swaps(&stuff->deviceSpec,n);
- swapl(&stuff->which,n);
+ swaps(&stuff->deviceSpec);
+ swapl(&stuff->which);
return ProcXkbGetNames(client);
}
static int
SProcXkbSetNames(ClientPtr client)
{
-register int n;
-
REQUEST(xkbSetNamesReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbSetNamesReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->virtualMods,n);
- swapl(&stuff->which,n);
- swapl(&stuff->indicators,n);
- swaps(&stuff->totalKTLevelNames,n);
+ swaps(&stuff->deviceSpec);
+ swaps(&stuff->virtualMods);
+ swapl(&stuff->which);
+ swapl(&stuff->indicators);
+ swaps(&stuff->totalKTLevelNames);
return ProcXkbSetNames(client);
}
static int
SProcXkbGetGeometry(ClientPtr client)
{
-register int n;
-
REQUEST(xkbGetGeometryReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetGeometryReq);
- swaps(&stuff->deviceSpec,n);
- swapl(&stuff->name,n);
+ swaps(&stuff->deviceSpec);
+ swapl(&stuff->name);
return ProcXkbGetGeometry(client);
}
static int
SProcXkbSetGeometry(ClientPtr client)
{
-register int n;
-
REQUEST(xkbSetGeometryReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbSetGeometryReq);
- swaps(&stuff->deviceSpec,n);
- swapl(&stuff->name,n);
- swaps(&stuff->widthMM,n);
- swaps(&stuff->heightMM,n);
- swaps(&stuff->nProperties,n);
- swaps(&stuff->nColors,n);
- swaps(&stuff->nDoodads,n);
- swaps(&stuff->nKeyAliases,n);
+ swaps(&stuff->deviceSpec);
+ swapl(&stuff->name);
+ swaps(&stuff->widthMM);
+ swaps(&stuff->heightMM);
+ swaps(&stuff->nProperties);
+ swaps(&stuff->nColors);
+ swaps(&stuff->nDoodads);
+ swaps(&stuff->nKeyAliases);
return ProcXkbSetGeometry(client);
}
static int
SProcXkbPerClientFlags(ClientPtr client)
{
-register int n;
-
REQUEST(xkbPerClientFlagsReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbPerClientFlagsReq);
- swaps(&stuff->deviceSpec,n);
- swapl(&stuff->change,n);
- swapl(&stuff->value,n);
- swapl(&stuff->ctrlsToChange,n);
- swapl(&stuff->autoCtrls,n);
- swapl(&stuff->autoCtrlValues,n);
+ swaps(&stuff->deviceSpec);
+ swapl(&stuff->change);
+ swapl(&stuff->value);
+ swapl(&stuff->ctrlsToChange);
+ swapl(&stuff->autoCtrls);
+ swapl(&stuff->autoCtrlValues);
return ProcXkbPerClientFlags(client);
}
static int
SProcXkbListComponents(ClientPtr client)
{
-register int n;
-
REQUEST(xkbListComponentsReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbListComponentsReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->maxNames,n);
+ swaps(&stuff->deviceSpec);
+ swaps(&stuff->maxNames);
return ProcXkbListComponents(client);
}
static int
SProcXkbGetKbdByName(ClientPtr client)
{
-register int n;
-
REQUEST(xkbGetKbdByNameReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->want,n);
- swaps(&stuff->need,n);
+ swaps(&stuff->deviceSpec);
+ swaps(&stuff->want);
+ swaps(&stuff->need);
return ProcXkbGetKbdByName(client);
}
static int
SProcXkbGetDeviceInfo(ClientPtr client)
{
-register int n;
-
REQUEST(xkbGetDeviceInfoReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_SIZE_MATCH(xkbGetDeviceInfoReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->wanted,n);
- swaps(&stuff->ledClass,n);
- swaps(&stuff->ledID,n);
+ swaps(&stuff->deviceSpec);
+ swaps(&stuff->wanted);
+ swaps(&stuff->ledClass);
+ swaps(&stuff->ledID);
return ProcXkbGetDeviceInfo(client);
}
static int
SProcXkbSetDeviceInfo(ClientPtr client)
{
-register int n;
-
REQUEST(xkbSetDeviceInfoReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbSetDeviceInfoReq);
- swaps(&stuff->deviceSpec,n);
- swaps(&stuff->change,n);
- swaps(&stuff->nDeviceLedFBs,n);
+ swaps(&stuff->deviceSpec);
+ swaps(&stuff->change);
+ swaps(&stuff->nDeviceLedFBs);
return ProcXkbSetDeviceInfo(client);
}
static int
SProcXkbSetDebuggingFlags(ClientPtr client)
{
-register int n;
-
REQUEST(xkbSetDebuggingFlagsReq);
- swaps(&stuff->length,n);
+ swaps(&stuff->length);
REQUEST_AT_LEAST_SIZE(xkbSetDebuggingFlagsReq);
- swapl(&stuff->affectFlags,n);
- swapl(&stuff->flags,n);
- swapl(&stuff->affectCtrls,n);
- swapl(&stuff->ctrls,n);
- swaps(&stuff->msgLength,n);
+ swapl(&stuff->affectFlags);
+ swapl(&stuff->flags);
+ swapl(&stuff->affectCtrls);
+ swapl(&stuff->ctrls);
+ swaps(&stuff->msgLength);
return ProcXkbSetDebuggingFlags(client);
}