From 8a191c08ddda2e66fa26f148d6c21959bb08f923 Mon Sep 17 00:00:00 2001 From: marha Date: Sun, 20 Feb 2011 12:29:25 +0000 Subject: xserver xkeyboard-config libX11 pixman mesa git update 2011 --- libX11/modules/im/ximcp/imLcPrs.c | 5 +- libX11/src/Region.c | 3199 ++--- mesalib/SConstruct | 6 +- mesalib/common.py | 1 + mesalib/docs/envvars.html | 233 +- mesalib/docs/shading.html | 536 +- mesalib/docs/sourcetree.html | 331 +- mesalib/scons/gallium.py | 3 +- mesalib/src/glsl/Makefile | 2 +- mesalib/src/mesa/main/debug.c | 1222 +- mesalib/src/mesa/main/debug.h | 3 + mesalib/src/mesa/main/drawpix.c | 23 + mesalib/src/mesa/main/enable.c | 3005 +++-- mesalib/src/mesa/main/fbobject.c | 4981 +++---- mesalib/src/mesa/main/formats.c | 6 +- mesalib/src/mesa/main/formats.h | 3 + mesalib/src/mesa/main/image.c | 7 +- mesalib/src/mesa/main/imports.c | 2 +- mesalib/src/mesa/main/mipmap.c | 52 +- mesalib/src/mesa/main/mtypes.h | 6737 +++++---- mesalib/src/mesa/main/readpix.c | 8 + mesalib/src/mesa/main/texgetimage.c | 4 +- mesalib/src/mesa/program/ir_to_mesa.cpp | 30 +- mesalib/src/mesa/state_tracker/st_cb_drawpixels.c | 2858 ++-- mesalib/src/mesa/state_tracker/st_cb_fbo.c | 2 + mesalib/src/mesa/state_tracker/st_cb_texture.c | 155 - mesalib/src/mesa/state_tracker/st_draw.c | 1500 +-- mesalib/src/mesa/state_tracker/st_extensions.c | 967 +- mesalib/src/mesa/vbo/vbo_exec_array.c | 2589 ++-- pixman/demos/Makefile.am | 70 +- pixman/demos/tri-test.c | 48 + pixman/pixman/pixman-image.c | 20 +- pixman/pixman/pixman-trap.c | 271 + pixman/pixman/pixman.h | 30 + pixman/test/Makefile.am | 90 +- pixman/test/composite-traps-test.c | 253 + xorg-server/Xi/xiproperty.c | 2 +- xorg-server/Xi/xiquerypointer.c | 2 +- xorg-server/configure.ac | 4556 +++---- xorg-server/fb/Makefile.am | 4 - xorg-server/glx/glxcmds.c | 4743 +++---- xorg-server/glx/glxcmdsswap.c | 1836 +-- xorg-server/hw/xfree86/common/xf86Init.c | 2994 ++-- xorg-server/hw/xfree86/common/xf86VidMode.c | 2 +- xorg-server/hw/xfree86/common/xf86xv.c | 210 +- xorg-server/hw/xfree86/common/xf86xv.h | 3 + xorg-server/hw/xfree86/common/xf86xvpriv.h | 6 +- xorg-server/hw/xfree86/dri2/dri2.c | 2 +- xorg-server/hw/xfree86/fbdevhw/fbdevhw.c | 56 +- xorg-server/hw/xfree86/int10/helper_exec.c | 1466 +- xorg-server/hw/xfree86/modes/xf86Crtc.c | 6563 +++++---- xorg-server/hw/xwin/winclipboardxevents.c | 3 + xorg-server/hw/xwin/winconfig.c | 77 +- xorg-server/hw/xwin/winkeybd.c | 8 +- xorg-server/hw/xwin/winkeybd.h | 16 +- xorg-server/hw/xwin/winkeyhook.c | 4 +- xorg-server/hw/xwin/winkeynames.h | 13 +- xorg-server/hw/xwin/winlayouts.h | 8 +- xorg-server/include/exevents.h | 2 +- xorg-server/miext/damage/Makefile.am | 28 +- xorg-server/miext/rootless/Makefile.am | 33 +- xorg-server/miext/shadow/Makefile.am | 66 +- xorg-server/randr/rrdispatch.c | 2 +- xorg-server/randr/rrmode.c | 2 +- xorg-server/xfixes/cursor.c | 2 +- xorg-server/xkb/ddxLoad.c | 962 +- xorg-server/xkb/xkb.c | 13480 +++++++++---------- xorg-server/xkeyboard-config/compat/accessx | 106 +- xorg-server/xkeyboard-config/compat/basic | 100 +- xorg-server/xkeyboard-config/compat/complete | 23 +- xorg-server/xkeyboard-config/compat/default | 26 +- xorg-server/xkeyboard-config/compat/iso9995 | 164 +- xorg-server/xkeyboard-config/compat/japan | 93 +- xorg-server/xkeyboard-config/compat/keypad | 118 +- xorg-server/xkeyboard-config/compat/level5 | 107 +- xorg-server/xkeyboard-config/compat/misc | 251 +- xorg-server/xkeyboard-config/compat/mousekeys | 407 +- xorg-server/xkeyboard-config/compat/norepeat | 20 +- xorg-server/xkeyboard-config/compat/olpc | 103 +- xorg-server/xkeyboard-config/compat/pc | 35 +- xorg-server/xkeyboard-config/compat/pc98 | 117 +- xorg-server/xkeyboard-config/compat/xfree86 | 113 +- xorg-server/xkeyboard-config/compat/xtest | 115 +- xorg-server/xkeyboard-config/docs/README.enhancing | 1045 +- xorg-server/xkeyboard-config/geometry/amiga | 534 +- xorg-server/xkeyboard-config/geometry/ataritt | 508 +- xorg-server/xkeyboard-config/geometry/chicony | 379 +- xorg-server/xkeyboard-config/geometry/dell | 1289 +- .../xkeyboard-config/geometry/digital_vndr/lk | 1458 +- .../xkeyboard-config/geometry/digital_vndr/pc | 699 +- .../xkeyboard-config/geometry/digital_vndr/unix | 457 +- xorg-server/xkeyboard-config/geometry/everex | 342 +- xorg-server/xkeyboard-config/geometry/fujitsu | 629 +- xorg-server/xkeyboard-config/geometry/hhk | 534 +- xorg-server/xkeyboard-config/geometry/hp | 1399 +- xorg-server/xkeyboard-config/geometry/keytronic | 505 +- xorg-server/xkeyboard-config/geometry/kinesis | 380 +- xorg-server/xkeyboard-config/geometry/macintosh | 1 - xorg-server/xkeyboard-config/geometry/microsoft | 1067 +- xorg-server/xkeyboard-config/geometry/nec | 316 +- xorg-server/xkeyboard-config/geometry/northgate | 338 +- xorg-server/xkeyboard-config/geometry/pc | 2 - xorg-server/xkeyboard-config/geometry/sanwa | 1 - xorg-server/xkeyboard-config/geometry/sgi_vndr/O2 | 1230 +- .../xkeyboard-config/geometry/sgi_vndr/indigo | 821 +- .../xkeyboard-config/geometry/sgi_vndr/indy | 1197 +- xorg-server/xkeyboard-config/geometry/sony | 359 +- xorg-server/xkeyboard-config/geometry/sun | 6096 +++++---- xorg-server/xkeyboard-config/geometry/thinkpad | 941 +- xorg-server/xkeyboard-config/geometry/winbook | 287 +- xorg-server/xkeyboard-config/keycodes/amiga | 456 +- xorg-server/xkeyboard-config/keycodes/ataritt | 240 +- .../xkeyboard-config/keycodes/digital_vndr/lk | 541 +- .../xkeyboard-config/keycodes/digital_vndr/pc | 557 +- xorg-server/xkeyboard-config/keycodes/evdev | 627 +- xorg-server/xkeyboard-config/keycodes/fujitsu | 373 +- xorg-server/xkeyboard-config/keycodes/hp | 541 +- xorg-server/xkeyboard-config/keycodes/ibm | 301 +- xorg-server/xkeyboard-config/keycodes/macintosh | 3 - .../xkeyboard-config/keycodes/sgi_vndr/indigo | 279 +- .../xkeyboard-config/keycodes/sgi_vndr/indy | 405 +- .../xkeyboard-config/keycodes/sgi_vndr/iris | 21 +- xorg-server/xkeyboard-config/keycodes/sony | 283 +- xorg-server/xkeyboard-config/keycodes/sun | 1904 ++- xorg-server/xkeyboard-config/keycodes/xfree86 | 822 +- xorg-server/xkeyboard-config/keycodes/xfree98 | 307 +- xorg-server/xkeyboard-config/keymap/amiga | 37 +- xorg-server/xkeyboard-config/keymap/ataritt | 35 +- .../xkeyboard-config/keymap/digital_vndr/us | 375 +- xorg-server/xkeyboard-config/keymap/macintosh | 32 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/be | 66 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/bg | 37 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/ca | 65 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/ch | 132 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/cz | 62 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/de | 66 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/dk | 66 +- .../xkeyboard-config/keymap/sgi_vndr/dvorak | 29 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/en_US | 2 - xorg-server/xkeyboard-config/keymap/sgi_vndr/es | 66 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/fi | 66 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/fr | 66 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/gb | 66 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/hu | 209 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/it | 66 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/jp | 15 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/no | 66 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/pl | 57 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/pt | 66 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/ru | 209 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/se | 66 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/sk | 62 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/th | 33 +- xorg-server/xkeyboard-config/keymap/sgi_vndr/us | 85 +- xorg-server/xkeyboard-config/keymap/sony | 65 +- xorg-server/xkeyboard-config/keymap/sun_vndr/all | 2183 ++- xorg-server/xkeyboard-config/keymap/sun_vndr/de | 155 +- xorg-server/xkeyboard-config/keymap/sun_vndr/es | 121 +- xorg-server/xkeyboard-config/keymap/sun_vndr/fi | 121 +- xorg-server/xkeyboard-config/keymap/sun_vndr/fr | 121 +- xorg-server/xkeyboard-config/keymap/sun_vndr/no | 121 +- xorg-server/xkeyboard-config/keymap/sun_vndr/pl | 121 +- xorg-server/xkeyboard-config/keymap/sun_vndr/ru | 121 +- xorg-server/xkeyboard-config/keymap/sun_vndr/se | 110 +- xorg-server/xkeyboard-config/keymap/sun_vndr/uk | 121 +- xorg-server/xkeyboard-config/keymap/sun_vndr/us | 135 +- xorg-server/xkeyboard-config/keymap/xfree86 | 751 +- xorg-server/xkeyboard-config/keymap/xfree98 | 68 +- xorg-server/xkeyboard-config/rules/base.hdr.part | 15 +- xorg-server/xkeyboard-config/rules/base.xml.in | 19 +- xorg-server/xkeyboard-config/rules/xfree98 | 2 - xorg-server/xkeyboard-config/semantics/basic | 13 +- xorg-server/xkeyboard-config/semantics/complete | 13 +- xorg-server/xkeyboard-config/semantics/default | 13 +- xorg-server/xkeyboard-config/semantics/xtest | 13 +- xorg-server/xkeyboard-config/symbols/ad | 65 +- xorg-server/xkeyboard-config/symbols/af | 1 - xorg-server/xkeyboard-config/symbols/al | 85 +- xorg-server/xkeyboard-config/symbols/altwin | 162 +- xorg-server/xkeyboard-config/symbols/am | 484 +- xorg-server/xkeyboard-config/symbols/ara | 554 +- xorg-server/xkeyboard-config/symbols/at | 4 - xorg-server/xkeyboard-config/symbols/az | 186 +- xorg-server/xkeyboard-config/symbols/ba | 83 +- xorg-server/xkeyboard-config/symbols/bd | 195 +- xorg-server/xkeyboard-config/symbols/be | 4 - xorg-server/xkeyboard-config/symbols/bg | 723 +- xorg-server/xkeyboard-config/symbols/br | 3 - xorg-server/xkeyboard-config/symbols/brai | 121 +- xorg-server/xkeyboard-config/symbols/bt | 175 +- xorg-server/xkeyboard-config/symbols/bw | 37 +- xorg-server/xkeyboard-config/symbols/by | 107 +- xorg-server/xkeyboard-config/symbols/ca | 1057 +- xorg-server/xkeyboard-config/symbols/capslock | 127 +- xorg-server/xkeyboard-config/symbols/cd | 140 +- xorg-server/xkeyboard-config/symbols/ch | 5 - xorg-server/xkeyboard-config/symbols/cn | 4 - xorg-server/xkeyboard-config/symbols/compose | 113 +- xorg-server/xkeyboard-config/symbols/ctrl | 4 - xorg-server/xkeyboard-config/symbols/cz | 344 +- xorg-server/xkeyboard-config/symbols/de | 1196 +- .../xkeyboard-config/symbols/digital_vndr/lk | 261 +- .../xkeyboard-config/symbols/digital_vndr/pc | 351 +- .../xkeyboard-config/symbols/digital_vndr/us | 423 +- .../xkeyboard-config/symbols/digital_vndr/vt | 317 +- xorg-server/xkeyboard-config/symbols/dk | 149 +- xorg-server/xkeyboard-config/symbols/ee | 203 +- xorg-server/xkeyboard-config/symbols/empty | 10 +- xorg-server/xkeyboard-config/symbols/epo | 280 +- xorg-server/xkeyboard-config/symbols/es | 3 - xorg-server/xkeyboard-config/symbols/et | 148 +- xorg-server/xkeyboard-config/symbols/eurosign | 3 - xorg-server/xkeyboard-config/symbols/extras/apl | 590 +- xorg-server/xkeyboard-config/symbols/extras/ru | 1 - xorg-server/xkeyboard-config/symbols/extras/us | 293 +- xorg-server/xkeyboard-config/symbols/fi | 414 +- xorg-server/xkeyboard-config/symbols/fo | 98 +- xorg-server/xkeyboard-config/symbols/fr | 7 - .../xkeyboard-config/symbols/fujitsu_vndr/jp | 175 +- .../xkeyboard-config/symbols/fujitsu_vndr/us | 288 +- xorg-server/xkeyboard-config/symbols/gb | 5 - xorg-server/xkeyboard-config/symbols/ge | 547 +- xorg-server/xkeyboard-config/symbols/gh | 304 +- xorg-server/xkeyboard-config/symbols/gn | 124 +- xorg-server/xkeyboard-config/symbols/gr | 2 - xorg-server/xkeyboard-config/symbols/group | 3 - xorg-server/xkeyboard-config/symbols/hp_vndr/us | 210 +- xorg-server/xkeyboard-config/symbols/hr | 149 +- xorg-server/xkeyboard-config/symbols/hu | 1 - xorg-server/xkeyboard-config/symbols/ie | 818 +- xorg-server/xkeyboard-config/symbols/il | 506 +- xorg-server/xkeyboard-config/symbols/in | 8 - xorg-server/xkeyboard-config/symbols/inet | 6 +- xorg-server/xkeyboard-config/symbols/iq | 67 +- xorg-server/xkeyboard-config/symbols/ir | 3 - xorg-server/xkeyboard-config/symbols/is | 3 - xorg-server/xkeyboard-config/symbols/it | 5 - xorg-server/xkeyboard-config/symbols/jp | 2 - xorg-server/xkeyboard-config/symbols/ke | 86 +- xorg-server/xkeyboard-config/symbols/keypad | 3 - xorg-server/xkeyboard-config/symbols/kg | 268 +- xorg-server/xkeyboard-config/symbols/kh | 227 +- xorg-server/xkeyboard-config/symbols/kpdl | 207 +- xorg-server/xkeyboard-config/symbols/kr | 56 +- xorg-server/xkeyboard-config/symbols/kz | 433 +- xorg-server/xkeyboard-config/symbols/la | 227 +- xorg-server/xkeyboard-config/symbols/latam | 4 - xorg-server/xkeyboard-config/symbols/latin | 5 - xorg-server/xkeyboard-config/symbols/level3 | 396 +- xorg-server/xkeyboard-config/symbols/level5 | 4 - xorg-server/xkeyboard-config/symbols/lk | 3 - xorg-server/xkeyboard-config/symbols/lt | 5 - xorg-server/xkeyboard-config/symbols/lv | 256 +- xorg-server/xkeyboard-config/symbols/ma | 1 - .../xkeyboard-config/symbols/macintosh_vndr/apple | 1 - .../xkeyboard-config/symbols/macintosh_vndr/ch | 203 +- .../xkeyboard-config/symbols/macintosh_vndr/de | 191 +- .../xkeyboard-config/symbols/macintosh_vndr/dk | 155 +- .../xkeyboard-config/symbols/macintosh_vndr/fi | 35 +- .../xkeyboard-config/symbols/macintosh_vndr/gb | 38 +- .../xkeyboard-config/symbols/macintosh_vndr/is | 255 +- .../xkeyboard-config/symbols/macintosh_vndr/it | 126 +- .../xkeyboard-config/symbols/macintosh_vndr/latam | 75 +- .../xkeyboard-config/symbols/macintosh_vndr/nl | 32 +- .../xkeyboard-config/symbols/macintosh_vndr/no | 102 +- .../xkeyboard-config/symbols/macintosh_vndr/pt | 124 +- .../xkeyboard-config/symbols/macintosh_vndr/se | 90 +- .../xkeyboard-config/symbols/macintosh_vndr/us | 299 +- xorg-server/xkeyboard-config/symbols/mao | 44 +- xorg-server/xkeyboard-config/symbols/me | 105 +- xorg-server/xkeyboard-config/symbols/mk | 132 +- xorg-server/xkeyboard-config/symbols/ml | 2 - xorg-server/xkeyboard-config/symbols/mm | 128 +- xorg-server/xkeyboard-config/symbols/mn | 163 +- xorg-server/xkeyboard-config/symbols/mt | 156 +- xorg-server/xkeyboard-config/symbols/mv | 163 +- xorg-server/xkeyboard-config/symbols/nbsp | 3 - xorg-server/xkeyboard-config/symbols/nec_vndr/jp | 330 +- xorg-server/xkeyboard-config/symbols/ng | 231 +- xorg-server/xkeyboard-config/symbols/nl | 305 +- xorg-server/xkeyboard-config/symbols/no | 455 +- xorg-server/xkeyboard-config/symbols/np | 244 +- xorg-server/xkeyboard-config/symbols/olpc | 43 +- xorg-server/xkeyboard-config/symbols/pc | 6 - xorg-server/xkeyboard-config/symbols/ph | 3 - xorg-server/xkeyboard-config/symbols/pk | 3 - xorg-server/xkeyboard-config/symbols/pl | 704 +- xorg-server/xkeyboard-config/symbols/pt | 6 +- xorg-server/xkeyboard-config/symbols/ro | 468 +- xorg-server/xkeyboard-config/symbols/rs | 655 +- xorg-server/xkeyboard-config/symbols/ru | 1058 +- xorg-server/xkeyboard-config/symbols/rupeesign | 2 - xorg-server/xkeyboard-config/symbols/se | 510 +- xorg-server/xkeyboard-config/symbols/sgi_vndr/jp | 90 +- xorg-server/xkeyboard-config/symbols/shift | 170 +- xorg-server/xkeyboard-config/symbols/si | 63 +- xorg-server/xkeyboard-config/symbols/sk | 211 +- xorg-server/xkeyboard-config/symbols/sony_vndr/us | 184 +- xorg-server/xkeyboard-config/symbols/srvr_ctrl | 255 +- xorg-server/xkeyboard-config/symbols/sun_vndr/ara | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/be | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/br | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/ca | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/ch | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/cz | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/de | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/dk | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/ee | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/es | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/fi | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/fr | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/gb | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/gr | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/it | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/jp | 3 - xorg-server/xkeyboard-config/symbols/sun_vndr/kr | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/lt | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/lv | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/nl | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/no | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/pl | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/pt | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/ro | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/ru | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/se | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/sk | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/tr | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/tuv | 3 - xorg-server/xkeyboard-config/symbols/sun_vndr/tw | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/ua | 1 - xorg-server/xkeyboard-config/symbols/sun_vndr/us | 1 - xorg-server/xkeyboard-config/symbols/sy | 10 - xorg-server/xkeyboard-config/symbols/terminate | 15 +- xorg-server/xkeyboard-config/symbols/th | 494 +- xorg-server/xkeyboard-config/symbols/tj | 275 +- xorg-server/xkeyboard-config/symbols/tm | 94 +- xorg-server/xkeyboard-config/symbols/tr | 708 +- xorg-server/xkeyboard-config/symbols/typo | 104 +- xorg-server/xkeyboard-config/symbols/tz | 122 +- xorg-server/xkeyboard-config/symbols/ua | 664 +- xorg-server/xkeyboard-config/symbols/us | 2384 ++-- xorg-server/xkeyboard-config/symbols/uz | 242 +- xorg-server/xkeyboard-config/symbols/vn | 80 +- .../xkeyboard-config/symbols/xfree68_vndr/amiga | 258 +- .../xkeyboard-config/symbols/xfree68_vndr/ataritt | 316 +- xorg-server/xkeyboard-config/symbols/za | 86 +- xorg-server/xkeyboard-config/types/basic | 60 +- xorg-server/xkeyboard-config/types/cancel | 23 +- xorg-server/xkeyboard-config/types/caps | 338 +- xorg-server/xkeyboard-config/types/complete | 26 +- xorg-server/xkeyboard-config/types/default | 21 +- xorg-server/xkeyboard-config/types/extra | 368 +- xorg-server/xkeyboard-config/types/iso9995 | 38 +- xorg-server/xkeyboard-config/types/level5 | 430 +- xorg-server/xkeyboard-config/types/mousekeys | 23 +- xorg-server/xkeyboard-config/types/numpad | 143 +- xorg-server/xkeyboard-config/types/pc | 219 +- 357 files changed, 68387 insertions(+), 68124 deletions(-) create mode 100644 pixman/demos/tri-test.c create mode 100644 pixman/test/composite-traps-test.c diff --git a/libX11/modules/im/ximcp/imLcPrs.c b/libX11/modules/im/ximcp/imLcPrs.c index f6c42daa8..f5d6f8cd1 100644 --- a/libX11/modules/im/ximcp/imLcPrs.c +++ b/libX11/modules/im/ximcp/imLcPrs.c @@ -321,7 +321,8 @@ TransFileName(Xim im, char *name) l += strlen(home); break; case 'L': - lcCompose = _XlcFileName(im->core.lcd, COMPOSE_FILE); + if (lcCompose == NULL) + lcCompose = _XlcFileName(im->core.lcd, COMPOSE_FILE); if (lcCompose) l += strlen(lcCompose); break; @@ -357,7 +358,6 @@ TransFileName(Xim im, char *name) if (lcCompose) { strcpy(j, lcCompose); j += strlen(lcCompose); - Xfree(lcCompose); } break; case 'S': @@ -371,6 +371,7 @@ TransFileName(Xim im, char *name) } } *j = '\0'; + Xfree(lcCompose); return ret; } diff --git a/libX11/src/Region.c b/libX11/src/Region.c index 45a0bdac3..3003ac52a 100644 --- a/libX11/src/Region.c +++ b/libX11/src/Region.c @@ -1,1595 +1,1604 @@ -/************************************************************************ - -Copyright 1987, 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. - - -Copyright 1987, 1988 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. - -************************************************************************/ -/* - * The functions in this file implement the Region abstraction, similar to one - * used in the X11 sample server. A Region is simply an area, as the name - * implies, and is implemented as a "y-x-banded" array of rectangles. To - * explain: Each Region is made up of a certain number of rectangles sorted - * by y coordinate first, and then by x coordinate. - * - * Furthermore, the rectangles are banded such that every rectangle with a - * given upper-left y coordinate (y1) will have the same lower-right y - * coordinate (y2) and vice versa. If a rectangle has scanlines in a band, it - * will span the entire vertical distance of the band. This means that some - * areas that could be merged into a taller rectangle will be represented as - * several shorter rectangles to account for shorter rectangles to its left - * or right but within its "vertical scope". - * - * An added constraint on the rectangles is that they must cover as much - * horizontal area as possible. E.g. no two rectangles in a band are allowed - * to touch. - * - * Whenever possible, bands will be merged together to cover a greater vertical - * distance (and thus reduce the number of rectangles). Two bands can be merged - * only if the bottom of one touches the top of the other and they have - * rectangles in the same places (of the same width, of course). This maintains - * the y-x-banding that's so nice to have... - */ - -#ifdef HAVE_CONFIG_H -#include -#endif -#include "Xlibint.h" -#include "Xutil.h" -#include -#include "poly.h" - -#ifdef DEBUG -#include -#define assert(expr) {if (!(expr)) fprintf(stderr,\ -"Assertion failed file %s, line %d: expr\n", __FILE__, __LINE__); } -#else -#define assert(expr) -#endif - -typedef int (*overlapProcp)( - register Region pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - short y1, - short y2); - -typedef int (*nonOverlapProcp)( - register Region pReg, - register BoxPtr r, - BoxPtr rEnd, - register short y1, - register short y2); - -static void miRegionOp( - register Region newReg, /* Place to store result */ - Region reg1, /* First region in operation */ - Region reg2, /* 2d region in operation */ - int (*overlapFunc)( - register Region pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - short y1, - short y2), /* Function to call for over- - * lapping bands */ - int (*nonOverlap1Func)( - register Region pReg, - register BoxPtr r, - BoxPtr rEnd, - register short y1, - register short y2), /* Function to call for non- - * overlapping bands in region - * 1 */ - int (*nonOverlap2Func)( - register Region pReg, - register BoxPtr r, - BoxPtr rEnd, - register short y1, - register short y2)); /* Function to call for non- - * overlapping bands in region - * 2 */ - - -/* Create a new empty region */ -Region -XCreateRegion(void) -{ - Region temp; - - if (! (temp = ( Region )Xmalloc( (unsigned) sizeof( REGION )))) - return (Region) NULL; - if (! (temp->rects = ( BOX * )Xmalloc( (unsigned) sizeof( BOX )))) { - Xfree((char *) temp); - return (Region) NULL; - } - temp->numRects = 0; - temp->extents.x1 = 0; - temp->extents.y1 = 0; - temp->extents.x2 = 0; - temp->extents.y2 = 0; - temp->size = 1; - return( temp ); -} - -int -XClipBox( - Region r, - XRectangle *rect) -{ - rect->x = r->extents.x1; - rect->y = r->extents.y1; - rect->width = r->extents.x2 - r->extents.x1; - rect->height = r->extents.y2 - r->extents.y1; - return 1; -} - -int -XUnionRectWithRegion( - register XRectangle *rect, - Region source, Region dest) -{ - REGION region; - - if (!rect->width || !rect->height) - return 0; - region.rects = ®ion.extents; - region.numRects = 1; - region.extents.x1 = rect->x; - region.extents.y1 = rect->y; - region.extents.x2 = rect->x + rect->width; - region.extents.y2 = rect->y + rect->height; - region.size = 1; - - return XUnionRegion(®ion, source, dest); -} - -/*- - *----------------------------------------------------------------------- - * miSetExtents -- - * Reset the extents of a region to what they should be. Called by - * miSubtract and miIntersect b/c they can't figure it out along the - * way or do so easily, as miUnion can. - * - * Results: - * None. - * - * Side Effects: - * The region's 'extents' structure is overwritten. - * - *----------------------------------------------------------------------- - */ -static void -miSetExtents ( - Region pReg) -{ - register BoxPtr pBox, - pBoxEnd, - pExtents; - - if (pReg->numRects == 0) - { - pReg->extents.x1 = 0; - pReg->extents.y1 = 0; - pReg->extents.x2 = 0; - pReg->extents.y2 = 0; - return; - } - - pExtents = &pReg->extents; - pBox = pReg->rects; - pBoxEnd = &pBox[pReg->numRects - 1]; - - /* - * Since pBox is the first rectangle in the region, it must have the - * smallest y1 and since pBoxEnd is the last rectangle in the region, - * it must have the largest y2, because of banding. Initialize x1 and - * x2 from pBox and pBoxEnd, resp., as good things to initialize them - * to... - */ - pExtents->x1 = pBox->x1; - pExtents->y1 = pBox->y1; - pExtents->x2 = pBoxEnd->x2; - pExtents->y2 = pBoxEnd->y2; - - assert(pExtents->y1 < pExtents->y2); - while (pBox <= pBoxEnd) - { - if (pBox->x1 < pExtents->x1) - { - pExtents->x1 = pBox->x1; - } - if (pBox->x2 > pExtents->x2) - { - pExtents->x2 = pBox->x2; - } - pBox++; - } - assert(pExtents->x1 < pExtents->x2); -} - -int -XSetRegion( - Display *dpy, - GC gc, - register Region r) -{ - register int i; - register XRectangle *xr, *pr; - register BOX *pb; - unsigned long total; - - LockDisplay (dpy); - total = r->numRects * sizeof (XRectangle); - if ((xr = (XRectangle *) _XAllocTemp(dpy, total))) { - for (pr = xr, pb = r->rects, i = r->numRects; --i >= 0; pr++, pb++) { - pr->x = pb->x1; - pr->y = pb->y1; - pr->width = pb->x2 - pb->x1; - pr->height = pb->y2 - pb->y1; - } - } - if (xr || !r->numRects) - _XSetClipRectangles(dpy, gc, 0, 0, xr, r->numRects, YXBanded); - if (xr) - _XFreeTemp(dpy, (char *)xr, total); - UnlockDisplay(dpy); - SyncHandle(); - return 1; -} - -int -XDestroyRegion( - Region r) -{ - Xfree( (char *) r->rects ); - Xfree( (char *) r ); - return 1; -} - - -/* TranslateRegion(pRegion, x, y) - translates in place - added by raymond -*/ - -int -XOffsetRegion( - register Region pRegion, - register int x, - register int y) -{ - register int nbox; - register BOX *pbox; - - pbox = pRegion->rects; - nbox = pRegion->numRects; - - while(nbox--) - { - pbox->x1 += x; - pbox->x2 += x; - pbox->y1 += y; - pbox->y2 += y; - pbox++; - } - pRegion->extents.x1 += x; - pRegion->extents.x2 += x; - pRegion->extents.y1 += y; - pRegion->extents.y2 += y; - return 1; -} - -/* - Utility procedure Compress: - Replace r by the region r', where - p in r' iff (Quantifer m <= dx) (p + m in r), and - Quantifier is Exists if grow is TRUE, For all if grow is FALSE, and - (x,y) + m = (x+m,y) if xdir is TRUE; (x,y+m) if xdir is FALSE. - - Thus, if xdir is TRUE and grow is FALSE, r is replaced by the region - of all points p such that p and the next dx points on the same - horizontal scan line are all in r. We do this using by noting - that p is the head of a run of length 2^i + k iff p is the head - of a run of length 2^i and p+2^i is the head of a run of length - k. Thus, the loop invariant: s contains the region corresponding - to the runs of length shift. r contains the region corresponding - to the runs of length 1 + dxo & (shift-1), where dxo is the original - value of dx. dx = dxo & ~(shift-1). As parameters, s and t are - scratch regions, so that we don't have to allocate them on every - call. -*/ - -#define ZOpRegion(a,b,c) if (grow) XUnionRegion(a,b,c); \ - else XIntersectRegion(a,b,c) -#define ZShiftRegion(a,b) if (xdir) XOffsetRegion(a,b,0); \ - else XOffsetRegion(a,0,b) -#define ZCopyRegion(a,b) XUnionRegion(a,a,b) - -static void -Compress( - Region r, Region s, Region t, - register unsigned dx, - register int xdir, register int grow) -{ - register unsigned shift = 1; - - ZCopyRegion(r, s); - while (dx) { - if (dx & shift) { - ZShiftRegion(r, -(int)shift); - ZOpRegion(r, s, r); - dx -= shift; - if (!dx) break; - } - ZCopyRegion(s, t); - ZShiftRegion(s, -(int)shift); - ZOpRegion(s, t, s); - shift <<= 1; - } -} - -#undef ZOpRegion -#undef ZShiftRegion -#undef ZCopyRegion - -int -XShrinkRegion( - Region r, - int dx, int dy) -{ - Region s, t; - int grow; - - if (!dx && !dy) return 0; - if ((! (s = XCreateRegion())) || (! (t = XCreateRegion()))) return 0; - if ((grow = (dx < 0))) dx = -dx; - if (dx) Compress(r, s, t, (unsigned) 2*dx, TRUE, grow); - if ((grow = (dy < 0))) dy = -dy; - if (dy) Compress(r, s, t, (unsigned) 2*dy, FALSE, grow); - XOffsetRegion(r, dx, dy); - XDestroyRegion(s); - XDestroyRegion(t); - return 0; -} - - -/*====================================================================== - * Region Intersection - *====================================================================*/ -/*- - *----------------------------------------------------------------------- - * miIntersectO -- - * Handle an overlapping band for miIntersect. - * - * Results: - * None. - * - * Side Effects: - * Rectangles may be added to the region. - * - *----------------------------------------------------------------------- - */ -/* static void*/ -static int -miIntersectO ( - register Region pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - short y1, - short y2) -{ - register short x1; - register short x2; - register BoxPtr pNextRect; - - pNextRect = &pReg->rects[pReg->numRects]; - - while ((r1 != r1End) && (r2 != r2End)) - { - x1 = max(r1->x1,r2->x1); - x2 = min(r1->x2,r2->x2); - - /* - * If there's any overlap between the two rectangles, add that - * overlap to the new region. - * There's no need to check for subsumption because the only way - * such a need could arise is if some region has two rectangles - * right next to each other. Since that should never happen... - */ - if (x1 < x2) - { - assert(y1rects); - pNextRect->x1 = x1; - pNextRect->y1 = y1; - pNextRect->x2 = x2; - pNextRect->y2 = y2; - pReg->numRects += 1; - pNextRect++; - assert(pReg->numRects <= pReg->size); - } - - /* - * Need to advance the pointers. Shift the one that extends - * to the right the least, since the other still has a chance to - * overlap with that region's next rectangle, if you see what I mean. - */ - if (r1->x2 < r2->x2) - { - r1++; - } - else if (r2->x2 < r1->x2) - { - r2++; - } - else - { - r1++; - r2++; - } - } - return 0; /* lint */ -} - -int -XIntersectRegion( - Region reg1, - Region reg2, /* source regions */ - register Region newReg) /* destination Region */ -{ - /* check for trivial reject */ - if ( (!(reg1->numRects)) || (!(reg2->numRects)) || - (!EXTENTCHECK(®1->extents, ®2->extents))) - newReg->numRects = 0; - else - miRegionOp (newReg, reg1, reg2, - miIntersectO, NULL, NULL); - - /* - * Can't alter newReg's extents before we call miRegionOp because - * it might be one of the source regions and miRegionOp depends - * on the extents of those regions being the same. Besides, this - * way there's no checking against rectangles that will be nuked - * due to coalescing, so we have to examine fewer rectangles. - */ - miSetExtents(newReg); - return 1; -} - -static void -miRegionCopy( - register Region dstrgn, - register Region rgn) - -{ - if (dstrgn != rgn) /* don't want to copy to itself */ - { - if (dstrgn->size < rgn->numRects) - { - if (dstrgn->rects) - { - BOX *prevRects = dstrgn->rects; - - if (! (dstrgn->rects = (BOX *) - Xrealloc((char *) dstrgn->rects, - (unsigned) rgn->numRects * (sizeof(BOX))))) { - Xfree(prevRects); - return; - } - } - dstrgn->size = rgn->numRects; - } - dstrgn->numRects = rgn->numRects; - dstrgn->extents.x1 = rgn->extents.x1; - dstrgn->extents.y1 = rgn->extents.y1; - dstrgn->extents.x2 = rgn->extents.x2; - dstrgn->extents.y2 = rgn->extents.y2; - - memcpy((char *) dstrgn->rects, (char *) rgn->rects, - (int) (rgn->numRects * sizeof(BOX))); - } -} - -/*====================================================================== - * Generic Region Operator - *====================================================================*/ - -/*- - *----------------------------------------------------------------------- - * miCoalesce -- - * Attempt to merge the boxes in the current band with those in the - * previous one. Used only by miRegionOp. - * - * Results: - * The new index for the previous band. - * - * Side Effects: - * If coalescing takes place: - * - rectangles in the previous band will have their y2 fields - * altered. - * - pReg->numRects will be decreased. - * - *----------------------------------------------------------------------- - */ -/* static int*/ -static int -miCoalesce( - register Region pReg, /* Region to coalesce */ - int prevStart, /* Index of start of previous band */ - int curStart) /* Index of start of current band */ -{ - register BoxPtr pPrevBox; /* Current box in previous band */ - register BoxPtr pCurBox; /* Current box in current band */ - register BoxPtr pRegEnd; /* End of region */ - int curNumRects; /* Number of rectangles in current - * band */ - int prevNumRects; /* Number of rectangles in previous - * band */ - int bandY1; /* Y1 coordinate for current band */ - - pRegEnd = &pReg->rects[pReg->numRects]; - - pPrevBox = &pReg->rects[prevStart]; - prevNumRects = curStart - prevStart; - - /* - * Figure out how many rectangles are in the current band. Have to do - * this because multiple bands could have been added in miRegionOp - * at the end when one region has been exhausted. - */ - pCurBox = &pReg->rects[curStart]; - bandY1 = pCurBox->y1; - for (curNumRects = 0; - (pCurBox != pRegEnd) && (pCurBox->y1 == bandY1); - curNumRects++) - { - pCurBox++; - } - - if (pCurBox != pRegEnd) - { - /* - * If more than one band was added, we have to find the start - * of the last band added so the next coalescing job can start - * at the right place... (given when multiple bands are added, - * this may be pointless -- see above). - */ - pRegEnd--; - while (pRegEnd[-1].y1 == pRegEnd->y1) - { - pRegEnd--; - } - curStart = pRegEnd - pReg->rects; - pRegEnd = pReg->rects + pReg->numRects; - } - - if ((curNumRects == prevNumRects) && (curNumRects != 0)) { - pCurBox -= curNumRects; - /* - * The bands may only be coalesced if the bottom of the previous - * matches the top scanline of the current. - */ - if (pPrevBox->y2 == pCurBox->y1) - { - /* - * Make sure the bands have boxes in the same places. This - * assumes that boxes have been added in such a way that they - * cover the most area possible. I.e. two boxes in a band must - * have some horizontal space between them. - */ - do - { - if ((pPrevBox->x1 != pCurBox->x1) || - (pPrevBox->x2 != pCurBox->x2)) - { - /* - * The bands don't line up so they can't be coalesced. - */ - return (curStart); - } - pPrevBox++; - pCurBox++; - prevNumRects -= 1; - } while (prevNumRects != 0); - - pReg->numRects -= curNumRects; - pCurBox -= curNumRects; - pPrevBox -= curNumRects; - - /* - * The bands may be merged, so set the bottom y of each box - * in the previous band to that of the corresponding box in - * the current band. - */ - do - { - pPrevBox->y2 = pCurBox->y2; - pPrevBox++; - pCurBox++; - curNumRects -= 1; - } while (curNumRects != 0); - - /* - * If only one band was added to the region, we have to backup - * curStart to the start of the previous band. - * - * If more than one band was added to the region, copy the - * other bands down. The assumption here is that the other bands - * came from the same region as the current one and no further - * coalescing can be done on them since it's all been done - * already... curStart is already in the right place. - */ - if (pCurBox == pRegEnd) - { - curStart = prevStart; - } - else - { - do - { - *pPrevBox++ = *pCurBox++; - } while (pCurBox != pRegEnd); - } - - } - } - return (curStart); -} - -/*- - *----------------------------------------------------------------------- - * miRegionOp -- - * Apply an operation to two regions. Called by miUnion, miInverse, - * miSubtract, miIntersect... - * - * Results: - * None. - * - * Side Effects: - * The new region is overwritten. - * - * Notes: - * The idea behind this function is to view the two regions as sets. - * Together they cover a rectangle of area that this function divides - * into horizontal bands where points are covered only by one region - * or by both. For the first case, the nonOverlapFunc is called with - * each the band and the band's upper and lower extents. For the - * second, the overlapFunc is called to process the entire band. It - * is responsible for clipping the rectangles in the band, though - * this function provides the boundaries. - * At the end of each band, the new region is coalesced, if possible, - * to reduce the number of rectangles in the region. - * - *----------------------------------------------------------------------- - */ -/* static void*/ -static void -miRegionOp( - register Region newReg, /* Place to store result */ - Region reg1, /* First region in operation */ - Region reg2, /* 2d region in operation */ - int (*overlapFunc)( - register Region pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - short y1, - short y2), /* Function to call for over- - * lapping bands */ - int (*nonOverlap1Func)( - register Region pReg, - register BoxPtr r, - BoxPtr rEnd, - register short y1, - register short y2), /* Function to call for non- - * overlapping bands in region - * 1 */ - int (*nonOverlap2Func)( - register Region pReg, - register BoxPtr r, - BoxPtr rEnd, - register short y1, - register short y2)) /* Function to call for non- - * overlapping bands in region - * 2 */ -{ - register BoxPtr r1; /* Pointer into first region */ - register BoxPtr r2; /* Pointer into 2d region */ - BoxPtr r1End; /* End of 1st region */ - BoxPtr r2End; /* End of 2d region */ - register short ybot; /* Bottom of intersection */ - register short ytop; /* Top of intersection */ - BoxPtr oldRects; /* Old rects for newReg */ - int prevBand; /* Index of start of - * previous band in newReg */ - int curBand; /* Index of start of current - * band in newReg */ - register BoxPtr r1BandEnd; /* End of current band in r1 */ - register BoxPtr r2BandEnd; /* End of current band in r2 */ - short top; /* Top of non-overlapping - * band */ - short bot; /* Bottom of non-overlapping - * band */ - - /* - * Initialization: - * set r1, r2, r1End and r2End appropriately, preserve the important - * parts of the destination region until the end in case it's one of - * the two source regions, then mark the "new" region empty, allocating - * another array of rectangles for it to use. - */ - r1 = reg1->rects; - r2 = reg2->rects; - r1End = r1 + reg1->numRects; - r2End = r2 + reg2->numRects; - - oldRects = newReg->rects; - - EMPTY_REGION(newReg); - - /* - * Allocate a reasonable number of rectangles for the new region. The idea - * is to allocate enough so the individual functions don't need to - * reallocate and copy the array, which is time consuming, yet we don't - * have to worry about using too much memory. I hope to be able to - * nuke the Xrealloc() at the end of this function eventually. - */ - newReg->size = max(reg1->numRects,reg2->numRects) * 2; - - if (! (newReg->rects = (BoxPtr) - Xmalloc ((unsigned) (sizeof(BoxRec) * newReg->size)))) { - newReg->size = 0; - return; - } - - /* - * Initialize ybot and ytop. - * In the upcoming loop, ybot and ytop serve different functions depending - * on whether the band being handled is an overlapping or non-overlapping - * band. - * In the case of a non-overlapping band (only one of the regions - * has points in the band), ybot is the bottom of the most recent - * intersection and thus clips the top of the rectangles in that band. - * ytop is the top of the next intersection between the two regions and - * serves to clip the bottom of the rectangles in the current band. - * For an overlapping band (where the two regions intersect), ytop clips - * the top of the rectangles of both regions and ybot clips the bottoms. - */ - if (reg1->extents.y1 < reg2->extents.y1) - ybot = reg1->extents.y1; - else - ybot = reg2->extents.y1; - - /* - * prevBand serves to mark the start of the previous band so rectangles - * can be coalesced into larger rectangles. qv. miCoalesce, above. - * In the beginning, there is no previous band, so prevBand == curBand - * (curBand is set later on, of course, but the first band will always - * start at index 0). prevBand and curBand must be indices because of - * the possible expansion, and resultant moving, of the new region's - * array of rectangles. - */ - prevBand = 0; - - do - { - curBand = newReg->numRects; - - /* - * This algorithm proceeds one source-band (as opposed to a - * destination band, which is determined by where the two regions - * intersect) at a time. r1BandEnd and r2BandEnd serve to mark the - * rectangle after the last one in the current band for their - * respective regions. - */ - r1BandEnd = r1; - while ((r1BandEnd != r1End) && (r1BandEnd->y1 == r1->y1)) - { - r1BandEnd++; - } - - r2BandEnd = r2; - while ((r2BandEnd != r2End) && (r2BandEnd->y1 == r2->y1)) - { - r2BandEnd++; - } - - /* - * First handle the band that doesn't intersect, if any. - * - * Note that attention is restricted to one band in the - * non-intersecting region at once, so if a region has n - * bands between the current position and the next place it overlaps - * the other, this entire loop will be passed through n times. - */ - if (r1->y1 < r2->y1) - { - top = max(r1->y1,ybot); - bot = min(r1->y2,r2->y1); - - if ((top != bot) && (nonOverlap1Func != NULL)) - { - (* nonOverlap1Func) (newReg, r1, r1BandEnd, top, bot); - } - - ytop = r2->y1; - } - else if (r2->y1 < r1->y1) - { - top = max(r2->y1,ybot); - bot = min(r2->y2,r1->y1); - - if ((top != bot) && (nonOverlap2Func != NULL)) - { - (* nonOverlap2Func) (newReg, r2, r2BandEnd, top, bot); - } - - ytop = r1->y1; - } - else - { - ytop = r1->y1; - } - - /* - * If any rectangles got added to the region, try and coalesce them - * with rectangles from the previous band. Note we could just do - * this test in miCoalesce, but some machines incur a not - * inconsiderable cost for function calls, so... - */ - if (newReg->numRects != curBand) - { - prevBand = miCoalesce (newReg, prevBand, curBand); - } - - /* - * Now see if we've hit an intersecting band. The two bands only - * intersect if ybot > ytop - */ - ybot = min(r1->y2, r2->y2); - curBand = newReg->numRects; - if (ybot > ytop) - { - (* overlapFunc) (newReg, r1, r1BandEnd, r2, r2BandEnd, ytop, ybot); - - } - - if (newReg->numRects != curBand) - { - prevBand = miCoalesce (newReg, prevBand, curBand); - } - - /* - * If we've finished with a band (y2 == ybot) we skip forward - * in the region to the next band. - */ - if (r1->y2 == ybot) - { - r1 = r1BandEnd; - } - if (r2->y2 == ybot) - { - r2 = r2BandEnd; - } - } while ((r1 != r1End) && (r2 != r2End)); - - /* - * Deal with whichever region still has rectangles left. - */ - curBand = newReg->numRects; - if (r1 != r1End) - { - if (nonOverlap1Func != NULL) - { - do - { - r1BandEnd = r1; - while ((r1BandEnd < r1End) && (r1BandEnd->y1 == r1->y1)) - { - r1BandEnd++; - } - (* nonOverlap1Func) (newReg, r1, r1BandEnd, - max(r1->y1,ybot), r1->y2); - r1 = r1BandEnd; - } while (r1 != r1End); - } - } - else if ((r2 != r2End) && (nonOverlap2Func != NULL)) - { - do - { - r2BandEnd = r2; - while ((r2BandEnd < r2End) && (r2BandEnd->y1 == r2->y1)) - { - r2BandEnd++; - } - (* nonOverlap2Func) (newReg, r2, r2BandEnd, - max(r2->y1,ybot), r2->y2); - r2 = r2BandEnd; - } while (r2 != r2End); - } - - if (newReg->numRects != curBand) - { - (void) miCoalesce (newReg, prevBand, curBand); - } - - /* - * A bit of cleanup. To keep regions from growing without bound, - * we shrink the array of rectangles to match the new number of - * rectangles in the region. This never goes to 0, however... - * - * Only do this stuff if the number of rectangles allocated is more than - * twice the number of rectangles in the region (a simple optimization...). - */ - if (newReg->numRects < (newReg->size >> 1)) - { - if (REGION_NOT_EMPTY(newReg)) - { - BoxPtr prev_rects = newReg->rects; - newReg->size = newReg->numRects; - newReg->rects = (BoxPtr) Xrealloc ((char *) newReg->rects, - (unsigned) (sizeof(BoxRec) * newReg->size)); - if (! newReg->rects) - newReg->rects = prev_rects; - } - else - { - /* - * No point in doing the extra work involved in an Xrealloc if - * the region is empty - */ - newReg->size = 1; - Xfree((char *) newReg->rects); - newReg->rects = (BoxPtr) Xmalloc(sizeof(BoxRec)); - } - } - Xfree ((char *) oldRects); - return; -} - - -/*====================================================================== - * Region Union - *====================================================================*/ - -/*- - *----------------------------------------------------------------------- - * miUnionNonO -- - * Handle a non-overlapping band for the union operation. Just - * Adds the rectangles into the region. Doesn't have to check for - * subsumption or anything. - * - * Results: - * None. - * - * Side Effects: - * pReg->numRects is incremented and the final rectangles overwritten - * with the rectangles we're passed. - * - *----------------------------------------------------------------------- - */ -/* static void*/ -static int -miUnionNonO ( - register Region pReg, - register BoxPtr r, - BoxPtr rEnd, - register short y1, - register short y2) -{ - register BoxPtr pNextRect; - - pNextRect = &pReg->rects[pReg->numRects]; - - assert(y1 < y2); - - while (r != rEnd) - { - assert(r->x1 < r->x2); - MEMCHECK(pReg, pNextRect, pReg->rects); - pNextRect->x1 = r->x1; - pNextRect->y1 = y1; - pNextRect->x2 = r->x2; - pNextRect->y2 = y2; - pReg->numRects += 1; - pNextRect++; - - assert(pReg->numRects<=pReg->size); - r++; - } - return 0; /* lint */ -} - - -/*- - *----------------------------------------------------------------------- - * miUnionO -- - * Handle an overlapping band for the union operation. Picks the - * left-most rectangle each time and merges it into the region. - * - * Results: - * None. - * - * Side Effects: - * Rectangles are overwritten in pReg->rects and pReg->numRects will - * be changed. - * - *----------------------------------------------------------------------- - */ - -/* static void*/ -static int -miUnionO ( - register Region pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - register short y1, - register short y2) -{ - register BoxPtr pNextRect; - - pNextRect = &pReg->rects[pReg->numRects]; - -#define MERGERECT(r) \ - if ((pReg->numRects != 0) && \ - (pNextRect[-1].y1 == y1) && \ - (pNextRect[-1].y2 == y2) && \ - (pNextRect[-1].x2 >= r->x1)) \ - { \ - if (pNextRect[-1].x2 < r->x2) \ - { \ - pNextRect[-1].x2 = r->x2; \ - assert(pNextRect[-1].x1rects); \ - pNextRect->y1 = y1; \ - pNextRect->y2 = y2; \ - pNextRect->x1 = r->x1; \ - pNextRect->x2 = r->x2; \ - pReg->numRects += 1; \ - pNextRect += 1; \ - } \ - assert(pReg->numRects<=pReg->size);\ - r++; - - assert (y1x1 < r2->x1) - { - MERGERECT(r1); - } - else - { - MERGERECT(r2); - } - } - - if (r1 != r1End) - { - do - { - MERGERECT(r1); - } while (r1 != r1End); - } - else while (r2 != r2End) - { - MERGERECT(r2); - } - return 0; /* lint */ -} - -int -XUnionRegion( - Region reg1, - Region reg2, /* source regions */ - Region newReg) /* destination Region */ -{ - /* checks all the simple cases */ - - /* - * Region 1 and 2 are the same or region 1 is empty - */ - if ( (reg1 == reg2) || (!(reg1->numRects)) ) - { - if (newReg != reg2) - miRegionCopy(newReg, reg2); - return 1; - } - - /* - * if nothing to union (region 2 empty) - */ - if (!(reg2->numRects)) - { - if (newReg != reg1) - miRegionCopy(newReg, reg1); - return 1; - } - - /* - * Region 1 completely subsumes region 2 - */ - if ((reg1->numRects == 1) && - (reg1->extents.x1 <= reg2->extents.x1) && - (reg1->extents.y1 <= reg2->extents.y1) && - (reg1->extents.x2 >= reg2->extents.x2) && - (reg1->extents.y2 >= reg2->extents.y2)) - { - if (newReg != reg1) - miRegionCopy(newReg, reg1); - return 1; - } - - /* - * Region 2 completely subsumes region 1 - */ - if ((reg2->numRects == 1) && - (reg2->extents.x1 <= reg1->extents.x1) && - (reg2->extents.y1 <= reg1->extents.y1) && - (reg2->extents.x2 >= reg1->extents.x2) && - (reg2->extents.y2 >= reg1->extents.y2)) - { - if (newReg != reg2) - miRegionCopy(newReg, reg2); - return 1; - } - - miRegionOp (newReg, reg1, reg2, miUnionO, - miUnionNonO, miUnionNonO); - - newReg->extents.x1 = min(reg1->extents.x1, reg2->extents.x1); - newReg->extents.y1 = min(reg1->extents.y1, reg2->extents.y1); - newReg->extents.x2 = max(reg1->extents.x2, reg2->extents.x2); - newReg->extents.y2 = max(reg1->extents.y2, reg2->extents.y2); - - return 1; -} - - -/*====================================================================== - * Region Subtraction - *====================================================================*/ - -/*- - *----------------------------------------------------------------------- - * miSubtractNonO -- - * Deal with non-overlapping band for subtraction. Any parts from - * region 2 we discard. Anything from region 1 we add to the region. - * - * Results: - * None. - * - * Side Effects: - * pReg may be affected. - * - *----------------------------------------------------------------------- - */ -/* static void*/ -static int -miSubtractNonO1 ( - register Region pReg, - register BoxPtr r, - BoxPtr rEnd, - register short y1, - register short y2) -{ - register BoxPtr pNextRect; - - pNextRect = &pReg->rects[pReg->numRects]; - - assert(y1x1x2); - MEMCHECK(pReg, pNextRect, pReg->rects); - pNextRect->x1 = r->x1; - pNextRect->y1 = y1; - pNextRect->x2 = r->x2; - pNextRect->y2 = y2; - pReg->numRects += 1; - pNextRect++; - - assert(pReg->numRects <= pReg->size); - - r++; - } - return 0; /* lint */ -} - -/*- - *----------------------------------------------------------------------- - * miSubtractO -- - * Overlapping band subtraction. x1 is the left-most point not yet - * checked. - * - * Results: - * None. - * - * Side Effects: - * pReg may have rectangles added to it. - * - *----------------------------------------------------------------------- - */ -/* static void*/ -static int -miSubtractO ( - register Region pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - register short y1, - register short y2) -{ - register BoxPtr pNextRect; - register int x1; - - x1 = r1->x1; - - assert(y1rects[pReg->numRects]; - - while ((r1 != r1End) && (r2 != r2End)) - { - if (r2->x2 <= x1) - { - /* - * Subtrahend missed the boat: go to next subtrahend. - */ - r2++; - } - else if (r2->x1 <= x1) - { - /* - * Subtrahend preceeds minuend: nuke left edge of minuend. - */ - x1 = r2->x2; - if (x1 >= r1->x2) - { - /* - * Minuend completely covered: advance to next minuend and - * reset left fence to edge of new minuend. - */ - r1++; - if (r1 != r1End) - x1 = r1->x1; - } - else - { - /* - * Subtrahend now used up since it doesn't extend beyond - * minuend - */ - r2++; - } - } - else if (r2->x1 < r1->x2) - { - /* - * Left part of subtrahend covers part of minuend: add uncovered - * part of minuend to region and skip to next subtrahend. - */ - assert(x1x1); - MEMCHECK(pReg, pNextRect, pReg->rects); - pNextRect->x1 = x1; - pNextRect->y1 = y1; - pNextRect->x2 = r2->x1; - pNextRect->y2 = y2; - pReg->numRects += 1; - pNextRect++; - - assert(pReg->numRects<=pReg->size); - - x1 = r2->x2; - if (x1 >= r1->x2) - { - /* - * Minuend used up: advance to new... - */ - r1++; - if (r1 != r1End) - x1 = r1->x1; - } - else - { - /* - * Subtrahend used up - */ - r2++; - } - } - else - { - /* - * Minuend used up: add any remaining piece before advancing. - */ - if (r1->x2 > x1) - { - MEMCHECK(pReg, pNextRect, pReg->rects); - pNextRect->x1 = x1; - pNextRect->y1 = y1; - pNextRect->x2 = r1->x2; - pNextRect->y2 = y2; - pReg->numRects += 1; - pNextRect++; - assert(pReg->numRects<=pReg->size); - } - r1++; - if (r1 != r1End) - x1 = r1->x1; - } - } - - /* - * Add remaining minuend rectangles to region. - */ - while (r1 != r1End) - { - assert(x1x2); - MEMCHECK(pReg, pNextRect, pReg->rects); - pNextRect->x1 = x1; - pNextRect->y1 = y1; - pNextRect->x2 = r1->x2; - pNextRect->y2 = y2; - pReg->numRects += 1; - pNextRect++; - - assert(pReg->numRects<=pReg->size); - - r1++; - if (r1 != r1End) - { - x1 = r1->x1; - } - } - return 0; /* lint */ -} - -/*- - *----------------------------------------------------------------------- - * miSubtract -- - * Subtract regS from regM and leave the result in regD. - * S stands for subtrahend, M for minuend and D for difference. - * - * Results: - * TRUE. - * - * Side Effects: - * regD is overwritten. - * - *----------------------------------------------------------------------- - */ - -int -XSubtractRegion( - Region regM, - Region regS, - register Region regD) -{ - /* check for trivial reject */ - if ( (!(regM->numRects)) || (!(regS->numRects)) || - (!EXTENTCHECK(®M->extents, ®S->extents)) ) - { - miRegionCopy(regD, regM); - return 1; - } - - miRegionOp (regD, regM, regS, miSubtractO, - miSubtractNonO1, NULL); - - /* - * Can't alter newReg's extents before we call miRegionOp because - * it might be one of the source regions and miRegionOp depends - * on the extents of those regions being the unaltered. Besides, this - * way there's no checking against rectangles that will be nuked - * due to coalescing, so we have to examine fewer rectangles. - */ - miSetExtents (regD); - return 1; -} - -int -XXorRegion(Region sra, Region srb, Region dr) -{ - Region tra, trb; - - if ((! (tra = XCreateRegion())) || (! (trb = XCreateRegion()))) - return 0; - (void) XSubtractRegion(sra,srb,tra); - (void) XSubtractRegion(srb,sra,trb); - (void) XUnionRegion(tra,trb,dr); - XDestroyRegion(tra); - XDestroyRegion(trb); - return 0; -} - -/* - * Check to see if the region is empty. Assumes a region is passed - * as a parameter - */ -int -XEmptyRegion( - Region r) -{ - if( r->numRects == 0 ) return TRUE; - else return FALSE; -} - -/* - * Check to see if two regions are equal - */ -int -XEqualRegion(Region r1, Region r2) -{ - int i; - - if( r1->numRects != r2->numRects ) return FALSE; - else if( r1->numRects == 0 ) return TRUE; - else if ( r1->extents.x1 != r2->extents.x1 ) return FALSE; - else if ( r1->extents.x2 != r2->extents.x2 ) return FALSE; - else if ( r1->extents.y1 != r2->extents.y1 ) return FALSE; - else if ( r1->extents.y2 != r2->extents.y2 ) return FALSE; - else for( i=0; i < r1->numRects; i++ ) { - if ( r1->rects[i].x1 != r2->rects[i].x1 ) return FALSE; - else if ( r1->rects[i].x2 != r2->rects[i].x2 ) return FALSE; - else if ( r1->rects[i].y1 != r2->rects[i].y1 ) return FALSE; - else if ( r1->rects[i].y2 != r2->rects[i].y2 ) return FALSE; - } - return TRUE; -} - -int -XPointInRegion( - Region pRegion, - int x, int y) -{ - int i; - - if (pRegion->numRects == 0) - return FALSE; - if (!INBOX(pRegion->extents, x, y)) - return FALSE; - for (i=0; inumRects; i++) - { - if (INBOX (pRegion->rects[i], x, y)) - return TRUE; - } - return FALSE; -} - -int -XRectInRegion( - register Region region, - int rx, int ry, - unsigned int rwidth, unsigned int rheight) -{ - register BoxPtr pbox; - register BoxPtr pboxEnd; - Box rect; - register BoxPtr prect = ▭ - int partIn, partOut; - - prect->x1 = rx; - prect->y1 = ry; - prect->x2 = rwidth + rx; - prect->y2 = rheight + ry; - - /* this is (just) a useful optimization */ - if ((region->numRects == 0) || !EXTENTCHECK(®ion->extents, prect)) - return(RectangleOut); - - partOut = FALSE; - partIn = FALSE; - - /* can stop when both partOut and partIn are TRUE, or we reach prect->y2 */ - for (pbox = region->rects, pboxEnd = pbox + region->numRects; - pbox < pboxEnd; - pbox++) - { - - if (pbox->y2 <= ry) - continue; /* getting up to speed or skipping remainder of band */ - - if (pbox->y1 > ry) - { - partOut = TRUE; /* missed part of rectangle above */ - if (partIn || (pbox->y1 >= prect->y2)) - break; - ry = pbox->y1; /* x guaranteed to be == prect->x1 */ - } - - if (pbox->x2 <= rx) - continue; /* not far enough over yet */ - - if (pbox->x1 > rx) - { - partOut = TRUE; /* missed part of rectangle to left */ - if (partIn) - break; - } - - if (pbox->x1 < prect->x2) - { - partIn = TRUE; /* definitely overlap */ - if (partOut) - break; - } - - if (pbox->x2 >= prect->x2) - { - ry = pbox->y2; /* finished with this band */ - if (ry >= prect->y2) - break; - rx = prect->x1; /* reset x out to left again */ - } else - { - /* - * Because boxes in a band are maximal width, if the first box - * to overlap the rectangle doesn't completely cover it in that - * band, the rectangle must be partially out, since some of it - * will be uncovered in that band. partIn will have been set true - * by now... - */ - break; - } - - } - - return(partIn ? ((ry < prect->y2) ? RectanglePart : RectangleIn) : - RectangleOut); -} +/************************************************************************ + +Copyright 1987, 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. + + +Copyright 1987, 1988 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. + +************************************************************************/ +/* + * The functions in this file implement the Region abstraction, similar to one + * used in the X11 sample server. A Region is simply an area, as the name + * implies, and is implemented as a "y-x-banded" array of rectangles. To + * explain: Each Region is made up of a certain number of rectangles sorted + * by y coordinate first, and then by x coordinate. + * + * Furthermore, the rectangles are banded such that every rectangle with a + * given upper-left y coordinate (y1) will have the same lower-right y + * coordinate (y2) and vice versa. If a rectangle has scanlines in a band, it + * will span the entire vertical distance of the band. This means that some + * areas that could be merged into a taller rectangle will be represented as + * several shorter rectangles to account for shorter rectangles to its left + * or right but within its "vertical scope". + * + * An added constraint on the rectangles is that they must cover as much + * horizontal area as possible. E.g. no two rectangles in a band are allowed + * to touch. + * + * Whenever possible, bands will be merged together to cover a greater vertical + * distance (and thus reduce the number of rectangles). Two bands can be merged + * only if the bottom of one touches the top of the other and they have + * rectangles in the same places (of the same width, of course). This maintains + * the y-x-banding that's so nice to have... + */ + +#ifdef HAVE_CONFIG_H +#include +#endif +#include "Xlibint.h" +#include "Xutil.h" +#include +#include "poly.h" + +#ifdef DEBUG +#include +#define assert(expr) {if (!(expr)) fprintf(stderr,\ +"Assertion failed file %s, line %d: expr\n", __FILE__, __LINE__); } +#else +#define assert(expr) +#endif + +typedef int (*overlapProcp)( + register Region pReg, + register BoxPtr r1, + BoxPtr r1End, + register BoxPtr r2, + BoxPtr r2End, + short y1, + short y2); + +typedef int (*nonOverlapProcp)( + register Region pReg, + register BoxPtr r, + BoxPtr rEnd, + register short y1, + register short y2); + +static void miRegionOp( + register Region newReg, /* Place to store result */ + Region reg1, /* First region in operation */ + Region reg2, /* 2d region in operation */ + int (*overlapFunc)( + register Region pReg, + register BoxPtr r1, + BoxPtr r1End, + register BoxPtr r2, + BoxPtr r2End, + short y1, + short y2), /* Function to call for over- + * lapping bands */ + int (*nonOverlap1Func)( + register Region pReg, + register BoxPtr r, + BoxPtr rEnd, + register short y1, + register short y2), /* Function to call for non- + * overlapping bands in region + * 1 */ + int (*nonOverlap2Func)( + register Region pReg, + register BoxPtr r, + BoxPtr rEnd, + register short y1, + register short y2)); /* Function to call for non- + * overlapping bands in region + * 2 */ + + +/* Create a new empty region */ +Region +XCreateRegion(void) +{ + Region temp; + + if (! (temp = ( Region )Xmalloc( (unsigned) sizeof( REGION )))) + return (Region) NULL; + if (! (temp->rects = ( BOX * )Xmalloc( (unsigned) sizeof( BOX )))) { + Xfree((char *) temp); + return (Region) NULL; + } + temp->numRects = 0; + temp->extents.x1 = 0; + temp->extents.y1 = 0; + temp->extents.x2 = 0; + temp->extents.y2 = 0; + temp->size = 1; + return( temp ); +} + +int +XClipBox( + Region r, + XRectangle *rect) +{ + rect->x = r->extents.x1; + rect->y = r->extents.y1; + rect->width = r->extents.x2 - r->extents.x1; + rect->height = r->extents.y2 - r->extents.y1; + return 1; +} + +int +XUnionRectWithRegion( + register XRectangle *rect, + Region source, Region dest) +{ + REGION region; + + if (!rect->width || !rect->height) + return 0; + region.rects = ®ion.extents; + region.numRects = 1; + region.extents.x1 = rect->x; + region.extents.y1 = rect->y; + region.extents.x2 = rect->x + rect->width; + region.extents.y2 = rect->y + rect->height; + region.size = 1; + + return XUnionRegion(®ion, source, dest); +} + +/*- + *----------------------------------------------------------------------- + * miSetExtents -- + * Reset the extents of a region to what they should be. Called by + * miSubtract and miIntersect b/c they can't figure it out along the + * way or do so easily, as miUnion can. + * + * Results: + * None. + * + * Side Effects: + * The region's 'extents' structure is overwritten. + * + *----------------------------------------------------------------------- + */ +static void +miSetExtents ( + Region pReg) +{ + register BoxPtr pBox, + pBoxEnd, + pExtents; + + if (pReg->numRects == 0) + { + pReg->extents.x1 = 0; + pReg->extents.y1 = 0; + pReg->extents.x2 = 0; + pReg->extents.y2 = 0; + return; + } + + pExtents = &pReg->extents; + pBox = pReg->rects; + pBoxEnd = &pBox[pReg->numRects - 1]; + + /* + * Since pBox is the first rectangle in the region, it must have the + * smallest y1 and since pBoxEnd is the last rectangle in the region, + * it must have the largest y2, because of banding. Initialize x1 and + * x2 from pBox and pBoxEnd, resp., as good things to initialize them + * to... + */ + pExtents->x1 = pBox->x1; + pExtents->y1 = pBox->y1; + pExtents->x2 = pBoxEnd->x2; + pExtents->y2 = pBoxEnd->y2; + + assert(pExtents->y1 < pExtents->y2); + while (pBox <= pBoxEnd) + { + if (pBox->x1 < pExtents->x1) + { + pExtents->x1 = pBox->x1; + } + if (pBox->x2 > pExtents->x2) + { + pExtents->x2 = pBox->x2; + } + pBox++; + } + assert(pExtents->x1 < pExtents->x2); +} + +int +XSetRegion( + Display *dpy, + GC gc, + register Region r) +{ + register int i; + register XRectangle *xr, *pr; + register BOX *pb; + unsigned long total; + + LockDisplay (dpy); + total = r->numRects * sizeof (XRectangle); + if ((xr = (XRectangle *) _XAllocTemp(dpy, total))) { + for (pr = xr, pb = r->rects, i = r->numRects; --i >= 0; pr++, pb++) { + pr->x = pb->x1; + pr->y = pb->y1; + pr->width = pb->x2 - pb->x1; + pr->height = pb->y2 - pb->y1; + } + } + if (xr || !r->numRects) + _XSetClipRectangles(dpy, gc, 0, 0, xr, r->numRects, YXBanded); + if (xr) + _XFreeTemp(dpy, (char *)xr, total); + UnlockDisplay(dpy); + SyncHandle(); + return 1; +} + +int +XDestroyRegion( + Region r) +{ + Xfree( (char *) r->rects ); + Xfree( (char *) r ); + return 1; +} + + +/* TranslateRegion(pRegion, x, y) + translates in place + added by raymond +*/ + +int +XOffsetRegion( + register Region pRegion, + register int x, + register int y) +{ + register int nbox; + register BOX *pbox; + + pbox = pRegion->rects; + nbox = pRegion->numRects; + + while(nbox--) + { + pbox->x1 += x; + pbox->x2 += x; + pbox->y1 += y; + pbox->y2 += y; + pbox++; + } + pRegion->extents.x1 += x; + pRegion->extents.x2 += x; + pRegion->extents.y1 += y; + pRegion->extents.y2 += y; + return 1; +} + +/* + Utility procedure Compress: + Replace r by the region r', where + p in r' iff (Quantifer m <= dx) (p + m in r), and + Quantifier is Exists if grow is TRUE, For all if grow is FALSE, and + (x,y) + m = (x+m,y) if xdir is TRUE; (x,y+m) if xdir is FALSE. + + Thus, if xdir is TRUE and grow is FALSE, r is replaced by the region + of all points p such that p and the next dx points on the same + horizontal scan line are all in r. We do this using by noting + that p is the head of a run of length 2^i + k iff p is the head + of a run of length 2^i and p+2^i is the head of a run of length + k. Thus, the loop invariant: s contains the region corresponding + to the runs of length shift. r contains the region corresponding + to the runs of length 1 + dxo & (shift-1), where dxo is the original + value of dx. dx = dxo & ~(shift-1). As parameters, s and t are + scratch regions, so that we don't have to allocate them on every + call. +*/ + +#define ZOpRegion(a,b,c) if (grow) XUnionRegion(a,b,c); \ + else XIntersectRegion(a,b,c) +#define ZShiftRegion(a,b) if (xdir) XOffsetRegion(a,b,0); \ + else XOffsetRegion(a,0,b) +#define ZCopyRegion(a,b) XUnionRegion(a,a,b) + +static void +Compress( + Region r, Region s, Region t, + register unsigned dx, + register int xdir, register int grow) +{ + register unsigned shift = 1; + + ZCopyRegion(r, s); + while (dx) { + if (dx & shift) { + ZShiftRegion(r, -(int)shift); + ZOpRegion(r, s, r); + dx -= shift; + if (!dx) break; + } + ZCopyRegion(s, t); + ZShiftRegion(s, -(int)shift); + ZOpRegion(s, t, s); + shift <<= 1; + } +} + +#undef ZOpRegion +#undef ZShiftRegion +#undef ZCopyRegion + +int +XShrinkRegion( + Region r, + int dx, int dy) +{ + Region s, t; + int grow; + + if (!dx && !dy) return 0; + if (! (s = XCreateRegion()) ) + return 0; + if (! (t = XCreateRegion()) ) { + XDestroyRegion(s); + return 0; + } + if ((grow = (dx < 0))) dx = -dx; + if (dx) Compress(r, s, t, (unsigned) 2*dx, TRUE, grow); + if ((grow = (dy < 0))) dy = -dy; + if (dy) Compress(r, s, t, (unsigned) 2*dy, FALSE, grow); + XOffsetRegion(r, dx, dy); + XDestroyRegion(s); + XDestroyRegion(t); + return 0; +} + + +/*====================================================================== + * Region Intersection + *====================================================================*/ +/*- + *----------------------------------------------------------------------- + * miIntersectO -- + * Handle an overlapping band for miIntersect. + * + * Results: + * None. + * + * Side Effects: + * Rectangles may be added to the region. + * + *----------------------------------------------------------------------- + */ +/* static void*/ +static int +miIntersectO ( + register Region pReg, + register BoxPtr r1, + BoxPtr r1End, + register BoxPtr r2, + BoxPtr r2End, + short y1, + short y2) +{ + register short x1; + register short x2; + register BoxPtr pNextRect; + + pNextRect = &pReg->rects[pReg->numRects]; + + while ((r1 != r1End) && (r2 != r2End)) + { + x1 = max(r1->x1,r2->x1); + x2 = min(r1->x2,r2->x2); + + /* + * If there's any overlap between the two rectangles, add that + * overlap to the new region. + * There's no need to check for subsumption because the only way + * such a need could arise is if some region has two rectangles + * right next to each other. Since that should never happen... + */ + if (x1 < x2) + { + assert(y1rects); + pNextRect->x1 = x1; + pNextRect->y1 = y1; + pNextRect->x2 = x2; + pNextRect->y2 = y2; + pReg->numRects += 1; + pNextRect++; + assert(pReg->numRects <= pReg->size); + } + + /* + * Need to advance the pointers. Shift the one that extends + * to the right the least, since the other still has a chance to + * overlap with that region's next rectangle, if you see what I mean. + */ + if (r1->x2 < r2->x2) + { + r1++; + } + else if (r2->x2 < r1->x2) + { + r2++; + } + else + { + r1++; + r2++; + } + } + return 0; /* lint */ +} + +int +XIntersectRegion( + Region reg1, + Region reg2, /* source regions */ + register Region newReg) /* destination Region */ +{ + /* check for trivial reject */ + if ( (!(reg1->numRects)) || (!(reg2->numRects)) || + (!EXTENTCHECK(®1->extents, ®2->extents))) + newReg->numRects = 0; + else + miRegionOp (newReg, reg1, reg2, + miIntersectO, NULL, NULL); + + /* + * Can't alter newReg's extents before we call miRegionOp because + * it might be one of the source regions and miRegionOp depends + * on the extents of those regions being the same. Besides, this + * way there's no checking against rectangles that will be nuked + * due to coalescing, so we have to examine fewer rectangles. + */ + miSetExtents(newReg); + return 1; +} + +static void +miRegionCopy( + register Region dstrgn, + register Region rgn) + +{ + if (dstrgn != rgn) /* don't want to copy to itself */ + { + if (dstrgn->size < rgn->numRects) + { + if (dstrgn->rects) + { + BOX *prevRects = dstrgn->rects; + + if (! (dstrgn->rects = (BOX *) + Xrealloc((char *) dstrgn->rects, + (unsigned) rgn->numRects * (sizeof(BOX))))) { + Xfree(prevRects); + return; + } + } + dstrgn->size = rgn->numRects; + } + dstrgn->numRects = rgn->numRects; + dstrgn->extents.x1 = rgn->extents.x1; + dstrgn->extents.y1 = rgn->extents.y1; + dstrgn->extents.x2 = rgn->extents.x2; + dstrgn->extents.y2 = rgn->extents.y2; + + memcpy((char *) dstrgn->rects, (char *) rgn->rects, + (int) (rgn->numRects * sizeof(BOX))); + } +} + +/*====================================================================== + * Generic Region Operator + *====================================================================*/ + +/*- + *----------------------------------------------------------------------- + * miCoalesce -- + * Attempt to merge the boxes in the current band with those in the + * previous one. Used only by miRegionOp. + * + * Results: + * The new index for the previous band. + * + * Side Effects: + * If coalescing takes place: + * - rectangles in the previous band will have their y2 fields + * altered. + * - pReg->numRects will be decreased. + * + *----------------------------------------------------------------------- + */ +/* static int*/ +static int +miCoalesce( + register Region pReg, /* Region to coalesce */ + int prevStart, /* Index of start of previous band */ + int curStart) /* Index of start of current band */ +{ + register BoxPtr pPrevBox; /* Current box in previous band */ + register BoxPtr pCurBox; /* Current box in current band */ + register BoxPtr pRegEnd; /* End of region */ + int curNumRects; /* Number of rectangles in current + * band */ + int prevNumRects; /* Number of rectangles in previous + * band */ + int bandY1; /* Y1 coordinate for current band */ + + pRegEnd = &pReg->rects[pReg->numRects]; + + pPrevBox = &pReg->rects[prevStart]; + prevNumRects = curStart - prevStart; + + /* + * Figure out how many rectangles are in the current band. Have to do + * this because multiple bands could have been added in miRegionOp + * at the end when one region has been exhausted. + */ + pCurBox = &pReg->rects[curStart]; + bandY1 = pCurBox->y1; + for (curNumRects = 0; + (pCurBox != pRegEnd) && (pCurBox->y1 == bandY1); + curNumRects++) + { + pCurBox++; + } + + if (pCurBox != pRegEnd) + { + /* + * If more than one band was added, we have to find the start + * of the last band added so the next coalescing job can start + * at the right place... (given when multiple bands are added, + * this may be pointless -- see above). + */ + pRegEnd--; + while (pRegEnd[-1].y1 == pRegEnd->y1) + { + pRegEnd--; + } + curStart = pRegEnd - pReg->rects; + pRegEnd = pReg->rects + pReg->numRects; + } + + if ((curNumRects == prevNumRects) && (curNumRects != 0)) { + pCurBox -= curNumRects; + /* + * The bands may only be coalesced if the bottom of the previous + * matches the top scanline of the current. + */ + if (pPrevBox->y2 == pCurBox->y1) + { + /* + * Make sure the bands have boxes in the same places. This + * assumes that boxes have been added in such a way that they + * cover the most area possible. I.e. two boxes in a band must + * have some horizontal space between them. + */ + do + { + if ((pPrevBox->x1 != pCurBox->x1) || + (pPrevBox->x2 != pCurBox->x2)) + { + /* + * The bands don't line up so they can't be coalesced. + */ + return (curStart); + } + pPrevBox++; + pCurBox++; + prevNumRects -= 1; + } while (prevNumRects != 0); + + pReg->numRects -= curNumRects; + pCurBox -= curNumRects; + pPrevBox -= curNumRects; + + /* + * The bands may be merged, so set the bottom y of each box + * in the previous band to that of the corresponding box in + * the current band. + */ + do + { + pPrevBox->y2 = pCurBox->y2; + pPrevBox++; + pCurBox++; + curNumRects -= 1; + } while (curNumRects != 0); + + /* + * If only one band was added to the region, we have to backup + * curStart to the start of the previous band. + * + * If more than one band was added to the region, copy the + * other bands down. The assumption here is that the other bands + * came from the same region as the current one and no further + * coalescing can be done on them since it's all been done + * already... curStart is already in the right place. + */ + if (pCurBox == pRegEnd) + { + curStart = prevStart; + } + else + { + do + { + *pPrevBox++ = *pCurBox++; + } while (pCurBox != pRegEnd); + } + + } + } + return (curStart); +} + +/*- + *----------------------------------------------------------------------- + * miRegionOp -- + * Apply an operation to two regions. Called by miUnion, miInverse, + * miSubtract, miIntersect... + * + * Results: + * None. + * + * Side Effects: + * The new region is overwritten. + * + * Notes: + * The idea behind this function is to view the two regions as sets. + * Together they cover a rectangle of area that this function divides + * into horizontal bands where points are covered only by one region + * or by both. For the first case, the nonOverlapFunc is called with + * each the band and the band's upper and lower extents. For the + * second, the overlapFunc is called to process the entire band. It + * is responsible for clipping the rectangles in the band, though + * this function provides the boundaries. + * At the end of each band, the new region is coalesced, if possible, + * to reduce the number of rectangles in the region. + * + *----------------------------------------------------------------------- + */ +/* static void*/ +static void +miRegionOp( + register Region newReg, /* Place to store result */ + Region reg1, /* First region in operation */ + Region reg2, /* 2d region in operation */ + int (*overlapFunc)( + register Region pReg, + register BoxPtr r1, + BoxPtr r1End, + register BoxPtr r2, + BoxPtr r2End, + short y1, + short y2), /* Function to call for over- + * lapping bands */ + int (*nonOverlap1Func)( + register Region pReg, + register BoxPtr r, + BoxPtr rEnd, + register short y1, + register short y2), /* Function to call for non- + * overlapping bands in region + * 1 */ + int (*nonOverlap2Func)( + register Region pReg, + register BoxPtr r, + BoxPtr rEnd, + register short y1, + register short y2)) /* Function to call for non- + * overlapping bands in region + * 2 */ +{ + register BoxPtr r1; /* Pointer into first region */ + register BoxPtr r2; /* Pointer into 2d region */ + BoxPtr r1End; /* End of 1st region */ + BoxPtr r2End; /* End of 2d region */ + register short ybot; /* Bottom of intersection */ + register short ytop; /* Top of intersection */ + BoxPtr oldRects; /* Old rects for newReg */ + int prevBand; /* Index of start of + * previous band in newReg */ + int curBand; /* Index of start of current + * band in newReg */ + register BoxPtr r1BandEnd; /* End of current band in r1 */ + register BoxPtr r2BandEnd; /* End of current band in r2 */ + short top; /* Top of non-overlapping + * band */ + short bot; /* Bottom of non-overlapping + * band */ + + /* + * Initialization: + * set r1, r2, r1End and r2End appropriately, preserve the important + * parts of the destination region until the end in case it's one of + * the two source regions, then mark the "new" region empty, allocating + * another array of rectangles for it to use. + */ + r1 = reg1->rects; + r2 = reg2->rects; + r1End = r1 + reg1->numRects; + r2End = r2 + reg2->numRects; + + oldRects = newReg->rects; + + EMPTY_REGION(newReg); + + /* + * Allocate a reasonable number of rectangles for the new region. The idea + * is to allocate enough so the individual functions don't need to + * reallocate and copy the array, which is time consuming, yet we don't + * have to worry about using too much memory. I hope to be able to + * nuke the Xrealloc() at the end of this function eventually. + */ + newReg->size = max(reg1->numRects,reg2->numRects) * 2; + + if (! (newReg->rects = (BoxPtr) + Xmalloc ((unsigned) (sizeof(BoxRec) * newReg->size)))) { + newReg->size = 0; + return; + } + + /* + * Initialize ybot and ytop. + * In the upcoming loop, ybot and ytop serve different functions depending + * on whether the band being handled is an overlapping or non-overlapping + * band. + * In the case of a non-overlapping band (only one of the regions + * has points in the band), ybot is the bottom of the most recent + * intersection and thus clips the top of the rectangles in that band. + * ytop is the top of the next intersection between the two regions and + * serves to clip the bottom of the rectangles in the current band. + * For an overlapping band (where the two regions intersect), ytop clips + * the top of the rectangles of both regions and ybot clips the bottoms. + */ + if (reg1->extents.y1 < reg2->extents.y1) + ybot = reg1->extents.y1; + else + ybot = reg2->extents.y1; + + /* + * prevBand serves to mark the start of the previous band so rectangles + * can be coalesced into larger rectangles. qv. miCoalesce, above. + * In the beginning, there is no previous band, so prevBand == curBand + * (curBand is set later on, of course, but the first band will always + * start at index 0). prevBand and curBand must be indices because of + * the possible expansion, and resultant moving, of the new region's + * array of rectangles. + */ + prevBand = 0; + + do + { + curBand = newReg->numRects; + + /* + * This algorithm proceeds one source-band (as opposed to a + * destination band, which is determined by where the two regions + * intersect) at a time. r1BandEnd and r2BandEnd serve to mark the + * rectangle after the last one in the current band for their + * respective regions. + */ + r1BandEnd = r1; + while ((r1BandEnd != r1End) && (r1BandEnd->y1 == r1->y1)) + { + r1BandEnd++; + } + + r2BandEnd = r2; + while ((r2BandEnd != r2End) && (r2BandEnd->y1 == r2->y1)) + { + r2BandEnd++; + } + + /* + * First handle the band that doesn't intersect, if any. + * + * Note that attention is restricted to one band in the + * non-intersecting region at once, so if a region has n + * bands between the current position and the next place it overlaps + * the other, this entire loop will be passed through n times. + */ + if (r1->y1 < r2->y1) + { + top = max(r1->y1,ybot); + bot = min(r1->y2,r2->y1); + + if ((top != bot) && (nonOverlap1Func != NULL)) + { + (* nonOverlap1Func) (newReg, r1, r1BandEnd, top, bot); + } + + ytop = r2->y1; + } + else if (r2->y1 < r1->y1) + { + top = max(r2->y1,ybot); + bot = min(r2->y2,r1->y1); + + if ((top != bot) && (nonOverlap2Func != NULL)) + { + (* nonOverlap2Func) (newReg, r2, r2BandEnd, top, bot); + } + + ytop = r1->y1; + } + else + { + ytop = r1->y1; + } + + /* + * If any rectangles got added to the region, try and coalesce them + * with rectangles from the previous band. Note we could just do + * this test in miCoalesce, but some machines incur a not + * inconsiderable cost for function calls, so... + */ + if (newReg->numRects != curBand) + { + prevBand = miCoalesce (newReg, prevBand, curBand); + } + + /* + * Now see if we've hit an intersecting band. The two bands only + * intersect if ybot > ytop + */ + ybot = min(r1->y2, r2->y2); + curBand = newReg->numRects; + if (ybot > ytop) + { + (* overlapFunc) (newReg, r1, r1BandEnd, r2, r2BandEnd, ytop, ybot); + + } + + if (newReg->numRects != curBand) + { + prevBand = miCoalesce (newReg, prevBand, curBand); + } + + /* + * If we've finished with a band (y2 == ybot) we skip forward + * in the region to the next band. + */ + if (r1->y2 == ybot) + { + r1 = r1BandEnd; + } + if (r2->y2 == ybot) + { + r2 = r2BandEnd; + } + } while ((r1 != r1End) && (r2 != r2End)); + + /* + * Deal with whichever region still has rectangles left. + */ + curBand = newReg->numRects; + if (r1 != r1End) + { + if (nonOverlap1Func != NULL) + { + do + { + r1BandEnd = r1; + while ((r1BandEnd < r1End) && (r1BandEnd->y1 == r1->y1)) + { + r1BandEnd++; + } + (* nonOverlap1Func) (newReg, r1, r1BandEnd, + max(r1->y1,ybot), r1->y2); + r1 = r1BandEnd; + } while (r1 != r1End); + } + } + else if ((r2 != r2End) && (nonOverlap2Func != NULL)) + { + do + { + r2BandEnd = r2; + while ((r2BandEnd < r2End) && (r2BandEnd->y1 == r2->y1)) + { + r2BandEnd++; + } + (* nonOverlap2Func) (newReg, r2, r2BandEnd, + max(r2->y1,ybot), r2->y2); + r2 = r2BandEnd; + } while (r2 != r2End); + } + + if (newReg->numRects != curBand) + { + (void) miCoalesce (newReg, prevBand, curBand); + } + + /* + * A bit of cleanup. To keep regions from growing without bound, + * we shrink the array of rectangles to match the new number of + * rectangles in the region. This never goes to 0, however... + * + * Only do this stuff if the number of rectangles allocated is more than + * twice the number of rectangles in the region (a simple optimization...). + */ + if (newReg->numRects < (newReg->size >> 1)) + { + if (REGION_NOT_EMPTY(newReg)) + { + BoxPtr prev_rects = newReg->rects; + newReg->size = newReg->numRects; + newReg->rects = (BoxPtr) Xrealloc ((char *) newReg->rects, + (unsigned) (sizeof(BoxRec) * newReg->size)); + if (! newReg->rects) + newReg->rects = prev_rects; + } + else + { + /* + * No point in doing the extra work involved in an Xrealloc if + * the region is empty + */ + newReg->size = 1; + Xfree((char *) newReg->rects); + newReg->rects = (BoxPtr) Xmalloc(sizeof(BoxRec)); + } + } + Xfree ((char *) oldRects); + return; +} + + +/*====================================================================== + * Region Union + *====================================================================*/ + +/*- + *----------------------------------------------------------------------- + * miUnionNonO -- + * Handle a non-overlapping band for the union operation. Just + * Adds the rectangles into the region. Doesn't have to check for + * subsumption or anything. + * + * Results: + * None. + * + * Side Effects: + * pReg->numRects is incremented and the final rectangles overwritten + * with the rectangles we're passed. + * + *----------------------------------------------------------------------- + */ +/* static void*/ +static int +miUnionNonO ( + register Region pReg, + register BoxPtr r, + BoxPtr rEnd, + register short y1, + register short y2) +{ + register BoxPtr pNextRect; + + pNextRect = &pReg->rects[pReg->numRects]; + + assert(y1 < y2); + + while (r != rEnd) + { + assert(r->x1 < r->x2); + MEMCHECK(pReg, pNextRect, pReg->rects); + pNextRect->x1 = r->x1; + pNextRect->y1 = y1; + pNextRect->x2 = r->x2; + pNextRect->y2 = y2; + pReg->numRects += 1; + pNextRect++; + + assert(pReg->numRects<=pReg->size); + r++; + } + return 0; /* lint */ +} + + +/*- + *----------------------------------------------------------------------- + * miUnionO -- + * Handle an overlapping band for the union operation. Picks the + * left-most rectangle each time and merges it into the region. + * + * Results: + * None. + * + * Side Effects: + * Rectangles are overwritten in pReg->rects and pReg->numRects will + * be changed. + * + *----------------------------------------------------------------------- + */ + +/* static void*/ +static int +miUnionO ( + register Region pReg, + register BoxPtr r1, + BoxPtr r1End, + register BoxPtr r2, + BoxPtr r2End, + register short y1, + register short y2) +{ + register BoxPtr pNextRect; + + pNextRect = &pReg->rects[pReg->numRects]; + +#define MERGERECT(r) \ + if ((pReg->numRects != 0) && \ + (pNextRect[-1].y1 == y1) && \ + (pNextRect[-1].y2 == y2) && \ + (pNextRect[-1].x2 >= r->x1)) \ + { \ + if (pNextRect[-1].x2 < r->x2) \ + { \ + pNextRect[-1].x2 = r->x2; \ + assert(pNextRect[-1].x1rects); \ + pNextRect->y1 = y1; \ + pNextRect->y2 = y2; \ + pNextRect->x1 = r->x1; \ + pNextRect->x2 = r->x2; \ + pReg->numRects += 1; \ + pNextRect += 1; \ + } \ + assert(pReg->numRects<=pReg->size);\ + r++; + + assert (y1x1 < r2->x1) + { + MERGERECT(r1); + } + else + { + MERGERECT(r2); + } + } + + if (r1 != r1End) + { + do + { + MERGERECT(r1); + } while (r1 != r1End); + } + else while (r2 != r2End) + { + MERGERECT(r2); + } + return 0; /* lint */ +} + +int +XUnionRegion( + Region reg1, + Region reg2, /* source regions */ + Region newReg) /* destination Region */ +{ + /* checks all the simple cases */ + + /* + * Region 1 and 2 are the same or region 1 is empty + */ + if ( (reg1 == reg2) || (!(reg1->numRects)) ) + { + if (newReg != reg2) + miRegionCopy(newReg, reg2); + return 1; + } + + /* + * if nothing to union (region 2 empty) + */ + if (!(reg2->numRects)) + { + if (newReg != reg1) + miRegionCopy(newReg, reg1); + return 1; + } + + /* + * Region 1 completely subsumes region 2 + */ + if ((reg1->numRects == 1) && + (reg1->extents.x1 <= reg2->extents.x1) && + (reg1->extents.y1 <= reg2->extents.y1) && + (reg1->extents.x2 >= reg2->extents.x2) && + (reg1->extents.y2 >= reg2->extents.y2)) + { + if (newReg != reg1) + miRegionCopy(newReg, reg1); + return 1; + } + + /* + * Region 2 completely subsumes region 1 + */ + if ((reg2->numRects == 1) && + (reg2->extents.x1 <= reg1->extents.x1) && + (reg2->extents.y1 <= reg1->extents.y1) && + (reg2->extents.x2 >= reg1->extents.x2) && + (reg2->extents.y2 >= reg1->extents.y2)) + { + if (newReg != reg2) + miRegionCopy(newReg, reg2); + return 1; + } + + miRegionOp (newReg, reg1, reg2, miUnionO, + miUnionNonO, miUnionNonO); + + newReg->extents.x1 = min(reg1->extents.x1, reg2->extents.x1); + newReg->extents.y1 = min(reg1->extents.y1, reg2->extents.y1); + newReg->extents.x2 = max(reg1->extents.x2, reg2->extents.x2); + newReg->extents.y2 = max(reg1->extents.y2, reg2->extents.y2); + + return 1; +} + + +/*====================================================================== + * Region Subtraction + *====================================================================*/ + +/*- + *----------------------------------------------------------------------- + * miSubtractNonO -- + * Deal with non-overlapping band for subtraction. Any parts from + * region 2 we discard. Anything from region 1 we add to the region. + * + * Results: + * None. + * + * Side Effects: + * pReg may be affected. + * + *----------------------------------------------------------------------- + */ +/* static void*/ +static int +miSubtractNonO1 ( + register Region pReg, + register BoxPtr r, + BoxPtr rEnd, + register short y1, + register short y2) +{ + register BoxPtr pNextRect; + + pNextRect = &pReg->rects[pReg->numRects]; + + assert(y1x1x2); + MEMCHECK(pReg, pNextRect, pReg->rects); + pNextRect->x1 = r->x1; + pNextRect->y1 = y1; + pNextRect->x2 = r->x2; + pNextRect->y2 = y2; + pReg->numRects += 1; + pNextRect++; + + assert(pReg->numRects <= pReg->size); + + r++; + } + return 0; /* lint */ +} + +/*- + *----------------------------------------------------------------------- + * miSubtractO -- + * Overlapping band subtraction. x1 is the left-most point not yet + * checked. + * + * Results: + * None. + * + * Side Effects: + * pReg may have rectangles added to it. + * + *----------------------------------------------------------------------- + */ +/* static void*/ +static int +miSubtractO ( + register Region pReg, + register BoxPtr r1, + BoxPtr r1End, + register BoxPtr r2, + BoxPtr r2End, + register short y1, + register short y2) +{ + register BoxPtr pNextRect; + register int x1; + + x1 = r1->x1; + + assert(y1rects[pReg->numRects]; + + while ((r1 != r1End) && (r2 != r2End)) + { + if (r2->x2 <= x1) + { + /* + * Subtrahend missed the boat: go to next subtrahend. + */ + r2++; + } + else if (r2->x1 <= x1) + { + /* + * Subtrahend preceeds minuend: nuke left edge of minuend. + */ + x1 = r2->x2; + if (x1 >= r1->x2) + { + /* + * Minuend completely covered: advance to next minuend and + * reset left fence to edge of new minuend. + */ + r1++; + if (r1 != r1End) + x1 = r1->x1; + } + else + { + /* + * Subtrahend now used up since it doesn't extend beyond + * minuend + */ + r2++; + } + } + else if (r2->x1 < r1->x2) + { + /* + * Left part of subtrahend covers part of minuend: add uncovered + * part of minuend to region and skip to next subtrahend. + */ + assert(x1x1); + MEMCHECK(pReg, pNextRect, pReg->rects); + pNextRect->x1 = x1; + pNextRect->y1 = y1; + pNextRect->x2 = r2->x1; + pNextRect->y2 = y2; + pReg->numRects += 1; + pNextRect++; + + assert(pReg->numRects<=pReg->size); + + x1 = r2->x2; + if (x1 >= r1->x2) + { + /* + * Minuend used up: advance to new... + */ + r1++; + if (r1 != r1End) + x1 = r1->x1; + } + else + { + /* + * Subtrahend used up + */ + r2++; + } + } + else + { + /* + * Minuend used up: add any remaining piece before advancing. + */ + if (r1->x2 > x1) + { + MEMCHECK(pReg, pNextRect, pReg->rects); + pNextRect->x1 = x1; + pNextRect->y1 = y1; + pNextRect->x2 = r1->x2; + pNextRect->y2 = y2; + pReg->numRects += 1; + pNextRect++; + assert(pReg->numRects<=pReg->size); + } + r1++; + if (r1 != r1End) + x1 = r1->x1; + } + } + + /* + * Add remaining minuend rectangles to region. + */ + while (r1 != r1End) + { + assert(x1x2); + MEMCHECK(pReg, pNextRect, pReg->rects); + pNextRect->x1 = x1; + pNextRect->y1 = y1; + pNextRect->x2 = r1->x2; + pNextRect->y2 = y2; + pReg->numRects += 1; + pNextRect++; + + assert(pReg->numRects<=pReg->size); + + r1++; + if (r1 != r1End) + { + x1 = r1->x1; + } + } + return 0; /* lint */ +} + +/*- + *----------------------------------------------------------------------- + * miSubtract -- + * Subtract regS from regM and leave the result in regD. + * S stands for subtrahend, M for minuend and D for difference. + * + * Results: + * TRUE. + * + * Side Effects: + * regD is overwritten. + * + *----------------------------------------------------------------------- + */ + +int +XSubtractRegion( + Region regM, + Region regS, + register Region regD) +{ + /* check for trivial reject */ + if ( (!(regM->numRects)) || (!(regS->numRects)) || + (!EXTENTCHECK(®M->extents, ®S->extents)) ) + { + miRegionCopy(regD, regM); + return 1; + } + + miRegionOp (regD, regM, regS, miSubtractO, + miSubtractNonO1, NULL); + + /* + * Can't alter newReg's extents before we call miRegionOp because + * it might be one of the source regions and miRegionOp depends + * on the extents of those regions being the unaltered. Besides, this + * way there's no checking against rectangles that will be nuked + * due to coalescing, so we have to examine fewer rectangles. + */ + miSetExtents (regD); + return 1; +} + +int +XXorRegion(Region sra, Region srb, Region dr) +{ + Region tra, trb; + + if (! (tra = XCreateRegion()) ) + return 0; + if (! (trb = XCreateRegion()) ) { + XDestroyRegion(tra); + return 0; + } + (void) XSubtractRegion(sra,srb,tra); + (void) XSubtractRegion(srb,sra,trb); + (void) XUnionRegion(tra,trb,dr); + XDestroyRegion(tra); + XDestroyRegion(trb); + return 0; +} + +/* + * Check to see if the region is empty. Assumes a region is passed + * as a parameter + */ +int +XEmptyRegion( + Region r) +{ + if( r->numRects == 0 ) return TRUE; + else return FALSE; +} + +/* + * Check to see if two regions are equal + */ +int +XEqualRegion(Region r1, Region r2) +{ + int i; + + if( r1->numRects != r2->numRects ) return FALSE; + else if( r1->numRects == 0 ) return TRUE; + else if ( r1->extents.x1 != r2->extents.x1 ) return FALSE; + else if ( r1->extents.x2 != r2->extents.x2 ) return FALSE; + else if ( r1->extents.y1 != r2->extents.y1 ) return FALSE; + else if ( r1->extents.y2 != r2->extents.y2 ) return FALSE; + else for( i=0; i < r1->numRects; i++ ) { + if ( r1->rects[i].x1 != r2->rects[i].x1 ) return FALSE; + else if ( r1->rects[i].x2 != r2->rects[i].x2 ) return FALSE; + else if ( r1->rects[i].y1 != r2->rects[i].y1 ) return FALSE; + else if ( r1->rects[i].y2 != r2->rects[i].y2 ) return FALSE; + } + return TRUE; +} + +int +XPointInRegion( + Region pRegion, + int x, int y) +{ + int i; + + if (pRegion->numRects == 0) + return FALSE; + if (!INBOX(pRegion->extents, x, y)) + return FALSE; + for (i=0; inumRects; i++) + { + if (INBOX (pRegion->rects[i], x, y)) + return TRUE; + } + return FALSE; +} + +int +XRectInRegion( + register Region region, + int rx, int ry, + unsigned int rwidth, unsigned int rheight) +{ + register BoxPtr pbox; + register BoxPtr pboxEnd; + Box rect; + register BoxPtr prect = ▭ + int partIn, partOut; + + prect->x1 = rx; + prect->y1 = ry; + prect->x2 = rwidth + rx; + prect->y2 = rheight + ry; + + /* this is (just) a useful optimization */ + if ((region->numRects == 0) || !EXTENTCHECK(®ion->extents, prect)) + return(RectangleOut); + + partOut = FALSE; + partIn = FALSE; + + /* can stop when both partOut and partIn are TRUE, or we reach prect->y2 */ + for (pbox = region->rects, pboxEnd = pbox + region->numRects; + pbox < pboxEnd; + pbox++) + { + + if (pbox->y2 <= ry) + continue; /* getting up to speed or skipping remainder of band */ + + if (pbox->y1 > ry) + { + partOut = TRUE; /* missed part of rectangle above */ + if (partIn || (pbox->y1 >= prect->y2)) + break; + ry = pbox->y1; /* x guaranteed to be == prect->x1 */ + } + + if (pbox->x2 <= rx) + continue; /* not far enough over yet */ + + if (pbox->x1 > rx) + { + partOut = TRUE; /* missed part of rectangle to left */ + if (partIn) + break; + } + + if (pbox->x1 < prect->x2) + { + partIn = TRUE; /* definitely overlap */ + if (partOut) + break; + } + + if (pbox->x2 >= prect->x2) + { + ry = pbox->y2; /* finished with this band */ + if (ry >= prect->y2) + break; + rx = prect->x1; /* reset x out to left again */ + } else + { + /* + * Because boxes in a band are maximal width, if the first box + * to overlap the rectangle doesn't completely cover it in that + * band, the rectangle must be partially out, since some of it + * will be uncovered in that band. partIn will have been set true + * by now... + */ + break; + } + + } + + return(partIn ? ((ry < prect->y2) ? RectanglePart : RectangleIn) : + RectangleOut); +} diff --git a/mesalib/SConstruct b/mesalib/SConstruct index 269715637..7773719af 100644 --- a/mesalib/SConstruct +++ b/mesalib/SConstruct @@ -153,7 +153,9 @@ if env['crosscompile'] and env['platform'] != 'embedded': if host_env['msvc']: host_env.Append(CPPPATH = ['#include/c99']) - Export(env = host_env) + target_env = env + env = host_env + Export('env') SConscript( 'src/SConscript', @@ -161,6 +163,8 @@ if env['crosscompile'] and env['platform'] != 'embedded': duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html ) + env = target_env + Export('env') ####################################################################### diff --git a/mesalib/common.py b/mesalib/common.py index 4f1fef81b..6130e6110 100644 --- a/mesalib/common.py +++ b/mesalib/common.py @@ -30,6 +30,7 @@ _machine_map = { 'i586': 'x86', 'i686': 'x86', 'ppc' : 'ppc', + 'AMD64': 'x86_64', 'x86_64': 'x86_64', } diff --git a/mesalib/docs/envvars.html b/mesalib/docs/envvars.html index fd1700a02..5240c803f 100644 --- a/mesalib/docs/envvars.html +++ b/mesalib/docs/envvars.html @@ -1,78 +1,155 @@ - - -Environment Variables - - - - - -

Environment Variables

- -

-Mesa supports the following environment variables: -

-
    -
  • MESA_NO_ASM - if set, disables all assembly language optimizations -
  • MESA_NO_MMX - if set, disables Intel MMX optimizations -
  • MESA_NO_3DNOW - if set, disables AMD 3DNow! optimizations -
  • MESA_NO_SSE - if set, disables Intel SSE optimizations -
  • MESA_DEBUG - if set, error messages are printed to stderr. -If the value of MESA_DEBUG is "FP" floating point arithmetic errors will -generate exceptions. -
  • MESA_NO_DITHER - if set, disables dithering, overriding glEnable(GL_DITHER) -
  • MESA_TEX_PROG - if set, implement conventional texture env modes with -fragment programs (intended for developers only) -
  • MESA_TNL_PROG - if set, implement conventional vertex transformation -operations with vertex programs (intended for developers only). -Setting this variable automatically sets the MESA_TEX_PROG variable as well. -
  • MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions. -A value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension -and disable the GL_EXT_bar extension. -
  • MESA_GLSL - shading language options -
- -

-The following are only applicable to the Xlib software driver. -See the Xlib software driver page for details. -

-
    -
  • MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode -
  • MESA_CI_VISUAL - specifies the X visual and depth for CI mode -
  • MESA_BACK_BUFFER - specifies how to implement the back color buffer, - either "pixmap" or "ximage" -
  • MESA_GAMMA - gamma correction coefficients for red, green, blue channels -
  • MESA_XSYNC - enable synchronous X behavior (for debugging only) -
  • MESA_GLX_FORCE_CI - if set, force GLX to treat 8bpp visuals as CI visuals -
  • MESA_GLX_FX - set to either "fullscreen" for full-screen rendering, - "window" to render into a window, or "disable" to disable the Glide driver. -
  • MESA_GLX_FORCE_ALPHA - if set, forces RGB windows to have an alpha channel. -
  • MESA_GLX_DEPTH_BITS - specifies default number of bits for depth buffer. -
  • MESA_GLX_ALPHA_BITS - specifies default number of bits for alpha channel. -
- - -

-These environment variables are for the Intel i945/i965 drivers: -

-
    -
  • INTEL_STRICT_CONFORMANCE - if set to 1, enable sw fallbacks to improve - OpenGL conformance. If set to 2, always use software rendering. -
  • INTEL_NO_BLIT - if set, disable hardware-accelerated glBitmap, - glCopyPixels, glDrawPixels. -
- - -

-These environment variables are for the Radeon R300 driver: -

-
    -
  • R300_NO_TCL - if set, disable hardware-accelerated Transform/Clip/Lighting. -
- -

-Mesa EGL supports different sets of environment variables. See the -Mesa EGL page for the details. -

- - - + + +Environment Variables + + + + + +

Environment Variables

+ +

+Normally, no environment variables need to be set. Most of the environment +variables used by Mesa/Gallium are for debugging purposes, but they can +sometimes be useful for debugging end-user issues. +

+ + +

LibGL environment variables

+ +
    +
  • LIBGL_DEBUG - If defined debug information will be printed to stderr. + If set to 'verbose' additional information will be printed. +
  • LIBGL_DRIVERS_PATH - colon-separated list of paths to search for DRI drivers +
  • LIBGL_ALWAYS_INDIRECT - forces an indirect rendering context/connection. +
  • LIBGL_ALWAYS_SOFTWARE - if set, always use software rendering +
  • LIBGL_NO_DRAWARRAYS - if set do not use DrawArrays GLX protocol (for debugging) +
+ + + +

Core Mesa environment variables

+ +
    +
  • MESA_NO_ASM - if set, disables all assembly language optimizations +
  • MESA_NO_MMX - if set, disables Intel MMX optimizations +
  • MESA_NO_3DNOW - if set, disables AMD 3DNow! optimizations +
  • MESA_NO_SSE - if set, disables Intel SSE optimizations +
  • MESA_DEBUG - if set, error messages are printed to stderr. For example, + if the application generates a GL_INVALID_ENUM error, a corresponding error + message indicating where the error occured, and possibly why, will be + printed to stderr.
    + If the value of MESA_DEBUG is 'FP' floating point arithmetic errors will + generate exceptions. +
  • MESA_TEX_PROG - if set, implement conventional texture env modes with +fragment programs (intended for developers only) +
  • MESA_TNL_PROG - if set, implement conventional vertex transformation +operations with vertex programs (intended for developers only). +Setting this variable automatically sets the MESA_TEX_PROG variable as well. +
  • MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions. +A value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension +and disable the GL_EXT_bar extension. +
  • MESA_GLSL - shading language compiler options +
+ + +

Mesa Xlib driver environment variables

+ +

+The following are only applicable to the Mesa Xlib software driver. +See the Xlib software driver page for details. +

+
    +
  • MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode +
  • MESA_CI_VISUAL - specifies the X visual and depth for CI mode +
  • MESA_BACK_BUFFER - specifies how to implement the back color buffer, + either "pixmap" or "ximage" +
  • MESA_GAMMA - gamma correction coefficients for red, green, blue channels +
  • MESA_XSYNC - enable synchronous X behavior (for debugging only) +
  • MESA_GLX_FORCE_CI - if set, force GLX to treat 8bpp visuals as CI visuals +
  • MESA_GLX_FX - set to either "fullscreen" for full-screen rendering, + "window" to render into a window, or "disable" to disable the Glide driver. +
  • MESA_GLX_FORCE_ALPHA - if set, forces RGB windows to have an alpha channel. +
  • MESA_GLX_DEPTH_BITS - specifies default number of bits for depth buffer. +
  • MESA_GLX_ALPHA_BITS - specifies default number of bits for alpha channel. +
+ + +

i945/i965 driver environment variables (non-Gallium)

+ +
    +
  • INTEL_STRICT_CONFORMANCE - if set to 1, enable sw fallbacks to improve + OpenGL conformance. If set to 2, always use software rendering. +
  • INTEL_NO_BLIT - if set, disable hardware-accelerated glBitmap, + glCopyPixels, glDrawPixels. +
+ + +

Radeon R300 driver environment variables (non-Gallium)

+ +
    +
  • R300_NO_TCL - if set, disable hardware-accelerated Transform/Clip/Lighting. +
+ + +

EGL environment variables

+ +

+Mesa EGL supports different sets of environment variables. See the +Mesa EGL page for the details. +

+ + +

Gallium environment variables

+ +
    +
  • GALLIUM_PRINT_OPTIONS - if non-zero, print all the Gallium environment + variables which are used, and their current values. +
  • GALLIUM_NOSSE - if non-zero, do not use SSE runtime code generation for + shader execution +
  • GALLIUM_NOPPC - if non-zero, do not use PPC runtime code generation for + shader execution +
  • GALLIUM_DUMP_CPU - if non-zero, print information about the CPU on start-up +
  • TGSI_PRINT_SANITY - if set, do extra sanity checking on TGSI shaders and + print any errors to stderr. +
  • DRAW_FSE - ??? +
  • DRAW_NO_FSE - ??? +
  • DRAW_USE_LLVM - if set to zero, the draw module will not use LLVM to execute + shaders, vertex fetch, etc. +
+ +

Softpipe driver environment variables

+
    +
  • SOFTPIPE_DUMP_FS - if set, the softpipe driver will print fragment shaders + to stderr +
  • SOFTPIPE_DUMP_GS - if set, the softpipe driver will print geometry shaders + to stderr +
  • SOFTPIPE_NO_RAST - if set, rasterization is no-op'd. For profiling purposes. +
+ + +

LLVMpipe driver environment variables

+
    +
  • LP_NO_RAST - if set LLVMpipe will no-op rasterization +
  • LP_DEBUG - a comma-separated list of debug options is acceptec. See the + source code for details. +
  • LP_PERF - a comma-separated list of options to selectively no-op various + parts of the driver. See the source code for details. +
  • LP_NUM_THREADS - an integer indicating how many threads to use for rendering. + Zero turns of threading completely. The default value is the number of CPU + cores present. +
+ + +

+Other Gallium drivers have their own environment variables. These may change +frequently so the source code should be consulted for details. +

+ + +
+
+ + + + diff --git a/mesalib/docs/shading.html b/mesalib/docs/shading.html index c41d4a9be..cc1f9f1ec 100644 --- a/mesalib/docs/shading.html +++ b/mesalib/docs/shading.html @@ -1,268 +1,268 @@ - - -Shading Language Support - - - - - -

Shading Language Support

- -

-This page describes the features and status of Mesa's support for the - -OpenGL Shading Language. -

- -

-Contents -

- - - - - -

Environment Variables

- -

-The MESA_GLSL environment variable can be set to a comma-separated -list of keywords to control some aspects of the GLSL compiler and shader -execution. These are generally used for debugging. -

-
    -
  • dump - print GLSL shader code to stdout at link time -
  • log - log all GLSL shaders to files. - The filenames will be "shader_X.vert" or "shader_X.frag" where X - the shader ID. -
  • nopt - disable compiler optimizations -
  • opt - force compiler optimizations -
  • uniform - print message to stdout when glUniform is called -
  • nopvert - force vertex shaders to be a simple shader that just transforms - the vertex position with ftransform() and passes through the color and - texcoord[0] attributes. -
  • nopfrag - force fragment shader to be a simple shader that passes - through the color attribute. -
  • useprog - log glUseProgram calls to stderr -
-

-Example: export MESA_GLSL=dump,nopt -

- - -
-

GLSL Version

- -

-The GLSL compiler currently supports version 1.20 of the shading language. -

- -

-Several GLSL extensions are also supported: -

-
    -
  • GL_ARB_draw_buffers -
  • GL_ARB_texture_rectangle -
  • GL_ARB_fragment_coord_conventions -
  • GL_EXT_texture_array -
- - -
-

Unsupported Features

- -

XXX update this section

- -

-The following features of the shading language are not yet fully supported -in Mesa: -

- -
    -
  • Linking of multiple shaders does not always work. Currently, linking - is implemented through shader concatenation and re-compiling. This - doesn't always work because of some #pragma and preprocessor issues. -
  • gl_ClipVertex -
  • The gl_Color and gl_SecondaryColor varying vars are interpolated - without perspective correction -
- -

-All other major features of the shading language should function. -

- - -
-

Implementation Notes

- -
    -
  • Shading language programs are compiled into low-level programs - very similar to those of GL_ARB_vertex/fragment_program. -
  • All vector types (vec2, vec3, vec4, bvec2, etc) currently occupy full - float[4] registers. -
  • Float constants and variables are packed so that up to four floats - can occupy one program parameter/register. -
  • All function calls are inlined. -
  • Shaders which use too many registers will not compile. -
  • The quality of generated code is pretty good, register usage is fair. -
  • Shader error detection and reporting of errors (InfoLog) is not - very good yet. -
  • The ftransform() function doesn't necessarily match the results of - fixed-function transformation. -
- -

-These issues will be addressed/resolved in the future. -

- - -
-

Programming Hints

- -
    -
  • Use the built-in library functions whenever possible. - For example, instead of writing this: -
    -        float x = 1.0 / sqrt(y);
    -
    - Write this: -
    -        float x = inversesqrt(y);
    -
    -
  • -
- - -
-

Stand-alone GLSL Compiler

- -

-The stand-alone GLSL compiler program can be used to compile GLSL shaders -into low-level GPU code. -

- -

-This tool is useful for: -

-

    -
  • Inspecting GPU code to gain insight into compilation -
  • Generating initial GPU code for subsequent hand-tuning -
  • Debugging the GLSL compiler itself -
- -

-After building Mesa, the compiler can be found at src/glsl/glsl_compiler -

- -

-Here's an example of using the compiler to compile a vertex shader and -emit GL_ARB_vertex_program-style instructions: -

-
-    src/glsl/glslcompiler --dump-ast myshader.vert
-
- -Options include -
    -
  • --dump-ast - dump GPU code -
  • --dump-hir - dump high-level IR code -
  • --dump-lir - dump low-level IR code -
  • --link - ??? -
- - - - -
-

Compiler Implementation

- -

-The source code for Mesa's shading language compiler is in the -src/glsl/ directory. -

- -

-XXX provide some info about the compiler.... -

- -

-The final vertex and fragment programs may be interpreted in software -(see prog_execute.c) or translated into a specific hardware architecture -(see drivers/dri/i915/i915_fragprog.c for example). -

- -

Code Generation Options

- -

-Internally, there are several options that control the compiler's code -generation and instruction selection. -These options are seen in the gl_shader_state struct and may be set -by the device driver to indicate its preferences: - -

-struct gl_shader_state
-{
-   ...
-   /** Driver-selectable options: */
-   GLboolean EmitHighLevelInstructions;
-   GLboolean EmitCondCodes;
-   GLboolean EmitComments;
-};
-
- -
    -
  • EmitHighLevelInstructions -
    -This option controls instruction selection for loops and conditionals. -If the option is set high-level IF/ELSE/ENDIF, LOOP/ENDLOOP, CONT/BRK -instructions will be emitted. -Otherwise, those constructs will be implemented with BRA instructions. -
  • - -
  • EmitCondCodes -
    -If set, condition codes (ala GL_NV_fragment_program) will be used for -branching and looping. -Otherwise, ordinary registers will be used (the IF instruction will -examine the first operand's X component and do the if-part if non-zero). -This option is only relevant if EmitHighLevelInstructions is set. -
  • - -
  • EmitComments -
    -If set, instructions will be annoted with comments to help with debugging. -Extra NOP instructions will also be inserted. -
    - -
- - -
-

Compiler Validation

- -

-Developers working on the GLSL compiler should test frequently to avoid -regressions. -

- -

-The Piglit project -has many GLSL tests and the -Glean glsl1 test -tests GLSL features. -

- -

-The Mesa demos repository also has some good GLSL tests. -

- - - + + +Shading Language Support + + + + + +

Shading Language Support

+ +

+This page describes the features and status of Mesa's support for the + +OpenGL Shading Language. +

+ +

+Contents +

+ + + + + +

Environment Variables

+ +

+The MESA_GLSL environment variable can be set to a comma-separated +list of keywords to control some aspects of the GLSL compiler and shader +execution. These are generally used for debugging. +

+
    +
  • dump - print GLSL shader code to stdout at link time +
  • log - log all GLSL shaders to files. + The filenames will be "shader_X.vert" or "shader_X.frag" where X + the shader ID. +
  • nopt - disable compiler optimizations +
  • opt - force compiler optimizations +
  • uniform - print message to stdout when glUniform is called +
  • nopvert - force vertex shaders to be a simple shader that just transforms + the vertex position with ftransform() and passes through the color and + texcoord[0] attributes. +
  • nopfrag - force fragment shader to be a simple shader that passes + through the color attribute. +
  • useprog - log glUseProgram calls to stderr +
+

+Example: export MESA_GLSL=dump,nopt +

+ + +
+

GLSL Version

+ +

+The GLSL compiler currently supports version 1.20 of the shading language. +

+ +

+Several GLSL extensions are also supported: +

+
    +
  • GL_ARB_draw_buffers +
  • GL_ARB_texture_rectangle +
  • GL_ARB_fragment_coord_conventions +
  • GL_EXT_texture_array +
+ + +
+

Unsupported Features

+ +

XXX update this section

+ +

+The following features of the shading language are not yet fully supported +in Mesa: +

+ +
    +
  • Linking of multiple shaders does not always work. Currently, linking + is implemented through shader concatenation and re-compiling. This + doesn't always work because of some #pragma and preprocessor issues. +
  • gl_ClipVertex +
  • The gl_Color and gl_SecondaryColor varying vars are interpolated + without perspective correction +
+ +

+All other major features of the shading language should function. +

+ + +
+

Implementation Notes

+ +
    +
  • Shading language programs are compiled into low-level programs + very similar to those of GL_ARB_vertex/fragment_program. +
  • All vector types (vec2, vec3, vec4, bvec2, etc) currently occupy full + float[4] registers. +
  • Float constants and variables are packed so that up to four floats + can occupy one program parameter/register. +
  • All function calls are inlined. +
  • Shaders which use too many registers will not compile. +
  • The quality of generated code is pretty good, register usage is fair. +
  • Shader error detection and reporting of errors (InfoLog) is not + very good yet. +
  • The ftransform() function doesn't necessarily match the results of + fixed-function transformation. +
+ +

+These issues will be addressed/resolved in the future. +

+ + +
+

Programming Hints

+ +
    +
  • Use the built-in library functions whenever possible. + For example, instead of writing this: +
    +        float x = 1.0 / sqrt(y);
    +
    + Write this: +
    +        float x = inversesqrt(y);
    +
    +
  • +
+ + +
+

Stand-alone GLSL Compiler

+ +

+The stand-alone GLSL compiler program can be used to compile GLSL shaders +into low-level GPU code. +

+ +

+This tool is useful for: +

+

    +
  • Inspecting GPU code to gain insight into compilation +
  • Generating initial GPU code for subsequent hand-tuning +
  • Debugging the GLSL compiler itself +
+ +

+After building Mesa, the compiler can be found at src/glsl/glsl_compiler +

+ +

+Here's an example of using the compiler to compile a vertex shader and +emit GL_ARB_vertex_program-style instructions: +

+
+    src/glsl/glsl_compiler --dump-ast myshader.vert
+
+ +Options include +
    +
  • --dump-ast - dump GPU code +
  • --dump-hir - dump high-level IR code +
  • --dump-lir - dump low-level IR code +
  • --link - ??? +
+ + + + +
+

Compiler Implementation

+ +

+The source code for Mesa's shading language compiler is in the +src/glsl/ directory. +

+ +

+XXX provide some info about the compiler.... +

+ +

+The final vertex and fragment programs may be interpreted in software +(see prog_execute.c) or translated into a specific hardware architecture +(see drivers/dri/i915/i915_fragprog.c for example). +

+ +

Code Generation Options

+ +

+Internally, there are several options that control the compiler's code +generation and instruction selection. +These options are seen in the gl_shader_state struct and may be set +by the device driver to indicate its preferences: + +

+struct gl_shader_state
+{
+   ...
+   /** Driver-selectable options: */
+   GLboolean EmitHighLevelInstructions;
+   GLboolean EmitCondCodes;
+   GLboolean EmitComments;
+};
+
+ +
    +
  • EmitHighLevelInstructions +
    +This option controls instruction selection for loops and conditionals. +If the option is set high-level IF/ELSE/ENDIF, LOOP/ENDLOOP, CONT/BRK +instructions will be emitted. +Otherwise, those constructs will be implemented with BRA instructions. +
  • + +
  • EmitCondCodes +
    +If set, condition codes (ala GL_NV_fragment_program) will be used for +branching and looping. +Otherwise, ordinary registers will be used (the IF instruction will +examine the first operand's X component and do the if-part if non-zero). +This option is only relevant if EmitHighLevelInstructions is set. +
  • + +
  • EmitComments +
    +If set, instructions will be annoted with comments to help with debugging. +Extra NOP instructions will also be inserted. +
    + +
+ + +
+

Compiler Validation

+ +

+Developers working on the GLSL compiler should test frequently to avoid +regressions. +

+ +

+The Piglit project +has many GLSL tests and the +Glean glsl1 test +tests GLSL features. +

+ +

+The Mesa demos repository also has some good GLSL tests. +

+ + + diff --git a/mesalib/docs/sourcetree.html b/mesalib/docs/sourcetree.html index 00dc4e7c9..67e0494b1 100644 --- a/mesalib/docs/sourcetree.html +++ b/mesalib/docs/sourcetree.html @@ -1,165 +1,166 @@ - - -Mesa Source Tree - - - - - -

Mesa source code tree overview

- -

-This is a brief summary of Mesa's directory tree and what's contained in -each directory. -

- - -
    -
  • docs - Documentation -
  • include - Public OpenGL header files -
  • src -
      -
    • egl - EGL library sources -
        -
      • docs - EGL documentation -
      • drivers - EGL drivers -
      • main - main EGL library implementation. This is where all - the EGL API functions are implemented, like eglCreateContext(). -
      -
    • mesa - Main Mesa sources -
        -
      • glapi - OpenGL API dispatch layer. This is where all the - GL entrypoints like glClear, glBegin, etc. are generated, as well as - the GL dispatch table. All GL function calls jump through the - dispatch table to functions found in main/. -
      • main - The core Mesa code (mainly state management) -
      • drivers - Mesa drivers (not used with Gallium) -
          -
        • common - code which may be shared by all drivers -
        • dri - Direct Rendering Infrastructure drivers -
            -
          • common - code shared by all DRI drivers -
          • i915 - driver for Intel i915/i945 -
          • i965 - driver for Intel i965 -
          • XXX more -
          -
        • x11 - Xlib-based software driver -
        • osmesa - off-screen software driver -
        • glslcompiler - a stand-alone GLSL compiler driver -
        • XXX more -
        -
      • es - OpenGL ES overlay, parallelly buildable with the core Mesa -
      • math - vertex array translation and transformation code - (not used with Gallium) -
      • ppc - Assembly code/optimizations for PPC systems - (not used with Gallium) -
      • shader - Vertex/fragment shader and GLSL compiler code -
      • sparc - Assembly code/optimizations for SPARC systems - (not used with Gallium) -
      • state_tracker - State tracker / driver for Gallium. This - is basically a Mesa device driver that speaks to Gallium. This - directory may be moved to src/mesa/drivers/gallium at some point. -
      • swrast - Software rasterization module. For drawing points, - lines, triangles, bitmaps, images, etc. in software. - (not used with Gallium) -
      • swrast_setup - Software primitive setup. Does things like - polygon culling, glPolygonMode, polygon offset, etc. - (not used with Gallium) -
      • tnl - Software vertex Transformation 'n Lighting. - (not used with Gallium) -
      • tnl_dd - TNL code for device drivers. - (not used with Gallium) -
      • vbo - Vertex Buffer Object code. All drawing with - glBegin/glEnd, glDrawArrays, display lists, etc. goes through this - module. The results is a well-defined set of vertex arrays which - are passed to the device driver (or tnl module) for rendering. -
      • vf - vertex format conversion (currently unused) -
      • x86 - Assembly code/optimizations for 32-bit x86 systems - (not used with Gallium) -
      • x86-64 - Assembly code/optimizations for 64-bit x86 systems - (not used with Gallium) -
      -
    • gallium - Gallium3D source code -
        -
      • include - Gallium3D header files which define the Gallium3D - interfaces -
      • drivers - Gallium3D device drivers -
          -
        • cell - Driver for Cell processor. -
        • i915 - Driver for Intel i915/i945. -
        • i965 - Driver for Intel i965. -
        • llvmpipe - Software driver using LLVM for runtime code generation. -
        • nv* - Drivers for NVIDIA GPUs. -
        • r300 - Driver for ATI/AMD R300. -
        • softpipe - Software reference driver. -
        • svga - Driver for VMware's SVGA virtual GPU. -
        • trace - Driver for tracing Gallium calls. -
        • XXX more -
        -
      • auxiliary - Gallium support code -
          -
        • draw - Software vertex processing and primitive assembly - module. This includes vertex program execution, clipping, culling - and optional stages for drawing wide lines, stippled lines, - polygon stippling, two-sided lighting, etc. - Intended for use by drivers for hardware that does not have - vertex shaders. - Geometry shaders will also be implemented in this module. -
        • cso_cache - Constant State Objects Cache. Used to filter out - redundant state changes between state trackers and drivers. -
        • gallivm - LLVM module for Gallium. For LLVM-based - compilation, optimization and code generation for TGSI shaders. - Incomplete. -
        • pipebuffer - utility module for managing buffers -
        • rbug - Gallium remote debug utility -
        • rtasm - run-time assembly/machine code generation. - Currently there's run-time code generation for x86/SSE, PowerPC - and Cell SPU. -
        • tgsi - TG Shader Infrastructure. Code for encoding, - manipulating and interpretting GPU programs. -
        • translate - module for translating vertex data from one format - to another. -
        • util - assorted utilities for arithmetic, hashing, surface - creation, memory management, 2D blitting, simple rendering, etc. -
        -
      • state_trackers - -
          -
        • dri - Meta state tracker for DRI drivers -
        • egl - Meta state tracker for EGL drivers -
        • es - OpenGL ES 1.x and 2.x state trackers -
        • g3dvl - -
        • glx - Meta state tracker for GLX -
        • python - -
        • vega - OpenVG 1.x state tracker -
        • wgl - -
        • xorg - Meta state tracker for Xorg video drivers -
        -
      • winsys - -
          -
        • drm - -
        • g3dvl - -
        • gdi - -
        • xlib - -
        -
      -
    -
      -
    • glu - The OpenGL Utility library -
        -
      • sgi - GLU from SGI -
      • mesa - Mesa version of GLU (deprecated) -
      -
    • glut - Mark Kilgard's OpenGL OpenGL Utility Toolkit library -
    • glx - The GLX library code for building libGL. This is used for - direct rendering drivers. It will dynamically load one of the - xxx_dri.so drivers. -
    • glw - Widgets for Xt/Motif. -
    • glew - OpenGL Extension Wrangler library (used by demo programs) -
    -
  • progs - OpenGL test and demonstration programs -
  • lib - where the GL libraries are placed -
- - - - + + +Mesa Source Tree + + + + + +

Mesa source code tree overview

+ +

+This is a brief summary of Mesa's directory tree and what's contained in +each directory. +

+ + +
    +
  • docs - Documentation +
  • include - Public OpenGL header files +
  • src +
      +
    • egl - EGL library sources +
        +
      • docs - EGL documentation +
      • drivers - EGL drivers +
      • glsl - the GLSL compiler +
      • main - main EGL library implementation. This is where all + the EGL API functions are implemented, like eglCreateContext(). +
      +
    • mesa - Main Mesa sources +
        +
      • glapi - OpenGL API dispatch layer. This is where all the + GL entrypoints like glClear, glBegin, etc. are generated, as well as + the GL dispatch table. All GL function calls jump through the + dispatch table to functions found in main/. +
      • main - The core Mesa code (mainly state management) +
      • drivers - Mesa drivers (not used with Gallium) +
          +
        • common - code which may be shared by all drivers +
        • dri - Direct Rendering Infrastructure drivers +
            +
          • common - code shared by all DRI drivers +
          • i915 - driver for Intel i915/i945 +
          • i965 - driver for Intel i965 +
          • XXX more +
          +
        • x11 - Xlib-based software driver +
        • osmesa - off-screen software driver +
        • glslcompiler - a stand-alone GLSL compiler driver +
        • XXX more +
        +
      • es - OpenGL ES overlay, parallelly buildable with the core Mesa +
      • math - vertex array translation and transformation code + (not used with Gallium) +
      • ppc - Assembly code/optimizations for PPC systems + (not used with Gallium) +
      • shader - Vertex/fragment shader and GLSL compiler code +
      • sparc - Assembly code/optimizations for SPARC systems + (not used with Gallium) +
      • state_tracker - State tracker / driver for Gallium. This + is basically a Mesa device driver that speaks to Gallium. This + directory may be moved to src/mesa/drivers/gallium at some point. +
      • swrast - Software rasterization module. For drawing points, + lines, triangles, bitmaps, images, etc. in software. + (not used with Gallium) +
      • swrast_setup - Software primitive setup. Does things like + polygon culling, glPolygonMode, polygon offset, etc. + (not used with Gallium) +
      • tnl - Software vertex Transformation 'n Lighting. + (not used with Gallium) +
      • tnl_dd - TNL code for device drivers. + (not used with Gallium) +
      • vbo - Vertex Buffer Object code. All drawing with + glBegin/glEnd, glDrawArrays, display lists, etc. goes through this + module. The results is a well-defined set of vertex arrays which + are passed to the device driver (or tnl module) for rendering. +
      • vf - vertex format conversion (currently unused) +
      • x86 - Assembly code/optimizations for 32-bit x86 systems + (not used with Gallium) +
      • x86-64 - Assembly code/optimizations for 64-bit x86 systems + (not used with Gallium) +
      +
    • gallium - Gallium3D source code +
        +
      • include - Gallium3D header files which define the Gallium3D + interfaces +
      • drivers - Gallium3D device drivers +
          +
        • cell - Driver for Cell processor. +
        • i915 - Driver for Intel i915/i945. +
        • i965 - Driver for Intel i965. +
        • llvmpipe - Software driver using LLVM for runtime code generation. +
        • nv* - Drivers for NVIDIA GPUs. +
        • r300 - Driver for ATI/AMD R300. +
        • softpipe - Software reference driver. +
        • svga - Driver for VMware's SVGA virtual GPU. +
        • trace - Driver for tracing Gallium calls. +
        • XXX more +
        +
      • auxiliary - Gallium support code +
          +
        • draw - Software vertex processing and primitive assembly + module. This includes vertex program execution, clipping, culling + and optional stages for drawing wide lines, stippled lines, + polygon stippling, two-sided lighting, etc. + Intended for use by drivers for hardware that does not have + vertex shaders. + Geometry shaders will also be implemented in this module. +
        • cso_cache - Constant State Objects Cache. Used to filter out + redundant state changes between state trackers and drivers. +
        • gallivm - LLVM module for Gallium. For LLVM-based + compilation, optimization and code generation for TGSI shaders. + Incomplete. +
        • pipebuffer - utility module for managing buffers +
        • rbug - Gallium remote debug utility +
        • rtasm - run-time assembly/machine code generation. + Currently there's run-time code generation for x86/SSE, PowerPC + and Cell SPU. +
        • tgsi - TG Shader Infrastructure. Code for encoding, + manipulating and interpretting GPU programs. +
        • translate - module for translating vertex data from one format + to another. +
        • util - assorted utilities for arithmetic, hashing, surface + creation, memory management, 2D blitting, simple rendering, etc. +
        +
      • state_trackers - +
          +
        • dri - Meta state tracker for DRI drivers +
        • egl - Meta state tracker for EGL drivers +
        • es - OpenGL ES 1.x and 2.x state trackers +
        • g3dvl - +
        • glx - Meta state tracker for GLX +
        • python - +
        • vega - OpenVG 1.x state tracker +
        • wgl - +
        • xorg - Meta state tracker for Xorg video drivers +
        +
      • winsys - +
          +
        • drm - +
        • g3dvl - +
        • gdi - +
        • xlib - +
        +
      +
    +
      +
    • glu - The OpenGL Utility library +
        +
      • sgi - GLU from SGI +
      • mesa - Mesa version of GLU (deprecated) +
      +
    • glut - Mark Kilgard's OpenGL OpenGL Utility Toolkit library +
    • glx - The GLX library code for building libGL. This is used for + direct rendering drivers. It will dynamically load one of the + xxx_dri.so drivers. +
    • glw - Widgets for Xt/Motif. +
    • glew - OpenGL Extension Wrangler library (used by demo programs) +
    +
  • progs - OpenGL test and demonstration programs +
  • lib - where the GL libraries are placed +
+ + + + diff --git a/mesalib/scons/gallium.py b/mesalib/scons/gallium.py index ac8888cf6..46df7a899 100644 --- a/mesalib/scons/gallium.py +++ b/mesalib/scons/gallium.py @@ -195,7 +195,7 @@ def generate(env): # Determine whether we are cross compiling; in particular, whether we need # to compile code generators with a different compiler as the target code. host_platform = _platform.system().lower() - host_machine = os.environ.get('PROCESSOR_ARCHITECTURE', _platform.machine()) + host_machine = os.environ.get('PROCESSOR_ARCHITEW6432', os.environ.get('PROCESSOR_ARCHITECTURE', _platform.machine())) host_machine = { 'x86': 'x86', 'i386': 'x86', @@ -203,6 +203,7 @@ def generate(env): 'i586': 'x86', 'i686': 'x86', 'ppc' : 'ppc', + 'AMD64': 'x86_64', 'x86_64': 'x86_64', }.get(host_machine, 'generic') env['crosscompile'] = platform != host_platform diff --git a/mesalib/src/glsl/Makefile b/mesalib/src/glsl/Makefile index a017894ac..f964b7487 100644 --- a/mesalib/src/glsl/Makefile +++ b/mesalib/src/glsl/Makefile @@ -208,6 +208,6 @@ builtin_compiler: $(GLSL2_OBJECTS) $(OBJECTS) builtin_stubs.o builtin_function.cpp: builtins/profiles/* builtins/ir/* builtins/tools/generate_builtins.py builtins/tools/texture_builtins.py builtin_compiler @echo Regenerating builtin_function.cpp... - $(PYTHON2) $(PYTHON_FLAGS) builtins/tools/generate_builtins.py $(PWD)/builtin_compiler > builtin_function.cpp + $(PYTHON2) $(PYTHON_FLAGS) builtins/tools/generate_builtins.py ./builtin_compiler > builtin_function.cpp -include depend diff --git a/mesalib/src/mesa/main/debug.c b/mesalib/src/mesa/main/debug.c index c1118504f..e336b077e 100644 --- a/mesalib/src/mesa/main/debug.c +++ b/mesalib/src/mesa/main/debug.c @@ -1,612 +1,610 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 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. - */ - -#include "mtypes.h" -#include "attrib.h" -#include "colormac.h" -#include "enums.h" -#include "formats.h" -#include "hash.h" -#include "imports.h" -#include "debug.h" -#include "get.h" -#include "pixelstore.h" -#include "readpix.h" -#include "texobj.h" - - -static const char * -tex_target_name(GLenum tgt) -{ - static const struct { - GLenum target; - const char *name; - } tex_targets[] = { - { GL_TEXTURE_1D, "GL_TEXTURE_1D" }, - { GL_TEXTURE_2D, "GL_TEXTURE_2D" }, - { GL_TEXTURE_3D, "GL_TEXTURE_3D" }, - { GL_TEXTURE_CUBE_MAP, "GL_TEXTURE_CUBE_MAP" }, - { GL_TEXTURE_RECTANGLE, "GL_TEXTURE_RECTANGLE" }, - { GL_TEXTURE_1D_ARRAY_EXT, "GL_TEXTURE_1D_ARRAY" }, - { GL_TEXTURE_2D_ARRAY_EXT, "GL_TEXTURE_2D_ARRAY" } - }; - GLuint i; - for (i = 0; i < Elements(tex_targets); i++) { - if (tex_targets[i].target == tgt) - return tex_targets[i].name; - } - return "UNKNOWN TEX TARGET"; -} - - -void -_mesa_print_state( const char *msg, GLuint state ) -{ - _mesa_debug(NULL, - "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", - msg, - state, - (state & _NEW_MODELVIEW) ? "ctx->ModelView, " : "", - (state & _NEW_PROJECTION) ? "ctx->Projection, " : "", - (state & _NEW_TEXTURE_MATRIX) ? "ctx->TextureMatrix, " : "", - (state & _NEW_COLOR) ? "ctx->Color, " : "", - (state & _NEW_DEPTH) ? "ctx->Depth, " : "", - (state & _NEW_EVAL) ? "ctx->Eval/EvalMap, " : "", - (state & _NEW_FOG) ? "ctx->Fog, " : "", - (state & _NEW_HINT) ? "ctx->Hint, " : "", - (state & _NEW_LIGHT) ? "ctx->Light, " : "", - (state & _NEW_LINE) ? "ctx->Line, " : "", - (state & _NEW_PIXEL) ? "ctx->Pixel, " : "", - (state & _NEW_POINT) ? "ctx->Point, " : "", - (state & _NEW_POLYGON) ? "ctx->Polygon, " : "", - (state & _NEW_POLYGONSTIPPLE) ? "ctx->PolygonStipple, " : "", - (state & _NEW_SCISSOR) ? "ctx->Scissor, " : "", - (state & _NEW_STENCIL) ? "ctx->Stencil, " : "", - (state & _NEW_TEXTURE) ? "ctx->Texture, " : "", - (state & _NEW_TRANSFORM) ? "ctx->Transform, " : "", - (state & _NEW_VIEWPORT) ? "ctx->Viewport, " : "", - (state & _NEW_PACKUNPACK) ? "ctx->Pack/Unpack, " : "", - (state & _NEW_ARRAY) ? "ctx->Array, " : "", - (state & _NEW_RENDERMODE) ? "ctx->RenderMode, " : "", - (state & _NEW_BUFFERS) ? "ctx->Visual, ctx->DrawBuffer,, " : ""); -} - - - -void -_mesa_print_tri_caps( const char *name, GLuint flags ) -{ - _mesa_debug(NULL, - "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s\n", - name, - flags, - (flags & DD_FLATSHADE) ? "flat-shade, " : "", - (flags & DD_SEPARATE_SPECULAR) ? "separate-specular, " : "", - (flags & DD_TRI_LIGHT_TWOSIDE) ? "tri-light-twoside, " : "", - (flags & DD_TRI_TWOSTENCIL) ? "tri-twostencil, " : "", - (flags & DD_TRI_UNFILLED) ? "tri-unfilled, " : "", - (flags & DD_TRI_STIPPLE) ? "tri-stipple, " : "", - (flags & DD_TRI_OFFSET) ? "tri-offset, " : "", - (flags & DD_TRI_SMOOTH) ? "tri-smooth, " : "", - (flags & DD_LINE_SMOOTH) ? "line-smooth, " : "", - (flags & DD_LINE_STIPPLE) ? "line-stipple, " : "", - (flags & DD_POINT_SMOOTH) ? "point-smooth, " : "", - (flags & DD_POINT_ATTEN) ? "point-atten, " : "", - (flags & DD_TRI_CULL_FRONT_BACK) ? "cull-all, " : "" - ); -} - - -/** - * Print information about this Mesa version and build options. - */ -void _mesa_print_info( void ) -{ - _mesa_debug(NULL, "Mesa GL_VERSION = %s\n", - (char *) _mesa_GetString(GL_VERSION)); - _mesa_debug(NULL, "Mesa GL_RENDERER = %s\n", - (char *) _mesa_GetString(GL_RENDERER)); - _mesa_debug(NULL, "Mesa GL_VENDOR = %s\n", - (char *) _mesa_GetString(GL_VENDOR)); - _mesa_debug(NULL, "Mesa GL_EXTENSIONS = %s\n", - (char *) _mesa_GetString(GL_EXTENSIONS)); -#if defined(THREADS) - _mesa_debug(NULL, "Mesa thread-safe: YES\n"); -#else - _mesa_debug(NULL, "Mesa thread-safe: NO\n"); -#endif -#if defined(USE_X86_ASM) - _mesa_debug(NULL, "Mesa x86-optimized: YES\n"); -#else - _mesa_debug(NULL, "Mesa x86-optimized: NO\n"); -#endif -#if defined(USE_SPARC_ASM) - _mesa_debug(NULL, "Mesa sparc-optimized: YES\n"); -#else - _mesa_debug(NULL, "Mesa sparc-optimized: NO\n"); -#endif -} - - -/** - * Set the debugging flags. - * - * \param debug debug string - * - * If compiled with debugging support then search for keywords in \p debug and - * enables the verbose debug output of the respective feature. - */ -static void add_debug_flags( const char *debug ) -{ -#ifdef DEBUG - struct debug_option { - const char *name; - GLbitfield flag; - }; - static const struct debug_option debug_opt[] = { - { "varray", VERBOSE_VARRAY }, - { "tex", VERBOSE_TEXTURE }, - { "mat", VERBOSE_MATERIAL }, - { "pipe", VERBOSE_PIPELINE }, - { "driver", VERBOSE_DRIVER }, - { "state", VERBOSE_STATE }, - { "api", VERBOSE_API }, - { "list", VERBOSE_DISPLAY_LIST }, - { "lighting", VERBOSE_LIGHTING }, - { "disassem", VERBOSE_DISASSEM }, - { "draw", VERBOSE_DRAW }, - { "swap", VERBOSE_SWAPBUFFERS } - }; - GLuint i; - - MESA_VERBOSE = 0x0; - for (i = 0; i < Elements(debug_opt); i++) { - if (strstr(debug, debug_opt[i].name)) - MESA_VERBOSE |= debug_opt[i].flag; - } - - /* Debug flag: - */ - if (strstr(debug, "flush")) - MESA_DEBUG_FLAGS |= DEBUG_ALWAYS_FLUSH; - -#if defined(_FPU_GETCW) && defined(_FPU_SETCW) - if (strstr(debug, "fpexceptions")) { - /* raise FP exceptions */ - fpu_control_t mask; - _FPU_GETCW(mask); - mask &= ~(_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM - | _FPU_MASK_OM | _FPU_MASK_UM); - _FPU_SETCW(mask); - } -#endif - -#else - (void) debug; -#endif -} - - -void -_mesa_init_debug( struct gl_context *ctx ) -{ - char *c; - - /* Dither disable */ - ctx->NoDither = _mesa_getenv("MESA_NO_DITHER") ? GL_TRUE : GL_FALSE; - if (ctx->NoDither) { - if (_mesa_getenv("MESA_DEBUG")) { - _mesa_debug(ctx, "MESA_NO_DITHER set - dithering disabled\n"); - } - ctx->Color.DitherFlag = GL_FALSE; - } - - c = _mesa_getenv("MESA_DEBUG"); - if (c) - add_debug_flags(c); - - c = _mesa_getenv("MESA_VERBOSE"); - if (c) - add_debug_flags(c); -} - - -/* - * Write ppm file - */ -static void -write_ppm(const char *filename, const GLubyte *buffer, int width, int height, - int comps, int rcomp, int gcomp, int bcomp, GLboolean invert) -{ - FILE *f = fopen( filename, "w" ); - if (f) { - int x, y; - const GLubyte *ptr = buffer; - fprintf(f,"P6\n"); - fprintf(f,"# ppm-file created by osdemo.c\n"); - fprintf(f,"%i %i\n", width,height); - fprintf(f,"255\n"); - fclose(f); - f = fopen( filename, "ab" ); /* reopen in binary append mode */ - for (y=0; y < height; y++) { - for (x = 0; x < width; x++) { - int yy = invert ? (height - 1 - y) : y; - int i = (yy * width + x) * comps; - fputc(ptr[i+rcomp], f); /* write red */ - fputc(ptr[i+gcomp], f); /* write green */ - fputc(ptr[i+bcomp], f); /* write blue */ - } - } - fclose(f); - } -} - - -/** - * Write a texture image to a ppm file. - * \param face cube face in [0,5] - * \param level mipmap level - */ -static void -write_texture_image(struct gl_texture_object *texObj, - GLuint face, GLuint level) -{ - struct gl_texture_image *img = texObj->Image[face][level]; - if (img) { - GET_CURRENT_CONTEXT(ctx); - struct gl_pixelstore_attrib store; - GLubyte *buffer; - char s[100]; - - buffer = (GLubyte *) malloc(img->Width * img->Height - * img->Depth * 4); - - store = ctx->Pack; /* save */ - ctx->Pack = ctx->DefaultPacking; - - ctx->Driver.GetTexImage(ctx, texObj->Target, level, - GL_RGBA, GL_UNSIGNED_BYTE, - buffer, texObj, img); - - /* make filename */ - _mesa_snprintf(s, sizeof(s), "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face); - - printf(" Writing image level %u to %s\n", level, s); - write_ppm(s, buffer, img->Width, img->Height, 4, 0, 1, 2, GL_FALSE); - - ctx->Pack = store; /* restore */ - - free(buffer); - } -} - - -/** - * Write renderbuffer image to a ppm file. - */ -static void -write_renderbuffer_image(const struct gl_renderbuffer *rb) -{ - GET_CURRENT_CONTEXT(ctx); - GLubyte *buffer; - char s[100]; - GLenum format, type; - - if (rb->_BaseFormat == GL_RGB || - rb->_BaseFormat == GL_RGBA) { - format = GL_RGBA; - type = GL_UNSIGNED_BYTE; - } - else if (rb->_BaseFormat == GL_DEPTH_STENCIL) { - format = GL_DEPTH_STENCIL; - type = GL_UNSIGNED_INT_24_8; - } - else { - return; - } - - buffer = (GLubyte *) malloc(rb->Width * rb->Height * 4); - - ctx->Driver.ReadPixels(ctx, 0, 0, rb->Width, rb->Height, - format, type, &ctx->DefaultPacking, buffer); - - /* make filename */ - _mesa_snprintf(s, sizeof(s), "/tmp/renderbuffer%u.ppm", rb->Name); - - printf(" Writing renderbuffer image to %s\n", s); - write_ppm(s, buffer, rb->Width, rb->Height, 4, 0, 1, 2, GL_TRUE); - - free(buffer); -} - - -/** How many texture images (mipmap levels, faces) to write to files */ -#define WRITE_NONE 0 -#define WRITE_ONE 1 -#define WRITE_ALL 2 - -static GLuint WriteImages; - - -static void -dump_texture(struct gl_texture_object *texObj, GLuint writeImages) -{ - const GLuint numFaces = texObj->Target == GL_TEXTURE_CUBE_MAP ? 6 : 1; - GLboolean written = GL_FALSE; - GLuint i, j; - - printf("Texture %u\n", texObj->Name); - printf(" Target %s\n", tex_target_name(texObj->Target)); - for (i = 0; i < MAX_TEXTURE_LEVELS; i++) { - for (j = 0; j < numFaces; j++) { - struct gl_texture_image *texImg = texObj->Image[j][i]; - if (texImg) { - printf(" Face %u level %u: %d x %d x %d, format %s at %p\n", - j, i, - texImg->Width, texImg->Height, texImg->Depth, - _mesa_get_format_name(texImg->TexFormat), - texImg->Data); - if (writeImages == WRITE_ALL || - (writeImages == WRITE_ONE && !written)) { - write_texture_image(texObj, j, i); - written = GL_TRUE; - } - } - } - } -} - - -/** - * Dump a single texture. - */ -void -_mesa_dump_texture(GLuint texture, GLuint writeImages) -{ - GET_CURRENT_CONTEXT(ctx); - struct gl_texture_object *texObj = _mesa_lookup_texture(ctx, texture); - if (texObj) { - dump_texture(texObj, writeImages); - } -} - - -static void -dump_texture_cb(GLuint id, void *data, void *userData) -{ - struct gl_texture_object *texObj = (struct gl_texture_object *) data; - (void) userData; - dump_texture(texObj, WriteImages); -} - - -/** - * Print basic info about all texture objext to stdout. - * If dumpImages is true, write PPM of level[0] image to a file. - */ -void -_mesa_dump_textures(GLuint writeImages) -{ - GET_CURRENT_CONTEXT(ctx); - WriteImages = writeImages; - _mesa_HashWalk(ctx->Shared->TexObjects, dump_texture_cb, ctx); -} - - -static void -dump_renderbuffer(const struct gl_renderbuffer *rb, GLboolean writeImage) -{ - printf("Renderbuffer %u: %u x %u IntFormat = %s\n", - rb->Name, rb->Width, rb->Height, - _mesa_lookup_enum_by_nr(rb->InternalFormat)); - if (writeImage) { - write_renderbuffer_image(rb); - } -} - - -static void -dump_renderbuffer_cb(GLuint id, void *data, void *userData) -{ - const struct gl_renderbuffer *rb = (const struct gl_renderbuffer *) data; - (void) userData; - dump_renderbuffer(rb, WriteImages); -} - - -/** - * Print basic info about all renderbuffers to stdout. - * If dumpImages is true, write PPM of level[0] image to a file. - */ -void -_mesa_dump_renderbuffers(GLboolean writeImages) -{ - GET_CURRENT_CONTEXT(ctx); - WriteImages = writeImages; - _mesa_HashWalk(ctx->Shared->RenderBuffers, dump_renderbuffer_cb, ctx); -} - - - -void -_mesa_dump_color_buffer(const char *filename) -{ - GET_CURRENT_CONTEXT(ctx); - const GLuint w = ctx->DrawBuffer->Width; - const GLuint h = ctx->DrawBuffer->Height; - GLubyte *buf; - - buf = (GLubyte *) malloc(w * h * 4); - - _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); - _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1); - _mesa_PixelStorei(GL_PACK_INVERT_MESA, GL_TRUE); - - _mesa_ReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, buf); - - printf("ReadBuffer %p 0x%x DrawBuffer %p 0x%x\n", - (void *) ctx->ReadBuffer->_ColorReadBuffer, - ctx->ReadBuffer->ColorReadBuffer, - (void *) ctx->DrawBuffer->_ColorDrawBuffers[0], - ctx->DrawBuffer->ColorDrawBuffer[0]); - printf("Writing %d x %d color buffer to %s\n", w, h, filename); - write_ppm(filename, buf, w, h, 4, 0, 1, 2, GL_TRUE); - - _mesa_PopClientAttrib(); - - free(buf); -} - - -void -_mesa_dump_depth_buffer(const char *filename) -{ - GET_CURRENT_CONTEXT(ctx); - const GLuint w = ctx->DrawBuffer->Width; - const GLuint h = ctx->DrawBuffer->Height; - GLuint *buf; - GLubyte *buf2; - GLuint i; - - buf = (GLuint *) malloc(w * h * 4); /* 4 bpp */ - buf2 = (GLubyte *) malloc(w * h * 3); /* 3 bpp */ - - _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); - _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1); - _mesa_PixelStorei(GL_PACK_INVERT_MESA, GL_TRUE); - - _mesa_ReadPixels(0, 0, w, h, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, buf); - - /* spread 24 bits of Z across R, G, B */ - for (i = 0; i < w * h; i++) { - buf2[i*3+0] = (buf[i] >> 24) & 0xff; - buf2[i*3+1] = (buf[i] >> 16) & 0xff; - buf2[i*3+2] = (buf[i] >> 8) & 0xff; - } - - printf("Writing %d x %d depth buffer to %s\n", w, h, filename); - write_ppm(filename, buf2, w, h, 3, 0, 1, 2, GL_TRUE); - - _mesa_PopClientAttrib(); - - free(buf); - free(buf2); -} - - -void -_mesa_dump_stencil_buffer(const char *filename) -{ - GET_CURRENT_CONTEXT(ctx); - const GLuint w = ctx->DrawBuffer->Width; - const GLuint h = ctx->DrawBuffer->Height; - GLubyte *buf; - GLubyte *buf2; - GLuint i; - - buf = (GLubyte *) malloc(w * h); /* 1 bpp */ - buf2 = (GLubyte *) malloc(w * h * 3); /* 3 bpp */ - - _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); - _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1); - _mesa_PixelStorei(GL_PACK_INVERT_MESA, GL_TRUE); - - _mesa_ReadPixels(0, 0, w, h, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, buf); - - for (i = 0; i < w * h; i++) { - buf2[i*3+0] = buf[i]; - buf2[i*3+1] = (buf[i] & 127) * 2; - buf2[i*3+2] = (buf[i] - 128) * 2; - } - - printf("Writing %d x %d stencil buffer to %s\n", w, h, filename); - write_ppm(filename, buf2, w, h, 3, 0, 1, 2, GL_TRUE); - - _mesa_PopClientAttrib(); - - free(buf); - free(buf2); -} - - -/** - * Quick and dirty function to "print" a texture to stdout. - */ -void -_mesa_print_texture(struct gl_context *ctx, const struct gl_texture_image *img) -{ -#if CHAN_TYPE != GL_UNSIGNED_BYTE - _mesa_problem(NULL, "PrintTexture not supported"); -#else - GLuint i, j, c; - const GLubyte *data = (const GLubyte *) img->Data; - - if (!data) { - printf("No texture data\n"); - return; - } - - /* XXX add more formats or make into a new format utility function */ - switch (img->TexFormat) { - case MESA_FORMAT_A8: - case MESA_FORMAT_L8: - case MESA_FORMAT_I8: - case MESA_FORMAT_CI8: - c = 1; - break; - case MESA_FORMAT_AL88: - case MESA_FORMAT_AL88_REV: - c = 2; - break; - case MESA_FORMAT_RGB888: - case MESA_FORMAT_BGR888: - c = 3; - break; - case MESA_FORMAT_RGBA8888: - case MESA_FORMAT_ARGB8888: - c = 4; - break; - default: - _mesa_problem(NULL, "error in PrintTexture\n"); - return; - } - - for (i = 0; i < img->Height; i++) { - for (j = 0; j < img->Width; j++) { - if (c==1) - printf("%02x ", data[0]); - else if (c==2) - printf("%02x%02x ", data[0], data[1]); - else if (c==3) - printf("%02x%02x%02x ", data[0], data[1], data[2]); - else if (c==4) - printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]); - data += (img->RowStride - img->Width) * c; - } - /* XXX use img->ImageStride here */ - printf("\n"); - } -#endif -} +/* + * Mesa 3-D graphics library + * Version: 6.5 + * + * Copyright (C) 1999-2005 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. + */ + +#include "mtypes.h" +#include "attrib.h" +#include "colormac.h" +#include "enums.h" +#include "formats.h" +#include "hash.h" +#include "imports.h" +#include "debug.h" +#include "get.h" +#include "pixelstore.h" +#include "readpix.h" +#include "texobj.h" + + +static const char * +tex_target_name(GLenum tgt) +{ + static const struct { + GLenum target; + const char *name; + } tex_targets[] = { + { GL_TEXTURE_1D, "GL_TEXTURE_1D" }, + { GL_TEXTURE_2D, "GL_TEXTURE_2D" }, + { GL_TEXTURE_3D, "GL_TEXTURE_3D" }, + { GL_TEXTURE_CUBE_MAP, "GL_TEXTURE_CUBE_MAP" }, + { GL_TEXTURE_RECTANGLE, "GL_TEXTURE_RECTANGLE" }, + { GL_TEXTURE_1D_ARRAY_EXT, "GL_TEXTURE_1D_ARRAY" }, + { GL_TEXTURE_2D_ARRAY_EXT, "GL_TEXTURE_2D_ARRAY" } + }; + GLuint i; + for (i = 0; i < Elements(tex_targets); i++) { + if (tex_targets[i].target == tgt) + return tex_targets[i].name; + } + return "UNKNOWN TEX TARGET"; +} + + +void +_mesa_print_state( const char *msg, GLuint state ) +{ + _mesa_debug(NULL, + "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", + msg, + state, + (state & _NEW_MODELVIEW) ? "ctx->ModelView, " : "", + (state & _NEW_PROJECTION) ? "ctx->Projection, " : "", + (state & _NEW_TEXTURE_MATRIX) ? "ctx->TextureMatrix, " : "", + (state & _NEW_COLOR) ? "ctx->Color, " : "", + (state & _NEW_DEPTH) ? "ctx->Depth, " : "", + (state & _NEW_EVAL) ? "ctx->Eval/EvalMap, " : "", + (state & _NEW_FOG) ? "ctx->Fog, " : "", + (state & _NEW_HINT) ? "ctx->Hint, " : "", + (state & _NEW_LIGHT) ? "ctx->Light, " : "", + (state & _NEW_LINE) ? "ctx->Line, " : "", + (state & _NEW_PIXEL) ? "ctx->Pixel, " : "", + (state & _NEW_POINT) ? "ctx->Point, " : "", + (state & _NEW_POLYGON) ? "ctx->Polygon, " : "", + (state & _NEW_POLYGONSTIPPLE) ? "ctx->PolygonStipple, " : "", + (state & _NEW_SCISSOR) ? "ctx->Scissor, " : "", + (state & _NEW_STENCIL) ? "ctx->Stencil, " : "", + (state & _NEW_TEXTURE) ? "ctx->Texture, " : "", + (state & _NEW_TRANSFORM) ? "ctx->Transform, " : "", + (state & _NEW_VIEWPORT) ? "ctx->Viewport, " : "", + (state & _NEW_PACKUNPACK) ? "ctx->Pack/Unpack, " : "", + (state & _NEW_ARRAY) ? "ctx->Array, " : "", + (state & _NEW_RENDERMODE) ? "ctx->RenderMode, " : "", + (state & _NEW_BUFFERS) ? "ctx->Visual, ctx->DrawBuffer,, " : ""); +} + + + +void +_mesa_print_tri_caps( const char *name, GLuint flags ) +{ + _mesa_debug(NULL, + "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s\n", + name, + flags, + (flags & DD_FLATSHADE) ? "flat-shade, " : "", + (flags & DD_SEPARATE_SPECULAR) ? "separate-specular, " : "", + (flags & DD_TRI_LIGHT_TWOSIDE) ? "tri-light-twoside, " : "", + (flags & DD_TRI_TWOSTENCIL) ? "tri-twostencil, " : "", + (flags & DD_TRI_UNFILLED) ? "tri-unfilled, " : "", + (flags & DD_TRI_STIPPLE) ? "tri-stipple, " : "", + (flags & DD_TRI_OFFSET) ? "tri-offset, " : "", + (flags & DD_TRI_SMOOTH) ? "tri-smooth, " : "", + (flags & DD_LINE_SMOOTH) ? "line-smooth, " : "", + (flags & DD_LINE_STIPPLE) ? "line-stipple, " : "", + (flags & DD_POINT_SMOOTH) ? "point-smooth, " : "", + (flags & DD_POINT_ATTEN) ? "point-atten, " : "", + (flags & DD_TRI_CULL_FRONT_BACK) ? "cull-all, " : "" + ); +} + + +/** + * Print information about this Mesa version and build options. + */ +void _mesa_print_info( void ) +{ + _mesa_debug(NULL, "Mesa GL_VERSION = %s\n", + (char *) _mesa_GetString(GL_VERSION)); + _mesa_debug(NULL, "Mesa GL_RENDERER = %s\n", + (char *) _mesa_GetString(GL_RENDERER)); + _mesa_debug(NULL, "Mesa GL_VENDOR = %s\n", + (char *) _mesa_GetString(GL_VENDOR)); + _mesa_debug(NULL, "Mesa GL_EXTENSIONS = %s\n", + (char *) _mesa_GetString(GL_EXTENSIONS)); +#if defined(THREADS) + _mesa_debug(NULL, "Mesa thread-safe: YES\n"); +#else + _mesa_debug(NULL, "Mesa thread-safe: NO\n"); +#endif +#if defined(USE_X86_ASM) + _mesa_debug(NULL, "Mesa x86-optimized: YES\n"); +#else + _mesa_debug(NULL, "Mesa x86-optimized: NO\n"); +#endif +#if defined(USE_SPARC_ASM) + _mesa_debug(NULL, "Mesa sparc-optimized: YES\n"); +#else + _mesa_debug(NULL, "Mesa sparc-optimized: NO\n"); +#endif +} + + +/** + * Set the debugging flags. + * + * \param debug debug string + * + * If compiled with debugging support then search for keywords in \p debug and + * enables the verbose debug output of the respective feature. + */ +static void add_debug_flags( const char *debug ) +{ +#ifdef DEBUG + struct debug_option { + const char *name; + GLbitfield flag; + }; + static const struct debug_option debug_opt[] = { + { "varray", VERBOSE_VARRAY }, + { "tex", VERBOSE_TEXTURE }, + { "mat", VERBOSE_MATERIAL }, + { "pipe", VERBOSE_PIPELINE }, + { "driver", VERBOSE_DRIVER }, + { "state", VERBOSE_STATE }, + { "api", VERBOSE_API }, + { "list", VERBOSE_DISPLAY_LIST }, + { "lighting", VERBOSE_LIGHTING }, + { "disassem", VERBOSE_DISASSEM }, + { "draw", VERBOSE_DRAW }, + { "swap", VERBOSE_SWAPBUFFERS } + }; + GLuint i; + + MESA_VERBOSE = 0x0; + for (i = 0; i < Elements(debug_opt); i++) { + if (strstr(debug, debug_opt[i].name)) + MESA_VERBOSE |= debug_opt[i].flag; + } + + /* Debug flag: + */ + if (strstr(debug, "flush")) + MESA_DEBUG_FLAGS |= DEBUG_ALWAYS_FLUSH; + +#if defined(_FPU_GETCW) && defined(_FPU_SETCW) + if (strstr(debug, "fpexceptions")) { + /* raise FP exceptions */ + fpu_control_t mask; + _FPU_GETCW(mask); + mask &= ~(_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM + | _FPU_MASK_OM | _FPU_MASK_UM); + _FPU_SETCW(mask); + } +#endif + +#else + (void) debug; +#endif +} + + +void +_mesa_init_debug( struct gl_context *ctx ) +{ + char *c; + c = _mesa_getenv("MESA_DEBUG"); + if (c) + add_debug_flags(c); + + c = _mesa_getenv("MESA_VERBOSE"); + if (c) + add_debug_flags(c); +} + + +/* + * Write ppm file + */ +static void +write_ppm(const char *filename, const GLubyte *buffer, int width, int height, + int comps, int rcomp, int gcomp, int bcomp, GLboolean invert) +{ + FILE *f = fopen( filename, "w" ); + if (f) { + int x, y; + const GLubyte *ptr = buffer; + fprintf(f,"P6\n"); + fprintf(f,"# ppm-file created by osdemo.c\n"); + fprintf(f,"%i %i\n", width,height); + fprintf(f,"255\n"); + fclose(f); + f = fopen( filename, "ab" ); /* reopen in binary append mode */ + for (y=0; y < height; y++) { + for (x = 0; x < width; x++) { + int yy = invert ? (height - 1 - y) : y; + int i = (yy * width + x) * comps; + fputc(ptr[i+rcomp], f); /* write red */ + fputc(ptr[i+gcomp], f); /* write green */ + fputc(ptr[i+bcomp], f); /* write blue */ + } + } + fclose(f); + } +} + + +/** + * Write a texture image to a ppm file. + * \param face cube face in [0,5] + * \param level mipmap level + */ +static void +write_texture_image(struct gl_texture_object *texObj, + GLuint face, GLuint level) +{ + struct gl_texture_image *img = texObj->Image[face][level]; + if (img) { + GET_CURRENT_CONTEXT(ctx); + struct gl_pixelstore_attrib store; + GLubyte *buffer; + char s[100]; + + buffer = (GLubyte *) malloc(img->Width * img->Height + * img->Depth * 4); + + store = ctx->Pack; /* save */ + ctx->Pack = ctx->DefaultPacking; + + ctx->Driver.GetTexImage(ctx, texObj->Target, level, + GL_RGBA, GL_UNSIGNED_BYTE, + buffer, texObj, img); + + /* make filename */ + _mesa_snprintf(s, sizeof(s), "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face); + + printf(" Writing image level %u to %s\n", level, s); + write_ppm(s, buffer, img->Width, img->Height, 4, 0, 1, 2, GL_FALSE); + + ctx->Pack = store; /* restore */ + + free(buffer); + } +} + + +/** + * Write renderbuffer image to a ppm file. + */ +void +_mesa_write_renderbuffer_image(const struct gl_renderbuffer *rb) +{ + GET_CURRENT_CONTEXT(ctx); + GLubyte *buffer; + char s[100]; + GLenum format, type; + + if (rb->_BaseFormat == GL_RGB || + rb->_BaseFormat == GL_RGBA) { + format = GL_RGBA; + type = GL_UNSIGNED_BYTE; + } + else if (rb->_BaseFormat == GL_DEPTH_STENCIL) { + format = GL_DEPTH_STENCIL; + type = GL_UNSIGNED_INT_24_8; + } + else { + _mesa_debug(NULL, + "Unsupported BaseFormat 0x%x in " + "_mesa_write_renderbuffer_image()\n", + rb->_BaseFormat); + return; + } + + buffer = (GLubyte *) malloc(rb->Width * rb->Height * 4); + + ctx->Driver.ReadPixels(ctx, 0, 0, rb->Width, rb->Height, + format, type, &ctx->DefaultPacking, buffer); + + /* make filename */ + _mesa_snprintf(s, sizeof(s), "/tmp/renderbuffer%u.ppm", rb->Name); + _mesa_snprintf(s, sizeof(s), "C:\\renderbuffer%u.ppm", rb->Name); + + printf(" Writing renderbuffer image to %s\n", s); + + _mesa_debug(NULL, " Writing renderbuffer image to %s\n", s); + + write_ppm(s, buffer, rb->Width, rb->Height, 4, 0, 1, 2, GL_TRUE); + + free(buffer); +} + + +/** How many texture images (mipmap levels, faces) to write to files */ +#define WRITE_NONE 0 +#define WRITE_ONE 1 +#define WRITE_ALL 2 + +static GLuint WriteImages; + + +static void +dump_texture(struct gl_texture_object *texObj, GLuint writeImages) +{ + const GLuint numFaces = texObj->Target == GL_TEXTURE_CUBE_MAP ? 6 : 1; + GLboolean written = GL_FALSE; + GLuint i, j; + + printf("Texture %u\n", texObj->Name); + printf(" Target %s\n", tex_target_name(texObj->Target)); + for (i = 0; i < MAX_TEXTURE_LEVELS; i++) { + for (j = 0; j < numFaces; j++) { + struct gl_texture_image *texImg = texObj->Image[j][i]; + if (texImg) { + printf(" Face %u level %u: %d x %d x %d, format %s at %p\n", + j, i, + texImg->Width, texImg->Height, texImg->Depth, + _mesa_get_format_name(texImg->TexFormat), + texImg->Data); + if (writeImages == WRITE_ALL || + (writeImages == WRITE_ONE && !written)) { + write_texture_image(texObj, j, i); + written = GL_TRUE; + } + } + } + } +} + + +/** + * Dump a single texture. + */ +void +_mesa_dump_texture(GLuint texture, GLuint writeImages) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_texture_object *texObj = _mesa_lookup_texture(ctx, texture); + if (texObj) { + dump_texture(texObj, writeImages); + } +} + + +static void +dump_texture_cb(GLuint id, void *data, void *userData) +{ + struct gl_texture_object *texObj = (struct gl_texture_object *) data; + (void) userData; + dump_texture(texObj, WriteImages); +} + + +/** + * Print basic info about all texture objext to stdout. + * If dumpImages is true, write PPM of level[0] image to a file. + */ +void +_mesa_dump_textures(GLuint writeImages) +{ + GET_CURRENT_CONTEXT(ctx); + WriteImages = writeImages; + _mesa_HashWalk(ctx->Shared->TexObjects, dump_texture_cb, ctx); +} + + +static void +dump_renderbuffer(const struct gl_renderbuffer *rb, GLboolean writeImage) +{ + printf("Renderbuffer %u: %u x %u IntFormat = %s\n", + rb->Name, rb->Width, rb->Height, + _mesa_lookup_enum_by_nr(rb->InternalFormat)); + if (writeImage) { + _mesa_write_renderbuffer_image(rb); + } +} + + +static void +dump_renderbuffer_cb(GLuint id, void *data, void *userData) +{ + const struct gl_renderbuffer *rb = (const struct gl_renderbuffer *) data; + (void) userData; + dump_renderbuffer(rb, WriteImages); +} + + +/** + * Print basic info about all renderbuffers to stdout. + * If dumpImages is true, write PPM of level[0] image to a file. + */ +void +_mesa_dump_renderbuffers(GLboolean writeImages) +{ + GET_CURRENT_CONTEXT(ctx); + WriteImages = writeImages; + _mesa_HashWalk(ctx->Shared->RenderBuffers, dump_renderbuffer_cb, ctx); +} + + + +void +_mesa_dump_color_buffer(const char *filename) +{ + GET_CURRENT_CONTEXT(ctx); + const GLuint w = ctx->DrawBuffer->Width; + const GLuint h = ctx->DrawBuffer->Height; + GLubyte *buf; + + buf = (GLubyte *) malloc(w * h * 4); + + _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); + _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1); + _mesa_PixelStorei(GL_PACK_INVERT_MESA, GL_TRUE); + + _mesa_ReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, buf); + + printf("ReadBuffer %p 0x%x DrawBuffer %p 0x%x\n", + (void *) ctx->ReadBuffer->_ColorReadBuffer, + ctx->ReadBuffer->ColorReadBuffer, + (void *) ctx->DrawBuffer->_ColorDrawBuffers[0], + ctx->DrawBuffer->ColorDrawBuffer[0]); + printf("Writing %d x %d color buffer to %s\n", w, h, filename); + write_ppm(filename, buf, w, h, 4, 0, 1, 2, GL_TRUE); + + _mesa_PopClientAttrib(); + + free(buf); +} + + +void +_mesa_dump_depth_buffer(const char *filename) +{ + GET_CURRENT_CONTEXT(ctx); + const GLuint w = ctx->DrawBuffer->Width; + const GLuint h = ctx->DrawBuffer->Height; + GLuint *buf; + GLubyte *buf2; + GLuint i; + + buf = (GLuint *) malloc(w * h * 4); /* 4 bpp */ + buf2 = (GLubyte *) malloc(w * h * 3); /* 3 bpp */ + + _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); + _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1); + _mesa_PixelStorei(GL_PACK_INVERT_MESA, GL_TRUE); + + _mesa_ReadPixels(0, 0, w, h, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, buf); + + /* spread 24 bits of Z across R, G, B */ + for (i = 0; i < w * h; i++) { + buf2[i*3+0] = (buf[i] >> 24) & 0xff; + buf2[i*3+1] = (buf[i] >> 16) & 0xff; + buf2[i*3+2] = (buf[i] >> 8) & 0xff; + } + + printf("Writing %d x %d depth buffer to %s\n", w, h, filename); + write_ppm(filename, buf2, w, h, 3, 0, 1, 2, GL_TRUE); + + _mesa_PopClientAttrib(); + + free(buf); + free(buf2); +} + + +void +_mesa_dump_stencil_buffer(const char *filename) +{ + GET_CURRENT_CONTEXT(ctx); + const GLuint w = ctx->DrawBuffer->Width; + const GLuint h = ctx->DrawBuffer->Height; + GLubyte *buf; + GLubyte *buf2; + GLuint i; + + buf = (GLubyte *) malloc(w * h); /* 1 bpp */ + buf2 = (GLubyte *) malloc(w * h * 3); /* 3 bpp */ + + _mesa_PushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT); + _mesa_PixelStorei(GL_PACK_ALIGNMENT, 1); + _mesa_PixelStorei(GL_PACK_INVERT_MESA, GL_TRUE); + + _mesa_ReadPixels(0, 0, w, h, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, buf); + + for (i = 0; i < w * h; i++) { + buf2[i*3+0] = buf[i]; + buf2[i*3+1] = (buf[i] & 127) * 2; + buf2[i*3+2] = (buf[i] - 128) * 2; + } + + printf("Writing %d x %d stencil buffer to %s\n", w, h, filename); + write_ppm(filename, buf2, w, h, 3, 0, 1, 2, GL_TRUE); + + _mesa_PopClientAttrib(); + + free(buf); + free(buf2); +} + + +/** + * Quick and dirty function to "print" a texture to stdout. + */ +void +_mesa_print_texture(struct gl_context *ctx, const struct gl_texture_image *img) +{ +#if CHAN_TYPE != GL_UNSIGNED_BYTE + _mesa_problem(NULL, "PrintTexture not supported"); +#else + GLuint i, j, c; + const GLubyte *data = (const GLubyte *) img->Data; + + if (!data) { + printf("No texture data\n"); + return; + } + + /* XXX add more formats or make into a new format utility function */ + switch (img->TexFormat) { + case MESA_FORMAT_A8: + case MESA_FORMAT_L8: + case MESA_FORMAT_I8: + case MESA_FORMAT_CI8: + c = 1; + break; + case MESA_FORMAT_AL88: + case MESA_FORMAT_AL88_REV: + c = 2; + break; + case MESA_FORMAT_RGB888: + case MESA_FORMAT_BGR888: + c = 3; + break; + case MESA_FORMAT_RGBA8888: + case MESA_FORMAT_ARGB8888: + c = 4; + break; + default: + _mesa_problem(NULL, "error in PrintTexture\n"); + return; + } + + for (i = 0; i < img->Height; i++) { + for (j = 0; j < img->Width; j++) { + if (c==1) + printf("%02x ", data[0]); + else if (c==2) + printf("%02x%02x ", data[0], data[1]); + else if (c==3) + printf("%02x%02x%02x ", data[0], data[1], data[2]); + else if (c==4) + printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]); + data += (img->RowStride - img->Width) * c; + } + /* XXX use img->ImageStride here */ + printf("\n"); + } +#endif +} diff --git a/mesalib/src/mesa/main/debug.h b/mesalib/src/mesa/main/debug.h index ea397b72b..81fcf100d 100644 --- a/mesalib/src/mesa/main/debug.h +++ b/mesalib/src/mesa/main/debug.h @@ -63,6 +63,9 @@ extern void _mesa_init_debug( struct gl_context *ctx ); #endif +extern void +_mesa_write_renderbuffer_image(const struct gl_renderbuffer *rb); + extern void _mesa_dump_texture(GLuint texture, GLuint writeImages); diff --git a/mesalib/src/mesa/main/drawpix.c b/mesalib/src/mesa/main/drawpix.c index d7628c8f7..554d7a84a 100644 --- a/mesalib/src/mesa/main/drawpix.c +++ b/mesalib/src/mesa/main/drawpix.c @@ -49,6 +49,17 @@ _mesa_DrawPixels( GLsizei width, GLsizei height, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & VERBOSE_API) + _mesa_debug(ctx, "glDrawPixels(%d, %d, %s, %s, %p) // to %s at %d, %d\n", + width, height, + _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), + pixels, + _mesa_lookup_enum_by_nr(ctx->DrawBuffer->ColorDrawBuffer[0]), + IROUND(ctx->Current.RasterPos[0]), + IROUND(ctx->Current.RasterPos[1])); + + if (width < 0 || height < 0) { _mesa_error( ctx, GL_INVALID_VALUE, "glDrawPixels(width or height < 0" ); return; @@ -124,6 +135,18 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + _mesa_finish(ctx); + + if (MESA_VERBOSE & VERBOSE_API) + _mesa_debug(ctx, + "glCopyPixels(%d, %d, %d, %d, %s) // from %s to %s at %d, %d\n", + srcx, srcy, width, height, + _mesa_lookup_enum_by_nr(type), + _mesa_lookup_enum_by_nr(ctx->ReadBuffer->ColorReadBuffer), + _mesa_lookup_enum_by_nr(ctx->DrawBuffer->ColorDrawBuffer[0]), + IROUND(ctx->Current.RasterPos[0]), + IROUND(ctx->Current.RasterPos[1])); + if (width < 0 || height < 0) { _mesa_error(ctx, GL_INVALID_VALUE, "glCopyPixels(width or height < 0)"); return; diff --git a/mesalib/src/mesa/main/enable.c b/mesalib/src/mesa/main/enable.c index d34c6ff90..231278bee 100644 --- a/mesalib/src/mesa/main/enable.c +++ b/mesalib/src/mesa/main/enable.c @@ -1,1504 +1,1501 @@ -/** - * \file enable.c - * Enable/disable/query GL capabilities. - */ - -/* - * Mesa 3-D graphics library - * Version: 7.0.3 - * - * Copyright (C) 1999-2007 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. - */ - - -#include "glheader.h" -#include "context.h" -#include "enable.h" -#include "light.h" -#include "simple_list.h" -#include "mfeatures.h" -#include "mtypes.h" -#include "enums.h" -#include "api_arrayelt.h" -#include "texstate.h" - - - -#define CHECK_EXTENSION(EXTNAME, CAP) \ - if (!ctx->Extensions.EXTNAME) { \ - goto invalid_enum_error; \ - } - - -/** - * Helper to enable/disable client-side state. - */ -static void -client_state(struct gl_context *ctx, GLenum cap, GLboolean state) -{ - struct gl_array_object *arrayObj = ctx->Array.ArrayObj; - GLuint flag; - GLboolean *var; - - switch (cap) { - case GL_VERTEX_ARRAY: - var = &arrayObj->Vertex.Enabled; - flag = _NEW_ARRAY_VERTEX; - break; - case GL_NORMAL_ARRAY: - var = &arrayObj->Normal.Enabled; - flag = _NEW_ARRAY_NORMAL; - break; - case GL_COLOR_ARRAY: - var = &arrayObj->Color.Enabled; - flag = _NEW_ARRAY_COLOR0; - break; - case GL_INDEX_ARRAY: - var = &arrayObj->Index.Enabled; - flag = _NEW_ARRAY_INDEX; - break; - case GL_TEXTURE_COORD_ARRAY: - var = &arrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled; - flag = _NEW_ARRAY_TEXCOORD(ctx->Array.ActiveTexture); - break; - case GL_EDGE_FLAG_ARRAY: - var = &arrayObj->EdgeFlag.Enabled; - flag = _NEW_ARRAY_EDGEFLAG; - break; - case GL_FOG_COORDINATE_ARRAY_EXT: - var = &arrayObj->FogCoord.Enabled; - flag = _NEW_ARRAY_FOGCOORD; - break; - case GL_SECONDARY_COLOR_ARRAY_EXT: - var = &arrayObj->SecondaryColor.Enabled; - flag = _NEW_ARRAY_COLOR1; - break; - -#if FEATURE_point_size_array - case GL_POINT_SIZE_ARRAY_OES: - var = &arrayObj->PointSize.Enabled; - flag = _NEW_ARRAY_POINT_SIZE; - break; -#endif - -#if FEATURE_NV_vertex_program - case GL_VERTEX_ATTRIB_ARRAY0_NV: - case GL_VERTEX_ATTRIB_ARRAY1_NV: - case GL_VERTEX_ATTRIB_ARRAY2_NV: - case GL_VERTEX_ATTRIB_ARRAY3_NV: - case GL_VERTEX_ATTRIB_ARRAY4_NV: - case GL_VERTEX_ATTRIB_ARRAY5_NV: - case GL_VERTEX_ATTRIB_ARRAY6_NV: - case GL_VERTEX_ATTRIB_ARRAY7_NV: - case GL_VERTEX_ATTRIB_ARRAY8_NV: - case GL_VERTEX_ATTRIB_ARRAY9_NV: - case GL_VERTEX_ATTRIB_ARRAY10_NV: - case GL_VERTEX_ATTRIB_ARRAY11_NV: - case GL_VERTEX_ATTRIB_ARRAY12_NV: - case GL_VERTEX_ATTRIB_ARRAY13_NV: - case GL_VERTEX_ATTRIB_ARRAY14_NV: - case GL_VERTEX_ATTRIB_ARRAY15_NV: - CHECK_EXTENSION(NV_vertex_program, cap); - { - GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV; - ASSERT(n < Elements(ctx->Array.ArrayObj->VertexAttrib)); - var = &arrayObj->VertexAttrib[n].Enabled; - flag = _NEW_ARRAY_ATTRIB(n); - } - break; -#endif /* FEATURE_NV_vertex_program */ - - /* GL_NV_primitive_restart */ - case GL_PRIMITIVE_RESTART_NV: - if (!ctx->Extensions.NV_primitive_restart) { - goto invalid_enum_error; - } - var = &ctx->Array.PrimitiveRestart; - flag = 0; - break; - - default: - goto invalid_enum_error; - } - - if (*var == state) - return; - - FLUSH_VERTICES(ctx, _NEW_ARRAY); - ctx->Array.NewState |= flag; - - _ae_invalidate_state(ctx, _NEW_ARRAY); - - *var = state; - - if (state) - ctx->Array.ArrayObj->_Enabled |= flag; - else - ctx->Array.ArrayObj->_Enabled &= ~flag; - - if (ctx->Driver.Enable) { - ctx->Driver.Enable( ctx, cap, state ); - } - - return; - -invalid_enum_error: - _mesa_error(ctx, GL_INVALID_ENUM, "gl%sClientState(0x%x)", - state ? "Enable" : "Disable", cap); -} - - -/** - * Enable GL capability. - * \param cap state to enable/disable. - * - * Get's the current context, assures that we're outside glBegin()/glEnd() and - * calls client_state(). - */ -void GLAPIENTRY -_mesa_EnableClientState( GLenum cap ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - client_state( ctx, cap, GL_TRUE ); -} - - -/** - * Disable GL capability. - * \param cap state to enable/disable. - * - * Get's the current context, assures that we're outside glBegin()/glEnd() and - * calls client_state(). - */ -void GLAPIENTRY -_mesa_DisableClientState( GLenum cap ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - client_state( ctx, cap, GL_FALSE ); -} - - -#undef CHECK_EXTENSION -#define CHECK_EXTENSION(EXTNAME, CAP) \ - if (!ctx->Extensions.EXTNAME) { \ - goto invalid_enum_error; \ - } - -#define CHECK_EXTENSION2(EXT1, EXT2, CAP) \ - if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \ - goto invalid_enum_error; \ - } - - - -/** - * Return pointer to current texture unit for setting/getting coordinate - * state. - * Note that we'll set GL_INVALID_OPERATION if the active texture unit is - * higher than the number of supported coordinate units. And we'll return NULL. - */ -static struct gl_texture_unit * -get_texcoord_unit(struct gl_context *ctx) -{ - if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glEnable/Disable(texcoord unit)"); - return NULL; - } - else { - return &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - } -} - - -/** - * Helper function to enable or disable a texture target. - * \param bit one of the TEXTURE_x_BIT values - * \return GL_TRUE if state is changing or GL_FALSE if no change - */ -static GLboolean -enable_texture(struct gl_context *ctx, GLboolean state, GLbitfield texBit) -{ - struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); - const GLbitfield newenabled = state - ? (texUnit->Enabled | texBit) : (texUnit->Enabled & ~texBit); - - if (texUnit->Enabled == newenabled) - return GL_FALSE; - - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->Enabled = newenabled; - return GL_TRUE; -} - - -/** - * Helper function to enable or disable state. - * - * \param ctx GL context. - * \param cap the state to enable/disable - * \param state whether to enable or disable the specified capability. - * - * Updates the current context and flushes the vertices as needed. For - * capabilities associated with extensions it verifies that those extensions - * are effectivly present before updating. Notifies the driver via - * dd_function_table::Enable. - */ -void -_mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) -{ - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "%s %s (newstate is %x)\n", - state ? "glEnable" : "glDisable", - _mesa_lookup_enum_by_nr(cap), - ctx->NewState); - - switch (cap) { - case GL_ALPHA_TEST: - if (ctx->Color.AlphaEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.AlphaEnabled = state; - break; - case GL_AUTO_NORMAL: - if (ctx->Eval.AutoNormal == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.AutoNormal = state; - break; - case GL_BLEND: - { - GLbitfield newEnabled = state * ((1 << ctx->Const.MaxDrawBuffers) - 1); - if (newEnabled != ctx->Color.BlendEnabled) { - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.BlendEnabled = newEnabled; - } - } - break; -#if FEATURE_userclip - case GL_CLIP_PLANE0: - case GL_CLIP_PLANE1: - case GL_CLIP_PLANE2: - case GL_CLIP_PLANE3: - case GL_CLIP_PLANE4: - case GL_CLIP_PLANE5: - { - const GLuint p = cap - GL_CLIP_PLANE0; - - if ((ctx->Transform.ClipPlanesEnabled & (1 << p)) == ((GLuint) state << p)) - return; - - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - - if (state) { - ctx->Transform.ClipPlanesEnabled |= (1 << p); - - if (_math_matrix_is_dirty(ctx->ProjectionMatrixStack.Top)) - _math_matrix_analyse( ctx->ProjectionMatrixStack.Top ); - - /* This derived state also calculated in clip.c and - * from _mesa_update_state() on changes to EyeUserPlane - * and ctx->ProjectionMatrix respectively. - */ - _mesa_transform_vector( ctx->Transform._ClipUserPlane[p], - ctx->Transform.EyeUserPlane[p], - ctx->ProjectionMatrixStack.Top->inv ); - } - else { - ctx->Transform.ClipPlanesEnabled &= ~(1 << p); - } - } - break; -#endif - case GL_COLOR_MATERIAL: - if (ctx->Light.ColorMaterialEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - FLUSH_CURRENT(ctx, 0); - ctx->Light.ColorMaterialEnabled = state; - if (state) { - _mesa_update_color_material( ctx, - ctx->Current.Attrib[VERT_ATTRIB_COLOR0] ); - } - break; - case GL_CULL_FACE: - if (ctx->Polygon.CullFlag == state) - return; - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.CullFlag = state; - break; - case GL_DEPTH_TEST: - if (ctx->Depth.Test == state) - return; - FLUSH_VERTICES(ctx, _NEW_DEPTH); - ctx->Depth.Test = state; - break; - case GL_DITHER: - if (ctx->NoDither) { - state = GL_FALSE; /* MESA_NO_DITHER env var */ - } - if (ctx->Color.DitherFlag == state) - return; - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.DitherFlag = state; - break; - case GL_FOG: - if (ctx->Fog.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_FOG); - ctx->Fog.Enabled = state; - break; - case GL_LIGHT0: - case GL_LIGHT1: - case GL_LIGHT2: - case GL_LIGHT3: - case GL_LIGHT4: - case GL_LIGHT5: - case GL_LIGHT6: - case GL_LIGHT7: - if (ctx->Light.Light[cap-GL_LIGHT0].Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - ctx->Light.Light[cap-GL_LIGHT0].Enabled = state; - if (state) { - insert_at_tail(&ctx->Light.EnabledList, - &ctx->Light.Light[cap-GL_LIGHT0]); - } - else { - remove_from_list(&ctx->Light.Light[cap-GL_LIGHT0]); - } - break; - case GL_LIGHTING: - if (ctx->Light.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_LIGHT); - ctx->Light.Enabled = state; - if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) - ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE; - else - ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE; - break; - case GL_LINE_SMOOTH: - if (ctx->Line.SmoothFlag == state) - return; - FLUSH_VERTICES(ctx, _NEW_LINE); - ctx->Line.SmoothFlag = state; - ctx->_TriangleCaps ^= DD_LINE_SMOOTH; - break; - case GL_LINE_STIPPLE: - if (ctx->Line.StippleFlag == state) - return; - FLUSH_VERTICES(ctx, _NEW_LINE); - ctx->Line.StippleFlag = state; - ctx->_TriangleCaps ^= DD_LINE_STIPPLE; - break; - case GL_INDEX_LOGIC_OP: - if (ctx->Color.IndexLogicOpEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.IndexLogicOpEnabled = state; - break; - case GL_COLOR_LOGIC_OP: - if (ctx->Color.ColorLogicOpEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_COLOR); - ctx->Color.ColorLogicOpEnabled = state; - break; - case GL_MAP1_COLOR_4: - if (ctx->Eval.Map1Color4 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1Color4 = state; - break; - case GL_MAP1_INDEX: - if (ctx->Eval.Map1Index == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1Index = state; - break; - case GL_MAP1_NORMAL: - if (ctx->Eval.Map1Normal == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1Normal = state; - break; - case GL_MAP1_TEXTURE_COORD_1: - if (ctx->Eval.Map1TextureCoord1 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1TextureCoord1 = state; - break; - case GL_MAP1_TEXTURE_COORD_2: - if (ctx->Eval.Map1TextureCoord2 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1TextureCoord2 = state; - break; - case GL_MAP1_TEXTURE_COORD_3: - if (ctx->Eval.Map1TextureCoord3 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1TextureCoord3 = state; - break; - case GL_MAP1_TEXTURE_COORD_4: - if (ctx->Eval.Map1TextureCoord4 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1TextureCoord4 = state; - break; - case GL_MAP1_VERTEX_3: - if (ctx->Eval.Map1Vertex3 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1Vertex3 = state; - break; - case GL_MAP1_VERTEX_4: - if (ctx->Eval.Map1Vertex4 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1Vertex4 = state; - break; - case GL_MAP2_COLOR_4: - if (ctx->Eval.Map2Color4 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2Color4 = state; - break; - case GL_MAP2_INDEX: - if (ctx->Eval.Map2Index == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2Index = state; - break; - case GL_MAP2_NORMAL: - if (ctx->Eval.Map2Normal == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2Normal = state; - break; - case GL_MAP2_TEXTURE_COORD_1: - if (ctx->Eval.Map2TextureCoord1 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2TextureCoord1 = state; - break; - case GL_MAP2_TEXTURE_COORD_2: - if (ctx->Eval.Map2TextureCoord2 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2TextureCoord2 = state; - break; - case GL_MAP2_TEXTURE_COORD_3: - if (ctx->Eval.Map2TextureCoord3 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2TextureCoord3 = state; - break; - case GL_MAP2_TEXTURE_COORD_4: - if (ctx->Eval.Map2TextureCoord4 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2TextureCoord4 = state; - break; - case GL_MAP2_VERTEX_3: - if (ctx->Eval.Map2Vertex3 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2Vertex3 = state; - break; - case GL_MAP2_VERTEX_4: - if (ctx->Eval.Map2Vertex4 == state) - return; - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2Vertex4 = state; - break; - case GL_NORMALIZE: - if (ctx->Transform.Normalize == state) - return; - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - ctx->Transform.Normalize = state; - break; - case GL_POINT_SMOOTH: - if (ctx->Point.SmoothFlag == state) - return; - FLUSH_VERTICES(ctx, _NEW_POINT); - ctx->Point.SmoothFlag = state; - ctx->_TriangleCaps ^= DD_POINT_SMOOTH; - break; - case GL_POLYGON_SMOOTH: - if (ctx->Polygon.SmoothFlag == state) - return; - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.SmoothFlag = state; - ctx->_TriangleCaps ^= DD_TRI_SMOOTH; - break; - case GL_POLYGON_STIPPLE: - if (ctx->Polygon.StippleFlag == state) - return; - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.StippleFlag = state; - ctx->_TriangleCaps ^= DD_TRI_STIPPLE; - break; - case GL_POLYGON_OFFSET_POINT: - if (ctx->Polygon.OffsetPoint == state) - return; - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.OffsetPoint = state; - break; - case GL_POLYGON_OFFSET_LINE: - if (ctx->Polygon.OffsetLine == state) - return; - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.OffsetLine = state; - break; - case GL_POLYGON_OFFSET_FILL: - /*case GL_POLYGON_OFFSET_EXT:*/ - if (ctx->Polygon.OffsetFill == state) - return; - FLUSH_VERTICES(ctx, _NEW_POLYGON); - ctx->Polygon.OffsetFill = state; - break; - case GL_RESCALE_NORMAL_EXT: - if (ctx->Transform.RescaleNormals == state) - return; - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - ctx->Transform.RescaleNormals = state; - break; - case GL_SCISSOR_TEST: - if (ctx->Scissor.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_SCISSOR); - ctx->Scissor.Enabled = state; - break; - case GL_SHARED_TEXTURE_PALETTE_EXT: - if (ctx->Texture.SharedPalette == state) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - ctx->Texture.SharedPalette = state; - break; - case GL_STENCIL_TEST: - if (ctx->Stencil.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.Enabled = state; - break; - case GL_TEXTURE_1D: - if (!enable_texture(ctx, state, TEXTURE_1D_BIT)) { - return; - } - break; - case GL_TEXTURE_2D: - if (!enable_texture(ctx, state, TEXTURE_2D_BIT)) { - return; - } - break; - case GL_TEXTURE_3D: - if (!enable_texture(ctx, state, TEXTURE_3D_BIT)) { - return; - } - break; - case GL_TEXTURE_GEN_Q: - { - struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - GLuint newenabled = texUnit->TexGenEnabled & ~Q_BIT; - if (state) - newenabled |= Q_BIT; - if (texUnit->TexGenEnabled == newenabled) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->TexGenEnabled = newenabled; - } - } - break; - case GL_TEXTURE_GEN_R: - { - struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - GLuint newenabled = texUnit->TexGenEnabled & ~R_BIT; - if (state) - newenabled |= R_BIT; - if (texUnit->TexGenEnabled == newenabled) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->TexGenEnabled = newenabled; - } - } - break; - case GL_TEXTURE_GEN_S: - { - struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - GLuint newenabled = texUnit->TexGenEnabled & ~S_BIT; - if (state) - newenabled |= S_BIT; - if (texUnit->TexGenEnabled == newenabled) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->TexGenEnabled = newenabled; - } - } - break; - case GL_TEXTURE_GEN_T: - { - struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - GLuint newenabled = texUnit->TexGenEnabled & ~T_BIT; - if (state) - newenabled |= T_BIT; - if (texUnit->TexGenEnabled == newenabled) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->TexGenEnabled = newenabled; - } - } - break; - -#if FEATURE_ES1 - case GL_TEXTURE_GEN_STR_OES: - /* disable S, T, and R at the same time */ - { - struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - GLuint newenabled = - texUnit->TexGenEnabled & ~STR_BITS; - if (state) - newenabled |= STR_BITS; - if (texUnit->TexGenEnabled == newenabled) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - texUnit->TexGenEnabled = newenabled; - } - } - break; -#endif - - /* - * CLIENT STATE!!! - */ - case GL_VERTEX_ARRAY: - case GL_NORMAL_ARRAY: - case GL_COLOR_ARRAY: - case GL_INDEX_ARRAY: - case GL_TEXTURE_COORD_ARRAY: - case GL_EDGE_FLAG_ARRAY: - case GL_FOG_COORDINATE_ARRAY_EXT: - case GL_SECONDARY_COLOR_ARRAY_EXT: - case GL_POINT_SIZE_ARRAY_OES: - client_state( ctx, cap, state ); - return; - - /* GL_SGI_texture_color_table */ - case GL_TEXTURE_COLOR_TABLE_SGI: - CHECK_EXTENSION(SGI_texture_color_table, cap); - if (ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled = state; - break; - - /* GL_ARB_texture_cube_map */ - case GL_TEXTURE_CUBE_MAP_ARB: - CHECK_EXTENSION(ARB_texture_cube_map, cap); - if (!enable_texture(ctx, state, TEXTURE_CUBE_BIT)) { - return; - } - break; - - /* GL_EXT_secondary_color */ - case GL_COLOR_SUM_EXT: - CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program, cap); - if (ctx->Fog.ColorSumEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_FOG); - ctx->Fog.ColorSumEnabled = state; - break; - - /* GL_ARB_multisample */ - case GL_MULTISAMPLE_ARB: - if (ctx->Multisample.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); - ctx->Multisample.Enabled = state; - break; - case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: - if (ctx->Multisample.SampleAlphaToCoverage == state) - return; - FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); - ctx->Multisample.SampleAlphaToCoverage = state; - break; - case GL_SAMPLE_ALPHA_TO_ONE_ARB: - if (ctx->Multisample.SampleAlphaToOne == state) - return; - FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); - ctx->Multisample.SampleAlphaToOne = state; - break; - case GL_SAMPLE_COVERAGE_ARB: - if (ctx->Multisample.SampleCoverage == state) - return; - FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); - ctx->Multisample.SampleCoverage = state; - break; - case GL_SAMPLE_COVERAGE_INVERT_ARB: - if (ctx->Multisample.SampleCoverageInvert == state) - return; - FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); - ctx->Multisample.SampleCoverageInvert = state; - break; - - /* GL_IBM_rasterpos_clip */ - case GL_RASTER_POSITION_UNCLIPPED_IBM: - CHECK_EXTENSION(IBM_rasterpos_clip, cap); - if (ctx->Transform.RasterPositionUnclipped == state) - return; - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - ctx->Transform.RasterPositionUnclipped = state; - break; - - /* GL_NV_point_sprite */ - case GL_POINT_SPRITE_NV: - CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite, cap); - if (ctx->Point.PointSprite == state) - return; - FLUSH_VERTICES(ctx, _NEW_POINT); - ctx->Point.PointSprite = state; - break; - -#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program - case GL_VERTEX_PROGRAM_ARB: - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap); - if (ctx->VertexProgram.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - ctx->VertexProgram.Enabled = state; - break; - case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap); - if (ctx->VertexProgram.PointSizeEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - ctx->VertexProgram.PointSizeEnabled = state; - break; - case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap); - if (ctx->VertexProgram.TwoSideEnabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - ctx->VertexProgram.TwoSideEnabled = state; - break; -#endif -#if FEATURE_NV_vertex_program - case GL_MAP1_VERTEX_ATTRIB0_4_NV: - case GL_MAP1_VERTEX_ATTRIB1_4_NV: - case GL_MAP1_VERTEX_ATTRIB2_4_NV: - case GL_MAP1_VERTEX_ATTRIB3_4_NV: - case GL_MAP1_VERTEX_ATTRIB4_4_NV: - case GL_MAP1_VERTEX_ATTRIB5_4_NV: - case GL_MAP1_VERTEX_ATTRIB6_4_NV: - case GL_MAP1_VERTEX_ATTRIB7_4_NV: - case GL_MAP1_VERTEX_ATTRIB8_4_NV: - case GL_MAP1_VERTEX_ATTRIB9_4_NV: - case GL_MAP1_VERTEX_ATTRIB10_4_NV: - case GL_MAP1_VERTEX_ATTRIB11_4_NV: - case GL_MAP1_VERTEX_ATTRIB12_4_NV: - case GL_MAP1_VERTEX_ATTRIB13_4_NV: - case GL_MAP1_VERTEX_ATTRIB14_4_NV: - case GL_MAP1_VERTEX_ATTRIB15_4_NV: - CHECK_EXTENSION(NV_vertex_program, cap); - { - const GLuint map = (GLuint) (cap - GL_MAP1_VERTEX_ATTRIB0_4_NV); - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map1Attrib[map] = state; - } - break; - case GL_MAP2_VERTEX_ATTRIB0_4_NV: - case GL_MAP2_VERTEX_ATTRIB1_4_NV: - case GL_MAP2_VERTEX_ATTRIB2_4_NV: - case GL_MAP2_VERTEX_ATTRIB3_4_NV: - case GL_MAP2_VERTEX_ATTRIB4_4_NV: - case GL_MAP2_VERTEX_ATTRIB5_4_NV: - case GL_MAP2_VERTEX_ATTRIB6_4_NV: - case GL_MAP2_VERTEX_ATTRIB7_4_NV: - case GL_MAP2_VERTEX_ATTRIB8_4_NV: - case GL_MAP2_VERTEX_ATTRIB9_4_NV: - case GL_MAP2_VERTEX_ATTRIB10_4_NV: - case GL_MAP2_VERTEX_ATTRIB11_4_NV: - case GL_MAP2_VERTEX_ATTRIB12_4_NV: - case GL_MAP2_VERTEX_ATTRIB13_4_NV: - case GL_MAP2_VERTEX_ATTRIB14_4_NV: - case GL_MAP2_VERTEX_ATTRIB15_4_NV: - CHECK_EXTENSION(NV_vertex_program, cap); - { - const GLuint map = (GLuint) (cap - GL_MAP2_VERTEX_ATTRIB0_4_NV); - FLUSH_VERTICES(ctx, _NEW_EVAL); - ctx->Eval.Map2Attrib[map] = state; - } - break; -#endif /* FEATURE_NV_vertex_program */ - -#if FEATURE_NV_fragment_program - case GL_FRAGMENT_PROGRAM_NV: - CHECK_EXTENSION(NV_fragment_program, cap); - if (ctx->FragmentProgram.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - ctx->FragmentProgram.Enabled = state; - break; -#endif /* FEATURE_NV_fragment_program */ - - /* GL_NV_texture_rectangle */ - case GL_TEXTURE_RECTANGLE_NV: - CHECK_EXTENSION(NV_texture_rectangle, cap); - if (!enable_texture(ctx, state, TEXTURE_RECT_BIT)) { - return; - } - break; - - /* GL_EXT_stencil_two_side */ - case GL_STENCIL_TEST_TWO_SIDE_EXT: - CHECK_EXTENSION(EXT_stencil_two_side, cap); - if (ctx->Stencil.TestTwoSide == state) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.TestTwoSide = state; - if (state) { - ctx->Stencil._BackFace = 2; - ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL; - } else { - ctx->Stencil._BackFace = 1; - ctx->_TriangleCaps &= ~DD_TRI_TWOSTENCIL; - } - break; - -#if FEATURE_ARB_fragment_program - case GL_FRAGMENT_PROGRAM_ARB: - CHECK_EXTENSION(ARB_fragment_program, cap); - if (ctx->FragmentProgram.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - ctx->FragmentProgram.Enabled = state; - break; -#endif /* FEATURE_ARB_fragment_program */ - - /* GL_EXT_depth_bounds_test */ - case GL_DEPTH_BOUNDS_TEST_EXT: - CHECK_EXTENSION(EXT_depth_bounds_test, cap); - if (ctx->Depth.BoundsTest == state) - return; - FLUSH_VERTICES(ctx, _NEW_DEPTH); - ctx->Depth.BoundsTest = state; - break; - - case GL_DEPTH_CLAMP: - if (ctx->Transform.DepthClamp == state) - return; - CHECK_EXTENSION(ARB_depth_clamp, cap); - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - ctx->Transform.DepthClamp = state; - break; - -#if FEATURE_ATI_fragment_shader - case GL_FRAGMENT_SHADER_ATI: - CHECK_EXTENSION(ATI_fragment_shader, cap); - if (ctx->ATIFragmentShader.Enabled == state) - return; - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - ctx->ATIFragmentShader.Enabled = state; - break; -#endif - - /* GL_MESA_texture_array */ - case GL_TEXTURE_1D_ARRAY_EXT: - CHECK_EXTENSION(MESA_texture_array, cap); - if (!enable_texture(ctx, state, TEXTURE_1D_ARRAY_BIT)) { - return; - } - break; - - case GL_TEXTURE_2D_ARRAY_EXT: - CHECK_EXTENSION(MESA_texture_array, cap); - if (!enable_texture(ctx, state, TEXTURE_2D_ARRAY_BIT)) { - return; - } - break; - - case GL_TEXTURE_CUBE_MAP_SEAMLESS: - CHECK_EXTENSION(ARB_seamless_cube_map, cap); - ctx->Texture.CubeMapSeamless = state; - break; - -#if FEATURE_EXT_transform_feedback - case GL_RASTERIZER_DISCARD: - CHECK_EXTENSION(EXT_transform_feedback, cap); - if (ctx->TransformFeedback.RasterDiscard != state) { - ctx->TransformFeedback.RasterDiscard = state; - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - } - break; -#endif - - /* GL 3.1 primitive restart. Note: this enum is different from - * GL_PRIMITIVE_RESTART_NV (which is client state). - */ - case GL_PRIMITIVE_RESTART: - if (ctx->VersionMajor * 10 + ctx->VersionMinor < 31) { - goto invalid_enum_error; - } - if (ctx->Array.PrimitiveRestart != state) { - FLUSH_VERTICES(ctx, _NEW_TRANSFORM); - ctx->Array.PrimitiveRestart = state; - } - break; - - /* GL3.0 - GL_framebuffer_sRGB */ - case GL_FRAMEBUFFER_SRGB_EXT: - CHECK_EXTENSION(EXT_framebuffer_sRGB, cap); - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - ctx->Color.sRGBEnabled = state; - break; - - default: - goto invalid_enum_error; - } - - if (ctx->Driver.Enable) { - ctx->Driver.Enable( ctx, cap, state ); - } - - return; - -invalid_enum_error: - _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(0x%x)", - state ? "Enable" : "Disable", cap); -} - - -/** - * Enable GL capability. Called by glEnable() - * \param cap state to enable. - */ -void GLAPIENTRY -_mesa_Enable( GLenum cap ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - _mesa_set_enable( ctx, cap, GL_TRUE ); -} - - -/** - * Disable GL capability. Called by glDisable() - * \param cap state to disable. - */ -void GLAPIENTRY -_mesa_Disable( GLenum cap ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - _mesa_set_enable( ctx, cap, GL_FALSE ); -} - - - -/** - * Enable/disable an indexed state var. - */ -void -_mesa_set_enablei(struct gl_context *ctx, GLenum cap, GLuint index, GLboolean state) -{ - ASSERT(state == 0 || state == 1); - switch (cap) { - case GL_BLEND: - if (!ctx->Extensions.EXT_draw_buffers2) { - goto invalid_enum_error; - } - if (index >= ctx->Const.MaxDrawBuffers) { - _mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)", - state ? "glEnableIndexed" : "glDisableIndexed", index); - return; - } - if (((ctx->Color.BlendEnabled >> index) & 1) != state) { - FLUSH_VERTICES(ctx, _NEW_COLOR); - if (state) - ctx->Color.BlendEnabled |= (1 << index); - else - ctx->Color.BlendEnabled &= ~(1 << index); - } - break; - default: - goto invalid_enum_error; - } - return; - -invalid_enum_error: - _mesa_error(ctx, GL_INVALID_ENUM, "%s(cap=%s)", - state ? "glEnablei" : "glDisablei", - _mesa_lookup_enum_by_nr(cap)); -} - - -void GLAPIENTRY -_mesa_DisableIndexed( GLenum cap, GLuint index ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - _mesa_set_enablei(ctx, cap, index, GL_FALSE); -} - - -void GLAPIENTRY -_mesa_EnableIndexed( GLenum cap, GLuint index ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - _mesa_set_enablei(ctx, cap, index, GL_TRUE); -} - - -GLboolean GLAPIENTRY -_mesa_IsEnabledIndexed( GLenum cap, GLuint index ) -{ - GET_CURRENT_CONTEXT(ctx); - switch (cap) { - case GL_BLEND: - if (index >= ctx->Const.MaxDrawBuffers) { - _mesa_error(ctx, GL_INVALID_VALUE, "glIsEnabledIndexed(index=%u)", - index); - return GL_FALSE; - } - return (ctx->Color.BlendEnabled >> index) & 1; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabledIndexed(cap=%s)", - _mesa_lookup_enum_by_nr(cap)); - return GL_FALSE; - } -} - - - - -#undef CHECK_EXTENSION -#define CHECK_EXTENSION(EXTNAME) \ - if (!ctx->Extensions.EXTNAME) { \ - goto invalid_enum_error; \ - } - -#undef CHECK_EXTENSION2 -#define CHECK_EXTENSION2(EXT1, EXT2) \ - if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \ - goto invalid_enum_error; \ - } - - -/** - * Helper function to determine whether a texture target is enabled. - */ -static GLboolean -is_texture_enabled(struct gl_context *ctx, GLbitfield bit) -{ - const struct gl_texture_unit *const texUnit = - &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - return (texUnit->Enabled & bit) ? GL_TRUE : GL_FALSE; -} - - -/** - * Return simple enable/disable state. - * - * \param cap state variable to query. - * - * Returns the state of the specified capability from the current GL context. - * For the capabilities associated with extensions verifies that those - * extensions are effectively present before reporting. - */ -GLboolean GLAPIENTRY -_mesa_IsEnabled( GLenum cap ) -{ - GET_CURRENT_CONTEXT(ctx); - switch (cap) { - case GL_ALPHA_TEST: - return ctx->Color.AlphaEnabled; - case GL_AUTO_NORMAL: - return ctx->Eval.AutoNormal; - case GL_BLEND: - return ctx->Color.BlendEnabled & 1; /* return state for buffer[0] */ - case GL_CLIP_PLANE0: - case GL_CLIP_PLANE1: - case GL_CLIP_PLANE2: - case GL_CLIP_PLANE3: - case GL_CLIP_PLANE4: - case GL_CLIP_PLANE5: - return (ctx->Transform.ClipPlanesEnabled >> (cap - GL_CLIP_PLANE0)) & 1; - case GL_COLOR_MATERIAL: - return ctx->Light.ColorMaterialEnabled; - case GL_CULL_FACE: - return ctx->Polygon.CullFlag; - case GL_DEPTH_TEST: - return ctx->Depth.Test; - case GL_DITHER: - return ctx->Color.DitherFlag; - case GL_FOG: - return ctx->Fog.Enabled; - case GL_LIGHTING: - return ctx->Light.Enabled; - case GL_LIGHT0: - case GL_LIGHT1: - case GL_LIGHT2: - case GL_LIGHT3: - case GL_LIGHT4: - case GL_LIGHT5: - case GL_LIGHT6: - case GL_LIGHT7: - return ctx->Light.Light[cap-GL_LIGHT0].Enabled; - case GL_LINE_SMOOTH: - return ctx->Line.SmoothFlag; - case GL_LINE_STIPPLE: - return ctx->Line.StippleFlag; - case GL_INDEX_LOGIC_OP: - return ctx->Color.IndexLogicOpEnabled; - case GL_COLOR_LOGIC_OP: - return ctx->Color.ColorLogicOpEnabled; - case GL_MAP1_COLOR_4: - return ctx->Eval.Map1Color4; - case GL_MAP1_INDEX: - return ctx->Eval.Map1Index; - case GL_MAP1_NORMAL: - return ctx->Eval.Map1Normal; - case GL_MAP1_TEXTURE_COORD_1: - return ctx->Eval.Map1TextureCoord1; - case GL_MAP1_TEXTURE_COORD_2: - return ctx->Eval.Map1TextureCoord2; - case GL_MAP1_TEXTURE_COORD_3: - return ctx->Eval.Map1TextureCoord3; - case GL_MAP1_TEXTURE_COORD_4: - return ctx->Eval.Map1TextureCoord4; - case GL_MAP1_VERTEX_3: - return ctx->Eval.Map1Vertex3; - case GL_MAP1_VERTEX_4: - return ctx->Eval.Map1Vertex4; - case GL_MAP2_COLOR_4: - return ctx->Eval.Map2Color4; - case GL_MAP2_INDEX: - return ctx->Eval.Map2Index; - case GL_MAP2_NORMAL: - return ctx->Eval.Map2Normal; - case GL_MAP2_TEXTURE_COORD_1: - return ctx->Eval.Map2TextureCoord1; - case GL_MAP2_TEXTURE_COORD_2: - return ctx->Eval.Map2TextureCoord2; - case GL_MAP2_TEXTURE_COORD_3: - return ctx->Eval.Map2TextureCoord3; - case GL_MAP2_TEXTURE_COORD_4: - return ctx->Eval.Map2TextureCoord4; - case GL_MAP2_VERTEX_3: - return ctx->Eval.Map2Vertex3; - case GL_MAP2_VERTEX_4: - return ctx->Eval.Map2Vertex4; - case GL_NORMALIZE: - return ctx->Transform.Normalize; - case GL_POINT_SMOOTH: - return ctx->Point.SmoothFlag; - case GL_POLYGON_SMOOTH: - return ctx->Polygon.SmoothFlag; - case GL_POLYGON_STIPPLE: - return ctx->Polygon.StippleFlag; - case GL_POLYGON_OFFSET_POINT: - return ctx->Polygon.OffsetPoint; - case GL_POLYGON_OFFSET_LINE: - return ctx->Polygon.OffsetLine; - case GL_POLYGON_OFFSET_FILL: - /*case GL_POLYGON_OFFSET_EXT:*/ - return ctx->Polygon.OffsetFill; - case GL_RESCALE_NORMAL_EXT: - return ctx->Transform.RescaleNormals; - case GL_SCISSOR_TEST: - return ctx->Scissor.Enabled; - case GL_SHARED_TEXTURE_PALETTE_EXT: - return ctx->Texture.SharedPalette; - case GL_STENCIL_TEST: - return ctx->Stencil.Enabled; - case GL_TEXTURE_1D: - return is_texture_enabled(ctx, TEXTURE_1D_BIT); - case GL_TEXTURE_2D: - return is_texture_enabled(ctx, TEXTURE_2D_BIT); - case GL_TEXTURE_3D: - return is_texture_enabled(ctx, TEXTURE_3D_BIT); - case GL_TEXTURE_GEN_Q: - { - const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - return (texUnit->TexGenEnabled & Q_BIT) ? GL_TRUE : GL_FALSE; - } - } - return GL_FALSE; - case GL_TEXTURE_GEN_R: - { - const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - return (texUnit->TexGenEnabled & R_BIT) ? GL_TRUE : GL_FALSE; - } - } - return GL_FALSE; - case GL_TEXTURE_GEN_S: - { - const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - return (texUnit->TexGenEnabled & S_BIT) ? GL_TRUE : GL_FALSE; - } - } - return GL_FALSE; - case GL_TEXTURE_GEN_T: - { - const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - return (texUnit->TexGenEnabled & T_BIT) ? GL_TRUE : GL_FALSE; - } - } - return GL_FALSE; -#if FEATURE_ES1 - case GL_TEXTURE_GEN_STR_OES: - { - const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); - if (texUnit) { - return (texUnit->TexGenEnabled & STR_BITS) == STR_BITS ? GL_TRUE : GL_FALSE; - } - } -#endif - - /* - * CLIENT STATE!!! - */ - case GL_VERTEX_ARRAY: - return (ctx->Array.ArrayObj->Vertex.Enabled != 0); - case GL_NORMAL_ARRAY: - return (ctx->Array.ArrayObj->Normal.Enabled != 0); - case GL_COLOR_ARRAY: - return (ctx->Array.ArrayObj->Color.Enabled != 0); - case GL_INDEX_ARRAY: - return (ctx->Array.ArrayObj->Index.Enabled != 0); - case GL_TEXTURE_COORD_ARRAY: - return (ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled != 0); - case GL_EDGE_FLAG_ARRAY: - return (ctx->Array.ArrayObj->EdgeFlag.Enabled != 0); - case GL_FOG_COORDINATE_ARRAY_EXT: - CHECK_EXTENSION(EXT_fog_coord); - return (ctx->Array.ArrayObj->FogCoord.Enabled != 0); - case GL_SECONDARY_COLOR_ARRAY_EXT: - CHECK_EXTENSION(EXT_secondary_color); - return (ctx->Array.ArrayObj->SecondaryColor.Enabled != 0); -#if FEATURE_point_size_array - case GL_POINT_SIZE_ARRAY_OES: - return (ctx->Array.ArrayObj->PointSize.Enabled != 0); -#endif - - /* GL_SGI_texture_color_table */ - case GL_TEXTURE_COLOR_TABLE_SGI: - CHECK_EXTENSION(SGI_texture_color_table); - return ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled; - - /* GL_ARB_texture_cube_map */ - case GL_TEXTURE_CUBE_MAP_ARB: - CHECK_EXTENSION(ARB_texture_cube_map); - return is_texture_enabled(ctx, TEXTURE_CUBE_BIT); - - /* GL_EXT_secondary_color */ - case GL_COLOR_SUM_EXT: - CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program); - return ctx->Fog.ColorSumEnabled; - - /* GL_ARB_multisample */ - case GL_MULTISAMPLE_ARB: - return ctx->Multisample.Enabled; - case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: - return ctx->Multisample.SampleAlphaToCoverage; - case GL_SAMPLE_ALPHA_TO_ONE_ARB: - return ctx->Multisample.SampleAlphaToOne; - case GL_SAMPLE_COVERAGE_ARB: - return ctx->Multisample.SampleCoverage; - case GL_SAMPLE_COVERAGE_INVERT_ARB: - return ctx->Multisample.SampleCoverageInvert; - - /* GL_IBM_rasterpos_clip */ - case GL_RASTER_POSITION_UNCLIPPED_IBM: - CHECK_EXTENSION(IBM_rasterpos_clip); - return ctx->Transform.RasterPositionUnclipped; - - /* GL_NV_point_sprite */ - case GL_POINT_SPRITE_NV: - CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite) - return ctx->Point.PointSprite; - -#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program - case GL_VERTEX_PROGRAM_ARB: - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program); - return ctx->VertexProgram.Enabled; - case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program); - return ctx->VertexProgram.PointSizeEnabled; - case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: - CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program); - return ctx->VertexProgram.TwoSideEnabled; -#endif -#if FEATURE_NV_vertex_program - case GL_VERTEX_ATTRIB_ARRAY0_NV: - case GL_VERTEX_ATTRIB_ARRAY1_NV: - case GL_VERTEX_ATTRIB_ARRAY2_NV: - case GL_VERTEX_ATTRIB_ARRAY3_NV: - case GL_VERTEX_ATTRIB_ARRAY4_NV: - case GL_VERTEX_ATTRIB_ARRAY5_NV: - case GL_VERTEX_ATTRIB_ARRAY6_NV: - case GL_VERTEX_ATTRIB_ARRAY7_NV: - case GL_VERTEX_ATTRIB_ARRAY8_NV: - case GL_VERTEX_ATTRIB_ARRAY9_NV: - case GL_VERTEX_ATTRIB_ARRAY10_NV: - case GL_VERTEX_ATTRIB_ARRAY11_NV: - case GL_VERTEX_ATTRIB_ARRAY12_NV: - case GL_VERTEX_ATTRIB_ARRAY13_NV: - case GL_VERTEX_ATTRIB_ARRAY14_NV: - case GL_VERTEX_ATTRIB_ARRAY15_NV: - CHECK_EXTENSION(NV_vertex_program); - { - GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV; - ASSERT(n < Elements(ctx->Array.ArrayObj->VertexAttrib)); - return (ctx->Array.ArrayObj->VertexAttrib[n].Enabled != 0); - } - case GL_MAP1_VERTEX_ATTRIB0_4_NV: - case GL_MAP1_VERTEX_ATTRIB1_4_NV: - case GL_MAP1_VERTEX_ATTRIB2_4_NV: - case GL_MAP1_VERTEX_ATTRIB3_4_NV: - case GL_MAP1_VERTEX_ATTRIB4_4_NV: - case GL_MAP1_VERTEX_ATTRIB5_4_NV: - case GL_MAP1_VERTEX_ATTRIB6_4_NV: - case GL_MAP1_VERTEX_ATTRIB7_4_NV: - case GL_MAP1_VERTEX_ATTRIB8_4_NV: - case GL_MAP1_VERTEX_ATTRIB9_4_NV: - case GL_MAP1_VERTEX_ATTRIB10_4_NV: - case GL_MAP1_VERTEX_ATTRIB11_4_NV: - case GL_MAP1_VERTEX_ATTRIB12_4_NV: - case GL_MAP1_VERTEX_ATTRIB13_4_NV: - case GL_MAP1_VERTEX_ATTRIB14_4_NV: - case GL_MAP1_VERTEX_ATTRIB15_4_NV: - CHECK_EXTENSION(NV_vertex_program); - { - const GLuint map = (GLuint) (cap - GL_MAP1_VERTEX_ATTRIB0_4_NV); - return ctx->Eval.Map1Attrib[map]; - } - case GL_MAP2_VERTEX_ATTRIB0_4_NV: - case GL_MAP2_VERTEX_ATTRIB1_4_NV: - case GL_MAP2_VERTEX_ATTRIB2_4_NV: - case GL_MAP2_VERTEX_ATTRIB3_4_NV: - case GL_MAP2_VERTEX_ATTRIB4_4_NV: - case GL_MAP2_VERTEX_ATTRIB5_4_NV: - case GL_MAP2_VERTEX_ATTRIB6_4_NV: - case GL_MAP2_VERTEX_ATTRIB7_4_NV: - case GL_MAP2_VERTEX_ATTRIB8_4_NV: - case GL_MAP2_VERTEX_ATTRIB9_4_NV: - case GL_MAP2_VERTEX_ATTRIB10_4_NV: - case GL_MAP2_VERTEX_ATTRIB11_4_NV: - case GL_MAP2_VERTEX_ATTRIB12_4_NV: - case GL_MAP2_VERTEX_ATTRIB13_4_NV: - case GL_MAP2_VERTEX_ATTRIB14_4_NV: - case GL_MAP2_VERTEX_ATTRIB15_4_NV: - CHECK_EXTENSION(NV_vertex_program); - { - const GLuint map = (GLuint) (cap - GL_MAP2_VERTEX_ATTRIB0_4_NV); - return ctx->Eval.Map2Attrib[map]; - } -#endif /* FEATURE_NV_vertex_program */ - -#if FEATURE_NV_fragment_program - case GL_FRAGMENT_PROGRAM_NV: - CHECK_EXTENSION(NV_fragment_program); - return ctx->FragmentProgram.Enabled; -#endif /* FEATURE_NV_fragment_program */ - - /* GL_NV_texture_rectangle */ - case GL_TEXTURE_RECTANGLE_NV: - CHECK_EXTENSION(NV_texture_rectangle); - return is_texture_enabled(ctx, TEXTURE_RECT_BIT); - - /* GL_EXT_stencil_two_side */ - case GL_STENCIL_TEST_TWO_SIDE_EXT: - CHECK_EXTENSION(EXT_stencil_two_side); - return ctx->Stencil.TestTwoSide; - -#if FEATURE_ARB_fragment_program - case GL_FRAGMENT_PROGRAM_ARB: - return ctx->FragmentProgram.Enabled; -#endif /* FEATURE_ARB_fragment_program */ - - /* GL_EXT_depth_bounds_test */ - case GL_DEPTH_BOUNDS_TEST_EXT: - CHECK_EXTENSION(EXT_depth_bounds_test); - return ctx->Depth.BoundsTest; - - /* GL_ARB_depth_clamp */ - case GL_DEPTH_CLAMP: - CHECK_EXTENSION(ARB_depth_clamp); - return ctx->Transform.DepthClamp; - -#if FEATURE_ATI_fragment_shader - case GL_FRAGMENT_SHADER_ATI: - CHECK_EXTENSION(ATI_fragment_shader); - return ctx->ATIFragmentShader.Enabled; -#endif /* FEATURE_ATI_fragment_shader */ - - case GL_TEXTURE_CUBE_MAP_SEAMLESS: - CHECK_EXTENSION(ARB_seamless_cube_map); - return ctx->Texture.CubeMapSeamless; - -#if FEATURE_EXT_transform_feedback - case GL_RASTERIZER_DISCARD: - CHECK_EXTENSION(EXT_transform_feedback); - return ctx->TransformFeedback.RasterDiscard; -#endif - - /* GL_NV_primitive_restart */ - case GL_PRIMITIVE_RESTART_NV: - if (!ctx->Extensions.NV_primitive_restart) { - goto invalid_enum_error; - } - return ctx->Array.PrimitiveRestart; - - /* GL 3.1 primitive restart */ - case GL_PRIMITIVE_RESTART: - if (ctx->VersionMajor * 10 + ctx->VersionMinor < 31) { - goto invalid_enum_error; - } - return ctx->Array.PrimitiveRestart; - - /* GL3.0 - GL_framebuffer_sRGB */ - case GL_FRAMEBUFFER_SRGB_EXT: - CHECK_EXTENSION(EXT_framebuffer_sRGB); - return ctx->Color.sRGBEnabled; - - default: - goto invalid_enum_error; - } - - return GL_FALSE; - -invalid_enum_error: - _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled(0x%x)", (int) cap); - return GL_FALSE; -} +/** + * \file enable.c + * Enable/disable/query GL capabilities. + */ + +/* + * Mesa 3-D graphics library + * Version: 7.0.3 + * + * Copyright (C) 1999-2007 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. + */ + + +#include "glheader.h" +#include "context.h" +#include "enable.h" +#include "light.h" +#include "simple_list.h" +#include "mfeatures.h" +#include "mtypes.h" +#include "enums.h" +#include "api_arrayelt.h" +#include "texstate.h" + + + +#define CHECK_EXTENSION(EXTNAME, CAP) \ + if (!ctx->Extensions.EXTNAME) { \ + goto invalid_enum_error; \ + } + + +/** + * Helper to enable/disable client-side state. + */ +static void +client_state(struct gl_context *ctx, GLenum cap, GLboolean state) +{ + struct gl_array_object *arrayObj = ctx->Array.ArrayObj; + GLuint flag; + GLboolean *var; + + switch (cap) { + case GL_VERTEX_ARRAY: + var = &arrayObj->Vertex.Enabled; + flag = _NEW_ARRAY_VERTEX; + break; + case GL_NORMAL_ARRAY: + var = &arrayObj->Normal.Enabled; + flag = _NEW_ARRAY_NORMAL; + break; + case GL_COLOR_ARRAY: + var = &arrayObj->Color.Enabled; + flag = _NEW_ARRAY_COLOR0; + break; + case GL_INDEX_ARRAY: + var = &arrayObj->Index.Enabled; + flag = _NEW_ARRAY_INDEX; + break; + case GL_TEXTURE_COORD_ARRAY: + var = &arrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled; + flag = _NEW_ARRAY_TEXCOORD(ctx->Array.ActiveTexture); + break; + case GL_EDGE_FLAG_ARRAY: + var = &arrayObj->EdgeFlag.Enabled; + flag = _NEW_ARRAY_EDGEFLAG; + break; + case GL_FOG_COORDINATE_ARRAY_EXT: + var = &arrayObj->FogCoord.Enabled; + flag = _NEW_ARRAY_FOGCOORD; + break; + case GL_SECONDARY_COLOR_ARRAY_EXT: + var = &arrayObj->SecondaryColor.Enabled; + flag = _NEW_ARRAY_COLOR1; + break; + +#if FEATURE_point_size_array + case GL_POINT_SIZE_ARRAY_OES: + var = &arrayObj->PointSize.Enabled; + flag = _NEW_ARRAY_POINT_SIZE; + break; +#endif + +#if FEATURE_NV_vertex_program + case GL_VERTEX_ATTRIB_ARRAY0_NV: + case GL_VERTEX_ATTRIB_ARRAY1_NV: + case GL_VERTEX_ATTRIB_ARRAY2_NV: + case GL_VERTEX_ATTRIB_ARRAY3_NV: + case GL_VERTEX_ATTRIB_ARRAY4_NV: + case GL_VERTEX_ATTRIB_ARRAY5_NV: + case GL_VERTEX_ATTRIB_ARRAY6_NV: + case GL_VERTEX_ATTRIB_ARRAY7_NV: + case GL_VERTEX_ATTRIB_ARRAY8_NV: + case GL_VERTEX_ATTRIB_ARRAY9_NV: + case GL_VERTEX_ATTRIB_ARRAY10_NV: + case GL_VERTEX_ATTRIB_ARRAY11_NV: + case GL_VERTEX_ATTRIB_ARRAY12_NV: + case GL_VERTEX_ATTRIB_ARRAY13_NV: + case GL_VERTEX_ATTRIB_ARRAY14_NV: + case GL_VERTEX_ATTRIB_ARRAY15_NV: + CHECK_EXTENSION(NV_vertex_program, cap); + { + GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV; + ASSERT(n < Elements(ctx->Array.ArrayObj->VertexAttrib)); + var = &arrayObj->VertexAttrib[n].Enabled; + flag = _NEW_ARRAY_ATTRIB(n); + } + break; +#endif /* FEATURE_NV_vertex_program */ + + /* GL_NV_primitive_restart */ + case GL_PRIMITIVE_RESTART_NV: + if (!ctx->Extensions.NV_primitive_restart) { + goto invalid_enum_error; + } + var = &ctx->Array.PrimitiveRestart; + flag = 0; + break; + + default: + goto invalid_enum_error; + } + + if (*var == state) + return; + + FLUSH_VERTICES(ctx, _NEW_ARRAY); + ctx->Array.NewState |= flag; + + _ae_invalidate_state(ctx, _NEW_ARRAY); + + *var = state; + + if (state) + ctx->Array.ArrayObj->_Enabled |= flag; + else + ctx->Array.ArrayObj->_Enabled &= ~flag; + + if (ctx->Driver.Enable) { + ctx->Driver.Enable( ctx, cap, state ); + } + + return; + +invalid_enum_error: + _mesa_error(ctx, GL_INVALID_ENUM, "gl%sClientState(0x%x)", + state ? "Enable" : "Disable", cap); +} + + +/** + * Enable GL capability. + * \param cap state to enable/disable. + * + * Get's the current context, assures that we're outside glBegin()/glEnd() and + * calls client_state(). + */ +void GLAPIENTRY +_mesa_EnableClientState( GLenum cap ) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + client_state( ctx, cap, GL_TRUE ); +} + + +/** + * Disable GL capability. + * \param cap state to enable/disable. + * + * Get's the current context, assures that we're outside glBegin()/glEnd() and + * calls client_state(). + */ +void GLAPIENTRY +_mesa_DisableClientState( GLenum cap ) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + client_state( ctx, cap, GL_FALSE ); +} + + +#undef CHECK_EXTENSION +#define CHECK_EXTENSION(EXTNAME, CAP) \ + if (!ctx->Extensions.EXTNAME) { \ + goto invalid_enum_error; \ + } + +#define CHECK_EXTENSION2(EXT1, EXT2, CAP) \ + if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \ + goto invalid_enum_error; \ + } + + + +/** + * Return pointer to current texture unit for setting/getting coordinate + * state. + * Note that we'll set GL_INVALID_OPERATION if the active texture unit is + * higher than the number of supported coordinate units. And we'll return NULL. + */ +static struct gl_texture_unit * +get_texcoord_unit(struct gl_context *ctx) +{ + if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glEnable/Disable(texcoord unit)"); + return NULL; + } + else { + return &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + } +} + + +/** + * Helper function to enable or disable a texture target. + * \param bit one of the TEXTURE_x_BIT values + * \return GL_TRUE if state is changing or GL_FALSE if no change + */ +static GLboolean +enable_texture(struct gl_context *ctx, GLboolean state, GLbitfield texBit) +{ + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); + const GLbitfield newenabled = state + ? (texUnit->Enabled | texBit) : (texUnit->Enabled & ~texBit); + + if (texUnit->Enabled == newenabled) + return GL_FALSE; + + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->Enabled = newenabled; + return GL_TRUE; +} + + +/** + * Helper function to enable or disable state. + * + * \param ctx GL context. + * \param cap the state to enable/disable + * \param state whether to enable or disable the specified capability. + * + * Updates the current context and flushes the vertices as needed. For + * capabilities associated with extensions it verifies that those extensions + * are effectivly present before updating. Notifies the driver via + * dd_function_table::Enable. + */ +void +_mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) +{ + if (MESA_VERBOSE & VERBOSE_API) + _mesa_debug(ctx, "%s %s (newstate is %x)\n", + state ? "glEnable" : "glDisable", + _mesa_lookup_enum_by_nr(cap), + ctx->NewState); + + switch (cap) { + case GL_ALPHA_TEST: + if (ctx->Color.AlphaEnabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_COLOR); + ctx->Color.AlphaEnabled = state; + break; + case GL_AUTO_NORMAL: + if (ctx->Eval.AutoNormal == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.AutoNormal = state; + break; + case GL_BLEND: + { + GLbitfield newEnabled = state * ((1 << ctx->Const.MaxDrawBuffers) - 1); + if (newEnabled != ctx->Color.BlendEnabled) { + FLUSH_VERTICES(ctx, _NEW_COLOR); + ctx->Color.BlendEnabled = newEnabled; + } + } + break; +#if FEATURE_userclip + case GL_CLIP_PLANE0: + case GL_CLIP_PLANE1: + case GL_CLIP_PLANE2: + case GL_CLIP_PLANE3: + case GL_CLIP_PLANE4: + case GL_CLIP_PLANE5: + { + const GLuint p = cap - GL_CLIP_PLANE0; + + if ((ctx->Transform.ClipPlanesEnabled & (1 << p)) == ((GLuint) state << p)) + return; + + FLUSH_VERTICES(ctx, _NEW_TRANSFORM); + + if (state) { + ctx->Transform.ClipPlanesEnabled |= (1 << p); + + if (_math_matrix_is_dirty(ctx->ProjectionMatrixStack.Top)) + _math_matrix_analyse( ctx->ProjectionMatrixStack.Top ); + + /* This derived state also calculated in clip.c and + * from _mesa_update_state() on changes to EyeUserPlane + * and ctx->ProjectionMatrix respectively. + */ + _mesa_transform_vector( ctx->Transform._ClipUserPlane[p], + ctx->Transform.EyeUserPlane[p], + ctx->ProjectionMatrixStack.Top->inv ); + } + else { + ctx->Transform.ClipPlanesEnabled &= ~(1 << p); + } + } + break; +#endif + case GL_COLOR_MATERIAL: + if (ctx->Light.ColorMaterialEnabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_LIGHT); + FLUSH_CURRENT(ctx, 0); + ctx->Light.ColorMaterialEnabled = state; + if (state) { + _mesa_update_color_material( ctx, + ctx->Current.Attrib[VERT_ATTRIB_COLOR0] ); + } + break; + case GL_CULL_FACE: + if (ctx->Polygon.CullFlag == state) + return; + FLUSH_VERTICES(ctx, _NEW_POLYGON); + ctx->Polygon.CullFlag = state; + break; + case GL_DEPTH_TEST: + if (ctx->Depth.Test == state) + return; + FLUSH_VERTICES(ctx, _NEW_DEPTH); + ctx->Depth.Test = state; + break; + case GL_DITHER: + if (ctx->Color.DitherFlag == state) + return; + FLUSH_VERTICES(ctx, _NEW_COLOR); + ctx->Color.DitherFlag = state; + break; + case GL_FOG: + if (ctx->Fog.Enabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_FOG); + ctx->Fog.Enabled = state; + break; + case GL_LIGHT0: + case GL_LIGHT1: + case GL_LIGHT2: + case GL_LIGHT3: + case GL_LIGHT4: + case GL_LIGHT5: + case GL_LIGHT6: + case GL_LIGHT7: + if (ctx->Light.Light[cap-GL_LIGHT0].Enabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_LIGHT); + ctx->Light.Light[cap-GL_LIGHT0].Enabled = state; + if (state) { + insert_at_tail(&ctx->Light.EnabledList, + &ctx->Light.Light[cap-GL_LIGHT0]); + } + else { + remove_from_list(&ctx->Light.Light[cap-GL_LIGHT0]); + } + break; + case GL_LIGHTING: + if (ctx->Light.Enabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_LIGHT); + ctx->Light.Enabled = state; + if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) + ctx->_TriangleCaps |= DD_TRI_LIGHT_TWOSIDE; + else + ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE; + break; + case GL_LINE_SMOOTH: + if (ctx->Line.SmoothFlag == state) + return; + FLUSH_VERTICES(ctx, _NEW_LINE); + ctx->Line.SmoothFlag = state; + ctx->_TriangleCaps ^= DD_LINE_SMOOTH; + break; + case GL_LINE_STIPPLE: + if (ctx->Line.StippleFlag == state) + return; + FLUSH_VERTICES(ctx, _NEW_LINE); + ctx->Line.StippleFlag = state; + ctx->_TriangleCaps ^= DD_LINE_STIPPLE; + break; + case GL_INDEX_LOGIC_OP: + if (ctx->Color.IndexLogicOpEnabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_COLOR); + ctx->Color.IndexLogicOpEnabled = state; + break; + case GL_COLOR_LOGIC_OP: + if (ctx->Color.ColorLogicOpEnabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_COLOR); + ctx->Color.ColorLogicOpEnabled = state; + break; + case GL_MAP1_COLOR_4: + if (ctx->Eval.Map1Color4 == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map1Color4 = state; + break; + case GL_MAP1_INDEX: + if (ctx->Eval.Map1Index == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map1Index = state; + break; + case GL_MAP1_NORMAL: + if (ctx->Eval.Map1Normal == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map1Normal = state; + break; + case GL_MAP1_TEXTURE_COORD_1: + if (ctx->Eval.Map1TextureCoord1 == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map1TextureCoord1 = state; + break; + case GL_MAP1_TEXTURE_COORD_2: + if (ctx->Eval.Map1TextureCoord2 == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map1TextureCoord2 = state; + break; + case GL_MAP1_TEXTURE_COORD_3: + if (ctx->Eval.Map1TextureCoord3 == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map1TextureCoord3 = state; + break; + case GL_MAP1_TEXTURE_COORD_4: + if (ctx->Eval.Map1TextureCoord4 == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map1TextureCoord4 = state; + break; + case GL_MAP1_VERTEX_3: + if (ctx->Eval.Map1Vertex3 == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map1Vertex3 = state; + break; + case GL_MAP1_VERTEX_4: + if (ctx->Eval.Map1Vertex4 == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map1Vertex4 = state; + break; + case GL_MAP2_COLOR_4: + if (ctx->Eval.Map2Color4 == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map2Color4 = state; + break; + case GL_MAP2_INDEX: + if (ctx->Eval.Map2Index == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map2Index = state; + break; + case GL_MAP2_NORMAL: + if (ctx->Eval.Map2Normal == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map2Normal = state; + break; + case GL_MAP2_TEXTURE_COORD_1: + if (ctx->Eval.Map2TextureCoord1 == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map2TextureCoord1 = state; + break; + case GL_MAP2_TEXTURE_COORD_2: + if (ctx->Eval.Map2TextureCoord2 == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map2TextureCoord2 = state; + break; + case GL_MAP2_TEXTURE_COORD_3: + if (ctx->Eval.Map2TextureCoord3 == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map2TextureCoord3 = state; + break; + case GL_MAP2_TEXTURE_COORD_4: + if (ctx->Eval.Map2TextureCoord4 == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map2TextureCoord4 = state; + break; + case GL_MAP2_VERTEX_3: + if (ctx->Eval.Map2Vertex3 == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map2Vertex3 = state; + break; + case GL_MAP2_VERTEX_4: + if (ctx->Eval.Map2Vertex4 == state) + return; + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map2Vertex4 = state; + break; + case GL_NORMALIZE: + if (ctx->Transform.Normalize == state) + return; + FLUSH_VERTICES(ctx, _NEW_TRANSFORM); + ctx->Transform.Normalize = state; + break; + case GL_POINT_SMOOTH: + if (ctx->Point.SmoothFlag == state) + return; + FLUSH_VERTICES(ctx, _NEW_POINT); + ctx->Point.SmoothFlag = state; + ctx->_TriangleCaps ^= DD_POINT_SMOOTH; + break; + case GL_POLYGON_SMOOTH: + if (ctx->Polygon.SmoothFlag == state) + return; + FLUSH_VERTICES(ctx, _NEW_POLYGON); + ctx->Polygon.SmoothFlag = state; + ctx->_TriangleCaps ^= DD_TRI_SMOOTH; + break; + case GL_POLYGON_STIPPLE: + if (ctx->Polygon.StippleFlag == state) + return; + FLUSH_VERTICES(ctx, _NEW_POLYGON); + ctx->Polygon.StippleFlag = state; + ctx->_TriangleCaps ^= DD_TRI_STIPPLE; + break; + case GL_POLYGON_OFFSET_POINT: + if (ctx->Polygon.OffsetPoint == state) + return; + FLUSH_VERTICES(ctx, _NEW_POLYGON); + ctx->Polygon.OffsetPoint = state; + break; + case GL_POLYGON_OFFSET_LINE: + if (ctx->Polygon.OffsetLine == state) + return; + FLUSH_VERTICES(ctx, _NEW_POLYGON); + ctx->Polygon.OffsetLine = state; + break; + case GL_POLYGON_OFFSET_FILL: + /*case GL_POLYGON_OFFSET_EXT:*/ + if (ctx->Polygon.OffsetFill == state) + return; + FLUSH_VERTICES(ctx, _NEW_POLYGON); + ctx->Polygon.OffsetFill = state; + break; + case GL_RESCALE_NORMAL_EXT: + if (ctx->Transform.RescaleNormals == state) + return; + FLUSH_VERTICES(ctx, _NEW_TRANSFORM); + ctx->Transform.RescaleNormals = state; + break; + case GL_SCISSOR_TEST: + if (ctx->Scissor.Enabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_SCISSOR); + ctx->Scissor.Enabled = state; + break; + case GL_SHARED_TEXTURE_PALETTE_EXT: + if (ctx->Texture.SharedPalette == state) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + ctx->Texture.SharedPalette = state; + break; + case GL_STENCIL_TEST: + if (ctx->Stencil.Enabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_STENCIL); + ctx->Stencil.Enabled = state; + break; + case GL_TEXTURE_1D: + if (!enable_texture(ctx, state, TEXTURE_1D_BIT)) { + return; + } + break; + case GL_TEXTURE_2D: + if (!enable_texture(ctx, state, TEXTURE_2D_BIT)) { + return; + } + break; + case GL_TEXTURE_3D: + if (!enable_texture(ctx, state, TEXTURE_3D_BIT)) { + return; + } + break; + case GL_TEXTURE_GEN_Q: + { + struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + GLuint newenabled = texUnit->TexGenEnabled & ~Q_BIT; + if (state) + newenabled |= Q_BIT; + if (texUnit->TexGenEnabled == newenabled) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->TexGenEnabled = newenabled; + } + } + break; + case GL_TEXTURE_GEN_R: + { + struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + GLuint newenabled = texUnit->TexGenEnabled & ~R_BIT; + if (state) + newenabled |= R_BIT; + if (texUnit->TexGenEnabled == newenabled) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->TexGenEnabled = newenabled; + } + } + break; + case GL_TEXTURE_GEN_S: + { + struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + GLuint newenabled = texUnit->TexGenEnabled & ~S_BIT; + if (state) + newenabled |= S_BIT; + if (texUnit->TexGenEnabled == newenabled) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->TexGenEnabled = newenabled; + } + } + break; + case GL_TEXTURE_GEN_T: + { + struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + GLuint newenabled = texUnit->TexGenEnabled & ~T_BIT; + if (state) + newenabled |= T_BIT; + if (texUnit->TexGenEnabled == newenabled) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->TexGenEnabled = newenabled; + } + } + break; + +#if FEATURE_ES1 + case GL_TEXTURE_GEN_STR_OES: + /* disable S, T, and R at the same time */ + { + struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + GLuint newenabled = + texUnit->TexGenEnabled & ~STR_BITS; + if (state) + newenabled |= STR_BITS; + if (texUnit->TexGenEnabled == newenabled) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + texUnit->TexGenEnabled = newenabled; + } + } + break; +#endif + + /* + * CLIENT STATE!!! + */ + case GL_VERTEX_ARRAY: + case GL_NORMAL_ARRAY: + case GL_COLOR_ARRAY: + case GL_INDEX_ARRAY: + case GL_TEXTURE_COORD_ARRAY: + case GL_EDGE_FLAG_ARRAY: + case GL_FOG_COORDINATE_ARRAY_EXT: + case GL_SECONDARY_COLOR_ARRAY_EXT: + case GL_POINT_SIZE_ARRAY_OES: + client_state( ctx, cap, state ); + return; + + /* GL_SGI_texture_color_table */ + case GL_TEXTURE_COLOR_TABLE_SGI: + CHECK_EXTENSION(SGI_texture_color_table, cap); + if (ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_TEXTURE); + ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled = state; + break; + + /* GL_ARB_texture_cube_map */ + case GL_TEXTURE_CUBE_MAP_ARB: + CHECK_EXTENSION(ARB_texture_cube_map, cap); + if (!enable_texture(ctx, state, TEXTURE_CUBE_BIT)) { + return; + } + break; + + /* GL_EXT_secondary_color */ + case GL_COLOR_SUM_EXT: + CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program, cap); + if (ctx->Fog.ColorSumEnabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_FOG); + ctx->Fog.ColorSumEnabled = state; + break; + + /* GL_ARB_multisample */ + case GL_MULTISAMPLE_ARB: + if (ctx->Multisample.Enabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); + ctx->Multisample.Enabled = state; + break; + case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: + if (ctx->Multisample.SampleAlphaToCoverage == state) + return; + FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); + ctx->Multisample.SampleAlphaToCoverage = state; + break; + case GL_SAMPLE_ALPHA_TO_ONE_ARB: + if (ctx->Multisample.SampleAlphaToOne == state) + return; + FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); + ctx->Multisample.SampleAlphaToOne = state; + break; + case GL_SAMPLE_COVERAGE_ARB: + if (ctx->Multisample.SampleCoverage == state) + return; + FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); + ctx->Multisample.SampleCoverage = state; + break; + case GL_SAMPLE_COVERAGE_INVERT_ARB: + if (ctx->Multisample.SampleCoverageInvert == state) + return; + FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE); + ctx->Multisample.SampleCoverageInvert = state; + break; + + /* GL_IBM_rasterpos_clip */ + case GL_RASTER_POSITION_UNCLIPPED_IBM: + CHECK_EXTENSION(IBM_rasterpos_clip, cap); + if (ctx->Transform.RasterPositionUnclipped == state) + return; + FLUSH_VERTICES(ctx, _NEW_TRANSFORM); + ctx->Transform.RasterPositionUnclipped = state; + break; + + /* GL_NV_point_sprite */ + case GL_POINT_SPRITE_NV: + CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite, cap); + if (ctx->Point.PointSprite == state) + return; + FLUSH_VERTICES(ctx, _NEW_POINT); + ctx->Point.PointSprite = state; + break; + +#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program + case GL_VERTEX_PROGRAM_ARB: + CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap); + if (ctx->VertexProgram.Enabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_PROGRAM); + ctx->VertexProgram.Enabled = state; + break; + case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: + CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap); + if (ctx->VertexProgram.PointSizeEnabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_PROGRAM); + ctx->VertexProgram.PointSizeEnabled = state; + break; + case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: + CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program, cap); + if (ctx->VertexProgram.TwoSideEnabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_PROGRAM); + ctx->VertexProgram.TwoSideEnabled = state; + break; +#endif +#if FEATURE_NV_vertex_program + case GL_MAP1_VERTEX_ATTRIB0_4_NV: + case GL_MAP1_VERTEX_ATTRIB1_4_NV: + case GL_MAP1_VERTEX_ATTRIB2_4_NV: + case GL_MAP1_VERTEX_ATTRIB3_4_NV: + case GL_MAP1_VERTEX_ATTRIB4_4_NV: + case GL_MAP1_VERTEX_ATTRIB5_4_NV: + case GL_MAP1_VERTEX_ATTRIB6_4_NV: + case GL_MAP1_VERTEX_ATTRIB7_4_NV: + case GL_MAP1_VERTEX_ATTRIB8_4_NV: + case GL_MAP1_VERTEX_ATTRIB9_4_NV: + case GL_MAP1_VERTEX_ATTRIB10_4_NV: + case GL_MAP1_VERTEX_ATTRIB11_4_NV: + case GL_MAP1_VERTEX_ATTRIB12_4_NV: + case GL_MAP1_VERTEX_ATTRIB13_4_NV: + case GL_MAP1_VERTEX_ATTRIB14_4_NV: + case GL_MAP1_VERTEX_ATTRIB15_4_NV: + CHECK_EXTENSION(NV_vertex_program, cap); + { + const GLuint map = (GLuint) (cap - GL_MAP1_VERTEX_ATTRIB0_4_NV); + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map1Attrib[map] = state; + } + break; + case GL_MAP2_VERTEX_ATTRIB0_4_NV: + case GL_MAP2_VERTEX_ATTRIB1_4_NV: + case GL_MAP2_VERTEX_ATTRIB2_4_NV: + case GL_MAP2_VERTEX_ATTRIB3_4_NV: + case GL_MAP2_VERTEX_ATTRIB4_4_NV: + case GL_MAP2_VERTEX_ATTRIB5_4_NV: + case GL_MAP2_VERTEX_ATTRIB6_4_NV: + case GL_MAP2_VERTEX_ATTRIB7_4_NV: + case GL_MAP2_VERTEX_ATTRIB8_4_NV: + case GL_MAP2_VERTEX_ATTRIB9_4_NV: + case GL_MAP2_VERTEX_ATTRIB10_4_NV: + case GL_MAP2_VERTEX_ATTRIB11_4_NV: + case GL_MAP2_VERTEX_ATTRIB12_4_NV: + case GL_MAP2_VERTEX_ATTRIB13_4_NV: + case GL_MAP2_VERTEX_ATTRIB14_4_NV: + case GL_MAP2_VERTEX_ATTRIB15_4_NV: + CHECK_EXTENSION(NV_vertex_program, cap); + { + const GLuint map = (GLuint) (cap - GL_MAP2_VERTEX_ATTRIB0_4_NV); + FLUSH_VERTICES(ctx, _NEW_EVAL); + ctx->Eval.Map2Attrib[map] = state; + } + break; +#endif /* FEATURE_NV_vertex_program */ + +#if FEATURE_NV_fragment_program + case GL_FRAGMENT_PROGRAM_NV: + CHECK_EXTENSION(NV_fragment_program, cap); + if (ctx->FragmentProgram.Enabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_PROGRAM); + ctx->FragmentProgram.Enabled = state; + break; +#endif /* FEATURE_NV_fragment_program */ + + /* GL_NV_texture_rectangle */ + case GL_TEXTURE_RECTANGLE_NV: + CHECK_EXTENSION(NV_texture_rectangle, cap); + if (!enable_texture(ctx, state, TEXTURE_RECT_BIT)) { + return; + } + break; + + /* GL_EXT_stencil_two_side */ + case GL_STENCIL_TEST_TWO_SIDE_EXT: + CHECK_EXTENSION(EXT_stencil_two_side, cap); + if (ctx->Stencil.TestTwoSide == state) + return; + FLUSH_VERTICES(ctx, _NEW_STENCIL); + ctx->Stencil.TestTwoSide = state; + if (state) { + ctx->Stencil._BackFace = 2; + ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL; + } else { + ctx->Stencil._BackFace = 1; + ctx->_TriangleCaps &= ~DD_TRI_TWOSTENCIL; + } + break; + +#if FEATURE_ARB_fragment_program + case GL_FRAGMENT_PROGRAM_ARB: + CHECK_EXTENSION(ARB_fragment_program, cap); + if (ctx->FragmentProgram.Enabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_PROGRAM); + ctx->FragmentProgram.Enabled = state; + break; +#endif /* FEATURE_ARB_fragment_program */ + + /* GL_EXT_depth_bounds_test */ + case GL_DEPTH_BOUNDS_TEST_EXT: + CHECK_EXTENSION(EXT_depth_bounds_test, cap); + if (ctx->Depth.BoundsTest == state) + return; + FLUSH_VERTICES(ctx, _NEW_DEPTH); + ctx->Depth.BoundsTest = state; + break; + + case GL_DEPTH_CLAMP: + if (ctx->Transform.DepthClamp == state) + return; + CHECK_EXTENSION(ARB_depth_clamp, cap); + FLUSH_VERTICES(ctx, _NEW_TRANSFORM); + ctx->Transform.DepthClamp = state; + break; + +#if FEATURE_ATI_fragment_shader + case GL_FRAGMENT_SHADER_ATI: + CHECK_EXTENSION(ATI_fragment_shader, cap); + if (ctx->ATIFragmentShader.Enabled == state) + return; + FLUSH_VERTICES(ctx, _NEW_PROGRAM); + ctx->ATIFragmentShader.Enabled = state; + break; +#endif + + /* GL_MESA_texture_array */ + case GL_TEXTURE_1D_ARRAY_EXT: + CHECK_EXTENSION(MESA_texture_array, cap); + if (!enable_texture(ctx, state, TEXTURE_1D_ARRAY_BIT)) { + return; + } + break; + + case GL_TEXTURE_2D_ARRAY_EXT: + CHECK_EXTENSION(MESA_texture_array, cap); + if (!enable_texture(ctx, state, TEXTURE_2D_ARRAY_BIT)) { + return; + } + break; + + case GL_TEXTURE_CUBE_MAP_SEAMLESS: + CHECK_EXTENSION(ARB_seamless_cube_map, cap); + ctx->Texture.CubeMapSeamless = state; + break; + +#if FEATURE_EXT_transform_feedback + case GL_RASTERIZER_DISCARD: + CHECK_EXTENSION(EXT_transform_feedback, cap); + if (ctx->TransformFeedback.RasterDiscard != state) { + ctx->TransformFeedback.RasterDiscard = state; + FLUSH_VERTICES(ctx, _NEW_TRANSFORM); + } + break; +#endif + + /* GL 3.1 primitive restart. Note: this enum is different from + * GL_PRIMITIVE_RESTART_NV (which is client state). + */ + case GL_PRIMITIVE_RESTART: + if (ctx->VersionMajor * 10 + ctx->VersionMinor < 31) { + goto invalid_enum_error; + } + if (ctx->Array.PrimitiveRestart != state) { + FLUSH_VERTICES(ctx, _NEW_TRANSFORM); + ctx->Array.PrimitiveRestart = state; + } + break; + + /* GL3.0 - GL_framebuffer_sRGB */ + case GL_FRAMEBUFFER_SRGB_EXT: + CHECK_EXTENSION(EXT_framebuffer_sRGB, cap); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); + ctx->Color.sRGBEnabled = state; + break; + + default: + goto invalid_enum_error; + } + + if (ctx->Driver.Enable) { + ctx->Driver.Enable( ctx, cap, state ); + } + + return; + +invalid_enum_error: + _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(0x%x)", + state ? "Enable" : "Disable", cap); +} + + +/** + * Enable GL capability. Called by glEnable() + * \param cap state to enable. + */ +void GLAPIENTRY +_mesa_Enable( GLenum cap ) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + _mesa_set_enable( ctx, cap, GL_TRUE ); +} + + +/** + * Disable GL capability. Called by glDisable() + * \param cap state to disable. + */ +void GLAPIENTRY +_mesa_Disable( GLenum cap ) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + _mesa_set_enable( ctx, cap, GL_FALSE ); +} + + + +/** + * Enable/disable an indexed state var. + */ +void +_mesa_set_enablei(struct gl_context *ctx, GLenum cap, GLuint index, GLboolean state) +{ + ASSERT(state == 0 || state == 1); + switch (cap) { + case GL_BLEND: + if (!ctx->Extensions.EXT_draw_buffers2) { + goto invalid_enum_error; + } + if (index >= ctx->Const.MaxDrawBuffers) { + _mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)", + state ? "glEnableIndexed" : "glDisableIndexed", index); + return; + } + if (((ctx->Color.BlendEnabled >> index) & 1) != state) { + FLUSH_VERTICES(ctx, _NEW_COLOR); + if (state) + ctx->Color.BlendEnabled |= (1 << index); + else + ctx->Color.BlendEnabled &= ~(1 << index); + } + break; + default: + goto invalid_enum_error; + } + return; + +invalid_enum_error: + _mesa_error(ctx, GL_INVALID_ENUM, "%s(cap=%s)", + state ? "glEnablei" : "glDisablei", + _mesa_lookup_enum_by_nr(cap)); +} + + +void GLAPIENTRY +_mesa_DisableIndexed( GLenum cap, GLuint index ) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + _mesa_set_enablei(ctx, cap, index, GL_FALSE); +} + + +void GLAPIENTRY +_mesa_EnableIndexed( GLenum cap, GLuint index ) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + _mesa_set_enablei(ctx, cap, index, GL_TRUE); +} + + +GLboolean GLAPIENTRY +_mesa_IsEnabledIndexed( GLenum cap, GLuint index ) +{ + GET_CURRENT_CONTEXT(ctx); + switch (cap) { + case GL_BLEND: + if (index >= ctx->Const.MaxDrawBuffers) { + _mesa_error(ctx, GL_INVALID_VALUE, "glIsEnabledIndexed(index=%u)", + index); + return GL_FALSE; + } + return (ctx->Color.BlendEnabled >> index) & 1; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabledIndexed(cap=%s)", + _mesa_lookup_enum_by_nr(cap)); + return GL_FALSE; + } +} + + + + +#undef CHECK_EXTENSION +#define CHECK_EXTENSION(EXTNAME) \ + if (!ctx->Extensions.EXTNAME) { \ + goto invalid_enum_error; \ + } + +#undef CHECK_EXTENSION2 +#define CHECK_EXTENSION2(EXT1, EXT2) \ + if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \ + goto invalid_enum_error; \ + } + + +/** + * Helper function to determine whether a texture target is enabled. + */ +static GLboolean +is_texture_enabled(struct gl_context *ctx, GLbitfield bit) +{ + const struct gl_texture_unit *const texUnit = + &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + return (texUnit->Enabled & bit) ? GL_TRUE : GL_FALSE; +} + + +/** + * Return simple enable/disable state. + * + * \param cap state variable to query. + * + * Returns the state of the specified capability from the current GL context. + * For the capabilities associated with extensions verifies that those + * extensions are effectively present before reporting. + */ +GLboolean GLAPIENTRY +_mesa_IsEnabled( GLenum cap ) +{ + GET_CURRENT_CONTEXT(ctx); + switch (cap) { + case GL_ALPHA_TEST: + return ctx->Color.AlphaEnabled; + case GL_AUTO_NORMAL: + return ctx->Eval.AutoNormal; + case GL_BLEND: + return ctx->Color.BlendEnabled & 1; /* return state for buffer[0] */ + case GL_CLIP_PLANE0: + case GL_CLIP_PLANE1: + case GL_CLIP_PLANE2: + case GL_CLIP_PLANE3: + case GL_CLIP_PLANE4: + case GL_CLIP_PLANE5: + return (ctx->Transform.ClipPlanesEnabled >> (cap - GL_CLIP_PLANE0)) & 1; + case GL_COLOR_MATERIAL: + return ctx->Light.ColorMaterialEnabled; + case GL_CULL_FACE: + return ctx->Polygon.CullFlag; + case GL_DEPTH_TEST: + return ctx->Depth.Test; + case GL_DITHER: + return ctx->Color.DitherFlag; + case GL_FOG: + return ctx->Fog.Enabled; + case GL_LIGHTING: + return ctx->Light.Enabled; + case GL_LIGHT0: + case GL_LIGHT1: + case GL_LIGHT2: + case GL_LIGHT3: + case GL_LIGHT4: + case GL_LIGHT5: + case GL_LIGHT6: + case GL_LIGHT7: + return ctx->Light.Light[cap-GL_LIGHT0].Enabled; + case GL_LINE_SMOOTH: + return ctx->Line.SmoothFlag; + case GL_LINE_STIPPLE: + return ctx->Line.StippleFlag; + case GL_INDEX_LOGIC_OP: + return ctx->Color.IndexLogicOpEnabled; + case GL_COLOR_LOGIC_OP: + return ctx->Color.ColorLogicOpEnabled; + case GL_MAP1_COLOR_4: + return ctx->Eval.Map1Color4; + case GL_MAP1_INDEX: + return ctx->Eval.Map1Index; + case GL_MAP1_NORMAL: + return ctx->Eval.Map1Normal; + case GL_MAP1_TEXTURE_COORD_1: + return ctx->Eval.Map1TextureCoord1; + case GL_MAP1_TEXTURE_COORD_2: + return ctx->Eval.Map1TextureCoord2; + case GL_MAP1_TEXTURE_COORD_3: + return ctx->Eval.Map1TextureCoord3; + case GL_MAP1_TEXTURE_COORD_4: + return ctx->Eval.Map1TextureCoord4; + case GL_MAP1_VERTEX_3: + return ctx->Eval.Map1Vertex3; + case GL_MAP1_VERTEX_4: + return ctx->Eval.Map1Vertex4; + case GL_MAP2_COLOR_4: + return ctx->Eval.Map2Color4; + case GL_MAP2_INDEX: + return ctx->Eval.Map2Index; + case GL_MAP2_NORMAL: + return ctx->Eval.Map2Normal; + case GL_MAP2_TEXTURE_COORD_1: + return ctx->Eval.Map2TextureCoord1; + case GL_MAP2_TEXTURE_COORD_2: + return ctx->Eval.Map2TextureCoord2; + case GL_MAP2_TEXTURE_COORD_3: + return ctx->Eval.Map2TextureCoord3; + case GL_MAP2_TEXTURE_COORD_4: + return ctx->Eval.Map2TextureCoord4; + case GL_MAP2_VERTEX_3: + return ctx->Eval.Map2Vertex3; + case GL_MAP2_VERTEX_4: + return ctx->Eval.Map2Vertex4; + case GL_NORMALIZE: + return ctx->Transform.Normalize; + case GL_POINT_SMOOTH: + return ctx->Point.SmoothFlag; + case GL_POLYGON_SMOOTH: + return ctx->Polygon.SmoothFlag; + case GL_POLYGON_STIPPLE: + return ctx->Polygon.StippleFlag; + case GL_POLYGON_OFFSET_POINT: + return ctx->Polygon.OffsetPoint; + case GL_POLYGON_OFFSET_LINE: + return ctx->Polygon.OffsetLine; + case GL_POLYGON_OFFSET_FILL: + /*case GL_POLYGON_OFFSET_EXT:*/ + return ctx->Polygon.OffsetFill; + case GL_RESCALE_NORMAL_EXT: + return ctx->Transform.RescaleNormals; + case GL_SCISSOR_TEST: + return ctx->Scissor.Enabled; + case GL_SHARED_TEXTURE_PALETTE_EXT: + return ctx->Texture.SharedPalette; + case GL_STENCIL_TEST: + return ctx->Stencil.Enabled; + case GL_TEXTURE_1D: + return is_texture_enabled(ctx, TEXTURE_1D_BIT); + case GL_TEXTURE_2D: + return is_texture_enabled(ctx, TEXTURE_2D_BIT); + case GL_TEXTURE_3D: + return is_texture_enabled(ctx, TEXTURE_3D_BIT); + case GL_TEXTURE_GEN_Q: + { + const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + return (texUnit->TexGenEnabled & Q_BIT) ? GL_TRUE : GL_FALSE; + } + } + return GL_FALSE; + case GL_TEXTURE_GEN_R: + { + const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + return (texUnit->TexGenEnabled & R_BIT) ? GL_TRUE : GL_FALSE; + } + } + return GL_FALSE; + case GL_TEXTURE_GEN_S: + { + const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + return (texUnit->TexGenEnabled & S_BIT) ? GL_TRUE : GL_FALSE; + } + } + return GL_FALSE; + case GL_TEXTURE_GEN_T: + { + const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + return (texUnit->TexGenEnabled & T_BIT) ? GL_TRUE : GL_FALSE; + } + } + return GL_FALSE; +#if FEATURE_ES1 + case GL_TEXTURE_GEN_STR_OES: + { + const struct gl_texture_unit *texUnit = get_texcoord_unit(ctx); + if (texUnit) { + return (texUnit->TexGenEnabled & STR_BITS) == STR_BITS ? GL_TRUE : GL_FALSE; + } + } +#endif + + /* + * CLIENT STATE!!! + */ + case GL_VERTEX_ARRAY: + return (ctx->Array.ArrayObj->Vertex.Enabled != 0); + case GL_NORMAL_ARRAY: + return (ctx->Array.ArrayObj->Normal.Enabled != 0); + case GL_COLOR_ARRAY: + return (ctx->Array.ArrayObj->Color.Enabled != 0); + case GL_INDEX_ARRAY: + return (ctx->Array.ArrayObj->Index.Enabled != 0); + case GL_TEXTURE_COORD_ARRAY: + return (ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled != 0); + case GL_EDGE_FLAG_ARRAY: + return (ctx->Array.ArrayObj->EdgeFlag.Enabled != 0); + case GL_FOG_COORDINATE_ARRAY_EXT: + CHECK_EXTENSION(EXT_fog_coord); + return (ctx->Array.ArrayObj->FogCoord.Enabled != 0); + case GL_SECONDARY_COLOR_ARRAY_EXT: + CHECK_EXTENSION(EXT_secondary_color); + return (ctx->Array.ArrayObj->SecondaryColor.Enabled != 0); +#if FEATURE_point_size_array + case GL_POINT_SIZE_ARRAY_OES: + return (ctx->Array.ArrayObj->PointSize.Enabled != 0); +#endif + + /* GL_SGI_texture_color_table */ + case GL_TEXTURE_COLOR_TABLE_SGI: + CHECK_EXTENSION(SGI_texture_color_table); + return ctx->Texture.Unit[ctx->Texture.CurrentUnit].ColorTableEnabled; + + /* GL_ARB_texture_cube_map */ + case GL_TEXTURE_CUBE_MAP_ARB: + CHECK_EXTENSION(ARB_texture_cube_map); + return is_texture_enabled(ctx, TEXTURE_CUBE_BIT); + + /* GL_EXT_secondary_color */ + case GL_COLOR_SUM_EXT: + CHECK_EXTENSION2(EXT_secondary_color, ARB_vertex_program); + return ctx->Fog.ColorSumEnabled; + + /* GL_ARB_multisample */ + case GL_MULTISAMPLE_ARB: + return ctx->Multisample.Enabled; + case GL_SAMPLE_ALPHA_TO_COVERAGE_ARB: + return ctx->Multisample.SampleAlphaToCoverage; + case GL_SAMPLE_ALPHA_TO_ONE_ARB: + return ctx->Multisample.SampleAlphaToOne; + case GL_SAMPLE_COVERAGE_ARB: + return ctx->Multisample.SampleCoverage; + case GL_SAMPLE_COVERAGE_INVERT_ARB: + return ctx->Multisample.SampleCoverageInvert; + + /* GL_IBM_rasterpos_clip */ + case GL_RASTER_POSITION_UNCLIPPED_IBM: + CHECK_EXTENSION(IBM_rasterpos_clip); + return ctx->Transform.RasterPositionUnclipped; + + /* GL_NV_point_sprite */ + case GL_POINT_SPRITE_NV: + CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite) + return ctx->Point.PointSprite; + +#if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program + case GL_VERTEX_PROGRAM_ARB: + CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program); + return ctx->VertexProgram.Enabled; + case GL_VERTEX_PROGRAM_POINT_SIZE_ARB: + CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program); + return ctx->VertexProgram.PointSizeEnabled; + case GL_VERTEX_PROGRAM_TWO_SIDE_ARB: + CHECK_EXTENSION2(ARB_vertex_program, NV_vertex_program); + return ctx->VertexProgram.TwoSideEnabled; +#endif +#if FEATURE_NV_vertex_program + case GL_VERTEX_ATTRIB_ARRAY0_NV: + case GL_VERTEX_ATTRIB_ARRAY1_NV: + case GL_VERTEX_ATTRIB_ARRAY2_NV: + case GL_VERTEX_ATTRIB_ARRAY3_NV: + case GL_VERTEX_ATTRIB_ARRAY4_NV: + case GL_VERTEX_ATTRIB_ARRAY5_NV: + case GL_VERTEX_ATTRIB_ARRAY6_NV: + case GL_VERTEX_ATTRIB_ARRAY7_NV: + case GL_VERTEX_ATTRIB_ARRAY8_NV: + case GL_VERTEX_ATTRIB_ARRAY9_NV: + case GL_VERTEX_ATTRIB_ARRAY10_NV: + case GL_VERTEX_ATTRIB_ARRAY11_NV: + case GL_VERTEX_ATTRIB_ARRAY12_NV: + case GL_VERTEX_ATTRIB_ARRAY13_NV: + case GL_VERTEX_ATTRIB_ARRAY14_NV: + case GL_VERTEX_ATTRIB_ARRAY15_NV: + CHECK_EXTENSION(NV_vertex_program); + { + GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV; + ASSERT(n < Elements(ctx->Array.ArrayObj->VertexAttrib)); + return (ctx->Array.ArrayObj->VertexAttrib[n].Enabled != 0); + } + case GL_MAP1_VERTEX_ATTRIB0_4_NV: + case GL_MAP1_VERTEX_ATTRIB1_4_NV: + case GL_MAP1_VERTEX_ATTRIB2_4_NV: + case GL_MAP1_VERTEX_ATTRIB3_4_NV: + case GL_MAP1_VERTEX_ATTRIB4_4_NV: + case GL_MAP1_VERTEX_ATTRIB5_4_NV: + case GL_MAP1_VERTEX_ATTRIB6_4_NV: + case GL_MAP1_VERTEX_ATTRIB7_4_NV: + case GL_MAP1_VERTEX_ATTRIB8_4_NV: + case GL_MAP1_VERTEX_ATTRIB9_4_NV: + case GL_MAP1_VERTEX_ATTRIB10_4_NV: + case GL_MAP1_VERTEX_ATTRIB11_4_NV: + case GL_MAP1_VERTEX_ATTRIB12_4_NV: + case GL_MAP1_VERTEX_ATTRIB13_4_NV: + case GL_MAP1_VERTEX_ATTRIB14_4_NV: + case GL_MAP1_VERTEX_ATTRIB15_4_NV: + CHECK_EXTENSION(NV_vertex_program); + { + const GLuint map = (GLuint) (cap - GL_MAP1_VERTEX_ATTRIB0_4_NV); + return ctx->Eval.Map1Attrib[map]; + } + case GL_MAP2_VERTEX_ATTRIB0_4_NV: + case GL_MAP2_VERTEX_ATTRIB1_4_NV: + case GL_MAP2_VERTEX_ATTRIB2_4_NV: + case GL_MAP2_VERTEX_ATTRIB3_4_NV: + case GL_MAP2_VERTEX_ATTRIB4_4_NV: + case GL_MAP2_VERTEX_ATTRIB5_4_NV: + case GL_MAP2_VERTEX_ATTRIB6_4_NV: + case GL_MAP2_VERTEX_ATTRIB7_4_NV: + case GL_MAP2_VERTEX_ATTRIB8_4_NV: + case GL_MAP2_VERTEX_ATTRIB9_4_NV: + case GL_MAP2_VERTEX_ATTRIB10_4_NV: + case GL_MAP2_VERTEX_ATTRIB11_4_NV: + case GL_MAP2_VERTEX_ATTRIB12_4_NV: + case GL_MAP2_VERTEX_ATTRIB13_4_NV: + case GL_MAP2_VERTEX_ATTRIB14_4_NV: + case GL_MAP2_VERTEX_ATTRIB15_4_NV: + CHECK_EXTENSION(NV_vertex_program); + { + const GLuint map = (GLuint) (cap - GL_MAP2_VERTEX_ATTRIB0_4_NV); + return ctx->Eval.Map2Attrib[map]; + } +#endif /* FEATURE_NV_vertex_program */ + +#if FEATURE_NV_fragment_program + case GL_FRAGMENT_PROGRAM_NV: + CHECK_EXTENSION(NV_fragment_program); + return ctx->FragmentProgram.Enabled; +#endif /* FEATURE_NV_fragment_program */ + + /* GL_NV_texture_rectangle */ + case GL_TEXTURE_RECTANGLE_NV: + CHECK_EXTENSION(NV_texture_rectangle); + return is_texture_enabled(ctx, TEXTURE_RECT_BIT); + + /* GL_EXT_stencil_two_side */ + case GL_STENCIL_TEST_TWO_SIDE_EXT: + CHECK_EXTENSION(EXT_stencil_two_side); + return ctx->Stencil.TestTwoSide; + +#if FEATURE_ARB_fragment_program + case GL_FRAGMENT_PROGRAM_ARB: + return ctx->FragmentProgram.Enabled; +#endif /* FEATURE_ARB_fragment_program */ + + /* GL_EXT_depth_bounds_test */ + case GL_DEPTH_BOUNDS_TEST_EXT: + CHECK_EXTENSION(EXT_depth_bounds_test); + return ctx->Depth.BoundsTest; + + /* GL_ARB_depth_clamp */ + case GL_DEPTH_CLAMP: + CHECK_EXTENSION(ARB_depth_clamp); + return ctx->Transform.DepthClamp; + +#if FEATURE_ATI_fragment_shader + case GL_FRAGMENT_SHADER_ATI: + CHECK_EXTENSION(ATI_fragment_shader); + return ctx->ATIFragmentShader.Enabled; +#endif /* FEATURE_ATI_fragment_shader */ + + case GL_TEXTURE_CUBE_MAP_SEAMLESS: + CHECK_EXTENSION(ARB_seamless_cube_map); + return ctx->Texture.CubeMapSeamless; + +#if FEATURE_EXT_transform_feedback + case GL_RASTERIZER_DISCARD: + CHECK_EXTENSION(EXT_transform_feedback); + return ctx->TransformFeedback.RasterDiscard; +#endif + + /* GL_NV_primitive_restart */ + case GL_PRIMITIVE_RESTART_NV: + if (!ctx->Extensions.NV_primitive_restart) { + goto invalid_enum_error; + } + return ctx->Array.PrimitiveRestart; + + /* GL 3.1 primitive restart */ + case GL_PRIMITIVE_RESTART: + if (ctx->VersionMajor * 10 + ctx->VersionMinor < 31) { + goto invalid_enum_error; + } + return ctx->Array.PrimitiveRestart; + + /* GL3.0 - GL_framebuffer_sRGB */ + case GL_FRAMEBUFFER_SRGB_EXT: + CHECK_EXTENSION(EXT_framebuffer_sRGB); + return ctx->Color.sRGBEnabled; + + default: + goto invalid_enum_error; + } + + return GL_FALSE; + +invalid_enum_error: + _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled(0x%x)", (int) cap); + return GL_FALSE; +} diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c index 97cbd3c61..b2ff4dc29 100644 --- a/mesalib/src/mesa/main/fbobject.c +++ b/mesalib/src/mesa/main/fbobject.c @@ -1,2487 +1,2494 @@ -/* - * Mesa 3-D graphics library - * Version: 7.1 - * - * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. - * Copyright (C) 1999-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. - */ - - -/* - * GL_EXT/ARB_framebuffer_object extensions - * - * Authors: - * Brian Paul - */ - - -#include "buffers.h" -#include "context.h" -#include "enums.h" -#include "fbobject.h" -#include "formats.h" -#include "framebuffer.h" -#include "hash.h" -#include "macros.h" -#include "mfeatures.h" -#include "mtypes.h" -#include "renderbuffer.h" -#include "state.h" -#include "teximage.h" -#include "texobj.h" - - -/** Set this to 1 to help debug FBO incompleteness problems */ -#define DEBUG_FBO 0 - -/** Set this to 1 to debug/log glBlitFramebuffer() calls */ -#define DEBUG_BLIT 0 - - -/** - * Notes: - * - * None of the GL_EXT_framebuffer_object functions are compiled into - * display lists. - */ - - - -/* - * When glGenRender/FramebuffersEXT() is called we insert pointers to - * these placeholder objects into the hash table. - * Later, when the object ID is first bound, we replace the placeholder - * with the real frame/renderbuffer. - */ -static struct gl_framebuffer DummyFramebuffer; -static struct gl_renderbuffer DummyRenderbuffer; - -/* We bind this framebuffer when applications pass a NULL - * drawable/surface in make current. */ -static struct gl_framebuffer IncompleteFramebuffer; - - -#define IS_CUBE_FACE(TARGET) \ - ((TARGET) >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && \ - (TARGET) <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) - - -static void -delete_dummy_renderbuffer(struct gl_renderbuffer *rb) -{ - /* no op */ -} - -static void -delete_dummy_framebuffer(struct gl_framebuffer *fb) -{ - /* no op */ -} - - -void -_mesa_init_fbobjects(struct gl_context *ctx) -{ - _glthread_INIT_MUTEX(DummyFramebuffer.Mutex); - _glthread_INIT_MUTEX(DummyRenderbuffer.Mutex); - _glthread_INIT_MUTEX(IncompleteFramebuffer.Mutex); - DummyFramebuffer.Delete = delete_dummy_framebuffer; - DummyRenderbuffer.Delete = delete_dummy_renderbuffer; - IncompleteFramebuffer.Delete = delete_dummy_framebuffer; -} - -struct gl_framebuffer * -_mesa_get_incomplete_framebuffer(void) -{ - return &IncompleteFramebuffer; -} - -/** - * Helper routine for getting a gl_renderbuffer. - */ -struct gl_renderbuffer * -_mesa_lookup_renderbuffer(struct gl_context *ctx, GLuint id) -{ - struct gl_renderbuffer *rb; - - if (id == 0) - return NULL; - - rb = (struct gl_renderbuffer *) - _mesa_HashLookup(ctx->Shared->RenderBuffers, id); - return rb; -} - - -/** - * Helper routine for getting a gl_framebuffer. - */ -struct gl_framebuffer * -_mesa_lookup_framebuffer(struct gl_context *ctx, GLuint id) -{ - struct gl_framebuffer *fb; - - if (id == 0) - return NULL; - - fb = (struct gl_framebuffer *) - _mesa_HashLookup(ctx->Shared->FrameBuffers, id); - return fb; -} - - -/** - * Mark the given framebuffer as invalid. This will force the - * test for framebuffer completeness to be done before the framebuffer - * is used. - */ -static void -invalidate_framebuffer(struct gl_framebuffer *fb) -{ - fb->_Status = 0; /* "indeterminate" */ -} - - -/** - * Given a GL_*_ATTACHMENTn token, return a pointer to the corresponding - * gl_renderbuffer_attachment object. - * This function is only used for user-created FB objects, not the - * default / window-system FB object. - * If \p attachment is GL_DEPTH_STENCIL_ATTACHMENT, return a pointer to - * the depth buffer attachment point. - */ -struct gl_renderbuffer_attachment * -_mesa_get_attachment(struct gl_context *ctx, struct gl_framebuffer *fb, - GLenum attachment) -{ - GLuint i; - - assert(fb->Name > 0); - - switch (attachment) { - case GL_COLOR_ATTACHMENT0_EXT: - case GL_COLOR_ATTACHMENT1_EXT: - case GL_COLOR_ATTACHMENT2_EXT: - case GL_COLOR_ATTACHMENT3_EXT: - case GL_COLOR_ATTACHMENT4_EXT: - case GL_COLOR_ATTACHMENT5_EXT: - case GL_COLOR_ATTACHMENT6_EXT: - case GL_COLOR_ATTACHMENT7_EXT: - case GL_COLOR_ATTACHMENT8_EXT: - case GL_COLOR_ATTACHMENT9_EXT: - case GL_COLOR_ATTACHMENT10_EXT: - case GL_COLOR_ATTACHMENT11_EXT: - case GL_COLOR_ATTACHMENT12_EXT: - case GL_COLOR_ATTACHMENT13_EXT: - case GL_COLOR_ATTACHMENT14_EXT: - case GL_COLOR_ATTACHMENT15_EXT: - i = attachment - GL_COLOR_ATTACHMENT0_EXT; - if (i >= ctx->Const.MaxColorAttachments) { - return NULL; - } - return &fb->Attachment[BUFFER_COLOR0 + i]; - case GL_DEPTH_STENCIL_ATTACHMENT: - /* fall-through */ - case GL_DEPTH_BUFFER: - /* fall-through / new in GL 3.0 */ - case GL_DEPTH_ATTACHMENT_EXT: - return &fb->Attachment[BUFFER_DEPTH]; - case GL_STENCIL_BUFFER: - /* fall-through / new in GL 3.0 */ - case GL_STENCIL_ATTACHMENT_EXT: - return &fb->Attachment[BUFFER_STENCIL]; - default: - return NULL; - } -} - - -/** - * As above, but only used for getting attachments of the default / - * window-system framebuffer (not user-created framebuffer objects). - */ -static struct gl_renderbuffer_attachment * -_mesa_get_fb0_attachment(struct gl_context *ctx, struct gl_framebuffer *fb, - GLenum attachment) -{ - assert(fb->Name == 0); - - switch (attachment) { - case GL_FRONT_LEFT: - return &fb->Attachment[BUFFER_FRONT_LEFT]; - case GL_FRONT_RIGHT: - return &fb->Attachment[BUFFER_FRONT_RIGHT]; - case GL_BACK_LEFT: - return &fb->Attachment[BUFFER_BACK_LEFT]; - case GL_BACK_RIGHT: - return &fb->Attachment[BUFFER_BACK_RIGHT]; - case GL_AUX0: - if (fb->Visual.numAuxBuffers == 1) { - return &fb->Attachment[BUFFER_AUX0]; - } - return NULL; - case GL_DEPTH_BUFFER: - /* fall-through / new in GL 3.0 */ - case GL_DEPTH_ATTACHMENT_EXT: - return &fb->Attachment[BUFFER_DEPTH]; - case GL_STENCIL_BUFFER: - /* fall-through / new in GL 3.0 */ - case GL_STENCIL_ATTACHMENT_EXT: - return &fb->Attachment[BUFFER_STENCIL]; - default: - return NULL; - } -} - - - -/** - * Remove any texture or renderbuffer attached to the given attachment - * point. Update reference counts, etc. - */ -void -_mesa_remove_attachment(struct gl_context *ctx, - struct gl_renderbuffer_attachment *att) -{ - if (att->Type == GL_TEXTURE) { - ASSERT(att->Texture); - if (ctx->Driver.FinishRenderTexture) { - /* tell driver that we're done rendering to this texture. */ - ctx->Driver.FinishRenderTexture(ctx, att); - } - _mesa_reference_texobj(&att->Texture, NULL); /* unbind */ - ASSERT(!att->Texture); - } - if (att->Type == GL_TEXTURE || att->Type == GL_RENDERBUFFER_EXT) { - ASSERT(!att->Texture); - _mesa_reference_renderbuffer(&att->Renderbuffer, NULL); /* unbind */ - ASSERT(!att->Renderbuffer); - } - att->Type = GL_NONE; - att->Complete = GL_TRUE; -} - - -/** - * Bind a texture object to an attachment point. - * The previous binding, if any, will be removed first. - */ -void -_mesa_set_texture_attachment(struct gl_context *ctx, - struct gl_framebuffer *fb, - struct gl_renderbuffer_attachment *att, - struct gl_texture_object *texObj, - GLenum texTarget, GLuint level, GLuint zoffset) -{ - if (att->Texture == texObj) { - /* re-attaching same texture */ - ASSERT(att->Type == GL_TEXTURE); - if (ctx->Driver.FinishRenderTexture) - ctx->Driver.FinishRenderTexture(ctx, att); - } - else { - /* new attachment */ - if (ctx->Driver.FinishRenderTexture && att->Texture) - ctx->Driver.FinishRenderTexture(ctx, att); - _mesa_remove_attachment(ctx, att); - att->Type = GL_TEXTURE; - assert(!att->Texture); - _mesa_reference_texobj(&att->Texture, texObj); - } - - /* always update these fields */ - att->TextureLevel = level; - att->CubeMapFace = _mesa_tex_target_to_face(texTarget); - att->Zoffset = zoffset; - att->Complete = GL_FALSE; - - if (att->Texture->Image[att->CubeMapFace][att->TextureLevel]) { - ctx->Driver.RenderTexture(ctx, fb, att); - } - - invalidate_framebuffer(fb); -} - - -/** - * Bind a renderbuffer to an attachment point. - * The previous binding, if any, will be removed first. - */ -void -_mesa_set_renderbuffer_attachment(struct gl_context *ctx, - struct gl_renderbuffer_attachment *att, - struct gl_renderbuffer *rb) -{ - /* XXX check if re-doing same attachment, exit early */ - _mesa_remove_attachment(ctx, att); - att->Type = GL_RENDERBUFFER_EXT; - att->Texture = NULL; /* just to be safe */ - att->Complete = GL_FALSE; - _mesa_reference_renderbuffer(&att->Renderbuffer, rb); -} - - -/** - * Fallback for ctx->Driver.FramebufferRenderbuffer() - * Attach a renderbuffer object to a framebuffer object. - */ -void -_mesa_framebuffer_renderbuffer(struct gl_context *ctx, - struct gl_framebuffer *fb, - GLenum attachment, struct gl_renderbuffer *rb) -{ - struct gl_renderbuffer_attachment *att; - - _glthread_LOCK_MUTEX(fb->Mutex); - - att = _mesa_get_attachment(ctx, fb, attachment); - ASSERT(att); - if (rb) { - _mesa_set_renderbuffer_attachment(ctx, att, rb); - if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { - /* do stencil attachment here (depth already done above) */ - att = _mesa_get_attachment(ctx, fb, GL_STENCIL_ATTACHMENT_EXT); - assert(att); - _mesa_set_renderbuffer_attachment(ctx, att, rb); - } - } - else { - _mesa_remove_attachment(ctx, att); - } - - invalidate_framebuffer(fb); - - _glthread_UNLOCK_MUTEX(fb->Mutex); -} - - -/** - * Fallback for ctx->Driver.ValidateFramebuffer() - * Check if the renderbuffer's formats are supported by the software - * renderer. - * Drivers should probably override this. - */ -void -_mesa_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb) -{ - gl_buffer_index buf; - for (buf = 0; buf < BUFFER_COUNT; buf++) { - const struct gl_renderbuffer *rb = fb->Attachment[buf].Renderbuffer; - if (rb) { - switch (rb->_BaseFormat) { - case GL_ALPHA: - case GL_LUMINANCE_ALPHA: - case GL_LUMINANCE: - case GL_INTENSITY: - case GL_RED: - case GL_RG: - fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED; - return; - default: - /* render buffer format is supported by software rendering */ - ; - } - } - } -} - - -/** - * For debug only. - */ -static void -att_incomplete(const char *msg) -{ -#if DEBUG_FBO - _mesa_debug(NULL, "attachment incomplete: %s\n", msg); -#else - (void) msg; -#endif -} - - -/** - * For debug only. - */ -static void -fbo_incomplete(const char *msg, int index) -{ -#if DEBUG_FBO - _mesa_debug(NULL, "FBO Incomplete: %s [%d]\n", msg, index); -#else - (void) msg; - (void) index; -#endif -} - - -/** - * Is the given base format a legal format for a color renderbuffer? - */ -GLboolean -_mesa_is_legal_color_format(const struct gl_context *ctx, GLenum baseFormat) -{ - switch (baseFormat) { - case GL_RGB: - case GL_RGBA: - return GL_TRUE; - case GL_LUMINANCE: - case GL_LUMINANCE_ALPHA: - case GL_INTENSITY: - case GL_ALPHA: - return ctx->Extensions.ARB_framebuffer_object; - case GL_RED: - case GL_RG: - return ctx->Extensions.ARB_texture_rg; - default: - return GL_FALSE; - } -} - - -/** - * Is the given base format a legal format for a depth/stencil renderbuffer? - */ -static GLboolean -is_legal_depth_format(const struct gl_context *ctx, GLenum baseFormat) -{ - switch (baseFormat) { - case GL_DEPTH_COMPONENT: - case GL_DEPTH_STENCIL_EXT: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -/** - * Test if an attachment point is complete and update its Complete field. - * \param format if GL_COLOR, this is a color attachment point, - * if GL_DEPTH, this is a depth component attachment point, - * if GL_STENCIL, this is a stencil component attachment point. - */ -static void -test_attachment_completeness(const struct gl_context *ctx, GLenum format, - struct gl_renderbuffer_attachment *att) -{ - assert(format == GL_COLOR || format == GL_DEPTH || format == GL_STENCIL); - - /* assume complete */ - att->Complete = GL_TRUE; - - /* Look for reasons why the attachment might be incomplete */ - if (att->Type == GL_TEXTURE) { - const struct gl_texture_object *texObj = att->Texture; - struct gl_texture_image *texImage; - GLenum baseFormat; - - if (!texObj) { - att_incomplete("no texobj"); - att->Complete = GL_FALSE; - return; - } - - texImage = texObj->Image[att->CubeMapFace][att->TextureLevel]; - if (!texImage) { - att_incomplete("no teximage"); - att->Complete = GL_FALSE; - return; - } - if (texImage->Width < 1 || texImage->Height < 1) { - att_incomplete("teximage width/height=0"); - printf("texobj = %u\n", texObj->Name); - printf("level = %d\n", att->TextureLevel); - att->Complete = GL_FALSE; - return; - } - if (texObj->Target == GL_TEXTURE_3D && att->Zoffset >= texImage->Depth) { - att_incomplete("bad z offset"); - att->Complete = GL_FALSE; - return; - } - - baseFormat = _mesa_get_format_base_format(texImage->TexFormat); - - if (format == GL_COLOR) { - if (!_mesa_is_legal_color_format(ctx, baseFormat)) { - att_incomplete("bad format"); - att->Complete = GL_FALSE; - return; - } - if (_mesa_is_format_compressed(texImage->TexFormat)) { - att_incomplete("compressed internalformat"); - att->Complete = GL_FALSE; - return; - } - } - else if (format == GL_DEPTH) { - if (baseFormat == GL_DEPTH_COMPONENT) { - /* OK */ - } - else if (ctx->Extensions.EXT_packed_depth_stencil && - ctx->Extensions.ARB_depth_texture && - baseFormat == GL_DEPTH_STENCIL_EXT) { - /* OK */ - } - else { - att->Complete = GL_FALSE; - att_incomplete("bad depth format"); - return; - } - } - else { - ASSERT(format == GL_STENCIL); - if (ctx->Extensions.EXT_packed_depth_stencil && - ctx->Extensions.ARB_depth_texture && - baseFormat == GL_DEPTH_STENCIL_EXT) { - /* OK */ - } - else { - /* no such thing as stencil-only textures */ - att_incomplete("illegal stencil texture"); - att->Complete = GL_FALSE; - return; - } - } - } - else if (att->Type == GL_RENDERBUFFER_EXT) { - const GLenum baseFormat = - _mesa_get_format_base_format(att->Renderbuffer->Format); - - ASSERT(att->Renderbuffer); - if (!att->Renderbuffer->InternalFormat || - att->Renderbuffer->Width < 1 || - att->Renderbuffer->Height < 1) { - att_incomplete("0x0 renderbuffer"); - att->Complete = GL_FALSE; - return; - } - if (format == GL_COLOR) { - if (!_mesa_is_legal_color_format(ctx, baseFormat)) { - att_incomplete("bad renderbuffer color format"); - att->Complete = GL_FALSE; - return; - } - } - else if (format == GL_DEPTH) { - if (baseFormat == GL_DEPTH_COMPONENT) { - /* OK */ - } - else if (ctx->Extensions.EXT_packed_depth_stencil && - baseFormat == GL_DEPTH_STENCIL_EXT) { - /* OK */ - } - else { - att_incomplete("bad renderbuffer depth format"); - att->Complete = GL_FALSE; - return; - } - } - else { - assert(format == GL_STENCIL); - if (baseFormat == GL_STENCIL_INDEX) { - /* OK */ - } - else if (ctx->Extensions.EXT_packed_depth_stencil && - baseFormat == GL_DEPTH_STENCIL_EXT) { - /* OK */ - } - else { - att->Complete = GL_FALSE; - att_incomplete("bad renderbuffer stencil format"); - return; - } - } - } - else { - ASSERT(att->Type == GL_NONE); - /* complete */ - return; - } -} - - -/** - * Test if the given framebuffer object is complete and update its - * Status field with the results. - * Calls the ctx->Driver.ValidateFramebuffer() function to allow the - * driver to make hardware-specific validation/completeness checks. - * Also update the framebuffer's Width and Height fields if the - * framebuffer is complete. - */ -void -_mesa_test_framebuffer_completeness(struct gl_context *ctx, - struct gl_framebuffer *fb) -{ - GLuint numImages; - GLenum intFormat = GL_NONE; /* color buffers' internal format */ - GLuint minWidth = ~0, minHeight = ~0, maxWidth = 0, maxHeight = 0; - GLint numSamples = -1; - GLint i; - GLuint j; - - assert(fb->Name != 0); - - numImages = 0; - fb->Width = 0; - fb->Height = 0; - - /* Start at -2 to more easily loop over all attachment points. - * -2: depth buffer - * -1: stencil buffer - * >=0: color buffer - */ - for (i = -2; i < (GLint) ctx->Const.MaxColorAttachments; i++) { - struct gl_renderbuffer_attachment *att; - GLenum f; - gl_format mesaFormat; - - /* - * XXX for ARB_fbo, only check color buffers that are named by - * GL_READ_BUFFER and GL_DRAW_BUFFERi. - */ - - /* check for attachment completeness - */ - if (i == -2) { - att = &fb->Attachment[BUFFER_DEPTH]; - test_attachment_completeness(ctx, GL_DEPTH, att); - if (!att->Complete) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT; - fbo_incomplete("depth attachment incomplete", -1); - return; - } - } - else if (i == -1) { - att = &fb->Attachment[BUFFER_STENCIL]; - test_attachment_completeness(ctx, GL_STENCIL, att); - if (!att->Complete) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT; - fbo_incomplete("stencil attachment incomplete", -1); - return; - } - } - else { - att = &fb->Attachment[BUFFER_COLOR0 + i]; - test_attachment_completeness(ctx, GL_COLOR, att); - if (!att->Complete) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT; - fbo_incomplete("color attachment incomplete", i); - return; - } - } - - /* get width, height, format of the renderbuffer/texture - */ - if (att->Type == GL_TEXTURE) { - const struct gl_texture_image *texImg - = att->Texture->Image[att->CubeMapFace][att->TextureLevel]; - minWidth = MIN2(minWidth, texImg->Width); - maxWidth = MAX2(maxWidth, texImg->Width); - minHeight = MIN2(minHeight, texImg->Height); - maxHeight = MAX2(maxHeight, texImg->Height); - f = texImg->_BaseFormat; - mesaFormat = texImg->TexFormat; - numImages++; - if (!_mesa_is_legal_color_format(ctx, f) && - !is_legal_depth_format(ctx, f)) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT; - fbo_incomplete("texture attachment incomplete", -1); - return; - } - } - else if (att->Type == GL_RENDERBUFFER_EXT) { - minWidth = MIN2(minWidth, att->Renderbuffer->Width); - maxWidth = MAX2(minWidth, att->Renderbuffer->Width); - minHeight = MIN2(minHeight, att->Renderbuffer->Height); - maxHeight = MAX2(minHeight, att->Renderbuffer->Height); - f = att->Renderbuffer->InternalFormat; - mesaFormat = att->Renderbuffer->Format; - numImages++; - } - else { - assert(att->Type == GL_NONE); - continue; - } - - if (numSamples < 0) { - /* first buffer */ - numSamples = att->Renderbuffer->NumSamples; - } - - /* check if integer color */ - fb->_IntegerColor = _mesa_is_format_integer_color(mesaFormat); - - /* Error-check width, height, format, samples - */ - if (numImages == 1) { - /* save format, num samples */ - if (i >= 0) { - intFormat = f; - } - } - else { - if (!ctx->Extensions.ARB_framebuffer_object) { - /* check that width, height, format are same */ - if (minWidth != maxWidth || minHeight != maxHeight) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT; - fbo_incomplete("width or height mismatch", -1); - return; - } - /* check that all color buffer have same format */ - if (intFormat != GL_NONE && f != intFormat) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT; - fbo_incomplete("format mismatch", -1); - return; - } - } - if (att->Renderbuffer && - att->Renderbuffer->NumSamples != numSamples) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE; - fbo_incomplete("inconsistant number of samples", i); - return; - } - - } - } - -#if FEATURE_GL - if (ctx->API == API_OPENGL) { - /* Check that all DrawBuffers are present */ - for (j = 0; j < ctx->Const.MaxDrawBuffers; j++) { - if (fb->ColorDrawBuffer[j] != GL_NONE) { - const struct gl_renderbuffer_attachment *att - = _mesa_get_attachment(ctx, fb, fb->ColorDrawBuffer[j]); - assert(att); - if (att->Type == GL_NONE) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT; - fbo_incomplete("missing drawbuffer", j); - return; - } - } - } - - /* Check that the ReadBuffer is present */ - if (fb->ColorReadBuffer != GL_NONE) { - const struct gl_renderbuffer_attachment *att - = _mesa_get_attachment(ctx, fb, fb->ColorReadBuffer); - assert(att); - if (att->Type == GL_NONE) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT; - fbo_incomplete("missing readbuffer", -1); - return; - } - } - } -#else - (void) j; -#endif - - if (numImages == 0) { - fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT; - fbo_incomplete("no attachments", -1); - return; - } - - /* Provisionally set status = COMPLETE ... */ - fb->_Status = GL_FRAMEBUFFER_COMPLETE_EXT; - - /* ... but the driver may say the FB is incomplete. - * Drivers will most likely set the status to GL_FRAMEBUFFER_UNSUPPORTED - * if anything. - */ - if (ctx->Driver.ValidateFramebuffer) { - ctx->Driver.ValidateFramebuffer(ctx, fb); - if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - fbo_incomplete("driver marked FBO as incomplete", -1); - } - } - - if (fb->_Status == GL_FRAMEBUFFER_COMPLETE_EXT) { - /* - * Note that if ARB_framebuffer_object is supported and the attached - * renderbuffers/textures are different sizes, the framebuffer - * width/height will be set to the smallest width/height. - */ - fb->Width = minWidth; - fb->Height = minHeight; - - /* finally, update the visual info for the framebuffer */ - _mesa_update_framebuffer_visual(ctx, fb); - } -} - - -GLboolean GLAPIENTRY -_mesa_IsRenderbufferEXT(GLuint renderbuffer) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - if (renderbuffer) { - struct gl_renderbuffer *rb = _mesa_lookup_renderbuffer(ctx, renderbuffer); - if (rb != NULL && rb != &DummyRenderbuffer) - return GL_TRUE; - } - return GL_FALSE; -} - - -void GLAPIENTRY -_mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) -{ - struct gl_renderbuffer *newRb; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target != GL_RENDERBUFFER_EXT) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBindRenderbufferEXT(target)"); - return; - } - - /* No need to flush here since the render buffer binding has no - * effect on rendering state. - */ - - if (renderbuffer) { - newRb = _mesa_lookup_renderbuffer(ctx, renderbuffer); - if (newRb == &DummyRenderbuffer) { - /* ID was reserved, but no real renderbuffer object made yet */ - newRb = NULL; - } - else if (!newRb && ctx->Extensions.ARB_framebuffer_object) { - /* All RB IDs must be Gen'd */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glBindRenderbuffer(buffer)"); - return; - } - - if (!newRb) { - /* create new renderbuffer object */ - newRb = ctx->Driver.NewRenderbuffer(ctx, renderbuffer); - if (!newRb) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindRenderbufferEXT"); - return; - } - ASSERT(newRb->AllocStorage); - _mesa_HashInsert(ctx->Shared->RenderBuffers, renderbuffer, newRb); - newRb->RefCount = 1; /* referenced by hash table */ - } - } - else { - newRb = NULL; - } - - ASSERT(newRb != &DummyRenderbuffer); - - _mesa_reference_renderbuffer(&ctx->CurrentRenderbuffer, newRb); -} - - -/** - * If the given renderbuffer is anywhere attached to the framebuffer, detach - * the renderbuffer. - * This is used when a renderbuffer object is deleted. - * The spec calls for unbinding. - */ -static void -detach_renderbuffer(struct gl_context *ctx, - struct gl_framebuffer *fb, - struct gl_renderbuffer *rb) -{ - GLuint i; - for (i = 0; i < BUFFER_COUNT; i++) { - if (fb->Attachment[i].Renderbuffer == rb) { - _mesa_remove_attachment(ctx, &fb->Attachment[i]); - } - } - invalidate_framebuffer(fb); -} - - -void GLAPIENTRY -_mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers) -{ - GLint i; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - - for (i = 0; i < n; i++) { - if (renderbuffers[i] > 0) { - struct gl_renderbuffer *rb; - rb = _mesa_lookup_renderbuffer(ctx, renderbuffers[i]); - if (rb) { - /* check if deleting currently bound renderbuffer object */ - if (rb == ctx->CurrentRenderbuffer) { - /* bind default */ - ASSERT(rb->RefCount >= 2); - _mesa_BindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0); - } - - if (ctx->DrawBuffer->Name) { - detach_renderbuffer(ctx, ctx->DrawBuffer, rb); - } - if (ctx->ReadBuffer->Name && ctx->ReadBuffer != ctx->DrawBuffer) { - detach_renderbuffer(ctx, ctx->ReadBuffer, rb); - } - - /* Remove from hash table immediately, to free the ID. - * But the object will not be freed until it's no longer - * referenced anywhere else. - */ - _mesa_HashRemove(ctx->Shared->RenderBuffers, renderbuffers[i]); - - if (rb != &DummyRenderbuffer) { - /* no longer referenced by hash table */ - _mesa_reference_renderbuffer(&rb, NULL); - } - } - } - } -} - - -void GLAPIENTRY -_mesa_GenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint first; - GLint i; - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGenRenderbuffersEXT(n)"); - return; - } - - if (!renderbuffers) - return; - - first = _mesa_HashFindFreeKeyBlock(ctx->Shared->RenderBuffers, n); - - for (i = 0; i < n; i++) { - GLuint name = first + i; - renderbuffers[i] = name; - /* insert dummy placeholder into hash table */ - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); - _mesa_HashInsert(ctx->Shared->RenderBuffers, name, &DummyRenderbuffer); - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); - } -} - - -/** - * Given an internal format token for a render buffer, return the - * corresponding base format (one of GL_RGB, GL_RGBA, GL_STENCIL_INDEX, - * GL_DEPTH_COMPONENT, GL_DEPTH_STENCIL_EXT, GL_ALPHA, GL_LUMINANCE, - * GL_LUMINANCE_ALPHA, GL_INTENSITY, etc). - * - * This is similar to _mesa_base_tex_format() but the set of valid - * internal formats is different. - * - * Note that even if a format is determined to be legal here, validation - * of the FBO may fail if the format is not supported by the driver/GPU. - * - * \param internalFormat as passed to glRenderbufferStorage() - * \return the base internal format, or 0 if internalFormat is illegal - */ -GLenum -_mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) -{ - /* - * Notes: some formats such as alpha, luminance, etc. were added - * with GL_ARB_framebuffer_object. - */ - switch (internalFormat) { - case GL_ALPHA: - case GL_ALPHA4: - case GL_ALPHA8: - case GL_ALPHA12: - case GL_ALPHA16: - return ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0; - case GL_LUMINANCE: - case GL_LUMINANCE4: - case GL_LUMINANCE8: - case GL_LUMINANCE12: - case GL_LUMINANCE16: - return ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0; - case GL_LUMINANCE_ALPHA: - case GL_LUMINANCE4_ALPHA4: - case GL_LUMINANCE6_ALPHA2: - case GL_LUMINANCE8_ALPHA8: - case GL_LUMINANCE12_ALPHA4: - case GL_LUMINANCE12_ALPHA12: - case GL_LUMINANCE16_ALPHA16: - return ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0; - case GL_INTENSITY: - case GL_INTENSITY4: - case GL_INTENSITY8: - case GL_INTENSITY12: - case GL_INTENSITY16: - return ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0; - case GL_RGB: - case GL_R3_G3_B2: - case GL_RGB4: - case GL_RGB5: - case GL_RGB8: - case GL_RGB10: - case GL_RGB12: - case GL_RGB16: - case GL_SRGB8_EXT: - return GL_RGB; - case GL_RGBA: - case GL_RGBA2: - case GL_RGBA4: - case GL_RGB5_A1: - case GL_RGBA8: - case GL_RGB10_A2: - case GL_RGBA12: - case GL_RGBA16: - case GL_RGBA16_SNORM: - case GL_SRGB8_ALPHA8_EXT: - return GL_RGBA; - case GL_STENCIL_INDEX: - case GL_STENCIL_INDEX1_EXT: - case GL_STENCIL_INDEX4_EXT: - case GL_STENCIL_INDEX8_EXT: - case GL_STENCIL_INDEX16_EXT: - return GL_STENCIL_INDEX; - case GL_DEPTH_COMPONENT: - case GL_DEPTH_COMPONENT16: - case GL_DEPTH_COMPONENT24: - case GL_DEPTH_COMPONENT32: - return GL_DEPTH_COMPONENT; - case GL_DEPTH_STENCIL_EXT: - case GL_DEPTH24_STENCIL8_EXT: - if (ctx->Extensions.EXT_packed_depth_stencil) - return GL_DEPTH_STENCIL_EXT; - else - return 0; - case GL_RED: - case GL_R8: - case GL_R16: - return ctx->Extensions.ARB_texture_rg ? GL_RED : 0; - case GL_RG: - case GL_RG8: - case GL_RG16: - return ctx->Extensions.ARB_texture_rg ? GL_RG : 0; - /* XXX add floating point and integer formats eventually */ - default: - return 0; - } -} - - -/** sentinal value, see below */ -#define NO_SAMPLES 1000 - - -/** - * Helper function used by _mesa_RenderbufferStorageEXT() and - * _mesa_RenderbufferStorageMultisample(). - * samples will be NO_SAMPLES if called by _mesa_RenderbufferStorageEXT(). - */ -static void -renderbuffer_storage(GLenum target, GLenum internalFormat, - GLsizei width, GLsizei height, GLsizei samples) -{ - const char *func = samples == NO_SAMPLES ? - "glRenderbufferStorage" : "RenderbufferStorageMultisample"; - struct gl_renderbuffer *rb; - GLenum baseFormat; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target != GL_RENDERBUFFER_EXT) { - _mesa_error(ctx, GL_INVALID_ENUM, "%s(target)", func); - return; - } - - baseFormat = _mesa_base_fbo_format(ctx, internalFormat); - if (baseFormat == 0) { - _mesa_error(ctx, GL_INVALID_ENUM, "%s(internalFormat)", func); - return; - } - - if (width < 1 || width > (GLsizei) ctx->Const.MaxRenderbufferSize) { - _mesa_error(ctx, GL_INVALID_VALUE, "%s(width)", func); - return; - } - - if (height < 1 || height > (GLsizei) ctx->Const.MaxRenderbufferSize) { - _mesa_error(ctx, GL_INVALID_VALUE, "%s(height)", func); - return; - } - - if (samples == NO_SAMPLES) { - /* NumSamples == 0 indicates non-multisampling */ - samples = 0; - } - else if (samples > (GLsizei) ctx->Const.MaxSamples) { - /* note: driver may choose to use more samples than what's requested */ - _mesa_error(ctx, GL_INVALID_VALUE, "%s(samples)", func); - return; - } - - rb = ctx->CurrentRenderbuffer; - if (!rb) { - _mesa_error(ctx, GL_INVALID_OPERATION, "%s", func); - return; - } - - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - - if (rb->InternalFormat == internalFormat && - rb->Width == (GLuint) width && - rb->Height == (GLuint) height) { - /* no change in allocation needed */ - return; - } - - /* These MUST get set by the AllocStorage func */ - rb->Format = MESA_FORMAT_NONE; - rb->NumSamples = samples; - - /* Now allocate the storage */ - ASSERT(rb->AllocStorage); - if (rb->AllocStorage(ctx, rb, internalFormat, width, height)) { - /* No error - check/set fields now */ - assert(rb->Format != MESA_FORMAT_NONE); - assert(rb->Width == (GLuint) width); - assert(rb->Height == (GLuint) height); - rb->InternalFormat = internalFormat; - rb->_BaseFormat = baseFormat; - assert(rb->_BaseFormat != 0); - } - else { - /* Probably ran out of memory - clear the fields */ - rb->Width = 0; - rb->Height = 0; - rb->Format = MESA_FORMAT_NONE; - rb->InternalFormat = GL_NONE; - rb->_BaseFormat = GL_NONE; - rb->NumSamples = 0; - } - - /* - test_framebuffer_completeness(ctx, fb); - */ - /* XXX if this renderbuffer is attached anywhere, invalidate attachment - * points??? - */ -} - - -#if FEATURE_OES_EGL_image -void GLAPIENTRY -_mesa_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image) -{ - struct gl_renderbuffer *rb; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!ctx->Extensions.OES_EGL_image) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glEGLImageTargetRenderbufferStorageOES(unsupported)"); - return; - } - - if (target != GL_RENDERBUFFER) { - _mesa_error(ctx, GL_INVALID_ENUM, - "EGLImageTargetRenderbufferStorageOES"); - return; - } - - rb = ctx->CurrentRenderbuffer; - if (!rb) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "EGLImageTargetRenderbufferStorageOES"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - - ctx->Driver.EGLImageTargetRenderbufferStorage(ctx, rb, image); -} -#endif - - -/** - * Helper function for _mesa_GetRenderbufferParameterivEXT() and - * _mesa_GetFramebufferAttachmentParameterivEXT() - * We have to be careful to respect the base format. For example, if a - * renderbuffer/texture was created with internalFormat=GL_RGB but the - * driver actually chose a GL_RGBA format, when the user queries ALPHA_SIZE - * we need to return zero. - */ -static GLint -get_component_bits(GLenum pname, GLenum baseFormat, gl_format format) -{ - switch (pname) { - case GL_RENDERBUFFER_RED_SIZE_EXT: - case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: - if (baseFormat == GL_RGB || baseFormat == GL_RGBA || - baseFormat == GL_RG || baseFormat == GL_RED) - return _mesa_get_format_bits(format, pname); - else - return 0; - case GL_RENDERBUFFER_GREEN_SIZE_EXT: - case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: - if (baseFormat == GL_RGB || baseFormat == GL_RGBA || baseFormat == GL_RG) - return _mesa_get_format_bits(format, pname); - else - return 0; - case GL_RENDERBUFFER_BLUE_SIZE_EXT: - case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: - if (baseFormat == GL_RGB || baseFormat == GL_RGBA) - return _mesa_get_format_bits(format, pname); - else - return 0; - case GL_RENDERBUFFER_ALPHA_SIZE_EXT: - case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: - if (baseFormat == GL_RGBA || baseFormat == GL_ALPHA || - baseFormat == GL_LUMINANCE_ALPHA) - return _mesa_get_format_bits(format, pname); - else - return 0; - case GL_RENDERBUFFER_DEPTH_SIZE_EXT: - case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: - if (baseFormat == GL_DEPTH_COMPONENT || baseFormat == GL_DEPTH_STENCIL) - return _mesa_get_format_bits(format, pname); - else - return 0; - case GL_RENDERBUFFER_STENCIL_SIZE_EXT: - case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: - if (baseFormat == GL_STENCIL_INDEX || baseFormat == GL_DEPTH_STENCIL) - return _mesa_get_format_bits(format, pname); - else - return 0; - default: - return 0; - } -} - - - -void GLAPIENTRY -_mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, - GLsizei width, GLsizei height) -{ - /* GL_ARB_fbo says calling this function is equivalent to calling - * glRenderbufferStorageMultisample() with samples=0. We pass in - * a token value here just for error reporting purposes. - */ - renderbuffer_storage(target, internalFormat, width, height, NO_SAMPLES); -} - - -void GLAPIENTRY -_mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples, - GLenum internalFormat, - GLsizei width, GLsizei height) -{ - renderbuffer_storage(target, internalFormat, width, height, samples); -} - - -/** - * OpenGL ES version of glRenderBufferStorage. - */ -void GLAPIENTRY -_es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, - GLsizei width, GLsizei height) -{ - switch (internalFormat) { - case GL_RGB565: - /* XXX this confuses GL_RENDERBUFFER_INTERNAL_FORMAT_OES */ - /* choose a closest format */ - internalFormat = GL_RGB5; - break; - default: - break; - } - - renderbuffer_storage(target, internalFormat, width, height, 0); -} - - -void GLAPIENTRY -_mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) -{ - struct gl_renderbuffer *rb; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target != GL_RENDERBUFFER_EXT) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetRenderbufferParameterivEXT(target)"); - return; - } - - rb = ctx->CurrentRenderbuffer; - if (!rb) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetRenderbufferParameterivEXT"); - return; - } - - /* No need to flush here since we're just quering state which is - * not effected by rendering. - */ - - switch (pname) { - case GL_RENDERBUFFER_WIDTH_EXT: - *params = rb->Width; - return; - case GL_RENDERBUFFER_HEIGHT_EXT: - *params = rb->Height; - return; - case GL_RENDERBUFFER_INTERNAL_FORMAT_EXT: - *params = rb->InternalFormat; - return; - case GL_RENDERBUFFER_RED_SIZE_EXT: - case GL_RENDERBUFFER_GREEN_SIZE_EXT: - case GL_RENDERBUFFER_BLUE_SIZE_EXT: - case GL_RENDERBUFFER_ALPHA_SIZE_EXT: - case GL_RENDERBUFFER_DEPTH_SIZE_EXT: - case GL_RENDERBUFFER_STENCIL_SIZE_EXT: - *params = get_component_bits(pname, rb->_BaseFormat, rb->Format); - break; - case GL_RENDERBUFFER_SAMPLES: - if (ctx->Extensions.ARB_framebuffer_object) { - *params = rb->NumSamples; - break; - } - /* fallthrough */ - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetRenderbufferParameterivEXT(target)"); - return; - } -} - - -GLboolean GLAPIENTRY -_mesa_IsFramebufferEXT(GLuint framebuffer) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - if (framebuffer) { - struct gl_framebuffer *rb = _mesa_lookup_framebuffer(ctx, framebuffer); - if (rb != NULL && rb != &DummyFramebuffer) - return GL_TRUE; - } - return GL_FALSE; -} - - -/** - * Check if any of the attachments of the given framebuffer are textures - * (render to texture). Call ctx->Driver.RenderTexture() for such - * attachments. - */ -static void -check_begin_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb) -{ - GLuint i; - ASSERT(ctx->Driver.RenderTexture); - - if (fb->Name == 0) - return; /* can't render to texture with winsys framebuffers */ - - for (i = 0; i < BUFFER_COUNT; i++) { - struct gl_renderbuffer_attachment *att = fb->Attachment + i; - struct gl_texture_object *texObj = att->Texture; - if (texObj - && texObj->Image[att->CubeMapFace][att->TextureLevel]) { - ctx->Driver.RenderTexture(ctx, fb, att); - } - } -} - - -/** - * Examine all the framebuffer's attachments to see if any are textures. - * If so, call ctx->Driver.FinishRenderTexture() for each texture to - * notify the device driver that the texture image may have changed. - */ -static void -check_end_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb) -{ - if (fb->Name == 0) - return; /* can't render to texture with winsys framebuffers */ - - if (ctx->Driver.FinishRenderTexture) { - GLuint i; - for (i = 0; i < BUFFER_COUNT; i++) { - struct gl_renderbuffer_attachment *att = fb->Attachment + i; - if (att->Texture && att->Renderbuffer) { - ctx->Driver.FinishRenderTexture(ctx, att); - } - } - } -} - - -void GLAPIENTRY -_mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) -{ - struct gl_framebuffer *newDrawFb, *newReadFb; - struct gl_framebuffer *oldDrawFb, *oldReadFb; - GLboolean bindReadBuf, bindDrawBuf; - GET_CURRENT_CONTEXT(ctx); - -#ifdef DEBUG - if (ctx->Extensions.ARB_framebuffer_object) { - ASSERT(ctx->Extensions.EXT_framebuffer_object); - ASSERT(ctx->Extensions.EXT_framebuffer_blit); - } -#endif - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (!ctx->Extensions.EXT_framebuffer_object) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBindFramebufferEXT(unsupported)"); - return; - } - - switch (target) { -#if FEATURE_EXT_framebuffer_blit - case GL_DRAW_FRAMEBUFFER_EXT: - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBindFramebufferEXT(target)"); - return; - } - bindDrawBuf = GL_TRUE; - bindReadBuf = GL_FALSE; - break; - case GL_READ_FRAMEBUFFER_EXT: - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBindFramebufferEXT(target)"); - return; - } - bindDrawBuf = GL_FALSE; - bindReadBuf = GL_TRUE; - break; -#endif - case GL_FRAMEBUFFER_EXT: - bindDrawBuf = GL_TRUE; - bindReadBuf = GL_TRUE; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glBindFramebufferEXT(target)"); - return; - } - - if (framebuffer) { - /* Binding a user-created framebuffer object */ - newDrawFb = _mesa_lookup_framebuffer(ctx, framebuffer); - if (newDrawFb == &DummyFramebuffer) { - /* ID was reserved, but no real framebuffer object made yet */ - newDrawFb = NULL; - } - else if (!newDrawFb && ctx->Extensions.ARB_framebuffer_object) { - /* All FBO IDs must be Gen'd */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glBindFramebuffer(buffer)"); - return; - } - - if (!newDrawFb) { - /* create new framebuffer object */ - newDrawFb = ctx->Driver.NewFramebuffer(ctx, framebuffer); - if (!newDrawFb) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindFramebufferEXT"); - return; - } - _mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, newDrawFb); - } - newReadFb = newDrawFb; - } - else { - /* Binding the window system framebuffer (which was originally set - * with MakeCurrent). - */ - newDrawFb = ctx->WinSysDrawBuffer; - newReadFb = ctx->WinSysReadBuffer; - } - - ASSERT(newDrawFb); - ASSERT(newDrawFb != &DummyFramebuffer); - - /* save pointers to current/old framebuffers */ - oldDrawFb = ctx->DrawBuffer; - oldReadFb = ctx->ReadBuffer; - - /* check if really changing bindings */ - if (oldDrawFb == newDrawFb) - bindDrawBuf = GL_FALSE; - if (oldReadFb == newReadFb) - bindReadBuf = GL_FALSE; - - /* - * OK, now bind the new Draw/Read framebuffers, if they're changing. - * - * We also check if we're beginning and/or ending render-to-texture. - * When a framebuffer with texture attachments is unbound, call - * ctx->Driver.FinishRenderTexture(). - * When a framebuffer with texture attachments is bound, call - * ctx->Driver.RenderTexture(). - * - * Note that if the ReadBuffer has texture attachments we don't consider - * that a render-to-texture case. - */ - if (bindReadBuf) { - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - - /* check if old readbuffer was render-to-texture */ - check_end_texture_render(ctx, oldReadFb); - - _mesa_reference_framebuffer(&ctx->ReadBuffer, newReadFb); - } - - if (bindDrawBuf) { - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - - /* check if old read/draw buffers were render-to-texture */ - if (!bindReadBuf) - check_end_texture_render(ctx, oldReadFb); - - if (oldDrawFb != oldReadFb) - check_end_texture_render(ctx, oldDrawFb); - - /* check if newly bound framebuffer has any texture attachments */ - check_begin_texture_render(ctx, newDrawFb); - - _mesa_reference_framebuffer(&ctx->DrawBuffer, newDrawFb); - } - - if ((bindDrawBuf || bindReadBuf) && ctx->Driver.BindFramebuffer) { - ctx->Driver.BindFramebuffer(ctx, target, newDrawFb, newReadFb); - } -} - - -void GLAPIENTRY -_mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) -{ - GLint i; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - - for (i = 0; i < n; i++) { - if (framebuffers[i] > 0) { - struct gl_framebuffer *fb; - fb = _mesa_lookup_framebuffer(ctx, framebuffers[i]); - if (fb) { - ASSERT(fb == &DummyFramebuffer || fb->Name == framebuffers[i]); - - /* check if deleting currently bound framebuffer object */ - if (ctx->Extensions.EXT_framebuffer_blit) { - /* separate draw/read binding points */ - if (fb == ctx->DrawBuffer) { - /* bind default */ - ASSERT(fb->RefCount >= 2); - _mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0); - } - if (fb == ctx->ReadBuffer) { - /* bind default */ - ASSERT(fb->RefCount >= 2); - _mesa_BindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0); - } - } - else { - /* only one binding point for read/draw buffers */ - if (fb == ctx->DrawBuffer || fb == ctx->ReadBuffer) { - /* bind default */ - ASSERT(fb->RefCount >= 2); - _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); - } - } - - /* remove from hash table immediately, to free the ID */ - _mesa_HashRemove(ctx->Shared->FrameBuffers, framebuffers[i]); - - if (fb != &DummyFramebuffer) { - /* But the object will not be freed until it's no longer - * bound in any context. - */ - _mesa_reference_framebuffer(&fb, NULL); - } - } - } - } -} - - -void GLAPIENTRY -_mesa_GenFramebuffersEXT(GLsizei n, GLuint *framebuffers) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint first; - GLint i; - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (n < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGenFramebuffersEXT(n)"); - return; - } - - if (!framebuffers) - return; - - first = _mesa_HashFindFreeKeyBlock(ctx->Shared->FrameBuffers, n); - - for (i = 0; i < n; i++) { - GLuint name = first + i; - framebuffers[i] = name; - /* insert dummy placeholder into hash table */ - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); - _mesa_HashInsert(ctx->Shared->FrameBuffers, name, &DummyFramebuffer); - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); - } -} - - - -GLenum GLAPIENTRY -_mesa_CheckFramebufferStatusEXT(GLenum target) -{ - struct gl_framebuffer *buffer; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0); - - switch (target) { -#if FEATURE_EXT_framebuffer_blit - case GL_DRAW_FRAMEBUFFER_EXT: - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_ENUM, "glCheckFramebufferStatus(target)"); - return 0; - } - buffer = ctx->DrawBuffer; - break; - case GL_READ_FRAMEBUFFER_EXT: - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_ENUM, "glCheckFramebufferStatus(target)"); - return 0; - } - buffer = ctx->ReadBuffer; - break; -#endif - case GL_FRAMEBUFFER_EXT: - buffer = ctx->DrawBuffer; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glCheckFramebufferStatus(target)"); - return 0; /* formerly GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - } - - if (buffer->Name == 0) { - /* The window system / default framebuffer is always complete */ - return GL_FRAMEBUFFER_COMPLETE_EXT; - } - - /* No need to flush here */ - - if (buffer->_Status != GL_FRAMEBUFFER_COMPLETE) { - _mesa_test_framebuffer_completeness(ctx, buffer); - } - - return buffer->_Status; -} - - - -/** - * Common code called by glFramebufferTexture1D/2D/3DEXT(). - */ -static void -framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, - GLenum attachment, GLenum textarget, GLuint texture, - GLint level, GLint zoffset) -{ - struct gl_renderbuffer_attachment *att; - struct gl_texture_object *texObj = NULL; - struct gl_framebuffer *fb; - GLboolean error = GL_FALSE; - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (target) { - case GL_READ_FRAMEBUFFER_EXT: - error = !ctx->Extensions.EXT_framebuffer_blit; - fb = ctx->ReadBuffer; - break; - case GL_DRAW_FRAMEBUFFER_EXT: - error = !ctx->Extensions.EXT_framebuffer_blit; - /* fall-through */ - case GL_FRAMEBUFFER_EXT: - fb = ctx->DrawBuffer; - break; - default: - error = GL_TRUE; - } - - if (error) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture%sEXT(target=0x%x)", caller, target); - return; - } - - ASSERT(fb); - - /* check framebuffer binding */ - if (fb->Name == 0) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture%sEXT", caller); - return; - } - - - /* The textarget, level, and zoffset parameters are only validated if - * texture is non-zero. - */ - if (texture) { - GLboolean err = GL_TRUE; - - texObj = _mesa_lookup_texture(ctx, texture); - if (texObj != NULL) { - if (textarget == 0) { - /* XXX what's the purpose of this? */ - err = (texObj->Target != GL_TEXTURE_3D) && - (texObj->Target != GL_TEXTURE_1D_ARRAY_EXT) && - (texObj->Target != GL_TEXTURE_2D_ARRAY_EXT); - } - else { - err = (texObj->Target == GL_TEXTURE_CUBE_MAP) - ? !IS_CUBE_FACE(textarget) - : (texObj->Target != textarget); - } - } - else { - /* can't render to a non-existant texture */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture%sEXT(non existant texture)", - caller); - return; - } - - if (err) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture%sEXT(texture target mismatch)", - caller); - return; - } - - if (texObj->Target == GL_TEXTURE_3D) { - const GLint maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1); - if (zoffset < 0 || zoffset >= maxSize) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glFramebufferTexture%sEXT(zoffset)", caller); - return; - } - } - else if ((texObj->Target == GL_TEXTURE_1D_ARRAY_EXT) || - (texObj->Target == GL_TEXTURE_2D_ARRAY_EXT)) { - if (zoffset < 0 || zoffset >= ctx->Const.MaxArrayTextureLayers) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glFramebufferTexture%sEXT(layer)", caller); - return; - } - } - - if ((level < 0) || - (level >= _mesa_max_texture_levels(ctx, texObj->Target))) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glFramebufferTexture%sEXT(level)", caller); - return; - } - } - - att = _mesa_get_attachment(ctx, fb, attachment); - if (att == NULL) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture%sEXT(attachment)", caller); - return; - } - - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - - _glthread_LOCK_MUTEX(fb->Mutex); - if (texObj) { - _mesa_set_texture_attachment(ctx, fb, att, texObj, textarget, - level, zoffset); - /* Set the render-to-texture flag. We'll check this flag in - * glTexImage() and friends to determine if we need to revalidate - * any FBOs that might be rendering into this texture. - * This flag never gets cleared since it's non-trivial to determine - * when all FBOs might be done rendering to this texture. That's OK - * though since it's uncommon to render to a texture then repeatedly - * call glTexImage() to change images in the texture. - */ - texObj->_RenderToTexture = GL_TRUE; - } - else { - _mesa_remove_attachment(ctx, att); - } - - invalidate_framebuffer(fb); - - _glthread_UNLOCK_MUTEX(fb->Mutex); -} - - - -void GLAPIENTRY -_mesa_FramebufferTexture1DEXT(GLenum target, GLenum attachment, - GLenum textarget, GLuint texture, GLint level) -{ - GET_CURRENT_CONTEXT(ctx); - - if ((texture != 0) && (textarget != GL_TEXTURE_1D)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture1DEXT(textarget)"); - return; - } - - framebuffer_texture(ctx, "1D", target, attachment, textarget, texture, - level, 0); -} - - -void GLAPIENTRY -_mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment, - GLenum textarget, GLuint texture, GLint level) -{ - GET_CURRENT_CONTEXT(ctx); - - if ((texture != 0) && - (textarget != GL_TEXTURE_2D) && - (textarget != GL_TEXTURE_RECTANGLE_ARB) && - (!IS_CUBE_FACE(textarget))) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture2DEXT(textarget=0x%x)", textarget); - return; - } - - framebuffer_texture(ctx, "2D", target, attachment, textarget, texture, - level, 0); -} - - -void GLAPIENTRY -_mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment, - GLenum textarget, GLuint texture, - GLint level, GLint zoffset) -{ - GET_CURRENT_CONTEXT(ctx); - - if ((texture != 0) && (textarget != GL_TEXTURE_3D)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferTexture3DEXT(textarget)"); - return; - } - - framebuffer_texture(ctx, "3D", target, attachment, textarget, texture, - level, zoffset); -} - - -void GLAPIENTRY -_mesa_FramebufferTextureLayerEXT(GLenum target, GLenum attachment, - GLuint texture, GLint level, GLint layer) -{ - GET_CURRENT_CONTEXT(ctx); - - framebuffer_texture(ctx, "Layer", target, attachment, 0, texture, - level, layer); -} - - -void GLAPIENTRY -_mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, - GLenum renderbufferTarget, - GLuint renderbuffer) -{ - struct gl_renderbuffer_attachment *att; - struct gl_framebuffer *fb; - struct gl_renderbuffer *rb; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (target) { -#if FEATURE_EXT_framebuffer_blit - case GL_DRAW_FRAMEBUFFER_EXT: - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferRenderbufferEXT(target)"); - return; - } - fb = ctx->DrawBuffer; - break; - case GL_READ_FRAMEBUFFER_EXT: - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferRenderbufferEXT(target)"); - return; - } - fb = ctx->ReadBuffer; - break; -#endif - case GL_FRAMEBUFFER_EXT: - fb = ctx->DrawBuffer; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferRenderbufferEXT(target)"); - return; - } - - if (renderbufferTarget != GL_RENDERBUFFER_EXT) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferRenderbufferEXT(renderbufferTarget)"); - return; - } - - if (fb->Name == 0) { - /* Can't attach new renderbuffers to a window system framebuffer */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glFramebufferRenderbufferEXT"); - return; - } - - att = _mesa_get_attachment(ctx, fb, attachment); - if (att == NULL) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferRenderbufferEXT(invalid attachment %s)", - _mesa_lookup_enum_by_nr(attachment)); - return; - } - - if (renderbuffer) { - rb = _mesa_lookup_renderbuffer(ctx, renderbuffer); - if (!rb) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferRenderbufferEXT(non-existant" - " renderbuffer %u)", renderbuffer); - return; - } - else if (rb == &DummyRenderbuffer) { - /* This is what NVIDIA does */ - _mesa_error(ctx, GL_INVALID_VALUE, - "glFramebufferRenderbufferEXT(renderbuffer %u)", - renderbuffer); - return; - } - } - else { - /* remove renderbuffer attachment */ - rb = NULL; - } - - if (attachment == GL_DEPTH_STENCIL_ATTACHMENT && - rb && rb->Format != MESA_FORMAT_NONE) { - /* make sure the renderbuffer is a depth/stencil format */ - const GLenum baseFormat = _mesa_get_format_base_format(rb->Format); - if (baseFormat != GL_DEPTH_STENCIL) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferRenderbufferEXT(renderbuffer" - " is not DEPTH_STENCIL format)"); - return; - } - } - - - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - - assert(ctx->Driver.FramebufferRenderbuffer); - ctx->Driver.FramebufferRenderbuffer(ctx, fb, attachment, rb); - - /* Some subsequent GL commands may depend on the framebuffer's visual - * after the binding is updated. Update visual info now. - */ - _mesa_update_framebuffer_visual(ctx, fb); -} - - -void GLAPIENTRY -_mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, - GLenum pname, GLint *params) -{ - const struct gl_renderbuffer_attachment *att; - struct gl_framebuffer *buffer; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - switch (target) { -#if FEATURE_EXT_framebuffer_blit - case GL_DRAW_FRAMEBUFFER_EXT: - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(target)"); - return; - } - buffer = ctx->DrawBuffer; - break; - case GL_READ_FRAMEBUFFER_EXT: - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(target)"); - return; - } - buffer = ctx->ReadBuffer; - break; -#endif - case GL_FRAMEBUFFER_EXT: - buffer = ctx->DrawBuffer; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(target)"); - return; - } - - if (buffer->Name == 0) { - /* the default / window-system FBO */ - att = _mesa_get_fb0_attachment(ctx, buffer, attachment); - } - else { - /* user-created framebuffer FBO */ - att = _mesa_get_attachment(ctx, buffer, attachment); - } - - if (att == NULL) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(attachment)"); - return; - } - - if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { - /* the depth and stencil attachments must point to the same buffer */ - const struct gl_renderbuffer_attachment *depthAtt, *stencilAtt; - depthAtt = _mesa_get_attachment(ctx, buffer, GL_DEPTH_ATTACHMENT); - stencilAtt = _mesa_get_attachment(ctx, buffer, GL_STENCIL_ATTACHMENT); - if (depthAtt->Renderbuffer != stencilAtt->Renderbuffer) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetFramebufferAttachmentParameterivEXT(DEPTH/STENCIL" - " attachments differ)"); - return; - } - } - - /* No need to flush here */ - - switch (pname) { - case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT: - *params = buffer->Name == 0 ? GL_FRAMEBUFFER_DEFAULT : att->Type; - return; - case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT: - if (att->Type == GL_RENDERBUFFER_EXT) { - *params = att->Renderbuffer->Name; - } - else if (att->Type == GL_TEXTURE) { - *params = att->Texture->Name; - } - else { - assert(att->Type == GL_NONE); - *params = 0; - } - return; - case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT: - if (att->Type == GL_TEXTURE) { - *params = att->TextureLevel; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - } - return; - case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT: - if (att->Type == GL_TEXTURE) { - if (att->Texture && att->Texture->Target == GL_TEXTURE_CUBE_MAP) { - *params = GL_TEXTURE_CUBE_MAP_POSITIVE_X + att->CubeMapFace; - } - else { - *params = 0; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - } - return; - case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT: - if (att->Type == GL_TEXTURE) { - if (att->Texture && att->Texture->Target == GL_TEXTURE_3D) { - *params = att->Zoffset; - } - else { - *params = 0; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - } - return; - case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: - if (!ctx->Extensions.ARB_framebuffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - } - else { - if (ctx->Extensions.EXT_framebuffer_sRGB && ctx->Const.sRGBCapable) { - *params = _mesa_get_format_color_encoding(att->Renderbuffer->Format); - } - else { - /* According to ARB_framebuffer_sRGB, we should return LINEAR - * if the sRGB conversion is unsupported. */ - *params = GL_LINEAR; - } - } - return; - case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: - if (!ctx->Extensions.ARB_framebuffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - return; - } - else { - gl_format format = att->Renderbuffer->Format; - if (format == MESA_FORMAT_CI8 || format == MESA_FORMAT_S8) { - /* special cases */ - *params = GL_INDEX; - } - else { - *params = _mesa_get_format_datatype(format); - } - } - return; - case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: - case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: - case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: - case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: - case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: - case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: - if (!ctx->Extensions.ARB_framebuffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - } - else if (att->Texture) { - const struct gl_texture_image *texImage = - _mesa_select_tex_image(ctx, att->Texture, att->Texture->Target, - att->TextureLevel); - if (texImage) { - *params = get_component_bits(pname, texImage->_BaseFormat, - texImage->TexFormat); - } - else { - *params = 0; - } - } - else if (att->Renderbuffer) { - *params = get_component_bits(pname, att->Renderbuffer->_BaseFormat, - att->Renderbuffer->Format); - } - else { - *params = 0; - } - return; - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - return; - } -} - - -void GLAPIENTRY -_mesa_GenerateMipmapEXT(GLenum target) -{ - struct gl_texture_object *texObj; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - - switch (target) { - case GL_TEXTURE_1D: - case GL_TEXTURE_2D: - case GL_TEXTURE_3D: - case GL_TEXTURE_CUBE_MAP: - /* OK, legal value */ - break; - default: - /* XXX need to implement GL_TEXTURE_1D_ARRAY and GL_TEXTURE_2D_ARRAY */ - _mesa_error(ctx, GL_INVALID_ENUM, "glGenerateMipmapEXT(target)"); - return; - } - - texObj = _mesa_get_current_tex_object(ctx, target); - - if (texObj->BaseLevel >= texObj->MaxLevel) { - /* nothing to do */ - return; - } - - if (texObj->Target == GL_TEXTURE_CUBE_MAP && - !_mesa_cube_complete(texObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGenerateMipmap(incomplete cube map)"); - return; - } - - _mesa_lock_texture(ctx, texObj); - if (target == GL_TEXTURE_CUBE_MAP) { - GLuint face; - for (face = 0; face < 6; face++) - ctx->Driver.GenerateMipmap(ctx, - GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + face, - texObj); - } - else { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unlock_texture(ctx, texObj); -} - - -#if FEATURE_EXT_framebuffer_blit - -static const struct gl_renderbuffer_attachment * -find_attachment(const struct gl_framebuffer *fb, - const struct gl_renderbuffer *rb) -{ - GLuint i; - for (i = 0; i < Elements(fb->Attachment); i++) { - if (fb->Attachment[i].Renderbuffer == rb) - return &fb->Attachment[i]; - } - return NULL; -} - - - -/** - * Blit rectangular region, optionally from one framebuffer to another. - * - * Note, if the src buffer is multisampled and the dest is not, this is - * when the samples must be resolved to a single color. - */ -void GLAPIENTRY -_mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, - GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, - GLbitfield mask, GLenum filter) -{ - const GLbitfield legalMaskBits = (GL_COLOR_BUFFER_BIT | - GL_DEPTH_BUFFER_BIT | - GL_STENCIL_BUFFER_BIT); - const struct gl_framebuffer *readFb, *drawFb; - const struct gl_renderbuffer *colorReadRb, *colorDrawRb; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - FLUSH_VERTICES(ctx, _NEW_BUFFERS); - - if (ctx->NewState) { - _mesa_update_state(ctx); - } - - readFb = ctx->ReadBuffer; - drawFb = ctx->DrawBuffer; - - if (!readFb || !drawFb) { - /* This will normally never happen but someday we may want to - * support MakeCurrent() with no drawables. - */ - return; - } - - /* check for complete framebuffers */ - if (drawFb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT || - readFb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { - _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, - "glBlitFramebufferEXT(incomplete draw/read buffers)"); - return; - } - - if (filter != GL_NEAREST && filter != GL_LINEAR) { - _mesa_error(ctx, GL_INVALID_ENUM, "glBlitFramebufferEXT(filter)"); - return; - } - - if (mask & ~legalMaskBits) { - _mesa_error( ctx, GL_INVALID_VALUE, "glBlitFramebufferEXT(mask)"); - return; - } - - /* depth/stencil must be blitted with nearest filtering */ - if ((mask & (GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)) - && filter != GL_NEAREST) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBlitFramebufferEXT(depth/stencil requires GL_NEAREST filter"); - return; - } - - /* get color read/draw renderbuffers */ - if (mask & GL_COLOR_BUFFER_BIT) { - colorReadRb = readFb->_ColorReadBuffer; - colorDrawRb = drawFb->_ColorDrawBuffers[0]; - } - else { - colorReadRb = colorDrawRb = NULL; - } - - if (mask & GL_STENCIL_BUFFER_BIT) { - struct gl_renderbuffer *readRb = readFb->_StencilBuffer; - struct gl_renderbuffer *drawRb = drawFb->_StencilBuffer; - if (!readRb || - !drawRb || - _mesa_get_format_bits(readRb->Format, GL_STENCIL_BITS) != - _mesa_get_format_bits(drawRb->Format, GL_STENCIL_BITS)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBlitFramebufferEXT(stencil buffer size mismatch"); - return; - } - } - - if (mask & GL_DEPTH_BUFFER_BIT) { - struct gl_renderbuffer *readRb = readFb->_DepthBuffer; - struct gl_renderbuffer *drawRb = drawFb->_DepthBuffer; - if (!readRb || - !drawRb || - _mesa_get_format_bits(readRb->Format, GL_DEPTH_BITS) != - _mesa_get_format_bits(drawRb->Format, GL_DEPTH_BITS)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBlitFramebufferEXT(depth buffer size mismatch"); - return; - } - } - - if (readFb->Visual.samples > 0 && - drawFb->Visual.samples > 0 && - readFb->Visual.samples != drawFb->Visual.samples) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBlitFramebufferEXT(mismatched samples"); - return; - } - - /* extra checks for multisample copies... */ - if (readFb->Visual.samples > 0 || drawFb->Visual.samples > 0) { - /* src and dest region sizes must be the same */ - if (srcX1 - srcX0 != dstX1 - dstX0 || - srcY1 - srcY0 != dstY1 - dstY0) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBlitFramebufferEXT(bad src/dst multisample region sizes"); - return; - } - - /* color formats must match */ - if (colorReadRb && - colorDrawRb && - colorReadRb->Format != colorDrawRb->Format) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBlitFramebufferEXT(bad src/dst multisample pixel formats"); - return; - } - } - - if (!ctx->Extensions.EXT_framebuffer_blit) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT"); - return; - } - - /* Debug code */ - if (DEBUG_BLIT) { - printf("glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d," - " 0x%x, 0x%x)\n", - srcX0, srcY0, srcX1, srcY1, - dstX0, dstY0, dstX1, dstY1, - mask, filter); - if (colorReadRb) { - const struct gl_renderbuffer_attachment *att; - - att = find_attachment(readFb, colorReadRb); - printf(" Src FBO %u RB %u (%dx%d) ", - readFb->Name, colorReadRb->Name, - colorReadRb->Width, colorReadRb->Height); - if (att && att->Texture) { - printf("Tex %u tgt 0x%x level %u face %u", - att->Texture->Name, - att->Texture->Target, - att->TextureLevel, - att->CubeMapFace); - } - printf("\n"); - - att = find_attachment(drawFb, colorDrawRb); - printf(" Dst FBO %u RB %u (%dx%d) ", - drawFb->Name, colorDrawRb->Name, - colorDrawRb->Width, colorDrawRb->Height); - if (att && att->Texture) { - printf("Tex %u tgt 0x%x level %u face %u", - att->Texture->Name, - att->Texture->Target, - att->TextureLevel, - att->CubeMapFace); - } - printf("\n"); - } - } - - ASSERT(ctx->Driver.BlitFramebuffer); - ctx->Driver.BlitFramebuffer(ctx, - srcX0, srcY0, srcX1, srcY1, - dstX0, dstY0, dstX1, dstY1, - mask, filter); -} -#endif /* FEATURE_EXT_framebuffer_blit */ - -#if FEATURE_ARB_geometry_shader4 -void GLAPIENTRY -_mesa_FramebufferTextureARB(GLenum target, GLenum attachment, - GLuint texture, GLint level) -{ - GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTextureARB " - "not implemented!"); -} - -void GLAPIENTRY -_mesa_FramebufferTextureFaceARB(GLenum target, GLenum attachment, - GLuint texture, GLint level, GLenum face) -{ - GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTextureFaceARB " - "not implemented!"); -} -#endif /* FEATURE_ARB_geometry_shader4 */ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 1999-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. + */ + + +/* + * GL_EXT/ARB_framebuffer_object extensions + * + * Authors: + * Brian Paul + */ + + +#include "buffers.h" +#include "context.h" +#include "enums.h" +#include "fbobject.h" +#include "formats.h" +#include "framebuffer.h" +#include "hash.h" +#include "macros.h" +#include "mfeatures.h" +#include "mtypes.h" +#include "renderbuffer.h" +#include "state.h" +#include "teximage.h" +#include "texobj.h" + + +/** Set this to 1 to help debug FBO incompleteness problems */ +#define DEBUG_FBO 0 + +/** Set this to 1 to debug/log glBlitFramebuffer() calls */ +#define DEBUG_BLIT 0 + + +/** + * Notes: + * + * None of the GL_EXT_framebuffer_object functions are compiled into + * display lists. + */ + + + +/* + * When glGenRender/FramebuffersEXT() is called we insert pointers to + * these placeholder objects into the hash table. + * Later, when the object ID is first bound, we replace the placeholder + * with the real frame/renderbuffer. + */ +static struct gl_framebuffer DummyFramebuffer; +static struct gl_renderbuffer DummyRenderbuffer; + +/* We bind this framebuffer when applications pass a NULL + * drawable/surface in make current. */ +static struct gl_framebuffer IncompleteFramebuffer; + + +#define IS_CUBE_FACE(TARGET) \ + ((TARGET) >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && \ + (TARGET) <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) + + +static void +delete_dummy_renderbuffer(struct gl_renderbuffer *rb) +{ + /* no op */ +} + +static void +delete_dummy_framebuffer(struct gl_framebuffer *fb) +{ + /* no op */ +} + + +void +_mesa_init_fbobjects(struct gl_context *ctx) +{ + _glthread_INIT_MUTEX(DummyFramebuffer.Mutex); + _glthread_INIT_MUTEX(DummyRenderbuffer.Mutex); + _glthread_INIT_MUTEX(IncompleteFramebuffer.Mutex); + DummyFramebuffer.Delete = delete_dummy_framebuffer; + DummyRenderbuffer.Delete = delete_dummy_renderbuffer; + IncompleteFramebuffer.Delete = delete_dummy_framebuffer; +} + +struct gl_framebuffer * +_mesa_get_incomplete_framebuffer(void) +{ + return &IncompleteFramebuffer; +} + +/** + * Helper routine for getting a gl_renderbuffer. + */ +struct gl_renderbuffer * +_mesa_lookup_renderbuffer(struct gl_context *ctx, GLuint id) +{ + struct gl_renderbuffer *rb; + + if (id == 0) + return NULL; + + rb = (struct gl_renderbuffer *) + _mesa_HashLookup(ctx->Shared->RenderBuffers, id); + return rb; +} + + +/** + * Helper routine for getting a gl_framebuffer. + */ +struct gl_framebuffer * +_mesa_lookup_framebuffer(struct gl_context *ctx, GLuint id) +{ + struct gl_framebuffer *fb; + + if (id == 0) + return NULL; + + fb = (struct gl_framebuffer *) + _mesa_HashLookup(ctx->Shared->FrameBuffers, id); + return fb; +} + + +/** + * Mark the given framebuffer as invalid. This will force the + * test for framebuffer completeness to be done before the framebuffer + * is used. + */ +static void +invalidate_framebuffer(struct gl_framebuffer *fb) +{ + fb->_Status = 0; /* "indeterminate" */ +} + + +/** + * Given a GL_*_ATTACHMENTn token, return a pointer to the corresponding + * gl_renderbuffer_attachment object. + * This function is only used for user-created FB objects, not the + * default / window-system FB object. + * If \p attachment is GL_DEPTH_STENCIL_ATTACHMENT, return a pointer to + * the depth buffer attachment point. + */ +struct gl_renderbuffer_attachment * +_mesa_get_attachment(struct gl_context *ctx, struct gl_framebuffer *fb, + GLenum attachment) +{ + GLuint i; + + assert(fb->Name > 0); + + switch (attachment) { + case GL_COLOR_ATTACHMENT0_EXT: + case GL_COLOR_ATTACHMENT1_EXT: + case GL_COLOR_ATTACHMENT2_EXT: + case GL_COLOR_ATTACHMENT3_EXT: + case GL_COLOR_ATTACHMENT4_EXT: + case GL_COLOR_ATTACHMENT5_EXT: + case GL_COLOR_ATTACHMENT6_EXT: + case GL_COLOR_ATTACHMENT7_EXT: + case GL_COLOR_ATTACHMENT8_EXT: + case GL_COLOR_ATTACHMENT9_EXT: + case GL_COLOR_ATTACHMENT10_EXT: + case GL_COLOR_ATTACHMENT11_EXT: + case GL_COLOR_ATTACHMENT12_EXT: + case GL_COLOR_ATTACHMENT13_EXT: + case GL_COLOR_ATTACHMENT14_EXT: + case GL_COLOR_ATTACHMENT15_EXT: + i = attachment - GL_COLOR_ATTACHMENT0_EXT; + if (i >= ctx->Const.MaxColorAttachments) { + return NULL; + } + return &fb->Attachment[BUFFER_COLOR0 + i]; + case GL_DEPTH_STENCIL_ATTACHMENT: + /* fall-through */ + case GL_DEPTH_BUFFER: + /* fall-through / new in GL 3.0 */ + case GL_DEPTH_ATTACHMENT_EXT: + return &fb->Attachment[BUFFER_DEPTH]; + case GL_STENCIL_BUFFER: + /* fall-through / new in GL 3.0 */ + case GL_STENCIL_ATTACHMENT_EXT: + return &fb->Attachment[BUFFER_STENCIL]; + default: + return NULL; + } +} + + +/** + * As above, but only used for getting attachments of the default / + * window-system framebuffer (not user-created framebuffer objects). + */ +static struct gl_renderbuffer_attachment * +_mesa_get_fb0_attachment(struct gl_context *ctx, struct gl_framebuffer *fb, + GLenum attachment) +{ + assert(fb->Name == 0); + + switch (attachment) { + case GL_FRONT_LEFT: + return &fb->Attachment[BUFFER_FRONT_LEFT]; + case GL_FRONT_RIGHT: + return &fb->Attachment[BUFFER_FRONT_RIGHT]; + case GL_BACK_LEFT: + return &fb->Attachment[BUFFER_BACK_LEFT]; + case GL_BACK_RIGHT: + return &fb->Attachment[BUFFER_BACK_RIGHT]; + case GL_AUX0: + if (fb->Visual.numAuxBuffers == 1) { + return &fb->Attachment[BUFFER_AUX0]; + } + return NULL; + case GL_DEPTH_BUFFER: + /* fall-through / new in GL 3.0 */ + case GL_DEPTH_ATTACHMENT_EXT: + return &fb->Attachment[BUFFER_DEPTH]; + case GL_STENCIL_BUFFER: + /* fall-through / new in GL 3.0 */ + case GL_STENCIL_ATTACHMENT_EXT: + return &fb->Attachment[BUFFER_STENCIL]; + default: + return NULL; + } +} + + + +/** + * Remove any texture or renderbuffer attached to the given attachment + * point. Update reference counts, etc. + */ +void +_mesa_remove_attachment(struct gl_context *ctx, + struct gl_renderbuffer_attachment *att) +{ + if (att->Type == GL_TEXTURE) { + ASSERT(att->Texture); + if (ctx->Driver.FinishRenderTexture) { + /* tell driver that we're done rendering to this texture. */ + ctx->Driver.FinishRenderTexture(ctx, att); + } + _mesa_reference_texobj(&att->Texture, NULL); /* unbind */ + ASSERT(!att->Texture); + } + if (att->Type == GL_TEXTURE || att->Type == GL_RENDERBUFFER_EXT) { + ASSERT(!att->Texture); + _mesa_reference_renderbuffer(&att->Renderbuffer, NULL); /* unbind */ + ASSERT(!att->Renderbuffer); + } + att->Type = GL_NONE; + att->Complete = GL_TRUE; +} + + +/** + * Bind a texture object to an attachment point. + * The previous binding, if any, will be removed first. + */ +void +_mesa_set_texture_attachment(struct gl_context *ctx, + struct gl_framebuffer *fb, + struct gl_renderbuffer_attachment *att, + struct gl_texture_object *texObj, + GLenum texTarget, GLuint level, GLuint zoffset) +{ + if (att->Texture == texObj) { + /* re-attaching same texture */ + ASSERT(att->Type == GL_TEXTURE); + if (ctx->Driver.FinishRenderTexture) + ctx->Driver.FinishRenderTexture(ctx, att); + } + else { + /* new attachment */ + if (ctx->Driver.FinishRenderTexture && att->Texture) + ctx->Driver.FinishRenderTexture(ctx, att); + _mesa_remove_attachment(ctx, att); + att->Type = GL_TEXTURE; + assert(!att->Texture); + _mesa_reference_texobj(&att->Texture, texObj); + } + + /* always update these fields */ + att->TextureLevel = level; + att->CubeMapFace = _mesa_tex_target_to_face(texTarget); + att->Zoffset = zoffset; + att->Complete = GL_FALSE; + + if (att->Texture->Image[att->CubeMapFace][att->TextureLevel]) { + ctx->Driver.RenderTexture(ctx, fb, att); + } + + invalidate_framebuffer(fb); +} + + +/** + * Bind a renderbuffer to an attachment point. + * The previous binding, if any, will be removed first. + */ +void +_mesa_set_renderbuffer_attachment(struct gl_context *ctx, + struct gl_renderbuffer_attachment *att, + struct gl_renderbuffer *rb) +{ + /* XXX check if re-doing same attachment, exit early */ + _mesa_remove_attachment(ctx, att); + att->Type = GL_RENDERBUFFER_EXT; + att->Texture = NULL; /* just to be safe */ + att->Complete = GL_FALSE; + _mesa_reference_renderbuffer(&att->Renderbuffer, rb); +} + + +/** + * Fallback for ctx->Driver.FramebufferRenderbuffer() + * Attach a renderbuffer object to a framebuffer object. + */ +void +_mesa_framebuffer_renderbuffer(struct gl_context *ctx, + struct gl_framebuffer *fb, + GLenum attachment, struct gl_renderbuffer *rb) +{ + struct gl_renderbuffer_attachment *att; + + _glthread_LOCK_MUTEX(fb->Mutex); + + att = _mesa_get_attachment(ctx, fb, attachment); + ASSERT(att); + if (rb) { + _mesa_set_renderbuffer_attachment(ctx, att, rb); + if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { + /* do stencil attachment here (depth already done above) */ + att = _mesa_get_attachment(ctx, fb, GL_STENCIL_ATTACHMENT_EXT); + assert(att); + _mesa_set_renderbuffer_attachment(ctx, att, rb); + } + } + else { + _mesa_remove_attachment(ctx, att); + } + + invalidate_framebuffer(fb); + + _glthread_UNLOCK_MUTEX(fb->Mutex); +} + + +/** + * Fallback for ctx->Driver.ValidateFramebuffer() + * Check if the renderbuffer's formats are supported by the software + * renderer. + * Drivers should probably override this. + */ +void +_mesa_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb) +{ + gl_buffer_index buf; + for (buf = 0; buf < BUFFER_COUNT; buf++) { + const struct gl_renderbuffer *rb = fb->Attachment[buf].Renderbuffer; + if (rb) { + switch (rb->_BaseFormat) { + case GL_ALPHA: + case GL_LUMINANCE_ALPHA: + case GL_LUMINANCE: + case GL_INTENSITY: + case GL_RED: + case GL_RG: + fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED; + return; + default: + /* render buffer format is supported by software rendering */ + ; + } + } + } +} + + +/** + * For debug only. + */ +static void +att_incomplete(const char *msg) +{ +#if DEBUG_FBO + _mesa_debug(NULL, "attachment incomplete: %s\n", msg); +#else + (void) msg; +#endif +} + + +/** + * For debug only. + */ +static void +fbo_incomplete(const char *msg, int index) +{ +#if DEBUG_FBO + _mesa_debug(NULL, "FBO Incomplete: %s [%d]\n", msg, index); +#else + (void) msg; + (void) index; +#endif +} + + +/** + * Is the given base format a legal format for a color renderbuffer? + */ +GLboolean +_mesa_is_legal_color_format(const struct gl_context *ctx, GLenum baseFormat) +{ + switch (baseFormat) { + case GL_RGB: + case GL_RGBA: + return GL_TRUE; + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + case GL_INTENSITY: + case GL_ALPHA: + return ctx->Extensions.ARB_framebuffer_object; + case GL_RED: + case GL_RG: + return ctx->Extensions.ARB_texture_rg; + default: + return GL_FALSE; + } +} + + +/** + * Is the given base format a legal format for a depth/stencil renderbuffer? + */ +static GLboolean +is_legal_depth_format(const struct gl_context *ctx, GLenum baseFormat) +{ + switch (baseFormat) { + case GL_DEPTH_COMPONENT: + case GL_DEPTH_STENCIL_EXT: + return GL_TRUE; + default: + return GL_FALSE; + } +} + + +/** + * Test if an attachment point is complete and update its Complete field. + * \param format if GL_COLOR, this is a color attachment point, + * if GL_DEPTH, this is a depth component attachment point, + * if GL_STENCIL, this is a stencil component attachment point. + */ +static void +test_attachment_completeness(const struct gl_context *ctx, GLenum format, + struct gl_renderbuffer_attachment *att) +{ + assert(format == GL_COLOR || format == GL_DEPTH || format == GL_STENCIL); + + /* assume complete */ + att->Complete = GL_TRUE; + + /* Look for reasons why the attachment might be incomplete */ + if (att->Type == GL_TEXTURE) { + const struct gl_texture_object *texObj = att->Texture; + struct gl_texture_image *texImage; + GLenum baseFormat; + + if (!texObj) { + att_incomplete("no texobj"); + att->Complete = GL_FALSE; + return; + } + + texImage = texObj->Image[att->CubeMapFace][att->TextureLevel]; + if (!texImage) { + att_incomplete("no teximage"); + att->Complete = GL_FALSE; + return; + } + if (texImage->Width < 1 || texImage->Height < 1) { + att_incomplete("teximage width/height=0"); + printf("texobj = %u\n", texObj->Name); + printf("level = %d\n", att->TextureLevel); + att->Complete = GL_FALSE; + return; + } + if (texObj->Target == GL_TEXTURE_3D && att->Zoffset >= texImage->Depth) { + att_incomplete("bad z offset"); + att->Complete = GL_FALSE; + return; + } + + baseFormat = _mesa_get_format_base_format(texImage->TexFormat); + + if (format == GL_COLOR) { + if (!_mesa_is_legal_color_format(ctx, baseFormat)) { + att_incomplete("bad format"); + att->Complete = GL_FALSE; + return; + } + if (_mesa_is_format_compressed(texImage->TexFormat)) { + att_incomplete("compressed internalformat"); + att->Complete = GL_FALSE; + return; + } + } + else if (format == GL_DEPTH) { + if (baseFormat == GL_DEPTH_COMPONENT) { + /* OK */ + } + else if (ctx->Extensions.EXT_packed_depth_stencil && + ctx->Extensions.ARB_depth_texture && + baseFormat == GL_DEPTH_STENCIL_EXT) { + /* OK */ + } + else { + att->Complete = GL_FALSE; + att_incomplete("bad depth format"); + return; + } + } + else { + ASSERT(format == GL_STENCIL); + if (ctx->Extensions.EXT_packed_depth_stencil && + ctx->Extensions.ARB_depth_texture && + baseFormat == GL_DEPTH_STENCIL_EXT) { + /* OK */ + } + else { + /* no such thing as stencil-only textures */ + att_incomplete("illegal stencil texture"); + att->Complete = GL_FALSE; + return; + } + } + } + else if (att->Type == GL_RENDERBUFFER_EXT) { + const GLenum baseFormat = + _mesa_get_format_base_format(att->Renderbuffer->Format); + + ASSERT(att->Renderbuffer); + if (!att->Renderbuffer->InternalFormat || + att->Renderbuffer->Width < 1 || + att->Renderbuffer->Height < 1) { + att_incomplete("0x0 renderbuffer"); + att->Complete = GL_FALSE; + return; + } + if (format == GL_COLOR) { + if (!_mesa_is_legal_color_format(ctx, baseFormat)) { + att_incomplete("bad renderbuffer color format"); + att->Complete = GL_FALSE; + return; + } + } + else if (format == GL_DEPTH) { + if (baseFormat == GL_DEPTH_COMPONENT) { + /* OK */ + } + else if (ctx->Extensions.EXT_packed_depth_stencil && + baseFormat == GL_DEPTH_STENCIL_EXT) { + /* OK */ + } + else { + att_incomplete("bad renderbuffer depth format"); + att->Complete = GL_FALSE; + return; + } + } + else { + assert(format == GL_STENCIL); + if (baseFormat == GL_STENCIL_INDEX) { + /* OK */ + } + else if (ctx->Extensions.EXT_packed_depth_stencil && + baseFormat == GL_DEPTH_STENCIL_EXT) { + /* OK */ + } + else { + att->Complete = GL_FALSE; + att_incomplete("bad renderbuffer stencil format"); + return; + } + } + } + else { + ASSERT(att->Type == GL_NONE); + /* complete */ + return; + } +} + + +/** + * Test if the given framebuffer object is complete and update its + * Status field with the results. + * Calls the ctx->Driver.ValidateFramebuffer() function to allow the + * driver to make hardware-specific validation/completeness checks. + * Also update the framebuffer's Width and Height fields if the + * framebuffer is complete. + */ +void +_mesa_test_framebuffer_completeness(struct gl_context *ctx, + struct gl_framebuffer *fb) +{ + GLuint numImages; + GLenum intFormat = GL_NONE; /* color buffers' internal format */ + GLuint minWidth = ~0, minHeight = ~0, maxWidth = 0, maxHeight = 0; + GLint numSamples = -1; + GLint i; + GLuint j; + + assert(fb->Name != 0); + + numImages = 0; + fb->Width = 0; + fb->Height = 0; + + /* Start at -2 to more easily loop over all attachment points. + * -2: depth buffer + * -1: stencil buffer + * >=0: color buffer + */ + for (i = -2; i < (GLint) ctx->Const.MaxColorAttachments; i++) { + struct gl_renderbuffer_attachment *att; + GLenum f; + gl_format mesaFormat; + + /* + * XXX for ARB_fbo, only check color buffers that are named by + * GL_READ_BUFFER and GL_DRAW_BUFFERi. + */ + + /* check for attachment completeness + */ + if (i == -2) { + att = &fb->Attachment[BUFFER_DEPTH]; + test_attachment_completeness(ctx, GL_DEPTH, att); + if (!att->Complete) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT; + fbo_incomplete("depth attachment incomplete", -1); + return; + } + } + else if (i == -1) { + att = &fb->Attachment[BUFFER_STENCIL]; + test_attachment_completeness(ctx, GL_STENCIL, att); + if (!att->Complete) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT; + fbo_incomplete("stencil attachment incomplete", -1); + return; + } + } + else { + att = &fb->Attachment[BUFFER_COLOR0 + i]; + test_attachment_completeness(ctx, GL_COLOR, att); + if (!att->Complete) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT; + fbo_incomplete("color attachment incomplete", i); + return; + } + } + + /* get width, height, format of the renderbuffer/texture + */ + if (att->Type == GL_TEXTURE) { + const struct gl_texture_image *texImg + = att->Texture->Image[att->CubeMapFace][att->TextureLevel]; + minWidth = MIN2(minWidth, texImg->Width); + maxWidth = MAX2(maxWidth, texImg->Width); + minHeight = MIN2(minHeight, texImg->Height); + maxHeight = MAX2(maxHeight, texImg->Height); + f = texImg->_BaseFormat; + mesaFormat = texImg->TexFormat; + numImages++; + if (!_mesa_is_legal_color_format(ctx, f) && + !is_legal_depth_format(ctx, f)) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT; + fbo_incomplete("texture attachment incomplete", -1); + return; + } + } + else if (att->Type == GL_RENDERBUFFER_EXT) { + minWidth = MIN2(minWidth, att->Renderbuffer->Width); + maxWidth = MAX2(minWidth, att->Renderbuffer->Width); + minHeight = MIN2(minHeight, att->Renderbuffer->Height); + maxHeight = MAX2(minHeight, att->Renderbuffer->Height); + f = att->Renderbuffer->InternalFormat; + mesaFormat = att->Renderbuffer->Format; + numImages++; + } + else { + assert(att->Type == GL_NONE); + continue; + } + + if (numSamples < 0) { + /* first buffer */ + numSamples = att->Renderbuffer->NumSamples; + } + + /* check if integer color */ + fb->_IntegerColor = _mesa_is_format_integer_color(mesaFormat); + + /* Error-check width, height, format, samples + */ + if (numImages == 1) { + /* save format, num samples */ + if (i >= 0) { + intFormat = f; + } + } + else { + if (!ctx->Extensions.ARB_framebuffer_object) { + /* check that width, height, format are same */ + if (minWidth != maxWidth || minHeight != maxHeight) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT; + fbo_incomplete("width or height mismatch", -1); + return; + } + /* check that all color buffer have same format */ + if (intFormat != GL_NONE && f != intFormat) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT; + fbo_incomplete("format mismatch", -1); + return; + } + } + if (att->Renderbuffer && + att->Renderbuffer->NumSamples != numSamples) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE; + fbo_incomplete("inconsistant number of samples", i); + return; + } + + } + } + +#if FEATURE_GL + if (ctx->API == API_OPENGL) { + /* Check that all DrawBuffers are present */ + for (j = 0; j < ctx->Const.MaxDrawBuffers; j++) { + if (fb->ColorDrawBuffer[j] != GL_NONE) { + const struct gl_renderbuffer_attachment *att + = _mesa_get_attachment(ctx, fb, fb->ColorDrawBuffer[j]); + assert(att); + if (att->Type == GL_NONE) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT; + fbo_incomplete("missing drawbuffer", j); + return; + } + } + } + + /* Check that the ReadBuffer is present */ + if (fb->ColorReadBuffer != GL_NONE) { + const struct gl_renderbuffer_attachment *att + = _mesa_get_attachment(ctx, fb, fb->ColorReadBuffer); + assert(att); + if (att->Type == GL_NONE) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT; + fbo_incomplete("missing readbuffer", -1); + return; + } + } + } +#else + (void) j; +#endif + + if (numImages == 0) { + fb->_Status = GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT; + fbo_incomplete("no attachments", -1); + return; + } + + /* Provisionally set status = COMPLETE ... */ + fb->_Status = GL_FRAMEBUFFER_COMPLETE_EXT; + + /* ... but the driver may say the FB is incomplete. + * Drivers will most likely set the status to GL_FRAMEBUFFER_UNSUPPORTED + * if anything. + */ + if (ctx->Driver.ValidateFramebuffer) { + ctx->Driver.ValidateFramebuffer(ctx, fb); + if (fb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { + fbo_incomplete("driver marked FBO as incomplete", -1); + } + } + + if (fb->_Status == GL_FRAMEBUFFER_COMPLETE_EXT) { + /* + * Note that if ARB_framebuffer_object is supported and the attached + * renderbuffers/textures are different sizes, the framebuffer + * width/height will be set to the smallest width/height. + */ + fb->Width = minWidth; + fb->Height = minHeight; + + /* finally, update the visual info for the framebuffer */ + _mesa_update_framebuffer_visual(ctx, fb); + } +} + + +GLboolean GLAPIENTRY +_mesa_IsRenderbufferEXT(GLuint renderbuffer) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); + if (renderbuffer) { + struct gl_renderbuffer *rb = _mesa_lookup_renderbuffer(ctx, renderbuffer); + if (rb != NULL && rb != &DummyRenderbuffer) + return GL_TRUE; + } + return GL_FALSE; +} + + +void GLAPIENTRY +_mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) +{ + struct gl_renderbuffer *newRb; + GET_CURRENT_CONTEXT(ctx); + + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (target != GL_RENDERBUFFER_EXT) { + _mesa_error(ctx, GL_INVALID_ENUM, "glBindRenderbufferEXT(target)"); + return; + } + + /* No need to flush here since the render buffer binding has no + * effect on rendering state. + */ + + if (renderbuffer) { + newRb = _mesa_lookup_renderbuffer(ctx, renderbuffer); + if (newRb == &DummyRenderbuffer) { + /* ID was reserved, but no real renderbuffer object made yet */ + newRb = NULL; + } + else if (!newRb && ctx->Extensions.ARB_framebuffer_object) { + /* All RB IDs must be Gen'd */ + _mesa_error(ctx, GL_INVALID_OPERATION, "glBindRenderbuffer(buffer)"); + return; + } + + if (!newRb) { + /* create new renderbuffer object */ + newRb = ctx->Driver.NewRenderbuffer(ctx, renderbuffer); + if (!newRb) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindRenderbufferEXT"); + return; + } + ASSERT(newRb->AllocStorage); + _mesa_HashInsert(ctx->Shared->RenderBuffers, renderbuffer, newRb); + newRb->RefCount = 1; /* referenced by hash table */ + } + } + else { + newRb = NULL; + } + + ASSERT(newRb != &DummyRenderbuffer); + + _mesa_reference_renderbuffer(&ctx->CurrentRenderbuffer, newRb); +} + + +/** + * If the given renderbuffer is anywhere attached to the framebuffer, detach + * the renderbuffer. + * This is used when a renderbuffer object is deleted. + * The spec calls for unbinding. + */ +static void +detach_renderbuffer(struct gl_context *ctx, + struct gl_framebuffer *fb, + struct gl_renderbuffer *rb) +{ + GLuint i; + for (i = 0; i < BUFFER_COUNT; i++) { + if (fb->Attachment[i].Renderbuffer == rb) { + _mesa_remove_attachment(ctx, &fb->Attachment[i]); + } + } + invalidate_framebuffer(fb); +} + + +void GLAPIENTRY +_mesa_DeleteRenderbuffersEXT(GLsizei n, const GLuint *renderbuffers) +{ + GLint i; + GET_CURRENT_CONTEXT(ctx); + + ASSERT_OUTSIDE_BEGIN_END(ctx); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); + + for (i = 0; i < n; i++) { + if (renderbuffers[i] > 0) { + struct gl_renderbuffer *rb; + rb = _mesa_lookup_renderbuffer(ctx, renderbuffers[i]); + if (rb) { + /* check if deleting currently bound renderbuffer object */ + if (rb == ctx->CurrentRenderbuffer) { + /* bind default */ + ASSERT(rb->RefCount >= 2); + _mesa_BindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0); + } + + if (ctx->DrawBuffer->Name) { + detach_renderbuffer(ctx, ctx->DrawBuffer, rb); + } + if (ctx->ReadBuffer->Name && ctx->ReadBuffer != ctx->DrawBuffer) { + detach_renderbuffer(ctx, ctx->ReadBuffer, rb); + } + + /* Remove from hash table immediately, to free the ID. + * But the object will not be freed until it's no longer + * referenced anywhere else. + */ + _mesa_HashRemove(ctx->Shared->RenderBuffers, renderbuffers[i]); + + if (rb != &DummyRenderbuffer) { + /* no longer referenced by hash table */ + _mesa_reference_renderbuffer(&rb, NULL); + } + } + } + } +} + + +void GLAPIENTRY +_mesa_GenRenderbuffersEXT(GLsizei n, GLuint *renderbuffers) +{ + GET_CURRENT_CONTEXT(ctx); + GLuint first; + GLint i; + + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (n < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glGenRenderbuffersEXT(n)"); + return; + } + + if (!renderbuffers) + return; + + first = _mesa_HashFindFreeKeyBlock(ctx->Shared->RenderBuffers, n); + + for (i = 0; i < n; i++) { + GLuint name = first + i; + renderbuffers[i] = name; + /* insert dummy placeholder into hash table */ + _glthread_LOCK_MUTEX(ctx->Shared->Mutex); + _mesa_HashInsert(ctx->Shared->RenderBuffers, name, &DummyRenderbuffer); + _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); + } +} + + +/** + * Given an internal format token for a render buffer, return the + * corresponding base format (one of GL_RGB, GL_RGBA, GL_STENCIL_INDEX, + * GL_DEPTH_COMPONENT, GL_DEPTH_STENCIL_EXT, GL_ALPHA, GL_LUMINANCE, + * GL_LUMINANCE_ALPHA, GL_INTENSITY, etc). + * + * This is similar to _mesa_base_tex_format() but the set of valid + * internal formats is different. + * + * Note that even if a format is determined to be legal here, validation + * of the FBO may fail if the format is not supported by the driver/GPU. + * + * \param internalFormat as passed to glRenderbufferStorage() + * \return the base internal format, or 0 if internalFormat is illegal + */ +GLenum +_mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) +{ + /* + * Notes: some formats such as alpha, luminance, etc. were added + * with GL_ARB_framebuffer_object. + */ + switch (internalFormat) { + case GL_ALPHA: + case GL_ALPHA4: + case GL_ALPHA8: + case GL_ALPHA12: + case GL_ALPHA16: + return ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0; + case GL_LUMINANCE: + case GL_LUMINANCE4: + case GL_LUMINANCE8: + case GL_LUMINANCE12: + case GL_LUMINANCE16: + return ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0; + case GL_LUMINANCE_ALPHA: + case GL_LUMINANCE4_ALPHA4: + case GL_LUMINANCE6_ALPHA2: + case GL_LUMINANCE8_ALPHA8: + case GL_LUMINANCE12_ALPHA4: + case GL_LUMINANCE12_ALPHA12: + case GL_LUMINANCE16_ALPHA16: + return ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0; + case GL_INTENSITY: + case GL_INTENSITY4: + case GL_INTENSITY8: + case GL_INTENSITY12: + case GL_INTENSITY16: + return ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0; + case GL_RGB: + case GL_R3_G3_B2: + case GL_RGB4: + case GL_RGB5: + case GL_RGB8: + case GL_RGB10: + case GL_RGB12: + case GL_RGB16: + case GL_SRGB8_EXT: + return GL_RGB; + case GL_RGBA: + case GL_RGBA2: + case GL_RGBA4: + case GL_RGB5_A1: + case GL_RGBA8: + case GL_RGB10_A2: + case GL_RGBA12: + case GL_RGBA16: + case GL_RGBA16_SNORM: + case GL_SRGB8_ALPHA8_EXT: + return GL_RGBA; + case GL_STENCIL_INDEX: + case GL_STENCIL_INDEX1_EXT: + case GL_STENCIL_INDEX4_EXT: + case GL_STENCIL_INDEX8_EXT: + case GL_STENCIL_INDEX16_EXT: + return GL_STENCIL_INDEX; + case GL_DEPTH_COMPONENT: + case GL_DEPTH_COMPONENT16: + case GL_DEPTH_COMPONENT24: + case GL_DEPTH_COMPONENT32: + return GL_DEPTH_COMPONENT; + case GL_DEPTH_STENCIL_EXT: + case GL_DEPTH24_STENCIL8_EXT: + if (ctx->Extensions.EXT_packed_depth_stencil) + return GL_DEPTH_STENCIL_EXT; + else + return 0; + case GL_RED: + case GL_R8: + case GL_R16: + return ctx->Extensions.ARB_texture_rg ? GL_RED : 0; + case GL_RG: + case GL_RG8: + case GL_RG16: + return ctx->Extensions.ARB_texture_rg ? GL_RG : 0; + /* XXX add floating point and integer formats eventually */ + default: + return 0; + } +} + + +/** sentinal value, see below */ +#define NO_SAMPLES 1000 + + +/** + * Helper function used by _mesa_RenderbufferStorageEXT() and + * _mesa_RenderbufferStorageMultisample(). + * samples will be NO_SAMPLES if called by _mesa_RenderbufferStorageEXT(). + */ +static void +renderbuffer_storage(GLenum target, GLenum internalFormat, + GLsizei width, GLsizei height, GLsizei samples) +{ + const char *func = samples == NO_SAMPLES ? + "glRenderbufferStorage" : "RenderbufferStorageMultisample"; + struct gl_renderbuffer *rb; + GLenum baseFormat; + GET_CURRENT_CONTEXT(ctx); + + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (target != GL_RENDERBUFFER_EXT) { + _mesa_error(ctx, GL_INVALID_ENUM, "%s(target)", func); + return; + } + + baseFormat = _mesa_base_fbo_format(ctx, internalFormat); + if (baseFormat == 0) { + _mesa_error(ctx, GL_INVALID_ENUM, "%s(internalFormat)", func); + return; + } + + if (width < 1 || width > (GLsizei) ctx->Const.MaxRenderbufferSize) { + _mesa_error(ctx, GL_INVALID_VALUE, "%s(width)", func); + return; + } + + if (height < 1 || height > (GLsizei) ctx->Const.MaxRenderbufferSize) { + _mesa_error(ctx, GL_INVALID_VALUE, "%s(height)", func); + return; + } + + if (samples == NO_SAMPLES) { + /* NumSamples == 0 indicates non-multisampling */ + samples = 0; + } + else if (samples > (GLsizei) ctx->Const.MaxSamples) { + /* note: driver may choose to use more samples than what's requested */ + _mesa_error(ctx, GL_INVALID_VALUE, "%s(samples)", func); + return; + } + + rb = ctx->CurrentRenderbuffer; + if (!rb) { + _mesa_error(ctx, GL_INVALID_OPERATION, "%s", func); + return; + } + + FLUSH_VERTICES(ctx, _NEW_BUFFERS); + + if (rb->InternalFormat == internalFormat && + rb->Width == (GLuint) width && + rb->Height == (GLuint) height) { + /* no change in allocation needed */ + return; + } + + /* These MUST get set by the AllocStorage func */ + rb->Format = MESA_FORMAT_NONE; + rb->NumSamples = samples; + + /* Now allocate the storage */ + ASSERT(rb->AllocStorage); + if (rb->AllocStorage(ctx, rb, internalFormat, width, height)) { + /* No error - check/set fields now */ + assert(rb->Format != MESA_FORMAT_NONE); + assert(rb->Width == (GLuint) width); + assert(rb->Height == (GLuint) height); + rb->InternalFormat = internalFormat; + rb->_BaseFormat = baseFormat; + assert(rb->_BaseFormat != 0); + } + else { + /* Probably ran out of memory - clear the fields */ + rb->Width = 0; + rb->Height = 0; + rb->Format = MESA_FORMAT_NONE; + rb->InternalFormat = GL_NONE; + rb->_BaseFormat = GL_NONE; + rb->NumSamples = 0; + } + + /* + test_framebuffer_completeness(ctx, fb); + */ + /* XXX if this renderbuffer is attached anywhere, invalidate attachment + * points??? + */ +} + + +#if FEATURE_OES_EGL_image +void GLAPIENTRY +_mesa_EGLImageTargetRenderbufferStorageOES(GLenum target, GLeglImageOES image) +{ + struct gl_renderbuffer *rb; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (!ctx->Extensions.OES_EGL_image) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glEGLImageTargetRenderbufferStorageOES(unsupported)"); + return; + } + + if (target != GL_RENDERBUFFER) { + _mesa_error(ctx, GL_INVALID_ENUM, + "EGLImageTargetRenderbufferStorageOES"); + return; + } + + rb = ctx->CurrentRenderbuffer; + if (!rb) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "EGLImageTargetRenderbufferStorageOES"); + return; + } + + FLUSH_VERTICES(ctx, _NEW_BUFFERS); + + ctx->Driver.EGLImageTargetRenderbufferStorage(ctx, rb, image); +} +#endif + + +/** + * Helper function for _mesa_GetRenderbufferParameterivEXT() and + * _mesa_GetFramebufferAttachmentParameterivEXT() + * We have to be careful to respect the base format. For example, if a + * renderbuffer/texture was created with internalFormat=GL_RGB but the + * driver actually chose a GL_RGBA format, when the user queries ALPHA_SIZE + * we need to return zero. + */ +static GLint +get_component_bits(GLenum pname, GLenum baseFormat, gl_format format) +{ + switch (pname) { + case GL_RENDERBUFFER_RED_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: + if (baseFormat == GL_RGB || baseFormat == GL_RGBA || + baseFormat == GL_RG || baseFormat == GL_RED) + return _mesa_get_format_bits(format, pname); + else + return 0; + case GL_RENDERBUFFER_GREEN_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: + if (baseFormat == GL_RGB || baseFormat == GL_RGBA || baseFormat == GL_RG) + return _mesa_get_format_bits(format, pname); + else + return 0; + case GL_RENDERBUFFER_BLUE_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: + if (baseFormat == GL_RGB || baseFormat == GL_RGBA) + return _mesa_get_format_bits(format, pname); + else + return 0; + case GL_RENDERBUFFER_ALPHA_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: + if (baseFormat == GL_RGBA || baseFormat == GL_ALPHA || + baseFormat == GL_LUMINANCE_ALPHA) + return _mesa_get_format_bits(format, pname); + else + return 0; + case GL_RENDERBUFFER_DEPTH_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: + if (baseFormat == GL_DEPTH_COMPONENT || baseFormat == GL_DEPTH_STENCIL) + return _mesa_get_format_bits(format, pname); + else + return 0; + case GL_RENDERBUFFER_STENCIL_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: + if (baseFormat == GL_STENCIL_INDEX || baseFormat == GL_DEPTH_STENCIL) + return _mesa_get_format_bits(format, pname); + else + return 0; + default: + return 0; + } +} + + + +void GLAPIENTRY +_mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, + GLsizei width, GLsizei height) +{ + /* GL_ARB_fbo says calling this function is equivalent to calling + * glRenderbufferStorageMultisample() with samples=0. We pass in + * a token value here just for error reporting purposes. + */ + renderbuffer_storage(target, internalFormat, width, height, NO_SAMPLES); +} + + +void GLAPIENTRY +_mesa_RenderbufferStorageMultisample(GLenum target, GLsizei samples, + GLenum internalFormat, + GLsizei width, GLsizei height) +{ + renderbuffer_storage(target, internalFormat, width, height, samples); +} + + +/** + * OpenGL ES version of glRenderBufferStorage. + */ +void GLAPIENTRY +_es_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, + GLsizei width, GLsizei height) +{ + switch (internalFormat) { + case GL_RGB565: + /* XXX this confuses GL_RENDERBUFFER_INTERNAL_FORMAT_OES */ + /* choose a closest format */ + internalFormat = GL_RGB5; + break; + default: + break; + } + + renderbuffer_storage(target, internalFormat, width, height, 0); +} + + +void GLAPIENTRY +_mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) +{ + struct gl_renderbuffer *rb; + GET_CURRENT_CONTEXT(ctx); + + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (target != GL_RENDERBUFFER_EXT) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetRenderbufferParameterivEXT(target)"); + return; + } + + rb = ctx->CurrentRenderbuffer; + if (!rb) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetRenderbufferParameterivEXT"); + return; + } + + /* No need to flush here since we're just quering state which is + * not effected by rendering. + */ + + switch (pname) { + case GL_RENDERBUFFER_WIDTH_EXT: + *params = rb->Width; + return; + case GL_RENDERBUFFER_HEIGHT_EXT: + *params = rb->Height; + return; + case GL_RENDERBUFFER_INTERNAL_FORMAT_EXT: + *params = rb->InternalFormat; + return; + case GL_RENDERBUFFER_RED_SIZE_EXT: + case GL_RENDERBUFFER_GREEN_SIZE_EXT: + case GL_RENDERBUFFER_BLUE_SIZE_EXT: + case GL_RENDERBUFFER_ALPHA_SIZE_EXT: + case GL_RENDERBUFFER_DEPTH_SIZE_EXT: + case GL_RENDERBUFFER_STENCIL_SIZE_EXT: + *params = get_component_bits(pname, rb->_BaseFormat, rb->Format); + break; + case GL_RENDERBUFFER_SAMPLES: + if (ctx->Extensions.ARB_framebuffer_object) { + *params = rb->NumSamples; + break; + } + /* fallthrough */ + default: + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetRenderbufferParameterivEXT(target)"); + return; + } +} + + +GLboolean GLAPIENTRY +_mesa_IsFramebufferEXT(GLuint framebuffer) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); + if (framebuffer) { + struct gl_framebuffer *rb = _mesa_lookup_framebuffer(ctx, framebuffer); + if (rb != NULL && rb != &DummyFramebuffer) + return GL_TRUE; + } + return GL_FALSE; +} + + +/** + * Check if any of the attachments of the given framebuffer are textures + * (render to texture). Call ctx->Driver.RenderTexture() for such + * attachments. + */ +static void +check_begin_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb) +{ + GLuint i; + ASSERT(ctx->Driver.RenderTexture); + + if (fb->Name == 0) + return; /* can't render to texture with winsys framebuffers */ + + for (i = 0; i < BUFFER_COUNT; i++) { + struct gl_renderbuffer_attachment *att = fb->Attachment + i; + struct gl_texture_object *texObj = att->Texture; + if (texObj + && texObj->Image[att->CubeMapFace][att->TextureLevel]) { + ctx->Driver.RenderTexture(ctx, fb, att); + } + } +} + + +/** + * Examine all the framebuffer's attachments to see if any are textures. + * If so, call ctx->Driver.FinishRenderTexture() for each texture to + * notify the device driver that the texture image may have changed. + */ +static void +check_end_texture_render(struct gl_context *ctx, struct gl_framebuffer *fb) +{ + if (fb->Name == 0) + return; /* can't render to texture with winsys framebuffers */ + + if (ctx->Driver.FinishRenderTexture) { + GLuint i; + for (i = 0; i < BUFFER_COUNT; i++) { + struct gl_renderbuffer_attachment *att = fb->Attachment + i; + if (att->Texture && att->Renderbuffer) { + ctx->Driver.FinishRenderTexture(ctx, att); + } + } + } +} + + +void GLAPIENTRY +_mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) +{ + struct gl_framebuffer *newDrawFb, *newReadFb; + struct gl_framebuffer *oldDrawFb, *oldReadFb; + GLboolean bindReadBuf, bindDrawBuf; + GET_CURRENT_CONTEXT(ctx); + +#ifdef DEBUG + if (ctx->Extensions.ARB_framebuffer_object) { + ASSERT(ctx->Extensions.EXT_framebuffer_object); + ASSERT(ctx->Extensions.EXT_framebuffer_blit); + } +#endif + + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (!ctx->Extensions.EXT_framebuffer_object) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBindFramebufferEXT(unsupported)"); + return; + } + + switch (target) { +#if FEATURE_EXT_framebuffer_blit + case GL_DRAW_FRAMEBUFFER_EXT: + if (!ctx->Extensions.EXT_framebuffer_blit) { + _mesa_error(ctx, GL_INVALID_ENUM, "glBindFramebufferEXT(target)"); + return; + } + bindDrawBuf = GL_TRUE; + bindReadBuf = GL_FALSE; + break; + case GL_READ_FRAMEBUFFER_EXT: + if (!ctx->Extensions.EXT_framebuffer_blit) { + _mesa_error(ctx, GL_INVALID_ENUM, "glBindFramebufferEXT(target)"); + return; + } + bindDrawBuf = GL_FALSE; + bindReadBuf = GL_TRUE; + break; +#endif + case GL_FRAMEBUFFER_EXT: + bindDrawBuf = GL_TRUE; + bindReadBuf = GL_TRUE; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glBindFramebufferEXT(target)"); + return; + } + + if (framebuffer) { + /* Binding a user-created framebuffer object */ + newDrawFb = _mesa_lookup_framebuffer(ctx, framebuffer); + if (newDrawFb == &DummyFramebuffer) { + /* ID was reserved, but no real framebuffer object made yet */ + newDrawFb = NULL; + } + else if (!newDrawFb && ctx->Extensions.ARB_framebuffer_object) { + /* All FBO IDs must be Gen'd */ + _mesa_error(ctx, GL_INVALID_OPERATION, "glBindFramebuffer(buffer)"); + return; + } + + if (!newDrawFb) { + /* create new framebuffer object */ + newDrawFb = ctx->Driver.NewFramebuffer(ctx, framebuffer); + if (!newDrawFb) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindFramebufferEXT"); + return; + } + _mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, newDrawFb); + } + newReadFb = newDrawFb; + } + else { + /* Binding the window system framebuffer (which was originally set + * with MakeCurrent). + */ + newDrawFb = ctx->WinSysDrawBuffer; + newReadFb = ctx->WinSysReadBuffer; + } + + ASSERT(newDrawFb); + ASSERT(newDrawFb != &DummyFramebuffer); + + /* save pointers to current/old framebuffers */ + oldDrawFb = ctx->DrawBuffer; + oldReadFb = ctx->ReadBuffer; + + /* check if really changing bindings */ + if (oldDrawFb == newDrawFb) + bindDrawBuf = GL_FALSE; + if (oldReadFb == newReadFb) + bindReadBuf = GL_FALSE; + + /* + * OK, now bind the new Draw/Read framebuffers, if they're changing. + * + * We also check if we're beginning and/or ending render-to-texture. + * When a framebuffer with texture attachments is unbound, call + * ctx->Driver.FinishRenderTexture(). + * When a framebuffer with texture attachments is bound, call + * ctx->Driver.RenderTexture(). + * + * Note that if the ReadBuffer has texture attachments we don't consider + * that a render-to-texture case. + */ + if (bindReadBuf) { + FLUSH_VERTICES(ctx, _NEW_BUFFERS); + + /* check if old readbuffer was render-to-texture */ + check_end_texture_render(ctx, oldReadFb); + + _mesa_reference_framebuffer(&ctx->ReadBuffer, newReadFb); + } + + if (bindDrawBuf) { + FLUSH_VERTICES(ctx, _NEW_BUFFERS); + + /* check if old read/draw buffers were render-to-texture */ + if (!bindReadBuf) + check_end_texture_render(ctx, oldReadFb); + + if (oldDrawFb != oldReadFb) + check_end_texture_render(ctx, oldDrawFb); + + /* check if newly bound framebuffer has any texture attachments */ + check_begin_texture_render(ctx, newDrawFb); + + _mesa_reference_framebuffer(&ctx->DrawBuffer, newDrawFb); + } + + if ((bindDrawBuf || bindReadBuf) && ctx->Driver.BindFramebuffer) { + ctx->Driver.BindFramebuffer(ctx, target, newDrawFb, newReadFb); + } +} + + +void GLAPIENTRY +_mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) +{ + GLint i; + GET_CURRENT_CONTEXT(ctx); + + ASSERT_OUTSIDE_BEGIN_END(ctx); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); + + for (i = 0; i < n; i++) { + if (framebuffers[i] > 0) { + struct gl_framebuffer *fb; + fb = _mesa_lookup_framebuffer(ctx, framebuffers[i]); + if (fb) { + ASSERT(fb == &DummyFramebuffer || fb->Name == framebuffers[i]); + + /* check if deleting currently bound framebuffer object */ + if (ctx->Extensions.EXT_framebuffer_blit) { + /* separate draw/read binding points */ + if (fb == ctx->DrawBuffer) { + /* bind default */ + ASSERT(fb->RefCount >= 2); + _mesa_BindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0); + } + if (fb == ctx->ReadBuffer) { + /* bind default */ + ASSERT(fb->RefCount >= 2); + _mesa_BindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0); + } + } + else { + /* only one binding point for read/draw buffers */ + if (fb == ctx->DrawBuffer || fb == ctx->ReadBuffer) { + /* bind default */ + ASSERT(fb->RefCount >= 2); + _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); + } + } + + /* remove from hash table immediately, to free the ID */ + _mesa_HashRemove(ctx->Shared->FrameBuffers, framebuffers[i]); + + if (fb != &DummyFramebuffer) { + /* But the object will not be freed until it's no longer + * bound in any context. + */ + _mesa_reference_framebuffer(&fb, NULL); + } + } + } + } +} + + +void GLAPIENTRY +_mesa_GenFramebuffersEXT(GLsizei n, GLuint *framebuffers) +{ + GET_CURRENT_CONTEXT(ctx); + GLuint first; + GLint i; + + ASSERT_OUTSIDE_BEGIN_END(ctx); + + if (n < 0) { + _mesa_error(ctx, GL_INVALID_VALUE, "glGenFramebuffersEXT(n)"); + return; + } + + if (!framebuffers) + return; + + first = _mesa_HashFindFreeKeyBlock(ctx->Shared->FrameBuffers, n); + + for (i = 0; i < n; i++) { + GLuint name = first + i; + framebuffers[i] = name; + /* insert dummy placeholder into hash table */ + _glthread_LOCK_MUTEX(ctx->Shared->Mutex); + _mesa_HashInsert(ctx->Shared->FrameBuffers, name, &DummyFramebuffer); + _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); + } +} + + + +GLenum GLAPIENTRY +_mesa_CheckFramebufferStatusEXT(GLenum target) +{ + struct gl_framebuffer *buffer; + GET_CURRENT_CONTEXT(ctx); + + ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0); + + switch (target) { +#if FEATURE_EXT_framebuffer_blit + case GL_DRAW_FRAMEBUFFER_EXT: + if (!ctx->Extensions.EXT_framebuffer_blit) { + _mesa_error(ctx, GL_INVALID_ENUM, "glCheckFramebufferStatus(target)"); + return 0; + } + buffer = ctx->DrawBuffer; + break; + case GL_READ_FRAMEBUFFER_EXT: + if (!ctx->Extensions.EXT_framebuffer_blit) { + _mesa_error(ctx, GL_INVALID_ENUM, "glCheckFramebufferStatus(target)"); + return 0; + } + buffer = ctx->ReadBuffer; + break; +#endif + case GL_FRAMEBUFFER_EXT: + buffer = ctx->DrawBuffer; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, "glCheckFramebufferStatus(target)"); + return 0; /* formerly GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + } + + if (buffer->Name == 0) { + /* The window system / default framebuffer is always complete */ + return GL_FRAMEBUFFER_COMPLETE_EXT; + } + + /* No need to flush here */ + + if (buffer->_Status != GL_FRAMEBUFFER_COMPLETE) { + _mesa_test_framebuffer_completeness(ctx, buffer); + } + + return buffer->_Status; +} + + + +/** + * Common code called by glFramebufferTexture1D/2D/3DEXT(). + */ +static void +framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target, + GLenum attachment, GLenum textarget, GLuint texture, + GLint level, GLint zoffset) +{ + struct gl_renderbuffer_attachment *att; + struct gl_texture_object *texObj = NULL; + struct gl_framebuffer *fb; + GLboolean error = GL_FALSE; + + ASSERT_OUTSIDE_BEGIN_END(ctx); + + switch (target) { + case GL_READ_FRAMEBUFFER_EXT: + error = !ctx->Extensions.EXT_framebuffer_blit; + fb = ctx->ReadBuffer; + break; + case GL_DRAW_FRAMEBUFFER_EXT: + error = !ctx->Extensions.EXT_framebuffer_blit; + /* fall-through */ + case GL_FRAMEBUFFER_EXT: + fb = ctx->DrawBuffer; + break; + default: + error = GL_TRUE; + } + + if (error) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glFramebufferTexture%sEXT(target=0x%x)", caller, target); + return; + } + + ASSERT(fb); + + /* check framebuffer binding */ + if (fb->Name == 0) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glFramebufferTexture%sEXT", caller); + return; + } + + + /* The textarget, level, and zoffset parameters are only validated if + * texture is non-zero. + */ + if (texture) { + GLboolean err = GL_TRUE; + + texObj = _mesa_lookup_texture(ctx, texture); + if (texObj != NULL) { + if (textarget == 0) { + /* XXX what's the purpose of this? */ + err = (texObj->Target != GL_TEXTURE_3D) && + (texObj->Target != GL_TEXTURE_1D_ARRAY_EXT) && + (texObj->Target != GL_TEXTURE_2D_ARRAY_EXT); + } + else { + err = (texObj->Target == GL_TEXTURE_CUBE_MAP) + ? !IS_CUBE_FACE(textarget) + : (texObj->Target != textarget); + } + } + else { + /* can't render to a non-existant texture */ + _mesa_error(ctx, GL_INVALID_OPERATION, + "glFramebufferTexture%sEXT(non existant texture)", + caller); + return; + } + + if (err) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glFramebufferTexture%sEXT(texture target mismatch)", + caller); + return; + } + + if (texObj->Target == GL_TEXTURE_3D) { + const GLint maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1); + if (zoffset < 0 || zoffset >= maxSize) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glFramebufferTexture%sEXT(zoffset)", caller); + return; + } + } + else if ((texObj->Target == GL_TEXTURE_1D_ARRAY_EXT) || + (texObj->Target == GL_TEXTURE_2D_ARRAY_EXT)) { + if (zoffset < 0 || zoffset >= ctx->Const.MaxArrayTextureLayers) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glFramebufferTexture%sEXT(layer)", caller); + return; + } + } + + if ((level < 0) || + (level >= _mesa_max_texture_levels(ctx, texObj->Target))) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glFramebufferTexture%sEXT(level)", caller); + return; + } + } + + att = _mesa_get_attachment(ctx, fb, attachment); + if (att == NULL) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glFramebufferTexture%sEXT(attachment)", caller); + return; + } + + FLUSH_VERTICES(ctx, _NEW_BUFFERS); + + _glthread_LOCK_MUTEX(fb->Mutex); + if (texObj) { + _mesa_set_texture_attachment(ctx, fb, att, texObj, textarget, + level, zoffset); + /* Set the render-to-texture flag. We'll check this flag in + * glTexImage() and friends to determine if we need to revalidate + * any FBOs that might be rendering into this texture. + * This flag never gets cleared since it's non-trivial to determine + * when all FBOs might be done rendering to this texture. That's OK + * though since it's uncommon to render to a texture then repeatedly + * call glTexImage() to change images in the texture. + */ + texObj->_RenderToTexture = GL_TRUE; + } + else { + _mesa_remove_attachment(ctx, att); + } + + invalidate_framebuffer(fb); + + _glthread_UNLOCK_MUTEX(fb->Mutex); +} + + + +void GLAPIENTRY +_mesa_FramebufferTexture1DEXT(GLenum target, GLenum attachment, + GLenum textarget, GLuint texture, GLint level) +{ + GET_CURRENT_CONTEXT(ctx); + + if ((texture != 0) && (textarget != GL_TEXTURE_1D)) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glFramebufferTexture1DEXT(textarget)"); + return; + } + + framebuffer_texture(ctx, "1D", target, attachment, textarget, texture, + level, 0); +} + + +void GLAPIENTRY +_mesa_FramebufferTexture2DEXT(GLenum target, GLenum attachment, + GLenum textarget, GLuint texture, GLint level) +{ + GET_CURRENT_CONTEXT(ctx); + + if ((texture != 0) && + (textarget != GL_TEXTURE_2D) && + (textarget != GL_TEXTURE_RECTANGLE_ARB) && + (!IS_CUBE_FACE(textarget))) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glFramebufferTexture2DEXT(textarget=0x%x)", textarget); + return; + } + + framebuffer_texture(ctx, "2D", target, attachment, textarget, texture, + level, 0); +} + + +void GLAPIENTRY +_mesa_FramebufferTexture3DEXT(GLenum target, GLenum attachment, + GLenum textarget, GLuint texture, + GLint level, GLint zoffset) +{ + GET_CURRENT_CONTEXT(ctx); + + if ((texture != 0) && (textarget != GL_TEXTURE_3D)) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glFramebufferTexture3DEXT(textarget)"); + return; + } + + framebuffer_texture(ctx, "3D", target, attachment, textarget, texture, + level, zoffset); +} + + +void GLAPIENTRY +_mesa_FramebufferTextureLayerEXT(GLenum target, GLenum attachment, + GLuint texture, GLint level, GLint layer) +{ + GET_CURRENT_CONTEXT(ctx); + + framebuffer_texture(ctx, "Layer", target, attachment, 0, texture, + level, layer); +} + + +void GLAPIENTRY +_mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, + GLenum renderbufferTarget, + GLuint renderbuffer) +{ + struct gl_renderbuffer_attachment *att; + struct gl_framebuffer *fb; + struct gl_renderbuffer *rb; + GET_CURRENT_CONTEXT(ctx); + + ASSERT_OUTSIDE_BEGIN_END(ctx); + + switch (target) { +#if FEATURE_EXT_framebuffer_blit + case GL_DRAW_FRAMEBUFFER_EXT: + if (!ctx->Extensions.EXT_framebuffer_blit) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glFramebufferRenderbufferEXT(target)"); + return; + } + fb = ctx->DrawBuffer; + break; + case GL_READ_FRAMEBUFFER_EXT: + if (!ctx->Extensions.EXT_framebuffer_blit) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glFramebufferRenderbufferEXT(target)"); + return; + } + fb = ctx->ReadBuffer; + break; +#endif + case GL_FRAMEBUFFER_EXT: + fb = ctx->DrawBuffer; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, + "glFramebufferRenderbufferEXT(target)"); + return; + } + + if (renderbufferTarget != GL_RENDERBUFFER_EXT) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glFramebufferRenderbufferEXT(renderbufferTarget)"); + return; + } + + if (fb->Name == 0) { + /* Can't attach new renderbuffers to a window system framebuffer */ + _mesa_error(ctx, GL_INVALID_OPERATION, "glFramebufferRenderbufferEXT"); + return; + } + + att = _mesa_get_attachment(ctx, fb, attachment); + if (att == NULL) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glFramebufferRenderbufferEXT(invalid attachment %s)", + _mesa_lookup_enum_by_nr(attachment)); + return; + } + + if (renderbuffer) { + rb = _mesa_lookup_renderbuffer(ctx, renderbuffer); + if (!rb) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glFramebufferRenderbufferEXT(non-existant" + " renderbuffer %u)", renderbuffer); + return; + } + else if (rb == &DummyRenderbuffer) { + /* This is what NVIDIA does */ + _mesa_error(ctx, GL_INVALID_VALUE, + "glFramebufferRenderbufferEXT(renderbuffer %u)", + renderbuffer); + return; + } + } + else { + /* remove renderbuffer attachment */ + rb = NULL; + } + + if (attachment == GL_DEPTH_STENCIL_ATTACHMENT && + rb && rb->Format != MESA_FORMAT_NONE) { + /* make sure the renderbuffer is a depth/stencil format */ + const GLenum baseFormat = _mesa_get_format_base_format(rb->Format); + if (baseFormat != GL_DEPTH_STENCIL) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glFramebufferRenderbufferEXT(renderbuffer" + " is not DEPTH_STENCIL format)"); + return; + } + } + + + FLUSH_VERTICES(ctx, _NEW_BUFFERS); + + assert(ctx->Driver.FramebufferRenderbuffer); + ctx->Driver.FramebufferRenderbuffer(ctx, fb, attachment, rb); + + /* Some subsequent GL commands may depend on the framebuffer's visual + * after the binding is updated. Update visual info now. + */ + _mesa_update_framebuffer_visual(ctx, fb); +} + + +void GLAPIENTRY +_mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, + GLenum pname, GLint *params) +{ + const struct gl_renderbuffer_attachment *att; + struct gl_framebuffer *buffer; + GET_CURRENT_CONTEXT(ctx); + + ASSERT_OUTSIDE_BEGIN_END(ctx); + + switch (target) { +#if FEATURE_EXT_framebuffer_blit + case GL_DRAW_FRAMEBUFFER_EXT: + if (!ctx->Extensions.EXT_framebuffer_blit) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(target)"); + return; + } + buffer = ctx->DrawBuffer; + break; + case GL_READ_FRAMEBUFFER_EXT: + if (!ctx->Extensions.EXT_framebuffer_blit) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(target)"); + return; + } + buffer = ctx->ReadBuffer; + break; +#endif + case GL_FRAMEBUFFER_EXT: + buffer = ctx->DrawBuffer; + break; + default: + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(target)"); + return; + } + + if (buffer->Name == 0) { + /* the default / window-system FBO */ + att = _mesa_get_fb0_attachment(ctx, buffer, attachment); + } + else { + /* user-created framebuffer FBO */ + att = _mesa_get_attachment(ctx, buffer, attachment); + } + + if (att == NULL) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(attachment)"); + return; + } + + if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { + /* the depth and stencil attachments must point to the same buffer */ + const struct gl_renderbuffer_attachment *depthAtt, *stencilAtt; + depthAtt = _mesa_get_attachment(ctx, buffer, GL_DEPTH_ATTACHMENT); + stencilAtt = _mesa_get_attachment(ctx, buffer, GL_STENCIL_ATTACHMENT); + if (depthAtt->Renderbuffer != stencilAtt->Renderbuffer) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetFramebufferAttachmentParameterivEXT(DEPTH/STENCIL" + " attachments differ)"); + return; + } + } + + /* No need to flush here */ + + switch (pname) { + case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT: + *params = buffer->Name == 0 ? GL_FRAMEBUFFER_DEFAULT : att->Type; + return; + case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT: + if (att->Type == GL_RENDERBUFFER_EXT) { + *params = att->Renderbuffer->Name; + } + else if (att->Type == GL_TEXTURE) { + *params = att->Texture->Name; + } + else { + assert(att->Type == GL_NONE); + *params = 0; + } + return; + case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT: + if (att->Type == GL_TEXTURE) { + *params = att->TextureLevel; + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + } + return; + case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT: + if (att->Type == GL_TEXTURE) { + if (att->Texture && att->Texture->Target == GL_TEXTURE_CUBE_MAP) { + *params = GL_TEXTURE_CUBE_MAP_POSITIVE_X + att->CubeMapFace; + } + else { + *params = 0; + } + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + } + return; + case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT: + if (att->Type == GL_TEXTURE) { + if (att->Texture && att->Texture->Target == GL_TEXTURE_3D) { + *params = att->Zoffset; + } + else { + *params = 0; + } + } + else { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + } + return; + case GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING: + if (!ctx->Extensions.ARB_framebuffer_object) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + } + else { + if (ctx->Extensions.EXT_framebuffer_sRGB && ctx->Const.sRGBCapable) { + *params = _mesa_get_format_color_encoding(att->Renderbuffer->Format); + } + else { + /* According to ARB_framebuffer_sRGB, we should return LINEAR + * if the sRGB conversion is unsupported. */ + *params = GL_LINEAR; + } + } + return; + case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: + if (!ctx->Extensions.ARB_framebuffer_object) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + return; + } + else { + gl_format format = att->Renderbuffer->Format; + if (format == MESA_FORMAT_CI8 || format == MESA_FORMAT_S8) { + /* special cases */ + *params = GL_INDEX; + } + else { + *params = _mesa_get_format_datatype(format); + } + } + return; + case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: + case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: + case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: + case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: + case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: + case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: + if (!ctx->Extensions.ARB_framebuffer_object) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + } + else if (att->Texture) { + const struct gl_texture_image *texImage = + _mesa_select_tex_image(ctx, att->Texture, att->Texture->Target, + att->TextureLevel); + if (texImage) { + *params = get_component_bits(pname, texImage->_BaseFormat, + texImage->TexFormat); + } + else { + *params = 0; + } + } + else if (att->Renderbuffer) { + *params = get_component_bits(pname, att->Renderbuffer->_BaseFormat, + att->Renderbuffer->Format); + } + else { + *params = 0; + } + return; + default: + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetFramebufferAttachmentParameterivEXT(pname)"); + return; + } +} + + +void GLAPIENTRY +_mesa_GenerateMipmapEXT(GLenum target) +{ + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + + ASSERT_OUTSIDE_BEGIN_END(ctx); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); + + switch (target) { + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: + case GL_TEXTURE_3D: + case GL_TEXTURE_CUBE_MAP: + /* OK, legal value */ + break; + default: + /* XXX need to implement GL_TEXTURE_1D_ARRAY and GL_TEXTURE_2D_ARRAY */ + _mesa_error(ctx, GL_INVALID_ENUM, "glGenerateMipmapEXT(target)"); + return; + } + + texObj = _mesa_get_current_tex_object(ctx, target); + + if (texObj->BaseLevel >= texObj->MaxLevel) { + /* nothing to do */ + return; + } + + if (texObj->Target == GL_TEXTURE_CUBE_MAP && + !_mesa_cube_complete(texObj)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGenerateMipmap(incomplete cube map)"); + return; + } + + _mesa_lock_texture(ctx, texObj); + if (target == GL_TEXTURE_CUBE_MAP) { + GLuint face; + for (face = 0; face < 6; face++) + ctx->Driver.GenerateMipmap(ctx, + GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + face, + texObj); + } + else { + ctx->Driver.GenerateMipmap(ctx, target, texObj); + } + _mesa_unlock_texture(ctx, texObj); +} + + +#if FEATURE_EXT_framebuffer_blit + +static const struct gl_renderbuffer_attachment * +find_attachment(const struct gl_framebuffer *fb, + const struct gl_renderbuffer *rb) +{ + GLuint i; + for (i = 0; i < Elements(fb->Attachment); i++) { + if (fb->Attachment[i].Renderbuffer == rb) + return &fb->Attachment[i]; + } + return NULL; +} + + + +/** + * Blit rectangular region, optionally from one framebuffer to another. + * + * Note, if the src buffer is multisampled and the dest is not, this is + * when the samples must be resolved to a single color. + */ +void GLAPIENTRY +_mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter) +{ + const GLbitfield legalMaskBits = (GL_COLOR_BUFFER_BIT | + GL_DEPTH_BUFFER_BIT | + GL_STENCIL_BUFFER_BIT); + const struct gl_framebuffer *readFb, *drawFb; + const struct gl_renderbuffer *colorReadRb, *colorDrawRb; + GET_CURRENT_CONTEXT(ctx); + + ASSERT_OUTSIDE_BEGIN_END(ctx); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); + + if (MESA_VERBOSE & VERBOSE_API) + _mesa_debug(ctx, + "glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d, 0x%x, %s)\n", + srcX0, srcY0, srcX1, srcY1, + dstX0, dstY0, dstX1, dstY1, + mask, _mesa_lookup_enum_by_nr(filter)); + + if (ctx->NewState) { + _mesa_update_state(ctx); + } + + readFb = ctx->ReadBuffer; + drawFb = ctx->DrawBuffer; + + if (!readFb || !drawFb) { + /* This will normally never happen but someday we may want to + * support MakeCurrent() with no drawables. + */ + return; + } + + /* check for complete framebuffers */ + if (drawFb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT || + readFb->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) { + _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT, + "glBlitFramebufferEXT(incomplete draw/read buffers)"); + return; + } + + if (filter != GL_NEAREST && filter != GL_LINEAR) { + _mesa_error(ctx, GL_INVALID_ENUM, "glBlitFramebufferEXT(filter)"); + return; + } + + if (mask & ~legalMaskBits) { + _mesa_error( ctx, GL_INVALID_VALUE, "glBlitFramebufferEXT(mask)"); + return; + } + + /* depth/stencil must be blitted with nearest filtering */ + if ((mask & (GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)) + && filter != GL_NEAREST) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBlitFramebufferEXT(depth/stencil requires GL_NEAREST filter"); + return; + } + + /* get color read/draw renderbuffers */ + if (mask & GL_COLOR_BUFFER_BIT) { + colorReadRb = readFb->_ColorReadBuffer; + colorDrawRb = drawFb->_ColorDrawBuffers[0]; + } + else { + colorReadRb = colorDrawRb = NULL; + } + + if (mask & GL_STENCIL_BUFFER_BIT) { + struct gl_renderbuffer *readRb = readFb->_StencilBuffer; + struct gl_renderbuffer *drawRb = drawFb->_StencilBuffer; + if (!readRb || + !drawRb || + _mesa_get_format_bits(readRb->Format, GL_STENCIL_BITS) != + _mesa_get_format_bits(drawRb->Format, GL_STENCIL_BITS)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBlitFramebufferEXT(stencil buffer size mismatch"); + return; + } + } + + if (mask & GL_DEPTH_BUFFER_BIT) { + struct gl_renderbuffer *readRb = readFb->_DepthBuffer; + struct gl_renderbuffer *drawRb = drawFb->_DepthBuffer; + if (!readRb || + !drawRb || + _mesa_get_format_bits(readRb->Format, GL_DEPTH_BITS) != + _mesa_get_format_bits(drawRb->Format, GL_DEPTH_BITS)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBlitFramebufferEXT(depth buffer size mismatch"); + return; + } + } + + if (readFb->Visual.samples > 0 && + drawFb->Visual.samples > 0 && + readFb->Visual.samples != drawFb->Visual.samples) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBlitFramebufferEXT(mismatched samples"); + return; + } + + /* extra checks for multisample copies... */ + if (readFb->Visual.samples > 0 || drawFb->Visual.samples > 0) { + /* src and dest region sizes must be the same */ + if (srcX1 - srcX0 != dstX1 - dstX0 || + srcY1 - srcY0 != dstY1 - dstY0) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBlitFramebufferEXT(bad src/dst multisample region sizes"); + return; + } + + /* color formats must match */ + if (colorReadRb && + colorDrawRb && + colorReadRb->Format != colorDrawRb->Format) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBlitFramebufferEXT(bad src/dst multisample pixel formats"); + return; + } + } + + if (!ctx->Extensions.EXT_framebuffer_blit) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT"); + return; + } + + /* Debug code */ + if (DEBUG_BLIT) { + printf("glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d," + " 0x%x, 0x%x)\n", + srcX0, srcY0, srcX1, srcY1, + dstX0, dstY0, dstX1, dstY1, + mask, filter); + if (colorReadRb) { + const struct gl_renderbuffer_attachment *att; + + att = find_attachment(readFb, colorReadRb); + printf(" Src FBO %u RB %u (%dx%d) ", + readFb->Name, colorReadRb->Name, + colorReadRb->Width, colorReadRb->Height); + if (att && att->Texture) { + printf("Tex %u tgt 0x%x level %u face %u", + att->Texture->Name, + att->Texture->Target, + att->TextureLevel, + att->CubeMapFace); + } + printf("\n"); + + att = find_attachment(drawFb, colorDrawRb); + printf(" Dst FBO %u RB %u (%dx%d) ", + drawFb->Name, colorDrawRb->Name, + colorDrawRb->Width, colorDrawRb->Height); + if (att && att->Texture) { + printf("Tex %u tgt 0x%x level %u face %u", + att->Texture->Name, + att->Texture->Target, + att->TextureLevel, + att->CubeMapFace); + } + printf("\n"); + } + } + + ASSERT(ctx->Driver.BlitFramebuffer); + ctx->Driver.BlitFramebuffer(ctx, + srcX0, srcY0, srcX1, srcY1, + dstX0, dstY0, dstX1, dstY1, + mask, filter); +} +#endif /* FEATURE_EXT_framebuffer_blit */ + +#if FEATURE_ARB_geometry_shader4 +void GLAPIENTRY +_mesa_FramebufferTextureARB(GLenum target, GLenum attachment, + GLuint texture, GLint level) +{ + GET_CURRENT_CONTEXT(ctx); + _mesa_error(ctx, GL_INVALID_OPERATION, + "glFramebufferTextureARB " + "not implemented!"); +} + +void GLAPIENTRY +_mesa_FramebufferTextureFaceARB(GLenum target, GLenum attachment, + GLuint texture, GLint level, GLenum face) +{ + GET_CURRENT_CONTEXT(ctx); + _mesa_error(ctx, GL_INVALID_OPERATION, + "glFramebufferTextureFaceARB " + "not implemented!"); +} +#endif /* FEATURE_ARB_geometry_shader4 */ diff --git a/mesalib/src/mesa/main/formats.c b/mesalib/src/mesa/main/formats.c index b24b66c92..5c9b3068e 100644 --- a/mesalib/src/mesa/main/formats.c +++ b/mesalib/src/mesa/main/formats.c @@ -1372,7 +1372,11 @@ _mesa_format_to_type_and_comps(gl_format format, *comps = 4; return; - case MESA_FORMAT_AL44: /* XXX this isn't plain GL_UNSIGNED_BYTE */ + case MESA_FORMAT_AL44: + *datatype = MESA_UNSIGNED_BYTE_4_4; + *comps = 2; + return; + case MESA_FORMAT_AL88: case MESA_FORMAT_AL88_REV: case MESA_FORMAT_RG88: diff --git a/mesalib/src/mesa/main/formats.h b/mesalib/src/mesa/main/formats.h index fbd2e1eb5..cd7e0e25e 100644 --- a/mesalib/src/mesa/main/formats.h +++ b/mesalib/src/mesa/main/formats.h @@ -35,6 +35,9 @@ #include +/* OpenGL doesn't have GL_UNSIGNED_BYTE_4_4, so we must define our own type + * for GL_LUMINANCE4_ALPHA4. */ +#define MESA_UNSIGNED_BYTE_4_4 (GL_UNSIGNED_BYTE<<1) /** diff --git a/mesalib/src/mesa/main/image.c b/mesalib/src/mesa/main/image.c index fa9e8b9bb..444f21ed5 100644 --- a/mesalib/src/mesa/main/image.c +++ b/mesalib/src/mesa/main/image.c @@ -68,6 +68,7 @@ _mesa_type_is_packed(GLenum type) switch (type) { case GL_UNSIGNED_BYTE_3_3_2: case GL_UNSIGNED_BYTE_2_3_3_REV: + case MESA_UNSIGNED_BYTE_4_4: case GL_UNSIGNED_SHORT_5_6_5: case GL_UNSIGNED_SHORT_5_6_5_REV: case GL_UNSIGNED_SHORT_4_4_4_4: @@ -194,6 +195,8 @@ _mesa_sizeof_packed_type( GLenum type ) return sizeof(GLubyte); case GL_UNSIGNED_BYTE_2_3_3_REV: return sizeof(GLubyte); + case MESA_UNSIGNED_BYTE_4_4: + return sizeof(GLubyte); case GL_UNSIGNED_SHORT_5_6_5: return sizeof(GLushort); case GL_UNSIGNED_SHORT_5_6_5_REV: @@ -1581,8 +1584,8 @@ _mesa_clip_drawpixels(const struct gl_context *ctx, * scissor box is ignored, and we use the bounds of the current readbuffer * surface. * - * \return GL_TRUE if image is ready for drawing or - * GL_FALSE if image was completely clipped away (draw nothing) + * \return GL_TRUE if region to read is in bounds + * GL_FALSE if region is completely out of bounds (nothing to read) */ GLboolean _mesa_clip_readpixels(const struct gl_context *ctx, diff --git a/mesalib/src/mesa/main/imports.c b/mesalib/src/mesa/main/imports.c index dcd8cf537..f98098230 100644 --- a/mesalib/src/mesa/main/imports.c +++ b/mesalib/src/mesa/main/imports.c @@ -942,7 +942,7 @@ _mesa_problem( const struct gl_context *ctx, const char *fmtString, ... ) va_end( args ); fprintf(stderr, "Mesa %s implementation error: %s\n", MESA_VERSION_STRING, str); - fprintf(stderr, "Please report at bugzilla.freedesktop.org\n"); + fprintf(stderr, "Please report at bugs.freedesktop.org\n"); } diff --git a/mesalib/src/mesa/main/mipmap.c b/mesalib/src/mesa/main/mipmap.c index d27179e86..3d7ab6b35 100644 --- a/mesalib/src/mesa/main/mipmap.c +++ b/mesalib/src/mesa/main/mipmap.c @@ -612,6 +612,28 @@ do_row(GLenum datatype, GLuint comps, GLint srcWidth, dst[i] = (blue << 5) | (green << 2) | red; } } + + else if (datatype == MESA_UNSIGNED_BYTE_4_4 && comps == 2) { + GLuint i, j, k; + const GLubyte *rowA = (const GLubyte *) srcRowA; + const GLubyte *rowB = (const GLubyte *) srcRowB; + GLubyte *dst = (GLubyte *) dstRow; + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + const GLint rowAr0 = rowA[j] & 0xf; + const GLint rowAr1 = rowA[k] & 0xf; + const GLint rowBr0 = rowB[j] & 0xf; + const GLint rowBr1 = rowB[k] & 0xf; + const GLint rowAg0 = (rowA[j] >> 4) & 0xf; + const GLint rowAg1 = (rowA[k] >> 4) & 0xf; + const GLint rowBg0 = (rowB[j] >> 4) & 0xf; + const GLint rowBg1 = (rowB[k] >> 4) & 0xf; + const GLint r = (rowAr0 + rowAr1 + rowBr0 + rowBr1) >> 2; + const GLint g = (rowAg0 + rowAg1 + rowBg0 + rowBg1) >> 2; + dst[i] = (g << 4) | r; + } + } + else { _mesa_problem(NULL, "bad format in do_row()"); } @@ -1078,7 +1100,7 @@ do_row_3D(GLenum datatype, GLuint comps, GLint srcWidth, } } else if ((datatype == GL_UNSIGNED_BYTE_3_3_2) && (comps == 3)) { - DECLARE_ROW_POINTERS0(GLushort); + DECLARE_ROW_POINTERS0(GLubyte); for (i = j = 0, k = k0; i < (GLuint) dstWidth; i++, j += colStride, k += colStride) { @@ -1115,6 +1137,34 @@ do_row_3D(GLenum datatype, GLuint comps, GLint srcWidth, dst[i] = (b << 5) | (g << 2) | r; } } + else if (datatype == MESA_UNSIGNED_BYTE_4_4 && comps == 2) { + DECLARE_ROW_POINTERS0(GLubyte); + + for (i = j = 0, k = k0; i < (GLuint) dstWidth; + i++, j += colStride, k += colStride) { + const GLint rowAr0 = rowA[j] & 0xf; + const GLint rowAr1 = rowA[k] & 0xf; + const GLint rowBr0 = rowB[j] & 0xf; + const GLint rowBr1 = rowB[k] & 0xf; + const GLint rowCr0 = rowC[j] & 0xf; + const GLint rowCr1 = rowC[k] & 0xf; + const GLint rowDr0 = rowD[j] & 0xf; + const GLint rowDr1 = rowD[k] & 0xf; + const GLint rowAg0 = (rowA[j] >> 4) & 0xf; + const GLint rowAg1 = (rowA[k] >> 4) & 0xf; + const GLint rowBg0 = (rowB[j] >> 4) & 0xf; + const GLint rowBg1 = (rowB[k] >> 4) & 0xf; + const GLint rowCg0 = (rowC[j] >> 4) & 0xf; + const GLint rowCg1 = (rowC[k] >> 4) & 0xf; + const GLint rowDg0 = (rowD[j] >> 4) & 0xf; + const GLint rowDg1 = (rowD[k] >> 4) & 0xf; + const GLint r = FILTER_SUM_3D(rowAr0, rowAr1, rowBr0, rowBr1, + rowCr0, rowCr1, rowDr0, rowDr1); + const GLint g = FILTER_SUM_3D(rowAg0, rowAg1, rowBg0, rowBg1, + rowCg0, rowCg1, rowDg0, rowDg1); + dst[i] = (g << 4) | r; + } + } else { _mesa_problem(NULL, "bad format in do_row()"); } diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index b5966dffe..d2888fa80 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -1,3370 +1,3367 @@ -/* - * Mesa 3-D graphics library - * Version: 7.7 - * - * 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 mtypes.h - * Main Mesa data structures. - * - * Please try to mark derived values with a leading underscore ('_'). - */ - -#ifndef MTYPES_H -#define MTYPES_H - - -#include "main/glheader.h" -#include "main/config.h" -#include "main/mfeatures.h" -#include "glapi/glapi.h" -#include "math/m_matrix.h" /* GLmatrix */ -#include "main/simple_list.h" /* struct simple_node */ -#include "main/formats.h" /* MESA_FORMAT_COUNT */ - - -/** - * 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 - typedef GLubyte GLstencil; -#elif STENCIL_BITS==16 - typedef GLushort GLstencil; -#else -# error "illegal number of stencil bits" -#endif - - -/** - * \name 64-bit extension of GLbitfield. - */ -/*@{*/ -typedef GLuint64 GLbitfield64; - -/** Set a single bit */ -#define BITFIELD64_BIT(b) (1ULL << (b)) - - -/** - * \name Some forward type declarations - */ -/*@{*/ -struct _mesa_HashTable; -struct gl_attrib_node; -struct gl_list_extensions; -struct gl_meta_state; -struct gl_pixelstore_attrib; -struct gl_program_cache; -struct gl_texture_format; -struct gl_texture_image; -struct gl_texture_object; -struct gl_context; -struct st_context; -/*@}*/ - - -/** Extra draw modes beyond GL_POINTS, GL_TRIANGLE_FAN, etc */ -#define PRIM_OUTSIDE_BEGIN_END (GL_POLYGON+1) -#define PRIM_INSIDE_UNKNOWN_PRIM (GL_POLYGON+2) -#define PRIM_UNKNOWN (GL_POLYGON+3) - - -/** - * Shader stages. Note that these will become 5 with tessellation. - * These MUST have the same values as gallium's PIPE_SHADER_* - */ -typedef enum -{ - MESA_SHADER_VERTEX = 0, - MESA_SHADER_FRAGMENT = 1, - MESA_SHADER_GEOMETRY = 2, - MESA_SHADER_TYPES = 3 -} gl_shader_type; - - - -/** - * Indexes for vertex program attributes. - * GL_NV_vertex_program aliases generic attributes over the conventional - * attributes. In GL_ARB_vertex_program shader the aliasing is optional. - * In GL_ARB_vertex_shader / OpenGL 2.0 the aliasing is disallowed (the - * generic attributes are distinct/separate). - */ -typedef enum -{ - VERT_ATTRIB_POS = 0, - VERT_ATTRIB_WEIGHT = 1, - VERT_ATTRIB_NORMAL = 2, - VERT_ATTRIB_COLOR0 = 3, - VERT_ATTRIB_COLOR1 = 4, - VERT_ATTRIB_FOG = 5, - VERT_ATTRIB_COLOR_INDEX = 6, - VERT_ATTRIB_POINT_SIZE = 6, /*alias*/ - VERT_ATTRIB_EDGEFLAG = 7, - VERT_ATTRIB_TEX0 = 8, - VERT_ATTRIB_TEX1 = 9, - VERT_ATTRIB_TEX2 = 10, - VERT_ATTRIB_TEX3 = 11, - VERT_ATTRIB_TEX4 = 12, - VERT_ATTRIB_TEX5 = 13, - VERT_ATTRIB_TEX6 = 14, - VERT_ATTRIB_TEX7 = 15, - VERT_ATTRIB_GENERIC0 = 16, - VERT_ATTRIB_GENERIC1 = 17, - VERT_ATTRIB_GENERIC2 = 18, - VERT_ATTRIB_GENERIC3 = 19, - VERT_ATTRIB_GENERIC4 = 20, - VERT_ATTRIB_GENERIC5 = 21, - VERT_ATTRIB_GENERIC6 = 22, - VERT_ATTRIB_GENERIC7 = 23, - VERT_ATTRIB_GENERIC8 = 24, - VERT_ATTRIB_GENERIC9 = 25, - VERT_ATTRIB_GENERIC10 = 26, - VERT_ATTRIB_GENERIC11 = 27, - VERT_ATTRIB_GENERIC12 = 28, - VERT_ATTRIB_GENERIC13 = 29, - VERT_ATTRIB_GENERIC14 = 30, - VERT_ATTRIB_GENERIC15 = 31, - VERT_ATTRIB_MAX = 32 -} gl_vert_attrib; - -/** - * Bitflags for vertex attributes. - * These are used in bitfields in many places. - */ -/*@{*/ -#define VERT_BIT_POS (1 << VERT_ATTRIB_POS) -#define VERT_BIT_WEIGHT (1 << VERT_ATTRIB_WEIGHT) -#define VERT_BIT_NORMAL (1 << VERT_ATTRIB_NORMAL) -#define VERT_BIT_COLOR0 (1 << VERT_ATTRIB_COLOR0) -#define VERT_BIT_COLOR1 (1 << VERT_ATTRIB_COLOR1) -#define VERT_BIT_FOG (1 << VERT_ATTRIB_FOG) -#define VERT_BIT_COLOR_INDEX (1 << VERT_ATTRIB_COLOR_INDEX) -#define VERT_BIT_EDGEFLAG (1 << VERT_ATTRIB_EDGEFLAG) -#define VERT_BIT_TEX0 (1 << VERT_ATTRIB_TEX0) -#define VERT_BIT_TEX1 (1 << VERT_ATTRIB_TEX1) -#define VERT_BIT_TEX2 (1 << VERT_ATTRIB_TEX2) -#define VERT_BIT_TEX3 (1 << VERT_ATTRIB_TEX3) -#define VERT_BIT_TEX4 (1 << VERT_ATTRIB_TEX4) -#define VERT_BIT_TEX5 (1 << VERT_ATTRIB_TEX5) -#define VERT_BIT_TEX6 (1 << VERT_ATTRIB_TEX6) -#define VERT_BIT_TEX7 (1 << VERT_ATTRIB_TEX7) -#define VERT_BIT_GENERIC0 (1 << VERT_ATTRIB_GENERIC0) -#define VERT_BIT_GENERIC1 (1 << VERT_ATTRIB_GENERIC1) -#define VERT_BIT_GENERIC2 (1 << VERT_ATTRIB_GENERIC2) -#define VERT_BIT_GENERIC3 (1 << VERT_ATTRIB_GENERIC3) -#define VERT_BIT_GENERIC4 (1 << VERT_ATTRIB_GENERIC4) -#define VERT_BIT_GENERIC5 (1 << VERT_ATTRIB_GENERIC5) -#define VERT_BIT_GENERIC6 (1 << VERT_ATTRIB_GENERIC6) -#define VERT_BIT_GENERIC7 (1 << VERT_ATTRIB_GENERIC7) -#define VERT_BIT_GENERIC8 (1 << VERT_ATTRIB_GENERIC8) -#define VERT_BIT_GENERIC9 (1 << VERT_ATTRIB_GENERIC9) -#define VERT_BIT_GENERIC10 (1 << VERT_ATTRIB_GENERIC10) -#define VERT_BIT_GENERIC11 (1 << VERT_ATTRIB_GENERIC11) -#define VERT_BIT_GENERIC12 (1 << VERT_ATTRIB_GENERIC12) -#define VERT_BIT_GENERIC13 (1 << VERT_ATTRIB_GENERIC13) -#define VERT_BIT_GENERIC14 (1 << VERT_ATTRIB_GENERIC14) -#define VERT_BIT_GENERIC15 (1 << VERT_ATTRIB_GENERIC15) - -#define VERT_BIT_TEX(u) (1 << (VERT_ATTRIB_TEX0 + (u))) -#define VERT_BIT_GENERIC(g) (1 << (VERT_ATTRIB_GENERIC0 + (g))) -/*@}*/ - - -/** - * Indexes for vertex program result attributes - */ -typedef enum -{ - VERT_RESULT_HPOS = 0, - VERT_RESULT_COL0 = 1, - VERT_RESULT_COL1 = 2, - VERT_RESULT_FOGC = 3, - VERT_RESULT_TEX0 = 4, - VERT_RESULT_TEX1 = 5, - VERT_RESULT_TEX2 = 6, - VERT_RESULT_TEX3 = 7, - VERT_RESULT_TEX4 = 8, - VERT_RESULT_TEX5 = 9, - VERT_RESULT_TEX6 = 10, - VERT_RESULT_TEX7 = 11, - VERT_RESULT_PSIZ = 12, - VERT_RESULT_BFC0 = 13, - VERT_RESULT_BFC1 = 14, - VERT_RESULT_EDGE = 15, - VERT_RESULT_VAR0 = 16, /**< shader varying */ - VERT_RESULT_MAX = (VERT_RESULT_VAR0 + MAX_VARYING) -} gl_vert_result; - - -/*********************************************/ - -/** - * Indexes for geometry program attributes. - */ -typedef enum -{ - GEOM_ATTRIB_POSITION = 0, - GEOM_ATTRIB_COLOR0 = 1, - GEOM_ATTRIB_COLOR1 = 2, - GEOM_ATTRIB_SECONDARY_COLOR0 = 3, - GEOM_ATTRIB_SECONDARY_COLOR1 = 4, - GEOM_ATTRIB_FOG_FRAG_COORD = 5, - GEOM_ATTRIB_POINT_SIZE = 6, - GEOM_ATTRIB_CLIP_VERTEX = 7, - GEOM_ATTRIB_PRIMITIVE_ID = 8, - GEOM_ATTRIB_TEX_COORD = 9, - - GEOM_ATTRIB_VAR0 = 16, - GEOM_ATTRIB_MAX = (GEOM_ATTRIB_VAR0 + MAX_VARYING) -} gl_geom_attrib; - -/** - * Bitflags for geometry attributes. - * These are used in bitfields in many places. - */ -/*@{*/ -#define GEOM_BIT_COLOR0 (1 << GEOM_ATTRIB_COLOR0) -#define GEOM_BIT_COLOR1 (1 << GEOM_ATTRIB_COLOR1) -#define GEOM_BIT_SCOLOR0 (1 << GEOM_ATTRIB_SECONDARY_COLOR0) -#define GEOM_BIT_SCOLOR1 (1 << GEOM_ATTRIB_SECONDARY_COLOR1) -#define GEOM_BIT_TEX_COORD (1 << GEOM_ATTRIB_TEX_COORD) -#define GEOM_BIT_FOG_COORD (1 << GEOM_ATTRIB_FOG_FRAG_COORD) -#define GEOM_BIT_POSITION (1 << GEOM_ATTRIB_POSITION) -#define GEOM_BIT_POINT_SIDE (1 << GEOM_ATTRIB_POINT_SIZE) -#define GEOM_BIT_CLIP_VERTEX (1 << GEOM_ATTRIB_CLIP_VERTEX) -#define GEOM_BIT_PRIM_ID (1 << GEOM_ATTRIB_PRIMITIVE_ID) -#define GEOM_BIT_VAR0 (1 << GEOM_ATTRIB_VAR0) - -#define GEOM_BIT_VAR(g) (1 << (GEOM_BIT_VAR0 + (g))) -/*@}*/ - - -/** - * Indexes for geometry program result attributes - */ -typedef enum -{ - GEOM_RESULT_POS = 0, - GEOM_RESULT_COL0 = 1, - GEOM_RESULT_COL1 = 2, - GEOM_RESULT_SCOL0 = 3, - GEOM_RESULT_SCOL1 = 4, - GEOM_RESULT_FOGC = 5, - GEOM_RESULT_TEX0 = 6, - GEOM_RESULT_TEX1 = 7, - GEOM_RESULT_TEX2 = 8, - GEOM_RESULT_TEX3 = 9, - GEOM_RESULT_TEX4 = 10, - GEOM_RESULT_TEX5 = 11, - GEOM_RESULT_TEX6 = 12, - GEOM_RESULT_TEX7 = 13, - GEOM_RESULT_PSIZ = 14, - GEOM_RESULT_CLPV = 15, - GEOM_RESULT_PRID = 16, - GEOM_RESULT_LAYR = 17, - GEOM_RESULT_VAR0 = 18, /**< shader varying, should really be 16 */ - /* ### we need to -2 because var0 is 18 instead 16 like in the others */ - GEOM_RESULT_MAX = (GEOM_RESULT_VAR0 + MAX_VARYING - 2) -} gl_geom_result; - - -/** - * Indexes for fragment program input attributes. - */ -typedef enum -{ - FRAG_ATTRIB_WPOS = 0, - FRAG_ATTRIB_COL0 = 1, - FRAG_ATTRIB_COL1 = 2, - FRAG_ATTRIB_FOGC = 3, - FRAG_ATTRIB_TEX0 = 4, - FRAG_ATTRIB_TEX1 = 5, - FRAG_ATTRIB_TEX2 = 6, - FRAG_ATTRIB_TEX3 = 7, - FRAG_ATTRIB_TEX4 = 8, - FRAG_ATTRIB_TEX5 = 9, - FRAG_ATTRIB_TEX6 = 10, - FRAG_ATTRIB_TEX7 = 11, - FRAG_ATTRIB_FACE = 12, /**< front/back face */ - FRAG_ATTRIB_PNTC = 13, /**< sprite/point coord */ - FRAG_ATTRIB_VAR0 = 14, /**< shader varying */ - FRAG_ATTRIB_MAX = (FRAG_ATTRIB_VAR0 + MAX_VARYING) -} gl_frag_attrib; - -/** - * Bitflags for fragment program input attributes. - */ -/*@{*/ -#define FRAG_BIT_WPOS (1 << FRAG_ATTRIB_WPOS) -#define FRAG_BIT_COL0 (1 << FRAG_ATTRIB_COL0) -#define FRAG_BIT_COL1 (1 << FRAG_ATTRIB_COL1) -#define FRAG_BIT_FOGC (1 << FRAG_ATTRIB_FOGC) -#define FRAG_BIT_FACE (1 << FRAG_ATTRIB_FACE) -#define FRAG_BIT_PNTC (1 << FRAG_ATTRIB_PNTC) -#define FRAG_BIT_TEX0 (1 << FRAG_ATTRIB_TEX0) -#define FRAG_BIT_TEX1 (1 << FRAG_ATTRIB_TEX1) -#define FRAG_BIT_TEX2 (1 << FRAG_ATTRIB_TEX2) -#define FRAG_BIT_TEX3 (1 << FRAG_ATTRIB_TEX3) -#define FRAG_BIT_TEX4 (1 << FRAG_ATTRIB_TEX4) -#define FRAG_BIT_TEX5 (1 << FRAG_ATTRIB_TEX5) -#define FRAG_BIT_TEX6 (1 << FRAG_ATTRIB_TEX6) -#define FRAG_BIT_TEX7 (1 << FRAG_ATTRIB_TEX7) -#define FRAG_BIT_VAR0 (1 << FRAG_ATTRIB_VAR0) - -#define FRAG_BIT_TEX(U) (FRAG_BIT_TEX0 << (U)) -#define FRAG_BIT_VAR(V) (FRAG_BIT_VAR0 << (V)) - -#define FRAG_BITS_TEX_ANY (FRAG_BIT_TEX0| \ - FRAG_BIT_TEX1| \ - FRAG_BIT_TEX2| \ - FRAG_BIT_TEX3| \ - FRAG_BIT_TEX4| \ - FRAG_BIT_TEX5| \ - FRAG_BIT_TEX6| \ - FRAG_BIT_TEX7) -/*@}*/ - - -/** - * Fragment program results - */ -typedef enum -{ - FRAG_RESULT_DEPTH = 0, - FRAG_RESULT_STENCIL = 1, - FRAG_RESULT_COLOR = 2, - FRAG_RESULT_DATA0 = 3, - FRAG_RESULT_MAX = (FRAG_RESULT_DATA0 + MAX_DRAW_BUFFERS) -} gl_frag_result; - - -/** - * Indexes for all renderbuffers - */ -typedef enum -{ - /* the four standard color buffers */ - BUFFER_FRONT_LEFT, - BUFFER_BACK_LEFT, - BUFFER_FRONT_RIGHT, - BUFFER_BACK_RIGHT, - BUFFER_DEPTH, - BUFFER_STENCIL, - BUFFER_ACCUM, - /* optional aux buffer */ - BUFFER_AUX0, - /* generic renderbuffers */ - BUFFER_COLOR0, - BUFFER_COLOR1, - BUFFER_COLOR2, - BUFFER_COLOR3, - BUFFER_COLOR4, - BUFFER_COLOR5, - BUFFER_COLOR6, - BUFFER_COLOR7, - BUFFER_COUNT -} gl_buffer_index; - -/** - * Bit flags for all renderbuffers - */ -#define BUFFER_BIT_FRONT_LEFT (1 << BUFFER_FRONT_LEFT) -#define BUFFER_BIT_BACK_LEFT (1 << BUFFER_BACK_LEFT) -#define BUFFER_BIT_FRONT_RIGHT (1 << BUFFER_FRONT_RIGHT) -#define BUFFER_BIT_BACK_RIGHT (1 << BUFFER_BACK_RIGHT) -#define BUFFER_BIT_AUX0 (1 << BUFFER_AUX0) -#define BUFFER_BIT_AUX1 (1 << BUFFER_AUX1) -#define BUFFER_BIT_AUX2 (1 << BUFFER_AUX2) -#define BUFFER_BIT_AUX3 (1 << BUFFER_AUX3) -#define BUFFER_BIT_DEPTH (1 << BUFFER_DEPTH) -#define BUFFER_BIT_STENCIL (1 << BUFFER_STENCIL) -#define BUFFER_BIT_ACCUM (1 << BUFFER_ACCUM) -#define BUFFER_BIT_COLOR0 (1 << BUFFER_COLOR0) -#define BUFFER_BIT_COLOR1 (1 << BUFFER_COLOR1) -#define BUFFER_BIT_COLOR2 (1 << BUFFER_COLOR2) -#define BUFFER_BIT_COLOR3 (1 << BUFFER_COLOR3) -#define BUFFER_BIT_COLOR4 (1 << BUFFER_COLOR4) -#define BUFFER_BIT_COLOR5 (1 << BUFFER_COLOR5) -#define BUFFER_BIT_COLOR6 (1 << BUFFER_COLOR6) -#define BUFFER_BIT_COLOR7 (1 << BUFFER_COLOR7) - -/** - * Mask of all the color buffer bits (but not accum). - */ -#define BUFFER_BITS_COLOR (BUFFER_BIT_FRONT_LEFT | \ - BUFFER_BIT_BACK_LEFT | \ - BUFFER_BIT_FRONT_RIGHT | \ - BUFFER_BIT_BACK_RIGHT | \ - BUFFER_BIT_AUX0 | \ - BUFFER_BIT_COLOR0 | \ - BUFFER_BIT_COLOR1 | \ - BUFFER_BIT_COLOR2 | \ - BUFFER_BIT_COLOR3 | \ - BUFFER_BIT_COLOR4 | \ - BUFFER_BIT_COLOR5 | \ - BUFFER_BIT_COLOR6 | \ - BUFFER_BIT_COLOR7) - - -/** - * Framebuffer configuration (aka visual / pixelformat) - * Note: some of these fields should be boolean, but it appears that - * code in drivers/dri/common/util.c requires int-sized fields. - */ -struct gl_config -{ - GLboolean rgbMode; - GLboolean floatMode; - GLboolean colorIndexMode; /* XXX is this used anywhere? */ - GLuint doubleBufferMode; - GLuint stereoMode; - - GLboolean haveAccumBuffer; - GLboolean haveDepthBuffer; - GLboolean haveStencilBuffer; - - GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */ - GLuint redMask, greenMask, blueMask, alphaMask; - GLint rgbBits; /* total bits for rgb */ - GLint indexBits; /* total bits for colorindex */ - - GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits; - GLint depthBits; - GLint stencilBits; - - GLint numAuxBuffers; - - GLint level; - - /* EXT_visual_rating / GLX 1.2 */ - GLint visualRating; - - /* EXT_visual_info / GLX 1.2 */ - GLint transparentPixel; - /* colors are floats scaled to ints */ - GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha; - GLint transparentIndex; - - /* ARB_multisample / SGIS_multisample */ - GLint sampleBuffers; - GLint samples; - - /* SGIX_pbuffer / GLX 1.3 */ - GLint maxPbufferWidth; - GLint maxPbufferHeight; - GLint maxPbufferPixels; - GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */ - GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */ - - /* OML_swap_method */ - GLint swapMethod; - - /* EXT_texture_from_pixmap */ - GLint bindToTextureRgb; - GLint bindToTextureRgba; - GLint bindToMipmapTexture; - GLint bindToTextureTargets; - GLint yInverted; - - /* EXT_framebuffer_sRGB */ - GLint sRGBCapable; -}; - - -/** - * Data structure for color tables - */ -struct gl_color_table -{ - GLenum InternalFormat; /**< The user-specified format */ - GLenum _BaseFormat; /**< GL_ALPHA, GL_RGBA, GL_RGB, etc */ - GLuint Size; /**< number of entries in table */ - GLfloat *TableF; /**< Color table, floating point values */ - GLubyte *TableUB; /**< Color table, ubyte values */ - GLubyte RedSize; - GLubyte GreenSize; - GLubyte BlueSize; - GLubyte AlphaSize; - GLubyte LuminanceSize; - GLubyte IntensitySize; -}; - - -/** - * \name Bit flags used for updating material values. - */ -/*@{*/ -#define MAT_ATTRIB_FRONT_AMBIENT 0 -#define MAT_ATTRIB_BACK_AMBIENT 1 -#define MAT_ATTRIB_FRONT_DIFFUSE 2 -#define MAT_ATTRIB_BACK_DIFFUSE 3 -#define MAT_ATTRIB_FRONT_SPECULAR 4 -#define MAT_ATTRIB_BACK_SPECULAR 5 -#define MAT_ATTRIB_FRONT_EMISSION 6 -#define MAT_ATTRIB_BACK_EMISSION 7 -#define MAT_ATTRIB_FRONT_SHININESS 8 -#define MAT_ATTRIB_BACK_SHININESS 9 -#define MAT_ATTRIB_FRONT_INDEXES 10 -#define MAT_ATTRIB_BACK_INDEXES 11 -#define MAT_ATTRIB_MAX 12 - -#define MAT_ATTRIB_AMBIENT(f) (MAT_ATTRIB_FRONT_AMBIENT+(f)) -#define MAT_ATTRIB_DIFFUSE(f) (MAT_ATTRIB_FRONT_DIFFUSE+(f)) -#define MAT_ATTRIB_SPECULAR(f) (MAT_ATTRIB_FRONT_SPECULAR+(f)) -#define MAT_ATTRIB_EMISSION(f) (MAT_ATTRIB_FRONT_EMISSION+(f)) -#define MAT_ATTRIB_SHININESS(f)(MAT_ATTRIB_FRONT_SHININESS+(f)) -#define MAT_ATTRIB_INDEXES(f) (MAT_ATTRIB_FRONT_INDEXES+(f)) - -#define MAT_INDEX_AMBIENT 0 -#define MAT_INDEX_DIFFUSE 1 -#define MAT_INDEX_SPECULAR 2 - -#define MAT_BIT_FRONT_AMBIENT (1< ) */ - GLfloat _NormSpotDirection[4]; /**< normalized spotlight direction */ - GLfloat _VP_inf_spot_attenuation; - - GLfloat _SpotExpTable[EXP_TABLE_SIZE][2]; /**< to replace a pow() call */ - GLfloat _MatAmbient[2][3]; /**< material ambient * light ambient */ - GLfloat _MatDiffuse[2][3]; /**< material diffuse * light diffuse */ - GLfloat _MatSpecular[2][3]; /**< material spec * light specular */ - GLfloat _dli; /**< CI diffuse light intensity */ - GLfloat _sli; /**< CI specular light intensity */ - /*@}*/ -}; - - -/** - * Light model state. - */ -struct gl_lightmodel -{ - GLfloat Ambient[4]; /**< ambient color */ - GLboolean LocalViewer; /**< Local (or infinite) view point? */ - GLboolean TwoSide; /**< Two (or one) sided lighting? */ - GLenum ColorControl; /**< either GL_SINGLE_COLOR - * or GL_SEPARATE_SPECULAR_COLOR */ -}; - - -/** - * Material state. - */ -struct gl_material -{ - GLfloat Attrib[MAT_ATTRIB_MAX][4]; -}; - - -/** - * Accumulation buffer attribute group (GL_ACCUM_BUFFER_BIT) - */ -struct gl_accum_attrib -{ - GLfloat ClearColor[4]; /**< Accumulation buffer clear color */ -}; - - -/** - * Color buffer attribute group (GL_COLOR_BUFFER_BIT). - */ -struct gl_colorbuffer_attrib -{ - GLuint ClearIndex; /**< Index to use for glClear */ - GLclampf ClearColor[4]; /**< Color to use for glClear */ - - GLuint IndexMask; /**< Color index write mask */ - GLubyte ColorMask[MAX_DRAW_BUFFERS][4];/**< Each flag is 0xff or 0x0 */ - - GLenum DrawBuffer[MAX_DRAW_BUFFERS]; /**< Which buffer to draw into */ - - /** - * \name alpha testing - */ - /*@{*/ - GLboolean AlphaEnabled; /**< Alpha test enabled flag */ - GLenum AlphaFunc; /**< Alpha test function */ - GLclampf AlphaRef; /**< Alpha reference value */ - /*@}*/ - - /** - * \name Blending - */ - /*@{*/ - GLbitfield BlendEnabled; /**< Per-buffer blend enable flags */ - GLfloat BlendColor[4]; /**< Blending color */ - struct - { - GLenum SrcRGB; /**< RGB blend source term */ - GLenum DstRGB; /**< RGB blend dest term */ - GLenum SrcA; /**< Alpha blend source term */ - GLenum DstA; /**< Alpha blend dest term */ - GLenum EquationRGB; /**< GL_ADD, GL_SUBTRACT, etc. */ - GLenum EquationA; /**< GL_ADD, GL_SUBTRACT, etc. */ - } Blend[MAX_DRAW_BUFFERS]; - /** Are the blend func terms currently different for each buffer/target? */ - GLboolean _BlendFuncPerBuffer; - /** Are the blend equations currently different for each buffer/target? */ - GLboolean _BlendEquationPerBuffer; - /*@}*/ - - /** - * \name Logic op - */ - /*@{*/ - GLenum LogicOp; /**< Logic operator */ - GLboolean IndexLogicOpEnabled; /**< Color index logic op enabled flag */ - GLboolean ColorLogicOpEnabled; /**< RGBA logic op enabled flag */ - GLboolean _LogicOpEnabled; /**< RGBA logic op + EXT_blend_logic_op enabled flag */ - /*@}*/ - - GLboolean DitherFlag; /**< Dither enable flag */ - - GLenum ClampFragmentColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */ - GLenum ClampReadColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */ - - GLboolean sRGBEnabled; /**< Framebuffer sRGB blending/updating requested */ -}; - - -/** - * Current attribute group (GL_CURRENT_BIT). - */ -struct gl_current_attrib -{ - /** - * \name Current vertex attributes. - * \note Values are valid only after FLUSH_VERTICES has been called. - * \note Index and Edgeflag current values are stored as floats in the - * SIX and SEVEN attribute slots. - */ - GLfloat Attrib[VERT_ATTRIB_MAX][4]; /**< Position, color, texcoords, etc */ - - /** - * \name Current raster position attributes (always valid). - * \note This set of attributes is very similar to the SWvertex struct. - */ - /*@{*/ - GLfloat RasterPos[4]; - GLfloat RasterDistance; - GLfloat RasterColor[4]; - GLfloat RasterSecondaryColor[4]; - GLfloat RasterTexCoords[MAX_TEXTURE_COORD_UNITS][4]; - GLboolean RasterPosValid; - /*@}*/ -}; - - -/** - * Depth buffer attribute group (GL_DEPTH_BUFFER_BIT). - */ -struct gl_depthbuffer_attrib -{ - GLenum Func; /**< Function for depth buffer compare */ - GLclampd Clear; /**< Value to clear depth buffer to */ - GLboolean Test; /**< Depth buffering enabled flag */ - GLboolean Mask; /**< Depth buffer writable? */ - GLboolean BoundsTest; /**< GL_EXT_depth_bounds_test */ - GLfloat BoundsMin, BoundsMax;/**< GL_EXT_depth_bounds_test */ -}; - - -/** - * Evaluator attribute group (GL_EVAL_BIT). - */ -struct gl_eval_attrib -{ - /** - * \name Enable bits - */ - /*@{*/ - GLboolean Map1Color4; - GLboolean Map1Index; - GLboolean Map1Normal; - GLboolean Map1TextureCoord1; - GLboolean Map1TextureCoord2; - GLboolean Map1TextureCoord3; - GLboolean Map1TextureCoord4; - GLboolean Map1Vertex3; - GLboolean Map1Vertex4; - GLboolean Map1Attrib[16]; /* GL_NV_vertex_program */ - GLboolean Map2Color4; - GLboolean Map2Index; - GLboolean Map2Normal; - GLboolean Map2TextureCoord1; - GLboolean Map2TextureCoord2; - GLboolean Map2TextureCoord3; - GLboolean Map2TextureCoord4; - GLboolean Map2Vertex3; - GLboolean Map2Vertex4; - GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */ - GLboolean AutoNormal; - /*@}*/ - - /** - * \name Map Grid endpoints and divisions and calculated du values - */ - /*@{*/ - GLint MapGrid1un; - GLfloat MapGrid1u1, MapGrid1u2, MapGrid1du; - GLint MapGrid2un, MapGrid2vn; - GLfloat MapGrid2u1, MapGrid2u2, MapGrid2du; - GLfloat MapGrid2v1, MapGrid2v2, MapGrid2dv; - /*@}*/ -}; - - -/** - * Fog attribute group (GL_FOG_BIT). - */ -struct gl_fog_attrib -{ - GLboolean Enabled; /**< Fog enabled flag */ - GLfloat Color[4]; /**< Fog color */ - GLfloat Density; /**< Density >= 0.0 */ - GLfloat Start; /**< Start distance in eye coords */ - GLfloat End; /**< End distance in eye coords */ - GLfloat Index; /**< Fog index */ - GLenum Mode; /**< Fog mode */ - GLboolean ColorSumEnabled; - GLenum FogCoordinateSource; /**< GL_EXT_fog_coord */ - GLfloat _Scale; /**< (End == Start) ? 1.0 : 1.0 / (End - Start) */ -}; - - -/** - * \brief Layout qualifiers for gl_FragDepth. - * - * Extension AMD_conservative_depth allows gl_FragDepth to be redeclared with - * a layout qualifier. - * - * \see enum ir_depth_layout - */ -enum gl_frag_depth_layout { - FRAG_DEPTH_LAYOUT_NONE, /**< No layout is specified. */ - FRAG_DEPTH_LAYOUT_ANY, - FRAG_DEPTH_LAYOUT_GREATER, - FRAG_DEPTH_LAYOUT_LESS, - FRAG_DEPTH_LAYOUT_UNCHANGED -}; - - -/** - * Hint attribute group (GL_HINT_BIT). - * - * Values are always one of GL_FASTEST, GL_NICEST, or GL_DONT_CARE. - */ -struct gl_hint_attrib -{ - GLenum PerspectiveCorrection; - GLenum PointSmooth; - GLenum LineSmooth; - GLenum PolygonSmooth; - GLenum Fog; - GLenum ClipVolumeClipping; /**< GL_EXT_clip_volume_hint */ - GLenum TextureCompression; /**< GL_ARB_texture_compression */ - GLenum GenerateMipmap; /**< GL_SGIS_generate_mipmap */ - GLenum FragmentShaderDerivative; /**< GL_ARB_fragment_shader */ -}; - -/** - * Light state flags. - */ -/*@{*/ -#define LIGHT_SPOT 0x1 -#define LIGHT_LOCAL_VIEWER 0x2 -#define LIGHT_POSITIONAL 0x4 -#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER) -/*@}*/ - - -/** - * Lighting attribute group (GL_LIGHT_BIT). - */ -struct gl_light_attrib -{ - struct gl_light Light[MAX_LIGHTS]; /**< Array of light sources */ - struct gl_lightmodel Model; /**< Lighting model */ - - /** - * Must flush FLUSH_VERTICES before referencing: - */ - /*@{*/ - struct gl_material Material; /**< Includes front & back values */ - /*@}*/ - - GLboolean Enabled; /**< Lighting enabled flag */ - GLenum ShadeModel; /**< GL_FLAT or GL_SMOOTH */ - GLenum ProvokingVertex; /**< GL_EXT_provoking_vertex */ - GLenum ColorMaterialFace; /**< GL_FRONT, BACK or FRONT_AND_BACK */ - GLenum ColorMaterialMode; /**< GL_AMBIENT, GL_DIFFUSE, etc */ - GLbitfield ColorMaterialBitmask; /**< bitmask formed from Face and Mode */ - GLboolean ColorMaterialEnabled; - GLenum ClampVertexColor; - - struct gl_light EnabledList; /**< List sentinel */ - - /** - * Derived state for optimizations: - */ - /*@{*/ - GLboolean _NeedEyeCoords; - GLboolean _NeedVertices; /**< Use fast shader? */ - GLbitfield _Flags; /**< LIGHT_* flags, see above */ - GLfloat _BaseColor[2][3]; - /*@}*/ -}; - - -/** - * Line attribute group (GL_LINE_BIT). - */ -struct gl_line_attrib -{ - GLboolean SmoothFlag; /**< GL_LINE_SMOOTH enabled? */ - GLboolean StippleFlag; /**< GL_LINE_STIPPLE enabled? */ - GLushort StipplePattern; /**< Stipple pattern */ - GLint StippleFactor; /**< Stipple repeat factor */ - GLfloat Width; /**< Line width */ -}; - - -/** - * Display list attribute group (GL_LIST_BIT). - */ -struct gl_list_attrib -{ - GLuint ListBase; -}; - - -/** - * Multisample attribute group (GL_MULTISAMPLE_BIT). - */ -struct gl_multisample_attrib -{ - GLboolean Enabled; - GLboolean _Enabled; /**< true if Enabled and multisample buffer */ - GLboolean SampleAlphaToCoverage; - GLboolean SampleAlphaToOne; - GLboolean SampleCoverage; - GLfloat SampleCoverageValue; - GLboolean SampleCoverageInvert; -}; - - -/** - * A pixelmap (see glPixelMap) - */ -struct gl_pixelmap -{ - GLint Size; - GLfloat Map[MAX_PIXEL_MAP_TABLE]; - GLubyte Map8[MAX_PIXEL_MAP_TABLE]; /**< converted to 8-bit color */ -}; - - -/** - * Collection of all pixelmaps - */ -struct gl_pixelmaps -{ - struct gl_pixelmap RtoR; /**< i.e. GL_PIXEL_MAP_R_TO_R */ - struct gl_pixelmap GtoG; - struct gl_pixelmap BtoB; - struct gl_pixelmap AtoA; - struct gl_pixelmap ItoR; - struct gl_pixelmap ItoG; - struct gl_pixelmap ItoB; - struct gl_pixelmap ItoA; - struct gl_pixelmap ItoI; - struct gl_pixelmap StoS; -}; - - -/** - * Pixel attribute group (GL_PIXEL_MODE_BIT). - */ -struct gl_pixel_attrib -{ - GLenum ReadBuffer; /**< source buffer for glRead/CopyPixels() */ - - /*--- Begin Pixel Transfer State ---*/ - /* Fields are in the order in which they're applied... */ - - /** Scale & Bias (index shift, offset) */ - /*@{*/ - GLfloat RedBias, RedScale; - GLfloat GreenBias, GreenScale; - GLfloat BlueBias, BlueScale; - GLfloat AlphaBias, AlphaScale; - GLfloat DepthBias, DepthScale; - GLint IndexShift, IndexOffset; - /*@}*/ - - /* Pixel Maps */ - /* Note: actual pixel maps are not part of this attrib group */ - GLboolean MapColorFlag; - GLboolean MapStencilFlag; - - /*--- End Pixel Transfer State ---*/ - - /** glPixelZoom */ - GLfloat ZoomX, ZoomY; - - /** GL_SGI_texture_color_table */ - GLfloat TextureColorTableScale[4]; /**< RGBA */ - GLfloat TextureColorTableBias[4]; /**< RGBA */ -}; - - -/** - * Point attribute group (GL_POINT_BIT). - */ -struct gl_point_attrib -{ - GLboolean SmoothFlag; /**< True if GL_POINT_SMOOTH is enabled */ - GLfloat Size; /**< User-specified point size */ - GLfloat Params[3]; /**< GL_EXT_point_parameters */ - GLfloat MinSize, MaxSize; /**< GL_EXT_point_parameters */ - GLfloat Threshold; /**< GL_EXT_point_parameters */ - GLboolean _Attenuated; /**< True if Params != [1, 0, 0] */ - GLboolean PointSprite; /**< GL_NV/ARB_point_sprite */ - GLboolean CoordReplace[MAX_TEXTURE_COORD_UNITS]; /**< GL_ARB_point_sprite*/ - GLenum SpriteRMode; /**< GL_NV_point_sprite (only!) */ - GLenum SpriteOrigin; /**< GL_ARB_point_sprite */ -}; - - -/** - * Polygon attribute group (GL_POLYGON_BIT). - */ -struct gl_polygon_attrib -{ - GLenum FrontFace; /**< Either GL_CW or GL_CCW */ - GLenum FrontMode; /**< Either GL_POINT, GL_LINE or GL_FILL */ - GLenum BackMode; /**< Either GL_POINT, GL_LINE or GL_FILL */ - GLboolean _FrontBit; /**< 0=GL_CCW, 1=GL_CW */ - GLboolean CullFlag; /**< Culling on/off flag */ - GLboolean SmoothFlag; /**< True if GL_POLYGON_SMOOTH is enabled */ - GLboolean StippleFlag; /**< True if GL_POLYGON_STIPPLE is enabled */ - GLenum CullFaceMode; /**< Culling mode GL_FRONT or GL_BACK */ - GLfloat OffsetFactor; /**< Polygon offset factor, from user */ - GLfloat OffsetUnits; /**< Polygon offset units, from user */ - GLboolean OffsetPoint; /**< Offset in GL_POINT mode */ - GLboolean OffsetLine; /**< Offset in GL_LINE mode */ - GLboolean OffsetFill; /**< Offset in GL_FILL mode */ -}; - - -/** - * Scissor attributes (GL_SCISSOR_BIT). - */ -struct gl_scissor_attrib -{ - GLboolean Enabled; /**< Scissor test enabled? */ - GLint X, Y; /**< Lower left corner of box */ - GLsizei Width, Height; /**< Size of box */ -}; - - -/** - * Stencil attribute group (GL_STENCIL_BUFFER_BIT). - * - * Three sets of stencil data are tracked so that OpenGL 2.0, - * GL_EXT_stencil_two_side, and GL_ATI_separate_stencil can all be supported - * simultaneously. In each of the stencil state arrays, element 0 corresponds - * to GL_FRONT. Element 1 corresponds to the OpenGL 2.0 / - * GL_ATI_separate_stencil GL_BACK state. Element 2 corresponds to the - * GL_EXT_stencil_two_side GL_BACK state. - * - * The derived value \c _BackFace is either 1 or 2 depending on whether or - * not GL_STENCIL_TEST_TWO_SIDE_EXT is enabled. - * - * The derived value \c _TestTwoSide is set when the front-face and back-face - * stencil state are different. - */ -struct gl_stencil_attrib -{ - GLboolean Enabled; /**< Enabled flag */ - GLboolean TestTwoSide; /**< GL_EXT_stencil_two_side */ - GLubyte ActiveFace; /**< GL_EXT_stencil_two_side (0 or 2) */ - GLboolean _Enabled; /**< Enabled and stencil buffer present */ - GLboolean _TestTwoSide; - GLubyte _BackFace; /**< Current back stencil state (1 or 2) */ - GLenum Function[3]; /**< Stencil function */ - GLenum FailFunc[3]; /**< Fail function */ - GLenum ZPassFunc[3]; /**< Depth buffer pass function */ - GLenum ZFailFunc[3]; /**< Depth buffer fail function */ - GLint Ref[3]; /**< Reference value */ - GLuint ValueMask[3]; /**< Value mask */ - GLuint WriteMask[3]; /**< Write mask */ - GLuint Clear; /**< Clear value */ -}; - - -/** - * An index for each type of texture object. These correspond to the GL - * texture target enums, such as GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, etc. - * Note: the order is from highest priority to lowest priority. - */ -typedef enum -{ - TEXTURE_2D_ARRAY_INDEX, - TEXTURE_1D_ARRAY_INDEX, - TEXTURE_CUBE_INDEX, - TEXTURE_3D_INDEX, - TEXTURE_RECT_INDEX, - TEXTURE_2D_INDEX, - TEXTURE_1D_INDEX, - NUM_TEXTURE_TARGETS -} gl_texture_index; - - -/** - * Bit flags for each type of texture object - * Used for Texture.Unit[]._ReallyEnabled flags. - */ -/*@{*/ -#define TEXTURE_2D_ARRAY_BIT (1 << TEXTURE_2D_ARRAY_INDEX) -#define TEXTURE_1D_ARRAY_BIT (1 << TEXTURE_1D_ARRAY_INDEX) -#define TEXTURE_CUBE_BIT (1 << TEXTURE_CUBE_INDEX) -#define TEXTURE_3D_BIT (1 << TEXTURE_3D_INDEX) -#define TEXTURE_RECT_BIT (1 << TEXTURE_RECT_INDEX) -#define TEXTURE_2D_BIT (1 << TEXTURE_2D_INDEX) -#define TEXTURE_1D_BIT (1 << TEXTURE_1D_INDEX) -/*@}*/ - - -/** - * TexGenEnabled flags. - */ -/*@{*/ -#define S_BIT 1 -#define T_BIT 2 -#define R_BIT 4 -#define Q_BIT 8 -#define STR_BITS (S_BIT | T_BIT | R_BIT) -/*@}*/ - - -/** - * Bit flag versions of the corresponding GL_ constants. - */ -/*@{*/ -#define TEXGEN_SPHERE_MAP 0x1 -#define TEXGEN_OBJ_LINEAR 0x2 -#define TEXGEN_EYE_LINEAR 0x4 -#define TEXGEN_REFLECTION_MAP_NV 0x8 -#define TEXGEN_NORMAL_MAP_NV 0x10 - -#define TEXGEN_NEED_NORMALS (TEXGEN_SPHERE_MAP | \ - TEXGEN_REFLECTION_MAP_NV | \ - TEXGEN_NORMAL_MAP_NV) -#define TEXGEN_NEED_EYE_COORD (TEXGEN_SPHERE_MAP | \ - TEXGEN_REFLECTION_MAP_NV | \ - TEXGEN_NORMAL_MAP_NV | \ - TEXGEN_EYE_LINEAR) -/*@}*/ - - - -/** Tex-gen enabled for texture unit? */ -#define ENABLE_TEXGEN(unit) (1 << (unit)) - -/** Non-identity texture matrix for texture unit? */ -#define ENABLE_TEXMAT(unit) (1 << (unit)) - - -/** - * Texel fetch function prototype. We use texel fetch functions to - * extract RGBA, color indexes and depth components out of 1D, 2D and 3D - * texture images. These functions help to isolate us from the gritty - * details of all the various texture image encodings. - * - * \param texImage texture image. - * \param col texel column. - * \param row texel row. - * \param img texel image level/layer. - * \param texelOut output texel (up to 4 GLchans) - */ -typedef void (*FetchTexelFuncC)( const struct gl_texture_image *texImage, - GLint col, GLint row, GLint img, - GLchan *texelOut ); - -/** - * As above, but returns floats. - * Used for depth component images and for upcoming signed/float - * texture images. - */ -typedef void (*FetchTexelFuncF)( const struct gl_texture_image *texImage, - GLint col, GLint row, GLint img, - GLfloat *texelOut ); - - -typedef void (*StoreTexelFunc)(struct gl_texture_image *texImage, - GLint col, GLint row, GLint img, - const void *texel); - - -/** - * Texture image state. Describes the dimensions of a texture image, - * the texel format and pointers to Texel Fetch functions. - */ -struct gl_texture_image -{ - GLint InternalFormat; /**< Internal format as given by the user */ - GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_ALPHA, - * GL_LUMINANCE, GL_LUMINANCE_ALPHA, - * GL_INTENSITY, GL_COLOR_INDEX, - * GL_DEPTH_COMPONENT or GL_DEPTH_STENCIL_EXT - * only. Used for choosing TexEnv arithmetic. - */ - gl_format TexFormat; /**< The actual texture memory format */ - - GLuint Border; /**< 0 or 1 */ - GLuint Width; /**< = 2^WidthLog2 + 2*Border */ - GLuint Height; /**< = 2^HeightLog2 + 2*Border */ - GLuint Depth; /**< = 2^DepthLog2 + 2*Border */ - GLuint Width2; /**< = Width - 2*Border */ - GLuint Height2; /**< = Height - 2*Border */ - GLuint Depth2; /**< = Depth - 2*Border */ - GLuint WidthLog2; /**< = log2(Width2) */ - GLuint HeightLog2; /**< = log2(Height2) */ - GLuint DepthLog2; /**< = log2(Depth2) */ - GLuint MaxLog2; /**< = MAX(WidthLog2, HeightLog2) */ - GLfloat WidthScale; /**< used for mipmap LOD computation */ - GLfloat HeightScale; /**< used for mipmap LOD computation */ - GLfloat DepthScale; /**< used for mipmap LOD computation */ - GLboolean IsClientData; /**< Data owned by client? */ - GLboolean _IsPowerOfTwo; /**< Are all dimensions powers of two? */ - - struct gl_texture_object *TexObject; /**< Pointer back to parent object */ - - FetchTexelFuncC FetchTexelc; /**< GLchan texel fetch function pointer */ - FetchTexelFuncF FetchTexelf; /**< Float texel fetch function pointer */ - - GLuint RowStride; /**< Padded width in units of texels */ - GLuint *ImageOffsets; /**< if 3D texture: array [Depth] of offsets to - each 2D slice in 'Data', in texels */ - GLvoid *Data; /**< Image data, accessed via FetchTexel() */ - - /** - * \name For device driver: - */ - /*@{*/ - void *DriverData; /**< Arbitrary device driver data */ - /*@}*/ -}; - - -/** - * Indexes for cube map faces. - */ -typedef enum -{ - FACE_POS_X = 0, - FACE_NEG_X = 1, - FACE_POS_Y = 2, - FACE_NEG_Y = 3, - FACE_POS_Z = 4, - FACE_NEG_Z = 5, - MAX_FACES = 6 -} gl_face_index; - - -/** - * Texture object state. Contains the array of mipmap images, border color, - * wrap modes, filter modes, shadow/texcompare state, and the per-texture - * color palette. - */ -struct gl_texture_object -{ - _glthread_Mutex Mutex; /**< for thread safety */ - GLint RefCount; /**< reference count */ - GLuint Name; /**< the user-visible texture object ID */ - GLenum Target; /**< GL_TEXTURE_1D, GL_TEXTURE_2D, etc. */ - GLfloat Priority; /**< in [0,1] */ - union { - GLfloat f[4]; - GLuint ui[4]; - GLint i[4]; - } BorderColor; /**< Interpreted according to texture format */ - GLenum WrapS; /**< S-axis texture image wrap mode */ - GLenum WrapT; /**< T-axis texture image wrap mode */ - GLenum WrapR; /**< R-axis texture image wrap mode */ - GLenum MinFilter; /**< minification filter */ - GLenum MagFilter; /**< magnification filter */ - GLfloat MinLod; /**< min lambda, OpenGL 1.2 */ - GLfloat MaxLod; /**< max lambda, OpenGL 1.2 */ - GLfloat LodBias; /**< OpenGL 1.4 */ - GLint BaseLevel; /**< min mipmap level, OpenGL 1.2 */ - GLint MaxLevel; /**< max mipmap level, OpenGL 1.2 */ - GLfloat MaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ - GLenum CompareMode; /**< GL_ARB_shadow */ - GLenum CompareFunc; /**< GL_ARB_shadow */ - GLfloat CompareFailValue; /**< GL_ARB_shadow_ambient */ - GLenum DepthMode; /**< GL_ARB_depth_texture */ - GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */ - GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - b in spec) */ - GLint CropRect[4]; /**< GL_OES_draw_texture */ - GLenum Swizzle[4]; /**< GL_EXT_texture_swizzle */ - GLuint _Swizzle; /**< same as Swizzle, but SWIZZLE_* format */ - GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */ - GLboolean _Complete; /**< Is texture object complete? */ - GLboolean _RenderToTexture; /**< Any rendering to this texture? */ - GLboolean Purgeable; /**< Is the buffer purgeable under memory pressure? */ - GLenum sRGBDecode; /**< GL_DECODE_EXT or GL_SKIP_DECODE_EXT */ - - /** Actual texture images, indexed by [cube face] and [mipmap level] */ - struct gl_texture_image *Image[MAX_FACES][MAX_TEXTURE_LEVELS]; - - /** GL_EXT_paletted_texture */ - struct gl_color_table Palette; - - /** - * \name For device driver. - * Note: instead of attaching driver data to this pointer, it's preferable - * to instead use this struct as a base class for your own texture object - * class. Driver->NewTextureObject() can be used to implement the - * allocation. - */ - void *DriverData; /**< Arbitrary device driver data */ -}; - - -/** Up to four combiner sources are possible with GL_NV_texture_env_combine4 */ -#define MAX_COMBINER_TERMS 4 - - -/** - * Texture combine environment state. - */ -struct gl_tex_env_combine_state -{ - GLenum ModeRGB; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */ - GLenum ModeA; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */ - /** Source terms: GL_PRIMARY_COLOR, GL_TEXTURE, etc */ - GLenum SourceRGB[MAX_COMBINER_TERMS]; - GLenum SourceA[MAX_COMBINER_TERMS]; - /** Source operands: GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, etc */ - GLenum OperandRGB[MAX_COMBINER_TERMS]; - GLenum OperandA[MAX_COMBINER_TERMS]; - GLuint ScaleShiftRGB; /**< 0, 1 or 2 */ - GLuint ScaleShiftA; /**< 0, 1 or 2 */ - GLuint _NumArgsRGB; /**< Number of inputs used for the RGB combiner */ - GLuint _NumArgsA; /**< Number of inputs used for the A combiner */ -}; - - -/** - * Texture coord generation state. - */ -struct gl_texgen -{ - GLenum Mode; /**< GL_EYE_LINEAR, GL_SPHERE_MAP, etc */ - GLbitfield _ModeBit; /**< TEXGEN_x bit corresponding to Mode */ - GLfloat ObjectPlane[4]; - GLfloat EyePlane[4]; -}; - - -/** - * Texture unit state. Contains enable flags, texture environment/function/ - * combiners, texgen state, pointers to current texture objects and - * post-filter color tables. - */ -struct gl_texture_unit -{ - GLbitfield Enabled; /**< bitmask of TEXTURE_*_BIT flags */ - GLbitfield _ReallyEnabled; /**< 0 or exactly one of TEXTURE_*_BIT flags */ - - GLenum EnvMode; /**< GL_MODULATE, GL_DECAL, GL_BLEND, etc. */ - GLfloat EnvColor[4]; - - struct gl_texgen GenS; - struct gl_texgen GenT; - struct gl_texgen GenR; - struct gl_texgen GenQ; - GLbitfield TexGenEnabled; /**< Bitwise-OR of [STRQ]_BIT values */ - GLbitfield _GenFlags; /**< Bitwise-OR of Gen[STRQ]._ModeBit */ - - GLfloat LodBias; /**< for biasing mipmap levels */ - GLenum BumpTarget; - GLfloat RotMatrix[4]; /* 2x2 matrix */ - - /** - * \name GL_EXT_texture_env_combine - */ - struct gl_tex_env_combine_state Combine; - - /** - * Derived state based on \c EnvMode and the \c BaseFormat of the - * currently enabled texture. - */ - struct gl_tex_env_combine_state _EnvMode; - - /** - * Currently enabled combiner state. This will point to either - * \c Combine or \c _EnvMode. - */ - struct gl_tex_env_combine_state *_CurrentCombine; - - /** Current texture object pointers */ - struct gl_texture_object *CurrentTex[NUM_TEXTURE_TARGETS]; - - /** Points to highest priority, complete and enabled texture object */ - struct gl_texture_object *_Current; - - /** GL_SGI_texture_color_table */ - /*@{*/ - struct gl_color_table ColorTable; - struct gl_color_table ProxyColorTable; - GLboolean ColorTableEnabled; - /*@}*/ -}; - - -/** - * Texture attribute group (GL_TEXTURE_BIT). - */ -struct gl_texture_attrib -{ - GLuint CurrentUnit; /**< GL_ACTIVE_TEXTURE */ - struct gl_texture_unit Unit[MAX_COMBINED_TEXTURE_IMAGE_UNITS]; - - struct gl_texture_object *ProxyTex[NUM_TEXTURE_TARGETS]; - - /** GL_ARB_seamless_cubemap */ - GLboolean CubeMapSeamless; - - /** GL_EXT_shared_texture_palette */ - GLboolean SharedPalette; - struct gl_color_table Palette; - - /** Texture units/samplers used by vertex or fragment texturing */ - GLbitfield _EnabledUnits; - - /** Texture coord units/sets used for fragment texturing */ - GLbitfield _EnabledCoordUnits; - - /** Texture coord units that have texgen enabled */ - GLbitfield _TexGenEnabled; - - /** Texture coord units that have non-identity matrices */ - GLbitfield _TexMatEnabled; - - /** Bitwise-OR of all Texture.Unit[i]._GenFlags */ - GLbitfield _GenFlags; -}; - - -/** - * Transformation attribute group (GL_TRANSFORM_BIT). - */ -struct gl_transform_attrib -{ - GLenum MatrixMode; /**< Matrix mode */ - GLfloat EyeUserPlane[MAX_CLIP_PLANES][4]; /**< User clip planes */ - GLfloat _ClipUserPlane[MAX_CLIP_PLANES][4]; /**< derived */ - GLbitfield ClipPlanesEnabled; /**< on/off bitmask */ - GLboolean Normalize; /**< Normalize all normals? */ - GLboolean RescaleNormals; /**< GL_EXT_rescale_normal */ - GLboolean RasterPositionUnclipped; /**< GL_IBM_rasterpos_clip */ - GLboolean DepthClamp; /**< GL_ARB_depth_clamp */ - - GLfloat CullEyePos[4]; - GLfloat CullObjPos[4]; -}; - - -/** - * Viewport attribute group (GL_VIEWPORT_BIT). - */ -struct gl_viewport_attrib -{ - GLint X, Y; /**< position */ - GLsizei Width, Height; /**< size */ - GLfloat Near, Far; /**< Depth buffer range */ - GLmatrix _WindowMap; /**< Mapping transformation as a matrix. */ -}; - - -/** - * GL_ARB_vertex/pixel_buffer_object buffer object - */ -struct gl_buffer_object -{ - _glthread_Mutex Mutex; - GLint RefCount; - GLuint Name; - GLenum Usage; /**< GL_STREAM_DRAW_ARB, GL_STREAM_READ_ARB, etc. */ - GLsizeiptrARB Size; /**< Size of buffer storage in bytes */ - GLubyte *Data; /**< Location of storage either in RAM or VRAM. */ - /** Fields describing a mapped buffer */ - /*@{*/ - GLbitfield AccessFlags; /**< Mask of GL_MAP_x_BIT flags */ - GLvoid *Pointer; /**< User-space address of mapping */ - GLintptr Offset; /**< Mapped offset */ - GLsizeiptr Length; /**< Mapped length */ - /*@}*/ - GLboolean Written; /**< Ever written to? (for debugging) */ - GLboolean Purgeable; /**< Is the buffer purgeable under memory pressure? */ -}; - - -/** - * Client pixel packing/unpacking attributes - */ -struct gl_pixelstore_attrib -{ - GLint Alignment; - GLint RowLength; - GLint SkipPixels; - GLint SkipRows; - GLint ImageHeight; - GLint SkipImages; - GLboolean SwapBytes; - GLboolean LsbFirst; - GLboolean ClientStorage; /**< GL_APPLE_client_storage */ - GLboolean Invert; /**< GL_MESA_pack_invert */ - struct gl_buffer_object *BufferObj; /**< GL_ARB_pixel_buffer_object */ -}; - - -/** - * Client vertex array attributes - */ -struct gl_client_array -{ - GLint Size; /**< components per element (1,2,3,4) */ - GLenum Type; /**< datatype: GL_FLOAT, GL_INT, etc */ - GLenum Format; /**< default: GL_RGBA, but may be GL_BGRA */ - GLsizei Stride; /**< user-specified stride */ - GLsizei StrideB; /**< actual stride in bytes */ - const GLubyte *Ptr; /**< Points to array data */ - GLboolean Enabled; /**< Enabled flag is a boolean */ - GLboolean Normalized; /**< GL_ARB_vertex_program */ - GLboolean Integer; /**< Integer-valued? */ - GLuint InstanceDivisor; /**< GL_ARB_instanced_arrays */ - GLuint _ElementSize; /**< size of each element in bytes */ - - struct gl_buffer_object *BufferObj;/**< GL_ARB_vertex_buffer_object */ - GLuint _MaxElement; /**< max element index into array buffer + 1 */ -}; - - -/** - * Collection of vertex arrays. Defined by the GL_APPLE_vertex_array_object - * extension, but a nice encapsulation in any case. - */ -struct gl_array_object -{ - /** Name of the array object as received from glGenVertexArrayAPPLE. */ - GLuint Name; - - GLint RefCount; - _glthread_Mutex Mutex; - GLboolean VBOonly; /**< require all arrays to live in VBOs? */ - - /** Conventional vertex arrays */ - /*@{*/ - struct gl_client_array Vertex; - struct gl_client_array Weight; - struct gl_client_array Normal; - struct gl_client_array Color; - struct gl_client_array SecondaryColor; - struct gl_client_array FogCoord; - struct gl_client_array Index; - struct gl_client_array EdgeFlag; - struct gl_client_array TexCoord[MAX_TEXTURE_COORD_UNITS]; - struct gl_client_array PointSize; - /*@}*/ - - /** - * Generic arrays for vertex programs/shaders. - * For NV vertex programs, these attributes alias and take priority - * over the conventional attribs above. For ARB vertex programs and - * GLSL vertex shaders, these attributes are separate. - */ - struct gl_client_array VertexAttrib[MAX_VERTEX_GENERIC_ATTRIBS]; - - /** Mask of _NEW_ARRAY_* values indicating which arrays are enabled */ - GLbitfield _Enabled; - - /** - * Min of all enabled arrays' _MaxElement. When arrays reside inside VBOs - * we can determine the max legal (in bounds) glDrawElements array index. - */ - GLuint _MaxElement; -}; - - -/** - * Vertex array state - */ -struct gl_array_attrib -{ - /** Currently bound array object. See _mesa_BindVertexArrayAPPLE() */ - struct gl_array_object *ArrayObj; - - /** The default vertex array object */ - struct gl_array_object *DefaultArrayObj; - - /** Array objects (GL_ARB/APPLE_vertex_array_object) */ - struct _mesa_HashTable *Objects; - - GLint ActiveTexture; /**< Client Active Texture */ - GLuint LockFirst; /**< GL_EXT_compiled_vertex_array */ - GLuint LockCount; /**< GL_EXT_compiled_vertex_array */ - - /** GL 3.1 (slightly different from GL_NV_primitive_restart) */ - GLboolean PrimitiveRestart; - GLuint RestartIndex; - - GLbitfield NewState; /**< mask of _NEW_ARRAY_* values */ - GLboolean RebindArrays; /**< whether the VBO module should rebind arrays */ - - /* GL_ARB_vertex_buffer_object */ - struct gl_buffer_object *ArrayBufferObj; - struct gl_buffer_object *ElementArrayBufferObj; -}; - - -/** - * Feedback buffer state - */ -struct gl_feedback -{ - GLenum Type; - GLbitfield _Mask; /**< FB_* bits */ - GLfloat *Buffer; - GLuint BufferSize; - GLuint Count; -}; - - -/** - * Selection buffer state - */ -struct gl_selection -{ - GLuint *Buffer; /**< selection buffer */ - GLuint BufferSize; /**< size of the selection buffer */ - GLuint BufferCount; /**< number of values in the selection buffer */ - GLuint Hits; /**< number of records in the selection buffer */ - GLuint NameStackDepth; /**< name stack depth */ - GLuint NameStack[MAX_NAME_STACK_DEPTH]; /**< name stack */ - GLboolean HitFlag; /**< hit flag */ - GLfloat HitMinZ; /**< minimum hit depth */ - GLfloat HitMaxZ; /**< maximum hit depth */ -}; - - -/** - * 1-D Evaluator control points - */ -struct gl_1d_map -{ - GLuint Order; /**< Number of control points */ - GLfloat u1, u2, du; /**< u1, u2, 1.0/(u2-u1) */ - GLfloat *Points; /**< Points to contiguous control points */ -}; - - -/** - * 2-D Evaluator control points - */ -struct gl_2d_map -{ - GLuint Uorder; /**< Number of control points in U dimension */ - GLuint Vorder; /**< Number of control points in V dimension */ - GLfloat u1, u2, du; - GLfloat v1, v2, dv; - GLfloat *Points; /**< Points to contiguous control points */ -}; - - -/** - * All evaluator control point state - */ -struct gl_evaluators -{ - /** - * \name 1-D maps - */ - /*@{*/ - struct gl_1d_map Map1Vertex3; - struct gl_1d_map Map1Vertex4; - struct gl_1d_map Map1Index; - struct gl_1d_map Map1Color4; - struct gl_1d_map Map1Normal; - struct gl_1d_map Map1Texture1; - struct gl_1d_map Map1Texture2; - struct gl_1d_map Map1Texture3; - struct gl_1d_map Map1Texture4; - struct gl_1d_map Map1Attrib[16]; /**< GL_NV_vertex_program */ - /*@}*/ - - /** - * \name 2-D maps - */ - /*@{*/ - struct gl_2d_map Map2Vertex3; - struct gl_2d_map Map2Vertex4; - struct gl_2d_map Map2Index; - struct gl_2d_map Map2Color4; - struct gl_2d_map Map2Normal; - struct gl_2d_map Map2Texture1; - struct gl_2d_map Map2Texture2; - struct gl_2d_map Map2Texture3; - struct gl_2d_map Map2Texture4; - struct gl_2d_map Map2Attrib[16]; /**< GL_NV_vertex_program */ - /*@}*/ -}; - - -/** - * Names of the various vertex/fragment program register files, etc. - * - * NOTE: first four tokens must fit into 2 bits (see t_vb_arbprogram.c) - * All values should fit in a 4-bit field. - * - * NOTE: PROGRAM_ENV_PARAM, PROGRAM_STATE_VAR, PROGRAM_NAMED_PARAM, - * PROGRAM_CONSTANT, and PROGRAM_UNIFORM can all be considered to - * be "uniform" variables since they can only be set outside glBegin/End. - * They're also all stored in the same Parameters array. - */ -typedef enum -{ - PROGRAM_TEMPORARY, /**< machine->Temporary[] */ - PROGRAM_INPUT, /**< machine->Inputs[] */ - PROGRAM_OUTPUT, /**< machine->Outputs[] */ - PROGRAM_VARYING, /**< machine->Inputs[]/Outputs[] */ - PROGRAM_LOCAL_PARAM, /**< gl_program->LocalParams[] */ - PROGRAM_ENV_PARAM, /**< gl_program->Parameters[] */ - PROGRAM_STATE_VAR, /**< gl_program->Parameters[] */ - PROGRAM_NAMED_PARAM, /**< gl_program->Parameters[] */ - PROGRAM_CONSTANT, /**< gl_program->Parameters[] */ - PROGRAM_UNIFORM, /**< gl_program->Parameters[] */ - PROGRAM_WRITE_ONLY, /**< A dummy, write-only register */ - PROGRAM_ADDRESS, /**< machine->AddressReg */ - PROGRAM_SAMPLER, /**< for shader samplers, compile-time only */ - PROGRAM_SYSTEM_VALUE,/**< InstanceId, PrimitiveID, etc. */ - PROGRAM_UNDEFINED, /**< Invalid/TBD value */ - PROGRAM_FILE_MAX -} gl_register_file; - - -/** - * If the register file is PROGRAM_SYSTEM_VALUE, the register index will be - * one of these values. - */ -typedef enum -{ - SYSTEM_VALUE_FRONT_FACE, /**< Fragment shader only (not done yet) */ - SYSTEM_VALUE_INSTANCE_ID, /**< Vertex shader only */ - SYSTEM_VALUE_MAX /**< Number of values */ -} gl_system_value; - - -/** Vertex and fragment instructions */ -struct prog_instruction; -struct gl_program_parameter_list; -struct gl_uniform_list; - - -/** - * Base class for any kind of program object - */ -struct gl_program -{ - GLuint Id; - GLubyte *String; /**< Null-terminated program text */ - GLint RefCount; - GLenum Target; /**< GL_VERTEX/FRAGMENT_PROGRAM_ARB, GL_FRAGMENT_PROGRAM_NV */ - GLenum Format; /**< String encoding format */ - GLboolean Resident; - - struct prog_instruction *Instructions; - - GLbitfield InputsRead; /**< Bitmask of which input regs are read */ - GLbitfield64 OutputsWritten; /**< Bitmask of which output regs are written */ - GLbitfield SystemValuesRead; /**< Bitmask of SYSTEM_VALUE_x inputs used */ - GLbitfield InputFlags[MAX_PROGRAM_INPUTS]; /**< PROG_PARAM_BIT_x flags */ - GLbitfield OutputFlags[MAX_PROGRAM_OUTPUTS]; /**< PROG_PARAM_BIT_x flags */ - GLbitfield TexturesUsed[MAX_TEXTURE_UNITS]; /**< TEXTURE_x_BIT bitmask */ - GLbitfield SamplersUsed; /**< Bitfield of which samplers are used */ - GLbitfield ShadowSamplers; /**< Texture units used for shadow sampling. */ - - - /** Named parameters, constants, etc. from program text */ - struct gl_program_parameter_list *Parameters; - /** Numbered local parameters */ - GLfloat LocalParams[MAX_PROGRAM_LOCAL_PARAMS][4]; - - /** Vertex/fragment shader varying vars */ - struct gl_program_parameter_list *Varying; - /** Vertex program user-defined attributes */ - struct gl_program_parameter_list *Attributes; - - /** Map from sampler unit to texture unit (set by glUniform1i()) */ - GLubyte SamplerUnits[MAX_SAMPLERS]; - /** Which texture target is being sampled (TEXTURE_1D/2D/3D/etc_INDEX) */ - gl_texture_index SamplerTargets[MAX_SAMPLERS]; - - /** Bitmask of which register files are read/written with indirect - * addressing. Mask of (1 << PROGRAM_x) bits. - */ - GLbitfield IndirectRegisterFiles; - - /** Logical counts */ - /*@{*/ - GLuint NumInstructions; - GLuint NumTemporaries; - GLuint NumParameters; - GLuint NumAttributes; - GLuint NumAddressRegs; - GLuint NumAluInstructions; - GLuint NumTexInstructions; - GLuint NumTexIndirections; - /*@}*/ - /** Native, actual h/w counts */ - /*@{*/ - GLuint NumNativeInstructions; - GLuint NumNativeTemporaries; - GLuint NumNativeParameters; - GLuint NumNativeAttributes; - GLuint NumNativeAddressRegs; - GLuint NumNativeAluInstructions; - GLuint NumNativeTexInstructions; - GLuint NumNativeTexIndirections; - /*@}*/ -}; - - -/** Vertex program object */ -struct gl_vertex_program -{ - struct gl_program Base; /**< base class */ - GLboolean IsNVProgram; /**< is this a GL_NV_vertex_program program? */ - GLboolean IsPositionInvariant; -}; - - -/** Geometry program object */ -struct gl_geometry_program -{ - struct gl_program Base; /**< base class */ - - GLint VerticesOut; - GLenum InputType; /**< GL_POINTS, GL_LINES, GL_LINES_ADJACENCY_ARB, - GL_TRIANGLES, or GL_TRIANGLES_ADJACENCY_ARB */ - GLenum OutputType; /**< GL_POINTS, GL_LINE_STRIP or GL_TRIANGLE_STRIP */ -}; - - -/** Fragment program object */ -struct gl_fragment_program -{ - struct gl_program Base; /**< base class */ - GLenum FogOption; - GLboolean UsesKill; /**< shader uses KIL instruction */ - GLboolean OriginUpperLeft; - GLboolean PixelCenterInteger; - enum gl_frag_depth_layout FragDepthLayout; -}; - - -/** - * State common to vertex and fragment programs. - */ -struct gl_program_state -{ - GLint ErrorPos; /* GL_PROGRAM_ERROR_POSITION_ARB/NV */ - const char *ErrorString; /* GL_PROGRAM_ERROR_STRING_ARB/NV */ -}; - - -/** - * Context state for vertex programs. - */ -struct gl_vertex_program_state -{ - GLboolean Enabled; /**< User-set GL_VERTEX_PROGRAM_ARB/NV flag */ - 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 */ - struct gl_vertex_program *Current; /**< User-bound vertex program */ - - /** Currently enabled and valid vertex program (including internal - * programs, user-defined vertex programs and GLSL vertex shaders). - * This is the program we must use when rendering. - */ - struct gl_vertex_program *_Current; - - GLfloat Parameters[MAX_PROGRAM_ENV_PARAMS][4]; /**< Env params */ - - /* For GL_NV_vertex_program only: */ - GLenum TrackMatrix[MAX_PROGRAM_ENV_PARAMS / 4]; - GLenum TrackMatrixTransform[MAX_PROGRAM_ENV_PARAMS / 4]; - - /** Should fixed-function T&L be implemented with a vertex prog? */ - GLboolean _MaintainTnlProgram; - - /** Program to emulate fixed-function T&L (see above) */ - struct gl_vertex_program *_TnlProgram; - - /** Cache of fixed-function programs */ - struct gl_program_cache *Cache; - - GLboolean _Overriden; -}; - - -/** - * Context state for geometry programs. - */ -struct gl_geometry_program_state -{ - GLboolean Enabled; /**< GL_ARB_GEOMETRY_SHADER4 */ - GLboolean _Enabled; /**< Enabled and valid program? */ - struct gl_geometry_program *Current; /**< user-bound geometry program */ - - /** Currently enabled and valid program (including internal programs - * and compiled shader programs). - */ - struct gl_geometry_program *_Current; - - GLfloat Parameters[MAX_PROGRAM_ENV_PARAMS][4]; /**< Env params */ - - /** Cache of fixed-function programs */ - struct gl_program_cache *Cache; -}; - -/** - * Context state for fragment programs. - */ -struct gl_fragment_program_state -{ - GLboolean Enabled; /**< User-set fragment program enable flag */ - GLboolean _Enabled; /**< Enabled and _valid_ user program? */ - struct gl_fragment_program *Current; /**< User-bound fragment program */ - - /** Currently enabled and valid fragment program (including internal - * programs, user-defined fragment programs and GLSL fragment shaders). - * This is the program we must use when rendering. - */ - struct gl_fragment_program *_Current; - - GLfloat Parameters[MAX_PROGRAM_ENV_PARAMS][4]; /**< Env params */ - - /** Should fixed-function texturing be implemented with a fragment prog? */ - GLboolean _MaintainTexEnvProgram; - - /** Program to emulate fixed-function texture env/combine (see above) */ - struct gl_fragment_program *_TexEnvProgram; - - /** Cache of fixed-function programs */ - struct gl_program_cache *Cache; -}; - - -/** - * ATI_fragment_shader runtime state - */ -#define ATI_FS_INPUT_PRIMARY 0 -#define ATI_FS_INPUT_SECONDARY 1 - -struct atifs_instruction; -struct atifs_setupinst; - -/** - * ATI fragment shader - */ -struct ati_fragment_shader -{ - GLuint Id; - GLint RefCount; - struct atifs_instruction *Instructions[2]; - struct atifs_setupinst *SetupInst[2]; - GLfloat Constants[8][4]; - GLbitfield LocalConstDef; /**< Indicates which constants have been set */ - GLubyte numArithInstr[2]; - GLubyte regsAssigned[2]; - GLubyte NumPasses; /**< 1 or 2 */ - GLubyte cur_pass; - GLubyte last_optype; - GLboolean interpinp1; - GLboolean isValid; - GLuint swizzlerq; -}; - -/** - * Context state for GL_ATI_fragment_shader - */ -struct gl_ati_fragment_shader_state -{ - GLboolean Enabled; - GLboolean _Enabled; /**< enabled and valid shader? */ - GLboolean Compiling; - GLfloat GlobalConstants[8][4]; - struct ati_fragment_shader *Current; -}; - - -/** - * Occlusion/timer query object. - */ -struct gl_query_object -{ - GLenum Target; /**< The query target, when active */ - GLuint Id; /**< hash table ID/name */ - GLuint64EXT Result; /**< the counter */ - GLboolean Active; /**< inside Begin/EndQuery */ - GLboolean Ready; /**< result is ready? */ -}; - - -/** - * Context state for query objects. - */ -struct gl_query_state -{ - struct _mesa_HashTable *QueryObjects; - struct gl_query_object *CurrentOcclusionObject; /* GL_ARB_occlusion_query */ - struct gl_query_object *CurrentTimerObject; /* GL_EXT_timer_query */ - - /** GL_NV_conditional_render */ - struct gl_query_object *CondRenderQuery; - - /** GL_EXT_transform_feedback */ - struct gl_query_object *PrimitivesGenerated; - struct gl_query_object *PrimitivesWritten; - - /** GL_ARB_timer_query */ - struct gl_query_object *TimeElapsed; - - GLenum CondRenderMode; -}; - - -/** Sync object state */ -struct gl_sync_object { - struct simple_node link; - GLenum Type; /**< GL_SYNC_FENCE */ - GLuint Name; /**< Fence name */ - GLint RefCount; /**< Reference count */ - GLboolean DeletePending; /**< Object was deleted while there were still - * live references (e.g., sync not yet finished) - */ - GLenum SyncCondition; - GLbitfield Flags; /**< Flags passed to glFenceSync */ - GLuint StatusFlag:1; /**< Has the sync object been signaled? */ -}; - - -/** Set by #pragma directives */ -struct gl_sl_pragmas -{ - GLboolean IgnoreOptimize; /**< ignore #pragma optimize(on/off) ? */ - GLboolean IgnoreDebug; /**< ignore #pragma debug(on/off) ? */ - GLboolean Optimize; /**< defaults on */ - GLboolean Debug; /**< defaults off */ -}; - - -/** - * A GLSL vertex or fragment shader object. - */ -struct gl_shader -{ - GLenum Type; /**< GL_FRAGMENT_SHADER || GL_VERTEX_SHADER || GL_GEOMETRY_SHADER_ARB (first field!) */ - GLuint Name; /**< AKA the handle */ - GLint RefCount; /**< Reference count */ - GLboolean DeletePending; - GLboolean CompileStatus; - const GLchar *Source; /**< Source code string */ - GLuint SourceChecksum; /**< for debug/logging purposes */ - struct gl_program *Program; /**< Post-compile assembly code */ - GLchar *InfoLog; - struct gl_sl_pragmas Pragmas; - - unsigned Version; /**< GLSL version used for linking */ - - struct exec_list *ir; - struct glsl_symbol_table *symbols; - - /** Shaders containing built-in functions that are used for linking. */ - struct gl_shader *builtins_to_link[16]; - unsigned num_builtins_to_link; -}; - - -/** - * A GLSL program object. - * Basically a linked collection of vertex and fragment shaders. - */ -struct gl_shader_program -{ - GLenum Type; /**< Always GL_SHADER_PROGRAM (internal token) */ - GLuint Name; /**< aka handle or ID */ - GLint RefCount; /**< Reference count */ - GLboolean DeletePending; - - GLuint NumShaders; /**< number of attached shaders */ - struct gl_shader **Shaders; /**< List of attached the shaders */ - - /** User-defined attribute bindings (glBindAttribLocation) */ - struct gl_program_parameter_list *Attributes; - - /** Transform feedback varyings */ - struct { - GLenum BufferMode; - GLuint NumVarying; - GLchar **VaryingNames; /**< Array [NumVarying] of char * */ - } TransformFeedback; - - /** Geometry shader state - copied into gl_geometry_program at link time */ - struct { - GLint VerticesOut; - GLenum InputType; /**< GL_POINTS, GL_LINES, GL_LINES_ADJACENCY_ARB, - GL_TRIANGLES, or GL_TRIANGLES_ADJACENCY_ARB */ - GLenum OutputType; /**< GL_POINTS, GL_LINE_STRIP or GL_TRIANGLE_STRIP */ - } Geom; - - /* post-link info: */ - struct gl_vertex_program *VertexProgram; /**< Linked vertex program */ - struct gl_fragment_program *FragmentProgram; /**< Linked fragment prog */ - struct gl_geometry_program *GeometryProgram; /**< Linked geometry prog */ - struct gl_uniform_list *Uniforms; - struct gl_program_parameter_list *Varying; - GLboolean LinkStatus; /**< GL_LINK_STATUS */ - GLboolean Validated; - GLboolean _Used; /**< Ever used for drawing? */ - GLchar *InfoLog; - - unsigned Version; /**< GLSL version used for linking */ - - /** - * Per-stage shaders resulting from the first stage of linking. - * - * Set of linked shaders for this program. The array is accessed using the - * \c MESA_SHADER_* defines. Entries for non-existent stages will be - * \c NULL. - */ - struct gl_shader *_LinkedShaders[MESA_SHADER_TYPES]; -}; - - -#define GLSL_DUMP 0x1 /**< Dump shaders to stdout */ -#define GLSL_LOG 0x2 /**< Write shaders to files */ -#define GLSL_OPT 0x4 /**< Force optimizations (override pragmas) */ -#define GLSL_NO_OPT 0x8 /**< Force no optimizations (override pragmas) */ -#define GLSL_UNIFORMS 0x10 /**< Print glUniform calls */ -#define GLSL_NOP_VERT 0x20 /**< Force no-op vertex shaders */ -#define GLSL_NOP_FRAG 0x40 /**< Force no-op fragment shaders */ -#define GLSL_USE_PROG 0x80 /**< Log glUseProgram calls */ - - -/** - * Context state for GLSL vertex/fragment shaders. - */ -struct gl_shader_state -{ - /** - * Programs used for rendering - * - * There is a separate program set for each shader stage. If - * GL_EXT_separate_shader_objects is not supported, each of these must point - * to \c NULL or to the same program. - */ - struct gl_shader_program *CurrentVertexProgram; - struct gl_shader_program *CurrentGeometryProgram; - struct gl_shader_program *CurrentFragmentProgram; - - /** - * Program used by glUniform calls. - * - * Explicitly set by \c glUseProgram and \c glActiveProgramEXT. - */ - struct gl_shader_program *ActiveProgram; - - void *MemPool; - - GLbitfield Flags; /**< Mask of GLSL_x flags */ -}; - -/** - * Compiler options for a single GLSL shaders type - */ -struct gl_shader_compiler_options -{ - /** Driver-selectable options: */ - GLboolean EmitCondCodes; /**< Use condition codes? */ - GLboolean EmitNVTempInitialization; /**< 0-fill NV temp registers */ - /** - * Attempts to flatten all ir_if (OPCODE_IF) for GPUs that can't - * support control flow. - */ - GLboolean EmitNoIfs; - GLboolean EmitNoLoops; - GLboolean EmitNoFunctions; - GLboolean EmitNoCont; /**< Emit CONT opcode? */ - GLboolean EmitNoMainReturn; /**< Emit CONT/RET opcodes? */ - GLboolean EmitNoNoise; /**< Emit NOISE opcodes? */ - GLboolean EmitNoPow; /**< Emit POW opcodes? */ - - /** - * \name Forms of indirect addressing the driver cannot do. - */ - /*@{*/ - GLboolean EmitNoIndirectInput; /**< No indirect addressing of inputs */ - GLboolean EmitNoIndirectOutput; /**< No indirect addressing of outputs */ - GLboolean EmitNoIndirectTemp; /**< No indirect addressing of temps */ - GLboolean EmitNoIndirectUniform; /**< No indirect addressing of constants */ - /*@}*/ - - GLuint MaxUnrollIterations; - - struct gl_sl_pragmas DefaultPragmas; /**< Default #pragma settings */ -}; - -/** - * Transform feedback object state - */ -struct gl_transform_feedback_object -{ - GLuint Name; /**< AKA the object ID */ - GLint RefCount; - GLboolean Active; /**< Is transform feedback enabled? */ - GLboolean Paused; /**< Is transform feedback paused? */ - - /** The feedback buffers */ - GLuint BufferNames[MAX_FEEDBACK_ATTRIBS]; - struct gl_buffer_object *Buffers[MAX_FEEDBACK_ATTRIBS]; - - /** Start of feedback data in dest buffer */ - GLintptr Offset[MAX_FEEDBACK_ATTRIBS]; - /** Max data to put into dest buffer (in bytes) */ - GLsizeiptr Size[MAX_FEEDBACK_ATTRIBS]; -}; - - -/** - * Context state for transform feedback. - */ -struct gl_transform_feedback -{ - GLenum Mode; /**< GL_POINTS, GL_LINES or GL_TRIANGLES */ - - GLboolean RasterDiscard; /**< GL_RASTERIZER_DISCARD */ - - /** The general binding point (GL_TRANSFORM_FEEDBACK_BUFFER) */ - struct gl_buffer_object *CurrentBuffer; - - /** The table of all transform feedback objects */ - struct _mesa_HashTable *Objects; - - /** The current xform-fb object (GL_TRANSFORM_FEEDBACK_BINDING) */ - struct gl_transform_feedback_object *CurrentObject; - - /** The default xform-fb object (Name==0) */ - struct gl_transform_feedback_object *DefaultObject; -}; - - - -/** - * State which can be shared by multiple contexts: - */ -struct gl_shared_state -{ - _glthread_Mutex Mutex; /**< for thread safety */ - GLint RefCount; /**< Reference count */ - struct _mesa_HashTable *DisplayList; /**< Display lists hash table */ - struct _mesa_HashTable *TexObjects; /**< Texture objects hash table */ - - /** Default texture objects (shared by all texture units) */ - struct gl_texture_object *DefaultTex[NUM_TEXTURE_TARGETS]; - - /** Fallback texture used when a bound texture is incomplete */ - struct gl_texture_object *FallbackTex; - - /** - * \name Thread safety and statechange notification for texture - * objects. - * - * \todo Improve the granularity of locking. - */ - /*@{*/ - _glthread_Mutex TexMutex; /**< texobj thread safety */ - GLuint TextureStateStamp; /**< state notification for shared tex */ - /*@}*/ - - /** Default buffer object for vertex arrays that aren't in VBOs */ - struct gl_buffer_object *NullBufferObj; - - /** - * \name Vertex/geometry/fragment programs - */ - /*@{*/ - struct _mesa_HashTable *Programs; /**< All vertex/fragment programs */ - struct gl_vertex_program *DefaultVertexProgram; - struct gl_fragment_program *DefaultFragmentProgram; - struct gl_geometry_program *DefaultGeometryProgram; - /*@}*/ - - /* GL_ATI_fragment_shader */ - struct _mesa_HashTable *ATIShaders; - struct ati_fragment_shader *DefaultFragmentShader; - - struct _mesa_HashTable *BufferObjects; - - /** Table of both gl_shader and gl_shader_program objects */ - struct _mesa_HashTable *ShaderObjects; - - /* GL_EXT_framebuffer_object */ - struct _mesa_HashTable *RenderBuffers; - struct _mesa_HashTable *FrameBuffers; - - /* GL_ARB_sync */ - struct simple_node SyncObjects; - - void *DriverData; /**< Device driver shared state */ -}; - - - - -/** - * A renderbuffer stores colors or depth values or stencil values. - * A framebuffer object will have a collection of these. - * Data are read/written to the buffer with a handful of Get/Put functions. - * - * Instances of this object are allocated with the Driver's NewRenderbuffer - * hook. Drivers will likely wrap this class inside a driver-specific - * class to simulate inheritance. - */ -struct gl_renderbuffer -{ -#define RB_MAGIC 0xaabbccdd - int Magic; /** XXX TEMPORARY DEBUG INFO */ - _glthread_Mutex Mutex; /**< for thread safety */ - GLuint ClassID; /**< Useful for drivers */ - GLuint Name; - GLint RefCount; - GLuint Width, Height; - GLboolean Purgeable; /**< Is the buffer purgeable under memory pressure? */ - - GLenum InternalFormat; /**< The user-specified format */ - GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or - GL_STENCIL_INDEX. */ - gl_format Format; /**< The actual renderbuffer memory format */ - - GLubyte NumSamples; - - GLenum DataType; /**< Type of values passed to the Get/Put functions */ - GLvoid *Data; /**< This may not be used by some kinds of RBs */ - - /* Used to wrap one renderbuffer around another: */ - struct gl_renderbuffer *Wrapped; - - /* Delete this renderbuffer */ - void (*Delete)(struct gl_renderbuffer *rb); - - /* Allocate new storage for this renderbuffer */ - GLboolean (*AllocStorage)(struct gl_context *ctx, struct gl_renderbuffer *rb, - GLenum internalFormat, - GLuint width, GLuint height); - - /* Lock/Unlock are called before/after calling the Get/Put functions. - * Not sure this is the right place for these yet. - void (*Lock)(struct gl_context *ctx, struct gl_renderbuffer *rb); - void (*Unlock)(struct gl_context *ctx, struct gl_renderbuffer *rb); - */ - - /* Return a pointer to the element/pixel at (x,y). - * Should return NULL if the buffer memory can't be directly addressed. - */ - void *(*GetPointer)(struct gl_context *ctx, struct gl_renderbuffer *rb, - GLint x, GLint y); - - /* Get/Read a row of values. - * The values will be of format _BaseFormat and type DataType. - */ - void (*GetRow)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, void *values); - - /* Get/Read values at arbitrary locations. - * The values will be of format _BaseFormat and type DataType. - */ - void (*GetValues)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], void *values); - - /* Put/Write a row of values. - * The values will be of format _BaseFormat and type DataType. - */ - void (*PutRow)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask); - - /* Put/Write a row of RGB values. This is a special-case routine that's - * only used for RGBA renderbuffers when the source data is GL_RGB. That's - * a common case for glDrawPixels and some triangle routines. - * The values will be of format GL_RGB and type DataType. - */ - void (*PutRowRGB)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *values, const GLubyte *mask); - - - /* Put/Write a row of identical values. - * The values will be of format _BaseFormat and type DataType. - */ - void (*PutMonoRow)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask); - - /* Put/Write values at arbitrary locations. - * The values will be of format _BaseFormat and type DataType. - */ - void (*PutValues)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], const void *values, - const GLubyte *mask); - /* Put/Write identical values at arbitrary locations. - * The values will be of format _BaseFormat and type DataType. - */ - void (*PutMonoValues)(struct gl_context *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask); -}; - - -/** - * A renderbuffer attachment points to either a texture object (and specifies - * a mipmap level, cube face or 3D texture slice) or points to a renderbuffer. - */ -struct gl_renderbuffer_attachment -{ - GLenum Type; /**< \c GL_NONE or \c GL_TEXTURE or \c GL_RENDERBUFFER_EXT */ - GLboolean Complete; - - /** - * If \c Type is \c GL_RENDERBUFFER_EXT, this stores a pointer to the - * application supplied renderbuffer object. - */ - struct gl_renderbuffer *Renderbuffer; - - /** - * If \c Type is \c GL_TEXTURE, this stores a pointer to the application - * supplied texture object. - */ - struct gl_texture_object *Texture; - GLuint TextureLevel; /**< Attached mipmap level. */ - GLuint CubeMapFace; /**< 0 .. 5, for cube map textures. */ - GLuint Zoffset; /**< Slice for 3D textures, or layer for both 1D - * and 2D array textures */ -}; - - -/** - * A framebuffer is a collection of renderbuffers (color, depth, stencil, etc). - * In C++ terms, think of this as a base class from which device drivers - * will make derived classes. - */ -struct gl_framebuffer -{ - _glthread_Mutex Mutex; /**< for thread safety */ - /** - * If zero, this is a window system framebuffer. If non-zero, this - * is a FBO framebuffer; note that for some devices (i.e. those with - * a natural pixel coordinate system for FBOs that differs from the - * OpenGL/Mesa coordinate system), this means that the viewport, - * polygon face orientation, and polygon stipple will have to be inverted. - */ - GLuint Name; - - GLint RefCount; - GLboolean DeletePending; - - /** - * The framebuffer's visual. Immutable if this is a window system buffer. - * Computed from attachments if user-made FBO. - */ - struct gl_config Visual; - - GLboolean Initialized; - - GLuint Width, Height; /**< size of frame buffer in pixels */ - - /** \name Drawing bounds (Intersection of buffer size and scissor box) */ - /*@{*/ - GLint _Xmin, _Xmax; /**< inclusive */ - GLint _Ymin, _Ymax; /**< exclusive */ - /*@}*/ - - /** \name Derived Z buffer stuff */ - /*@{*/ - GLuint _DepthMax; /**< Max depth buffer value */ - GLfloat _DepthMaxF; /**< Float max depth buffer value */ - GLfloat _MRD; /**< minimum resolvable difference in Z values */ - /*@}*/ - - /** One of the GL_FRAMEBUFFER_(IN)COMPLETE_* tokens */ - GLenum _Status; - - /** Integer color values */ - GLboolean _IntegerColor; - - /** Array of all renderbuffer attachments, indexed by BUFFER_* tokens. */ - struct gl_renderbuffer_attachment Attachment[BUFFER_COUNT]; - - /* In unextended OpenGL these vars are part of the GL_COLOR_BUFFER - * attribute group and GL_PIXEL attribute group, respectively. - */ - GLenum ColorDrawBuffer[MAX_DRAW_BUFFERS]; - GLenum ColorReadBuffer; - - /** Computed from ColorDraw/ReadBuffer above */ - GLuint _NumColorDrawBuffers; - GLint _ColorDrawBufferIndexes[MAX_DRAW_BUFFERS]; /**< BUFFER_x or -1 */ - GLint _ColorReadBufferIndex; /* -1 = None */ - struct gl_renderbuffer *_ColorDrawBuffers[MAX_DRAW_BUFFERS]; - struct gl_renderbuffer *_ColorReadBuffer; - - /** The Actual depth/stencil buffers to use. May be wrappers around the - * depth/stencil buffers attached above. */ - struct gl_renderbuffer *_DepthBuffer; - struct gl_renderbuffer *_StencilBuffer; - - /** Delete this framebuffer */ - void (*Delete)(struct gl_framebuffer *fb); -}; - - -/** - * Precision info for shader datatypes. See glGetShaderPrecisionFormat(). - */ -struct gl_precision -{ - GLushort RangeMin; /**< min value exponent */ - GLushort RangeMax; /**< max value exponent */ - GLushort Precision; /**< number of mantissa bits */ -}; - - -/** - * Limits for vertex and fragment programs/shaders. - */ -struct gl_program_constants -{ - /* logical limits */ - GLuint MaxInstructions; - GLuint MaxAluInstructions; - GLuint MaxTexInstructions; - GLuint MaxTexIndirections; - GLuint MaxAttribs; - GLuint MaxTemps; - GLuint MaxAddressRegs; - GLuint MaxParameters; - GLuint MaxLocalParams; - GLuint MaxEnvParams; - /* native/hardware limits */ - GLuint MaxNativeInstructions; - GLuint MaxNativeAluInstructions; - GLuint MaxNativeTexInstructions; - GLuint MaxNativeTexIndirections; - GLuint MaxNativeAttribs; - GLuint MaxNativeTemps; - GLuint MaxNativeAddressRegs; - GLuint MaxNativeParameters; - /* For shaders */ - GLuint MaxUniformComponents; - /* GL_ARB_geometry_shader4 */ - GLuint MaxGeometryTextureImageUnits; - GLuint MaxGeometryVaryingComponents; - GLuint MaxVertexVaryingComponents; - GLuint MaxGeometryUniformComponents; - GLuint MaxGeometryOutputVertices; - GLuint MaxGeometryTotalOutputComponents; - /* ES 2.0 and GL_ARB_ES2_compatibility */ - struct gl_precision LowFloat, MediumFloat, HighFloat; - struct gl_precision LowInt, MediumInt, HighInt; -}; - - -/** - * Constants which may be overridden by device driver during context creation - * but are never changed after that. - */ -struct gl_constants -{ - GLint MaxTextureMbytes; /**< Max memory per image, in MB */ - GLint MaxTextureLevels; /**< Max mipmap levels. */ - GLint Max3DTextureLevels; /**< Max mipmap levels for 3D textures */ - GLint MaxCubeTextureLevels; /**< Max mipmap levels for cube textures */ - GLint MaxArrayTextureLayers; /**< Max layers in array textures */ - GLint MaxTextureRectSize; /**< Max rectangle texture size, in pixes */ - GLuint MaxTextureCoordUnits; - GLuint MaxTextureImageUnits; - GLuint MaxVertexTextureImageUnits; - GLuint MaxCombinedTextureImageUnits; - GLuint MaxTextureUnits; /**< = MIN(CoordUnits, ImageUnits) */ - GLfloat MaxTextureMaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ - GLfloat MaxTextureLodBias; /**< GL_EXT_texture_lod_bias */ - - GLuint MaxArrayLockSize; - - GLint SubPixelBits; - - GLfloat MinPointSize, MaxPointSize; /**< aliased */ - GLfloat MinPointSizeAA, MaxPointSizeAA; /**< antialiased */ - GLfloat PointSizeGranularity; - GLfloat MinLineWidth, MaxLineWidth; /**< aliased */ - GLfloat MinLineWidthAA, MaxLineWidthAA; /**< antialiased */ - GLfloat LineWidthGranularity; - - GLuint MaxColorTableSize; - - GLuint MaxClipPlanes; - GLuint MaxLights; - GLfloat MaxShininess; /**< GL_NV_light_max_exponent */ - GLfloat MaxSpotExponent; /**< GL_NV_light_max_exponent */ - - GLuint MaxViewportWidth, MaxViewportHeight; - - struct gl_program_constants VertexProgram; /**< GL_ARB_vertex_program */ - struct gl_program_constants FragmentProgram; /**< GL_ARB_fragment_program */ - struct gl_program_constants GeometryProgram; /**< GL_ARB_geometry_shader4 */ - GLuint MaxProgramMatrices; - GLuint MaxProgramMatrixStackDepth; - - /** vertex array / buffer object bounds checking */ - GLboolean CheckArrayBounds; - - GLuint MaxDrawBuffers; /**< GL_ARB_draw_buffers */ - - GLuint MaxColorAttachments; /**< GL_EXT_framebuffer_object */ - GLuint MaxRenderbufferSize; /**< GL_EXT_framebuffer_object */ - GLuint MaxSamples; /**< GL_ARB_framebuffer_object */ - - GLuint MaxVarying; /**< Number of float[4] varying parameters */ - - GLuint GLSLVersion; /**< GLSL version supported (ex: 120 = 1.20) */ - - /** Which texture units support GL_ATI_envmap_bumpmap as targets */ - GLbitfield SupportedBumpUnits; - - /** - * Maximum amount of time, measured in nanseconds, that the server can wait. - */ - GLuint64 MaxServerWaitTimeout; - - /** GL_EXT_provoking_vertex */ - GLboolean QuadsFollowProvokingVertexConvention; - - /** OpenGL version 3.0 */ - GLbitfield ContextFlags; /**< Ex: GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT */ - - /** OpenGL version 3.2 */ - GLbitfield ProfileMask; /**< Mask of CONTEXT_x_PROFILE_BIT */ - - /** GL_EXT_transform_feedback */ - GLuint MaxTransformFeedbackSeparateAttribs; - GLuint MaxTransformFeedbackSeparateComponents; - GLuint MaxTransformFeedbackInterleavedComponents; - - /** GL_EXT_gpu_shader4 */ - GLint MinProgramTexelOffset, MaxProgramTexelOffset; - - /* GL_EXT_framebuffer_sRGB */ - GLboolean sRGBCapable; /* can enable sRGB blend/update on FBOs */ -}; - - -/** - * Enable flag for each OpenGL extension. Different device drivers will - * enable different extensions at runtime. - */ -struct gl_extensions -{ - GLboolean dummy; /* don't remove this! */ - GLboolean dummy_true; /* Set true by _mesa_init_extensions(). */ - GLboolean dummy_false; /* Set false by _mesa_init_extensions(). */ - GLboolean ARB_ES2_compatibility; - GLboolean ARB_blend_func_extended; - GLboolean ARB_copy_buffer; - GLboolean ARB_depth_buffer_float; - GLboolean ARB_depth_clamp; - GLboolean ARB_depth_texture; - GLboolean ARB_draw_buffers; - GLboolean ARB_draw_buffers_blend; - GLboolean ARB_draw_elements_base_vertex; - GLboolean ARB_draw_instanced; - GLboolean ARB_fragment_coord_conventions; - GLboolean ARB_fragment_program; - GLboolean ARB_fragment_program_shadow; - GLboolean ARB_fragment_shader; - GLboolean ARB_framebuffer_object; - GLboolean ARB_explicit_attrib_location; - GLboolean ARB_geometry_shader4; - GLboolean ARB_half_float_pixel; - GLboolean ARB_half_float_vertex; - GLboolean ARB_instanced_arrays; - GLboolean ARB_map_buffer_range; - GLboolean ARB_multisample; - GLboolean ARB_multitexture; - GLboolean ARB_occlusion_query; - GLboolean ARB_occlusion_query2; - GLboolean ARB_point_sprite; - GLboolean ARB_sampler_objects; - GLboolean ARB_seamless_cube_map; - GLboolean ARB_shader_objects; - GLboolean ARB_shader_stencil_export; - GLboolean ARB_shading_language_100; - GLboolean ARB_shadow; - GLboolean ARB_shadow_ambient; - GLboolean ARB_sync; - GLboolean ARB_texture_border_clamp; - GLboolean ARB_texture_buffer_object; - GLboolean ARB_texture_compression; - GLboolean ARB_texture_compression_rgtc; - GLboolean ARB_texture_cube_map; - GLboolean ARB_texture_env_combine; - GLboolean ARB_texture_env_crossbar; - GLboolean ARB_texture_env_dot3; - GLboolean ARB_texture_float; - GLboolean ARB_texture_mirrored_repeat; - GLboolean ARB_texture_multisample; - GLboolean ARB_texture_non_power_of_two; - GLboolean ARB_texture_rg; - GLboolean ARB_texture_rgb10_a2ui; - GLboolean ARB_timer_query; - GLboolean ARB_transform_feedback2; - GLboolean ARB_transpose_matrix; - GLboolean ARB_uniform_buffer_object; - GLboolean ARB_vertex_array_object; - GLboolean ARB_vertex_buffer_object; - GLboolean ARB_vertex_program; - GLboolean ARB_vertex_shader; - GLboolean ARB_vertex_type_2_10_10_10_rev; - GLboolean ARB_window_pos; - GLboolean EXT_abgr; - GLboolean EXT_bgra; - GLboolean EXT_blend_color; - GLboolean EXT_blend_equation_separate; - GLboolean EXT_blend_func_separate; - GLboolean EXT_blend_logic_op; - GLboolean EXT_blend_minmax; - GLboolean EXT_blend_subtract; - GLboolean EXT_clip_volume_hint; - GLboolean EXT_compiled_vertex_array; - GLboolean EXT_copy_texture; - GLboolean EXT_depth_bounds_test; - GLboolean EXT_draw_buffers2; - GLboolean EXT_draw_range_elements; - GLboolean EXT_fog_coord; - GLboolean EXT_framebuffer_blit; - GLboolean EXT_framebuffer_multisample; - GLboolean EXT_framebuffer_object; - GLboolean EXT_framebuffer_sRGB; - GLboolean EXT_gpu_program_parameters; - GLboolean EXT_gpu_shader4; - GLboolean EXT_multi_draw_arrays; - GLboolean EXT_paletted_texture; - GLboolean EXT_packed_depth_stencil; - GLboolean EXT_packed_float; - GLboolean EXT_packed_pixels; - GLboolean EXT_pixel_buffer_object; - GLboolean EXT_point_parameters; - GLboolean EXT_polygon_offset; - GLboolean EXT_provoking_vertex; - GLboolean EXT_rescale_normal; - GLboolean EXT_shadow_funcs; - GLboolean EXT_secondary_color; - GLboolean EXT_separate_shader_objects; - GLboolean EXT_separate_specular_color; - GLboolean EXT_shared_texture_palette; - GLboolean EXT_stencil_wrap; - GLboolean EXT_stencil_two_side; - GLboolean EXT_subtexture; - GLboolean EXT_texture; - GLboolean EXT_texture_object; - GLboolean EXT_texture3D; - GLboolean EXT_texture_array; - GLboolean EXT_texture_compression_s3tc; - GLboolean EXT_texture_env_add; - GLboolean EXT_texture_env_combine; - GLboolean EXT_texture_env_dot3; - GLboolean EXT_texture_filter_anisotropic; - GLboolean EXT_texture_integer; - GLboolean EXT_texture_lod_bias; - GLboolean EXT_texture_mirror_clamp; - GLboolean EXT_texture_shared_exponent; - GLboolean EXT_texture_sRGB; - GLboolean EXT_texture_sRGB_decode; - GLboolean EXT_texture_swizzle; - GLboolean EXT_transform_feedback; - GLboolean EXT_timer_query; - GLboolean EXT_vertex_array; - GLboolean EXT_vertex_array_bgra; - GLboolean EXT_vertex_array_set; - GLboolean OES_standard_derivatives; - /* vendor extensions */ - GLboolean AMD_conservative_depth; - GLboolean APPLE_client_storage; - GLboolean APPLE_packed_pixels; - GLboolean APPLE_vertex_array_object; - GLboolean APPLE_object_purgeable; - GLboolean ATI_envmap_bumpmap; - GLboolean ATI_texture_mirror_once; - GLboolean ATI_texture_env_combine3; - GLboolean ATI_fragment_shader; - GLboolean ATI_separate_stencil; - GLboolean IBM_rasterpos_clip; - GLboolean IBM_multimode_draw_arrays; - GLboolean MESA_pack_invert; - GLboolean MESA_resize_buffers; - GLboolean MESA_ycbcr_texture; - GLboolean MESA_texture_array; - GLboolean MESA_texture_signed_rgba; - GLboolean NV_blend_square; - GLboolean NV_conditional_render; - GLboolean NV_fragment_program; - GLboolean NV_fragment_program_option; - GLboolean NV_light_max_exponent; - GLboolean NV_point_sprite; - GLboolean NV_primitive_restart; - GLboolean NV_texgen_reflection; - GLboolean NV_texture_env_combine4; - GLboolean NV_texture_rectangle; - GLboolean NV_vertex_program; - GLboolean NV_vertex_program1_1; - GLboolean OES_read_format; - GLboolean SGI_texture_color_table; - GLboolean SGIS_generate_mipmap; - GLboolean SGIS_texture_edge_clamp; - GLboolean SGIS_texture_lod; - GLboolean TDFX_texture_compression_FXT1; - GLboolean S3_s3tc; - GLboolean OES_EGL_image; - GLboolean OES_draw_texture; - GLboolean EXT_texture_format_BGRA8888; - GLboolean extension_sentinel; - /** The extension string */ - const GLubyte *String; - /** Number of supported extensions */ - GLuint Count; -}; - - -/** - * A stack of matrices (projection, modelview, color, texture, etc). - */ -struct gl_matrix_stack -{ - GLmatrix *Top; /**< points into Stack */ - GLmatrix *Stack; /**< array [MaxDepth] of GLmatrix */ - GLuint Depth; /**< 0 <= Depth < MaxDepth */ - GLuint MaxDepth; /**< size of Stack[] array */ - GLuint DirtyFlag; /**< _NEW_MODELVIEW or _NEW_PROJECTION, for example */ -}; - - -/** - * \name Bits for image transfer operations - * \sa __struct gl_contextRec::ImageTransferState. - */ -/*@{*/ -#define IMAGE_SCALE_BIAS_BIT 0x1 -#define IMAGE_SHIFT_OFFSET_BIT 0x2 -#define IMAGE_MAP_COLOR_BIT 0x4 -#define IMAGE_CLAMP_BIT 0x800 - - -/** Pixel Transfer ops */ -#define IMAGE_BITS (IMAGE_SCALE_BIAS_BIT | \ - IMAGE_SHIFT_OFFSET_BIT | \ - IMAGE_MAP_COLOR_BIT) - -/** - * \name Bits to indicate what state has changed. - */ -/*@{*/ -#define _NEW_MODELVIEW (1 << 0) /**< gl_context::ModelView */ -#define _NEW_PROJECTION (1 << 1) /**< gl_context::Projection */ -#define _NEW_TEXTURE_MATRIX (1 << 2) /**< gl_context::TextureMatrix */ -#define _NEW_COLOR (1 << 3) /**< gl_context::Color */ -#define _NEW_DEPTH (1 << 4) /**< gl_context::Depth */ -#define _NEW_EVAL (1 << 5) /**< gl_context::Eval, EvalMap */ -#define _NEW_FOG (1 << 6) /**< gl_context::Fog */ -#define _NEW_HINT (1 << 7) /**< gl_context::Hint */ -#define _NEW_LIGHT (1 << 8) /**< gl_context::Light */ -#define _NEW_LINE (1 << 9) /**< gl_context::Line */ -#define _NEW_PIXEL (1 << 10) /**< gl_context::Pixel */ -#define _NEW_POINT (1 << 11) /**< gl_context::Point */ -#define _NEW_POLYGON (1 << 12) /**< gl_context::Polygon */ -#define _NEW_POLYGONSTIPPLE (1 << 13) /**< gl_context::PolygonStipple */ -#define _NEW_SCISSOR (1 << 14) /**< gl_context::Scissor */ -#define _NEW_STENCIL (1 << 15) /**< gl_context::Stencil */ -#define _NEW_TEXTURE (1 << 16) /**< gl_context::Texture */ -#define _NEW_TRANSFORM (1 << 17) /**< gl_context::Transform */ -#define _NEW_VIEWPORT (1 << 18) /**< gl_context::Viewport */ -#define _NEW_PACKUNPACK (1 << 19) /**< gl_context::Pack, Unpack */ -#define _NEW_ARRAY (1 << 20) /**< gl_context::Array */ -#define _NEW_RENDERMODE (1 << 21) /**< gl_context::RenderMode, etc */ -#define _NEW_BUFFERS (1 << 22) /**< gl_context::Visual, DrawBuffer, */ -#define _NEW_CURRENT_ATTRIB (1 << 23) /**< gl_context::Current */ -#define _NEW_MULTISAMPLE (1 << 24) /**< gl_context::Multisample */ -#define _NEW_TRACK_MATRIX (1 << 25) /**< gl_context::VertexProgram */ -#define _NEW_PROGRAM (1 << 26) /**< New program/shader state */ -#define _NEW_PROGRAM_CONSTANTS (1 << 27) -#define _NEW_BUFFER_OBJECT (1 << 28) -#define _NEW_ALL ~0 -/*@}*/ - - -/** - * \name Bits to track array state changes - * - * Also used to summarize array enabled. - */ -/*@{*/ -#define _NEW_ARRAY_VERTEX VERT_BIT_POS -#define _NEW_ARRAY_WEIGHT VERT_BIT_WEIGHT -#define _NEW_ARRAY_NORMAL VERT_BIT_NORMAL -#define _NEW_ARRAY_COLOR0 VERT_BIT_COLOR0 -#define _NEW_ARRAY_COLOR1 VERT_BIT_COLOR1 -#define _NEW_ARRAY_FOGCOORD VERT_BIT_FOG -#define _NEW_ARRAY_INDEX VERT_BIT_COLOR_INDEX -#define _NEW_ARRAY_EDGEFLAG VERT_BIT_EDGEFLAG -#define _NEW_ARRAY_POINT_SIZE VERT_BIT_COLOR_INDEX /* aliased */ -#define _NEW_ARRAY_TEXCOORD_0 VERT_BIT_TEX0 -#define _NEW_ARRAY_TEXCOORD_1 VERT_BIT_TEX1 -#define _NEW_ARRAY_TEXCOORD_2 VERT_BIT_TEX2 -#define _NEW_ARRAY_TEXCOORD_3 VERT_BIT_TEX3 -#define _NEW_ARRAY_TEXCOORD_4 VERT_BIT_TEX4 -#define _NEW_ARRAY_TEXCOORD_5 VERT_BIT_TEX5 -#define _NEW_ARRAY_TEXCOORD_6 VERT_BIT_TEX6 -#define _NEW_ARRAY_TEXCOORD_7 VERT_BIT_TEX7 -#define _NEW_ARRAY_ATTRIB_0 VERT_BIT_GENERIC0 /* start at bit 16 */ -#define _NEW_ARRAY_ALL 0xffffffff - - -#define _NEW_ARRAY_TEXCOORD(i) (_NEW_ARRAY_TEXCOORD_0 << (i)) -#define _NEW_ARRAY_ATTRIB(i) (_NEW_ARRAY_ATTRIB_0 << (i)) -/*@}*/ - - - -/** - * \name A bunch of flags that we think might be useful to drivers. - * - * Set in the __struct gl_contextRec::_TriangleCaps bitfield. - */ -/*@{*/ -#define DD_FLATSHADE 0x1 -#define DD_SEPARATE_SPECULAR 0x2 -#define DD_TRI_CULL_FRONT_BACK 0x4 /* special case on some hw */ -#define DD_TRI_LIGHT_TWOSIDE 0x8 -#define DD_TRI_UNFILLED 0x10 -#define DD_TRI_SMOOTH 0x20 -#define DD_TRI_STIPPLE 0x40 -#define DD_TRI_OFFSET 0x80 -#define DD_LINE_SMOOTH 0x100 -#define DD_LINE_STIPPLE 0x200 -#define DD_POINT_SMOOTH 0x400 -#define DD_POINT_ATTEN 0x800 -#define DD_TRI_TWOSTENCIL 0x1000 -/*@}*/ - - -/** - * \name Define the state changes under which each of these bits might change - */ -/*@{*/ -#define _DD_NEW_FLATSHADE _NEW_LIGHT -#define _DD_NEW_SEPARATE_SPECULAR (_NEW_LIGHT | _NEW_FOG | _NEW_PROGRAM) -#define _DD_NEW_TRI_CULL_FRONT_BACK _NEW_POLYGON -#define _DD_NEW_TRI_LIGHT_TWOSIDE _NEW_LIGHT -#define _DD_NEW_TRI_UNFILLED _NEW_POLYGON -#define _DD_NEW_TRI_SMOOTH _NEW_POLYGON -#define _DD_NEW_TRI_STIPPLE _NEW_POLYGON -#define _DD_NEW_TRI_OFFSET _NEW_POLYGON -#define _DD_NEW_LINE_SMOOTH _NEW_LINE -#define _DD_NEW_LINE_STIPPLE _NEW_LINE -#define _DD_NEW_LINE_WIDTH _NEW_LINE -#define _DD_NEW_POINT_SMOOTH _NEW_POINT -#define _DD_NEW_POINT_SIZE _NEW_POINT -#define _DD_NEW_POINT_ATTEN _NEW_POINT -/*@}*/ - - -/** - * Composite state flags - */ -/*@{*/ -#define _MESA_NEW_NEED_EYE_COORDS (_NEW_LIGHT | \ - _NEW_TEXTURE | \ - _NEW_POINT | \ - _NEW_PROGRAM | \ - _NEW_MODELVIEW) - -#define _MESA_NEW_NEED_NORMALS (_NEW_LIGHT | \ - _NEW_TEXTURE) - -#define _MESA_NEW_TRANSFER_STATE (_NEW_PIXEL) -/*@}*/ - - - - -/* This has to be included here. */ -#include "dd.h" - - -/** - * Display list flags. - * Strictly this is a tnl-private concept, but it doesn't seem - * worthwhile adding a tnl private structure just to hold this one bit - * of information: - */ -#define DLIST_DANGLING_REFS 0x1 - - -/** Opaque declaration of display list payload data type */ -union gl_dlist_node; - - -/** - * Provide a location where information about a display list can be - * collected. Could be extended with driverPrivate structures, - * etc. in the future. - */ -struct gl_display_list -{ - GLuint Name; - GLbitfield Flags; /**< DLIST_x flags */ - /** The dlist commands are in a linked list of nodes */ - union gl_dlist_node *Head; -}; - - -/** - * State used during display list compilation and execution. - */ -struct gl_dlist_state -{ - GLuint CallDepth; /**< Current recursion calling depth */ - - struct gl_display_list *CurrentList; /**< List currently being compiled */ - union gl_dlist_node *CurrentBlock; /**< Pointer to current block of nodes */ - GLuint CurrentPos; /**< Index into current block of nodes */ - - GLvertexformat ListVtxfmt; - - GLubyte ActiveAttribSize[VERT_ATTRIB_MAX]; - GLfloat CurrentAttrib[VERT_ATTRIB_MAX][4]; - - GLubyte ActiveMaterialSize[MAT_ATTRIB_MAX]; - GLfloat CurrentMaterial[MAT_ATTRIB_MAX][4]; - - GLubyte ActiveIndex; - GLfloat CurrentIndex; - - GLubyte ActiveEdgeFlag; - GLboolean CurrentEdgeFlag; - - struct { - /* State known to have been set by the currently-compiling display - * list. Used to eliminate some redundant state changes. - */ - GLenum ShadeModel; - } Current; -}; - - -/** - * Enum for the OpenGL APIs we know about and may support. - */ -typedef enum -{ - API_OPENGL, - API_OPENGLES, - API_OPENGLES2 -} gl_api; - - -/** - * Mesa rendering context. - * - * This is the central context data structure for Mesa. Almost all - * OpenGL state is contained in this structure. - * Think of this as a base class from which device drivers will derive - * sub classes. - * - * The struct gl_context typedef names this structure. - */ -struct gl_context -{ - /** State possibly shared with other contexts in the address space */ - struct gl_shared_state *Shared; - - /** \name API function pointer tables */ - /*@{*/ - gl_api API; - struct _glapi_table *Save; /**< Display list save functions */ - struct _glapi_table *Exec; /**< Execute functions */ - struct _glapi_table *CurrentDispatch; /**< == Save or Exec !! */ - /*@}*/ - - struct gl_config Visual; - struct gl_framebuffer *DrawBuffer; /**< buffer for writing */ - struct gl_framebuffer *ReadBuffer; /**< buffer for reading */ - struct gl_framebuffer *WinSysDrawBuffer; /**< set with MakeCurrent */ - struct gl_framebuffer *WinSysReadBuffer; /**< set with MakeCurrent */ - - /** - * Device driver function pointer table - */ - struct dd_function_table Driver; - - void *DriverCtx; /**< Points to device driver context/state */ - - /** Core/Driver constants */ - struct gl_constants Const; - - /** \name The various 4x4 matrix stacks */ - /*@{*/ - struct gl_matrix_stack ModelviewMatrixStack; - struct gl_matrix_stack ProjectionMatrixStack; - struct gl_matrix_stack TextureMatrixStack[MAX_TEXTURE_UNITS]; - struct gl_matrix_stack ProgramMatrixStack[MAX_PROGRAM_MATRICES]; - struct gl_matrix_stack *CurrentStack; /**< Points to one of the above stacks */ - /*@}*/ - - /** Combined modelview and projection matrix */ - GLmatrix _ModelProjectMatrix; - - /** \name Display lists */ - struct gl_dlist_state ListState; - - GLboolean ExecuteFlag; /**< Execute GL commands? */ - GLboolean CompileFlag; /**< Compile GL commands into display list? */ - - /** Extension information */ - struct gl_extensions Extensions; - - /** Version info */ - GLuint VersionMajor, VersionMinor; - char *VersionString; - - /** \name State attribute stack (for glPush/PopAttrib) */ - /*@{*/ - GLuint AttribStackDepth; - struct gl_attrib_node *AttribStack[MAX_ATTRIB_STACK_DEPTH]; - /*@}*/ - - /** \name Renderer attribute groups - * - * We define a struct for each attribute group to make pushing and popping - * attributes easy. Also it's a good organization. - */ - /*@{*/ - struct gl_accum_attrib Accum; /**< Accum buffer attributes */ - struct gl_colorbuffer_attrib Color; /**< Color buffer attributes */ - struct gl_current_attrib Current; /**< Current attributes */ - struct gl_depthbuffer_attrib Depth; /**< Depth buffer attributes */ - struct gl_eval_attrib Eval; /**< Eval attributes */ - struct gl_fog_attrib Fog; /**< Fog attributes */ - struct gl_hint_attrib Hint; /**< Hint attributes */ - struct gl_light_attrib Light; /**< Light attributes */ - struct gl_line_attrib Line; /**< Line attributes */ - struct gl_list_attrib List; /**< List attributes */ - struct gl_multisample_attrib Multisample; - struct gl_pixel_attrib Pixel; /**< Pixel attributes */ - struct gl_point_attrib Point; /**< Point attributes */ - struct gl_polygon_attrib Polygon; /**< Polygon attributes */ - GLuint PolygonStipple[32]; /**< Polygon stipple */ - struct gl_scissor_attrib Scissor; /**< Scissor attributes */ - struct gl_stencil_attrib Stencil; /**< Stencil buffer attributes */ - struct gl_texture_attrib Texture; /**< Texture attributes */ - struct gl_transform_attrib Transform; /**< Transformation attributes */ - struct gl_viewport_attrib Viewport; /**< Viewport attributes */ - /*@}*/ - - /** \name Client attribute stack */ - /*@{*/ - GLuint ClientAttribStackDepth; - struct gl_attrib_node *ClientAttribStack[MAX_CLIENT_ATTRIB_STACK_DEPTH]; - /*@}*/ - - /** \name Client attribute groups */ - /*@{*/ - struct gl_array_attrib Array; /**< Vertex arrays */ - struct gl_pixelstore_attrib Pack; /**< Pixel packing */ - struct gl_pixelstore_attrib Unpack; /**< Pixel unpacking */ - struct gl_pixelstore_attrib DefaultPacking; /**< Default params */ - /*@}*/ - - /** \name Other assorted state (not pushed/popped on attribute stack) */ - /*@{*/ - struct gl_pixelmaps PixelMaps; - - struct gl_evaluators EvalMap; /**< All evaluators */ - struct gl_feedback Feedback; /**< Feedback */ - struct gl_selection Select; /**< Selection */ - - struct gl_program_state Program; /**< general program state */ - struct gl_vertex_program_state VertexProgram; - struct gl_fragment_program_state FragmentProgram; - struct gl_geometry_program_state GeometryProgram; - struct gl_ati_fragment_shader_state ATIFragmentShader; - - struct gl_shader_state Shader; /**< GLSL shader object state */ - struct gl_shader_compiler_options ShaderCompilerOptions[MESA_SHADER_TYPES]; - - struct gl_query_state Query; /**< occlusion, timer queries */ - - struct gl_transform_feedback TransformFeedback; - - struct gl_buffer_object *CopyReadBuffer; /**< GL_ARB_copy_buffer */ - struct gl_buffer_object *CopyWriteBuffer; /**< GL_ARB_copy_buffer */ - /*@}*/ - - struct gl_meta_state *Meta; /**< for "meta" operations */ - - /* GL_EXT_framebuffer_object */ - struct gl_renderbuffer *CurrentRenderbuffer; - - GLenum ErrorValue; /**< Last error code */ - - /** - * Recognize and silence repeated error debug messages in buggy apps. - */ - const char *ErrorDebugFmtString; - GLuint ErrorDebugCount; - - GLenum RenderMode; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */ - GLbitfield NewState; /**< bitwise-or of _NEW_* flags */ - - GLboolean ViewportInitialized; /**< has viewport size been initialized? */ - - GLbitfield varying_vp_inputs; /**< mask of VERT_BIT_* flags */ - - /** \name Derived state */ - /*@{*/ - /** Bitwise-or of DD_* flags. Note that this bitfield may be used before - * state validation so they need to always be current. - */ - GLbitfield _TriangleCaps; - GLbitfield _ImageTransferState;/**< bitwise-or of IMAGE_*_BIT flags */ - GLfloat _EyeZDir[3]; - GLfloat _ModelViewInvScale; - GLboolean _NeedEyeCoords; - GLboolean _ForceEyeCoords; - - GLuint TextureStateTimestamp; /**< detect changes to shared state */ - - struct gl_shine_tab *_ShineTable[2]; /**< Active shine tables */ - struct gl_shine_tab *_ShineTabList; /**< MRU list of inactive shine tables */ - /**@}*/ - - struct gl_list_extensions *ListExt; /**< driver dlist extensions */ - - /** \name For debugging/development only */ - /*@{*/ - GLboolean FirstTimeCurrent; - /*@}*/ - - /** Dither disable via MESA_NO_DITHER env var */ - GLboolean NoDither; - - /** software compression/decompression supported or not */ - GLboolean Mesa_DXTn; - - GLboolean TextureFormatSupported[MESA_FORMAT_COUNT]; - - /** - * Use dp4 (rather than mul/mad) instructions for position - * transformation? - */ - GLboolean mvp_with_dp4; - - /** - * \name Hooks for module contexts. - * - * These will eventually live in the driver or elsewhere. - */ - /*@{*/ - void *swrast_context; - void *swsetup_context; - void *swtnl_context; - void *swtnl_im; - struct st_context *st; - void *aelt_context; - /*@}*/ -}; - - -#ifdef DEBUG -extern int MESA_VERBOSE; -extern int MESA_DEBUG_FLAGS; -# define MESA_FUNCTION __FUNCTION__ -#else -# define MESA_VERBOSE 0 -# define MESA_DEBUG_FLAGS 0 -# define MESA_FUNCTION "a function" -# ifndef NDEBUG -# define NDEBUG -# endif -#endif - - -/** The MESA_VERBOSE var is a bitmask of these flags */ -enum _verbose -{ - VERBOSE_VARRAY = 0x0001, - VERBOSE_TEXTURE = 0x0002, - VERBOSE_MATERIAL = 0x0004, - VERBOSE_PIPELINE = 0x0008, - VERBOSE_DRIVER = 0x0010, - VERBOSE_STATE = 0x0020, - VERBOSE_API = 0x0040, - VERBOSE_DISPLAY_LIST = 0x0100, - VERBOSE_LIGHTING = 0x0200, - VERBOSE_PRIMS = 0x0400, - VERBOSE_VERTS = 0x0800, - VERBOSE_DISASSEM = 0x1000, - VERBOSE_DRAW = 0x2000, - VERBOSE_SWAPBUFFERS = 0x4000 -}; - - -/** The MESA_DEBUG_FLAGS var is a bitmask of these flags */ -enum _debug -{ - DEBUG_ALWAYS_FLUSH = 0x1 -}; - - - -#endif /* MTYPES_H */ +/* + * Mesa 3-D graphics library + * Version: 7.7 + * + * 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 mtypes.h + * Main Mesa data structures. + * + * Please try to mark derived values with a leading underscore ('_'). + */ + +#ifndef MTYPES_H +#define MTYPES_H + + +#include "main/glheader.h" +#include "main/config.h" +#include "main/mfeatures.h" +#include "glapi/glapi.h" +#include "math/m_matrix.h" /* GLmatrix */ +#include "main/simple_list.h" /* struct simple_node */ +#include "main/formats.h" /* MESA_FORMAT_COUNT */ + + +/** + * 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 + typedef GLubyte GLstencil; +#elif STENCIL_BITS==16 + typedef GLushort GLstencil; +#else +# error "illegal number of stencil bits" +#endif + + +/** + * \name 64-bit extension of GLbitfield. + */ +/*@{*/ +typedef GLuint64 GLbitfield64; + +/** Set a single bit */ +#define BITFIELD64_BIT(b) (1ULL << (b)) + + +/** + * \name Some forward type declarations + */ +/*@{*/ +struct _mesa_HashTable; +struct gl_attrib_node; +struct gl_list_extensions; +struct gl_meta_state; +struct gl_pixelstore_attrib; +struct gl_program_cache; +struct gl_texture_format; +struct gl_texture_image; +struct gl_texture_object; +struct gl_context; +struct st_context; +/*@}*/ + + +/** Extra draw modes beyond GL_POINTS, GL_TRIANGLE_FAN, etc */ +#define PRIM_OUTSIDE_BEGIN_END (GL_POLYGON+1) +#define PRIM_INSIDE_UNKNOWN_PRIM (GL_POLYGON+2) +#define PRIM_UNKNOWN (GL_POLYGON+3) + + +/** + * Shader stages. Note that these will become 5 with tessellation. + * These MUST have the same values as gallium's PIPE_SHADER_* + */ +typedef enum +{ + MESA_SHADER_VERTEX = 0, + MESA_SHADER_FRAGMENT = 1, + MESA_SHADER_GEOMETRY = 2, + MESA_SHADER_TYPES = 3 +} gl_shader_type; + + + +/** + * Indexes for vertex program attributes. + * GL_NV_vertex_program aliases generic attributes over the conventional + * attributes. In GL_ARB_vertex_program shader the aliasing is optional. + * In GL_ARB_vertex_shader / OpenGL 2.0 the aliasing is disallowed (the + * generic attributes are distinct/separate). + */ +typedef enum +{ + VERT_ATTRIB_POS = 0, + VERT_ATTRIB_WEIGHT = 1, + VERT_ATTRIB_NORMAL = 2, + VERT_ATTRIB_COLOR0 = 3, + VERT_ATTRIB_COLOR1 = 4, + VERT_ATTRIB_FOG = 5, + VERT_ATTRIB_COLOR_INDEX = 6, + VERT_ATTRIB_POINT_SIZE = 6, /*alias*/ + VERT_ATTRIB_EDGEFLAG = 7, + VERT_ATTRIB_TEX0 = 8, + VERT_ATTRIB_TEX1 = 9, + VERT_ATTRIB_TEX2 = 10, + VERT_ATTRIB_TEX3 = 11, + VERT_ATTRIB_TEX4 = 12, + VERT_ATTRIB_TEX5 = 13, + VERT_ATTRIB_TEX6 = 14, + VERT_ATTRIB_TEX7 = 15, + VERT_ATTRIB_GENERIC0 = 16, + VERT_ATTRIB_GENERIC1 = 17, + VERT_ATTRIB_GENERIC2 = 18, + VERT_ATTRIB_GENERIC3 = 19, + VERT_ATTRIB_GENERIC4 = 20, + VERT_ATTRIB_GENERIC5 = 21, + VERT_ATTRIB_GENERIC6 = 22, + VERT_ATTRIB_GENERIC7 = 23, + VERT_ATTRIB_GENERIC8 = 24, + VERT_ATTRIB_GENERIC9 = 25, + VERT_ATTRIB_GENERIC10 = 26, + VERT_ATTRIB_GENERIC11 = 27, + VERT_ATTRIB_GENERIC12 = 28, + VERT_ATTRIB_GENERIC13 = 29, + VERT_ATTRIB_GENERIC14 = 30, + VERT_ATTRIB_GENERIC15 = 31, + VERT_ATTRIB_MAX = 32 +} gl_vert_attrib; + +/** + * Bitflags for vertex attributes. + * These are used in bitfields in many places. + */ +/*@{*/ +#define VERT_BIT_POS (1 << VERT_ATTRIB_POS) +#define VERT_BIT_WEIGHT (1 << VERT_ATTRIB_WEIGHT) +#define VERT_BIT_NORMAL (1 << VERT_ATTRIB_NORMAL) +#define VERT_BIT_COLOR0 (1 << VERT_ATTRIB_COLOR0) +#define VERT_BIT_COLOR1 (1 << VERT_ATTRIB_COLOR1) +#define VERT_BIT_FOG (1 << VERT_ATTRIB_FOG) +#define VERT_BIT_COLOR_INDEX (1 << VERT_ATTRIB_COLOR_INDEX) +#define VERT_BIT_EDGEFLAG (1 << VERT_ATTRIB_EDGEFLAG) +#define VERT_BIT_TEX0 (1 << VERT_ATTRIB_TEX0) +#define VERT_BIT_TEX1 (1 << VERT_ATTRIB_TEX1) +#define VERT_BIT_TEX2 (1 << VERT_ATTRIB_TEX2) +#define VERT_BIT_TEX3 (1 << VERT_ATTRIB_TEX3) +#define VERT_BIT_TEX4 (1 << VERT_ATTRIB_TEX4) +#define VERT_BIT_TEX5 (1 << VERT_ATTRIB_TEX5) +#define VERT_BIT_TEX6 (1 << VERT_ATTRIB_TEX6) +#define VERT_BIT_TEX7 (1 << VERT_ATTRIB_TEX7) +#define VERT_BIT_GENERIC0 (1 << VERT_ATTRIB_GENERIC0) +#define VERT_BIT_GENERIC1 (1 << VERT_ATTRIB_GENERIC1) +#define VERT_BIT_GENERIC2 (1 << VERT_ATTRIB_GENERIC2) +#define VERT_BIT_GENERIC3 (1 << VERT_ATTRIB_GENERIC3) +#define VERT_BIT_GENERIC4 (1 << VERT_ATTRIB_GENERIC4) +#define VERT_BIT_GENERIC5 (1 << VERT_ATTRIB_GENERIC5) +#define VERT_BIT_GENERIC6 (1 << VERT_ATTRIB_GENERIC6) +#define VERT_BIT_GENERIC7 (1 << VERT_ATTRIB_GENERIC7) +#define VERT_BIT_GENERIC8 (1 << VERT_ATTRIB_GENERIC8) +#define VERT_BIT_GENERIC9 (1 << VERT_ATTRIB_GENERIC9) +#define VERT_BIT_GENERIC10 (1 << VERT_ATTRIB_GENERIC10) +#define VERT_BIT_GENERIC11 (1 << VERT_ATTRIB_GENERIC11) +#define VERT_BIT_GENERIC12 (1 << VERT_ATTRIB_GENERIC12) +#define VERT_BIT_GENERIC13 (1 << VERT_ATTRIB_GENERIC13) +#define VERT_BIT_GENERIC14 (1 << VERT_ATTRIB_GENERIC14) +#define VERT_BIT_GENERIC15 (1 << VERT_ATTRIB_GENERIC15) + +#define VERT_BIT_TEX(u) (1 << (VERT_ATTRIB_TEX0 + (u))) +#define VERT_BIT_GENERIC(g) (1 << (VERT_ATTRIB_GENERIC0 + (g))) +/*@}*/ + + +/** + * Indexes for vertex program result attributes + */ +typedef enum +{ + VERT_RESULT_HPOS = 0, + VERT_RESULT_COL0 = 1, + VERT_RESULT_COL1 = 2, + VERT_RESULT_FOGC = 3, + VERT_RESULT_TEX0 = 4, + VERT_RESULT_TEX1 = 5, + VERT_RESULT_TEX2 = 6, + VERT_RESULT_TEX3 = 7, + VERT_RESULT_TEX4 = 8, + VERT_RESULT_TEX5 = 9, + VERT_RESULT_TEX6 = 10, + VERT_RESULT_TEX7 = 11, + VERT_RESULT_PSIZ = 12, + VERT_RESULT_BFC0 = 13, + VERT_RESULT_BFC1 = 14, + VERT_RESULT_EDGE = 15, + VERT_RESULT_VAR0 = 16, /**< shader varying */ + VERT_RESULT_MAX = (VERT_RESULT_VAR0 + MAX_VARYING) +} gl_vert_result; + + +/*********************************************/ + +/** + * Indexes for geometry program attributes. + */ +typedef enum +{ + GEOM_ATTRIB_POSITION = 0, + GEOM_ATTRIB_COLOR0 = 1, + GEOM_ATTRIB_COLOR1 = 2, + GEOM_ATTRIB_SECONDARY_COLOR0 = 3, + GEOM_ATTRIB_SECONDARY_COLOR1 = 4, + GEOM_ATTRIB_FOG_FRAG_COORD = 5, + GEOM_ATTRIB_POINT_SIZE = 6, + GEOM_ATTRIB_CLIP_VERTEX = 7, + GEOM_ATTRIB_PRIMITIVE_ID = 8, + GEOM_ATTRIB_TEX_COORD = 9, + + GEOM_ATTRIB_VAR0 = 16, + GEOM_ATTRIB_MAX = (GEOM_ATTRIB_VAR0 + MAX_VARYING) +} gl_geom_attrib; + +/** + * Bitflags for geometry attributes. + * These are used in bitfields in many places. + */ +/*@{*/ +#define GEOM_BIT_COLOR0 (1 << GEOM_ATTRIB_COLOR0) +#define GEOM_BIT_COLOR1 (1 << GEOM_ATTRIB_COLOR1) +#define GEOM_BIT_SCOLOR0 (1 << GEOM_ATTRIB_SECONDARY_COLOR0) +#define GEOM_BIT_SCOLOR1 (1 << GEOM_ATTRIB_SECONDARY_COLOR1) +#define GEOM_BIT_TEX_COORD (1 << GEOM_ATTRIB_TEX_COORD) +#define GEOM_BIT_FOG_COORD (1 << GEOM_ATTRIB_FOG_FRAG_COORD) +#define GEOM_BIT_POSITION (1 << GEOM_ATTRIB_POSITION) +#define GEOM_BIT_POINT_SIDE (1 << GEOM_ATTRIB_POINT_SIZE) +#define GEOM_BIT_CLIP_VERTEX (1 << GEOM_ATTRIB_CLIP_VERTEX) +#define GEOM_BIT_PRIM_ID (1 << GEOM_ATTRIB_PRIMITIVE_ID) +#define GEOM_BIT_VAR0 (1 << GEOM_ATTRIB_VAR0) + +#define GEOM_BIT_VAR(g) (1 << (GEOM_BIT_VAR0 + (g))) +/*@}*/ + + +/** + * Indexes for geometry program result attributes + */ +typedef enum +{ + GEOM_RESULT_POS = 0, + GEOM_RESULT_COL0 = 1, + GEOM_RESULT_COL1 = 2, + GEOM_RESULT_SCOL0 = 3, + GEOM_RESULT_SCOL1 = 4, + GEOM_RESULT_FOGC = 5, + GEOM_RESULT_TEX0 = 6, + GEOM_RESULT_TEX1 = 7, + GEOM_RESULT_TEX2 = 8, + GEOM_RESULT_TEX3 = 9, + GEOM_RESULT_TEX4 = 10, + GEOM_RESULT_TEX5 = 11, + GEOM_RESULT_TEX6 = 12, + GEOM_RESULT_TEX7 = 13, + GEOM_RESULT_PSIZ = 14, + GEOM_RESULT_CLPV = 15, + GEOM_RESULT_PRID = 16, + GEOM_RESULT_LAYR = 17, + GEOM_RESULT_VAR0 = 18, /**< shader varying, should really be 16 */ + /* ### we need to -2 because var0 is 18 instead 16 like in the others */ + GEOM_RESULT_MAX = (GEOM_RESULT_VAR0 + MAX_VARYING - 2) +} gl_geom_result; + + +/** + * Indexes for fragment program input attributes. + */ +typedef enum +{ + FRAG_ATTRIB_WPOS = 0, + FRAG_ATTRIB_COL0 = 1, + FRAG_ATTRIB_COL1 = 2, + FRAG_ATTRIB_FOGC = 3, + FRAG_ATTRIB_TEX0 = 4, + FRAG_ATTRIB_TEX1 = 5, + FRAG_ATTRIB_TEX2 = 6, + FRAG_ATTRIB_TEX3 = 7, + FRAG_ATTRIB_TEX4 = 8, + FRAG_ATTRIB_TEX5 = 9, + FRAG_ATTRIB_TEX6 = 10, + FRAG_ATTRIB_TEX7 = 11, + FRAG_ATTRIB_FACE = 12, /**< front/back face */ + FRAG_ATTRIB_PNTC = 13, /**< sprite/point coord */ + FRAG_ATTRIB_VAR0 = 14, /**< shader varying */ + FRAG_ATTRIB_MAX = (FRAG_ATTRIB_VAR0 + MAX_VARYING) +} gl_frag_attrib; + +/** + * Bitflags for fragment program input attributes. + */ +/*@{*/ +#define FRAG_BIT_WPOS (1 << FRAG_ATTRIB_WPOS) +#define FRAG_BIT_COL0 (1 << FRAG_ATTRIB_COL0) +#define FRAG_BIT_COL1 (1 << FRAG_ATTRIB_COL1) +#define FRAG_BIT_FOGC (1 << FRAG_ATTRIB_FOGC) +#define FRAG_BIT_FACE (1 << FRAG_ATTRIB_FACE) +#define FRAG_BIT_PNTC (1 << FRAG_ATTRIB_PNTC) +#define FRAG_BIT_TEX0 (1 << FRAG_ATTRIB_TEX0) +#define FRAG_BIT_TEX1 (1 << FRAG_ATTRIB_TEX1) +#define FRAG_BIT_TEX2 (1 << FRAG_ATTRIB_TEX2) +#define FRAG_BIT_TEX3 (1 << FRAG_ATTRIB_TEX3) +#define FRAG_BIT_TEX4 (1 << FRAG_ATTRIB_TEX4) +#define FRAG_BIT_TEX5 (1 << FRAG_ATTRIB_TEX5) +#define FRAG_BIT_TEX6 (1 << FRAG_ATTRIB_TEX6) +#define FRAG_BIT_TEX7 (1 << FRAG_ATTRIB_TEX7) +#define FRAG_BIT_VAR0 (1 << FRAG_ATTRIB_VAR0) + +#define FRAG_BIT_TEX(U) (FRAG_BIT_TEX0 << (U)) +#define FRAG_BIT_VAR(V) (FRAG_BIT_VAR0 << (V)) + +#define FRAG_BITS_TEX_ANY (FRAG_BIT_TEX0| \ + FRAG_BIT_TEX1| \ + FRAG_BIT_TEX2| \ + FRAG_BIT_TEX3| \ + FRAG_BIT_TEX4| \ + FRAG_BIT_TEX5| \ + FRAG_BIT_TEX6| \ + FRAG_BIT_TEX7) +/*@}*/ + + +/** + * Fragment program results + */ +typedef enum +{ + FRAG_RESULT_DEPTH = 0, + FRAG_RESULT_STENCIL = 1, + FRAG_RESULT_COLOR = 2, + FRAG_RESULT_DATA0 = 3, + FRAG_RESULT_MAX = (FRAG_RESULT_DATA0 + MAX_DRAW_BUFFERS) +} gl_frag_result; + + +/** + * Indexes for all renderbuffers + */ +typedef enum +{ + /* the four standard color buffers */ + BUFFER_FRONT_LEFT, + BUFFER_BACK_LEFT, + BUFFER_FRONT_RIGHT, + BUFFER_BACK_RIGHT, + BUFFER_DEPTH, + BUFFER_STENCIL, + BUFFER_ACCUM, + /* optional aux buffer */ + BUFFER_AUX0, + /* generic renderbuffers */ + BUFFER_COLOR0, + BUFFER_COLOR1, + BUFFER_COLOR2, + BUFFER_COLOR3, + BUFFER_COLOR4, + BUFFER_COLOR5, + BUFFER_COLOR6, + BUFFER_COLOR7, + BUFFER_COUNT +} gl_buffer_index; + +/** + * Bit flags for all renderbuffers + */ +#define BUFFER_BIT_FRONT_LEFT (1 << BUFFER_FRONT_LEFT) +#define BUFFER_BIT_BACK_LEFT (1 << BUFFER_BACK_LEFT) +#define BUFFER_BIT_FRONT_RIGHT (1 << BUFFER_FRONT_RIGHT) +#define BUFFER_BIT_BACK_RIGHT (1 << BUFFER_BACK_RIGHT) +#define BUFFER_BIT_AUX0 (1 << BUFFER_AUX0) +#define BUFFER_BIT_AUX1 (1 << BUFFER_AUX1) +#define BUFFER_BIT_AUX2 (1 << BUFFER_AUX2) +#define BUFFER_BIT_AUX3 (1 << BUFFER_AUX3) +#define BUFFER_BIT_DEPTH (1 << BUFFER_DEPTH) +#define BUFFER_BIT_STENCIL (1 << BUFFER_STENCIL) +#define BUFFER_BIT_ACCUM (1 << BUFFER_ACCUM) +#define BUFFER_BIT_COLOR0 (1 << BUFFER_COLOR0) +#define BUFFER_BIT_COLOR1 (1 << BUFFER_COLOR1) +#define BUFFER_BIT_COLOR2 (1 << BUFFER_COLOR2) +#define BUFFER_BIT_COLOR3 (1 << BUFFER_COLOR3) +#define BUFFER_BIT_COLOR4 (1 << BUFFER_COLOR4) +#define BUFFER_BIT_COLOR5 (1 << BUFFER_COLOR5) +#define BUFFER_BIT_COLOR6 (1 << BUFFER_COLOR6) +#define BUFFER_BIT_COLOR7 (1 << BUFFER_COLOR7) + +/** + * Mask of all the color buffer bits (but not accum). + */ +#define BUFFER_BITS_COLOR (BUFFER_BIT_FRONT_LEFT | \ + BUFFER_BIT_BACK_LEFT | \ + BUFFER_BIT_FRONT_RIGHT | \ + BUFFER_BIT_BACK_RIGHT | \ + BUFFER_BIT_AUX0 | \ + BUFFER_BIT_COLOR0 | \ + BUFFER_BIT_COLOR1 | \ + BUFFER_BIT_COLOR2 | \ + BUFFER_BIT_COLOR3 | \ + BUFFER_BIT_COLOR4 | \ + BUFFER_BIT_COLOR5 | \ + BUFFER_BIT_COLOR6 | \ + BUFFER_BIT_COLOR7) + + +/** + * Framebuffer configuration (aka visual / pixelformat) + * Note: some of these fields should be boolean, but it appears that + * code in drivers/dri/common/util.c requires int-sized fields. + */ +struct gl_config +{ + GLboolean rgbMode; + GLboolean floatMode; + GLboolean colorIndexMode; /* XXX is this used anywhere? */ + GLuint doubleBufferMode; + GLuint stereoMode; + + GLboolean haveAccumBuffer; + GLboolean haveDepthBuffer; + GLboolean haveStencilBuffer; + + GLint redBits, greenBits, blueBits, alphaBits; /* bits per comp */ + GLuint redMask, greenMask, blueMask, alphaMask; + GLint rgbBits; /* total bits for rgb */ + GLint indexBits; /* total bits for colorindex */ + + GLint accumRedBits, accumGreenBits, accumBlueBits, accumAlphaBits; + GLint depthBits; + GLint stencilBits; + + GLint numAuxBuffers; + + GLint level; + + /* EXT_visual_rating / GLX 1.2 */ + GLint visualRating; + + /* EXT_visual_info / GLX 1.2 */ + GLint transparentPixel; + /* colors are floats scaled to ints */ + GLint transparentRed, transparentGreen, transparentBlue, transparentAlpha; + GLint transparentIndex; + + /* ARB_multisample / SGIS_multisample */ + GLint sampleBuffers; + GLint samples; + + /* SGIX_pbuffer / GLX 1.3 */ + GLint maxPbufferWidth; + GLint maxPbufferHeight; + GLint maxPbufferPixels; + GLint optimalPbufferWidth; /* Only for SGIX_pbuffer. */ + GLint optimalPbufferHeight; /* Only for SGIX_pbuffer. */ + + /* OML_swap_method */ + GLint swapMethod; + + /* EXT_texture_from_pixmap */ + GLint bindToTextureRgb; + GLint bindToTextureRgba; + GLint bindToMipmapTexture; + GLint bindToTextureTargets; + GLint yInverted; + + /* EXT_framebuffer_sRGB */ + GLint sRGBCapable; +}; + + +/** + * Data structure for color tables + */ +struct gl_color_table +{ + GLenum InternalFormat; /**< The user-specified format */ + GLenum _BaseFormat; /**< GL_ALPHA, GL_RGBA, GL_RGB, etc */ + GLuint Size; /**< number of entries in table */ + GLfloat *TableF; /**< Color table, floating point values */ + GLubyte *TableUB; /**< Color table, ubyte values */ + GLubyte RedSize; + GLubyte GreenSize; + GLubyte BlueSize; + GLubyte AlphaSize; + GLubyte LuminanceSize; + GLubyte IntensitySize; +}; + + +/** + * \name Bit flags used for updating material values. + */ +/*@{*/ +#define MAT_ATTRIB_FRONT_AMBIENT 0 +#define MAT_ATTRIB_BACK_AMBIENT 1 +#define MAT_ATTRIB_FRONT_DIFFUSE 2 +#define MAT_ATTRIB_BACK_DIFFUSE 3 +#define MAT_ATTRIB_FRONT_SPECULAR 4 +#define MAT_ATTRIB_BACK_SPECULAR 5 +#define MAT_ATTRIB_FRONT_EMISSION 6 +#define MAT_ATTRIB_BACK_EMISSION 7 +#define MAT_ATTRIB_FRONT_SHININESS 8 +#define MAT_ATTRIB_BACK_SHININESS 9 +#define MAT_ATTRIB_FRONT_INDEXES 10 +#define MAT_ATTRIB_BACK_INDEXES 11 +#define MAT_ATTRIB_MAX 12 + +#define MAT_ATTRIB_AMBIENT(f) (MAT_ATTRIB_FRONT_AMBIENT+(f)) +#define MAT_ATTRIB_DIFFUSE(f) (MAT_ATTRIB_FRONT_DIFFUSE+(f)) +#define MAT_ATTRIB_SPECULAR(f) (MAT_ATTRIB_FRONT_SPECULAR+(f)) +#define MAT_ATTRIB_EMISSION(f) (MAT_ATTRIB_FRONT_EMISSION+(f)) +#define MAT_ATTRIB_SHININESS(f)(MAT_ATTRIB_FRONT_SHININESS+(f)) +#define MAT_ATTRIB_INDEXES(f) (MAT_ATTRIB_FRONT_INDEXES+(f)) + +#define MAT_INDEX_AMBIENT 0 +#define MAT_INDEX_DIFFUSE 1 +#define MAT_INDEX_SPECULAR 2 + +#define MAT_BIT_FRONT_AMBIENT (1< ) */ + GLfloat _NormSpotDirection[4]; /**< normalized spotlight direction */ + GLfloat _VP_inf_spot_attenuation; + + GLfloat _SpotExpTable[EXP_TABLE_SIZE][2]; /**< to replace a pow() call */ + GLfloat _MatAmbient[2][3]; /**< material ambient * light ambient */ + GLfloat _MatDiffuse[2][3]; /**< material diffuse * light diffuse */ + GLfloat _MatSpecular[2][3]; /**< material spec * light specular */ + GLfloat _dli; /**< CI diffuse light intensity */ + GLfloat _sli; /**< CI specular light intensity */ + /*@}*/ +}; + + +/** + * Light model state. + */ +struct gl_lightmodel +{ + GLfloat Ambient[4]; /**< ambient color */ + GLboolean LocalViewer; /**< Local (or infinite) view point? */ + GLboolean TwoSide; /**< Two (or one) sided lighting? */ + GLenum ColorControl; /**< either GL_SINGLE_COLOR + * or GL_SEPARATE_SPECULAR_COLOR */ +}; + + +/** + * Material state. + */ +struct gl_material +{ + GLfloat Attrib[MAT_ATTRIB_MAX][4]; +}; + + +/** + * Accumulation buffer attribute group (GL_ACCUM_BUFFER_BIT) + */ +struct gl_accum_attrib +{ + GLfloat ClearColor[4]; /**< Accumulation buffer clear color */ +}; + + +/** + * Color buffer attribute group (GL_COLOR_BUFFER_BIT). + */ +struct gl_colorbuffer_attrib +{ + GLuint ClearIndex; /**< Index to use for glClear */ + GLclampf ClearColor[4]; /**< Color to use for glClear */ + + GLuint IndexMask; /**< Color index write mask */ + GLubyte ColorMask[MAX_DRAW_BUFFERS][4];/**< Each flag is 0xff or 0x0 */ + + GLenum DrawBuffer[MAX_DRAW_BUFFERS]; /**< Which buffer to draw into */ + + /** + * \name alpha testing + */ + /*@{*/ + GLboolean AlphaEnabled; /**< Alpha test enabled flag */ + GLenum AlphaFunc; /**< Alpha test function */ + GLclampf AlphaRef; /**< Alpha reference value */ + /*@}*/ + + /** + * \name Blending + */ + /*@{*/ + GLbitfield BlendEnabled; /**< Per-buffer blend enable flags */ + GLfloat BlendColor[4]; /**< Blending color */ + struct + { + GLenum SrcRGB; /**< RGB blend source term */ + GLenum DstRGB; /**< RGB blend dest term */ + GLenum SrcA; /**< Alpha blend source term */ + GLenum DstA; /**< Alpha blend dest term */ + GLenum EquationRGB; /**< GL_ADD, GL_SUBTRACT, etc. */ + GLenum EquationA; /**< GL_ADD, GL_SUBTRACT, etc. */ + } Blend[MAX_DRAW_BUFFERS]; + /** Are the blend func terms currently different for each buffer/target? */ + GLboolean _BlendFuncPerBuffer; + /** Are the blend equations currently different for each buffer/target? */ + GLboolean _BlendEquationPerBuffer; + /*@}*/ + + /** + * \name Logic op + */ + /*@{*/ + GLenum LogicOp; /**< Logic operator */ + GLboolean IndexLogicOpEnabled; /**< Color index logic op enabled flag */ + GLboolean ColorLogicOpEnabled; /**< RGBA logic op enabled flag */ + GLboolean _LogicOpEnabled; /**< RGBA logic op + EXT_blend_logic_op enabled flag */ + /*@}*/ + + GLboolean DitherFlag; /**< Dither enable flag */ + + GLenum ClampFragmentColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */ + GLenum ClampReadColor; /**< GL_TRUE, GL_FALSE or GL_FIXED_ONLY_ARB */ + + GLboolean sRGBEnabled; /**< Framebuffer sRGB blending/updating requested */ +}; + + +/** + * Current attribute group (GL_CURRENT_BIT). + */ +struct gl_current_attrib +{ + /** + * \name Current vertex attributes. + * \note Values are valid only after FLUSH_VERTICES has been called. + * \note Index and Edgeflag current values are stored as floats in the + * SIX and SEVEN attribute slots. + */ + GLfloat Attrib[VERT_ATTRIB_MAX][4]; /**< Position, color, texcoords, etc */ + + /** + * \name Current raster position attributes (always valid). + * \note This set of attributes is very similar to the SWvertex struct. + */ + /*@{*/ + GLfloat RasterPos[4]; + GLfloat RasterDistance; + GLfloat RasterColor[4]; + GLfloat RasterSecondaryColor[4]; + GLfloat RasterTexCoords[MAX_TEXTURE_COORD_UNITS][4]; + GLboolean RasterPosValid; + /*@}*/ +}; + + +/** + * Depth buffer attribute group (GL_DEPTH_BUFFER_BIT). + */ +struct gl_depthbuffer_attrib +{ + GLenum Func; /**< Function for depth buffer compare */ + GLclampd Clear; /**< Value to clear depth buffer to */ + GLboolean Test; /**< Depth buffering enabled flag */ + GLboolean Mask; /**< Depth buffer writable? */ + GLboolean BoundsTest; /**< GL_EXT_depth_bounds_test */ + GLfloat BoundsMin, BoundsMax;/**< GL_EXT_depth_bounds_test */ +}; + + +/** + * Evaluator attribute group (GL_EVAL_BIT). + */ +struct gl_eval_attrib +{ + /** + * \name Enable bits + */ + /*@{*/ + GLboolean Map1Color4; + GLboolean Map1Index; + GLboolean Map1Normal; + GLboolean Map1TextureCoord1; + GLboolean Map1TextureCoord2; + GLboolean Map1TextureCoord3; + GLboolean Map1TextureCoord4; + GLboolean Map1Vertex3; + GLboolean Map1Vertex4; + GLboolean Map1Attrib[16]; /* GL_NV_vertex_program */ + GLboolean Map2Color4; + GLboolean Map2Index; + GLboolean Map2Normal; + GLboolean Map2TextureCoord1; + GLboolean Map2TextureCoord2; + GLboolean Map2TextureCoord3; + GLboolean Map2TextureCoord4; + GLboolean Map2Vertex3; + GLboolean Map2Vertex4; + GLboolean Map2Attrib[16]; /* GL_NV_vertex_program */ + GLboolean AutoNormal; + /*@}*/ + + /** + * \name Map Grid endpoints and divisions and calculated du values + */ + /*@{*/ + GLint MapGrid1un; + GLfloat MapGrid1u1, MapGrid1u2, MapGrid1du; + GLint MapGrid2un, MapGrid2vn; + GLfloat MapGrid2u1, MapGrid2u2, MapGrid2du; + GLfloat MapGrid2v1, MapGrid2v2, MapGrid2dv; + /*@}*/ +}; + + +/** + * Fog attribute group (GL_FOG_BIT). + */ +struct gl_fog_attrib +{ + GLboolean Enabled; /**< Fog enabled flag */ + GLfloat Color[4]; /**< Fog color */ + GLfloat Density; /**< Density >= 0.0 */ + GLfloat Start; /**< Start distance in eye coords */ + GLfloat End; /**< End distance in eye coords */ + GLfloat Index; /**< Fog index */ + GLenum Mode; /**< Fog mode */ + GLboolean ColorSumEnabled; + GLenum FogCoordinateSource; /**< GL_EXT_fog_coord */ + GLfloat _Scale; /**< (End == Start) ? 1.0 : 1.0 / (End - Start) */ +}; + + +/** + * \brief Layout qualifiers for gl_FragDepth. + * + * Extension AMD_conservative_depth allows gl_FragDepth to be redeclared with + * a layout qualifier. + * + * \see enum ir_depth_layout + */ +enum gl_frag_depth_layout { + FRAG_DEPTH_LAYOUT_NONE, /**< No layout is specified. */ + FRAG_DEPTH_LAYOUT_ANY, + FRAG_DEPTH_LAYOUT_GREATER, + FRAG_DEPTH_LAYOUT_LESS, + FRAG_DEPTH_LAYOUT_UNCHANGED +}; + + +/** + * Hint attribute group (GL_HINT_BIT). + * + * Values are always one of GL_FASTEST, GL_NICEST, or GL_DONT_CARE. + */ +struct gl_hint_attrib +{ + GLenum PerspectiveCorrection; + GLenum PointSmooth; + GLenum LineSmooth; + GLenum PolygonSmooth; + GLenum Fog; + GLenum ClipVolumeClipping; /**< GL_EXT_clip_volume_hint */ + GLenum TextureCompression; /**< GL_ARB_texture_compression */ + GLenum GenerateMipmap; /**< GL_SGIS_generate_mipmap */ + GLenum FragmentShaderDerivative; /**< GL_ARB_fragment_shader */ +}; + +/** + * Light state flags. + */ +/*@{*/ +#define LIGHT_SPOT 0x1 +#define LIGHT_LOCAL_VIEWER 0x2 +#define LIGHT_POSITIONAL 0x4 +#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER) +/*@}*/ + + +/** + * Lighting attribute group (GL_LIGHT_BIT). + */ +struct gl_light_attrib +{ + struct gl_light Light[MAX_LIGHTS]; /**< Array of light sources */ + struct gl_lightmodel Model; /**< Lighting model */ + + /** + * Must flush FLUSH_VERTICES before referencing: + */ + /*@{*/ + struct gl_material Material; /**< Includes front & back values */ + /*@}*/ + + GLboolean Enabled; /**< Lighting enabled flag */ + GLenum ShadeModel; /**< GL_FLAT or GL_SMOOTH */ + GLenum ProvokingVertex; /**< GL_EXT_provoking_vertex */ + GLenum ColorMaterialFace; /**< GL_FRONT, BACK or FRONT_AND_BACK */ + GLenum ColorMaterialMode; /**< GL_AMBIENT, GL_DIFFUSE, etc */ + GLbitfield ColorMaterialBitmask; /**< bitmask formed from Face and Mode */ + GLboolean ColorMaterialEnabled; + GLenum ClampVertexColor; + + struct gl_light EnabledList; /**< List sentinel */ + + /** + * Derived state for optimizations: + */ + /*@{*/ + GLboolean _NeedEyeCoords; + GLboolean _NeedVertices; /**< Use fast shader? */ + GLbitfield _Flags; /**< LIGHT_* flags, see above */ + GLfloat _BaseColor[2][3]; + /*@}*/ +}; + + +/** + * Line attribute group (GL_LINE_BIT). + */ +struct gl_line_attrib +{ + GLboolean SmoothFlag; /**< GL_LINE_SMOOTH enabled? */ + GLboolean StippleFlag; /**< GL_LINE_STIPPLE enabled? */ + GLushort StipplePattern; /**< Stipple pattern */ + GLint StippleFactor; /**< Stipple repeat factor */ + GLfloat Width; /**< Line width */ +}; + + +/** + * Display list attribute group (GL_LIST_BIT). + */ +struct gl_list_attrib +{ + GLuint ListBase; +}; + + +/** + * Multisample attribute group (GL_MULTISAMPLE_BIT). + */ +struct gl_multisample_attrib +{ + GLboolean Enabled; + GLboolean _Enabled; /**< true if Enabled and multisample buffer */ + GLboolean SampleAlphaToCoverage; + GLboolean SampleAlphaToOne; + GLboolean SampleCoverage; + GLfloat SampleCoverageValue; + GLboolean SampleCoverageInvert; +}; + + +/** + * A pixelmap (see glPixelMap) + */ +struct gl_pixelmap +{ + GLint Size; + GLfloat Map[MAX_PIXEL_MAP_TABLE]; + GLubyte Map8[MAX_PIXEL_MAP_TABLE]; /**< converted to 8-bit color */ +}; + + +/** + * Collection of all pixelmaps + */ +struct gl_pixelmaps +{ + struct gl_pixelmap RtoR; /**< i.e. GL_PIXEL_MAP_R_TO_R */ + struct gl_pixelmap GtoG; + struct gl_pixelmap BtoB; + struct gl_pixelmap AtoA; + struct gl_pixelmap ItoR; + struct gl_pixelmap ItoG; + struct gl_pixelmap ItoB; + struct gl_pixelmap ItoA; + struct gl_pixelmap ItoI; + struct gl_pixelmap StoS; +}; + + +/** + * Pixel attribute group (GL_PIXEL_MODE_BIT). + */ +struct gl_pixel_attrib +{ + GLenum ReadBuffer; /**< source buffer for glRead/CopyPixels() */ + + /*--- Begin Pixel Transfer State ---*/ + /* Fields are in the order in which they're applied... */ + + /** Scale & Bias (index shift, offset) */ + /*@{*/ + GLfloat RedBias, RedScale; + GLfloat GreenBias, GreenScale; + GLfloat BlueBias, BlueScale; + GLfloat AlphaBias, AlphaScale; + GLfloat DepthBias, DepthScale; + GLint IndexShift, IndexOffset; + /*@}*/ + + /* Pixel Maps */ + /* Note: actual pixel maps are not part of this attrib group */ + GLboolean MapColorFlag; + GLboolean MapStencilFlag; + + /*--- End Pixel Transfer State ---*/ + + /** glPixelZoom */ + GLfloat ZoomX, ZoomY; + + /** GL_SGI_texture_color_table */ + GLfloat TextureColorTableScale[4]; /**< RGBA */ + GLfloat TextureColorTableBias[4]; /**< RGBA */ +}; + + +/** + * Point attribute group (GL_POINT_BIT). + */ +struct gl_point_attrib +{ + GLboolean SmoothFlag; /**< True if GL_POINT_SMOOTH is enabled */ + GLfloat Size; /**< User-specified point size */ + GLfloat Params[3]; /**< GL_EXT_point_parameters */ + GLfloat MinSize, MaxSize; /**< GL_EXT_point_parameters */ + GLfloat Threshold; /**< GL_EXT_point_parameters */ + GLboolean _Attenuated; /**< True if Params != [1, 0, 0] */ + GLboolean PointSprite; /**< GL_NV/ARB_point_sprite */ + GLboolean CoordReplace[MAX_TEXTURE_COORD_UNITS]; /**< GL_ARB_point_sprite*/ + GLenum SpriteRMode; /**< GL_NV_point_sprite (only!) */ + GLenum SpriteOrigin; /**< GL_ARB_point_sprite */ +}; + + +/** + * Polygon attribute group (GL_POLYGON_BIT). + */ +struct gl_polygon_attrib +{ + GLenum FrontFace; /**< Either GL_CW or GL_CCW */ + GLenum FrontMode; /**< Either GL_POINT, GL_LINE or GL_FILL */ + GLenum BackMode; /**< Either GL_POINT, GL_LINE or GL_FILL */ + GLboolean _FrontBit; /**< 0=GL_CCW, 1=GL_CW */ + GLboolean CullFlag; /**< Culling on/off flag */ + GLboolean SmoothFlag; /**< True if GL_POLYGON_SMOOTH is enabled */ + GLboolean StippleFlag; /**< True if GL_POLYGON_STIPPLE is enabled */ + GLenum CullFaceMode; /**< Culling mode GL_FRONT or GL_BACK */ + GLfloat OffsetFactor; /**< Polygon offset factor, from user */ + GLfloat OffsetUnits; /**< Polygon offset units, from user */ + GLboolean OffsetPoint; /**< Offset in GL_POINT mode */ + GLboolean OffsetLine; /**< Offset in GL_LINE mode */ + GLboolean OffsetFill; /**< Offset in GL_FILL mode */ +}; + + +/** + * Scissor attributes (GL_SCISSOR_BIT). + */ +struct gl_scissor_attrib +{ + GLboolean Enabled; /**< Scissor test enabled? */ + GLint X, Y; /**< Lower left corner of box */ + GLsizei Width, Height; /**< Size of box */ +}; + + +/** + * Stencil attribute group (GL_STENCIL_BUFFER_BIT). + * + * Three sets of stencil data are tracked so that OpenGL 2.0, + * GL_EXT_stencil_two_side, and GL_ATI_separate_stencil can all be supported + * simultaneously. In each of the stencil state arrays, element 0 corresponds + * to GL_FRONT. Element 1 corresponds to the OpenGL 2.0 / + * GL_ATI_separate_stencil GL_BACK state. Element 2 corresponds to the + * GL_EXT_stencil_two_side GL_BACK state. + * + * The derived value \c _BackFace is either 1 or 2 depending on whether or + * not GL_STENCIL_TEST_TWO_SIDE_EXT is enabled. + * + * The derived value \c _TestTwoSide is set when the front-face and back-face + * stencil state are different. + */ +struct gl_stencil_attrib +{ + GLboolean Enabled; /**< Enabled flag */ + GLboolean TestTwoSide; /**< GL_EXT_stencil_two_side */ + GLubyte ActiveFace; /**< GL_EXT_stencil_two_side (0 or 2) */ + GLboolean _Enabled; /**< Enabled and stencil buffer present */ + GLboolean _TestTwoSide; + GLubyte _BackFace; /**< Current back stencil state (1 or 2) */ + GLenum Function[3]; /**< Stencil function */ + GLenum FailFunc[3]; /**< Fail function */ + GLenum ZPassFunc[3]; /**< Depth buffer pass function */ + GLenum ZFailFunc[3]; /**< Depth buffer fail function */ + GLint Ref[3]; /**< Reference value */ + GLuint ValueMask[3]; /**< Value mask */ + GLuint WriteMask[3]; /**< Write mask */ + GLuint Clear; /**< Clear value */ +}; + + +/** + * An index for each type of texture object. These correspond to the GL + * texture target enums, such as GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP, etc. + * Note: the order is from highest priority to lowest priority. + */ +typedef enum +{ + TEXTURE_2D_ARRAY_INDEX, + TEXTURE_1D_ARRAY_INDEX, + TEXTURE_CUBE_INDEX, + TEXTURE_3D_INDEX, + TEXTURE_RECT_INDEX, + TEXTURE_2D_INDEX, + TEXTURE_1D_INDEX, + NUM_TEXTURE_TARGETS +} gl_texture_index; + + +/** + * Bit flags for each type of texture object + * Used for Texture.Unit[]._ReallyEnabled flags. + */ +/*@{*/ +#define TEXTURE_2D_ARRAY_BIT (1 << TEXTURE_2D_ARRAY_INDEX) +#define TEXTURE_1D_ARRAY_BIT (1 << TEXTURE_1D_ARRAY_INDEX) +#define TEXTURE_CUBE_BIT (1 << TEXTURE_CUBE_INDEX) +#define TEXTURE_3D_BIT (1 << TEXTURE_3D_INDEX) +#define TEXTURE_RECT_BIT (1 << TEXTURE_RECT_INDEX) +#define TEXTURE_2D_BIT (1 << TEXTURE_2D_INDEX) +#define TEXTURE_1D_BIT (1 << TEXTURE_1D_INDEX) +/*@}*/ + + +/** + * TexGenEnabled flags. + */ +/*@{*/ +#define S_BIT 1 +#define T_BIT 2 +#define R_BIT 4 +#define Q_BIT 8 +#define STR_BITS (S_BIT | T_BIT | R_BIT) +/*@}*/ + + +/** + * Bit flag versions of the corresponding GL_ constants. + */ +/*@{*/ +#define TEXGEN_SPHERE_MAP 0x1 +#define TEXGEN_OBJ_LINEAR 0x2 +#define TEXGEN_EYE_LINEAR 0x4 +#define TEXGEN_REFLECTION_MAP_NV 0x8 +#define TEXGEN_NORMAL_MAP_NV 0x10 + +#define TEXGEN_NEED_NORMALS (TEXGEN_SPHERE_MAP | \ + TEXGEN_REFLECTION_MAP_NV | \ + TEXGEN_NORMAL_MAP_NV) +#define TEXGEN_NEED_EYE_COORD (TEXGEN_SPHERE_MAP | \ + TEXGEN_REFLECTION_MAP_NV | \ + TEXGEN_NORMAL_MAP_NV | \ + TEXGEN_EYE_LINEAR) +/*@}*/ + + + +/** Tex-gen enabled for texture unit? */ +#define ENABLE_TEXGEN(unit) (1 << (unit)) + +/** Non-identity texture matrix for texture unit? */ +#define ENABLE_TEXMAT(unit) (1 << (unit)) + + +/** + * Texel fetch function prototype. We use texel fetch functions to + * extract RGBA, color indexes and depth components out of 1D, 2D and 3D + * texture images. These functions help to isolate us from the gritty + * details of all the various texture image encodings. + * + * \param texImage texture image. + * \param col texel column. + * \param row texel row. + * \param img texel image level/layer. + * \param texelOut output texel (up to 4 GLchans) + */ +typedef void (*FetchTexelFuncC)( const struct gl_texture_image *texImage, + GLint col, GLint row, GLint img, + GLchan *texelOut ); + +/** + * As above, but returns floats. + * Used for depth component images and for upcoming signed/float + * texture images. + */ +typedef void (*FetchTexelFuncF)( const struct gl_texture_image *texImage, + GLint col, GLint row, GLint img, + GLfloat *texelOut ); + + +typedef void (*StoreTexelFunc)(struct gl_texture_image *texImage, + GLint col, GLint row, GLint img, + const void *texel); + + +/** + * Texture image state. Describes the dimensions of a texture image, + * the texel format and pointers to Texel Fetch functions. + */ +struct gl_texture_image +{ + GLint InternalFormat; /**< Internal format as given by the user */ + GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_ALPHA, + * GL_LUMINANCE, GL_LUMINANCE_ALPHA, + * GL_INTENSITY, GL_COLOR_INDEX, + * GL_DEPTH_COMPONENT or GL_DEPTH_STENCIL_EXT + * only. Used for choosing TexEnv arithmetic. + */ + gl_format TexFormat; /**< The actual texture memory format */ + + GLuint Border; /**< 0 or 1 */ + GLuint Width; /**< = 2^WidthLog2 + 2*Border */ + GLuint Height; /**< = 2^HeightLog2 + 2*Border */ + GLuint Depth; /**< = 2^DepthLog2 + 2*Border */ + GLuint Width2; /**< = Width - 2*Border */ + GLuint Height2; /**< = Height - 2*Border */ + GLuint Depth2; /**< = Depth - 2*Border */ + GLuint WidthLog2; /**< = log2(Width2) */ + GLuint HeightLog2; /**< = log2(Height2) */ + GLuint DepthLog2; /**< = log2(Depth2) */ + GLuint MaxLog2; /**< = MAX(WidthLog2, HeightLog2) */ + GLfloat WidthScale; /**< used for mipmap LOD computation */ + GLfloat HeightScale; /**< used for mipmap LOD computation */ + GLfloat DepthScale; /**< used for mipmap LOD computation */ + GLboolean IsClientData; /**< Data owned by client? */ + GLboolean _IsPowerOfTwo; /**< Are all dimensions powers of two? */ + + struct gl_texture_object *TexObject; /**< Pointer back to parent object */ + + FetchTexelFuncC FetchTexelc; /**< GLchan texel fetch function pointer */ + FetchTexelFuncF FetchTexelf; /**< Float texel fetch function pointer */ + + GLuint RowStride; /**< Padded width in units of texels */ + GLuint *ImageOffsets; /**< if 3D texture: array [Depth] of offsets to + each 2D slice in 'Data', in texels */ + GLvoid *Data; /**< Image data, accessed via FetchTexel() */ + + /** + * \name For device driver: + */ + /*@{*/ + void *DriverData; /**< Arbitrary device driver data */ + /*@}*/ +}; + + +/** + * Indexes for cube map faces. + */ +typedef enum +{ + FACE_POS_X = 0, + FACE_NEG_X = 1, + FACE_POS_Y = 2, + FACE_NEG_Y = 3, + FACE_POS_Z = 4, + FACE_NEG_Z = 5, + MAX_FACES = 6 +} gl_face_index; + + +/** + * Texture object state. Contains the array of mipmap images, border color, + * wrap modes, filter modes, shadow/texcompare state, and the per-texture + * color palette. + */ +struct gl_texture_object +{ + _glthread_Mutex Mutex; /**< for thread safety */ + GLint RefCount; /**< reference count */ + GLuint Name; /**< the user-visible texture object ID */ + GLenum Target; /**< GL_TEXTURE_1D, GL_TEXTURE_2D, etc. */ + GLfloat Priority; /**< in [0,1] */ + union { + GLfloat f[4]; + GLuint ui[4]; + GLint i[4]; + } BorderColor; /**< Interpreted according to texture format */ + GLenum WrapS; /**< S-axis texture image wrap mode */ + GLenum WrapT; /**< T-axis texture image wrap mode */ + GLenum WrapR; /**< R-axis texture image wrap mode */ + GLenum MinFilter; /**< minification filter */ + GLenum MagFilter; /**< magnification filter */ + GLfloat MinLod; /**< min lambda, OpenGL 1.2 */ + GLfloat MaxLod; /**< max lambda, OpenGL 1.2 */ + GLfloat LodBias; /**< OpenGL 1.4 */ + GLint BaseLevel; /**< min mipmap level, OpenGL 1.2 */ + GLint MaxLevel; /**< max mipmap level, OpenGL 1.2 */ + GLfloat MaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ + GLenum CompareMode; /**< GL_ARB_shadow */ + GLenum CompareFunc; /**< GL_ARB_shadow */ + GLfloat CompareFailValue; /**< GL_ARB_shadow_ambient */ + GLenum DepthMode; /**< GL_ARB_depth_texture */ + GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */ + GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - b in spec) */ + GLint CropRect[4]; /**< GL_OES_draw_texture */ + GLenum Swizzle[4]; /**< GL_EXT_texture_swizzle */ + GLuint _Swizzle; /**< same as Swizzle, but SWIZZLE_* format */ + GLboolean GenerateMipmap; /**< GL_SGIS_generate_mipmap */ + GLboolean _Complete; /**< Is texture object complete? */ + GLboolean _RenderToTexture; /**< Any rendering to this texture? */ + GLboolean Purgeable; /**< Is the buffer purgeable under memory pressure? */ + GLenum sRGBDecode; /**< GL_DECODE_EXT or GL_SKIP_DECODE_EXT */ + + /** Actual texture images, indexed by [cube face] and [mipmap level] */ + struct gl_texture_image *Image[MAX_FACES][MAX_TEXTURE_LEVELS]; + + /** GL_EXT_paletted_texture */ + struct gl_color_table Palette; + + /** + * \name For device driver. + * Note: instead of attaching driver data to this pointer, it's preferable + * to instead use this struct as a base class for your own texture object + * class. Driver->NewTextureObject() can be used to implement the + * allocation. + */ + void *DriverData; /**< Arbitrary device driver data */ +}; + + +/** Up to four combiner sources are possible with GL_NV_texture_env_combine4 */ +#define MAX_COMBINER_TERMS 4 + + +/** + * Texture combine environment state. + */ +struct gl_tex_env_combine_state +{ + GLenum ModeRGB; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */ + GLenum ModeA; /**< GL_REPLACE, GL_DECAL, GL_ADD, etc. */ + /** Source terms: GL_PRIMARY_COLOR, GL_TEXTURE, etc */ + GLenum SourceRGB[MAX_COMBINER_TERMS]; + GLenum SourceA[MAX_COMBINER_TERMS]; + /** Source operands: GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, etc */ + GLenum OperandRGB[MAX_COMBINER_TERMS]; + GLenum OperandA[MAX_COMBINER_TERMS]; + GLuint ScaleShiftRGB; /**< 0, 1 or 2 */ + GLuint ScaleShiftA; /**< 0, 1 or 2 */ + GLuint _NumArgsRGB; /**< Number of inputs used for the RGB combiner */ + GLuint _NumArgsA; /**< Number of inputs used for the A combiner */ +}; + + +/** + * Texture coord generation state. + */ +struct gl_texgen +{ + GLenum Mode; /**< GL_EYE_LINEAR, GL_SPHERE_MAP, etc */ + GLbitfield _ModeBit; /**< TEXGEN_x bit corresponding to Mode */ + GLfloat ObjectPlane[4]; + GLfloat EyePlane[4]; +}; + + +/** + * Texture unit state. Contains enable flags, texture environment/function/ + * combiners, texgen state, pointers to current texture objects and + * post-filter color tables. + */ +struct gl_texture_unit +{ + GLbitfield Enabled; /**< bitmask of TEXTURE_*_BIT flags */ + GLbitfield _ReallyEnabled; /**< 0 or exactly one of TEXTURE_*_BIT flags */ + + GLenum EnvMode; /**< GL_MODULATE, GL_DECAL, GL_BLEND, etc. */ + GLfloat EnvColor[4]; + + struct gl_texgen GenS; + struct gl_texgen GenT; + struct gl_texgen GenR; + struct gl_texgen GenQ; + GLbitfield TexGenEnabled; /**< Bitwise-OR of [STRQ]_BIT values */ + GLbitfield _GenFlags; /**< Bitwise-OR of Gen[STRQ]._ModeBit */ + + GLfloat LodBias; /**< for biasing mipmap levels */ + GLenum BumpTarget; + GLfloat RotMatrix[4]; /* 2x2 matrix */ + + /** + * \name GL_EXT_texture_env_combine + */ + struct gl_tex_env_combine_state Combine; + + /** + * Derived state based on \c EnvMode and the \c BaseFormat of the + * currently enabled texture. + */ + struct gl_tex_env_combine_state _EnvMode; + + /** + * Currently enabled combiner state. This will point to either + * \c Combine or \c _EnvMode. + */ + struct gl_tex_env_combine_state *_CurrentCombine; + + /** Current texture object pointers */ + struct gl_texture_object *CurrentTex[NUM_TEXTURE_TARGETS]; + + /** Points to highest priority, complete and enabled texture object */ + struct gl_texture_object *_Current; + + /** GL_SGI_texture_color_table */ + /*@{*/ + struct gl_color_table ColorTable; + struct gl_color_table ProxyColorTable; + GLboolean ColorTableEnabled; + /*@}*/ +}; + + +/** + * Texture attribute group (GL_TEXTURE_BIT). + */ +struct gl_texture_attrib +{ + GLuint CurrentUnit; /**< GL_ACTIVE_TEXTURE */ + struct gl_texture_unit Unit[MAX_COMBINED_TEXTURE_IMAGE_UNITS]; + + struct gl_texture_object *ProxyTex[NUM_TEXTURE_TARGETS]; + + /** GL_ARB_seamless_cubemap */ + GLboolean CubeMapSeamless; + + /** GL_EXT_shared_texture_palette */ + GLboolean SharedPalette; + struct gl_color_table Palette; + + /** Texture units/samplers used by vertex or fragment texturing */ + GLbitfield _EnabledUnits; + + /** Texture coord units/sets used for fragment texturing */ + GLbitfield _EnabledCoordUnits; + + /** Texture coord units that have texgen enabled */ + GLbitfield _TexGenEnabled; + + /** Texture coord units that have non-identity matrices */ + GLbitfield _TexMatEnabled; + + /** Bitwise-OR of all Texture.Unit[i]._GenFlags */ + GLbitfield _GenFlags; +}; + + +/** + * Transformation attribute group (GL_TRANSFORM_BIT). + */ +struct gl_transform_attrib +{ + GLenum MatrixMode; /**< Matrix mode */ + GLfloat EyeUserPlane[MAX_CLIP_PLANES][4]; /**< User clip planes */ + GLfloat _ClipUserPlane[MAX_CLIP_PLANES][4]; /**< derived */ + GLbitfield ClipPlanesEnabled; /**< on/off bitmask */ + GLboolean Normalize; /**< Normalize all normals? */ + GLboolean RescaleNormals; /**< GL_EXT_rescale_normal */ + GLboolean RasterPositionUnclipped; /**< GL_IBM_rasterpos_clip */ + GLboolean DepthClamp; /**< GL_ARB_depth_clamp */ + + GLfloat CullEyePos[4]; + GLfloat CullObjPos[4]; +}; + + +/** + * Viewport attribute group (GL_VIEWPORT_BIT). + */ +struct gl_viewport_attrib +{ + GLint X, Y; /**< position */ + GLsizei Width, Height; /**< size */ + GLfloat Near, Far; /**< Depth buffer range */ + GLmatrix _WindowMap; /**< Mapping transformation as a matrix. */ +}; + + +/** + * GL_ARB_vertex/pixel_buffer_object buffer object + */ +struct gl_buffer_object +{ + _glthread_Mutex Mutex; + GLint RefCount; + GLuint Name; + GLenum Usage; /**< GL_STREAM_DRAW_ARB, GL_STREAM_READ_ARB, etc. */ + GLsizeiptrARB Size; /**< Size of buffer storage in bytes */ + GLubyte *Data; /**< Location of storage either in RAM or VRAM. */ + /** Fields describing a mapped buffer */ + /*@{*/ + GLbitfield AccessFlags; /**< Mask of GL_MAP_x_BIT flags */ + GLvoid *Pointer; /**< User-space address of mapping */ + GLintptr Offset; /**< Mapped offset */ + GLsizeiptr Length; /**< Mapped length */ + /*@}*/ + GLboolean Written; /**< Ever written to? (for debugging) */ + GLboolean Purgeable; /**< Is the buffer purgeable under memory pressure? */ +}; + + +/** + * Client pixel packing/unpacking attributes + */ +struct gl_pixelstore_attrib +{ + GLint Alignment; + GLint RowLength; + GLint SkipPixels; + GLint SkipRows; + GLint ImageHeight; + GLint SkipImages; + GLboolean SwapBytes; + GLboolean LsbFirst; + GLboolean ClientStorage; /**< GL_APPLE_client_storage */ + GLboolean Invert; /**< GL_MESA_pack_invert */ + struct gl_buffer_object *BufferObj; /**< GL_ARB_pixel_buffer_object */ +}; + + +/** + * Client vertex array attributes + */ +struct gl_client_array +{ + GLint Size; /**< components per element (1,2,3,4) */ + GLenum Type; /**< datatype: GL_FLOAT, GL_INT, etc */ + GLenum Format; /**< default: GL_RGBA, but may be GL_BGRA */ + GLsizei Stride; /**< user-specified stride */ + GLsizei StrideB; /**< actual stride in bytes */ + const GLubyte *Ptr; /**< Points to array data */ + GLboolean Enabled; /**< Enabled flag is a boolean */ + GLboolean Normalized; /**< GL_ARB_vertex_program */ + GLboolean Integer; /**< Integer-valued? */ + GLuint InstanceDivisor; /**< GL_ARB_instanced_arrays */ + GLuint _ElementSize; /**< size of each element in bytes */ + + struct gl_buffer_object *BufferObj;/**< GL_ARB_vertex_buffer_object */ + GLuint _MaxElement; /**< max element index into array buffer + 1 */ +}; + + +/** + * Collection of vertex arrays. Defined by the GL_APPLE_vertex_array_object + * extension, but a nice encapsulation in any case. + */ +struct gl_array_object +{ + /** Name of the array object as received from glGenVertexArrayAPPLE. */ + GLuint Name; + + GLint RefCount; + _glthread_Mutex Mutex; + GLboolean VBOonly; /**< require all arrays to live in VBOs? */ + + /** Conventional vertex arrays */ + /*@{*/ + struct gl_client_array Vertex; + struct gl_client_array Weight; + struct gl_client_array Normal; + struct gl_client_array Color; + struct gl_client_array SecondaryColor; + struct gl_client_array FogCoord; + struct gl_client_array Index; + struct gl_client_array EdgeFlag; + struct gl_client_array TexCoord[MAX_TEXTURE_COORD_UNITS]; + struct gl_client_array PointSize; + /*@}*/ + + /** + * Generic arrays for vertex programs/shaders. + * For NV vertex programs, these attributes alias and take priority + * over the conventional attribs above. For ARB vertex programs and + * GLSL vertex shaders, these attributes are separate. + */ + struct gl_client_array VertexAttrib[MAX_VERTEX_GENERIC_ATTRIBS]; + + /** Mask of _NEW_ARRAY_* values indicating which arrays are enabled */ + GLbitfield _Enabled; + + /** + * Min of all enabled arrays' _MaxElement. When arrays reside inside VBOs + * we can determine the max legal (in bounds) glDrawElements array index. + */ + GLuint _MaxElement; +}; + + +/** + * Vertex array state + */ +struct gl_array_attrib +{ + /** Currently bound array object. See _mesa_BindVertexArrayAPPLE() */ + struct gl_array_object *ArrayObj; + + /** The default vertex array object */ + struct gl_array_object *DefaultArrayObj; + + /** Array objects (GL_ARB/APPLE_vertex_array_object) */ + struct _mesa_HashTable *Objects; + + GLint ActiveTexture; /**< Client Active Texture */ + GLuint LockFirst; /**< GL_EXT_compiled_vertex_array */ + GLuint LockCount; /**< GL_EXT_compiled_vertex_array */ + + /** GL 3.1 (slightly different from GL_NV_primitive_restart) */ + GLboolean PrimitiveRestart; + GLuint RestartIndex; + + GLbitfield NewState; /**< mask of _NEW_ARRAY_* values */ + GLboolean RebindArrays; /**< whether the VBO module should rebind arrays */ + + /* GL_ARB_vertex_buffer_object */ + struct gl_buffer_object *ArrayBufferObj; + struct gl_buffer_object *ElementArrayBufferObj; +}; + + +/** + * Feedback buffer state + */ +struct gl_feedback +{ + GLenum Type; + GLbitfield _Mask; /**< FB_* bits */ + GLfloat *Buffer; + GLuint BufferSize; + GLuint Count; +}; + + +/** + * Selection buffer state + */ +struct gl_selection +{ + GLuint *Buffer; /**< selection buffer */ + GLuint BufferSize; /**< size of the selection buffer */ + GLuint BufferCount; /**< number of values in the selection buffer */ + GLuint Hits; /**< number of records in the selection buffer */ + GLuint NameStackDepth; /**< name stack depth */ + GLuint NameStack[MAX_NAME_STACK_DEPTH]; /**< name stack */ + GLboolean HitFlag; /**< hit flag */ + GLfloat HitMinZ; /**< minimum hit depth */ + GLfloat HitMaxZ; /**< maximum hit depth */ +}; + + +/** + * 1-D Evaluator control points + */ +struct gl_1d_map +{ + GLuint Order; /**< Number of control points */ + GLfloat u1, u2, du; /**< u1, u2, 1.0/(u2-u1) */ + GLfloat *Points; /**< Points to contiguous control points */ +}; + + +/** + * 2-D Evaluator control points + */ +struct gl_2d_map +{ + GLuint Uorder; /**< Number of control points in U dimension */ + GLuint Vorder; /**< Number of control points in V dimension */ + GLfloat u1, u2, du; + GLfloat v1, v2, dv; + GLfloat *Points; /**< Points to contiguous control points */ +}; + + +/** + * All evaluator control point state + */ +struct gl_evaluators +{ + /** + * \name 1-D maps + */ + /*@{*/ + struct gl_1d_map Map1Vertex3; + struct gl_1d_map Map1Vertex4; + struct gl_1d_map Map1Index; + struct gl_1d_map Map1Color4; + struct gl_1d_map Map1Normal; + struct gl_1d_map Map1Texture1; + struct gl_1d_map Map1Texture2; + struct gl_1d_map Map1Texture3; + struct gl_1d_map Map1Texture4; + struct gl_1d_map Map1Attrib[16]; /**< GL_NV_vertex_program */ + /*@}*/ + + /** + * \name 2-D maps + */ + /*@{*/ + struct gl_2d_map Map2Vertex3; + struct gl_2d_map Map2Vertex4; + struct gl_2d_map Map2Index; + struct gl_2d_map Map2Color4; + struct gl_2d_map Map2Normal; + struct gl_2d_map Map2Texture1; + struct gl_2d_map Map2Texture2; + struct gl_2d_map Map2Texture3; + struct gl_2d_map Map2Texture4; + struct gl_2d_map Map2Attrib[16]; /**< GL_NV_vertex_program */ + /*@}*/ +}; + + +/** + * Names of the various vertex/fragment program register files, etc. + * + * NOTE: first four tokens must fit into 2 bits (see t_vb_arbprogram.c) + * All values should fit in a 4-bit field. + * + * NOTE: PROGRAM_ENV_PARAM, PROGRAM_STATE_VAR, PROGRAM_NAMED_PARAM, + * PROGRAM_CONSTANT, and PROGRAM_UNIFORM can all be considered to + * be "uniform" variables since they can only be set outside glBegin/End. + * They're also all stored in the same Parameters array. + */ +typedef enum +{ + PROGRAM_TEMPORARY, /**< machine->Temporary[] */ + PROGRAM_INPUT, /**< machine->Inputs[] */ + PROGRAM_OUTPUT, /**< machine->Outputs[] */ + PROGRAM_VARYING, /**< machine->Inputs[]/Outputs[] */ + PROGRAM_LOCAL_PARAM, /**< gl_program->LocalParams[] */ + PROGRAM_ENV_PARAM, /**< gl_program->Parameters[] */ + PROGRAM_STATE_VAR, /**< gl_program->Parameters[] */ + PROGRAM_NAMED_PARAM, /**< gl_program->Parameters[] */ + PROGRAM_CONSTANT, /**< gl_program->Parameters[] */ + PROGRAM_UNIFORM, /**< gl_program->Parameters[] */ + PROGRAM_WRITE_ONLY, /**< A dummy, write-only register */ + PROGRAM_ADDRESS, /**< machine->AddressReg */ + PROGRAM_SAMPLER, /**< for shader samplers, compile-time only */ + PROGRAM_SYSTEM_VALUE,/**< InstanceId, PrimitiveID, etc. */ + PROGRAM_UNDEFINED, /**< Invalid/TBD value */ + PROGRAM_FILE_MAX +} gl_register_file; + + +/** + * If the register file is PROGRAM_SYSTEM_VALUE, the register index will be + * one of these values. + */ +typedef enum +{ + SYSTEM_VALUE_FRONT_FACE, /**< Fragment shader only (not done yet) */ + SYSTEM_VALUE_INSTANCE_ID, /**< Vertex shader only */ + SYSTEM_VALUE_MAX /**< Number of values */ +} gl_system_value; + + +/** Vertex and fragment instructions */ +struct prog_instruction; +struct gl_program_parameter_list; +struct gl_uniform_list; + + +/** + * Base class for any kind of program object + */ +struct gl_program +{ + GLuint Id; + GLubyte *String; /**< Null-terminated program text */ + GLint RefCount; + GLenum Target; /**< GL_VERTEX/FRAGMENT_PROGRAM_ARB, GL_FRAGMENT_PROGRAM_NV */ + GLenum Format; /**< String encoding format */ + GLboolean Resident; + + struct prog_instruction *Instructions; + + GLbitfield InputsRead; /**< Bitmask of which input regs are read */ + GLbitfield64 OutputsWritten; /**< Bitmask of which output regs are written */ + GLbitfield SystemValuesRead; /**< Bitmask of SYSTEM_VALUE_x inputs used */ + GLbitfield InputFlags[MAX_PROGRAM_INPUTS]; /**< PROG_PARAM_BIT_x flags */ + GLbitfield OutputFlags[MAX_PROGRAM_OUTPUTS]; /**< PROG_PARAM_BIT_x flags */ + GLbitfield TexturesUsed[MAX_TEXTURE_UNITS]; /**< TEXTURE_x_BIT bitmask */ + GLbitfield SamplersUsed; /**< Bitfield of which samplers are used */ + GLbitfield ShadowSamplers; /**< Texture units used for shadow sampling. */ + + + /** Named parameters, constants, etc. from program text */ + struct gl_program_parameter_list *Parameters; + /** Numbered local parameters */ + GLfloat LocalParams[MAX_PROGRAM_LOCAL_PARAMS][4]; + + /** Vertex/fragment shader varying vars */ + struct gl_program_parameter_list *Varying; + /** Vertex program user-defined attributes */ + struct gl_program_parameter_list *Attributes; + + /** Map from sampler unit to texture unit (set by glUniform1i()) */ + GLubyte SamplerUnits[MAX_SAMPLERS]; + /** Which texture target is being sampled (TEXTURE_1D/2D/3D/etc_INDEX) */ + gl_texture_index SamplerTargets[MAX_SAMPLERS]; + + /** Bitmask of which register files are read/written with indirect + * addressing. Mask of (1 << PROGRAM_x) bits. + */ + GLbitfield IndirectRegisterFiles; + + /** Logical counts */ + /*@{*/ + GLuint NumInstructions; + GLuint NumTemporaries; + GLuint NumParameters; + GLuint NumAttributes; + GLuint NumAddressRegs; + GLuint NumAluInstructions; + GLuint NumTexInstructions; + GLuint NumTexIndirections; + /*@}*/ + /** Native, actual h/w counts */ + /*@{*/ + GLuint NumNativeInstructions; + GLuint NumNativeTemporaries; + GLuint NumNativeParameters; + GLuint NumNativeAttributes; + GLuint NumNativeAddressRegs; + GLuint NumNativeAluInstructions; + GLuint NumNativeTexInstructions; + GLuint NumNativeTexIndirections; + /*@}*/ +}; + + +/** Vertex program object */ +struct gl_vertex_program +{ + struct gl_program Base; /**< base class */ + GLboolean IsNVProgram; /**< is this a GL_NV_vertex_program program? */ + GLboolean IsPositionInvariant; +}; + + +/** Geometry program object */ +struct gl_geometry_program +{ + struct gl_program Base; /**< base class */ + + GLint VerticesOut; + GLenum InputType; /**< GL_POINTS, GL_LINES, GL_LINES_ADJACENCY_ARB, + GL_TRIANGLES, or GL_TRIANGLES_ADJACENCY_ARB */ + GLenum OutputType; /**< GL_POINTS, GL_LINE_STRIP or GL_TRIANGLE_STRIP */ +}; + + +/** Fragment program object */ +struct gl_fragment_program +{ + struct gl_program Base; /**< base class */ + GLenum FogOption; + GLboolean UsesKill; /**< shader uses KIL instruction */ + GLboolean OriginUpperLeft; + GLboolean PixelCenterInteger; + enum gl_frag_depth_layout FragDepthLayout; +}; + + +/** + * State common to vertex and fragment programs. + */ +struct gl_program_state +{ + GLint ErrorPos; /* GL_PROGRAM_ERROR_POSITION_ARB/NV */ + const char *ErrorString; /* GL_PROGRAM_ERROR_STRING_ARB/NV */ +}; + + +/** + * Context state for vertex programs. + */ +struct gl_vertex_program_state +{ + GLboolean Enabled; /**< User-set GL_VERTEX_PROGRAM_ARB/NV flag */ + 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 */ + struct gl_vertex_program *Current; /**< User-bound vertex program */ + + /** Currently enabled and valid vertex program (including internal + * programs, user-defined vertex programs and GLSL vertex shaders). + * This is the program we must use when rendering. + */ + struct gl_vertex_program *_Current; + + GLfloat Parameters[MAX_PROGRAM_ENV_PARAMS][4]; /**< Env params */ + + /* For GL_NV_vertex_program only: */ + GLenum TrackMatrix[MAX_PROGRAM_ENV_PARAMS / 4]; + GLenum TrackMatrixTransform[MAX_PROGRAM_ENV_PARAMS / 4]; + + /** Should fixed-function T&L be implemented with a vertex prog? */ + GLboolean _MaintainTnlProgram; + + /** Program to emulate fixed-function T&L (see above) */ + struct gl_vertex_program *_TnlProgram; + + /** Cache of fixed-function programs */ + struct gl_program_cache *Cache; + + GLboolean _Overriden; +}; + + +/** + * Context state for geometry programs. + */ +struct gl_geometry_program_state +{ + GLboolean Enabled; /**< GL_ARB_GEOMETRY_SHADER4 */ + GLboolean _Enabled; /**< Enabled and valid program? */ + struct gl_geometry_program *Current; /**< user-bound geometry program */ + + /** Currently enabled and valid program (including internal programs + * and compiled shader programs). + */ + struct gl_geometry_program *_Current; + + GLfloat Parameters[MAX_PROGRAM_ENV_PARAMS][4]; /**< Env params */ + + /** Cache of fixed-function programs */ + struct gl_program_cache *Cache; +}; + +/** + * Context state for fragment programs. + */ +struct gl_fragment_program_state +{ + GLboolean Enabled; /**< User-set fragment program enable flag */ + GLboolean _Enabled; /**< Enabled and _valid_ user program? */ + struct gl_fragment_program *Current; /**< User-bound fragment program */ + + /** Currently enabled and valid fragment program (including internal + * programs, user-defined fragment programs and GLSL fragment shaders). + * This is the program we must use when rendering. + */ + struct gl_fragment_program *_Current; + + GLfloat Parameters[MAX_PROGRAM_ENV_PARAMS][4]; /**< Env params */ + + /** Should fixed-function texturing be implemented with a fragment prog? */ + GLboolean _MaintainTexEnvProgram; + + /** Program to emulate fixed-function texture env/combine (see above) */ + struct gl_fragment_program *_TexEnvProgram; + + /** Cache of fixed-function programs */ + struct gl_program_cache *Cache; +}; + + +/** + * ATI_fragment_shader runtime state + */ +#define ATI_FS_INPUT_PRIMARY 0 +#define ATI_FS_INPUT_SECONDARY 1 + +struct atifs_instruction; +struct atifs_setupinst; + +/** + * ATI fragment shader + */ +struct ati_fragment_shader +{ + GLuint Id; + GLint RefCount; + struct atifs_instruction *Instructions[2]; + struct atifs_setupinst *SetupInst[2]; + GLfloat Constants[8][4]; + GLbitfield LocalConstDef; /**< Indicates which constants have been set */ + GLubyte numArithInstr[2]; + GLubyte regsAssigned[2]; + GLubyte NumPasses; /**< 1 or 2 */ + GLubyte cur_pass; + GLubyte last_optype; + GLboolean interpinp1; + GLboolean isValid; + GLuint swizzlerq; +}; + +/** + * Context state for GL_ATI_fragment_shader + */ +struct gl_ati_fragment_shader_state +{ + GLboolean Enabled; + GLboolean _Enabled; /**< enabled and valid shader? */ + GLboolean Compiling; + GLfloat GlobalConstants[8][4]; + struct ati_fragment_shader *Current; +}; + + +/** + * Occlusion/timer query object. + */ +struct gl_query_object +{ + GLenum Target; /**< The query target, when active */ + GLuint Id; /**< hash table ID/name */ + GLuint64EXT Result; /**< the counter */ + GLboolean Active; /**< inside Begin/EndQuery */ + GLboolean Ready; /**< result is ready? */ +}; + + +/** + * Context state for query objects. + */ +struct gl_query_state +{ + struct _mesa_HashTable *QueryObjects; + struct gl_query_object *CurrentOcclusionObject; /* GL_ARB_occlusion_query */ + struct gl_query_object *CurrentTimerObject; /* GL_EXT_timer_query */ + + /** GL_NV_conditional_render */ + struct gl_query_object *CondRenderQuery; + + /** GL_EXT_transform_feedback */ + struct gl_query_object *PrimitivesGenerated; + struct gl_query_object *PrimitivesWritten; + + /** GL_ARB_timer_query */ + struct gl_query_object *TimeElapsed; + + GLenum CondRenderMode; +}; + + +/** Sync object state */ +struct gl_sync_object { + struct simple_node link; + GLenum Type; /**< GL_SYNC_FENCE */ + GLuint Name; /**< Fence name */ + GLint RefCount; /**< Reference count */ + GLboolean DeletePending; /**< Object was deleted while there were still + * live references (e.g., sync not yet finished) + */ + GLenum SyncCondition; + GLbitfield Flags; /**< Flags passed to glFenceSync */ + GLuint StatusFlag:1; /**< Has the sync object been signaled? */ +}; + + +/** Set by #pragma directives */ +struct gl_sl_pragmas +{ + GLboolean IgnoreOptimize; /**< ignore #pragma optimize(on/off) ? */ + GLboolean IgnoreDebug; /**< ignore #pragma debug(on/off) ? */ + GLboolean Optimize; /**< defaults on */ + GLboolean Debug; /**< defaults off */ +}; + + +/** + * A GLSL vertex or fragment shader object. + */ +struct gl_shader +{ + GLenum Type; /**< GL_FRAGMENT_SHADER || GL_VERTEX_SHADER || GL_GEOMETRY_SHADER_ARB (first field!) */ + GLuint Name; /**< AKA the handle */ + GLint RefCount; /**< Reference count */ + GLboolean DeletePending; + GLboolean CompileStatus; + const GLchar *Source; /**< Source code string */ + GLuint SourceChecksum; /**< for debug/logging purposes */ + struct gl_program *Program; /**< Post-compile assembly code */ + GLchar *InfoLog; + struct gl_sl_pragmas Pragmas; + + unsigned Version; /**< GLSL version used for linking */ + + struct exec_list *ir; + struct glsl_symbol_table *symbols; + + /** Shaders containing built-in functions that are used for linking. */ + struct gl_shader *builtins_to_link[16]; + unsigned num_builtins_to_link; +}; + + +/** + * A GLSL program object. + * Basically a linked collection of vertex and fragment shaders. + */ +struct gl_shader_program +{ + GLenum Type; /**< Always GL_SHADER_PROGRAM (internal token) */ + GLuint Name; /**< aka handle or ID */ + GLint RefCount; /**< Reference count */ + GLboolean DeletePending; + + GLuint NumShaders; /**< number of attached shaders */ + struct gl_shader **Shaders; /**< List of attached the shaders */ + + /** User-defined attribute bindings (glBindAttribLocation) */ + struct gl_program_parameter_list *Attributes; + + /** Transform feedback varyings */ + struct { + GLenum BufferMode; + GLuint NumVarying; + GLchar **VaryingNames; /**< Array [NumVarying] of char * */ + } TransformFeedback; + + /** Geometry shader state - copied into gl_geometry_program at link time */ + struct { + GLint VerticesOut; + GLenum InputType; /**< GL_POINTS, GL_LINES, GL_LINES_ADJACENCY_ARB, + GL_TRIANGLES, or GL_TRIANGLES_ADJACENCY_ARB */ + GLenum OutputType; /**< GL_POINTS, GL_LINE_STRIP or GL_TRIANGLE_STRIP */ + } Geom; + + /* post-link info: */ + struct gl_vertex_program *VertexProgram; /**< Linked vertex program */ + struct gl_fragment_program *FragmentProgram; /**< Linked fragment prog */ + struct gl_geometry_program *GeometryProgram; /**< Linked geometry prog */ + struct gl_uniform_list *Uniforms; + struct gl_program_parameter_list *Varying; + GLboolean LinkStatus; /**< GL_LINK_STATUS */ + GLboolean Validated; + GLboolean _Used; /**< Ever used for drawing? */ + GLchar *InfoLog; + + unsigned Version; /**< GLSL version used for linking */ + + /** + * Per-stage shaders resulting from the first stage of linking. + * + * Set of linked shaders for this program. The array is accessed using the + * \c MESA_SHADER_* defines. Entries for non-existent stages will be + * \c NULL. + */ + struct gl_shader *_LinkedShaders[MESA_SHADER_TYPES]; +}; + + +#define GLSL_DUMP 0x1 /**< Dump shaders to stdout */ +#define GLSL_LOG 0x2 /**< Write shaders to files */ +#define GLSL_OPT 0x4 /**< Force optimizations (override pragmas) */ +#define GLSL_NO_OPT 0x8 /**< Force no optimizations (override pragmas) */ +#define GLSL_UNIFORMS 0x10 /**< Print glUniform calls */ +#define GLSL_NOP_VERT 0x20 /**< Force no-op vertex shaders */ +#define GLSL_NOP_FRAG 0x40 /**< Force no-op fragment shaders */ +#define GLSL_USE_PROG 0x80 /**< Log glUseProgram calls */ + + +/** + * Context state for GLSL vertex/fragment shaders. + */ +struct gl_shader_state +{ + /** + * Programs used for rendering + * + * There is a separate program set for each shader stage. If + * GL_EXT_separate_shader_objects is not supported, each of these must point + * to \c NULL or to the same program. + */ + struct gl_shader_program *CurrentVertexProgram; + struct gl_shader_program *CurrentGeometryProgram; + struct gl_shader_program *CurrentFragmentProgram; + + /** + * Program used by glUniform calls. + * + * Explicitly set by \c glUseProgram and \c glActiveProgramEXT. + */ + struct gl_shader_program *ActiveProgram; + + void *MemPool; + + GLbitfield Flags; /**< Mask of GLSL_x flags */ +}; + +/** + * Compiler options for a single GLSL shaders type + */ +struct gl_shader_compiler_options +{ + /** Driver-selectable options: */ + GLboolean EmitCondCodes; /**< Use condition codes? */ + GLboolean EmitNVTempInitialization; /**< 0-fill NV temp registers */ + /** + * Attempts to flatten all ir_if (OPCODE_IF) for GPUs that can't + * support control flow. + */ + GLboolean EmitNoIfs; + GLboolean EmitNoLoops; + GLboolean EmitNoFunctions; + GLboolean EmitNoCont; /**< Emit CONT opcode? */ + GLboolean EmitNoMainReturn; /**< Emit CONT/RET opcodes? */ + GLboolean EmitNoNoise; /**< Emit NOISE opcodes? */ + GLboolean EmitNoPow; /**< Emit POW opcodes? */ + + /** + * \name Forms of indirect addressing the driver cannot do. + */ + /*@{*/ + GLboolean EmitNoIndirectInput; /**< No indirect addressing of inputs */ + GLboolean EmitNoIndirectOutput; /**< No indirect addressing of outputs */ + GLboolean EmitNoIndirectTemp; /**< No indirect addressing of temps */ + GLboolean EmitNoIndirectUniform; /**< No indirect addressing of constants */ + /*@}*/ + + GLuint MaxUnrollIterations; + + struct gl_sl_pragmas DefaultPragmas; /**< Default #pragma settings */ +}; + +/** + * Transform feedback object state + */ +struct gl_transform_feedback_object +{ + GLuint Name; /**< AKA the object ID */ + GLint RefCount; + GLboolean Active; /**< Is transform feedback enabled? */ + GLboolean Paused; /**< Is transform feedback paused? */ + + /** The feedback buffers */ + GLuint BufferNames[MAX_FEEDBACK_ATTRIBS]; + struct gl_buffer_object *Buffers[MAX_FEEDBACK_ATTRIBS]; + + /** Start of feedback data in dest buffer */ + GLintptr Offset[MAX_FEEDBACK_ATTRIBS]; + /** Max data to put into dest buffer (in bytes) */ + GLsizeiptr Size[MAX_FEEDBACK_ATTRIBS]; +}; + + +/** + * Context state for transform feedback. + */ +struct gl_transform_feedback +{ + GLenum Mode; /**< GL_POINTS, GL_LINES or GL_TRIANGLES */ + + GLboolean RasterDiscard; /**< GL_RASTERIZER_DISCARD */ + + /** The general binding point (GL_TRANSFORM_FEEDBACK_BUFFER) */ + struct gl_buffer_object *CurrentBuffer; + + /** The table of all transform feedback objects */ + struct _mesa_HashTable *Objects; + + /** The current xform-fb object (GL_TRANSFORM_FEEDBACK_BINDING) */ + struct gl_transform_feedback_object *CurrentObject; + + /** The default xform-fb object (Name==0) */ + struct gl_transform_feedback_object *DefaultObject; +}; + + + +/** + * State which can be shared by multiple contexts: + */ +struct gl_shared_state +{ + _glthread_Mutex Mutex; /**< for thread safety */ + GLint RefCount; /**< Reference count */ + struct _mesa_HashTable *DisplayList; /**< Display lists hash table */ + struct _mesa_HashTable *TexObjects; /**< Texture objects hash table */ + + /** Default texture objects (shared by all texture units) */ + struct gl_texture_object *DefaultTex[NUM_TEXTURE_TARGETS]; + + /** Fallback texture used when a bound texture is incomplete */ + struct gl_texture_object *FallbackTex; + + /** + * \name Thread safety and statechange notification for texture + * objects. + * + * \todo Improve the granularity of locking. + */ + /*@{*/ + _glthread_Mutex TexMutex; /**< texobj thread safety */ + GLuint TextureStateStamp; /**< state notification for shared tex */ + /*@}*/ + + /** Default buffer object for vertex arrays that aren't in VBOs */ + struct gl_buffer_object *NullBufferObj; + + /** + * \name Vertex/geometry/fragment programs + */ + /*@{*/ + struct _mesa_HashTable *Programs; /**< All vertex/fragment programs */ + struct gl_vertex_program *DefaultVertexProgram; + struct gl_fragment_program *DefaultFragmentProgram; + struct gl_geometry_program *DefaultGeometryProgram; + /*@}*/ + + /* GL_ATI_fragment_shader */ + struct _mesa_HashTable *ATIShaders; + struct ati_fragment_shader *DefaultFragmentShader; + + struct _mesa_HashTable *BufferObjects; + + /** Table of both gl_shader and gl_shader_program objects */ + struct _mesa_HashTable *ShaderObjects; + + /* GL_EXT_framebuffer_object */ + struct _mesa_HashTable *RenderBuffers; + struct _mesa_HashTable *FrameBuffers; + + /* GL_ARB_sync */ + struct simple_node SyncObjects; + + void *DriverData; /**< Device driver shared state */ +}; + + + + +/** + * A renderbuffer stores colors or depth values or stencil values. + * A framebuffer object will have a collection of these. + * Data are read/written to the buffer with a handful of Get/Put functions. + * + * Instances of this object are allocated with the Driver's NewRenderbuffer + * hook. Drivers will likely wrap this class inside a driver-specific + * class to simulate inheritance. + */ +struct gl_renderbuffer +{ +#define RB_MAGIC 0xaabbccdd + int Magic; /** XXX TEMPORARY DEBUG INFO */ + _glthread_Mutex Mutex; /**< for thread safety */ + GLuint ClassID; /**< Useful for drivers */ + GLuint Name; + GLint RefCount; + GLuint Width, Height; + GLboolean Purgeable; /**< Is the buffer purgeable under memory pressure? */ + + GLenum InternalFormat; /**< The user-specified format */ + GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or + GL_STENCIL_INDEX. */ + gl_format Format; /**< The actual renderbuffer memory format */ + + GLubyte NumSamples; + + GLenum DataType; /**< Type of values passed to the Get/Put functions */ + GLvoid *Data; /**< This may not be used by some kinds of RBs */ + + /* Used to wrap one renderbuffer around another: */ + struct gl_renderbuffer *Wrapped; + + /* Delete this renderbuffer */ + void (*Delete)(struct gl_renderbuffer *rb); + + /* Allocate new storage for this renderbuffer */ + GLboolean (*AllocStorage)(struct gl_context *ctx, struct gl_renderbuffer *rb, + GLenum internalFormat, + GLuint width, GLuint height); + + /* Lock/Unlock are called before/after calling the Get/Put functions. + * Not sure this is the right place for these yet. + void (*Lock)(struct gl_context *ctx, struct gl_renderbuffer *rb); + void (*Unlock)(struct gl_context *ctx, struct gl_renderbuffer *rb); + */ + + /* Return a pointer to the element/pixel at (x,y). + * Should return NULL if the buffer memory can't be directly addressed. + */ + void *(*GetPointer)(struct gl_context *ctx, struct gl_renderbuffer *rb, + GLint x, GLint y); + + /* Get/Read a row of values. + * The values will be of format _BaseFormat and type DataType. + */ + void (*GetRow)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, void *values); + + /* Get/Read values at arbitrary locations. + * The values will be of format _BaseFormat and type DataType. + */ + void (*GetValues)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], void *values); + + /* Put/Write a row of values. + * The values will be of format _BaseFormat and type DataType. + */ + void (*PutRow)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask); + + /* Put/Write a row of RGB values. This is a special-case routine that's + * only used for RGBA renderbuffers when the source data is GL_RGB. That's + * a common case for glDrawPixels and some triangle routines. + * The values will be of format GL_RGB and type DataType. + */ + void (*PutRowRGB)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *values, const GLubyte *mask); + + + /* Put/Write a row of identical values. + * The values will be of format _BaseFormat and type DataType. + */ + void (*PutMonoRow)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, + GLint x, GLint y, const void *value, const GLubyte *mask); + + /* Put/Write values at arbitrary locations. + * The values will be of format _BaseFormat and type DataType. + */ + void (*PutValues)(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, + const GLint x[], const GLint y[], const void *values, + const GLubyte *mask); + /* Put/Write identical values at arbitrary locations. + * The values will be of format _BaseFormat and type DataType. + */ + void (*PutMonoValues)(struct gl_context *ctx, struct gl_renderbuffer *rb, + GLuint count, const GLint x[], const GLint y[], + const void *value, const GLubyte *mask); +}; + + +/** + * A renderbuffer attachment points to either a texture object (and specifies + * a mipmap level, cube face or 3D texture slice) or points to a renderbuffer. + */ +struct gl_renderbuffer_attachment +{ + GLenum Type; /**< \c GL_NONE or \c GL_TEXTURE or \c GL_RENDERBUFFER_EXT */ + GLboolean Complete; + + /** + * If \c Type is \c GL_RENDERBUFFER_EXT, this stores a pointer to the + * application supplied renderbuffer object. + */ + struct gl_renderbuffer *Renderbuffer; + + /** + * If \c Type is \c GL_TEXTURE, this stores a pointer to the application + * supplied texture object. + */ + struct gl_texture_object *Texture; + GLuint TextureLevel; /**< Attached mipmap level. */ + GLuint CubeMapFace; /**< 0 .. 5, for cube map textures. */ + GLuint Zoffset; /**< Slice for 3D textures, or layer for both 1D + * and 2D array textures */ +}; + + +/** + * A framebuffer is a collection of renderbuffers (color, depth, stencil, etc). + * In C++ terms, think of this as a base class from which device drivers + * will make derived classes. + */ +struct gl_framebuffer +{ + _glthread_Mutex Mutex; /**< for thread safety */ + /** + * If zero, this is a window system framebuffer. If non-zero, this + * is a FBO framebuffer; note that for some devices (i.e. those with + * a natural pixel coordinate system for FBOs that differs from the + * OpenGL/Mesa coordinate system), this means that the viewport, + * polygon face orientation, and polygon stipple will have to be inverted. + */ + GLuint Name; + + GLint RefCount; + GLboolean DeletePending; + + /** + * The framebuffer's visual. Immutable if this is a window system buffer. + * Computed from attachments if user-made FBO. + */ + struct gl_config Visual; + + GLboolean Initialized; + + GLuint Width, Height; /**< size of frame buffer in pixels */ + + /** \name Drawing bounds (Intersection of buffer size and scissor box) */ + /*@{*/ + GLint _Xmin, _Xmax; /**< inclusive */ + GLint _Ymin, _Ymax; /**< exclusive */ + /*@}*/ + + /** \name Derived Z buffer stuff */ + /*@{*/ + GLuint _DepthMax; /**< Max depth buffer value */ + GLfloat _DepthMaxF; /**< Float max depth buffer value */ + GLfloat _MRD; /**< minimum resolvable difference in Z values */ + /*@}*/ + + /** One of the GL_FRAMEBUFFER_(IN)COMPLETE_* tokens */ + GLenum _Status; + + /** Integer color values */ + GLboolean _IntegerColor; + + /** Array of all renderbuffer attachments, indexed by BUFFER_* tokens. */ + struct gl_renderbuffer_attachment Attachment[BUFFER_COUNT]; + + /* In unextended OpenGL these vars are part of the GL_COLOR_BUFFER + * attribute group and GL_PIXEL attribute group, respectively. + */ + GLenum ColorDrawBuffer[MAX_DRAW_BUFFERS]; + GLenum ColorReadBuffer; + + /** Computed from ColorDraw/ReadBuffer above */ + GLuint _NumColorDrawBuffers; + GLint _ColorDrawBufferIndexes[MAX_DRAW_BUFFERS]; /**< BUFFER_x or -1 */ + GLint _ColorReadBufferIndex; /* -1 = None */ + struct gl_renderbuffer *_ColorDrawBuffers[MAX_DRAW_BUFFERS]; + struct gl_renderbuffer *_ColorReadBuffer; + + /** The Actual depth/stencil buffers to use. May be wrappers around the + * depth/stencil buffers attached above. */ + struct gl_renderbuffer *_DepthBuffer; + struct gl_renderbuffer *_StencilBuffer; + + /** Delete this framebuffer */ + void (*Delete)(struct gl_framebuffer *fb); +}; + + +/** + * Precision info for shader datatypes. See glGetShaderPrecisionFormat(). + */ +struct gl_precision +{ + GLushort RangeMin; /**< min value exponent */ + GLushort RangeMax; /**< max value exponent */ + GLushort Precision; /**< number of mantissa bits */ +}; + + +/** + * Limits for vertex and fragment programs/shaders. + */ +struct gl_program_constants +{ + /* logical limits */ + GLuint MaxInstructions; + GLuint MaxAluInstructions; + GLuint MaxTexInstructions; + GLuint MaxTexIndirections; + GLuint MaxAttribs; + GLuint MaxTemps; + GLuint MaxAddressRegs; + GLuint MaxParameters; + GLuint MaxLocalParams; + GLuint MaxEnvParams; + /* native/hardware limits */ + GLuint MaxNativeInstructions; + GLuint MaxNativeAluInstructions; + GLuint MaxNativeTexInstructions; + GLuint MaxNativeTexIndirections; + GLuint MaxNativeAttribs; + GLuint MaxNativeTemps; + GLuint MaxNativeAddressRegs; + GLuint MaxNativeParameters; + /* For shaders */ + GLuint MaxUniformComponents; + /* GL_ARB_geometry_shader4 */ + GLuint MaxGeometryTextureImageUnits; + GLuint MaxGeometryVaryingComponents; + GLuint MaxVertexVaryingComponents; + GLuint MaxGeometryUniformComponents; + GLuint MaxGeometryOutputVertices; + GLuint MaxGeometryTotalOutputComponents; + /* ES 2.0 and GL_ARB_ES2_compatibility */ + struct gl_precision LowFloat, MediumFloat, HighFloat; + struct gl_precision LowInt, MediumInt, HighInt; +}; + + +/** + * Constants which may be overridden by device driver during context creation + * but are never changed after that. + */ +struct gl_constants +{ + GLint MaxTextureMbytes; /**< Max memory per image, in MB */ + GLint MaxTextureLevels; /**< Max mipmap levels. */ + GLint Max3DTextureLevels; /**< Max mipmap levels for 3D textures */ + GLint MaxCubeTextureLevels; /**< Max mipmap levels for cube textures */ + GLint MaxArrayTextureLayers; /**< Max layers in array textures */ + GLint MaxTextureRectSize; /**< Max rectangle texture size, in pixes */ + GLuint MaxTextureCoordUnits; + GLuint MaxTextureImageUnits; + GLuint MaxVertexTextureImageUnits; + GLuint MaxCombinedTextureImageUnits; + GLuint MaxTextureUnits; /**< = MIN(CoordUnits, ImageUnits) */ + GLfloat MaxTextureMaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ + GLfloat MaxTextureLodBias; /**< GL_EXT_texture_lod_bias */ + + GLuint MaxArrayLockSize; + + GLint SubPixelBits; + + GLfloat MinPointSize, MaxPointSize; /**< aliased */ + GLfloat MinPointSizeAA, MaxPointSizeAA; /**< antialiased */ + GLfloat PointSizeGranularity; + GLfloat MinLineWidth, MaxLineWidth; /**< aliased */ + GLfloat MinLineWidthAA, MaxLineWidthAA; /**< antialiased */ + GLfloat LineWidthGranularity; + + GLuint MaxColorTableSize; + + GLuint MaxClipPlanes; + GLuint MaxLights; + GLfloat MaxShininess; /**< GL_NV_light_max_exponent */ + GLfloat MaxSpotExponent; /**< GL_NV_light_max_exponent */ + + GLuint MaxViewportWidth, MaxViewportHeight; + + struct gl_program_constants VertexProgram; /**< GL_ARB_vertex_program */ + struct gl_program_constants FragmentProgram; /**< GL_ARB_fragment_program */ + struct gl_program_constants GeometryProgram; /**< GL_ARB_geometry_shader4 */ + GLuint MaxProgramMatrices; + GLuint MaxProgramMatrixStackDepth; + + /** vertex array / buffer object bounds checking */ + GLboolean CheckArrayBounds; + + GLuint MaxDrawBuffers; /**< GL_ARB_draw_buffers */ + + GLuint MaxColorAttachments; /**< GL_EXT_framebuffer_object */ + GLuint MaxRenderbufferSize; /**< GL_EXT_framebuffer_object */ + GLuint MaxSamples; /**< GL_ARB_framebuffer_object */ + + GLuint MaxVarying; /**< Number of float[4] varying parameters */ + + GLuint GLSLVersion; /**< GLSL version supported (ex: 120 = 1.20) */ + + /** Which texture units support GL_ATI_envmap_bumpmap as targets */ + GLbitfield SupportedBumpUnits; + + /** + * Maximum amount of time, measured in nanseconds, that the server can wait. + */ + GLuint64 MaxServerWaitTimeout; + + /** GL_EXT_provoking_vertex */ + GLboolean QuadsFollowProvokingVertexConvention; + + /** OpenGL version 3.0 */ + GLbitfield ContextFlags; /**< Ex: GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT */ + + /** OpenGL version 3.2 */ + GLbitfield ProfileMask; /**< Mask of CONTEXT_x_PROFILE_BIT */ + + /** GL_EXT_transform_feedback */ + GLuint MaxTransformFeedbackSeparateAttribs; + GLuint MaxTransformFeedbackSeparateComponents; + GLuint MaxTransformFeedbackInterleavedComponents; + + /** GL_EXT_gpu_shader4 */ + GLint MinProgramTexelOffset, MaxProgramTexelOffset; + + /* GL_EXT_framebuffer_sRGB */ + GLboolean sRGBCapable; /* can enable sRGB blend/update on FBOs */ +}; + + +/** + * Enable flag for each OpenGL extension. Different device drivers will + * enable different extensions at runtime. + */ +struct gl_extensions +{ + GLboolean dummy; /* don't remove this! */ + GLboolean dummy_true; /* Set true by _mesa_init_extensions(). */ + GLboolean dummy_false; /* Set false by _mesa_init_extensions(). */ + GLboolean ARB_ES2_compatibility; + GLboolean ARB_blend_func_extended; + GLboolean ARB_copy_buffer; + GLboolean ARB_depth_buffer_float; + GLboolean ARB_depth_clamp; + GLboolean ARB_depth_texture; + GLboolean ARB_draw_buffers; + GLboolean ARB_draw_buffers_blend; + GLboolean ARB_draw_elements_base_vertex; + GLboolean ARB_draw_instanced; + GLboolean ARB_fragment_coord_conventions; + GLboolean ARB_fragment_program; + GLboolean ARB_fragment_program_shadow; + GLboolean ARB_fragment_shader; + GLboolean ARB_framebuffer_object; + GLboolean ARB_explicit_attrib_location; + GLboolean ARB_geometry_shader4; + GLboolean ARB_half_float_pixel; + GLboolean ARB_half_float_vertex; + GLboolean ARB_instanced_arrays; + GLboolean ARB_map_buffer_range; + GLboolean ARB_multisample; + GLboolean ARB_multitexture; + GLboolean ARB_occlusion_query; + GLboolean ARB_occlusion_query2; + GLboolean ARB_point_sprite; + GLboolean ARB_sampler_objects; + GLboolean ARB_seamless_cube_map; + GLboolean ARB_shader_objects; + GLboolean ARB_shader_stencil_export; + GLboolean ARB_shading_language_100; + GLboolean ARB_shadow; + GLboolean ARB_shadow_ambient; + GLboolean ARB_sync; + GLboolean ARB_texture_border_clamp; + GLboolean ARB_texture_buffer_object; + GLboolean ARB_texture_compression; + GLboolean ARB_texture_compression_rgtc; + GLboolean ARB_texture_cube_map; + GLboolean ARB_texture_env_combine; + GLboolean ARB_texture_env_crossbar; + GLboolean ARB_texture_env_dot3; + GLboolean ARB_texture_float; + GLboolean ARB_texture_mirrored_repeat; + GLboolean ARB_texture_multisample; + GLboolean ARB_texture_non_power_of_two; + GLboolean ARB_texture_rg; + GLboolean ARB_texture_rgb10_a2ui; + GLboolean ARB_timer_query; + GLboolean ARB_transform_feedback2; + GLboolean ARB_transpose_matrix; + GLboolean ARB_uniform_buffer_object; + GLboolean ARB_vertex_array_object; + GLboolean ARB_vertex_buffer_object; + GLboolean ARB_vertex_program; + GLboolean ARB_vertex_shader; + GLboolean ARB_vertex_type_2_10_10_10_rev; + GLboolean ARB_window_pos; + GLboolean EXT_abgr; + GLboolean EXT_bgra; + GLboolean EXT_blend_color; + GLboolean EXT_blend_equation_separate; + GLboolean EXT_blend_func_separate; + GLboolean EXT_blend_logic_op; + GLboolean EXT_blend_minmax; + GLboolean EXT_blend_subtract; + GLboolean EXT_clip_volume_hint; + GLboolean EXT_compiled_vertex_array; + GLboolean EXT_copy_texture; + GLboolean EXT_depth_bounds_test; + GLboolean EXT_draw_buffers2; + GLboolean EXT_draw_range_elements; + GLboolean EXT_fog_coord; + GLboolean EXT_framebuffer_blit; + GLboolean EXT_framebuffer_multisample; + GLboolean EXT_framebuffer_object; + GLboolean EXT_framebuffer_sRGB; + GLboolean EXT_gpu_program_parameters; + GLboolean EXT_gpu_shader4; + GLboolean EXT_multi_draw_arrays; + GLboolean EXT_paletted_texture; + GLboolean EXT_packed_depth_stencil; + GLboolean EXT_packed_float; + GLboolean EXT_packed_pixels; + GLboolean EXT_pixel_buffer_object; + GLboolean EXT_point_parameters; + GLboolean EXT_polygon_offset; + GLboolean EXT_provoking_vertex; + GLboolean EXT_rescale_normal; + GLboolean EXT_shadow_funcs; + GLboolean EXT_secondary_color; + GLboolean EXT_separate_shader_objects; + GLboolean EXT_separate_specular_color; + GLboolean EXT_shared_texture_palette; + GLboolean EXT_stencil_wrap; + GLboolean EXT_stencil_two_side; + GLboolean EXT_subtexture; + GLboolean EXT_texture; + GLboolean EXT_texture_object; + GLboolean EXT_texture3D; + GLboolean EXT_texture_array; + GLboolean EXT_texture_compression_s3tc; + GLboolean EXT_texture_env_add; + GLboolean EXT_texture_env_combine; + GLboolean EXT_texture_env_dot3; + GLboolean EXT_texture_filter_anisotropic; + GLboolean EXT_texture_integer; + GLboolean EXT_texture_lod_bias; + GLboolean EXT_texture_mirror_clamp; + GLboolean EXT_texture_shared_exponent; + GLboolean EXT_texture_sRGB; + GLboolean EXT_texture_sRGB_decode; + GLboolean EXT_texture_swizzle; + GLboolean EXT_transform_feedback; + GLboolean EXT_timer_query; + GLboolean EXT_vertex_array; + GLboolean EXT_vertex_array_bgra; + GLboolean EXT_vertex_array_set; + GLboolean OES_standard_derivatives; + /* vendor extensions */ + GLboolean AMD_conservative_depth; + GLboolean APPLE_client_storage; + GLboolean APPLE_packed_pixels; + GLboolean APPLE_vertex_array_object; + GLboolean APPLE_object_purgeable; + GLboolean ATI_envmap_bumpmap; + GLboolean ATI_texture_mirror_once; + GLboolean ATI_texture_env_combine3; + GLboolean ATI_fragment_shader; + GLboolean ATI_separate_stencil; + GLboolean IBM_rasterpos_clip; + GLboolean IBM_multimode_draw_arrays; + GLboolean MESA_pack_invert; + GLboolean MESA_resize_buffers; + GLboolean MESA_ycbcr_texture; + GLboolean MESA_texture_array; + GLboolean MESA_texture_signed_rgba; + GLboolean NV_blend_square; + GLboolean NV_conditional_render; + GLboolean NV_fragment_program; + GLboolean NV_fragment_program_option; + GLboolean NV_light_max_exponent; + GLboolean NV_point_sprite; + GLboolean NV_primitive_restart; + GLboolean NV_texgen_reflection; + GLboolean NV_texture_env_combine4; + GLboolean NV_texture_rectangle; + GLboolean NV_vertex_program; + GLboolean NV_vertex_program1_1; + GLboolean OES_read_format; + GLboolean SGI_texture_color_table; + GLboolean SGIS_generate_mipmap; + GLboolean SGIS_texture_edge_clamp; + GLboolean SGIS_texture_lod; + GLboolean TDFX_texture_compression_FXT1; + GLboolean S3_s3tc; + GLboolean OES_EGL_image; + GLboolean OES_draw_texture; + GLboolean EXT_texture_format_BGRA8888; + GLboolean extension_sentinel; + /** The extension string */ + const GLubyte *String; + /** Number of supported extensions */ + GLuint Count; +}; + + +/** + * A stack of matrices (projection, modelview, color, texture, etc). + */ +struct gl_matrix_stack +{ + GLmatrix *Top; /**< points into Stack */ + GLmatrix *Stack; /**< array [MaxDepth] of GLmatrix */ + GLuint Depth; /**< 0 <= Depth < MaxDepth */ + GLuint MaxDepth; /**< size of Stack[] array */ + GLuint DirtyFlag; /**< _NEW_MODELVIEW or _NEW_PROJECTION, for example */ +}; + + +/** + * \name Bits for image transfer operations + * \sa __struct gl_contextRec::ImageTransferState. + */ +/*@{*/ +#define IMAGE_SCALE_BIAS_BIT 0x1 +#define IMAGE_SHIFT_OFFSET_BIT 0x2 +#define IMAGE_MAP_COLOR_BIT 0x4 +#define IMAGE_CLAMP_BIT 0x800 + + +/** Pixel Transfer ops */ +#define IMAGE_BITS (IMAGE_SCALE_BIAS_BIT | \ + IMAGE_SHIFT_OFFSET_BIT | \ + IMAGE_MAP_COLOR_BIT) + +/** + * \name Bits to indicate what state has changed. + */ +/*@{*/ +#define _NEW_MODELVIEW (1 << 0) /**< gl_context::ModelView */ +#define _NEW_PROJECTION (1 << 1) /**< gl_context::Projection */ +#define _NEW_TEXTURE_MATRIX (1 << 2) /**< gl_context::TextureMatrix */ +#define _NEW_COLOR (1 << 3) /**< gl_context::Color */ +#define _NEW_DEPTH (1 << 4) /**< gl_context::Depth */ +#define _NEW_EVAL (1 << 5) /**< gl_context::Eval, EvalMap */ +#define _NEW_FOG (1 << 6) /**< gl_context::Fog */ +#define _NEW_HINT (1 << 7) /**< gl_context::Hint */ +#define _NEW_LIGHT (1 << 8) /**< gl_context::Light */ +#define _NEW_LINE (1 << 9) /**< gl_context::Line */ +#define _NEW_PIXEL (1 << 10) /**< gl_context::Pixel */ +#define _NEW_POINT (1 << 11) /**< gl_context::Point */ +#define _NEW_POLYGON (1 << 12) /**< gl_context::Polygon */ +#define _NEW_POLYGONSTIPPLE (1 << 13) /**< gl_context::PolygonStipple */ +#define _NEW_SCISSOR (1 << 14) /**< gl_context::Scissor */ +#define _NEW_STENCIL (1 << 15) /**< gl_context::Stencil */ +#define _NEW_TEXTURE (1 << 16) /**< gl_context::Texture */ +#define _NEW_TRANSFORM (1 << 17) /**< gl_context::Transform */ +#define _NEW_VIEWPORT (1 << 18) /**< gl_context::Viewport */ +#define _NEW_PACKUNPACK (1 << 19) /**< gl_context::Pack, Unpack */ +#define _NEW_ARRAY (1 << 20) /**< gl_context::Array */ +#define _NEW_RENDERMODE (1 << 21) /**< gl_context::RenderMode, etc */ +#define _NEW_BUFFERS (1 << 22) /**< gl_context::Visual, DrawBuffer, */ +#define _NEW_CURRENT_ATTRIB (1 << 23) /**< gl_context::Current */ +#define _NEW_MULTISAMPLE (1 << 24) /**< gl_context::Multisample */ +#define _NEW_TRACK_MATRIX (1 << 25) /**< gl_context::VertexProgram */ +#define _NEW_PROGRAM (1 << 26) /**< New program/shader state */ +#define _NEW_PROGRAM_CONSTANTS (1 << 27) +#define _NEW_BUFFER_OBJECT (1 << 28) +#define _NEW_ALL ~0 +/*@}*/ + + +/** + * \name Bits to track array state changes + * + * Also used to summarize array enabled. + */ +/*@{*/ +#define _NEW_ARRAY_VERTEX VERT_BIT_POS +#define _NEW_ARRAY_WEIGHT VERT_BIT_WEIGHT +#define _NEW_ARRAY_NORMAL VERT_BIT_NORMAL +#define _NEW_ARRAY_COLOR0 VERT_BIT_COLOR0 +#define _NEW_ARRAY_COLOR1 VERT_BIT_COLOR1 +#define _NEW_ARRAY_FOGCOORD VERT_BIT_FOG +#define _NEW_ARRAY_INDEX VERT_BIT_COLOR_INDEX +#define _NEW_ARRAY_EDGEFLAG VERT_BIT_EDGEFLAG +#define _NEW_ARRAY_POINT_SIZE VERT_BIT_COLOR_INDEX /* aliased */ +#define _NEW_ARRAY_TEXCOORD_0 VERT_BIT_TEX0 +#define _NEW_ARRAY_TEXCOORD_1 VERT_BIT_TEX1 +#define _NEW_ARRAY_TEXCOORD_2 VERT_BIT_TEX2 +#define _NEW_ARRAY_TEXCOORD_3 VERT_BIT_TEX3 +#define _NEW_ARRAY_TEXCOORD_4 VERT_BIT_TEX4 +#define _NEW_ARRAY_TEXCOORD_5 VERT_BIT_TEX5 +#define _NEW_ARRAY_TEXCOORD_6 VERT_BIT_TEX6 +#define _NEW_ARRAY_TEXCOORD_7 VERT_BIT_TEX7 +#define _NEW_ARRAY_ATTRIB_0 VERT_BIT_GENERIC0 /* start at bit 16 */ +#define _NEW_ARRAY_ALL 0xffffffff + + +#define _NEW_ARRAY_TEXCOORD(i) (_NEW_ARRAY_TEXCOORD_0 << (i)) +#define _NEW_ARRAY_ATTRIB(i) (_NEW_ARRAY_ATTRIB_0 << (i)) +/*@}*/ + + + +/** + * \name A bunch of flags that we think might be useful to drivers. + * + * Set in the __struct gl_contextRec::_TriangleCaps bitfield. + */ +/*@{*/ +#define DD_FLATSHADE 0x1 +#define DD_SEPARATE_SPECULAR 0x2 +#define DD_TRI_CULL_FRONT_BACK 0x4 /* special case on some hw */ +#define DD_TRI_LIGHT_TWOSIDE 0x8 +#define DD_TRI_UNFILLED 0x10 +#define DD_TRI_SMOOTH 0x20 +#define DD_TRI_STIPPLE 0x40 +#define DD_TRI_OFFSET 0x80 +#define DD_LINE_SMOOTH 0x100 +#define DD_LINE_STIPPLE 0x200 +#define DD_POINT_SMOOTH 0x400 +#define DD_POINT_ATTEN 0x800 +#define DD_TRI_TWOSTENCIL 0x1000 +/*@}*/ + + +/** + * \name Define the state changes under which each of these bits might change + */ +/*@{*/ +#define _DD_NEW_FLATSHADE _NEW_LIGHT +#define _DD_NEW_SEPARATE_SPECULAR (_NEW_LIGHT | _NEW_FOG | _NEW_PROGRAM) +#define _DD_NEW_TRI_CULL_FRONT_BACK _NEW_POLYGON +#define _DD_NEW_TRI_LIGHT_TWOSIDE _NEW_LIGHT +#define _DD_NEW_TRI_UNFILLED _NEW_POLYGON +#define _DD_NEW_TRI_SMOOTH _NEW_POLYGON +#define _DD_NEW_TRI_STIPPLE _NEW_POLYGON +#define _DD_NEW_TRI_OFFSET _NEW_POLYGON +#define _DD_NEW_LINE_SMOOTH _NEW_LINE +#define _DD_NEW_LINE_STIPPLE _NEW_LINE +#define _DD_NEW_LINE_WIDTH _NEW_LINE +#define _DD_NEW_POINT_SMOOTH _NEW_POINT +#define _DD_NEW_POINT_SIZE _NEW_POINT +#define _DD_NEW_POINT_ATTEN _NEW_POINT +/*@}*/ + + +/** + * Composite state flags + */ +/*@{*/ +#define _MESA_NEW_NEED_EYE_COORDS (_NEW_LIGHT | \ + _NEW_TEXTURE | \ + _NEW_POINT | \ + _NEW_PROGRAM | \ + _NEW_MODELVIEW) + +#define _MESA_NEW_NEED_NORMALS (_NEW_LIGHT | \ + _NEW_TEXTURE) + +#define _MESA_NEW_TRANSFER_STATE (_NEW_PIXEL) +/*@}*/ + + + + +/* This has to be included here. */ +#include "dd.h" + + +/** + * Display list flags. + * Strictly this is a tnl-private concept, but it doesn't seem + * worthwhile adding a tnl private structure just to hold this one bit + * of information: + */ +#define DLIST_DANGLING_REFS 0x1 + + +/** Opaque declaration of display list payload data type */ +union gl_dlist_node; + + +/** + * Provide a location where information about a display list can be + * collected. Could be extended with driverPrivate structures, + * etc. in the future. + */ +struct gl_display_list +{ + GLuint Name; + GLbitfield Flags; /**< DLIST_x flags */ + /** The dlist commands are in a linked list of nodes */ + union gl_dlist_node *Head; +}; + + +/** + * State used during display list compilation and execution. + */ +struct gl_dlist_state +{ + GLuint CallDepth; /**< Current recursion calling depth */ + + struct gl_display_list *CurrentList; /**< List currently being compiled */ + union gl_dlist_node *CurrentBlock; /**< Pointer to current block of nodes */ + GLuint CurrentPos; /**< Index into current block of nodes */ + + GLvertexformat ListVtxfmt; + + GLubyte ActiveAttribSize[VERT_ATTRIB_MAX]; + GLfloat CurrentAttrib[VERT_ATTRIB_MAX][4]; + + GLubyte ActiveMaterialSize[MAT_ATTRIB_MAX]; + GLfloat CurrentMaterial[MAT_ATTRIB_MAX][4]; + + GLubyte ActiveIndex; + GLfloat CurrentIndex; + + GLubyte ActiveEdgeFlag; + GLboolean CurrentEdgeFlag; + + struct { + /* State known to have been set by the currently-compiling display + * list. Used to eliminate some redundant state changes. + */ + GLenum ShadeModel; + } Current; +}; + + +/** + * Enum for the OpenGL APIs we know about and may support. + */ +typedef enum +{ + API_OPENGL, + API_OPENGLES, + API_OPENGLES2 +} gl_api; + + +/** + * Mesa rendering context. + * + * This is the central context data structure for Mesa. Almost all + * OpenGL state is contained in this structure. + * Think of this as a base class from which device drivers will derive + * sub classes. + * + * The struct gl_context typedef names this structure. + */ +struct gl_context +{ + /** State possibly shared with other contexts in the address space */ + struct gl_shared_state *Shared; + + /** \name API function pointer tables */ + /*@{*/ + gl_api API; + struct _glapi_table *Save; /**< Display list save functions */ + struct _glapi_table *Exec; /**< Execute functions */ + struct _glapi_table *CurrentDispatch; /**< == Save or Exec !! */ + /*@}*/ + + struct gl_config Visual; + struct gl_framebuffer *DrawBuffer; /**< buffer for writing */ + struct gl_framebuffer *ReadBuffer; /**< buffer for reading */ + struct gl_framebuffer *WinSysDrawBuffer; /**< set with MakeCurrent */ + struct gl_framebuffer *WinSysReadBuffer; /**< set with MakeCurrent */ + + /** + * Device driver function pointer table + */ + struct dd_function_table Driver; + + void *DriverCtx; /**< Points to device driver context/state */ + + /** Core/Driver constants */ + struct gl_constants Const; + + /** \name The various 4x4 matrix stacks */ + /*@{*/ + struct gl_matrix_stack ModelviewMatrixStack; + struct gl_matrix_stack ProjectionMatrixStack; + struct gl_matrix_stack TextureMatrixStack[MAX_TEXTURE_UNITS]; + struct gl_matrix_stack ProgramMatrixStack[MAX_PROGRAM_MATRICES]; + struct gl_matrix_stack *CurrentStack; /**< Points to one of the above stacks */ + /*@}*/ + + /** Combined modelview and projection matrix */ + GLmatrix _ModelProjectMatrix; + + /** \name Display lists */ + struct gl_dlist_state ListState; + + GLboolean ExecuteFlag; /**< Execute GL commands? */ + GLboolean CompileFlag; /**< Compile GL commands into display list? */ + + /** Extension information */ + struct gl_extensions Extensions; + + /** Version info */ + GLuint VersionMajor, VersionMinor; + char *VersionString; + + /** \name State attribute stack (for glPush/PopAttrib) */ + /*@{*/ + GLuint AttribStackDepth; + struct gl_attrib_node *AttribStack[MAX_ATTRIB_STACK_DEPTH]; + /*@}*/ + + /** \name Renderer attribute groups + * + * We define a struct for each attribute group to make pushing and popping + * attributes easy. Also it's a good organization. + */ + /*@{*/ + struct gl_accum_attrib Accum; /**< Accum buffer attributes */ + struct gl_colorbuffer_attrib Color; /**< Color buffer attributes */ + struct gl_current_attrib Current; /**< Current attributes */ + struct gl_depthbuffer_attrib Depth; /**< Depth buffer attributes */ + struct gl_eval_attrib Eval; /**< Eval attributes */ + struct gl_fog_attrib Fog; /**< Fog attributes */ + struct gl_hint_attrib Hint; /**< Hint attributes */ + struct gl_light_attrib Light; /**< Light attributes */ + struct gl_line_attrib Line; /**< Line attributes */ + struct gl_list_attrib List; /**< List attributes */ + struct gl_multisample_attrib Multisample; + struct gl_pixel_attrib Pixel; /**< Pixel attributes */ + struct gl_point_attrib Point; /**< Point attributes */ + struct gl_polygon_attrib Polygon; /**< Polygon attributes */ + GLuint PolygonStipple[32]; /**< Polygon stipple */ + struct gl_scissor_attrib Scissor; /**< Scissor attributes */ + struct gl_stencil_attrib Stencil; /**< Stencil buffer attributes */ + struct gl_texture_attrib Texture; /**< Texture attributes */ + struct gl_transform_attrib Transform; /**< Transformation attributes */ + struct gl_viewport_attrib Viewport; /**< Viewport attributes */ + /*@}*/ + + /** \name Client attribute stack */ + /*@{*/ + GLuint ClientAttribStackDepth; + struct gl_attrib_node *ClientAttribStack[MAX_CLIENT_ATTRIB_STACK_DEPTH]; + /*@}*/ + + /** \name Client attribute groups */ + /*@{*/ + struct gl_array_attrib Array; /**< Vertex arrays */ + struct gl_pixelstore_attrib Pack; /**< Pixel packing */ + struct gl_pixelstore_attrib Unpack; /**< Pixel unpacking */ + struct gl_pixelstore_attrib DefaultPacking; /**< Default params */ + /*@}*/ + + /** \name Other assorted state (not pushed/popped on attribute stack) */ + /*@{*/ + struct gl_pixelmaps PixelMaps; + + struct gl_evaluators EvalMap; /**< All evaluators */ + struct gl_feedback Feedback; /**< Feedback */ + struct gl_selection Select; /**< Selection */ + + struct gl_program_state Program; /**< general program state */ + struct gl_vertex_program_state VertexProgram; + struct gl_fragment_program_state FragmentProgram; + struct gl_geometry_program_state GeometryProgram; + struct gl_ati_fragment_shader_state ATIFragmentShader; + + struct gl_shader_state Shader; /**< GLSL shader object state */ + struct gl_shader_compiler_options ShaderCompilerOptions[MESA_SHADER_TYPES]; + + struct gl_query_state Query; /**< occlusion, timer queries */ + + struct gl_transform_feedback TransformFeedback; + + struct gl_buffer_object *CopyReadBuffer; /**< GL_ARB_copy_buffer */ + struct gl_buffer_object *CopyWriteBuffer; /**< GL_ARB_copy_buffer */ + /*@}*/ + + struct gl_meta_state *Meta; /**< for "meta" operations */ + + /* GL_EXT_framebuffer_object */ + struct gl_renderbuffer *CurrentRenderbuffer; + + GLenum ErrorValue; /**< Last error code */ + + /** + * Recognize and silence repeated error debug messages in buggy apps. + */ + const char *ErrorDebugFmtString; + GLuint ErrorDebugCount; + + GLenum RenderMode; /**< either GL_RENDER, GL_SELECT, GL_FEEDBACK */ + GLbitfield NewState; /**< bitwise-or of _NEW_* flags */ + + GLboolean ViewportInitialized; /**< has viewport size been initialized? */ + + GLbitfield varying_vp_inputs; /**< mask of VERT_BIT_* flags */ + + /** \name Derived state */ + /*@{*/ + /** Bitwise-or of DD_* flags. Note that this bitfield may be used before + * state validation so they need to always be current. + */ + GLbitfield _TriangleCaps; + GLbitfield _ImageTransferState;/**< bitwise-or of IMAGE_*_BIT flags */ + GLfloat _EyeZDir[3]; + GLfloat _ModelViewInvScale; + GLboolean _NeedEyeCoords; + GLboolean _ForceEyeCoords; + + GLuint TextureStateTimestamp; /**< detect changes to shared state */ + + struct gl_shine_tab *_ShineTable[2]; /**< Active shine tables */ + struct gl_shine_tab *_ShineTabList; /**< MRU list of inactive shine tables */ + /**@}*/ + + struct gl_list_extensions *ListExt; /**< driver dlist extensions */ + + /** \name For debugging/development only */ + /*@{*/ + GLboolean FirstTimeCurrent; + /*@}*/ + + /** software compression/decompression supported or not */ + GLboolean Mesa_DXTn; + + GLboolean TextureFormatSupported[MESA_FORMAT_COUNT]; + + /** + * Use dp4 (rather than mul/mad) instructions for position + * transformation? + */ + GLboolean mvp_with_dp4; + + /** + * \name Hooks for module contexts. + * + * These will eventually live in the driver or elsewhere. + */ + /*@{*/ + void *swrast_context; + void *swsetup_context; + void *swtnl_context; + void *swtnl_im; + struct st_context *st; + void *aelt_context; + /*@}*/ +}; + + +#ifdef DEBUG +extern int MESA_VERBOSE; +extern int MESA_DEBUG_FLAGS; +# define MESA_FUNCTION __FUNCTION__ +#else +# define MESA_VERBOSE 0 +# define MESA_DEBUG_FLAGS 0 +# define MESA_FUNCTION "a function" +# ifndef NDEBUG +# define NDEBUG +# endif +#endif + + +/** The MESA_VERBOSE var is a bitmask of these flags */ +enum _verbose +{ + VERBOSE_VARRAY = 0x0001, + VERBOSE_TEXTURE = 0x0002, + VERBOSE_MATERIAL = 0x0004, + VERBOSE_PIPELINE = 0x0008, + VERBOSE_DRIVER = 0x0010, + VERBOSE_STATE = 0x0020, + VERBOSE_API = 0x0040, + VERBOSE_DISPLAY_LIST = 0x0100, + VERBOSE_LIGHTING = 0x0200, + VERBOSE_PRIMS = 0x0400, + VERBOSE_VERTS = 0x0800, + VERBOSE_DISASSEM = 0x1000, + VERBOSE_DRAW = 0x2000, + VERBOSE_SWAPBUFFERS = 0x4000 +}; + + +/** The MESA_DEBUG_FLAGS var is a bitmask of these flags */ +enum _debug +{ + DEBUG_ALWAYS_FLUSH = 0x1 +}; + + + +#endif /* MTYPES_H */ diff --git a/mesalib/src/mesa/main/readpix.c b/mesalib/src/mesa/main/readpix.c index 9887fd816..3f424600c 100644 --- a/mesalib/src/mesa/main/readpix.c +++ b/mesalib/src/mesa/main/readpix.c @@ -26,6 +26,7 @@ #include "imports.h" #include "bufferobj.h" #include "context.h" +#include "enums.h" #include "readpix.h" #include "framebuffer.h" #include "formats.h" @@ -173,6 +174,13 @@ _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, FLUSH_CURRENT(ctx, 0); + if (MESA_VERBOSE & VERBOSE_API) + _mesa_debug(ctx, "glReadPixels(%d, %d, %s, %s, %p)\n", + width, height, + _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), + pixels); + if (width < 0 || height < 0) { _mesa_error( ctx, GL_INVALID_VALUE, "glReadPixels(width=%d height=%d)", width, height ); diff --git a/mesalib/src/mesa/main/texgetimage.c b/mesalib/src/mesa/main/texgetimage.c index 36bd02a6c..c3f7d3c32 100644 --- a/mesalib/src/mesa/main/texgetimage.c +++ b/mesalib/src/mesa/main/texgetimage.c @@ -805,8 +805,8 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, * \return GL_TRUE if any error, GL_FALSE if no errors. */ static GLboolean -getcompressedteximage_error_check(struct gl_context *ctx, GLenum target, GLint level, - GLvoid *img) +getcompressedteximage_error_check(struct gl_context *ctx, GLenum target, + GLint level, GLvoid *img) { struct gl_texture_object *texObj; struct gl_texture_image *texImage; diff --git a/mesalib/src/mesa/program/ir_to_mesa.cpp b/mesalib/src/mesa/program/ir_to_mesa.cpp index aa5f007e9..0255b576c 100644 --- a/mesalib/src/mesa/program/ir_to_mesa.cpp +++ b/mesalib/src/mesa/program/ir_to_mesa.cpp @@ -2670,6 +2670,8 @@ ir_to_mesa_visitor::copy_propagate(void) ir_to_mesa_instruction **acp = rzalloc_array(mem_ctx, ir_to_mesa_instruction *, this->next_temp * 4); + int *acp_level = rzalloc_array(mem_ctx, int, this->next_temp * 4); + int level = 0; foreach_iter(exec_list_iterator, iter, this->instructions) { ir_to_mesa_instruction *inst = (ir_to_mesa_instruction *)iter.get(); @@ -2700,6 +2702,8 @@ ir_to_mesa_visitor::copy_propagate(void) break; } + assert(acp_level[acp_base + src_chan] <= level); + if (!first) { first = copy_chan; } else { @@ -2732,12 +2736,32 @@ ir_to_mesa_visitor::copy_propagate(void) switch (inst->op) { case OPCODE_BGNLOOP: case OPCODE_ENDLOOP: - case OPCODE_ELSE: - case OPCODE_ENDIF: /* End of a basic block, clear the ACP entirely. */ memset(acp, 0, sizeof(*acp) * this->next_temp * 4); break; + case OPCODE_IF: + ++level; + break; + + case OPCODE_ENDIF: + case OPCODE_ELSE: + /* Clear all channels written inside the block from the ACP, but + * leaving those that were not touched. + */ + for (int r = 0; r < this->next_temp; r++) { + for (int c = 0; c < 4; c++) { + if (!acp[4 * r + c]) + continue; + + if (acp_level[4 * r + c] >= level) + acp[4 * r + c] = NULL; + } + } + if (inst->op == OPCODE_ENDIF) + --level; + break; + default: /* Continuing the block, clear any written channels from * the ACP. @@ -2802,11 +2826,13 @@ ir_to_mesa_visitor::copy_propagate(void) for (int i = 0; i < 4; i++) { if (inst->dst_reg.writemask & (1 << i)) { acp[4 * inst->dst_reg.index + i] = inst; + acp_level[4 * inst->dst_reg.index + i] = level; } } } } + ralloc_free(acp_level); ralloc_free(acp); } diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c index 07527002b..2c4746622 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c @@ -1,1371 +1,1487 @@ -/************************************************************************** - * - * Copyright 2007 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. - * - **************************************************************************/ - - /* - * Authors: - * Brian Paul - */ - -#include "main/imports.h" -#include "main/image.h" -#include "main/bufferobj.h" -#include "main/macros.h" -#include "main/mfeatures.h" -#include "main/mtypes.h" -#include "main/pack.h" -#include "main/texformat.h" -#include "main/texstore.h" -#include "program/program.h" -#include "program/prog_print.h" -#include "program/prog_instruction.h" - -#include "st_atom.h" -#include "st_atom_constbuf.h" -#include "st_cb_drawpixels.h" -#include "st_cb_readpixels.h" -#include "st_cb_fbo.h" -#include "st_context.h" -#include "st_debug.h" -#include "st_format.h" -#include "st_program.h" -#include "st_texture.h" - -#include "pipe/p_context.h" -#include "pipe/p_defines.h" -#include "tgsi/tgsi_ureg.h" -#include "util/u_draw_quad.h" -#include "util/u_format.h" -#include "util/u_inlines.h" -#include "util/u_math.h" -#include "util/u_tile.h" -#include "cso_cache/cso_context.h" - - -#if FEATURE_drawpix - -/** - * Check if the given program is: - * 0: MOVE result.color, fragment.color; - * 1: END; - */ -static GLboolean -is_passthrough_program(const struct gl_fragment_program *prog) -{ - if (prog->Base.NumInstructions == 2) { - const struct prog_instruction *inst = prog->Base.Instructions; - if (inst[0].Opcode == OPCODE_MOV && - inst[1].Opcode == OPCODE_END && - inst[0].DstReg.File == PROGRAM_OUTPUT && - inst[0].DstReg.Index == FRAG_RESULT_COLOR && - inst[0].DstReg.WriteMask == WRITEMASK_XYZW && - inst[0].SrcReg[0].File == PROGRAM_INPUT && - inst[0].SrcReg[0].Index == FRAG_ATTRIB_COL0 && - inst[0].SrcReg[0].Swizzle == SWIZZLE_XYZW) { - return GL_TRUE; - } - } - return GL_FALSE; -} - - - -/** - * Make fragment shader for glDraw/CopyPixels. This shader is made - * by combining the pixel transfer shader with the user-defined shader. - * \param fpIn the current/incoming fragment program - * \param fpOut returns the combined fragment program - */ -void -st_make_drawpix_fragment_program(struct st_context *st, - struct gl_fragment_program *fpIn, - struct gl_fragment_program **fpOut) -{ - struct gl_program *newProg; - - if (is_passthrough_program(fpIn)) { - newProg = (struct gl_program *) _mesa_clone_fragment_program(st->ctx, - &st->pixel_xfer.program->Base); - } - else { -#if 0 - /* debug */ - printf("Base program:\n"); - _mesa_print_program(&fpIn->Base); - printf("DrawPix program:\n"); - _mesa_print_program(&st->pixel_xfer.program->Base.Base); -#endif - newProg = _mesa_combine_programs(st->ctx, - &st->pixel_xfer.program->Base.Base, - &fpIn->Base); - } - -#if 0 - /* debug */ - printf("Combined DrawPixels program:\n"); - _mesa_print_program(newProg); - printf("InputsRead: 0x%x\n", newProg->InputsRead); - printf("OutputsWritten: 0x%x\n", newProg->OutputsWritten); - _mesa_print_parameter_list(newProg->Parameters); -#endif - - *fpOut = (struct gl_fragment_program *) newProg; -} - - -/** - * Create fragment program that does a TEX() instruction to get a Z and/or - * stencil value value, then writes to FRAG_RESULT_DEPTH/FRAG_RESULT_STENCIL. - * Used for glDrawPixels(GL_DEPTH_COMPONENT / GL_STENCIL_INDEX). - * Pass fragment color through as-is. - * \return pointer to the gl_fragment program - */ -struct gl_fragment_program * -st_make_drawpix_z_stencil_program(struct st_context *st, - GLboolean write_depth, - GLboolean write_stencil) -{ - struct gl_context *ctx = st->ctx; - struct gl_program *p; - struct gl_fragment_program *fp; - GLuint ic = 0; - const GLuint shaderIndex = write_depth * 2 + write_stencil; - - assert(shaderIndex < Elements(st->drawpix.shaders)); - - if (st->drawpix.shaders[shaderIndex]) { - /* already have the proper shader */ - return st->drawpix.shaders[shaderIndex]; - } - - /* - * Create shader now - */ - p = ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0); - if (!p) - return NULL; - - p->NumInstructions = write_depth ? 2 : 1; - p->NumInstructions += write_stencil ? 1 : 0; - - p->Instructions = _mesa_alloc_instructions(p->NumInstructions); - if (!p->Instructions) { - ctx->Driver.DeleteProgram(ctx, p); - return NULL; - } - _mesa_init_instructions(p->Instructions, p->NumInstructions); - - if (write_depth) { - /* TEX result.depth, fragment.texcoord[0], texture[0], 2D; */ - p->Instructions[ic].Opcode = OPCODE_TEX; - p->Instructions[ic].DstReg.File = PROGRAM_OUTPUT; - p->Instructions[ic].DstReg.Index = FRAG_RESULT_DEPTH; - p->Instructions[ic].DstReg.WriteMask = WRITEMASK_Z; - p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT; - p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0; - p->Instructions[ic].TexSrcUnit = 0; - p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX; - ic++; - } - - if (write_stencil) { - /* TEX result.stencil, fragment.texcoord[0], texture[0], 2D; */ - p->Instructions[ic].Opcode = OPCODE_TEX; - p->Instructions[ic].DstReg.File = PROGRAM_OUTPUT; - p->Instructions[ic].DstReg.Index = FRAG_RESULT_STENCIL; - p->Instructions[ic].DstReg.WriteMask = WRITEMASK_Y; - p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT; - p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0; - p->Instructions[ic].TexSrcUnit = 1; - p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX; - ic++; - } - - /* END; */ - p->Instructions[ic++].Opcode = OPCODE_END; - - assert(ic == p->NumInstructions); - - p->InputsRead = FRAG_BIT_TEX0 | FRAG_BIT_COL0; - p->OutputsWritten = 0; - if (write_depth) - p->OutputsWritten |= (1 << FRAG_RESULT_DEPTH); - if (write_stencil) - p->OutputsWritten |= (1 << FRAG_RESULT_STENCIL); - - p->SamplersUsed = 0x1; /* sampler 0 (bit 0) is used */ - if (write_stencil) - p->SamplersUsed |= 1 << 1; - - fp = (struct gl_fragment_program *) p; - - /* save the new shader */ - st->drawpix.shaders[shaderIndex] = fp; - - return fp; -} - - -/** - * Create a simple vertex shader that just passes through the - * vertex position and texcoord (and optionally, color). - */ -static void * -make_passthrough_vertex_shader(struct st_context *st, - GLboolean passColor) -{ - if (!st->drawpix.vert_shaders[passColor]) { - struct ureg_program *ureg = ureg_create( TGSI_PROCESSOR_VERTEX ); - - if (ureg == NULL) - return NULL; - - /* MOV result.pos, vertex.pos; */ - ureg_MOV(ureg, - ureg_DECL_output( ureg, TGSI_SEMANTIC_POSITION, 0 ), - ureg_DECL_vs_input( ureg, 0 )); - - /* MOV result.texcoord0, vertex.attr[1]; */ - ureg_MOV(ureg, - ureg_DECL_output( ureg, TGSI_SEMANTIC_GENERIC, 0 ), - ureg_DECL_vs_input( ureg, 1 )); - - if (passColor) { - /* MOV result.color0, vertex.attr[2]; */ - ureg_MOV(ureg, - ureg_DECL_output( ureg, TGSI_SEMANTIC_COLOR, 0 ), - ureg_DECL_vs_input( ureg, 2 )); - } - - ureg_END( ureg ); - - st->drawpix.vert_shaders[passColor] = - ureg_create_shader_and_destroy( ureg, st->pipe ); - } - - return st->drawpix.vert_shaders[passColor]; -} - - -/** - * Return a texture base format for drawing/copying an image - * of the given format. - */ -static GLenum -base_format(GLenum format) -{ - switch (format) { - case GL_DEPTH_COMPONENT: - return GL_DEPTH_COMPONENT; - case GL_DEPTH_STENCIL: - return GL_DEPTH_STENCIL; - case GL_STENCIL_INDEX: - return GL_STENCIL_INDEX; - default: - return GL_RGBA; - } -} - - -/** - * Return a texture internalFormat for drawing/copying an image - * of the given format and type. - */ -static GLenum -internal_format(GLenum format, GLenum type) -{ - switch (format) { - case GL_DEPTH_COMPONENT: - return GL_DEPTH_COMPONENT; - case GL_DEPTH_STENCIL: - return GL_DEPTH_STENCIL; - case GL_STENCIL_INDEX: - return GL_STENCIL_INDEX; - default: - if (_mesa_is_integer_format(format)) { - switch (type) { - case GL_BYTE: - return GL_RGBA8I; - case GL_UNSIGNED_BYTE: - return GL_RGBA8UI; - case GL_SHORT: - return GL_RGBA16I; - case GL_UNSIGNED_SHORT: - return GL_RGBA16UI; - case GL_INT: - return GL_RGBA32I; - case GL_UNSIGNED_INT: - return GL_RGBA32UI; - default: - assert(0 && "Unexpected type in internal_format()"); - return GL_RGBA_INTEGER; - } - } - else { - return GL_RGBA; - } - } -} - - -/** - * Create a temporary texture to hold an image of the given size. - * If width, height are not POT and the driver only handles POT textures, - * allocate the next larger size of texture that is POT. - */ -static struct pipe_resource * -alloc_texture(struct st_context *st, GLsizei width, GLsizei height, - enum pipe_format texFormat) -{ - struct pipe_resource *pt; - - pt = st_texture_create(st, st->internal_target, texFormat, 0, - width, height, 1, 1, PIPE_BIND_SAMPLER_VIEW); - - return pt; -} - - -/** - * Make texture containing an image for glDrawPixels image. - * If 'pixels' is NULL, leave the texture image data undefined. - */ -static struct pipe_resource * -make_texture(struct st_context *st, - GLsizei width, GLsizei height, GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels) -{ - struct gl_context *ctx = st->ctx; - struct pipe_context *pipe = st->pipe; - gl_format mformat; - struct pipe_resource *pt; - enum pipe_format pipeFormat; - GLuint cpp; - GLenum baseFormat, intFormat; - - baseFormat = base_format(format); - intFormat = internal_format(format, type); - - mformat = st_ChooseTextureFormat_renderable(ctx, intFormat, - format, type, GL_FALSE); - assert(mformat); - - pipeFormat = st_mesa_format_to_pipe_format(mformat); - assert(pipeFormat); - cpp = util_format_get_blocksize(pipeFormat); - - pixels = _mesa_map_pbo_source(ctx, unpack, pixels); - if (!pixels) - return NULL; - - /* alloc temporary texture */ - pt = alloc_texture(st, width, height, pipeFormat); - if (!pt) { - _mesa_unmap_pbo_source(ctx, unpack); - return NULL; - } - - { - struct pipe_transfer *transfer; - static const GLuint dstImageOffsets = 0; - GLboolean success; - GLubyte *dest; - const GLbitfield imageTransferStateSave = ctx->_ImageTransferState; - - /* we'll do pixel transfer in a fragment shader */ - ctx->_ImageTransferState = 0x0; - - transfer = pipe_get_transfer(st->pipe, pt, 0, 0, - PIPE_TRANSFER_WRITE, 0, 0, - width, height); - - /* map texture transfer */ - dest = pipe_transfer_map(pipe, transfer); - - - /* Put image into texture transfer. - * Note that the image is actually going to be upside down in - * the texture. We deal with that with texcoords. - */ - success = _mesa_texstore(ctx, 2, /* dims */ - baseFormat, /* baseInternalFormat */ - mformat, /* gl_format */ - dest, /* dest */ - 0, 0, 0, /* dstX/Y/Zoffset */ - transfer->stride, /* dstRowStride, bytes */ - &dstImageOffsets, /* dstImageOffsets */ - width, height, 1, /* size */ - format, type, /* src format/type */ - pixels, /* data source */ - unpack); - - /* unmap */ - pipe_transfer_unmap(pipe, transfer); - pipe->transfer_destroy(pipe, transfer); - - assert(success); - - /* restore */ - ctx->_ImageTransferState = imageTransferStateSave; - } - - _mesa_unmap_pbo_source(ctx, unpack); - - return pt; -} - - -/** - * Draw quad with texcoords and optional color. - * Coords are gallium window coords with y=0=top. - * \param color may be null - * \param invertTex if true, flip texcoords vertically - */ -static void -draw_quad(struct gl_context *ctx, GLfloat x0, GLfloat y0, GLfloat z, - GLfloat x1, GLfloat y1, const GLfloat *color, - GLboolean invertTex, GLfloat maxXcoord, GLfloat maxYcoord) -{ - struct st_context *st = st_context(ctx); - struct pipe_context *pipe = st->pipe; - GLfloat verts[4][3][4]; /* four verts, three attribs, XYZW */ - - /* setup vertex data */ - { - const struct gl_framebuffer *fb = st->ctx->DrawBuffer; - const GLfloat fb_width = (GLfloat) fb->Width; - const GLfloat fb_height = (GLfloat) fb->Height; - const GLfloat clip_x0 = x0 / fb_width * 2.0f - 1.0f; - const GLfloat clip_y0 = y0 / fb_height * 2.0f - 1.0f; - const GLfloat clip_x1 = x1 / fb_width * 2.0f - 1.0f; - const GLfloat clip_y1 = y1 / fb_height * 2.0f - 1.0f; - const GLfloat sLeft = 0.0f, sRight = maxXcoord; - const GLfloat tTop = invertTex ? maxYcoord : 0.0f; - const GLfloat tBot = invertTex ? 0.0f : maxYcoord; - GLuint i; - - /* upper-left */ - verts[0][0][0] = clip_x0; /* v[0].attr[0].x */ - verts[0][0][1] = clip_y0; /* v[0].attr[0].y */ - - /* upper-right */ - verts[1][0][0] = clip_x1; - verts[1][0][1] = clip_y0; - - /* lower-right */ - verts[2][0][0] = clip_x1; - verts[2][0][1] = clip_y1; - - /* lower-left */ - verts[3][0][0] = clip_x0; - verts[3][0][1] = clip_y1; - - verts[0][1][0] = sLeft; /* v[0].attr[1].S */ - verts[0][1][1] = tTop; /* v[0].attr[1].T */ - verts[1][1][0] = sRight; - verts[1][1][1] = tTop; - verts[2][1][0] = sRight; - verts[2][1][1] = tBot; - verts[3][1][0] = sLeft; - verts[3][1][1] = tBot; - - /* same for all verts: */ - if (color) { - for (i = 0; i < 4; i++) { - verts[i][0][2] = z; /* v[i].attr[0].z */ - verts[i][0][3] = 1.0f; /* v[i].attr[0].w */ - verts[i][2][0] = color[0]; /* v[i].attr[2].r */ - verts[i][2][1] = color[1]; /* v[i].attr[2].g */ - verts[i][2][2] = color[2]; /* v[i].attr[2].b */ - verts[i][2][3] = color[3]; /* v[i].attr[2].a */ - verts[i][1][2] = 0.0f; /* v[i].attr[1].R */ - verts[i][1][3] = 1.0f; /* v[i].attr[1].Q */ - } - } - else { - for (i = 0; i < 4; i++) { - verts[i][0][2] = z; /*Z*/ - verts[i][0][3] = 1.0f; /*W*/ - verts[i][1][2] = 0.0f; /*R*/ - verts[i][1][3] = 1.0f; /*Q*/ - } - } - } - - { - struct pipe_resource *buf; - - /* allocate/load buffer object with vertex data */ - buf = pipe_buffer_create(pipe->screen, - PIPE_BIND_VERTEX_BUFFER, - PIPE_USAGE_STATIC, - sizeof(verts)); - pipe_buffer_write(st->pipe, buf, 0, sizeof(verts), verts); - - util_draw_vertex_buffer(pipe, st->cso_context, buf, 0, - PIPE_PRIM_QUADS, - 4, /* verts */ - 3); /* attribs/vert */ - pipe_resource_reference(&buf, NULL); - } -} - - - -static void -draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, - GLsizei width, GLsizei height, - GLfloat zoomX, GLfloat zoomY, - struct pipe_sampler_view **sv, - int num_sampler_view, - void *driver_vp, - void *driver_fp, - const GLfloat *color, - GLboolean invertTex, - GLboolean write_depth, GLboolean write_stencil) -{ - struct st_context *st = st_context(ctx); - struct pipe_context *pipe = st->pipe; - struct cso_context *cso = st->cso_context; - GLfloat x0, y0, x1, y1; - GLsizei maxSize; - boolean normalized = sv[0]->texture->target != PIPE_TEXTURE_RECT; - - /* limit checks */ - /* XXX if DrawPixels image is larger than max texture size, break - * it up into chunks. - */ - maxSize = 1 << (pipe->screen->get_param(pipe->screen, - PIPE_CAP_MAX_TEXTURE_2D_LEVELS) - 1); - assert(width <= maxSize); - assert(height <= maxSize); - - cso_save_rasterizer(cso); - cso_save_viewport(cso); - cso_save_samplers(cso); - cso_save_fragment_sampler_views(cso); - cso_save_fragment_shader(cso); - cso_save_vertex_shader(cso); - cso_save_vertex_elements(cso); - cso_save_vertex_buffers(cso); - if (write_stencil) { - cso_save_depth_stencil_alpha(cso); - cso_save_blend(cso); - } - - /* rasterizer state: just scissor */ - { - struct pipe_rasterizer_state rasterizer; - memset(&rasterizer, 0, sizeof(rasterizer)); - rasterizer.gl_rasterization_rules = 1; - rasterizer.scissor = ctx->Scissor.Enabled; - cso_set_rasterizer(cso, &rasterizer); - } - - if (write_stencil) { - /* Stencil writing bypasses the normal fragment pipeline to - * disable color writing and set stencil test to always pass. - */ - struct pipe_depth_stencil_alpha_state dsa; - struct pipe_blend_state blend; - - /* depth/stencil */ - memset(&dsa, 0, sizeof(dsa)); - dsa.stencil[0].enabled = 1; - dsa.stencil[0].func = PIPE_FUNC_ALWAYS; - dsa.stencil[0].writemask = ctx->Stencil.WriteMask[0] & 0xff; - dsa.stencil[0].zpass_op = PIPE_STENCIL_OP_REPLACE; - if (write_depth) { - /* writing depth+stencil: depth test always passes */ - dsa.depth.enabled = 1; - dsa.depth.writemask = ctx->Depth.Mask; - dsa.depth.func = PIPE_FUNC_ALWAYS; - } - cso_set_depth_stencil_alpha(cso, &dsa); - - /* blend (colormask) */ - memset(&blend, 0, sizeof(blend)); - cso_set_blend(cso, &blend); - } - - /* fragment shader state: TEX lookup program */ - cso_set_fragment_shader_handle(cso, driver_fp); - - /* vertex shader state: position + texcoord pass-through */ - cso_set_vertex_shader_handle(cso, driver_vp); - - - /* texture sampling state: */ - { - struct pipe_sampler_state sampler; - memset(&sampler, 0, sizeof(sampler)); - sampler.wrap_s = PIPE_TEX_WRAP_CLAMP; - sampler.wrap_t = PIPE_TEX_WRAP_CLAMP; - sampler.wrap_r = PIPE_TEX_WRAP_CLAMP; - sampler.min_img_filter = PIPE_TEX_FILTER_NEAREST; - sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NONE; - sampler.mag_img_filter = PIPE_TEX_FILTER_NEAREST; - sampler.normalized_coords = normalized; - - cso_single_sampler(cso, 0, &sampler); - if (num_sampler_view > 1) { - cso_single_sampler(cso, 1, &sampler); - } - cso_single_sampler_done(cso); - } - - /* viewport state: viewport matching window dims */ - { - const float w = (float) ctx->DrawBuffer->Width; - const float h = (float) ctx->DrawBuffer->Height; - struct pipe_viewport_state vp; - vp.scale[0] = 0.5f * w; - vp.scale[1] = -0.5f * h; - vp.scale[2] = 0.5f; - vp.scale[3] = 1.0f; - vp.translate[0] = 0.5f * w; - vp.translate[1] = 0.5f * h; - vp.translate[2] = 0.5f; - vp.translate[3] = 0.0f; - cso_set_viewport(cso, &vp); - } - - cso_set_vertex_elements(cso, 3, st->velems_util_draw); - - /* texture state: */ - cso_set_fragment_sampler_views(cso, num_sampler_view, sv); - - /* Compute Gallium window coords (y=0=top) with pixel zoom. - * Recall that these coords are transformed by the current - * vertex shader and viewport transformation. - */ - if (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM) { - y = ctx->DrawBuffer->Height - (int) (y + height * ctx->Pixel.ZoomY); - invertTex = !invertTex; - } - - x0 = (GLfloat) x; - x1 = x + width * ctx->Pixel.ZoomX; - y0 = (GLfloat) y; - y1 = y + height * ctx->Pixel.ZoomY; - - /* convert Z from [0,1] to [-1,-1] to match viewport Z scale/bias */ - z = z * 2.0 - 1.0; - - draw_quad(ctx, x0, y0, z, x1, y1, color, invertTex, - normalized ? ((GLfloat) width / sv[0]->texture->width0) : (GLfloat)width, - normalized ? ((GLfloat) height / sv[0]->texture->height0) : (GLfloat)height); - - /* restore state */ - cso_restore_rasterizer(cso); - cso_restore_viewport(cso); - cso_restore_samplers(cso); - cso_restore_fragment_sampler_views(cso); - cso_restore_fragment_shader(cso); - cso_restore_vertex_shader(cso); - cso_restore_vertex_elements(cso); - cso_restore_vertex_buffers(cso); - if (write_stencil) { - cso_restore_depth_stencil_alpha(cso); - cso_restore_blend(cso); - } -} - - -/** - * Software fallback to do glDrawPixels(GL_STENCIL_INDEX) when we - * can't use a fragment shader to write stencil values. - */ -static void -draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, - GLsizei width, GLsizei height, GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels) -{ - struct st_context *st = st_context(ctx); - struct pipe_context *pipe = st->pipe; - struct st_renderbuffer *strb; - enum pipe_transfer_usage usage; - struct pipe_transfer *pt; - const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0; - GLint skipPixels; - ubyte *stmap; - struct gl_pixelstore_attrib clippedUnpack = *unpack; - - if (!zoom) { - if (!_mesa_clip_drawpixels(ctx, &x, &y, &width, &height, - &clippedUnpack)) { - /* totally clipped */ - return; - } - } - - strb = st_renderbuffer(ctx->DrawBuffer-> - Attachment[BUFFER_STENCIL].Renderbuffer); - - if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) { - y = ctx->DrawBuffer->Height - y - height; - } - - if(format != GL_DEPTH_STENCIL && - util_format_get_component_bits(strb->format, - UTIL_FORMAT_COLORSPACE_ZS, 0) != 0) - usage = PIPE_TRANSFER_READ_WRITE; - else - usage = PIPE_TRANSFER_WRITE; - - pt = pipe_get_transfer(st_context(ctx)->pipe, strb->texture, 0, 0, - usage, x, y, - width, height); - - stmap = pipe_transfer_map(pipe, pt); - - pixels = _mesa_map_pbo_source(ctx, &clippedUnpack, pixels); - assert(pixels); - - /* if width > MAX_WIDTH, have to process image in chunks */ - skipPixels = 0; - while (skipPixels < width) { - const GLint spanX = skipPixels; - const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH); - GLint row; - for (row = 0; row < height; row++) { - GLubyte sValues[MAX_WIDTH]; - GLuint zValues[MAX_WIDTH]; - GLenum destType = GL_UNSIGNED_BYTE; - const GLvoid *source = _mesa_image_address2d(&clippedUnpack, pixels, - width, height, - format, type, - row, skipPixels); - _mesa_unpack_stencil_span(ctx, spanWidth, destType, sValues, - type, source, &clippedUnpack, - ctx->_ImageTransferState); - - if (format == GL_DEPTH_STENCIL) { - _mesa_unpack_depth_span(ctx, spanWidth, GL_UNSIGNED_INT, zValues, - (1 << 24) - 1, type, source, - &clippedUnpack); - } - - if (zoom) { - _mesa_problem(ctx, "Gallium glDrawPixels(GL_STENCIL) with " - "zoom not complete"); - } - - { - GLint spanY; - - if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) { - spanY = height - row - 1; - } - else { - spanY = row; - } - - /* now pack the stencil (and Z) values in the dest format */ - switch (pt->resource->format) { - case PIPE_FORMAT_S8_USCALED: - { - ubyte *dest = stmap + spanY * pt->stride + spanX; - assert(usage == PIPE_TRANSFER_WRITE); - memcpy(dest, sValues, spanWidth); - } - break; - case PIPE_FORMAT_Z24_UNORM_S8_USCALED: - if (format == GL_DEPTH_STENCIL) { - uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4); - GLint k; - assert(usage == PIPE_TRANSFER_WRITE); - for (k = 0; k < spanWidth; k++) { - dest[k] = zValues[k] | (sValues[k] << 24); - } - } - else { - uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4); - GLint k; - assert(usage == PIPE_TRANSFER_READ_WRITE); - for (k = 0; k < spanWidth; k++) { - dest[k] = (dest[k] & 0xffffff) | (sValues[k] << 24); - } - } - break; - case PIPE_FORMAT_S8_USCALED_Z24_UNORM: - if (format == GL_DEPTH_STENCIL) { - uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4); - GLint k; - assert(usage == PIPE_TRANSFER_WRITE); - for (k = 0; k < spanWidth; k++) { - dest[k] = (zValues[k] << 8) | (sValues[k] & 0xff); - } - } - else { - uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4); - GLint k; - assert(usage == PIPE_TRANSFER_READ_WRITE); - for (k = 0; k < spanWidth; k++) { - dest[k] = (dest[k] & 0xffffff00) | (sValues[k] & 0xff); - } - } - break; - default: - assert(0); - } - } - } - skipPixels += spanWidth; - } - - _mesa_unmap_pbo_source(ctx, &clippedUnpack); - - /* unmap the stencil buffer */ - pipe_transfer_unmap(pipe, pt); - pipe->transfer_destroy(pipe, pt); -} - - -/** - * Get fragment program variant for a glDrawPixels or glCopyPixels - * command for RGBA data. - */ -static struct st_fp_variant * -get_color_fp_variant(struct st_context *st) -{ - struct gl_context *ctx = st->ctx; - struct st_fp_variant_key key; - struct st_fp_variant *fpv; - - memset(&key, 0, sizeof(key)); - - key.st = st; - key.drawpixels = 1; - key.scaleAndBias = (ctx->Pixel.RedBias != 0.0 || - ctx->Pixel.RedScale != 1.0 || - ctx->Pixel.GreenBias != 0.0 || - ctx->Pixel.GreenScale != 1.0 || - ctx->Pixel.BlueBias != 0.0 || - ctx->Pixel.BlueScale != 1.0 || - ctx->Pixel.AlphaBias != 0.0 || - ctx->Pixel.AlphaScale != 1.0); - key.pixelMaps = ctx->Pixel.MapColorFlag; - - fpv = st_get_fp_variant(st, st->fp, &key); - - return fpv; -} - - -/** - * Get fragment program variant for a glDrawPixels or glCopyPixels - * command for depth/stencil data. - */ -static struct st_fp_variant * -get_depth_stencil_fp_variant(struct st_context *st, GLboolean write_depth, - GLboolean write_stencil) -{ - struct st_fp_variant_key key; - struct st_fp_variant *fpv; - - memset(&key, 0, sizeof(key)); - - key.st = st; - key.drawpixels = 1; - key.drawpixels_z = write_depth; - key.drawpixels_stencil = write_stencil; - - fpv = st_get_fp_variant(st, st->fp, &key); - - return fpv; -} - - -/** - * Called via ctx->Driver.DrawPixels() - */ -static void -st_DrawPixels(struct gl_context *ctx, GLint x, GLint y, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels) -{ - void *driver_vp, *driver_fp; - struct st_context *st = st_context(ctx); - const GLfloat *color; - struct pipe_context *pipe = st->pipe; - GLboolean write_stencil = GL_FALSE, write_depth = GL_FALSE; - struct pipe_sampler_view *sv[2]; - int num_sampler_view = 1; - enum pipe_format stencil_format = PIPE_FORMAT_NONE; - struct st_fp_variant *fpv; - - if (format == GL_DEPTH_STENCIL) - write_stencil = write_depth = GL_TRUE; - else if (format == GL_STENCIL_INDEX) - write_stencil = GL_TRUE; - else if (format == GL_DEPTH_COMPONENT) - write_depth = GL_TRUE; - - if (write_stencil) { - enum pipe_format tex_format; - /* can we write to stencil if not fallback */ - if (!pipe->screen->get_param(pipe->screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) - goto stencil_fallback; - - tex_format = st_choose_format(st->pipe->screen, base_format(format), - PIPE_TEXTURE_2D, - 0, PIPE_BIND_SAMPLER_VIEW); - if (tex_format == PIPE_FORMAT_Z24_UNORM_S8_USCALED) - stencil_format = PIPE_FORMAT_X24S8_USCALED; - else if (tex_format == PIPE_FORMAT_S8_USCALED_Z24_UNORM) - stencil_format = PIPE_FORMAT_S8X24_USCALED; - else - stencil_format = PIPE_FORMAT_S8_USCALED; - if (stencil_format == PIPE_FORMAT_NONE) - goto stencil_fallback; - } - - /* Mesa state should be up to date by now */ - assert(ctx->NewState == 0x0); - - st_validate_state(st); - - /* - * Get vertex/fragment shaders - */ - if (write_depth || write_stencil) { - fpv = get_depth_stencil_fp_variant(st, write_depth, write_stencil); - - driver_fp = fpv->driver_shader; - - driver_vp = make_passthrough_vertex_shader(st, GL_TRUE); - - color = ctx->Current.RasterColor; - } - else { - fpv = get_color_fp_variant(st); - - driver_fp = fpv->driver_shader; - - driver_vp = make_passthrough_vertex_shader(st, GL_FALSE); - - color = NULL; - if (st->pixel_xfer.pixelmap_enabled) { - sv[1] = st->pixel_xfer.pixelmap_sampler_view; - num_sampler_view++; - } - } - - /* update fragment program constants */ - st_upload_constants(st, fpv->parameters, PIPE_SHADER_FRAGMENT); - - /* draw with textured quad */ - { - struct pipe_resource *pt - = make_texture(st, width, height, format, type, unpack, pixels); - if (pt) { - sv[0] = st_create_texture_sampler_view(st->pipe, pt); - - if (sv[0]) { - if (write_stencil) { - sv[1] = st_create_texture_sampler_view_format(st->pipe, pt, - stencil_format); - num_sampler_view++; - } - - draw_textured_quad(ctx, x, y, ctx->Current.RasterPos[2], - width, height, - ctx->Pixel.ZoomX, ctx->Pixel.ZoomY, - sv, - num_sampler_view, - driver_vp, - driver_fp, - color, GL_FALSE, write_depth, write_stencil); - pipe_sampler_view_reference(&sv[0], NULL); - if (num_sampler_view > 1) - pipe_sampler_view_reference(&sv[1], NULL); - } - pipe_resource_reference(&pt, NULL); - } - } - return; - -stencil_fallback: - draw_stencil_pixels(ctx, x, y, width, height, format, type, - unpack, pixels); -} - - - -/** - * Software fallback for glCopyPixels(GL_STENCIL). - */ -static void -copy_stencil_pixels(struct gl_context *ctx, GLint srcx, GLint srcy, - GLsizei width, GLsizei height, - GLint dstx, GLint dsty) -{ - struct st_renderbuffer *rbDraw; - struct pipe_context *pipe = st_context(ctx)->pipe; - enum pipe_transfer_usage usage; - struct pipe_transfer *ptDraw; - ubyte *drawMap; - ubyte *buffer; - int i; - - buffer = malloc(width * height * sizeof(ubyte)); - if (!buffer) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels(stencil)"); - return; - } - - /* Get the dest renderbuffer. If there's a wrapper, use the - * underlying renderbuffer. - */ - rbDraw = st_renderbuffer(ctx->DrawBuffer->_StencilBuffer); - if (rbDraw->Base.Wrapped) - rbDraw = st_renderbuffer(rbDraw->Base.Wrapped); - - /* this will do stencil pixel transfer ops */ - st_read_stencil_pixels(ctx, srcx, srcy, width, height, - GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, - &ctx->DefaultPacking, buffer); - - if (0) { - /* debug code: dump stencil values */ - GLint row, col; - for (row = 0; row < height; row++) { - printf("%3d: ", row); - for (col = 0; col < width; col++) { - printf("%02x ", buffer[col + row * width]); - } - printf("\n"); - } - } - - if (util_format_get_component_bits(rbDraw->format, - UTIL_FORMAT_COLORSPACE_ZS, 0) != 0) - usage = PIPE_TRANSFER_READ_WRITE; - else - usage = PIPE_TRANSFER_WRITE; - - if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) { - dsty = rbDraw->Base.Height - dsty - height; - } - - ptDraw = pipe_get_transfer(st_context(ctx)->pipe, - rbDraw->texture, 0, 0, - usage, dstx, dsty, - width, height); - - assert(util_format_get_blockwidth(ptDraw->resource->format) == 1); - assert(util_format_get_blockheight(ptDraw->resource->format) == 1); - - /* map the stencil buffer */ - drawMap = pipe_transfer_map(pipe, ptDraw); - - /* draw */ - /* XXX PixelZoom not handled yet */ - for (i = 0; i < height; i++) { - ubyte *dst; - const ubyte *src; - int y; - - y = i; - - if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) { - y = height - y - 1; - } - - dst = drawMap + y * ptDraw->stride; - src = buffer + i * width; - - switch (ptDraw->resource->format) { - case PIPE_FORMAT_Z24_UNORM_S8_USCALED: - { - uint *dst4 = (uint *) dst; - int j; - assert(usage == PIPE_TRANSFER_READ_WRITE); - for (j = 0; j < width; j++) { - *dst4 = (*dst4 & 0xffffff) | (src[j] << 24); - dst4++; - } - } - break; - case PIPE_FORMAT_S8_USCALED_Z24_UNORM: - { - uint *dst4 = (uint *) dst; - int j; - assert(usage == PIPE_TRANSFER_READ_WRITE); - for (j = 0; j < width; j++) { - *dst4 = (*dst4 & 0xffffff00) | (src[j] & 0xff); - dst4++; - } - } - break; - case PIPE_FORMAT_S8_USCALED: - assert(usage == PIPE_TRANSFER_WRITE); - memcpy(dst, src, width); - break; - default: - assert(0); - } - } - - free(buffer); - - /* unmap the stencil buffer */ - pipe_transfer_unmap(pipe, ptDraw); - pipe->transfer_destroy(pipe, ptDraw); -} - - -static void -st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, - GLsizei width, GLsizei height, - GLint dstx, GLint dsty, GLenum type) -{ - struct st_context *st = st_context(ctx); - struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; - struct st_renderbuffer *rbRead; - void *driver_vp, *driver_fp; - struct pipe_resource *pt; - struct pipe_sampler_view *sv[2]; - int num_sampler_view = 1; - GLfloat *color; - enum pipe_format srcFormat, texFormat; - GLboolean invertTex = GL_FALSE; - GLint readX, readY, readW, readH; - GLuint sample_count; - struct gl_pixelstore_attrib pack = ctx->DefaultPacking; - struct st_fp_variant *fpv; - - st_validate_state(st); - - if (type == GL_STENCIL) { - /* can't use texturing to do stencil */ - copy_stencil_pixels(ctx, srcx, srcy, width, height, dstx, dsty); - return; - } - - /* - * Get vertex/fragment shaders - */ - if (type == GL_COLOR) { - rbRead = st_get_color_read_renderbuffer(ctx); - color = NULL; - - fpv = get_color_fp_variant(st); - driver_fp = fpv->driver_shader; - - driver_vp = make_passthrough_vertex_shader(st, GL_FALSE); - - if (st->pixel_xfer.pixelmap_enabled) { - sv[1] = st->pixel_xfer.pixelmap_sampler_view; - num_sampler_view++; - } - } - else { - assert(type == GL_DEPTH); - rbRead = st_renderbuffer(ctx->ReadBuffer->_DepthBuffer); - color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; - - fpv = get_depth_stencil_fp_variant(st, GL_TRUE, GL_FALSE); - driver_fp = fpv->driver_shader; - - driver_vp = make_passthrough_vertex_shader(st, GL_TRUE); - } - - /* update fragment program constants */ - st_upload_constants(st, fpv->parameters, PIPE_SHADER_FRAGMENT); - - - if (rbRead->Base.Wrapped) - rbRead = st_renderbuffer(rbRead->Base.Wrapped); - - sample_count = rbRead->texture->nr_samples; - /* I believe this would be legal, presumably would need to do a resolve - for color, and for depth/stencil spec says to just use one of the - depth/stencil samples per pixel? Need some transfer clarifications. */ - assert(sample_count < 2); - - srcFormat = rbRead->texture->format; - - if (screen->is_format_supported(screen, srcFormat, st->internal_target, - sample_count, - PIPE_BIND_SAMPLER_VIEW, 0)) { - texFormat = srcFormat; - } - else { - /* srcFormat can't be used as a texture format */ - if (type == GL_DEPTH) { - texFormat = st_choose_format(screen, GL_DEPTH_COMPONENT, - st->internal_target, sample_count, - PIPE_BIND_DEPTH_STENCIL); - assert(texFormat != PIPE_FORMAT_NONE); - } - else { - /* default color format */ - texFormat = st_choose_format(screen, GL_RGBA, st->internal_target, - sample_count, PIPE_BIND_SAMPLER_VIEW); - assert(texFormat != PIPE_FORMAT_NONE); - } - } - - /* Invert src region if needed */ - if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) { - srcy = ctx->ReadBuffer->Height - srcy - height; - invertTex = !invertTex; - } - - /* Clip the read region against the src buffer bounds. - * We'll still allocate a temporary buffer/texture for the original - * src region size but we'll only read the region which is on-screen. - * This may mean that we draw garbage pixels into the dest region, but - * that's expected. - */ - readX = srcx; - readY = srcy; - readW = width; - readH = height; - _mesa_clip_readpixels(ctx, &readX, &readY, &readW, &readH, &pack); - readW = MAX2(0, readW); - readH = MAX2(0, readH); - - /* alloc temporary texture */ - pt = alloc_texture(st, width, height, texFormat); - if (!pt) - return; - - sv[0] = st_create_texture_sampler_view(st->pipe, pt); - if (!sv[0]) { - pipe_resource_reference(&pt, NULL); - return; - } - - /* Make temporary texture which is a copy of the src region. - */ - if (srcFormat == texFormat) { - struct pipe_box src_box; - u_box_2d(readX, readY, readW, readH, &src_box); - /* copy source framebuffer surface into mipmap/texture */ - pipe->resource_copy_region(pipe, - pt, /* dest tex */ - 0, - pack.SkipPixels, pack.SkipRows, 0, /* dest pos */ - rbRead->texture, /* src tex */ - 0, - &src_box); - - } - else { - /* CPU-based fallback/conversion */ - struct pipe_transfer *ptRead = - pipe_get_transfer(st->pipe, rbRead->texture, 0, 0, - PIPE_TRANSFER_READ, - readX, readY, readW, readH); - struct pipe_transfer *ptTex; - enum pipe_transfer_usage transfer_usage; - - if (ST_DEBUG & DEBUG_FALLBACK) - debug_printf("%s: fallback processing\n", __FUNCTION__); - - if (type == GL_DEPTH && util_format_is_depth_and_stencil(pt->format)) - transfer_usage = PIPE_TRANSFER_READ_WRITE; - else - transfer_usage = PIPE_TRANSFER_WRITE; - - ptTex = pipe_get_transfer(st->pipe, pt, 0, 0, transfer_usage, - 0, 0, width, height); - - /* copy image from ptRead surface to ptTex surface */ - if (type == GL_COLOR) { - /* alternate path using get/put_tile() */ - GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); - enum pipe_format readFormat, drawFormat; - readFormat = util_format_linear(rbRead->texture->format); - drawFormat = util_format_linear(pt->format); - pipe_get_tile_rgba_format(pipe, ptRead, readX, readY, readW, readH, - readFormat, buf); - pipe_put_tile_rgba_format(pipe, ptTex, pack.SkipPixels, pack.SkipRows, - readW, readH, drawFormat, buf); - free(buf); - } - else { - /* GL_DEPTH */ - GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint)); - pipe_get_tile_z(pipe, ptRead, readX, readY, readW, readH, buf); - pipe_put_tile_z(pipe, ptTex, pack.SkipPixels, pack.SkipRows, - readW, readH, buf); - free(buf); - } - - pipe->transfer_destroy(pipe, ptRead); - pipe->transfer_destroy(pipe, ptTex); - } - - /* OK, the texture 'pt' contains the src image/pixels. Now draw a - * textured quad with that texture. - */ - draw_textured_quad(ctx, dstx, dsty, ctx->Current.RasterPos[2], - width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY, - sv, - num_sampler_view, - driver_vp, - driver_fp, - color, invertTex, GL_FALSE, GL_FALSE); - - pipe_resource_reference(&pt, NULL); - pipe_sampler_view_reference(&sv[0], NULL); -} - - - -void st_init_drawpixels_functions(struct dd_function_table *functions) -{ - functions->DrawPixels = st_DrawPixels; - functions->CopyPixels = st_CopyPixels; -} - - -void -st_destroy_drawpix(struct st_context *st) -{ - GLuint i; - - for (i = 0; i < Elements(st->drawpix.shaders); i++) { - if (st->drawpix.shaders[i]) - _mesa_reference_fragprog(st->ctx, &st->drawpix.shaders[i], NULL); - } - - st_reference_fragprog(st, &st->pixel_xfer.combined_prog, NULL); - if (st->drawpix.vert_shaders[0]) - ureg_free_tokens(st->drawpix.vert_shaders[0]); - if (st->drawpix.vert_shaders[1]) - ureg_free_tokens(st->drawpix.vert_shaders[1]); -} - -#endif /* FEATURE_drawpix */ +/************************************************************************** + * + * Copyright 2007 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. + * + **************************************************************************/ + + /* + * Authors: + * Brian Paul + */ + +#include "main/imports.h" +#include "main/image.h" +#include "main/bufferobj.h" +#include "main/macros.h" +#include "main/mfeatures.h" +#include "main/mtypes.h" +#include "main/pack.h" +#include "main/texformat.h" +#include "main/texstore.h" +#include "program/program.h" +#include "program/prog_print.h" +#include "program/prog_instruction.h" + +#include "st_atom.h" +#include "st_atom_constbuf.h" +#include "st_cb_drawpixels.h" +#include "st_cb_readpixels.h" +#include "st_cb_fbo.h" +#include "st_context.h" +#include "st_debug.h" +#include "st_format.h" +#include "st_program.h" +#include "st_texture.h" + +#include "pipe/p_context.h" +#include "pipe/p_defines.h" +#include "tgsi/tgsi_ureg.h" +#include "util/u_draw_quad.h" +#include "util/u_format.h" +#include "util/u_inlines.h" +#include "util/u_math.h" +#include "util/u_tile.h" +#include "cso_cache/cso_context.h" + + +#if FEATURE_drawpix + +/** + * Check if the given program is: + * 0: MOVE result.color, fragment.color; + * 1: END; + */ +static GLboolean +is_passthrough_program(const struct gl_fragment_program *prog) +{ + if (prog->Base.NumInstructions == 2) { + const struct prog_instruction *inst = prog->Base.Instructions; + if (inst[0].Opcode == OPCODE_MOV && + inst[1].Opcode == OPCODE_END && + inst[0].DstReg.File == PROGRAM_OUTPUT && + inst[0].DstReg.Index == FRAG_RESULT_COLOR && + inst[0].DstReg.WriteMask == WRITEMASK_XYZW && + inst[0].SrcReg[0].File == PROGRAM_INPUT && + inst[0].SrcReg[0].Index == FRAG_ATTRIB_COL0 && + inst[0].SrcReg[0].Swizzle == SWIZZLE_XYZW) { + return GL_TRUE; + } + } + return GL_FALSE; +} + + + +/** + * Make fragment shader for glDraw/CopyPixels. This shader is made + * by combining the pixel transfer shader with the user-defined shader. + * \param fpIn the current/incoming fragment program + * \param fpOut returns the combined fragment program + */ +void +st_make_drawpix_fragment_program(struct st_context *st, + struct gl_fragment_program *fpIn, + struct gl_fragment_program **fpOut) +{ + struct gl_program *newProg; + + if (is_passthrough_program(fpIn)) { + newProg = (struct gl_program *) _mesa_clone_fragment_program(st->ctx, + &st->pixel_xfer.program->Base); + } + else { +#if 0 + /* debug */ + printf("Base program:\n"); + _mesa_print_program(&fpIn->Base); + printf("DrawPix program:\n"); + _mesa_print_program(&st->pixel_xfer.program->Base.Base); +#endif + newProg = _mesa_combine_programs(st->ctx, + &st->pixel_xfer.program->Base.Base, + &fpIn->Base); + } + +#if 0 + /* debug */ + printf("Combined DrawPixels program:\n"); + _mesa_print_program(newProg); + printf("InputsRead: 0x%x\n", newProg->InputsRead); + printf("OutputsWritten: 0x%x\n", newProg->OutputsWritten); + _mesa_print_parameter_list(newProg->Parameters); +#endif + + *fpOut = (struct gl_fragment_program *) newProg; +} + + +/** + * Create fragment program that does a TEX() instruction to get a Z and/or + * stencil value value, then writes to FRAG_RESULT_DEPTH/FRAG_RESULT_STENCIL. + * Used for glDrawPixels(GL_DEPTH_COMPONENT / GL_STENCIL_INDEX). + * Pass fragment color through as-is. + * \return pointer to the gl_fragment program + */ +struct gl_fragment_program * +st_make_drawpix_z_stencil_program(struct st_context *st, + GLboolean write_depth, + GLboolean write_stencil) +{ + struct gl_context *ctx = st->ctx; + struct gl_program *p; + struct gl_fragment_program *fp; + GLuint ic = 0; + const GLuint shaderIndex = write_depth * 2 + write_stencil; + + assert(shaderIndex < Elements(st->drawpix.shaders)); + + if (st->drawpix.shaders[shaderIndex]) { + /* already have the proper shader */ + return st->drawpix.shaders[shaderIndex]; + } + + /* + * Create shader now + */ + p = ctx->Driver.NewProgram(ctx, GL_FRAGMENT_PROGRAM_ARB, 0); + if (!p) + return NULL; + + p->NumInstructions = write_depth ? 2 : 1; + p->NumInstructions += write_stencil ? 1 : 0; + + p->Instructions = _mesa_alloc_instructions(p->NumInstructions); + if (!p->Instructions) { + ctx->Driver.DeleteProgram(ctx, p); + return NULL; + } + _mesa_init_instructions(p->Instructions, p->NumInstructions); + + if (write_depth) { + /* TEX result.depth, fragment.texcoord[0], texture[0], 2D; */ + p->Instructions[ic].Opcode = OPCODE_TEX; + p->Instructions[ic].DstReg.File = PROGRAM_OUTPUT; + p->Instructions[ic].DstReg.Index = FRAG_RESULT_DEPTH; + p->Instructions[ic].DstReg.WriteMask = WRITEMASK_Z; + p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT; + p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0; + p->Instructions[ic].TexSrcUnit = 0; + p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX; + ic++; + } + + if (write_stencil) { + /* TEX result.stencil, fragment.texcoord[0], texture[0], 2D; */ + p->Instructions[ic].Opcode = OPCODE_TEX; + p->Instructions[ic].DstReg.File = PROGRAM_OUTPUT; + p->Instructions[ic].DstReg.Index = FRAG_RESULT_STENCIL; + p->Instructions[ic].DstReg.WriteMask = WRITEMASK_Y; + p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT; + p->Instructions[ic].SrcReg[0].Index = FRAG_ATTRIB_TEX0; + p->Instructions[ic].TexSrcUnit = 1; + p->Instructions[ic].TexSrcTarget = TEXTURE_2D_INDEX; + ic++; + } + + /* END; */ + p->Instructions[ic++].Opcode = OPCODE_END; + + assert(ic == p->NumInstructions); + + p->InputsRead = FRAG_BIT_TEX0 | FRAG_BIT_COL0; + p->OutputsWritten = 0; + if (write_depth) + p->OutputsWritten |= (1 << FRAG_RESULT_DEPTH); + if (write_stencil) + p->OutputsWritten |= (1 << FRAG_RESULT_STENCIL); + + p->SamplersUsed = 0x1; /* sampler 0 (bit 0) is used */ + if (write_stencil) + p->SamplersUsed |= 1 << 1; + + fp = (struct gl_fragment_program *) p; + + /* save the new shader */ + st->drawpix.shaders[shaderIndex] = fp; + + return fp; +} + + +/** + * Create a simple vertex shader that just passes through the + * vertex position and texcoord (and optionally, color). + */ +static void * +make_passthrough_vertex_shader(struct st_context *st, + GLboolean passColor) +{ + if (!st->drawpix.vert_shaders[passColor]) { + struct ureg_program *ureg = ureg_create( TGSI_PROCESSOR_VERTEX ); + + if (ureg == NULL) + return NULL; + + /* MOV result.pos, vertex.pos; */ + ureg_MOV(ureg, + ureg_DECL_output( ureg, TGSI_SEMANTIC_POSITION, 0 ), + ureg_DECL_vs_input( ureg, 0 )); + + /* MOV result.texcoord0, vertex.attr[1]; */ + ureg_MOV(ureg, + ureg_DECL_output( ureg, TGSI_SEMANTIC_GENERIC, 0 ), + ureg_DECL_vs_input( ureg, 1 )); + + if (passColor) { + /* MOV result.color0, vertex.attr[2]; */ + ureg_MOV(ureg, + ureg_DECL_output( ureg, TGSI_SEMANTIC_COLOR, 0 ), + ureg_DECL_vs_input( ureg, 2 )); + } + + ureg_END( ureg ); + + st->drawpix.vert_shaders[passColor] = + ureg_create_shader_and_destroy( ureg, st->pipe ); + } + + return st->drawpix.vert_shaders[passColor]; +} + + +/** + * Return a texture base format for drawing/copying an image + * of the given format. + */ +static GLenum +base_format(GLenum format) +{ + switch (format) { + case GL_DEPTH_COMPONENT: + return GL_DEPTH_COMPONENT; + case GL_DEPTH_STENCIL: + return GL_DEPTH_STENCIL; + case GL_STENCIL_INDEX: + return GL_STENCIL_INDEX; + default: + return GL_RGBA; + } +} + + +/** + * Return a texture internalFormat for drawing/copying an image + * of the given format and type. + */ +static GLenum +internal_format(GLenum format, GLenum type) +{ + switch (format) { + case GL_DEPTH_COMPONENT: + return GL_DEPTH_COMPONENT; + case GL_DEPTH_STENCIL: + return GL_DEPTH_STENCIL; + case GL_STENCIL_INDEX: + return GL_STENCIL_INDEX; + default: + if (_mesa_is_integer_format(format)) { + switch (type) { + case GL_BYTE: + return GL_RGBA8I; + case GL_UNSIGNED_BYTE: + return GL_RGBA8UI; + case GL_SHORT: + return GL_RGBA16I; + case GL_UNSIGNED_SHORT: + return GL_RGBA16UI; + case GL_INT: + return GL_RGBA32I; + case GL_UNSIGNED_INT: + return GL_RGBA32UI; + default: + assert(0 && "Unexpected type in internal_format()"); + return GL_RGBA_INTEGER; + } + } + else { + return GL_RGBA; + } + } +} + + +/** + * Create a temporary texture to hold an image of the given size. + * If width, height are not POT and the driver only handles POT textures, + * allocate the next larger size of texture that is POT. + */ +static struct pipe_resource * +alloc_texture(struct st_context *st, GLsizei width, GLsizei height, + enum pipe_format texFormat) +{ + struct pipe_resource *pt; + + pt = st_texture_create(st, st->internal_target, texFormat, 0, + width, height, 1, 1, PIPE_BIND_SAMPLER_VIEW); + + return pt; +} + + +/** + * Make texture containing an image for glDrawPixels image. + * If 'pixels' is NULL, leave the texture image data undefined. + */ +static struct pipe_resource * +make_texture(struct st_context *st, + GLsizei width, GLsizei height, GLenum format, GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid *pixels) +{ + struct gl_context *ctx = st->ctx; + struct pipe_context *pipe = st->pipe; + gl_format mformat; + struct pipe_resource *pt; + enum pipe_format pipeFormat; + GLuint cpp; + GLenum baseFormat, intFormat; + + baseFormat = base_format(format); + intFormat = internal_format(format, type); + + mformat = st_ChooseTextureFormat_renderable(ctx, intFormat, + format, type, GL_FALSE); + assert(mformat); + + pipeFormat = st_mesa_format_to_pipe_format(mformat); + assert(pipeFormat); + cpp = util_format_get_blocksize(pipeFormat); + + pixels = _mesa_map_pbo_source(ctx, unpack, pixels); + if (!pixels) + return NULL; + + /* alloc temporary texture */ + pt = alloc_texture(st, width, height, pipeFormat); + if (!pt) { + _mesa_unmap_pbo_source(ctx, unpack); + return NULL; + } + + { + struct pipe_transfer *transfer; + static const GLuint dstImageOffsets = 0; + GLboolean success; + GLubyte *dest; + const GLbitfield imageTransferStateSave = ctx->_ImageTransferState; + + /* we'll do pixel transfer in a fragment shader */ + ctx->_ImageTransferState = 0x0; + + transfer = pipe_get_transfer(st->pipe, pt, 0, 0, + PIPE_TRANSFER_WRITE, 0, 0, + width, height); + + /* map texture transfer */ + dest = pipe_transfer_map(pipe, transfer); + + + /* Put image into texture transfer. + * Note that the image is actually going to be upside down in + * the texture. We deal with that with texcoords. + */ + success = _mesa_texstore(ctx, 2, /* dims */ + baseFormat, /* baseInternalFormat */ + mformat, /* gl_format */ + dest, /* dest */ + 0, 0, 0, /* dstX/Y/Zoffset */ + transfer->stride, /* dstRowStride, bytes */ + &dstImageOffsets, /* dstImageOffsets */ + width, height, 1, /* size */ + format, type, /* src format/type */ + pixels, /* data source */ + unpack); + + /* unmap */ + pipe_transfer_unmap(pipe, transfer); + pipe->transfer_destroy(pipe, transfer); + + assert(success); + + /* restore */ + ctx->_ImageTransferState = imageTransferStateSave; + } + + _mesa_unmap_pbo_source(ctx, unpack); + + return pt; +} + + +/** + * Draw quad with texcoords and optional color. + * Coords are gallium window coords with y=0=top. + * \param color may be null + * \param invertTex if true, flip texcoords vertically + */ +static void +draw_quad(struct gl_context *ctx, GLfloat x0, GLfloat y0, GLfloat z, + GLfloat x1, GLfloat y1, const GLfloat *color, + GLboolean invertTex, GLfloat maxXcoord, GLfloat maxYcoord) +{ + struct st_context *st = st_context(ctx); + struct pipe_context *pipe = st->pipe; + GLfloat verts[4][3][4]; /* four verts, three attribs, XYZW */ + + /* setup vertex data */ + { + const struct gl_framebuffer *fb = st->ctx->DrawBuffer; + const GLfloat fb_width = (GLfloat) fb->Width; + const GLfloat fb_height = (GLfloat) fb->Height; + const GLfloat clip_x0 = x0 / fb_width * 2.0f - 1.0f; + const GLfloat clip_y0 = y0 / fb_height * 2.0f - 1.0f; + const GLfloat clip_x1 = x1 / fb_width * 2.0f - 1.0f; + const GLfloat clip_y1 = y1 / fb_height * 2.0f - 1.0f; + const GLfloat sLeft = 0.0f, sRight = maxXcoord; + const GLfloat tTop = invertTex ? maxYcoord : 0.0f; + const GLfloat tBot = invertTex ? 0.0f : maxYcoord; + GLuint i; + + /* upper-left */ + verts[0][0][0] = clip_x0; /* v[0].attr[0].x */ + verts[0][0][1] = clip_y0; /* v[0].attr[0].y */ + + /* upper-right */ + verts[1][0][0] = clip_x1; + verts[1][0][1] = clip_y0; + + /* lower-right */ + verts[2][0][0] = clip_x1; + verts[2][0][1] = clip_y1; + + /* lower-left */ + verts[3][0][0] = clip_x0; + verts[3][0][1] = clip_y1; + + verts[0][1][0] = sLeft; /* v[0].attr[1].S */ + verts[0][1][1] = tTop; /* v[0].attr[1].T */ + verts[1][1][0] = sRight; + verts[1][1][1] = tTop; + verts[2][1][0] = sRight; + verts[2][1][1] = tBot; + verts[3][1][0] = sLeft; + verts[3][1][1] = tBot; + + /* same for all verts: */ + if (color) { + for (i = 0; i < 4; i++) { + verts[i][0][2] = z; /* v[i].attr[0].z */ + verts[i][0][3] = 1.0f; /* v[i].attr[0].w */ + verts[i][2][0] = color[0]; /* v[i].attr[2].r */ + verts[i][2][1] = color[1]; /* v[i].attr[2].g */ + verts[i][2][2] = color[2]; /* v[i].attr[2].b */ + verts[i][2][3] = color[3]; /* v[i].attr[2].a */ + verts[i][1][2] = 0.0f; /* v[i].attr[1].R */ + verts[i][1][3] = 1.0f; /* v[i].attr[1].Q */ + } + } + else { + for (i = 0; i < 4; i++) { + verts[i][0][2] = z; /*Z*/ + verts[i][0][3] = 1.0f; /*W*/ + verts[i][1][2] = 0.0f; /*R*/ + verts[i][1][3] = 1.0f; /*Q*/ + } + } + } + + { + struct pipe_resource *buf; + + /* allocate/load buffer object with vertex data */ + buf = pipe_buffer_create(pipe->screen, + PIPE_BIND_VERTEX_BUFFER, + PIPE_USAGE_STATIC, + sizeof(verts)); + pipe_buffer_write(st->pipe, buf, 0, sizeof(verts), verts); + + util_draw_vertex_buffer(pipe, st->cso_context, buf, 0, + PIPE_PRIM_QUADS, + 4, /* verts */ + 3); /* attribs/vert */ + pipe_resource_reference(&buf, NULL); + } +} + + + +static void +draw_textured_quad(struct gl_context *ctx, GLint x, GLint y, GLfloat z, + GLsizei width, GLsizei height, + GLfloat zoomX, GLfloat zoomY, + struct pipe_sampler_view **sv, + int num_sampler_view, + void *driver_vp, + void *driver_fp, + const GLfloat *color, + GLboolean invertTex, + GLboolean write_depth, GLboolean write_stencil) +{ + struct st_context *st = st_context(ctx); + struct pipe_context *pipe = st->pipe; + struct cso_context *cso = st->cso_context; + GLfloat x0, y0, x1, y1; + GLsizei maxSize; + boolean normalized = sv[0]->texture->target != PIPE_TEXTURE_RECT; + + /* limit checks */ + /* XXX if DrawPixels image is larger than max texture size, break + * it up into chunks. + */ + maxSize = 1 << (pipe->screen->get_param(pipe->screen, + PIPE_CAP_MAX_TEXTURE_2D_LEVELS) - 1); + assert(width <= maxSize); + assert(height <= maxSize); + + cso_save_rasterizer(cso); + cso_save_viewport(cso); + cso_save_samplers(cso); + cso_save_fragment_sampler_views(cso); + cso_save_fragment_shader(cso); + cso_save_vertex_shader(cso); + cso_save_vertex_elements(cso); + cso_save_vertex_buffers(cso); + if (write_stencil) { + cso_save_depth_stencil_alpha(cso); + cso_save_blend(cso); + } + + /* rasterizer state: just scissor */ + { + struct pipe_rasterizer_state rasterizer; + memset(&rasterizer, 0, sizeof(rasterizer)); + rasterizer.gl_rasterization_rules = 1; + rasterizer.scissor = ctx->Scissor.Enabled; + cso_set_rasterizer(cso, &rasterizer); + } + + if (write_stencil) { + /* Stencil writing bypasses the normal fragment pipeline to + * disable color writing and set stencil test to always pass. + */ + struct pipe_depth_stencil_alpha_state dsa; + struct pipe_blend_state blend; + + /* depth/stencil */ + memset(&dsa, 0, sizeof(dsa)); + dsa.stencil[0].enabled = 1; + dsa.stencil[0].func = PIPE_FUNC_ALWAYS; + dsa.stencil[0].writemask = ctx->Stencil.WriteMask[0] & 0xff; + dsa.stencil[0].zpass_op = PIPE_STENCIL_OP_REPLACE; + if (write_depth) { + /* writing depth+stencil: depth test always passes */ + dsa.depth.enabled = 1; + dsa.depth.writemask = ctx->Depth.Mask; + dsa.depth.func = PIPE_FUNC_ALWAYS; + } + cso_set_depth_stencil_alpha(cso, &dsa); + + /* blend (colormask) */ + memset(&blend, 0, sizeof(blend)); + cso_set_blend(cso, &blend); + } + + /* fragment shader state: TEX lookup program */ + cso_set_fragment_shader_handle(cso, driver_fp); + + /* vertex shader state: position + texcoord pass-through */ + cso_set_vertex_shader_handle(cso, driver_vp); + + + /* texture sampling state: */ + { + struct pipe_sampler_state sampler; + memset(&sampler, 0, sizeof(sampler)); + sampler.wrap_s = PIPE_TEX_WRAP_CLAMP; + sampler.wrap_t = PIPE_TEX_WRAP_CLAMP; + sampler.wrap_r = PIPE_TEX_WRAP_CLAMP; + sampler.min_img_filter = PIPE_TEX_FILTER_NEAREST; + sampler.min_mip_filter = PIPE_TEX_MIPFILTER_NONE; + sampler.mag_img_filter = PIPE_TEX_FILTER_NEAREST; + sampler.normalized_coords = normalized; + + cso_single_sampler(cso, 0, &sampler); + if (num_sampler_view > 1) { + cso_single_sampler(cso, 1, &sampler); + } + cso_single_sampler_done(cso); + } + + /* viewport state: viewport matching window dims */ + { + const float w = (float) ctx->DrawBuffer->Width; + const float h = (float) ctx->DrawBuffer->Height; + struct pipe_viewport_state vp; + vp.scale[0] = 0.5f * w; + vp.scale[1] = -0.5f * h; + vp.scale[2] = 0.5f; + vp.scale[3] = 1.0f; + vp.translate[0] = 0.5f * w; + vp.translate[1] = 0.5f * h; + vp.translate[2] = 0.5f; + vp.translate[3] = 0.0f; + cso_set_viewport(cso, &vp); + } + + cso_set_vertex_elements(cso, 3, st->velems_util_draw); + + /* texture state: */ + cso_set_fragment_sampler_views(cso, num_sampler_view, sv); + + /* Compute Gallium window coords (y=0=top) with pixel zoom. + * Recall that these coords are transformed by the current + * vertex shader and viewport transformation. + */ + if (st_fb_orientation(ctx->DrawBuffer) == Y_0_BOTTOM) { + y = ctx->DrawBuffer->Height - (int) (y + height * ctx->Pixel.ZoomY); + invertTex = !invertTex; + } + + x0 = (GLfloat) x; + x1 = x + width * ctx->Pixel.ZoomX; + y0 = (GLfloat) y; + y1 = y + height * ctx->Pixel.ZoomY; + + /* convert Z from [0,1] to [-1,-1] to match viewport Z scale/bias */ + z = z * 2.0 - 1.0; + + draw_quad(ctx, x0, y0, z, x1, y1, color, invertTex, + normalized ? ((GLfloat) width / sv[0]->texture->width0) : (GLfloat)width, + normalized ? ((GLfloat) height / sv[0]->texture->height0) : (GLfloat)height); + + /* restore state */ + cso_restore_rasterizer(cso); + cso_restore_viewport(cso); + cso_restore_samplers(cso); + cso_restore_fragment_sampler_views(cso); + cso_restore_fragment_shader(cso); + cso_restore_vertex_shader(cso); + cso_restore_vertex_elements(cso); + cso_restore_vertex_buffers(cso); + if (write_stencil) { + cso_restore_depth_stencil_alpha(cso); + cso_restore_blend(cso); + } +} + + +/** + * Software fallback to do glDrawPixels(GL_STENCIL_INDEX) when we + * can't use a fragment shader to write stencil values. + */ +static void +draw_stencil_pixels(struct gl_context *ctx, GLint x, GLint y, + GLsizei width, GLsizei height, GLenum format, GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid *pixels) +{ + struct st_context *st = st_context(ctx); + struct pipe_context *pipe = st->pipe; + struct st_renderbuffer *strb; + enum pipe_transfer_usage usage; + struct pipe_transfer *pt; + const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0; + GLint skipPixels; + ubyte *stmap; + struct gl_pixelstore_attrib clippedUnpack = *unpack; + + if (!zoom) { + if (!_mesa_clip_drawpixels(ctx, &x, &y, &width, &height, + &clippedUnpack)) { + /* totally clipped */ + return; + } + } + + strb = st_renderbuffer(ctx->DrawBuffer-> + Attachment[BUFFER_STENCIL].Renderbuffer); + + if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) { + y = ctx->DrawBuffer->Height - y - height; + } + + if(format != GL_DEPTH_STENCIL && + util_format_get_component_bits(strb->format, + UTIL_FORMAT_COLORSPACE_ZS, 0) != 0) + usage = PIPE_TRANSFER_READ_WRITE; + else + usage = PIPE_TRANSFER_WRITE; + + pt = pipe_get_transfer(st_context(ctx)->pipe, strb->texture, 0, 0, + usage, x, y, + width, height); + + stmap = pipe_transfer_map(pipe, pt); + + pixels = _mesa_map_pbo_source(ctx, &clippedUnpack, pixels); + assert(pixels); + + /* if width > MAX_WIDTH, have to process image in chunks */ + skipPixels = 0; + while (skipPixels < width) { + const GLint spanX = skipPixels; + const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH); + GLint row; + for (row = 0; row < height; row++) { + GLubyte sValues[MAX_WIDTH]; + GLuint zValues[MAX_WIDTH]; + GLenum destType = GL_UNSIGNED_BYTE; + const GLvoid *source = _mesa_image_address2d(&clippedUnpack, pixels, + width, height, + format, type, + row, skipPixels); + _mesa_unpack_stencil_span(ctx, spanWidth, destType, sValues, + type, source, &clippedUnpack, + ctx->_ImageTransferState); + + if (format == GL_DEPTH_STENCIL) { + _mesa_unpack_depth_span(ctx, spanWidth, GL_UNSIGNED_INT, zValues, + (1 << 24) - 1, type, source, + &clippedUnpack); + } + + if (zoom) { + _mesa_problem(ctx, "Gallium glDrawPixels(GL_STENCIL) with " + "zoom not complete"); + } + + { + GLint spanY; + + if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) { + spanY = height - row - 1; + } + else { + spanY = row; + } + + /* now pack the stencil (and Z) values in the dest format */ + switch (pt->resource->format) { + case PIPE_FORMAT_S8_USCALED: + { + ubyte *dest = stmap + spanY * pt->stride + spanX; + assert(usage == PIPE_TRANSFER_WRITE); + memcpy(dest, sValues, spanWidth); + } + break; + case PIPE_FORMAT_Z24_UNORM_S8_USCALED: + if (format == GL_DEPTH_STENCIL) { + uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4); + GLint k; + assert(usage == PIPE_TRANSFER_WRITE); + for (k = 0; k < spanWidth; k++) { + dest[k] = zValues[k] | (sValues[k] << 24); + } + } + else { + uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4); + GLint k; + assert(usage == PIPE_TRANSFER_READ_WRITE); + for (k = 0; k < spanWidth; k++) { + dest[k] = (dest[k] & 0xffffff) | (sValues[k] << 24); + } + } + break; + case PIPE_FORMAT_S8_USCALED_Z24_UNORM: + if (format == GL_DEPTH_STENCIL) { + uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4); + GLint k; + assert(usage == PIPE_TRANSFER_WRITE); + for (k = 0; k < spanWidth; k++) { + dest[k] = (zValues[k] << 8) | (sValues[k] & 0xff); + } + } + else { + uint *dest = (uint *) (stmap + spanY * pt->stride + spanX*4); + GLint k; + assert(usage == PIPE_TRANSFER_READ_WRITE); + for (k = 0; k < spanWidth; k++) { + dest[k] = (dest[k] & 0xffffff00) | (sValues[k] & 0xff); + } + } + break; + default: + assert(0); + } + } + } + skipPixels += spanWidth; + } + + _mesa_unmap_pbo_source(ctx, &clippedUnpack); + + /* unmap the stencil buffer */ + pipe_transfer_unmap(pipe, pt); + pipe->transfer_destroy(pipe, pt); +} + + +/** + * Get fragment program variant for a glDrawPixels or glCopyPixels + * command for RGBA data. + */ +static struct st_fp_variant * +get_color_fp_variant(struct st_context *st) +{ + struct gl_context *ctx = st->ctx; + struct st_fp_variant_key key; + struct st_fp_variant *fpv; + + memset(&key, 0, sizeof(key)); + + key.st = st; + key.drawpixels = 1; + key.scaleAndBias = (ctx->Pixel.RedBias != 0.0 || + ctx->Pixel.RedScale != 1.0 || + ctx->Pixel.GreenBias != 0.0 || + ctx->Pixel.GreenScale != 1.0 || + ctx->Pixel.BlueBias != 0.0 || + ctx->Pixel.BlueScale != 1.0 || + ctx->Pixel.AlphaBias != 0.0 || + ctx->Pixel.AlphaScale != 1.0); + key.pixelMaps = ctx->Pixel.MapColorFlag; + + fpv = st_get_fp_variant(st, st->fp, &key); + + return fpv; +} + + +/** + * Get fragment program variant for a glDrawPixels or glCopyPixels + * command for depth/stencil data. + */ +static struct st_fp_variant * +get_depth_stencil_fp_variant(struct st_context *st, GLboolean write_depth, + GLboolean write_stencil) +{ + struct st_fp_variant_key key; + struct st_fp_variant *fpv; + + memset(&key, 0, sizeof(key)); + + key.st = st; + key.drawpixels = 1; + key.drawpixels_z = write_depth; + key.drawpixels_stencil = write_stencil; + + fpv = st_get_fp_variant(st, st->fp, &key); + + return fpv; +} + + +/** + * Called via ctx->Driver.DrawPixels() + */ +static void +st_DrawPixels(struct gl_context *ctx, GLint x, GLint y, + GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels) +{ + void *driver_vp, *driver_fp; + struct st_context *st = st_context(ctx); + const GLfloat *color; + struct pipe_context *pipe = st->pipe; + GLboolean write_stencil = GL_FALSE, write_depth = GL_FALSE; + struct pipe_sampler_view *sv[2]; + int num_sampler_view = 1; + enum pipe_format stencil_format = PIPE_FORMAT_NONE; + struct st_fp_variant *fpv; + + if (format == GL_DEPTH_STENCIL) + write_stencil = write_depth = GL_TRUE; + else if (format == GL_STENCIL_INDEX) + write_stencil = GL_TRUE; + else if (format == GL_DEPTH_COMPONENT) + write_depth = GL_TRUE; + + if (write_stencil) { + enum pipe_format tex_format; + /* can we write to stencil if not fallback */ + if (!pipe->screen->get_param(pipe->screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) + goto stencil_fallback; + + tex_format = st_choose_format(st->pipe->screen, base_format(format), + PIPE_TEXTURE_2D, + 0, PIPE_BIND_SAMPLER_VIEW); + if (tex_format == PIPE_FORMAT_Z24_UNORM_S8_USCALED) + stencil_format = PIPE_FORMAT_X24S8_USCALED; + else if (tex_format == PIPE_FORMAT_S8_USCALED_Z24_UNORM) + stencil_format = PIPE_FORMAT_S8X24_USCALED; + else + stencil_format = PIPE_FORMAT_S8_USCALED; + if (stencil_format == PIPE_FORMAT_NONE) + goto stencil_fallback; + } + + /* Mesa state should be up to date by now */ + assert(ctx->NewState == 0x0); + + st_validate_state(st); + + /* + * Get vertex/fragment shaders + */ + if (write_depth || write_stencil) { + fpv = get_depth_stencil_fp_variant(st, write_depth, write_stencil); + + driver_fp = fpv->driver_shader; + + driver_vp = make_passthrough_vertex_shader(st, GL_TRUE); + + color = ctx->Current.RasterColor; + } + else { + fpv = get_color_fp_variant(st); + + driver_fp = fpv->driver_shader; + + driver_vp = make_passthrough_vertex_shader(st, GL_FALSE); + + color = NULL; + if (st->pixel_xfer.pixelmap_enabled) { + sv[1] = st->pixel_xfer.pixelmap_sampler_view; + num_sampler_view++; + } + } + + /* update fragment program constants */ + st_upload_constants(st, fpv->parameters, PIPE_SHADER_FRAGMENT); + + /* draw with textured quad */ + { + struct pipe_resource *pt + = make_texture(st, width, height, format, type, unpack, pixels); + if (pt) { + sv[0] = st_create_texture_sampler_view(st->pipe, pt); + + if (sv[0]) { + if (write_stencil) { + sv[1] = st_create_texture_sampler_view_format(st->pipe, pt, + stencil_format); + num_sampler_view++; + } + + draw_textured_quad(ctx, x, y, ctx->Current.RasterPos[2], + width, height, + ctx->Pixel.ZoomX, ctx->Pixel.ZoomY, + sv, + num_sampler_view, + driver_vp, + driver_fp, + color, GL_FALSE, write_depth, write_stencil); + pipe_sampler_view_reference(&sv[0], NULL); + if (num_sampler_view > 1) + pipe_sampler_view_reference(&sv[1], NULL); + } + pipe_resource_reference(&pt, NULL); + } + } + return; + +stencil_fallback: + draw_stencil_pixels(ctx, x, y, width, height, format, type, + unpack, pixels); +} + + + +/** + * Software fallback for glCopyPixels(GL_STENCIL). + */ +static void +copy_stencil_pixels(struct gl_context *ctx, GLint srcx, GLint srcy, + GLsizei width, GLsizei height, + GLint dstx, GLint dsty) +{ + struct st_renderbuffer *rbDraw; + struct pipe_context *pipe = st_context(ctx)->pipe; + enum pipe_transfer_usage usage; + struct pipe_transfer *ptDraw; + ubyte *drawMap; + ubyte *buffer; + int i; + + buffer = malloc(width * height * sizeof(ubyte)); + if (!buffer) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyPixels(stencil)"); + return; + } + + /* Get the dest renderbuffer. If there's a wrapper, use the + * underlying renderbuffer. + */ + rbDraw = st_renderbuffer(ctx->DrawBuffer->_StencilBuffer); + if (rbDraw->Base.Wrapped) + rbDraw = st_renderbuffer(rbDraw->Base.Wrapped); + + /* this will do stencil pixel transfer ops */ + st_read_stencil_pixels(ctx, srcx, srcy, width, height, + GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, + &ctx->DefaultPacking, buffer); + + if (0) { + /* debug code: dump stencil values */ + GLint row, col; + for (row = 0; row < height; row++) { + printf("%3d: ", row); + for (col = 0; col < width; col++) { + printf("%02x ", buffer[col + row * width]); + } + printf("\n"); + } + } + + if (util_format_get_component_bits(rbDraw->format, + UTIL_FORMAT_COLORSPACE_ZS, 0) != 0) + usage = PIPE_TRANSFER_READ_WRITE; + else + usage = PIPE_TRANSFER_WRITE; + + if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) { + dsty = rbDraw->Base.Height - dsty - height; + } + + ptDraw = pipe_get_transfer(st_context(ctx)->pipe, + rbDraw->texture, 0, 0, + usage, dstx, dsty, + width, height); + + assert(util_format_get_blockwidth(ptDraw->resource->format) == 1); + assert(util_format_get_blockheight(ptDraw->resource->format) == 1); + + /* map the stencil buffer */ + drawMap = pipe_transfer_map(pipe, ptDraw); + + /* draw */ + /* XXX PixelZoom not handled yet */ + for (i = 0; i < height; i++) { + ubyte *dst; + const ubyte *src; + int y; + + y = i; + + if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP) { + y = height - y - 1; + } + + dst = drawMap + y * ptDraw->stride; + src = buffer + i * width; + + switch (ptDraw->resource->format) { + case PIPE_FORMAT_Z24_UNORM_S8_USCALED: + { + uint *dst4 = (uint *) dst; + int j; + assert(usage == PIPE_TRANSFER_READ_WRITE); + for (j = 0; j < width; j++) { + *dst4 = (*dst4 & 0xffffff) | (src[j] << 24); + dst4++; + } + } + break; + case PIPE_FORMAT_S8_USCALED_Z24_UNORM: + { + uint *dst4 = (uint *) dst; + int j; + assert(usage == PIPE_TRANSFER_READ_WRITE); + for (j = 0; j < width; j++) { + *dst4 = (*dst4 & 0xffffff00) | (src[j] & 0xff); + dst4++; + } + } + break; + case PIPE_FORMAT_S8_USCALED: + assert(usage == PIPE_TRANSFER_WRITE); + memcpy(dst, src, width); + break; + default: + assert(0); + } + } + + free(buffer); + + /* unmap the stencil buffer */ + pipe_transfer_unmap(pipe, ptDraw); + pipe->transfer_destroy(pipe, ptDraw); +} + + +/** Do the src/dest regions overlap? */ +static GLboolean +regions_overlap(GLint srcX, GLint srcY, GLint dstX, GLint dstY, + GLsizei width, GLsizei height) +{ + if (srcX + width <= dstX || + dstX + width <= srcX || + srcY + height <= dstY || + dstY + height <= srcY) + return GL_FALSE; + else + return GL_TRUE; +} + + +/** + * Try to do a glCopyPixels for simple cases with a blit by calling + * pipe->resource_copy_region(). + * + * We can do this when we're copying color pixels (depth/stencil + * eventually) with no pixel zoom, no pixel transfer ops, no + * per-fragment ops, the src/dest regions don't overlap and the + * src/dest pixel formats are the same. + */ +static GLboolean +blit_copy_pixels(struct gl_context *ctx, GLint srcx, GLint srcy, + GLsizei width, GLsizei height, + GLint dstx, GLint dsty, GLenum type) +{ + struct st_context *st = st_context(ctx); + struct pipe_context *pipe = st->pipe; + struct gl_pixelstore_attrib pack, unpack; + GLint readX, readY, readW, readH; + + if (type == GL_COLOR && + ctx->Pixel.ZoomX == 1.0 && + ctx->Pixel.ZoomY == 1.0 && + ctx->_ImageTransferState == 0x0 && + !ctx->Color.BlendEnabled && + !ctx->Color.AlphaEnabled && + !ctx->Depth.Test && + !ctx->Fog.Enabled && + !ctx->Stencil.Enabled && + !ctx->FragmentProgram.Enabled && + !ctx->VertexProgram.Enabled && + !ctx->Shader.CurrentFragmentProgram && + st_fb_orientation(ctx->ReadBuffer) == st_fb_orientation(ctx->DrawBuffer) && + ctx->DrawBuffer->_NumColorDrawBuffers == 1) { + struct st_renderbuffer *rbRead, *rbDraw; + GLint drawX, drawY; + + /* + * Clip the read region against the src buffer bounds. + * We'll still allocate a temporary buffer/texture for the original + * src region size but we'll only read the region which is on-screen. + * This may mean that we draw garbage pixels into the dest region, but + * that's expected. + */ + readX = srcx; + readY = srcy; + readW = width; + readH = height; + pack = ctx->DefaultPacking; + if (!_mesa_clip_readpixels(ctx, &readX, &readY, &readW, &readH, &pack)) + return GL_TRUE; /* all done */ + + /* clip against dest buffer bounds and scissor box */ + drawX = dstx + pack.SkipPixels; + drawY = dsty + pack.SkipRows; + unpack = pack; + if (!_mesa_clip_drawpixels(ctx, &drawX, &drawY, &readW, &readH, &unpack)) + return GL_TRUE; /* all done */ + + readX = readX - pack.SkipPixels + unpack.SkipPixels; + readY = readY - pack.SkipRows + unpack.SkipRows; + + rbRead = st_get_color_read_renderbuffer(ctx); + rbDraw = st_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[0]); + + if ((rbRead != rbDraw || + !regions_overlap(readX, readY, drawX, drawY, readW, readH)) && + rbRead->Base.Format == rbDraw->Base.Format) { + struct pipe_box srcBox; + + /* flip src/dst position if needed */ + if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) { + /* both buffers will have the same orientation */ + readY = ctx->ReadBuffer->Height - readY - readH; + drawY = ctx->DrawBuffer->Height - drawY - readH; + } + + u_box_2d(readX, readY, readW, readH, &srcBox); + + pipe->resource_copy_region(pipe, + rbDraw->texture, 0, drawX, drawY, 0, + rbRead->texture, 0, &srcBox); + return GL_TRUE; + } + } + + return GL_FALSE; +} + + +static void +st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy, + GLsizei width, GLsizei height, + GLint dstx, GLint dsty, GLenum type) +{ + struct st_context *st = st_context(ctx); + struct pipe_context *pipe = st->pipe; + struct pipe_screen *screen = pipe->screen; + struct st_renderbuffer *rbRead; + void *driver_vp, *driver_fp; + struct pipe_resource *pt; + struct pipe_sampler_view *sv[2]; + int num_sampler_view = 1; + GLfloat *color; + enum pipe_format srcFormat, texFormat; + GLboolean invertTex = GL_FALSE; + GLint readX, readY, readW, readH; + GLuint sample_count; + struct gl_pixelstore_attrib pack = ctx->DefaultPacking; + struct st_fp_variant *fpv; + + st_validate_state(st); + + if (type == GL_STENCIL) { + /* can't use texturing to do stencil */ + copy_stencil_pixels(ctx, srcx, srcy, width, height, dstx, dsty); + return; + } + + if (blit_copy_pixels(ctx, srcx, srcy, width, height, dstx, dsty, type)) + return; + + /* + * The subsequent code implements glCopyPixels by copying the source + * pixels into a temporary texture that's then applied to a textured quad. + * When we draw the textured quad, all the usual per-fragment operations + * are handled. + */ + + + /* + * Get vertex/fragment shaders + */ + if (type == GL_COLOR) { + rbRead = st_get_color_read_renderbuffer(ctx); + color = NULL; + + fpv = get_color_fp_variant(st); + driver_fp = fpv->driver_shader; + + driver_vp = make_passthrough_vertex_shader(st, GL_FALSE); + + if (st->pixel_xfer.pixelmap_enabled) { + sv[1] = st->pixel_xfer.pixelmap_sampler_view; + num_sampler_view++; + } + } + else { + assert(type == GL_DEPTH); + rbRead = st_renderbuffer(ctx->ReadBuffer->_DepthBuffer); + color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; + + fpv = get_depth_stencil_fp_variant(st, GL_TRUE, GL_FALSE); + driver_fp = fpv->driver_shader; + + driver_vp = make_passthrough_vertex_shader(st, GL_TRUE); + } + + /* update fragment program constants */ + st_upload_constants(st, fpv->parameters, PIPE_SHADER_FRAGMENT); + + + if (rbRead->Base.Wrapped) + rbRead = st_renderbuffer(rbRead->Base.Wrapped); + + sample_count = rbRead->texture->nr_samples; + /* I believe this would be legal, presumably would need to do a resolve + for color, and for depth/stencil spec says to just use one of the + depth/stencil samples per pixel? Need some transfer clarifications. */ + assert(sample_count < 2); + + srcFormat = rbRead->texture->format; + + if (screen->is_format_supported(screen, srcFormat, st->internal_target, + sample_count, + PIPE_BIND_SAMPLER_VIEW, 0)) { + texFormat = srcFormat; + } + else { + /* srcFormat can't be used as a texture format */ + if (type == GL_DEPTH) { + texFormat = st_choose_format(screen, GL_DEPTH_COMPONENT, + st->internal_target, sample_count, + PIPE_BIND_DEPTH_STENCIL); + assert(texFormat != PIPE_FORMAT_NONE); + } + else { + /* default color format */ + texFormat = st_choose_format(screen, GL_RGBA, st->internal_target, + sample_count, PIPE_BIND_SAMPLER_VIEW); + assert(texFormat != PIPE_FORMAT_NONE); + } + } + + /* Invert src region if needed */ + if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) { + srcy = ctx->ReadBuffer->Height - srcy - height; + invertTex = !invertTex; + } + + /* Clip the read region against the src buffer bounds. + * We'll still allocate a temporary buffer/texture for the original + * src region size but we'll only read the region which is on-screen. + * This may mean that we draw garbage pixels into the dest region, but + * that's expected. + */ + readX = srcx; + readY = srcy; + readW = width; + readH = height; + _mesa_clip_readpixels(ctx, &readX, &readY, &readW, &readH, &pack); + readW = MAX2(0, readW); + readH = MAX2(0, readH); + + /* alloc temporary texture */ + pt = alloc_texture(st, width, height, texFormat); + if (!pt) + return; + + sv[0] = st_create_texture_sampler_view(st->pipe, pt); + if (!sv[0]) { + pipe_resource_reference(&pt, NULL); + return; + } + + /* Make temporary texture which is a copy of the src region. + */ + if (srcFormat == texFormat) { + struct pipe_box src_box; + u_box_2d(readX, readY, readW, readH, &src_box); + /* copy source framebuffer surface into mipmap/texture */ + pipe->resource_copy_region(pipe, + pt, /* dest tex */ + 0, + pack.SkipPixels, pack.SkipRows, 0, /* dest pos */ + rbRead->texture, /* src tex */ + 0, + &src_box); + + } + else { + /* CPU-based fallback/conversion */ + struct pipe_transfer *ptRead = + pipe_get_transfer(st->pipe, rbRead->texture, + 0, 0, /* level, layer */ + PIPE_TRANSFER_READ, + readX, readY, readW, readH); + struct pipe_transfer *ptTex; + enum pipe_transfer_usage transfer_usage; + + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback processing\n", __FUNCTION__); + + if (type == GL_DEPTH && util_format_is_depth_and_stencil(pt->format)) + transfer_usage = PIPE_TRANSFER_READ_WRITE; + else + transfer_usage = PIPE_TRANSFER_WRITE; + + ptTex = pipe_get_transfer(st->pipe, pt, 0, 0, transfer_usage, + 0, 0, width, height); + + /* copy image from ptRead surface to ptTex surface */ + if (type == GL_COLOR) { + /* alternate path using get/put_tile() */ + GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat)); + enum pipe_format readFormat, drawFormat; + readFormat = util_format_linear(rbRead->texture->format); + drawFormat = util_format_linear(pt->format); + pipe_get_tile_rgba_format(pipe, ptRead, 0, 0, readW, readH, + readFormat, buf); + pipe_put_tile_rgba_format(pipe, ptTex, pack.SkipPixels, pack.SkipRows, + readW, readH, drawFormat, buf); + free(buf); + } + else { + /* GL_DEPTH */ + GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint)); + pipe_get_tile_z(pipe, ptRead, 0, 0, readW, readH, buf); + pipe_put_tile_z(pipe, ptTex, pack.SkipPixels, pack.SkipRows, + readW, readH, buf); + free(buf); + } + + pipe->transfer_destroy(pipe, ptRead); + pipe->transfer_destroy(pipe, ptTex); + } + + /* OK, the texture 'pt' contains the src image/pixels. Now draw a + * textured quad with that texture. + */ + draw_textured_quad(ctx, dstx, dsty, ctx->Current.RasterPos[2], + width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY, + sv, + num_sampler_view, + driver_vp, + driver_fp, + color, invertTex, GL_FALSE, GL_FALSE); + + pipe_resource_reference(&pt, NULL); + pipe_sampler_view_reference(&sv[0], NULL); +} + + + +void st_init_drawpixels_functions(struct dd_function_table *functions) +{ + functions->DrawPixels = st_DrawPixels; + functions->CopyPixels = st_CopyPixels; +} + + +void +st_destroy_drawpix(struct st_context *st) +{ + GLuint i; + + for (i = 0; i < Elements(st->drawpix.shaders); i++) { + if (st->drawpix.shaders[i]) + _mesa_reference_fragprog(st->ctx, &st->drawpix.shaders[i], NULL); + } + + st_reference_fragprog(st, &st->pixel_xfer.combined_prog, NULL); + if (st->drawpix.vert_shaders[0]) + ureg_free_tokens(st->drawpix.vert_shaders[0]); + if (st->drawpix.vert_shaders[1]) + ureg_free_tokens(st->drawpix.vert_shaders[1]); +} + +#endif /* FEATURE_drawpix */ diff --git a/mesalib/src/mesa/state_tracker/st_cb_fbo.c b/mesalib/src/mesa/state_tracker/st_cb_fbo.c index 2934f9ffb..7e124186c 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_fbo.c +++ b/mesalib/src/mesa/state_tracker/st_cb_fbo.c @@ -84,6 +84,7 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx, strb->Base.Width = width; strb->Base.Height = height; strb->Base.Format = st_pipe_format_to_mesa_format(format); + strb->Base._BaseFormat = _mesa_base_fbo_format(ctx, internalFormat); strb->Base.DataType = st_format_datatype(format); strb->defined = GL_FALSE; /* undefined contents now */ @@ -234,6 +235,7 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw) strb->Base.ClassID = 0x4242; /* just a unique value */ strb->Base.NumSamples = samples; strb->Base.Format = st_pipe_format_to_mesa_format(format); + strb->Base._BaseFormat = _mesa_get_format_base_format(strb->Base.Format); strb->Base.DataType = st_format_datatype(format); strb->format = format; strb->software = sw; diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c index ff04f3364..c0d1bd94a 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_texture.c +++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c @@ -411,125 +411,6 @@ strip_texture_border(GLint border, } -/** - * Try to do texture compression via rendering. If the Gallium driver - * can render into a compressed surface this will allow us to do texture - * compression. - * \return GL_TRUE for success, GL_FALSE for failure - */ -static GLboolean -compress_with_blit(struct gl_context * ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint width, GLint height, GLint depth, - GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *unpack, - struct gl_texture_image *texImage) -{ - const GLuint dstImageOffsets[1] = {0}; - struct st_texture_image *stImage = st_texture_image(texImage); - struct st_context *st = st_context(ctx); - struct pipe_context *pipe = st->pipe; - struct pipe_screen *screen = pipe->screen; - gl_format mesa_format; - struct pipe_resource templ; - struct pipe_resource *src_tex; - struct pipe_sampler_view view_templ; - struct pipe_sampler_view *src_view; - struct pipe_surface *dst_surface, surf_tmpl; - struct pipe_transfer *tex_xfer; - void *map; - - if (!stImage->pt) { - /* XXX: Can this happen? Should we assert? */ - return GL_FALSE; - } - - /* get destination surface (in the compressed texture) */ - memset(&surf_tmpl, 0, sizeof(surf_tmpl)); - surf_tmpl.format = stImage->pt->format; - surf_tmpl.usage = PIPE_BIND_RENDER_TARGET; - surf_tmpl.u.tex.level = stImage->level; - surf_tmpl.u.tex.first_layer = stImage->face; - surf_tmpl.u.tex.last_layer = stImage->face; - dst_surface = pipe->create_surface(pipe, stImage->pt, &surf_tmpl); - if (!dst_surface) { - /* can't render into this format (or other problem) */ - return GL_FALSE; - } - - /* Choose format for the temporary RGBA texture image. - */ - mesa_format = st_ChooseTextureFormat(ctx, GL_RGBA, format, type); - assert(mesa_format); - if (!mesa_format) - return GL_FALSE; - - /* Create the temporary source texture - */ - memset(&templ, 0, sizeof(templ)); - templ.target = st->internal_target; - templ.format = st_mesa_format_to_pipe_format(mesa_format); - templ.width0 = width; - templ.height0 = height; - templ.depth0 = 1; - templ.array_size = 1; - templ.last_level = 0; - templ.usage = PIPE_USAGE_DEFAULT; - templ.bind = PIPE_BIND_SAMPLER_VIEW; - src_tex = screen->resource_create(screen, &templ); - - if (!src_tex) - return GL_FALSE; - - /* Put user's tex data into the temporary texture - */ - tex_xfer = pipe_get_transfer(st_context(ctx)->pipe, src_tex, - 0, 0, /* layer, level are zero */ - PIPE_TRANSFER_WRITE, - 0, 0, width, height); /* x, y, w, h */ - map = pipe_transfer_map(pipe, tex_xfer); - - _mesa_texstore(ctx, 2, GL_RGBA, mesa_format, - map, /* dest ptr */ - 0, 0, 0, /* dest x/y/z offset */ - tex_xfer->stride, /* dest row stride (bytes) */ - dstImageOffsets, /* image offsets (for 3D only) */ - width, height, 1, /* size */ - format, type, /* source format/type */ - pixels, /* source data */ - unpack); /* source data packing */ - - pipe_transfer_unmap(pipe, tex_xfer); - pipe->transfer_destroy(pipe, tex_xfer); - - /* Create temporary sampler view */ - u_sampler_view_default_template(&view_templ, - src_tex, - src_tex->format); - src_view = pipe->create_sampler_view(pipe, src_tex, &view_templ); - - - /* copy / compress image */ - util_blit_pixels_tex(st->blit, - src_view, /* sampler view (src) */ - 0, 0, /* src x0, y0 */ - width, height, /* src x1, y1 */ - dst_surface, /* pipe_surface (dst) */ - xoffset, yoffset, /* dst x0, y0 */ - xoffset + width, /* dst x1 */ - yoffset + height, /* dst y1 */ - 0.0, /* z */ - PIPE_TEX_MIPFILTER_NEAREST); - - pipe_surface_reference(&dst_surface, NULL); - pipe_resource_reference(&src_tex, NULL); - pipe_sampler_view_reference(&src_view, NULL); - - return GL_TRUE; -} - - /** * Do glTexImage1/2/3D(). */ @@ -547,7 +428,6 @@ st_TexImage(struct gl_context * ctx, GLsizei imageSize, GLboolean compressed_src) { struct st_context *st = st_context(ctx); - struct pipe_screen *screen = st->pipe->screen; struct st_texture_object *stObj = st_texture_object(texObj); struct st_texture_image *stImage = st_texture_image(texImage); GLuint dstRowStride = 0; @@ -674,24 +554,6 @@ st_TexImage(struct gl_context * ctx, pixels, unpack, "glTexImage"); } - /* See if we can do texture compression with a blit/render. - */ - if (!compressed_src && - !ctx->Mesa_DXTn && - _mesa_is_format_compressed(texImage->TexFormat) && - screen->is_format_supported(screen, - stImage->pt->format, - stImage->pt->target, 0, - PIPE_BIND_RENDER_TARGET, 0)) { - if (!pixels) - goto done; - - if (compress_with_blit(ctx, target, level, 0, 0, 0, width, height, depth, - format, type, pixels, unpack, texImage)) { - goto done; - } - } - /* * Prepare to store the texture data. Either map the gallium texture buffer * memory or malloc space for it. @@ -1080,7 +942,6 @@ st_TexSubimage(struct gl_context *ctx, GLint dims, GLenum target, GLint level, struct gl_texture_image *texImage) { struct st_context *st = st_context(ctx); - struct pipe_screen *screen = st->pipe->screen; struct st_texture_image *stImage = st_texture_image(texImage); GLuint dstRowStride; const GLuint srcImageStride = @@ -1100,22 +961,6 @@ st_TexSubimage(struct gl_context *ctx, GLint dims, GLenum target, GLint level, if (!pixels) return; - /* See if we can do texture compression with a blit/render. - */ - if (!ctx->Mesa_DXTn && - _mesa_is_format_compressed(texImage->TexFormat) && - screen->is_format_supported(screen, - stImage->pt->format, - stImage->pt->target, 0, - PIPE_BIND_RENDER_TARGET, 0)) { - if (compress_with_blit(ctx, target, level, - xoffset, yoffset, zoffset, - width, height, depth, - format, type, pixels, packing, texImage)) { - goto done; - } - } - /* Map buffer if necessary. Need to lock to prevent other contexts * from uploading the buffer under us. */ diff --git a/mesalib/src/mesa/state_tracker/st_draw.c b/mesalib/src/mesa/state_tracker/st_draw.c index 830e3e3c1..564d63483 100644 --- a/mesalib/src/mesa/state_tracker/st_draw.c +++ b/mesalib/src/mesa/state_tracker/st_draw.c @@ -1,749 +1,751 @@ -/************************************************************************** - * - * Copyright 2007 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. - * - **************************************************************************/ - -/* - * This file implements the st_draw_vbo() function which is called from - * Mesa's VBO module. All point/line/triangle rendering is done through - * this function whether the user called glBegin/End, glDrawArrays, - * glDrawElements, glEvalMesh, or glCalList, etc. - * - * We basically convert the VBO's vertex attribute/array information into - * Gallium vertex state, bind the vertex buffer objects and call - * pipe->draw_elements(), pipe->draw_range_elements() or pipe->draw_arrays(). - * - * Authors: - * Keith Whitwell - */ - - -#include "main/imports.h" -#include "main/image.h" -#include "main/macros.h" -#include "main/mfeatures.h" -#include "program/prog_uniform.h" - -#include "vbo/vbo.h" - -#include "st_context.h" -#include "st_atom.h" -#include "st_cb_bufferobjects.h" -#include "st_draw.h" -#include "st_program.h" - -#include "pipe/p_context.h" -#include "pipe/p_defines.h" -#include "util/u_inlines.h" -#include "util/u_format.h" -#include "util/u_prim.h" -#include "util/u_draw_quad.h" -#include "draw/draw_context.h" -#include "cso_cache/cso_context.h" - - -static GLuint double_types[4] = { - PIPE_FORMAT_R64_FLOAT, - PIPE_FORMAT_R64G64_FLOAT, - PIPE_FORMAT_R64G64B64_FLOAT, - PIPE_FORMAT_R64G64B64A64_FLOAT -}; - -static GLuint float_types[4] = { - PIPE_FORMAT_R32_FLOAT, - PIPE_FORMAT_R32G32_FLOAT, - PIPE_FORMAT_R32G32B32_FLOAT, - PIPE_FORMAT_R32G32B32A32_FLOAT -}; - -static GLuint half_float_types[4] = { - PIPE_FORMAT_R16_FLOAT, - PIPE_FORMAT_R16G16_FLOAT, - PIPE_FORMAT_R16G16B16_FLOAT, - PIPE_FORMAT_R16G16B16A16_FLOAT -}; - -static GLuint uint_types_norm[4] = { - PIPE_FORMAT_R32_UNORM, - PIPE_FORMAT_R32G32_UNORM, - PIPE_FORMAT_R32G32B32_UNORM, - PIPE_FORMAT_R32G32B32A32_UNORM -}; - -static GLuint uint_types_scale[4] = { - PIPE_FORMAT_R32_USCALED, - PIPE_FORMAT_R32G32_USCALED, - PIPE_FORMAT_R32G32B32_USCALED, - PIPE_FORMAT_R32G32B32A32_USCALED -}; - -static GLuint int_types_norm[4] = { - PIPE_FORMAT_R32_SNORM, - PIPE_FORMAT_R32G32_SNORM, - PIPE_FORMAT_R32G32B32_SNORM, - PIPE_FORMAT_R32G32B32A32_SNORM -}; - -static GLuint int_types_scale[4] = { - PIPE_FORMAT_R32_SSCALED, - PIPE_FORMAT_R32G32_SSCALED, - PIPE_FORMAT_R32G32B32_SSCALED, - PIPE_FORMAT_R32G32B32A32_SSCALED -}; - -static GLuint ushort_types_norm[4] = { - PIPE_FORMAT_R16_UNORM, - PIPE_FORMAT_R16G16_UNORM, - PIPE_FORMAT_R16G16B16_UNORM, - PIPE_FORMAT_R16G16B16A16_UNORM -}; - -static GLuint ushort_types_scale[4] = { - PIPE_FORMAT_R16_USCALED, - PIPE_FORMAT_R16G16_USCALED, - PIPE_FORMAT_R16G16B16_USCALED, - PIPE_FORMAT_R16G16B16A16_USCALED -}; - -static GLuint short_types_norm[4] = { - PIPE_FORMAT_R16_SNORM, - PIPE_FORMAT_R16G16_SNORM, - PIPE_FORMAT_R16G16B16_SNORM, - PIPE_FORMAT_R16G16B16A16_SNORM -}; - -static GLuint short_types_scale[4] = { - PIPE_FORMAT_R16_SSCALED, - PIPE_FORMAT_R16G16_SSCALED, - PIPE_FORMAT_R16G16B16_SSCALED, - PIPE_FORMAT_R16G16B16A16_SSCALED -}; - -static GLuint ubyte_types_norm[4] = { - PIPE_FORMAT_R8_UNORM, - PIPE_FORMAT_R8G8_UNORM, - PIPE_FORMAT_R8G8B8_UNORM, - PIPE_FORMAT_R8G8B8A8_UNORM -}; - -static GLuint ubyte_types_scale[4] = { - PIPE_FORMAT_R8_USCALED, - PIPE_FORMAT_R8G8_USCALED, - PIPE_FORMAT_R8G8B8_USCALED, - PIPE_FORMAT_R8G8B8A8_USCALED -}; - -static GLuint byte_types_norm[4] = { - PIPE_FORMAT_R8_SNORM, - PIPE_FORMAT_R8G8_SNORM, - PIPE_FORMAT_R8G8B8_SNORM, - PIPE_FORMAT_R8G8B8A8_SNORM -}; - -static GLuint byte_types_scale[4] = { - PIPE_FORMAT_R8_SSCALED, - PIPE_FORMAT_R8G8_SSCALED, - PIPE_FORMAT_R8G8B8_SSCALED, - PIPE_FORMAT_R8G8B8A8_SSCALED -}; - -static GLuint fixed_types[4] = { - PIPE_FORMAT_R32_FIXED, - PIPE_FORMAT_R32G32_FIXED, - PIPE_FORMAT_R32G32B32_FIXED, - PIPE_FORMAT_R32G32B32A32_FIXED -}; - - - -/** - * Return a PIPE_FORMAT_x for the given GL datatype and size. - */ -GLuint -st_pipe_vertex_format(GLenum type, GLuint size, GLenum format, - GLboolean normalized) -{ - assert((type >= GL_BYTE && type <= GL_DOUBLE) || - type == GL_FIXED || type == GL_HALF_FLOAT); - assert(size >= 1); - assert(size <= 4); - assert(format == GL_RGBA || format == GL_BGRA); - - if (format == GL_BGRA) { - /* this is an odd-ball case */ - assert(type == GL_UNSIGNED_BYTE); - assert(normalized); - return PIPE_FORMAT_B8G8R8A8_UNORM; - } - - if (normalized) { - switch (type) { - case GL_DOUBLE: return double_types[size-1]; - case GL_FLOAT: return float_types[size-1]; - case GL_HALF_FLOAT: return half_float_types[size-1]; - case GL_INT: return int_types_norm[size-1]; - case GL_SHORT: return short_types_norm[size-1]; - case GL_BYTE: return byte_types_norm[size-1]; - case GL_UNSIGNED_INT: return uint_types_norm[size-1]; - case GL_UNSIGNED_SHORT: return ushort_types_norm[size-1]; - case GL_UNSIGNED_BYTE: return ubyte_types_norm[size-1]; - case GL_FIXED: return fixed_types[size-1]; - default: assert(0); return 0; - } - } - else { - switch (type) { - case GL_DOUBLE: return double_types[size-1]; - case GL_FLOAT: return float_types[size-1]; - case GL_HALF_FLOAT: return half_float_types[size-1]; - case GL_INT: return int_types_scale[size-1]; - case GL_SHORT: return short_types_scale[size-1]; - case GL_BYTE: return byte_types_scale[size-1]; - case GL_UNSIGNED_INT: return uint_types_scale[size-1]; - case GL_UNSIGNED_SHORT: return ushort_types_scale[size-1]; - case GL_UNSIGNED_BYTE: return ubyte_types_scale[size-1]; - case GL_FIXED: return fixed_types[size-1]; - default: assert(0); return 0; - } - } - return 0; /* silence compiler warning */ -} - - - - - -/** - * Examine the active arrays to determine if we have interleaved - * vertex arrays all living in one VBO, or all living in user space. - * \param userSpace returns whether the arrays are in user space. - */ -static GLboolean -is_interleaved_arrays(const struct st_vertex_program *vp, - const struct st_vp_variant *vpv, - const struct gl_client_array **arrays) -{ - GLuint attr; - const struct gl_buffer_object *firstBufObj = NULL; - GLint firstStride = -1; - const GLubyte *client_addr = NULL; - - for (attr = 0; attr < vpv->num_inputs; attr++) { - const GLuint mesaAttr = vp->index_to_input[attr]; - const struct gl_buffer_object *bufObj = arrays[mesaAttr]->BufferObj; - const GLsizei stride = arrays[mesaAttr]->StrideB; /* in bytes */ - - if (firstStride < 0) { - firstStride = stride; - } - else if (firstStride != stride) { - return GL_FALSE; - } - - if (!bufObj || !bufObj->Name) { - /* Try to detect if the client-space arrays are - * "close" to each other. - */ - if (!client_addr) { - client_addr = arrays[mesaAttr]->Ptr; - } - else if (abs(arrays[mesaAttr]->Ptr - client_addr) > firstStride) { - /* arrays start too far apart */ - return GL_FALSE; - } - } - else if (!firstBufObj) { - firstBufObj = bufObj; - } - else if (bufObj != firstBufObj) { - return GL_FALSE; - } - } - - return GL_TRUE; -} - - -/** - * Set up for drawing interleaved arrays that all live in one VBO - * or all live in user space. - * \param vbuffer returns vertex buffer info - * \param velements returns vertex element info - */ -static void -setup_interleaved_attribs(struct gl_context *ctx, - const struct st_vertex_program *vp, - const struct st_vp_variant *vpv, - const struct gl_client_array **arrays, - struct pipe_vertex_buffer *vbuffer, - struct pipe_vertex_element velements[], - unsigned max_index) -{ - struct st_context *st = st_context(ctx); - struct pipe_context *pipe = st->pipe; - GLuint attr; - const GLubyte *low_addr = NULL; - - /* Find the lowest address. */ - for (attr = 0; attr < vpv->num_inputs; attr++) { - const GLubyte *start = arrays[vp->index_to_input[attr]]->Ptr; - - low_addr = !low_addr ? start : MIN2(low_addr, start); - } - - for (attr = 0; attr < vpv->num_inputs; attr++) { - const GLuint mesaAttr = vp->index_to_input[attr]; - struct gl_buffer_object *bufobj = arrays[mesaAttr]->BufferObj; - struct st_buffer_object *stobj = st_buffer_object(bufobj); - GLsizei stride = arrays[mesaAttr]->StrideB; - - if (attr == 0) { - if (bufobj && bufobj->Name) { - vbuffer->buffer = NULL; - pipe_resource_reference(&vbuffer->buffer, stobj->buffer); - vbuffer->buffer_offset = pointer_to_offset(low_addr); - } else { - vbuffer->buffer = - pipe_user_buffer_create(pipe->screen, (void*)low_addr, - stride * (max_index + 1), - PIPE_BIND_VERTEX_BUFFER); - vbuffer->buffer_offset = 0; - - /* Track user vertex buffers. */ - pipe_resource_reference(&st->user_vb[0], vbuffer->buffer); - st->user_vb_stride[0] = stride; - st->num_user_vbs = 1; - } - vbuffer->stride = stride; /* in bytes */ - } - - velements[attr].src_offset = - (unsigned) (arrays[mesaAttr]->Ptr - low_addr); - velements[attr].instance_divisor = arrays[mesaAttr]->InstanceDivisor; - velements[attr].vertex_buffer_index = 0; - velements[attr].src_format = - st_pipe_vertex_format(arrays[mesaAttr]->Type, - arrays[mesaAttr]->Size, - arrays[mesaAttr]->Format, - arrays[mesaAttr]->Normalized); - assert(velements[attr].src_format); - } -} - - -/** - * Set up a separate pipe_vertex_buffer and pipe_vertex_element for each - * vertex attribute. - * \param vbuffer returns vertex buffer info - * \param velements returns vertex element info - */ -static void -setup_non_interleaved_attribs(struct gl_context *ctx, - const struct st_vertex_program *vp, - const struct st_vp_variant *vpv, - const struct gl_client_array **arrays, - struct pipe_vertex_buffer vbuffer[], - struct pipe_vertex_element velements[], - unsigned max_index) -{ - struct st_context *st = st_context(ctx); - struct pipe_context *pipe = st->pipe; - GLuint attr; - - for (attr = 0; attr < vpv->num_inputs; attr++) { - const GLuint mesaAttr = vp->index_to_input[attr]; - struct gl_buffer_object *bufobj = arrays[mesaAttr]->BufferObj; - GLsizei stride = arrays[mesaAttr]->StrideB; - - if (bufobj && bufobj->Name) { - /* Attribute data is in a VBO. - * Recall that for VBOs, the gl_client_array->Ptr field is - * really an offset from the start of the VBO, not a pointer. - */ - struct st_buffer_object *stobj = st_buffer_object(bufobj); - assert(stobj->buffer); - - vbuffer[attr].buffer = NULL; - pipe_resource_reference(&vbuffer[attr].buffer, stobj->buffer); - vbuffer[attr].buffer_offset = pointer_to_offset(arrays[mesaAttr]->Ptr); - } - else { - /* wrap user data */ - if (arrays[mesaAttr]->Ptr) { - vbuffer[attr].buffer = - pipe_user_buffer_create(pipe->screen, - (void *) arrays[mesaAttr]->Ptr, - stride * (max_index + 1), - PIPE_BIND_VERTEX_BUFFER); - } - else { - /* no array, use ctx->Current.Attrib[] value */ - uint bytes = sizeof(ctx->Current.Attrib[0]); - vbuffer[attr].buffer = - pipe_user_buffer_create(pipe->screen, - (void *) ctx->Current.Attrib[mesaAttr], - bytes, - PIPE_BIND_VERTEX_BUFFER); - stride = 0; - } - - vbuffer[attr].buffer_offset = 0; - - /* Track user vertex buffers. */ - pipe_resource_reference(&st->user_vb[attr], vbuffer->buffer); - st->user_vb_stride[attr] = stride; - st->num_user_vbs = MAX2(st->num_user_vbs, attr+1); - } - - /* common-case setup */ - vbuffer[attr].stride = stride; /* in bytes */ - - velements[attr].src_offset = 0; - velements[attr].instance_divisor = arrays[mesaAttr]->InstanceDivisor; - velements[attr].vertex_buffer_index = attr; - velements[attr].src_format - = st_pipe_vertex_format(arrays[mesaAttr]->Type, - arrays[mesaAttr]->Size, - arrays[mesaAttr]->Format, - arrays[mesaAttr]->Normalized); - assert(velements[attr].src_format); - } -} - - -static void -setup_index_buffer(struct gl_context *ctx, - const struct _mesa_index_buffer *ib, - struct pipe_index_buffer *ibuffer) -{ - struct st_context *st = st_context(ctx); - struct pipe_context *pipe = st->pipe; - - memset(ibuffer, 0, sizeof(*ibuffer)); - if (ib) { - struct gl_buffer_object *bufobj = ib->obj; - - switch (ib->type) { - case GL_UNSIGNED_INT: - ibuffer->index_size = 4; - break; - case GL_UNSIGNED_SHORT: - ibuffer->index_size = 2; - break; - case GL_UNSIGNED_BYTE: - ibuffer->index_size = 1; - break; - default: - assert(0); - return; - } - - /* get/create the index buffer object */ - if (bufobj && bufobj->Name) { - /* elements/indexes are in a real VBO */ - struct st_buffer_object *stobj = st_buffer_object(bufobj); - pipe_resource_reference(&ibuffer->buffer, stobj->buffer); - ibuffer->offset = pointer_to_offset(ib->ptr); - } - else { - /* element/indicies are in user space memory */ - ibuffer->buffer = - pipe_user_buffer_create(pipe->screen, (void *) ib->ptr, - ib->count * ibuffer->index_size, - PIPE_BIND_INDEX_BUFFER); - } - } -} - -/** - * Prior to drawing, check that any uniforms referenced by the - * current shader have been set. If a uniform has not been set, - * issue a warning. - */ -static void -check_uniforms(struct gl_context *ctx) -{ - struct gl_shader_program *shProg[3] = { - ctx->Shader.CurrentVertexProgram, - ctx->Shader.CurrentGeometryProgram, - ctx->Shader.CurrentFragmentProgram, - }; - unsigned j; - - for (j = 0; j < 3; j++) { - unsigned i; - - if (shProg[j] == NULL || !shProg[j]->LinkStatus) - continue; - - for (i = 0; i < shProg[j]->Uniforms->NumUniforms; i++) { - const struct gl_uniform *u = &shProg[j]->Uniforms->Uniforms[i]; - if (!u->Initialized) { - _mesa_warning(ctx, - "Using shader with uninitialized uniform: %s", - u->Name); - } - } - } -} - - -/** - * Translate OpenGL primtive type (GL_POINTS, GL_TRIANGLE_STRIP, etc) to - * the corresponding Gallium type. - */ -static unsigned -translate_prim(const struct gl_context *ctx, unsigned prim) -{ - /* GL prims should match Gallium prims, spot-check a few */ - assert(GL_POINTS == PIPE_PRIM_POINTS); - assert(GL_QUADS == PIPE_PRIM_QUADS); - assert(GL_TRIANGLE_STRIP_ADJACENCY == PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY); - - /* Avoid quadstrips if it's easy to do so: - * Note: it's imporant to do the correct trimming if we change the prim type! - * We do that wherever this function is called. - */ - if (prim == GL_QUAD_STRIP && - ctx->Light.ShadeModel != GL_FLAT && - ctx->Polygon.FrontMode == GL_FILL && - ctx->Polygon.BackMode == GL_FILL) - prim = GL_TRIANGLE_STRIP; - - return prim; -} - - -static void -st_validate_varrays(struct gl_context *ctx, - const struct gl_client_array **arrays, - unsigned max_index) -{ - struct st_context *st = st_context(ctx); - const struct st_vertex_program *vp; - const struct st_vp_variant *vpv; - struct pipe_vertex_buffer vbuffer[PIPE_MAX_SHADER_INPUTS]; - struct pipe_vertex_element velements[PIPE_MAX_ATTRIBS]; - unsigned num_vbuffers, num_velements; - GLuint attr; - unsigned i; - - /* must get these after state validation! */ - vp = st->vp; - vpv = st->vp_variant; - - memset(velements, 0, sizeof(struct pipe_vertex_element) * vpv->num_inputs); - - /* Unreference any user vertex buffers. */ - for (i = 0; i < st->num_user_vbs; i++) { - pipe_resource_reference(&st->user_vb[i], NULL); - } - st->num_user_vbs = 0; - - /* - * Setup the vbuffer[] and velements[] arrays. - */ - if (is_interleaved_arrays(vp, vpv, arrays)) { - setup_interleaved_attribs(ctx, vp, vpv, arrays, vbuffer, velements, - max_index); - num_vbuffers = 1; - num_velements = vpv->num_inputs; - if (num_velements == 0) - num_vbuffers = 0; - } - else { - setup_non_interleaved_attribs(ctx, vp, vpv, arrays, - vbuffer, velements, max_index); - num_vbuffers = vpv->num_inputs; - num_velements = vpv->num_inputs; - } - - cso_set_vertex_buffers(st->cso_context, num_vbuffers, vbuffer); - cso_set_vertex_elements(st->cso_context, num_velements, velements); - - /* unreference buffers (frees wrapped user-space buffer objects) - * This is OK, because the pipe driver should reference buffers by itself - * in set_vertex_buffers. */ - for (attr = 0; attr < num_vbuffers; attr++) { - pipe_resource_reference(&vbuffer[attr].buffer, NULL); - assert(!vbuffer[attr].buffer); - } -} - - -/** - * This function gets plugged into the VBO module and is called when - * we have something to render. - * Basically, translate the information into the format expected by gallium. - */ -void -st_draw_vbo(struct gl_context *ctx, - const struct gl_client_array **arrays, - const struct _mesa_prim *prims, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - GLboolean index_bounds_valid, - GLuint min_index, - GLuint max_index) -{ - struct st_context *st = st_context(ctx); - struct pipe_context *pipe = st->pipe; - struct pipe_index_buffer ibuffer; - struct pipe_draw_info info; - unsigned i; - GLboolean new_array = - st->dirty.st && (st->dirty.mesa & (_NEW_ARRAY | _NEW_PROGRAM)) != 0; - - /* Mesa core state should have been validated already */ - assert(ctx->NewState == 0x0); - - if (ib) { - /* Gallium probably doesn't want this in some cases. */ - if (!index_bounds_valid) - if (!vbo_all_varyings_in_vbos(arrays)) - vbo_get_minmax_index(ctx, prims, ib, &min_index, &max_index); - } else { - /* Get min/max index for non-indexed drawing. */ - min_index = ~0; - max_index = 0; - - for (i = 0; i < nr_prims; i++) { - min_index = MIN2(min_index, prims[i].start); - max_index = MAX2(max_index, prims[i].start + prims[i].count - 1); - } - } - - /* Validate state. */ - if (st->dirty.st) { - GLboolean vertDataEdgeFlags; - - /* sanity check for pointer arithmetic below */ - assert(sizeof(arrays[0]->Ptr[0]) == 1); - - vertDataEdgeFlags = arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj && - arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj->Name; - if (vertDataEdgeFlags != st->vertdata_edgeflags) { - st->vertdata_edgeflags = vertDataEdgeFlags; - st->dirty.st |= ST_NEW_EDGEFLAGS_DATA; - } - - st_validate_state(st); - - if (new_array) { - st_validate_varrays(ctx, arrays, max_index); - } - -#if 0 - if (MESA_VERBOSE & VERBOSE_GLSL) { - check_uniforms(ctx); - } -#else - (void) check_uniforms; -#endif - } - - /* Notify the driver that the content of user buffers may have been - * changed. */ - if (!new_array && st->num_user_vbs) { - for (i = 0; i < st->num_user_vbs; i++) { - if (st->user_vb[i]) { - unsigned stride = st->user_vb_stride[i]; - - if (stride) { - pipe->redefine_user_buffer(pipe, st->user_vb[i], - min_index * stride, - (max_index + 1 - min_index) * stride); - } else { - /* stride == 0 */ - pipe->redefine_user_buffer(pipe, st->user_vb[i], - 0, st->user_vb[i]->width0); - } - } - } - } - - setup_index_buffer(ctx, ib, &ibuffer); - pipe->set_index_buffer(pipe, &ibuffer); - - util_draw_init_info(&info); - if (ib) { - info.indexed = TRUE; - if (min_index != ~0 && max_index != ~0) { - info.min_index = min_index; - info.max_index = max_index; - } - } - - info.primitive_restart = st->ctx->Array.PrimitiveRestart; - info.restart_index = st->ctx->Array.RestartIndex; - - /* do actual drawing */ - for (i = 0; i < nr_prims; i++) { - info.mode = translate_prim( ctx, prims[i].mode ); - info.start = prims[i].start; - info.count = prims[i].count; - info.instance_count = prims[i].num_instances; - info.index_bias = prims[i].basevertex; - if (!ib) { - info.min_index = info.start; - info.max_index = info.start + info.count - 1; - } - - if (u_trim_pipe_prim(info.mode, &info.count)) - pipe->draw_vbo(pipe, &info); - } - - pipe_resource_reference(&ibuffer.buffer, NULL); -} - - -void st_init_draw( struct st_context *st ) -{ - struct gl_context *ctx = st->ctx; - - vbo_set_draw_func(ctx, st_draw_vbo); - -#if FEATURE_feedback || FEATURE_rastpos - st->draw = draw_create(st->pipe); /* for selection/feedback */ - - /* Disable draw options that might convert points/lines to tris, etc. - * as that would foul-up feedback/selection mode. - */ - draw_wide_line_threshold(st->draw, 1000.0f); - draw_wide_point_threshold(st->draw, 1000.0f); - draw_enable_line_stipple(st->draw, FALSE); - draw_enable_point_sprites(st->draw, FALSE); -#endif -} - - -void st_destroy_draw( struct st_context *st ) -{ -#if FEATURE_feedback || FEATURE_rastpos - draw_destroy(st->draw); -#endif -} - - +/************************************************************************** + * + * Copyright 2007 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. + * + **************************************************************************/ + +/* + * This file implements the st_draw_vbo() function which is called from + * Mesa's VBO module. All point/line/triangle rendering is done through + * this function whether the user called glBegin/End, glDrawArrays, + * glDrawElements, glEvalMesh, or glCalList, etc. + * + * We basically convert the VBO's vertex attribute/array information into + * Gallium vertex state, bind the vertex buffer objects and call + * pipe->draw_elements(), pipe->draw_range_elements() or pipe->draw_arrays(). + * + * Authors: + * Keith Whitwell + */ + + +#include "main/imports.h" +#include "main/image.h" +#include "main/macros.h" +#include "main/mfeatures.h" +#include "program/prog_uniform.h" + +#include "vbo/vbo.h" + +#include "st_context.h" +#include "st_atom.h" +#include "st_cb_bufferobjects.h" +#include "st_draw.h" +#include "st_program.h" + +#include "pipe/p_context.h" +#include "pipe/p_defines.h" +#include "util/u_inlines.h" +#include "util/u_format.h" +#include "util/u_prim.h" +#include "util/u_draw_quad.h" +#include "draw/draw_context.h" +#include "cso_cache/cso_context.h" + + +static GLuint double_types[4] = { + PIPE_FORMAT_R64_FLOAT, + PIPE_FORMAT_R64G64_FLOAT, + PIPE_FORMAT_R64G64B64_FLOAT, + PIPE_FORMAT_R64G64B64A64_FLOAT +}; + +static GLuint float_types[4] = { + PIPE_FORMAT_R32_FLOAT, + PIPE_FORMAT_R32G32_FLOAT, + PIPE_FORMAT_R32G32B32_FLOAT, + PIPE_FORMAT_R32G32B32A32_FLOAT +}; + +static GLuint half_float_types[4] = { + PIPE_FORMAT_R16_FLOAT, + PIPE_FORMAT_R16G16_FLOAT, + PIPE_FORMAT_R16G16B16_FLOAT, + PIPE_FORMAT_R16G16B16A16_FLOAT +}; + +static GLuint uint_types_norm[4] = { + PIPE_FORMAT_R32_UNORM, + PIPE_FORMAT_R32G32_UNORM, + PIPE_FORMAT_R32G32B32_UNORM, + PIPE_FORMAT_R32G32B32A32_UNORM +}; + +static GLuint uint_types_scale[4] = { + PIPE_FORMAT_R32_USCALED, + PIPE_FORMAT_R32G32_USCALED, + PIPE_FORMAT_R32G32B32_USCALED, + PIPE_FORMAT_R32G32B32A32_USCALED +}; + +static GLuint int_types_norm[4] = { + PIPE_FORMAT_R32_SNORM, + PIPE_FORMAT_R32G32_SNORM, + PIPE_FORMAT_R32G32B32_SNORM, + PIPE_FORMAT_R32G32B32A32_SNORM +}; + +static GLuint int_types_scale[4] = { + PIPE_FORMAT_R32_SSCALED, + PIPE_FORMAT_R32G32_SSCALED, + PIPE_FORMAT_R32G32B32_SSCALED, + PIPE_FORMAT_R32G32B32A32_SSCALED +}; + +static GLuint ushort_types_norm[4] = { + PIPE_FORMAT_R16_UNORM, + PIPE_FORMAT_R16G16_UNORM, + PIPE_FORMAT_R16G16B16_UNORM, + PIPE_FORMAT_R16G16B16A16_UNORM +}; + +static GLuint ushort_types_scale[4] = { + PIPE_FORMAT_R16_USCALED, + PIPE_FORMAT_R16G16_USCALED, + PIPE_FORMAT_R16G16B16_USCALED, + PIPE_FORMAT_R16G16B16A16_USCALED +}; + +static GLuint short_types_norm[4] = { + PIPE_FORMAT_R16_SNORM, + PIPE_FORMAT_R16G16_SNORM, + PIPE_FORMAT_R16G16B16_SNORM, + PIPE_FORMAT_R16G16B16A16_SNORM +}; + +static GLuint short_types_scale[4] = { + PIPE_FORMAT_R16_SSCALED, + PIPE_FORMAT_R16G16_SSCALED, + PIPE_FORMAT_R16G16B16_SSCALED, + PIPE_FORMAT_R16G16B16A16_SSCALED +}; + +static GLuint ubyte_types_norm[4] = { + PIPE_FORMAT_R8_UNORM, + PIPE_FORMAT_R8G8_UNORM, + PIPE_FORMAT_R8G8B8_UNORM, + PIPE_FORMAT_R8G8B8A8_UNORM +}; + +static GLuint ubyte_types_scale[4] = { + PIPE_FORMAT_R8_USCALED, + PIPE_FORMAT_R8G8_USCALED, + PIPE_FORMAT_R8G8B8_USCALED, + PIPE_FORMAT_R8G8B8A8_USCALED +}; + +static GLuint byte_types_norm[4] = { + PIPE_FORMAT_R8_SNORM, + PIPE_FORMAT_R8G8_SNORM, + PIPE_FORMAT_R8G8B8_SNORM, + PIPE_FORMAT_R8G8B8A8_SNORM +}; + +static GLuint byte_types_scale[4] = { + PIPE_FORMAT_R8_SSCALED, + PIPE_FORMAT_R8G8_SSCALED, + PIPE_FORMAT_R8G8B8_SSCALED, + PIPE_FORMAT_R8G8B8A8_SSCALED +}; + +static GLuint fixed_types[4] = { + PIPE_FORMAT_R32_FIXED, + PIPE_FORMAT_R32G32_FIXED, + PIPE_FORMAT_R32G32B32_FIXED, + PIPE_FORMAT_R32G32B32A32_FIXED +}; + + + +/** + * Return a PIPE_FORMAT_x for the given GL datatype and size. + */ +GLuint +st_pipe_vertex_format(GLenum type, GLuint size, GLenum format, + GLboolean normalized) +{ + assert((type >= GL_BYTE && type <= GL_DOUBLE) || + type == GL_FIXED || type == GL_HALF_FLOAT); + assert(size >= 1); + assert(size <= 4); + assert(format == GL_RGBA || format == GL_BGRA); + + if (format == GL_BGRA) { + /* this is an odd-ball case */ + assert(type == GL_UNSIGNED_BYTE); + assert(normalized); + return PIPE_FORMAT_B8G8R8A8_UNORM; + } + + if (normalized) { + switch (type) { + case GL_DOUBLE: return double_types[size-1]; + case GL_FLOAT: return float_types[size-1]; + case GL_HALF_FLOAT: return half_float_types[size-1]; + case GL_INT: return int_types_norm[size-1]; + case GL_SHORT: return short_types_norm[size-1]; + case GL_BYTE: return byte_types_norm[size-1]; + case GL_UNSIGNED_INT: return uint_types_norm[size-1]; + case GL_UNSIGNED_SHORT: return ushort_types_norm[size-1]; + case GL_UNSIGNED_BYTE: return ubyte_types_norm[size-1]; + case GL_FIXED: return fixed_types[size-1]; + default: assert(0); return 0; + } + } + else { + switch (type) { + case GL_DOUBLE: return double_types[size-1]; + case GL_FLOAT: return float_types[size-1]; + case GL_HALF_FLOAT: return half_float_types[size-1]; + case GL_INT: return int_types_scale[size-1]; + case GL_SHORT: return short_types_scale[size-1]; + case GL_BYTE: return byte_types_scale[size-1]; + case GL_UNSIGNED_INT: return uint_types_scale[size-1]; + case GL_UNSIGNED_SHORT: return ushort_types_scale[size-1]; + case GL_UNSIGNED_BYTE: return ubyte_types_scale[size-1]; + case GL_FIXED: return fixed_types[size-1]; + default: assert(0); return 0; + } + } + return 0; /* silence compiler warning */ +} + + + + + +/** + * Examine the active arrays to determine if we have interleaved + * vertex arrays all living in one VBO, or all living in user space. + * \param userSpace returns whether the arrays are in user space. + */ +static GLboolean +is_interleaved_arrays(const struct st_vertex_program *vp, + const struct st_vp_variant *vpv, + const struct gl_client_array **arrays) +{ + GLuint attr; + const struct gl_buffer_object *firstBufObj = NULL; + GLint firstStride = -1; + const GLubyte *client_addr = NULL; + + for (attr = 0; attr < vpv->num_inputs; attr++) { + const GLuint mesaAttr = vp->index_to_input[attr]; + const struct gl_buffer_object *bufObj = arrays[mesaAttr]->BufferObj; + const GLsizei stride = arrays[mesaAttr]->StrideB; /* in bytes */ + + if (firstStride < 0) { + firstStride = stride; + } + else if (firstStride != stride) { + return GL_FALSE; + } + + if (!bufObj || !bufObj->Name) { + /* Try to detect if the client-space arrays are + * "close" to each other. + */ + if (!client_addr) { + client_addr = arrays[mesaAttr]->Ptr; + } + else if (abs(arrays[mesaAttr]->Ptr - client_addr) > firstStride) { + /* arrays start too far apart */ + return GL_FALSE; + } + } + else if (!firstBufObj) { + firstBufObj = bufObj; + } + else if (bufObj != firstBufObj) { + return GL_FALSE; + } + } + + return GL_TRUE; +} + + +/** + * Set up for drawing interleaved arrays that all live in one VBO + * or all live in user space. + * \param vbuffer returns vertex buffer info + * \param velements returns vertex element info + */ +static void +setup_interleaved_attribs(struct gl_context *ctx, + const struct st_vertex_program *vp, + const struct st_vp_variant *vpv, + const struct gl_client_array **arrays, + struct pipe_vertex_buffer *vbuffer, + struct pipe_vertex_element velements[], + unsigned max_index) +{ + struct st_context *st = st_context(ctx); + struct pipe_context *pipe = st->pipe; + GLuint attr; + const GLubyte *low_addr = NULL; + + /* Find the lowest address. */ + for (attr = 0; attr < vpv->num_inputs; attr++) { + const GLubyte *start = arrays[vp->index_to_input[attr]]->Ptr; + + low_addr = !low_addr ? start : MIN2(low_addr, start); + } + + for (attr = 0; attr < vpv->num_inputs; attr++) { + const GLuint mesaAttr = vp->index_to_input[attr]; + struct gl_buffer_object *bufobj = arrays[mesaAttr]->BufferObj; + struct st_buffer_object *stobj = st_buffer_object(bufobj); + GLsizei stride = arrays[mesaAttr]->StrideB; + + if (attr == 0) { + if (bufobj && bufobj->Name) { + vbuffer->buffer = NULL; + pipe_resource_reference(&vbuffer->buffer, stobj->buffer); + vbuffer->buffer_offset = pointer_to_offset(low_addr); + } else { + vbuffer->buffer = + pipe_user_buffer_create(pipe->screen, (void*)low_addr, + stride * (max_index + 1), + PIPE_BIND_VERTEX_BUFFER); + vbuffer->buffer_offset = 0; + + /* Track user vertex buffers. */ + pipe_resource_reference(&st->user_vb[0], vbuffer->buffer); + st->user_vb_stride[0] = stride; + st->num_user_vbs = 1; + } + vbuffer->stride = stride; /* in bytes */ + } + + velements[attr].src_offset = + (unsigned) (arrays[mesaAttr]->Ptr - low_addr); + velements[attr].instance_divisor = arrays[mesaAttr]->InstanceDivisor; + velements[attr].vertex_buffer_index = 0; + velements[attr].src_format = + st_pipe_vertex_format(arrays[mesaAttr]->Type, + arrays[mesaAttr]->Size, + arrays[mesaAttr]->Format, + arrays[mesaAttr]->Normalized); + assert(velements[attr].src_format); + } +} + + +/** + * Set up a separate pipe_vertex_buffer and pipe_vertex_element for each + * vertex attribute. + * \param vbuffer returns vertex buffer info + * \param velements returns vertex element info + */ +static void +setup_non_interleaved_attribs(struct gl_context *ctx, + const struct st_vertex_program *vp, + const struct st_vp_variant *vpv, + const struct gl_client_array **arrays, + struct pipe_vertex_buffer vbuffer[], + struct pipe_vertex_element velements[], + unsigned max_index) +{ + struct st_context *st = st_context(ctx); + struct pipe_context *pipe = st->pipe; + GLuint attr; + + for (attr = 0; attr < vpv->num_inputs; attr++) { + const GLuint mesaAttr = vp->index_to_input[attr]; + struct gl_buffer_object *bufobj = arrays[mesaAttr]->BufferObj; + GLsizei stride = arrays[mesaAttr]->StrideB; + + if (bufobj && bufobj->Name) { + /* Attribute data is in a VBO. + * Recall that for VBOs, the gl_client_array->Ptr field is + * really an offset from the start of the VBO, not a pointer. + */ + struct st_buffer_object *stobj = st_buffer_object(bufobj); + assert(stobj->buffer); + + vbuffer[attr].buffer = NULL; + pipe_resource_reference(&vbuffer[attr].buffer, stobj->buffer); + vbuffer[attr].buffer_offset = pointer_to_offset(arrays[mesaAttr]->Ptr); + } + else { + /* wrap user data */ + if (arrays[mesaAttr]->Ptr) { + vbuffer[attr].buffer = + pipe_user_buffer_create(pipe->screen, + (void *) arrays[mesaAttr]->Ptr, + stride * (max_index + 1), + PIPE_BIND_VERTEX_BUFFER); + } + else { + /* no array, use ctx->Current.Attrib[] value */ + uint bytes = sizeof(ctx->Current.Attrib[0]); + vbuffer[attr].buffer = + pipe_user_buffer_create(pipe->screen, + (void *) ctx->Current.Attrib[mesaAttr], + bytes, + PIPE_BIND_VERTEX_BUFFER); + stride = 0; + } + + vbuffer[attr].buffer_offset = 0; + + /* Track user vertex buffers. */ + pipe_resource_reference(&st->user_vb[attr], vbuffer->buffer); + st->user_vb_stride[attr] = stride; + st->num_user_vbs = MAX2(st->num_user_vbs, attr+1); + } + + /* common-case setup */ + vbuffer[attr].stride = stride; /* in bytes */ + + velements[attr].src_offset = 0; + velements[attr].instance_divisor = arrays[mesaAttr]->InstanceDivisor; + velements[attr].vertex_buffer_index = attr; + velements[attr].src_format + = st_pipe_vertex_format(arrays[mesaAttr]->Type, + arrays[mesaAttr]->Size, + arrays[mesaAttr]->Format, + arrays[mesaAttr]->Normalized); + assert(velements[attr].src_format); + } +} + + +static void +setup_index_buffer(struct gl_context *ctx, + const struct _mesa_index_buffer *ib, + struct pipe_index_buffer *ibuffer) +{ + struct st_context *st = st_context(ctx); + struct pipe_context *pipe = st->pipe; + + memset(ibuffer, 0, sizeof(*ibuffer)); + if (ib) { + struct gl_buffer_object *bufobj = ib->obj; + + switch (ib->type) { + case GL_UNSIGNED_INT: + ibuffer->index_size = 4; + break; + case GL_UNSIGNED_SHORT: + ibuffer->index_size = 2; + break; + case GL_UNSIGNED_BYTE: + ibuffer->index_size = 1; + break; + default: + assert(0); + return; + } + + /* get/create the index buffer object */ + if (bufobj && bufobj->Name) { + /* elements/indexes are in a real VBO */ + struct st_buffer_object *stobj = st_buffer_object(bufobj); + pipe_resource_reference(&ibuffer->buffer, stobj->buffer); + ibuffer->offset = pointer_to_offset(ib->ptr); + } + else { + /* element/indicies are in user space memory */ + ibuffer->buffer = + pipe_user_buffer_create(pipe->screen, (void *) ib->ptr, + ib->count * ibuffer->index_size, + PIPE_BIND_INDEX_BUFFER); + } + } +} + +/** + * Prior to drawing, check that any uniforms referenced by the + * current shader have been set. If a uniform has not been set, + * issue a warning. + */ +static void +check_uniforms(struct gl_context *ctx) +{ + struct gl_shader_program *shProg[3] = { + ctx->Shader.CurrentVertexProgram, + ctx->Shader.CurrentGeometryProgram, + ctx->Shader.CurrentFragmentProgram, + }; + unsigned j; + + for (j = 0; j < 3; j++) { + unsigned i; + + if (shProg[j] == NULL || !shProg[j]->LinkStatus) + continue; + + for (i = 0; i < shProg[j]->Uniforms->NumUniforms; i++) { + const struct gl_uniform *u = &shProg[j]->Uniforms->Uniforms[i]; + if (!u->Initialized) { + _mesa_warning(ctx, + "Using shader with uninitialized uniform: %s", + u->Name); + } + } + } +} + + +/** + * Translate OpenGL primtive type (GL_POINTS, GL_TRIANGLE_STRIP, etc) to + * the corresponding Gallium type. + */ +static unsigned +translate_prim(const struct gl_context *ctx, unsigned prim) +{ + /* GL prims should match Gallium prims, spot-check a few */ + assert(GL_POINTS == PIPE_PRIM_POINTS); + assert(GL_QUADS == PIPE_PRIM_QUADS); + assert(GL_TRIANGLE_STRIP_ADJACENCY == PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY); + + /* Avoid quadstrips if it's easy to do so: + * Note: it's imporant to do the correct trimming if we change the prim type! + * We do that wherever this function is called. + */ + if (prim == GL_QUAD_STRIP && + ctx->Light.ShadeModel != GL_FLAT && + ctx->Polygon.FrontMode == GL_FILL && + ctx->Polygon.BackMode == GL_FILL) + prim = GL_TRIANGLE_STRIP; + + return prim; +} + + +static void +st_validate_varrays(struct gl_context *ctx, + const struct gl_client_array **arrays, + unsigned max_index) +{ + struct st_context *st = st_context(ctx); + const struct st_vertex_program *vp; + const struct st_vp_variant *vpv; + struct pipe_vertex_buffer vbuffer[PIPE_MAX_SHADER_INPUTS]; + struct pipe_vertex_element velements[PIPE_MAX_ATTRIBS]; + unsigned num_vbuffers, num_velements; + GLuint attr; + unsigned i; + + /* must get these after state validation! */ + vp = st->vp; + vpv = st->vp_variant; + + memset(velements, 0, sizeof(struct pipe_vertex_element) * vpv->num_inputs); + + /* Unreference any user vertex buffers. */ + for (i = 0; i < st->num_user_vbs; i++) { + pipe_resource_reference(&st->user_vb[i], NULL); + } + st->num_user_vbs = 0; + + /* + * Setup the vbuffer[] and velements[] arrays. + */ + if (is_interleaved_arrays(vp, vpv, arrays)) { + setup_interleaved_attribs(ctx, vp, vpv, arrays, vbuffer, velements, + max_index); + num_vbuffers = 1; + num_velements = vpv->num_inputs; + if (num_velements == 0) + num_vbuffers = 0; + } + else { + setup_non_interleaved_attribs(ctx, vp, vpv, arrays, + vbuffer, velements, max_index); + num_vbuffers = vpv->num_inputs; + num_velements = vpv->num_inputs; + } + + cso_set_vertex_buffers(st->cso_context, num_vbuffers, vbuffer); + cso_set_vertex_elements(st->cso_context, num_velements, velements); + + /* unreference buffers (frees wrapped user-space buffer objects) + * This is OK, because the pipe driver should reference buffers by itself + * in set_vertex_buffers. */ + for (attr = 0; attr < num_vbuffers; attr++) { + pipe_resource_reference(&vbuffer[attr].buffer, NULL); + assert(!vbuffer[attr].buffer); + } +} + + +/** + * This function gets plugged into the VBO module and is called when + * we have something to render. + * Basically, translate the information into the format expected by gallium. + */ +void +st_draw_vbo(struct gl_context *ctx, + const struct gl_client_array **arrays, + const struct _mesa_prim *prims, + GLuint nr_prims, + const struct _mesa_index_buffer *ib, + GLboolean index_bounds_valid, + GLuint min_index, + GLuint max_index) +{ + struct st_context *st = st_context(ctx); + struct pipe_context *pipe = st->pipe; + struct pipe_index_buffer ibuffer; + struct pipe_draw_info info; + unsigned i; + GLboolean new_array = GL_TRUE; + /* Fix this (Bug 34378): + GLboolean new_array = + st->dirty.st && (st->dirty.mesa & (_NEW_ARRAY | _NEW_PROGRAM)) != 0;*/ + + /* Mesa core state should have been validated already */ + assert(ctx->NewState == 0x0); + + if (ib) { + /* Gallium probably doesn't want this in some cases. */ + if (!index_bounds_valid) + if (!vbo_all_varyings_in_vbos(arrays)) + vbo_get_minmax_index(ctx, prims, ib, &min_index, &max_index); + } else { + /* Get min/max index for non-indexed drawing. */ + min_index = ~0; + max_index = 0; + + for (i = 0; i < nr_prims; i++) { + min_index = MIN2(min_index, prims[i].start); + max_index = MAX2(max_index, prims[i].start + prims[i].count - 1); + } + } + + /* Validate state. */ + if (st->dirty.st) { + GLboolean vertDataEdgeFlags; + + /* sanity check for pointer arithmetic below */ + assert(sizeof(arrays[0]->Ptr[0]) == 1); + + vertDataEdgeFlags = arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj && + arrays[VERT_ATTRIB_EDGEFLAG]->BufferObj->Name; + if (vertDataEdgeFlags != st->vertdata_edgeflags) { + st->vertdata_edgeflags = vertDataEdgeFlags; + st->dirty.st |= ST_NEW_EDGEFLAGS_DATA; + } + + st_validate_state(st); + + if (new_array) { + st_validate_varrays(ctx, arrays, max_index); + } + +#if 0 + if (MESA_VERBOSE & VERBOSE_GLSL) { + check_uniforms(ctx); + } +#else + (void) check_uniforms; +#endif + } + + /* Notify the driver that the content of user buffers may have been + * changed. */ + if (!new_array && st->num_user_vbs) { + for (i = 0; i < st->num_user_vbs; i++) { + if (st->user_vb[i]) { + unsigned stride = st->user_vb_stride[i]; + + if (stride) { + pipe->redefine_user_buffer(pipe, st->user_vb[i], + min_index * stride, + (max_index + 1 - min_index) * stride); + } else { + /* stride == 0 */ + pipe->redefine_user_buffer(pipe, st->user_vb[i], + 0, st->user_vb[i]->width0); + } + } + } + } + + setup_index_buffer(ctx, ib, &ibuffer); + pipe->set_index_buffer(pipe, &ibuffer); + + util_draw_init_info(&info); + if (ib) { + info.indexed = TRUE; + if (min_index != ~0 && max_index != ~0) { + info.min_index = min_index; + info.max_index = max_index; + } + } + + info.primitive_restart = st->ctx->Array.PrimitiveRestart; + info.restart_index = st->ctx->Array.RestartIndex; + + /* do actual drawing */ + for (i = 0; i < nr_prims; i++) { + info.mode = translate_prim( ctx, prims[i].mode ); + info.start = prims[i].start; + info.count = prims[i].count; + info.instance_count = prims[i].num_instances; + info.index_bias = prims[i].basevertex; + if (!ib) { + info.min_index = info.start; + info.max_index = info.start + info.count - 1; + } + + if (u_trim_pipe_prim(info.mode, &info.count)) + pipe->draw_vbo(pipe, &info); + } + + pipe_resource_reference(&ibuffer.buffer, NULL); +} + + +void st_init_draw( struct st_context *st ) +{ + struct gl_context *ctx = st->ctx; + + vbo_set_draw_func(ctx, st_draw_vbo); + +#if FEATURE_feedback || FEATURE_rastpos + st->draw = draw_create(st->pipe); /* for selection/feedback */ + + /* Disable draw options that might convert points/lines to tris, etc. + * as that would foul-up feedback/selection mode. + */ + draw_wide_line_threshold(st->draw, 1000.0f); + draw_wide_point_threshold(st->draw, 1000.0f); + draw_enable_line_stipple(st->draw, FALSE); + draw_enable_point_sprites(st->draw, FALSE); +#endif +} + + +void st_destroy_draw( struct st_context *st ) +{ +#if FEATURE_feedback || FEATURE_rastpos + draw_destroy(st->draw); +#endif +} + + diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c index d600edc48..b1ede1c8b 100644 --- a/mesalib/src/mesa/state_tracker/st_extensions.c +++ b/mesalib/src/mesa/state_tracker/st_extensions.c @@ -1,485 +1,482 @@ -/************************************************************************** - * - * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. - * Copyright (c) 2008 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, 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. - * - **************************************************************************/ - -#include "main/imports.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/mfeatures.h" - -#include "pipe/p_context.h" -#include "pipe/p_defines.h" -#include "pipe/p_screen.h" - -#include "st_context.h" -#include "st_extensions.h" - - -static int _min(int a, int b) -{ - return (a < b) ? a : b; -} - -static float _maxf(float a, float b) -{ - return (a > b) ? a : b; -} - -static int _clamp(int a, int min, int max) -{ - if (a < min) - return min; - else if (a > max) - return max; - else - return a; -} - - -/** - * Query driver to get implementation limits. - * Note that we have to limit/clamp against Mesa's internal limits too. - */ -void st_init_limits(struct st_context *st) -{ - struct pipe_screen *screen = st->pipe->screen; - struct gl_constants *c = &st->ctx->Const; - gl_shader_type sh; - - c->MaxTextureLevels - = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS), - MAX_TEXTURE_LEVELS); - - c->Max3DTextureLevels - = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_3D_LEVELS), - MAX_3D_TEXTURE_LEVELS); - - c->MaxCubeTextureLevels - = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS), - MAX_CUBE_TEXTURE_LEVELS); - - c->MaxTextureRectSize - = _min(1 << (c->MaxTextureLevels - 1), MAX_TEXTURE_RECT_SIZE); - - c->MaxTextureImageUnits - = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS), - MAX_TEXTURE_IMAGE_UNITS); - - c->MaxVertexTextureImageUnits - = _min(screen->get_param(screen, PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS), - MAX_VERTEX_TEXTURE_IMAGE_UNITS); - - c->MaxCombinedTextureImageUnits - = _min(screen->get_param(screen, PIPE_CAP_MAX_COMBINED_SAMPLERS), - MAX_COMBINED_TEXTURE_IMAGE_UNITS); - - c->MaxTextureCoordUnits - = _min(c->MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS); - - c->MaxTextureUnits = _min(c->MaxTextureImageUnits, c->MaxTextureCoordUnits); - - c->MaxDrawBuffers - = _clamp(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS), - 1, MAX_DRAW_BUFFERS); - - c->MaxLineWidth - = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH)); - c->MaxLineWidthAA - = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH_AA)); - - c->MaxPointSize - = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH)); - c->MaxPointSizeAA - = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH_AA)); - /* called after _mesa_create_context/_mesa_init_point, fix default user - * settable max point size up - */ - st->ctx->Point.MaxSize = MAX2(c->MaxPointSize, c->MaxPointSizeAA); - /* these are not queryable. Note that GL basically mandates a 1.0 minimum - * for non-aa sizes, but we can go down to 0.0 for aa points. - */ - c->MinPointSize = 1.0f; - c->MinPointSizeAA = 0.0f; - - c->MaxTextureMaxAnisotropy - = _maxf(2.0f, screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_ANISOTROPY)); - - c->MaxTextureLodBias - = screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_LOD_BIAS); - - c->MaxDrawBuffers - = CLAMP(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS), - 1, MAX_DRAW_BUFFERS); - - /* Quads always follow GL provoking rules. */ - c->QuadsFollowProvokingVertexConvention = GL_FALSE; - - for (sh = 0; sh < MESA_SHADER_TYPES; ++sh) { - struct gl_shader_compiler_options *options = - &st->ctx->ShaderCompilerOptions[sh]; - struct gl_program_constants *pc; - - switch (sh) { - case PIPE_SHADER_FRAGMENT: - pc = &c->FragmentProgram; - break; - case PIPE_SHADER_VERTEX: - pc = &c->VertexProgram; - break; - case PIPE_SHADER_GEOMETRY: - pc = &c->GeometryProgram; - break; - default: - assert(0); - continue; - } - - pc->MaxNativeInstructions = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS); - pc->MaxNativeAluInstructions = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS); - pc->MaxNativeTexInstructions = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS); - pc->MaxNativeTexIndirections = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS); - pc->MaxNativeAttribs = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INPUTS); - pc->MaxNativeTemps = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEMPS); - pc->MaxNativeAddressRegs = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_ADDRS); - pc->MaxNativeParameters = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONSTS); - pc->MaxUniformComponents = 4 * MIN2(pc->MaxNativeParameters, MAX_UNIFORMS); - - options->EmitNoNoise = TRUE; - - /* TODO: make these more fine-grained if anyone needs it */ - options->EmitNoIfs = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH); - options->EmitNoLoops = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH); - options->EmitNoFunctions = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_SUBROUTINES); - options->EmitNoMainReturn = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_SUBROUTINES); - - options->EmitNoCont = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED); - - options->EmitNoIndirectInput = !screen->get_shader_param(screen, sh, - PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR); - options->EmitNoIndirectOutput = !screen->get_shader_param(screen, sh, - PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR); - options->EmitNoIndirectTemp = !screen->get_shader_param(screen, sh, - PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR); - options->EmitNoIndirectUniform = !screen->get_shader_param(screen, sh, - PIPE_SHADER_CAP_INDIRECT_CONST_ADDR); - - if(options->EmitNoLoops) - options->MaxUnrollIterations = MIN2(screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS), 65536); - } - - /* PIPE_CAP_MAX_FS_INPUTS specifies the number of COLORn + GENERICn inputs - * and is set in MaxNativeAttribs. It's always 2 colors + N generic - * attributes. The GLSL compiler never uses COLORn for varyings, so we - * subtract the 2 colors to get the maximum number of varyings (generic - * attributes) supported by a driver. */ - c->MaxVarying = screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_MAX_INPUTS) - 2; - c->MaxVarying = MIN2(c->MaxVarying, MAX_VARYING); - - /* XXX we'll need a better query here someday */ - if (screen->get_param(screen, PIPE_CAP_GLSL)) { - c->GLSLVersion = 120; - } -} - - -/** - * Use pipe_screen::get_param() to query PIPE_CAP_ values to determine - * which GL extensions are supported. - * Quite a few extensions are always supported because they are standard - * features or can be built on top of other gallium features. - * Some fine tuning may still be needed. - */ -void st_init_extensions(struct st_context *st) -{ - struct pipe_screen *screen = st->pipe->screen; - struct gl_context *ctx = st->ctx; - - /* - * Extensions that are supported by all Gallium drivers: - */ - ctx->Extensions.ARB_copy_buffer = GL_TRUE; - ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE; - ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE; - ctx->Extensions.ARB_fragment_program = GL_TRUE; - ctx->Extensions.ARB_half_float_pixel = GL_TRUE; - ctx->Extensions.ARB_map_buffer_range = GL_TRUE; - ctx->Extensions.ARB_multisample = GL_TRUE; - ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; /* XXX temp */ - ctx->Extensions.ARB_texture_compression = GL_TRUE; - ctx->Extensions.ARB_texture_cube_map = GL_TRUE; - ctx->Extensions.ARB_texture_env_combine = GL_TRUE; - ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE; - ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE; - ctx->Extensions.ARB_vertex_array_object = GL_TRUE; - ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE; - ctx->Extensions.ARB_vertex_program = GL_TRUE; - ctx->Extensions.ARB_window_pos = GL_TRUE; - - ctx->Extensions.EXT_blend_color = GL_TRUE; - ctx->Extensions.EXT_blend_func_separate = GL_TRUE; - ctx->Extensions.EXT_blend_logic_op = GL_TRUE; - ctx->Extensions.EXT_blend_minmax = GL_TRUE; - ctx->Extensions.EXT_blend_subtract = GL_TRUE; - ctx->Extensions.EXT_framebuffer_blit = GL_TRUE; - ctx->Extensions.EXT_framebuffer_object = GL_TRUE; - ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE; - ctx->Extensions.EXT_fog_coord = GL_TRUE; - ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE; - ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE; - ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE; - ctx->Extensions.EXT_point_parameters = GL_TRUE; - ctx->Extensions.EXT_provoking_vertex = GL_TRUE; - ctx->Extensions.EXT_secondary_color = GL_TRUE; - ctx->Extensions.EXT_stencil_wrap = GL_TRUE; - ctx->Extensions.EXT_texture_env_add = GL_TRUE; - ctx->Extensions.EXT_texture_env_combine = GL_TRUE; - ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE; - ctx->Extensions.EXT_texture_lod_bias = GL_TRUE; - ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE; - if (ctx->API == API_OPENGLES || ctx->API == API_OPENGLES2) - ctx->Extensions.EXT_texture_format_BGRA8888 = GL_TRUE; - - ctx->Extensions.APPLE_vertex_array_object = GL_TRUE; - - ctx->Extensions.ATI_texture_env_combine3 = GL_TRUE; - - ctx->Extensions.MESA_pack_invert = GL_TRUE; - - ctx->Extensions.NV_blend_square = GL_TRUE; - ctx->Extensions.NV_texgen_reflection = GL_TRUE; - ctx->Extensions.NV_texture_env_combine4 = GL_TRUE; - ctx->Extensions.NV_texture_rectangle = GL_TRUE; -#if 0 - /* possibly could support the following two */ - ctx->Extensions.NV_vertex_program = GL_TRUE; - ctx->Extensions.NV_vertex_program1_1 = GL_TRUE; -#endif - -#if FEATURE_OES_EGL_image - ctx->Extensions.OES_EGL_image = GL_TRUE; -#endif -#if FEATURE_OES_draw_texture - ctx->Extensions.OES_draw_texture = GL_TRUE; -#endif - - ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; - - /* - * Extensions that depend on the driver/hardware: - */ - if (screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS) > 0) { - ctx->Extensions.ARB_draw_buffers = GL_TRUE; - } - - if (screen->get_param(screen, PIPE_CAP_TEXTURE_SWIZZLE) > 0) { - ctx->Extensions.EXT_texture_swizzle = GL_TRUE; - } - - if (screen->get_param(screen, PIPE_CAP_GLSL)) { - ctx->Extensions.ARB_fragment_shader = GL_TRUE; - ctx->Extensions.ARB_vertex_shader = GL_TRUE; - ctx->Extensions.ARB_shader_objects = GL_TRUE; - ctx->Extensions.ARB_shading_language_100 = GL_TRUE; - ctx->Extensions.ARB_explicit_attrib_location = GL_TRUE; - ctx->Extensions.EXT_separate_shader_objects = GL_TRUE; - } - - if (screen->get_param(screen, PIPE_CAP_TEXTURE_MIRROR_REPEAT) > 0) { - ctx->Extensions.ARB_texture_mirrored_repeat = GL_TRUE; - } - - if (screen->get_param(screen, PIPE_CAP_BLEND_EQUATION_SEPARATE)) { - ctx->Extensions.EXT_blend_equation_separate = GL_TRUE; - } - - if (screen->get_param(screen, PIPE_CAP_TEXTURE_MIRROR_CLAMP) > 0) { - ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE; - ctx->Extensions.ATI_texture_mirror_once = GL_TRUE; - } - - if (screen->get_param(screen, PIPE_CAP_NPOT_TEXTURES)) { - ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE; - } - - if (screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS) > 1) { - ctx->Extensions.ARB_multitexture = GL_TRUE; - } - - if (screen->get_param(screen, PIPE_CAP_TWO_SIDED_STENCIL)) { - ctx->Extensions.ATI_separate_stencil = GL_TRUE; - ctx->Extensions.EXT_stencil_two_side = GL_TRUE; - } - - if (screen->get_param(screen, PIPE_CAP_ANISOTROPIC_FILTER)) { - ctx->Extensions.EXT_texture_filter_anisotropic = GL_TRUE; - } - - if (screen->get_param(screen, PIPE_CAP_POINT_SPRITE)) { - ctx->Extensions.ARB_point_sprite = GL_TRUE; - /* GL_NV_point_sprite is not supported by gallium because we don't - * support the GL_POINT_SPRITE_R_MODE_NV option. - */ - } - - if (screen->get_param(screen, PIPE_CAP_OCCLUSION_QUERY)) { - ctx->Extensions.ARB_occlusion_query = GL_TRUE; - ctx->Extensions.ARB_occlusion_query2 = GL_TRUE; - } - if (screen->get_param(screen, PIPE_CAP_TIMER_QUERY)) { - ctx->Extensions.EXT_timer_query = GL_TRUE; - } - - if (screen->get_param(screen, PIPE_CAP_TEXTURE_SHADOW_MAP)) { - ctx->Extensions.ARB_depth_texture = GL_TRUE; - ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE; - ctx->Extensions.ARB_shadow = GL_TRUE; - ctx->Extensions.EXT_shadow_funcs = GL_TRUE; - /*ctx->Extensions.ARB_shadow_ambient = GL_TRUE;*/ - } - - /* GL_EXT_packed_depth_stencil requires both the ability to render to - * a depth/stencil buffer and texture from depth/stencil source. - */ - if (screen->is_format_supported(screen, PIPE_FORMAT_S8_USCALED_Z24_UNORM, - PIPE_TEXTURE_2D, 0, - PIPE_BIND_DEPTH_STENCIL, 0) && - screen->is_format_supported(screen, PIPE_FORMAT_S8_USCALED_Z24_UNORM, - PIPE_TEXTURE_2D, 0, - PIPE_BIND_SAMPLER_VIEW, 0)) { - ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; - } - else if (screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_USCALED, - PIPE_TEXTURE_2D, 0, - PIPE_BIND_DEPTH_STENCIL, 0) && - screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_USCALED, - PIPE_TEXTURE_2D, 0, - PIPE_BIND_SAMPLER_VIEW, 0)) { - ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; - } - - /* sRGB support */ - if (screen->is_format_supported(screen, PIPE_FORMAT_A8B8G8R8_SRGB, - PIPE_TEXTURE_2D, 0, - PIPE_BIND_SAMPLER_VIEW, 0) || - screen->is_format_supported(screen, PIPE_FORMAT_B8G8R8A8_SRGB, - PIPE_TEXTURE_2D, 0, - PIPE_BIND_SAMPLER_VIEW, 0)) { - ctx->Extensions.EXT_texture_sRGB = GL_TRUE; - ctx->Extensions.EXT_texture_sRGB_decode = GL_TRUE; - if (screen->is_format_supported(screen, PIPE_FORMAT_A8B8G8R8_SRGB, - PIPE_TEXTURE_2D, 0, - PIPE_BIND_RENDER_TARGET, 0) || - screen->is_format_supported(screen, PIPE_FORMAT_B8G8R8A8_SRGB, - PIPE_TEXTURE_2D, 0, - PIPE_BIND_RENDER_TARGET, 0)) { - ctx->Extensions.EXT_framebuffer_sRGB = GL_TRUE; - ctx->Const.sRGBCapable = GL_TRUE; - } - } - - if (screen->is_format_supported(screen, PIPE_FORMAT_R8G8_UNORM, - PIPE_TEXTURE_2D, 0, - PIPE_BIND_SAMPLER_VIEW, 0)) { - ctx->Extensions.ARB_texture_rg = GL_TRUE; - } - - /* s3tc support */ - if (screen->is_format_supported(screen, PIPE_FORMAT_DXT5_RGBA, - PIPE_TEXTURE_2D, 0, - PIPE_BIND_SAMPLER_VIEW, 0) && - (ctx->Mesa_DXTn || - screen->is_format_supported(screen, PIPE_FORMAT_DXT5_RGBA, - PIPE_TEXTURE_2D, 0, - PIPE_BIND_RENDER_TARGET, 0))) { - ctx->Extensions.EXT_texture_compression_s3tc = GL_TRUE; - ctx->Extensions.S3_s3tc = GL_TRUE; - } - - /* ycbcr support */ - if (screen->is_format_supported(screen, PIPE_FORMAT_UYVY, - PIPE_TEXTURE_2D, 0, - PIPE_BIND_SAMPLER_VIEW, 0) || - screen->is_format_supported(screen, PIPE_FORMAT_YUYV, - PIPE_TEXTURE_2D, 0, - PIPE_BIND_SAMPLER_VIEW, 0)) { - ctx->Extensions.MESA_ycbcr_texture = GL_TRUE; - } - - /* GL_EXT_texture_array */ - if (screen->get_param(screen, PIPE_CAP_ARRAY_TEXTURES)) { - ctx->Extensions.EXT_texture_array = GL_TRUE; - ctx->Extensions.MESA_texture_array = GL_TRUE; - } - - /* GL_ARB_framebuffer_object */ - if (ctx->Extensions.EXT_packed_depth_stencil) { - /* we support always support GL_EXT_framebuffer_blit */ - ctx->Extensions.ARB_framebuffer_object = GL_TRUE; - } - - if (st->pipe->render_condition) { - ctx->Extensions.NV_conditional_render = GL_TRUE; - } - - if (screen->get_param(screen, PIPE_CAP_INDEP_BLEND_ENABLE)) { - ctx->Extensions.EXT_draw_buffers2 = GL_TRUE; - } - - if (screen->get_param(screen, PIPE_CAP_INDEP_BLEND_FUNC)) { - ctx->Extensions.ARB_draw_buffers_blend = GL_TRUE; - } - - /* GL_ARB_half_float_vertex */ - if (screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16A16_FLOAT, - PIPE_BUFFER, 0, - PIPE_BIND_VERTEX_BUFFER, 0)) { - ctx->Extensions.ARB_half_float_vertex = GL_TRUE; - } - - if (screen->get_shader_param(screen, PIPE_SHADER_GEOMETRY, PIPE_SHADER_CAP_MAX_INSTRUCTIONS) > 0) { -#if 0 /* XXX re-enable when GLSL compiler again supports geometry shaders */ - ctx->Extensions.ARB_geometry_shader4 = GL_TRUE; -#endif - } - - if (screen->get_param(screen, PIPE_CAP_PRIMITIVE_RESTART)) { - ctx->Extensions.NV_primitive_restart = GL_TRUE; - } - - if (screen->get_param(screen, PIPE_CAP_DEPTH_CLAMP)) { - ctx->Extensions.ARB_depth_clamp = GL_TRUE; - } - - if (screen->get_param(screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) { - ctx->Extensions.ARB_shader_stencil_export = GL_TRUE; - } - - if (screen->get_param(screen, PIPE_CAP_INSTANCED_DRAWING)) { - ctx->Extensions.ARB_draw_instanced = GL_TRUE; - ctx->Extensions.ARB_instanced_arrays = GL_TRUE; - } -} +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * Copyright (c) 2008 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, 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. + * + **************************************************************************/ + +#include "main/imports.h" +#include "main/context.h" +#include "main/macros.h" +#include "main/mfeatures.h" + +#include "pipe/p_context.h" +#include "pipe/p_defines.h" +#include "pipe/p_screen.h" + +#include "st_context.h" +#include "st_extensions.h" + + +static int _min(int a, int b) +{ + return (a < b) ? a : b; +} + +static float _maxf(float a, float b) +{ + return (a > b) ? a : b; +} + +static int _clamp(int a, int min, int max) +{ + if (a < min) + return min; + else if (a > max) + return max; + else + return a; +} + + +/** + * Query driver to get implementation limits. + * Note that we have to limit/clamp against Mesa's internal limits too. + */ +void st_init_limits(struct st_context *st) +{ + struct pipe_screen *screen = st->pipe->screen; + struct gl_constants *c = &st->ctx->Const; + gl_shader_type sh; + + c->MaxTextureLevels + = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS), + MAX_TEXTURE_LEVELS); + + c->Max3DTextureLevels + = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_3D_LEVELS), + MAX_3D_TEXTURE_LEVELS); + + c->MaxCubeTextureLevels + = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS), + MAX_CUBE_TEXTURE_LEVELS); + + c->MaxTextureRectSize + = _min(1 << (c->MaxTextureLevels - 1), MAX_TEXTURE_RECT_SIZE); + + c->MaxTextureImageUnits + = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS), + MAX_TEXTURE_IMAGE_UNITS); + + c->MaxVertexTextureImageUnits + = _min(screen->get_param(screen, PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS), + MAX_VERTEX_TEXTURE_IMAGE_UNITS); + + c->MaxCombinedTextureImageUnits + = _min(screen->get_param(screen, PIPE_CAP_MAX_COMBINED_SAMPLERS), + MAX_COMBINED_TEXTURE_IMAGE_UNITS); + + c->MaxTextureCoordUnits + = _min(c->MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS); + + c->MaxTextureUnits = _min(c->MaxTextureImageUnits, c->MaxTextureCoordUnits); + + c->MaxDrawBuffers + = _clamp(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS), + 1, MAX_DRAW_BUFFERS); + + c->MaxLineWidth + = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH)); + c->MaxLineWidthAA + = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_LINE_WIDTH_AA)); + + c->MaxPointSize + = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH)); + c->MaxPointSizeAA + = _maxf(1.0f, screen->get_paramf(screen, PIPE_CAP_MAX_POINT_WIDTH_AA)); + /* called after _mesa_create_context/_mesa_init_point, fix default user + * settable max point size up + */ + st->ctx->Point.MaxSize = MAX2(c->MaxPointSize, c->MaxPointSizeAA); + /* these are not queryable. Note that GL basically mandates a 1.0 minimum + * for non-aa sizes, but we can go down to 0.0 for aa points. + */ + c->MinPointSize = 1.0f; + c->MinPointSizeAA = 0.0f; + + c->MaxTextureMaxAnisotropy + = _maxf(2.0f, screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_ANISOTROPY)); + + c->MaxTextureLodBias + = screen->get_paramf(screen, PIPE_CAP_MAX_TEXTURE_LOD_BIAS); + + c->MaxDrawBuffers + = CLAMP(screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS), + 1, MAX_DRAW_BUFFERS); + + /* Quads always follow GL provoking rules. */ + c->QuadsFollowProvokingVertexConvention = GL_FALSE; + + for (sh = 0; sh < MESA_SHADER_TYPES; ++sh) { + struct gl_shader_compiler_options *options = + &st->ctx->ShaderCompilerOptions[sh]; + struct gl_program_constants *pc; + + switch (sh) { + case PIPE_SHADER_FRAGMENT: + pc = &c->FragmentProgram; + break; + case PIPE_SHADER_VERTEX: + pc = &c->VertexProgram; + break; + case PIPE_SHADER_GEOMETRY: + pc = &c->GeometryProgram; + break; + default: + assert(0); + continue; + } + + pc->MaxNativeInstructions = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS); + pc->MaxNativeAluInstructions = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_ALU_INSTRUCTIONS); + pc->MaxNativeTexInstructions = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS); + pc->MaxNativeTexIndirections = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS); + pc->MaxNativeAttribs = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INPUTS); + pc->MaxNativeTemps = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_TEMPS); + pc->MaxNativeAddressRegs = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_ADDRS); + pc->MaxNativeParameters = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONSTS); + pc->MaxUniformComponents = 4 * MIN2(pc->MaxNativeParameters, MAX_UNIFORMS); + + options->EmitNoNoise = TRUE; + + /* TODO: make these more fine-grained if anyone needs it */ + options->EmitNoIfs = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH); + options->EmitNoLoops = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH); + options->EmitNoFunctions = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_SUBROUTINES); + options->EmitNoMainReturn = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_SUBROUTINES); + + options->EmitNoCont = !screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_TGSI_CONT_SUPPORTED); + + options->EmitNoIndirectInput = !screen->get_shader_param(screen, sh, + PIPE_SHADER_CAP_INDIRECT_INPUT_ADDR); + options->EmitNoIndirectOutput = !screen->get_shader_param(screen, sh, + PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR); + options->EmitNoIndirectTemp = !screen->get_shader_param(screen, sh, + PIPE_SHADER_CAP_INDIRECT_TEMP_ADDR); + options->EmitNoIndirectUniform = !screen->get_shader_param(screen, sh, + PIPE_SHADER_CAP_INDIRECT_CONST_ADDR); + + if(options->EmitNoLoops) + options->MaxUnrollIterations = MIN2(screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS), 65536); + } + + /* PIPE_CAP_MAX_FS_INPUTS specifies the number of COLORn + GENERICn inputs + * and is set in MaxNativeAttribs. It's always 2 colors + N generic + * attributes. The GLSL compiler never uses COLORn for varyings, so we + * subtract the 2 colors to get the maximum number of varyings (generic + * attributes) supported by a driver. */ + c->MaxVarying = screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_MAX_INPUTS) - 2; + c->MaxVarying = MIN2(c->MaxVarying, MAX_VARYING); + + /* XXX we'll need a better query here someday */ + if (screen->get_param(screen, PIPE_CAP_GLSL)) { + c->GLSLVersion = 120; + } +} + + +/** + * Use pipe_screen::get_param() to query PIPE_CAP_ values to determine + * which GL extensions are supported. + * Quite a few extensions are always supported because they are standard + * features or can be built on top of other gallium features. + * Some fine tuning may still be needed. + */ +void st_init_extensions(struct st_context *st) +{ + struct pipe_screen *screen = st->pipe->screen; + struct gl_context *ctx = st->ctx; + + /* + * Extensions that are supported by all Gallium drivers: + */ + ctx->Extensions.ARB_copy_buffer = GL_TRUE; + ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE; + ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE; + ctx->Extensions.ARB_fragment_program = GL_TRUE; + ctx->Extensions.ARB_half_float_pixel = GL_TRUE; + ctx->Extensions.ARB_map_buffer_range = GL_TRUE; + ctx->Extensions.ARB_multisample = GL_TRUE; + ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; /* XXX temp */ + ctx->Extensions.ARB_texture_compression = GL_TRUE; + ctx->Extensions.ARB_texture_cube_map = GL_TRUE; + ctx->Extensions.ARB_texture_env_combine = GL_TRUE; + ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE; + ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE; + ctx->Extensions.ARB_vertex_array_object = GL_TRUE; + ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE; + ctx->Extensions.ARB_vertex_program = GL_TRUE; + ctx->Extensions.ARB_window_pos = GL_TRUE; + + ctx->Extensions.EXT_blend_color = GL_TRUE; + ctx->Extensions.EXT_blend_func_separate = GL_TRUE; + ctx->Extensions.EXT_blend_logic_op = GL_TRUE; + ctx->Extensions.EXT_blend_minmax = GL_TRUE; + ctx->Extensions.EXT_blend_subtract = GL_TRUE; + ctx->Extensions.EXT_framebuffer_blit = GL_TRUE; + ctx->Extensions.EXT_framebuffer_object = GL_TRUE; + ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE; + ctx->Extensions.EXT_fog_coord = GL_TRUE; + ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE; + ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE; + ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE; + ctx->Extensions.EXT_point_parameters = GL_TRUE; + ctx->Extensions.EXT_provoking_vertex = GL_TRUE; + ctx->Extensions.EXT_secondary_color = GL_TRUE; + ctx->Extensions.EXT_stencil_wrap = GL_TRUE; + ctx->Extensions.EXT_texture_env_add = GL_TRUE; + ctx->Extensions.EXT_texture_env_combine = GL_TRUE; + ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE; + ctx->Extensions.EXT_texture_lod_bias = GL_TRUE; + ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE; + if (ctx->API == API_OPENGLES || ctx->API == API_OPENGLES2) + ctx->Extensions.EXT_texture_format_BGRA8888 = GL_TRUE; + + ctx->Extensions.APPLE_vertex_array_object = GL_TRUE; + + ctx->Extensions.ATI_texture_env_combine3 = GL_TRUE; + + ctx->Extensions.MESA_pack_invert = GL_TRUE; + + ctx->Extensions.NV_blend_square = GL_TRUE; + ctx->Extensions.NV_texgen_reflection = GL_TRUE; + ctx->Extensions.NV_texture_env_combine4 = GL_TRUE; + ctx->Extensions.NV_texture_rectangle = GL_TRUE; +#if 0 + /* possibly could support the following two */ + ctx->Extensions.NV_vertex_program = GL_TRUE; + ctx->Extensions.NV_vertex_program1_1 = GL_TRUE; +#endif + +#if FEATURE_OES_EGL_image + ctx->Extensions.OES_EGL_image = GL_TRUE; +#endif +#if FEATURE_OES_draw_texture + ctx->Extensions.OES_draw_texture = GL_TRUE; +#endif + + ctx->Extensions.SGIS_generate_mipmap = GL_TRUE; + + /* + * Extensions that depend on the driver/hardware: + */ + if (screen->get_param(screen, PIPE_CAP_MAX_RENDER_TARGETS) > 0) { + ctx->Extensions.ARB_draw_buffers = GL_TRUE; + } + + if (screen->get_param(screen, PIPE_CAP_TEXTURE_SWIZZLE) > 0) { + ctx->Extensions.EXT_texture_swizzle = GL_TRUE; + } + + if (screen->get_param(screen, PIPE_CAP_GLSL)) { + ctx->Extensions.ARB_fragment_shader = GL_TRUE; + ctx->Extensions.ARB_vertex_shader = GL_TRUE; + ctx->Extensions.ARB_shader_objects = GL_TRUE; + ctx->Extensions.ARB_shading_language_100 = GL_TRUE; + ctx->Extensions.ARB_explicit_attrib_location = GL_TRUE; + ctx->Extensions.EXT_separate_shader_objects = GL_TRUE; + } + + if (screen->get_param(screen, PIPE_CAP_TEXTURE_MIRROR_REPEAT) > 0) { + ctx->Extensions.ARB_texture_mirrored_repeat = GL_TRUE; + } + + if (screen->get_param(screen, PIPE_CAP_BLEND_EQUATION_SEPARATE)) { + ctx->Extensions.EXT_blend_equation_separate = GL_TRUE; + } + + if (screen->get_param(screen, PIPE_CAP_TEXTURE_MIRROR_CLAMP) > 0) { + ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE; + ctx->Extensions.ATI_texture_mirror_once = GL_TRUE; + } + + if (screen->get_param(screen, PIPE_CAP_NPOT_TEXTURES)) { + ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE; + } + + if (screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS) > 1) { + ctx->Extensions.ARB_multitexture = GL_TRUE; + } + + if (screen->get_param(screen, PIPE_CAP_TWO_SIDED_STENCIL)) { + ctx->Extensions.ATI_separate_stencil = GL_TRUE; + ctx->Extensions.EXT_stencil_two_side = GL_TRUE; + } + + if (screen->get_param(screen, PIPE_CAP_ANISOTROPIC_FILTER)) { + ctx->Extensions.EXT_texture_filter_anisotropic = GL_TRUE; + } + + if (screen->get_param(screen, PIPE_CAP_POINT_SPRITE)) { + ctx->Extensions.ARB_point_sprite = GL_TRUE; + /* GL_NV_point_sprite is not supported by gallium because we don't + * support the GL_POINT_SPRITE_R_MODE_NV option. + */ + } + + if (screen->get_param(screen, PIPE_CAP_OCCLUSION_QUERY)) { + ctx->Extensions.ARB_occlusion_query = GL_TRUE; + ctx->Extensions.ARB_occlusion_query2 = GL_TRUE; + } + if (screen->get_param(screen, PIPE_CAP_TIMER_QUERY)) { + ctx->Extensions.EXT_timer_query = GL_TRUE; + } + + if (screen->get_param(screen, PIPE_CAP_TEXTURE_SHADOW_MAP)) { + ctx->Extensions.ARB_depth_texture = GL_TRUE; + ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE; + ctx->Extensions.ARB_shadow = GL_TRUE; + ctx->Extensions.EXT_shadow_funcs = GL_TRUE; + /*ctx->Extensions.ARB_shadow_ambient = GL_TRUE;*/ + } + + /* GL_EXT_packed_depth_stencil requires both the ability to render to + * a depth/stencil buffer and texture from depth/stencil source. + */ + if (screen->is_format_supported(screen, PIPE_FORMAT_S8_USCALED_Z24_UNORM, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_DEPTH_STENCIL, 0) && + screen->is_format_supported(screen, PIPE_FORMAT_S8_USCALED_Z24_UNORM, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_SAMPLER_VIEW, 0)) { + ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; + } + else if (screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_USCALED, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_DEPTH_STENCIL, 0) && + screen->is_format_supported(screen, PIPE_FORMAT_Z24_UNORM_S8_USCALED, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_SAMPLER_VIEW, 0)) { + ctx->Extensions.EXT_packed_depth_stencil = GL_TRUE; + } + + /* sRGB support */ + if (screen->is_format_supported(screen, PIPE_FORMAT_A8B8G8R8_SRGB, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_SAMPLER_VIEW, 0) || + screen->is_format_supported(screen, PIPE_FORMAT_B8G8R8A8_SRGB, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_SAMPLER_VIEW, 0)) { + ctx->Extensions.EXT_texture_sRGB = GL_TRUE; + ctx->Extensions.EXT_texture_sRGB_decode = GL_TRUE; + if (screen->is_format_supported(screen, PIPE_FORMAT_A8B8G8R8_SRGB, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_RENDER_TARGET, 0) || + screen->is_format_supported(screen, PIPE_FORMAT_B8G8R8A8_SRGB, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_RENDER_TARGET, 0)) { + ctx->Extensions.EXT_framebuffer_sRGB = GL_TRUE; + ctx->Const.sRGBCapable = GL_TRUE; + } + } + + if (screen->is_format_supported(screen, PIPE_FORMAT_R8G8_UNORM, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_SAMPLER_VIEW, 0)) { + ctx->Extensions.ARB_texture_rg = GL_TRUE; + } + + /* s3tc support */ + if (screen->is_format_supported(screen, PIPE_FORMAT_DXT5_RGBA, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_SAMPLER_VIEW, 0) && + ctx->Mesa_DXTn) { + ctx->Extensions.EXT_texture_compression_s3tc = GL_TRUE; + ctx->Extensions.S3_s3tc = GL_TRUE; + } + + /* ycbcr support */ + if (screen->is_format_supported(screen, PIPE_FORMAT_UYVY, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_SAMPLER_VIEW, 0) || + screen->is_format_supported(screen, PIPE_FORMAT_YUYV, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_SAMPLER_VIEW, 0)) { + ctx->Extensions.MESA_ycbcr_texture = GL_TRUE; + } + + /* GL_EXT_texture_array */ + if (screen->get_param(screen, PIPE_CAP_ARRAY_TEXTURES)) { + ctx->Extensions.EXT_texture_array = GL_TRUE; + ctx->Extensions.MESA_texture_array = GL_TRUE; + } + + /* GL_ARB_framebuffer_object */ + if (ctx->Extensions.EXT_packed_depth_stencil) { + /* we support always support GL_EXT_framebuffer_blit */ + ctx->Extensions.ARB_framebuffer_object = GL_TRUE; + } + + if (st->pipe->render_condition) { + ctx->Extensions.NV_conditional_render = GL_TRUE; + } + + if (screen->get_param(screen, PIPE_CAP_INDEP_BLEND_ENABLE)) { + ctx->Extensions.EXT_draw_buffers2 = GL_TRUE; + } + + if (screen->get_param(screen, PIPE_CAP_INDEP_BLEND_FUNC)) { + ctx->Extensions.ARB_draw_buffers_blend = GL_TRUE; + } + + /* GL_ARB_half_float_vertex */ + if (screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16A16_FLOAT, + PIPE_BUFFER, 0, + PIPE_BIND_VERTEX_BUFFER, 0)) { + ctx->Extensions.ARB_half_float_vertex = GL_TRUE; + } + + if (screen->get_shader_param(screen, PIPE_SHADER_GEOMETRY, PIPE_SHADER_CAP_MAX_INSTRUCTIONS) > 0) { +#if 0 /* XXX re-enable when GLSL compiler again supports geometry shaders */ + ctx->Extensions.ARB_geometry_shader4 = GL_TRUE; +#endif + } + + if (screen->get_param(screen, PIPE_CAP_PRIMITIVE_RESTART)) { + ctx->Extensions.NV_primitive_restart = GL_TRUE; + } + + if (screen->get_param(screen, PIPE_CAP_DEPTH_CLAMP)) { + ctx->Extensions.ARB_depth_clamp = GL_TRUE; + } + + if (screen->get_param(screen, PIPE_CAP_SHADER_STENCIL_EXPORT)) { + ctx->Extensions.ARB_shader_stencil_export = GL_TRUE; + } + + if (screen->get_param(screen, PIPE_CAP_INSTANCED_DRAWING)) { + ctx->Extensions.ARB_draw_instanced = GL_TRUE; + ctx->Extensions.ARB_instanced_arrays = GL_TRUE; + } +} diff --git a/mesalib/src/mesa/vbo/vbo_exec_array.c b/mesalib/src/mesa/vbo/vbo_exec_array.c index 6749541b7..65a0642f1 100644 --- a/mesalib/src/mesa/vbo/vbo_exec_array.c +++ b/mesalib/src/mesa/vbo/vbo_exec_array.c @@ -1,1282 +1,1307 @@ -/************************************************************************** - * - * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. - * Copyright 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, 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. - * - **************************************************************************/ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/state.h" -#include "main/api_validate.h" -#include "main/varray.h" -#include "main/bufferobj.h" -#include "main/enums.h" -#include "main/macros.h" - -#include "vbo_context.h" - - -/** - * Compute min and max elements by scanning the index buffer for - * glDraw[Range]Elements() calls. - * If primitive restart is enabled, we need to ignore restart - * indexes when computing min/max. - */ -void -vbo_get_minmax_index(struct gl_context *ctx, - const struct _mesa_prim *prim, - const struct _mesa_index_buffer *ib, - GLuint *min_index, GLuint *max_index) -{ - const GLboolean restart = ctx->Array.PrimitiveRestart; - const GLuint restartIndex = ctx->Array.RestartIndex; - const GLuint count = prim->count; - const void *indices; - GLuint i; - - if (_mesa_is_bufferobj(ib->obj)) { - const GLvoid *map = - ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, - GL_READ_ONLY, ib->obj); - indices = ADD_POINTERS(map, ib->ptr); - } else { - indices = ib->ptr; - } - - switch (ib->type) { - case GL_UNSIGNED_INT: { - const GLuint *ui_indices = (const GLuint *)indices; - GLuint max_ui = 0; - GLuint min_ui = ~0U; - if (restart) { - for (i = 0; i < count; i++) { - if (ui_indices[i] != restartIndex) { - if (ui_indices[i] > max_ui) max_ui = ui_indices[i]; - if (ui_indices[i] < min_ui) min_ui = ui_indices[i]; - } - } - } - else { - for (i = 0; i < count; i++) { - if (ui_indices[i] > max_ui) max_ui = ui_indices[i]; - if (ui_indices[i] < min_ui) min_ui = ui_indices[i]; - } - } - *min_index = min_ui; - *max_index = max_ui; - break; - } - case GL_UNSIGNED_SHORT: { - const GLushort *us_indices = (const GLushort *)indices; - GLuint max_us = 0; - GLuint min_us = ~0U; - if (restart) { - for (i = 0; i < count; i++) { - if (us_indices[i] != restartIndex) { - if (us_indices[i] > max_us) max_us = us_indices[i]; - if (us_indices[i] < min_us) min_us = us_indices[i]; - } - } - } - else { - for (i = 0; i < count; i++) { - if (us_indices[i] > max_us) max_us = us_indices[i]; - if (us_indices[i] < min_us) min_us = us_indices[i]; - } - } - *min_index = min_us; - *max_index = max_us; - break; - } - case GL_UNSIGNED_BYTE: { - const GLubyte *ub_indices = (const GLubyte *)indices; - GLuint max_ub = 0; - GLuint min_ub = ~0U; - if (restart) { - for (i = 0; i < count; i++) { - if (ub_indices[i] != restartIndex) { - if (ub_indices[i] > max_ub) max_ub = ub_indices[i]; - if (ub_indices[i] < min_ub) min_ub = ub_indices[i]; - } - } - } - else { - for (i = 0; i < count; i++) { - if (ub_indices[i] > max_ub) max_ub = ub_indices[i]; - if (ub_indices[i] < min_ub) min_ub = ub_indices[i]; - } - } - *min_index = min_ub; - *max_index = max_ub; - break; - } - default: - assert(0); - break; - } - - if (_mesa_is_bufferobj(ib->obj)) { - ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, ib->obj); - } -} - - -/** - * Check that element 'j' of the array has reasonable data. - * Map VBO if needed. - * For debugging purposes; not normally used. - */ -static void -check_array_data(struct gl_context *ctx, struct gl_client_array *array, - GLuint attrib, GLuint j) -{ - if (array->Enabled) { - const void *data = array->Ptr; - if (_mesa_is_bufferobj(array->BufferObj)) { - if (!array->BufferObj->Pointer) { - /* need to map now */ - array->BufferObj->Pointer = - ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER_ARB, - GL_READ_ONLY, array->BufferObj); - } - data = ADD_POINTERS(data, array->BufferObj->Pointer); - } - switch (array->Type) { - case GL_FLOAT: - { - GLfloat *f = (GLfloat *) ((GLubyte *) data + array->StrideB * j); - GLint k; - for (k = 0; k < array->Size; k++) { - if (IS_INF_OR_NAN(f[k]) || - f[k] >= 1.0e20 || f[k] <= -1.0e10) { - printf("Bad array data:\n"); - printf(" Element[%u].%u = %f\n", j, k, f[k]); - printf(" Array %u at %p\n", attrib, (void* ) array); - printf(" Type 0x%x, Size %d, Stride %d\n", - array->Type, array->Size, array->Stride); - printf(" Address/offset %p in Buffer Object %u\n", - array->Ptr, array->BufferObj->Name); - f[k] = 1.0; /* XXX replace the bad value! */ - } - /*assert(!IS_INF_OR_NAN(f[k]));*/ - } - } - break; - default: - ; - } - } -} - - -/** - * Unmap the buffer object referenced by given array, if mapped. - */ -static void -unmap_array_buffer(struct gl_context *ctx, struct gl_client_array *array) -{ - if (array->Enabled && - _mesa_is_bufferobj(array->BufferObj) && - _mesa_bufferobj_mapped(array->BufferObj)) { - ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, array->BufferObj); - } -} - - -/** - * Examine the array's data for NaNs, etc. - * For debug purposes; not normally used. - */ -static void -check_draw_elements_data(struct gl_context *ctx, GLsizei count, GLenum elemType, - const void *elements, GLint basevertex) -{ - struct gl_array_object *arrayObj = ctx->Array.ArrayObj; - const void *elemMap; - GLint i, k; - - if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) { - elemMap = ctx->Driver.MapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, - GL_READ_ONLY, - ctx->Array.ElementArrayBufferObj); - elements = ADD_POINTERS(elements, elemMap); - } - - for (i = 0; i < count; i++) { - GLuint j; - - /* j = element[i] */ - switch (elemType) { - case GL_UNSIGNED_BYTE: - j = ((const GLubyte *) elements)[i]; - break; - case GL_UNSIGNED_SHORT: - j = ((const GLushort *) elements)[i]; - break; - case GL_UNSIGNED_INT: - j = ((const GLuint *) elements)[i]; - break; - default: - assert(0); - } - - /* check element j of each enabled array */ - check_array_data(ctx, &arrayObj->Vertex, VERT_ATTRIB_POS, j); - check_array_data(ctx, &arrayObj->Normal, VERT_ATTRIB_NORMAL, j); - check_array_data(ctx, &arrayObj->Color, VERT_ATTRIB_COLOR0, j); - check_array_data(ctx, &arrayObj->SecondaryColor, VERT_ATTRIB_COLOR1, j); - for (k = 0; k < Elements(arrayObj->TexCoord); k++) { - check_array_data(ctx, &arrayObj->TexCoord[k], VERT_ATTRIB_TEX0 + k, j); - } - for (k = 0; k < Elements(arrayObj->VertexAttrib); k++) { - check_array_data(ctx, &arrayObj->VertexAttrib[k], - VERT_ATTRIB_GENERIC0 + k, j); - } - } - - if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) { - ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, - ctx->Array.ElementArrayBufferObj); - } - - unmap_array_buffer(ctx, &arrayObj->Vertex); - unmap_array_buffer(ctx, &arrayObj->Normal); - unmap_array_buffer(ctx, &arrayObj->Color); - for (k = 0; k < Elements(arrayObj->TexCoord); k++) { - unmap_array_buffer(ctx, &arrayObj->TexCoord[k]); - } - for (k = 0; k < Elements(arrayObj->VertexAttrib); k++) { - unmap_array_buffer(ctx, &arrayObj->VertexAttrib[k]); - } -} - - -/** - * Check array data, looking for NaNs, etc. - */ -static void -check_draw_arrays_data(struct gl_context *ctx, GLint start, GLsizei count) -{ - /* TO DO */ -} - - -/** - * Print info/data for glDrawArrays(), for debugging. - */ -static void -print_draw_arrays(struct gl_context *ctx, - GLenum mode, GLint start, GLsizei count) -{ - struct vbo_context *vbo = vbo_context(ctx); - struct vbo_exec_context *exec = &vbo->exec; - int i; - - printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n", - mode, start, count); - - for (i = 0; i < 32; i++) { - GLuint bufName = exec->array.inputs[i]->BufferObj->Name; - GLint stride = exec->array.inputs[i]->Stride; - printf("attr %2d: size %d stride %d enabled %d " - "ptr %p Bufobj %u\n", - i, - exec->array.inputs[i]->Size, - stride, - /*exec->array.inputs[i]->Enabled,*/ - exec->array.legacy_array[i]->Enabled, - exec->array.inputs[i]->Ptr, - bufName); - - if (bufName) { - struct gl_buffer_object *buf = _mesa_lookup_bufferobj(ctx, bufName); - GLubyte *p = ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER_ARB, - GL_READ_ONLY_ARB, buf); - int offset = (int) (GLintptr) exec->array.inputs[i]->Ptr; - float *f = (float *) (p + offset); - int *k = (int *) f; - int i; - int n = (count * stride) / 4; - if (n > 32) - n = 32; - printf(" Data at offset %d:\n", offset); - for (i = 0; i < n; i++) { - printf(" float[%d] = 0x%08x %f\n", i, k[i], f[i]); - } - ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, buf); - } - } -} - - -/** - * Bind the VBO executor to the current vertex array object prior - * to drawing. - * - * Just translate the arrayobj into a sane layout. - */ -static void -bind_array_obj(struct gl_context *ctx) -{ - struct vbo_context *vbo = vbo_context(ctx); - struct vbo_exec_context *exec = &vbo->exec; - struct gl_array_object *arrayObj = ctx->Array.ArrayObj; - GLuint i; - - /* TODO: Fix the ArrayObj struct to keep legacy arrays in an array - * rather than as individual named arrays. Then this function can - * go away. - */ - exec->array.legacy_array[VERT_ATTRIB_POS] = &arrayObj->Vertex; - exec->array.legacy_array[VERT_ATTRIB_WEIGHT] = &arrayObj->Weight; - exec->array.legacy_array[VERT_ATTRIB_NORMAL] = &arrayObj->Normal; - exec->array.legacy_array[VERT_ATTRIB_COLOR0] = &arrayObj->Color; - exec->array.legacy_array[VERT_ATTRIB_COLOR1] = &arrayObj->SecondaryColor; - exec->array.legacy_array[VERT_ATTRIB_FOG] = &arrayObj->FogCoord; - exec->array.legacy_array[VERT_ATTRIB_COLOR_INDEX] = &arrayObj->Index; - if (arrayObj->PointSize.Enabled) { - /* this aliases COLOR_INDEX */ - exec->array.legacy_array[VERT_ATTRIB_POINT_SIZE] = &arrayObj->PointSize; - } - exec->array.legacy_array[VERT_ATTRIB_EDGEFLAG] = &arrayObj->EdgeFlag; - - for (i = 0; i < Elements(arrayObj->TexCoord); i++) - exec->array.legacy_array[VERT_ATTRIB_TEX0 + i] = &arrayObj->TexCoord[i]; - - for (i = 0; i < Elements(arrayObj->VertexAttrib); i++) { - assert(i < Elements(exec->array.generic_array)); - exec->array.generic_array[i] = &arrayObj->VertexAttrib[i]; - } - - exec->array.array_obj = arrayObj->Name; -} - - -/** - * Set the vbo->exec->inputs[] pointers to point to the enabled - * vertex arrays. This depends on the current vertex program/shader - * being executed because of whether or not generic vertex arrays - * alias the conventional vertex arrays. - * For arrays that aren't enabled, we set the input[attrib] pointer - * to point at a zero-stride current value "array". - */ -static void -recalculate_input_bindings(struct gl_context *ctx) -{ - struct vbo_context *vbo = vbo_context(ctx); - struct vbo_exec_context *exec = &vbo->exec; - const struct gl_client_array **inputs = &exec->array.inputs[0]; - GLbitfield const_inputs = 0x0; - GLuint i; - - exec->array.program_mode = get_program_mode(ctx); - exec->array.enabled_flags = ctx->Array.ArrayObj->_Enabled; - - switch (exec->array.program_mode) { - case VP_NONE: - /* When no vertex program is active (or the vertex program is generated - * from fixed-function state). We put the material values into the - * generic slots. This is the only situation where material values - * are available as per-vertex attributes. - */ - for (i = 0; i <= VERT_ATTRIB_TEX7; i++) { - if (exec->array.legacy_array[i]->Enabled) - inputs[i] = exec->array.legacy_array[i]; - else { - inputs[i] = &vbo->legacy_currval[i]; - const_inputs |= 1 << i; - } - } - - for (i = 0; i < MAT_ATTRIB_MAX; i++) { - inputs[VERT_ATTRIB_GENERIC0 + i] = &vbo->mat_currval[i]; - const_inputs |= 1 << (VERT_ATTRIB_GENERIC0 + i); - } - - /* Could use just about anything, just to fill in the empty - * slots: - */ - for (i = MAT_ATTRIB_MAX; i < VERT_ATTRIB_MAX - VERT_ATTRIB_GENERIC0; i++) { - inputs[VERT_ATTRIB_GENERIC0 + i] = &vbo->generic_currval[i]; - const_inputs |= 1 << (VERT_ATTRIB_GENERIC0 + i); - } - break; - - case VP_NV: - /* NV_vertex_program - attribute arrays alias and override - * conventional, legacy arrays. No materials, and the generic - * slots are vacant. - */ - for (i = 0; i <= VERT_ATTRIB_TEX7; i++) { - if (exec->array.generic_array[i]->Enabled) - inputs[i] = exec->array.generic_array[i]; - else if (exec->array.legacy_array[i]->Enabled) - inputs[i] = exec->array.legacy_array[i]; - else { - inputs[i] = &vbo->legacy_currval[i]; - const_inputs |= 1 << i; - } - } - - /* Could use just about anything, just to fill in the empty - * slots: - */ - for (i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++) { - inputs[i] = &vbo->generic_currval[i - VERT_ATTRIB_GENERIC0]; - const_inputs |= 1 << i; - } - break; - - case VP_ARB: - /* GL_ARB_vertex_program or GLSL vertex shader - Only the generic[0] - * attribute array aliases and overrides the legacy position array. - * - * Otherwise, legacy attributes available in the legacy slots, - * generic attributes in the generic slots and materials are not - * available as per-vertex attributes. - */ - if (exec->array.generic_array[0]->Enabled) - inputs[0] = exec->array.generic_array[0]; - else if (exec->array.legacy_array[0]->Enabled) - inputs[0] = exec->array.legacy_array[0]; - else { - inputs[0] = &vbo->legacy_currval[0]; - const_inputs |= 1 << 0; - } - - for (i = 1; i <= VERT_ATTRIB_TEX7; i++) { - if (exec->array.legacy_array[i]->Enabled) - inputs[i] = exec->array.legacy_array[i]; - else { - inputs[i] = &vbo->legacy_currval[i]; - const_inputs |= 1 << i; - } - } - - for (i = 0; i < MAX_VERTEX_GENERIC_ATTRIBS; i++) { - if (exec->array.generic_array[i]->Enabled) - inputs[VERT_ATTRIB_GENERIC0 + i] = exec->array.generic_array[i]; - else { - inputs[VERT_ATTRIB_GENERIC0 + i] = &vbo->generic_currval[i]; - const_inputs |= 1 << (VERT_ATTRIB_GENERIC0 + i); - } - - } - break; - } - - _mesa_set_varying_vp_inputs( ctx, ~const_inputs ); -} - - -/** - * Examine the enabled vertex arrays to set the exec->array.inputs[] values. - * These will point to the arrays to actually use for drawing. Some will - * be user-provided arrays, other will be zero-stride const-valued arrays. - * Note that this might set the _NEW_ARRAY dirty flag so state validation - * must be done after this call. - */ -static void -bind_arrays(struct gl_context *ctx) -{ - if (!ctx->Array.RebindArrays) { - return; - } - - bind_array_obj(ctx); - recalculate_input_bindings(ctx); - ctx->Array.RebindArrays = GL_FALSE; -} - - -/** - * Helper function called by the other DrawArrays() functions below. - * This is where we handle primitive restart for drawing non-indexed - * arrays. If primitive restart is enabled, it typically means - * splitting one DrawArrays() into two. - */ -static void -vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start, - GLsizei count, GLuint numInstances) -{ - struct vbo_context *vbo = vbo_context(ctx); - struct vbo_exec_context *exec = &vbo->exec; - struct _mesa_prim prim[2]; - - bind_arrays(ctx); - - /* Again... because we may have changed the bitmask of per-vertex varying - * attributes. If we regenerate the fixed-function vertex program now - * we may be able to prune down the number of vertex attributes which we - * need in the shader. - */ - if (ctx->NewState) - _mesa_update_state(ctx); - - prim[0].begin = 1; - prim[0].end = 1; - prim[0].weak = 0; - prim[0].pad = 0; - prim[0].mode = mode; - prim[0].start = 0; /* filled in below */ - prim[0].count = 0; /* filled in below */ - prim[0].indexed = 0; - prim[0].basevertex = 0; - prim[0].num_instances = numInstances; - - /* Implement the primitive restart index */ - if (ctx->Array.PrimitiveRestart && ctx->Array.RestartIndex < count) { - GLuint primCount = 0; - - if (ctx->Array.RestartIndex == start) { - /* special case: RestartIndex at beginning */ - if (count > 1) { - prim[0].start = start + 1; - prim[0].count = count - 1; - primCount = 1; - } - } - else if (ctx->Array.RestartIndex == start + count - 1) { - /* special case: RestartIndex at end */ - if (count > 1) { - prim[0].start = start; - prim[0].count = count - 1; - primCount = 1; - } - } - else { - /* general case: RestartIndex in middle, split into two prims */ - prim[0].start = start; - prim[0].count = ctx->Array.RestartIndex - start; - - prim[1] = prim[0]; - prim[1].start = ctx->Array.RestartIndex + 1; - prim[1].count = count - prim[1].start; - - primCount = 2; - } - - if (primCount > 0) { - /* draw one or two prims */ - vbo->draw_prims(ctx, exec->array.inputs, prim, primCount, NULL, - GL_TRUE, start, start + count - 1); - } - } - else { - /* no prim restart */ - prim[0].start = start; - prim[0].count = count; - - vbo->draw_prims(ctx, exec->array.inputs, prim, 1, NULL, - GL_TRUE, start, start + count - 1); - } -} - - - -/** - * Called from glDrawArrays when in immediate mode (not display list mode). - */ -static void GLAPIENTRY -vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count) -{ - GET_CURRENT_CONTEXT(ctx); - - if (MESA_VERBOSE & VERBOSE_DRAW) - _mesa_debug(ctx, "glDrawArrays(%s, %d, %d)\n", - _mesa_lookup_enum_by_nr(mode), start, count); - - if (!_mesa_validate_DrawArrays( ctx, mode, start, count )) - return; - - FLUSH_CURRENT( ctx, 0 ); - - if (!_mesa_valid_to_render(ctx, "glDrawArrays")) { - return; - } - - if (0) - check_draw_arrays_data(ctx, start, count); - - vbo_draw_arrays(ctx, mode, start, count, 1); - - if (0) - print_draw_arrays(ctx, mode, start, count); -} - - -/** - * Called from glDrawArraysInstanced when in immediate mode (not - * display list mode). - */ -static void GLAPIENTRY -vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count, - GLsizei numInstances) -{ - GET_CURRENT_CONTEXT(ctx); - - if (MESA_VERBOSE & VERBOSE_DRAW) - _mesa_debug(ctx, "glDrawArraysInstanced(%s, %d, %d, %d)\n", - _mesa_lookup_enum_by_nr(mode), start, count, numInstances); - - if (!_mesa_validate_DrawArraysInstanced(ctx, mode, start, count, numInstances)) - return; - - FLUSH_CURRENT( ctx, 0 ); - - if (!_mesa_valid_to_render(ctx, "glDrawArraysInstanced")) { - return; - } - - if (0) - check_draw_arrays_data(ctx, start, count); - - vbo_draw_arrays(ctx, mode, start, count, numInstances); - - if (0) - print_draw_arrays(ctx, mode, start, count); -} - - -/** - * Map GL_ELEMENT_ARRAY_BUFFER and print contents. - * For debugging. - */ -static void -dump_element_buffer(struct gl_context *ctx, GLenum type) -{ - const GLvoid *map = ctx->Driver.MapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, - GL_READ_ONLY, - ctx->Array.ElementArrayBufferObj); - switch (type) { - case GL_UNSIGNED_BYTE: - { - const GLubyte *us = (const GLubyte *) map; - GLint i; - for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size; i++) { - printf("%02x ", us[i]); - if (i % 32 == 31) - printf("\n"); - } - printf("\n"); - } - break; - case GL_UNSIGNED_SHORT: - { - const GLushort *us = (const GLushort *) map; - GLint i; - for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size / 2; i++) { - printf("%04x ", us[i]); - if (i % 16 == 15) - printf("\n"); - } - printf("\n"); - } - break; - case GL_UNSIGNED_INT: - { - const GLuint *us = (const GLuint *) map; - GLint i; - for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size / 4; i++) { - printf("%08x ", us[i]); - if (i % 8 == 7) - printf("\n"); - } - printf("\n"); - } - break; - default: - ; - } - - ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, - ctx->Array.ElementArrayBufferObj); -} - - -/** - * Inner support for both _mesa_DrawElements and _mesa_DrawRangeElements. - * Do the rendering for a glDrawElements or glDrawRangeElements call after - * we've validated buffer bounds, etc. - */ -static void -vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode, - GLboolean index_bounds_valid, - GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid *indices, - GLint basevertex, GLint numInstances) -{ - struct vbo_context *vbo = vbo_context(ctx); - struct vbo_exec_context *exec = &vbo->exec; - struct _mesa_index_buffer ib; - struct _mesa_prim prim[1]; - - FLUSH_CURRENT( ctx, 0 ); - - if (!_mesa_valid_to_render(ctx, "glDraw[Range]Elements")) { - return; - } - - bind_arrays( ctx ); - - /* check for dirty state again */ - if (ctx->NewState) - _mesa_update_state( ctx ); - - ib.count = count; - ib.type = type; - ib.obj = ctx->Array.ElementArrayBufferObj; - ib.ptr = indices; - - prim[0].begin = 1; - prim[0].end = 1; - prim[0].weak = 0; - prim[0].pad = 0; - prim[0].mode = mode; - prim[0].start = 0; - prim[0].count = count; - prim[0].indexed = 1; - prim[0].basevertex = basevertex; - prim[0].num_instances = numInstances; - - /* Need to give special consideration to rendering a range of - * indices starting somewhere above zero. Typically the - * application is issuing multiple DrawRangeElements() to draw - * successive primitives layed out linearly in the vertex arrays. - * Unless the vertex arrays are all in a VBO (or locked as with - * CVA), the OpenGL semantics imply that we need to re-read or - * re-upload the vertex data on each draw call. - * - * In the case of hardware tnl, we want to avoid starting the - * upload at zero, as it will mean every draw call uploads an - * increasing amount of not-used vertex data. Worse - in the - * software tnl module, all those vertices might be transformed and - * lit but never rendered. - * - * If we just upload or transform the vertices in start..end, - * however, the indices will be incorrect. - * - * At this level, we don't know exactly what the requirements of - * the backend are going to be, though it will likely boil down to - * either: - * - * 1) Do nothing, everything is in a VBO and is processed once - * only. - * - * 2) Adjust the indices and vertex arrays so that start becomes - * zero. - * - * Rather than doing anything here, I'll provide a helper function - * for the latter case elsewhere. - */ - - vbo->draw_prims( ctx, exec->array.inputs, prim, 1, &ib, - index_bounds_valid, start, end ); -} - - -/** - * Called by glDrawRangeElementsBaseVertex() in immediate mode. - */ -static void GLAPIENTRY -vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid *indices, - GLint basevertex) -{ - static GLuint warnCount = 0; - GET_CURRENT_CONTEXT(ctx); - - if (MESA_VERBOSE & VERBOSE_DRAW) - _mesa_debug(ctx, - "glDrawRangeElementsBaseVertex(%s, %u, %u, %d, %s, %p, %d)\n", - _mesa_lookup_enum_by_nr(mode), start, end, count, - _mesa_lookup_enum_by_nr(type), indices, basevertex); - - if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count, - type, indices, basevertex )) - return; - - /* NOTE: It's important that 'end' is a reasonable value. - * in _tnl_draw_prims(), we use end to determine how many vertices - * to transform. If it's too large, we can unnecessarily split prims - * or we can read/write out of memory in several different places! - */ - - /* Catch/fix some potential user errors */ - if (type == GL_UNSIGNED_BYTE) { - start = MIN2(start, 0xff); - end = MIN2(end, 0xff); - } - else if (type == GL_UNSIGNED_SHORT) { - start = MIN2(start, 0xffff); - end = MIN2(end, 0xffff); - } - - if (end >= ctx->Array.ArrayObj->_MaxElement) { - /* the max element is out of bounds of one or more enabled arrays */ - warnCount++; - - if (warnCount < 10) { - _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, count %d, " - "type 0x%x, indices=%p)\n" - "\tend is out of bounds (max=%u) " - "Element Buffer %u (size %d)\n" - "\tThis should probably be fixed in the application.", - start, end, count, type, indices, - ctx->Array.ArrayObj->_MaxElement - 1, - ctx->Array.ElementArrayBufferObj->Name, - (int) ctx->Array.ElementArrayBufferObj->Size); - } - - if (0) - dump_element_buffer(ctx, type); - - if (0) - _mesa_print_arrays(ctx); - -#ifdef DEBUG - /* 'end' was out of bounds, but now let's check the actual array - * indexes to see if any of them are out of bounds. - */ - { - GLuint max = _mesa_max_buffer_index(ctx, count, type, indices, - ctx->Array.ElementArrayBufferObj); - if (max >= ctx->Array.ArrayObj->_MaxElement) { - if (warnCount < 10) { - _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, " - "count %d, type 0x%x, indices=%p)\n" - "\tindex=%u is out of bounds (max=%u) " - "Element Buffer %u (size %d)\n" - "\tSkipping the glDrawRangeElements() call", - start, end, count, type, indices, max, - ctx->Array.ArrayObj->_MaxElement - 1, - ctx->Array.ElementArrayBufferObj->Name, - (int) ctx->Array.ElementArrayBufferObj->Size); - } - } - /* XXX we could also find the min index and compare to 'start' - * to see if start is correct. But it's more likely to get the - * upper bound wrong. - */ - } -#endif - - /* Set 'end' to the max possible legal value */ - assert(ctx->Array.ArrayObj->_MaxElement >= 1); - end = ctx->Array.ArrayObj->_MaxElement - 1; - } - else if (0) { - printf("glDraw[Range]Elements{,BaseVertex}" - "(start %u, end %u, type 0x%x, count %d) ElemBuf %u, " - "base %d\n", - start, end, type, count, - ctx->Array.ElementArrayBufferObj->Name, - basevertex); - } - -#if 0 - check_draw_elements_data(ctx, count, type, indices); -#else - (void) check_draw_elements_data; -#endif - - vbo_validated_drawrangeelements(ctx, mode, GL_TRUE, start, end, - count, type, indices, basevertex, 1); -} - - -/** - * Called by glDrawRangeElements() in immediate mode. - */ -static void GLAPIENTRY -vbo_exec_DrawRangeElements(GLenum mode, GLuint start, GLuint end, - GLsizei count, GLenum type, const GLvoid *indices) -{ - GET_CURRENT_CONTEXT(ctx); - - if (MESA_VERBOSE & VERBOSE_DRAW) - _mesa_debug(ctx, - "glDrawRangeElements(%s, %u, %u, %d, %s, %p)\n", - _mesa_lookup_enum_by_nr(mode), start, end, count, - _mesa_lookup_enum_by_nr(type), indices); - - vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type, - indices, 0); -} - - -/** - * Called by glDrawElements() in immediate mode. - */ -static void GLAPIENTRY -vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices) -{ - GET_CURRENT_CONTEXT(ctx); - - if (MESA_VERBOSE & VERBOSE_DRAW) - _mesa_debug(ctx, "glDrawElements(%s, %u, %s, %p)\n", - _mesa_lookup_enum_by_nr(mode), count, - _mesa_lookup_enum_by_nr(type), indices); - - if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, 0 )) - return; - - vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0, - count, type, indices, 0, 1); -} - - -/** - * Called by glDrawElementsBaseVertex() in immediate mode. - */ -static void GLAPIENTRY -vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices, GLint basevertex) -{ - GET_CURRENT_CONTEXT(ctx); - - if (MESA_VERBOSE & VERBOSE_DRAW) - _mesa_debug(ctx, "glDrawElementsBaseVertex(%s, %d, %s, %p, %d)\n", - _mesa_lookup_enum_by_nr(mode), count, - _mesa_lookup_enum_by_nr(type), indices, basevertex); - - if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, - basevertex )) - return; - - vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0, - count, type, indices, basevertex, 1); -} - - -/** - * Called by glDrawElementsInstanced() in immediate mode. - */ -static void GLAPIENTRY -vbo_exec_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices, GLsizei numInstances) -{ - GET_CURRENT_CONTEXT(ctx); - - if (MESA_VERBOSE & VERBOSE_DRAW) - _mesa_debug(ctx, "glDrawElementsInstanced(%s, %d, %s, %p, %d)\n", - _mesa_lookup_enum_by_nr(mode), count, - _mesa_lookup_enum_by_nr(type), indices, numInstances); - - if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices, - numInstances)) - return; - - vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0, - count, type, indices, 0, numInstances); -} - - -/** - * Inner support for both _mesa_MultiDrawElements() and - * _mesa_MultiDrawRangeElements(). - * This does the actual rendering after we've checked array indexes, etc. - */ -static void -vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode, - const GLsizei *count, GLenum type, - const GLvoid **indices, GLsizei primcount, - const GLint *basevertex) -{ - struct vbo_context *vbo = vbo_context(ctx); - struct vbo_exec_context *exec = &vbo->exec; - struct _mesa_index_buffer ib; - struct _mesa_prim *prim; - unsigned int index_type_size = 0; - uintptr_t min_index_ptr, max_index_ptr; - GLboolean fallback = GL_FALSE; - int i; - - if (primcount == 0) - return; - - FLUSH_CURRENT( ctx, 0 ); - - if (!_mesa_valid_to_render(ctx, "glMultiDrawElements")) { - return; - } - - prim = calloc(1, primcount * sizeof(*prim)); - if (prim == NULL) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMultiDrawElements"); - return; - } - - /* Decide if we can do this all as one set of primitives sharing the - * same index buffer, or if we have to reset the index pointer per - * primitive. - */ - bind_arrays( ctx ); - - /* check for dirty state again */ - if (ctx->NewState) - _mesa_update_state( ctx ); - - switch (type) { - case GL_UNSIGNED_INT: - index_type_size = 4; - break; - case GL_UNSIGNED_SHORT: - index_type_size = 2; - break; - case GL_UNSIGNED_BYTE: - index_type_size = 1; - break; - default: - assert(0); - } - - min_index_ptr = (uintptr_t)indices[0]; - max_index_ptr = 0; - for (i = 0; i < primcount; i++) { - min_index_ptr = MIN2(min_index_ptr, (uintptr_t)indices[i]); - max_index_ptr = MAX2(max_index_ptr, (uintptr_t)indices[i] + - index_type_size * count[i]); - } - - /* Check if we can handle this thing as a bunch of index offsets from the - * same index pointer. If we can't, then we have to fall back to doing - * a draw_prims per primitive. - * Check that the difference between each prim's indexes is a multiple of - * the index/element size. - */ - if (index_type_size != 1) { - for (i = 0; i < primcount; i++) { - if ((((uintptr_t)indices[i] - min_index_ptr) % index_type_size) != 0) { - fallback = GL_TRUE; - break; - } - } - } - - /* If the index buffer isn't in a VBO, then treating the application's - * subranges of the index buffer as one large index buffer may lead to - * us reading unmapped memory. - */ - if (!_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) - fallback = GL_TRUE; - - if (!fallback) { - ib.count = (max_index_ptr - min_index_ptr) / index_type_size; - ib.type = type; - ib.obj = ctx->Array.ElementArrayBufferObj; - ib.ptr = (void *)min_index_ptr; - - for (i = 0; i < primcount; i++) { - prim[i].begin = (i == 0); - prim[i].end = (i == primcount - 1); - prim[i].weak = 0; - prim[i].pad = 0; - prim[i].mode = mode; - prim[i].start = ((uintptr_t)indices[i] - min_index_ptr) / index_type_size; - prim[i].count = count[i]; - prim[i].indexed = 1; - prim[i].num_instances = 1; - if (basevertex != NULL) - prim[i].basevertex = basevertex[i]; - else - prim[i].basevertex = 0; - } - - vbo->draw_prims(ctx, exec->array.inputs, prim, primcount, &ib, - GL_FALSE, ~0, ~0); - } else { - /* render one prim at a time */ - for (i = 0; i < primcount; i++) { - ib.count = count[i]; - ib.type = type; - ib.obj = ctx->Array.ElementArrayBufferObj; - ib.ptr = indices[i]; - - prim[0].begin = 1; - prim[0].end = 1; - prim[0].weak = 0; - prim[0].pad = 0; - prim[0].mode = mode; - prim[0].start = 0; - prim[0].count = count[i]; - prim[0].indexed = 1; - prim[0].num_instances = 1; - if (basevertex != NULL) - prim[0].basevertex = basevertex[i]; - else - prim[0].basevertex = 0; - - vbo->draw_prims(ctx, exec->array.inputs, prim, 1, &ib, - GL_FALSE, ~0, ~0); - } - } - - free(prim); -} - - -static void GLAPIENTRY -vbo_exec_MultiDrawElements(GLenum mode, - const GLsizei *count, GLenum type, - const GLvoid **indices, - GLsizei primcount) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - for (i = 0; i < primcount; i++) { - if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i], - 0)) - return; - } - - vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount, - NULL); -} - - -static void GLAPIENTRY -vbo_exec_MultiDrawElementsBaseVertex(GLenum mode, - const GLsizei *count, GLenum type, - const GLvoid **indices, - GLsizei primcount, - const GLsizei *basevertex) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - for (i = 0; i < primcount; i++) { - if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i], - basevertex[i])) - return; - } - - vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount, - basevertex); -} - - -/** - * Plug in the immediate-mode vertex array drawing commands into the - * givven vbo_exec_context object. - */ -void -vbo_exec_array_init( struct vbo_exec_context *exec ) -{ - exec->vtxfmt.DrawArrays = vbo_exec_DrawArrays; - exec->vtxfmt.DrawElements = vbo_exec_DrawElements; - exec->vtxfmt.DrawRangeElements = vbo_exec_DrawRangeElements; - exec->vtxfmt.MultiDrawElementsEXT = vbo_exec_MultiDrawElements; - exec->vtxfmt.DrawElementsBaseVertex = vbo_exec_DrawElementsBaseVertex; - exec->vtxfmt.DrawRangeElementsBaseVertex = vbo_exec_DrawRangeElementsBaseVertex; - exec->vtxfmt.MultiDrawElementsBaseVertex = vbo_exec_MultiDrawElementsBaseVertex; - exec->vtxfmt.DrawArraysInstanced = vbo_exec_DrawArraysInstanced; - exec->vtxfmt.DrawElementsInstanced = vbo_exec_DrawElementsInstanced; -} - - -void -vbo_exec_array_destroy( struct vbo_exec_context *exec ) -{ - /* nothing to do */ -} - - - -/** - * The following functions are only used for OpenGL ES 1/2 support. - * And some aren't even supported (yet) in ES 1/2. - */ - - -void GLAPIENTRY -_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count) -{ - vbo_exec_DrawArrays(mode, first, count); -} - - -void GLAPIENTRY -_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices) -{ - vbo_exec_DrawElements(mode, count, type, indices); -} - - -void GLAPIENTRY -_mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices, GLint basevertex) -{ - vbo_exec_DrawElementsBaseVertex(mode, count, type, indices, basevertex); -} - - -void GLAPIENTRY -_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, - GLenum type, const GLvoid *indices) -{ - vbo_exec_DrawRangeElements(mode, start, end, count, type, indices); -} - - -void GLAPIENTRY -_mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid *indices, GLint basevertex) -{ - vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type, - indices, basevertex); -} - - -void GLAPIENTRY -_mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, - const GLvoid **indices, GLsizei primcount) -{ - vbo_exec_MultiDrawElements(mode, count, type, indices, primcount); -} - - -void GLAPIENTRY -_mesa_MultiDrawElementsBaseVertex(GLenum mode, - const GLsizei *count, GLenum type, - const GLvoid **indices, GLsizei primcount, - const GLint *basevertex) -{ - vbo_exec_MultiDrawElementsBaseVertex(mode, count, type, indices, - primcount, basevertex); -} +/************************************************************************** + * + * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. + * Copyright 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, 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. + * + **************************************************************************/ + +#include "main/glheader.h" +#include "main/context.h" +#include "main/state.h" +#include "main/api_validate.h" +#include "main/varray.h" +#include "main/bufferobj.h" +#include "main/enums.h" +#include "main/macros.h" + +#include "vbo_context.h" + + +/** + * All vertex buffers should be in an unmapped state when we're about + * to draw. This debug function checks that. + */ +static void +check_buffers_are_unmapped(const struct gl_client_array **inputs) +{ +#ifdef DEBUG + GLuint i; + + for (i = 0; i < VERT_ATTRIB_MAX; i++) { + if (inputs[i]) { + struct gl_buffer_object *obj = inputs[i]->BufferObj; + assert(!_mesa_bufferobj_mapped(obj)); + } + } +#endif +} + + +/** + * Compute min and max elements by scanning the index buffer for + * glDraw[Range]Elements() calls. + * If primitive restart is enabled, we need to ignore restart + * indexes when computing min/max. + */ +void +vbo_get_minmax_index(struct gl_context *ctx, + const struct _mesa_prim *prim, + const struct _mesa_index_buffer *ib, + GLuint *min_index, GLuint *max_index) +{ + const GLboolean restart = ctx->Array.PrimitiveRestart; + const GLuint restartIndex = ctx->Array.RestartIndex; + const GLuint count = prim->count; + const void *indices; + GLuint i; + + if (_mesa_is_bufferobj(ib->obj)) { + const GLvoid *map = + ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, + GL_READ_ONLY, ib->obj); + indices = ADD_POINTERS(map, ib->ptr); + } else { + indices = ib->ptr; + } + + switch (ib->type) { + case GL_UNSIGNED_INT: { + const GLuint *ui_indices = (const GLuint *)indices; + GLuint max_ui = 0; + GLuint min_ui = ~0U; + if (restart) { + for (i = 0; i < count; i++) { + if (ui_indices[i] != restartIndex) { + if (ui_indices[i] > max_ui) max_ui = ui_indices[i]; + if (ui_indices[i] < min_ui) min_ui = ui_indices[i]; + } + } + } + else { + for (i = 0; i < count; i++) { + if (ui_indices[i] > max_ui) max_ui = ui_indices[i]; + if (ui_indices[i] < min_ui) min_ui = ui_indices[i]; + } + } + *min_index = min_ui; + *max_index = max_ui; + break; + } + case GL_UNSIGNED_SHORT: { + const GLushort *us_indices = (const GLushort *)indices; + GLuint max_us = 0; + GLuint min_us = ~0U; + if (restart) { + for (i = 0; i < count; i++) { + if (us_indices[i] != restartIndex) { + if (us_indices[i] > max_us) max_us = us_indices[i]; + if (us_indices[i] < min_us) min_us = us_indices[i]; + } + } + } + else { + for (i = 0; i < count; i++) { + if (us_indices[i] > max_us) max_us = us_indices[i]; + if (us_indices[i] < min_us) min_us = us_indices[i]; + } + } + *min_index = min_us; + *max_index = max_us; + break; + } + case GL_UNSIGNED_BYTE: { + const GLubyte *ub_indices = (const GLubyte *)indices; + GLuint max_ub = 0; + GLuint min_ub = ~0U; + if (restart) { + for (i = 0; i < count; i++) { + if (ub_indices[i] != restartIndex) { + if (ub_indices[i] > max_ub) max_ub = ub_indices[i]; + if (ub_indices[i] < min_ub) min_ub = ub_indices[i]; + } + } + } + else { + for (i = 0; i < count; i++) { + if (ub_indices[i] > max_ub) max_ub = ub_indices[i]; + if (ub_indices[i] < min_ub) min_ub = ub_indices[i]; + } + } + *min_index = min_ub; + *max_index = max_ub; + break; + } + default: + assert(0); + break; + } + + if (_mesa_is_bufferobj(ib->obj)) { + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, ib->obj); + } +} + + +/** + * Check that element 'j' of the array has reasonable data. + * Map VBO if needed. + * For debugging purposes; not normally used. + */ +static void +check_array_data(struct gl_context *ctx, struct gl_client_array *array, + GLuint attrib, GLuint j) +{ + if (array->Enabled) { + const void *data = array->Ptr; + if (_mesa_is_bufferobj(array->BufferObj)) { + if (!array->BufferObj->Pointer) { + /* need to map now */ + array->BufferObj->Pointer = + ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER_ARB, + GL_READ_ONLY, array->BufferObj); + } + data = ADD_POINTERS(data, array->BufferObj->Pointer); + } + switch (array->Type) { + case GL_FLOAT: + { + GLfloat *f = (GLfloat *) ((GLubyte *) data + array->StrideB * j); + GLint k; + for (k = 0; k < array->Size; k++) { + if (IS_INF_OR_NAN(f[k]) || + f[k] >= 1.0e20 || f[k] <= -1.0e10) { + printf("Bad array data:\n"); + printf(" Element[%u].%u = %f\n", j, k, f[k]); + printf(" Array %u at %p\n", attrib, (void* ) array); + printf(" Type 0x%x, Size %d, Stride %d\n", + array->Type, array->Size, array->Stride); + printf(" Address/offset %p in Buffer Object %u\n", + array->Ptr, array->BufferObj->Name); + f[k] = 1.0; /* XXX replace the bad value! */ + } + /*assert(!IS_INF_OR_NAN(f[k]));*/ + } + } + break; + default: + ; + } + } +} + + +/** + * Unmap the buffer object referenced by given array, if mapped. + */ +static void +unmap_array_buffer(struct gl_context *ctx, struct gl_client_array *array) +{ + if (array->Enabled && + _mesa_is_bufferobj(array->BufferObj) && + _mesa_bufferobj_mapped(array->BufferObj)) { + ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, array->BufferObj); + } +} + + +/** + * Examine the array's data for NaNs, etc. + * For debug purposes; not normally used. + */ +static void +check_draw_elements_data(struct gl_context *ctx, GLsizei count, GLenum elemType, + const void *elements, GLint basevertex) +{ + struct gl_array_object *arrayObj = ctx->Array.ArrayObj; + const void *elemMap; + GLint i, k; + + if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) { + elemMap = ctx->Driver.MapBuffer(ctx, + GL_ELEMENT_ARRAY_BUFFER_ARB, + GL_READ_ONLY, + ctx->Array.ElementArrayBufferObj); + elements = ADD_POINTERS(elements, elemMap); + } + + for (i = 0; i < count; i++) { + GLuint j; + + /* j = element[i] */ + switch (elemType) { + case GL_UNSIGNED_BYTE: + j = ((const GLubyte *) elements)[i]; + break; + case GL_UNSIGNED_SHORT: + j = ((const GLushort *) elements)[i]; + break; + case GL_UNSIGNED_INT: + j = ((const GLuint *) elements)[i]; + break; + default: + assert(0); + } + + /* check element j of each enabled array */ + check_array_data(ctx, &arrayObj->Vertex, VERT_ATTRIB_POS, j); + check_array_data(ctx, &arrayObj->Normal, VERT_ATTRIB_NORMAL, j); + check_array_data(ctx, &arrayObj->Color, VERT_ATTRIB_COLOR0, j); + check_array_data(ctx, &arrayObj->SecondaryColor, VERT_ATTRIB_COLOR1, j); + for (k = 0; k < Elements(arrayObj->TexCoord); k++) { + check_array_data(ctx, &arrayObj->TexCoord[k], VERT_ATTRIB_TEX0 + k, j); + } + for (k = 0; k < Elements(arrayObj->VertexAttrib); k++) { + check_array_data(ctx, &arrayObj->VertexAttrib[k], + VERT_ATTRIB_GENERIC0 + k, j); + } + } + + if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) { + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, + ctx->Array.ElementArrayBufferObj); + } + + unmap_array_buffer(ctx, &arrayObj->Vertex); + unmap_array_buffer(ctx, &arrayObj->Normal); + unmap_array_buffer(ctx, &arrayObj->Color); + for (k = 0; k < Elements(arrayObj->TexCoord); k++) { + unmap_array_buffer(ctx, &arrayObj->TexCoord[k]); + } + for (k = 0; k < Elements(arrayObj->VertexAttrib); k++) { + unmap_array_buffer(ctx, &arrayObj->VertexAttrib[k]); + } +} + + +/** + * Check array data, looking for NaNs, etc. + */ +static void +check_draw_arrays_data(struct gl_context *ctx, GLint start, GLsizei count) +{ + /* TO DO */ +} + + +/** + * Print info/data for glDrawArrays(), for debugging. + */ +static void +print_draw_arrays(struct gl_context *ctx, + GLenum mode, GLint start, GLsizei count) +{ + struct vbo_context *vbo = vbo_context(ctx); + struct vbo_exec_context *exec = &vbo->exec; + int i; + + printf("vbo_exec_DrawArrays(mode 0x%x, start %d, count %d):\n", + mode, start, count); + + for (i = 0; i < 32; i++) { + GLuint bufName = exec->array.inputs[i]->BufferObj->Name; + GLint stride = exec->array.inputs[i]->Stride; + printf("attr %2d: size %d stride %d enabled %d " + "ptr %p Bufobj %u\n", + i, + exec->array.inputs[i]->Size, + stride, + /*exec->array.inputs[i]->Enabled,*/ + exec->array.legacy_array[i]->Enabled, + exec->array.inputs[i]->Ptr, + bufName); + + if (bufName) { + struct gl_buffer_object *buf = _mesa_lookup_bufferobj(ctx, bufName); + GLubyte *p = ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER_ARB, + GL_READ_ONLY_ARB, buf); + int offset = (int) (GLintptr) exec->array.inputs[i]->Ptr; + float *f = (float *) (p + offset); + int *k = (int *) f; + int i; + int n = (count * stride) / 4; + if (n > 32) + n = 32; + printf(" Data at offset %d:\n", offset); + for (i = 0; i < n; i++) { + printf(" float[%d] = 0x%08x %f\n", i, k[i], f[i]); + } + ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, buf); + } + } +} + + +/** + * Bind the VBO executor to the current vertex array object prior + * to drawing. + * + * Just translate the arrayobj into a sane layout. + */ +static void +bind_array_obj(struct gl_context *ctx) +{ + struct vbo_context *vbo = vbo_context(ctx); + struct vbo_exec_context *exec = &vbo->exec; + struct gl_array_object *arrayObj = ctx->Array.ArrayObj; + GLuint i; + + /* TODO: Fix the ArrayObj struct to keep legacy arrays in an array + * rather than as individual named arrays. Then this function can + * go away. + */ + exec->array.legacy_array[VERT_ATTRIB_POS] = &arrayObj->Vertex; + exec->array.legacy_array[VERT_ATTRIB_WEIGHT] = &arrayObj->Weight; + exec->array.legacy_array[VERT_ATTRIB_NORMAL] = &arrayObj->Normal; + exec->array.legacy_array[VERT_ATTRIB_COLOR0] = &arrayObj->Color; + exec->array.legacy_array[VERT_ATTRIB_COLOR1] = &arrayObj->SecondaryColor; + exec->array.legacy_array[VERT_ATTRIB_FOG] = &arrayObj->FogCoord; + exec->array.legacy_array[VERT_ATTRIB_COLOR_INDEX] = &arrayObj->Index; + if (arrayObj->PointSize.Enabled) { + /* this aliases COLOR_INDEX */ + exec->array.legacy_array[VERT_ATTRIB_POINT_SIZE] = &arrayObj->PointSize; + } + exec->array.legacy_array[VERT_ATTRIB_EDGEFLAG] = &arrayObj->EdgeFlag; + + for (i = 0; i < Elements(arrayObj->TexCoord); i++) + exec->array.legacy_array[VERT_ATTRIB_TEX0 + i] = &arrayObj->TexCoord[i]; + + for (i = 0; i < Elements(arrayObj->VertexAttrib); i++) { + assert(i < Elements(exec->array.generic_array)); + exec->array.generic_array[i] = &arrayObj->VertexAttrib[i]; + } + + exec->array.array_obj = arrayObj->Name; +} + + +/** + * Set the vbo->exec->inputs[] pointers to point to the enabled + * vertex arrays. This depends on the current vertex program/shader + * being executed because of whether or not generic vertex arrays + * alias the conventional vertex arrays. + * For arrays that aren't enabled, we set the input[attrib] pointer + * to point at a zero-stride current value "array". + */ +static void +recalculate_input_bindings(struct gl_context *ctx) +{ + struct vbo_context *vbo = vbo_context(ctx); + struct vbo_exec_context *exec = &vbo->exec; + const struct gl_client_array **inputs = &exec->array.inputs[0]; + GLbitfield const_inputs = 0x0; + GLuint i; + + exec->array.program_mode = get_program_mode(ctx); + exec->array.enabled_flags = ctx->Array.ArrayObj->_Enabled; + + switch (exec->array.program_mode) { + case VP_NONE: + /* When no vertex program is active (or the vertex program is generated + * from fixed-function state). We put the material values into the + * generic slots. This is the only situation where material values + * are available as per-vertex attributes. + */ + for (i = 0; i <= VERT_ATTRIB_TEX7; i++) { + if (exec->array.legacy_array[i]->Enabled) + inputs[i] = exec->array.legacy_array[i]; + else { + inputs[i] = &vbo->legacy_currval[i]; + const_inputs |= 1 << i; + } + } + + for (i = 0; i < MAT_ATTRIB_MAX; i++) { + inputs[VERT_ATTRIB_GENERIC0 + i] = &vbo->mat_currval[i]; + const_inputs |= 1 << (VERT_ATTRIB_GENERIC0 + i); + } + + /* Could use just about anything, just to fill in the empty + * slots: + */ + for (i = MAT_ATTRIB_MAX; i < VERT_ATTRIB_MAX - VERT_ATTRIB_GENERIC0; i++) { + inputs[VERT_ATTRIB_GENERIC0 + i] = &vbo->generic_currval[i]; + const_inputs |= 1 << (VERT_ATTRIB_GENERIC0 + i); + } + break; + + case VP_NV: + /* NV_vertex_program - attribute arrays alias and override + * conventional, legacy arrays. No materials, and the generic + * slots are vacant. + */ + for (i = 0; i <= VERT_ATTRIB_TEX7; i++) { + if (exec->array.generic_array[i]->Enabled) + inputs[i] = exec->array.generic_array[i]; + else if (exec->array.legacy_array[i]->Enabled) + inputs[i] = exec->array.legacy_array[i]; + else { + inputs[i] = &vbo->legacy_currval[i]; + const_inputs |= 1 << i; + } + } + + /* Could use just about anything, just to fill in the empty + * slots: + */ + for (i = VERT_ATTRIB_GENERIC0; i < VERT_ATTRIB_MAX; i++) { + inputs[i] = &vbo->generic_currval[i - VERT_ATTRIB_GENERIC0]; + const_inputs |= 1 << i; + } + break; + + case VP_ARB: + /* GL_ARB_vertex_program or GLSL vertex shader - Only the generic[0] + * attribute array aliases and overrides the legacy position array. + * + * Otherwise, legacy attributes available in the legacy slots, + * generic attributes in the generic slots and materials are not + * available as per-vertex attributes. + */ + if (exec->array.generic_array[0]->Enabled) + inputs[0] = exec->array.generic_array[0]; + else if (exec->array.legacy_array[0]->Enabled) + inputs[0] = exec->array.legacy_array[0]; + else { + inputs[0] = &vbo->legacy_currval[0]; + const_inputs |= 1 << 0; + } + + for (i = 1; i <= VERT_ATTRIB_TEX7; i++) { + if (exec->array.legacy_array[i]->Enabled) + inputs[i] = exec->array.legacy_array[i]; + else { + inputs[i] = &vbo->legacy_currval[i]; + const_inputs |= 1 << i; + } + } + + for (i = 0; i < MAX_VERTEX_GENERIC_ATTRIBS; i++) { + if (exec->array.generic_array[i]->Enabled) + inputs[VERT_ATTRIB_GENERIC0 + i] = exec->array.generic_array[i]; + else { + inputs[VERT_ATTRIB_GENERIC0 + i] = &vbo->generic_currval[i]; + const_inputs |= 1 << (VERT_ATTRIB_GENERIC0 + i); + } + + } + break; + } + + _mesa_set_varying_vp_inputs( ctx, ~const_inputs ); +} + + +/** + * Examine the enabled vertex arrays to set the exec->array.inputs[] values. + * These will point to the arrays to actually use for drawing. Some will + * be user-provided arrays, other will be zero-stride const-valued arrays. + * Note that this might set the _NEW_ARRAY dirty flag so state validation + * must be done after this call. + */ +static void +bind_arrays(struct gl_context *ctx) +{ + if (!ctx->Array.RebindArrays) { + return; + } + + bind_array_obj(ctx); + recalculate_input_bindings(ctx); + ctx->Array.RebindArrays = GL_FALSE; +} + + +/** + * Helper function called by the other DrawArrays() functions below. + * This is where we handle primitive restart for drawing non-indexed + * arrays. If primitive restart is enabled, it typically means + * splitting one DrawArrays() into two. + */ +static void +vbo_draw_arrays(struct gl_context *ctx, GLenum mode, GLint start, + GLsizei count, GLuint numInstances) +{ + struct vbo_context *vbo = vbo_context(ctx); + struct vbo_exec_context *exec = &vbo->exec; + struct _mesa_prim prim[2]; + + bind_arrays(ctx); + + /* Again... because we may have changed the bitmask of per-vertex varying + * attributes. If we regenerate the fixed-function vertex program now + * we may be able to prune down the number of vertex attributes which we + * need in the shader. + */ + if (ctx->NewState) + _mesa_update_state(ctx); + + prim[0].begin = 1; + prim[0].end = 1; + prim[0].weak = 0; + prim[0].pad = 0; + prim[0].mode = mode; + prim[0].start = 0; /* filled in below */ + prim[0].count = 0; /* filled in below */ + prim[0].indexed = 0; + prim[0].basevertex = 0; + prim[0].num_instances = numInstances; + + /* Implement the primitive restart index */ + if (ctx->Array.PrimitiveRestart && ctx->Array.RestartIndex < count) { + GLuint primCount = 0; + + if (ctx->Array.RestartIndex == start) { + /* special case: RestartIndex at beginning */ + if (count > 1) { + prim[0].start = start + 1; + prim[0].count = count - 1; + primCount = 1; + } + } + else if (ctx->Array.RestartIndex == start + count - 1) { + /* special case: RestartIndex at end */ + if (count > 1) { + prim[0].start = start; + prim[0].count = count - 1; + primCount = 1; + } + } + else { + /* general case: RestartIndex in middle, split into two prims */ + prim[0].start = start; + prim[0].count = ctx->Array.RestartIndex - start; + + prim[1] = prim[0]; + prim[1].start = ctx->Array.RestartIndex + 1; + prim[1].count = count - prim[1].start; + + primCount = 2; + } + + if (primCount > 0) { + /* draw one or two prims */ + check_buffers_are_unmapped(exec->array.inputs); + vbo->draw_prims(ctx, exec->array.inputs, prim, primCount, NULL, + GL_TRUE, start, start + count - 1); + } + } + else { + /* no prim restart */ + prim[0].start = start; + prim[0].count = count; + + check_buffers_are_unmapped(exec->array.inputs); + vbo->draw_prims(ctx, exec->array.inputs, prim, 1, NULL, + GL_TRUE, start, start + count - 1); + } +} + + + +/** + * Called from glDrawArrays when in immediate mode (not display list mode). + */ +static void GLAPIENTRY +vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count) +{ + GET_CURRENT_CONTEXT(ctx); + + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, "glDrawArrays(%s, %d, %d)\n", + _mesa_lookup_enum_by_nr(mode), start, count); + + if (!_mesa_validate_DrawArrays( ctx, mode, start, count )) + return; + + FLUSH_CURRENT( ctx, 0 ); + + if (!_mesa_valid_to_render(ctx, "glDrawArrays")) { + return; + } + + if (0) + check_draw_arrays_data(ctx, start, count); + + vbo_draw_arrays(ctx, mode, start, count, 1); + + if (0) + print_draw_arrays(ctx, mode, start, count); +} + + +/** + * Called from glDrawArraysInstanced when in immediate mode (not + * display list mode). + */ +static void GLAPIENTRY +vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count, + GLsizei numInstances) +{ + GET_CURRENT_CONTEXT(ctx); + + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, "glDrawArraysInstanced(%s, %d, %d, %d)\n", + _mesa_lookup_enum_by_nr(mode), start, count, numInstances); + + if (!_mesa_validate_DrawArraysInstanced(ctx, mode, start, count, numInstances)) + return; + + FLUSH_CURRENT( ctx, 0 ); + + if (!_mesa_valid_to_render(ctx, "glDrawArraysInstanced")) { + return; + } + + if (0) + check_draw_arrays_data(ctx, start, count); + + vbo_draw_arrays(ctx, mode, start, count, numInstances); + + if (0) + print_draw_arrays(ctx, mode, start, count); +} + + +/** + * Map GL_ELEMENT_ARRAY_BUFFER and print contents. + * For debugging. + */ +static void +dump_element_buffer(struct gl_context *ctx, GLenum type) +{ + const GLvoid *map = ctx->Driver.MapBuffer(ctx, + GL_ELEMENT_ARRAY_BUFFER_ARB, + GL_READ_ONLY, + ctx->Array.ElementArrayBufferObj); + switch (type) { + case GL_UNSIGNED_BYTE: + { + const GLubyte *us = (const GLubyte *) map; + GLint i; + for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size; i++) { + printf("%02x ", us[i]); + if (i % 32 == 31) + printf("\n"); + } + printf("\n"); + } + break; + case GL_UNSIGNED_SHORT: + { + const GLushort *us = (const GLushort *) map; + GLint i; + for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size / 2; i++) { + printf("%04x ", us[i]); + if (i % 16 == 15) + printf("\n"); + } + printf("\n"); + } + break; + case GL_UNSIGNED_INT: + { + const GLuint *us = (const GLuint *) map; + GLint i; + for (i = 0; i < ctx->Array.ElementArrayBufferObj->Size / 4; i++) { + printf("%08x ", us[i]); + if (i % 8 == 7) + printf("\n"); + } + printf("\n"); + } + break; + default: + ; + } + + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, + ctx->Array.ElementArrayBufferObj); +} + + +/** + * Inner support for both _mesa_DrawElements and _mesa_DrawRangeElements. + * Do the rendering for a glDrawElements or glDrawRangeElements call after + * we've validated buffer bounds, etc. + */ +static void +vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode, + GLboolean index_bounds_valid, + GLuint start, GLuint end, + GLsizei count, GLenum type, + const GLvoid *indices, + GLint basevertex, GLint numInstances) +{ + struct vbo_context *vbo = vbo_context(ctx); + struct vbo_exec_context *exec = &vbo->exec; + struct _mesa_index_buffer ib; + struct _mesa_prim prim[1]; + + FLUSH_CURRENT( ctx, 0 ); + + if (!_mesa_valid_to_render(ctx, "glDraw[Range]Elements")) { + return; + } + + bind_arrays( ctx ); + + /* check for dirty state again */ + if (ctx->NewState) + _mesa_update_state( ctx ); + + ib.count = count; + ib.type = type; + ib.obj = ctx->Array.ElementArrayBufferObj; + ib.ptr = indices; + + prim[0].begin = 1; + prim[0].end = 1; + prim[0].weak = 0; + prim[0].pad = 0; + prim[0].mode = mode; + prim[0].start = 0; + prim[0].count = count; + prim[0].indexed = 1; + prim[0].basevertex = basevertex; + prim[0].num_instances = numInstances; + + /* Need to give special consideration to rendering a range of + * indices starting somewhere above zero. Typically the + * application is issuing multiple DrawRangeElements() to draw + * successive primitives layed out linearly in the vertex arrays. + * Unless the vertex arrays are all in a VBO (or locked as with + * CVA), the OpenGL semantics imply that we need to re-read or + * re-upload the vertex data on each draw call. + * + * In the case of hardware tnl, we want to avoid starting the + * upload at zero, as it will mean every draw call uploads an + * increasing amount of not-used vertex data. Worse - in the + * software tnl module, all those vertices might be transformed and + * lit but never rendered. + * + * If we just upload or transform the vertices in start..end, + * however, the indices will be incorrect. + * + * At this level, we don't know exactly what the requirements of + * the backend are going to be, though it will likely boil down to + * either: + * + * 1) Do nothing, everything is in a VBO and is processed once + * only. + * + * 2) Adjust the indices and vertex arrays so that start becomes + * zero. + * + * Rather than doing anything here, I'll provide a helper function + * for the latter case elsewhere. + */ + + check_buffers_are_unmapped(exec->array.inputs); + vbo->draw_prims( ctx, exec->array.inputs, prim, 1, &ib, + index_bounds_valid, start, end ); +} + + +/** + * Called by glDrawRangeElementsBaseVertex() in immediate mode. + */ +static void GLAPIENTRY +vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, + GLuint start, GLuint end, + GLsizei count, GLenum type, + const GLvoid *indices, + GLint basevertex) +{ + static GLuint warnCount = 0; + GET_CURRENT_CONTEXT(ctx); + + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, + "glDrawRangeElementsBaseVertex(%s, %u, %u, %d, %s, %p, %d)\n", + _mesa_lookup_enum_by_nr(mode), start, end, count, + _mesa_lookup_enum_by_nr(type), indices, basevertex); + + if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count, + type, indices, basevertex )) + return; + + /* NOTE: It's important that 'end' is a reasonable value. + * in _tnl_draw_prims(), we use end to determine how many vertices + * to transform. If it's too large, we can unnecessarily split prims + * or we can read/write out of memory in several different places! + */ + + /* Catch/fix some potential user errors */ + if (type == GL_UNSIGNED_BYTE) { + start = MIN2(start, 0xff); + end = MIN2(end, 0xff); + } + else if (type == GL_UNSIGNED_SHORT) { + start = MIN2(start, 0xffff); + end = MIN2(end, 0xffff); + } + + if (end >= ctx->Array.ArrayObj->_MaxElement) { + /* the max element is out of bounds of one or more enabled arrays */ + warnCount++; + + if (warnCount < 10) { + _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, count %d, " + "type 0x%x, indices=%p)\n" + "\tend is out of bounds (max=%u) " + "Element Buffer %u (size %d)\n" + "\tThis should probably be fixed in the application.", + start, end, count, type, indices, + ctx->Array.ArrayObj->_MaxElement - 1, + ctx->Array.ElementArrayBufferObj->Name, + (int) ctx->Array.ElementArrayBufferObj->Size); + } + + if (0) + dump_element_buffer(ctx, type); + + if (0) + _mesa_print_arrays(ctx); + +#ifdef DEBUG + /* 'end' was out of bounds, but now let's check the actual array + * indexes to see if any of them are out of bounds. + */ + { + GLuint max = _mesa_max_buffer_index(ctx, count, type, indices, + ctx->Array.ElementArrayBufferObj); + if (max >= ctx->Array.ArrayObj->_MaxElement) { + if (warnCount < 10) { + _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, " + "count %d, type 0x%x, indices=%p)\n" + "\tindex=%u is out of bounds (max=%u) " + "Element Buffer %u (size %d)\n" + "\tSkipping the glDrawRangeElements() call", + start, end, count, type, indices, max, + ctx->Array.ArrayObj->_MaxElement - 1, + ctx->Array.ElementArrayBufferObj->Name, + (int) ctx->Array.ElementArrayBufferObj->Size); + } + } + /* XXX we could also find the min index and compare to 'start' + * to see if start is correct. But it's more likely to get the + * upper bound wrong. + */ + } +#endif + + /* Set 'end' to the max possible legal value */ + assert(ctx->Array.ArrayObj->_MaxElement >= 1); + end = ctx->Array.ArrayObj->_MaxElement - 1; + } + else if (0) { + printf("glDraw[Range]Elements{,BaseVertex}" + "(start %u, end %u, type 0x%x, count %d) ElemBuf %u, " + "base %d\n", + start, end, type, count, + ctx->Array.ElementArrayBufferObj->Name, + basevertex); + } + +#if 0 + check_draw_elements_data(ctx, count, type, indices); +#else + (void) check_draw_elements_data; +#endif + + vbo_validated_drawrangeelements(ctx, mode, GL_TRUE, start, end, + count, type, indices, basevertex, 1); +} + + +/** + * Called by glDrawRangeElements() in immediate mode. + */ +static void GLAPIENTRY +vbo_exec_DrawRangeElements(GLenum mode, GLuint start, GLuint end, + GLsizei count, GLenum type, const GLvoid *indices) +{ + GET_CURRENT_CONTEXT(ctx); + + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, + "glDrawRangeElements(%s, %u, %u, %d, %s, %p)\n", + _mesa_lookup_enum_by_nr(mode), start, end, count, + _mesa_lookup_enum_by_nr(type), indices); + + vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type, + indices, 0); +} + + +/** + * Called by glDrawElements() in immediate mode. + */ +static void GLAPIENTRY +vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type, + const GLvoid *indices) +{ + GET_CURRENT_CONTEXT(ctx); + + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, "glDrawElements(%s, %u, %s, %p)\n", + _mesa_lookup_enum_by_nr(mode), count, + _mesa_lookup_enum_by_nr(type), indices); + + if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, 0 )) + return; + + vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0, + count, type, indices, 0, 1); +} + + +/** + * Called by glDrawElementsBaseVertex() in immediate mode. + */ +static void GLAPIENTRY +vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, + const GLvoid *indices, GLint basevertex) +{ + GET_CURRENT_CONTEXT(ctx); + + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, "glDrawElementsBaseVertex(%s, %d, %s, %p, %d)\n", + _mesa_lookup_enum_by_nr(mode), count, + _mesa_lookup_enum_by_nr(type), indices, basevertex); + + if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, + basevertex )) + return; + + vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0, + count, type, indices, basevertex, 1); +} + + +/** + * Called by glDrawElementsInstanced() in immediate mode. + */ +static void GLAPIENTRY +vbo_exec_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, + const GLvoid *indices, GLsizei numInstances) +{ + GET_CURRENT_CONTEXT(ctx); + + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, "glDrawElementsInstanced(%s, %d, %s, %p, %d)\n", + _mesa_lookup_enum_by_nr(mode), count, + _mesa_lookup_enum_by_nr(type), indices, numInstances); + + if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices, + numInstances)) + return; + + vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0, + count, type, indices, 0, numInstances); +} + + +/** + * Inner support for both _mesa_MultiDrawElements() and + * _mesa_MultiDrawRangeElements(). + * This does the actual rendering after we've checked array indexes, etc. + */ +static void +vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode, + const GLsizei *count, GLenum type, + const GLvoid **indices, GLsizei primcount, + const GLint *basevertex) +{ + struct vbo_context *vbo = vbo_context(ctx); + struct vbo_exec_context *exec = &vbo->exec; + struct _mesa_index_buffer ib; + struct _mesa_prim *prim; + unsigned int index_type_size = 0; + uintptr_t min_index_ptr, max_index_ptr; + GLboolean fallback = GL_FALSE; + int i; + + if (primcount == 0) + return; + + FLUSH_CURRENT( ctx, 0 ); + + if (!_mesa_valid_to_render(ctx, "glMultiDrawElements")) { + return; + } + + prim = calloc(1, primcount * sizeof(*prim)); + if (prim == NULL) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMultiDrawElements"); + return; + } + + /* Decide if we can do this all as one set of primitives sharing the + * same index buffer, or if we have to reset the index pointer per + * primitive. + */ + bind_arrays( ctx ); + + /* check for dirty state again */ + if (ctx->NewState) + _mesa_update_state( ctx ); + + switch (type) { + case GL_UNSIGNED_INT: + index_type_size = 4; + break; + case GL_UNSIGNED_SHORT: + index_type_size = 2; + break; + case GL_UNSIGNED_BYTE: + index_type_size = 1; + break; + default: + assert(0); + } + + min_index_ptr = (uintptr_t)indices[0]; + max_index_ptr = 0; + for (i = 0; i < primcount; i++) { + min_index_ptr = MIN2(min_index_ptr, (uintptr_t)indices[i]); + max_index_ptr = MAX2(max_index_ptr, (uintptr_t)indices[i] + + index_type_size * count[i]); + } + + /* Check if we can handle this thing as a bunch of index offsets from the + * same index pointer. If we can't, then we have to fall back to doing + * a draw_prims per primitive. + * Check that the difference between each prim's indexes is a multiple of + * the index/element size. + */ + if (index_type_size != 1) { + for (i = 0; i < primcount; i++) { + if ((((uintptr_t)indices[i] - min_index_ptr) % index_type_size) != 0) { + fallback = GL_TRUE; + break; + } + } + } + + /* If the index buffer isn't in a VBO, then treating the application's + * subranges of the index buffer as one large index buffer may lead to + * us reading unmapped memory. + */ + if (!_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) + fallback = GL_TRUE; + + if (!fallback) { + ib.count = (max_index_ptr - min_index_ptr) / index_type_size; + ib.type = type; + ib.obj = ctx->Array.ElementArrayBufferObj; + ib.ptr = (void *)min_index_ptr; + + for (i = 0; i < primcount; i++) { + prim[i].begin = (i == 0); + prim[i].end = (i == primcount - 1); + prim[i].weak = 0; + prim[i].pad = 0; + prim[i].mode = mode; + prim[i].start = ((uintptr_t)indices[i] - min_index_ptr) / index_type_size; + prim[i].count = count[i]; + prim[i].indexed = 1; + prim[i].num_instances = 1; + if (basevertex != NULL) + prim[i].basevertex = basevertex[i]; + else + prim[i].basevertex = 0; + } + + check_buffers_are_unmapped(exec->array.inputs); + vbo->draw_prims(ctx, exec->array.inputs, prim, primcount, &ib, + GL_FALSE, ~0, ~0); + } else { + /* render one prim at a time */ + for (i = 0; i < primcount; i++) { + ib.count = count[i]; + ib.type = type; + ib.obj = ctx->Array.ElementArrayBufferObj; + ib.ptr = indices[i]; + + prim[0].begin = 1; + prim[0].end = 1; + prim[0].weak = 0; + prim[0].pad = 0; + prim[0].mode = mode; + prim[0].start = 0; + prim[0].count = count[i]; + prim[0].indexed = 1; + prim[0].num_instances = 1; + if (basevertex != NULL) + prim[0].basevertex = basevertex[i]; + else + prim[0].basevertex = 0; + + check_buffers_are_unmapped(exec->array.inputs); + vbo->draw_prims(ctx, exec->array.inputs, prim, 1, &ib, + GL_FALSE, ~0, ~0); + } + } + + free(prim); +} + + +static void GLAPIENTRY +vbo_exec_MultiDrawElements(GLenum mode, + const GLsizei *count, GLenum type, + const GLvoid **indices, + GLsizei primcount) +{ + GET_CURRENT_CONTEXT(ctx); + GLint i; + + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + + for (i = 0; i < primcount; i++) { + if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i], + 0)) + return; + } + + vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount, + NULL); +} + + +static void GLAPIENTRY +vbo_exec_MultiDrawElementsBaseVertex(GLenum mode, + const GLsizei *count, GLenum type, + const GLvoid **indices, + GLsizei primcount, + const GLsizei *basevertex) +{ + GET_CURRENT_CONTEXT(ctx); + GLint i; + + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + + for (i = 0; i < primcount; i++) { + if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i], + basevertex[i])) + return; + } + + vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount, + basevertex); +} + + +/** + * Plug in the immediate-mode vertex array drawing commands into the + * givven vbo_exec_context object. + */ +void +vbo_exec_array_init( struct vbo_exec_context *exec ) +{ + exec->vtxfmt.DrawArrays = vbo_exec_DrawArrays; + exec->vtxfmt.DrawElements = vbo_exec_DrawElements; + exec->vtxfmt.DrawRangeElements = vbo_exec_DrawRangeElements; + exec->vtxfmt.MultiDrawElementsEXT = vbo_exec_MultiDrawElements; + exec->vtxfmt.DrawElementsBaseVertex = vbo_exec_DrawElementsBaseVertex; + exec->vtxfmt.DrawRangeElementsBaseVertex = vbo_exec_DrawRangeElementsBaseVertex; + exec->vtxfmt.MultiDrawElementsBaseVertex = vbo_exec_MultiDrawElementsBaseVertex; + exec->vtxfmt.DrawArraysInstanced = vbo_exec_DrawArraysInstanced; + exec->vtxfmt.DrawElementsInstanced = vbo_exec_DrawElementsInstanced; +} + + +void +vbo_exec_array_destroy( struct vbo_exec_context *exec ) +{ + /* nothing to do */ +} + + + +/** + * The following functions are only used for OpenGL ES 1/2 support. + * And some aren't even supported (yet) in ES 1/2. + */ + + +void GLAPIENTRY +_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count) +{ + vbo_exec_DrawArrays(mode, first, count); +} + + +void GLAPIENTRY +_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, + const GLvoid *indices) +{ + vbo_exec_DrawElements(mode, count, type, indices); +} + + +void GLAPIENTRY +_mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, + const GLvoid *indices, GLint basevertex) +{ + vbo_exec_DrawElementsBaseVertex(mode, count, type, indices, basevertex); +} + + +void GLAPIENTRY +_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, + GLenum type, const GLvoid *indices) +{ + vbo_exec_DrawRangeElements(mode, start, end, count, type, indices); +} + + +void GLAPIENTRY +_mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, + GLsizei count, GLenum type, + const GLvoid *indices, GLint basevertex) +{ + vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type, + indices, basevertex); +} + + +void GLAPIENTRY +_mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, + const GLvoid **indices, GLsizei primcount) +{ + vbo_exec_MultiDrawElements(mode, count, type, indices, primcount); +} + + +void GLAPIENTRY +_mesa_MultiDrawElementsBaseVertex(GLenum mode, + const GLsizei *count, GLenum type, + const GLvoid **indices, GLsizei primcount, + const GLint *basevertex) +{ + vbo_exec_MultiDrawElementsBaseVertex(mode, count, type, indices, + primcount, basevertex); +} diff --git a/pixman/demos/Makefile.am b/pixman/demos/Makefile.am index 2dcdfd350..171f8f419 100644 --- a/pixman/demos/Makefile.am +++ b/pixman/demos/Makefile.am @@ -1,34 +1,36 @@ -if HAVE_GTK - -AM_CFLAGS = @OPENMP_CFLAGS@ -AM_LDFLAGS = @OPENMP_CFLAGS@ - -LDADD = $(GTK_LIBS) $(top_builddir)/pixman/libpixman-1.la -lm -INCLUDES = -I$(top_srcdir)/pixman -I$(top_builddir)/pixman $(GTK_CFLAGS) - -GTK_UTILS = gtk-utils.c gtk-utils.h - -DEMOS = \ - clip-test \ - clip-in \ - composite-test \ - gradient-test \ - radial-test \ - alpha-test \ - screen-test \ - convolution-test \ - trap-test - -gradient_test_SOURCES = gradient-test.c $(GTK_UTILS) -alpha_test_SOURCES = alpha-test.c $(GTK_UTILS) -composite_test_SOURCES = composite-test.c $(GTK_UTILS) -clip_test_SOURCES = clip-test.c $(GTK_UTILS) -clip_in_SOURCES = clip-in.c $(GTK_UTILS) -trap_test_SOURCES = trap-test.c $(GTK_UTILS) -screen_test_SOURCES = screen-test.c $(GTK_UTILS) -convolution_test_SOURCES = convolution-test.c $(GTK_UTILS) -radial_test_SOURCES = radial-test.c ../test/utils.c ../test/utils.h $(GTK_UTILS) - -noinst_PROGRAMS = $(DEMOS) - -endif +if HAVE_GTK + +AM_CFLAGS = @OPENMP_CFLAGS@ +AM_LDFLAGS = @OPENMP_CFLAGS@ + +LDADD = $(top_builddir)/pixman/libpixman-1.la -lm $(GTK_LIBS) +INCLUDES = -I$(top_srcdir)/pixman -I$(top_builddir)/pixman $(GTK_CFLAGS) + +GTK_UTILS = gtk-utils.c gtk-utils.h + +DEMOS = \ + clip-test \ + clip-in \ + composite-test \ + gradient-test \ + radial-test \ + alpha-test \ + screen-test \ + convolution-test \ + trap-test \ + tri-test + +gradient_test_SOURCES = gradient-test.c $(GTK_UTILS) +alpha_test_SOURCES = alpha-test.c $(GTK_UTILS) +composite_test_SOURCES = composite-test.c $(GTK_UTILS) +clip_test_SOURCES = clip-test.c $(GTK_UTILS) +clip_in_SOURCES = clip-in.c $(GTK_UTILS) +trap_test_SOURCES = trap-test.c $(GTK_UTILS) +screen_test_SOURCES = screen-test.c $(GTK_UTILS) +convolution_test_SOURCES = convolution-test.c $(GTK_UTILS) +radial_test_SOURCES = radial-test.c ../test/utils.c ../test/utils.h $(GTK_UTILS) +tri_test_SOURCES = tri-test.c ../test/utils.c ../test/utils.h $(GTK_UTILS) + +noinst_PROGRAMS = $(DEMOS) + +endif diff --git a/pixman/demos/tri-test.c b/pixman/demos/tri-test.c new file mode 100644 index 000000000..23ea18cb3 --- /dev/null +++ b/pixman/demos/tri-test.c @@ -0,0 +1,48 @@ +#include +#include +#include +#include "../test/utils.h" +#include "gtk-utils.h" + +int +main (int argc, char **argv) +{ +#define WIDTH 200 +#define HEIGHT 200 + +#define POINT(x,y) \ + { pixman_double_to_fixed ((x)), pixman_double_to_fixed ((y)) } + + pixman_image_t *src_img, *dest_img; + pixman_triangle_t tris[4] = + { + { POINT (100, 100), POINT (10, 50), POINT (110, 10) }, + { POINT (100, 100), POINT (150, 10), POINT (200, 50) }, + { POINT (100, 100), POINT (10, 170), POINT (90, 175) }, + { POINT (100, 100), POINT (170, 150), POINT (120, 190) }, + }; + pixman_color_t color = { 0x4444, 0x4444, 0xffff, 0xffff }; + uint32_t *bits = malloc (WIDTH * HEIGHT * 4); + int i; + + for (i = 0; i < WIDTH * HEIGHT; ++i) + bits[i] = (i / HEIGHT) * 0x01010000; + + src_img = pixman_image_create_solid_fill (&color); + dest_img = pixman_image_create_bits (PIXMAN_a8r8g8b8, WIDTH, HEIGHT, bits, WIDTH * 4); + + pixman_composite_triangles (PIXMAN_OP_ATOP_REVERSE, + src_img, + dest_img, + PIXMAN_a8, + 200, 200, + 35, 5, + ARRAY_LENGTH (tris), tris); + show_image (dest_img); + + pixman_image_unref (src_img); + pixman_image_unref (dest_img); + free (bits); + + return 0; +} diff --git a/pixman/pixman/pixman-image.c b/pixman/pixman/pixman-image.c index beda4b423..306692fe0 100644 --- a/pixman/pixman/pixman-image.c +++ b/pixman/pixman/pixman-image.c @@ -502,7 +502,7 @@ pixman_image_set_transform (pixman_image_t * image, if (common->transform == transform) return TRUE; - if (memcmp (&id, transform, sizeof (pixman_transform_t)) == 0) + if (!transform || memcmp (&id, transform, sizeof (pixman_transform_t)) == 0) { free (common->transform); common->transform = NULL; @@ -511,6 +511,12 @@ pixman_image_set_transform (pixman_image_t * image, goto out; } + if (common->transform && + memcmp (common->transform, transform, sizeof (pixman_transform_t) == 0)) + { + return TRUE; + } + if (common->transform == NULL) common->transform = malloc (sizeof (pixman_transform_t)); @@ -535,6 +541,9 @@ PIXMAN_EXPORT void pixman_image_set_repeat (pixman_image_t *image, pixman_repeat_t repeat) { + if (image->common.repeat == repeat) + return; + image->common.repeat = repeat; image_property_changed (image); @@ -579,6 +588,9 @@ PIXMAN_EXPORT void pixman_image_set_source_clipping (pixman_image_t *image, pixman_bool_t clip_sources) { + if (image->common.clip_sources == clip_sources) + return; + image->common.clip_sources = clip_sources; image_property_changed (image); @@ -594,6 +606,9 @@ pixman_image_set_indexed (pixman_image_t * image, { bits_image_t *bits = (bits_image_t *)image; + if (bits->indexed == indexed) + return; + bits->indexed = indexed; image_property_changed (image); @@ -656,6 +671,9 @@ PIXMAN_EXPORT void pixman_image_set_component_alpha (pixman_image_t *image, pixman_bool_t component_alpha) { + if (image->common.component_alpha == component_alpha) + return; + image->common.component_alpha = component_alpha; image_property_changed (image); diff --git a/pixman/pixman/pixman-trap.c b/pixman/pixman/pixman-trap.c index 787093a85..6e85acd49 100644 --- a/pixman/pixman/pixman-trap.c +++ b/pixman/pixman/pixman-trap.c @@ -1,4 +1,5 @@ /* + * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc. * Copyright © 2004 Keith Packard * * Permission to use, copy, modify, distribute, and sell this software and its @@ -25,6 +26,7 @@ #endif #include +#include #include "pixman-private.h" /* @@ -384,3 +386,272 @@ pixman_rasterize_trapezoid (pixman_image_t * image, pixman_rasterize_edges (image, &l, &r, t, b); } } + +PIXMAN_EXPORT void +pixman_composite_trapezoids (pixman_op_t op, + pixman_image_t * src, + pixman_image_t * dst, + pixman_format_code_t mask_format, + int x_src, + int y_src, + int x_dst, + int y_dst, + int n_traps, + const pixman_trapezoid_t * traps) +{ + int i; + + if (n_traps <= 0) + return; + + _pixman_image_validate (src); + _pixman_image_validate (dst); + + if (op == PIXMAN_OP_ADD && + (src->common.flags & FAST_PATH_IS_OPAQUE) && + (mask_format == dst->common.extended_format_code) && + !(dst->common.have_clip_region)) + { + for (i = 0; i < n_traps; ++i) + { + const pixman_trapezoid_t *trap = &(traps[i]); + + if (!pixman_trapezoid_valid (trap)) + continue; + + pixman_rasterize_trapezoid (dst, trap, 0, 0); + } + } + else + { + pixman_image_t *tmp; + pixman_box32_t box; + int x_rel, y_rel; + + box.x1 = INT32_MAX; + box.y1 = INT32_MAX; + box.x2 = INT32_MIN; + box.y2 = INT32_MIN; + + for (i = 0; i < n_traps; ++i) + { + const pixman_trapezoid_t *trap = &(traps[i]); + int y1, y2; + + if (!pixman_trapezoid_valid (trap)) + continue; + + y1 = pixman_fixed_to_int (trap->top); + if (y1 < box.y1) + box.y1 = y1; + + y2 = pixman_fixed_to_int (pixman_fixed_ceil (trap->bottom)); + if (y2 > box.y2) + box.y2 = y2; + +#define EXTEND_MIN(x) \ + if (pixman_fixed_to_int ((x)) < box.x1) \ + box.x1 = pixman_fixed_to_int ((x)); +#define EXTEND_MAX(x) \ + if (pixman_fixed_to_int (pixman_fixed_ceil ((x))) > box.x2) \ + box.x2 = pixman_fixed_to_int (pixman_fixed_ceil ((x))); + +#define EXTEND(x) \ + EXTEND_MIN(x); \ + EXTEND_MAX(x); + + EXTEND(trap->left.p1.x); + EXTEND(trap->left.p2.x); + EXTEND(trap->right.p1.x); + EXTEND(trap->right.p2.x); + } + + if (box.x1 >= box.x2 || box.y1 >= box.y2) + return; + + tmp = pixman_image_create_bits ( + mask_format, box.x2 - box.x1, box.y2 - box.y1, NULL, -1); + + for (i = 0; i < n_traps; ++i) + { + const pixman_trapezoid_t *trap = &(traps[i]); + + if (!pixman_trapezoid_valid (trap)) + continue; + + pixman_rasterize_trapezoid (tmp, trap, - box.x1, - box.y1); + } + + x_rel = box.x1 + x_src - x_dst; + y_rel = box.y1 + y_src - y_dst; + + pixman_image_composite (op, src, tmp, dst, + x_rel, y_rel, 0, 0, box.x1, box.y1, + box.x2 - box.x1, box.y2 - box.y1); + + pixman_image_unref (tmp); + } +} + +static int +greater_y (const pixman_point_fixed_t *a, const pixman_point_fixed_t *b) +{ + if (a->y == b->y) + return a->x > b->x; + return a->y > b->y; +} + +/* + * Note that the definition of this function is a bit odd because + * of the X coordinate space (y increasing downwards). + */ +static int +clockwise (const pixman_point_fixed_t *ref, + const pixman_point_fixed_t *a, + const pixman_point_fixed_t *b) +{ + pixman_point_fixed_t ad, bd; + + ad.x = a->x - ref->x; + ad.y = a->y - ref->y; + bd.x = b->x - ref->x; + bd.y = b->y - ref->y; + + return ((pixman_fixed_32_32_t) bd.y * ad.x - + (pixman_fixed_32_32_t) ad.y * bd.x) < 0; +} + +static void +triangle_to_trapezoids (const pixman_triangle_t *tri, pixman_trapezoid_t *traps) +{ + const pixman_point_fixed_t *top, *left, *right, *tmp; + + top = &tri->p1; + left = &tri->p2; + right = &tri->p3; + + if (greater_y (top, left)) + { + tmp = left; + left = top; + top = tmp; + } + + if (greater_y (top, right)) + { + tmp = right; + right = top; + top = tmp; + } + + if (clockwise (top, right, left)) + { + tmp = right; + right = left; + left = tmp; + } + + /* + * Two cases: + * + * + + + * / \ / \ + * / \ / \ + * / + + \ + * / -- -- \ + * / -- -- \ + * / --- --- \ + * +-- --+ + */ + + traps->top = top->y; + traps->left.p1 = *top; + traps->left.p2 = *left; + traps->right.p1 = *top; + traps->right.p2 = *right; + + if (right->y < left->y) + traps->bottom = right->y; + else + traps->bottom = left->y; + + traps++; + + *traps = *(traps - 1); + + if (right->y < left->y) + { + traps->top = right->y; + traps->bottom = left->y; + traps->right.p1 = *right; + traps->right.p2 = *left; + } + else + { + traps->top = left->y; + traps->bottom = right->y; + traps->left.p1 = *left; + traps->left.p2 = *right; + } +} + +static pixman_trapezoid_t * +convert_triangles (int n_tris, const pixman_triangle_t *tris) +{ + pixman_trapezoid_t *traps; + int i; + + if (n_tris <= 0) + return NULL; + + traps = pixman_malloc_ab (n_tris, 2 * sizeof (pixman_trapezoid_t)); + if (!traps) + return NULL; + + for (i = 0; i < n_tris; ++i) + triangle_to_trapezoids (&(tris[i]), traps + 2 * i); + + return traps; +} + +PIXMAN_EXPORT void +pixman_composite_triangles (pixman_op_t op, + pixman_image_t * src, + pixman_image_t * dst, + pixman_format_code_t mask_format, + int x_src, + int y_src, + int x_dst, + int y_dst, + int n_tris, + const pixman_triangle_t * tris) +{ + pixman_trapezoid_t *traps; + + if ((traps = convert_triangles (n_tris, tris))) + { + pixman_composite_trapezoids (op, src, dst, mask_format, + x_src, y_src, x_dst, y_dst, + n_tris * 2, traps); + + free (traps); + } +} + +PIXMAN_EXPORT void +pixman_add_triangles (pixman_image_t *image, + int32_t x_off, + int32_t y_off, + int n_tris, + const pixman_triangle_t *tris) +{ + pixman_trapezoid_t *traps; + + if ((traps = convert_triangles (n_tris, tris))) + { + pixman_add_trapezoids (image, x_off, y_off, + n_tris * 2, traps); + + free (traps); + } +} diff --git a/pixman/pixman/pixman.h b/pixman/pixman/pixman.h index 27eeeee4e..855575a30 100644 --- a/pixman/pixman/pixman.h +++ b/pixman/pixman/pixman.h @@ -868,6 +868,7 @@ typedef struct pixman_edge pixman_edge_t; typedef struct pixman_trapezoid pixman_trapezoid_t; typedef struct pixman_trap pixman_trap_t; typedef struct pixman_span_fix pixman_span_fix_t; +typedef struct pixman_triangle pixman_triangle_t; /* * An edge structure. This represents a single polygon edge @@ -895,6 +896,10 @@ struct pixman_trapezoid pixman_line_fixed_t left, right; }; +struct pixman_triangle +{ + pixman_point_fixed_t p1, p2, p3; +}; /* whether 't' is a well defined not obviously empty trapezoid */ #define pixman_trapezoid_valid(t) \ @@ -950,6 +955,31 @@ void pixman_rasterize_trapezoid (pixman_image_t *image, const pixman_trapezoid_t *trap, int x_off, int y_off); +void pixman_composite_trapezoids (pixman_op_t op, + pixman_image_t * src, + pixman_image_t * dst, + pixman_format_code_t mask_format, + int x_src, + int y_src, + int x_dst, + int y_dst, + int n_traps, + const pixman_trapezoid_t * traps); +void pixman_composite_triangles (pixman_op_t op, + pixman_image_t * src, + pixman_image_t * dst, + pixman_format_code_t mask_format, + int x_src, + int y_src, + int x_dst, + int y_dst, + int n_tris, + const pixman_triangle_t * tris); +void pixman_add_triangles (pixman_image_t *image, + int32_t x_off, + int32_t y_off, + int n_tris, + const pixman_triangle_t *tris); PIXMAN_END_DECLS diff --git a/pixman/test/Makefile.am b/pixman/test/Makefile.am index 3ce466eec..f05b99918 100644 --- a/pixman/test/Makefile.am +++ b/pixman/test/Makefile.am @@ -1,44 +1,46 @@ -AM_CFLAGS = @OPENMP_CFLAGS@ -AM_LDFLAGS = @OPENMP_CFLAGS@ @TESTPROGS_EXTRA_LDFLAGS@ -LDADD = $(top_builddir)/pixman/libpixman-1.la -lm -INCLUDES = -I$(top_srcdir)/pixman -I$(top_builddir)/pixman - -TESTPROGRAMS = \ - a1-trap-test \ - pdf-op-test \ - region-test \ - region-translate-test \ - fetch-test \ - oob-test \ - trap-crasher \ - alpha-loop \ - scaling-crash-test \ - gradient-crash-test \ - alphamap \ - stress-test \ - blitters-test \ - scaling-test \ - affine-test \ - composite - -pdf_op_test_SOURCES = pdf-op-test.c utils.c utils.h -region_test_SOURCES = region-test.c utils.c utils.h -blitters_test_SOURCES = blitters-test.c utils.c utils.h -scaling_test_SOURCES = scaling-test.c utils.c utils.h -affine_test_SOURCES = affine-test.c utils.c utils.h -alphamap_SOURCES = alphamap.c utils.c utils.h -alpha_loop_SOURCES = alpha-loop.c utils.c utils.h -composite_SOURCES = composite.c utils.c utils.h -gradient_crash_test_SOURCES = gradient-crash-test.c utils.c utils.h -stress_test_SOURCES = stress-test.c utils.c utils.h - -# Benchmarks - -BENCHMARKS = \ - lowlevel-blt-bench - -lowlevel_blt_bench_SOURCES = lowlevel-blt-bench.c utils.c utils.h - -noinst_PROGRAMS = $(TESTPROGRAMS) $(BENCHMARKS) - -TESTS = $(TESTPROGRAMS) +AM_CFLAGS = @OPENMP_CFLAGS@ +AM_LDFLAGS = @OPENMP_CFLAGS@ @TESTPROGS_EXTRA_LDFLAGS@ +LDADD = $(top_builddir)/pixman/libpixman-1.la -lm +INCLUDES = -I$(top_srcdir)/pixman -I$(top_builddir)/pixman + +TESTPROGRAMS = \ + a1-trap-test \ + pdf-op-test \ + region-test \ + region-translate-test \ + fetch-test \ + oob-test \ + trap-crasher \ + alpha-loop \ + scaling-crash-test \ + gradient-crash-test \ + alphamap \ + stress-test \ + composite-traps-test \ + blitters-test \ + scaling-test \ + affine-test \ + composite + +pdf_op_test_SOURCES = pdf-op-test.c utils.c utils.h +region_test_SOURCES = region-test.c utils.c utils.h +blitters_test_SOURCES = blitters-test.c utils.c utils.h +composite_traps_test_SOURCES = composite-traps-test.c utils.c utils.h +scaling_test_SOURCES = scaling-test.c utils.c utils.h +affine_test_SOURCES = affine-test.c utils.c utils.h +alphamap_SOURCES = alphamap.c utils.c utils.h +alpha_loop_SOURCES = alpha-loop.c utils.c utils.h +composite_SOURCES = composite.c utils.c utils.h +gradient_crash_test_SOURCES = gradient-crash-test.c utils.c utils.h +stress_test_SOURCES = stress-test.c utils.c utils.h + +# Benchmarks + +BENCHMARKS = \ + lowlevel-blt-bench + +lowlevel_blt_bench_SOURCES = lowlevel-blt-bench.c utils.c utils.h + +noinst_PROGRAMS = $(TESTPROGRAMS) $(BENCHMARKS) + +TESTS = $(TESTPROGRAMS) diff --git a/pixman/test/composite-traps-test.c b/pixman/test/composite-traps-test.c new file mode 100644 index 000000000..c601d8135 --- /dev/null +++ b/pixman/test/composite-traps-test.c @@ -0,0 +1,253 @@ +/* Based loosely on scaling-test */ + +#include +#include +#include +#include "utils.h" + +#define MAX_SRC_WIDTH 48 +#define MAX_SRC_HEIGHT 48 +#define MAX_DST_WIDTH 48 +#define MAX_DST_HEIGHT 48 +#define MAX_STRIDE 4 + +static pixman_format_code_t formats[] = +{ + PIXMAN_a8r8g8b8, PIXMAN_a8, PIXMAN_r5g6b5, PIXMAN_a1, PIXMAN_a4 +}; + +static pixman_format_code_t mask_formats[] = +{ + PIXMAN_a1, PIXMAN_a4, PIXMAN_a8, +}; + +static pixman_op_t operators[] = +{ + PIXMAN_OP_OVER, PIXMAN_OP_ADD, PIXMAN_OP_SRC, PIXMAN_OP_IN +}; + +#define RANDOM_ELT(array) \ + ((array)[lcg_rand_n(ARRAY_LENGTH((array)))]) + +static void +destroy_bits (pixman_image_t *image, void *data) +{ + fence_free (data); +} + +static pixman_fixed_t +random_fixed (int n) +{ + return lcg_rand_N (n << 16); +} + +/* + * 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_region16_t clip; + int dst_width, dst_height; + int dst_stride; + int dst_x, dst_y; + int dst_bpp; + pixman_op_t op; + uint32_t * dst_bits; + uint32_t crc32; + pixman_format_code_t mask_format, dst_format; + pixman_trapezoid_t *traps; + int src_x, src_y; + int n_traps; + + static pixman_color_t colors[] = + { + { 0xffff, 0xffff, 0xffff, 0xffff }, + { 0x0000, 0x0000, 0x0000, 0x0000 }, + { 0xabcd, 0xabcd, 0x0000, 0xabcd }, + { 0x0000, 0x0000, 0x0000, 0xffff }, + { 0x0101, 0x0101, 0x0101, 0x0101 }, + { 0x7777, 0x6666, 0x5555, 0x9999 }, + }; + + FLOAT_REGS_CORRUPTION_DETECTOR_START (); + + lcg_srand (testnum); + + op = RANDOM_ELT (operators); + mask_format = RANDOM_ELT (mask_formats); + + /* Create source image */ + + if (lcg_rand_n (4) == 0) + { + src_img = pixman_image_create_solid_fill ( + &(colors[lcg_rand_n (ARRAY_LENGTH (colors))])); + + src_x = 10; + src_y = 234; + } + else + { + pixman_format_code_t src_format = RANDOM_ELT(formats); + int src_bpp = (PIXMAN_FORMAT_BPP (src_format) + 7) / 8; + int src_width = lcg_rand_n (MAX_SRC_WIDTH) + 1; + int src_height = lcg_rand_n (MAX_SRC_HEIGHT) + 1; + int src_stride = src_width * src_bpp + lcg_rand_n (MAX_STRIDE) * src_bpp; + uint32_t *bits; + + src_x = -(src_width / 4) + lcg_rand_n (src_width * 3 / 2); + src_y = -(src_height / 4) + lcg_rand_n (src_height * 3 / 2); + + src_stride = (src_stride + 3) & ~3; + + bits = (uint32_t *)make_random_bytes (src_stride * src_height); + + src_img = pixman_image_create_bits ( + src_format, src_width, src_height, bits, src_stride); + + pixman_image_set_destroy_function (src_img, destroy_bits, bits); + + 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); + } + } + + /* Create destination image */ + { + dst_format = RANDOM_ELT(formats); + dst_bpp = (PIXMAN_FORMAT_BPP (dst_format) + 7) / 8; + dst_width = lcg_rand_n (MAX_DST_WIDTH) + 1; + dst_height = lcg_rand_n (MAX_DST_HEIGHT) + 1; + dst_stride = dst_width * dst_bpp + lcg_rand_n (MAX_STRIDE) * dst_bpp; + dst_stride = (dst_stride + 3) & ~3; + + dst_bits = (uint32_t *)make_random_bytes (dst_stride * dst_height); + + dst_x = -(dst_width / 4) + lcg_rand_n (dst_width * 3 / 2); + dst_y = -(dst_height / 4) + lcg_rand_n (dst_height * 3 / 2); + + dst_img = pixman_image_create_bits ( + dst_format, dst_width, dst_height, dst_bits, dst_stride); + } + + /* Create traps */ + { + int i; + + n_traps = lcg_rand_n (25); + traps = fence_malloc (n_traps * sizeof (pixman_trapezoid_t)); + + for (i = 0; i < n_traps; ++i) + { + pixman_trapezoid_t *t = &(traps[i]); + + t->top = random_fixed (MAX_DST_HEIGHT) - MAX_DST_HEIGHT / 2; + t->bottom = t->top + random_fixed (MAX_DST_HEIGHT); + t->left.p1.x = random_fixed (MAX_DST_WIDTH) - MAX_DST_WIDTH / 2; + t->left.p1.y = t->top - random_fixed (50); + t->left.p2.x = random_fixed (MAX_DST_WIDTH) - MAX_DST_WIDTH / 2; + t->left.p2.y = t->bottom + random_fixed (50); + t->right.p1.x = t->left.p1.x + random_fixed (MAX_DST_WIDTH); + t->right.p1.y = t->top - random_fixed (50); + t->right.p2.x = t->left.p2.x + random_fixed (MAX_DST_WIDTH); + t->right.p2.y = t->bottom - random_fixed (50); + } + } + + 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_composite_trapezoids (op, src_img, dst_img, mask_format, + src_x, src_y, dst_x, dst_y, n_traps, traps); + + if (dst_format == PIXMAN_x8r8g8b8) + { + /* ignore unused part */ + for (i = 0; i < dst_stride * dst_height / 4; i++) + dst_bits[i] &= 0xFFFFFF; + } + + image_endian_swap (dst_img, dst_bpp * 8); + + if (verbose) + { + int j; + + for (i = 0; i < dst_height; i++) + { + for (j = 0; j < dst_stride; j++) + printf ("%02X ", *((uint8_t *)dst_bits + i * dst_stride + j)); + + printf ("\n"); + } + } + + crc32 = compute_crc32 (0, dst_bits, dst_stride * dst_height); + + fence_free (dst_bits); + + pixman_image_unref (src_img); + pixman_image_unref (dst_img); + fence_free (traps); + + FLOAT_REGS_CORRUPTION_DETECTOR_FINISH (); + return crc32; +} + +int +main (int argc, const char *argv[]) +{ + return fuzzer_test_main("composite traps", 40000, 0xA34F95C7, + test_composite, argc, argv); +} diff --git a/xorg-server/Xi/xiproperty.c b/xorg-server/Xi/xiproperty.c index 11739f9ae..c1a25bbf7 100644 --- a/xorg-server/Xi/xiproperty.c +++ b/xorg-server/Xi/xiproperty.c @@ -701,7 +701,7 @@ XIDeleteDeviceProperty (DeviceIntPtr device, Atom property, Bool fromClient) int XIChangeDeviceProperty (DeviceIntPtr dev, Atom property, Atom type, int format, int mode, unsigned long len, - pointer value, Bool sendevent) + const pointer value, Bool sendevent) { XIPropertyPtr prop; int size_in_bytes; diff --git a/xorg-server/Xi/xiquerypointer.c b/xorg-server/Xi/xiquerypointer.c index 0c6079d23..2dc057d67 100644 --- a/xorg-server/Xi/xiquerypointer.c +++ b/xorg-server/Xi/xiquerypointer.c @@ -129,7 +129,7 @@ ProcXIQueryPointer(ClientPtr client) if (kbd) { - state = &kbd->key->xkbInfo->prev_state; + state = &kbd->key->xkbInfo->state; rep.mods.base_mods = state->base_mods; rep.mods.latched_mods = state->latched_mods; rep.mods.locked_mods = state->locked_mods; diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac index 9b3e2be2b..21b2a28f4 100644 --- a/xorg-server/configure.ac +++ b/xorg-server/configure.ac @@ -1,2278 +1,2278 @@ -dnl Copyright © 2003-2007 Keith Packard, Daniel Stone -dnl -dnl Permission is hereby granted, free of charge, to any person obtaining a -dnl copy of this software and associated documentation files (the "Software"), -dnl to deal in the Software without restriction, including without limitation -dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, -dnl and/or sell copies of the Software, and to permit persons to whom the -dnl Software is furnished to do so, subject to the following conditions: -dnl -dnl The above copyright notice and this permission notice (including the next -dnl paragraph) shall be included in all copies or substantial portions of the -dnl Software. -dnl -dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -dnl DEALINGS IN THE SOFTWARE. -dnl -dnl Authors: Keith Packard -dnl Daniel Stone -dnl an unwitting cast of miscellaneous others -dnl -dnl Process this file with autoconf to create configure. - -AC_PREREQ(2.57) -AC_INIT([xorg-server], 1.9.99.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2010-12-06" -AC_CONFIG_SRCDIR([Makefile.am]) -AM_INIT_AUTOMAKE([foreign dist-bzip2]) -AM_MAINTAINER_MODE - -# Require xorg-macros minimum of 1.10 for XORG_CHECK_SGML_DOCTOOLS -m4_ifndef([XORG_MACROS_VERSION], - [m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])]) -XORG_MACROS_VERSION(1.10) -XORG_DEFAULT_OPTIONS -XORG_WITH_DOXYGEN(1.6.1) -XORG_CHECK_SGML_DOCTOOLS(1.5) - -m4_ifndef([XORG_FONT_MACROS_VERSION], [m4_fatal([must install fontutil 1.1 or later before running autoconf/autogen])]) -XORG_FONT_MACROS_VERSION(1.1) - -dnl this gets generated by autoheader, and thus contains all the defines. we -dnl don't ever actually use it, internally. -AC_CONFIG_HEADERS(include/do-not-use-config.h) -dnl xorg-server.h is an external header, designed to be included by loadable -dnl drivers. -AC_CONFIG_HEADERS(include/xorg-server.h) -dnl dix-config.h covers most of the DIX (i.e. everything but the DDX, not just -dnl dix/). -AC_CONFIG_HEADERS(include/dix-config.h) -dnl xorg-config.h covers the Xorg DDX. -AC_CONFIG_HEADERS(include/xorg-config.h) -dnl xkb-config.h covers XKB for the Xorg and Xnest DDXs. -AC_CONFIG_HEADERS(include/xkb-config.h) -dnl xwin-config.h covers the XWin DDX. -AC_CONFIG_HEADERS(include/xwin-config.h) -dnl kdrive-config.h covers the kdrive DDX -AC_CONFIG_HEADERS(include/kdrive-config.h) -dnl version-config.h covers the version numbers so they can be bumped without -dnl forcing an entire recompile.x -AC_CONFIG_HEADERS(include/version-config.h) - -AM_PROG_AS -AC_PROG_LN_S -AC_LIBTOOL_WIN32_DLL -AC_DISABLE_STATIC -AC_PROG_LIBTOOL -AC_PROG_MAKE_SET -PKG_PROG_PKG_CONFIG -AC_PROG_LEX -AC_PROG_YACC -AC_SYS_LARGEFILE -XORG_PROG_RAWCPP - -# Quoted so that make will expand $(CWARNFLAGS) in makefiles to allow -# easier overrides at build time. -XSERVER_CFLAGS='$(CWARNFLAGS)' - -dnl Check for dtrace program (needed to build Xserver dtrace probes) -dnl Also checks for , since some Linux distros have an -dnl ISDN trace program named dtrace -AC_ARG_WITH(dtrace, AS_HELP_STRING([--with-dtrace=PATH], - [Enable dtrace probes (default: enabled if dtrace found)]), - [WDTRACE=$withval], [WDTRACE=auto]) -if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then - AC_PATH_PROG(DTRACE, [dtrace], [not_found], [$PATH:/usr/sbin]) - if test "x$DTRACE" = "xnot_found" ; then - if test "x$WDTRACE" = "xyes" ; then - AC_MSG_FAILURE([dtrace requested but not found]) - fi - WDTRACE="no" - else - AC_CHECK_HEADER(sys/sdt.h, [HAS_SDT_H="yes"], [HAS_SDT_H="no"]) - if test "x$WDTRACE" = "xauto" -a "x$HAS_SDT_H" = "xno" ; then - WDTRACE="no" - fi - fi -fi -if test "x$WDTRACE" != "xno" ; then - AC_DEFINE(XSERVER_DTRACE, 1, - [Define to 1 if the DTrace Xserver provider probes should be built in.]) - -# Solaris/OpenSolaris require dtrace -G to build dtrace probe information into -# object files, and require linking with those as relocatable objects, not .a -# archives. MacOS X handles all this in the normal compiler toolchain, and on -# some releases (like Tiger), will error out on dtrace -G. For now, other -# platforms with Dtrace ports are assumed to support -G (the FreeBSD and Linux -# ports appear to, based on my web searches, but have not yet been tested). - case $host_os in - darwin*) SPECIAL_DTRACE_OBJECTS=no ;; - *) SPECIAL_DTRACE_OBJECTS=yes ;; - esac -fi -AM_CONDITIONAL(XSERVER_DTRACE, [test "x$WDTRACE" != "xno"]) -AM_CONDITIONAL(SPECIAL_DTRACE_OBJECTS, [test "x$SPECIAL_DTRACE_OBJECTS" = "xyes"]) - -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h dlfcn.h stropts.h fnmatch.h sys/utsname.h]) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_C_BIGENDIAN([ENDIAN="X_BIG_ENDIAN"], [ENDIAN="X_LITTLE_ENDIAN"]) - -AC_CHECK_SIZEOF([unsigned long]) -if test "$ac_cv_sizeof_unsigned_long" = 8; then - AC_DEFINE(_XSERVER64, 1, [Define to 1 if unsigned long is 64 bits.]) -fi - -AC_TYPE_PID_T - -# Checks for headers/macros for byte swapping -# Known variants: -# bswap_16, bswap_32, bswap_64 (glibc) -# __swap16, __swap32, __swap64 (OpenBSD) -# bswap16, bswap32, bswap64 (other BSD's) -# and a fallback to local macros if none of the above are found - -# if is found, assume it's the correct version -AC_CHECK_HEADERS([byteswap.h]) - -# if is found, have to check which version -AC_CHECK_HEADER([sys/endian.h], [HAVE_SYS_ENDIAN_H="yes"], [HAVE_SYS_ENDIAN_H="no"]) - -if test "x$HAVE_SYS_ENDIAN_H" = "xyes" ; then - AC_MSG_CHECKING([for __swap16 variant of byteswapping macros]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([ -#include -#include - ], [ -int a = 1, b; -b = __swap16(a); - ]) -], [SYS_ENDIAN__SWAP='yes'], [SYS_ENDIAN__SWAP='no']) - AC_MSG_RESULT([$SYS_ENDIAN__SWAP]) - - AC_MSG_CHECKING([for bswap16 variant of byteswapping macros]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([ -#include -#include - ], [ -int a = 1, b; -b = bswap16(a); - ]) -], [SYS_ENDIAN_BSWAP='yes'], [SYS_ENDIAN_BSWAP='no']) - AC_MSG_RESULT([$SYS_ENDIAN_BSWAP]) - - if test "$SYS_ENDIAN_BSWAP" = "yes" ; then - USE_SYS_ENDIAN_H=yes - BSWAP=bswap - else - if test "$SYS_ENDIAN__SWAP" = "yes" ; then - USE_SYS_ENDIAN_H=yes - BSWAP=__swap - else - USE_SYS_ENDIAN_H=no - fi - fi - - if test "$USE_SYS_ENDIAN_H" = "yes" ; then - AC_DEFINE([USE_SYS_ENDIAN_H], 1, - [Define to use byteswap macros from ]) - AC_DEFINE_UNQUOTED([bswap_16], ${BSWAP}16, - [Define to 16-bit byteswap macro]) - AC_DEFINE_UNQUOTED([bswap_32], ${BSWAP}32, - [Define to 32-bit byteswap macro]) - AC_DEFINE_UNQUOTED([bswap_64], ${BSWAP}64, - [Define to 64-bit byteswap macro]) - fi -fi - -dnl Check to see if dlopen is in default libraries (like Solaris, which -dnl has it in libc), or if libdl is needed to get it. -AC_CHECK_FUNC([dlopen], [], - AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl")) -AC_SUBST(DLOPEN_LIBS) - -dnl Checks for library functions. -AC_FUNC_VPRINTF -AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \ - strtol getopt getopt_long vsnprintf walkcontext backtrace \ - getisax getzoneid shmctl64 strcasestr ffs vasprintf]) -AC_FUNC_ALLOCA -dnl Old HAS_* names used in os/*.c. -AC_CHECK_FUNC([getdtablesize], - AC_DEFINE(HAS_GETDTABLESIZE, 1, [Have the 'getdtablesize' function.])) -AC_CHECK_FUNC([getifaddrs], - AC_DEFINE(HAS_GETIFADDRS, 1, [Have the 'getifaddrs' function.])) -AC_CHECK_FUNC([getpeereid], - AC_DEFINE(HAS_GETPEEREID, 1, [Have the 'getpeereid' function.])) -AC_CHECK_FUNC([getpeerucred], - AC_DEFINE(HAS_GETPEERUCRED, 1, [Have the 'getpeerucred' function.])) -AC_CHECK_FUNC([strlcat], HAVE_STRLCAT=yes, HAVE_STRLCAT=no) -AM_CONDITIONAL(NEED_STRLCAT, [test x$HAVE_STRLCAT = xno]) -AC_CHECK_FUNC([strlcpy], AC_DEFINE(HAS_STRLCPY, 1, [Have the 'strlcpy' function])) - -AM_CONDITIONAL(NEED_VSNPRINTF, [test x$HAVE_VSNPRINTF = xno]) - -dnl Check for mmap support for Xvfb -AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP, 1, [Have the 'mmap' function.])) - -dnl Find the math libary -AC_CHECK_LIB(m, sqrt) -AC_CHECK_LIB(m, cbrt, AC_DEFINE(HAVE_CBRT, 1, [Have the 'cbrt' function])) - -AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h]) - -dnl AGPGART headers -AC_CHECK_HEADERS([linux/agpgart.h sys/agpio.h sys/agpgart.h], AGP=yes) -AM_CONDITIONAL(AGP, [test "x$AGP" = xyes]) - -dnl APM header -AC_CHECK_HEADERS([linux/apm_bios.h], LNXAPM=yes) -AM_CONDITIONAL(LNXAPM, [test "x$LNXAPM" = xyes]) - -dnl fbdev header -AC_CHECK_HEADERS([linux/fb.h], FBDEV=yes) -AM_CONDITIONAL(FBDEVHW, [test "x$FBDEV" = xyes]) - -dnl MTRR header -AC_CHECK_HEADERS([asm/mtrr.h], ac_cv_asm_mtrr_h=yes) -if test "x$ac_cv_asm_mtrr_h" = xyes; then - HAVE_MTRR=yes -fi - -dnl BSD MTRR header -AC_CHECK_HEADERS([sys/memrange.h], ac_cv_memrange_h=yes) -if test "x$ac_cv_memrange_h" = xyes; then - HAVE_MTRR=yes -fi - -if test "x$HAVE_MTRR" = xyes; then - AC_DEFINE(HAS_MTRR_SUPPORT, 1, [MTRR support available]) -fi - -dnl A NetBSD MTRR header -AC_CHECK_HEADERS([machine/mtrr.h], ac_cv_machine_mtrr_h=yes) -if test "x$ac_cv_machine_mtrr_h" = xyes; then - AC_DEFINE(HAS_MTRR_BUILTIN, 1, [Define to 1 if NetBSD built-in MTRR - support is available]) -fi - -dnl FreeBSD kldload support (sys/linker.h) -AC_CHECK_HEADERS([sys/linker.h], - [ac_cv_sys_linker_h=yes], - [ac_cv_sys_linker_h=no], - [#include ]) -AM_CONDITIONAL(FREEBSD_KLDLOAD, [test "x$ac_cv_sys_linker_h" = xyes]) - -AC_CACHE_CHECK([for SYSV IPC], - ac_cv_sysv_ipc, - [AC_TRY_LINK([ -#include -#include -#include -],[ -{ - int id; - id = shmget(IPC_PRIVATE, 512, SHM_W | SHM_R); - if (id < 0) return -1; - return shmctl(id, IPC_RMID, 0); -}], - [ac_cv_sysv_ipc=yes], - [ac_cv_sysv_ipc=no])]) -if test "x$ac_cv_sysv_ipc" = xyes; then - AC_DEFINE(HAVE_SYSV_IPC, 1, [Define to 1 if SYSV IPC is available]) -fi - -dnl OpenBSD /dev/xf86 aperture driver -if test -c /dev/xf86 ; then - AC_DEFINE(HAS_APERTURE_DRV, 1, [System has /dev/xf86 aperture driver]) -fi - -dnl BSD APM support -AC_CHECK_HEADER([machine/apmvar.h],[ - AC_CHECK_HEADER([sys/event.h], - ac_cv_BSD_KQUEUE_APM=yes, - ac_cv_BSD_APM=yes)]) - -AM_CONDITIONAL(BSD_APM, [test "x$ac_cv_BSD_APM" = xyes]) -AM_CONDITIONAL(BSD_KQUEUE_APM, [test "x$ac_cv_BSD_KQUEUE_APM" = xyes]) - -dnl glibc backtrace support check (hw/xfree86/common/xf86Events.c) -AC_CHECK_HEADER([execinfo.h],[ - AC_CHECK_LIB(c, backtrace, [ - AC_DEFINE(HAVE_BACKTRACE, 1, [Has backtrace support]) - AC_DEFINE(HAVE_EXECINFO_H, 1, [Have execinfo.h]) - ])] -) - -dnl ARM needs additional compiler flags for proper backtraces if GCC is -dnl used. Compile a dummy program with the -mapcs-frame option. If it -dnl succeeds, we know that we are building for ARM with GCC. -old_CFLAGS="$CFLAGS" -CFLAGS="-mapcs-frame" -AC_COMPILE_IFELSE( - AC_LANG_PROGRAM([[ ]]), - ARM_BACKTRACE_CFLAGS="$CFLAGS", - ARM_BACKTRACE_CFLAGS="" -) -CFLAGS="$old_CFLAGS" -AC_SUBST(ARM_BACKTRACE_CFLAGS) - -dnl --------------------------------------------------------------------------- -dnl Bus options and CPU capabilities. Replaces logic in -dnl hw/xfree86/os-support/bus/Makefile.am, among others. -dnl --------------------------------------------------------------------------- -DEFAULT_INT10="x86emu" - -dnl Override defaults as needed for specific platforms: - -case $host_cpu in - alpha*) - ALPHA_VIDEO=yes - case $host_os in - *freebsd*) SYS_LIBS=-lio ;; - *netbsd*) AC_DEFINE(USE_ALPHA_PIO, 1, [NetBSD PIO alpha IO]) ;; - esac - GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee" - ;; - arm*) - ARM_VIDEO=yes - ;; - i*86) - I386_VIDEO=yes - case $host_os in - *freebsd*) AC_DEFINE(USE_DEV_IO) ;; - *dragonfly*) AC_DEFINE(USE_DEV_IO) ;; - *netbsd*) AC_DEFINE(USE_I386_IOPL) - SYS_LIBS=-li386 - ;; - *openbsd*) AC_DEFINE(USE_I386_IOPL) - SYS_LIBS=-li386 - ;; - esac - ;; - powerpc*) - PPC_VIDEO=yes - case $host_os in - *freebsd*) DEFAULT_INT10=stub ;; - esac - ;; - sparc*) - SPARC64_VIDEO=yes - BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c" - GLX_ARCH_DEFINES="-D__GLX_ALIGN64" - ;; - x86_64*|amd64*) - I386_VIDEO=yes - case $host_os in - *freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;; - *dragonfly*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;; - *netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl]) - SYS_LIBS=-lx86_64 - ;; - *openbsd*) AC_DEFINE(USE_AMD64_IOPL, 1, [BSD AMD64 iopl]) - SYS_LIBS=-lamd64 - ;; - esac - GLX_ARCH_DEFINES="-D__GLX_ALIGN64" - ;; - ia64*) - GLX_ARCH_DEFINES="-D__GLX_ALIGN64" - ;; - s390*) - GLX_ARCH_DEFINES="-D__GLX_ALIGN64" - ;; -esac -AC_SUBST(GLX_ARCH_DEFINES) - -dnl BSD *_video.c selection -AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" = xyes]) -AM_CONDITIONAL(ARM_VIDEO, [test "x$ARM_VIDEO" = xyes]) -AM_CONDITIONAL(I386_VIDEO, [test "x$I386_VIDEO" = xyes]) -AM_CONDITIONAL(PPC_VIDEO, [test "x$PPC_VIDEO" = xyes]) -AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" = xyes]) - -DRI=no -USE_SIGIO_BY_DEFAULT="yes" -dnl it would be nice to autodetect these *CONS_SUPPORTs -case $host_os in - *freebsd* | *dragonfly*) - case $host_os in - kfreebsd*-gnu) ;; - *) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) ;; - esac - AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console]) - AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console]) - AC_DEFINE(SYSCONS_SUPPORT, 1, [System has syscons console]) - DRI=yes - ;; - *netbsd*) - AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) - AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console]) - AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console]) - AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console]) - DRI=yes - ;; - *openbsd*) - AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) - AC_DEFINE(PCVT_SUPPORT, 1, [System has PC console]) - AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console]) - ;; - *linux*) - DRI=yes - ;; - *solaris*) - PKG_CHECK_EXISTS(libdrm, DRI=yes, DRI=no) - # Disable use of SIGIO by default until some system bugs are - # fixed - see Sun/OpenSolaris bug id 6879897 - USE_SIGIO_BY_DEFAULT="no" - ;; - darwin*) - AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) - ;; - cygwin*) - CFLAGS="$CFLAGS -DFD_SETSIZE=256" - ;; -esac - -dnl augment XORG_RELEASE_VERSION for our snapshot number and to expose the -dnl major number -PVMAJOR=`echo $PACKAGE_VERSION | cut -d . -f 1` -PVS=`echo $PACKAGE_VERSION | cut -d . -f 4 | cut -d - -f 1` -if test "x$PVS" = "x"; then - PVS="0" -fi - -VENDOR_RELEASE="((($PVMAJOR) * 10000000) + (($PVM) * 100000) + (($PVP) * 1000) + $PVS)" -VENDOR_MAN_VERSION="Version ${PACKAGE_VERSION}" - -VENDOR_NAME="The X.Org Foundation" -VENDOR_NAME_SHORT="X.Org" -VENDOR_WEB="http://wiki.x.org" - -m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))]) - -dnl Build options. -AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror], - [Obsolete - use --enable-strict-compilation instead]), - AC_MSG_ERROR([--enable-werror has been replaced by --enable-strict-compilation])) - -AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], - [Enable debugging (default: disabled)]), - [DEBUGGING=$enableval], [DEBUGGING=no]) -AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests], - [Enable unit-tests (default: auto)]), - [UNITTESTS=$enableval], [UNITTESTS=auto]) -AC_ARG_ENABLE(use-sigio-by-default, AS_HELP_STRING([--enable-use-sigio-by-default] - [Enable SIGIO input handlers by default (default: $USE_SIGIO_BY_DEFAULT)]), - [USE_SIGIO_BY_DEFAULT=$enableval], []) -AC_ARG_WITH(int10, AS_HELP_STRING([--with-int10=BACKEND], [int10 backend: vm86, x86emu or stub]), - [INT10="$withval"], - [INT10="$DEFAULT_INT10"]) -AC_ARG_WITH(vendor-name, AS_HELP_STRING([--with-vendor-name=VENDOR], - [Vendor string reported by the server]), - [ VENDOR_NAME="$withval" ], []) -AC_ARG_WITH(vendor-name-short, AS_HELP_STRING([--with-vendor-name-short=VENDOR], - [Short version of vendor string reported by the server]), - [ VENDOR_NAME_SHORT="$withval" ], []) -AC_ARG_WITH(vendor-web, AS_HELP_STRING([--with-vendor-web=URL], - [Vendor web address reported by the server]), - [ VENDOR_WEB="$withval" ], []) -AC_ARG_WITH(module-dir, AS_HELP_STRING([--with-module-dir=DIR], - [Directory where modules are installed (default: $libdir/xorg/modules)]), - [ moduledir="$withval" ], - [ moduledir="${libdir}/xorg/modules" ]) -AC_ARG_WITH(log-dir, AS_HELP_STRING([--with-log-dir=DIR], - [Directory where log files are kept (default: $localstatedir/log)]), - [ logdir="$withval" ], - [ logdir="$localstatedir/log" ]) -AC_ARG_WITH(builder-addr, AS_HELP_STRING([--with-builder-addr=ADDRESS], - [Builder address (default: xorg@lists.freedesktop.org)]), - [ BUILDERADDR="$withval" ], - [ BUILDERADDR="xorg@lists.freedesktop.org" ]) -AC_ARG_WITH(os-name, AS_HELP_STRING([--with-os-name=OSNAME], [Name of OS (default: output of "uname -srm")]), - [ OSNAME="$withval" ], - [ OSNAME=`uname -srm` ]) -AC_ARG_WITH(os-vendor, AS_HELP_STRING([--with-os-vendor=OSVENDOR], [Name of OS vendor]), - [ OSVENDOR="$withval" ], - [ OSVENDOR="" ]) -AC_ARG_WITH(builderstring, AS_HELP_STRING([--with-builderstring=BUILDERSTRING], [Additional builder string]), - [ BUILDERSTRING="$withval" ] - [ ]) - -dnl Determine font path -XORG_FONTROOTDIR -XORG_FONTSUBDIR(FONTMISCDIR, fontmiscdir, misc) -XORG_FONTSUBDIR(FONTOTFDIR, fontotfdir, OTF) -XORG_FONTSUBDIR(FONTTTFDIR, fontttfdir, TTF) -XORG_FONTSUBDIR(FONTTYPE1DIR, fonttype1dir, Type1) -XORG_FONTSUBDIR(FONT75DPIDIR, font75dpidir, 75dpi) -XORG_FONTSUBDIR(FONT100DPIDIR, font100dpidir, 100dpi) - -dnl Uses --default-font-path if set, otherwise checks for /etc/X11/fontpath.d, -dnl otherwise uses standard subdirectories of FONTROOTDIR. When cross -dnl compiling, assume default font path uses standard FONTROOTDIR directories. -DEFAULT_FONT_PATH="${FONTMISCDIR}/,${FONTTTFDIR}/,${FONTOTFDIR}/,${FONTTYPE1DIR}/,${FONT100DPIDIR}/,${FONT75DPIDIR}/" -if test "$cross_compiling" != yes; then - AC_CHECK_FILE([${sysconfdir}/X11/fontpath.d], - [DEFAULT_FONT_PATH='catalogue:${sysconfdir}/X11/fontpath.d'], - [case $host_os in - darwin*) DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;; - esac]) -fi -AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]), - [ FONTPATH="$withval" ], - [ FONTPATH="${DEFAULT_FONT_PATH}" ]) - -AC_MSG_CHECKING([for default font path]) -AC_MSG_RESULT([$FONTPATH]) - -AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: ${datadir}/X11/xkb)]), - [ XKBPATH="$withval" ], - [ XKBPATH="${datadir}/X11/xkb" ]) -AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]), - [ XKBOUTPUT="$withval" ], - [ XKBOUTPUT="compiled" ]) -AC_ARG_WITH(default-xkb-rules, AS_HELP_STRING([--with-default-xkb-rules=RULES], - [Keyboard ruleset (default: base/evdev)]), - [ XKB_DFLT_RULES="$withval" ], - [ XKB_DFLT_RULES="" ]) -AC_ARG_WITH(default-xkb-model, AS_HELP_STRING([--with-default-xkb-model=MODEL], - [Keyboard model (default: pc105)]), - [ XKB_DFLT_MODEL="$withval" ], - [ XKB_DFLT_MODEL="pc105" ]) -AC_ARG_WITH(default-xkb-layout, AS_HELP_STRING([--with-default-xkb-layout=LAYOUT], - [Keyboard layout (default: us)]), - [ XKB_DFLT_LAYOUT="$withval" ], - [ XKB_DFLT_LAYOUT="us" ]) -AC_ARG_WITH(default-xkb-variant, AS_HELP_STRING([--with-default-xkb-variant=VARIANT], - [Keyboard variant (default: (none))]), - [ XKB_DFLT_VARIANT="$withval" ], - [ XKB_DFLT_VARIANT="" ]) -AC_ARG_WITH(default-xkb-options, AS_HELP_STRING([--with-default-xkb-options=OPTIONS], - [Keyboard layout options (default: (none))]), - [ XKB_DFLT_OPTIONS="$withval" ], - [ XKB_DFLT_OPTIONS="" ]) -AC_ARG_WITH(serverconfig-path, AS_HELP_STRING([--with-serverconfig-path=PATH], - [Directory where ancillary server config files are installed (default: ${libdir}/xorg)]), - [ SERVERCONFIG="$withval" ], - [ SERVERCONFIG="${libdir}/xorg" ]) -AC_ARG_WITH(apple-applications-dir,AS_HELP_STRING([--with-apple-applications-dir=PATH], [Path to the Applications directory (default: /Applications/Utilities)]), - [ APPLE_APPLICATIONS_DIR="${withval}" ], - [ APPLE_APPLICATIONS_DIR="/Applications/Utilities" ]) -AC_SUBST([APPLE_APPLICATIONS_DIR]) -AC_ARG_WITH(apple-application-name,AS_HELP_STRING([--with-apple-application-name=NAME], [Name for the .app (default: X11)]), - [ APPLE_APPLICATION_NAME="${withval}" ], - [ APPLE_APPLICATION_NAME="X11" ]) -AC_SUBST([APPLE_APPLICATION_NAME]) -AC_ARG_WITH(launchd-id-prefix, AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Prefix to use for launchd identifiers (default: org.x)]), - [ LAUNCHD_ID_PREFIX="${withval}" ], - [ LAUNCHD_ID_PREFIX="org.x" ]) -AC_SUBST([LAUNCHD_ID_PREFIX]) -AC_DEFINE_UNQUOTED(LAUNCHD_ID_PREFIX, "$LAUNCHD_ID_PREFIX", [Prefix to use for launchd identifiers]) -AC_ARG_ENABLE(sparkle,AS_HELP_STRING([--enable-sparkle], [Enable updating of X11.app using the Sparkle Framework (default: disabled)]), - [ XQUARTZ_SPARKLE="${enableval}" ], - [ XQUARTZ_SPARKLE="no" ]) -AC_SUBST([XQUARTZ_SPARKLE]) -AC_ARG_ENABLE(install-libxf86config, - AS_HELP_STRING([--enable-install-libxf86config], - [Install libxf86config (default: disabled)]), - [INSTALL_LIBXF86CONFIG=$enableval], - [INSTALL_LIBXF86CONFIG=no]) -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)]), - [AIGLX=$enableval], - [AIGLX=yes]) -AX_TLS -AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: auto)]), - [GLX_USE_TLS=$enableval], - [GLX_USE_TLS=no - if test "${ac_cv_tls}" != "none" ; then - GLX_USE_TLS=yes - fi]) -AC_SUBST(GLX_TLS, ${GLX_USE_TLS}) - -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(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]) -AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Build XvMC extension (default: enabled)]), [XVMC=$enableval], [XVMC=yes]) -AC_ARG_ENABLE(dga, AS_HELP_STRING([--disable-dga], [Build DGA extension (default: auto)]), [DGA=$enableval], [DGA=auto]) -AC_ARG_ENABLE(screensaver, AS_HELP_STRING([--disable-screensaver], [Build ScreenSaver extension (default: enabled)]), [SCREENSAVER=$enableval], [SCREENSAVER=yes]) -AC_ARG_ENABLE(xdmcp, AS_HELP_STRING([--disable-xdmcp], [Build XDMCP extension (default: auto)]), [XDMCP=$enableval], [XDMCP=auto]) -AC_ARG_ENABLE(xdm-auth-1, AS_HELP_STRING([--disable-xdm-auth-1], [Build XDM-Auth-1 extension (default: auto)]), [XDMAUTH=$enableval], [XDMAUTH=auto]) -AC_ARG_ENABLE(glx, AS_HELP_STRING([--disable-glx], [Build GLX extension (default: enabled)]), [GLX=$enableval], [GLX=yes]) -AC_ARG_ENABLE(dri, AS_HELP_STRING([--enable-dri], [Build DRI extension (default: auto)]), [DRI=$enableval]) -AC_ARG_ENABLE(dri2, AS_HELP_STRING([--enable-dri2], [Build DRI2 extension (default: auto)]), [DRI2=$enableval], [DRI2=auto]) -AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--disable-xinerama], [Build Xinerama extension (default: enabled)]), [XINERAMA=$enableval], [XINERAMA=yes]) -AC_ARG_ENABLE(xf86vidmode, AS_HELP_STRING([--disable-xf86vidmode], [Build XF86VidMode extension (default: auto)]), [XF86VIDMODE=$enableval], [XF86VIDMODE=auto]) -AC_ARG_ENABLE(xace, AS_HELP_STRING([--disable-xace], [Build X-ACE extension (default: enabled)]), [XACE=$enableval], [XACE=yes]) -AC_ARG_ENABLE(xselinux, AS_HELP_STRING([--enable-xselinux], [Build SELinux extension (default: disabled)]), [XSELINUX=$enableval], [XSELINUX=no]) -AC_ARG_ENABLE(xcsecurity, AS_HELP_STRING([--enable-xcsecurity], [Build Security extension (default: disabled)]), [XCSECURITY=$enableval], [XCSECURITY=no]) -AC_ARG_ENABLE(xcalibrate, AS_HELP_STRING([--enable-xcalibrate], [Build XCalibrate extension (default: disabled)]), [XCALIBRATE=$enableval], [XCALIBRATE=no]) -AC_ARG_ENABLE(tslib, AS_HELP_STRING([--enable-tslib], [Build kdrive tslib touchscreen support (default: disabled)]), [TSLIB=$enableval], [TSLIB=no]) -AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes]) -AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--enable-xf86bigfont], [Build XF86 Big Font extension (default: disabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=no]) -AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes]) -AC_ARG_ENABLE(config-udev, AS_HELP_STRING([--enable-config-udev], [Build udev support (default: auto)]), [CONFIG_UDEV=$enableval], [CONFIG_UDEV=auto]) -AC_ARG_ENABLE(config-dbus, AS_HELP_STRING([--enable-config-dbus], [Build D-BUS API support (default: no)]), [CONFIG_DBUS_API=$enableval], [CONFIG_DBUS_API=no]) -AC_ARG_ENABLE(config-hal, AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto]) -AC_ARG_ENABLE(xfree86-utils, AS_HELP_STRING([--enable-xfree86-utils], [Build xfree86 DDX utilities (default: enabled)]), [XF86UTILS=$enableval], [XF86UTILS=yes]) -AC_ARG_ENABLE(xaa, AS_HELP_STRING([--enable-xaa], [Build XAA (default: enabled)]), [XAA=$enableval], [XAA=yes]) -AC_ARG_ENABLE(vgahw, AS_HELP_STRING([--enable-vgahw], [Build Xorg with vga access (default: enabled)]), [VGAHW=$enableval], [VGAHW=yes]) -AC_ARG_ENABLE(vbe, AS_HELP_STRING([--enable-vbe], [Build Xorg with VBE module (default: enabled)]), [VBE=$enableval], [VBE=yes]) -AC_ARG_ENABLE(int10-module, AS_HELP_STRING([--enable-int10-module], [Build Xorg with int10 module (default: enabled)]), [INT10MODULE=$enableval], [INT10MODULE=yes]) -AC_ARG_ENABLE(windowswm, AS_HELP_STRING([--enable-windowswm], [Build XWin with WindowsWM extension (default: no)]), [WINDOWSWM=$enableval], [WINDOWSWM=no]) -AC_ARG_ENABLE(libdrm, AS_HELP_STRING([--enable-libdrm], [Build Xorg with libdrm support (default: enabled)]), [DRM=$enableval],[DRM=yes]) - -dnl DDXes. -AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto]) -AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=auto]) -AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes]) -AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto]) -AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto]) -AC_ARG_ENABLE(standalone-xpbproxy, AS_HELP_STRING([--enable-standalone-xpbproxy], [Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) (default: no)]), [STANDALONE_XPBPROXY=$enableval], [STANDALONE_XPBPROXY=no]) -AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto]) -dnl kdrive and its subsystems -AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no]) -AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto]) -AC_ARG_ENABLE(xfake, AS_HELP_STRING([--enable-xfake], [Build the kdrive 'fake' server (default: auto)]), [XFAKE=$enableval], [XFAKE=auto]) -AC_ARG_ENABLE(xfbdev, AS_HELP_STRING([--enable-xfbdev], [Build the kdrive framebuffer device server (default: auto)]), [XFBDEV=$enableval], [XFBDEV=auto]) -dnl kdrive options -AC_ARG_ENABLE(kdrive-kbd, AS_HELP_STRING([--enable-kdrive-kbd], [Build kbd driver for kdrive (default: auto)]), [KDRIVE_KBD=$enableval], [KDRIVE_KBD=auto]) -AC_ARG_ENABLE(kdrive-mouse, AC_HELP_STRING([--enable-kdrive-mouse], [Build mouse driver for kdrive (default: auto)]), [KDRIVE_MOUSE=$enableval], [KDRIVE_MOUSE=auto]) -AC_ARG_ENABLE(kdrive-evdev, AC_HELP_STRING([--enable-kdrive-evdev], [Build evdev driver for kdrive (default: auto)]), [KDRIVE_EVDEV=$enableval], [KDRIVE_EVDEV=auto]) - - -dnl chown/chmod to be setuid root as part of build -dnl Replaces InstallXserverSetUID in imake -AC_ARG_ENABLE(install-setuid, - AS_HELP_STRING([--enable-install-setuid], - [Install Xorg server as owned by root with setuid bit (default: auto)]), - [SETUID=$enableval], [SETUID=auto]) -AC_MSG_CHECKING([to see if we can install the Xorg server as root]) -if test "x$SETUID" = "xauto" ; then - case $host_os in - cygwin*) SETUID="no" ;; - darwin*) SETUID="no" ;; - *) - case $host_cpu in - sparc) SETUID="no" ;; - *) SETUID="yes" ;; - esac - esac - if test "x$SETUID" = xyes; then - touch testfile - chown root testfile > /dev/null 2>&1 || SETUID="no" - rm -f testfile - fi -fi -AC_MSG_RESULT([$SETUID]) -AM_CONDITIONAL(INSTALL_SETUID, [test "x$SETUID" = "xyes"]) - -dnl Issue an error if xtrans.m4 was not found and XTRANS_CONNECTION_FLAGS macro -dnl was not expanded, since xorg-server with no transport types is rather useless. -dnl -dnl If you're seeing an error here, be sure you installed the lib/xtrans module -dnl first and if it's not in the default location, that you set the ACLOCAL -dnl environment variable to find it, such as: -dnl ACLOCAL="aclocal -I ${PREFIX}/share/aclocal" -m4_pattern_forbid([^XTRANS_CONNECTION_FLAGS$]) - -# Transport selection macro from xtrans.m4 -XTRANS_CONNECTION_FLAGS - -# Secure RPC detection macro from xtrans.m4 -XTRANS_SECURE_RPC_FLAGS -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 - -XORG_ENABLE_DOCS -XORG_ENABLE_DEVEL_DOCS -XORG_WITH_XMLTO(0.0.20) -XORG_WITH_FOP - -dnl Handle installing libxf86config -AM_CONDITIONAL(INSTALL_LIBXF86CONFIG, [test "x$INSTALL_LIBXF86CONFIG" = xyes]) - -dnl DDX Detection... Yes, it's ugly to have it here... but we need to -dnl handle this early on so that we don't require unsupported extensions -case $host_os in - cygwin*) - DGA=no - DRI2=no - XF86VIDMODE=no - XSELINUX=no - XV=no - ;; - darwin*) - DRI2=no - - if test x$XQUARTZ = xauto; then - AC_CACHE_CHECK([whether to build Xquartz],xorg_cv_Carbon_framework,[ - save_LDFLAGS=$LDFLAGS - LDFLAGS="$LDFLAGS -framework Carbon" - AC_LINK_IFELSE([char FSFindFolder(); int main() { FSFindFolder(); return 0;}], - [xorg_cv_Carbon_framework=yes], - [xorg_cv_Carbon_framework=no]) - LDFLAGS=$save_LDFLAGS]) - - if test "X$xorg_cv_Carbon_framework" = Xyes; then - XQUARTZ=yes - else - XQUARTZ=no - fi - fi - - if test "x$XQUARTZ" = xyes ; then - XQUARTZ=yes - XVFB=no - XNEST=no - - COMPOSITE=no - DGA=no - DPMSExtension=no - XF86VIDMODE=no - fi - ;; - *) XQUARTZ=no ;; -esac - -dnl --------------------------------------------------------------------------- -dnl Extension section -dnl --------------------------------------------------------------------------- -XEXT_INC='-I$(top_srcdir)/Xext' -XEXT_LIB='$(top_builddir)/Xext/libXext.la' -XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la' - -dnl Optional modules -VIDEOPROTO="videoproto" -COMPOSITEPROTO="compositeproto >= 0.4" -RECORDPROTO="recordproto >= 1.13.99.1" -SCRNSAVERPROTO="scrnsaverproto >= 1.1" -RESOURCEPROTO="resourceproto" -DRIPROTO="xf86driproto >= 2.1.0" -DRI2PROTO="dri2proto >= 2.3" -XINERAMAPROTO="xineramaproto" -BIGFONTPROTO="xf86bigfontproto >= 1.2.0" -XCALIBRATEPROTO="xcalibrateproto" -DGAPROTO="xf86dgaproto >= 2.0.99.1" -GLPROTO="glproto >= 1.4.10" -DMXPROTO="dmxproto >= 2.2.99.1" -VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1" -WINDOWSWMPROTO="windowswmproto" -APPLEWMPROTO="applewmproto >= 1.4" - -dnl Core modules for most extensions, et al. -SDK_REQUIRED_MODULES="[xproto >= 7.0.17] [randrproto >= 1.4] [renderproto >= 0.11] [xextproto >= 7.1.99] [inputproto >= 1.9.99.902] [kbproto >= 1.0.3] fontsproto" -# Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc -AC_SUBST(SDK_REQUIRED_MODULES) - -dnl List of libraries that require a specific version -LIBAPPLEWM="applewm >= 1.4" -LIBDMX="dmx >= 1.0.99.1" -LIBDRI="dri >= 7.8.0" -LIBDRM="libdrm >= 2.3.0" -LIBGL="gl >= 7.1.0" -LIBXEXT="xext >= 1.0.99.4" -LIBXFONT="xfont >= 1.4.2" -LIBXI="xi >= 1.2.99.1" -LIBXTST="xtst >= 1.0.99.2" -LIBPCIACCESS="pciaccess >= 0.8.0" -LIBGLIB="glib-2.0 >= 2.16" -LIBUDEV="libudev >= 143" -LIBSELINUX="libselinux >= 2.0.86" -LIBDBUS="dbus-1 >= 1.0" -LIBPIXMAN="pixman-1 >= 0.15.20" - -dnl Pixman is always required, but we separate it out so we can link -dnl specific modules against it -PKG_CHECK_MODULES(PIXMAN, $LIBPIXMAN) -REQUIRED_LIBS="$REQUIRED_LIBS $LIBPIXMAN $LIBXFONT xau" - -REQUIRED_MODULES="[fixesproto >= 4.1] [damageproto >= 1.1] [xcmiscproto >= 1.2.0] [xtrans >= 1.2.2] [bigreqsproto >= 1.1.0] $SDK_REQUIRED_MODULES" - -if test "x$CONFIG_UDEV" = xyes && - { test "x$CONFIG_DBUS_API" = xyes || test "x$CONFIG_HAL" = xyes; }; then - AC_MSG_ERROR([Hotplugging through both libudev and dbus/hal not allowed]) -fi - -PKG_CHECK_MODULES(UDEV, $LIBUDEV, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no]) -if test "x$CONFIG_UDEV" = xauto; then - CONFIG_UDEV="$HAVE_LIBUDEV" -fi -AM_CONDITIONAL(CONFIG_UDEV, [test "x$CONFIG_UDEV" = xyes]) -if test "x$CONFIG_UDEV" = xyes; then - CONFIG_DBUS_API=no - CONFIG_HAL=no - if ! test "x$HAVE_LIBUDEV" = xyes; then - AC_MSG_ERROR([udev configuration API requested, but libudev is not installed]) - fi - AC_DEFINE(CONFIG_UDEV, 1, [Use libudev for input hotplug]) -fi - -dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas -dnl CONFIG_DBUS_API is true if we want to enable the D-Bus config -dnl API. -PKG_CHECK_MODULES(DBUS, $LIBDBUS, [HAVE_DBUS=yes], [HAVE_DBUS=no]) -if test "x$HAVE_DBUS" = xyes; then - AC_DEFINE(HAVE_DBUS, 1, [Have D-Bus support]) -fi -AM_CONDITIONAL(HAVE_DBUS, [test "x$HAVE_DBUS" = xyes]) - -if test "x$CONFIG_DBUS_API" = xauto; then - CONFIG_DBUS_API="$HAVE_DBUS" -fi -if test "x$CONFIG_DBUS_API" = xyes; then - if ! test "x$HAVE_DBUS" = xyes; then - AC_MSG_ERROR([D-Bus configuration API requested, but D-Bus is not installed.]) - fi - - AC_DEFINE(CONFIG_DBUS_API, 1, [Use the D-Bus input configuration API]) - CONFIG_NEED_DBUS="yes" -fi -AM_CONDITIONAL(CONFIG_DBUS_API, [test "x$CONFIG_DBUS_API" = xyes]) - -PKG_CHECK_MODULES(HAL, hal, [HAVE_HAL=yes], [HAVE_HAL=no]) -if test "x$CONFIG_HAL" = xauto; then - CONFIG_HAL="$HAVE_HAL" -fi -if test "x$CONFIG_HAL" = xyes; then - if ! test "x$HAVE_HAL" = xyes; then - AC_MSG_ERROR([HAL hotplug API requested, but HAL is not installed.]) - fi - - AC_DEFINE(CONFIG_HAL, 1, [Use the HAL hotplug API]) - CONFIG_NEED_DBUS="yes" -fi -AM_CONDITIONAL(CONFIG_HAL, [test "x$CONFIG_HAL" = xyes]) - -if test "x$CONFIG_NEED_DBUS" = xyes; then - AC_DEFINE(CONFIG_NEED_DBUS, 1, [Use D-Bus for input hotplug]) -fi -AM_CONDITIONAL(CONFIG_NEED_DBUS, [test "x$CONFIG_NEED_DBUS" = xyes]) - -if test "x$USE_SIGIO_BY_DEFAULT" = xyes; then - USE_SIGIO_BY_DEFAULT_VALUE=TRUE -else - USE_SIGIO_BY_DEFAULT_VALUE=FALSE -fi -AC_DEFINE_UNQUOTED([USE_SIGIO_BY_DEFAULT], [$USE_SIGIO_BY_DEFAULT_VALUE], - [Use SIGIO handlers for input device events by default]) - -AC_MSG_CHECKING([for glibc...]) -AC_PREPROC_IFELSE([ -#include -#ifndef __GLIBC__ -#error -#endif -], glibc=yes, glibc=no) -AC_MSG_RESULT([$glibc]) - -AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes], - [AC_CHECK_LIB([rt], [clock_gettime], [have_clock_gettime=-lrt], - [have_clock_gettime=no])]) - -AC_MSG_CHECKING([for a useful monotonic clock ...]) - -if ! test "x$have_clock_gettime" = xno; then - if ! test "x$have_clock_gettime" = xyes; then - CLOCK_LIBS="$have_clock_gettime" - else - CLOCK_LIBS="" - fi - - LIBS_SAVE="$LIBS" - LIBS="$CLOCK_LIBS" - CPPFLAGS_SAVE="$CPPFLAGS" - - if test x"$glibc" = xyes; then - CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L" - fi - - AC_RUN_IFELSE([ -#include - -int main(int argc, char *argv[[]]) { - struct timespec tp; - - if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) - return 0; - else - return 1; -} - ], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no], - [MONOTONIC_CLOCK="cross compiling"]) - - LIBS="$LIBS_SAVE" - CPPFLAGS="$CPPFLAGS_SAVE" -else - MONOTONIC_CLOCK=no -fi - -AC_MSG_RESULT([$MONOTONIC_CLOCK]) - -if test "x$MONOTONIC_CLOCK" = xyes; then - AC_DEFINE(MONOTONIC_CLOCK, 1, [Have monotonic clock from clock_gettime()]) - LIBS="$LIBS $CLOCK_LIBS" -fi - -AM_CONDITIONAL(XV, [test "x$XV" = xyes]) -if test "x$XV" = xyes; then - AC_DEFINE(XV, 1, [Support Xv extension]) - AC_DEFINE(XvExtension, 1, [Build Xv extension]) - REQUIRED_MODULES="$REQUIRED_MODULES $VIDEOPROTO" - SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $VIDEOPROTO" -else - XVMC=no -fi - -AM_CONDITIONAL(XVMC, [test "x$XVMC" = xyes]) -if test "x$XVMC" = xyes; then - AC_DEFINE(XvMCExtension, 1, [Build XvMC extension]) -fi - -AM_CONDITIONAL(XREGISTRY, [test "x$XREGISTRY" = xyes]) -if test "x$XREGISTRY" = xyes; then - AC_DEFINE(XREGISTRY, 1, [Build registry module]) -fi - -AM_CONDITIONAL(COMPOSITE, [test "x$COMPOSITE" = xyes]) -if test "x$COMPOSITE" = xyes; then - AC_DEFINE(COMPOSITE, 1, [Support Composite Extension]) - REQUIRED_MODULES="$REQUIRED_MODULES $COMPOSITEPROTO" - COMPOSITE_LIB='$(top_builddir)/composite/libcomposite.la' - COMPOSITE_INC='-I$(top_srcdir)/composite' -fi - -AM_CONDITIONAL(MITSHM, [test "x$MITSHM" = xyes]) -if test "x$MITSHM" = xyes; then - AC_DEFINE(MITSHM, 1, [Support MIT-SHM extension]) - AC_DEFINE(HAS_SHM, 1, [Support SHM]) -fi - -AM_CONDITIONAL(RECORD, [test "x$RECORD" = xyes]) -if test "x$RECORD" = xyes; then - AC_DEFINE(XRECORD, 1, [Support Record extension]) - REQUIRED_MODULES="$REQUIRED_MODULES $RECORDPROTO" - RECORD_LIB='$(top_builddir)/record/librecord.la' -fi - -AM_CONDITIONAL(SCREENSAVER, [test "x$SCREENSAVER" = xyes]) -if test "x$SCREENSAVER" = xyes; then - AC_DEFINE(SCREENSAVER, 1, [Support MIT-SCREEN-SAVER extension]) - REQUIRED_MODULES="$REQUIRED_MODULES $SCRNSAVERPROTO" -fi - -AM_CONDITIONAL(RES, [test "x$RES" = xyes]) -if test "x$RES" = xyes; then - AC_DEFINE(RES, 1, [Support X resource extension]) - REQUIRED_MODULES="$REQUIRED_MODULES $RESOURCEPROTO" -fi - -if test "x$GLX" = xyes; then - PKG_CHECK_MODULES([XLIB], [x11]) - PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL) - AC_SUBST(XLIB_CFLAGS) - AC_DEFINE(GLXEXT, 1, [Build GLX extension]) - GLX_LIBS='$(top_builddir)/glx/libglx.la' - GLX_SYS_LIBS="$GLX_SYS_LIBS" -else - GLX=no -fi -AM_CONDITIONAL(GLX, test "x$GLX" = xyes) - -if test "x$AIGLX" = xyes -a "x$GLX" = xyes -a "x$DRI" = xyes; then - AC_DEFINE(AIGLX, 1, [Build AIGLX loader]) -else - AIGLX=no -fi -AM_CONDITIONAL(AIGLX, test "x$AIGLX" = xyes) - -if test "x$GLX_USE_TLS" = xyes ; then - GLX_DEFINES="-DGLX_USE_TLS -DPTHREADS" - GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread" -fi -AC_SUBST([GLX_DEFINES]) - -AM_CONDITIONAL(DRI, test "x$DRI" = xyes) -if test "x$DRI" = xyes; then - AC_DEFINE(XF86DRI, 1, [Build DRI extension]) - PKG_CHECK_MODULES([DRIPROTO], [$DRIPROTO]) - PKG_CHECK_MODULES([DRI], $GLPROTO $LIBDRI) - AC_SUBST(DRIPROTO_CFLAGS) -fi - -PKG_CHECK_MODULES([DRI2PROTO], $DRI2PROTO, - [HAVE_DRI2PROTO=yes], [HAVE_DRI2PROTO=no]) -case "$DRI2,$HAVE_DRI2PROTO" in - yes,no) - AC_MSG_ERROR([DRI2 requested, but dri2proto not found.]) - ;; - yes,yes | auto,yes) - AC_DEFINE(DRI2, 1, [Build DRI2 extension]) - DRI2=yes - SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI2PROTO" - ;; -esac -AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes) - -if test "x$DRI" = xyes || test "x$DRI2" = xyes; then - if test "x$DRM" = xyes; then - AC_DEFINE(WITH_LIBDRM, 1, [Building with libdrm support]) - PKG_CHECK_MODULES([LIBDRM], $LIBDRM) - fi -fi - -if test "x$DRI2" = xyes; then - save_CFLAGS=$CFLAGS - CFLAGS="$GL_CFLAGS $LIBDRM_CFLAGS" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include -#include -#ifndef __DRI_DRI2 -#error DRI2 extension not available. -#endif]])], - [HAVE_DRI2EXTENSION=yes], - [HAVE_DRI2EXTENSION=no]) - CFLAGS=$save_CFLAGS - if test "x$HAVE_DRI2EXTENSION" = xyes; then - AC_DEFINE(DRI2_AIGLX, 1, [Build DRI2 AIGLX loader]) - DRI2_AIGLX=yes - else - AC_MSG_NOTICE([DRI2 AIGLX disabled, __DRI_DRI2 not defined in dri_interface.h.]) - DRI2_AIGLX=no - fi -fi -AM_CONDITIONAL(DRI2_AIGLX, test "x$DRI2_AIGLX" = xyes) - - -AM_CONDITIONAL(XINERAMA, [test "x$XINERAMA" = xyes]) -if test "x$XINERAMA" = xyes; then - AC_DEFINE(XINERAMA, 1, [Support Xinerama extension]) - AC_DEFINE(PANORAMIX, 1, [Internal define for Xinerama]) - REQUIRED_MODULES="$REQUIRED_MODULES $XINERAMAPROTO" - SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $XINERAMAPROTO" -fi - -AM_CONDITIONAL(XACE, [test "x$XACE" = xyes]) -if test "x$XACE" = xyes; then - AC_DEFINE(XACE, 1, [Build X-ACE extension]) -fi - -AM_CONDITIONAL(XSELINUX, [test "x$XSELINUX" = xyes]) -if test "x$XSELINUX" = xyes; then - if test "x$XACE" != xyes; then - AC_MSG_ERROR([cannot build SELinux extension without X-ACE]) - fi - AC_CHECK_HEADERS([libaudit.h], [], AC_MSG_ERROR([SELinux extension requires audit system headers])) - AC_CHECK_LIB(audit, audit_open, [], AC_MSG_ERROR([SELinux extension requires audit system library])) - PKG_CHECK_MODULES([SELINUX], $LIBSELINUX) - SELINUX_LIBS="$SELINUX_LIBS -laudit" - AC_DEFINE(XSELINUX, 1, [Build SELinux extension]) -fi - -AM_CONDITIONAL(XCSECURITY, [test "x$XCSECURITY" = xyes]) -if test "x$XCSECURITY" = xyes; then - if test "x$XACE" != xyes; then - AC_MSG_ERROR([cannot build Security extension without X-ACE]) - fi - AC_DEFINE(XCSECURITY, 1, [Build Security extension]) -fi - -AM_CONDITIONAL(DBE, [test "x$DBE" = xyes]) -if test "x$DBE" = xyes; then - AC_DEFINE(DBE, 1, [Support DBE extension]) - DBE_LIB='$(top_builddir)/dbe/libdbe.la' -fi - -AM_CONDITIONAL(XF86BIGFONT, [test "x$XF86BIGFONT" = xyes]) -if test "x$XF86BIGFONT" = xyes; then - AC_DEFINE(XF86BIGFONT, 1, [Support XF86 Big font extension]) - REQUIRED_MODULES="$REQUIRED_MODULES $BIGFONTPROTO" -fi - -AM_CONDITIONAL(DPMSExtension, [test "x$DPMSExtension" = xyes]) -if test "x$DPMSExtension" = xyes; then - AC_DEFINE(DPMSExtension, 1, [Support DPMS extension]) -fi - -if test "x$XCALIBRATE" = xyes && test "$KDRIVE" = yes; then - AC_DEFINE(XCALIBRATE, 1, [Build XCalibrate extension]) - REQUIRED_MODULES="$REQUIRED_MODULES $XCALIBRATEPROTO" -else - XCALIBRATE=no -fi -AM_CONDITIONAL(XCALIBRATE, [test "x$XCALIBRATE" = xyes]) - -AC_DEFINE(RENDER, 1, [Support RENDER extension]) -RENDER_LIB='$(top_builddir)/render/librender.la' -RENDER_INC='-I$(top_srcdir)/render' - -AC_DEFINE(RANDR, 1, [Support RANDR extension]) -RANDR_LIB='$(top_builddir)/randr/librandr.la' -RANDR_INC='-I$(top_srcdir)/randr' - -AC_DEFINE(XFIXES,1,[Support XFixes extension]) -FIXES_LIB='$(top_builddir)/xfixes/libxfixes.la' -FIXES_INC='-I$(top_srcdir)/xfixes' - -AC_DEFINE(DAMAGE,1,[Support Damage extension]) -DAMAGE_LIB='$(top_builddir)/damageext/libdamageext.la' -DAMAGE_INC='-I$(top_srcdir)/damageext' -MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la' -MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage' - -# XINPUT extension is integral part of the server -AC_DEFINE(XINPUT, 1, [Support X Input extension]) -XI_LIB='$(top_builddir)/Xi/libXi.la' -XI_INC='-I$(top_srcdir)/Xi' - -AM_CONDITIONAL(XF86UTILS, test "x$XF86UTILS" = xyes) -AM_CONDITIONAL(XAA, test "x$XAA" = xyes) -AM_CONDITIONAL(VGAHW, test "x$VGAHW" = xyes) -AM_CONDITIONAL(VBE, test "x$VBE" = xyes) -AM_CONDITIONAL(INT10MODULE, test "x$INT10MODULE" = xyes) - -AC_DEFINE(SHAPE, 1, [Support SHAPE extension]) - -AC_DEFINE_DIR(XKB_BASE_DIRECTORY, XKBPATH, [Path to XKB data]) -AC_ARG_WITH(xkb-bin-directory, - AS_HELP_STRING([--with-xkb-bin-directory=DIR], [Directory containing xkbcomp program]), - [XKB_BIN_DIRECTORY="$withval"], - [XKB_BIN_DIRECTORY="$bindir"]) - -AC_DEFINE_DIR(XKB_BIN_DIRECTORY, XKB_BIN_DIRECTORY, [Path to XKB bin dir]) - -dnl Make sure XKM_OUTPUT_DIR is an absolute path -XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1` -if [[ x$XKBOUTPUT_FIRSTCHAR != x/ -a x$XKBOUTPUT_FIRSTCHAR != 'x$' ]] ; then - XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT" -fi - -dnl XKM_OUTPUT_DIR (used in code) must end in / or file names get hosed -dnl XKB_COMPILED_DIR (used in Makefiles) must not or install-sh gets confused - -XKBOUTPUT=`echo $XKBOUTPUT/ | $SED 's|/*$|/|'` -XKB_COMPILED_DIR=`echo $XKBOUTPUT | $SED 's|/*$||'` -AC_DEFINE_DIR(XKM_OUTPUT_DIR, XKBOUTPUT, [Path to XKB output dir]) -AC_SUBST(XKB_COMPILED_DIR) - -if test "x$XKB_DFLT_RULES" = x; then - case $host_os in - linux*) - dnl doesn't take AutoAddDevices into account, but whatever. - if test "x$CONFIG_HAL" = xyes; then - XKB_DFLT_RULES="evdev" - else - XKB_DFLT_RULES="base" - fi - ;; - *) - XKB_DFLT_RULES="base" - ;; - esac -fi -AC_DEFINE_UNQUOTED(XKB_DFLT_RULES, ["$XKB_DFLT_RULES"], [Default XKB ruleset]) -AC_DEFINE_UNQUOTED(XKB_DFLT_MODEL, ["$XKB_DFLT_MODEL"], [Default XKB model]) -AC_DEFINE_UNQUOTED(XKB_DFLT_LAYOUT, ["$XKB_DFLT_LAYOUT"], [Default XKB layout]) -AC_DEFINE_UNQUOTED(XKB_DFLT_VARIANT, ["$XKB_DFLT_VARIANT"], [Default XKB variant]) -AC_DEFINE_UNQUOTED(XKB_DFLT_OPTIONS, ["$XKB_DFLT_OPTIONS"], [Default XKB options]) - -XKB_LIB='$(top_builddir)/xkb/libxkb.la' -XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la' -REQUIRED_MODULES="$REQUIRED_MODULES xkbfile" - -AC_CHECK_FUNC(strcasecmp, [], AC_DEFINE([NEED_STRCASECMP], 1, - [Do not have 'strcasecmp'.])) -AC_CHECK_FUNC(strncasecmp, [], AC_DEFINE([NEED_STRNCASECMP], 1, - [Do not have 'strncasecmp'.])) -AC_CHECK_FUNC(strcasestr, [], AC_DEFINE([NEED_STRCASESTR], 1, - [Do not have 'strcasestr'.])) - -PKG_CHECK_MODULES([XDMCP], [xdmcp], [have_libxdmcp="yes"], [have_libxdmcp="no"]) -if test "x$have_libxdmcp" = xyes; then - AC_CHECK_LIB(Xdmcp, XdmcpWrap, [have_xdmcpwrap="yes"], [have_xdmcpwrap="no"], [$XDMCP_LIBS]) -fi -if test "x$XDMCP" = xauto; then - if test "x$have_libxdmcp" = xyes; then - XDMCP=yes - else - XDMCP=no - fi -fi -if test "x$XDMAUTH" = xauto; then - if test "x$have_libxdmcp" = xyes && test "x$have_xdmcpwrap" = xyes; then - XDMAUTH=yes - else - XDMAUTH=no - fi -fi - -AM_CONDITIONAL(XDMCP, [test "x$XDMCP" = xyes]) -if test "x$XDMCP" = xyes; then - AC_DEFINE(XDMCP, 1, [Support XDM Control Protocol]) - REQUIRED_LIBS="$REQUIRED_LIBS xdmcp" - XDMCP_MODULES="xdmcp" -fi - -AM_CONDITIONAL(XDMAUTH, [test "x$XDMAUTH" = xyes]) -if test "x$XDMAUTH" = xyes; then - AC_DEFINE(HASXDMAUTH,1,[Support XDM-AUTH*-1]) - if ! test "x$XDMCP" = xyes; then - REQUIRED_LIBS="$REQUIRED_LIBS xdmcp" - XDMCP_MODULES="xdmcp" - fi -fi - -AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path]) -AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path]) -AC_DEFINE_DIR(SERVER_MISC_CONFIG_PATH, SERVERCONFIG, [Server miscellaneous config path]) -AC_DEFINE_DIR(BASE_FONT_PATH, FONTROOTDIR, [Default base font path]) -dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri` -AC_DEFINE_DIR(DRI_DRIVER_PATH, dridriverdir, [Default DRI driver path]) -AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_NAME"], [Vendor name]) -AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_NAME_SHORT"], [Short vendor name]) -AC_DEFINE_UNQUOTED(XORG_DATE, ["$RELEASE_DATE"], [Vendor release]) -AC_DEFINE_UNQUOTED(XORG_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version]) -AC_DEFINE_UNQUOTED(BUILDERADDR, ["$BUILDERADDR"], [Builder address]) - -if test -z "$OSNAME"; then - OSNAME="UNKNOWN" -fi - -AC_DEFINE_UNQUOTED(OSNAME, ["$OSNAME"], [Operating System Name]) -AC_DEFINE_UNQUOTED(OSVENDOR, ["$OSVENDOR"], [Operating System Vendor]) -AC_DEFINE_UNQUOTED(BUILDERSTRING, ["$BUILDERSTRING"], [Builder string]) - -AC_SUBST([VENDOR_NAME_SHORT]) -AC_DEFINE_UNQUOTED(VENDOR_NAME, ["$VENDOR_NAME"], [Vendor name]) -AC_DEFINE_UNQUOTED(VENDOR_NAME_SHORT, ["$VENDOR_NAME_SHORT"], [Vendor name]) -AC_DEFINE_UNQUOTED(VENDOR_RELEASE, [$VENDOR_RELEASE], [Vendor release]) -AC_DEFINE_UNQUOTED(VENDOR_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version]) - -AC_DEFINE(NO_LIBCWRAPPER, 1, [Define to 1 if modules should avoid the libcwrapper]) - -if test "x$DEBUGGING" = xyes; then - AC_DEFINE(DEBUG, 1, [Enable debugging code]) -fi -AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes]) - -# If unittests aren't explicitly disabled, check for required support -if test "x$UNITTESTS" != xno ; then - PKG_CHECK_MODULES([GLIB], $LIBGLIB, - [HAVE_GLIB=yes], [HAVE_GLIB=no]) - - # Check if linker supports -wrap, passed via compiler flags - # When cross-compiling, reports no, since unit tests run from - # "make check", so would be running on build machine, not target - AC_MSG_CHECKING([whether the linker supports -wrap]) - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -Wl,-wrap,exit" - AC_RUN_IFELSE([AC_LANG_PROGRAM([[ - void __wrap_exit (int s) - { - __real_exit (0); - }]], - [[exit (1);]])], - [linker_can_wrap="yes"], - [linker_can_wrap="no"], - [linker_can_wrap="no"]) - AC_MSG_RESULT([$linker_can_wrap]) - LDFLAGS="$save_LDFLAGS" -fi - -if test "x$UNITTESTS" = xauto; then - if test "x$HAVE_GLIB" = xyes && test "x$linker_can_wrap" = xyes; then - UNITTESTS=yes - else - UNITTESTS=no - fi -fi -if test "x$UNITTESTS" = xyes; then - if test "x$HAVE_GLIB" = xno; then - AC_MSG_ERROR([glib required to build unit tests]) - fi - if test "x$linker_can_wrap" = xno; then - AC_MSG_ERROR([ld -wrap support required to build unit tests]) - fi - AC_DEFINE(UNITTESTS, 1, [Enable unit tests]) - AC_SUBST([GLIB_LIBS]) - AC_SUBST([GLIB_CFLAGS]) -fi -AM_CONDITIONAL(UNITTESTS, [test "x$UNITTESTS" = xyes]) - -AC_DEFINE(XTEST, 1, [Support XTest extension]) -AC_DEFINE(XSYNC, 1, [Support XSync extension]) -AC_DEFINE(XCMISC, 1, [Support XCMisc extension]) -AC_DEFINE(BIGREQS, 1, [Support BigRequests extension]) - -if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then - DIX_LIB='$(top_builddir)/dix/dix.O' - OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS)' -else - DIX_LIB='$(top_builddir)/dix/libdix.la' - OS_LIB='$(top_builddir)/os/libos.la' -fi -AC_SUBST([DIX_LIB]) -AC_SUBST([OS_LIB]) - -MAIN_LIB='$(top_builddir)/dix/libmain.la' -AC_SUBST([MAIN_LIB]) - -MI_LIB='$(top_builddir)/mi/libmi.la' -MI_EXT_LIB='$(top_builddir)/mi/libmiext.la' -MI_INC='-I$(top_srcdir)/mi' -FB_LIB='$(top_builddir)/fb/libfb.la' -FB_INC='-I$(top_srcdir)/fb' -MIEXT_SHADOW_INC='-I$(top_srcdir)/miext/shadow' -MIEXT_SHADOW_LIB='$(top_builddir)/miext/shadow/libshadow.la' -MIEXT_SYNC_INC='-I$(top_srcdir)/miext/sync' -MIEXT_SYNC_LIB='$(top_builddir)/miext/sync/libsync.la' -CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include' - -# SHA1 hashing -AC_ARG_WITH([sha1], - [AS_HELP_STRING([--with-sha1=libc|libmd|libgcrypt|libcrypto|libsha1|CommonCrypto], - [choose SHA1 implementation])]) -AC_CHECK_FUNC([SHA1Init], [HAVE_SHA1_IN_LIBC=yes]) -if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_LIBC" = xyes; then - with_sha1=libc -fi -if test "x$with_sha1" = xlibc && test "x$HAVE_SHA1_IN_LIBC" != xyes; then - AC_MSG_ERROR([libc requested but not found]) -fi -if test "x$with_sha1" = xlibc; then - AC_DEFINE([HAVE_SHA1_IN_LIBC], [1], - [Use libc SHA1 functions]) - SHA1_LIBS="" -fi -AC_CHECK_FUNC([CC_SHA1_Init], [HAVE_SHA1_IN_COMMONCRYPTO=yes]) -if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_COMMONCRYPTO" = xyes; then - with_sha1=CommonCrypto -fi -if test "x$with_sha1" = xCommonCrypto && test "x$HAVE_SHA1_IN_COMMONCRYPTO" != xyes; then - AC_MSG_ERROR([CommonCrypto requested but not found]) -fi -if test "x$with_sha1" = xCommonCrypto; then - AC_DEFINE([HAVE_SHA1_IN_COMMONCRYPTO], [1], - [Use CommonCrypto SHA1 functions]) - SHA1_LIBS="" -fi -AC_CHECK_LIB([md], [SHA1Init], [HAVE_LIBMD=yes]) -if test "x$with_sha1" = x && test "x$HAVE_LIBMD" = xyes; then - with_sha1=libmd -fi -if test "x$with_sha1" = xlibmd && test "x$HAVE_LIBMD" != xyes; then - AC_MSG_ERROR([libmd requested but not found]) -fi -if test "x$with_sha1" = xlibmd; then - AC_DEFINE([HAVE_SHA1_IN_LIBMD], [1], - [Use libmd SHA1 functions]) - SHA1_LIBS=-lmd -fi -PKG_CHECK_MODULES([LIBSHA1], [libsha1], [HAVE_LIBSHA1=yes], [HAVE_LIBSHA1=no]) -if test "x$with_sha1" = x && test "x$HAVE_LIBSHA1" = xyes; then - with_sha1=libsha1 -fi -if test "x$with_sha1" = xlibsha1 && test "x$HAVE_LIBSHA1" != xyes; then - AC_MSG_ERROR([libsha1 requested but not found]) -fi -if test "x$with_sha1" = xlibsha1; then - AC_DEFINE([HAVE_SHA1_IN_LIBSHA1], [1], - [Use libsha1 for SHA1]) - SHA1_LIBS=-lsha1 -fi -AC_CHECK_LIB([gcrypt], [gcry_md_open], [HAVE_LIBGCRYPT=yes]) -if test "x$with_sha1" = x && test "x$HAVE_LIBGCRYPT" = xyes; then - with_sha1=libgcrypt -fi -if test "x$with_sha1" = xlibgcrypt && test "x$HAVE_LIBGCRYPT" != xyes; then - AC_MSG_ERROR([libgcrypt requested but not found]) -fi -if test "x$with_sha1" = xlibgcrypt; then - AC_DEFINE([HAVE_SHA1_IN_LIBGCRYPT], [1], - [Use libgcrypt SHA1 functions]) - SHA1_LIBS=-lgcrypt -fi -# We don't need all of the OpenSSL libraries, just libcrypto -AC_CHECK_LIB([crypto], [SHA1_Init], [HAVE_LIBCRYPTO=yes]) -PKG_CHECK_MODULES([OPENSSL], [openssl], [HAVE_OPENSSL_PKC=yes], - [HAVE_OPENSSL_PKC=no]) -if test "x$HAVE_LIBCRYPTO" = xyes || test "x$HAVE_OPENSSL_PKC" = xyes; then - if test "x$with_sha1" = x; then - with_sha1=libcrypto - fi -else - if test "x$with_sha1" = xlibcrypto; then - AC_MSG_ERROR([OpenSSL libcrypto requested but not found]) - fi -fi -if test "x$with_sha1" = xlibcrypto; then - if test "x$HAVE_LIBCRYPTO" = xyes; then - SHA1_LIBS=-lcrypto - else - SHA1_LIBS="$OPENSSL_LIBS" - SHA1_CFLAGS="$OPENSSL_CFLAGS" - fi -fi -AC_MSG_CHECKING([for SHA1 implementation]) -if test "x$with_sha1" = x; then - AC_MSG_ERROR([No suitable SHA1 implementation found]) -fi -AC_MSG_RESULT([$with_sha1]) -AC_SUBST(SHA1_LIBS) -AC_SUBST(SHA1_CFLAGS) - -PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS]) -PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS]) - -# Autotools has some unfortunate issues with library handling. In order to -# get a server to rebuild when a dependency in the tree is changed, it must -# be listed in SERVERNAME_DEPENDENCIES. However, no system libraries may be -# listed there, or some versions of autotools will break (especially if a -L -# is required to find the library). So, we keep two sets of libraries -# detected: NAMESPACE_LIBS for in-tree libraries to be linked against, which -# will go into the _DEPENDENCIES and _LDADD of the server, and -# NAMESPACE_SYS_LIBS which will go into only the _LDADD. The -# NAMESPACEMODULES_LIBS detected from pkgconfig should always go in -# NAMESPACE_SYS_LIBS. -# -# XSERVER_LIBS is the set of in-tree libraries which all servers require. -# XSERVER_SYS_LIBS is the set of out-of-tree libraries which all servers -# require. -# -XSERVER_CFLAGS="${XSERVER_CFLAGS} ${XSERVERCFLAGS_CFLAGS}" -XSERVER_LIBS="$DIX_LIB $MI_LIB $OS_LIB" -XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}" -AC_SUBST([XSERVER_LIBS]) -AC_SUBST([XSERVER_SYS_LIBS]) - -UTILS_SYS_LIBS="${SYS_LIBS}" -AC_SUBST([UTILS_SYS_LIBS]) - -# The Xorg binary needs to export symbols so that they can be used from modules -# Some platforms require extra flags to do this. libtool should set the -# necessary flags for each platform when -export-dynamic is passed to it. -LD_EXPORT_SYMBOLS_FLAG="-export-dynamic" -AC_SUBST([LD_EXPORT_SYMBOLS_FLAG]) - -dnl Imake defines SVR4 on SVR4 systems, and many files check for it, so -dnl we need to replicate that here until those can all be fixed -AC_MSG_CHECKING([if SVR4 needs to be defined]) -AC_EGREP_CPP([I_AM_SVR4],[ -#if defined(SVR4) || defined(__svr4__) || defined(__SVR4) - I_AM_SVR4 -#endif -],[ -AC_DEFINE([SVR4],1,[Define to 1 on systems derived from System V Release 4]) -AC_MSG_RESULT([yes])], AC_MSG_RESULT([no])) - -XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SYNC_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC" - -dnl --------------------------------------------------------------------------- -dnl DDX section. -dnl --------------------------------------------------------------------------- - -dnl Xvfb DDX - -AC_MSG_CHECKING([whether to build Xvfb DDX]) -AC_MSG_RESULT([$XVFB]) -AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes]) - -if test "x$XVFB" = xyes; then - XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB" - XVFB_SYS_LIBS="$XVFBMODULES_LIBS $GLX_SYS_LIBS" - AC_SUBST([XVFB_LIBS]) - AC_SUBST([XVFB_SYS_LIBS]) -fi - - -dnl Xnest DDX - -PKG_CHECK_MODULES(XNESTMODULES, [$LIBXEXT x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no]) -AC_MSG_CHECKING([whether to build Xnest DDX]) -if test "x$XNEST" = xauto; then - XNEST="$have_xnest" -fi -AC_MSG_RESULT([$XNEST]) -AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes]) - -if test "x$XNEST" = xyes; then - if test "x$have_xnest" = xno; then - AC_MSG_ERROR([Xnest build explicitly requested, but required modules not found.]) - fi - XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DIX_LIB $MAIN_LIB $OS_LIB" - XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS" - AC_SUBST([XNEST_LIBS]) - AC_SUBST([XNEST_SYS_LIBS]) -fi - - -dnl Xorg DDX - -AC_MSG_CHECKING([whether to build Xorg DDX]) -if test "x$XORG" = xauto; then - XORG="yes" - case $host_os in - cygwin*) XORG="no" ;; - darwin*) XORG="no" ;; - esac -fi -AC_MSG_RESULT([$XORG]) - -xorg_bus_linuxpci=no -xorg_bus_bsdpci=no -xorg_bus_sparc=no - -if test "x$XORG" = xyes; then - XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common' - XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os' - XORG_INCS="$XORG_DDXINCS $XORG_OSINCS" - XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H" - XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB" - - dnl ================================================================== - dnl symbol visibility - symbol_visibility= - have_visibility=disabled - if test x$SYMBOL_VISIBILITY != xno; then - AC_MSG_CHECKING(for symbol visibility support) - if test x$GCC = xyes; then - VISIBILITY_CFLAGS="-fvisibility=hidden" - else - AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) - if test x$SUNCC = xyes; then - VISIBILITY_CFLAGS="-xldscope=hidden" - else - have_visibility=no - fi - fi - if test x$have_visibility != xno; then - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $VISIBILITY_CFLAGS" - AC_TRY_COMPILE( - [#include - extern _X_HIDDEN int hidden_int; - extern _X_EXPORT int public_int; - extern _X_HIDDEN int hidden_int_func(void); - extern _X_EXPORT int public_int_func(void);], - [], - have_visibility=yes, - have_visibility=no) - CFLAGS=$save_CFLAGS - fi - AC_MSG_RESULT([$have_visibility]) - if test x$have_visibility != xno; then - symbol_visibility=$VISIBILITY_CFLAGS - XORG_CFLAGS="$XORG_CFLAGS $VISIBILITY_CFLAGS" - XSERVER_CFLAGS="$XSERVER_CFLAGS $VISIBILITY_CFLAGS" - fi - fi - dnl added to xorg-server.pc - AC_SUBST([symbol_visibility]) - dnl =================================================================== - - PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS) - SAVE_LIBS=$LIBS - SAVE_CFLAGS=$CFLAGS - CFLAGS=$PCIACCESS_CFLAGS - LIBS=$PCIACCESS_LIBS - AC_CHECK_FUNCS([pci_system_init_dev_mem]) - AC_CHECK_FUNCS([pci_device_enable]) - AC_CHECK_FUNCS([pci_device_is_boot_vga]) - AC_CHECK_FUNCS([pci_device_vgaarb_init]) - LIBS=$SAVE_LIBS - CFLAGS=$SAVE_CFLAGS - XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS" - XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" - - case $host_os in - linux*) - 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" - case $host_cpu in - ia64*) - linux_ia64=yes - linux_acpi="yes" - ;; - alpha*) - linux_alpha=yes - ;; - i*86|amd64*|x86_64*) - linux_acpi="yes" - ;; - *) - ;; - 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" - ;; - openbsd*) - if test "x$ac_cv_BSD_APM" = xyes \ - -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 - # use libpciaccess for PCI - xorg_bus_bsdpci="yes" - AC_CHECK_HEADERS([sys/kd.h]) - AC_CHECK_HEADERS([sys/vt.h], [solaris_vt=yes], [solaris_vt=no]) - # Check for minimum supported release - AC_MSG_CHECKING([Solaris version]) - OS_MINOR=`echo ${host_os}|$SED -e 's/^.*solaris2\.//' -e s'/\..*$//'` - if test "${OS_MINOR}" -ge 7 ; then - AC_MSG_RESULT(Solaris ${OS_MINOR}) - else - AC_MSG_RESULT(Solaris `echo ${host_os}|$SED -e 's/^.*solaris//`) - fi - if test "${OS_MINOR}" -lt 8 ; then - AC_MSG_ERROR([This release no longer supports Solaris versions older than Solaris 8.]) - fi - AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) - if test "x$SUNCC" = "xyes"; then - solaris_asm_inline="yes" - fi - AC_CHECK_DECL([_LP64], [SOLARIS_64="yes"], [SOLARIS_64="no"]) - - case $host_cpu in - sparc*) - SOLARIS_INOUT_ARCH="sparcv8plus" - ;; - i*86) - if test x$SOLARIS_64 = xyes ; then - SOLARIS_INOUT_ARCH="amd64" - else - SOLARIS_INOUT_ARCH="ia32" - fi - ;; - *) - AC_MSG_ERROR([Unsupported Solaris platform. Only SPARC & x86 \ - are supported on Solaris in this release. If you are \ - interested in porting Xorg to your platform, please email \ - xorg@lists.freedesktop.org.]) ;; - esac - AC_SUBST([SOLARIS_INOUT_ARCH]) - if test x$solaris_asm_inline = xyes ; then - SOLARIS_ASM_CFLAGS='$(top_srcdir)/hw/xfree86/os-support/solaris/solaris-$(SOLARIS_INOUT_ARCH).il' - 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,], - [Free/Open/Net/DragonFlyBSD, Solaris/OpenSolaris, & GNU Hurd.], - [If you are interested in porting Xorg to your platform,], - [please email xorg@lists.freedesktop.org.]))]) - ;; - esac - - case $host_cpu in - sparc*) - 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 - if test "x$DGA" = xyes; then - XORG_MODULES="$XORG_MODULES $DGAPROTO" - PKG_CHECK_MODULES(DGA, $DGAPROTO) - AC_DEFINE(DGA, 1, [Support DGA extension]) - AC_DEFINE(XFreeXDGA, 1, [Build XDGA support]) - fi - - if test "x$XF86VIDMODE" = xauto; then - PKG_CHECK_MODULES(XF86VIDMODE, $VIDMODEPROTO, [XF86VIDMODE=yes], [XF86VIDMODE=no]) - fi - if test "x$XF86VIDMODE" = xyes; then - XORG_MODULES="$XORG_MODULES $VIDMODEPROTO" - PKG_CHECK_MODULES(XF86VIDMODE, $VIDMODEPROTO) - AC_DEFINE(XF86VIDMODE, 1, [Support XFree86 Video Mode extension]) - fi - - if test -n "$XORG_MODULES"; then - PKG_CHECK_MODULES(XORG_MODULES, [$XORG_MODULES]) - XORG_CFLAGS="$XORG_CFLAGS $XORG_MODULES_CFLAGS" - XORG_SYS_LIBS="$XORG_SYS_LIBS $XORG_MODULES_LIBS" - fi - - AC_SUBST([XORG_LIBS]) - AC_SUBST([XORG_SYS_LIBS]) - AC_SUBST([XORG_INCS]) - AC_SUBST([XORG_OS]) - AC_SUBST([XORG_OS_SUBDIR]) - - AC_PATH_PROG(PERL, perl, no) - dnl unlikely as this may be ... - if test "x$PERL" = xno; then - AC_MSG_ERROR([Perl is required to build the XFree86/Xorg DDX.]) - fi - AC_SUBST(PERL) - - AC_SUBST([XORG_CFLAGS]) - - dnl these only go in xorg-config.h - XF86CONFIGFILE="xorg.conf" - XF86CONFIGDIR="xorg.conf.d" - AC_SUBST(XF86CONFIGDIR) - CONFIGFILE="$sysconfdir/$XF86CONFIGFILE" - LOGPREFIX="$logdir/Xorg." - AC_DEFINE(XORG_SERVER, 1, [Building Xorg server]) - AC_DEFINE(XORGSERVER, 1, [Building Xorg server]) - AC_DEFINE(XFree86Server, 1, [Building XFree86 server]) - AC_DEFINE(XFree86LOADER, 1, [Building loadable XFree86 server]) - AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) - AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs]) - AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions]) - AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server]) - AC_DEFINE_DIR(__XCONFIGFILE__, XF86CONFIGFILE, [Name of configuration file]) - AC_DEFINE_DIR(XF86CONFIGFILE, XF86CONFIGFILE, [Name of configuration file]) - AC_DEFINE_DIR(__XCONFIGDIR__, XF86CONFIGDIR, [Name of configuration directory]) - AC_DEFINE_DIR(DEFAULT_MODULE_PATH, moduledir, [Default module search path]) - AC_DEFINE_DIR(DEFAULT_LIBRARY_PATH, libdir, [Default library install path]) - AC_DEFINE_DIR(DEFAULT_LOGPREFIX, LOGPREFIX, [Default log location]) - AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support]) - AC_DEFINE(XSERVER_LIBPCIACCESS, 1, [Use libpciaccess for all pci manipulation]) - if test "x$VGAHW" = xyes; then - AC_DEFINE(WITH_VGAHW, 1, [Building vgahw module]) - fi - - driverdir="$moduledir/drivers" - AC_SUBST([moduledir]) - AC_SUBST([driverdir]) - sdkdir="$includedir/xorg" - extdir="$includedir/X11/extensions" - sysconfigdir="$datadir/X11/$XF86CONFIGDIR" - AC_SUBST([sdkdir]) - AC_SUBST([extdir]) - AC_SUBST([sysconfigdir]) - AC_SUBST([logdir]) - - # stuff the ABI versions into the pc file too - extract_abi() { - grep ^.define.*${1}_VERSION ${srcdir}/hw/xfree86/common/xf86Module.h | tr '(),' ' .' | awk '{ print $4$5 }' - } - abi_ansic=`extract_abi ANSIC` - abi_videodrv=`extract_abi VIDEODRV` - abi_xinput=`extract_abi XINPUT` - abi_extension=`extract_abi EXTENSION` - AC_SUBST([abi_ansic]) - AC_SUBST([abi_videodrv]) - AC_SUBST([abi_xinput]) - AC_SUBST([abi_extension]) -fi -AM_CONDITIONAL([XORG], [test "x$XORG" = xyes]) -AM_CONDITIONAL([XORG_BUS_LINUXPCI], [test "x$xorg_bus_linuxpci" = xyes]) -AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes]) -AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes]) -AM_CONDITIONAL([LINUX_IA64], [test "x$linux_ia64" = xyes]) -AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes]) -AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes]) -AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes]) -AM_CONDITIONAL([SOLARIS_VT], [test "x$solaris_vt" = xyes]) -AM_CONDITIONAL([DGA], [test "x$DGA" = xyes]) -AM_CONDITIONAL([XF86VIDMODE], [test "x$XF86VIDMODE" = xyes]) - -dnl XWin DDX - -AC_MSG_CHECKING([whether to build XWin DDX]) -if test "x$XWIN" = xauto; then - case $host_os in - cygwin*) XWIN="yes" ;; - mingw*) XWIN="yes" ;; - *) XWIN="no" ;; - esac -fi -AC_MSG_RESULT([$XWIN]) - -if test "x$XWIN" = xyes; then - AC_DEFINE_DIR(SYSCONFDIR, sysconfdir, [Location of system.XWinrc]) - AC_DEFINE_DIR(DEFAULT_LOGDIR, logdir, [Default log location]) - AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) - AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support]) - AC_CHECK_TOOL(WINDRES, windres) - - PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau]) - - if test "x$WINDOWSWM" = xauto; then - PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no]) - fi - if test "x$WINDOWSWM" = xyes ; then - PKG_CHECK_MODULES(WINDOWSWM, $WINDOWSWMPROTO) - XWINMODULES_CFLAGS="$XWINMODULES_CFLAGS $WINDOWSWM_CFLAGS" - AC_DEFINE(ROOTLESS,1,[Build Rootless code]) - fi - - case $host_os in - cygwin*) - XWIN_SERVER_NAME=XWin - AC_DEFINE(HAS_DEVWINDOWS,1,[Cygwin has /dev/windows for signaling new win32 messages]) - ;; - mingw*) - XWIN_SERVER_NAME=Xming - AC_DEFINE(RELOCATE_PROJECTROOT,1,[Make PROJECT_ROOT relative to the xserver location]) - AC_DEFINE(HAS_WINSOCK,1,[Use Windows sockets]) - XWIN_SYS_LIBS=-lwinsock2 - ;; - esac - XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB" - XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS" - AC_SUBST(XWIN_LIBS) - AC_SUBST(XWIN_SERVER_NAME) - AC_SUBST(XWIN_SYS_LIBS) - - if test "x$DEBUGGING" = xyes; then - AC_DEFINE(CYGDEBUG, 1, [Simple debug messages]) - AC_DEFINE(CYGWINDOWING_DEBUG, 1, [Debug messages for window handling]) - AC_DEFINE(CYGMULTIWINDOW_DEBUG, 1, [Debug window manager]) - fi - - AC_DEFINE(DDXOSVERRORF, 1, [Use OsVendorVErrorF]) - AC_DEFINE(DDXBEFORERESET, 1, [Use ddxBeforeReset ]) -fi -AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes]) -AM_CONDITIONAL(XWIN_MULTIWINDOW, [test "x$XWIN" = xyes]) -AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes]) -AM_CONDITIONAL(XWIN_CLIPBOARD, [test "x$XWIN" = xyes]) -AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && false]) -AM_CONDITIONAL(XWIN_NATIVEGDI, [test "x$XWIN" = xyes]) -AM_CONDITIONAL(XWIN_PRIMARYFB, [test "x$XWIN" = xyes]) -AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes]) -AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes]) - -dnl Darwin / OS X DDX -if test "x$XQUARTZ" = xyes; then - AC_DEFINE(XQUARTZ,1,[Have Quartz]) - AC_DEFINE(ROOTLESS,1,[Build Rootless code]) - - DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $MAIN_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB" - AC_SUBST([DARWIN_LIBS]) - - AC_CHECK_LIB([Xplugin],[xp_init],[:]) - - CFLAGS="${CFLAGS} -DROOTLESS_SAFEALPHA -DNO_ALLOCA" - - PKG_CHECK_MODULES(XPBPROXY, $APPLEWMPROTO $LIBAPPLEWM xfixes x11) - - if test "x$XQUARTZ_SPARKLE" = xyes ; then - AC_DEFINE(XQUARTZ_SPARKLE,1,[Support application updating through sparkle.]) - fi - - if test "x$STANDALONE_XPBPROXY" = xyes ; then - AC_DEFINE(STANDALONE_XPBPROXY,1,[Build a standalone xpbproxy]) - fi -fi - -# Support for objc in autotools is minimal and not documented. -OBJC='$(CC)' -OBJCLD='$(CCLD)' -OBJCLINK='$(LINK)' -OBJCFLAGS='$(CFLAGS)' -AC_SUBST([OBJC]) -AC_SUBST([OBJCCLD]) -AC_SUBST([OBJCLINK]) -AC_SUBST([OBJCFLAGS]) -# internal, undocumented automake func follows :( -_AM_DEPENDENCIES([OBJC]) -AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes]) -AM_CONDITIONAL(XQUARTZ_SPARKLE, [test "x$XQUARTZ_SPARKLE" != "xno"]) -AM_CONDITIONAL(STANDALONE_XPBPROXY, [test "x$STANDALONE_XPBPROXY" = xyes]) - -dnl DMX DDX -PKG_CHECK_MODULES( - [DMXMODULES], - [xmuu $LIBXEXT x11 xrender xfixes $LIBXI $DMXPROTO xau $XDMCP_MODULES], - [PKG_CHECK_MODULES( - [XDMXCONFIG_DEP], - [xaw7 xmu xt xpm x11], - [have_dmx=yes], - [have_dmx=no])], - [have_dmx=no]) -AC_MSG_CHECKING([whether to build Xdmx DDX]) -if test "x$DMX" = xauto; then - DMX="$have_dmx" - case $host_os in - cygwin*) DMX="no" ;; - darwin*) DMX="no" ;; - esac -fi -AC_MSG_RESULT([$DMX]) -AM_CONDITIONAL(DMX, [test "x$DMX" = xyes]) - -if test "x$DMX" = xyes; then - if test "x$have_dmx" = xno; then - AC_MSG_ERROR([Xdmx build explicitly requested, but required - modules not found.]) - fi - DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC" - XDMX_CFLAGS="$DMXMODULES_CFLAGS" - XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB" - XDMX_SYS_LIBS="$DMXMODULES_LIBS" - AC_SUBST([XDMX_CFLAGS]) - AC_SUBST([XDMX_LIBS]) - AC_SUBST([XDMX_SYS_LIBS]) - -dnl USB sources in DMX require - AC_CHECK_HEADER([linux/input.h], DMX_BUILD_USB="yes", - DMX_BUILD_USB="no") -dnl Linux sources in DMX require - AC_CHECK_HEADER([linux/keyboard.h], DMX_BUILD_LNX="yes", - DMX_BUILD_LNX="no") - AC_SUBST(XDMXCONFIG_DEP_CFLAGS) - AC_SUBST(XDMXCONFIG_DEP_LIBS) - PKG_CHECK_MODULES([DMXEXAMPLES_DEP], [$LIBDMX $LIBXEXT x11]) - AC_SUBST(DMXEXAMPLES_DEP_LIBS) - PKG_CHECK_MODULES([DMXXMUEXAMPLES_DEP], [$LIBDMX xmu $LIBXEXT x11]) - AC_SUBST(DMXXMUEXAMPLES_DEP_LIBS) - PKG_CHECK_MODULES([DMXXIEXAMPLES_DEP], [$LIBDMX $LIBXI $LIBXEXT x11]) - AC_SUBST(DMXXIEXAMPLES_DEP_LIBS) - PKG_CHECK_MODULES([XTSTEXAMPLES_DEP], [$LIBXTST $LIBXEXT x11]) - AC_SUBST(XTSTEXAMPLES_DEP_LIBS) - PKG_CHECK_MODULES([XRESEXAMPLES_DEP], [xres $LIBXEXT x11]) - AC_SUBST(XRESEXAMPLES_DEP_LIBS) - PKG_CHECK_MODULES([X11EXAMPLES_DEP], [$LIBXEXT x11]) - AC_SUBST(X11EXAMPLES_DEP_LIBS) - -fi -AM_CONDITIONAL([DMX_BUILD_LNX], [test "x$DMX_BUILD_LNX" = xyes]) -AM_CONDITIONAL([DMX_BUILD_USB], [test "x$DMX_BUILD_USB" = xyes]) - -dnl kdrive DDX - -XEPHYR_LIBS= -XEPHYR_INCS= - -AM_CONDITIONAL(KDRIVE, [test x$KDRIVE = xyes]) - -if test "$KDRIVE" = yes; then - AC_DEFINE(KDRIVESERVER,1,[Build Kdrive X server]) - AC_DEFINE(KDRIVEDDXACTIONS,,[Build kdrive ddx]) - - AC_CHECK_HEADERS([linux/fb.h]) - if test "$ac_cv_header_linux_fb_h" = yes && test "x$XFBDEV" = xauto; then - XFBDEV=yes - fi - - if test "x$XFBDEV" = xyes; then - KDRIVEFBDEVLIB=yes - AC_DEFINE(KDRIVEFBDEV, 1, [Build fbdev-based kdrive server]) - fi - - - PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [HAVE_TSLIB="yes"], [HAVE_TSLIB="no"]) - if test "x$HAVE_TSLIB" = xno; then - AC_CHECK_LIB(ts, ts_open, [ - HAVE_TSLIB="yes" - TSLIB_LIBS="-lts" - ]) - fi - - if test "xTSLIB" = xauto; then - TSLIB="$HAVE_TSLIB" - fi - - if test "x$TSLIB" = xyes; then - if ! test "x$HAVE_TSLIB" = xyes; then - AC_MSG_ERROR([tslib must be installed to build the tslib driver. See http://tslib.berlios.de/]) - else - AC_DEFINE(TSLIB, 1, [Have tslib support]) - fi - fi - - if test "x$KDRIVE_KBD" = xyes; then - AC_DEFINE(KDRIVE_KBD, 1, [Enable KDrive kbd driver]) - fi - if test "x$KDRIVE_EVDEV" = xyes; then - AC_DEFINE(KDRIVE_EVDEV, 1, [Enable KDrive evdev driver]) - fi - if test "x$KDRIVE_MOUSE" = xyes; then - AC_DEFINE(KDRIVE_MOUSE, 1, [Enable KDrive mouse driver]) - fi - - XEPHYR_REQUIRED_LIBS="x11 $LIBXEXT xau xdmcp" - if test "x$XV" = xyes; then - XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xv" - fi - if test "x$DRI" = xyes && test "x$GLX" = xyes; then - XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS $LIBGL libdrm" - fi - - PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS, [xephyr="yes"], [xephyr="no"]) - if test "x$XEPHYR" = xauto; then - XEPHYR=$xephyr - fi - if test "x$XEPHYR" = xyes && test "x$xephyr" = xno; then - AC_MSG_ERROR([Xephyr dependencies missing]) - fi - - # Xephyr needs nanosleep() which is in librt on Solaris - AC_CHECK_FUNC([nanosleep], [], - AC_CHECK_LIB([rt], [nanosleep], XEPHYR_LIBS="$XEPHYR_LIBS -lrt")) - - # damage shadow extension glx (NOTYET) fb mi - KDRIVE_INC='-I$(top_srcdir)/hw/kdrive/src' - KDRIVE_PURE_INCS="$KDRIVE_INC $MIEXT_SYNC_INC $MIEXT_DAMAGE_INC $MIEXT_SHADOW_INC $XEXT_INC $FB_INC $MI_INC" - KDRIVE_OS_INC='-I$(top_srcdir)/hw/kdrive/linux' - KDRIVE_INCS="$KDRIVE_PURE_INCS $KDRIVE_OS_INC" - - KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS" - - KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB" - KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.la' - case $host_os in - *linux*) - KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.la' - KDRIVELINUX=yes - if test "x$KDRIVE_EVDEV" = xauto; then - KDRIVE_EVDEV=yes - fi - if test "x$KDRIVE_KBD" = xauto; then - KDRIVE_KBD=yes - fi - if test "x$KDRIVE_MOUSE" = xauto; then - KDRIVE_MOUSE=yes - fi - ;; - *) - if test "x$KDRIVE_EVDEV" = xauto; then - KDRIVE_EVDEV=no - fi - if test "x$KDRIVE_KBD" = xauto; then - KDRIVE_KBD=no - fi - if test "x$KDRIVE_MOUSE" = xauto; then - KDRIVE_MOUSE=no - fi - ;; - esac - KDRIVE_STUB_LIB='$(top_builddir)/hw/kdrive/src/libkdrivestubs.la' - KDRIVE_LOCAL_LIBS="$MAIN_LIB $DIX_LIB $KDRIVE_LIB $KDRIVE_STUB_LIB" - KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS" - KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB" - KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS $TSLIB_LIBS" - - AC_SUBST([XEPHYR_LIBS]) - AC_SUBST([XEPHYR_INCS]) -fi -AC_SUBST([KDRIVE_INCS]) -AC_SUBST([KDRIVE_PURE_INCS]) -AC_SUBST([KDRIVE_CFLAGS]) -AC_SUBST([KDRIVE_PURE_LIBS]) -AC_SUBST([KDRIVE_LOCAL_LIBS]) -AC_SUBST([KDRIVE_LIBS]) -AM_CONDITIONAL(KDRIVELINUX, [test "x$KDRIVELINUX" = xyes]) -AM_CONDITIONAL(KDRIVE_EVDEV, [test "x$KDRIVE_EVDEV" = xyes]) -AM_CONDITIONAL(KDRIVE_KBD, [test "x$KDRIVE_KBD" = xyes]) -AM_CONDITIONAL(KDRIVE_MOUSE, [test "x$KDRIVE_MOUSE" = xyes]) -AM_CONDITIONAL(TSLIB, [test "x$HAVE_TSLIB" = xyes]) -AM_CONDITIONAL(KDRIVEFBDEV, [test "x$XFBDEV" = xyes]) -AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes]) -AM_CONDITIONAL(BUILD_KDRIVEFBDEVLIB, [test "x$KDRIVE" = xyes && test "x$KDRIVEFBDEVLIB" = xyes]) -AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes]) - -dnl and the rest of these are generic, so they're in config.h -dnl -dnl though, thanks to the passing of some significant amount of time, the -dnl above is probably a complete fallacy, and you should not rely on it. -dnl but this is still actually better than imake, honest. -daniels - -AC_TRY_COMPILE([ -#include -#ifndef __GLIBC__ -#error not glibc -#endif -], [], [AC_DEFINE(_GNU_SOURCE, 1, - [ Enable GNU and other extensions to the C environment for glibc])]) - -AC_DEFINE_DIR(PROJECTROOT, prefix, [Overall prefix]) - -AC_SUBST([RELEASE_DATE]) -BUILD_DATE="`date +'%Y%m%d'`" -AC_SUBST([BUILD_DATE]) -BUILD_TIME="`date +'1%H%M%S'`" -AC_SUBST([BUILD_TIME]) - -DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS" - -AC_SUBST([DIX_CFLAGS]) - -AC_SUBST([libdir]) -AC_SUBST([exec_prefix]) -AC_SUBST([prefix]) - -AC_OUTPUT([ -Makefile -glx/Makefile -include/Makefile -composite/Makefile -damageext/Makefile -dbe/Makefile -dix/Makefile -doc/Makefile -doc/man/Makefile -doc/xml/Makefile -doc/xml/dtrace/Makefile -doc/xml/xserver.ent -fb/Makefile -record/Makefile -config/Makefile -mi/Makefile -miext/Makefile -miext/sync/Makefile -miext/damage/Makefile -miext/shadow/Makefile -miext/cw/Makefile -miext/rootless/Makefile -os/Makefile -randr/Makefile -render/Makefile -xkb/Makefile -Xext/Makefile -Xi/Makefile -xfixes/Makefile -exa/Makefile -hw/Makefile -hw/xfree86/Makefile -hw/xfree86/common/Makefile -hw/xfree86/common/xf86Build.h -hw/xfree86/ddc/Makefile -hw/xfree86/dixmods/Makefile -hw/xfree86/dixmods/extmod/Makefile -hw/xfree86/doc/Makefile -hw/xfree86/doc/devel/Makefile -hw/xfree86/doc/man/Makefile -hw/xfree86/doc/sgml/Makefile -hw/xfree86/dri/Makefile -hw/xfree86/dri2/Makefile -hw/xfree86/exa/Makefile -hw/xfree86/exa/man/Makefile -hw/xfree86/fbdevhw/Makefile -hw/xfree86/fbdevhw/man/Makefile -hw/xfree86/i2c/Makefile -hw/xfree86/int10/Makefile -hw/xfree86/loader/Makefile -hw/xfree86/modes/Makefile -hw/xfree86/os-support/Makefile -hw/xfree86/os-support/bsd/Makefile -hw/xfree86/os-support/bus/Makefile -hw/xfree86/os-support/hurd/Makefile -hw/xfree86/os-support/misc/Makefile -hw/xfree86/os-support/linux/Makefile -hw/xfree86/os-support/solaris/Makefile -hw/xfree86/parser/Makefile -hw/xfree86/ramdac/Makefile -hw/xfree86/shadowfb/Makefile -hw/xfree86/vbe/Makefile -hw/xfree86/vgahw/Makefile -hw/xfree86/x86emu/Makefile -hw/xfree86/xaa/Makefile -hw/xfree86/utils/Makefile -hw/xfree86/utils/man/Makefile -hw/xfree86/utils/cvt/Makefile -hw/xfree86/utils/gtf/Makefile -hw/dmx/config/Makefile -hw/dmx/config/man/Makefile -hw/dmx/doc/Makefile -hw/dmx/examples/Makefile -hw/dmx/input/Makefile -hw/dmx/glxProxy/Makefile -hw/dmx/Makefile -hw/dmx/man/Makefile -hw/vfb/Makefile -hw/vfb/man/Makefile -hw/xnest/Makefile -hw/xnest/man/Makefile -hw/xwin/Makefile -hw/xwin/glx/Makefile -hw/xwin/man/Makefile -hw/xquartz/Makefile -hw/xquartz/GL/Makefile -hw/xquartz/bundle/Makefile -hw/xquartz/man/Makefile -hw/xquartz/mach-startup/Makefile -hw/xquartz/pbproxy/Makefile -hw/xquartz/xpr/Makefile -hw/kdrive/Makefile -hw/kdrive/ephyr/Makefile -hw/kdrive/ephyr/man/Makefile -hw/kdrive/fake/Makefile -hw/kdrive/fbdev/Makefile -hw/kdrive/linux/Makefile -hw/kdrive/src/Makefile -test/Makefile -test/xi2/Makefile -xorg-server.pc -]) +dnl Copyright © 2003-2007 Keith Packard, Daniel Stone +dnl +dnl Permission is hereby granted, free of charge, to any person obtaining a +dnl copy of this software and associated documentation files (the "Software"), +dnl to deal in the Software without restriction, including without limitation +dnl the rights to use, copy, modify, merge, publish, distribute, sublicense, +dnl and/or sell copies of the Software, and to permit persons to whom the +dnl Software is furnished to do so, subject to the following conditions: +dnl +dnl The above copyright notice and this permission notice (including the next +dnl paragraph) shall be included in all copies or substantial portions of the +dnl Software. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +dnl DEALINGS IN THE SOFTWARE. +dnl +dnl Authors: Keith Packard +dnl Daniel Stone +dnl an unwitting cast of miscellaneous others +dnl +dnl Process this file with autoconf to create configure. + +AC_PREREQ(2.57) +AC_INIT([xorg-server], 1.9.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2011-2-18" +AC_CONFIG_SRCDIR([Makefile.am]) +AM_INIT_AUTOMAKE([foreign dist-bzip2]) +AM_MAINTAINER_MODE + +# Require xorg-macros minimum of 1.10 for XORG_CHECK_SGML_DOCTOOLS +m4_ifndef([XORG_MACROS_VERSION], + [m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.10) +XORG_DEFAULT_OPTIONS +XORG_WITH_DOXYGEN(1.6.1) +XORG_CHECK_SGML_DOCTOOLS(1.5) + +m4_ifndef([XORG_FONT_MACROS_VERSION], [m4_fatal([must install fontutil 1.1 or later before running autoconf/autogen])]) +XORG_FONT_MACROS_VERSION(1.1) + +dnl this gets generated by autoheader, and thus contains all the defines. we +dnl don't ever actually use it, internally. +AC_CONFIG_HEADERS(include/do-not-use-config.h) +dnl xorg-server.h is an external header, designed to be included by loadable +dnl drivers. +AC_CONFIG_HEADERS(include/xorg-server.h) +dnl dix-config.h covers most of the DIX (i.e. everything but the DDX, not just +dnl dix/). +AC_CONFIG_HEADERS(include/dix-config.h) +dnl xorg-config.h covers the Xorg DDX. +AC_CONFIG_HEADERS(include/xorg-config.h) +dnl xkb-config.h covers XKB for the Xorg and Xnest DDXs. +AC_CONFIG_HEADERS(include/xkb-config.h) +dnl xwin-config.h covers the XWin DDX. +AC_CONFIG_HEADERS(include/xwin-config.h) +dnl kdrive-config.h covers the kdrive DDX +AC_CONFIG_HEADERS(include/kdrive-config.h) +dnl version-config.h covers the version numbers so they can be bumped without +dnl forcing an entire recompile.x +AC_CONFIG_HEADERS(include/version-config.h) + +AM_PROG_AS +AC_PROG_LN_S +AC_LIBTOOL_WIN32_DLL +AC_DISABLE_STATIC +AC_PROG_LIBTOOL +AC_PROG_MAKE_SET +PKG_PROG_PKG_CONFIG +AC_PROG_LEX +AC_PROG_YACC +AC_SYS_LARGEFILE +XORG_PROG_RAWCPP + +# Quoted so that make will expand $(CWARNFLAGS) in makefiles to allow +# easier overrides at build time. +XSERVER_CFLAGS='$(CWARNFLAGS)' + +dnl Check for dtrace program (needed to build Xserver dtrace probes) +dnl Also checks for , since some Linux distros have an +dnl ISDN trace program named dtrace +AC_ARG_WITH(dtrace, AS_HELP_STRING([--with-dtrace=PATH], + [Enable dtrace probes (default: enabled if dtrace found)]), + [WDTRACE=$withval], [WDTRACE=auto]) +if test "x$WDTRACE" = "xyes" -o "x$WDTRACE" = "xauto" ; then + AC_PATH_PROG(DTRACE, [dtrace], [not_found], [$PATH:/usr/sbin]) + if test "x$DTRACE" = "xnot_found" ; then + if test "x$WDTRACE" = "xyes" ; then + AC_MSG_FAILURE([dtrace requested but not found]) + fi + WDTRACE="no" + else + AC_CHECK_HEADER(sys/sdt.h, [HAS_SDT_H="yes"], [HAS_SDT_H="no"]) + if test "x$WDTRACE" = "xauto" -a "x$HAS_SDT_H" = "xno" ; then + WDTRACE="no" + fi + fi +fi +if test "x$WDTRACE" != "xno" ; then + AC_DEFINE(XSERVER_DTRACE, 1, + [Define to 1 if the DTrace Xserver provider probes should be built in.]) + +# Solaris/OpenSolaris require dtrace -G to build dtrace probe information into +# object files, and require linking with those as relocatable objects, not .a +# archives. MacOS X handles all this in the normal compiler toolchain, and on +# some releases (like Tiger), will error out on dtrace -G. For now, other +# platforms with Dtrace ports are assumed to support -G (the FreeBSD and Linux +# ports appear to, based on my web searches, but have not yet been tested). + case $host_os in + darwin*) SPECIAL_DTRACE_OBJECTS=no ;; + *) SPECIAL_DTRACE_OBJECTS=yes ;; + esac +fi +AM_CONDITIONAL(XSERVER_DTRACE, [test "x$WDTRACE" != "xno"]) +AM_CONDITIONAL(SPECIAL_DTRACE_OBJECTS, [test "x$SPECIAL_DTRACE_OBJECTS" = "xyes"]) + +AC_HEADER_DIRENT +AC_HEADER_STDC +AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h dlfcn.h stropts.h fnmatch.h sys/utsname.h]) + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_BIGENDIAN([ENDIAN="X_BIG_ENDIAN"], [ENDIAN="X_LITTLE_ENDIAN"]) + +AC_CHECK_SIZEOF([unsigned long]) +if test "$ac_cv_sizeof_unsigned_long" = 8; then + AC_DEFINE(_XSERVER64, 1, [Define to 1 if unsigned long is 64 bits.]) +fi + +AC_TYPE_PID_T + +# Checks for headers/macros for byte swapping +# Known variants: +# bswap_16, bswap_32, bswap_64 (glibc) +# __swap16, __swap32, __swap64 (OpenBSD) +# bswap16, bswap32, bswap64 (other BSD's) +# and a fallback to local macros if none of the above are found + +# if is found, assume it's the correct version +AC_CHECK_HEADERS([byteswap.h]) + +# if is found, have to check which version +AC_CHECK_HEADER([sys/endian.h], [HAVE_SYS_ENDIAN_H="yes"], [HAVE_SYS_ENDIAN_H="no"]) + +if test "x$HAVE_SYS_ENDIAN_H" = "xyes" ; then + AC_MSG_CHECKING([for __swap16 variant of byteswapping macros]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([ +#include +#include + ], [ +int a = 1, b; +b = __swap16(a); + ]) +], [SYS_ENDIAN__SWAP='yes'], [SYS_ENDIAN__SWAP='no']) + AC_MSG_RESULT([$SYS_ENDIAN__SWAP]) + + AC_MSG_CHECKING([for bswap16 variant of byteswapping macros]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([ +#include +#include + ], [ +int a = 1, b; +b = bswap16(a); + ]) +], [SYS_ENDIAN_BSWAP='yes'], [SYS_ENDIAN_BSWAP='no']) + AC_MSG_RESULT([$SYS_ENDIAN_BSWAP]) + + if test "$SYS_ENDIAN_BSWAP" = "yes" ; then + USE_SYS_ENDIAN_H=yes + BSWAP=bswap + else + if test "$SYS_ENDIAN__SWAP" = "yes" ; then + USE_SYS_ENDIAN_H=yes + BSWAP=__swap + else + USE_SYS_ENDIAN_H=no + fi + fi + + if test "$USE_SYS_ENDIAN_H" = "yes" ; then + AC_DEFINE([USE_SYS_ENDIAN_H], 1, + [Define to use byteswap macros from ]) + AC_DEFINE_UNQUOTED([bswap_16], ${BSWAP}16, + [Define to 16-bit byteswap macro]) + AC_DEFINE_UNQUOTED([bswap_32], ${BSWAP}32, + [Define to 32-bit byteswap macro]) + AC_DEFINE_UNQUOTED([bswap_64], ${BSWAP}64, + [Define to 64-bit byteswap macro]) + fi +fi + +dnl Check to see if dlopen is in default libraries (like Solaris, which +dnl has it in libc), or if libdl is needed to get it. +AC_CHECK_FUNC([dlopen], [], + AC_CHECK_LIB([dl], [dlopen], DLOPEN_LIBS="-ldl")) +AC_SUBST(DLOPEN_LIBS) + +dnl Checks for library functions. +AC_FUNC_VPRINTF +AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \ + strtol getopt getopt_long vsnprintf walkcontext backtrace \ + getisax getzoneid shmctl64 strcasestr ffs vasprintf]) +AC_FUNC_ALLOCA +dnl Old HAS_* names used in os/*.c. +AC_CHECK_FUNC([getdtablesize], + AC_DEFINE(HAS_GETDTABLESIZE, 1, [Have the 'getdtablesize' function.])) +AC_CHECK_FUNC([getifaddrs], + AC_DEFINE(HAS_GETIFADDRS, 1, [Have the 'getifaddrs' function.])) +AC_CHECK_FUNC([getpeereid], + AC_DEFINE(HAS_GETPEEREID, 1, [Have the 'getpeereid' function.])) +AC_CHECK_FUNC([getpeerucred], + AC_DEFINE(HAS_GETPEERUCRED, 1, [Have the 'getpeerucred' function.])) +AC_CHECK_FUNC([strlcat], HAVE_STRLCAT=yes, HAVE_STRLCAT=no) +AM_CONDITIONAL(NEED_STRLCAT, [test x$HAVE_STRLCAT = xno]) +AC_CHECK_FUNC([strlcpy], AC_DEFINE(HAS_STRLCPY, 1, [Have the 'strlcpy' function])) + +AM_CONDITIONAL(NEED_VSNPRINTF, [test x$HAVE_VSNPRINTF = xno]) + +dnl Check for mmap support for Xvfb +AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP, 1, [Have the 'mmap' function.])) + +dnl Find the math libary +AC_CHECK_LIB(m, sqrt) +AC_CHECK_LIB(m, cbrt, AC_DEFINE(HAVE_CBRT, 1, [Have the 'cbrt' function])) + +AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h]) + +dnl AGPGART headers +AC_CHECK_HEADERS([linux/agpgart.h sys/agpio.h sys/agpgart.h], AGP=yes) +AM_CONDITIONAL(AGP, [test "x$AGP" = xyes]) + +dnl APM header +AC_CHECK_HEADERS([linux/apm_bios.h], LNXAPM=yes) +AM_CONDITIONAL(LNXAPM, [test "x$LNXAPM" = xyes]) + +dnl fbdev header +AC_CHECK_HEADERS([linux/fb.h], FBDEV=yes) +AM_CONDITIONAL(FBDEVHW, [test "x$FBDEV" = xyes]) + +dnl MTRR header +AC_CHECK_HEADERS([asm/mtrr.h], ac_cv_asm_mtrr_h=yes) +if test "x$ac_cv_asm_mtrr_h" = xyes; then + HAVE_MTRR=yes +fi + +dnl BSD MTRR header +AC_CHECK_HEADERS([sys/memrange.h], ac_cv_memrange_h=yes) +if test "x$ac_cv_memrange_h" = xyes; then + HAVE_MTRR=yes +fi + +if test "x$HAVE_MTRR" = xyes; then + AC_DEFINE(HAS_MTRR_SUPPORT, 1, [MTRR support available]) +fi + +dnl A NetBSD MTRR header +AC_CHECK_HEADERS([machine/mtrr.h], ac_cv_machine_mtrr_h=yes) +if test "x$ac_cv_machine_mtrr_h" = xyes; then + AC_DEFINE(HAS_MTRR_BUILTIN, 1, [Define to 1 if NetBSD built-in MTRR + support is available]) +fi + +dnl FreeBSD kldload support (sys/linker.h) +AC_CHECK_HEADERS([sys/linker.h], + [ac_cv_sys_linker_h=yes], + [ac_cv_sys_linker_h=no], + [#include ]) +AM_CONDITIONAL(FREEBSD_KLDLOAD, [test "x$ac_cv_sys_linker_h" = xyes]) + +AC_CACHE_CHECK([for SYSV IPC], + ac_cv_sysv_ipc, + [AC_TRY_LINK([ +#include +#include +#include +],[ +{ + int id; + id = shmget(IPC_PRIVATE, 512, SHM_W | SHM_R); + if (id < 0) return -1; + return shmctl(id, IPC_RMID, 0); +}], + [ac_cv_sysv_ipc=yes], + [ac_cv_sysv_ipc=no])]) +if test "x$ac_cv_sysv_ipc" = xyes; then + AC_DEFINE(HAVE_SYSV_IPC, 1, [Define to 1 if SYSV IPC is available]) +fi + +dnl OpenBSD /dev/xf86 aperture driver +if test -c /dev/xf86 ; then + AC_DEFINE(HAS_APERTURE_DRV, 1, [System has /dev/xf86 aperture driver]) +fi + +dnl BSD APM support +AC_CHECK_HEADER([machine/apmvar.h],[ + AC_CHECK_HEADER([sys/event.h], + ac_cv_BSD_KQUEUE_APM=yes, + ac_cv_BSD_APM=yes)]) + +AM_CONDITIONAL(BSD_APM, [test "x$ac_cv_BSD_APM" = xyes]) +AM_CONDITIONAL(BSD_KQUEUE_APM, [test "x$ac_cv_BSD_KQUEUE_APM" = xyes]) + +dnl glibc backtrace support check (hw/xfree86/common/xf86Events.c) +AC_CHECK_HEADER([execinfo.h],[ + AC_CHECK_LIB(c, backtrace, [ + AC_DEFINE(HAVE_BACKTRACE, 1, [Has backtrace support]) + AC_DEFINE(HAVE_EXECINFO_H, 1, [Have execinfo.h]) + ])] +) + +dnl ARM needs additional compiler flags for proper backtraces if GCC is +dnl used. Compile a dummy program with the -mapcs-frame option. If it +dnl succeeds, we know that we are building for ARM with GCC. +old_CFLAGS="$CFLAGS" +CFLAGS="-mapcs-frame" +AC_COMPILE_IFELSE( + AC_LANG_PROGRAM([[ ]]), + ARM_BACKTRACE_CFLAGS="$CFLAGS", + ARM_BACKTRACE_CFLAGS="" +) +CFLAGS="$old_CFLAGS" +AC_SUBST(ARM_BACKTRACE_CFLAGS) + +dnl --------------------------------------------------------------------------- +dnl Bus options and CPU capabilities. Replaces logic in +dnl hw/xfree86/os-support/bus/Makefile.am, among others. +dnl --------------------------------------------------------------------------- +DEFAULT_INT10="x86emu" + +dnl Override defaults as needed for specific platforms: + +case $host_cpu in + alpha*) + ALPHA_VIDEO=yes + case $host_os in + *freebsd*) SYS_LIBS=-lio ;; + *netbsd*) AC_DEFINE(USE_ALPHA_PIO, 1, [NetBSD PIO alpha IO]) ;; + esac + GLX_ARCH_DEFINES="-D__GLX_ALIGN64 -mieee" + ;; + arm*) + ARM_VIDEO=yes + ;; + i*86) + I386_VIDEO=yes + case $host_os in + *freebsd*) AC_DEFINE(USE_DEV_IO) ;; + *dragonfly*) AC_DEFINE(USE_DEV_IO) ;; + *netbsd*) AC_DEFINE(USE_I386_IOPL) + SYS_LIBS=-li386 + ;; + *openbsd*) AC_DEFINE(USE_I386_IOPL) + SYS_LIBS=-li386 + ;; + esac + ;; + powerpc*) + PPC_VIDEO=yes + case $host_os in + *freebsd*) DEFAULT_INT10=stub ;; + esac + ;; + sparc*) + SPARC64_VIDEO=yes + BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c" + GLX_ARCH_DEFINES="-D__GLX_ALIGN64" + ;; + x86_64*|amd64*) + I386_VIDEO=yes + case $host_os in + *freebsd*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;; + *dragonfly*) AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;; + *netbsd*) AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl]) + SYS_LIBS=-lx86_64 + ;; + *openbsd*) AC_DEFINE(USE_AMD64_IOPL, 1, [BSD AMD64 iopl]) + SYS_LIBS=-lamd64 + ;; + esac + GLX_ARCH_DEFINES="-D__GLX_ALIGN64" + ;; + ia64*) + GLX_ARCH_DEFINES="-D__GLX_ALIGN64" + ;; + s390*) + GLX_ARCH_DEFINES="-D__GLX_ALIGN64" + ;; +esac +AC_SUBST(GLX_ARCH_DEFINES) + +dnl BSD *_video.c selection +AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" = xyes]) +AM_CONDITIONAL(ARM_VIDEO, [test "x$ARM_VIDEO" = xyes]) +AM_CONDITIONAL(I386_VIDEO, [test "x$I386_VIDEO" = xyes]) +AM_CONDITIONAL(PPC_VIDEO, [test "x$PPC_VIDEO" = xyes]) +AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" = xyes]) + +DRI=no +USE_SIGIO_BY_DEFAULT="yes" +dnl it would be nice to autodetect these *CONS_SUPPORTs +case $host_os in + *freebsd* | *dragonfly*) + case $host_os in + kfreebsd*-gnu) ;; + *) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) ;; + esac + AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console]) + AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console]) + AC_DEFINE(SYSCONS_SUPPORT, 1, [System has syscons console]) + DRI=yes + ;; + *netbsd*) + AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) + AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console]) + AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console]) + AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console]) + DRI=yes + ;; + *openbsd*) + AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) + AC_DEFINE(PCVT_SUPPORT, 1, [System has PC console]) + AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console]) + ;; + *linux*) + DRI=yes + ;; + *solaris*) + PKG_CHECK_EXISTS(libdrm, DRI=yes, DRI=no) + # Disable use of SIGIO by default until some system bugs are + # fixed - see Sun/OpenSolaris bug id 6879897 + USE_SIGIO_BY_DEFAULT="no" + ;; + darwin*) + AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) + ;; + cygwin*) + CFLAGS="$CFLAGS -DFD_SETSIZE=256" + ;; +esac + +dnl augment XORG_RELEASE_VERSION for our snapshot number and to expose the +dnl major number +PVMAJOR=`echo $PACKAGE_VERSION | cut -d . -f 1` +PVS=`echo $PACKAGE_VERSION | cut -d . -f 4 | cut -d - -f 1` +if test "x$PVS" = "x"; then + PVS="0" +fi + +VENDOR_RELEASE="((($PVMAJOR) * 10000000) + (($PVM) * 100000) + (($PVP) * 1000) + $PVS)" +VENDOR_MAN_VERSION="Version ${PACKAGE_VERSION}" + +VENDOR_NAME="The X.Org Foundation" +VENDOR_NAME_SHORT="X.Org" +VENDOR_WEB="http://wiki.x.org" + +m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))]) + +dnl Build options. +AC_ARG_ENABLE(werror, AS_HELP_STRING([--enable-werror], + [Obsolete - use --enable-strict-compilation instead]), + AC_MSG_ERROR([--enable-werror has been replaced by --enable-strict-compilation])) + +AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], + [Enable debugging (default: disabled)]), + [DEBUGGING=$enableval], [DEBUGGING=no]) +AC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests], + [Enable unit-tests (default: auto)]), + [UNITTESTS=$enableval], [UNITTESTS=auto]) +AC_ARG_ENABLE(use-sigio-by-default, AS_HELP_STRING([--enable-use-sigio-by-default] + [Enable SIGIO input handlers by default (default: $USE_SIGIO_BY_DEFAULT)]), + [USE_SIGIO_BY_DEFAULT=$enableval], []) +AC_ARG_WITH(int10, AS_HELP_STRING([--with-int10=BACKEND], [int10 backend: vm86, x86emu or stub]), + [INT10="$withval"], + [INT10="$DEFAULT_INT10"]) +AC_ARG_WITH(vendor-name, AS_HELP_STRING([--with-vendor-name=VENDOR], + [Vendor string reported by the server]), + [ VENDOR_NAME="$withval" ], []) +AC_ARG_WITH(vendor-name-short, AS_HELP_STRING([--with-vendor-name-short=VENDOR], + [Short version of vendor string reported by the server]), + [ VENDOR_NAME_SHORT="$withval" ], []) +AC_ARG_WITH(vendor-web, AS_HELP_STRING([--with-vendor-web=URL], + [Vendor web address reported by the server]), + [ VENDOR_WEB="$withval" ], []) +AC_ARG_WITH(module-dir, AS_HELP_STRING([--with-module-dir=DIR], + [Directory where modules are installed (default: $libdir/xorg/modules)]), + [ moduledir="$withval" ], + [ moduledir="${libdir}/xorg/modules" ]) +AC_ARG_WITH(log-dir, AS_HELP_STRING([--with-log-dir=DIR], + [Directory where log files are kept (default: $localstatedir/log)]), + [ logdir="$withval" ], + [ logdir="$localstatedir/log" ]) +AC_ARG_WITH(builder-addr, AS_HELP_STRING([--with-builder-addr=ADDRESS], + [Builder address (default: xorg@lists.freedesktop.org)]), + [ BUILDERADDR="$withval" ], + [ BUILDERADDR="xorg@lists.freedesktop.org" ]) +AC_ARG_WITH(os-name, AS_HELP_STRING([--with-os-name=OSNAME], [Name of OS (default: output of "uname -srm")]), + [ OSNAME="$withval" ], + [ OSNAME=`uname -srm` ]) +AC_ARG_WITH(os-vendor, AS_HELP_STRING([--with-os-vendor=OSVENDOR], [Name of OS vendor]), + [ OSVENDOR="$withval" ], + [ OSVENDOR="" ]) +AC_ARG_WITH(builderstring, AS_HELP_STRING([--with-builderstring=BUILDERSTRING], [Additional builder string]), + [ BUILDERSTRING="$withval" ] + [ ]) + +dnl Determine font path +XORG_FONTROOTDIR +XORG_FONTSUBDIR(FONTMISCDIR, fontmiscdir, misc) +XORG_FONTSUBDIR(FONTOTFDIR, fontotfdir, OTF) +XORG_FONTSUBDIR(FONTTTFDIR, fontttfdir, TTF) +XORG_FONTSUBDIR(FONTTYPE1DIR, fonttype1dir, Type1) +XORG_FONTSUBDIR(FONT75DPIDIR, font75dpidir, 75dpi) +XORG_FONTSUBDIR(FONT100DPIDIR, font100dpidir, 100dpi) + +dnl Uses --default-font-path if set, otherwise checks for /etc/X11/fontpath.d, +dnl otherwise uses standard subdirectories of FONTROOTDIR. When cross +dnl compiling, assume default font path uses standard FONTROOTDIR directories. +DEFAULT_FONT_PATH="${FONTMISCDIR}/,${FONTTTFDIR}/,${FONTOTFDIR}/,${FONTTYPE1DIR}/,${FONT100DPIDIR}/,${FONT75DPIDIR}/" +if test "$cross_compiling" != yes; then + AC_CHECK_FILE([${sysconfdir}/X11/fontpath.d], + [DEFAULT_FONT_PATH='catalogue:${sysconfdir}/X11/fontpath.d'], + [case $host_os in + darwin*) DEFAULT_FONT_PATH="${DEFAULT_FONT_PATH},/Library/Fonts,/System/Library/Fonts" ;; + esac]) +fi +AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]), + [ FONTPATH="$withval" ], + [ FONTPATH="${DEFAULT_FONT_PATH}" ]) + +AC_MSG_CHECKING([for default font path]) +AC_MSG_RESULT([$FONTPATH]) + +AC_ARG_WITH(xkb-path, AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: ${datadir}/X11/xkb)]), + [ XKBPATH="$withval" ], + [ XKBPATH="${datadir}/X11/xkb" ]) +AC_ARG_WITH(xkb-output, AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]), + [ XKBOUTPUT="$withval" ], + [ XKBOUTPUT="compiled" ]) +AC_ARG_WITH(default-xkb-rules, AS_HELP_STRING([--with-default-xkb-rules=RULES], + [Keyboard ruleset (default: base/evdev)]), + [ XKB_DFLT_RULES="$withval" ], + [ XKB_DFLT_RULES="" ]) +AC_ARG_WITH(default-xkb-model, AS_HELP_STRING([--with-default-xkb-model=MODEL], + [Keyboard model (default: pc105)]), + [ XKB_DFLT_MODEL="$withval" ], + [ XKB_DFLT_MODEL="pc105" ]) +AC_ARG_WITH(default-xkb-layout, AS_HELP_STRING([--with-default-xkb-layout=LAYOUT], + [Keyboard layout (default: us)]), + [ XKB_DFLT_LAYOUT="$withval" ], + [ XKB_DFLT_LAYOUT="us" ]) +AC_ARG_WITH(default-xkb-variant, AS_HELP_STRING([--with-default-xkb-variant=VARIANT], + [Keyboard variant (default: (none))]), + [ XKB_DFLT_VARIANT="$withval" ], + [ XKB_DFLT_VARIANT="" ]) +AC_ARG_WITH(default-xkb-options, AS_HELP_STRING([--with-default-xkb-options=OPTIONS], + [Keyboard layout options (default: (none))]), + [ XKB_DFLT_OPTIONS="$withval" ], + [ XKB_DFLT_OPTIONS="" ]) +AC_ARG_WITH(serverconfig-path, AS_HELP_STRING([--with-serverconfig-path=PATH], + [Directory where ancillary server config files are installed (default: ${libdir}/xorg)]), + [ SERVERCONFIG="$withval" ], + [ SERVERCONFIG="${libdir}/xorg" ]) +AC_ARG_WITH(apple-applications-dir,AS_HELP_STRING([--with-apple-applications-dir=PATH], [Path to the Applications directory (default: /Applications/Utilities)]), + [ APPLE_APPLICATIONS_DIR="${withval}" ], + [ APPLE_APPLICATIONS_DIR="/Applications/Utilities" ]) +AC_SUBST([APPLE_APPLICATIONS_DIR]) +AC_ARG_WITH(apple-application-name,AS_HELP_STRING([--with-apple-application-name=NAME], [Name for the .app (default: X11)]), + [ APPLE_APPLICATION_NAME="${withval}" ], + [ APPLE_APPLICATION_NAME="X11" ]) +AC_SUBST([APPLE_APPLICATION_NAME]) +AC_ARG_WITH(launchd-id-prefix, AS_HELP_STRING([--with-launchd-id-prefix=PATH], [Prefix to use for launchd identifiers (default: org.x)]), + [ LAUNCHD_ID_PREFIX="${withval}" ], + [ LAUNCHD_ID_PREFIX="org.x" ]) +AC_SUBST([LAUNCHD_ID_PREFIX]) +AC_DEFINE_UNQUOTED(LAUNCHD_ID_PREFIX, "$LAUNCHD_ID_PREFIX", [Prefix to use for launchd identifiers]) +AC_ARG_ENABLE(sparkle,AS_HELP_STRING([--enable-sparkle], [Enable updating of X11.app using the Sparkle Framework (default: disabled)]), + [ XQUARTZ_SPARKLE="${enableval}" ], + [ XQUARTZ_SPARKLE="no" ]) +AC_SUBST([XQUARTZ_SPARKLE]) +AC_ARG_ENABLE(install-libxf86config, + AS_HELP_STRING([--enable-install-libxf86config], + [Install libxf86config (default: disabled)]), + [INSTALL_LIBXF86CONFIG=$enableval], + [INSTALL_LIBXF86CONFIG=no]) +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)]), + [AIGLX=$enableval], + [AIGLX=yes]) +AX_TLS +AC_ARG_ENABLE(glx-tls, AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: auto)]), + [GLX_USE_TLS=$enableval], + [GLX_USE_TLS=no + if test "${ac_cv_tls}" != "none" ; then + GLX_USE_TLS=yes + fi]) +AC_SUBST(GLX_TLS, ${GLX_USE_TLS}) + +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(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]) +AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Build XvMC extension (default: enabled)]), [XVMC=$enableval], [XVMC=yes]) +AC_ARG_ENABLE(dga, AS_HELP_STRING([--disable-dga], [Build DGA extension (default: auto)]), [DGA=$enableval], [DGA=auto]) +AC_ARG_ENABLE(screensaver, AS_HELP_STRING([--disable-screensaver], [Build ScreenSaver extension (default: enabled)]), [SCREENSAVER=$enableval], [SCREENSAVER=yes]) +AC_ARG_ENABLE(xdmcp, AS_HELP_STRING([--disable-xdmcp], [Build XDMCP extension (default: auto)]), [XDMCP=$enableval], [XDMCP=auto]) +AC_ARG_ENABLE(xdm-auth-1, AS_HELP_STRING([--disable-xdm-auth-1], [Build XDM-Auth-1 extension (default: auto)]), [XDMAUTH=$enableval], [XDMAUTH=auto]) +AC_ARG_ENABLE(glx, AS_HELP_STRING([--disable-glx], [Build GLX extension (default: enabled)]), [GLX=$enableval], [GLX=yes]) +AC_ARG_ENABLE(dri, AS_HELP_STRING([--enable-dri], [Build DRI extension (default: auto)]), [DRI=$enableval]) +AC_ARG_ENABLE(dri2, AS_HELP_STRING([--enable-dri2], [Build DRI2 extension (default: auto)]), [DRI2=$enableval], [DRI2=auto]) +AC_ARG_ENABLE(xinerama, AS_HELP_STRING([--disable-xinerama], [Build Xinerama extension (default: enabled)]), [XINERAMA=$enableval], [XINERAMA=yes]) +AC_ARG_ENABLE(xf86vidmode, AS_HELP_STRING([--disable-xf86vidmode], [Build XF86VidMode extension (default: auto)]), [XF86VIDMODE=$enableval], [XF86VIDMODE=auto]) +AC_ARG_ENABLE(xace, AS_HELP_STRING([--disable-xace], [Build X-ACE extension (default: enabled)]), [XACE=$enableval], [XACE=yes]) +AC_ARG_ENABLE(xselinux, AS_HELP_STRING([--enable-xselinux], [Build SELinux extension (default: disabled)]), [XSELINUX=$enableval], [XSELINUX=no]) +AC_ARG_ENABLE(xcsecurity, AS_HELP_STRING([--enable-xcsecurity], [Build Security extension (default: disabled)]), [XCSECURITY=$enableval], [XCSECURITY=no]) +AC_ARG_ENABLE(xcalibrate, AS_HELP_STRING([--enable-xcalibrate], [Build XCalibrate extension (default: disabled)]), [XCALIBRATE=$enableval], [XCALIBRATE=no]) +AC_ARG_ENABLE(tslib, AS_HELP_STRING([--enable-tslib], [Build kdrive tslib touchscreen support (default: disabled)]), [TSLIB=$enableval], [TSLIB=no]) +AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes]) +AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--enable-xf86bigfont], [Build XF86 Big Font extension (default: disabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=no]) +AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes]) +AC_ARG_ENABLE(config-udev, AS_HELP_STRING([--enable-config-udev], [Build udev support (default: auto)]), [CONFIG_UDEV=$enableval], [CONFIG_UDEV=auto]) +AC_ARG_ENABLE(config-dbus, AS_HELP_STRING([--enable-config-dbus], [Build D-BUS API support (default: no)]), [CONFIG_DBUS_API=$enableval], [CONFIG_DBUS_API=no]) +AC_ARG_ENABLE(config-hal, AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto]) +AC_ARG_ENABLE(xfree86-utils, AS_HELP_STRING([--enable-xfree86-utils], [Build xfree86 DDX utilities (default: enabled)]), [XF86UTILS=$enableval], [XF86UTILS=yes]) +AC_ARG_ENABLE(xaa, AS_HELP_STRING([--enable-xaa], [Build XAA (default: enabled)]), [XAA=$enableval], [XAA=yes]) +AC_ARG_ENABLE(vgahw, AS_HELP_STRING([--enable-vgahw], [Build Xorg with vga access (default: enabled)]), [VGAHW=$enableval], [VGAHW=yes]) +AC_ARG_ENABLE(vbe, AS_HELP_STRING([--enable-vbe], [Build Xorg with VBE module (default: enabled)]), [VBE=$enableval], [VBE=yes]) +AC_ARG_ENABLE(int10-module, AS_HELP_STRING([--enable-int10-module], [Build Xorg with int10 module (default: enabled)]), [INT10MODULE=$enableval], [INT10MODULE=yes]) +AC_ARG_ENABLE(windowswm, AS_HELP_STRING([--enable-windowswm], [Build XWin with WindowsWM extension (default: no)]), [WINDOWSWM=$enableval], [WINDOWSWM=no]) +AC_ARG_ENABLE(libdrm, AS_HELP_STRING([--enable-libdrm], [Build Xorg with libdrm support (default: enabled)]), [DRM=$enableval],[DRM=yes]) + +dnl DDXes. +AC_ARG_ENABLE(xorg, AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto]) +AC_ARG_ENABLE(dmx, AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=auto]) +AC_ARG_ENABLE(xvfb, AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes]) +AC_ARG_ENABLE(xnest, AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto]) +AC_ARG_ENABLE(xquartz, AS_HELP_STRING([--enable-xquartz], [Build Xquartz server for OS-X (default: auto)]), [XQUARTZ=$enableval], [XQUARTZ=auto]) +AC_ARG_ENABLE(standalone-xpbproxy, AS_HELP_STRING([--enable-standalone-xpbproxy], [Build a standalone xpbproxy (in addition to the one integrated into Xquartz as a separate thread) (default: no)]), [STANDALONE_XPBPROXY=$enableval], [STANDALONE_XPBPROXY=no]) +AC_ARG_ENABLE(xwin, AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto]) +dnl kdrive and its subsystems +AC_ARG_ENABLE(kdrive, AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no]) +AC_ARG_ENABLE(xephyr, AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto]) +AC_ARG_ENABLE(xfake, AS_HELP_STRING([--enable-xfake], [Build the kdrive 'fake' server (default: auto)]), [XFAKE=$enableval], [XFAKE=auto]) +AC_ARG_ENABLE(xfbdev, AS_HELP_STRING([--enable-xfbdev], [Build the kdrive framebuffer device server (default: auto)]), [XFBDEV=$enableval], [XFBDEV=auto]) +dnl kdrive options +AC_ARG_ENABLE(kdrive-kbd, AS_HELP_STRING([--enable-kdrive-kbd], [Build kbd driver for kdrive (default: auto)]), [KDRIVE_KBD=$enableval], [KDRIVE_KBD=auto]) +AC_ARG_ENABLE(kdrive-mouse, AC_HELP_STRING([--enable-kdrive-mouse], [Build mouse driver for kdrive (default: auto)]), [KDRIVE_MOUSE=$enableval], [KDRIVE_MOUSE=auto]) +AC_ARG_ENABLE(kdrive-evdev, AC_HELP_STRING([--enable-kdrive-evdev], [Build evdev driver for kdrive (default: auto)]), [KDRIVE_EVDEV=$enableval], [KDRIVE_EVDEV=auto]) + + +dnl chown/chmod to be setuid root as part of build +dnl Replaces InstallXserverSetUID in imake +AC_ARG_ENABLE(install-setuid, + AS_HELP_STRING([--enable-install-setuid], + [Install Xorg server as owned by root with setuid bit (default: auto)]), + [SETUID=$enableval], [SETUID=auto]) +AC_MSG_CHECKING([to see if we can install the Xorg server as root]) +if test "x$SETUID" = "xauto" ; then + case $host_os in + cygwin*) SETUID="no" ;; + darwin*) SETUID="no" ;; + *) + case $host_cpu in + sparc) SETUID="no" ;; + *) SETUID="yes" ;; + esac + esac + if test "x$SETUID" = xyes; then + touch testfile + chown root testfile > /dev/null 2>&1 || SETUID="no" + rm -f testfile + fi +fi +AC_MSG_RESULT([$SETUID]) +AM_CONDITIONAL(INSTALL_SETUID, [test "x$SETUID" = "xyes"]) + +dnl Issue an error if xtrans.m4 was not found and XTRANS_CONNECTION_FLAGS macro +dnl was not expanded, since xorg-server with no transport types is rather useless. +dnl +dnl If you're seeing an error here, be sure you installed the lib/xtrans module +dnl first and if it's not in the default location, that you set the ACLOCAL +dnl environment variable to find it, such as: +dnl ACLOCAL="aclocal -I ${PREFIX}/share/aclocal" +m4_pattern_forbid([^XTRANS_CONNECTION_FLAGS$]) + +# Transport selection macro from xtrans.m4 +XTRANS_CONNECTION_FLAGS + +# Secure RPC detection macro from xtrans.m4 +XTRANS_SECURE_RPC_FLAGS +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 + +XORG_ENABLE_DOCS +XORG_ENABLE_DEVEL_DOCS +XORG_WITH_XMLTO(0.0.20) +XORG_WITH_FOP + +dnl Handle installing libxf86config +AM_CONDITIONAL(INSTALL_LIBXF86CONFIG, [test "x$INSTALL_LIBXF86CONFIG" = xyes]) + +dnl DDX Detection... Yes, it's ugly to have it here... but we need to +dnl handle this early on so that we don't require unsupported extensions +case $host_os in + cygwin*) + DGA=no + DRI2=no + XF86VIDMODE=no + XSELINUX=no + XV=no + ;; + darwin*) + DRI2=no + + if test x$XQUARTZ = xauto; then + AC_CACHE_CHECK([whether to build Xquartz],xorg_cv_Carbon_framework,[ + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -framework Carbon" + AC_LINK_IFELSE([char FSFindFolder(); int main() { FSFindFolder(); return 0;}], + [xorg_cv_Carbon_framework=yes], + [xorg_cv_Carbon_framework=no]) + LDFLAGS=$save_LDFLAGS]) + + if test "X$xorg_cv_Carbon_framework" = Xyes; then + XQUARTZ=yes + else + XQUARTZ=no + fi + fi + + if test "x$XQUARTZ" = xyes ; then + XQUARTZ=yes + XVFB=no + XNEST=no + + COMPOSITE=no + DGA=no + DPMSExtension=no + XF86VIDMODE=no + fi + ;; + *) XQUARTZ=no ;; +esac + +dnl --------------------------------------------------------------------------- +dnl Extension section +dnl --------------------------------------------------------------------------- +XEXT_INC='-I$(top_srcdir)/Xext' +XEXT_LIB='$(top_builddir)/Xext/libXext.la' +XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la' + +dnl Optional modules +VIDEOPROTO="videoproto" +COMPOSITEPROTO="compositeproto >= 0.4" +RECORDPROTO="recordproto >= 1.13.99.1" +SCRNSAVERPROTO="scrnsaverproto >= 1.1" +RESOURCEPROTO="resourceproto" +DRIPROTO="xf86driproto >= 2.1.0" +DRI2PROTO="dri2proto >= 2.3" +XINERAMAPROTO="xineramaproto" +BIGFONTPROTO="xf86bigfontproto >= 1.2.0" +XCALIBRATEPROTO="xcalibrateproto" +DGAPROTO="xf86dgaproto >= 2.0.99.1" +GLPROTO="glproto >= 1.4.10" +DMXPROTO="dmxproto >= 2.2.99.1" +VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1" +WINDOWSWMPROTO="windowswmproto" +APPLEWMPROTO="applewmproto >= 1.4" + +dnl Core modules for most extensions, et al. +SDK_REQUIRED_MODULES="[xproto >= 7.0.17] [randrproto >= 1.4] [renderproto >= 0.11] [xextproto >= 7.1.99] [inputproto >= 1.9.99.902] [kbproto >= 1.0.3] fontsproto" +# Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc +AC_SUBST(SDK_REQUIRED_MODULES) + +dnl List of libraries that require a specific version +LIBAPPLEWM="applewm >= 1.4" +LIBDMX="dmx >= 1.0.99.1" +LIBDRI="dri >= 7.8.0" +LIBDRM="libdrm >= 2.3.0" +LIBGL="gl >= 7.1.0" +LIBXEXT="xext >= 1.0.99.4" +LIBXFONT="xfont >= 1.4.2" +LIBXI="xi >= 1.2.99.1" +LIBXTST="xtst >= 1.0.99.2" +LIBPCIACCESS="pciaccess >= 0.8.0" +LIBGLIB="glib-2.0 >= 2.16" +LIBUDEV="libudev >= 143" +LIBSELINUX="libselinux >= 2.0.86" +LIBDBUS="dbus-1 >= 1.0" +LIBPIXMAN="pixman-1 >= 0.15.20" + +dnl Pixman is always required, but we separate it out so we can link +dnl specific modules against it +PKG_CHECK_MODULES(PIXMAN, $LIBPIXMAN) +REQUIRED_LIBS="$REQUIRED_LIBS $LIBPIXMAN $LIBXFONT xau" + +REQUIRED_MODULES="[fixesproto >= 4.1] [damageproto >= 1.1] [xcmiscproto >= 1.2.0] [xtrans >= 1.2.2] [bigreqsproto >= 1.1.0] $SDK_REQUIRED_MODULES" + +if test "x$CONFIG_UDEV" = xyes && + { test "x$CONFIG_DBUS_API" = xyes || test "x$CONFIG_HAL" = xyes; }; then + AC_MSG_ERROR([Hotplugging through both libudev and dbus/hal not allowed]) +fi + +PKG_CHECK_MODULES(UDEV, $LIBUDEV, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no]) +if test "x$CONFIG_UDEV" = xauto; then + CONFIG_UDEV="$HAVE_LIBUDEV" +fi +AM_CONDITIONAL(CONFIG_UDEV, [test "x$CONFIG_UDEV" = xyes]) +if test "x$CONFIG_UDEV" = xyes; then + CONFIG_DBUS_API=no + CONFIG_HAL=no + if ! test "x$HAVE_LIBUDEV" = xyes; then + AC_MSG_ERROR([udev configuration API requested, but libudev is not installed]) + fi + AC_DEFINE(CONFIG_UDEV, 1, [Use libudev for input hotplug]) +fi + +dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas +dnl CONFIG_DBUS_API is true if we want to enable the D-Bus config +dnl API. +PKG_CHECK_MODULES(DBUS, $LIBDBUS, [HAVE_DBUS=yes], [HAVE_DBUS=no]) +if test "x$HAVE_DBUS" = xyes; then + AC_DEFINE(HAVE_DBUS, 1, [Have D-Bus support]) +fi +AM_CONDITIONAL(HAVE_DBUS, [test "x$HAVE_DBUS" = xyes]) + +if test "x$CONFIG_DBUS_API" = xauto; then + CONFIG_DBUS_API="$HAVE_DBUS" +fi +if test "x$CONFIG_DBUS_API" = xyes; then + if ! test "x$HAVE_DBUS" = xyes; then + AC_MSG_ERROR([D-Bus configuration API requested, but D-Bus is not installed.]) + fi + + AC_DEFINE(CONFIG_DBUS_API, 1, [Use the D-Bus input configuration API]) + CONFIG_NEED_DBUS="yes" +fi +AM_CONDITIONAL(CONFIG_DBUS_API, [test "x$CONFIG_DBUS_API" = xyes]) + +PKG_CHECK_MODULES(HAL, hal, [HAVE_HAL=yes], [HAVE_HAL=no]) +if test "x$CONFIG_HAL" = xauto; then + CONFIG_HAL="$HAVE_HAL" +fi +if test "x$CONFIG_HAL" = xyes; then + if ! test "x$HAVE_HAL" = xyes; then + AC_MSG_ERROR([HAL hotplug API requested, but HAL is not installed.]) + fi + + AC_DEFINE(CONFIG_HAL, 1, [Use the HAL hotplug API]) + CONFIG_NEED_DBUS="yes" +fi +AM_CONDITIONAL(CONFIG_HAL, [test "x$CONFIG_HAL" = xyes]) + +if test "x$CONFIG_NEED_DBUS" = xyes; then + AC_DEFINE(CONFIG_NEED_DBUS, 1, [Use D-Bus for input hotplug]) +fi +AM_CONDITIONAL(CONFIG_NEED_DBUS, [test "x$CONFIG_NEED_DBUS" = xyes]) + +if test "x$USE_SIGIO_BY_DEFAULT" = xyes; then + USE_SIGIO_BY_DEFAULT_VALUE=TRUE +else + USE_SIGIO_BY_DEFAULT_VALUE=FALSE +fi +AC_DEFINE_UNQUOTED([USE_SIGIO_BY_DEFAULT], [$USE_SIGIO_BY_DEFAULT_VALUE], + [Use SIGIO handlers for input device events by default]) + +AC_MSG_CHECKING([for glibc...]) +AC_PREPROC_IFELSE([ +#include +#ifndef __GLIBC__ +#error +#endif +], glibc=yes, glibc=no) +AC_MSG_RESULT([$glibc]) + +AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes], + [AC_CHECK_LIB([rt], [clock_gettime], [have_clock_gettime=-lrt], + [have_clock_gettime=no])]) + +AC_MSG_CHECKING([for a useful monotonic clock ...]) + +if ! test "x$have_clock_gettime" = xno; then + if ! test "x$have_clock_gettime" = xyes; then + CLOCK_LIBS="$have_clock_gettime" + else + CLOCK_LIBS="" + fi + + LIBS_SAVE="$LIBS" + LIBS="$CLOCK_LIBS" + CPPFLAGS_SAVE="$CPPFLAGS" + + if test x"$glibc" = xyes; then + CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L" + fi + + AC_RUN_IFELSE([ +#include + +int main(int argc, char *argv[[]]) { + struct timespec tp; + + if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) + return 0; + else + return 1; +} + ], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no], + [MONOTONIC_CLOCK="cross compiling"]) + + LIBS="$LIBS_SAVE" + CPPFLAGS="$CPPFLAGS_SAVE" +else + MONOTONIC_CLOCK=no +fi + +AC_MSG_RESULT([$MONOTONIC_CLOCK]) + +if test "x$MONOTONIC_CLOCK" = xyes; then + AC_DEFINE(MONOTONIC_CLOCK, 1, [Have monotonic clock from clock_gettime()]) + LIBS="$LIBS $CLOCK_LIBS" +fi + +AM_CONDITIONAL(XV, [test "x$XV" = xyes]) +if test "x$XV" = xyes; then + AC_DEFINE(XV, 1, [Support Xv extension]) + AC_DEFINE(XvExtension, 1, [Build Xv extension]) + REQUIRED_MODULES="$REQUIRED_MODULES $VIDEOPROTO" + SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $VIDEOPROTO" +else + XVMC=no +fi + +AM_CONDITIONAL(XVMC, [test "x$XVMC" = xyes]) +if test "x$XVMC" = xyes; then + AC_DEFINE(XvMCExtension, 1, [Build XvMC extension]) +fi + +AM_CONDITIONAL(XREGISTRY, [test "x$XREGISTRY" = xyes]) +if test "x$XREGISTRY" = xyes; then + AC_DEFINE(XREGISTRY, 1, [Build registry module]) +fi + +AM_CONDITIONAL(COMPOSITE, [test "x$COMPOSITE" = xyes]) +if test "x$COMPOSITE" = xyes; then + AC_DEFINE(COMPOSITE, 1, [Support Composite Extension]) + REQUIRED_MODULES="$REQUIRED_MODULES $COMPOSITEPROTO" + COMPOSITE_LIB='$(top_builddir)/composite/libcomposite.la' + COMPOSITE_INC='-I$(top_srcdir)/composite' +fi + +AM_CONDITIONAL(MITSHM, [test "x$MITSHM" = xyes]) +if test "x$MITSHM" = xyes; then + AC_DEFINE(MITSHM, 1, [Support MIT-SHM extension]) + AC_DEFINE(HAS_SHM, 1, [Support SHM]) +fi + +AM_CONDITIONAL(RECORD, [test "x$RECORD" = xyes]) +if test "x$RECORD" = xyes; then + AC_DEFINE(XRECORD, 1, [Support Record extension]) + REQUIRED_MODULES="$REQUIRED_MODULES $RECORDPROTO" + RECORD_LIB='$(top_builddir)/record/librecord.la' +fi + +AM_CONDITIONAL(SCREENSAVER, [test "x$SCREENSAVER" = xyes]) +if test "x$SCREENSAVER" = xyes; then + AC_DEFINE(SCREENSAVER, 1, [Support MIT-SCREEN-SAVER extension]) + REQUIRED_MODULES="$REQUIRED_MODULES $SCRNSAVERPROTO" +fi + +AM_CONDITIONAL(RES, [test "x$RES" = xyes]) +if test "x$RES" = xyes; then + AC_DEFINE(RES, 1, [Support X resource extension]) + REQUIRED_MODULES="$REQUIRED_MODULES $RESOURCEPROTO" +fi + +if test "x$GLX" = xyes; then + PKG_CHECK_MODULES([XLIB], [x11]) + PKG_CHECK_MODULES([GL], $GLPROTO $LIBGL) + AC_SUBST(XLIB_CFLAGS) + AC_DEFINE(GLXEXT, 1, [Build GLX extension]) + GLX_LIBS='$(top_builddir)/glx/libglx.la' + GLX_SYS_LIBS="$GLX_SYS_LIBS" +else + GLX=no +fi +AM_CONDITIONAL(GLX, test "x$GLX" = xyes) + +if test "x$AIGLX" = xyes -a "x$GLX" = xyes -a "x$DRI" = xyes; then + AC_DEFINE(AIGLX, 1, [Build AIGLX loader]) +else + AIGLX=no +fi +AM_CONDITIONAL(AIGLX, test "x$AIGLX" = xyes) + +if test "x$GLX_USE_TLS" = xyes ; then + GLX_DEFINES="-DGLX_USE_TLS -DPTHREADS" + GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread" +fi +AC_SUBST([GLX_DEFINES]) + +AM_CONDITIONAL(DRI, test "x$DRI" = xyes) +if test "x$DRI" = xyes; then + AC_DEFINE(XF86DRI, 1, [Build DRI extension]) + PKG_CHECK_MODULES([DRIPROTO], [$DRIPROTO]) + PKG_CHECK_MODULES([DRI], $GLPROTO $LIBDRI) + AC_SUBST(DRIPROTO_CFLAGS) +fi + +PKG_CHECK_MODULES([DRI2PROTO], $DRI2PROTO, + [HAVE_DRI2PROTO=yes], [HAVE_DRI2PROTO=no]) +case "$DRI2,$HAVE_DRI2PROTO" in + yes,no) + AC_MSG_ERROR([DRI2 requested, but dri2proto not found.]) + ;; + yes,yes | auto,yes) + AC_DEFINE(DRI2, 1, [Build DRI2 extension]) + DRI2=yes + SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI2PROTO" + ;; +esac +AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes) + +if test "x$DRI" = xyes || test "x$DRI2" = xyes; then + if test "x$DRM" = xyes; then + AC_DEFINE(WITH_LIBDRM, 1, [Building with libdrm support]) + PKG_CHECK_MODULES([LIBDRM], $LIBDRM) + fi +fi + +if test "x$DRI2" = xyes; then + save_CFLAGS=$CFLAGS + CFLAGS="$GL_CFLAGS $LIBDRM_CFLAGS" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include +#include +#ifndef __DRI_DRI2 +#error DRI2 extension not available. +#endif]])], + [HAVE_DRI2EXTENSION=yes], + [HAVE_DRI2EXTENSION=no]) + CFLAGS=$save_CFLAGS + if test "x$HAVE_DRI2EXTENSION" = xyes; then + AC_DEFINE(DRI2_AIGLX, 1, [Build DRI2 AIGLX loader]) + DRI2_AIGLX=yes + else + AC_MSG_NOTICE([DRI2 AIGLX disabled, __DRI_DRI2 not defined in dri_interface.h.]) + DRI2_AIGLX=no + fi +fi +AM_CONDITIONAL(DRI2_AIGLX, test "x$DRI2_AIGLX" = xyes) + + +AM_CONDITIONAL(XINERAMA, [test "x$XINERAMA" = xyes]) +if test "x$XINERAMA" = xyes; then + AC_DEFINE(XINERAMA, 1, [Support Xinerama extension]) + AC_DEFINE(PANORAMIX, 1, [Internal define for Xinerama]) + REQUIRED_MODULES="$REQUIRED_MODULES $XINERAMAPROTO" + SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $XINERAMAPROTO" +fi + +AM_CONDITIONAL(XACE, [test "x$XACE" = xyes]) +if test "x$XACE" = xyes; then + AC_DEFINE(XACE, 1, [Build X-ACE extension]) +fi + +AM_CONDITIONAL(XSELINUX, [test "x$XSELINUX" = xyes]) +if test "x$XSELINUX" = xyes; then + if test "x$XACE" != xyes; then + AC_MSG_ERROR([cannot build SELinux extension without X-ACE]) + fi + AC_CHECK_HEADERS([libaudit.h], [], AC_MSG_ERROR([SELinux extension requires audit system headers])) + AC_CHECK_LIB(audit, audit_open, [], AC_MSG_ERROR([SELinux extension requires audit system library])) + PKG_CHECK_MODULES([SELINUX], $LIBSELINUX) + SELINUX_LIBS="$SELINUX_LIBS -laudit" + AC_DEFINE(XSELINUX, 1, [Build SELinux extension]) +fi + +AM_CONDITIONAL(XCSECURITY, [test "x$XCSECURITY" = xyes]) +if test "x$XCSECURITY" = xyes; then + if test "x$XACE" != xyes; then + AC_MSG_ERROR([cannot build Security extension without X-ACE]) + fi + AC_DEFINE(XCSECURITY, 1, [Build Security extension]) +fi + +AM_CONDITIONAL(DBE, [test "x$DBE" = xyes]) +if test "x$DBE" = xyes; then + AC_DEFINE(DBE, 1, [Support DBE extension]) + DBE_LIB='$(top_builddir)/dbe/libdbe.la' +fi + +AM_CONDITIONAL(XF86BIGFONT, [test "x$XF86BIGFONT" = xyes]) +if test "x$XF86BIGFONT" = xyes; then + AC_DEFINE(XF86BIGFONT, 1, [Support XF86 Big font extension]) + REQUIRED_MODULES="$REQUIRED_MODULES $BIGFONTPROTO" +fi + +AM_CONDITIONAL(DPMSExtension, [test "x$DPMSExtension" = xyes]) +if test "x$DPMSExtension" = xyes; then + AC_DEFINE(DPMSExtension, 1, [Support DPMS extension]) +fi + +if test "x$XCALIBRATE" = xyes && test "$KDRIVE" = yes; then + AC_DEFINE(XCALIBRATE, 1, [Build XCalibrate extension]) + REQUIRED_MODULES="$REQUIRED_MODULES $XCALIBRATEPROTO" +else + XCALIBRATE=no +fi +AM_CONDITIONAL(XCALIBRATE, [test "x$XCALIBRATE" = xyes]) + +AC_DEFINE(RENDER, 1, [Support RENDER extension]) +RENDER_LIB='$(top_builddir)/render/librender.la' +RENDER_INC='-I$(top_srcdir)/render' + +AC_DEFINE(RANDR, 1, [Support RANDR extension]) +RANDR_LIB='$(top_builddir)/randr/librandr.la' +RANDR_INC='-I$(top_srcdir)/randr' + +AC_DEFINE(XFIXES,1,[Support XFixes extension]) +FIXES_LIB='$(top_builddir)/xfixes/libxfixes.la' +FIXES_INC='-I$(top_srcdir)/xfixes' + +AC_DEFINE(DAMAGE,1,[Support Damage extension]) +DAMAGE_LIB='$(top_builddir)/damageext/libdamageext.la' +DAMAGE_INC='-I$(top_srcdir)/damageext' +MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la' +MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage' + +# XINPUT extension is integral part of the server +AC_DEFINE(XINPUT, 1, [Support X Input extension]) +XI_LIB='$(top_builddir)/Xi/libXi.la' +XI_INC='-I$(top_srcdir)/Xi' + +AM_CONDITIONAL(XF86UTILS, test "x$XF86UTILS" = xyes) +AM_CONDITIONAL(XAA, test "x$XAA" = xyes) +AM_CONDITIONAL(VGAHW, test "x$VGAHW" = xyes) +AM_CONDITIONAL(VBE, test "x$VBE" = xyes) +AM_CONDITIONAL(INT10MODULE, test "x$INT10MODULE" = xyes) + +AC_DEFINE(SHAPE, 1, [Support SHAPE extension]) + +AC_DEFINE_DIR(XKB_BASE_DIRECTORY, XKBPATH, [Path to XKB data]) +AC_ARG_WITH(xkb-bin-directory, + AS_HELP_STRING([--with-xkb-bin-directory=DIR], [Directory containing xkbcomp program]), + [XKB_BIN_DIRECTORY="$withval"], + [XKB_BIN_DIRECTORY="$bindir"]) + +AC_DEFINE_DIR(XKB_BIN_DIRECTORY, XKB_BIN_DIRECTORY, [Path to XKB bin dir]) + +dnl Make sure XKM_OUTPUT_DIR is an absolute path +XKBOUTPUT_FIRSTCHAR=`echo $XKBOUTPUT | cut -b 1` +if [[ x$XKBOUTPUT_FIRSTCHAR != x/ -a x$XKBOUTPUT_FIRSTCHAR != 'x$' ]] ; then + XKBOUTPUT="$XKB_BASE_DIRECTORY/$XKBOUTPUT" +fi + +dnl XKM_OUTPUT_DIR (used in code) must end in / or file names get hosed +dnl XKB_COMPILED_DIR (used in Makefiles) must not or install-sh gets confused + +XKBOUTPUT=`echo $XKBOUTPUT/ | $SED 's|/*$|/|'` +XKB_COMPILED_DIR=`echo $XKBOUTPUT | $SED 's|/*$||'` +AC_DEFINE_DIR(XKM_OUTPUT_DIR, XKBOUTPUT, [Path to XKB output dir]) +AC_SUBST(XKB_COMPILED_DIR) + +if test "x$XKB_DFLT_RULES" = x; then + case $host_os in + linux*) + dnl doesn't take AutoAddDevices into account, but whatever. + if test "x$CONFIG_HAL" = xyes; then + XKB_DFLT_RULES="evdev" + else + XKB_DFLT_RULES="base" + fi + ;; + *) + XKB_DFLT_RULES="base" + ;; + esac +fi +AC_DEFINE_UNQUOTED(XKB_DFLT_RULES, ["$XKB_DFLT_RULES"], [Default XKB ruleset]) +AC_DEFINE_UNQUOTED(XKB_DFLT_MODEL, ["$XKB_DFLT_MODEL"], [Default XKB model]) +AC_DEFINE_UNQUOTED(XKB_DFLT_LAYOUT, ["$XKB_DFLT_LAYOUT"], [Default XKB layout]) +AC_DEFINE_UNQUOTED(XKB_DFLT_VARIANT, ["$XKB_DFLT_VARIANT"], [Default XKB variant]) +AC_DEFINE_UNQUOTED(XKB_DFLT_OPTIONS, ["$XKB_DFLT_OPTIONS"], [Default XKB options]) + +XKB_LIB='$(top_builddir)/xkb/libxkb.la' +XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la' +REQUIRED_MODULES="$REQUIRED_MODULES xkbfile" + +AC_CHECK_FUNC(strcasecmp, [], AC_DEFINE([NEED_STRCASECMP], 1, + [Do not have 'strcasecmp'.])) +AC_CHECK_FUNC(strncasecmp, [], AC_DEFINE([NEED_STRNCASECMP], 1, + [Do not have 'strncasecmp'.])) +AC_CHECK_FUNC(strcasestr, [], AC_DEFINE([NEED_STRCASESTR], 1, + [Do not have 'strcasestr'.])) + +PKG_CHECK_MODULES([XDMCP], [xdmcp], [have_libxdmcp="yes"], [have_libxdmcp="no"]) +if test "x$have_libxdmcp" = xyes; then + AC_CHECK_LIB(Xdmcp, XdmcpWrap, [have_xdmcpwrap="yes"], [have_xdmcpwrap="no"], [$XDMCP_LIBS]) +fi +if test "x$XDMCP" = xauto; then + if test "x$have_libxdmcp" = xyes; then + XDMCP=yes + else + XDMCP=no + fi +fi +if test "x$XDMAUTH" = xauto; then + if test "x$have_libxdmcp" = xyes && test "x$have_xdmcpwrap" = xyes; then + XDMAUTH=yes + else + XDMAUTH=no + fi +fi + +AM_CONDITIONAL(XDMCP, [test "x$XDMCP" = xyes]) +if test "x$XDMCP" = xyes; then + AC_DEFINE(XDMCP, 1, [Support XDM Control Protocol]) + REQUIRED_LIBS="$REQUIRED_LIBS xdmcp" + XDMCP_MODULES="xdmcp" +fi + +AM_CONDITIONAL(XDMAUTH, [test "x$XDMAUTH" = xyes]) +if test "x$XDMAUTH" = xyes; then + AC_DEFINE(HASXDMAUTH,1,[Support XDM-AUTH*-1]) + if ! test "x$XDMCP" = xyes; then + REQUIRED_LIBS="$REQUIRED_LIBS xdmcp" + XDMCP_MODULES="xdmcp" + fi +fi + +AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path]) +AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path]) +AC_DEFINE_DIR(SERVER_MISC_CONFIG_PATH, SERVERCONFIG, [Server miscellaneous config path]) +AC_DEFINE_DIR(BASE_FONT_PATH, FONTROOTDIR, [Default base font path]) +dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri` +AC_DEFINE_DIR(DRI_DRIVER_PATH, dridriverdir, [Default DRI driver path]) +AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_NAME"], [Vendor name]) +AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_NAME_SHORT"], [Short vendor name]) +AC_DEFINE_UNQUOTED(XORG_DATE, ["$RELEASE_DATE"], [Vendor release]) +AC_DEFINE_UNQUOTED(XORG_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version]) +AC_DEFINE_UNQUOTED(BUILDERADDR, ["$BUILDERADDR"], [Builder address]) + +if test -z "$OSNAME"; then + OSNAME="UNKNOWN" +fi + +AC_DEFINE_UNQUOTED(OSNAME, ["$OSNAME"], [Operating System Name]) +AC_DEFINE_UNQUOTED(OSVENDOR, ["$OSVENDOR"], [Operating System Vendor]) +AC_DEFINE_UNQUOTED(BUILDERSTRING, ["$BUILDERSTRING"], [Builder string]) + +AC_SUBST([VENDOR_NAME_SHORT]) +AC_DEFINE_UNQUOTED(VENDOR_NAME, ["$VENDOR_NAME"], [Vendor name]) +AC_DEFINE_UNQUOTED(VENDOR_NAME_SHORT, ["$VENDOR_NAME_SHORT"], [Vendor name]) +AC_DEFINE_UNQUOTED(VENDOR_RELEASE, [$VENDOR_RELEASE], [Vendor release]) +AC_DEFINE_UNQUOTED(VENDOR_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version]) + +AC_DEFINE(NO_LIBCWRAPPER, 1, [Define to 1 if modules should avoid the libcwrapper]) + +if test "x$DEBUGGING" = xyes; then + AC_DEFINE(DEBUG, 1, [Enable debugging code]) +fi +AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes]) + +# If unittests aren't explicitly disabled, check for required support +if test "x$UNITTESTS" != xno ; then + PKG_CHECK_MODULES([GLIB], $LIBGLIB, + [HAVE_GLIB=yes], [HAVE_GLIB=no]) + + # Check if linker supports -wrap, passed via compiler flags + # When cross-compiling, reports no, since unit tests run from + # "make check", so would be running on build machine, not target + AC_MSG_CHECKING([whether the linker supports -wrap]) + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,-wrap,exit" + AC_RUN_IFELSE([AC_LANG_PROGRAM([[ + void __wrap_exit (int s) + { + __real_exit (0); + }]], + [[exit (1);]])], + [linker_can_wrap="yes"], + [linker_can_wrap="no"], + [linker_can_wrap="no"]) + AC_MSG_RESULT([$linker_can_wrap]) + LDFLAGS="$save_LDFLAGS" +fi + +if test "x$UNITTESTS" = xauto; then + if test "x$HAVE_GLIB" = xyes && test "x$linker_can_wrap" = xyes; then + UNITTESTS=yes + else + UNITTESTS=no + fi +fi +if test "x$UNITTESTS" = xyes; then + if test "x$HAVE_GLIB" = xno; then + AC_MSG_ERROR([glib required to build unit tests]) + fi + if test "x$linker_can_wrap" = xno; then + AC_MSG_ERROR([ld -wrap support required to build unit tests]) + fi + AC_DEFINE(UNITTESTS, 1, [Enable unit tests]) + AC_SUBST([GLIB_LIBS]) + AC_SUBST([GLIB_CFLAGS]) +fi +AM_CONDITIONAL(UNITTESTS, [test "x$UNITTESTS" = xyes]) + +AC_DEFINE(XTEST, 1, [Support XTest extension]) +AC_DEFINE(XSYNC, 1, [Support XSync extension]) +AC_DEFINE(XCMISC, 1, [Support XCMisc extension]) +AC_DEFINE(BIGREQS, 1, [Support BigRequests extension]) + +if test "x$SPECIAL_DTRACE_OBJECTS" = "xyes" ; then + DIX_LIB='$(top_builddir)/dix/dix.O' + OS_LIB='$(top_builddir)/os/os.O $(SHA1_LIBS) $(DLOPEN_LIBS)' +else + DIX_LIB='$(top_builddir)/dix/libdix.la' + OS_LIB='$(top_builddir)/os/libos.la' +fi +AC_SUBST([DIX_LIB]) +AC_SUBST([OS_LIB]) + +MAIN_LIB='$(top_builddir)/dix/libmain.la' +AC_SUBST([MAIN_LIB]) + +MI_LIB='$(top_builddir)/mi/libmi.la' +MI_EXT_LIB='$(top_builddir)/mi/libmiext.la' +MI_INC='-I$(top_srcdir)/mi' +FB_LIB='$(top_builddir)/fb/libfb.la' +FB_INC='-I$(top_srcdir)/fb' +MIEXT_SHADOW_INC='-I$(top_srcdir)/miext/shadow' +MIEXT_SHADOW_LIB='$(top_builddir)/miext/shadow/libshadow.la' +MIEXT_SYNC_INC='-I$(top_srcdir)/miext/sync' +MIEXT_SYNC_LIB='$(top_builddir)/miext/sync/libsync.la' +CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include' + +# SHA1 hashing +AC_ARG_WITH([sha1], + [AS_HELP_STRING([--with-sha1=libc|libmd|libgcrypt|libcrypto|libsha1|CommonCrypto], + [choose SHA1 implementation])]) +AC_CHECK_FUNC([SHA1Init], [HAVE_SHA1_IN_LIBC=yes]) +if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_LIBC" = xyes; then + with_sha1=libc +fi +if test "x$with_sha1" = xlibc && test "x$HAVE_SHA1_IN_LIBC" != xyes; then + AC_MSG_ERROR([libc requested but not found]) +fi +if test "x$with_sha1" = xlibc; then + AC_DEFINE([HAVE_SHA1_IN_LIBC], [1], + [Use libc SHA1 functions]) + SHA1_LIBS="" +fi +AC_CHECK_FUNC([CC_SHA1_Init], [HAVE_SHA1_IN_COMMONCRYPTO=yes]) +if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_COMMONCRYPTO" = xyes; then + with_sha1=CommonCrypto +fi +if test "x$with_sha1" = xCommonCrypto && test "x$HAVE_SHA1_IN_COMMONCRYPTO" != xyes; then + AC_MSG_ERROR([CommonCrypto requested but not found]) +fi +if test "x$with_sha1" = xCommonCrypto; then + AC_DEFINE([HAVE_SHA1_IN_COMMONCRYPTO], [1], + [Use CommonCrypto SHA1 functions]) + SHA1_LIBS="" +fi +AC_CHECK_LIB([md], [SHA1Init], [HAVE_LIBMD=yes]) +if test "x$with_sha1" = x && test "x$HAVE_LIBMD" = xyes; then + with_sha1=libmd +fi +if test "x$with_sha1" = xlibmd && test "x$HAVE_LIBMD" != xyes; then + AC_MSG_ERROR([libmd requested but not found]) +fi +if test "x$with_sha1" = xlibmd; then + AC_DEFINE([HAVE_SHA1_IN_LIBMD], [1], + [Use libmd SHA1 functions]) + SHA1_LIBS=-lmd +fi +PKG_CHECK_MODULES([LIBSHA1], [libsha1], [HAVE_LIBSHA1=yes], [HAVE_LIBSHA1=no]) +if test "x$with_sha1" = x && test "x$HAVE_LIBSHA1" = xyes; then + with_sha1=libsha1 +fi +if test "x$with_sha1" = xlibsha1 && test "x$HAVE_LIBSHA1" != xyes; then + AC_MSG_ERROR([libsha1 requested but not found]) +fi +if test "x$with_sha1" = xlibsha1; then + AC_DEFINE([HAVE_SHA1_IN_LIBSHA1], [1], + [Use libsha1 for SHA1]) + SHA1_LIBS=-lsha1 +fi +AC_CHECK_LIB([gcrypt], [gcry_md_open], [HAVE_LIBGCRYPT=yes]) +if test "x$with_sha1" = x && test "x$HAVE_LIBGCRYPT" = xyes; then + with_sha1=libgcrypt +fi +if test "x$with_sha1" = xlibgcrypt && test "x$HAVE_LIBGCRYPT" != xyes; then + AC_MSG_ERROR([libgcrypt requested but not found]) +fi +if test "x$with_sha1" = xlibgcrypt; then + AC_DEFINE([HAVE_SHA1_IN_LIBGCRYPT], [1], + [Use libgcrypt SHA1 functions]) + SHA1_LIBS=-lgcrypt +fi +# We don't need all of the OpenSSL libraries, just libcrypto +AC_CHECK_LIB([crypto], [SHA1_Init], [HAVE_LIBCRYPTO=yes]) +PKG_CHECK_MODULES([OPENSSL], [openssl], [HAVE_OPENSSL_PKC=yes], + [HAVE_OPENSSL_PKC=no]) +if test "x$HAVE_LIBCRYPTO" = xyes || test "x$HAVE_OPENSSL_PKC" = xyes; then + if test "x$with_sha1" = x; then + with_sha1=libcrypto + fi +else + if test "x$with_sha1" = xlibcrypto; then + AC_MSG_ERROR([OpenSSL libcrypto requested but not found]) + fi +fi +if test "x$with_sha1" = xlibcrypto; then + if test "x$HAVE_LIBCRYPTO" = xyes; then + SHA1_LIBS=-lcrypto + else + SHA1_LIBS="$OPENSSL_LIBS" + SHA1_CFLAGS="$OPENSSL_CFLAGS" + fi +fi +AC_MSG_CHECKING([for SHA1 implementation]) +if test "x$with_sha1" = x; then + AC_MSG_ERROR([No suitable SHA1 implementation found]) +fi +AC_MSG_RESULT([$with_sha1]) +AC_SUBST(SHA1_LIBS) +AC_SUBST(SHA1_CFLAGS) + +PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS]) +PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS]) + +# Autotools has some unfortunate issues with library handling. In order to +# get a server to rebuild when a dependency in the tree is changed, it must +# be listed in SERVERNAME_DEPENDENCIES. However, no system libraries may be +# listed there, or some versions of autotools will break (especially if a -L +# is required to find the library). So, we keep two sets of libraries +# detected: NAMESPACE_LIBS for in-tree libraries to be linked against, which +# will go into the _DEPENDENCIES and _LDADD of the server, and +# NAMESPACE_SYS_LIBS which will go into only the _LDADD. The +# NAMESPACEMODULES_LIBS detected from pkgconfig should always go in +# NAMESPACE_SYS_LIBS. +# +# XSERVER_LIBS is the set of in-tree libraries which all servers require. +# XSERVER_SYS_LIBS is the set of out-of-tree libraries which all servers +# require. +# +XSERVER_CFLAGS="${XSERVER_CFLAGS} ${XSERVERCFLAGS_CFLAGS}" +XSERVER_LIBS="$DIX_LIB $MI_LIB $OS_LIB" +XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}" +AC_SUBST([XSERVER_LIBS]) +AC_SUBST([XSERVER_SYS_LIBS]) + +UTILS_SYS_LIBS="${SYS_LIBS}" +AC_SUBST([UTILS_SYS_LIBS]) + +# The Xorg binary needs to export symbols so that they can be used from modules +# Some platforms require extra flags to do this. libtool should set the +# necessary flags for each platform when -export-dynamic is passed to it. +LD_EXPORT_SYMBOLS_FLAG="-export-dynamic" +AC_SUBST([LD_EXPORT_SYMBOLS_FLAG]) + +dnl Imake defines SVR4 on SVR4 systems, and many files check for it, so +dnl we need to replicate that here until those can all be fixed +AC_MSG_CHECKING([if SVR4 needs to be defined]) +AC_EGREP_CPP([I_AM_SVR4],[ +#if defined(SVR4) || defined(__svr4__) || defined(__SVR4) + I_AM_SVR4 +#endif +],[ +AC_DEFINE([SVR4],1,[Define to 1 on systems derived from System V Release 4]) +AC_MSG_RESULT([yes])], AC_MSG_RESULT([no])) + +XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SYNC_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC" + +dnl --------------------------------------------------------------------------- +dnl DDX section. +dnl --------------------------------------------------------------------------- + +dnl Xvfb DDX + +AC_MSG_CHECKING([whether to build Xvfb DDX]) +AC_MSG_RESULT([$XVFB]) +AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes]) + +if test "x$XVFB" = xyes; then + XVFB_LIBS="$FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB" + XVFB_SYS_LIBS="$XVFBMODULES_LIBS $GLX_SYS_LIBS" + AC_SUBST([XVFB_LIBS]) + AC_SUBST([XVFB_SYS_LIBS]) +fi + + +dnl Xnest DDX + +PKG_CHECK_MODULES(XNESTMODULES, [$LIBXEXT x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no]) +AC_MSG_CHECKING([whether to build Xnest DDX]) +if test "x$XNEST" = xauto; then + XNEST="$have_xnest" +fi +AC_MSG_RESULT([$XNEST]) +AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes]) + +if test "x$XNEST" = xyes; then + if test "x$have_xnest" = xno; then + AC_MSG_ERROR([Xnest build explicitly requested, but required modules not found.]) + fi + XNEST_LIBS="$FB_LIB $FIXES_LIB $MI_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DIX_LIB $MAIN_LIB $OS_LIB" + XNEST_SYS_LIBS="$XNESTMODULES_LIBS $GLX_SYS_LIBS" + AC_SUBST([XNEST_LIBS]) + AC_SUBST([XNEST_SYS_LIBS]) +fi + + +dnl Xorg DDX + +AC_MSG_CHECKING([whether to build Xorg DDX]) +if test "x$XORG" = xauto; then + XORG="yes" + case $host_os in + cygwin*) XORG="no" ;; + darwin*) XORG="no" ;; + esac +fi +AC_MSG_RESULT([$XORG]) + +xorg_bus_linuxpci=no +xorg_bus_bsdpci=no +xorg_bus_sparc=no + +if test "x$XORG" = xyes; then + XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common' + XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os' + XORG_INCS="$XORG_DDXINCS $XORG_OSINCS" + XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H" + XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB" + + dnl ================================================================== + dnl symbol visibility + symbol_visibility= + have_visibility=disabled + if test x$SYMBOL_VISIBILITY != xno; then + AC_MSG_CHECKING(for symbol visibility support) + if test x$GCC = xyes; then + VISIBILITY_CFLAGS="-fvisibility=hidden" + else + AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) + if test x$SUNCC = xyes; then + VISIBILITY_CFLAGS="-xldscope=hidden" + else + have_visibility=no + fi + fi + if test x$have_visibility != xno; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $VISIBILITY_CFLAGS" + AC_TRY_COMPILE( + [#include + extern _X_HIDDEN int hidden_int; + extern _X_EXPORT int public_int; + extern _X_HIDDEN int hidden_int_func(void); + extern _X_EXPORT int public_int_func(void);], + [], + have_visibility=yes, + have_visibility=no) + CFLAGS=$save_CFLAGS + fi + AC_MSG_RESULT([$have_visibility]) + if test x$have_visibility != xno; then + symbol_visibility=$VISIBILITY_CFLAGS + XORG_CFLAGS="$XORG_CFLAGS $VISIBILITY_CFLAGS" + XSERVER_CFLAGS="$XSERVER_CFLAGS $VISIBILITY_CFLAGS" + fi + fi + dnl added to xorg-server.pc + AC_SUBST([symbol_visibility]) + dnl =================================================================== + + PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS) + SAVE_LIBS=$LIBS + SAVE_CFLAGS=$CFLAGS + CFLAGS=$PCIACCESS_CFLAGS + LIBS=$PCIACCESS_LIBS + AC_CHECK_FUNCS([pci_system_init_dev_mem]) + AC_CHECK_FUNCS([pci_device_enable]) + AC_CHECK_FUNCS([pci_device_is_boot_vga]) + AC_CHECK_FUNCS([pci_device_vgaarb_init]) + LIBS=$SAVE_LIBS + CFLAGS=$SAVE_CFLAGS + XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS" + XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" + + case $host_os in + linux*) + 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" + case $host_cpu in + ia64*) + linux_ia64=yes + linux_acpi="yes" + ;; + alpha*) + linux_alpha=yes + ;; + i*86|amd64*|x86_64*) + linux_acpi="yes" + ;; + *) + ;; + 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" + ;; + openbsd*) + if test "x$ac_cv_BSD_APM" = xyes \ + -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 + # use libpciaccess for PCI + xorg_bus_bsdpci="yes" + AC_CHECK_HEADERS([sys/kd.h]) + AC_CHECK_HEADERS([sys/vt.h], [solaris_vt=yes], [solaris_vt=no]) + # Check for minimum supported release + AC_MSG_CHECKING([Solaris version]) + OS_MINOR=`echo ${host_os}|$SED -e 's/^.*solaris2\.//' -e s'/\..*$//'` + if test "${OS_MINOR}" -ge 7 ; then + AC_MSG_RESULT(Solaris ${OS_MINOR}) + else + AC_MSG_RESULT(Solaris `echo ${host_os}|$SED -e 's/^.*solaris//`) + fi + if test "${OS_MINOR}" -lt 8 ; then + AC_MSG_ERROR([This release no longer supports Solaris versions older than Solaris 8.]) + fi + AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"]) + if test "x$SUNCC" = "xyes"; then + solaris_asm_inline="yes" + fi + AC_CHECK_DECL([_LP64], [SOLARIS_64="yes"], [SOLARIS_64="no"]) + + case $host_cpu in + sparc*) + SOLARIS_INOUT_ARCH="sparcv8plus" + ;; + i*86) + if test x$SOLARIS_64 = xyes ; then + SOLARIS_INOUT_ARCH="amd64" + else + SOLARIS_INOUT_ARCH="ia32" + fi + ;; + *) + AC_MSG_ERROR([Unsupported Solaris platform. Only SPARC & x86 \ + are supported on Solaris in this release. If you are \ + interested in porting Xorg to your platform, please email \ + xorg@lists.freedesktop.org.]) ;; + esac + AC_SUBST([SOLARIS_INOUT_ARCH]) + if test x$solaris_asm_inline = xyes ; then + SOLARIS_ASM_CFLAGS='$(top_srcdir)/hw/xfree86/os-support/solaris/solaris-$(SOLARIS_INOUT_ARCH).il' + 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,], + [Free/Open/Net/DragonFlyBSD, Solaris/OpenSolaris, & GNU Hurd.], + [If you are interested in porting Xorg to your platform,], + [please email xorg@lists.freedesktop.org.]))]) + ;; + esac + + case $host_cpu in + sparc*) + 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 + if test "x$DGA" = xyes; then + XORG_MODULES="$XORG_MODULES $DGAPROTO" + PKG_CHECK_MODULES(DGA, $DGAPROTO) + AC_DEFINE(DGA, 1, [Support DGA extension]) + AC_DEFINE(XFreeXDGA, 1, [Build XDGA support]) + fi + + if test "x$XF86VIDMODE" = xauto; then + PKG_CHECK_MODULES(XF86VIDMODE, $VIDMODEPROTO, [XF86VIDMODE=yes], [XF86VIDMODE=no]) + fi + if test "x$XF86VIDMODE" = xyes; then + XORG_MODULES="$XORG_MODULES $VIDMODEPROTO" + PKG_CHECK_MODULES(XF86VIDMODE, $VIDMODEPROTO) + AC_DEFINE(XF86VIDMODE, 1, [Support XFree86 Video Mode extension]) + fi + + if test -n "$XORG_MODULES"; then + PKG_CHECK_MODULES(XORG_MODULES, [$XORG_MODULES]) + XORG_CFLAGS="$XORG_CFLAGS $XORG_MODULES_CFLAGS" + XORG_SYS_LIBS="$XORG_SYS_LIBS $XORG_MODULES_LIBS" + fi + + AC_SUBST([XORG_LIBS]) + AC_SUBST([XORG_SYS_LIBS]) + AC_SUBST([XORG_INCS]) + AC_SUBST([XORG_OS]) + AC_SUBST([XORG_OS_SUBDIR]) + + AC_PATH_PROG(PERL, perl, no) + dnl unlikely as this may be ... + if test "x$PERL" = xno; then + AC_MSG_ERROR([Perl is required to build the XFree86/Xorg DDX.]) + fi + AC_SUBST(PERL) + + AC_SUBST([XORG_CFLAGS]) + + dnl these only go in xorg-config.h + XF86CONFIGFILE="xorg.conf" + XF86CONFIGDIR="xorg.conf.d" + AC_SUBST(XF86CONFIGDIR) + CONFIGFILE="$sysconfdir/$XF86CONFIGFILE" + LOGPREFIX="$logdir/Xorg." + AC_DEFINE(XORG_SERVER, 1, [Building Xorg server]) + AC_DEFINE(XORGSERVER, 1, [Building Xorg server]) + AC_DEFINE(XFree86Server, 1, [Building XFree86 server]) + AC_DEFINE(XFree86LOADER, 1, [Building loadable XFree86 server]) + AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) + AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs]) + AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions]) + AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server]) + AC_DEFINE_DIR(__XCONFIGFILE__, XF86CONFIGFILE, [Name of configuration file]) + AC_DEFINE_DIR(XF86CONFIGFILE, XF86CONFIGFILE, [Name of configuration file]) + AC_DEFINE_DIR(__XCONFIGDIR__, XF86CONFIGDIR, [Name of configuration directory]) + AC_DEFINE_DIR(DEFAULT_MODULE_PATH, moduledir, [Default module search path]) + AC_DEFINE_DIR(DEFAULT_LIBRARY_PATH, libdir, [Default library install path]) + AC_DEFINE_DIR(DEFAULT_LOGPREFIX, LOGPREFIX, [Default log location]) + AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support]) + AC_DEFINE(XSERVER_LIBPCIACCESS, 1, [Use libpciaccess for all pci manipulation]) + if test "x$VGAHW" = xyes; then + AC_DEFINE(WITH_VGAHW, 1, [Building vgahw module]) + fi + + driverdir="$moduledir/drivers" + AC_SUBST([moduledir]) + AC_SUBST([driverdir]) + sdkdir="$includedir/xorg" + extdir="$includedir/X11/extensions" + sysconfigdir="$datadir/X11/$XF86CONFIGDIR" + AC_SUBST([sdkdir]) + AC_SUBST([extdir]) + AC_SUBST([sysconfigdir]) + AC_SUBST([logdir]) + + # stuff the ABI versions into the pc file too + extract_abi() { + grep ^.define.*${1}_VERSION ${srcdir}/hw/xfree86/common/xf86Module.h | tr '(),' ' .' | awk '{ print $4$5 }' + } + abi_ansic=`extract_abi ANSIC` + abi_videodrv=`extract_abi VIDEODRV` + abi_xinput=`extract_abi XINPUT` + abi_extension=`extract_abi EXTENSION` + AC_SUBST([abi_ansic]) + AC_SUBST([abi_videodrv]) + AC_SUBST([abi_xinput]) + AC_SUBST([abi_extension]) +fi +AM_CONDITIONAL([XORG], [test "x$XORG" = xyes]) +AM_CONDITIONAL([XORG_BUS_LINUXPCI], [test "x$xorg_bus_linuxpci" = xyes]) +AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes]) +AM_CONDITIONAL([XORG_BUS_SPARC], [test "x$xorg_bus_sparc" = xyes]) +AM_CONDITIONAL([LINUX_IA64], [test "x$linux_ia64" = xyes]) +AM_CONDITIONAL([LINUX_ALPHA], [test "x$linux_alpha" = xyes]) +AM_CONDITIONAL([LNXACPI], [test "x$linux_acpi" = xyes]) +AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes]) +AM_CONDITIONAL([SOLARIS_VT], [test "x$solaris_vt" = xyes]) +AM_CONDITIONAL([DGA], [test "x$DGA" = xyes]) +AM_CONDITIONAL([XF86VIDMODE], [test "x$XF86VIDMODE" = xyes]) + +dnl XWin DDX + +AC_MSG_CHECKING([whether to build XWin DDX]) +if test "x$XWIN" = xauto; then + case $host_os in + cygwin*) XWIN="yes" ;; + mingw*) XWIN="yes" ;; + *) XWIN="no" ;; + esac +fi +AC_MSG_RESULT([$XWIN]) + +if test "x$XWIN" = xyes; then + AC_DEFINE_DIR(SYSCONFDIR, sysconfdir, [Location of system.XWinrc]) + AC_DEFINE_DIR(DEFAULT_LOGDIR, logdir, [Default log location]) + AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) + AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support]) + AC_CHECK_TOOL(WINDRES, windres) + + PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau]) + + if test "x$WINDOWSWM" = xauto; then + PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no]) + fi + if test "x$WINDOWSWM" = xyes ; then + PKG_CHECK_MODULES(WINDOWSWM, $WINDOWSWMPROTO) + XWINMODULES_CFLAGS="$XWINMODULES_CFLAGS $WINDOWSWM_CFLAGS" + AC_DEFINE(ROOTLESS,1,[Build Rootless code]) + fi + + case $host_os in + cygwin*) + XWIN_SERVER_NAME=XWin + AC_DEFINE(HAS_DEVWINDOWS,1,[Cygwin has /dev/windows for signaling new win32 messages]) + ;; + mingw*) + XWIN_SERVER_NAME=Xming + AC_DEFINE(RELOCATE_PROJECTROOT,1,[Make PROJECT_ROOT relative to the xserver location]) + AC_DEFINE(HAS_WINSOCK,1,[Use Windows sockets]) + XWIN_SYS_LIBS=-lwinsock2 + ;; + esac + XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB" + XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS" + AC_SUBST(XWIN_LIBS) + AC_SUBST(XWIN_SERVER_NAME) + AC_SUBST(XWIN_SYS_LIBS) + + if test "x$DEBUGGING" = xyes; then + AC_DEFINE(CYGDEBUG, 1, [Simple debug messages]) + AC_DEFINE(CYGWINDOWING_DEBUG, 1, [Debug messages for window handling]) + AC_DEFINE(CYGMULTIWINDOW_DEBUG, 1, [Debug window manager]) + fi + + AC_DEFINE(DDXOSVERRORF, 1, [Use OsVendorVErrorF]) + AC_DEFINE(DDXBEFORERESET, 1, [Use ddxBeforeReset ]) +fi +AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes]) +AM_CONDITIONAL(XWIN_MULTIWINDOW, [test "x$XWIN" = xyes]) +AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes]) +AM_CONDITIONAL(XWIN_CLIPBOARD, [test "x$XWIN" = xyes]) +AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && false]) +AM_CONDITIONAL(XWIN_NATIVEGDI, [test "x$XWIN" = xyes]) +AM_CONDITIONAL(XWIN_PRIMARYFB, [test "x$XWIN" = xyes]) +AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes]) +AM_CONDITIONAL(XWIN_XV, [test "x$XWIN" = xyes && test "x$XV" = xyes]) + +dnl Darwin / OS X DDX +if test "x$XQUARTZ" = xyes; then + AC_DEFINE(XQUARTZ,1,[Have Quartz]) + AC_DEFINE(ROOTLESS,1,[Build Rootless code]) + + DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $MAIN_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB" + AC_SUBST([DARWIN_LIBS]) + + AC_CHECK_LIB([Xplugin],[xp_init],[:]) + + CFLAGS="${CFLAGS} -DROOTLESS_SAFEALPHA -DNO_ALLOCA" + + PKG_CHECK_MODULES(XPBPROXY, $APPLEWMPROTO $LIBAPPLEWM xfixes x11) + + if test "x$XQUARTZ_SPARKLE" = xyes ; then + AC_DEFINE(XQUARTZ_SPARKLE,1,[Support application updating through sparkle.]) + fi + + if test "x$STANDALONE_XPBPROXY" = xyes ; then + AC_DEFINE(STANDALONE_XPBPROXY,1,[Build a standalone xpbproxy]) + fi +fi + +# Support for objc in autotools is minimal and not documented. +OBJC='$(CC)' +OBJCLD='$(CCLD)' +OBJCLINK='$(LINK)' +OBJCFLAGS='$(CFLAGS)' +AC_SUBST([OBJC]) +AC_SUBST([OBJCCLD]) +AC_SUBST([OBJCLINK]) +AC_SUBST([OBJCFLAGS]) +# internal, undocumented automake func follows :( +_AM_DEPENDENCIES([OBJC]) +AM_CONDITIONAL(XQUARTZ, [test "x$XQUARTZ" = xyes]) +AM_CONDITIONAL(XQUARTZ_SPARKLE, [test "x$XQUARTZ_SPARKLE" != "xno"]) +AM_CONDITIONAL(STANDALONE_XPBPROXY, [test "x$STANDALONE_XPBPROXY" = xyes]) + +dnl DMX DDX +PKG_CHECK_MODULES( + [DMXMODULES], + [xmuu $LIBXEXT x11 xrender xfixes $LIBXI $DMXPROTO xau $XDMCP_MODULES], + [PKG_CHECK_MODULES( + [XDMXCONFIG_DEP], + [xaw7 xmu xt xpm x11], + [have_dmx=yes], + [have_dmx=no])], + [have_dmx=no]) +AC_MSG_CHECKING([whether to build Xdmx DDX]) +if test "x$DMX" = xauto; then + DMX="$have_dmx" + case $host_os in + cygwin*) DMX="no" ;; + darwin*) DMX="no" ;; + esac +fi +AC_MSG_RESULT([$DMX]) +AM_CONDITIONAL(DMX, [test "x$DMX" = xyes]) + +if test "x$DMX" = xyes; then + if test "x$have_dmx" = xno; then + AC_MSG_ERROR([Xdmx build explicitly requested, but required + modules not found.]) + fi + DMX_INCLUDES="$XEXT_INC $RENDER_INC $RECORD_INC" + XDMX_CFLAGS="$DMXMODULES_CFLAGS" + XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RENDER_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_SYNC_LIB $MIEXT_SHADOW_LIB $MIEXT_DAMAGE_LIB $COMPOSITE_LIB $DAMAGE_LIB $MAIN_LIB $DIX_LIB $CONFIG_LIB $OS_LIB $FIXES_LIB" + XDMX_SYS_LIBS="$DMXMODULES_LIBS" + AC_SUBST([XDMX_CFLAGS]) + AC_SUBST([XDMX_LIBS]) + AC_SUBST([XDMX_SYS_LIBS]) + +dnl USB sources in DMX require + AC_CHECK_HEADER([linux/input.h], DMX_BUILD_USB="yes", + DMX_BUILD_USB="no") +dnl Linux sources in DMX require + AC_CHECK_HEADER([linux/keyboard.h], DMX_BUILD_LNX="yes", + DMX_BUILD_LNX="no") + AC_SUBST(XDMXCONFIG_DEP_CFLAGS) + AC_SUBST(XDMXCONFIG_DEP_LIBS) + PKG_CHECK_MODULES([DMXEXAMPLES_DEP], [$LIBDMX $LIBXEXT x11]) + AC_SUBST(DMXEXAMPLES_DEP_LIBS) + PKG_CHECK_MODULES([DMXXMUEXAMPLES_DEP], [$LIBDMX xmu $LIBXEXT x11]) + AC_SUBST(DMXXMUEXAMPLES_DEP_LIBS) + PKG_CHECK_MODULES([DMXXIEXAMPLES_DEP], [$LIBDMX $LIBXI $LIBXEXT x11]) + AC_SUBST(DMXXIEXAMPLES_DEP_LIBS) + PKG_CHECK_MODULES([XTSTEXAMPLES_DEP], [$LIBXTST $LIBXEXT x11]) + AC_SUBST(XTSTEXAMPLES_DEP_LIBS) + PKG_CHECK_MODULES([XRESEXAMPLES_DEP], [xres $LIBXEXT x11]) + AC_SUBST(XRESEXAMPLES_DEP_LIBS) + PKG_CHECK_MODULES([X11EXAMPLES_DEP], [$LIBXEXT x11]) + AC_SUBST(X11EXAMPLES_DEP_LIBS) + +fi +AM_CONDITIONAL([DMX_BUILD_LNX], [test "x$DMX_BUILD_LNX" = xyes]) +AM_CONDITIONAL([DMX_BUILD_USB], [test "x$DMX_BUILD_USB" = xyes]) + +dnl kdrive DDX + +XEPHYR_LIBS= +XEPHYR_INCS= + +AM_CONDITIONAL(KDRIVE, [test x$KDRIVE = xyes]) + +if test "$KDRIVE" = yes; then + AC_DEFINE(KDRIVESERVER,1,[Build Kdrive X server]) + AC_DEFINE(KDRIVEDDXACTIONS,,[Build kdrive ddx]) + + AC_CHECK_HEADERS([linux/fb.h]) + if test "$ac_cv_header_linux_fb_h" = yes && test "x$XFBDEV" = xauto; then + XFBDEV=yes + fi + + if test "x$XFBDEV" = xyes; then + KDRIVEFBDEVLIB=yes + AC_DEFINE(KDRIVEFBDEV, 1, [Build fbdev-based kdrive server]) + fi + + + PKG_CHECK_MODULES([TSLIB], [tslib-0.0], [HAVE_TSLIB="yes"], [HAVE_TSLIB="no"]) + if test "x$HAVE_TSLIB" = xno; then + AC_CHECK_LIB(ts, ts_open, [ + HAVE_TSLIB="yes" + TSLIB_LIBS="-lts" + ]) + fi + + if test "xTSLIB" = xauto; then + TSLIB="$HAVE_TSLIB" + fi + + if test "x$TSLIB" = xyes; then + if ! test "x$HAVE_TSLIB" = xyes; then + AC_MSG_ERROR([tslib must be installed to build the tslib driver. See http://tslib.berlios.de/]) + else + AC_DEFINE(TSLIB, 1, [Have tslib support]) + fi + fi + + if test "x$KDRIVE_KBD" = xyes; then + AC_DEFINE(KDRIVE_KBD, 1, [Enable KDrive kbd driver]) + fi + if test "x$KDRIVE_EVDEV" = xyes; then + AC_DEFINE(KDRIVE_EVDEV, 1, [Enable KDrive evdev driver]) + fi + if test "x$KDRIVE_MOUSE" = xyes; then + AC_DEFINE(KDRIVE_MOUSE, 1, [Enable KDrive mouse driver]) + fi + + XEPHYR_REQUIRED_LIBS="x11 $LIBXEXT xau xdmcp" + if test "x$XV" = xyes; then + XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS xv" + fi + if test "x$DRI" = xyes && test "x$GLX" = xyes; then + XEPHYR_REQUIRED_LIBS="$XEPHYR_REQUIRED_LIBS $LIBGL libdrm" + fi + + PKG_CHECK_MODULES(XEPHYR, $XEPHYR_REQUIRED_LIBS, [xephyr="yes"], [xephyr="no"]) + if test "x$XEPHYR" = xauto; then + XEPHYR=$xephyr + fi + if test "x$XEPHYR" = xyes && test "x$xephyr" = xno; then + AC_MSG_ERROR([Xephyr dependencies missing]) + fi + + # Xephyr needs nanosleep() which is in librt on Solaris + AC_CHECK_FUNC([nanosleep], [], + AC_CHECK_LIB([rt], [nanosleep], XEPHYR_LIBS="$XEPHYR_LIBS -lrt")) + + # damage shadow extension glx (NOTYET) fb mi + KDRIVE_INC='-I$(top_srcdir)/hw/kdrive/src' + KDRIVE_PURE_INCS="$KDRIVE_INC $MIEXT_SYNC_INC $MIEXT_DAMAGE_INC $MIEXT_SHADOW_INC $XEXT_INC $FB_INC $MI_INC" + KDRIVE_OS_INC='-I$(top_srcdir)/hw/kdrive/linux' + KDRIVE_INCS="$KDRIVE_PURE_INCS $KDRIVE_OS_INC" + + KDRIVE_CFLAGS="$XSERVER_CFLAGS -DHAVE_KDRIVE_CONFIG_H $TSLIB_CFLAGS" + + KDRIVE_PURE_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $OS_LIB" + KDRIVE_LIB='$(top_builddir)/hw/kdrive/src/libkdrive.la' + case $host_os in + *linux*) + KDRIVE_OS_LIB='$(top_builddir)/hw/kdrive/linux/liblinux.la' + KDRIVELINUX=yes + if test "x$KDRIVE_EVDEV" = xauto; then + KDRIVE_EVDEV=yes + fi + if test "x$KDRIVE_KBD" = xauto; then + KDRIVE_KBD=yes + fi + if test "x$KDRIVE_MOUSE" = xauto; then + KDRIVE_MOUSE=yes + fi + ;; + *) + if test "x$KDRIVE_EVDEV" = xauto; then + KDRIVE_EVDEV=no + fi + if test "x$KDRIVE_KBD" = xauto; then + KDRIVE_KBD=no + fi + if test "x$KDRIVE_MOUSE" = xauto; then + KDRIVE_MOUSE=no + fi + ;; + esac + KDRIVE_STUB_LIB='$(top_builddir)/hw/kdrive/src/libkdrivestubs.la' + KDRIVE_LOCAL_LIBS="$MAIN_LIB $DIX_LIB $KDRIVE_LIB $KDRIVE_STUB_LIB" + KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS" + KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB" + KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS $TSLIB_LIBS" + + AC_SUBST([XEPHYR_LIBS]) + AC_SUBST([XEPHYR_INCS]) +fi +AC_SUBST([KDRIVE_INCS]) +AC_SUBST([KDRIVE_PURE_INCS]) +AC_SUBST([KDRIVE_CFLAGS]) +AC_SUBST([KDRIVE_PURE_LIBS]) +AC_SUBST([KDRIVE_LOCAL_LIBS]) +AC_SUBST([KDRIVE_LIBS]) +AM_CONDITIONAL(KDRIVELINUX, [test "x$KDRIVELINUX" = xyes]) +AM_CONDITIONAL(KDRIVE_EVDEV, [test "x$KDRIVE_EVDEV" = xyes]) +AM_CONDITIONAL(KDRIVE_KBD, [test "x$KDRIVE_KBD" = xyes]) +AM_CONDITIONAL(KDRIVE_MOUSE, [test "x$KDRIVE_MOUSE" = xyes]) +AM_CONDITIONAL(TSLIB, [test "x$HAVE_TSLIB" = xyes]) +AM_CONDITIONAL(KDRIVEFBDEV, [test "x$XFBDEV" = xyes]) +AM_CONDITIONAL(XEPHYR, [test "x$KDRIVE" = xyes && test "x$XEPHYR" = xyes]) +AM_CONDITIONAL(BUILD_KDRIVEFBDEVLIB, [test "x$KDRIVE" = xyes && test "x$KDRIVEFBDEVLIB" = xyes]) +AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes]) + +dnl and the rest of these are generic, so they're in config.h +dnl +dnl though, thanks to the passing of some significant amount of time, the +dnl above is probably a complete fallacy, and you should not rely on it. +dnl but this is still actually better than imake, honest. -daniels + +AC_TRY_COMPILE([ +#include +#ifndef __GLIBC__ +#error not glibc +#endif +], [], [AC_DEFINE(_GNU_SOURCE, 1, + [ Enable GNU and other extensions to the C environment for glibc])]) + +AC_DEFINE_DIR(PROJECTROOT, prefix, [Overall prefix]) + +AC_SUBST([RELEASE_DATE]) +BUILD_DATE="`date +'%Y%m%d'`" +AC_SUBST([BUILD_DATE]) +BUILD_TIME="`date +'1%H%M%S'`" +AC_SUBST([BUILD_TIME]) + +DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS" + +AC_SUBST([DIX_CFLAGS]) + +AC_SUBST([libdir]) +AC_SUBST([exec_prefix]) +AC_SUBST([prefix]) + +AC_OUTPUT([ +Makefile +glx/Makefile +include/Makefile +composite/Makefile +damageext/Makefile +dbe/Makefile +dix/Makefile +doc/Makefile +doc/man/Makefile +doc/xml/Makefile +doc/xml/dtrace/Makefile +doc/xml/xserver.ent +fb/Makefile +record/Makefile +config/Makefile +mi/Makefile +miext/Makefile +miext/sync/Makefile +miext/damage/Makefile +miext/shadow/Makefile +miext/cw/Makefile +miext/rootless/Makefile +os/Makefile +randr/Makefile +render/Makefile +xkb/Makefile +Xext/Makefile +Xi/Makefile +xfixes/Makefile +exa/Makefile +hw/Makefile +hw/xfree86/Makefile +hw/xfree86/common/Makefile +hw/xfree86/common/xf86Build.h +hw/xfree86/ddc/Makefile +hw/xfree86/dixmods/Makefile +hw/xfree86/dixmods/extmod/Makefile +hw/xfree86/doc/Makefile +hw/xfree86/doc/devel/Makefile +hw/xfree86/doc/man/Makefile +hw/xfree86/doc/sgml/Makefile +hw/xfree86/dri/Makefile +hw/xfree86/dri2/Makefile +hw/xfree86/exa/Makefile +hw/xfree86/exa/man/Makefile +hw/xfree86/fbdevhw/Makefile +hw/xfree86/fbdevhw/man/Makefile +hw/xfree86/i2c/Makefile +hw/xfree86/int10/Makefile +hw/xfree86/loader/Makefile +hw/xfree86/modes/Makefile +hw/xfree86/os-support/Makefile +hw/xfree86/os-support/bsd/Makefile +hw/xfree86/os-support/bus/Makefile +hw/xfree86/os-support/hurd/Makefile +hw/xfree86/os-support/misc/Makefile +hw/xfree86/os-support/linux/Makefile +hw/xfree86/os-support/solaris/Makefile +hw/xfree86/parser/Makefile +hw/xfree86/ramdac/Makefile +hw/xfree86/shadowfb/Makefile +hw/xfree86/vbe/Makefile +hw/xfree86/vgahw/Makefile +hw/xfree86/x86emu/Makefile +hw/xfree86/xaa/Makefile +hw/xfree86/utils/Makefile +hw/xfree86/utils/man/Makefile +hw/xfree86/utils/cvt/Makefile +hw/xfree86/utils/gtf/Makefile +hw/dmx/config/Makefile +hw/dmx/config/man/Makefile +hw/dmx/doc/Makefile +hw/dmx/examples/Makefile +hw/dmx/input/Makefile +hw/dmx/glxProxy/Makefile +hw/dmx/Makefile +hw/dmx/man/Makefile +hw/vfb/Makefile +hw/vfb/man/Makefile +hw/xnest/Makefile +hw/xnest/man/Makefile +hw/xwin/Makefile +hw/xwin/glx/Makefile +hw/xwin/man/Makefile +hw/xquartz/Makefile +hw/xquartz/GL/Makefile +hw/xquartz/bundle/Makefile +hw/xquartz/man/Makefile +hw/xquartz/mach-startup/Makefile +hw/xquartz/pbproxy/Makefile +hw/xquartz/xpr/Makefile +hw/kdrive/Makefile +hw/kdrive/ephyr/Makefile +hw/kdrive/ephyr/man/Makefile +hw/kdrive/fake/Makefile +hw/kdrive/fbdev/Makefile +hw/kdrive/linux/Makefile +hw/kdrive/src/Makefile +test/Makefile +test/xi2/Makefile +xorg-server.pc +]) diff --git a/xorg-server/fb/Makefile.am b/xorg-server/fb/Makefile.am index 0863d7c07..1b0302ed1 100644 --- a/xorg-server/fb/Makefile.am +++ b/xorg-server/fb/Makefile.am @@ -1,9 +1,5 @@ noinst_LTLIBRARIES = libfb.la libwfb.la -INCLUDES = \ - -I$(top_srcdir)/hw/xfree86/os-support \ - -I$(top_srcdir)/hw/xfree86/os-support/bus \ - -I$(top_srcdir)/hw/xfree86/common AM_CFLAGS = $(DIX_CFLAGS) if XORG diff --git a/xorg-server/glx/glxcmds.c b/xorg-server/glx/glxcmds.c index 3ef567d10..d57dff5e0 100644 --- a/xorg-server/glx/glxcmds.c +++ b/xorg-server/glx/glxcmds.c @@ -1,2362 +1,2381 @@ -/* - * 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_DIX_CONFIG_H -#include -#endif - -#include -#include - -#include "glxserver.h" -#include -#include -#include -#include -#include "glxutil.h" -#include "glxext.h" -#include "glapitable.h" -#include "glapi.h" -#include "glthread.h" -#include "dispatch.h" -#include "indirect_dispatch.h" -#include "indirect_table.h" -#include "indirect_util.h" - -static int -validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err) -{ - /* - ** Check if screen exists. - */ - if (screen < 0 || screen >= screenInfo.numScreens) { - client->errorValue = screen; - *err = BadValue; - return FALSE; - } - *pGlxScreen = glxGetScreen(screenInfo.screens[screen]); - - return TRUE; -} - -static int -validGlxFBConfig(ClientPtr client, __GLXscreen *pGlxScreen, XID id, - __GLXconfig **config, int *err) -{ - __GLXconfig *m; - - for (m = pGlxScreen->fbconfigs; m != NULL; m = m->next) - if (m->fbconfigID == id) { - *config = m; - return TRUE; - } - - client->errorValue = id; - *err = __glXError(GLXBadFBConfig); - - return FALSE; -} - -static int -validGlxVisual(ClientPtr client, __GLXscreen *pGlxScreen, XID id, - __GLXconfig **config, int *err) -{ - int i; - - for (i = 0; i < pGlxScreen->numVisuals; i++) - if (pGlxScreen->visuals[i]->visualID == id) { - *config = pGlxScreen->visuals[i]; - return TRUE; - } - - client->errorValue = id; - *err = BadValue; - - return FALSE; -} - -static int -validGlxFBConfigForWindow(ClientPtr client, __GLXconfig *config, - DrawablePtr pDraw, int *err) -{ - ScreenPtr pScreen = pDraw->pScreen; - VisualPtr pVisual = NULL; - XID vid; - int i; - - vid = wVisual((WindowPtr)pDraw); - for (i = 0; i < pScreen->numVisuals; i++) { - if (pScreen->visuals[i].vid == vid) { - pVisual = &pScreen->visuals[i]; - break; - } - } - - /* FIXME: What exactly should we check here... */ - if (pVisual->class != glxConvertToXVisualType(config->visualType) || - !(config->drawableType & GLX_WINDOW_BIT)) { - client->errorValue = pDraw->id; - *err = BadMatch; - return FALSE; - } - - return TRUE; -} - -static int -validGlxContext(ClientPtr client, XID id, int access_mode, - __GLXcontext **context, int *err) -{ - *err = dixLookupResourceByType((pointer *) context, id, - __glXContextRes, client, access_mode); - if (*err != Success) { - client->errorValue = id; - if (*err == BadValue) - *err = __glXError(GLXBadContext); - return FALSE; - } - - return TRUE; -} - -static int -validGlxDrawable(ClientPtr client, XID id, int type, int access_mode, - __GLXdrawable **drawable, int *err) -{ - int rc; - - rc = dixLookupResourceByType((pointer *) drawable, id, - __glXDrawableRes, client, access_mode); - if (rc != Success && rc != BadValue) { - *err = rc; - client->errorValue = id; - return FALSE; - } - - /* If the ID of the glx drawable we looked up doesn't match the id - * we looked for, it's because we looked it up under the X - * drawable ID (see DoCreateGLXDrawable). */ - if (rc == BadValue || - (*drawable)->drawId != id || - (type != GLX_DRAWABLE_ANY && type != (*drawable)->type)) { - client->errorValue = id; - switch (type) { - case GLX_DRAWABLE_WINDOW: - *err = __glXError(GLXBadWindow); - return FALSE; - case GLX_DRAWABLE_PIXMAP: - *err = __glXError(GLXBadPixmap); - return FALSE; - case GLX_DRAWABLE_PBUFFER: - *err = __glXError(GLXBadPbuffer); - return FALSE; - case GLX_DRAWABLE_ANY: - *err = __glXError(GLXBadDrawable); - return FALSE; - } - } - - return TRUE; -} - -void -__glXContextDestroy(__GLXcontext *context) -{ - __glXFlushContextCache(); -} - -static void __glXdirectContextDestroy(__GLXcontext *context) -{ - __glXContextDestroy(context); - free(context); -} - -static __GLXcontext *__glXdirectContextCreate(__GLXscreen *screen, - __GLXconfig *modes, - __GLXcontext *shareContext) -{ - __GLXcontext *context; - - context = calloc(1, sizeof (__GLXcontext)); - if (context == NULL) - return NULL; - - context->destroy = __glXdirectContextDestroy; - - return context; -} - -/** - * Create a GL context with the given properties. This routine is used - * to implement \c glXCreateContext, \c glXCreateNewContext, and - * \c glXCreateContextWithConfigSGIX. This works becuase of the hack way - * that GLXFBConfigs are implemented. Basically, the FBConfigID is the - * same as the VisualID. - */ - -static int -DoCreateContext(__GLXclientState *cl, GLXContextID gcId, - GLXContextID shareList, __GLXconfig *config, - __GLXscreen *pGlxScreen, GLboolean isDirect) -{ - ClientPtr client = cl->client; - __GLXcontext *glxc, *shareglxc; - int err; - - LEGAL_NEW_RESOURCE(gcId, client); - - /* - ** Find the display list space that we want to share. - ** - ** NOTE: In a multithreaded X server, we would need to keep a reference - ** count for each display list so that if one client detroyed a list that - ** another client was using, the list would not really be freed until it - ** was no longer in use. Since this sample implementation has no support - ** for multithreaded servers, we don't do this. - */ - if (shareList == None) { - shareglxc = 0; - } else { - if (!validGlxContext(client, shareList, DixReadAccess, - &shareglxc, &err)) - return err; - - if (shareglxc->isDirect) { - /* - ** NOTE: no support for sharing display lists between direct - ** contexts, even if they are in the same address space. - */ -#if 0 - /* Disabling this code seems to allow shared display lists - * and texture objects to work. We'll leave it disabled for now. - */ - client->errorValue = shareList; - return BadMatch; -#endif - } else { - /* - ** Create an indirect context regardless of what the client asked - ** for; this way we can share display list space with shareList. - */ - isDirect = GL_FALSE; - } - } - - /* - ** Allocate memory for the new context - */ - if (!isDirect) - glxc = pGlxScreen->createContext(pGlxScreen, config, shareglxc); - else - glxc = __glXdirectContextCreate(pGlxScreen, config, shareglxc); - if (!glxc) { - return BadAlloc; - } - - /* - ** Initially, setup the part of the context that could be used by - ** a GL core that needs windowing information (e.g., Mesa). - */ - glxc->pGlxScreen = pGlxScreen; - glxc->config = config; - - /* - ** Register this context as a resource. - */ - if (!AddResource(gcId, __glXContextRes, (pointer)glxc)) { - (*glxc->destroy)(glxc); - client->errorValue = gcId; - return BadAlloc; - } - - /* - ** Finally, now that everything is working, setup the rest of the - ** context. - */ - glxc->id = gcId; - glxc->share_id = shareList; - glxc->idExists = GL_TRUE; - glxc->isCurrent = GL_FALSE; - glxc->isDirect = isDirect; - glxc->renderMode = GL_RENDER; - - __glXAddToContextList(glxc); - - return Success; -} - -int __glXDisp_CreateContext(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc; - __GLXconfig *config; - __GLXscreen *pGlxScreen; - int err; - - REQUEST_SIZE_MATCH(xGLXCreateContextReq); - - if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) - return err; - if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err)) - return err; - - return DoCreateContext(cl, req->context, req->shareList, - config, pGlxScreen, req->isDirect); -} - -int __glXDisp_CreateNewContext(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc; - __GLXconfig *config; - __GLXscreen *pGlxScreen; - int err; - - REQUEST_SIZE_MATCH(xGLXCreateNewContextReq); - - if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) - return err; - if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err)) - return err; - - return DoCreateContext(cl, req->context, req->shareList, - config, pGlxScreen, req->isDirect); -} - -int __glXDisp_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCreateContextWithConfigSGIXReq *req = - (xGLXCreateContextWithConfigSGIXReq *) pc; - __GLXconfig *config; - __GLXscreen *pGlxScreen; - int err; - - REQUEST_SIZE_MATCH(xGLXCreateContextWithConfigSGIXReq); - - if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) - return err; - if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err)) - return err; - - return DoCreateContext(cl, req->context, req->shareList, - config, pGlxScreen, req->isDirect); -} -int __glXDisp_DestroyContext(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc; - __GLXcontext *glxc; - int err; - - REQUEST_SIZE_MATCH(xGLXDestroyContextReq); - - if (!validGlxContext(cl->client, req->context, DixDestroyAccess, - &glxc, &err)) - return err; - - FreeResourceByType(req->context, __glXContextRes, FALSE); - return Success; -} - -/*****************************************************************************/ - -/* -** For each client, the server keeps a table of all the contexts that are -** current for that client (each thread of a client may have its own current -** context). These routines add, change, and lookup contexts in the table. -*/ - -/* -** Add a current context, and return the tag that will be used to refer to it. -*/ -static int AddCurrentContext(__GLXclientState *cl, __GLXcontext *glxc) -{ - int i; - int num = cl->numCurrentContexts; - __GLXcontext **table = cl->currentContexts; - - if (!glxc) return -1; - - /* - ** Try to find an empty slot and use it. - */ - for (i=0; i < num; i++) { - if (!table[i]) { - table[i] = glxc; - return i+1; - } - } - /* - ** Didn't find a free slot, so we'll have to grow the table. - */ - if (!num) { - table = (__GLXcontext **) malloc(sizeof(__GLXcontext *)); - } else { - table = (__GLXcontext **) realloc(table, - (num+1)*sizeof(__GLXcontext *)); - } - table[num] = glxc; - cl->currentContexts = table; - cl->numCurrentContexts++; - return num+1; -} - -/* -** Given a tag, change the current context for the corresponding entry. -*/ -static void ChangeCurrentContext(__GLXclientState *cl, __GLXcontext *glxc, - GLXContextTag tag) -{ - __GLXcontext **table = cl->currentContexts; - table[tag-1] = glxc; -} - -/* -** For this implementation we have chosen to simply use the index of the -** context's entry in the table as the context tag. A tag must be greater -** than 0. -*/ -__GLXcontext *__glXLookupContextByTag(__GLXclientState *cl, GLXContextTag tag) -{ - int num = cl->numCurrentContexts; - - if (tag < 1 || tag > num) { - return 0; - } else { - return cl->currentContexts[tag-1]; - } -} - -/*****************************************************************************/ - -static void StopUsingContext(__GLXcontext *glxc) -{ - if (glxc) { - if (glxc == __glXLastContext) { - /* Tell server GL library */ - __glXLastContext = 0; - } - glxc->isCurrent = GL_FALSE; - if (!glxc->idExists) { - __glXFreeContext(glxc); - } - } -} - -static void StartUsingContext(__GLXclientState *cl, __GLXcontext *glxc) -{ - glxc->isCurrent = GL_TRUE; - __glXLastContext = glxc; -} - -/** - * This is a helper function to handle the legacy (pre GLX 1.3) cases - * where passing an X window to glXMakeCurrent is valid. Given a - * resource ID, look up the GLX drawable if available, otherwise, make - * sure it's an X window and create a GLX drawable one the fly. - */ -static __GLXdrawable * -__glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client, - int *error) -{ - DrawablePtr pDraw; - __GLXdrawable *pGlxDraw; - int rc; - - if (validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY, - DixWriteAccess, &pGlxDraw, &rc)) { - if (glxc != NULL && pGlxDraw->config != glxc->config) { - client->errorValue = drawId; - *error = BadMatch; - return NULL; - } - - return pGlxDraw; - } - - /* No active context and an unknown drawable, bail. */ - if (glxc == NULL) { - client->errorValue = drawId; - *error = BadMatch; - return NULL; - } - - /* The drawId wasn't a GLX drawable. Make sure it's a window and - * create a GLXWindow for it. Check that the drawable screen - * matches the context screen and that the context fbconfig is - * compatible with the window visual. */ - - rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixGetAttrAccess); - if (rc != Success || pDraw->type != DRAWABLE_WINDOW) { - client->errorValue = drawId; - *error = __glXError(GLXBadDrawable); - return NULL; - } - - if (pDraw->pScreen != glxc->pGlxScreen->pScreen) { - client->errorValue = pDraw->pScreen->myNum; - *error = BadMatch; - return NULL; - } - - if (!validGlxFBConfigForWindow(client, glxc->config, pDraw, error)) - return NULL; - - pGlxDraw = glxc->pGlxScreen->createDrawable(client, glxc->pGlxScreen, - pDraw, drawId, - GLX_DRAWABLE_WINDOW, - drawId, glxc->config); - - /* since we are creating the drawablePrivate, drawId should be new */ - if (!AddResource(drawId, __glXDrawableRes, pGlxDraw)) { - pGlxDraw->destroy (pGlxDraw); - *error = BadAlloc; - return NULL; - } - - return pGlxDraw; -} - -/*****************************************************************************/ -/* -** Make an OpenGL context and drawable current. -*/ - -static int -DoMakeCurrent(__GLXclientState *cl, - GLXDrawable drawId, GLXDrawable readId, - GLXContextID contextId, GLXContextTag tag) -{ - ClientPtr client = cl->client; - xGLXMakeCurrentReply reply; - __GLXcontext *glxc, *prevglxc; - __GLXdrawable *drawPriv = NULL; - __GLXdrawable *readPriv = NULL; - int error; - GLuint mask; - - /* - ** If one is None and the other isn't, it's a bad match. - */ - - mask = (drawId == None) ? (1 << 0) : 0; - mask |= (readId == None) ? (1 << 1) : 0; - mask |= (contextId == None) ? (1 << 2) : 0; - - if ( (mask != 0x00) && (mask != 0x07) ) { - return BadMatch; - } - - /* - ** Lookup old context. If we have one, it must be in a usable state. - */ - if (tag != 0) { - prevglxc = __glXLookupContextByTag(cl, tag); - if (!prevglxc) { - /* - ** Tag for previous context is invalid. - */ - return __glXError(GLXBadContextTag); - } - if (prevglxc->renderMode != GL_RENDER) { - /* Oops. Not in render mode render. */ - client->errorValue = prevglxc->id; - return __glXError(GLXBadContextState); - } - } else { - prevglxc = 0; - } - - /* - ** Lookup new context. It must not be current for someone else. - */ - if (contextId != None) { - int status; - - if (!validGlxContext(client, contextId, DixUseAccess, &glxc, &error)) - return error; - if ((glxc != prevglxc) && glxc->isCurrent) { - /* Context is current to somebody else */ - return BadAccess; - } - - assert( drawId != None ); - assert( readId != None ); - - drawPriv = __glXGetDrawable(glxc, drawId, client, &status); - if (drawPriv == NULL) - return status; - - readPriv = __glXGetDrawable(glxc, readId, client, &status); - if (readPriv == NULL) - return status; - - } else { - /* Switching to no context. Ignore new drawable. */ - glxc = 0; - drawPriv = 0; - readPriv = 0; - } - - - if (prevglxc) { - /* - ** Flush the previous context if needed. - */ - if (__GLX_HAS_UNFLUSHED_CMDS(prevglxc)) { - if (__glXForceCurrent(cl, tag, (int *)&error)) { - CALL_Flush( GET_DISPATCH(), () ); - __GLX_NOTE_FLUSHED_CMDS(prevglxc); - } else { - return error; - } - } - - /* - ** Make the previous context not current. - */ - if (!(*prevglxc->loseCurrent)(prevglxc)) { - return __glXError(GLXBadContext); - } - __glXFlushContextCache(); - if (!prevglxc->isDirect) { - prevglxc->drawPriv = NULL; - prevglxc->readPriv = NULL; - } - } - - - if ((glxc != 0) && !glxc->isDirect) { - - glxc->drawPriv = drawPriv; - glxc->readPriv = readPriv; - - /* make the context current */ - if (!(*glxc->makeCurrent)(glxc)) { - glxc->drawPriv = NULL; - glxc->readPriv = NULL; - return __glXError(GLXBadContext); - } - - glxc->isCurrent = GL_TRUE; - } - - if (prevglxc) { - ChangeCurrentContext(cl, glxc, tag); - StopUsingContext(prevglxc); - } else { - tag = AddCurrentContext(cl, glxc); - } - - if (glxc) { - StartUsingContext(cl, glxc); - reply.contextTag = tag; - } else { - reply.contextTag = 0; - } - - reply.length = 0; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - - if (client->swapped) { - __glXSwapMakeCurrentReply(client, &reply); - } else { - WriteToClient(client, sz_xGLXMakeCurrentReply, (char *)&reply); - } - return Success; -} - -int __glXDisp_MakeCurrent(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc; - - REQUEST_SIZE_MATCH(xGLXMakeCurrentReq); - - return DoMakeCurrent( cl, req->drawable, req->drawable, - req->context, req->oldContextTag ); -} - -int __glXDisp_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc; - - REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq); - - return DoMakeCurrent( cl, req->drawable, req->readdrawable, - req->context, req->oldContextTag ); -} - -int __glXDisp_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc; - - REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq); - - return DoMakeCurrent( cl, req->drawable, req->readable, - req->context, req->oldContextTag ); -} - -int __glXDisp_IsDirect(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc; - xGLXIsDirectReply reply; - __GLXcontext *glxc; - int err; - - REQUEST_SIZE_MATCH(xGLXIsDirectReq); - - if (!validGlxContext(cl->client, req->context, DixReadAccess, &glxc, &err)) - return err; - - reply.isDirect = glxc->isDirect; - reply.length = 0; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - - if (client->swapped) { - __glXSwapIsDirectReply(client, &reply); - } else { - WriteToClient(client, sz_xGLXIsDirectReply, (char *)&reply); - } - - return Success; -} - -int __glXDisp_QueryVersion(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc; - xGLXQueryVersionReply reply; - GLuint major, minor; - - REQUEST_SIZE_MATCH(xGLXQueryVersionReq); - - major = req->majorVersion; - minor = req->minorVersion; - (void)major; - (void)minor; - - /* - ** Server should take into consideration the version numbers sent by the - ** client if it wants to work with older clients; however, in this - ** implementation the server just returns its version number. - */ - reply.majorVersion = glxMajorVersion; - reply.minorVersion = glxMinorVersion; - reply.length = 0; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - - if (client->swapped) { - __glXSwapQueryVersionReply(client, &reply); - } else { - WriteToClient(client, sz_xGLXQueryVersionReply, (char *)&reply); - } - return Success; -} - -int __glXDisp_WaitGL(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXWaitGLReq *req = (xGLXWaitGLReq *)pc; - GLXContextTag tag; - __GLXcontext *glxc = NULL; - int error; - - REQUEST_SIZE_MATCH(xGLXWaitGLReq); - - tag = req->contextTag; - if (tag) { - glxc = __glXLookupContextByTag(cl, tag); - if (!glxc) - return __glXError(GLXBadContextTag); - - if (!__glXForceCurrent(cl, req->contextTag, &error)) - return error; - - CALL_Finish( GET_DISPATCH(), () ); - } - - if (glxc && glxc->drawPriv->waitGL) - (*glxc->drawPriv->waitGL)(glxc->drawPriv); - - return Success; -} - -int __glXDisp_WaitX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXWaitXReq *req = (xGLXWaitXReq *)pc; - GLXContextTag tag; - __GLXcontext *glxc = NULL; - int error; - - REQUEST_SIZE_MATCH(xGLXWaitXReq); - - tag = req->contextTag; - if (tag) { - glxc = __glXLookupContextByTag(cl, tag); - if (!glxc) - return __glXError(GLXBadContextTag); - - if (!__glXForceCurrent(cl, req->contextTag, &error)) - return error; - } - - if (glxc && glxc->drawPriv->waitX) - (*glxc->drawPriv->waitX)(glxc->drawPriv); - - return Success; -} - -int __glXDisp_CopyContext(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc; - GLXContextID source; - GLXContextID dest; - GLXContextTag tag; - unsigned long mask; - __GLXcontext *src, *dst; - int error; - - REQUEST_SIZE_MATCH(xGLXCopyContextReq); - - source = req->source; - dest = req->dest; - tag = req->contextTag; - mask = req->mask; - if (!validGlxContext(cl->client, source, DixReadAccess, &src, &error)) - return error; - if (!validGlxContext(cl->client, dest, DixWriteAccess, &dst, &error)) - return error; - - /* - ** They must be in the same address space, and same screen. - ** NOTE: no support for direct rendering contexts here. - */ - if (src->isDirect || dst->isDirect || - (src->pGlxScreen != dst->pGlxScreen)) { - client->errorValue = source; - return BadMatch; - } - - /* - ** The destination context must not be current for any client. - */ - if (dst->isCurrent) { - client->errorValue = dest; - return BadAccess; - } - - if (tag) { - __GLXcontext *tagcx = __glXLookupContextByTag(cl, tag); - - if (!tagcx) { - return __glXError(GLXBadContextTag); - } - if (tagcx != src) { - /* - ** This would be caused by a faulty implementation of the client - ** library. - */ - return BadMatch; - } - /* - ** In this case, glXCopyContext is in both GL and X streams, in terms - ** of sequentiality. - */ - if (__glXForceCurrent(cl, tag, &error)) { - /* - ** Do whatever is needed to make sure that all preceding requests - ** in both streams are completed before the copy is executed. - */ - CALL_Finish( GET_DISPATCH(), () ); - __GLX_NOTE_FLUSHED_CMDS(tagcx); - } else { - return error; - } - } - /* - ** Issue copy. The only reason for failure is a bad mask. - */ - if (!(*dst->copy)(dst, src, mask)) { - client->errorValue = mask; - return BadValue; - } - return Success; -} - -enum { - GLX_VIS_CONFIG_UNPAIRED = 18, - GLX_VIS_CONFIG_PAIRED = 20 -}; - -enum { - GLX_VIS_CONFIG_TOTAL = GLX_VIS_CONFIG_UNPAIRED + GLX_VIS_CONFIG_PAIRED -}; - -int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc) -{ - xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc; - ClientPtr client = cl->client; - xGLXGetVisualConfigsReply reply; - __GLXscreen *pGlxScreen; - __GLXconfig *modes; - CARD32 buf[GLX_VIS_CONFIG_TOTAL]; - int p, i, err; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq); - - if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) - return err; - - reply.numVisuals = pGlxScreen->numVisuals; - reply.numProps = GLX_VIS_CONFIG_TOTAL; - reply.length = (reply.numVisuals * __GLX_SIZE_CARD32 * GLX_VIS_CONFIG_TOTAL) >> 2; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - - if (client->swapped) { - __GLX_SWAP_SHORT(&reply.sequenceNumber); - __GLX_SWAP_INT(&reply.length); - __GLX_SWAP_INT(&reply.numVisuals); - __GLX_SWAP_INT(&reply.numProps); - } - - WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *)&reply); - - for (i = 0; i < pGlxScreen->numVisuals; i++) { - modes = pGlxScreen->visuals[i]; - - p = 0; - buf[p++] = modes->visualID; - buf[p++] = glxConvertToXVisualType( modes->visualType ); - buf[p++] = (modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE; - - buf[p++] = modes->redBits; - buf[p++] = modes->greenBits; - buf[p++] = modes->blueBits; - buf[p++] = modes->alphaBits; - buf[p++] = modes->accumRedBits; - buf[p++] = modes->accumGreenBits; - buf[p++] = modes->accumBlueBits; - buf[p++] = modes->accumAlphaBits; - - buf[p++] = modes->doubleBufferMode; - buf[p++] = modes->stereoMode; - - buf[p++] = modes->rgbBits; - buf[p++] = modes->depthBits; - buf[p++] = modes->stencilBits; - buf[p++] = modes->numAuxBuffers; - buf[p++] = modes->level; - - assert(p == GLX_VIS_CONFIG_UNPAIRED); - /* - ** Add token/value pairs for extensions. - */ - buf[p++] = GLX_VISUAL_CAVEAT_EXT; - buf[p++] = modes->visualRating; - buf[p++] = GLX_TRANSPARENT_TYPE; - buf[p++] = modes->transparentPixel; - buf[p++] = GLX_TRANSPARENT_RED_VALUE; - buf[p++] = modes->transparentRed; - buf[p++] = GLX_TRANSPARENT_GREEN_VALUE; - buf[p++] = modes->transparentGreen; - buf[p++] = GLX_TRANSPARENT_BLUE_VALUE; - buf[p++] = modes->transparentBlue; - buf[p++] = GLX_TRANSPARENT_ALPHA_VALUE; - buf[p++] = modes->transparentAlpha; - buf[p++] = GLX_TRANSPARENT_INDEX_VALUE; - buf[p++] = modes->transparentIndex; - buf[p++] = GLX_SAMPLES_SGIS; - buf[p++] = modes->samples; - buf[p++] = GLX_SAMPLE_BUFFERS_SGIS; - buf[p++] = modes->sampleBuffers; - buf[p++] = 0; /* copy over visualSelectGroup (GLX_VISUAL_SELECT_GROUP_SGIX)? */ - buf[p++] = 0; - - assert(p == GLX_VIS_CONFIG_TOTAL); - if (client->swapped) { - __GLX_SWAP_INT_ARRAY(buf, p); - } - WriteToClient(client, __GLX_SIZE_CARD32 * p, (char *)buf); - } - return Success; -} - -#define __GLX_TOTAL_FBCONFIG_ATTRIBS (36) -#define __GLX_FBCONFIG_ATTRIBS_LENGTH (__GLX_TOTAL_FBCONFIG_ATTRIBS * 2) -/** - * Send the set of GLXFBConfigs to the client. There is not currently - * and interface into the driver on the server-side to get GLXFBConfigs, - * so we "invent" some based on the \c __GLXvisualConfig structures that - * the driver does supply. - * - * The reply format for both \c glXGetFBConfigs and \c glXGetFBConfigsSGIX - * is the same, so this routine pulls double duty. - */ - -static int -DoGetFBConfigs(__GLXclientState *cl, unsigned screen) -{ - ClientPtr client = cl->client; - xGLXGetFBConfigsReply reply; - __GLXscreen *pGlxScreen; - CARD32 buf[__GLX_FBCONFIG_ATTRIBS_LENGTH]; - int p, err; - __GLXconfig *modes; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - - if (!validGlxScreen(cl->client, screen, &pGlxScreen, &err)) - return err; - - reply.numFBConfigs = pGlxScreen->numFBConfigs; - reply.numAttribs = __GLX_TOTAL_FBCONFIG_ATTRIBS; - reply.length = (__GLX_FBCONFIG_ATTRIBS_LENGTH * reply.numFBConfigs); - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - - if (client->swapped) { - __GLX_SWAP_SHORT(&reply.sequenceNumber); - __GLX_SWAP_INT(&reply.length); - __GLX_SWAP_INT(&reply.numFBConfigs); - __GLX_SWAP_INT(&reply.numAttribs); - } - - WriteToClient(client, sz_xGLXGetFBConfigsReply, (char *)&reply); - - for (modes = pGlxScreen->fbconfigs; modes != NULL; modes = modes->next) { - p = 0; - -#define WRITE_PAIR(tag,value) \ - do { buf[p++] = tag ; buf[p++] = value ; } while( 0 ) - - WRITE_PAIR( GLX_VISUAL_ID, modes->visualID ); - WRITE_PAIR( GLX_FBCONFIG_ID, modes->fbconfigID ); - WRITE_PAIR( GLX_X_RENDERABLE, GL_TRUE ); - - WRITE_PAIR( GLX_RGBA, - (modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE ); - WRITE_PAIR( GLX_RENDER_TYPE, modes->renderType ); - WRITE_PAIR( GLX_DOUBLEBUFFER, modes->doubleBufferMode ); - WRITE_PAIR( GLX_STEREO, modes->stereoMode ); - - WRITE_PAIR( GLX_BUFFER_SIZE, modes->rgbBits ); - WRITE_PAIR( GLX_LEVEL, modes->level ); - WRITE_PAIR( GLX_AUX_BUFFERS, modes->numAuxBuffers ); - WRITE_PAIR( GLX_RED_SIZE, modes->redBits ); - WRITE_PAIR( GLX_GREEN_SIZE, modes->greenBits ); - WRITE_PAIR( GLX_BLUE_SIZE, modes->blueBits ); - WRITE_PAIR( GLX_ALPHA_SIZE, modes->alphaBits ); - WRITE_PAIR( GLX_ACCUM_RED_SIZE, modes->accumRedBits ); - WRITE_PAIR( GLX_ACCUM_GREEN_SIZE, modes->accumGreenBits ); - WRITE_PAIR( GLX_ACCUM_BLUE_SIZE, modes->accumBlueBits ); - WRITE_PAIR( GLX_ACCUM_ALPHA_SIZE, modes->accumAlphaBits ); - WRITE_PAIR( GLX_DEPTH_SIZE, modes->depthBits ); - WRITE_PAIR( GLX_STENCIL_SIZE, modes->stencilBits ); - WRITE_PAIR( GLX_X_VISUAL_TYPE, modes->visualType ); - WRITE_PAIR( GLX_CONFIG_CAVEAT, modes->visualRating ); - WRITE_PAIR( GLX_TRANSPARENT_TYPE, modes->transparentPixel ); - WRITE_PAIR( GLX_TRANSPARENT_RED_VALUE, modes->transparentRed ); - WRITE_PAIR( GLX_TRANSPARENT_GREEN_VALUE, modes->transparentGreen ); - WRITE_PAIR( GLX_TRANSPARENT_BLUE_VALUE, modes->transparentBlue ); - WRITE_PAIR( GLX_TRANSPARENT_ALPHA_VALUE, modes->transparentAlpha ); - WRITE_PAIR( GLX_TRANSPARENT_INDEX_VALUE, modes->transparentIndex ); - WRITE_PAIR( GLX_SWAP_METHOD_OML, modes->swapMethod ); - WRITE_PAIR( GLX_SAMPLES_SGIS, modes->samples ); - WRITE_PAIR( GLX_SAMPLE_BUFFERS_SGIS, modes->sampleBuffers ); - /* GLX_VISUAL_SELECT_GROUP_SGIX ? */ - WRITE_PAIR( GLX_DRAWABLE_TYPE, modes->drawableType ); - WRITE_PAIR( GLX_BIND_TO_TEXTURE_RGB_EXT, modes->bindToTextureRgb ); - WRITE_PAIR( GLX_BIND_TO_TEXTURE_RGBA_EXT, modes->bindToTextureRgba ); - WRITE_PAIR( GLX_BIND_TO_MIPMAP_TEXTURE_EXT, modes->bindToMipmapTexture ); - WRITE_PAIR( GLX_BIND_TO_TEXTURE_TARGETS_EXT, modes->bindToTextureTargets ); - - if (client->swapped) { - __GLX_SWAP_INT_ARRAY(buf, __GLX_FBCONFIG_ATTRIBS_LENGTH); - } - WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_FBCONFIG_ATTRIBS_LENGTH, - (char *)buf); - } - return Success; -} - - -int __glXDisp_GetFBConfigs(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc; - REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq); - return DoGetFBConfigs(cl, req->screen); -} - -int __glXDisp_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc; - REQUEST_SIZE_MATCH(xGLXGetFBConfigsSGIXReq); - return DoGetFBConfigs(cl, req->screen); -} - -GLboolean -__glXDrawableInit(__GLXdrawable *drawable, - __GLXscreen *screen, DrawablePtr pDraw, int type, - XID drawId, __GLXconfig *config) -{ - drawable->pDraw = pDraw; - drawable->type = type; - drawable->drawId = drawId; - drawable->config = config; - drawable->eventMask = 0; - - return GL_TRUE; -} - -void -__glXDrawableRelease(__GLXdrawable *drawable) -{ -} - -static int -DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen, - __GLXconfig *config, DrawablePtr pDraw, XID drawableId, - XID glxDrawableId, int type) -{ - __GLXdrawable *pGlxDraw; - - if (pGlxScreen->pScreen != pDraw->pScreen) - return BadMatch; - - pGlxDraw = pGlxScreen->createDrawable(client, pGlxScreen, pDraw, - drawableId, type, - glxDrawableId, config); - if (pGlxDraw == NULL) - return BadAlloc; - - if (!AddResource(glxDrawableId, __glXDrawableRes, pGlxDraw)) { - pGlxDraw->destroy (pGlxDraw); - return BadAlloc; - } - - /* Add the glx drawable under the XID of the underlying X drawable - * too. That way we'll get a callback in DrawableGone and can - * clean up properly when the drawable is destroyed. */ - if (drawableId != glxDrawableId && - !AddResource(pDraw->id, __glXDrawableRes, pGlxDraw)) { - pGlxDraw->destroy (pGlxDraw); - return BadAlloc; - } - - return Success; -} - -static int -DoCreateGLXPixmap(ClientPtr client, __GLXscreen *pGlxScreen, __GLXconfig *config, - XID drawableId, XID glxDrawableId) -{ - DrawablePtr pDraw; - int err; - - LEGAL_NEW_RESOURCE(glxDrawableId, client); - - err = dixLookupDrawable(&pDraw, drawableId, client, 0, DixAddAccess); - if (err != Success) { - client->errorValue = drawableId; - return err; - } - if (pDraw->type != DRAWABLE_PIXMAP) { - client->errorValue = drawableId; - return BadPixmap; - } - - err = DoCreateGLXDrawable(client, pGlxScreen, config, pDraw, drawableId, - glxDrawableId, GLX_DRAWABLE_PIXMAP); - - return err; -} - -static void -determineTextureTarget(ClientPtr client, XID glxDrawableID, - CARD32 *attribs, CARD32 numAttribs) -{ - GLenum target = 0; - GLenum format = 0; - int i, err; - __GLXdrawable *pGlxDraw; - - if (!validGlxDrawable(client, glxDrawableID, GLX_DRAWABLE_PIXMAP, - DixWriteAccess, &pGlxDraw, &err)) - /* We just added it in CreatePixmap, so we should never get here. */ - return; - - for (i = 0; i < numAttribs; i++) { - if (attribs[2 * i] == GLX_TEXTURE_TARGET_EXT) { - switch (attribs[2 * i + 1]) { - case GLX_TEXTURE_2D_EXT: - target = GL_TEXTURE_2D; - break; - case GLX_TEXTURE_RECTANGLE_EXT: - target = GL_TEXTURE_RECTANGLE_ARB; - break; - } - } - - if (attribs[2 * i] == GLX_TEXTURE_FORMAT_EXT) - format = attribs[2 * i + 1]; - } - - if (!target) { - int w = pGlxDraw->pDraw->width, h = pGlxDraw->pDraw->height; - - if (h & (h - 1) || w & (w - 1)) - target = GL_TEXTURE_RECTANGLE_ARB; - else - target = GL_TEXTURE_2D; - } - - pGlxDraw->target = target; - pGlxDraw->format = format; -} - -int __glXDisp_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc; - __GLXconfig *config; - __GLXscreen *pGlxScreen; - int err; - - REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq); - - if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) - return err; - if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err)) - return err; - - return DoCreateGLXPixmap(cl->client, pGlxScreen, config, - req->pixmap, req->glxpixmap); -} - -int __glXDisp_CreatePixmap(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc; - __GLXconfig *config; - __GLXscreen *pGlxScreen; - int err; - - REQUEST_AT_LEAST_SIZE(xGLXCreatePixmapReq); - if (req->numAttribs > (UINT32_MAX >> 3)) { - client->errorValue = req->numAttribs; - return BadValue; - } - REQUEST_FIXED_SIZE(xGLXCreatePixmapReq, req->numAttribs << 3); - - if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) - return err; - if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err)) - return err; - - err = DoCreateGLXPixmap(cl->client, pGlxScreen, config, - req->pixmap, req->glxpixmap); - if (err != Success) - return err; - - determineTextureTarget(cl->client, req->glxpixmap, - (CARD32*) (req + 1), req->numAttribs); - - return Success; -} - -int __glXDisp_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCreateGLXPixmapWithConfigSGIXReq *req = - (xGLXCreateGLXPixmapWithConfigSGIXReq *) pc; - __GLXconfig *config; - __GLXscreen *pGlxScreen; - int err; - - REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapWithConfigSGIXReq); - - if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) - return err; - if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err)) - return err; - - return DoCreateGLXPixmap(cl->client, pGlxScreen, - config, req->pixmap, req->glxpixmap); -} - - -static int DoDestroyDrawable(__GLXclientState *cl, XID glxdrawable, int type) -{ - __GLXdrawable *pGlxDraw; - int err; - - if (!validGlxDrawable(cl->client, glxdrawable, type, - DixDestroyAccess, &pGlxDraw, &err)) - return err; - - FreeResource(glxdrawable, FALSE); - - return Success; -} - -int __glXDisp_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc; - - REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq); - - return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP); -} - -int __glXDisp_DestroyPixmap(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXDestroyPixmapReq *req = (xGLXDestroyPixmapReq *) pc; - - REQUEST_SIZE_MATCH(xGLXDestroyPixmapReq); - - return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP); -} - -static int -DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId, - int width, int height, XID glxDrawableId) -{ - __GLXconfig *config; - __GLXscreen *pGlxScreen; - PixmapPtr pPixmap; - int err; - - LEGAL_NEW_RESOURCE(glxDrawableId, client); - - if (!validGlxScreen(client, screenNum, &pGlxScreen, &err)) - return err; - if (!validGlxFBConfig(client, pGlxScreen, fbconfigId, &config, &err)) - return err; - - __glXenterServer(GL_FALSE); - pPixmap = (*pGlxScreen->pScreen->CreatePixmap) (pGlxScreen->pScreen, - width, height, config->rgbBits, 0); - __glXleaveServer(GL_FALSE); - - /* Assign the pixmap the same id as the pbuffer and add it as a - * resource so it and the DRI2 drawable will be reclaimed when the - * pbuffer is destroyed. */ - pPixmap->drawable.id = glxDrawableId; - if (!AddResource(pPixmap->drawable.id, RT_PIXMAP, pPixmap)) - return BadAlloc; - - return DoCreateGLXDrawable(client, pGlxScreen, config, &pPixmap->drawable, - glxDrawableId, glxDrawableId, - GLX_DRAWABLE_PBUFFER); -} - -int __glXDisp_CreatePbuffer(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc; - CARD32 *attrs; - int width, height, i; - - REQUEST_AT_LEAST_SIZE(xGLXCreatePbufferReq); - if (req->numAttribs > (UINT32_MAX >> 3)) { - client->errorValue = req->numAttribs; - return BadValue; - } - REQUEST_FIXED_SIZE(xGLXCreatePbufferReq, req->numAttribs << 3); - - attrs = (CARD32 *) (req + 1); - width = 0; - height = 0; - - for (i = 0; i < req->numAttribs; i++) { - switch (attrs[i * 2]) { - case GLX_PBUFFER_WIDTH: - width = attrs[i * 2 + 1]; - break; - case GLX_PBUFFER_HEIGHT: - height = attrs[i * 2 + 1]; - break; - case GLX_LARGEST_PBUFFER: - case GLX_PRESERVED_CONTENTS: - /* FIXME: huh... */ - break; - } - } - - return DoCreatePbuffer(cl->client, req->screen, req->fbconfig, - width, height, req->pbuffer); -} - -int __glXDisp_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc; - - REQUEST_SIZE_MATCH(xGLXCreateGLXPbufferSGIXReq); - - return DoCreatePbuffer(cl->client, req->screen, req->fbconfig, - req->width, req->height, req->pbuffer); -} - -int __glXDisp_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc; - - REQUEST_SIZE_MATCH(xGLXDestroyPbufferReq); - - return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER); -} - -int __glXDisp_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc; - - REQUEST_SIZE_MATCH(xGLXDestroyGLXPbufferSGIXReq); - - return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER); -} - -static int -DoChangeDrawableAttributes(ClientPtr client, XID glxdrawable, - int numAttribs, CARD32 *attribs) -{ - __GLXdrawable *pGlxDraw; - int i, err; - - if (!validGlxDrawable(client, glxdrawable, GLX_DRAWABLE_ANY, - DixSetAttrAccess, &pGlxDraw, &err)) - return err; - - for (i = 0; i < numAttribs; i++) { - switch(attribs[i * 2]) { - case GLX_EVENT_MASK: - /* All we do is to record the event mask so we can send it - * back when queried. We never actually clobber the - * pbuffers, so we never need to send out the event. */ - pGlxDraw->eventMask = attribs[i * 2 + 1]; - break; - } - } - - return Success; -} - -int __glXDisp_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXChangeDrawableAttributesReq *req = - (xGLXChangeDrawableAttributesReq *) pc; - - REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesReq); - if (req->numAttribs > (UINT32_MAX >> 3)) { - client->errorValue = req->numAttribs; - return BadValue; - } - REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesReq, req->numAttribs << 3); - - return DoChangeDrawableAttributes(cl->client, req->drawable, - req->numAttribs, (CARD32 *) (req + 1)); -} - -int __glXDisp_ChangeDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXChangeDrawableAttributesSGIXReq *req = - (xGLXChangeDrawableAttributesSGIXReq *)pc; - - REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesSGIXReq); - if (req->numAttribs > (UINT32_MAX >> 3)) { - client->errorValue = req->numAttribs; - return BadValue; - } - REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesSGIXReq, req->numAttribs << 3); - - return DoChangeDrawableAttributes(cl->client, req->drawable, - req->numAttribs, (CARD32 *) (req + 1)); -} - -int __glXDisp_CreateWindow(__GLXclientState *cl, GLbyte *pc) -{ - xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc; - __GLXconfig *config; - __GLXscreen *pGlxScreen; - ClientPtr client = cl->client; - DrawablePtr pDraw; - int err; - - REQUEST_AT_LEAST_SIZE(xGLXCreateWindowReq); - if (req->numAttribs > (UINT32_MAX >> 3)) { - client->errorValue = req->numAttribs; - return BadValue; - } - REQUEST_FIXED_SIZE(xGLXCreateWindowReq, req->numAttribs << 3); - - LEGAL_NEW_RESOURCE(req->glxwindow, client); - - if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) - return err; - if (!validGlxFBConfig(client, pGlxScreen, req->fbconfig, &config, &err)) - return err; - - err = dixLookupDrawable(&pDraw, req->window, client, 0, DixAddAccess); - if (err != Success || pDraw->type != DRAWABLE_WINDOW) { - client->errorValue = req->window; - return BadWindow; - } - - if (!validGlxFBConfigForWindow(client, config, pDraw, &err)) - return err; - - return DoCreateGLXDrawable(client, pGlxScreen, config, - pDraw, req->window, - req->glxwindow, GLX_DRAWABLE_WINDOW); -} - -int __glXDisp_DestroyWindow(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc; - - REQUEST_SIZE_MATCH(xGLXDestroyWindowReq); - - return DoDestroyDrawable(cl, req->glxwindow, GLX_DRAWABLE_WINDOW); -} - - -/*****************************************************************************/ - -/* -** NOTE: There is no portable implementation for swap buffers as of -** this time that is of value. Consequently, this code must be -** implemented by somebody other than SGI. -*/ -int __glXDisp_SwapBuffers(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc; - GLXContextTag tag; - XID drawId; - __GLXcontext *glxc = NULL; - __GLXdrawable *pGlxDraw; - int error; - - REQUEST_SIZE_MATCH(xGLXSwapBuffersReq); - - tag = req->contextTag; - drawId = req->drawable; - if (tag) { - glxc = __glXLookupContextByTag(cl, tag); - if (!glxc) { - return __glXError(GLXBadContextTag); - } - /* - ** The calling thread is swapping its current drawable. In this case, - ** glxSwapBuffers is in both GL and X streams, in terms of - ** sequentiality. - */ - if (__glXForceCurrent(cl, tag, &error)) { - /* - ** Do whatever is needed to make sure that all preceding requests - ** in both streams are completed before the swap is executed. - */ - CALL_Finish( GET_DISPATCH(), () ); - __GLX_NOTE_FLUSHED_CMDS(glxc); - } else { - return error; - } - } - - pGlxDraw = __glXGetDrawable(glxc, drawId, client, &error); - if (pGlxDraw == NULL) - return error; - - if (pGlxDraw->type == DRAWABLE_WINDOW && - (*pGlxDraw->swapBuffers)(cl->client, pGlxDraw) == GL_FALSE) - return __glXError(GLXBadDrawable); - - return Success; -} - - -static int -DoQueryContext(__GLXclientState *cl, GLXContextID gcId) -{ - ClientPtr client = cl->client; - __GLXcontext *ctx; - xGLXQueryContextInfoEXTReply reply; - int nProps; - int *sendBuf, *pSendBuf; - int nReplyBytes; - int err; - - if (!validGlxContext(cl->client, gcId, DixReadAccess, &ctx, &err)) - return err; - - nProps = 3; - reply.length = nProps << 1; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.n = nProps; - - nReplyBytes = reply.length << 2; - sendBuf = (int *)malloc((size_t)nReplyBytes); - if (sendBuf == NULL) { - return __glXError(GLXBadContext); /* XXX: Is this correct? */ - } - pSendBuf = sendBuf; - *pSendBuf++ = GLX_SHARE_CONTEXT_EXT; - *pSendBuf++ = (int)(ctx->share_id); - *pSendBuf++ = GLX_VISUAL_ID_EXT; - *pSendBuf++ = (int)(ctx->config->visualID); - *pSendBuf++ = GLX_SCREEN_EXT; - *pSendBuf++ = (int)(ctx->pGlxScreen->pScreen->myNum); - - if (client->swapped) { - __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf); - } else { - WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)&reply); - WriteToClient(client, nReplyBytes, (char *)sendBuf); - } - free((char *)sendBuf); - - return Success; -} - -int __glXDisp_QueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc; - - REQUEST_SIZE_MATCH(xGLXQueryContextInfoEXTReq); - - return DoQueryContext(cl, req->context); -} - -int __glXDisp_QueryContext(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc; - - REQUEST_SIZE_MATCH(xGLXQueryContextReq); - - return DoQueryContext(cl, req->context); -} - -int __glXDisp_BindTexImageEXT(__GLXclientState *cl, GLbyte *pc) -{ - xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; - ClientPtr client = cl->client; - __GLXcontext *context; - __GLXdrawable *pGlxDraw; - GLXDrawable drawId; - int buffer; - int error; - - REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 8); - - pc += __GLX_VENDPRIV_HDR_SIZE; - - drawId = *((CARD32 *) (pc)); - buffer = *((INT32 *) (pc + 4)); - - if (buffer != GLX_FRONT_LEFT_EXT) - return __glXError(GLXBadPixmap); - - context = __glXForceCurrent (cl, req->contextTag, &error); - if (!context) - return error; - - if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_PIXMAP, - DixReadAccess, &pGlxDraw, &error)) - return error; - - if (!context->textureFromPixmap) - return __glXError(GLXUnsupportedPrivateRequest); - - return context->textureFromPixmap->bindTexImage(context, - buffer, - pGlxDraw); -} - -int __glXDisp_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc) -{ - xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; - ClientPtr client = cl->client; - __GLXdrawable *pGlxDraw; - __GLXcontext *context; - GLXDrawable drawId; - int buffer; - int error; - - REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 8); - - pc += __GLX_VENDPRIV_HDR_SIZE; - - drawId = *((CARD32 *) (pc)); - buffer = *((INT32 *) (pc + 4)); - - context = __glXForceCurrent (cl, req->contextTag, &error); - if (!context) - return error; - - if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_PIXMAP, - DixReadAccess, &pGlxDraw, &error)) - return error; - - if (!context->textureFromPixmap) - return __glXError(GLXUnsupportedPrivateRequest); - - return context->textureFromPixmap->releaseTexImage(context, - buffer, - pGlxDraw); -} - -int __glXDisp_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc) -{ - xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; - GLXContextTag tag = req->contextTag; - __GLXcontext *glxc = NULL; - __GLXdrawable *pGlxDraw; - ClientPtr client = cl->client; - GLXDrawable drawId; - int error; - int x, y, width, height; - - (void) client; - (void) req; - - REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 20); - - pc += __GLX_VENDPRIV_HDR_SIZE; - - drawId = *((CARD32 *) (pc)); - x = *((INT32 *) (pc + 4)); - y = *((INT32 *) (pc + 8)); - width = *((INT32 *) (pc + 12)); - height = *((INT32 *) (pc + 16)); - - if (tag) { - glxc = __glXLookupContextByTag(cl, tag); - if (!glxc) { - return __glXError(GLXBadContextTag); - } - /* - ** The calling thread is swapping its current drawable. In this case, - ** glxSwapBuffers is in both GL and X streams, in terms of - ** sequentiality. - */ - if (__glXForceCurrent(cl, tag, &error)) { - /* - ** Do whatever is needed to make sure that all preceding requests - ** in both streams are completed before the swap is executed. - */ - CALL_Finish( GET_DISPATCH(), () ); - __GLX_NOTE_FLUSHED_CMDS(glxc); - } else { - return error; - } - } - - pGlxDraw = __glXGetDrawable(glxc, drawId, client, &error); - if (!pGlxDraw) - return error; - - if (pGlxDraw == NULL || - pGlxDraw->type != GLX_DRAWABLE_WINDOW || - pGlxDraw->copySubBuffer == NULL) - return __glXError(GLXBadDrawable); - - (*pGlxDraw->copySubBuffer)(pGlxDraw, x, y, width, height); - - return Success; -} - -/* -** Get drawable attributes -*/ -static int -DoGetDrawableAttributes(__GLXclientState *cl, XID drawId) -{ - ClientPtr client = cl->client; - xGLXGetDrawableAttributesReply reply; - __GLXdrawable *pGlxDraw; - CARD32 attributes[6]; - int numAttribs, error; - - if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY, - DixGetAttrAccess, &pGlxDraw, &error)) - return error; - - numAttribs = 3; - reply.length = numAttribs << 1; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.numAttribs = numAttribs; - - attributes[0] = GLX_TEXTURE_TARGET_EXT; - attributes[1] = pGlxDraw->target == GL_TEXTURE_2D ? GLX_TEXTURE_2D_EXT : - GLX_TEXTURE_RECTANGLE_EXT; - attributes[2] = GLX_Y_INVERTED_EXT; - attributes[3] = GL_FALSE; - attributes[4] = GLX_EVENT_MASK; - attributes[5] = pGlxDraw->eventMask; - - if (client->swapped) { - __glXSwapGetDrawableAttributesReply(client, &reply, attributes); - } else { - WriteToClient(client, sz_xGLXGetDrawableAttributesReply, - (char *)&reply); - WriteToClient(client, reply.length * sizeof (CARD32), - (char *)attributes); - } - - return Success; -} - -int __glXDisp_GetDrawableAttributes(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc; - - REQUEST_SIZE_MATCH(xGLXGetDrawableAttributesReq); - - return DoGetDrawableAttributes(cl, req->drawable); -} - -int __glXDisp_GetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXGetDrawableAttributesSGIXReq *req = - (xGLXGetDrawableAttributesSGIXReq *)pc; - - REQUEST_SIZE_MATCH(xGLXGetDrawableAttributesSGIXReq); - - return DoGetDrawableAttributes(cl, req->drawable); -} - -/************************************************************************/ - -/* -** Render and Renderlarge are not in the GLX API. They are used by the GLX -** client library to send batches of GL rendering commands. -*/ - -/* -** Execute all the drawing commands in a request. -*/ -int __glXDisp_Render(__GLXclientState *cl, GLbyte *pc) -{ - xGLXRenderReq *req; - ClientPtr client= cl->client; - int left, cmdlen, error; - int commandsDone; - CARD16 opcode; - __GLXrenderHeader *hdr; - __GLXcontext *glxc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_AT_LEAST_SIZE(xGLXRenderReq); - - req = (xGLXRenderReq *) pc; - if (client->swapped) { - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->contextTag); - } - - glxc = __glXForceCurrent(cl, req->contextTag, &error); - if (!glxc) { - return error; - } - - commandsDone = 0; - pc += sz_xGLXRenderReq; - left = (req->length << 2) - sz_xGLXRenderReq; - while (left > 0) { - __GLXrenderSizeData entry; - int extra; - __GLXdispatchRenderProcPtr proc; - int err; - - if (left < sizeof(__GLXrenderHeader)) - return BadLength; - - /* - ** Verify that the header length and the overall length agree. - ** Also, each command must be word aligned. - */ - hdr = (__GLXrenderHeader *) pc; - if (client->swapped) { - __GLX_SWAP_SHORT(&hdr->length); - __GLX_SWAP_SHORT(&hdr->opcode); - } - cmdlen = hdr->length; - opcode = hdr->opcode; - - /* - ** Check for core opcodes and grab entry data. - */ - err = __glXGetProtocolSizeData(& Render_dispatch_info, opcode, & entry); - proc = (__GLXdispatchRenderProcPtr) - __glXGetProtocolDecodeFunction(& Render_dispatch_info, - opcode, client->swapped); - - if ((err < 0) || (proc == NULL)) { - client->errorValue = commandsDone; - return __glXError(GLXBadRenderRequest); - } - - if (entry.varsize) { - /* variable size command */ - extra = (*entry.varsize)(pc + __GLX_RENDER_HDR_SIZE, - client->swapped); - if (extra < 0) { - extra = 0; - } - if (cmdlen != __GLX_PAD(entry.bytes + extra)) { - return BadLength; - } - } else { - /* constant size command */ - if (cmdlen != __GLX_PAD(entry.bytes)) { - return BadLength; - } - } - if (left < cmdlen) { - return BadLength; - } - - /* - ** Skip over the header and execute the command. We allow the - ** caller to trash the command memory. This is useful especially - ** for things that require double alignment - they can just shift - ** the data towards lower memory (trashing the header) by 4 bytes - ** and achieve the required alignment. - */ - (*proc)(pc + __GLX_RENDER_HDR_SIZE); - pc += cmdlen; - left -= cmdlen; - commandsDone++; - } - __GLX_NOTE_UNFLUSHED_CMDS(glxc); - return Success; -} - - -/* -** Execute a large rendering request (one that spans multiple X requests). -*/ -int __glXDisp_RenderLarge(__GLXclientState *cl, GLbyte *pc) -{ - xGLXRenderLargeReq *req; - ClientPtr client= cl->client; - size_t dataBytes; - __GLXrenderLargeHeader *hdr; - __GLXcontext *glxc; - int error; - CARD16 opcode; - __GLX_DECLARE_SWAP_VARIABLES; - - req = (xGLXRenderLargeReq *) pc; - if (client->swapped) { - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->contextTag); - __GLX_SWAP_INT(&req->dataBytes); - __GLX_SWAP_SHORT(&req->requestNumber); - __GLX_SWAP_SHORT(&req->requestTotal); - } - - glxc = __glXForceCurrent(cl, req->contextTag, &error); - if (!glxc) { - /* Reset in case this isn't 1st request. */ - __glXResetLargeCommandStatus(cl); - return error; - } - dataBytes = req->dataBytes; - - /* - ** Check the request length. - */ - if ((req->length << 2) != __GLX_PAD(dataBytes) + sz_xGLXRenderLargeReq) { - client->errorValue = req->length; - /* Reset in case this isn't 1st request. */ - __glXResetLargeCommandStatus(cl); - return BadLength; - } - pc += sz_xGLXRenderLargeReq; - - if (cl->largeCmdRequestsSoFar == 0) { - __GLXrenderSizeData entry; - int extra; - size_t cmdlen; - int err; - - /* - ** This is the first request of a multi request command. - ** Make enough space in the buffer, then copy the entire request. - */ - if (req->requestNumber != 1) { - client->errorValue = req->requestNumber; - return __glXError(GLXBadLargeRequest); - } - - hdr = (__GLXrenderLargeHeader *) pc; - if (client->swapped) { - __GLX_SWAP_INT(&hdr->length); - __GLX_SWAP_INT(&hdr->opcode); - } - cmdlen = hdr->length; - opcode = hdr->opcode; - - /* - ** Check for core opcodes and grab entry data. - */ - err = __glXGetProtocolSizeData(& Render_dispatch_info, opcode, & entry); - if (err < 0) { - client->errorValue = opcode; - return __glXError(GLXBadLargeRequest); - } - - if (entry.varsize) { - /* - ** If it's a variable-size command (a command whose length must - ** be computed from its parameters), all the parameters needed - ** will be in the 1st request, so it's okay to do this. - */ - extra = (*entry.varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE, - client->swapped); - if (extra < 0) { - extra = 0; - } - /* large command's header is 4 bytes longer, so add 4 */ - if (cmdlen != __GLX_PAD(entry.bytes + 4 + extra)) { - return BadLength; - } - } else { - /* constant size command */ - if (cmdlen != __GLX_PAD(entry.bytes + 4)) { - return BadLength; - } - } - /* - ** Make enough space in the buffer, then copy the entire request. - */ - if (cl->largeCmdBufSize < cmdlen) { - if (!cl->largeCmdBuf) { - cl->largeCmdBuf = (GLbyte *) malloc(cmdlen); - } else { - cl->largeCmdBuf = (GLbyte *) realloc(cl->largeCmdBuf, cmdlen); - } - if (!cl->largeCmdBuf) { - return BadAlloc; - } - cl->largeCmdBufSize = cmdlen; - } - memcpy(cl->largeCmdBuf, pc, dataBytes); - - cl->largeCmdBytesSoFar = dataBytes; - cl->largeCmdBytesTotal = cmdlen; - cl->largeCmdRequestsSoFar = 1; - cl->largeCmdRequestsTotal = req->requestTotal; - return Success; - - } else { - /* - ** We are receiving subsequent (i.e. not the first) requests of a - ** multi request command. - */ - - /* - ** Check the request number and the total request count. - */ - if (req->requestNumber != cl->largeCmdRequestsSoFar + 1) { - client->errorValue = req->requestNumber; - __glXResetLargeCommandStatus(cl); - return __glXError(GLXBadLargeRequest); - } - if (req->requestTotal != cl->largeCmdRequestsTotal) { - client->errorValue = req->requestTotal; - __glXResetLargeCommandStatus(cl); - return __glXError(GLXBadLargeRequest); - } - - /* - ** Check that we didn't get too much data. - */ - if ((cl->largeCmdBytesSoFar + dataBytes) > cl->largeCmdBytesTotal) { - client->errorValue = dataBytes; - __glXResetLargeCommandStatus(cl); - return __glXError(GLXBadLargeRequest); - } - memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes); - cl->largeCmdBytesSoFar += dataBytes; - cl->largeCmdRequestsSoFar++; - - if (req->requestNumber == cl->largeCmdRequestsTotal) { - __GLXdispatchRenderProcPtr proc; - - /* - ** This is the last request; it must have enough bytes to complete - ** the command. - */ - /* NOTE: the two pad macros have been added below; they are needed - ** because the client library pads the total byte count, but not - ** the per-request byte counts. The Protocol Encoding says the - ** total byte count should not be padded, so a proposal will be - ** made to the ARB to relax the padding constraint on the total - ** byte count, thus preserving backward compatibility. Meanwhile, - ** the padding done below fixes a bug that did not allow - ** large commands of odd sizes to be accepted by the server. - */ - if (__GLX_PAD(cl->largeCmdBytesSoFar) != - __GLX_PAD(cl->largeCmdBytesTotal)) { - client->errorValue = dataBytes; - __glXResetLargeCommandStatus(cl); - return __glXError(GLXBadLargeRequest); - } - hdr = (__GLXrenderLargeHeader *) cl->largeCmdBuf; - /* - ** The opcode and length field in the header had already been - ** swapped when the first request was received. - ** - ** Use the opcode to index into the procedure table. - */ - opcode = hdr->opcode; - - proc = (__GLXdispatchRenderProcPtr) - __glXGetProtocolDecodeFunction(& Render_dispatch_info, opcode, - client->swapped); - if (proc == NULL) { - client->errorValue = opcode; - return __glXError(GLXBadLargeRequest); - } - - /* - ** Skip over the header and execute the command. - */ - (*proc)(cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE); - __GLX_NOTE_UNFLUSHED_CMDS(glxc); - - /* - ** Reset for the next RenderLarge series. - */ - __glXResetLargeCommandStatus(cl); - } else { - /* - ** This is neither the first nor the last request. - */ - } - return Success; - } -} - -/************************************************************************/ - -/* -** No support is provided for the vendor-private requests other than -** allocating the entry points in the dispatch table. -*/ - -int __glXDisp_VendorPrivate(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; - GLint vendorcode = req->vendorCode; - __GLXdispatchVendorPrivProcPtr proc; - - REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq); - - proc = (__GLXdispatchVendorPrivProcPtr) - __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info, - vendorcode, 0); - if (proc != NULL) { - (*proc)(cl, (GLbyte*)req); - return Success; - } - - cl->client->errorValue = req->vendorCode; - return __glXError(GLXUnsupportedPrivateRequest); -} - -int __glXDisp_VendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; - GLint vendorcode = req->vendorCode; - __GLXdispatchVendorPrivProcPtr proc; - - REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq); - - proc = (__GLXdispatchVendorPrivProcPtr) - __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info, - vendorcode, 0); - if (proc != NULL) { - return (*proc)(cl, (GLbyte*)req); - } - - cl->client->errorValue = vendorcode; - return __glXError(GLXUnsupportedPrivateRequest); -} - -int __glXDisp_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc; - xGLXQueryExtensionsStringReply reply; - __GLXscreen *pGlxScreen; - size_t n, length; - char *buf; - int err; - - REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq); - - if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) - return err; - - n = strlen(pGlxScreen->GLXextensions) + 1; - length = __GLX_PAD(n) >> 2; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = length; - reply.n = n; - - /* Allocate buffer to make sure it's a multiple of 4 bytes big.*/ - buf = (char *) malloc(length << 2); - if (buf == NULL) - return BadAlloc; - memcpy(buf, pGlxScreen->GLXextensions, n); - - if (client->swapped) { - glxSwapQueryExtensionsStringReply(client, &reply, buf); - } else { - WriteToClient(client, sz_xGLXQueryExtensionsStringReply,(char *)&reply); - WriteToClient(client, (int)(length << 2), (char *)buf); - } - - free(buf); - return Success; -} - -int __glXDisp_QueryServerString(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc; - xGLXQueryServerStringReply reply; - size_t n, length; - const char *ptr; - char *buf; - __GLXscreen *pGlxScreen; - int err; - char ver_str[16]; - - REQUEST_SIZE_MATCH(xGLXQueryServerStringReq); - - if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) - return err; - - switch(req->name) { - case GLX_VENDOR: - ptr = pGlxScreen->GLXvendor; - break; - case GLX_VERSION: - /* Return to the server version rather than the screen version - * to prevent confusion when they do not match. - */ - snprintf(ver_str, 16, "%d.%d", glxMajorVersion, glxMinorVersion); - ptr = ver_str; - break; - case GLX_EXTENSIONS: - ptr = pGlxScreen->GLXextensions; - break; - default: - return BadValue; - } - - n = strlen(ptr) + 1; - length = __GLX_PAD(n) >> 2; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = length; - reply.n = n; - - buf = (char *) malloc(length << 2); - if (buf == NULL) { - return BadAlloc; - } - memcpy(buf, ptr, n); - - if (client->swapped) { - glxSwapQueryServerStringReply(client, &reply, buf); - } else { - WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)&reply); - WriteToClient(client, (int)(length << 2), buf); - } - - free(buf); - return Success; -} - -int __glXDisp_ClientInfo(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXClientInfoReq *req = (xGLXClientInfoReq *) pc; - const char *buf; - - REQUEST_AT_LEAST_SIZE(xGLXClientInfoReq); - - buf = (const char *)(req+1); - if (!memchr(buf, 0, (client->req_len << 2) - sizeof(xGLXClientInfoReq))) - return BadLength; - - cl->GLClientmajorVersion = req->major; - cl->GLClientminorVersion = req->minor; - free(cl->GLClientextensions); - cl->GLClientextensions = strdup(buf); - - return Success; -} +/* + * 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_DIX_CONFIG_H +#include +#endif + +#include +#include + +#include "glxserver.h" +#include +#include +#include +#include +#include "glxutil.h" +#include "glxext.h" +#include "glapitable.h" +#include "glapi.h" +#include "glthread.h" +#include "dispatch.h" +#include "indirect_dispatch.h" +#include "indirect_table.h" +#include "indirect_util.h" + +static int +validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err) +{ + /* + ** Check if screen exists. + */ + if (screen < 0 || screen >= screenInfo.numScreens) { + client->errorValue = screen; + *err = BadValue; + return FALSE; + } + *pGlxScreen = glxGetScreen(screenInfo.screens[screen]); + + return TRUE; +} + +static int +validGlxFBConfig(ClientPtr client, __GLXscreen *pGlxScreen, XID id, + __GLXconfig **config, int *err) +{ + __GLXconfig *m; + + for (m = pGlxScreen->fbconfigs; m != NULL; m = m->next) + if (m->fbconfigID == id) { + *config = m; + return TRUE; + } + + client->errorValue = id; + *err = __glXError(GLXBadFBConfig); + + return FALSE; +} + +static int +validGlxVisual(ClientPtr client, __GLXscreen *pGlxScreen, XID id, + __GLXconfig **config, int *err) +{ + int i; + + for (i = 0; i < pGlxScreen->numVisuals; i++) + if (pGlxScreen->visuals[i]->visualID == id) { + *config = pGlxScreen->visuals[i]; + return TRUE; + } + + client->errorValue = id; + *err = BadValue; + + return FALSE; +} + +static int +validGlxFBConfigForWindow(ClientPtr client, __GLXconfig *config, + DrawablePtr pDraw, int *err) +{ + ScreenPtr pScreen = pDraw->pScreen; + VisualPtr pVisual = NULL; + XID vid; + int i; + + vid = wVisual((WindowPtr)pDraw); + for (i = 0; i < pScreen->numVisuals; i++) { + if (pScreen->visuals[i].vid == vid) { + pVisual = &pScreen->visuals[i]; + break; + } + } + + /* FIXME: What exactly should we check here... */ + if (pVisual->class != glxConvertToXVisualType(config->visualType) || + !(config->drawableType & GLX_WINDOW_BIT)) { + client->errorValue = pDraw->id; + *err = BadMatch; + return FALSE; + } + + return TRUE; +} + +static int +validGlxContext(ClientPtr client, XID id, int access_mode, + __GLXcontext **context, int *err) +{ + *err = dixLookupResourceByType((pointer *) context, id, + __glXContextRes, client, access_mode); + if (*err != Success) { + client->errorValue = id; + if (*err == BadValue) + *err = __glXError(GLXBadContext); + return FALSE; + } + + return TRUE; +} + +static int +validGlxDrawable(ClientPtr client, XID id, int type, int access_mode, + __GLXdrawable **drawable, int *err) +{ + int rc; + + rc = dixLookupResourceByType((pointer *) drawable, id, + __glXDrawableRes, client, access_mode); + if (rc != Success && rc != BadValue) { + *err = rc; + client->errorValue = id; + return FALSE; + } + + /* If the ID of the glx drawable we looked up doesn't match the id + * we looked for, it's because we looked it up under the X + * drawable ID (see DoCreateGLXDrawable). */ + if (rc == BadValue || + (*drawable)->drawId != id || + (type != GLX_DRAWABLE_ANY && type != (*drawable)->type)) { + client->errorValue = id; + switch (type) { + case GLX_DRAWABLE_WINDOW: + *err = __glXError(GLXBadWindow); + return FALSE; + case GLX_DRAWABLE_PIXMAP: + *err = __glXError(GLXBadPixmap); + return FALSE; + case GLX_DRAWABLE_PBUFFER: + *err = __glXError(GLXBadPbuffer); + return FALSE; + case GLX_DRAWABLE_ANY: + *err = __glXError(GLXBadDrawable); + return FALSE; + } + } + + return TRUE; +} + +void +__glXContextDestroy(__GLXcontext *context) +{ + __glXFlushContextCache(); +} + +static void __glXdirectContextDestroy(__GLXcontext *context) +{ + __glXContextDestroy(context); + free(context); +} + +static __GLXcontext *__glXdirectContextCreate(__GLXscreen *screen, + __GLXconfig *modes, + __GLXcontext *shareContext) +{ + __GLXcontext *context; + + context = calloc(1, sizeof (__GLXcontext)); + if (context == NULL) + return NULL; + + context->destroy = __glXdirectContextDestroy; + + return context; +} + +/** + * Create a GL context with the given properties. This routine is used + * to implement \c glXCreateContext, \c glXCreateNewContext, and + * \c glXCreateContextWithConfigSGIX. This works becuase of the hack way + * that GLXFBConfigs are implemented. Basically, the FBConfigID is the + * same as the VisualID. + */ + +static int +DoCreateContext(__GLXclientState *cl, GLXContextID gcId, + GLXContextID shareList, __GLXconfig *config, + __GLXscreen *pGlxScreen, GLboolean isDirect) +{ + ClientPtr client = cl->client; + __GLXcontext *glxc, *shareglxc; + int err; + + LEGAL_NEW_RESOURCE(gcId, client); + + /* + ** Find the display list space that we want to share. + ** + ** NOTE: In a multithreaded X server, we would need to keep a reference + ** count for each display list so that if one client detroyed a list that + ** another client was using, the list would not really be freed until it + ** was no longer in use. Since this sample implementation has no support + ** for multithreaded servers, we don't do this. + */ + if (shareList == None) { + shareglxc = 0; + } else { + if (!validGlxContext(client, shareList, DixReadAccess, + &shareglxc, &err)) + return err; + + if (shareglxc->isDirect) { + /* + ** NOTE: no support for sharing display lists between direct + ** contexts, even if they are in the same address space. + */ +#if 0 + /* Disabling this code seems to allow shared display lists + * and texture objects to work. We'll leave it disabled for now. + */ + client->errorValue = shareList; + return BadMatch; +#endif + } else { + /* + ** Create an indirect context regardless of what the client asked + ** for; this way we can share display list space with shareList. + */ + isDirect = GL_FALSE; + } + } + + /* + ** Allocate memory for the new context + */ + if (!isDirect) + glxc = pGlxScreen->createContext(pGlxScreen, config, shareglxc); + else + glxc = __glXdirectContextCreate(pGlxScreen, config, shareglxc); + if (!glxc) { + return BadAlloc; + } + + /* + ** Initially, setup the part of the context that could be used by + ** a GL core that needs windowing information (e.g., Mesa). + */ + glxc->pGlxScreen = pGlxScreen; + glxc->config = config; + + /* + ** Register this context as a resource. + */ + if (!AddResource(gcId, __glXContextRes, (pointer)glxc)) { + (*glxc->destroy)(glxc); + client->errorValue = gcId; + return BadAlloc; + } + + /* + ** Finally, now that everything is working, setup the rest of the + ** context. + */ + glxc->id = gcId; + glxc->share_id = shareList; + glxc->idExists = GL_TRUE; + glxc->isCurrent = GL_FALSE; + glxc->isDirect = isDirect; + glxc->renderMode = GL_RENDER; + + __glXAddToContextList(glxc); + + return Success; +} + +int __glXDisp_CreateContext(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc; + __GLXconfig *config; + __GLXscreen *pGlxScreen; + int err; + + REQUEST_SIZE_MATCH(xGLXCreateContextReq); + + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) + return err; + if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err)) + return err; + + return DoCreateContext(cl, req->context, req->shareList, + config, pGlxScreen, req->isDirect); +} + +int __glXDisp_CreateNewContext(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc; + __GLXconfig *config; + __GLXscreen *pGlxScreen; + int err; + + REQUEST_SIZE_MATCH(xGLXCreateNewContextReq); + + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) + return err; + if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err)) + return err; + + return DoCreateContext(cl, req->context, req->shareList, + config, pGlxScreen, req->isDirect); +} + +int __glXDisp_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCreateContextWithConfigSGIXReq *req = + (xGLXCreateContextWithConfigSGIXReq *) pc; + __GLXconfig *config; + __GLXscreen *pGlxScreen; + int err; + + REQUEST_SIZE_MATCH(xGLXCreateContextWithConfigSGIXReq); + + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) + return err; + if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err)) + return err; + + return DoCreateContext(cl, req->context, req->shareList, + config, pGlxScreen, req->isDirect); +} +int __glXDisp_DestroyContext(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc; + __GLXcontext *glxc; + int err; + + REQUEST_SIZE_MATCH(xGLXDestroyContextReq); + + if (!validGlxContext(cl->client, req->context, DixDestroyAccess, + &glxc, &err)) + return err; + + FreeResourceByType(req->context, __glXContextRes, FALSE); + return Success; +} + +/*****************************************************************************/ + +/* +** For each client, the server keeps a table of all the contexts that are +** current for that client (each thread of a client may have its own current +** context). These routines add, change, and lookup contexts in the table. +*/ + +/* +** Add a current context, and return the tag that will be used to refer to it. +*/ +static int AddCurrentContext(__GLXclientState *cl, __GLXcontext *glxc) +{ + int i; + int num = cl->numCurrentContexts; + __GLXcontext **table = cl->currentContexts; + + if (!glxc) return -1; + + /* + ** Try to find an empty slot and use it. + */ + for (i=0; i < num; i++) { + if (!table[i]) { + table[i] = glxc; + return i+1; + } + } + /* + ** Didn't find a free slot, so we'll have to grow the table. + */ + if (!num) { + table = (__GLXcontext **) malloc(sizeof(__GLXcontext *)); + } else { + table = (__GLXcontext **) realloc(table, + (num+1)*sizeof(__GLXcontext *)); + } + table[num] = glxc; + cl->currentContexts = table; + cl->numCurrentContexts++; + return num+1; +} + +/* +** Given a tag, change the current context for the corresponding entry. +*/ +static void ChangeCurrentContext(__GLXclientState *cl, __GLXcontext *glxc, + GLXContextTag tag) +{ + __GLXcontext **table = cl->currentContexts; + table[tag-1] = glxc; +} + +/* +** For this implementation we have chosen to simply use the index of the +** context's entry in the table as the context tag. A tag must be greater +** than 0. +*/ +__GLXcontext *__glXLookupContextByTag(__GLXclientState *cl, GLXContextTag tag) +{ + int num = cl->numCurrentContexts; + + if (tag < 1 || tag > num) { + return 0; + } else { + return cl->currentContexts[tag-1]; + } +} + +/*****************************************************************************/ + +static void StopUsingContext(__GLXcontext *glxc) +{ + if (glxc) { + if (glxc == __glXLastContext) { + /* Tell server GL library */ + __glXLastContext = 0; + } + glxc->isCurrent = GL_FALSE; + if (!glxc->idExists) { + __glXFreeContext(glxc); + } + } +} + +static void StartUsingContext(__GLXclientState *cl, __GLXcontext *glxc) +{ + glxc->isCurrent = GL_TRUE; + __glXLastContext = glxc; +} + +/** + * This is a helper function to handle the legacy (pre GLX 1.3) cases + * where passing an X window to glXMakeCurrent is valid. Given a + * resource ID, look up the GLX drawable if available, otherwise, make + * sure it's an X window and create a GLX drawable one the fly. + */ +static __GLXdrawable * +__glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, ClientPtr client, + int *error) +{ + DrawablePtr pDraw; + __GLXdrawable *pGlxDraw; + int rc; + + if (validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY, + DixWriteAccess, &pGlxDraw, &rc)) { + if (glxc != NULL && pGlxDraw->config != glxc->config) { + client->errorValue = drawId; + *error = BadMatch; + return NULL; + } + + return pGlxDraw; + } + + /* No active context and an unknown drawable, bail. */ + if (glxc == NULL) { + client->errorValue = drawId; + *error = BadMatch; + return NULL; + } + + /* The drawId wasn't a GLX drawable. Make sure it's a window and + * create a GLXWindow for it. Check that the drawable screen + * matches the context screen and that the context fbconfig is + * compatible with the window visual. */ + + rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixGetAttrAccess); + if (rc != Success || pDraw->type != DRAWABLE_WINDOW) { + client->errorValue = drawId; + *error = __glXError(GLXBadDrawable); + return NULL; + } + + if (pDraw->pScreen != glxc->pGlxScreen->pScreen) { + client->errorValue = pDraw->pScreen->myNum; + *error = BadMatch; + return NULL; + } + + if (!validGlxFBConfigForWindow(client, glxc->config, pDraw, error)) + return NULL; + + pGlxDraw = glxc->pGlxScreen->createDrawable(client, glxc->pGlxScreen, + pDraw, drawId, + GLX_DRAWABLE_WINDOW, + drawId, glxc->config); + + /* since we are creating the drawablePrivate, drawId should be new */ + if (!AddResource(drawId, __glXDrawableRes, pGlxDraw)) { + pGlxDraw->destroy (pGlxDraw); + *error = BadAlloc; + return NULL; + } + + return pGlxDraw; +} + +/*****************************************************************************/ +/* +** Make an OpenGL context and drawable current. +*/ + +static int +DoMakeCurrent(__GLXclientState *cl, + GLXDrawable drawId, GLXDrawable readId, + GLXContextID contextId, GLXContextTag tag) +{ + ClientPtr client = cl->client; + xGLXMakeCurrentReply reply; + __GLXcontext *glxc, *prevglxc; + __GLXdrawable *drawPriv = NULL; + __GLXdrawable *readPriv = NULL; + int error; + GLuint mask; + + /* + ** If one is None and the other isn't, it's a bad match. + */ + + mask = (drawId == None) ? (1 << 0) : 0; + mask |= (readId == None) ? (1 << 1) : 0; + mask |= (contextId == None) ? (1 << 2) : 0; + + if ( (mask != 0x00) && (mask != 0x07) ) { + return BadMatch; + } + + /* + ** Lookup old context. If we have one, it must be in a usable state. + */ + if (tag != 0) { + prevglxc = __glXLookupContextByTag(cl, tag); + if (!prevglxc) { + /* + ** Tag for previous context is invalid. + */ + return __glXError(GLXBadContextTag); + } + if (prevglxc->renderMode != GL_RENDER) { + /* Oops. Not in render mode render. */ + client->errorValue = prevglxc->id; + return __glXError(GLXBadContextState); + } + } else { + prevglxc = 0; + } + + /* + ** Lookup new context. It must not be current for someone else. + */ + if (contextId != None) { + int status; + + if (!validGlxContext(client, contextId, DixUseAccess, &glxc, &error)) + return error; + if ((glxc != prevglxc) && glxc->isCurrent) { + /* Context is current to somebody else */ + return BadAccess; + } + + assert( drawId != None ); + assert( readId != None ); + + drawPriv = __glXGetDrawable(glxc, drawId, client, &status); + if (drawPriv == NULL) + return status; + + readPriv = __glXGetDrawable(glxc, readId, client, &status); + if (readPriv == NULL) + return status; + + } else { + /* Switching to no context. Ignore new drawable. */ + glxc = 0; + drawPriv = 0; + readPriv = 0; + } + + + if (prevglxc) { + /* + ** Flush the previous context if needed. + */ + if (__GLX_HAS_UNFLUSHED_CMDS(prevglxc)) { + if (__glXForceCurrent(cl, tag, (int *)&error)) { + CALL_Flush( GET_DISPATCH(), () ); + __GLX_NOTE_FLUSHED_CMDS(prevglxc); + } else { + return error; + } + } + + /* + ** Make the previous context not current. + */ + if (!(*prevglxc->loseCurrent)(prevglxc)) { + return __glXError(GLXBadContext); + } + __glXFlushContextCache(); + if (!prevglxc->isDirect) { + prevglxc->drawPriv = NULL; + prevglxc->readPriv = NULL; + } + } + + + if ((glxc != 0) && !glxc->isDirect) { + + glxc->drawPriv = drawPriv; + glxc->readPriv = readPriv; + + /* make the context current */ + if (!(*glxc->makeCurrent)(glxc)) { + glxc->drawPriv = NULL; + glxc->readPriv = NULL; + return __glXError(GLXBadContext); + } + + glxc->isCurrent = GL_TRUE; + } + + if (prevglxc) { + ChangeCurrentContext(cl, glxc, tag); + StopUsingContext(prevglxc); + } else { + tag = AddCurrentContext(cl, glxc); + } + + if (glxc) { + StartUsingContext(cl, glxc); + reply.contextTag = tag; + } else { + reply.contextTag = 0; + } + + reply.length = 0; + reply.type = X_Reply; + reply.sequenceNumber = client->sequence; + + if (client->swapped) { + __glXSwapMakeCurrentReply(client, &reply); + } else { + WriteToClient(client, sz_xGLXMakeCurrentReply, (char *)&reply); + } + return Success; +} + +int __glXDisp_MakeCurrent(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc; + + REQUEST_SIZE_MATCH(xGLXMakeCurrentReq); + + return DoMakeCurrent( cl, req->drawable, req->drawable, + req->context, req->oldContextTag ); +} + +int __glXDisp_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc; + + REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq); + + return DoMakeCurrent( cl, req->drawable, req->readdrawable, + req->context, req->oldContextTag ); +} + +int __glXDisp_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc; + + REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq); + + return DoMakeCurrent( cl, req->drawable, req->readable, + req->context, req->oldContextTag ); +} + +int __glXDisp_IsDirect(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc; + xGLXIsDirectReply reply; + __GLXcontext *glxc; + int err; + + REQUEST_SIZE_MATCH(xGLXIsDirectReq); + + if (!validGlxContext(cl->client, req->context, DixReadAccess, &glxc, &err)) + return err; + + reply.isDirect = glxc->isDirect; + reply.length = 0; + reply.type = X_Reply; + reply.sequenceNumber = client->sequence; + + if (client->swapped) { + __glXSwapIsDirectReply(client, &reply); + } else { + WriteToClient(client, sz_xGLXIsDirectReply, (char *)&reply); + } + + return Success; +} + +int __glXDisp_QueryVersion(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc; + xGLXQueryVersionReply reply; + GLuint major, minor; + + REQUEST_SIZE_MATCH(xGLXQueryVersionReq); + + major = req->majorVersion; + minor = req->minorVersion; + (void)major; + (void)minor; + + /* + ** Server should take into consideration the version numbers sent by the + ** client if it wants to work with older clients; however, in this + ** implementation the server just returns its version number. + */ + reply.majorVersion = glxMajorVersion; + reply.minorVersion = glxMinorVersion; + reply.length = 0; + reply.type = X_Reply; + reply.sequenceNumber = client->sequence; + + if (client->swapped) { + __glXSwapQueryVersionReply(client, &reply); + } else { + WriteToClient(client, sz_xGLXQueryVersionReply, (char *)&reply); + } + return Success; +} + +int __glXDisp_WaitGL(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXWaitGLReq *req = (xGLXWaitGLReq *)pc; + GLXContextTag tag; + __GLXcontext *glxc = NULL; + int error; + + REQUEST_SIZE_MATCH(xGLXWaitGLReq); + + tag = req->contextTag; + if (tag) { + glxc = __glXLookupContextByTag(cl, tag); + if (!glxc) + return __glXError(GLXBadContextTag); + + if (!__glXForceCurrent(cl, req->contextTag, &error)) + return error; + + CALL_Finish( GET_DISPATCH(), () ); + } + + if (glxc && glxc->drawPriv->waitGL) + (*glxc->drawPriv->waitGL)(glxc->drawPriv); + + return Success; +} + +int __glXDisp_WaitX(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXWaitXReq *req = (xGLXWaitXReq *)pc; + GLXContextTag tag; + __GLXcontext *glxc = NULL; + int error; + + REQUEST_SIZE_MATCH(xGLXWaitXReq); + + tag = req->contextTag; + if (tag) { + glxc = __glXLookupContextByTag(cl, tag); + if (!glxc) + return __glXError(GLXBadContextTag); + + if (!__glXForceCurrent(cl, req->contextTag, &error)) + return error; + } + + if (glxc && glxc->drawPriv->waitX) + (*glxc->drawPriv->waitX)(glxc->drawPriv); + + return Success; +} + +int __glXDisp_CopyContext(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc; + GLXContextID source; + GLXContextID dest; + GLXContextTag tag; + unsigned long mask; + __GLXcontext *src, *dst; + int error; + + REQUEST_SIZE_MATCH(xGLXCopyContextReq); + + source = req->source; + dest = req->dest; + tag = req->contextTag; + mask = req->mask; + if (!validGlxContext(cl->client, source, DixReadAccess, &src, &error)) + return error; + if (!validGlxContext(cl->client, dest, DixWriteAccess, &dst, &error)) + return error; + + /* + ** They must be in the same address space, and same screen. + ** NOTE: no support for direct rendering contexts here. + */ + if (src->isDirect || dst->isDirect || + (src->pGlxScreen != dst->pGlxScreen)) { + client->errorValue = source; + return BadMatch; + } + + /* + ** The destination context must not be current for any client. + */ + if (dst->isCurrent) { + client->errorValue = dest; + return BadAccess; + } + + if (tag) { + __GLXcontext *tagcx = __glXLookupContextByTag(cl, tag); + + if (!tagcx) { + return __glXError(GLXBadContextTag); + } + if (tagcx != src) { + /* + ** This would be caused by a faulty implementation of the client + ** library. + */ + return BadMatch; + } + /* + ** In this case, glXCopyContext is in both GL and X streams, in terms + ** of sequentiality. + */ + if (__glXForceCurrent(cl, tag, &error)) { + /* + ** Do whatever is needed to make sure that all preceding requests + ** in both streams are completed before the copy is executed. + */ + CALL_Finish( GET_DISPATCH(), () ); + __GLX_NOTE_FLUSHED_CMDS(tagcx); + } else { + return error; + } + } + /* + ** Issue copy. The only reason for failure is a bad mask. + */ + if (!(*dst->copy)(dst, src, mask)) { + client->errorValue = mask; + return BadValue; + } + return Success; +} + +enum { + GLX_VIS_CONFIG_UNPAIRED = 18, + GLX_VIS_CONFIG_PAIRED = 20 +}; + +enum { + GLX_VIS_CONFIG_TOTAL = GLX_VIS_CONFIG_UNPAIRED + GLX_VIS_CONFIG_PAIRED +}; + +int __glXDisp_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc) +{ + xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc; + ClientPtr client = cl->client; + xGLXGetVisualConfigsReply reply; + __GLXscreen *pGlxScreen; + __GLXconfig *modes; + CARD32 buf[GLX_VIS_CONFIG_TOTAL]; + int p, i, err; + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_DECLARE_SWAP_ARRAY_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq); + + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) + return err; + + reply.numVisuals = pGlxScreen->numVisuals; + reply.numProps = GLX_VIS_CONFIG_TOTAL; + reply.length = (reply.numVisuals * __GLX_SIZE_CARD32 * GLX_VIS_CONFIG_TOTAL) >> 2; + reply.type = X_Reply; + reply.sequenceNumber = client->sequence; + + if (client->swapped) { + __GLX_SWAP_SHORT(&reply.sequenceNumber); + __GLX_SWAP_INT(&reply.length); + __GLX_SWAP_INT(&reply.numVisuals); + __GLX_SWAP_INT(&reply.numProps); + } + + WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *)&reply); + + for (i = 0; i < pGlxScreen->numVisuals; i++) { + modes = pGlxScreen->visuals[i]; + + p = 0; + buf[p++] = modes->visualID; + buf[p++] = glxConvertToXVisualType( modes->visualType ); + buf[p++] = (modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE; + + buf[p++] = modes->redBits; + buf[p++] = modes->greenBits; + buf[p++] = modes->blueBits; + buf[p++] = modes->alphaBits; + buf[p++] = modes->accumRedBits; + buf[p++] = modes->accumGreenBits; + buf[p++] = modes->accumBlueBits; + buf[p++] = modes->accumAlphaBits; + + buf[p++] = modes->doubleBufferMode; + buf[p++] = modes->stereoMode; + + buf[p++] = modes->rgbBits; + buf[p++] = modes->depthBits; + buf[p++] = modes->stencilBits; + buf[p++] = modes->numAuxBuffers; + buf[p++] = modes->level; + + assert(p == GLX_VIS_CONFIG_UNPAIRED); + /* + ** Add token/value pairs for extensions. + */ + buf[p++] = GLX_VISUAL_CAVEAT_EXT; + buf[p++] = modes->visualRating; + buf[p++] = GLX_TRANSPARENT_TYPE; + buf[p++] = modes->transparentPixel; + buf[p++] = GLX_TRANSPARENT_RED_VALUE; + buf[p++] = modes->transparentRed; + buf[p++] = GLX_TRANSPARENT_GREEN_VALUE; + buf[p++] = modes->transparentGreen; + buf[p++] = GLX_TRANSPARENT_BLUE_VALUE; + buf[p++] = modes->transparentBlue; + buf[p++] = GLX_TRANSPARENT_ALPHA_VALUE; + buf[p++] = modes->transparentAlpha; + buf[p++] = GLX_TRANSPARENT_INDEX_VALUE; + buf[p++] = modes->transparentIndex; + buf[p++] = GLX_SAMPLES_SGIS; + buf[p++] = modes->samples; + buf[p++] = GLX_SAMPLE_BUFFERS_SGIS; + buf[p++] = modes->sampleBuffers; + buf[p++] = 0; /* copy over visualSelectGroup (GLX_VISUAL_SELECT_GROUP_SGIX)? */ + buf[p++] = 0; + + assert(p == GLX_VIS_CONFIG_TOTAL); + if (client->swapped) { + __GLX_SWAP_INT_ARRAY(buf, p); + } + WriteToClient(client, __GLX_SIZE_CARD32 * p, (char *)buf); + } + return Success; +} + +#define __GLX_TOTAL_FBCONFIG_ATTRIBS (36) +#define __GLX_FBCONFIG_ATTRIBS_LENGTH (__GLX_TOTAL_FBCONFIG_ATTRIBS * 2) +/** + * Send the set of GLXFBConfigs to the client. There is not currently + * and interface into the driver on the server-side to get GLXFBConfigs, + * so we "invent" some based on the \c __GLXvisualConfig structures that + * the driver does supply. + * + * The reply format for both \c glXGetFBConfigs and \c glXGetFBConfigsSGIX + * is the same, so this routine pulls double duty. + */ + +static int +DoGetFBConfigs(__GLXclientState *cl, unsigned screen) +{ + ClientPtr client = cl->client; + xGLXGetFBConfigsReply reply; + __GLXscreen *pGlxScreen; + CARD32 buf[__GLX_FBCONFIG_ATTRIBS_LENGTH]; + int p, err; + __GLXconfig *modes; + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_DECLARE_SWAP_ARRAY_VARIABLES; + + if (!validGlxScreen(cl->client, screen, &pGlxScreen, &err)) + return err; + + reply.numFBConfigs = pGlxScreen->numFBConfigs; + reply.numAttribs = __GLX_TOTAL_FBCONFIG_ATTRIBS; + reply.length = (__GLX_FBCONFIG_ATTRIBS_LENGTH * reply.numFBConfigs); + reply.type = X_Reply; + reply.sequenceNumber = client->sequence; + + if (client->swapped) { + __GLX_SWAP_SHORT(&reply.sequenceNumber); + __GLX_SWAP_INT(&reply.length); + __GLX_SWAP_INT(&reply.numFBConfigs); + __GLX_SWAP_INT(&reply.numAttribs); + } + + WriteToClient(client, sz_xGLXGetFBConfigsReply, (char *)&reply); + + for (modes = pGlxScreen->fbconfigs; modes != NULL; modes = modes->next) { + p = 0; + +#define WRITE_PAIR(tag,value) \ + do { buf[p++] = tag ; buf[p++] = value ; } while( 0 ) + + WRITE_PAIR( GLX_VISUAL_ID, modes->visualID ); + WRITE_PAIR( GLX_FBCONFIG_ID, modes->fbconfigID ); + WRITE_PAIR( GLX_X_RENDERABLE, GL_TRUE ); + + WRITE_PAIR( GLX_RGBA, + (modes->renderType & GLX_RGBA_BIT) ? GL_TRUE : GL_FALSE ); + WRITE_PAIR( GLX_RENDER_TYPE, modes->renderType ); + WRITE_PAIR( GLX_DOUBLEBUFFER, modes->doubleBufferMode ); + WRITE_PAIR( GLX_STEREO, modes->stereoMode ); + + WRITE_PAIR( GLX_BUFFER_SIZE, modes->rgbBits ); + WRITE_PAIR( GLX_LEVEL, modes->level ); + WRITE_PAIR( GLX_AUX_BUFFERS, modes->numAuxBuffers ); + WRITE_PAIR( GLX_RED_SIZE, modes->redBits ); + WRITE_PAIR( GLX_GREEN_SIZE, modes->greenBits ); + WRITE_PAIR( GLX_BLUE_SIZE, modes->blueBits ); + WRITE_PAIR( GLX_ALPHA_SIZE, modes->alphaBits ); + WRITE_PAIR( GLX_ACCUM_RED_SIZE, modes->accumRedBits ); + WRITE_PAIR( GLX_ACCUM_GREEN_SIZE, modes->accumGreenBits ); + WRITE_PAIR( GLX_ACCUM_BLUE_SIZE, modes->accumBlueBits ); + WRITE_PAIR( GLX_ACCUM_ALPHA_SIZE, modes->accumAlphaBits ); + WRITE_PAIR( GLX_DEPTH_SIZE, modes->depthBits ); + WRITE_PAIR( GLX_STENCIL_SIZE, modes->stencilBits ); + WRITE_PAIR( GLX_X_VISUAL_TYPE, modes->visualType ); + WRITE_PAIR( GLX_CONFIG_CAVEAT, modes->visualRating ); + WRITE_PAIR( GLX_TRANSPARENT_TYPE, modes->transparentPixel ); + WRITE_PAIR( GLX_TRANSPARENT_RED_VALUE, modes->transparentRed ); + WRITE_PAIR( GLX_TRANSPARENT_GREEN_VALUE, modes->transparentGreen ); + WRITE_PAIR( GLX_TRANSPARENT_BLUE_VALUE, modes->transparentBlue ); + WRITE_PAIR( GLX_TRANSPARENT_ALPHA_VALUE, modes->transparentAlpha ); + WRITE_PAIR( GLX_TRANSPARENT_INDEX_VALUE, modes->transparentIndex ); + WRITE_PAIR( GLX_SWAP_METHOD_OML, modes->swapMethod ); + WRITE_PAIR( GLX_SAMPLES_SGIS, modes->samples ); + WRITE_PAIR( GLX_SAMPLE_BUFFERS_SGIS, modes->sampleBuffers ); + /* GLX_VISUAL_SELECT_GROUP_SGIX ? */ + WRITE_PAIR( GLX_DRAWABLE_TYPE, modes->drawableType ); + WRITE_PAIR( GLX_BIND_TO_TEXTURE_RGB_EXT, modes->bindToTextureRgb ); + WRITE_PAIR( GLX_BIND_TO_TEXTURE_RGBA_EXT, modes->bindToTextureRgba ); + WRITE_PAIR( GLX_BIND_TO_MIPMAP_TEXTURE_EXT, modes->bindToMipmapTexture ); + WRITE_PAIR( GLX_BIND_TO_TEXTURE_TARGETS_EXT, modes->bindToTextureTargets ); + + if (client->swapped) { + __GLX_SWAP_INT_ARRAY(buf, __GLX_FBCONFIG_ATTRIBS_LENGTH); + } + WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_FBCONFIG_ATTRIBS_LENGTH, + (char *)buf); + } + return Success; +} + + +int __glXDisp_GetFBConfigs(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc; + REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq); + return DoGetFBConfigs(cl, req->screen); +} + +int __glXDisp_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc; + /* work around mesa bug, don't use REQUEST_SIZE_MATCH */ + REQUEST_AT_LEAST_SIZE(xGLXGetFBConfigsSGIXReq); + return DoGetFBConfigs(cl, req->screen); +} + +GLboolean +__glXDrawableInit(__GLXdrawable *drawable, + __GLXscreen *screen, DrawablePtr pDraw, int type, + XID drawId, __GLXconfig *config) +{ + drawable->pDraw = pDraw; + drawable->type = type; + drawable->drawId = drawId; + drawable->config = config; + drawable->eventMask = 0; + + return GL_TRUE; +} + +void +__glXDrawableRelease(__GLXdrawable *drawable) +{ +} + +static int +DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen, + __GLXconfig *config, DrawablePtr pDraw, XID drawableId, + XID glxDrawableId, int type) +{ + __GLXdrawable *pGlxDraw; + + if (pGlxScreen->pScreen != pDraw->pScreen) + return BadMatch; + + pGlxDraw = pGlxScreen->createDrawable(client, pGlxScreen, pDraw, + drawableId, type, + glxDrawableId, config); + if (pGlxDraw == NULL) + return BadAlloc; + + if (!AddResource(glxDrawableId, __glXDrawableRes, pGlxDraw)) { + pGlxDraw->destroy (pGlxDraw); + return BadAlloc; + } + + /* Add the glx drawable under the XID of the underlying X drawable + * too. That way we'll get a callback in DrawableGone and can + * clean up properly when the drawable is destroyed. */ + if (drawableId != glxDrawableId && + !AddResource(pDraw->id, __glXDrawableRes, pGlxDraw)) { + pGlxDraw->destroy (pGlxDraw); + return BadAlloc; + } + + return Success; +} + +static int +DoCreateGLXPixmap(ClientPtr client, __GLXscreen *pGlxScreen, __GLXconfig *config, + XID drawableId, XID glxDrawableId) +{ + DrawablePtr pDraw; + int err; + + LEGAL_NEW_RESOURCE(glxDrawableId, client); + + err = dixLookupDrawable(&pDraw, drawableId, client, 0, DixAddAccess); + if (err != Success) { + client->errorValue = drawableId; + return err; + } + if (pDraw->type != DRAWABLE_PIXMAP) { + client->errorValue = drawableId; + return BadPixmap; + } + + err = DoCreateGLXDrawable(client, pGlxScreen, config, pDraw, drawableId, + glxDrawableId, GLX_DRAWABLE_PIXMAP); + + return err; +} + +static void +determineTextureTarget(ClientPtr client, XID glxDrawableID, + CARD32 *attribs, CARD32 numAttribs) +{ + GLenum target = 0; + GLenum format = 0; + int i, err; + __GLXdrawable *pGlxDraw; + + if (!validGlxDrawable(client, glxDrawableID, GLX_DRAWABLE_PIXMAP, + DixWriteAccess, &pGlxDraw, &err)) + /* We just added it in CreatePixmap, so we should never get here. */ + return; + + for (i = 0; i < numAttribs; i++) { + if (attribs[2 * i] == GLX_TEXTURE_TARGET_EXT) { + switch (attribs[2 * i + 1]) { + case GLX_TEXTURE_2D_EXT: + target = GL_TEXTURE_2D; + break; + case GLX_TEXTURE_RECTANGLE_EXT: + target = GL_TEXTURE_RECTANGLE_ARB; + break; + } + } + + if (attribs[2 * i] == GLX_TEXTURE_FORMAT_EXT) + format = attribs[2 * i + 1]; + } + + if (!target) { + int w = pGlxDraw->pDraw->width, h = pGlxDraw->pDraw->height; + + if (h & (h - 1) || w & (w - 1)) + target = GL_TEXTURE_RECTANGLE_ARB; + else + target = GL_TEXTURE_2D; + } + + pGlxDraw->target = target; + pGlxDraw->format = format; +} + +int __glXDisp_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc; + __GLXconfig *config; + __GLXscreen *pGlxScreen; + int err; + + REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq); + + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) + return err; + if (!validGlxVisual(cl->client, pGlxScreen, req->visual, &config, &err)) + return err; + + return DoCreateGLXPixmap(cl->client, pGlxScreen, config, + req->pixmap, req->glxpixmap); +} + +int __glXDisp_CreatePixmap(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc; + __GLXconfig *config; + __GLXscreen *pGlxScreen; + int err; + + REQUEST_AT_LEAST_SIZE(xGLXCreatePixmapReq); + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXCreatePixmapReq, req->numAttribs << 3); + + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) + return err; + if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err)) + return err; + + err = DoCreateGLXPixmap(cl->client, pGlxScreen, config, + req->pixmap, req->glxpixmap); + if (err != Success) + return err; + + determineTextureTarget(cl->client, req->glxpixmap, + (CARD32*) (req + 1), req->numAttribs); + + return Success; +} + +int __glXDisp_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCreateGLXPixmapWithConfigSGIXReq *req = + (xGLXCreateGLXPixmapWithConfigSGIXReq *) pc; + __GLXconfig *config; + __GLXscreen *pGlxScreen; + int err; + + REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapWithConfigSGIXReq); + + if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) + return err; + if (!validGlxFBConfig(cl->client, pGlxScreen, req->fbconfig, &config, &err)) + return err; + + return DoCreateGLXPixmap(cl->client, pGlxScreen, + config, req->pixmap, req->glxpixmap); +} + + +static int DoDestroyDrawable(__GLXclientState *cl, XID glxdrawable, int type) +{ + __GLXdrawable *pGlxDraw; + int err; + + if (!validGlxDrawable(cl->client, glxdrawable, type, + DixDestroyAccess, &pGlxDraw, &err)) + return err; + + FreeResource(glxdrawable, FALSE); + + return Success; +} + +int __glXDisp_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc; + + REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq); + + return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP); +} + +int __glXDisp_DestroyPixmap(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXDestroyPixmapReq *req = (xGLXDestroyPixmapReq *) pc; + + /* should be REQUEST_SIZE_MATCH, but mesa's glXDestroyPixmap used to set + * length to 3 instead of 2 */ + REQUEST_AT_LEAST_SIZE(xGLXDestroyPixmapReq); + + return DoDestroyDrawable(cl, req->glxpixmap, GLX_DRAWABLE_PIXMAP); +} + +static int +DoCreatePbuffer(ClientPtr client, int screenNum, XID fbconfigId, + int width, int height, XID glxDrawableId) +{ + __GLXconfig *config; + __GLXscreen *pGlxScreen; + PixmapPtr pPixmap; + int err; + + LEGAL_NEW_RESOURCE(glxDrawableId, client); + + if (!validGlxScreen(client, screenNum, &pGlxScreen, &err)) + return err; + if (!validGlxFBConfig(client, pGlxScreen, fbconfigId, &config, &err)) + return err; + + __glXenterServer(GL_FALSE); + pPixmap = (*pGlxScreen->pScreen->CreatePixmap) (pGlxScreen->pScreen, + width, height, config->rgbBits, 0); + __glXleaveServer(GL_FALSE); + + /* Assign the pixmap the same id as the pbuffer and add it as a + * resource so it and the DRI2 drawable will be reclaimed when the + * pbuffer is destroyed. */ + pPixmap->drawable.id = glxDrawableId; + if (!AddResource(pPixmap->drawable.id, RT_PIXMAP, pPixmap)) + return BadAlloc; + + return DoCreateGLXDrawable(client, pGlxScreen, config, &pPixmap->drawable, + glxDrawableId, glxDrawableId, + GLX_DRAWABLE_PBUFFER); +} + +int __glXDisp_CreatePbuffer(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc; + CARD32 *attrs; + int width, height, i; + + REQUEST_AT_LEAST_SIZE(xGLXCreatePbufferReq); + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXCreatePbufferReq, req->numAttribs << 3); + + attrs = (CARD32 *) (req + 1); + width = 0; + height = 0; + + for (i = 0; i < req->numAttribs; i++) { + switch (attrs[i * 2]) { + case GLX_PBUFFER_WIDTH: + width = attrs[i * 2 + 1]; + break; + case GLX_PBUFFER_HEIGHT: + height = attrs[i * 2 + 1]; + break; + case GLX_LARGEST_PBUFFER: + case GLX_PRESERVED_CONTENTS: + /* FIXME: huh... */ + break; + } + } + + return DoCreatePbuffer(cl->client, req->screen, req->fbconfig, + width, height, req->pbuffer); +} + +int __glXDisp_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc; + + REQUEST_AT_LEAST_SIZE(xGLXCreateGLXPbufferSGIXReq); + + return DoCreatePbuffer(cl->client, req->screen, req->fbconfig, + req->width, req->height, req->pbuffer); +} + +int __glXDisp_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc; + + REQUEST_SIZE_MATCH(xGLXDestroyPbufferReq); + + return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER); +} + +int __glXDisp_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc; + + REQUEST_SIZE_MATCH(xGLXDestroyGLXPbufferSGIXReq); + + return DoDestroyDrawable(cl, req->pbuffer, GLX_DRAWABLE_PBUFFER); +} + +static int +DoChangeDrawableAttributes(ClientPtr client, XID glxdrawable, + int numAttribs, CARD32 *attribs) +{ + __GLXdrawable *pGlxDraw; + int i, err; + + if (!validGlxDrawable(client, glxdrawable, GLX_DRAWABLE_ANY, + DixSetAttrAccess, &pGlxDraw, &err)) + return err; + + for (i = 0; i < numAttribs; i++) { + switch(attribs[i * 2]) { + case GLX_EVENT_MASK: + /* All we do is to record the event mask so we can send it + * back when queried. We never actually clobber the + * pbuffers, so we never need to send out the event. */ + pGlxDraw->eventMask = attribs[i * 2 + 1]; + break; + } + } + + return Success; +} + +int __glXDisp_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXChangeDrawableAttributesReq *req = + (xGLXChangeDrawableAttributesReq *) pc; + + REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesReq); + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } +#if 0 + /* mesa sends an additional 8 bytes */ + REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesReq, req->numAttribs << 3); +#else + if (((sizeof(xGLXChangeDrawableAttributesReq) + (req->numAttribs << 3)) >> 2) < client->req_len) + return BadLength; +#endif + + return DoChangeDrawableAttributes(cl->client, req->drawable, + req->numAttribs, (CARD32 *) (req + 1)); +} + +int __glXDisp_ChangeDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXChangeDrawableAttributesSGIXReq *req = + (xGLXChangeDrawableAttributesSGIXReq *)pc; + + REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesSGIXReq); + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesSGIXReq, req->numAttribs << 3); + + return DoChangeDrawableAttributes(cl->client, req->drawable, + req->numAttribs, (CARD32 *) (req + 1)); +} + +int __glXDisp_CreateWindow(__GLXclientState *cl, GLbyte *pc) +{ + xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc; + __GLXconfig *config; + __GLXscreen *pGlxScreen; + ClientPtr client = cl->client; + DrawablePtr pDraw; + int err; + + REQUEST_AT_LEAST_SIZE(xGLXCreateWindowReq); + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXCreateWindowReq, req->numAttribs << 3); + + LEGAL_NEW_RESOURCE(req->glxwindow, client); + + if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) + return err; + if (!validGlxFBConfig(client, pGlxScreen, req->fbconfig, &config, &err)) + return err; + + err = dixLookupDrawable(&pDraw, req->window, client, 0, DixAddAccess); + if (err != Success || pDraw->type != DRAWABLE_WINDOW) { + client->errorValue = req->window; + return BadWindow; + } + + if (!validGlxFBConfigForWindow(client, config, pDraw, &err)) + return err; + + return DoCreateGLXDrawable(client, pGlxScreen, config, + pDraw, req->window, + req->glxwindow, GLX_DRAWABLE_WINDOW); +} + +int __glXDisp_DestroyWindow(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc; + + /* mesa's glXDestroyWindow used to set length to 3 instead of 2 */ + REQUEST_AT_LEAST_SIZE(xGLXDestroyWindowReq); + + return DoDestroyDrawable(cl, req->glxwindow, GLX_DRAWABLE_WINDOW); +} + + +/*****************************************************************************/ + +/* +** NOTE: There is no portable implementation for swap buffers as of +** this time that is of value. Consequently, this code must be +** implemented by somebody other than SGI. +*/ +int __glXDisp_SwapBuffers(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc; + GLXContextTag tag; + XID drawId; + __GLXcontext *glxc = NULL; + __GLXdrawable *pGlxDraw; + int error; + + REQUEST_SIZE_MATCH(xGLXSwapBuffersReq); + + tag = req->contextTag; + drawId = req->drawable; + if (tag) { + glxc = __glXLookupContextByTag(cl, tag); + if (!glxc) { + return __glXError(GLXBadContextTag); + } + /* + ** The calling thread is swapping its current drawable. In this case, + ** glxSwapBuffers is in both GL and X streams, in terms of + ** sequentiality. + */ + if (__glXForceCurrent(cl, tag, &error)) { + /* + ** Do whatever is needed to make sure that all preceding requests + ** in both streams are completed before the swap is executed. + */ + CALL_Finish( GET_DISPATCH(), () ); + __GLX_NOTE_FLUSHED_CMDS(glxc); + } else { + return error; + } + } + + pGlxDraw = __glXGetDrawable(glxc, drawId, client, &error); + if (pGlxDraw == NULL) + return error; + + if (pGlxDraw->type == DRAWABLE_WINDOW && + (*pGlxDraw->swapBuffers)(cl->client, pGlxDraw) == GL_FALSE) + return __glXError(GLXBadDrawable); + + return Success; +} + + +static int +DoQueryContext(__GLXclientState *cl, GLXContextID gcId) +{ + ClientPtr client = cl->client; + __GLXcontext *ctx; + xGLXQueryContextInfoEXTReply reply; + int nProps; + int *sendBuf, *pSendBuf; + int nReplyBytes; + int err; + + if (!validGlxContext(cl->client, gcId, DixReadAccess, &ctx, &err)) + return err; + + nProps = 3; + reply.length = nProps << 1; + reply.type = X_Reply; + reply.sequenceNumber = client->sequence; + reply.n = nProps; + + nReplyBytes = reply.length << 2; + sendBuf = (int *)malloc((size_t)nReplyBytes); + if (sendBuf == NULL) { + return __glXError(GLXBadContext); /* XXX: Is this correct? */ + } + pSendBuf = sendBuf; + *pSendBuf++ = GLX_SHARE_CONTEXT_EXT; + *pSendBuf++ = (int)(ctx->share_id); + *pSendBuf++ = GLX_VISUAL_ID_EXT; + *pSendBuf++ = (int)(ctx->config->visualID); + *pSendBuf++ = GLX_SCREEN_EXT; + *pSendBuf++ = (int)(ctx->pGlxScreen->pScreen->myNum); + + if (client->swapped) { + __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf); + } else { + WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)&reply); + WriteToClient(client, nReplyBytes, (char *)sendBuf); + } + free((char *)sendBuf); + + return Success; +} + +int __glXDisp_QueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc; + + REQUEST_SIZE_MATCH(xGLXQueryContextInfoEXTReq); + + return DoQueryContext(cl, req->context); +} + +int __glXDisp_QueryContext(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc; + + REQUEST_SIZE_MATCH(xGLXQueryContextReq); + + return DoQueryContext(cl, req->context); +} + +int __glXDisp_BindTexImageEXT(__GLXclientState *cl, GLbyte *pc) +{ + xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; + ClientPtr client = cl->client; + __GLXcontext *context; + __GLXdrawable *pGlxDraw; + GLXDrawable drawId; + int buffer; + int error; + CARD32 num_attribs; + + if ((sizeof(xGLXVendorPrivateReq) + 12) >> 2 > client->req_len) + return BadLength; + + pc += __GLX_VENDPRIV_HDR_SIZE; + + drawId = *((CARD32 *) (pc)); + buffer = *((INT32 *) (pc + 4)); + num_attribs = *((CARD32 *) (pc + 8)); + if (num_attribs > (UINT32_MAX >> 3)) { + client->errorValue = num_attribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 12 + (num_attribs << 3)); + + if (buffer != GLX_FRONT_LEFT_EXT) + return __glXError(GLXBadPixmap); + + context = __glXForceCurrent (cl, req->contextTag, &error); + if (!context) + return error; + + if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_PIXMAP, + DixReadAccess, &pGlxDraw, &error)) + return error; + + if (!context->textureFromPixmap) + return __glXError(GLXUnsupportedPrivateRequest); + + return context->textureFromPixmap->bindTexImage(context, + buffer, + pGlxDraw); +} + +int __glXDisp_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc) +{ + xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; + ClientPtr client = cl->client; + __GLXdrawable *pGlxDraw; + __GLXcontext *context; + GLXDrawable drawId; + int buffer; + int error; + + REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 8); + + pc += __GLX_VENDPRIV_HDR_SIZE; + + drawId = *((CARD32 *) (pc)); + buffer = *((INT32 *) (pc + 4)); + + context = __glXForceCurrent (cl, req->contextTag, &error); + if (!context) + return error; + + if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_PIXMAP, + DixReadAccess, &pGlxDraw, &error)) + return error; + + if (!context->textureFromPixmap) + return __glXError(GLXUnsupportedPrivateRequest); + + return context->textureFromPixmap->releaseTexImage(context, + buffer, + pGlxDraw); +} + +int __glXDisp_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc) +{ + xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; + GLXContextTag tag = req->contextTag; + __GLXcontext *glxc = NULL; + __GLXdrawable *pGlxDraw; + ClientPtr client = cl->client; + GLXDrawable drawId; + int error; + int x, y, width, height; + + (void) client; + (void) req; + + REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 20); + + pc += __GLX_VENDPRIV_HDR_SIZE; + + drawId = *((CARD32 *) (pc)); + x = *((INT32 *) (pc + 4)); + y = *((INT32 *) (pc + 8)); + width = *((INT32 *) (pc + 12)); + height = *((INT32 *) (pc + 16)); + + if (tag) { + glxc = __glXLookupContextByTag(cl, tag); + if (!glxc) { + return __glXError(GLXBadContextTag); + } + /* + ** The calling thread is swapping its current drawable. In this case, + ** glxSwapBuffers is in both GL and X streams, in terms of + ** sequentiality. + */ + if (__glXForceCurrent(cl, tag, &error)) { + /* + ** Do whatever is needed to make sure that all preceding requests + ** in both streams are completed before the swap is executed. + */ + CALL_Finish( GET_DISPATCH(), () ); + __GLX_NOTE_FLUSHED_CMDS(glxc); + } else { + return error; + } + } + + pGlxDraw = __glXGetDrawable(glxc, drawId, client, &error); + if (!pGlxDraw) + return error; + + if (pGlxDraw == NULL || + pGlxDraw->type != GLX_DRAWABLE_WINDOW || + pGlxDraw->copySubBuffer == NULL) + return __glXError(GLXBadDrawable); + + (*pGlxDraw->copySubBuffer)(pGlxDraw, x, y, width, height); + + return Success; +} + +/* +** Get drawable attributes +*/ +static int +DoGetDrawableAttributes(__GLXclientState *cl, XID drawId) +{ + ClientPtr client = cl->client; + xGLXGetDrawableAttributesReply reply; + __GLXdrawable *pGlxDraw; + CARD32 attributes[6]; + int numAttribs, error; + + if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY, + DixGetAttrAccess, &pGlxDraw, &error)) + return error; + + numAttribs = 3; + reply.length = numAttribs << 1; + reply.type = X_Reply; + reply.sequenceNumber = client->sequence; + reply.numAttribs = numAttribs; + + attributes[0] = GLX_TEXTURE_TARGET_EXT; + attributes[1] = pGlxDraw->target == GL_TEXTURE_2D ? GLX_TEXTURE_2D_EXT : + GLX_TEXTURE_RECTANGLE_EXT; + attributes[2] = GLX_Y_INVERTED_EXT; + attributes[3] = GL_FALSE; + attributes[4] = GLX_EVENT_MASK; + attributes[5] = pGlxDraw->eventMask; + + if (client->swapped) { + __glXSwapGetDrawableAttributesReply(client, &reply, attributes); + } else { + WriteToClient(client, sz_xGLXGetDrawableAttributesReply, + (char *)&reply); + WriteToClient(client, reply.length * sizeof (CARD32), + (char *)attributes); + } + + return Success; +} + +int __glXDisp_GetDrawableAttributes(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc; + + /* this should be REQUEST_SIZE_MATCH, but mesa sends an additional 4 bytes */ + REQUEST_AT_LEAST_SIZE(xGLXGetDrawableAttributesReq); + + return DoGetDrawableAttributes(cl, req->drawable); +} + +int __glXDisp_GetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXGetDrawableAttributesSGIXReq *req = + (xGLXGetDrawableAttributesSGIXReq *)pc; + + REQUEST_SIZE_MATCH(xGLXGetDrawableAttributesSGIXReq); + + return DoGetDrawableAttributes(cl, req->drawable); +} + +/************************************************************************/ + +/* +** Render and Renderlarge are not in the GLX API. They are used by the GLX +** client library to send batches of GL rendering commands. +*/ + +/* +** Execute all the drawing commands in a request. +*/ +int __glXDisp_Render(__GLXclientState *cl, GLbyte *pc) +{ + xGLXRenderReq *req; + ClientPtr client= cl->client; + int left, cmdlen, error; + int commandsDone; + CARD16 opcode; + __GLXrenderHeader *hdr; + __GLXcontext *glxc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_AT_LEAST_SIZE(xGLXRenderReq); + + req = (xGLXRenderReq *) pc; + if (client->swapped) { + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->contextTag); + } + + glxc = __glXForceCurrent(cl, req->contextTag, &error); + if (!glxc) { + return error; + } + + commandsDone = 0; + pc += sz_xGLXRenderReq; + left = (req->length << 2) - sz_xGLXRenderReq; + while (left > 0) { + __GLXrenderSizeData entry; + int extra; + __GLXdispatchRenderProcPtr proc; + int err; + + if (left < sizeof(__GLXrenderHeader)) + return BadLength; + + /* + ** Verify that the header length and the overall length agree. + ** Also, each command must be word aligned. + */ + hdr = (__GLXrenderHeader *) pc; + if (client->swapped) { + __GLX_SWAP_SHORT(&hdr->length); + __GLX_SWAP_SHORT(&hdr->opcode); + } + cmdlen = hdr->length; + opcode = hdr->opcode; + + /* + ** Check for core opcodes and grab entry data. + */ + err = __glXGetProtocolSizeData(& Render_dispatch_info, opcode, & entry); + proc = (__GLXdispatchRenderProcPtr) + __glXGetProtocolDecodeFunction(& Render_dispatch_info, + opcode, client->swapped); + + if ((err < 0) || (proc == NULL)) { + client->errorValue = commandsDone; + return __glXError(GLXBadRenderRequest); + } + + if (entry.varsize) { + /* variable size command */ + extra = (*entry.varsize)(pc + __GLX_RENDER_HDR_SIZE, + client->swapped); + if (extra < 0) { + extra = 0; + } + if (cmdlen != __GLX_PAD(entry.bytes + extra)) { + return BadLength; + } + } else { + /* constant size command */ + if (cmdlen != __GLX_PAD(entry.bytes)) { + return BadLength; + } + } + if (left < cmdlen) { + return BadLength; + } + + /* + ** Skip over the header and execute the command. We allow the + ** caller to trash the command memory. This is useful especially + ** for things that require double alignment - they can just shift + ** the data towards lower memory (trashing the header) by 4 bytes + ** and achieve the required alignment. + */ + (*proc)(pc + __GLX_RENDER_HDR_SIZE); + pc += cmdlen; + left -= cmdlen; + commandsDone++; + } + __GLX_NOTE_UNFLUSHED_CMDS(glxc); + return Success; +} + + +/* +** Execute a large rendering request (one that spans multiple X requests). +*/ +int __glXDisp_RenderLarge(__GLXclientState *cl, GLbyte *pc) +{ + xGLXRenderLargeReq *req; + ClientPtr client= cl->client; + size_t dataBytes; + __GLXrenderLargeHeader *hdr; + __GLXcontext *glxc; + int error; + CARD16 opcode; + __GLX_DECLARE_SWAP_VARIABLES; + + req = (xGLXRenderLargeReq *) pc; + if (client->swapped) { + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->contextTag); + __GLX_SWAP_INT(&req->dataBytes); + __GLX_SWAP_SHORT(&req->requestNumber); + __GLX_SWAP_SHORT(&req->requestTotal); + } + + glxc = __glXForceCurrent(cl, req->contextTag, &error); + if (!glxc) { + /* Reset in case this isn't 1st request. */ + __glXResetLargeCommandStatus(cl); + return error; + } + dataBytes = req->dataBytes; + + /* + ** Check the request length. + */ + if ((req->length << 2) != __GLX_PAD(dataBytes) + sz_xGLXRenderLargeReq) { + client->errorValue = req->length; + /* Reset in case this isn't 1st request. */ + __glXResetLargeCommandStatus(cl); + return BadLength; + } + pc += sz_xGLXRenderLargeReq; + + if (cl->largeCmdRequestsSoFar == 0) { + __GLXrenderSizeData entry; + int extra; + size_t cmdlen; + int err; + + /* + ** This is the first request of a multi request command. + ** Make enough space in the buffer, then copy the entire request. + */ + if (req->requestNumber != 1) { + client->errorValue = req->requestNumber; + return __glXError(GLXBadLargeRequest); + } + + hdr = (__GLXrenderLargeHeader *) pc; + if (client->swapped) { + __GLX_SWAP_INT(&hdr->length); + __GLX_SWAP_INT(&hdr->opcode); + } + cmdlen = hdr->length; + opcode = hdr->opcode; + + /* + ** Check for core opcodes and grab entry data. + */ + err = __glXGetProtocolSizeData(& Render_dispatch_info, opcode, & entry); + if (err < 0) { + client->errorValue = opcode; + return __glXError(GLXBadLargeRequest); + } + + if (entry.varsize) { + /* + ** If it's a variable-size command (a command whose length must + ** be computed from its parameters), all the parameters needed + ** will be in the 1st request, so it's okay to do this. + */ + extra = (*entry.varsize)(pc + __GLX_RENDER_LARGE_HDR_SIZE, + client->swapped); + if (extra < 0) { + extra = 0; + } + /* large command's header is 4 bytes longer, so add 4 */ + if (cmdlen != __GLX_PAD(entry.bytes + 4 + extra)) { + return BadLength; + } + } else { + /* constant size command */ + if (cmdlen != __GLX_PAD(entry.bytes + 4)) { + return BadLength; + } + } + /* + ** Make enough space in the buffer, then copy the entire request. + */ + if (cl->largeCmdBufSize < cmdlen) { + if (!cl->largeCmdBuf) { + cl->largeCmdBuf = (GLbyte *) malloc(cmdlen); + } else { + cl->largeCmdBuf = (GLbyte *) realloc(cl->largeCmdBuf, cmdlen); + } + if (!cl->largeCmdBuf) { + return BadAlloc; + } + cl->largeCmdBufSize = cmdlen; + } + memcpy(cl->largeCmdBuf, pc, dataBytes); + + cl->largeCmdBytesSoFar = dataBytes; + cl->largeCmdBytesTotal = cmdlen; + cl->largeCmdRequestsSoFar = 1; + cl->largeCmdRequestsTotal = req->requestTotal; + return Success; + + } else { + /* + ** We are receiving subsequent (i.e. not the first) requests of a + ** multi request command. + */ + + /* + ** Check the request number and the total request count. + */ + if (req->requestNumber != cl->largeCmdRequestsSoFar + 1) { + client->errorValue = req->requestNumber; + __glXResetLargeCommandStatus(cl); + return __glXError(GLXBadLargeRequest); + } + if (req->requestTotal != cl->largeCmdRequestsTotal) { + client->errorValue = req->requestTotal; + __glXResetLargeCommandStatus(cl); + return __glXError(GLXBadLargeRequest); + } + + /* + ** Check that we didn't get too much data. + */ + if ((cl->largeCmdBytesSoFar + dataBytes) > cl->largeCmdBytesTotal) { + client->errorValue = dataBytes; + __glXResetLargeCommandStatus(cl); + return __glXError(GLXBadLargeRequest); + } + memcpy(cl->largeCmdBuf + cl->largeCmdBytesSoFar, pc, dataBytes); + cl->largeCmdBytesSoFar += dataBytes; + cl->largeCmdRequestsSoFar++; + + if (req->requestNumber == cl->largeCmdRequestsTotal) { + __GLXdispatchRenderProcPtr proc; + + /* + ** This is the last request; it must have enough bytes to complete + ** the command. + */ + /* NOTE: the two pad macros have been added below; they are needed + ** because the client library pads the total byte count, but not + ** the per-request byte counts. The Protocol Encoding says the + ** total byte count should not be padded, so a proposal will be + ** made to the ARB to relax the padding constraint on the total + ** byte count, thus preserving backward compatibility. Meanwhile, + ** the padding done below fixes a bug that did not allow + ** large commands of odd sizes to be accepted by the server. + */ + if (__GLX_PAD(cl->largeCmdBytesSoFar) != + __GLX_PAD(cl->largeCmdBytesTotal)) { + client->errorValue = dataBytes; + __glXResetLargeCommandStatus(cl); + return __glXError(GLXBadLargeRequest); + } + hdr = (__GLXrenderLargeHeader *) cl->largeCmdBuf; + /* + ** The opcode and length field in the header had already been + ** swapped when the first request was received. + ** + ** Use the opcode to index into the procedure table. + */ + opcode = hdr->opcode; + + proc = (__GLXdispatchRenderProcPtr) + __glXGetProtocolDecodeFunction(& Render_dispatch_info, opcode, + client->swapped); + if (proc == NULL) { + client->errorValue = opcode; + return __glXError(GLXBadLargeRequest); + } + + /* + ** Skip over the header and execute the command. + */ + (*proc)(cl->largeCmdBuf + __GLX_RENDER_LARGE_HDR_SIZE); + __GLX_NOTE_UNFLUSHED_CMDS(glxc); + + /* + ** Reset for the next RenderLarge series. + */ + __glXResetLargeCommandStatus(cl); + } else { + /* + ** This is neither the first nor the last request. + */ + } + return Success; + } +} + +/************************************************************************/ + +/* +** No support is provided for the vendor-private requests other than +** allocating the entry points in the dispatch table. +*/ + +int __glXDisp_VendorPrivate(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; + GLint vendorcode = req->vendorCode; + __GLXdispatchVendorPrivProcPtr proc; + + REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq); + + proc = (__GLXdispatchVendorPrivProcPtr) + __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info, + vendorcode, 0); + if (proc != NULL) { + (*proc)(cl, (GLbyte*)req); + return Success; + } + + cl->client->errorValue = req->vendorCode; + return __glXError(GLXUnsupportedPrivateRequest); +} + +int __glXDisp_VendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; + GLint vendorcode = req->vendorCode; + __GLXdispatchVendorPrivProcPtr proc; + + REQUEST_AT_LEAST_SIZE(xGLXVendorPrivateReq); + + proc = (__GLXdispatchVendorPrivProcPtr) + __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info, + vendorcode, 0); + if (proc != NULL) { + return (*proc)(cl, (GLbyte*)req); + } + + cl->client->errorValue = vendorcode; + return __glXError(GLXUnsupportedPrivateRequest); +} + +int __glXDisp_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc; + xGLXQueryExtensionsStringReply reply; + __GLXscreen *pGlxScreen; + size_t n, length; + char *buf; + int err; + + REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq); + + if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) + return err; + + n = strlen(pGlxScreen->GLXextensions) + 1; + length = __GLX_PAD(n) >> 2; + reply.type = X_Reply; + reply.sequenceNumber = client->sequence; + reply.length = length; + reply.n = n; + + /* Allocate buffer to make sure it's a multiple of 4 bytes big.*/ + buf = (char *) malloc(length << 2); + if (buf == NULL) + return BadAlloc; + memcpy(buf, pGlxScreen->GLXextensions, n); + + if (client->swapped) { + glxSwapQueryExtensionsStringReply(client, &reply, buf); + } else { + WriteToClient(client, sz_xGLXQueryExtensionsStringReply,(char *)&reply); + WriteToClient(client, (int)(length << 2), (char *)buf); + } + + free(buf); + return Success; +} + +int __glXDisp_QueryServerString(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) pc; + xGLXQueryServerStringReply reply; + size_t n, length; + const char *ptr; + char *buf; + __GLXscreen *pGlxScreen; + int err; + char ver_str[16]; + + REQUEST_SIZE_MATCH(xGLXQueryServerStringReq); + + if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) + return err; + + switch(req->name) { + case GLX_VENDOR: + ptr = pGlxScreen->GLXvendor; + break; + case GLX_VERSION: + /* Return to the server version rather than the screen version + * to prevent confusion when they do not match. + */ + snprintf(ver_str, 16, "%d.%d", glxMajorVersion, glxMinorVersion); + ptr = ver_str; + break; + case GLX_EXTENSIONS: + ptr = pGlxScreen->GLXextensions; + break; + default: + return BadValue; + } + + n = strlen(ptr) + 1; + length = __GLX_PAD(n) >> 2; + reply.type = X_Reply; + reply.sequenceNumber = client->sequence; + reply.length = length; + reply.n = n; + + buf = (char *) malloc(length << 2); + if (buf == NULL) { + return BadAlloc; + } + memcpy(buf, ptr, n); + + if (client->swapped) { + glxSwapQueryServerStringReply(client, &reply, buf); + } else { + WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)&reply); + WriteToClient(client, (int)(length << 2), buf); + } + + free(buf); + return Success; +} + +int __glXDisp_ClientInfo(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXClientInfoReq *req = (xGLXClientInfoReq *) pc; + const char *buf; + + REQUEST_AT_LEAST_SIZE(xGLXClientInfoReq); + + buf = (const char *)(req+1); + if (!memchr(buf, 0, (client->req_len << 2) - sizeof(xGLXClientInfoReq))) + return BadLength; + + cl->GLClientmajorVersion = req->major; + cl->GLClientminorVersion = req->minor; + free(cl->GLClientextensions); + cl->GLClientextensions = strdup(buf); + + return Success; +} diff --git a/xorg-server/glx/glxcmdsswap.c b/xorg-server/glx/glxcmdsswap.c index 3bb4cade9..a7689ed46 100644 --- a/xorg-server/glx/glxcmdsswap.c +++ b/xorg-server/glx/glxcmdsswap.c @@ -1,915 +1,921 @@ -/* - * 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_DIX_CONFIG_H -#include -#endif - -#include -#include "glxserver.h" -#include "glxutil.h" -#include -#include -#include -#include -#include "glxext.h" -#include "glapitable.h" -#include "glapi.h" -#include "glthread.h" -#include "dispatch.h" -#include "indirect_dispatch.h" -#include "indirect_table.h" -#include "indirect_util.h" - - -/************************************************************************/ - -/* -** Byteswapping versions of GLX commands. In most cases they just swap -** the incoming arguments and then call the unswapped routine. For commands -** that have replies, a separate swapping routine for the reply is provided; -** it is called at the end of the unswapped routine. -*/ - -int __glXDispSwap_CreateContext(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXCreateContextReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->context); - __GLX_SWAP_INT(&req->visual); - __GLX_SWAP_INT(&req->screen); - __GLX_SWAP_INT(&req->shareList); - - return __glXDisp_CreateContext(cl, pc); -} - -int __glXDispSwap_CreateNewContext(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXCreateNewContextReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->context); - __GLX_SWAP_INT(&req->fbconfig); - __GLX_SWAP_INT(&req->screen); - __GLX_SWAP_INT(&req->renderType); - __GLX_SWAP_INT(&req->shareList); - - return __glXDisp_CreateNewContext(cl, pc); -} - -int __glXDispSwap_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCreateContextWithConfigSGIXReq *req = - (xGLXCreateContextWithConfigSGIXReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXCreateContextWithConfigSGIXReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->context); - __GLX_SWAP_INT(&req->fbconfig); - __GLX_SWAP_INT(&req->screen); - __GLX_SWAP_INT(&req->renderType); - __GLX_SWAP_INT(&req->shareList); - - return __glXDisp_CreateContextWithConfigSGIX(cl, pc); -} - -int __glXDispSwap_DestroyContext(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXDestroyContextReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->context); - - return __glXDisp_DestroyContext(cl, pc); -} - -int __glXDispSwap_MakeCurrent(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXMakeCurrentReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->drawable); - __GLX_SWAP_INT(&req->context); - __GLX_SWAP_INT(&req->oldContextTag); - - return __glXDisp_MakeCurrent(cl, pc); -} - -int __glXDispSwap_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->drawable); - __GLX_SWAP_INT(&req->readdrawable); - __GLX_SWAP_INT(&req->context); - __GLX_SWAP_INT(&req->oldContextTag); - - return __glXDisp_MakeContextCurrent(cl, pc); -} - -int __glXDispSwap_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->drawable); - __GLX_SWAP_INT(&req->readable); - __GLX_SWAP_INT(&req->context); - __GLX_SWAP_INT(&req->oldContextTag); - - return __glXDisp_MakeCurrentReadSGI(cl, pc); -} - -int __glXDispSwap_IsDirect(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXIsDirectReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->context); - - return __glXDisp_IsDirect(cl, pc); -} - -int __glXDispSwap_QueryVersion(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXQueryVersionReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->majorVersion); - __GLX_SWAP_INT(&req->minorVersion); - - return __glXDisp_QueryVersion(cl, pc); -} - -int __glXDispSwap_WaitGL(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXWaitGLReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->contextTag); - - return __glXDisp_WaitGL(cl, pc); -} - -int __glXDispSwap_WaitX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXWaitXReq *req = (xGLXWaitXReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXWaitXReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->contextTag); - - return __glXDisp_WaitX(cl, pc); -} - -int __glXDispSwap_CopyContext(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXCopyContextReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->source); - __GLX_SWAP_INT(&req->dest); - __GLX_SWAP_INT(&req->mask); - - return __glXDisp_CopyContext(cl, pc); -} - -int __glXDispSwap_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq); - - __GLX_SWAP_INT(&req->screen); - return __glXDisp_GetVisualConfigs(cl, pc); -} - -int __glXDispSwap_GetFBConfigs(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq); - - __GLX_SWAP_INT(&req->screen); - return __glXDisp_GetFBConfigs(cl, pc); -} - -int __glXDispSwap_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXGetFBConfigsSGIXReq); - - __GLX_SWAP_INT(&req->screen); - return __glXDisp_GetFBConfigsSGIX(cl, pc); -} - -int __glXDispSwap_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->screen); - __GLX_SWAP_INT(&req->visual); - __GLX_SWAP_INT(&req->pixmap); - __GLX_SWAP_INT(&req->glxpixmap); - - return __glXDisp_CreateGLXPixmap(cl, pc); -} - -int __glXDispSwap_CreatePixmap(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc; - CARD32 *attribs; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - - REQUEST_AT_LEAST_SIZE(xGLXCreatePixmapReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->screen); - __GLX_SWAP_INT(&req->fbconfig); - __GLX_SWAP_INT(&req->pixmap); - __GLX_SWAP_INT(&req->glxpixmap); - __GLX_SWAP_INT(&req->numAttribs); - - if (req->numAttribs > (UINT32_MAX >> 3)) { - client->errorValue = req->numAttribs; - return BadValue; - } - REQUEST_FIXED_SIZE(xGLXCreatePixmapReq, req->numAttribs << 3); - attribs = (CARD32*)(req + 1); - __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); - - return __glXDisp_CreatePixmap(cl, pc); -} - -int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCreateGLXPixmapWithConfigSGIXReq *req = - (xGLXCreateGLXPixmapWithConfigSGIXReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapWithConfigSGIXReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->screen); - __GLX_SWAP_INT(&req->fbconfig); - __GLX_SWAP_INT(&req->pixmap); - __GLX_SWAP_INT(&req->glxpixmap); - - return __glXDisp_CreateGLXPixmapWithConfigSGIX(cl, pc); -} - -int __glXDispSwap_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->glxpixmap); - - return __glXDisp_DestroyGLXPixmap(cl, pc); -} - -int __glXDispSwap_DestroyPixmap(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->glxpixmap); - - return __glXDisp_DestroyGLXPixmap(cl, pc); -} - -int __glXDispSwap_QueryContext(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXQueryContextReq); - - __GLX_SWAP_INT(&req->context); - - return __glXDisp_QueryContext(cl, pc); -} - -int __glXDispSwap_CreatePbuffer(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - CARD32 *attribs; - - REQUEST_AT_LEAST_SIZE(xGLXCreatePbufferReq); - - __GLX_SWAP_INT(&req->screen); - __GLX_SWAP_INT(&req->fbconfig); - __GLX_SWAP_INT(&req->pbuffer); - __GLX_SWAP_INT(&req->numAttribs); - - if (req->numAttribs > (UINT32_MAX >> 3)) { - client->errorValue = req->numAttribs; - return BadValue; - } - REQUEST_FIXED_SIZE(xGLXCreatePbufferReq, req->numAttribs << 3); - attribs = (CARD32*)(req + 1); - __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); - - return __glXDisp_CreatePbuffer(cl, pc); -} - -int __glXDispSwap_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXCreateGLXPbufferSGIXReq); - - __GLX_SWAP_INT(&req->screen); - __GLX_SWAP_INT(&req->fbconfig); - __GLX_SWAP_INT(&req->pbuffer); - __GLX_SWAP_INT(&req->width); - __GLX_SWAP_INT(&req->height); - - return __glXDisp_CreateGLXPbufferSGIX(cl, pc); -} - -int __glXDispSwap_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXDestroyPbufferReq); - - __GLX_SWAP_INT(&req->pbuffer); - - return __glXDisp_DestroyPbuffer(cl, pc); -} - -int __glXDispSwap_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXDestroyGLXPbufferSGIXReq); - - __GLX_SWAP_INT(&req->pbuffer); - - return __glXDisp_DestroyGLXPbufferSGIX(cl, pc); -} - -int __glXDispSwap_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXChangeDrawableAttributesReq *req = - (xGLXChangeDrawableAttributesReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - CARD32 *attribs; - - REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesReq); - - __GLX_SWAP_INT(&req->drawable); - __GLX_SWAP_INT(&req->numAttribs); - - if (req->numAttribs > (UINT32_MAX >> 3)) { - client->errorValue = req->numAttribs; - return BadValue; - } - REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesReq, req->numAttribs << 3); - attribs = (CARD32*)(req + 1); - __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); - - return __glXDisp_ChangeDrawableAttributes(cl, pc); -} - -int __glXDispSwap_ChangeDrawableAttributesSGIX(__GLXclientState *cl, - GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXChangeDrawableAttributesSGIXReq *req = - (xGLXChangeDrawableAttributesSGIXReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - CARD32 *attribs; - - REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesSGIXReq); - - __GLX_SWAP_INT(&req->drawable); - __GLX_SWAP_INT(&req->numAttribs); - - if (req->numAttribs > (UINT32_MAX >> 3)) { - client->errorValue = req->numAttribs; - return BadValue; - } - REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesSGIXReq, req->numAttribs << 3); - attribs = (CARD32*)(req + 1); - __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); - - return __glXDisp_ChangeDrawableAttributesSGIX(cl, pc); -} - -int __glXDispSwap_CreateWindow(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - CARD32 *attribs; - - REQUEST_AT_LEAST_SIZE(xGLXCreateWindowReq); - - __GLX_SWAP_INT(&req->screen); - __GLX_SWAP_INT(&req->fbconfig); - __GLX_SWAP_INT(&req->window); - __GLX_SWAP_INT(&req->glxwindow); - __GLX_SWAP_INT(&req->numAttribs); - - if (req->numAttribs > (UINT32_MAX >> 3)) { - client->errorValue = req->numAttribs; - return BadValue; - } - REQUEST_FIXED_SIZE(xGLXCreateWindowReq, req->numAttribs << 3); - attribs = (CARD32*)(req + 1); - __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); - - return __glXDisp_CreateWindow(cl, pc); -} - -int __glXDispSwap_DestroyWindow(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXDestroyWindowReq); - - __GLX_SWAP_INT(&req->glxwindow); - - return __glXDisp_DestroyWindow(cl, pc); -} - -int __glXDispSwap_SwapBuffers(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXSwapBuffersReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->contextTag); - __GLX_SWAP_INT(&req->drawable); - - return __glXDisp_SwapBuffers(cl, pc); -} - -int __glXDispSwap_UseXFont(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXUseXFontReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->contextTag); - __GLX_SWAP_INT(&req->font); - __GLX_SWAP_INT(&req->first); - __GLX_SWAP_INT(&req->count); - __GLX_SWAP_INT(&req->listBase); - - return __glXDisp_UseXFont(cl, pc); -} - - -int __glXDispSwap_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *)pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->screen); - - return __glXDisp_QueryExtensionsString(cl, pc); -} - -int __glXDispSwap_QueryServerString(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *)pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXQueryServerStringReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->screen); - __GLX_SWAP_INT(&req->name); - - return __glXDisp_QueryServerString(cl, pc); -} - -int __glXDispSwap_ClientInfo(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXClientInfoReq *req = (xGLXClientInfoReq *)pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_AT_LEAST_SIZE(xGLXClientInfoReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->major); - __GLX_SWAP_INT(&req->minor); - __GLX_SWAP_INT(&req->numbytes); - - return __glXDisp_ClientInfo(cl, pc); -} - -int __glXDispSwap_QueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXQueryContextInfoEXTReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->context); - - return __glXDisp_QueryContextInfoEXT(cl, pc); -} - -int __glXDispSwap_BindTexImageEXT(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; - GLXDrawable *drawId; - int *buffer; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 8); - - pc += __GLX_VENDPRIV_HDR_SIZE; - - drawId = ((GLXDrawable *) (pc)); - buffer = ((int *) (pc + 4)); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->contextTag); - __GLX_SWAP_INT(drawId); - __GLX_SWAP_INT(buffer); - - return __glXDisp_BindTexImageEXT(cl, (GLbyte *)pc); -} - -int __glXDispSwap_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; - GLXDrawable *drawId; - int *buffer; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 8); - - pc += __GLX_VENDPRIV_HDR_SIZE; - - drawId = ((GLXDrawable *) (pc)); - buffer = ((int *) (pc + 4)); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->contextTag); - __GLX_SWAP_INT(drawId); - __GLX_SWAP_INT(buffer); - - return __glXDisp_ReleaseTexImageEXT(cl, (GLbyte *)pc); -} - -int __glXDispSwap_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; - GLXDrawable *drawId; - int *buffer; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 20); - - (void) drawId; - (void) buffer; - - pc += __GLX_VENDPRIV_HDR_SIZE; - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->contextTag); - __GLX_SWAP_INT(pc); - __GLX_SWAP_INT(pc + 4); - __GLX_SWAP_INT(pc + 8); - __GLX_SWAP_INT(pc + 12); - __GLX_SWAP_INT(pc + 16); - - return __glXDisp_CopySubBufferMESA(cl, pc); - -} - -int __glXDispSwap_GetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXVendorPrivateWithReplyReq *req = (xGLXVendorPrivateWithReplyReq *)pc; - CARD32 *data; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXGetDrawableAttributesSGIXReq); - - data = (CARD32 *) (req + 1); - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->contextTag); - __GLX_SWAP_INT(data); - - return __glXDisp_GetDrawableAttributesSGIX(cl, pc); -} - -int __glXDispSwap_GetDrawableAttributes(__GLXclientState *cl, GLbyte *pc) -{ - ClientPtr client = cl->client; - xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc; - __GLX_DECLARE_SWAP_VARIABLES; - - REQUEST_SIZE_MATCH(xGLXGetDrawableAttributesReq); - - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->drawable); - - return __glXDisp_GetDrawableAttributes(cl, pc); -} - - -/************************************************************************/ - -/* -** Swap replies. -*/ - -void __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply *reply) -{ - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_SHORT(&reply->sequenceNumber); - __GLX_SWAP_INT(&reply->length); - __GLX_SWAP_INT(&reply->contextTag); - WriteToClient(client, sz_xGLXMakeCurrentReply, (char *)reply); -} - -void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply *reply) -{ - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_SHORT(&reply->sequenceNumber); - __GLX_SWAP_INT(&reply->length); - WriteToClient(client, sz_xGLXIsDirectReply, (char *)reply); -} - -void __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply *reply) -{ - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_SHORT(&reply->sequenceNumber); - __GLX_SWAP_INT(&reply->length); - __GLX_SWAP_INT(&reply->majorVersion); - __GLX_SWAP_INT(&reply->minorVersion); - WriteToClient(client, sz_xGLXQueryVersionReply, (char *)reply); -} - -void glxSwapQueryExtensionsStringReply(ClientPtr client, - xGLXQueryExtensionsStringReply *reply, char *buf) -{ - int length = reply->length; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - __GLX_SWAP_SHORT(&reply->sequenceNumber); - __GLX_SWAP_INT(&reply->length); - __GLX_SWAP_INT(&reply->n); - WriteToClient(client, sz_xGLXQueryExtensionsStringReply, (char *)reply); - __GLX_SWAP_INT_ARRAY((int *)buf, length); - WriteToClient(client, length << 2, buf); -} - -void glxSwapQueryServerStringReply(ClientPtr client, - xGLXQueryServerStringReply *reply, char *buf) -{ - int length = reply->length; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_SHORT(&reply->sequenceNumber); - __GLX_SWAP_INT(&reply->length); - __GLX_SWAP_INT(&reply->n); - WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)reply); - /** no swap is needed for an array of chars **/ - /* __GLX_SWAP_INT_ARRAY((int *)buf, length); */ - WriteToClient(client, length << 2, buf); -} - -void __glXSwapQueryContextInfoEXTReply(ClientPtr client, xGLXQueryContextInfoEXTReply *reply, int *buf) -{ - int length = reply->length; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - __GLX_SWAP_SHORT(&reply->sequenceNumber); - __GLX_SWAP_INT(&reply->length); - __GLX_SWAP_INT(&reply->n); - WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)reply); - __GLX_SWAP_INT_ARRAY((int *)buf, length); - WriteToClient(client, length << 2, (char *)buf); -} - -void __glXSwapGetDrawableAttributesReply(ClientPtr client, - xGLXGetDrawableAttributesReply *reply, CARD32 *buf) -{ - int length = reply->length; - __GLX_DECLARE_SWAP_VARIABLES; - __GLX_DECLARE_SWAP_ARRAY_VARIABLES; - __GLX_SWAP_SHORT(&reply->sequenceNumber); - __GLX_SWAP_INT(&reply->length); - __GLX_SWAP_INT(&reply->numAttribs); - WriteToClient(client, sz_xGLXGetDrawableAttributesReply, (char *)reply); - __GLX_SWAP_INT_ARRAY((int *)buf, length); - WriteToClient(client, length << 2, (char *)buf); -} - -/************************************************************************/ - -/* -** Render and Renderlarge are not in the GLX API. They are used by the GLX -** client library to send batches of GL rendering commands. -*/ - -int __glXDispSwap_Render(__GLXclientState *cl, GLbyte *pc) -{ - return __glXDisp_Render(cl, pc); -} - -/* -** Execute a large rendering request (one that spans multiple X requests). -*/ -int __glXDispSwap_RenderLarge(__GLXclientState *cl, GLbyte *pc) -{ - return __glXDisp_RenderLarge(cl, pc); -} - -/************************************************************************/ - -/* -** No support is provided for the vendor-private requests other than -** allocating these entry points in the dispatch table. -*/ - -int __glXDispSwap_VendorPrivate(__GLXclientState *cl, GLbyte *pc) -{ - xGLXVendorPrivateReq *req; - GLint vendorcode; - __GLXdispatchVendorPrivProcPtr proc; - - __GLX_DECLARE_SWAP_VARIABLES; - - req = (xGLXVendorPrivateReq *) pc; - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->vendorCode); - - vendorcode = req->vendorCode; - - proc = (__GLXdispatchVendorPrivProcPtr) - __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info, - vendorcode, 1); - if (proc != NULL) { - (*proc)(cl, (GLbyte*)req); - return Success; - } - - cl->client->errorValue = req->vendorCode; - return __glXError(GLXUnsupportedPrivateRequest); -} - - -int __glXDispSwap_VendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc) -{ - xGLXVendorPrivateWithReplyReq *req; - GLint vendorcode; - __GLXdispatchVendorPrivProcPtr proc; - - __GLX_DECLARE_SWAP_VARIABLES; - - req = (xGLXVendorPrivateWithReplyReq *) pc; - __GLX_SWAP_SHORT(&req->length); - __GLX_SWAP_INT(&req->vendorCode); - - vendorcode = req->vendorCode; - - proc = (__GLXdispatchVendorPrivProcPtr) - __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info, - vendorcode, 1); - if (proc != NULL) { - return (*proc)(cl, (GLbyte*)req); - } - - cl->client->errorValue = req->vendorCode; - return __glXError(GLXUnsupportedPrivateRequest); -} +/* + * 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_DIX_CONFIG_H +#include +#endif + +#include +#include "glxserver.h" +#include "glxutil.h" +#include +#include +#include +#include +#include "glxext.h" +#include "glapitable.h" +#include "glapi.h" +#include "glthread.h" +#include "dispatch.h" +#include "indirect_dispatch.h" +#include "indirect_table.h" +#include "indirect_util.h" + + +/************************************************************************/ + +/* +** Byteswapping versions of GLX commands. In most cases they just swap +** the incoming arguments and then call the unswapped routine. For commands +** that have replies, a separate swapping routine for the reply is provided; +** it is called at the end of the unswapped routine. +*/ + +int __glXDispSwap_CreateContext(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCreateContextReq *req = (xGLXCreateContextReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXCreateContextReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->context); + __GLX_SWAP_INT(&req->visual); + __GLX_SWAP_INT(&req->screen); + __GLX_SWAP_INT(&req->shareList); + + return __glXDisp_CreateContext(cl, pc); +} + +int __glXDispSwap_CreateNewContext(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXCreateNewContextReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->context); + __GLX_SWAP_INT(&req->fbconfig); + __GLX_SWAP_INT(&req->screen); + __GLX_SWAP_INT(&req->renderType); + __GLX_SWAP_INT(&req->shareList); + + return __glXDisp_CreateNewContext(cl, pc); +} + +int __glXDispSwap_CreateContextWithConfigSGIX(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCreateContextWithConfigSGIXReq *req = + (xGLXCreateContextWithConfigSGIXReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXCreateContextWithConfigSGIXReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->context); + __GLX_SWAP_INT(&req->fbconfig); + __GLX_SWAP_INT(&req->screen); + __GLX_SWAP_INT(&req->renderType); + __GLX_SWAP_INT(&req->shareList); + + return __glXDisp_CreateContextWithConfigSGIX(cl, pc); +} + +int __glXDispSwap_DestroyContext(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXDestroyContextReq *req = (xGLXDestroyContextReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXDestroyContextReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->context); + + return __glXDisp_DestroyContext(cl, pc); +} + +int __glXDispSwap_MakeCurrent(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXMakeCurrentReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->drawable); + __GLX_SWAP_INT(&req->context); + __GLX_SWAP_INT(&req->oldContextTag); + + return __glXDisp_MakeCurrent(cl, pc); +} + +int __glXDispSwap_MakeContextCurrent(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXMakeContextCurrentReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->drawable); + __GLX_SWAP_INT(&req->readdrawable); + __GLX_SWAP_INT(&req->context); + __GLX_SWAP_INT(&req->oldContextTag); + + return __glXDisp_MakeContextCurrent(cl, pc); +} + +int __glXDispSwap_MakeCurrentReadSGI(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXMakeCurrentReadSGIReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->drawable); + __GLX_SWAP_INT(&req->readable); + __GLX_SWAP_INT(&req->context); + __GLX_SWAP_INT(&req->oldContextTag); + + return __glXDisp_MakeCurrentReadSGI(cl, pc); +} + +int __glXDispSwap_IsDirect(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXIsDirectReq *req = (xGLXIsDirectReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXIsDirectReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->context); + + return __glXDisp_IsDirect(cl, pc); +} + +int __glXDispSwap_QueryVersion(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXQueryVersionReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->majorVersion); + __GLX_SWAP_INT(&req->minorVersion); + + return __glXDisp_QueryVersion(cl, pc); +} + +int __glXDispSwap_WaitGL(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXWaitGLReq *req = (xGLXWaitGLReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXWaitGLReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->contextTag); + + return __glXDisp_WaitGL(cl, pc); +} + +int __glXDispSwap_WaitX(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXWaitXReq *req = (xGLXWaitXReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXWaitXReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->contextTag); + + return __glXDisp_WaitX(cl, pc); +} + +int __glXDispSwap_CopyContext(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCopyContextReq *req = (xGLXCopyContextReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXCopyContextReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->source); + __GLX_SWAP_INT(&req->dest); + __GLX_SWAP_INT(&req->mask); + + return __glXDisp_CopyContext(cl, pc); +} + +int __glXDispSwap_GetVisualConfigs(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXGetVisualConfigsReq *req = (xGLXGetVisualConfigsReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXGetVisualConfigsReq); + + __GLX_SWAP_INT(&req->screen); + return __glXDisp_GetVisualConfigs(cl, pc); +} + +int __glXDispSwap_GetFBConfigs(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXGetFBConfigsReq *req = (xGLXGetFBConfigsReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXGetFBConfigsReq); + + __GLX_SWAP_INT(&req->screen); + return __glXDisp_GetFBConfigs(cl, pc); +} + +int __glXDispSwap_GetFBConfigsSGIX(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXGetFBConfigsSGIXReq *req = (xGLXGetFBConfigsSGIXReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_AT_LEAST_SIZE(xGLXGetFBConfigsSGIXReq); + + __GLX_SWAP_INT(&req->screen); + return __glXDisp_GetFBConfigsSGIX(cl, pc); +} + +int __glXDispSwap_CreateGLXPixmap(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCreateGLXPixmapReq *req = (xGLXCreateGLXPixmapReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->screen); + __GLX_SWAP_INT(&req->visual); + __GLX_SWAP_INT(&req->pixmap); + __GLX_SWAP_INT(&req->glxpixmap); + + return __glXDisp_CreateGLXPixmap(cl, pc); +} + +int __glXDispSwap_CreatePixmap(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCreatePixmapReq *req = (xGLXCreatePixmapReq *) pc; + CARD32 *attribs; + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_DECLARE_SWAP_ARRAY_VARIABLES; + + REQUEST_AT_LEAST_SIZE(xGLXCreatePixmapReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->screen); + __GLX_SWAP_INT(&req->fbconfig); + __GLX_SWAP_INT(&req->pixmap); + __GLX_SWAP_INT(&req->glxpixmap); + __GLX_SWAP_INT(&req->numAttribs); + + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXCreatePixmapReq, req->numAttribs << 3); + attribs = (CARD32*)(req + 1); + __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); + + return __glXDisp_CreatePixmap(cl, pc); +} + +int __glXDispSwap_CreateGLXPixmapWithConfigSGIX(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCreateGLXPixmapWithConfigSGIXReq *req = + (xGLXCreateGLXPixmapWithConfigSGIXReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXCreateGLXPixmapWithConfigSGIXReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->screen); + __GLX_SWAP_INT(&req->fbconfig); + __GLX_SWAP_INT(&req->pixmap); + __GLX_SWAP_INT(&req->glxpixmap); + + return __glXDisp_CreateGLXPixmapWithConfigSGIX(cl, pc); +} + +int __glXDispSwap_DestroyGLXPixmap(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXDestroyGLXPixmapReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->glxpixmap); + + return __glXDisp_DestroyGLXPixmap(cl, pc); +} + +int __glXDispSwap_DestroyPixmap(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXDestroyGLXPixmapReq *req = (xGLXDestroyGLXPixmapReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_AT_LEAST_SIZE(xGLXDestroyGLXPixmapReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->glxpixmap); + + return __glXDisp_DestroyGLXPixmap(cl, pc); +} + +int __glXDispSwap_QueryContext(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXQueryContextReq *req = (xGLXQueryContextReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXQueryContextReq); + + __GLX_SWAP_INT(&req->context); + + return __glXDisp_QueryContext(cl, pc); +} + +int __glXDispSwap_CreatePbuffer(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCreatePbufferReq *req = (xGLXCreatePbufferReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_DECLARE_SWAP_ARRAY_VARIABLES; + CARD32 *attribs; + + REQUEST_AT_LEAST_SIZE(xGLXCreatePbufferReq); + + __GLX_SWAP_INT(&req->screen); + __GLX_SWAP_INT(&req->fbconfig); + __GLX_SWAP_INT(&req->pbuffer); + __GLX_SWAP_INT(&req->numAttribs); + + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXCreatePbufferReq, req->numAttribs << 3); + attribs = (CARD32*)(req + 1); + __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); + + return __glXDisp_CreatePbuffer(cl, pc); +} + +int __glXDispSwap_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCreateGLXPbufferSGIXReq *req = (xGLXCreateGLXPbufferSGIXReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_AT_LEAST_SIZE(xGLXCreateGLXPbufferSGIXReq); + + __GLX_SWAP_INT(&req->screen); + __GLX_SWAP_INT(&req->fbconfig); + __GLX_SWAP_INT(&req->pbuffer); + __GLX_SWAP_INT(&req->width); + __GLX_SWAP_INT(&req->height); + + return __glXDisp_CreateGLXPbufferSGIX(cl, pc); +} + +int __glXDispSwap_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXDestroyPbufferReq); + + __GLX_SWAP_INT(&req->pbuffer); + + return __glXDisp_DestroyPbuffer(cl, pc); +} + +int __glXDispSwap_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXDestroyGLXPbufferSGIXReq); + + __GLX_SWAP_INT(&req->pbuffer); + + return __glXDisp_DestroyGLXPbufferSGIX(cl, pc); +} + +int __glXDispSwap_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXChangeDrawableAttributesReq *req = + (xGLXChangeDrawableAttributesReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_DECLARE_SWAP_ARRAY_VARIABLES; + CARD32 *attribs; + + REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesReq); + + __GLX_SWAP_INT(&req->drawable); + __GLX_SWAP_INT(&req->numAttribs); + + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + if (((sizeof(xGLXChangeDrawableAttributesReq) + (req->numAttribs << 3)) >> 2) < client->req_len) + return BadLength; + + attribs = (CARD32*)(req + 1); + __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); + + return __glXDisp_ChangeDrawableAttributes(cl, pc); +} + +int __glXDispSwap_ChangeDrawableAttributesSGIX(__GLXclientState *cl, + GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXChangeDrawableAttributesSGIXReq *req = + (xGLXChangeDrawableAttributesSGIXReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_DECLARE_SWAP_ARRAY_VARIABLES; + CARD32 *attribs; + + REQUEST_AT_LEAST_SIZE(xGLXChangeDrawableAttributesSGIXReq); + + __GLX_SWAP_INT(&req->drawable); + __GLX_SWAP_INT(&req->numAttribs); + + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXChangeDrawableAttributesSGIXReq, req->numAttribs << 3); + attribs = (CARD32*)(req + 1); + __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); + + return __glXDisp_ChangeDrawableAttributesSGIX(cl, pc); +} + +int __glXDispSwap_CreateWindow(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXCreateWindowReq *req = (xGLXCreateWindowReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_DECLARE_SWAP_ARRAY_VARIABLES; + CARD32 *attribs; + + REQUEST_AT_LEAST_SIZE(xGLXCreateWindowReq); + + __GLX_SWAP_INT(&req->screen); + __GLX_SWAP_INT(&req->fbconfig); + __GLX_SWAP_INT(&req->window); + __GLX_SWAP_INT(&req->glxwindow); + __GLX_SWAP_INT(&req->numAttribs); + + if (req->numAttribs > (UINT32_MAX >> 3)) { + client->errorValue = req->numAttribs; + return BadValue; + } + REQUEST_FIXED_SIZE(xGLXCreateWindowReq, req->numAttribs << 3); + attribs = (CARD32*)(req + 1); + __GLX_SWAP_INT_ARRAY(attribs, req->numAttribs << 1); + + return __glXDisp_CreateWindow(cl, pc); +} + +int __glXDispSwap_DestroyWindow(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXDestroyWindowReq *req = (xGLXDestroyWindowReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_AT_LEAST_SIZE(xGLXDestroyWindowReq); + + __GLX_SWAP_INT(&req->glxwindow); + + return __glXDisp_DestroyWindow(cl, pc); +} + +int __glXDispSwap_SwapBuffers(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXSwapBuffersReq *req = (xGLXSwapBuffersReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXSwapBuffersReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->contextTag); + __GLX_SWAP_INT(&req->drawable); + + return __glXDisp_SwapBuffers(cl, pc); +} + +int __glXDispSwap_UseXFont(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXUseXFontReq *req = (xGLXUseXFontReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXUseXFontReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->contextTag); + __GLX_SWAP_INT(&req->font); + __GLX_SWAP_INT(&req->first); + __GLX_SWAP_INT(&req->count); + __GLX_SWAP_INT(&req->listBase); + + return __glXDisp_UseXFont(cl, pc); +} + + +int __glXDispSwap_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *)pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXQueryExtensionsStringReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->screen); + + return __glXDisp_QueryExtensionsString(cl, pc); +} + +int __glXDispSwap_QueryServerString(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *)pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXQueryServerStringReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->screen); + __GLX_SWAP_INT(&req->name); + + return __glXDisp_QueryServerString(cl, pc); +} + +int __glXDispSwap_ClientInfo(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXClientInfoReq *req = (xGLXClientInfoReq *)pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_AT_LEAST_SIZE(xGLXClientInfoReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->major); + __GLX_SWAP_INT(&req->minor); + __GLX_SWAP_INT(&req->numbytes); + + return __glXDisp_ClientInfo(cl, pc); +} + +int __glXDispSwap_QueryContextInfoEXT(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXQueryContextInfoEXTReq *req = (xGLXQueryContextInfoEXTReq *) pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXQueryContextInfoEXTReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->context); + + return __glXDisp_QueryContextInfoEXT(cl, pc); +} + +int __glXDispSwap_BindTexImageEXT(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; + GLXDrawable *drawId; + int *buffer; + CARD32 *num_attribs; + __GLX_DECLARE_SWAP_VARIABLES; + + if ((sizeof(xGLXVendorPrivateReq) + 12) >> 2 > client->req_len) + return BadLength; + + pc += __GLX_VENDPRIV_HDR_SIZE; + + drawId = ((GLXDrawable *) (pc)); + buffer = ((int *) (pc + 4)); + num_attribs = ((CARD32 *) (pc + 8)); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->contextTag); + __GLX_SWAP_INT(drawId); + __GLX_SWAP_INT(buffer); + __GLX_SWAP_INT(num_attribs); + + return __glXDisp_BindTexImageEXT(cl, (GLbyte *)pc); +} + +int __glXDispSwap_ReleaseTexImageEXT(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; + GLXDrawable *drawId; + int *buffer; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 8); + + pc += __GLX_VENDPRIV_HDR_SIZE; + + drawId = ((GLXDrawable *) (pc)); + buffer = ((int *) (pc + 4)); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->contextTag); + __GLX_SWAP_INT(drawId); + __GLX_SWAP_INT(buffer); + + return __glXDisp_ReleaseTexImageEXT(cl, (GLbyte *)pc); +} + +int __glXDispSwap_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXVendorPrivateReq *req = (xGLXVendorPrivateReq *) pc; + GLXDrawable *drawId; + int *buffer; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 20); + + (void) drawId; + (void) buffer; + + pc += __GLX_VENDPRIV_HDR_SIZE; + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->contextTag); + __GLX_SWAP_INT(pc); + __GLX_SWAP_INT(pc + 4); + __GLX_SWAP_INT(pc + 8); + __GLX_SWAP_INT(pc + 12); + __GLX_SWAP_INT(pc + 16); + + return __glXDisp_CopySubBufferMESA(cl, pc); + +} + +int __glXDispSwap_GetDrawableAttributesSGIX(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXVendorPrivateWithReplyReq *req = (xGLXVendorPrivateWithReplyReq *)pc; + CARD32 *data; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_SIZE_MATCH(xGLXGetDrawableAttributesSGIXReq); + + data = (CARD32 *) (req + 1); + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->contextTag); + __GLX_SWAP_INT(data); + + return __glXDisp_GetDrawableAttributesSGIX(cl, pc); +} + +int __glXDispSwap_GetDrawableAttributes(__GLXclientState *cl, GLbyte *pc) +{ + ClientPtr client = cl->client; + xGLXGetDrawableAttributesReq *req = (xGLXGetDrawableAttributesReq *)pc; + __GLX_DECLARE_SWAP_VARIABLES; + + REQUEST_AT_LEAST_SIZE(xGLXGetDrawableAttributesReq); + + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->drawable); + + return __glXDisp_GetDrawableAttributes(cl, pc); +} + + +/************************************************************************/ + +/* +** Swap replies. +*/ + +void __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply *reply) +{ + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_SWAP_SHORT(&reply->sequenceNumber); + __GLX_SWAP_INT(&reply->length); + __GLX_SWAP_INT(&reply->contextTag); + WriteToClient(client, sz_xGLXMakeCurrentReply, (char *)reply); +} + +void __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply *reply) +{ + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_SWAP_SHORT(&reply->sequenceNumber); + __GLX_SWAP_INT(&reply->length); + WriteToClient(client, sz_xGLXIsDirectReply, (char *)reply); +} + +void __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply *reply) +{ + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_SWAP_SHORT(&reply->sequenceNumber); + __GLX_SWAP_INT(&reply->length); + __GLX_SWAP_INT(&reply->majorVersion); + __GLX_SWAP_INT(&reply->minorVersion); + WriteToClient(client, sz_xGLXQueryVersionReply, (char *)reply); +} + +void glxSwapQueryExtensionsStringReply(ClientPtr client, + xGLXQueryExtensionsStringReply *reply, char *buf) +{ + int length = reply->length; + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_DECLARE_SWAP_ARRAY_VARIABLES; + __GLX_SWAP_SHORT(&reply->sequenceNumber); + __GLX_SWAP_INT(&reply->length); + __GLX_SWAP_INT(&reply->n); + WriteToClient(client, sz_xGLXQueryExtensionsStringReply, (char *)reply); + __GLX_SWAP_INT_ARRAY((int *)buf, length); + WriteToClient(client, length << 2, buf); +} + +void glxSwapQueryServerStringReply(ClientPtr client, + xGLXQueryServerStringReply *reply, char *buf) +{ + int length = reply->length; + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_SWAP_SHORT(&reply->sequenceNumber); + __GLX_SWAP_INT(&reply->length); + __GLX_SWAP_INT(&reply->n); + WriteToClient(client, sz_xGLXQueryServerStringReply, (char *)reply); + /** no swap is needed for an array of chars **/ + /* __GLX_SWAP_INT_ARRAY((int *)buf, length); */ + WriteToClient(client, length << 2, buf); +} + +void __glXSwapQueryContextInfoEXTReply(ClientPtr client, xGLXQueryContextInfoEXTReply *reply, int *buf) +{ + int length = reply->length; + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_DECLARE_SWAP_ARRAY_VARIABLES; + __GLX_SWAP_SHORT(&reply->sequenceNumber); + __GLX_SWAP_INT(&reply->length); + __GLX_SWAP_INT(&reply->n); + WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *)reply); + __GLX_SWAP_INT_ARRAY((int *)buf, length); + WriteToClient(client, length << 2, (char *)buf); +} + +void __glXSwapGetDrawableAttributesReply(ClientPtr client, + xGLXGetDrawableAttributesReply *reply, CARD32 *buf) +{ + int length = reply->length; + __GLX_DECLARE_SWAP_VARIABLES; + __GLX_DECLARE_SWAP_ARRAY_VARIABLES; + __GLX_SWAP_SHORT(&reply->sequenceNumber); + __GLX_SWAP_INT(&reply->length); + __GLX_SWAP_INT(&reply->numAttribs); + WriteToClient(client, sz_xGLXGetDrawableAttributesReply, (char *)reply); + __GLX_SWAP_INT_ARRAY((int *)buf, length); + WriteToClient(client, length << 2, (char *)buf); +} + +/************************************************************************/ + +/* +** Render and Renderlarge are not in the GLX API. They are used by the GLX +** client library to send batches of GL rendering commands. +*/ + +int __glXDispSwap_Render(__GLXclientState *cl, GLbyte *pc) +{ + return __glXDisp_Render(cl, pc); +} + +/* +** Execute a large rendering request (one that spans multiple X requests). +*/ +int __glXDispSwap_RenderLarge(__GLXclientState *cl, GLbyte *pc) +{ + return __glXDisp_RenderLarge(cl, pc); +} + +/************************************************************************/ + +/* +** No support is provided for the vendor-private requests other than +** allocating these entry points in the dispatch table. +*/ + +int __glXDispSwap_VendorPrivate(__GLXclientState *cl, GLbyte *pc) +{ + xGLXVendorPrivateReq *req; + GLint vendorcode; + __GLXdispatchVendorPrivProcPtr proc; + + __GLX_DECLARE_SWAP_VARIABLES; + + req = (xGLXVendorPrivateReq *) pc; + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->vendorCode); + + vendorcode = req->vendorCode; + + proc = (__GLXdispatchVendorPrivProcPtr) + __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info, + vendorcode, 1); + if (proc != NULL) { + (*proc)(cl, (GLbyte*)req); + return Success; + } + + cl->client->errorValue = req->vendorCode; + return __glXError(GLXUnsupportedPrivateRequest); +} + + +int __glXDispSwap_VendorPrivateWithReply(__GLXclientState *cl, GLbyte *pc) +{ + xGLXVendorPrivateWithReplyReq *req; + GLint vendorcode; + __GLXdispatchVendorPrivProcPtr proc; + + __GLX_DECLARE_SWAP_VARIABLES; + + req = (xGLXVendorPrivateWithReplyReq *) pc; + __GLX_SWAP_SHORT(&req->length); + __GLX_SWAP_INT(&req->vendorCode); + + vendorcode = req->vendorCode; + + proc = (__GLXdispatchVendorPrivProcPtr) + __glXGetProtocolDecodeFunction(& VendorPriv_dispatch_info, + vendorcode, 1); + if (proc != NULL) { + return (*proc)(cl, (GLbyte*)req); + } + + cl->client->errorValue = req->vendorCode; + return __glXError(GLXUnsupportedPrivateRequest); +} diff --git a/xorg-server/hw/xfree86/common/xf86Init.c b/xorg-server/hw/xfree86/common/xf86Init.c index a1fda54cd..e017d9dce 100644 --- a/xorg-server/hw/xfree86/common/xf86Init.c +++ b/xorg-server/hw/xfree86/common/xf86Init.c @@ -1,1497 +1,1497 @@ -/* - * Loosely based on code bearing the following copyright: - * - * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. - */ -/* - * Copyright (c) 1992-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 -#endif - -#include -#include - -#undef HAS_UTSNAME -#if !defined(WIN32) -#define HAS_UTSNAME 1 -#include -#endif - -#include -#include -#include -#include -#include "input.h" -#include "servermd.h" -#include "windowstr.h" -#include "scrnintstr.h" -#include "site.h" -#include "mi.h" - -#include "compiler.h" - -#include "loaderProcs.h" -#ifdef XFreeXDGA -#include "dgaproc.h" -#endif - -#define XF86_OS_PRIVS -#include "xf86.h" -#include "xf86Priv.h" -#include "xf86Config.h" -#include "xf86_OSlib.h" -#include "xf86cmap.h" -#include "xorgVersion.h" -#include "xf86Build.h" -#include "mipointer.h" -#include -#include -#include "xf86DDC.h" -#include "xf86Xinput.h" -#include "xf86InPriv.h" -#include "picturestr.h" - -#include "xf86Bus.h" -#include "xf86VGAarbiter.h" -#include "globals.h" - -#ifdef DPMSExtension -#include -#include "dpmsproc.h" -#endif -#include - - -#ifdef XF86PM -void (*xf86OSPMClose)(void) = NULL; -#endif -static Bool xorgHWOpenConsole = FALSE; - -/* Common pixmap formats */ - -static PixmapFormatRec formats[MAXFORMATS] = { - { 1, 1, BITMAP_SCANLINE_PAD }, - { 4, 8, BITMAP_SCANLINE_PAD }, - { 8, 8, BITMAP_SCANLINE_PAD }, - { 15, 16, BITMAP_SCANLINE_PAD }, - { 16, 16, BITMAP_SCANLINE_PAD }, - { 24, 32, BITMAP_SCANLINE_PAD }, - { 32, 32, BITMAP_SCANLINE_PAD }, -}; -static int numFormats = 7; -static Bool formatsDone = FALSE; - -#ifndef OSNAME -#define OSNAME " unknown" -#endif -#ifndef OSVENDOR -#define OSVENDOR "" -#endif -#ifndef PRE_RELEASE -#define PRE_RELEASE XORG_VERSION_SNAP -#endif - -static void -xf86PrintBanner(void) -{ -#if PRE_RELEASE - xf86ErrorFVerb(0, "\n" - "This is a pre-release version of the X server from " XVENDORNAME ".\n" - "It is not supported in any way.\n" - "Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.\n" - "Select the \"xorg\" product for bugs you find in this release.\n" - "Before reporting bugs in pre-release versions please check the\n" - "latest version in the X.Org Foundation git repository.\n" - "See http://wiki.x.org/wiki/GitPage for git access instructions.\n"); -#endif - xf86ErrorFVerb(0, "\nX.Org X Server %d.%d.%d", - XORG_VERSION_MAJOR, - XORG_VERSION_MINOR, - XORG_VERSION_PATCH); -#if XORG_VERSION_SNAP > 0 - xf86ErrorFVerb(0, ".%d", XORG_VERSION_SNAP); -#endif - -#if XORG_VERSION_SNAP >= 900 - /* When the minor number is 99, that signifies that the we are making - * a release candidate for a major version. (X.0.0) - * When the patch number is 99, that signifies that the we are making - * a release candidate for a minor version. (X.Y.0) - * When the patch number is < 99, then we are making a release - * candidate for the next point release. (X.Y.Z) - */ -#if XORG_VERSION_MINOR >= 99 - xf86ErrorFVerb(0, " (%d.0.0 RC %d)", XORG_VERSION_MAJOR+1, - XORG_VERSION_SNAP - 900); -#elif XORG_VERSION_PATCH == 99 - xf86ErrorFVerb(0, " (%d.%d.0 RC %d)", XORG_VERSION_MAJOR, - XORG_VERSION_MINOR + 1, XORG_VERSION_SNAP - 900); -#else - xf86ErrorFVerb(0, " (%d.%d.%d RC %d)", XORG_VERSION_MAJOR, - XORG_VERSION_MINOR, XORG_VERSION_PATCH + 1, - XORG_VERSION_SNAP - 900); -#endif -#endif - -#ifdef XORG_CUSTOM_VERSION - xf86ErrorFVerb(0, " (%s)", XORG_CUSTOM_VERSION); -#endif -#ifndef XORG_DATE -# define XORG_DATE "Unknown" -#endif - xf86ErrorFVerb(0, "\nRelease Date: %s\n", XORG_DATE); - xf86ErrorFVerb(0, "X Protocol Version %d, Revision %d\n", - X_PROTOCOL, X_PROTOCOL_REVISION); - xf86ErrorFVerb(0, "Build Operating System: %s %s\n", OSNAME, OSVENDOR); -#ifdef HAS_UTSNAME - { - struct utsname name; - - /* Linux & BSD state that 0 is success, SysV (including Solaris, HP-UX, - and Irix) and Single Unix Spec 3 just say that non-negative is success. - All agree that failure is represented by a negative number. - */ - if (uname(&name) >= 0) { - xf86ErrorFVerb(0, "Current Operating System: %s %s %s %s %s\n", - name.sysname, name.nodename, name.release, name.version, name.machine); -#ifdef linux - do { - char buf[80]; - int fd = open("/proc/cmdline", O_RDONLY); - if (fd != -1) { - xf86ErrorFVerb(0, "Kernel command line: "); - memset(buf, 0, 80); - while (read(fd, buf, 80) > 0) { - xf86ErrorFVerb(0, "%.80s", buf); - memset(buf, 0, 80); - } - close(fd); - } - } while (0); -#endif - } - } -#endif -#if defined(BUILD_DATE) && (BUILD_DATE > 19000000) - { - struct tm t; - char buf[100]; - - memset(&t, 0, sizeof(t)); - memset(buf, 0, sizeof(buf)); - t.tm_mday = BUILD_DATE % 100; - t.tm_mon = (BUILD_DATE / 100) % 100 - 1; - t.tm_year = BUILD_DATE / 10000 - 1900; -#if defined(BUILD_TIME) - t.tm_sec = BUILD_TIME % 100; - t.tm_min = (BUILD_TIME / 100) % 100; - t.tm_hour = (BUILD_TIME / 10000) % 100; - if (strftime(buf, sizeof(buf), "%d %B %Y %I:%M:%S%p", &t)) - xf86ErrorFVerb(0, "Build Date: %s\n", buf); -#else - if (strftime(buf, sizeof(buf), "%d %B %Y", &t)) - xf86ErrorFVerb(0, "Build Date: %s\n", buf); -#endif - } -#endif -#if defined(BUILDERSTRING) - xf86ErrorFVerb(0, "%s \n", BUILDERSTRING); -#endif - xf86ErrorFVerb(0, "Current version of pixman: %s\n", - pixman_version_string()); - xf86ErrorFVerb(0, "\tBefore reporting problems, check " - ""__VENDORDWEBSUPPORT__"\n" - "\tto make sure that you have the latest version.\n"); -} - -static void -xf86PrintMarkers(void) -{ - LogPrintMarkers(); -} - -static Bool -xf86CreateRootWindow(WindowPtr pWin) -{ - int ret = TRUE; - int err = Success; - ScreenPtr pScreen = pWin->drawable.pScreen; - RootWinPropPtr pProp; - CreateWindowProcPtr CreateWindow = (CreateWindowProcPtr) - dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey); - - DebugF("xf86CreateRootWindow(%p)\n", pWin); - - if ( pScreen->CreateWindow != xf86CreateRootWindow ) { - /* Can't find hook we are hung on */ - xf86DrvMsg(pScreen->myNum, X_WARNING /* X_ERROR */, - "xf86CreateRootWindow %p called when not in pScreen->CreateWindow %p n", - (void *)xf86CreateRootWindow, - (void *)pScreen->CreateWindow ); - } - - /* Unhook this function ... */ - pScreen->CreateWindow = CreateWindow; - dixSetPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey, NULL); - - /* ... and call the previous CreateWindow fuction, if any */ - if (NULL!=pScreen->CreateWindow) { - ret = (*pScreen->CreateWindow)(pWin); - } - - /* Now do our stuff */ - if (xf86RegisteredPropertiesTable != NULL) { - if (pWin->parent == NULL && xf86RegisteredPropertiesTable != NULL) { - for (pProp = xf86RegisteredPropertiesTable[pScreen->myNum]; - pProp != NULL && err==Success; - pProp = pProp->next ) - { - Atom prop; - - prop = MakeAtom(pProp->name, strlen(pProp->name), TRUE); - err = dixChangeWindowProperty(serverClient, pWin, - prop, pProp->type, - pProp->format, PropModeReplace, - pProp->size, pProp->data, - FALSE); - } - - /* Look at err */ - ret &= (err==Success); - - } else { - xf86Msg(X_ERROR, "xf86CreateRootWindow unexpectedly called with " - "non-root window %p (parent %p)\n", - (void *)pWin, (void *)pWin->parent); - ret = FALSE; - } - } - - DebugF("xf86CreateRootWindow() returns %d\n", ret); - return ret; -} - - -static void -InstallSignalHandlers(void) -{ - /* - * Install signal handler for unexpected signals - */ - xf86Info.caughtSignal=FALSE; - if (!xf86Info.notrapSignals) { - OsRegisterSigWrapper(xf86SigWrapper); - } else { - signal(SIGSEGV, SIG_DFL); - signal(SIGILL, SIG_DFL); -#ifdef SIGEMT - signal(SIGEMT, SIG_DFL); -#endif - signal(SIGFPE, SIG_DFL); - signal(SIGBUS, SIG_DFL); - signal(SIGSYS, SIG_DFL); - signal(SIGXCPU, SIG_DFL); - signal(SIGXFSZ, SIG_DFL); - } -} - -/* - * InitOutput -- - * Initialize screenInfo for all actually accessible framebuffers. - * That includes vt-manager setup, querying all possible devices and - * collecting the pixmap formats. - */ -void -InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) -{ - int i, j, k, scr_index, was_blocked = 0; - char **modulelist; - pointer *optionlist; - Pix24Flags screenpix24, pix24; - MessageType pix24From = X_DEFAULT; - Bool pix24Fail = FALSE; - Bool autoconfig = FALSE; - GDevPtr configured_device; - - xf86Initialising = TRUE; - - if (serverGeneration == 1) { - if ((xf86ServerName = strrchr(argv[0], '/')) != 0) - xf86ServerName++; - else - xf86ServerName = argv[0]; - - xf86PrintBanner(); - xf86PrintMarkers(); - if (xf86LogFile) { - time_t t; - const char *ct; - t = time(NULL); - ct = ctime(&t); - xf86MsgVerb(xf86LogFileFrom, 0, "Log file: \"%s\", Time: %s", - xf86LogFile, ct); - } - - /* Read and parse the config file */ - if (!xf86DoConfigure && !xf86DoShowOptions) { - switch (xf86HandleConfigFile(FALSE)) { - case CONFIG_OK: - break; - case CONFIG_PARSE_ERROR: - xf86Msg(X_ERROR, "Error parsing the config file\n"); - return; - case CONFIG_NOFILE: - autoconfig = TRUE; - break; - } - } - - InstallSignalHandlers(); - - /* Initialise the loader */ - LoaderInit(); - - /* Tell the loader the default module search path */ - LoaderSetPath(xf86ModulePath); - - if (xf86Info.ignoreABI) { - LoaderSetOptions(LDR_OPT_ABI_MISMATCH_NONFATAL); - } - - if (xf86DoShowOptions) - DoShowOptions(); - - /* Do a general bus probe. This will be a PCI probe for x86 platforms */ - xf86BusProbe(); - - if (xf86DoConfigure) - DoConfigure(); - - if (autoconfig) { - if (!xf86AutoConfig()) { - xf86Msg(X_ERROR, "Auto configuration failed\n"); - return; - } - } - -#ifdef XF86PM - xf86OSPMClose = xf86OSPMOpen(); -#endif - - /* Load all modules specified explicitly in the config file */ - if ((modulelist = xf86ModulelistFromConfig(&optionlist))) { - xf86LoadModules(modulelist, optionlist); - free(modulelist); - free(optionlist); - } - - /* Load all driver modules specified in the config file */ - /* If there aren't any specified in the config file, autoconfig them */ - /* FIXME: Does not handle multiple active screen sections, but I'm not - * sure if we really want to handle that case*/ - configured_device = xf86ConfigLayout.screens->screen->device; - if ((!configured_device) || (!configured_device->driver)) { - if (!autoConfigDevice(configured_device)) { - xf86Msg(X_ERROR, "Automatic driver configuration failed\n"); - return ; - } - } - if ((modulelist = xf86DriverlistFromConfig())) { - xf86LoadModules(modulelist, NULL); - free(modulelist); - } - - /* Load all input driver modules specified in the config file. */ - if ((modulelist = xf86InputDriverlistFromConfig())) { - xf86LoadModules(modulelist, NULL); - free(modulelist); - } - - /* - * It is expected that xf86AddDriver()/xf86AddInputDriver will be - * called for each driver as it is loaded. Those functions save the - * module pointers for drivers. - * XXX Nothing keeps track of them for other modules. - */ - /* XXX What do we do if not all of these could be loaded? */ - - /* - * At this point, xf86DriverList[] is all filled in with entries for - * each of the drivers to try and xf86NumDrivers has the number of - * drivers. If there are none, return now. - */ - - if (xf86NumDrivers == 0) { - xf86Msg(X_ERROR, "No drivers available.\n"); - return; - } - - /* - * Call each of the Identify functions and call the driverFunc to check - * if HW access is required. The Identify functions print out some - * identifying information, and anything else that might be - * needed at this early stage. - */ - - for (i = 0; i < xf86NumDrivers; i++) { - if (xf86DriverList[i]->Identify != NULL) - xf86DriverList[i]->Identify(0); - - if (!xorgHWAccess || !xorgHWOpenConsole) { - xorgHWFlags flags; - if(!xf86DriverList[i]->driverFunc - || !xf86DriverList[i]->driverFunc(NULL, - GET_REQUIRED_HW_INTERFACES, - &flags)) - flags = HW_IO; - - if(NEED_IO_ENABLED(flags)) - xorgHWAccess = TRUE; - if(!(flags & HW_SKIP_CONSOLE)) - xorgHWOpenConsole = TRUE; - } - } - - if (xorgHWOpenConsole) - xf86OpenConsole(); - else - xf86Info.dontVTSwitch = TRUE; - - if (xf86BusConfig() == FALSE) - return; - - xf86PostProbe(); - - /* - * Sort the drivers to match the requested ording. Using a slow - * bubble sort. - */ - for (j = 0; j < xf86NumScreens - 1; j++) { - for (i = 0; i < xf86NumScreens - j - 1; i++) { - if (xf86Screens[i + 1]->confScreen->screennum < - xf86Screens[i]->confScreen->screennum) { - ScrnInfoPtr tmpScrn = xf86Screens[i + 1]; - xf86Screens[i + 1] = xf86Screens[i]; - xf86Screens[i] = tmpScrn; - } - } - } - /* Fix up the indexes */ - for (i = 0; i < xf86NumScreens; i++) { - xf86Screens[i]->scrnIndex = i; - } - - /* - * Call the driver's PreInit()'s to complete initialisation for the first - * generation. - */ - - for (i = 0; i < xf86NumScreens; i++) { - xf86VGAarbiterScrnInit(xf86Screens[i]); - xf86VGAarbiterLock(xf86Screens[i]); - if (xf86Screens[i]->PreInit && - xf86Screens[i]->PreInit(xf86Screens[i], 0)) - xf86Screens[i]->configured = TRUE; - xf86VGAarbiterUnlock(xf86Screens[i]); - } - for (i = 0; i < xf86NumScreens; i++) - if (!xf86Screens[i]->configured) - xf86DeleteScreen(i--, 0); - - /* - * If no screens left, return now. - */ - - if (xf86NumScreens == 0) { - xf86Msg(X_ERROR, - "Screen(s) found, but none have a usable configuration.\n"); - return; - } - - for (i = 0; i < xf86NumScreens; i++) { - if (xf86Screens[i]->name == NULL) { - XNFasprintf(&xf86Screens[i]->name, "screen%d", i); - xf86MsgVerb(X_WARNING, 0, - "Screen driver %d has no name set, using `%s'.\n", - i, xf86Screens[i]->name); - } - } - - /* Remove (unload) drivers that are not required */ - for (i = 0; i < xf86NumDrivers; i++) - if (xf86DriverList[i] && xf86DriverList[i]->refCount <= 0) - xf86DeleteDriver(i); - - /* - * At this stage we know how many screens there are. - */ - - for (i = 0; i < xf86NumScreens; i++) - xf86InitViewport(xf86Screens[i]); - - /* - * Collect all pixmap formats and check for conflicts at the display - * level. Should we die here? Or just delete the offending screens? - */ - screenpix24 = Pix24DontCare; - for (i = 0; i < xf86NumScreens; i++) { - if (xf86Screens[i]->imageByteOrder != - xf86Screens[0]->imageByteOrder) - FatalError("Inconsistent display bitmapBitOrder. Exiting\n"); - if (xf86Screens[i]->bitmapScanlinePad != - xf86Screens[0]->bitmapScanlinePad) - FatalError("Inconsistent display bitmapScanlinePad. Exiting\n"); - if (xf86Screens[i]->bitmapScanlineUnit != - xf86Screens[0]->bitmapScanlineUnit) - FatalError("Inconsistent display bitmapScanlineUnit. Exiting\n"); - if (xf86Screens[i]->bitmapBitOrder != - xf86Screens[0]->bitmapBitOrder) - FatalError("Inconsistent display bitmapBitOrder. Exiting\n"); - - /* Determine the depth 24 pixmap format the screens would like */ - if (xf86Screens[i]->pixmap24 != Pix24DontCare) { - if (screenpix24 == Pix24DontCare) - screenpix24 = xf86Screens[i]->pixmap24; - else if (screenpix24 != xf86Screens[i]->pixmap24) - FatalError("Inconsistent depth 24 pixmap format. Exiting\n"); - } - } - /* check if screenpix24 is consistent with the config/cmdline */ - if (xf86Info.pixmap24 != Pix24DontCare) { - pix24 = xf86Info.pixmap24; - pix24From = xf86Info.pix24From; - if (screenpix24 != Pix24DontCare && screenpix24 != xf86Info.pixmap24) - pix24Fail = TRUE; - } else if (screenpix24 != Pix24DontCare) { - pix24 = screenpix24; - pix24From = X_PROBED; - } else - pix24 = Pix24Use32; - - if (pix24Fail) - FatalError("Screen(s) can't use the required depth 24 pixmap format" - " (%d). Exiting\n", PIX24TOBPP(pix24)); - - /* Initialise the depth 24 format */ - for (j = 0; j < numFormats && formats[j].depth != 24; j++) - ; - formats[j].bitsPerPixel = PIX24TOBPP(pix24); - - /* Collect additional formats */ - for (i = 0; i < xf86NumScreens; i++) { - for (j = 0; j < xf86Screens[i]->numFormats; j++) { - for (k = 0; ; k++) { - if (k >= numFormats) { - if (k >= MAXFORMATS) - FatalError("Too many pixmap formats! Exiting\n"); - formats[k] = xf86Screens[i]->formats[j]; - numFormats++; - break; - } - if (formats[k].depth == xf86Screens[i]->formats[j].depth) { - if ((formats[k].bitsPerPixel == - xf86Screens[i]->formats[j].bitsPerPixel) && - (formats[k].scanlinePad == - xf86Screens[i]->formats[j].scanlinePad)) - break; - FatalError("Inconsistent pixmap format for depth %d." - " Exiting\n", formats[k].depth); - } - } - } - } - formatsDone = TRUE; - - if (xf86Info.vtno >= 0 ) { -#define VT_ATOM_NAME "XFree86_VT" - Atom VTAtom=-1; - CARD32 *VT = NULL; - int ret; - - /* This memory needs to stay available until the screen has been - initialized, and we can create the property for real. - */ - if ( (VT = malloc(sizeof(CARD32)))==NULL ) { - FatalError("Unable to make VT property - out of memory. Exiting...\n"); - } - *VT = xf86Info.vtno; - - VTAtom = MakeAtom(VT_ATOM_NAME, sizeof(VT_ATOM_NAME) - 1, TRUE); - - for (i = 0, ret = Success; i < xf86NumScreens && ret == Success; i++) { - ret = xf86RegisterRootWindowProperty(xf86Screens[i]->scrnIndex, - VTAtom, XA_INTEGER, 32, - 1, VT ); - if (ret != Success) - xf86DrvMsg(xf86Screens[i]->scrnIndex, X_WARNING, - "Failed to register VT property\n"); - } - } - - /* If a screen uses depth 24, show what the pixmap format is */ - for (i = 0; i < xf86NumScreens; i++) { - if (xf86Screens[i]->depth == 24) { - xf86Msg(pix24From, "Depth 24 pixmap format is %d bpp\n", - PIX24TOBPP(pix24)); - break; - } - } - } else { - /* - * serverGeneration != 1; some OSs have to do things here, too. - */ - if (xorgHWOpenConsole) - xf86OpenConsole(); - -#ifdef XF86PM - /* - should we reopen it here? We need to deal with an already opened - device. We could leave this to the OS layer. For now we simply - close it here - */ - if (xf86OSPMClose) - xf86OSPMClose(); - if ((xf86OSPMClose = xf86OSPMOpen()) != NULL) - xf86MsgVerb(X_INFO, 3, "APM registered successfully\n"); -#endif - - /* Make sure full I/O access is enabled */ - if (xorgHWAccess) - xf86EnableIO(); - } - - /* - * Use the previously collected parts to setup pScreenInfo - */ - - pScreenInfo->imageByteOrder = xf86Screens[0]->imageByteOrder; - pScreenInfo->bitmapScanlinePad = xf86Screens[0]->bitmapScanlinePad; - pScreenInfo->bitmapScanlineUnit = xf86Screens[0]->bitmapScanlineUnit; - pScreenInfo->bitmapBitOrder = xf86Screens[0]->bitmapBitOrder; - pScreenInfo->numPixmapFormats = numFormats; - for (i = 0; i < numFormats; i++) - pScreenInfo->formats[i] = formats[i]; - - /* Make sure the server's VT is active */ - - if (serverGeneration != 1) { - xf86Resetting = TRUE; - /* All screens are in the same state, so just check the first */ - if (!xf86Screens[0]->vtSema) { -#ifdef HAS_USL_VTS - ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ); -#endif - xf86AccessEnter(); - was_blocked = xf86BlockSIGIO(); - } - } - - for (i = 0; i < xf86NumScreens; i++) - if (!xf86ColormapAllocatePrivates(xf86Screens[i])) - FatalError("Cannot register DDX private keys"); - - if (!dixRegisterPrivateKey(&xf86ScreenKeyRec, PRIVATE_SCREEN, 0) || - !dixRegisterPrivateKey(&xf86CreateRootWindowKeyRec, PRIVATE_SCREEN, 0)) - FatalError("Cannot register DDX private keys"); - - for (i = 0; i < xf86NumScreens; i++) { - xf86VGAarbiterLock(xf86Screens[i]); - /* - * Almost everything uses these defaults, and many of those that - * don't, will wrap them. - */ - xf86Screens[i]->EnableDisableFBAccess = xf86EnableDisableFBAccess; -#ifdef XFreeXDGA - xf86Screens[i]->SetDGAMode = xf86SetDGAMode; -#endif - xf86Screens[i]->DPMSSet = NULL; - xf86Screens[i]->LoadPalette = NULL; - xf86Screens[i]->SetOverscan = NULL; - xf86Screens[i]->DriverFunc = NULL; - xf86Screens[i]->pScreen = NULL; - scr_index = AddScreen(xf86Screens[i]->ScreenInit, argc, argv); - xf86VGAarbiterUnlock(xf86Screens[i]); - if (scr_index == i) { - /* - * Hook in our ScrnInfoRec, and initialise some other pScreen - * fields. - */ - dixSetPrivate(&screenInfo.screens[scr_index]->devPrivates, - xf86ScreenKey, xf86Screens[i]); - xf86Screens[i]->pScreen = screenInfo.screens[scr_index]; - /* The driver should set this, but make sure it is set anyway */ - xf86Screens[i]->vtSema = TRUE; - } else { - /* This shouldn't normally happen */ - FatalError("AddScreen/ScreenInit failed for driver %d\n", i); - } - - DebugF("InitOutput - xf86Screens[%d]->pScreen = %p\n", - i, xf86Screens[i]->pScreen ); - DebugF("xf86Screens[%d]->pScreen->CreateWindow = %p\n", - i, xf86Screens[i]->pScreen->CreateWindow ); - - dixSetPrivate(&screenInfo.screens[scr_index]->devPrivates, - xf86CreateRootWindowKey, - xf86Screens[i]->pScreen->CreateWindow); - xf86Screens[i]->pScreen->CreateWindow = xf86CreateRootWindow; - - if (PictureGetSubpixelOrder (xf86Screens[i]->pScreen) == SubPixelUnknown) - { - xf86MonPtr DDC = (xf86MonPtr)(xf86Screens[i]->monitor->DDC); - PictureSetSubpixelOrder (xf86Screens[i]->pScreen, - DDC ? - (DDC->features.input_type ? - SubPixelHorizontalRGB : SubPixelNone) : - SubPixelUnknown); - } -#ifdef RANDR - if (!xf86Info.disableRandR) - xf86RandRInit (screenInfo.screens[scr_index]); - xf86Msg(xf86Info.randRFrom, "RandR %s\n", - xf86Info.disableRandR ? "disabled" : "enabled"); -#endif - } - - xf86VGAarbiterWrapFunctions(); - xf86UnblockSIGIO(was_blocked); - - xf86InitOrigins(); - - xf86Resetting = FALSE; - xf86Initialising = FALSE; - - RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, xf86Wakeup, - NULL); -} - -/* - * InitInput -- - * Initialize all supported input devices. - */ - -void -InitInput(int argc, char **argv) -{ - InputInfoPtr* pDev; - DeviceIntPtr dev; - - xf86Info.vtRequestsPending = FALSE; - - mieqInit(); - - GetEventList(&xf86Events); - - /* Call the PreInit function for each input device instance. */ - for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) { - /* Replace obsolete keyboard driver with kbd */ - if (!xf86NameCmp((*pDev)->driver, "keyboard")) { - strcpy((*pDev)->driver, "kbd"); - } - - /* If one fails, the others will too */ - if (xf86NewInputDevice(*pDev, &dev, TRUE) == BadAlloc) - break; - } - - config_init(); -} - -void -CloseInput (void) -{ - config_fini(); -} - -/* - * OsVendorInit -- - * OS/Vendor-specific initialisations. Called from OsInit(), which - * is called by dix before establishing the well known sockets. - */ - -void -OsVendorInit(void) -{ - static Bool beenHere = FALSE; - - signal(SIGCHLD, SIG_DFL); /* Need to wait for child processes */ - - if (!beenHere) { - umask(022); - xf86LogInit(); - } - - /* Set stderr to non-blocking. */ -#ifndef O_NONBLOCK -#if defined(FNDELAY) -#define O_NONBLOCK FNDELAY -#elif defined(O_NDELAY) -#define O_NONBLOCK O_NDELAY -#endif - -#ifdef O_NONBLOCK - if (!beenHere) { - if (geteuid() == 0 && getuid() != geteuid()) - { - int status; - - status = fcntl(fileno(stderr), F_GETFL, 0); - if (status != -1) { - fcntl(fileno(stderr), F_SETFL, status | O_NONBLOCK); - } - } - } -#endif -#endif - - beenHere = TRUE; -} - -/* - * ddxGiveUp -- - * Device dependent cleanup. Called by by dix before normal server death. - * For SYSV386 we must switch the terminal back to normal mode. No error- - * checking here, since there should be restored as much as possible. - */ - -void -ddxGiveUp(void) -{ - int i; - - xf86VGAarbiterFini(); - -#ifdef XF86PM - if (xf86OSPMClose) - xf86OSPMClose(); - xf86OSPMClose = NULL; -#endif - - for (i = 0; i < xf86NumScreens; i++) { - /* - * zero all access functions to - * trap calls when switched away. - */ - xf86Screens[i]->vtSema = FALSE; - } - -#ifdef XFreeXDGA - DGAShutdown(); -#endif - - if (xorgHWOpenConsole) - xf86CloseConsole(); - - xf86CloseLog(); - - /* If an unexpected signal was caught, dump a core for debugging */ - if (xf86Info.caughtSignal) - OsAbort(); -} - - - -/* - * AbortDDX -- - * DDX - specific abort routine. Called by AbortServer(). The attempt is - * made to restore all original setting of the displays. Also all devices - * are closed. - */ - -void -AbortDDX(void) -{ - int i; - - xf86BlockSIGIO(); - - /* - * try to restore the original video state - */ -#ifdef DPMSExtension /* Turn screens back on */ - if (DPMSPowerLevel != DPMSModeOn) - DPMSSet(serverClient, DPMSModeOn); -#endif - if (xf86Screens) { - for (i = 0; i < xf86NumScreens; i++) - if (xf86Screens[i]->vtSema) { - /* - * if we are aborting before ScreenInit() has finished - * we might not have been wrapped yet. Therefore enable - * screen explicitely. - */ - xf86VGAarbiterLock(xf86Screens[i]); - (xf86Screens[i]->LeaveVT)(i, 0); - xf86VGAarbiterUnlock(xf86Screens[i]); - } - } - - xf86AccessLeave(); - - /* - * This is needed for an abnormal server exit, since the normal exit stuff - * MUST also be performed (i.e. the vt must be left in a defined state) - */ - ddxGiveUp(); -} - -void -OsVendorFatalError(void) -{ -#ifdef VENDORSUPPORT - ErrorF("\nPlease refer to your Operating System Vendor support pages\n" - "at %s for support on this crash.\n",VENDORSUPPORT); -#else - ErrorF("\nPlease consult the "XVENDORNAME" support \n" - "\t at "__VENDORDWEBSUPPORT__"\n for help. \n"); -#endif - if (xf86LogFile && xf86LogFileWasOpened) - ErrorF("Please also check the log file at \"%s\" for additional " - "information.\n", xf86LogFile); - ErrorF("\n"); -} - -int -xf86SetVerbosity(int verb) -{ - int save = xf86Verbose; - - xf86Verbose = verb; - LogSetParameter(XLOG_VERBOSITY, verb); - return save; -} - -int -xf86SetLogVerbosity(int verb) -{ - int save = xf86LogVerbose; - - xf86LogVerbose = verb; - LogSetParameter(XLOG_FILE_VERBOSITY, verb); - return save; -} - -static void -xf86PrintDefaultModulePath(void) -{ - ErrorF("%s\n", DEFAULT_MODULE_PATH); -} - -static void -xf86PrintDefaultLibraryPath(void) -{ - ErrorF("%s\n", DEFAULT_LIBRARY_PATH); -} - -/* - * ddxProcessArgument -- - * Process device-dependent command line args. Returns 0 if argument is - * not device dependent, otherwise Count of number of elements of argv - * that are part of a device dependent commandline option. - * - */ - -/* ARGSUSED */ -int -ddxProcessArgument(int argc, char **argv, int i) -{ -#define CHECK_FOR_REQUIRED_ARGUMENT() \ - if (((i + 1) >= argc) || (!argv[i + 1])) { \ - ErrorF("Required argument to %s not specified\n", argv[i]); \ - UseMsg(); \ - FatalError("Required argument to %s not specified\n", argv[i]); \ - } - - /* First the options that are only allowed for root */ - if (!strcmp(argv[i], "-modulepath") || !strcmp(argv[i], "-logfile")) { - if ( (geteuid() == 0) && (getuid() != 0) ) { - FatalError("The '%s' option can only be used by root.\n", argv[i]); - } - else if (!strcmp(argv[i], "-modulepath")) - { - char *mp; - CHECK_FOR_REQUIRED_ARGUMENT(); - mp = strdup(argv[i + 1]); - if (!mp) - FatalError("Can't allocate memory for ModulePath\n"); - xf86ModulePath = mp; - xf86ModPathFrom = X_CMDLINE; - return 2; - } - else if (!strcmp(argv[i], "-logfile")) - { - char *lf; - CHECK_FOR_REQUIRED_ARGUMENT(); - lf = strdup(argv[i + 1]); - if (!lf) - FatalError("Can't allocate memory for LogFile\n"); - xf86LogFile = lf; - xf86LogFileFrom = X_CMDLINE; - return 2; - } - } - if (!strcmp(argv[i], "-config") || !strcmp(argv[i], "-xf86config")) - { - CHECK_FOR_REQUIRED_ARGUMENT(); - if (getuid() != 0 && !xf86PathIsSafe(argv[i + 1])) { - FatalError("\nInvalid argument for %s\n" - "\tFor non-root users, the file specified with %s must be\n" - "\ta relative path and must not contain any \"..\" elements.\n" - "\tUsing default "__XCONFIGFILE__" search path.\n\n", - argv[i], argv[i]); - } - xf86ConfigFile = argv[i + 1]; - return 2; - } - if (!strcmp(argv[i], "-configdir")) - { - CHECK_FOR_REQUIRED_ARGUMENT(); - if (getuid() != 0 && !xf86PathIsSafe(argv[i + 1])) { - FatalError("\nInvalid argument for %s\n" - "\tFor non-root users, the file specified with %s must be\n" - "\ta relative path and must not contain any \"..\" elements.\n" - "\tUsing default "__XCONFIGDIR__" search path.\n\n", - argv[i], argv[i]); - } - xf86ConfigDir = argv[i + 1]; - return 2; - } - if (!strcmp(argv[i],"-flipPixels")) - { - xf86FlipPixels = TRUE; - return 1; - } -#ifdef XF86VIDMODE - if (!strcmp(argv[i],"-disableVidMode")) - { - xf86VidModeDisabled = TRUE; - return 1; - } - if (!strcmp(argv[i],"-allowNonLocalXvidtune")) - { - xf86VidModeAllowNonLocal = TRUE; - return 1; - } -#endif - if (!strcmp(argv[i],"-allowMouseOpenFail")) - { - xf86AllowMouseOpenFail = TRUE; - return 1; - } - if (!strcmp(argv[i],"-ignoreABI")) - { - LoaderSetOptions(LDR_OPT_ABI_MISMATCH_NONFATAL); - return 1; - } - if (!strcmp(argv[i],"-verbose")) - { - if (++i < argc && argv[i]) - { - char *end; - long val; - val = strtol(argv[i], &end, 0); - if (*end == '\0') - { - xf86SetVerbosity(val); - return 2; - } - } - xf86SetVerbosity(++xf86Verbose); - return 1; - } - if (!strcmp(argv[i],"-logverbose")) - { - if (++i < argc && argv[i]) - { - char *end; - long val; - val = strtol(argv[i], &end, 0); - if (*end == '\0') - { - xf86SetLogVerbosity(val); - return 2; - } - } - xf86SetLogVerbosity(++xf86LogVerbose); - return 1; - } - if (!strcmp(argv[i],"-quiet")) - { - xf86SetVerbosity(-1); - return 1; - } - if (!strcmp(argv[i],"-showconfig") || !strcmp(argv[i],"-version")) - { - xf86PrintBanner(); - exit(0); - } - if (!strcmp(argv[i],"-showDefaultModulePath")) - { - xf86PrintDefaultModulePath(); - exit(0); - } - if (!strcmp(argv[i],"-showDefaultLibPath")) - { - xf86PrintDefaultLibraryPath(); - exit(0); - } - /* Notice the -fp flag, but allow it to pass to the dix layer */ - if (!strcmp(argv[i], "-fp")) - { - xf86fpFlag = TRUE; - return 0; - } - /* Notice the -bs flag, but allow it to pass to the dix layer */ - if (!strcmp(argv[i], "-bs")) - { - xf86bsDisableFlag = TRUE; - return 0; - } - /* Notice the +bs flag, but allow it to pass to the dix layer */ - if (!strcmp(argv[i], "+bs")) - { - xf86bsEnableFlag = TRUE; - return 0; - } - /* Notice the -s flag, but allow it to pass to the dix layer */ - if (!strcmp(argv[i], "-s")) - { - xf86sFlag = TRUE; - return 0; - } - if (!strcmp(argv[i], "-pixmap24")) - { - xf86Pix24 = Pix24Use24; - return 1; - } - if (!strcmp(argv[i], "-pixmap32")) - { - xf86Pix24 = Pix24Use32; - return 1; - } - if (!strcmp(argv[i], "-fbbpp")) - { - int bpp; - CHECK_FOR_REQUIRED_ARGUMENT(); - if (sscanf(argv[++i], "%d", &bpp) == 1) - { - xf86FbBpp = bpp; - return 2; - } - else - { - ErrorF("Invalid fbbpp\n"); - return 0; - } - } - if (!strcmp(argv[i], "-depth")) - { - int depth; - CHECK_FOR_REQUIRED_ARGUMENT(); - if (sscanf(argv[++i], "%d", &depth) == 1) - { - xf86Depth = depth; - return 2; - } - else - { - ErrorF("Invalid depth\n"); - return 0; - } - } - if (!strcmp(argv[i], "-weight")) - { - int red, green, blue; - CHECK_FOR_REQUIRED_ARGUMENT(); - if (sscanf(argv[++i], "%1d%1d%1d", &red, &green, &blue) == 3) - { - xf86Weight.red = red; - xf86Weight.green = green; - xf86Weight.blue = blue; - return 2; - } - else - { - ErrorF("Invalid weighting\n"); - return 0; - } - } - if (!strcmp(argv[i], "-gamma") || !strcmp(argv[i], "-rgamma") || - !strcmp(argv[i], "-ggamma") || !strcmp(argv[i], "-bgamma")) - { - double gamma; - CHECK_FOR_REQUIRED_ARGUMENT(); - if (sscanf(argv[++i], "%lf", &gamma) == 1) { - if (gamma < GAMMA_MIN || gamma > GAMMA_MAX) { - ErrorF("gamma out of range, only %.2f <= gamma_value <= %.1f" - " is valid\n", GAMMA_MIN, GAMMA_MAX); - return 0; - } - if (!strcmp(argv[i-1], "-gamma")) - xf86Gamma.red = xf86Gamma.green = xf86Gamma.blue = gamma; - else if (!strcmp(argv[i-1], "-rgamma")) xf86Gamma.red = gamma; - else if (!strcmp(argv[i-1], "-ggamma")) xf86Gamma.green = gamma; - else if (!strcmp(argv[i-1], "-bgamma")) xf86Gamma.blue = gamma; - return 2; - } - } - if (!strcmp(argv[i], "-layout")) - { - CHECK_FOR_REQUIRED_ARGUMENT(); - xf86LayoutName = argv[++i]; - return 2; - } - if (!strcmp(argv[i], "-screen")) - { - CHECK_FOR_REQUIRED_ARGUMENT(); - xf86ScreenName = argv[++i]; - return 2; - } - if (!strcmp(argv[i], "-pointer")) - { - CHECK_FOR_REQUIRED_ARGUMENT(); - xf86PointerName = argv[++i]; - return 2; - } - if (!strcmp(argv[i], "-keyboard")) - { - CHECK_FOR_REQUIRED_ARGUMENT(); - xf86KeyboardName = argv[++i]; - return 2; - } - if (!strcmp(argv[i], "-nosilk")) - { - xf86silkenMouseDisableFlag = TRUE; - return 1; - } -#ifdef HAVE_ACPI - if (!strcmp(argv[i], "-noacpi")) - { - xf86acpiDisableFlag = TRUE; - return 1; - } -#endif - if (!strcmp(argv[i], "-configure")) - { - if (getuid() != 0 && geteuid() == 0) { - ErrorF("The '-configure' option can only be used by root.\n"); - exit(1); - } - xf86DoConfigure = TRUE; - xf86AllowMouseOpenFail = TRUE; - return 1; - } - if (!strcmp(argv[i], "-showopts")) - { - if (getuid() != 0 && geteuid() == 0) { - ErrorF("The '-showopts' option can only be used by root.\n"); - exit(1); - } - xf86DoShowOptions = TRUE; - return 1; - } - if (!strcmp(argv[i], "-isolateDevice")) - { - CHECK_FOR_REQUIRED_ARGUMENT(); - if (strncmp(argv[++i], "PCI:", 4)) { - FatalError("Bus types other than PCI not yet isolable\n"); - } - xf86PciIsolateDevice(argv[i]); - return 2; - } - /* Notice cmdline xkbdir, but pass to dix as well */ - if (!strcmp(argv[i], "-xkbdir")) - { - xf86xkbdirFlag = TRUE; - return 0; - } - - /* OS-specific processing */ - return xf86ProcessArgument(argc, argv, i); -} - -/* - * ddxUseMsg -- - * Print out correct use of device dependent commandline options. - * Maybe the user now knows what really to do ... - */ - -void -ddxUseMsg(void) -{ - ErrorF("\n"); - ErrorF("\n"); - ErrorF("Device Dependent Usage\n"); - if (getuid() == 0 || geteuid() != 0) - { - ErrorF("-modulepath paths specify the module search path\n"); - ErrorF("-logfile file specify a log file name\n"); - ErrorF("-configure probe for devices and write an "__XCONFIGFILE__"\n"); - ErrorF("-showopts print available options for all installed drivers\n"); - } - ErrorF("-config file specify a configuration file, relative to the\n"); - ErrorF(" "__XCONFIGFILE__" search path, only root can use absolute\n"); - ErrorF("-configdir dir specify a configuration directory, relative to the\n"); - ErrorF(" "__XCONFIGDIR__" search path, only root can use absolute\n"); - ErrorF("-verbose [n] verbose startup messages\n"); - ErrorF("-logverbose [n] verbose log messages\n"); - ErrorF("-quiet minimal startup messages\n"); - ErrorF("-pixmap24 use 24bpp pixmaps for depth 24\n"); - ErrorF("-pixmap32 use 32bpp pixmaps for depth 24\n"); - ErrorF("-fbbpp n set bpp for the framebuffer. Default: 8\n"); - ErrorF("-depth n set colour depth. Default: 8\n"); - ErrorF("-gamma f set gamma value (0.1 < f < 10.0) Default: 1.0\n"); - ErrorF("-rgamma f set gamma value for red phase\n"); - ErrorF("-ggamma f set gamma value for green phase\n"); - ErrorF("-bgamma f set gamma value for blue phase\n"); - ErrorF("-weight nnn set RGB weighting at 16 bpp. Default: 565\n"); - ErrorF("-layout name specify the ServerLayout section name\n"); - ErrorF("-screen name specify the Screen section name\n"); - ErrorF("-keyboard name specify the core keyboard InputDevice name\n"); - ErrorF("-pointer name specify the core pointer InputDevice name\n"); - ErrorF("-nosilk disable Silken Mouse\n"); - ErrorF("-flipPixels swap default black/white Pixel values\n"); -#ifdef XF86VIDMODE - ErrorF("-disableVidMode disable mode adjustments with xvidtune\n"); - ErrorF("-allowNonLocalXvidtune allow xvidtune to be run as a non-local client\n"); -#endif - ErrorF("-allowMouseOpenFail start server even if the mouse can't be initialized\n"); - ErrorF("-ignoreABI make module ABI mismatches non-fatal\n"); - ErrorF("-isolateDevice bus_id restrict device resets to bus_id (PCI only)\n"); - 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"); - /* OS-specific usage */ - xf86UseMsg(); - ErrorF("\n"); -} - - -/* - * xf86LoadModules iterates over a list that is being passed in. - */ -Bool -xf86LoadModules(char **list, pointer *optlist) -{ - int errmaj, errmin; - pointer opt; - int i; - char *name; - Bool failed = FALSE; - - if (!list) - return TRUE; - - for (i = 0; list[i] != NULL; i++) { - - /* Normalise the module name */ - name = xf86NormalizeName(list[i]); - - /* Skip empty names */ - if (name == NULL || *name == '\0') - continue; - - /* Replace obsolete keyboard driver with kbd */ - if (!xf86NameCmp(name, "keyboard")) { - strcpy(name, "kbd"); - } - - if (optlist) - opt = optlist[i]; - else - opt = NULL; - - if (!LoadModule(name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin)) { - LoaderErrorMsg(NULL, name, errmaj, errmin); - failed = TRUE; - } - free(name); - } - return !failed; -} - -/* Pixmap format stuff */ - -PixmapFormatPtr -xf86GetPixFormat(ScrnInfoPtr pScrn, int depth) -{ - int i; - static PixmapFormatRec format; /* XXX not reentrant */ - - /* - * When the formats[] list initialisation isn't complete, check the - * depth 24 pixmap config/cmdline options and screen-specified formats. - */ - - if (!formatsDone) { - if (depth == 24) { - Pix24Flags pix24 = Pix24DontCare; - - format.depth = 24; - format.scanlinePad = BITMAP_SCANLINE_PAD; - if (xf86Info.pixmap24 != Pix24DontCare) - pix24 = xf86Info.pixmap24; - else if (pScrn->pixmap24 != Pix24DontCare) - pix24 = pScrn->pixmap24; - if (pix24 == Pix24Use24) - format.bitsPerPixel = 24; - else - format.bitsPerPixel = 32; - return &format; - } - } - - for (i = 0; i < numFormats; i++) - if (formats[i].depth == depth) - break; - if (i != numFormats) - return &formats[i]; - else if (!formatsDone) { - /* Check for screen-specified formats */ - for (i = 0; i < pScrn->numFormats; i++) - if (pScrn->formats[i].depth == depth) - break; - if (i != pScrn->numFormats) - return &pScrn->formats[i]; - } - return NULL; -} - -int -xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth) -{ - PixmapFormatPtr format; - - - format = xf86GetPixFormat(pScrn, depth); - if (format) - return format->bitsPerPixel; - else - return 0; -} +/* + * Loosely based on code bearing the following copyright: + * + * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany. + */ +/* + * Copyright (c) 1992-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 +#endif + +#include +#include + +#undef HAS_UTSNAME +#if !defined(WIN32) +#define HAS_UTSNAME 1 +#include +#endif + +#include +#include +#include +#include +#include "input.h" +#include "servermd.h" +#include "windowstr.h" +#include "scrnintstr.h" +#include "site.h" +#include "mi.h" + +#include "compiler.h" + +#include "loaderProcs.h" +#ifdef XFreeXDGA +#include "dgaproc.h" +#endif + +#define XF86_OS_PRIVS +#include "xf86.h" +#include "xf86Priv.h" +#include "xf86Config.h" +#include "xf86_OSlib.h" +#include "xf86cmap.h" +#include "xorgVersion.h" +#include "xf86Build.h" +#include "mipointer.h" +#include +#include +#include "xf86DDC.h" +#include "xf86Xinput.h" +#include "xf86InPriv.h" +#include "picturestr.h" + +#include "xf86Bus.h" +#include "xf86VGAarbiter.h" +#include "globals.h" + +#ifdef DPMSExtension +#include +#include "dpmsproc.h" +#endif +#include + + +#ifdef XF86PM +void (*xf86OSPMClose)(void) = NULL; +#endif +static Bool xorgHWOpenConsole = FALSE; + +/* Common pixmap formats */ + +static PixmapFormatRec formats[MAXFORMATS] = { + { 1, 1, BITMAP_SCANLINE_PAD }, + { 4, 8, BITMAP_SCANLINE_PAD }, + { 8, 8, BITMAP_SCANLINE_PAD }, + { 15, 16, BITMAP_SCANLINE_PAD }, + { 16, 16, BITMAP_SCANLINE_PAD }, + { 24, 32, BITMAP_SCANLINE_PAD }, + { 32, 32, BITMAP_SCANLINE_PAD }, +}; +static int numFormats = 7; +static Bool formatsDone = FALSE; + +#ifndef OSNAME +#define OSNAME " unknown" +#endif +#ifndef OSVENDOR +#define OSVENDOR "" +#endif +#ifndef PRE_RELEASE +#define PRE_RELEASE XORG_VERSION_SNAP +#endif + +static void +xf86PrintBanner(void) +{ +#if PRE_RELEASE + xf86ErrorFVerb(0, "\n" + "This is a pre-release version of the X server from " XVENDORNAME ".\n" + "It is not supported in any way.\n" + "Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.\n" + "Select the \"xorg\" product for bugs you find in this release.\n" + "Before reporting bugs in pre-release versions please check the\n" + "latest version in the X.Org Foundation git repository.\n" + "See http://wiki.x.org/wiki/GitPage for git access instructions.\n"); +#endif + xf86ErrorFVerb(0, "\nX.Org X Server %d.%d.%d", + XORG_VERSION_MAJOR, + XORG_VERSION_MINOR, + XORG_VERSION_PATCH); +#if XORG_VERSION_SNAP > 0 + xf86ErrorFVerb(0, ".%d", XORG_VERSION_SNAP); +#endif + +#if XORG_VERSION_SNAP >= 900 + /* When the minor number is 99, that signifies that the we are making + * a release candidate for a major version. (X.0.0) + * When the patch number is 99, that signifies that the we are making + * a release candidate for a minor version. (X.Y.0) + * When the patch number is < 99, then we are making a release + * candidate for the next point release. (X.Y.Z) + */ +#if XORG_VERSION_MINOR >= 99 + xf86ErrorFVerb(0, " (%d.0.0 RC %d)", XORG_VERSION_MAJOR+1, + XORG_VERSION_SNAP - 900); +#elif XORG_VERSION_PATCH == 99 + xf86ErrorFVerb(0, " (%d.%d.0 RC %d)", XORG_VERSION_MAJOR, + XORG_VERSION_MINOR + 1, XORG_VERSION_SNAP - 900); +#else + xf86ErrorFVerb(0, " (%d.%d.%d RC %d)", XORG_VERSION_MAJOR, + XORG_VERSION_MINOR, XORG_VERSION_PATCH + 1, + XORG_VERSION_SNAP - 900); +#endif +#endif + +#ifdef XORG_CUSTOM_VERSION + xf86ErrorFVerb(0, " (%s)", XORG_CUSTOM_VERSION); +#endif +#ifndef XORG_DATE +# define XORG_DATE "Unknown" +#endif + xf86ErrorFVerb(0, "\nRelease Date: %s\n", XORG_DATE); + xf86ErrorFVerb(0, "X Protocol Version %d, Revision %d\n", + X_PROTOCOL, X_PROTOCOL_REVISION); + xf86ErrorFVerb(0, "Build Operating System: %s %s\n", OSNAME, OSVENDOR); +#ifdef HAS_UTSNAME + { + struct utsname name; + + /* Linux & BSD state that 0 is success, SysV (including Solaris, HP-UX, + and Irix) and Single Unix Spec 3 just say that non-negative is success. + All agree that failure is represented by a negative number. + */ + if (uname(&name) >= 0) { + xf86ErrorFVerb(0, "Current Operating System: %s %s %s %s %s\n", + name.sysname, name.nodename, name.release, name.version, name.machine); +#ifdef linux + do { + char buf[80]; + int fd = open("/proc/cmdline", O_RDONLY); + if (fd != -1) { + xf86ErrorFVerb(0, "Kernel command line: "); + memset(buf, 0, 80); + while (read(fd, buf, 80) > 0) { + xf86ErrorFVerb(0, "%.80s", buf); + memset(buf, 0, 80); + } + close(fd); + } + } while (0); +#endif + } + } +#endif +#if defined(BUILD_DATE) && (BUILD_DATE > 19000000) + { + struct tm t; + char buf[100]; + + memset(&t, 0, sizeof(t)); + memset(buf, 0, sizeof(buf)); + t.tm_mday = BUILD_DATE % 100; + t.tm_mon = (BUILD_DATE / 100) % 100 - 1; + t.tm_year = BUILD_DATE / 10000 - 1900; +#if defined(BUILD_TIME) + t.tm_sec = BUILD_TIME % 100; + t.tm_min = (BUILD_TIME / 100) % 100; + t.tm_hour = (BUILD_TIME / 10000) % 100; + if (strftime(buf, sizeof(buf), "%d %B %Y %I:%M:%S%p", &t)) + xf86ErrorFVerb(0, "Build Date: %s\n", buf); +#else + if (strftime(buf, sizeof(buf), "%d %B %Y", &t)) + xf86ErrorFVerb(0, "Build Date: %s\n", buf); +#endif + } +#endif +#if defined(BUILDERSTRING) + xf86ErrorFVerb(0, "%s \n", BUILDERSTRING); +#endif + xf86ErrorFVerb(0, "Current version of pixman: %s\n", + pixman_version_string()); + xf86ErrorFVerb(0, "\tBefore reporting problems, check " + ""__VENDORDWEBSUPPORT__"\n" + "\tto make sure that you have the latest version.\n"); +} + +static void +xf86PrintMarkers(void) +{ + LogPrintMarkers(); +} + +static Bool +xf86CreateRootWindow(WindowPtr pWin) +{ + int ret = TRUE; + int err = Success; + ScreenPtr pScreen = pWin->drawable.pScreen; + RootWinPropPtr pProp; + CreateWindowProcPtr CreateWindow = (CreateWindowProcPtr) + dixLookupPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey); + + DebugF("xf86CreateRootWindow(%p)\n", pWin); + + if ( pScreen->CreateWindow != xf86CreateRootWindow ) { + /* Can't find hook we are hung on */ + xf86DrvMsg(pScreen->myNum, X_WARNING /* X_ERROR */, + "xf86CreateRootWindow %p called when not in pScreen->CreateWindow %p n", + (void *)xf86CreateRootWindow, + (void *)pScreen->CreateWindow ); + } + + /* Unhook this function ... */ + pScreen->CreateWindow = CreateWindow; + dixSetPrivate(&pScreen->devPrivates, xf86CreateRootWindowKey, NULL); + + /* ... and call the previous CreateWindow fuction, if any */ + if (NULL!=pScreen->CreateWindow) { + ret = (*pScreen->CreateWindow)(pWin); + } + + /* Now do our stuff */ + if (xf86RegisteredPropertiesTable != NULL) { + if (pWin->parent == NULL && xf86RegisteredPropertiesTable != NULL) { + for (pProp = xf86RegisteredPropertiesTable[pScreen->myNum]; + pProp != NULL && err==Success; + pProp = pProp->next ) + { + Atom prop; + + prop = MakeAtom(pProp->name, strlen(pProp->name), TRUE); + err = dixChangeWindowProperty(serverClient, pWin, + prop, pProp->type, + pProp->format, PropModeReplace, + pProp->size, pProp->data, + FALSE); + } + + /* Look at err */ + ret &= (err==Success); + + } else { + xf86Msg(X_ERROR, "xf86CreateRootWindow unexpectedly called with " + "non-root window %p (parent %p)\n", + (void *)pWin, (void *)pWin->parent); + ret = FALSE; + } + } + + DebugF("xf86CreateRootWindow() returns %d\n", ret); + return ret; +} + + +static void +InstallSignalHandlers(void) +{ + /* + * Install signal handler for unexpected signals + */ + xf86Info.caughtSignal=FALSE; + if (!xf86Info.notrapSignals) { + OsRegisterSigWrapper(xf86SigWrapper); + } else { + signal(SIGSEGV, SIG_DFL); + signal(SIGILL, SIG_DFL); +#ifdef SIGEMT + signal(SIGEMT, SIG_DFL); +#endif + signal(SIGFPE, SIG_DFL); + signal(SIGBUS, SIG_DFL); + signal(SIGSYS, SIG_DFL); + signal(SIGXCPU, SIG_DFL); + signal(SIGXFSZ, SIG_DFL); + } +} + +/* + * InitOutput -- + * Initialize screenInfo for all actually accessible framebuffers. + * That includes vt-manager setup, querying all possible devices and + * collecting the pixmap formats. + */ +void +InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) +{ + int i, j, k, scr_index, was_blocked = 0; + char **modulelist; + pointer *optionlist; + Pix24Flags screenpix24, pix24; + MessageType pix24From = X_DEFAULT; + Bool pix24Fail = FALSE; + Bool autoconfig = FALSE; + GDevPtr configured_device; + + xf86Initialising = TRUE; + + if (serverGeneration == 1) { + if ((xf86ServerName = strrchr(argv[0], '/')) != 0) + xf86ServerName++; + else + xf86ServerName = argv[0]; + + xf86PrintBanner(); + xf86PrintMarkers(); + if (xf86LogFile) { + time_t t; + const char *ct; + t = time(NULL); + ct = ctime(&t); + xf86MsgVerb(xf86LogFileFrom, 0, "Log file: \"%s\", Time: %s", + xf86LogFile, ct); + } + + /* Read and parse the config file */ + if (!xf86DoConfigure && !xf86DoShowOptions) { + switch (xf86HandleConfigFile(FALSE)) { + case CONFIG_OK: + break; + case CONFIG_PARSE_ERROR: + xf86Msg(X_ERROR, "Error parsing the config file\n"); + return; + case CONFIG_NOFILE: + autoconfig = TRUE; + break; + } + } + + InstallSignalHandlers(); + + /* Initialise the loader */ + LoaderInit(); + + /* Tell the loader the default module search path */ + LoaderSetPath(xf86ModulePath); + + if (xf86Info.ignoreABI) { + LoaderSetOptions(LDR_OPT_ABI_MISMATCH_NONFATAL); + } + + if (xf86DoShowOptions) + DoShowOptions(); + + /* Do a general bus probe. This will be a PCI probe for x86 platforms */ + xf86BusProbe(); + + if (xf86DoConfigure) + DoConfigure(); + + if (autoconfig) { + if (!xf86AutoConfig()) { + xf86Msg(X_ERROR, "Auto configuration failed\n"); + return; + } + } + +#ifdef XF86PM + xf86OSPMClose = xf86OSPMOpen(); +#endif + + /* Load all modules specified explicitly in the config file */ + if ((modulelist = xf86ModulelistFromConfig(&optionlist))) { + xf86LoadModules(modulelist, optionlist); + free(modulelist); + free(optionlist); + } + + /* Load all driver modules specified in the config file */ + /* If there aren't any specified in the config file, autoconfig them */ + /* FIXME: Does not handle multiple active screen sections, but I'm not + * sure if we really want to handle that case*/ + configured_device = xf86ConfigLayout.screens->screen->device; + if ((!configured_device) || (!configured_device->driver)) { + if (!autoConfigDevice(configured_device)) { + xf86Msg(X_ERROR, "Automatic driver configuration failed\n"); + return ; + } + } + if ((modulelist = xf86DriverlistFromConfig())) { + xf86LoadModules(modulelist, NULL); + free(modulelist); + } + + /* Load all input driver modules specified in the config file. */ + if ((modulelist = xf86InputDriverlistFromConfig())) { + xf86LoadModules(modulelist, NULL); + free(modulelist); + } + + /* + * It is expected that xf86AddDriver()/xf86AddInputDriver will be + * called for each driver as it is loaded. Those functions save the + * module pointers for drivers. + * XXX Nothing keeps track of them for other modules. + */ + /* XXX What do we do if not all of these could be loaded? */ + + /* + * At this point, xf86DriverList[] is all filled in with entries for + * each of the drivers to try and xf86NumDrivers has the number of + * drivers. If there are none, return now. + */ + + if (xf86NumDrivers == 0) { + xf86Msg(X_ERROR, "No drivers available.\n"); + return; + } + + /* + * Call each of the Identify functions and call the driverFunc to check + * if HW access is required. The Identify functions print out some + * identifying information, and anything else that might be + * needed at this early stage. + */ + + for (i = 0; i < xf86NumDrivers; i++) { + if (xf86DriverList[i]->Identify != NULL) + xf86DriverList[i]->Identify(0); + + if (!xorgHWAccess || !xorgHWOpenConsole) { + xorgHWFlags flags; + if(!xf86DriverList[i]->driverFunc + || !xf86DriverList[i]->driverFunc(NULL, + GET_REQUIRED_HW_INTERFACES, + &flags)) + flags = HW_IO; + + if(NEED_IO_ENABLED(flags)) + xorgHWAccess = TRUE; + if(!(flags & HW_SKIP_CONSOLE)) + xorgHWOpenConsole = TRUE; + } + } + + if (xorgHWOpenConsole) + xf86OpenConsole(); + else + xf86Info.dontVTSwitch = TRUE; + + if (xf86BusConfig() == FALSE) + return; + + xf86PostProbe(); + + /* + * Sort the drivers to match the requested ording. Using a slow + * bubble sort. + */ + for (j = 0; j < xf86NumScreens - 1; j++) { + for (i = 0; i < xf86NumScreens - j - 1; i++) { + if (xf86Screens[i + 1]->confScreen->screennum < + xf86Screens[i]->confScreen->screennum) { + ScrnInfoPtr tmpScrn = xf86Screens[i + 1]; + xf86Screens[i + 1] = xf86Screens[i]; + xf86Screens[i] = tmpScrn; + } + } + } + /* Fix up the indexes */ + for (i = 0; i < xf86NumScreens; i++) { + xf86Screens[i]->scrnIndex = i; + } + + /* + * Call the driver's PreInit()'s to complete initialisation for the first + * generation. + */ + + for (i = 0; i < xf86NumScreens; i++) { + xf86VGAarbiterScrnInit(xf86Screens[i]); + xf86VGAarbiterLock(xf86Screens[i]); + if (xf86Screens[i]->PreInit && + xf86Screens[i]->PreInit(xf86Screens[i], 0)) + xf86Screens[i]->configured = TRUE; + xf86VGAarbiterUnlock(xf86Screens[i]); + } + for (i = 0; i < xf86NumScreens; i++) + if (!xf86Screens[i]->configured) + xf86DeleteScreen(i--, 0); + + /* + * If no screens left, return now. + */ + + if (xf86NumScreens == 0) { + xf86Msg(X_ERROR, + "Screen(s) found, but none have a usable configuration.\n"); + return; + } + + for (i = 0; i < xf86NumScreens; i++) { + if (xf86Screens[i]->name == NULL) { + XNFasprintf(&xf86Screens[i]->name, "screen%d", i); + xf86MsgVerb(X_WARNING, 0, + "Screen driver %d has no name set, using `%s'.\n", + i, xf86Screens[i]->name); + } + } + + /* Remove (unload) drivers that are not required */ + for (i = 0; i < xf86NumDrivers; i++) + if (xf86DriverList[i] && xf86DriverList[i]->refCount <= 0) + xf86DeleteDriver(i); + + /* + * At this stage we know how many screens there are. + */ + + for (i = 0; i < xf86NumScreens; i++) + xf86InitViewport(xf86Screens[i]); + + /* + * Collect all pixmap formats and check for conflicts at the display + * level. Should we die here? Or just delete the offending screens? + */ + screenpix24 = Pix24DontCare; + for (i = 0; i < xf86NumScreens; i++) { + if (xf86Screens[i]->imageByteOrder != + xf86Screens[0]->imageByteOrder) + FatalError("Inconsistent display bitmapBitOrder. Exiting\n"); + if (xf86Screens[i]->bitmapScanlinePad != + xf86Screens[0]->bitmapScanlinePad) + FatalError("Inconsistent display bitmapScanlinePad. Exiting\n"); + if (xf86Screens[i]->bitmapScanlineUnit != + xf86Screens[0]->bitmapScanlineUnit) + FatalError("Inconsistent display bitmapScanlineUnit. Exiting\n"); + if (xf86Screens[i]->bitmapBitOrder != + xf86Screens[0]->bitmapBitOrder) + FatalError("Inconsistent display bitmapBitOrder. Exiting\n"); + + /* Determine the depth 24 pixmap format the screens would like */ + if (xf86Screens[i]->pixmap24 != Pix24DontCare) { + if (screenpix24 == Pix24DontCare) + screenpix24 = xf86Screens[i]->pixmap24; + else if (screenpix24 != xf86Screens[i]->pixmap24) + FatalError("Inconsistent depth 24 pixmap format. Exiting\n"); + } + } + /* check if screenpix24 is consistent with the config/cmdline */ + if (xf86Info.pixmap24 != Pix24DontCare) { + pix24 = xf86Info.pixmap24; + pix24From = xf86Info.pix24From; + if (screenpix24 != Pix24DontCare && screenpix24 != xf86Info.pixmap24) + pix24Fail = TRUE; + } else if (screenpix24 != Pix24DontCare) { + pix24 = screenpix24; + pix24From = X_PROBED; + } else + pix24 = Pix24Use32; + + if (pix24Fail) + FatalError("Screen(s) can't use the required depth 24 pixmap format" + " (%d). Exiting\n", PIX24TOBPP(pix24)); + + /* Initialise the depth 24 format */ + for (j = 0; j < numFormats && formats[j].depth != 24; j++) + ; + formats[j].bitsPerPixel = PIX24TOBPP(pix24); + + /* Collect additional formats */ + for (i = 0; i < xf86NumScreens; i++) { + for (j = 0; j < xf86Screens[i]->numFormats; j++) { + for (k = 0; ; k++) { + if (k >= numFormats) { + if (k >= MAXFORMATS) + FatalError("Too many pixmap formats! Exiting\n"); + formats[k] = xf86Screens[i]->formats[j]; + numFormats++; + break; + } + if (formats[k].depth == xf86Screens[i]->formats[j].depth) { + if ((formats[k].bitsPerPixel == + xf86Screens[i]->formats[j].bitsPerPixel) && + (formats[k].scanlinePad == + xf86Screens[i]->formats[j].scanlinePad)) + break; + FatalError("Inconsistent pixmap format for depth %d." + " Exiting\n", formats[k].depth); + } + } + } + } + formatsDone = TRUE; + + if (xf86Info.vtno >= 0 ) { +#define VT_ATOM_NAME "XFree86_VT" + Atom VTAtom=-1; + CARD32 *VT = NULL; + int ret; + + /* This memory needs to stay available until the screen has been + initialized, and we can create the property for real. + */ + if ( (VT = malloc(sizeof(CARD32)))==NULL ) { + FatalError("Unable to make VT property - out of memory. Exiting...\n"); + } + *VT = xf86Info.vtno; + + VTAtom = MakeAtom(VT_ATOM_NAME, sizeof(VT_ATOM_NAME) - 1, TRUE); + + for (i = 0, ret = Success; i < xf86NumScreens && ret == Success; i++) { + ret = xf86RegisterRootWindowProperty(xf86Screens[i]->scrnIndex, + VTAtom, XA_INTEGER, 32, + 1, VT ); + if (ret != Success) + xf86DrvMsg(xf86Screens[i]->scrnIndex, X_WARNING, + "Failed to register VT property\n"); + } + } + + /* If a screen uses depth 24, show what the pixmap format is */ + for (i = 0; i < xf86NumScreens; i++) { + if (xf86Screens[i]->depth == 24) { + xf86Msg(pix24From, "Depth 24 pixmap format is %d bpp\n", + PIX24TOBPP(pix24)); + break; + } + } + } else { + /* + * serverGeneration != 1; some OSs have to do things here, too. + */ + if (xorgHWOpenConsole) + xf86OpenConsole(); + +#ifdef XF86PM + /* + should we reopen it here? We need to deal with an already opened + device. We could leave this to the OS layer. For now we simply + close it here + */ + if (xf86OSPMClose) + xf86OSPMClose(); + if ((xf86OSPMClose = xf86OSPMOpen()) != NULL) + xf86MsgVerb(X_INFO, 3, "APM registered successfully\n"); +#endif + + /* Make sure full I/O access is enabled */ + if (xorgHWAccess) + xf86EnableIO(); + } + + /* + * Use the previously collected parts to setup pScreenInfo + */ + + pScreenInfo->imageByteOrder = xf86Screens[0]->imageByteOrder; + pScreenInfo->bitmapScanlinePad = xf86Screens[0]->bitmapScanlinePad; + pScreenInfo->bitmapScanlineUnit = xf86Screens[0]->bitmapScanlineUnit; + pScreenInfo->bitmapBitOrder = xf86Screens[0]->bitmapBitOrder; + pScreenInfo->numPixmapFormats = numFormats; + for (i = 0; i < numFormats; i++) + pScreenInfo->formats[i] = formats[i]; + + /* Make sure the server's VT is active */ + + if (serverGeneration != 1) { + xf86Resetting = TRUE; + /* All screens are in the same state, so just check the first */ + if (!xf86Screens[0]->vtSema) { +#ifdef HAS_USL_VTS + ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ); +#endif + xf86AccessEnter(); + was_blocked = xf86BlockSIGIO(); + } + } + + for (i = 0; i < xf86NumScreens; i++) + if (!xf86ColormapAllocatePrivates(xf86Screens[i])) + FatalError("Cannot register DDX private keys"); + + if (!dixRegisterPrivateKey(&xf86ScreenKeyRec, PRIVATE_SCREEN, 0) || + !dixRegisterPrivateKey(&xf86CreateRootWindowKeyRec, PRIVATE_SCREEN, 0)) + FatalError("Cannot register DDX private keys"); + + for (i = 0; i < xf86NumScreens; i++) { + xf86VGAarbiterLock(xf86Screens[i]); + /* + * Almost everything uses these defaults, and many of those that + * don't, will wrap them. + */ + xf86Screens[i]->EnableDisableFBAccess = xf86EnableDisableFBAccess; +#ifdef XFreeXDGA + xf86Screens[i]->SetDGAMode = xf86SetDGAMode; +#endif + xf86Screens[i]->DPMSSet = NULL; + xf86Screens[i]->LoadPalette = NULL; + xf86Screens[i]->SetOverscan = NULL; + xf86Screens[i]->DriverFunc = NULL; + xf86Screens[i]->pScreen = NULL; + scr_index = AddScreen(xf86Screens[i]->ScreenInit, argc, argv); + xf86VGAarbiterUnlock(xf86Screens[i]); + if (scr_index == i) { + /* + * Hook in our ScrnInfoRec, and initialise some other pScreen + * fields. + */ + dixSetPrivate(&screenInfo.screens[scr_index]->devPrivates, + xf86ScreenKey, xf86Screens[i]); + xf86Screens[i]->pScreen = screenInfo.screens[scr_index]; + /* The driver should set this, but make sure it is set anyway */ + xf86Screens[i]->vtSema = TRUE; + } else { + /* This shouldn't normally happen */ + FatalError("AddScreen/ScreenInit failed for driver %d\n", i); + } + + DebugF("InitOutput - xf86Screens[%d]->pScreen = %p\n", + i, xf86Screens[i]->pScreen ); + DebugF("xf86Screens[%d]->pScreen->CreateWindow = %p\n", + i, xf86Screens[i]->pScreen->CreateWindow ); + + dixSetPrivate(&screenInfo.screens[scr_index]->devPrivates, + xf86CreateRootWindowKey, + xf86Screens[i]->pScreen->CreateWindow); + xf86Screens[i]->pScreen->CreateWindow = xf86CreateRootWindow; + + if (PictureGetSubpixelOrder (xf86Screens[i]->pScreen) == SubPixelUnknown) + { + xf86MonPtr DDC = (xf86MonPtr)(xf86Screens[i]->monitor->DDC); + PictureSetSubpixelOrder (xf86Screens[i]->pScreen, + DDC ? + (DDC->features.input_type ? + SubPixelHorizontalRGB : SubPixelNone) : + SubPixelUnknown); + } +#ifdef RANDR + if (!xf86Info.disableRandR) + xf86RandRInit (screenInfo.screens[scr_index]); + xf86Msg(xf86Info.randRFrom, "RandR %s\n", + xf86Info.disableRandR ? "disabled" : "enabled"); +#endif + } + + xf86VGAarbiterWrapFunctions(); + xf86UnblockSIGIO(was_blocked); + + xf86InitOrigins(); + + xf86Resetting = FALSE; + xf86Initialising = FALSE; + + RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, xf86Wakeup, + NULL); +} + +/* + * InitInput -- + * Initialize all supported input devices. + */ + +void +InitInput(int argc, char **argv) +{ + InputInfoPtr* pDev; + DeviceIntPtr dev; + + xf86Info.vtRequestsPending = FALSE; + + mieqInit(); + + GetEventList(&xf86Events); + + /* Initialize all configured input devices */ + for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) { + /* Replace obsolete keyboard driver with kbd */ + if (!xf86NameCmp((*pDev)->driver, "keyboard")) { + strcpy((*pDev)->driver, "kbd"); + } + + /* If one fails, the others will too */ + if (xf86NewInputDevice(*pDev, &dev, TRUE) == BadAlloc) + break; + } + + config_init(); +} + +void +CloseInput (void) +{ + config_fini(); +} + +/* + * OsVendorInit -- + * OS/Vendor-specific initialisations. Called from OsInit(), which + * is called by dix before establishing the well known sockets. + */ + +void +OsVendorInit(void) +{ + static Bool beenHere = FALSE; + + signal(SIGCHLD, SIG_DFL); /* Need to wait for child processes */ + + if (!beenHere) { + umask(022); + xf86LogInit(); + } + + /* Set stderr to non-blocking. */ +#ifndef O_NONBLOCK +#if defined(FNDELAY) +#define O_NONBLOCK FNDELAY +#elif defined(O_NDELAY) +#define O_NONBLOCK O_NDELAY +#endif + +#ifdef O_NONBLOCK + if (!beenHere) { + if (geteuid() == 0 && getuid() != geteuid()) + { + int status; + + status = fcntl(fileno(stderr), F_GETFL, 0); + if (status != -1) { + fcntl(fileno(stderr), F_SETFL, status | O_NONBLOCK); + } + } + } +#endif +#endif + + beenHere = TRUE; +} + +/* + * ddxGiveUp -- + * Device dependent cleanup. Called by by dix before normal server death. + * For SYSV386 we must switch the terminal back to normal mode. No error- + * checking here, since there should be restored as much as possible. + */ + +void +ddxGiveUp(void) +{ + int i; + + xf86VGAarbiterFini(); + +#ifdef XF86PM + if (xf86OSPMClose) + xf86OSPMClose(); + xf86OSPMClose = NULL; +#endif + + for (i = 0; i < xf86NumScreens; i++) { + /* + * zero all access functions to + * trap calls when switched away. + */ + xf86Screens[i]->vtSema = FALSE; + } + +#ifdef XFreeXDGA + DGAShutdown(); +#endif + + if (xorgHWOpenConsole) + xf86CloseConsole(); + + xf86CloseLog(); + + /* If an unexpected signal was caught, dump a core for debugging */ + if (xf86Info.caughtSignal) + OsAbort(); +} + + + +/* + * AbortDDX -- + * DDX - specific abort routine. Called by AbortServer(). The attempt is + * made to restore all original setting of the displays. Also all devices + * are closed. + */ + +void +AbortDDX(void) +{ + int i; + + xf86BlockSIGIO(); + + /* + * try to restore the original video state + */ +#ifdef DPMSExtension /* Turn screens back on */ + if (DPMSPowerLevel != DPMSModeOn) + DPMSSet(serverClient, DPMSModeOn); +#endif + if (xf86Screens) { + for (i = 0; i < xf86NumScreens; i++) + if (xf86Screens[i]->vtSema) { + /* + * if we are aborting before ScreenInit() has finished + * we might not have been wrapped yet. Therefore enable + * screen explicitely. + */ + xf86VGAarbiterLock(xf86Screens[i]); + (xf86Screens[i]->LeaveVT)(i, 0); + xf86VGAarbiterUnlock(xf86Screens[i]); + } + } + + xf86AccessLeave(); + + /* + * This is needed for an abnormal server exit, since the normal exit stuff + * MUST also be performed (i.e. the vt must be left in a defined state) + */ + ddxGiveUp(); +} + +void +OsVendorFatalError(void) +{ +#ifdef VENDORSUPPORT + ErrorF("\nPlease refer to your Operating System Vendor support pages\n" + "at %s for support on this crash.\n",VENDORSUPPORT); +#else + ErrorF("\nPlease consult the "XVENDORNAME" support \n" + "\t at "__VENDORDWEBSUPPORT__"\n for help. \n"); +#endif + if (xf86LogFile && xf86LogFileWasOpened) + ErrorF("Please also check the log file at \"%s\" for additional " + "information.\n", xf86LogFile); + ErrorF("\n"); +} + +int +xf86SetVerbosity(int verb) +{ + int save = xf86Verbose; + + xf86Verbose = verb; + LogSetParameter(XLOG_VERBOSITY, verb); + return save; +} + +int +xf86SetLogVerbosity(int verb) +{ + int save = xf86LogVerbose; + + xf86LogVerbose = verb; + LogSetParameter(XLOG_FILE_VERBOSITY, verb); + return save; +} + +static void +xf86PrintDefaultModulePath(void) +{ + ErrorF("%s\n", DEFAULT_MODULE_PATH); +} + +static void +xf86PrintDefaultLibraryPath(void) +{ + ErrorF("%s\n", DEFAULT_LIBRARY_PATH); +} + +/* + * ddxProcessArgument -- + * Process device-dependent command line args. Returns 0 if argument is + * not device dependent, otherwise Count of number of elements of argv + * that are part of a device dependent commandline option. + * + */ + +/* ARGSUSED */ +int +ddxProcessArgument(int argc, char **argv, int i) +{ +#define CHECK_FOR_REQUIRED_ARGUMENT() \ + if (((i + 1) >= argc) || (!argv[i + 1])) { \ + ErrorF("Required argument to %s not specified\n", argv[i]); \ + UseMsg(); \ + FatalError("Required argument to %s not specified\n", argv[i]); \ + } + + /* First the options that are only allowed for root */ + if (!strcmp(argv[i], "-modulepath") || !strcmp(argv[i], "-logfile")) { + if ( (geteuid() == 0) && (getuid() != 0) ) { + FatalError("The '%s' option can only be used by root.\n", argv[i]); + } + else if (!strcmp(argv[i], "-modulepath")) + { + char *mp; + CHECK_FOR_REQUIRED_ARGUMENT(); + mp = strdup(argv[i + 1]); + if (!mp) + FatalError("Can't allocate memory for ModulePath\n"); + xf86ModulePath = mp; + xf86ModPathFrom = X_CMDLINE; + return 2; + } + else if (!strcmp(argv[i], "-logfile")) + { + char *lf; + CHECK_FOR_REQUIRED_ARGUMENT(); + lf = strdup(argv[i + 1]); + if (!lf) + FatalError("Can't allocate memory for LogFile\n"); + xf86LogFile = lf; + xf86LogFileFrom = X_CMDLINE; + return 2; + } + } + if (!strcmp(argv[i], "-config") || !strcmp(argv[i], "-xf86config")) + { + CHECK_FOR_REQUIRED_ARGUMENT(); + if (getuid() != 0 && !xf86PathIsSafe(argv[i + 1])) { + FatalError("\nInvalid argument for %s\n" + "\tFor non-root users, the file specified with %s must be\n" + "\ta relative path and must not contain any \"..\" elements.\n" + "\tUsing default "__XCONFIGFILE__" search path.\n\n", + argv[i], argv[i]); + } + xf86ConfigFile = argv[i + 1]; + return 2; + } + if (!strcmp(argv[i], "-configdir")) + { + CHECK_FOR_REQUIRED_ARGUMENT(); + if (getuid() != 0 && !xf86PathIsSafe(argv[i + 1])) { + FatalError("\nInvalid argument for %s\n" + "\tFor non-root users, the file specified with %s must be\n" + "\ta relative path and must not contain any \"..\" elements.\n" + "\tUsing default "__XCONFIGDIR__" search path.\n\n", + argv[i], argv[i]); + } + xf86ConfigDir = argv[i + 1]; + return 2; + } + if (!strcmp(argv[i],"-flipPixels")) + { + xf86FlipPixels = TRUE; + return 1; + } +#ifdef XF86VIDMODE + if (!strcmp(argv[i],"-disableVidMode")) + { + xf86VidModeDisabled = TRUE; + return 1; + } + if (!strcmp(argv[i],"-allowNonLocalXvidtune")) + { + xf86VidModeAllowNonLocal = TRUE; + return 1; + } +#endif + if (!strcmp(argv[i],"-allowMouseOpenFail")) + { + xf86AllowMouseOpenFail = TRUE; + return 1; + } + if (!strcmp(argv[i],"-ignoreABI")) + { + LoaderSetOptions(LDR_OPT_ABI_MISMATCH_NONFATAL); + return 1; + } + if (!strcmp(argv[i],"-verbose")) + { + if (++i < argc && argv[i]) + { + char *end; + long val; + val = strtol(argv[i], &end, 0); + if (*end == '\0') + { + xf86SetVerbosity(val); + return 2; + } + } + xf86SetVerbosity(++xf86Verbose); + return 1; + } + if (!strcmp(argv[i],"-logverbose")) + { + if (++i < argc && argv[i]) + { + char *end; + long val; + val = strtol(argv[i], &end, 0); + if (*end == '\0') + { + xf86SetLogVerbosity(val); + return 2; + } + } + xf86SetLogVerbosity(++xf86LogVerbose); + return 1; + } + if (!strcmp(argv[i],"-quiet")) + { + xf86SetVerbosity(-1); + return 1; + } + if (!strcmp(argv[i],"-showconfig") || !strcmp(argv[i],"-version")) + { + xf86PrintBanner(); + exit(0); + } + if (!strcmp(argv[i],"-showDefaultModulePath")) + { + xf86PrintDefaultModulePath(); + exit(0); + } + if (!strcmp(argv[i],"-showDefaultLibPath")) + { + xf86PrintDefaultLibraryPath(); + exit(0); + } + /* Notice the -fp flag, but allow it to pass to the dix layer */ + if (!strcmp(argv[i], "-fp")) + { + xf86fpFlag = TRUE; + return 0; + } + /* Notice the -bs flag, but allow it to pass to the dix layer */ + if (!strcmp(argv[i], "-bs")) + { + xf86bsDisableFlag = TRUE; + return 0; + } + /* Notice the +bs flag, but allow it to pass to the dix layer */ + if (!strcmp(argv[i], "+bs")) + { + xf86bsEnableFlag = TRUE; + return 0; + } + /* Notice the -s flag, but allow it to pass to the dix layer */ + if (!strcmp(argv[i], "-s")) + { + xf86sFlag = TRUE; + return 0; + } + if (!strcmp(argv[i], "-pixmap24")) + { + xf86Pix24 = Pix24Use24; + return 1; + } + if (!strcmp(argv[i], "-pixmap32")) + { + xf86Pix24 = Pix24Use32; + return 1; + } + if (!strcmp(argv[i], "-fbbpp")) + { + int bpp; + CHECK_FOR_REQUIRED_ARGUMENT(); + if (sscanf(argv[++i], "%d", &bpp) == 1) + { + xf86FbBpp = bpp; + return 2; + } + else + { + ErrorF("Invalid fbbpp\n"); + return 0; + } + } + if (!strcmp(argv[i], "-depth")) + { + int depth; + CHECK_FOR_REQUIRED_ARGUMENT(); + if (sscanf(argv[++i], "%d", &depth) == 1) + { + xf86Depth = depth; + return 2; + } + else + { + ErrorF("Invalid depth\n"); + return 0; + } + } + if (!strcmp(argv[i], "-weight")) + { + int red, green, blue; + CHECK_FOR_REQUIRED_ARGUMENT(); + if (sscanf(argv[++i], "%1d%1d%1d", &red, &green, &blue) == 3) + { + xf86Weight.red = red; + xf86Weight.green = green; + xf86Weight.blue = blue; + return 2; + } + else + { + ErrorF("Invalid weighting\n"); + return 0; + } + } + if (!strcmp(argv[i], "-gamma") || !strcmp(argv[i], "-rgamma") || + !strcmp(argv[i], "-ggamma") || !strcmp(argv[i], "-bgamma")) + { + double gamma; + CHECK_FOR_REQUIRED_ARGUMENT(); + if (sscanf(argv[++i], "%lf", &gamma) == 1) { + if (gamma < GAMMA_MIN || gamma > GAMMA_MAX) { + ErrorF("gamma out of range, only %.2f <= gamma_value <= %.1f" + " is valid\n", GAMMA_MIN, GAMMA_MAX); + return 0; + } + if (!strcmp(argv[i-1], "-gamma")) + xf86Gamma.red = xf86Gamma.green = xf86Gamma.blue = gamma; + else if (!strcmp(argv[i-1], "-rgamma")) xf86Gamma.red = gamma; + else if (!strcmp(argv[i-1], "-ggamma")) xf86Gamma.green = gamma; + else if (!strcmp(argv[i-1], "-bgamma")) xf86Gamma.blue = gamma; + return 2; + } + } + if (!strcmp(argv[i], "-layout")) + { + CHECK_FOR_REQUIRED_ARGUMENT(); + xf86LayoutName = argv[++i]; + return 2; + } + if (!strcmp(argv[i], "-screen")) + { + CHECK_FOR_REQUIRED_ARGUMENT(); + xf86ScreenName = argv[++i]; + return 2; + } + if (!strcmp(argv[i], "-pointer")) + { + CHECK_FOR_REQUIRED_ARGUMENT(); + xf86PointerName = argv[++i]; + return 2; + } + if (!strcmp(argv[i], "-keyboard")) + { + CHECK_FOR_REQUIRED_ARGUMENT(); + xf86KeyboardName = argv[++i]; + return 2; + } + if (!strcmp(argv[i], "-nosilk")) + { + xf86silkenMouseDisableFlag = TRUE; + return 1; + } +#ifdef HAVE_ACPI + if (!strcmp(argv[i], "-noacpi")) + { + xf86acpiDisableFlag = TRUE; + return 1; + } +#endif + if (!strcmp(argv[i], "-configure")) + { + if (getuid() != 0 && geteuid() == 0) { + ErrorF("The '-configure' option can only be used by root.\n"); + exit(1); + } + xf86DoConfigure = TRUE; + xf86AllowMouseOpenFail = TRUE; + return 1; + } + if (!strcmp(argv[i], "-showopts")) + { + if (getuid() != 0 && geteuid() == 0) { + ErrorF("The '-showopts' option can only be used by root.\n"); + exit(1); + } + xf86DoShowOptions = TRUE; + return 1; + } + if (!strcmp(argv[i], "-isolateDevice")) + { + CHECK_FOR_REQUIRED_ARGUMENT(); + if (strncmp(argv[++i], "PCI:", 4)) { + FatalError("Bus types other than PCI not yet isolable\n"); + } + xf86PciIsolateDevice(argv[i]); + return 2; + } + /* Notice cmdline xkbdir, but pass to dix as well */ + if (!strcmp(argv[i], "-xkbdir")) + { + xf86xkbdirFlag = TRUE; + return 0; + } + + /* OS-specific processing */ + return xf86ProcessArgument(argc, argv, i); +} + +/* + * ddxUseMsg -- + * Print out correct use of device dependent commandline options. + * Maybe the user now knows what really to do ... + */ + +void +ddxUseMsg(void) +{ + ErrorF("\n"); + ErrorF("\n"); + ErrorF("Device Dependent Usage\n"); + if (getuid() == 0 || geteuid() != 0) + { + ErrorF("-modulepath paths specify the module search path\n"); + ErrorF("-logfile file specify a log file name\n"); + ErrorF("-configure probe for devices and write an "__XCONFIGFILE__"\n"); + ErrorF("-showopts print available options for all installed drivers\n"); + } + ErrorF("-config file specify a configuration file, relative to the\n"); + ErrorF(" "__XCONFIGFILE__" search path, only root can use absolute\n"); + ErrorF("-configdir dir specify a configuration directory, relative to the\n"); + ErrorF(" "__XCONFIGDIR__" search path, only root can use absolute\n"); + ErrorF("-verbose [n] verbose startup messages\n"); + ErrorF("-logverbose [n] verbose log messages\n"); + ErrorF("-quiet minimal startup messages\n"); + ErrorF("-pixmap24 use 24bpp pixmaps for depth 24\n"); + ErrorF("-pixmap32 use 32bpp pixmaps for depth 24\n"); + ErrorF("-fbbpp n set bpp for the framebuffer. Default: 8\n"); + ErrorF("-depth n set colour depth. Default: 8\n"); + ErrorF("-gamma f set gamma value (0.1 < f < 10.0) Default: 1.0\n"); + ErrorF("-rgamma f set gamma value for red phase\n"); + ErrorF("-ggamma f set gamma value for green phase\n"); + ErrorF("-bgamma f set gamma value for blue phase\n"); + ErrorF("-weight nnn set RGB weighting at 16 bpp. Default: 565\n"); + ErrorF("-layout name specify the ServerLayout section name\n"); + ErrorF("-screen name specify the Screen section name\n"); + ErrorF("-keyboard name specify the core keyboard InputDevice name\n"); + ErrorF("-pointer name specify the core pointer InputDevice name\n"); + ErrorF("-nosilk disable Silken Mouse\n"); + ErrorF("-flipPixels swap default black/white Pixel values\n"); +#ifdef XF86VIDMODE + ErrorF("-disableVidMode disable mode adjustments with xvidtune\n"); + ErrorF("-allowNonLocalXvidtune allow xvidtune to be run as a non-local client\n"); +#endif + ErrorF("-allowMouseOpenFail start server even if the mouse can't be initialized\n"); + ErrorF("-ignoreABI make module ABI mismatches non-fatal\n"); + ErrorF("-isolateDevice bus_id restrict device resets to bus_id (PCI only)\n"); + 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"); + /* OS-specific usage */ + xf86UseMsg(); + ErrorF("\n"); +} + + +/* + * xf86LoadModules iterates over a list that is being passed in. + */ +Bool +xf86LoadModules(char **list, pointer *optlist) +{ + int errmaj, errmin; + pointer opt; + int i; + char *name; + Bool failed = FALSE; + + if (!list) + return TRUE; + + for (i = 0; list[i] != NULL; i++) { + + /* Normalise the module name */ + name = xf86NormalizeName(list[i]); + + /* Skip empty names */ + if (name == NULL || *name == '\0') + continue; + + /* Replace obsolete keyboard driver with kbd */ + if (!xf86NameCmp(name, "keyboard")) { + strcpy(name, "kbd"); + } + + if (optlist) + opt = optlist[i]; + else + opt = NULL; + + if (!LoadModule(name, NULL, NULL, NULL, opt, NULL, &errmaj, &errmin)) { + LoaderErrorMsg(NULL, name, errmaj, errmin); + failed = TRUE; + } + free(name); + } + return !failed; +} + +/* Pixmap format stuff */ + +PixmapFormatPtr +xf86GetPixFormat(ScrnInfoPtr pScrn, int depth) +{ + int i; + static PixmapFormatRec format; /* XXX not reentrant */ + + /* + * When the formats[] list initialisation isn't complete, check the + * depth 24 pixmap config/cmdline options and screen-specified formats. + */ + + if (!formatsDone) { + if (depth == 24) { + Pix24Flags pix24 = Pix24DontCare; + + format.depth = 24; + format.scanlinePad = BITMAP_SCANLINE_PAD; + if (xf86Info.pixmap24 != Pix24DontCare) + pix24 = xf86Info.pixmap24; + else if (pScrn->pixmap24 != Pix24DontCare) + pix24 = pScrn->pixmap24; + if (pix24 == Pix24Use24) + format.bitsPerPixel = 24; + else + format.bitsPerPixel = 32; + return &format; + } + } + + for (i = 0; i < numFormats; i++) + if (formats[i].depth == depth) + break; + if (i != numFormats) + return &formats[i]; + else if (!formatsDone) { + /* Check for screen-specified formats */ + for (i = 0; i < pScrn->numFormats; i++) + if (pScrn->formats[i].depth == depth) + break; + if (i != pScrn->numFormats) + return &pScrn->formats[i]; + } + return NULL; +} + +int +xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth) +{ + PixmapFormatPtr format; + + + format = xf86GetPixFormat(pScrn, depth); + if (format) + return format->bitsPerPixel; + else + return 0; +} diff --git a/xorg-server/hw/xfree86/common/xf86VidMode.c b/xorg-server/hw/xfree86/common/xf86VidMode.c index 591c338b1..eb29fd09e 100644 --- a/xorg-server/hw/xfree86/common/xf86VidMode.c +++ b/xorg-server/hw/xfree86/common/xf86VidMode.c @@ -634,7 +634,7 @@ VidModeSetModeValue(pointer mode, int valtyp, int val) vidMonitorValue VidModeGetMonitorValue(pointer monitor, int valtyp, int indx) { - vidMonitorValue ret; + vidMonitorValue ret = { NULL, }; switch (valtyp) { case VIDMODE_MON_VENDOR: diff --git a/xorg-server/hw/xfree86/common/xf86xv.c b/xorg-server/hw/xfree86/common/xf86xv.c index 9f62a8397..8115075b3 100644 --- a/xorg-server/hw/xfree86/common/xf86xv.c +++ b/xorg-server/hw/xfree86/common/xf86xv.c @@ -97,8 +97,11 @@ static int xf86XVQueryImageAttributes(ClientPtr, XvPortPtr, XvImagePtr, static Bool xf86XVDestroyWindow(WindowPtr pWin); static void xf86XVWindowExposures(WindowPtr pWin, RegionPtr r1, RegionPtr r2); +static void xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind); static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy); +#define PostValidateTreeUndefined ((PostValidateTreeProcPtr)-1) + /* ScrnInfoRec functions */ static Bool xf86XVEnterVT(int, int); @@ -280,10 +283,9 @@ xf86XVScreenInit( pScrn = xf86Screens[pScreen->myNum]; - ScreenPriv->videoGC = NULL; /* for the helper */ - ScreenPriv->DestroyWindow = pScreen->DestroyWindow; ScreenPriv->WindowExposures = pScreen->WindowExposures; + ScreenPriv->PostValidateTree = PostValidateTreeUndefined; ScreenPriv->ClipNotify = pScreen->ClipNotify; ScreenPriv->EnterVT = pScrn->EnterVT; ScreenPriv->LeaveVT = pScrn->LeaveVT; @@ -333,6 +335,8 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) RegionDestroy(pPriv->clientClip); if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) RegionDestroy(pPriv->pCompositeClip); + if (pPriv->ckeyFilled) + RegionDestroy(pPriv->ckeyFilled); free(pPriv); } } @@ -1018,7 +1022,6 @@ static void xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) { XF86XVWindowPtr winPriv, prevPriv = NULL; - winPriv = GET_XF86XV_WINDOW(pWin); while(winPriv) { @@ -1035,6 +1038,11 @@ xf86XVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) winPriv = winPriv->next; } portPriv->pDraw = NULL; + if (portPriv->ckeyFilled) { + RegionDestroy(portPriv->ckeyFilled); + portPriv->ckeyFilled = NULL; + } + portPriv->clipChanged = FALSE; } static void @@ -1069,7 +1077,7 @@ xf86XVReputOrStopPort(XvPortRecPrivatePtr pPriv, } static void -xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn) +xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn, Bool onlyChanged) { ScreenPtr pScreen = pScrn->pScreen; XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); @@ -1087,6 +1095,9 @@ xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn) if (pPriv->isOn == XV_OFF || !pWin) continue; + if (onlyChanged && !pPriv->clipChanged) + continue; + visible = pWin->visibility == VisibilityUnobscured || pWin->visibility == VisibilityPartiallyObscured; @@ -1098,6 +1109,8 @@ xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn) visible = FALSE; xf86XVReputOrStopPort(pPriv, pWin, visible); + + pPriv->clipChanged = FALSE; } } } @@ -1123,9 +1136,6 @@ xf86XVDestroyWindow(WindowPtr pWin) pPriv->pDraw = NULL; tmp = WinPriv; - if(WinPriv->pGC) { - FreeGC(WinPriv->pGC, 0); - } WinPriv = WinPriv->next; free(tmp); } @@ -1139,6 +1149,29 @@ xf86XVDestroyWindow(WindowPtr pWin) return ret; } +static void +xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind) +{ + ScreenPtr pScreen; + XF86XVScreenPtr ScreenPriv; + ScrnInfoPtr pScrn; + + if (pWin) + pScreen = pWin->drawable.pScreen; + else + pScreen = pLayerWin->drawable.pScreen; + + ScreenPriv = GET_XF86XV_SCREEN(pScreen); + pScrn = xf86Screens[pScreen->myNum]; + + xf86XVReputOrStopAllPorts(pScrn, TRUE); + + pScreen->PostValidateTree = ScreenPriv->PostValidateTree; + if (pScreen->PostValidateTree) { + (*pScreen->PostValidateTree)(pWin, pLayerWin, kind); + } + ScreenPriv->PostValidateTree = PostValidateTreeUndefined; +} static void xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) @@ -1170,12 +1203,28 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) if (!pPriv->type && !pPriv->AdaptorRec->ReputImage) visible = !AreasExposed; + /* + * Subtract exposed areas from overlaid image to match textured video + * behavior. + */ + if (!pPriv->type && pPriv->clientClip) + RegionSubtract(pPriv->clientClip, pPriv->clientClip, reg1); + + if (visible && pPriv->ckeyFilled) { + RegionRec tmp; + RegionNull(&tmp); + RegionCopy(&tmp, reg1); + RegionTranslate(&tmp, pWin->drawable.x, pWin->drawable.y); + RegionSubtract(pPriv->ckeyFilled, pPriv->ckeyFilled, &tmp); + } + WinPriv = WinPriv->next; xf86XVReputOrStopPort(pPriv, pWin, visible); + + pPriv->clipChanged = FALSE; } } - static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy) { @@ -1185,9 +1234,6 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy) XvPortRecPrivatePtr pPriv; while(WinPriv) { - Bool visible = pWin->visibility == VisibilityUnobscured || - pWin->visibility == VisibilityPartiallyObscured; - pPriv = WinPriv->PortRec; if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) @@ -1199,15 +1245,14 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy) (*pPriv->AdaptorRec->ClipNotify)(pPriv->pScrn, pPriv->DevPriv.ptr, pWin, dx, dy); - /* - * Stop and remove still/images if - * ReputImage isn't supported. - */ - if (!pPriv->type && !pPriv->AdaptorRec->ReputImage) - visible = FALSE; + pPriv->clipChanged = TRUE; + + if (ScreenPriv->PostValidateTree == PostValidateTreeUndefined) { + ScreenPriv->PostValidateTree = pScreen->PostValidateTree; + pScreen->PostValidateTree = xf86XVPostValidateTree; + } WinPriv = WinPriv->next; - xf86XVReputOrStopPort(pPriv, pWin, visible); } if(ScreenPriv->ClipNotify) { @@ -1232,11 +1277,6 @@ xf86XVCloseScreen(int i, ScreenPtr pScreen) if(!ScreenPriv) return TRUE; - if(ScreenPriv->videoGC) { - FreeGC(ScreenPriv->videoGC, 0); - ScreenPriv->videoGC = NULL; - } - pScreen->DestroyWindow = ScreenPriv->DestroyWindow; pScreen->WindowExposures = ScreenPriv->WindowExposures; pScreen->ClipNotify = ScreenPriv->ClipNotify; @@ -1345,7 +1385,7 @@ xf86XVAdjustFrame(int index, int x, int y, int flags) pScrn->AdjustFrame = xf86XVAdjustFrame; } - xf86XVReputOrStopAllPorts(pScrn); + xf86XVReputOrStopAllPorts(pScrn, FALSE); } static void @@ -1366,7 +1406,7 @@ xf86XVModeSet(ScrnInfoPtr pScrn) pScrn->ModeSet = xf86XVModeSet; } - xf86XVReputOrStopAllPorts(pScrn); + xf86XVReputOrStopAllPorts(pScrn, FALSE); } /**** XvAdaptorRec fields ****/ @@ -1869,92 +1909,92 @@ xf86XVQueryImageAttributes( format->id, width, height, pitches, offsets); } - void -xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes) +xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr fillboxes) { ScreenPtr pScreen = pDraw->pScreen; - WindowPtr pWin = (WindowPtr)pDraw; - XF86XVWindowPtr pPriv = GET_XF86XV_WINDOW(pWin); - GCPtr pGC = NULL; - BoxPtr pbox = RegionRects(clipboxes); - int i, nbox = RegionNumRects(clipboxes); - xRectangle *rects; - - if(!xf86Screens[pScreen->myNum]->vtSema) return; - - if(pPriv) - pGC = pPriv->pGC; - - if(!pGC) { - int status; - XID pval[2]; - pval[0] = key; - pval[1] = IncludeInferiors; - pGC = CreateGC(pDraw, GCForeground | GCSubwindowMode, pval, &status, - (XID)0, serverClient); - if(!pGC) return; - ValidateGC(pDraw, pGC); - if (pPriv) pPriv->pGC = pGC; - } else if (key != pGC->fgPixel){ - ChangeGCVal val; - val.val = key; - ChangeGC(NullClient, pGC, GCForeground, &val); - ValidateGC(pDraw, pGC); - } - - RegionTranslate(clipboxes, -pDraw->x, -pDraw->y); - - rects = malloc(nbox * sizeof(xRectangle)); - - for(i = 0; i < nbox; i++, pbox++) { - rects[i].x = pbox->x1; - rects[i].y = pbox->y1; - rects[i].width = pbox->x2 - pbox->x1; - rects[i].height = pbox->y2 - pbox->y1; - } - - (*pGC->ops->PolyFillRect)(pDraw, pGC, nbox, rects); - - if (!pPriv) FreeGC(pGC, 0); - - free(rects); -} - -void -xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes) -{ - DrawablePtr root = &pScreen->root->drawable; ChangeGCVal pval[2]; - BoxPtr pbox = RegionRects(clipboxes); - int i, nbox = RegionNumRects(clipboxes); + BoxPtr pbox = RegionRects(fillboxes); + int i, nbox = RegionNumRects(fillboxes); xRectangle *rects; GCPtr gc; if(!xf86Screens[pScreen->myNum]->vtSema) return; - gc = GetScratchGC(root->depth, pScreen); + gc = GetScratchGC(pDraw->depth, pScreen); pval[0].val = key; pval[1].val = IncludeInferiors; (void) ChangeGC(NullClient, gc, GCForeground|GCSubwindowMode, pval); - ValidateGC(root, gc); + ValidateGC(pDraw, gc); rects = malloc(nbox * sizeof(xRectangle)); for(i = 0; i < nbox; i++, pbox++) { - rects[i].x = pbox->x1; - rects[i].y = pbox->y1; + rects[i].x = pbox->x1 - pDraw->x; + rects[i].y = pbox->y1 - pDraw->y; rects[i].width = pbox->x2 - pbox->x1; rects[i].height = pbox->y2 - pbox->y1; } - (*gc->ops->PolyFillRect)(root, gc, nbox, rects); + (*gc->ops->PolyFillRect)(pDraw, gc, nbox, rects); free(rects); FreeScratchGC (gc); } +void +xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr fillboxes) +{ + xf86XVFillKeyHelperDrawable (&pScreen->root->drawable, key, fillboxes); +} + +void +xf86XVFillKeyHelperPort (DrawablePtr pDraw, pointer data, CARD32 key, RegionPtr clipboxes, Bool fillEverything) +{ + WindowPtr pWin = (WindowPtr)pDraw; + XF86XVWindowPtr WinPriv = GET_XF86XV_WINDOW(pWin); + XvPortRecPrivatePtr portPriv = NULL; + RegionRec reg; + RegionPtr fillboxes; + + while (WinPriv) { + XvPortRecPrivatePtr pPriv = WinPriv->PortRec; + + if (data == pPriv->DevPriv.ptr) { + portPriv = pPriv; + break; + } + + WinPriv = WinPriv->next; + } + + if (!portPriv) + return; + + if (!portPriv->ckeyFilled) + portPriv->ckeyFilled = RegionCreate(NULL, 0); + + if (!fillEverything) { + RegionNull(®); + fillboxes = ® + RegionSubtract(fillboxes, clipboxes, portPriv->ckeyFilled); + + if (!RegionNotEmpty(fillboxes)) + goto out; + } else + fillboxes = clipboxes; + + + RegionCopy(portPriv->ckeyFilled, clipboxes); + + xf86XVFillKeyHelperDrawable(pDraw, key, fillboxes); +out: + if (!fillEverything) + RegionUninit(®); +} + + /* xf86XVClipVideoHelper - Takes the dst box in standard X BoxRec form (top and left diff --git a/xorg-server/hw/xfree86/common/xf86xv.h b/xorg-server/hw/xfree86/common/xf86xv.h index 25f3e4ad3..08e5c790d 100644 --- a/xorg-server/hw/xfree86/common/xf86xv.h +++ b/xorg-server/hw/xfree86/common/xf86xv.h @@ -244,6 +244,9 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes); extern _X_EXPORT void xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes); +extern _X_EXPORT void +xf86XVFillKeyHelperPort (DrawablePtr pDraw, pointer data, CARD32 key, RegionPtr clipboxes, Bool fillEverything); + extern _X_EXPORT Bool xf86XVClipVideoHelper( BoxPtr dst, diff --git a/xorg-server/hw/xfree86/common/xf86xvpriv.h b/xorg-server/hw/xfree86/common/xf86xvpriv.h index 35d72ca9c..7eb46e51f 100644 --- a/xorg-server/hw/xfree86/common/xf86xvpriv.h +++ b/xorg-server/hw/xfree86/common/xf86xvpriv.h @@ -40,10 +40,10 @@ typedef struct { DestroyWindowProcPtr DestroyWindow; ClipNotifyProcPtr ClipNotify; WindowExposuresProcPtr WindowExposures; + PostValidateTreeProcPtr PostValidateTree; void (*AdjustFrame)(int, int, int, int); Bool (*EnterVT)(int, int); void (*LeaveVT)(int, int); - GCPtr videoGC; xf86ModeSetProc *ModeSet; } XF86XVScreenRec, *XF86XVScreenPtr; @@ -69,11 +69,12 @@ typedef struct { unsigned char type; unsigned int subWindowMode; RegionPtr clientClip; + RegionPtr ckeyFilled; RegionPtr pCompositeClip; Bool FreeCompositeClip; XvAdaptorRecPrivatePtr AdaptorRec; XvStatus isOn; - Bool moved; + Bool clipChanged; int vid_x, vid_y, vid_w, vid_h; int drw_x, drw_y, drw_w, drw_h; DevUnion DevPriv; @@ -82,7 +83,6 @@ typedef struct { typedef struct _XF86XVWindowRec{ XvPortRecPrivatePtr PortRec; struct _XF86XVWindowRec *next; - GCPtr pGC; } XF86XVWindowRec, *XF86XVWindowPtr; #endif /* _XF86XVPRIV_H_ */ diff --git a/xorg-server/hw/xfree86/dri2/dri2.c b/xorg-server/hw/xfree86/dri2/dri2.c index aba2202d6..7d6f772d7 100644 --- a/xorg-server/hw/xfree86/dri2/dri2.c +++ b/xorg-server/hw/xfree86/dri2/dri2.c @@ -403,7 +403,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, && (pDraw->height == pPriv->height) && (pPriv->serialNumber == DRI2DrawableSerial(pDraw)); - buffers = malloc((count + 1) * sizeof(buffers[0])); + buffers = calloc((count + 1), sizeof(buffers[0])); for (i = 0; i < count; i++) { const unsigned attachment = *(attachments++); diff --git a/xorg-server/hw/xfree86/fbdevhw/fbdevhw.c b/xorg-server/hw/xfree86/fbdevhw/fbdevhw.c index 49d0bd044..ef69d58bc 100644 --- a/xorg-server/hw/xfree86/fbdevhw/fbdevhw.c +++ b/xorg-server/hw/xfree86/fbdevhw/fbdevhw.c @@ -264,14 +264,7 @@ fbdev_open_pci(struct pci_device * pPci, char **namep) { struct fb_fix_screeninfo fix; char filename[256]; - int fd,i,j; - - - /* There are two ways to that we can determine which fb device is - * associated with this PCI device. The more modern way is to look in - * the sysfs directory for the PCI device for a file named - * "graphics/fb*" - */ + int fd, i; for (i = 0; i < 8; i++) { sprintf(filename, @@ -304,55 +297,10 @@ fbdev_open_pci(struct pci_device * pPci, char **namep) } } - - /* The other way is to examine the resources associated with each fb - * device and see if there is a match with the PCI device. This technique - * has some problems on certain mixed 64-bit / 32-bit architectures. - * There is a flaw in the fb_fix_screeninfo structure in that it only - * returns the low 32-bits of the address of the resources associated with - * a device. However, on a mixed architecture the base addresses of PCI - * devices, even for 32-bit applications, may be higher than 0x0f0000000. - */ - - for (i = 0; i < 8; i++) { - sprintf(filename,"/dev/fb%d",i); - if (-1 == (fd = open(filename,O_RDWR,0))) { - xf86DrvMsg(-1, X_WARNING, - "open %s: %s\n", filename, strerror(errno)); - continue; - } - if (-1 == ioctl(fd,FBIOGET_FSCREENINFO,(void*)&fix)) { - close(fd); - continue; - } - for (j = 0; j < 6; j++) { - const pciaddr_t res_start = pPci->regions[j].base_addr; - const pciaddr_t res_end = res_start + pPci->regions[j].size; - - if ((0 != fix.smem_len && - (pciaddr_t) fix.smem_start >= res_start && - (pciaddr_t) fix.smem_start < res_end) || - (0 != fix.mmio_len && - (pciaddr_t) fix.mmio_start >= res_start && - (pciaddr_t) fix.mmio_start < res_end)) - break; - } - if (j == 6) { - close(fd); - continue; - } - if (namep) { - *namep = xnfalloc(16); - strncpy(*namep,fix.id,16); - } - return fd; - } - if (namep) *namep = NULL; - xf86DrvMsg(-1, X_ERROR, - "Unable to find a valid framebuffer device\n"); + xf86DrvMsg(-1, X_ERROR, "Unable to find a valid framebuffer device\n"); return -1; } diff --git a/xorg-server/hw/xfree86/int10/helper_exec.c b/xorg-server/hw/xfree86/int10/helper_exec.c index b9af473b1..1043fcde7 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 -#endif - -#define PRINT_PORT 0 - -#include - -#include -#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 - -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), - 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 +#endif + +#define PRINT_PORT 0 + +#include + +#include +#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 + +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); +} diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.c b/xorg-server/hw/xfree86/modes/xf86Crtc.c index 47d3ad14c..d721b131f 100644 --- a/xorg-server/hw/xfree86/modes/xf86Crtc.c +++ b/xorg-server/hw/xfree86/modes/xf86Crtc.c @@ -1,3282 +1,3281 @@ -/* - * 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. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#else -#ifdef HAVE_CONFIG_H -#include -#endif -#endif - -#include -#include -#include - -#include "xf86.h" -#include "xf86DDC.h" -#include "xf86Crtc.h" -#include "xf86Modes.h" -#include "xf86Priv.h" -#include "xf86RandR12.h" -#include "X11/extensions/render.h" -#include "X11/extensions/dpmsconst.h" -#include "X11/Xatom.h" -#include "picturestr.h" - -#include "xf86xv.h" - -#define NO_OUTPUT_DEFAULT_WIDTH 1024 -#define NO_OUTPUT_DEFAULT_HEIGHT 768 -/* - * Initialize xf86CrtcConfig structure - */ - -int xf86CrtcConfigPrivateIndex = -1; - -void -xf86CrtcConfigInit (ScrnInfoPtr scrn, - const xf86CrtcConfigFuncsRec *funcs) -{ - xf86CrtcConfigPtr config; - - if (xf86CrtcConfigPrivateIndex == -1) - xf86CrtcConfigPrivateIndex = xf86AllocateScrnInfoPrivateIndex(); - config = xnfcalloc (1, sizeof (xf86CrtcConfigRec)); - - config->funcs = funcs; - - scrn->privates[xf86CrtcConfigPrivateIndex].ptr = config; -} - -void -xf86CrtcSetSizeRange (ScrnInfoPtr scrn, - int minWidth, int minHeight, - int maxWidth, int maxHeight) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - - config->minWidth = minWidth; - config->minHeight = minHeight; - config->maxWidth = maxWidth; - config->maxHeight = maxHeight; -} - -void -xf86CrtcSetScanoutFormats(ScrnInfoPtr scrn, - int num_formats, - xf86CrtcScanoutFormat *formats) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - - config->num_scanout_formats = num_formats; - config->scanout_formats = formats; -} - -/* - * Crtc functions - */ -xf86CrtcPtr -xf86CrtcCreate (ScrnInfoPtr scrn, - const xf86CrtcFuncsRec *funcs) -{ - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - xf86CrtcPtr crtc, *crtcs; - - crtc = calloc(sizeof (xf86CrtcRec), 1); - if (!crtc) - return NULL; - crtc->version = XF86_CRTC_VERSION; - crtc->scrn = scrn; - crtc->funcs = funcs; -#ifdef RANDR_12_INTERFACE - crtc->randr_crtc = NULL; -#endif - crtc->rotation = RR_Rotate_0; - crtc->desiredRotation = RR_Rotate_0; - pixman_transform_init_identity (&crtc->crtc_to_framebuffer); - pixman_f_transform_init_identity (&crtc->f_crtc_to_framebuffer); - pixman_f_transform_init_identity (&crtc->f_framebuffer_to_crtc); - pixman_f_transform_init_identity (&crtc->f_screen_to_crtc); - pixman_f_transform_init_identity (&crtc->user_sprite_position_transform); - pixman_f_transform_init_identity (&crtc->f_crtc_to_cursor); - pixman_f_transform_init_identity (&crtc->user_sprite_image_transform); - crtc->filter = NULL; - crtc->params = NULL; - crtc->nparams = 0; - crtc->filter_width = 0; - crtc->filter_height = 0; - crtc->transform_in_use = FALSE; - crtc->sprite_transform_in_use = FALSE; - crtc->transformPresent = FALSE; - crtc->desiredTransformPresent = FALSE; - memset (&crtc->bounds, '\0', sizeof (crtc->bounds)); - - /* Preallocate gamma at a sensible size. */ - crtc->gamma_size = 256; - crtc->gamma_red = malloc(3 * crtc->gamma_size * sizeof (CARD16)); - if (!crtc->gamma_red) { - free(crtc); - return NULL; - } - crtc->gamma_green = crtc->gamma_red + crtc->gamma_size; - crtc->gamma_blue = crtc->gamma_green + crtc->gamma_size; - - if (xf86_config->crtc) - crtcs = realloc(xf86_config->crtc, - (xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr)); - else - crtcs = malloc((xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr)); - if (!crtcs) - { - free(crtc); - return NULL; - } - xf86_config->crtc = crtcs; - xf86_config->crtc[xf86_config->num_crtc++] = crtc; - return crtc; -} - -void -xf86CrtcDestroy (xf86CrtcPtr crtc) -{ - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); - int c; - - (*crtc->funcs->destroy) (crtc); - for (c = 0; c < xf86_config->num_crtc; c++) - if (xf86_config->crtc[c] == crtc) - { - memmove (&xf86_config->crtc[c], - &xf86_config->crtc[c+1], - ((xf86_config->num_crtc - (c + 1)) * sizeof(void*))); - xf86_config->num_crtc--; - break; - } - free(crtc->params); - free(crtc->gamma_red); - free(crtc); -} - - -/** - * Return whether any outputs are connected to the specified pipe - */ - -Bool -xf86CrtcInUse (xf86CrtcPtr crtc) -{ - ScrnInfoPtr pScrn = crtc->scrn; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - int o; - - for (o = 0; o < xf86_config->num_output; o++) - if (xf86_config->output[o]->crtc == crtc) - return TRUE; - return FALSE; -} - -void -xf86CrtcSetScreenSubpixelOrder (ScreenPtr pScreen) -{ - int subpixel_order = SubPixelUnknown; - Bool has_none = FALSE; - ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - int c, o; - - for (c = 0; c < xf86_config->num_crtc; c++) - { - xf86CrtcPtr crtc = xf86_config->crtc[c]; - - for (o = 0; o < xf86_config->num_output; o++) - { - xf86OutputPtr output = xf86_config->output[o]; - - if (output->crtc == crtc) - { - switch (output->subpixel_order) { - case SubPixelNone: - has_none = TRUE; - break; - case SubPixelUnknown: - break; - default: - subpixel_order = output->subpixel_order; - break; - } - } - if (subpixel_order != SubPixelUnknown) - break; - } - if (subpixel_order != SubPixelUnknown) - { - static const int circle[4] = { - SubPixelHorizontalRGB, - SubPixelVerticalRGB, - SubPixelHorizontalBGR, - SubPixelVerticalBGR, - }; - int rotate; - int c; - for (rotate = 0; rotate < 4; rotate++) - if (crtc->rotation & (1 << rotate)) - break; - for (c = 0; c < 4; c++) - if (circle[c] == subpixel_order) - break; - c = (c + rotate) & 0x3; - if ((crtc->rotation & RR_Reflect_X) && !(c & 1)) - c ^= 2; - if ((crtc->rotation & RR_Reflect_Y) && (c & 1)) - c ^= 2; - subpixel_order = circle[c]; - break; - } - } - if (subpixel_order == SubPixelUnknown && has_none) - subpixel_order = SubPixelNone; - PictureSetSubpixelOrder (pScreen, subpixel_order); -} - -/** - * Sets the given video mode on the given crtc - */ -Bool -xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set) -{ - ScrnInfoPtr scrn = crtc->scrn; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - int i; - Bool ret = FALSE; - Bool didLock = FALSE; - DisplayModePtr adjusted_mode = NULL; - DisplayModeRec saved_mode; - int saved_x, saved_y; - Rotation saved_rotation; - RRTransformRec saved_transform; - Bool saved_transform_present; - PixmapPtr saved_scanout_pixmap; - - crtc->enabled = xf86CrtcInUse (crtc); - - /* We only hit this if someone explicitly sends a "disabled" modeset. */ - if (!crtc->enabled) - { - /* Check everything for stuff that should be off. */ - xf86DisableUnusedFunctions(scrn); - return TRUE; - } - - /* See if nothing has changed */ - if (!set->flags) - return TRUE; - - saved_mode = crtc->mode; - saved_x = crtc->x; - saved_y = crtc->y; - saved_rotation = crtc->rotation; - saved_scanout_pixmap = crtc->scanoutPixmap; - if (crtc->transformPresent) { - RRTransformInit (&saved_transform); - RRTransformCopy (&saved_transform, &crtc->transform); - } - saved_transform_present = crtc->transformPresent; - - /* Update crtc values up front so the driver can rely on them for mode - * setting. - */ - if (set->flags & XF86CrtcSetMode) - crtc->mode = *set->mode; - if (set->flags & XF86CrtcSetOrigin) { - crtc->x = set->x; - crtc->y = set->y; - } - if (set->flags & XF86CrtcSetRotation) - crtc->rotation = set->rotation; - if (set->flags & XF86CrtcSetScanoutPixmap) - crtc->scanoutPixmap = set->scanout_pixmap; - - if (set->flags & XF86CrtcSetTransform) { - if (set->transform) { - RRTransformCopy (&crtc->transform, set->transform); - crtc->transformPresent = TRUE; - } else - crtc->transformPresent = FALSE; - } - - if (crtc->funcs->set) { - ret = crtc->funcs->set(crtc, set->flags); - goto done; - } - - if (set->flags == XF86CrtcSetOrigin && crtc->funcs->set_origin) { - ret = xf86CrtcRotate(crtc); - if (ret) - crtc->funcs->set_origin(crtc, crtc->x, crtc->y); - goto done; - } - - if (crtc->funcs->set_mode_major) { - ret = crtc->funcs->set_mode_major(crtc, &crtc->mode, - crtc->rotation, - crtc->x, crtc->y); - goto done; - } - - adjusted_mode = xf86DuplicateMode(&crtc->mode); - - didLock = crtc->funcs->lock (crtc); - /* Pass our mode to the outputs and the CRTC to give them a chance to - * adjust it according to limitations or output properties, and also - * a chance to reject the mode entirely. - */ - for (i = 0; i < xf86_config->num_output; i++) { - xf86OutputPtr output = xf86_config->output[i]; - - if (output->crtc != crtc) - continue; - - if (!output->funcs->mode_fixup(output, &crtc->mode, adjusted_mode)) { - goto done; - } - } - - if (!crtc->funcs->mode_fixup(crtc, &crtc->mode, adjusted_mode)) { - goto done; - } - - if (!xf86CrtcRotate (crtc)) - goto done; - - /* Prepare the outputs and CRTCs before setting the mode. */ - for (i = 0; i < xf86_config->num_output; i++) { - xf86OutputPtr output = xf86_config->output[i]; - - if (output->crtc != crtc) - continue; - - /* Disable the output as the first thing we do. */ - output->funcs->prepare(output); - } - - crtc->funcs->prepare(crtc); - - /* Set up the DPLL and any output state that needs to adjust or depend - * on the DPLL. - */ - crtc->funcs->mode_set(crtc, &crtc->mode, adjusted_mode, crtc->x, crtc->y); - for (i = 0; i < xf86_config->num_output; i++) - { - xf86OutputPtr output = xf86_config->output[i]; - if (output->crtc == crtc) - output->funcs->mode_set(output, &crtc->mode, adjusted_mode); - } - - /* Only upload when needed, to avoid unneeded delays. */ - if (!crtc->active && crtc->funcs->gamma_set) - crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green, - crtc->gamma_blue, crtc->gamma_size); - - /* Now, enable the clocks, plane, pipe, and outputs that we set up. */ - crtc->funcs->commit(crtc); - for (i = 0; i < xf86_config->num_output; i++) - { - xf86OutputPtr output = xf86_config->output[i]; - if (output->crtc == crtc) - output->funcs->commit(output); - } - - ret = TRUE; - -done: - if (ret) { - crtc->active = TRUE; - if (scrn->pScreen) - xf86CrtcSetScreenSubpixelOrder (scrn->pScreen); - if (scrn->ModeSet) - scrn->ModeSet(scrn); - } else { - crtc->x = saved_x; - crtc->y = saved_y; - crtc->rotation = saved_rotation; - crtc->mode = saved_mode; - if (saved_transform_present) - RRTransformCopy (&crtc->transform, &saved_transform); - crtc->transformPresent = saved_transform_present; - crtc->scanoutPixmap = saved_scanout_pixmap; - } - - if (adjusted_mode) { - free(adjusted_mode->name); - free(adjusted_mode); - } - - if (didLock) - crtc->funcs->unlock (crtc); - - return ret; -} - -/** - * Pans the screen, does not change the mode - */ -void -xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y) -{ - xf86CrtcSetRec set; - - if (x != crtc->x || y != crtc->y) { - set.x = x; - set.y = y; - set.flags = XF86CrtcSetOrigin; - (void) xf86CrtcSet(crtc, &set); - } -} - -/* - * Output functions - */ - -extern XF86ConfigPtr xf86configptr; - -typedef enum { - OPTION_PREFERRED_MODE, - OPTION_POSITION, - OPTION_BELOW, - OPTION_RIGHT_OF, - OPTION_ABOVE, - OPTION_LEFT_OF, - OPTION_ENABLE, - OPTION_DISABLE, - OPTION_MIN_CLOCK, - OPTION_MAX_CLOCK, - OPTION_IGNORE, - OPTION_ROTATE, - OPTION_PANNING, - OPTION_PRIMARY, - OPTION_DEFAULT_MODES, -} OutputOpts; - -static OptionInfoRec xf86OutputOptions[] = { - {OPTION_PREFERRED_MODE, "PreferredMode", OPTV_STRING, {0}, FALSE }, - {OPTION_POSITION, "Position", OPTV_STRING, {0}, FALSE }, - {OPTION_BELOW, "Below", OPTV_STRING, {0}, FALSE }, - {OPTION_RIGHT_OF, "RightOf", OPTV_STRING, {0}, FALSE }, - {OPTION_ABOVE, "Above", OPTV_STRING, {0}, FALSE }, - {OPTION_LEFT_OF, "LeftOf", OPTV_STRING, {0}, FALSE }, - {OPTION_ENABLE, "Enable", OPTV_BOOLEAN, {0}, FALSE }, - {OPTION_DISABLE, "Disable", OPTV_BOOLEAN, {0}, FALSE }, - {OPTION_MIN_CLOCK, "MinClock", OPTV_FREQ, {0}, FALSE }, - {OPTION_MAX_CLOCK, "MaxClock", OPTV_FREQ, {0}, FALSE }, - {OPTION_IGNORE, "Ignore", OPTV_BOOLEAN, {0}, FALSE }, - {OPTION_ROTATE, "Rotate", OPTV_STRING, {0}, FALSE }, - {OPTION_PANNING, "Panning", OPTV_STRING, {0}, FALSE }, - {OPTION_PRIMARY, "Primary", OPTV_BOOLEAN, {0}, FALSE }, - {OPTION_DEFAULT_MODES, "DefaultModes", OPTV_BOOLEAN, {0}, FALSE }, - {-1, NULL, OPTV_NONE, {0}, FALSE }, -}; - -enum { - OPTION_MODEDEBUG, -}; - -static OptionInfoRec xf86DeviceOptions[] = { - {OPTION_MODEDEBUG, "ModeDebug", OPTV_BOOLEAN, {0}, FALSE }, - {-1, NULL, OPTV_NONE, {0}, FALSE }, -}; - -static void -xf86OutputSetMonitor (xf86OutputPtr output) -{ - char *option_name; - char *monitor; - - if (!output->name) - return; - - free(output->options); - - output->options = xnfalloc (sizeof (xf86OutputOptions)); - memcpy (output->options, xf86OutputOptions, sizeof (xf86OutputOptions)); - - XNFasprintf(&option_name, "monitor-%s", output->name); - monitor = xf86findOptionValue (output->scrn->options, option_name); - if (!monitor) - monitor = output->name; - else - xf86MarkOptionUsedByName (output->scrn->options, option_name); - free(option_name); - output->conf_monitor = xf86findMonitor (monitor, - xf86configptr->conf_monitor_lst); - /* - * Find the monitor section of the screen and use that - */ - if (!output->conf_monitor && output->use_screen_monitor) - output->conf_monitor = xf86findMonitor (output->scrn->monitor->id, - xf86configptr->conf_monitor_lst); - if (output->conf_monitor) - { - xf86DrvMsg (output->scrn->scrnIndex, X_INFO, - "Output %s using monitor section %s\n", - output->name, output->conf_monitor->mon_identifier); - xf86ProcessOptions (output->scrn->scrnIndex, - output->conf_monitor->mon_option_lst, - output->options); - } - else - xf86DrvMsg (output->scrn->scrnIndex, X_INFO, - "Output %s has no monitor section\n", - output->name); -} - -static Bool -xf86OutputEnabled (xf86OutputPtr output, Bool strict) -{ - Bool enable, disable; - - /* check to see if this output was enabled in the config file */ - if (xf86GetOptValBool (output->options, OPTION_ENABLE, &enable) && enable) - { - xf86DrvMsg (output->scrn->scrnIndex, X_INFO, - "Output %s enabled by config file\n", output->name); - return TRUE; - } - /* or if this output was disabled in the config file */ - if (xf86GetOptValBool (output->options, OPTION_DISABLE, &disable) && disable) - { - xf86DrvMsg (output->scrn->scrnIndex, X_INFO, - "Output %s disabled by config file\n", output->name); - return FALSE; - } - - /* If not, try to only light up the ones we know are connected */ - if (strict) { - enable = output->status == XF86OutputStatusConnected; - } - /* But if that fails, try to light up even outputs we're unsure of */ - else { - enable = output->status != XF86OutputStatusDisconnected; - } - - xf86DrvMsg (output->scrn->scrnIndex, X_INFO, - "Output %s %sconnected\n", output->name, enable ? "" : "dis"); - return enable; -} - -static Bool -xf86OutputIgnored (xf86OutputPtr output) -{ - return xf86ReturnOptValBool (output->options, OPTION_IGNORE, FALSE); -} - -static char *direction[4] = { - "normal", - "left", - "inverted", - "right" -}; - -static Rotation -xf86OutputInitialRotation (xf86OutputPtr output) -{ - char *rotate_name = xf86GetOptValString (output->options, - OPTION_ROTATE); - int i; - - if (!rotate_name) { - if (output->initial_rotation) - return output->initial_rotation; - return RR_Rotate_0; - } - - for (i = 0; i < 4; i++) - if (xf86nameCompare (direction[i], rotate_name) == 0) - return 1 << i; - return RR_Rotate_0; -} - -xf86OutputPtr -xf86OutputCreate (ScrnInfoPtr scrn, - const xf86OutputFuncsRec *funcs, - const char *name) -{ - xf86OutputPtr output, *outputs; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - int len; - Bool primary; - - if (name) - len = strlen (name) + 1; - else - len = 0; - - output = calloc(sizeof (xf86OutputRec) + len, 1); - if (!output) - return NULL; - output->scrn = scrn; - output->funcs = funcs; - if (name) - { - output->name = (char *) (output + 1); - strcpy (output->name, name); - } - output->subpixel_order = SubPixelUnknown; - /* - * Use the old per-screen monitor section for the first output - */ - output->use_screen_monitor = (xf86_config->num_output == 0); -#ifdef RANDR_12_INTERFACE - output->randr_output = NULL; -#endif - if (name) - { - xf86OutputSetMonitor (output); - if (xf86OutputIgnored (output)) - { - free(output); - return FALSE; - } - } - - - if (xf86_config->output) - outputs = realloc(xf86_config->output, - (xf86_config->num_output + 1) * sizeof (xf86OutputPtr)); - else - outputs = malloc((xf86_config->num_output + 1) * sizeof (xf86OutputPtr)); - if (!outputs) - { - free(output); - return NULL; - } - - xf86_config->output = outputs; - - if (xf86GetOptValBool (output->options, OPTION_PRIMARY, &primary) && primary) - { - memmove(xf86_config->output + 1, xf86_config->output, - xf86_config->num_output * sizeof (xf86OutputPtr)); - xf86_config->output[0] = output; - } - else - { - xf86_config->output[xf86_config->num_output] = output; - } - - xf86_config->num_output++; - - return output; -} - -Bool -xf86OutputRename (xf86OutputPtr output, const char *name) -{ - char *newname = strdup(name); - - if (!newname) - return FALSE; /* so sorry... */ - - if (output->name && output->name != (char *) (output + 1)) - free(output->name); - output->name = newname; - xf86OutputSetMonitor (output); - if (xf86OutputIgnored (output)) - return FALSE; - return TRUE; -} - -void -xf86OutputUseScreenMonitor (xf86OutputPtr output, Bool use_screen_monitor) -{ - if (use_screen_monitor != output->use_screen_monitor) - { - output->use_screen_monitor = use_screen_monitor; - xf86OutputSetMonitor (output); - } -} - -void -xf86OutputDestroy (xf86OutputPtr output) -{ - ScrnInfoPtr scrn = output->scrn; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - int o; - - (*output->funcs->destroy) (output); - while (output->probed_modes) - xf86DeleteMode (&output->probed_modes, output->probed_modes); - for (o = 0; o < xf86_config->num_output; o++) - if (xf86_config->output[o] == output) - { - memmove (&xf86_config->output[o], - &xf86_config->output[o+1], - ((xf86_config->num_output - (o + 1)) * sizeof(void*))); - xf86_config->num_output--; - break; - } - if (output->name && output->name != (char *) (output + 1)) - free(output->name); - free(output); -} - -/* - * Called during CreateScreenResources to hook up RandR - */ -static Bool -xf86CrtcCreateScreenResources (ScreenPtr screen) -{ - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - - screen->CreateScreenResources = config->CreateScreenResources; - - if (!(*screen->CreateScreenResources)(screen)) - return FALSE; - - if (!xf86RandR12CreateScreenResources (screen)) - return FALSE; - - return TRUE; -} - -/* - * Clean up config on server reset - */ -static Bool -xf86CrtcCloseScreen (int index, ScreenPtr screen) -{ - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int o, c; - - screen->CloseScreen = config->CloseScreen; - - xf86RotateCloseScreen (screen); - - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - - output->randr_output = NULL; - } - for (c = 0; c < config->num_crtc; c++) - { - xf86CrtcPtr crtc = config->crtc[c]; - - crtc->randr_crtc = NULL; - } - xf86RandR12CloseScreen (screen); - - return screen->CloseScreen (index, screen); -} - -/* - * Called at ScreenInit time to set up - */ -#ifdef RANDR_13_INTERFACE -int -#else -Bool -#endif -xf86CrtcScreenInit (ScreenPtr screen) -{ - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int c; - - /* Rotation */ - xf86DrvMsg(scrn->scrnIndex, X_INFO, "RandR 1.2 enabled, ignore the following RandR disabled message.\n"); - xf86DisableRandR(); /* Disable old RandR extension support */ - xf86RandR12Init (screen); - - /* support all rotations if every crtc has the shadow alloc funcs */ - for (c = 0; c < config->num_crtc; c++) - { - xf86CrtcPtr crtc = config->crtc[c]; - if (!crtc->funcs->shadow_allocate || !crtc->funcs->shadow_create) - break; - } - if (c == config->num_crtc) - { - xf86RandR12SetRotations (screen, RR_Rotate_0 | RR_Rotate_90 | - RR_Rotate_180 | RR_Rotate_270 | - RR_Reflect_X | RR_Reflect_Y); - xf86RandR12SetTransformSupport (screen, TRUE); - } - else - { - xf86RandR12SetRotations (screen, RR_Rotate_0); - xf86RandR12SetTransformSupport (screen, FALSE); - } - - /* Wrap CreateScreenResources so we can initialize the RandR code */ - config->CreateScreenResources = screen->CreateScreenResources; - screen->CreateScreenResources = xf86CrtcCreateScreenResources; - - config->CloseScreen = screen->CloseScreen; - screen->CloseScreen = xf86CrtcCloseScreen; - -#ifdef XFreeXDGA - _xf86_di_dga_init_internal(screen); -#endif -#ifdef RANDR_13_INTERFACE - return RANDR_INTERFACE_VERSION; -#else - return TRUE; -#endif -} - -static DisplayModePtr -xf86DefaultMode (xf86OutputPtr output, int width, int height) -{ - DisplayModePtr target_mode = NULL; - DisplayModePtr mode; - int target_diff = 0; - int target_preferred = 0; - int mm_height; - - mm_height = output->mm_height; - if (!mm_height) - mm_height = (768 * 25.4) / DEFAULT_DPI; - /* - * Pick a mode closest to DEFAULT_DPI - */ - for (mode = output->probed_modes; mode; mode = mode->next) - { - int dpi; - int preferred = (((mode->type & M_T_PREFERRED) != 0) + - ((mode->type & M_T_USERPREF) != 0)); - int diff; - - if (xf86ModeWidth (mode, output->initial_rotation) > width || - xf86ModeHeight (mode, output->initial_rotation) > height) - continue; - - /* yes, use VDisplay here, not xf86ModeHeight */ - dpi = (mode->VDisplay * 254) / (mm_height * 10); - diff = dpi - DEFAULT_DPI; - diff = diff < 0 ? -diff : diff; - if (target_mode == NULL || (preferred > target_preferred) || - (preferred == target_preferred && diff < target_diff)) - { - target_mode = mode; - target_diff = diff; - target_preferred = preferred; - } - } - return target_mode; -} - -static DisplayModePtr -xf86ClosestMode (xf86OutputPtr output, - DisplayModePtr match, Rotation match_rotation, - int width, int height) -{ - DisplayModePtr target_mode = NULL; - DisplayModePtr mode; - int target_diff = 0; - - /* - * Pick a mode closest to the specified mode - */ - for (mode = output->probed_modes; mode; mode = mode->next) - { - int dx, dy; - int diff; - - if (xf86ModeWidth (mode, output->initial_rotation) > width || - xf86ModeHeight (mode, output->initial_rotation) > height) - continue; - - /* exact matches are preferred */ - if (output->initial_rotation == match_rotation && - xf86ModesEqual (mode, match)) - return mode; - - dx = xf86ModeWidth (match, match_rotation) - xf86ModeWidth (mode, output->initial_rotation); - dy = xf86ModeHeight (match, match_rotation) - xf86ModeHeight (mode, output->initial_rotation); - diff = dx * dx + dy * dy; - if (target_mode == NULL || diff < target_diff) - { - target_mode = mode; - target_diff = diff; - } - } - return target_mode; -} - -static DisplayModePtr -xf86OutputHasPreferredMode (xf86OutputPtr output, int width, int height) -{ - DisplayModePtr mode; - - for (mode = output->probed_modes; mode; mode = mode->next) - { - if (xf86ModeWidth (mode, output->initial_rotation) > width || - xf86ModeHeight (mode, output->initial_rotation) > height) - continue; - - if (mode->type & M_T_PREFERRED) - return mode; - } - return NULL; -} - -static DisplayModePtr -xf86OutputHasUserPreferredMode (xf86OutputPtr output) -{ - DisplayModePtr mode, first = output->probed_modes; - - for (mode = first; mode && mode->next != first; mode = mode->next) - if (mode->type & M_T_USERPREF) - return mode; - - return NULL; -} - -static int -xf86PickCrtcs (ScrnInfoPtr scrn, - xf86CrtcPtr *best_crtcs, - DisplayModePtr *modes, - int n, - int width, - int height) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int c, o; - xf86OutputPtr output; - xf86CrtcPtr crtc; - xf86CrtcPtr *crtcs; - xf86CrtcPtr best_crtc; - int best_score; - int score; - int my_score; - - if (n == config->num_output) - return 0; - output = config->output[n]; - - /* - * Compute score with this output disabled - */ - best_crtcs[n] = NULL; - best_crtc = NULL; - best_score = xf86PickCrtcs (scrn, best_crtcs, modes, n+1, width, height); - if (modes[n] == NULL) - return best_score; - - crtcs = malloc(config->num_output * sizeof (xf86CrtcPtr)); - if (!crtcs) - return best_score; - - my_score = 1; - /* Score outputs that are known to be connected higher */ - if (output->status == XF86OutputStatusConnected) - my_score++; - /* Score outputs with preferred modes higher */ - if (xf86OutputHasPreferredMode (output, width, height)) - my_score++; - /* - * Select a crtc for this output and - * then attempt to configure the remaining - * outputs - */ - for (c = 0; c < config->num_crtc; c++) - { - if ((output->possible_crtcs & (1 << c)) == 0) - continue; - - crtc = config->crtc[c]; - /* - * Check to see if some other output is - * using this crtc - */ - for (o = 0; o < n; o++) - if (best_crtcs[o] == crtc) - break; - if (o < n) - { - /* - * If the two outputs desire the same mode, - * see if they can be cloned - */ - if (xf86ModesEqual (modes[o], modes[n]) && - config->output[o]->initial_rotation == config->output[n]->initial_rotation && - config->output[o]->initial_x == config->output[n]->initial_x && - config->output[o]->initial_y == config->output[n]->initial_y) - { - if ((output->possible_clones & (1 << o)) == 0) - continue; /* nope, try next CRTC */ - } - else - continue; /* different modes, can't clone */ - } - crtcs[n] = crtc; - memcpy (crtcs, best_crtcs, n * sizeof (xf86CrtcPtr)); - score = my_score + xf86PickCrtcs (scrn, crtcs, modes, n+1, width, height); - if (score > best_score) - { - best_crtc = crtc; - best_score = score; - memcpy (best_crtcs, crtcs, config->num_output * sizeof (xf86CrtcPtr)); - } - } - free(crtcs); - return best_score; -} - - -/* - * Compute the virtual size necessary to place all of the available - * crtcs in the specified configuration. - * - * canGrow indicates that the driver can make the screen larger than its initial - * configuration. If FALSE, this function will enlarge the screen to include - * the largest available mode. - */ - -static void -xf86DefaultScreenLimits (ScrnInfoPtr scrn, int *widthp, int *heightp, - Bool canGrow) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int width = 0, height = 0; - int o; - int c; - int s; - - for (c = 0; c < config->num_crtc; c++) - { - int crtc_width = 0, crtc_height = 0; - xf86CrtcPtr crtc = config->crtc[c]; - - if (crtc->enabled) - { - crtc_width = crtc->desiredX + xf86ModeWidth (&crtc->desiredMode, crtc->desiredRotation); - crtc_height = crtc->desiredY + xf86ModeHeight (&crtc->desiredMode, crtc->desiredRotation); - } - if (!canGrow) { - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - - for (s = 0; s < config->num_crtc; s++) - if (output->possible_crtcs & (1 << s)) - { - DisplayModePtr mode; - for (mode = output->probed_modes; mode; mode = mode->next) - { - if (mode->HDisplay > crtc_width) - crtc_width = mode->HDisplay; - if (mode->VDisplay > crtc_width) - crtc_width = mode->VDisplay; - if (mode->VDisplay > crtc_height) - crtc_height = mode->VDisplay; - if (mode->HDisplay > crtc_height) - crtc_height = mode->HDisplay; - } - } - } - } - if (crtc_width > width) - width = crtc_width; - if (crtc_height > height) - height = crtc_height; - } - if (config->maxWidth && width > config->maxWidth) width = config->maxWidth; - if (config->maxHeight && height > config->maxHeight) height = config->maxHeight; - if (config->minWidth && width < config->minWidth) width = config->minWidth; - if (config->minHeight && height < config->minHeight) height = config->minHeight; - *widthp = width; - *heightp = height; -} - -#define POSITION_UNSET -100000 - -/* - * check if the user configured any outputs at all - * with either a position or a relative setting or a mode. - */ -static Bool -xf86UserConfiguredOutputs(ScrnInfoPtr scrn, DisplayModePtr *modes) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int o; - Bool user_conf = FALSE; - - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - char *position; - char *relative_name; - OutputOpts relation; - int r; - static const OutputOpts relations[] = { - OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF - }; - - position = xf86GetOptValString (output->options, - OPTION_POSITION); - if (position) - user_conf = TRUE; - - relation = 0; - relative_name = NULL; - for (r = 0; r < 4; r++) - { - relation = relations[r]; - relative_name = xf86GetOptValString (output->options, - relation); - if (relative_name) - break; - } - if (relative_name) - user_conf = TRUE; - - modes[o] = xf86OutputHasUserPreferredMode(output); - if (modes[o]) - user_conf = TRUE; - } - - return user_conf; -} - -static Bool -xf86InitialOutputPositions (ScrnInfoPtr scrn, DisplayModePtr *modes) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int o; - int min_x, min_y; - - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - - output->initial_x = output->initial_y = POSITION_UNSET; - } - - /* - * Loop until all outputs are set - */ - for (;;) - { - Bool any_set = FALSE; - Bool keep_going = FALSE; - - for (o = 0; o < config->num_output; o++) - { - static const OutputOpts relations[] = { - OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF - }; - xf86OutputPtr output = config->output[o]; - xf86OutputPtr relative; - char *relative_name; - char *position; - OutputOpts relation; - int r; - - if (output->initial_x != POSITION_UNSET) - continue; - position = xf86GetOptValString (output->options, - OPTION_POSITION); - /* - * Absolute position wins - */ - if (position) - { - int x, y; - if (sscanf (position, "%d %d", &x, &y) == 2) - { - output->initial_x = x; - output->initial_y = y; - } - else - { - xf86DrvMsg (scrn->scrnIndex, X_ERROR, - "Output %s position not of form \"x y\"\n", - output->name); - output->initial_x = output->initial_y = 0; - } - any_set = TRUE; - continue; - } - /* - * Next comes relative positions - */ - relation = 0; - relative_name = NULL; - for (r = 0; r < 4; r++) - { - relation = relations[r]; - relative_name = xf86GetOptValString (output->options, - relation); - if (relative_name) - break; - } - if (relative_name) - { - int or; - relative = NULL; - for (or = 0; or < config->num_output; or++) - { - xf86OutputPtr out_rel = config->output[or]; - XF86ConfMonitorPtr rel_mon = out_rel->conf_monitor; - - if (rel_mon) - { - if (xf86nameCompare (rel_mon->mon_identifier, - relative_name) == 0) - { - relative = config->output[or]; - break; - } - } - if (strcmp (out_rel->name, relative_name) == 0) - { - relative = config->output[or]; - break; - } - } - if (!relative) - { - xf86DrvMsg (scrn->scrnIndex, X_ERROR, - "Cannot position output %s relative to unknown output %s\n", - output->name, relative_name); - output->initial_x = 0; - output->initial_y = 0; - any_set = TRUE; - continue; - } - if (!modes[or]) - { - xf86DrvMsg (scrn->scrnIndex, X_ERROR, - "Cannot position output %s relative to output %s without modes\n", - output->name, relative_name); - output->initial_x = 0; - output->initial_y = 0; - any_set = TRUE; - continue; - } - if (relative->initial_x == POSITION_UNSET) - { - keep_going = TRUE; - continue; - } - output->initial_x = relative->initial_x; - output->initial_y = relative->initial_y; - switch (relation) { - case OPTION_BELOW: - output->initial_y += xf86ModeHeight (modes[or], relative->initial_rotation); - break; - case OPTION_RIGHT_OF: - output->initial_x += xf86ModeWidth (modes[or], relative->initial_rotation); - break; - case OPTION_ABOVE: - if (modes[o]) - output->initial_y -= xf86ModeHeight (modes[o], output->initial_rotation); - break; - case OPTION_LEFT_OF: - if (modes[o]) - output->initial_x -= xf86ModeWidth (modes[o], output->initial_rotation); - break; - default: - break; - } - any_set = TRUE; - continue; - } - - /* Nothing set, just stick them at 0,0 */ - output->initial_x = 0; - output->initial_y = 0; - any_set = TRUE; - } - if (!keep_going) - break; - if (!any_set) - { - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - if (output->initial_x == POSITION_UNSET) - { - xf86DrvMsg (scrn->scrnIndex, X_ERROR, - "Output position loop. Moving %s to 0,0\n", - output->name); - output->initial_x = output->initial_y = 0; - break; - } - } - } - } - - /* - * normalize positions - */ - min_x = 1000000; - min_y = 1000000; - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - - if (output->initial_x < min_x) - min_x = output->initial_x; - if (output->initial_y < min_y) - min_y = output->initial_y; - } - - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - - output->initial_x -= min_x; - output->initial_y -= min_y; - } - return TRUE; -} - -static void -xf86InitialPanning (ScrnInfoPtr scrn) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int o; - - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - char *panning = xf86GetOptValString (output->options, OPTION_PANNING); - int width, height, left, top; - int track_width, track_height, track_left, track_top; - int brdr[4]; - - memset (&output->initialTotalArea, 0, sizeof(BoxRec)); - memset (&output->initialTrackingArea, 0, sizeof(BoxRec)); - memset (output->initialBorder, 0, 4*sizeof(INT16)); - - if (! panning) - continue; - - switch (sscanf (panning, "%dx%d+%d+%d/%dx%d+%d+%d/%d/%d/%d/%d", - &width, &height, &left, &top, - &track_width, &track_height, &track_left, &track_top, - &brdr[0], &brdr[1], &brdr[2], &brdr[3])) { - case 12: - output->initialBorder[0] = brdr[0]; - output->initialBorder[1] = brdr[1]; - output->initialBorder[2] = brdr[2]; - output->initialBorder[3] = brdr[3]; - /* fall through */ - case 8: - output->initialTrackingArea.x1 = track_left; - output->initialTrackingArea.y1 = track_top; - output->initialTrackingArea.x2 = track_left + track_width; - output->initialTrackingArea.y2 = track_top + track_height; - /* fall through */ - case 4: - output->initialTotalArea.x1 = left; - output->initialTotalArea.y1 = top; - /* fall through */ - case 2: - output->initialTotalArea.x2 = output->initialTotalArea.x1 + width; - output->initialTotalArea.y2 = output->initialTotalArea.y1 + height; - break; - default: - xf86DrvMsg (scrn->scrnIndex, X_ERROR, - "Broken panning specification '%s' for output %s in config file\n", - panning, output->name); - } - } -} - -/** Return - 0 + if a should be earlier, same or later than b in list - */ -static int -xf86ModeCompare (DisplayModePtr a, DisplayModePtr b) -{ - int diff; - - diff = ((b->type & M_T_PREFERRED) != 0) - ((a->type & M_T_PREFERRED) != 0); - if (diff) - return diff; - diff = b->HDisplay * b->VDisplay - a->HDisplay * a->VDisplay; - if (diff) - return diff; - diff = b->Clock - a->Clock; - return diff; -} - -/** - * Insertion sort input in-place and return the resulting head - */ -static DisplayModePtr -xf86SortModes (DisplayModePtr input) -{ - DisplayModePtr output = NULL, i, o, n, *op, prev; - - /* sort by preferred status and pixel area */ - while (input) - { - i = input; - input = input->next; - for (op = &output; (o = *op); op = &o->next) - if (xf86ModeCompare (o, i) > 0) - break; - i->next = *op; - *op = i; - } - /* prune identical modes */ - for (o = output; o && (n = o->next); o = n) - { - if (!strcmp (o->name, n->name) && xf86ModesEqual (o, n)) - { - o->next = n->next; - free(n->name); - free(n); - n = o; - } - } - /* hook up backward links */ - prev = NULL; - for (o = output; o; o = o->next) - { - o->prev = prev; - prev = o; - } - return output; -} - -static char * -preferredMode(ScrnInfoPtr pScrn, xf86OutputPtr output) -{ - char *preferred_mode = NULL; - - /* Check for a configured preference for a particular mode */ - preferred_mode = xf86GetOptValString (output->options, - OPTION_PREFERRED_MODE); - if (preferred_mode) - return preferred_mode; - - if (pScrn->display->modes && *pScrn->display->modes) - preferred_mode = *pScrn->display->modes; - - return preferred_mode; -} - -static void -GuessRangeFromModes(MonPtr mon, DisplayModePtr mode) -{ - if (!mon || !mode) - return; - - mon->nHsync = 1; - mon->hsync[0].lo = 1024.0; - mon->hsync[0].hi = 0.0; - - mon->nVrefresh = 1; - mon->vrefresh[0].lo = 1024.0; - mon->vrefresh[0].hi = 0.0; - - while (mode) { - if (!mode->HSync) - mode->HSync = ((float) mode->Clock ) / ((float) mode->HTotal); - - if (!mode->VRefresh) - mode->VRefresh = (1000.0 * ((float) mode->Clock)) / - ((float) (mode->HTotal * mode->VTotal)); - - if (mode->HSync < mon->hsync[0].lo) - mon->hsync[0].lo = mode->HSync; - - if (mode->HSync > mon->hsync[0].hi) - mon->hsync[0].hi = mode->HSync; - - if (mode->VRefresh < mon->vrefresh[0].lo) - mon->vrefresh[0].lo = mode->VRefresh; - - if (mode->VRefresh > mon->vrefresh[0].hi) - mon->vrefresh[0].hi = mode->VRefresh; - - mode = mode->next; - } - - /* stretch out the bottom to fit 640x480@60 */ - if (mon->hsync[0].lo > 31.0) - mon->hsync[0].lo = 31.0; - if (mon->vrefresh[0].lo > 58.0) - mon->vrefresh[0].lo = 58.0; -} - -enum det_monrec_source { - sync_config, sync_edid, sync_default -}; - -struct det_monrec_parameter { - MonRec *mon_rec; - int *max_clock; - Bool set_hsync; - Bool set_vrefresh; - enum det_monrec_source *sync_source; -}; - -static void handle_detailed_monrec(struct detailed_monitor_section *det_mon, - void *data) -{ - enum { sync_config, sync_edid, sync_default }; - struct det_monrec_parameter *p; - p = (struct det_monrec_parameter *)data; - - if (det_mon->type == DS_RANGES) { - struct monitor_ranges *ranges = &det_mon->section.ranges; - if (p->set_hsync && ranges->max_h) { - p->mon_rec->hsync[p->mon_rec->nHsync].lo = ranges->min_h; - p->mon_rec->hsync[p->mon_rec->nHsync].hi = ranges->max_h; - p->mon_rec->nHsync++; - if (*p->sync_source == sync_default) - *p->sync_source = sync_edid; - } - if (p->set_vrefresh && ranges->max_v) { - p->mon_rec->vrefresh[p->mon_rec->nVrefresh].lo = ranges->min_v; - p->mon_rec->vrefresh[p->mon_rec->nVrefresh].hi = ranges->max_v; - p->mon_rec->nVrefresh++; - if (*p->sync_source == sync_default) - *p->sync_source = sync_edid; - } - if (ranges->max_clock * 1000 > *p->max_clock) - *p->max_clock = ranges->max_clock * 1000; - } -} - -void -xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int o; - - /* When canGrow was TRUE in the initial configuration we have to - * compare against the maximum values so that we don't drop modes. - * When canGrow was FALSE, the maximum values would have been clamped - * anyway. - */ - if (maxX == 0 || maxY == 0) { - maxX = config->maxWidth; - maxY = config->maxHeight; - } - - /* Probe the list of modes for each output. */ - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - DisplayModePtr mode; - DisplayModePtr config_modes = NULL, output_modes, default_modes = NULL; - char *preferred_mode; - xf86MonPtr edid_monitor; - XF86ConfMonitorPtr conf_monitor; - MonRec mon_rec; - int min_clock = 0; - int max_clock = 0; - double clock; - Bool add_default_modes = xf86ReturnOptValBool(output->options, OPTION_DEFAULT_MODES, TRUE); - Bool debug_modes = config->debug_modes || - xf86Initialising; - enum det_monrec_source sync_source = sync_default; - - while (output->probed_modes != NULL) - xf86DeleteMode(&output->probed_modes, output->probed_modes); - - /* - * Check connection status - */ - output->status = (*output->funcs->detect)(output); - - if (output->status == XF86OutputStatusDisconnected && - !xf86ReturnOptValBool(output->options, OPTION_ENABLE, FALSE)) - { - xf86OutputSetEDID (output, NULL); - continue; - } - - memset (&mon_rec, '\0', sizeof (mon_rec)); - - conf_monitor = output->conf_monitor; - - if (conf_monitor) - { - int i; - - for (i = 0; i < conf_monitor->mon_n_hsync; i++) - { - mon_rec.hsync[mon_rec.nHsync].lo = conf_monitor->mon_hsync[i].lo; - mon_rec.hsync[mon_rec.nHsync].hi = conf_monitor->mon_hsync[i].hi; - mon_rec.nHsync++; - sync_source = sync_config; - } - for (i = 0; i < conf_monitor->mon_n_vrefresh; i++) - { - mon_rec.vrefresh[mon_rec.nVrefresh].lo = conf_monitor->mon_vrefresh[i].lo; - mon_rec.vrefresh[mon_rec.nVrefresh].hi = conf_monitor->mon_vrefresh[i].hi; - mon_rec.nVrefresh++; - sync_source = sync_config; - } - config_modes = xf86GetMonitorModes (scrn, conf_monitor); - } - - output_modes = (*output->funcs->get_modes) (output); - - edid_monitor = output->MonInfo; - - if (edid_monitor) - { - struct det_monrec_parameter p; - struct disp_features *features = &edid_monitor->features; - - /* if display is not continuous-frequency, don't add default modes */ - if (!GTF_SUPPORTED(features->msc)) - add_default_modes = FALSE; - - p.mon_rec = &mon_rec; - p.max_clock = &max_clock; - p.set_hsync = mon_rec.nHsync == 0; - p.set_vrefresh = mon_rec.nVrefresh == 0; - p.sync_source = &sync_source; - - xf86ForEachDetailedBlock(edid_monitor, - handle_detailed_monrec, - &p); - } - - if (xf86GetOptValFreq (output->options, OPTION_MIN_CLOCK, - OPTUNITS_KHZ, &clock)) - min_clock = (int) clock; - if (xf86GetOptValFreq (output->options, OPTION_MAX_CLOCK, - OPTUNITS_KHZ, &clock)) - max_clock = (int) clock; - - /* If we still don't have a sync range, guess wildly */ - if (!mon_rec.nHsync || !mon_rec.nVrefresh) - GuessRangeFromModes(&mon_rec, output_modes); - - /* - * These limits will end up setting a 1024x768@60Hz mode by default, - * which seems like a fairly good mode to use when nothing else is - * specified - */ - if (mon_rec.nHsync == 0) - { - mon_rec.hsync[0].lo = 31.0; - mon_rec.hsync[0].hi = 55.0; - mon_rec.nHsync = 1; - } - if (mon_rec.nVrefresh == 0) - { - mon_rec.vrefresh[0].lo = 58.0; - mon_rec.vrefresh[0].hi = 62.0; - mon_rec.nVrefresh = 1; - } - - if (add_default_modes) - default_modes = xf86GetDefaultModes (); - - /* - * If this is not an RB monitor, remove RB modes from the default - * pool. RB modes from the config or the monitor itself are fine. - */ - if (!mon_rec.reducedblanking) - xf86ValidateModesReducedBlanking (scrn, default_modes); - - if (sync_source == sync_config) - { - /* - * Check output and config modes against sync range from config file - */ - xf86ValidateModesSync (scrn, output_modes, &mon_rec); - xf86ValidateModesSync (scrn, config_modes, &mon_rec); - } - /* - * Check default modes against sync range - */ - xf86ValidateModesSync (scrn, default_modes, &mon_rec); - /* - * Check default modes against monitor max clock - */ - if (max_clock) { - xf86ValidateModesClocks(scrn, default_modes, - &min_clock, &max_clock, 1); - xf86ValidateModesClocks(scrn, output_modes, - &min_clock, &max_clock, 1); - } - - output->probed_modes = NULL; - output->probed_modes = xf86ModesAdd (output->probed_modes, config_modes); - output->probed_modes = xf86ModesAdd (output->probed_modes, output_modes); - output->probed_modes = xf86ModesAdd (output->probed_modes, default_modes); - - /* - * Check all modes against max size, interlace, and doublescan - */ - if (maxX && maxY) - xf86ValidateModesSize (scrn, output->probed_modes, - maxX, maxY, 0); - - { - int flags = (output->interlaceAllowed ? V_INTERLACE : 0) | - (output->doubleScanAllowed ? V_DBLSCAN : 0); - xf86ValidateModesFlags (scrn, output->probed_modes, flags); - } - - /* - * Check all modes against output - */ - for (mode = output->probed_modes; mode != NULL; mode = mode->next) - if (mode->status == MODE_OK) - mode->status = (*output->funcs->mode_valid)(output, mode); - - xf86PruneInvalidModes(scrn, &output->probed_modes, debug_modes); - - output->probed_modes = xf86SortModes (output->probed_modes); - - /* Check for a configured preference for a particular mode */ - preferred_mode = preferredMode(scrn, output); - - if (preferred_mode) - { - for (mode = output->probed_modes; mode; mode = mode->next) - { - if (!strcmp (preferred_mode, mode->name)) - { - if (mode != output->probed_modes) - { - if (mode->prev) - mode->prev->next = mode->next; - if (mode->next) - mode->next->prev = mode->prev; - mode->next = output->probed_modes; - output->probed_modes->prev = mode; - mode->prev = NULL; - output->probed_modes = mode; - } - mode->type |= (M_T_PREFERRED|M_T_USERPREF); - break; - } - } - } - - output->initial_rotation = xf86OutputInitialRotation (output); - - if (debug_modes) { - if (output->probed_modes != NULL) { - xf86DrvMsg(scrn->scrnIndex, X_INFO, - "Printing probed modes for output %s\n", - output->name); - } else { - xf86DrvMsg(scrn->scrnIndex, X_INFO, - "No remaining probed modes for output %s\n", - output->name); - } - } - for (mode = output->probed_modes; mode != NULL; mode = mode->next) - { - /* The code to choose the best mode per pipe later on will require - * VRefresh to be set. - */ - mode->VRefresh = xf86ModeVRefresh(mode); - xf86SetModeCrtc(mode, INTERLACE_HALVE_V); - - if (debug_modes) - xf86PrintModeline(scrn->scrnIndex, mode); - } - } -} - - -/** - * Copy one of the output mode lists to the ScrnInfo record - */ - -/* XXX where does this function belong? Here? */ -void -xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr scrn, int *x, int *y); - -static DisplayModePtr -biggestMode(DisplayModePtr a, DisplayModePtr b) -{ - int A, B; - - if (!a) - return b; - if (!b) - return a; - - A = a->HDisplay * a->VDisplay; - B = b->HDisplay * b->VDisplay; - - if (A > B) - return a; - - return b; -} - -static xf86OutputPtr -SetCompatOutput(xf86CrtcConfigPtr config) -{ - xf86OutputPtr output = NULL, test = NULL; - DisplayModePtr maxmode = NULL, testmode, mode; - int o, compat = -1, count, mincount = 0; - - /* Look for one that's definitely connected */ - for (o = 0; o < config->num_output; o++) - { - test = config->output[o]; - if (!test->crtc) - continue; - if (test->status != XF86OutputStatusConnected) - continue; - if (!test->probed_modes) - continue; - - testmode = mode = test->probed_modes; - for (count = 0; mode; mode = mode->next, count++) - testmode = biggestMode(testmode, mode); - - if (!output) { - output = test; - compat = o; - maxmode = testmode; - mincount = count; - } else if (maxmode == biggestMode(maxmode, testmode)) { - output = test; - compat = o; - maxmode = testmode; - mincount = count; - } else if ((maxmode->HDisplay == testmode->HDisplay) && - (maxmode->VDisplay == testmode->VDisplay) && - count <= mincount) { - output = test; - compat = o; - maxmode = testmode; - mincount = count; - } - } - - /* If we didn't find one, take anything we can get */ - if (!output) - { - for (o = 0; o < config->num_output; o++) - { - test = config->output[o]; - if (!test->crtc) - continue; - if (!test->probed_modes) - continue; - - if (!output) { - output = test; - compat = o; - } else if (test->probed_modes->HDisplay < output->probed_modes->HDisplay) { - output = test; - compat = o; - } - } - } - - if (compat >= 0) { - config->compat_output = compat; - } else { - /* Don't change the compat output when no valid outputs found */ - output = config->output[config->compat_output]; - } - - return output; -} - -void -xf86SetScrnInfoModes (ScrnInfoPtr scrn) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - xf86OutputPtr output; - xf86CrtcPtr crtc; - DisplayModePtr last, mode = NULL; - - output = SetCompatOutput(config); - - if (!output) - return; /* punt */ - - crtc = output->crtc; - - /* Clear any existing modes from scrn->modes */ - while (scrn->modes != NULL) - xf86DeleteMode(&scrn->modes, scrn->modes); - - /* Set scrn->modes to the mode list for the 'compat' output */ - scrn->modes = xf86DuplicateModes(scrn, output->probed_modes); - - if (crtc) { - for (mode = scrn->modes; mode; mode = mode->next) - if (xf86ModesEqual (mode, &crtc->desiredMode)) - break; - } - - if (scrn->modes != NULL) { - /* For some reason, scrn->modes is circular, unlike the other mode - * lists. How great is that? - */ - for (last = scrn->modes; last && last->next; last = last->next) - ; - last->next = scrn->modes; - scrn->modes->prev = last; - if (mode) { - while (scrn->modes != mode) - scrn->modes = scrn->modes->next; - } - } - scrn->currentMode = scrn->modes; -#ifdef XFreeXDGA - if (scrn->pScreen) - _xf86_di_dga_reinit_internal(scrn->pScreen); -#endif -} - -static Bool -xf86CollectEnabledOutputs(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, - Bool *enabled) -{ - Bool any_enabled = FALSE; - int o; - - for (o = 0; o < config->num_output; o++) - any_enabled |= enabled[o] = xf86OutputEnabled(config->output[o], TRUE); - - if (!any_enabled) { - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "No outputs definitely connected, trying again...\n"); - - for (o = 0; o < config->num_output; o++) - any_enabled |= enabled[o] = xf86OutputEnabled(config->output[o], FALSE); - } - - return any_enabled; -} - -static Bool -nextEnabledOutput(xf86CrtcConfigPtr config, Bool *enabled, int *index) -{ - int o = *index; - - for (o++; o < config->num_output; o++) { - if (enabled[o]) { - *index = o; - return TRUE; - } - } - - return FALSE; -} - -static Bool -aspectMatch(float a, float b) -{ - return fabs(1 - (a / b)) < 0.05; -} - -static DisplayModePtr -nextAspectMode(xf86OutputPtr o, DisplayModePtr last, float aspect) -{ - DisplayModePtr m = NULL; - - if (!o) - return NULL; - - if (!last) - m = o->probed_modes; - else - m = last->next; - - for (; m; m = m->next) - if (aspectMatch(aspect, (float)m->HDisplay / (float)m->VDisplay)) - return m; - - return NULL; -} - -static DisplayModePtr -bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect) -{ - int o = -1, p; - DisplayModePtr mode = NULL, test = NULL, match = NULL; - - if (!nextEnabledOutput(config, enabled, &o)) - return NULL; - while ((mode = nextAspectMode(config->output[o], mode, aspect))) { - test = mode; - for (p = o; nextEnabledOutput(config, enabled, &p); ) { - test = xf86OutputFindClosestMode(config->output[p], mode); - if (!test) - break; - if (test->HDisplay != mode->HDisplay || - test->VDisplay != mode->VDisplay) { - test = NULL; - break; - } - } - - /* if we didn't match it on all outputs, try the next one */ - if (!test) - continue; - - /* if it's bigger than the last one, save it */ - if (!match || (test->HDisplay > match->HDisplay)) - match = test; - } - - /* return the biggest one found */ - return match; -} - -static Bool -xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, - DisplayModePtr *modes, Bool *enabled, - int width, int height) -{ - int o, p; - int max_pref_width = 0, max_pref_height = 0; - DisplayModePtr *preferred, *preferred_match; - Bool ret = FALSE; - - preferred = xnfcalloc(config->num_output, sizeof(DisplayModePtr)); - preferred_match = xnfcalloc(config->num_output, sizeof(DisplayModePtr)); - - /* Check if the preferred mode is available on all outputs */ - for (p = -1; nextEnabledOutput(config, enabled, &p); ) { - Rotation r = config->output[p]->initial_rotation; - DisplayModePtr mode; - if ((preferred[p] = xf86OutputHasPreferredMode(config->output[p], - width, height))) { - int pref_width = xf86ModeWidth(preferred[p], r); - int pref_height = xf86ModeHeight(preferred[p], r); - Bool all_match = TRUE; - - for (o = -1; nextEnabledOutput(config, enabled, &o); ) { - Bool match = FALSE; - xf86OutputPtr output = config->output[o]; - if (o == p) - continue; - - for (mode = output->probed_modes; mode; mode = mode->next) { - Rotation r = output->initial_rotation; - if (xf86ModeWidth(mode, r) == pref_width && - xf86ModeHeight(mode, r) == pref_height) { - preferred[o] = mode; - match = TRUE; - } - } - - all_match &= match; - } - - if (all_match && - (pref_width*pref_height > max_pref_width*max_pref_height)) { - for (o = -1; nextEnabledOutput(config, enabled, &o); ) - preferred_match[o] = preferred[o]; - max_pref_width = pref_width; - max_pref_height = pref_height; - ret = TRUE; - } - } - } - - /* - * If there's no preferred mode, but only one monitor, pick the - * biggest mode for its aspect ratio, assuming one exists. - */ - if (!ret) do { - int i = 0; - float aspect = 0.0; - - /* count the number of enabled outputs */ - for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++) ; - - if (i != 1) - break; - - p = -1; - nextEnabledOutput(config, enabled, &p); - if (config->output[p]->mm_height) - aspect = (float)config->output[p]->mm_width / - (float)config->output[p]->mm_height; - - if (aspect) - preferred_match[p] = bestModeForAspect(config, enabled, aspect); - - if (preferred_match[p]) - ret = TRUE; - - } while (0); - - if (ret) { - /* oh good, there is a match. stash the selected modes and return. */ - memcpy(modes, preferred_match, - config->num_output * sizeof(DisplayModePtr)); - } - - free(preferred); - free(preferred_match); - return ret; -} - -static Bool -xf86TargetAspect(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, - DisplayModePtr *modes, Bool *enabled, - int width, int height) -{ - int o; - float aspect = 0.0, *aspects; - xf86OutputPtr output; - Bool ret = FALSE; - DisplayModePtr guess = NULL, aspect_guess = NULL, base_guess = NULL; - - aspects = xnfcalloc(config->num_output, sizeof(float)); - - /* collect the aspect ratios */ - for (o = -1; nextEnabledOutput(config, enabled, &o); ) { - output = config->output[o]; - if (output->mm_height) - aspects[o] = (float)output->mm_width / (float)output->mm_height; - else - aspects[o] = 4.0 / 3.0; - } - - /* check that they're all the same */ - for (o = -1; nextEnabledOutput(config, enabled, &o); ) { - output = config->output[o]; - if (!aspect) { - aspect = aspects[o]; - } else if (!aspectMatch(aspect, aspects[o])) { - goto no_aspect_match; - } - } - - /* if they're all 4:3, just skip ahead and save effort */ - if (!aspectMatch(aspect, 4.0/3.0)) - aspect_guess = bestModeForAspect(config, enabled, aspect); - -no_aspect_match: - base_guess = bestModeForAspect(config, enabled, 4.0/3.0); - - guess = biggestMode(base_guess, aspect_guess); - - if (!guess) - goto out; - - /* found a mode that works everywhere, now apply it */ - for (o = -1; nextEnabledOutput(config, enabled, &o); ) { - modes[o] = xf86OutputFindClosestMode(config->output[o], guess); - } - ret = TRUE; - -out: - free(aspects); - return ret; -} - -static Bool -xf86TargetFallback(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, - DisplayModePtr *modes, Bool *enabled, - int width, int height) -{ - DisplayModePtr target_mode = NULL; - Rotation target_rotation = RR_Rotate_0; - DisplayModePtr default_mode; - int default_preferred, target_preferred = 0, o; - - /* User preferred > preferred > other modes */ - for (o = -1; nextEnabledOutput(config, enabled, &o); ) { - default_mode = xf86DefaultMode (config->output[o], width, height); - if (!default_mode) - continue; - - default_preferred = (((default_mode->type & M_T_PREFERRED) != 0) + - ((default_mode->type & M_T_USERPREF) != 0)); - - if (default_preferred > target_preferred || !target_mode) { - target_mode = default_mode; - target_preferred = default_preferred; - target_rotation = config->output[o]->initial_rotation; - config->compat_output = o; - } - } - - if (target_mode) - modes[config->compat_output] = target_mode; - - /* Fill in other output modes */ - for (o = -1; nextEnabledOutput(config, enabled, &o); ) { - if (!modes[o]) - modes[o] = xf86ClosestMode(config->output[o], target_mode, - target_rotation, width, height); - } - - return target_mode != NULL; -} - -static Bool -xf86TargetUserpref(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, - DisplayModePtr *modes, Bool *enabled, - int width, int height) -{ - int o; - - if (xf86UserConfiguredOutputs(scrn, modes)) - return xf86TargetFallback(scrn, config, modes, enabled, width, height); - - for (o = -1; nextEnabledOutput(config, enabled, &o); ) - if (xf86OutputHasUserPreferredMode(config->output[o])) - return - xf86TargetFallback(scrn, config, modes, enabled, width, height); - - return FALSE; -} - -static Bool -xf86CrtcSetInitialGamma(xf86CrtcPtr crtc, float gamma_red, float gamma_green, - float gamma_blue) -{ - int i, size = 256; - CARD16 *red, *green, *blue; - - red = malloc(3 * size * sizeof(CARD16)); - green = red + size; - blue = green + size; - - /* Only cause warning if user wanted gamma to be set. */ - if (!crtc->funcs->gamma_set && (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0)) { - free(red); - return FALSE; - } else if (!crtc->funcs->gamma_set) { - free(red); - return TRUE; - } - - /* At this early stage none of the randr-interface stuff is up. - * So take the default gamma size for lack of something better. - */ - for (i = 0; i < size; i++) { - if (gamma_red == 1.0) - red[i] = i << 8; - else - red[i] = (CARD16)(pow((double)i/(double)(size - 1), - 1. / (double)gamma_red) * (double)(size - 1) * 256); - - if (gamma_green == 1.0) - green[i] = i << 8; - else - green[i] = (CARD16)(pow((double)i/(double)(size - 1), - 1. / (double)gamma_green) * (double)(size - 1) * 256); - - if (gamma_blue == 1.0) - blue[i] = i << 8; - else - blue[i] = (CARD16)(pow((double)i/(double)(size - 1), - 1. / (double)gamma_blue) * (double)(size - 1) * 256); - } - - /* Default size is 256, so anything else is failure. */ - if (size != crtc->gamma_size) { - free(red); - return FALSE; - } - - crtc->gamma_size = size; - memcpy (crtc->gamma_red, red, crtc->gamma_size * sizeof (CARD16)); - memcpy (crtc->gamma_green, green, crtc->gamma_size * sizeof (CARD16)); - memcpy (crtc->gamma_blue, blue, crtc->gamma_size * sizeof (CARD16)); - - /* Do not set gamma now, delay until the crtc is activated. */ - - free(red); - - return TRUE; -} - -static Bool -xf86OutputSetInitialGamma(xf86OutputPtr output) -{ - XF86ConfMonitorPtr mon = output->conf_monitor; - float gamma_red = 1.0, gamma_green = 1.0, gamma_blue = 1.0; - - if (!mon) - return TRUE; - - if (!output->crtc) - return FALSE; - - /* Get configured values, where they exist. */ - if (mon->mon_gamma_red >= GAMMA_MIN && - mon->mon_gamma_red <= GAMMA_MAX) - gamma_red = mon->mon_gamma_red; - - if (mon->mon_gamma_green >= GAMMA_MIN && - mon->mon_gamma_green <= GAMMA_MAX) - gamma_green = mon->mon_gamma_green; - - if (mon->mon_gamma_blue >= GAMMA_MIN && - mon->mon_gamma_blue <= GAMMA_MAX) - gamma_blue = mon->mon_gamma_blue; - - /* This avoids setting gamma 1.0 in case another cloned output on this crtc has a specific gamma. */ - if (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0) { - xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "Output %s wants gamma correction (%.1f, %.1f, %.1f)\n", output->name, gamma_red, gamma_green, gamma_blue); - return xf86CrtcSetInitialGamma(output->crtc, gamma_red, gamma_green, gamma_blue); - }else - return TRUE; -} - -/** - * Construct default screen configuration - * - * Given auto-detected (and, eventually, configured) values, - * construct a usable configuration for the system - * - * canGrow indicates that the driver can resize the screen to larger than its - * initially configured size via the config->funcs->resize hook. If TRUE, this - * function will set virtualX and virtualY to match the initial configuration - * and leave config->max{Width,Height} alone. If FALSE, it will bloat - * virtual[XY] to include the largest modes and set config->max{Width,Height} - * accordingly. - */ - -Bool -xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int o, c; - xf86CrtcPtr *crtcs; - DisplayModePtr *modes; - Bool *enabled; - int width, height; - int i = scrn->scrnIndex; - Bool have_outputs = TRUE; - Bool ret; - - /* Set up the device options */ - config->options = xnfalloc (sizeof (xf86DeviceOptions)); - memcpy (config->options, xf86DeviceOptions, sizeof (xf86DeviceOptions)); - xf86ProcessOptions (scrn->scrnIndex, - scrn->options, - config->options); - config->debug_modes = xf86ReturnOptValBool (config->options, - OPTION_MODEDEBUG, FALSE); - - if (scrn->display->virtualX) - width = scrn->display->virtualX; - else - width = config->maxWidth; - if (scrn->display->virtualY) - height = scrn->display->virtualY; - else - height = config->maxHeight; - - xf86ProbeOutputModes (scrn, width, height); - - crtcs = xnfcalloc (config->num_output, sizeof (xf86CrtcPtr)); - modes = xnfcalloc (config->num_output, sizeof (DisplayModePtr)); - enabled = xnfcalloc (config->num_output, sizeof (Bool)); - - ret = xf86CollectEnabledOutputs(scrn, config, enabled); - if (ret == FALSE && canGrow) { - xf86DrvMsg(i, X_WARNING, "Unable to find connected outputs - setting %dx%d initial framebuffer\n", - NO_OUTPUT_DEFAULT_WIDTH, NO_OUTPUT_DEFAULT_HEIGHT); - have_outputs = FALSE; - } else { - if (xf86TargetUserpref(scrn, config, modes, enabled, width, height)) - xf86DrvMsg(i, X_INFO, "Using user preference for initial modes\n"); - else if (xf86TargetPreferred(scrn, config, modes, enabled, width, height)) - xf86DrvMsg(i, X_INFO, "Using exact sizes for initial modes\n"); - else if (xf86TargetAspect(scrn, config, modes, enabled, width, height)) - xf86DrvMsg(i, X_INFO, "Using fuzzy aspect match for initial modes\n"); - else if (xf86TargetFallback(scrn, config, modes, enabled, width, height)) - xf86DrvMsg(i, X_INFO, "Using sloppy heuristic for initial modes\n"); - else - xf86DrvMsg(i, X_WARNING, "Unable to find initial modes\n"); - } - - for (o = -1; nextEnabledOutput(config, enabled, &o); ) { - if (!modes[o]) - xf86DrvMsg (scrn->scrnIndex, X_ERROR, - "Output %s enabled but has no modes\n", - config->output[o]->name); - else - xf86DrvMsg (scrn->scrnIndex, X_INFO, - "Output %s using initial mode %s\n", - config->output[o]->name, modes[o]->name); - } - - /* - * Set the position of each output - */ - if (!xf86InitialOutputPositions (scrn, modes)) - { - free(crtcs); - free(modes); - return FALSE; - } - - /* - * Set initial panning of each output - */ - xf86InitialPanning (scrn); - - /* - * Assign CRTCs to fit output configuration - */ - if (have_outputs && !xf86PickCrtcs (scrn, crtcs, modes, 0, width, height)) - { - free(crtcs); - free(modes); - return FALSE; - } - - /* XXX override xf86 common frame computation code */ - - scrn->display->frameX0 = 0; - scrn->display->frameY0 = 0; - - for (c = 0; c < config->num_crtc; c++) - { - xf86CrtcPtr crtc = config->crtc[c]; - - crtc->enabled = FALSE; - memset (&crtc->desiredMode, '\0', sizeof (crtc->desiredMode)); - /* Set default gamma for all crtc's. */ - /* This is done to avoid problems later on with cloned outputs. */ - xf86CrtcSetInitialGamma(crtc, 1.0, 1.0, 1.0); - } - - if (xf86_crtc_supports_gamma(scrn)) - xf86DrvMsg(scrn->scrnIndex, X_INFO, "Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.\n"); - - /* - * Set initial configuration - */ - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - DisplayModePtr mode = modes[o]; - xf86CrtcPtr crtc = crtcs[o]; - - if (mode && crtc) - { - crtc->desiredMode = *mode; - crtc->desiredRotation = output->initial_rotation; - crtc->desiredX = output->initial_x; - crtc->desiredY = output->initial_y; - crtc->desiredTransformPresent = FALSE; - crtc->enabled = TRUE; - memcpy (&crtc->panningTotalArea, &output->initialTotalArea, sizeof(BoxRec)); - memcpy (&crtc->panningTrackingArea, &output->initialTrackingArea, sizeof(BoxRec)); - memcpy (crtc->panningBorder, output->initialBorder, 4*sizeof(INT16)); - output->crtc = crtc; - if (!xf86OutputSetInitialGamma(output)) - xf86DrvMsg (scrn->scrnIndex, X_WARNING, "Initial gamma correction for output %s: failed.\n", output->name); - } else { - output->crtc = NULL; - } - } - - if (scrn->display->virtualX == 0) - { - /* - * Expand virtual size to cover the current config and potential mode - * switches, if the driver can't enlarge the screen later. - */ - xf86DefaultScreenLimits (scrn, &width, &height, canGrow); - - if (have_outputs == FALSE) { - if (width < NO_OUTPUT_DEFAULT_WIDTH && height < NO_OUTPUT_DEFAULT_HEIGHT) { - width = NO_OUTPUT_DEFAULT_WIDTH; - height = NO_OUTPUT_DEFAULT_HEIGHT; - } - } - - scrn->display->virtualX = width; - scrn->display->virtualY = height; - } - - if (width > scrn->virtualX) - scrn->virtualX = width; - if (height > scrn->virtualY) - scrn->virtualY = height; - - /* - * Make sure the configuration isn't too small. - */ - if (width < config->minWidth || height < config->minHeight) - return FALSE; - - /* - * Limit the crtc config to virtual[XY] if the driver can't grow the - * desktop. - */ - if (!canGrow) - { - xf86CrtcSetSizeRange (scrn, config->minWidth, config->minHeight, - width, height); - } - - if (have_outputs) { - /* Mirror output modes to scrn mode list */ - xf86SetScrnInfoModes (scrn); - } else { - /* Clear any existing modes from scrn->modes */ - while (scrn->modes != NULL) - xf86DeleteMode(&scrn->modes, scrn->modes); - scrn->modes = xf86ModesAdd(scrn->modes, - xf86CVTMode(width, height, 60, 0, 0)); - } - - - free(crtcs); - free(modes); - return TRUE; -} - -/* - * Check the CRTC we're going to map each output to vs. it's current - * CRTC. If they don't match, we have to disable the output and the CRTC - * since the driver will have to re-route things. - */ -static void -xf86PrepareOutputs (ScrnInfoPtr scrn) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int o; - - for (o = 0; o < config->num_output; o++) { - xf86OutputPtr output = config->output[o]; -#if RANDR_GET_CRTC_INTERFACE - /* Disable outputs that are unused or will be re-routed */ - if (!output->funcs->get_crtc || - output->crtc != (*output->funcs->get_crtc)(output) || - output->crtc == NULL) -#endif - (*output->funcs->dpms)(output, DPMSModeOff); - } -} - -static void -xf86PrepareCrtcs (ScrnInfoPtr scrn) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int c; - - for (c = 0; c < config->num_crtc; c++) { -#if RANDR_GET_CRTC_INTERFACE - xf86CrtcPtr crtc = config->crtc[c]; - xf86OutputPtr output = NULL; - uint32_t desired_outputs = 0, current_outputs = 0; - int o; - - for (o = 0; o < config->num_output; o++) { - output = config->output[o]; - if (output->crtc == crtc) - desired_outputs |= (1<funcs->get_crtc) { - desired_outputs = 0; - break; - } - if ((*output->funcs->get_crtc)(output) == crtc) - current_outputs |= (1<funcs->dpms)(crtc, DPMSModeOff); -#else - (*crtc->funcs->dpms)(crtc, DPMSModeOff); -#endif - } -} - -/* - * Using the desired mode information in each crtc, set - * modes (used in EnterVT functions, or at server startup) - */ - -Bool -xf86SetDesiredModes (ScrnInfoPtr scrn) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - xf86CrtcPtr crtc = config->crtc[0]; - int c; - - /* A driver with this hook will take care of this */ - if (!crtc->funcs->set_mode_major) { - xf86PrepareOutputs(scrn); - xf86PrepareCrtcs(scrn); - } - - for (c = 0; c < config->num_crtc; c++) - { - xf86OutputPtr output = NULL; - xf86CrtcSetRec set; - int o; - RRTransformPtr transform; - - crtc = config->crtc[c]; - - /* Skip disabled CRTCs */ - if (!crtc->enabled) - continue; - - if (xf86CompatOutput(scrn) && xf86CompatCrtc(scrn) == crtc) - output = xf86CompatOutput(scrn); - else - { - for (o = 0; o < config->num_output; o++) - if (config->output[o]->crtc == crtc) - { - output = config->output[o]; - break; - } - } - /* paranoia */ - if (!output) - continue; - - /* Mark that we'll need to re-set the mode for sure */ - memset(&crtc->mode, 0, sizeof(crtc->mode)); - if (!crtc->desiredMode.CrtcHDisplay) - { - DisplayModePtr mode = xf86OutputFindClosestMode (output, scrn->currentMode); - - if (!mode) - return FALSE; - crtc->desiredMode = *mode; - crtc->desiredRotation = RR_Rotate_0; - crtc->desiredTransformPresent = FALSE; - crtc->desiredX = 0; - crtc->desiredY = 0; - } - - if (crtc->desiredTransformPresent) - transform = &crtc->desiredTransform; - else - transform = NULL; - set.mode = &crtc->desiredMode; - set.rotation = crtc->desiredRotation; - set.transform = transform; - set.x = crtc->desiredX; - set.y = crtc->desiredY; - set.flags = (XF86CrtcSetMode | XF86CrtcSetOutput | - XF86CrtcSetOrigin | XF86CrtcSetTransform | - XF86CrtcSetRotation); - if (!xf86CrtcSet(crtc, &set)) - return FALSE; - } - - xf86DisableUnusedFunctions(scrn); - return TRUE; -} - -/** - * In the current world order, there are lists of modes per output, which may - * or may not include the mode that was asked to be set by XFree86's mode - * selection. Find the closest one, in the following preference order: - * - * - Equality - * - Closer in size to the requested mode, but no larger - * - Closer in refresh rate to the requested mode. - */ - -DisplayModePtr -xf86OutputFindClosestMode (xf86OutputPtr output, DisplayModePtr desired) -{ - DisplayModePtr best = NULL, scan = NULL; - - for (scan = output->probed_modes; scan != NULL; scan = scan->next) - { - /* If there's an exact match, we're done. */ - if (xf86ModesEqual(scan, desired)) { - best = desired; - break; - } - - /* Reject if it's larger than the desired mode. */ - if (scan->HDisplay > desired->HDisplay || - scan->VDisplay > desired->VDisplay) - { - continue; - } - - /* - * If we haven't picked a best mode yet, use the first - * one in the size range - */ - if (best == NULL) - { - best = scan; - continue; - } - - /* Find if it's closer to the right size than the current best - * option. - */ - if ((scan->HDisplay > best->HDisplay && - scan->VDisplay >= best->VDisplay) || - (scan->HDisplay >= best->HDisplay && - scan->VDisplay > best->VDisplay)) - { - best = scan; - continue; - } - - /* Find if it's still closer to the right refresh than the current - * best resolution. - */ - if (scan->HDisplay == best->HDisplay && - scan->VDisplay == best->VDisplay && - (fabs(scan->VRefresh - desired->VRefresh) < - fabs(best->VRefresh - desired->VRefresh))) { - best = scan; - } - } - return best; -} - -/** - * When setting a mode through XFree86-VidModeExtension or XFree86-DGA, - * take the specified mode and apply it to the crtc connected to the compat - * output. Then, find similar modes for the other outputs, as with the - * InitialConfiguration code above. The goal is to clone the desired - * mode across all outputs that are currently active. - */ - -Bool -xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); - Bool ok = TRUE; - xf86OutputPtr compat_output; - DisplayModePtr compat_mode = NULL; - int c; - - /* - * Let the compat output drive the final mode selection - */ - compat_output = xf86CompatOutput(pScrn); - if (compat_output) - compat_mode = xf86OutputFindClosestMode (compat_output, desired); - if (compat_mode) - desired = compat_mode; - - for (c = 0; c < config->num_crtc; c++) - { - xf86CrtcPtr crtc = config->crtc[c]; - DisplayModePtr crtc_mode = NULL; - int o; - xf86CrtcSetRec set; - - if (!crtc->enabled) - continue; - - for (o = 0; o < config->num_output; o++) - { - xf86OutputPtr output = config->output[o]; - DisplayModePtr output_mode; - - /* skip outputs not on this crtc */ - if (output->crtc != crtc) - continue; - - if (crtc_mode) - { - output_mode = xf86OutputFindClosestMode (output, crtc_mode); - if (output_mode != crtc_mode) - output->crtc = NULL; - } - else - crtc_mode = xf86OutputFindClosestMode (output, desired); - } - if (!crtc_mode) - { - crtc->enabled = FALSE; - continue; - } - set.mode = crtc_mode; - set.rotation = rotation; - set.transform = NULL; - set.x = 0; - set.y = 0; - set.flags = (XF86CrtcSetMode | XF86CrtcSetOutput | - XF86CrtcSetOrigin | XF86CrtcSetTransform | - XF86CrtcSetRotation); - if (!xf86CrtcSet (crtc, &set)) - ok = FALSE; - else - { - crtc->desiredMode = *crtc_mode; - crtc->desiredRotation = rotation; - crtc->desiredTransformPresent = FALSE; - crtc->desiredX = 0; - crtc->desiredY = 0; - } - } - xf86DisableUnusedFunctions(pScrn); -#ifdef RANDR_12_INTERFACE - xf86RandR12TellChanged (pScrn->pScreen); -#endif - return ok; -} - - -/** - * Set the DPMS power mode of all outputs and CRTCs. - * - * If the new mode is off, it will turn off outputs and then CRTCs. - * Otherwise, it will affect CRTCs before outputs. - */ -void -xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags) -{ - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int i; - - if (!scrn->vtSema) - return; - - if (mode == DPMSModeOff) { - for (i = 0; i < config->num_output; i++) { - xf86OutputPtr output = config->output[i]; - if (output->crtc != NULL) - (*output->funcs->dpms) (output, mode); - } - } - - for (i = 0; i < config->num_crtc; i++) { - xf86CrtcPtr crtc = config->crtc[i]; - if (crtc->enabled) - (*crtc->funcs->dpms) (crtc, mode); - } - - if (mode != DPMSModeOff) { - for (i = 0; i < config->num_output; i++) { - xf86OutputPtr output = config->output[i]; - if (output->crtc != NULL) - (*output->funcs->dpms) (output, mode); - } - } -} - -/** - * Implement the screensaver by just calling down into the driver DPMS hooks. - * - * Even for monitors with no DPMS support, by the definition of our DPMS hooks, - * the outputs will still get disabled (blanked). - */ -Bool -xf86SaveScreen(ScreenPtr pScreen, int mode) -{ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - - if (xf86IsUnblank(mode)) - xf86DPMSSet(pScrn, DPMSModeOn, 0); - else - xf86DPMSSet(pScrn, DPMSModeOff, 0); - - return TRUE; -} - -/** - * Disable all inactive crtcs and outputs - */ -void -xf86DisableUnusedFunctions(ScrnInfoPtr pScrn) -{ - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - int o, c; - - for (o = 0; o < xf86_config->num_output; o++) - { - xf86OutputPtr output = xf86_config->output[o]; - if (!output->crtc) - (*output->funcs->dpms)(output, DPMSModeOff); - } - - for (c = 0; c < xf86_config->num_crtc; c++) - { - xf86CrtcPtr crtc = xf86_config->crtc[c]; - - if (!crtc->enabled) - { - crtc->funcs->dpms(crtc, DPMSModeOff); - memset(&crtc->mode, 0, sizeof(crtc->mode)); - xf86RotateDestroy(crtc); - crtc->active = FALSE; - } - } - if (pScrn->pScreen) - xf86_crtc_notify(pScrn->pScreen); - if (pScrn->ModeSet) - pScrn->ModeSet(pScrn); -} - -#ifdef RANDR_12_INTERFACE - -#define EDID_ATOM_NAME "EDID" - -/** - * Set the RandR EDID property - */ -static void -xf86OutputSetEDIDProperty (xf86OutputPtr output, void *data, int data_len) -{ - Atom edid_atom = MakeAtom(EDID_ATOM_NAME, sizeof(EDID_ATOM_NAME) - 1, TRUE); - - /* This may get called before the RandR resources have been created */ - if (output->randr_output == NULL) - return; - - if (data_len != 0) { - RRChangeOutputProperty(output->randr_output, edid_atom, XA_INTEGER, 8, - PropModeReplace, data_len, data, FALSE, TRUE); - } else { - RRDeleteOutputProperty(output->randr_output, edid_atom); - } -} - -#endif - -/* Pull out a phyiscal size from a detailed timing if available. */ -struct det_phySize_parameter { - xf86OutputPtr output; - ddc_quirk_t quirks; - Bool ret; -}; - -static void handle_detailed_physical_size(struct detailed_monitor_section - *det_mon, void *data) -{ - struct det_phySize_parameter *p; - p = (struct det_phySize_parameter *)data; - - if (p->ret == TRUE ) - return ; - - xf86DetTimingApplyQuirks(det_mon, p->quirks, - p->output->MonInfo->features.hsize, - p->output->MonInfo->features.vsize); - if (det_mon->type == DT && - det_mon->section.d_timings.h_size != 0 && - det_mon->section.d_timings.v_size != 0) { - - p->output->mm_width = det_mon->section.d_timings.h_size; - p->output->mm_height = det_mon->section.d_timings.v_size; - p->ret = TRUE; - } -} - -/** - * Set the EDID information for the specified output - */ -void -xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) -{ - ScrnInfoPtr scrn = output->scrn; - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - Bool debug_modes = config->debug_modes || xf86Initialising; -#ifdef RANDR_12_INTERFACE - int size; -#endif - - free(output->MonInfo); - - output->MonInfo = edid_mon; - output->mm_width = 0; - output->mm_height = 0; - - if (debug_modes) { - xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n", - output->name); - xf86PrintEDID(edid_mon); - } - - /* Set the DDC properties for the 'compat' output */ - if (output == xf86CompatOutput(scrn)) - xf86SetDDCproperties(scrn, edid_mon); - -#ifdef RANDR_12_INTERFACE - /* Set the RandR output properties */ - size = 0; - if (edid_mon) - { - if (edid_mon->ver.version == 1) { - size = 128; - if (edid_mon->flags & EDID_COMPLETE_RAWDATA) - size += edid_mon->no_sections * 128; - } else if (edid_mon->ver.version == 2) - size = 256; - } - xf86OutputSetEDIDProperty (output, edid_mon ? edid_mon->rawData : NULL, size); -#endif - - if (edid_mon) { - - struct det_phySize_parameter p; - p.output = output; - p.quirks = xf86DDCDetectQuirks(scrn->scrnIndex,edid_mon, FALSE); - p.ret = FALSE; - xf86ForEachDetailedBlock(edid_mon, - handle_detailed_physical_size, &p); - - /* if no mm size is available from a detailed timing, check the max size field */ - if ((!output->mm_width || !output->mm_height) && - (edid_mon->features.hsize && edid_mon->features.vsize)) - { - output->mm_width = edid_mon->features.hsize * 10; - output->mm_height = edid_mon->features.vsize * 10; - } - } -} - -/** - * Return the list of modes supported by the EDID information - * stored in 'output' - */ -DisplayModePtr -xf86OutputGetEDIDModes (xf86OutputPtr output) -{ - ScrnInfoPtr scrn = output->scrn; - xf86MonPtr edid_mon = output->MonInfo; - - if (!edid_mon) - return NULL; - return xf86DDCGetModes(scrn->scrnIndex, edid_mon); -} - -/* maybe we should care about DDC1? meh. */ -xf86MonPtr -xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus) -{ - ScrnInfoPtr scrn = output->scrn; - xf86MonPtr mon; - - mon = xf86DoEEDID(scrn->scrnIndex, pDDCBus, TRUE); - if (mon) - xf86DDCApplyQuirks(scrn->scrnIndex, mon); - - return mon; -} - -static char *_xf86ConnectorNames[] = { - "None", "VGA", "DVI-I", "DVI-D", - "DVI-A", "Composite", "S-Video", - "Component", "LFP", "Proprietary", - "HDMI", "DisplayPort", - }; -char * -xf86ConnectorGetName(xf86ConnectorType connector) -{ - return _xf86ConnectorNames[connector]; -} - -static void -x86_crtc_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b) -{ - dest->x1 = a->x1 > b->x1 ? a->x1 : b->x1; - dest->x2 = a->x2 < b->x2 ? a->x2 : b->x2; - dest->y1 = a->y1 > b->y1 ? a->y1 : b->y1; - dest->y2 = a->y2 < b->y2 ? a->y2 : b->y2; - - if (dest->x1 >= dest->x2 || dest->y1 >= dest->y2) - dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0; -} - -static void -x86_crtc_box(xf86CrtcPtr crtc, BoxPtr crtc_box) -{ - if (crtc->enabled) { - crtc_box->x1 = crtc->x; - crtc_box->x2 = crtc->x + xf86ModeWidth(&crtc->mode, crtc->rotation); - crtc_box->y1 = crtc->y; - crtc_box->y2 = crtc->y + xf86ModeHeight(&crtc->mode, crtc->rotation); - } else - crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0; -} - -static int -xf86_crtc_box_area(BoxPtr box) -{ - return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1); -} - -/* - * Return the crtc covering 'box'. If two crtcs cover a portion of - * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc - * with greater coverage - */ - -static xf86CrtcPtr -xf86_covering_crtc(ScrnInfoPtr pScrn, - BoxPtr box, - xf86CrtcPtr desired, - BoxPtr crtc_box_ret) -{ - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - xf86CrtcPtr crtc, best_crtc; - int coverage, best_coverage; - int c; - BoxRec crtc_box, cover_box; - - best_crtc = NULL; - best_coverage = 0; - crtc_box_ret->x1 = 0; - crtc_box_ret->x2 = 0; - crtc_box_ret->y1 = 0; - crtc_box_ret->y2 = 0; - for (c = 0; c < xf86_config->num_crtc; c++) { - crtc = xf86_config->crtc[c]; - x86_crtc_box(crtc, &crtc_box); - x86_crtc_box_intersect(&cover_box, &crtc_box, box); - coverage = xf86_crtc_box_area(&cover_box); - if (coverage && crtc == desired) { - *crtc_box_ret = crtc_box; - return crtc; - } else if (coverage > best_coverage) { - *crtc_box_ret = crtc_box; - best_crtc = crtc; - best_coverage = coverage; - } - } - return best_crtc; -} - -/* - * For overlay video, compute the relevant CRTC and - * clip video to that. - * - * returning FALSE means there was a memory failure of some kind, - * not that the video shouldn't be displayed - */ - -Bool -xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn, - xf86CrtcPtr *crtc_ret, - xf86CrtcPtr desired_crtc, - BoxPtr dst, - INT32 *xa, - INT32 *xb, - INT32 *ya, - INT32 *yb, - RegionPtr reg, - INT32 width, - INT32 height) -{ - Bool ret; - RegionRec crtc_region_local; - RegionPtr crtc_region = reg; - - if (crtc_ret) { - BoxRec crtc_box; - xf86CrtcPtr crtc = xf86_covering_crtc(pScrn, dst, - desired_crtc, - &crtc_box); - - if (crtc) { - RegionInit(&crtc_region_local, &crtc_box, 1); - crtc_region = &crtc_region_local; - RegionIntersect(crtc_region, crtc_region, reg); - } - *crtc_ret = crtc; - } - - ret = xf86XVClipVideoHelper(dst, xa, xb, ya, yb, - crtc_region, width, height); - - if (crtc_region != reg) - RegionUninit(&crtc_region_local); - - return ret; -} - -xf86_crtc_notify_proc_ptr -xf86_wrap_crtc_notify (ScreenPtr screen, xf86_crtc_notify_proc_ptr new) -{ - if (xf86CrtcConfigPrivateIndex != -1) - { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - xf86_crtc_notify_proc_ptr old; - - old = config->xf86_crtc_notify; - config->xf86_crtc_notify = new; - return old; - } - return NULL; -} - -void -xf86_unwrap_crtc_notify(ScreenPtr screen, xf86_crtc_notify_proc_ptr old) -{ - if (xf86CrtcConfigPrivateIndex != -1) - { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - - config->xf86_crtc_notify = old; - } -} - -void -xf86_crtc_notify(ScreenPtr screen) -{ - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - - if (config->xf86_crtc_notify) - config->xf86_crtc_notify(screen); -} - -Bool -xf86_crtc_supports_gamma(ScrnInfoPtr pScrn) -{ - if (xf86CrtcConfigPrivateIndex != -1) { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - xf86CrtcPtr crtc; - - /* for multiple drivers loaded we need this */ - if (!xf86_config) - return FALSE; - if (xf86_config->num_crtc == 0) - return FALSE; - crtc = xf86_config->crtc[0]; - - return crtc->funcs->gamma_set != NULL; - } - - return FALSE; -} +/* + * 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. + */ + +#ifdef HAVE_XORG_CONFIG_H +#include +#else +#ifdef HAVE_CONFIG_H +#include +#endif +#endif + +#include +#include +#include + +#include "xf86.h" +#include "xf86DDC.h" +#include "xf86Crtc.h" +#include "xf86Modes.h" +#include "xf86Priv.h" +#include "xf86RandR12.h" +#include "X11/extensions/render.h" +#include "X11/extensions/dpmsconst.h" +#include "X11/Xatom.h" +#include "picturestr.h" + +#include "xf86xv.h" + +#define NO_OUTPUT_DEFAULT_WIDTH 1024 +#define NO_OUTPUT_DEFAULT_HEIGHT 768 +/* + * Initialize xf86CrtcConfig structure + */ + +int xf86CrtcConfigPrivateIndex = -1; + +void +xf86CrtcConfigInit (ScrnInfoPtr scrn, + const xf86CrtcConfigFuncsRec *funcs) +{ + xf86CrtcConfigPtr config; + + if (xf86CrtcConfigPrivateIndex == -1) + xf86CrtcConfigPrivateIndex = xf86AllocateScrnInfoPrivateIndex(); + config = xnfcalloc (1, sizeof (xf86CrtcConfigRec)); + + config->funcs = funcs; + + scrn->privates[xf86CrtcConfigPrivateIndex].ptr = config; +} + +void +xf86CrtcSetSizeRange (ScrnInfoPtr scrn, + int minWidth, int minHeight, + int maxWidth, int maxHeight) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + + config->minWidth = minWidth; + config->minHeight = minHeight; + config->maxWidth = maxWidth; + config->maxHeight = maxHeight; +} + +void +xf86CrtcSetScanoutFormats(ScrnInfoPtr scrn, + int num_formats, + xf86CrtcScanoutFormat *formats) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + + config->num_scanout_formats = num_formats; + config->scanout_formats = formats; +} + +/* + * Crtc functions + */ +xf86CrtcPtr +xf86CrtcCreate (ScrnInfoPtr scrn, + const xf86CrtcFuncsRec *funcs) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + xf86CrtcPtr crtc, *crtcs; + + crtc = calloc(sizeof (xf86CrtcRec), 1); + if (!crtc) + return NULL; + crtc->version = XF86_CRTC_VERSION; + crtc->scrn = scrn; + crtc->funcs = funcs; +#ifdef RANDR_12_INTERFACE + crtc->randr_crtc = NULL; +#endif + crtc->rotation = RR_Rotate_0; + crtc->desiredRotation = RR_Rotate_0; + pixman_transform_init_identity (&crtc->crtc_to_framebuffer); + pixman_f_transform_init_identity (&crtc->f_crtc_to_framebuffer); + pixman_f_transform_init_identity (&crtc->f_framebuffer_to_crtc); + pixman_f_transform_init_identity (&crtc->f_screen_to_crtc); + pixman_f_transform_init_identity (&crtc->user_sprite_position_transform); + pixman_f_transform_init_identity (&crtc->f_crtc_to_cursor); + pixman_f_transform_init_identity (&crtc->user_sprite_image_transform); + crtc->filter = NULL; + crtc->params = NULL; + crtc->nparams = 0; + crtc->filter_width = 0; + crtc->filter_height = 0; + crtc->transform_in_use = FALSE; + crtc->sprite_transform_in_use = FALSE; + crtc->transformPresent = FALSE; + crtc->desiredTransformPresent = FALSE; + memset (&crtc->bounds, '\0', sizeof (crtc->bounds)); + + /* Preallocate gamma at a sensible size. */ + crtc->gamma_size = 256; + crtc->gamma_red = malloc(3 * crtc->gamma_size * sizeof (CARD16)); + if (!crtc->gamma_red) { + free(crtc); + return NULL; + } + crtc->gamma_green = crtc->gamma_red + crtc->gamma_size; + crtc->gamma_blue = crtc->gamma_green + crtc->gamma_size; + + if (xf86_config->crtc) + crtcs = realloc(xf86_config->crtc, + (xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr)); + else + crtcs = malloc((xf86_config->num_crtc + 1) * sizeof (xf86CrtcPtr)); + if (!crtcs) + { + free(crtc); + return NULL; + } + xf86_config->crtc = crtcs; + xf86_config->crtc[xf86_config->num_crtc++] = crtc; + return crtc; +} + +void +xf86CrtcDestroy (xf86CrtcPtr crtc) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); + int c; + + (*crtc->funcs->destroy) (crtc); + for (c = 0; c < xf86_config->num_crtc; c++) + if (xf86_config->crtc[c] == crtc) + { + memmove (&xf86_config->crtc[c], + &xf86_config->crtc[c+1], + ((xf86_config->num_crtc - (c + 1)) * sizeof(void*))); + xf86_config->num_crtc--; + break; + } + free(crtc->params); + free(crtc->gamma_red); + free(crtc); +} + + +/** + * Return whether any outputs are connected to the specified pipe + */ + +Bool +xf86CrtcInUse (xf86CrtcPtr crtc) +{ + ScrnInfoPtr pScrn = crtc->scrn; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + int o; + + for (o = 0; o < xf86_config->num_output; o++) + if (xf86_config->output[o]->crtc == crtc) + return TRUE; + return FALSE; +} + +void +xf86CrtcSetScreenSubpixelOrder (ScreenPtr pScreen) +{ + int subpixel_order = SubPixelUnknown; + Bool has_none = FALSE; + ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + int c, o; + + for (c = 0; c < xf86_config->num_crtc; c++) + { + xf86CrtcPtr crtc = xf86_config->crtc[c]; + + for (o = 0; o < xf86_config->num_output; o++) + { + xf86OutputPtr output = xf86_config->output[o]; + + if (output->crtc == crtc) + { + switch (output->subpixel_order) { + case SubPixelNone: + has_none = TRUE; + break; + case SubPixelUnknown: + break; + default: + subpixel_order = output->subpixel_order; + break; + } + } + if (subpixel_order != SubPixelUnknown) + break; + } + if (subpixel_order != SubPixelUnknown) + { + static const int circle[4] = { + SubPixelHorizontalRGB, + SubPixelVerticalRGB, + SubPixelHorizontalBGR, + SubPixelVerticalBGR, + }; + int rotate; + int c; + for (rotate = 0; rotate < 4; rotate++) + if (crtc->rotation & (1 << rotate)) + break; + for (c = 0; c < 4; c++) + if (circle[c] == subpixel_order) + break; + c = (c + rotate) & 0x3; + if ((crtc->rotation & RR_Reflect_X) && !(c & 1)) + c ^= 2; + if ((crtc->rotation & RR_Reflect_Y) && (c & 1)) + c ^= 2; + subpixel_order = circle[c]; + break; + } + } + if (subpixel_order == SubPixelUnknown && has_none) + subpixel_order = SubPixelNone; + PictureSetSubpixelOrder (pScreen, subpixel_order); +} + +/** + * Sets the given video mode on the given crtc + */ +Bool +xf86CrtcSet(xf86CrtcPtr crtc, xf86CrtcSetRec *set) +{ + ScrnInfoPtr scrn = crtc->scrn; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + int i; + Bool ret = FALSE; + Bool didLock = FALSE; + DisplayModePtr adjusted_mode = NULL; + DisplayModeRec saved_mode; + int saved_x, saved_y; + Rotation saved_rotation; + RRTransformRec saved_transform; + Bool saved_transform_present; + PixmapPtr saved_scanout_pixmap; + + crtc->enabled = xf86CrtcInUse (crtc); + + /* We only hit this if someone explicitly sends a "disabled" modeset. */ + if (!crtc->enabled) + { + /* Check everything for stuff that should be off. */ + xf86DisableUnusedFunctions(scrn); + return TRUE; + } + + /* See if nothing has changed */ + if (!set->flags) + return TRUE; + + saved_mode = crtc->mode; + saved_x = crtc->x; + saved_y = crtc->y; + saved_rotation = crtc->rotation; + saved_scanout_pixmap = crtc->scanoutPixmap; + if (crtc->transformPresent) { + RRTransformInit (&saved_transform); + RRTransformCopy (&saved_transform, &crtc->transform); + } + saved_transform_present = crtc->transformPresent; + + /* Update crtc values up front so the driver can rely on them for mode + * setting. + */ + if (set->flags & XF86CrtcSetMode) + crtc->mode = *set->mode; + if (set->flags & XF86CrtcSetOrigin) { + crtc->x = set->x; + crtc->y = set->y; + } + if (set->flags & XF86CrtcSetRotation) + crtc->rotation = set->rotation; + if (set->flags & XF86CrtcSetScanoutPixmap) + crtc->scanoutPixmap = set->scanout_pixmap; + + if (set->flags & XF86CrtcSetTransform) { + if (set->transform) { + RRTransformCopy (&crtc->transform, set->transform); + crtc->transformPresent = TRUE; + } else + crtc->transformPresent = FALSE; + } + + if (crtc->funcs->set) { + ret = crtc->funcs->set(crtc, set->flags); + goto done; + } + + if (set->flags == XF86CrtcSetOrigin && crtc->funcs->set_origin) { + ret = xf86CrtcRotate(crtc); + if (ret) + crtc->funcs->set_origin(crtc, crtc->x, crtc->y); + goto done; + } + + if (crtc->funcs->set_mode_major) { + ret = crtc->funcs->set_mode_major(crtc, &crtc->mode, + crtc->rotation, + crtc->x, crtc->y); + goto done; + } + + adjusted_mode = xf86DuplicateMode(&crtc->mode); + + didLock = crtc->funcs->lock (crtc); + /* Pass our mode to the outputs and the CRTC to give them a chance to + * adjust it according to limitations or output properties, and also + * a chance to reject the mode entirely. + */ + for (i = 0; i < xf86_config->num_output; i++) { + xf86OutputPtr output = xf86_config->output[i]; + + if (output->crtc != crtc) + continue; + + if (!output->funcs->mode_fixup(output, &crtc->mode, adjusted_mode)) { + goto done; + } + } + + if (!crtc->funcs->mode_fixup(crtc, &crtc->mode, adjusted_mode)) { + goto done; + } + + if (!xf86CrtcRotate (crtc)) + goto done; + + /* Prepare the outputs and CRTCs before setting the mode. */ + for (i = 0; i < xf86_config->num_output; i++) { + xf86OutputPtr output = xf86_config->output[i]; + + if (output->crtc != crtc) + continue; + + /* Disable the output as the first thing we do. */ + output->funcs->prepare(output); + } + + crtc->funcs->prepare(crtc); + + /* Set up the DPLL and any output state that needs to adjust or depend + * on the DPLL. + */ + crtc->funcs->mode_set(crtc, &crtc->mode, adjusted_mode, crtc->x, crtc->y); + for (i = 0; i < xf86_config->num_output; i++) + { + xf86OutputPtr output = xf86_config->output[i]; + if (output->crtc == crtc) + output->funcs->mode_set(output, &crtc->mode, adjusted_mode); + } + + /* Only upload when needed, to avoid unneeded delays. */ + if (!crtc->active && crtc->funcs->gamma_set) + crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green, + crtc->gamma_blue, crtc->gamma_size); + + /* Now, enable the clocks, plane, pipe, and outputs that we set up. */ + crtc->funcs->commit(crtc); + for (i = 0; i < xf86_config->num_output; i++) + { + xf86OutputPtr output = xf86_config->output[i]; + if (output->crtc == crtc) + output->funcs->commit(output); + } + + ret = TRUE; + +done: + if (ret) { + crtc->active = TRUE; + if (scrn->pScreen) + xf86CrtcSetScreenSubpixelOrder (scrn->pScreen); + if (scrn->ModeSet) + scrn->ModeSet(scrn); + } else { + crtc->x = saved_x; + crtc->y = saved_y; + crtc->rotation = saved_rotation; + crtc->mode = saved_mode; + if (saved_transform_present) + RRTransformCopy (&crtc->transform, &saved_transform); + crtc->transformPresent = saved_transform_present; + crtc->scanoutPixmap = saved_scanout_pixmap; + } + + if (adjusted_mode) { + free(adjusted_mode->name); + free(adjusted_mode); + } + + if (didLock) + crtc->funcs->unlock (crtc); + + return ret; +} + +/** + * Pans the screen, does not change the mode + */ +void +xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y) +{ + xf86CrtcSetRec set; + + if (x != crtc->x || y != crtc->y) { + set.x = x; + set.y = y; + set.flags = XF86CrtcSetOrigin; + (void) xf86CrtcSet(crtc, &set); + } +} + +/* + * Output functions + */ + +extern XF86ConfigPtr xf86configptr; + +typedef enum { + OPTION_PREFERRED_MODE, + OPTION_POSITION, + OPTION_BELOW, + OPTION_RIGHT_OF, + OPTION_ABOVE, + OPTION_LEFT_OF, + OPTION_ENABLE, + OPTION_DISABLE, + OPTION_MIN_CLOCK, + OPTION_MAX_CLOCK, + OPTION_IGNORE, + OPTION_ROTATE, + OPTION_PANNING, + OPTION_PRIMARY, + OPTION_DEFAULT_MODES, +} OutputOpts; + +static OptionInfoRec xf86OutputOptions[] = { + {OPTION_PREFERRED_MODE, "PreferredMode", OPTV_STRING, {0}, FALSE }, + {OPTION_POSITION, "Position", OPTV_STRING, {0}, FALSE }, + {OPTION_BELOW, "Below", OPTV_STRING, {0}, FALSE }, + {OPTION_RIGHT_OF, "RightOf", OPTV_STRING, {0}, FALSE }, + {OPTION_ABOVE, "Above", OPTV_STRING, {0}, FALSE }, + {OPTION_LEFT_OF, "LeftOf", OPTV_STRING, {0}, FALSE }, + {OPTION_ENABLE, "Enable", OPTV_BOOLEAN, {0}, FALSE }, + {OPTION_DISABLE, "Disable", OPTV_BOOLEAN, {0}, FALSE }, + {OPTION_MIN_CLOCK, "MinClock", OPTV_FREQ, {0}, FALSE }, + {OPTION_MAX_CLOCK, "MaxClock", OPTV_FREQ, {0}, FALSE }, + {OPTION_IGNORE, "Ignore", OPTV_BOOLEAN, {0}, FALSE }, + {OPTION_ROTATE, "Rotate", OPTV_STRING, {0}, FALSE }, + {OPTION_PANNING, "Panning", OPTV_STRING, {0}, FALSE }, + {OPTION_PRIMARY, "Primary", OPTV_BOOLEAN, {0}, FALSE }, + {OPTION_DEFAULT_MODES, "DefaultModes", OPTV_BOOLEAN, {0}, FALSE }, + {-1, NULL, OPTV_NONE, {0}, FALSE }, +}; + +enum { + OPTION_MODEDEBUG, +}; + +static OptionInfoRec xf86DeviceOptions[] = { + {OPTION_MODEDEBUG, "ModeDebug", OPTV_BOOLEAN, {0}, FALSE }, + {-1, NULL, OPTV_NONE, {0}, FALSE }, +}; + +static void +xf86OutputSetMonitor (xf86OutputPtr output) +{ + char *option_name; + char *monitor; + + if (!output->name) + return; + + free(output->options); + + output->options = xnfalloc (sizeof (xf86OutputOptions)); + memcpy (output->options, xf86OutputOptions, sizeof (xf86OutputOptions)); + + XNFasprintf(&option_name, "monitor-%s", output->name); + monitor = xf86findOptionValue (output->scrn->options, option_name); + if (!monitor) + monitor = output->name; + else + xf86MarkOptionUsedByName (output->scrn->options, option_name); + free(option_name); + output->conf_monitor = xf86findMonitor (monitor, + xf86configptr->conf_monitor_lst); + /* + * Find the monitor section of the screen and use that + */ + if (!output->conf_monitor && output->use_screen_monitor) + output->conf_monitor = xf86findMonitor (output->scrn->monitor->id, + xf86configptr->conf_monitor_lst); + if (output->conf_monitor) + { + xf86DrvMsg (output->scrn->scrnIndex, X_INFO, + "Output %s using monitor section %s\n", + output->name, output->conf_monitor->mon_identifier); + xf86ProcessOptions (output->scrn->scrnIndex, + output->conf_monitor->mon_option_lst, + output->options); + } + else + xf86DrvMsg (output->scrn->scrnIndex, X_INFO, + "Output %s has no monitor section\n", + output->name); +} + +static Bool +xf86OutputEnabled (xf86OutputPtr output, Bool strict) +{ + Bool enable, disable; + + /* check to see if this output was enabled in the config file */ + if (xf86GetOptValBool (output->options, OPTION_ENABLE, &enable) && enable) + { + xf86DrvMsg (output->scrn->scrnIndex, X_INFO, + "Output %s enabled by config file\n", output->name); + return TRUE; + } + /* or if this output was disabled in the config file */ + if (xf86GetOptValBool (output->options, OPTION_DISABLE, &disable) && disable) + { + xf86DrvMsg (output->scrn->scrnIndex, X_INFO, + "Output %s disabled by config file\n", output->name); + return FALSE; + } + + /* If not, try to only light up the ones we know are connected */ + if (strict) { + enable = output->status == XF86OutputStatusConnected; + } + /* But if that fails, try to light up even outputs we're unsure of */ + else { + enable = output->status != XF86OutputStatusDisconnected; + } + + xf86DrvMsg (output->scrn->scrnIndex, X_INFO, + "Output %s %sconnected\n", output->name, enable ? "" : "dis"); + return enable; +} + +static Bool +xf86OutputIgnored (xf86OutputPtr output) +{ + return xf86ReturnOptValBool (output->options, OPTION_IGNORE, FALSE); +} + +static char *direction[4] = { + "normal", + "left", + "inverted", + "right" +}; + +static Rotation +xf86OutputInitialRotation (xf86OutputPtr output) +{ + char *rotate_name = xf86GetOptValString (output->options, + OPTION_ROTATE); + int i; + + if (!rotate_name) { + if (output->initial_rotation) + return output->initial_rotation; + return RR_Rotate_0; + } + + for (i = 0; i < 4; i++) + if (xf86nameCompare (direction[i], rotate_name) == 0) + return 1 << i; + return RR_Rotate_0; +} + +xf86OutputPtr +xf86OutputCreate (ScrnInfoPtr scrn, + const xf86OutputFuncsRec *funcs, + const char *name) +{ + xf86OutputPtr output, *outputs; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + int len; + Bool primary; + + if (name) + len = strlen (name) + 1; + else + len = 0; + + output = calloc(sizeof (xf86OutputRec) + len, 1); + if (!output) + return NULL; + output->scrn = scrn; + output->funcs = funcs; + if (name) + { + output->name = (char *) (output + 1); + strcpy (output->name, name); + } + output->subpixel_order = SubPixelUnknown; + /* + * Use the old per-screen monitor section for the first output + */ + output->use_screen_monitor = (xf86_config->num_output == 0); +#ifdef RANDR_12_INTERFACE + output->randr_output = NULL; +#endif + if (name) + { + xf86OutputSetMonitor (output); + if (xf86OutputIgnored (output)) + { + free(output); + return FALSE; + } + } + + + if (xf86_config->output) + outputs = realloc(xf86_config->output, + (xf86_config->num_output + 1) * sizeof (xf86OutputPtr)); + else + outputs = malloc((xf86_config->num_output + 1) * sizeof (xf86OutputPtr)); + if (!outputs) + { + free(output); + return NULL; + } + + xf86_config->output = outputs; + + if (xf86GetOptValBool (output->options, OPTION_PRIMARY, &primary) && primary) + { + memmove(xf86_config->output + 1, xf86_config->output, + xf86_config->num_output * sizeof (xf86OutputPtr)); + xf86_config->output[0] = output; + } + else + { + xf86_config->output[xf86_config->num_output] = output; + } + + xf86_config->num_output++; + + return output; +} + +Bool +xf86OutputRename (xf86OutputPtr output, const char *name) +{ + char *newname = strdup(name); + + if (!newname) + return FALSE; /* so sorry... */ + + if (output->name && output->name != (char *) (output + 1)) + free(output->name); + output->name = newname; + xf86OutputSetMonitor (output); + if (xf86OutputIgnored (output)) + return FALSE; + return TRUE; +} + +void +xf86OutputUseScreenMonitor (xf86OutputPtr output, Bool use_screen_monitor) +{ + if (use_screen_monitor != output->use_screen_monitor) + { + output->use_screen_monitor = use_screen_monitor; + xf86OutputSetMonitor (output); + } +} + +void +xf86OutputDestroy (xf86OutputPtr output) +{ + ScrnInfoPtr scrn = output->scrn; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + int o; + + (*output->funcs->destroy) (output); + while (output->probed_modes) + xf86DeleteMode (&output->probed_modes, output->probed_modes); + for (o = 0; o < xf86_config->num_output; o++) + if (xf86_config->output[o] == output) + { + memmove (&xf86_config->output[o], + &xf86_config->output[o+1], + ((xf86_config->num_output - (o + 1)) * sizeof(void*))); + xf86_config->num_output--; + break; + } + if (output->name && output->name != (char *) (output + 1)) + free(output->name); + free(output); +} + +/* + * Called during CreateScreenResources to hook up RandR + */ +static Bool +xf86CrtcCreateScreenResources (ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + + screen->CreateScreenResources = config->CreateScreenResources; + + if (!(*screen->CreateScreenResources)(screen)) + return FALSE; + + if (!xf86RandR12CreateScreenResources (screen)) + return FALSE; + + return TRUE; +} + +/* + * Clean up config on server reset + */ +static Bool +xf86CrtcCloseScreen (int index, ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int o, c; + + screen->CloseScreen = config->CloseScreen; + + xf86RotateCloseScreen (screen); + + for (o = 0; o < config->num_output; o++) + { + xf86OutputPtr output = config->output[o]; + + output->randr_output = NULL; + } + for (c = 0; c < config->num_crtc; c++) + { + xf86CrtcPtr crtc = config->crtc[c]; + + crtc->randr_crtc = NULL; + } + xf86RandR12CloseScreen (screen); + + return screen->CloseScreen (index, screen); +} + +/* + * Called at ScreenInit time to set up + */ +#ifdef RANDR_13_INTERFACE +int +#else +Bool +#endif +xf86CrtcScreenInit (ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int c; + + /* Rotation */ + xf86DrvMsg(scrn->scrnIndex, X_INFO, "RandR 1.2 enabled, ignore the following RandR disabled message.\n"); + xf86DisableRandR(); /* Disable old RandR extension support */ + xf86RandR12Init (screen); + + /* support all rotations if every crtc has the shadow alloc funcs */ + for (c = 0; c < config->num_crtc; c++) + { + xf86CrtcPtr crtc = config->crtc[c]; + if (!crtc->funcs->shadow_allocate || !crtc->funcs->shadow_create) + break; + } + if (c == config->num_crtc) + { + xf86RandR12SetRotations (screen, RR_Rotate_0 | RR_Rotate_90 | + RR_Rotate_180 | RR_Rotate_270 | + RR_Reflect_X | RR_Reflect_Y); + xf86RandR12SetTransformSupport (screen, TRUE); + } + else + { + xf86RandR12SetRotations (screen, RR_Rotate_0); + xf86RandR12SetTransformSupport (screen, FALSE); + } + + /* Wrap CreateScreenResources so we can initialize the RandR code */ + config->CreateScreenResources = screen->CreateScreenResources; + screen->CreateScreenResources = xf86CrtcCreateScreenResources; + + config->CloseScreen = screen->CloseScreen; + screen->CloseScreen = xf86CrtcCloseScreen; + +#ifdef XFreeXDGA + _xf86_di_dga_init_internal(screen); +#endif +#ifdef RANDR_13_INTERFACE + return RANDR_INTERFACE_VERSION; +#else + return TRUE; +#endif +} + +static DisplayModePtr +xf86DefaultMode (xf86OutputPtr output, int width, int height) +{ + DisplayModePtr target_mode = NULL; + DisplayModePtr mode; + int target_diff = 0; + int target_preferred = 0; + int mm_height; + + mm_height = output->mm_height; + if (!mm_height) + mm_height = (768 * 25.4) / DEFAULT_DPI; + /* + * Pick a mode closest to DEFAULT_DPI + */ + for (mode = output->probed_modes; mode; mode = mode->next) + { + int dpi; + int preferred = (((mode->type & M_T_PREFERRED) != 0) + + ((mode->type & M_T_USERPREF) != 0)); + int diff; + + if (xf86ModeWidth (mode, output->initial_rotation) > width || + xf86ModeHeight (mode, output->initial_rotation) > height) + continue; + + /* yes, use VDisplay here, not xf86ModeHeight */ + dpi = (mode->VDisplay * 254) / (mm_height * 10); + diff = dpi - DEFAULT_DPI; + diff = diff < 0 ? -diff : diff; + if (target_mode == NULL || (preferred > target_preferred) || + (preferred == target_preferred && diff < target_diff)) + { + target_mode = mode; + target_diff = diff; + target_preferred = preferred; + } + } + return target_mode; +} + +static DisplayModePtr +xf86ClosestMode (xf86OutputPtr output, + DisplayModePtr match, Rotation match_rotation, + int width, int height) +{ + DisplayModePtr target_mode = NULL; + DisplayModePtr mode; + int target_diff = 0; + + /* + * Pick a mode closest to the specified mode + */ + for (mode = output->probed_modes; mode; mode = mode->next) + { + int dx, dy; + int diff; + + if (xf86ModeWidth (mode, output->initial_rotation) > width || + xf86ModeHeight (mode, output->initial_rotation) > height) + continue; + + /* exact matches are preferred */ + if (output->initial_rotation == match_rotation && + xf86ModesEqual (mode, match)) + return mode; + + dx = xf86ModeWidth (match, match_rotation) - xf86ModeWidth (mode, output->initial_rotation); + dy = xf86ModeHeight (match, match_rotation) - xf86ModeHeight (mode, output->initial_rotation); + diff = dx * dx + dy * dy; + if (target_mode == NULL || diff < target_diff) + { + target_mode = mode; + target_diff = diff; + } + } + return target_mode; +} + +static DisplayModePtr +xf86OutputHasPreferredMode (xf86OutputPtr output, int width, int height) +{ + DisplayModePtr mode; + + for (mode = output->probed_modes; mode; mode = mode->next) + { + if (xf86ModeWidth (mode, output->initial_rotation) > width || + xf86ModeHeight (mode, output->initial_rotation) > height) + continue; + + if (mode->type & M_T_PREFERRED) + return mode; + } + return NULL; +} + +static DisplayModePtr +xf86OutputHasUserPreferredMode (xf86OutputPtr output) +{ + DisplayModePtr mode, first = output->probed_modes; + + for (mode = first; mode && mode->next != first; mode = mode->next) + if (mode->type & M_T_USERPREF) + return mode; + + return NULL; +} + +static int +xf86PickCrtcs (ScrnInfoPtr scrn, + xf86CrtcPtr *best_crtcs, + DisplayModePtr *modes, + int n, + int width, + int height) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int c, o; + xf86OutputPtr output; + xf86CrtcPtr crtc; + xf86CrtcPtr *crtcs; + xf86CrtcPtr best_crtc; + int best_score; + int score; + int my_score; + + if (n == config->num_output) + return 0; + output = config->output[n]; + + /* + * Compute score with this output disabled + */ + best_crtcs[n] = NULL; + best_crtc = NULL; + best_score = xf86PickCrtcs (scrn, best_crtcs, modes, n+1, width, height); + if (modes[n] == NULL) + return best_score; + + crtcs = malloc(config->num_output * sizeof (xf86CrtcPtr)); + if (!crtcs) + return best_score; + + my_score = 1; + /* Score outputs that are known to be connected higher */ + if (output->status == XF86OutputStatusConnected) + my_score++; + /* Score outputs with preferred modes higher */ + if (xf86OutputHasPreferredMode (output, width, height)) + my_score++; + /* + * Select a crtc for this output and + * then attempt to configure the remaining + * outputs + */ + for (c = 0; c < config->num_crtc; c++) + { + if ((output->possible_crtcs & (1 << c)) == 0) + continue; + + crtc = config->crtc[c]; + /* + * Check to see if some other output is + * using this crtc + */ + for (o = 0; o < n; o++) + if (best_crtcs[o] == crtc) + break; + if (o < n) + { + /* + * If the two outputs desire the same mode, + * see if they can be cloned + */ + if (xf86ModesEqual (modes[o], modes[n]) && + config->output[o]->initial_rotation == config->output[n]->initial_rotation && + config->output[o]->initial_x == config->output[n]->initial_x && + config->output[o]->initial_y == config->output[n]->initial_y) + { + if ((output->possible_clones & (1 << o)) == 0) + continue; /* nope, try next CRTC */ + } + else + continue; /* different modes, can't clone */ + } + crtcs[n] = crtc; + memcpy (crtcs, best_crtcs, n * sizeof (xf86CrtcPtr)); + score = my_score + xf86PickCrtcs (scrn, crtcs, modes, n+1, width, height); + if (score > best_score) + { + best_crtc = crtc; + best_score = score; + memcpy (best_crtcs, crtcs, config->num_output * sizeof (xf86CrtcPtr)); + } + } + free(crtcs); + return best_score; +} + + +/* + * Compute the virtual size necessary to place all of the available + * crtcs in the specified configuration. + * + * canGrow indicates that the driver can make the screen larger than its initial + * configuration. If FALSE, this function will enlarge the screen to include + * the largest available mode. + */ + +static void +xf86DefaultScreenLimits (ScrnInfoPtr scrn, int *widthp, int *heightp, + Bool canGrow) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int width = 0, height = 0; + int o; + int c; + int s; + + for (c = 0; c < config->num_crtc; c++) + { + int crtc_width = 0, crtc_height = 0; + xf86CrtcPtr crtc = config->crtc[c]; + + if (crtc->enabled) + { + crtc_width = crtc->desiredX + xf86ModeWidth (&crtc->desiredMode, crtc->desiredRotation); + crtc_height = crtc->desiredY + xf86ModeHeight (&crtc->desiredMode, crtc->desiredRotation); + } + if (!canGrow) { + for (o = 0; o < config->num_output; o++) + { + xf86OutputPtr output = config->output[o]; + + for (s = 0; s < config->num_crtc; s++) + if (output->possible_crtcs & (1 << s)) + { + DisplayModePtr mode; + for (mode = output->probed_modes; mode; mode = mode->next) + { + if (mode->HDisplay > crtc_width) + crtc_width = mode->HDisplay; + if (mode->VDisplay > crtc_width) + crtc_width = mode->VDisplay; + if (mode->VDisplay > crtc_height) + crtc_height = mode->VDisplay; + if (mode->HDisplay > crtc_height) + crtc_height = mode->HDisplay; + } + } + } + } + if (crtc_width > width) + width = crtc_width; + if (crtc_height > height) + height = crtc_height; + } + if (config->maxWidth && width > config->maxWidth) width = config->maxWidth; + if (config->maxHeight && height > config->maxHeight) height = config->maxHeight; + if (config->minWidth && width < config->minWidth) width = config->minWidth; + if (config->minHeight && height < config->minHeight) height = config->minHeight; + *widthp = width; + *heightp = height; +} + +#define POSITION_UNSET -100000 + +/* + * check if the user configured any outputs at all + * with either a position or a relative setting or a mode. + */ +static Bool +xf86UserConfiguredOutputs(ScrnInfoPtr scrn, DisplayModePtr *modes) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int o; + Bool user_conf = FALSE; + + for (o = 0; o < config->num_output; o++) + { + xf86OutputPtr output = config->output[o]; + char *position; + char *relative_name; + OutputOpts relation; + int r; + static const OutputOpts relations[] = { + OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF + }; + + position = xf86GetOptValString (output->options, + OPTION_POSITION); + if (position) + user_conf = TRUE; + + relation = 0; + relative_name = NULL; + for (r = 0; r < 4; r++) + { + relation = relations[r]; + relative_name = xf86GetOptValString (output->options, + relation); + if (relative_name) + break; + } + if (relative_name) + user_conf = TRUE; + + modes[o] = xf86OutputHasUserPreferredMode(output); + if (modes[o]) + user_conf = TRUE; + } + + return user_conf; +} + +static Bool +xf86InitialOutputPositions (ScrnInfoPtr scrn, DisplayModePtr *modes) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int o; + int min_x, min_y; + + for (o = 0; o < config->num_output; o++) + { + xf86OutputPtr output = config->output[o]; + + output->initial_x = output->initial_y = POSITION_UNSET; + } + + /* + * Loop until all outputs are set + */ + for (;;) + { + Bool any_set = FALSE; + Bool keep_going = FALSE; + + for (o = 0; o < config->num_output; o++) + { + static const OutputOpts relations[] = { + OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF + }; + xf86OutputPtr output = config->output[o]; + xf86OutputPtr relative; + char *relative_name; + char *position; + OutputOpts relation; + int r; + + if (output->initial_x != POSITION_UNSET) + continue; + position = xf86GetOptValString (output->options, + OPTION_POSITION); + /* + * Absolute position wins + */ + if (position) + { + int x, y; + if (sscanf (position, "%d %d", &x, &y) == 2) + { + output->initial_x = x; + output->initial_y = y; + } + else + { + xf86DrvMsg (scrn->scrnIndex, X_ERROR, + "Output %s position not of form \"x y\"\n", + output->name); + output->initial_x = output->initial_y = 0; + } + any_set = TRUE; + continue; + } + /* + * Next comes relative positions + */ + relation = 0; + relative_name = NULL; + for (r = 0; r < 4; r++) + { + relation = relations[r]; + relative_name = xf86GetOptValString (output->options, + relation); + if (relative_name) + break; + } + if (relative_name) + { + int or; + relative = NULL; + for (or = 0; or < config->num_output; or++) + { + xf86OutputPtr out_rel = config->output[or]; + XF86ConfMonitorPtr rel_mon = out_rel->conf_monitor; + + if (rel_mon) + { + if (xf86nameCompare (rel_mon->mon_identifier, + relative_name) == 0) + { + relative = config->output[or]; + break; + } + } + if (strcmp (out_rel->name, relative_name) == 0) + { + relative = config->output[or]; + break; + } + } + if (!relative) + { + xf86DrvMsg (scrn->scrnIndex, X_ERROR, + "Cannot position output %s relative to unknown output %s\n", + output->name, relative_name); + output->initial_x = 0; + output->initial_y = 0; + any_set = TRUE; + continue; + } + if (!modes[or]) + { + xf86DrvMsg (scrn->scrnIndex, X_ERROR, + "Cannot position output %s relative to output %s without modes\n", + output->name, relative_name); + output->initial_x = 0; + output->initial_y = 0; + any_set = TRUE; + continue; + } + if (relative->initial_x == POSITION_UNSET) + { + keep_going = TRUE; + continue; + } + output->initial_x = relative->initial_x; + output->initial_y = relative->initial_y; + switch (relation) { + case OPTION_BELOW: + output->initial_y += xf86ModeHeight (modes[or], relative->initial_rotation); + break; + case OPTION_RIGHT_OF: + output->initial_x += xf86ModeWidth (modes[or], relative->initial_rotation); + break; + case OPTION_ABOVE: + if (modes[o]) + output->initial_y -= xf86ModeHeight (modes[o], output->initial_rotation); + break; + case OPTION_LEFT_OF: + if (modes[o]) + output->initial_x -= xf86ModeWidth (modes[o], output->initial_rotation); + break; + default: + break; + } + any_set = TRUE; + continue; + } + + /* Nothing set, just stick them at 0,0 */ + output->initial_x = 0; + output->initial_y = 0; + any_set = TRUE; + } + if (!keep_going) + break; + if (!any_set) + { + for (o = 0; o < config->num_output; o++) + { + xf86OutputPtr output = config->output[o]; + if (output->initial_x == POSITION_UNSET) + { + xf86DrvMsg (scrn->scrnIndex, X_ERROR, + "Output position loop. Moving %s to 0,0\n", + output->name); + output->initial_x = output->initial_y = 0; + break; + } + } + } + } + + /* + * normalize positions + */ + min_x = 1000000; + min_y = 1000000; + for (o = 0; o < config->num_output; o++) + { + xf86OutputPtr output = config->output[o]; + + if (output->initial_x < min_x) + min_x = output->initial_x; + if (output->initial_y < min_y) + min_y = output->initial_y; + } + + for (o = 0; o < config->num_output; o++) + { + xf86OutputPtr output = config->output[o]; + + output->initial_x -= min_x; + output->initial_y -= min_y; + } + return TRUE; +} + +static void +xf86InitialPanning (ScrnInfoPtr scrn) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int o; + + for (o = 0; o < config->num_output; o++) + { + xf86OutputPtr output = config->output[o]; + char *panning = xf86GetOptValString (output->options, OPTION_PANNING); + int width, height, left, top; + int track_width, track_height, track_left, track_top; + int brdr[4]; + + memset (&output->initialTotalArea, 0, sizeof(BoxRec)); + memset (&output->initialTrackingArea, 0, sizeof(BoxRec)); + memset (output->initialBorder, 0, 4*sizeof(INT16)); + + if (! panning) + continue; + + switch (sscanf (panning, "%dx%d+%d+%d/%dx%d+%d+%d/%d/%d/%d/%d", + &width, &height, &left, &top, + &track_width, &track_height, &track_left, &track_top, + &brdr[0], &brdr[1], &brdr[2], &brdr[3])) { + case 12: + output->initialBorder[0] = brdr[0]; + output->initialBorder[1] = brdr[1]; + output->initialBorder[2] = brdr[2]; + output->initialBorder[3] = brdr[3]; + /* fall through */ + case 8: + output->initialTrackingArea.x1 = track_left; + output->initialTrackingArea.y1 = track_top; + output->initialTrackingArea.x2 = track_left + track_width; + output->initialTrackingArea.y2 = track_top + track_height; + /* fall through */ + case 4: + output->initialTotalArea.x1 = left; + output->initialTotalArea.y1 = top; + /* fall through */ + case 2: + output->initialTotalArea.x2 = output->initialTotalArea.x1 + width; + output->initialTotalArea.y2 = output->initialTotalArea.y1 + height; + break; + default: + xf86DrvMsg (scrn->scrnIndex, X_ERROR, + "Broken panning specification '%s' for output %s in config file\n", + panning, output->name); + } + } +} + +/** Return - 0 + if a should be earlier, same or later than b in list + */ +static int +xf86ModeCompare (DisplayModePtr a, DisplayModePtr b) +{ + int diff; + + diff = ((b->type & M_T_PREFERRED) != 0) - ((a->type & M_T_PREFERRED) != 0); + if (diff) + return diff; + diff = b->HDisplay * b->VDisplay - a->HDisplay * a->VDisplay; + if (diff) + return diff; + diff = b->Clock - a->Clock; + return diff; +} + +/** + * Insertion sort input in-place and return the resulting head + */ +static DisplayModePtr +xf86SortModes (DisplayModePtr input) +{ + DisplayModePtr output = NULL, i, o, n, *op, prev; + + /* sort by preferred status and pixel area */ + while (input) + { + i = input; + input = input->next; + for (op = &output; (o = *op); op = &o->next) + if (xf86ModeCompare (o, i) > 0) + break; + i->next = *op; + *op = i; + } + /* prune identical modes */ + for (o = output; o && (n = o->next); o = n) + { + if (!strcmp (o->name, n->name) && xf86ModesEqual (o, n)) + { + o->next = n->next; + free(n->name); + free(n); + n = o; + } + } + /* hook up backward links */ + prev = NULL; + for (o = output; o; o = o->next) + { + o->prev = prev; + prev = o; + } + return output; +} + +static char * +preferredMode(ScrnInfoPtr pScrn, xf86OutputPtr output) +{ + char *preferred_mode = NULL; + + /* Check for a configured preference for a particular mode */ + preferred_mode = xf86GetOptValString (output->options, + OPTION_PREFERRED_MODE); + if (preferred_mode) + return preferred_mode; + + if (pScrn->display->modes && *pScrn->display->modes) + preferred_mode = *pScrn->display->modes; + + return preferred_mode; +} + +static void +GuessRangeFromModes(MonPtr mon, DisplayModePtr mode) +{ + if (!mon || !mode) + return; + + mon->nHsync = 1; + mon->hsync[0].lo = 1024.0; + mon->hsync[0].hi = 0.0; + + mon->nVrefresh = 1; + mon->vrefresh[0].lo = 1024.0; + mon->vrefresh[0].hi = 0.0; + + while (mode) { + if (!mode->HSync) + mode->HSync = ((float) mode->Clock ) / ((float) mode->HTotal); + + if (!mode->VRefresh) + mode->VRefresh = (1000.0 * ((float) mode->Clock)) / + ((float) (mode->HTotal * mode->VTotal)); + + if (mode->HSync < mon->hsync[0].lo) + mon->hsync[0].lo = mode->HSync; + + if (mode->HSync > mon->hsync[0].hi) + mon->hsync[0].hi = mode->HSync; + + if (mode->VRefresh < mon->vrefresh[0].lo) + mon->vrefresh[0].lo = mode->VRefresh; + + if (mode->VRefresh > mon->vrefresh[0].hi) + mon->vrefresh[0].hi = mode->VRefresh; + + mode = mode->next; + } + + /* stretch out the bottom to fit 640x480@60 */ + if (mon->hsync[0].lo > 31.0) + mon->hsync[0].lo = 31.0; + if (mon->vrefresh[0].lo > 58.0) + mon->vrefresh[0].lo = 58.0; +} + +enum det_monrec_source { + sync_config, sync_edid, sync_default +}; + +struct det_monrec_parameter { + MonRec *mon_rec; + int *max_clock; + Bool set_hsync; + Bool set_vrefresh; + enum det_monrec_source *sync_source; +}; + +static void handle_detailed_monrec(struct detailed_monitor_section *det_mon, + void *data) +{ + struct det_monrec_parameter *p; + p = (struct det_monrec_parameter *)data; + + if (det_mon->type == DS_RANGES) { + struct monitor_ranges *ranges = &det_mon->section.ranges; + if (p->set_hsync && ranges->max_h) { + p->mon_rec->hsync[p->mon_rec->nHsync].lo = ranges->min_h; + p->mon_rec->hsync[p->mon_rec->nHsync].hi = ranges->max_h; + p->mon_rec->nHsync++; + if (*p->sync_source == sync_default) + *p->sync_source = sync_edid; + } + if (p->set_vrefresh && ranges->max_v) { + p->mon_rec->vrefresh[p->mon_rec->nVrefresh].lo = ranges->min_v; + p->mon_rec->vrefresh[p->mon_rec->nVrefresh].hi = ranges->max_v; + p->mon_rec->nVrefresh++; + if (*p->sync_source == sync_default) + *p->sync_source = sync_edid; + } + if (ranges->max_clock * 1000 > *p->max_clock) + *p->max_clock = ranges->max_clock * 1000; + } +} + +void +xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int o; + + /* When canGrow was TRUE in the initial configuration we have to + * compare against the maximum values so that we don't drop modes. + * When canGrow was FALSE, the maximum values would have been clamped + * anyway. + */ + if (maxX == 0 || maxY == 0) { + maxX = config->maxWidth; + maxY = config->maxHeight; + } + + /* Probe the list of modes for each output. */ + for (o = 0; o < config->num_output; o++) + { + xf86OutputPtr output = config->output[o]; + DisplayModePtr mode; + DisplayModePtr config_modes = NULL, output_modes, default_modes = NULL; + char *preferred_mode; + xf86MonPtr edid_monitor; + XF86ConfMonitorPtr conf_monitor; + MonRec mon_rec; + int min_clock = 0; + int max_clock = 0; + double clock; + Bool add_default_modes = xf86ReturnOptValBool(output->options, OPTION_DEFAULT_MODES, TRUE); + Bool debug_modes = config->debug_modes || + xf86Initialising; + enum det_monrec_source sync_source = sync_default; + + while (output->probed_modes != NULL) + xf86DeleteMode(&output->probed_modes, output->probed_modes); + + /* + * Check connection status + */ + output->status = (*output->funcs->detect)(output); + + if (output->status == XF86OutputStatusDisconnected && + !xf86ReturnOptValBool(output->options, OPTION_ENABLE, FALSE)) + { + xf86OutputSetEDID (output, NULL); + continue; + } + + memset (&mon_rec, '\0', sizeof (mon_rec)); + + conf_monitor = output->conf_monitor; + + if (conf_monitor) + { + int i; + + for (i = 0; i < conf_monitor->mon_n_hsync; i++) + { + mon_rec.hsync[mon_rec.nHsync].lo = conf_monitor->mon_hsync[i].lo; + mon_rec.hsync[mon_rec.nHsync].hi = conf_monitor->mon_hsync[i].hi; + mon_rec.nHsync++; + sync_source = sync_config; + } + for (i = 0; i < conf_monitor->mon_n_vrefresh; i++) + { + mon_rec.vrefresh[mon_rec.nVrefresh].lo = conf_monitor->mon_vrefresh[i].lo; + mon_rec.vrefresh[mon_rec.nVrefresh].hi = conf_monitor->mon_vrefresh[i].hi; + mon_rec.nVrefresh++; + sync_source = sync_config; + } + config_modes = xf86GetMonitorModes (scrn, conf_monitor); + } + + output_modes = (*output->funcs->get_modes) (output); + + edid_monitor = output->MonInfo; + + if (edid_monitor) + { + struct det_monrec_parameter p; + struct disp_features *features = &edid_monitor->features; + + /* if display is not continuous-frequency, don't add default modes */ + if (!GTF_SUPPORTED(features->msc)) + add_default_modes = FALSE; + + p.mon_rec = &mon_rec; + p.max_clock = &max_clock; + p.set_hsync = mon_rec.nHsync == 0; + p.set_vrefresh = mon_rec.nVrefresh == 0; + p.sync_source = &sync_source; + + xf86ForEachDetailedBlock(edid_monitor, + handle_detailed_monrec, + &p); + } + + if (xf86GetOptValFreq (output->options, OPTION_MIN_CLOCK, + OPTUNITS_KHZ, &clock)) + min_clock = (int) clock; + if (xf86GetOptValFreq (output->options, OPTION_MAX_CLOCK, + OPTUNITS_KHZ, &clock)) + max_clock = (int) clock; + + /* If we still don't have a sync range, guess wildly */ + if (!mon_rec.nHsync || !mon_rec.nVrefresh) + GuessRangeFromModes(&mon_rec, output_modes); + + /* + * These limits will end up setting a 1024x768@60Hz mode by default, + * which seems like a fairly good mode to use when nothing else is + * specified + */ + if (mon_rec.nHsync == 0) + { + mon_rec.hsync[0].lo = 31.0; + mon_rec.hsync[0].hi = 55.0; + mon_rec.nHsync = 1; + } + if (mon_rec.nVrefresh == 0) + { + mon_rec.vrefresh[0].lo = 58.0; + mon_rec.vrefresh[0].hi = 62.0; + mon_rec.nVrefresh = 1; + } + + if (add_default_modes) + default_modes = xf86GetDefaultModes (); + + /* + * If this is not an RB monitor, remove RB modes from the default + * pool. RB modes from the config or the monitor itself are fine. + */ + if (!mon_rec.reducedblanking) + xf86ValidateModesReducedBlanking (scrn, default_modes); + + if (sync_source == sync_config) + { + /* + * Check output and config modes against sync range from config file + */ + xf86ValidateModesSync (scrn, output_modes, &mon_rec); + xf86ValidateModesSync (scrn, config_modes, &mon_rec); + } + /* + * Check default modes against sync range + */ + xf86ValidateModesSync (scrn, default_modes, &mon_rec); + /* + * Check default modes against monitor max clock + */ + if (max_clock) { + xf86ValidateModesClocks(scrn, default_modes, + &min_clock, &max_clock, 1); + xf86ValidateModesClocks(scrn, output_modes, + &min_clock, &max_clock, 1); + } + + output->probed_modes = NULL; + output->probed_modes = xf86ModesAdd (output->probed_modes, config_modes); + output->probed_modes = xf86ModesAdd (output->probed_modes, output_modes); + output->probed_modes = xf86ModesAdd (output->probed_modes, default_modes); + + /* + * Check all modes against max size, interlace, and doublescan + */ + if (maxX && maxY) + xf86ValidateModesSize (scrn, output->probed_modes, + maxX, maxY, 0); + + { + int flags = (output->interlaceAllowed ? V_INTERLACE : 0) | + (output->doubleScanAllowed ? V_DBLSCAN : 0); + xf86ValidateModesFlags (scrn, output->probed_modes, flags); + } + + /* + * Check all modes against output + */ + for (mode = output->probed_modes; mode != NULL; mode = mode->next) + if (mode->status == MODE_OK) + mode->status = (*output->funcs->mode_valid)(output, mode); + + xf86PruneInvalidModes(scrn, &output->probed_modes, debug_modes); + + output->probed_modes = xf86SortModes (output->probed_modes); + + /* Check for a configured preference for a particular mode */ + preferred_mode = preferredMode(scrn, output); + + if (preferred_mode) + { + for (mode = output->probed_modes; mode; mode = mode->next) + { + if (!strcmp (preferred_mode, mode->name)) + { + if (mode != output->probed_modes) + { + if (mode->prev) + mode->prev->next = mode->next; + if (mode->next) + mode->next->prev = mode->prev; + mode->next = output->probed_modes; + output->probed_modes->prev = mode; + mode->prev = NULL; + output->probed_modes = mode; + } + mode->type |= (M_T_PREFERRED|M_T_USERPREF); + break; + } + } + } + + output->initial_rotation = xf86OutputInitialRotation (output); + + if (debug_modes) { + if (output->probed_modes != NULL) { + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "Printing probed modes for output %s\n", + output->name); + } else { + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "No remaining probed modes for output %s\n", + output->name); + } + } + for (mode = output->probed_modes; mode != NULL; mode = mode->next) + { + /* The code to choose the best mode per pipe later on will require + * VRefresh to be set. + */ + mode->VRefresh = xf86ModeVRefresh(mode); + xf86SetModeCrtc(mode, INTERLACE_HALVE_V); + + if (debug_modes) + xf86PrintModeline(scrn->scrnIndex, mode); + } + } +} + + +/** + * Copy one of the output mode lists to the ScrnInfo record + */ + +/* XXX where does this function belong? Here? */ +void +xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr scrn, int *x, int *y); + +static DisplayModePtr +biggestMode(DisplayModePtr a, DisplayModePtr b) +{ + int A, B; + + if (!a) + return b; + if (!b) + return a; + + A = a->HDisplay * a->VDisplay; + B = b->HDisplay * b->VDisplay; + + if (A > B) + return a; + + return b; +} + +static xf86OutputPtr +SetCompatOutput(xf86CrtcConfigPtr config) +{ + xf86OutputPtr output = NULL, test = NULL; + DisplayModePtr maxmode = NULL, testmode, mode; + int o, compat = -1, count, mincount = 0; + + /* Look for one that's definitely connected */ + for (o = 0; o < config->num_output; o++) + { + test = config->output[o]; + if (!test->crtc) + continue; + if (test->status != XF86OutputStatusConnected) + continue; + if (!test->probed_modes) + continue; + + testmode = mode = test->probed_modes; + for (count = 0; mode; mode = mode->next, count++) + testmode = biggestMode(testmode, mode); + + if (!output) { + output = test; + compat = o; + maxmode = testmode; + mincount = count; + } else if (maxmode == biggestMode(maxmode, testmode)) { + output = test; + compat = o; + maxmode = testmode; + mincount = count; + } else if ((maxmode->HDisplay == testmode->HDisplay) && + (maxmode->VDisplay == testmode->VDisplay) && + count <= mincount) { + output = test; + compat = o; + maxmode = testmode; + mincount = count; + } + } + + /* If we didn't find one, take anything we can get */ + if (!output) + { + for (o = 0; o < config->num_output; o++) + { + test = config->output[o]; + if (!test->crtc) + continue; + if (!test->probed_modes) + continue; + + if (!output) { + output = test; + compat = o; + } else if (test->probed_modes->HDisplay < output->probed_modes->HDisplay) { + output = test; + compat = o; + } + } + } + + if (compat >= 0) { + config->compat_output = compat; + } else { + /* Don't change the compat output when no valid outputs found */ + output = config->output[config->compat_output]; + } + + return output; +} + +void +xf86SetScrnInfoModes (ScrnInfoPtr scrn) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + xf86OutputPtr output; + xf86CrtcPtr crtc; + DisplayModePtr last, mode = NULL; + + output = SetCompatOutput(config); + + if (!output) + return; /* punt */ + + crtc = output->crtc; + + /* Clear any existing modes from scrn->modes */ + while (scrn->modes != NULL) + xf86DeleteMode(&scrn->modes, scrn->modes); + + /* Set scrn->modes to the mode list for the 'compat' output */ + scrn->modes = xf86DuplicateModes(scrn, output->probed_modes); + + if (crtc) { + for (mode = scrn->modes; mode; mode = mode->next) + if (xf86ModesEqual (mode, &crtc->desiredMode)) + break; + } + + if (scrn->modes != NULL) { + /* For some reason, scrn->modes is circular, unlike the other mode + * lists. How great is that? + */ + for (last = scrn->modes; last && last->next; last = last->next) + ; + last->next = scrn->modes; + scrn->modes->prev = last; + if (mode) { + while (scrn->modes != mode) + scrn->modes = scrn->modes->next; + } + } + scrn->currentMode = scrn->modes; +#ifdef XFreeXDGA + if (scrn->pScreen) + _xf86_di_dga_reinit_internal(scrn->pScreen); +#endif +} + +static Bool +xf86CollectEnabledOutputs(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, + Bool *enabled) +{ + Bool any_enabled = FALSE; + int o; + + for (o = 0; o < config->num_output; o++) + any_enabled |= enabled[o] = xf86OutputEnabled(config->output[o], TRUE); + + if (!any_enabled) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "No outputs definitely connected, trying again...\n"); + + for (o = 0; o < config->num_output; o++) + any_enabled |= enabled[o] = xf86OutputEnabled(config->output[o], FALSE); + } + + return any_enabled; +} + +static Bool +nextEnabledOutput(xf86CrtcConfigPtr config, Bool *enabled, int *index) +{ + int o = *index; + + for (o++; o < config->num_output; o++) { + if (enabled[o]) { + *index = o; + return TRUE; + } + } + + return FALSE; +} + +static Bool +aspectMatch(float a, float b) +{ + return fabs(1 - (a / b)) < 0.05; +} + +static DisplayModePtr +nextAspectMode(xf86OutputPtr o, DisplayModePtr last, float aspect) +{ + DisplayModePtr m = NULL; + + if (!o) + return NULL; + + if (!last) + m = o->probed_modes; + else + m = last->next; + + for (; m; m = m->next) + if (aspectMatch(aspect, (float)m->HDisplay / (float)m->VDisplay)) + return m; + + return NULL; +} + +static DisplayModePtr +bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect) +{ + int o = -1, p; + DisplayModePtr mode = NULL, test = NULL, match = NULL; + + if (!nextEnabledOutput(config, enabled, &o)) + return NULL; + while ((mode = nextAspectMode(config->output[o], mode, aspect))) { + test = mode; + for (p = o; nextEnabledOutput(config, enabled, &p); ) { + test = xf86OutputFindClosestMode(config->output[p], mode); + if (!test) + break; + if (test->HDisplay != mode->HDisplay || + test->VDisplay != mode->VDisplay) { + test = NULL; + break; + } + } + + /* if we didn't match it on all outputs, try the next one */ + if (!test) + continue; + + /* if it's bigger than the last one, save it */ + if (!match || (test->HDisplay > match->HDisplay)) + match = test; + } + + /* return the biggest one found */ + return match; +} + +static Bool +xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, + DisplayModePtr *modes, Bool *enabled, + int width, int height) +{ + int o, p; + int max_pref_width = 0, max_pref_height = 0; + DisplayModePtr *preferred, *preferred_match; + Bool ret = FALSE; + + preferred = xnfcalloc(config->num_output, sizeof(DisplayModePtr)); + preferred_match = xnfcalloc(config->num_output, sizeof(DisplayModePtr)); + + /* Check if the preferred mode is available on all outputs */ + for (p = -1; nextEnabledOutput(config, enabled, &p); ) { + Rotation r = config->output[p]->initial_rotation; + DisplayModePtr mode; + if ((preferred[p] = xf86OutputHasPreferredMode(config->output[p], + width, height))) { + int pref_width = xf86ModeWidth(preferred[p], r); + int pref_height = xf86ModeHeight(preferred[p], r); + Bool all_match = TRUE; + + for (o = -1; nextEnabledOutput(config, enabled, &o); ) { + Bool match = FALSE; + xf86OutputPtr output = config->output[o]; + if (o == p) + continue; + + for (mode = output->probed_modes; mode; mode = mode->next) { + Rotation r = output->initial_rotation; + if (xf86ModeWidth(mode, r) == pref_width && + xf86ModeHeight(mode, r) == pref_height) { + preferred[o] = mode; + match = TRUE; + } + } + + all_match &= match; + } + + if (all_match && + (pref_width*pref_height > max_pref_width*max_pref_height)) { + for (o = -1; nextEnabledOutput(config, enabled, &o); ) + preferred_match[o] = preferred[o]; + max_pref_width = pref_width; + max_pref_height = pref_height; + ret = TRUE; + } + } + } + + /* + * If there's no preferred mode, but only one monitor, pick the + * biggest mode for its aspect ratio, assuming one exists. + */ + if (!ret) do { + int i = 0; + float aspect = 0.0; + + /* count the number of enabled outputs */ + for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++) ; + + if (i != 1) + break; + + p = -1; + nextEnabledOutput(config, enabled, &p); + if (config->output[p]->mm_height) + aspect = (float)config->output[p]->mm_width / + (float)config->output[p]->mm_height; + + if (aspect) + preferred_match[p] = bestModeForAspect(config, enabled, aspect); + + if (preferred_match[p]) + ret = TRUE; + + } while (0); + + if (ret) { + /* oh good, there is a match. stash the selected modes and return. */ + memcpy(modes, preferred_match, + config->num_output * sizeof(DisplayModePtr)); + } + + free(preferred); + free(preferred_match); + return ret; +} + +static Bool +xf86TargetAspect(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, + DisplayModePtr *modes, Bool *enabled, + int width, int height) +{ + int o; + float aspect = 0.0, *aspects; + xf86OutputPtr output; + Bool ret = FALSE; + DisplayModePtr guess = NULL, aspect_guess = NULL, base_guess = NULL; + + aspects = xnfcalloc(config->num_output, sizeof(float)); + + /* collect the aspect ratios */ + for (o = -1; nextEnabledOutput(config, enabled, &o); ) { + output = config->output[o]; + if (output->mm_height) + aspects[o] = (float)output->mm_width / (float)output->mm_height; + else + aspects[o] = 4.0 / 3.0; + } + + /* check that they're all the same */ + for (o = -1; nextEnabledOutput(config, enabled, &o); ) { + output = config->output[o]; + if (!aspect) { + aspect = aspects[o]; + } else if (!aspectMatch(aspect, aspects[o])) { + goto no_aspect_match; + } + } + + /* if they're all 4:3, just skip ahead and save effort */ + if (!aspectMatch(aspect, 4.0/3.0)) + aspect_guess = bestModeForAspect(config, enabled, aspect); + +no_aspect_match: + base_guess = bestModeForAspect(config, enabled, 4.0/3.0); + + guess = biggestMode(base_guess, aspect_guess); + + if (!guess) + goto out; + + /* found a mode that works everywhere, now apply it */ + for (o = -1; nextEnabledOutput(config, enabled, &o); ) { + modes[o] = xf86OutputFindClosestMode(config->output[o], guess); + } + ret = TRUE; + +out: + free(aspects); + return ret; +} + +static Bool +xf86TargetFallback(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, + DisplayModePtr *modes, Bool *enabled, + int width, int height) +{ + DisplayModePtr target_mode = NULL; + Rotation target_rotation = RR_Rotate_0; + DisplayModePtr default_mode; + int default_preferred, target_preferred = 0, o; + + /* User preferred > preferred > other modes */ + for (o = -1; nextEnabledOutput(config, enabled, &o); ) { + default_mode = xf86DefaultMode (config->output[o], width, height); + if (!default_mode) + continue; + + default_preferred = (((default_mode->type & M_T_PREFERRED) != 0) + + ((default_mode->type & M_T_USERPREF) != 0)); + + if (default_preferred > target_preferred || !target_mode) { + target_mode = default_mode; + target_preferred = default_preferred; + target_rotation = config->output[o]->initial_rotation; + config->compat_output = o; + } + } + + if (target_mode) + modes[config->compat_output] = target_mode; + + /* Fill in other output modes */ + for (o = -1; nextEnabledOutput(config, enabled, &o); ) { + if (!modes[o]) + modes[o] = xf86ClosestMode(config->output[o], target_mode, + target_rotation, width, height); + } + + return target_mode != NULL; +} + +static Bool +xf86TargetUserpref(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, + DisplayModePtr *modes, Bool *enabled, + int width, int height) +{ + int o; + + if (xf86UserConfiguredOutputs(scrn, modes)) + return xf86TargetFallback(scrn, config, modes, enabled, width, height); + + for (o = -1; nextEnabledOutput(config, enabled, &o); ) + if (xf86OutputHasUserPreferredMode(config->output[o])) + return + xf86TargetFallback(scrn, config, modes, enabled, width, height); + + return FALSE; +} + +static Bool +xf86CrtcSetInitialGamma(xf86CrtcPtr crtc, float gamma_red, float gamma_green, + float gamma_blue) +{ + int i, size = 256; + CARD16 *red, *green, *blue; + + red = malloc(3 * size * sizeof(CARD16)); + green = red + size; + blue = green + size; + + /* Only cause warning if user wanted gamma to be set. */ + if (!crtc->funcs->gamma_set && (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0)) { + free(red); + return FALSE; + } else if (!crtc->funcs->gamma_set) { + free(red); + return TRUE; + } + + /* At this early stage none of the randr-interface stuff is up. + * So take the default gamma size for lack of something better. + */ + for (i = 0; i < size; i++) { + if (gamma_red == 1.0) + red[i] = i << 8; + else + red[i] = (CARD16)(pow((double)i/(double)(size - 1), + 1. / (double)gamma_red) * (double)(size - 1) * 256); + + if (gamma_green == 1.0) + green[i] = i << 8; + else + green[i] = (CARD16)(pow((double)i/(double)(size - 1), + 1. / (double)gamma_green) * (double)(size - 1) * 256); + + if (gamma_blue == 1.0) + blue[i] = i << 8; + else + blue[i] = (CARD16)(pow((double)i/(double)(size - 1), + 1. / (double)gamma_blue) * (double)(size - 1) * 256); + } + + /* Default size is 256, so anything else is failure. */ + if (size != crtc->gamma_size) { + free(red); + return FALSE; + } + + crtc->gamma_size = size; + memcpy (crtc->gamma_red, red, crtc->gamma_size * sizeof (CARD16)); + memcpy (crtc->gamma_green, green, crtc->gamma_size * sizeof (CARD16)); + memcpy (crtc->gamma_blue, blue, crtc->gamma_size * sizeof (CARD16)); + + /* Do not set gamma now, delay until the crtc is activated. */ + + free(red); + + return TRUE; +} + +static Bool +xf86OutputSetInitialGamma(xf86OutputPtr output) +{ + XF86ConfMonitorPtr mon = output->conf_monitor; + float gamma_red = 1.0, gamma_green = 1.0, gamma_blue = 1.0; + + if (!mon) + return TRUE; + + if (!output->crtc) + return FALSE; + + /* Get configured values, where they exist. */ + if (mon->mon_gamma_red >= GAMMA_MIN && + mon->mon_gamma_red <= GAMMA_MAX) + gamma_red = mon->mon_gamma_red; + + if (mon->mon_gamma_green >= GAMMA_MIN && + mon->mon_gamma_green <= GAMMA_MAX) + gamma_green = mon->mon_gamma_green; + + if (mon->mon_gamma_blue >= GAMMA_MIN && + mon->mon_gamma_blue <= GAMMA_MAX) + gamma_blue = mon->mon_gamma_blue; + + /* This avoids setting gamma 1.0 in case another cloned output on this crtc has a specific gamma. */ + if (gamma_red != 1.0 || gamma_green != 1.0 || gamma_blue != 1.0) { + xf86DrvMsg(output->scrn->scrnIndex, X_INFO, "Output %s wants gamma correction (%.1f, %.1f, %.1f)\n", output->name, gamma_red, gamma_green, gamma_blue); + return xf86CrtcSetInitialGamma(output->crtc, gamma_red, gamma_green, gamma_blue); + }else + return TRUE; +} + +/** + * Construct default screen configuration + * + * Given auto-detected (and, eventually, configured) values, + * construct a usable configuration for the system + * + * canGrow indicates that the driver can resize the screen to larger than its + * initially configured size via the config->funcs->resize hook. If TRUE, this + * function will set virtualX and virtualY to match the initial configuration + * and leave config->max{Width,Height} alone. If FALSE, it will bloat + * virtual[XY] to include the largest modes and set config->max{Width,Height} + * accordingly. + */ + +Bool +xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int o, c; + xf86CrtcPtr *crtcs; + DisplayModePtr *modes; + Bool *enabled; + int width, height; + int i = scrn->scrnIndex; + Bool have_outputs = TRUE; + Bool ret; + + /* Set up the device options */ + config->options = xnfalloc (sizeof (xf86DeviceOptions)); + memcpy (config->options, xf86DeviceOptions, sizeof (xf86DeviceOptions)); + xf86ProcessOptions (scrn->scrnIndex, + scrn->options, + config->options); + config->debug_modes = xf86ReturnOptValBool (config->options, + OPTION_MODEDEBUG, FALSE); + + if (scrn->display->virtualX) + width = scrn->display->virtualX; + else + width = config->maxWidth; + if (scrn->display->virtualY) + height = scrn->display->virtualY; + else + height = config->maxHeight; + + xf86ProbeOutputModes (scrn, width, height); + + crtcs = xnfcalloc (config->num_output, sizeof (xf86CrtcPtr)); + modes = xnfcalloc (config->num_output, sizeof (DisplayModePtr)); + enabled = xnfcalloc (config->num_output, sizeof (Bool)); + + ret = xf86CollectEnabledOutputs(scrn, config, enabled); + if (ret == FALSE && canGrow) { + xf86DrvMsg(i, X_WARNING, "Unable to find connected outputs - setting %dx%d initial framebuffer\n", + NO_OUTPUT_DEFAULT_WIDTH, NO_OUTPUT_DEFAULT_HEIGHT); + have_outputs = FALSE; + } else { + if (xf86TargetUserpref(scrn, config, modes, enabled, width, height)) + xf86DrvMsg(i, X_INFO, "Using user preference for initial modes\n"); + else if (xf86TargetPreferred(scrn, config, modes, enabled, width, height)) + xf86DrvMsg(i, X_INFO, "Using exact sizes for initial modes\n"); + else if (xf86TargetAspect(scrn, config, modes, enabled, width, height)) + xf86DrvMsg(i, X_INFO, "Using fuzzy aspect match for initial modes\n"); + else if (xf86TargetFallback(scrn, config, modes, enabled, width, height)) + xf86DrvMsg(i, X_INFO, "Using sloppy heuristic for initial modes\n"); + else + xf86DrvMsg(i, X_WARNING, "Unable to find initial modes\n"); + } + + for (o = -1; nextEnabledOutput(config, enabled, &o); ) { + if (!modes[o]) + xf86DrvMsg (scrn->scrnIndex, X_ERROR, + "Output %s enabled but has no modes\n", + config->output[o]->name); + else + xf86DrvMsg (scrn->scrnIndex, X_INFO, + "Output %s using initial mode %s\n", + config->output[o]->name, modes[o]->name); + } + + /* + * Set the position of each output + */ + if (!xf86InitialOutputPositions (scrn, modes)) + { + free(crtcs); + free(modes); + return FALSE; + } + + /* + * Set initial panning of each output + */ + xf86InitialPanning (scrn); + + /* + * Assign CRTCs to fit output configuration + */ + if (have_outputs && !xf86PickCrtcs (scrn, crtcs, modes, 0, width, height)) + { + free(crtcs); + free(modes); + return FALSE; + } + + /* XXX override xf86 common frame computation code */ + + scrn->display->frameX0 = 0; + scrn->display->frameY0 = 0; + + for (c = 0; c < config->num_crtc; c++) + { + xf86CrtcPtr crtc = config->crtc[c]; + + crtc->enabled = FALSE; + memset (&crtc->desiredMode, '\0', sizeof (crtc->desiredMode)); + /* Set default gamma for all crtc's. */ + /* This is done to avoid problems later on with cloned outputs. */ + xf86CrtcSetInitialGamma(crtc, 1.0, 1.0, 1.0); + } + + if (xf86_crtc_supports_gamma(scrn)) + xf86DrvMsg(scrn->scrnIndex, X_INFO, "Using default gamma of (1.0, 1.0, 1.0) unless otherwise stated.\n"); + + /* + * Set initial configuration + */ + for (o = 0; o < config->num_output; o++) + { + xf86OutputPtr output = config->output[o]; + DisplayModePtr mode = modes[o]; + xf86CrtcPtr crtc = crtcs[o]; + + if (mode && crtc) + { + crtc->desiredMode = *mode; + crtc->desiredRotation = output->initial_rotation; + crtc->desiredX = output->initial_x; + crtc->desiredY = output->initial_y; + crtc->desiredTransformPresent = FALSE; + crtc->enabled = TRUE; + memcpy (&crtc->panningTotalArea, &output->initialTotalArea, sizeof(BoxRec)); + memcpy (&crtc->panningTrackingArea, &output->initialTrackingArea, sizeof(BoxRec)); + memcpy (crtc->panningBorder, output->initialBorder, 4*sizeof(INT16)); + output->crtc = crtc; + if (!xf86OutputSetInitialGamma(output)) + xf86DrvMsg (scrn->scrnIndex, X_WARNING, "Initial gamma correction for output %s: failed.\n", output->name); + } else { + output->crtc = NULL; + } + } + + if (scrn->display->virtualX == 0) + { + /* + * Expand virtual size to cover the current config and potential mode + * switches, if the driver can't enlarge the screen later. + */ + xf86DefaultScreenLimits (scrn, &width, &height, canGrow); + + if (have_outputs == FALSE) { + if (width < NO_OUTPUT_DEFAULT_WIDTH && height < NO_OUTPUT_DEFAULT_HEIGHT) { + width = NO_OUTPUT_DEFAULT_WIDTH; + height = NO_OUTPUT_DEFAULT_HEIGHT; + } + } + + scrn->display->virtualX = width; + scrn->display->virtualY = height; + } + + if (width > scrn->virtualX) + scrn->virtualX = width; + if (height > scrn->virtualY) + scrn->virtualY = height; + + /* + * Make sure the configuration isn't too small. + */ + if (width < config->minWidth || height < config->minHeight) + return FALSE; + + /* + * Limit the crtc config to virtual[XY] if the driver can't grow the + * desktop. + */ + if (!canGrow) + { + xf86CrtcSetSizeRange (scrn, config->minWidth, config->minHeight, + width, height); + } + + if (have_outputs) { + /* Mirror output modes to scrn mode list */ + xf86SetScrnInfoModes (scrn); + } else { + /* Clear any existing modes from scrn->modes */ + while (scrn->modes != NULL) + xf86DeleteMode(&scrn->modes, scrn->modes); + scrn->modes = xf86ModesAdd(scrn->modes, + xf86CVTMode(width, height, 60, 0, 0)); + } + + + free(crtcs); + free(modes); + return TRUE; +} + +/* + * Check the CRTC we're going to map each output to vs. it's current + * CRTC. If they don't match, we have to disable the output and the CRTC + * since the driver will have to re-route things. + */ +static void +xf86PrepareOutputs (ScrnInfoPtr scrn) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int o; + + for (o = 0; o < config->num_output; o++) { + xf86OutputPtr output = config->output[o]; +#if RANDR_GET_CRTC_INTERFACE + /* Disable outputs that are unused or will be re-routed */ + if (!output->funcs->get_crtc || + output->crtc != (*output->funcs->get_crtc)(output) || + output->crtc == NULL) +#endif + (*output->funcs->dpms)(output, DPMSModeOff); + } +} + +static void +xf86PrepareCrtcs (ScrnInfoPtr scrn) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int c; + + for (c = 0; c < config->num_crtc; c++) { +#if RANDR_GET_CRTC_INTERFACE + xf86CrtcPtr crtc = config->crtc[c]; + xf86OutputPtr output = NULL; + uint32_t desired_outputs = 0, current_outputs = 0; + int o; + + for (o = 0; o < config->num_output; o++) { + output = config->output[o]; + if (output->crtc == crtc) + desired_outputs |= (1<funcs->get_crtc) { + desired_outputs = 0; + break; + } + if ((*output->funcs->get_crtc)(output) == crtc) + current_outputs |= (1<funcs->dpms)(crtc, DPMSModeOff); +#else + (*crtc->funcs->dpms)(crtc, DPMSModeOff); +#endif + } +} + +/* + * Using the desired mode information in each crtc, set + * modes (used in EnterVT functions, or at server startup) + */ + +Bool +xf86SetDesiredModes (ScrnInfoPtr scrn) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + xf86CrtcPtr crtc = config->crtc[0]; + int c; + + /* A driver with this hook will take care of this */ + if (!crtc->funcs->set_mode_major) { + xf86PrepareOutputs(scrn); + xf86PrepareCrtcs(scrn); + } + + for (c = 0; c < config->num_crtc; c++) + { + xf86OutputPtr output = NULL; + xf86CrtcSetRec set; + int o; + RRTransformPtr transform; + + crtc = config->crtc[c]; + + /* Skip disabled CRTCs */ + if (!crtc->enabled) + continue; + + if (xf86CompatOutput(scrn) && xf86CompatCrtc(scrn) == crtc) + output = xf86CompatOutput(scrn); + else + { + for (o = 0; o < config->num_output; o++) + if (config->output[o]->crtc == crtc) + { + output = config->output[o]; + break; + } + } + /* paranoia */ + if (!output) + continue; + + /* Mark that we'll need to re-set the mode for sure */ + memset(&crtc->mode, 0, sizeof(crtc->mode)); + if (!crtc->desiredMode.CrtcHDisplay) + { + DisplayModePtr mode = xf86OutputFindClosestMode (output, scrn->currentMode); + + if (!mode) + return FALSE; + crtc->desiredMode = *mode; + crtc->desiredRotation = RR_Rotate_0; + crtc->desiredTransformPresent = FALSE; + crtc->desiredX = 0; + crtc->desiredY = 0; + } + + if (crtc->desiredTransformPresent) + transform = &crtc->desiredTransform; + else + transform = NULL; + set.mode = &crtc->desiredMode; + set.rotation = crtc->desiredRotation; + set.transform = transform; + set.x = crtc->desiredX; + set.y = crtc->desiredY; + set.flags = (XF86CrtcSetMode | XF86CrtcSetOutput | + XF86CrtcSetOrigin | XF86CrtcSetTransform | + XF86CrtcSetRotation); + if (!xf86CrtcSet(crtc, &set)) + return FALSE; + } + + xf86DisableUnusedFunctions(scrn); + return TRUE; +} + +/** + * In the current world order, there are lists of modes per output, which may + * or may not include the mode that was asked to be set by XFree86's mode + * selection. Find the closest one, in the following preference order: + * + * - Equality + * - Closer in size to the requested mode, but no larger + * - Closer in refresh rate to the requested mode. + */ + +DisplayModePtr +xf86OutputFindClosestMode (xf86OutputPtr output, DisplayModePtr desired) +{ + DisplayModePtr best = NULL, scan = NULL; + + for (scan = output->probed_modes; scan != NULL; scan = scan->next) + { + /* If there's an exact match, we're done. */ + if (xf86ModesEqual(scan, desired)) { + best = desired; + break; + } + + /* Reject if it's larger than the desired mode. */ + if (scan->HDisplay > desired->HDisplay || + scan->VDisplay > desired->VDisplay) + { + continue; + } + + /* + * If we haven't picked a best mode yet, use the first + * one in the size range + */ + if (best == NULL) + { + best = scan; + continue; + } + + /* Find if it's closer to the right size than the current best + * option. + */ + if ((scan->HDisplay > best->HDisplay && + scan->VDisplay >= best->VDisplay) || + (scan->HDisplay >= best->HDisplay && + scan->VDisplay > best->VDisplay)) + { + best = scan; + continue; + } + + /* Find if it's still closer to the right refresh than the current + * best resolution. + */ + if (scan->HDisplay == best->HDisplay && + scan->VDisplay == best->VDisplay && + (fabs(scan->VRefresh - desired->VRefresh) < + fabs(best->VRefresh - desired->VRefresh))) { + best = scan; + } + } + return best; +} + +/** + * When setting a mode through XFree86-VidModeExtension or XFree86-DGA, + * take the specified mode and apply it to the crtc connected to the compat + * output. Then, find similar modes for the other outputs, as with the + * InitialConfiguration code above. The goal is to clone the desired + * mode across all outputs that are currently active. + */ + +Bool +xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + Bool ok = TRUE; + xf86OutputPtr compat_output; + DisplayModePtr compat_mode = NULL; + int c; + + /* + * Let the compat output drive the final mode selection + */ + compat_output = xf86CompatOutput(pScrn); + if (compat_output) + compat_mode = xf86OutputFindClosestMode (compat_output, desired); + if (compat_mode) + desired = compat_mode; + + for (c = 0; c < config->num_crtc; c++) + { + xf86CrtcPtr crtc = config->crtc[c]; + DisplayModePtr crtc_mode = NULL; + int o; + xf86CrtcSetRec set; + + if (!crtc->enabled) + continue; + + for (o = 0; o < config->num_output; o++) + { + xf86OutputPtr output = config->output[o]; + DisplayModePtr output_mode; + + /* skip outputs not on this crtc */ + if (output->crtc != crtc) + continue; + + if (crtc_mode) + { + output_mode = xf86OutputFindClosestMode (output, crtc_mode); + if (output_mode != crtc_mode) + output->crtc = NULL; + } + else + crtc_mode = xf86OutputFindClosestMode (output, desired); + } + if (!crtc_mode) + { + crtc->enabled = FALSE; + continue; + } + set.mode = crtc_mode; + set.rotation = rotation; + set.transform = NULL; + set.x = 0; + set.y = 0; + set.flags = (XF86CrtcSetMode | XF86CrtcSetOutput | + XF86CrtcSetOrigin | XF86CrtcSetTransform | + XF86CrtcSetRotation); + if (!xf86CrtcSet (crtc, &set)) + ok = FALSE; + else + { + crtc->desiredMode = *crtc_mode; + crtc->desiredRotation = rotation; + crtc->desiredTransformPresent = FALSE; + crtc->desiredX = 0; + crtc->desiredY = 0; + } + } + xf86DisableUnusedFunctions(pScrn); +#ifdef RANDR_12_INTERFACE + xf86RandR12TellChanged (pScrn->pScreen); +#endif + return ok; +} + + +/** + * Set the DPMS power mode of all outputs and CRTCs. + * + * If the new mode is off, it will turn off outputs and then CRTCs. + * Otherwise, it will affect CRTCs before outputs. + */ +void +xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int i; + + if (!scrn->vtSema) + return; + + if (mode == DPMSModeOff) { + for (i = 0; i < config->num_output; i++) { + xf86OutputPtr output = config->output[i]; + if (output->crtc != NULL) + (*output->funcs->dpms) (output, mode); + } + } + + for (i = 0; i < config->num_crtc; i++) { + xf86CrtcPtr crtc = config->crtc[i]; + if (crtc->enabled) + (*crtc->funcs->dpms) (crtc, mode); + } + + if (mode != DPMSModeOff) { + for (i = 0; i < config->num_output; i++) { + xf86OutputPtr output = config->output[i]; + if (output->crtc != NULL) + (*output->funcs->dpms) (output, mode); + } + } +} + +/** + * Implement the screensaver by just calling down into the driver DPMS hooks. + * + * Even for monitors with no DPMS support, by the definition of our DPMS hooks, + * the outputs will still get disabled (blanked). + */ +Bool +xf86SaveScreen(ScreenPtr pScreen, int mode) +{ + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + + if (xf86IsUnblank(mode)) + xf86DPMSSet(pScrn, DPMSModeOn, 0); + else + xf86DPMSSet(pScrn, DPMSModeOff, 0); + + return TRUE; +} + +/** + * Disable all inactive crtcs and outputs + */ +void +xf86DisableUnusedFunctions(ScrnInfoPtr pScrn) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + int o, c; + + for (o = 0; o < xf86_config->num_output; o++) + { + xf86OutputPtr output = xf86_config->output[o]; + if (!output->crtc) + (*output->funcs->dpms)(output, DPMSModeOff); + } + + for (c = 0; c < xf86_config->num_crtc; c++) + { + xf86CrtcPtr crtc = xf86_config->crtc[c]; + + if (!crtc->enabled) + { + crtc->funcs->dpms(crtc, DPMSModeOff); + memset(&crtc->mode, 0, sizeof(crtc->mode)); + xf86RotateDestroy(crtc); + crtc->active = FALSE; + } + } + if (pScrn->pScreen) + xf86_crtc_notify(pScrn->pScreen); + if (pScrn->ModeSet) + pScrn->ModeSet(pScrn); +} + +#ifdef RANDR_12_INTERFACE + +#define EDID_ATOM_NAME "EDID" + +/** + * Set the RandR EDID property + */ +static void +xf86OutputSetEDIDProperty (xf86OutputPtr output, void *data, int data_len) +{ + Atom edid_atom = MakeAtom(EDID_ATOM_NAME, sizeof(EDID_ATOM_NAME) - 1, TRUE); + + /* This may get called before the RandR resources have been created */ + if (output->randr_output == NULL) + return; + + if (data_len != 0) { + RRChangeOutputProperty(output->randr_output, edid_atom, XA_INTEGER, 8, + PropModeReplace, data_len, data, FALSE, TRUE); + } else { + RRDeleteOutputProperty(output->randr_output, edid_atom); + } +} + +#endif + +/* Pull out a phyiscal size from a detailed timing if available. */ +struct det_phySize_parameter { + xf86OutputPtr output; + ddc_quirk_t quirks; + Bool ret; +}; + +static void handle_detailed_physical_size(struct detailed_monitor_section + *det_mon, void *data) +{ + struct det_phySize_parameter *p; + p = (struct det_phySize_parameter *)data; + + if (p->ret == TRUE ) + return ; + + xf86DetTimingApplyQuirks(det_mon, p->quirks, + p->output->MonInfo->features.hsize, + p->output->MonInfo->features.vsize); + if (det_mon->type == DT && + det_mon->section.d_timings.h_size != 0 && + det_mon->section.d_timings.v_size != 0) { + + p->output->mm_width = det_mon->section.d_timings.h_size; + p->output->mm_height = det_mon->section.d_timings.v_size; + p->ret = TRUE; + } +} + +/** + * Set the EDID information for the specified output + */ +void +xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) +{ + ScrnInfoPtr scrn = output->scrn; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + Bool debug_modes = config->debug_modes || xf86Initialising; +#ifdef RANDR_12_INTERFACE + int size; +#endif + + free(output->MonInfo); + + output->MonInfo = edid_mon; + output->mm_width = 0; + output->mm_height = 0; + + if (debug_modes) { + xf86DrvMsg(scrn->scrnIndex, X_INFO, "EDID for output %s\n", + output->name); + xf86PrintEDID(edid_mon); + } + + /* Set the DDC properties for the 'compat' output */ + if (output == xf86CompatOutput(scrn)) + xf86SetDDCproperties(scrn, edid_mon); + +#ifdef RANDR_12_INTERFACE + /* Set the RandR output properties */ + size = 0; + if (edid_mon) + { + if (edid_mon->ver.version == 1) { + size = 128; + if (edid_mon->flags & EDID_COMPLETE_RAWDATA) + size += edid_mon->no_sections * 128; + } else if (edid_mon->ver.version == 2) + size = 256; + } + xf86OutputSetEDIDProperty (output, edid_mon ? edid_mon->rawData : NULL, size); +#endif + + if (edid_mon) { + + struct det_phySize_parameter p; + p.output = output; + p.quirks = xf86DDCDetectQuirks(scrn->scrnIndex,edid_mon, FALSE); + p.ret = FALSE; + xf86ForEachDetailedBlock(edid_mon, + handle_detailed_physical_size, &p); + + /* if no mm size is available from a detailed timing, check the max size field */ + if ((!output->mm_width || !output->mm_height) && + (edid_mon->features.hsize && edid_mon->features.vsize)) + { + output->mm_width = edid_mon->features.hsize * 10; + output->mm_height = edid_mon->features.vsize * 10; + } + } +} + +/** + * Return the list of modes supported by the EDID information + * stored in 'output' + */ +DisplayModePtr +xf86OutputGetEDIDModes (xf86OutputPtr output) +{ + ScrnInfoPtr scrn = output->scrn; + xf86MonPtr edid_mon = output->MonInfo; + + if (!edid_mon) + return NULL; + return xf86DDCGetModes(scrn->scrnIndex, edid_mon); +} + +/* maybe we should care about DDC1? meh. */ +xf86MonPtr +xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus) +{ + ScrnInfoPtr scrn = output->scrn; + xf86MonPtr mon; + + mon = xf86DoEEDID(scrn->scrnIndex, pDDCBus, TRUE); + if (mon) + xf86DDCApplyQuirks(scrn->scrnIndex, mon); + + return mon; +} + +static char *_xf86ConnectorNames[] = { + "None", "VGA", "DVI-I", "DVI-D", + "DVI-A", "Composite", "S-Video", + "Component", "LFP", "Proprietary", + "HDMI", "DisplayPort", + }; +char * +xf86ConnectorGetName(xf86ConnectorType connector) +{ + return _xf86ConnectorNames[connector]; +} + +static void +x86_crtc_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b) +{ + dest->x1 = a->x1 > b->x1 ? a->x1 : b->x1; + dest->x2 = a->x2 < b->x2 ? a->x2 : b->x2; + dest->y1 = a->y1 > b->y1 ? a->y1 : b->y1; + dest->y2 = a->y2 < b->y2 ? a->y2 : b->y2; + + if (dest->x1 >= dest->x2 || dest->y1 >= dest->y2) + dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0; +} + +static void +x86_crtc_box(xf86CrtcPtr crtc, BoxPtr crtc_box) +{ + if (crtc->enabled) { + crtc_box->x1 = crtc->x; + crtc_box->x2 = crtc->x + xf86ModeWidth(&crtc->mode, crtc->rotation); + crtc_box->y1 = crtc->y; + crtc_box->y2 = crtc->y + xf86ModeHeight(&crtc->mode, crtc->rotation); + } else + crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0; +} + +static int +xf86_crtc_box_area(BoxPtr box) +{ + return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1); +} + +/* + * Return the crtc covering 'box'. If two crtcs cover a portion of + * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc + * with greater coverage + */ + +static xf86CrtcPtr +xf86_covering_crtc(ScrnInfoPtr pScrn, + BoxPtr box, + xf86CrtcPtr desired, + BoxPtr crtc_box_ret) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + xf86CrtcPtr crtc, best_crtc; + int coverage, best_coverage; + int c; + BoxRec crtc_box, cover_box; + + best_crtc = NULL; + best_coverage = 0; + crtc_box_ret->x1 = 0; + crtc_box_ret->x2 = 0; + crtc_box_ret->y1 = 0; + crtc_box_ret->y2 = 0; + for (c = 0; c < xf86_config->num_crtc; c++) { + crtc = xf86_config->crtc[c]; + x86_crtc_box(crtc, &crtc_box); + x86_crtc_box_intersect(&cover_box, &crtc_box, box); + coverage = xf86_crtc_box_area(&cover_box); + if (coverage && crtc == desired) { + *crtc_box_ret = crtc_box; + return crtc; + } else if (coverage > best_coverage) { + *crtc_box_ret = crtc_box; + best_crtc = crtc; + best_coverage = coverage; + } + } + return best_crtc; +} + +/* + * For overlay video, compute the relevant CRTC and + * clip video to that. + * + * returning FALSE means there was a memory failure of some kind, + * not that the video shouldn't be displayed + */ + +Bool +xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn, + xf86CrtcPtr *crtc_ret, + xf86CrtcPtr desired_crtc, + BoxPtr dst, + INT32 *xa, + INT32 *xb, + INT32 *ya, + INT32 *yb, + RegionPtr reg, + INT32 width, + INT32 height) +{ + Bool ret; + RegionRec crtc_region_local; + RegionPtr crtc_region = reg; + + if (crtc_ret) { + BoxRec crtc_box; + xf86CrtcPtr crtc = xf86_covering_crtc(pScrn, dst, + desired_crtc, + &crtc_box); + + if (crtc) { + RegionInit(&crtc_region_local, &crtc_box, 1); + crtc_region = &crtc_region_local; + RegionIntersect(crtc_region, crtc_region, reg); + } + *crtc_ret = crtc; + } + + ret = xf86XVClipVideoHelper(dst, xa, xb, ya, yb, + crtc_region, width, height); + + if (crtc_region != reg) + RegionUninit(&crtc_region_local); + + return ret; +} + +xf86_crtc_notify_proc_ptr +xf86_wrap_crtc_notify (ScreenPtr screen, xf86_crtc_notify_proc_ptr new) +{ + if (xf86CrtcConfigPrivateIndex != -1) + { + ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + xf86_crtc_notify_proc_ptr old; + + old = config->xf86_crtc_notify; + config->xf86_crtc_notify = new; + return old; + } + return NULL; +} + +void +xf86_unwrap_crtc_notify(ScreenPtr screen, xf86_crtc_notify_proc_ptr old) +{ + if (xf86CrtcConfigPrivateIndex != -1) + { + ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + + config->xf86_crtc_notify = old; + } +} + +void +xf86_crtc_notify(ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + + if (config->xf86_crtc_notify) + config->xf86_crtc_notify(screen); +} + +Bool +xf86_crtc_supports_gamma(ScrnInfoPtr pScrn) +{ + if (xf86CrtcConfigPrivateIndex != -1) { + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + xf86CrtcPtr crtc; + + /* for multiple drivers loaded we need this */ + if (!xf86_config) + return FALSE; + if (xf86_config->num_crtc == 0) + return FALSE; + crtc = xf86_config->crtc[0]; + + return crtc->funcs->gamma_set != NULL; + } + + return FALSE; +} diff --git a/xorg-server/hw/xwin/winclipboardxevents.c b/xorg-server/hw/xwin/winclipboardxevents.c index c331f402e..e65717008 100644 --- a/xorg-server/hw/xwin/winclipboardxevents.c +++ b/xorg-server/hw/xwin/winclipboardxevents.c @@ -789,6 +789,9 @@ winClipboardFlushXEvents (HWND hwnd, case PropertyNotify: break; + case MappingNotify: + break; + default: ErrorF ("winClipboardFlushXEvents - unexpected event type %d\n", event.type); break; diff --git a/xorg-server/hw/xwin/winconfig.c b/xorg-server/hw/xwin/winconfig.c index 2503bcb1a..7b26432f2 100644 --- a/xorg-server/hw/xwin/winconfig.c +++ b/xorg-server/hw/xwin/winconfig.c @@ -240,6 +240,7 @@ Bool winConfigKeyboard (DeviceIntPtr pDevice) { char layoutName[KL_NAMELENGTH]; + unsigned char layoutFriendlyName[256]; static unsigned int layoutNum = 0; int keyboardType; #ifdef XWIN_XF86CONFIG @@ -299,11 +300,32 @@ winConfigKeyboard (DeviceIntPtr pDevice) if (LoadKeyboardLayout("00000409", KLF_ACTIVATE) != NULL) winMsg (X_INFO, "Loading US keyboard layout.\n"); else - winMsg (X_ERROR, "LoadKeyboardLaout failed.\n"); + winMsg (X_ERROR, "LoadKeyboardLayout failed.\n"); } } - winMsg (X_PROBED, "winConfigKeyboard - Layout: \"%s\" (%08x) \n", - layoutName, layoutNum); + + /* Discover the friendly name of the current layout */ + { + HKEY regkey = NULL; + const char regtempl[] = "SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\"; + char *regpath; + DWORD namesize = sizeof(layoutFriendlyName); + + regpath = malloc(sizeof(regtempl) + KL_NAMELENGTH + 1); + strcpy(regpath, regtempl); + strcat(regpath, layoutName); + + if (!RegOpenKey(HKEY_LOCAL_MACHINE, regpath, ®key)) + RegQueryValueEx(regkey, "Layout Text", 0, NULL, layoutFriendlyName, &namesize); + + /* Close registry key */ + if (regkey) + RegCloseKey (regkey); + free(regpath); + } + + winMsg (X_PROBED, "Windows keyboard layout: \"%s\" (%08x) \"%s\", type %d\n", + layoutName, layoutNum, layoutFriendlyName, keyboardType); for (pLayout = winKBLayouts; pLayout->winlayout != -1; pLayout++) { @@ -311,46 +333,35 @@ winConfigKeyboard (DeviceIntPtr pDevice) continue; if (pLayout->winkbtype > 0 && pLayout->winkbtype != keyboardType) continue; - + bfound = TRUE; winMsg (X_PROBED, - "Using preset keyboard for \"%s\" (%x), type \"%d\"\n", - pLayout->layoutname, pLayout->winlayout, keyboardType); - + "Found matching XKB configuration \"%s\"\n", + pLayout->layoutname); + + winMsg(X_PROBED, + "Model = \"%s\" Layout = \"%s\"" + " Variant = \"%s\" Options = \"%s\"\n", + pLayout->xkbmodel ? pLayout->xkbmodel : "none", + pLayout->xkblayout ? pLayout->xkblayout : "none", + pLayout->xkbvariant ? pLayout->xkbvariant : "none", + pLayout->xkboptions ? pLayout->xkboptions : "none"); + g_winInfo.xkb.model = pLayout->xkbmodel; g_winInfo.xkb.layout = pLayout->xkblayout; g_winInfo.xkb.variant = pLayout->xkbvariant; - g_winInfo.xkb.options = pLayout->xkboptions; + g_winInfo.xkb.options = pLayout->xkboptions; + + break; } - + if (!bfound) { - HKEY regkey = NULL; - const char regtempl[] = - "SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts\\"; - char *regpath; - unsigned char lname[256]; - DWORD namesize = sizeof(lname); - - regpath = malloc(sizeof(regtempl) + KL_NAMELENGTH + 1); - strcpy(regpath, regtempl); - strcat(regpath, layoutName); - - if (!RegOpenKey(HKEY_LOCAL_MACHINE, regpath, ®key) && - !RegQueryValueEx(regkey, "Layout Text", 0, NULL, lname, &namesize)) - { - winMsg (X_ERROR, - "Keyboardlayout \"%s\" (%s) is unknown\n", lname, layoutName); - } - - /* Close registry key */ - if (regkey) - RegCloseKey (regkey); - free(regpath); + winMsg (X_ERROR, "Keyboardlayout \"%s\" (%s) is unknown, using X server default layout\n", layoutFriendlyName, layoutName); } - } - + } + /* parse the configuration */ #ifdef XWIN_XF86CONFIG if (g_cmdline.keyboard) diff --git a/xorg-server/hw/xwin/winkeybd.c b/xorg-server/hw/xwin/winkeybd.c index 1a44695c6..94318969f 100644 --- a/xorg-server/hw/xwin/winkeybd.c +++ b/xorg-server/hw/xwin/winkeybd.c @@ -73,6 +73,8 @@ winTranslateKey (WPARAM wParam, LPARAM lParam, int *piScanCode) int iParam = HIWORD (lParam); int iParamScanCode = LOBYTE (iParam); + winDebug("winTranslateKey: wParam %08x lParam %08x\n", wParam, lParam); + /* WM_ key messages faked by Vista speech recognition (WSR) don't have a * scan code. * @@ -488,10 +490,8 @@ winSendKeyEvent (DWORD dwKey, Bool fDown) for (i = 0; i < nevents; i++) mieqEnqueue(g_pwinKeyboard, (InternalEvent*)events[i].event); -#if CYGDEBUG - ErrorF("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n", - dwKey, fDown, nevents); -#endif + winDebug("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n", + dwKey, fDown, nevents); } BOOL winCheckKeyPressed(WPARAM wParam, LPARAM lParam) diff --git a/xorg-server/hw/xwin/winkeybd.h b/xorg-server/hw/xwin/winkeybd.h index fc5e6b53a..40fbc179f 100644 --- a/xorg-server/hw/xwin/winkeybd.h +++ b/xorg-server/hw/xwin/winkeybd.h @@ -216,13 +216,13 @@ g_iKeyMap [] = { /* 170 */ 0, 0, 0, /* 171 */ 0, 0, 0, /* 172 */ 0, 0, 0, - /* 173 */ 0, 0, 0, - /* 174 */ 0, 0, 0, - /* 175 */ 0, 0, 0, - /* 176 */ 0, 0, 0, - /* 177 */ 0, 0, 0, - /* 178 */ 0, 0, 0, - /* 179 */ 0, 0, 0, + /* 173 */ VK_VOLUME_MUTE, 0, KEY_Mute, + /* 174 */ VK_VOLUME_DOWN, 0, KEY_AudioLower, + /* 175 */ VK_VOLUME_UP, 0, KEY_AudioRaise, + /* 176 */ VK_MEDIA_NEXT_TRACK, 0, KEY_NEXTSONG, + /* 177 */ VK_MEDIA_PREV_TRACK, 0, KEY_PREVIOUSSONG, + /* 178 */ VK_MEDIA_STOP, 0, KEY_STOPCD, + /* 179 */ VK_MEDIA_PLAY_PAUSE, 0, KEY_PLAYPAUSE, /* 180 */ 0, 0, 0, /* 181 */ 0, 0, 0, /* 182 */ 0, 0, 0, @@ -266,7 +266,7 @@ g_iKeyMap [] = { /* 220 */ 0, 0, 0, /* 221 */ 0, 0, 0, /* 222 */ 0, 0, 0, - /* 223 */ 0, 0, 0, + /* 223 */ VK_OEM_8, 0, KEY_RCtrl, /* at least on Candian Multilingual Standard layout */ /* 224 */ 0, 0, 0, /* 225 */ 0, 0, 0, /* 226 */ 0, 0, 0, diff --git a/xorg-server/hw/xwin/winkeyhook.c b/xorg-server/hw/xwin/winkeyhook.c index fcf222fd4..e452fa5f7 100644 --- a/xorg-server/hw/xwin/winkeyhook.c +++ b/xorg-server/hw/xwin/winkeyhook.c @@ -88,9 +88,7 @@ winKeyboardMessageHookLL (int iCode, WPARAM wParam, LPARAM lParam) /* Pass keystrokes on to our main message loop */ if (iCode == HC_ACTION) { -#if 0 - ErrorF ("vkCode: %08x\tscanCode: %08x\n", p->vkCode, p->scanCode); -#endif + winDebug("winKeyboardMessageHook: vkCode: %08x scanCode: %08x\n", p->vkCode, p->scanCode); switch (wParam) { diff --git a/xorg-server/hw/xwin/winkeynames.h b/xorg-server/hw/xwin/winkeynames.h index 5649e2f66..a6738330e 100644 --- a/xorg-server/hw/xwin/winkeynames.h +++ b/xorg-server/hw/xwin/winkeynames.h @@ -23,10 +23,6 @@ * */ -#define XK_TECHNICAL -#define XK_KATAKANA -#include - #define GLYPHS_PER_KEY 4 #define NUM_KEYCODES 248 #define MIN_KEYCODE 8 @@ -194,6 +190,15 @@ #define KEY_HKTG /* Hirugana/Katakana tog 0xc8 */ 200 #define KEY_BSlash2 /* \ _ 0xcb */ 203 +#define KEY_Mute /* Audio Mute */ 152 +#define KEY_AudioLower /* Audio Lower */ 168 +#define KEY_AudioRaise /* Audio Raise */ 166 + +#define KEY_NEXTSONG /* Media next */ 145 +#define KEY_PLAYPAUSE /* Media play/pause toggle */ 154 +#define KEY_PREVIOUSSONG /* Media previous */ 136 +#define KEY_STOPCD /* Media stop */ 156 + /* These are for "notused" and "unknown" entries in translation maps. */ #define KEY_NOTUSED 0 #define KEY_UNKNOWN 255 diff --git a/xorg-server/hw/xwin/winlayouts.h b/xorg-server/hw/xwin/winlayouts.h index 3cbc91244..743f03c39 100644 --- a/xorg-server/hw/xwin/winlayouts.h +++ b/xorg-server/hw/xwin/winlayouts.h @@ -55,13 +55,15 @@ WinKBLayoutRec winKBLayouts[] = { 0x00010409, -1, "pc105", "dvorak", NULL, NULL, "English (USA,Dvorak)"}, { 0x00020409, -1, "pc105", "us_intl", NULL, NULL, "English (USA,International)"}, { 0x00000809, -1, "pc105", "gb", NULL, NULL, "English (United Kingdom)"}, + { 0x00001009, -1, "pc105", "ca", "fr", NULL, "French (Canada)"}, + { 0x00011009, -1, "pc105", "ca", "multix", NULL, "Canadian Multilingual Standard"}, { 0x00001809, -1, "pc105", "ie", NULL, NULL, "Irish"}, { 0x0000040a, -1, "pc105", "es", NULL, NULL, "Spanish (Spain,Traditional Sort)"}, { 0x0000080a, -1, "pc105", "latam", NULL, NULL, "Latin American"}, { 0x0000040b, -1, "pc105", "fi", NULL, NULL, "Finnish"}, { 0x0000040c, -1, "pc105", "fr", NULL, NULL, "French (Standard)"}, { 0x0000080c, -1, "pc105", "be", NULL, NULL, "French (Belgian)"}, - { 0x00000c0c, -1, "pc105", "ca", "fr", NULL, "French (Canada)"}, + { 0x00000c0c, -1, "pc105", "ca", "fr-legacy", NULL, "French (Canada, Legacy)"}, { 0x0000100c, -1, "pc105", "ch", "fr", NULL, "French (Switzerland)"}, { 0x0000040d, -1, "pc105", "il", NULL, NULL, "Hebrew"}, { 0x0000040e, -1, "pc105", "hu", NULL, NULL, "Hungarian"}, @@ -79,6 +81,8 @@ WinKBLayoutRec winKBLayouts[] = { 0x00000816, -1, "pc105", "pt", NULL, NULL, "Portuguese (Portugal)"}, { 0x0000041a, -1, "pc105", "hr", NULL, NULL, "Croatian"}, { 0x0000041d, -1, "pc105", "se", NULL, NULL, "Swedish (Sweden)"}, + { 0x0000041f, -1, "pc105", "tr", NULL, NULL, "Turkish (Q)"}, + { 0x0001041f, -1, "pc105", "tr", "f", NULL, "Turkish (F)"}, { 0x00000424, -1, "pc105", "si", NULL, NULL, "Slovenian"}, { 0x00000425, -1, "pc105", "ee", NULL, NULL, "Estonian"}, { 0x00000452, -1, "pc105", "gb", "intl", NULL, "United Kingdom (Extended)"}, @@ -89,5 +93,3 @@ WinKBLayoutRec winKBLayouts[] = See http://technet.microsoft.com/en-us/library/cc766503%28WS.10%29.aspx for a listing of input locale (keyboard layout) codes */ - - diff --git a/xorg-server/include/exevents.h b/xorg-server/include/exevents.h index 2b859a3bd..6e5804080 100644 --- a/xorg-server/include/exevents.h +++ b/xorg-server/include/exevents.h @@ -69,7 +69,7 @@ extern _X_EXPORT int XIChangeDeviceProperty( int /* format*/, int /* mode*/, unsigned long /* len*/, - pointer /* value*/, + const pointer /* value*/, Bool /* sendevent*/ ); diff --git a/xorg-server/miext/damage/Makefile.am b/xorg-server/miext/damage/Makefile.am index 595835731..9f858a8e5 100644 --- a/xorg-server/miext/damage/Makefile.am +++ b/xorg-server/miext/damage/Makefile.am @@ -1,14 +1,14 @@ -noinst_LTLIBRARIES = libdamage.la - -AM_CFLAGS = $(DIX_CFLAGS) - -INCLUDES = -I$(srcdir)/../cw -I$(top_srcdir)/hw/xfree86/os-support - -if XORG -sdk_HEADERS = damage.h damagestr.h -endif - -libdamage_la_SOURCES = \ - damage.c \ - damage.h \ - damagestr.h +noinst_LTLIBRARIES = libdamage.la + +AM_CFLAGS = $(DIX_CFLAGS) + +INCLUDES = -I$(srcdir)/../cw + +if XORG +sdk_HEADERS = damage.h damagestr.h +endif + +libdamage_la_SOURCES = \ + damage.c \ + damage.h \ + damagestr.h diff --git a/xorg-server/miext/rootless/Makefile.am b/xorg-server/miext/rootless/Makefile.am index f09300d5c..72d299bcc 100644 --- a/xorg-server/miext/rootless/Makefile.am +++ b/xorg-server/miext/rootless/Makefile.am @@ -1,17 +1,16 @@ -AM_CFLAGS = $(DIX_CFLAGS) $(XSERVER_CFLAGS) -AM_CPPFLAGS = -I$(top_srcdir)/hw/xfree86/os-support - -noinst_LTLIBRARIES = librootless.la -librootless_la_SOURCES = \ - rootlessCommon.c \ - rootlessGC.c \ - rootlessScreen.c \ - rootlessValTree.c \ - rootlessWindow.c - -EXTRA_DIST = \ - README.txt \ - rootless.h \ - rootlessCommon.h \ - rootlessConfig.h \ - rootlessWindow.h +AM_CFLAGS = $(DIX_CFLAGS) $(XSERVER_CFLAGS) + +noinst_LTLIBRARIES = librootless.la +librootless_la_SOURCES = \ + rootlessCommon.c \ + rootlessGC.c \ + rootlessScreen.c \ + rootlessValTree.c \ + rootlessWindow.c + +EXTRA_DIST = \ + README.txt \ + rootless.h \ + rootlessCommon.h \ + rootlessConfig.h \ + rootlessWindow.h diff --git a/xorg-server/miext/shadow/Makefile.am b/xorg-server/miext/shadow/Makefile.am index a73d0ec78..59cee7f59 100644 --- a/xorg-server/miext/shadow/Makefile.am +++ b/xorg-server/miext/shadow/Makefile.am @@ -1,34 +1,32 @@ -noinst_LTLIBRARIES = libshadow.la - -AM_CFLAGS = $(DIX_CFLAGS) - -INCLUDES = -I$(top_srcdir)/hw/xfree86/os-support - -if XORG -sdk_HEADERS = shadow.h -endif - -libshadow_la_SOURCES = \ - shadow.c \ - shadow.h \ - shalloc.c \ - shpacked.c \ - shplanar8.c \ - shplanar.c \ - shrot16pack_180.c \ - shrot16pack_270.c \ - shrot16pack_270YX.c \ - shrot16pack_90.c \ - shrot16pack_90YX.c \ - shrot16pack.c \ - shrot32pack_180.c \ - shrot32pack_270.c \ - shrot32pack_90.c \ - shrot32pack.c \ - shrot8pack_180.c \ - shrot8pack_270.c \ - shrot8pack_90.c \ - shrot8pack.c \ - shrotate.c \ - shrotpack.h \ - shrotpackYX.h +noinst_LTLIBRARIES = libshadow.la + +AM_CFLAGS = $(DIX_CFLAGS) + +if XORG +sdk_HEADERS = shadow.h +endif + +libshadow_la_SOURCES = \ + shadow.c \ + shadow.h \ + shalloc.c \ + shpacked.c \ + shplanar8.c \ + shplanar.c \ + shrot16pack_180.c \ + shrot16pack_270.c \ + shrot16pack_270YX.c \ + shrot16pack_90.c \ + shrot16pack_90YX.c \ + shrot16pack.c \ + shrot32pack_180.c \ + shrot32pack_270.c \ + shrot32pack_90.c \ + shrot32pack.c \ + shrot8pack_180.c \ + shrot8pack_270.c \ + shrot8pack_90.c \ + shrot8pack.c \ + shrotate.c \ + shrotpack.h \ + shrotpackYX.h diff --git a/xorg-server/randr/rrdispatch.c b/xorg-server/randr/rrdispatch.c index 7540b4d35..b9cbb5858 100644 --- a/xorg-server/randr/rrdispatch.c +++ b/xorg-server/randr/rrdispatch.c @@ -35,7 +35,7 @@ RRClientKnowsRates (ClientPtr pClient) static int ProcRRQueryVersion (ClientPtr client) { - xRRQueryVersionReply rep; + xRRQueryVersionReply rep = {0}; register int n; REQUEST(xRRQueryVersionReq); rrClientPriv(client); diff --git a/xorg-server/randr/rrmode.c b/xorg-server/randr/rrmode.c index 692f61567..ae7939909 100644 --- a/xorg-server/randr/rrmode.c +++ b/xorg-server/randr/rrmode.c @@ -288,7 +288,7 @@ int ProcRRCreateMode (ClientPtr client) { REQUEST(xRRCreateModeReq); - xRRCreateModeReply rep; + xRRCreateModeReply rep = {0}; WindowPtr pWin; ScreenPtr pScreen; rrScrPrivPtr pScrPriv; diff --git a/xorg-server/xfixes/cursor.c b/xorg-server/xfixes/cursor.c index 488688b17..2cafb3087 100644 --- a/xorg-server/xfixes/cursor.c +++ b/xorg-server/xfixes/cursor.c @@ -1045,7 +1045,7 @@ XFixesCursorInit (void) ScreenPtr pScreen = screenInfo.screens[i]; CursorScreenPtr cs; - cs = (CursorScreenPtr) malloc(sizeof (CursorScreenRec)); + cs = (CursorScreenPtr) calloc(1, sizeof (CursorScreenRec)); if (!cs) return FALSE; Wrap (cs, pScreen, CloseScreen, CursorCloseScreen); diff --git a/xorg-server/xkb/ddxLoad.c b/xorg-server/xkb/ddxLoad.c index 51b577725..be946d89e 100644 --- a/xorg-server/xkb/ddxLoad.c +++ b/xorg-server/xkb/ddxLoad.c @@ -1,459 +1,503 @@ -/************************************************************ -Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. - -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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution -of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability -of this software for any purpose. It is provided "as is" -without any express or implied warranty. - -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 -#endif - -#include - -#include -#include -#include -#include -#include -#include -#include -#include "inputstr.h" -#include "scrnintstr.h" -#include "windowstr.h" -#define XKBSRV_NEED_FILE_FUNCS -#include -#include -#include "xkb.h" - - /* - * If XKM_OUTPUT_DIR specifies a path without a leading slash, it is - * relative to the top-level XKB configuration directory. - * Making the server write to a subdirectory of that directory - * requires some work in the general case (install procedure - * has to create links to /var or somesuch on many machines), - * so we just compile into /usr/tmp for now. - */ -#ifndef XKM_OUTPUT_DIR -#define XKM_OUTPUT_DIR "compiled/" -#endif - -#define PRE_ERROR_MSG "\"The XKEYBOARD keymap compiler (xkbcomp) reports:\"" -#define ERROR_PREFIX "\"> \"" -#define POST_ERROR_MSG1 "\"Errors from xkbcomp are not fatal to the X server\"" -#define POST_ERROR_MSG2 "\"End of messages from xkbcomp\"" - -#if defined(WIN32) -#define PATHSEPARATOR "\\" -#else -#define PATHSEPARATOR "/" -#endif - -#ifdef WIN32 - -#include -const char* -Win32TempDir() -{ - static char buffer[PATH_MAX]; - if (GetTempPath(sizeof(buffer), buffer)) - { - int len; - buffer[sizeof(buffer)-1] = 0; - len = strlen(buffer); - if (len > 0) - if (buffer[len-1] == '\\') - buffer[len-1] = 0; - return buffer; - } - if (getenv("TEMP") != NULL) - return getenv("TEMP"); - else if (getenv("TMP") != NULL) - return getenv("TEMP"); - else - return "/tmp"; -} - -int -Win32System(const char *cmdline) -{ - STARTUPINFO si; - PROCESS_INFORMATION pi; - DWORD dwExitCode; - char *cmd = strdup(cmdline); - - ZeroMemory( &si, sizeof(si) ); - si.cb = sizeof(si); - ZeroMemory( &pi, sizeof(pi) ); - - if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) - { - LPVOID buffer; - if (!FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &buffer, - 0, - NULL )) - { - ErrorF("[xkb] Starting '%s' failed!\n", cmdline); - } - else - { - ErrorF("[xkb] Starting '%s' failed: %s", cmdline, (char *)buffer); - LocalFree(buffer); - } - - free(cmd); - return -1; - } - /* Wait until child process exits. */ - WaitForSingleObject( pi.hProcess, INFINITE ); - - GetExitCodeProcess( pi.hProcess, &dwExitCode); - - /* Close process and thread handles. */ - CloseHandle( pi.hProcess ); - CloseHandle( pi.hThread ); - free(cmd); - - return dwExitCode; -} -#undef System -#define System(x) Win32System(x) -#endif - -static void -OutputDirectory( - char* outdir, - size_t size) -{ -#ifndef WIN32 - /* Can we write an xkm and then open it too? */ - if (access(XKM_OUTPUT_DIR, W_OK | X_OK) == 0 && (strlen(XKM_OUTPUT_DIR) < size)) - { - (void) strcpy (outdir, XKM_OUTPUT_DIR); - } else -#else - if (strlen(Win32TempDir()) + 1 < size) - { - (void) strcpy(outdir, Win32TempDir()); - (void) strcat(outdir, "\\"); - } else -#endif - if (strlen("/tmp/") < size) - { - (void) strcpy (outdir, "/tmp/"); - } -} - -static Bool -XkbDDXCompileKeymapByNames( XkbDescPtr xkb, - XkbComponentNamesPtr names, - unsigned want, - unsigned need, - char * nameRtrn, - int nameRtrnLen) -{ - FILE * out; - char *buf = NULL, keymap[PATH_MAX], xkm_output_dir[PATH_MAX]; - - const char *emptystring = ""; - char *xkbbasedirflag = NULL; - const char *xkbbindir = emptystring; - const char *xkbbindirsep = emptystring; - -#ifdef WIN32 - /* WIN32 has no popen. The input must be stored in a file which is - used as input for xkbcomp. xkbcomp does not read from stdin. */ - char tmpname[PATH_MAX]; - const char *xkmfile = tmpname; -#else - const char *xkmfile = "-"; -#endif - - snprintf(keymap, sizeof(keymap), "server-%s", display); - - OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); - -#ifdef WIN32 - strcpy(tmpname, Win32TempDir()); - strcat(tmpname, "\\xkb_XXXXXX"); - (void) mktemp(tmpname); -#endif - - if (XkbBaseDirectory != NULL) { - if (asprintf(&xkbbasedirflag, "\"-R%s\"", XkbBaseDirectory) == -1) - xkbbasedirflag = NULL; - } - - if (XkbBinDirectory != NULL) { - int ld = strlen(XkbBinDirectory); - int lps = strlen(PATHSEPARATOR); - - xkbbindir = XkbBinDirectory; - - if ((ld >= lps) && - (strcmp(xkbbindir + ld - lps, PATHSEPARATOR) != 0)) { - xkbbindirsep = PATHSEPARATOR; - } - } - - if (asprintf(&buf, - "\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" " - "-em1 %s -emp %s -eml %s \"%s%s.xkm\"", - xkbbindir, xkbbindirsep, - ((xkbDebugFlags < 2) ? 1 : - ((xkbDebugFlags > 10) ? 10 : (int) xkbDebugFlags)), - xkbbasedirflag ? xkbbasedirflag : "", xkmfile, - PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1, - xkm_output_dir, keymap) == -1) - buf = NULL; - - free(xkbbasedirflag); - - if (!buf) { - LogMessage(X_ERROR, "XKB: Could not invoke xkbcomp: not enough memory\n"); - return FALSE; - } - -#ifndef WIN32 - out= Popen(buf,"w"); -#else - out= fopen(tmpname, "w"); -#endif - - if (out!=NULL) { -#ifdef DEBUG - if (xkbDebugFlags) { - ErrorF("[xkb] XkbDDXCompileKeymapByNames compiling keymap:\n"); - XkbWriteXKBKeymapForNames(stderr,names,xkb,want,need); - } -#endif - XkbWriteXKBKeymapForNames(out,names,xkb,want,need); -#ifndef WIN32 - if (Pclose(out)==0) -#else - if (fclose(out)==0 && System(buf) >= 0) -#endif - { - if (xkbDebugFlags) - DebugF("[xkb] xkb executes: %s\n",buf); - if (nameRtrn) { - strncpy(nameRtrn,keymap,nameRtrnLen); - nameRtrn[nameRtrnLen-1]= '\0'; - } - free(buf); - return TRUE; - } - else - LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap); -#ifdef WIN32 - /* remove the temporary file */ - unlink(tmpname); -#endif - } - else { -#ifndef WIN32 - LogMessage(X_ERROR, "XKB: Could not invoke xkbcomp\n"); -#else - LogMessage(X_ERROR, "Could not open file %s\n", tmpname); -#endif - } - if (nameRtrn) - nameRtrn[0]= '\0'; - free(buf); - return FALSE; -} - -static FILE * -XkbDDXOpenConfigFile(char *mapName,char *fileNameRtrn,int fileNameRtrnLen) -{ -char buf[PATH_MAX],xkm_output_dir[PATH_MAX]; -FILE * file; - - buf[0]= '\0'; - if (mapName!=NULL) { - OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); - if ((XkbBaseDirectory!=NULL)&&(xkm_output_dir[0]!='/') -#ifdef WIN32 - &&(!isalpha(xkm_output_dir[0]) || xkm_output_dir[1]!=':') -#endif - ) { - if (strlen(XkbBaseDirectory)+strlen(xkm_output_dir) - +strlen(mapName)+6 <= PATH_MAX) - { - sprintf(buf,"%s/%s%s.xkm",XkbBaseDirectory, - xkm_output_dir,mapName); - } - } - else if (strlen(xkm_output_dir)+strlen(mapName)+5 <= PATH_MAX) - sprintf(buf,"%s%s.xkm",xkm_output_dir,mapName); - if (buf[0] != '\0') - file= fopen(buf,"rb"); - else file= NULL; - } - else file= NULL; - if ((fileNameRtrn!=NULL)&&(fileNameRtrnLen>0)) { - strncpy(fileNameRtrn,buf,fileNameRtrnLen); - buf[fileNameRtrnLen-1]= '\0'; - } - return file; -} - -unsigned -XkbDDXLoadKeymapByNames( DeviceIntPtr keybd, - XkbComponentNamesPtr names, - unsigned want, - unsigned need, - XkbDescPtr * xkbRtrn, - char * nameRtrn, - int nameRtrnLen) -{ -XkbDescPtr xkb; -FILE * file; -char fileName[PATH_MAX]; -unsigned missing; - - *xkbRtrn = NULL; - if ((keybd==NULL)||(keybd->key==NULL)||(keybd->key->xkbInfo==NULL)) - xkb= NULL; - else xkb= keybd->key->xkbInfo->desc; - if ((names->keycodes==NULL)&&(names->types==NULL)&& - (names->compat==NULL)&&(names->symbols==NULL)&& - (names->geometry==NULL)) { - LogMessage(X_ERROR, "XKB: No components provided for device %s\n", - keybd->name ? keybd->name : "(unnamed keyboard)"); - return 0; - } - else if (!XkbDDXCompileKeymapByNames(xkb,names,want,need, - nameRtrn,nameRtrnLen)){ - LogMessage(X_ERROR, "XKB: Couldn't compile keymap\n"); - return 0; - } - file= XkbDDXOpenConfigFile(nameRtrn,fileName,PATH_MAX); - if (file==NULL) { - LogMessage(X_ERROR, "Couldn't open compiled keymap file %s\n",fileName); - return 0; - } - missing= XkmReadFile(file,need,want,xkbRtrn); - if (*xkbRtrn==NULL) { - LogMessage(X_ERROR, "Error loading keymap %s\n",fileName); - fclose(file); - (void) unlink (fileName); - return 0; - } - else { - DebugF("Loaded XKB keymap %s, defined=0x%x\n",fileName,(*xkbRtrn)->defined); - } - fclose(file); - (void) unlink (fileName); - return (need|want)&(~missing); -} - -Bool -XkbDDXNamesFromRules( DeviceIntPtr keybd, - char * rules_name, - XkbRF_VarDefsPtr defs, - XkbComponentNamesPtr names) -{ -char buf[PATH_MAX]; -FILE * file; -Bool complete; -XkbRF_RulesPtr rules; - - if (!rules_name) - return FALSE; - - if (strlen(XkbBaseDirectory) + strlen(rules_name) + 8 > PATH_MAX) { - LogMessage(X_ERROR, "XKB: Rules name is too long\n"); - return FALSE; - } - sprintf(buf,"%s/rules/%s", XkbBaseDirectory, rules_name); - - file = fopen(buf, "r"); - if (!file) { - LogMessage(X_ERROR, "XKB: Couldn't open rules file %s\n", buf); - return FALSE; - } - - rules = XkbRF_Create(); - if (!rules) { - LogMessage(X_ERROR, "XKB: Couldn't create rules struct\n"); - fclose(file); - return FALSE; - } - - if (!XkbRF_LoadRules(file, rules)) { - LogMessage(X_ERROR, "XKB: Couldn't parse rules file %s\n", rules_name); - fclose(file); - XkbRF_Free(rules,TRUE); - return FALSE; - } - - memset(names, 0, sizeof(*names)); - complete = XkbRF_GetComponents(rules,defs,names); - fclose(file); - XkbRF_Free(rules, TRUE); - - if (!complete) - LogMessage(X_ERROR, "XKB: Rules returned no components\n"); - - return complete; -} - -XkbDescPtr -XkbCompileKeymap(DeviceIntPtr dev, XkbRMLVOSet *rmlvo) -{ - XkbComponentNamesRec kccgst; - XkbRF_VarDefsRec mlvo; - XkbDescPtr xkb; - char name[PATH_MAX]; - - if (!dev || !rmlvo) { - LogMessage(X_ERROR, "XKB: No device or RMLVO specified\n"); - return NULL; - } - - mlvo.model = rmlvo->model; - mlvo.layout = rmlvo->layout; - mlvo.variant = rmlvo->variant; - mlvo.options = rmlvo->options; - - /* XDNFR already logs for us. */ - if (!XkbDDXNamesFromRules(dev, rmlvo->rules, &mlvo, &kccgst)) - return NULL; - - /* XDLKBN too, but it might return 0 as well as allocating. */ - if (!XkbDDXLoadKeymapByNames(dev, &kccgst, XkmAllIndicesMask, 0, &xkb, name, - PATH_MAX)) { - if (xkb) - XkbFreeKeyboard(xkb, 0, TRUE); - return NULL; - } - - return xkb; -} +/************************************************************ +Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. + +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 Silicon Graphics not be +used in advertising or publicity pertaining to distribution +of the software without specific prior written permission. +Silicon Graphics makes no representation about the suitability +of this software for any purpose. It is provided "as is" +without any express or implied warranty. + +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON +GRAPHICS 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 +#endif + +#include + +#include +#include +#include +#include +#include +#include +#include +#include "inputstr.h" +#include "scrnintstr.h" +#include "windowstr.h" +#define XKBSRV_NEED_FILE_FUNCS +#include +#include +#include "xkb.h" + + /* + * If XKM_OUTPUT_DIR specifies a path without a leading slash, it is + * relative to the top-level XKB configuration directory. + * Making the server write to a subdirectory of that directory + * requires some work in the general case (install procedure + * has to create links to /var or somesuch on many machines), + * so we just compile into /usr/tmp for now. + */ +#ifndef XKM_OUTPUT_DIR +#define XKM_OUTPUT_DIR "compiled/" +#endif + +#define PRE_ERROR_MSG "\"The XKEYBOARD keymap compiler (xkbcomp) reports:\"" +#define ERROR_PREFIX "\"> \"" +#define POST_ERROR_MSG1 "\"Errors from xkbcomp are not fatal to the X server\"" +#define POST_ERROR_MSG2 "\"End of messages from xkbcomp\"" + +#if defined(WIN32) +#define PATHSEPARATOR "\\" +#else +#define PATHSEPARATOR "/" +#endif + +#ifdef WIN32 + +#include +const char* +Win32TempDir() +{ + static char buffer[PATH_MAX]; + if (GetTempPath(sizeof(buffer), buffer)) + { + int len; + buffer[sizeof(buffer)-1] = 0; + len = strlen(buffer); + if (len > 0) + if (buffer[len-1] == '\\') + buffer[len-1] = 0; + return buffer; + } + if (getenv("TEMP") != NULL) + return getenv("TEMP"); + else if (getenv("TMP") != NULL) + return getenv("TEMP"); + else + return "/tmp"; +} + +int +Win32System(const char *cmdline) +{ + STARTUPINFO si; + PROCESS_INFORMATION pi; + DWORD dwExitCode; + char *cmd = strdup(cmdline); + + ZeroMemory( &si, sizeof(si) ); + si.cb = sizeof(si); + ZeroMemory( &pi, sizeof(pi) ); + + if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) + { + LPVOID buffer; + if (!FormatMessage( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) &buffer, + 0, + NULL )) + { + ErrorF("[xkb] Starting '%s' failed!\n", cmdline); + } + else + { + ErrorF("[xkb] Starting '%s' failed: %s", cmdline, (char *)buffer); + LocalFree(buffer); + } + + free(cmd); + return -1; + } + /* Wait until child process exits. */ + WaitForSingleObject( pi.hProcess, INFINITE ); + + GetExitCodeProcess( pi.hProcess, &dwExitCode); + + /* Close process and thread handles. */ + CloseHandle( pi.hProcess ); + CloseHandle( pi.hThread ); + free(cmd); + + return dwExitCode; +} +#undef System +#define System(x) Win32System(x) +#endif + +static void +OutputDirectory( + char* outdir, + size_t size) +{ +#ifndef WIN32 + /* Can we write an xkm and then open it too? */ + if (access(XKM_OUTPUT_DIR, W_OK | X_OK) == 0 && (strlen(XKM_OUTPUT_DIR) < size)) + { + (void) strcpy (outdir, XKM_OUTPUT_DIR); + } else +#else + if (strlen(Win32TempDir()) + 1 < size) + { + (void) strcpy(outdir, Win32TempDir()); + (void) strcat(outdir, "\\"); + } else +#endif + if (strlen("/tmp/") < size) + { + (void) strcpy (outdir, "/tmp/"); + } +} + +static Bool +XkbDDXCompileKeymapByNames( XkbDescPtr xkb, + XkbComponentNamesPtr names, + unsigned want, + unsigned need, + char * nameRtrn, + int nameRtrnLen) +{ + FILE * out; + char *buf = NULL, keymap[PATH_MAX], xkm_output_dir[PATH_MAX]; + + const char *emptystring = ""; + char *xkbbasedirflag = NULL; + const char *xkbbindir = emptystring; + const char *xkbbindirsep = emptystring; + +#ifdef WIN32 + /* WIN32 has no popen. The input must be stored in a file which is + used as input for xkbcomp. xkbcomp does not read from stdin. */ + char tmpname[PATH_MAX]; + const char *xkmfile = tmpname; +#else + const char *xkmfile = "-"; +#endif + + snprintf(keymap, sizeof(keymap), "server-%s", display); + + OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); + +#ifdef WIN32 + strcpy(tmpname, Win32TempDir()); + strcat(tmpname, "\\xkb_XXXXXX"); + (void) mktemp(tmpname); +#endif + + if (XkbBaseDirectory != NULL) { + if (asprintf(&xkbbasedirflag, "\"-R%s\"", XkbBaseDirectory) == -1) + xkbbasedirflag = NULL; + } + + if (XkbBinDirectory != NULL) { + int ld = strlen(XkbBinDirectory); + int lps = strlen(PATHSEPARATOR); + + xkbbindir = XkbBinDirectory; + + if ((ld >= lps) && + (strcmp(xkbbindir + ld - lps, PATHSEPARATOR) != 0)) { + xkbbindirsep = PATHSEPARATOR; + } + } + + if (asprintf(&buf, + "\"%s%sxkbcomp\" -w %d %s -xkm \"%s\" " + "-em1 %s -emp %s -eml %s \"%s%s.xkm\"", + xkbbindir, xkbbindirsep, + ((xkbDebugFlags < 2) ? 1 : + ((xkbDebugFlags > 10) ? 10 : (int) xkbDebugFlags)), + xkbbasedirflag ? xkbbasedirflag : "", xkmfile, + PRE_ERROR_MSG, ERROR_PREFIX, POST_ERROR_MSG1, + xkm_output_dir, keymap) == -1) + buf = NULL; + + free(xkbbasedirflag); + + if (!buf) { + LogMessage(X_ERROR, "XKB: Could not invoke xkbcomp: not enough memory\n"); + return FALSE; + } + +#ifndef WIN32 + out= Popen(buf,"w"); +#else + out= fopen(tmpname, "w"); +#endif + + if (out!=NULL) { +#ifdef DEBUG + if (xkbDebugFlags) { + ErrorF("[xkb] XkbDDXCompileKeymapByNames compiling keymap:\n"); + XkbWriteXKBKeymapForNames(stderr,names,xkb,want,need); + } +#endif + XkbWriteXKBKeymapForNames(out,names,xkb,want,need); +#ifndef WIN32 + if (Pclose(out)==0) +#else + if (fclose(out)==0 && System(buf) >= 0) +#endif + { + if (xkbDebugFlags) + DebugF("[xkb] xkb executes: %s\n",buf); + if (nameRtrn) { + strncpy(nameRtrn,keymap,nameRtrnLen); + nameRtrn[nameRtrnLen-1]= '\0'; + } + free(buf); + return TRUE; + } + else + LogMessage(X_ERROR, "Error compiling keymap (%s)\n", keymap); +#ifdef WIN32 + /* remove the temporary file */ + unlink(tmpname); +#endif + } + else { +#ifndef WIN32 + LogMessage(X_ERROR, "XKB: Could not invoke xkbcomp\n"); +#else + LogMessage(X_ERROR, "Could not open file %s\n", tmpname); +#endif + } + if (nameRtrn) + nameRtrn[0]= '\0'; + free(buf); + return FALSE; +} + +static FILE * +XkbDDXOpenConfigFile(char *mapName,char *fileNameRtrn,int fileNameRtrnLen) +{ +char buf[PATH_MAX],xkm_output_dir[PATH_MAX]; +FILE * file; + + buf[0]= '\0'; + if (mapName!=NULL) { + OutputDirectory(xkm_output_dir, sizeof(xkm_output_dir)); + if ((XkbBaseDirectory!=NULL)&&(xkm_output_dir[0]!='/') +#ifdef WIN32 + &&(!isalpha(xkm_output_dir[0]) || xkm_output_dir[1]!=':') +#endif + ) { + if (strlen(XkbBaseDirectory)+strlen(xkm_output_dir) + +strlen(mapName)+6 <= PATH_MAX) + { + sprintf(buf,"%s/%s%s.xkm",XkbBaseDirectory, + xkm_output_dir,mapName); + } + } + else if (strlen(xkm_output_dir)+strlen(mapName)+5 <= PATH_MAX) + sprintf(buf,"%s%s.xkm",xkm_output_dir,mapName); + if (buf[0] != '\0') + file= fopen(buf,"rb"); + else file= NULL; + } + else file= NULL; + if ((fileNameRtrn!=NULL)&&(fileNameRtrnLen>0)) { + strncpy(fileNameRtrn,buf,fileNameRtrnLen); + buf[fileNameRtrnLen-1]= '\0'; + } + return file; +} + +unsigned +XkbDDXLoadKeymapByNames( DeviceIntPtr keybd, + XkbComponentNamesPtr names, + unsigned want, + unsigned need, + XkbDescPtr * xkbRtrn, + char * nameRtrn, + int nameRtrnLen) +{ +XkbDescPtr xkb; +FILE * file; +char fileName[PATH_MAX]; +unsigned missing; + + *xkbRtrn = NULL; + if ((keybd==NULL)||(keybd->key==NULL)||(keybd->key->xkbInfo==NULL)) + xkb= NULL; + else xkb= keybd->key->xkbInfo->desc; + if ((names->keycodes==NULL)&&(names->types==NULL)&& + (names->compat==NULL)&&(names->symbols==NULL)&& + (names->geometry==NULL)) { + LogMessage(X_ERROR, "XKB: No components provided for device %s\n", + keybd->name ? keybd->name : "(unnamed keyboard)"); + return 0; + } + else if (!XkbDDXCompileKeymapByNames(xkb,names,want,need, + nameRtrn,nameRtrnLen)){ + LogMessage(X_ERROR, "XKB: Couldn't compile keymap\n"); + return 0; + } + file= XkbDDXOpenConfigFile(nameRtrn,fileName,PATH_MAX); + if (file==NULL) { + LogMessage(X_ERROR, "Couldn't open compiled keymap file %s\n",fileName); + return 0; + } + missing= XkmReadFile(file,need,want,xkbRtrn); + if (*xkbRtrn==NULL) { + LogMessage(X_ERROR, "Error loading keymap %s\n",fileName); + fclose(file); + (void) unlink (fileName); + return 0; + } + else { + DebugF("Loaded XKB keymap %s, defined=0x%x\n",fileName,(*xkbRtrn)->defined); + } + fclose(file); + (void) unlink (fileName); + return (need|want)&(~missing); +} + +Bool +XkbDDXNamesFromRules( DeviceIntPtr keybd, + char * rules_name, + XkbRF_VarDefsPtr defs, + XkbComponentNamesPtr names) +{ +char buf[PATH_MAX]; +FILE * file; +Bool complete; +XkbRF_RulesPtr rules; + + if (!rules_name) + return FALSE; + + if (strlen(XkbBaseDirectory) + strlen(rules_name) + 8 > PATH_MAX) { + LogMessage(X_ERROR, "XKB: Rules name is too long\n"); + return FALSE; + } + sprintf(buf,"%s/rules/%s", XkbBaseDirectory, rules_name); + + file = fopen(buf, "r"); + if (!file) { + LogMessage(X_ERROR, "XKB: Couldn't open rules file %s\n", buf); + return FALSE; + } + + rules = XkbRF_Create(); + if (!rules) { + LogMessage(X_ERROR, "XKB: Couldn't create rules struct\n"); + fclose(file); + return FALSE; + } + + if (!XkbRF_LoadRules(file, rules)) { + LogMessage(X_ERROR, "XKB: Couldn't parse rules file %s\n", rules_name); + fclose(file); + XkbRF_Free(rules,TRUE); + return FALSE; + } + + memset(names, 0, sizeof(*names)); + complete = XkbRF_GetComponents(rules,defs,names); + fclose(file); + XkbRF_Free(rules, TRUE); + + if (!complete) + LogMessage(X_ERROR, "XKB: Rules returned no components\n"); + + return complete; +} + +static Bool +XkbRMLVOtoKcCGST(DeviceIntPtr dev, XkbRMLVOSet *rmlvo, XkbComponentNamesPtr kccgst) +{ + XkbRF_VarDefsRec mlvo; + + mlvo.model = rmlvo->model; + mlvo.layout = rmlvo->layout; + mlvo.variant = rmlvo->variant; + mlvo.options = rmlvo->options; + + return XkbDDXNamesFromRules(dev, rmlvo->rules, &mlvo, kccgst); +} + +/** + * Compile the given RMLVO keymap and return it. Returns the XkbDescPtr on + * success or NULL on failure. If the components compiled are not a superset + * or equal to need, the compiliation is treated as failure. + */ +static XkbDescPtr +XkbCompileKeymapForDevice(DeviceIntPtr dev, XkbRMLVOSet *rmlvo, int need) +{ + XkbDescPtr xkb; + unsigned int provided; + XkbComponentNamesRec kccgst; + char name[PATH_MAX]; + + if (!XkbRMLVOtoKcCGST(dev, rmlvo, &kccgst)) + return NULL; + + provided = XkbDDXLoadKeymapByNames(dev, &kccgst, XkmAllIndicesMask, need, + &xkb, name, PATH_MAX); + if ((need & provided) != need) { + if (xkb) { + XkbFreeKeyboard(xkb, 0, TRUE); + xkb = NULL; + } + } + + return xkb; +} + +XkbDescPtr +XkbCompileKeymap(DeviceIntPtr dev, XkbRMLVOSet *rmlvo) +{ + XkbDescPtr xkb; + unsigned int need; + + if (!dev || !rmlvo) { + LogMessage(X_ERROR, "XKB: No device or RMLVO specified\n"); + return NULL; + } + + /* These are the components we really really need */ + need = XkmSymbolsMask | XkmCompatMapMask | XkmTypesMask | + XkmKeyNamesMask | XkmVirtualModsMask; + + + xkb = XkbCompileKeymapForDevice(dev, rmlvo, need); + + if (!xkb) { + XkbRMLVOSet dflts; + + /* we didn't get what we really needed. And that will likely leave + * us with a keyboard that doesn't work. Use the defaults instead */ + LogMessage(X_ERROR, "XKB: Failed to load keymap. Loading default " + "keymap instead.\n"); + + XkbGetRulesDflts(&dflts); + + xkb = XkbCompileKeymapForDevice(dev, &dflts, 0); + + XkbFreeRMLVOSet(&dflts, FALSE); + } + + return xkb; +} diff --git a/xorg-server/xkb/xkb.c b/xorg-server/xkb/xkb.c index 6fd66c5e5..385c38d7d 100644 --- a/xorg-server/xkb/xkb.c +++ b/xorg-server/xkb/xkb.c @@ -1,6740 +1,6740 @@ -/************************************************************ -Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. - -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 Silicon Graphics not be -used in advertising or publicity pertaining to distribution -of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability -of this software for any purpose. It is provided "as is" -without any express or implied warranty. - -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS 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 -#endif - -#include -#include -#include -#include "misc.h" -#include "inputstr.h" -#define XKBSRV_NEED_FILE_FUNCS -#include -#include "extnsionst.h" -#include "xace.h" -#include "xkb.h" -#include "protocol-versions.h" - -#include -#include - -int XkbEventBase; -static int XkbErrorBase; -int XkbReqCode; -int XkbKeyboardErrorCode; -CARD32 xkbDebugFlags = 0; -static CARD32 xkbDebugCtrls = 0; - -static RESTYPE RT_XKBCLIENT; - -/***====================================================================***/ - -#define CHK_DEVICE(dev, id, client, access_mode, lf) {\ - int why;\ - int rc = lf(&(dev), id, client, access_mode, &why);\ - if (rc != Success) {\ - client->errorValue = _XkbErrCode2(why, id);\ - return rc;\ - }\ -} - -#define CHK_KBD_DEVICE(dev, id, client, mode) \ - CHK_DEVICE(dev, id, client, mode, _XkbLookupKeyboard) -#define CHK_LED_DEVICE(dev, id, client, mode) \ - CHK_DEVICE(dev, id, client, mode, _XkbLookupLedDevice) -#define CHK_BELL_DEVICE(dev, id, client, mode) \ - CHK_DEVICE(dev, id, client, mode, _XkbLookupBellDevice) -#define CHK_ANY_DEVICE(dev, id, client, mode) \ - CHK_DEVICE(dev, id, client, mode, _XkbLookupAnyDevice) - -#define CHK_ATOM_ONLY2(a,ev,er) {\ - if (((a)==None)||(!ValidAtom((a)))) {\ - (ev)= (XID)(a);\ - return er;\ - }\ -} -#define CHK_ATOM_ONLY(a) \ - CHK_ATOM_ONLY2(a,client->errorValue,BadAtom) - -#define CHK_ATOM_OR_NONE3(a,ev,er,ret) {\ - if (((a)!=None)&&(!ValidAtom((a)))) {\ - (ev)= (XID)(a);\ - (er)= BadAtom;\ - return ret;\ - }\ -} -#define CHK_ATOM_OR_NONE2(a,ev,er) {\ - if (((a)!=None)&&(!ValidAtom((a)))) {\ - (ev)= (XID)(a);\ - return er;\ - }\ -} -#define CHK_ATOM_OR_NONE(a) \ - CHK_ATOM_OR_NONE2(a,client->errorValue,BadAtom) - -#define CHK_MASK_LEGAL3(err,mask,legal,ev,er,ret) {\ - if ((mask)&(~(legal))) { \ - (ev)= _XkbErrCode2((err),((mask)&(~(legal))));\ - (er)= BadValue;\ - return ret;\ - }\ -} -#define CHK_MASK_LEGAL2(err,mask,legal,ev,er) {\ - if ((mask)&(~(legal))) { \ - (ev)= _XkbErrCode2((err),((mask)&(~(legal))));\ - return er;\ - }\ -} -#define CHK_MASK_LEGAL(err,mask,legal) \ - CHK_MASK_LEGAL2(err,mask,legal,client->errorValue,BadValue) - -#define CHK_MASK_MATCH(err,affect,value) {\ - if ((value)&(~(affect))) { \ - client->errorValue= _XkbErrCode2((err),((value)&(~(affect))));\ - return BadMatch;\ - }\ -} -#define CHK_MASK_OVERLAP(err,m1,m2) {\ - if ((m1)&(m2)) { \ - client->errorValue= _XkbErrCode2((err),((m1)&(m2)));\ - return BadMatch;\ - }\ -} -#define CHK_KEY_RANGE2(err,first,num,x,ev,er) {\ - if (((unsigned)(first)+(num)-1)>(x)->max_key_code) {\ - (ev)=_XkbErrCode4(err,(first),(num),(x)->max_key_code);\ - return er;\ - }\ - else if ( (first)<(x)->min_key_code ) {\ - (ev)=_XkbErrCode3(err+1,(first),xkb->min_key_code);\ - return er;\ - }\ -} -#define CHK_KEY_RANGE(err,first,num,x) \ - CHK_KEY_RANGE2(err,first,num,x,client->errorValue,BadValue) - -#define CHK_REQ_KEY_RANGE2(err,first,num,r,ev,er) {\ - if (((unsigned)(first)+(num)-1)>(r)->maxKeyCode) {\ - (ev)=_XkbErrCode4(err,(first),(num),(r)->maxKeyCode);\ - return er;\ - }\ - else if ( (first)<(r)->minKeyCode ) {\ - (ev)=_XkbErrCode3(err+1,(first),(r)->minKeyCode);\ - return er;\ - }\ -} -#define CHK_REQ_KEY_RANGE(err,first,num,r) \ - CHK_REQ_KEY_RANGE2(err,first,num,r,client->errorValue,BadValue) - -/***====================================================================***/ - -int -ProcXkbUseExtension(ClientPtr client) -{ - REQUEST(xkbUseExtensionReq); - xkbUseExtensionReply rep; - register int n; - int supported; - - REQUEST_SIZE_MATCH(xkbUseExtensionReq); - if (stuff->wantedMajor != SERVER_XKB_MAJOR_VERSION) { - /* pre-release version 0.65 is compatible with 1.00 */ - supported= ((SERVER_XKB_MAJOR_VERSION==1)&& - (stuff->wantedMajor==0)&&(stuff->wantedMinor==65)); - } - else supported = 1; - - if ((supported) && (!(client->xkbClientFlags&_XkbClientInitialized))) { - client->xkbClientFlags= _XkbClientInitialized; - client->vMajor= stuff->wantedMajor; - client->vMinor= stuff->wantedMinor; - } - else if (xkbDebugFlags&0x1) { - ErrorF("[xkb] Rejecting client %d (0x%lx) (wants %d.%02d, have %d.%02d)\n", - client->index, - (long)client->clientAsMask, - stuff->wantedMajor,stuff->wantedMinor, - SERVER_XKB_MAJOR_VERSION,SERVER_XKB_MINOR_VERSION); - } - memset(&rep, 0, sizeof(xkbUseExtensionReply)); - rep.type = X_Reply; - rep.supported = supported; - rep.length = 0; - rep.sequenceNumber = client->sequence; - 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); - } - WriteToClient(client,SIZEOF(xkbUseExtensionReply), (char *)&rep); - return Success; -} - -/***====================================================================***/ - -int -ProcXkbSelectEvents(ClientPtr client) -{ - unsigned legal; - DeviceIntPtr dev; - XkbInterestPtr masks; - REQUEST(xkbSelectEventsReq); - - REQUEST_AT_LEAST_SIZE(xkbSelectEventsReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixUseAccess); - - if (((stuff->affectWhich&XkbMapNotifyMask)!=0)&&(stuff->affectMap)) { - client->mapNotifyMask&= ~stuff->affectMap; - client->mapNotifyMask|= (stuff->affectMap&stuff->map); - } - if ((stuff->affectWhich&(~XkbMapNotifyMask))==0) - return Success; - - masks = XkbFindClientResource((DevicePtr)dev,client); - if (!masks){ - XID id = FakeClientID(client->index); - if (!AddResource(id,RT_XKBCLIENT,dev)) - return BadAlloc; - masks= XkbAddClientResource((DevicePtr)dev,client,id); - } - if (masks) { - union { - CARD8 *c8; - CARD16 *c16; - CARD32 *c32; - } from,to; - register unsigned bit,ndx,maskLeft,dataLeft,size; - - from.c8= (CARD8 *)&stuff[1]; - dataLeft= (stuff->length*4)-SIZEOF(xkbSelectEventsReq); - maskLeft= (stuff->affectWhich&(~XkbMapNotifyMask)); - for (ndx=0,bit=1; (maskLeft!=0); ndx++, bit<<=1) { - if ((bit&maskLeft)==0) - continue; - maskLeft&= ~bit; - switch (ndx) { - case XkbNewKeyboardNotify: - to.c16= &client->newKeyboardNotifyMask; - legal= XkbAllNewKeyboardEventsMask; - size= 2; - break; - case XkbStateNotify: - to.c16= &masks->stateNotifyMask; - legal= XkbAllStateEventsMask; - size= 2; - break; - case XkbControlsNotify: - to.c32= &masks->ctrlsNotifyMask; - legal= XkbAllControlEventsMask; - size= 4; - break; - case XkbIndicatorStateNotify: - to.c32= &masks->iStateNotifyMask; - legal= XkbAllIndicatorEventsMask; - size= 4; - break; - case XkbIndicatorMapNotify: - to.c32= &masks->iMapNotifyMask; - legal= XkbAllIndicatorEventsMask; - size= 4; - break; - case XkbNamesNotify: - to.c16= &masks->namesNotifyMask; - legal= XkbAllNameEventsMask; - size= 2; - break; - case XkbCompatMapNotify: - to.c8= &masks->compatNotifyMask; - legal= XkbAllCompatMapEventsMask; - size= 1; - break; - case XkbBellNotify: - to.c8= &masks->bellNotifyMask; - legal= XkbAllBellEventsMask; - size= 1; - break; - case XkbActionMessage: - to.c8= &masks->actionMessageMask; - legal= XkbAllActionMessagesMask; - size= 1; - break; - case XkbAccessXNotify: - to.c16= &masks->accessXNotifyMask; - legal= XkbAllAccessXEventsMask; - size= 2; - break; - case XkbExtensionDeviceNotify: - to.c16= &masks->extDevNotifyMask; - legal= XkbAllExtensionDeviceEventsMask; - size= 2; - break; - default: - client->errorValue = _XkbErrCode2(33,bit); - return BadValue; - } - - if (stuff->clear&bit) { - if (size==2) to.c16[0]= 0; - else if (size==4) to.c32[0]= 0; - else to.c8[0]= 0; - } - else if (stuff->selectAll&bit) { - if (size==2) to.c16[0]= ~0; - else if (size==4) to.c32[0]= ~0; - else to.c8[0]= ~0; - } - else { - if (dataLeft<(size*2)) - return BadLength; - if (size==2) { - CHK_MASK_MATCH(ndx,from.c16[0],from.c16[1]); - CHK_MASK_LEGAL(ndx,from.c16[0],legal); - to.c16[0]&= ~from.c16[0]; - to.c16[0]|= (from.c16[0]&from.c16[1]); - } - else if (size==4) { - CHK_MASK_MATCH(ndx,from.c32[0],from.c32[1]); - CHK_MASK_LEGAL(ndx,from.c32[0],legal); - to.c32[0]&= ~from.c32[0]; - to.c32[0]|= (from.c32[0]&from.c32[1]); - } - else { - CHK_MASK_MATCH(ndx,from.c8[0],from.c8[1]); - CHK_MASK_LEGAL(ndx,from.c8[0],legal); - to.c8[0]&= ~from.c8[0]; - to.c8[0]|= (from.c8[0]&from.c8[1]); - size= 2; - } - from.c8+= (size*2); - dataLeft-= (size*2); - } - } - if (dataLeft>2) { - ErrorF("[xkb] Extra data (%d bytes) after SelectEvents\n",dataLeft); - return BadLength; - } - return Success; - } - return BadAlloc; -} - -/***====================================================================***/ -/** - * Ring a bell on the given device for the given client. - */ -static int -_XkbBell(ClientPtr client, DeviceIntPtr dev, WindowPtr pWin, - int bellClass, int bellID, int pitch, int duration, - int percent, int forceSound, int eventOnly, Atom name) -{ - int base; - pointer ctrl; - int oldPitch, oldDuration; - int newPercent; - - if (bellClass == KbdFeedbackClass) { - KbdFeedbackPtr k; - if (bellID==XkbDfltXIId) - k= dev->kbdfeed; - else { - for (k=dev->kbdfeed; k; k=k->next) { - if (k->ctrl.id == bellID) - break; - } - } - if (!k) { - client->errorValue = _XkbErrCode2(0x5,bellID); - return BadValue; - } - base = k->ctrl.bell; - ctrl = (pointer) &(k->ctrl); - oldPitch= k->ctrl.bell_pitch; - oldDuration= k->ctrl.bell_duration; - if (pitch!=0) { - if (pitch==-1) - k->ctrl.bell_pitch= defaultKeyboardControl.bell_pitch; - else k->ctrl.bell_pitch= pitch; - } - if (duration!=0) { - if (duration==-1) - k->ctrl.bell_duration= defaultKeyboardControl.bell_duration; - else k->ctrl.bell_duration= duration; - } - } - else if (bellClass == BellFeedbackClass) { - BellFeedbackPtr b; - if (bellID==XkbDfltXIId) - b= dev->bell; - else { - for (b=dev->bell; b; b=b->next) { - if (b->ctrl.id == bellID) - break; - } - } - if (!b) { - client->errorValue = _XkbErrCode2(0x6,bellID); - return BadValue; - } - base = b->ctrl.percent; - ctrl = (pointer) &(b->ctrl); - oldPitch= b->ctrl.pitch; - oldDuration= b->ctrl.duration; - if (pitch!=0) { - if (pitch==-1) - b->ctrl.pitch= defaultKeyboardControl.bell_pitch; - else b->ctrl.pitch= pitch; - } - if (duration!=0) { - if (duration==-1) - b->ctrl.duration= defaultKeyboardControl.bell_duration; - else b->ctrl.duration= duration; - } - } - else { - client->errorValue = _XkbErrCode2(0x7, bellClass); - return BadValue; - } - - newPercent = (base * percent)/100; - if (percent < 0) - newPercent = base + newPercent; - else newPercent = base - newPercent + percent; - - XkbHandleBell(forceSound, eventOnly, - dev, newPercent, ctrl, bellClass, - name, pWin, client); - if ((pitch!=0)||(duration!=0)) { - if (bellClass == KbdFeedbackClass) { - KbdFeedbackPtr k; - k= (KbdFeedbackPtr)ctrl; - if (pitch!=0) - k->ctrl.bell_pitch= oldPitch; - if (duration!=0) - k->ctrl.bell_duration= oldDuration; - } - else { - BellFeedbackPtr b; - b= (BellFeedbackPtr)ctrl; - if (pitch!=0) - b->ctrl.pitch= oldPitch; - if (duration!=0) - b->ctrl.duration= oldDuration; - } - } - - return Success; -} - -int -ProcXkbBell(ClientPtr client) -{ - REQUEST(xkbBellReq); - DeviceIntPtr dev; - WindowPtr pWin; - int rc; - - REQUEST_SIZE_MATCH(xkbBellReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_BELL_DEVICE(dev, stuff->deviceSpec, client, DixBellAccess); - CHK_ATOM_OR_NONE(stuff->name); - - /* device-independent checks request for sane values */ - if ((stuff->forceSound)&&(stuff->eventOnly)) { - client->errorValue=_XkbErrCode3(0x1,stuff->forceSound,stuff->eventOnly); - return BadMatch; - } - if (stuff->percent < -100 || stuff->percent > 100) { - client->errorValue = _XkbErrCode2(0x2,stuff->percent); - return BadValue; - } - if (stuff->duration<-1) { - client->errorValue = _XkbErrCode2(0x3,stuff->duration); - return BadValue; - } - if (stuff->pitch<-1) { - client->errorValue = _XkbErrCode2(0x4,stuff->pitch); - return BadValue; - } - - if (stuff->bellClass == XkbDfltXIClass) { - if (dev->kbdfeed!=NULL) - stuff->bellClass= KbdFeedbackClass; - else stuff->bellClass= BellFeedbackClass; - } - - if (stuff->window!=None) { - rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); - if (rc != Success) { - client->errorValue= stuff->window; - return rc; - } - } - else pWin= NULL; - - /* Client wants to ring a bell on the core keyboard? - Ring the bell on the core keyboard (which does nothing, but if that - fails the client is screwed anyway), and then on all extension devices. - Fail if the core keyboard fails but not the extension devices. this - may cause some keyboards to ding and others to stay silent. Fix - your client to use explicit keyboards to avoid this. - - dev is the device the client requested. - */ - rc = _XkbBell(client, dev, pWin, stuff->bellClass, stuff->bellID, - stuff->pitch, stuff->duration, stuff->percent, - stuff->forceSound, stuff->eventOnly, stuff->name); - - if ((rc == Success) && ((stuff->deviceSpec == XkbUseCoreKbd) || - (stuff->deviceSpec == XkbUseCorePtr))) - { - DeviceIntPtr other; - for (other = inputInfo.devices; other; other = other->next) - { - if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) - { - rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixBellAccess); - if (rc == Success) - _XkbBell(client, other, pWin, stuff->bellClass, - stuff->bellID, stuff->pitch, stuff->duration, - stuff->percent, stuff->forceSound, - stuff->eventOnly, stuff->name); - } - } - rc = Success; /* reset to success, that's what we got for the VCK */ - } - - return rc; -} - -/***====================================================================***/ - -int -ProcXkbGetState(ClientPtr client) -{ - REQUEST(xkbGetStateReq); - DeviceIntPtr dev; - xkbGetStateReply rep; - XkbStateRec *xkb; - - REQUEST_SIZE_MATCH(xkbGetStateReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); - - xkb= &dev->key->xkbInfo->state; - memset(&rep, 0, sizeof(xkbGetStateReply)); - rep.type= X_Reply; - rep.sequenceNumber= client->sequence; - rep.length = 0; - rep.deviceID = dev->id; - rep.mods = XkbStateFieldFromRec(xkb) & 0xff; - rep.baseMods = xkb->base_mods; - rep.lockedMods = xkb->locked_mods; - rep.latchedMods = xkb->latched_mods; - rep.group = xkb->group; - rep.baseGroup = xkb->base_group; - rep.latchedGroup = xkb->latched_group; - rep.lockedGroup = xkb->locked_group; - rep.compatState = xkb->compat_state; - rep.ptrBtnState = xkb->ptr_buttons; - if (client->swapped) { - register int n; - swaps(&rep.sequenceNumber,n); - swaps(&rep.ptrBtnState,n); - } - WriteToClient(client, SIZEOF(xkbGetStateReply), (char *)&rep); - return Success; -} - -/***====================================================================***/ - -int -ProcXkbLatchLockState(ClientPtr client) -{ - int status; - DeviceIntPtr dev, tmpd; - XkbStateRec oldState,*newState; - CARD16 changed; - xkbStateNotify sn; - XkbEventCauseRec cause; - - REQUEST(xkbLatchLockStateReq); - REQUEST_SIZE_MATCH(xkbLatchLockStateReq); - - if (!(client->xkbClientFlags & _XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess); - CHK_MASK_MATCH(0x01, stuff->affectModLocks, stuff->modLocks); - CHK_MASK_MATCH(0x01, stuff->affectModLatches, stuff->modLatches); - - status = Success; - - for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { - if ((tmpd == dev) || (!IsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) { - if (!tmpd->key || !tmpd->key->xkbInfo) - continue; - - oldState = tmpd->key->xkbInfo->state; - newState = &tmpd->key->xkbInfo->state; - if (stuff->affectModLocks) { - newState->locked_mods &= ~stuff->affectModLocks; - newState->locked_mods |= (stuff->affectModLocks & stuff->modLocks); - } - if (status == Success && stuff->lockGroup) - newState->locked_group = stuff->groupLock; - if (status == Success && stuff->affectModLatches) - status = XkbLatchModifiers(tmpd, stuff->affectModLatches, - stuff->modLatches); - if (status == Success && stuff->latchGroup) - status = XkbLatchGroup(tmpd, stuff->groupLatch); - - if (status != Success) - return status; - - XkbComputeDerivedState(tmpd->key->xkbInfo); - - changed = XkbStateChangedFlags(&oldState, newState); - if (changed) { - sn.keycode = 0; - sn.eventType = 0; - sn.requestMajor = XkbReqCode; - sn.requestMinor = X_kbLatchLockState; - sn.changed = changed; - XkbSendStateNotify(tmpd, &sn); - changed = XkbIndicatorsToUpdate(tmpd, changed, FALSE); - if (changed) { - XkbSetCauseXkbReq(&cause, X_kbLatchLockState, client); - XkbUpdateIndicators(tmpd, changed, TRUE, NULL, &cause); - } - } - } - } - - return Success; -} - -/***====================================================================***/ - -int -ProcXkbGetControls(ClientPtr client) -{ - xkbGetControlsReply rep; - XkbControlsPtr xkb; - DeviceIntPtr dev; - register int n; - - REQUEST(xkbGetControlsReq); - REQUEST_SIZE_MATCH(xkbGetControlsReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); - - xkb = dev->key->xkbInfo->desc->ctrls; - rep.type = X_Reply; - rep.length = bytes_to_int32(SIZEOF(xkbGetControlsReply)- - SIZEOF(xGenericReply)); - rep.sequenceNumber = client->sequence; - rep.deviceID = ((DeviceIntPtr)dev)->id; - rep.numGroups = xkb->num_groups; - rep.groupsWrap = xkb->groups_wrap; - rep.internalMods = xkb->internal.mask; - rep.ignoreLockMods = xkb->ignore_lock.mask; - rep.internalRealMods = xkb->internal.real_mods; - rep.ignoreLockRealMods = xkb->ignore_lock.real_mods; - rep.internalVMods = xkb->internal.vmods; - rep.ignoreLockVMods = xkb->ignore_lock.vmods; - rep.enabledCtrls = xkb->enabled_ctrls; - rep.repeatDelay = xkb->repeat_delay; - rep.repeatInterval = xkb->repeat_interval; - rep.slowKeysDelay = xkb->slow_keys_delay; - rep.debounceDelay = xkb->debounce_delay; - rep.mkDelay = xkb->mk_delay; - rep.mkInterval = xkb->mk_interval; - rep.mkTimeToMax = xkb->mk_time_to_max; - rep.mkMaxSpeed = xkb->mk_max_speed; - rep.mkCurve = xkb->mk_curve; - rep.mkDfltBtn = xkb->mk_dflt_btn; - rep.axTimeout = xkb->ax_timeout; - rep.axtCtrlsMask = xkb->axt_ctrls_mask; - rep.axtCtrlsValues = xkb->axt_ctrls_values; - rep.axtOptsMask = xkb->axt_opts_mask; - rep.axtOptsValues = xkb->axt_opts_values; - 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); - } - WriteToClient(client, SIZEOF(xkbGetControlsReply), (char *)&rep); - return Success; -} - -int -ProcXkbSetControls(ClientPtr client) -{ - DeviceIntPtr dev, tmpd; - XkbSrvInfoPtr xkbi; - XkbControlsPtr ctrl; - XkbControlsRec new,old; - xkbControlsNotify cn; - XkbEventCauseRec cause; - XkbSrvLedInfoPtr sli; - - REQUEST(xkbSetControlsReq); - REQUEST_SIZE_MATCH(xkbSetControlsReq); - - if (!(client->xkbClientFlags & _XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); - CHK_MASK_LEGAL(0x01, stuff->changeCtrls, XkbAllControlsMask); - - for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { - if (!tmpd->key || !tmpd->key->xkbInfo) - continue; - if ((tmpd == dev) || (!IsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) { - xkbi = tmpd->key->xkbInfo; - ctrl = xkbi->desc->ctrls; - new = *ctrl; - XkbSetCauseXkbReq(&cause, X_kbSetControls, client); - - if (stuff->changeCtrls & XkbInternalModsMask) { - CHK_MASK_MATCH(0x02, stuff->affectInternalMods, - stuff->internalMods); - CHK_MASK_MATCH(0x03, stuff->affectInternalVMods, - stuff->internalVMods); - - new.internal.real_mods &= ~(stuff->affectInternalMods); - new.internal.real_mods |= (stuff->affectInternalMods & - stuff->internalMods); - new.internal.vmods &= ~(stuff->affectInternalVMods); - new.internal.vmods |= (stuff->affectInternalVMods & - stuff->internalVMods); - new.internal.mask = new.internal.real_mods | - XkbMaskForVMask(xkbi->desc, - new.internal.vmods); - } - - if (stuff->changeCtrls & XkbIgnoreLockModsMask) { - CHK_MASK_MATCH(0x4, stuff->affectIgnoreLockMods, - stuff->ignoreLockMods); - CHK_MASK_MATCH(0x5, stuff->affectIgnoreLockVMods, - stuff->ignoreLockVMods); - - new.ignore_lock.real_mods &= ~(stuff->affectIgnoreLockMods); - new.ignore_lock.real_mods |= (stuff->affectIgnoreLockMods & - stuff->ignoreLockMods); - new.ignore_lock.vmods &= ~(stuff->affectIgnoreLockVMods); - new.ignore_lock.vmods |= (stuff->affectIgnoreLockVMods & - stuff->ignoreLockVMods); - new.ignore_lock.mask = new.ignore_lock.real_mods | - XkbMaskForVMask(xkbi->desc, - new.ignore_lock.vmods); - } - - CHK_MASK_MATCH(0x06, stuff->affectEnabledCtrls, - stuff->enabledCtrls); - if (stuff->affectEnabledCtrls) { - CHK_MASK_LEGAL(0x07, stuff->affectEnabledCtrls, - XkbAllBooleanCtrlsMask); - - new.enabled_ctrls &= ~(stuff->affectEnabledCtrls); - new.enabled_ctrls |= (stuff->affectEnabledCtrls & - stuff->enabledCtrls); - } - - if (stuff->changeCtrls & XkbRepeatKeysMask) { - if (stuff->repeatDelay < 1 || stuff->repeatInterval < 1) { - client->errorValue = _XkbErrCode3(0x08, stuff->repeatDelay, - stuff->repeatInterval); - return BadValue; - } - - new.repeat_delay = stuff->repeatDelay; - new.repeat_interval = stuff->repeatInterval; - } - - if (stuff->changeCtrls & XkbSlowKeysMask) { - if (stuff->slowKeysDelay < 1) { - client->errorValue = _XkbErrCode2(0x09, - stuff->slowKeysDelay); - return BadValue; - } - - new.slow_keys_delay = stuff->slowKeysDelay; - } - - if (stuff->changeCtrls & XkbBounceKeysMask) { - if (stuff->debounceDelay < 1) { - client->errorValue = _XkbErrCode2(0x0A, - stuff->debounceDelay); - return BadValue; - } - - new.debounce_delay = stuff->debounceDelay; - } - - if (stuff->changeCtrls & XkbMouseKeysMask) { - if (stuff->mkDfltBtn > XkbMaxMouseKeysBtn) { - client->errorValue = _XkbErrCode2(0x0B, stuff->mkDfltBtn); - return BadValue; - } - - new.mk_dflt_btn = stuff->mkDfltBtn; - } - - if (stuff->changeCtrls & XkbMouseKeysAccelMask) { - if (stuff->mkDelay < 1 || stuff->mkInterval < 1 || - stuff->mkTimeToMax < 1 || stuff->mkMaxSpeed < 1 || - stuff->mkCurve < -1000) { - client->errorValue = _XkbErrCode2(0x0C,0); - return BadValue; - } - - new.mk_delay = stuff->mkDelay; - new.mk_interval = stuff->mkInterval; - new.mk_time_to_max = stuff->mkTimeToMax; - new.mk_max_speed = stuff->mkMaxSpeed; - new.mk_curve = stuff->mkCurve; - AccessXComputeCurveFactor(xkbi, &new); - } - - if (stuff->changeCtrls & XkbGroupsWrapMask) { - unsigned act, num; - - act = XkbOutOfRangeGroupAction(stuff->groupsWrap); - switch (act) { - case XkbRedirectIntoRange: - num = XkbOutOfRangeGroupNumber(stuff->groupsWrap); - if (num >= new.num_groups) { - client->errorValue = _XkbErrCode3(0x0D, new.num_groups, - num); - return BadValue; - } - case XkbWrapIntoRange: - case XkbClampIntoRange: - break; - default: - client->errorValue = _XkbErrCode2(0x0E, act); - return BadValue; - } - - new.groups_wrap= stuff->groupsWrap; - } - - CHK_MASK_LEGAL(0x0F, stuff->axOptions, XkbAX_AllOptionsMask); - if (stuff->changeCtrls & XkbAccessXKeysMask) { - new.ax_options = stuff->axOptions & XkbAX_AllOptionsMask; - } - else { - if (stuff->changeCtrls & XkbStickyKeysMask) { - new.ax_options &= ~(XkbAX_SKOptionsMask); - new.ax_options |= (stuff->axOptions & XkbAX_SKOptionsMask); - } - - if (stuff->changeCtrls & XkbAccessXFeedbackMask) { - new.ax_options &= ~(XkbAX_FBOptionsMask); - new.ax_options |= (stuff->axOptions & XkbAX_FBOptionsMask); - } - } - - if (stuff->changeCtrls & XkbAccessXTimeoutMask) { - if (stuff->axTimeout < 1) { - client->errorValue = _XkbErrCode2(0x10, stuff->axTimeout); - return BadValue; - } - CHK_MASK_MATCH(0x11, stuff->axtCtrlsMask, - stuff->axtCtrlsValues); - CHK_MASK_LEGAL(0x12, stuff->axtCtrlsMask, - XkbAllBooleanCtrlsMask); - CHK_MASK_MATCH(0x13, stuff->axtOptsMask, stuff->axtOptsValues); - CHK_MASK_LEGAL(0x14, stuff->axtOptsMask, XkbAX_AllOptionsMask); - new.ax_timeout = stuff->axTimeout; - new.axt_ctrls_mask = stuff->axtCtrlsMask; - new.axt_ctrls_values = (stuff->axtCtrlsValues & - stuff->axtCtrlsMask); - new.axt_opts_mask = stuff->axtOptsMask; - new.axt_opts_values = (stuff->axtOptsValues & - stuff->axtOptsMask); - } - - if (stuff->changeCtrls & XkbPerKeyRepeatMask) { - memcpy(new.per_key_repeat, stuff->perKeyRepeat, - XkbPerKeyBitArraySize); - if (xkbi->repeatKey && - !BitIsOn(new.per_key_repeat, xkbi->repeatKey)) { - AccessXCancelRepeatKey(xkbi, xkbi->repeatKey); - } - } - - old= *ctrl; - *ctrl= new; - XkbDDXChangeControls(tmpd, &old, ctrl); - - if (XkbComputeControlsNotify(tmpd, &old, ctrl, &cn, FALSE)) { - cn.keycode = 0; - cn.eventType = 0; - cn.requestMajor = XkbReqCode; - cn.requestMinor = X_kbSetControls; - XkbSendControlsNotify(tmpd, &cn); - } - - sli = XkbFindSrvLedInfo(tmpd, XkbDfltXIClass, XkbDfltXIId, 0); - if (sli) - XkbUpdateIndicators(tmpd, sli->usesControls, TRUE, NULL, - &cause); - - /* If sticky keys were disabled, clear all locks and latches */ - if ((old.enabled_ctrls & XkbStickyKeysMask) && - !(ctrl->enabled_ctrls & XkbStickyKeysMask)) - XkbClearAllLatchesAndLocks(tmpd, xkbi, TRUE, &cause); - } - } - - return Success; -} - -/***====================================================================***/ - -static int -XkbSizeKeyTypes(XkbDescPtr xkb,xkbGetMapReply *rep) -{ - XkbKeyTypeRec *type; - unsigned i,len; - - len= 0; - if (((rep->present&XkbKeyTypesMask)==0)||(rep->nTypes<1)|| - (!xkb)||(!xkb->map)||(!xkb->map->types)) { - rep->present&= ~XkbKeyTypesMask; - rep->firstType= rep->nTypes= 0; - return 0; - } - type= &xkb->map->types[rep->firstType]; - for (i=0;inTypes;i++,type++){ - len+= SIZEOF(xkbKeyTypeWireDesc); - if (type->map_count>0) { - len+= (type->map_count*SIZEOF(xkbKTMapEntryWireDesc)); - if (type->preserve) - len+= (type->map_count*SIZEOF(xkbModsWireDesc)); - } - } - return len; -} - -static char * -XkbWriteKeyTypes( XkbDescPtr xkb, - xkbGetMapReply * rep, - char * buf, - ClientPtr client) -{ - XkbKeyTypePtr type; - unsigned i; - xkbKeyTypeWireDesc *wire; - - type= &xkb->map->types[rep->firstType]; - for (i=0;inTypes;i++,type++) { - register unsigned n; - wire= (xkbKeyTypeWireDesc *)buf; - wire->mask = type->mods.mask; - wire->realMods = type->mods.real_mods; - wire->virtualMods = type->mods.vmods; - wire->numLevels = type->num_levels; - wire->nMapEntries = type->map_count; - wire->preserve = (type->preserve!=NULL); - if (client->swapped) { - register int n; - swaps(&wire->virtualMods,n); - } - - buf= (char *)&wire[1]; - if (wire->nMapEntries>0) { - xkbKTMapEntryWireDesc * wire; - XkbKTMapEntryPtr entry; - wire= (xkbKTMapEntryWireDesc *)buf; - entry= type->map; - for (n=0;nmap_count;n++,wire++,entry++) { - wire->active= entry->active; - wire->mask= entry->mods.mask; - wire->level= entry->level; - wire->realMods= entry->mods.real_mods; - wire->virtualMods= entry->mods.vmods; - if (client->swapped) { - register int n; - swaps(&wire->virtualMods,n); - } - } - buf= (char *)wire; - if (type->preserve!=NULL) { - xkbModsWireDesc * pwire; - XkbModsPtr preserve; - pwire= (xkbModsWireDesc *)buf; - preserve= type->preserve; - for (n=0;nmap_count;n++,pwire++,preserve++) { - pwire->mask= preserve->mask; - pwire->realMods= preserve->real_mods; - pwire->virtualMods= preserve->vmods; - if (client->swapped) { - register int n; - swaps(&pwire->virtualMods,n); - } - } - buf= (char *)pwire; - } - } - } - return buf; -} - -static int -XkbSizeKeySyms(XkbDescPtr xkb,xkbGetMapReply *rep) -{ - XkbSymMapPtr symMap; - unsigned i,len; - unsigned nSyms,nSymsThisKey; - - if (((rep->present&XkbKeySymsMask)==0)||(rep->nKeySyms<1)|| - (!xkb)||(!xkb->map)||(!xkb->map->key_sym_map)) { - rep->present&= ~XkbKeySymsMask; - rep->firstKeySym= rep->nKeySyms= 0; - rep->totalSyms= 0; - return 0; - } - len= rep->nKeySyms*SIZEOF(xkbSymMapWireDesc); - symMap = &xkb->map->key_sym_map[rep->firstKeySym]; - for (i=nSyms=0;inKeySyms;i++,symMap++) { - if (symMap->offset!=0) { - nSymsThisKey= XkbNumGroups(symMap->group_info)*symMap->width; - nSyms+= nSymsThisKey; - } - } - len+= nSyms*4; - rep->totalSyms= nSyms; - return len; -} - -static int -XkbSizeVirtualMods(XkbDescPtr xkb,xkbGetMapReply *rep) -{ -register unsigned i,nMods,bit; - - if (((rep->present&XkbVirtualModsMask)==0)||(rep->virtualMods==0)|| - (!xkb)||(!xkb->server)) { - rep->present&= ~XkbVirtualModsMask; - rep->virtualMods= 0; - return 0; - } - for (i=nMods=0,bit=1;ivirtualMods&bit) - nMods++; - } - return XkbPaddedSize(nMods); -} - -static char * -XkbWriteKeySyms(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf,ClientPtr client) -{ -register KeySym * pSym; -XkbSymMapPtr symMap; -xkbSymMapWireDesc * outMap; -register unsigned i; - - symMap = &xkb->map->key_sym_map[rep->firstKeySym]; - for (i=0;inKeySyms;i++,symMap++) { - outMap = (xkbSymMapWireDesc *)buf; - outMap->ktIndex[0] = symMap->kt_index[0]; - outMap->ktIndex[1] = symMap->kt_index[1]; - outMap->ktIndex[2] = symMap->kt_index[2]; - outMap->ktIndex[3] = symMap->kt_index[3]; - outMap->groupInfo = symMap->group_info; - outMap->width= symMap->width; - outMap->nSyms = symMap->width*XkbNumGroups(symMap->group_info); - buf= (char *)&outMap[1]; - if (outMap->nSyms==0) - continue; - - 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); - while (nSyms-->0) { - swapl(buf,n); - buf+= 4; - } - } - else buf+= outMap->nSyms*4; - } - return buf; -} - -static int -XkbSizeKeyActions(XkbDescPtr xkb,xkbGetMapReply *rep) -{ - unsigned i,len,nActs; - register KeyCode firstKey; - - if (((rep->present&XkbKeyActionsMask)==0)||(rep->nKeyActs<1)|| - (!xkb)||(!xkb->server)||(!xkb->server->key_acts)) { - rep->present&= ~XkbKeyActionsMask; - rep->firstKeyAct= rep->nKeyActs= 0; - rep->totalActs= 0; - return 0; - } - firstKey= rep->firstKeyAct; - for (nActs=i=0;inKeyActs;i++) { - if (xkb->server->key_acts[i+firstKey]!=0) - nActs+= XkbKeyNumActions(xkb,i+firstKey); - } - len= XkbPaddedSize(rep->nKeyActs)+(nActs*SIZEOF(xkbActionWireDesc)); - rep->totalActs= nActs; - return len; -} - -static char * -XkbWriteKeyActions(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, - ClientPtr client) -{ - unsigned i; - CARD8 * numDesc; - XkbAnyAction * actDesc; - - numDesc = (CARD8 *)buf; - for (i=0;inKeyActs;i++) { - if (xkb->server->key_acts[i+rep->firstKeyAct]==0) - numDesc[i] = 0; - else numDesc[i] = XkbKeyNumActions(xkb,(i+rep->firstKeyAct)); - } - buf+= XkbPaddedSize(rep->nKeyActs); - - actDesc = (XkbAnyAction *)buf; - for (i=0;inKeyActs;i++) { - if (xkb->server->key_acts[i+rep->firstKeyAct]!=0) { - unsigned int num; - num = XkbKeyNumActions(xkb,(i+rep->firstKeyAct)); - memcpy((char *)actDesc, - (char*)XkbKeyActionsPtr(xkb,(i+rep->firstKeyAct)), - num*SIZEOF(xkbActionWireDesc)); - actDesc+= num; - } - } - buf = (char *)actDesc; - return buf; -} - -static int -XkbSizeKeyBehaviors(XkbDescPtr xkb,xkbGetMapReply *rep) -{ - unsigned i,len,nBhvr; - XkbBehavior * bhv; - - if (((rep->present&XkbKeyBehaviorsMask)==0)||(rep->nKeyBehaviors<1)|| - (!xkb)||(!xkb->server)||(!xkb->server->behaviors)) { - rep->present&= ~XkbKeyBehaviorsMask; - rep->firstKeyBehavior= rep->nKeyBehaviors= 0; - rep->totalKeyBehaviors= 0; - return 0; - } - bhv= &xkb->server->behaviors[rep->firstKeyBehavior]; - for (nBhvr=i=0;inKeyBehaviors;i++,bhv++) { - if (bhv->type!=XkbKB_Default) - nBhvr++; - } - len= nBhvr*SIZEOF(xkbBehaviorWireDesc); - rep->totalKeyBehaviors= nBhvr; - return len; -} - -static char * -XkbWriteKeyBehaviors(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, - ClientPtr client) -{ - unsigned i; - xkbBehaviorWireDesc *wire; - XkbBehavior *pBhvr; - - wire = (xkbBehaviorWireDesc *)buf; - pBhvr= &xkb->server->behaviors[rep->firstKeyBehavior]; - for (i=0;inKeyBehaviors;i++,pBhvr++) { - if (pBhvr->type!=XkbKB_Default) { - wire->key= i+rep->firstKeyBehavior; - wire->type= pBhvr->type; - wire->data= pBhvr->data; - wire++; - } - } - buf = (char *)wire; - return buf; -} - -static int -XkbSizeExplicit(XkbDescPtr xkb,xkbGetMapReply *rep) -{ - unsigned i,len,nRtrn; - - if (((rep->present&XkbExplicitComponentsMask)==0)||(rep->nKeyExplicit<1)|| - (!xkb)||(!xkb->server)||(!xkb->server->explicit)) { - rep->present&= ~XkbExplicitComponentsMask; - rep->firstKeyExplicit= rep->nKeyExplicit= 0; - rep->totalKeyExplicit= 0; - return 0; - } - for (nRtrn=i=0;inKeyExplicit;i++) { - if (xkb->server->explicit[i+rep->firstKeyExplicit]!=0) - nRtrn++; - } - rep->totalKeyExplicit= nRtrn; - len= XkbPaddedSize(nRtrn*2); /* two bytes per non-zero explicit component */ - return len; -} - -static char * -XkbWriteExplicit(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf,ClientPtr client) -{ -unsigned i; -char * start; -unsigned char * pExp; - - start= buf; - pExp= &xkb->server->explicit[rep->firstKeyExplicit]; - for (i=0;inKeyExplicit;i++,pExp++) { - if (*pExp!=0) { - *buf++= i+rep->firstKeyExplicit; - *buf++= *pExp; - } - } - i= XkbPaddedSize(buf-start)-(buf-start); /* pad to word boundary */ - return buf+i; -} - -static int -XkbSizeModifierMap(XkbDescPtr xkb,xkbGetMapReply *rep) -{ - unsigned i,len,nRtrn; - - if (((rep->present&XkbModifierMapMask)==0)||(rep->nModMapKeys<1)|| - (!xkb)||(!xkb->map)||(!xkb->map->modmap)) { - rep->present&= ~XkbModifierMapMask; - rep->firstModMapKey= rep->nModMapKeys= 0; - rep->totalModMapKeys= 0; - return 0; - } - for (nRtrn=i=0;inModMapKeys;i++) { - if (xkb->map->modmap[i+rep->firstModMapKey]!=0) - nRtrn++; - } - rep->totalModMapKeys= nRtrn; - len= XkbPaddedSize(nRtrn*2); /* two bytes per non-zero modmap component */ - return len; -} - -static char * -XkbWriteModifierMap(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, - ClientPtr client) -{ -unsigned i; -char * start; -unsigned char * pMap; - - start= buf; - pMap= &xkb->map->modmap[rep->firstModMapKey]; - for (i=0;inModMapKeys;i++,pMap++) { - if (*pMap!=0) { - *buf++= i+rep->firstModMapKey; - *buf++= *pMap; - } - } - i= XkbPaddedSize(buf-start)-(buf-start); /* pad to word boundary */ - return buf+i; -} - -static int -XkbSizeVirtualModMap(XkbDescPtr xkb,xkbGetMapReply *rep) -{ - unsigned i,len,nRtrn; - - if (((rep->present&XkbVirtualModMapMask)==0)||(rep->nVModMapKeys<1)|| - (!xkb)||(!xkb->server)||(!xkb->server->vmodmap)) { - rep->present&= ~XkbVirtualModMapMask; - rep->firstVModMapKey= rep->nVModMapKeys= 0; - rep->totalVModMapKeys= 0; - return 0; - } - for (nRtrn=i=0;inVModMapKeys;i++) { - if (xkb->server->vmodmap[i+rep->firstVModMapKey]!=0) - nRtrn++; - } - rep->totalVModMapKeys= nRtrn; - len= nRtrn*SIZEOF(xkbVModMapWireDesc); - return len; -} - -static char * -XkbWriteVirtualModMap(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, - ClientPtr client) -{ -unsigned i; -xkbVModMapWireDesc * wire; -unsigned short * pMap; - - wire= (xkbVModMapWireDesc *)buf; - pMap= &xkb->server->vmodmap[rep->firstVModMapKey]; - for (i=0;inVModMapKeys;i++,pMap++) { - if (*pMap!=0) { - wire->key= i+rep->firstVModMapKey; - wire->vmods= *pMap; - wire++; - } - } - return (char *)wire; -} - -static Status -XkbComputeGetMapReplySize(XkbDescPtr xkb,xkbGetMapReply *rep) -{ -int len; - - rep->minKeyCode= xkb->min_key_code; - rep->maxKeyCode= xkb->max_key_code; - len= XkbSizeKeyTypes(xkb,rep); - len+= XkbSizeKeySyms(xkb,rep); - len+= XkbSizeKeyActions(xkb,rep); - len+= XkbSizeKeyBehaviors(xkb,rep); - len+= XkbSizeVirtualMods(xkb,rep); - len+= XkbSizeExplicit(xkb,rep); - len+= XkbSizeModifierMap(xkb,rep); - len+= XkbSizeVirtualModMap(xkb,rep); - rep->length+= (len/4); - return Success; -} - -static int -XkbSendMap(ClientPtr client,XkbDescPtr xkb,xkbGetMapReply *rep) -{ -unsigned i,len; -char *desc,*start; - - len= (rep->length*4)-(SIZEOF(xkbGetMapReply)-SIZEOF(xGenericReply)); - start= desc= calloc(1, len); - if (!start) - return BadAlloc; - if ( rep->nTypes>0 ) - desc = XkbWriteKeyTypes(xkb,rep,desc,client); - if ( rep->nKeySyms>0 ) - desc = XkbWriteKeySyms(xkb,rep,desc,client); - if ( rep->nKeyActs>0 ) - desc = XkbWriteKeyActions(xkb,rep,desc,client); - if ( rep->totalKeyBehaviors>0 ) - desc = XkbWriteKeyBehaviors(xkb,rep,desc,client); - if ( rep->virtualMods ) { - register int sz,bit; - for (i=sz=0,bit=1;ivirtualMods&bit) { - desc[sz++]= xkb->server->vmods[i]; - } - } - desc+= XkbPaddedSize(sz); - } - if ( rep->totalKeyExplicit>0 ) - desc= XkbWriteExplicit(xkb,rep,desc,client); - if ( rep->totalModMapKeys>0 ) - desc= XkbWriteModifierMap(xkb,rep,desc,client); - if ( rep->totalVModMapKeys>0 ) - desc= XkbWriteVirtualModMap(xkb,rep,desc,client); - if ((desc-start)!=(len)) { - ErrorF("[xkb] BOGUS LENGTH in write keyboard desc, expected %d, got %ld\n", - 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); - } - WriteToClient(client, (i=SIZEOF(xkbGetMapReply)), (char *)rep); - WriteToClient(client, len, start); - free((char *)start); - return Success; -} - -int -ProcXkbGetMap(ClientPtr client) -{ - DeviceIntPtr dev; - xkbGetMapReply rep; - XkbDescRec *xkb; - int n,status; - - REQUEST(xkbGetMapReq); - REQUEST_SIZE_MATCH(xkbGetMapReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); - CHK_MASK_OVERLAP(0x01,stuff->full,stuff->partial); - CHK_MASK_LEGAL(0x02,stuff->full,XkbAllMapComponentsMask); - CHK_MASK_LEGAL(0x03,stuff->partial,XkbAllMapComponentsMask); - - xkb= dev->key->xkbInfo->desc; - memset(&rep, 0, sizeof(xkbGetMapReply)); - rep.type= X_Reply; - rep.sequenceNumber= client->sequence; - rep.length = (SIZEOF(xkbGetMapReply)-SIZEOF(xGenericReply))>>2; - rep.deviceID = dev->id; - rep.present = stuff->partial|stuff->full; - rep.minKeyCode = xkb->min_key_code; - rep.maxKeyCode = xkb->max_key_code; - if ( stuff->full&XkbKeyTypesMask ) { - rep.firstType = 0; - rep.nTypes = xkb->map->num_types; - } - else if (stuff->partial&XkbKeyTypesMask) { - if (((unsigned)stuff->firstType+stuff->nTypes)>xkb->map->num_types) { - client->errorValue = _XkbErrCode4(0x04,xkb->map->num_types, - stuff->firstType,stuff->nTypes); - return BadValue; - } - rep.firstType = stuff->firstType; - rep.nTypes = stuff->nTypes; - } - else rep.nTypes = 0; - rep.totalTypes = xkb->map->num_types; - - n= XkbNumKeys(xkb); - if ( stuff->full&XkbKeySymsMask ) { - rep.firstKeySym = xkb->min_key_code; - rep.nKeySyms = n; - } - else if (stuff->partial&XkbKeySymsMask) { - CHK_KEY_RANGE(0x05,stuff->firstKeySym,stuff->nKeySyms,xkb); - rep.firstKeySym = stuff->firstKeySym; - rep.nKeySyms = stuff->nKeySyms; - } - else rep.nKeySyms = 0; - rep.totalSyms= 0; - - if ( stuff->full&XkbKeyActionsMask ) { - rep.firstKeyAct= xkb->min_key_code; - rep.nKeyActs= n; - } - else if (stuff->partial&XkbKeyActionsMask) { - CHK_KEY_RANGE(0x07,stuff->firstKeyAct,stuff->nKeyActs,xkb); - rep.firstKeyAct= stuff->firstKeyAct; - rep.nKeyActs= stuff->nKeyActs; - } - else rep.nKeyActs= 0; - rep.totalActs= 0; - - if ( stuff->full&XkbKeyBehaviorsMask ) { - rep.firstKeyBehavior = xkb->min_key_code; - rep.nKeyBehaviors = n; - } - else if (stuff->partial&XkbKeyBehaviorsMask) { - CHK_KEY_RANGE(0x09,stuff->firstKeyBehavior,stuff->nKeyBehaviors,xkb); - rep.firstKeyBehavior= stuff->firstKeyBehavior; - rep.nKeyBehaviors= stuff->nKeyBehaviors; - } - else rep.nKeyBehaviors = 0; - rep.totalKeyBehaviors= 0; - - if (stuff->full&XkbVirtualModsMask) - rep.virtualMods= ~0; - else if (stuff->partial&XkbVirtualModsMask) - rep.virtualMods= stuff->virtualMods; - - if (stuff->full&XkbExplicitComponentsMask) { - rep.firstKeyExplicit= xkb->min_key_code; - rep.nKeyExplicit= n; - } - else if (stuff->partial&XkbExplicitComponentsMask) { - CHK_KEY_RANGE(0x0B,stuff->firstKeyExplicit,stuff->nKeyExplicit,xkb); - rep.firstKeyExplicit= stuff->firstKeyExplicit; - rep.nKeyExplicit= stuff->nKeyExplicit; - } - else rep.nKeyExplicit = 0; - rep.totalKeyExplicit= 0; - - if (stuff->full&XkbModifierMapMask) { - rep.firstModMapKey= xkb->min_key_code; - rep.nModMapKeys= n; - } - else if (stuff->partial&XkbModifierMapMask) { - CHK_KEY_RANGE(0x0D,stuff->firstModMapKey,stuff->nModMapKeys,xkb); - rep.firstModMapKey= stuff->firstModMapKey; - rep.nModMapKeys= stuff->nModMapKeys; - } - else rep.nModMapKeys = 0; - rep.totalModMapKeys= 0; - - if (stuff->full&XkbVirtualModMapMask) { - rep.firstVModMapKey= xkb->min_key_code; - rep.nVModMapKeys= n; - } - else if (stuff->partial&XkbVirtualModMapMask) { - CHK_KEY_RANGE(0x0F,stuff->firstVModMapKey,stuff->nVModMapKeys,xkb); - rep.firstVModMapKey= stuff->firstVModMapKey; - rep.nVModMapKeys= stuff->nVModMapKeys; - } - else rep.nVModMapKeys = 0; - rep.totalVModMapKeys= 0; - - if ((status=XkbComputeGetMapReplySize(xkb,&rep))!=Success) - return status; - return XkbSendMap(client,xkb,&rep); -} - -/***====================================================================***/ - -static int -CheckKeyTypes( ClientPtr client, - XkbDescPtr xkb, - xkbSetMapReq * req, - xkbKeyTypeWireDesc **wireRtrn, - int * nMapsRtrn, - CARD8 * mapWidthRtrn) -{ -unsigned nMaps; -register unsigned i,n; -register CARD8 * map; -register xkbKeyTypeWireDesc *wire = *wireRtrn; - - if (req->firstType>((unsigned)xkb->map->num_types)) { - *nMapsRtrn = _XkbErrCode3(0x01,req->firstType,xkb->map->num_types); - return 0; - } - if (req->flags&XkbSetMapResizeTypes) { - nMaps = req->firstType+req->nTypes; - if (nMapsfirstType,req->nTypes,4); - return 0; - } - } - else if (req->present&XkbKeyTypesMask) { - nMaps = xkb->map->num_types; - if ((req->firstType+req->nTypes)>nMaps) { - *nMapsRtrn = req->firstType+req->nTypes; - return 0; - } - } - else { - *nMapsRtrn = xkb->map->num_types; - for (i=0;imap->num_types;i++) { - mapWidthRtrn[i] = xkb->map->types[i].num_levels; - } - return 1; - } - - for (i=0;ifirstType;i++) { - mapWidthRtrn[i] = xkb->map->types[i].num_levels; - } - for (i=0;inTypes;i++) { - unsigned width; - if (client->swapped) { - register int s; - swaps(&wire->virtualMods,s); - } - n= i+req->firstType; - width= wire->numLevels; - if (width<1) { - *nMapsRtrn= _XkbErrCode3(0x04,n,width); - return 0; - } - else if ((n==XkbOneLevelIndex)&&(width!=1)) { /* must be width 1 */ - *nMapsRtrn= _XkbErrCode3(0x05,n,width); - return 0; - } - else if ((width!=2)&& - ((n==XkbTwoLevelIndex)||(n==XkbKeypadIndex)|| - (n==XkbAlphabeticIndex))) { - /* TWO_LEVEL, ALPHABETIC and KEYPAD must be width 2 */ - *nMapsRtrn= _XkbErrCode3(0x05,n,width); - return 0; - } - if (wire->nMapEntries>0) { - xkbKTSetMapEntryWireDesc * mapWire; - xkbModsWireDesc * preWire; - mapWire= (xkbKTSetMapEntryWireDesc *)&wire[1]; - preWire= (xkbModsWireDesc *)&mapWire[wire->nMapEntries]; - for (n=0;nnMapEntries;n++) { - if (client->swapped) { - register int s; - swaps(&mapWire[n].virtualMods,s); - } - if (mapWire[n].realMods&(~wire->realMods)) { - *nMapsRtrn= _XkbErrCode4(0x06,n,mapWire[n].realMods, - wire->realMods); - return 0; - } - if (mapWire[n].virtualMods&(~wire->virtualMods)) { - *nMapsRtrn= _XkbErrCode3(0x07,n,mapWire[n].virtualMods); - return 0; - } - if (mapWire[n].level>=wire->numLevels) { - *nMapsRtrn= _XkbErrCode4(0x08,n,wire->numLevels, - mapWire[n].level); - return 0; - } - if (wire->preserve) { - if (client->swapped) { - register int s; - swaps(&preWire[n].virtualMods,s); - } - if (preWire[n].realMods&(~mapWire[n].realMods)) { - *nMapsRtrn= _XkbErrCode4(0x09,n,preWire[n].realMods, - mapWire[n].realMods); - return 0; - } - if (preWire[n].virtualMods&(~mapWire[n].virtualMods)) { - *nMapsRtrn=_XkbErrCode3(0x0a,n,preWire[n].virtualMods); - return 0; - } - } - } - if (wire->preserve) - map= (CARD8 *)&preWire[wire->nMapEntries]; - else map= (CARD8 *)&mapWire[wire->nMapEntries]; - } - else map= (CARD8 *)&wire[1]; - mapWidthRtrn[i+req->firstType] = wire->numLevels; - wire= (xkbKeyTypeWireDesc *)map; - } - for (i=req->firstType+req->nTypes;imap->types[i].num_levels; - } - *nMapsRtrn = nMaps; - *wireRtrn = wire; - return 1; -} - -static int -CheckKeySyms( ClientPtr client, - XkbDescPtr xkb, - xkbSetMapReq * req, - int nTypes, - CARD8 * mapWidths, - CARD16 * symsPerKey, - xkbSymMapWireDesc ** wireRtrn, - int * errorRtrn) -{ -register unsigned i; -XkbSymMapPtr map; -xkbSymMapWireDesc* wire = *wireRtrn; - - if (!(XkbKeySymsMask&req->present)) - return 1; - CHK_REQ_KEY_RANGE2(0x11,req->firstKeySym,req->nKeySyms,req,(*errorRtrn),0); - for (i=0;inKeySyms;i++) { - KeySym *pSyms; - register unsigned nG; - if (client->swapped) { - swaps(&wire->nSyms,nG); - } - nG = XkbNumGroups(wire->groupInfo); - if (nG>XkbNumKbdGroups) { - *errorRtrn = _XkbErrCode3(0x14,i+req->firstKeySym,nG); - return 0; - } - if (nG>0) { - register int g,w; - for (g=w=0;gktIndex[g]>=(unsigned)nTypes) { - *errorRtrn= _XkbErrCode4(0x15,i+req->firstKeySym,g, - wire->ktIndex[g]); - return 0; - } - if (mapWidths[wire->ktIndex[g]]>w) - w= mapWidths[wire->ktIndex[g]]; - } - if (wire->width!=w) { - *errorRtrn= _XkbErrCode3(0x16,i+req->firstKeySym,wire->width); - return 0; - } - w*= nG; - symsPerKey[i+req->firstKeySym] = w; - if (w!=wire->nSyms) { - *errorRtrn=_XkbErrCode4(0x16,i+req->firstKeySym,wire->nSyms,w); - return 0; - } - } - else if (wire->nSyms!=0) { - *errorRtrn = _XkbErrCode3(0x17,i+req->firstKeySym,wire->nSyms); - return 0; - } - pSyms = (KeySym *)&wire[1]; - wire = (xkbSymMapWireDesc *)&pSyms[wire->nSyms]; - } - - map = &xkb->map->key_sym_map[i]; - for (;i<=(unsigned)xkb->max_key_code;i++,map++) { - register int g,nG,w; - nG= XkbKeyNumGroups(xkb,i); - for (w=g=0;gkt_index[g]>=(unsigned)nTypes) { - *errorRtrn = _XkbErrCode4(0x18,i,g,map->kt_index[g]); - return 0; - } - if (mapWidths[map->kt_index[g]]>w) - w= mapWidths[map->kt_index[g]]; - } - symsPerKey[i] = w*nG; - } - *wireRtrn = wire; - return 1; -} - -static int -CheckKeyActions( XkbDescPtr xkb, - xkbSetMapReq * req, - int nTypes, - CARD8 * mapWidths, - CARD16 * symsPerKey, - CARD8 ** wireRtrn, - int * nActsRtrn) -{ -int nActs; -CARD8 * wire = *wireRtrn; -register unsigned i; - - if (!(XkbKeyActionsMask&req->present)) - return 1; - CHK_REQ_KEY_RANGE2(0x21,req->firstKeyAct,req->nKeyActs,req,(*nActsRtrn),0); - for (nActs=i=0;inKeyActs;i++) { - if (wire[0]!=0) { - if (wire[0]==symsPerKey[i+req->firstKeyAct]) - nActs+= wire[0]; - else { - *nActsRtrn= _XkbErrCode3(0x23,i+req->firstKeyAct,wire[0]); - return 0; - } - } - wire++; - } - if (req->nKeyActs%4) - wire+= 4-(req->nKeyActs%4); - *wireRtrn = (CARD8 *)(((XkbAnyAction *)wire)+nActs); - *nActsRtrn = nActs; - return 1; -} - -static int -CheckKeyBehaviors( XkbDescPtr xkb, - xkbSetMapReq * req, - xkbBehaviorWireDesc ** wireRtrn, - int * errorRtrn) -{ -register xkbBehaviorWireDesc * wire = *wireRtrn; -register XkbServerMapPtr server = xkb->server; -register unsigned i; -unsigned first,last; - - if (((req->present&XkbKeyBehaviorsMask)==0)||(req->nKeyBehaviors<1)) { - req->present&= ~XkbKeyBehaviorsMask; - req->nKeyBehaviors= 0; - return 1; - } - first= req->firstKeyBehavior; - last= req->firstKeyBehavior+req->nKeyBehaviors-1; - if (firstminKeyCode) { - *errorRtrn = _XkbErrCode3(0x31,first,req->minKeyCode); - return 0; - } - if (last>req->maxKeyCode) { - *errorRtrn = _XkbErrCode3(0x32,last,req->maxKeyCode); - return 0; - } - - for (i=0;itotalKeyBehaviors;i++,wire++) { - if ((wire->keykey>last)) { - *errorRtrn = _XkbErrCode4(0x33,first,last,wire->key); - return 0; - } - if ((wire->type&XkbKB_Permanent)&& - ((server->behaviors[wire->key].type!=wire->type)|| - (server->behaviors[wire->key].data!=wire->data))) { - *errorRtrn = _XkbErrCode3(0x33,wire->key,wire->type); - return 0; - } - if ((wire->type==XkbKB_RadioGroup)&& - ((wire->data&(~XkbKB_RGAllowNone))>XkbMaxRadioGroups)) { - *errorRtrn= _XkbErrCode4(0x34,wire->key,wire->data, - XkbMaxRadioGroups); - return 0; - } - if ((wire->type==XkbKB_Overlay1)||(wire->type==XkbKB_Overlay2)) { - CHK_KEY_RANGE2(0x35,wire->key,1,xkb,*errorRtrn,0); - } - } - *wireRtrn = wire; - return 1; -} - -static int -CheckVirtualMods( XkbDescRec * xkb, - xkbSetMapReq * req, - CARD8 ** wireRtrn, - int * errorRtrn) -{ -register CARD8 *wire = *wireRtrn; -register unsigned i,nMods,bit; - - if (((req->present&XkbVirtualModsMask)==0)||(req->virtualMods==0)) - return 1; - for (i=nMods=0,bit=1;ivirtualMods&bit) - nMods++; - } - *wireRtrn= (wire+XkbPaddedSize(nMods)); - return 1; -} - -static int -CheckKeyExplicit( XkbDescPtr xkb, - xkbSetMapReq * req, - CARD8 ** wireRtrn, - int * errorRtrn) -{ -register CARD8 * wire = *wireRtrn; -CARD8 * start; -register unsigned i; -int first,last; - - if (((req->present&XkbExplicitComponentsMask)==0)||(req->nKeyExplicit<1)) { - req->present&= ~XkbExplicitComponentsMask; - req->nKeyExplicit= 0; - return 1; - } - first= req->firstKeyExplicit; - last= first+req->nKeyExplicit-1; - if (firstminKeyCode) { - *errorRtrn = _XkbErrCode3(0x51,first,req->minKeyCode); - return 0; - } - if (last>req->maxKeyCode) { - *errorRtrn = _XkbErrCode3(0x52,last,req->maxKeyCode); - return 0; - } - start= wire; - for (i=0;itotalKeyExplicit;i++,wire+=2) { - if ((wire[0]last)) { - *errorRtrn = _XkbErrCode4(0x53,first,last,wire[0]); - return 0; - } - if (wire[1]&(~XkbAllExplicitMask)) { - *errorRtrn= _XkbErrCode3(0x52,~XkbAllExplicitMask,wire[1]); - return 0; - } - } - wire+= XkbPaddedSize(wire-start)-(wire-start); - *wireRtrn= wire; - return 1; -} - -static int -CheckModifierMap(XkbDescPtr xkb,xkbSetMapReq *req,CARD8 **wireRtrn,int *errRtrn) -{ -register CARD8 * wire = *wireRtrn; -CARD8 * start; -register unsigned i; -int first,last; - - if (((req->present&XkbModifierMapMask)==0)||(req->nModMapKeys<1)) { - req->present&= ~XkbModifierMapMask; - req->nModMapKeys= 0; - return 1; - } - first= req->firstModMapKey; - last= first+req->nModMapKeys-1; - if (firstminKeyCode) { - *errRtrn = _XkbErrCode3(0x61,first,req->minKeyCode); - return 0; - } - if (last>req->maxKeyCode) { - *errRtrn = _XkbErrCode3(0x62,last,req->maxKeyCode); - return 0; - } - start= wire; - for (i=0;itotalModMapKeys;i++,wire+=2) { - if ((wire[0]last)) { - *errRtrn = _XkbErrCode4(0x63,first,last,wire[0]); - return 0; - } - } - wire+= XkbPaddedSize(wire-start)-(wire-start); - *wireRtrn= wire; - return 1; -} - -static int -CheckVirtualModMap( XkbDescPtr xkb, - xkbSetMapReq *req, - xkbVModMapWireDesc **wireRtrn, - int *errRtrn) -{ -register xkbVModMapWireDesc * wire = *wireRtrn; -register unsigned i; -int first,last; - - if (((req->present&XkbVirtualModMapMask)==0)||(req->nVModMapKeys<1)) { - req->present&= ~XkbVirtualModMapMask; - req->nVModMapKeys= 0; - return 1; - } - first= req->firstVModMapKey; - last= first+req->nVModMapKeys-1; - if (firstminKeyCode) { - *errRtrn = _XkbErrCode3(0x71,first,req->minKeyCode); - return 0; - } - if (last>req->maxKeyCode) { - *errRtrn = _XkbErrCode3(0x72,last,req->maxKeyCode); - return 0; - } - for (i=0;itotalVModMapKeys;i++,wire++) { - if ((wire->keykey>last)) { - *errRtrn = _XkbErrCode4(0x73,first,last,wire->key); - return 0; - } - } - *wireRtrn= wire; - return 1; -} - -static char * -SetKeyTypes( XkbDescPtr xkb, - xkbSetMapReq * req, - xkbKeyTypeWireDesc * wire, - XkbChangesPtr changes) -{ -register unsigned i; -unsigned first,last; -CARD8 *map; - - if ((unsigned)(req->firstType+req->nTypes)>xkb->map->size_types) { - i= req->firstType+req->nTypes; - if (XkbAllocClientMap(xkb,XkbKeyTypesMask,i)!=Success) { - return NULL; - } - } - if ((unsigned)(req->firstType+req->nTypes)>xkb->map->num_types) - xkb->map->num_types= req->firstType+req->nTypes; - - for (i=0;inTypes;i++) { - XkbKeyTypePtr pOld; - register unsigned n; - - if (XkbResizeKeyType(xkb,i+req->firstType,wire->nMapEntries, - wire->preserve,wire->numLevels)!=Success) { - return NULL; - } - pOld = &xkb->map->types[i+req->firstType]; - map = (CARD8 *)&wire[1]; - - pOld->mods.real_mods = wire->realMods; - pOld->mods.vmods= wire->virtualMods; - pOld->num_levels = wire->numLevels; - pOld->map_count= wire->nMapEntries; - - pOld->mods.mask= pOld->mods.real_mods| - XkbMaskForVMask(xkb,pOld->mods.vmods); - - if (wire->nMapEntries) { - xkbKTSetMapEntryWireDesc *mapWire; - xkbModsWireDesc *preWire; - unsigned tmp; - mapWire= (xkbKTSetMapEntryWireDesc *)map; - preWire= (xkbModsWireDesc *)&mapWire[wire->nMapEntries]; - for (n=0;nnMapEntries;n++) { - pOld->map[n].active= 1; - pOld->map[n].mods.mask= mapWire[n].realMods; - pOld->map[n].mods.real_mods= mapWire[n].realMods; - pOld->map[n].mods.vmods= mapWire[n].virtualMods; - pOld->map[n].level= mapWire[n].level; - if (mapWire[n].virtualMods!=0) { - tmp= XkbMaskForVMask(xkb,mapWire[n].virtualMods); - pOld->map[n].active= (tmp!=0); - pOld->map[n].mods.mask|= tmp; - } - if (wire->preserve) { - pOld->preserve[n].real_mods= preWire[n].realMods; - pOld->preserve[n].vmods= preWire[n].virtualMods; - tmp= XkbMaskForVMask(xkb,preWire[n].virtualMods); - pOld->preserve[n].mask= preWire[n].realMods|tmp; - } - } - if (wire->preserve) - map= (CARD8 *)&preWire[wire->nMapEntries]; - else map= (CARD8 *)&mapWire[wire->nMapEntries]; - } - else map= (CARD8 *)&wire[1]; - wire = (xkbKeyTypeWireDesc *)map; - } - first= req->firstType; - last= first+req->nTypes-1; /* last changed type */ - if (changes->map.changed&XkbKeyTypesMask) { - int oldLast; - oldLast= changes->map.first_type+changes->map.num_types-1; - if (changes->map.first_typemap.first_type; - if (oldLast>last) - last= oldLast; - } - changes->map.changed|= XkbKeyTypesMask; - changes->map.first_type = first; - changes->map.num_types = (last-first)+1; - return (char *)wire; -} - -static char * -SetKeySyms( ClientPtr client, - XkbDescPtr xkb, - xkbSetMapReq * req, - xkbSymMapWireDesc * wire, - XkbChangesPtr changes, - DeviceIntPtr dev) -{ -register unsigned i,s; -XkbSymMapPtr oldMap; -KeySym * newSyms; -KeySym * pSyms; -unsigned first,last; - - oldMap = &xkb->map->key_sym_map[req->firstKeySym]; - for (i=0;inKeySyms;i++,oldMap++) { - pSyms = (KeySym *)&wire[1]; - if (wire->nSyms>0) { - newSyms = XkbResizeKeySyms(xkb,i+req->firstKeySym,wire->nSyms); - for (s=0;snSyms;s++) { - newSyms[s]= pSyms[s]; - } - if (client->swapped) { - int n; - for (s=0;snSyms;s++) { - swapl(&newSyms[s],n); - } - } - } - oldMap->kt_index[0] = wire->ktIndex[0]; - oldMap->kt_index[1] = wire->ktIndex[1]; - oldMap->kt_index[2] = wire->ktIndex[2]; - oldMap->kt_index[3] = wire->ktIndex[3]; - oldMap->group_info = wire->groupInfo; - oldMap->width = wire->width; - wire= (xkbSymMapWireDesc *)&pSyms[wire->nSyms]; - } - first= req->firstKeySym; - last= first+req->nKeySyms-1; - if (changes->map.changed&XkbKeySymsMask) { - int oldLast= (changes->map.first_key_sym+changes->map.num_key_syms-1); - if (changes->map.first_key_symmap.first_key_sym; - if (oldLast>last) - last= oldLast; - } - changes->map.changed|= XkbKeySymsMask; - changes->map.first_key_sym = first; - changes->map.num_key_syms = (last-first+1); - - s= 0; - for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) { - if (XkbKeyNumGroups(xkb,i)>s) - s= XkbKeyNumGroups(xkb,i); - } - if (s!=xkb->ctrls->num_groups) { - xkbControlsNotify cn; - XkbControlsRec old; - cn.keycode= 0; - cn.eventType= 0; - cn.requestMajor= XkbReqCode; - cn.requestMinor= X_kbSetMap; - old= *xkb->ctrls; - xkb->ctrls->num_groups= s; - if (XkbComputeControlsNotify(dev,&old,xkb->ctrls,&cn,FALSE)) - XkbSendControlsNotify(dev,&cn); - } - return (char *)wire; -} - -static char * -SetKeyActions( XkbDescPtr xkb, - xkbSetMapReq * req, - CARD8 * wire, - XkbChangesPtr changes) -{ -register unsigned i,first,last; -CARD8 * nActs = wire; -XkbAction * newActs; - - wire+= XkbPaddedSize(req->nKeyActs); - for (i=0;inKeyActs;i++) { - if (nActs[i]==0) - xkb->server->key_acts[i+req->firstKeyAct]= 0; - else { - newActs= XkbResizeKeyActions(xkb,i+req->firstKeyAct,nActs[i]); - memcpy((char *)newActs,(char *)wire, - nActs[i]*SIZEOF(xkbActionWireDesc)); - wire+= nActs[i]*SIZEOF(xkbActionWireDesc); - } - } - first= req->firstKeyAct; - last= (first+req->nKeyActs-1); - if (changes->map.changed&XkbKeyActionsMask) { - int oldLast; - oldLast= changes->map.first_key_act+changes->map.num_key_acts-1; - if (changes->map.first_key_actmap.first_key_act; - if (oldLast>last) - last= oldLast; - } - changes->map.changed|= XkbKeyActionsMask; - changes->map.first_key_act= first; - changes->map.num_key_acts= (last-first+1); - return (char *)wire; -} - -static char * -SetKeyBehaviors( XkbSrvInfoPtr xkbi, - xkbSetMapReq *req, - xkbBehaviorWireDesc *wire, - XkbChangesPtr changes) -{ -register unsigned i; -int maxRG = -1; -XkbDescPtr xkb = xkbi->desc; -XkbServerMapPtr server = xkb->server; -unsigned first,last; - - first= req->firstKeyBehavior; - last= req->firstKeyBehavior+req->nKeyBehaviors-1; - memset(&server->behaviors[first], 0, req->nKeyBehaviors*sizeof(XkbBehavior)); - for (i=0;itotalKeyBehaviors;i++) { - if ((server->behaviors[wire->key].type&XkbKB_Permanent)==0) { - server->behaviors[wire->key].type= wire->type; - server->behaviors[wire->key].data= wire->data; - if ((wire->type==XkbKB_RadioGroup)&&(((int)wire->data)>maxRG)) - maxRG= wire->data + 1; - } - wire++; - } - - if (maxRG>(int)xkbi->nRadioGroups) { - int sz = maxRG*sizeof(XkbRadioGroupRec); - if (xkbi->radioGroups) - xkbi->radioGroups= realloc(xkbi->radioGroups,sz); - else xkbi->radioGroups= calloc(1, sz); - if (xkbi->radioGroups) { - if (xkbi->nRadioGroups) - memset(&xkbi->radioGroups[xkbi->nRadioGroups], 0, - (maxRG-xkbi->nRadioGroups)*sizeof(XkbRadioGroupRec)); - xkbi->nRadioGroups= maxRG; - } - else xkbi->nRadioGroups= 0; - /* should compute members here */ - } - if (changes->map.changed&XkbKeyBehaviorsMask) { - unsigned oldLast; - oldLast= changes->map.first_key_behavior+ - changes->map.num_key_behaviors-1; - if (changes->map.first_key_behaviorfirstKeyBehavior) - first= changes->map.first_key_behavior; - if (oldLast>last) - last= oldLast; - } - changes->map.changed|= XkbKeyBehaviorsMask; - changes->map.first_key_behavior = first; - changes->map.num_key_behaviors = (last-first+1); - return (char *)wire; -} - -static char * -SetVirtualMods(XkbSrvInfoPtr xkbi,xkbSetMapReq *req,CARD8 *wire, - XkbChangesPtr changes) -{ -register int i,bit,nMods; -XkbServerMapPtr srv = xkbi->desc->server; - - if (((req->present&XkbVirtualModsMask)==0)||(req->virtualMods==0)) - return (char *)wire; - for (i=nMods=0,bit=1;ivirtualMods&bit) { - if (srv->vmods[i]!=wire[nMods]) { - changes->map.changed|= XkbVirtualModsMask; - changes->map.vmods|= bit; - srv->vmods[i]= wire[nMods]; - } - nMods++; - } - } - return (char *)(wire+XkbPaddedSize(nMods)); -} - -static char * -SetKeyExplicit(XkbSrvInfoPtr xkbi,xkbSetMapReq *req,CARD8 *wire, - XkbChangesPtr changes) -{ -register unsigned i,first,last; -XkbServerMapPtr xkb = xkbi->desc->server; -CARD8 * start; - - start= wire; - first= req->firstKeyExplicit; - last= req->firstKeyExplicit+req->nKeyExplicit-1; - memset(&xkb->explicit[first], 0, req->nKeyExplicit); - for (i=0;itotalKeyExplicit;i++,wire+= 2) { - xkb->explicit[wire[0]]= wire[1]; - } - if (first>0) { - if (changes->map.changed&XkbExplicitComponentsMask) { - int oldLast; - oldLast= changes->map.first_key_explicit+ - changes->map.num_key_explicit-1; - if (changes->map.first_key_explicitmap.first_key_explicit; - if (oldLast>last) - last= oldLast; - } - changes->map.first_key_explicit= first; - changes->map.num_key_explicit= (last-first)+1; - } - wire+= XkbPaddedSize(wire-start)-(wire-start); - return (char *)wire; -} - -static char * -SetModifierMap( XkbSrvInfoPtr xkbi, - xkbSetMapReq * req, - CARD8 * wire, - XkbChangesPtr changes) -{ -register unsigned i,first,last; -XkbClientMapPtr xkb = xkbi->desc->map; -CARD8 * start; - - start= wire; - first= req->firstModMapKey; - last= req->firstModMapKey+req->nModMapKeys-1; - memset(&xkb->modmap[first], 0, req->nModMapKeys); - for (i=0;itotalModMapKeys;i++,wire+= 2) { - xkb->modmap[wire[0]]= wire[1]; - } - if (first>0) { - if (changes->map.changed&XkbModifierMapMask) { - int oldLast; - oldLast= changes->map.first_modmap_key+ - changes->map.num_modmap_keys-1; - if (changes->map.first_modmap_keymap.first_modmap_key; - if (oldLast>last) - last= oldLast; - } - changes->map.first_modmap_key= first; - changes->map.num_modmap_keys= (last-first)+1; - } - wire+= XkbPaddedSize(wire-start)-(wire-start); - return (char *)wire; -} - -static char * -SetVirtualModMap( XkbSrvInfoPtr xkbi, - xkbSetMapReq * req, - xkbVModMapWireDesc * wire, - XkbChangesPtr changes) -{ -register unsigned i,first,last; -XkbServerMapPtr srv = xkbi->desc->server; - - first= req->firstVModMapKey; - last= req->firstVModMapKey+req->nVModMapKeys-1; - memset(&srv->vmodmap[first], 0, req->nVModMapKeys*sizeof(unsigned short)); - for (i=0;itotalVModMapKeys;i++,wire++) { - srv->vmodmap[wire->key]= wire->vmods; - } - if (first>0) { - if (changes->map.changed&XkbVirtualModMapMask) { - int oldLast; - oldLast= changes->map.first_vmodmap_key+ - changes->map.num_vmodmap_keys-1; - if (changes->map.first_vmodmap_keymap.first_vmodmap_key; - if (oldLast>last) - last= oldLast; - } - changes->map.first_vmodmap_key= first; - changes->map.num_vmodmap_keys= (last-first)+1; - } - return (char *)wire; -} - -/** - * Check if the given request can be applied to the given device but don't - * actually do anything.. - */ -static int -_XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq *req, char* values) -{ - XkbSrvInfoPtr xkbi; - XkbDescPtr xkb; - int error; - int nTypes = 0, nActions; - CARD8 mapWidths[XkbMaxLegalKeyCode + 1] = {0}; - CARD16 symsPerKey[XkbMaxLegalKeyCode + 1] = {0}; - XkbSymMapPtr map; - int i; - - xkbi= dev->key->xkbInfo; - xkb = xkbi->desc; - - if ((xkb->min_key_code != req->minKeyCode)|| - (xkb->max_key_code != req->maxKeyCode)) { - if (client->vMajor!=1) { /* pre 1.0 versions of Xlib have a bug */ - req->minKeyCode= xkb->min_key_code; - req->maxKeyCode= xkb->max_key_code; - } - else { - if (!XkbIsLegalKeycode(req->minKeyCode)) { - client->errorValue = _XkbErrCode3(2, req->minKeyCode, req->maxKeyCode); - return BadValue; - } - if (req->minKeyCode > req->maxKeyCode) { - client->errorValue = _XkbErrCode3(3, req->minKeyCode, req->maxKeyCode); - return BadMatch; - } - } - } - - if ((req->present & XkbKeyTypesMask) && - (!CheckKeyTypes(client,xkb,req,(xkbKeyTypeWireDesc **)&values, - &nTypes,mapWidths))) { - client->errorValue = nTypes; - return BadValue; - } - - /* symsPerKey/mapWidths must be filled regardless of client-side flags */ - map = &xkb->map->key_sym_map[xkb->min_key_code]; - for (i=xkb->min_key_code;imax_key_code;i++,map++) { - register int g,ng,w; - ng= XkbNumGroups(map->group_info); - for (w=g=0;gkt_index[g]>=(unsigned)nTypes) { - client->errorValue = _XkbErrCode4(0x13,i,g,map->kt_index[g]); - return 0; - } - if (mapWidths[map->kt_index[g]]>w) - w= mapWidths[map->kt_index[g]]; - } - symsPerKey[i] = w*ng; - } - - if ((req->present & XkbKeySymsMask) && - (!CheckKeySyms(client,xkb,req,nTypes,mapWidths,symsPerKey, - (xkbSymMapWireDesc **)&values,&error))) { - client->errorValue = error; - return BadValue; - } - - if ((req->present & XkbKeyActionsMask) && - (!CheckKeyActions(xkb,req,nTypes,mapWidths,symsPerKey, - (CARD8 **)&values,&nActions))) { - client->errorValue = nActions; - return BadValue; - } - - if ((req->present & XkbKeyBehaviorsMask) && - (!CheckKeyBehaviors(xkb,req,(xkbBehaviorWireDesc**)&values,&error))) { - client->errorValue = error; - return BadValue; - } - - if ((req->present & XkbVirtualModsMask) && - (!CheckVirtualMods(xkb,req,(CARD8 **)&values,&error))) { - client->errorValue= error; - return BadValue; - } - if ((req->present&XkbExplicitComponentsMask) && - (!CheckKeyExplicit(xkb,req,(CARD8 **)&values,&error))) { - client->errorValue= error; - return BadValue; - } - if ((req->present&XkbModifierMapMask) && - (!CheckModifierMap(xkb,req,(CARD8 **)&values,&error))) { - client->errorValue= error; - return BadValue; - } - if ((req->present&XkbVirtualModMapMask) && - (!CheckVirtualModMap(xkb,req,(xkbVModMapWireDesc **)&values,&error))) { - client->errorValue= error; - return BadValue; - } - - if (((values-((char *)req))/4)!= req->length) { - ErrorF("[xkb] Internal error! Bad length in XkbSetMap (after check)\n"); - client->errorValue = values-((char *)&req[1]); - return BadLength; - } - - return Success; -} - -/** - * Apply the given request on the given device. - */ -static int -_XkbSetMap(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq *req, char *values) -{ - XkbEventCauseRec cause; - XkbChangesRec change; - Bool sentNKN; - XkbSrvInfoPtr xkbi; - XkbDescPtr xkb; - - xkbi= dev->key->xkbInfo; - xkb = xkbi->desc; - - XkbSetCauseXkbReq(&cause,X_kbSetMap,client); - memset(&change, 0, sizeof(change)); - sentNKN = FALSE; - if ((xkb->min_key_code!=req->minKeyCode)|| - (xkb->max_key_code!=req->maxKeyCode)) { - Status status; - xkbNewKeyboardNotify nkn; - nkn.deviceID = nkn.oldDeviceID = dev->id; - nkn.oldMinKeyCode = xkb->min_key_code; - nkn.oldMaxKeyCode = xkb->max_key_code; - status= XkbChangeKeycodeRange(xkb, req->minKeyCode, - req->maxKeyCode, &change); - if (status != Success) - return status; /* oh-oh. what about the other keyboards? */ - nkn.minKeyCode = xkb->min_key_code; - nkn.maxKeyCode = xkb->max_key_code; - nkn.requestMajor = XkbReqCode; - nkn.requestMinor = X_kbSetMap; - nkn.changed = XkbNKN_KeycodesMask; - XkbSendNewKeyboardNotify(dev,&nkn); - sentNKN = TRUE; - } - - if (req->present&XkbKeyTypesMask) { - values = SetKeyTypes(xkb,req,(xkbKeyTypeWireDesc *)values,&change); - if (!values) goto allocFailure; - } - if (req->present&XkbKeySymsMask) { - values = SetKeySyms(client,xkb,req,(xkbSymMapWireDesc *)values,&change,dev); - if (!values) goto allocFailure; - } - if (req->present&XkbKeyActionsMask) { - values = SetKeyActions(xkb,req,(CARD8 *)values,&change); - if (!values) goto allocFailure; - } - if (req->present&XkbKeyBehaviorsMask) { - values= SetKeyBehaviors(xkbi,req,(xkbBehaviorWireDesc *)values,&change); - if (!values) goto allocFailure; - } - if (req->present&XkbVirtualModsMask) - values= SetVirtualMods(xkbi,req,(CARD8 *)values,&change); - if (req->present&XkbExplicitComponentsMask) - values= SetKeyExplicit(xkbi,req,(CARD8 *)values,&change); - if (req->present&XkbModifierMapMask) - values= SetModifierMap(xkbi,req,(CARD8 *)values,&change); - if (req->present&XkbVirtualModMapMask) - values= SetVirtualModMap(xkbi,req,(xkbVModMapWireDesc *)values,&change); - if (((values-((char *)req))/4)!=req->length) { - ErrorF("[xkb] Internal error! Bad length in XkbSetMap (after set)\n"); - client->errorValue = values-((char *)&req[1]); - return BadLength; - } - if (req->flags&XkbSetMapRecomputeActions) { - KeyCode first,last,firstMM,lastMM; - if (change.map.num_key_syms>0) { - first= change.map.first_key_sym; - last= first+change.map.num_key_syms-1; - } - else first= last= 0; - if (change.map.num_modmap_keys>0) { - firstMM= change.map.first_modmap_key; - lastMM= first+change.map.num_modmap_keys-1; - } - else firstMM= lastMM= 0; - if ((last>0) && (lastMM>0)) { - if (firstMMlast) - last= lastMM; - } - else if (lastMM>0) { - first= firstMM; - last= lastMM; - } - if (last>0) { - unsigned check= 0; - XkbUpdateActions(dev,first,(last-first+1),&change,&check,&cause); - if (check) - XkbCheckSecondaryEffects(xkbi,check,&change,&cause); - } - } - if (!sentNKN) - XkbSendNotification(dev,&change,&cause); - - return Success; -allocFailure: - return BadAlloc; -} - - -int -ProcXkbSetMap(ClientPtr client) -{ - DeviceIntPtr dev; - char * tmp; - int rc; - - REQUEST(xkbSetMapReq); - REQUEST_AT_LEAST_SIZE(xkbSetMapReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); - CHK_MASK_LEGAL(0x01,stuff->present,XkbAllMapComponentsMask); - - tmp = (char *)&stuff[1]; - - /* Check if we can to the SetMap on the requested device. If this - succeeds, do the same thing for all extension devices (if needed). - If any of them fails, fail. */ - rc = _XkbSetMapChecks(client, dev, stuff, tmp); - - if (rc != Success) - return rc; - - if (stuff->deviceSpec == XkbUseCoreKbd) - { - DeviceIntPtr other; - for (other = inputInfo.devices; other; other = other->next) - { - if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) - { - rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); - if (rc == Success) - { - rc = _XkbSetMapChecks(client, other, stuff, tmp); - if (rc != Success) - return rc; - } - } - } - } - - /* We know now that we will succed with the SetMap. In theory anyway. */ - rc = _XkbSetMap(client, dev, stuff, tmp); - if (rc != Success) - return rc; - - if (stuff->deviceSpec == XkbUseCoreKbd) - { - DeviceIntPtr other; - for (other = inputInfo.devices; other; other = other->next) - { - if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) - { - rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); - if (rc == Success) - _XkbSetMap(client, other, stuff, tmp); - /* ignore rc. if the SetMap failed although the check above - reported true there isn't much we can do. we still need to - set all other devices, hoping that at least they stay in - sync. */ - } - } - } - - return Success; -} - -/***====================================================================***/ - -static Status -XkbComputeGetCompatMapReplySize( XkbCompatMapPtr compat, - xkbGetCompatMapReply * rep) -{ -unsigned size,nGroups; - - nGroups= 0; - if (rep->groups!=0) { - register int i,bit; - for (i=0,bit=1;igroups&bit) - nGroups++; - } - } - size= nGroups*SIZEOF(xkbModsWireDesc); - size+= (rep->nSI*SIZEOF(xkbSymInterpretWireDesc)); - rep->length= size/4; - return Success; -} - -static int -XkbSendCompatMap( ClientPtr client, - XkbCompatMapPtr compat, - xkbGetCompatMapReply * rep) -{ -char * data; -int size; - - size= rep->length*4; - if (size>0) { - data = malloc(size); - if (data) { - register unsigned i,bit; - xkbModsWireDesc * grp; - XkbSymInterpretPtr sym= &compat->sym_interpret[rep->firstSI]; - xkbSymInterpretWireDesc *wire = (xkbSymInterpretWireDesc *)data; - for (i=0;inSI;i++,sym++,wire++) { - wire->sym= sym->sym; - wire->mods= sym->mods; - wire->match= sym->match; - wire->virtualMod= sym->virtual_mod; - wire->flags= sym->flags; - memcpy((char*)&wire->act,(char*)&sym->act,sz_xkbActionWireDesc); - if (client->swapped) { - register int n; - swapl(&wire->sym,n); - } - } - if (rep->groups) { - grp = (xkbModsWireDesc *)wire; - for (i=0,bit=1;igroups&bit) { - grp->mask= compat->groups[i].mask; - grp->realMods= compat->groups[i].real_mods; - grp->virtualMods= compat->groups[i].vmods; - if (client->swapped) { - register int n; - swaps(&grp->virtualMods,n); - } - grp++; - } - } - wire= (xkbSymInterpretWireDesc*)grp; - } - } - else return BadAlloc; - } - 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); - } - - WriteToClient(client, SIZEOF(xkbGetCompatMapReply), (char *)rep); - if (data) { - WriteToClient(client, size, data); - free((char *)data); - } - return Success; -} - -int -ProcXkbGetCompatMap(ClientPtr client) -{ - xkbGetCompatMapReply rep; - DeviceIntPtr dev; - XkbDescPtr xkb; - XkbCompatMapPtr compat; - - REQUEST(xkbGetCompatMapReq); - REQUEST_SIZE_MATCH(xkbGetCompatMapReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); - - xkb = dev->key->xkbInfo->desc; - compat= xkb->compat; - - rep.type = X_Reply; - rep.deviceID = dev->id; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.firstSI = stuff->firstSI; - rep.nSI = stuff->nSI; - if (stuff->getAllSI) { - rep.firstSI = 0; - rep.nSI = compat->num_si; - } - else if ((((unsigned)stuff->nSI)>0)&& - ((unsigned)(stuff->firstSI+stuff->nSI-1)>=compat->num_si)) { - client->errorValue = _XkbErrCode2(0x05,compat->num_si); - return BadValue; - } - rep.nTotalSI = compat->num_si; - rep.groups= stuff->groups; - XkbComputeGetCompatMapReplySize(compat,&rep); - return XkbSendCompatMap(client,compat,&rep); -} - -/** - * Apply the given request on the given device. - * If dryRun is TRUE, then value checks are performed, but the device isn't - * modified. - */ -static int -_XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev, - xkbSetCompatMapReq *req, char* data, BOOL dryRun) -{ - XkbSrvInfoPtr xkbi; - XkbDescPtr xkb; - XkbCompatMapPtr compat; - int nGroups; - unsigned i,bit; - - xkbi = dev->key->xkbInfo; - xkb = xkbi->desc; - compat = xkb->compat; - - if ((req->nSI>0)||(req->truncateSI)) { - xkbSymInterpretWireDesc *wire; - if (req->firstSI>compat->num_si) { - client->errorValue = _XkbErrCode2(0x02,compat->num_si); - return BadValue; - } - wire= (xkbSymInterpretWireDesc *)data; - wire+= req->nSI; - data = (char *)wire; - } - - nGroups= 0; - if (req->groups!=0) { - for (i=0,bit=1;igroups&bit ) - nGroups++; - } - } - data+= nGroups*SIZEOF(xkbModsWireDesc); - if (((data-((char *)req))/4)!=req->length) { - return BadLength; - } - - /* Done all the checks we can do */ - if (dryRun) - return Success; - - data = (char *)&req[1]; - if (req->nSI>0) { - xkbSymInterpretWireDesc *wire = (xkbSymInterpretWireDesc *)data; - XkbSymInterpretPtr sym; - if ((unsigned)(req->firstSI+req->nSI)>compat->num_si) { - compat->num_si= req->firstSI+req->nSI; - compat->sym_interpret= realloc(compat->sym_interpret, - compat->num_si * sizeof(XkbSymInterpretRec)); - if (!compat->sym_interpret) { - compat->num_si= 0; - return BadAlloc; - } - } - else if (req->truncateSI) { - compat->num_si = req->firstSI+req->nSI; - } - sym = &compat->sym_interpret[req->firstSI]; - for (i=0;inSI;i++,wire++,sym++) { - if (client->swapped) { - int n; - swapl(&wire->sym,n); - } - sym->sym= wire->sym; - sym->mods= wire->mods; - sym->match= wire->match; - sym->flags= wire->flags; - sym->virtual_mod= wire->virtualMod; - memcpy((char *)&sym->act,(char *)&wire->act, - SIZEOF(xkbActionWireDesc)); - } - data = (char *)wire; - } - else if (req->truncateSI) { - compat->num_si = req->firstSI; - } - - if (req->groups!=0) { - unsigned i, bit; - xkbModsWireDesc *wire = (xkbModsWireDesc *)data; - for (i = 0, bit = 1; i < XkbNumKbdGroups; i++, bit <<= 1) { - if (req->groups & bit) { - if (client->swapped) { - int n; - swaps(&wire->virtualMods,n); - } - compat->groups[i].mask= wire->realMods; - compat->groups[i].real_mods= wire->realMods; - compat->groups[i].vmods= wire->virtualMods; - if (wire->virtualMods!=0) { - unsigned tmp; - tmp= XkbMaskForVMask(xkb,wire->virtualMods); - compat->groups[i].mask|= tmp; - } - data+= SIZEOF(xkbModsWireDesc); - wire= (xkbModsWireDesc *)data; - } - } - } - i= XkbPaddedSize((data-((char *)req))); - if ((i/4)!=req->length) { - ErrorF("[xkb] Internal length error on read in _XkbSetCompatMap\n"); - return BadLength; - } - - if (dev->xkb_interest) { - xkbCompatMapNotify ev; - ev.deviceID = dev->id; - ev.changedGroups = req->groups; - ev.firstSI = req->firstSI; - ev.nSI = req->nSI; - ev.nTotalSI = compat->num_si; - XkbSendCompatMapNotify(dev,&ev); - } - - if (req->recomputeActions) { - XkbChangesRec change; - unsigned check; - XkbEventCauseRec cause; - - XkbSetCauseXkbReq(&cause,X_kbSetCompatMap,client); - memset(&change, 0, sizeof(XkbChangesRec)); - XkbUpdateActions(dev,xkb->min_key_code,XkbNumKeys(xkb),&change,&check, - &cause); - if (check) - XkbCheckSecondaryEffects(xkbi,check,&change,&cause); - XkbSendNotification(dev,&change,&cause); - } - return Success; -} - -int -ProcXkbSetCompatMap(ClientPtr client) -{ - DeviceIntPtr dev; - char *data; - int rc; - - REQUEST(xkbSetCompatMapReq); - REQUEST_AT_LEAST_SIZE(xkbSetCompatMapReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); - - data = (char *)&stuff[1]; - - /* check first using a dry-run */ - rc = _XkbSetCompatMap(client, dev, stuff, data, TRUE); - if (rc != Success) - return rc; - if (stuff->deviceSpec == XkbUseCoreKbd) - { - DeviceIntPtr other; - for (other = inputInfo.devices; other; other = other->next) - { - if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) - { - rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); - if (rc == Success) - { - /* dry-run */ - rc = _XkbSetCompatMap(client, other, stuff, data, TRUE); - if (rc != Success) - return rc; - } - } - } - } - - /* Yay, the dry-runs succeed. Let's apply */ - rc = _XkbSetCompatMap(client, dev, stuff, data, FALSE); - if (rc != Success) - return rc; - if (stuff->deviceSpec == XkbUseCoreKbd) - { - DeviceIntPtr other; - for (other = inputInfo.devices; other; other = other->next) - { - if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) - { - rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); - if (rc == Success) - { - rc = _XkbSetCompatMap(client, other, stuff, data, FALSE); - if (rc != Success) - return rc; - } - } - } - } - - return Success; -} - -/***====================================================================***/ - -int -ProcXkbGetIndicatorState(ClientPtr client) -{ - xkbGetIndicatorStateReply rep; - XkbSrvLedInfoPtr sli; - DeviceIntPtr dev; - register int i; - - REQUEST(xkbGetIndicatorStateReq); - REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixReadAccess); - - sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId, - XkbXI_IndicatorStateMask); - if (!sli) - return BadAlloc; - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.deviceID = dev->id; - rep.state = sli->effectiveState; - - if (client->swapped) { - swaps(&rep.sequenceNumber,i); - swapl(&rep.state,i); - } - WriteToClient(client, SIZEOF(xkbGetIndicatorStateReply), (char *)&rep); - return Success; -} - -/***====================================================================***/ - -static Status -XkbComputeGetIndicatorMapReplySize( - XkbIndicatorPtr indicators, - xkbGetIndicatorMapReply *rep) -{ -register int i,bit; -int nIndicators; - - rep->realIndicators = indicators->phys_indicators; - for (i=nIndicators=0,bit=1;iwhich&bit) - nIndicators++; - } - rep->length = (nIndicators*SIZEOF(xkbIndicatorMapWireDesc))/4; - return Success; -} - -static int -XkbSendIndicatorMap( ClientPtr client, - XkbIndicatorPtr indicators, - xkbGetIndicatorMapReply * rep) -{ -int length; -CARD8 * map; -register int i; -register unsigned bit; - - length = rep->length*4; - if (length>0) { - CARD8 *to; - to= map= malloc(length); - if (map) { - xkbIndicatorMapWireDesc *wire = (xkbIndicatorMapWireDesc *)to; - for (i=0,bit=1;iwhich&bit) { - wire->flags= indicators->maps[i].flags; - wire->whichGroups= indicators->maps[i].which_groups; - wire->groups= indicators->maps[i].groups; - wire->whichMods= indicators->maps[i].which_mods; - wire->mods= indicators->maps[i].mods.mask; - wire->realMods= indicators->maps[i].mods.real_mods; - 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); - } - wire++; - } - } - to = (CARD8 *)wire; - if ((to-map)!=length) { - client->errorValue = _XkbErrCode2(0xff,length); - free(map); - return BadLength; - } - } - else return BadAlloc; - } - else map = NULL; - if (client->swapped) { - swaps(&rep->sequenceNumber,i); - swapl(&rep->length,i); - swapl(&rep->which,i); - swapl(&rep->realIndicators,i); - } - WriteToClient(client, SIZEOF(xkbGetIndicatorMapReply), (char *)rep); - if (map) { - WriteToClient(client, length, (char *)map); - free((char *)map); - } - return Success; -} - -int -ProcXkbGetIndicatorMap(ClientPtr client) -{ -xkbGetIndicatorMapReply rep; -DeviceIntPtr dev; -XkbDescPtr xkb; -XkbIndicatorPtr leds; - - REQUEST(xkbGetIndicatorMapReq); - REQUEST_SIZE_MATCH(xkbGetIndicatorMapReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); - - xkb= dev->key->xkbInfo->desc; - leds= xkb->indicators; - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.deviceID = dev->id; - rep.which = stuff->which; - XkbComputeGetIndicatorMapReplySize(leds,&rep); - return XkbSendIndicatorMap(client,leds,&rep); -} - -/** - * Apply the given map to the given device. Which specifies which components - * to apply. - */ -static int -_XkbSetIndicatorMap(ClientPtr client, DeviceIntPtr dev, - int which, xkbIndicatorMapWireDesc *desc) -{ - XkbSrvInfoPtr xkbi; - XkbSrvLedInfoPtr sli; - XkbEventCauseRec cause; - int i, bit; - - xkbi = dev->key->xkbInfo; - - sli= XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, - XkbXI_IndicatorMapsMask); - if (!sli) - return BadAlloc; - - for (i = 0, bit = 1; i < XkbNumIndicators; i++, bit <<= 1) { - if (which & bit) { - sli->maps[i].flags = desc->flags; - sli->maps[i].which_groups = desc->whichGroups; - sli->maps[i].groups = desc->groups; - sli->maps[i].which_mods = desc->whichMods; - sli->maps[i].mods.mask = desc->mods; - sli->maps[i].mods.real_mods = desc->mods; - sli->maps[i].mods.vmods= desc->virtualMods; - sli->maps[i].ctrls = desc->ctrls; - if (desc->virtualMods!=0) { - unsigned tmp; - tmp= XkbMaskForVMask(xkbi->desc,desc->virtualMods); - sli->maps[i].mods.mask= desc->mods|tmp; - } - desc++; - } - } - - XkbSetCauseXkbReq(&cause,X_kbSetIndicatorMap,client); - XkbApplyLedMapChanges(dev,sli,which,NULL,NULL,&cause); - - return Success; -} - -int -ProcXkbSetIndicatorMap(ClientPtr client) -{ - int i, bit; - int nIndicators; - DeviceIntPtr dev; - xkbIndicatorMapWireDesc *from; - int rc; - - REQUEST(xkbSetIndicatorMapReq); - REQUEST_AT_LEAST_SIZE(xkbSetIndicatorMapReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess); - - if (stuff->which==0) - return Success; - - for (nIndicators=i=0,bit=1;iwhich&bit) - nIndicators++; - } - if (stuff->length!=((SIZEOF(xkbSetIndicatorMapReq)+ - (nIndicators*SIZEOF(xkbIndicatorMapWireDesc)))/4)) { - return BadLength; - } - - from = (xkbIndicatorMapWireDesc *)&stuff[1]; - for (i=0,bit=1;iwhich&bit) { - if (client->swapped) { - int n; - swaps(&from->virtualMods,n); - swapl(&from->ctrls,n); - } - CHK_MASK_LEGAL(i,from->whichGroups,XkbIM_UseAnyGroup); - CHK_MASK_LEGAL(i,from->whichMods,XkbIM_UseAnyMods); - from++; - } - } - - from = (xkbIndicatorMapWireDesc *)&stuff[1]; - rc = _XkbSetIndicatorMap(client, dev, stuff->which, from); - if (rc != Success) - return rc; - - if (stuff->deviceSpec == XkbUseCoreKbd) - { - DeviceIntPtr other; - for (other = inputInfo.devices; other; other = other->next) - { - if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) - { - rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixSetAttrAccess); - if (rc == Success) - _XkbSetIndicatorMap(client, other, stuff->which, from); - } - } - } - - return Success; -} - -/***====================================================================***/ - -int -ProcXkbGetNamedIndicator(ClientPtr client) -{ - DeviceIntPtr dev; - xkbGetNamedIndicatorReply rep; - register int i = 0; - XkbSrvLedInfoPtr sli; - XkbIndicatorMapPtr map = NULL; - - REQUEST(xkbGetNamedIndicatorReq); - REQUEST_SIZE_MATCH(xkbGetNamedIndicatorReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_LED_DEVICE(dev, stuff->deviceSpec, client, DixReadAccess); - CHK_ATOM_ONLY(stuff->indicator); - - sli= XkbFindSrvLedInfo(dev,stuff->ledClass,stuff->ledID,0); - if (!sli) - return BadAlloc; - - i= 0; - map= NULL; - if ((sli->names)&&(sli->maps)) { - for (i=0;iindicator==sli->names[i]) { - map= &sli->maps[i]; - break; - } - } - } - - rep.type= X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.deviceID = dev->id; - rep.indicator= stuff->indicator; - if (map!=NULL) { - rep.found= TRUE; - rep.on= ((sli->effectiveState&(1<physIndicators&(1<flags; - rep.whichGroups= map->which_groups; - rep.groups= map->groups; - rep.whichMods= map->which_mods; - rep.mods= map->mods.mask; - rep.realMods= map->mods.real_mods; - rep.virtualMods= map->mods.vmods; - rep.ctrls= map->ctrls; - rep.supported= TRUE; - } - else { - rep.found= FALSE; - rep.on= FALSE; - rep.realIndicator= FALSE; - rep.ndx= XkbNoIndicator; - rep.flags= 0; - rep.whichGroups= 0; - rep.groups= 0; - rep.whichMods= 0; - rep.mods= 0; - rep.realMods= 0; - rep.virtualMods= 0; - rep.ctrls= 0; - 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); - } - - WriteToClient(client,SIZEOF(xkbGetNamedIndicatorReply), (char *)&rep); - return Success; -} - - -/** - * Find the IM on the device. - * Returns the map, or NULL if the map doesn't exist. - * If the return value is NULL, led_return is undefined. Otherwise, led_return - * is set to the led index of the map. - */ -static XkbIndicatorMapPtr -_XkbFindNamedIndicatorMap(XkbSrvLedInfoPtr sli, Atom indicator, - int *led_return) -{ - XkbIndicatorMapPtr map; - - /* search for the right indicator */ - map = NULL; - if (sli->names && sli->maps) { - int led; - - for (led = 0; (led < XkbNumIndicators) && (map == NULL); led++) { - if (sli->names[led] == indicator) { - map= &sli->maps[led]; - *led_return = led; - break; - } - } - } - - return map; -} - -/** - * Creates an indicator map on the device. If dryRun is TRUE, it only checks - * if creation is possible, but doesn't actually create it. - */ -static int -_XkbCreateIndicatorMap(DeviceIntPtr dev, Atom indicator, - int ledClass, int ledID, - XkbIndicatorMapPtr *map_return, int *led_return, - Bool dryRun) -{ - XkbSrvLedInfoPtr sli; - XkbIndicatorMapPtr map; - int led; - - sli = XkbFindSrvLedInfo(dev, ledClass, ledID, XkbXI_IndicatorsMask); - if (!sli) - return BadAlloc; - - map = _XkbFindNamedIndicatorMap(sli, indicator, &led); - - if (!map) - { - /* find first unused indicator maps and assign the name to it */ - for (led = 0, map = NULL; (led < XkbNumIndicators) && (map == NULL); led++) { - if ((sli->names) && (sli->maps) && (sli->names[led] == None) && - (!XkbIM_InUse(&sli->maps[led]))) - { - map = &sli->maps[led]; - if (!dryRun) - sli->names[led] = indicator; - break; - } - } - } - - if (!map) - return BadAlloc; - - *led_return = led; - *map_return = map; - return Success; -} - -static int -_XkbSetNamedIndicator(ClientPtr client, DeviceIntPtr dev, - xkbSetNamedIndicatorReq *stuff) -{ - unsigned int extDevReason; - unsigned int statec, namec, mapc; - XkbSrvLedInfoPtr sli; - int led = 0; - XkbIndicatorMapPtr map; - DeviceIntPtr kbd; - XkbEventCauseRec cause; - xkbExtensionDeviceNotify ed; - XkbChangesRec changes; - int rc; - - rc = _XkbCreateIndicatorMap(dev, stuff->indicator, stuff->ledClass, - stuff->ledID, &map, &led, FALSE); - if (rc != Success || !map) /* oh-oh */ - return rc; - - sli = XkbFindSrvLedInfo(dev, stuff->ledClass, stuff->ledID, - XkbXI_IndicatorsMask); - if (!sli) - return BadAlloc; - - namec = mapc = statec = 0; - extDevReason = 0; - - namec |= (1<namesPresent |= ((stuff->indicator != None) ? (1 << led) : 0); - extDevReason |= XkbXI_IndicatorNamesMask; - - if (stuff->setMap) { - map->flags = stuff->flags; - map->which_groups = stuff->whichGroups; - map->groups = stuff->groups; - map->which_mods = stuff->whichMods; - map->mods.mask = stuff->realMods; - map->mods.real_mods = stuff->realMods; - map->mods.vmods= stuff->virtualMods; - map->ctrls = stuff->ctrls; - mapc|= (1<setState) && ((map->flags & XkbIM_NoExplicit) == 0)) - { - if (stuff->on) sli->explicitState |= (1<explicitState &= ~(1<effectiveState ^ sli->explicitState) & (1 << led)); - } - - memset((char *)&ed, 0, sizeof(xkbExtensionDeviceNotify)); - memset((char *)&changes, 0, sizeof(XkbChangesRec)); - XkbSetCauseXkbReq(&cause,X_kbSetNamedIndicator,client); - if (namec) - XkbApplyLedNameChanges(dev,sli,namec,&ed,&changes,&cause); - if (mapc) - XkbApplyLedMapChanges(dev,sli,mapc,&ed,&changes,&cause); - if (statec) - XkbApplyLedStateChanges(dev,sli,statec,&ed,&changes,&cause); - - kbd = dev; - if ((sli->flags&XkbSLI_HasOwnState)==0) - kbd = inputInfo.keyboard; - XkbFlushLedEvents(dev, kbd, sli, &ed, &changes, &cause); - - return Success; -} - -int -ProcXkbSetNamedIndicator(ClientPtr client) -{ - int rc; - DeviceIntPtr dev; - int led = 0; - XkbIndicatorMapPtr map; - - REQUEST(xkbSetNamedIndicatorReq); - REQUEST_SIZE_MATCH(xkbSetNamedIndicatorReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_LED_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess); - CHK_ATOM_ONLY(stuff->indicator); - CHK_MASK_LEGAL(0x10,stuff->whichGroups,XkbIM_UseAnyGroup); - CHK_MASK_LEGAL(0x11,stuff->whichMods,XkbIM_UseAnyMods); - - /* Dry-run for checks */ - rc = _XkbCreateIndicatorMap(dev, stuff->indicator, - stuff->ledClass, stuff->ledID, - &map, &led, TRUE); - if (rc != Success || !map) /* couldn't be created or didn't exist */ - return rc; - - if (stuff->deviceSpec == XkbUseCoreKbd || - stuff->deviceSpec == XkbUseCorePtr) - { - DeviceIntPtr other; - for (other = inputInfo.devices; other; other = other->next) - { - if ((other != dev) && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev && - (other->kbdfeed || other->leds) && - (XaceHook(XACE_DEVICE_ACCESS, client, other, DixSetAttrAccess) == Success)) - { - rc = _XkbCreateIndicatorMap(other, stuff->indicator, - stuff->ledClass, stuff->ledID, - &map, &led, TRUE); - if (rc != Success || !map) - return rc; - } - } - } - - /* All checks passed, let's do it */ - rc = _XkbSetNamedIndicator(client, dev, stuff); - if (rc != Success) - return rc; - - if (stuff->deviceSpec == XkbUseCoreKbd || - stuff->deviceSpec == XkbUseCorePtr) - { - DeviceIntPtr other; - for (other = inputInfo.devices; other; other = other->next) - { - if ((other != dev) && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev && - (other->kbdfeed || other->leds) && - (XaceHook(XACE_DEVICE_ACCESS, client, other, DixSetAttrAccess) == Success)) - { - _XkbSetNamedIndicator(client, other, stuff); - } - } - } - - return Success; -} - -/***====================================================================***/ - -static CARD32 -_XkbCountAtoms(Atom *atoms,int maxAtoms,int *count) -{ -register unsigned int i,bit,nAtoms; -register CARD32 atomsPresent; - - for (i=nAtoms=atomsPresent=0,bit=1;iminKeyCode= xkb->min_key_code; - rep->maxKeyCode= xkb->max_key_code; - which= rep->which; - length= 0; - if (xkb->names!=NULL) { - if (which&XkbKeycodesNameMask) length++; - if (which&XkbGeometryNameMask) length++; - if (which&XkbSymbolsNameMask) length++; - if (which&XkbPhysSymbolsNameMask) length++; - if (which&XkbTypesNameMask) length++; - if (which&XkbCompatNameMask) length++; - } - else which&= ~XkbComponentNamesMask; - - if (xkb->map!=NULL) { - if (which&XkbKeyTypeNamesMask) - length+= xkb->map->num_types; - rep->nTypes= xkb->map->num_types; - if (which&XkbKTLevelNamesMask) { - XkbKeyTypePtr pType = xkb->map->types; - int nKTLevels = 0; - - length+= XkbPaddedSize(xkb->map->num_types)/4; - for (i=0;imap->num_types;i++,pType++) { - if (pType->level_names!=NULL) - nKTLevels+= pType->num_levels; - } - rep->nKTLevels= nKTLevels; - length+= nKTLevels; - } - } - else { - rep->nTypes= 0; - rep->nKTLevels= 0; - which&= ~(XkbKeyTypeNamesMask|XkbKTLevelNamesMask); - } - - rep->minKeyCode= xkb->min_key_code; - rep->maxKeyCode= xkb->max_key_code; - rep->indicators= 0; - rep->virtualMods= 0; - rep->groupNames= 0; - if (xkb->names!=NULL) { - if (which&XkbIndicatorNamesMask) { - int nLeds; - rep->indicators= - _XkbCountAtoms(xkb->names->indicators,XkbNumIndicators,&nLeds); - length+= nLeds; - if (nLeds==0) - which&= ~XkbIndicatorNamesMask; - } - - if (which&XkbVirtualModNamesMask) { - int nVMods; - rep->virtualMods= - _XkbCountAtoms(xkb->names->vmods,XkbNumVirtualMods,&nVMods); - length+= nVMods; - if (nVMods==0) - which&= ~XkbVirtualModNamesMask; - } - - if (which&XkbGroupNamesMask) { - int nGroups; - rep->groupNames= - _XkbCountAtoms(xkb->names->groups,XkbNumKbdGroups,&nGroups); - length+= nGroups; - if (nGroups==0) - which&= ~XkbGroupNamesMask; - } - - if ((which&XkbKeyNamesMask)&&(xkb->names->keys)) - length+= rep->nKeys; - else which&= ~XkbKeyNamesMask; - - if ((which&XkbKeyAliasesMask)&& - (xkb->names->key_aliases)&&(xkb->names->num_key_aliases>0)) { - rep->nKeyAliases= xkb->names->num_key_aliases; - length+= rep->nKeyAliases*2; - } - else { - which&= ~XkbKeyAliasesMask; - rep->nKeyAliases= 0; - } - - if ((which&XkbRGNamesMask)&&(xkb->names->num_rg>0)) - length+= xkb->names->num_rg; - else which&= ~XkbRGNamesMask; - } - else { - which&= ~(XkbIndicatorNamesMask|XkbVirtualModNamesMask); - which&= ~(XkbGroupNamesMask|XkbKeyNamesMask|XkbKeyAliasesMask); - which&= ~XkbRGNamesMask; - } - - rep->length= length; - rep->which= which; - return Success; -} - -static int -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); - } - - start = desc = malloc(length); - if ( !start ) - return BadAlloc; - if (xkb->names) { - if (which&XkbKeycodesNameMask) { - *((CARD32 *)desc)= xkb->names->keycodes; - if (client->swapped) { - swapl(desc,n); - } - desc+= 4; - } - if (which&XkbGeometryNameMask) { - *((CARD32 *)desc)= xkb->names->geometry; - if (client->swapped) { - swapl(desc,n); - } - desc+= 4; - } - if (which&XkbSymbolsNameMask) { - *((CARD32 *)desc)= xkb->names->symbols; - if (client->swapped) { - swapl(desc,n); - } - desc+= 4; - } - if (which&XkbPhysSymbolsNameMask) { - register CARD32 *atm= (CARD32 *)desc; - atm[0]= (CARD32)xkb->names->phys_symbols; - if (client->swapped) { - swapl(&atm[0],n); - } - desc+= 4; - } - if (which&XkbTypesNameMask) { - *((CARD32 *)desc)= (CARD32)xkb->names->types; - if (client->swapped) { - swapl(desc,n); - } - desc+= 4; - } - if (which&XkbCompatNameMask) { - *((CARD32 *)desc)= (CARD32)xkb->names->compat; - if (client->swapped) { - swapl(desc,n); - } - desc+= 4; - } - if (which&XkbKeyTypeNamesMask) { - register CARD32 *atm= (CARD32 *)desc; - register XkbKeyTypePtr type= xkb->map->types; - - for (i=0;imap->num_types;i++,atm++,type++) { - *atm= (CARD32)type->name; - if (client->swapped) { - swapl(atm,n); - } - } - desc= (char *)atm; - } - if (which&XkbKTLevelNamesMask && xkb->map) { - XkbKeyTypePtr type = xkb->map->types; - register CARD32 *atm; - for (i=0;inTypes;i++,type++) { - *desc++ = type->num_levels; - } - desc+= XkbPaddedSize(rep->nTypes)-rep->nTypes; - - atm= (CARD32 *)desc; - type = xkb->map->types; - for (i=0;imap->num_types;i++,type++) { - register unsigned l; - if (type->level_names) { - for (l=0;lnum_levels;l++,atm++) { - *atm= type->level_names[l]; - if (client->swapped) { - swapl(atm,n); - } - } - desc+= type->num_levels*4; - } - } - } - if (which&XkbIndicatorNamesMask) { - desc= _XkbWriteAtoms(desc,xkb->names->indicators,XkbNumIndicators, - client->swapped); - } - if (which&XkbVirtualModNamesMask) { - desc= _XkbWriteAtoms(desc,xkb->names->vmods,XkbNumVirtualMods, - client->swapped); - } - if (which&XkbGroupNamesMask) { - desc= _XkbWriteAtoms(desc,xkb->names->groups,XkbNumKbdGroups, - client->swapped); - } - if (which&XkbKeyNamesMask) { - for (i=0;inKeys;i++,desc+= sizeof(XkbKeyNameRec)) { - *((XkbKeyNamePtr)desc)= xkb->names->keys[i+rep->firstKey]; - } - } - if (which&XkbKeyAliasesMask) { - XkbKeyAliasPtr pAl; - pAl= xkb->names->key_aliases; - for (i=0;inKeyAliases;i++,pAl++,desc+=2*XkbKeyNameLength) { - *((XkbKeyAliasPtr)desc)= *pAl; - } - } - if ((which&XkbRGNamesMask)&&(rep->nRadioGroups>0)) { - register CARD32 *atm= (CARD32 *)desc; - for (i=0;inRadioGroups;i++,atm++) { - *atm= (CARD32)xkb->names->radio_groups[i]; - if (client->swapped) { - swapl(atm,n); - } - } - desc+= rep->nRadioGroups*4; - } - } - - if ((desc-start)!=(length)) { - ErrorF("[xkb] BOGUS LENGTH in write names, expected %d, got %ld\n", - length, (unsigned long)(desc-start)); - } - WriteToClient(client, SIZEOF(xkbGetNamesReply), (char *)rep); - WriteToClient(client, length, start); - free((char *)start); - return Success; -} - -int -ProcXkbGetNames(ClientPtr client) -{ - DeviceIntPtr dev; - XkbDescPtr xkb; - xkbGetNamesReply rep; - - REQUEST(xkbGetNamesReq); - REQUEST_SIZE_MATCH(xkbGetNamesReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); - CHK_MASK_LEGAL(0x01,stuff->which,XkbAllNamesMask); - - xkb = dev->key->xkbInfo->desc; - memset(&rep, 0, sizeof(xkbGetNamesReply)); - rep.type= X_Reply; - rep.sequenceNumber= client->sequence; - rep.length = 0; - rep.deviceID = dev->id; - rep.which = stuff->which; - rep.nTypes = xkb->map->num_types; - rep.firstKey = xkb->min_key_code; - rep.nKeys = XkbNumKeys(xkb); - if (xkb->names!=NULL) { - rep.nKeyAliases= xkb->names->num_key_aliases; - rep.nRadioGroups = xkb->names->num_rg; - } - else { - rep.nKeyAliases= rep.nRadioGroups= 0; - } - XkbComputeGetNamesReplySize(xkb,&rep); - return XkbSendNames(client,xkb,&rep); -} - -/***====================================================================***/ - -static CARD32 * -_XkbCheckAtoms(CARD32 *wire,int nAtoms,int swapped,Atom *pError) -{ -register int i; - - for (i=0;ikey->xkbInfo->desc; - names = xkb->names; - - - if (stuff->which & XkbKeyTypeNamesMask) { - int i; - CARD32 *old; - if ( stuff->nTypes<1 ) { - client->errorValue = _XkbErrCode2(0x02,stuff->nTypes); - return BadValue; - } - if ((unsigned)(stuff->firstType+stuff->nTypes-1)>=xkb->map->num_types) { - client->errorValue = _XkbErrCode4(0x03,stuff->firstType, - stuff->nTypes, - xkb->map->num_types); - return BadValue; - } - if (((unsigned)stuff->firstType)<=XkbLastRequiredType) { - client->errorValue = _XkbErrCode2(0x04,stuff->firstType); - return BadAccess; - } - old= tmp; - tmp= _XkbCheckAtoms(tmp,stuff->nTypes,client->swapped,&bad); - if (!tmp) { - client->errorValue= bad; - return BadAtom; - } - for (i=0;inTypes;i++,old++) { - if (!_XkbCheckTypeName((Atom)*old,stuff->firstType+i)) - client->errorValue= _XkbErrCode2(0x05,i); - } - } - if (stuff->which&XkbKTLevelNamesMask) { - unsigned i; - XkbKeyTypePtr type; - CARD8 * width; - if ( stuff->nKTLevels<1 ) { - client->errorValue = _XkbErrCode2(0x05,stuff->nKTLevels); - return BadValue; - } - if ((unsigned)(stuff->firstKTLevel+stuff->nKTLevels-1)>= - xkb->map->num_types) { - client->errorValue = _XkbErrCode4(0x06,stuff->firstKTLevel, - stuff->nKTLevels,xkb->map->num_types); - return BadValue; - } - width = (CARD8 *)tmp; - tmp= (CARD32 *)(((char *)tmp)+XkbPaddedSize(stuff->nKTLevels)); - type = &xkb->map->types[stuff->firstKTLevel]; - for (i=0;inKTLevels;i++,type++) { - if (width[i]==0) - continue; - else if (width[i]!=type->num_levels) { - client->errorValue= _XkbErrCode4(0x07,i+stuff->firstKTLevel, - type->num_levels,width[i]); - return BadMatch; - } - tmp= _XkbCheckAtoms(tmp,width[i],client->swapped,&bad); - if (!tmp) { - client->errorValue= bad; - return BadAtom; - } - } - } - if (stuff->which&XkbIndicatorNamesMask) { - if (stuff->indicators==0) { - client->errorValue= 0x08; - return BadMatch; - } - tmp= _XkbCheckMaskedAtoms(tmp,XkbNumIndicators,stuff->indicators, - client->swapped,&bad); - if (!tmp) { - client->errorValue= bad; - return BadAtom; - } - } - if (stuff->which&XkbVirtualModNamesMask) { - if (stuff->virtualMods==0) { - client->errorValue= 0x09; - return BadMatch; - } - tmp= _XkbCheckMaskedAtoms(tmp,XkbNumVirtualMods, - (CARD32)stuff->virtualMods, - client->swapped,&bad); - if (!tmp) { - client->errorValue = bad; - return BadAtom; - } - } - if (stuff->which&XkbGroupNamesMask) { - if (stuff->groupNames==0) { - client->errorValue= 0x0a; - return BadMatch; - } - tmp= _XkbCheckMaskedAtoms(tmp,XkbNumKbdGroups, - (CARD32)stuff->groupNames, - client->swapped,&bad); - if (!tmp) { - client->errorValue = bad; - return BadAtom; - } - } - if (stuff->which&XkbKeyNamesMask) { - if (stuff->firstKey<(unsigned)xkb->min_key_code) { - client->errorValue= _XkbErrCode3(0x0b,xkb->min_key_code, - stuff->firstKey); - return BadValue; - } - if (((unsigned)(stuff->firstKey+stuff->nKeys-1)>xkb->max_key_code)|| - (stuff->nKeys<1)) { - client->errorValue= _XkbErrCode4(0x0c,xkb->max_key_code, - stuff->firstKey,stuff->nKeys); - return BadValue; - } - tmp+= stuff->nKeys; - } - if ((stuff->which&XkbKeyAliasesMask)&&(stuff->nKeyAliases>0)) { - tmp+= stuff->nKeyAliases*2; - } - if (stuff->which&XkbRGNamesMask) { - if ( stuff->nRadioGroups<1 ) { - client->errorValue= _XkbErrCode2(0x0d,stuff->nRadioGroups); - return BadValue; - } - tmp= _XkbCheckAtoms(tmp,stuff->nRadioGroups,client->swapped,&bad); - if (!tmp) { - client->errorValue= bad; - return BadAtom; - } - } - if ((tmp-((CARD32 *)stuff))!=stuff->length) { - client->errorValue = stuff->length; - return BadLength; - } - - - - return Success; -} - -static int -_XkbSetNames(ClientPtr client, DeviceIntPtr dev, xkbSetNamesReq *stuff) -{ - XkbDescRec *xkb; - XkbNamesRec *names; - CARD32 *tmp; - xkbNamesNotify nn; - - tmp = (CARD32 *)&stuff[1]; - xkb = dev->key->xkbInfo->desc; - names = xkb->names; - - if (XkbAllocNames(xkb,stuff->which,stuff->nRadioGroups, - stuff->nKeyAliases)!=Success) { - return BadAlloc; - } - - memset(&nn, 0, sizeof(xkbNamesNotify)); - nn.changed= stuff->which; - tmp = (CARD32 *)&stuff[1]; - if (stuff->which&XkbKeycodesNameMask) - names->keycodes= *tmp++; - if (stuff->which&XkbGeometryNameMask) - names->geometry= *tmp++; - if (stuff->which&XkbSymbolsNameMask) - names->symbols= *tmp++; - if (stuff->which&XkbPhysSymbolsNameMask) - names->phys_symbols= *tmp++; - if (stuff->which&XkbTypesNameMask) - names->types= *tmp++; - if (stuff->which&XkbCompatNameMask) - names->compat= *tmp++; - if ((stuff->which&XkbKeyTypeNamesMask)&&(stuff->nTypes>0)) { - register unsigned i; - register XkbKeyTypePtr type; - - type= &xkb->map->types[stuff->firstType]; - for (i=0;inTypes;i++,type++) { - type->name= *tmp++; - } - nn.firstType= stuff->firstType; - nn.nTypes= stuff->nTypes; - } - if (stuff->which&XkbKTLevelNamesMask) { - register XkbKeyTypePtr type; - register unsigned i; - CARD8 *width; - - width = (CARD8 *)tmp; - tmp= (CARD32 *)(((char *)tmp)+XkbPaddedSize(stuff->nKTLevels)); - type= &xkb->map->types[stuff->firstKTLevel]; - for (i=0;inKTLevels;i++,type++) { - if (width[i]>0) { - if (type->level_names) { - register unsigned n; - for (n=0;nlevel_names[n]= tmp[n]; - } - } - tmp+= width[i]; - } - } - nn.firstLevelName= 0; - nn.nLevelNames= stuff->nTypes; - } - if (stuff->which&XkbIndicatorNamesMask) { - tmp= _XkbCopyMaskedAtoms(tmp,names->indicators,XkbNumIndicators, - stuff->indicators); - nn.changedIndicators= stuff->indicators; - } - if (stuff->which&XkbVirtualModNamesMask) { - tmp= _XkbCopyMaskedAtoms(tmp,names->vmods,XkbNumVirtualMods, - stuff->virtualMods); - nn.changedVirtualMods= stuff->virtualMods; - } - if (stuff->which&XkbGroupNamesMask) { - tmp= _XkbCopyMaskedAtoms(tmp,names->groups,XkbNumKbdGroups, - stuff->groupNames); - nn.changedVirtualMods= stuff->groupNames; - } - if (stuff->which&XkbKeyNamesMask) { - memcpy((char*)&names->keys[stuff->firstKey],(char *)tmp, - stuff->nKeys*XkbKeyNameLength); - tmp+= stuff->nKeys; - nn.firstKey= stuff->firstKey; - nn.nKeys= stuff->nKeys; - } - if (stuff->which&XkbKeyAliasesMask) { - if (stuff->nKeyAliases>0) { - register int na= stuff->nKeyAliases; - if (XkbAllocNames(xkb,XkbKeyAliasesMask,0,na)!=Success) - return BadAlloc; - memcpy((char *)names->key_aliases,(char *)tmp, - stuff->nKeyAliases*sizeof(XkbKeyAliasRec)); - tmp+= stuff->nKeyAliases*2; - } - else if (names->key_aliases!=NULL) { - free(names->key_aliases); - names->key_aliases= NULL; - names->num_key_aliases= 0; - } - nn.nAliases= names->num_key_aliases; - } - if (stuff->which&XkbRGNamesMask) { - if (stuff->nRadioGroups>0) { - register unsigned i,nrg; - nrg= stuff->nRadioGroups; - if (XkbAllocNames(xkb,XkbRGNamesMask,nrg,0)!=Success) - return BadAlloc; - - for (i=0;inRadioGroups;i++) { - names->radio_groups[i]= tmp[i]; - } - tmp+= stuff->nRadioGroups; - } - else if (names->radio_groups) { - free(names->radio_groups); - names->radio_groups= NULL; - names->num_rg= 0; - } - nn.nRadioGroups= names->num_rg; - } - if (nn.changed) { - Bool needExtEvent; - needExtEvent= (nn.changed&XkbIndicatorNamesMask)!=0; - XkbSendNamesNotify(dev,&nn); - if (needExtEvent) { - XkbSrvLedInfoPtr sli; - xkbExtensionDeviceNotify edev; - register int i; - register unsigned bit; - - sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId, - XkbXI_IndicatorsMask); - sli->namesPresent= 0; - for (i=0,bit=1;iindicators[i]!=None) - sli->namesPresent|= bit; - } - memset(&edev, 0, sizeof(xkbExtensionDeviceNotify)); - edev.reason= XkbXI_IndicatorNamesMask; - edev.ledClass= KbdFeedbackClass; - edev.ledID= dev->kbdfeed->ctrl.id; - edev.ledsDefined= sli->namesPresent|sli->mapsPresent; - edev.ledState= sli->effectiveState; - edev.firstBtn= 0; - edev.nBtns= 0; - edev.supported= XkbXI_AllFeaturesMask; - edev.unsupported= 0; - XkbSendExtensionDeviceNotify(dev,client,&edev); - } - } - return Success; -} - -int -ProcXkbSetNames(ClientPtr client) -{ - DeviceIntPtr dev; - CARD32 *tmp; - Atom bad; - int rc; - - REQUEST(xkbSetNamesReq); - REQUEST_AT_LEAST_SIZE(xkbSetNamesReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); - CHK_MASK_LEGAL(0x01,stuff->which,XkbAllNamesMask); - - /* check device-independent stuff */ - tmp = (CARD32 *)&stuff[1]; - - if (stuff->which&XkbKeycodesNameMask) { - tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad); - if (!tmp) { - client->errorValue = bad; - return BadAtom; - } - } - if (stuff->which&XkbGeometryNameMask) { - tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad); - if (!tmp) { - client->errorValue = bad; - return BadAtom; - } - } - if (stuff->which&XkbSymbolsNameMask) { - tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad); - if (!tmp) { - client->errorValue = bad; - return BadAtom; - } - } - if (stuff->which&XkbPhysSymbolsNameMask) { - tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad); - if (!tmp) { - client->errorValue= bad; - return BadAtom; - } - } - if (stuff->which&XkbTypesNameMask) { - tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad); - if (!tmp) { - client->errorValue = bad; - return BadAtom; - } - } - if (stuff->which&XkbCompatNameMask) { - tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad); - if (!tmp) { - client->errorValue = bad; - return BadAtom; - } - } - - /* start of device-dependent tests */ - rc = _XkbSetNamesCheck(client, dev, stuff, tmp); - if (rc != Success) - return rc; - - if (stuff->deviceSpec == XkbUseCoreKbd) - { - DeviceIntPtr other; - for (other = inputInfo.devices; other; other = other->next) - { - if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) - { - - rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); - if (rc == Success) - { - rc = _XkbSetNamesCheck(client, other, stuff, tmp); - if (rc != Success) - return rc; - } - } - } - } - - /* everything is okay -- update names */ - - rc = _XkbSetNames(client, dev, stuff); - if (rc != Success) - return rc; - - if (stuff->deviceSpec == XkbUseCoreKbd) - { - DeviceIntPtr other; - for (other = inputInfo.devices; other; other = other->next) - { - if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) - { - - rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); - if (rc == Success) - _XkbSetNames(client, other, stuff); - } - } - } - - /* everything is okay -- update names */ - - return Success; -} - -/***====================================================================***/ - -#include "xkbgeom.h" - -#define XkbSizeCountedString(s) ((s)?((((2+strlen(s))+3)/4)*4):4) - -static char * -XkbWriteCountedString(char *wire,char *str,Bool swap) -{ - CARD16 len,*pLen; - - if (!str) - return wire; - - len= strlen(str); - pLen= (CARD16 *)wire; - *pLen= len; - if (swap) { - register int n; - swaps(pLen,n); - } - memcpy(&wire[2],str,len); - wire+= ((2+len+3)/4)*4; - return wire; -} - -static int -XkbSizeGeomProperties(XkbGeometryPtr geom) -{ -register int i,size; -XkbPropertyPtr prop; - - for (size=i=0,prop=geom->properties;inum_properties;i++,prop++) { - size+= XkbSizeCountedString(prop->name); - size+= XkbSizeCountedString(prop->value); - } - return size; -} - -static char * -XkbWriteGeomProperties(char *wire,XkbGeometryPtr geom,Bool swap) -{ -register int i; -register XkbPropertyPtr prop; - - for (i=0,prop=geom->properties;inum_properties;i++,prop++) { - wire= XkbWriteCountedString(wire,prop->name,swap); - wire= XkbWriteCountedString(wire,prop->value,swap); - } - return wire; -} - -static int -XkbSizeGeomKeyAliases(XkbGeometryPtr geom) -{ - return geom->num_key_aliases*(2*XkbKeyNameLength); -} - -static char * -XkbWriteGeomKeyAliases(char *wire,XkbGeometryPtr geom,Bool swap) -{ -register int sz; - - sz= geom->num_key_aliases*(XkbKeyNameLength*2); - if (sz>0) { - memcpy(wire,(char *)geom->key_aliases,sz); - wire+= sz; - } - return wire; -} - -static int -XkbSizeGeomColors(XkbGeometryPtr geom) -{ -register int i,size; -register XkbColorPtr color; - - for (i=size=0,color=geom->colors;inum_colors;i++,color++) { - size+= XkbSizeCountedString(color->spec); - } - return size; -} - -static char * -XkbWriteGeomColors(char *wire,XkbGeometryPtr geom,Bool swap) -{ -register int i; -register XkbColorPtr color; - - for (i=0,color=geom->colors;inum_colors;i++,color++) { - wire= XkbWriteCountedString(wire,color->spec,swap); - } - return wire; -} - -static int -XkbSizeGeomShapes(XkbGeometryPtr geom) -{ -register int i,size; -register XkbShapePtr shape; - - for (i=size=0,shape=geom->shapes;inum_shapes;i++,shape++) { - register int n; - register XkbOutlinePtr ol; - size+= SIZEOF(xkbShapeWireDesc); - for (n=0,ol=shape->outlines;nnum_outlines;n++,ol++) { - size+= SIZEOF(xkbOutlineWireDesc); - size+= ol->num_points*SIZEOF(xkbPointWireDesc); - } - } - return size; -} - -static char * -XkbWriteGeomShapes(char *wire,XkbGeometryPtr geom,Bool swap) -{ -int i; -XkbShapePtr shape; -xkbShapeWireDesc * shapeWire; - - for (i=0,shape=geom->shapes;inum_shapes;i++,shape++) { - register int o; - XkbOutlinePtr ol; - xkbOutlineWireDesc * olWire; - shapeWire= (xkbShapeWireDesc *)wire; - shapeWire->name= shape->name; - shapeWire->nOutlines= shape->num_outlines; - if (shape->primary!=NULL) - shapeWire->primaryNdx= XkbOutlineIndex(shape,shape->primary); - else shapeWire->primaryNdx= XkbNoShape; - if (shape->approx!=NULL) - shapeWire->approxNdx= XkbOutlineIndex(shape,shape->approx); - else shapeWire->approxNdx= XkbNoShape; - if (swap) { - register int n; - swapl(&shapeWire->name,n); - } - wire= (char *)&shapeWire[1]; - for (o=0,ol=shape->outlines;onum_outlines;o++,ol++) { - register int p; - XkbPointPtr pt; - xkbPointWireDesc * ptWire; - olWire= (xkbOutlineWireDesc *)wire; - olWire->nPoints= ol->num_points; - olWire->cornerRadius= ol->corner_radius; - wire= (char *)&olWire[1]; - ptWire= (xkbPointWireDesc *)wire; - for (p=0,pt=ol->points;pnum_points;p++,pt++) { - 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); - } - } - wire= (char *)&ptWire[ol->num_points]; - } - } - return wire; -} - -static int -XkbSizeGeomDoodads(int num_doodads,XkbDoodadPtr doodad) -{ -register int i,size; - - for (i=size=0;iany.type==XkbTextDoodad) { - size+= XkbSizeCountedString(doodad->text.text); - size+= XkbSizeCountedString(doodad->text.font); - } - else if (doodad->any.type==XkbLogoDoodad) { - size+= XkbSizeCountedString(doodad->logo.logo_name); - } - } - return size; -} - -static char * -XkbWriteGeomDoodads(char *wire,int num_doodads,XkbDoodadPtr doodad,Bool swap) -{ -register int i; -xkbDoodadWireDesc * doodadWire; - - for (i=0;iany.name= doodad->any.name; - doodadWire->any.type= doodad->any.type; - doodadWire->any.priority= doodad->any.priority; - 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); - } - switch (doodad->any.type) { - case XkbOutlineDoodad: - case XkbSolidDoodad: - doodadWire->shape.angle= doodad->shape.angle; - doodadWire->shape.colorNdx= doodad->shape.color_ndx; - doodadWire->shape.shapeNdx= doodad->shape.shape_ndx; - if (swap) { - register int n; - swaps(&doodadWire->shape.angle,n); - } - break; - case XkbTextDoodad: - doodadWire->text.angle= doodad->text.angle; - doodadWire->text.width= doodad->text.width; - 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); - } - wire= XkbWriteCountedString(wire,doodad->text.text,swap); - wire= XkbWriteCountedString(wire,doodad->text.font,swap); - break; - case XkbIndicatorDoodad: - doodadWire->indicator.shapeNdx= doodad->indicator.shape_ndx; - doodadWire->indicator.onColorNdx=doodad->indicator.on_color_ndx; - doodadWire->indicator.offColorNdx= - doodad->indicator.off_color_ndx; - break; - case XkbLogoDoodad: - doodadWire->logo.angle= doodad->logo.angle; - doodadWire->logo.colorNdx= doodad->logo.color_ndx; - doodadWire->logo.shapeNdx= doodad->logo.shape_ndx; - wire= XkbWriteCountedString(wire,doodad->logo.logo_name,swap); - break; - default: - ErrorF("[xkb] Unknown doodad type %d in XkbWriteGeomDoodads\n", - doodad->any.type); - ErrorF("[xkb] Ignored\n"); - break; - } - } - return wire; -} - -static char * -XkbWriteGeomOverlay(char *wire,XkbOverlayPtr ol,Bool swap) -{ -register int r; -XkbOverlayRowPtr row; -xkbOverlayWireDesc * olWire; - - olWire= (xkbOverlayWireDesc *)wire; - olWire->name= ol->name; - olWire->nRows= ol->num_rows; - if (swap) { - register int n; - swapl(&olWire->name,n); - } - wire= (char *)&olWire[1]; - for (r=0,row=ol->rows;rnum_rows;r++,row++) { - unsigned int k; - XkbOverlayKeyPtr key; - xkbOverlayRowWireDesc * rowWire; - rowWire= (xkbOverlayRowWireDesc *)wire; - rowWire->rowUnder= row->row_under; - rowWire->nKeys= row->num_keys; - wire= (char *)&rowWire[1]; - for (k=0,key=row->keys;knum_keys;k++,key++) { - xkbOverlayKeyWireDesc * keyWire; - keyWire= (xkbOverlayKeyWireDesc *)wire; - memcpy(keyWire->over,key->over.name,XkbKeyNameLength); - memcpy(keyWire->under,key->under.name,XkbKeyNameLength); - wire= (char *)&keyWire[1]; - } - } - return wire; -} - -static int -XkbSizeGeomSections(XkbGeometryPtr geom) -{ -register int i,size; -XkbSectionPtr section; - - for (i=size=0,section=geom->sections;inum_sections;i++,section++) { - size+= SIZEOF(xkbSectionWireDesc); - if (section->rows) { - int r; - XkbRowPtr row; - for (r=0,row=section->rows;rnum_rows;row++,r++) { - size+= SIZEOF(xkbRowWireDesc); - size+= row->num_keys*SIZEOF(xkbKeyWireDesc); - } - } - if (section->doodads) - size+= XkbSizeGeomDoodads(section->num_doodads,section->doodads); - if (section->overlays) { - int o; - XkbOverlayPtr ol; - for (o=0,ol=section->overlays;onum_overlays;o++,ol++) { - int r; - XkbOverlayRowPtr row; - size+= SIZEOF(xkbOverlayWireDesc); - for (r=0,row=ol->rows;rnum_rows;r++,row++) { - size+= SIZEOF(xkbOverlayRowWireDesc); - size+= row->num_keys*SIZEOF(xkbOverlayKeyWireDesc); - } - } - } - } - return size; -} - -static char * -XkbWriteGeomSections(char *wire,XkbGeometryPtr geom,Bool swap) -{ -register int i; -XkbSectionPtr section; -xkbSectionWireDesc * sectionWire; - - for (i=0,section=geom->sections;inum_sections;i++,section++) { - sectionWire= (xkbSectionWireDesc *)wire; - sectionWire->name= section->name; - sectionWire->top= section->top; - sectionWire->left= section->left; - sectionWire->width= section->width; - sectionWire->height= section->height; - sectionWire->angle= section->angle; - sectionWire->priority= section->priority; - sectionWire->nRows= section->num_rows; - sectionWire->nDoodads= section->num_doodads; - sectionWire->nOverlays= section->num_overlays; - sectionWire->pad= 0; - if (swap) { - register int n; - swapl(§ionWire->name,n); - swaps(§ionWire->top,n); - swaps(§ionWire->left,n); - swaps(§ionWire->width,n); - swaps(§ionWire->height,n); - swaps(§ionWire->angle,n); - } - wire= (char *)§ionWire[1]; - if (section->rows) { - int r; - XkbRowPtr row; - xkbRowWireDesc * rowWire; - for (r=0,row=section->rows;rnum_rows;r++,row++) { - rowWire= (xkbRowWireDesc *)wire; - rowWire->top= row->top; - rowWire->left= row->left; - rowWire->nKeys= row->num_keys; - rowWire->vertical= row->vertical; - rowWire->pad= 0; - if (swap) { - register int n; - swaps(&rowWire->top,n); - swaps(&rowWire->left,n); - } - wire= (char *)&rowWire[1]; - if (row->keys) { - int k; - XkbKeyPtr key; - xkbKeyWireDesc * keyWire; - keyWire= (xkbKeyWireDesc *)wire; - for (k=0,key=row->keys;knum_keys;k++,key++) { - memcpy(keyWire[k].name,key->name.name,XkbKeyNameLength); - keyWire[k].gap= key->gap; - keyWire[k].shapeNdx= key->shape_ndx; - keyWire[k].colorNdx= key->color_ndx; - if (swap) { - register int n; - swaps(&keyWire[k].gap,n); - } - } - wire= (char *)&keyWire[row->num_keys]; - } - } - } - if (section->doodads) { - wire= XkbWriteGeomDoodads(wire, - section->num_doodads,section->doodads, - swap); - } - if (section->overlays) { - register int o; - for (o=0;onum_overlays;o++) { - wire= XkbWriteGeomOverlay(wire,§ion->overlays[o],swap); - } - } - } - return wire; -} - -static Status -XkbComputeGetGeometryReplySize( XkbGeometryPtr geom, - xkbGetGeometryReply * rep, - Atom name) -{ -int len; - - if (geom!=NULL) { - len= XkbSizeCountedString(geom->label_font); - len+= XkbSizeGeomProperties(geom); - len+= XkbSizeGeomColors(geom); - len+= XkbSizeGeomShapes(geom); - len+= XkbSizeGeomSections(geom); - len+= XkbSizeGeomDoodads(geom->num_doodads,geom->doodads); - len+= XkbSizeGeomKeyAliases(geom); - rep->length= len/4; - rep->found= TRUE; - rep->name= geom->name; - rep->widthMM= geom->width_mm; - rep->heightMM= geom->height_mm; - rep->nProperties= geom->num_properties; - rep->nColors= geom->num_colors; - rep->nShapes= geom->num_shapes; - rep->nSections= geom->num_sections; - rep->nDoodads= geom->num_doodads; - rep->nKeyAliases= geom->num_key_aliases; - rep->baseColorNdx= XkbGeomColorIndex(geom,geom->base_color); - rep->labelColorNdx= XkbGeomColorIndex(geom,geom->label_color); - } - else { - rep->length= 0; - rep->found= FALSE; - rep->name= name; - rep->widthMM= rep->heightMM= 0; - rep->nProperties= rep->nColors= rep->nShapes= 0; - rep->nSections= rep->nDoodads= 0; - rep->nKeyAliases= 0; - rep->labelColorNdx= rep->baseColorNdx= 0; - } - return Success; -} - -static int -XkbSendGeometry( ClientPtr client, - XkbGeometryPtr geom, - xkbGetGeometryReply * rep, - Bool freeGeom) -{ - char *desc,*start; - int len; - - if (geom!=NULL) { - len= rep->length*4; - start= desc= malloc(len); - if (!start) - return BadAlloc; - desc= XkbWriteCountedString(desc,geom->label_font,client->swapped); - if ( rep->nProperties>0 ) - desc = XkbWriteGeomProperties(desc,geom,client->swapped); - if ( rep->nColors>0 ) - desc = XkbWriteGeomColors(desc,geom,client->swapped); - if ( rep->nShapes>0 ) - desc = XkbWriteGeomShapes(desc,geom,client->swapped); - if ( rep->nSections>0 ) - desc = XkbWriteGeomSections(desc,geom,client->swapped); - if ( rep->nDoodads>0 ) - desc = XkbWriteGeomDoodads(desc,geom->num_doodads,geom->doodads, - client->swapped); - if ( rep->nKeyAliases>0 ) - desc = XkbWriteGeomKeyAliases(desc,geom,client->swapped); - if ((desc-start)!=(len)) { - ErrorF("[xkb] BOGUS LENGTH in XkbSendGeometry, expected %d, got %ld\n", - len, (unsigned long)(desc-start)); - } - } - else { - len= 0; - 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); - } - WriteToClient(client, SIZEOF(xkbGetGeometryReply), (char *)rep); - if (len>0) - WriteToClient(client, len, start); - if (start!=NULL) - free((char *)start); - if (freeGeom) - XkbFreeGeometry(geom,XkbGeomAllMask,TRUE); - return Success; -} - -int -ProcXkbGetGeometry(ClientPtr client) -{ - DeviceIntPtr dev; - xkbGetGeometryReply rep; - XkbGeometryPtr geom; - Bool shouldFree; - Status status; - - REQUEST(xkbGetGeometryReq); - REQUEST_SIZE_MATCH(xkbGetGeometryReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); - CHK_ATOM_OR_NONE(stuff->name); - - geom= XkbLookupNamedGeometry(dev,stuff->name,&shouldFree); - rep.type= X_Reply; - rep.deviceID= dev->id; - rep.sequenceNumber= client->sequence; - rep.length= 0; - status= XkbComputeGetGeometryReplySize(geom,&rep,stuff->name); - if (status!=Success) - return status; - else return XkbSendGeometry(client,geom,&rep,shouldFree); -} - -/***====================================================================***/ - -static char * -_GetCountedString(char **wire_inout,Bool swap) -{ -char * wire,*str; -CARD16 len,*plen; - - wire= *wire_inout; - plen= (CARD16 *)wire; - if (swap) { - register int n; - swaps(plen,n); - } - len= *plen; - str= malloc(len+1); - if (str) { - memcpy(str,&wire[2],len); - str[len]= '\0'; - } - wire+= XkbPaddedSize(len+2); - *wire_inout= wire; - return str; -} - -static Status -_CheckSetDoodad( char ** wire_inout, - XkbGeometryPtr geom, - XkbSectionPtr section, - ClientPtr client) -{ -char * wire; -xkbDoodadWireDesc * dWire; -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); - } - CHK_ATOM_ONLY(dWire->any.name); - doodad= XkbAddGeomDoodad(geom,section,dWire->any.name); - if (!doodad) - return BadAlloc; - doodad->any.type= dWire->any.type; - doodad->any.priority= dWire->any.priority; - doodad->any.top= dWire->any.top; - doodad->any.left= dWire->any.left; - doodad->any.angle= dWire->any.angle; - switch (doodad->any.type) { - case XkbOutlineDoodad: - case XkbSolidDoodad: - if (dWire->shape.colorNdx>=geom->num_colors) { - client->errorValue= _XkbErrCode3(0x40,geom->num_colors, - dWire->shape.colorNdx); - return BadMatch; - } - if (dWire->shape.shapeNdx>=geom->num_shapes) { - client->errorValue= _XkbErrCode3(0x41,geom->num_shapes, - dWire->shape.shapeNdx); - return BadMatch; - } - doodad->shape.color_ndx= dWire->shape.colorNdx; - doodad->shape.shape_ndx= dWire->shape.shapeNdx; - break; - case XkbTextDoodad: - if (dWire->text.colorNdx>=geom->num_colors) { - client->errorValue= _XkbErrCode3(0x42,geom->num_colors, - dWire->text.colorNdx); - return BadMatch; - } - if (client->swapped) { - register int n; - swaps(&dWire->text.width,n); - swaps(&dWire->text.height,n); - } - doodad->text.width= dWire->text.width; - doodad->text.height= dWire->text.height; - doodad->text.color_ndx= dWire->text.colorNdx; - doodad->text.text= _GetCountedString(&wire,client->swapped); - doodad->text.font= _GetCountedString(&wire,client->swapped); - break; - case XkbIndicatorDoodad: - if (dWire->indicator.onColorNdx>=geom->num_colors) { - client->errorValue= _XkbErrCode3(0x43,geom->num_colors, - dWire->indicator.onColorNdx); - return BadMatch; - } - if (dWire->indicator.offColorNdx>=geom->num_colors) { - client->errorValue= _XkbErrCode3(0x44,geom->num_colors, - dWire->indicator.offColorNdx); - return BadMatch; - } - if (dWire->indicator.shapeNdx>=geom->num_shapes) { - client->errorValue= _XkbErrCode3(0x45,geom->num_shapes, - dWire->indicator.shapeNdx); - return BadMatch; - } - doodad->indicator.shape_ndx= dWire->indicator.shapeNdx; - doodad->indicator.on_color_ndx= dWire->indicator.onColorNdx; - doodad->indicator.off_color_ndx= dWire->indicator.offColorNdx; - break; - case XkbLogoDoodad: - if (dWire->logo.colorNdx>=geom->num_colors) { - client->errorValue= _XkbErrCode3(0x46,geom->num_colors, - dWire->logo.colorNdx); - return BadMatch; - } - if (dWire->logo.shapeNdx>=geom->num_shapes) { - client->errorValue= _XkbErrCode3(0x47,geom->num_shapes, - dWire->logo.shapeNdx); - return BadMatch; - } - doodad->logo.color_ndx= dWire->logo.colorNdx; - doodad->logo.shape_ndx= dWire->logo.shapeNdx; - doodad->logo.logo_name= _GetCountedString(&wire,client->swapped); - break; - default: - client->errorValue= _XkbErrCode2(0x4F,dWire->any.type); - return BadValue; - } - *wire_inout= wire; - return Success; -} - -static Status -_CheckSetOverlay( char ** wire_inout, - XkbGeometryPtr geom, - XkbSectionPtr section, - ClientPtr client) -{ -register int r; -char * wire; -XkbOverlayPtr ol; -xkbOverlayWireDesc * olWire; -xkbOverlayRowWireDesc * rWire; - - wire= *wire_inout; - olWire= (xkbOverlayWireDesc *)wire; - if (client->swapped) { - register int n; - swapl(&olWire->name,n); - } - CHK_ATOM_ONLY(olWire->name); - ol= XkbAddGeomOverlay(section,olWire->name,olWire->nRows); - rWire= (xkbOverlayRowWireDesc *)&olWire[1]; - for (r=0;rnRows;r++) { - register int k; - xkbOverlayKeyWireDesc * kWire; - XkbOverlayRowPtr row; - - if (rWire->rowUnder>section->num_rows) { - client->errorValue= _XkbErrCode4(0x20,r,section->num_rows, - rWire->rowUnder); - return BadMatch; - } - row= XkbAddGeomOverlayRow(ol,rWire->rowUnder,rWire->nKeys); - kWire= (xkbOverlayKeyWireDesc *)&rWire[1]; - for (k=0;knKeys;k++,kWire++) { - if (XkbAddGeomOverlayKey(ol,row, - (char *)kWire->over,(char *)kWire->under)==NULL) { - client->errorValue= _XkbErrCode3(0x21,r,k); - return BadMatch; - } - } - rWire= (xkbOverlayRowWireDesc *)kWire; - } - olWire= (xkbOverlayWireDesc *)rWire; - wire= (char *)olWire; - *wire_inout= wire; - return Success; -} - -static Status -_CheckSetSections( XkbGeometryPtr geom, - xkbSetGeometryReq * req, - char ** wire_inout, - ClientPtr client) -{ -Status status; -register int s; -char * wire; -xkbSectionWireDesc * sWire; -XkbSectionPtr section; - - wire= *wire_inout; - if (req->nSections<1) - return Success; - sWire= (xkbSectionWireDesc *)wire; - for (s=0;snSections;s++) { - 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); - } - CHK_ATOM_ONLY(sWire->name); - section= XkbAddGeomSection(geom,sWire->name,sWire->nRows, - sWire->nDoodads,sWire->nOverlays); - if (!section) - return BadAlloc; - section->priority= sWire->priority; - section->top= sWire->top; - section->left= sWire->left; - section->width= sWire->width; - section->height= sWire->height; - section->angle= sWire->angle; - rWire= (xkbRowWireDesc *)&sWire[1]; - for (r=0;rnRows;r++) { - register int k; - XkbRowPtr row; - xkbKeyWireDesc * kWire; - if (client->swapped) { - register int n; - swaps(&rWire->top,n); - swaps(&rWire->left,n); - } - row= XkbAddGeomRow(section,rWire->nKeys); - if (!row) - return BadAlloc; - row->top= rWire->top; - row->left= rWire->left; - row->vertical= rWire->vertical; - kWire= (xkbKeyWireDesc *)&rWire[1]; - for (k=0;knKeys;k++) { - XkbKeyPtr key; - key= XkbAddGeomKey(row); - if (!key) - return BadAlloc; - memcpy(key->name.name,kWire[k].name,XkbKeyNameLength); - key->gap= kWire[k].gap; - key->shape_ndx= kWire[k].shapeNdx; - key->color_ndx= kWire[k].colorNdx; - if (key->shape_ndx>=geom->num_shapes) { - client->errorValue= _XkbErrCode3(0x10,key->shape_ndx, - geom->num_shapes); - return BadMatch; - } - if (key->color_ndx>=geom->num_colors) { - client->errorValue= _XkbErrCode3(0x11,key->color_ndx, - geom->num_colors); - return BadMatch; - } - } - rWire= (xkbRowWireDesc *)&kWire[rWire->nKeys]; - } - wire= (char *)rWire; - if (sWire->nDoodads>0) { - register int d; - for (d=0;dnDoodads;d++) { - status=_CheckSetDoodad(&wire,geom,section,client); - if (status!=Success) - return status; - } - } - if (sWire->nOverlays>0) { - register int o; - for (o=0;onOverlays;o++) { - status= _CheckSetOverlay(&wire,geom,section,client); - if (status!=Success) - return status; - } - } - sWire= (xkbSectionWireDesc *)wire; - } - wire= (char *)sWire; - *wire_inout= wire; - return Success; -} - -static Status -_CheckSetShapes( XkbGeometryPtr geom, - xkbSetGeometryReq * req, - char ** wire_inout, - ClientPtr client) -{ -register int i; -char * wire; - - wire= *wire_inout; - if (req->nShapes<1) { - client->errorValue= _XkbErrCode2(0x06,req->nShapes); - return BadValue; - } - else { - xkbShapeWireDesc * shapeWire; - XkbShapePtr shape; - register int o; - shapeWire= (xkbShapeWireDesc *)wire; - for (i=0;inShapes;i++) { - xkbOutlineWireDesc * olWire; - XkbOutlinePtr ol; - shape= XkbAddGeomShape(geom,shapeWire->name,shapeWire->nOutlines); - if (!shape) - return BadAlloc; - olWire= (xkbOutlineWireDesc *)(&shapeWire[1]); - for (o=0;onOutlines;o++) { - register int p; - XkbPointPtr pt; - xkbPointWireDesc * ptWire; - - ol= XkbAddGeomOutline(shape,olWire->nPoints); - if (!ol) - return BadAlloc; - ol->corner_radius= olWire->cornerRadius; - ptWire= (xkbPointWireDesc *)&olWire[1]; - for (p=0,pt=ol->points;pnPoints;p++,pt++) { - pt->x= ptWire[p].x; - pt->y= ptWire[p].y; - if (client->swapped) { - register int n; - swaps(&pt->x,n); - swaps(&pt->y,n); - } - } - ol->num_points= olWire->nPoints; - olWire= (xkbOutlineWireDesc *)(&ptWire[olWire->nPoints]); - } - if (shapeWire->primaryNdx!=XkbNoShape) - shape->primary= &shape->outlines[shapeWire->primaryNdx]; - if (shapeWire->approxNdx!=XkbNoShape) - shape->approx= &shape->outlines[shapeWire->approxNdx]; - shapeWire= (xkbShapeWireDesc *)olWire; - } - wire= (char *)shapeWire; - } - if (geom->num_shapes!=req->nShapes) { - client->errorValue= _XkbErrCode3(0x07,geom->num_shapes,req->nShapes); - return BadMatch; - } - - *wire_inout= wire; - return Success; -} - -static Status -_CheckSetGeom( XkbGeometryPtr geom, - xkbSetGeometryReq * req, - ClientPtr client) -{ -register int i; -Status status; -char * wire; - - wire= (char *)&req[1]; - geom->label_font= _GetCountedString(&wire,client->swapped); - - for (i=0;inProperties;i++) { - char *name,*val; - name= _GetCountedString(&wire,client->swapped); - if (!name) - return BadAlloc; - val= _GetCountedString(&wire,client->swapped); - if (!val) { - free(name); - return BadAlloc; - } - if (XkbAddGeomProperty(geom,name,val)==NULL) { - free(name); - free(val); - return BadAlloc; - } - free(name); - free(val); - } - - if (req->nColors<2) { - client->errorValue= _XkbErrCode3(0x01,2,req->nColors); - return BadValue; - } - if (req->baseColorNdx>req->nColors) { - client->errorValue=_XkbErrCode3(0x03,req->nColors,req->baseColorNdx); - return BadMatch; - } - if (req->labelColorNdx>req->nColors) { - client->errorValue= _XkbErrCode3(0x03,req->nColors,req->labelColorNdx); - return BadMatch; - } - if (req->labelColorNdx==req->baseColorNdx) { - client->errorValue= _XkbErrCode3(0x04,req->baseColorNdx, - req->labelColorNdx); - return BadMatch; - } - - for (i=0;inColors;i++) { - char *name; - name= _GetCountedString(&wire,client->swapped); - if (!name) - return BadAlloc; - if (!XkbAddGeomColor(geom,name,geom->num_colors)) { - free(name); - return BadAlloc; - } - free(name); - } - if (req->nColors!=geom->num_colors) { - client->errorValue= _XkbErrCode3(0x05,req->nColors,geom->num_colors); - return BadMatch; - } - geom->label_color= &geom->colors[req->labelColorNdx]; - geom->base_color= &geom->colors[req->baseColorNdx]; - - if ((status=_CheckSetShapes(geom,req,&wire,client))!=Success) - return status; - - if ((status=_CheckSetSections(geom,req,&wire,client))!=Success) - return status; - - for (i=0;inDoodads;i++) { - status=_CheckSetDoodad(&wire,geom,NULL,client); - if (status!=Success) - return status; - } - - for (i=0;inKeyAliases;i++) { - if (XkbAddGeomKeyAlias(geom,&wire[XkbKeyNameLength],wire)==NULL) - return BadAlloc; - wire+= 2*XkbKeyNameLength; - } - return Success; -} - -static int -_XkbSetGeometry(ClientPtr client, DeviceIntPtr dev, xkbSetGeometryReq *stuff) -{ - XkbDescPtr xkb; - Bool new_name; - xkbNewKeyboardNotify nkn; - XkbGeometryPtr geom,old; - XkbGeometrySizesRec sizes; - Status status; - - xkb= dev->key->xkbInfo->desc; - old= xkb->geom; - xkb->geom= NULL; - - sizes.which= XkbGeomAllMask; - sizes.num_properties= stuff->nProperties; - sizes.num_colors= stuff->nColors; - sizes.num_shapes= stuff->nShapes; - sizes.num_sections= stuff->nSections; - sizes.num_doodads= stuff->nDoodads; - sizes.num_key_aliases= stuff->nKeyAliases; - if ((status= XkbAllocGeometry(xkb,&sizes))!=Success) { - xkb->geom= old; - return status; - } - geom= xkb->geom; - geom->name= stuff->name; - geom->width_mm= stuff->widthMM; - geom->height_mm= stuff->heightMM; - if ((status= _CheckSetGeom(geom,stuff,client))!=Success) { - XkbFreeGeometry(geom,XkbGeomAllMask,TRUE); - xkb->geom= old; - return status; - } - new_name= (xkb->names->geometry!=geom->name); - xkb->names->geometry= geom->name; - if (old) - XkbFreeGeometry(old,XkbGeomAllMask,TRUE); - if (new_name) { - xkbNamesNotify nn; - memset(&nn, 0, sizeof(xkbNamesNotify)); - nn.changed= XkbGeometryNameMask; - XkbSendNamesNotify(dev,&nn); - } - nkn.deviceID= nkn.oldDeviceID= dev->id; - nkn.minKeyCode= nkn.oldMinKeyCode= xkb->min_key_code; - nkn.maxKeyCode= nkn.oldMaxKeyCode= xkb->max_key_code; - nkn.requestMajor= XkbReqCode; - nkn.requestMinor= X_kbSetGeometry; - nkn.changed= XkbNKN_GeometryMask; - XkbSendNewKeyboardNotify(dev,&nkn); - return Success; -} - -int -ProcXkbSetGeometry(ClientPtr client) -{ - DeviceIntPtr dev; - int rc; - - REQUEST(xkbSetGeometryReq); - REQUEST_AT_LEAST_SIZE(xkbSetGeometryReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); - CHK_ATOM_OR_NONE(stuff->name); - - rc = _XkbSetGeometry(client, dev, stuff); - if (rc != Success) - return rc; - - if (stuff->deviceSpec == XkbUseCoreKbd) - { - DeviceIntPtr other; - for (other = inputInfo.devices; other; other = other->next) - { - if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) - { - rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); - if (rc == Success) - _XkbSetGeometry(client, other, stuff); - } - } - } - - return Success; -} - -/***====================================================================***/ - -int -ProcXkbPerClientFlags(ClientPtr client) -{ - DeviceIntPtr dev; - xkbPerClientFlagsReply rep; - XkbInterestPtr interest; - Mask access_mode = DixGetAttrAccess | DixSetAttrAccess; - - REQUEST(xkbPerClientFlagsReq); - REQUEST_SIZE_MATCH(xkbPerClientFlagsReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, access_mode); - CHK_MASK_LEGAL(0x01,stuff->change,XkbPCF_AllFlagsMask); - CHK_MASK_MATCH(0x02,stuff->change,stuff->value); - - interest = XkbFindClientResource((DevicePtr)dev,client); - memset(&rep, 0, sizeof(xkbPerClientFlagsReply)); - rep.type= X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - if (stuff->change) { - client->xkbClientFlags&= ~stuff->change; - client->xkbClientFlags|= stuff->value; - } - if (stuff->change&XkbPCF_AutoResetControlsMask) { - Bool want; - want= stuff->value&XkbPCF_AutoResetControlsMask; - if (interest && !want) { - interest->autoCtrls= interest->autoCtrlValues= 0; - } - else if (want && (!interest)) { - XID id = FakeClientID(client->index); - if (!AddResource(id,RT_XKBCLIENT,dev)) - return BadAlloc; - interest= XkbAddClientResource((DevicePtr)dev,client,id); - if (!interest) - return BadAlloc; - } - if (interest && want ) { - register unsigned affect; - affect= stuff->ctrlsToChange; - - CHK_MASK_LEGAL(0x03,affect,XkbAllBooleanCtrlsMask); - CHK_MASK_MATCH(0x04,affect,stuff->autoCtrls); - CHK_MASK_MATCH(0x05,stuff->autoCtrls,stuff->autoCtrlValues); - - interest->autoCtrls&= ~affect; - interest->autoCtrlValues&= ~affect; - interest->autoCtrls|= stuff->autoCtrls&affect; - interest->autoCtrlValues|= stuff->autoCtrlValues&affect; - } - } - rep.supported = XkbPCF_AllFlagsMask; - rep.value= client->xkbClientFlags&XkbPCF_AllFlagsMask; - if (interest) { - rep.autoCtrls= interest->autoCtrls; - rep.autoCtrlValues= interest->autoCtrlValues; - } - else { - 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); - } - WriteToClient(client,SIZEOF(xkbPerClientFlagsReply), (char *)&rep); - return Success; -} - -/***====================================================================***/ - -/* all latin-1 alphanumerics, plus parens, minus, underscore, slash */ -/* and wildcards */ -static unsigned char componentSpecLegal[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, 0xff, 0x87, - 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x07, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff -}; - -/* same as above but accepts percent, plus and bar too */ -static unsigned char componentExprLegal[] = { - 0x00, 0x00, 0x00, 0x00, 0x20, 0xaf, 0xff, 0x87, - 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x17, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff -}; - -static char * -GetComponentSpec(unsigned char **pWire,Bool allowExpr,int *errRtrn) -{ -int len; -register int i; -unsigned char *wire,*str,*tmp,*legal; - - if (allowExpr) legal= &componentExprLegal[0]; - else legal= &componentSpecLegal[0]; - - wire= *pWire; - len= (*(unsigned char *)wire++); - if (len>0) { - str= calloc(1, len+1); - if (str) { - tmp= str; - for (i=0;ixkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); - - status= Success; - str= (unsigned char *)&stuff[1]; - memset(&list, 0, sizeof(XkbSrvListInfoRec)); - list.maxRtrn= stuff->maxNames; - list.pattern[_XkbListKeycodes]= GetComponentSpec(&str,FALSE,&status); - list.pattern[_XkbListTypes]= GetComponentSpec(&str,FALSE,&status); - list.pattern[_XkbListCompat]= GetComponentSpec(&str,FALSE,&status); - list.pattern[_XkbListSymbols]= GetComponentSpec(&str,FALSE,&status); - list.pattern[_XkbListGeometry]= GetComponentSpec(&str,FALSE,&status); - if (status!=Success) - return status; - len= str-((unsigned char *)stuff); - if ((XkbPaddedSize(len)/4)!=stuff->length) - return BadLength; - if ((status=XkbDDXList(dev,&list,client))!=Success) { - free(list.pool); - list.pool = NULL; - return status; - } - memset(&rep, 0, sizeof(xkbListComponentsReply)); - rep.type= X_Reply; - rep.deviceID = dev->id; - rep.sequenceNumber = client->sequence; - rep.length = XkbPaddedSize(list.nPool)/4; - rep.nKeymaps = 0; - rep.nKeycodes = list.nFound[_XkbListKeycodes]; - rep.nTypes = list.nFound[_XkbListTypes]; - rep.nCompatMaps = list.nFound[_XkbListCompat]; - rep.nSymbols = list.nFound[_XkbListSymbols]; - rep.nGeometries = list.nFound[_XkbListGeometry]; - rep.extra= 0; - 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); - } - WriteToClient(client,SIZEOF(xkbListComponentsReply),(char *)&rep); - if (list.nPool && list.pool) { - WriteToClient(client,XkbPaddedSize(list.nPool), (char *)list.pool); - free(list.pool); - list.pool= NULL; - } - return Success; -} - -/***====================================================================***/ - -int -ProcXkbGetKbdByName(ClientPtr client) -{ - DeviceIntPtr dev; - DeviceIntPtr tmpd; - xkbGetKbdByNameReply rep; - xkbGetMapReply mrep; - xkbGetCompatMapReply crep; - xkbGetIndicatorMapReply irep; - xkbGetNamesReply nrep; - xkbGetGeometryReply grep; - XkbComponentNamesRec names; - XkbDescPtr xkb, new; - unsigned char * str; - char mapFile[PATH_MAX]; - unsigned len; - unsigned fwant,fneed,reported; - int status; - Bool geom_changed; - XkbSrvLedInfoPtr old_sli; - XkbSrvLedInfoPtr sli; - Mask access_mode = DixGetAttrAccess | DixManageAccess; - - REQUEST(xkbGetKbdByNameReq); - REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, access_mode); - - xkb = dev->key->xkbInfo->desc; - status= Success; - str= (unsigned char *)&stuff[1]; - if (GetComponentSpec(&str,TRUE,&status)) /* keymap, unsupported */ - return BadMatch; - names.keycodes= GetComponentSpec(&str,TRUE,&status); - names.types= GetComponentSpec(&str,TRUE,&status); - names.compat= GetComponentSpec(&str,TRUE,&status); - names.symbols= GetComponentSpec(&str,TRUE,&status); - names.geometry= GetComponentSpec(&str,TRUE,&status); - if (status!=Success) - return status; - len= str-((unsigned char *)stuff); - if ((XkbPaddedSize(len)/4)!=stuff->length) - return BadLength; - - CHK_MASK_LEGAL(0x01,stuff->want,XkbGBN_AllComponentsMask); - CHK_MASK_LEGAL(0x02,stuff->need,XkbGBN_AllComponentsMask); - - if (stuff->load) - fwant= XkbGBN_AllComponentsMask; - else fwant= stuff->want|stuff->need; - if ((!names.compat)&& - (fwant&(XkbGBN_CompatMapMask|XkbGBN_IndicatorMapMask))) { - names.compat= _XkbDupString("%"); - } - if ((!names.types)&&(fwant&(XkbGBN_TypesMask))) { - names.types= _XkbDupString("%"); - } - if ((!names.symbols)&&(fwant&XkbGBN_SymbolsMask)) { - names.symbols= _XkbDupString("%"); - } - geom_changed= ((names.geometry!=NULL)&&(strcmp(names.geometry,"%")!=0)); - if ((!names.geometry)&&(fwant&XkbGBN_GeometryMask)) { - names.geometry= _XkbDupString("%"); - geom_changed= FALSE; - } - - memset(mapFile, 0, PATH_MAX); - rep.type= X_Reply; - rep.deviceID = dev->id; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.minKeyCode = xkb->min_key_code; - rep.maxKeyCode = xkb->max_key_code; - rep.loaded= FALSE; - fwant= XkbConvertGetByNameComponents(TRUE,stuff->want)|XkmVirtualModsMask; - fneed= XkbConvertGetByNameComponents(TRUE,stuff->need); - rep.reported= XkbConvertGetByNameComponents(FALSE,fwant|fneed); - if (stuff->load) { - fneed|= XkmKeymapRequired; - fwant|= XkmKeymapLegal; - } - if ((fwant|fneed)&XkmSymbolsMask) { - fneed|= XkmKeyNamesIndex|XkmTypesIndex; - fwant|= XkmIndicatorsIndex; - } - - /* We pass dev in here so we can get the old names out if needed. */ - rep.found = XkbDDXLoadKeymapByNames(dev,&names,fwant,fneed,&new, - mapFile,PATH_MAX); - rep.newKeyboard= FALSE; - rep.pad1= rep.pad2= rep.pad3= rep.pad4= 0; - - stuff->want|= stuff->need; - if (new==NULL) - rep.reported= 0; - else { - if (stuff->load) - rep.loaded= TRUE; - if (stuff->load || - ((rep.reported&XkbGBN_SymbolsMask) && (new->compat))) { - XkbChangesRec changes; - memset(&changes, 0, sizeof(changes)); - XkbUpdateDescActions(new, - new->min_key_code,XkbNumKeys(new), - &changes); - } - - if (new->map==NULL) - rep.reported&= ~(XkbGBN_SymbolsMask|XkbGBN_TypesMask); - else if (rep.reported&(XkbGBN_SymbolsMask|XkbGBN_TypesMask)) { - mrep.type= X_Reply; - mrep.deviceID = dev->id; - mrep.sequenceNumber= client->sequence; - mrep.length = ((SIZEOF(xkbGetMapReply)-SIZEOF(xGenericReply))>>2); - mrep.minKeyCode = new->min_key_code; - mrep.maxKeyCode = new->max_key_code; - mrep.present = 0; - mrep.totalSyms = mrep.totalActs = - mrep.totalKeyBehaviors= mrep.totalKeyExplicit= - mrep.totalModMapKeys= mrep.totalVModMapKeys= 0; - if (rep.reported&(XkbGBN_TypesMask|XkbGBN_ClientSymbolsMask)) { - mrep.present|= XkbKeyTypesMask; - mrep.firstType = 0; - mrep.nTypes = mrep.totalTypes= new->map->num_types; - } - else { - mrep.firstType = mrep.nTypes= 0; - mrep.totalTypes= 0; - } - if (rep.reported&XkbGBN_ClientSymbolsMask) { - mrep.present|= (XkbKeySymsMask|XkbModifierMapMask); - mrep.firstKeySym = mrep.firstModMapKey= new->min_key_code; - mrep.nKeySyms = mrep.nModMapKeys= XkbNumKeys(new); - } - else { - mrep.firstKeySym= mrep.firstModMapKey= 0; - mrep.nKeySyms= mrep.nModMapKeys= 0; - } - if (rep.reported&XkbGBN_ServerSymbolsMask) { - mrep.present|= XkbAllServerInfoMask; - mrep.virtualMods= ~0; - mrep.firstKeyAct = mrep.firstKeyBehavior = - mrep.firstKeyExplicit = new->min_key_code; - mrep.nKeyActs = mrep.nKeyBehaviors = - mrep.nKeyExplicit = XkbNumKeys(new); - mrep.firstVModMapKey= new->min_key_code; - mrep.nVModMapKeys= XkbNumKeys(new); - } - else { - mrep.virtualMods= 0; - mrep.firstKeyAct= mrep.firstKeyBehavior= - mrep.firstKeyExplicit = 0; - mrep.nKeyActs= mrep.nKeyBehaviors= mrep.nKeyExplicit= 0; - } - XkbComputeGetMapReplySize(new,&mrep); - rep.length+= SIZEOF(xGenericReply)/4+mrep.length; - } - if (new->compat==NULL) - rep.reported&= ~XkbGBN_CompatMapMask; - else if (rep.reported&XkbGBN_CompatMapMask) { - crep.type= X_Reply; - crep.deviceID= dev->id; - crep.sequenceNumber= client->sequence; - crep.length= 0; - crep.groups= XkbAllGroupsMask; - crep.firstSI= 0; - crep.nSI= crep.nTotalSI= new->compat->num_si; - XkbComputeGetCompatMapReplySize(new->compat,&crep); - rep.length+= SIZEOF(xGenericReply)/4+crep.length; - } - if (new->indicators==NULL) - rep.reported&= ~XkbGBN_IndicatorMapMask; - else if (rep.reported&XkbGBN_IndicatorMapMask) { - irep.type= X_Reply; - irep.deviceID= dev->id; - irep.sequenceNumber= client->sequence; - irep.length= 0; - irep.which= XkbAllIndicatorsMask; - XkbComputeGetIndicatorMapReplySize(new->indicators,&irep); - rep.length+= SIZEOF(xGenericReply)/4+irep.length; - } - if (new->names==NULL) - rep.reported&= ~(XkbGBN_OtherNamesMask|XkbGBN_KeyNamesMask); - else if (rep.reported&(XkbGBN_OtherNamesMask|XkbGBN_KeyNamesMask)) { - nrep.type= X_Reply; - nrep.deviceID= dev->id; - nrep.sequenceNumber= client->sequence; - nrep.length= 0; - nrep.minKeyCode= new->min_key_code; - nrep.maxKeyCode= new->max_key_code; - if (rep.reported&XkbGBN_OtherNamesMask) { - nrep.which= XkbAllNamesMask; - if (new->map!=NULL) - nrep.nTypes= new->map->num_types; - else nrep.nTypes= 0; - nrep.nKTLevels= 0; - nrep.groupNames= XkbAllGroupsMask; - nrep.virtualMods= XkbAllVirtualModsMask; - nrep.indicators= XkbAllIndicatorsMask; - nrep.nRadioGroups= new->names->num_rg; - } - else { - nrep.which= 0; - nrep.nTypes= 0; - nrep.nKTLevels= 0; - nrep.groupNames= 0; - nrep.virtualMods= 0; - nrep.indicators= 0; - nrep.nRadioGroups= 0; - } - if (rep.reported&XkbGBN_KeyNamesMask) { - nrep.which|= XkbKeyNamesMask; - nrep.firstKey= new->min_key_code; - nrep.nKeys= XkbNumKeys(new); - nrep.nKeyAliases= new->names->num_key_aliases; - if (nrep.nKeyAliases) - nrep.which|= XkbKeyAliasesMask; - } - else { - nrep.which&= ~(XkbKeyNamesMask|XkbKeyAliasesMask); - nrep.firstKey= nrep.nKeys= 0; - nrep.nKeyAliases= 0; - } - XkbComputeGetNamesReplySize(new,&nrep); - rep.length+= SIZEOF(xGenericReply)/4+nrep.length; - } - if (new->geom==NULL) - rep.reported&= ~XkbGBN_GeometryMask; - else if (rep.reported&XkbGBN_GeometryMask) { - grep.type= X_Reply; - grep.deviceID= dev->id; - grep.sequenceNumber= client->sequence; - grep.length= 0; - grep.found= TRUE; - grep.pad= 0; - grep.widthMM= grep.heightMM= 0; - grep.nProperties= grep.nColors= grep.nShapes= 0; - grep.nSections= grep.nDoodads= 0; - grep.baseColorNdx= grep.labelColorNdx= 0; - XkbComputeGetGeometryReplySize(new->geom,&grep,None); - rep.length+= SIZEOF(xGenericReply)/4+grep.length; - } - } - - 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); - } - WriteToClient(client,SIZEOF(xkbGetKbdByNameReply), (char *)&rep); - if (reported&(XkbGBN_SymbolsMask|XkbGBN_TypesMask)) - XkbSendMap(client,new,&mrep); - if (reported&XkbGBN_CompatMapMask) - XkbSendCompatMap(client,new->compat,&crep); - if (reported&XkbGBN_IndicatorMapMask) - XkbSendIndicatorMap(client,new->indicators,&irep); - if (reported&(XkbGBN_KeyNamesMask|XkbGBN_OtherNamesMask)) - XkbSendNames(client,new,&nrep); - if (reported&XkbGBN_GeometryMask) - XkbSendGeometry(client,new->geom,&grep,FALSE); - if (rep.loaded) { - XkbDescPtr old_xkb; - xkbNewKeyboardNotify nkn; - int i,nG,nTG; - old_xkb= xkb; - xkb= new; - dev->key->xkbInfo->desc= xkb; - new= old_xkb; /* so it'll get freed automatically */ - - *xkb->ctrls= *old_xkb->ctrls; - for (nG=nTG=0,i=xkb->min_key_code;i<=xkb->max_key_code;i++) { - nG= XkbKeyNumGroups(xkb,i); - if (nG>=XkbNumKbdGroups) { - nTG= XkbNumKbdGroups; - break; - } - if (nG>nTG) { - nTG= nG; - } - } - xkb->ctrls->num_groups= nTG; - - for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { - if ((tmpd == dev) || (!IsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) { - if (tmpd != dev) - XkbCopyDeviceKeymap(tmpd, dev); - - if (tmpd->kbdfeed && tmpd->kbdfeed->xkb_sli) { - old_sli = tmpd->kbdfeed->xkb_sli; - tmpd->kbdfeed->xkb_sli = NULL; - sli = XkbAllocSrvLedInfo(tmpd, tmpd->kbdfeed, NULL, 0); - if (sli) { - sli->explicitState = old_sli->explicitState; - sli->effectiveState = old_sli->effectiveState; - } - tmpd->kbdfeed->xkb_sli = sli; - XkbFreeSrvLedInfo(old_sli); - } - } - } - - nkn.deviceID= nkn.oldDeviceID= dev->id; - nkn.minKeyCode= new->min_key_code; - nkn.maxKeyCode= new->max_key_code; - nkn.oldMinKeyCode= xkb->min_key_code; - nkn.oldMaxKeyCode= xkb->max_key_code; - nkn.requestMajor= XkbReqCode; - nkn.requestMinor= X_kbGetKbdByName; - nkn.changed= XkbNKN_KeycodesMask; - if (geom_changed) - nkn.changed|= XkbNKN_GeometryMask; - XkbSendNewKeyboardNotify(dev,&nkn); - - if (!IsMaster(dev) && dev->u.master) - { - DeviceIntPtr master = dev->u.master; - if (master->u.lastSlave == dev) - { - XkbCopyDeviceKeymap(dev->u.master, dev); - XkbSendNewKeyboardNotify(dev,&nkn); - } - } - } - if ((new!=NULL)&&(new!=xkb)) { - XkbFreeKeyboard(new,XkbAllComponentsMask,TRUE); - new= NULL; - } - free(names.keycodes); - names.keycodes = NULL; - free(names.types); - names.types = NULL; - free(names.compat); - names.compat = NULL; - free(names.symbols); - names.symbols = NULL; - free(names.geometry); - names.geometry = NULL; - return Success; -} - -/***====================================================================***/ - -static int -ComputeDeviceLedInfoSize( DeviceIntPtr dev, - unsigned int what, - XkbSrvLedInfoPtr sli) -{ -int nNames,nMaps; -register unsigned n,bit; - - if (sli==NULL) - return 0; - nNames= nMaps= 0; - if ((what&XkbXI_IndicatorNamesMask)==0) - sli->namesPresent= 0; - if ((what&XkbXI_IndicatorMapsMask)==0) - sli->mapsPresent= 0; - - for (n=0,bit=1;nnames && sli->names[n]!=None) { - sli->namesPresent|= bit; - nNames++; - } - if (sli->maps && XkbIM_InUse(&sli->maps[n])) { - sli->mapsPresent|= bit; - nMaps++; - } - } - return (nNames*4)+(nMaps*SIZEOF(xkbIndicatorMapWireDesc)); -} - -static int -CheckDeviceLedFBs( DeviceIntPtr dev, - int class, - int id, - xkbGetDeviceInfoReply * rep, - ClientPtr client) -{ -int nFBs= 0; -int length= 0; -Bool classOk; - - if (class==XkbDfltXIClass) { - if (dev->kbdfeed) class= KbdFeedbackClass; - else if (dev->leds) class= LedFeedbackClass; - else { - client->errorValue= _XkbErrCode2(XkbErr_BadClass,class); - return XkbKeyboardErrorCode; - } - } - classOk= FALSE; - if ((dev->kbdfeed)&&((class==KbdFeedbackClass)||(class==XkbAllXIClasses))) { - KbdFeedbackPtr kf; - classOk= TRUE; - for (kf= dev->kbdfeed;(kf);kf=kf->next) { - if ((id!=XkbAllXIIds)&&(id!=XkbDfltXIId)&&(id!=kf->ctrl.id)) - continue; - nFBs++; - length+= SIZEOF(xkbDeviceLedsWireDesc); - if (!kf->xkb_sli) - kf->xkb_sli= XkbAllocSrvLedInfo(dev,kf,NULL,0); - length+= ComputeDeviceLedInfoSize(dev,rep->present,kf->xkb_sli); - if (id!=XkbAllXIIds) - break; - } - } - if ((dev->leds)&&((class==LedFeedbackClass)||(class==XkbAllXIClasses))) { - LedFeedbackPtr lf; - classOk= TRUE; - for (lf= dev->leds;(lf);lf=lf->next) { - if ((id!=XkbAllXIIds)&&(id!=XkbDfltXIId)&&(id!=lf->ctrl.id)) - continue; - nFBs++; - length+= SIZEOF(xkbDeviceLedsWireDesc); - if (!lf->xkb_sli) - lf->xkb_sli= XkbAllocSrvLedInfo(dev,NULL,lf,0); - length+= ComputeDeviceLedInfoSize(dev,rep->present,lf->xkb_sli); - if (id!=XkbAllXIIds) - break; - } - } - if (nFBs>0) { - rep->nDeviceLedFBs= nFBs; - rep->length+= (length/4); - return Success; - } - if (classOk) client->errorValue= _XkbErrCode2(XkbErr_BadId,id); - else client->errorValue= _XkbErrCode2(XkbErr_BadClass,class); - return XkbKeyboardErrorCode; -} - -static int -SendDeviceLedInfo( XkbSrvLedInfoPtr sli, - ClientPtr client) -{ -xkbDeviceLedsWireDesc wire; -int length; - - length= 0; - wire.ledClass= sli->class; - wire.ledID= sli->id; - wire.namesPresent= sli->namesPresent; - wire.mapsPresent= sli->mapsPresent; - 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); - } - WriteToClient(client,SIZEOF(xkbDeviceLedsWireDesc),(char *)&wire); - length+= SIZEOF(xkbDeviceLedsWireDesc); - if (sli->namesPresent|sli->mapsPresent) { - register unsigned i,bit; - if (sli->namesPresent) { - CARD32 awire; - for (i=0,bit=1;inamesPresent&bit) { - awire= (CARD32)sli->names[i]; - if (client->swapped) { - register int n; - swapl(&awire,n); - } - WriteToClient(client,4,(char *)&awire); - length+= 4; - } - } - } - if (sli->mapsPresent) { - for (i=0,bit=1;imapsPresent&bit) { - iwire.flags= sli->maps[i].flags; - iwire.whichGroups= sli->maps[i].which_groups; - iwire.groups= sli->maps[i].groups; - iwire.whichMods= sli->maps[i].which_mods; - iwire.mods= sli->maps[i].mods.mask; - iwire.realMods= sli->maps[i].mods.real_mods; - 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); - } - WriteToClient(client,SIZEOF(xkbIndicatorMapWireDesc), - (char *)&iwire); - length+= SIZEOF(xkbIndicatorMapWireDesc); - } - } - } - } - return length; -} - -static int -SendDeviceLedFBs( DeviceIntPtr dev, - int class, - int id, - unsigned wantLength, - ClientPtr client) -{ -int length= 0; - - if (class==XkbDfltXIClass) { - if (dev->kbdfeed) class= KbdFeedbackClass; - else if (dev->leds) class= LedFeedbackClass; - } - if ((dev->kbdfeed)&& - ((class==KbdFeedbackClass)||(class==XkbAllXIClasses))) { - KbdFeedbackPtr kf; - for (kf= dev->kbdfeed;(kf);kf=kf->next) { - if ((id==XkbAllXIIds)||(id==XkbDfltXIId)||(id==kf->ctrl.id)) { - length+= SendDeviceLedInfo(kf->xkb_sli,client); - if (id!=XkbAllXIIds) - break; - } - } - } - if ((dev->leds)&& - ((class==LedFeedbackClass)||(class==XkbAllXIClasses))) { - LedFeedbackPtr lf; - for (lf= dev->leds;(lf);lf=lf->next) { - if ((id==XkbAllXIIds)||(id==XkbDfltXIId)||(id==lf->ctrl.id)) { - length+= SendDeviceLedInfo(lf->xkb_sli,client); - if (id!=XkbAllXIIds) - break; - } - } - } - if (length==wantLength) - return Success; - else return BadLength; -} - -int -ProcXkbGetDeviceInfo(ClientPtr client) -{ -DeviceIntPtr dev; -xkbGetDeviceInfoReply rep; -int status,nDeviceLedFBs; -unsigned length,nameLen; -CARD16 ledClass,ledID; -unsigned wanted; -char * str; - - REQUEST(xkbGetDeviceInfoReq); - REQUEST_SIZE_MATCH(xkbGetDeviceInfoReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - wanted= stuff->wanted; - - CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); - CHK_MASK_LEGAL(0x01,wanted,XkbXI_AllDeviceFeaturesMask); - - if ((!dev->button)||((stuff->nBtns<1)&&(!stuff->allBtns))) - wanted&= ~XkbXI_ButtonActionsMask; - if ((!dev->kbdfeed)&&(!dev->leds)) - wanted&= ~XkbXI_IndicatorsMask; - - nameLen= XkbSizeCountedString(dev->name); - memset((char *)&rep, 0, SIZEOF(xkbGetDeviceInfoReply)); - rep.type = X_Reply; - rep.deviceID= dev->id; - rep.sequenceNumber = client->sequence; - rep.length = nameLen/4; - rep.present = wanted; - rep.supported = XkbXI_AllDeviceFeaturesMask; - rep.unsupported = 0; - rep.firstBtnWanted = rep.nBtnsWanted = 0; - rep.firstBtnRtrn = rep.nBtnsRtrn = 0; - if (dev->button) - rep.totalBtns= dev->button->numButtons; - else rep.totalBtns= 0; - rep.devType= dev->xinput_type; - rep.hasOwnState= (dev->key && dev->key->xkbInfo); - rep.nDeviceLedFBs = 0; - if (dev->kbdfeed) rep.dfltKbdFB= dev->kbdfeed->ctrl.id; - else rep.dfltKbdFB= XkbXINone; - if (dev->leds) rep.dfltLedFB= dev->leds->ctrl.id; - else rep.dfltLedFB= XkbXINone; - - ledClass= stuff->ledClass; - ledID= stuff->ledID; - - rep.firstBtnWanted= rep.nBtnsWanted= 0; - rep.firstBtnRtrn= rep.nBtnsRtrn= 0; - if (wanted&XkbXI_ButtonActionsMask) { - if (stuff->allBtns) { - stuff->firstBtn= 0; - stuff->nBtns= dev->button->numButtons; - } - - if ((stuff->firstBtn+stuff->nBtns)>dev->button->numButtons) { - client->errorValue = _XkbErrCode4(0x02,dev->button->numButtons, - stuff->firstBtn, - stuff->nBtns); - return BadValue; - } - else { - rep.firstBtnWanted= stuff->firstBtn; - rep.nBtnsWanted= stuff->nBtns; - if (dev->button->xkb_acts!=NULL) { - XkbAction *act; - register int i; - - rep.firstBtnRtrn= stuff->firstBtn; - rep.nBtnsRtrn= stuff->nBtns; - act= &dev->button->xkb_acts[rep.firstBtnWanted]; - for (i=0;itype!=XkbSA_NoAction) - break; - } - rep.firstBtnRtrn+= i; - rep.nBtnsRtrn-= i; - act= &dev->button->xkb_acts[rep.firstBtnRtrn+rep.nBtnsRtrn-1]; - for (i=0;itype!=XkbSA_NoAction) - break; - } - rep.nBtnsRtrn-= i; - } - rep.length+= (rep.nBtnsRtrn*SIZEOF(xkbActionWireDesc))/4; - } - } - - if (wanted&XkbXI_IndicatorsMask) { - status= CheckDeviceLedFBs(dev,ledClass,ledID,&rep,client); - if (status!=Success) - return status; - } - 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); - } - WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), (char *)&rep); - - str= malloc(nameLen); - if (!str) - return BadAlloc; - XkbWriteCountedString(str,dev->name,client->swapped); - WriteToClient(client,nameLen,str); - free(str); - length-= nameLen; - - if (rep.nBtnsRtrn>0) { - int sz; - xkbActionWireDesc * awire; - sz= rep.nBtnsRtrn*SIZEOF(xkbActionWireDesc); - awire= (xkbActionWireDesc *)&dev->button->xkb_acts[rep.firstBtnRtrn]; - WriteToClient(client,sz,(char *)awire); - length-= sz; - } - if (nDeviceLedFBs>0) { - status= SendDeviceLedFBs(dev,ledClass,ledID,length,client); - if (status!=Success) - return status; - } - else if (length!=0) { - ErrorF("[xkb] Internal Error! BadLength in ProcXkbGetDeviceInfo\n"); - ErrorF("[xkb] Wrote %d fewer bytes than expected\n",length); - return BadLength; - } - return Success; -} - -static char * -CheckSetDeviceIndicators( char * wire, - DeviceIntPtr dev, - int num, - int * status_rtrn, - ClientPtr client) -{ -xkbDeviceLedsWireDesc * ledWire; -int i; -XkbSrvLedInfoPtr sli; - - ledWire= (xkbDeviceLedsWireDesc *)wire; - for (i=0;iswapped) { - register int n; - swaps(&ledWire->ledClass,n); - swaps(&ledWire->ledID,n); - swapl(&ledWire->namesPresent,n); - swapl(&ledWire->mapsPresent,n); - swapl(&ledWire->physIndicators,n); - } - - sli= XkbFindSrvLedInfo(dev,ledWire->ledClass,ledWire->ledID, - XkbXI_IndicatorsMask); - if (sli!=NULL) { - register int n; - register unsigned bit; - int nMaps,nNames; - CARD32 *atomWire; - xkbIndicatorMapWireDesc *mapWire; - - nMaps= nNames= 0; - for (n=0,bit=1;nnamesPresent&bit) - nNames++; - if (ledWire->mapsPresent&bit) - nMaps++; - } - atomWire= (CARD32 *)&ledWire[1]; - if (nNames>0) { - for (n=0;nswapped) { - register int t; - swapl(atomWire,t); - } - CHK_ATOM_OR_NONE3(((Atom)(*atomWire)),client->errorValue, - *status_rtrn,NULL); - atomWire++; - } - } - mapWire= (xkbIndicatorMapWireDesc *)atomWire; - if (nMaps>0) { - for (n=0;nswapped) { - register int t; - swaps(&mapWire->virtualMods,t); - swapl(&mapWire->ctrls,t); - } - CHK_MASK_LEGAL3(0x21,mapWire->whichGroups, - XkbIM_UseAnyGroup, - client->errorValue, - *status_rtrn,NULL); - CHK_MASK_LEGAL3(0x22,mapWire->whichMods,XkbIM_UseAnyMods, - client->errorValue, - *status_rtrn,NULL); - mapWire++; - } - } - ledWire= (xkbDeviceLedsWireDesc *)mapWire; - } - else { - /* SHOULD NEVER HAPPEN */ - return (char *)ledWire; - } - } - return (char *)ledWire; -} - -static char * -SetDeviceIndicators( char * wire, - DeviceIntPtr dev, - unsigned changed, - int num, - int * status_rtrn, - ClientPtr client, - xkbExtensionDeviceNotify *ev) -{ -xkbDeviceLedsWireDesc * ledWire; -int i; -XkbEventCauseRec cause; -unsigned namec,mapc,statec; -xkbExtensionDeviceNotify ed; -XkbChangesRec changes; -DeviceIntPtr kbd; - - memset((char *)&ed, 0, sizeof(xkbExtensionDeviceNotify)); - memset((char *)&changes, 0, sizeof(XkbChangesRec)); - XkbSetCauseXkbReq(&cause,X_kbSetDeviceInfo,client); - ledWire= (xkbDeviceLedsWireDesc *)wire; - for (i=0;iledClass,ledWire->ledID, - XkbXI_IndicatorMapsMask); - if (!sli) { - /* SHOULD NEVER HAPPEN!! */ - return (char *)ledWire; - } - - atomWire= (CARD32 *)&ledWire[1]; - if (changed&XkbXI_IndicatorNamesMask) { - namec= sli->namesPresent|ledWire->namesPresent; - memset((char *)sli->names, 0, XkbNumIndicators*sizeof(Atom)); - } - if (ledWire->namesPresent) { - sli->namesPresent= ledWire->namesPresent; - memset((char *)sli->names, 0, XkbNumIndicators*sizeof(Atom)); - for (n=0,bit=1;nnamesPresent&bit) { - sli->names[n]= (Atom)*atomWire; - if (sli->names[n]==None) - ledWire->namesPresent&= ~bit; - atomWire++; - } - } - } - mapWire= (xkbIndicatorMapWireDesc *)atomWire; - if (changed&XkbXI_IndicatorMapsMask) { - mapc= sli->mapsPresent|ledWire->mapsPresent; - sli->mapsPresent= ledWire->mapsPresent; - memset((char*)sli->maps, 0, XkbNumIndicators*sizeof(XkbIndicatorMapRec)); - } - if (ledWire->mapsPresent) { - for (n=0,bit=1;nmapsPresent&bit) { - sli->maps[n].flags= mapWire->flags; - sli->maps[n].which_groups= mapWire->whichGroups; - sli->maps[n].groups= mapWire->groups; - sli->maps[n].which_mods= mapWire->whichMods; - sli->maps[n].mods.mask= mapWire->mods; - sli->maps[n].mods.real_mods=mapWire->realMods; - sli->maps[n].mods.vmods= mapWire->virtualMods; - sli->maps[n].ctrls= mapWire->ctrls; - mapWire++; - } - } - } - if (changed&XkbXI_IndicatorStateMask) { - statec= sli->effectiveState^ledWire->state; - sli->explicitState&= ~statec; - sli->explicitState|= (ledWire->state&statec); - } - if (namec) - XkbApplyLedNameChanges(dev,sli,namec,&ed,&changes,&cause); - if (mapc) - XkbApplyLedMapChanges(dev,sli,mapc,&ed,&changes,&cause); - if (statec) - XkbApplyLedStateChanges(dev,sli,statec,&ed,&changes,&cause); - - kbd= dev; - if ((sli->flags&XkbSLI_HasOwnState)==0) - kbd = inputInfo.keyboard; - - XkbFlushLedEvents(dev,kbd,sli,&ed,&changes,&cause); - ledWire= (xkbDeviceLedsWireDesc *)mapWire; - } - return (char *)ledWire; -} - - -static int -_XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, - xkbSetDeviceInfoReq *stuff) -{ - char *wire; - - wire= (char *)&stuff[1]; - if (stuff->change&XkbXI_ButtonActionsMask) { - if (!dev->button) { - client->errorValue = _XkbErrCode2(XkbErr_BadClass,ButtonClass); - return XkbKeyboardErrorCode; - } - if ((stuff->firstBtn+stuff->nBtns)>dev->button->numButtons) { - client->errorValue= _XkbErrCode4(0x02,stuff->firstBtn,stuff->nBtns, - dev->button->numButtons); - return BadMatch; - } - wire+= (stuff->nBtns*SIZEOF(xkbActionWireDesc)); - } - if (stuff->change&XkbXI_IndicatorsMask) { - int status= Success; - wire= CheckSetDeviceIndicators(wire,dev,stuff->nDeviceLedFBs, - &status,client); - if (status!=Success) - return status; - } - if (((wire-((char *)stuff))/4)!=stuff->length) - return BadLength; - - return Success; -} - -static int -_XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, - xkbSetDeviceInfoReq *stuff) -{ - char *wire; - xkbExtensionDeviceNotify ed; - - memset((char *)&ed, 0, SIZEOF(xkbExtensionDeviceNotify)); - ed.deviceID= dev->id; - wire= (char *)&stuff[1]; - if (stuff->change&XkbXI_ButtonActionsMask) { - int nBtns,sz,i; - XkbAction * acts; - DeviceIntPtr kbd; - - nBtns= dev->button->numButtons; - acts= dev->button->xkb_acts; - if (acts==NULL) { - acts= calloc(nBtns, sizeof(XkbAction)); - if (!acts) - return BadAlloc; - dev->button->xkb_acts= acts; - } - sz= stuff->nBtns*SIZEOF(xkbActionWireDesc); - memcpy((char *)&acts[stuff->firstBtn],(char *)wire,sz); - wire+= sz; - ed.reason|= XkbXI_ButtonActionsMask; - ed.firstBtn= stuff->firstBtn; - ed.nBtns= stuff->nBtns; - - if (dev->key) kbd= dev; - else kbd= inputInfo.keyboard; - acts= &dev->button->xkb_acts[stuff->firstBtn]; - for (i=0;inBtns;i++,acts++) { - if (acts->type!=XkbSA_NoAction) - XkbSetActionKeyMods(kbd->key->xkbInfo->desc,acts,0); - } - } - if (stuff->change&XkbXI_IndicatorsMask) { - int status= Success; - wire= SetDeviceIndicators(wire,dev,stuff->change, - stuff->nDeviceLedFBs, &status,client,&ed); - if (status!=Success) - return status; - } - if ((stuff->change)&&(ed.reason)) - XkbSendExtensionDeviceNotify(dev,client,&ed); - return Success; -} - -int -ProcXkbSetDeviceInfo(ClientPtr client) -{ - DeviceIntPtr dev; - int rc; - - REQUEST(xkbSetDeviceInfoReq); - REQUEST_AT_LEAST_SIZE(xkbSetDeviceInfoReq); - - if (!(client->xkbClientFlags&_XkbClientInitialized)) - return BadAccess; - - CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); - CHK_MASK_LEGAL(0x01,stuff->change,XkbXI_AllFeaturesMask); - - rc = _XkbSetDeviceInfoCheck(client, dev, stuff); - - if (rc != Success) - return rc; - - if (stuff->deviceSpec == XkbUseCoreKbd || stuff->deviceSpec == XkbUseCorePtr) - { - DeviceIntPtr other; - for (other = inputInfo.devices; other; other = other->next) - { - if (((other != dev) && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) && - ((stuff->deviceSpec == XkbUseCoreKbd && other->key) || - (stuff->deviceSpec == XkbUseCorePtr && other->button))) - { - rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); - if (rc == Success) - { - rc = _XkbSetDeviceInfoCheck(client, other, stuff); - if (rc != Success) - return rc; - } - } - } - } - - /* checks done, apply */ - rc = _XkbSetDeviceInfo(client, dev, stuff); - if (rc != Success) - return rc; - - if (stuff->deviceSpec == XkbUseCoreKbd || stuff->deviceSpec == XkbUseCorePtr) - { - DeviceIntPtr other; - for (other = inputInfo.devices; other; other = other->next) - { - if (((other != dev) && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) && - ((stuff->deviceSpec == XkbUseCoreKbd && other->key) || - (stuff->deviceSpec == XkbUseCorePtr && other->button))) - { - rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); - if (rc == Success) - { - rc = _XkbSetDeviceInfo(client, other, stuff); - if (rc != Success) - return rc; - } - } - } - } - - return Success; -} - -/***====================================================================***/ - -int -ProcXkbSetDebuggingFlags(ClientPtr client) -{ -CARD32 newFlags,newCtrls,extraLength; -xkbSetDebuggingFlagsReply rep; -int rc; - - REQUEST(xkbSetDebuggingFlagsReq); - REQUEST_AT_LEAST_SIZE(xkbSetDebuggingFlagsReq); - - rc = XaceHook(XACE_SERVER_ACCESS, client, DixDebugAccess); - if (rc != Success) - return rc; - - newFlags= xkbDebugFlags&(~stuff->affectFlags); - newFlags|= (stuff->flags&stuff->affectFlags); - newCtrls= xkbDebugCtrls&(~stuff->affectCtrls); - newCtrls|= (stuff->ctrls&stuff->affectCtrls); - if (xkbDebugFlags || newFlags || stuff->msgLength) { - ErrorF("[xkb] XkbDebug: Setting debug flags to 0x%lx\n",(long)newFlags); - if (newCtrls!=xkbDebugCtrls) - ErrorF("[xkb] XkbDebug: Setting debug controls to 0x%lx\n",(long)newCtrls); - } - extraLength= (stuff->length<<2)-sz_xkbSetDebuggingFlagsReq; - if (stuff->msgLength>0) { - char *msg; - if (extraLengthmsgLength)) { - ErrorF("[xkb] XkbDebug: msgLength= %d, length= %ld (should be %d)\n", - stuff->msgLength,(long)extraLength, - XkbPaddedSize(stuff->msgLength)); - return BadLength; - } - msg= (char *)&stuff[1]; - if (msg[stuff->msgLength-1]!='\0') { - ErrorF("[xkb] XkbDebug: message not null-terminated\n"); - return BadValue; - } - ErrorF("[xkb] XkbDebug: %s\n",msg); - } - xkbDebugFlags = newFlags; - xkbDebugCtrls = newCtrls; - - rep.type= X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.currentFlags = newFlags; - rep.currentCtrls = newCtrls; - 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); - } - WriteToClient(client,SIZEOF(xkbSetDebuggingFlagsReply), (char *)&rep); - return Success; -} - -/***====================================================================***/ - -static int -ProcXkbDispatch (ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_kbUseExtension: - return ProcXkbUseExtension(client); - case X_kbSelectEvents: - return ProcXkbSelectEvents(client); - case X_kbBell: - return ProcXkbBell(client); - case X_kbGetState: - return ProcXkbGetState(client); - case X_kbLatchLockState: - return ProcXkbLatchLockState(client); - case X_kbGetControls: - return ProcXkbGetControls(client); - case X_kbSetControls: - return ProcXkbSetControls(client); - case X_kbGetMap: - return ProcXkbGetMap(client); - case X_kbSetMap: - return ProcXkbSetMap(client); - case X_kbGetCompatMap: - return ProcXkbGetCompatMap(client); - case X_kbSetCompatMap: - return ProcXkbSetCompatMap(client); - case X_kbGetIndicatorState: - return ProcXkbGetIndicatorState(client); - case X_kbGetIndicatorMap: - return ProcXkbGetIndicatorMap(client); - case X_kbSetIndicatorMap: - return ProcXkbSetIndicatorMap(client); - case X_kbGetNamedIndicator: - return ProcXkbGetNamedIndicator(client); - case X_kbSetNamedIndicator: - return ProcXkbSetNamedIndicator(client); - case X_kbGetNames: - return ProcXkbGetNames(client); - case X_kbSetNames: - return ProcXkbSetNames(client); - case X_kbGetGeometry: - return ProcXkbGetGeometry(client); - case X_kbSetGeometry: - return ProcXkbSetGeometry(client); - case X_kbPerClientFlags: - return ProcXkbPerClientFlags(client); - case X_kbListComponents: - return ProcXkbListComponents(client); - case X_kbGetKbdByName: - return ProcXkbGetKbdByName(client); - case X_kbGetDeviceInfo: - return ProcXkbGetDeviceInfo(client); - case X_kbSetDeviceInfo: - return ProcXkbSetDeviceInfo(client); - case X_kbSetDebuggingFlags: - return ProcXkbSetDebuggingFlags(client); - default: - return BadRequest; - } -} - -static int -XkbClientGone(pointer data,XID id) -{ - DevicePtr pXDev = (DevicePtr)data; - - if (!XkbRemoveResourceClient(pXDev,id)) { - ErrorF("[xkb] Internal Error! bad RemoveResourceClient in XkbClientGone\n"); - } - return 1; -} - -void -XkbExtensionInit(void) -{ - ExtensionEntry *extEntry; - - RT_XKBCLIENT = CreateNewResourceType(XkbClientGone, "XkbClient"); - if (!RT_XKBCLIENT) - return; - - if (!XkbInitPrivates()) - return; - - if ((extEntry = AddExtension(XkbName, XkbNumberEvents, XkbNumberErrors, - ProcXkbDispatch, SProcXkbDispatch, - NULL, StandardMinorOpcode))) { - XkbReqCode = (unsigned char)extEntry->base; - XkbEventBase = (unsigned char)extEntry->eventBase; - XkbErrorBase = (unsigned char)extEntry->errorBase; - XkbKeyboardErrorCode = XkbErrorBase+XkbKeyboard; - } - return; -} - - +/************************************************************ +Copyright (c) 1993 by Silicon Graphics Computer Systems, Inc. + +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 Silicon Graphics not be +used in advertising or publicity pertaining to distribution +of the software without specific prior written permission. +Silicon Graphics makes no representation about the suitability +of this software for any purpose. It is provided "as is" +without any express or implied warranty. + +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON +GRAPHICS 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 +#endif + +#include +#include +#include +#include "misc.h" +#include "inputstr.h" +#define XKBSRV_NEED_FILE_FUNCS +#include +#include "extnsionst.h" +#include "xace.h" +#include "xkb.h" +#include "protocol-versions.h" + +#include +#include + +int XkbEventBase; +static int XkbErrorBase; +int XkbReqCode; +int XkbKeyboardErrorCode; +CARD32 xkbDebugFlags = 0; +static CARD32 xkbDebugCtrls = 0; + +static RESTYPE RT_XKBCLIENT; + +/***====================================================================***/ + +#define CHK_DEVICE(dev, id, client, access_mode, lf) {\ + int why;\ + int rc = lf(&(dev), id, client, access_mode, &why);\ + if (rc != Success) {\ + client->errorValue = _XkbErrCode2(why, id);\ + return rc;\ + }\ +} + +#define CHK_KBD_DEVICE(dev, id, client, mode) \ + CHK_DEVICE(dev, id, client, mode, _XkbLookupKeyboard) +#define CHK_LED_DEVICE(dev, id, client, mode) \ + CHK_DEVICE(dev, id, client, mode, _XkbLookupLedDevice) +#define CHK_BELL_DEVICE(dev, id, client, mode) \ + CHK_DEVICE(dev, id, client, mode, _XkbLookupBellDevice) +#define CHK_ANY_DEVICE(dev, id, client, mode) \ + CHK_DEVICE(dev, id, client, mode, _XkbLookupAnyDevice) + +#define CHK_ATOM_ONLY2(a,ev,er) {\ + if (((a)==None)||(!ValidAtom((a)))) {\ + (ev)= (XID)(a);\ + return er;\ + }\ +} +#define CHK_ATOM_ONLY(a) \ + CHK_ATOM_ONLY2(a,client->errorValue,BadAtom) + +#define CHK_ATOM_OR_NONE3(a,ev,er,ret) {\ + if (((a)!=None)&&(!ValidAtom((a)))) {\ + (ev)= (XID)(a);\ + (er)= BadAtom;\ + return ret;\ + }\ +} +#define CHK_ATOM_OR_NONE2(a,ev,er) {\ + if (((a)!=None)&&(!ValidAtom((a)))) {\ + (ev)= (XID)(a);\ + return er;\ + }\ +} +#define CHK_ATOM_OR_NONE(a) \ + CHK_ATOM_OR_NONE2(a,client->errorValue,BadAtom) + +#define CHK_MASK_LEGAL3(err,mask,legal,ev,er,ret) {\ + if ((mask)&(~(legal))) { \ + (ev)= _XkbErrCode2((err),((mask)&(~(legal))));\ + (er)= BadValue;\ + return ret;\ + }\ +} +#define CHK_MASK_LEGAL2(err,mask,legal,ev,er) {\ + if ((mask)&(~(legal))) { \ + (ev)= _XkbErrCode2((err),((mask)&(~(legal))));\ + return er;\ + }\ +} +#define CHK_MASK_LEGAL(err,mask,legal) \ + CHK_MASK_LEGAL2(err,mask,legal,client->errorValue,BadValue) + +#define CHK_MASK_MATCH(err,affect,value) {\ + if ((value)&(~(affect))) { \ + client->errorValue= _XkbErrCode2((err),((value)&(~(affect))));\ + return BadMatch;\ + }\ +} +#define CHK_MASK_OVERLAP(err,m1,m2) {\ + if ((m1)&(m2)) { \ + client->errorValue= _XkbErrCode2((err),((m1)&(m2)));\ + return BadMatch;\ + }\ +} +#define CHK_KEY_RANGE2(err,first,num,x,ev,er) {\ + if (((unsigned)(first)+(num)-1)>(x)->max_key_code) {\ + (ev)=_XkbErrCode4(err,(first),(num),(x)->max_key_code);\ + return er;\ + }\ + else if ( (first)<(x)->min_key_code ) {\ + (ev)=_XkbErrCode3(err+1,(first),xkb->min_key_code);\ + return er;\ + }\ +} +#define CHK_KEY_RANGE(err,first,num,x) \ + CHK_KEY_RANGE2(err,first,num,x,client->errorValue,BadValue) + +#define CHK_REQ_KEY_RANGE2(err,first,num,r,ev,er) {\ + if (((unsigned)(first)+(num)-1)>(r)->maxKeyCode) {\ + (ev)=_XkbErrCode4(err,(first),(num),(r)->maxKeyCode);\ + return er;\ + }\ + else if ( (first)<(r)->minKeyCode ) {\ + (ev)=_XkbErrCode3(err+1,(first),(r)->minKeyCode);\ + return er;\ + }\ +} +#define CHK_REQ_KEY_RANGE(err,first,num,r) \ + CHK_REQ_KEY_RANGE2(err,first,num,r,client->errorValue,BadValue) + +/***====================================================================***/ + +int +ProcXkbUseExtension(ClientPtr client) +{ + REQUEST(xkbUseExtensionReq); + xkbUseExtensionReply rep; + register int n; + int supported; + + REQUEST_SIZE_MATCH(xkbUseExtensionReq); + if (stuff->wantedMajor != SERVER_XKB_MAJOR_VERSION) { + /* pre-release version 0.65 is compatible with 1.00 */ + supported= ((SERVER_XKB_MAJOR_VERSION==1)&& + (stuff->wantedMajor==0)&&(stuff->wantedMinor==65)); + } + else supported = 1; + + if ((supported) && (!(client->xkbClientFlags&_XkbClientInitialized))) { + client->xkbClientFlags= _XkbClientInitialized; + client->vMajor= stuff->wantedMajor; + client->vMinor= stuff->wantedMinor; + } + else if (xkbDebugFlags&0x1) { + ErrorF("[xkb] Rejecting client %d (0x%lx) (wants %d.%02d, have %d.%02d)\n", + client->index, + (long)client->clientAsMask, + stuff->wantedMajor,stuff->wantedMinor, + SERVER_XKB_MAJOR_VERSION,SERVER_XKB_MINOR_VERSION); + } + memset(&rep, 0, sizeof(xkbUseExtensionReply)); + rep.type = X_Reply; + rep.supported = supported; + rep.length = 0; + rep.sequenceNumber = client->sequence; + 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); + } + WriteToClient(client,SIZEOF(xkbUseExtensionReply), (char *)&rep); + return Success; +} + +/***====================================================================***/ + +int +ProcXkbSelectEvents(ClientPtr client) +{ + unsigned legal; + DeviceIntPtr dev; + XkbInterestPtr masks; + REQUEST(xkbSelectEventsReq); + + REQUEST_AT_LEAST_SIZE(xkbSelectEventsReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixUseAccess); + + if (((stuff->affectWhich&XkbMapNotifyMask)!=0)&&(stuff->affectMap)) { + client->mapNotifyMask&= ~stuff->affectMap; + client->mapNotifyMask|= (stuff->affectMap&stuff->map); + } + if ((stuff->affectWhich&(~XkbMapNotifyMask))==0) + return Success; + + masks = XkbFindClientResource((DevicePtr)dev,client); + if (!masks){ + XID id = FakeClientID(client->index); + if (!AddResource(id,RT_XKBCLIENT,dev)) + return BadAlloc; + masks= XkbAddClientResource((DevicePtr)dev,client,id); + } + if (masks) { + union { + CARD8 *c8; + CARD16 *c16; + CARD32 *c32; + } from,to; + register unsigned bit,ndx,maskLeft,dataLeft,size; + + from.c8= (CARD8 *)&stuff[1]; + dataLeft= (stuff->length*4)-SIZEOF(xkbSelectEventsReq); + maskLeft= (stuff->affectWhich&(~XkbMapNotifyMask)); + for (ndx=0,bit=1; (maskLeft!=0); ndx++, bit<<=1) { + if ((bit&maskLeft)==0) + continue; + maskLeft&= ~bit; + switch (ndx) { + case XkbNewKeyboardNotify: + to.c16= &client->newKeyboardNotifyMask; + legal= XkbAllNewKeyboardEventsMask; + size= 2; + break; + case XkbStateNotify: + to.c16= &masks->stateNotifyMask; + legal= XkbAllStateEventsMask; + size= 2; + break; + case XkbControlsNotify: + to.c32= &masks->ctrlsNotifyMask; + legal= XkbAllControlEventsMask; + size= 4; + break; + case XkbIndicatorStateNotify: + to.c32= &masks->iStateNotifyMask; + legal= XkbAllIndicatorEventsMask; + size= 4; + break; + case XkbIndicatorMapNotify: + to.c32= &masks->iMapNotifyMask; + legal= XkbAllIndicatorEventsMask; + size= 4; + break; + case XkbNamesNotify: + to.c16= &masks->namesNotifyMask; + legal= XkbAllNameEventsMask; + size= 2; + break; + case XkbCompatMapNotify: + to.c8= &masks->compatNotifyMask; + legal= XkbAllCompatMapEventsMask; + size= 1; + break; + case XkbBellNotify: + to.c8= &masks->bellNotifyMask; + legal= XkbAllBellEventsMask; + size= 1; + break; + case XkbActionMessage: + to.c8= &masks->actionMessageMask; + legal= XkbAllActionMessagesMask; + size= 1; + break; + case XkbAccessXNotify: + to.c16= &masks->accessXNotifyMask; + legal= XkbAllAccessXEventsMask; + size= 2; + break; + case XkbExtensionDeviceNotify: + to.c16= &masks->extDevNotifyMask; + legal= XkbAllExtensionDeviceEventsMask; + size= 2; + break; + default: + client->errorValue = _XkbErrCode2(33,bit); + return BadValue; + } + + if (stuff->clear&bit) { + if (size==2) to.c16[0]= 0; + else if (size==4) to.c32[0]= 0; + else to.c8[0]= 0; + } + else if (stuff->selectAll&bit) { + if (size==2) to.c16[0]= ~0; + else if (size==4) to.c32[0]= ~0; + else to.c8[0]= ~0; + } + else { + if (dataLeft<(size*2)) + return BadLength; + if (size==2) { + CHK_MASK_MATCH(ndx,from.c16[0],from.c16[1]); + CHK_MASK_LEGAL(ndx,from.c16[0],legal); + to.c16[0]&= ~from.c16[0]; + to.c16[0]|= (from.c16[0]&from.c16[1]); + } + else if (size==4) { + CHK_MASK_MATCH(ndx,from.c32[0],from.c32[1]); + CHK_MASK_LEGAL(ndx,from.c32[0],legal); + to.c32[0]&= ~from.c32[0]; + to.c32[0]|= (from.c32[0]&from.c32[1]); + } + else { + CHK_MASK_MATCH(ndx,from.c8[0],from.c8[1]); + CHK_MASK_LEGAL(ndx,from.c8[0],legal); + to.c8[0]&= ~from.c8[0]; + to.c8[0]|= (from.c8[0]&from.c8[1]); + size= 2; + } + from.c8+= (size*2); + dataLeft-= (size*2); + } + } + if (dataLeft>2) { + ErrorF("[xkb] Extra data (%d bytes) after SelectEvents\n",dataLeft); + return BadLength; + } + return Success; + } + return BadAlloc; +} + +/***====================================================================***/ +/** + * Ring a bell on the given device for the given client. + */ +static int +_XkbBell(ClientPtr client, DeviceIntPtr dev, WindowPtr pWin, + int bellClass, int bellID, int pitch, int duration, + int percent, int forceSound, int eventOnly, Atom name) +{ + int base; + pointer ctrl; + int oldPitch, oldDuration; + int newPercent; + + if (bellClass == KbdFeedbackClass) { + KbdFeedbackPtr k; + if (bellID==XkbDfltXIId) + k= dev->kbdfeed; + else { + for (k=dev->kbdfeed; k; k=k->next) { + if (k->ctrl.id == bellID) + break; + } + } + if (!k) { + client->errorValue = _XkbErrCode2(0x5,bellID); + return BadValue; + } + base = k->ctrl.bell; + ctrl = (pointer) &(k->ctrl); + oldPitch= k->ctrl.bell_pitch; + oldDuration= k->ctrl.bell_duration; + if (pitch!=0) { + if (pitch==-1) + k->ctrl.bell_pitch= defaultKeyboardControl.bell_pitch; + else k->ctrl.bell_pitch= pitch; + } + if (duration!=0) { + if (duration==-1) + k->ctrl.bell_duration= defaultKeyboardControl.bell_duration; + else k->ctrl.bell_duration= duration; + } + } + else if (bellClass == BellFeedbackClass) { + BellFeedbackPtr b; + if (bellID==XkbDfltXIId) + b= dev->bell; + else { + for (b=dev->bell; b; b=b->next) { + if (b->ctrl.id == bellID) + break; + } + } + if (!b) { + client->errorValue = _XkbErrCode2(0x6,bellID); + return BadValue; + } + base = b->ctrl.percent; + ctrl = (pointer) &(b->ctrl); + oldPitch= b->ctrl.pitch; + oldDuration= b->ctrl.duration; + if (pitch!=0) { + if (pitch==-1) + b->ctrl.pitch= defaultKeyboardControl.bell_pitch; + else b->ctrl.pitch= pitch; + } + if (duration!=0) { + if (duration==-1) + b->ctrl.duration= defaultKeyboardControl.bell_duration; + else b->ctrl.duration= duration; + } + } + else { + client->errorValue = _XkbErrCode2(0x7, bellClass); + return BadValue; + } + + newPercent = (base * percent)/100; + if (percent < 0) + newPercent = base + newPercent; + else newPercent = base - newPercent + percent; + + XkbHandleBell(forceSound, eventOnly, + dev, newPercent, ctrl, bellClass, + name, pWin, client); + if ((pitch!=0)||(duration!=0)) { + if (bellClass == KbdFeedbackClass) { + KbdFeedbackPtr k; + k= (KbdFeedbackPtr)ctrl; + if (pitch!=0) + k->ctrl.bell_pitch= oldPitch; + if (duration!=0) + k->ctrl.bell_duration= oldDuration; + } + else { + BellFeedbackPtr b; + b= (BellFeedbackPtr)ctrl; + if (pitch!=0) + b->ctrl.pitch= oldPitch; + if (duration!=0) + b->ctrl.duration= oldDuration; + } + } + + return Success; +} + +int +ProcXkbBell(ClientPtr client) +{ + REQUEST(xkbBellReq); + DeviceIntPtr dev; + WindowPtr pWin; + int rc; + + REQUEST_SIZE_MATCH(xkbBellReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_BELL_DEVICE(dev, stuff->deviceSpec, client, DixBellAccess); + CHK_ATOM_OR_NONE(stuff->name); + + /* device-independent checks request for sane values */ + if ((stuff->forceSound)&&(stuff->eventOnly)) { + client->errorValue=_XkbErrCode3(0x1,stuff->forceSound,stuff->eventOnly); + return BadMatch; + } + if (stuff->percent < -100 || stuff->percent > 100) { + client->errorValue = _XkbErrCode2(0x2,stuff->percent); + return BadValue; + } + if (stuff->duration<-1) { + client->errorValue = _XkbErrCode2(0x3,stuff->duration); + return BadValue; + } + if (stuff->pitch<-1) { + client->errorValue = _XkbErrCode2(0x4,stuff->pitch); + return BadValue; + } + + if (stuff->bellClass == XkbDfltXIClass) { + if (dev->kbdfeed!=NULL) + stuff->bellClass= KbdFeedbackClass; + else stuff->bellClass= BellFeedbackClass; + } + + if (stuff->window!=None) { + rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); + if (rc != Success) { + client->errorValue= stuff->window; + return rc; + } + } + else pWin= NULL; + + /* Client wants to ring a bell on the core keyboard? + Ring the bell on the core keyboard (which does nothing, but if that + fails the client is screwed anyway), and then on all extension devices. + Fail if the core keyboard fails but not the extension devices. this + may cause some keyboards to ding and others to stay silent. Fix + your client to use explicit keyboards to avoid this. + + dev is the device the client requested. + */ + rc = _XkbBell(client, dev, pWin, stuff->bellClass, stuff->bellID, + stuff->pitch, stuff->duration, stuff->percent, + stuff->forceSound, stuff->eventOnly, stuff->name); + + if ((rc == Success) && ((stuff->deviceSpec == XkbUseCoreKbd) || + (stuff->deviceSpec == XkbUseCorePtr))) + { + DeviceIntPtr other; + for (other = inputInfo.devices; other; other = other->next) + { + if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) + { + rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixBellAccess); + if (rc == Success) + _XkbBell(client, other, pWin, stuff->bellClass, + stuff->bellID, stuff->pitch, stuff->duration, + stuff->percent, stuff->forceSound, + stuff->eventOnly, stuff->name); + } + } + rc = Success; /* reset to success, that's what we got for the VCK */ + } + + return rc; +} + +/***====================================================================***/ + +int +ProcXkbGetState(ClientPtr client) +{ + REQUEST(xkbGetStateReq); + DeviceIntPtr dev; + xkbGetStateReply rep; + XkbStateRec *xkb; + + REQUEST_SIZE_MATCH(xkbGetStateReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); + + xkb= &dev->key->xkbInfo->state; + memset(&rep, 0, sizeof(xkbGetStateReply)); + rep.type= X_Reply; + rep.sequenceNumber= client->sequence; + rep.length = 0; + rep.deviceID = dev->id; + rep.mods = XkbStateFieldFromRec(xkb) & 0xff; + rep.baseMods = xkb->base_mods; + rep.lockedMods = xkb->locked_mods; + rep.latchedMods = xkb->latched_mods; + rep.group = xkb->group; + rep.baseGroup = xkb->base_group; + rep.latchedGroup = xkb->latched_group; + rep.lockedGroup = xkb->locked_group; + rep.compatState = xkb->compat_state; + rep.ptrBtnState = xkb->ptr_buttons; + if (client->swapped) { + register int n; + swaps(&rep.sequenceNumber,n); + swaps(&rep.ptrBtnState,n); + } + WriteToClient(client, SIZEOF(xkbGetStateReply), (char *)&rep); + return Success; +} + +/***====================================================================***/ + +int +ProcXkbLatchLockState(ClientPtr client) +{ + int status; + DeviceIntPtr dev, tmpd; + XkbStateRec oldState,*newState; + CARD16 changed; + xkbStateNotify sn; + XkbEventCauseRec cause; + + REQUEST(xkbLatchLockStateReq); + REQUEST_SIZE_MATCH(xkbLatchLockStateReq); + + if (!(client->xkbClientFlags & _XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess); + CHK_MASK_MATCH(0x01, stuff->affectModLocks, stuff->modLocks); + CHK_MASK_MATCH(0x01, stuff->affectModLatches, stuff->modLatches); + + status = Success; + + for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { + if ((tmpd == dev) || (!IsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) { + if (!tmpd->key || !tmpd->key->xkbInfo) + continue; + + oldState = tmpd->key->xkbInfo->state; + newState = &tmpd->key->xkbInfo->state; + if (stuff->affectModLocks) { + newState->locked_mods &= ~stuff->affectModLocks; + newState->locked_mods |= (stuff->affectModLocks & stuff->modLocks); + } + if (status == Success && stuff->lockGroup) + newState->locked_group = stuff->groupLock; + if (status == Success && stuff->affectModLatches) + status = XkbLatchModifiers(tmpd, stuff->affectModLatches, + stuff->modLatches); + if (status == Success && stuff->latchGroup) + status = XkbLatchGroup(tmpd, stuff->groupLatch); + + if (status != Success) + return status; + + XkbComputeDerivedState(tmpd->key->xkbInfo); + + changed = XkbStateChangedFlags(&oldState, newState); + if (changed) { + sn.keycode = 0; + sn.eventType = 0; + sn.requestMajor = XkbReqCode; + sn.requestMinor = X_kbLatchLockState; + sn.changed = changed; + XkbSendStateNotify(tmpd, &sn); + changed = XkbIndicatorsToUpdate(tmpd, changed, FALSE); + if (changed) { + XkbSetCauseXkbReq(&cause, X_kbLatchLockState, client); + XkbUpdateIndicators(tmpd, changed, TRUE, NULL, &cause); + } + } + } + } + + return Success; +} + +/***====================================================================***/ + +int +ProcXkbGetControls(ClientPtr client) +{ + xkbGetControlsReply rep; + XkbControlsPtr xkb; + DeviceIntPtr dev; + register int n; + + REQUEST(xkbGetControlsReq); + REQUEST_SIZE_MATCH(xkbGetControlsReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); + + xkb = dev->key->xkbInfo->desc->ctrls; + rep.type = X_Reply; + rep.length = bytes_to_int32(SIZEOF(xkbGetControlsReply)- + SIZEOF(xGenericReply)); + rep.sequenceNumber = client->sequence; + rep.deviceID = ((DeviceIntPtr)dev)->id; + rep.numGroups = xkb->num_groups; + rep.groupsWrap = xkb->groups_wrap; + rep.internalMods = xkb->internal.mask; + rep.ignoreLockMods = xkb->ignore_lock.mask; + rep.internalRealMods = xkb->internal.real_mods; + rep.ignoreLockRealMods = xkb->ignore_lock.real_mods; + rep.internalVMods = xkb->internal.vmods; + rep.ignoreLockVMods = xkb->ignore_lock.vmods; + rep.enabledCtrls = xkb->enabled_ctrls; + rep.repeatDelay = xkb->repeat_delay; + rep.repeatInterval = xkb->repeat_interval; + rep.slowKeysDelay = xkb->slow_keys_delay; + rep.debounceDelay = xkb->debounce_delay; + rep.mkDelay = xkb->mk_delay; + rep.mkInterval = xkb->mk_interval; + rep.mkTimeToMax = xkb->mk_time_to_max; + rep.mkMaxSpeed = xkb->mk_max_speed; + rep.mkCurve = xkb->mk_curve; + rep.mkDfltBtn = xkb->mk_dflt_btn; + rep.axTimeout = xkb->ax_timeout; + rep.axtCtrlsMask = xkb->axt_ctrls_mask; + rep.axtCtrlsValues = xkb->axt_ctrls_values; + rep.axtOptsMask = xkb->axt_opts_mask; + rep.axtOptsValues = xkb->axt_opts_values; + 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); + } + WriteToClient(client, SIZEOF(xkbGetControlsReply), (char *)&rep); + return Success; +} + +int +ProcXkbSetControls(ClientPtr client) +{ + DeviceIntPtr dev, tmpd; + XkbSrvInfoPtr xkbi; + XkbControlsPtr ctrl; + XkbControlsRec new,old; + xkbControlsNotify cn; + XkbEventCauseRec cause; + XkbSrvLedInfoPtr sli; + + REQUEST(xkbSetControlsReq); + REQUEST_SIZE_MATCH(xkbSetControlsReq); + + if (!(client->xkbClientFlags & _XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); + CHK_MASK_LEGAL(0x01, stuff->changeCtrls, XkbAllControlsMask); + + for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { + if (!tmpd->key || !tmpd->key->xkbInfo) + continue; + if ((tmpd == dev) || (!IsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) { + xkbi = tmpd->key->xkbInfo; + ctrl = xkbi->desc->ctrls; + new = *ctrl; + XkbSetCauseXkbReq(&cause, X_kbSetControls, client); + + if (stuff->changeCtrls & XkbInternalModsMask) { + CHK_MASK_MATCH(0x02, stuff->affectInternalMods, + stuff->internalMods); + CHK_MASK_MATCH(0x03, stuff->affectInternalVMods, + stuff->internalVMods); + + new.internal.real_mods &= ~(stuff->affectInternalMods); + new.internal.real_mods |= (stuff->affectInternalMods & + stuff->internalMods); + new.internal.vmods &= ~(stuff->affectInternalVMods); + new.internal.vmods |= (stuff->affectInternalVMods & + stuff->internalVMods); + new.internal.mask = new.internal.real_mods | + XkbMaskForVMask(xkbi->desc, + new.internal.vmods); + } + + if (stuff->changeCtrls & XkbIgnoreLockModsMask) { + CHK_MASK_MATCH(0x4, stuff->affectIgnoreLockMods, + stuff->ignoreLockMods); + CHK_MASK_MATCH(0x5, stuff->affectIgnoreLockVMods, + stuff->ignoreLockVMods); + + new.ignore_lock.real_mods &= ~(stuff->affectIgnoreLockMods); + new.ignore_lock.real_mods |= (stuff->affectIgnoreLockMods & + stuff->ignoreLockMods); + new.ignore_lock.vmods &= ~(stuff->affectIgnoreLockVMods); + new.ignore_lock.vmods |= (stuff->affectIgnoreLockVMods & + stuff->ignoreLockVMods); + new.ignore_lock.mask = new.ignore_lock.real_mods | + XkbMaskForVMask(xkbi->desc, + new.ignore_lock.vmods); + } + + CHK_MASK_MATCH(0x06, stuff->affectEnabledCtrls, + stuff->enabledCtrls); + if (stuff->affectEnabledCtrls) { + CHK_MASK_LEGAL(0x07, stuff->affectEnabledCtrls, + XkbAllBooleanCtrlsMask); + + new.enabled_ctrls &= ~(stuff->affectEnabledCtrls); + new.enabled_ctrls |= (stuff->affectEnabledCtrls & + stuff->enabledCtrls); + } + + if (stuff->changeCtrls & XkbRepeatKeysMask) { + if (stuff->repeatDelay < 1 || stuff->repeatInterval < 1) { + client->errorValue = _XkbErrCode3(0x08, stuff->repeatDelay, + stuff->repeatInterval); + return BadValue; + } + + new.repeat_delay = stuff->repeatDelay; + new.repeat_interval = stuff->repeatInterval; + } + + if (stuff->changeCtrls & XkbSlowKeysMask) { + if (stuff->slowKeysDelay < 1) { + client->errorValue = _XkbErrCode2(0x09, + stuff->slowKeysDelay); + return BadValue; + } + + new.slow_keys_delay = stuff->slowKeysDelay; + } + + if (stuff->changeCtrls & XkbBounceKeysMask) { + if (stuff->debounceDelay < 1) { + client->errorValue = _XkbErrCode2(0x0A, + stuff->debounceDelay); + return BadValue; + } + + new.debounce_delay = stuff->debounceDelay; + } + + if (stuff->changeCtrls & XkbMouseKeysMask) { + if (stuff->mkDfltBtn > XkbMaxMouseKeysBtn) { + client->errorValue = _XkbErrCode2(0x0B, stuff->mkDfltBtn); + return BadValue; + } + + new.mk_dflt_btn = stuff->mkDfltBtn; + } + + if (stuff->changeCtrls & XkbMouseKeysAccelMask) { + if (stuff->mkDelay < 1 || stuff->mkInterval < 1 || + stuff->mkTimeToMax < 1 || stuff->mkMaxSpeed < 1 || + stuff->mkCurve < -1000) { + client->errorValue = _XkbErrCode2(0x0C,0); + return BadValue; + } + + new.mk_delay = stuff->mkDelay; + new.mk_interval = stuff->mkInterval; + new.mk_time_to_max = stuff->mkTimeToMax; + new.mk_max_speed = stuff->mkMaxSpeed; + new.mk_curve = stuff->mkCurve; + AccessXComputeCurveFactor(xkbi, &new); + } + + if (stuff->changeCtrls & XkbGroupsWrapMask) { + unsigned act, num; + + act = XkbOutOfRangeGroupAction(stuff->groupsWrap); + switch (act) { + case XkbRedirectIntoRange: + num = XkbOutOfRangeGroupNumber(stuff->groupsWrap); + if (num >= new.num_groups) { + client->errorValue = _XkbErrCode3(0x0D, new.num_groups, + num); + return BadValue; + } + case XkbWrapIntoRange: + case XkbClampIntoRange: + break; + default: + client->errorValue = _XkbErrCode2(0x0E, act); + return BadValue; + } + + new.groups_wrap= stuff->groupsWrap; + } + + CHK_MASK_LEGAL(0x0F, stuff->axOptions, XkbAX_AllOptionsMask); + if (stuff->changeCtrls & XkbAccessXKeysMask) { + new.ax_options = stuff->axOptions & XkbAX_AllOptionsMask; + } + else { + if (stuff->changeCtrls & XkbStickyKeysMask) { + new.ax_options &= ~(XkbAX_SKOptionsMask); + new.ax_options |= (stuff->axOptions & XkbAX_SKOptionsMask); + } + + if (stuff->changeCtrls & XkbAccessXFeedbackMask) { + new.ax_options &= ~(XkbAX_FBOptionsMask); + new.ax_options |= (stuff->axOptions & XkbAX_FBOptionsMask); + } + } + + if (stuff->changeCtrls & XkbAccessXTimeoutMask) { + if (stuff->axTimeout < 1) { + client->errorValue = _XkbErrCode2(0x10, stuff->axTimeout); + return BadValue; + } + CHK_MASK_MATCH(0x11, stuff->axtCtrlsMask, + stuff->axtCtrlsValues); + CHK_MASK_LEGAL(0x12, stuff->axtCtrlsMask, + XkbAllBooleanCtrlsMask); + CHK_MASK_MATCH(0x13, stuff->axtOptsMask, stuff->axtOptsValues); + CHK_MASK_LEGAL(0x14, stuff->axtOptsMask, XkbAX_AllOptionsMask); + new.ax_timeout = stuff->axTimeout; + new.axt_ctrls_mask = stuff->axtCtrlsMask; + new.axt_ctrls_values = (stuff->axtCtrlsValues & + stuff->axtCtrlsMask); + new.axt_opts_mask = stuff->axtOptsMask; + new.axt_opts_values = (stuff->axtOptsValues & + stuff->axtOptsMask); + } + + if (stuff->changeCtrls & XkbPerKeyRepeatMask) { + memcpy(new.per_key_repeat, stuff->perKeyRepeat, + XkbPerKeyBitArraySize); + if (xkbi->repeatKey && + !BitIsOn(new.per_key_repeat, xkbi->repeatKey)) { + AccessXCancelRepeatKey(xkbi, xkbi->repeatKey); + } + } + + old= *ctrl; + *ctrl= new; + XkbDDXChangeControls(tmpd, &old, ctrl); + + if (XkbComputeControlsNotify(tmpd, &old, ctrl, &cn, FALSE)) { + cn.keycode = 0; + cn.eventType = 0; + cn.requestMajor = XkbReqCode; + cn.requestMinor = X_kbSetControls; + XkbSendControlsNotify(tmpd, &cn); + } + + sli = XkbFindSrvLedInfo(tmpd, XkbDfltXIClass, XkbDfltXIId, 0); + if (sli) + XkbUpdateIndicators(tmpd, sli->usesControls, TRUE, NULL, + &cause); + + /* If sticky keys were disabled, clear all locks and latches */ + if ((old.enabled_ctrls & XkbStickyKeysMask) && + !(ctrl->enabled_ctrls & XkbStickyKeysMask)) + XkbClearAllLatchesAndLocks(tmpd, xkbi, TRUE, &cause); + } + } + + return Success; +} + +/***====================================================================***/ + +static int +XkbSizeKeyTypes(XkbDescPtr xkb,xkbGetMapReply *rep) +{ + XkbKeyTypeRec *type; + unsigned i,len; + + len= 0; + if (((rep->present&XkbKeyTypesMask)==0)||(rep->nTypes<1)|| + (!xkb)||(!xkb->map)||(!xkb->map->types)) { + rep->present&= ~XkbKeyTypesMask; + rep->firstType= rep->nTypes= 0; + return 0; + } + type= &xkb->map->types[rep->firstType]; + for (i=0;inTypes;i++,type++){ + len+= SIZEOF(xkbKeyTypeWireDesc); + if (type->map_count>0) { + len+= (type->map_count*SIZEOF(xkbKTMapEntryWireDesc)); + if (type->preserve) + len+= (type->map_count*SIZEOF(xkbModsWireDesc)); + } + } + return len; +} + +static char * +XkbWriteKeyTypes( XkbDescPtr xkb, + xkbGetMapReply * rep, + char * buf, + ClientPtr client) +{ + XkbKeyTypePtr type; + unsigned i; + xkbKeyTypeWireDesc *wire; + + type= &xkb->map->types[rep->firstType]; + for (i=0;inTypes;i++,type++) { + register unsigned n; + wire= (xkbKeyTypeWireDesc *)buf; + wire->mask = type->mods.mask; + wire->realMods = type->mods.real_mods; + wire->virtualMods = type->mods.vmods; + wire->numLevels = type->num_levels; + wire->nMapEntries = type->map_count; + wire->preserve = (type->preserve!=NULL); + if (client->swapped) { + register int n; + swaps(&wire->virtualMods,n); + } + + buf= (char *)&wire[1]; + if (wire->nMapEntries>0) { + xkbKTMapEntryWireDesc * wire; + XkbKTMapEntryPtr entry; + wire= (xkbKTMapEntryWireDesc *)buf; + entry= type->map; + for (n=0;nmap_count;n++,wire++,entry++) { + wire->active= entry->active; + wire->mask= entry->mods.mask; + wire->level= entry->level; + wire->realMods= entry->mods.real_mods; + wire->virtualMods= entry->mods.vmods; + if (client->swapped) { + register int n; + swaps(&wire->virtualMods,n); + } + } + buf= (char *)wire; + if (type->preserve!=NULL) { + xkbModsWireDesc * pwire; + XkbModsPtr preserve; + pwire= (xkbModsWireDesc *)buf; + preserve= type->preserve; + for (n=0;nmap_count;n++,pwire++,preserve++) { + pwire->mask= preserve->mask; + pwire->realMods= preserve->real_mods; + pwire->virtualMods= preserve->vmods; + if (client->swapped) { + register int n; + swaps(&pwire->virtualMods,n); + } + } + buf= (char *)pwire; + } + } + } + return buf; +} + +static int +XkbSizeKeySyms(XkbDescPtr xkb,xkbGetMapReply *rep) +{ + XkbSymMapPtr symMap; + unsigned i,len; + unsigned nSyms,nSymsThisKey; + + if (((rep->present&XkbKeySymsMask)==0)||(rep->nKeySyms<1)|| + (!xkb)||(!xkb->map)||(!xkb->map->key_sym_map)) { + rep->present&= ~XkbKeySymsMask; + rep->firstKeySym= rep->nKeySyms= 0; + rep->totalSyms= 0; + return 0; + } + len= rep->nKeySyms*SIZEOF(xkbSymMapWireDesc); + symMap = &xkb->map->key_sym_map[rep->firstKeySym]; + for (i=nSyms=0;inKeySyms;i++,symMap++) { + if (symMap->offset!=0) { + nSymsThisKey= XkbNumGroups(symMap->group_info)*symMap->width; + nSyms+= nSymsThisKey; + } + } + len+= nSyms*4; + rep->totalSyms= nSyms; + return len; +} + +static int +XkbSizeVirtualMods(XkbDescPtr xkb,xkbGetMapReply *rep) +{ +register unsigned i,nMods,bit; + + if (((rep->present&XkbVirtualModsMask)==0)||(rep->virtualMods==0)|| + (!xkb)||(!xkb->server)) { + rep->present&= ~XkbVirtualModsMask; + rep->virtualMods= 0; + return 0; + } + for (i=nMods=0,bit=1;ivirtualMods&bit) + nMods++; + } + return XkbPaddedSize(nMods); +} + +static char * +XkbWriteKeySyms(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf,ClientPtr client) +{ +register KeySym * pSym; +XkbSymMapPtr symMap; +xkbSymMapWireDesc * outMap; +register unsigned i; + + symMap = &xkb->map->key_sym_map[rep->firstKeySym]; + for (i=0;inKeySyms;i++,symMap++) { + outMap = (xkbSymMapWireDesc *)buf; + outMap->ktIndex[0] = symMap->kt_index[0]; + outMap->ktIndex[1] = symMap->kt_index[1]; + outMap->ktIndex[2] = symMap->kt_index[2]; + outMap->ktIndex[3] = symMap->kt_index[3]; + outMap->groupInfo = symMap->group_info; + outMap->width= symMap->width; + outMap->nSyms = symMap->width*XkbNumGroups(symMap->group_info); + buf= (char *)&outMap[1]; + if (outMap->nSyms==0) + continue; + + 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); + while (nSyms-->0) { + swapl(buf,n); + buf+= 4; + } + } + else buf+= outMap->nSyms*4; + } + return buf; +} + +static int +XkbSizeKeyActions(XkbDescPtr xkb,xkbGetMapReply *rep) +{ + unsigned i,len,nActs; + register KeyCode firstKey; + + if (((rep->present&XkbKeyActionsMask)==0)||(rep->nKeyActs<1)|| + (!xkb)||(!xkb->server)||(!xkb->server->key_acts)) { + rep->present&= ~XkbKeyActionsMask; + rep->firstKeyAct= rep->nKeyActs= 0; + rep->totalActs= 0; + return 0; + } + firstKey= rep->firstKeyAct; + for (nActs=i=0;inKeyActs;i++) { + if (xkb->server->key_acts[i+firstKey]!=0) + nActs+= XkbKeyNumActions(xkb,i+firstKey); + } + len= XkbPaddedSize(rep->nKeyActs)+(nActs*SIZEOF(xkbActionWireDesc)); + rep->totalActs= nActs; + return len; +} + +static char * +XkbWriteKeyActions(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, + ClientPtr client) +{ + unsigned i; + CARD8 * numDesc; + XkbAnyAction * actDesc; + + numDesc = (CARD8 *)buf; + for (i=0;inKeyActs;i++) { + if (xkb->server->key_acts[i+rep->firstKeyAct]==0) + numDesc[i] = 0; + else numDesc[i] = XkbKeyNumActions(xkb,(i+rep->firstKeyAct)); + } + buf+= XkbPaddedSize(rep->nKeyActs); + + actDesc = (XkbAnyAction *)buf; + for (i=0;inKeyActs;i++) { + if (xkb->server->key_acts[i+rep->firstKeyAct]!=0) { + unsigned int num; + num = XkbKeyNumActions(xkb,(i+rep->firstKeyAct)); + memcpy((char *)actDesc, + (char*)XkbKeyActionsPtr(xkb,(i+rep->firstKeyAct)), + num*SIZEOF(xkbActionWireDesc)); + actDesc+= num; + } + } + buf = (char *)actDesc; + return buf; +} + +static int +XkbSizeKeyBehaviors(XkbDescPtr xkb,xkbGetMapReply *rep) +{ + unsigned i,len,nBhvr; + XkbBehavior * bhv; + + if (((rep->present&XkbKeyBehaviorsMask)==0)||(rep->nKeyBehaviors<1)|| + (!xkb)||(!xkb->server)||(!xkb->server->behaviors)) { + rep->present&= ~XkbKeyBehaviorsMask; + rep->firstKeyBehavior= rep->nKeyBehaviors= 0; + rep->totalKeyBehaviors= 0; + return 0; + } + bhv= &xkb->server->behaviors[rep->firstKeyBehavior]; + for (nBhvr=i=0;inKeyBehaviors;i++,bhv++) { + if (bhv->type!=XkbKB_Default) + nBhvr++; + } + len= nBhvr*SIZEOF(xkbBehaviorWireDesc); + rep->totalKeyBehaviors= nBhvr; + return len; +} + +static char * +XkbWriteKeyBehaviors(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, + ClientPtr client) +{ + unsigned i; + xkbBehaviorWireDesc *wire; + XkbBehavior *pBhvr; + + wire = (xkbBehaviorWireDesc *)buf; + pBhvr= &xkb->server->behaviors[rep->firstKeyBehavior]; + for (i=0;inKeyBehaviors;i++,pBhvr++) { + if (pBhvr->type!=XkbKB_Default) { + wire->key= i+rep->firstKeyBehavior; + wire->type= pBhvr->type; + wire->data= pBhvr->data; + wire++; + } + } + buf = (char *)wire; + return buf; +} + +static int +XkbSizeExplicit(XkbDescPtr xkb,xkbGetMapReply *rep) +{ + unsigned i,len,nRtrn; + + if (((rep->present&XkbExplicitComponentsMask)==0)||(rep->nKeyExplicit<1)|| + (!xkb)||(!xkb->server)||(!xkb->server->explicit)) { + rep->present&= ~XkbExplicitComponentsMask; + rep->firstKeyExplicit= rep->nKeyExplicit= 0; + rep->totalKeyExplicit= 0; + return 0; + } + for (nRtrn=i=0;inKeyExplicit;i++) { + if (xkb->server->explicit[i+rep->firstKeyExplicit]!=0) + nRtrn++; + } + rep->totalKeyExplicit= nRtrn; + len= XkbPaddedSize(nRtrn*2); /* two bytes per non-zero explicit component */ + return len; +} + +static char * +XkbWriteExplicit(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf,ClientPtr client) +{ +unsigned i; +char * start; +unsigned char * pExp; + + start= buf; + pExp= &xkb->server->explicit[rep->firstKeyExplicit]; + for (i=0;inKeyExplicit;i++,pExp++) { + if (*pExp!=0) { + *buf++= i+rep->firstKeyExplicit; + *buf++= *pExp; + } + } + i= XkbPaddedSize(buf-start)-(buf-start); /* pad to word boundary */ + return buf+i; +} + +static int +XkbSizeModifierMap(XkbDescPtr xkb,xkbGetMapReply *rep) +{ + unsigned i,len,nRtrn; + + if (((rep->present&XkbModifierMapMask)==0)||(rep->nModMapKeys<1)|| + (!xkb)||(!xkb->map)||(!xkb->map->modmap)) { + rep->present&= ~XkbModifierMapMask; + rep->firstModMapKey= rep->nModMapKeys= 0; + rep->totalModMapKeys= 0; + return 0; + } + for (nRtrn=i=0;inModMapKeys;i++) { + if (xkb->map->modmap[i+rep->firstModMapKey]!=0) + nRtrn++; + } + rep->totalModMapKeys= nRtrn; + len= XkbPaddedSize(nRtrn*2); /* two bytes per non-zero modmap component */ + return len; +} + +static char * +XkbWriteModifierMap(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, + ClientPtr client) +{ +unsigned i; +char * start; +unsigned char * pMap; + + start= buf; + pMap= &xkb->map->modmap[rep->firstModMapKey]; + for (i=0;inModMapKeys;i++,pMap++) { + if (*pMap!=0) { + *buf++= i+rep->firstModMapKey; + *buf++= *pMap; + } + } + i= XkbPaddedSize(buf-start)-(buf-start); /* pad to word boundary */ + return buf+i; +} + +static int +XkbSizeVirtualModMap(XkbDescPtr xkb,xkbGetMapReply *rep) +{ + unsigned i,len,nRtrn; + + if (((rep->present&XkbVirtualModMapMask)==0)||(rep->nVModMapKeys<1)|| + (!xkb)||(!xkb->server)||(!xkb->server->vmodmap)) { + rep->present&= ~XkbVirtualModMapMask; + rep->firstVModMapKey= rep->nVModMapKeys= 0; + rep->totalVModMapKeys= 0; + return 0; + } + for (nRtrn=i=0;inVModMapKeys;i++) { + if (xkb->server->vmodmap[i+rep->firstVModMapKey]!=0) + nRtrn++; + } + rep->totalVModMapKeys= nRtrn; + len= nRtrn*SIZEOF(xkbVModMapWireDesc); + return len; +} + +static char * +XkbWriteVirtualModMap(XkbDescPtr xkb,xkbGetMapReply *rep,char *buf, + ClientPtr client) +{ +unsigned i; +xkbVModMapWireDesc * wire; +unsigned short * pMap; + + wire= (xkbVModMapWireDesc *)buf; + pMap= &xkb->server->vmodmap[rep->firstVModMapKey]; + for (i=0;inVModMapKeys;i++,pMap++) { + if (*pMap!=0) { + wire->key= i+rep->firstVModMapKey; + wire->vmods= *pMap; + wire++; + } + } + return (char *)wire; +} + +static Status +XkbComputeGetMapReplySize(XkbDescPtr xkb,xkbGetMapReply *rep) +{ +int len; + + rep->minKeyCode= xkb->min_key_code; + rep->maxKeyCode= xkb->max_key_code; + len= XkbSizeKeyTypes(xkb,rep); + len+= XkbSizeKeySyms(xkb,rep); + len+= XkbSizeKeyActions(xkb,rep); + len+= XkbSizeKeyBehaviors(xkb,rep); + len+= XkbSizeVirtualMods(xkb,rep); + len+= XkbSizeExplicit(xkb,rep); + len+= XkbSizeModifierMap(xkb,rep); + len+= XkbSizeVirtualModMap(xkb,rep); + rep->length+= (len/4); + return Success; +} + +static int +XkbSendMap(ClientPtr client,XkbDescPtr xkb,xkbGetMapReply *rep) +{ +unsigned i,len; +char *desc,*start; + + len= (rep->length*4)-(SIZEOF(xkbGetMapReply)-SIZEOF(xGenericReply)); + start= desc= calloc(1, len); + if (!start) + return BadAlloc; + if ( rep->nTypes>0 ) + desc = XkbWriteKeyTypes(xkb,rep,desc,client); + if ( rep->nKeySyms>0 ) + desc = XkbWriteKeySyms(xkb,rep,desc,client); + if ( rep->nKeyActs>0 ) + desc = XkbWriteKeyActions(xkb,rep,desc,client); + if ( rep->totalKeyBehaviors>0 ) + desc = XkbWriteKeyBehaviors(xkb,rep,desc,client); + if ( rep->virtualMods ) { + register int sz,bit; + for (i=sz=0,bit=1;ivirtualMods&bit) { + desc[sz++]= xkb->server->vmods[i]; + } + } + desc+= XkbPaddedSize(sz); + } + if ( rep->totalKeyExplicit>0 ) + desc= XkbWriteExplicit(xkb,rep,desc,client); + if ( rep->totalModMapKeys>0 ) + desc= XkbWriteModifierMap(xkb,rep,desc,client); + if ( rep->totalVModMapKeys>0 ) + desc= XkbWriteVirtualModMap(xkb,rep,desc,client); + if ((desc-start)!=(len)) { + ErrorF("[xkb] BOGUS LENGTH in write keyboard desc, expected %d, got %ld\n", + 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); + } + WriteToClient(client, (i=SIZEOF(xkbGetMapReply)), (char *)rep); + WriteToClient(client, len, start); + free((char *)start); + return Success; +} + +int +ProcXkbGetMap(ClientPtr client) +{ + DeviceIntPtr dev; + xkbGetMapReply rep; + XkbDescRec *xkb; + int n,status; + + REQUEST(xkbGetMapReq); + REQUEST_SIZE_MATCH(xkbGetMapReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); + CHK_MASK_OVERLAP(0x01,stuff->full,stuff->partial); + CHK_MASK_LEGAL(0x02,stuff->full,XkbAllMapComponentsMask); + CHK_MASK_LEGAL(0x03,stuff->partial,XkbAllMapComponentsMask); + + xkb= dev->key->xkbInfo->desc; + memset(&rep, 0, sizeof(xkbGetMapReply)); + rep.type= X_Reply; + rep.sequenceNumber= client->sequence; + rep.length = (SIZEOF(xkbGetMapReply)-SIZEOF(xGenericReply))>>2; + rep.deviceID = dev->id; + rep.present = stuff->partial|stuff->full; + rep.minKeyCode = xkb->min_key_code; + rep.maxKeyCode = xkb->max_key_code; + if ( stuff->full&XkbKeyTypesMask ) { + rep.firstType = 0; + rep.nTypes = xkb->map->num_types; + } + else if (stuff->partial&XkbKeyTypesMask) { + if (((unsigned)stuff->firstType+stuff->nTypes)>xkb->map->num_types) { + client->errorValue = _XkbErrCode4(0x04,xkb->map->num_types, + stuff->firstType,stuff->nTypes); + return BadValue; + } + rep.firstType = stuff->firstType; + rep.nTypes = stuff->nTypes; + } + else rep.nTypes = 0; + rep.totalTypes = xkb->map->num_types; + + n= XkbNumKeys(xkb); + if ( stuff->full&XkbKeySymsMask ) { + rep.firstKeySym = xkb->min_key_code; + rep.nKeySyms = n; + } + else if (stuff->partial&XkbKeySymsMask) { + CHK_KEY_RANGE(0x05,stuff->firstKeySym,stuff->nKeySyms,xkb); + rep.firstKeySym = stuff->firstKeySym; + rep.nKeySyms = stuff->nKeySyms; + } + else rep.nKeySyms = 0; + rep.totalSyms= 0; + + if ( stuff->full&XkbKeyActionsMask ) { + rep.firstKeyAct= xkb->min_key_code; + rep.nKeyActs= n; + } + else if (stuff->partial&XkbKeyActionsMask) { + CHK_KEY_RANGE(0x07,stuff->firstKeyAct,stuff->nKeyActs,xkb); + rep.firstKeyAct= stuff->firstKeyAct; + rep.nKeyActs= stuff->nKeyActs; + } + else rep.nKeyActs= 0; + rep.totalActs= 0; + + if ( stuff->full&XkbKeyBehaviorsMask ) { + rep.firstKeyBehavior = xkb->min_key_code; + rep.nKeyBehaviors = n; + } + else if (stuff->partial&XkbKeyBehaviorsMask) { + CHK_KEY_RANGE(0x09,stuff->firstKeyBehavior,stuff->nKeyBehaviors,xkb); + rep.firstKeyBehavior= stuff->firstKeyBehavior; + rep.nKeyBehaviors= stuff->nKeyBehaviors; + } + else rep.nKeyBehaviors = 0; + rep.totalKeyBehaviors= 0; + + if (stuff->full&XkbVirtualModsMask) + rep.virtualMods= ~0; + else if (stuff->partial&XkbVirtualModsMask) + rep.virtualMods= stuff->virtualMods; + + if (stuff->full&XkbExplicitComponentsMask) { + rep.firstKeyExplicit= xkb->min_key_code; + rep.nKeyExplicit= n; + } + else if (stuff->partial&XkbExplicitComponentsMask) { + CHK_KEY_RANGE(0x0B,stuff->firstKeyExplicit,stuff->nKeyExplicit,xkb); + rep.firstKeyExplicit= stuff->firstKeyExplicit; + rep.nKeyExplicit= stuff->nKeyExplicit; + } + else rep.nKeyExplicit = 0; + rep.totalKeyExplicit= 0; + + if (stuff->full&XkbModifierMapMask) { + rep.firstModMapKey= xkb->min_key_code; + rep.nModMapKeys= n; + } + else if (stuff->partial&XkbModifierMapMask) { + CHK_KEY_RANGE(0x0D,stuff->firstModMapKey,stuff->nModMapKeys,xkb); + rep.firstModMapKey= stuff->firstModMapKey; + rep.nModMapKeys= stuff->nModMapKeys; + } + else rep.nModMapKeys = 0; + rep.totalModMapKeys= 0; + + if (stuff->full&XkbVirtualModMapMask) { + rep.firstVModMapKey= xkb->min_key_code; + rep.nVModMapKeys= n; + } + else if (stuff->partial&XkbVirtualModMapMask) { + CHK_KEY_RANGE(0x0F,stuff->firstVModMapKey,stuff->nVModMapKeys,xkb); + rep.firstVModMapKey= stuff->firstVModMapKey; + rep.nVModMapKeys= stuff->nVModMapKeys; + } + else rep.nVModMapKeys = 0; + rep.totalVModMapKeys= 0; + + if ((status=XkbComputeGetMapReplySize(xkb,&rep))!=Success) + return status; + return XkbSendMap(client,xkb,&rep); +} + +/***====================================================================***/ + +static int +CheckKeyTypes( ClientPtr client, + XkbDescPtr xkb, + xkbSetMapReq * req, + xkbKeyTypeWireDesc **wireRtrn, + int * nMapsRtrn, + CARD8 * mapWidthRtrn) +{ +unsigned nMaps; +register unsigned i,n; +register CARD8 * map; +register xkbKeyTypeWireDesc *wire = *wireRtrn; + + if (req->firstType>((unsigned)xkb->map->num_types)) { + *nMapsRtrn = _XkbErrCode3(0x01,req->firstType,xkb->map->num_types); + return 0; + } + if (req->flags&XkbSetMapResizeTypes) { + nMaps = req->firstType+req->nTypes; + if (nMapsfirstType,req->nTypes,4); + return 0; + } + } + else if (req->present&XkbKeyTypesMask) { + nMaps = xkb->map->num_types; + if ((req->firstType+req->nTypes)>nMaps) { + *nMapsRtrn = req->firstType+req->nTypes; + return 0; + } + } + else { + *nMapsRtrn = xkb->map->num_types; + for (i=0;imap->num_types;i++) { + mapWidthRtrn[i] = xkb->map->types[i].num_levels; + } + return 1; + } + + for (i=0;ifirstType;i++) { + mapWidthRtrn[i] = xkb->map->types[i].num_levels; + } + for (i=0;inTypes;i++) { + unsigned width; + if (client->swapped) { + register int s; + swaps(&wire->virtualMods,s); + } + n= i+req->firstType; + width= wire->numLevels; + if (width<1) { + *nMapsRtrn= _XkbErrCode3(0x04,n,width); + return 0; + } + else if ((n==XkbOneLevelIndex)&&(width!=1)) { /* must be width 1 */ + *nMapsRtrn= _XkbErrCode3(0x05,n,width); + return 0; + } + else if ((width!=2)&& + ((n==XkbTwoLevelIndex)||(n==XkbKeypadIndex)|| + (n==XkbAlphabeticIndex))) { + /* TWO_LEVEL, ALPHABETIC and KEYPAD must be width 2 */ + *nMapsRtrn= _XkbErrCode3(0x05,n,width); + return 0; + } + if (wire->nMapEntries>0) { + xkbKTSetMapEntryWireDesc * mapWire; + xkbModsWireDesc * preWire; + mapWire= (xkbKTSetMapEntryWireDesc *)&wire[1]; + preWire= (xkbModsWireDesc *)&mapWire[wire->nMapEntries]; + for (n=0;nnMapEntries;n++) { + if (client->swapped) { + register int s; + swaps(&mapWire[n].virtualMods,s); + } + if (mapWire[n].realMods&(~wire->realMods)) { + *nMapsRtrn= _XkbErrCode4(0x06,n,mapWire[n].realMods, + wire->realMods); + return 0; + } + if (mapWire[n].virtualMods&(~wire->virtualMods)) { + *nMapsRtrn= _XkbErrCode3(0x07,n,mapWire[n].virtualMods); + return 0; + } + if (mapWire[n].level>=wire->numLevels) { + *nMapsRtrn= _XkbErrCode4(0x08,n,wire->numLevels, + mapWire[n].level); + return 0; + } + if (wire->preserve) { + if (client->swapped) { + register int s; + swaps(&preWire[n].virtualMods,s); + } + if (preWire[n].realMods&(~mapWire[n].realMods)) { + *nMapsRtrn= _XkbErrCode4(0x09,n,preWire[n].realMods, + mapWire[n].realMods); + return 0; + } + if (preWire[n].virtualMods&(~mapWire[n].virtualMods)) { + *nMapsRtrn=_XkbErrCode3(0x0a,n,preWire[n].virtualMods); + return 0; + } + } + } + if (wire->preserve) + map= (CARD8 *)&preWire[wire->nMapEntries]; + else map= (CARD8 *)&mapWire[wire->nMapEntries]; + } + else map= (CARD8 *)&wire[1]; + mapWidthRtrn[i+req->firstType] = wire->numLevels; + wire= (xkbKeyTypeWireDesc *)map; + } + for (i=req->firstType+req->nTypes;imap->types[i].num_levels; + } + *nMapsRtrn = nMaps; + *wireRtrn = wire; + return 1; +} + +static int +CheckKeySyms( ClientPtr client, + XkbDescPtr xkb, + xkbSetMapReq * req, + int nTypes, + CARD8 * mapWidths, + CARD16 * symsPerKey, + xkbSymMapWireDesc ** wireRtrn, + int * errorRtrn) +{ +register unsigned i; +XkbSymMapPtr map; +xkbSymMapWireDesc* wire = *wireRtrn; + + if (!(XkbKeySymsMask&req->present)) + return 1; + CHK_REQ_KEY_RANGE2(0x11,req->firstKeySym,req->nKeySyms,req,(*errorRtrn),0); + for (i=0;inKeySyms;i++) { + KeySym *pSyms; + register unsigned nG; + if (client->swapped) { + swaps(&wire->nSyms,nG); + } + nG = XkbNumGroups(wire->groupInfo); + if (nG>XkbNumKbdGroups) { + *errorRtrn = _XkbErrCode3(0x14,i+req->firstKeySym,nG); + return 0; + } + if (nG>0) { + register int g,w; + for (g=w=0;gktIndex[g]>=(unsigned)nTypes) { + *errorRtrn= _XkbErrCode4(0x15,i+req->firstKeySym,g, + wire->ktIndex[g]); + return 0; + } + if (mapWidths[wire->ktIndex[g]]>w) + w= mapWidths[wire->ktIndex[g]]; + } + if (wire->width!=w) { + *errorRtrn= _XkbErrCode3(0x16,i+req->firstKeySym,wire->width); + return 0; + } + w*= nG; + symsPerKey[i+req->firstKeySym] = w; + if (w!=wire->nSyms) { + *errorRtrn=_XkbErrCode4(0x16,i+req->firstKeySym,wire->nSyms,w); + return 0; + } + } + else if (wire->nSyms!=0) { + *errorRtrn = _XkbErrCode3(0x17,i+req->firstKeySym,wire->nSyms); + return 0; + } + pSyms = (KeySym *)&wire[1]; + wire = (xkbSymMapWireDesc *)&pSyms[wire->nSyms]; + } + + map = &xkb->map->key_sym_map[i]; + for (;i<=(unsigned)xkb->max_key_code;i++,map++) { + register int g,nG,w; + nG= XkbKeyNumGroups(xkb,i); + for (w=g=0;gkt_index[g]>=(unsigned)nTypes) { + *errorRtrn = _XkbErrCode4(0x18,i,g,map->kt_index[g]); + return 0; + } + if (mapWidths[map->kt_index[g]]>w) + w= mapWidths[map->kt_index[g]]; + } + symsPerKey[i] = w*nG; + } + *wireRtrn = wire; + return 1; +} + +static int +CheckKeyActions( XkbDescPtr xkb, + xkbSetMapReq * req, + int nTypes, + CARD8 * mapWidths, + CARD16 * symsPerKey, + CARD8 ** wireRtrn, + int * nActsRtrn) +{ +int nActs; +CARD8 * wire = *wireRtrn; +register unsigned i; + + if (!(XkbKeyActionsMask&req->present)) + return 1; + CHK_REQ_KEY_RANGE2(0x21,req->firstKeyAct,req->nKeyActs,req,(*nActsRtrn),0); + for (nActs=i=0;inKeyActs;i++) { + if (wire[0]!=0) { + if (wire[0]==symsPerKey[i+req->firstKeyAct]) + nActs+= wire[0]; + else { + *nActsRtrn= _XkbErrCode3(0x23,i+req->firstKeyAct,wire[0]); + return 0; + } + } + wire++; + } + if (req->nKeyActs%4) + wire+= 4-(req->nKeyActs%4); + *wireRtrn = (CARD8 *)(((XkbAnyAction *)wire)+nActs); + *nActsRtrn = nActs; + return 1; +} + +static int +CheckKeyBehaviors( XkbDescPtr xkb, + xkbSetMapReq * req, + xkbBehaviorWireDesc ** wireRtrn, + int * errorRtrn) +{ +register xkbBehaviorWireDesc * wire = *wireRtrn; +register XkbServerMapPtr server = xkb->server; +register unsigned i; +unsigned first,last; + + if (((req->present&XkbKeyBehaviorsMask)==0)||(req->nKeyBehaviors<1)) { + req->present&= ~XkbKeyBehaviorsMask; + req->nKeyBehaviors= 0; + return 1; + } + first= req->firstKeyBehavior; + last= req->firstKeyBehavior+req->nKeyBehaviors-1; + if (firstminKeyCode) { + *errorRtrn = _XkbErrCode3(0x31,first,req->minKeyCode); + return 0; + } + if (last>req->maxKeyCode) { + *errorRtrn = _XkbErrCode3(0x32,last,req->maxKeyCode); + return 0; + } + + for (i=0;itotalKeyBehaviors;i++,wire++) { + if ((wire->keykey>last)) { + *errorRtrn = _XkbErrCode4(0x33,first,last,wire->key); + return 0; + } + if ((wire->type&XkbKB_Permanent)&& + ((server->behaviors[wire->key].type!=wire->type)|| + (server->behaviors[wire->key].data!=wire->data))) { + *errorRtrn = _XkbErrCode3(0x33,wire->key,wire->type); + return 0; + } + if ((wire->type==XkbKB_RadioGroup)&& + ((wire->data&(~XkbKB_RGAllowNone))>XkbMaxRadioGroups)) { + *errorRtrn= _XkbErrCode4(0x34,wire->key,wire->data, + XkbMaxRadioGroups); + return 0; + } + if ((wire->type==XkbKB_Overlay1)||(wire->type==XkbKB_Overlay2)) { + CHK_KEY_RANGE2(0x35,wire->key,1,xkb,*errorRtrn,0); + } + } + *wireRtrn = wire; + return 1; +} + +static int +CheckVirtualMods( XkbDescRec * xkb, + xkbSetMapReq * req, + CARD8 ** wireRtrn, + int * errorRtrn) +{ +register CARD8 *wire = *wireRtrn; +register unsigned i,nMods,bit; + + if (((req->present&XkbVirtualModsMask)==0)||(req->virtualMods==0)) + return 1; + for (i=nMods=0,bit=1;ivirtualMods&bit) + nMods++; + } + *wireRtrn= (wire+XkbPaddedSize(nMods)); + return 1; +} + +static int +CheckKeyExplicit( XkbDescPtr xkb, + xkbSetMapReq * req, + CARD8 ** wireRtrn, + int * errorRtrn) +{ +register CARD8 * wire = *wireRtrn; +CARD8 * start; +register unsigned i; +int first,last; + + if (((req->present&XkbExplicitComponentsMask)==0)||(req->nKeyExplicit<1)) { + req->present&= ~XkbExplicitComponentsMask; + req->nKeyExplicit= 0; + return 1; + } + first= req->firstKeyExplicit; + last= first+req->nKeyExplicit-1; + if (firstminKeyCode) { + *errorRtrn = _XkbErrCode3(0x51,first,req->minKeyCode); + return 0; + } + if (last>req->maxKeyCode) { + *errorRtrn = _XkbErrCode3(0x52,last,req->maxKeyCode); + return 0; + } + start= wire; + for (i=0;itotalKeyExplicit;i++,wire+=2) { + if ((wire[0]last)) { + *errorRtrn = _XkbErrCode4(0x53,first,last,wire[0]); + return 0; + } + if (wire[1]&(~XkbAllExplicitMask)) { + *errorRtrn= _XkbErrCode3(0x52,~XkbAllExplicitMask,wire[1]); + return 0; + } + } + wire+= XkbPaddedSize(wire-start)-(wire-start); + *wireRtrn= wire; + return 1; +} + +static int +CheckModifierMap(XkbDescPtr xkb,xkbSetMapReq *req,CARD8 **wireRtrn,int *errRtrn) +{ +register CARD8 * wire = *wireRtrn; +CARD8 * start; +register unsigned i; +int first,last; + + if (((req->present&XkbModifierMapMask)==0)||(req->nModMapKeys<1)) { + req->present&= ~XkbModifierMapMask; + req->nModMapKeys= 0; + return 1; + } + first= req->firstModMapKey; + last= first+req->nModMapKeys-1; + if (firstminKeyCode) { + *errRtrn = _XkbErrCode3(0x61,first,req->minKeyCode); + return 0; + } + if (last>req->maxKeyCode) { + *errRtrn = _XkbErrCode3(0x62,last,req->maxKeyCode); + return 0; + } + start= wire; + for (i=0;itotalModMapKeys;i++,wire+=2) { + if ((wire[0]last)) { + *errRtrn = _XkbErrCode4(0x63,first,last,wire[0]); + return 0; + } + } + wire+= XkbPaddedSize(wire-start)-(wire-start); + *wireRtrn= wire; + return 1; +} + +static int +CheckVirtualModMap( XkbDescPtr xkb, + xkbSetMapReq *req, + xkbVModMapWireDesc **wireRtrn, + int *errRtrn) +{ +register xkbVModMapWireDesc * wire = *wireRtrn; +register unsigned i; +int first,last; + + if (((req->present&XkbVirtualModMapMask)==0)||(req->nVModMapKeys<1)) { + req->present&= ~XkbVirtualModMapMask; + req->nVModMapKeys= 0; + return 1; + } + first= req->firstVModMapKey; + last= first+req->nVModMapKeys-1; + if (firstminKeyCode) { + *errRtrn = _XkbErrCode3(0x71,first,req->minKeyCode); + return 0; + } + if (last>req->maxKeyCode) { + *errRtrn = _XkbErrCode3(0x72,last,req->maxKeyCode); + return 0; + } + for (i=0;itotalVModMapKeys;i++,wire++) { + if ((wire->keykey>last)) { + *errRtrn = _XkbErrCode4(0x73,first,last,wire->key); + return 0; + } + } + *wireRtrn= wire; + return 1; +} + +static char * +SetKeyTypes( XkbDescPtr xkb, + xkbSetMapReq * req, + xkbKeyTypeWireDesc * wire, + XkbChangesPtr changes) +{ +register unsigned i; +unsigned first,last; +CARD8 *map; + + if ((unsigned)(req->firstType+req->nTypes)>xkb->map->size_types) { + i= req->firstType+req->nTypes; + if (XkbAllocClientMap(xkb,XkbKeyTypesMask,i)!=Success) { + return NULL; + } + } + if ((unsigned)(req->firstType+req->nTypes)>xkb->map->num_types) + xkb->map->num_types= req->firstType+req->nTypes; + + for (i=0;inTypes;i++) { + XkbKeyTypePtr pOld; + register unsigned n; + + if (XkbResizeKeyType(xkb,i+req->firstType,wire->nMapEntries, + wire->preserve,wire->numLevels)!=Success) { + return NULL; + } + pOld = &xkb->map->types[i+req->firstType]; + map = (CARD8 *)&wire[1]; + + pOld->mods.real_mods = wire->realMods; + pOld->mods.vmods= wire->virtualMods; + pOld->num_levels = wire->numLevels; + pOld->map_count= wire->nMapEntries; + + pOld->mods.mask= pOld->mods.real_mods| + XkbMaskForVMask(xkb,pOld->mods.vmods); + + if (wire->nMapEntries) { + xkbKTSetMapEntryWireDesc *mapWire; + xkbModsWireDesc *preWire; + unsigned tmp; + mapWire= (xkbKTSetMapEntryWireDesc *)map; + preWire= (xkbModsWireDesc *)&mapWire[wire->nMapEntries]; + for (n=0;nnMapEntries;n++) { + pOld->map[n].active= 1; + pOld->map[n].mods.mask= mapWire[n].realMods; + pOld->map[n].mods.real_mods= mapWire[n].realMods; + pOld->map[n].mods.vmods= mapWire[n].virtualMods; + pOld->map[n].level= mapWire[n].level; + if (mapWire[n].virtualMods!=0) { + tmp= XkbMaskForVMask(xkb,mapWire[n].virtualMods); + pOld->map[n].active= (tmp!=0); + pOld->map[n].mods.mask|= tmp; + } + if (wire->preserve) { + pOld->preserve[n].real_mods= preWire[n].realMods; + pOld->preserve[n].vmods= preWire[n].virtualMods; + tmp= XkbMaskForVMask(xkb,preWire[n].virtualMods); + pOld->preserve[n].mask= preWire[n].realMods|tmp; + } + } + if (wire->preserve) + map= (CARD8 *)&preWire[wire->nMapEntries]; + else map= (CARD8 *)&mapWire[wire->nMapEntries]; + } + else map= (CARD8 *)&wire[1]; + wire = (xkbKeyTypeWireDesc *)map; + } + first= req->firstType; + last= first+req->nTypes-1; /* last changed type */ + if (changes->map.changed&XkbKeyTypesMask) { + int oldLast; + oldLast= changes->map.first_type+changes->map.num_types-1; + if (changes->map.first_typemap.first_type; + if (oldLast>last) + last= oldLast; + } + changes->map.changed|= XkbKeyTypesMask; + changes->map.first_type = first; + changes->map.num_types = (last-first)+1; + return (char *)wire; +} + +static char * +SetKeySyms( ClientPtr client, + XkbDescPtr xkb, + xkbSetMapReq * req, + xkbSymMapWireDesc * wire, + XkbChangesPtr changes, + DeviceIntPtr dev) +{ +register unsigned i,s; +XkbSymMapPtr oldMap; +KeySym * newSyms; +KeySym * pSyms; +unsigned first,last; + + oldMap = &xkb->map->key_sym_map[req->firstKeySym]; + for (i=0;inKeySyms;i++,oldMap++) { + pSyms = (KeySym *)&wire[1]; + if (wire->nSyms>0) { + newSyms = XkbResizeKeySyms(xkb,i+req->firstKeySym,wire->nSyms); + for (s=0;snSyms;s++) { + newSyms[s]= pSyms[s]; + } + if (client->swapped) { + int n; + for (s=0;snSyms;s++) { + swapl(&newSyms[s],n); + } + } + } + oldMap->kt_index[0] = wire->ktIndex[0]; + oldMap->kt_index[1] = wire->ktIndex[1]; + oldMap->kt_index[2] = wire->ktIndex[2]; + oldMap->kt_index[3] = wire->ktIndex[3]; + oldMap->group_info = wire->groupInfo; + oldMap->width = wire->width; + wire= (xkbSymMapWireDesc *)&pSyms[wire->nSyms]; + } + first= req->firstKeySym; + last= first+req->nKeySyms-1; + if (changes->map.changed&XkbKeySymsMask) { + int oldLast= (changes->map.first_key_sym+changes->map.num_key_syms-1); + if (changes->map.first_key_symmap.first_key_sym; + if (oldLast>last) + last= oldLast; + } + changes->map.changed|= XkbKeySymsMask; + changes->map.first_key_sym = first; + changes->map.num_key_syms = (last-first+1); + + s= 0; + for (i=xkb->min_key_code;i<=xkb->max_key_code;i++) { + if (XkbKeyNumGroups(xkb,i)>s) + s= XkbKeyNumGroups(xkb,i); + } + if (s!=xkb->ctrls->num_groups) { + xkbControlsNotify cn; + XkbControlsRec old; + cn.keycode= 0; + cn.eventType= 0; + cn.requestMajor= XkbReqCode; + cn.requestMinor= X_kbSetMap; + old= *xkb->ctrls; + xkb->ctrls->num_groups= s; + if (XkbComputeControlsNotify(dev,&old,xkb->ctrls,&cn,FALSE)) + XkbSendControlsNotify(dev,&cn); + } + return (char *)wire; +} + +static char * +SetKeyActions( XkbDescPtr xkb, + xkbSetMapReq * req, + CARD8 * wire, + XkbChangesPtr changes) +{ +register unsigned i,first,last; +CARD8 * nActs = wire; +XkbAction * newActs; + + wire+= XkbPaddedSize(req->nKeyActs); + for (i=0;inKeyActs;i++) { + if (nActs[i]==0) + xkb->server->key_acts[i+req->firstKeyAct]= 0; + else { + newActs= XkbResizeKeyActions(xkb,i+req->firstKeyAct,nActs[i]); + memcpy((char *)newActs,(char *)wire, + nActs[i]*SIZEOF(xkbActionWireDesc)); + wire+= nActs[i]*SIZEOF(xkbActionWireDesc); + } + } + first= req->firstKeyAct; + last= (first+req->nKeyActs-1); + if (changes->map.changed&XkbKeyActionsMask) { + int oldLast; + oldLast= changes->map.first_key_act+changes->map.num_key_acts-1; + if (changes->map.first_key_actmap.first_key_act; + if (oldLast>last) + last= oldLast; + } + changes->map.changed|= XkbKeyActionsMask; + changes->map.first_key_act= first; + changes->map.num_key_acts= (last-first+1); + return (char *)wire; +} + +static char * +SetKeyBehaviors( XkbSrvInfoPtr xkbi, + xkbSetMapReq *req, + xkbBehaviorWireDesc *wire, + XkbChangesPtr changes) +{ +register unsigned i; +int maxRG = -1; +XkbDescPtr xkb = xkbi->desc; +XkbServerMapPtr server = xkb->server; +unsigned first,last; + + first= req->firstKeyBehavior; + last= req->firstKeyBehavior+req->nKeyBehaviors-1; + memset(&server->behaviors[first], 0, req->nKeyBehaviors*sizeof(XkbBehavior)); + for (i=0;itotalKeyBehaviors;i++) { + if ((server->behaviors[wire->key].type&XkbKB_Permanent)==0) { + server->behaviors[wire->key].type= wire->type; + server->behaviors[wire->key].data= wire->data; + if ((wire->type==XkbKB_RadioGroup)&&(((int)wire->data)>maxRG)) + maxRG= wire->data + 1; + } + wire++; + } + + if (maxRG>(int)xkbi->nRadioGroups) { + int sz = maxRG*sizeof(XkbRadioGroupRec); + if (xkbi->radioGroups) + xkbi->radioGroups= realloc(xkbi->radioGroups,sz); + else xkbi->radioGroups= calloc(1, sz); + if (xkbi->radioGroups) { + if (xkbi->nRadioGroups) + memset(&xkbi->radioGroups[xkbi->nRadioGroups], 0, + (maxRG-xkbi->nRadioGroups)*sizeof(XkbRadioGroupRec)); + xkbi->nRadioGroups= maxRG; + } + else xkbi->nRadioGroups= 0; + /* should compute members here */ + } + if (changes->map.changed&XkbKeyBehaviorsMask) { + unsigned oldLast; + oldLast= changes->map.first_key_behavior+ + changes->map.num_key_behaviors-1; + if (changes->map.first_key_behaviorfirstKeyBehavior) + first= changes->map.first_key_behavior; + if (oldLast>last) + last= oldLast; + } + changes->map.changed|= XkbKeyBehaviorsMask; + changes->map.first_key_behavior = first; + changes->map.num_key_behaviors = (last-first+1); + return (char *)wire; +} + +static char * +SetVirtualMods(XkbSrvInfoPtr xkbi,xkbSetMapReq *req,CARD8 *wire, + XkbChangesPtr changes) +{ +register int i,bit,nMods; +XkbServerMapPtr srv = xkbi->desc->server; + + if (((req->present&XkbVirtualModsMask)==0)||(req->virtualMods==0)) + return (char *)wire; + for (i=nMods=0,bit=1;ivirtualMods&bit) { + if (srv->vmods[i]!=wire[nMods]) { + changes->map.changed|= XkbVirtualModsMask; + changes->map.vmods|= bit; + srv->vmods[i]= wire[nMods]; + } + nMods++; + } + } + return (char *)(wire+XkbPaddedSize(nMods)); +} + +static char * +SetKeyExplicit(XkbSrvInfoPtr xkbi,xkbSetMapReq *req,CARD8 *wire, + XkbChangesPtr changes) +{ +register unsigned i,first,last; +XkbServerMapPtr xkb = xkbi->desc->server; +CARD8 * start; + + start= wire; + first= req->firstKeyExplicit; + last= req->firstKeyExplicit+req->nKeyExplicit-1; + memset(&xkb->explicit[first], 0, req->nKeyExplicit); + for (i=0;itotalKeyExplicit;i++,wire+= 2) { + xkb->explicit[wire[0]]= wire[1]; + } + if (first>0) { + if (changes->map.changed&XkbExplicitComponentsMask) { + int oldLast; + oldLast= changes->map.first_key_explicit+ + changes->map.num_key_explicit-1; + if (changes->map.first_key_explicitmap.first_key_explicit; + if (oldLast>last) + last= oldLast; + } + changes->map.first_key_explicit= first; + changes->map.num_key_explicit= (last-first)+1; + } + wire+= XkbPaddedSize(wire-start)-(wire-start); + return (char *)wire; +} + +static char * +SetModifierMap( XkbSrvInfoPtr xkbi, + xkbSetMapReq * req, + CARD8 * wire, + XkbChangesPtr changes) +{ +register unsigned i,first,last; +XkbClientMapPtr xkb = xkbi->desc->map; +CARD8 * start; + + start= wire; + first= req->firstModMapKey; + last= req->firstModMapKey+req->nModMapKeys-1; + memset(&xkb->modmap[first], 0, req->nModMapKeys); + for (i=0;itotalModMapKeys;i++,wire+= 2) { + xkb->modmap[wire[0]]= wire[1]; + } + if (first>0) { + if (changes->map.changed&XkbModifierMapMask) { + int oldLast; + oldLast= changes->map.first_modmap_key+ + changes->map.num_modmap_keys-1; + if (changes->map.first_modmap_keymap.first_modmap_key; + if (oldLast>last) + last= oldLast; + } + changes->map.first_modmap_key= first; + changes->map.num_modmap_keys= (last-first)+1; + } + wire+= XkbPaddedSize(wire-start)-(wire-start); + return (char *)wire; +} + +static char * +SetVirtualModMap( XkbSrvInfoPtr xkbi, + xkbSetMapReq * req, + xkbVModMapWireDesc * wire, + XkbChangesPtr changes) +{ +register unsigned i,first,last; +XkbServerMapPtr srv = xkbi->desc->server; + + first= req->firstVModMapKey; + last= req->firstVModMapKey+req->nVModMapKeys-1; + memset(&srv->vmodmap[first], 0, req->nVModMapKeys*sizeof(unsigned short)); + for (i=0;itotalVModMapKeys;i++,wire++) { + srv->vmodmap[wire->key]= wire->vmods; + } + if (first>0) { + if (changes->map.changed&XkbVirtualModMapMask) { + int oldLast; + oldLast= changes->map.first_vmodmap_key+ + changes->map.num_vmodmap_keys-1; + if (changes->map.first_vmodmap_keymap.first_vmodmap_key; + if (oldLast>last) + last= oldLast; + } + changes->map.first_vmodmap_key= first; + changes->map.num_vmodmap_keys= (last-first)+1; + } + return (char *)wire; +} + +/** + * Check if the given request can be applied to the given device but don't + * actually do anything.. + */ +static int +_XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq *req, char* values) +{ + XkbSrvInfoPtr xkbi; + XkbDescPtr xkb; + int error; + int nTypes = 0, nActions; + CARD8 mapWidths[XkbMaxLegalKeyCode + 1] = {0}; + CARD16 symsPerKey[XkbMaxLegalKeyCode + 1] = {0}; + XkbSymMapPtr map; + int i; + + xkbi= dev->key->xkbInfo; + xkb = xkbi->desc; + + if ((xkb->min_key_code != req->minKeyCode)|| + (xkb->max_key_code != req->maxKeyCode)) { + if (client->vMajor!=1) { /* pre 1.0 versions of Xlib have a bug */ + req->minKeyCode= xkb->min_key_code; + req->maxKeyCode= xkb->max_key_code; + } + else { + if (!XkbIsLegalKeycode(req->minKeyCode)) { + client->errorValue = _XkbErrCode3(2, req->minKeyCode, req->maxKeyCode); + return BadValue; + } + if (req->minKeyCode > req->maxKeyCode) { + client->errorValue = _XkbErrCode3(3, req->minKeyCode, req->maxKeyCode); + return BadMatch; + } + } + } + + if ((req->present & XkbKeyTypesMask) && + (!CheckKeyTypes(client,xkb,req,(xkbKeyTypeWireDesc **)&values, + &nTypes,mapWidths))) { + client->errorValue = nTypes; + return BadValue; + } + + /* symsPerKey/mapWidths must be filled regardless of client-side flags */ + map = &xkb->map->key_sym_map[xkb->min_key_code]; + for (i=xkb->min_key_code;imax_key_code;i++,map++) { + register int g,ng,w; + ng= XkbNumGroups(map->group_info); + for (w=g=0;gkt_index[g]>=(unsigned)nTypes) { + client->errorValue = _XkbErrCode4(0x13,i,g,map->kt_index[g]); + return 0; + } + if (mapWidths[map->kt_index[g]]>w) + w= mapWidths[map->kt_index[g]]; + } + symsPerKey[i] = w*ng; + } + + if ((req->present & XkbKeySymsMask) && + (!CheckKeySyms(client,xkb,req,nTypes,mapWidths,symsPerKey, + (xkbSymMapWireDesc **)&values,&error))) { + client->errorValue = error; + return BadValue; + } + + if ((req->present & XkbKeyActionsMask) && + (!CheckKeyActions(xkb,req,nTypes,mapWidths,symsPerKey, + (CARD8 **)&values,&nActions))) { + client->errorValue = nActions; + return BadValue; + } + + if ((req->present & XkbKeyBehaviorsMask) && + (!CheckKeyBehaviors(xkb,req,(xkbBehaviorWireDesc**)&values,&error))) { + client->errorValue = error; + return BadValue; + } + + if ((req->present & XkbVirtualModsMask) && + (!CheckVirtualMods(xkb,req,(CARD8 **)&values,&error))) { + client->errorValue= error; + return BadValue; + } + if ((req->present&XkbExplicitComponentsMask) && + (!CheckKeyExplicit(xkb,req,(CARD8 **)&values,&error))) { + client->errorValue= error; + return BadValue; + } + if ((req->present&XkbModifierMapMask) && + (!CheckModifierMap(xkb,req,(CARD8 **)&values,&error))) { + client->errorValue= error; + return BadValue; + } + if ((req->present&XkbVirtualModMapMask) && + (!CheckVirtualModMap(xkb,req,(xkbVModMapWireDesc **)&values,&error))) { + client->errorValue= error; + return BadValue; + } + + if (((values-((char *)req))/4)!= req->length) { + ErrorF("[xkb] Internal error! Bad length in XkbSetMap (after check)\n"); + client->errorValue = values-((char *)&req[1]); + return BadLength; + } + + return Success; +} + +/** + * Apply the given request on the given device. + */ +static int +_XkbSetMap(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq *req, char *values) +{ + XkbEventCauseRec cause; + XkbChangesRec change; + Bool sentNKN; + XkbSrvInfoPtr xkbi; + XkbDescPtr xkb; + + xkbi= dev->key->xkbInfo; + xkb = xkbi->desc; + + XkbSetCauseXkbReq(&cause,X_kbSetMap,client); + memset(&change, 0, sizeof(change)); + sentNKN = FALSE; + if ((xkb->min_key_code!=req->minKeyCode)|| + (xkb->max_key_code!=req->maxKeyCode)) { + Status status; + xkbNewKeyboardNotify nkn; + nkn.deviceID = nkn.oldDeviceID = dev->id; + nkn.oldMinKeyCode = xkb->min_key_code; + nkn.oldMaxKeyCode = xkb->max_key_code; + status= XkbChangeKeycodeRange(xkb, req->minKeyCode, + req->maxKeyCode, &change); + if (status != Success) + return status; /* oh-oh. what about the other keyboards? */ + nkn.minKeyCode = xkb->min_key_code; + nkn.maxKeyCode = xkb->max_key_code; + nkn.requestMajor = XkbReqCode; + nkn.requestMinor = X_kbSetMap; + nkn.changed = XkbNKN_KeycodesMask; + XkbSendNewKeyboardNotify(dev,&nkn); + sentNKN = TRUE; + } + + if (req->present&XkbKeyTypesMask) { + values = SetKeyTypes(xkb,req,(xkbKeyTypeWireDesc *)values,&change); + if (!values) goto allocFailure; + } + if (req->present&XkbKeySymsMask) { + values = SetKeySyms(client,xkb,req,(xkbSymMapWireDesc *)values,&change,dev); + if (!values) goto allocFailure; + } + if (req->present&XkbKeyActionsMask) { + values = SetKeyActions(xkb,req,(CARD8 *)values,&change); + if (!values) goto allocFailure; + } + if (req->present&XkbKeyBehaviorsMask) { + values= SetKeyBehaviors(xkbi,req,(xkbBehaviorWireDesc *)values,&change); + if (!values) goto allocFailure; + } + if (req->present&XkbVirtualModsMask) + values= SetVirtualMods(xkbi,req,(CARD8 *)values,&change); + if (req->present&XkbExplicitComponentsMask) + values= SetKeyExplicit(xkbi,req,(CARD8 *)values,&change); + if (req->present&XkbModifierMapMask) + values= SetModifierMap(xkbi,req,(CARD8 *)values,&change); + if (req->present&XkbVirtualModMapMask) + values= SetVirtualModMap(xkbi,req,(xkbVModMapWireDesc *)values,&change); + if (((values-((char *)req))/4)!=req->length) { + ErrorF("[xkb] Internal error! Bad length in XkbSetMap (after set)\n"); + client->errorValue = values-((char *)&req[1]); + return BadLength; + } + if (req->flags&XkbSetMapRecomputeActions) { + KeyCode first,last,firstMM,lastMM; + if (change.map.num_key_syms>0) { + first= change.map.first_key_sym; + last= first+change.map.num_key_syms-1; + } + else first= last= 0; + if (change.map.num_modmap_keys>0) { + firstMM= change.map.first_modmap_key; + lastMM= first+change.map.num_modmap_keys-1; + } + else firstMM= lastMM= 0; + if ((last>0) && (lastMM>0)) { + if (firstMMlast) + last= lastMM; + } + else if (lastMM>0) { + first= firstMM; + last= lastMM; + } + if (last>0) { + unsigned check= 0; + XkbUpdateActions(dev,first,(last-first+1),&change,&check,&cause); + if (check) + XkbCheckSecondaryEffects(xkbi,check,&change,&cause); + } + } + if (!sentNKN) + XkbSendNotification(dev,&change,&cause); + + return Success; +allocFailure: + return BadAlloc; +} + + +int +ProcXkbSetMap(ClientPtr client) +{ + DeviceIntPtr dev; + char * tmp; + int rc; + + REQUEST(xkbSetMapReq); + REQUEST_AT_LEAST_SIZE(xkbSetMapReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); + CHK_MASK_LEGAL(0x01,stuff->present,XkbAllMapComponentsMask); + + tmp = (char *)&stuff[1]; + + /* Check if we can to the SetMap on the requested device. If this + succeeds, do the same thing for all extension devices (if needed). + If any of them fails, fail. */ + rc = _XkbSetMapChecks(client, dev, stuff, tmp); + + if (rc != Success) + return rc; + + if (stuff->deviceSpec == XkbUseCoreKbd) + { + DeviceIntPtr other; + for (other = inputInfo.devices; other; other = other->next) + { + if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) + { + rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); + if (rc == Success) + { + rc = _XkbSetMapChecks(client, other, stuff, tmp); + if (rc != Success) + return rc; + } + } + } + } + + /* We know now that we will succed with the SetMap. In theory anyway. */ + rc = _XkbSetMap(client, dev, stuff, tmp); + if (rc != Success) + return rc; + + if (stuff->deviceSpec == XkbUseCoreKbd) + { + DeviceIntPtr other; + for (other = inputInfo.devices; other; other = other->next) + { + if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) + { + rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); + if (rc == Success) + _XkbSetMap(client, other, stuff, tmp); + /* ignore rc. if the SetMap failed although the check above + reported true there isn't much we can do. we still need to + set all other devices, hoping that at least they stay in + sync. */ + } + } + } + + return Success; +} + +/***====================================================================***/ + +static Status +XkbComputeGetCompatMapReplySize( XkbCompatMapPtr compat, + xkbGetCompatMapReply * rep) +{ +unsigned size,nGroups; + + nGroups= 0; + if (rep->groups!=0) { + register int i,bit; + for (i=0,bit=1;igroups&bit) + nGroups++; + } + } + size= nGroups*SIZEOF(xkbModsWireDesc); + size+= (rep->nSI*SIZEOF(xkbSymInterpretWireDesc)); + rep->length= size/4; + return Success; +} + +static int +XkbSendCompatMap( ClientPtr client, + XkbCompatMapPtr compat, + xkbGetCompatMapReply * rep) +{ +char * data; +int size; + + size= rep->length*4; + if (size>0) { + data = malloc(size); + if (data) { + register unsigned i,bit; + xkbModsWireDesc * grp; + XkbSymInterpretPtr sym= &compat->sym_interpret[rep->firstSI]; + xkbSymInterpretWireDesc *wire = (xkbSymInterpretWireDesc *)data; + for (i=0;inSI;i++,sym++,wire++) { + wire->sym= sym->sym; + wire->mods= sym->mods; + wire->match= sym->match; + wire->virtualMod= sym->virtual_mod; + wire->flags= sym->flags; + memcpy((char*)&wire->act,(char*)&sym->act,sz_xkbActionWireDesc); + if (client->swapped) { + register int n; + swapl(&wire->sym,n); + } + } + if (rep->groups) { + grp = (xkbModsWireDesc *)wire; + for (i=0,bit=1;igroups&bit) { + grp->mask= compat->groups[i].mask; + grp->realMods= compat->groups[i].real_mods; + grp->virtualMods= compat->groups[i].vmods; + if (client->swapped) { + register int n; + swaps(&grp->virtualMods,n); + } + grp++; + } + } + wire= (xkbSymInterpretWireDesc*)grp; + } + } + else return BadAlloc; + } + 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); + } + + WriteToClient(client, SIZEOF(xkbGetCompatMapReply), (char *)rep); + if (data) { + WriteToClient(client, size, data); + free((char *)data); + } + return Success; +} + +int +ProcXkbGetCompatMap(ClientPtr client) +{ + xkbGetCompatMapReply rep; + DeviceIntPtr dev; + XkbDescPtr xkb; + XkbCompatMapPtr compat; + + REQUEST(xkbGetCompatMapReq); + REQUEST_SIZE_MATCH(xkbGetCompatMapReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); + + xkb = dev->key->xkbInfo->desc; + compat= xkb->compat; + + rep.type = X_Reply; + rep.deviceID = dev->id; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.firstSI = stuff->firstSI; + rep.nSI = stuff->nSI; + if (stuff->getAllSI) { + rep.firstSI = 0; + rep.nSI = compat->num_si; + } + else if ((((unsigned)stuff->nSI)>0)&& + ((unsigned)(stuff->firstSI+stuff->nSI-1)>=compat->num_si)) { + client->errorValue = _XkbErrCode2(0x05,compat->num_si); + return BadValue; + } + rep.nTotalSI = compat->num_si; + rep.groups= stuff->groups; + XkbComputeGetCompatMapReplySize(compat,&rep); + return XkbSendCompatMap(client,compat,&rep); +} + +/** + * Apply the given request on the given device. + * If dryRun is TRUE, then value checks are performed, but the device isn't + * modified. + */ +static int +_XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev, + xkbSetCompatMapReq *req, char* data, BOOL dryRun) +{ + XkbSrvInfoPtr xkbi; + XkbDescPtr xkb; + XkbCompatMapPtr compat; + int nGroups; + unsigned i,bit; + + xkbi = dev->key->xkbInfo; + xkb = xkbi->desc; + compat = xkb->compat; + + if ((req->nSI>0)||(req->truncateSI)) { + xkbSymInterpretWireDesc *wire; + if (req->firstSI>compat->num_si) { + client->errorValue = _XkbErrCode2(0x02,compat->num_si); + return BadValue; + } + wire= (xkbSymInterpretWireDesc *)data; + wire+= req->nSI; + data = (char *)wire; + } + + nGroups= 0; + if (req->groups!=0) { + for (i=0,bit=1;igroups&bit ) + nGroups++; + } + } + data+= nGroups*SIZEOF(xkbModsWireDesc); + if (((data-((char *)req))/4)!=req->length) { + return BadLength; + } + + /* Done all the checks we can do */ + if (dryRun) + return Success; + + data = (char *)&req[1]; + if (req->nSI>0) { + xkbSymInterpretWireDesc *wire = (xkbSymInterpretWireDesc *)data; + XkbSymInterpretPtr sym; + if ((unsigned)(req->firstSI+req->nSI)>compat->num_si) { + compat->num_si= req->firstSI+req->nSI; + compat->sym_interpret= realloc(compat->sym_interpret, + compat->num_si * sizeof(XkbSymInterpretRec)); + if (!compat->sym_interpret) { + compat->num_si= 0; + return BadAlloc; + } + } + else if (req->truncateSI) { + compat->num_si = req->firstSI+req->nSI; + } + sym = &compat->sym_interpret[req->firstSI]; + for (i=0;inSI;i++,wire++,sym++) { + if (client->swapped) { + int n; + swapl(&wire->sym,n); + } + sym->sym= wire->sym; + sym->mods= wire->mods; + sym->match= wire->match; + sym->flags= wire->flags; + sym->virtual_mod= wire->virtualMod; + memcpy((char *)&sym->act,(char *)&wire->act, + SIZEOF(xkbActionWireDesc)); + } + data = (char *)wire; + } + else if (req->truncateSI) { + compat->num_si = req->firstSI; + } + + if (req->groups!=0) { + unsigned i, bit; + xkbModsWireDesc *wire = (xkbModsWireDesc *)data; + for (i = 0, bit = 1; i < XkbNumKbdGroups; i++, bit <<= 1) { + if (req->groups & bit) { + if (client->swapped) { + int n; + swaps(&wire->virtualMods,n); + } + compat->groups[i].mask= wire->realMods; + compat->groups[i].real_mods= wire->realMods; + compat->groups[i].vmods= wire->virtualMods; + if (wire->virtualMods!=0) { + unsigned tmp; + tmp= XkbMaskForVMask(xkb,wire->virtualMods); + compat->groups[i].mask|= tmp; + } + data+= SIZEOF(xkbModsWireDesc); + wire= (xkbModsWireDesc *)data; + } + } + } + i= XkbPaddedSize((data-((char *)req))); + if ((i/4)!=req->length) { + ErrorF("[xkb] Internal length error on read in _XkbSetCompatMap\n"); + return BadLength; + } + + if (dev->xkb_interest) { + xkbCompatMapNotify ev; + ev.deviceID = dev->id; + ev.changedGroups = req->groups; + ev.firstSI = req->firstSI; + ev.nSI = req->nSI; + ev.nTotalSI = compat->num_si; + XkbSendCompatMapNotify(dev,&ev); + } + + if (req->recomputeActions) { + XkbChangesRec change; + unsigned check; + XkbEventCauseRec cause; + + XkbSetCauseXkbReq(&cause,X_kbSetCompatMap,client); + memset(&change, 0, sizeof(XkbChangesRec)); + XkbUpdateActions(dev,xkb->min_key_code,XkbNumKeys(xkb),&change,&check, + &cause); + if (check) + XkbCheckSecondaryEffects(xkbi,check,&change,&cause); + XkbSendNotification(dev,&change,&cause); + } + return Success; +} + +int +ProcXkbSetCompatMap(ClientPtr client) +{ + DeviceIntPtr dev; + char *data; + int rc; + + REQUEST(xkbSetCompatMapReq); + REQUEST_AT_LEAST_SIZE(xkbSetCompatMapReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); + + data = (char *)&stuff[1]; + + /* check first using a dry-run */ + rc = _XkbSetCompatMap(client, dev, stuff, data, TRUE); + if (rc != Success) + return rc; + if (stuff->deviceSpec == XkbUseCoreKbd) + { + DeviceIntPtr other; + for (other = inputInfo.devices; other; other = other->next) + { + if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) + { + rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); + if (rc == Success) + { + /* dry-run */ + rc = _XkbSetCompatMap(client, other, stuff, data, TRUE); + if (rc != Success) + return rc; + } + } + } + } + + /* Yay, the dry-runs succeed. Let's apply */ + rc = _XkbSetCompatMap(client, dev, stuff, data, FALSE); + if (rc != Success) + return rc; + if (stuff->deviceSpec == XkbUseCoreKbd) + { + DeviceIntPtr other; + for (other = inputInfo.devices; other; other = other->next) + { + if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) + { + rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); + if (rc == Success) + { + rc = _XkbSetCompatMap(client, other, stuff, data, FALSE); + if (rc != Success) + return rc; + } + } + } + } + + return Success; +} + +/***====================================================================***/ + +int +ProcXkbGetIndicatorState(ClientPtr client) +{ + xkbGetIndicatorStateReply rep; + XkbSrvLedInfoPtr sli; + DeviceIntPtr dev; + register int i; + + REQUEST(xkbGetIndicatorStateReq); + REQUEST_SIZE_MATCH(xkbGetIndicatorStateReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixReadAccess); + + sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId, + XkbXI_IndicatorStateMask); + if (!sli) + return BadAlloc; + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.deviceID = dev->id; + rep.state = sli->effectiveState; + + if (client->swapped) { + swaps(&rep.sequenceNumber,i); + swapl(&rep.state,i); + } + WriteToClient(client, SIZEOF(xkbGetIndicatorStateReply), (char *)&rep); + return Success; +} + +/***====================================================================***/ + +static Status +XkbComputeGetIndicatorMapReplySize( + XkbIndicatorPtr indicators, + xkbGetIndicatorMapReply *rep) +{ +register int i,bit; +int nIndicators; + + rep->realIndicators = indicators->phys_indicators; + for (i=nIndicators=0,bit=1;iwhich&bit) + nIndicators++; + } + rep->length = (nIndicators*SIZEOF(xkbIndicatorMapWireDesc))/4; + return Success; +} + +static int +XkbSendIndicatorMap( ClientPtr client, + XkbIndicatorPtr indicators, + xkbGetIndicatorMapReply * rep) +{ +int length; +CARD8 * map; +register int i; +register unsigned bit; + + length = rep->length*4; + if (length>0) { + CARD8 *to; + to= map= malloc(length); + if (map) { + xkbIndicatorMapWireDesc *wire = (xkbIndicatorMapWireDesc *)to; + for (i=0,bit=1;iwhich&bit) { + wire->flags= indicators->maps[i].flags; + wire->whichGroups= indicators->maps[i].which_groups; + wire->groups= indicators->maps[i].groups; + wire->whichMods= indicators->maps[i].which_mods; + wire->mods= indicators->maps[i].mods.mask; + wire->realMods= indicators->maps[i].mods.real_mods; + 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); + } + wire++; + } + } + to = (CARD8 *)wire; + if ((to-map)!=length) { + client->errorValue = _XkbErrCode2(0xff,length); + free(map); + return BadLength; + } + } + else return BadAlloc; + } + else map = NULL; + if (client->swapped) { + swaps(&rep->sequenceNumber,i); + swapl(&rep->length,i); + swapl(&rep->which,i); + swapl(&rep->realIndicators,i); + } + WriteToClient(client, SIZEOF(xkbGetIndicatorMapReply), (char *)rep); + if (map) { + WriteToClient(client, length, (char *)map); + free((char *)map); + } + return Success; +} + +int +ProcXkbGetIndicatorMap(ClientPtr client) +{ +xkbGetIndicatorMapReply rep; +DeviceIntPtr dev; +XkbDescPtr xkb; +XkbIndicatorPtr leds; + + REQUEST(xkbGetIndicatorMapReq); + REQUEST_SIZE_MATCH(xkbGetIndicatorMapReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); + + xkb= dev->key->xkbInfo->desc; + leds= xkb->indicators; + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.deviceID = dev->id; + rep.which = stuff->which; + XkbComputeGetIndicatorMapReplySize(leds,&rep); + return XkbSendIndicatorMap(client,leds,&rep); +} + +/** + * Apply the given map to the given device. Which specifies which components + * to apply. + */ +static int +_XkbSetIndicatorMap(ClientPtr client, DeviceIntPtr dev, + int which, xkbIndicatorMapWireDesc *desc) +{ + XkbSrvInfoPtr xkbi; + XkbSrvLedInfoPtr sli; + XkbEventCauseRec cause; + int i, bit; + + xkbi = dev->key->xkbInfo; + + sli= XkbFindSrvLedInfo(dev, XkbDfltXIClass, XkbDfltXIId, + XkbXI_IndicatorMapsMask); + if (!sli) + return BadAlloc; + + for (i = 0, bit = 1; i < XkbNumIndicators; i++, bit <<= 1) { + if (which & bit) { + sli->maps[i].flags = desc->flags; + sli->maps[i].which_groups = desc->whichGroups; + sli->maps[i].groups = desc->groups; + sli->maps[i].which_mods = desc->whichMods; + sli->maps[i].mods.mask = desc->mods; + sli->maps[i].mods.real_mods = desc->mods; + sli->maps[i].mods.vmods= desc->virtualMods; + sli->maps[i].ctrls = desc->ctrls; + if (desc->virtualMods!=0) { + unsigned tmp; + tmp= XkbMaskForVMask(xkbi->desc,desc->virtualMods); + sli->maps[i].mods.mask= desc->mods|tmp; + } + desc++; + } + } + + XkbSetCauseXkbReq(&cause,X_kbSetIndicatorMap,client); + XkbApplyLedMapChanges(dev,sli,which,NULL,NULL,&cause); + + return Success; +} + +int +ProcXkbSetIndicatorMap(ClientPtr client) +{ + int i, bit; + int nIndicators; + DeviceIntPtr dev; + xkbIndicatorMapWireDesc *from; + int rc; + + REQUEST(xkbSetIndicatorMapReq); + REQUEST_AT_LEAST_SIZE(xkbSetIndicatorMapReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess); + + if (stuff->which==0) + return Success; + + for (nIndicators=i=0,bit=1;iwhich&bit) + nIndicators++; + } + if (stuff->length!=((SIZEOF(xkbSetIndicatorMapReq)+ + (nIndicators*SIZEOF(xkbIndicatorMapWireDesc)))/4)) { + return BadLength; + } + + from = (xkbIndicatorMapWireDesc *)&stuff[1]; + for (i=0,bit=1;iwhich&bit) { + if (client->swapped) { + int n; + swaps(&from->virtualMods,n); + swapl(&from->ctrls,n); + } + CHK_MASK_LEGAL(i,from->whichGroups,XkbIM_UseAnyGroup); + CHK_MASK_LEGAL(i,from->whichMods,XkbIM_UseAnyMods); + from++; + } + } + + from = (xkbIndicatorMapWireDesc *)&stuff[1]; + rc = _XkbSetIndicatorMap(client, dev, stuff->which, from); + if (rc != Success) + return rc; + + if (stuff->deviceSpec == XkbUseCoreKbd) + { + DeviceIntPtr other; + for (other = inputInfo.devices; other; other = other->next) + { + if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) + { + rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixSetAttrAccess); + if (rc == Success) + _XkbSetIndicatorMap(client, other, stuff->which, from); + } + } + } + + return Success; +} + +/***====================================================================***/ + +int +ProcXkbGetNamedIndicator(ClientPtr client) +{ + DeviceIntPtr dev; + xkbGetNamedIndicatorReply rep; + register int i = 0; + XkbSrvLedInfoPtr sli; + XkbIndicatorMapPtr map = NULL; + + REQUEST(xkbGetNamedIndicatorReq); + REQUEST_SIZE_MATCH(xkbGetNamedIndicatorReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_LED_DEVICE(dev, stuff->deviceSpec, client, DixReadAccess); + CHK_ATOM_ONLY(stuff->indicator); + + sli= XkbFindSrvLedInfo(dev,stuff->ledClass,stuff->ledID,0); + if (!sli) + return BadAlloc; + + i= 0; + map= NULL; + if ((sli->names)&&(sli->maps)) { + for (i=0;iindicator==sli->names[i]) { + map= &sli->maps[i]; + break; + } + } + } + + rep.type= X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.deviceID = dev->id; + rep.indicator= stuff->indicator; + if (map!=NULL) { + rep.found= TRUE; + rep.on= ((sli->effectiveState&(1<physIndicators&(1<flags; + rep.whichGroups= map->which_groups; + rep.groups= map->groups; + rep.whichMods= map->which_mods; + rep.mods= map->mods.mask; + rep.realMods= map->mods.real_mods; + rep.virtualMods= map->mods.vmods; + rep.ctrls= map->ctrls; + rep.supported= TRUE; + } + else { + rep.found= FALSE; + rep.on= FALSE; + rep.realIndicator= FALSE; + rep.ndx= XkbNoIndicator; + rep.flags= 0; + rep.whichGroups= 0; + rep.groups= 0; + rep.whichMods= 0; + rep.mods= 0; + rep.realMods= 0; + rep.virtualMods= 0; + rep.ctrls= 0; + 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); + } + + WriteToClient(client,SIZEOF(xkbGetNamedIndicatorReply), (char *)&rep); + return Success; +} + + +/** + * Find the IM on the device. + * Returns the map, or NULL if the map doesn't exist. + * If the return value is NULL, led_return is undefined. Otherwise, led_return + * is set to the led index of the map. + */ +static XkbIndicatorMapPtr +_XkbFindNamedIndicatorMap(XkbSrvLedInfoPtr sli, Atom indicator, + int *led_return) +{ + XkbIndicatorMapPtr map; + + /* search for the right indicator */ + map = NULL; + if (sli->names && sli->maps) { + int led; + + for (led = 0; (led < XkbNumIndicators) && (map == NULL); led++) { + if (sli->names[led] == indicator) { + map= &sli->maps[led]; + *led_return = led; + break; + } + } + } + + return map; +} + +/** + * Creates an indicator map on the device. If dryRun is TRUE, it only checks + * if creation is possible, but doesn't actually create it. + */ +static int +_XkbCreateIndicatorMap(DeviceIntPtr dev, Atom indicator, + int ledClass, int ledID, + XkbIndicatorMapPtr *map_return, int *led_return, + Bool dryRun) +{ + XkbSrvLedInfoPtr sli; + XkbIndicatorMapPtr map; + int led; + + sli = XkbFindSrvLedInfo(dev, ledClass, ledID, XkbXI_IndicatorsMask); + if (!sli) + return BadAlloc; + + map = _XkbFindNamedIndicatorMap(sli, indicator, &led); + + if (!map) + { + /* find first unused indicator maps and assign the name to it */ + for (led = 0, map = NULL; (led < XkbNumIndicators) && (map == NULL); led++) { + if ((sli->names) && (sli->maps) && (sli->names[led] == None) && + (!XkbIM_InUse(&sli->maps[led]))) + { + map = &sli->maps[led]; + if (!dryRun) + sli->names[led] = indicator; + break; + } + } + } + + if (!map) + return BadAlloc; + + *led_return = led; + *map_return = map; + return Success; +} + +static int +_XkbSetNamedIndicator(ClientPtr client, DeviceIntPtr dev, + xkbSetNamedIndicatorReq *stuff) +{ + unsigned int extDevReason; + unsigned int statec, namec, mapc; + XkbSrvLedInfoPtr sli; + int led = 0; + XkbIndicatorMapPtr map; + DeviceIntPtr kbd; + XkbEventCauseRec cause; + xkbExtensionDeviceNotify ed; + XkbChangesRec changes; + int rc; + + rc = _XkbCreateIndicatorMap(dev, stuff->indicator, stuff->ledClass, + stuff->ledID, &map, &led, FALSE); + if (rc != Success || !map) /* oh-oh */ + return rc; + + sli = XkbFindSrvLedInfo(dev, stuff->ledClass, stuff->ledID, + XkbXI_IndicatorsMask); + if (!sli) + return BadAlloc; + + namec = mapc = statec = 0; + extDevReason = 0; + + namec |= (1<namesPresent |= ((stuff->indicator != None) ? (1 << led) : 0); + extDevReason |= XkbXI_IndicatorNamesMask; + + if (stuff->setMap) { + map->flags = stuff->flags; + map->which_groups = stuff->whichGroups; + map->groups = stuff->groups; + map->which_mods = stuff->whichMods; + map->mods.mask = stuff->realMods; + map->mods.real_mods = stuff->realMods; + map->mods.vmods= stuff->virtualMods; + map->ctrls = stuff->ctrls; + mapc|= (1<setState) && ((map->flags & XkbIM_NoExplicit) == 0)) + { + if (stuff->on) sli->explicitState |= (1<explicitState &= ~(1<effectiveState ^ sli->explicitState) & (1 << led)); + } + + memset((char *)&ed, 0, sizeof(xkbExtensionDeviceNotify)); + memset((char *)&changes, 0, sizeof(XkbChangesRec)); + XkbSetCauseXkbReq(&cause,X_kbSetNamedIndicator,client); + if (namec) + XkbApplyLedNameChanges(dev,sli,namec,&ed,&changes,&cause); + if (mapc) + XkbApplyLedMapChanges(dev,sli,mapc,&ed,&changes,&cause); + if (statec) + XkbApplyLedStateChanges(dev,sli,statec,&ed,&changes,&cause); + + kbd = dev; + if ((sli->flags&XkbSLI_HasOwnState)==0) + kbd = inputInfo.keyboard; + XkbFlushLedEvents(dev, kbd, sli, &ed, &changes, &cause); + + return Success; +} + +int +ProcXkbSetNamedIndicator(ClientPtr client) +{ + int rc; + DeviceIntPtr dev; + int led = 0; + XkbIndicatorMapPtr map; + + REQUEST(xkbSetNamedIndicatorReq); + REQUEST_SIZE_MATCH(xkbSetNamedIndicatorReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_LED_DEVICE(dev, stuff->deviceSpec, client, DixSetAttrAccess); + CHK_ATOM_ONLY(stuff->indicator); + CHK_MASK_LEGAL(0x10,stuff->whichGroups,XkbIM_UseAnyGroup); + CHK_MASK_LEGAL(0x11,stuff->whichMods,XkbIM_UseAnyMods); + + /* Dry-run for checks */ + rc = _XkbCreateIndicatorMap(dev, stuff->indicator, + stuff->ledClass, stuff->ledID, + &map, &led, TRUE); + if (rc != Success || !map) /* couldn't be created or didn't exist */ + return rc; + + if (stuff->deviceSpec == XkbUseCoreKbd || + stuff->deviceSpec == XkbUseCorePtr) + { + DeviceIntPtr other; + for (other = inputInfo.devices; other; other = other->next) + { + if ((other != dev) && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev && + (other->kbdfeed || other->leds) && + (XaceHook(XACE_DEVICE_ACCESS, client, other, DixSetAttrAccess) == Success)) + { + rc = _XkbCreateIndicatorMap(other, stuff->indicator, + stuff->ledClass, stuff->ledID, + &map, &led, TRUE); + if (rc != Success || !map) + return rc; + } + } + } + + /* All checks passed, let's do it */ + rc = _XkbSetNamedIndicator(client, dev, stuff); + if (rc != Success) + return rc; + + if (stuff->deviceSpec == XkbUseCoreKbd || + stuff->deviceSpec == XkbUseCorePtr) + { + DeviceIntPtr other; + for (other = inputInfo.devices; other; other = other->next) + { + if ((other != dev) && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev && + (other->kbdfeed || other->leds) && + (XaceHook(XACE_DEVICE_ACCESS, client, other, DixSetAttrAccess) == Success)) + { + _XkbSetNamedIndicator(client, other, stuff); + } + } + } + + return Success; +} + +/***====================================================================***/ + +static CARD32 +_XkbCountAtoms(Atom *atoms,int maxAtoms,int *count) +{ +register unsigned int i,bit,nAtoms; +register CARD32 atomsPresent; + + for (i=nAtoms=atomsPresent=0,bit=1;iminKeyCode= xkb->min_key_code; + rep->maxKeyCode= xkb->max_key_code; + which= rep->which; + length= 0; + if (xkb->names!=NULL) { + if (which&XkbKeycodesNameMask) length++; + if (which&XkbGeometryNameMask) length++; + if (which&XkbSymbolsNameMask) length++; + if (which&XkbPhysSymbolsNameMask) length++; + if (which&XkbTypesNameMask) length++; + if (which&XkbCompatNameMask) length++; + } + else which&= ~XkbComponentNamesMask; + + if (xkb->map!=NULL) { + if (which&XkbKeyTypeNamesMask) + length+= xkb->map->num_types; + rep->nTypes= xkb->map->num_types; + if (which&XkbKTLevelNamesMask) { + XkbKeyTypePtr pType = xkb->map->types; + int nKTLevels = 0; + + length+= XkbPaddedSize(xkb->map->num_types)/4; + for (i=0;imap->num_types;i++,pType++) { + if (pType->level_names!=NULL) + nKTLevels+= pType->num_levels; + } + rep->nKTLevels= nKTLevels; + length+= nKTLevels; + } + } + else { + rep->nTypes= 0; + rep->nKTLevels= 0; + which&= ~(XkbKeyTypeNamesMask|XkbKTLevelNamesMask); + } + + rep->minKeyCode= xkb->min_key_code; + rep->maxKeyCode= xkb->max_key_code; + rep->indicators= 0; + rep->virtualMods= 0; + rep->groupNames= 0; + if (xkb->names!=NULL) { + if (which&XkbIndicatorNamesMask) { + int nLeds; + rep->indicators= + _XkbCountAtoms(xkb->names->indicators,XkbNumIndicators,&nLeds); + length+= nLeds; + if (nLeds==0) + which&= ~XkbIndicatorNamesMask; + } + + if (which&XkbVirtualModNamesMask) { + int nVMods; + rep->virtualMods= + _XkbCountAtoms(xkb->names->vmods,XkbNumVirtualMods,&nVMods); + length+= nVMods; + if (nVMods==0) + which&= ~XkbVirtualModNamesMask; + } + + if (which&XkbGroupNamesMask) { + int nGroups; + rep->groupNames= + _XkbCountAtoms(xkb->names->groups,XkbNumKbdGroups,&nGroups); + length+= nGroups; + if (nGroups==0) + which&= ~XkbGroupNamesMask; + } + + if ((which&XkbKeyNamesMask)&&(xkb->names->keys)) + length+= rep->nKeys; + else which&= ~XkbKeyNamesMask; + + if ((which&XkbKeyAliasesMask)&& + (xkb->names->key_aliases)&&(xkb->names->num_key_aliases>0)) { + rep->nKeyAliases= xkb->names->num_key_aliases; + length+= rep->nKeyAliases*2; + } + else { + which&= ~XkbKeyAliasesMask; + rep->nKeyAliases= 0; + } + + if ((which&XkbRGNamesMask)&&(xkb->names->num_rg>0)) + length+= xkb->names->num_rg; + else which&= ~XkbRGNamesMask; + } + else { + which&= ~(XkbIndicatorNamesMask|XkbVirtualModNamesMask); + which&= ~(XkbGroupNamesMask|XkbKeyNamesMask|XkbKeyAliasesMask); + which&= ~XkbRGNamesMask; + } + + rep->length= length; + rep->which= which; + return Success; +} + +static int +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); + } + + start = desc = calloc(1, length); + if ( !start ) + return BadAlloc; + if (xkb->names) { + if (which&XkbKeycodesNameMask) { + *((CARD32 *)desc)= xkb->names->keycodes; + if (client->swapped) { + swapl(desc,n); + } + desc+= 4; + } + if (which&XkbGeometryNameMask) { + *((CARD32 *)desc)= xkb->names->geometry; + if (client->swapped) { + swapl(desc,n); + } + desc+= 4; + } + if (which&XkbSymbolsNameMask) { + *((CARD32 *)desc)= xkb->names->symbols; + if (client->swapped) { + swapl(desc,n); + } + desc+= 4; + } + if (which&XkbPhysSymbolsNameMask) { + register CARD32 *atm= (CARD32 *)desc; + atm[0]= (CARD32)xkb->names->phys_symbols; + if (client->swapped) { + swapl(&atm[0],n); + } + desc+= 4; + } + if (which&XkbTypesNameMask) { + *((CARD32 *)desc)= (CARD32)xkb->names->types; + if (client->swapped) { + swapl(desc,n); + } + desc+= 4; + } + if (which&XkbCompatNameMask) { + *((CARD32 *)desc)= (CARD32)xkb->names->compat; + if (client->swapped) { + swapl(desc,n); + } + desc+= 4; + } + if (which&XkbKeyTypeNamesMask) { + register CARD32 *atm= (CARD32 *)desc; + register XkbKeyTypePtr type= xkb->map->types; + + for (i=0;imap->num_types;i++,atm++,type++) { + *atm= (CARD32)type->name; + if (client->swapped) { + swapl(atm,n); + } + } + desc= (char *)atm; + } + if (which&XkbKTLevelNamesMask && xkb->map) { + XkbKeyTypePtr type = xkb->map->types; + register CARD32 *atm; + for (i=0;inTypes;i++,type++) { + *desc++ = type->num_levels; + } + desc+= XkbPaddedSize(rep->nTypes)-rep->nTypes; + + atm= (CARD32 *)desc; + type = xkb->map->types; + for (i=0;imap->num_types;i++,type++) { + register unsigned l; + if (type->level_names) { + for (l=0;lnum_levels;l++,atm++) { + *atm= type->level_names[l]; + if (client->swapped) { + swapl(atm,n); + } + } + desc+= type->num_levels*4; + } + } + } + if (which&XkbIndicatorNamesMask) { + desc= _XkbWriteAtoms(desc,xkb->names->indicators,XkbNumIndicators, + client->swapped); + } + if (which&XkbVirtualModNamesMask) { + desc= _XkbWriteAtoms(desc,xkb->names->vmods,XkbNumVirtualMods, + client->swapped); + } + if (which&XkbGroupNamesMask) { + desc= _XkbWriteAtoms(desc,xkb->names->groups,XkbNumKbdGroups, + client->swapped); + } + if (which&XkbKeyNamesMask) { + for (i=0;inKeys;i++,desc+= sizeof(XkbKeyNameRec)) { + *((XkbKeyNamePtr)desc)= xkb->names->keys[i+rep->firstKey]; + } + } + if (which&XkbKeyAliasesMask) { + XkbKeyAliasPtr pAl; + pAl= xkb->names->key_aliases; + for (i=0;inKeyAliases;i++,pAl++,desc+=2*XkbKeyNameLength) { + *((XkbKeyAliasPtr)desc)= *pAl; + } + } + if ((which&XkbRGNamesMask)&&(rep->nRadioGroups>0)) { + register CARD32 *atm= (CARD32 *)desc; + for (i=0;inRadioGroups;i++,atm++) { + *atm= (CARD32)xkb->names->radio_groups[i]; + if (client->swapped) { + swapl(atm,n); + } + } + desc+= rep->nRadioGroups*4; + } + } + + if ((desc-start)!=(length)) { + ErrorF("[xkb] BOGUS LENGTH in write names, expected %d, got %ld\n", + length, (unsigned long)(desc-start)); + } + WriteToClient(client, SIZEOF(xkbGetNamesReply), (char *)rep); + WriteToClient(client, length, start); + free((char *)start); + return Success; +} + +int +ProcXkbGetNames(ClientPtr client) +{ + DeviceIntPtr dev; + XkbDescPtr xkb; + xkbGetNamesReply rep; + + REQUEST(xkbGetNamesReq); + REQUEST_SIZE_MATCH(xkbGetNamesReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); + CHK_MASK_LEGAL(0x01,stuff->which,XkbAllNamesMask); + + xkb = dev->key->xkbInfo->desc; + memset(&rep, 0, sizeof(xkbGetNamesReply)); + rep.type= X_Reply; + rep.sequenceNumber= client->sequence; + rep.length = 0; + rep.deviceID = dev->id; + rep.which = stuff->which; + rep.nTypes = xkb->map->num_types; + rep.firstKey = xkb->min_key_code; + rep.nKeys = XkbNumKeys(xkb); + if (xkb->names!=NULL) { + rep.nKeyAliases= xkb->names->num_key_aliases; + rep.nRadioGroups = xkb->names->num_rg; + } + else { + rep.nKeyAliases= rep.nRadioGroups= 0; + } + XkbComputeGetNamesReplySize(xkb,&rep); + return XkbSendNames(client,xkb,&rep); +} + +/***====================================================================***/ + +static CARD32 * +_XkbCheckAtoms(CARD32 *wire,int nAtoms,int swapped,Atom *pError) +{ +register int i; + + for (i=0;ikey->xkbInfo->desc; + names = xkb->names; + + + if (stuff->which & XkbKeyTypeNamesMask) { + int i; + CARD32 *old; + if ( stuff->nTypes<1 ) { + client->errorValue = _XkbErrCode2(0x02,stuff->nTypes); + return BadValue; + } + if ((unsigned)(stuff->firstType+stuff->nTypes-1)>=xkb->map->num_types) { + client->errorValue = _XkbErrCode4(0x03,stuff->firstType, + stuff->nTypes, + xkb->map->num_types); + return BadValue; + } + if (((unsigned)stuff->firstType)<=XkbLastRequiredType) { + client->errorValue = _XkbErrCode2(0x04,stuff->firstType); + return BadAccess; + } + old= tmp; + tmp= _XkbCheckAtoms(tmp,stuff->nTypes,client->swapped,&bad); + if (!tmp) { + client->errorValue= bad; + return BadAtom; + } + for (i=0;inTypes;i++,old++) { + if (!_XkbCheckTypeName((Atom)*old,stuff->firstType+i)) + client->errorValue= _XkbErrCode2(0x05,i); + } + } + if (stuff->which&XkbKTLevelNamesMask) { + unsigned i; + XkbKeyTypePtr type; + CARD8 * width; + if ( stuff->nKTLevels<1 ) { + client->errorValue = _XkbErrCode2(0x05,stuff->nKTLevels); + return BadValue; + } + if ((unsigned)(stuff->firstKTLevel+stuff->nKTLevels-1)>= + xkb->map->num_types) { + client->errorValue = _XkbErrCode4(0x06,stuff->firstKTLevel, + stuff->nKTLevels,xkb->map->num_types); + return BadValue; + } + width = (CARD8 *)tmp; + tmp= (CARD32 *)(((char *)tmp)+XkbPaddedSize(stuff->nKTLevels)); + type = &xkb->map->types[stuff->firstKTLevel]; + for (i=0;inKTLevels;i++,type++) { + if (width[i]==0) + continue; + else if (width[i]!=type->num_levels) { + client->errorValue= _XkbErrCode4(0x07,i+stuff->firstKTLevel, + type->num_levels,width[i]); + return BadMatch; + } + tmp= _XkbCheckAtoms(tmp,width[i],client->swapped,&bad); + if (!tmp) { + client->errorValue= bad; + return BadAtom; + } + } + } + if (stuff->which&XkbIndicatorNamesMask) { + if (stuff->indicators==0) { + client->errorValue= 0x08; + return BadMatch; + } + tmp= _XkbCheckMaskedAtoms(tmp,XkbNumIndicators,stuff->indicators, + client->swapped,&bad); + if (!tmp) { + client->errorValue= bad; + return BadAtom; + } + } + if (stuff->which&XkbVirtualModNamesMask) { + if (stuff->virtualMods==0) { + client->errorValue= 0x09; + return BadMatch; + } + tmp= _XkbCheckMaskedAtoms(tmp,XkbNumVirtualMods, + (CARD32)stuff->virtualMods, + client->swapped,&bad); + if (!tmp) { + client->errorValue = bad; + return BadAtom; + } + } + if (stuff->which&XkbGroupNamesMask) { + if (stuff->groupNames==0) { + client->errorValue= 0x0a; + return BadMatch; + } + tmp= _XkbCheckMaskedAtoms(tmp,XkbNumKbdGroups, + (CARD32)stuff->groupNames, + client->swapped,&bad); + if (!tmp) { + client->errorValue = bad; + return BadAtom; + } + } + if (stuff->which&XkbKeyNamesMask) { + if (stuff->firstKey<(unsigned)xkb->min_key_code) { + client->errorValue= _XkbErrCode3(0x0b,xkb->min_key_code, + stuff->firstKey); + return BadValue; + } + if (((unsigned)(stuff->firstKey+stuff->nKeys-1)>xkb->max_key_code)|| + (stuff->nKeys<1)) { + client->errorValue= _XkbErrCode4(0x0c,xkb->max_key_code, + stuff->firstKey,stuff->nKeys); + return BadValue; + } + tmp+= stuff->nKeys; + } + if ((stuff->which&XkbKeyAliasesMask)&&(stuff->nKeyAliases>0)) { + tmp+= stuff->nKeyAliases*2; + } + if (stuff->which&XkbRGNamesMask) { + if ( stuff->nRadioGroups<1 ) { + client->errorValue= _XkbErrCode2(0x0d,stuff->nRadioGroups); + return BadValue; + } + tmp= _XkbCheckAtoms(tmp,stuff->nRadioGroups,client->swapped,&bad); + if (!tmp) { + client->errorValue= bad; + return BadAtom; + } + } + if ((tmp-((CARD32 *)stuff))!=stuff->length) { + client->errorValue = stuff->length; + return BadLength; + } + + + + return Success; +} + +static int +_XkbSetNames(ClientPtr client, DeviceIntPtr dev, xkbSetNamesReq *stuff) +{ + XkbDescRec *xkb; + XkbNamesRec *names; + CARD32 *tmp; + xkbNamesNotify nn; + + tmp = (CARD32 *)&stuff[1]; + xkb = dev->key->xkbInfo->desc; + names = xkb->names; + + if (XkbAllocNames(xkb,stuff->which,stuff->nRadioGroups, + stuff->nKeyAliases)!=Success) { + return BadAlloc; + } + + memset(&nn, 0, sizeof(xkbNamesNotify)); + nn.changed= stuff->which; + tmp = (CARD32 *)&stuff[1]; + if (stuff->which&XkbKeycodesNameMask) + names->keycodes= *tmp++; + if (stuff->which&XkbGeometryNameMask) + names->geometry= *tmp++; + if (stuff->which&XkbSymbolsNameMask) + names->symbols= *tmp++; + if (stuff->which&XkbPhysSymbolsNameMask) + names->phys_symbols= *tmp++; + if (stuff->which&XkbTypesNameMask) + names->types= *tmp++; + if (stuff->which&XkbCompatNameMask) + names->compat= *tmp++; + if ((stuff->which&XkbKeyTypeNamesMask)&&(stuff->nTypes>0)) { + register unsigned i; + register XkbKeyTypePtr type; + + type= &xkb->map->types[stuff->firstType]; + for (i=0;inTypes;i++,type++) { + type->name= *tmp++; + } + nn.firstType= stuff->firstType; + nn.nTypes= stuff->nTypes; + } + if (stuff->which&XkbKTLevelNamesMask) { + register XkbKeyTypePtr type; + register unsigned i; + CARD8 *width; + + width = (CARD8 *)tmp; + tmp= (CARD32 *)(((char *)tmp)+XkbPaddedSize(stuff->nKTLevels)); + type= &xkb->map->types[stuff->firstKTLevel]; + for (i=0;inKTLevels;i++,type++) { + if (width[i]>0) { + if (type->level_names) { + register unsigned n; + for (n=0;nlevel_names[n]= tmp[n]; + } + } + tmp+= width[i]; + } + } + nn.firstLevelName= 0; + nn.nLevelNames= stuff->nTypes; + } + if (stuff->which&XkbIndicatorNamesMask) { + tmp= _XkbCopyMaskedAtoms(tmp,names->indicators,XkbNumIndicators, + stuff->indicators); + nn.changedIndicators= stuff->indicators; + } + if (stuff->which&XkbVirtualModNamesMask) { + tmp= _XkbCopyMaskedAtoms(tmp,names->vmods,XkbNumVirtualMods, + stuff->virtualMods); + nn.changedVirtualMods= stuff->virtualMods; + } + if (stuff->which&XkbGroupNamesMask) { + tmp= _XkbCopyMaskedAtoms(tmp,names->groups,XkbNumKbdGroups, + stuff->groupNames); + nn.changedVirtualMods= stuff->groupNames; + } + if (stuff->which&XkbKeyNamesMask) { + memcpy((char*)&names->keys[stuff->firstKey],(char *)tmp, + stuff->nKeys*XkbKeyNameLength); + tmp+= stuff->nKeys; + nn.firstKey= stuff->firstKey; + nn.nKeys= stuff->nKeys; + } + if (stuff->which&XkbKeyAliasesMask) { + if (stuff->nKeyAliases>0) { + register int na= stuff->nKeyAliases; + if (XkbAllocNames(xkb,XkbKeyAliasesMask,0,na)!=Success) + return BadAlloc; + memcpy((char *)names->key_aliases,(char *)tmp, + stuff->nKeyAliases*sizeof(XkbKeyAliasRec)); + tmp+= stuff->nKeyAliases*2; + } + else if (names->key_aliases!=NULL) { + free(names->key_aliases); + names->key_aliases= NULL; + names->num_key_aliases= 0; + } + nn.nAliases= names->num_key_aliases; + } + if (stuff->which&XkbRGNamesMask) { + if (stuff->nRadioGroups>0) { + register unsigned i,nrg; + nrg= stuff->nRadioGroups; + if (XkbAllocNames(xkb,XkbRGNamesMask,nrg,0)!=Success) + return BadAlloc; + + for (i=0;inRadioGroups;i++) { + names->radio_groups[i]= tmp[i]; + } + tmp+= stuff->nRadioGroups; + } + else if (names->radio_groups) { + free(names->radio_groups); + names->radio_groups= NULL; + names->num_rg= 0; + } + nn.nRadioGroups= names->num_rg; + } + if (nn.changed) { + Bool needExtEvent; + needExtEvent= (nn.changed&XkbIndicatorNamesMask)!=0; + XkbSendNamesNotify(dev,&nn); + if (needExtEvent) { + XkbSrvLedInfoPtr sli; + xkbExtensionDeviceNotify edev; + register int i; + register unsigned bit; + + sli= XkbFindSrvLedInfo(dev,XkbDfltXIClass,XkbDfltXIId, + XkbXI_IndicatorsMask); + sli->namesPresent= 0; + for (i=0,bit=1;iindicators[i]!=None) + sli->namesPresent|= bit; + } + memset(&edev, 0, sizeof(xkbExtensionDeviceNotify)); + edev.reason= XkbXI_IndicatorNamesMask; + edev.ledClass= KbdFeedbackClass; + edev.ledID= dev->kbdfeed->ctrl.id; + edev.ledsDefined= sli->namesPresent|sli->mapsPresent; + edev.ledState= sli->effectiveState; + edev.firstBtn= 0; + edev.nBtns= 0; + edev.supported= XkbXI_AllFeaturesMask; + edev.unsupported= 0; + XkbSendExtensionDeviceNotify(dev,client,&edev); + } + } + return Success; +} + +int +ProcXkbSetNames(ClientPtr client) +{ + DeviceIntPtr dev; + CARD32 *tmp; + Atom bad; + int rc; + + REQUEST(xkbSetNamesReq); + REQUEST_AT_LEAST_SIZE(xkbSetNamesReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); + CHK_MASK_LEGAL(0x01,stuff->which,XkbAllNamesMask); + + /* check device-independent stuff */ + tmp = (CARD32 *)&stuff[1]; + + if (stuff->which&XkbKeycodesNameMask) { + tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad); + if (!tmp) { + client->errorValue = bad; + return BadAtom; + } + } + if (stuff->which&XkbGeometryNameMask) { + tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad); + if (!tmp) { + client->errorValue = bad; + return BadAtom; + } + } + if (stuff->which&XkbSymbolsNameMask) { + tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad); + if (!tmp) { + client->errorValue = bad; + return BadAtom; + } + } + if (stuff->which&XkbPhysSymbolsNameMask) { + tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad); + if (!tmp) { + client->errorValue= bad; + return BadAtom; + } + } + if (stuff->which&XkbTypesNameMask) { + tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad); + if (!tmp) { + client->errorValue = bad; + return BadAtom; + } + } + if (stuff->which&XkbCompatNameMask) { + tmp= _XkbCheckAtoms(tmp,1,client->swapped,&bad); + if (!tmp) { + client->errorValue = bad; + return BadAtom; + } + } + + /* start of device-dependent tests */ + rc = _XkbSetNamesCheck(client, dev, stuff, tmp); + if (rc != Success) + return rc; + + if (stuff->deviceSpec == XkbUseCoreKbd) + { + DeviceIntPtr other; + for (other = inputInfo.devices; other; other = other->next) + { + if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) + { + + rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); + if (rc == Success) + { + rc = _XkbSetNamesCheck(client, other, stuff, tmp); + if (rc != Success) + return rc; + } + } + } + } + + /* everything is okay -- update names */ + + rc = _XkbSetNames(client, dev, stuff); + if (rc != Success) + return rc; + + if (stuff->deviceSpec == XkbUseCoreKbd) + { + DeviceIntPtr other; + for (other = inputInfo.devices; other; other = other->next) + { + if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) + { + + rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); + if (rc == Success) + _XkbSetNames(client, other, stuff); + } + } + } + + /* everything is okay -- update names */ + + return Success; +} + +/***====================================================================***/ + +#include "xkbgeom.h" + +#define XkbSizeCountedString(s) ((s)?((((2+strlen(s))+3)/4)*4):4) + +static char * +XkbWriteCountedString(char *wire,char *str,Bool swap) +{ + CARD16 len,*pLen; + + if (!str) + return wire; + + len= strlen(str); + pLen= (CARD16 *)wire; + *pLen= len; + if (swap) { + register int n; + swaps(pLen,n); + } + memcpy(&wire[2],str,len); + wire+= ((2+len+3)/4)*4; + return wire; +} + +static int +XkbSizeGeomProperties(XkbGeometryPtr geom) +{ +register int i,size; +XkbPropertyPtr prop; + + for (size=i=0,prop=geom->properties;inum_properties;i++,prop++) { + size+= XkbSizeCountedString(prop->name); + size+= XkbSizeCountedString(prop->value); + } + return size; +} + +static char * +XkbWriteGeomProperties(char *wire,XkbGeometryPtr geom,Bool swap) +{ +register int i; +register XkbPropertyPtr prop; + + for (i=0,prop=geom->properties;inum_properties;i++,prop++) { + wire= XkbWriteCountedString(wire,prop->name,swap); + wire= XkbWriteCountedString(wire,prop->value,swap); + } + return wire; +} + +static int +XkbSizeGeomKeyAliases(XkbGeometryPtr geom) +{ + return geom->num_key_aliases*(2*XkbKeyNameLength); +} + +static char * +XkbWriteGeomKeyAliases(char *wire,XkbGeometryPtr geom,Bool swap) +{ +register int sz; + + sz= geom->num_key_aliases*(XkbKeyNameLength*2); + if (sz>0) { + memcpy(wire,(char *)geom->key_aliases,sz); + wire+= sz; + } + return wire; +} + +static int +XkbSizeGeomColors(XkbGeometryPtr geom) +{ +register int i,size; +register XkbColorPtr color; + + for (i=size=0,color=geom->colors;inum_colors;i++,color++) { + size+= XkbSizeCountedString(color->spec); + } + return size; +} + +static char * +XkbWriteGeomColors(char *wire,XkbGeometryPtr geom,Bool swap) +{ +register int i; +register XkbColorPtr color; + + for (i=0,color=geom->colors;inum_colors;i++,color++) { + wire= XkbWriteCountedString(wire,color->spec,swap); + } + return wire; +} + +static int +XkbSizeGeomShapes(XkbGeometryPtr geom) +{ +register int i,size; +register XkbShapePtr shape; + + for (i=size=0,shape=geom->shapes;inum_shapes;i++,shape++) { + register int n; + register XkbOutlinePtr ol; + size+= SIZEOF(xkbShapeWireDesc); + for (n=0,ol=shape->outlines;nnum_outlines;n++,ol++) { + size+= SIZEOF(xkbOutlineWireDesc); + size+= ol->num_points*SIZEOF(xkbPointWireDesc); + } + } + return size; +} + +static char * +XkbWriteGeomShapes(char *wire,XkbGeometryPtr geom,Bool swap) +{ +int i; +XkbShapePtr shape; +xkbShapeWireDesc * shapeWire; + + for (i=0,shape=geom->shapes;inum_shapes;i++,shape++) { + register int o; + XkbOutlinePtr ol; + xkbOutlineWireDesc * olWire; + shapeWire= (xkbShapeWireDesc *)wire; + shapeWire->name= shape->name; + shapeWire->nOutlines= shape->num_outlines; + if (shape->primary!=NULL) + shapeWire->primaryNdx= XkbOutlineIndex(shape,shape->primary); + else shapeWire->primaryNdx= XkbNoShape; + if (shape->approx!=NULL) + shapeWire->approxNdx= XkbOutlineIndex(shape,shape->approx); + else shapeWire->approxNdx= XkbNoShape; + if (swap) { + register int n; + swapl(&shapeWire->name,n); + } + wire= (char *)&shapeWire[1]; + for (o=0,ol=shape->outlines;onum_outlines;o++,ol++) { + register int p; + XkbPointPtr pt; + xkbPointWireDesc * ptWire; + olWire= (xkbOutlineWireDesc *)wire; + olWire->nPoints= ol->num_points; + olWire->cornerRadius= ol->corner_radius; + wire= (char *)&olWire[1]; + ptWire= (xkbPointWireDesc *)wire; + for (p=0,pt=ol->points;pnum_points;p++,pt++) { + 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); + } + } + wire= (char *)&ptWire[ol->num_points]; + } + } + return wire; +} + +static int +XkbSizeGeomDoodads(int num_doodads,XkbDoodadPtr doodad) +{ +register int i,size; + + for (i=size=0;iany.type==XkbTextDoodad) { + size+= XkbSizeCountedString(doodad->text.text); + size+= XkbSizeCountedString(doodad->text.font); + } + else if (doodad->any.type==XkbLogoDoodad) { + size+= XkbSizeCountedString(doodad->logo.logo_name); + } + } + return size; +} + +static char * +XkbWriteGeomDoodads(char *wire,int num_doodads,XkbDoodadPtr doodad,Bool swap) +{ +register int i; +xkbDoodadWireDesc * doodadWire; + + for (i=0;iany.name= doodad->any.name; + doodadWire->any.type= doodad->any.type; + doodadWire->any.priority= doodad->any.priority; + 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); + } + switch (doodad->any.type) { + case XkbOutlineDoodad: + case XkbSolidDoodad: + doodadWire->shape.angle= doodad->shape.angle; + doodadWire->shape.colorNdx= doodad->shape.color_ndx; + doodadWire->shape.shapeNdx= doodad->shape.shape_ndx; + if (swap) { + register int n; + swaps(&doodadWire->shape.angle,n); + } + break; + case XkbTextDoodad: + doodadWire->text.angle= doodad->text.angle; + doodadWire->text.width= doodad->text.width; + 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); + } + wire= XkbWriteCountedString(wire,doodad->text.text,swap); + wire= XkbWriteCountedString(wire,doodad->text.font,swap); + break; + case XkbIndicatorDoodad: + doodadWire->indicator.shapeNdx= doodad->indicator.shape_ndx; + doodadWire->indicator.onColorNdx=doodad->indicator.on_color_ndx; + doodadWire->indicator.offColorNdx= + doodad->indicator.off_color_ndx; + break; + case XkbLogoDoodad: + doodadWire->logo.angle= doodad->logo.angle; + doodadWire->logo.colorNdx= doodad->logo.color_ndx; + doodadWire->logo.shapeNdx= doodad->logo.shape_ndx; + wire= XkbWriteCountedString(wire,doodad->logo.logo_name,swap); + break; + default: + ErrorF("[xkb] Unknown doodad type %d in XkbWriteGeomDoodads\n", + doodad->any.type); + ErrorF("[xkb] Ignored\n"); + break; + } + } + return wire; +} + +static char * +XkbWriteGeomOverlay(char *wire,XkbOverlayPtr ol,Bool swap) +{ +register int r; +XkbOverlayRowPtr row; +xkbOverlayWireDesc * olWire; + + olWire= (xkbOverlayWireDesc *)wire; + olWire->name= ol->name; + olWire->nRows= ol->num_rows; + if (swap) { + register int n; + swapl(&olWire->name,n); + } + wire= (char *)&olWire[1]; + for (r=0,row=ol->rows;rnum_rows;r++,row++) { + unsigned int k; + XkbOverlayKeyPtr key; + xkbOverlayRowWireDesc * rowWire; + rowWire= (xkbOverlayRowWireDesc *)wire; + rowWire->rowUnder= row->row_under; + rowWire->nKeys= row->num_keys; + wire= (char *)&rowWire[1]; + for (k=0,key=row->keys;knum_keys;k++,key++) { + xkbOverlayKeyWireDesc * keyWire; + keyWire= (xkbOverlayKeyWireDesc *)wire; + memcpy(keyWire->over,key->over.name,XkbKeyNameLength); + memcpy(keyWire->under,key->under.name,XkbKeyNameLength); + wire= (char *)&keyWire[1]; + } + } + return wire; +} + +static int +XkbSizeGeomSections(XkbGeometryPtr geom) +{ +register int i,size; +XkbSectionPtr section; + + for (i=size=0,section=geom->sections;inum_sections;i++,section++) { + size+= SIZEOF(xkbSectionWireDesc); + if (section->rows) { + int r; + XkbRowPtr row; + for (r=0,row=section->rows;rnum_rows;row++,r++) { + size+= SIZEOF(xkbRowWireDesc); + size+= row->num_keys*SIZEOF(xkbKeyWireDesc); + } + } + if (section->doodads) + size+= XkbSizeGeomDoodads(section->num_doodads,section->doodads); + if (section->overlays) { + int o; + XkbOverlayPtr ol; + for (o=0,ol=section->overlays;onum_overlays;o++,ol++) { + int r; + XkbOverlayRowPtr row; + size+= SIZEOF(xkbOverlayWireDesc); + for (r=0,row=ol->rows;rnum_rows;r++,row++) { + size+= SIZEOF(xkbOverlayRowWireDesc); + size+= row->num_keys*SIZEOF(xkbOverlayKeyWireDesc); + } + } + } + } + return size; +} + +static char * +XkbWriteGeomSections(char *wire,XkbGeometryPtr geom,Bool swap) +{ +register int i; +XkbSectionPtr section; +xkbSectionWireDesc * sectionWire; + + for (i=0,section=geom->sections;inum_sections;i++,section++) { + sectionWire= (xkbSectionWireDesc *)wire; + sectionWire->name= section->name; + sectionWire->top= section->top; + sectionWire->left= section->left; + sectionWire->width= section->width; + sectionWire->height= section->height; + sectionWire->angle= section->angle; + sectionWire->priority= section->priority; + sectionWire->nRows= section->num_rows; + sectionWire->nDoodads= section->num_doodads; + sectionWire->nOverlays= section->num_overlays; + sectionWire->pad= 0; + if (swap) { + register int n; + swapl(§ionWire->name,n); + swaps(§ionWire->top,n); + swaps(§ionWire->left,n); + swaps(§ionWire->width,n); + swaps(§ionWire->height,n); + swaps(§ionWire->angle,n); + } + wire= (char *)§ionWire[1]; + if (section->rows) { + int r; + XkbRowPtr row; + xkbRowWireDesc * rowWire; + for (r=0,row=section->rows;rnum_rows;r++,row++) { + rowWire= (xkbRowWireDesc *)wire; + rowWire->top= row->top; + rowWire->left= row->left; + rowWire->nKeys= row->num_keys; + rowWire->vertical= row->vertical; + rowWire->pad= 0; + if (swap) { + register int n; + swaps(&rowWire->top,n); + swaps(&rowWire->left,n); + } + wire= (char *)&rowWire[1]; + if (row->keys) { + int k; + XkbKeyPtr key; + xkbKeyWireDesc * keyWire; + keyWire= (xkbKeyWireDesc *)wire; + for (k=0,key=row->keys;knum_keys;k++,key++) { + memcpy(keyWire[k].name,key->name.name,XkbKeyNameLength); + keyWire[k].gap= key->gap; + keyWire[k].shapeNdx= key->shape_ndx; + keyWire[k].colorNdx= key->color_ndx; + if (swap) { + register int n; + swaps(&keyWire[k].gap,n); + } + } + wire= (char *)&keyWire[row->num_keys]; + } + } + } + if (section->doodads) { + wire= XkbWriteGeomDoodads(wire, + section->num_doodads,section->doodads, + swap); + } + if (section->overlays) { + register int o; + for (o=0;onum_overlays;o++) { + wire= XkbWriteGeomOverlay(wire,§ion->overlays[o],swap); + } + } + } + return wire; +} + +static Status +XkbComputeGetGeometryReplySize( XkbGeometryPtr geom, + xkbGetGeometryReply * rep, + Atom name) +{ +int len; + + if (geom!=NULL) { + len= XkbSizeCountedString(geom->label_font); + len+= XkbSizeGeomProperties(geom); + len+= XkbSizeGeomColors(geom); + len+= XkbSizeGeomShapes(geom); + len+= XkbSizeGeomSections(geom); + len+= XkbSizeGeomDoodads(geom->num_doodads,geom->doodads); + len+= XkbSizeGeomKeyAliases(geom); + rep->length= len/4; + rep->found= TRUE; + rep->name= geom->name; + rep->widthMM= geom->width_mm; + rep->heightMM= geom->height_mm; + rep->nProperties= geom->num_properties; + rep->nColors= geom->num_colors; + rep->nShapes= geom->num_shapes; + rep->nSections= geom->num_sections; + rep->nDoodads= geom->num_doodads; + rep->nKeyAliases= geom->num_key_aliases; + rep->baseColorNdx= XkbGeomColorIndex(geom,geom->base_color); + rep->labelColorNdx= XkbGeomColorIndex(geom,geom->label_color); + } + else { + rep->length= 0; + rep->found= FALSE; + rep->name= name; + rep->widthMM= rep->heightMM= 0; + rep->nProperties= rep->nColors= rep->nShapes= 0; + rep->nSections= rep->nDoodads= 0; + rep->nKeyAliases= 0; + rep->labelColorNdx= rep->baseColorNdx= 0; + } + return Success; +} + +static int +XkbSendGeometry( ClientPtr client, + XkbGeometryPtr geom, + xkbGetGeometryReply * rep, + Bool freeGeom) +{ + char *desc,*start; + int len; + + if (geom!=NULL) { + len= rep->length*4; + start= desc= malloc(len); + if (!start) + return BadAlloc; + desc= XkbWriteCountedString(desc,geom->label_font,client->swapped); + if ( rep->nProperties>0 ) + desc = XkbWriteGeomProperties(desc,geom,client->swapped); + if ( rep->nColors>0 ) + desc = XkbWriteGeomColors(desc,geom,client->swapped); + if ( rep->nShapes>0 ) + desc = XkbWriteGeomShapes(desc,geom,client->swapped); + if ( rep->nSections>0 ) + desc = XkbWriteGeomSections(desc,geom,client->swapped); + if ( rep->nDoodads>0 ) + desc = XkbWriteGeomDoodads(desc,geom->num_doodads,geom->doodads, + client->swapped); + if ( rep->nKeyAliases>0 ) + desc = XkbWriteGeomKeyAliases(desc,geom,client->swapped); + if ((desc-start)!=(len)) { + ErrorF("[xkb] BOGUS LENGTH in XkbSendGeometry, expected %d, got %ld\n", + len, (unsigned long)(desc-start)); + } + } + else { + len= 0; + 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); + } + WriteToClient(client, SIZEOF(xkbGetGeometryReply), (char *)rep); + if (len>0) + WriteToClient(client, len, start); + if (start!=NULL) + free((char *)start); + if (freeGeom) + XkbFreeGeometry(geom,XkbGeomAllMask,TRUE); + return Success; +} + +int +ProcXkbGetGeometry(ClientPtr client) +{ + DeviceIntPtr dev; + xkbGetGeometryReply rep; + XkbGeometryPtr geom; + Bool shouldFree; + Status status; + + REQUEST(xkbGetGeometryReq); + REQUEST_SIZE_MATCH(xkbGetGeometryReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); + CHK_ATOM_OR_NONE(stuff->name); + + geom= XkbLookupNamedGeometry(dev,stuff->name,&shouldFree); + rep.type= X_Reply; + rep.deviceID= dev->id; + rep.sequenceNumber= client->sequence; + rep.length= 0; + status= XkbComputeGetGeometryReplySize(geom,&rep,stuff->name); + if (status!=Success) + return status; + else return XkbSendGeometry(client,geom,&rep,shouldFree); +} + +/***====================================================================***/ + +static char * +_GetCountedString(char **wire_inout,Bool swap) +{ +char * wire,*str; +CARD16 len,*plen; + + wire= *wire_inout; + plen= (CARD16 *)wire; + if (swap) { + register int n; + swaps(plen,n); + } + len= *plen; + str= malloc(len+1); + if (str) { + memcpy(str,&wire[2],len); + str[len]= '\0'; + } + wire+= XkbPaddedSize(len+2); + *wire_inout= wire; + return str; +} + +static Status +_CheckSetDoodad( char ** wire_inout, + XkbGeometryPtr geom, + XkbSectionPtr section, + ClientPtr client) +{ +char * wire; +xkbDoodadWireDesc * dWire; +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); + } + CHK_ATOM_ONLY(dWire->any.name); + doodad= XkbAddGeomDoodad(geom,section,dWire->any.name); + if (!doodad) + return BadAlloc; + doodad->any.type= dWire->any.type; + doodad->any.priority= dWire->any.priority; + doodad->any.top= dWire->any.top; + doodad->any.left= dWire->any.left; + doodad->any.angle= dWire->any.angle; + switch (doodad->any.type) { + case XkbOutlineDoodad: + case XkbSolidDoodad: + if (dWire->shape.colorNdx>=geom->num_colors) { + client->errorValue= _XkbErrCode3(0x40,geom->num_colors, + dWire->shape.colorNdx); + return BadMatch; + } + if (dWire->shape.shapeNdx>=geom->num_shapes) { + client->errorValue= _XkbErrCode3(0x41,geom->num_shapes, + dWire->shape.shapeNdx); + return BadMatch; + } + doodad->shape.color_ndx= dWire->shape.colorNdx; + doodad->shape.shape_ndx= dWire->shape.shapeNdx; + break; + case XkbTextDoodad: + if (dWire->text.colorNdx>=geom->num_colors) { + client->errorValue= _XkbErrCode3(0x42,geom->num_colors, + dWire->text.colorNdx); + return BadMatch; + } + if (client->swapped) { + register int n; + swaps(&dWire->text.width,n); + swaps(&dWire->text.height,n); + } + doodad->text.width= dWire->text.width; + doodad->text.height= dWire->text.height; + doodad->text.color_ndx= dWire->text.colorNdx; + doodad->text.text= _GetCountedString(&wire,client->swapped); + doodad->text.font= _GetCountedString(&wire,client->swapped); + break; + case XkbIndicatorDoodad: + if (dWire->indicator.onColorNdx>=geom->num_colors) { + client->errorValue= _XkbErrCode3(0x43,geom->num_colors, + dWire->indicator.onColorNdx); + return BadMatch; + } + if (dWire->indicator.offColorNdx>=geom->num_colors) { + client->errorValue= _XkbErrCode3(0x44,geom->num_colors, + dWire->indicator.offColorNdx); + return BadMatch; + } + if (dWire->indicator.shapeNdx>=geom->num_shapes) { + client->errorValue= _XkbErrCode3(0x45,geom->num_shapes, + dWire->indicator.shapeNdx); + return BadMatch; + } + doodad->indicator.shape_ndx= dWire->indicator.shapeNdx; + doodad->indicator.on_color_ndx= dWire->indicator.onColorNdx; + doodad->indicator.off_color_ndx= dWire->indicator.offColorNdx; + break; + case XkbLogoDoodad: + if (dWire->logo.colorNdx>=geom->num_colors) { + client->errorValue= _XkbErrCode3(0x46,geom->num_colors, + dWire->logo.colorNdx); + return BadMatch; + } + if (dWire->logo.shapeNdx>=geom->num_shapes) { + client->errorValue= _XkbErrCode3(0x47,geom->num_shapes, + dWire->logo.shapeNdx); + return BadMatch; + } + doodad->logo.color_ndx= dWire->logo.colorNdx; + doodad->logo.shape_ndx= dWire->logo.shapeNdx; + doodad->logo.logo_name= _GetCountedString(&wire,client->swapped); + break; + default: + client->errorValue= _XkbErrCode2(0x4F,dWire->any.type); + return BadValue; + } + *wire_inout= wire; + return Success; +} + +static Status +_CheckSetOverlay( char ** wire_inout, + XkbGeometryPtr geom, + XkbSectionPtr section, + ClientPtr client) +{ +register int r; +char * wire; +XkbOverlayPtr ol; +xkbOverlayWireDesc * olWire; +xkbOverlayRowWireDesc * rWire; + + wire= *wire_inout; + olWire= (xkbOverlayWireDesc *)wire; + if (client->swapped) { + register int n; + swapl(&olWire->name,n); + } + CHK_ATOM_ONLY(olWire->name); + ol= XkbAddGeomOverlay(section,olWire->name,olWire->nRows); + rWire= (xkbOverlayRowWireDesc *)&olWire[1]; + for (r=0;rnRows;r++) { + register int k; + xkbOverlayKeyWireDesc * kWire; + XkbOverlayRowPtr row; + + if (rWire->rowUnder>section->num_rows) { + client->errorValue= _XkbErrCode4(0x20,r,section->num_rows, + rWire->rowUnder); + return BadMatch; + } + row= XkbAddGeomOverlayRow(ol,rWire->rowUnder,rWire->nKeys); + kWire= (xkbOverlayKeyWireDesc *)&rWire[1]; + for (k=0;knKeys;k++,kWire++) { + if (XkbAddGeomOverlayKey(ol,row, + (char *)kWire->over,(char *)kWire->under)==NULL) { + client->errorValue= _XkbErrCode3(0x21,r,k); + return BadMatch; + } + } + rWire= (xkbOverlayRowWireDesc *)kWire; + } + olWire= (xkbOverlayWireDesc *)rWire; + wire= (char *)olWire; + *wire_inout= wire; + return Success; +} + +static Status +_CheckSetSections( XkbGeometryPtr geom, + xkbSetGeometryReq * req, + char ** wire_inout, + ClientPtr client) +{ +Status status; +register int s; +char * wire; +xkbSectionWireDesc * sWire; +XkbSectionPtr section; + + wire= *wire_inout; + if (req->nSections<1) + return Success; + sWire= (xkbSectionWireDesc *)wire; + for (s=0;snSections;s++) { + 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); + } + CHK_ATOM_ONLY(sWire->name); + section= XkbAddGeomSection(geom,sWire->name,sWire->nRows, + sWire->nDoodads,sWire->nOverlays); + if (!section) + return BadAlloc; + section->priority= sWire->priority; + section->top= sWire->top; + section->left= sWire->left; + section->width= sWire->width; + section->height= sWire->height; + section->angle= sWire->angle; + rWire= (xkbRowWireDesc *)&sWire[1]; + for (r=0;rnRows;r++) { + register int k; + XkbRowPtr row; + xkbKeyWireDesc * kWire; + if (client->swapped) { + register int n; + swaps(&rWire->top,n); + swaps(&rWire->left,n); + } + row= XkbAddGeomRow(section,rWire->nKeys); + if (!row) + return BadAlloc; + row->top= rWire->top; + row->left= rWire->left; + row->vertical= rWire->vertical; + kWire= (xkbKeyWireDesc *)&rWire[1]; + for (k=0;knKeys;k++) { + XkbKeyPtr key; + key= XkbAddGeomKey(row); + if (!key) + return BadAlloc; + memcpy(key->name.name,kWire[k].name,XkbKeyNameLength); + key->gap= kWire[k].gap; + key->shape_ndx= kWire[k].shapeNdx; + key->color_ndx= kWire[k].colorNdx; + if (key->shape_ndx>=geom->num_shapes) { + client->errorValue= _XkbErrCode3(0x10,key->shape_ndx, + geom->num_shapes); + return BadMatch; + } + if (key->color_ndx>=geom->num_colors) { + client->errorValue= _XkbErrCode3(0x11,key->color_ndx, + geom->num_colors); + return BadMatch; + } + } + rWire= (xkbRowWireDesc *)&kWire[rWire->nKeys]; + } + wire= (char *)rWire; + if (sWire->nDoodads>0) { + register int d; + for (d=0;dnDoodads;d++) { + status=_CheckSetDoodad(&wire,geom,section,client); + if (status!=Success) + return status; + } + } + if (sWire->nOverlays>0) { + register int o; + for (o=0;onOverlays;o++) { + status= _CheckSetOverlay(&wire,geom,section,client); + if (status!=Success) + return status; + } + } + sWire= (xkbSectionWireDesc *)wire; + } + wire= (char *)sWire; + *wire_inout= wire; + return Success; +} + +static Status +_CheckSetShapes( XkbGeometryPtr geom, + xkbSetGeometryReq * req, + char ** wire_inout, + ClientPtr client) +{ +register int i; +char * wire; + + wire= *wire_inout; + if (req->nShapes<1) { + client->errorValue= _XkbErrCode2(0x06,req->nShapes); + return BadValue; + } + else { + xkbShapeWireDesc * shapeWire; + XkbShapePtr shape; + register int o; + shapeWire= (xkbShapeWireDesc *)wire; + for (i=0;inShapes;i++) { + xkbOutlineWireDesc * olWire; + XkbOutlinePtr ol; + shape= XkbAddGeomShape(geom,shapeWire->name,shapeWire->nOutlines); + if (!shape) + return BadAlloc; + olWire= (xkbOutlineWireDesc *)(&shapeWire[1]); + for (o=0;onOutlines;o++) { + register int p; + XkbPointPtr pt; + xkbPointWireDesc * ptWire; + + ol= XkbAddGeomOutline(shape,olWire->nPoints); + if (!ol) + return BadAlloc; + ol->corner_radius= olWire->cornerRadius; + ptWire= (xkbPointWireDesc *)&olWire[1]; + for (p=0,pt=ol->points;pnPoints;p++,pt++) { + pt->x= ptWire[p].x; + pt->y= ptWire[p].y; + if (client->swapped) { + register int n; + swaps(&pt->x,n); + swaps(&pt->y,n); + } + } + ol->num_points= olWire->nPoints; + olWire= (xkbOutlineWireDesc *)(&ptWire[olWire->nPoints]); + } + if (shapeWire->primaryNdx!=XkbNoShape) + shape->primary= &shape->outlines[shapeWire->primaryNdx]; + if (shapeWire->approxNdx!=XkbNoShape) + shape->approx= &shape->outlines[shapeWire->approxNdx]; + shapeWire= (xkbShapeWireDesc *)olWire; + } + wire= (char *)shapeWire; + } + if (geom->num_shapes!=req->nShapes) { + client->errorValue= _XkbErrCode3(0x07,geom->num_shapes,req->nShapes); + return BadMatch; + } + + *wire_inout= wire; + return Success; +} + +static Status +_CheckSetGeom( XkbGeometryPtr geom, + xkbSetGeometryReq * req, + ClientPtr client) +{ +register int i; +Status status; +char * wire; + + wire= (char *)&req[1]; + geom->label_font= _GetCountedString(&wire,client->swapped); + + for (i=0;inProperties;i++) { + char *name,*val; + name= _GetCountedString(&wire,client->swapped); + if (!name) + return BadAlloc; + val= _GetCountedString(&wire,client->swapped); + if (!val) { + free(name); + return BadAlloc; + } + if (XkbAddGeomProperty(geom,name,val)==NULL) { + free(name); + free(val); + return BadAlloc; + } + free(name); + free(val); + } + + if (req->nColors<2) { + client->errorValue= _XkbErrCode3(0x01,2,req->nColors); + return BadValue; + } + if (req->baseColorNdx>req->nColors) { + client->errorValue=_XkbErrCode3(0x03,req->nColors,req->baseColorNdx); + return BadMatch; + } + if (req->labelColorNdx>req->nColors) { + client->errorValue= _XkbErrCode3(0x03,req->nColors,req->labelColorNdx); + return BadMatch; + } + if (req->labelColorNdx==req->baseColorNdx) { + client->errorValue= _XkbErrCode3(0x04,req->baseColorNdx, + req->labelColorNdx); + return BadMatch; + } + + for (i=0;inColors;i++) { + char *name; + name= _GetCountedString(&wire,client->swapped); + if (!name) + return BadAlloc; + if (!XkbAddGeomColor(geom,name,geom->num_colors)) { + free(name); + return BadAlloc; + } + free(name); + } + if (req->nColors!=geom->num_colors) { + client->errorValue= _XkbErrCode3(0x05,req->nColors,geom->num_colors); + return BadMatch; + } + geom->label_color= &geom->colors[req->labelColorNdx]; + geom->base_color= &geom->colors[req->baseColorNdx]; + + if ((status=_CheckSetShapes(geom,req,&wire,client))!=Success) + return status; + + if ((status=_CheckSetSections(geom,req,&wire,client))!=Success) + return status; + + for (i=0;inDoodads;i++) { + status=_CheckSetDoodad(&wire,geom,NULL,client); + if (status!=Success) + return status; + } + + for (i=0;inKeyAliases;i++) { + if (XkbAddGeomKeyAlias(geom,&wire[XkbKeyNameLength],wire)==NULL) + return BadAlloc; + wire+= 2*XkbKeyNameLength; + } + return Success; +} + +static int +_XkbSetGeometry(ClientPtr client, DeviceIntPtr dev, xkbSetGeometryReq *stuff) +{ + XkbDescPtr xkb; + Bool new_name; + xkbNewKeyboardNotify nkn; + XkbGeometryPtr geom,old; + XkbGeometrySizesRec sizes; + Status status; + + xkb= dev->key->xkbInfo->desc; + old= xkb->geom; + xkb->geom= NULL; + + sizes.which= XkbGeomAllMask; + sizes.num_properties= stuff->nProperties; + sizes.num_colors= stuff->nColors; + sizes.num_shapes= stuff->nShapes; + sizes.num_sections= stuff->nSections; + sizes.num_doodads= stuff->nDoodads; + sizes.num_key_aliases= stuff->nKeyAliases; + if ((status= XkbAllocGeometry(xkb,&sizes))!=Success) { + xkb->geom= old; + return status; + } + geom= xkb->geom; + geom->name= stuff->name; + geom->width_mm= stuff->widthMM; + geom->height_mm= stuff->heightMM; + if ((status= _CheckSetGeom(geom,stuff,client))!=Success) { + XkbFreeGeometry(geom,XkbGeomAllMask,TRUE); + xkb->geom= old; + return status; + } + new_name= (xkb->names->geometry!=geom->name); + xkb->names->geometry= geom->name; + if (old) + XkbFreeGeometry(old,XkbGeomAllMask,TRUE); + if (new_name) { + xkbNamesNotify nn; + memset(&nn, 0, sizeof(xkbNamesNotify)); + nn.changed= XkbGeometryNameMask; + XkbSendNamesNotify(dev,&nn); + } + nkn.deviceID= nkn.oldDeviceID= dev->id; + nkn.minKeyCode= nkn.oldMinKeyCode= xkb->min_key_code; + nkn.maxKeyCode= nkn.oldMaxKeyCode= xkb->max_key_code; + nkn.requestMajor= XkbReqCode; + nkn.requestMinor= X_kbSetGeometry; + nkn.changed= XkbNKN_GeometryMask; + XkbSendNewKeyboardNotify(dev,&nkn); + return Success; +} + +int +ProcXkbSetGeometry(ClientPtr client) +{ + DeviceIntPtr dev; + int rc; + + REQUEST(xkbSetGeometryReq); + REQUEST_AT_LEAST_SIZE(xkbSetGeometryReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); + CHK_ATOM_OR_NONE(stuff->name); + + rc = _XkbSetGeometry(client, dev, stuff); + if (rc != Success) + return rc; + + if (stuff->deviceSpec == XkbUseCoreKbd) + { + DeviceIntPtr other; + for (other = inputInfo.devices; other; other = other->next) + { + if ((other != dev) && other->key && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) + { + rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); + if (rc == Success) + _XkbSetGeometry(client, other, stuff); + } + } + } + + return Success; +} + +/***====================================================================***/ + +int +ProcXkbPerClientFlags(ClientPtr client) +{ + DeviceIntPtr dev; + xkbPerClientFlagsReply rep; + XkbInterestPtr interest; + Mask access_mode = DixGetAttrAccess | DixSetAttrAccess; + + REQUEST(xkbPerClientFlagsReq); + REQUEST_SIZE_MATCH(xkbPerClientFlagsReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, access_mode); + CHK_MASK_LEGAL(0x01,stuff->change,XkbPCF_AllFlagsMask); + CHK_MASK_MATCH(0x02,stuff->change,stuff->value); + + interest = XkbFindClientResource((DevicePtr)dev,client); + memset(&rep, 0, sizeof(xkbPerClientFlagsReply)); + rep.type= X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + if (stuff->change) { + client->xkbClientFlags&= ~stuff->change; + client->xkbClientFlags|= stuff->value; + } + if (stuff->change&XkbPCF_AutoResetControlsMask) { + Bool want; + want= stuff->value&XkbPCF_AutoResetControlsMask; + if (interest && !want) { + interest->autoCtrls= interest->autoCtrlValues= 0; + } + else if (want && (!interest)) { + XID id = FakeClientID(client->index); + if (!AddResource(id,RT_XKBCLIENT,dev)) + return BadAlloc; + interest= XkbAddClientResource((DevicePtr)dev,client,id); + if (!interest) + return BadAlloc; + } + if (interest && want ) { + register unsigned affect; + affect= stuff->ctrlsToChange; + + CHK_MASK_LEGAL(0x03,affect,XkbAllBooleanCtrlsMask); + CHK_MASK_MATCH(0x04,affect,stuff->autoCtrls); + CHK_MASK_MATCH(0x05,stuff->autoCtrls,stuff->autoCtrlValues); + + interest->autoCtrls&= ~affect; + interest->autoCtrlValues&= ~affect; + interest->autoCtrls|= stuff->autoCtrls&affect; + interest->autoCtrlValues|= stuff->autoCtrlValues&affect; + } + } + rep.supported = XkbPCF_AllFlagsMask; + rep.value= client->xkbClientFlags&XkbPCF_AllFlagsMask; + if (interest) { + rep.autoCtrls= interest->autoCtrls; + rep.autoCtrlValues= interest->autoCtrlValues; + } + else { + 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); + } + WriteToClient(client,SIZEOF(xkbPerClientFlagsReply), (char *)&rep); + return Success; +} + +/***====================================================================***/ + +/* all latin-1 alphanumerics, plus parens, minus, underscore, slash */ +/* and wildcards */ +static unsigned char componentSpecLegal[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, 0xff, 0x87, + 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x07, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff +}; + +/* same as above but accepts percent, plus and bar too */ +static unsigned char componentExprLegal[] = { + 0x00, 0x00, 0x00, 0x00, 0x20, 0xaf, 0xff, 0x87, + 0xfe, 0xff, 0xff, 0x87, 0xfe, 0xff, 0xff, 0x17, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x7f, 0xff, 0xff, 0xff, 0x7f, 0xff +}; + +static char * +GetComponentSpec(unsigned char **pWire,Bool allowExpr,int *errRtrn) +{ +int len; +register int i; +unsigned char *wire,*str,*tmp,*legal; + + if (allowExpr) legal= &componentExprLegal[0]; + else legal= &componentSpecLegal[0]; + + wire= *pWire; + len= (*(unsigned char *)wire++); + if (len>0) { + str= calloc(1, len+1); + if (str) { + tmp= str; + for (i=0;ixkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); + + status= Success; + str= (unsigned char *)&stuff[1]; + memset(&list, 0, sizeof(XkbSrvListInfoRec)); + list.maxRtrn= stuff->maxNames; + list.pattern[_XkbListKeycodes]= GetComponentSpec(&str,FALSE,&status); + list.pattern[_XkbListTypes]= GetComponentSpec(&str,FALSE,&status); + list.pattern[_XkbListCompat]= GetComponentSpec(&str,FALSE,&status); + list.pattern[_XkbListSymbols]= GetComponentSpec(&str,FALSE,&status); + list.pattern[_XkbListGeometry]= GetComponentSpec(&str,FALSE,&status); + if (status!=Success) + return status; + len= str-((unsigned char *)stuff); + if ((XkbPaddedSize(len)/4)!=stuff->length) + return BadLength; + if ((status=XkbDDXList(dev,&list,client))!=Success) { + free(list.pool); + list.pool = NULL; + return status; + } + memset(&rep, 0, sizeof(xkbListComponentsReply)); + rep.type= X_Reply; + rep.deviceID = dev->id; + rep.sequenceNumber = client->sequence; + rep.length = XkbPaddedSize(list.nPool)/4; + rep.nKeymaps = 0; + rep.nKeycodes = list.nFound[_XkbListKeycodes]; + rep.nTypes = list.nFound[_XkbListTypes]; + rep.nCompatMaps = list.nFound[_XkbListCompat]; + rep.nSymbols = list.nFound[_XkbListSymbols]; + rep.nGeometries = list.nFound[_XkbListGeometry]; + rep.extra= 0; + 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); + } + WriteToClient(client,SIZEOF(xkbListComponentsReply),(char *)&rep); + if (list.nPool && list.pool) { + WriteToClient(client,XkbPaddedSize(list.nPool), (char *)list.pool); + free(list.pool); + list.pool= NULL; + } + return Success; +} + +/***====================================================================***/ + +int +ProcXkbGetKbdByName(ClientPtr client) +{ + DeviceIntPtr dev; + DeviceIntPtr tmpd; + xkbGetKbdByNameReply rep = {0}; + xkbGetMapReply mrep = {0}; + xkbGetCompatMapReply crep = {0}; + xkbGetIndicatorMapReply irep = {0}; + xkbGetNamesReply nrep = {0}; + xkbGetGeometryReply grep = {0}; + XkbComponentNamesRec names = {0}; + XkbDescPtr xkb, new; + unsigned char * str; + char mapFile[PATH_MAX]; + unsigned len; + unsigned fwant,fneed,reported; + int status; + Bool geom_changed; + XkbSrvLedInfoPtr old_sli; + XkbSrvLedInfoPtr sli; + Mask access_mode = DixGetAttrAccess | DixManageAccess; + + REQUEST(xkbGetKbdByNameReq); + REQUEST_AT_LEAST_SIZE(xkbGetKbdByNameReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, access_mode); + + xkb = dev->key->xkbInfo->desc; + status= Success; + str= (unsigned char *)&stuff[1]; + if (GetComponentSpec(&str,TRUE,&status)) /* keymap, unsupported */ + return BadMatch; + names.keycodes= GetComponentSpec(&str,TRUE,&status); + names.types= GetComponentSpec(&str,TRUE,&status); + names.compat= GetComponentSpec(&str,TRUE,&status); + names.symbols= GetComponentSpec(&str,TRUE,&status); + names.geometry= GetComponentSpec(&str,TRUE,&status); + if (status!=Success) + return status; + len= str-((unsigned char *)stuff); + if ((XkbPaddedSize(len)/4)!=stuff->length) + return BadLength; + + CHK_MASK_LEGAL(0x01,stuff->want,XkbGBN_AllComponentsMask); + CHK_MASK_LEGAL(0x02,stuff->need,XkbGBN_AllComponentsMask); + + if (stuff->load) + fwant= XkbGBN_AllComponentsMask; + else fwant= stuff->want|stuff->need; + if ((!names.compat)&& + (fwant&(XkbGBN_CompatMapMask|XkbGBN_IndicatorMapMask))) { + names.compat= _XkbDupString("%"); + } + if ((!names.types)&&(fwant&(XkbGBN_TypesMask))) { + names.types= _XkbDupString("%"); + } + if ((!names.symbols)&&(fwant&XkbGBN_SymbolsMask)) { + names.symbols= _XkbDupString("%"); + } + geom_changed= ((names.geometry!=NULL)&&(strcmp(names.geometry,"%")!=0)); + if ((!names.geometry)&&(fwant&XkbGBN_GeometryMask)) { + names.geometry= _XkbDupString("%"); + geom_changed= FALSE; + } + + memset(mapFile, 0, PATH_MAX); + rep.type= X_Reply; + rep.deviceID = dev->id; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.minKeyCode = xkb->min_key_code; + rep.maxKeyCode = xkb->max_key_code; + rep.loaded= FALSE; + fwant= XkbConvertGetByNameComponents(TRUE,stuff->want)|XkmVirtualModsMask; + fneed= XkbConvertGetByNameComponents(TRUE,stuff->need); + rep.reported= XkbConvertGetByNameComponents(FALSE,fwant|fneed); + if (stuff->load) { + fneed|= XkmKeymapRequired; + fwant|= XkmKeymapLegal; + } + if ((fwant|fneed)&XkmSymbolsMask) { + fneed|= XkmKeyNamesIndex|XkmTypesIndex; + fwant|= XkmIndicatorsIndex; + } + + /* We pass dev in here so we can get the old names out if needed. */ + rep.found = XkbDDXLoadKeymapByNames(dev,&names,fwant,fneed,&new, + mapFile,PATH_MAX); + rep.newKeyboard= FALSE; + rep.pad1= rep.pad2= rep.pad3= rep.pad4= 0; + + stuff->want|= stuff->need; + if (new==NULL) + rep.reported= 0; + else { + if (stuff->load) + rep.loaded= TRUE; + if (stuff->load || + ((rep.reported&XkbGBN_SymbolsMask) && (new->compat))) { + XkbChangesRec changes; + memset(&changes, 0, sizeof(changes)); + XkbUpdateDescActions(new, + new->min_key_code,XkbNumKeys(new), + &changes); + } + + if (new->map==NULL) + rep.reported&= ~(XkbGBN_SymbolsMask|XkbGBN_TypesMask); + else if (rep.reported&(XkbGBN_SymbolsMask|XkbGBN_TypesMask)) { + mrep.type= X_Reply; + mrep.deviceID = dev->id; + mrep.sequenceNumber= client->sequence; + mrep.length = ((SIZEOF(xkbGetMapReply)-SIZEOF(xGenericReply))>>2); + mrep.minKeyCode = new->min_key_code; + mrep.maxKeyCode = new->max_key_code; + mrep.present = 0; + mrep.totalSyms = mrep.totalActs = + mrep.totalKeyBehaviors= mrep.totalKeyExplicit= + mrep.totalModMapKeys= mrep.totalVModMapKeys= 0; + if (rep.reported&(XkbGBN_TypesMask|XkbGBN_ClientSymbolsMask)) { + mrep.present|= XkbKeyTypesMask; + mrep.firstType = 0; + mrep.nTypes = mrep.totalTypes= new->map->num_types; + } + else { + mrep.firstType = mrep.nTypes= 0; + mrep.totalTypes= 0; + } + if (rep.reported&XkbGBN_ClientSymbolsMask) { + mrep.present|= (XkbKeySymsMask|XkbModifierMapMask); + mrep.firstKeySym = mrep.firstModMapKey= new->min_key_code; + mrep.nKeySyms = mrep.nModMapKeys= XkbNumKeys(new); + } + else { + mrep.firstKeySym= mrep.firstModMapKey= 0; + mrep.nKeySyms= mrep.nModMapKeys= 0; + } + if (rep.reported&XkbGBN_ServerSymbolsMask) { + mrep.present|= XkbAllServerInfoMask; + mrep.virtualMods= ~0; + mrep.firstKeyAct = mrep.firstKeyBehavior = + mrep.firstKeyExplicit = new->min_key_code; + mrep.nKeyActs = mrep.nKeyBehaviors = + mrep.nKeyExplicit = XkbNumKeys(new); + mrep.firstVModMapKey= new->min_key_code; + mrep.nVModMapKeys= XkbNumKeys(new); + } + else { + mrep.virtualMods= 0; + mrep.firstKeyAct= mrep.firstKeyBehavior= + mrep.firstKeyExplicit = 0; + mrep.nKeyActs= mrep.nKeyBehaviors= mrep.nKeyExplicit= 0; + } + XkbComputeGetMapReplySize(new,&mrep); + rep.length+= SIZEOF(xGenericReply)/4+mrep.length; + } + if (new->compat==NULL) + rep.reported&= ~XkbGBN_CompatMapMask; + else if (rep.reported&XkbGBN_CompatMapMask) { + crep.type= X_Reply; + crep.deviceID= dev->id; + crep.sequenceNumber= client->sequence; + crep.length= 0; + crep.groups= XkbAllGroupsMask; + crep.firstSI= 0; + crep.nSI= crep.nTotalSI= new->compat->num_si; + XkbComputeGetCompatMapReplySize(new->compat,&crep); + rep.length+= SIZEOF(xGenericReply)/4+crep.length; + } + if (new->indicators==NULL) + rep.reported&= ~XkbGBN_IndicatorMapMask; + else if (rep.reported&XkbGBN_IndicatorMapMask) { + irep.type= X_Reply; + irep.deviceID= dev->id; + irep.sequenceNumber= client->sequence; + irep.length= 0; + irep.which= XkbAllIndicatorsMask; + XkbComputeGetIndicatorMapReplySize(new->indicators,&irep); + rep.length+= SIZEOF(xGenericReply)/4+irep.length; + } + if (new->names==NULL) + rep.reported&= ~(XkbGBN_OtherNamesMask|XkbGBN_KeyNamesMask); + else if (rep.reported&(XkbGBN_OtherNamesMask|XkbGBN_KeyNamesMask)) { + nrep.type= X_Reply; + nrep.deviceID= dev->id; + nrep.sequenceNumber= client->sequence; + nrep.length= 0; + nrep.minKeyCode= new->min_key_code; + nrep.maxKeyCode= new->max_key_code; + if (rep.reported&XkbGBN_OtherNamesMask) { + nrep.which= XkbAllNamesMask; + if (new->map!=NULL) + nrep.nTypes= new->map->num_types; + else nrep.nTypes= 0; + nrep.nKTLevels= 0; + nrep.groupNames= XkbAllGroupsMask; + nrep.virtualMods= XkbAllVirtualModsMask; + nrep.indicators= XkbAllIndicatorsMask; + nrep.nRadioGroups= new->names->num_rg; + } + else { + nrep.which= 0; + nrep.nTypes= 0; + nrep.nKTLevels= 0; + nrep.groupNames= 0; + nrep.virtualMods= 0; + nrep.indicators= 0; + nrep.nRadioGroups= 0; + } + if (rep.reported&XkbGBN_KeyNamesMask) { + nrep.which|= XkbKeyNamesMask; + nrep.firstKey= new->min_key_code; + nrep.nKeys= XkbNumKeys(new); + nrep.nKeyAliases= new->names->num_key_aliases; + if (nrep.nKeyAliases) + nrep.which|= XkbKeyAliasesMask; + } + else { + nrep.which&= ~(XkbKeyNamesMask|XkbKeyAliasesMask); + nrep.firstKey= nrep.nKeys= 0; + nrep.nKeyAliases= 0; + } + XkbComputeGetNamesReplySize(new,&nrep); + rep.length+= SIZEOF(xGenericReply)/4+nrep.length; + } + if (new->geom==NULL) + rep.reported&= ~XkbGBN_GeometryMask; + else if (rep.reported&XkbGBN_GeometryMask) { + grep.type= X_Reply; + grep.deviceID= dev->id; + grep.sequenceNumber= client->sequence; + grep.length= 0; + grep.found= TRUE; + grep.pad= 0; + grep.widthMM= grep.heightMM= 0; + grep.nProperties= grep.nColors= grep.nShapes= 0; + grep.nSections= grep.nDoodads= 0; + grep.baseColorNdx= grep.labelColorNdx= 0; + XkbComputeGetGeometryReplySize(new->geom,&grep,None); + rep.length+= SIZEOF(xGenericReply)/4+grep.length; + } + } + + 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); + } + WriteToClient(client,SIZEOF(xkbGetKbdByNameReply), (char *)&rep); + if (reported&(XkbGBN_SymbolsMask|XkbGBN_TypesMask)) + XkbSendMap(client,new,&mrep); + if (reported&XkbGBN_CompatMapMask) + XkbSendCompatMap(client,new->compat,&crep); + if (reported&XkbGBN_IndicatorMapMask) + XkbSendIndicatorMap(client,new->indicators,&irep); + if (reported&(XkbGBN_KeyNamesMask|XkbGBN_OtherNamesMask)) + XkbSendNames(client,new,&nrep); + if (reported&XkbGBN_GeometryMask) + XkbSendGeometry(client,new->geom,&grep,FALSE); + if (rep.loaded) { + XkbDescPtr old_xkb; + xkbNewKeyboardNotify nkn; + int i,nG,nTG; + old_xkb= xkb; + xkb= new; + dev->key->xkbInfo->desc= xkb; + new= old_xkb; /* so it'll get freed automatically */ + + *xkb->ctrls= *old_xkb->ctrls; + for (nG=nTG=0,i=xkb->min_key_code;i<=xkb->max_key_code;i++) { + nG= XkbKeyNumGroups(xkb,i); + if (nG>=XkbNumKbdGroups) { + nTG= XkbNumKbdGroups; + break; + } + if (nG>nTG) { + nTG= nG; + } + } + xkb->ctrls->num_groups= nTG; + + for (tmpd = inputInfo.devices; tmpd; tmpd = tmpd->next) { + if ((tmpd == dev) || (!IsMaster(tmpd) && GetMaster(tmpd, MASTER_KEYBOARD) == dev)) { + if (tmpd != dev) + XkbCopyDeviceKeymap(tmpd, dev); + + if (tmpd->kbdfeed && tmpd->kbdfeed->xkb_sli) { + old_sli = tmpd->kbdfeed->xkb_sli; + tmpd->kbdfeed->xkb_sli = NULL; + sli = XkbAllocSrvLedInfo(tmpd, tmpd->kbdfeed, NULL, 0); + if (sli) { + sli->explicitState = old_sli->explicitState; + sli->effectiveState = old_sli->effectiveState; + } + tmpd->kbdfeed->xkb_sli = sli; + XkbFreeSrvLedInfo(old_sli); + } + } + } + + nkn.deviceID= nkn.oldDeviceID= dev->id; + nkn.minKeyCode= new->min_key_code; + nkn.maxKeyCode= new->max_key_code; + nkn.oldMinKeyCode= xkb->min_key_code; + nkn.oldMaxKeyCode= xkb->max_key_code; + nkn.requestMajor= XkbReqCode; + nkn.requestMinor= X_kbGetKbdByName; + nkn.changed= XkbNKN_KeycodesMask; + if (geom_changed) + nkn.changed|= XkbNKN_GeometryMask; + XkbSendNewKeyboardNotify(dev,&nkn); + + if (!IsMaster(dev) && dev->u.master) + { + DeviceIntPtr master = dev->u.master; + if (master->u.lastSlave == dev) + { + XkbCopyDeviceKeymap(dev->u.master, dev); + XkbSendNewKeyboardNotify(dev,&nkn); + } + } + } + if ((new!=NULL)&&(new!=xkb)) { + XkbFreeKeyboard(new,XkbAllComponentsMask,TRUE); + new= NULL; + } + free(names.keycodes); + names.keycodes = NULL; + free(names.types); + names.types = NULL; + free(names.compat); + names.compat = NULL; + free(names.symbols); + names.symbols = NULL; + free(names.geometry); + names.geometry = NULL; + return Success; +} + +/***====================================================================***/ + +static int +ComputeDeviceLedInfoSize( DeviceIntPtr dev, + unsigned int what, + XkbSrvLedInfoPtr sli) +{ +int nNames,nMaps; +register unsigned n,bit; + + if (sli==NULL) + return 0; + nNames= nMaps= 0; + if ((what&XkbXI_IndicatorNamesMask)==0) + sli->namesPresent= 0; + if ((what&XkbXI_IndicatorMapsMask)==0) + sli->mapsPresent= 0; + + for (n=0,bit=1;nnames && sli->names[n]!=None) { + sli->namesPresent|= bit; + nNames++; + } + if (sli->maps && XkbIM_InUse(&sli->maps[n])) { + sli->mapsPresent|= bit; + nMaps++; + } + } + return (nNames*4)+(nMaps*SIZEOF(xkbIndicatorMapWireDesc)); +} + +static int +CheckDeviceLedFBs( DeviceIntPtr dev, + int class, + int id, + xkbGetDeviceInfoReply * rep, + ClientPtr client) +{ +int nFBs= 0; +int length= 0; +Bool classOk; + + if (class==XkbDfltXIClass) { + if (dev->kbdfeed) class= KbdFeedbackClass; + else if (dev->leds) class= LedFeedbackClass; + else { + client->errorValue= _XkbErrCode2(XkbErr_BadClass,class); + return XkbKeyboardErrorCode; + } + } + classOk= FALSE; + if ((dev->kbdfeed)&&((class==KbdFeedbackClass)||(class==XkbAllXIClasses))) { + KbdFeedbackPtr kf; + classOk= TRUE; + for (kf= dev->kbdfeed;(kf);kf=kf->next) { + if ((id!=XkbAllXIIds)&&(id!=XkbDfltXIId)&&(id!=kf->ctrl.id)) + continue; + nFBs++; + length+= SIZEOF(xkbDeviceLedsWireDesc); + if (!kf->xkb_sli) + kf->xkb_sli= XkbAllocSrvLedInfo(dev,kf,NULL,0); + length+= ComputeDeviceLedInfoSize(dev,rep->present,kf->xkb_sli); + if (id!=XkbAllXIIds) + break; + } + } + if ((dev->leds)&&((class==LedFeedbackClass)||(class==XkbAllXIClasses))) { + LedFeedbackPtr lf; + classOk= TRUE; + for (lf= dev->leds;(lf);lf=lf->next) { + if ((id!=XkbAllXIIds)&&(id!=XkbDfltXIId)&&(id!=lf->ctrl.id)) + continue; + nFBs++; + length+= SIZEOF(xkbDeviceLedsWireDesc); + if (!lf->xkb_sli) + lf->xkb_sli= XkbAllocSrvLedInfo(dev,NULL,lf,0); + length+= ComputeDeviceLedInfoSize(dev,rep->present,lf->xkb_sli); + if (id!=XkbAllXIIds) + break; + } + } + if (nFBs>0) { + rep->nDeviceLedFBs= nFBs; + rep->length+= (length/4); + return Success; + } + if (classOk) client->errorValue= _XkbErrCode2(XkbErr_BadId,id); + else client->errorValue= _XkbErrCode2(XkbErr_BadClass,class); + return XkbKeyboardErrorCode; +} + +static int +SendDeviceLedInfo( XkbSrvLedInfoPtr sli, + ClientPtr client) +{ +xkbDeviceLedsWireDesc wire; +int length; + + length= 0; + wire.ledClass= sli->class; + wire.ledID= sli->id; + wire.namesPresent= sli->namesPresent; + wire.mapsPresent= sli->mapsPresent; + 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); + } + WriteToClient(client,SIZEOF(xkbDeviceLedsWireDesc),(char *)&wire); + length+= SIZEOF(xkbDeviceLedsWireDesc); + if (sli->namesPresent|sli->mapsPresent) { + register unsigned i,bit; + if (sli->namesPresent) { + CARD32 awire; + for (i=0,bit=1;inamesPresent&bit) { + awire= (CARD32)sli->names[i]; + if (client->swapped) { + register int n; + swapl(&awire,n); + } + WriteToClient(client,4,(char *)&awire); + length+= 4; + } + } + } + if (sli->mapsPresent) { + for (i=0,bit=1;imapsPresent&bit) { + iwire.flags= sli->maps[i].flags; + iwire.whichGroups= sli->maps[i].which_groups; + iwire.groups= sli->maps[i].groups; + iwire.whichMods= sli->maps[i].which_mods; + iwire.mods= sli->maps[i].mods.mask; + iwire.realMods= sli->maps[i].mods.real_mods; + 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); + } + WriteToClient(client,SIZEOF(xkbIndicatorMapWireDesc), + (char *)&iwire); + length+= SIZEOF(xkbIndicatorMapWireDesc); + } + } + } + } + return length; +} + +static int +SendDeviceLedFBs( DeviceIntPtr dev, + int class, + int id, + unsigned wantLength, + ClientPtr client) +{ +int length= 0; + + if (class==XkbDfltXIClass) { + if (dev->kbdfeed) class= KbdFeedbackClass; + else if (dev->leds) class= LedFeedbackClass; + } + if ((dev->kbdfeed)&& + ((class==KbdFeedbackClass)||(class==XkbAllXIClasses))) { + KbdFeedbackPtr kf; + for (kf= dev->kbdfeed;(kf);kf=kf->next) { + if ((id==XkbAllXIIds)||(id==XkbDfltXIId)||(id==kf->ctrl.id)) { + length+= SendDeviceLedInfo(kf->xkb_sli,client); + if (id!=XkbAllXIIds) + break; + } + } + } + if ((dev->leds)&& + ((class==LedFeedbackClass)||(class==XkbAllXIClasses))) { + LedFeedbackPtr lf; + for (lf= dev->leds;(lf);lf=lf->next) { + if ((id==XkbAllXIIds)||(id==XkbDfltXIId)||(id==lf->ctrl.id)) { + length+= SendDeviceLedInfo(lf->xkb_sli,client); + if (id!=XkbAllXIIds) + break; + } + } + } + if (length==wantLength) + return Success; + else return BadLength; +} + +int +ProcXkbGetDeviceInfo(ClientPtr client) +{ +DeviceIntPtr dev; +xkbGetDeviceInfoReply rep; +int status,nDeviceLedFBs; +unsigned length,nameLen; +CARD16 ledClass,ledID; +unsigned wanted; +char * str; + + REQUEST(xkbGetDeviceInfoReq); + REQUEST_SIZE_MATCH(xkbGetDeviceInfoReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + wanted= stuff->wanted; + + CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); + CHK_MASK_LEGAL(0x01,wanted,XkbXI_AllDeviceFeaturesMask); + + if ((!dev->button)||((stuff->nBtns<1)&&(!stuff->allBtns))) + wanted&= ~XkbXI_ButtonActionsMask; + if ((!dev->kbdfeed)&&(!dev->leds)) + wanted&= ~XkbXI_IndicatorsMask; + + nameLen= XkbSizeCountedString(dev->name); + memset((char *)&rep, 0, SIZEOF(xkbGetDeviceInfoReply)); + rep.type = X_Reply; + rep.deviceID= dev->id; + rep.sequenceNumber = client->sequence; + rep.length = nameLen/4; + rep.present = wanted; + rep.supported = XkbXI_AllDeviceFeaturesMask; + rep.unsupported = 0; + rep.firstBtnWanted = rep.nBtnsWanted = 0; + rep.firstBtnRtrn = rep.nBtnsRtrn = 0; + if (dev->button) + rep.totalBtns= dev->button->numButtons; + else rep.totalBtns= 0; + rep.devType= dev->xinput_type; + rep.hasOwnState= (dev->key && dev->key->xkbInfo); + rep.nDeviceLedFBs = 0; + if (dev->kbdfeed) rep.dfltKbdFB= dev->kbdfeed->ctrl.id; + else rep.dfltKbdFB= XkbXINone; + if (dev->leds) rep.dfltLedFB= dev->leds->ctrl.id; + else rep.dfltLedFB= XkbXINone; + + ledClass= stuff->ledClass; + ledID= stuff->ledID; + + rep.firstBtnWanted= rep.nBtnsWanted= 0; + rep.firstBtnRtrn= rep.nBtnsRtrn= 0; + if (wanted&XkbXI_ButtonActionsMask) { + if (stuff->allBtns) { + stuff->firstBtn= 0; + stuff->nBtns= dev->button->numButtons; + } + + if ((stuff->firstBtn+stuff->nBtns)>dev->button->numButtons) { + client->errorValue = _XkbErrCode4(0x02,dev->button->numButtons, + stuff->firstBtn, + stuff->nBtns); + return BadValue; + } + else { + rep.firstBtnWanted= stuff->firstBtn; + rep.nBtnsWanted= stuff->nBtns; + if (dev->button->xkb_acts!=NULL) { + XkbAction *act; + register int i; + + rep.firstBtnRtrn= stuff->firstBtn; + rep.nBtnsRtrn= stuff->nBtns; + act= &dev->button->xkb_acts[rep.firstBtnWanted]; + for (i=0;itype!=XkbSA_NoAction) + break; + } + rep.firstBtnRtrn+= i; + rep.nBtnsRtrn-= i; + act= &dev->button->xkb_acts[rep.firstBtnRtrn+rep.nBtnsRtrn-1]; + for (i=0;itype!=XkbSA_NoAction) + break; + } + rep.nBtnsRtrn-= i; + } + rep.length+= (rep.nBtnsRtrn*SIZEOF(xkbActionWireDesc))/4; + } + } + + if (wanted&XkbXI_IndicatorsMask) { + status= CheckDeviceLedFBs(dev,ledClass,ledID,&rep,client); + if (status!=Success) + return status; + } + 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); + } + WriteToClient(client,SIZEOF(xkbGetDeviceInfoReply), (char *)&rep); + + str= malloc(nameLen); + if (!str) + return BadAlloc; + XkbWriteCountedString(str,dev->name,client->swapped); + WriteToClient(client,nameLen,str); + free(str); + length-= nameLen; + + if (rep.nBtnsRtrn>0) { + int sz; + xkbActionWireDesc * awire; + sz= rep.nBtnsRtrn*SIZEOF(xkbActionWireDesc); + awire= (xkbActionWireDesc *)&dev->button->xkb_acts[rep.firstBtnRtrn]; + WriteToClient(client,sz,(char *)awire); + length-= sz; + } + if (nDeviceLedFBs>0) { + status= SendDeviceLedFBs(dev,ledClass,ledID,length,client); + if (status!=Success) + return status; + } + else if (length!=0) { + ErrorF("[xkb] Internal Error! BadLength in ProcXkbGetDeviceInfo\n"); + ErrorF("[xkb] Wrote %d fewer bytes than expected\n",length); + return BadLength; + } + return Success; +} + +static char * +CheckSetDeviceIndicators( char * wire, + DeviceIntPtr dev, + int num, + int * status_rtrn, + ClientPtr client) +{ +xkbDeviceLedsWireDesc * ledWire; +int i; +XkbSrvLedInfoPtr sli; + + ledWire= (xkbDeviceLedsWireDesc *)wire; + for (i=0;iswapped) { + register int n; + swaps(&ledWire->ledClass,n); + swaps(&ledWire->ledID,n); + swapl(&ledWire->namesPresent,n); + swapl(&ledWire->mapsPresent,n); + swapl(&ledWire->physIndicators,n); + } + + sli= XkbFindSrvLedInfo(dev,ledWire->ledClass,ledWire->ledID, + XkbXI_IndicatorsMask); + if (sli!=NULL) { + register int n; + register unsigned bit; + int nMaps,nNames; + CARD32 *atomWire; + xkbIndicatorMapWireDesc *mapWire; + + nMaps= nNames= 0; + for (n=0,bit=1;nnamesPresent&bit) + nNames++; + if (ledWire->mapsPresent&bit) + nMaps++; + } + atomWire= (CARD32 *)&ledWire[1]; + if (nNames>0) { + for (n=0;nswapped) { + register int t; + swapl(atomWire,t); + } + CHK_ATOM_OR_NONE3(((Atom)(*atomWire)),client->errorValue, + *status_rtrn,NULL); + atomWire++; + } + } + mapWire= (xkbIndicatorMapWireDesc *)atomWire; + if (nMaps>0) { + for (n=0;nswapped) { + register int t; + swaps(&mapWire->virtualMods,t); + swapl(&mapWire->ctrls,t); + } + CHK_MASK_LEGAL3(0x21,mapWire->whichGroups, + XkbIM_UseAnyGroup, + client->errorValue, + *status_rtrn,NULL); + CHK_MASK_LEGAL3(0x22,mapWire->whichMods,XkbIM_UseAnyMods, + client->errorValue, + *status_rtrn,NULL); + mapWire++; + } + } + ledWire= (xkbDeviceLedsWireDesc *)mapWire; + } + else { + /* SHOULD NEVER HAPPEN */ + return (char *)ledWire; + } + } + return (char *)ledWire; +} + +static char * +SetDeviceIndicators( char * wire, + DeviceIntPtr dev, + unsigned changed, + int num, + int * status_rtrn, + ClientPtr client, + xkbExtensionDeviceNotify *ev) +{ +xkbDeviceLedsWireDesc * ledWire; +int i; +XkbEventCauseRec cause; +unsigned namec,mapc,statec; +xkbExtensionDeviceNotify ed; +XkbChangesRec changes; +DeviceIntPtr kbd; + + memset((char *)&ed, 0, sizeof(xkbExtensionDeviceNotify)); + memset((char *)&changes, 0, sizeof(XkbChangesRec)); + XkbSetCauseXkbReq(&cause,X_kbSetDeviceInfo,client); + ledWire= (xkbDeviceLedsWireDesc *)wire; + for (i=0;iledClass,ledWire->ledID, + XkbXI_IndicatorMapsMask); + if (!sli) { + /* SHOULD NEVER HAPPEN!! */ + return (char *)ledWire; + } + + atomWire= (CARD32 *)&ledWire[1]; + if (changed&XkbXI_IndicatorNamesMask) { + namec= sli->namesPresent|ledWire->namesPresent; + memset((char *)sli->names, 0, XkbNumIndicators*sizeof(Atom)); + } + if (ledWire->namesPresent) { + sli->namesPresent= ledWire->namesPresent; + memset((char *)sli->names, 0, XkbNumIndicators*sizeof(Atom)); + for (n=0,bit=1;nnamesPresent&bit) { + sli->names[n]= (Atom)*atomWire; + if (sli->names[n]==None) + ledWire->namesPresent&= ~bit; + atomWire++; + } + } + } + mapWire= (xkbIndicatorMapWireDesc *)atomWire; + if (changed&XkbXI_IndicatorMapsMask) { + mapc= sli->mapsPresent|ledWire->mapsPresent; + sli->mapsPresent= ledWire->mapsPresent; + memset((char*)sli->maps, 0, XkbNumIndicators*sizeof(XkbIndicatorMapRec)); + } + if (ledWire->mapsPresent) { + for (n=0,bit=1;nmapsPresent&bit) { + sli->maps[n].flags= mapWire->flags; + sli->maps[n].which_groups= mapWire->whichGroups; + sli->maps[n].groups= mapWire->groups; + sli->maps[n].which_mods= mapWire->whichMods; + sli->maps[n].mods.mask= mapWire->mods; + sli->maps[n].mods.real_mods=mapWire->realMods; + sli->maps[n].mods.vmods= mapWire->virtualMods; + sli->maps[n].ctrls= mapWire->ctrls; + mapWire++; + } + } + } + if (changed&XkbXI_IndicatorStateMask) { + statec= sli->effectiveState^ledWire->state; + sli->explicitState&= ~statec; + sli->explicitState|= (ledWire->state&statec); + } + if (namec) + XkbApplyLedNameChanges(dev,sli,namec,&ed,&changes,&cause); + if (mapc) + XkbApplyLedMapChanges(dev,sli,mapc,&ed,&changes,&cause); + if (statec) + XkbApplyLedStateChanges(dev,sli,statec,&ed,&changes,&cause); + + kbd= dev; + if ((sli->flags&XkbSLI_HasOwnState)==0) + kbd = inputInfo.keyboard; + + XkbFlushLedEvents(dev,kbd,sli,&ed,&changes,&cause); + ledWire= (xkbDeviceLedsWireDesc *)mapWire; + } + return (char *)ledWire; +} + + +static int +_XkbSetDeviceInfo(ClientPtr client, DeviceIntPtr dev, + xkbSetDeviceInfoReq *stuff) +{ + char *wire; + + wire= (char *)&stuff[1]; + if (stuff->change&XkbXI_ButtonActionsMask) { + if (!dev->button) { + client->errorValue = _XkbErrCode2(XkbErr_BadClass,ButtonClass); + return XkbKeyboardErrorCode; + } + if ((stuff->firstBtn+stuff->nBtns)>dev->button->numButtons) { + client->errorValue= _XkbErrCode4(0x02,stuff->firstBtn,stuff->nBtns, + dev->button->numButtons); + return BadMatch; + } + wire+= (stuff->nBtns*SIZEOF(xkbActionWireDesc)); + } + if (stuff->change&XkbXI_IndicatorsMask) { + int status= Success; + wire= CheckSetDeviceIndicators(wire,dev,stuff->nDeviceLedFBs, + &status,client); + if (status!=Success) + return status; + } + if (((wire-((char *)stuff))/4)!=stuff->length) + return BadLength; + + return Success; +} + +static int +_XkbSetDeviceInfoCheck(ClientPtr client, DeviceIntPtr dev, + xkbSetDeviceInfoReq *stuff) +{ + char *wire; + xkbExtensionDeviceNotify ed; + + memset((char *)&ed, 0, SIZEOF(xkbExtensionDeviceNotify)); + ed.deviceID= dev->id; + wire= (char *)&stuff[1]; + if (stuff->change&XkbXI_ButtonActionsMask) { + int nBtns,sz,i; + XkbAction * acts; + DeviceIntPtr kbd; + + nBtns= dev->button->numButtons; + acts= dev->button->xkb_acts; + if (acts==NULL) { + acts= calloc(nBtns, sizeof(XkbAction)); + if (!acts) + return BadAlloc; + dev->button->xkb_acts= acts; + } + sz= stuff->nBtns*SIZEOF(xkbActionWireDesc); + memcpy((char *)&acts[stuff->firstBtn],(char *)wire,sz); + wire+= sz; + ed.reason|= XkbXI_ButtonActionsMask; + ed.firstBtn= stuff->firstBtn; + ed.nBtns= stuff->nBtns; + + if (dev->key) kbd= dev; + else kbd= inputInfo.keyboard; + acts= &dev->button->xkb_acts[stuff->firstBtn]; + for (i=0;inBtns;i++,acts++) { + if (acts->type!=XkbSA_NoAction) + XkbSetActionKeyMods(kbd->key->xkbInfo->desc,acts,0); + } + } + if (stuff->change&XkbXI_IndicatorsMask) { + int status= Success; + wire= SetDeviceIndicators(wire,dev,stuff->change, + stuff->nDeviceLedFBs, &status,client,&ed); + if (status!=Success) + return status; + } + if ((stuff->change)&&(ed.reason)) + XkbSendExtensionDeviceNotify(dev,client,&ed); + return Success; +} + +int +ProcXkbSetDeviceInfo(ClientPtr client) +{ + DeviceIntPtr dev; + int rc; + + REQUEST(xkbSetDeviceInfoReq); + REQUEST_AT_LEAST_SIZE(xkbSetDeviceInfoReq); + + if (!(client->xkbClientFlags&_XkbClientInitialized)) + return BadAccess; + + CHK_ANY_DEVICE(dev, stuff->deviceSpec, client, DixManageAccess); + CHK_MASK_LEGAL(0x01,stuff->change,XkbXI_AllFeaturesMask); + + rc = _XkbSetDeviceInfoCheck(client, dev, stuff); + + if (rc != Success) + return rc; + + if (stuff->deviceSpec == XkbUseCoreKbd || stuff->deviceSpec == XkbUseCorePtr) + { + DeviceIntPtr other; + for (other = inputInfo.devices; other; other = other->next) + { + if (((other != dev) && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) && + ((stuff->deviceSpec == XkbUseCoreKbd && other->key) || + (stuff->deviceSpec == XkbUseCorePtr && other->button))) + { + rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); + if (rc == Success) + { + rc = _XkbSetDeviceInfoCheck(client, other, stuff); + if (rc != Success) + return rc; + } + } + } + } + + /* checks done, apply */ + rc = _XkbSetDeviceInfo(client, dev, stuff); + if (rc != Success) + return rc; + + if (stuff->deviceSpec == XkbUseCoreKbd || stuff->deviceSpec == XkbUseCorePtr) + { + DeviceIntPtr other; + for (other = inputInfo.devices; other; other = other->next) + { + if (((other != dev) && !IsMaster(other) && GetMaster(other, MASTER_KEYBOARD) == dev) && + ((stuff->deviceSpec == XkbUseCoreKbd && other->key) || + (stuff->deviceSpec == XkbUseCorePtr && other->button))) + { + rc = XaceHook(XACE_DEVICE_ACCESS, client, other, DixManageAccess); + if (rc == Success) + { + rc = _XkbSetDeviceInfo(client, other, stuff); + if (rc != Success) + return rc; + } + } + } + } + + return Success; +} + +/***====================================================================***/ + +int +ProcXkbSetDebuggingFlags(ClientPtr client) +{ +CARD32 newFlags,newCtrls,extraLength; +xkbSetDebuggingFlagsReply rep; +int rc; + + REQUEST(xkbSetDebuggingFlagsReq); + REQUEST_AT_LEAST_SIZE(xkbSetDebuggingFlagsReq); + + rc = XaceHook(XACE_SERVER_ACCESS, client, DixDebugAccess); + if (rc != Success) + return rc; + + newFlags= xkbDebugFlags&(~stuff->affectFlags); + newFlags|= (stuff->flags&stuff->affectFlags); + newCtrls= xkbDebugCtrls&(~stuff->affectCtrls); + newCtrls|= (stuff->ctrls&stuff->affectCtrls); + if (xkbDebugFlags || newFlags || stuff->msgLength) { + ErrorF("[xkb] XkbDebug: Setting debug flags to 0x%lx\n",(long)newFlags); + if (newCtrls!=xkbDebugCtrls) + ErrorF("[xkb] XkbDebug: Setting debug controls to 0x%lx\n",(long)newCtrls); + } + extraLength= (stuff->length<<2)-sz_xkbSetDebuggingFlagsReq; + if (stuff->msgLength>0) { + char *msg; + if (extraLengthmsgLength)) { + ErrorF("[xkb] XkbDebug: msgLength= %d, length= %ld (should be %d)\n", + stuff->msgLength,(long)extraLength, + XkbPaddedSize(stuff->msgLength)); + return BadLength; + } + msg= (char *)&stuff[1]; + if (msg[stuff->msgLength-1]!='\0') { + ErrorF("[xkb] XkbDebug: message not null-terminated\n"); + return BadValue; + } + ErrorF("[xkb] XkbDebug: %s\n",msg); + } + xkbDebugFlags = newFlags; + xkbDebugCtrls = newCtrls; + + rep.type= X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.currentFlags = newFlags; + rep.currentCtrls = newCtrls; + 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); + } + WriteToClient(client,SIZEOF(xkbSetDebuggingFlagsReply), (char *)&rep); + return Success; +} + +/***====================================================================***/ + +static int +ProcXkbDispatch (ClientPtr client) +{ + REQUEST(xReq); + switch (stuff->data) + { + case X_kbUseExtension: + return ProcXkbUseExtension(client); + case X_kbSelectEvents: + return ProcXkbSelectEvents(client); + case X_kbBell: + return ProcXkbBell(client); + case X_kbGetState: + return ProcXkbGetState(client); + case X_kbLatchLockState: + return ProcXkbLatchLockState(client); + case X_kbGetControls: + return ProcXkbGetControls(client); + case X_kbSetControls: + return ProcXkbSetControls(client); + case X_kbGetMap: + return ProcXkbGetMap(client); + case X_kbSetMap: + return ProcXkbSetMap(client); + case X_kbGetCompatMap: + return ProcXkbGetCompatMap(client); + case X_kbSetCompatMap: + return ProcXkbSetCompatMap(client); + case X_kbGetIndicatorState: + return ProcXkbGetIndicatorState(client); + case X_kbGetIndicatorMap: + return ProcXkbGetIndicatorMap(client); + case X_kbSetIndicatorMap: + return ProcXkbSetIndicatorMap(client); + case X_kbGetNamedIndicator: + return ProcXkbGetNamedIndicator(client); + case X_kbSetNamedIndicator: + return ProcXkbSetNamedIndicator(client); + case X_kbGetNames: + return ProcXkbGetNames(client); + case X_kbSetNames: + return ProcXkbSetNames(client); + case X_kbGetGeometry: + return ProcXkbGetGeometry(client); + case X_kbSetGeometry: + return ProcXkbSetGeometry(client); + case X_kbPerClientFlags: + return ProcXkbPerClientFlags(client); + case X_kbListComponents: + return ProcXkbListComponents(client); + case X_kbGetKbdByName: + return ProcXkbGetKbdByName(client); + case X_kbGetDeviceInfo: + return ProcXkbGetDeviceInfo(client); + case X_kbSetDeviceInfo: + return ProcXkbSetDeviceInfo(client); + case X_kbSetDebuggingFlags: + return ProcXkbSetDebuggingFlags(client); + default: + return BadRequest; + } +} + +static int +XkbClientGone(pointer data,XID id) +{ + DevicePtr pXDev = (DevicePtr)data; + + if (!XkbRemoveResourceClient(pXDev,id)) { + ErrorF("[xkb] Internal Error! bad RemoveResourceClient in XkbClientGone\n"); + } + return 1; +} + +void +XkbExtensionInit(void) +{ + ExtensionEntry *extEntry; + + RT_XKBCLIENT = CreateNewResourceType(XkbClientGone, "XkbClient"); + if (!RT_XKBCLIENT) + return; + + if (!XkbInitPrivates()) + return; + + if ((extEntry = AddExtension(XkbName, XkbNumberEvents, XkbNumberErrors, + ProcXkbDispatch, SProcXkbDispatch, + NULL, StandardMinorOpcode))) { + XkbReqCode = (unsigned char)extEntry->base; + XkbEventBase = (unsigned char)extEntry->eventBase; + XkbErrorBase = (unsigned char)extEntry->errorBase; + XkbKeyboardErrorCode = XkbErrorBase+XkbKeyboard; + } + return; +} + + diff --git a/xorg-server/xkeyboard-config/compat/accessx b/xorg-server/xkeyboard-config/compat/accessx index 3e4b46163..26cafab7a 100644 --- a/xorg-server/xkeyboard-config/compat/accessx +++ b/xorg-server/xkeyboard-config/compat/accessx @@ -1,54 +1,52 @@ -// $Xorg: accessx,v 1.3 2000/08/17 19:54:34 cpqbld Exp $ - -default partial xkb_compatibility "basic" { - interpret AccessX_Enable { - action= LockControls(controls=AccessXKeys); - }; -}; - -partial xkb_compatibility "full" { - - interpret AccessX_Enable { - action= LockControls(controls=AccessXKeys); - }; - - interpret AccessX_Feedback_Enable { - action= LockControls(controls=AccessXFeedback); - }; - - interpret RepeatKeys_Enable { - action= LockControls(controls=RepeatKeys); - }; - - interpret SlowKeys_Enable { - action= LockControls(controls=SlowKeys); - }; - - interpret BounceKeys_Enable { - action= LockControls(controls=BounceKeys); - }; - - interpret StickyKeys_Enable { - action= LockControls(controls=StickyKeys); - }; - - interpret MouseKeys_Enable { - action= LockControls(controls=MouseKeys); - }; - - interpret MouseKeys_Accel_Enable { - action= LockControls(controls=MouseKeysAccel); - }; - - interpret Overlay1_Enable { - action= LockControls(controls=Overlay1); - }; - - interpret Overlay2_Enable { - action= LockControls(controls=Overlay2); - }; - - interpret AudibleBell_Enable { - action= LockControls(controls=AudibleBell); - }; -}; +default partial xkb_compatibility "basic" { + interpret AccessX_Enable { + action= LockControls(controls=AccessXKeys); + }; +}; + +partial xkb_compatibility "full" { + + interpret AccessX_Enable { + action= LockControls(controls=AccessXKeys); + }; + + interpret AccessX_Feedback_Enable { + action= LockControls(controls=AccessXFeedback); + }; + + interpret RepeatKeys_Enable { + action= LockControls(controls=RepeatKeys); + }; + + interpret SlowKeys_Enable { + action= LockControls(controls=SlowKeys); + }; + + interpret BounceKeys_Enable { + action= LockControls(controls=BounceKeys); + }; + + interpret StickyKeys_Enable { + action= LockControls(controls=StickyKeys); + }; + + interpret MouseKeys_Enable { + action= LockControls(controls=MouseKeys); + }; + + interpret MouseKeys_Accel_Enable { + action= LockControls(controls=MouseKeysAccel); + }; + + interpret Overlay1_Enable { + action= LockControls(controls=Overlay1); + }; + + interpret Overlay2_Enable { + action= LockControls(controls=Overlay2); + }; + + interpret AudibleBell_Enable { + action= LockControls(controls=AudibleBell); + }; +}; diff --git a/xorg-server/xkeyboard-config/compat/basic b/xorg-server/xkeyboard-config/compat/basic index 8f99c7b73..ba7e52a6f 100644 --- a/xorg-server/xkeyboard-config/compat/basic +++ b/xorg-server/xkeyboard-config/compat/basic @@ -1,52 +1,48 @@ -// $Xorg: basic,v 1.3 2000/08/17 19:54:34 cpqbld Exp $ - -// Minimal set of symbol interpretations to provide -// reasonable default behavior (Num lock, shift and -// caps lock and mode switch) and set up the -// automatic updating of common keyboard LEDs. - -// $XFree86: xc/programs/xkbcomp/compat/basic,v 1.2 2000/11/06 19:24:10 dawes Exp $ - -default xkb_compatibility "basic" { - virtual_modifiers NumLock,AltGr; - - interpret.repeat= False; - setMods.clearLocks= True; - latchMods.clearLocks= True; - latchMods.latchToLock= True; - - interpret Shift_Lock+AnyOf(Shift+Lock) { - action= LockMods(modifiers=Shift); - }; - - interpret Any+Lock { - action= LockMods(modifiers=Lock); - }; - - interpret Num_Lock+Any { - virtualModifier= NumLock; - action= LockMods(modifiers=NumLock); - }; - - interpret Mode_switch { - useModMapMods= level1; - virtualModifier= AltGr; - action= SetGroup(group=+1); - }; - - interpret Any + Any { - action= SetMods(modifiers=modMapMods); - }; - - group 2 = AltGr; - group 3 = AltGr; - group 4 = AltGr; - - include "ledcaps" - include "lednum" - indicator "Shift Lock" { - !allowExplicit; - whichModState= Locked; - modifiers= Shift; - }; -}; +// Minimal set of symbol interpretations to provide +// reasonable default behavior (Num lock, shift and +// caps lock and mode switch) and set up the +// automatic updating of common keyboard LEDs. + +default xkb_compatibility "basic" { + virtual_modifiers NumLock,AltGr; + + interpret.repeat= False; + setMods.clearLocks= True; + latchMods.clearLocks= True; + latchMods.latchToLock= True; + + interpret Shift_Lock+AnyOf(Shift+Lock) { + action= LockMods(modifiers=Shift); + }; + + interpret Any+Lock { + action= LockMods(modifiers=Lock); + }; + + interpret Num_Lock+Any { + virtualModifier= NumLock; + action= LockMods(modifiers=NumLock); + }; + + interpret Mode_switch { + useModMapMods= level1; + virtualModifier= AltGr; + action= SetGroup(group=+1); + }; + + interpret Any + Any { + action= SetMods(modifiers=modMapMods); + }; + + group 2 = AltGr; + group 3 = AltGr; + group 4 = AltGr; + + include "ledcaps" + include "lednum" + indicator "Shift Lock" { + !allowExplicit; + whichModState= Locked; + modifiers= Shift; + }; +}; diff --git a/xorg-server/xkeyboard-config/compat/complete b/xorg-server/xkeyboard-config/compat/complete index cd8d059a7..0bf171db3 100644 --- a/xorg-server/xkeyboard-config/compat/complete +++ b/xorg-server/xkeyboard-config/compat/complete @@ -1,13 +1,10 @@ -// $XKeyboardConfig$ -// $Xorg: complete,v 1.3 2000/08/17 19:54:34 cpqbld Exp $ -default xkb_compatibility "complete" { - include "basic" - augment "iso9995" - augment "mousekeys" - augment "accessx(full)" - augment "misc" - augment "xfree86" - augment "level5" - augment "caps(caps_lock)" -}; - +default xkb_compatibility "complete" { + include "basic" + augment "iso9995" + augment "mousekeys" + augment "accessx(full)" + augment "misc" + augment "xfree86" + augment "level5" + augment "caps(caps_lock)" +}; diff --git a/xorg-server/xkeyboard-config/compat/default b/xorg-server/xkeyboard-config/compat/default index 090793fd7..9527a31cf 100644 --- a/xorg-server/xkeyboard-config/compat/default +++ b/xorg-server/xkeyboard-config/compat/default @@ -1,14 +1,12 @@ -// $XKeyboardConfig$ -// $Xorg: default,v 1.3 2000/08/17 19:54:34 cpqbld Exp $ -default xkb_compatibility "default" { - include "basic" - augment "mousekeys" - augment "accessx(basic)" - augment "misc" - augment "iso9995" - augment "level5" -// ??should be changed/renamed/removed -// augment "xfree86" - augment "japan" - augment "caps(caps_lock)" -}; +default xkb_compatibility "default" { + include "basic" + augment "mousekeys" + augment "accessx(basic)" + augment "misc" + augment "iso9995" + augment "level5" +// ??should be changed/renamed/removed +// augment "xfree86" + augment "japan" + augment "caps(caps_lock)" +}; diff --git a/xorg-server/xkeyboard-config/compat/iso9995 b/xorg-server/xkeyboard-config/compat/iso9995 index d513c1ce4..4dea5bf01 100644 --- a/xorg-server/xkeyboard-config/compat/iso9995 +++ b/xorg-server/xkeyboard-config/compat/iso9995 @@ -1,84 +1,80 @@ -// $Xorg: iso9995,v 1.3 2000/08/17 19:54:34 cpqbld Exp $ - -// Fairly complete set of symbol interpretations -// to provide reasonable default behavior - -// $XFree86: xc/programs/xkbcomp/compat/iso9995,v 1.3 2003/02/21 03:16:34 dawes Exp $ - -default partial xkb_compatibility "default" { - virtual_modifiers LevelThree,AltGr; - - interpret.repeat= False; - setMods.clearLocks= True; - latchMods.clearLocks= True; - latchMods.latchToLock= True; - - interpret ISO_Lock+Any { - action= ISOLock(affect= all,modifiers=modMapMods); - }; - - interpret ISO_Level2_Latch+Shift { - useModMapMods= level1; - action= LatchMods(modifiers=Shift); - }; - - interpret ISO_Level3_Shift+Any { - useModMapMods= level1; - virtualModifier= LevelThree; - action= SetMods(modifiers=LevelThree); - }; - - interpret ISO_Level3_Shift { - action= SetMods(modifiers=LevelThree); - }; - - interpret ISO_Level3_Latch+Any { - useModMapMods= level1; - virtualModifier= LevelThree; - action= LatchMods(modifiers=LevelThree); - }; - - interpret ISO_Level3_Latch { - action= LatchMods(modifiers=LevelThree); - }; - - interpret ISO_Level3_Lock+Any { - useModMapMods= level1; - virtualModifier= LevelThree; - action= LockMods(modifiers=LevelThree); - }; - - interpret ISO_Level3_Lock { - action= LockMods(modifiers=LevelThree); - }; - - interpret ISO_Group_Latch { - useModMapMods= level1; - virtualModifier= AltGr; - action= LatchGroup(group=2); - }; - - interpret ISO_Next_Group { - useModMapMods= level1; - virtualModifier= AltGr; - action= LockGroup(group=+1); - }; - - interpret ISO_Prev_Group { - useModMapMods= level1; - virtualModifier= AltGr; - action= LockGroup(group=-1); - }; - interpret ISO_First_Group { - action= LockGroup(group=1); - }; - - interpret ISO_Last_Group { - action= LockGroup(group=2); - }; - - indicator "Group 2" { - !allowExplicit; - groups= All-Group1; - }; -}; +// Fairly complete set of symbol interpretations +// to provide reasonable default behavior + +default partial xkb_compatibility "default" { + virtual_modifiers LevelThree,AltGr; + + interpret.repeat= False; + setMods.clearLocks= True; + latchMods.clearLocks= True; + latchMods.latchToLock= True; + + interpret ISO_Lock+Any { + action= ISOLock(affect= all,modifiers=modMapMods); + }; + + interpret ISO_Level2_Latch+Shift { + useModMapMods= level1; + action= LatchMods(modifiers=Shift); + }; + + interpret ISO_Level3_Shift+Any { + useModMapMods= level1; + virtualModifier= LevelThree; + action= SetMods(modifiers=LevelThree); + }; + + interpret ISO_Level3_Shift { + action= SetMods(modifiers=LevelThree); + }; + + interpret ISO_Level3_Latch+Any { + useModMapMods= level1; + virtualModifier= LevelThree; + action= LatchMods(modifiers=LevelThree); + }; + + interpret ISO_Level3_Latch { + action= LatchMods(modifiers=LevelThree); + }; + + interpret ISO_Level3_Lock+Any { + useModMapMods= level1; + virtualModifier= LevelThree; + action= LockMods(modifiers=LevelThree); + }; + + interpret ISO_Level3_Lock { + action= LockMods(modifiers=LevelThree); + }; + + interpret ISO_Group_Latch { + useModMapMods= level1; + virtualModifier= AltGr; + action= LatchGroup(group=2); + }; + + interpret ISO_Next_Group { + useModMapMods= level1; + virtualModifier= AltGr; + action= LockGroup(group=+1); + }; + + interpret ISO_Prev_Group { + useModMapMods= level1; + virtualModifier= AltGr; + action= LockGroup(group=-1); + }; + interpret ISO_First_Group { + action= LockGroup(group=1); + }; + + interpret ISO_Last_Group { + action= LockGroup(group=2); + }; + + indicator "Group 2" { + !allowExplicit; + groups= All-Group1; + }; +}; diff --git a/xorg-server/xkeyboard-config/compat/japan b/xorg-server/xkeyboard-config/compat/japan index 00187d00f..e9a6728d4 100644 --- a/xorg-server/xkeyboard-config/compat/japan +++ b/xorg-server/xkeyboard-config/compat/japan @@ -1,48 +1,45 @@ -// $Xorg: japan,v 1.3 2000/08/17 19:54:34 cpqbld Exp $ - -// Japanese keyboards need Eisu and Kana shift and -// lock keys, which are typically bound to the -// second shift level for some other modifier key. -// These interpretations disable the default -// interpretation (which would have these keys set -// the same modifier as the level one symbol). - -default partial xkb_compatibility "japan" { - - interpret.repeat= False; - - interpret Eisu_Shift+Lock { - action= NoAction(); - }; - - interpret Eisu_toggle+Lock { - action= NoAction(); - }; - - interpret Kana_Shift+Lock { - action= NoAction(); - }; - - interpret Kana_Lock+Lock { - action= NoAction(); - }; -}; - -// Some Japanese keyboards have an explict Kana Lock key & matching LED - -partial xkb_compatibility "kana_lock" { - - virtual_modifiers Kana_Lock; - - interpret Kana_Lock+AnyOfOrNone(all) { - virtualModifier= Kana_Lock; - useModMapMods=level1; - action= LockGroup(group=+1); - }; - - indicator "Kana" { - !allowExplicit; - groups= All-Group1; - }; -}; - +// Japanese keyboards need Eisu and Kana shift and +// lock keys, which are typically bound to the +// second shift level for some other modifier key. +// These interpretations disable the default +// interpretation (which would have these keys set +// the same modifier as the level one symbol). + +default partial xkb_compatibility "japan" { + + interpret.repeat= False; + + interpret Eisu_Shift+Lock { + action= NoAction(); + }; + + interpret Eisu_toggle+Lock { + action= NoAction(); + }; + + interpret Kana_Shift+Lock { + action= NoAction(); + }; + + interpret Kana_Lock+Lock { + action= NoAction(); + }; +}; + +// Some Japanese keyboards have an explict Kana Lock key & matching LED + +partial xkb_compatibility "kana_lock" { + + virtual_modifiers Kana_Lock; + + interpret Kana_Lock+AnyOfOrNone(all) { + virtualModifier= Kana_Lock; + useModMapMods=level1; + action= LockGroup(group=+1); + }; + + indicator "Kana" { + !allowExplicit; + groups= All-Group1; + }; +}; diff --git a/xorg-server/xkeyboard-config/compat/keypad b/xorg-server/xkeyboard-config/compat/keypad index 469edec28..f28ca1497 100644 --- a/xorg-server/xkeyboard-config/compat/keypad +++ b/xorg-server/xkeyboard-config/compat/keypad @@ -1,60 +1,58 @@ -// $Xorg: keypad,v 1.3 2000/08/17 19:54:34 cpqbld Exp $ - -// Interpretations needed to implement the numeric keypad -// as an overlay instead of a modifier. - -partial hidden xkb_compatibility "overlay" { - include "keypad(overlay1)" -}; -partial hidden xkb_compatibility "overlay1" { - virtual_modifiers NumLock,AltGr; - - interpret.repeat= False; - setMods.clearLocks= True; - latchMods.clearLocks= True; - latchMods.latchToLock= True; - - interpret Num_Lock { - virtualModifier= NumLock; - action= LockControls(ctrls=overlay1); - }; - interpret Num_Lock+Any { - virtualModifier= NumLock; - action= LockControls(ctrls=overlay1); - }; - - indicator.allowExplicit= True; - indicator.driveskbd= True; - replace indicator "Num Lock" { - whichModState= Locked; - modifiers= NumLock; - controls= Overlay1; - }; - indicator.allowExplicit= True; -}; -partial hidden xkb_compatibility "overlay2" { - virtual_modifiers NumLock,AltGr; - - interpret.repeat= False; - setMods.clearLocks= True; - latchMods.clearLocks= True; - latchMods.latchToLock= True; - - interpret Num_Lock { - virtualModifier= NumLock; - action= LockControls(ctrls=overlay2); - }; - interpret Num_Lock+Any { - virtualModifier= NumLock; - action= LockControls(ctrls=overlay1); - }; - - indicator.allowExplicit= True; - indicator.driveskbd= True; - replace indicator "Num Lock" { - whichModState= Locked; - modifiers= NumLock; - controls= Overlay2; - }; - indicator.allowExplicit= True; -}; +// Interpretations needed to implement the numeric keypad +// as an overlay instead of a modifier. + +partial hidden xkb_compatibility "overlay" { + include "keypad(overlay1)" +}; +partial hidden xkb_compatibility "overlay1" { + virtual_modifiers NumLock,AltGr; + + interpret.repeat= False; + setMods.clearLocks= True; + latchMods.clearLocks= True; + latchMods.latchToLock= True; + + interpret Num_Lock { + virtualModifier= NumLock; + action= LockControls(ctrls=overlay1); + }; + interpret Num_Lock+Any { + virtualModifier= NumLock; + action= LockControls(ctrls=overlay1); + }; + + indicator.allowExplicit= True; + indicator.driveskbd= True; + replace indicator "Num Lock" { + whichModState= Locked; + modifiers= NumLock; + controls= Overlay1; + }; + indicator.allowExplicit= True; +}; +partial hidden xkb_compatibility "overlay2" { + virtual_modifiers NumLock,AltGr; + + interpret.repeat= False; + setMods.clearLocks= True; + latchMods.clearLocks= True; + latchMods.latchToLock= True; + + interpret Num_Lock { + virtualModifier= NumLock; + action= LockControls(ctrls=overlay2); + }; + interpret Num_Lock+Any { + virtualModifier= NumLock; + action= LockControls(ctrls=overlay1); + }; + + indicator.allowExplicit= True; + indicator.driveskbd= True; + replace indicator "Num Lock" { + whichModState= Locked; + modifiers= NumLock; + controls= Overlay2; + }; + indicator.allowExplicit= True; +}; diff --git a/xorg-server/xkeyboard-config/compat/level5 b/xorg-server/xkeyboard-config/compat/level5 index 47693549f..69296e9f0 100644 --- a/xorg-server/xkeyboard-config/compat/level5 +++ b/xorg-server/xkeyboard-config/compat/level5 @@ -1,56 +1,51 @@ -// $XKeyboardConfig$ -// $Xorg: level5,v 1.3 2000/08/17 19:54:34 cpqbld Exp $ - -// Fairly complete set of symbol interpretations -// to provide reasonable default behavior - -// $XFree86: xc/programs/xkbcomp/compat/iso9995,v 1.3 2003/02/21 03:16:34 dawes Exp $ - -default partial xkb_compatibility "default" { - virtual_modifiers LevelFive; - - interpret.repeat= False; - setMods.clearLocks= True; - latchMods.clearLocks= True; - latchMods.latchToLock= True; - - interpret ISO_Level5_Shift+Any { - useModMapMods= level1; - virtualModifier= LevelFive; - action= SetMods(modifiers=LevelFive); - }; - - interpret ISO_Level5_Shift { - action= SetMods(modifiers=LevelFive); - }; - - interpret ISO_Level5_Latch+Any { - virtualModifier= LevelFive; - action= LatchMods(modifiers=LevelFive); - }; - - interpret ISO_Level5_Latch { - action= LatchMods(modifiers=LevelFive); - }; - - interpret ISO_Level5_Lock+Any { - virtualModifier= LevelFive; - action= LockMods(modifiers=LevelFive); - }; - - interpret ISO_Level5_Lock { - action= LockMods(modifiers=LevelFive); - }; -}; -partial xkb_compatibility "level5_lock" { - // This defines a Level5-Lock using the NumLock real modifier in order to - // create arbitrary level-behaviour, which would not be possible with the - // virtual modifier. - // See also: types/level5 : EIGHT_LEVEL_LEVEL_FIVE_LOCK - // See also: symbols/level5(lock) - virtual_modifiers NumLock; - - interpret ISO_Level5_Lock { - action = LockMods(modifiers = NumLock); - }; -}; +// Fairly complete set of symbol interpretations +// to provide reasonable default behavior + +default partial xkb_compatibility "default" { + virtual_modifiers LevelFive; + + interpret.repeat= False; + setMods.clearLocks= True; + latchMods.clearLocks= True; + latchMods.latchToLock= True; + + interpret ISO_Level5_Shift+Any { + useModMapMods= level1; + virtualModifier= LevelFive; + action= SetMods(modifiers=LevelFive); + }; + + interpret ISO_Level5_Shift { + action= SetMods(modifiers=LevelFive); + }; + + interpret ISO_Level5_Latch+Any { + virtualModifier= LevelFive; + action= LatchMods(modifiers=LevelFive); + }; + + interpret ISO_Level5_Latch { + action= LatchMods(modifiers=LevelFive); + }; + + interpret ISO_Level5_Lock+Any { + virtualModifier= LevelFive; + action= LockMods(modifiers=LevelFive); + }; + + interpret ISO_Level5_Lock { + action= LockMods(modifiers=LevelFive); + }; +}; +partial xkb_compatibility "level5_lock" { + // This defines a Level5-Lock using the NumLock real modifier in order to + // create arbitrary level-behaviour, which would not be possible with the + // virtual modifier. + // See also: types/level5 : EIGHT_LEVEL_LEVEL_FIVE_LOCK + // See also: symbols/level5(lock) + virtual_modifiers NumLock; + + interpret ISO_Level5_Lock { + action = LockMods(modifiers = NumLock); + }; +}; diff --git a/xorg-server/xkeyboard-config/compat/misc b/xorg-server/xkeyboard-config/compat/misc index 184fedc42..6a8b20217 100644 --- a/xorg-server/xkeyboard-config/compat/misc +++ b/xorg-server/xkeyboard-config/compat/misc @@ -1,129 +1,122 @@ -// $XdotOrg: xc/programs/xkbcomp/compat/misc,v 1.1.4.4 2004/03/05 13:41:28 eich Exp $ -// $Xorg: misc,v 1.3 2000/08/17 19:54:34 cpqbld Exp $ -// -// -// -// $XFree86: xc/programs/xkbcomp/compat/misc,v 1.4 2003/05/15 13:31:57 pascal Exp $ - -default partial xkb_compatibility "misc" { - - virtual_modifiers Alt,Meta,Super,Hyper,ScrollLock; - - // Interpretations for some other useful keys - - interpret Terminate_Server { - action = Terminate(); - }; - - setMods.clearLocks= True; - - // Sets the "Alt" virtual modifier - - interpret Alt_L+Any { - //useModMapMods= level1; - virtualModifier= Alt; - action = SetMods(modifiers=modMapMods); - }; - - interpret Alt_L { - action = SetMods(modifiers=Alt); - }; - - interpret Alt_R+Any { - //useModMapMods= level1; - virtualModifier= Alt; - action = SetMods(modifiers=modMapMods); - }; - - interpret Alt_R { - action = SetMods(modifiers=Alt); - }; - - // Sets the "Meta" virtual modifier - - interpret Meta_L+Any { -// useModMapMods= level1; - virtualModifier= Meta; - action = SetMods(modifiers=modMapMods); - }; - - interpret Meta_L { - action = SetMods(modifiers=Meta); - }; - - interpret Meta_R+Any { - //useModMapMods= level1; - virtualModifier= Meta; - action = SetMods(modifiers=modMapMods); - }; - - interpret Meta_R { - action = SetMods(modifiers=Meta); - }; - - // Sets the "Super" virtual modifier - - interpret Super_L+Any { -// useModMapMods= level1; - virtualModifier= Super; - action = SetMods(modifiers=modMapMods); - }; - - interpret Super_L { - action = SetMods(modifiers=Super); - }; - - interpret Super_R+Any { - //useModMapMods= level1; - virtualModifier= Super; - action = SetMods(modifiers=modMapMods); - }; - - interpret Super_R { - action = SetMods(modifiers=Super); - }; - - // Sets the "Hyper" virtual modifier - - interpret Hyper_L+Any { -// useModMapMods= level1; - virtualModifier= Hyper; - action = SetMods(modifiers=modMapMods); - }; - - interpret Hyper_L { - action = SetMods(modifiers=Hyper); - }; - - interpret Hyper_R+Any { - //useModMapMods= level1; - virtualModifier= Hyper; - action = SetMods(modifiers=modMapMods); - }; - - interpret Hyper_R { - action = SetMods(modifiers=Hyper); - }; - - // Sets the "ScrollLock" virtual modifier and - // makes it actually lock when pressed. Sets - // up a map for the scroll lock indicator. - interpret Scroll_Lock+Any { - virtualModifier= ScrollLock; - action = LockMods(modifiers=modMapMods); - }; - - include "ledscroll" - - include "misc(assign_shift_left_action)" -}; - -partial xkb_compatibility "assign_shift_left_action" { - // Because of the irrevertable modifier mapping in symbols/pc is - // getting bound to the Lock modifier when using - // symbols/shift(both_capslock), creating unwanted behaviour. - // This is a quirk, to circumvent the problem. - interpret Shift_L { - action = SetMods(modifiers = Shift); - }; -}; +default partial xkb_compatibility "misc" { + + virtual_modifiers Alt,Meta,Super,Hyper,ScrollLock; + + // Interpretations for some other useful keys + + interpret Terminate_Server { + action = Terminate(); + }; + + setMods.clearLocks= True; + + // Sets the "Alt" virtual modifier + + interpret Alt_L+Any { + //useModMapMods= level1; + virtualModifier= Alt; + action = SetMods(modifiers=modMapMods); + }; + + interpret Alt_L { + action = SetMods(modifiers=Alt); + }; + + interpret Alt_R+Any { + //useModMapMods= level1; + virtualModifier= Alt; + action = SetMods(modifiers=modMapMods); + }; + + interpret Alt_R { + action = SetMods(modifiers=Alt); + }; + + // Sets the "Meta" virtual modifier + + interpret Meta_L+Any { +// useModMapMods= level1; + virtualModifier= Meta; + action = SetMods(modifiers=modMapMods); + }; + + interpret Meta_L { + action = SetMods(modifiers=Meta); + }; + + interpret Meta_R+Any { + //useModMapMods= level1; + virtualModifier= Meta; + action = SetMods(modifiers=modMapMods); + }; + + interpret Meta_R { + action = SetMods(modifiers=Meta); + }; + + // Sets the "Super" virtual modifier + + interpret Super_L+Any { +// useModMapMods= level1; + virtualModifier= Super; + action = SetMods(modifiers=modMapMods); + }; + + interpret Super_L { + action = SetMods(modifiers=Super); + }; + + interpret Super_R+Any { + //useModMapMods= level1; + virtualModifier= Super; + action = SetMods(modifiers=modMapMods); + }; + + interpret Super_R { + action = SetMods(modifiers=Super); + }; + + // Sets the "Hyper" virtual modifier + + interpret Hyper_L+Any { +// useModMapMods= level1; + virtualModifier= Hyper; + action = SetMods(modifiers=modMapMods); + }; + + interpret Hyper_L { + action = SetMods(modifiers=Hyper); + }; + + interpret Hyper_R+Any { + //useModMapMods= level1; + virtualModifier= Hyper; + action = SetMods(modifiers=modMapMods); + }; + + interpret Hyper_R { + action = SetMods(modifiers=Hyper); + }; + + // Sets the "ScrollLock" virtual modifier and + // makes it actually lock when pressed. Sets + // up a map for the scroll lock indicator. + interpret Scroll_Lock+Any { + virtualModifier= ScrollLock; + action = LockMods(modifiers=modMapMods); + }; + + include "ledscroll" + + include "misc(assign_shift_left_action)" +}; + +partial xkb_compatibility "assign_shift_left_action" { + // Because of the irrevertable modifier mapping in symbols/pc is + // getting bound to the Lock modifier when using + // symbols/shift(both_capslock), creating unwanted behaviour. + // This is a quirk, to circumvent the problem. + interpret Shift_L { + action = SetMods(modifiers = Shift); + }; +}; diff --git a/xorg-server/xkeyboard-config/compat/mousekeys b/xorg-server/xkeyboard-config/compat/mousekeys index fbd2b889a..bdd3d7c5d 100644 --- a/xorg-server/xkeyboard-config/compat/mousekeys +++ b/xorg-server/xkeyboard-config/compat/mousekeys @@ -1,205 +1,202 @@ - -// $Xorg: mousekeys,v 1.3 2000/08/17 19:54:34 cpqbld Exp $ - -// Interpretations for arrow keys and a bunch of other -// common keysyms which make it possible to bind "mouse" -// keys using xmodmap and activate or deactivate them -// from the keyboard. - -default partial xkb_compatibility "mousekeys" { - - // Keypad actions. - // - interpret.repeat= True; - - interpret KP_1 { - action = MovePtr(x=-1,y= +1); - }; - interpret KP_End { - action = MovePtr(x=-1,y= +1); - }; - - interpret KP_2 { - action = MovePtr(x=+0,y= +1); - }; - interpret KP_Down { - action = MovePtr(x=+0,y= +1); - }; - - interpret KP_3 { - action = MovePtr(x=+1,y=+1); - }; - interpret KP_Next { - action = MovePtr(x=+1,y=+1); - }; - - interpret KP_4 { - action = MovePtr(x=-1,y=+0); - }; - interpret KP_Left { - action = MovePtr(x=-1,y=+0); - }; - - interpret KP_6 { - action = MovePtr(x=+1,y=+0); - }; - interpret KP_Right { - action = MovePtr(x=+1,y=+0); - }; - - interpret KP_7 { - action = MovePtr(x=-1,y=-1); - }; - interpret KP_Home { - action = MovePtr(x=-1,y=-1); - }; - - interpret KP_8 { - action = MovePtr(x=+0,y=-1); - }; - interpret KP_Up { - action = MovePtr(x=+0,y=-1); - }; - - interpret KP_9 { - action = MovePtr(x=+1,y=-1); - }; - interpret KP_Prior { - action = MovePtr(x=+1,y=-1); - }; - - interpret KP_5 { - action = PointerButton(button=default); - }; - interpret KP_Begin { - action = PointerButton(button=default); - }; - - interpret KP_F2 { - action = SetPtrDflt(affect=defaultButton,button=1); - }; - interpret KP_Divide { - action = SetPtrDflt(affect=defaultButton,button=1); - }; - - interpret KP_F3 { - action = SetPtrDflt(affect=defaultButton,button=2); - }; - interpret KP_Multiply { - action = SetPtrDflt(affect=defaultButton,button=2); - }; - - interpret KP_F4 { - action = SetPtrDflt(affect=defaultButton,button=3); - }; - interpret KP_Subtract { - action = SetPtrDflt(affect=defaultButton,button=3); - }; - - interpret KP_Separator { - action = PointerButton(button=default,count=2); - }; - interpret KP_Add { - action = PointerButton(button=default,count=2); - }; - - interpret KP_0 { - action = LockPointerButton(button=default,affect=lock); - }; - interpret KP_Insert { - action = LockPointerButton(button=default,affect=lock); - }; - - interpret KP_Decimal { - action = LockPointerButton(button=default,affect=unlock); - }; - interpret KP_Delete { - action = LockPointerButton(button=default,affect=unlock); - }; - - // Additional mappings for Solaris keypad compatibility - interpret F25 { // aka KP_Divide - action = SetPtrDflt(affect=defaultButton,button=1); - }; - interpret F26 { // aka KP_Multiply - action = SetPtrDflt(affect=defaultButton,button=2); - }; - interpret F27 { // aka KP_Home - action = MovePtr(x=-1,y=-1); - }; - interpret F29 { // aka KP_Prior - action = MovePtr(x=+1,y=-1); - }; - interpret F31 { // aka KP_Begin - action = PointerButton(button=default); - }; - interpret F33 { // aka KP_End - action = MovePtr(x=-1,y= +1); - }; - interpret F35 { // aka KP_Next - action = MovePtr(x=+1,y=+1); - }; - - interpret.repeat= False; - - - // New Keysym Actions. - // - interpret Pointer_Button_Dflt { - action= PointerButton(button=default); - }; - interpret Pointer_Button1 { - action= PointerButton(button=1); - }; - interpret Pointer_Button2 { - action= PointerButton(button=2); - }; - interpret Pointer_Button3 { - action= PointerButton(button=3); - }; - interpret Pointer_DblClick_Dflt { - action= PointerButton(button=default,count=2); - }; - interpret Pointer_DblClick1 { - action= PointerButton(button=1,count=2); - }; - interpret Pointer_DblClick2 { - action= PointerButton(button=2,count=2); - }; - interpret Pointer_DblClick3 { - action= PointerButton(button=3,count=2); - }; - interpret Pointer_Drag_Dflt { - action= LockPointerButton(button=default); - }; - interpret Pointer_Drag1 { - action= LockPointerButton(button=1); - }; - interpret Pointer_Drag2 { - action= LockPointerButton(button=2); - }; - interpret Pointer_Drag3 { - action= LockPointerButton(button=3); - }; - - interpret Pointer_EnableKeys { - action= LockControls(controls=MouseKeys); - }; - interpret Pointer_Accelerate { - action= LockControls(controls=MouseKeysAccel); - }; - interpret Pointer_DfltBtnNext { - action= SetPtrDflt(affect=defaultButton,button= +1); - }; - interpret Pointer_DfltBtnPrev { - action= SetPtrDflt(affect=defaultButton,button= -1); - }; - - - // Allow an indicator for MouseKeys. - indicator "Mouse Keys" { -// !allowExplicit; - indicatorDrivesKeyboard; - controls= MouseKeys; - }; -}; +// Interpretations for arrow keys and a bunch of other +// common keysyms which make it possible to bind "mouse" +// keys using xmodmap and activate or deactivate them +// from the keyboard. + +default partial xkb_compatibility "mousekeys" { + + // Keypad actions. + // + interpret.repeat= True; + + interpret KP_1 { + action = MovePtr(x=-1,y= +1); + }; + interpret KP_End { + action = MovePtr(x=-1,y= +1); + }; + + interpret KP_2 { + action = MovePtr(x=+0,y= +1); + }; + interpret KP_Down { + action = MovePtr(x=+0,y= +1); + }; + + interpret KP_3 { + action = MovePtr(x=+1,y=+1); + }; + interpret KP_Next { + action = MovePtr(x=+1,y=+1); + }; + + interpret KP_4 { + action = MovePtr(x=-1,y=+0); + }; + interpret KP_Left { + action = MovePtr(x=-1,y=+0); + }; + + interpret KP_6 { + action = MovePtr(x=+1,y=+0); + }; + interpret KP_Right { + action = MovePtr(x=+1,y=+0); + }; + + interpret KP_7 { + action = MovePtr(x=-1,y=-1); + }; + interpret KP_Home { + action = MovePtr(x=-1,y=-1); + }; + + interpret KP_8 { + action = MovePtr(x=+0,y=-1); + }; + interpret KP_Up { + action = MovePtr(x=+0,y=-1); + }; + + interpret KP_9 { + action = MovePtr(x=+1,y=-1); + }; + interpret KP_Prior { + action = MovePtr(x=+1,y=-1); + }; + + interpret KP_5 { + action = PointerButton(button=default); + }; + interpret KP_Begin { + action = PointerButton(button=default); + }; + + interpret KP_F2 { + action = SetPtrDflt(affect=defaultButton,button=1); + }; + interpret KP_Divide { + action = SetPtrDflt(affect=defaultButton,button=1); + }; + + interpret KP_F3 { + action = SetPtrDflt(affect=defaultButton,button=2); + }; + interpret KP_Multiply { + action = SetPtrDflt(affect=defaultButton,button=2); + }; + + interpret KP_F4 { + action = SetPtrDflt(affect=defaultButton,button=3); + }; + interpret KP_Subtract { + action = SetPtrDflt(affect=defaultButton,button=3); + }; + + interpret KP_Separator { + action = PointerButton(button=default,count=2); + }; + interpret KP_Add { + action = PointerButton(button=default,count=2); + }; + + interpret KP_0 { + action = LockPointerButton(button=default,affect=lock); + }; + interpret KP_Insert { + action = LockPointerButton(button=default,affect=lock); + }; + + interpret KP_Decimal { + action = LockPointerButton(button=default,affect=unlock); + }; + interpret KP_Delete { + action = LockPointerButton(button=default,affect=unlock); + }; + + // Additional mappings for Solaris keypad compatibility + interpret F25 { // aka KP_Divide + action = SetPtrDflt(affect=defaultButton,button=1); + }; + interpret F26 { // aka KP_Multiply + action = SetPtrDflt(affect=defaultButton,button=2); + }; + interpret F27 { // aka KP_Home + action = MovePtr(x=-1,y=-1); + }; + interpret F29 { // aka KP_Prior + action = MovePtr(x=+1,y=-1); + }; + interpret F31 { // aka KP_Begin + action = PointerButton(button=default); + }; + interpret F33 { // aka KP_End + action = MovePtr(x=-1,y= +1); + }; + interpret F35 { // aka KP_Next + action = MovePtr(x=+1,y=+1); + }; + + interpret.repeat= False; + + + // New Keysym Actions. + // + interpret Pointer_Button_Dflt { + action= PointerButton(button=default); + }; + interpret Pointer_Button1 { + action= PointerButton(button=1); + }; + interpret Pointer_Button2 { + action= PointerButton(button=2); + }; + interpret Pointer_Button3 { + action= PointerButton(button=3); + }; + interpret Pointer_DblClick_Dflt { + action= PointerButton(button=default,count=2); + }; + interpret Pointer_DblClick1 { + action= PointerButton(button=1,count=2); + }; + interpret Pointer_DblClick2 { + action= PointerButton(button=2,count=2); + }; + interpret Pointer_DblClick3 { + action= PointerButton(button=3,count=2); + }; + interpret Pointer_Drag_Dflt { + action= LockPointerButton(button=default); + }; + interpret Pointer_Drag1 { + action= LockPointerButton(button=1); + }; + interpret Pointer_Drag2 { + action= LockPointerButton(button=2); + }; + interpret Pointer_Drag3 { + action= LockPointerButton(button=3); + }; + + interpret Pointer_EnableKeys { + action= LockControls(controls=MouseKeys); + }; + interpret Pointer_Accelerate { + action= LockControls(controls=MouseKeysAccel); + }; + interpret Pointer_DfltBtnNext { + action= SetPtrDflt(affect=defaultButton,button= +1); + }; + interpret Pointer_DfltBtnPrev { + action= SetPtrDflt(affect=defaultButton,button= -1); + }; + + + // Allow an indicator for MouseKeys. + indicator "Mouse Keys" { +// !allowExplicit; + indicatorDrivesKeyboard; + controls= MouseKeys; + }; +}; diff --git a/xorg-server/xkeyboard-config/compat/norepeat b/xorg-server/xkeyboard-config/compat/norepeat index 07b0b7a60..1f47d7e17 100644 --- a/xorg-server/xkeyboard-config/compat/norepeat +++ b/xorg-server/xkeyboard-config/compat/norepeat @@ -1,11 +1,9 @@ -// $Xorg: norepeat,v 1.3 2000/08/17 19:54:34 cpqbld Exp $ - -// Put any otherwise normal keys that you don't want to repeat in -// this file - -default partial xkb_compatibility "norepeat" { - interpret Return { - action= NoAction(); - repeat= False; - }; -}; +// Put any otherwise normal keys that you don't want to repeat in +// this file + +default partial xkb_compatibility "norepeat" { + interpret Return { + action= NoAction(); + repeat= False; + }; +}; diff --git a/xorg-server/xkeyboard-config/compat/olpc b/xorg-server/xkeyboard-config/compat/olpc index 001da12c1..b8fe667d2 100644 --- a/xorg-server/xkeyboard-config/compat/olpc +++ b/xorg-server/xkeyboard-config/compat/olpc @@ -1,52 +1,51 @@ -// $XKeyboardConfig$ -// -// Created by Bernardo Innocenti -// -// Map the OLPC game keys to virtual modifiers -// - -default xkb_compatibility "olpc" { - include "complete" - - virtual_modifiers Square,Cross,Triangle,Circle; - - interpret KP_Home+Any { - //useModMapMods= level1; - virtualModifier= Square; - action = SetMods(modifiers=modMapMods); - }; - - interpret KP_Home { - action = SetMods(modifiers=Square); - }; - - interpret KP_Next+Any { - //useModMapMods= level1; - virtualModifier= Cross; - action = SetMods(modifiers=modMapMods); - }; - - interpret KP_Next { - action = SetMods(modifiers=Cross); - }; - - interpret KP_End+Any { - //useModMapMods= level1; - virtualModifier= Circle; - action = SetMods(modifiers=modMapMods); - }; - - interpret KP_End { - action = SetMods(modifiers=Circle); - }; - - interpret KP_Prior+Any { - //useModMapMods= level1; - virtualModifier= Triangle; - action = SetMods(modifiers=modMapMods); - }; - - interpret KP_Prior { - action = SetMods(modifiers=Triangle); - }; -}; +// +// Created by Bernardo Innocenti +// +// Map the OLPC game keys to virtual modifiers +// + +default xkb_compatibility "olpc" { + include "complete" + + virtual_modifiers Square,Cross,Triangle,Circle; + + interpret KP_Home+Any { + //useModMapMods= level1; + virtualModifier= Square; + action = SetMods(modifiers=modMapMods); + }; + + interpret KP_Home { + action = SetMods(modifiers=Square); + }; + + interpret KP_Next+Any { + //useModMapMods= level1; + virtualModifier= Cross; + action = SetMods(modifiers=modMapMods); + }; + + interpret KP_Next { + action = SetMods(modifiers=Cross); + }; + + interpret KP_End+Any { + //useModMapMods= level1; + virtualModifier= Circle; + action = SetMods(modifiers=modMapMods); + }; + + interpret KP_End { + action = SetMods(modifiers=Circle); + }; + + interpret KP_Prior+Any { + //useModMapMods= level1; + virtualModifier= Triangle; + action = SetMods(modifiers=modMapMods); + }; + + interpret KP_Prior { + action = SetMods(modifiers=Triangle); + }; +}; diff --git a/xorg-server/xkeyboard-config/compat/pc b/xorg-server/xkeyboard-config/compat/pc index 5ce7d767d..14ba9c3cc 100644 --- a/xorg-server/xkeyboard-config/compat/pc +++ b/xorg-server/xkeyboard-config/compat/pc @@ -1,18 +1,17 @@ -// $Xorg: pc,v 1.3 2000/08/17 19:54:34 cpqbld Exp $ -default partial xkb_compatibility "pc" { - - // Sets the "Alt" virtual modifier - - virtual_modifiers Alt; - - setMods.clearLocks= True; - interpret Alt_L+Any { - virtualModifier= Alt; - action = SetMods(modifiers=modMapMods); - }; - - interpret Alt_R+Any { - virtualModifier= Alt; - action = SetMods(modifiers=modMapMods); - }; -}; +default partial xkb_compatibility "pc" { + + // Sets the "Alt" virtual modifier + + virtual_modifiers Alt; + + setMods.clearLocks= True; + interpret Alt_L+Any { + virtualModifier= Alt; + action = SetMods(modifiers=modMapMods); + }; + + interpret Alt_R+Any { + virtualModifier= Alt; + action = SetMods(modifiers=modMapMods); + }; +}; diff --git a/xorg-server/xkeyboard-config/compat/pc98 b/xorg-server/xkeyboard-config/compat/pc98 index 23f3f7987..93a620036 100644 --- a/xorg-server/xkeyboard-config/compat/pc98 +++ b/xorg-server/xkeyboard-config/compat/pc98 @@ -1,62 +1,55 @@ -// $Xorg: pc98,v 1.3 2000/08/17 19:54:34 cpqbld Exp $ - - - - -// $XFree86: xc/programs/xkbcomp/compat/pc98,v 3.1 1997/10/26 13:25:33 dawes Exp $ - -// Minimal set of symbol interpretations to provide -// reasonable default behavior (Num lock, shift and -// caps lock and mode switch) and set up the -// automatic updating of common keyboard LEDs. - -default xkb_compatibility "basic" { - virtual_modifiers NumLock,AltGr; - - interpret.repeat= False; - setMods.clearLocks= True; - latchMods.clearLocks= True; - latchMods.latchToLock= True; - - interpret Shift_Lock+AnyOf(Shift+Lock) { - action= LockMods(modifiers=Shift); - }; - -// interpret Any+Lock { -// action= LockMods(modifiers=Lock); -// }; - - interpret Num_Lock+Any { - virtualModifier= NumLock; - action= LockMods(modifiers=NumLock); - }; - - interpret Mode_switch { - useModMapMods= level1; - virtualModifier= AltGr; - action= SetGroup(group=2,clearLocks); - }; - - interpret Any + Any { - action= SetMods(modifiers=modMapMods); - }; - - group 2 = AltGr; - group 3 = AltGr; - group 4 = AltGr; - - indicator.allowExplicit= False; - indicator "Caps Lock" { - whichModState= Locked; - modifiers= Lock; - }; - indicator "Num Lock" { - whichModState= Locked; - modifiers= NumLock; - }; - indicator "Shift Lock" { - whichModState= Locked; - modifiers= Shift; - }; - indicator.allowExplicit= True; -}; +// Minimal set of symbol interpretations to provide +// reasonable default behavior (Num lock, shift and +// caps lock and mode switch) and set up the +// automatic updating of common keyboard LEDs. + +default xkb_compatibility "basic" { + virtual_modifiers NumLock,AltGr; + + interpret.repeat= False; + setMods.clearLocks= True; + latchMods.clearLocks= True; + latchMods.latchToLock= True; + + interpret Shift_Lock+AnyOf(Shift+Lock) { + action= LockMods(modifiers=Shift); + }; + +// interpret Any+Lock { +// action= LockMods(modifiers=Lock); +// }; + + interpret Num_Lock+Any { + virtualModifier= NumLock; + action= LockMods(modifiers=NumLock); + }; + + interpret Mode_switch { + useModMapMods= level1; + virtualModifier= AltGr; + action= SetGroup(group=2,clearLocks); + }; + + interpret Any + Any { + action= SetMods(modifiers=modMapMods); + }; + + group 2 = AltGr; + group 3 = AltGr; + group 4 = AltGr; + + indicator.allowExplicit= False; + indicator "Caps Lock" { + whichModState= Locked; + modifiers= Lock; + }; + indicator "Num Lock" { + whichModState= Locked; + modifiers= NumLock; + }; + indicator "Shift Lock" { + whichModState= Locked; + modifiers= Shift; + }; + indicator.allowExplicit= True; +}; diff --git a/xorg-server/xkeyboard-config/compat/xfree86 b/xorg-server/xkeyboard-config/compat/xfree86 index 2da65fd6a..c511ae264 100644 --- a/xorg-server/xkeyboard-config/compat/xfree86 +++ b/xorg-server/xkeyboard-config/compat/xfree86 @@ -1,57 +1,56 @@ -// $XFree86$ -// XFree86 special keysyms - -default partial xkb_compatibility "basic" { - - interpret.repeat= True; - - interpret XF86_Switch_VT_1 { - action = SwitchScreen(Screen=1, !SameServer); - }; - interpret XF86_Switch_VT_2 { - action = SwitchScreen(Screen=2, !SameServer); - }; - interpret XF86_Switch_VT_3 { - action = SwitchScreen(Screen=3, !SameServer); - }; - interpret XF86_Switch_VT_4 { - action = SwitchScreen(Screen=4, !SameServer); - }; - interpret XF86_Switch_VT_5 { - action = SwitchScreen(Screen=5, !SameServer); - }; - interpret XF86_Switch_VT_6 { - action = SwitchScreen(Screen=6, !SameServer); - }; - interpret XF86_Switch_VT_7 { - action = SwitchScreen(Screen=7, !SameServer); - }; - interpret XF86_Switch_VT_8 { - action = SwitchScreen(Screen=8, !SameServer); - }; - interpret XF86_Switch_VT_9 { - action = SwitchScreen(Screen=9, !SameServer); - }; - interpret XF86_Switch_VT_10 { - action = SwitchScreen(Screen=10, !SameServer); - }; - interpret XF86_Switch_VT_11 { - action = SwitchScreen(Screen=11, !SameServer); - }; - interpret XF86_Switch_VT_12 { - action = SwitchScreen(Screen=12, !SameServer); - }; - - interpret XF86_Ungrab { - action = Private(type=0x86, data="Ungrab"); - }; - interpret XF86_ClearGrab { - action = Private(type=0x86, data="ClsGrb"); - }; - interpret XF86_Next_VMode { - action = Private(type=0x86, data="+VMode"); - }; - interpret XF86_Prev_VMode { - action = Private(type=0x86, data="-VMode"); - }; -}; +// XFree86 special keysyms + +default partial xkb_compatibility "basic" { + + interpret.repeat= True; + + interpret XF86_Switch_VT_1 { + action = SwitchScreen(Screen=1, !SameServer); + }; + interpret XF86_Switch_VT_2 { + action = SwitchScreen(Screen=2, !SameServer); + }; + interpret XF86_Switch_VT_3 { + action = SwitchScreen(Screen=3, !SameServer); + }; + interpret XF86_Switch_VT_4 { + action = SwitchScreen(Screen=4, !SameServer); + }; + interpret XF86_Switch_VT_5 { + action = SwitchScreen(Screen=5, !SameServer); + }; + interpret XF86_Switch_VT_6 { + action = SwitchScreen(Screen=6, !SameServer); + }; + interpret XF86_Switch_VT_7 { + action = SwitchScreen(Screen=7, !SameServer); + }; + interpret XF86_Switch_VT_8 { + action = SwitchScreen(Screen=8, !SameServer); + }; + interpret XF86_Switch_VT_9 { + action = SwitchScreen(Screen=9, !SameServer); + }; + interpret XF86_Switch_VT_10 { + action = SwitchScreen(Screen=10, !SameServer); + }; + interpret XF86_Switch_VT_11 { + action = SwitchScreen(Screen=11, !SameServer); + }; + interpret XF86_Switch_VT_12 { + action = SwitchScreen(Screen=12, !SameServer); + }; + + interpret XF86_Ungrab { + action = Private(type=0x86, data="Ungrab"); + }; + interpret XF86_ClearGrab { + action = Private(type=0x86, data="ClsGrb"); + }; + interpret XF86_Next_VMode { + action = Private(type=0x86, data="+VMode"); + }; + interpret XF86_Prev_VMode { + action = Private(type=0x86, data="-VMode"); + }; +}; diff --git a/xorg-server/xkeyboard-config/compat/xtest b/xorg-server/xkeyboard-config/compat/xtest index a35ced915..6700bedd6 100644 --- a/xorg-server/xkeyboard-config/compat/xtest +++ b/xorg-server/xkeyboard-config/compat/xtest @@ -1,58 +1,57 @@ -// $Xorg: xtest,v 1.3 2000/08/17 19:54:34 cpqbld Exp $ -default xkb_compatibility "xtest" { - - // Minimal set of symbol interpretations to provide - // reasonable behavior for testing. The X Test - // Suite assumes that it can set any modifier by - // simulating a KeyPress and clear it by simulating - // a KeyRelease. Because of the way that XKB - // implements locking/latching modifiers, this - // approach fails in some cases (typically the - // lock or num lock modifiers). These symbol - // interpretations make all modifier keys just - // set the corresponding modifier so that xtest - // will see the behavior it expects. - - virtual_modifiers NumLock,AltGr; - - interpret.repeat= False; - setMods.clearLocks= True; - latchMods.clearLocks= True; - latchMods.latchToLock= False; - - interpret Shift_Lock+AnyOf(Shift+Lock) { - action= SetMods(modifiers=Shift); - }; - - interpret Num_Lock+Any { - virtualModifier= NumLock; - action= SetMods(modifiers=NumLock); - }; - - interpret Mode_switch { - useModMapMods= level1; - virtualModifier= AltGr; - action= SetGroup(group=2); - }; - - interpret Any + Any { - action= SetMods(modifiers=modMapMods); - }; - - group 2 = AltGr; - group 3 = AltGr; - group 4 = AltGr; - - indicator.allowExplicit= False; - indicator "Caps Lock" { - modifiers= Lock; - }; - indicator "Num Lock" { - modifiers= NumLock; - }; - indicator "Shift Lock" { - whichModState= Locked; - modifiers= Shift; - }; - indicator.allowExplicit= True; -}; +default xkb_compatibility "xtest" { + + // Minimal set of symbol interpretations to provide + // reasonable behavior for testing. The X Test + // Suite assumes that it can set any modifier by + // simulating a KeyPress and clear it by simulating + // a KeyRelease. Because of the way that XKB + // implements locking/latching modifiers, this + // approach fails in some cases (typically the + // lock or num lock modifiers). These symbol + // interpretations make all modifier keys just + // set the corresponding modifier so that xtest + // will see the behavior it expects. + + virtual_modifiers NumLock,AltGr; + + interpret.repeat= False; + setMods.clearLocks= True; + latchMods.clearLocks= True; + latchMods.latchToLock= False; + + interpret Shift_Lock+AnyOf(Shift+Lock) { + action= SetMods(modifiers=Shift); + }; + + interpret Num_Lock+Any { + virtualModifier= NumLock; + action= SetMods(modifiers=NumLock); + }; + + interpret Mode_switch { + useModMapMods= level1; + virtualModifier= AltGr; + action= SetGroup(group=2); + }; + + interpret Any + Any { + action= SetMods(modifiers=modMapMods); + }; + + group 2 = AltGr; + group 3 = AltGr; + group 4 = AltGr; + + indicator.allowExplicit= False; + indicator "Caps Lock" { + modifiers= Lock; + }; + indicator "Num Lock" { + modifiers= NumLock; + }; + indicator "Shift Lock" { + whichModState= Locked; + modifiers= Shift; + }; + indicator.allowExplicit= True; +}; diff --git a/xorg-server/xkeyboard-config/docs/README.enhancing b/xorg-server/xkeyboard-config/docs/README.enhancing index 024ea146e..88d6a4edf 100644 --- a/xorg-server/xkeyboard-config/docs/README.enhancing +++ b/xorg-server/xkeyboard-config/docs/README.enhancing @@ -1,525 +1,520 @@ - How to further enhance XKB configuration - - Kamil Toman, Ivan U. Pascal - - 25 November 2002 - - Abstract - - This guide is aimed to relieve one's labour to create a new (inter- - nationalized) keyboard layout. Unlike other documents this guide - accents the keymap developer's point of view. - -1. Overview - -The developer of a new layout should read the xkb protocol specification (The -X Keyboard Extension: Protocol Specification -) at least to clarify for -himself some xkb-specific terms used in this document and elsewhere in xkb -configuration. Also it shows wise to understand how the X server and a client -digest their keyboard inputs (with and without xkb). - -A useful source is also Ivan Pascal's text about xkb configuration - often referenced throughout this docu- -ment. - -Note that this document covers only enhancements which are to be made to -XFree86 version 4.3.x and above. - -2. The Basics - -At the startup (or at later at user's command) X server starts its xkb key- -board module extension and reads data from a compiled configuration file. - -This compiled configuration file is prepared by the program xkbcomp which -behaves altogether as an ordinary compiler (see man xkbcomp). Its input are -human readable xkb configuration files which are verified and then composed -into a useful xkb configuration. Users don't need to mess with xkbcomp them- -selves, for them it is invisible. Usually, it is started upon X server -startup. - -As you probably already know, the xkb configuration consists of five main -modules: - - Keycodes - Tables that defines translation from keyboard scan codes into - reasonable symbolic names, maximum, minimum legal keycodes, sym- - bolic aliases and description of physically present LED-indica- - tors. The primary sence of this component is to allow definitions - of maps of symbols (see below) to be independent of physical key- - board scancodes. There are two main naming conventions for sym- - bolic names (always four bytes long): - - o names which express some traditional meaning like - (stands for space bar) or - - o names which express some relative positioning on a key- - board, for example (an exclamation mark on US key- - boards), on the right there are keys , etc. - - Types - Types describe how the produced key is changed by active modi- - fiers (like Shift, Control, Alt, ...). There are several prede- - fined types which cover most of used combinations. - - Compat - Compatibility component defines internal behaviour of modifiers. - Using compat component you can assign various actions (elabo- - rately described in xkb specification) to key events. This is - also the place where LED-indicators behaviour is defined. - - Symbols - For i18n purposes, this is the most important table. It defines - what values (=symbols) are assigned to what keycodes (represented - by their symbolic name, see above). There may be defined more - than one value for each key and then it depends on a key type and - on modifiers state (respective compat component) which value will - be the resulting one. - - Geometry - Geometry files aren't used by xkb itself but they may be used by - some external programs to depict a keyboard image. - -All these components have the files located in xkb configuration tree in sub- -directories with the same names (usually in /usr/lib/X11/xkb). - -3. Enhancing XKB Configuration - -Most of xkb enhancements concerns a need to define new output symbols for the -some input key events. In other words, a need to define a new symbol map (for -a new language, standard or just to feel more comfortable when typing text). - -What do you need to do? Generally, you have to define following things: - - o the map of symbols itself - - o the rules to allow users to select the new mapping - - o the description of the new layout - -First of all, it is good to go through existing layouts and to examine them -if there is something you could easily adjust to fit your needs. Even if -there is nothing similar you may get some ideas about basic concepts and used -tricks. - -3.1 Levels And Groups - -Since XFree86 4.3.0 you can use multi-layout concept of xkb configuration. -Though it is still in boundaries of xkb protocol and general ideas, the -keymap designer must obey new rules when creating new maps. In exchange we -get a more powerful and cleaner configuration system. - -Remember that it is the application which must decide which symbol matches -which keycode according to effective modifier state. The X server itself -sends only an input event message to. Of course, usually the general inter- -pretation is processed by Xlib, Xaw, Motif, Qt, Gtk and similar libraries. -The X server only supplies its mapping table (usually upon an application -startup). - -You can think of the X server's symbol table as of a irregular table where -each keycode has its row and where each combination of modifiers determines -exactly one column. The resulting cell then gives the proper symbolic value. -Not all keycodes need to bind different values for different combination of -modifiers. key, for instance, usually doesn't depend on any modi- -fiers so it its row has only one column defined. - -Note that in XKB there is no prior assumption that certain modifiers are -bound to certain columns. By editing proper files (see keytypes (section 4.2, -page 1)) this mapping can be changed as well. - -Unlike the original X protocol the XKB approach is far more flexible. It is -comfortable to add one additional XKB term - group. You can think of a group -as of a vector of columns per each keycode (naturally the dimension of this -vector may differ for different keycodes). What is it good for? The group is -not very useful unless you intend to use more than one logically different -set of symbols (like more than one alphabet) defined in a single mapping ta- -ble. But then, the group has a natural meaning - each symbol set has its own -group and changing it means selecting a different one. XKB approach allows -up to four different groups. The columns inside each group are called (shift) -levels. The X server knows the current group and reports it together with -modifier set and with a keycode in key events. - -To sum it up: - - o for each keycode XKB keyboard map contains up to four one-dimensional - tables - groups (logically different symbol sets) - - o for each group of a keycode XKB keyboard map contains some columns - - shift levels (values reached by combinations of Shift, Ctrl, Alt, ... - modifiers) - - o different keycodes can have different number of groups - - o different groups of one keycode can have different number of shift lev- - els - - o the current group number is tracked by X server - -It is clear that if you sanely define levels, groups and sanely bind modi- -fiers and associated actions you can have simultaneously loaded up to four -different symbol sets where each of them would reside in its own group. - -The multi-layout concept provides a facility to manipulate xkb groups and -symbol definitions in a way that allows almost arbitrary composition of pre- -defined symbol tables. To keep it fully functional you have to: - - o define all symbols only in the first group - - o (re)define any modifiers with extra care to avoid strange (anisometric) - behaviour - -4. Defining New Layouts - -See Some Words About XKB internals for explanation of used xkb terms and problems -addressed by XKB extension. - -See Common notes about XKB configuration files language - for more precise -explanation of syntax of xkb configuration files. - -4.1 Predefined XKB Symbol Sets - -If you are about to define some European symbol map extension, you might want -to use on of four predefined latin alphabet layouts. - -Okay, let's assume you want extend an existing keymap and you want to over- -ride a few keys. Let's take a simple U.K. keyboard as an example (defined in -pc/gb): - - partial default alphanumeric_keys - xkb_symbols "basic" { - include "pc/latin" - - name[Group1]="Great Britain"; - - key { [ 2, quotedbl, twosuperior, oneeighth ] }; - key { [ 3, sterling, threesuperior, sterling ] }; - key { [apostrophe, at, dead_circumflex, dead_caron] }; - key { [ grave, notsign, bar, bar ] }; - key { [numbersign, asciitilde, dead_grave, dead_breve ] }; - key { type[Group1]="TWO_LEVEL", - [ ISO_Level3_Shift, Multi_key ] }; - - modifier_map Mod5 { }; - }; - -It defines a new layout in basic variant as an extension of common latin -alphabet layout. The layout (symbol set) name is set to "Great Britain". -Then there are redefinitions of a few keycodes and a modifiers binding. As -you can see the number of shift levels is the same for , , -, and keys but it differs from number of shift levels of -. - -Note that the key itself is a binding key for Mod5 and that it serves -like a shift modifier for LevelThree, together with Shift as a multi-key. It -is a good habit to respect this rule in a new similar layout. - -Okay, you could now define more variants of your new layout besides basic -simply by including (augmenting/overriding/...) the basic definition and -altering what may be needed. - -4.2 Key Types - -The differences in the number of columns (shift levels) are caused by a dif- -ferent types of keys (see the types definition in section basics). Most key- -codes have implicitly set the keytype in the included "pc/latin" file to -"FOUR_LEVEL_ALPHABETIC". The only exception is keycode which is -explicitly set "TWO_LEVEL" keytype. - -All those names refer to pre-defined shift level schemes. Usually you can -choose a suitable shift level scheme from default types scheme list in proper -xkb component's subdirectory. - -The most used schemes are: - - ONE_LEVEL - The key does not depend on any modifiers. The symbol from first - level is always chosen. - - TWO_LEVEL - The key uses a modifier Shift and may have two possible values. - The second level may be chosen by Shift modifier. If Lock modi- - fier (usually Caps-lock) applies the symbol is further processed - using system-specific capitalization rules. If both Shift+Lock - modifier apply the symbol from the second level is taken and cap- - italization rules are applied (and usually have no effect). - - ALPHABETIC - The key uses modifiers Shift and Lock. It may have two possible - values. The second level may be chosen by Shift modifier. When - Lock modifier applies, the symbol from the first level is taken - and further processed using system-specific capitalization rules. - If both Shift+Lock modifier apply the symbol from the first level - is taken and no capitalization rules applied. This is often - called shift-cancels-caps behaviour. - - THREE_LEVEL - Is the same as TWO_LEVEL but it considers an extra modifier - - LevelThree which can be used to gain the symbol value from the - third level. If both Shift+LevelThree modifiers apply the value - from the third level is also taken. As in TWO_LEVEL, the Lock - modifier doesn't influence the resulting level. Only Shift and - LevelThree are taken into that consideration. If the Lock modi- - fier is active capitalization rules are applied on the resulting - symbol. - - FOUR_LEVEL - Is the same as THREE_LEVEL but unlike LEVEL_THREE if both - Shift+LevelThree modifiers apply the symbol is taken from the - fourth level. - - FOUR_LEVEL_ALPHABETIC - Is similar to FOUR_LEVEL but also defines shift-cancels-caps - behaviour as in ALPHABETIC. If Lock+LevelThree apply the symbol - from the third level is taken and the capitalization rules are - applied. If Lock+Shift+LevelThree apply the symbol from the - third level is taken and no capitalization rules are applied. - - KEYPAD - As the name suggest this scheme is primarily used for numeric - keypads. The scheme considers two modifiers - Shift and NumLock. - If none of modifiers applies the symbol from the first level is - taken. If either Shift or NumLock modifiers apply the symbol from - the second level is taken. If both Shift+NumLock modifiers apply - the symbol from the first level is taken. Again, shift-cancels- - caps variant. - - FOUR_LEVEL_KEYPAD - Is similar to KEYPAD scheme but considers also LevelThree modi- - fier. If LevelThree modifier applies the symbol from the third - level is taken. If Shift+LevelThree or NumLock+LevelThree apply - the symbol from the fourth level is taken. If all Shift+Num- - Lock+LevelThree modifiers apply the symbol from the third level - is taken. This also, shift-cancels-caps variant. - - FOUR_LEVEL_MIXED_KEYPAD - A four-level keypad scheme where the first two levels are similar - to the KEYPAD scheme (NumLock+Shift) - LevelThree acts as an override providing access to two Shift-ed - levels. When LevelThree is active we totally ignore NumLock state - Intended for the digit area of the keypad - - FOUR_LEVEL_X - A four-level scheme where the base level accepts no modifier, - LevelThree provides two more Shift-ed levels like in the previous - scheme, and Ctrl+Alt controls the fourth level - Intended for the operator part of a keypad, though since NumLock - plays no part, it is not keypad-specific - -Besides that, there are several schemes for special purposes: - - PC_CONTROL_LEVEL2 - It is similar to TWO_LEVEL scheme but it considers the Control - modifier rather than Shift. That means, the symbol from the sec- - ond level is chosen by Control rather than by Shift. - - PC_ALT_LEVEL2 - It is similar to TWO_LEVEL scheme but it considers the Alt modi- - fier rather than Shift. That means, the symbol from the second - level is chosen by Alt rather than by Shift. - - CTRL+ALT - The key uses modifiers Alt and Control. It may have two possible - values. If only one modifier (Alt or Control) applies the symbol - from the first level is chosen. Only if both Alt+Control modi- - fiers apply the symbol from the second level is chosen. - - SHIFT+ALT - The key uses modifiers Shift and Alt. It may have two possible - values. If only one modifier (Alt or Shift) applies the symbol - from the first level is chosen. Only if both Alt+Shift modifiers - apply the symbol from the second level is chosen. - -If needed, special caps schemes may be used. They redefine the standard -behaviour of all *ALPHABETIC types. The layouts (maps of symbols) with keys -defined in respective types then automatically change their behaviour accord- -ingly. Possible redefinitions are: - - o internal - - o internal_nocancel - - o shift - - o shift_nocancel - -None of these schemes should be used directly. They are defined merely for -'caps:' xkb options (used to globally change the layouts behaviour). - -Don't alter any of existing key types. If you need a different behaviour cre- -ate a new one. - -4.2.1 More On Definitions Of Types - -When the XKB software deals with a separate type description it gets a com- -plete list of modifiers that should be taken into account from the 'modi- -fiers=' list and expects that a set of 'map[]=' instructions that contain the mapping for -each combination of modifiers mentioned in that list. Modifiers that are not -explicitly listed are NOT taken into account when the resulting shift level -is computed. If some combination is omitted the program (subroutine) should -choose the first level for this combination (a quite reasonable behavior). - -Lets consider an example with two modifiers ModOne and ModTwo: - - type "..." { - modifiers = ModOne+ModTwo; - map[None] = Level1; - map[ModOne] = Level2; - }; - -In this case the map statements for ModTwo only and ModOne+ModTwo are omit- -ted. It means that if the ModTwo is active the subroutine can't found -explicit mapping for such combination an will use the default level i.e. -Level1. - -But in the case the type described as: - - type "..." { - modifiers = ModOne; - map[None] = Level1; - map[ModOne] = Level2; - }; - -the ModTwo will not be taken into account and the resulting level depends on -the ModOne state only. That means, ModTwo alone produces the Level1 but the -combination ModOne+ModTwo produces the Level2 as well as ModOne alone. - -What does it mean if the second modifier is the Lock? It means that in the -first case (the Lock itself is included in the list of modifiers but combina- -tions with this modifier aren't mentioned in the map statements) the internal -capitalization rules will be applied to the symbol from the first level. But -in the second case the capitalization will be applied to the symbol chosen -accordingly to he first modifier - and this can be the symbol from the first -as well as from the second level. - -Usually, all modifiers introduced in 'modifiers=' list are -used for shift level calculation and then discarded. Sometimes this is not -desirable. If you want to use a modifier for shift level calculation but you -don't want to discard it, you may list in 'preserve[]='. That means, for a given combination all listed -modifiers will be preserved. If the Lock modifier is preserved then the -resulting symbol is passed to internal capitalization routine regardless -whether it has been used for a shift level calculation or not. - -Any key type description can use both real and virtual modifiers. Since real -modifiers always have standard names it is not necessary to explicitly -declare them. Virtual modifiers can have arbitrary names and can be declared -(prior using them) directly in key type definition: - - virtual_modifiers ; - -as seen in for example basic, pc or mousekeys key type definitions. - -4.3 Rules - -Once you are finished with your symbol map you need to add it to rules file. -The rules file describes how all the five basic keycodes, types, compat, sym- -bols and geometry components should be composed to give a sensible resulting -xkb configuration. - -The main advantage of rules over formerly used keymaps is a possibility to -simply parameterize (once) fixed patterns of configurations and thus to ele- -gantly allow substitutions of various local configurations into predefined -templates. - -A pattern in a rules file (often located in /usr/lib/X11/xkb/rules) can be -parameterized with four other arguments: Model, Layout, Variant and Options. -For most cases parameters model and layout should be sufficient for choosing -a functional keyboard mapping. - -The rules file itself is composed of pattern lines and lines with rules. The -pattern line starts with an exclamation mark ('!') and describes how will the -xkb interpret the following lines (rules). A sample rules file looks like -this: - - ! model = keycodes - macintosh_old = macintosh - ... - * = xfree86 - - ! model = symbols - hp = +inet(%m) - microsoftpro = +inet(%m) - geniuscomfy = +inet(%m) - - ! model layout[1] = symbols - macintosh us = macintosh/us%(v[1]) - * * = pc/pc(%m)+pc/%l[1]%(v[1]) - - ! model layout[2] = symbols - macintosh us = +macintosh/us[2]%(v[2]):2 - * * = +pc/%l[2]%(v[2]):2 - - ! option = types - caps:internal = +caps(internal) - caps:internal_nocancel = +caps(internal_nocancel) - -Each rule defines what certain combination of values on the left side of -equal sign ('=') results in. For example a (keyboard) model macintosh_old -instructs xkb to take definitions of keycodes from file keycodes/macintosh -while the rest of models (represented by a wild card '*') instructs it to -take them from file keycodes/xfree86. The wild card represents all possible -values on the left side which were not found in any of the previous rules. -The more specialized (more complete) rules have higher precedence than gen- -eral ones, i.e. the more general rules supply reasonable default values. - -As you can see some lines contain substitution parameters - the parameters -preceded by the percent sign ('%'). The first alphabetical character after -the percent sign expands to the value which has been found on the left side. -For example +%l%(v) expands into +cz(bksl) if the respective values on the -left side were cz layout in its bksl variant. More, if the layout resp. vari- -ant parameter is followed by a pair of brackets ('[', ']') it means that xkb -should place the layout resp. variant into specified xkb group. If the brack- -ets are omitted the first group is the default value. - -So the second block of rules enhances symbol definitions for some particular -keyboard models with extra keys (for internet, multimedia, ...) . Other mod- -els are left intact. Similarly, the last block overrides some key type defi- -nitions, so the common global behaviour ''shift cancels caps'' or ''shift -doesn't cancel caps'' can be selected. The rest of rules produces special -symbols for each variant us layout of macintosh keyboard and standard pc sym- -bols in appropriate variants as a default. - -4.4 Descriptive Files of Rules - -Now you just need to add a detailed description to .xml description -file so the other users (and external programs which often parse this file) -know what is your work about. - -4.4.1 Old Descriptive Files - -The formerly used descriptive files were named .lst Its structure is -very simple and quite self descriptive but such simplicity had also some cav- -ities, for example there was no way how to describe local variants of layouts -and there were problems with the localization of descriptions. To preserve -compatibility with some older programs, new XML descriptive files can be con- -verted to old format '.lst'. - -For each parameter of rules file should be described its meaning. For the -rules file described above the .lst file could look like: - - ! model - pc104 Generic 104-key PC - microsoft Microsoft Natural - pc98 PC-98xx Series - macintosh Original Macintosh - ... - - ! layout - us U.S. English - cz Czech - de German - ... - - ! option - caps:internal uses internal capitalization. Shift cancels Caps - caps:internal_nocancel uses internal capitalization. Shift doesn't cancel Caps - -And that should be it. Enjoy creating your own xkb mapping. - - Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/XKB-Enhancing.sgml,v 1.2 dawes Exp $ - - -$XFree86: xc/programs/xkbcomp/README.enhancing,v 1.5 2003/10/19 19:57:44 dawes Exp $ + How to further enhance XKB configuration + + Kamil Toman, Ivan U. Pascal + + 25 November 2002 + + Abstract + + This guide is aimed to relieve one's labour to create a new (inter- + nationalized) keyboard layout. Unlike other documents this guide + accents the keymap developer's point of view. + +1. Overview + +The developer of a new layout should read the xkb protocol specification (The +X Keyboard Extension: Protocol Specification +) at least to clarify for +himself some xkb-specific terms used in this document and elsewhere in xkb +configuration. Also it shows wise to understand how the X server and a client +digest their keyboard inputs (with and without xkb). + +A useful source is also Ivan Pascal's text about xkb configuration + often referenced throughout this docu- +ment. + +Note that this document covers only enhancements which are to be made to +XFree86 version 4.3.x and above. + +2. The Basics + +At the startup (or at later at user's command) X server starts its xkb key- +board module extension and reads data from a compiled configuration file. + +This compiled configuration file is prepared by the program xkbcomp which +behaves altogether as an ordinary compiler (see man xkbcomp). Its input are +human readable xkb configuration files which are verified and then composed +into a useful xkb configuration. Users don't need to mess with xkbcomp them- +selves, for them it is invisible. Usually, it is started upon X server +startup. + +As you probably already know, the xkb configuration consists of five main +modules: + + Keycodes + Tables that defines translation from keyboard scan codes into + reasonable symbolic names, maximum, minimum legal keycodes, sym- + bolic aliases and description of physically present LED-indica- + tors. The primary sence of this component is to allow definitions + of maps of symbols (see below) to be independent of physical key- + board scancodes. There are two main naming conventions for sym- + bolic names (always four bytes long): + + o names which express some traditional meaning like + (stands for space bar) or + + o names which express some relative positioning on a key- + board, for example (an exclamation mark on US key- + boards), on the right there are keys , etc. + + Types + Types describe how the produced key is changed by active modi- + fiers (like Shift, Control, Alt, ...). There are several prede- + fined types which cover most of used combinations. + + Compat + Compatibility component defines internal behaviour of modifiers. + Using compat component you can assign various actions (elabo- + rately described in xkb specification) to key events. This is + also the place where LED-indicators behaviour is defined. + + Symbols + For i18n purposes, this is the most important table. It defines + what values (=symbols) are assigned to what keycodes (represented + by their symbolic name, see above). There may be defined more + than one value for each key and then it depends on a key type and + on modifiers state (respective compat component) which value will + be the resulting one. + + Geometry + Geometry files aren't used by xkb itself but they may be used by + some external programs to depict a keyboard image. + +All these components have the files located in xkb configuration tree in sub- +directories with the same names (usually in /usr/lib/X11/xkb). + +3. Enhancing XKB Configuration + +Most of xkb enhancements concerns a need to define new output symbols for the +some input key events. In other words, a need to define a new symbol map (for +a new language, standard or just to feel more comfortable when typing text). + +What do you need to do? Generally, you have to define following things: + + o the map of symbols itself + + o the rules to allow users to select the new mapping + + o the description of the new layout + +First of all, it is good to go through existing layouts and to examine them +if there is something you could easily adjust to fit your needs. Even if +there is nothing similar you may get some ideas about basic concepts and used +tricks. + +3.1 Levels And Groups + +Since XFree86 4.3.0 you can use multi-layout concept of xkb configuration. +Though it is still in boundaries of xkb protocol and general ideas, the +keymap designer must obey new rules when creating new maps. In exchange we +get a more powerful and cleaner configuration system. + +Remember that it is the application which must decide which symbol matches +which keycode according to effective modifier state. The X server itself +sends only an input event message to. Of course, usually the general inter- +pretation is processed by Xlib, Xaw, Motif, Qt, Gtk and similar libraries. +The X server only supplies its mapping table (usually upon an application +startup). + +You can think of the X server's symbol table as of a irregular table where +each keycode has its row and where each combination of modifiers determines +exactly one column. The resulting cell then gives the proper symbolic value. +Not all keycodes need to bind different values for different combination of +modifiers. key, for instance, usually doesn't depend on any modi- +fiers so it its row has only one column defined. + +Note that in XKB there is no prior assumption that certain modifiers are +bound to certain columns. By editing proper files (see keytypes (section 4.2, +page 1)) this mapping can be changed as well. + +Unlike the original X protocol the XKB approach is far more flexible. It is +comfortable to add one additional XKB term - group. You can think of a group +as of a vector of columns per each keycode (naturally the dimension of this +vector may differ for different keycodes). What is it good for? The group is +not very useful unless you intend to use more than one logically different +set of symbols (like more than one alphabet) defined in a single mapping ta- +ble. But then, the group has a natural meaning - each symbol set has its own +group and changing it means selecting a different one. XKB approach allows +up to four different groups. The columns inside each group are called (shift) +levels. The X server knows the current group and reports it together with +modifier set and with a keycode in key events. + +To sum it up: + + o for each keycode XKB keyboard map contains up to four one-dimensional + tables - groups (logically different symbol sets) + + o for each group of a keycode XKB keyboard map contains some columns - + shift levels (values reached by combinations of Shift, Ctrl, Alt, ... + modifiers) + + o different keycodes can have different number of groups + + o different groups of one keycode can have different number of shift lev- + els + + o the current group number is tracked by X server + +It is clear that if you sanely define levels, groups and sanely bind modi- +fiers and associated actions you can have simultaneously loaded up to four +different symbol sets where each of them would reside in its own group. + +The multi-layout concept provides a facility to manipulate xkb groups and +symbol definitions in a way that allows almost arbitrary composition of pre- +defined symbol tables. To keep it fully functional you have to: + + o define all symbols only in the first group + + o (re)define any modifiers with extra care to avoid strange (anisometric) + behaviour + +4. Defining New Layouts + +See Some Words About XKB internals for explanation of used xkb terms and problems +addressed by XKB extension. + +See Common notes about XKB configuration files language + for more precise +explanation of syntax of xkb configuration files. + +4.1 Predefined XKB Symbol Sets + +If you are about to define some European symbol map extension, you might want +to use on of four predefined latin alphabet layouts. + +Okay, let's assume you want extend an existing keymap and you want to over- +ride a few keys. Let's take a simple U.K. keyboard as an example (defined in +pc/gb): + + partial default alphanumeric_keys + xkb_symbols "basic" { + include "pc/latin" + + name[Group1]="Great Britain"; + + key { [ 2, quotedbl, twosuperior, oneeighth ] }; + key { [ 3, sterling, threesuperior, sterling ] }; + key { [apostrophe, at, dead_circumflex, dead_caron] }; + key { [ grave, notsign, bar, bar ] }; + key { [numbersign, asciitilde, dead_grave, dead_breve ] }; + key { type[Group1]="TWO_LEVEL", + [ ISO_Level3_Shift, Multi_key ] }; + + modifier_map Mod5 { }; + }; + +It defines a new layout in basic variant as an extension of common latin +alphabet layout. The layout (symbol set) name is set to "Great Britain". +Then there are redefinitions of a few keycodes and a modifiers binding. As +you can see the number of shift levels is the same for , , +, and keys but it differs from number of shift levels of +. + +Note that the key itself is a binding key for Mod5 and that it serves +like a shift modifier for LevelThree, together with Shift as a multi-key. It +is a good habit to respect this rule in a new similar layout. + +Okay, you could now define more variants of your new layout besides basic +simply by including (augmenting/overriding/...) the basic definition and +altering what may be needed. + +4.2 Key Types + +The differences in the number of columns (shift levels) are caused by a dif- +ferent types of keys (see the types definition in section basics). Most key- +codes have implicitly set the keytype in the included "pc/latin" file to +"FOUR_LEVEL_ALPHABETIC". The only exception is keycode which is +explicitly set "TWO_LEVEL" keytype. + +All those names refer to pre-defined shift level schemes. Usually you can +choose a suitable shift level scheme from default types scheme list in proper +xkb component's subdirectory. + +The most used schemes are: + + ONE_LEVEL + The key does not depend on any modifiers. The symbol from first + level is always chosen. + + TWO_LEVEL + The key uses a modifier Shift and may have two possible values. + The second level may be chosen by Shift modifier. If Lock modi- + fier (usually Caps-lock) applies the symbol is further processed + using system-specific capitalization rules. If both Shift+Lock + modifier apply the symbol from the second level is taken and cap- + italization rules are applied (and usually have no effect). + + ALPHABETIC + The key uses modifiers Shift and Lock. It may have two possible + values. The second level may be chosen by Shift modifier. When + Lock modifier applies, the symbol from the first level is taken + and further processed using system-specific capitalization rules. + If both Shift+Lock modifier apply the symbol from the first level + is taken and no capitalization rules applied. This is often + called shift-cancels-caps behaviour. + + THREE_LEVEL + Is the same as TWO_LEVEL but it considers an extra modifier - + LevelThree which can be used to gain the symbol value from the + third level. If both Shift+LevelThree modifiers apply the value + from the third level is also taken. As in TWO_LEVEL, the Lock + modifier doesn't influence the resulting level. Only Shift and + LevelThree are taken into that consideration. If the Lock modi- + fier is active capitalization rules are applied on the resulting + symbol. + + FOUR_LEVEL + Is the same as THREE_LEVEL but unlike LEVEL_THREE if both + Shift+LevelThree modifiers apply the symbol is taken from the + fourth level. + + FOUR_LEVEL_ALPHABETIC + Is similar to FOUR_LEVEL but also defines shift-cancels-caps + behaviour as in ALPHABETIC. If Lock+LevelThree apply the symbol + from the third level is taken and the capitalization rules are + applied. If Lock+Shift+LevelThree apply the symbol from the + third level is taken and no capitalization rules are applied. + + KEYPAD + As the name suggest this scheme is primarily used for numeric + keypads. The scheme considers two modifiers - Shift and NumLock. + If none of modifiers applies the symbol from the first level is + taken. If either Shift or NumLock modifiers apply the symbol from + the second level is taken. If both Shift+NumLock modifiers apply + the symbol from the first level is taken. Again, shift-cancels- + caps variant. + + FOUR_LEVEL_KEYPAD + Is similar to KEYPAD scheme but considers also LevelThree modi- + fier. If LevelThree modifier applies the symbol from the third + level is taken. If Shift+LevelThree or NumLock+LevelThree apply + the symbol from the fourth level is taken. If all Shift+Num- + Lock+LevelThree modifiers apply the symbol from the third level + is taken. This also, shift-cancels-caps variant. + + FOUR_LEVEL_MIXED_KEYPAD + A four-level keypad scheme where the first two levels are similar + to the KEYPAD scheme (NumLock+Shift) + LevelThree acts as an override providing access to two Shift-ed + levels. When LevelThree is active we totally ignore NumLock state + Intended for the digit area of the keypad + + FOUR_LEVEL_X + A four-level scheme where the base level accepts no modifier, + LevelThree provides two more Shift-ed levels like in the previous + scheme, and Ctrl+Alt controls the fourth level + Intended for the operator part of a keypad, though since NumLock + plays no part, it is not keypad-specific + +Besides that, there are several schemes for special purposes: + + PC_CONTROL_LEVEL2 + It is similar to TWO_LEVEL scheme but it considers the Control + modifier rather than Shift. That means, the symbol from the sec- + ond level is chosen by Control rather than by Shift. + + PC_ALT_LEVEL2 + It is similar to TWO_LEVEL scheme but it considers the Alt modi- + fier rather than Shift. That means, the symbol from the second + level is chosen by Alt rather than by Shift. + + CTRL+ALT + The key uses modifiers Alt and Control. It may have two possible + values. If only one modifier (Alt or Control) applies the symbol + from the first level is chosen. Only if both Alt+Control modi- + fiers apply the symbol from the second level is chosen. + + SHIFT+ALT + The key uses modifiers Shift and Alt. It may have two possible + values. If only one modifier (Alt or Shift) applies the symbol + from the first level is chosen. Only if both Alt+Shift modifiers + apply the symbol from the second level is chosen. + +If needed, special caps schemes may be used. They redefine the standard +behaviour of all *ALPHABETIC types. The layouts (maps of symbols) with keys +defined in respective types then automatically change their behaviour accord- +ingly. Possible redefinitions are: + + o internal + + o internal_nocancel + + o shift + + o shift_nocancel + +None of these schemes should be used directly. They are defined merely for +'caps:' xkb options (used to globally change the layouts behaviour). + +Don't alter any of existing key types. If you need a different behaviour cre- +ate a new one. + +4.2.1 More On Definitions Of Types + +When the XKB software deals with a separate type description it gets a com- +plete list of modifiers that should be taken into account from the 'modi- +fiers=' list and expects that a set of 'map[]=' instructions that contain the mapping for +each combination of modifiers mentioned in that list. Modifiers that are not +explicitly listed are NOT taken into account when the resulting shift level +is computed. If some combination is omitted the program (subroutine) should +choose the first level for this combination (a quite reasonable behavior). + +Lets consider an example with two modifiers ModOne and ModTwo: + + type "..." { + modifiers = ModOne+ModTwo; + map[None] = Level1; + map[ModOne] = Level2; + }; + +In this case the map statements for ModTwo only and ModOne+ModTwo are omit- +ted. It means that if the ModTwo is active the subroutine can't found +explicit mapping for such combination an will use the default level i.e. +Level1. + +But in the case the type described as: + + type "..." { + modifiers = ModOne; + map[None] = Level1; + map[ModOne] = Level2; + }; + +the ModTwo will not be taken into account and the resulting level depends on +the ModOne state only. That means, ModTwo alone produces the Level1 but the +combination ModOne+ModTwo produces the Level2 as well as ModOne alone. + +What does it mean if the second modifier is the Lock? It means that in the +first case (the Lock itself is included in the list of modifiers but combina- +tions with this modifier aren't mentioned in the map statements) the internal +capitalization rules will be applied to the symbol from the first level. But +in the second case the capitalization will be applied to the symbol chosen +accordingly to he first modifier - and this can be the symbol from the first +as well as from the second level. + +Usually, all modifiers introduced in 'modifiers=' list are +used for shift level calculation and then discarded. Sometimes this is not +desirable. If you want to use a modifier for shift level calculation but you +don't want to discard it, you may list in 'preserve[]='. That means, for a given combination all listed +modifiers will be preserved. If the Lock modifier is preserved then the +resulting symbol is passed to internal capitalization routine regardless +whether it has been used for a shift level calculation or not. + +Any key type description can use both real and virtual modifiers. Since real +modifiers always have standard names it is not necessary to explicitly +declare them. Virtual modifiers can have arbitrary names and can be declared +(prior using them) directly in key type definition: + + virtual_modifiers ; + +as seen in for example basic, pc or mousekeys key type definitions. + +4.3 Rules + +Once you are finished with your symbol map you need to add it to rules file. +The rules file describes how all the five basic keycodes, types, compat, sym- +bols and geometry components should be composed to give a sensible resulting +xkb configuration. + +The main advantage of rules over formerly used keymaps is a possibility to +simply parameterize (once) fixed patterns of configurations and thus to ele- +gantly allow substitutions of various local configurations into predefined +templates. + +A pattern in a rules file (often located in /usr/lib/X11/xkb/rules) can be +parameterized with four other arguments: Model, Layout, Variant and Options. +For most cases parameters model and layout should be sufficient for choosing +a functional keyboard mapping. + +The rules file itself is composed of pattern lines and lines with rules. The +pattern line starts with an exclamation mark ('!') and describes how will the +xkb interpret the following lines (rules). A sample rules file looks like +this: + + ! model = keycodes + macintosh_old = macintosh + ... + * = xfree86 + + ! model = symbols + hp = +inet(%m) + microsoftpro = +inet(%m) + geniuscomfy = +inet(%m) + + ! model layout[1] = symbols + macintosh us = macintosh/us%(v[1]) + * * = pc/pc(%m)+pc/%l[1]%(v[1]) + + ! model layout[2] = symbols + macintosh us = +macintosh/us[2]%(v[2]):2 + * * = +pc/%l[2]%(v[2]):2 + + ! option = types + caps:internal = +caps(internal) + caps:internal_nocancel = +caps(internal_nocancel) + +Each rule defines what certain combination of values on the left side of +equal sign ('=') results in. For example a (keyboard) model macintosh_old +instructs xkb to take definitions of keycodes from file keycodes/macintosh +while the rest of models (represented by a wild card '*') instructs it to +take them from file keycodes/xfree86. The wild card represents all possible +values on the left side which were not found in any of the previous rules. +The more specialized (more complete) rules have higher precedence than gen- +eral ones, i.e. the more general rules supply reasonable default values. + +As you can see some lines contain substitution parameters - the parameters +preceded by the percent sign ('%'). The first alphabetical character after +the percent sign expands to the value which has been found on the left side. +For example +%l%(v) expands into +cz(bksl) if the respective values on the +left side were cz layout in its bksl variant. More, if the layout resp. vari- +ant parameter is followed by a pair of brackets ('[', ']') it means that xkb +should place the layout resp. variant into specified xkb group. If the brack- +ets are omitted the first group is the default value. + +So the second block of rules enhances symbol definitions for some particular +keyboard models with extra keys (for internet, multimedia, ...) . Other mod- +els are left intact. Similarly, the last block overrides some key type defi- +nitions, so the common global behaviour ''shift cancels caps'' or ''shift +doesn't cancel caps'' can be selected. The rest of rules produces special +symbols for each variant us layout of macintosh keyboard and standard pc sym- +bols in appropriate variants as a default. + +4.4 Descriptive Files of Rules + +Now you just need to add a detailed description to .xml description +file so the other users (and external programs which often parse this file) +know what is your work about. + +4.4.1 Old Descriptive Files + +The formerly used descriptive files were named .lst Its structure is +very simple and quite self descriptive but such simplicity had also some cav- +ities, for example there was no way how to describe local variants of layouts +and there were problems with the localization of descriptions. To preserve +compatibility with some older programs, new XML descriptive files can be con- +verted to old format '.lst'. + +For each parameter of rules file should be described its meaning. For the +rules file described above the .lst file could look like: + + ! model + pc104 Generic 104-key PC + microsoft Microsoft Natural + pc98 PC-98xx Series + macintosh Original Macintosh + ... + + ! layout + us U.S. English + cz Czech + de German + ... + + ! option + caps:internal uses internal capitalization. Shift cancels Caps + caps:internal_nocancel uses internal capitalization. Shift doesn't cancel Caps + +And that should be it. Enjoy creating your own xkb mapping. diff --git a/xorg-server/xkeyboard-config/geometry/amiga b/xorg-server/xkeyboard-config/geometry/amiga index 357c4c0e1..79793eabf 100644 --- a/xorg-server/xkeyboard-config/geometry/amiga +++ b/xorg-server/xkeyboard-config/geometry/amiga @@ -1,270 +1,264 @@ -// $Xorg: amiga,v 1.3 2000/08/17 19:54:35 cpqbld Exp $ - - - -// $XFree86: xc/programs/xkbcomp/geometry/amiga,v 3.2 1997/10/26 13:25:34 dawes Exp $ - -default xkb_geometry "usa1" { - - description= "Amiga (usa1)"; - width= 490; - height= 175; - - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; - shape "BKSP" { { [ 18,18] }, { [2,1], [ 16,17] } }; - shape "FCTS" { { [ 23,18] }, { [2,1], [ 21,17] } }; - shape "TLDE" { { [ 28,18] }, { [2,1], [ 21,17] } }; - shape "TABK" { { [ 37,18] }, { [2,1], [ 35,17] } }; - shape "CTRL" { { [ 23,18] }, { [2,1], [ 21,17] } }; - shape "CAPS" { { [ 18,18] }, { [2,1], [ 16,17] } }; - shape "RTRN" { - approx = { [ 16, 0], [42,37] }, - { [16, 0], [42, 0], [42,37], - [ 0,37], [ 0,19], [16,19] }, - { [18, 1], [40, 1], [40,36], - [ 2,36], [ 2,20], [18,20] } }; - shape "LFSH" { { [ 52,18] }, { [2,1], [ 50,17] } }; - shape "RTSH" { { [ 52,18] }, { [2,1], [ 50,17] } }; - shape "MODK" { { [ 23,18] }, { [2,1], [ 21,17] } }; - shape "SPCE" { { [172,18] }, { [2,1], [170,17] } }; - shape "DELE" { { [ 28,18] }, { [2,1], [ 26,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; - shape "KPEN" { { [ 18,37] }, { [2,1], [ 16,36] } }; - - section.left= 22; - row.left= 1; - key.shape= "FCTS"; - key.gap= 1; - section "Function" { - top= 28; - row { - top= 1; - keys { { , shape="NORM" }, - { , 9 }, , , , , - { , 9 }, , , , - }; - }; - }; // End of "Function" section - - key.shape= "NORM"; - section "Alpha" { - top= 56; - row { - top= 1; - keys { { , shape="TLDE" }, - , , , , , , - , , , , , , - , { , "BKSP" } - }; - }; - row { - top= 20; - keys { { , "TABK" }, - , , , , , - , , , , , - , , { , "RTRN", -15 } - }; - }; - row { - top= 39; - keys { { , "CTRL" }, { , "CAPS" }, - , , , , , - , , , , , - - }; - }; - row { - top= 58; - keys { { , "LFSH" }, - , , , , , - , , , , , - { , "RTSH" } - }; - }; - row { - top= 77; - key.shape= "MODK"; - keys { { , 10 }, , - { , "SPCE" }, - , - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 56; - left= 326; - row { - top= 1; - key.shape = "DELE"; - keys { , }; - }; - row { - top= 39; - left = 20; - keys { }; - }; - row { - top= 58; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 56; - left= 392; - row { - top= 1; - keys { , , , }; - }; - row { - top= 20; - keys { , , , }; - }; - row { - top= 39; - keys { , , , }; - }; - row { - top= 58; - keys { , , , { , "KPEN" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - -}; - -xkb_geometry "de" { - - description= "Amiga (de)"; - width= 490; - height= 175; - - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; - shape "BKSP" { { [ 18,18] }, { [2,1], [ 16,17] } }; - shape "FCTS" { { [ 23,18] }, { [2,1], [ 21,17] } }; - shape "TLDE" { { [ 28,18] }, { [2,1], [ 26,17] } }; - shape "TABK" { { [ 37,18] }, { [2,1], [ 35,17] } }; - shape "CTRL" { { [ 23,18] }, { [2,1], [ 21,17] } }; - shape "CAPS" { { [ 18,18] }, { [2,1], [ 16,17] } }; - shape "RTRN" { - { [ 0, 0], [28,0], [28,37], [5,37], [5,18], [ 0,18] }, - { [ 2, 1], [26,1], [26,36], [7,36], [7,17], [ 2,17] } }; - shape "LFSH" { { [ 32,18] }, { [2,1], [ 29,17] } }; - shape "RTSH" { { [ 52,18] }, { [2,1], [ 50,17] } }; - shape "MODK" { { [ 23,18] }, { [2,1], [ 21,17] } }; - shape "SPCE" { { [172,18] }, { [2,1], [170,17] } }; - shape "DELE" { { [ 28,18] }, { [2,1], [ 26,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; - shape "KPEN" { { [ 18,37] }, { [2,1], [ 16,36] } }; - - section.left= 22; - row.left= 1; - key.shape= "FCTS"; - key.gap= 1; - section "Function" { - top= 28; - row { - top= 1; - keys { { , shape="NORM" }, - { , 9 }, , , , , - { , 9 }, , , , - }; - }; - }; // End of "Function" section - - key.shape= "NORM"; - section "Alpha" { - top= 56; - row { - top= 1; - keys { { , shape="TLDE" }, - , , , , , , - , , , , , , - , { , "BKSP" } - }; - }; - row { - top= 20; - keys { { , "TABK" }, - , , , , , - , , , , , - , , { , "RTRN" } - }; - }; - row { - top= 39; - keys { { , "CTRL" }, { , "CAPS" }, - , , , , , - , , , , , - , - }; - }; - row { - top= 58; - keys { { , "LFSH" }, - , , , , , , - , , , , , - { , "RTSH" } - }; - }; - row { - top= 77; - key.shape= "MODK"; - keys { { , 14 }, , - { , "SPCE" }, - , - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 56; - left= 326; - row { - top= 1; - key.shape = "DELE"; - keys { , }; - }; - row { - top= 39; - left = 20; - keys { }; - }; - row { - top= 58; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 56; - left= 392; - row { - top= 1; - keys { , , , }; - }; - row { - top= 20; - keys { , , , }; - }; - row { - top= 39; - keys { , , , }; - }; - row { - top= 58; - keys { , , , { , "KPEN" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - -}; +default xkb_geometry "usa1" { + + description= "Amiga (usa1)"; + width= 490; + height= 175; + + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; + shape "BKSP" { { [ 18,18] }, { [2,1], [ 16,17] } }; + shape "FCTS" { { [ 23,18] }, { [2,1], [ 21,17] } }; + shape "TLDE" { { [ 28,18] }, { [2,1], [ 21,17] } }; + shape "TABK" { { [ 37,18] }, { [2,1], [ 35,17] } }; + shape "CTRL" { { [ 23,18] }, { [2,1], [ 21,17] } }; + shape "CAPS" { { [ 18,18] }, { [2,1], [ 16,17] } }; + shape "RTRN" { + approx = { [ 16, 0], [42,37] }, + { [16, 0], [42, 0], [42,37], + [ 0,37], [ 0,19], [16,19] }, + { [18, 1], [40, 1], [40,36], + [ 2,36], [ 2,20], [18,20] } }; + shape "LFSH" { { [ 52,18] }, { [2,1], [ 50,17] } }; + shape "RTSH" { { [ 52,18] }, { [2,1], [ 50,17] } }; + shape "MODK" { { [ 23,18] }, { [2,1], [ 21,17] } }; + shape "SPCE" { { [172,18] }, { [2,1], [170,17] } }; + shape "DELE" { { [ 28,18] }, { [2,1], [ 26,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; + shape "KPEN" { { [ 18,37] }, { [2,1], [ 16,36] } }; + + section.left= 22; + row.left= 1; + key.shape= "FCTS"; + key.gap= 1; + section "Function" { + top= 28; + row { + top= 1; + keys { { , shape="NORM" }, + { , 9 }, , , , , + { , 9 }, , , , + }; + }; + }; // End of "Function" section + + key.shape= "NORM"; + section "Alpha" { + top= 56; + row { + top= 1; + keys { { , shape="TLDE" }, + , , , , , , + , , , , , , + , { , "BKSP" } + }; + }; + row { + top= 20; + keys { { , "TABK" }, + , , , , , + , , , , , + , , { , "RTRN", -15 } + }; + }; + row { + top= 39; + keys { { , "CTRL" }, { , "CAPS" }, + , , , , , + , , , , , + + }; + }; + row { + top= 58; + keys { { , "LFSH" }, + , , , , , + , , , , , + { , "RTSH" } + }; + }; + row { + top= 77; + key.shape= "MODK"; + keys { { , 10 }, , + { , "SPCE" }, + , + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 56; + left= 326; + row { + top= 1; + key.shape = "DELE"; + keys { , }; + }; + row { + top= 39; + left = 20; + keys { }; + }; + row { + top= 58; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 56; + left= 392; + row { + top= 1; + keys { , , , }; + }; + row { + top= 20; + keys { , , , }; + }; + row { + top= 39; + keys { , , , }; + }; + row { + top= 58; + keys { , , , { , "KPEN" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + +}; + +xkb_geometry "de" { + + description= "Amiga (de)"; + width= 490; + height= 175; + + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; + shape "BKSP" { { [ 18,18] }, { [2,1], [ 16,17] } }; + shape "FCTS" { { [ 23,18] }, { [2,1], [ 21,17] } }; + shape "TLDE" { { [ 28,18] }, { [2,1], [ 26,17] } }; + shape "TABK" { { [ 37,18] }, { [2,1], [ 35,17] } }; + shape "CTRL" { { [ 23,18] }, { [2,1], [ 21,17] } }; + shape "CAPS" { { [ 18,18] }, { [2,1], [ 16,17] } }; + shape "RTRN" { + { [ 0, 0], [28,0], [28,37], [5,37], [5,18], [ 0,18] }, + { [ 2, 1], [26,1], [26,36], [7,36], [7,17], [ 2,17] } }; + shape "LFSH" { { [ 32,18] }, { [2,1], [ 29,17] } }; + shape "RTSH" { { [ 52,18] }, { [2,1], [ 50,17] } }; + shape "MODK" { { [ 23,18] }, { [2,1], [ 21,17] } }; + shape "SPCE" { { [172,18] }, { [2,1], [170,17] } }; + shape "DELE" { { [ 28,18] }, { [2,1], [ 26,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; + shape "KPEN" { { [ 18,37] }, { [2,1], [ 16,36] } }; + + section.left= 22; + row.left= 1; + key.shape= "FCTS"; + key.gap= 1; + section "Function" { + top= 28; + row { + top= 1; + keys { { , shape="NORM" }, + { , 9 }, , , , , + { , 9 }, , , , + }; + }; + }; // End of "Function" section + + key.shape= "NORM"; + section "Alpha" { + top= 56; + row { + top= 1; + keys { { , shape="TLDE" }, + , , , , , , + , , , , , , + , { , "BKSP" } + }; + }; + row { + top= 20; + keys { { , "TABK" }, + , , , , , + , , , , , + , , { , "RTRN" } + }; + }; + row { + top= 39; + keys { { , "CTRL" }, { , "CAPS" }, + , , , , , + , , , , , + , + }; + }; + row { + top= 58; + keys { { , "LFSH" }, + , , , , , , + , , , , , + { , "RTSH" } + }; + }; + row { + top= 77; + key.shape= "MODK"; + keys { { , 14 }, , + { , "SPCE" }, + , + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 56; + left= 326; + row { + top= 1; + key.shape = "DELE"; + keys { , }; + }; + row { + top= 39; + left = 20; + keys { }; + }; + row { + top= 58; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 56; + left= 392; + row { + top= 1; + keys { , , , }; + }; + row { + top= 20; + keys { , , , }; + }; + row { + top= 39; + keys { , , , }; + }; + row { + top= 58; + keys { , , , { , "KPEN" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + +}; diff --git a/xorg-server/xkeyboard-config/geometry/ataritt b/xorg-server/xkeyboard-config/geometry/ataritt index e53cd94c2..5b035131a 100644 --- a/xorg-server/xkeyboard-config/geometry/ataritt +++ b/xorg-server/xkeyboard-config/geometry/ataritt @@ -1,257 +1,251 @@ -// $Xorg: ataritt,v 1.3 2000/08/17 19:54:35 cpqbld Exp $ - - - -// $XFree86: xc/programs/xkbcomp/geometry/ataritt,v 3.2 1997/10/26 13:25:34 dawes Exp $ - -default xkb_geometry "us" { - - description= "Atari TT (us)"; - width= 480; - height= 173; - - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [ 35,17] } }; - shape "TABK" { { [ 28,18] }, { [2,1], [ 26,17] } }; - shape "RTRN" { approx = { [0,19], [32,37] }, - { [ 14, 0], [32, 0], [32,37], [0,37], [0,19], [14,19] }, - { [ 16, 1], [30, 1], [30,36], [2,36], [2,20], [16,20] } }; - shape "CTRL" { { [ 32,18] }, { [2,1], [ 30,17] } }; - shape "LFSH" { { [ 42,18] }, { [2,1], [ 40,17] } }; - shape "RTSH" { { [ 52,18] }, { [2,1], [ 50,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [ 26,17] } }; - shape "SPCE" { { [172,18] }, { [2,1], [170,17] } }; - shape "FCTS" { { [ 28,10] }, { [2,1], [ 26,9] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; - shape "KPEN" { { [ 18,37] }, { [2,1], [ 16,36] } }; - - section.left= 21; - row.left= 1; - key.shape = "NORM"; - key.gap= 1; - section "Function" { - top= 36; - key.shape= "FCTS"; - row { - top= 1; - keys { , , , , - , , , , - , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 63; - row { - top= 1; - keys { , , , , , - , , , , , - , , , , - { , "BKSP" } - }; - }; - row { - top= 20; - keys { { , "TABK" }, - , , , , , - , , , , , - , , { , "RTRN", -13 }, - }; - }; - row { - top= 39; - keys { { , "CTRL" }, - , , , , , - , , , , , - , { , 34 } - }; - }; - row { - top= 58; - keys { { , "LFSH" }, - , , , , , - , , , , , - { , "RTSH" } - }; - }; - row { - top= 77; - key.shape= "MODK"; - keys { { , 24 }, - { , "SPCE" }, - - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 63; - left= 319; - row { - top= 1; - key.shape = "BKSP"; - keys { , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - top= 39; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 63; - left= 381; - row { - top= 1; - keys { , , , }; - }; - row { - top= 20; - keys { , , , }; - }; - row { - top= 39; - keys { , , , }; - }; - row { - top= 58; - keys { , , , { , "KPEN" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - -}; - -xkb_geometry "de" { - - description= "Atari TT (de)"; - width= 480; - height= 173; - - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; - shape "BKSP" { { [ 27,18] }, { [2,1], [ 25,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [ 25,17] } }; - shape "RTRN" { approx = { [0,19], [32,37] }, - { [ 14, 0], [32, 0], [32,37], [0,37], [0,19], [14,19] }, - { [ 16, 1], [30, 1], [30,36], [2,36], [2,20], [16,20] } }; - shape "CTRL" { { [ 32,18] }, { [2,1], [ 30,17] } }; - shape "LFSH" { { [ 23,18] }, { [2,1], [ 21,17] } }; - shape "RTSH" { { [ 28,18] }, { [2,1], [ 26,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [ 26,17] } }; - shape "SPCE" { { [170,18] }, { [2,1], [168,17] } }; - shape "FCTS" { { [ 28,11] }, { [2,1], [ 26,10] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; - shape "KPEN" { { [ 18,37] }, { [2,1], [ 16,36] } }; - - section.left= 21; - row.left= 1; - key.shape = "NORM"; - key.gap= 1; - section "Function" { - top= 36; - key.shape= "FCTS"; - row { - top= 1; - keys { , , , , - , , , , - , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 63; - row { - top= 1; - keys { , , , , , - , , , , , - , , , , - { , "BKSP" } - }; - }; - row { - top= 20; - keys { { , "TABK" }, - , , , , , - , , , , , - , , { , "RTRN", -13 }, - }; - }; - row { - top= 39; - keys { { , "CTRL" }, - , , , , , - , , , , , - , { , 34 } - }; - }; - row { - top= 58; - keys { { , "LFSH" }, , - , , , , - , , , , , , - { , "RTSH" } - }; - }; - row { - top= 77; - key.shape= "MODK"; - keys { { , 24 }, { , "SPCE" }, - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 63; - left= 319; - row { - top= 1; - key.shape = "BKSP"; - keys { , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - top= 39; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 63; - left= 381; - row { - top= 1; - keys { , , , }; - }; - row { - top= 20; - keys { , , , }; - }; - row { - top= 39; - keys { , , , }; - }; - row { - top= 58; - keys { , , , { , "KPEN" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - -}; +default xkb_geometry "us" { + + description= "Atari TT (us)"; + width= 480; + height= 173; + + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [ 35,17] } }; + shape "TABK" { { [ 28,18] }, { [2,1], [ 26,17] } }; + shape "RTRN" { approx = { [0,19], [32,37] }, + { [ 14, 0], [32, 0], [32,37], [0,37], [0,19], [14,19] }, + { [ 16, 1], [30, 1], [30,36], [2,36], [2,20], [16,20] } }; + shape "CTRL" { { [ 32,18] }, { [2,1], [ 30,17] } }; + shape "LFSH" { { [ 42,18] }, { [2,1], [ 40,17] } }; + shape "RTSH" { { [ 52,18] }, { [2,1], [ 50,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [ 26,17] } }; + shape "SPCE" { { [172,18] }, { [2,1], [170,17] } }; + shape "FCTS" { { [ 28,10] }, { [2,1], [ 26,9] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; + shape "KPEN" { { [ 18,37] }, { [2,1], [ 16,36] } }; + + section.left= 21; + row.left= 1; + key.shape = "NORM"; + key.gap= 1; + section "Function" { + top= 36; + key.shape= "FCTS"; + row { + top= 1; + keys { , , , , + , , , , + , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 63; + row { + top= 1; + keys { , , , , , + , , , , , + , , , , + { , "BKSP" } + }; + }; + row { + top= 20; + keys { { , "TABK" }, + , , , , , + , , , , , + , , { , "RTRN", -13 }, + }; + }; + row { + top= 39; + keys { { , "CTRL" }, + , , , , , + , , , , , + , { , 34 } + }; + }; + row { + top= 58; + keys { { , "LFSH" }, + , , , , , + , , , , , + { , "RTSH" } + }; + }; + row { + top= 77; + key.shape= "MODK"; + keys { { , 24 }, + { , "SPCE" }, + + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 63; + left= 319; + row { + top= 1; + key.shape = "BKSP"; + keys { , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + top= 39; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 63; + left= 381; + row { + top= 1; + keys { , , , }; + }; + row { + top= 20; + keys { , , , }; + }; + row { + top= 39; + keys { , , , }; + }; + row { + top= 58; + keys { , , , { , "KPEN" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + +}; + +xkb_geometry "de" { + + description= "Atari TT (de)"; + width= 480; + height= 173; + + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; + shape "BKSP" { { [ 27,18] }, { [2,1], [ 25,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [ 25,17] } }; + shape "RTRN" { approx = { [0,19], [32,37] }, + { [ 14, 0], [32, 0], [32,37], [0,37], [0,19], [14,19] }, + { [ 16, 1], [30, 1], [30,36], [2,36], [2,20], [16,20] } }; + shape "CTRL" { { [ 32,18] }, { [2,1], [ 30,17] } }; + shape "LFSH" { { [ 23,18] }, { [2,1], [ 21,17] } }; + shape "RTSH" { { [ 28,18] }, { [2,1], [ 26,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [ 26,17] } }; + shape "SPCE" { { [170,18] }, { [2,1], [168,17] } }; + shape "FCTS" { { [ 28,11] }, { [2,1], [ 26,10] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; + shape "KPEN" { { [ 18,37] }, { [2,1], [ 16,36] } }; + + section.left= 21; + row.left= 1; + key.shape = "NORM"; + key.gap= 1; + section "Function" { + top= 36; + key.shape= "FCTS"; + row { + top= 1; + keys { , , , , + , , , , + , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 63; + row { + top= 1; + keys { , , , , , + , , , , , + , , , , + { , "BKSP" } + }; + }; + row { + top= 20; + keys { { , "TABK" }, + , , , , , + , , , , , + , , { , "RTRN", -13 }, + }; + }; + row { + top= 39; + keys { { , "CTRL" }, + , , , , , + , , , , , + , { , 34 } + }; + }; + row { + top= 58; + keys { { , "LFSH" }, , + , , , , + , , , , , , + { , "RTSH" } + }; + }; + row { + top= 77; + key.shape= "MODK"; + keys { { , 24 }, { , "SPCE" }, + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 63; + left= 319; + row { + top= 1; + key.shape = "BKSP"; + keys { , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + top= 39; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 63; + left= 381; + row { + top= 1; + keys { , , , }; + }; + row { + top= 20; + keys { , , , }; + }; + row { + top= 39; + keys { , , , }; + }; + row { + top= 58; + keys { , , , { , "KPEN" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + +}; diff --git a/xorg-server/xkeyboard-config/geometry/chicony b/xorg-server/xkeyboard-config/geometry/chicony index 9bdd15b00..d43fb1b4a 100644 --- a/xorg-server/xkeyboard-config/geometry/chicony +++ b/xorg-server/xkeyboard-config/geometry/chicony @@ -1,190 +1,189 @@ -// -*- indent-tabs-mode: nil -*- -// $XFree86: xc/programs/xkbcomp/geometry/chicony,v 1.1 2003/05/29 12:41:57 pascal Exp $ - -// Created by Alexander Pohoyda -// Geometry specification for Chicony KB-9820 keyboard. - -// 86 keys -default xkb_geometry "us" { - description = "Chicony KB-9820 infra-red keyboard"; - width = 350; - height = 180; - //baseColor = "grey60"; - labelColor = "white"; - - shape "EDGE" { cornerRadius = 25, - { [0, 8], [142.5, 0], [202.5, 0], [347, 8], - [347, 60], [327, 100], [322, 160], - [202.5, 165], [142.5, 165], - [25, 160], [20, 100], [0, 60] } }; - shape "KEYS" { cornerRadius = 2, { [271, 109] } }; - shape "MOUS" { cornerRadius = 12, { [24, 24] } }; - shape "MOUS2" { cornerRadius = 9, { [18, 18] } }; - shape "BTNS" { cornerRadius = 5, { [10, 10] } }; - - solid "Edges" { - top = 0; - left = 0; - shape = "EDGE"; - color = "grey60"; - }; - - solid "KeyPanel" { - shape = "KEYS"; - left = 38; - top = 22; - color = "black"; - }; - - solid "Mouse" { - shape = "MOUS"; - left = 315; - top = 30; - color = "grey30"; - }; - - outline "Mouse2" { - shape = "MOUS2"; - left = 318; - top = 33; - color = "black"; - }; - - solid "Button1" { - shape = "BTNS"; - left = 10; - top = 32; - color = "grey30"; - }; - - solid "Button2" { - shape = "BTNS"; - left = 20; - top = 42; - color = "grey30"; - }; - - outline "Buttons" { - shape = "MOUS"; - left = 8; - top = 30; - color = "black"; - }; - - shape.cornerRadius = 1; - shape "ESC" { { [17, 12] }, { [1.5, 0], [15.5, 10] } }; - shape "SMALL" { { [15, 12] }, { [1.5, 0], [13.5, 10] } }; - shape "THIN" { { [14, 18] }, { [2, 0], [12, 15] } }; - shape "NARR" { { [16, 18] }, { [2, 0], [14, 15] } }; - shape "NORM" { { [17, 18] }, { [2, 0], [15, 15] } }; - shape "WIDER" { { [18, 18] }, { [2, 0], [16, 15] } }; - shape "CAPS" { { [22, 18] }, { [2, 0], [20, 15] } }; - shape "RTSH" { { [23, 18] }, { [2, 0], [21, 15] } }; - shape "WIDEST" { { [30, 18] }, { [2, 0], [28, 15] } }; - shape "SPCE" { { [68, 18] }, { [2, 0], [66, 15] } }; - - section "Function" { - key.shape = "SMALL"; - key.gap = 0.79; - key.color = "grey60"; - left = 38; - top = 22; - row { - top = 1; - keys { { , shape="ESC", 1 }, - { , 1.5 }, , , , - , , , , - , , , , - , , , - }; - }; - }; // End of "Function" section - - section "Control" { - key.shape = "NORM"; - key.gap = 1; - key.color = "grey60"; - left = 38; - top = 111; - row { - top = 1; - keys { , , , , - { , shape="SPCE" }, - , - { , shape="THIN" }, - { , shape="THIN" }, - { , shape="THIN" }, - { , shape="THIN" } }; - }; - }; // End of "Control" section - - section "Editing" { - key.shape = "NORM"; - key.gap = 1; - key.color = "grey60"; - left = 291; - top = 34; - row.vertical = True; - row { - top = 1; - keys { , , , }; - }; - }; // End of "Editing" section - - section "Navigation" { - key.gap = 1; - key.shape = "NARR"; - key.color = "grey60"; - left = 257; - top = 92; - row { - left = 16; - top = 1; - keys { }; - }; - row { - top = 20; - keys { , , }; - }; - }; // End of "Navigation" section - - section "Alpha" { - key.gap = 1; - key.shape = "NORM"; - key.color = "grey60"; - left = 38; - top = 35; - row { - top = 1; - keys { { , shape="NARR" }, - , , , , - , , , , , - , , , { , shape="WIDER" } - }; - }; - row { - top = 20; - keys { , - , , , , , - , , , , , - , , - }; - }; - row { - top = 39; - keys { { , shape="CAPS" }, - , , , , , - , , , , , - , { , shape="WIDEST" } - }; - }; - row { - top = 58; - keys { { , shape="WIDEST" }, - , , , , , - , , , , , - { , shape="RTSH" } - }; - }; - }; // End of "Alpha" section -}; +// -*- indent-tabs-mode: nil -*- + +// Created by Alexander Pohoyda +// Geometry specification for Chicony KB-9820 keyboard. + +// 86 keys +default xkb_geometry "us" { + description = "Chicony KB-9820 infra-red keyboard"; + width = 350; + height = 180; + //baseColor = "grey60"; + labelColor = "white"; + + shape "EDGE" { cornerRadius = 25, + { [0, 8], [142.5, 0], [202.5, 0], [347, 8], + [347, 60], [327, 100], [322, 160], + [202.5, 165], [142.5, 165], + [25, 160], [20, 100], [0, 60] } }; + shape "KEYS" { cornerRadius = 2, { [271, 109] } }; + shape "MOUS" { cornerRadius = 12, { [24, 24] } }; + shape "MOUS2" { cornerRadius = 9, { [18, 18] } }; + shape "BTNS" { cornerRadius = 5, { [10, 10] } }; + + solid "Edges" { + top = 0; + left = 0; + shape = "EDGE"; + color = "grey60"; + }; + + solid "KeyPanel" { + shape = "KEYS"; + left = 38; + top = 22; + color = "black"; + }; + + solid "Mouse" { + shape = "MOUS"; + left = 315; + top = 30; + color = "grey30"; + }; + + outline "Mouse2" { + shape = "MOUS2"; + left = 318; + top = 33; + color = "black"; + }; + + solid "Button1" { + shape = "BTNS"; + left = 10; + top = 32; + color = "grey30"; + }; + + solid "Button2" { + shape = "BTNS"; + left = 20; + top = 42; + color = "grey30"; + }; + + outline "Buttons" { + shape = "MOUS"; + left = 8; + top = 30; + color = "black"; + }; + + shape.cornerRadius = 1; + shape "ESC" { { [17, 12] }, { [1.5, 0], [15.5, 10] } }; + shape "SMALL" { { [15, 12] }, { [1.5, 0], [13.5, 10] } }; + shape "THIN" { { [14, 18] }, { [2, 0], [12, 15] } }; + shape "NARR" { { [16, 18] }, { [2, 0], [14, 15] } }; + shape "NORM" { { [17, 18] }, { [2, 0], [15, 15] } }; + shape "WIDER" { { [18, 18] }, { [2, 0], [16, 15] } }; + shape "CAPS" { { [22, 18] }, { [2, 0], [20, 15] } }; + shape "RTSH" { { [23, 18] }, { [2, 0], [21, 15] } }; + shape "WIDEST" { { [30, 18] }, { [2, 0], [28, 15] } }; + shape "SPCE" { { [68, 18] }, { [2, 0], [66, 15] } }; + + section "Function" { + key.shape = "SMALL"; + key.gap = 0.79; + key.color = "grey60"; + left = 38; + top = 22; + row { + top = 1; + keys { { , shape="ESC", 1 }, + { , 1.5 }, , , , + , , , , + , , , , + , , , + }; + }; + }; // End of "Function" section + + section "Control" { + key.shape = "NORM"; + key.gap = 1; + key.color = "grey60"; + left = 38; + top = 111; + row { + top = 1; + keys { , , , , + { , shape="SPCE" }, + , + { , shape="THIN" }, + { , shape="THIN" }, + { , shape="THIN" }, + { , shape="THIN" } }; + }; + }; // End of "Control" section + + section "Editing" { + key.shape = "NORM"; + key.gap = 1; + key.color = "grey60"; + left = 291; + top = 34; + row.vertical = True; + row { + top = 1; + keys { , , , }; + }; + }; // End of "Editing" section + + section "Navigation" { + key.gap = 1; + key.shape = "NARR"; + key.color = "grey60"; + left = 257; + top = 92; + row { + left = 16; + top = 1; + keys { }; + }; + row { + top = 20; + keys { , , }; + }; + }; // End of "Navigation" section + + section "Alpha" { + key.gap = 1; + key.shape = "NORM"; + key.color = "grey60"; + left = 38; + top = 35; + row { + top = 1; + keys { { , shape="NARR" }, + , , , , + , , , , , + , , , { , shape="WIDER" } + }; + }; + row { + top = 20; + keys { , + , , , , , + , , , , , + , , + }; + }; + row { + top = 39; + keys { { , shape="CAPS" }, + , , , , , + , , , , , + , { , shape="WIDEST" } + }; + }; + row { + top = 58; + keys { { , shape="WIDEST" }, + , , , , , + , , , , , + { , shape="RTSH" } + }; + }; + }; // End of "Alpha" section +}; diff --git a/xorg-server/xkeyboard-config/geometry/dell b/xorg-server/xkeyboard-config/geometry/dell index 064f8e6e5..4fd6479f7 100644 --- a/xorg-server/xkeyboard-config/geometry/dell +++ b/xorg-server/xkeyboard-config/geometry/dell @@ -1,645 +1,644 @@ -// $Xorg: dell,v 1.4 2001/02/09 02:05:49 xorgcvs Exp $ -// -//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. -// -default xkb_geometry "dell101" { - - description= "Dell 101"; - width= 470; - height= 210; - - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [ 16,16] } }; - shape "BKSP" { { [ 38,18] }, { [2,1], [ 36,16] } }; - shape "TABK" { { [ 28,18] }, { [2,1], [ 26,16] } }; - shape "BKSL" { { [ 28,18] }, { [2,1], [ 26,16] } }; - shape "RTRN" { { [ 42,18] }, { [2,1], [ 40,16] } }; - shape "CAPS" { { [ 33,18] }, { [ 28,18] }, { [2,1], [ 26,16] } }; - shape "LFSH" { { [ 42,18] }, { [2,1], [ 40,16] } }; - shape "RTSH" { { [ 52,18] }, { [2,1], [ 50,16] } }; - shape "MODK" { { [ 27,18] }, { [2,1], [ 25,16] } }; - shape "SPCE" { { [133,18] }, { [2,1], [131,16] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [ 35,16] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [ 16,35] } }; - - shape "LEDS" { cornerRadius= 0, { [ 75 ,20 ] } }; - shape "LED" { cornerRadius= 0, { [ 5, 1 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 52; - left= 377; - color= "grey10"; - }; - - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 67; - indicator.shape= "LED"; - indicator "Num Lock" { left= 382; }; - indicator "Caps Lock" { left= 407; }; - indicator "Scroll Lock" { left= 433; }; - text.top= 55; - text.color= "black"; - text "NumLockLabel" { left= 378; text="Num\nLock"; }; - text "CapsLockLabel" { left= 403; text="Caps\nLock"; }; - text "ScrollLockLabel" { left= 428; text="Scroll\nLock"; }; - - section.left= 19; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 52; - row { - top= 1; - keys { { , color="grey20" }, - { , 20 }, , , , - { , 11 }, , , , - { , 11 }, , , , - { , 8 }, , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 91; - row { - top= 1; - keys { , , , , , - , , , , , - , , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { { , "TABK", color="grey20" }, - , , , , , - , , , , , - , , { , "BKSL" } - }; - }; - row { - top= 39; - keys { { , "CAPS", color="grey20" }, - , , , , , - , , , , , - , { , "RTRN", color="grey20" } - }; - }; - row { - top= 58; - keys { { , "LFSH", color="grey20" }, - , , , , , - , , , , , - { , "RTSH", color="grey20" } - }; - }; - row { - top= 77; - key.shape= "MODK"; - key.color= "grey20"; - keys { , { , 21 }, - { , "SPCE", color="white" }, - , { , 21 } - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 91; - left= 312; - key.color= "grey20"; - row { - top= 1; - keys { , , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - top= 58; - left= 20; - keys { }; - }; - row { - top= 77; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 91; - left= 376; - row { - top= 1; - key.color= "grey20"; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - - alias = ; - alias = ; - -}; // End of "default" geometry - - -xkb_geometry "dell65" { -}; - -xkb_geometry "dell65x" { - - description= "Dell 101"; - width= 470; - height= 210; - color="grey10"; - - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [ 16,16] } }; - shape "BKSP" { { [ 38,18] }, { [2,1], [ 36,16] } }; - shape "TABK" { { [ 28,18] }, { [2,1], [ 26,16] } }; - shape "BKSL" { { [ 28,18] }, { [2,1], [ 26,16] } }; - shape "RTRN" { { [ 42,18] }, { [2,1], [ 40,16] } }; - shape "CAPS" { { [ 33,18] }, { [ 28,18] }, { [2,1], [ 26,16] } }; - shape "LFSH" { { [ 42,18] }, { [2,1], [ 40,16] } }; - shape "RTSH" { { [ 52,18] }, { [2,1], [ 50,16] } }; - shape "MODK" { { [ 27,18] }, { [2,1], [ 25,16] } }; - shape "SPCE" { { [133,18] }, { [2,1], [131,16] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [ 35,16] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [ 16,35] } }; - - shape "LEDS" { cornerRadius= 0, { [ 75 ,20 ] } }; - shape "LED" { cornerRadius= 0, { [ 5, 1 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 52; - left= 377; - color= "grey10"; - }; - - shape "BACKGROUND" { cornerRadius=5, { [ 470, 210 ] } }; - solid "Background" { - shape= "BACKGROUND"; - top= 0; - left= 0; - color= "grey10"; - }; - - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 67; - indicator.shape= "LED"; - indicator "Num Lock" { left= 382; }; - indicator "Caps Lock" { left= 407; }; - indicator "Scroll Lock" { left= 433; }; - text.top= 55; - text.color= "black"; - text "NumLockLabel" { left= 378; text="Num\nLock"; }; - text "CapsLockLabel" { left= 403; text="Caps\nLock"; }; - text "ScrollLockLabel" { left= 428; text="Scroll\nLock"; }; - - section.left= 19; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 52; - row { - top= 1; - keys { { , color="grey20" }, - { , 20 }, , , , - { , 11 }, , , , - { , 11 }, , , , - { , 8 }, , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 91; - row { - top= 1; - keys { , , , , , - , , , , , - , , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { { , "TABK", color="grey20" }, - , , , , , - , , , , , - , , { , "BKSL" } - }; - }; - row { - top= 39; - keys { { , "CAPS", color="grey20" }, - , , , , , - , , , , , - , { , "RTRN", color="grey20" } - }; - }; - row { - top= 58; - keys { { , "LFSH", color="grey20" }, - , , , , , - , , , , , - { , "RTSH", color="grey20" } - }; - }; - row { - top= 77; - key.shape= "MODK"; - key.color= "grey20"; - keys { , { , 21 }, - { , "SPCE", color="white" }, - , { , 21 } - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 91; - left= 312; - key.color= "grey20"; - row { - top= 1; - keys { , , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - top= 58; - left= 20; - keys { }; - }; - row { - top= 77; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 91; - left= 376; - row { - top= 1; - key.color= "grey20"; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - - alias = ; - alias = ; - -}; - - -// -// Dell Precision M65 -// - -xkb_geometry "dellm65" { - - description= "Dell Precision M65"; - width= 308; - height= 152; - baseColor = "grey20"; - labelColor = "white"; - - shape "BACKGROUND" { cornerRadius = 3, { [ 308, 152 ] } }; - shape "BACKGROUND2" { cornerRadius = 2, { [ 7, 22 ], - [ 171, 22 ], - [ 171, 10 ], - [ 301, 10 ], - [ 301, 148 ], - [ 244, 148 ], - [ 244, 132 ], - [ 7, 132] } }; - solid "Background" { - shape = "BACKGROUND"; - top = 0; - left = 0; - color = "grey20"; - }; - solid "Background2" { - shape = "BACKGROUND2"; - top = 0; - left = 0; - color = "black"; - }; - - shape "LEDS" { cornerRadius = 4, { [ 26, 8 ] } }; - shape "LED" { cornerRadius = 0, { [ 4, 4 ] } }; - solid "LedPanel" { - shape = "LEDS"; - top = 8; - left = 69; - color = "grey20"; - }; - - indicator.onColor= "green"; - indicator.offColor= "gray20"; - indicator.top= 10; - indicator.shape= "LED"; - indicator "Num Lock" { left= 72; }; - indicator "Caps Lock" { left= 80; }; - indicator "Scroll Lock" { left= 88; }; - - shape "MEDIA" { cornerRadius = 5, { [ 2, 2], [ 12, 12 ] } }; - shape "POWER" { cornerRadius = 7, { [ 14, 14 ] } }; - - section "Media" { - top = 5; - left = 102; - width = 60; - height = 14; - key.color="grey30"; - key.shape = "MEDIA"; - row { - top = 0; - keys { - , , , { , shape = "POWER", gap = 3 } - }; - }; - }; - - - shape "FKEY" { cornerRadius = 1, { [ 18, 12 ] }, { [ 1, 1 ], [ 17, 10 ] } }; - - section "Function" { - top = 12; - left = 8; - width = 290; - height = 24; - key.color = "grey80"; - key.shape = "FKEY"; - key.gap = 0; - row { - top = 0; - keys { { , 165 }, , , , - { , 1 }, , }; - }; - row { - top = 12; - keys { , { , 1 }, , , , - { , 1 }, , , , - { , 1 }, , , , - { , 1 }, , }; - }; - }; - - shape "AKEY" { cornerRadius = 1, { [ 19, 19 ] }, { [ 2, 1 ], [ 17, 15 ] } }; - shape "BKSP" { cornerRadius = 1, { [ 44, 19 ] }, { [ 2, 1 ], [ 42, 15 ] } }; - shape "TABK" { cornerRadius = 1, { [ 31, 19 ] }, { [ 2, 1 ], [ 29, 15 ] } }; - shape "BKSL" { cornerRadius = 1, { [ 31, 19 ] }, { [ 2, 1 ], [ 29, 15 ] } }; - shape "CAPS" { cornerRadius = 1, { [ 34, 19 ] }, { [ 2, 1 ], [ 32, 15 ] } }; - shape "RTRN" { cornerRadius = 1, { [ 47, 19 ] }, { [ 2, 1 ], [ 45, 15 ] } }; - shape "LFSH" { cornerRadius = 1, { [ 44, 19 ] }, { [ 2, 1 ], [ 42, 15 ] } }; - shape "RTSH" { cornerRadius = 1, { [ 56, 19 ] }, { [ 2, 1 ], [ 54, 15 ] } }; - shape "LCTL" { cornerRadius = 1, { [ 31, 19 ] }, { [ 2, 1 ], [ 29, 15 ] } }; - shape "LALT" { cornerRadius = 1, { [ 25, 19 ] }, { [ 2, 1 ], [ 23, 15 ] } }; - shape "RCTL" { cornerRadius = 1, { [ 25, 19 ] }, { [ 2, 1 ], [ 23, 15 ] } }; - shape "SPCE" { cornerRadius = 1, { [ 96, 19 ] }, { [ 2, 1 ], [ 94, 15 ] } }; - - - section "Alpha" { - top = 36; - left = 8; - width = 290; - height = 21; - key.color = "grey80"; - key.shape = "AKEY"; - key.gap = 0; - row { - top = 1; - keys { , , , , , - , , , , , - , , , { , 1, "BKSP" } }; - }; - row { - top = 20; - keys { { , "TABK" }, - { , 1 }, , , , , - , , , , , - , , { , 1, "BKSL" } }; - }; - row { - top = 39; - keys { { , "CAPS" }, - { , 1 }, , , , , - , , , , , - , { , 1, "RTRN" } }; - }; - row { - top = 58; - keys { { , "LFSH" }, - { , 1 }, , , , , - , , , , , - { , 1, "RTSH" } }; - }; - row { - top = 77; - keys { { , "LCTL" }, { , 20 }, { , "LALT" }, - { , "SPCE" }, , { , "RCTL" } }; - }; - }; - - shape "SKEY" { cornerRadius = 1, { [ 18, 17 ] }, { [ 2, 1 ], [ 16, 13 ] } }; - section "Arrows" { - top = 113; - left = 243; - width = 54; - height = 36; - - key.color = "grey80"; - key.shape = "SKEY"; - row { - top = 0; - left = 20; - - keys { }; - }; - - row { - top = 17; - left = 2; - - keys { , , }; - }; - }; - - shape "STIK" { cornerRadius = 4, { [ 7, 7 ] } }; - - solid "STIK" { - priority = 255; - color = "blue"; - shape = "STIK"; - top = 90; - left = 135; - }; -}; - -xkb_geometry "latitude" { - description="Dell Latitude"; - width=304.2; height=219.1; - - baseColor="grey"; labelColor="white"; - - alias =; - alias =; - - shape "EXTERNAL" {corner=3, - {[0,0], [302,0], [302,154], [174,154], [174,198], [166,216], [107,216], [100,198], [100,154], [0,154]}}; - solid "external" {shape="EXTERNAL"; top=1.1; left=1.1; color="grey10"; priority=10;}; - - shape "INTERNAL" {corner=3, - {[0,13], [162.2,13], [162.2,0], [286,0], [286,138], [230,138], [230,124], [163,124], [163,138], [96,138], [96,124], [0,124]}}; - solid "internal" {shape="INTERNAL"; top=7; left=8.5; color="black"; priority=20;}; - - shape "TOUCHPAD" {corner=2, {[68,40]}}; - solid "touchpad" {shape="TOUCHPAD"; top=153; left=104; color="grey20"; priority=20;}; - - shape "TOUCHPADBUTTONS" {corner=1, - {[0,0], [33.5,0], [33.5,16], [6,16]}, - {[34.5,0], [68,0], [61, 16], [34.5,16]}}; - solid "touchleft" {shape="TOUCHPADBUTTONS"; top=198; left=104; color="grey20"; priority=20;}; - - shape "NIPPLE" {corner=3, {[7.5,7.5]}}; - solid "nipple" {shape="NIPPLE"; top=87; left=134; color="blue"; priority=200;}; - shape "NIPPLEBUTTONS" {corner=2, {[32.5,13]}, {[33.5,0],[66,13]}}; - solid "nipplebuttons" {shape="NIPPLEBUTTONS"; top=131; left=105; color="grey20"; priority=20;}; - - shape "FILLINGS" {corner=1.5, {[19,15]}, {[38,0],[55,15]}}; - solid "fillings" {shape="FILLINGS"; top=112; left=238; color="grey"; priority=200;}; - - shape "FUNC" {corner=1.5, {[16.3,12]}, {[2,0.5], [14,10]}}; - shape "ESC" {corner=1.5, {[18,12]}, {[2,0.5], [16,10]}}; - shape "BKSP" {corner=1.5, {[36.5,18]}, {[3,0.5], [33.5,14]}}; - - section "Function" {key.color="grey"; priority=100; top=9; left=10; width=290; height=28; - row {top=0; left=161.1; keys {{,"FUNC",1.1}, {,"FUNC",1.1}, {,"FUNC",1.1}, - {,"FUNC",1.1}, {,"FUNC",2.5}, {,"FUNC",1.1}, {,"FUNC",1.1}};}; - row {top=12.5; left=0; keys {{,"ESC",0}, - {,"FUNC",2.7}, {,"FUNC",1.1}, {,"FUNC",1.1}, {,"FUNC",1.1}, - {,"FUNC",2.5}, {,"FUNC",1.1}, {,"FUNC",1.1}, {,"FUNC",1.1}, - {,"FUNC",2.5}, {,"FUNC",1.1}, {,"FUNC",1.1}, {,"FUNC",1.1}, - {,"FUNC",2.5}, {, "FUNC",1.1}, {,"FUNC",1.1}};}; - }; // End of "Function" section - - shape "NORM" {corner=1.5, {[18,18]}, {[3,0.5], [14.8,14]}}; - shape "TABK" {corner=1.5, {[28,18]}, {[3,0.5], [25,14]}}; - shape "CAPS" {corner=1.5, {[32,18]}, {[3,0.5], [22,14]}}; - shape "LFSH" {corner=1.5, {[23,18]}, {[3,0.5], [20,14]}}; - shape "RTSH" {corner=1.5, {[50,18]}, {[3,1], [47,14]}}; - shape "RTRN" {corner=1.5, {[0,0],[26.5,0],[26.5,37],[4,37],[4,18],[0,18]}, - {[3,0.5], [23.5,0.5], [23.5,33], [7,33], [7,14], [3,14]}}; - shape "SPCE" {corner=1.5,{[95,18]}, {[3,0.5],[92,14]}}; - shape "LCTL" {corner=1.5, {[27,18]}, {[3,0.5],[24,14]}}; - shape "LALT" {corner=1.5, {[22,18]}, {[3,0.5],[19,14]}}; - shape "WIN" {corner=1.5, {[18,18]}, {[3,0.5],[15,14]}}; - - section "Alpha" {key.color="grey"; priority=100; top=36; left=10; width=290; height=18; - row {top=0; left=0; keys {{, "NORM", 0}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, - {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, - {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "BKSP", 1}};}; - row {top=19; left=0; keys {{, "TABK", 0}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, - {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, - {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "RTRN", 1}};}; - row {top=38; left=0; keys {{, "CAPS", 0}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, - {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, - {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}};}; - // TODO There's a weird <> key here, check it out: - row {top=57; left=0; keys {{, "LFSH", 0}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, - {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, - {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "RTSH", 1}};}; - row {top=76; left=0; keys {{, "LCTL", 0}, {, "WIN", 1},{, "WIN", 1}, {, "LALT", 1}, - {, "SPCE", 1}, {, "WIN", 1},{, "LALT", 1}};}; - }; // End of "Alpha" section - - shape "ARROW" {corner=1.5, {[17,15]}, {[2,0.5],[15,13]}}; - section "Arrows" {key.color="grey"; priority=110; top=112; left=240; width=43; height=31; - row {top=0; left=18; keys {{, "ARROW", 0}};}; - row {top=16; left=0; keys {{, "ARROW", 0}, {, "ARROW", 1}, {, "ARROW", 1}};}; - }; // End of "Arrows" section - - shape "LEDS" {corner=3, {[25,7]}}; - solid "leds" {shape="LEDS"; top=5.7; left=69; color="grey"; priority=10;}; - shape "LED" {corner=0, {[0,1.5], [3,4.5]}, {[0.5,1.5], [1,0] , [2,0], [2.5,1.5]}}; - indicator.onColor="green"; - indicator.offColor="grey"; - indicator.top=7; - indicator.shape="LED"; - indicator.priority=200; - indicator "Num Lock" {left=72;}; - indicator "Caps Lock" {left=80;}; - indicator "Scroll Lock" {left=88;}; - - text "LATITUDE" {left=10; top=7; text="L A T I T U D E | D620";}; - - shape "ROUND" {corner=5, {[10,10]}}; - shape "POWER" {corner=7, {[15,15]}}; - section "Topbuttons" {key.color="grey"; priority=110; top=2; left=100; - row {top=2; left=0; keys {{, "ROUND", 0}, {, "ROUND", 3}, {, "ROUND", 3}};}; - row {top=0; left=45; keys {{, "POWER", 0}};}; - }; // End of "TopButtons" section -}; +// +//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. +// +default xkb_geometry "dell101" { + + description= "Dell 101"; + width= 470; + height= 210; + + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [ 16,16] } }; + shape "BKSP" { { [ 38,18] }, { [2,1], [ 36,16] } }; + shape "TABK" { { [ 28,18] }, { [2,1], [ 26,16] } }; + shape "BKSL" { { [ 28,18] }, { [2,1], [ 26,16] } }; + shape "RTRN" { { [ 42,18] }, { [2,1], [ 40,16] } }; + shape "CAPS" { { [ 33,18] }, { [ 28,18] }, { [2,1], [ 26,16] } }; + shape "LFSH" { { [ 42,18] }, { [2,1], [ 40,16] } }; + shape "RTSH" { { [ 52,18] }, { [2,1], [ 50,16] } }; + shape "MODK" { { [ 27,18] }, { [2,1], [ 25,16] } }; + shape "SPCE" { { [133,18] }, { [2,1], [131,16] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [ 35,16] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [ 16,35] } }; + + shape "LEDS" { cornerRadius= 0, { [ 75 ,20 ] } }; + shape "LED" { cornerRadius= 0, { [ 5, 1 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 52; + left= 377; + color= "grey10"; + }; + + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 67; + indicator.shape= "LED"; + indicator "Num Lock" { left= 382; }; + indicator "Caps Lock" { left= 407; }; + indicator "Scroll Lock" { left= 433; }; + text.top= 55; + text.color= "black"; + text "NumLockLabel" { left= 378; text="Num\nLock"; }; + text "CapsLockLabel" { left= 403; text="Caps\nLock"; }; + text "ScrollLockLabel" { left= 428; text="Scroll\nLock"; }; + + section.left= 19; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 52; + row { + top= 1; + keys { { , color="grey20" }, + { , 20 }, , , , + { , 11 }, , , , + { , 11 }, , , , + { , 8 }, , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 91; + row { + top= 1; + keys { , , , , , + , , , , , + , , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { { , "TABK", color="grey20" }, + , , , , , + , , , , , + , , { , "BKSL" } + }; + }; + row { + top= 39; + keys { { , "CAPS", color="grey20" }, + , , , , , + , , , , , + , { , "RTRN", color="grey20" } + }; + }; + row { + top= 58; + keys { { , "LFSH", color="grey20" }, + , , , , , + , , , , , + { , "RTSH", color="grey20" } + }; + }; + row { + top= 77; + key.shape= "MODK"; + key.color= "grey20"; + keys { , { , 21 }, + { , "SPCE", color="white" }, + , { , 21 } + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 91; + left= 312; + key.color= "grey20"; + row { + top= 1; + keys { , , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + top= 58; + left= 20; + keys { }; + }; + row { + top= 77; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 91; + left= 376; + row { + top= 1; + key.color= "grey20"; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + + alias = ; + alias = ; + +}; // End of "default" geometry + + +xkb_geometry "dell65" { +}; + +xkb_geometry "dell65x" { + + description= "Dell 101"; + width= 470; + height= 210; + color="grey10"; + + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [ 16,16] } }; + shape "BKSP" { { [ 38,18] }, { [2,1], [ 36,16] } }; + shape "TABK" { { [ 28,18] }, { [2,1], [ 26,16] } }; + shape "BKSL" { { [ 28,18] }, { [2,1], [ 26,16] } }; + shape "RTRN" { { [ 42,18] }, { [2,1], [ 40,16] } }; + shape "CAPS" { { [ 33,18] }, { [ 28,18] }, { [2,1], [ 26,16] } }; + shape "LFSH" { { [ 42,18] }, { [2,1], [ 40,16] } }; + shape "RTSH" { { [ 52,18] }, { [2,1], [ 50,16] } }; + shape "MODK" { { [ 27,18] }, { [2,1], [ 25,16] } }; + shape "SPCE" { { [133,18] }, { [2,1], [131,16] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [ 35,16] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [ 16,35] } }; + + shape "LEDS" { cornerRadius= 0, { [ 75 ,20 ] } }; + shape "LED" { cornerRadius= 0, { [ 5, 1 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 52; + left= 377; + color= "grey10"; + }; + + shape "BACKGROUND" { cornerRadius=5, { [ 470, 210 ] } }; + solid "Background" { + shape= "BACKGROUND"; + top= 0; + left= 0; + color= "grey10"; + }; + + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 67; + indicator.shape= "LED"; + indicator "Num Lock" { left= 382; }; + indicator "Caps Lock" { left= 407; }; + indicator "Scroll Lock" { left= 433; }; + text.top= 55; + text.color= "black"; + text "NumLockLabel" { left= 378; text="Num\nLock"; }; + text "CapsLockLabel" { left= 403; text="Caps\nLock"; }; + text "ScrollLockLabel" { left= 428; text="Scroll\nLock"; }; + + section.left= 19; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 52; + row { + top= 1; + keys { { , color="grey20" }, + { , 20 }, , , , + { , 11 }, , , , + { , 11 }, , , , + { , 8 }, , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 91; + row { + top= 1; + keys { , , , , , + , , , , , + , , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { { , "TABK", color="grey20" }, + , , , , , + , , , , , + , , { , "BKSL" } + }; + }; + row { + top= 39; + keys { { , "CAPS", color="grey20" }, + , , , , , + , , , , , + , { , "RTRN", color="grey20" } + }; + }; + row { + top= 58; + keys { { , "LFSH", color="grey20" }, + , , , , , + , , , , , + { , "RTSH", color="grey20" } + }; + }; + row { + top= 77; + key.shape= "MODK"; + key.color= "grey20"; + keys { , { , 21 }, + { , "SPCE", color="white" }, + , { , 21 } + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 91; + left= 312; + key.color= "grey20"; + row { + top= 1; + keys { , , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + top= 58; + left= 20; + keys { }; + }; + row { + top= 77; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 91; + left= 376; + row { + top= 1; + key.color= "grey20"; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + + alias = ; + alias = ; + +}; + + +// +// Dell Precision M65 +// + +xkb_geometry "dellm65" { + + description= "Dell Precision M65"; + width= 308; + height= 152; + baseColor = "grey20"; + labelColor = "white"; + + shape "BACKGROUND" { cornerRadius = 3, { [ 308, 152 ] } }; + shape "BACKGROUND2" { cornerRadius = 2, { [ 7, 22 ], + [ 171, 22 ], + [ 171, 10 ], + [ 301, 10 ], + [ 301, 148 ], + [ 244, 148 ], + [ 244, 132 ], + [ 7, 132] } }; + solid "Background" { + shape = "BACKGROUND"; + top = 0; + left = 0; + color = "grey20"; + }; + solid "Background2" { + shape = "BACKGROUND2"; + top = 0; + left = 0; + color = "black"; + }; + + shape "LEDS" { cornerRadius = 4, { [ 26, 8 ] } }; + shape "LED" { cornerRadius = 0, { [ 4, 4 ] } }; + solid "LedPanel" { + shape = "LEDS"; + top = 8; + left = 69; + color = "grey20"; + }; + + indicator.onColor= "green"; + indicator.offColor= "gray20"; + indicator.top= 10; + indicator.shape= "LED"; + indicator "Num Lock" { left= 72; }; + indicator "Caps Lock" { left= 80; }; + indicator "Scroll Lock" { left= 88; }; + + shape "MEDIA" { cornerRadius = 5, { [ 2, 2], [ 12, 12 ] } }; + shape "POWER" { cornerRadius = 7, { [ 14, 14 ] } }; + + section "Media" { + top = 5; + left = 102; + width = 60; + height = 14; + key.color="grey30"; + key.shape = "MEDIA"; + row { + top = 0; + keys { + , , , { , shape = "POWER", gap = 3 } + }; + }; + }; + + + shape "FKEY" { cornerRadius = 1, { [ 18, 12 ] }, { [ 1, 1 ], [ 17, 10 ] } }; + + section "Function" { + top = 12; + left = 8; + width = 290; + height = 24; + key.color = "grey80"; + key.shape = "FKEY"; + key.gap = 0; + row { + top = 0; + keys { { , 165 }, , , , + { , 1 }, , }; + }; + row { + top = 12; + keys { , { , 1 }, , , , + { , 1 }, , , , + { , 1 }, , , , + { , 1 }, , }; + }; + }; + + shape "AKEY" { cornerRadius = 1, { [ 19, 19 ] }, { [ 2, 1 ], [ 17, 15 ] } }; + shape "BKSP" { cornerRadius = 1, { [ 44, 19 ] }, { [ 2, 1 ], [ 42, 15 ] } }; + shape "TABK" { cornerRadius = 1, { [ 31, 19 ] }, { [ 2, 1 ], [ 29, 15 ] } }; + shape "BKSL" { cornerRadius = 1, { [ 31, 19 ] }, { [ 2, 1 ], [ 29, 15 ] } }; + shape "CAPS" { cornerRadius = 1, { [ 34, 19 ] }, { [ 2, 1 ], [ 32, 15 ] } }; + shape "RTRN" { cornerRadius = 1, { [ 47, 19 ] }, { [ 2, 1 ], [ 45, 15 ] } }; + shape "LFSH" { cornerRadius = 1, { [ 44, 19 ] }, { [ 2, 1 ], [ 42, 15 ] } }; + shape "RTSH" { cornerRadius = 1, { [ 56, 19 ] }, { [ 2, 1 ], [ 54, 15 ] } }; + shape "LCTL" { cornerRadius = 1, { [ 31, 19 ] }, { [ 2, 1 ], [ 29, 15 ] } }; + shape "LALT" { cornerRadius = 1, { [ 25, 19 ] }, { [ 2, 1 ], [ 23, 15 ] } }; + shape "RCTL" { cornerRadius = 1, { [ 25, 19 ] }, { [ 2, 1 ], [ 23, 15 ] } }; + shape "SPCE" { cornerRadius = 1, { [ 96, 19 ] }, { [ 2, 1 ], [ 94, 15 ] } }; + + + section "Alpha" { + top = 36; + left = 8; + width = 290; + height = 21; + key.color = "grey80"; + key.shape = "AKEY"; + key.gap = 0; + row { + top = 1; + keys { , , , , , + , , , , , + , , , { , 1, "BKSP" } }; + }; + row { + top = 20; + keys { { , "TABK" }, + { , 1 }, , , , , + , , , , , + , , { , 1, "BKSL" } }; + }; + row { + top = 39; + keys { { , "CAPS" }, + { , 1 }, , , , , + , , , , , + , { , 1, "RTRN" } }; + }; + row { + top = 58; + keys { { , "LFSH" }, + { , 1 }, , , , , + , , , , , + { , 1, "RTSH" } }; + }; + row { + top = 77; + keys { { , "LCTL" }, { , 20 }, { , "LALT" }, + { , "SPCE" }, , { , "RCTL" } }; + }; + }; + + shape "SKEY" { cornerRadius = 1, { [ 18, 17 ] }, { [ 2, 1 ], [ 16, 13 ] } }; + section "Arrows" { + top = 113; + left = 243; + width = 54; + height = 36; + + key.color = "grey80"; + key.shape = "SKEY"; + row { + top = 0; + left = 20; + + keys { }; + }; + + row { + top = 17; + left = 2; + + keys { , , }; + }; + }; + + shape "STIK" { cornerRadius = 4, { [ 7, 7 ] } }; + + solid "STIK" { + priority = 255; + color = "blue"; + shape = "STIK"; + top = 90; + left = 135; + }; +}; + +xkb_geometry "latitude" { + description="Dell Latitude"; + width=304.2; height=219.1; + + baseColor="grey"; labelColor="white"; + + alias =; + alias =; + + shape "EXTERNAL" {corner=3, + {[0,0], [302,0], [302,154], [174,154], [174,198], [166,216], [107,216], [100,198], [100,154], [0,154]}}; + solid "external" {shape="EXTERNAL"; top=1.1; left=1.1; color="grey10"; priority=10;}; + + shape "INTERNAL" {corner=3, + {[0,13], [162.2,13], [162.2,0], [286,0], [286,138], [230,138], [230,124], [163,124], [163,138], [96,138], [96,124], [0,124]}}; + solid "internal" {shape="INTERNAL"; top=7; left=8.5; color="black"; priority=20;}; + + shape "TOUCHPAD" {corner=2, {[68,40]}}; + solid "touchpad" {shape="TOUCHPAD"; top=153; left=104; color="grey20"; priority=20;}; + + shape "TOUCHPADBUTTONS" {corner=1, + {[0,0], [33.5,0], [33.5,16], [6,16]}, + {[34.5,0], [68,0], [61, 16], [34.5,16]}}; + solid "touchleft" {shape="TOUCHPADBUTTONS"; top=198; left=104; color="grey20"; priority=20;}; + + shape "NIPPLE" {corner=3, {[7.5,7.5]}}; + solid "nipple" {shape="NIPPLE"; top=87; left=134; color="blue"; priority=200;}; + shape "NIPPLEBUTTONS" {corner=2, {[32.5,13]}, {[33.5,0],[66,13]}}; + solid "nipplebuttons" {shape="NIPPLEBUTTONS"; top=131; left=105; color="grey20"; priority=20;}; + + shape "FILLINGS" {corner=1.5, {[19,15]}, {[38,0],[55,15]}}; + solid "fillings" {shape="FILLINGS"; top=112; left=238; color="grey"; priority=200;}; + + shape "FUNC" {corner=1.5, {[16.3,12]}, {[2,0.5], [14,10]}}; + shape "ESC" {corner=1.5, {[18,12]}, {[2,0.5], [16,10]}}; + shape "BKSP" {corner=1.5, {[36.5,18]}, {[3,0.5], [33.5,14]}}; + + section "Function" {key.color="grey"; priority=100; top=9; left=10; width=290; height=28; + row {top=0; left=161.1; keys {{,"FUNC",1.1}, {,"FUNC",1.1}, {,"FUNC",1.1}, + {,"FUNC",1.1}, {,"FUNC",2.5}, {,"FUNC",1.1}, {,"FUNC",1.1}};}; + row {top=12.5; left=0; keys {{,"ESC",0}, + {,"FUNC",2.7}, {,"FUNC",1.1}, {,"FUNC",1.1}, {,"FUNC",1.1}, + {,"FUNC",2.5}, {,"FUNC",1.1}, {,"FUNC",1.1}, {,"FUNC",1.1}, + {,"FUNC",2.5}, {,"FUNC",1.1}, {,"FUNC",1.1}, {,"FUNC",1.1}, + {,"FUNC",2.5}, {, "FUNC",1.1}, {,"FUNC",1.1}};}; + }; // End of "Function" section + + shape "NORM" {corner=1.5, {[18,18]}, {[3,0.5], [14.8,14]}}; + shape "TABK" {corner=1.5, {[28,18]}, {[3,0.5], [25,14]}}; + shape "CAPS" {corner=1.5, {[32,18]}, {[3,0.5], [22,14]}}; + shape "LFSH" {corner=1.5, {[23,18]}, {[3,0.5], [20,14]}}; + shape "RTSH" {corner=1.5, {[50,18]}, {[3,1], [47,14]}}; + shape "RTRN" {corner=1.5, {[0,0],[26.5,0],[26.5,37],[4,37],[4,18],[0,18]}, + {[3,0.5], [23.5,0.5], [23.5,33], [7,33], [7,14], [3,14]}}; + shape "SPCE" {corner=1.5,{[95,18]}, {[3,0.5],[92,14]}}; + shape "LCTL" {corner=1.5, {[27,18]}, {[3,0.5],[24,14]}}; + shape "LALT" {corner=1.5, {[22,18]}, {[3,0.5],[19,14]}}; + shape "WIN" {corner=1.5, {[18,18]}, {[3,0.5],[15,14]}}; + + section "Alpha" {key.color="grey"; priority=100; top=36; left=10; width=290; height=18; + row {top=0; left=0; keys {{, "NORM", 0}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, + {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, + {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "BKSP", 1}};}; + row {top=19; left=0; keys {{, "TABK", 0}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, + {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, + {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "RTRN", 1}};}; + row {top=38; left=0; keys {{, "CAPS", 0}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, + {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, + {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}};}; + // TODO There's a weird <> key here, check it out: + row {top=57; left=0; keys {{, "LFSH", 0}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, + {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, + {, "NORM", 1}, {, "NORM", 1}, {, "NORM", 1}, {, "RTSH", 1}};}; + row {top=76; left=0; keys {{, "LCTL", 0}, {, "WIN", 1},{, "WIN", 1}, {, "LALT", 1}, + {, "SPCE", 1}, {, "WIN", 1},{, "LALT", 1}};}; + }; // End of "Alpha" section + + shape "ARROW" {corner=1.5, {[17,15]}, {[2,0.5],[15,13]}}; + section "Arrows" {key.color="grey"; priority=110; top=112; left=240; width=43; height=31; + row {top=0; left=18; keys {{, "ARROW", 0}};}; + row {top=16; left=0; keys {{, "ARROW", 0}, {, "ARROW", 1}, {, "ARROW", 1}};}; + }; // End of "Arrows" section + + shape "LEDS" {corner=3, {[25,7]}}; + solid "leds" {shape="LEDS"; top=5.7; left=69; color="grey"; priority=10;}; + shape "LED" {corner=0, {[0,1.5], [3,4.5]}, {[0.5,1.5], [1,0] , [2,0], [2.5,1.5]}}; + indicator.onColor="green"; + indicator.offColor="grey"; + indicator.top=7; + indicator.shape="LED"; + indicator.priority=200; + indicator "Num Lock" {left=72;}; + indicator "Caps Lock" {left=80;}; + indicator "Scroll Lock" {left=88;}; + + text "LATITUDE" {left=10; top=7; text="L A T I T U D E | D620";}; + + shape "ROUND" {corner=5, {[10,10]}}; + shape "POWER" {corner=7, {[15,15]}}; + section "Topbuttons" {key.color="grey"; priority=110; top=2; left=100; + row {top=2; left=0; keys {{, "ROUND", 0}, {, "ROUND", 3}, {, "ROUND", 3}};}; + row {top=0; left=45; keys {{, "POWER", 0}};}; + }; // End of "TopButtons" section +}; diff --git a/xorg-server/xkeyboard-config/geometry/digital_vndr/lk b/xorg-server/xkeyboard-config/geometry/digital_vndr/lk index 1ccd33163..fb6b2c72c 100644 --- a/xorg-server/xkeyboard-config/geometry/digital_vndr/lk +++ b/xorg-server/xkeyboard-config/geometry/digital_vndr/lk @@ -1,730 +1,728 @@ -// $Xorg: lk,v 1.3 2000/08/17 19:54:36 cpqbld Exp $ -// -//Copyright (c) 1996 Digital Equipment Corporation -// -//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. -// -// HISTORY -// Log: lk,v -// Revision 1.2 1996/06/18 09:12:47 erik -// use flags correctly, assorted cleanups and consortium fixes -// -// Revision 1.1.6.2 1995/08/18 21:15:16 William_Walker -// Upgrade XKB to Protocol Rev. 0.64 -// [1995/08/18 20:41:46 William_Walker] -// -// Revision 1.1.2.5 1995/08/11 19:35:47 William_Walker -// Sync up with Erik's pool. -// [1995/08/11 18:35:58 William_Walker] -// -// Revision 1.1.2.4 1995/06/27 12:17:28 William_Walker -// Rename to ISO9995 compliant . -// [1995/06/26 20:23:07 William_Walker] -// -// Revision 1.1.2.3 1995/06/09 20:54:36 William_Walker -// Add VT105 layout support and ISO group support -// [1995/06/09 20:40:38 William_Walker] -// -// Revision 1.1.2.2 1995/06/05 19:21:16 William_Walker -// New file. I love keymaps. -// [1995/06/05 18:05:43 William_Walker] -// -// EndLog -// -// @(#)RCSfile: lk,v Revision: 1.2 (DEC) Date: 1996/01/24 12:16:00 -// -xkb_geometry "lk201" { - width = 530; - height = 170; - shape.cornerRadius = 1; - - shape "NORM" { { [18,19] }, { [3,2], [15,16] } }; - shape "RTRN" { - approx = { [0,0],[23,19] }, - { [0,0], [23,0], [23,39], [5,39], [5,19], [0,19] }, - { [3,2], [20,2], [20,36], [8,36], [8,16], [3,16] } - }; - shape "LONG" { { [37,19] }, { [3,2], [34,16] } }; - shape "TALL" { { [18,39] }, { [3,2], [15,36] } }; - shape "MED" { { [28,19] }, { [3,2], [25,16] } }; - shape "CAPS" { { [28,19] }, { [3,2], [18,16] } }; - shape "SPCE" { { [171,19] },{ [3,2], [168,16]} }; - shape "LEDS" { [ 30,15] }; - shape "LED" { [ 5, 2] }; - - section.left= 27; - row.left = 1; - key.shape = "NORM"; - key.gap = 1; - - section "Function" { top = 20; - row { top = 1; - keys { , , , , , - { , 19 }, , , , , - { , 19 }, , , , - { , 98 }, , , - }; - }; - }; - - section "Editing" { top = 20; left = 350; - row { top = 1; - keys { , { , "LONG" } }; - }; - row { top = 41; - keys { , , }; - }; - row { top = 61; - keys { , , }; - }; - row { top = 81; left = 20; - keys { }; - }; - row { top = 101; - keys { , , }; - }; - }; - - section "Keypad" { top = 60; left = 426; - row { top = 1; - keys { , , , }; - }; - row { top = 21; - keys { , , , }; - }; - row { top = 41; - keys { , , , }; - }; - row { top = 61; - keys { , , , { , "TALL" } }; - }; - row { top = 81; - keys { { , "LONG" }, }; - }; - }; - - section "Alpha" { top = 60; - row { top = 1; left = 15; - keys { , - , , , , , , - , , , , , , - { , "MED" } - }; - }; - row { top = 21; left = 15; - keys { { , "MED" }, - , , , , , , - , , , , , , - { , "RTRN" } - }; - - }; - row { top = 41; - keys { , - { , "CAPS" }, - , , , , , , - , , , , , - }; - }; - row { top = 61; - keys { { , "LONG" }, - , , , , , , - , , , , , - { , "LONG" } - }; - }; - row { top = 81; left = 26; - keys { { , "LONG" }, - { , "SPCE" } - }; - }; - }; - - section.left = 341; - section.top = 3; - - section "Indicators" { - indicator.onColor = "#00ff00"; - indicator.offColor= "#001000"; - indicator.top = 10; - indicator.shape= "LED"; - indicator "Scroll Lock" { left = 9; }; - indicator "Caps Lock" { left = 27; }; - indicator "Compose" { left = 45; }; - indicator "Wait" { left = 63; }; - text.top = 4; - text.color = "black"; - text "HoldScreenLabel" {left = 5; text="Hold\n"; }; - text "CapsLockLabel" {left = 23; text="Lock\n"; }; - text "ComposeLabel" {left = 37; text="Compose\n"; }; - text "WaitLabel" {left = 60; text="Wait\n"; }; - }; -}; - -xkb_geometry "lk401" { - - width = 480; - height = 180; - shape.cornerRadius = 1; - - shape "NORM" { { [18,19] }, { [3,2], [15,16] } }; - shape "RTRN" { - approx = { [0,0],[23,19] }, - { [0,0], [23,0], [23,39], [5,39], [5,19], [0,19] }, - { [3,2], [20,2], [20,36], [8,36], [8,16], [3,16] } - }; - shape "LONG" { { [37,19] }, { [3,2], [34,16] } }; - shape "TALL" { { [18,39] }, { [3,2], [15,36] } }; - shape "MED" { { [28,19] }, { [3,2], [25,16] } }; - shape "CAPS" { { [28,19] }, { [3,2], [18,16] } }; - shape "SPCE" { { [131,19] },{ [3,2], [128,16]} }; - shape "LEDS" { [ 36,15] }; - shape "LED" { [ 5, 2] }; - - section.left= 17; - row.left = 1; - key.shape = "NORM"; - key.gap = 1; - - text "Logo" {left = 20; top = 10; text="digital\n"; }; - - section "Function" { top = 20; - row { top = 1; - keys { , , , , , - { , 15 }, , , , , - { , 15 }, , , , - { , 75 }, , , - }; - }; - }; - - section "Editing" { top = 20; left = 320; - row { top = 1; - keys { , { , "LONG" } }; - }; - row { top = 41; - keys { , , }; - }; - row { top = 61; - keys { , , }; - }; - row { top = 81; left= 20; - keys { }; - }; - row { top = 101; - keys { , , }; - }; - }; - - section "Keypad" { top = 60; left = 385; - row { top = 1; - keys { , , , }; - }; - row { - top = 21; - keys { , , , }; - }; - row { top = 41; - keys { , , , }; - }; - row { top = 61; - keys { , , , { , "TALL" } }; - }; - row { top = 81; - keys { { , "LONG" }, }; - }; - }; - - section "Alpha" { top = 60; - row { top = 1; left = 15; - keys { , - , , , , , , - , , , , , , - { , "MED" } - }; - }; - row { top = 21; left = 15; - keys { { , "MED" }, - , , , , , , - , , , , , , - { , "RTRN" } - }; - - }; - row { top = 41; - keys { , - { , "CAPS" }, - , , , , , , - , , , , , - }; - }; - row { top = 61; - keys { { , "LONG" }, - , , , , , , - , , , , , - { , "LONG" } - }; - }; - row { top = 81; left = 29; - keys { { , "MED" }, - { , "MED" }, - { , "SPCE" }, - { , "MED" }, - { , "MED" } - }; - }; - }; - - section.left = 69; - section.top = 3; - section "Indicators" { - solid "led_panel" { top = 0; left = 0; - cornerRadius = 1; - shape = "LEDS"; - color = "grey"; - }; - indicator.onColor = "#00ff00"; - indicator.offColor= "#001000"; - indicator.shape = "LED"; - indicator.top = 1; - indicator "Scroll Lock" { left = 3; }; - indicator "Caps Lock" { left = 22; }; - }; - section "IndicatorLabels" { - text.top = 4; - text.color = "black"; - text "ScrollLockLabel" {left = 3; text="Scroll\nLock"; }; - text "CapsLockLabel" {left = 22; text="Caps\nLock"; }; - }; -}; - -xkb_geometry "lk450" { - - width = 480; - height = 180; - shape.cornerRadius = 1; - - shape "NORM" { { [18,19] }, { [3,2], [15,16] } }; - shape "RTRN" { - approx = { [0,0],[23,19] }, - { [0,0], [23,0], [23,39], [5,39], [5,19], [0,19] }, - { [3,2], [20,2], [20,36], [8,36], [8,16], [3,16] } - }; - shape "LONG" { { [37,19] }, { [3,2], [34,16] } }; - shape "TALL" { { [18,39] }, { [3,2], [15,36] } }; - shape "MED" { { [28,19] }, { [3,2], [25,16] } }; - shape "CAPS" { { [28,19] }, { [3,2], [18,16] } }; - shape "SPCE" { { [131,19] },{ [3,2], [128,16]} }; - shape "LEDS" { [ 36,15] }; - shape "LED" { [ 5, 2] }; - - section.left= 17; - row.left = 1; - key.shape = "NORM"; - key.gap = 1; - - text "Logo" {left = 20; top = 10; text="digital\n"; }; - - section "Function" { top = 20; - row { top = 1; - keys { , , , , , - { , 15 }, , , , , - { , 15 }, , , , - { , 75 }, , , - }; - }; - }; - - section "Editing" { top = 20; left = 320; - row { top = 1; - keys { , { , "LONG" } }; - }; - row { top = 41; - keys { , , }; - }; - row { top = 61; - keys { , , }; - }; - row { top = 81; left= 20; - keys { }; - }; - row { top = 101; - keys { , , }; - }; - }; - - section "Keypad" { top = 60; left = 385; - row { top = 1; - keys { , , , }; - }; - row { - top = 21; - keys { , , , }; - }; - row { top = 41; - keys { , , , }; - }; - row { top = 61; - keys { , , , { , "TALL" } }; - }; - row { top = 81; - keys { { , "LONG" }, }; - }; - }; - - section "Alpha" { top = 60; - row { top = 1; left = 15; - keys { , - , , , , , , - , , , , , , - { , "MED" } - }; - }; - row { top = 21; left = 15; - keys { { , "MED" }, - , , , , , , - , , , , , , - { , "RTRN" } - }; - - }; - row { top = 41; - keys { , - { , "CAPS" }, - , , , , , , - , , , , , - }; - }; - row { top = 61; - keys { { , "LONG" }, - , , , , , , - , , , , , - { , "LONG" } - }; - }; - row { top = 81; left = 29; - keys { { , "MED" }, - { , "MED" }, - { , "SPCE" }, - { , "MED" }, - { , "MED" } - }; - }; - }; - - section.left = 69; - section.top = 3; - section "Indicators" { - solid "led_panel" { top = 0; left = 0; - cornerRadius = 1; - shape = "LEDS"; - color = "grey"; - }; - indicator.onColor = "#00ff00"; - indicator.offColor= "#001000"; - indicator.shape = "LED"; - indicator.top = 1; - indicator "Scroll Lock" { left = 3; }; - indicator "Caps Lock" { left = 22; }; - }; - section "IndicatorLabels" { - text.top = 4; - text.color = "black"; - text "ScrollLockLabel" {left = 3; text="Scroll\nLock"; }; - text "CapsLockLabel" {left = 22; text="Caps\nLock"; }; - }; -}; - -xkb_geometry "lk401bj" -{ - width = 480; - height = 180; - shape.cornerRadius = 1; - - shape "NORM" { { [18,19] }, { [3,2], [15,16] } }; - shape "RTRN" { - approx = { [0,0],[23,19] }, - { [0,0], [23,0], [23,39], [5,39], [5,19], [0,19] }, - { [3,2], [20,2], [20,36], [8,36], [8,16], [3,16] } - }; - shape "LONG" { { [37,19] }, { [3,2], [34,16] } }; - shape "TALL" { { [18,39] }, { [3,2], [15,36] } }; - shape "MED" { { [28,19] }, { [3,2], [25,16] } }; - shape "CAPS" { { [28,19] }, { [3,2], [18,16] } }; - shape "SPCE" { { [131,19] },{ [3,2], [128,16]} }; - shape "LEDS" { [ 30,15] }; - shape "LED" { [ 5, 2] }; - - section.left= 17; - row.left = 1; - key.shape = "NORM"; - key.gap = 1; - - text "Logo" {left = 20; top = 10; text="digital\n"; }; - - section "Function" { top = 20; - row { top = 1; - keys { , , , , , - { , 15 }, , , , , - { , 15 }, , , , - { , 75 }, , , - }; - }; - }; - - section "Editing" { top = 20; left = 320; - row { top = 1; - keys { , { , "LONG" } }; - }; - row { top = 41; - keys { , , }; - }; - row { top = 61; - keys { , , }; - }; - row { top = 81; left = 20; - keys { }; - }; - row { top = 101; - keys { , , }; - }; - }; - - section "Keypad" { top = 60; left = 385; - row { top = 1; - keys { , , , }; - }; - row { top = 21; - keys { , , , }; - }; - row { top = 41; - keys { , , , }; - }; - row { top = 61; - keys { , , , { , "TALL" } }; - }; - row { top = 81; - keys { { , "LONG" }, }; - }; - }; - - section "Alpha" { top = 60; - row { top = 1; left = 15; - keys { , - , , , , , , - , , , , , , - { , "MED" } - }; - }; - row { top = 21; left = 15; - keys { { , "MED" }, - , , , , , , - , , , , , , - { , "RTRN" } - }; - }; - row { top = 41; - keys { , - { , "CAPS" }, - , , , , , , - , , , , , - }; - }; - row { top = 61; - keys { { , "LONG" }, - , , , , , , - , , , , , - { , "LONG" } - }; - }; - row { top = 81; left = 29; - keys { { , "MED" }, - { , "MED" }, - { , "SPCE" }, - { , "MED" }, - { , "MED" } - }; - }; - }; - - section.left = 69; - section.top = 3; - - section "Indicators" { - solid "led_panel" { top = 0; left = 0; - cornerRadius = 1; - shape = "LEDS"; - color = "grey"; - }; - indicator.onColor = "#00ff00"; - indicator.offColor= "#001000"; - indicator.top = 1; - indicator.shape= "LED"; - indicator "Scroll Lock" { left = 3; }; - indicator "Caps Lock" { left = 22; }; - text.top = 4; - text.color = "black"; - text "ScrollLockLabel" {left = 3; text="Scroll\nLock"; }; - text "CapsLockLabel" {left = 19; text="Caps\nLock"; }; - }; -}; - -xkb_geometry "lk401jj" { - - width = 460; - height = 180; - shape.cornerRadius = 1; - - shape "NORM" { { [18,19] }, { [3,2], [15,16] } }; - shape "RTRN" { - approx = { [0,0],[28,23] }, - { [0,0], [28,0], [28,39], [5,39], [5,19], [0,19] }, - { [3,2], [25,2], [25,36], [8,36], [8,16], [3,16] } - }; - shape "LONG" { { [37,19] }, { [3,2], [34,16] } }; - shape "LONG1" { { [32,19] }, { [3,2], [29,16] } }; - shape "TALL" { { [18,39] }, { [3,2], [15,36] } }; - shape "MED" { { [28,19] }, { [3,2], [25,16] } }; - shape "MED1" { { [23,19] }, { [3,2], [20,16] } }; - shape "CTRL" { { [43,19] }, { [3,2], [38,16] } }; - shape "SPCE" { { [55,19] },{ [3,2], [53,16]} }; - shape "LEDS" { [ 56,15] }; - shape "LED" { [ 5, 2] }; - - section.left = 5; - row.left = 1; - key.shape = "NORM"; - key.gap = 1; - - text "Logo" {left = 7; top = 10; text="digital\n"; }; - - section "Function" { top = 40; - row { top = 1; - keys { , , , , , - { , 18 }, , , , , - { , 18 }, , , , - { , 73 }, , , - }; - }; - }; - - section "Editing" { top = 40; left = 313; - row { top = 1; - keys { , { , "LONG" } }; - }; - row { top = 31; - keys { , , }; - }; - row { top = 51; - keys { , , }; - }; - row { top = 71; left= 20; - keys { }; - }; - row { top = 91; - keys { , , }; - }; - }; - - section "Keypad" { top = 70; left = 377; - row { top = 1; - keys { , , , }; - }; - row { top = 21; - keys { , , , }; - }; - row { top = 41; - keys { , , , }; - }; - row { top = 61; - keys { , , , { , "TALL" } }; - }; - row { top = 81; - keys { { , "LONG" }, }; - }; - }; - - section "Alpha" { top = 70; - row { top = 1; left = 7; - keys { { , "MED1" }, - , , , , , , - , , , , , , - , { , "MED1" } - }; - }; - row { top = 21; left = 7; - keys { { , "LONG1" }, - , , , , , , - , , , , , , - { , "RTRN" } - }; - }; - row { top = 41; - keys { { , "CTRL" }, - , , , , , , - , , , , , - }; - }; - row { top = 61; - keys { , { , "LONG1" }, - , , , , , - , , , , , - , { , "MED" } - }; - }; - row { top = 81; left = 7; - keys { { , "LONG" }, - { , "LONG" }, - { , "LONG" }, - { , "SPCE" }, - { , "LONG" }, - { , "LONG" }, - , - }; - }; - }; - - section.left = 315; - section.top = 20; - - section "Indicators" { - solid "led_panel" { top = 0; left = 0; - cornerRadius = 1; - shape = "LEDS"; - color = "grey"; - }; - indicator.onColor = "#00ff00"; - indicator.offColor= "#001000"; - indicator.top = 11; - indicator.shape= "LED"; - indicator "Scroll Lock" { left = 6; }; - indicator "Caps Lock" { left = 26; }; - text.top = 4; - text.color = "black"; - text "ScrollLockLabel" {left = 3; text="Scroll\nLock"; }; - text "CapsLockLabel" {left = 22; text="Caps\nLock"; }; - }; -}; - +// +//Copyright (c) 1996 Digital Equipment Corporation +// +//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. +// +// HISTORY +// Log: lk,v +// Revision 1.2 1996/06/18 09:12:47 erik +// use flags correctly, assorted cleanups and consortium fixes +// +// Revision 1.1.6.2 1995/08/18 21:15:16 William_Walker +// Upgrade XKB to Protocol Rev. 0.64 +// [1995/08/18 20:41:46 William_Walker] +// +// Revision 1.1.2.5 1995/08/11 19:35:47 William_Walker +// Sync up with Erik's pool. +// [1995/08/11 18:35:58 William_Walker] +// +// Revision 1.1.2.4 1995/06/27 12:17:28 William_Walker +// Rename to ISO9995 compliant . +// [1995/06/26 20:23:07 William_Walker] +// +// Revision 1.1.2.3 1995/06/09 20:54:36 William_Walker +// Add VT105 layout support and ISO group support +// [1995/06/09 20:40:38 William_Walker] +// +// Revision 1.1.2.2 1995/06/05 19:21:16 William_Walker +// New file. I love keymaps. +// [1995/06/05 18:05:43 William_Walker] +// +// EndLog +// +// @(#)RCSfile: lk,v Revision: 1.2 (DEC) Date: 1996/01/24 12:16:00 +// +xkb_geometry "lk201" { + width = 530; + height = 170; + shape.cornerRadius = 1; + + shape "NORM" { { [18,19] }, { [3,2], [15,16] } }; + shape "RTRN" { + approx = { [0,0],[23,19] }, + { [0,0], [23,0], [23,39], [5,39], [5,19], [0,19] }, + { [3,2], [20,2], [20,36], [8,36], [8,16], [3,16] } + }; + shape "LONG" { { [37,19] }, { [3,2], [34,16] } }; + shape "TALL" { { [18,39] }, { [3,2], [15,36] } }; + shape "MED" { { [28,19] }, { [3,2], [25,16] } }; + shape "CAPS" { { [28,19] }, { [3,2], [18,16] } }; + shape "SPCE" { { [171,19] },{ [3,2], [168,16]} }; + shape "LEDS" { [ 30,15] }; + shape "LED" { [ 5, 2] }; + + section.left= 27; + row.left = 1; + key.shape = "NORM"; + key.gap = 1; + + section "Function" { top = 20; + row { top = 1; + keys { , , , , , + { , 19 }, , , , , + { , 19 }, , , , + { , 98 }, , , + }; + }; + }; + + section "Editing" { top = 20; left = 350; + row { top = 1; + keys { , { , "LONG" } }; + }; + row { top = 41; + keys { , , }; + }; + row { top = 61; + keys { , , }; + }; + row { top = 81; left = 20; + keys { }; + }; + row { top = 101; + keys { , , }; + }; + }; + + section "Keypad" { top = 60; left = 426; + row { top = 1; + keys { , , , }; + }; + row { top = 21; + keys { , , , }; + }; + row { top = 41; + keys { , , , }; + }; + row { top = 61; + keys { , , , { , "TALL" } }; + }; + row { top = 81; + keys { { , "LONG" }, }; + }; + }; + + section "Alpha" { top = 60; + row { top = 1; left = 15; + keys { , + , , , , , , + , , , , , , + { , "MED" } + }; + }; + row { top = 21; left = 15; + keys { { , "MED" }, + , , , , , , + , , , , , , + { , "RTRN" } + }; + + }; + row { top = 41; + keys { , + { , "CAPS" }, + , , , , , , + , , , , , + }; + }; + row { top = 61; + keys { { , "LONG" }, + , , , , , , + , , , , , + { , "LONG" } + }; + }; + row { top = 81; left = 26; + keys { { , "LONG" }, + { , "SPCE" } + }; + }; + }; + + section.left = 341; + section.top = 3; + + section "Indicators" { + indicator.onColor = "#00ff00"; + indicator.offColor= "#001000"; + indicator.top = 10; + indicator.shape= "LED"; + indicator "Scroll Lock" { left = 9; }; + indicator "Caps Lock" { left = 27; }; + indicator "Compose" { left = 45; }; + indicator "Wait" { left = 63; }; + text.top = 4; + text.color = "black"; + text "HoldScreenLabel" {left = 5; text="Hold\n"; }; + text "CapsLockLabel" {left = 23; text="Lock\n"; }; + text "ComposeLabel" {left = 37; text="Compose\n"; }; + text "WaitLabel" {left = 60; text="Wait\n"; }; + }; +}; + +xkb_geometry "lk401" { + + width = 480; + height = 180; + shape.cornerRadius = 1; + + shape "NORM" { { [18,19] }, { [3,2], [15,16] } }; + shape "RTRN" { + approx = { [0,0],[23,19] }, + { [0,0], [23,0], [23,39], [5,39], [5,19], [0,19] }, + { [3,2], [20,2], [20,36], [8,36], [8,16], [3,16] } + }; + shape "LONG" { { [37,19] }, { [3,2], [34,16] } }; + shape "TALL" { { [18,39] }, { [3,2], [15,36] } }; + shape "MED" { { [28,19] }, { [3,2], [25,16] } }; + shape "CAPS" { { [28,19] }, { [3,2], [18,16] } }; + shape "SPCE" { { [131,19] },{ [3,2], [128,16]} }; + shape "LEDS" { [ 36,15] }; + shape "LED" { [ 5, 2] }; + + section.left= 17; + row.left = 1; + key.shape = "NORM"; + key.gap = 1; + + text "Logo" {left = 20; top = 10; text="digital\n"; }; + + section "Function" { top = 20; + row { top = 1; + keys { , , , , , + { , 15 }, , , , , + { , 15 }, , , , + { , 75 }, , , + }; + }; + }; + + section "Editing" { top = 20; left = 320; + row { top = 1; + keys { , { , "LONG" } }; + }; + row { top = 41; + keys { , , }; + }; + row { top = 61; + keys { , , }; + }; + row { top = 81; left= 20; + keys { }; + }; + row { top = 101; + keys { , , }; + }; + }; + + section "Keypad" { top = 60; left = 385; + row { top = 1; + keys { , , , }; + }; + row { + top = 21; + keys { , , , }; + }; + row { top = 41; + keys { , , , }; + }; + row { top = 61; + keys { , , , { , "TALL" } }; + }; + row { top = 81; + keys { { , "LONG" }, }; + }; + }; + + section "Alpha" { top = 60; + row { top = 1; left = 15; + keys { , + , , , , , , + , , , , , , + { , "MED" } + }; + }; + row { top = 21; left = 15; + keys { { , "MED" }, + , , , , , , + , , , , , , + { , "RTRN" } + }; + + }; + row { top = 41; + keys { , + { , "CAPS" }, + , , , , , , + , , , , , + }; + }; + row { top = 61; + keys { { , "LONG" }, + , , , , , , + , , , , , + { , "LONG" } + }; + }; + row { top = 81; left = 29; + keys { { , "MED" }, + { , "MED" }, + { , "SPCE" }, + { , "MED" }, + { , "MED" } + }; + }; + }; + + section.left = 69; + section.top = 3; + section "Indicators" { + solid "led_panel" { top = 0; left = 0; + cornerRadius = 1; + shape = "LEDS"; + color = "grey"; + }; + indicator.onColor = "#00ff00"; + indicator.offColor= "#001000"; + indicator.shape = "LED"; + indicator.top = 1; + indicator "Scroll Lock" { left = 3; }; + indicator "Caps Lock" { left = 22; }; + }; + section "IndicatorLabels" { + text.top = 4; + text.color = "black"; + text "ScrollLockLabel" {left = 3; text="Scroll\nLock"; }; + text "CapsLockLabel" {left = 22; text="Caps\nLock"; }; + }; +}; + +xkb_geometry "lk450" { + + width = 480; + height = 180; + shape.cornerRadius = 1; + + shape "NORM" { { [18,19] }, { [3,2], [15,16] } }; + shape "RTRN" { + approx = { [0,0],[23,19] }, + { [0,0], [23,0], [23,39], [5,39], [5,19], [0,19] }, + { [3,2], [20,2], [20,36], [8,36], [8,16], [3,16] } + }; + shape "LONG" { { [37,19] }, { [3,2], [34,16] } }; + shape "TALL" { { [18,39] }, { [3,2], [15,36] } }; + shape "MED" { { [28,19] }, { [3,2], [25,16] } }; + shape "CAPS" { { [28,19] }, { [3,2], [18,16] } }; + shape "SPCE" { { [131,19] },{ [3,2], [128,16]} }; + shape "LEDS" { [ 36,15] }; + shape "LED" { [ 5, 2] }; + + section.left= 17; + row.left = 1; + key.shape = "NORM"; + key.gap = 1; + + text "Logo" {left = 20; top = 10; text="digital\n"; }; + + section "Function" { top = 20; + row { top = 1; + keys { , , , , , + { , 15 }, , , , , + { , 15 }, , , , + { , 75 }, , , + }; + }; + }; + + section "Editing" { top = 20; left = 320; + row { top = 1; + keys { , { , "LONG" } }; + }; + row { top = 41; + keys { , , }; + }; + row { top = 61; + keys { , , }; + }; + row { top = 81; left= 20; + keys { }; + }; + row { top = 101; + keys { , , }; + }; + }; + + section "Keypad" { top = 60; left = 385; + row { top = 1; + keys { , , , }; + }; + row { + top = 21; + keys { , , , }; + }; + row { top = 41; + keys { , , , }; + }; + row { top = 61; + keys { , , , { , "TALL" } }; + }; + row { top = 81; + keys { { , "LONG" }, }; + }; + }; + + section "Alpha" { top = 60; + row { top = 1; left = 15; + keys { , + , , , , , , + , , , , , , + { , "MED" } + }; + }; + row { top = 21; left = 15; + keys { { , "MED" }, + , , , , , , + , , , , , , + { , "RTRN" } + }; + + }; + row { top = 41; + keys { , + { , "CAPS" }, + , , , , , , + , , , , , + }; + }; + row { top = 61; + keys { { , "LONG" }, + , , , , , , + , , , , , + { , "LONG" } + }; + }; + row { top = 81; left = 29; + keys { { , "MED" }, + { , "MED" }, + { , "SPCE" }, + { , "MED" }, + { , "MED" } + }; + }; + }; + + section.left = 69; + section.top = 3; + section "Indicators" { + solid "led_panel" { top = 0; left = 0; + cornerRadius = 1; + shape = "LEDS"; + color = "grey"; + }; + indicator.onColor = "#00ff00"; + indicator.offColor= "#001000"; + indicator.shape = "LED"; + indicator.top = 1; + indicator "Scroll Lock" { left = 3; }; + indicator "Caps Lock" { left = 22; }; + }; + section "IndicatorLabels" { + text.top = 4; + text.color = "black"; + text "ScrollLockLabel" {left = 3; text="Scroll\nLock"; }; + text "CapsLockLabel" {left = 22; text="Caps\nLock"; }; + }; +}; + +xkb_geometry "lk401bj" +{ + width = 480; + height = 180; + shape.cornerRadius = 1; + + shape "NORM" { { [18,19] }, { [3,2], [15,16] } }; + shape "RTRN" { + approx = { [0,0],[23,19] }, + { [0,0], [23,0], [23,39], [5,39], [5,19], [0,19] }, + { [3,2], [20,2], [20,36], [8,36], [8,16], [3,16] } + }; + shape "LONG" { { [37,19] }, { [3,2], [34,16] } }; + shape "TALL" { { [18,39] }, { [3,2], [15,36] } }; + shape "MED" { { [28,19] }, { [3,2], [25,16] } }; + shape "CAPS" { { [28,19] }, { [3,2], [18,16] } }; + shape "SPCE" { { [131,19] },{ [3,2], [128,16]} }; + shape "LEDS" { [ 30,15] }; + shape "LED" { [ 5, 2] }; + + section.left= 17; + row.left = 1; + key.shape = "NORM"; + key.gap = 1; + + text "Logo" {left = 20; top = 10; text="digital\n"; }; + + section "Function" { top = 20; + row { top = 1; + keys { , , , , , + { , 15 }, , , , , + { , 15 }, , , , + { , 75 }, , , + }; + }; + }; + + section "Editing" { top = 20; left = 320; + row { top = 1; + keys { , { , "LONG" } }; + }; + row { top = 41; + keys { , , }; + }; + row { top = 61; + keys { , , }; + }; + row { top = 81; left = 20; + keys { }; + }; + row { top = 101; + keys { , , }; + }; + }; + + section "Keypad" { top = 60; left = 385; + row { top = 1; + keys { , , , }; + }; + row { top = 21; + keys { , , , }; + }; + row { top = 41; + keys { , , , }; + }; + row { top = 61; + keys { , , , { , "TALL" } }; + }; + row { top = 81; + keys { { , "LONG" }, }; + }; + }; + + section "Alpha" { top = 60; + row { top = 1; left = 15; + keys { , + , , , , , , + , , , , , , + { , "MED" } + }; + }; + row { top = 21; left = 15; + keys { { , "MED" }, + , , , , , , + , , , , , , + { , "RTRN" } + }; + }; + row { top = 41; + keys { , + { , "CAPS" }, + , , , , , , + , , , , , + }; + }; + row { top = 61; + keys { { , "LONG" }, + , , , , , , + , , , , , + { , "LONG" } + }; + }; + row { top = 81; left = 29; + keys { { , "MED" }, + { , "MED" }, + { , "SPCE" }, + { , "MED" }, + { , "MED" } + }; + }; + }; + + section.left = 69; + section.top = 3; + + section "Indicators" { + solid "led_panel" { top = 0; left = 0; + cornerRadius = 1; + shape = "LEDS"; + color = "grey"; + }; + indicator.onColor = "#00ff00"; + indicator.offColor= "#001000"; + indicator.top = 1; + indicator.shape= "LED"; + indicator "Scroll Lock" { left = 3; }; + indicator "Caps Lock" { left = 22; }; + text.top = 4; + text.color = "black"; + text "ScrollLockLabel" {left = 3; text="Scroll\nLock"; }; + text "CapsLockLabel" {left = 19; text="Caps\nLock"; }; + }; +}; + +xkb_geometry "lk401jj" { + + width = 460; + height = 180; + shape.cornerRadius = 1; + + shape "NORM" { { [18,19] }, { [3,2], [15,16] } }; + shape "RTRN" { + approx = { [0,0],[28,23] }, + { [0,0], [28,0], [28,39], [5,39], [5,19], [0,19] }, + { [3,2], [25,2], [25,36], [8,36], [8,16], [3,16] } + }; + shape "LONG" { { [37,19] }, { [3,2], [34,16] } }; + shape "LONG1" { { [32,19] }, { [3,2], [29,16] } }; + shape "TALL" { { [18,39] }, { [3,2], [15,36] } }; + shape "MED" { { [28,19] }, { [3,2], [25,16] } }; + shape "MED1" { { [23,19] }, { [3,2], [20,16] } }; + shape "CTRL" { { [43,19] }, { [3,2], [38,16] } }; + shape "SPCE" { { [55,19] },{ [3,2], [53,16]} }; + shape "LEDS" { [ 56,15] }; + shape "LED" { [ 5, 2] }; + + section.left = 5; + row.left = 1; + key.shape = "NORM"; + key.gap = 1; + + text "Logo" {left = 7; top = 10; text="digital\n"; }; + + section "Function" { top = 40; + row { top = 1; + keys { , , , , , + { , 18 }, , , , , + { , 18 }, , , , + { , 73 }, , , + }; + }; + }; + + section "Editing" { top = 40; left = 313; + row { top = 1; + keys { , { , "LONG" } }; + }; + row { top = 31; + keys { , , }; + }; + row { top = 51; + keys { , , }; + }; + row { top = 71; left= 20; + keys { }; + }; + row { top = 91; + keys { , , }; + }; + }; + + section "Keypad" { top = 70; left = 377; + row { top = 1; + keys { , , , }; + }; + row { top = 21; + keys { , , , }; + }; + row { top = 41; + keys { , , , }; + }; + row { top = 61; + keys { , , , { , "TALL" } }; + }; + row { top = 81; + keys { { , "LONG" }, }; + }; + }; + + section "Alpha" { top = 70; + row { top = 1; left = 7; + keys { { , "MED1" }, + , , , , , , + , , , , , , + , { , "MED1" } + }; + }; + row { top = 21; left = 7; + keys { { , "LONG1" }, + , , , , , , + , , , , , , + { , "RTRN" } + }; + }; + row { top = 41; + keys { { , "CTRL" }, + , , , , , , + , , , , , + }; + }; + row { top = 61; + keys { , { , "LONG1" }, + , , , , , + , , , , , + , { , "MED" } + }; + }; + row { top = 81; left = 7; + keys { { , "LONG" }, + { , "LONG" }, + { , "LONG" }, + { , "SPCE" }, + { , "LONG" }, + { , "LONG" }, + , + }; + }; + }; + + section.left = 315; + section.top = 20; + + section "Indicators" { + solid "led_panel" { top = 0; left = 0; + cornerRadius = 1; + shape = "LEDS"; + color = "grey"; + }; + indicator.onColor = "#00ff00"; + indicator.offColor= "#001000"; + indicator.top = 11; + indicator.shape= "LED"; + indicator "Scroll Lock" { left = 6; }; + indicator "Caps Lock" { left = 26; }; + text.top = 4; + text.color = "black"; + text "ScrollLockLabel" {left = 3; text="Scroll\nLock"; }; + text "CapsLockLabel" {left = 22; text="Caps\nLock"; }; + }; +}; diff --git a/xorg-server/xkeyboard-config/geometry/digital_vndr/pc b/xorg-server/xkeyboard-config/geometry/digital_vndr/pc index ad4ffc655..45589fca0 100644 --- a/xorg-server/xkeyboard-config/geometry/digital_vndr/pc +++ b/xorg-server/xkeyboard-config/geometry/digital_vndr/pc @@ -1,350 +1,349 @@ -// $Xorg: pc,v 1.3 2000/08/17 19:54:36 cpqbld Exp $ -// -//Copyright (c) 1996 Digital Equipment Corporation -// -//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. -// -// HISTORY -// Log: pc,v -// Revision 1.2 1996/06/18 09:12:50 erik -// use flags correctly, assorted cleanups and consortium fixes -// -// Revision 1.1.6.2 1995/08/18 21:15:18 William_Walker -// Upgrade XKB to Protocol Rev. 0.64 -// [1995/08/18 20:41:49 William_Walker] -// -// Revision 1.1.2.4 1995/08/11 19:35:48 William_Walker -// Sync up with Erik's pool. -// [1995/08/11 18:36:03 William_Walker] -// -// Revision 1.1.2.3 1995/06/27 12:17:29 William_Walker -// Rename to ISO9995 compliant . -// [1995/06/26 20:23:10 William_Walker] -// -// Revision 1.1.2.2 1995/06/05 19:21:19 William_Walker -// New file. I love keymaps. -// [1995/06/05 18:05:51 William_Walker] -// -// EndLog -// -// @(#)RCSfile: pc,v Revision: 1.2 (DEC) Date: 1996/02/02 14:40:25 -// -partial xkb_geometry "common" { - width = 480; - height = 200; - - shape.cornerRadius = 1; - shape "NORM" { primary = { [18,19] }, { [3,2], [15,16] } }; - shape "KP0" { primary = { [37,19] }, { [3,2], [34,16] } }; - shape "KPAD" { primary = { [18,39] }, { [3,2], [15,36] } }; - shape "LEDS" { [78,22] }; - shape "LED" { [5,2] }; - - text.color = "black"; - section.left = 17; - row.left = 1; - key.shape = "NORM"; - key.gap = 1; - - section "Function" { top = 40; - row { top = 1; - keys { , - { , 20 }, , , , - { , 10 }, , , , - { , 10 }, , , - }; - }; - }; - - section "Editing" { top = 40; left = 308; - row { top = 1; - keys { , , }; - }; - row { top = 41; - keys { , , }; - }; - row { top = 61; - keys { , , }; - }; - row { top = 101; left = 20; - keys { }; - }; - row { top = 121; - keys { , , }; - }; - }; - - section "Keypad" { top = 80; left = 374; - row { top = 1; - keys { , , , }; - }; - row { top = 21; - keys { , , , { , "KPAD" } }; - }; - row { top = 41; - keys { , , }; - }; - row { top = 61; - keys { , , , { , "KPAD" } }; - }; - row { top = 81; - keys { { , "KP0" }, }; - }; - }; -}; - -partial xkb_geometry "leds_on_keys" { - section.top = 40; - section.left = 17; - section "LedPanel" { - indicator.onColor = "#00ff00"; - indicator.offColor = "#001000"; - indicator.shape = "LED"; - indicator "Scroll Lock" { left = 317; top = 5; }; - indicator "Num Lock" { left = 364; top = 45; }; - indicator "Caps Lock" { left = 10; top = 85; }; - }; - - section.left = 375; - section.top = 40; - section "LogoPanel" { - solid "logo_panel" { top = 0; left = 0; - shape = "LEDS"; - color = "grey"; - }; - text "Logo" {left = 28; top = 10; text="digital\n"; }; - }; -}; - -partial xkb_geometry "leds_alone" { - section.left = 375; - section.top = 40; - section "Indicators" { - solid "led_panel" { top = 0; left = 0; - shape = "LEDS"; - color = "grey"; - }; - indicator.top = 16; - indicator.onColor = "#00ff00"; - indicator.offColor = "#001000"; - indicator.shape = "LED"; - indicator "Num Lock" { left = 3; }; - indicator "Caps Lock" { left = 26; }; - indicator "Scroll Lock" { left = 50; }; - text "Logo" {left = 2; top = 3; text="digital\n"; }; - }; - section "IndicatorLabels" { - text.top = 11; - text "NumLockLabel" {left = 10; text="Num\nLock"; }; - text "CapsLockLabel" {left = 33; text="Caps\nLock"; }; - text "ScrollLockLabel" {left = 58; text="Scroll\nLock"; }; - }; -}; - -xkb_geometry "pc101" { - include "digital_vndr/pc(common)" - - shape.cornerRadius = 1; - shape "BKSP" { primary = { [36,19] }, { [3,2], [33,16] } }; - shape "TABK" { primary = { [27,19] }, { [3,2], [24,16] } }; - shape "RTRN" { primary = { [41,19] }, { [3,2], [38,16] } }; - shape "CAPS" { primary = { [32,19] }, { [3,2], [29,16] } }; - shape "LFSH" { primary = { [41,19] }, { [3,2], [38,16] } }; - shape "RTSH" { primary = { [51,19] }, { [3,2], [49,16] } }; - shape "MODK" { primary = { [27,19] }, { [3,2], [24,16] } }; - shape "BKSL" { primary = { [27,19] }, { [3,2], [24,16] } }; - shape "SPCE" { primary = { [132,19] },{ [3,2], [129,16]} }; - - section.left = 17; - row.left = 1; - key.shape = "NORM"; - key.gap = 1; - - section "Alpha" { top = 80; - row { top = 1; - keys { , - , , , , , , - , , , , , , - { , "BKSP" } - }; - }; - row { top = 21; - keys { { , "TABK" }, - , , , , , , - , , , , , , - { , "BKSL" } - }; - - }; - row { top = 41; - keys { { , "CAPS" }, - , , , , , , - , , , , , - { , "RTRN" } - }; - }; - row { top = 61; - keys { { , "LFSH" }, - , , , , , , - , , , , - { , "RTSH" } - }; - }; - row { top = 81; - key.shape = "MODK"; - keys { , - { , 20 }, - { , "SPCE" }, - , - { , 21 } - }; - }; - }; -}; - -xkb_geometry "pc102" { - include "digital_vndr/pc(common)" - - shape.cornerRadius = 1; - shape "BKSP" { primary = { [36,19] }, { [3,2], [33,16] } }; - shape "TABK" { primary = { [27,19] }, { [3,2], [24,16] } }; - shape "RTRN" { - approx = { [0,0],[28,19] }, - { [0,0], [27,0], [27,39], [5,39], [5,19], [0,19] }, - { [3,2], [24,2], [24,36], [8,36], [8,16], [3,16] } - }; - shape "CAPS" { primary = { [32,19] }, { [3,2], [29,16] } }; - shape "LFSH" { primary = { [22,19] }, { [3,2], [19,16] } }; - shape "RTSH" { primary = { [51,19] }, { [3,2], [49,16] } }; - shape "MODK" { primary = { [27,19] }, { [3,2], [24,16] } }; - shape "BKSL" { primary = { [27,19] }, { [3,2], [24,16] } }; - shape "SPCE" { primary = { [132,19] },{ [3,2], [129,16]} }; - - section.left = 17; - row.left = 1; - key.shape = "NORM"; - key.gap = 1; - - section "Alpha" { top = 80; - row { top = 1; - keys { , - , , , , , , - , , , , , , - { , "BKSP" } - }; - }; - row { top = 21; - keys { { , "TABK" }, - , , , , , , - , , , , , , - { , "RTRN" } - }; - - }; - row { top = 41; - keys { { , "CAPS" }, - , , , , , , - , , , , , - }; - }; - row { top = 61; - keys { { , "LFSH" }, - , , , , , , - , , , , , - { , "RTSH" } - }; - }; - row { top = 81; - key.shape = "MODK"; - keys { , - { , 20 }, - { , "SPCE" }, - , - { , 21 } - }; - }; - }; -}; - -xkb_geometry "pcxaj" { - include "digital_vndr/pc(common)" - - shape.cornerRadius = 1; - shape "BKSP" { primary = { [36,19] }, { [3,2], [33,16] } }; - shape "TABK" { primary = { [27,19] }, { [3,2], [24,16] } }; - shape "RTRN" { primary = { [22,19] }, { [3,2], [19,16] } }; - shape "CAPS" { primary = { [32,19] }, { [3,2], [29,16] } }; - shape "LFSH" { primary = { [41,19] }, { [3,2], [38,16] } }; - shape "RTSH" { primary = { [32,19] }, { [3,2], [29,16] } }; - shape "MODK" { primary = { [27,19] }, { [3,2], [24,16] } }; - shape "BKSL" { primary = { [27,19] }, { [3,2], [24,16] } }; - shape "SPCE" { primary = { [114,19]}, { [3,2], [111,16]} }; - - section.left = 17; - row.left = 1; - key.shape = "NORM"; - key.gap = 1; - - section "Alpha" { top = 80; - row { top = 1; - keys { , - , , , , , , - , , , , , , - { , "BKSP" } - }; - }; - row { top = 21; - keys { { , "TABK" }, - , , , , , , - , , , , , , - { , "BKSL" } - }; - }; - row { top = 41; - keys { { , "CAPS" }, - , , , , , , - , , , , , , - { , "RTRN" } - }; - }; - row { top = 61; - keys { { , "LFSH" }, - , , , , , , - , , , , , - { , "RTSH" } - }; - }; - row { top = 81; - key.shape = "MODK"; - keys { , , - { , "NORM" }, - { , "SPCE" }, - { , "NORM" }, - { , "NORM" }, - , - }; - }; - }; -}; +// +//Copyright (c) 1996 Digital Equipment Corporation +// +//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. +// +// HISTORY +// Log: pc,v +// Revision 1.2 1996/06/18 09:12:50 erik +// use flags correctly, assorted cleanups and consortium fixes +// +// Revision 1.1.6.2 1995/08/18 21:15:18 William_Walker +// Upgrade XKB to Protocol Rev. 0.64 +// [1995/08/18 20:41:49 William_Walker] +// +// Revision 1.1.2.4 1995/08/11 19:35:48 William_Walker +// Sync up with Erik's pool. +// [1995/08/11 18:36:03 William_Walker] +// +// Revision 1.1.2.3 1995/06/27 12:17:29 William_Walker +// Rename to ISO9995 compliant . +// [1995/06/26 20:23:10 William_Walker] +// +// Revision 1.1.2.2 1995/06/05 19:21:19 William_Walker +// New file. I love keymaps. +// [1995/06/05 18:05:51 William_Walker] +// +// EndLog +// +// @(#)RCSfile: pc,v Revision: 1.2 (DEC) Date: 1996/02/02 14:40:25 +// +partial xkb_geometry "common" { + width = 480; + height = 200; + + shape.cornerRadius = 1; + shape "NORM" { primary = { [18,19] }, { [3,2], [15,16] } }; + shape "KP0" { primary = { [37,19] }, { [3,2], [34,16] } }; + shape "KPAD" { primary = { [18,39] }, { [3,2], [15,36] } }; + shape "LEDS" { [78,22] }; + shape "LED" { [5,2] }; + + text.color = "black"; + section.left = 17; + row.left = 1; + key.shape = "NORM"; + key.gap = 1; + + section "Function" { top = 40; + row { top = 1; + keys { , + { , 20 }, , , , + { , 10 }, , , , + { , 10 }, , , + }; + }; + }; + + section "Editing" { top = 40; left = 308; + row { top = 1; + keys { , , }; + }; + row { top = 41; + keys { , , }; + }; + row { top = 61; + keys { , , }; + }; + row { top = 101; left = 20; + keys { }; + }; + row { top = 121; + keys { , , }; + }; + }; + + section "Keypad" { top = 80; left = 374; + row { top = 1; + keys { , , , }; + }; + row { top = 21; + keys { , , , { , "KPAD" } }; + }; + row { top = 41; + keys { , , }; + }; + row { top = 61; + keys { , , , { , "KPAD" } }; + }; + row { top = 81; + keys { { , "KP0" }, }; + }; + }; +}; + +partial xkb_geometry "leds_on_keys" { + section.top = 40; + section.left = 17; + section "LedPanel" { + indicator.onColor = "#00ff00"; + indicator.offColor = "#001000"; + indicator.shape = "LED"; + indicator "Scroll Lock" { left = 317; top = 5; }; + indicator "Num Lock" { left = 364; top = 45; }; + indicator "Caps Lock" { left = 10; top = 85; }; + }; + + section.left = 375; + section.top = 40; + section "LogoPanel" { + solid "logo_panel" { top = 0; left = 0; + shape = "LEDS"; + color = "grey"; + }; + text "Logo" {left = 28; top = 10; text="digital\n"; }; + }; +}; + +partial xkb_geometry "leds_alone" { + section.left = 375; + section.top = 40; + section "Indicators" { + solid "led_panel" { top = 0; left = 0; + shape = "LEDS"; + color = "grey"; + }; + indicator.top = 16; + indicator.onColor = "#00ff00"; + indicator.offColor = "#001000"; + indicator.shape = "LED"; + indicator "Num Lock" { left = 3; }; + indicator "Caps Lock" { left = 26; }; + indicator "Scroll Lock" { left = 50; }; + text "Logo" {left = 2; top = 3; text="digital\n"; }; + }; + section "IndicatorLabels" { + text.top = 11; + text "NumLockLabel" {left = 10; text="Num\nLock"; }; + text "CapsLockLabel" {left = 33; text="Caps\nLock"; }; + text "ScrollLockLabel" {left = 58; text="Scroll\nLock"; }; + }; +}; + +xkb_geometry "pc101" { + include "digital_vndr/pc(common)" + + shape.cornerRadius = 1; + shape "BKSP" { primary = { [36,19] }, { [3,2], [33,16] } }; + shape "TABK" { primary = { [27,19] }, { [3,2], [24,16] } }; + shape "RTRN" { primary = { [41,19] }, { [3,2], [38,16] } }; + shape "CAPS" { primary = { [32,19] }, { [3,2], [29,16] } }; + shape "LFSH" { primary = { [41,19] }, { [3,2], [38,16] } }; + shape "RTSH" { primary = { [51,19] }, { [3,2], [49,16] } }; + shape "MODK" { primary = { [27,19] }, { [3,2], [24,16] } }; + shape "BKSL" { primary = { [27,19] }, { [3,2], [24,16] } }; + shape "SPCE" { primary = { [132,19] },{ [3,2], [129,16]} }; + + section.left = 17; + row.left = 1; + key.shape = "NORM"; + key.gap = 1; + + section "Alpha" { top = 80; + row { top = 1; + keys { , + , , , , , , + , , , , , , + { , "BKSP" } + }; + }; + row { top = 21; + keys { { , "TABK" }, + , , , , , , + , , , , , , + { , "BKSL" } + }; + + }; + row { top = 41; + keys { { , "CAPS" }, + , , , , , , + , , , , , + { , "RTRN" } + }; + }; + row { top = 61; + keys { { , "LFSH" }, + , , , , , , + , , , , + { , "RTSH" } + }; + }; + row { top = 81; + key.shape = "MODK"; + keys { , + { , 20 }, + { , "SPCE" }, + , + { , 21 } + }; + }; + }; +}; + +xkb_geometry "pc102" { + include "digital_vndr/pc(common)" + + shape.cornerRadius = 1; + shape "BKSP" { primary = { [36,19] }, { [3,2], [33,16] } }; + shape "TABK" { primary = { [27,19] }, { [3,2], [24,16] } }; + shape "RTRN" { + approx = { [0,0],[28,19] }, + { [0,0], [27,0], [27,39], [5,39], [5,19], [0,19] }, + { [3,2], [24,2], [24,36], [8,36], [8,16], [3,16] } + }; + shape "CAPS" { primary = { [32,19] }, { [3,2], [29,16] } }; + shape "LFSH" { primary = { [22,19] }, { [3,2], [19,16] } }; + shape "RTSH" { primary = { [51,19] }, { [3,2], [49,16] } }; + shape "MODK" { primary = { [27,19] }, { [3,2], [24,16] } }; + shape "BKSL" { primary = { [27,19] }, { [3,2], [24,16] } }; + shape "SPCE" { primary = { [132,19] },{ [3,2], [129,16]} }; + + section.left = 17; + row.left = 1; + key.shape = "NORM"; + key.gap = 1; + + section "Alpha" { top = 80; + row { top = 1; + keys { , + , , , , , , + , , , , , , + { , "BKSP" } + }; + }; + row { top = 21; + keys { { , "TABK" }, + , , , , , , + , , , , , , + { , "RTRN" } + }; + + }; + row { top = 41; + keys { { , "CAPS" }, + , , , , , , + , , , , , + }; + }; + row { top = 61; + keys { { , "LFSH" }, + , , , , , , + , , , , , + { , "RTSH" } + }; + }; + row { top = 81; + key.shape = "MODK"; + keys { , + { , 20 }, + { , "SPCE" }, + , + { , 21 } + }; + }; + }; +}; + +xkb_geometry "pcxaj" { + include "digital_vndr/pc(common)" + + shape.cornerRadius = 1; + shape "BKSP" { primary = { [36,19] }, { [3,2], [33,16] } }; + shape "TABK" { primary = { [27,19] }, { [3,2], [24,16] } }; + shape "RTRN" { primary = { [22,19] }, { [3,2], [19,16] } }; + shape "CAPS" { primary = { [32,19] }, { [3,2], [29,16] } }; + shape "LFSH" { primary = { [41,19] }, { [3,2], [38,16] } }; + shape "RTSH" { primary = { [32,19] }, { [3,2], [29,16] } }; + shape "MODK" { primary = { [27,19] }, { [3,2], [24,16] } }; + shape "BKSL" { primary = { [27,19] }, { [3,2], [24,16] } }; + shape "SPCE" { primary = { [114,19]}, { [3,2], [111,16]} }; + + section.left = 17; + row.left = 1; + key.shape = "NORM"; + key.gap = 1; + + section "Alpha" { top = 80; + row { top = 1; + keys { , + , , , , , , + , , , , , , + { , "BKSP" } + }; + }; + row { top = 21; + keys { { , "TABK" }, + , , , , , , + , , , , , , + { , "BKSL" } + }; + }; + row { top = 41; + keys { { , "CAPS" }, + , , , , , , + , , , , , , + { , "RTRN" } + }; + }; + row { top = 61; + keys { { , "LFSH" }, + , , , , , , + , , , , , + { , "RTSH" } + }; + }; + row { top = 81; + key.shape = "MODK"; + keys { , , + { , "NORM" }, + { , "SPCE" }, + { , "NORM" }, + { , "NORM" }, + , + }; + }; + }; +}; diff --git a/xorg-server/xkeyboard-config/geometry/digital_vndr/unix b/xorg-server/xkeyboard-config/geometry/digital_vndr/unix index 2ca477e82..6c13d4326 100644 --- a/xorg-server/xkeyboard-config/geometry/digital_vndr/unix +++ b/xorg-server/xkeyboard-config/geometry/digital_vndr/unix @@ -1,230 +1,227 @@ -// $Xorg: unix,v 1.3 2000/08/17 19:54:36 cpqbld Exp $ -// -//Copyright (c) 1996 Digital Equipment Corporation -// -//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. -// -// HISTORY -// Log: unix,v -// Revision 1.2 1996/06/18 09:12:53 erik -// use flags correctly, assorted cleanups and consortium fixes -// -// Revision 1.1.2.3 1995/06/27 12:17:30 William_Walker -// Rename to ISO9995 compliant . -// [1995/06/26 20:23:12 William_Walker] -// -// Revision 1.1.2.2 1995/06/05 19:21:23 William_Walker -// New file. I love keymaps. -// [1995/06/05 18:05:56 William_Walker] -// -// EndLog -// -// @(#)RCSfile: unix,v Revision: 1.2 (DEC) Date: 1996/01/24 12:16: -// -xkb_geometry "unix" { - - width = 340; - height = 160; - shape.cornerRadius = 1; - - shape "NORM" { primary = { [18,19] }, { [3,2], [15,16] } }; - shape "AE00" { primary = { [28,19] }, { [3,2], [25,16] } }; - shape "BKSP" { primary = { [46,19] }, { [3,2], [43,16] } }; - shape "TABK" { primary = { [37,19] }, { [3,2], [34,16] } }; - shape "CTRL" { primary = { [46,19] }, { [3,2], [43,16] } }; - shape "RTRN" { primary = { [46,19] }, { [3,2], [43,16] } }; - shape "SHFT" { primary = { [56,19] }, { [3,2], [53,16] } }; - shape "MODK" { primary = { [37,19] }, { [3,2], [34,16] } }; - shape "SPCE" { primary = { [132,19] },{ [3,2], [129,16]} }; - - section.left= 17; - row.left = 1; - key.shape = "NORM"; - key.gap = 1; - - text.color = "black"; - text "Logo" {left = 20; top = 10; text="digital\n"; }; - - section "Function" { top = 30; - row { top = 1; - keys { , , , , , - { , 20 }, , , , , - { , 20 }, , , - }; - }; - }; - - section "Alpha" { top = 50; - row { top = 1; - keys { { , "AE00" }, - , , , , , , - , , , , , , - { , "BKSP" } - }; - }; - row { top = 21; - keys { { , "TABK" }, - , , , , , , - , , , , , , - , - }; - - }; - row { top = 41; left = -4; - keys { { , "CTRL" }, - , , , , , , - , , , , , - { , "RTRN" } - }; - }; - row { top = 61; left = -4; - keys { { , "SHFT" }, - , , , , , , - , , , , - { , "SHFT" } - }; - }; - solid "ExtendKey" { top = 81; left= 1; - shape= "NORM"; - color= "grey20"; - }; - text.top = 89; - text.color = "black"; - text "ExtendLabel" {left = 6; text="Ext\nend"; }; - row { top = 81; left = 19; - key.shape = "MODK"; - keys { { , "NORM" }, , - { , "SPCE" }, - , - }; - }; - }; -}; - -xkb_geometry "lk421jj" { - - width = 315; - height = 170; - shape.cornerRadius = 1; - - shape "NORM" { { [18,19] }, { [3,2], [15,16] } }; - shape "RTRN" { - approx = { [0,0],[28,23] }, - { [0,0], [28,0], [28,39], [5,39], [5,19], [0,19] }, - { [3,2], [25,2], [25,36], [8,36], [8,16], [3,16] } - }; - shape "LONG" { { [37,19] }, { [3,2], [34,16] } }; - shape "LONG1" { { [32,19] }, { [3,2], [29,16] } }; - shape "TALL" { { [18,39] }, { [3,2], [15,36] } }; - shape "MED" { { [23,19] }, { [3,2], [20,16] } }; - shape "CTRL" { { [43,19] }, { [3,2], [38,16] } }; - shape "SPCE" { { [55,19] },{ [3,2], [53,16]} }; - shape "LEDS" { [ 56,15] }; - shape "LED" { [ 5, 2] }; - - section.left = 5; - row.left = 1; - key.shape = "NORM"; - key.gap = 1; - - text "Logo" {left = 7; top = 10; text="digital\n"; }; - - section "Function" { top = 45; - row { top = 1; left = 7; - keys { , , , , , - { , 18 }, , , , - }; - }; - }; - - section "Editing" { top = 45; left= 230; - row { top = 1; - keys { , , , }; - }; - }; - - section "Alpha" { top = 65; - row { top = 1; left = 7; - keys { { , "MED" }, - , , , , , , - , , , , , , - , { , "MED" } - }; - }; - row { top = 21; left = 7; - keys { { , "LONG1" }, - , , , , , , - , , , , , , - { , "RTRN" } - }; - }; - row { top = 41; - keys { { , "CTRL" }, - , , , , , , - , , , , , - }; - }; - row { top = 61; - keys { , { , "LONG1" }, - , , , , , - , , , , , - , { , "LONG1" } - }; - }; - row { top = 81; left = 7; - keys { , , - { , "LONG" }, - { , "LONG" }, - { , "SPCE" }, - { , "LONG" }, - { , "LONG" }, - , - }; - }; - }; - - section.left = 233; - section.top = 20; - - section "Indicators" { - solid "led_panel" { top = 0; left = 0; - cornerRadius = 1; - shape = "LEDS"; - color = "grey"; - }; - indicator.onColor = "#00ff00"; - indicator.offColor= "#001000"; - indicator.top = 11; - indicator.shape= "LED"; - indicator "Scroll Lock" { left = 6; }; - indicator "Caps Lock" { left = 26; }; - text.top = 3; - text.color = "black"; - text "ScrollLockLabel" {left = 3; text="Scroll\nLock"; }; - text "CapsLockLabel" {left = 22; text="Caps\nLock"; }; - }; -}; - - +// +//Copyright (c) 1996 Digital Equipment Corporation +// +//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. +// +// HISTORY +// Log: unix,v +// Revision 1.2 1996/06/18 09:12:53 erik +// use flags correctly, assorted cleanups and consortium fixes +// +// Revision 1.1.2.3 1995/06/27 12:17:30 William_Walker +// Rename to ISO9995 compliant . +// [1995/06/26 20:23:12 William_Walker] +// +// Revision 1.1.2.2 1995/06/05 19:21:23 William_Walker +// New file. I love keymaps. +// [1995/06/05 18:05:56 William_Walker] +// +// EndLog +// +// @(#)RCSfile: unix,v Revision: 1.2 (DEC) Date: 1996/01/24 12:16: +// +xkb_geometry "unix" { + + width = 340; + height = 160; + shape.cornerRadius = 1; + + shape "NORM" { primary = { [18,19] }, { [3,2], [15,16] } }; + shape "AE00" { primary = { [28,19] }, { [3,2], [25,16] } }; + shape "BKSP" { primary = { [46,19] }, { [3,2], [43,16] } }; + shape "TABK" { primary = { [37,19] }, { [3,2], [34,16] } }; + shape "CTRL" { primary = { [46,19] }, { [3,2], [43,16] } }; + shape "RTRN" { primary = { [46,19] }, { [3,2], [43,16] } }; + shape "SHFT" { primary = { [56,19] }, { [3,2], [53,16] } }; + shape "MODK" { primary = { [37,19] }, { [3,2], [34,16] } }; + shape "SPCE" { primary = { [132,19] },{ [3,2], [129,16]} }; + + section.left= 17; + row.left = 1; + key.shape = "NORM"; + key.gap = 1; + + text.color = "black"; + text "Logo" {left = 20; top = 10; text="digital\n"; }; + + section "Function" { top = 30; + row { top = 1; + keys { , , , , , + { , 20 }, , , , , + { , 20 }, , , + }; + }; + }; + + section "Alpha" { top = 50; + row { top = 1; + keys { { , "AE00" }, + , , , , , , + , , , , , , + { , "BKSP" } + }; + }; + row { top = 21; + keys { { , "TABK" }, + , , , , , , + , , , , , , + , + }; + + }; + row { top = 41; left = -4; + keys { { , "CTRL" }, + , , , , , , + , , , , , + { , "RTRN" } + }; + }; + row { top = 61; left = -4; + keys { { , "SHFT" }, + , , , , , , + , , , , + { , "SHFT" } + }; + }; + solid "ExtendKey" { top = 81; left= 1; + shape= "NORM"; + color= "grey20"; + }; + text.top = 89; + text.color = "black"; + text "ExtendLabel" {left = 6; text="Ext\nend"; }; + row { top = 81; left = 19; + key.shape = "MODK"; + keys { { , "NORM" }, , + { , "SPCE" }, + , + }; + }; + }; +}; + +xkb_geometry "lk421jj" { + + width = 315; + height = 170; + shape.cornerRadius = 1; + + shape "NORM" { { [18,19] }, { [3,2], [15,16] } }; + shape "RTRN" { + approx = { [0,0],[28,23] }, + { [0,0], [28,0], [28,39], [5,39], [5,19], [0,19] }, + { [3,2], [25,2], [25,36], [8,36], [8,16], [3,16] } + }; + shape "LONG" { { [37,19] }, { [3,2], [34,16] } }; + shape "LONG1" { { [32,19] }, { [3,2], [29,16] } }; + shape "TALL" { { [18,39] }, { [3,2], [15,36] } }; + shape "MED" { { [23,19] }, { [3,2], [20,16] } }; + shape "CTRL" { { [43,19] }, { [3,2], [38,16] } }; + shape "SPCE" { { [55,19] },{ [3,2], [53,16]} }; + shape "LEDS" { [ 56,15] }; + shape "LED" { [ 5, 2] }; + + section.left = 5; + row.left = 1; + key.shape = "NORM"; + key.gap = 1; + + text "Logo" {left = 7; top = 10; text="digital\n"; }; + + section "Function" { top = 45; + row { top = 1; left = 7; + keys { , , , , , + { , 18 }, , , , + }; + }; + }; + + section "Editing" { top = 45; left= 230; + row { top = 1; + keys { , , , }; + }; + }; + + section "Alpha" { top = 65; + row { top = 1; left = 7; + keys { { , "MED" }, + , , , , , , + , , , , , , + , { , "MED" } + }; + }; + row { top = 21; left = 7; + keys { { , "LONG1" }, + , , , , , , + , , , , , , + { , "RTRN" } + }; + }; + row { top = 41; + keys { { , "CTRL" }, + , , , , , , + , , , , , + }; + }; + row { top = 61; + keys { , { , "LONG1" }, + , , , , , + , , , , , + , { , "LONG1" } + }; + }; + row { top = 81; left = 7; + keys { , , + { , "LONG" }, + { , "LONG" }, + { , "SPCE" }, + { , "LONG" }, + { , "LONG" }, + , + }; + }; + }; + + section.left = 233; + section.top = 20; + + section "Indicators" { + solid "led_panel" { top = 0; left = 0; + cornerRadius = 1; + shape = "LEDS"; + color = "grey"; + }; + indicator.onColor = "#00ff00"; + indicator.offColor= "#001000"; + indicator.top = 11; + indicator.shape= "LED"; + indicator "Scroll Lock" { left = 6; }; + indicator "Caps Lock" { left = 26; }; + text.top = 3; + text.color = "black"; + text "ScrollLockLabel" {left = 3; text="Scroll\nLock"; }; + text "CapsLockLabel" {left = 22; text="Caps\nLock"; }; + }; +}; diff --git a/xorg-server/xkeyboard-config/geometry/everex b/xorg-server/xkeyboard-config/geometry/everex index e70490680..8cc094760 100644 --- a/xorg-server/xkeyboard-config/geometry/everex +++ b/xorg-server/xkeyboard-config/geometry/everex @@ -1,172 +1,170 @@ -// $Xorg: everex,v 1.3 2000/08/17 19:54:35 cpqbld Exp $ -// -default xkb_geometry "STEPnote" { - - description= "Everex STEPnote"; - width= 281; - height= 150; - - shape.cornerRadius= 1; - - shape "NORM" { - { [17,17] }, - { [ 2, 1], [ 15, 15 ] } - }; - shape "NARR" { - { [ 15, 17 ] }, - { [ 2, 1 ], [ 13, 15 ] } - }; - shape "FKEY" { - { [ 15.1, 15.5 ] }, - { [ 1, 1 ], [ 14.1, 14.5 ] } - }; - shape "ESC" { - { [ 16.4, 15.5 ] }, - { [ 1, 1 ], [ 14.1, 14.5 ] } - }; - shape "WIDE" { // backspace, tab and Fn - { [ 25, 17 ] }, - { [ 2, 1 ], [ 23, 15 ] } - }; - shape "RTRN" { - { [ 27.5, 17 ] }, - { [ 2, 1 ], [ 25.5, 15 ] } - }; - shape "CAPS" { - { [ 30, 17 ] }, - { [ 2, 1 ], [ 28, 15 ] } - }; - shape "LFSH" { - { [ 38.5, 17 ] }, - { [ 2, 1 ], [ 36.5, 15 ] } - }; - shape "RTSH" { - { [ 21, 17 ] }, - { [ 2, 1 ], [ 19, 15 ] } - }; - shape "SPCE" { - { [ 88.8, 17 ] }, - { [ 2, 1 ], [ 86.8, 15 ] } - }; - shape "WELL" { - { [ 269, 105 ] } - }; - shape "LED" { - cornerRadius= 1.5, - { [ 3, 10 ] } - }; - - section.left= 6; - row.left= 1; - key.shape= "NORM"; - key.gap= 0.5; - - key.color= "grey20"; - labelColor= "white"; - baseColor= "grey20"; - - indicator.top= 20; - indicator.shape= "LED"; - indicator.onColor= "green"; - indicator.offColor= "green30"; - - indicator "Power" { left= 40; }; - indicator "Battery" { left=101; }; - indicator "Suspend" { left=112; }; - indicator "HardDrive" { left=123; }; - indicator "Floppy" { left=134; }; - indicator "KeyPad" { left=145; }; - indicator "Num Lock" { left=156; }; - indicator "Caps Lock" { left=167; }; - indicator "Scroll Lock" { left=178; }; - - solid "KeyWell" { - top= 35; - left= 6; - shape= "WELL"; - color= "grey10"; - }; - section "Whole" { - top= 35; - row { - top= 0.5; - key.color= "grey30"; - key.shape= "FKEY"; - keys { - { , "ESC" }, - , , , , , , - , , , , , , - , , , - }; - }; - row { - top= 16.5; - keys { - { , "NARR" }, - , , , , , , - , , , , , , - { , shape="WIDE", color="grey30" }, - { , shape="NARR", color="grey30" } - }; - }; - row { - top= 34; - keys { - { , shape="WIDE", color="grey30" }, - , , , , , , - , , , , , , - { , "NARR" }, - { , shape="NARR", color="grey30" } - }; - }; - row { - top= 51.5; - keys { - { , shape="CAPS", color="grey30" }, - , , , , , - , , , , , - , - { , shape="RTRN", color="grey30" }, - { , shape="NARR", color="grey30" } - }; - }; - row { - top= 69; - keys { - { , shape="LFSH", color="grey30" }, - , , , , , - , , , , , - { , shape="RTSH", color="grey30" }, - { , shape="NARR", color="grey30" }, - { , shape="NARR", color="grey30" } - }; - }; - row { - top= 86.5; - key.color= "grey30"; - keys { - { , "WIDE" }, - , , - { , shape="SPCE", 18, color="grey20" }, - , , , - { , "NARR" }, { , "NARR" }, - { , "NARR" } - }; - }; - solid "FakeKey" { - top= 86.5; - left= 62.1; - shape= "NORM"; - color= "grey20"; - }; - overlay "KPAD" { - =, =, =, =, - =, =, =, =, - =, =, =, =, - =, =, = - }; - }; // End of "Whole" section - - alias = ; - alias = ; -}; +default xkb_geometry "STEPnote" { + + description= "Everex STEPnote"; + width= 281; + height= 150; + + shape.cornerRadius= 1; + + shape "NORM" { + { [17,17] }, + { [ 2, 1], [ 15, 15 ] } + }; + shape "NARR" { + { [ 15, 17 ] }, + { [ 2, 1 ], [ 13, 15 ] } + }; + shape "FKEY" { + { [ 15.1, 15.5 ] }, + { [ 1, 1 ], [ 14.1, 14.5 ] } + }; + shape "ESC" { + { [ 16.4, 15.5 ] }, + { [ 1, 1 ], [ 14.1, 14.5 ] } + }; + shape "WIDE" { // backspace, tab and Fn + { [ 25, 17 ] }, + { [ 2, 1 ], [ 23, 15 ] } + }; + shape "RTRN" { + { [ 27.5, 17 ] }, + { [ 2, 1 ], [ 25.5, 15 ] } + }; + shape "CAPS" { + { [ 30, 17 ] }, + { [ 2, 1 ], [ 28, 15 ] } + }; + shape "LFSH" { + { [ 38.5, 17 ] }, + { [ 2, 1 ], [ 36.5, 15 ] } + }; + shape "RTSH" { + { [ 21, 17 ] }, + { [ 2, 1 ], [ 19, 15 ] } + }; + shape "SPCE" { + { [ 88.8, 17 ] }, + { [ 2, 1 ], [ 86.8, 15 ] } + }; + shape "WELL" { + { [ 269, 105 ] } + }; + shape "LED" { + cornerRadius= 1.5, + { [ 3, 10 ] } + }; + + section.left= 6; + row.left= 1; + key.shape= "NORM"; + key.gap= 0.5; + + key.color= "grey20"; + labelColor= "white"; + baseColor= "grey20"; + + indicator.top= 20; + indicator.shape= "LED"; + indicator.onColor= "green"; + indicator.offColor= "green30"; + + indicator "Power" { left= 40; }; + indicator "Battery" { left=101; }; + indicator "Suspend" { left=112; }; + indicator "HardDrive" { left=123; }; + indicator "Floppy" { left=134; }; + indicator "KeyPad" { left=145; }; + indicator "Num Lock" { left=156; }; + indicator "Caps Lock" { left=167; }; + indicator "Scroll Lock" { left=178; }; + + solid "KeyWell" { + top= 35; + left= 6; + shape= "WELL"; + color= "grey10"; + }; + section "Whole" { + top= 35; + row { + top= 0.5; + key.color= "grey30"; + key.shape= "FKEY"; + keys { + { , "ESC" }, + , , , , , , + , , , , , , + , , , + }; + }; + row { + top= 16.5; + keys { + { , "NARR" }, + , , , , , , + , , , , , , + { , shape="WIDE", color="grey30" }, + { , shape="NARR", color="grey30" } + }; + }; + row { + top= 34; + keys { + { , shape="WIDE", color="grey30" }, + , , , , , , + , , , , , , + { , "NARR" }, + { , shape="NARR", color="grey30" } + }; + }; + row { + top= 51.5; + keys { + { , shape="CAPS", color="grey30" }, + , , , , , + , , , , , + , + { , shape="RTRN", color="grey30" }, + { , shape="NARR", color="grey30" } + }; + }; + row { + top= 69; + keys { + { , shape="LFSH", color="grey30" }, + , , , , , + , , , , , + { , shape="RTSH", color="grey30" }, + { , shape="NARR", color="grey30" }, + { , shape="NARR", color="grey30" } + }; + }; + row { + top= 86.5; + key.color= "grey30"; + keys { + { , "WIDE" }, + , , + { , shape="SPCE", 18, color="grey20" }, + , , , + { , "NARR" }, { , "NARR" }, + { , "NARR" } + }; + }; + solid "FakeKey" { + top= 86.5; + left= 62.1; + shape= "NORM"; + color= "grey20"; + }; + overlay "KPAD" { + =, =, =, =, + =, =, =, =, + =, =, =, =, + =, =, = + }; + }; // End of "Whole" section + + alias = ; + alias = ; +}; diff --git a/xorg-server/xkeyboard-config/geometry/fujitsu b/xorg-server/xkeyboard-config/geometry/fujitsu index 02fe0bc20..1cc5dddca 100644 --- a/xorg-server/xkeyboard-config/geometry/fujitsu +++ b/xorg-server/xkeyboard-config/geometry/fujitsu @@ -1,315 +1,314 @@ -// $Xorg: fujitsu,v 1.4 2001/02/09 02:05:49 xorgcvs Exp $ -// -//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. -// -default xkb_geometry "138" { - - // This is an approximate layout for a (US/ASCII) Fujitsu keyboard. - - description= "Fujitsu English keyboard"; - - width= 480; - height= 215; - - shape "EDGE" { cornerRadius= 2, { [ 480, 215 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [ 25,17] } }; - shape "RTRN" { - approx = { [ 0, 0], [28,37] }, - { [ 0, 0], [28, 0], [28,37], - [ 5,37], [ 5,19], [ 0,19] }, - { [ 1, 1], [26, 1], [26,36], - [ 7,36], [ 7,18], [ 1,18] } - }; - shape "LFSH" { { [ 41,18] }, { [2,1], [ 39,17] } }; - shape "RTSH" { { [ 33,18] }, { [2,1], [ 31,17] } }; - shape "LCTL" { { [ 32,18] }, { [2,1], [ 30,17] } }; - shape "SPCE" { { [151,18] }, { [2,1], [149,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; - shape "KPEN" { { [ 18,37] }, { [2,1], [ 16,36] } }; - shape "EXEC" { { [ 57,18] }, { [2,1], [ 55,17] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 15; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - - section "Alpha" { - top= 28; - row { - top= 1; - keys { - , { , 6 }, - { , 30 }, , , , - { , 6 }, , , , - { , 6 }, , , , - { , 68 }, , , - }; - }; - row { - top= 20; - keys { - , { , 6 }, - { , 30 }, , , , - { , 6 }, , , , - { , 6 }, , , , - { , 6 }, , , - { , 6 }, , , - }; - }; - row { - top= 39; - left= 316; - keys { - , , - }; - }; - row { - top= 54; - keys { - , { , 6 }, - , , , , , - , , , , , - , , , , - { , 68 }, , , - - }; - }; - row { - top= 58; - left= 316; - keys { - , , - }; - }; - row { - top= 73; - keys { , - { , 6, "TABK" }, - , , , , , - , , , , , - , , { , "RTRN" }, - { , 68 }, , , - }; - }; - row { - top= 92; - keys { , - { , 6, "LCTL" }, - , , , , , - , , , , , - , , - { , 49 }, - { , 25 }, , , - }; - }; - row { - top= 102; - left= 316; - keys { , { , 19 } - }; - }; - row { - top= 111; - keys { , - { , 6 , "LFSH" }, - , , , , , - , , , , , - , { , "RTSH" }, - { , 25 }, - { , 25 }, , , { , "KPEN" } - }; - }; - row { - top= 130; - keys { , { , 6 }, - , , - { , "SPCE" }, - , , , , - { , 68, "KP0" }, - }; - }; - row { - top= 149; - left= 316; - keys { - { , "EXEC" } - }; - }; - }; // End of "Alpha" section -}; - -xkb_geometry "140" { - - // This is an approximate layout for a Fujitsu Japanese keyboard. - - description= "Fujitsu Japanese keyboard"; - - width= 480; - height= 215; - - shape "EDGE" { cornerRadius= 2, { [ 480, 215 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [ 25,17] } }; - shape "RTRN" { - approx = { [ 0, 0], [28,37] }, - { [ 0, 0], [28, 0], [28,37], - [ 5,37], [ 5,19], [ 0,19] }, - { [ 1, 1], [26, 1], [26,36], - [ 7,36], [ 7,18], [ 1,18] } - }; - shape "LFSH" { { [ 41,18] }, { [2,1], [ 39,17] } }; - shape "RTSH" { { [ 33,18] }, { [2,1], [ 31,17] } }; - shape "LCTL" { { [ 32,18] }, { [2,1], [ 30,17] } }; - shape "SPCE" { { [113,18] }, { [2,1], [111,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; - shape "KPEN" { { [ 18,37] }, { [2,1], [ 16,36] } }; - shape "HNKN" { { [ 23,18] }, { [2,1], [ 21,17] } }; - shape "EXEC" { { [ 57,18] }, { [2,1], [ 55,17] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 15; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - - section "Alpha" { - top= 28; - row { - top= 1; - keys { - , { , 6 }, - { , 30 }, , , , - { , 6 }, , , , - { , 6 }, , , , - { , 68 }, , , - }; - }; - row { - top= 20; - keys { - , { , 6 }, - { , 30 }, , , , - { , 6 }, , , , - { , 6 }, , , , - { , 6 }, , , - { , 6 }, , , - }; - }; - row { - top= 39; - left= 316; - keys { - , , - }; - }; - row { - top= 54; - keys { - , { , 6 }, - , , , , , - , , , , , - , , , , - { , 68 }, , , - - }; - }; - row { - top= 58; - left= 316; - keys { - , , - }; - }; - row { - top= 73; - keys { , - { , 6, "TABK" }, - , , , , , - , , , , , - , , { , "RTRN" }, - { , 68 }, , , - }; - }; - row { - top= 92; - keys { , - { , 6, "LCTL" }, - , , , , , - , , , , , - , , - { , 49 }, - { , 25 }, , , - }; - }; - row { - top= 102; - left= 316; - keys { , { , 19 } - }; - }; - row { - top= 111; - keys { , - { , 6 , "LFSH" }, - , , , , , - , , , , , - , { , "RTSH" }, - { , 25 }, - { , 25 }, , , { , "KPEN" } - }; - }; - row { - top= 130; - keys { , { , 6 }, - , , , - { , "SPCE" }, - , , , , , - { , 68, "KP0" }, - }; - }; - row { - top= 149; - left= 134; - keys { - { , "HNKN" }, { , "HNKN" }, - { , 132, "EXEC" } - }; - }; - }; // End of "Alpha" section -}; +// +//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. +// +default xkb_geometry "138" { + + // This is an approximate layout for a (US/ASCII) Fujitsu keyboard. + + description= "Fujitsu English keyboard"; + + width= 480; + height= 215; + + shape "EDGE" { cornerRadius= 2, { [ 480, 215 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [ 25,17] } }; + shape "RTRN" { + approx = { [ 0, 0], [28,37] }, + { [ 0, 0], [28, 0], [28,37], + [ 5,37], [ 5,19], [ 0,19] }, + { [ 1, 1], [26, 1], [26,36], + [ 7,36], [ 7,18], [ 1,18] } + }; + shape "LFSH" { { [ 41,18] }, { [2,1], [ 39,17] } }; + shape "RTSH" { { [ 33,18] }, { [2,1], [ 31,17] } }; + shape "LCTL" { { [ 32,18] }, { [2,1], [ 30,17] } }; + shape "SPCE" { { [151,18] }, { [2,1], [149,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; + shape "KPEN" { { [ 18,37] }, { [2,1], [ 16,36] } }; + shape "EXEC" { { [ 57,18] }, { [2,1], [ 55,17] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 15; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + + section "Alpha" { + top= 28; + row { + top= 1; + keys { + , { , 6 }, + { , 30 }, , , , + { , 6 }, , , , + { , 6 }, , , , + { , 68 }, , , + }; + }; + row { + top= 20; + keys { + , { , 6 }, + { , 30 }, , , , + { , 6 }, , , , + { , 6 }, , , , + { , 6 }, , , + { , 6 }, , , + }; + }; + row { + top= 39; + left= 316; + keys { + , , + }; + }; + row { + top= 54; + keys { + , { , 6 }, + , , , , , + , , , , , + , , , , + { , 68 }, , , + + }; + }; + row { + top= 58; + left= 316; + keys { + , , + }; + }; + row { + top= 73; + keys { , + { , 6, "TABK" }, + , , , , , + , , , , , + , , { , "RTRN" }, + { , 68 }, , , + }; + }; + row { + top= 92; + keys { , + { , 6, "LCTL" }, + , , , , , + , , , , , + , , + { , 49 }, + { , 25 }, , , + }; + }; + row { + top= 102; + left= 316; + keys { , { , 19 } + }; + }; + row { + top= 111; + keys { , + { , 6 , "LFSH" }, + , , , , , + , , , , , + , { , "RTSH" }, + { , 25 }, + { , 25 }, , , { , "KPEN" } + }; + }; + row { + top= 130; + keys { , { , 6 }, + , , + { , "SPCE" }, + , , , , + { , 68, "KP0" }, + }; + }; + row { + top= 149; + left= 316; + keys { + { , "EXEC" } + }; + }; + }; // End of "Alpha" section +}; + +xkb_geometry "140" { + + // This is an approximate layout for a Fujitsu Japanese keyboard. + + description= "Fujitsu Japanese keyboard"; + + width= 480; + height= 215; + + shape "EDGE" { cornerRadius= 2, { [ 480, 215 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [ 25,17] } }; + shape "RTRN" { + approx = { [ 0, 0], [28,37] }, + { [ 0, 0], [28, 0], [28,37], + [ 5,37], [ 5,19], [ 0,19] }, + { [ 1, 1], [26, 1], [26,36], + [ 7,36], [ 7,18], [ 1,18] } + }; + shape "LFSH" { { [ 41,18] }, { [2,1], [ 39,17] } }; + shape "RTSH" { { [ 33,18] }, { [2,1], [ 31,17] } }; + shape "LCTL" { { [ 32,18] }, { [2,1], [ 30,17] } }; + shape "SPCE" { { [113,18] }, { [2,1], [111,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; + shape "KPEN" { { [ 18,37] }, { [2,1], [ 16,36] } }; + shape "HNKN" { { [ 23,18] }, { [2,1], [ 21,17] } }; + shape "EXEC" { { [ 57,18] }, { [2,1], [ 55,17] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 15; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + + section "Alpha" { + top= 28; + row { + top= 1; + keys { + , { , 6 }, + { , 30 }, , , , + { , 6 }, , , , + { , 6 }, , , , + { , 68 }, , , + }; + }; + row { + top= 20; + keys { + , { , 6 }, + { , 30 }, , , , + { , 6 }, , , , + { , 6 }, , , , + { , 6 }, , , + { , 6 }, , , + }; + }; + row { + top= 39; + left= 316; + keys { + , , + }; + }; + row { + top= 54; + keys { + , { , 6 }, + , , , , , + , , , , , + , , , , + { , 68 }, , , + + }; + }; + row { + top= 58; + left= 316; + keys { + , , + }; + }; + row { + top= 73; + keys { , + { , 6, "TABK" }, + , , , , , + , , , , , + , , { , "RTRN" }, + { , 68 }, , , + }; + }; + row { + top= 92; + keys { , + { , 6, "LCTL" }, + , , , , , + , , , , , + , , + { , 49 }, + { , 25 }, , , + }; + }; + row { + top= 102; + left= 316; + keys { , { , 19 } + }; + }; + row { + top= 111; + keys { , + { , 6 , "LFSH" }, + , , , , , + , , , , , + , { , "RTSH" }, + { , 25 }, + { , 25 }, , , { , "KPEN" } + }; + }; + row { + top= 130; + keys { , { , 6 }, + , , , + { , "SPCE" }, + , , , , , + { , 68, "KP0" }, + }; + }; + row { + top= 149; + left= 134; + keys { + { , "HNKN" }, { , "HNKN" }, + { , 132, "EXEC" } + }; + }; + }; // End of "Alpha" section +}; diff --git a/xorg-server/xkeyboard-config/geometry/hhk b/xorg-server/xkeyboard-config/geometry/hhk index 901642b10..0f1cc0503 100644 --- a/xorg-server/xkeyboard-config/geometry/hhk +++ b/xorg-server/xkeyboard-config/geometry/hhk @@ -1,268 +1,266 @@ -// $XKeyboardConfig$ -// -// XKB geometry for the Happy Hacking Keyboard (Lite). -// Different variants correspond to different switch -// settings on the HHK. -// -// Copyright (c) Doug Palmer , 2002 -// -//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 -//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. - -// SW = 100 Default layout with windows keys -default xkb_geometry "win1" { - include "hhk(basic)" - - key.gap = 1; - section "Space" { - top = 86; - left = 30; - row { - top = 1; - keys { - , - { , "DIAM" }, - { , "SPCE" }, - { , "DIAM" }, - - }; - }; - }; -}; - -// SW = 101 Layout with windows and alt keys swapped -xkb_geometry "win2" { - include "hhk(basic)" - - key.gap = 1; - section "Space" { - top = 86; - left = 30; - row { - top = 1; - keys { - , - { , "DIAM" }, - { , "SPCE" }, - { , "DIAM" }, - - }; - }; - }; -}; - -// SW = 110 Default layout with windows keys, and left diamond = Fn key -xkb_geometry "win3" { - include "hhk(basic)" - - key.gap = 1; - section "Space" { - top = 86; - left = 30; - row { - top = 1; - keys { - , - { , "DIAM" }, - { , "SPCE" }, - { , "DIAM" }, - - }; - }; - }; -}; - -// SW = 101 Layout with windows and alt keys swapped and left-Alt = Fn key -xkb_geometry "win4" { - include "hhk(basic)" - - key.gap = 1; - section "Space" { - top = 86; - left = 30; - row { - top = 1; - keys { - , - { , "DIAM" }, - { , "SPCE" }, - { , "DIAM" }, - - }; - }; - }; -}; - -// SW = 000 Layout with Muhenkan and Henkan keys -xkb_geometry "jp1" { - include "hhk(basic)" - - key.gap = 1; - section "Space" { - top = 86; - left = 30; - row { - top = 1; - keys { - , - { , "DIAM" }, - { , "SPCE" }, - { , "DIAM" }, - - }; - }; - }; -}; - -// SW = 001 Layout with Muhenkan and Henkan keys swapped with Alt keys -xkb_geometry "jp2" { - include "hhk(basic)" - - key.gap = 1; - section "Space" { - top = 86; - left = 30; - row { - top = 1; - keys { - , - { , "DIAM" }, - { , "SPCE" }, - { , "DIAM" }, - - }; - }; - }; -}; - -// SW = 010 Layout with Henkan key and left-diamond as Fn -xkb_geometry "jp3" { - include "hhk(basic)" - - key.gap = 1; - section "Space" { - top = 86; - left = 30; - row { - top = 1; - keys { - , - { , "DIAM" }, - { , "SPCE" }, - { , "DIAM" }, - - }; - }; - }; -}; - -// SW = 001 Layout with Henkan key swapped with Alt keys and left-Alt as Fn -xkb_geometry "jp4" { - include "hhk(basic)" - - key.gap = 1; - section "Space" { - top = 86; - left = 30; - row { - top = 1; - keys { - , - { , "DIAM" }, - { , "SPCE" }, - { , "DIAM" }, - - }; - }; - }; -}; - -// Basic layout for non-swictchable keys -partial hidden xkb_geometry "basic" { - - description = "Happy Hacking Keyboard"; - width = 290; - height = 106; - - shape.cornerRadius = 1; - shape "NORM" { { [18, 18] }, { [2, 1], [14, 14] } }; - shape "BKSP" { { [28, 18] }, { [2, 1], [24, 14] } }; - shape "TABK" { { [28, 18] }, { [2, 1], [24, 14] } }; - shape "CTRL" { { [32, 18] }, { [2, 1], [28, 14] } }; - shape "RTRN" { { [42, 18] }, { [2, 1], [38, 14] } }; - shape "LFSH" { { [42, 18] }, { [2, 1], [38, 14] } }; - shape "RTSH" { { [32, 18] }, { [2, 1], [28, 14] } }; - shape "DIAM" { { [28, 18] }, { [2, 1], [24, 14] } }; - shape "SPCE" { { [114, 18] }, { [2, 1], [110, 14] } }; - - text.color = "black"; - text "PFULabel" { left = 16; top = 2; fontsize = 20; text = "PFU"; }; - text "HHKLabel" { left = 254; top = 90; text = "Happy Hacking\nKeyboard"; }; - - section.left = 1; - row.left = 1; - key.shape = "NORM"; - key.gap = 1; - - section "Alphanumeric" { - top = 10; - row { - top = 1; - keys { - , - , , , , , - , , , , , - , , - , - }; - }; - row { - top = 20; - keys { - { , "TABK" }, - , , , , , - , , , , , - , , - { , "BKSP" } - }; - }; - row { - top = 39; - keys { - { , "CTRL" }, - , , , , , - , , , , , - , - { , "RTRN" } - }; - }; - row { - top = 58; - keys { - { , "LFSH" }, - , , , , , - , , , , , - { , "RTSH" }, - { , color = "grey20" } - }; - }; - }; - - alias = ; -}; - +// +// XKB geometry for the Happy Hacking Keyboard (Lite). +// Different variants correspond to different switch +// settings on the HHK. +// +// Copyright (c) Doug Palmer , 2002 +// +//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 +//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. + +// SW = 100 Default layout with windows keys +default xkb_geometry "win1" { + include "hhk(basic)" + + key.gap = 1; + section "Space" { + top = 86; + left = 30; + row { + top = 1; + keys { + , + { , "DIAM" }, + { , "SPCE" }, + { , "DIAM" }, + + }; + }; + }; +}; + +// SW = 101 Layout with windows and alt keys swapped +xkb_geometry "win2" { + include "hhk(basic)" + + key.gap = 1; + section "Space" { + top = 86; + left = 30; + row { + top = 1; + keys { + , + { , "DIAM" }, + { , "SPCE" }, + { , "DIAM" }, + + }; + }; + }; +}; + +// SW = 110 Default layout with windows keys, and left diamond = Fn key +xkb_geometry "win3" { + include "hhk(basic)" + + key.gap = 1; + section "Space" { + top = 86; + left = 30; + row { + top = 1; + keys { + , + { , "DIAM" }, + { , "SPCE" }, + { , "DIAM" }, + + }; + }; + }; +}; + +// SW = 101 Layout with windows and alt keys swapped and left-Alt = Fn key +xkb_geometry "win4" { + include "hhk(basic)" + + key.gap = 1; + section "Space" { + top = 86; + left = 30; + row { + top = 1; + keys { + , + { , "DIAM" }, + { , "SPCE" }, + { , "DIAM" }, + + }; + }; + }; +}; + +// SW = 000 Layout with Muhenkan and Henkan keys +xkb_geometry "jp1" { + include "hhk(basic)" + + key.gap = 1; + section "Space" { + top = 86; + left = 30; + row { + top = 1; + keys { + , + { , "DIAM" }, + { , "SPCE" }, + { , "DIAM" }, + + }; + }; + }; +}; + +// SW = 001 Layout with Muhenkan and Henkan keys swapped with Alt keys +xkb_geometry "jp2" { + include "hhk(basic)" + + key.gap = 1; + section "Space" { + top = 86; + left = 30; + row { + top = 1; + keys { + , + { , "DIAM" }, + { , "SPCE" }, + { , "DIAM" }, + + }; + }; + }; +}; + +// SW = 010 Layout with Henkan key and left-diamond as Fn +xkb_geometry "jp3" { + include "hhk(basic)" + + key.gap = 1; + section "Space" { + top = 86; + left = 30; + row { + top = 1; + keys { + , + { , "DIAM" }, + { , "SPCE" }, + { , "DIAM" }, + + }; + }; + }; +}; + +// SW = 001 Layout with Henkan key swapped with Alt keys and left-Alt as Fn +xkb_geometry "jp4" { + include "hhk(basic)" + + key.gap = 1; + section "Space" { + top = 86; + left = 30; + row { + top = 1; + keys { + , + { , "DIAM" }, + { , "SPCE" }, + { , "DIAM" }, + + }; + }; + }; +}; + +// Basic layout for non-swictchable keys +partial hidden xkb_geometry "basic" { + + description = "Happy Hacking Keyboard"; + width = 290; + height = 106; + + shape.cornerRadius = 1; + shape "NORM" { { [18, 18] }, { [2, 1], [14, 14] } }; + shape "BKSP" { { [28, 18] }, { [2, 1], [24, 14] } }; + shape "TABK" { { [28, 18] }, { [2, 1], [24, 14] } }; + shape "CTRL" { { [32, 18] }, { [2, 1], [28, 14] } }; + shape "RTRN" { { [42, 18] }, { [2, 1], [38, 14] } }; + shape "LFSH" { { [42, 18] }, { [2, 1], [38, 14] } }; + shape "RTSH" { { [32, 18] }, { [2, 1], [28, 14] } }; + shape "DIAM" { { [28, 18] }, { [2, 1], [24, 14] } }; + shape "SPCE" { { [114, 18] }, { [2, 1], [110, 14] } }; + + text.color = "black"; + text "PFULabel" { left = 16; top = 2; fontsize = 20; text = "PFU"; }; + text "HHKLabel" { left = 254; top = 90; text = "Happy Hacking\nKeyboard"; }; + + section.left = 1; + row.left = 1; + key.shape = "NORM"; + key.gap = 1; + + section "Alphanumeric" { + top = 10; + row { + top = 1; + keys { + , + , , , , , + , , , , , + , , + , + }; + }; + row { + top = 20; + keys { + { , "TABK" }, + , , , , , + , , , , , + , , + { , "BKSP" } + }; + }; + row { + top = 39; + keys { + { , "CTRL" }, + , , , , , + , , , , , + , + { , "RTRN" } + }; + }; + row { + top = 58; + keys { + { , "LFSH" }, + , , , , , + , , , , , + { , "RTSH" }, + { , color = "grey20" } + }; + }; + }; + + alias = ; +}; diff --git a/xorg-server/xkeyboard-config/geometry/hp b/xorg-server/xkeyboard-config/geometry/hp index 62e4d8a18..a9846f295 100644 --- a/xorg-server/xkeyboard-config/geometry/hp +++ b/xorg-server/xkeyboard-config/geometry/hp @@ -1,702 +1,697 @@ -// $Xorg: hp,v 1.4 2001/02/09 02:05:50 xorgcvs Exp $ -// -//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. -// -// $XFree86: xc/programs/xkbcomp/geometry/hp,v 1.8 2003/08/09 14:30:46 pascal Exp $ - -default xkb_geometry "pc101" { - - description= "HP PC101"; - width= 470; - height= 210; - - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [ 35,17] } }; - shape "TABK" { { [ 28,18] }, { [2,1], [ 26,17] } }; - shape "BKSL" { { [ 28,18] }, { [2,1], [ 26,17] } }; - shape "RTRN" { { [ 42,18] }, { [2,1], [ 40,17] } }; - shape "CAPS" { { [ 32,18] }, { [2,1], [ 30,17] } }; - shape "LFSH" { { [ 42,18] }, { [2,1], [ 40,17] } }; - shape "RTSH" { { [ 52,18] }, { [2,1], [ 50,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [ 26,17] } }; - shape "SPCE" { { [132,18] }, { [2,1], [130,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [ 16,36] } }; - - section.left= 19; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 52; - row { - top= 1; - keys { { , color="grey20" }, - { , 18 }, , , , - { , 11 }, , , , - { , 11 }, , , , - { , 8 }, , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 91; - row { - top= 1; - keys { , , , , , - , , , , , - , , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { { , "TABK", color="grey20" }, - , , , , , - , , , , , - , , { , "BKSL" } - }; - }; - row { - top= 39; - keys { { , "CAPS", color="grey20" }, - , , , , , - , , , , , - , { , "RTRN", color="grey20" } - }; - }; - row { - top= 58; - keys { { , "LFSH", color="grey20" }, - , , , , , - , , , , , - { , "RTSH", color="grey20" } - }; - }; - row { - top= 77; - key.shape= "MODK"; - key.color= "grey20"; - keys { , { , 20 }, - { , "SPCE", color="white" }, - , { , 20 } - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 91; - left= 310; - key.color= "grey20"; - row { - top= 1; - keys { , , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - top= 58; - left= 20; - keys { }; - }; - row { - top= 77; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 91; - left= 375; - row { - top= 1; - key.color= "grey20"; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - - alias = ; - alias = ; - -}; // End of "default" geometry - -xkb_geometry "hil" { - - description= "HP hil"; - width= 455; - height= 170; - - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; - shape "BKSP" { { [ 32,18] }, { [2,1], [ 30,17] } }; - shape "TABK" { { [ 32,18] }, { [2,1], [ 30,17] } }; - shape "BKSL" { { [ 24,18] }, { [2,1], [ 22,17] } }; - shape "RTRN" { { [ 38,18] }, { [2,1], [ 36,17] } }; - shape "LFSH" { { [ 28,18] }, { [2,1], [ 26,17] } }; - shape "RTSH" { { [ 28,18] }, { [2,1], [ 26,17] } }; - shape "SPCE" { { [151,18] }, { [2,1], [150,17] } }; - shape "KP0" { { [ 38,18] }, { [2,1], [ 36,17] } }; - shape "KPTB" { { [ 18,38] }, { [2,1], [ 16,37] } }; - shape "TLDE" { { [ 24,18] }, { [2,1], [ 22,17] } }; - shape "FKT1" { { [ 17,14] }, { [2,1], [ 15,13] } }; - shape "FKT2" { { [ 23,14] }, { [2,1], [ 21,13] } }; - - section.left= 19; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 14; - row { - top= 1; - keys { { , "FKT1" }, { , "FKT1" } , - { , "FKT2", 10 }, { , "FKT2" }, - { , "FKT2" }, { , "FKT2" }, - { , "FKT1" }, { , "FKT1" }, - { , "FKT2" }, { , "FKT2" }, - { , "FKT2" }, { , "FKT2" }, - { , "FKT1", 10 }, { , "FKT1" }, - { , "FKT1", 19 }, { , "FKT1" }, - { , "FKT1" }, { , "FKT1" } - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 52; - row { - top= 1; - keys { { , "TLDE" }, , , , , - , , , , , - , , , - { , "BKSP" }, , - }; - }; - row { - top= 20; - keys { { , "TABK" }, - , , , , , - , , , , , - , , { , "BKSL" }, - , - }; - }; - row { - top= 39; - keys { , , - , , , , , - , , , , , - , { , "RTRN" }, - , - }; - }; - row { - top= 58; - keys { , { , "LFSH" }, - , , , , , - , , , , , - { , "RTSH" }, , - , - }; - }; - row { - top= 77; - keys { , { , 30 }, - { , "SPCE" }, - , { , 30 }, , - }; - }; - }; // End of "Alpha" section - - section "Keypad" { - top= 52; - left= 360; - row { - top= 1; - keys { , , , }; - }; - row { - top= 20; - keys { , , , }; - }; - row { - top= 39; - keys { , , , }; - }; - row { - top= 58; - keys { , , , { , "KPTB" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - -}; // End of "default" geometry - - -// Created by Alexander Pohoyda -// Geometry specification for HP Omnibook keyboards. -// Compatible Models: 6100, 6000. - -xkb_geometry "omnibook" { - width = 282; - height = 128; - baseColor = "grey80"; - labelColor = "white"; - - shape "FN0" { cornerRadius = 1, { [15.5, 12] }, { [1, 0], [14.5, 11] } }; - shape "NORM" { cornerRadius = 1, { [18, 16] }, { [2, 0], [16, 14] } }; - shape "BKSP" { cornerRadius = 1, { [31, 16] }, { [2, 0], [29, 14] } }; - shape "TABK" { cornerRadius = 1, { [27, 16] }, { [2, 0], [25, 14] } }; - shape "CAPS" { cornerRadius = 1, { [32, 16] }, { [2, 0], [30, 14] } }; - shape "RTSH" { cornerRadius = 1, { [45, 16] }, { [2, 0], [43, 14] } }; - shape "MODK" { cornerRadius = 1, { [28, 16] }, { [2, 0], [26, 14] } }; - shape "SPCE" { cornerRadius = 1, { [90, 16] }, { [2, 0], [88, 14] } }; - shape "ARRS" { cornerRadius = 1, { [17, 12] }, { [2, 0], [15, 11] } }; - - shape "LED" { cornerRadius = 1, { [2, 4] } }; - - shape "KEYS" { cornerRadius = 1, - { [0, 13], - [197, 13], [197, 0], - [280, 0], [280, 125], - [224, 125], [224, 112], - [0, 112] } - }; - - solid "KeyPanel" { - shape = "KEYS"; - left = 1; - top = 1; - color = "black"; - }; - - shape "NULL1" { cornerRadius = 1, { [54, 16] } }; - - solid "NullPanel1" { - shape = "NULL1"; - left = 226; - top = 96; - color = "grey80"; - }; - - shape "NULL2" { cornerRadius = 1, { [19, 14] } }; - - solid "NullPanel2" { - shape = "NULL2"; - left = 243; - top = 97; - color = "black"; - }; - - indicator.onColor = "green"; - indicator.offColor = "grey10"; - indicator.top = 4; - indicator.shape = "LED"; - indicator "Caps Lock" { left = 45; }; - indicator "Num Lock" { left = 60; }; - indicator "Scroll Lock" { left = 75; }; - indicator "HDDActivity" { onColor = "red"; left = 90; }; - - key.color = "grey60"; - - section "Function" { - key.gap = 0.99; - left = 1; - top = 1; - key.shape = "FN0"; - row { - left = 197; - top = 1; - keys { , , , , }; - }; - row { - top = 14; - keys { , - , , , , - , , , , - , , , , - , , , - }; - }; - }; // End of "Function" section - - section "Control" { - left = 1; - top = 34; - key.gap = 1; - row { - top = 62; - key.shape = "NORM"; - keys { , , , , - { , "SPCE" }, , , - }; - }; - }; // End of "Control" section - - section "Navigation" { - key.shape = "ARRS"; - left = 225; - top = 97; - key.gap = 1.4; - row { - left= 18; - top = 1; - keys { }; - }; - row { - top = 16; - keys { , , }; - }; - }; // End of "Navigation" section - - shape "STIK" { cornerRadius = 4, { [7, 7] } }; - - solid "STIK" { - priority = 255; - color = "red"; - shape = "STIK"; - top = 73; - left = 126; - }; -}; - -// 86 keys -xkb_geometry "omnibook_intl" { - include "hp(omnibook)" - description = "HP Omnibook 6000/6100, Intl"; - - shape "RTRN" { cornerRadius = 1, - { [22, 0], [22, 33], [5, 33], [5, 16], [0, 16], [0, 0] }, - { [20, 0], [20, 31], [7, 31], [7, 14], [2, 14], [2, 0] } }; - shape "LFSH" { cornerRadius = 1, { [23, 16] }, { [2, 0], [21, 14] } }; - - section "Alpha" { - key.gap = 1; - key.color = "grey60"; - key.shape = "NORM"; - left = 1; - top = 27; - row { - top = 1; - keys { , , , , , - , , , , , - , , , { , "BKSP" } - }; - }; - row { - top = 18; - keys { { , "TABK" }, - , , , , , - , , , , , - , , { , "RTRN" } - }; - }; - row { - top = 35; - keys { { , "CAPS" }, - , , , , , - , , , , , - , - }; - }; - row { - top = 52; - keys { { , "LFSH" }, , - , , , , , - , , , , , - { , "RTSH" } - }; - }; - }; // End of "Alpha" section -}; - -xkb_geometry "mini110" { - - description= "HP Mini 110"; - width= 262; - height= 106; - - shape.cornerRadius = 0; - shape "FN0" { { [ 14, 10 ] } , { [ 14, 10 ] } }; - shape "NORM" { { [ 16.7, 16 ] } , { [ 16.7, 16 ] } }; - shape "TLDE" { { [ 12, 16 ] } , { [ 12, 16 ] } }; - shape "ONE" { { [ 14, 16 ] } , { [ 14, 16 ] } }; - shape "BKSP" { { [ 31.3, 16 ] } , { [ 31.3, 16 ] } }; - shape "BKSL" { { [ 23.9, 16 ] } , { [ 23.9, 16 ] } }; - shape "CAPS" { { [ 22, 16 ] } , { [ 22, 16 ] } }; - shape "RTRN" { { [ 36.3, 16 ] } , { [ 36.3, 16 ] } }; - shape "LFSH" { { [ 31, 16 ] } , { [ 31, 16 ] } }; - shape "RTSH" { { [ 45, 16 ] } , { [ 45, 16 ] } }; - shape "CTLS" { { [ 16.5, 19 ] } , { [ 16.5, 19 ] } }; - shape "SPCE" { { [ 78.4, 19 ] } , { [ 78.4, 19 ] } }; - shape "ARRW" { { [ 16.7, 9 ] } , { [ 16.7, 9 ] } }; - - key.gap=1; - - section "Function" { - top=4; - left=3; - key.shape="FN0"; - row { - keys { - , , , , , , - , , , , , , - , , , , - }; - }; - }; - - section "Alphanum" { - top=15; - left=3; - key.shape="NORM"; - row { - top= 0; - keys { { , "TLDE" } , { , "ONE" }, , , , - , , , , , - , , , - { , "BKSP" } - }; - }; - row { - top= 17; - keys { , , , , , , - , , , , , - , , { , "BKSL" } - }; - }; - row { - top= 34; - keys { { , "CAPS" } , - , , , , , - , , , , , - , { , "RTRN" } - }; - }; - row { - top= 51; - keys { { , "LFSH" }, - , , , , , - , , , , , - { , "RTSH" } - }; - }; - - }; - - section "Control" { - top=83; - left=3; - key.shape="CTLS"; - row { - keys { - , , , , { , "SPCE" }, , , - }; - }; - }; - - section "Arrows" { - top=83; - left=204.9; - key.shape="ARRW"; - row { - left= 17.7; - keys { - - }; - }; - row { - top = 10; - keys { - , , - }; - }; - }; - -}; - -xkb_geometry "dv5" { - - height=118.4; - width=310.6; - - description = "HP Pavilion dv5"; - - shape.cornerRadius = 1; - - shape "ESC" { { [20.0, 12.5] }, { [2.2, 1], [17.8, 10.5] } }; - shape "FN0" { { [15.9, 12.5] }, { [2.2, 1], [13.7, 10.5] } }; - shape "DELE" { { [19.4, 12.5] }, { [2.2, 1], [17.2, 10.5] } }; - - shape "NORM" { { [17.9, 18.3] }, { [2.2, 1], [15.7, 16.3] } }; - - shape "BKSP" { { [36.1, 18.3] }, { [2.4, 1], [33.7, 16.3] } }; - - shape "TABK" { { [26.8, 18.3] }, { [2.4, 1], [24.4, 16.3] } }; - shape "BKSL" { { [27.1, 18.3] }, { [2.4, 1], [24.7, 16.3] } }; - - shape "CAPS" { { [31.6, 18.3] }, { [2.4, 1], [29.2, 16.3] } }; - shape "RTRN" { { [41.2, 18.3] }, { [2.4, 1], [39.3, 16.3] } }; - - shape "LFSH" { { [41.5, 18.3] }, { [2.4, 1], [38.8, 16.3] } }; - shape "RTSH" { { [31.5, 18.3] }, { [2.4, 1], [29.1, 16.3] } }; - - shape "LCTL" { { [22.4, 18.3] }, { [2.2, 1], [20.2, 16.3] } }; - shape "RCTL" { { [22.6, 18.3] }, { [2.2, 1], [20.4, 16.3] } }; - shape "CTLS" { { [17.9, 18.3] }, { [2.2, 1], [15.7, 16.3] } }; - shape "SPCE" { { [94.3, 18.3] }, { [2.5, 1], [91.8, 16.3] } }; - - shape "ARRW" { { [17.9, 18.3] }, { [2.2, 1], [15.7, 16.3] } }; - - shape "EDIT" { { [16.6, 18.3] }, { [2.2, 1], [14.4, 16.3] } }; - - key.gap = 1.2; - - section "Function" { - top=4.2; - left=3; - row { - key.shape = "FN0"; - keys { - {, "ESC"}, - {2.9, }, , , , - {2.9, }, , , , - {2.9, }, , , , - {2.9, }, , , {, "DELE"} - }; - }; - }; - - section "Alpha" { - top = 17.9; - key.shape = "NORM"; - left = 3; - - row { - top = 0; - keys { , , , , , - , , , , , - , , , { , "BKSP" } - }; - }; - row { - top = 19.5; - keys { { , "TABK" }, - , , , , , - , , , , , - , , { , "BKSL" } - }; - }; - row { - top = 39; - keys { { , "CAPS" }, - , , , , , - , , , , , - , { , "RTRN" } - }; - }; - row { - top = 58.5; - keys { { , "LFSH" }, - , , , , , - , , , , , - { , "RTSH" } - }; - }; - }; // End of "Alpha" section - - section "Controls" { - top = 95.9; - key.shape = "CTLS"; - left = 3; - - row { - top = 0; - keys { {, "LCTL"}, , , , {, "SPCE"}, - , , {, "RCTL"} - }; - }; - }; - - section "Edition" { - top = 16.5; - left = 289.9; - key.shape = "EDIT"; - key.gap = 1.4; - row { - top = 0; - vertical = true; - keys { - , , , - }; - }; - }; - - section "Arrows" { - top = 76.4; - key.shape = "ARRW"; - left = 249.3; - row { - top = 0; - left = 19.1; - keys { - - }; - }; - row { - top = 19.5; - left = 0; - keys { - , , - }; - }; - }; -}; - - - +// +//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. +// + +default xkb_geometry "pc101" { + + description= "HP PC101"; + width= 470; + height= 210; + + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [ 35,17] } }; + shape "TABK" { { [ 28,18] }, { [2,1], [ 26,17] } }; + shape "BKSL" { { [ 28,18] }, { [2,1], [ 26,17] } }; + shape "RTRN" { { [ 42,18] }, { [2,1], [ 40,17] } }; + shape "CAPS" { { [ 32,18] }, { [2,1], [ 30,17] } }; + shape "LFSH" { { [ 42,18] }, { [2,1], [ 40,17] } }; + shape "RTSH" { { [ 52,18] }, { [2,1], [ 50,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [ 26,17] } }; + shape "SPCE" { { [132,18] }, { [2,1], [130,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [ 16,36] } }; + + section.left= 19; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 52; + row { + top= 1; + keys { { , color="grey20" }, + { , 18 }, , , , + { , 11 }, , , , + { , 11 }, , , , + { , 8 }, , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 91; + row { + top= 1; + keys { , , , , , + , , , , , + , , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { { , "TABK", color="grey20" }, + , , , , , + , , , , , + , , { , "BKSL" } + }; + }; + row { + top= 39; + keys { { , "CAPS", color="grey20" }, + , , , , , + , , , , , + , { , "RTRN", color="grey20" } + }; + }; + row { + top= 58; + keys { { , "LFSH", color="grey20" }, + , , , , , + , , , , , + { , "RTSH", color="grey20" } + }; + }; + row { + top= 77; + key.shape= "MODK"; + key.color= "grey20"; + keys { , { , 20 }, + { , "SPCE", color="white" }, + , { , 20 } + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 91; + left= 310; + key.color= "grey20"; + row { + top= 1; + keys { , , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + top= 58; + left= 20; + keys { }; + }; + row { + top= 77; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 91; + left= 375; + row { + top= 1; + key.color= "grey20"; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + + alias = ; + alias = ; + +}; // End of "default" geometry + +xkb_geometry "hil" { + + description= "HP hil"; + width= 455; + height= 170; + + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; + shape "BKSP" { { [ 32,18] }, { [2,1], [ 30,17] } }; + shape "TABK" { { [ 32,18] }, { [2,1], [ 30,17] } }; + shape "BKSL" { { [ 24,18] }, { [2,1], [ 22,17] } }; + shape "RTRN" { { [ 38,18] }, { [2,1], [ 36,17] } }; + shape "LFSH" { { [ 28,18] }, { [2,1], [ 26,17] } }; + shape "RTSH" { { [ 28,18] }, { [2,1], [ 26,17] } }; + shape "SPCE" { { [151,18] }, { [2,1], [150,17] } }; + shape "KP0" { { [ 38,18] }, { [2,1], [ 36,17] } }; + shape "KPTB" { { [ 18,38] }, { [2,1], [ 16,37] } }; + shape "TLDE" { { [ 24,18] }, { [2,1], [ 22,17] } }; + shape "FKT1" { { [ 17,14] }, { [2,1], [ 15,13] } }; + shape "FKT2" { { [ 23,14] }, { [2,1], [ 21,13] } }; + + section.left= 19; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 14; + row { + top= 1; + keys { { , "FKT1" }, { , "FKT1" } , + { , "FKT2", 10 }, { , "FKT2" }, + { , "FKT2" }, { , "FKT2" }, + { , "FKT1" }, { , "FKT1" }, + { , "FKT2" }, { , "FKT2" }, + { , "FKT2" }, { , "FKT2" }, + { , "FKT1", 10 }, { , "FKT1" }, + { , "FKT1", 19 }, { , "FKT1" }, + { , "FKT1" }, { , "FKT1" } + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 52; + row { + top= 1; + keys { { , "TLDE" }, , , , , + , , , , , + , , , + { , "BKSP" }, , + }; + }; + row { + top= 20; + keys { { , "TABK" }, + , , , , , + , , , , , + , , { , "BKSL" }, + , + }; + }; + row { + top= 39; + keys { , , + , , , , , + , , , , , + , { , "RTRN" }, + , + }; + }; + row { + top= 58; + keys { , { , "LFSH" }, + , , , , , + , , , , , + { , "RTSH" }, , + , + }; + }; + row { + top= 77; + keys { , { , 30 }, + { , "SPCE" }, + , { , 30 }, , + }; + }; + }; // End of "Alpha" section + + section "Keypad" { + top= 52; + left= 360; + row { + top= 1; + keys { , , , }; + }; + row { + top= 20; + keys { , , , }; + }; + row { + top= 39; + keys { , , , }; + }; + row { + top= 58; + keys { , , , { , "KPTB" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + +}; // End of "default" geometry + + +// Created by Alexander Pohoyda +// Geometry specification for HP Omnibook keyboards. +// Compatible Models: 6100, 6000. + +xkb_geometry "omnibook" { + width = 282; + height = 128; + baseColor = "grey80"; + labelColor = "white"; + + shape "FN0" { cornerRadius = 1, { [15.5, 12] }, { [1, 0], [14.5, 11] } }; + shape "NORM" { cornerRadius = 1, { [18, 16] }, { [2, 0], [16, 14] } }; + shape "BKSP" { cornerRadius = 1, { [31, 16] }, { [2, 0], [29, 14] } }; + shape "TABK" { cornerRadius = 1, { [27, 16] }, { [2, 0], [25, 14] } }; + shape "CAPS" { cornerRadius = 1, { [32, 16] }, { [2, 0], [30, 14] } }; + shape "RTSH" { cornerRadius = 1, { [45, 16] }, { [2, 0], [43, 14] } }; + shape "MODK" { cornerRadius = 1, { [28, 16] }, { [2, 0], [26, 14] } }; + shape "SPCE" { cornerRadius = 1, { [90, 16] }, { [2, 0], [88, 14] } }; + shape "ARRS" { cornerRadius = 1, { [17, 12] }, { [2, 0], [15, 11] } }; + + shape "LED" { cornerRadius = 1, { [2, 4] } }; + + shape "KEYS" { cornerRadius = 1, + { [0, 13], + [197, 13], [197, 0], + [280, 0], [280, 125], + [224, 125], [224, 112], + [0, 112] } + }; + + solid "KeyPanel" { + shape = "KEYS"; + left = 1; + top = 1; + color = "black"; + }; + + shape "NULL1" { cornerRadius = 1, { [54, 16] } }; + + solid "NullPanel1" { + shape = "NULL1"; + left = 226; + top = 96; + color = "grey80"; + }; + + shape "NULL2" { cornerRadius = 1, { [19, 14] } }; + + solid "NullPanel2" { + shape = "NULL2"; + left = 243; + top = 97; + color = "black"; + }; + + indicator.onColor = "green"; + indicator.offColor = "grey10"; + indicator.top = 4; + indicator.shape = "LED"; + indicator "Caps Lock" { left = 45; }; + indicator "Num Lock" { left = 60; }; + indicator "Scroll Lock" { left = 75; }; + indicator "HDDActivity" { onColor = "red"; left = 90; }; + + key.color = "grey60"; + + section "Function" { + key.gap = 0.99; + left = 1; + top = 1; + key.shape = "FN0"; + row { + left = 197; + top = 1; + keys { , , , , }; + }; + row { + top = 14; + keys { , + , , , , + , , , , + , , , , + , , , + }; + }; + }; // End of "Function" section + + section "Control" { + left = 1; + top = 34; + key.gap = 1; + row { + top = 62; + key.shape = "NORM"; + keys { , , , , + { , "SPCE" }, , , + }; + }; + }; // End of "Control" section + + section "Navigation" { + key.shape = "ARRS"; + left = 225; + top = 97; + key.gap = 1.4; + row { + left= 18; + top = 1; + keys { }; + }; + row { + top = 16; + keys { , , }; + }; + }; // End of "Navigation" section + + shape "STIK" { cornerRadius = 4, { [7, 7] } }; + + solid "STIK" { + priority = 255; + color = "red"; + shape = "STIK"; + top = 73; + left = 126; + }; +}; + +// 86 keys +xkb_geometry "omnibook_intl" { + include "hp(omnibook)" + description = "HP Omnibook 6000/6100, Intl"; + + shape "RTRN" { cornerRadius = 1, + { [22, 0], [22, 33], [5, 33], [5, 16], [0, 16], [0, 0] }, + { [20, 0], [20, 31], [7, 31], [7, 14], [2, 14], [2, 0] } }; + shape "LFSH" { cornerRadius = 1, { [23, 16] }, { [2, 0], [21, 14] } }; + + section "Alpha" { + key.gap = 1; + key.color = "grey60"; + key.shape = "NORM"; + left = 1; + top = 27; + row { + top = 1; + keys { , , , , , + , , , , , + , , , { , "BKSP" } + }; + }; + row { + top = 18; + keys { { , "TABK" }, + , , , , , + , , , , , + , , { , "RTRN" } + }; + }; + row { + top = 35; + keys { { , "CAPS" }, + , , , , , + , , , , , + , + }; + }; + row { + top = 52; + keys { { , "LFSH" }, , + , , , , , + , , , , , + { , "RTSH" } + }; + }; + }; // End of "Alpha" section +}; + +xkb_geometry "mini110" { + + description= "HP Mini 110"; + width= 262; + height= 106; + + shape.cornerRadius = 0; + shape "FN0" { { [ 14, 10 ] } , { [ 14, 10 ] } }; + shape "NORM" { { [ 16.7, 16 ] } , { [ 16.7, 16 ] } }; + shape "TLDE" { { [ 12, 16 ] } , { [ 12, 16 ] } }; + shape "ONE" { { [ 14, 16 ] } , { [ 14, 16 ] } }; + shape "BKSP" { { [ 31.3, 16 ] } , { [ 31.3, 16 ] } }; + shape "BKSL" { { [ 23.9, 16 ] } , { [ 23.9, 16 ] } }; + shape "CAPS" { { [ 22, 16 ] } , { [ 22, 16 ] } }; + shape "RTRN" { { [ 36.3, 16 ] } , { [ 36.3, 16 ] } }; + shape "LFSH" { { [ 31, 16 ] } , { [ 31, 16 ] } }; + shape "RTSH" { { [ 45, 16 ] } , { [ 45, 16 ] } }; + shape "CTLS" { { [ 16.5, 19 ] } , { [ 16.5, 19 ] } }; + shape "SPCE" { { [ 78.4, 19 ] } , { [ 78.4, 19 ] } }; + shape "ARRW" { { [ 16.7, 9 ] } , { [ 16.7, 9 ] } }; + + key.gap=1; + + section "Function" { + top=4; + left=3; + key.shape="FN0"; + row { + keys { + , , , , , , + , , , , , , + , , , , + }; + }; + }; + + section "Alphanum" { + top=15; + left=3; + key.shape="NORM"; + row { + top= 0; + keys { { , "TLDE" } , { , "ONE" }, , , , + , , , , , + , , , + { , "BKSP" } + }; + }; + row { + top= 17; + keys { , , , , , , + , , , , , + , , { , "BKSL" } + }; + }; + row { + top= 34; + keys { { , "CAPS" } , + , , , , , + , , , , , + , { , "RTRN" } + }; + }; + row { + top= 51; + keys { { , "LFSH" }, + , , , , , + , , , , , + { , "RTSH" } + }; + }; + + }; + + section "Control" { + top=83; + left=3; + key.shape="CTLS"; + row { + keys { + , , , , { , "SPCE" }, , , + }; + }; + }; + + section "Arrows" { + top=83; + left=204.9; + key.shape="ARRW"; + row { + left= 17.7; + keys { + + }; + }; + row { + top = 10; + keys { + , , + }; + }; + }; + +}; + +xkb_geometry "dv5" { + + height=118.4; + width=310.6; + + description = "HP Pavilion dv5"; + + shape.cornerRadius = 1; + + shape "ESC" { { [20.0, 12.5] }, { [2.2, 1], [17.8, 10.5] } }; + shape "FN0" { { [15.9, 12.5] }, { [2.2, 1], [13.7, 10.5] } }; + shape "DELE" { { [19.4, 12.5] }, { [2.2, 1], [17.2, 10.5] } }; + + shape "NORM" { { [17.9, 18.3] }, { [2.2, 1], [15.7, 16.3] } }; + + shape "BKSP" { { [36.1, 18.3] }, { [2.4, 1], [33.7, 16.3] } }; + + shape "TABK" { { [26.8, 18.3] }, { [2.4, 1], [24.4, 16.3] } }; + shape "BKSL" { { [27.1, 18.3] }, { [2.4, 1], [24.7, 16.3] } }; + + shape "CAPS" { { [31.6, 18.3] }, { [2.4, 1], [29.2, 16.3] } }; + shape "RTRN" { { [41.2, 18.3] }, { [2.4, 1], [39.3, 16.3] } }; + + shape "LFSH" { { [41.5, 18.3] }, { [2.4, 1], [38.8, 16.3] } }; + shape "RTSH" { { [31.5, 18.3] }, { [2.4, 1], [29.1, 16.3] } }; + + shape "LCTL" { { [22.4, 18.3] }, { [2.2, 1], [20.2, 16.3] } }; + shape "RCTL" { { [22.6, 18.3] }, { [2.2, 1], [20.4, 16.3] } }; + shape "CTLS" { { [17.9, 18.3] }, { [2.2, 1], [15.7, 16.3] } }; + shape "SPCE" { { [94.3, 18.3] }, { [2.5, 1], [91.8, 16.3] } }; + + shape "ARRW" { { [17.9, 18.3] }, { [2.2, 1], [15.7, 16.3] } }; + + shape "EDIT" { { [16.6, 18.3] }, { [2.2, 1], [14.4, 16.3] } }; + + key.gap = 1.2; + + section "Function" { + top=4.2; + left=3; + row { + key.shape = "FN0"; + keys { + {, "ESC"}, + {2.9, }, , , , + {2.9, }, , , , + {2.9, }, , , , + {2.9, }, , , {, "DELE"} + }; + }; + }; + + section "Alpha" { + top = 17.9; + key.shape = "NORM"; + left = 3; + + row { + top = 0; + keys { , , , , , + , , , , , + , , , { , "BKSP" } + }; + }; + row { + top = 19.5; + keys { { , "TABK" }, + , , , , , + , , , , , + , , { , "BKSL" } + }; + }; + row { + top = 39; + keys { { , "CAPS" }, + , , , , , + , , , , , + , { , "RTRN" } + }; + }; + row { + top = 58.5; + keys { { , "LFSH" }, + , , , , , + , , , , , + { , "RTSH" } + }; + }; + }; // End of "Alpha" section + + section "Controls" { + top = 95.9; + key.shape = "CTLS"; + left = 3; + + row { + top = 0; + keys { {, "LCTL"}, , , , {, "SPCE"}, + , , {, "RCTL"} + }; + }; + }; + + section "Edition" { + top = 16.5; + left = 289.9; + key.shape = "EDIT"; + key.gap = 1.4; + row { + top = 0; + vertical = true; + keys { + , , , + }; + }; + }; + + section "Arrows" { + top = 76.4; + key.shape = "ARRW"; + left = 249.3; + row { + top = 0; + left = 19.1; + keys { + + }; + }; + row { + top = 19.5; + left = 0; + keys { + , , + }; + }; + }; +}; diff --git a/xorg-server/xkeyboard-config/geometry/keytronic b/xorg-server/xkeyboard-config/geometry/keytronic index 110274a2d..6ee1b718b 100644 --- a/xorg-server/xkeyboard-config/geometry/keytronic +++ b/xorg-server/xkeyboard-config/geometry/keytronic @@ -1,253 +1,252 @@ -// $Xorg: keytronic,v 1.4 2001/02/09 02:05:50 xorgcvs Exp $ -// -//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. -// -default xkb_geometry "FlexPro" { - - // This is an approximate layout for a Key Tronic FlexPro - // keyboard. I just took a similar layout (101 key PC keyboard) - // and adjusted the sizes of a few keys by eye. I didn't actually - // *measure* a real keyboard. - - description= "Key Tronic FlexPro keyboard"; - - width= 515; - height= 200; - - shape "EDGE" { cornerRadius= 2, { [ 515, 200 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "TABK" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "BKSL" { { [ 23,18] }, { [2,1], [21,17] } }; - shape "RTRN" { - approx = { [16, 0], [38,37] }, - { [16, 0], [38, 0], [38,37], - [ 0,37], [ 0,19], [16,19] }, - { [18, 1], [36, 1], [36,36], - [ 2,36], [ 2,20], [18,20] } }; - shape "CAPS" { { [36,18] }, { [2,1], [34,17] } }; - shape "SHFT" { { [46,18] }, { [2,1], [44,17] } }; - shape "LCTL" { { [32,18] }, { [2,1], [30,17] } }; - shape "RCTL" { { [38,18] }, { [2,1], [36,17] } }; - shape "LALT" { { [28,18] }, { [2,1], [26,17] } }; - shape "RALT" { { [33,18] }, { [2,1], [31,17] } }; - shape "LSPC" { { [66,22] }, { [0,0], [66,22] } }; - shape "RSPC" { { [76,22] }, { [0,0], [76,22] } }; - shape "KP0" { { [37,18] }, { [2,1], [35,17] } }; - shape "KPEN" { { [18,37] }, { [2,1], [16,36] } }; - shape "LOGO" { cornerRadius= 3, { [80,35] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 9; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - - section "Function" { - top= 56; - row { - top = 1; - key.color= "grey20"; - keys { , }; - }; - row { - top = 20; - key.color= "grey20"; - keys { , }; - }; - row { - top = 39; - keys { , }; - }; - row { - top = 58; - key.color= "grey20"; - keys { , }; - }; - row { - top = 77; - key.color= "grey20"; - keys { , }; - }; - row { - top = 96; - keys { , }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 56; - left= 53; - row { - top= 1; - keys { - { , color="grey20" }, { , "BKSL", color="grey20" }, - , , , , - , , , , , - , , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { - { , color="grey20" }, { , "TABK", color="grey20" }, - , , , , , - , , , , , - , , - { , "RTRN", -14, color="grey20" } - }; - }; - row { - top= 39; - keys { - { , color="grey20" }, { , "CAPS", color="grey20" }, - , , , , , - , , , , , - }; - }; - row { - top= 58; - keys { - { , color="grey20" }, - { , "SHFT", color="grey20" }, - , , , , , - , , , , , - { , "SHFT", color="grey20" } - }; - }; - row { - top= 77; - key.color= "grey20"; - keys { - , - { , shape="LCTL" }, - { , shape="LALT" }, - { , shape="LSPC", 4, color="white" }, - { , shape="RSPC",color="white" }, - { , shape="RALT", 4 }, - { , shape="RCTL" } - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 12; - left= 365; - key.color= "grey20"; - row { - top= 1; - keys { , , }; - }; - row { - top= 45; - keys { , , }; - }; - row { - top= 64; - keys { , , }; - }; - row { - top= 102; - left= 20; - keys { }; - }; - row { - top= 121; - keys { , , }; - }; - }; // End of "Editing" section - - shape "LEDS" { cornerRadius= 3, { [ 76, 20 ] } }; - shape "LED" { cornerRadius= 0, { [ 7, 4 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 11; - left= 430; - color= "grey10"; - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 13; - indicator.shape= "LED"; - indicator "Num Lock" { left= 440; }; - indicator "Caps Lock" { left= 467; }; - indicator "Scroll Lock" { left= 489; }; - text.top= 22; - text.color= "black"; - text "NumLockLabel" { left= 438; text="Num\nLock"; }; - text "CapsLockLabel" { left= 465; text="Caps\nLock"; }; - text "ScrollLockLabel" { left= 487; text="Scroll\nLock"; }; - - logo "FlexProLogoImage" { - top= 12; - left= 45; - name= "KeyTronic"; - shape= "LOGO"; - }; - text "KeyTronicLogoText" { - top= 15; - left= 50; - width= 55; - text= "FlexPro"; - font= "times"; - slant= "o"; - weight= "bold"; - fontWidth= "narrow"; - fontSize= 36; - }; - - section "Keypad" { - top= 56; - left= 430; - row { - top= 1; - key.color= "grey20"; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , color= "grey20" } }; - }; - row { - top= 39; - keys { , , , { , color= "grey20" } }; - }; - row { - top= 58; - keys { , , , { , "KPEN", color= "grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section -}; +// +//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. +// +default xkb_geometry "FlexPro" { + + // This is an approximate layout for a Key Tronic FlexPro + // keyboard. I just took a similar layout (101 key PC keyboard) + // and adjusted the sizes of a few keys by eye. I didn't actually + // *measure* a real keyboard. + + description= "Key Tronic FlexPro keyboard"; + + width= 515; + height= 200; + + shape "EDGE" { cornerRadius= 2, { [ 515, 200 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "TABK" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "BKSL" { { [ 23,18] }, { [2,1], [21,17] } }; + shape "RTRN" { + approx = { [16, 0], [38,37] }, + { [16, 0], [38, 0], [38,37], + [ 0,37], [ 0,19], [16,19] }, + { [18, 1], [36, 1], [36,36], + [ 2,36], [ 2,20], [18,20] } }; + shape "CAPS" { { [36,18] }, { [2,1], [34,17] } }; + shape "SHFT" { { [46,18] }, { [2,1], [44,17] } }; + shape "LCTL" { { [32,18] }, { [2,1], [30,17] } }; + shape "RCTL" { { [38,18] }, { [2,1], [36,17] } }; + shape "LALT" { { [28,18] }, { [2,1], [26,17] } }; + shape "RALT" { { [33,18] }, { [2,1], [31,17] } }; + shape "LSPC" { { [66,22] }, { [0,0], [66,22] } }; + shape "RSPC" { { [76,22] }, { [0,0], [76,22] } }; + shape "KP0" { { [37,18] }, { [2,1], [35,17] } }; + shape "KPEN" { { [18,37] }, { [2,1], [16,36] } }; + shape "LOGO" { cornerRadius= 3, { [80,35] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 9; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + + section "Function" { + top= 56; + row { + top = 1; + key.color= "grey20"; + keys { , }; + }; + row { + top = 20; + key.color= "grey20"; + keys { , }; + }; + row { + top = 39; + keys { , }; + }; + row { + top = 58; + key.color= "grey20"; + keys { , }; + }; + row { + top = 77; + key.color= "grey20"; + keys { , }; + }; + row { + top = 96; + keys { , }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 56; + left= 53; + row { + top= 1; + keys { + { , color="grey20" }, { , "BKSL", color="grey20" }, + , , , , + , , , , , + , , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { + { , color="grey20" }, { , "TABK", color="grey20" }, + , , , , , + , , , , , + , , + { , "RTRN", -14, color="grey20" } + }; + }; + row { + top= 39; + keys { + { , color="grey20" }, { , "CAPS", color="grey20" }, + , , , , , + , , , , , + }; + }; + row { + top= 58; + keys { + { , color="grey20" }, + { , "SHFT", color="grey20" }, + , , , , , + , , , , , + { , "SHFT", color="grey20" } + }; + }; + row { + top= 77; + key.color= "grey20"; + keys { + , + { , shape="LCTL" }, + { , shape="LALT" }, + { , shape="LSPC", 4, color="white" }, + { , shape="RSPC",color="white" }, + { , shape="RALT", 4 }, + { , shape="RCTL" } + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 12; + left= 365; + key.color= "grey20"; + row { + top= 1; + keys { , , }; + }; + row { + top= 45; + keys { , , }; + }; + row { + top= 64; + keys { , , }; + }; + row { + top= 102; + left= 20; + keys { }; + }; + row { + top= 121; + keys { , , }; + }; + }; // End of "Editing" section + + shape "LEDS" { cornerRadius= 3, { [ 76, 20 ] } }; + shape "LED" { cornerRadius= 0, { [ 7, 4 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 11; + left= 430; + color= "grey10"; + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 13; + indicator.shape= "LED"; + indicator "Num Lock" { left= 440; }; + indicator "Caps Lock" { left= 467; }; + indicator "Scroll Lock" { left= 489; }; + text.top= 22; + text.color= "black"; + text "NumLockLabel" { left= 438; text="Num\nLock"; }; + text "CapsLockLabel" { left= 465; text="Caps\nLock"; }; + text "ScrollLockLabel" { left= 487; text="Scroll\nLock"; }; + + logo "FlexProLogoImage" { + top= 12; + left= 45; + name= "KeyTronic"; + shape= "LOGO"; + }; + text "KeyTronicLogoText" { + top= 15; + left= 50; + width= 55; + text= "FlexPro"; + font= "times"; + slant= "o"; + weight= "bold"; + fontWidth= "narrow"; + fontSize= 36; + }; + + section "Keypad" { + top= 56; + left= 430; + row { + top= 1; + key.color= "grey20"; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , color= "grey20" } }; + }; + row { + top= 39; + keys { , , , { , color= "grey20" } }; + }; + row { + top= 58; + keys { , , , { , "KPEN", color= "grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section +}; diff --git a/xorg-server/xkeyboard-config/geometry/kinesis b/xorg-server/xkeyboard-config/geometry/kinesis index 05acf4b6e..868f5c542 100644 --- a/xorg-server/xkeyboard-config/geometry/kinesis +++ b/xorg-server/xkeyboard-config/geometry/kinesis @@ -1,191 +1,189 @@ -// $Xorg: kinesis,v 1.3 2000/08/17 19:54:35 cpqbld Exp $ -// -default xkb_geometry "model100" { - - // This is an approximate layout for a Kinesis Ergonomic keyboard - // Generated completely by eye. I didn't actually *measure* a real - // keyboard. - - description= "Kinesis Ergonomic Keyboard"; - width= 421; - height= 185; - - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "WIDE" { { [ 21,18] }, { [2,1], [19,17] } }; - shape "TALL" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "FKEY" { cornerRadius=0, { [ 10,13] } }; - shape "LED" { cornerRadius= 1.5, { [ 3, 3] } }; - shape "LOGO" { { [ 40, 10 ] } }; - shape "EDGE" { cornerRadius=5, { [ 421, 185 ] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section "LeftFunction" { - left= 15; - top= 11; - key.shape= "FKEY"; - key.gap= 3; - row { - left= 1; - top= 1; - keys { - , , , , , - , , , - }; - }; - }; // End of "LeftFunction" section - - section "RightFunction" { - left= 290; - top= 11; - key.shape= "FKEY"; - key.gap= 3; - row { - left= 1; - top= 0.2; - keys { - , , , , , - , , , - }; - }; - }; // End of "RightFunction" section - - row.vertical= True; - row.top= 1; - key.gap= 0.5; - - logo "KinesisLogoImage" { - top= 25; - left= 240; - name= "Kinesis"; - shape= "LOGO"; - }; - - indicator.shape= "LED"; - indicator.top= 30; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator "Caps Lock" { left= 23; }; - - section "LeftAlpha" { - top= 34; - left= 15; - row { - left= 2; - key.shape= "WIDE"; - keys { , , , }; - }; - row { - top= 4; - left= 24; - keys { , , { , color="grey20" }, , }; - }; - row { - left= 43; - keys { , , { , color="grey20" }, , }; - }; - row { - left= 62; - keys { , , { , color="grey20" }, , }; - }; - row { - left= 81; - keys { , , { , color="grey20" }, , }; - }; - row { - left= 100; - keys { , , , }; - }; - }; // End of "LeftAlpha" section - - indicator "NumLock" { left= 318; }; - indicator "Overlay" { left= 387; }; - section "RightAlpha" { - top= 34; - left= 290; - row { - left= 2; - keys { , , , }; - }; - row { - left= 21; - keys { , , { , color="grey20" }, , }; - }; - row { - left= 40; - keys { , , { , color="grey20" }, , }; - }; - row { - left= 59; - keys { , , { , color="grey20" }, , }; - }; - row { - top= 4; - left= 78; - keys { , , { , color="grey20" }, , }; - }; - row { - left= 97; - key.shape= "WIDE"; - keys { , , , }; - }; - overlay "KPAD" { - =, =, =, =, - =, =, =, =, - =, =, =, =, - =, =, =, =, - =, = - }; - }; // End of "RightAlpha" section - - section "LeftEdit" { - top= 109; - left= 123; - angle= 20; - row.top= -18; - row { - top= 1; - left= 1; - keys { { , "TALL" } }; - }; - row { - left= 20; - keys { , { , "TALL" } }; - }; - row { - left= 39; - keys { , , }; - }; - }; // End of "RightEdit" section - - section "RightEdit" { - top= 109; - left= 302; - angle= -20; - row.top= -18; - row { - left= -57; - keys { , , }; - }; - row { - left= -38; - keys { , { , "TALL" } }; - }; - row { - top= 1; - left= -19; - keys { { , "TALL" } }; - }; - overlay "KPAD" { - = - }; - }; // End of "Keypad" section - - alias = ; - alias = ; -}; +default xkb_geometry "model100" { + + // This is an approximate layout for a Kinesis Ergonomic keyboard + // Generated completely by eye. I didn't actually *measure* a real + // keyboard. + + description= "Kinesis Ergonomic Keyboard"; + width= 421; + height= 185; + + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "WIDE" { { [ 21,18] }, { [2,1], [19,17] } }; + shape "TALL" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "FKEY" { cornerRadius=0, { [ 10,13] } }; + shape "LED" { cornerRadius= 1.5, { [ 3, 3] } }; + shape "LOGO" { { [ 40, 10 ] } }; + shape "EDGE" { cornerRadius=5, { [ 421, 185 ] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section "LeftFunction" { + left= 15; + top= 11; + key.shape= "FKEY"; + key.gap= 3; + row { + left= 1; + top= 1; + keys { + , , , , , + , , , + }; + }; + }; // End of "LeftFunction" section + + section "RightFunction" { + left= 290; + top= 11; + key.shape= "FKEY"; + key.gap= 3; + row { + left= 1; + top= 0.2; + keys { + , , , , , + , , , + }; + }; + }; // End of "RightFunction" section + + row.vertical= True; + row.top= 1; + key.gap= 0.5; + + logo "KinesisLogoImage" { + top= 25; + left= 240; + name= "Kinesis"; + shape= "LOGO"; + }; + + indicator.shape= "LED"; + indicator.top= 30; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator "Caps Lock" { left= 23; }; + + section "LeftAlpha" { + top= 34; + left= 15; + row { + left= 2; + key.shape= "WIDE"; + keys { , , , }; + }; + row { + top= 4; + left= 24; + keys { , , { , color="grey20" }, , }; + }; + row { + left= 43; + keys { , , { , color="grey20" }, , }; + }; + row { + left= 62; + keys { , , { , color="grey20" }, , }; + }; + row { + left= 81; + keys { , , { , color="grey20" }, , }; + }; + row { + left= 100; + keys { , , , }; + }; + }; // End of "LeftAlpha" section + + indicator "NumLock" { left= 318; }; + indicator "Overlay" { left= 387; }; + section "RightAlpha" { + top= 34; + left= 290; + row { + left= 2; + keys { , , , }; + }; + row { + left= 21; + keys { , , { , color="grey20" }, , }; + }; + row { + left= 40; + keys { , , { , color="grey20" }, , }; + }; + row { + left= 59; + keys { , , { , color="grey20" }, , }; + }; + row { + top= 4; + left= 78; + keys { , , { , color="grey20" }, , }; + }; + row { + left= 97; + key.shape= "WIDE"; + keys { , , , }; + }; + overlay "KPAD" { + =, =, =, =, + =, =, =, =, + =, =, =, =, + =, =, =, =, + =, = + }; + }; // End of "RightAlpha" section + + section "LeftEdit" { + top= 109; + left= 123; + angle= 20; + row.top= -18; + row { + top= 1; + left= 1; + keys { { , "TALL" } }; + }; + row { + left= 20; + keys { , { , "TALL" } }; + }; + row { + left= 39; + keys { , , }; + }; + }; // End of "RightEdit" section + + section "RightEdit" { + top= 109; + left= 302; + angle= -20; + row.top= -18; + row { + left= -57; + keys { , , }; + }; + row { + left= -38; + keys { , { , "TALL" } }; + }; + row { + top= 1; + left= -19; + keys { { , "TALL" } }; + }; + overlay "KPAD" { + = + }; + }; // End of "Keypad" section + + alias = ; + alias = ; +}; diff --git a/xorg-server/xkeyboard-config/geometry/macintosh b/xorg-server/xkeyboard-config/geometry/macintosh index 216612262..32389445b 100644 --- a/xorg-server/xkeyboard-config/geometry/macintosh +++ b/xorg-server/xkeyboard-config/geometry/macintosh @@ -1,4 +1,3 @@ -// $XFree86: xc/programs/xkbcomp/geometry/macintosh,v 1.3 2003/08/09 14:30:47 pascal Exp $ // // Some modifications () : // - Added a key diff --git a/xorg-server/xkeyboard-config/geometry/microsoft b/xorg-server/xkeyboard-config/geometry/microsoft index ba027224f..932db6c11 100644 --- a/xorg-server/xkeyboard-config/geometry/microsoft +++ b/xorg-server/xkeyboard-config/geometry/microsoft @@ -1,535 +1,532 @@ -// $Xorg: microsoft,v 1.3 2000/08/17 19:54:35 cpqbld Exp $ -// -default xkb_geometry "natural" { - - // Approximate layout for a Microsoft Natural Keyboard - description= "Microsoft Natural Keyboard"; - width= 550; - height= 190; - - shape.cornerRadius= 1; - shape "LDEF" { { [ 18,18] }, { [2,1], [15,15] } }; - shape "TABK" { { [ 26,18] }, { [2,1], [23,15] } }; - shape "CAPS" { { [ 30,18] }, { [2,1], [23,15] } }; - shape "LFSH" { { [ 41,18] }, { [2,1], [38,15] } }; - shape "KEY6" { { [ 22,18] }, { [2,1], [15,15] } }; - shape "KEYT" { { [ 33,18] }, { [2,1], [15,15] } }; - shape "KEYG" { { [ 29,18] }, { [2,1], [15,15] } }; - shape "LCTL" { - approx= { [ 32, 22 ] }, - { [ 0, 0], [ 32, 0 ], [ 32, 23 ], [ 0, 22 ] }, - { [ 2, 1], [ 29, 1 ], [ 29, 17 ], [ 2, 15 ] } - }; - shape "LWIN" { - approx= { [ 32, 23 ] }, - { [ 0, 0], [ 32, 0 ], [ 32, 24 ], [ 0, 23 ] }, - { [ 2, 1], [ 29, 1 ], [ 29, 18 ], [ 2, 17 ] } - }; - shape "LALT" { - approx= { [ 32, 24 ] }, - { [ 0, 0], [ 32, 0 ], [ 32, 25 ], [ 0, 24 ] }, - { [ 2, 1], [ 29, 1 ], [ 29, 20 ], [ 2, 19 ] } - }; - shape "RDEF" { { [ 18,18] }, { [3,1], [15,15] } }; - shape "KEY7" { { [ 28, 18 ] }, { [ 14, 1], [26, 15] } }; - shape "KEYH" { { [ 24, 18 ] }, { [ 10, 1], [22, 15] } }; - shape "KEYN" { { [ 32, 18 ] }, { [ 18, 1], [30, 15] } }; - shape "BKSP" { { [ 41, 18 ] }, { [ 3, 1], [39, 15] } }; - shape "BKSL" { { [ 24, 18 ] }, { [ 3, 1], [22, 15] } }; - shape "RTRN" { { [ 37, 18 ] }, { [ 3, 1], [35, 15] } }; - shape "RTSH" { { [ 43, 18 ] }, { [ 3, 1], [41, 15] } }; - shape "RALT" { - approx= { [ 27, 24 ] }, - { [ 0, 0], [ 27, 0 ], [ 27, 24 ], [ 0, 25 ] }, - { [ 3, 1], [ 25, 1 ], [ 25, 19 ], [ 3, 20 ] } - }; - shape "RWIN" { - approx= { [ 27, 23 ] }, - { [ 0, 0], [ 27, 0 ], [ 27, 23 ], [ 0, 24 ] }, - { [ 3, 1], [ 25, 1 ], [ 25, 18 ], [ 3, 19 ] } - }; - shape "MENU" { - approx= { [ 27, 21 ] }, - { [ 0, 0], [ 27, 0 ], [ 27, 21 ], [ 0, 23 ] }, - { [ 3, 1], [ 25, 1 ], [ 25, 16 ], [ 3, 17 ] } - }; - shape "RCTL" { - approx= { [ 27, 19 ] }, - { [ 0, 0], [ 27, 0 ], [ 27, 19 ], [ 0, 21 ] }, - { [ 3, 1], [ 25, 1 ], [ 25, 14 ], [ 3, 15 ] } - }; - shape "KPAD" { { [ 18, 37 ] }, { [ 3, 1 ], [ 16, 34 ] } }; - shape "KP0" { { [ 37, 18 ] }, { [ 3, 1 ], [ 35, 15 ] } }; - shape "SPCE" { - { [ 4, 3], [42,10], [44, 0], [88, 0], [90,10], [130, 3], - [134,26], [99,30], [67,33], [33,30], [ 0,26] }, - { [ 6, 4.5], [43,11], [45, 1], [87, 1], [89,11], [128, 4.5], - [131,23], [99,28], [67,32], [33,28], [ 3,23] } - }; - - shape "EDGE" { - cornerRadius= 2, - { [ 25, 0 ], [ 177, 17 ], [ 329, 0 ], [ 542, 0 ], - [ 542, 150 ], [ 354, 150 ], [ 177, 185 ], [ 0, 150 ] } - }; - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - row.left= 1; - key.shape= "LDEF"; - key.gap= 1; - section "LeftFunction" { - top= 10; - left= 40; - angle= 10; - row { - top= 1; - keys { , { , 12 }, , , , }; - }; - }; // End of "LeftFunction" section - - section "LeftAlpha" { - top= 47; - left= 30; - angle= 10; - row { - top= 1; - keys { , , , , , - , { , "KEY6" } - }; - }; - row { - top= 20; - keys { { , "TABK" }, - , , , , { , "KEYT" } - }; - }; - row { - top= 39; - keys { { , "CAPS" }, - , , , , { , "KEYG" } - }; - }; - row { - top= 58; - keys { { , "LFSH" }, - , , , , - }; - }; - row { - top= 77; - keys { { , "LCTL" }, { , "LWIN" }, { , "LALT" } }; - }; - }; // End of "LeftAlpha" section - - key.shape= "RDEF"; - section "RightFunction" { - top= 32; - left= 195; - angle= -10; - row { - top= 1; - left= 1; - keys { , , , , , , }; - }; - }; // End of "RightFunction" section - - section "RightAlpha" { - top= 71; - left= 190; - angle= -10; - row.left= 1; - row { - top= 1; - keys { { , "KEY7" }, - , , , , , - { , "BKSP" } - }; - }; - row { - top= 20; - keys { - , , , , , , , - { , "BKSL" } - }; - }; - row { - top= 39; - keys { { , "KEYH" }, - , , , , , - { , "RTRN" } - }; - }; - row { - top= 58; - keys { { , "KEYN" }, - , , , , - { , "RTSH" } - }; - }; - row { - top= 77; - left= 40; - keys { { , "RALT" }, { , "RWIN" }, - { , "MENU" }, { , "RCTL" } - }; - }; - }; // End of "RightAlpha" section - - section "SpaceBar" { - top= 139; - left= 111; - key.shape= "SPCE"; - row { keys { }; }; - }; - - section "Editing" { - top= 15; - left= 385; - row { - top= 1; - keys { , , }; - }; - row { - top= 33; - keys { , , }; - }; - row { - top= 53; - keys { , , }; - }; - row { - top= 91; - left= 20; - keys { }; - }; - row { - top= 109; - keys { , , }; - }; - }; // End of "Editing" section - - shape "LED" { - cornerRadius= 0, - { [ 3, 1 ] } - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.left= 177; - indicator.shape= "LED"; - indicator "Num Lock" { top= 90; }; - indicator "Caps Lock" { top= 107; }; - indicator "Scroll Lock" { top= 127; }; - - section "Keypad" { - top= 47; - left= 456; - row { - top= 1; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - - alias = ; - alias = ; -}; - -// Approximate layout for a Microsoft Natural(R) Keyboard Elite -// -// Modified from // $Xorg: microsoft,v 1.3 2000/08/17 19:54:35 cpqbld Exp $ -// by Pavel Kurashov Mon Oct 8 22:08:20 NOVST 2007 -// -// * Function, editing and navigation keys are reduced height -// * Navigation keys are repositioned in two column -// * Leds are enlarged for better look -// * "BKSP" alligned with "BKSL" and "RTRN" -// * Ouline Edges slightly modified -// -xkb_geometry "elite" { - - // Approximate layout for a Microsoft Natural(R) Keyboard Elite - description= "Microsoft Natural(r) Keyboard Elite"; - width= 495; - height= 190; - - shape.cornerRadius= 1; - shape "LDEF" { { [ 18,18] }, { [2,1], [15,15] } }; - shape "FKEY" { { [ 18,13] }, { [2,1], [15,10] } }; - shape "TABK" { { [ 26,18] }, { [2,1], [23,15] } }; - shape "CAPS" { { [ 30,18] }, { [2,1], [23,15] } }; - shape "LFSH" { { [ 41,18] }, { [2,1], [38,15] } }; - shape "KEY6" { { [ 22,18] }, { [2,1], [15,15] } }; - shape "KEYT" { { [ 33,18] }, { [2,1], [15,15] } }; - shape "KEYG" { { [ 29,18] }, { [2,1], [15,15] } }; - shape "LCTL" { - approx= { [ 32, 22 ] }, - { [ 0, 0], [ 32, 0 ], [ 32, 23 ], [ 0, 22 ] }, - { [ 2, 1], [ 29, 1 ], [ 29, 17 ], [ 2, 15 ] } - }; - shape "LWIN" { - approx= { [ 32, 23 ] }, - { [ 0, 0], [ 32, 0 ], [ 32, 24 ], [ 0, 23 ] }, - { [ 2, 1], [ 29, 1 ], [ 29, 18 ], [ 2, 17 ] } - }; - shape "LALT" { - approx= { [ 32, 24 ] }, - { [ 0, 0], [ 32, 0 ], [ 32, 25 ], [ 0, 24 ] }, - { [ 2, 1], [ 29, 1 ], [ 29, 20 ], [ 2, 19 ] } - }; - shape "RDEF" { { [ 18,18 ] }, { [ 2, 1], [15, 15] } }; - shape "KEY7" { { [ 28, 18 ] }, { [ 14, 1], [26, 15] } }; - shape "KEYH" { { [ 24, 18 ] }, { [ 10, 1], [22, 15] } }; - shape "KEYN" { { [ 32, 18 ] }, { [ 18, 1], [30, 15] } }; - shape "BKSP" { { [ 32, 18 ] }, { [ 2, 1], [30, 15] } }; - shape "BKSL" { { [ 24, 18 ] }, { [ 2, 1], [22, 15] } }; - shape "RTRN" { { [ 37, 18 ] }, { [ 2, 1], [35, 15] } }; - shape "RTSH" { { [ 43, 18 ] }, { [ 2, 1], [41, 15] } }; - shape "RALT" { - approx= { [ 27, 24 ] }, - { [ 0, 0], [ 27, 0 ], [ 27, 24 ], [ 0, 25 ] }, - { [ 3, 1], [ 25, 1 ], [ 25, 19 ], [ 3, 20 ] } - }; - shape "RWIN" { - approx= { [ 27, 23 ] }, - { [ 0, 0], [ 27, 0 ], [ 27, 23 ], [ 0, 24 ] }, - { [ 3, 1], [ 25, 1 ], [ 25, 18 ], [ 3, 19 ] } - }; - shape "MENU" { - approx= { [ 27, 21 ] }, - { [ 0, 0], [ 27, 0 ], [ 27, 21 ], [ 0, 23 ] }, - { [ 3, 1], [ 25, 1 ], [ 25, 16 ], [ 3, 17 ] } - }; - shape "RCTL" { - approx= { [ 27, 19 ] }, - { [ 0, 0], [ 27, 0 ], [ 27, 19 ], [ 0, 21 ] }, - { [ 3, 1], [ 25, 1 ], [ 25, 14 ], [ 3, 15 ] } - }; - shape "KPAD" { { [ 18, 37 ] }, { [ 3, 1 ], [ 16, 34 ] } }; - shape "KP0" { { [ 37, 18 ] }, { [ 3, 1 ], [ 35, 15 ] } }; - shape "SPCE" { - { [ 4, 3], [42,10], [44, 0], [88, 0], [90,10], [130, 3], - [134,26], [99,30], [67,33], [33,30], [ 0,26] }, - { [ 6, 4.5], [43,11], [45, 1], [87, 1], [89,11], [128, 4.5], - [131,23], [99,28], [67,32], [33,28], [ 3,23] } - }; - - shape "EDGE" { - cornerRadius= 3, - { [ 32, 15 ], [140, 33],[ 220, 33 ], [ 329, 15 ], [ 493, 15 ], - [ 493, 150 ], [ 354, 150 ], [200, 180], [ 153, 180 ], [ 7, 150 ] } - }; - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - row.left= 1; - key.shape= "FKEY"; - key.gap= 1; - section "LeftFunction" { - top= 26; - left= 40; - angle= 10; - row { - top= 1; - keys { , { , 12 }, , , , }; - }; - }; // End of "LeftFunction" section - - key.shape= "LDEF"; - section "LeftAlpha" { - top= 47; - left= 30; - angle= 10; - row { - top= 1; - keys { , , , , , - , { , "KEY6" } - }; - }; - row { - top= 20; - keys { { , "TABK" }, - , , , , { , "KEYT" } - }; - }; - row { - top= 39; - keys { { , "CAPS" }, - , , , , { , "KEYG" } - }; - }; - row { - top= 58; - keys { { , "LFSH" }, - , , , , - }; - }; - row { - top= 77; - keys { { , "LCTL" }, { , "LWIN" }, { , "LALT" } }; - }; - }; // End of "LeftAlpha" section - - key.shape= "FKEY"; - section "RightFunction" { - top= 48; - left= 195; - angle= -10; - row { - top= 1; - left= 1; - keys { , , , , , , }; - }; - }; // End of "RightFunction" section - - key.shape= "RDEF"; - section "RightAlpha" { - top= 71; - left= 190; - angle= -10; - row.left= 1; - row { - top= 1; - keys { { , "KEY7" }, - , , , , , - { , "BKSP" } - }; - }; - row { - top= 20; - keys { - , , , , , , , - { , "BKSL" } - }; - }; - row { - top= 39; - keys { { , "KEYH" }, - , , , , , - { , "RTRN" } - }; - }; - row { - top= 58; - keys { { , "KEYN" }, - , , , , - { , "RTSH" } - }; - }; - row { - top= 77; - left= 40; - keys { { , "RALT" }, { , "RWIN" }, - { , "MENU" }, { , "RCTL" } - }; - }; - }; // End of "RightAlpha" section - - section "SpaceBar" { - top= 139; - left= 111; - key.shape= "SPCE"; - row { keys { }; }; - }; - - section "Editing" { - key.shape="FKEY"; - top= 23; - left= 348; - row { - top= 0; - keys { , , }; - }; - row { - top= 22; - left=20; - keys { , }; - }; - row { - top= 36; - left=20; - keys { , }; - }; - row { - top= 50; - left=20; - keys { , }; - }; - row { - top= 75; - left= 29; - keys { }; - }; - row { - top= 89; - left=20; - keys { , }; - }; - row { - top= 103; - left=29; - keys { }; - }; - }; // End of "Editing" section - - shape "LED" { - cornerRadius= 1, - { [ 7, 2 ] } - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.left= 177; - indicator.shape= "LED"; - indicator "Num Lock" { top= 90; }; - indicator "Caps Lock" { top= 107; }; - indicator "Scroll Lock" { top= 127; }; - - section "Keypad" { - top= 44; - left= 412; - row { - top= 1; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - - alias = ; - alias = ; -}; +default xkb_geometry "natural" { + + // Approximate layout for a Microsoft Natural Keyboard + description= "Microsoft Natural Keyboard"; + width= 550; + height= 190; + + shape.cornerRadius= 1; + shape "LDEF" { { [ 18,18] }, { [2,1], [15,15] } }; + shape "TABK" { { [ 26,18] }, { [2,1], [23,15] } }; + shape "CAPS" { { [ 30,18] }, { [2,1], [23,15] } }; + shape "LFSH" { { [ 41,18] }, { [2,1], [38,15] } }; + shape "KEY6" { { [ 22,18] }, { [2,1], [15,15] } }; + shape "KEYT" { { [ 33,18] }, { [2,1], [15,15] } }; + shape "KEYG" { { [ 29,18] }, { [2,1], [15,15] } }; + shape "LCTL" { + approx= { [ 32, 22 ] }, + { [ 0, 0], [ 32, 0 ], [ 32, 23 ], [ 0, 22 ] }, + { [ 2, 1], [ 29, 1 ], [ 29, 17 ], [ 2, 15 ] } + }; + shape "LWIN" { + approx= { [ 32, 23 ] }, + { [ 0, 0], [ 32, 0 ], [ 32, 24 ], [ 0, 23 ] }, + { [ 2, 1], [ 29, 1 ], [ 29, 18 ], [ 2, 17 ] } + }; + shape "LALT" { + approx= { [ 32, 24 ] }, + { [ 0, 0], [ 32, 0 ], [ 32, 25 ], [ 0, 24 ] }, + { [ 2, 1], [ 29, 1 ], [ 29, 20 ], [ 2, 19 ] } + }; + shape "RDEF" { { [ 18,18] }, { [3,1], [15,15] } }; + shape "KEY7" { { [ 28, 18 ] }, { [ 14, 1], [26, 15] } }; + shape "KEYH" { { [ 24, 18 ] }, { [ 10, 1], [22, 15] } }; + shape "KEYN" { { [ 32, 18 ] }, { [ 18, 1], [30, 15] } }; + shape "BKSP" { { [ 41, 18 ] }, { [ 3, 1], [39, 15] } }; + shape "BKSL" { { [ 24, 18 ] }, { [ 3, 1], [22, 15] } }; + shape "RTRN" { { [ 37, 18 ] }, { [ 3, 1], [35, 15] } }; + shape "RTSH" { { [ 43, 18 ] }, { [ 3, 1], [41, 15] } }; + shape "RALT" { + approx= { [ 27, 24 ] }, + { [ 0, 0], [ 27, 0 ], [ 27, 24 ], [ 0, 25 ] }, + { [ 3, 1], [ 25, 1 ], [ 25, 19 ], [ 3, 20 ] } + }; + shape "RWIN" { + approx= { [ 27, 23 ] }, + { [ 0, 0], [ 27, 0 ], [ 27, 23 ], [ 0, 24 ] }, + { [ 3, 1], [ 25, 1 ], [ 25, 18 ], [ 3, 19 ] } + }; + shape "MENU" { + approx= { [ 27, 21 ] }, + { [ 0, 0], [ 27, 0 ], [ 27, 21 ], [ 0, 23 ] }, + { [ 3, 1], [ 25, 1 ], [ 25, 16 ], [ 3, 17 ] } + }; + shape "RCTL" { + approx= { [ 27, 19 ] }, + { [ 0, 0], [ 27, 0 ], [ 27, 19 ], [ 0, 21 ] }, + { [ 3, 1], [ 25, 1 ], [ 25, 14 ], [ 3, 15 ] } + }; + shape "KPAD" { { [ 18, 37 ] }, { [ 3, 1 ], [ 16, 34 ] } }; + shape "KP0" { { [ 37, 18 ] }, { [ 3, 1 ], [ 35, 15 ] } }; + shape "SPCE" { + { [ 4, 3], [42,10], [44, 0], [88, 0], [90,10], [130, 3], + [134,26], [99,30], [67,33], [33,30], [ 0,26] }, + { [ 6, 4.5], [43,11], [45, 1], [87, 1], [89,11], [128, 4.5], + [131,23], [99,28], [67,32], [33,28], [ 3,23] } + }; + + shape "EDGE" { + cornerRadius= 2, + { [ 25, 0 ], [ 177, 17 ], [ 329, 0 ], [ 542, 0 ], + [ 542, 150 ], [ 354, 150 ], [ 177, 185 ], [ 0, 150 ] } + }; + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + row.left= 1; + key.shape= "LDEF"; + key.gap= 1; + section "LeftFunction" { + top= 10; + left= 40; + angle= 10; + row { + top= 1; + keys { , { , 12 }, , , , }; + }; + }; // End of "LeftFunction" section + + section "LeftAlpha" { + top= 47; + left= 30; + angle= 10; + row { + top= 1; + keys { , , , , , + , { , "KEY6" } + }; + }; + row { + top= 20; + keys { { , "TABK" }, + , , , , { , "KEYT" } + }; + }; + row { + top= 39; + keys { { , "CAPS" }, + , , , , { , "KEYG" } + }; + }; + row { + top= 58; + keys { { , "LFSH" }, + , , , , + }; + }; + row { + top= 77; + keys { { , "LCTL" }, { , "LWIN" }, { , "LALT" } }; + }; + }; // End of "LeftAlpha" section + + key.shape= "RDEF"; + section "RightFunction" { + top= 32; + left= 195; + angle= -10; + row { + top= 1; + left= 1; + keys { , , , , , , }; + }; + }; // End of "RightFunction" section + + section "RightAlpha" { + top= 71; + left= 190; + angle= -10; + row.left= 1; + row { + top= 1; + keys { { , "KEY7" }, + , , , , , + { , "BKSP" } + }; + }; + row { + top= 20; + keys { + , , , , , , , + { , "BKSL" } + }; + }; + row { + top= 39; + keys { { , "KEYH" }, + , , , , , + { , "RTRN" } + }; + }; + row { + top= 58; + keys { { , "KEYN" }, + , , , , + { , "RTSH" } + }; + }; + row { + top= 77; + left= 40; + keys { { , "RALT" }, { , "RWIN" }, + { , "MENU" }, { , "RCTL" } + }; + }; + }; // End of "RightAlpha" section + + section "SpaceBar" { + top= 139; + left= 111; + key.shape= "SPCE"; + row { keys { }; }; + }; + + section "Editing" { + top= 15; + left= 385; + row { + top= 1; + keys { , , }; + }; + row { + top= 33; + keys { , , }; + }; + row { + top= 53; + keys { , , }; + }; + row { + top= 91; + left= 20; + keys { }; + }; + row { + top= 109; + keys { , , }; + }; + }; // End of "Editing" section + + shape "LED" { + cornerRadius= 0, + { [ 3, 1 ] } + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.left= 177; + indicator.shape= "LED"; + indicator "Num Lock" { top= 90; }; + indicator "Caps Lock" { top= 107; }; + indicator "Scroll Lock" { top= 127; }; + + section "Keypad" { + top= 47; + left= 456; + row { + top= 1; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + + alias = ; + alias = ; +}; + +// Approximate layout for a Microsoft Natural(R) Keyboard Elite +// +// Modified by Pavel Kurashov Mon Oct 8 22:08:20 NOVST 2007 +// +// * Function, editing and navigation keys are reduced height +// * Navigation keys are repositioned in two column +// * Leds are enlarged for better look +// * "BKSP" alligned with "BKSL" and "RTRN" +// * Ouline Edges slightly modified +// +xkb_geometry "elite" { + + // Approximate layout for a Microsoft Natural(R) Keyboard Elite + description= "Microsoft Natural(r) Keyboard Elite"; + width= 495; + height= 190; + + shape.cornerRadius= 1; + shape "LDEF" { { [ 18,18] }, { [2,1], [15,15] } }; + shape "FKEY" { { [ 18,13] }, { [2,1], [15,10] } }; + shape "TABK" { { [ 26,18] }, { [2,1], [23,15] } }; + shape "CAPS" { { [ 30,18] }, { [2,1], [23,15] } }; + shape "LFSH" { { [ 41,18] }, { [2,1], [38,15] } }; + shape "KEY6" { { [ 22,18] }, { [2,1], [15,15] } }; + shape "KEYT" { { [ 33,18] }, { [2,1], [15,15] } }; + shape "KEYG" { { [ 29,18] }, { [2,1], [15,15] } }; + shape "LCTL" { + approx= { [ 32, 22 ] }, + { [ 0, 0], [ 32, 0 ], [ 32, 23 ], [ 0, 22 ] }, + { [ 2, 1], [ 29, 1 ], [ 29, 17 ], [ 2, 15 ] } + }; + shape "LWIN" { + approx= { [ 32, 23 ] }, + { [ 0, 0], [ 32, 0 ], [ 32, 24 ], [ 0, 23 ] }, + { [ 2, 1], [ 29, 1 ], [ 29, 18 ], [ 2, 17 ] } + }; + shape "LALT" { + approx= { [ 32, 24 ] }, + { [ 0, 0], [ 32, 0 ], [ 32, 25 ], [ 0, 24 ] }, + { [ 2, 1], [ 29, 1 ], [ 29, 20 ], [ 2, 19 ] } + }; + shape "RDEF" { { [ 18,18 ] }, { [ 2, 1], [15, 15] } }; + shape "KEY7" { { [ 28, 18 ] }, { [ 14, 1], [26, 15] } }; + shape "KEYH" { { [ 24, 18 ] }, { [ 10, 1], [22, 15] } }; + shape "KEYN" { { [ 32, 18 ] }, { [ 18, 1], [30, 15] } }; + shape "BKSP" { { [ 32, 18 ] }, { [ 2, 1], [30, 15] } }; + shape "BKSL" { { [ 24, 18 ] }, { [ 2, 1], [22, 15] } }; + shape "RTRN" { { [ 37, 18 ] }, { [ 2, 1], [35, 15] } }; + shape "RTSH" { { [ 43, 18 ] }, { [ 2, 1], [41, 15] } }; + shape "RALT" { + approx= { [ 27, 24 ] }, + { [ 0, 0], [ 27, 0 ], [ 27, 24 ], [ 0, 25 ] }, + { [ 3, 1], [ 25, 1 ], [ 25, 19 ], [ 3, 20 ] } + }; + shape "RWIN" { + approx= { [ 27, 23 ] }, + { [ 0, 0], [ 27, 0 ], [ 27, 23 ], [ 0, 24 ] }, + { [ 3, 1], [ 25, 1 ], [ 25, 18 ], [ 3, 19 ] } + }; + shape "MENU" { + approx= { [ 27, 21 ] }, + { [ 0, 0], [ 27, 0 ], [ 27, 21 ], [ 0, 23 ] }, + { [ 3, 1], [ 25, 1 ], [ 25, 16 ], [ 3, 17 ] } + }; + shape "RCTL" { + approx= { [ 27, 19 ] }, + { [ 0, 0], [ 27, 0 ], [ 27, 19 ], [ 0, 21 ] }, + { [ 3, 1], [ 25, 1 ], [ 25, 14 ], [ 3, 15 ] } + }; + shape "KPAD" { { [ 18, 37 ] }, { [ 3, 1 ], [ 16, 34 ] } }; + shape "KP0" { { [ 37, 18 ] }, { [ 3, 1 ], [ 35, 15 ] } }; + shape "SPCE" { + { [ 4, 3], [42,10], [44, 0], [88, 0], [90,10], [130, 3], + [134,26], [99,30], [67,33], [33,30], [ 0,26] }, + { [ 6, 4.5], [43,11], [45, 1], [87, 1], [89,11], [128, 4.5], + [131,23], [99,28], [67,32], [33,28], [ 3,23] } + }; + + shape "EDGE" { + cornerRadius= 3, + { [ 32, 15 ], [140, 33],[ 220, 33 ], [ 329, 15 ], [ 493, 15 ], + [ 493, 150 ], [ 354, 150 ], [200, 180], [ 153, 180 ], [ 7, 150 ] } + }; + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + row.left= 1; + key.shape= "FKEY"; + key.gap= 1; + section "LeftFunction" { + top= 26; + left= 40; + angle= 10; + row { + top= 1; + keys { , { , 12 }, , , , }; + }; + }; // End of "LeftFunction" section + + key.shape= "LDEF"; + section "LeftAlpha" { + top= 47; + left= 30; + angle= 10; + row { + top= 1; + keys { , , , , , + , { , "KEY6" } + }; + }; + row { + top= 20; + keys { { , "TABK" }, + , , , , { , "KEYT" } + }; + }; + row { + top= 39; + keys { { , "CAPS" }, + , , , , { , "KEYG" } + }; + }; + row { + top= 58; + keys { { , "LFSH" }, + , , , , + }; + }; + row { + top= 77; + keys { { , "LCTL" }, { , "LWIN" }, { , "LALT" } }; + }; + }; // End of "LeftAlpha" section + + key.shape= "FKEY"; + section "RightFunction" { + top= 48; + left= 195; + angle= -10; + row { + top= 1; + left= 1; + keys { , , , , , , }; + }; + }; // End of "RightFunction" section + + key.shape= "RDEF"; + section "RightAlpha" { + top= 71; + left= 190; + angle= -10; + row.left= 1; + row { + top= 1; + keys { { , "KEY7" }, + , , , , , + { , "BKSP" } + }; + }; + row { + top= 20; + keys { + , , , , , , , + { , "BKSL" } + }; + }; + row { + top= 39; + keys { { , "KEYH" }, + , , , , , + { , "RTRN" } + }; + }; + row { + top= 58; + keys { { , "KEYN" }, + , , , , + { , "RTSH" } + }; + }; + row { + top= 77; + left= 40; + keys { { , "RALT" }, { , "RWIN" }, + { , "MENU" }, { , "RCTL" } + }; + }; + }; // End of "RightAlpha" section + + section "SpaceBar" { + top= 139; + left= 111; + key.shape= "SPCE"; + row { keys { }; }; + }; + + section "Editing" { + key.shape="FKEY"; + top= 23; + left= 348; + row { + top= 0; + keys { , , }; + }; + row { + top= 22; + left=20; + keys { , }; + }; + row { + top= 36; + left=20; + keys { , }; + }; + row { + top= 50; + left=20; + keys { , }; + }; + row { + top= 75; + left= 29; + keys { }; + }; + row { + top= 89; + left=20; + keys { , }; + }; + row { + top= 103; + left=29; + keys { }; + }; + }; // End of "Editing" section + + shape "LED" { + cornerRadius= 1, + { [ 7, 2 ] } + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.left= 177; + indicator.shape= "LED"; + indicator "Num Lock" { top= 90; }; + indicator "Caps Lock" { top= 107; }; + indicator "Scroll Lock" { top= 127; }; + + section "Keypad" { + top= 44; + left= 412; + row { + top= 1; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + + alias = ; + alias = ; +}; diff --git a/xorg-server/xkeyboard-config/geometry/nec b/xorg-server/xkeyboard-config/geometry/nec index 189d9ca7c..e6c00d3ff 100644 --- a/xorg-server/xkeyboard-config/geometry/nec +++ b/xorg-server/xkeyboard-config/geometry/nec @@ -1,159 +1,157 @@ -// $Xorg: nec,v 1.4 2001/02/09 02:05:50 xorgcvs Exp $ -// -//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. -// -// $XFree86: xc/programs/xkbcomp/geometry/nec,v 3.4 2001/01/17 23:45:49 dawes Exp $ - -default xkb_geometry "pc98" { - - description= "Generic PC98"; - width= 405; - height= 172; - - shape.cornerRadius= 1; - shape "NORM" { { [ 17,18] }, { [2,1], [ 15,17] } }; - shape "RTRN" { { [ 20,37] }, { [2,1], [ 18,35] } }; - shape "LFSH" { { [ 42,18] }, { [2,1], [ 40,17] } }; - shape "RTSH" { { [ 31,18] }, { [2,1], [ 29,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [ 26,17] } }; - shape "SPCE" { { [115,18] }, { [2,1], [113,17] } }; - shape "FUNC" { { [ 21,18] }, { [2,1], [ 19,17] } }; - shape "BKSP" { { [ 18,18] }, { [2,1], [ 16,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [ 16,36] } }; - shape "TABK" { { [ 30,18] }, { [2,1], [ 28,17] } }; - shape "ARRW" { { [ 35,18] }, { [2,1], [ 33,17] } }; - - section.left= 8; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 29; - row { - top= 1; - key.shape="FUNC"; - keys { { , "NORM" }, { , "NORM", 5 }, - { , 6 }, , , , , - { , 6 }, , , , , - { , 6 }, , , , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 54; - row { - top= 1; - keys { { , shape="BKSP"}, - , , , , - , , , , , - , , , , - { , "BKSP" } - }; - }; - row { - top= 20; - keys { { , "TABK" }, - , , , , , - , , , , , - , , { , "RTRN", 6 } - }; - }; - row { - top= 39; - keys { , , - , , , , , - , , , , , - , - }; - }; - row { - top= 58; - keys { { , "LFSH" }, - , , , , , - , , , , , , - { , "RTSH" } - }; - }; - row { - top= 77; - keys { { , 35 } , , { , "FUNC" }, - { , "SPCE" }, { , "FUNC" } - - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 54; - left= 281; - row { - top= 1; - keys { , }; - }; - row { - top= 20; - keys { , }; - }; - row { - top= 39; - keys { { , "ARRW" } }; - }; - row { - top= 58; - keys { , }; - }; - row { - top= 77; - keys { { , "ARRW" } }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 54; - left= 320; - row { - top= 1; - keys { , , , }; - }; - row { - top= 20; - keys { , , , }; - }; - row { - top= 39; - keys { , , , }; - }; - row { - top= 58; - keys { , , , }; - }; - row { - top= 77; - keys { , , , }; - }; - }; // End of "Keypad" section - -}; // End of "pc98" geometry +// +//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. +// + +default xkb_geometry "pc98" { + + description= "Generic PC98"; + width= 405; + height= 172; + + shape.cornerRadius= 1; + shape "NORM" { { [ 17,18] }, { [2,1], [ 15,17] } }; + shape "RTRN" { { [ 20,37] }, { [2,1], [ 18,35] } }; + shape "LFSH" { { [ 42,18] }, { [2,1], [ 40,17] } }; + shape "RTSH" { { [ 31,18] }, { [2,1], [ 29,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [ 26,17] } }; + shape "SPCE" { { [115,18] }, { [2,1], [113,17] } }; + shape "FUNC" { { [ 21,18] }, { [2,1], [ 19,17] } }; + shape "BKSP" { { [ 18,18] }, { [2,1], [ 16,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [ 16,36] } }; + shape "TABK" { { [ 30,18] }, { [2,1], [ 28,17] } }; + shape "ARRW" { { [ 35,18] }, { [2,1], [ 33,17] } }; + + section.left= 8; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 29; + row { + top= 1; + key.shape="FUNC"; + keys { { , "NORM" }, { , "NORM", 5 }, + { , 6 }, , , , , + { , 6 }, , , , , + { , 6 }, , , , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 54; + row { + top= 1; + keys { { , shape="BKSP"}, + , , , , + , , , , , + , , , , + { , "BKSP" } + }; + }; + row { + top= 20; + keys { { , "TABK" }, + , , , , , + , , , , , + , , { , "RTRN", 6 } + }; + }; + row { + top= 39; + keys { , , + , , , , , + , , , , , + , + }; + }; + row { + top= 58; + keys { { , "LFSH" }, + , , , , , + , , , , , , + { , "RTSH" } + }; + }; + row { + top= 77; + keys { { , 35 } , , { , "FUNC" }, + { , "SPCE" }, { , "FUNC" } + + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 54; + left= 281; + row { + top= 1; + keys { , }; + }; + row { + top= 20; + keys { , }; + }; + row { + top= 39; + keys { { , "ARRW" } }; + }; + row { + top= 58; + keys { , }; + }; + row { + top= 77; + keys { { , "ARRW" } }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 54; + left= 320; + row { + top= 1; + keys { , , , }; + }; + row { + top= 20; + keys { , , , }; + }; + row { + top= 39; + keys { , , , }; + }; + row { + top= 58; + keys { , , , }; + }; + row { + top= 77; + keys { , , , }; + }; + }; // End of "Keypad" section + +}; // End of "pc98" geometry diff --git a/xorg-server/xkeyboard-config/geometry/northgate b/xorg-server/xkeyboard-config/geometry/northgate index cf0c6f477..cec2e35a3 100644 --- a/xorg-server/xkeyboard-config/geometry/northgate +++ b/xorg-server/xkeyboard-config/geometry/northgate @@ -1,170 +1,168 @@ -// $Xorg: northgate,v 1.3 2000/08/17 19:54:36 cpqbld Exp $ -// -default xkb_geometry "omnikey101" { - - description= "North Gate Omnikey 101"; - width= 470; - height= 175; - - shape.cornerRadius= 1; - shape "NORM" { { [18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [34,18] }, { [2,1], [32,17] } }; - shape "TABK" { { [27,18] }, { [2,1], [25,17] } }; - shape "RTRN" { - approx = { [15, 0], [40,37] }, - { [15, 0], [40, 0], [40,37], - [ 0,37], [ 0,19], [15,19] }, - { [17, 1], [38, 1], [38,36], - [ 2,36], [ 2,20], [17,20] } - }; - shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "LFSH" { { [ 41,18] }, { [2,1], [39,17] } }; - shape "RTSH" { { [ 30,18] }, { [2,1], [28,17] } }; - shape "MODK" { { [ 26,18] }, { [2,1], [24,17] } }; - shape "SPCE" { { [129,18] }, { [2,1], [127,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - - shape "LEDS" { cornerRadius= 0, { [ 76 ,20 ] } }; - shape "LED" { cornerRadius= 0, { [ 1, 3 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 32; - left= 375; - color= "grey10"; - }; - - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 46.5; - indicator.shape= "LED"; - indicator "Num Lock" { left= 384; }; - indicator "Caps Lock" { left= 409; }; - indicator "Scroll Lock" { left= 434; }; - text.top= 34; - text.color= "black"; - text "NumLockLabel" { left= 380.5; text="Num\nLock"; }; - text "CapsLockLabel" { left= 405; text="Caps\nLock"; }; - text "ScrollLockLabel" { left= 430; text="Scroll\nLock"; }; - - section.left= 19; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 32; - row { - top= 1; - keys { { , color="grey20" }, - { , 18}, , , , - { , 9 }, , , , - { , 9 }, , , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 65; - row { - top= 1; - keys { , , , , , - , , , , , - , , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { { , "TABK", color="grey20" }, - , , , , , - , , , , , - , , - { , "RTRN", -14, color="grey20" } - }; - }; - row { - top= 39; - keys { { , "CAPS", color="grey20" }, - , , , , , - , , , , , - - }; - }; - row { - top= 58; - keys { { , "LFSH", color="grey20" }, - , , , , , - , , , , , - { , "RTSH", color="grey20" }, - }; - }; - row { - top= 77; - key.shape= "MODK"; - key.color= "grey20"; - keys { , - { , 23 }, - { , "SPCE", color="white" }, - , - { , 23 } - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 32; - left= 308; - key.color= "grey20"; - row { - top= 1; - keys { , , }; - }; - row { - top= 33; - keys { , , }; - }; - row { - top= 53; - keys { , , }; - }; - row { - top= 91; - left= 20; - keys { }; - }; - row { - top= 110; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 65; - left= 374; - row { - top= 1; - key.color= "grey20"; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - - alias = ; - alias = ; - -}; // End of "default" geometry +default xkb_geometry "omnikey101" { + + description= "North Gate Omnikey 101"; + width= 470; + height= 175; + + shape.cornerRadius= 1; + shape "NORM" { { [18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [34,18] }, { [2,1], [32,17] } }; + shape "TABK" { { [27,18] }, { [2,1], [25,17] } }; + shape "RTRN" { + approx = { [15, 0], [40,37] }, + { [15, 0], [40, 0], [40,37], + [ 0,37], [ 0,19], [15,19] }, + { [17, 1], [38, 1], [38,36], + [ 2,36], [ 2,20], [17,20] } + }; + shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "LFSH" { { [ 41,18] }, { [2,1], [39,17] } }; + shape "RTSH" { { [ 30,18] }, { [2,1], [28,17] } }; + shape "MODK" { { [ 26,18] }, { [2,1], [24,17] } }; + shape "SPCE" { { [129,18] }, { [2,1], [127,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + + shape "LEDS" { cornerRadius= 0, { [ 76 ,20 ] } }; + shape "LED" { cornerRadius= 0, { [ 1, 3 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 32; + left= 375; + color= "grey10"; + }; + + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 46.5; + indicator.shape= "LED"; + indicator "Num Lock" { left= 384; }; + indicator "Caps Lock" { left= 409; }; + indicator "Scroll Lock" { left= 434; }; + text.top= 34; + text.color= "black"; + text "NumLockLabel" { left= 380.5; text="Num\nLock"; }; + text "CapsLockLabel" { left= 405; text="Caps\nLock"; }; + text "ScrollLockLabel" { left= 430; text="Scroll\nLock"; }; + + section.left= 19; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 32; + row { + top= 1; + keys { { , color="grey20" }, + { , 18}, , , , + { , 9 }, , , , + { , 9 }, , , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 65; + row { + top= 1; + keys { , , , , , + , , , , , + , , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { { , "TABK", color="grey20" }, + , , , , , + , , , , , + , , + { , "RTRN", -14, color="grey20" } + }; + }; + row { + top= 39; + keys { { , "CAPS", color="grey20" }, + , , , , , + , , , , , + + }; + }; + row { + top= 58; + keys { { , "LFSH", color="grey20" }, + , , , , , + , , , , , + { , "RTSH", color="grey20" }, + }; + }; + row { + top= 77; + key.shape= "MODK"; + key.color= "grey20"; + keys { , + { , 23 }, + { , "SPCE", color="white" }, + , + { , 23 } + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 32; + left= 308; + key.color= "grey20"; + row { + top= 1; + keys { , , }; + }; + row { + top= 33; + keys { , , }; + }; + row { + top= 53; + keys { , , }; + }; + row { + top= 91; + left= 20; + keys { }; + }; + row { + top= 110; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 65; + left= 374; + row { + top= 1; + key.color= "grey20"; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + + alias = ; + alias = ; + +}; // End of "default" geometry diff --git a/xorg-server/xkeyboard-config/geometry/pc b/xorg-server/xkeyboard-config/geometry/pc index cd951034f..91e8dd7e1 100644 --- a/xorg-server/xkeyboard-config/geometry/pc +++ b/xorg-server/xkeyboard-config/geometry/pc @@ -1,4 +1,3 @@ -// $Xorg: pc,v 1.4 2001/02/09 02:05:50 xorgcvs Exp $ // //Copyright 1996, 1998 The Open Group // @@ -24,7 +23,6 @@ //other dealings in this Software without prior written authorization //from The Open Group. // -// $XFree86: xc/programs/xkbcomp/geometry/pc,v 3.14 2003/08/09 14:30:47 pascal Exp $ default xkb_geometry "pc101" { diff --git a/xorg-server/xkeyboard-config/geometry/sanwa b/xorg-server/xkeyboard-config/geometry/sanwa index 5434bdf43..af134d725 100644 --- a/xorg-server/xkeyboard-config/geometry/sanwa +++ b/xorg-server/xkeyboard-config/geometry/sanwa @@ -1,4 +1,3 @@ -// $Xorg: $ // //Copyright 1996, 1998 The Open Group // diff --git a/xorg-server/xkeyboard-config/geometry/sgi_vndr/O2 b/xorg-server/xkeyboard-config/geometry/sgi_vndr/O2 index c321fe398..afaed76f2 100644 --- a/xorg-server/xkeyboard-config/geometry/sgi_vndr/O2 +++ b/xorg-server/xkeyboard-config/geometry/sgi_vndr/O2 @@ -1,616 +1,614 @@ -// $Xorg: O2,v 1.3 2000/08/17 19:54:36 cpqbld Exp $ -// -// Copyright (c) 1996 by Silicon Graphics Computer Systems, Inc. -// -// 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 Silicon Graphics not be -// used in advertising or publicity pertaining to distribution -// of the software without specific prior written permission. -// Silicon Graphics makes no representation about the suitability -// of this software for any purpose. It is provided "as is" -// without any express or implied warranty. -// -// SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -// SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -// GRAPHICS 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. -// -default xkb_geometry "pc101" { - - // This is an approximate layout for a 101-key (US/ASCII) SGI - // keyboard. I just took a similar layout (101 key PC keyboard) - // and adjusted the sizes of a few keys by eye. I didn't actually - // *measure* a real keyboard. - - description= "101-key keyboard for Silicon Graphics O2"; - - width= 448; - height= 162; - - shape "EDGE" { - cornerRadius= 2, - { [ 15, 0 ], [ 433, 0 ], [ 433, 10 ], [ 448, 10 ], - [ 448, 162 ], [ 0, 162 ], [ 0, 10 ], [ 15, 10 ] } - }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "TABK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "BKSL" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "RTRN" { { [ 40,18] }, { [2,1], [37,17] } }; - shape "CAPS" { { [ 34,18] }, { [2,1], [29,17] } }; - shape "RTSH" { { [ 49,18] }, { [2,1], [47,17] } }; - shape "LFSH" { { [ 44,18] }, { [2,1], [42,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [130,18] }, { [2,1], [128,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "LOGO" { { [ 12,12] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 6; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 25; - row { - top= 1; - keys { { , color="grey20" }, - { , 19}, , , , - { , 11}, , , , - { , 11}, , , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 58; - row { - top= 1; - keys { , , , , , - , , , , , - , , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { { , "TABK", color= "grey20" }, - , , , , , - , , , , , - , , - { , "BKSL" } - }; - }; - row { - top= 39; - keys { { , "CAPS", color="grey20" }, - , , , , , - , , , , , - , { , "RTRN", color="grey20" } - }; - }; - row { - top= 58; - keys { { , "LFSH", color="grey20" }, - , , , , , - , , , , , - { , "RTSH", color="grey20" } - }; - }; - row { - top= 77; - key.shape= "MODK"; - key.color= "grey20"; - keys { , { , 20 }, - { , "SPCE",color="white" }, - , { , 20 } - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 25; - left= 299; - key.color= "grey20"; - row { - top= 1; - keys { , , }; - }; - row { - top= 33; - keys { , , }; - }; - row { - top= 53; - keys { , , }; - }; - row { - top= 91; - left= 20; - keys { }; - }; - row { - top= 110; - keys { , , }; - }; - }; // End of "Editing" section - - shape "LEDS" { cornerRadius= 0, { [ 76 ,20 ] } }; - shape "LED" { cornerRadius= 0, { [ 3, 1.5] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 25; - left= 364; - color= "grey10"; - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 40.5; - indicator.shape= "LED"; - indicator "Num Lock" { left= 372; }; - indicator "Caps Lock" { left= 397; }; - indicator "Scro llLock" { left= 422; }; - - text.font= "helvetica"; - text.weight= "bold"; - text.slant= "r"; - text.fontWidth= "normal"; - text.fontSize= 12; - text.top= 39.5; - text.color= "black"; - text "NumLockLabel" { left= 376.5; text="1"; }; - text "CapsLockLabel" { left= 401.5; text="A"; }; - text "ScrollLockLabel" { left= 426.5; text="S"; }; - - logo "SGILogoImage" { - top= 26.5; - left= 396; - name= "SGI"; - shape= "LOGO"; - }; - text.font= "helvetica"; - text.weight= "bold"; - text.slant= "o"; - text.fontWidth= "narrow"; - text.fontSize= 18; - text "SiliconLogoText" { - top= 27; - left= 375; - width= 20; - text= "Silicon"; - }; - text "GraphicsLogoText" { - top= 27; - left= 409; - width= 20; - text= "Graphics"; - }; - - section "Keypad" { - top= 58; - left= 363; - row { - top= 1; - key.color= "grey20"; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - alias = ; - alias = ; -}; - -xkb_geometry "pc102" { - - // This is an approximate layout for 102-key SGI international - // keyboards. I just took a similar layout (101 key PC keyboard) - // and adjusted the sizes of a few keys by eye. I didn't actually - // *measure* a real keyboard. - - description= "Silicon Graphics 102-key Keyboard"; - width= 470; - height= 193; - - shape.cornerRadius= 1; - shape "EDGE" { cornerRadius=2, { [ 470, 193 ] } }; - shape "NORM" { { [18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [35,18] }, { [2,1], [33,17] } }; - shape "TABK" { { [27,18] }, { [2,1], [25,17] } }; - shape "RTRN" { - approx = { [ 0, 0], [26,37] }, - { [ 0, 0], [26, 0], [26,37], - [ 5,37], [ 5,18], [ 0,18] }, - { [ 1, 1], [24, 1], [24,36], - [ 7,36], [ 7,17], [ 1,17] } - }; - shape "CAPS" { { [ 32,18] }, { [2,1], [25,17] } }; - shape "RTSH" { { [ 50,18] }, { [2,1], [48,17] } }; - shape "LFSH" { { [ 22,18] }, { [2,1], [20,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [130,18] }, { [2,1], [128,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 19; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 50; - row { - top= 1; - keys { { , color="grey20" }, - { , 18}, , , , - { , 10}, , , , - { , 10}, , , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 83; - row { - top= 1; - keys { , , , , , - , , , , , - , , , - { , "BKSP", color= "grey20" } - }; - }; - row { - top= 20; - keys { { , "TABK", color= "grey20" }, - , , , , , - , , , , , - , , - { , "RTRN", color= "grey20" } - }; - }; - row { - top= 39; - keys { { , "CAPS", color= "grey20" }, - , , , , , - , , , , , - , - }; - }; - row { - top= 58; - keys { { , "LFSH", color= "grey20" }, , - , , , , , - , , , , , - { , "RTSH", color= "grey20" } - }; - }; - row { - top= 77; - key.shape= "MODK"; - key.color= "grey20"; - keys { , - { , 19 }, - { , "SPCE", color="white" }, - , - { , 19 } - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 50; - left= 308; - key.color= "grey20"; - row { - top= 1; - keys { , , }; - }; - row { - top= 33; - keys { , , }; - }; - row { - top= 53; - keys { , , }; - }; - row { - top= 91; - left= 20; - keys { }; - }; - row { - top= 110; - keys { , , }; - }; - }; // End of "Editing" section - - shape "LEDS" { cornerRadius= 0, { [ 76 ,20 ] } }; - shape "LED" { cornerRadius= 0, { [ 1, 3 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 50; - left= 375; - color= "grey10"; - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 64.5; - indicator.shape= "LED"; - indicator "Num Lock" { left= 384; }; - indicator "Caps Lock" { left= 409; }; - indicator "Scroll Lock" { left= 434; }; - text.top= 52; - text.color= "black"; - text "NumLockLabel" { left= 380.5; text="Num\nLock"; }; - text "CapsLockLabel" { left= 405; text="Caps\nLock"; }; - text "ScrollLockLabel" { left= 430; text="Scroll\nLock"; }; - - logo "SGILogoImage" { - top= 17; - left= 22; - name= "SGI"; - shape= "LOGO"; - }; - text "SGILogoText" { - top= 21; - left= 40; - width= 50; - text= "SiliconGraphics"; - font= "helvetica"; - slant= "o"; - weight= "bold"; - setWidth= "narrow"; - fontSize= 24; - }; - - section "Keypad" { - top= 83; - left= 374; - row { - top= 1; - key.color= "grey20"; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - alias = ; - alias = ; -}; - -xkb_geometry "jp106" { - description= "Silicon Graphics 106-key Japanese keyboard"; - width= 442; - height= 167; - - shape "EDGE" { cornerRadius= 2, { [ 442, 167 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; - shape "BKSP" { { [ 18,18] }, { [2,1], [ 16,17] } }; - shape "TABK" { { [ 28,18] }, { [2,1], [ 26,17] } }; - shape "BKSL" { { [ 27,18] }, { [2,1], [ 25,17] } }; - shape "RTRN" { - { [0,0],[ 27,0],[27,37],[4,37],[4,18],[0,18] } , - { [2,1],[ 25,1],[25,36],[5,36],[5,17],[2,17] } }; - shape "CAPS" { { [ 32,18] }, { [2,1], [ 30,17] } }; - shape "LFSH" { { [ 42,18] }, { [2,1], [ 40,17] } }; - shape "RTSH" { { [ 32,18] }, { [2,1], [ 30,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [ 26,17] } }; - shape "SPCE" { { [ 46,18] }, { [2,1], [ 44,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [ 16,36] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - logo "SGILogoImage" { - top= 5; - left= 6; - name= "SGI"; - shape= "LOGO"; - }; - - text "SGILogoText" { - top= 9; - left= 25; - width= 50; - text= "SiliconGraphics"; - font= "helvetica"; - slant= "o"; - weight= "bold"; - fontWidth= "narrow"; - fontSize= 24; - }; - - shape "LEDS" { cornerRadius= 0.1, { [ 76 ,20 ] } }; - shape "LED" { cornerRadius= 0, { [ 5, 1 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 25; - left= 362; - color= "grey10"; - }; - - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 40; - indicator.shape= "LED"; - indicator "Num Lock" { left= 366; }; - indicator "Caps Lock" { left= 391; }; - indicator "Scroll Lock" { left= 416; }; - text.top= 28; - text.color= "black"; - text "NumLockLabel" { left= 366; text="Num\nLock"; }; - text "CapsLockLabel" { left= 391; text="Caps\nLock"; }; - text "ScrollLockLabel" { left= 416; text="Scroll\nLock"; }; - - section.left= 5; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 25; - row { - top= 1; - keys { { , color="grey20" }, - { , 18 }, , , , - { , 11 ,color="grey20"}, {,color="grey20"}, - { , color="grey20"}, {,color="grey20"}, - { , 11 }, , , , - { , 8 }, , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 61; - row { - top= 1; - keys { {,color="grey20"}, , , - , , , , , - , , , , , - , { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { { , "TABK", color="grey20" }, - , , , , , - , , , , , - , , { , 1 ,"RTRN",color="grey20" } - }; - }; - row { - top= 39; - keys { { , "CAPS", color="grey20" }, - , , , , , - , , , , , - , - }; - }; - row { - top= 58; - keys { { , "LFSH", color="grey20" }, - , , , , , - , , , , , - , { , "RTSH", color="grey20" } - }; - }; - row { - top= 77; - key.shape= "MODK"; - key.color= "grey20"; - keys { , { , 20 },, - { , "SPCE", color="white" }, - ,,, { , 17 } - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 61; - left= 296; - key.color= "grey20"; - row { - top= 1; - keys { , , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - top= 58; - left= 20; - keys { }; - }; - row { - top= 77; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 61; - left= 361; - row { - top= 1; - key.color= "grey20"; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - - alias = ; - alias = ; - -}; // End of "jp106" geometry - +// +// Copyright (c) 1996 by Silicon Graphics Computer Systems, Inc. +// +// 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 Silicon Graphics not be +// used in advertising or publicity pertaining to distribution +// of the software without specific prior written permission. +// Silicon Graphics makes no representation about the suitability +// of this software for any purpose. It is provided "as is" +// without any express or implied warranty. +// +// SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +// SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON +// GRAPHICS 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. +// +default xkb_geometry "pc101" { + + // This is an approximate layout for a 101-key (US/ASCII) SGI + // keyboard. I just took a similar layout (101 key PC keyboard) + // and adjusted the sizes of a few keys by eye. I didn't actually + // *measure* a real keyboard. + + description= "101-key keyboard for Silicon Graphics O2"; + + width= 448; + height= 162; + + shape "EDGE" { + cornerRadius= 2, + { [ 15, 0 ], [ 433, 0 ], [ 433, 10 ], [ 448, 10 ], + [ 448, 162 ], [ 0, 162 ], [ 0, 10 ], [ 15, 10 ] } + }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "TABK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "BKSL" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "RTRN" { { [ 40,18] }, { [2,1], [37,17] } }; + shape "CAPS" { { [ 34,18] }, { [2,1], [29,17] } }; + shape "RTSH" { { [ 49,18] }, { [2,1], [47,17] } }; + shape "LFSH" { { [ 44,18] }, { [2,1], [42,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [130,18] }, { [2,1], [128,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "LOGO" { { [ 12,12] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 6; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 25; + row { + top= 1; + keys { { , color="grey20" }, + { , 19}, , , , + { , 11}, , , , + { , 11}, , , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 58; + row { + top= 1; + keys { , , , , , + , , , , , + , , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { { , "TABK", color= "grey20" }, + , , , , , + , , , , , + , , + { , "BKSL" } + }; + }; + row { + top= 39; + keys { { , "CAPS", color="grey20" }, + , , , , , + , , , , , + , { , "RTRN", color="grey20" } + }; + }; + row { + top= 58; + keys { { , "LFSH", color="grey20" }, + , , , , , + , , , , , + { , "RTSH", color="grey20" } + }; + }; + row { + top= 77; + key.shape= "MODK"; + key.color= "grey20"; + keys { , { , 20 }, + { , "SPCE",color="white" }, + , { , 20 } + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 25; + left= 299; + key.color= "grey20"; + row { + top= 1; + keys { , , }; + }; + row { + top= 33; + keys { , , }; + }; + row { + top= 53; + keys { , , }; + }; + row { + top= 91; + left= 20; + keys { }; + }; + row { + top= 110; + keys { , , }; + }; + }; // End of "Editing" section + + shape "LEDS" { cornerRadius= 0, { [ 76 ,20 ] } }; + shape "LED" { cornerRadius= 0, { [ 3, 1.5] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 25; + left= 364; + color= "grey10"; + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 40.5; + indicator.shape= "LED"; + indicator "Num Lock" { left= 372; }; + indicator "Caps Lock" { left= 397; }; + indicator "Scro llLock" { left= 422; }; + + text.font= "helvetica"; + text.weight= "bold"; + text.slant= "r"; + text.fontWidth= "normal"; + text.fontSize= 12; + text.top= 39.5; + text.color= "black"; + text "NumLockLabel" { left= 376.5; text="1"; }; + text "CapsLockLabel" { left= 401.5; text="A"; }; + text "ScrollLockLabel" { left= 426.5; text="S"; }; + + logo "SGILogoImage" { + top= 26.5; + left= 396; + name= "SGI"; + shape= "LOGO"; + }; + text.font= "helvetica"; + text.weight= "bold"; + text.slant= "o"; + text.fontWidth= "narrow"; + text.fontSize= 18; + text "SiliconLogoText" { + top= 27; + left= 375; + width= 20; + text= "Silicon"; + }; + text "GraphicsLogoText" { + top= 27; + left= 409; + width= 20; + text= "Graphics"; + }; + + section "Keypad" { + top= 58; + left= 363; + row { + top= 1; + key.color= "grey20"; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + alias = ; + alias = ; +}; + +xkb_geometry "pc102" { + + // This is an approximate layout for 102-key SGI international + // keyboards. I just took a similar layout (101 key PC keyboard) + // and adjusted the sizes of a few keys by eye. I didn't actually + // *measure* a real keyboard. + + description= "Silicon Graphics 102-key Keyboard"; + width= 470; + height= 193; + + shape.cornerRadius= 1; + shape "EDGE" { cornerRadius=2, { [ 470, 193 ] } }; + shape "NORM" { { [18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [35,18] }, { [2,1], [33,17] } }; + shape "TABK" { { [27,18] }, { [2,1], [25,17] } }; + shape "RTRN" { + approx = { [ 0, 0], [26,37] }, + { [ 0, 0], [26, 0], [26,37], + [ 5,37], [ 5,18], [ 0,18] }, + { [ 1, 1], [24, 1], [24,36], + [ 7,36], [ 7,17], [ 1,17] } + }; + shape "CAPS" { { [ 32,18] }, { [2,1], [25,17] } }; + shape "RTSH" { { [ 50,18] }, { [2,1], [48,17] } }; + shape "LFSH" { { [ 22,18] }, { [2,1], [20,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [130,18] }, { [2,1], [128,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 19; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 50; + row { + top= 1; + keys { { , color="grey20" }, + { , 18}, , , , + { , 10}, , , , + { , 10}, , , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 83; + row { + top= 1; + keys { , , , , , + , , , , , + , , , + { , "BKSP", color= "grey20" } + }; + }; + row { + top= 20; + keys { { , "TABK", color= "grey20" }, + , , , , , + , , , , , + , , + { , "RTRN", color= "grey20" } + }; + }; + row { + top= 39; + keys { { , "CAPS", color= "grey20" }, + , , , , , + , , , , , + , + }; + }; + row { + top= 58; + keys { { , "LFSH", color= "grey20" }, , + , , , , , + , , , , , + { , "RTSH", color= "grey20" } + }; + }; + row { + top= 77; + key.shape= "MODK"; + key.color= "grey20"; + keys { , + { , 19 }, + { , "SPCE", color="white" }, + , + { , 19 } + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 50; + left= 308; + key.color= "grey20"; + row { + top= 1; + keys { , , }; + }; + row { + top= 33; + keys { , , }; + }; + row { + top= 53; + keys { , , }; + }; + row { + top= 91; + left= 20; + keys { }; + }; + row { + top= 110; + keys { , , }; + }; + }; // End of "Editing" section + + shape "LEDS" { cornerRadius= 0, { [ 76 ,20 ] } }; + shape "LED" { cornerRadius= 0, { [ 1, 3 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 50; + left= 375; + color= "grey10"; + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 64.5; + indicator.shape= "LED"; + indicator "Num Lock" { left= 384; }; + indicator "Caps Lock" { left= 409; }; + indicator "Scroll Lock" { left= 434; }; + text.top= 52; + text.color= "black"; + text "NumLockLabel" { left= 380.5; text="Num\nLock"; }; + text "CapsLockLabel" { left= 405; text="Caps\nLock"; }; + text "ScrollLockLabel" { left= 430; text="Scroll\nLock"; }; + + logo "SGILogoImage" { + top= 17; + left= 22; + name= "SGI"; + shape= "LOGO"; + }; + text "SGILogoText" { + top= 21; + left= 40; + width= 50; + text= "SiliconGraphics"; + font= "helvetica"; + slant= "o"; + weight= "bold"; + setWidth= "narrow"; + fontSize= 24; + }; + + section "Keypad" { + top= 83; + left= 374; + row { + top= 1; + key.color= "grey20"; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + alias = ; + alias = ; +}; + +xkb_geometry "jp106" { + description= "Silicon Graphics 106-key Japanese keyboard"; + width= 442; + height= 167; + + shape "EDGE" { cornerRadius= 2, { [ 442, 167 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; + shape "BKSP" { { [ 18,18] }, { [2,1], [ 16,17] } }; + shape "TABK" { { [ 28,18] }, { [2,1], [ 26,17] } }; + shape "BKSL" { { [ 27,18] }, { [2,1], [ 25,17] } }; + shape "RTRN" { + { [0,0],[ 27,0],[27,37],[4,37],[4,18],[0,18] } , + { [2,1],[ 25,1],[25,36],[5,36],[5,17],[2,17] } }; + shape "CAPS" { { [ 32,18] }, { [2,1], [ 30,17] } }; + shape "LFSH" { { [ 42,18] }, { [2,1], [ 40,17] } }; + shape "RTSH" { { [ 32,18] }, { [2,1], [ 30,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [ 26,17] } }; + shape "SPCE" { { [ 46,18] }, { [2,1], [ 44,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [ 16,36] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + logo "SGILogoImage" { + top= 5; + left= 6; + name= "SGI"; + shape= "LOGO"; + }; + + text "SGILogoText" { + top= 9; + left= 25; + width= 50; + text= "SiliconGraphics"; + font= "helvetica"; + slant= "o"; + weight= "bold"; + fontWidth= "narrow"; + fontSize= 24; + }; + + shape "LEDS" { cornerRadius= 0.1, { [ 76 ,20 ] } }; + shape "LED" { cornerRadius= 0, { [ 5, 1 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 25; + left= 362; + color= "grey10"; + }; + + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 40; + indicator.shape= "LED"; + indicator "Num Lock" { left= 366; }; + indicator "Caps Lock" { left= 391; }; + indicator "Scroll Lock" { left= 416; }; + text.top= 28; + text.color= "black"; + text "NumLockLabel" { left= 366; text="Num\nLock"; }; + text "CapsLockLabel" { left= 391; text="Caps\nLock"; }; + text "ScrollLockLabel" { left= 416; text="Scroll\nLock"; }; + + section.left= 5; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 25; + row { + top= 1; + keys { { , color="grey20" }, + { , 18 }, , , , + { , 11 ,color="grey20"}, {,color="grey20"}, + { , color="grey20"}, {,color="grey20"}, + { , 11 }, , , , + { , 8 }, , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 61; + row { + top= 1; + keys { {,color="grey20"}, , , + , , , , , + , , , , , + , { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { { , "TABK", color="grey20" }, + , , , , , + , , , , , + , , { , 1 ,"RTRN",color="grey20" } + }; + }; + row { + top= 39; + keys { { , "CAPS", color="grey20" }, + , , , , , + , , , , , + , + }; + }; + row { + top= 58; + keys { { , "LFSH", color="grey20" }, + , , , , , + , , , , , + , { , "RTSH", color="grey20" } + }; + }; + row { + top= 77; + key.shape= "MODK"; + key.color= "grey20"; + keys { , { , 20 },, + { , "SPCE", color="white" }, + ,,, { , 17 } + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 61; + left= 296; + key.color= "grey20"; + row { + top= 1; + keys { , , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + top= 58; + left= 20; + keys { }; + }; + row { + top= 77; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 61; + left= 361; + row { + top= 1; + key.color= "grey20"; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + + alias = ; + alias = ; + +}; // End of "jp106" geometry diff --git a/xorg-server/xkeyboard-config/geometry/sgi_vndr/indigo b/xorg-server/xkeyboard-config/geometry/sgi_vndr/indigo index c91c5c2f3..076109dbe 100644 --- a/xorg-server/xkeyboard-config/geometry/sgi_vndr/indigo +++ b/xorg-server/xkeyboard-config/geometry/sgi_vndr/indigo @@ -1,411 +1,410 @@ -// $Xorg: indigo,v 1.3 2000/08/17 19:54:37 cpqbld Exp $ -// -// Copyright (c) 1996 by Silicon Graphics Computer Systems, Inc. -// -// 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 Silicon Graphics not be -// used in advertising or publicity pertaining to distribution -// of the software without specific prior written permission. -// Silicon Graphics makes no representation about the suitability -// of this software for any purpose. It is provided "as is" -// without any express or implied warranty. -// -// SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -// SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -// GRAPHICS 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. -// -default xkb_geometry "pc101" { - - // This is an approximate layout for a 101-key (US/ASCII) SGI - // keyboard. I just took a similar layout (101 key PC keyboard) - // and adjusted the sizes of a few keys by eye. I didn't actually - // *measure* a real keyboard. - - description= "Silicon Graphics 101-key keyboard"; - - width= 472; - height= 193; - - shape "EDGE" { cornerRadius= 2, { [ 472, 193 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "TABK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "BKSL" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "RTRN" { { [ 40,18] }, { [2,1], [37,17] } }; - shape "CAPS" { { [ 34,18] }, { [2,1], [29,17] } }; - shape "RTSH" { { [ 49,18] }, { [2,1], [47,17] } }; - shape "LFSH" { { [ 44,18] }, { [2,1], [42,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [130,18] }, { [2,1], [128,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 19; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 50; - row { - top= 1; - keys { { , color="grey20" }, - { , 19}, , , , - { , 11}, , , , - { , 11}, , , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 83; - row { - top= 1; - keys { , , , , , - , , , , , - , , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { { , "TABK", color= "grey20" }, - , , , , , - , , , , , - , , - { , "BKSL" } - }; - }; - row { - top= 39; - keys { { , "CAPS", color="grey20" }, - , , , , , - , , , , , - , { , "RTRN", color="grey20" } - }; - }; - row { - top= 58; - keys { { , "LFSH", color="grey20" }, - , , , , , - , , , , , - { , "RTSH", color="grey20" } - }; - }; - row { - top= 77; - key.shape= "MODK"; - key.color= "grey20"; - keys { , { , 20 }, - { , "SPCE",color="white" }, - , { , 20 } - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 50; - left= 312; - key.color= "grey20"; - row { - top= 1; - keys { , , }; - }; - row { - top= 33; - keys { , , }; - }; - row { - top= 53; - keys { , , }; - }; - row { - top= 91; - left= 20; - keys { }; - }; - row { - top= 110; - keys { , , }; - }; - }; // End of "Editing" section - - shape "LEDS" { cornerRadius= 0, { [ 76 ,20 ] } }; - shape "LED" { cornerRadius= 0, { [ 1, 3 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 50; - left= 377; - color= "grey10"; - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 64.5; - indicator.shape= "LED"; - indicator "Num Lock" { left= 386; }; - indicator "Caps Lock" { left= 411; }; - indicator "Scroll Lock" { left= 436; }; - text.top= 52; - text.color= "black"; - text "NumLockLabel" { left= 382.5; text="Num\nLock"; }; - text "CapsLockLabel" { left= 407; text="Caps\nLock"; }; - text "ScrollLockLabel" { left= 432; text="Scroll\nLock"; }; - - logo "SGILogoImage" { - top= 17; - left= 22; - name= "SGI"; - shape= "LOGO"; - }; - text "SGILogoText" { - top= 21; - left= 40; - width= 50; - text= "SiliconGraphics"; - font= "helvetica"; - slant= "o"; - weight= "bold"; - fontWidth= "narrow"; - fontSize= 24; - }; - - section "Keypad" { - top= 83; - left= 376; - row { - top= 1; - key.color= "grey20"; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - alias = ; - alias = ; -}; -xkb_geometry "pc102" { - - // This is an approximate layout for 102-key SGI international - // keyboards. I just took a similar layout (101 key PC keyboard) - // and adjusted the sizes of a few keys by eye. I didn't actually - // *measure* a real keyboard. - - description= "Silicon Graphics 102-key Keyboard"; - width= 470; - height= 193; - - shape.cornerRadius= 1; - shape "EDGE" { cornerRadius=2, { [ 470, 193 ] } }; - shape "NORM" { { [18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [35,18] }, { [2,1], [33,17] } }; - shape "TABK" { { [27,18] }, { [2,1], [25,17] } }; - shape "RTRN" { - approx = { [ 0, 0], [26,37] }, - { [ 0, 0], [26, 0], [26,37], - [ 5,37], [ 5,18], [ 0,18] }, - { [ 1, 1], [24, 1], [24,36], - [ 7,36], [ 7,17], [ 1,17] } - }; - shape "CAPS" { { [ 32,18] }, { [2,1], [25,17] } }; - shape "RTSH" { { [ 50,18] }, { [2,1], [48,17] } }; - shape "LFSH" { { [ 22,18] }, { [2,1], [20,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [130,18] }, { [2,1], [128,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 19; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 50; - row { - top= 1; - keys { { , color="grey20" }, - { , 18}, , , , - { , 10}, , , , - { , 10}, , , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 83; - row { - top= 1; - keys { , , , , , - , , , , , - , , , - { , "BKSP", color= "grey20" } - }; - }; - row { - top= 20; - keys { { , "TABK", color= "grey20" }, - , , , , , - , , , , , - , , - { , "RTRN", color= "grey20" } - }; - }; - row { - top= 39; - keys { { , "CAPS", color= "grey20" }, - , , , , , - , , , , , - , - }; - }; - row { - top= 58; - keys { { , "LFSH", color= "grey20" }, , - , , , , , - , , , , , - { , "RTSH", color= "grey20" } - }; - }; - row { - top= 77; - key.shape= "MODK"; - key.color= "grey20"; - keys { , - { , 19 }, - { , "SPCE", color="white" }, - , - { , 19 } - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 50; - left= 308; - key.color= "grey20"; - row { - top= 1; - keys { , , }; - }; - row { - top= 33; - keys { , , }; - }; - row { - top= 53; - keys { , , }; - }; - row { - top= 91; - left= 20; - keys { }; - }; - row { - top= 110; - keys { , , }; - }; - }; // End of "Editing" section - - shape "LEDS" { cornerRadius= 0, { [ 76 ,20 ] } }; - shape "LED" { cornerRadius= 0, { [ 1, 3 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 50; - left= 375; - color= "grey10"; - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 64.5; - indicator.shape= "LED"; - indicator "Num Lock" { left= 384; }; - indicator "Caps Lock" { left= 409; }; - indicator "Scroll Lock" { left= 434; }; - text.top= 52; - text.color= "black"; - text "NumLockLabel" { left= 380.5; text="Num\nLock"; }; - text "CapsLockLabel" { left= 405; text="Caps\nLock"; }; - text "ScrollLockLabel" { left= 430; text="Scroll\nLock"; }; - - logo "SGILogoImage" { - top= 17; - left= 22; - name= "SGI"; - shape= "LOGO"; - }; - text "SGILogoText" { - top= 21; - left= 40; - width= 50; - text= "SiliconGraphics"; - font= "helvetica"; - slant= "o"; - weight= "bold"; - setWidth= "narrow"; - fontSize= 24; - }; - - section "Keypad" { - top= 83; - left= 374; - row { - top= 1; - key.color= "grey20"; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - alias = ; - alias = ; -}; +// +// Copyright (c) 1996 by Silicon Graphics Computer Systems, Inc. +// +// 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 Silicon Graphics not be +// used in advertising or publicity pertaining to distribution +// of the software without specific prior written permission. +// Silicon Graphics makes no representation about the suitability +// of this software for any purpose. It is provided "as is" +// without any express or implied warranty. +// +// SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +// SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON +// GRAPHICS 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. +// +default xkb_geometry "pc101" { + + // This is an approximate layout for a 101-key (US/ASCII) SGI + // keyboard. I just took a similar layout (101 key PC keyboard) + // and adjusted the sizes of a few keys by eye. I didn't actually + // *measure* a real keyboard. + + description= "Silicon Graphics 101-key keyboard"; + + width= 472; + height= 193; + + shape "EDGE" { cornerRadius= 2, { [ 472, 193 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "TABK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "BKSL" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "RTRN" { { [ 40,18] }, { [2,1], [37,17] } }; + shape "CAPS" { { [ 34,18] }, { [2,1], [29,17] } }; + shape "RTSH" { { [ 49,18] }, { [2,1], [47,17] } }; + shape "LFSH" { { [ 44,18] }, { [2,1], [42,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [130,18] }, { [2,1], [128,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 19; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 50; + row { + top= 1; + keys { { , color="grey20" }, + { , 19}, , , , + { , 11}, , , , + { , 11}, , , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 83; + row { + top= 1; + keys { , , , , , + , , , , , + , , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { { , "TABK", color= "grey20" }, + , , , , , + , , , , , + , , + { , "BKSL" } + }; + }; + row { + top= 39; + keys { { , "CAPS", color="grey20" }, + , , , , , + , , , , , + , { , "RTRN", color="grey20" } + }; + }; + row { + top= 58; + keys { { , "LFSH", color="grey20" }, + , , , , , + , , , , , + { , "RTSH", color="grey20" } + }; + }; + row { + top= 77; + key.shape= "MODK"; + key.color= "grey20"; + keys { , { , 20 }, + { , "SPCE",color="white" }, + , { , 20 } + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 50; + left= 312; + key.color= "grey20"; + row { + top= 1; + keys { , , }; + }; + row { + top= 33; + keys { , , }; + }; + row { + top= 53; + keys { , , }; + }; + row { + top= 91; + left= 20; + keys { }; + }; + row { + top= 110; + keys { , , }; + }; + }; // End of "Editing" section + + shape "LEDS" { cornerRadius= 0, { [ 76 ,20 ] } }; + shape "LED" { cornerRadius= 0, { [ 1, 3 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 50; + left= 377; + color= "grey10"; + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 64.5; + indicator.shape= "LED"; + indicator "Num Lock" { left= 386; }; + indicator "Caps Lock" { left= 411; }; + indicator "Scroll Lock" { left= 436; }; + text.top= 52; + text.color= "black"; + text "NumLockLabel" { left= 382.5; text="Num\nLock"; }; + text "CapsLockLabel" { left= 407; text="Caps\nLock"; }; + text "ScrollLockLabel" { left= 432; text="Scroll\nLock"; }; + + logo "SGILogoImage" { + top= 17; + left= 22; + name= "SGI"; + shape= "LOGO"; + }; + text "SGILogoText" { + top= 21; + left= 40; + width= 50; + text= "SiliconGraphics"; + font= "helvetica"; + slant= "o"; + weight= "bold"; + fontWidth= "narrow"; + fontSize= 24; + }; + + section "Keypad" { + top= 83; + left= 376; + row { + top= 1; + key.color= "grey20"; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + alias = ; + alias = ; +}; +xkb_geometry "pc102" { + + // This is an approximate layout for 102-key SGI international + // keyboards. I just took a similar layout (101 key PC keyboard) + // and adjusted the sizes of a few keys by eye. I didn't actually + // *measure* a real keyboard. + + description= "Silicon Graphics 102-key Keyboard"; + width= 470; + height= 193; + + shape.cornerRadius= 1; + shape "EDGE" { cornerRadius=2, { [ 470, 193 ] } }; + shape "NORM" { { [18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [35,18] }, { [2,1], [33,17] } }; + shape "TABK" { { [27,18] }, { [2,1], [25,17] } }; + shape "RTRN" { + approx = { [ 0, 0], [26,37] }, + { [ 0, 0], [26, 0], [26,37], + [ 5,37], [ 5,18], [ 0,18] }, + { [ 1, 1], [24, 1], [24,36], + [ 7,36], [ 7,17], [ 1,17] } + }; + shape "CAPS" { { [ 32,18] }, { [2,1], [25,17] } }; + shape "RTSH" { { [ 50,18] }, { [2,1], [48,17] } }; + shape "LFSH" { { [ 22,18] }, { [2,1], [20,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [130,18] }, { [2,1], [128,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 19; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 50; + row { + top= 1; + keys { { , color="grey20" }, + { , 18}, , , , + { , 10}, , , , + { , 10}, , , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 83; + row { + top= 1; + keys { , , , , , + , , , , , + , , , + { , "BKSP", color= "grey20" } + }; + }; + row { + top= 20; + keys { { , "TABK", color= "grey20" }, + , , , , , + , , , , , + , , + { , "RTRN", color= "grey20" } + }; + }; + row { + top= 39; + keys { { , "CAPS", color= "grey20" }, + , , , , , + , , , , , + , + }; + }; + row { + top= 58; + keys { { , "LFSH", color= "grey20" }, , + , , , , , + , , , , , + { , "RTSH", color= "grey20" } + }; + }; + row { + top= 77; + key.shape= "MODK"; + key.color= "grey20"; + keys { , + { , 19 }, + { , "SPCE", color="white" }, + , + { , 19 } + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 50; + left= 308; + key.color= "grey20"; + row { + top= 1; + keys { , , }; + }; + row { + top= 33; + keys { , , }; + }; + row { + top= 53; + keys { , , }; + }; + row { + top= 91; + left= 20; + keys { }; + }; + row { + top= 110; + keys { , , }; + }; + }; // End of "Editing" section + + shape "LEDS" { cornerRadius= 0, { [ 76 ,20 ] } }; + shape "LED" { cornerRadius= 0, { [ 1, 3 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 50; + left= 375; + color= "grey10"; + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 64.5; + indicator.shape= "LED"; + indicator "Num Lock" { left= 384; }; + indicator "Caps Lock" { left= 409; }; + indicator "Scroll Lock" { left= 434; }; + text.top= 52; + text.color= "black"; + text "NumLockLabel" { left= 380.5; text="Num\nLock"; }; + text "CapsLockLabel" { left= 405; text="Caps\nLock"; }; + text "ScrollLockLabel" { left= 430; text="Scroll\nLock"; }; + + logo "SGILogoImage" { + top= 17; + left= 22; + name= "SGI"; + shape= "LOGO"; + }; + text "SGILogoText" { + top= 21; + left= 40; + width= 50; + text= "SiliconGraphics"; + font= "helvetica"; + slant= "o"; + weight= "bold"; + setWidth= "narrow"; + fontSize= 24; + }; + + section "Keypad" { + top= 83; + left= 374; + row { + top= 1; + key.color= "grey20"; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + alias = ; + alias = ; +}; diff --git a/xorg-server/xkeyboard-config/geometry/sgi_vndr/indy b/xorg-server/xkeyboard-config/geometry/sgi_vndr/indy index 98d511fa7..ca1dd2b66 100644 --- a/xorg-server/xkeyboard-config/geometry/sgi_vndr/indy +++ b/xorg-server/xkeyboard-config/geometry/sgi_vndr/indy @@ -1,599 +1,598 @@ -// $Xorg: indy,v 1.3 2000/08/17 19:54:37 cpqbld Exp $ -// -// Copyright (c) 1996 by Silicon Graphics Computer Systems, Inc. -// -// 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 Silicon Graphics not be -// used in advertising or publicity pertaining to distribution -// of the software without specific prior written permission. -// Silicon Graphics makes no representation about the suitability -// of this software for any purpose. It is provided "as is" -// without any express or implied warranty. -// -// SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -// SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -// GRAPHICS 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. -// -default xkb_geometry "pc101" { - - // This is an approximate layout for a 101-key (US/ASCII) SGI - // keyboard. I just took a similar layout (101 key PC keyboard) - // and adjusted the sizes of a few keys by eye. I didn't actually - // *measure* a real keyboard. - - description= "Silicon Graphics 101-key keyboard"; - - width= 472; - height= 193; - - shape "EDGE" { cornerRadius= 2, { [ 472, 193 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "TABK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "BKSL" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "RTRN" { { [ 40,18] }, { [2,1], [37,17] } }; - shape "CAPS" { { [ 34,18] }, { [2,1], [29,17] } }; - shape "RTSH" { { [ 49,18] }, { [2,1], [47,17] } }; - shape "LFSH" { { [ 44,18] }, { [2,1], [42,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [130,18] }, { [2,1], [128,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 19; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 50; - row { - top= 1; - keys { { , color="grey20" }, - { , 19}, , , , - { , 11}, , , , - { , 11}, , , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 83; - row { - top= 1; - keys { , , , , , - , , , , , - , , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { { , "TABK", color= "grey20" }, - , , , , , - , , , , , - , , - { , "BKSL" } - }; - }; - row { - top= 39; - keys { { , "CAPS", color="grey20" }, - , , , , , - , , , , , - , { , "RTRN", color="grey20" } - }; - }; - row { - top= 58; - keys { { , "LFSH", color="grey20" }, - , , , , , - , , , , , - { , "RTSH", color="grey20" } - }; - }; - row { - top= 77; - key.shape= "MODK"; - key.color= "grey20"; - keys { , { , 20 }, - { , "SPCE",color="white" }, - , { , 20 } - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 50; - left= 312; - key.color= "grey20"; - row { - top= 1; - keys { , , }; - }; - row { - top= 33; - keys { , , }; - }; - row { - top= 53; - keys { , , }; - }; - row { - top= 91; - left= 20; - keys { }; - }; - row { - top= 110; - keys { , , }; - }; - }; // End of "Editing" section - - shape "LEDS" { cornerRadius= 0, { [ 76 ,20 ] } }; - shape "LED" { cornerRadius= 0, { [ 1, 3 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 50; - left= 377; - color= "grey10"; - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 64.5; - indicator.shape= "LED"; - indicator "Num Lock" { left= 386; }; - indicator "Caps Lock" { left= 411; }; - indicator "Scroll Lock" { left= 436; }; - text.top= 52; - text.color= "black"; - text "NumLockLabel" { left= 382.5; text="Num\nLock"; }; - text "CapsLockLabel" { left= 407; text="Caps\nLock"; }; - text "ScrollLockLabel" { left= 432; text="Scroll\nLock"; }; - - logo "SGILogoImage" { - top= 17; - left= 22; - name= "SGI"; - shape= "LOGO"; - }; - text "SGILogoText" { - top= 21; - left= 40; - width= 50; - text= "SiliconGraphics"; - font= "helvetica"; - slant= "o"; - weight= "bold"; - fontWidth= "narrow"; - fontSize= 24; - }; - - section "Keypad" { - top= 83; - left= 376; - row { - top= 1; - key.color= "grey20"; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - alias = ; - alias = ; -}; - -xkb_geometry "pc102" { - - // This is an approximate layout for 102-key SGI international - // keyboards. I just took a similar layout (101 key PC keyboard) - // and adjusted the sizes of a few keys by eye. I didn't actually - // *measure* a real keyboard. - - description= "Silicon Graphics 102-key Keyboard"; - width= 470; - height= 193; - - shape.cornerRadius= 1; - shape "EDGE" { cornerRadius=2, { [ 470, 193 ] } }; - shape "NORM" { { [18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [35,18] }, { [2,1], [33,17] } }; - shape "TABK" { { [27,18] }, { [2,1], [25,17] } }; - shape "RTRN" { - approx = { [ 0, 0], [26,37] }, - { [ 0, 0], [26, 0], [26,37], - [ 5,37], [ 5,18], [ 0,18] }, - { [ 1, 1], [24, 1], [24,36], - [ 7,36], [ 7,17], [ 1,17] } - }; - shape "CAPS" { { [ 32,18] }, { [2,1], [25,17] } }; - shape "RTSH" { { [ 50,18] }, { [2,1], [48,17] } }; - shape "LFSH" { { [ 22,18] }, { [2,1], [20,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [130,18] }, { [2,1], [128,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 19; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 50; - row { - top= 1; - keys { { , color="grey20" }, - { , 18}, , , , - { , 10}, , , , - { , 10}, , , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 83; - row { - top= 1; - keys { , , , , , - , , , , , - , , , - { , "BKSP", color= "grey20" } - }; - }; - row { - top= 20; - keys { { , "TABK", color= "grey20" }, - , , , , , - , , , , , - , , - { , "RTRN", color= "grey20" } - }; - }; - row { - top= 39; - keys { { , "CAPS", color= "grey20" }, - , , , , , - , , , , , - , - }; - }; - row { - top= 58; - keys { { , "LFSH", color= "grey20" }, , - , , , , , - , , , , , - { , "RTSH", color= "grey20" } - }; - }; - row { - top= 77; - key.shape= "MODK"; - key.color= "grey20"; - keys { , - { , 19 }, - { , "SPCE", color="white" }, - , - { , 19 } - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 50; - left= 308; - key.color= "grey20"; - row { - top= 1; - keys { , , }; - }; - row { - top= 33; - keys { , , }; - }; - row { - top= 53; - keys { , , }; - }; - row { - top= 91; - left= 20; - keys { }; - }; - row { - top= 110; - keys { , , }; - }; - }; // End of "Editing" section - - shape "LEDS" { cornerRadius= 0, { [ 76 ,20 ] } }; - shape "LED" { cornerRadius= 0, { [ 1, 3 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 50; - left= 375; - color= "grey10"; - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 64.5; - indicator.shape= "LED"; - indicator "Num Lock" { left= 384; }; - indicator "Caps Lock" { left= 409; }; - indicator "Scroll Lock" { left= 434; }; - text.top= 52; - text.color= "black"; - text "NumLockLabel" { left= 380.5; text="Num\nLock"; }; - text "CapsLockLabel" { left= 405; text="Caps\nLock"; }; - text "ScrollLockLabel" { left= 430; text="Scroll\nLock"; }; - - logo "SGILogoImage" { - top= 17; - left= 22; - name= "SGI"; - shape= "LOGO"; - }; - text "SGILogoText" { - top= 21; - left= 40; - width= 50; - text= "SiliconGraphics"; - font= "helvetica"; - slant= "o"; - weight= "bold"; - setWidth= "narrow"; - fontSize= 24; - }; - - section "Keypad" { - top= 83; - left= 374; - row { - top= 1; - key.color= "grey20"; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - alias = ; - alias = ; -}; - -xkb_geometry "jp106" { - description= "Silicon Graphics 106-key Japanese keyboard"; - width= 442; - height= 167; - - shape "EDGE" { cornerRadius= 2, { [ 442, 167 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; - shape "BKSP" { { [ 18,18] }, { [2,1], [ 16,17] } }; - shape "TABK" { { [ 28,18] }, { [2,1], [ 26,17] } }; - shape "BKSL" { { [ 27,18] }, { [2,1], [ 25,17] } }; - shape "RTRN" { - { [0,0],[ 27,0],[27,37],[4,37],[4,18],[0,18] } , - { [2,1],[ 25,1],[25,36],[5,36],[5,17],[2,17] } }; - shape "CAPS" { { [ 32,18] }, { [2,1], [ 30,17] } }; - shape "LFSH" { { [ 42,18] }, { [2,1], [ 40,17] } }; - shape "RTSH" { { [ 32,18] }, { [2,1], [ 30,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [ 26,17] } }; - shape "SPCE" { { [ 46,18] }, { [2,1], [ 44,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [ 16,36] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - logo "SGILogoImage" { - top= 5; - left= 6; - name= "SGI"; - shape= "LOGO"; - }; - - text "SGILogoText" { - top= 9; - left= 25; - width= 50; - text= "SiliconGraphics"; - font= "helvetica"; - slant= "o"; - weight= "bold"; - fontWidth= "narrow"; - fontSize= 24; - }; - - shape "LEDS" { cornerRadius= 0.1, { [ 76 ,20 ] } }; - shape "LED" { cornerRadius= 0, { [ 5, 1 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 25; - left= 362; - color= "grey10"; - }; - - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 40; - indicator.shape= "LED"; - indicator "Num Lock" { left= 366; }; - indicator "Caps Lock" { left= 391; }; - indicator "Scroll Lock" { left= 416; }; - text.top= 28; - text.color= "black"; - text "NumLockLabel" { left= 366; text="Num\nLock"; }; - text "CapsLockLabel" { left= 391; text="Caps\nLock"; }; - text "ScrollLockLabel" { left= 416; text="Scroll\nLock"; }; - - section.left= 5; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 25; - row { - top= 1; - keys { { , color="grey20" }, - { , 18 }, , , , - { , 11 ,color="grey20"}, {,color="grey20"}, - { , color="grey20"}, {,color="grey20"}, - { , 11 }, , , , - { , 8 }, , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 61; - row { - top= 1; - keys { {,color="grey20"}, , , - , , , , , - , , , , , - , { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { { , "TABK", color="grey20" }, - , , , , , - , , , , , - , , { , 1 ,"RTRN",color="grey20" } - }; - }; - row { - top= 39; - keys { { , "CAPS", color="grey20" }, - , , , , , - , , , , , - , - }; - }; - row { - top= 58; - keys { { , "LFSH", color="grey20" }, - , , , , , - , , , , , - , { , "RTSH", color="grey20" } - }; - }; - row { - top= 77; - key.shape= "MODK"; - key.color= "grey20"; - keys { , { , 20 },, - { , "SPCE", color="white" }, - ,,, { , 17 } - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 61; - left= 296; - key.color= "grey20"; - row { - top= 1; - keys { , , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - top= 58; - left= 20; - keys { }; - }; - row { - top= 77; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 61; - left= 361; - row { - top= 1; - key.color= "grey20"; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color="grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - - alias = ; - alias = ; - -}; // End of "jp106" geometry +// +// Copyright (c) 1996 by Silicon Graphics Computer Systems, Inc. +// +// 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 Silicon Graphics not be +// used in advertising or publicity pertaining to distribution +// of the software without specific prior written permission. +// Silicon Graphics makes no representation about the suitability +// of this software for any purpose. It is provided "as is" +// without any express or implied warranty. +// +// SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +// SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON +// GRAPHICS 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. +// +default xkb_geometry "pc101" { + + // This is an approximate layout for a 101-key (US/ASCII) SGI + // keyboard. I just took a similar layout (101 key PC keyboard) + // and adjusted the sizes of a few keys by eye. I didn't actually + // *measure* a real keyboard. + + description= "Silicon Graphics 101-key keyboard"; + + width= 472; + height= 193; + + shape "EDGE" { cornerRadius= 2, { [ 472, 193 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "TABK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "BKSL" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "RTRN" { { [ 40,18] }, { [2,1], [37,17] } }; + shape "CAPS" { { [ 34,18] }, { [2,1], [29,17] } }; + shape "RTSH" { { [ 49,18] }, { [2,1], [47,17] } }; + shape "LFSH" { { [ 44,18] }, { [2,1], [42,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [130,18] }, { [2,1], [128,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 19; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 50; + row { + top= 1; + keys { { , color="grey20" }, + { , 19}, , , , + { , 11}, , , , + { , 11}, , , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 83; + row { + top= 1; + keys { , , , , , + , , , , , + , , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { { , "TABK", color= "grey20" }, + , , , , , + , , , , , + , , + { , "BKSL" } + }; + }; + row { + top= 39; + keys { { , "CAPS", color="grey20" }, + , , , , , + , , , , , + , { , "RTRN", color="grey20" } + }; + }; + row { + top= 58; + keys { { , "LFSH", color="grey20" }, + , , , , , + , , , , , + { , "RTSH", color="grey20" } + }; + }; + row { + top= 77; + key.shape= "MODK"; + key.color= "grey20"; + keys { , { , 20 }, + { , "SPCE",color="white" }, + , { , 20 } + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 50; + left= 312; + key.color= "grey20"; + row { + top= 1; + keys { , , }; + }; + row { + top= 33; + keys { , , }; + }; + row { + top= 53; + keys { , , }; + }; + row { + top= 91; + left= 20; + keys { }; + }; + row { + top= 110; + keys { , , }; + }; + }; // End of "Editing" section + + shape "LEDS" { cornerRadius= 0, { [ 76 ,20 ] } }; + shape "LED" { cornerRadius= 0, { [ 1, 3 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 50; + left= 377; + color= "grey10"; + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 64.5; + indicator.shape= "LED"; + indicator "Num Lock" { left= 386; }; + indicator "Caps Lock" { left= 411; }; + indicator "Scroll Lock" { left= 436; }; + text.top= 52; + text.color= "black"; + text "NumLockLabel" { left= 382.5; text="Num\nLock"; }; + text "CapsLockLabel" { left= 407; text="Caps\nLock"; }; + text "ScrollLockLabel" { left= 432; text="Scroll\nLock"; }; + + logo "SGILogoImage" { + top= 17; + left= 22; + name= "SGI"; + shape= "LOGO"; + }; + text "SGILogoText" { + top= 21; + left= 40; + width= 50; + text= "SiliconGraphics"; + font= "helvetica"; + slant= "o"; + weight= "bold"; + fontWidth= "narrow"; + fontSize= 24; + }; + + section "Keypad" { + top= 83; + left= 376; + row { + top= 1; + key.color= "grey20"; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + alias = ; + alias = ; +}; + +xkb_geometry "pc102" { + + // This is an approximate layout for 102-key SGI international + // keyboards. I just took a similar layout (101 key PC keyboard) + // and adjusted the sizes of a few keys by eye. I didn't actually + // *measure* a real keyboard. + + description= "Silicon Graphics 102-key Keyboard"; + width= 470; + height= 193; + + shape.cornerRadius= 1; + shape "EDGE" { cornerRadius=2, { [ 470, 193 ] } }; + shape "NORM" { { [18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [35,18] }, { [2,1], [33,17] } }; + shape "TABK" { { [27,18] }, { [2,1], [25,17] } }; + shape "RTRN" { + approx = { [ 0, 0], [26,37] }, + { [ 0, 0], [26, 0], [26,37], + [ 5,37], [ 5,18], [ 0,18] }, + { [ 1, 1], [24, 1], [24,36], + [ 7,36], [ 7,17], [ 1,17] } + }; + shape "CAPS" { { [ 32,18] }, { [2,1], [25,17] } }; + shape "RTSH" { { [ 50,18] }, { [2,1], [48,17] } }; + shape "LFSH" { { [ 22,18] }, { [2,1], [20,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [130,18] }, { [2,1], [128,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 19; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 50; + row { + top= 1; + keys { { , color="grey20" }, + { , 18}, , , , + { , 10}, , , , + { , 10}, , , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 83; + row { + top= 1; + keys { , , , , , + , , , , , + , , , + { , "BKSP", color= "grey20" } + }; + }; + row { + top= 20; + keys { { , "TABK", color= "grey20" }, + , , , , , + , , , , , + , , + { , "RTRN", color= "grey20" } + }; + }; + row { + top= 39; + keys { { , "CAPS", color= "grey20" }, + , , , , , + , , , , , + , + }; + }; + row { + top= 58; + keys { { , "LFSH", color= "grey20" }, , + , , , , , + , , , , , + { , "RTSH", color= "grey20" } + }; + }; + row { + top= 77; + key.shape= "MODK"; + key.color= "grey20"; + keys { , + { , 19 }, + { , "SPCE", color="white" }, + , + { , 19 } + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 50; + left= 308; + key.color= "grey20"; + row { + top= 1; + keys { , , }; + }; + row { + top= 33; + keys { , , }; + }; + row { + top= 53; + keys { , , }; + }; + row { + top= 91; + left= 20; + keys { }; + }; + row { + top= 110; + keys { , , }; + }; + }; // End of "Editing" section + + shape "LEDS" { cornerRadius= 0, { [ 76 ,20 ] } }; + shape "LED" { cornerRadius= 0, { [ 1, 3 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 50; + left= 375; + color= "grey10"; + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 64.5; + indicator.shape= "LED"; + indicator "Num Lock" { left= 384; }; + indicator "Caps Lock" { left= 409; }; + indicator "Scroll Lock" { left= 434; }; + text.top= 52; + text.color= "black"; + text "NumLockLabel" { left= 380.5; text="Num\nLock"; }; + text "CapsLockLabel" { left= 405; text="Caps\nLock"; }; + text "ScrollLockLabel" { left= 430; text="Scroll\nLock"; }; + + logo "SGILogoImage" { + top= 17; + left= 22; + name= "SGI"; + shape= "LOGO"; + }; + text "SGILogoText" { + top= 21; + left= 40; + width= 50; + text= "SiliconGraphics"; + font= "helvetica"; + slant= "o"; + weight= "bold"; + setWidth= "narrow"; + fontSize= 24; + }; + + section "Keypad" { + top= 83; + left= 374; + row { + top= 1; + key.color= "grey20"; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + alias = ; + alias = ; +}; + +xkb_geometry "jp106" { + description= "Silicon Graphics 106-key Japanese keyboard"; + width= 442; + height= 167; + + shape "EDGE" { cornerRadius= 2, { [ 442, 167 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [ 16,17] } }; + shape "BKSP" { { [ 18,18] }, { [2,1], [ 16,17] } }; + shape "TABK" { { [ 28,18] }, { [2,1], [ 26,17] } }; + shape "BKSL" { { [ 27,18] }, { [2,1], [ 25,17] } }; + shape "RTRN" { + { [0,0],[ 27,0],[27,37],[4,37],[4,18],[0,18] } , + { [2,1],[ 25,1],[25,36],[5,36],[5,17],[2,17] } }; + shape "CAPS" { { [ 32,18] }, { [2,1], [ 30,17] } }; + shape "LFSH" { { [ 42,18] }, { [2,1], [ 40,17] } }; + shape "RTSH" { { [ 32,18] }, { [2,1], [ 30,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [ 26,17] } }; + shape "SPCE" { { [ 46,18] }, { [2,1], [ 44,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [ 35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [ 16,36] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + logo "SGILogoImage" { + top= 5; + left= 6; + name= "SGI"; + shape= "LOGO"; + }; + + text "SGILogoText" { + top= 9; + left= 25; + width= 50; + text= "SiliconGraphics"; + font= "helvetica"; + slant= "o"; + weight= "bold"; + fontWidth= "narrow"; + fontSize= 24; + }; + + shape "LEDS" { cornerRadius= 0.1, { [ 76 ,20 ] } }; + shape "LED" { cornerRadius= 0, { [ 5, 1 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 25; + left= 362; + color= "grey10"; + }; + + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 40; + indicator.shape= "LED"; + indicator "Num Lock" { left= 366; }; + indicator "Caps Lock" { left= 391; }; + indicator "Scroll Lock" { left= 416; }; + text.top= 28; + text.color= "black"; + text "NumLockLabel" { left= 366; text="Num\nLock"; }; + text "CapsLockLabel" { left= 391; text="Caps\nLock"; }; + text "ScrollLockLabel" { left= 416; text="Scroll\nLock"; }; + + section.left= 5; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 25; + row { + top= 1; + keys { { , color="grey20" }, + { , 18 }, , , , + { , 11 ,color="grey20"}, {,color="grey20"}, + { , color="grey20"}, {,color="grey20"}, + { , 11 }, , , , + { , 8 }, , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 61; + row { + top= 1; + keys { {,color="grey20"}, , , + , , , , , + , , , , , + , { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { { , "TABK", color="grey20" }, + , , , , , + , , , , , + , , { , 1 ,"RTRN",color="grey20" } + }; + }; + row { + top= 39; + keys { { , "CAPS", color="grey20" }, + , , , , , + , , , , , + , + }; + }; + row { + top= 58; + keys { { , "LFSH", color="grey20" }, + , , , , , + , , , , , + , { , "RTSH", color="grey20" } + }; + }; + row { + top= 77; + key.shape= "MODK"; + key.color= "grey20"; + keys { , { , 20 },, + { , "SPCE", color="white" }, + ,,, { , 17 } + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 61; + left= 296; + key.color= "grey20"; + row { + top= 1; + keys { , , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + top= 58; + left= 20; + keys { }; + }; + row { + top= 77; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 61; + left= 361; + row { + top= 1; + key.color= "grey20"; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color="grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + + alias = ; + alias = ; + +}; // End of "jp106" geometry diff --git a/xorg-server/xkeyboard-config/geometry/sony b/xorg-server/xkeyboard-config/geometry/sony index 4e69f0e9a..cfd6f0388 100644 --- a/xorg-server/xkeyboard-config/geometry/sony +++ b/xorg-server/xkeyboard-config/geometry/sony @@ -1,180 +1,179 @@ -// $Xorg: sony,v 1.4 2001/02/09 02:05:51 xorgcvs Exp $ -// -//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. -// -default xkb_geometry "nwp5461" { - - description= "Sony NEWS NWS-5000 Keyboard"; - width= 425; - height= 190; - - shape.cornerRadius= 1; - shape "NORM" { { [18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [28,18] }, { [2,1], [26,17] } }; - shape "TABK" { { [28,18] }, { [2,1], [26,17] } }; - shape "BKSL" { { [28,18] }, { [2,1], [26,17] } }; - shape "RTRN" { - approx = { [15, 0], [33,37] }, - { [15, 0], [33, 0], [33,37], - [ 0,37], [ 0,19], [15,19] }, - { [17, 1], [31, 1], [31,36], - [ 2,36], [ 2,20], [17,20] } - }; - shape "SHFT" { { [42,18] }, { [2,1], [40,17] } }; - shape "MODK" { { [33,18] }, { [2,1], [31,17] } }; - shape "SPCE" { { [85,18] }, { [2,1], [83,17] } }; - shape "KPEN" { { [18,38] }, { [2,1], [16,37] } }; - shape "STOP" { { [28,18] }, { [2,1], [26,17] } }; - shape "CUT" { { [55,18] }, { [2,1], [53,17] } }; - shape "EXEC" { { [32,18] }, { [2,1], [30,17] } }; - shape "UNK" { { [18,18] }, { [2,1], [16,17] } }; - shape "CAPS" { { [18,18] }, { [2,1], [16,17] } }; - shape "FKEY" { { [23,18] }, { [2,1], [21,17] } }; - - section.left= 13; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 55; - row { - top= 1; - left= 37; - key.shape="FKEY"; - keys { , , , , , - { , 5 }, , , , , - { , 5 }, - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 80; - row { - top= 1; - keys { { , color="grey20" } , - , , , , - , , , , - , , , , - , { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { { , "TABK", color="grey20" }, - , , , , , - , , , , , - , , { , color="grey20" }, - { , "RTRN", -14, color="grey20" } - }; - }; - row { - top= 39; - keys { { , "MODK", color="grey20" }, - , , , , , - , , , , , - , - }; - }; - row { - top= 58; - keys { { , "SHFT", color="grey20" }, - , , , , , - , , , , , , - { , "SHFT", color="grey20" } - }; - }; - row { - top= 77; - key.shape= "MODK"; - key.color= "grey20"; - keys { , { , "CAPS" }, - { , "STOP", color="white" }, - { , "SPCE", color="white" }, - { , "CUT", color="white" }, - { , "UNK" }, { , "UNK" }, - { , "EXEC" } - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 80; - left= 312; - key.color= "grey20"; - row { - top= 1; - keys { }; - }; - row { - top= 20; - keys { }; - }; - row { - top= 39; - keys { }; - }; - row { - top= 58; - keys { }; - }; - row { - top= 77; - keys { }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 61; - left= 334; - row { - top= 1; - key.color= "grey20"; - keys { { , 19 }, , }; - }; - row { - top= 20; - keys { , , , { , color="grey20" } }; - }; - row { - top= 39; - keys { , , , { , color="grey20" } }; - }; - row { - top= 58; - keys { , , , { , "KPEN", color="grey20" } }; - }; - row { - top= 77; - keys { , { , color="grey20" }, }; - }; - row { - top= 96; - key.color= "grey20"; - keys { , , , }; - }; - }; // End of "Keypad" section - -}; // End of "default" geometry +// +//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. +// +default xkb_geometry "nwp5461" { + + description= "Sony NEWS NWS-5000 Keyboard"; + width= 425; + height= 190; + + shape.cornerRadius= 1; + shape "NORM" { { [18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [28,18] }, { [2,1], [26,17] } }; + shape "TABK" { { [28,18] }, { [2,1], [26,17] } }; + shape "BKSL" { { [28,18] }, { [2,1], [26,17] } }; + shape "RTRN" { + approx = { [15, 0], [33,37] }, + { [15, 0], [33, 0], [33,37], + [ 0,37], [ 0,19], [15,19] }, + { [17, 1], [31, 1], [31,36], + [ 2,36], [ 2,20], [17,20] } + }; + shape "SHFT" { { [42,18] }, { [2,1], [40,17] } }; + shape "MODK" { { [33,18] }, { [2,1], [31,17] } }; + shape "SPCE" { { [85,18] }, { [2,1], [83,17] } }; + shape "KPEN" { { [18,38] }, { [2,1], [16,37] } }; + shape "STOP" { { [28,18] }, { [2,1], [26,17] } }; + shape "CUT" { { [55,18] }, { [2,1], [53,17] } }; + shape "EXEC" { { [32,18] }, { [2,1], [30,17] } }; + shape "UNK" { { [18,18] }, { [2,1], [16,17] } }; + shape "CAPS" { { [18,18] }, { [2,1], [16,17] } }; + shape "FKEY" { { [23,18] }, { [2,1], [21,17] } }; + + section.left= 13; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 55; + row { + top= 1; + left= 37; + key.shape="FKEY"; + keys { , , , , , + { , 5 }, , , , , + { , 5 }, + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 80; + row { + top= 1; + keys { { , color="grey20" } , + , , , , + , , , , + , , , , + , { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { { , "TABK", color="grey20" }, + , , , , , + , , , , , + , , { , color="grey20" }, + { , "RTRN", -14, color="grey20" } + }; + }; + row { + top= 39; + keys { { , "MODK", color="grey20" }, + , , , , , + , , , , , + , + }; + }; + row { + top= 58; + keys { { , "SHFT", color="grey20" }, + , , , , , + , , , , , , + { , "SHFT", color="grey20" } + }; + }; + row { + top= 77; + key.shape= "MODK"; + key.color= "grey20"; + keys { , { , "CAPS" }, + { , "STOP", color="white" }, + { , "SPCE", color="white" }, + { , "CUT", color="white" }, + { , "UNK" }, { , "UNK" }, + { , "EXEC" } + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 80; + left= 312; + key.color= "grey20"; + row { + top= 1; + keys { }; + }; + row { + top= 20; + keys { }; + }; + row { + top= 39; + keys { }; + }; + row { + top= 58; + keys { }; + }; + row { + top= 77; + keys { }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 61; + left= 334; + row { + top= 1; + key.color= "grey20"; + keys { { , 19 }, , }; + }; + row { + top= 20; + keys { , , , { , color="grey20" } }; + }; + row { + top= 39; + keys { , , , { , color="grey20" } }; + }; + row { + top= 58; + keys { , , , { , "KPEN", color="grey20" } }; + }; + row { + top= 77; + keys { , { , color="grey20" }, }; + }; + row { + top= 96; + key.color= "grey20"; + keys { , , , }; + }; + }; // End of "Keypad" section + +}; // End of "default" geometry diff --git a/xorg-server/xkeyboard-config/geometry/sun b/xorg-server/xkeyboard-config/geometry/sun index 585eb2615..8aef7f6c3 100644 --- a/xorg-server/xkeyboard-config/geometry/sun +++ b/xorg-server/xkeyboard-config/geometry/sun @@ -1,3050 +1,3046 @@ -// $Xorg: sun,v 1.4 2001/02/09 02:05:51 xorgcvs Exp $ -// $XdotOrg: $ -// -//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. -// -// --------------------------------------------------------------------------- -// Copyright 2004 Sun Microsystems, 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 (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. -// -// --------------------------------------------------------------------------- -// -// $XFree86: xc/programs/xkbcomp/geometry/sun,v 1.7 2003/08/09 14:30:47 pascal Exp $ -// -xkb_geometry "type4" { - - // This is an approximate layout for a (US/ASCII) Sun Type4 US - // keyboard. - - description= "Sun Type4 keyboard"; - - width= 452; - height= 185; - - shape "EDGE" { cornerRadius= 2, { [ 452, 185 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "DELE" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "RTRN" { - approx = { [ 0, 0], [28,37] }, - { [ 0, 0], [28, 0], [28,37], - [ 5,37], [ 5,19], [ 0,19] }, - { [ 1, 1], [26, 1], [26,36], - [ 7,36], [ 7,18], [ 1,18] } - }; - shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "LFSH" { { [ 41,18] }, { [2,1], [39,17] } }; - shape "RTSH" { { [ 33,18] }, { [2,1], [31,17] } }; - shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [170,18] }, { [2,1], [168,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 17; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - - section "Alpha" { - top= 58; - row { - top= 1; - keys { , , - { , 9 }, , , , - , , , , - , , , , - , { , "DELE" }, - { , 9 }, , , - }; - }; - row { - top= 20; - keys { , , { , 9 }, - , , , , , - , , , , , - , , - { , "BKSP" }, - { , 9 }, , , - - }; - }; - row { - top= 39; - keys { , , - { , 9, shape="TABK" }, - , , , , , - , , , , , - , , { , "RTRN" }, - { , 9 }, , , { , "KPAD" } - }; - }; - row { - top= 58; - keys { , , - { , 9, shape="LCTL" }, - , , , , , - , , , , , - , , - { , 33 }, , - }; - }; - row { - top= 77; - keys { , , - { , 9 , shape="LFSH" }, - , , , , , - , , , , , - { , "RTSH" }, , - { , 9} , , , { , "KPAD" } - }; - }; - row { - top= 96; - keys { { , "HELP" }, { , 9 }, - , , { , "SPCE" }, - , , , - { , 9, shape="KP0" }, - }; - }; - }; // End of "Alpha" section - - shape "LEDS" { cornerRadius= 0, { [ 78 ,21 ] } }; - shape "LED" { cornerRadius= 0, { [ 7, 4 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 28; - left= 358; - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 43; - indicator.shape= "LED"; - indicator "Caps Lock" { left= 364; }; - indicator "Compose" { left= 383; }; - indicator "Scroll Lock" { left= 402; }; - indicator "Num Lock" { left= 421; }; - text.top= 34; - text.color= "black"; - text "CapsLockLabel" { left= 364; text="Caps\nLock"; }; - text "ComposeLabel" { left= 380; text="Compose"; }; - text "ScrollLockLabel" { left= 402; text="Scroll\nLock"; }; - text "NumLockLabel" { left= 421; text="Num\nLock"; }; -}; - -xkb_geometry "type4tuv" { - - // This is an approximate layout for a (US/ASCII) Sun Type4 TUV - // (European) keyboard with an extra key between the Shift_L - // and the Z keys, and two keys above the Bksp key, instead - // of a large delete key. - - description= "Sun Type4tuv keyboard"; - - width= 452; - height= 185; - - shape "EDGE" { cornerRadius= 2, { [ 452, 185 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; - - shape "RTRN" { - approx = { [ 0, 0], [28,37] }, - { [ 0, 0], [28, 0], [28,37], - [ 5,37], [ 5,19], [ 0,19] }, - { [ 1, 1], [26, 1], [26,36], - [ 7,36], [ 7,18], [ 1,18] } - }; - shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "RTSH" { { [ 33,18] }, { [2,1], [31,17] } }; - shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [170,18] }, { [2,1], [168,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 17; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - - section "Alpha" { - top= 58; - row { - top= 1; - keys { , , - { , 9 }, , , , - , , , , - , , , , - , ,, - { , 9 }, , , - }; - }; - row { - top= 20; - keys { , , { , 9 }, - , , , , , - , , , , , - , , - { , "BKSP" }, - { , 9 }, , , - - }; - }; - row { - top= 39; - keys { , , - { , 9, shape="TABK" }, - , , , , , - , , , , , - , , { , "RTRN" }, - { , 9 }, , , { , "KPAD" } - }; - }; - row { - top= 58; - keys { , , - { , 9, shape="LCTL" }, - , , , , , - , , , , , - , , - { , 33 }, , - }; - }; - row { - top= 77; - keys { , , - { , 9 }, , - , , , , , - , , , , , - { , "RTSH" }, , - { , 9} , , , { , "KPAD" } - }; - }; - row { - top= 96; - keys { { , "HELP" }, { , 9 }, - , , { , "SPCE" }, - , , , - { , 9, shape="KP0" }, - }; - }; - }; // End of "Alpha" section - - shape "LEDS" { cornerRadius= 0, { [ 78 ,21 ] } }; - shape "LED" { cornerRadius= 0, { [ 7, 4 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 28; - left= 358; - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 43; - indicator.shape= "LED"; - indicator "CapsLock" { left= 364; }; - indicator "Compose" { left= 383; }; - indicator "ScrollLock" { left= 402; }; - indicator "NumLock" { left= 421; }; - text.top= 34; - text.color= "black"; - text "CapsLockLabel" { left= 364; text="Caps\nLock"; }; - text "ComposeLabel" { left= 380; text="Compose"; }; - text "ScrollLockLabel" { left= 402; text="Scroll\nLock"; }; - text "NumLockLabel" { left= 421; text="Num\nLock"; }; -}; - -xkb_geometry "type4_ca" { - - // This is an approximate layout for a (US/ASCII) Sun Type4 - // Canadian and British keyboard with an extra key between - // the Shift_L - // and the Z keys. - - description= "Sun Type4_uk keyboard"; - - width= 452; - height= 185; - - shape "EDGE" { cornerRadius= 2, { [ 452, 185 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "DELE" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "RTRN" { - approx = { [ 0, 0], [28,37] }, - { [ 0, 0], [28, 0], [28,37], - [ 5,37], [ 5,19], [ 0,19] }, - { [ 1, 1], [26, 1], [26,36], - [ 7,36], [ 7,18], [ 1,18] } - }; - shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "RTSH" { { [ 33,18] }, { [2,1], [31,17] } }; - shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [170,18] }, { [2,1], [168,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 17; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - - section "Alpha" { - top= 58; - row { - top= 1; - keys { , , - { , 9 }, , , , - , , , , - , , , , - , { , "DELE" }, - { , 9 }, , , - }; - }; - row { - top= 20; - keys { , , { , 9 }, - , , , , , - , , , , , - , , - { , "BKSP" }, - { , 9 }, , , - - }; - }; - row { - top= 39; - keys { , , - { , 9, shape="TABK" }, - , , , , , - , , , , , - , , { , "RTRN" }, - { , 9 }, , , { , "KPAD" } - }; - }; - row { - top= 58; - keys { , , - { , 9, shape="LCTL" }, - , , , , , - , , , , , - , , - { , 33 }, , - }; - }; - row { - top= 77; - keys { , , - { , 9 }, , - , , , , , - , , , , , - { , "RTSH" }, , - { , 9} , , , { , "KPAD" } - }; - }; - row { - top= 96; - keys { { , "HELP" }, { , 9 }, - , , { , "SPCE" }, - , , , - { , 9, shape="KP0" }, - }; - }; - }; // End of "Alpha" section - - shape "LEDS" { cornerRadius= 0, { [ 78 ,21 ] } }; - shape "LED" { cornerRadius= 0, { [ 7, 4 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 28; - left= 358; - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 43; - indicator.shape= "LED"; - indicator "CapsLock" { left= 364; }; - indicator "Compose" { left= 383; }; - indicator "ScrollLock" { left= 402; }; - indicator "NumLock" { left= 421; }; - text.top= 34; - text.color= "black"; - text "CapsLockLabel" { left= 364; text="Caps\nLock"; }; - text "ComposeLabel" { left= 380; text="Compose"; }; - text "ScrollLockLabel" { left= 402; text="Scroll\nLock"; } -; - text "NumLockLabel" { left= 421; text="Num\nLock"; }; -}; - -xkb_geometry "type4jp" { - - // This is an approximate layout for a Japanese Sun Type4 - // keyboard, based on the European TUV keyboard. It has two keys - // above the Bksp key, instead of a large delete key, but lacks - // the extra key between Shift_L and Z. - - description= "Sun Japanese Type4 keyboard"; - - width= 452; - height= 185; - - shape "EDGE" { cornerRadius= 2, { [ 452, 185 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; - - shape "RTRN" { - approx = { [ 0, 0], [28,37] }, - { [ 0, 0], [28, 0], [28,37], - [ 5,37], [ 5,19], [ 0,19] }, - { [ 1, 1], [26, 1], [26,36], - [ 7,36], [ 7,18], [ 1,18] } - }; - shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "RTSH" { { [ 33,18] }, { [2,1], [31,17] } }; - shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [ 97,18] }, { [2,1], [95,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "LFSH" { { [ 41,18] }, { [2,1], [39,17] } }; - shape "KANJ" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "EXEC" { { [ 27,18] }, { [2,1], [25,17] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 17; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - - section "Alpha" { - top= 58; - row { - top= 1; - keys { , , - { , 9 }, , , , - , , , , - , , , , - , ,, - { , 9 }, , , - }; - }; - row { - top= 20; - keys { , , { , 9 }, - , , , , , - , , , , , - , , - { , "BKSP" }, - { , 9 }, , , - - }; - }; - row { - top= 39; - keys { , , - { , 9, shape="TABK" }, - , , , , , - , , , , , - , , { , "RTRN" }, - { , 9 }, , , { , "KPAD" } - }; - }; - row { - top= 58; - keys { , , - { , 9, shape="LCTL" }, - , , , , , - , , , , , - , , - { , 33 }, , - }; - }; - row { - top= 77; - keys { , , - { , 9, shape="LFSH" }, - , , , , , - , , , , , - , { , "RTSH" }, - { , 9} , , , { , "KPAD" } - }; - }; - row { - top= 96; - keys { { , "HELP" }, { , 9 }, - , , { , "EXEC"} , { , "SPCE" }, - { , "KANJ" }, , , , , - { , 9, shape="KP0" }, - }; - }; - }; // End of "Alpha" section - - shape "LEDS" { cornerRadius= 0, { [ 78 ,21 ] } }; - shape "LED" { cornerRadius= 0, { [ 7, 4 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 28; - left= 358; - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 43; - indicator.shape= "LED"; - indicator "CapsLock" { left= 364; }; - indicator "Compose" { left= 383; }; - indicator "ScrollLock" { left= 402; }; - indicator "NumLock" { left= 421; }; - text.top= 34; - text.color= "black"; - text "CapsLockLabel" { left= 364; text="Caps\nLock"; }; - text "ComposeLabel" { left= 380; text="Compose"; }; - text "ScrollLockLabel" { left= 402; text="Scroll\nLock"; }; - text "NumLockLabel" { left= 421; text="Num\nLock"; }; -}; - -xkb_geometry "t5" { - - // This is an approximate layout for a (US/ASCII) Sun Type5 - // keyboard. I just took a similar layout (101 key PC keyboard) - // and adjusted the sizes. - - width= 515; - height= 170; - - shape "EDGE" { cornerRadius= 2, { [ 515, 170 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "BKSL" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "RTRN" { { [ 42,18] }, { [2,1], [40,17] } }; - shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "LFSH" { { [ 42,18] }, { [2,1], [40,17] } }; - shape "RTSH" { { [ 51,18] }, { [2,1], [49,17] } }; - shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [156,18] }, { [2,1], [154,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 14; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 24; - row { - top= 1; - keys { { , "HELP" }, { , 9 }, - { , 19 }, , , , - { , 11 }, , , , - { , 11 }, , , , - { , 9 }, , , - { , 9 }, , , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 61; - row { - top= 1; - keys { , , - { , 9}, , , , , - , , , , , - , , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { , , { , 9, shape="TABK" }, - , , , , , - , , , , , - , , - { , "BKSL" } - }; - }; - row { - top= 39; - keys { , , { , 9, shape="CAPS" }, - , , , , , - , , , , , - , - { , "RTRN" } - }; - }; - row { - top= 58; - keys { , , { , 9 , shape="LFSH" }, - , , , , , - , , , , , - { , "RTSH", color="grey20" } - }; - }; - row { - top= 77; - keys { , , { , 9, shape="LCTL" }, - , , - { , "SPCE" }, - , , - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 61; - left= 352; - row { - top= 1; - keys { , , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - top= 58; - left= 20; - keys { }; - }; - row { - top= 77; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 61; - left= 420; - row { - top= 1; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section -}; - -xkb_geometry "t5tuv" { - - // This is an approximate layout for a TUV/European Sun Type5 keyboard. - - width= 515; - height= 170; - - shape "EDGE" { cornerRadius= 2, { [ 515, 170 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "RTRN" { - approx = { [ 0, 0], [28,37] }, - { [ 0, 0], [28, 0], [28,37], - [ 5,37], [ 5,18], [ 0,18] }, - { [ 1, 1], [26, 1], [26,36], - [ 7,36], [ 7,17], [ 1,17] } - }; - shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "LFSH" { { [ 24,18] }, { [2,1], [22,17] } }; - shape "RTSH" { { [ 51,18] }, { [2,1], [49,17] } }; - shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [157,18] }, { [2,1], [155,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 14; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 24; - row { - top= 1; - keys { { , "HELP" }, { , 9 }, - { , 19 }, , , , - { , 11 }, , , , - { , 11 }, , , , - { , 9 }, , , - { , 9 }, , , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 61; - row { - top= 1; - keys { , , - { , 9}, , , , , - , , , , , - , , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { , , { , 9, shape="TABK" }, - , , , , , - , , , , , - , , - { , "RTRN" } - }; - }; - row { - top= 39; - keys { , , { , 9, shape="CAPS" }, - , , , , , - , , , , , - , - }; - }; - row { - top= 58; - keys { , , { , 9 , shape="LFSH" }, , - , , , , , - , , , , , - { , "RTSH" } - }; - }; - row { - top= 77; - keys { , , { , 9, shape="LCTL" }, - , , - { , "SPCE" }, - , , - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 61; - left= 352; - row { - top= 1; - keys { , , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - top= 58; - left= 20; - keys { }; - }; - row { - top= 77; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 61; - left= 420; - row { - top= 1; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section -}; - - -xkb_geometry "t5jp" { - - // This is an approximate layout for a Japanese Sun Type5 keyboard. - - width= 515; - height= 170; - - shape "EDGE" { cornerRadius= 2, { [ 515, 170 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "KANJ" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "EXEC" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "RTRN" { - approx = { [ 0, 0], [28,37] }, - { [ 0, 0], [28, 0], [28,37], - [ 5,37], [ 5,18], [ 0,18] }, - { [ 1, 1], [26, 1], [26,36], - [ 7,36], [ 7,17], [ 1,17] } - }; - shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "LFSH" { { [ 42,18] }, { [2,1], [40,17] } }; - shape "RTSH" { { [ 33,18] }, { [2,1], [31,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [ 97,18] }, { [2,1], [95,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 14; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 24; - row { - top= 1; - keys { { , "HELP" }, { , 9 }, - { , 19 }, , , , - { , 11 }, , , , - { , 11 }, , , , - { , 9 }, , , - { , 9 }, , , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 61; - row { - top= 1; - keys { , , - { , 9}, , , , , - , , , , , - , , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { , , { , 9, shape="TABK" }, - , , , , , - , , , , , - , , - { , "RTRN" } - }; - }; - row { - top= 39; - keys { , , { , 9, shape="CAPS" }, - , , , , , - , , , , , - , - }; - }; - row { - top= 58; - keys { , , { , 9 , shape="LFSH" }, - , , , , , - , , , , , , - { , "RTSH", color="grey20" } - }; - }; - row { - top= 77; - keys { , , { , 9 }, - , , { , "EXEC" }, - { , "SPCE" }, { , "KANJ" }, , - , , - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 61; - left= 352; - row { - top= 1; - keys { , , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - top= 58; - left= 20; - keys { }; - }; - row { - top= 77; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 61; - left= 420; - row { - top= 1; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section -}; - -xkb_geometry "t5unix" { - - // This is an approximate layout for a (US/ASCII) Sun Type5 - // keyboard. I just took a similar layout (101 key PC keyboard) - // and adjusted the sizes. - - width= 515; - height= 170; - - shape "EDGE" { cornerRadius= 2, { [ 515, 170 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "BKSL" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "RTRN" { { [ 42,18] }, { [2,1], [40,17] } }; - shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "LFSH" { { [ 42,18] }, { [2,1], [40,17] } }; - shape "RTSH" { { [ 51,18] }, { [2,1], [49,17] } }; - shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [157,18] }, { [2,1], [155,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 14; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 24; - row { - top= 1; - keys { { , "HELP" }, { , 9 }, - { , 19 }, , , , - { , 11 }, , , , - { , 11 }, , , , - { , 9 }, , , - { , 9 }, , , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 61; - row { - top= 1; - keys { , , - { , 9}, , , , , - , , , , , - , , , - , - }; - }; - row { - top= 20; - keys { , , { , 9, shape="TABK" }, - , , , , , - , , , , , - , , - { , "BKSP" } - }; - }; - row { - top= 39; - keys { , , { , 9, shape="LCTL" }, - , , , , , - , , , , , - , - { , "RTRN" } - }; - }; - row { - top= 58; - keys { , , { , 9 , shape="LFSH" }, - , , , , , - , , , , , - { , "RTSH", color="grey20" } - }; - }; - row { - top= 77; - keys { , , { , 9, shape="CAPS" }, - , , - { , "SPCE" }, - , , - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 61; - left= 352; - row { - top= 1; - keys { , , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - top= 58; - left= 20; - keys { }; - }; - row { - top= 77; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 61; - left= 420; - row { - top= 1; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section -}; - -xkb_geometry "t5hobo" { - - // This is an approximate layout for a (US/ASCII) Sun Type5 - // keyboard. I just took a similar layout (101 key PC keyboard) - // and adjusted the sizes. - // - // I modified this to look like the hobo keyboard. - - width= 425; - height= 170; - - shape "EDGE" { cornerRadius= 2, { [ 425, 170 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "FKEY" { { [ 15,18] }, { [0.5,0.5], [14.5, 17.5] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "BKSL" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "RTRN" { { [ 42,18] }, { [2,1], [40,17] } }; - shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "LFSH" { { [ 42,18] }, { [2,1], [40,17] } }; - shape "RTSH" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [156,18] }, { [2,1], [154,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 14; - row.left= 1; - key.shape= "FKEY"; - key.gap= 1; - section "Function" { - top= 24; - row { - top= 1; - keys { { , "HELP" }, { , 9 }, - { , 4 }, , , , - { , 4 }, , , , - { , 4 }, , , , - { , 4 }, , , , - { , 9, "NORM" }, {, "NORM"}, {, "NORM"} - }; - }; - }; // End of "Function" section - - key.shape= "NORM"; - section "Alpha" { - top= 61; - row { - top= 1; - keys { , , - { , 9}, , , , , - , , , , , - , , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { , , { , 9, shape="TABK" }, - , , , , , - , , , , , - , , - { , "BKSL" } - }; - }; - row { - top= 39; - keys { , , { , 9, shape="CAPS" }, - , , , , , - , , , , , - , - { , "RTRN" } - }; - }; - row { - top= 58; - keys { , , { , 9 , shape="LFSH" }, - , , , , , - , , , , , - { , "RTSH", color="grey20" }, - }; - }; - row { - top= 77; - keys { , , { , 9, shape="LCTL" }, - , , - { , "SPCE" }, - , , - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 61; - left= 352; - row { - top= 1; - keys { , , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - - top= 58; - left= 20; - keys { }; - }; - row { - top= 77; - keys { , , }; - }; - }; // End of "Editing" section -}; - -xkb_geometry "t5tuvhobo" { - - // This is an approximate layout for a (US/ASCII) Sun Type5 - // keyboard. I just took a similar layout (101 key PC keyboard) - // and adjusted the sizes. - // - // I modified this to look like the hobo keyboard. - - width= 425; - height= 170; - - shape "EDGE" { cornerRadius= 2, { [ 425, 170 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "FKEY" { { [ 15,18] }, { [0.5,0.5], [14.5, 17.5] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "BKSL" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "RTRN" { { [ 42,18] }, { [2,1], [40,17] } }; - shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "LFSH" { { [ 24,18] }, { [2,1], [22,17] } }; - shape "RTSH" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [156,18] }, { [2,1], [154,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 14; - row.left= 1; - key.shape= "FKEY"; - key.gap= 1; - section "Function" { - top= 24; - row { - top= 1; - keys { { , "HELP" }, { , 9 }, - { , 4 }, , , , - { , 4 }, , , , - { , 4 }, , , , - { , 4 }, , , , - { , 9, "NORM" }, {, "NORM"}, {, "NORM"} - }; - }; - }; // End of "Function" section - - key.shape= "NORM"; - section "Alpha" { - top= 61; - row { - top= 1; - keys { , , - { , 9}, , , , , - , , , , , - , , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { , , { , 9, shape="TABK" }, - , , , , , - , , , , , - , , - { , "BKSL" } - }; - }; - row { - top= 39; - keys { , , { , 9, shape="CAPS" }, - , , , , , - , , , , , - , - { , "RTRN" } - }; - }; - row { - top= 58; - keys { , , { , 9 , shape="LFSH" }, , - , , , , , - , , , , , - { , "RTSH", color="grey20" }, - }; - }; - row { - top= 77; - keys { , , { , 9, shape="LCTL" }, - , , - { , "SPCE" }, - , , - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 61; - left= 352; - row { - top= 1; - keys { , , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - - top= 58; - left= 20; - keys { }; - }; - row { - top= 77; - keys { , , }; - }; - }; // End of "Editing" section -}; - -xkb_geometry "t5jphobo" { - - // This is an approximate layout for a (US/ASCII) Sun Type5 - // keyboard. I just took a similar layout (101 key PC keyboard) - // and adjusted the sizes. - - width= 425; - height= 170; - - shape "EDGE" { cornerRadius= 2, { [ 425, 170 ] } }; - shape.cornerRadius= 1; - shape "FKEY" { { [ 15,18] }, { [0.5,0.5], [14.5, 17.5] } }; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "KANJ" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "EXEC" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "RTRN" { - approx = { [ 0, 0], [28,37] }, - { [ 0, 0], [28, 0], [28,37], - [ 5,37], [ 5,18], [ 0,18] }, - { [ 1, 1], [26, 1], [26,36], - [ 7,36], [ 7,17], [ 1,17] } - }; - shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "LFSH" { { [ 42,18] }, { [2,1], [40,17] } }; - shape "RTSH" { { [ 33,18] }, { [2,1], [31,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [ 97,18] }, { [2,1], [95,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 14; - row.left= 1; - key.shape= "FKEY"; - key.gap= 1; - section "Function" { - top= 24; - row { - top= 1; - keys { { , "HELP" }, { , 9 }, - { , 4 }, , , , - { , 4 }, , , , - { , 4 }, , , , - { , 4 }, , , , - { , 9, "NORM" }, {, "NORM"}, {, "NORM"} - }; - }; - }; // End of "Function" section - - key.shape= "NORM"; - section "Alpha" { - top= 61; - row { - top= 1; - keys { , , - { , 9}, , , , , - , , , , , - , , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { , , { , 9, shape="TABK" }, - , , , , , - , , , , , - , , - { , "RTRN" } - }; - }; - row { - top= 39; - keys { , , { , 9, shape="CAPS" }, - , , , , , - , , , , , - , - }; - }; - row { - top= 58; - keys { , , { , 9 , shape="LFSH" }, - , , , , , - , , , , , , - { , "RTSH", color="grey20" } - }; - }; - row { - top= 77; - keys { , , { , 9 }, - , , { , "EXEC" }, - { , "SPCE" }, { , "KANJ" }, , - , , - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 61; - left= 352; - row { - top= 1; - keys { , , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - top= 58; - left= 20; - keys { }; - }; - row { - top= 77; - keys { , , }; - }; - }; // End of "Editing" section -}; - -xkb_geometry "type5_se" { - - // kbd: type = 4, layout = 43 - - description= "Sun Type5 keyboard (Sweden)"; - - width= 510; - height= 170; - - baseColor= "grey"; - labelColor= "black"; - - shape.cornerRadius= 1; - - shape "EDGE" { cornerRadius= 2, { [ 510, 170 ] } }; - shape "LOGO" { cornerRadius= 2, - { [ 0, 8], [ 8, 16], [ 16, 8], [ 8, 0] } - }; - - shape "NORM" { { [ 18, 18] }, { [ 2, 1], [ 16, 17] } }; - shape "BKSP" { { [ 38, 18] }, { [ 2, 1], [ 36, 17] } }; - shape "TABK" { { [ 27, 18] }, { [ 2, 1], [ 25, 17] } }; - shape "RTRN" { - { [ 0, 0], [ 29, 0], [ 29, 37], [ 5, 37], [ 5, 18], [ 0, 18] }, - { [ 2, 1], [ 27, 1], [ 27, 36], [ 7, 36], [ 7, 17], [ 2, 17] } - }; - shape "CAPS" { { [ 32, 18] }, { [ 2, 1], [ 30, 17 ] } }; - shape "LFSH" { { [ 24, 18] }, { [ 2, 1], [ 22, 17 ] } }; - shape "RTSH" { { [ 51, 18] }, { [ 2, 1], [ 49, 17 ] } }; - shape "LCTL" { { [ 32, 18] }, { [ 2, 1], [ 30, 17 ] } }; - shape "MODK" { { [ 28, 18] }, { [ 2, 1], [ 26, 17 ] } }; - shape "SPCE" { { [157, 18] }, { [ 2, 1], [155, 17 ] } }; - shape "KP0" { { [ 37, 18] }, { [ 2, 1], [ 35, 17 ] } }; - shape "KPAD" { { [ 18, 37] }, { [ 2, 1], [ 16, 36 ] } }; - shape "HELP" { { [ 37, 18] }, { [ 2, 1], [ 35, 17 ] } }; - - section "Function" { - key.color= "grey10"; - priority= 1; - top= 24; - left= 14; - width= 481; - height= 19; - row { - top= 1; - left= 1; - keys { - { , "HELP", 1 }, { , "NORM", 9 }, - { , "NORM", 19 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 11 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 11 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 9 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 11 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1, color= "white" } - }; - }; - }; // End of "Function" section - - section "Alpha" { - key.color= "white"; - priority= 2; - top= 61; - left= 14; - width= 333; - height= 95; - row { - top= 1; - left= 1; - keys { - { , "NORM", 1, color= "grey10" }, - { , "NORM", 1, color= "grey10" }, - { , "NORM", 9 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, - { , "BKSP", 1, color="grey10" } - }; - }; - row { - top= 20; - left= 1; - keys { - { , "NORM", 1, color= "grey10" }, - { , "NORM", 1, color= "grey10" }, - { , "TABK", 9, color= "grey10" }, - { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, - { , "RTRN", 1, color= "grey10" } - }; - }; - row { - top= 39; - left= 1; - keys { - { , "NORM", 1, color= "grey10" }, - { , "NORM", 1, color= "grey10" }, - { , "CAPS", 9, color= "grey10" }, - { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 } - }; - }; - row { - top= 58; - left= 1; - keys { - { , "NORM", 1, color= "grey10" }, - { , "NORM", 1, color= "grey10" }, - { , "LFSH", 9, color= "grey10" }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, - { , "RTSH", 1, color="grey10" } - }; - }; - row { - top= 77; - left= 1; - key.color= "grey10"; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "LCTL", 9 }, { , "NORM", 1 }, - { , "NORM", 1 }, - { , "SPCE", 1, color= "white" }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 } - }; - }; - }; // End of "Alpha" section - - section "Editing" { - key.color= "grey10"; - priority= 3; - top= 61; - left= 352; - width= 58; - height= 95; - row { - top= 1; - left= 1; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 } - }; - }; - row { - top= 20; - left= 1; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 } - }; - }; - row { - top= 58; - left= 20; - keys { - { , "NORM", 1 } - }; - }; - row { - top= 77; - left= 1; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 } - }; - }; - }; // End of "Editing" section - - section "Keypad" { - key.color= "white"; - priority= 4; - top= 61; - left= 420; - width= 77; - height= 95; - row { - top= 1; - left= 1; - key.color= "grey10"; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 } - }; - }; - row { - top= 20; - left= 1; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, - { , "KPAD", 1, color="grey10" } - }; - }; - row { - top= 39; - left= 1; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 } - }; - }; - row { - top= 58; - left= 1; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, - { , "KPAD", 1, color="grey10" } - }; - }; - row { - top= 77; - left= 1; - keys { - { , "KP0", 1 }, { , "NORM", 1 } - }; - }; - }; // End of "Keypad" section - - outline "Edges" { - top= 0; - left= 0; - priority= 0; - shape= "EDGE"; - }; - - solid "Logos" { - color= "blue"; - top= 5; - left= 25; - priority= 0; - shape= "LOGO"; - }; - - logo "SUNLogoImage" { - top= 5; - left= 25; - name= "SUN"; - priority= 1; - shape= "LOGO"; - }; - - shape "LED" { cornerRadius= 1, - { [ 0, 1.5], [ 1.5, 3], [ 3, 1.5], [ 1.5, 0] } - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.shape= "LED"; - indicator "Caps Lock" { left= 75; top= 103; priority= 5; }; - indicator "Compose" { left= 314; top= 142; priority= 5; }; - indicator "Scroll Lock" { left= 378; top= 29; }; - indicator "Num Lock" { left= 426; top= 66; }; -}; - -xkb_geometry "type5c_se" { - - // kbd: type = 4, layout = 43 - - description= "Sun Type5c keyboard (Sweden)"; - - width= 510; - height= 170; - - baseColor= "grey"; - labelColor= "black"; - - shape.cornerRadius= 1; - - shape "EDGE" { cornerRadius= 2, { [ 510, 170 ] } }; - shape "LOGO" { cornerRadius= 2, - { [ 0, 8], [ 8, 16], [ 16, 8], [ 8, 0] } - }; - - shape "NORM" { { [ 18, 18] }, { [ 2, 1], [ 16, 17] } }; - shape "BKSP" { { [ 38, 18] }, { [ 2, 1], [ 36, 17] } }; - shape "TABK" { { [ 27, 18] }, { [ 2, 1], [ 25, 17] } }; - shape "META" { { [ 27, 18] }, { [ 2, 1], [ 25, 17] } }; - shape "RTRN" { - { [ 0, 0], [ 29, 0], [ 29, 37], [ 5, 37], [ 5, 18], [ 0, 18] }, - { [ 2, 1], [ 27, 1], [ 27, 36], [ 7, 36], [ 7, 17], [ 2, 17] } - }; - shape "CAPS" { { [ 32, 18] }, { [ 2, 1], [ 30, 17 ] } }; - shape "LFSH" { { [ 24, 18] }, { [ 2, 1], [ 22, 17 ] } }; - shape "RTSH" { { [ 51, 18] }, { [ 2, 1], [ 49, 17 ] } }; - shape "LCTL" { { [ 32, 18] }, { [ 2, 1], [ 30, 17 ] } }; - shape "MODK" { { [ 28, 18] }, { [ 2, 1], [ 26, 17 ] } }; - shape "SPCE" { { [139, 18] }, { [ 2, 1], [137, 17 ] } }; - shape "KP0" { { [ 37, 18] }, { [ 2, 1], [ 35, 17 ] } }; - shape "KPAD" { { [ 18, 37] }, { [ 2, 1], [ 16, 36 ] } }; - shape "HELP" { { [ 37, 18] }, { [ 2, 1], [ 35, 17 ] } }; - - section "Function" { - key.color= "grey10"; - priority= 1; - top= 24; - left= 14; - width= 481; - height= 19; - row { - top= 1; - left= 1; - keys { - { , "HELP", 1 }, { , "NORM", 9 }, - { , "NORM", 19 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 11 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 11 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 9 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 11 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1, color= "white" } - }; - }; - }; // End of "Function" section - - section "Alpha" { - key.color= "white"; - priority= 2; - top= 61; - left= 14; - width= 333; - height= 95; - row { - top= 1; - left= 1; - keys { - { , "NORM", 1, color= "grey10" }, - { , "NORM", 1, color= "grey10" }, - { , "NORM", 9 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, - { , "BKSP", 1, color="grey10" } - }; - }; - row { - top= 20; - left= 1; - keys { - { , "NORM", 1, color= "grey10" }, - { , "NORM", 1, color= "grey10" }, - { , "TABK", 9, color= "grey10" }, - { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, - { , "RTRN", 1, color= "grey10" } - }; - }; - row { - top= 39; - left= 1; - keys { - { , "NORM", 1, color= "grey10" }, - { , "NORM", 1, color= "grey10" }, - { , "CAPS", 9, color= "grey10" }, - { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 } - }; - }; - row { - top= 58; - left= 1; - keys { - { , "NORM", 1, color= "grey10" }, - { , "NORM", 1, color= "grey10" }, - { , "LFSH", 9, color= "grey10" }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, - { , "RTSH", 1, color="grey10" } - }; - }; - row { - top= 77; - left= 1; - key.color= "grey10"; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "LCTL", 9 }, { , "NORM", 1 }, - { , "META", 1 }, - { , "SPCE", 1, color= "white" }, - { , "META", 1 }, { , "NORM", 1 }, - { , "NORM", 1 } - }; - }; - }; // End of "Alpha" section - - section "Editing" { - key.color= "grey10"; - priority= 3; - top= 61; - left= 352; - width= 58; - height= 95; - row { - top= 1; - left= 1; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 } - }; - }; - row { - top= 20; - left= 1; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 } - }; - }; - row { - top= 58; - left= 20; - keys { - { , "NORM", 1 } - }; - }; - row { - top= 77; - left= 1; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 } - }; - }; - }; // End of "Editing" section - - section "Keypad" { - key.color= "white"; - priority= 4; - top= 61; - left= 420; - width= 77; - height= 95; - row { - top= 1; - left= 1; - key.color= "grey10"; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, { , "NORM", 1 } - }; - }; - row { - top= 20; - left= 1; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, - { , "KPAD", 1, color="grey10" } - }; - }; - row { - top= 39; - left= 1; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 } - }; - }; - row { - top= 58; - left= 1; - keys { - { , "NORM", 1 }, { , "NORM", 1 }, - { , "NORM", 1 }, - { , "KPAD", 1, color="grey10" } - }; - }; - row { - top= 77; - left= 1; - keys { - { , "KP0", 1 }, { , "NORM", 1 } - }; - }; - }; // End of "Keypad" section - - outline "Edges" { - top= 0; - left= 0; - priority= 0; - shape= "EDGE"; - }; - - solid "Logos" { - color= "blue"; - top= 5; - left= 15; - priority= 0; - shape= "LOGO"; - }; - - logo "SUNLogoImage" { - top= 5; - left= 15; - name= "SUN"; - priority= 1; - shape= "LOGO"; - }; - - text.font= "charter"; - text.weight= "medium"; - text.slant= "i"; - text.fontSize= 40; - text "SunLogoText" { - top= 5; - left= 32; - color= "blue"; - text= "Sun"; - }; - - shape "LED" { cornerRadius= 1, - { [ 0, 1.5], [ 1.5, 3], [ 3, 1.5], [ 1.5, 0] } - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.shape= "LED"; - indicator "Caps Lock" { left= 75; top= 103; priority= 5; }; - indicator "Compose" { left= 314; top= 142; priority= 5; }; - indicator "Scroll Lock" { left= 378; top= 29; }; - indicator "Num Lock" { left= 426; top= 66; }; -}; - -xkb_geometry "type4_se" { - - // kbd: type = 4, layout = 11 - - description= "Sun Type4 keyboard (Sweden)"; - - - width= 453; - height= 183; - - baseColor= "grey"; - labelColor= "black"; - - shape "EDGE" { cornerRadius= 2, { [ 452, 185 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "DELE" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "RTRN" { - approx = { [ 0, 0], [28,37] }, - { [ 0, 0], [28, 0], [28,37], - [ 5,37], [ 5,19], [ 0,19] }, - { [ 1, 1], [26, 1], [26,36], - [ 7,36], [ 7,18], [ 1,18] } - }; - shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "LFSH" { { [ 22,18] }, { [2,1], [20,17] } }; - shape "RTSH" { { [ 33,18] }, { [2,1], [31,17] } }; - shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [170,18] }, { [2,1], [168,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 17; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - - section "Alpha" { - top= 58; - row { - top= 1; - key.color= "grey10"; - keys { , , { , 9 }, - , , , - , , , , - , , , , - { , color= "white"}, - { , color= "white"}, - , { , 9 }, - , , - }; - }; - row { - top= 20; - key.color= "white"; - keys { - { , color= "grey10" }, - { , color= "grey10" }, - { , 9, color= "grey10" }, - , , , , , - , , , , , - , , - { , "BKSP", color= "grey10" }, - { , 9, color= "grey10" }, - { , color= "grey10" }, - { , color= "grey10" }, - { , color= "grey10" } - }; - }; - row { - top= 39; - key.color= "white"; - keys { - { , color= "grey10" }, - { , color= "grey10" }, - { , 9, "TABK", color= "grey10" }, - , , , , , - , , , , , - , , - { , "RTRN", color= "grey10" }, - { , 9, color= "grey10" }, - { , color= "grey10" }, - { , color= "grey10" }, - { , "KPAD", color= "grey10" } - }; - }; - row { - top= 58; - key.color= "white"; - keys { - { , color= "grey10" }, - { , color= "grey10" }, - { , 9, "LCTL", color= "grey10" }, - , , , , , - , , , , , - , , - { , 33, color= "grey10" }, - { , color= "grey10" }, - { , color= "grey10" } - }; - }; - row { - top= 77; - key.color= "white"; - keys { - { , color= "grey10" }, - { , color= "grey10" }, - { , 9 , "LFSH", color= "grey10" }, - , , , , - , , , , - , , , - { , "RTSH", color= "grey10" }, - { , color= "grey10" }, - { , 9, color= "grey10" }, - { , color= "grey10" }, - { , color= "grey10" }, - { , "KPAD", color= "grey10" } - }; - }; - row { - top= 96; - key.color= "grey10"; - keys { - { , "HELP" }, { , 9 }, - , , - { , "SPCE", color= "white" }, - , , , - { , 9, "KP0" }, - }; - }; - }; // End of "Alpha" section - - shape "RIDGE" { cornerRadius= 1, { [ 0, 1], [ 1, 0 ], - [330, 0], [331, 1], - [330, 2], [ 1, 2] } }; - solid "Ridge" { - shape= "RIDGE"; - top= 48; - left= 18; - }; - - shape "LEDS" { cornerRadius= 1, { [ 75 ,21 ] } }; - shape "LED" { cornerRadius= 0, { [ 7, 4 ] } }; - outline "LedPanel" { - shape= "LEDS"; - top= 28; - left= 358; - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 43; - indicator.shape= "LED"; - indicator "Caps Lock" { left= 364; }; - indicator "Compose" { left= 383; }; - indicator "Scroll Lock" { left= 402; }; - indicator "Num Lock" { left= 421; }; - text.top= 32; - text.color= "black"; - text "CapsLockLabel" { left= 364; text="Caps\nLock"; }; - text "ComposeLabel" { left= 380; text="\nCompose"; }; - text "ScrollLockLabel" { left= 402; text="Scroll\nLock"; }; - text "NumLockLabel" { left= 421; text="Num\nLock"; }; -}; - -xkb_geometry "t6" { - - // This is an approximate layout for a (US/ASCII) Sun Type6 - // keyboard. I just took a similar layout (101 key PC keyboard) - // and adjusted the sizes. - - width= 515; - height= 170; - - shape "EDGE" { cornerRadius= 2, { [ 515, 170 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "BKSL" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "RTRN" { { [ 42,18] }, { [2,1], [40,17] } }; - shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "LFSH" { { [ 42,18] }, { [2,1], [40,17] } }; - shape "RTSH" { { [ 51,18] }, { [2,1], [49,17] } }; - shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [136,18] }, { [2,1], [134,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "RMTA" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "LMTA" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 14; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 24; - row { - top= 1; - keys { { , "HELP" }, { , 9 }, - { , 19 }, , , , - { , 11 }, , , , - { , 11 }, , , , - { , 9 }, , , - { , 9 }, , , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 61; - row { - top= 1; - keys { , , - { , 9}, , , , , - , , , , , - , , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { , , { , 9, shape="TABK" }, - , , , , , - , , , , , - , , - { , "BKSL" } - }; - }; - row { - top= 39; - keys { , , { , 9, shape="CAPS" }, - , , , , , - , , , , , - , - { , "RTRN" } - }; - }; - row { - top= 58; - keys { , , { , 9 , shape="LFSH" }, - , , , , , - , , , , , - { , "RTSH", color="grey20" } - }; - }; - row { - top= 77; - keys { , , { , 9, shape="LCTL" }, - , { , "LMTA" }, - { , "SPCE" }, - { , "RMTA" }, , - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 61; - left= 352; - row { - top= 1; - keys { , , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - top= 58; - left= 20; - keys { }; - }; - row { - top= 77; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 61; - left= 420; - row { - top= 1; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - - shape "LEDS" { cornerRadius= 0, { [ 78 ,21 ] } }; - shape "LED" { cornerRadius= 2, { [ 3, 6 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 1; - left= 218; - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 10; - indicator.shape= "LED"; - indicator "CapsLock" { left= 243; }; - indicator "Compose" { left= 281; }; - indicator "ScrollLock" { left= 262; }; - indicator "NumLock" { left= 224; }; - text.top= 1; - text.color= "black"; - text "CapsLockLabel" { left= 243; text="Caps\nLock"; }; - text "ComposeLabel" { left= 281; text="Compose"; }; - text "ScrollLockLabel" { left= 262; text="Scroll\nLock"; }; - text "NumLockLabel" { left= 224; text="Num\nLock"; }; - - -}; - -xkb_geometry "t6tuv" { - - // This is an approximate layout for a (US/ASCII) Sun Type6 - // keyboard. I just took a similar layout (101 key PC keyboard) - // and adjusted the sizes. - - width= 515; - height= 170; - - shape "EDGE" { cornerRadius= 2, { [ 515, 170 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "RTRN" { - approx = { [ 0, 0], [28,37] }, - { [ 0, 0], [28, 0], [28,37], - [ 5,37], [ 5,18], [ 0,18] }, - { [ 1, 1], [26, 1], [26,36], - [ 7,36], [ 7,17], [ 1,17] } - }; - shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "LFSH" { { [ 24,18] }, { [2,1], [22,17] } }; - shape "RTSH" { { [ 51,18] }, { [2,1], [49,17] } }; - shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [137,18] }, { [2,1], [135,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "RMTA" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "LMTA" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 14; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 24; - row { - top= 1; - keys { { , "HELP" }, { , 9 }, - { , 19 }, , , , - { , 11 }, , , , - { , 11 }, , , , - { , 9 }, , , - { , 9 }, , , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 61; - row { - top= 1; - keys { , , - { , 9}, , , , , - , , , , , - , , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { , , { , 9, shape="TABK" }, - , , , , , - , , , , , - , , - { , "RTRN" } - }; - }; - row { - top= 39; - keys { , , { , 9, shape="CAPS" }, - , , , , , - , , , , , - , - }; - }; - row { - top= 58; - keys { , , { , 9 , shape="LFSH" }, , - , , , , , - , , , , , - { , "RTSH", color="grey20" } - }; - }; - row { - top= 77; - keys { , , { , 9, shape="LCTL" }, - , { , "LMTA" }, - { , "SPCE" }, - { , "RMTA" }, , - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 61; - left= 352; - row { - top= 1; - keys { , , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - top= 58; - left= 20; - keys { }; - }; - row { - top= 77; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 61; - left= 420; - row { - top= 1; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - - shape "LEDS" { cornerRadius= 0, { [ 78 ,21 ] } }; - shape "LED" { cornerRadius= 2, { [ 3, 6 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 1; - left= 218; - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 10; - indicator.shape= "LED"; - indicator "CapsLock" { left= 243; }; - indicator "Compose" { left= 281; }; - indicator "ScrollLock" { left= 262; }; - indicator "NumLock" { left= 224; }; - text.top= 1; - text.color= "black"; - text "CapsLockLabel" { left= 243; text="Caps\nLock"; }; - text "ComposeLabel" { left= 281; text="Compose"; }; - text "ScrollLockLabel" { left= 262; text="Scroll\nLock"; }; - text "NumLockLabel" { left= 224; text="Num\nLock"; }; - -}; - -xkb_geometry "t6jp" { - - // This is an approximate layout for a (US/ASCII) Sun Type6 - // keyboard. I just took a similar layout (101 key PC keyboard) - // and adjusted the sizes. - - width= 515; - height= 170; - - shape "EDGE" { cornerRadius= 2, { [ 515, 170 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "KANJ" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "EXEC" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "RTRN" { - approx = { [ 0, 0], [28,37] }, - { [ 0, 0], [28, 0], [28,37], - [ 5,37], [ 5,18], [ 0,18] }, - { [ 1, 1], [26, 1], [26,36], - [ 7,36], [ 7,17], [ 1,17] } - }; - shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "LFSH" { { [ 42,18] }, { [2,1], [40,17] } }; - shape "RTSH" { { [ 33,18] }, { [2,1], [31,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [ 96,18] }, { [2,1], [94,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 14; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 24; - row { - top= 1; - keys { { , "HELP" }, { , 9 }, - { , 19 }, , , , - { , 11 }, , , , - { , 11 }, , , , - { , 9 }, , , - { , 9 }, , , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 61; - row { - top= 1; - keys { , , - { , 9}, , , , , - , , , , , - , , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 20; - keys { , , { , 9, shape="TABK" }, - , , , , , - , , , , , - , , - { , "RTRN" } - }; - }; - row { - top= 39; - keys { , , { , 9, shape="CAPS" }, - , , , , , - , , , , , - , - }; - }; - row { - top= 58; - keys { , , { , 9 , shape="LFSH" }, - , , , , , - , , , , , , - { , "RTSH", color="grey20" } - }; - }; - row { - top= 77; - keys { , , { , 9 }, - , , { , "EXEC" }, - { , "SPCE" }, { , "KANJ" }, , - , , - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 61; - left= 352; - row { - top= 1; - keys { , , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - top= 58; - left= 20; - keys { }; - }; - row { - top= 77; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 61; - left= 420; - row { - top= 1; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - - shape "LEDS" { cornerRadius= 0, { [ 78 ,21 ] } }; - shape "LED" { cornerRadius= 2, { [ 3, 6 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 1; - left= 218; - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 10; - indicator.shape= "LED"; - indicator "CapsLock" { left= 243; }; - indicator "Compose" { left= 281; }; - indicator "ScrollLock" { left= 262; }; - indicator "NumLock" { left= 224; }; - text.top= 1; - text.color= "black"; - text "CapsLockLabel" { left= 243; text="Caps\nLock"; }; - text "ComposeLabel" { left= 281; text="Compose"; }; - text "ScrollLockLabel" { left= 262; text="Scroll\nLock"; }; - text "NumLockLabel" { left= 224; text="Num\nLock"; }; - -}; - -xkb_geometry "t6unix" { - - // This is an approximate layout for a (US/ASCII) Sun Type6 - // keyboard. I just took a similar layout (101 key PC keyboard) - // and adjusted the sizes. - - width= 515; - height= 170; - - shape "EDGE" { cornerRadius= 2, { [ 515, 170 ] } }; - shape.cornerRadius= 1; - shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; - shape "BKSP" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; - shape "RTRN" { { [ 42,18] }, { [2,1], [40,17] } }; - shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "LFSH" { { [ 42,18] }, { [2,1], [40,17] } }; - shape "RTSH" { { [ 51,18] }, { [2,1], [49,17] } }; - shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; - shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "SPCE" { { [136,18] }, { [2,1], [134,17] } }; - shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; - shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; - shape "RMTA" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "LMTA" { { [ 28,18] }, { [2,1], [26,17] } }; - shape "LOGO" { { [ 16,16] } }; - - outline "Edges" { - top= 0; - left= 0; - shape= "EDGE"; - }; - - section.left= 14; - row.left= 1; - key.shape= "NORM"; - key.gap= 1; - section "Function" { - top= 24; - row { - top= 1; - keys { { , "HELP" }, { , 9 }, - { , 19 }, , , , - { , 11 }, , , , - { , 11 }, , , , - { , 9 }, , , - { , 9 }, , , - }; - }; - }; // End of "Function" section - - section "Alpha" { - top= 61; - row { - top= 1; - keys { , , - { , 9}, , , , , - , , , , , - , , , - , - }; - }; - row { - top= 20; - keys { , , { , 9, shape="TABK" }, - , , , , , - , , , , , - , , - { , "BKSP", color="grey20" } - }; - }; - row { - top= 39; - keys { , , { , 9, shape="CAPS" }, - , , , , , - , , , , , - , - { , "RTRN" } - }; - }; - row { - top= 58; - keys { , , { , 9 , shape="LFSH" }, - , , , , , - , , , , , - { , "RTSH", color="grey20" } - }; - }; - row { - top= 77; - keys { , , { , 9, shape="LCTL" }, - , {, "LMTA"}, - { , "SPCE" }, - {, "RMTA"}, , - }; - }; - }; // End of "Alpha" section - - section "Editing" { - top= 61; - left= 352; - row { - top= 1; - keys { , , }; - }; - row { - top= 20; - keys { , , }; - }; - row { - top= 58; - left= 20; - keys { }; - }; - row { - top= 77; - keys { , , }; - }; - }; // End of "Editing" section - - section "Keypad" { - top= 61; - left= 420; - row { - top= 1; - keys { , , , }; - }; - row { - top= 20; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 39; - keys { , , }; - }; - row { - top= 58; - keys { , , , { , "KPAD", color= "grey20" } }; - }; - row { - top= 77; - keys { { , "KP0" }, }; - }; - }; // End of "Keypad" section - - shape "LEDS" { cornerRadius= 0, { [ 78 ,21 ] } }; - shape "LED" { cornerRadius= 2, { [ 3, 6 ] } }; - solid "LedPanel" { - shape= "LEDS"; - top= 1; - left= 218; - }; - indicator.onColor= "green"; - indicator.offColor= "green30"; - indicator.top= 10; - indicator.shape= "LED"; - indicator "CapsLock" { left= 243; }; - indicator "Compose" { left= 281; }; - indicator "ScrollLock" { left= 262; }; - indicator "NumLock" { left= 224; }; - text.top= 1; - text.color= "black"; - text "CapsLockLabel" { left= 243; text="Caps\nLock"; }; - text "ComposeLabel" { left= 281; text="Compose"; }; - text "ScrollLockLabel" { left= 262; text="Scroll\nLock"; }; - text "NumLockLabel" { left= 224; text="Num\nLock"; }; -}; - -xkb_geometry "type5" { - include "sun(t5)" - description= "Sun Type5 keyboard"; -}; - -xkb_geometry "type5jp" { - include "sun(t5jp)" - description= "Sun Type5 Japanese keyboard"; -}; - -xkb_geometry "type5tuv" { - include "sun(t5tuv)" - description= "Sun Type5 keyboard"; -}; - -xkb_geometry "type5euro" { - include "sun(t5tuv)" - description= "Sun Type5 keyboard"; -}; - -xkb_geometry "type5unix" { - include "sun(t5unix)" - description= "Sun Type5 Unix keyboard"; -}; - -xkb_geometry "type5hobo" { - include "sun(t5hobo)" - description= "Sun Type5 Hobo keyboard"; -}; - -xkb_geometry "type5tuvhobo" { - include "sun(t5tuvhobo)" - description= "Sun Type5 Hobo keyboard"; -}; - -xkb_geometry "type5jphobo" { - include "sun(t5jphobo)" - description= "Sun Type5 Japanese Hobo keyboard"; -}; - -default xkb_geometry "type6" { - include "sun(t6)" - description= "Sun Type6 keyboard (US, Korea, Taiwan)"; -}; - -xkb_geometry "type6jp" { - include "sun(t6jp)" - description= "Sun Type6 Japanese keyboard"; -}; - -xkb_geometry "type6tuv" { - include "sun(t6tuv)" - description= "Sun Type6 TUV keyboard"; -}; - -xkb_geometry "type6unix" { - include "sun(t6unix)" - description= "Sun Type6 Unix keyboard"; -}; - -xkb_geometry "x86" { - include "pc(pc101)" - description= "x86 Style Keyboard"; -}; - -xkb_geometry "MS_x86" { - include "pc(pc104)" - description= "x86 104 Key Keyboard"; -}; - -xkb_geometry "x86tuv" { - include "pc(pc102)" - description= "x86 European Style Keyboard"; -}; +// +//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. +// +// --------------------------------------------------------------------------- +// Copyright 2004 Sun Microsystems, 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 (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. +// +// --------------------------------------------------------------------------- +// +xkb_geometry "type4" { + + // This is an approximate layout for a (US/ASCII) Sun Type4 US + // keyboard. + + description= "Sun Type4 keyboard"; + + width= 452; + height= 185; + + shape "EDGE" { cornerRadius= 2, { [ 452, 185 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "DELE" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "RTRN" { + approx = { [ 0, 0], [28,37] }, + { [ 0, 0], [28, 0], [28,37], + [ 5,37], [ 5,19], [ 0,19] }, + { [ 1, 1], [26, 1], [26,36], + [ 7,36], [ 7,18], [ 1,18] } + }; + shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "LFSH" { { [ 41,18] }, { [2,1], [39,17] } }; + shape "RTSH" { { [ 33,18] }, { [2,1], [31,17] } }; + shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [170,18] }, { [2,1], [168,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 17; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + + section "Alpha" { + top= 58; + row { + top= 1; + keys { , , + { , 9 }, , , , + , , , , + , , , , + , { , "DELE" }, + { , 9 }, , , + }; + }; + row { + top= 20; + keys { , , { , 9 }, + , , , , , + , , , , , + , , + { , "BKSP" }, + { , 9 }, , , + + }; + }; + row { + top= 39; + keys { , , + { , 9, shape="TABK" }, + , , , , , + , , , , , + , , { , "RTRN" }, + { , 9 }, , , { , "KPAD" } + }; + }; + row { + top= 58; + keys { , , + { , 9, shape="LCTL" }, + , , , , , + , , , , , + , , + { , 33 }, , + }; + }; + row { + top= 77; + keys { , , + { , 9 , shape="LFSH" }, + , , , , , + , , , , , + { , "RTSH" }, , + { , 9} , , , { , "KPAD" } + }; + }; + row { + top= 96; + keys { { , "HELP" }, { , 9 }, + , , { , "SPCE" }, + , , , + { , 9, shape="KP0" }, + }; + }; + }; // End of "Alpha" section + + shape "LEDS" { cornerRadius= 0, { [ 78 ,21 ] } }; + shape "LED" { cornerRadius= 0, { [ 7, 4 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 28; + left= 358; + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 43; + indicator.shape= "LED"; + indicator "Caps Lock" { left= 364; }; + indicator "Compose" { left= 383; }; + indicator "Scroll Lock" { left= 402; }; + indicator "Num Lock" { left= 421; }; + text.top= 34; + text.color= "black"; + text "CapsLockLabel" { left= 364; text="Caps\nLock"; }; + text "ComposeLabel" { left= 380; text="Compose"; }; + text "ScrollLockLabel" { left= 402; text="Scroll\nLock"; }; + text "NumLockLabel" { left= 421; text="Num\nLock"; }; +}; + +xkb_geometry "type4tuv" { + + // This is an approximate layout for a (US/ASCII) Sun Type4 TUV + // (European) keyboard with an extra key between the Shift_L + // and the Z keys, and two keys above the Bksp key, instead + // of a large delete key. + + description= "Sun Type4tuv keyboard"; + + width= 452; + height= 185; + + shape "EDGE" { cornerRadius= 2, { [ 452, 185 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; + + shape "RTRN" { + approx = { [ 0, 0], [28,37] }, + { [ 0, 0], [28, 0], [28,37], + [ 5,37], [ 5,19], [ 0,19] }, + { [ 1, 1], [26, 1], [26,36], + [ 7,36], [ 7,18], [ 1,18] } + }; + shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "RTSH" { { [ 33,18] }, { [2,1], [31,17] } }; + shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [170,18] }, { [2,1], [168,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 17; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + + section "Alpha" { + top= 58; + row { + top= 1; + keys { , , + { , 9 }, , , , + , , , , + , , , , + , ,, + { , 9 }, , , + }; + }; + row { + top= 20; + keys { , , { , 9 }, + , , , , , + , , , , , + , , + { , "BKSP" }, + { , 9 }, , , + + }; + }; + row { + top= 39; + keys { , , + { , 9, shape="TABK" }, + , , , , , + , , , , , + , , { , "RTRN" }, + { , 9 }, , , { , "KPAD" } + }; + }; + row { + top= 58; + keys { , , + { , 9, shape="LCTL" }, + , , , , , + , , , , , + , , + { , 33 }, , + }; + }; + row { + top= 77; + keys { , , + { , 9 }, , + , , , , , + , , , , , + { , "RTSH" }, , + { , 9} , , , { , "KPAD" } + }; + }; + row { + top= 96; + keys { { , "HELP" }, { , 9 }, + , , { , "SPCE" }, + , , , + { , 9, shape="KP0" }, + }; + }; + }; // End of "Alpha" section + + shape "LEDS" { cornerRadius= 0, { [ 78 ,21 ] } }; + shape "LED" { cornerRadius= 0, { [ 7, 4 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 28; + left= 358; + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 43; + indicator.shape= "LED"; + indicator "CapsLock" { left= 364; }; + indicator "Compose" { left= 383; }; + indicator "ScrollLock" { left= 402; }; + indicator "NumLock" { left= 421; }; + text.top= 34; + text.color= "black"; + text "CapsLockLabel" { left= 364; text="Caps\nLock"; }; + text "ComposeLabel" { left= 380; text="Compose"; }; + text "ScrollLockLabel" { left= 402; text="Scroll\nLock"; }; + text "NumLockLabel" { left= 421; text="Num\nLock"; }; +}; + +xkb_geometry "type4_ca" { + + // This is an approximate layout for a (US/ASCII) Sun Type4 + // Canadian and British keyboard with an extra key between + // the Shift_L + // and the Z keys. + + description= "Sun Type4_uk keyboard"; + + width= 452; + height= 185; + + shape "EDGE" { cornerRadius= 2, { [ 452, 185 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "DELE" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "RTRN" { + approx = { [ 0, 0], [28,37] }, + { [ 0, 0], [28, 0], [28,37], + [ 5,37], [ 5,19], [ 0,19] }, + { [ 1, 1], [26, 1], [26,36], + [ 7,36], [ 7,18], [ 1,18] } + }; + shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "RTSH" { { [ 33,18] }, { [2,1], [31,17] } }; + shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [170,18] }, { [2,1], [168,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 17; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + + section "Alpha" { + top= 58; + row { + top= 1; + keys { , , + { , 9 }, , , , + , , , , + , , , , + , { , "DELE" }, + { , 9 }, , , + }; + }; + row { + top= 20; + keys { , , { , 9 }, + , , , , , + , , , , , + , , + { , "BKSP" }, + { , 9 }, , , + + }; + }; + row { + top= 39; + keys { , , + { , 9, shape="TABK" }, + , , , , , + , , , , , + , , { , "RTRN" }, + { , 9 }, , , { , "KPAD" } + }; + }; + row { + top= 58; + keys { , , + { , 9, shape="LCTL" }, + , , , , , + , , , , , + , , + { , 33 }, , + }; + }; + row { + top= 77; + keys { , , + { , 9 }, , + , , , , , + , , , , , + { , "RTSH" }, , + { , 9} , , , { , "KPAD" } + }; + }; + row { + top= 96; + keys { { , "HELP" }, { , 9 }, + , , { , "SPCE" }, + , , , + { , 9, shape="KP0" }, + }; + }; + }; // End of "Alpha" section + + shape "LEDS" { cornerRadius= 0, { [ 78 ,21 ] } }; + shape "LED" { cornerRadius= 0, { [ 7, 4 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 28; + left= 358; + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 43; + indicator.shape= "LED"; + indicator "CapsLock" { left= 364; }; + indicator "Compose" { left= 383; }; + indicator "ScrollLock" { left= 402; }; + indicator "NumLock" { left= 421; }; + text.top= 34; + text.color= "black"; + text "CapsLockLabel" { left= 364; text="Caps\nLock"; }; + text "ComposeLabel" { left= 380; text="Compose"; }; + text "ScrollLockLabel" { left= 402; text="Scroll\nLock"; } +; + text "NumLockLabel" { left= 421; text="Num\nLock"; }; +}; + +xkb_geometry "type4jp" { + + // This is an approximate layout for a Japanese Sun Type4 + // keyboard, based on the European TUV keyboard. It has two keys + // above the Bksp key, instead of a large delete key, but lacks + // the extra key between Shift_L and Z. + + description= "Sun Japanese Type4 keyboard"; + + width= 452; + height= 185; + + shape "EDGE" { cornerRadius= 2, { [ 452, 185 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; + + shape "RTRN" { + approx = { [ 0, 0], [28,37] }, + { [ 0, 0], [28, 0], [28,37], + [ 5,37], [ 5,19], [ 0,19] }, + { [ 1, 1], [26, 1], [26,36], + [ 7,36], [ 7,18], [ 1,18] } + }; + shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "RTSH" { { [ 33,18] }, { [2,1], [31,17] } }; + shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [ 97,18] }, { [2,1], [95,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "LFSH" { { [ 41,18] }, { [2,1], [39,17] } }; + shape "KANJ" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "EXEC" { { [ 27,18] }, { [2,1], [25,17] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 17; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + + section "Alpha" { + top= 58; + row { + top= 1; + keys { , , + { , 9 }, , , , + , , , , + , , , , + , ,, + { , 9 }, , , + }; + }; + row { + top= 20; + keys { , , { , 9 }, + , , , , , + , , , , , + , , + { , "BKSP" }, + { , 9 }, , , + + }; + }; + row { + top= 39; + keys { , , + { , 9, shape="TABK" }, + , , , , , + , , , , , + , , { , "RTRN" }, + { , 9 }, , , { , "KPAD" } + }; + }; + row { + top= 58; + keys { , , + { , 9, shape="LCTL" }, + , , , , , + , , , , , + , , + { , 33 }, , + }; + }; + row { + top= 77; + keys { , , + { , 9, shape="LFSH" }, + , , , , , + , , , , , + , { , "RTSH" }, + { , 9} , , , { , "KPAD" } + }; + }; + row { + top= 96; + keys { { , "HELP" }, { , 9 }, + , , { , "EXEC"} , { , "SPCE" }, + { , "KANJ" }, , , , , + { , 9, shape="KP0" }, + }; + }; + }; // End of "Alpha" section + + shape "LEDS" { cornerRadius= 0, { [ 78 ,21 ] } }; + shape "LED" { cornerRadius= 0, { [ 7, 4 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 28; + left= 358; + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 43; + indicator.shape= "LED"; + indicator "CapsLock" { left= 364; }; + indicator "Compose" { left= 383; }; + indicator "ScrollLock" { left= 402; }; + indicator "NumLock" { left= 421; }; + text.top= 34; + text.color= "black"; + text "CapsLockLabel" { left= 364; text="Caps\nLock"; }; + text "ComposeLabel" { left= 380; text="Compose"; }; + text "ScrollLockLabel" { left= 402; text="Scroll\nLock"; }; + text "NumLockLabel" { left= 421; text="Num\nLock"; }; +}; + +xkb_geometry "t5" { + + // This is an approximate layout for a (US/ASCII) Sun Type5 + // keyboard. I just took a similar layout (101 key PC keyboard) + // and adjusted the sizes. + + width= 515; + height= 170; + + shape "EDGE" { cornerRadius= 2, { [ 515, 170 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "BKSL" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "RTRN" { { [ 42,18] }, { [2,1], [40,17] } }; + shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "LFSH" { { [ 42,18] }, { [2,1], [40,17] } }; + shape "RTSH" { { [ 51,18] }, { [2,1], [49,17] } }; + shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [156,18] }, { [2,1], [154,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 14; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 24; + row { + top= 1; + keys { { , "HELP" }, { , 9 }, + { , 19 }, , , , + { , 11 }, , , , + { , 11 }, , , , + { , 9 }, , , + { , 9 }, , , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 61; + row { + top= 1; + keys { , , + { , 9}, , , , , + , , , , , + , , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { , , { , 9, shape="TABK" }, + , , , , , + , , , , , + , , + { , "BKSL" } + }; + }; + row { + top= 39; + keys { , , { , 9, shape="CAPS" }, + , , , , , + , , , , , + , + { , "RTRN" } + }; + }; + row { + top= 58; + keys { , , { , 9 , shape="LFSH" }, + , , , , , + , , , , , + { , "RTSH", color="grey20" } + }; + }; + row { + top= 77; + keys { , , { , 9, shape="LCTL" }, + , , + { , "SPCE" }, + , , + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 61; + left= 352; + row { + top= 1; + keys { , , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + top= 58; + left= 20; + keys { }; + }; + row { + top= 77; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 61; + left= 420; + row { + top= 1; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section +}; + +xkb_geometry "t5tuv" { + + // This is an approximate layout for a TUV/European Sun Type5 keyboard. + + width= 515; + height= 170; + + shape "EDGE" { cornerRadius= 2, { [ 515, 170 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "RTRN" { + approx = { [ 0, 0], [28,37] }, + { [ 0, 0], [28, 0], [28,37], + [ 5,37], [ 5,18], [ 0,18] }, + { [ 1, 1], [26, 1], [26,36], + [ 7,36], [ 7,17], [ 1,17] } + }; + shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "LFSH" { { [ 24,18] }, { [2,1], [22,17] } }; + shape "RTSH" { { [ 51,18] }, { [2,1], [49,17] } }; + shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [157,18] }, { [2,1], [155,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 14; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 24; + row { + top= 1; + keys { { , "HELP" }, { , 9 }, + { , 19 }, , , , + { , 11 }, , , , + { , 11 }, , , , + { , 9 }, , , + { , 9 }, , , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 61; + row { + top= 1; + keys { , , + { , 9}, , , , , + , , , , , + , , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { , , { , 9, shape="TABK" }, + , , , , , + , , , , , + , , + { , "RTRN" } + }; + }; + row { + top= 39; + keys { , , { , 9, shape="CAPS" }, + , , , , , + , , , , , + , + }; + }; + row { + top= 58; + keys { , , { , 9 , shape="LFSH" }, , + , , , , , + , , , , , + { , "RTSH" } + }; + }; + row { + top= 77; + keys { , , { , 9, shape="LCTL" }, + , , + { , "SPCE" }, + , , + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 61; + left= 352; + row { + top= 1; + keys { , , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + top= 58; + left= 20; + keys { }; + }; + row { + top= 77; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 61; + left= 420; + row { + top= 1; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section +}; + + +xkb_geometry "t5jp" { + + // This is an approximate layout for a Japanese Sun Type5 keyboard. + + width= 515; + height= 170; + + shape "EDGE" { cornerRadius= 2, { [ 515, 170 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "KANJ" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "EXEC" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "RTRN" { + approx = { [ 0, 0], [28,37] }, + { [ 0, 0], [28, 0], [28,37], + [ 5,37], [ 5,18], [ 0,18] }, + { [ 1, 1], [26, 1], [26,36], + [ 7,36], [ 7,17], [ 1,17] } + }; + shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "LFSH" { { [ 42,18] }, { [2,1], [40,17] } }; + shape "RTSH" { { [ 33,18] }, { [2,1], [31,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [ 97,18] }, { [2,1], [95,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 14; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 24; + row { + top= 1; + keys { { , "HELP" }, { , 9 }, + { , 19 }, , , , + { , 11 }, , , , + { , 11 }, , , , + { , 9 }, , , + { , 9 }, , , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 61; + row { + top= 1; + keys { , , + { , 9}, , , , , + , , , , , + , , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { , , { , 9, shape="TABK" }, + , , , , , + , , , , , + , , + { , "RTRN" } + }; + }; + row { + top= 39; + keys { , , { , 9, shape="CAPS" }, + , , , , , + , , , , , + , + }; + }; + row { + top= 58; + keys { , , { , 9 , shape="LFSH" }, + , , , , , + , , , , , , + { , "RTSH", color="grey20" } + }; + }; + row { + top= 77; + keys { , , { , 9 }, + , , { , "EXEC" }, + { , "SPCE" }, { , "KANJ" }, , + , , + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 61; + left= 352; + row { + top= 1; + keys { , , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + top= 58; + left= 20; + keys { }; + }; + row { + top= 77; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 61; + left= 420; + row { + top= 1; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section +}; + +xkb_geometry "t5unix" { + + // This is an approximate layout for a (US/ASCII) Sun Type5 + // keyboard. I just took a similar layout (101 key PC keyboard) + // and adjusted the sizes. + + width= 515; + height= 170; + + shape "EDGE" { cornerRadius= 2, { [ 515, 170 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "BKSL" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "RTRN" { { [ 42,18] }, { [2,1], [40,17] } }; + shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "LFSH" { { [ 42,18] }, { [2,1], [40,17] } }; + shape "RTSH" { { [ 51,18] }, { [2,1], [49,17] } }; + shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [157,18] }, { [2,1], [155,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 14; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 24; + row { + top= 1; + keys { { , "HELP" }, { , 9 }, + { , 19 }, , , , + { , 11 }, , , , + { , 11 }, , , , + { , 9 }, , , + { , 9 }, , , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 61; + row { + top= 1; + keys { , , + { , 9}, , , , , + , , , , , + , , , + , + }; + }; + row { + top= 20; + keys { , , { , 9, shape="TABK" }, + , , , , , + , , , , , + , , + { , "BKSP" } + }; + }; + row { + top= 39; + keys { , , { , 9, shape="LCTL" }, + , , , , , + , , , , , + , + { , "RTRN" } + }; + }; + row { + top= 58; + keys { , , { , 9 , shape="LFSH" }, + , , , , , + , , , , , + { , "RTSH", color="grey20" } + }; + }; + row { + top= 77; + keys { , , { , 9, shape="CAPS" }, + , , + { , "SPCE" }, + , , + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 61; + left= 352; + row { + top= 1; + keys { , , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + top= 58; + left= 20; + keys { }; + }; + row { + top= 77; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 61; + left= 420; + row { + top= 1; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section +}; + +xkb_geometry "t5hobo" { + + // This is an approximate layout for a (US/ASCII) Sun Type5 + // keyboard. I just took a similar layout (101 key PC keyboard) + // and adjusted the sizes. + // + // I modified this to look like the hobo keyboard. + + width= 425; + height= 170; + + shape "EDGE" { cornerRadius= 2, { [ 425, 170 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "FKEY" { { [ 15,18] }, { [0.5,0.5], [14.5, 17.5] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "BKSL" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "RTRN" { { [ 42,18] }, { [2,1], [40,17] } }; + shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "LFSH" { { [ 42,18] }, { [2,1], [40,17] } }; + shape "RTSH" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [156,18] }, { [2,1], [154,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 14; + row.left= 1; + key.shape= "FKEY"; + key.gap= 1; + section "Function" { + top= 24; + row { + top= 1; + keys { { , "HELP" }, { , 9 }, + { , 4 }, , , , + { , 4 }, , , , + { , 4 }, , , , + { , 4 }, , , , + { , 9, "NORM" }, {, "NORM"}, {, "NORM"} + }; + }; + }; // End of "Function" section + + key.shape= "NORM"; + section "Alpha" { + top= 61; + row { + top= 1; + keys { , , + { , 9}, , , , , + , , , , , + , , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { , , { , 9, shape="TABK" }, + , , , , , + , , , , , + , , + { , "BKSL" } + }; + }; + row { + top= 39; + keys { , , { , 9, shape="CAPS" }, + , , , , , + , , , , , + , + { , "RTRN" } + }; + }; + row { + top= 58; + keys { , , { , 9 , shape="LFSH" }, + , , , , , + , , , , , + { , "RTSH", color="grey20" }, + }; + }; + row { + top= 77; + keys { , , { , 9, shape="LCTL" }, + , , + { , "SPCE" }, + , , + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 61; + left= 352; + row { + top= 1; + keys { , , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + + top= 58; + left= 20; + keys { }; + }; + row { + top= 77; + keys { , , }; + }; + }; // End of "Editing" section +}; + +xkb_geometry "t5tuvhobo" { + + // This is an approximate layout for a (US/ASCII) Sun Type5 + // keyboard. I just took a similar layout (101 key PC keyboard) + // and adjusted the sizes. + // + // I modified this to look like the hobo keyboard. + + width= 425; + height= 170; + + shape "EDGE" { cornerRadius= 2, { [ 425, 170 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "FKEY" { { [ 15,18] }, { [0.5,0.5], [14.5, 17.5] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "BKSL" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "RTRN" { { [ 42,18] }, { [2,1], [40,17] } }; + shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "LFSH" { { [ 24,18] }, { [2,1], [22,17] } }; + shape "RTSH" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [156,18] }, { [2,1], [154,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 14; + row.left= 1; + key.shape= "FKEY"; + key.gap= 1; + section "Function" { + top= 24; + row { + top= 1; + keys { { , "HELP" }, { , 9 }, + { , 4 }, , , , + { , 4 }, , , , + { , 4 }, , , , + { , 4 }, , , , + { , 9, "NORM" }, {, "NORM"}, {, "NORM"} + }; + }; + }; // End of "Function" section + + key.shape= "NORM"; + section "Alpha" { + top= 61; + row { + top= 1; + keys { , , + { , 9}, , , , , + , , , , , + , , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { , , { , 9, shape="TABK" }, + , , , , , + , , , , , + , , + { , "BKSL" } + }; + }; + row { + top= 39; + keys { , , { , 9, shape="CAPS" }, + , , , , , + , , , , , + , + { , "RTRN" } + }; + }; + row { + top= 58; + keys { , , { , 9 , shape="LFSH" }, , + , , , , , + , , , , , + { , "RTSH", color="grey20" }, + }; + }; + row { + top= 77; + keys { , , { , 9, shape="LCTL" }, + , , + { , "SPCE" }, + , , + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 61; + left= 352; + row { + top= 1; + keys { , , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + + top= 58; + left= 20; + keys { }; + }; + row { + top= 77; + keys { , , }; + }; + }; // End of "Editing" section +}; + +xkb_geometry "t5jphobo" { + + // This is an approximate layout for a (US/ASCII) Sun Type5 + // keyboard. I just took a similar layout (101 key PC keyboard) + // and adjusted the sizes. + + width= 425; + height= 170; + + shape "EDGE" { cornerRadius= 2, { [ 425, 170 ] } }; + shape.cornerRadius= 1; + shape "FKEY" { { [ 15,18] }, { [0.5,0.5], [14.5, 17.5] } }; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "KANJ" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "EXEC" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "RTRN" { + approx = { [ 0, 0], [28,37] }, + { [ 0, 0], [28, 0], [28,37], + [ 5,37], [ 5,18], [ 0,18] }, + { [ 1, 1], [26, 1], [26,36], + [ 7,36], [ 7,17], [ 1,17] } + }; + shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "LFSH" { { [ 42,18] }, { [2,1], [40,17] } }; + shape "RTSH" { { [ 33,18] }, { [2,1], [31,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [ 97,18] }, { [2,1], [95,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 14; + row.left= 1; + key.shape= "FKEY"; + key.gap= 1; + section "Function" { + top= 24; + row { + top= 1; + keys { { , "HELP" }, { , 9 }, + { , 4 }, , , , + { , 4 }, , , , + { , 4 }, , , , + { , 4 }, , , , + { , 9, "NORM" }, {, "NORM"}, {, "NORM"} + }; + }; + }; // End of "Function" section + + key.shape= "NORM"; + section "Alpha" { + top= 61; + row { + top= 1; + keys { , , + { , 9}, , , , , + , , , , , + , , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { , , { , 9, shape="TABK" }, + , , , , , + , , , , , + , , + { , "RTRN" } + }; + }; + row { + top= 39; + keys { , , { , 9, shape="CAPS" }, + , , , , , + , , , , , + , + }; + }; + row { + top= 58; + keys { , , { , 9 , shape="LFSH" }, + , , , , , + , , , , , , + { , "RTSH", color="grey20" } + }; + }; + row { + top= 77; + keys { , , { , 9 }, + , , { , "EXEC" }, + { , "SPCE" }, { , "KANJ" }, , + , , + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 61; + left= 352; + row { + top= 1; + keys { , , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + top= 58; + left= 20; + keys { }; + }; + row { + top= 77; + keys { , , }; + }; + }; // End of "Editing" section +}; + +xkb_geometry "type5_se" { + + // kbd: type = 4, layout = 43 + + description= "Sun Type5 keyboard (Sweden)"; + + width= 510; + height= 170; + + baseColor= "grey"; + labelColor= "black"; + + shape.cornerRadius= 1; + + shape "EDGE" { cornerRadius= 2, { [ 510, 170 ] } }; + shape "LOGO" { cornerRadius= 2, + { [ 0, 8], [ 8, 16], [ 16, 8], [ 8, 0] } + }; + + shape "NORM" { { [ 18, 18] }, { [ 2, 1], [ 16, 17] } }; + shape "BKSP" { { [ 38, 18] }, { [ 2, 1], [ 36, 17] } }; + shape "TABK" { { [ 27, 18] }, { [ 2, 1], [ 25, 17] } }; + shape "RTRN" { + { [ 0, 0], [ 29, 0], [ 29, 37], [ 5, 37], [ 5, 18], [ 0, 18] }, + { [ 2, 1], [ 27, 1], [ 27, 36], [ 7, 36], [ 7, 17], [ 2, 17] } + }; + shape "CAPS" { { [ 32, 18] }, { [ 2, 1], [ 30, 17 ] } }; + shape "LFSH" { { [ 24, 18] }, { [ 2, 1], [ 22, 17 ] } }; + shape "RTSH" { { [ 51, 18] }, { [ 2, 1], [ 49, 17 ] } }; + shape "LCTL" { { [ 32, 18] }, { [ 2, 1], [ 30, 17 ] } }; + shape "MODK" { { [ 28, 18] }, { [ 2, 1], [ 26, 17 ] } }; + shape "SPCE" { { [157, 18] }, { [ 2, 1], [155, 17 ] } }; + shape "KP0" { { [ 37, 18] }, { [ 2, 1], [ 35, 17 ] } }; + shape "KPAD" { { [ 18, 37] }, { [ 2, 1], [ 16, 36 ] } }; + shape "HELP" { { [ 37, 18] }, { [ 2, 1], [ 35, 17 ] } }; + + section "Function" { + key.color= "grey10"; + priority= 1; + top= 24; + left= 14; + width= 481; + height= 19; + row { + top= 1; + left= 1; + keys { + { , "HELP", 1 }, { , "NORM", 9 }, + { , "NORM", 19 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 11 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 11 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 9 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 11 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1, color= "white" } + }; + }; + }; // End of "Function" section + + section "Alpha" { + key.color= "white"; + priority= 2; + top= 61; + left= 14; + width= 333; + height= 95; + row { + top= 1; + left= 1; + keys { + { , "NORM", 1, color= "grey10" }, + { , "NORM", 1, color= "grey10" }, + { , "NORM", 9 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, + { , "BKSP", 1, color="grey10" } + }; + }; + row { + top= 20; + left= 1; + keys { + { , "NORM", 1, color= "grey10" }, + { , "NORM", 1, color= "grey10" }, + { , "TABK", 9, color= "grey10" }, + { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, + { , "RTRN", 1, color= "grey10" } + }; + }; + row { + top= 39; + left= 1; + keys { + { , "NORM", 1, color= "grey10" }, + { , "NORM", 1, color= "grey10" }, + { , "CAPS", 9, color= "grey10" }, + { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 } + }; + }; + row { + top= 58; + left= 1; + keys { + { , "NORM", 1, color= "grey10" }, + { , "NORM", 1, color= "grey10" }, + { , "LFSH", 9, color= "grey10" }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, + { , "RTSH", 1, color="grey10" } + }; + }; + row { + top= 77; + left= 1; + key.color= "grey10"; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "LCTL", 9 }, { , "NORM", 1 }, + { , "NORM", 1 }, + { , "SPCE", 1, color= "white" }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 } + }; + }; + }; // End of "Alpha" section + + section "Editing" { + key.color= "grey10"; + priority= 3; + top= 61; + left= 352; + width= 58; + height= 95; + row { + top= 1; + left= 1; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 } + }; + }; + row { + top= 20; + left= 1; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 } + }; + }; + row { + top= 58; + left= 20; + keys { + { , "NORM", 1 } + }; + }; + row { + top= 77; + left= 1; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 } + }; + }; + }; // End of "Editing" section + + section "Keypad" { + key.color= "white"; + priority= 4; + top= 61; + left= 420; + width= 77; + height= 95; + row { + top= 1; + left= 1; + key.color= "grey10"; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 } + }; + }; + row { + top= 20; + left= 1; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, + { , "KPAD", 1, color="grey10" } + }; + }; + row { + top= 39; + left= 1; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 } + }; + }; + row { + top= 58; + left= 1; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, + { , "KPAD", 1, color="grey10" } + }; + }; + row { + top= 77; + left= 1; + keys { + { , "KP0", 1 }, { , "NORM", 1 } + }; + }; + }; // End of "Keypad" section + + outline "Edges" { + top= 0; + left= 0; + priority= 0; + shape= "EDGE"; + }; + + solid "Logos" { + color= "blue"; + top= 5; + left= 25; + priority= 0; + shape= "LOGO"; + }; + + logo "SUNLogoImage" { + top= 5; + left= 25; + name= "SUN"; + priority= 1; + shape= "LOGO"; + }; + + shape "LED" { cornerRadius= 1, + { [ 0, 1.5], [ 1.5, 3], [ 3, 1.5], [ 1.5, 0] } + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.shape= "LED"; + indicator "Caps Lock" { left= 75; top= 103; priority= 5; }; + indicator "Compose" { left= 314; top= 142; priority= 5; }; + indicator "Scroll Lock" { left= 378; top= 29; }; + indicator "Num Lock" { left= 426; top= 66; }; +}; + +xkb_geometry "type5c_se" { + + // kbd: type = 4, layout = 43 + + description= "Sun Type5c keyboard (Sweden)"; + + width= 510; + height= 170; + + baseColor= "grey"; + labelColor= "black"; + + shape.cornerRadius= 1; + + shape "EDGE" { cornerRadius= 2, { [ 510, 170 ] } }; + shape "LOGO" { cornerRadius= 2, + { [ 0, 8], [ 8, 16], [ 16, 8], [ 8, 0] } + }; + + shape "NORM" { { [ 18, 18] }, { [ 2, 1], [ 16, 17] } }; + shape "BKSP" { { [ 38, 18] }, { [ 2, 1], [ 36, 17] } }; + shape "TABK" { { [ 27, 18] }, { [ 2, 1], [ 25, 17] } }; + shape "META" { { [ 27, 18] }, { [ 2, 1], [ 25, 17] } }; + shape "RTRN" { + { [ 0, 0], [ 29, 0], [ 29, 37], [ 5, 37], [ 5, 18], [ 0, 18] }, + { [ 2, 1], [ 27, 1], [ 27, 36], [ 7, 36], [ 7, 17], [ 2, 17] } + }; + shape "CAPS" { { [ 32, 18] }, { [ 2, 1], [ 30, 17 ] } }; + shape "LFSH" { { [ 24, 18] }, { [ 2, 1], [ 22, 17 ] } }; + shape "RTSH" { { [ 51, 18] }, { [ 2, 1], [ 49, 17 ] } }; + shape "LCTL" { { [ 32, 18] }, { [ 2, 1], [ 30, 17 ] } }; + shape "MODK" { { [ 28, 18] }, { [ 2, 1], [ 26, 17 ] } }; + shape "SPCE" { { [139, 18] }, { [ 2, 1], [137, 17 ] } }; + shape "KP0" { { [ 37, 18] }, { [ 2, 1], [ 35, 17 ] } }; + shape "KPAD" { { [ 18, 37] }, { [ 2, 1], [ 16, 36 ] } }; + shape "HELP" { { [ 37, 18] }, { [ 2, 1], [ 35, 17 ] } }; + + section "Function" { + key.color= "grey10"; + priority= 1; + top= 24; + left= 14; + width= 481; + height= 19; + row { + top= 1; + left= 1; + keys { + { , "HELP", 1 }, { , "NORM", 9 }, + { , "NORM", 19 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 11 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 11 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 9 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 11 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1, color= "white" } + }; + }; + }; // End of "Function" section + + section "Alpha" { + key.color= "white"; + priority= 2; + top= 61; + left= 14; + width= 333; + height= 95; + row { + top= 1; + left= 1; + keys { + { , "NORM", 1, color= "grey10" }, + { , "NORM", 1, color= "grey10" }, + { , "NORM", 9 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, + { , "BKSP", 1, color="grey10" } + }; + }; + row { + top= 20; + left= 1; + keys { + { , "NORM", 1, color= "grey10" }, + { , "NORM", 1, color= "grey10" }, + { , "TABK", 9, color= "grey10" }, + { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, + { , "RTRN", 1, color= "grey10" } + }; + }; + row { + top= 39; + left= 1; + keys { + { , "NORM", 1, color= "grey10" }, + { , "NORM", 1, color= "grey10" }, + { , "CAPS", 9, color= "grey10" }, + { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 } + }; + }; + row { + top= 58; + left= 1; + keys { + { , "NORM", 1, color= "grey10" }, + { , "NORM", 1, color= "grey10" }, + { , "LFSH", 9, color= "grey10" }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, + { , "RTSH", 1, color="grey10" } + }; + }; + row { + top= 77; + left= 1; + key.color= "grey10"; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "LCTL", 9 }, { , "NORM", 1 }, + { , "META", 1 }, + { , "SPCE", 1, color= "white" }, + { , "META", 1 }, { , "NORM", 1 }, + { , "NORM", 1 } + }; + }; + }; // End of "Alpha" section + + section "Editing" { + key.color= "grey10"; + priority= 3; + top= 61; + left= 352; + width= 58; + height= 95; + row { + top= 1; + left= 1; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 } + }; + }; + row { + top= 20; + left= 1; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 } + }; + }; + row { + top= 58; + left= 20; + keys { + { , "NORM", 1 } + }; + }; + row { + top= 77; + left= 1; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 } + }; + }; + }; // End of "Editing" section + + section "Keypad" { + key.color= "white"; + priority= 4; + top= 61; + left= 420; + width= 77; + height= 95; + row { + top= 1; + left= 1; + key.color= "grey10"; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, { , "NORM", 1 } + }; + }; + row { + top= 20; + left= 1; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, + { , "KPAD", 1, color="grey10" } + }; + }; + row { + top= 39; + left= 1; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 } + }; + }; + row { + top= 58; + left= 1; + keys { + { , "NORM", 1 }, { , "NORM", 1 }, + { , "NORM", 1 }, + { , "KPAD", 1, color="grey10" } + }; + }; + row { + top= 77; + left= 1; + keys { + { , "KP0", 1 }, { , "NORM", 1 } + }; + }; + }; // End of "Keypad" section + + outline "Edges" { + top= 0; + left= 0; + priority= 0; + shape= "EDGE"; + }; + + solid "Logos" { + color= "blue"; + top= 5; + left= 15; + priority= 0; + shape= "LOGO"; + }; + + logo "SUNLogoImage" { + top= 5; + left= 15; + name= "SUN"; + priority= 1; + shape= "LOGO"; + }; + + text.font= "charter"; + text.weight= "medium"; + text.slant= "i"; + text.fontSize= 40; + text "SunLogoText" { + top= 5; + left= 32; + color= "blue"; + text= "Sun"; + }; + + shape "LED" { cornerRadius= 1, + { [ 0, 1.5], [ 1.5, 3], [ 3, 1.5], [ 1.5, 0] } + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.shape= "LED"; + indicator "Caps Lock" { left= 75; top= 103; priority= 5; }; + indicator "Compose" { left= 314; top= 142; priority= 5; }; + indicator "Scroll Lock" { left= 378; top= 29; }; + indicator "Num Lock" { left= 426; top= 66; }; +}; + +xkb_geometry "type4_se" { + + // kbd: type = 4, layout = 11 + + description= "Sun Type4 keyboard (Sweden)"; + + + width= 453; + height= 183; + + baseColor= "grey"; + labelColor= "black"; + + shape "EDGE" { cornerRadius= 2, { [ 452, 185 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "DELE" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "RTRN" { + approx = { [ 0, 0], [28,37] }, + { [ 0, 0], [28, 0], [28,37], + [ 5,37], [ 5,19], [ 0,19] }, + { [ 1, 1], [26, 1], [26,36], + [ 7,36], [ 7,18], [ 1,18] } + }; + shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "LFSH" { { [ 22,18] }, { [2,1], [20,17] } }; + shape "RTSH" { { [ 33,18] }, { [2,1], [31,17] } }; + shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [170,18] }, { [2,1], [168,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 17; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + + section "Alpha" { + top= 58; + row { + top= 1; + key.color= "grey10"; + keys { , , { , 9 }, + , , , + , , , , + , , , , + { , color= "white"}, + { , color= "white"}, + , { , 9 }, + , , + }; + }; + row { + top= 20; + key.color= "white"; + keys { + { , color= "grey10" }, + { , color= "grey10" }, + { , 9, color= "grey10" }, + , , , , , + , , , , , + , , + { , "BKSP", color= "grey10" }, + { , 9, color= "grey10" }, + { , color= "grey10" }, + { , color= "grey10" }, + { , color= "grey10" } + }; + }; + row { + top= 39; + key.color= "white"; + keys { + { , color= "grey10" }, + { , color= "grey10" }, + { , 9, "TABK", color= "grey10" }, + , , , , , + , , , , , + , , + { , "RTRN", color= "grey10" }, + { , 9, color= "grey10" }, + { , color= "grey10" }, + { , color= "grey10" }, + { , "KPAD", color= "grey10" } + }; + }; + row { + top= 58; + key.color= "white"; + keys { + { , color= "grey10" }, + { , color= "grey10" }, + { , 9, "LCTL", color= "grey10" }, + , , , , , + , , , , , + , , + { , 33, color= "grey10" }, + { , color= "grey10" }, + { , color= "grey10" } + }; + }; + row { + top= 77; + key.color= "white"; + keys { + { , color= "grey10" }, + { , color= "grey10" }, + { , 9 , "LFSH", color= "grey10" }, + , , , , + , , , , + , , , + { , "RTSH", color= "grey10" }, + { , color= "grey10" }, + { , 9, color= "grey10" }, + { , color= "grey10" }, + { , color= "grey10" }, + { , "KPAD", color= "grey10" } + }; + }; + row { + top= 96; + key.color= "grey10"; + keys { + { , "HELP" }, { , 9 }, + , , + { , "SPCE", color= "white" }, + , , , + { , 9, "KP0" }, + }; + }; + }; // End of "Alpha" section + + shape "RIDGE" { cornerRadius= 1, { [ 0, 1], [ 1, 0 ], + [330, 0], [331, 1], + [330, 2], [ 1, 2] } }; + solid "Ridge" { + shape= "RIDGE"; + top= 48; + left= 18; + }; + + shape "LEDS" { cornerRadius= 1, { [ 75 ,21 ] } }; + shape "LED" { cornerRadius= 0, { [ 7, 4 ] } }; + outline "LedPanel" { + shape= "LEDS"; + top= 28; + left= 358; + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 43; + indicator.shape= "LED"; + indicator "Caps Lock" { left= 364; }; + indicator "Compose" { left= 383; }; + indicator "Scroll Lock" { left= 402; }; + indicator "Num Lock" { left= 421; }; + text.top= 32; + text.color= "black"; + text "CapsLockLabel" { left= 364; text="Caps\nLock"; }; + text "ComposeLabel" { left= 380; text="\nCompose"; }; + text "ScrollLockLabel" { left= 402; text="Scroll\nLock"; }; + text "NumLockLabel" { left= 421; text="Num\nLock"; }; +}; + +xkb_geometry "t6" { + + // This is an approximate layout for a (US/ASCII) Sun Type6 + // keyboard. I just took a similar layout (101 key PC keyboard) + // and adjusted the sizes. + + width= 515; + height= 170; + + shape "EDGE" { cornerRadius= 2, { [ 515, 170 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "BKSL" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "RTRN" { { [ 42,18] }, { [2,1], [40,17] } }; + shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "LFSH" { { [ 42,18] }, { [2,1], [40,17] } }; + shape "RTSH" { { [ 51,18] }, { [2,1], [49,17] } }; + shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [136,18] }, { [2,1], [134,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "RMTA" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "LMTA" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 14; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 24; + row { + top= 1; + keys { { , "HELP" }, { , 9 }, + { , 19 }, , , , + { , 11 }, , , , + { , 11 }, , , , + { , 9 }, , , + { , 9 }, , , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 61; + row { + top= 1; + keys { , , + { , 9}, , , , , + , , , , , + , , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { , , { , 9, shape="TABK" }, + , , , , , + , , , , , + , , + { , "BKSL" } + }; + }; + row { + top= 39; + keys { , , { , 9, shape="CAPS" }, + , , , , , + , , , , , + , + { , "RTRN" } + }; + }; + row { + top= 58; + keys { , , { , 9 , shape="LFSH" }, + , , , , , + , , , , , + { , "RTSH", color="grey20" } + }; + }; + row { + top= 77; + keys { , , { , 9, shape="LCTL" }, + , { , "LMTA" }, + { , "SPCE" }, + { , "RMTA" }, , + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 61; + left= 352; + row { + top= 1; + keys { , , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + top= 58; + left= 20; + keys { }; + }; + row { + top= 77; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 61; + left= 420; + row { + top= 1; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + + shape "LEDS" { cornerRadius= 0, { [ 78 ,21 ] } }; + shape "LED" { cornerRadius= 2, { [ 3, 6 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 1; + left= 218; + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 10; + indicator.shape= "LED"; + indicator "CapsLock" { left= 243; }; + indicator "Compose" { left= 281; }; + indicator "ScrollLock" { left= 262; }; + indicator "NumLock" { left= 224; }; + text.top= 1; + text.color= "black"; + text "CapsLockLabel" { left= 243; text="Caps\nLock"; }; + text "ComposeLabel" { left= 281; text="Compose"; }; + text "ScrollLockLabel" { left= 262; text="Scroll\nLock"; }; + text "NumLockLabel" { left= 224; text="Num\nLock"; }; + + +}; + +xkb_geometry "t6tuv" { + + // This is an approximate layout for a (US/ASCII) Sun Type6 + // keyboard. I just took a similar layout (101 key PC keyboard) + // and adjusted the sizes. + + width= 515; + height= 170; + + shape "EDGE" { cornerRadius= 2, { [ 515, 170 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "RTRN" { + approx = { [ 0, 0], [28,37] }, + { [ 0, 0], [28, 0], [28,37], + [ 5,37], [ 5,18], [ 0,18] }, + { [ 1, 1], [26, 1], [26,36], + [ 7,36], [ 7,17], [ 1,17] } + }; + shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "LFSH" { { [ 24,18] }, { [2,1], [22,17] } }; + shape "RTSH" { { [ 51,18] }, { [2,1], [49,17] } }; + shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [137,18] }, { [2,1], [135,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "RMTA" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "LMTA" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 14; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 24; + row { + top= 1; + keys { { , "HELP" }, { , 9 }, + { , 19 }, , , , + { , 11 }, , , , + { , 11 }, , , , + { , 9 }, , , + { , 9 }, , , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 61; + row { + top= 1; + keys { , , + { , 9}, , , , , + , , , , , + , , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { , , { , 9, shape="TABK" }, + , , , , , + , , , , , + , , + { , "RTRN" } + }; + }; + row { + top= 39; + keys { , , { , 9, shape="CAPS" }, + , , , , , + , , , , , + , + }; + }; + row { + top= 58; + keys { , , { , 9 , shape="LFSH" }, , + , , , , , + , , , , , + { , "RTSH", color="grey20" } + }; + }; + row { + top= 77; + keys { , , { , 9, shape="LCTL" }, + , { , "LMTA" }, + { , "SPCE" }, + { , "RMTA" }, , + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 61; + left= 352; + row { + top= 1; + keys { , , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + top= 58; + left= 20; + keys { }; + }; + row { + top= 77; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 61; + left= 420; + row { + top= 1; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + + shape "LEDS" { cornerRadius= 0, { [ 78 ,21 ] } }; + shape "LED" { cornerRadius= 2, { [ 3, 6 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 1; + left= 218; + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 10; + indicator.shape= "LED"; + indicator "CapsLock" { left= 243; }; + indicator "Compose" { left= 281; }; + indicator "ScrollLock" { left= 262; }; + indicator "NumLock" { left= 224; }; + text.top= 1; + text.color= "black"; + text "CapsLockLabel" { left= 243; text="Caps\nLock"; }; + text "ComposeLabel" { left= 281; text="Compose"; }; + text "ScrollLockLabel" { left= 262; text="Scroll\nLock"; }; + text "NumLockLabel" { left= 224; text="Num\nLock"; }; + +}; + +xkb_geometry "t6jp" { + + // This is an approximate layout for a (US/ASCII) Sun Type6 + // keyboard. I just took a similar layout (101 key PC keyboard) + // and adjusted the sizes. + + width= 515; + height= 170; + + shape "EDGE" { cornerRadius= 2, { [ 515, 170 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "KANJ" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "EXEC" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "RTRN" { + approx = { [ 0, 0], [28,37] }, + { [ 0, 0], [28, 0], [28,37], + [ 5,37], [ 5,18], [ 0,18] }, + { [ 1, 1], [26, 1], [26,36], + [ 7,36], [ 7,17], [ 1,17] } + }; + shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "LFSH" { { [ 42,18] }, { [2,1], [40,17] } }; + shape "RTSH" { { [ 33,18] }, { [2,1], [31,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [ 96,18] }, { [2,1], [94,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 14; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 24; + row { + top= 1; + keys { { , "HELP" }, { , 9 }, + { , 19 }, , , , + { , 11 }, , , , + { , 11 }, , , , + { , 9 }, , , + { , 9 }, , , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 61; + row { + top= 1; + keys { , , + { , 9}, , , , , + , , , , , + , , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 20; + keys { , , { , 9, shape="TABK" }, + , , , , , + , , , , , + , , + { , "RTRN" } + }; + }; + row { + top= 39; + keys { , , { , 9, shape="CAPS" }, + , , , , , + , , , , , + , + }; + }; + row { + top= 58; + keys { , , { , 9 , shape="LFSH" }, + , , , , , + , , , , , , + { , "RTSH", color="grey20" } + }; + }; + row { + top= 77; + keys { , , { , 9 }, + , , { , "EXEC" }, + { , "SPCE" }, { , "KANJ" }, , + , , + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 61; + left= 352; + row { + top= 1; + keys { , , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + top= 58; + left= 20; + keys { }; + }; + row { + top= 77; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 61; + left= 420; + row { + top= 1; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + + shape "LEDS" { cornerRadius= 0, { [ 78 ,21 ] } }; + shape "LED" { cornerRadius= 2, { [ 3, 6 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 1; + left= 218; + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 10; + indicator.shape= "LED"; + indicator "CapsLock" { left= 243; }; + indicator "Compose" { left= 281; }; + indicator "ScrollLock" { left= 262; }; + indicator "NumLock" { left= 224; }; + text.top= 1; + text.color= "black"; + text "CapsLockLabel" { left= 243; text="Caps\nLock"; }; + text "ComposeLabel" { left= 281; text="Compose"; }; + text "ScrollLockLabel" { left= 262; text="Scroll\nLock"; }; + text "NumLockLabel" { left= 224; text="Num\nLock"; }; + +}; + +xkb_geometry "t6unix" { + + // This is an approximate layout for a (US/ASCII) Sun Type6 + // keyboard. I just took a similar layout (101 key PC keyboard) + // and adjusted the sizes. + + width= 515; + height= 170; + + shape "EDGE" { cornerRadius= 2, { [ 515, 170 ] } }; + shape.cornerRadius= 1; + shape "NORM" { { [ 18,18] }, { [2,1], [16,17] } }; + shape "BKSP" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "TABK" { { [ 27,18] }, { [2,1], [25,17] } }; + shape "RTRN" { { [ 42,18] }, { [2,1], [40,17] } }; + shape "CAPS" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "LFSH" { { [ 42,18] }, { [2,1], [40,17] } }; + shape "RTSH" { { [ 51,18] }, { [2,1], [49,17] } }; + shape "LCTL" { { [ 32,18] }, { [2,1], [30,17] } }; + shape "MODK" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "SPCE" { { [136,18] }, { [2,1], [134,17] } }; + shape "KP0" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "KPAD" { { [ 18,37] }, { [2,1], [16,36] } }; + shape "HELP" { { [ 37,18] }, { [2,1], [35,17] } }; + shape "RMTA" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "LMTA" { { [ 28,18] }, { [2,1], [26,17] } }; + shape "LOGO" { { [ 16,16] } }; + + outline "Edges" { + top= 0; + left= 0; + shape= "EDGE"; + }; + + section.left= 14; + row.left= 1; + key.shape= "NORM"; + key.gap= 1; + section "Function" { + top= 24; + row { + top= 1; + keys { { , "HELP" }, { , 9 }, + { , 19 }, , , , + { , 11 }, , , , + { , 11 }, , , , + { , 9 }, , , + { , 9 }, , , + }; + }; + }; // End of "Function" section + + section "Alpha" { + top= 61; + row { + top= 1; + keys { , , + { , 9}, , , , , + , , , , , + , , , + , + }; + }; + row { + top= 20; + keys { , , { , 9, shape="TABK" }, + , , , , , + , , , , , + , , + { , "BKSP", color="grey20" } + }; + }; + row { + top= 39; + keys { , , { , 9, shape="CAPS" }, + , , , , , + , , , , , + , + { , "RTRN" } + }; + }; + row { + top= 58; + keys { , , { , 9 , shape="LFSH" }, + , , , , , + , , , , , + { , "RTSH", color="grey20" } + }; + }; + row { + top= 77; + keys { , , { , 9, shape="LCTL" }, + , {, "LMTA"}, + { , "SPCE" }, + {, "RMTA"}, , + }; + }; + }; // End of "Alpha" section + + section "Editing" { + top= 61; + left= 352; + row { + top= 1; + keys { , , }; + }; + row { + top= 20; + keys { , , }; + }; + row { + top= 58; + left= 20; + keys { }; + }; + row { + top= 77; + keys { , , }; + }; + }; // End of "Editing" section + + section "Keypad" { + top= 61; + left= 420; + row { + top= 1; + keys { , , , }; + }; + row { + top= 20; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 39; + keys { , , }; + }; + row { + top= 58; + keys { , , , { , "KPAD", color= "grey20" } }; + }; + row { + top= 77; + keys { { , "KP0" }, }; + }; + }; // End of "Keypad" section + + shape "LEDS" { cornerRadius= 0, { [ 78 ,21 ] } }; + shape "LED" { cornerRadius= 2, { [ 3, 6 ] } }; + solid "LedPanel" { + shape= "LEDS"; + top= 1; + left= 218; + }; + indicator.onColor= "green"; + indicator.offColor= "green30"; + indicator.top= 10; + indicator.shape= "LED"; + indicator "CapsLock" { left= 243; }; + indicator "Compose" { left= 281; }; + indicator "ScrollLock" { left= 262; }; + indicator "NumLock" { left= 224; }; + text.top= 1; + text.color= "black"; + text "CapsLockLabel" { left= 243; text="Caps\nLock"; }; + text "ComposeLabel" { left= 281; text="Compose"; }; + text "ScrollLockLabel" { left= 262; text="Scroll\nLock"; }; + text "NumLockLabel" { left= 224; text="Num\nLock"; }; +}; + +xkb_geometry "type5" { + include "sun(t5)" + description= "Sun Type5 keyboard"; +}; + +xkb_geometry "type5jp" { + include "sun(t5jp)" + description= "Sun Type5 Japanese keyboard"; +}; + +xkb_geometry "type5tuv" { + include "sun(t5tuv)" + description= "Sun Type5 keyboard"; +}; + +xkb_geometry "type5euro" { + include "sun(t5tuv)" + description= "Sun Type5 keyboard"; +}; + +xkb_geometry "type5unix" { + include "sun(t5unix)" + description= "Sun Type5 Unix keyboard"; +}; + +xkb_geometry "type5hobo" { + include "sun(t5hobo)" + description= "Sun Type5 Hobo keyboard"; +}; + +xkb_geometry "type5tuvhobo" { + include "sun(t5tuvhobo)" + description= "Sun Type5 Hobo keyboard"; +}; + +xkb_geometry "type5jphobo" { + include "sun(t5jphobo)" + description= "Sun Type5 Japanese Hobo keyboard"; +}; + +default xkb_geometry "type6" { + include "sun(t6)" + description= "Sun Type6 keyboard (US, Korea, Taiwan)"; +}; + +xkb_geometry "type6jp" { + include "sun(t6jp)" + description= "Sun Type6 Japanese keyboard"; +}; + +xkb_geometry "type6tuv" { + include "sun(t6tuv)" + description= "Sun Type6 TUV keyboard"; +}; + +xkb_geometry "type6unix" { + include "sun(t6unix)" + description= "Sun Type6 Unix keyboard"; +}; + +xkb_geometry "x86" { + include "pc(pc101)" + description= "x86 Style Keyboard"; +}; + +xkb_geometry "MS_x86" { + include "pc(pc104)" + description= "x86 104 Key Keyboard"; +}; + +xkb_geometry "x86tuv" { + include "pc(pc102)" + description= "x86 European Style Keyboard"; +}; diff --git a/xorg-server/xkeyboard-config/geometry/thinkpad b/xorg-server/xkeyboard-config/geometry/thinkpad index 031586662..fb1118040 100644 --- a/xorg-server/xkeyboard-config/geometry/thinkpad +++ b/xorg-server/xkeyboard-config/geometry/thinkpad @@ -1,471 +1,470 @@ -// -*- indent-tabs-mode: nil -*- -// $XFree86: xc/programs/xkbcomp/geometry/ibm/thinkpad,v 1.3 2003/08/09 14:30:48 pascal Exp $ - -// Created by Alexander Pohoyda -// Geometry specification for IBM ThinkPad keyboard. -// Compatible Models: THINKPAD 560Z 2640-90U, THINKPAD 560Z 2640-91U, -// THINKPAD 560Z 2640-B0U, THINKPAD 560Z 2640-B1U, THINKPAD 560Z 2640-RR3, -// THINKPAD 600 2645-31U, THINKPAD 600 2645-35U, THINKPAD 600 2645-41U, -// THINKPAD 600 2645-42U, THINKPAD 600 2645-45U, THINKPAD 600 2645-48U, -// THINKPAD 600 2645-51U, THINKPAD 600 2645-85U, THINKPAD 600 2645-A1U, -// THINKPAD 600 2645-RR1, THINKPAD 600 2645-RR2, THINKPAD 600E 2645-3AU, -// THINKPAD 600E 2645-4AU, THINKPAD 600E 2645-4BU, THINKPAD 600E 2645-55U, -// THINKPAD 600E 2645-5AU, THINKPAD 600E 2645-5BU, THINKPAD 600E 2645-5JU, -// THINKPAD 600E 2645-8AO, THINKPAD 600E 2645-8AU, THINKPAD 600E 2645-8BU, -// THINKPAD 600E 2645-AAU, THINKPAD 600E 2645-RRB, THINKPAD 600E 2645-RRD, -// THINKPAD 600E 2645-RRF, THINKPAD 600E 2645-RRS, THINKPAD A22E 2645-45U - -xkb_geometry "common" { - width = 290; - height = 150; - baseColor = "grey80"; - labelColor = "white"; - - shape "FN0" { cornerRadius = 1, { [17, 12] }, { [2, 0], [15, 10] } }; - shape "NORM" { cornerRadius = 1, { [18, 18] }, { [2.5, 0], [15.5, 14] } }; - shape "BKSP" { cornerRadius = 1, { [37, 18] }, { [2.5, 0], [34.5, 14] } }; - shape "TABK" { cornerRadius = 1, { [27, 18] }, { [2.5, 0], [24.5, 14] } }; - shape "CAPS" { cornerRadius = 1, { [31, 18] }, { [1, 0], [30, 16] }, - { [1, 0], [26, 16] }, - { [2.5, 0], [24.5, 14] } }; - shape "RTSH" { cornerRadius = 1, { [50, 18] }, { [2.5, 0], [46.5, 14] } }; - shape "MODK" { cornerRadius = 1, { [27.5, 18] }, { [2.5, 0], [25, 14] } }; - shape "SPCE" { cornerRadius = 1, { [100, 18] }, { [2.5, 0], [97.5, 14] } }; - shape "ARRS" { cornerRadius = 1, { [16, 13] }, { [1.5, 0], [14.5, 11] } }; - - shape "LED" { cornerRadius = 2, { [3, 3] } }; - - shape "KEYS" { cornerRadius = 2, - { [0, 0], [19, 0], [19, 13], [172, 13], - [172, 0], [286, 0], [286, 138], [216, 138], - [216, 124], [0, 124] } }; - - solid "KeyPanel" { - shape = "KEYS"; - left = 2; - top = 5; - color = "black"; - }; - - shape "NULL1" { cornerRadius = 1, - { [0, 0], [50, 0], [50, 18], [34, 18], [34, 4], - [16, 4], [16, 18], [0, 18] } }; - - solid "NullPanel1" { - shape = "NULL1"; - left = 237; - top = 110; - color = "grey80"; - }; - - shape "NULL2" { cornerRadius = 1, { [17, 13] } }; - - solid "NullPanel2" { - shape = "NULL2"; - left = 219; - top = 129; - color = "grey80"; - }; - - shape "NULL3" { cornerRadius = 1, - { [0, 26], - [72, 26], [72, 13], [76, 13], [76, 26], - [149, 26], [149, 13], [153, 13], [153, 26], - [226, 26], [226, 0], [230, 0], [230, 26], - [284, 26], [285, 27], - [0, 27] } }; - - solid "NullPanel3" { - shape = "NULL3"; - left = 3; - top = 6; - color = "grey80"; - }; - - indicator.onColor = "green"; - indicator.offColor = "grey10"; - indicator.top = 4; - indicator.shape = "LED"; - indicator "HDDActivity" { onColor = "red"; left = 100; }; - indicator "Num Lock" { left = 108; }; - indicator "Caps Lock" { left = 114; }; - indicator "Scroll Lock" { left = 120; }; - indicator "Power" { left = 128; }; - - key.gap = 1; - key.color = "grey60"; - - section "Function" { - left = 2; - top = 5; - key.shape = "FN0"; - row { - top = 1; - keys { , { , 155 }, , }; - }; - row { - top = 14; - keys { , , , , - { , 6 }, , , , - { , 6 }, , , - }; - }; - }; // End of "Function" section - - section "Control" { - left= 2; - top = 109; - key.shape = "MODK"; - row { - top = 1; - keys { { , "NORM" }, , , - { , "SPCE" }, , - }; - }; - }; // End of "Control" section - - section "Editing" { - top = 5; - left = 233; - key.shape = "FN0"; - row { - top = 1; - keys { , , }; - }; - row { - top = 14; - keys { , , }; - }; - }; // End of "Editing" section - - section "Navigation" { - top = 114; - left = 236; - key.shape = "ARRS"; - row { - top = 1; - left = 17; - keys { }; - }; - row { - top = 15; - keys { , , }; - }; - }; // End of "Navigation" section - - shape "STIK" { cornerRadius = 4, { [7, 7] } }; - - solid "STIK" { - priority = 255; - color = "red"; - shape = "STIK"; - top = 85; - left = 126; - }; -}; - -// 85 keys -// US/English (FRU 02K4785). -xkb_geometry "us" { - include "thinkpad(common)" - description = "IBM ThinkPad 560Z/600/600E/A22E, US"; - - shape "RTRN" { cornerRadius = 1, { [43, 18] }, { [2.5, 0], [40.5, 14] } }; - shape "LFSH" { cornerRadius = 1, { [43, 18] }, { [2.5, 0], [40.5, 14] } }; - shape "BKSL" { cornerRadius = 1, { [28, 18] }, { [2.5, 0], [25.5, 14] } }; - - section "Alpha" { - left = 2; - top = 33; - key.gap = 1; - key.color = "grey60"; - key.shape = "NORM"; - row { - top = 1; - keys { , , , , , - , , , , , - , , , { , "BKSP" } - }; - }; - row { - top = 20; - keys { { , "TABK" }, - , , , , , - , , , , , - , , { , "BKSL" } - }; - }; - row { - top = 39; - keys { { , "CAPS" }, - , , , , , - , , , , , - , { , "RTRN" } - }; - }; - row { - top = 58; - keys { { , "LFSH" }, - , , , , , - , , , , , - { , "RTSH" } - }; - }; - }; // End of "Alpha" section -}; - -// 86 keys -// Tested on: DE/German, UK/English (FRU 02K4787). -xkb_geometry "intl" { - include "thinkpad(common)" - description = "IBM ThinkPad 560Z/600/600E/A22E, Intl"; - - shape "RTRN" { cornerRadius = 1, { [28, 0], [28, 37], [4, 37], [4, 18], - [0, 18], [0, 0] }, - { [25.5, 0], [25.5, 33], [6.5, 33], - [6.5, 14], [2.5, 14], [2.5, 0] } }; - shape "LFSH" { cornerRadius = 1, { [24, 18] }, { [2.5, 0], [21.5, 14] } }; - - section "Alpha" { - left = 2; - top = 33; - key.gap = 1; - key.color = "grey60"; - key.shape = "NORM"; - row { - top = 1; - keys { , , , , , - , , , , , - , , , { , "BKSP" } - }; - }; - row { - top = 20; - keys { { , "TABK" }, - , , , , , - , , , , , - , , { , "RTRN" } - }; - }; - row { - top = 39; - keys { { , "CAPS" }, - , , , , , - , , , , , - , - }; - }; - row { - top = 58; - keys { { , "LFSH" }, , - , , , , , - , , , , , - { , "RTSH" } - }; - }; - }; // End of "Alpha" section -}; - -xkb_geometry "60" { - width = 290; - height = 140; - baseColor = "grey80"; - labelColor = "white"; - - shape "NORM" { cornerRadius = 1, { [18, 18] }, { [2, 0], [16, 16] } }; - - shape "ESC" { cornerRadius = 1, { [17, 13] }, { [1.5, 0], [15.5, 12] } }; - shape "FN0" { cornerRadius = 1, { [17, 11] }, { [1.5, 0], [15.5, 10] } }; - - shape "BKSP" { cornerRadius = 1, { [37, 18] }, { [2, 0], [35, 16] } }; - - shape "TABK" { cornerRadius = 1, { [27.5, 18] }, { [2, 0], [25.5, 16] } }; - shape "BKSL" { cornerRadius = 1, { [27.5, 18] }, { [2, 0], [25.5, 16] } }; - - shape "CAPS" { cornerRadius = 1, { [30.5, 18] }, { [2, 0], [28.5, 16] } }; - shape "RTRN" { cornerRadius = 1, { [43.5, 18] }, { [2, 0], [41.5, 16] } }; - - shape "LFSH" { cornerRadius = 1, { [40, 18] }, { [2, 0], [38, 16] } }; - shape "RTSH" { cornerRadius = 1, { [53, 18] }, { [2, 0], [51, 16] } }; - - shape "LCTL" { cornerRadius = 1, { [21, 18] }, { [2, 0], [19, 16] } }; - shape "LWIN" { cornerRadius = 1, { [15, 18] }, { [1.5, 0], [13.5, 16] } }; - - shape "SPCE" { cornerRadius = 1, { [97, 18] }, { [2, 0], [95, 16] } }; - - shape "ARR1" { cornerRadius = 1, { [17, 13] }, { [1.5, 0], [15.5, 12] } }; - shape "ARR2" { cornerRadius = 1, { [17, 11] }, { [1.5, 0], [15.5, 10] } }; - - shape "VOL" { cornerRadius = 2.5, { [5, 5] } }; - shape "TVTG" { cornerRadius = 0.5, { [0, 1], [17, 1], [17, 4], [0, 4] } }; - - shape "KEYS" { cornerRadius = 2, - { [0, 0], [19, 0], [19, 16], [172, 16], - [172, 4], [286, 4], [286, 133], [231, 133], - [231, 126], [0, 126] } }; - - solid "KeyPanel" { - shape = "KEYS"; - left = 2; - top = 3; - color = "black"; - }; - - shape "NULL0" { cornerRadius = 0.5, - { [0, 26], - [72, 26], [72, 14], [76, 14], [76, 26], - [149, 26], [149, 14], [153, 14], [153, 26], - [226, 26], [226, 2], [230, 2], [230, 26], - [284, 26], [284, 27], - [0, 27] } }; - - solid "NullPanel0" { - shape = "NULL0"; - left = 3; - top = 6; - color = "grey80"; - }; - - shape "NULL1" { cornerRadius = 0.5, { [0, 12], [17, 12], [17, 13], [0, 13] } }; - - solid "NullPanel1" { - shape = "NULL1"; - left = 3; - top = 6; - color = "grey80"; - }; - - shape "MEDIA" { cornerRadius = 0.5, { [0, 0], [55, 0], [55, 10], [0, 10] } }; - - solid "MediaPanel" { - shape = "MEDIA"; - left = 25.5; - top = 6; - color = "black"; - }; - - section "Volume" { - left = 22; - top = 8.5; - key.shape = "VOL"; - key.gap = 6; - key.color = "grey20"; - - row { - keys { , , , {, "TVTG", color = "blue"} }; - }; - }; - - key.gap = 1; - key.color = "grey60"; - - section "Function" { - left = 2; - top = 3; - key.shape = "FN0"; - row { - key.shape = "ESC"; - top = 1; - keys { }; - }; - row { - top = 5; - keys { { , 173 }, , }; - }; - row { - top = 17; - keys { , , , , - { , 6 }, , , , - { , 6 }, , , - }; - }; - }; // End of "Function" section - - section "Control" { - left = 2; - top = 109; - key.shape = "NORM"; - row { - top = 1; - keys { , { , "LCTL" }, { , "LWIN" }, , - { , "SPCE" }, , , - }; - }; - }; // End of "Control" section - - section "Editing" { - top = 7; - left = 233; - key.shape = "FN0"; - row { - top = 1; - keys { , , }; - }; - row { - top = 13; - keys { , , }; - }; - }; // End of "Editing" section - - section "Navigation" { - top = 109; - left = 233; - row { - key.shape = "ARR1"; - top = 1; - keys { , , }; - }; - row { - key.shape = "ARR2"; - top = 15; - keys { , , }; - }; - }; // End of "Navigation" section - - shape "STIK" { cornerRadius = 3.5, { [7, 7] } }; - - solid "STIK" { - priority = 255; - color = "red"; - shape = "STIK"; - top = 85.5; - left = 125.5; - }; - - section "Alpha" { - left = 2; - top = 33; - key.shape = "NORM"; - row { - top = 1; - keys { , , , , , - , , , , , - , , , { , "BKSP" } - }; - }; - row { - top = 20; - keys { { , "TABK" }, - , , , , , - , , , , , - , , { , "BKSL" } - }; - }; - row { - top = 39; - keys { { , "CAPS" }, - , , , , , - , , , , , - , { , "RTRN", color = "blue" } - }; - }; - row { - top = 58; - keys { { , "LFSH" }, - , , , , , - , , , , , - { , "RTSH" } - }; - }; - }; // End of "Alpha" section -}; +// -*- indent-tabs-mode: nil -*- + +// Created by Alexander Pohoyda +// Geometry specification for IBM ThinkPad keyboard. +// Compatible Models: THINKPAD 560Z 2640-90U, THINKPAD 560Z 2640-91U, +// THINKPAD 560Z 2640-B0U, THINKPAD 560Z 2640-B1U, THINKPAD 560Z 2640-RR3, +// THINKPAD 600 2645-31U, THINKPAD 600 2645-35U, THINKPAD 600 2645-41U, +// THINKPAD 600 2645-42U, THINKPAD 600 2645-45U, THINKPAD 600 2645-48U, +// THINKPAD 600 2645-51U, THINKPAD 600 2645-85U, THINKPAD 600 2645-A1U, +// THINKPAD 600 2645-RR1, THINKPAD 600 2645-RR2, THINKPAD 600E 2645-3AU, +// THINKPAD 600E 2645-4AU, THINKPAD 600E 2645-4BU, THINKPAD 600E 2645-55U, +// THINKPAD 600E 2645-5AU, THINKPAD 600E 2645-5BU, THINKPAD 600E 2645-5JU, +// THINKPAD 600E 2645-8AO, THINKPAD 600E 2645-8AU, THINKPAD 600E 2645-8BU, +// THINKPAD 600E 2645-AAU, THINKPAD 600E 2645-RRB, THINKPAD 600E 2645-RRD, +// THINKPAD 600E 2645-RRF, THINKPAD 600E 2645-RRS, THINKPAD A22E 2645-45U + +xkb_geometry "common" { + width = 290; + height = 150; + baseColor = "grey80"; + labelColor = "white"; + + shape "FN0" { cornerRadius = 1, { [17, 12] }, { [2, 0], [15, 10] } }; + shape "NORM" { cornerRadius = 1, { [18, 18] }, { [2.5, 0], [15.5, 14] } }; + shape "BKSP" { cornerRadius = 1, { [37, 18] }, { [2.5, 0], [34.5, 14] } }; + shape "TABK" { cornerRadius = 1, { [27, 18] }, { [2.5, 0], [24.5, 14] } }; + shape "CAPS" { cornerRadius = 1, { [31, 18] }, { [1, 0], [30, 16] }, + { [1, 0], [26, 16] }, + { [2.5, 0], [24.5, 14] } }; + shape "RTSH" { cornerRadius = 1, { [50, 18] }, { [2.5, 0], [46.5, 14] } }; + shape "MODK" { cornerRadius = 1, { [27.5, 18] }, { [2.5, 0], [25, 14] } }; + shape "SPCE" { cornerRadius = 1, { [100, 18] }, { [2.5, 0], [97.5, 14] } }; + shape "ARRS" { cornerRadius = 1, { [16, 13] }, { [1.5, 0], [14.5, 11] } }; + + shape "LED" { cornerRadius = 2, { [3, 3] } }; + + shape "KEYS" { cornerRadius = 2, + { [0, 0], [19, 0], [19, 13], [172, 13], + [172, 0], [286, 0], [286, 138], [216, 138], + [216, 124], [0, 124] } }; + + solid "KeyPanel" { + shape = "KEYS"; + left = 2; + top = 5; + color = "black"; + }; + + shape "NULL1" { cornerRadius = 1, + { [0, 0], [50, 0], [50, 18], [34, 18], [34, 4], + [16, 4], [16, 18], [0, 18] } }; + + solid "NullPanel1" { + shape = "NULL1"; + left = 237; + top = 110; + color = "grey80"; + }; + + shape "NULL2" { cornerRadius = 1, { [17, 13] } }; + + solid "NullPanel2" { + shape = "NULL2"; + left = 219; + top = 129; + color = "grey80"; + }; + + shape "NULL3" { cornerRadius = 1, + { [0, 26], + [72, 26], [72, 13], [76, 13], [76, 26], + [149, 26], [149, 13], [153, 13], [153, 26], + [226, 26], [226, 0], [230, 0], [230, 26], + [284, 26], [285, 27], + [0, 27] } }; + + solid "NullPanel3" { + shape = "NULL3"; + left = 3; + top = 6; + color = "grey80"; + }; + + indicator.onColor = "green"; + indicator.offColor = "grey10"; + indicator.top = 4; + indicator.shape = "LED"; + indicator "HDDActivity" { onColor = "red"; left = 100; }; + indicator "Num Lock" { left = 108; }; + indicator "Caps Lock" { left = 114; }; + indicator "Scroll Lock" { left = 120; }; + indicator "Power" { left = 128; }; + + key.gap = 1; + key.color = "grey60"; + + section "Function" { + left = 2; + top = 5; + key.shape = "FN0"; + row { + top = 1; + keys { , { , 155 }, , }; + }; + row { + top = 14; + keys { , , , , + { , 6 }, , , , + { , 6 }, , , + }; + }; + }; // End of "Function" section + + section "Control" { + left= 2; + top = 109; + key.shape = "MODK"; + row { + top = 1; + keys { { , "NORM" }, , , + { , "SPCE" }, , + }; + }; + }; // End of "Control" section + + section "Editing" { + top = 5; + left = 233; + key.shape = "FN0"; + row { + top = 1; + keys { , , }; + }; + row { + top = 14; + keys { , , }; + }; + }; // End of "Editing" section + + section "Navigation" { + top = 114; + left = 236; + key.shape = "ARRS"; + row { + top = 1; + left = 17; + keys { }; + }; + row { + top = 15; + keys { , , }; + }; + }; // End of "Navigation" section + + shape "STIK" { cornerRadius = 4, { [7, 7] } }; + + solid "STIK" { + priority = 255; + color = "red"; + shape = "STIK"; + top = 85; + left = 126; + }; +}; + +// 85 keys +// US/English (FRU 02K4785). +xkb_geometry "us" { + include "thinkpad(common)" + description = "IBM ThinkPad 560Z/600/600E/A22E, US"; + + shape "RTRN" { cornerRadius = 1, { [43, 18] }, { [2.5, 0], [40.5, 14] } }; + shape "LFSH" { cornerRadius = 1, { [43, 18] }, { [2.5, 0], [40.5, 14] } }; + shape "BKSL" { cornerRadius = 1, { [28, 18] }, { [2.5, 0], [25.5, 14] } }; + + section "Alpha" { + left = 2; + top = 33; + key.gap = 1; + key.color = "grey60"; + key.shape = "NORM"; + row { + top = 1; + keys { , , , , , + , , , , , + , , , { , "BKSP" } + }; + }; + row { + top = 20; + keys { { , "TABK" }, + , , , , , + , , , , , + , , { , "BKSL" } + }; + }; + row { + top = 39; + keys { { , "CAPS" }, + , , , , , + , , , , , + , { , "RTRN" } + }; + }; + row { + top = 58; + keys { { , "LFSH" }, + , , , , , + , , , , , + { , "RTSH" } + }; + }; + }; // End of "Alpha" section +}; + +// 86 keys +// Tested on: DE/German, UK/English (FRU 02K4787). +xkb_geometry "intl" { + include "thinkpad(common)" + description = "IBM ThinkPad 560Z/600/600E/A22E, Intl"; + + shape "RTRN" { cornerRadius = 1, { [28, 0], [28, 37], [4, 37], [4, 18], + [0, 18], [0, 0] }, + { [25.5, 0], [25.5, 33], [6.5, 33], + [6.5, 14], [2.5, 14], [2.5, 0] } }; + shape "LFSH" { cornerRadius = 1, { [24, 18] }, { [2.5, 0], [21.5, 14] } }; + + section "Alpha" { + left = 2; + top = 33; + key.gap = 1; + key.color = "grey60"; + key.shape = "NORM"; + row { + top = 1; + keys { , , , , , + , , , , , + , , , { , "BKSP" } + }; + }; + row { + top = 20; + keys { { , "TABK" }, + , , , , , + , , , , , + , , { , "RTRN" } + }; + }; + row { + top = 39; + keys { { , "CAPS" }, + , , , , , + , , , , , + , + }; + }; + row { + top = 58; + keys { { , "LFSH" }, , + , , , , , + , , , , , + { , "RTSH" } + }; + }; + }; // End of "Alpha" section +}; + +xkb_geometry "60" { + width = 290; + height = 140; + baseColor = "grey80"; + labelColor = "white"; + + shape "NORM" { cornerRadius = 1, { [18, 18] }, { [2, 0], [16, 16] } }; + + shape "ESC" { cornerRadius = 1, { [17, 13] }, { [1.5, 0], [15.5, 12] } }; + shape "FN0" { cornerRadius = 1, { [17, 11] }, { [1.5, 0], [15.5, 10] } }; + + shape "BKSP" { cornerRadius = 1, { [37, 18] }, { [2, 0], [35, 16] } }; + + shape "TABK" { cornerRadius = 1, { [27.5, 18] }, { [2, 0], [25.5, 16] } }; + shape "BKSL" { cornerRadius = 1, { [27.5, 18] }, { [2, 0], [25.5, 16] } }; + + shape "CAPS" { cornerRadius = 1, { [30.5, 18] }, { [2, 0], [28.5, 16] } }; + shape "RTRN" { cornerRadius = 1, { [43.5, 18] }, { [2, 0], [41.5, 16] } }; + + shape "LFSH" { cornerRadius = 1, { [40, 18] }, { [2, 0], [38, 16] } }; + shape "RTSH" { cornerRadius = 1, { [53, 18] }, { [2, 0], [51, 16] } }; + + shape "LCTL" { cornerRadius = 1, { [21, 18] }, { [2, 0], [19, 16] } }; + shape "LWIN" { cornerRadius = 1, { [15, 18] }, { [1.5, 0], [13.5, 16] } }; + + shape "SPCE" { cornerRadius = 1, { [97, 18] }, { [2, 0], [95, 16] } }; + + shape "ARR1" { cornerRadius = 1, { [17, 13] }, { [1.5, 0], [15.5, 12] } }; + shape "ARR2" { cornerRadius = 1, { [17, 11] }, { [1.5, 0], [15.5, 10] } }; + + shape "VOL" { cornerRadius = 2.5, { [5, 5] } }; + shape "TVTG" { cornerRadius = 0.5, { [0, 1], [17, 1], [17, 4], [0, 4] } }; + + shape "KEYS" { cornerRadius = 2, + { [0, 0], [19, 0], [19, 16], [172, 16], + [172, 4], [286, 4], [286, 133], [231, 133], + [231, 126], [0, 126] } }; + + solid "KeyPanel" { + shape = "KEYS"; + left = 2; + top = 3; + color = "black"; + }; + + shape "NULL0" { cornerRadius = 0.5, + { [0, 26], + [72, 26], [72, 14], [76, 14], [76, 26], + [149, 26], [149, 14], [153, 14], [153, 26], + [226, 26], [226, 2], [230, 2], [230, 26], + [284, 26], [284, 27], + [0, 27] } }; + + solid "NullPanel0" { + shape = "NULL0"; + left = 3; + top = 6; + color = "grey80"; + }; + + shape "NULL1" { cornerRadius = 0.5, { [0, 12], [17, 12], [17, 13], [0, 13] } }; + + solid "NullPanel1" { + shape = "NULL1"; + left = 3; + top = 6; + color = "grey80"; + }; + + shape "MEDIA" { cornerRadius = 0.5, { [0, 0], [55, 0], [55, 10], [0, 10] } }; + + solid "MediaPanel" { + shape = "MEDIA"; + left = 25.5; + top = 6; + color = "black"; + }; + + section "Volume" { + left = 22; + top = 8.5; + key.shape = "VOL"; + key.gap = 6; + key.color = "grey20"; + + row { + keys { , , , {, "TVTG", color = "blue"} }; + }; + }; + + key.gap = 1; + key.color = "grey60"; + + section "Function" { + left = 2; + top = 3; + key.shape = "FN0"; + row { + key.shape = "ESC"; + top = 1; + keys { }; + }; + row { + top = 5; + keys { { , 173 }, , }; + }; + row { + top = 17; + keys { , , , , + { , 6 }, , , , + { , 6 }, , , + }; + }; + }; // End of "Function" section + + section "Control" { + left = 2; + top = 109; + key.shape = "NORM"; + row { + top = 1; + keys { , { , "LCTL" }, { , "LWIN" }, , + { , "SPCE" }, , , + }; + }; + }; // End of "Control" section + + section "Editing" { + top = 7; + left = 233; + key.shape = "FN0"; + row { + top = 1; + keys { , , }; + }; + row { + top = 13; + keys { , , }; + }; + }; // End of "Editing" section + + section "Navigation" { + top = 109; + left = 233; + row { + key.shape = "ARR1"; + top = 1; + keys { , , }; + }; + row { + key.shape = "ARR2"; + top = 15; + keys { , , }; + }; + }; // End of "Navigation" section + + shape "STIK" { cornerRadius = 3.5, { [7, 7] } }; + + solid "STIK" { + priority = 255; + color = "red"; + shape = "STIK"; + top = 85.5; + left = 125.5; + }; + + section "Alpha" { + left = 2; + top = 33; + key.shape = "NORM"; + row { + top = 1; + keys { , , , , , + , , , , , + , , , { , "BKSP" } + }; + }; + row { + top = 20; + keys { { , "TABK" }, + , , , , , + , , , , , + , , { , "BKSL" } + }; + }; + row { + top = 39; + keys { { , "CAPS" }, + , , , , , + , , , , , + , { , "RTRN", color = "blue" } + }; + }; + row { + top = 58; + keys { { , "LFSH" }, + , , , , , + , , , , , + { , "RTSH" } + }; + }; + }; // End of "Alpha" section +}; diff --git a/xorg-server/xkeyboard-config/geometry/winbook b/xorg-server/xkeyboard-config/geometry/winbook index e4de47861..570deb358 100644 --- a/xorg-server/xkeyboard-config/geometry/winbook +++ b/xorg-server/xkeyboard-config/geometry/winbook @@ -1,144 +1,143 @@ -// $Xorg: winbook,v 1.3 2000/08/17 19:54:36 cpqbld Exp $ -default xkb_geometry "XP5" { - - description= "WinBook XP5"; - width= 281; - height= 180; - - shape.cornerRadius= 1; - - shape "NORM" { - { [17,17] }, - { [ 2, 1], [ 15, 15 ] } - }; - shape "FKEY" { - { [ 15, 10 ] }, - { [ 1, 0 ], [ 14, 9.5 ] } - }; - shape "ONE" { - { [ 28, 17 ] }, - { [ 11, 0 ], [ 28, 17 ] }, - { [ 13, 1 ], [ 26, 15 ] } - }; - shape "WIDE" { // backspace, caps lock, ctrl alt ? - { [ 24.5, 17 ] }, - { [ 2, 1 ], [ 22.5, 15 ] } - }; - shape "WIDR" { // backslash, left shift - { [ 35, 17 ] }, - { [ 2, 1 ], [ 33, 15 ] } - }; - shape "RTRN" { - { [ 45, 17 ] }, - { [ 2, 1 ], [ 43, 15 ] } - }; - shape "SPCE" { - { [ 90, 17 ] }, - { [ 2, 1 ], [ 88, 15 ] } - }; - shape "STIK" { - cornerRadius= 4, - { [ 8, 8 ] } - }; - shape "BTN" { - { [ 31, 6 ] } - }; - - section.left= 2; - row.left= 1; - key.shape= "NORM"; - key.gap= 0.5; - - key.color= "grey10"; - labelColor= "white"; - baseColor= "grey20"; - - section "Whole" { - top= 10; - row { - top= 11; - key.shape= "FKEY"; - keys { - , - , , , , , , - , , , , , , - , , , - }; - }; - row { - top= 22; - keys { - { , "ONE" }, - , , , , , - , , , , , , - { , shape="WIDE" }, - - }; - }; - row { - top= 40; - keys { - , , , , , , , - , , , , , , - { , "WIDR" } - }; - }; - row { - top= 58; - keys { { , shape="WIDE" }, - , , , , , - , , , , , - , - { , shape="RTRN" } - }; - }; - row { - top= 76; - keys { - { , shape="WIDR" }, - , , , , , - , , , , , - , , - }; - }; - row { - top= 94; - keys { - { , "WIDE" }, , { , "WIDE" }, - , { , shape="SPCE" }, , , - , , - }; - }; - overlay "KPAD" { - =, =, =, =, - =, =, =, =, - =, =, =, =, - =, =, = - }; - }; // End of "Whole" section - - solid "STIK" { - color= "red"; - shape= "STIK"; - top= 81; - left= 112; - }; - - solid "BTN1" { - color= "red"; - shape= "BTN"; - top= 137; - left= 93; - }; - - solid "BTN2" { - color= "red"; - shape= "BTN"; - top= 137; - left= 127; - }; - - alias = ; - alias = ; - -}; +default xkb_geometry "XP5" { + + description= "WinBook XP5"; + width= 281; + height= 180; + + shape.cornerRadius= 1; + + shape "NORM" { + { [17,17] }, + { [ 2, 1], [ 15, 15 ] } + }; + shape "FKEY" { + { [ 15, 10 ] }, + { [ 1, 0 ], [ 14, 9.5 ] } + }; + shape "ONE" { + { [ 28, 17 ] }, + { [ 11, 0 ], [ 28, 17 ] }, + { [ 13, 1 ], [ 26, 15 ] } + }; + shape "WIDE" { // backspace, caps lock, ctrl alt ? + { [ 24.5, 17 ] }, + { [ 2, 1 ], [ 22.5, 15 ] } + }; + shape "WIDR" { // backslash, left shift + { [ 35, 17 ] }, + { [ 2, 1 ], [ 33, 15 ] } + }; + shape "RTRN" { + { [ 45, 17 ] }, + { [ 2, 1 ], [ 43, 15 ] } + }; + shape "SPCE" { + { [ 90, 17 ] }, + { [ 2, 1 ], [ 88, 15 ] } + }; + shape "STIK" { + cornerRadius= 4, + { [ 8, 8 ] } + }; + shape "BTN" { + { [ 31, 6 ] } + }; + + section.left= 2; + row.left= 1; + key.shape= "NORM"; + key.gap= 0.5; + + key.color= "grey10"; + labelColor= "white"; + baseColor= "grey20"; + + section "Whole" { + top= 10; + row { + top= 11; + key.shape= "FKEY"; + keys { + , + , , , , , , + , , , , , , + , , , + }; + }; + row { + top= 22; + keys { + { , "ONE" }, + , , , , , + , , , , , , + { , shape="WIDE" }, + + }; + }; + row { + top= 40; + keys { + , , , , , , , + , , , , , , + { , "WIDR" } + }; + }; + row { + top= 58; + keys { { , shape="WIDE" }, + , , , , , + , , , , , + , + { , shape="RTRN" } + }; + }; + row { + top= 76; + keys { + { , shape="WIDR" }, + , , , , , + , , , , , + , , + }; + }; + row { + top= 94; + keys { + { , "WIDE" }, , { , "WIDE" }, + , { , shape="SPCE" }, , , + , , + }; + }; + overlay "KPAD" { + =, =, =, =, + =, =, =, =, + =, =, =, =, + =, =, = + }; + }; // End of "Whole" section + + solid "STIK" { + color= "red"; + shape= "STIK"; + top= 81; + left= 112; + }; + + solid "BTN1" { + color= "red"; + shape= "BTN"; + top= 137; + left= 93; + }; + + solid "BTN2" { + color= "red"; + shape= "BTN"; + top= 137; + left= 127; + }; + + alias = ; + alias = ; + +}; diff --git a/xorg-server/xkeyboard-config/keycodes/amiga b/xorg-server/xkeyboard-config/keycodes/amiga index 7d2576701..f374ea658 100644 --- a/xorg-server/xkeyboard-config/keycodes/amiga +++ b/xorg-server/xkeyboard-config/keycodes/amiga @@ -1,231 +1,225 @@ -// $Xorg: amiga,v 1.3 2000/08/17 19:54:37 cpqbld Exp $ - - - -// $XFree86: xc/programs/xkbcomp/keycodes/amiga,v 3.2 1997/10/26 13:25:35 dawes Exp $ - -default xkb_keycodes "usa1" { - - minimum= 8; - maximum= 255; - - = 77; - = 88; - = 89; - = 90; - = 91; - = 92; - = 93; - = 94; - = 95; - = 96; - = 97; - - = 8; - = 9; - = 10; - = 11; - = 12; - = 13; - = 14; - = 15; - = 16; - = 17; - = 18; - = 19; - = 20; - = 21; - = 73; - - = 74; - = 24; - = 25; - = 26; - = 27; - = 28; - = 29; - = 30; - = 31; - = 32; - = 33; - = 34; - = 35; - = 76; - - = 107; - = 106; - = 40; - = 41; - = 42; - = 43; - = 44; - = 45; - = 46; - = 47; - = 48; - = 49; - = 50; - - = 104; - = 57; - = 58; - = 59; - = 60; - = 61; - = 62; - = 63; - = 64; - = 65; - = 66; - = 105; - - = 108; - = 110; - = 72; - = 111; - = 109; - - = 78; - = 103; - = 84; - = 87; - = 85; - = 86; - - = 98; - = 99; - = 100; - = 101; - - = 69; - = 70; - = 71; - = 82; - - = 53; - = 54; - = 55; - = 102; - - = 37; - = 38; - = 39; - - = 23; - = 68; - = 75; -}; - -xkb_keycodes "de" { - - minimum= 8; - maximum= 255; - - = 77; - = 88; - = 89; - = 90; - = 91; - = 92; - = 93; - = 94; - = 95; - = 96; - = 97; - - = 8; - = 9; - = 10; - = 11; - = 12; - = 13; - = 14; - = 15; - = 16; - = 17; - = 18; - = 19; - = 20; - = 21; - = 73; - - = 74; - = 24; - = 25; - = 26; - = 27; - = 28; - = 29; - = 30; - = 31; - = 32; - = 33; - = 34; - = 35; - = 76; - - = 107; - = 106; - = 40; - = 41; - = 42; - = 43; - = 44; - = 45; - = 46; - = 47; - = 48; - = 49; - = 50; - = 51; - - = 104; - = 56; - = 57; - = 58; - = 59; - = 60; - = 61; - = 62; - = 63; - = 64; - = 65; - = 66; - = 105; - - = 108; - = 110; - = 72; - = 111; - = 109; - - = 78; - = 103; - = 84; - = 87; - = 85; - = 86; - - = 98; - = 99; - = 100; - = 101; - - = 69; - = 70; - = 71; - = 82; - - = 53; - = 54; - = 55; - = 102; - - = 37; - = 38; - = 39; - - = 23; - = 68; - = 75; -}; +default xkb_keycodes "usa1" { + + minimum= 8; + maximum= 255; + + = 77; + = 88; + = 89; + = 90; + = 91; + = 92; + = 93; + = 94; + = 95; + = 96; + = 97; + + = 8; + = 9; + = 10; + = 11; + = 12; + = 13; + = 14; + = 15; + = 16; + = 17; + = 18; + = 19; + = 20; + = 21; + = 73; + + = 74; + = 24; + = 25; + = 26; + = 27; + = 28; + = 29; + = 30; + = 31; + = 32; + = 33; + = 34; + = 35; + = 76; + + = 107; + = 106; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 48; + = 49; + = 50; + + = 104; + = 57; + = 58; + = 59; + = 60; + = 61; + = 62; + = 63; + = 64; + = 65; + = 66; + = 105; + + = 108; + = 110; + = 72; + = 111; + = 109; + + = 78; + = 103; + = 84; + = 87; + = 85; + = 86; + + = 98; + = 99; + = 100; + = 101; + + = 69; + = 70; + = 71; + = 82; + + = 53; + = 54; + = 55; + = 102; + + = 37; + = 38; + = 39; + + = 23; + = 68; + = 75; +}; + +xkb_keycodes "de" { + + minimum= 8; + maximum= 255; + + = 77; + = 88; + = 89; + = 90; + = 91; + = 92; + = 93; + = 94; + = 95; + = 96; + = 97; + + = 8; + = 9; + = 10; + = 11; + = 12; + = 13; + = 14; + = 15; + = 16; + = 17; + = 18; + = 19; + = 20; + = 21; + = 73; + + = 74; + = 24; + = 25; + = 26; + = 27; + = 28; + = 29; + = 30; + = 31; + = 32; + = 33; + = 34; + = 35; + = 76; + + = 107; + = 106; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 48; + = 49; + = 50; + = 51; + + = 104; + = 56; + = 57; + = 58; + = 59; + = 60; + = 61; + = 62; + = 63; + = 64; + = 65; + = 66; + = 105; + + = 108; + = 110; + = 72; + = 111; + = 109; + + = 78; + = 103; + = 84; + = 87; + = 85; + = 86; + + = 98; + = 99; + = 100; + = 101; + + = 69; + = 70; + = 71; + = 82; + + = 53; + = 54; + = 55; + = 102; + + = 37; + = 38; + = 39; + + = 23; + = 68; + = 75; +}; diff --git a/xorg-server/xkeyboard-config/keycodes/ataritt b/xorg-server/xkeyboard-config/keycodes/ataritt index 7eae09f49..c6d31d3ae 100644 --- a/xorg-server/xkeyboard-config/keycodes/ataritt +++ b/xorg-server/xkeyboard-config/keycodes/ataritt @@ -1,123 +1,117 @@ -// $Xorg: ataritt,v 1.3 2000/08/17 19:54:37 cpqbld Exp $ - - - -// $XFree86: xc/programs/xkbcomp/keycodes/ataritt,v 3.1 1997/10/26 13:25:35 dawes Exp $ - -default xkb_keycodes "us" { - - minimum= 8; - maximum= 255; - - = 9; - = 10; - = 11; - = 12; - = 13; - = 14; - = 15; - = 16; - = 17; - = 18; - = 19; - = 20; - = 21; - = 49; - = 22; - - = 23; - = 24; - = 25; - = 26; - = 27; - = 28; - = 29; - = 30; - = 31; - = 32; - = 33; - = 34; - = 35; - = 36; - = 91; - - = 37; - = 38; - = 39; - = 40; - = 41; - = 42; - = 43; - = 44; - = 45; - = 46; - = 47; - = 48; - = 51; - - = 50; - = 52; - = 53; - = 54; - = 55; - = 56; - = 57; - = 58; - = 59; - = 60; - = 61; - = 62; - - = 64; - = 65; - = 66; - - = 67; - = 68; - = 69; - = 70; - = 71; - = 72; - = 73; - = 74; - = 75; - = 76; - - = 106; - = 105; - = 90; - = 79; - = 80; - = 83; - = 88; - = 85; - - = 107; - = 108; - = 109; - = 110; - - = 111; - = 112; - = 113; - = 82; - - = 114; - = 115; - = 116; - = 86; - - = 117; - = 118; - = 119; - - = 120; - = 121; - = 122; -}; - -xkb_keycodes "de" { - include "ataritt(us)" - - = 104; -}; +default xkb_keycodes "us" { + + minimum= 8; + maximum= 255; + + = 9; + = 10; + = 11; + = 12; + = 13; + = 14; + = 15; + = 16; + = 17; + = 18; + = 19; + = 20; + = 21; + = 49; + = 22; + + = 23; + = 24; + = 25; + = 26; + = 27; + = 28; + = 29; + = 30; + = 31; + = 32; + = 33; + = 34; + = 35; + = 36; + = 91; + + = 37; + = 38; + = 39; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 48; + = 51; + + = 50; + = 52; + = 53; + = 54; + = 55; + = 56; + = 57; + = 58; + = 59; + = 60; + = 61; + = 62; + + = 64; + = 65; + = 66; + + = 67; + = 68; + = 69; + = 70; + = 71; + = 72; + = 73; + = 74; + = 75; + = 76; + + = 106; + = 105; + = 90; + = 79; + = 80; + = 83; + = 88; + = 85; + + = 107; + = 108; + = 109; + = 110; + + = 111; + = 112; + = 113; + = 82; + + = 114; + = 115; + = 116; + = 86; + + = 117; + = 118; + = 119; + + = 120; + = 121; + = 122; +}; + +xkb_keycodes "de" { + include "ataritt(us)" + + = 104; +}; diff --git a/xorg-server/xkeyboard-config/keycodes/digital_vndr/lk b/xorg-server/xkeyboard-config/keycodes/digital_vndr/lk index 8523b95dd..2c1421e88 100644 --- a/xorg-server/xkeyboard-config/keycodes/digital_vndr/lk +++ b/xorg-server/xkeyboard-config/keycodes/digital_vndr/lk @@ -1,271 +1,270 @@ -// $Xorg: lk,v 1.3 2000/08/17 19:54:38 cpqbld Exp $ -// -//Copyright (c) 1996 Digital Equipment Corporation -// -//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. -// -// HISTORY -// Log -// Revision 1.2 1996/06/18 09:13:22 erik -// use flags correctly, assorted cleanups and consortium fixes -// -// Revision 1.1.6.2 1995/08/07 17:40:34 William_Walker -// Upgrade XKB to protocol 0.62 (dual submit from decx11) -// [1995/08/06 14:06:25 William_Walker] -// -// Revision 1.1.2.4 1995/08/05 15:25:55 William_Walker -// Upgrade to XKB protocol 0.62 -// [1995/08/05 14:39:58 William_Walker] -// -// Revision 1.1.2.3 1995/06/27 12:17:31 William_Walker -// Rename to ISO9995 compliant . -// [1995/06/26 20:24:04 William_Walker] -// -// Revision 1.1.2.2 1995/06/05 19:21:28 William_Walker -// New file. I love keymaps. -// [1995/06/05 18:07:29 William_Walker] -// -// EndLog -// -// @(#)RCSfile: lk Revision: /main/3 (DEC) Date: 1996/01/24 12:13:31 -// -xkb_keycodes "lk_common" { - // "Function" keys - = 86; - = 87; - = 88; - = 89; - = 90; - = 100; - = 101; - = 102; - = 103; - = 104; - = 113; - = 114; - - = 170; - = 167; - = 169; - = 168; - - // "Keypad" keys - = 157; - = 158; - = 159; - = 153; - = 154; - = 155; - = 150; - = 151; - = 152; - = 149; - = 146; - = 148; - - // "Alphanumeric" keys - = 191; - = 192; - = 197; - = 203; - = 208; - = 214; - = 219; - = 224; - = 229; - = 234; - = 239; - = 249; - = 245; - = 188; - - = 190; - = 193; - = 198; - = 204; - = 209; - = 215; - = 220; - = 225; - = 230; - = 235; - = 240; - = 250; - = 246; - = 189; - - = 175; - = 176; - = 194; - = 199; - = 205; - = 210; - = 216; - = 221; - = 226; - = 231; - = 236; - = 242; - = 251; - - = 174; - = 195; - = 200; - = 206; - = 211; - = 217; - = 222; - = 227; - = 232; - = 237; - = 243; - = 171; - - = 212; - - = 255; // Support R5 Lock Down Modifiers - - alias = ; -}; - -xkb_keycodes "lkx01" { - include "digital_vndr/lk(lk_common)" - = 201; - = 115; - = 116; - = 128; - = 129; - = 130; - = 131; - = 124; - = 125; - = 138; - = 139; - = 140; - = 141; - = 142; - = 143; - = 161; - = 162; - = 163; - = 164; - = 160; - = 156; - = 247; - = 177; -}; - -xkb_keycodes "lk201" { - include "digital_vndr/lk(lkx01)" - indicator 4 = "Scroll Lock"; - indicator 3 = "Caps Lock"; - indicator 2 = "Compose"; - indicator 1 = "Wait"; -}; - -xkb_keycodes "lk421" { - include "digital_vndr/lk(lkx01)" - = 172; - = 178; - = 173; -}; - -xkb_keycodes "lk401" { - include "digital_vndr/lk(lk421)" - indicator 4 = "Scroll Lock"; - indicator 3 = "Caps Lock"; -}; - -xkb_keycodes "lk44x" { - include "digital_vndr/lk(lk_common)" - = 85; - = 115; - = 116; - = 124; - = 138; - = 139; - = 140; - = 141; - = 142; - = 143; - = 161; - = 162; - = 163; - = 164; - = 156; - = 172; - = 178; - = 173; -}; - -xkb_keycodes "lk443" { - include "digital_vndr/lk(lk44x)" - = 247; - indicator 3 = "Caps Lock"; - indicator 4 = "Scroll Lock"; - indicator 5 = "Num Lock"; -}; - -xkb_keycodes "lk444" { - include "digital_vndr/lk(lk44x)" - = 201; - = 247; - indicator 3 = "Caps Lock"; - indicator 4 = "Scroll Lock"; - indicator 5 = "Num Lock"; -}; - -// LK201-LT = lk201 -// LK421-AJ = lk421 +AB11 -// LK421-JJ = lk421aj+MUHE+KANJ+HIRA -// LK401-AJ = lk401 -// LK401-BJ = lk401 +MUHE+KANJ+HIRA -// LK401-JJ = lk401bj+AB11 -// LK401-LT = lk401 -// LK441-LT = lk443 - -xkb_keycodes "lk421aj" { - include "digital_vndr/lk(lk421)" - = 252; -}; - -xkb_keycodes "lk421jj" { - include "digital_vndr/lk(lk421aj)" - = 94; - = 95; - = 97; -}; - -xkb_keycodes "lk401bj" { - include "digital_vndr/lk(lk401)" - = 94; - = 95; - = 97; -}; - -xkb_keycodes "lk401jj" { - include "digital_vndr/lk(lk401bj)" - = 252; -}; +// +//Copyright (c) 1996 Digital Equipment Corporation +// +//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. +// +// HISTORY +// Log +// Revision 1.2 1996/06/18 09:13:22 erik +// use flags correctly, assorted cleanups and consortium fixes +// +// Revision 1.1.6.2 1995/08/07 17:40:34 William_Walker +// Upgrade XKB to protocol 0.62 (dual submit from decx11) +// [1995/08/06 14:06:25 William_Walker] +// +// Revision 1.1.2.4 1995/08/05 15:25:55 William_Walker +// Upgrade to XKB protocol 0.62 +// [1995/08/05 14:39:58 William_Walker] +// +// Revision 1.1.2.3 1995/06/27 12:17:31 William_Walker +// Rename to ISO9995 compliant . +// [1995/06/26 20:24:04 William_Walker] +// +// Revision 1.1.2.2 1995/06/05 19:21:28 William_Walker +// New file. I love keymaps. +// [1995/06/05 18:07:29 William_Walker] +// +// EndLog +// +// @(#)RCSfile: lk Revision: /main/3 (DEC) Date: 1996/01/24 12:13:31 +// +xkb_keycodes "lk_common" { + // "Function" keys + = 86; + = 87; + = 88; + = 89; + = 90; + = 100; + = 101; + = 102; + = 103; + = 104; + = 113; + = 114; + + = 170; + = 167; + = 169; + = 168; + + // "Keypad" keys + = 157; + = 158; + = 159; + = 153; + = 154; + = 155; + = 150; + = 151; + = 152; + = 149; + = 146; + = 148; + + // "Alphanumeric" keys + = 191; + = 192; + = 197; + = 203; + = 208; + = 214; + = 219; + = 224; + = 229; + = 234; + = 239; + = 249; + = 245; + = 188; + + = 190; + = 193; + = 198; + = 204; + = 209; + = 215; + = 220; + = 225; + = 230; + = 235; + = 240; + = 250; + = 246; + = 189; + + = 175; + = 176; + = 194; + = 199; + = 205; + = 210; + = 216; + = 221; + = 226; + = 231; + = 236; + = 242; + = 251; + + = 174; + = 195; + = 200; + = 206; + = 211; + = 217; + = 222; + = 227; + = 232; + = 237; + = 243; + = 171; + + = 212; + + = 255; // Support R5 Lock Down Modifiers + + alias = ; +}; + +xkb_keycodes "lkx01" { + include "digital_vndr/lk(lk_common)" + = 201; + = 115; + = 116; + = 128; + = 129; + = 130; + = 131; + = 124; + = 125; + = 138; + = 139; + = 140; + = 141; + = 142; + = 143; + = 161; + = 162; + = 163; + = 164; + = 160; + = 156; + = 247; + = 177; +}; + +xkb_keycodes "lk201" { + include "digital_vndr/lk(lkx01)" + indicator 4 = "Scroll Lock"; + indicator 3 = "Caps Lock"; + indicator 2 = "Compose"; + indicator 1 = "Wait"; +}; + +xkb_keycodes "lk421" { + include "digital_vndr/lk(lkx01)" + = 172; + = 178; + = 173; +}; + +xkb_keycodes "lk401" { + include "digital_vndr/lk(lk421)" + indicator 4 = "Scroll Lock"; + indicator 3 = "Caps Lock"; +}; + +xkb_keycodes "lk44x" { + include "digital_vndr/lk(lk_common)" + = 85; + = 115; + = 116; + = 124; + = 138; + = 139; + = 140; + = 141; + = 142; + = 143; + = 161; + = 162; + = 163; + = 164; + = 156; + = 172; + = 178; + = 173; +}; + +xkb_keycodes "lk443" { + include "digital_vndr/lk(lk44x)" + = 247; + indicator 3 = "Caps Lock"; + indicator 4 = "Scroll Lock"; + indicator 5 = "Num Lock"; +}; + +xkb_keycodes "lk444" { + include "digital_vndr/lk(lk44x)" + = 201; + = 247; + indicator 3 = "Caps Lock"; + indicator 4 = "Scroll Lock"; + indicator 5 = "Num Lock"; +}; + +// LK201-LT = lk201 +// LK421-AJ = lk421 +AB11 +// LK421-JJ = lk421aj+MUHE+KANJ+HIRA +// LK401-AJ = lk401 +// LK401-BJ = lk401 +MUHE+KANJ+HIRA +// LK401-JJ = lk401bj+AB11 +// LK401-LT = lk401 +// LK441-LT = lk443 + +xkb_keycodes "lk421aj" { + include "digital_vndr/lk(lk421)" + = 252; +}; + +xkb_keycodes "lk421jj" { + include "digital_vndr/lk(lk421aj)" + = 94; + = 95; + = 97; +}; + +xkb_keycodes "lk401bj" { + include "digital_vndr/lk(lk401)" + = 94; + = 95; + = 97; +}; + +xkb_keycodes "lk401jj" { + include "digital_vndr/lk(lk401bj)" + = 252; +}; diff --git a/xorg-server/xkeyboard-config/keycodes/digital_vndr/pc b/xorg-server/xkeyboard-config/keycodes/digital_vndr/pc index 511715627..8cf06f3f0 100644 --- a/xorg-server/xkeyboard-config/keycodes/digital_vndr/pc +++ b/xorg-server/xkeyboard-config/keycodes/digital_vndr/pc @@ -1,280 +1,277 @@ -// $Xorg: pc,v 1.3 2000/08/17 19:54:38 cpqbld Exp $ -// -//Copyright (c) 1996 Digital Equipment Corporation -// -//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. -// -// HISTORY -// Log -// Revision 1.2 1996/06/18 09:13:25 erik -// use flags correctly, assorted cleanups and consortium fixes -// -// Revision 1.1.6.3 1995/10/25 21:00:14 William_Walker -// Add pc104-key support -// [1995/10/23 15:46:21 William_Walker] -// -// Revision 1.1.6.2 1995/08/07 17:40:37 William_Walker -// Upgrade XKB to protocol 0.62 (dual submit from decx11) -// [1995/08/06 14:06:28 William_Walker] -// -// Revision 1.1.2.4 1995/08/05 15:25:56 William_Walker -// Upgrade to XKB protocol 0.62 -// [1995/08/05 14:40:02 William_Walker] -// -// Revision 1.1.2.3 1995/06/27 12:17:32 William_Walker -// Rename to ISO9995 compliant . -// [1995/06/26 20:24:07 William_Walker] -// -// Revision 1.1.2.2 1995/06/05 19:21:31 William_Walker -// New file. I love keymaps. -// [1995/06/05 18:07:34 William_Walker] -// -// EndLog -// -// @(#)RCSfile: pc Revision: /main/3 (DEC) Date: 1996/01/24 12:13:36 -// -xkb_keycodes "pc_common" { - // "Function" keys - = 9; - = 15; - = 23; - = 31; - = 39; - = 47; - = 55; - = 63; - = 71; - = 79; - = 86; - = 94; - - // "Editing" keys - - = 99; - = 97; - = 96; - = 106; - - // "Keypad" keys - = 108; - = 117; - = 125; - - = 107; - = 115; - = 116; - - = 105; - = 114; - = 122; - = 121; - - = 112; - = 113; - - // "Alphanumeric" keys - = 22; - = 30; - = 38; - = 37; - = 46; - = 54; - = 61; - = 62; - = 70; - = 69; - = 78; - = 85; - = 102; - - = 13; - = 21; - = 29; - = 36; - = 45; - = 44; - = 53; - = 60; - = 67; - = 68; - = 77; - = 84; - = 91; - - = 20; - = 28; - = 27; - = 35; - = 43; - = 52; - = 51; - = 59; - = 66; - = 75; - = 76; - = 82; - = 90; - - = 18; - = 26; - = 34; - = 33; - = 42; - = 50; - = 49; - = 58; - = 65; - = 73; - = 74; - = 89; - - = 17; - = 25; - = 41; - = 57; - - = 255; // Support R5 Lock Down Modifiers - -}; - -xkb_keycodes "pc10x" { - include "digital_vndr/pc(pc_common)" - = 8; - = 14; - = 87; - = 95; - = 98; - = 103; - = 110; - = 111; - = 100; - = 101; - = 109; - = 118; - = 119; - = 126; - = 132; - = 124; - = 88; - - alias = ; - - indicator 3 = "Caps Lock"; - indicator 4 = "Scroll Lock"; -}; - -xkb_keycodes "pc101" { - include "digital_vndr/pc(pc10x)" - = 92; - indicator 5 = "Num Lock"; -}; - - -xkb_keycodes "pc102" { - include "digital_vndr/pc(pc10x)" - = 19; - = 83; - indicator 5 = "Num Lock"; -}; - -xkb_keycodes "pc104" { - include "digital_vndr/pc(pc101)" - = 139; - = 140; - = 141; -}; - -xkb_keycodes "lk411_common" { - include "digital_vndr/pc(pc_common)" - = 8; - = 14; - = 24; - = 10; - = 16; - = 87; - = 95; - = 98; - = 11; - = 12; - = 110; - = 103; - = 100; - = 101; - = 111; - = 109; - = 118; - = 119; - = 126; - = 132; - = 19; - = 124; - = 40; - = 88; - - alias = ; - - indicator 3 = "Caps Lock"; - indicator 4 = "Scroll Lock"; -}; - -xkb_keycodes "lk411" { - include "digital_vndr/pc(lk411_common)" - = 92; -}; - -xkb_keycodes "lk450" { - include "digital_vndr/pc(lk411)" - indicator 2 = "Compose"; - indicator 1 = "Wait"; -}; - -// Japanese variants -// -// PCXAJ-AA = pc+BKSL+AC12+AB11+MUHE+KANJ+HIRA+indicator -// LK411-AJ = lk411+MUHE+KANJ+HIRA -// LK411-JJ = lk411+BKSL+AZ01+MUHE+KANJ+HIRA -// LK411-LT = lk411 - -xkb_keycodes "pcxajaa" { - include "digital_vndr/pc(pc10x)" - = 93; - = 83; - = 81; - = 133; - = 134; - = 135; - indicator 5 = "Group 2"; -}; - -xkb_keycodes "lk411jj" { - include "digital_vndr/pc(lk411_common)" - = 81; - = 83; - = 133; - = 134; - = 135; -}; - - +// +//Copyright (c) 1996 Digital Equipment Corporation +// +//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. +// +// HISTORY +// Log +// Revision 1.2 1996/06/18 09:13:25 erik +// use flags correctly, assorted cleanups and consortium fixes +// +// Revision 1.1.6.3 1995/10/25 21:00:14 William_Walker +// Add pc104-key support +// [1995/10/23 15:46:21 William_Walker] +// +// Revision 1.1.6.2 1995/08/07 17:40:37 William_Walker +// Upgrade XKB to protocol 0.62 (dual submit from decx11) +// [1995/08/06 14:06:28 William_Walker] +// +// Revision 1.1.2.4 1995/08/05 15:25:56 William_Walker +// Upgrade to XKB protocol 0.62 +// [1995/08/05 14:40:02 William_Walker] +// +// Revision 1.1.2.3 1995/06/27 12:17:32 William_Walker +// Rename to ISO9995 compliant . +// [1995/06/26 20:24:07 William_Walker] +// +// Revision 1.1.2.2 1995/06/05 19:21:31 William_Walker +// New file. I love keymaps. +// [1995/06/05 18:07:34 William_Walker] +// +// EndLog +// +// @(#)RCSfile: pc Revision: /main/3 (DEC) Date: 1996/01/24 12:13:36 +// +xkb_keycodes "pc_common" { + // "Function" keys + = 9; + = 15; + = 23; + = 31; + = 39; + = 47; + = 55; + = 63; + = 71; + = 79; + = 86; + = 94; + + // "Editing" keys + + = 99; + = 97; + = 96; + = 106; + + // "Keypad" keys + = 108; + = 117; + = 125; + + = 107; + = 115; + = 116; + + = 105; + = 114; + = 122; + = 121; + + = 112; + = 113; + + // "Alphanumeric" keys + = 22; + = 30; + = 38; + = 37; + = 46; + = 54; + = 61; + = 62; + = 70; + = 69; + = 78; + = 85; + = 102; + + = 13; + = 21; + = 29; + = 36; + = 45; + = 44; + = 53; + = 60; + = 67; + = 68; + = 77; + = 84; + = 91; + + = 20; + = 28; + = 27; + = 35; + = 43; + = 52; + = 51; + = 59; + = 66; + = 75; + = 76; + = 82; + = 90; + + = 18; + = 26; + = 34; + = 33; + = 42; + = 50; + = 49; + = 58; + = 65; + = 73; + = 74; + = 89; + + = 17; + = 25; + = 41; + = 57; + + = 255; // Support R5 Lock Down Modifiers + +}; + +xkb_keycodes "pc10x" { + include "digital_vndr/pc(pc_common)" + = 8; + = 14; + = 87; + = 95; + = 98; + = 103; + = 110; + = 111; + = 100; + = 101; + = 109; + = 118; + = 119; + = 126; + = 132; + = 124; + = 88; + + alias = ; + + indicator 3 = "Caps Lock"; + indicator 4 = "Scroll Lock"; +}; + +xkb_keycodes "pc101" { + include "digital_vndr/pc(pc10x)" + = 92; + indicator 5 = "Num Lock"; +}; + + +xkb_keycodes "pc102" { + include "digital_vndr/pc(pc10x)" + = 19; + = 83; + indicator 5 = "Num Lock"; +}; + +xkb_keycodes "pc104" { + include "digital_vndr/pc(pc101)" + = 139; + = 140; + = 141; +}; + +xkb_keycodes "lk411_common" { + include "digital_vndr/pc(pc_common)" + = 8; + = 14; + = 24; + = 10; + = 16; + = 87; + = 95; + = 98; + = 11; + = 12; + = 110; + = 103; + = 100; + = 101; + = 111; + = 109; + = 118; + = 119; + = 126; + = 132; + = 19; + = 124; + = 40; + = 88; + + alias = ; + + indicator 3 = "Caps Lock"; + indicator 4 = "Scroll Lock"; +}; + +xkb_keycodes "lk411" { + include "digital_vndr/pc(lk411_common)" + = 92; +}; + +xkb_keycodes "lk450" { + include "digital_vndr/pc(lk411)" + indicator 2 = "Compose"; + indicator 1 = "Wait"; +}; + +// Japanese variants +// +// PCXAJ-AA = pc+BKSL+AC12+AB11+MUHE+KANJ+HIRA+indicator +// LK411-AJ = lk411+MUHE+KANJ+HIRA +// LK411-JJ = lk411+BKSL+AZ01+MUHE+KANJ+HIRA +// LK411-LT = lk411 + +xkb_keycodes "pcxajaa" { + include "digital_vndr/pc(pc10x)" + = 93; + = 83; + = 81; + = 133; + = 134; + = 135; + indicator 5 = "Group 2"; +}; + +xkb_keycodes "lk411jj" { + include "digital_vndr/pc(lk411_common)" + = 81; + = 83; + = 133; + = 134; + = 135; +}; diff --git a/xorg-server/xkeyboard-config/keycodes/evdev b/xorg-server/xkeyboard-config/keycodes/evdev index d6963a2d5..de035c898 100644 --- a/xorg-server/xkeyboard-config/keycodes/evdev +++ b/xorg-server/xkeyboard-config/keycodes/evdev @@ -1,313 +1,314 @@ -// translation from evdev scancodes to something resembling xfree86 keycodes. - -default xkb_keycodes "evdev" { - minimum = 8; - maximum = 255; - - # Added for pc105 compatibility - = 94; - - = 49; - = 10; - = 11; - = 12; - = 13; - = 14; - = 15; - = 16; - = 17; - = 18; - = 19; - = 20; - = 21; - = 22; - - = 23; - = 24; - = 25; - = 26; - = 27; - = 28; - = 29; - = 30; - = 31; - = 32; - = 33; - = 34; - = 35; - = 51; - alias = ; - = 36; - - = 66; - = 38; - = 39; - = 40; - = 41; - = 42; - = 43; - = 44; - = 45; - = 46; - = 47; - = 48; - - = 50; - = 52; - = 53; - = 54; - = 55; - = 56; - = 57; - = 58; - = 59; - = 60; - = 61; - = 62; - - = 64; - = 37; - = 65; - = 105; - = 108; - // Microsoft keyboard extra keys - = 133; - = 134; - = 135; - alias = ; - - = 9; - = 67; - = 68; - = 69; - = 70; - = 71; - = 72; - = 73; - = 74; - = 75; - = 76; - = 95; - = 96; - - = 107; - // = 107; - = 78; - = 127; - // = 419; - - = 118; - = 110; - = 112; - = 119; - = 115; - = 117; - - = 111; - = 113; - = 116; - = 114; - - = 77; - = 106; - = 63; - = 82; - - = 79; - = 80; - = 81; - = 86; - - = 83; - = 84; - = 85; - - = 87; - = 88; - = 89; - = 104; - - = 90; - = 91; - = 125; - - = 191; - = 192; - = 193; - = 194; - = 195; - = 196; - = 197; - = 198; - = 199; - = 200; - = 201; - = 202; - - // Keys that are generated on Japanese keyboards - - // = 93; // Hankaku/Zenkakau toggle - not actually used - alias = ; - = 101; // Hiragana/Katakana toggle - = 97; // backslash/underscore - = 100; // Henkan - = 102; // Muhenkan - = 132; // Yen - = 98; // Katakana - = 99; // Hiragana - = 103; // KPJPComma - // = 97; // Romaji - - // Keys that are generated on Korean keyboards - - = 130; // Hangul Latin toggle - = 131; // Hangul to Hanja conversion - - // Solaris compatibility - - alias = ; - alias = ; - = 121; - = 122; - = 123; - = 124; - = 136; - = 137; - = 138; - = 139; - = 140; - = 141; - = 142; - = 143; - = 144; - = 145; - = 146; - - // Extended keys that may be generated on "Internet" keyboards. - // evdev has standardize names for these. - - = 109; // #define KEY_LINEFEED 101 - = 120; // #define KEY_MACRO 112 - = 126; // #define KEY_KPPLUSMINUS 118 - = 129; // #define KEY_KPCOMMA 121 - = 147; // #define KEY_MENU 139 - = 148; // #define KEY_CALC 140 - = 149; // #define KEY_SETUP 141 - = 150; // #define KEY_SLEEP 142 - = 151; // #define KEY_WAKEUP 143 - = 152; // #define KEY_FILE 144 - = 153; // #define KEY_SENDFILE 145 - = 154; // #define KEY_DELETEFILE 146 - = 155; // #define KEY_XFER 147 - = 156; // #define KEY_PROG1 148 - = 157; // #define KEY_PROG2 149 - = 158; // #define KEY_WWW 150 - = 159; // #define KEY_MSDOS 151 - = 160; // #define KEY_COFFEE 152 - = 161; // #define KEY_DIRECTION 153 - = 162; // #define KEY_CYCLEWINDOWS 154 - = 163; // #define KEY_MAIL 155 - = 164; // #define KEY_BOOKMARKS 156 - = 165; // #define KEY_COMPUTER 157 - = 166; // #define KEY_BACK 158 - = 167; // #define KEY_FORWARD 159 - = 168; // #define KEY_CLOSECD 160 - = 169; // #define KEY_EJECTCD 161 - = 170; // #define KEY_EJECTCLOSECD 162 - = 171; // #define KEY_NEXTSONG 163 - = 172; // #define KEY_PLAYPAUSE 164 - = 173; // #define KEY_PREVIOUSSONG 165 - = 174; // #define KEY_STOPCD 166 - = 175; // #define KEY_RECORD 167 - = 176; // #define KEY_REWIND 168 - = 177; // #define KEY_PHONE 169 - = 178; // #define KEY_ISO 170 - = 179; // #define KEY_CONFIG 171 - = 180; // #define KEY_HOMEPAGE 172 - = 181; // #define KEY_REFRESH 173 - = 182; // #define KEY_EXIT 174 - = 183; // #define KEY_MOVE 175 - = 184; // #define KEY_EDIT 176 - = 185; // #define KEY_SCROLLUP 177 - = 186; // #define KEY_SCROLLDOWN 178 - = 187; // #define KEY_KPLEFTPAREN 179 - = 188; // #define KEY_KPRIGHTPAREN 180 - = 189; // #define KEY_NEW 181 - = 190; // #define KEY_REDO 182 - = 208; // #define KEY_PLAYCD 200 - = 209; // #define KEY_PAUSECD 201 - = 210; // #define KEY_PROG3 202 - = 211; // #define KEY_PROG4 203 conflicts with AB11 - = 213; // #define KEY_SUSPEND 205 - = 214; // #define KEY_CLOSE 206 - = 215; // #define KEY_PLAY 207 - = 216; // #define KEY_FASTFORWARD 208 - = 217; // #define KEY_BASSBOOST 209 - = 218; // #define KEY_PRINT 210 - = 219; // #define KEY_HP 211 - = 220; // #define KEY_CAMERA 212 - = 221; // #define KEY_SOUND 213 - = 222; // #define KEY_QUESTION 214 - = 223; // #define KEY_EMAIL 215 - = 224; // #define KEY_CHAT 216 - = 225; // #define KEY_SEARCH 217 - = 226; // #define KEY_CONNECT 218 - = 227; // #define KEY_FINANCE 219 - = 228; // #define KEY_SPORT 220 - = 229; // #define KEY_SHOP 221 - = 230; // #define KEY_ALTERASE 222 - = 231; // #define KEY_CANCEL 223 - = 232; // #define KEY_BRIGHTNESSDOWN 224 - = 233; // #define KEY_BRIGHTNESSUP 225 - = 234; // #define KEY_MEDIA 226 - = 235; // #define KEY_SWITCHVIDEOMODE 227 - = 236; // #define KEY_KBDILLUMTOGGLE 228 - = 237; // #define KEY_KBDILLUMDOWN 229 - = 238; // #define KEY_KBDILLUMUP 230 - = 239; // #define KEY_SEND 231 - = 240; // #define KEY_REPLY 232 - = 241; // #define KEY_FORWARDMAIL 233 - = 242; // #define KEY_SAVE 234 - = 243; // #define KEY_DOCUMENTS 235 - = 244; // #define KEY_BATTERY 236 - = 245; // #define KEY_BLUETOOTH 237 - = 246; // #define KEY_WLAN 238 - = 247; // #define KEY_UWB 239 - = 248; // #define KEY_UNKNOWN 240 - = 249; // #define KEY_VIDEO_NEXT 241 - = 250; // #define KEY_VIDEO_PREV 242 - = 251; // #define KEY_BRIGHTNESS_CYCLE 243 - = 252; // #define KEY_BRIGHTNESS_ZERO 244 - = 253; // #define KEY_DISPLAY_OFF 245 - - // Fake keycodes for virtual keys - = 92; - = 203; - = 204; - = 205; - = 206; - = 207; - - indicator 1 = "Caps Lock"; - indicator 2 = "Num Lock"; - indicator 3 = "Scroll Lock"; - indicator 4 = "Compose"; - indicator 5 = "Kana"; - indicator 6 = "Sleep"; - indicator 7 = "Suspend"; - indicator 8 = "Mute"; - indicator 9 = "Misc"; - indicator 10 = "Mail"; - indicator 11 = "Charging"; - - alias = ; - - // For Brazilian ABNT2 - alias = ; -}; - -// PC98 -xkb_keycodes "pc98" { - include "evdev(evdev)" -}; - +// translation from evdev scancodes to something resembling xfree86 keycodes. + +default xkb_keycodes "evdev" { + minimum = 8; + maximum = 255; + + # Added for pc105 compatibility + = 94; + + = 49; + = 10; + = 11; + = 12; + = 13; + = 14; + = 15; + = 16; + = 17; + = 18; + = 19; + = 20; + = 21; + = 22; + + = 23; + = 24; + = 25; + = 26; + = 27; + = 28; + = 29; + = 30; + = 31; + = 32; + = 33; + = 34; + = 35; + = 51; + alias = ; + = 36; + + = 66; + = 38; + = 39; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 48; + + = 50; + = 52; + = 53; + = 54; + = 55; + = 56; + = 57; + = 58; + = 59; + = 60; + = 61; + = 62; + + = 64; + = 37; + = 65; + = 105; + = 108; + // Microsoft keyboard extra keys + = 133; + = 134; + = 135; + alias = ; + + = 9; + = 67; + = 68; + = 69; + = 70; + = 71; + = 72; + = 73; + = 74; + = 75; + = 76; + = 95; + = 96; + + = 107; + // = 107; + = 78; + = 127; + // = 419; + + = 118; + = 110; + = 112; + = 119; + = 115; + = 117; + + = 111; + = 113; + = 116; + = 114; + + = 77; + = 106; + = 63; + = 82; + + = 79; + = 80; + = 81; + = 86; + + = 83; + = 84; + = 85; + + = 87; + = 88; + = 89; + = 104; + + = 90; + = 91; + = 125; + + = 191; + = 192; + = 193; + = 194; + = 195; + = 196; + = 197; + = 198; + = 199; + = 200; + = 201; + = 202; + + // Keys that are generated on Japanese keyboards + + // = 93; // Hankaku/Zenkakau toggle - not actually used + alias = ; + = 101; // Hiragana/Katakana toggle + = 97; // backslash/underscore + = 100; // Henkan + = 102; // Muhenkan + = 132; // Yen + = 98; // Katakana + = 99; // Hiragana + = 103; // KPJPComma + // = 97; // Romaji + + // Keys that are generated on Korean keyboards + + = 130; // Hangul Latin toggle + = 131; // Hangul to Hanja conversion + + // Solaris compatibility + + alias = ; + alias = ; + = 121; + = 122; + = 123; + = 124; + = 136; + = 137; + = 138; + = 139; + = 140; + = 141; + = 142; + = 143; + = 144; + = 145; + = 146; + + // Extended keys that may be generated on "Internet" keyboards. + // evdev has standardize names for these. + + = 109; // #define KEY_LINEFEED 101 + = 120; // #define KEY_MACRO 112 + = 126; // #define KEY_KPPLUSMINUS 118 + = 128; // #define KEY_SCALE 120 + = 129; // #define KEY_KPCOMMA 121 + = 147; // #define KEY_MENU 139 + = 148; // #define KEY_CALC 140 + = 149; // #define KEY_SETUP 141 + = 150; // #define KEY_SLEEP 142 + = 151; // #define KEY_WAKEUP 143 + = 152; // #define KEY_FILE 144 + = 153; // #define KEY_SENDFILE 145 + = 154; // #define KEY_DELETEFILE 146 + = 155; // #define KEY_XFER 147 + = 156; // #define KEY_PROG1 148 + = 157; // #define KEY_PROG2 149 + = 158; // #define KEY_WWW 150 + = 159; // #define KEY_MSDOS 151 + = 160; // #define KEY_COFFEE 152 + = 161; // #define KEY_DIRECTION 153 + = 162; // #define KEY_CYCLEWINDOWS 154 + = 163; // #define KEY_MAIL 155 + = 164; // #define KEY_BOOKMARKS 156 + = 165; // #define KEY_COMPUTER 157 + = 166; // #define KEY_BACK 158 + = 167; // #define KEY_FORWARD 159 + = 168; // #define KEY_CLOSECD 160 + = 169; // #define KEY_EJECTCD 161 + = 170; // #define KEY_EJECTCLOSECD 162 + = 171; // #define KEY_NEXTSONG 163 + = 172; // #define KEY_PLAYPAUSE 164 + = 173; // #define KEY_PREVIOUSSONG 165 + = 174; // #define KEY_STOPCD 166 + = 175; // #define KEY_RECORD 167 + = 176; // #define KEY_REWIND 168 + = 177; // #define KEY_PHONE 169 + = 178; // #define KEY_ISO 170 + = 179; // #define KEY_CONFIG 171 + = 180; // #define KEY_HOMEPAGE 172 + = 181; // #define KEY_REFRESH 173 + = 182; // #define KEY_EXIT 174 + = 183; // #define KEY_MOVE 175 + = 184; // #define KEY_EDIT 176 + = 185; // #define KEY_SCROLLUP 177 + = 186; // #define KEY_SCROLLDOWN 178 + = 187; // #define KEY_KPLEFTPAREN 179 + = 188; // #define KEY_KPRIGHTPAREN 180 + = 189; // #define KEY_NEW 181 + = 190; // #define KEY_REDO 182 + = 208; // #define KEY_PLAYCD 200 + = 209; // #define KEY_PAUSECD 201 + = 210; // #define KEY_PROG3 202 + = 211; // #define KEY_PROG4 203 conflicts with AB11 + = 212; // #define KEY_DASHBOARD 204 + = 213; // #define KEY_SUSPEND 205 + = 214; // #define KEY_CLOSE 206 + = 215; // #define KEY_PLAY 207 + = 216; // #define KEY_FASTFORWARD 208 + = 217; // #define KEY_BASSBOOST 209 + = 218; // #define KEY_PRINT 210 + = 219; // #define KEY_HP 211 + = 220; // #define KEY_CAMERA 212 + = 221; // #define KEY_SOUND 213 + = 222; // #define KEY_QUESTION 214 + = 223; // #define KEY_EMAIL 215 + = 224; // #define KEY_CHAT 216 + = 225; // #define KEY_SEARCH 217 + = 226; // #define KEY_CONNECT 218 + = 227; // #define KEY_FINANCE 219 + = 228; // #define KEY_SPORT 220 + = 229; // #define KEY_SHOP 221 + = 230; // #define KEY_ALTERASE 222 + = 231; // #define KEY_CANCEL 223 + = 232; // #define KEY_BRIGHTNESSDOWN 224 + = 233; // #define KEY_BRIGHTNESSUP 225 + = 234; // #define KEY_MEDIA 226 + = 235; // #define KEY_SWITCHVIDEOMODE 227 + = 236; // #define KEY_KBDILLUMTOGGLE 228 + = 237; // #define KEY_KBDILLUMDOWN 229 + = 238; // #define KEY_KBDILLUMUP 230 + = 239; // #define KEY_SEND 231 + = 240; // #define KEY_REPLY 232 + = 241; // #define KEY_FORWARDMAIL 233 + = 242; // #define KEY_SAVE 234 + = 243; // #define KEY_DOCUMENTS 235 + = 244; // #define KEY_BATTERY 236 + = 245; // #define KEY_BLUETOOTH 237 + = 246; // #define KEY_WLAN 238 + = 247; // #define KEY_UWB 239 + = 248; // #define KEY_UNKNOWN 240 + = 249; // #define KEY_VIDEO_NEXT 241 + = 250; // #define KEY_VIDEO_PREV 242 + = 251; // #define KEY_BRIGHTNESS_CYCLE 243 + = 252; // #define KEY_BRIGHTNESS_ZERO 244 + = 253; // #define KEY_DISPLAY_OFF 245 + + // Fake keycodes for virtual keys + = 92; + = 203; + = 204; + = 205; + = 206; + = 207; + + indicator 1 = "Caps Lock"; + indicator 2 = "Num Lock"; + indicator 3 = "Scroll Lock"; + indicator 4 = "Compose"; + indicator 5 = "Kana"; + indicator 6 = "Sleep"; + indicator 7 = "Suspend"; + indicator 8 = "Mute"; + indicator 9 = "Misc"; + indicator 10 = "Mail"; + indicator 11 = "Charging"; + + alias = ; + + // For Brazilian ABNT2 + alias = ; +}; + +// PC98 +xkb_keycodes "pc98" { + include "evdev(evdev)" +}; diff --git a/xorg-server/xkeyboard-config/keycodes/fujitsu b/xorg-server/xkeyboard-config/keycodes/fujitsu index c36a3a984..373621038 100644 --- a/xorg-server/xkeyboard-config/keycodes/fujitsu +++ b/xorg-server/xkeyboard-config/keycodes/fujitsu @@ -1,187 +1,186 @@ -// $Xorg: fujitsu,v 1.4 2001/02/09 02:05:52 xorgcvs Exp $ -// -//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. -// -default xkb_keycodes "138" { - - minimum= 8; - maximum= 255; - - = 37; - = 38; - = 39; - = 40; - = 41; - = 42; - = 43; - = 44; - = 45; - = 46; - = 47; - = 48; - = 49; - = 50; - = 51; - - = 61; - = 62; - = 63; - = 64; - = 65; - = 66; - = 67; - = 68; - = 69; - = 70; - = 71; - = 72; - = 73; - - = 84; - = 85; - = 86; - = 87; - = 88; - = 89; - = 90; - = 91; - = 92; - = 93; - = 94; - = 95; - = 96; - = 97; - - = 107; - = 108; - = 109; - = 110; - = 111; - = 112; - = 113; - = 114; - = 115; - = 116; - = 117; - = 52; - = 118; - - = 127; - = 27; - = 128; - = 125; - = 129; - = 10; - = 130; - = 23; - = 75; - = 119; - = 56; - - = 13; - = 14; - = 16; - = 18; - = 20; - = 22; - = 24; - = 25; - = 26; - = 15; - = 17; - = 19; - = 137; - = 138; - = 139; - = 140; - = 141; - = 142; - = 143; - = 144; - = 145; - = 146; - = 147; - = 148; - = 153; - = 154; - = 155; - = 156; - = 149; - = 150; - = 151; - = 152; - - = 34; - = 59; - = 81; - = 105; - = 126; - - = 9; - = 30; - = 21; - = 29; - - = 82; - = 83; - = 12; - = 35; - = 32; - = 36; - = 28; - = 74; - = 60; - = 33; - = 103; - = 57; - = 80; - = 11; - - = 55; - = 54; - = 133; - = 79; - - = 76; - = 77; - = 78; - = 53; - - = 99; - = 100; - = 101; - = 58; - - = 120; - = 121; - = 122; - = 98; - - = 102; - = 31; - - = 123; - = 124; -}; +// +//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. +// +default xkb_keycodes "138" { + + minimum= 8; + maximum= 255; + + = 37; + = 38; + = 39; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 48; + = 49; + = 50; + = 51; + + = 61; + = 62; + = 63; + = 64; + = 65; + = 66; + = 67; + = 68; + = 69; + = 70; + = 71; + = 72; + = 73; + + = 84; + = 85; + = 86; + = 87; + = 88; + = 89; + = 90; + = 91; + = 92; + = 93; + = 94; + = 95; + = 96; + = 97; + + = 107; + = 108; + = 109; + = 110; + = 111; + = 112; + = 113; + = 114; + = 115; + = 116; + = 117; + = 52; + = 118; + + = 127; + = 27; + = 128; + = 125; + = 129; + = 10; + = 130; + = 23; + = 75; + = 119; + = 56; + + = 13; + = 14; + = 16; + = 18; + = 20; + = 22; + = 24; + = 25; + = 26; + = 15; + = 17; + = 19; + = 137; + = 138; + = 139; + = 140; + = 141; + = 142; + = 143; + = 144; + = 145; + = 146; + = 147; + = 148; + = 153; + = 154; + = 155; + = 156; + = 149; + = 150; + = 151; + = 152; + + = 34; + = 59; + = 81; + = 105; + = 126; + + = 9; + = 30; + = 21; + = 29; + + = 82; + = 83; + = 12; + = 35; + = 32; + = 36; + = 28; + = 74; + = 60; + = 33; + = 103; + = 57; + = 80; + = 11; + + = 55; + = 54; + = 133; + = 79; + + = 76; + = 77; + = 78; + = 53; + + = 99; + = 100; + = 101; + = 58; + + = 120; + = 121; + = 122; + = 98; + + = 102; + = 31; + + = 123; + = 124; +}; diff --git a/xorg-server/xkeyboard-config/keycodes/hp b/xorg-server/xkeyboard-config/keycodes/hp index 0c98072d3..544389578 100644 --- a/xorg-server/xkeyboard-config/keycodes/hp +++ b/xorg-server/xkeyboard-config/keycodes/hp @@ -1,271 +1,270 @@ -// $Xorg: hp,v 1.4 2001/02/09 02:05:52 xorgcvs Exp $ -// -//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. -// -default xkb_keycodes "hp-101" { - - = 23; - = 31; - = 39; - = 47; - = 46; - = 55; - = 63; - = 70; - = 71; - = 79; - = 78; - = 87; - = 94; - = 111; - - = 22; - = 30; - = 38; - = 45; - = 54; - = 53; - = 62; - = 69; - = 76; - = 77; - = 86; - = 93; - = 100; - = 101; - - = 29; - = 37; - = 36; - = 44; - = 52; - = 61; - = 60; - = 68; - = 75; - = 84; - = 85; - = 91; - = 99; - - = 27; - = 35; - = 43; - = 42; - = 51; - = 59; - = 58; - = 67; - = 74; - = 82; - = 83; - = 98; - - = 26; - = 34; - = 50; - = 66; - = 97; - - = 17; - = 16; - = 24; - = 32; - = 40; - = 48; - = 56; - = 64; - = 72; - = 80; - = 88; - = 95; - = 103; - - = 96; - = 104; - = 107; - - = 112; - = 119; - = 120; - = 109; - = 110; - = 118; - - = 108; - = 106; - = 105; - = 115; - - = 127; - = 128; - = 135; - = 141; - - = 117; - = 126; - = 134; - = 133; - - = 116; - = 124; - = 125; - - = 114; - = 123; - = 131; - = 130; - - = 121; - = 122; - - indicator 1 = "Caps Lock"; - indicator 2 = "Num Lock"; - indicator 3 = "Scroll Lock"; -}; - -xkb_keycodes "hil" { - - = 71; - = 70; - = 69; - = 68; - = 67; - = 66; - = 65; - = 64; - = 96; - = 97; - = 98; - = 99; - = 100; - = 101; - - = 63; - = 62; - = 61; - = 60; - = 59; - = 58; - = 57; - = 56; - = 104; - = 105; - = 106; - = 107; - = 108; - = 109; - - = 55; - = 53; - = 52; - = 51; - = 50; - = 49; - = 48; - = 112; - = 113; - = 114; - = 115; - = 116; - = 117; - - = 13; - = 36; - = 35; - = 34; - = 33; - = 32; - = 128; - = 120; - = 121; - = 122; - = 123; - = 12; - - = 14; - = 11; - = 129; - = 10; - = 87; - - = 39; - = 15; - = 86; - = 84; - = 83; - = 82; - = 81; - = 80; - = 88; - = 89; - = 90; - = 91; - = 92; - = 45; - = 41; - = 43; - = 47; - = 94; - = 95; - - = 102; - = 103; - = 110; - = 111; - - = 118; - = 119; - = 127; - = 125; - - = 134; - = 132; - = 133; - = 135; - - = 25; - = 29; - = 27; - = 31; - - = 21; - = 17; - = 19; - = 23; - - = 16; - = 18; - = 20; - = 22; - - = 24; - = 26; - = 28; - = 46; - - = 30; - = 44; -}; +// +//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. +// +default xkb_keycodes "hp-101" { + + = 23; + = 31; + = 39; + = 47; + = 46; + = 55; + = 63; + = 70; + = 71; + = 79; + = 78; + = 87; + = 94; + = 111; + + = 22; + = 30; + = 38; + = 45; + = 54; + = 53; + = 62; + = 69; + = 76; + = 77; + = 86; + = 93; + = 100; + = 101; + + = 29; + = 37; + = 36; + = 44; + = 52; + = 61; + = 60; + = 68; + = 75; + = 84; + = 85; + = 91; + = 99; + + = 27; + = 35; + = 43; + = 42; + = 51; + = 59; + = 58; + = 67; + = 74; + = 82; + = 83; + = 98; + + = 26; + = 34; + = 50; + = 66; + = 97; + + = 17; + = 16; + = 24; + = 32; + = 40; + = 48; + = 56; + = 64; + = 72; + = 80; + = 88; + = 95; + = 103; + + = 96; + = 104; + = 107; + + = 112; + = 119; + = 120; + = 109; + = 110; + = 118; + + = 108; + = 106; + = 105; + = 115; + + = 127; + = 128; + = 135; + = 141; + + = 117; + = 126; + = 134; + = 133; + + = 116; + = 124; + = 125; + + = 114; + = 123; + = 131; + = 130; + + = 121; + = 122; + + indicator 1 = "Caps Lock"; + indicator 2 = "Num Lock"; + indicator 3 = "Scroll Lock"; +}; + +xkb_keycodes "hil" { + + = 71; + = 70; + = 69; + = 68; + = 67; + = 66; + = 65; + = 64; + = 96; + = 97; + = 98; + = 99; + = 100; + = 101; + + = 63; + = 62; + = 61; + = 60; + = 59; + = 58; + = 57; + = 56; + = 104; + = 105; + = 106; + = 107; + = 108; + = 109; + + = 55; + = 53; + = 52; + = 51; + = 50; + = 49; + = 48; + = 112; + = 113; + = 114; + = 115; + = 116; + = 117; + + = 13; + = 36; + = 35; + = 34; + = 33; + = 32; + = 128; + = 120; + = 121; + = 122; + = 123; + = 12; + + = 14; + = 11; + = 129; + = 10; + = 87; + + = 39; + = 15; + = 86; + = 84; + = 83; + = 82; + = 81; + = 80; + = 88; + = 89; + = 90; + = 91; + = 92; + = 45; + = 41; + = 43; + = 47; + = 94; + = 95; + + = 102; + = 103; + = 110; + = 111; + + = 118; + = 119; + = 127; + = 125; + + = 134; + = 132; + = 133; + = 135; + + = 25; + = 29; + = 27; + = 31; + + = 21; + = 17; + = 19; + = 23; + + = 16; + = 18; + = 20; + = 22; + + = 24; + = 26; + = 28; + = 46; + + = 30; + = 44; +}; diff --git a/xorg-server/xkeyboard-config/keycodes/ibm b/xorg-server/xkeyboard-config/keycodes/ibm index 303d4b360..3ce84a70a 100644 --- a/xorg-server/xkeyboard-config/keycodes/ibm +++ b/xorg-server/xkeyboard-config/keycodes/ibm @@ -1,151 +1,150 @@ -// $Xorg: ibm,v 1.4 2001/02/09 02:05:52 xorgcvs Exp $ -// -//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. -// -xkb_keycodes "rs6k-101" { - - = 9; - = 10; - = 11; - = 12; - = 13; - = 14; - = 15; - = 16; - = 17; - = 18; - = 19; - = 20; - = 21; - = 23; - - = 24; - = 25; - = 26; - = 27; - = 28; - = 29; - = 30; - = 31; - = 32; - = 33; - = 34; - = 35; - = 36; - = 37; - - = 38; - = 39; - = 40; - = 41; - = 42; - = 43; - = 44; - = 45; - = 46; - = 47; - = 48; - = 49; - = 51; - - = 52; - = 54; - = 55; - = 56; - = 57; - = 58; - = 59; - = 60; - = 61; - = 62; - = 63; - = 65; - - = 66; - = 68; - = 69; - = 70; - = 72; - - = 118; - = 120; - = 121; - = 122; - = 123; - = 124; - = 125; - = 126; - = 127; - = 128; - = 129; - = 130; - = 131; - - = 132; - = 133; - = 134; - - = 83; - = 88; - = 93; - = 84; - = 89; - = 94; - - = 91; - = 87; - = 92; - = 97; - - = 98; - = 103; - = 108; - = 113; - - = 99; - = 104; - = 109; - = 114; - - = 100; - = 105; - = 110; - - = 101; - = 106; - = 111; - = 116; - - = 107; - = 112; - - indicator 1 = "Caps Lock"; - indicator 2 = "Num Lock"; - indicator 3 = "Scroll Lock"; -}; -xkb_keycodes "rs6k-102" { - include "ibm(rs6k-101)" - = 53; -}; +// +//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. +// +xkb_keycodes "rs6k-101" { + + = 9; + = 10; + = 11; + = 12; + = 13; + = 14; + = 15; + = 16; + = 17; + = 18; + = 19; + = 20; + = 21; + = 23; + + = 24; + = 25; + = 26; + = 27; + = 28; + = 29; + = 30; + = 31; + = 32; + = 33; + = 34; + = 35; + = 36; + = 37; + + = 38; + = 39; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 48; + = 49; + = 51; + + = 52; + = 54; + = 55; + = 56; + = 57; + = 58; + = 59; + = 60; + = 61; + = 62; + = 63; + = 65; + + = 66; + = 68; + = 69; + = 70; + = 72; + + = 118; + = 120; + = 121; + = 122; + = 123; + = 124; + = 125; + = 126; + = 127; + = 128; + = 129; + = 130; + = 131; + + = 132; + = 133; + = 134; + + = 83; + = 88; + = 93; + = 84; + = 89; + = 94; + + = 91; + = 87; + = 92; + = 97; + + = 98; + = 103; + = 108; + = 113; + + = 99; + = 104; + = 109; + = 114; + + = 100; + = 105; + = 110; + + = 101; + = 106; + = 111; + = 116; + + = 107; + = 112; + + indicator 1 = "Caps Lock"; + indicator 2 = "Num Lock"; + indicator 3 = "Scroll Lock"; +}; +xkb_keycodes "rs6k-102" { + include "ibm(rs6k-101)" + = 53; +}; diff --git a/xorg-server/xkeyboard-config/keycodes/macintosh b/xorg-server/xkeyboard-config/keycodes/macintosh index 5b0a2614a..a6e6ee061 100644 --- a/xorg-server/xkeyboard-config/keycodes/macintosh +++ b/xorg-server/xkeyboard-config/keycodes/macintosh @@ -1,4 +1,3 @@ -// $XConsortium: macintosh /main/10 1996/01/24 12:17:35 kaleb $ // //Copyright (c) 1996 X Consortium // @@ -26,7 +25,6 @@ //other dealings in this Software without prior written authorization //from the X Consortium. // -// $XFree86: xc/programs/xkbcomp/keycodes/macintosh,v 1.4 2001/10/02 19:57:00 alanh Exp $ // default xkb_keycodes "macintosh" { include "xfree86" @@ -208,4 +206,3 @@ xkb_keycodes "jisevdev" { alias = ; // Switch to kana mode alias = ; // Switch to alphanumeric mode }; - diff --git a/xorg-server/xkeyboard-config/keycodes/sgi_vndr/indigo b/xorg-server/xkeyboard-config/keycodes/sgi_vndr/indigo index 6605ade53..2f5f45bfc 100644 --- a/xorg-server/xkeyboard-config/keycodes/sgi_vndr/indigo +++ b/xorg-server/xkeyboard-config/keycodes/sgi_vndr/indigo @@ -1,140 +1,139 @@ -// $Xorg: indigo,v 1.3 2000/08/17 19:54:39 cpqbld Exp $ -default xkb_keycodes "pc101" { - minimum= 8; - maximum= 255; - - = 62; - = 15; - = 21; - = 22; - = 29; - = 30; - = 37; - = 38; - = 45; - = 46; - = 53; - = 54; - = 61; - = 68; - - = 16; - = 17; - = 23; - = 24; - = 31; - = 32; - = 39; - = 40; - = 47; - = 48; - = 55; - = 56; - = 63; - = 58; - - = 11; - = 18; - = 19; - = 25; - = 26; - = 33; - = 34; - = 41; - = 42; - = 49; - = 50; - = 57; - - = 13; - = 27; - = 28; - = 35; - = 36; - = 43; - = 44; - = 51; - = 52; - = 59; - = 60; - = 12; - = 64; - - = 91; - = 10; - = 90; - = 93; - = 92; - - = 14; - = 94; - = 95; - = 96; - = 97; - = 98; - = 99; - = 100; - = 101; - = 102; - = 103; - = 104; - = 105; - - = 106; - = 107; - = 108; - - = 109; - = 110; - = 111; - = 69; - = 112; - = 113; - - = 88; - = 80; - = 81; - = 87; - - = 114; - = 115; - = 116; - = 83; - - = 74; - = 75; - = 82; - = 117; - - = 70; - = 76; - = 77; - - = 65; - = 71; - = 72; - = 89; - - = 66; - = 73; - - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - - virtual indicator 1 = "L1"; - virtual indicator 2 = "L2"; - virtual indicator 3 = "L3"; - virtual indicator 4 = "L4"; - indicator 5 = "Caps Lock"; - indicator 6 = "Num Lock"; - indicator 7 = "Scroll Lock"; -}; -xkb_keycodes "pc102" { - include "sgi_vndr/indigo(pc101)" - = 118; -}; +default xkb_keycodes "pc101" { + minimum= 8; + maximum= 255; + + = 62; + = 15; + = 21; + = 22; + = 29; + = 30; + = 37; + = 38; + = 45; + = 46; + = 53; + = 54; + = 61; + = 68; + + = 16; + = 17; + = 23; + = 24; + = 31; + = 32; + = 39; + = 40; + = 47; + = 48; + = 55; + = 56; + = 63; + = 58; + + = 11; + = 18; + = 19; + = 25; + = 26; + = 33; + = 34; + = 41; + = 42; + = 49; + = 50; + = 57; + + = 13; + = 27; + = 28; + = 35; + = 36; + = 43; + = 44; + = 51; + = 52; + = 59; + = 60; + = 12; + = 64; + + = 91; + = 10; + = 90; + = 93; + = 92; + + = 14; + = 94; + = 95; + = 96; + = 97; + = 98; + = 99; + = 100; + = 101; + = 102; + = 103; + = 104; + = 105; + + = 106; + = 107; + = 108; + + = 109; + = 110; + = 111; + = 69; + = 112; + = 113; + + = 88; + = 80; + = 81; + = 87; + + = 114; + = 115; + = 116; + = 83; + + = 74; + = 75; + = 82; + = 117; + + = 70; + = 76; + = 77; + + = 65; + = 71; + = 72; + = 89; + + = 66; + = 73; + + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + + virtual indicator 1 = "L1"; + virtual indicator 2 = "L2"; + virtual indicator 3 = "L3"; + virtual indicator 4 = "L4"; + indicator 5 = "Caps Lock"; + indicator 6 = "Num Lock"; + indicator 7 = "Scroll Lock"; +}; +xkb_keycodes "pc102" { + include "sgi_vndr/indigo(pc101)" + = 118; +}; diff --git a/xorg-server/xkeyboard-config/keycodes/sgi_vndr/indy b/xorg-server/xkeyboard-config/keycodes/sgi_vndr/indy index e16a0cbc1..aab3749b5 100644 --- a/xorg-server/xkeyboard-config/keycodes/sgi_vndr/indy +++ b/xorg-server/xkeyboard-config/keycodes/sgi_vndr/indy @@ -1,203 +1,202 @@ -// $Xorg: indy,v 1.3 2000/08/17 19:54:39 cpqbld Exp $ -default xkb_keycodes "universal" { - minimum= 8; - maximum= 255; - include "sgi_vndr/indy(pc105)" - alternate = 91; - alternate = 100; - alternate = 101; -}; -xkb_keycodes "pc101" { - minimum= 8; - maximum= 255; - - = 22; - = 30; - = 38; - = 46; - = 45; - = 54; - = 62; - = 69; - = 70; - = 78; - = 77; - = 86; - = 93; - = 110; - - = 21; - = 29; - = 37; - = 44; - = 53; - = 52; - = 61; - = 68; - = 75; - = 76; - = 85; - = 92; - = 99; - = 98; - - = 28; - = 36; - = 35; - = 43; - = 51; - = 60; - = 59; - = 67; - = 74; - = 83; - = 84; - = 90; - - = 26; - = 34; - = 42; - = 41; - = 50; - = 58; - = 57; - = 66; - = 73; - = 81; - = 82; - = 97; - = 100; - - = 33; - = 25; - = 49; - = 96; - = 65; - - = 16; - = 15; - = 23; - = 31; - = 39; - = 47; - = 55; - = 63; - = 71; - = 79; - = 87; - = 94; - = 102; - - = 95; - = 103; - = 106; - - = 111; - = 118; - = 119; - = 108; - = 109; - = 117; - - = 107; - = 105; - = 104; - = 114; - - = 126; - = 127; - = 134; - = 140; - - = 116; - = 125; - = 133; - = 132; - - = 115; - = 123; - = 124; - - = 113; - = 122; - = 130; - = 129; - - = 120; - = 121; - - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - - virtual indicator 1 = "L1"; - virtual indicator 2 = "L2"; - virtual indicator 3 = "L3"; - virtual indicator 4 = "L4"; - indicator 5 = "Caps Lock"; - indicator 6 = "Num Lock"; - indicator 7 = "Scroll Lock"; - -}; -xkb_keycodes "pc102" { - = 91; - = 27; - augment "sgi_vndr/indy(pc101)" - maximum= 255; - minimum= 8; -}; -xkb_keycodes "pc104" { - include "sgi_vndr/indy(pc101)" - minimum= 8; - maximum= 255; - - // These key names are here to support so-called "Windows95" - // keyboards like the Microsoft Natural keyboard. - = 147; - = 148; - = 149; -}; -xkb_keycodes "pc105" { - = 27; - augment "sgi_vndr/indy(pc104)" - minimum= 8; - maximum= 255; -}; -xkb_keycodes "jp106" { - = 22; - = 89; - = 91; - = 141; - = 142; - = 143; - alias = ; - alias = ; - alias = ; - augment "sgi_vndr/indy(pc101)" - minimum= 8; - maximum= 255; -}; -// can be combined with any other "indy" keycode -// description to add virtual keys which can be -// used to implement an overlay-based numeric -// keypad. -partial hidden xkb_keycodes "overlayKeypad" { - = 17; - = 18; - = 19; - = 146; - = 145; - = 144; - = 136; - = 137; - = 138; - = 135; - = 139; -}; -partial hidden xkb_keycodes "shiftLock" { - indicator 5 = "Shift Lock"; -}; +default xkb_keycodes "universal" { + minimum= 8; + maximum= 255; + include "sgi_vndr/indy(pc105)" + alternate = 91; + alternate = 100; + alternate = 101; +}; +xkb_keycodes "pc101" { + minimum= 8; + maximum= 255; + + = 22; + = 30; + = 38; + = 46; + = 45; + = 54; + = 62; + = 69; + = 70; + = 78; + = 77; + = 86; + = 93; + = 110; + + = 21; + = 29; + = 37; + = 44; + = 53; + = 52; + = 61; + = 68; + = 75; + = 76; + = 85; + = 92; + = 99; + = 98; + + = 28; + = 36; + = 35; + = 43; + = 51; + = 60; + = 59; + = 67; + = 74; + = 83; + = 84; + = 90; + + = 26; + = 34; + = 42; + = 41; + = 50; + = 58; + = 57; + = 66; + = 73; + = 81; + = 82; + = 97; + = 100; + + = 33; + = 25; + = 49; + = 96; + = 65; + + = 16; + = 15; + = 23; + = 31; + = 39; + = 47; + = 55; + = 63; + = 71; + = 79; + = 87; + = 94; + = 102; + + = 95; + = 103; + = 106; + + = 111; + = 118; + = 119; + = 108; + = 109; + = 117; + + = 107; + = 105; + = 104; + = 114; + + = 126; + = 127; + = 134; + = 140; + + = 116; + = 125; + = 133; + = 132; + + = 115; + = 123; + = 124; + + = 113; + = 122; + = 130; + = 129; + + = 120; + = 121; + + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + + virtual indicator 1 = "L1"; + virtual indicator 2 = "L2"; + virtual indicator 3 = "L3"; + virtual indicator 4 = "L4"; + indicator 5 = "Caps Lock"; + indicator 6 = "Num Lock"; + indicator 7 = "Scroll Lock"; + +}; +xkb_keycodes "pc102" { + = 91; + = 27; + augment "sgi_vndr/indy(pc101)" + maximum= 255; + minimum= 8; +}; +xkb_keycodes "pc104" { + include "sgi_vndr/indy(pc101)" + minimum= 8; + maximum= 255; + + // These key names are here to support so-called "Windows95" + // keyboards like the Microsoft Natural keyboard. + = 147; + = 148; + = 149; +}; +xkb_keycodes "pc105" { + = 27; + augment "sgi_vndr/indy(pc104)" + minimum= 8; + maximum= 255; +}; +xkb_keycodes "jp106" { + = 22; + = 89; + = 91; + = 141; + = 142; + = 143; + alias = ; + alias = ; + alias = ; + augment "sgi_vndr/indy(pc101)" + minimum= 8; + maximum= 255; +}; +// can be combined with any other "indy" keycode +// description to add virtual keys which can be +// used to implement an overlay-based numeric +// keypad. +partial hidden xkb_keycodes "overlayKeypad" { + = 17; + = 18; + = 19; + = 146; + = 145; + = 144; + = 136; + = 137; + = 138; + = 135; + = 139; +}; +partial hidden xkb_keycodes "shiftLock" { + indicator 5 = "Shift Lock"; +}; diff --git a/xorg-server/xkeyboard-config/keycodes/sgi_vndr/iris b/xorg-server/xkeyboard-config/keycodes/sgi_vndr/iris index a4118a6b4..18068175d 100644 --- a/xorg-server/xkeyboard-config/keycodes/sgi_vndr/iris +++ b/xorg-server/xkeyboard-config/keycodes/sgi_vndr/iris @@ -1,11 +1,10 @@ -// $Xorg: iris,v 1.3 2000/08/17 19:54:39 cpqbld Exp $ -default xkb_keycodes "iris" { - include "sgi_vndr/indigo(pc101)" - indicator 1 = "L1"; - indicator 2 = "L2"; - indicator 3 = "L3"; - indicator 4 = "L4"; - indicator 5 = "Caps Lock"; - indicator 6 = "Num Lock"; - indicator 7 = "Scroll Lock"; -}; +default xkb_keycodes "iris" { + include "sgi_vndr/indigo(pc101)" + indicator 1 = "L1"; + indicator 2 = "L2"; + indicator 3 = "L3"; + indicator 4 = "L4"; + indicator 5 = "Caps Lock"; + indicator 6 = "Num Lock"; + indicator 7 = "Scroll Lock"; +}; diff --git a/xorg-server/xkeyboard-config/keycodes/sony b/xorg-server/xkeyboard-config/keycodes/sony index 0e720b422..def1eaf6b 100644 --- a/xorg-server/xkeyboard-config/keycodes/sony +++ b/xorg-server/xkeyboard-config/keycodes/sony @@ -1,142 +1,141 @@ -// $Xorg: sony,v 1.4 2001/02/09 02:05:52 xorgcvs Exp $ -// -//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. -// -xkb_keycodes "nwp5461" { - - = 18; - = 19; - = 20; - = 21; - = 22; - = 23; - = 24; - = 25; - = 26; - = 27; - = 28; - = 29; - = 30; - = 31; - = 32; - - = 33; - = 34; - = 35; - = 36; - = 37; - = 38; - = 39; - = 40; - = 41; - = 42; - = 43; - = 44; - = 45; - = 46; - - = 47; - = 48; - = 49; - = 50; - = 51; - = 52; - = 53; - = 54; - = 55; - = 56; - = 57; - = 58; - = 59; - = 60; - - = 61; - = 62; - = 63; - = 64; - = 65; - = 66; - = 67; - = 68; - = 69; - = 70; - = 71; - = 72; - = 73; - - = 74; - = 75; - = 76; - = 77; - = 78; - = 81; - - = 8; - = 9; - = 10; - = 11; - = 12; - = 13; - = 14; - = 15; - = 16; - = 17; - = 111; - = 112; - - = 113; - = 114; - = 115; - = 116; - = 117; - - = 109; - = 95; - = 98; - = 99; - = 100; - - = 107; - = 108; - = 89; - - = 82; - = 83; - = 84; - = 85; - - = 86; - = 87; - = 88; - = 93; - - = 90; - = 91; - = 92; - = 97; - - = 94; - = 96; -}; +// +//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. +// +xkb_keycodes "nwp5461" { + + = 18; + = 19; + = 20; + = 21; + = 22; + = 23; + = 24; + = 25; + = 26; + = 27; + = 28; + = 29; + = 30; + = 31; + = 32; + + = 33; + = 34; + = 35; + = 36; + = 37; + = 38; + = 39; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + + = 47; + = 48; + = 49; + = 50; + = 51; + = 52; + = 53; + = 54; + = 55; + = 56; + = 57; + = 58; + = 59; + = 60; + + = 61; + = 62; + = 63; + = 64; + = 65; + = 66; + = 67; + = 68; + = 69; + = 70; + = 71; + = 72; + = 73; + + = 74; + = 75; + = 76; + = 77; + = 78; + = 81; + + = 8; + = 9; + = 10; + = 11; + = 12; + = 13; + = 14; + = 15; + = 16; + = 17; + = 111; + = 112; + + = 113; + = 114; + = 115; + = 116; + = 117; + + = 109; + = 95; + = 98; + = 99; + = 100; + + = 107; + = 108; + = 89; + + = 82; + = 83; + = 84; + = 85; + + = 86; + = 87; + = 88; + = 93; + + = 90; + = 91; + = 92; + = 97; + + = 94; + = 96; +}; diff --git a/xorg-server/xkeyboard-config/keycodes/sun b/xorg-server/xkeyboard-config/keycodes/sun index a6ffdb39f..7cb38e304 100644 --- a/xorg-server/xkeyboard-config/keycodes/sun +++ b/xorg-server/xkeyboard-config/keycodes/sun @@ -1,954 +1,950 @@ -// $XdotOrg: $ -// $Xorg: sun,v 1.4 2001/02/09 02:05:52 xorgcvs Exp $ -// -//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. -// -// --------------------------------------------------------------------------- -// Copyright 2004 Sun Microsystems, 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 (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. -// -// --------------------------------------------------------------------------- -// -// $XFree86: xc/programs/xkbcomp/keycodes/sun,v 3.6 2003/08/09 14:30:48 pascal Exp $ -// - -default xkb_keycodes "type4" { - - minimum= 8; - maximum= 255; - - = 36; - = 37; - = 38; - = 39; - = 40; - = 41; - = 42; - = 43; - = 44; - = 45; - = 46; - = 47; - = 48; - = 49; - = 50; - - = 60; - = 61; - = 62; - = 63; - = 64; - = 65; - = 66; - = 67; - = 68; - = 69; - = 70; - = 71; - = 72; - = 73; - - = 83; - = 84; - = 85; - = 86; - = 87; - = 88; - = 89; - = 90; - = 91; - = 92; - = 93; - = 94; - = 95; - = 96; - - = 106; - = 107; - = 108; - = 109; - = 110; - = 111; - = 112; - = 113; - = 114; - = 115; - = 116; - = 117; - = 118; - - = 125; - = 126; - = 26; - = 127; - = 128; - = 129; - = 74; - = 20; - alias = ; - - = 12; - = 13; - = 15; - = 17; - = 19; - = 21; - = 23; - = 24; - = 25; - = 14; - = 16; - = 18; - - = 8; - = 10; - = 32; - = 33; - = 56; - = 58; - = 79; - = 80; - = 102; - = 104; - - = 29; - = 30; - = 28; - - = 105; - = 52; - = 53; - = 54; - = 78; - - = 75; - = 76; - = 77; - = 132; - - = 98; - = 99; - = 100; - - = 119; - = 120; - = 121; - = 97; - - = 101; - = 57; - indicator 4 = "Caps Lock"; - indicator 3 = "Compose"; - indicator 2 = "Scroll Lock"; - indicator 1 = "Num Lock"; -}; - -xkb_keycodes "type5" { - - minimum= 8; - maximum= 255; - - = 36; - = 37; - = 38; - = 39; - = 40; - = 41; - = 42; - = 43; - = 44; - = 45; - = 46; - = 47; - = 48; - = 49; - = 50; - - = 60; - = 61; - = 62; - = 63; - = 64; - = 65; - = 66; - = 67; - = 68; - = 69; - = 70; - = 71; - = 72; - = 73; - = 74; - = 20; - alias = ; - - = 83; - = 84; - = 85; - = 86; - = 87; - = 88; - = 89; - = 90; - = 91; - = 92; - = 93; - = 94; - = 95; - = 96; - - = 106; - = 107; - = 108; - = 109; - = 110; - = 111; - = 112; - = 113; - = 114; - = 115; - = 116; - = 117; - - = 26; - = 126; - = 127; - = 128; - = 129; - - = 12; - = 13; - = 15; - = 17; - = 19; - = 21; - = 23; - = 24; - = 25; - = 14; - = 16; - = 18; - = 8; - = 10; - = 32; - = 33; - = 56; - = 58; - = 79; - = 80; - = 102; - = 104; - - = 29; - = 30; - = 28; - - = 105; - = 53; - = 54; - = 78; - - = 75; - = 76; - = 77; - = 132; - - = 98; - = 99; - = 100; - - = 119; - = 120; - = 121; - = 97; - - = 101; - = 57; - - = 27; - = 31; - = 34; - = 35; - - = 51; - = 59; - = 81; - = 103; - = 130; - = 125; - - = 52; - = 9; - = 11; - = 55; - indicator 4 = "Caps Lock"; - indicator 3 = "Compose"; - indicator 2 = "Scroll Lock"; - indicator 1 = "Num Lock"; -}; - -xkb_keycodes "type4tuv" { - include "sun(type4)" - = 131; - = 22; -}; - -xkb_keycodes "type4_ca" { - include "sun(type4)" - = 131; -}; - -xkb_keycodes "type4_jp" { - include "sun(type4)" - = 122; - = 123; - = 124; - = 22; - alias = ; -}; - -xkb_keycodes "type4_euro" { - include "sun(type4)" - = 131; -}; - -xkb_keycodes "type5tuv" { - include "sun(type5)" - = 131; -}; - -xkb_keycodes "type5_jp" { - include "sun(type5)" - = 122; - = 123; - = 124; - = 118; -}; - -xkb_keycodes "type5_euro" { - include "sun(type5)" - = 131; -}; - -xkb_keycodes "type5hobo" { - - minimum= 8; - maximum= 255; - - = 36; - = 37; - = 38; - = 39; - = 40; - = 41; - = 42; - = 43; - = 44; - = 45; - = 46; - = 47; - = 48; - = 49; - = 50; - - = 60; - = 61; - = 62; - = 63; - = 64; - = 65; - = 66; - = 67; - = 68; - = 69; - = 70; - = 71; - = 72; - = 73; - = 74; - = 20; - alias = ; - - = 83; - = 84; - = 85; - = 86; - = 87; - = 88; - = 89; - = 90; - = 91; - = 92; - = 93; - = 94; - = 95; - = 96; - - = 106; - = 107; - = 108; - = 109; - = 110; - = 111; - = 112; - = 113; - = 114; - = 115; - = 116; - = 117; - - = 26; - = 126; - = 127; - = 128; - = 129; - - = 12; - = 13; - = 15; - = 17; - = 19; - = 21; - = 23; - = 24; - = 25; - = 14; - = 16; - = 18; - = 8; - = 10; - = 32; - = 33; - = 56; - = 58; - = 79; - = 80; - = 102; - = 104; - - = 29; - = 30; - = 28; - - = 105; -// = 53; -// = 54; -// = 78; - -// = 75; -// = 76; -// = 77; -// = 132; - -// = 98; -// = 99; -// = 100; - -// = 119; -// = 120; -// = 121; -// = 97; - -// = 101; -// = 57; - - = 27; - = 31; - = 34; - = 35; - - = 51; - = 59; - = 81; - = 103; - = 130; - = 125; - - = 52; - = 9; - = 11; - = 55; - indicator 4 = "Caps Lock"; - indicator 3 = "Compose"; - indicator 2 = "Scroll Lock"; - indicator 1 = "Num Lock"; -}; - -xkb_keycodes "type5tuvhobo" { - include "sun(type5hobo)" - = 131; - -}; - -xkb_keycodes "type5_jphobo" { - include "sun(type5hobo)" - = 122; - = 123; - = 124; - = 118; -}; - -xkb_keycodes "type6" { - include "sun(type5)" -}; - -xkb_keycodes "type6tuv" { - include "sun(type5tuv)" -}; - -xkb_keycodes "type6unix" { - include "sun(type5)" -}; - -xkb_keycodes "type6_jp" { - include "sun(type5_jp)" -}; - -xkb_keycodes "type6_euro" { - include "sun(type5_euro)" -}; - -// Even though this is labeled as _usb, I verified these keycodes as accurate -// on my type5 serial and type6 serial keyboards as well on linux-2.6 boxes. -// I'm not sure where the "type5" keycodes above are coming from... -xkb_keycodes "type6_usb" { - include "xfree86" - - = 232; - = 133; - = 134; - = 135; - = 140; - = 248; - = 191; - = 192; - = 122; - = 188; - - = 245; - - // The blank has keycode 239 on my type6 serial kb, but 134 on - // my type6 usb keyboard (same as ) - = 239; - - // AltGr + PrScr actually sends a different keycode - = 92; - - = 160; - = 174; - = 176; - = 222; - - indicator 4 = "Compose"; -}; - -xkb_keycodes "type6tuv_usb" { - include "sun(type6_usb)" - = 94; -// = 51; -}; - -xkb_keycodes "type6_jp_usb" { - include "sun(type6_usb)" - alias = ; // 123 - alias = ; // 139 - alias = ; // 138 - alias = ; // 129 - indicator 5 = "Kana"; -}; - -xkb_keycodes "type5_se" { - - minimum= 8; - maximum= 255; - - // Row G - = 125; - // - = 36; - // - = 12; - = 13; - = 15; - = 17; - // - = 19; - = 21; - = 23; - = 24; - // - = 25; - = 14; - = 16; - = 18; - // - = 29; - = 30; - = 28; - // - = 52; - = 9; - = 11; - = 55; - // End Row G - - // Row F - // - // End Row F - - // Row E - = 8; - = 10; - // - = 49; - alias = ; - = 37; - = 38; - = 39; - = 40; - = 41; - = 42; - = 43; - = 44; - = 45; - = 46; - = 47; - = 48; - = 50; - // - = 51; - = 59; - = 103; - // - = 105; - = 53; - = 54; - = 78; - //End Row E - - // Row D - = 32; - = 33; - // - = 60; - alias = ; - = 61; - = 62; - = 63; - = 64; - = 65; - = 66; - = 67; - = 68; - = 69; - = 70; - = 71; - = 72; - // - = 73; - = 81; - = 130; - // - = 75; - = 76; - = 77; - = 132; - // End Row D - - // Row C - = 56; - = 58; - // - = 126; - alias = ; - = 84; - = 85; - = 86; - = 87; - = 88; - = 89; - = 90; - = 91; - = 92; - = 93; - = 94; - = 95; - alias = ; - = 96; - // - = 98; - = 99; - = 100; - // End Row C - - // Row B - = 79; - = 80; - // - = 106; - = 131; - alias = ; - = 107; - = 108; - = 109; - = 110; - = 111; - = 112; - = 113; - = 114; - = 115; - = 116; - = 117; - // - = 27; - // - = 119; - = 120; - = 121; - = 97; - // End Row B - - // Row A - = 102; - = 104; - // - = 83; - = 26; - = 127; - = 128; - = 129; - = 74; - = 20; - alias = ; - // - = 31; - = 34; - = 35; - // - = 101; - = 57; - // End Row A - - indicator 4 = "Caps Lock"; - indicator 3 = "Compose"; - indicator 2 = "Scroll Lock"; - indicator 1 = "Num Lock"; -}; - -xkb_keycodes "type5c_se" { - include "sun(type5_se)" -}; - -xkb_keycodes "type4__se" { - - minimum= 8; - maximum= 255; - - // Row F - = 8; - = 10; - // - = 12; - = 13; - = 15; - = 17; - = 19; - = 21; - = 23; - = 24; - = 25; - = 14; - = 16; - = 18; - = 95; - alias = ; - = 22; - = 73; - // - = 28; - = 29; - = 30; - = 105; - // End Row F - - // Row E - = 32; - = 33; - // - = 36; - alias = ; - = 37; - = 38; - = 39; - = 40; - = 41; - = 42; - = 43; - = 44; - = 45; - = 46; - = 47; - = 48; - = 50; - // - = 52; - = 53; - = 54; - = 78; - // End Row E - - // Row D - = 56; - = 58; - // - = 60; - alias = ; - = 61; - = 62; - = 63; - = 64; - = 65; - = 66; - = 67; - = 68; - = 69; - = 70; - = 71; - = 72; - // - = 75; - = 76; - = 77; - = 132; - // End Row D - - // Row C - = 79; - = 80; - // - = 83; - // alias = ; - = 84; - = 85; - = 86; - = 87; - = 88; - = 89; - = 90; - = 91; - = 92; - = 93; - = 94; - = 49; - alias = ; - = 96; - // - = 98; - = 99; - = 100; - // End Row C - - // Row B - = 102; - = 104; - // - = 106; - = 131; - alias = ; - = 107; - = 108; - = 109; - = 110; - = 111; - = 112; - = 113; - = 114; - = 115; - = 116; - = 117; - = 118; - // - = 119; - = 120; - = 121; - = 97; - // End Row B - - // Row A - = 125; - // - = 126; - // alias = ; - = 26; - = 127; - = 128; - = 129; - = 74; - = 20; - alias = ; - // - = 101; - = 57; - // End Row A - - indicator 4 = "Caps Lock"; - indicator 3 = "Compose"; - indicator 2 = "Scroll Lock"; - indicator 1 = "Num Lock"; -}; - -xkb_keycodes "type4_se" { - - include "sun(type4__se)" - - alias = ; - alias = ; -}; - -xkb_keycodes "type4_se_swapctl" { - - include "sun(type4__se)" - - alias = ; - alias = ; -}; +// +//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. +// +// --------------------------------------------------------------------------- +// Copyright 2004 Sun Microsystems, 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 (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. +// +// --------------------------------------------------------------------------- +// + +default xkb_keycodes "type4" { + + minimum= 8; + maximum= 255; + + = 36; + = 37; + = 38; + = 39; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 48; + = 49; + = 50; + + = 60; + = 61; + = 62; + = 63; + = 64; + = 65; + = 66; + = 67; + = 68; + = 69; + = 70; + = 71; + = 72; + = 73; + + = 83; + = 84; + = 85; + = 86; + = 87; + = 88; + = 89; + = 90; + = 91; + = 92; + = 93; + = 94; + = 95; + = 96; + + = 106; + = 107; + = 108; + = 109; + = 110; + = 111; + = 112; + = 113; + = 114; + = 115; + = 116; + = 117; + = 118; + + = 125; + = 126; + = 26; + = 127; + = 128; + = 129; + = 74; + = 20; + alias = ; + + = 12; + = 13; + = 15; + = 17; + = 19; + = 21; + = 23; + = 24; + = 25; + = 14; + = 16; + = 18; + + = 8; + = 10; + = 32; + = 33; + = 56; + = 58; + = 79; + = 80; + = 102; + = 104; + + = 29; + = 30; + = 28; + + = 105; + = 52; + = 53; + = 54; + = 78; + + = 75; + = 76; + = 77; + = 132; + + = 98; + = 99; + = 100; + + = 119; + = 120; + = 121; + = 97; + + = 101; + = 57; + indicator 4 = "Caps Lock"; + indicator 3 = "Compose"; + indicator 2 = "Scroll Lock"; + indicator 1 = "Num Lock"; +}; + +xkb_keycodes "type5" { + + minimum= 8; + maximum= 255; + + = 36; + = 37; + = 38; + = 39; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 48; + = 49; + = 50; + + = 60; + = 61; + = 62; + = 63; + = 64; + = 65; + = 66; + = 67; + = 68; + = 69; + = 70; + = 71; + = 72; + = 73; + = 74; + = 20; + alias = ; + + = 83; + = 84; + = 85; + = 86; + = 87; + = 88; + = 89; + = 90; + = 91; + = 92; + = 93; + = 94; + = 95; + = 96; + + = 106; + = 107; + = 108; + = 109; + = 110; + = 111; + = 112; + = 113; + = 114; + = 115; + = 116; + = 117; + + = 26; + = 126; + = 127; + = 128; + = 129; + + = 12; + = 13; + = 15; + = 17; + = 19; + = 21; + = 23; + = 24; + = 25; + = 14; + = 16; + = 18; + = 8; + = 10; + = 32; + = 33; + = 56; + = 58; + = 79; + = 80; + = 102; + = 104; + + = 29; + = 30; + = 28; + + = 105; + = 53; + = 54; + = 78; + + = 75; + = 76; + = 77; + = 132; + + = 98; + = 99; + = 100; + + = 119; + = 120; + = 121; + = 97; + + = 101; + = 57; + + = 27; + = 31; + = 34; + = 35; + + = 51; + = 59; + = 81; + = 103; + = 130; + = 125; + + = 52; + = 9; + = 11; + = 55; + indicator 4 = "Caps Lock"; + indicator 3 = "Compose"; + indicator 2 = "Scroll Lock"; + indicator 1 = "Num Lock"; +}; + +xkb_keycodes "type4tuv" { + include "sun(type4)" + = 131; + = 22; +}; + +xkb_keycodes "type4_ca" { + include "sun(type4)" + = 131; +}; + +xkb_keycodes "type4_jp" { + include "sun(type4)" + = 122; + = 123; + = 124; + = 22; + alias = ; +}; + +xkb_keycodes "type4_euro" { + include "sun(type4)" + = 131; +}; + +xkb_keycodes "type5tuv" { + include "sun(type5)" + = 131; +}; + +xkb_keycodes "type5_jp" { + include "sun(type5)" + = 122; + = 123; + = 124; + = 118; +}; + +xkb_keycodes "type5_euro" { + include "sun(type5)" + = 131; +}; + +xkb_keycodes "type5hobo" { + + minimum= 8; + maximum= 255; + + = 36; + = 37; + = 38; + = 39; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 48; + = 49; + = 50; + + = 60; + = 61; + = 62; + = 63; + = 64; + = 65; + = 66; + = 67; + = 68; + = 69; + = 70; + = 71; + = 72; + = 73; + = 74; + = 20; + alias = ; + + = 83; + = 84; + = 85; + = 86; + = 87; + = 88; + = 89; + = 90; + = 91; + = 92; + = 93; + = 94; + = 95; + = 96; + + = 106; + = 107; + = 108; + = 109; + = 110; + = 111; + = 112; + = 113; + = 114; + = 115; + = 116; + = 117; + + = 26; + = 126; + = 127; + = 128; + = 129; + + = 12; + = 13; + = 15; + = 17; + = 19; + = 21; + = 23; + = 24; + = 25; + = 14; + = 16; + = 18; + = 8; + = 10; + = 32; + = 33; + = 56; + = 58; + = 79; + = 80; + = 102; + = 104; + + = 29; + = 30; + = 28; + + = 105; +// = 53; +// = 54; +// = 78; + +// = 75; +// = 76; +// = 77; +// = 132; + +// = 98; +// = 99; +// = 100; + +// = 119; +// = 120; +// = 121; +// = 97; + +// = 101; +// = 57; + + = 27; + = 31; + = 34; + = 35; + + = 51; + = 59; + = 81; + = 103; + = 130; + = 125; + + = 52; + = 9; + = 11; + = 55; + indicator 4 = "Caps Lock"; + indicator 3 = "Compose"; + indicator 2 = "Scroll Lock"; + indicator 1 = "Num Lock"; +}; + +xkb_keycodes "type5tuvhobo" { + include "sun(type5hobo)" + = 131; + +}; + +xkb_keycodes "type5_jphobo" { + include "sun(type5hobo)" + = 122; + = 123; + = 124; + = 118; +}; + +xkb_keycodes "type6" { + include "sun(type5)" +}; + +xkb_keycodes "type6tuv" { + include "sun(type5tuv)" +}; + +xkb_keycodes "type6unix" { + include "sun(type5)" +}; + +xkb_keycodes "type6_jp" { + include "sun(type5_jp)" +}; + +xkb_keycodes "type6_euro" { + include "sun(type5_euro)" +}; + +// Even though this is labeled as _usb, I verified these keycodes as accurate +// on my type5 serial and type6 serial keyboards as well on linux-2.6 boxes. +// I'm not sure where the "type5" keycodes above are coming from... +xkb_keycodes "type6_usb" { + include "xfree86" + + = 232; + = 133; + = 134; + = 135; + = 140; + = 248; + = 191; + = 192; + = 122; + = 188; + + = 245; + + // The blank has keycode 239 on my type6 serial kb, but 134 on + // my type6 usb keyboard (same as ) + = 239; + + // AltGr + PrScr actually sends a different keycode + = 92; + + = 160; + = 174; + = 176; + = 222; + + indicator 4 = "Compose"; +}; + +xkb_keycodes "type6tuv_usb" { + include "sun(type6_usb)" + = 94; +// = 51; +}; + +xkb_keycodes "type6_jp_usb" { + include "sun(type6_usb)" + alias = ; // 123 + alias = ; // 139 + alias = ; // 138 + alias = ; // 129 + indicator 5 = "Kana"; +}; + +xkb_keycodes "type5_se" { + + minimum= 8; + maximum= 255; + + // Row G + = 125; + // + = 36; + // + = 12; + = 13; + = 15; + = 17; + // + = 19; + = 21; + = 23; + = 24; + // + = 25; + = 14; + = 16; + = 18; + // + = 29; + = 30; + = 28; + // + = 52; + = 9; + = 11; + = 55; + // End Row G + + // Row F + // + // End Row F + + // Row E + = 8; + = 10; + // + = 49; + alias = ; + = 37; + = 38; + = 39; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 48; + = 50; + // + = 51; + = 59; + = 103; + // + = 105; + = 53; + = 54; + = 78; + //End Row E + + // Row D + = 32; + = 33; + // + = 60; + alias = ; + = 61; + = 62; + = 63; + = 64; + = 65; + = 66; + = 67; + = 68; + = 69; + = 70; + = 71; + = 72; + // + = 73; + = 81; + = 130; + // + = 75; + = 76; + = 77; + = 132; + // End Row D + + // Row C + = 56; + = 58; + // + = 126; + alias = ; + = 84; + = 85; + = 86; + = 87; + = 88; + = 89; + = 90; + = 91; + = 92; + = 93; + = 94; + = 95; + alias = ; + = 96; + // + = 98; + = 99; + = 100; + // End Row C + + // Row B + = 79; + = 80; + // + = 106; + = 131; + alias = ; + = 107; + = 108; + = 109; + = 110; + = 111; + = 112; + = 113; + = 114; + = 115; + = 116; + = 117; + // + = 27; + // + = 119; + = 120; + = 121; + = 97; + // End Row B + + // Row A + = 102; + = 104; + // + = 83; + = 26; + = 127; + = 128; + = 129; + = 74; + = 20; + alias = ; + // + = 31; + = 34; + = 35; + // + = 101; + = 57; + // End Row A + + indicator 4 = "Caps Lock"; + indicator 3 = "Compose"; + indicator 2 = "Scroll Lock"; + indicator 1 = "Num Lock"; +}; + +xkb_keycodes "type5c_se" { + include "sun(type5_se)" +}; + +xkb_keycodes "type4__se" { + + minimum= 8; + maximum= 255; + + // Row F + = 8; + = 10; + // + = 12; + = 13; + = 15; + = 17; + = 19; + = 21; + = 23; + = 24; + = 25; + = 14; + = 16; + = 18; + = 95; + alias = ; + = 22; + = 73; + // + = 28; + = 29; + = 30; + = 105; + // End Row F + + // Row E + = 32; + = 33; + // + = 36; + alias = ; + = 37; + = 38; + = 39; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 48; + = 50; + // + = 52; + = 53; + = 54; + = 78; + // End Row E + + // Row D + = 56; + = 58; + // + = 60; + alias = ; + = 61; + = 62; + = 63; + = 64; + = 65; + = 66; + = 67; + = 68; + = 69; + = 70; + = 71; + = 72; + // + = 75; + = 76; + = 77; + = 132; + // End Row D + + // Row C + = 79; + = 80; + // + = 83; + // alias = ; + = 84; + = 85; + = 86; + = 87; + = 88; + = 89; + = 90; + = 91; + = 92; + = 93; + = 94; + = 49; + alias = ; + = 96; + // + = 98; + = 99; + = 100; + // End Row C + + // Row B + = 102; + = 104; + // + = 106; + = 131; + alias = ; + = 107; + = 108; + = 109; + = 110; + = 111; + = 112; + = 113; + = 114; + = 115; + = 116; + = 117; + = 118; + // + = 119; + = 120; + = 121; + = 97; + // End Row B + + // Row A + = 125; + // + = 126; + // alias = ; + = 26; + = 127; + = 128; + = 129; + = 74; + = 20; + alias = ; + // + = 101; + = 57; + // End Row A + + indicator 4 = "Caps Lock"; + indicator 3 = "Compose"; + indicator 2 = "Scroll Lock"; + indicator 1 = "Num Lock"; +}; + +xkb_keycodes "type4_se" { + + include "sun(type4__se)" + + alias = ; + alias = ; +}; + +xkb_keycodes "type4_se_swapctl" { + + include "sun(type4__se)" + + alias = ; + alias = ; +}; diff --git a/xorg-server/xkeyboard-config/keycodes/xfree86 b/xorg-server/xkeyboard-config/keycodes/xfree86 index bf91fa8ff..7d4813e89 100644 --- a/xorg-server/xkeyboard-config/keycodes/xfree86 +++ b/xorg-server/xkeyboard-config/keycodes/xfree86 @@ -1,415 +1,407 @@ -// $XdotOrg: xc/programs/xkbcomp/keycodes/xfree86,v 1.1.4.4 2004/03/05 13:41:30 eich Exp $ -// $Xorg: xfree86,v 1.3 2000/08/17 19:54:37 cpqbld Exp $ - - - - -// $XFree86: xc/programs/xkbcomp/keycodes/xfree86,v 3.28 2003/11/21 04:46:42 dawes Exp $ - -// "standard" XFree86 codes -// It seems that the "default" must be the first entry in the file. - -default xkb_keycodes "xfree86" { - include "xfree86(basic)" - = 51; - alias = ; - = 94; -}; - -xkb_keycodes "basic" { - - minimum= 8; - maximum= 255; - - = 49; - alias = ; // Some geometries use AE00 - = 10; - = 11; - = 12; - = 13; - = 14; - = 15; - = 16; - = 17; - = 18; - = 19; - = 20; - = 21; - = 22; - - = 23; - = 24; - = 25; - = 26; - = 27; - = 28; - = 29; - = 30; - = 31; - = 32; - = 33; - = 34; - = 35; - = 36; - - = 66; - = 38; - = 39; - = 40; - = 41; - = 42; - = 43; - = 44; - = 45; - = 46; - = 47; - = 48; - - = 50; - = 52; - = 53; - = 54; - = 55; - = 56; - = 57; - = 58; - = 59; - = 60; - = 61; - = 62; - - = 64; - = 37; - = 65; - = 109; - = 113; - // Microsoft keyboard extra keys - = 115; - = 116; - = 117; - - = 9; - = 67; - = 68; - = 69; - = 70; - = 71; - = 72; - = 73; - = 74; - = 75; - = 76; - = 95; - = 96; - - = 111; - = 92; - = 78; - = 110; - = 114; - - = 106; - = 97; - = 99; - = 107; - = 103; - = 105; - - = 98; - = 100; - = 104; - = 102; - - = 77; - = 112; - = 63; - = 82; - - = 79; - = 80; - = 81; - = 86; - - = 83; - = 84; - = 85; - - = 87; - = 88; - = 89; - = 108; - - = 90; - = 91; - = 126; - - = 118; - = 119; - = 120; - = 121; - = 122; - = 123; - - // Keys that are generated on Japanese keyboards - - alias = ; // Hankaku_Zenkaku toggle - = 208; // Hiragana_Katakana toggle - = 211; // backslash/underscore - = 129; // Henkan - = 131; // Muhenkan - = 133; // Yen - = 210; // Alphanumeric mode on macintosh - = 209; // Kana mode on macintosh - - // Keys that are generated on Korean keyboards - - alias = ; // Hangul Latin toggle - alias = ; // Hangul to Hanja conversion - - // Extended keys that may be generated on "Internet" keyboards. - // These are not standardised, hence the meaningless names. - // The entries commented out are never generated because the raw codes - // in those positions are already used for well-defined keys. - - alias = ; - = 130; - alias = ; - = 132; - alias = ; - = 134; - = 135; - = 136; - = 137; - = 138; - = 139; - = 140; - = 141; - = 142; - = 143; - = 144; - = 145; - = 146; - = 147; - = 148; - = 149; - = 150; - = 151; - = 152; - = 153; - = 154; - = 155; - // = 156; - // = 157; - = 158; - = 159; - = 160; - = 161; - = 162; - = 163; - = 164; - = 165; - = 166; - = 167; - = 168; - = 169; - // = 170; - = 171; - = 172; - = 173; - = 174; - = 175; - = 176; - = 177; - = 178; - = 179; - = 180; - // = 181; - // = 182; - // = 183; - // = 184; - = 185; - = 186; - = 187; - = 188; - // = 189; - // = 190; - // = 191; - // = 192; - // = 193; - = 194; - = 195; - = 196; - = 197; - // = 198; - // = 199; - // = 200; - // = 201; - = 202; - // = 203; - // = 204; - // = 205; - // = 206; - // = 207; - // = 208; - // = 209; - // = 210; - // = 211; - = 212; - = 213; - = 214; - = 215; - = 216; - = 217; - = 218; - // = 219; - // = 220; - // = 221; - = 222; - = 223; - = 224; - = 225; - = 226; - = 227; - = 228; - = 229; - = 230; - = 231; - = 232; - = 233; - = 234; - = 235; - = 236; - = 237; - = 238; - = 239; - = 240; - = 241; - = 242; - = 243; - = 244; - = 245; - = 246; - = 247; - = 248; - = 249; - = 250; - = 251; - = 252; - = 253; - = 254; - = 255; - - // MacBooks generate 0x65 for the lower brightness key - = 101; - - // Codes generated for scancodes 0x59-0x5f, 0x62-0x76 - = 157; // - = 170; // - = 181; // - alias = ; - = 182; // - = 183; // - = 184; // - = 189; // - = 190; // - = 191; // - = 192; // - = 193; // - = 198; // - = 199; // - = 200; // - = 201; // - = 203; // - = 204; // - = 205; // - = 206; // - = 207; // - alias = ; // - alias = ; // - alias = ; // - alias = ; // - = 219; // - = 220; // - = 221; // - - // Solaris compatibility - - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - alias = ; - - // Other codes never generated. The XFree86 ddx never generates - // these codes. - // Thus we can use them as fake keys - = 93; // - = 124; // - = 125; // - = 156; // - = 127; // - = 128; // - - indicator 1 = "Caps Lock"; - indicator 2 = "Num Lock"; - indicator 3 = "Scroll Lock"; - - alias = ; - - // For Brazilian ABNT2 - alias = ; -}; - -// What keyboard is this? - -xkb_keycodes "102" { - include "xfree86(xfree86)" - - // There will be warnings from xkbcomp because of multiple definitions. - - = 122; - = 123; - - = 121; - = 118; - - = 131; - = 135; - = 119; - = 129; - = 130; - = 134; - - = 128; - = 132; - = 120; - = 133; - - = 125; - - = 124; -}; - - -// IBM ThinkPad Z60m/Z60t/Z61m/Z61t -xkb_keycodes "thinkpadz60" { - include "xfree86(xfree86)" - = 227; -}; +// "standard" XFree86 codes +// It seems that the "default" must be the first entry in the file. + +default xkb_keycodes "xfree86" { + include "xfree86(basic)" + = 51; + alias = ; + = 94; +}; + +xkb_keycodes "basic" { + + minimum= 8; + maximum= 255; + + = 49; + alias = ; // Some geometries use AE00 + = 10; + = 11; + = 12; + = 13; + = 14; + = 15; + = 16; + = 17; + = 18; + = 19; + = 20; + = 21; + = 22; + + = 23; + = 24; + = 25; + = 26; + = 27; + = 28; + = 29; + = 30; + = 31; + = 32; + = 33; + = 34; + = 35; + = 36; + + = 66; + = 38; + = 39; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 48; + + = 50; + = 52; + = 53; + = 54; + = 55; + = 56; + = 57; + = 58; + = 59; + = 60; + = 61; + = 62; + + = 64; + = 37; + = 65; + = 109; + = 113; + // Microsoft keyboard extra keys + = 115; + = 116; + = 117; + + = 9; + = 67; + = 68; + = 69; + = 70; + = 71; + = 72; + = 73; + = 74; + = 75; + = 76; + = 95; + = 96; + + = 111; + = 92; + = 78; + = 110; + = 114; + + = 106; + = 97; + = 99; + = 107; + = 103; + = 105; + + = 98; + = 100; + = 104; + = 102; + + = 77; + = 112; + = 63; + = 82; + + = 79; + = 80; + = 81; + = 86; + + = 83; + = 84; + = 85; + + = 87; + = 88; + = 89; + = 108; + + = 90; + = 91; + = 126; + + = 118; + = 119; + = 120; + = 121; + = 122; + = 123; + + // Keys that are generated on Japanese keyboards + + alias = ; // Hankaku_Zenkaku toggle + = 208; // Hiragana_Katakana toggle + = 211; // backslash/underscore + = 129; // Henkan + = 131; // Muhenkan + = 133; // Yen + = 210; // Alphanumeric mode on macintosh + = 209; // Kana mode on macintosh + + // Keys that are generated on Korean keyboards + + alias = ; // Hangul Latin toggle + alias = ; // Hangul to Hanja conversion + + // Extended keys that may be generated on "Internet" keyboards. + // These are not standardised, hence the meaningless names. + // The entries commented out are never generated because the raw codes + // in those positions are already used for well-defined keys. + + alias = ; + = 130; + alias = ; + = 132; + alias = ; + = 134; + = 135; + = 136; + = 137; + = 138; + = 139; + = 140; + = 141; + = 142; + = 143; + = 144; + = 145; + = 146; + = 147; + = 148; + = 149; + = 150; + = 151; + = 152; + = 153; + = 154; + = 155; + // = 156; + // = 157; + = 158; + = 159; + = 160; + = 161; + = 162; + = 163; + = 164; + = 165; + = 166; + = 167; + = 168; + = 169; + // = 170; + = 171; + = 172; + = 173; + = 174; + = 175; + = 176; + = 177; + = 178; + = 179; + = 180; + // = 181; + // = 182; + // = 183; + // = 184; + = 185; + = 186; + = 187; + = 188; + // = 189; + // = 190; + // = 191; + // = 192; + // = 193; + = 194; + = 195; + = 196; + = 197; + // = 198; + // = 199; + // = 200; + // = 201; + = 202; + // = 203; + // = 204; + // = 205; + // = 206; + // = 207; + // = 208; + // = 209; + // = 210; + // = 211; + = 212; + = 213; + = 214; + = 215; + = 216; + = 217; + = 218; + // = 219; + // = 220; + // = 221; + = 222; + = 223; + = 224; + = 225; + = 226; + = 227; + = 228; + = 229; + = 230; + = 231; + = 232; + = 233; + = 234; + = 235; + = 236; + = 237; + = 238; + = 239; + = 240; + = 241; + = 242; + = 243; + = 244; + = 245; + = 246; + = 247; + = 248; + = 249; + = 250; + = 251; + = 252; + = 253; + = 254; + = 255; + + // MacBooks generate 0x65 for the lower brightness key + = 101; + + // Codes generated for scancodes 0x59-0x5f, 0x62-0x76 + = 157; // + = 170; // + = 181; // + alias = ; + = 182; // + = 183; // + = 184; // + = 189; // + = 190; // + = 191; // + = 192; // + = 193; // + = 198; // + = 199; // + = 200; // + = 201; // + = 203; // + = 204; // + = 205; // + = 206; // + = 207; // + alias = ; // + alias = ; // + alias = ; // + alias = ; // + = 219; // + = 220; // + = 221; // + + // Solaris compatibility + + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + alias = ; + + // Other codes never generated. The XFree86 ddx never generates + // these codes. + // Thus we can use them as fake keys + = 93; // + = 124; // + = 125; // + = 156; // + = 127; // + = 128; // + + indicator 1 = "Caps Lock"; + indicator 2 = "Num Lock"; + indicator 3 = "Scroll Lock"; + + alias = ; + + // For Brazilian ABNT2 + alias = ; +}; + +// What keyboard is this? + +xkb_keycodes "102" { + include "xfree86(xfree86)" + + // There will be warnings from xkbcomp because of multiple definitions. + + = 122; + = 123; + + = 121; + = 118; + + = 131; + = 135; + = 119; + = 129; + = 130; + = 134; + + = 128; + = 132; + = 120; + = 133; + + = 125; + + = 124; +}; + + +// IBM ThinkPad Z60m/Z60t/Z61m/Z61t +xkb_keycodes "thinkpadz60" { + include "xfree86(xfree86)" + = 227; +}; diff --git a/xorg-server/xkeyboard-config/keycodes/xfree98 b/xorg-server/xkeyboard-config/keycodes/xfree98 index 59483caf3..3faea5ca5 100644 --- a/xorg-server/xkeyboard-config/keycodes/xfree98 +++ b/xorg-server/xkeyboard-config/keycodes/xfree98 @@ -1,155 +1,152 @@ -// $Xorg: xfree98,v 1.4 2001/02/09 02:05:52 xorgcvs Exp $ -// -//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. -// -// $XFree86: xc/programs/xkbcomp/keycodes/xfree98,v 3.6 2001/01/17 23:45:51 dawes Exp $ -// -default xkb_keycodes "pc98" { - - minimum= 8; - maximum= 255; - - = 8; - = 9; - = 10; - = 11; - = 12; - = 13; - = 14; - = 15; - = 16; - = 17; - = 18; - = 19; - = 20; - = 21; - = 22; - - = 23; - = 24; - = 25; - = 26; - = 27; - = 28; - = 29; - = 30; - = 31; - = 32; - = 33; - = 34; - = 35; - = 36; - - = 124; - = 121; - = 37; - = 38; - = 39; - = 40; - = 41; - = 42; - = 43; - = 44; - = 45; - = 46; - = 47; - = 48; - - = 120; - = 49; - = 50; - = 51; - = 52; - = 53; - = 54; - = 55; - = 56; - = 57; - = 58; - = 59; - - = 122; - = 123; - = 89; - = 60; - = 61; - - = 104; - = 105; - = 106; - = 107; - = 108; - = 109; - = 110; - = 111; - = 112; - = 113; - = 114; - = 115; - = 90; - = 91; - = 92; - = 93; - = 94; - - - = 64; - = 65; - = 63; - = 62; - = 66; - = 67; - = 68; - = 69; - - = 70; - = 71; - - = 72; - = 73; - - = 74; - = 75; - = 76; - = 77; - - = 78; - = 79; - = 80; - = 81; - - = 82; - = 83; - = 84; - = 85; - - = 86; - = 87; - = 88; - - indicator 1 = "Caps Lock"; - indicator 2 = "Kana"; -}; - +// +//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. +// +// +default xkb_keycodes "pc98" { + + minimum= 8; + maximum= 255; + + = 8; + = 9; + = 10; + = 11; + = 12; + = 13; + = 14; + = 15; + = 16; + = 17; + = 18; + = 19; + = 20; + = 21; + = 22; + + = 23; + = 24; + = 25; + = 26; + = 27; + = 28; + = 29; + = 30; + = 31; + = 32; + = 33; + = 34; + = 35; + = 36; + + = 124; + = 121; + = 37; + = 38; + = 39; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 48; + + = 120; + = 49; + = 50; + = 51; + = 52; + = 53; + = 54; + = 55; + = 56; + = 57; + = 58; + = 59; + + = 122; + = 123; + = 89; + = 60; + = 61; + + = 104; + = 105; + = 106; + = 107; + = 108; + = 109; + = 110; + = 111; + = 112; + = 113; + = 114; + = 115; + = 90; + = 91; + = 92; + = 93; + = 94; + + + = 64; + = 65; + = 63; + = 62; + = 66; + = 67; + = 68; + = 69; + + = 70; + = 71; + + = 72; + = 73; + + = 74; + = 75; + = 76; + = 77; + + = 78; + = 79; + = 80; + = 81; + + = 82; + = 83; + = 84; + = 85; + + = 86; + = 87; + = 88; + + indicator 1 = "Caps Lock"; + indicator 2 = "Kana"; +}; diff --git a/xorg-server/xkeyboard-config/keymap/amiga b/xorg-server/xkeyboard-config/keymap/amiga index d697a986b..10a7142a6 100644 --- a/xorg-server/xkeyboard-config/keymap/amiga +++ b/xorg-server/xkeyboard-config/keymap/amiga @@ -1,22 +1,15 @@ -// $Xorg: amiga,v 1.3 2000/08/17 19:54:40 cpqbld Exp $ - - - - -// $XFree86: xc/programs/xkbcomp/keymap/amiga,v 3.2 1997/10/26 13:25:36 dawes Exp $ - -default xkb_keymap "usa1" { - xkb_keycodes { include "amiga(usa1)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "amiga(usa1)" }; - xkb_geometry { include "amiga(usa1)" }; -}; - -xkb_keymap "de" { - xkb_keycodes { include "amiga(de)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "amiga(de)" }; - xkb_geometry { include "amiga(de)" }; -}; +default xkb_keymap "usa1" { + xkb_keycodes { include "amiga(usa1)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "amiga(usa1)" }; + xkb_geometry { include "amiga(usa1)" }; +}; + +xkb_keymap "de" { + xkb_keycodes { include "amiga(de)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "amiga(de)" }; + xkb_geometry { include "amiga(de)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/ataritt b/xorg-server/xkeyboard-config/keymap/ataritt index b801ac291..1f8449131 100644 --- a/xorg-server/xkeyboard-config/keymap/ataritt +++ b/xorg-server/xkeyboard-config/keymap/ataritt @@ -1,21 +1,14 @@ -// $Xorg: ataritt,v 1.3 2000/08/17 19:54:40 cpqbld Exp $ - - - - -// $XFree86: xc/programs/xkbcomp/keymap/ataritt,v 3.1 1997/10/26 13:25:37 dawes Exp $ - -default xkb_keymap "us" { - xkb_keycodes { include "ataritt(us)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "ataritt(us)" }; - xkb_geometry { include "ataritt(us)" }; -}; -xkb_keymap "de" { - xkb_keycodes { include "ataritt(de)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "ataritt(de)" }; - xkb_geometry { include "ataritt(de)" }; -}; +default xkb_keymap "us" { + xkb_keycodes { include "ataritt(us)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "ataritt(us)" }; + xkb_geometry { include "ataritt(us)" }; +}; +xkb_keymap "de" { + xkb_keycodes { include "ataritt(de)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "ataritt(de)" }; + xkb_geometry { include "ataritt(de)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/digital_vndr/us b/xorg-server/xkeyboard-config/keymap/digital_vndr/us index 7f5180e2c..8a600fc2e 100644 --- a/xorg-server/xkeyboard-config/keymap/digital_vndr/us +++ b/xorg-server/xkeyboard-config/keymap/digital_vndr/us @@ -1,188 +1,187 @@ -// $Xorg: us,v 1.3 2000/08/17 19:54:40 cpqbld Exp $ -// -//Copyright (c) 1996 Digital Equipment Corporation -// -//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. -// -// HISTORY -// Log: us,v -// Revision 1.3 1996/06/18 09:14:51 erik -// use flags correctly, assorted cleanups and consortium fixes -// -// Revision 1.1.6.2 1995/10/25 21:00:53 William_Walker -// Add pc104-key support -// [1995/10/23 15:46:24 William_Walker] -// -// Revision 1.1.2.6 1995/06/27 12:18:05 William_Walker -// Add LK201 and LK450 support as well as TW and DP variants. -// [1995/06/26 20:26:19 William_Walker] -// -// Revision 1.1.2.5 1995/06/05 19:23:12 William_Walker -// New file. I love keymaps. -// [1995/06/05 18:14:04 William_Walker] -// -// EndLog -// -// @(#)RCSfile: us,v Revision: 1.3 (DEC) Date: 1996/02/02 14:21:15 -// - -// ************************************************************** -// * * -// * Keymaps for en_US.ISO8859-1 - English for U.S. * -// * * -// ************************************************************** - -xkb_keymap "lk201" { - xkb_keycodes { include "digital_vndr/lk(lk201)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "digital_vndr/us(vt105)" }; - xkb_geometry { description = "Digital US LK201"; - include "digital_vndr/lk(lk201)" }; -}; - -xkb_keymap "lk401" { - xkb_keycodes { include "digital_vndr/lk(lk401)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "digital_vndr/us(vt108)" }; - xkb_geometry { description = "Digital US LK401"; - include "digital_vndr/lk(lk401)" }; -}; - -xkb_keymap "lk411" { - xkb_keycodes { include "digital_vndr/pc(lk411)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "digital_vndr/us(vt108)" }; - xkb_geometry { description = "Digital US LK411"; - include "digital_vndr/lk(lk401)" }; -}; - -xkb_keymap "lk421" { - xkb_keycodes { include "digital_vndr/lk(lk421)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "digital_vndr/us(unix)" }; - xkb_geometry { description = "Digital US LK421"; - include "digital_vndr/unix(unix)" }; -}; - -xkb_keymap "lk441" { - xkb_keycodes { include "digital_vndr/lk(lk443)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "digital_vndr/us(lk44x)" }; - xkb_geometry { description = "Digital US LK441"; - include "digital_vndr/pc(pc101)" - include "digital_vndr/pc(leds_alone)" }; -}; - -xkb_keymap "lk443" { - xkb_keycodes { include "digital_vndr/lk(lk443)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "digital_vndr/us(lk44x)" }; - xkb_geometry { description = "Digital US LK443"; - include "digital_vndr/pc(pc101)" - include "digital_vndr/pc(leds_alone)" }; -}; - -xkb_keymap "lk44x" { - xkb_keycodes { include "digital_vndr/lk(lk443)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "digital_vndr/us(lk44x)" }; - xkb_geometry { description = "Digital US LK443"; - include "digital_vndr/pc(pc101)" - include "digital_vndr/pc(leds_alone)" }; -}; - -xkb_keymap "lk450" { - xkb_keycodes { include "digital_vndr/pc(lk450)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "digital_vndr/us(vt108)" }; - xkb_geometry { description = "Digital US LK450"; - include "digital_vndr/lk(lk450)" }; -}; - -xkb_keymap "pcxalaa" { - xkb_keycodes { include "digital_vndr/pc(pc101)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "digital_vndr/us(pcxalaa)" }; - xkb_geometry { description = "Digital US PCXAL-AA"; - include "digital_vndr/pc(pc101)" - include "digital_vndr/pc(leds_alone)" }; -}; - -xkb_keymap "pcxalfa" { - xkb_keycodes { include "digital_vndr/pc(pc101)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "digital_vndr/us(pcxalfa)" }; - xkb_geometry { description = "Digital US PCXAL-FA"; - include "digital_vndr/pc(pc101)" - include "digital_vndr/pc(leds_on_keys)" }; -}; - -xkb_keymap "pcxalga" { - xkb_keycodes { include "digital_vndr/pc(pc101)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "digital_vndr/us(pcxalga)" }; - xkb_geometry { description = "Digital US PCXAL-GA"; - include "digital_vndr/pc(pc101)" - include "digital_vndr/pc(leds_alone)" }; -}; - -xkb_keymap "pcxalka" { - xkb_keycodes { include "digital_vndr/pc(pc101)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "digital_vndr/us(pcxalka)" }; - xkb_geometry { description = "Digital US PCXAL-KA"; - include "digital_vndr/pc(pc101)" - include "digital_vndr/pc(leds_alone)" }; -}; - -xkb_keymap "pcxal" { - xkb_keycodes { include "digital_vndr/pc(pc101)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "digital_vndr/us(pcxal)" }; - xkb_geometry { description = "Digital US PCXAL"; - include "digital_vndr/pc(pc101)" - include "digital_vndr/pc(leds_alone)" }; -}; - -xkb_keymap "mnk" { - xkb_keycodes { include "digital_vndr/pc(pc104)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "digital_vndr/us(pc104)" }; - xkb_geometry { include "microsoft" }; -}; +// +//Copyright (c) 1996 Digital Equipment Corporation +// +//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. +// +// HISTORY +// Log: us,v +// Revision 1.3 1996/06/18 09:14:51 erik +// use flags correctly, assorted cleanups and consortium fixes +// +// Revision 1.1.6.2 1995/10/25 21:00:53 William_Walker +// Add pc104-key support +// [1995/10/23 15:46:24 William_Walker] +// +// Revision 1.1.2.6 1995/06/27 12:18:05 William_Walker +// Add LK201 and LK450 support as well as TW and DP variants. +// [1995/06/26 20:26:19 William_Walker] +// +// Revision 1.1.2.5 1995/06/05 19:23:12 William_Walker +// New file. I love keymaps. +// [1995/06/05 18:14:04 William_Walker] +// +// EndLog +// +// @(#)RCSfile: us,v Revision: 1.3 (DEC) Date: 1996/02/02 14:21:15 +// + +// ************************************************************** +// * * +// * Keymaps for en_US.ISO8859-1 - English for U.S. * +// * * +// ************************************************************** + +xkb_keymap "lk201" { + xkb_keycodes { include "digital_vndr/lk(lk201)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "digital_vndr/us(vt105)" }; + xkb_geometry { description = "Digital US LK201"; + include "digital_vndr/lk(lk201)" }; +}; + +xkb_keymap "lk401" { + xkb_keycodes { include "digital_vndr/lk(lk401)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "digital_vndr/us(vt108)" }; + xkb_geometry { description = "Digital US LK401"; + include "digital_vndr/lk(lk401)" }; +}; + +xkb_keymap "lk411" { + xkb_keycodes { include "digital_vndr/pc(lk411)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "digital_vndr/us(vt108)" }; + xkb_geometry { description = "Digital US LK411"; + include "digital_vndr/lk(lk401)" }; +}; + +xkb_keymap "lk421" { + xkb_keycodes { include "digital_vndr/lk(lk421)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "digital_vndr/us(unix)" }; + xkb_geometry { description = "Digital US LK421"; + include "digital_vndr/unix(unix)" }; +}; + +xkb_keymap "lk441" { + xkb_keycodes { include "digital_vndr/lk(lk443)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "digital_vndr/us(lk44x)" }; + xkb_geometry { description = "Digital US LK441"; + include "digital_vndr/pc(pc101)" + include "digital_vndr/pc(leds_alone)" }; +}; + +xkb_keymap "lk443" { + xkb_keycodes { include "digital_vndr/lk(lk443)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "digital_vndr/us(lk44x)" }; + xkb_geometry { description = "Digital US LK443"; + include "digital_vndr/pc(pc101)" + include "digital_vndr/pc(leds_alone)" }; +}; + +xkb_keymap "lk44x" { + xkb_keycodes { include "digital_vndr/lk(lk443)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "digital_vndr/us(lk44x)" }; + xkb_geometry { description = "Digital US LK443"; + include "digital_vndr/pc(pc101)" + include "digital_vndr/pc(leds_alone)" }; +}; + +xkb_keymap "lk450" { + xkb_keycodes { include "digital_vndr/pc(lk450)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "digital_vndr/us(vt108)" }; + xkb_geometry { description = "Digital US LK450"; + include "digital_vndr/lk(lk450)" }; +}; + +xkb_keymap "pcxalaa" { + xkb_keycodes { include "digital_vndr/pc(pc101)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "digital_vndr/us(pcxalaa)" }; + xkb_geometry { description = "Digital US PCXAL-AA"; + include "digital_vndr/pc(pc101)" + include "digital_vndr/pc(leds_alone)" }; +}; + +xkb_keymap "pcxalfa" { + xkb_keycodes { include "digital_vndr/pc(pc101)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "digital_vndr/us(pcxalfa)" }; + xkb_geometry { description = "Digital US PCXAL-FA"; + include "digital_vndr/pc(pc101)" + include "digital_vndr/pc(leds_on_keys)" }; +}; + +xkb_keymap "pcxalga" { + xkb_keycodes { include "digital_vndr/pc(pc101)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "digital_vndr/us(pcxalga)" }; + xkb_geometry { description = "Digital US PCXAL-GA"; + include "digital_vndr/pc(pc101)" + include "digital_vndr/pc(leds_alone)" }; +}; + +xkb_keymap "pcxalka" { + xkb_keycodes { include "digital_vndr/pc(pc101)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "digital_vndr/us(pcxalka)" }; + xkb_geometry { description = "Digital US PCXAL-KA"; + include "digital_vndr/pc(pc101)" + include "digital_vndr/pc(leds_alone)" }; +}; + +xkb_keymap "pcxal" { + xkb_keycodes { include "digital_vndr/pc(pc101)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "digital_vndr/us(pcxal)" }; + xkb_geometry { description = "Digital US PCXAL"; + include "digital_vndr/pc(pc101)" + include "digital_vndr/pc(leds_alone)" }; +}; + +xkb_keymap "mnk" { + xkb_keycodes { include "digital_vndr/pc(pc104)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "digital_vndr/us(pc104)" }; + xkb_geometry { include "microsoft" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/macintosh b/xorg-server/xkeyboard-config/keymap/macintosh index de115badc..345667054 100644 --- a/xorg-server/xkeyboard-config/keymap/macintosh +++ b/xorg-server/xkeyboard-config/keymap/macintosh @@ -1,17 +1,15 @@ -// $XConsortium: macintosh /main/11 1996/03/07 13:42:13 kaleb $ -// $XFree86: xc/programs/xkbcomp/keymap/macintosh,v 1.1 1999/05/23 05:27:51 dawes Exp $ -default xkb_keymap "macintosh" { - xkb_keycodes { include "macintosh" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "macintosh_vndr/us(extended)" }; - xkb_geometry { include "macintosh" }; -}; - -xkb_keymap "macintosh_old" { - xkb_keycodes { include "macintosh(old)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "macintosh_vndr/us(extended)" }; - xkb_geometry { include "macintosh" }; -}; +default xkb_keymap "macintosh" { + xkb_keycodes { include "macintosh" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "macintosh_vndr/us(extended)" }; + xkb_geometry { include "macintosh" }; +}; + +xkb_keymap "macintosh_old" { + xkb_keycodes { include "macintosh(old)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "macintosh_vndr/us(extended)" }; + xkb_geometry { include "macintosh" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/be b/xorg-server/xkeyboard-config/keymap/sgi_vndr/be index 9905f0ba6..1301e5596 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/be +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/be @@ -1,34 +1,32 @@ -// $Xorg: be,v 1.3 2000/08/17 19:54:40 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc_universal)+be" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal_nodeadkeys)+be(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc102)+be" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102_nodeadkeys)+be(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; - +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc_universal)+be" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal_nodeadkeys)+be(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc102)+be" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102_nodeadkeys)+be(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/bg b/xorg-server/xkeyboard-config/keymap/sgi_vndr/bg index a3cb08a22..556f1146b 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/bg +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/bg @@ -1,19 +1,18 @@ -// $Xorg: bg,v 1.3 2000/08/17 19:54:40 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "us(pc_universal)+bg+group(shifts_toggle)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "us(pc102)+bg+group(shifts_toggle)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "us(pc_universal)+bg+group(shifts_toggle)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "us(pc102)+bg+group(shifts_toggle)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/ca b/xorg-server/xkeyboard-config/keymap/sgi_vndr/ca index 38f489657..528b0642a 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/ca +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/ca @@ -1,33 +1,32 @@ -// $Xorg: ca,v 1.3 2000/08/17 19:54:40 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc_universal)+ca" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal_nodeadkeys)+ca(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc102)+ca" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102_nodeadkeys)+ca(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc_universal)+ca" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal_nodeadkeys)+ca(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc102)+ca" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102_nodeadkeys)+ca(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/ch b/xorg-server/xkeyboard-config/keymap/sgi_vndr/ch index 6970a3679..ca35be7d9 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/ch +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/ch @@ -1,67 +1,65 @@ -// $Xorg: de_CH,v 1.3 2000/08/17 19:54:40 cpqbld Exp $ -default xkb_keymap "de_indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc_universal)+ch(de)" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "de_indy_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal_nodeadkeys)+ch(de_nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "de_indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc102)+ch(de)" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "de_indigo_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102_nodeadkeys)+ch(dr_nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; - -default xkb_keymap "fr_indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc_universal)+ch(fr)" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "fr_indy_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal_nodeadkeys)+ch(fr_nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "fr_indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc102)+ch(fr)" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "fr_indigo_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102_nodeadkeys)+ch(fr_nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; - +default xkb_keymap "de_indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc_universal)+ch(de)" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "de_indy_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal_nodeadkeys)+ch(de_nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "de_indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc102)+ch(de)" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "de_indigo_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102_nodeadkeys)+ch(dr_nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; + +default xkb_keymap "fr_indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc_universal)+ch(fr)" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "fr_indy_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal_nodeadkeys)+ch(fr_nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "fr_indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc102)+ch(fr)" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "fr_indigo_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102_nodeadkeys)+ch(fr_nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/cz b/xorg-server/xkeyboard-config/keymap/sgi_vndr/cz index 6673b615b..8e4a0a79c 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/cz +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/cz @@ -1,33 +1,29 @@ -// $Xorg: cs,v 1.3 2000/08/17 19:54:40 cpqbld Exp $ -// - -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc_universal)+cz" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc102)+cz" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; - -default xkb_keymap "indy_qwerty" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc_universal)+cz(qwerty)" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo_qwerty" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc102)+cz(qwerty)" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; - +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc_universal)+cz" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc102)+cz" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; + +default xkb_keymap "indy_qwerty" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc_universal)+cz(qwerty)" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo_qwerty" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc102)+cz(qwerty)" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/de b/xorg-server/xkeyboard-config/keymap/sgi_vndr/de index 1ad7fe7b0..c63caf9b0 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/de +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/de @@ -1,34 +1,32 @@ -// $Xorg: de,v 1.3 2000/08/17 19:54:40 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc_universal)+de" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal_nodeadkeys)+de(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc102)+de" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102_nodeadkeys)+de(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; - +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc_universal)+de" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal_nodeadkeys)+de(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc102)+de" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102_nodeadkeys)+de(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/dk b/xorg-server/xkeyboard-config/keymap/sgi_vndr/dk index 832f01da7..017443d56 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/dk +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/dk @@ -1,34 +1,32 @@ -// $Xorg: dk,v 1.3 2000/08/17 19:54:40 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc_universal)+dk" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal_nodeadkeys)+dk(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc102)+dk" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102_nodeadkeys)+dk(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; - +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc_universal)+dk" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal_nodeadkeys)+dk(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc102)+dk" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102_nodeadkeys)+dk(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/dvorak b/xorg-server/xkeyboard-config/keymap/sgi_vndr/dvorak index bd594b0eb..b84bc5659 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/dvorak +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/dvorak @@ -1,15 +1,14 @@ -// $Xorg: dvorak,v 1.3 2000/08/17 19:54:40 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc_universal)+dvorak" }; - xkb_geometry { include "sgi_vndr/indy(pc101)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc101)+dvorak" }; - xkb_geometry { include "sgi_vndr/indigo(pc101)" }; -}; +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc_universal)+dvorak" }; + xkb_geometry { include "sgi_vndr/indy(pc101)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc101)+dvorak" }; + xkb_geometry { include "sgi_vndr/indigo(pc101)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/en_US b/xorg-server/xkeyboard-config/keymap/sgi_vndr/en_US index 29f1666b7..184d4b896 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/en_US +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/en_US @@ -1,4 +1,3 @@ -// $Xorg: en_US,v 1.3 2000/08/17 19:54:40 cpqbld Exp $ default xkb_keymap "indy" { xkb_keycodes { include "sgi_vndr/indy(universal)" }; xkb_types { include "default" }; @@ -55,4 +54,3 @@ xkb_keymap "indigo_nodeadkeys" { xkb_symbols { include "en_US(pc102_nodeadkeys)" }; xkb_geometry { include "sgi_vndr/indigo(pc102)" }; }; - diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/es b/xorg-server/xkeyboard-config/keymap/sgi_vndr/es index f1aad9a7a..96898c6e3 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/es +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/es @@ -1,34 +1,32 @@ -// $Xorg: es,v 1.3 2000/08/17 19:54:40 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc_universal)+es" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal_nodeadkeys)+es(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc102)+es" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102_nodeadkeys)+es(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; - +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc_universal)+es" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal_nodeadkeys)+es(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc102)+es" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102_nodeadkeys)+es(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/fi b/xorg-server/xkeyboard-config/keymap/sgi_vndr/fi index 67af07eb7..ca99af149 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/fi +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/fi @@ -1,34 +1,32 @@ -// $Xorg: fi,v 1.3 2000/08/17 19:54:40 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc_universal)+fi" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal_nodeadkeys)+fi(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc102)+fi" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102_nodeadkeys)+fi(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; - +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc_universal)+fi" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal_nodeadkeys)+fi(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc102)+fi" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102_nodeadkeys)+fi(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/fr b/xorg-server/xkeyboard-config/keymap/sgi_vndr/fr index b6aea29de..fa84b65a7 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/fr +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/fr @@ -1,34 +1,32 @@ -// $Xorg: fr,v 1.3 2000/08/17 19:54:40 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc_universal)+fr" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal_nodeadkeys)+fr(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc102)+fr" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102_nodeadkeys)+fr(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; - +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc_universal)+fr" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal_nodeadkeys)+fr(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc102)+fr" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102_nodeadkeys)+fr(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/gb b/xorg-server/xkeyboard-config/keymap/sgi_vndr/gb index 6fa6d6515..90f79c194 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/gb +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/gb @@ -1,34 +1,32 @@ -// $Xorg: gb,v 1.3 2000/08/17 19:54:40 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc_universal)+gb" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal_nodeadkeys)+gb(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc102)+gb" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102_nodeadkeys)+gb(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; - +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc_universal)+gb" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal_nodeadkeys)+gb(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc102)+gb" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102_nodeadkeys)+gb(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/hu b/xorg-server/xkeyboard-config/keymap/sgi_vndr/hu index 3c256846e..653236f2f 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/hu +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/hu @@ -1,105 +1,104 @@ -// $Xorg: hu,v 1.3 2000/08/17 19:54:41 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc_universal)+hu(basic)" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_toggle" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal)+hu(basic)+group(toggle)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_shift_toggle" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal)+hu(basic)+group(shifts_toggle)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_ctrl_shift_toggle" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal)+hu(basic)+group(ctrl_shift_toggle)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_ctrl_alt_toggle" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal)+hu(basic)+group(ctrl_alt_toggle)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_caps_toggle" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal)+hu(basic)+group(caps_toggle)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc102)+hu(basic)" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_toggle" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102)+hu(basic)+group(toggle)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_shift_toggle" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102)+hu(basic)+group(shifts_toggle)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_ctrl_shift_toggle" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102)+hu(basic)+group(ctrl_shift_toggle)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_ctrl_alt_toggle" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102)+hu(basic)+group(ctrl_alt_toggle)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_caps_toggle" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102)+hu(basic)+group(caps_toggle)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc_universal)+hu(basic)" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_toggle" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal)+hu(basic)+group(toggle)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_shift_toggle" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal)+hu(basic)+group(shifts_toggle)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_ctrl_shift_toggle" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal)+hu(basic)+group(ctrl_shift_toggle)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_ctrl_alt_toggle" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal)+hu(basic)+group(ctrl_alt_toggle)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_caps_toggle" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal)+hu(basic)+group(caps_toggle)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc102)+hu(basic)" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_toggle" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102)+hu(basic)+group(toggle)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_shift_toggle" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102)+hu(basic)+group(shifts_toggle)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_ctrl_shift_toggle" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102)+hu(basic)+group(ctrl_shift_toggle)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_ctrl_alt_toggle" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102)+hu(basic)+group(ctrl_alt_toggle)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_caps_toggle" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102)+hu(basic)+group(caps_toggle)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/it b/xorg-server/xkeyboard-config/keymap/sgi_vndr/it index ed92227b7..64a413d4d 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/it +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/it @@ -1,34 +1,32 @@ -// $Xorg: it,v 1.3 2000/08/17 19:54:41 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc_universal)+it" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal_nodeadkeys)+it(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc102)+it" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102_nodeadkeys)+it(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; - +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc_universal)+it" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal_nodeadkeys)+it(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc102)+it" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102_nodeadkeys)+it(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/jp b/xorg-server/xkeyboard-config/keymap/sgi_vndr/jp index 74ed4243c..96280c105 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/jp +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/jp @@ -1,8 +1,7 @@ -// $Xorg: jp,v 1.3 2000/08/17 19:54:41 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(jp106)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc101)+sgi_vndr/jp" }; - xkb_geometry { include "sgi_vndr/indy(jp106)" }; -}; +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(jp106)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc101)+sgi_vndr/jp" }; + xkb_geometry { include "sgi_vndr/indy(jp106)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/no b/xorg-server/xkeyboard-config/keymap/sgi_vndr/no index fd32c72c0..8fc326abe 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/no +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/no @@ -1,34 +1,32 @@ -// $Xorg: no,v 1.3 2000/08/17 19:54:41 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc_universal)+no" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal_nodeadkeys)+no(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc102)+no" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102_nodeadkeys)+no(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; - +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc_universal)+no" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal_nodeadkeys)+no(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc102)+no" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102_nodeadkeys)+no(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/pl b/xorg-server/xkeyboard-config/keymap/sgi_vndr/pl index 3641a31ad..623e06f8f 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/pl +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/pl @@ -1,29 +1,28 @@ -// $Xorg: pl,v 1.3 2000/08/17 19:54:41 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc_universal)+pl" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc_universal)+pl(nodeadkeys)" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc102)+pl" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc102)+pl(nodeadkeys)" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc_universal)+pl" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc_universal)+pl(nodeadkeys)" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc102)+pl" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc102)+pl(nodeadkeys)" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/pt b/xorg-server/xkeyboard-config/keymap/sgi_vndr/pt index 3ec03471a..6be76ddb9 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/pt +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/pt @@ -1,34 +1,32 @@ -// $Xorg: pt,v 1.3 2000/08/17 19:54:41 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc_universal)+pt" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal_nodeadkeys)+pt(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc102)+pt" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102_nodeadkeys)+pt(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; - +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc_universal)+pt" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal_nodeadkeys)+pt(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc102)+pt" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102_nodeadkeys)+pt(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/ru b/xorg-server/xkeyboard-config/keymap/sgi_vndr/ru index fc514d87c..45ebdf76f 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/ru +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/ru @@ -1,105 +1,104 @@ -// $Xorg: ru,v 1.3 2000/08/17 19:54:41 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc_universal)+ru(basic)" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_toggle" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal)+ru(basic)+group(toggle)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_shift_toggle" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal)+ru(basic)+group(shifts_toggle)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_ctrl_shift_toggle" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal)+ru(basic)+group(ctrl_shift_toggle)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_ctrl_alt_toggle" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal)+ru(basic)+group(ctrl_alt_toggle)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_caps_toggle" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal)+ru(basic)+group(caps_toggle)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc102)+ru(basic)" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_toggle" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102)+ru(basic)+group(toggle)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_shift_toggle" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102)+ru(basic)+group(shifts_toggle)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_ctrl_shift_toggle" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102)+ru(basic)+group(ctrl_shift_toggle)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_ctrl_alt_toggle" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102)+ru(basic)+group(ctrl_alt_toggle)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_caps_toggle" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102)+ru(basic)+group(caps_toggle)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc_universal)+ru(basic)" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_toggle" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal)+ru(basic)+group(toggle)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_shift_toggle" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal)+ru(basic)+group(shifts_toggle)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_ctrl_shift_toggle" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal)+ru(basic)+group(ctrl_shift_toggle)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_ctrl_alt_toggle" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal)+ru(basic)+group(ctrl_alt_toggle)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_caps_toggle" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal)+ru(basic)+group(caps_toggle)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc102)+ru(basic)" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_toggle" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102)+ru(basic)+group(toggle)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_shift_toggle" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102)+ru(basic)+group(shifts_toggle)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_ctrl_shift_toggle" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102)+ru(basic)+group(ctrl_shift_toggle)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_ctrl_alt_toggle" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102)+ru(basic)+group(ctrl_alt_toggle)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_caps_toggle" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102)+ru(basic)+group(caps_toggle)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/se b/xorg-server/xkeyboard-config/keymap/sgi_vndr/se index 910a8cc89..7ac2fbc6b 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/se +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/se @@ -1,34 +1,32 @@ -// $Xorg: se,v 1.3 2000/08/17 19:54:41 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc_universal)+se" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indy_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal_nodeadkeys)+se(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc102)+se" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; -xkb_keymap "indigo_nodeadkeys" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc102_nodeadkeys)+se(nodeadkeys)" - }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; - +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc_universal)+se" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indy_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal_nodeadkeys)+se(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc102)+se" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; +xkb_keymap "indigo_nodeadkeys" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc102_nodeadkeys)+se(nodeadkeys)" + }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/sk b/xorg-server/xkeyboard-config/keymap/sgi_vndr/sk index 09b6a2956..53c5ebd84 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/sk +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/sk @@ -1,33 +1,29 @@ -// $Xorg: cs,v 1.3 2000/08/17 19:54:40 cpqbld Exp $ -// - -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc_universal)+sk" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc102)+sk" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; - -default xkb_keymap "indy_qwerty" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc_universal)+sk(qwerty)" }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo_qwerty" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc102)+sk(qwerty)" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; - +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc_universal)+sk" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc102)+sk" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; + +default xkb_keymap "indy_qwerty" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc_universal)+sk(qwerty)" }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo_qwerty" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc102)+sk(qwerty)" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/th b/xorg-server/xkeyboard-config/keymap/sgi_vndr/th index aa03c8c11..a1fb26601 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/th +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/th @@ -1,17 +1,16 @@ -// $Xorg: th,v 1.3 2000/08/17 19:54:41 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "en_US(pc_universal)+th+group(shifts_toggle)" - }; - xkb_geometry { include "sgi_vndr/indy(pc102)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "en_US(pc102)+th+group(shifts_toggle)" }; - xkb_geometry { include "sgi_vndr/indigo(pc102)" }; -}; +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "en_US(pc_universal)+th+group(shifts_toggle)" + }; + xkb_geometry { include "sgi_vndr/indy(pc102)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc102)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "en_US(pc102)+th+group(shifts_toggle)" }; + xkb_geometry { include "sgi_vndr/indigo(pc102)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sgi_vndr/us b/xorg-server/xkeyboard-config/keymap/sgi_vndr/us index 5850145ca..156e3684d 100644 --- a/xorg-server/xkeyboard-config/keymap/sgi_vndr/us +++ b/xorg-server/xkeyboard-config/keymap/sgi_vndr/us @@ -1,43 +1,42 @@ -// $Xorg: us,v 1.3 2000/08/17 19:54:41 cpqbld Exp $ -default xkb_keymap "indy" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc_universal)" }; - xkb_geometry { include "sgi_vndr/indy(pc101)" }; -}; -xkb_keymap "indy101_euro" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc_universal)" }; - xkb_geometry { include "sgi_vndr/indy(pc101)" }; -}; -xkb_keymap "indy_compose" { - xkb_keycodes { include "sgi_vndr/indy(universal)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc_universal)" }; - xkb_geometry { include "sgi_vndr/indy(pc101)" }; -}; -xkb_keymap "indigo" { - xkb_keycodes { include "sgi_vndr/indigo(pc101)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc101)" }; - xkb_geometry { include "sgi_vndr/indigo(pc101)" }; -}; -xkb_keymap "indigo_compose" { - xkb_keycodes { include "sgi_vndr/indigo(pc101)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc101compose)" }; - xkb_geometry { include "sgi_vndr/indigo(pc101)" }; -}; -xkb_keymap "indigo101_compose" { - xkb_keycodes { include "sgi_vndr/indigo(pc101)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc101euro)" }; - xkb_geometry { include "sgi_vndr/indigo(pc101)" }; -}; +default xkb_keymap "indy" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc_universal)" }; + xkb_geometry { include "sgi_vndr/indy(pc101)" }; +}; +xkb_keymap "indy101_euro" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc_universal)" }; + xkb_geometry { include "sgi_vndr/indy(pc101)" }; +}; +xkb_keymap "indy_compose" { + xkb_keycodes { include "sgi_vndr/indy(universal)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc_universal)" }; + xkb_geometry { include "sgi_vndr/indy(pc101)" }; +}; +xkb_keymap "indigo" { + xkb_keycodes { include "sgi_vndr/indigo(pc101)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc101)" }; + xkb_geometry { include "sgi_vndr/indigo(pc101)" }; +}; +xkb_keymap "indigo_compose" { + xkb_keycodes { include "sgi_vndr/indigo(pc101)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc101compose)" }; + xkb_geometry { include "sgi_vndr/indigo(pc101)" }; +}; +xkb_keymap "indigo101_compose" { + xkb_keycodes { include "sgi_vndr/indigo(pc101)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc101euro)" }; + xkb_geometry { include "sgi_vndr/indigo(pc101)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sony b/xorg-server/xkeyboard-config/keymap/sony index c4be3b1b8..ce4f566df 100644 --- a/xorg-server/xkeyboard-config/keymap/sony +++ b/xorg-server/xkeyboard-config/keymap/sony @@ -1,33 +1,32 @@ -// $Xorg: sony,v 1.4 2001/02/09 02:05:52 xorgcvs Exp $ -// -//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. -// -xkb_keymap "news5000-nwp5461" { - xkb_keycodes { include "sony(nwp5461)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sony_vndr/us(nwp5461)" }; - xkb_geometry { include "sony(nwp5461)" }; -}; +// +//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. +// +xkb_keymap "news5000-nwp5461" { + xkb_keycodes { include "sony(nwp5461)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sony_vndr/us(nwp5461)" }; + xkb_geometry { include "sony(nwp5461)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sun_vndr/all b/xorg-server/xkeyboard-config/keymap/sun_vndr/all index 047ae7bc4..71a1813eb 100644 --- a/xorg-server/xkeyboard-config/keymap/sun_vndr/all +++ b/xorg-server/xkeyboard-config/keymap/sun_vndr/all @@ -1,1092 +1,1091 @@ -// x86 KEYBOARDS -// -// Generally, x86 keyboards fall into either pc101 (101-key) or pc102 -// (102-key European) categories. Symbol tables are typically formed by -// augmenting sun/us(pc101) or sun/us(pc102) with the "extra" symbols -// from the type5 definition. Geometries and keycodes for many of -// these fall under sun(x86) or sun(x86tuv). -// -// USB KEYBOARDS -// -// Only the keycodes (scancodes) change in the Universal Serial Bus -// keyboard definitions. Symbols are kept the same as in the type5 -// case. The USB HID spec is confusing on this point, but the -// scancodes described in it relate to physical keys, not symbols, as -// it might lead one to believe. -// -// HOBO KEYBOARDS -// -// Hobo keyboards are derived from type5 keyboards, which in turn, -// are all derived from the type5 US keyboard. Use the -// appropriate set of keycodes and geometry (either type5hobo or -// type5tuvhobo) and select the symbol set sun/us(type5hobo) to -// replace sun/us(type5). For example, Sweden5_Hobo: -// -// xkb_keymap "Sweden5_Hobo" { -// xkb_keycodes { include "sun(type5tuvhobo)" }; -// xkb_types { include "default" }; -// xkb_compatibility { include "default" }; -// xkb_symbols { include "sun/us(type5hobo)+sun/se(type5)"}; -// xkb_geometry { include "sun(type5tuvhobo)" }; -// }; -// -// Doing it this way allows all the symbol changes for a particular -// type5 keyboard to hold for a Hobo keyboard; both keyboards, in -// this case, would use sun/se(type5) to augment the symbols in the -// US keboard definition. - -xkb_keymap "Belgian6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+be" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Belgian6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+be" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Canada4" { - xkb_keycodes { include "sun(type4_ca)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/ca(type4)" }; - xkb_geometry { include "sun(type4_ca)" }; -}; - -xkb_keymap "Canada_Fr5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/ca(type5)"}; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "Canada_Fr5_Hobo" { - xkb_keycodes { include "sun(type5tuvhobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5hobo)+sun/ca(type5)"}; - xkb_geometry { include "sun(type5tuvhobo)" }; -}; - -xkb_keymap "Canada_Fr5_TBITS5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/ca(type5tbits5)"}; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "Canada_Fr_x86" { - xkb_keycodes { include "sun(x86ca)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(pc101)+sun/ca(x86)"}; - xkb_geometry { include "sun(x86ca)" }; -}; - -xkb_keymap "Switzer_Fr4" { - xkb_keycodes { include "sun(type4tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/sw(type4fr)" }; - xkb_geometry { include "sun(type4tuv)" }; -}; - -xkb_keymap "Switzer_Fr5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/sw(type5fr)" }; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "Switzer_Fr5_Hobo" { - xkb_keycodes { include "sun(type5tuvhobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5hobo)+sun/sw(type5fr)"}; - xkb_geometry { include "sun(type5tuvhobo)" }; -}; - -xkb_keymap "Switzer_Fr6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/sw(type5fr)"}; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Switzer_Fr6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/sw(type5fr)"}; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Switzer_Fr_x86" { - xkb_keycodes { include "sun(x86tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(pc102)+sun/sw(type5fr)"}; - xkb_geometry { include "sun(x86tuv)" }; -}; - -xkb_keymap "Switzer_Ge4" { - xkb_keycodes { include "sun(type4tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/sw(type4de)" }; - xkb_geometry { include "sun(type4tuv)" }; -}; - -xkb_keymap "Switzer_Ge5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/sw(type5de)"}; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "Switzer_Ge5_Hobo" { - xkb_keycodes { include "sun(type5tuvhobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5hobo)+sun/sw(type5de)"}; - xkb_geometry { include "sun(type5tuvhobo)" }; -}; - -xkb_keymap "Switzer_Ge6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/sw(type5de)"}; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Switzer_Ge6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/sw(type5de)"}; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Switzer_Ge_x86" { - xkb_keycodes { include "sun(x86tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(pc102)+sun/sw(type5de)"}; - xkb_geometry { include "sun(x86tuv)" }; -}; - -xkb_keymap "Czech5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/cz(type5)" }; - xkb_geometry { include "sun(type5tuv)" }; -}; - - -xkb_keymap "Germany4" { - xkb_keycodes { include "sun(type4tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/de(type4)" }; - xkb_geometry { include "sun(type4tuv)" }; -}; - -xkb_keymap "Germany5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+de" }; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "Germany5_Hobo" { - xkb_keycodes { include "sun(type5tuvhobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5hobo)+de"}; - xkb_geometry { include "sun(type5tuvhobo)" }; -}; - -xkb_keymap "Germany6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+de" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Germany6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+de" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Germany_x86" { - xkb_keycodes { include "sun(x86tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(pc102)+de"}; - xkb_geometry { include "sun(x86tuv)" }; -}; - -xkb_keymap "Denmark4" { - xkb_keycodes { include "sun(type4tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/dk(type4)" }; - xkb_geometry { include "sun(type4tuv)" }; -}; - -xkb_keymap "Denmark5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/dk(type5)" }; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "Denmark5_Hobo" { - xkb_keycodes { include "sun(type5tuvhobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5hobo)+sun/dk(type5)" }; - xkb_geometry { include "sun(type5tuvhobo)" }; -}; - -xkb_keymap "Denmark6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/dk(type5)" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Denmark6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/dk(type5)" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Denmark_x86" { - xkb_keycodes { include "sun(x86tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(pc102)+sun/dk(type5)" }; - xkb_geometry { include "sun(x86tuv)" }; -}; - -xkb_keymap "SpainLatAm4" { - xkb_keycodes { include "sun(type4tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/es(type4)" }; - xkb_geometry { include "sun(type4tuv)" }; -}; - -xkb_keymap "Spain5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/es(type5)" }; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "Spain5_Hobo" { - xkb_keycodes { include "sun(type5tuvhobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5hobo)+sun/es(type5)"}; - xkb_geometry { include "sun(type5tuvhobo)" }; -}; - -xkb_keymap "Spain6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/es(type5)" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Spain6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/es(type5)" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Spain_x86" { - xkb_keycodes { include "sun(x86tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(pc102)+sun/es(type5)" }; - xkb_geometry { include "sun(x86tuv)" }; -}; - - -xkb_keymap "Finnish6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/fi"}; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Finnish6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/fi"}; - xkb_geometry { include "sun(type6tuv)" }; -}; - - -xkb_keymap "FranceBelg4" { - xkb_keycodes { include "sun(type4tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/fr(type4)" }; - xkb_geometry { include "sun(type4tuv)" }; -}; - -xkb_keymap "France5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/fr(type5)" }; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "France5_Hobo" { - xkb_keycodes { include "sun(type5tuvhobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5hobo)+sun/fr(type5)"}; - xkb_geometry { include "sun(type5tuvhobo)" }; -}; - -xkb_keymap "France6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/fr(type5)" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "France6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/fr(type5)" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "France_x86" { - xkb_keycodes { include "sun(x86tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(pc102)+sun/fr(type5)" }; - xkb_geometry { include "sun(x86tuv)" }; -}; - -xkb_keymap "Greece5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/gr(type5)" }; - xkb_geometry { include "sun(type5tuv)" }; -}; - - -xkb_keymap "Hungary5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5basic)+sun/hu(type5)" }; - xkb_geometry { include "sun(type5tuv)" }; -}; - - -xkb_keymap "Italy4" { - xkb_keycodes { include "sun(type4tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/it(type4)" }; - xkb_geometry { include "sun(type4tuv)" }; -}; - -xkb_keymap "Italy5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/it(type5)" }; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "Italy5_Hobo" { - xkb_keycodes { include "sun(type5tuvhobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5hobo)+sun/it(type5)"}; - xkb_geometry { include "sun(type5tuvhobo)" }; -}; - -xkb_keymap "Italy6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/it(type5)" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Italy6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/it(type5)" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Italy_x86" { - xkb_keycodes { include "sun(x86tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(pc102)+sun/it(type5)" }; - xkb_geometry { include "sun(x86tuv)" }; -}; - -xkb_keymap "Japan4" { - xkb_keycodes { include "sun(type4_jp)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/jp(type4)" }; - xkb_geometry { include "sun(type4jp)" }; -}; - -xkb_keymap "Japan5" { - xkb_keycodes { include "sun(type5_jp)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/jp(type5)" }; - xkb_geometry { include "sun(type5jp)" }; -}; - -xkb_keymap "Japan5_Hobo" { - xkb_keycodes { include "sun(type5_jphobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/jp(type5hobo)" }; - xkb_geometry { include "sun(type5jphobo)" }; -}; - -xkb_keymap "Japan6" { - xkb_keycodes { include "sun(type6_jp)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default+japan(kana_lock)" }; - xkb_symbols { include "sun/jp(type6)" }; - xkb_geometry { include "sun(type6jp)" }; -}; - -xkb_keymap "Japan6_usb" { - xkb_keycodes { include "sun(type6_jp_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default+japan(kana_lock)" }; - xkb_symbols { include "sun/jp(type6)" }; - xkb_geometry { include "sun(type6jp)" }; -}; - -xkb_keymap "Japan_x86" { - xkb_keycodes { include "sun(x86jp)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/jp(x86)" }; - xkb_geometry { include "sun(x86jp)" }; -}; - -xkb_keymap "J3100" { - xkb_keycodes { include "sun(x86tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/jp(J3100)" }; - xkb_geometry { include "sun(x86tuv)" }; -}; - -xkb_keymap "Japan_Muhenkan_x86" { - xkb_keycodes { include "sun(x86jp)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/jp(Muhenkan_x86)" }; - xkb_geometry { include "sun(x86jp)" }; -}; - -xkb_keymap "Korea4" { - xkb_keycodes { include "sun(type4)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/ko(type4)" }; - xkb_geometry { include "sun(type4)" }; -}; - -xkb_keymap "Korea5" { - xkb_keycodes { include "sun(type5)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/ko(type5)" }; - xkb_geometry { include "sun(type5)" }; -}; - -xkb_keymap "Korea5_Hobo" { - xkb_keycodes { include "sun(type5hobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5hobo)+sun/ko(type5)"}; - xkb_geometry { include "sun(type5hobo)" }; -}; - -xkb_keymap "Korea6" { - xkb_keycodes { include "sun(type6)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/ko(type5)" }; - xkb_geometry { include "sun(type6)" }; -}; - -xkb_keymap "Korea6_usb" { - xkb_keycodes { include "sun(type6_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/ko(type5)" }; - xkb_geometry { include "sun(type6)" }; -}; - -xkb_keymap "Korea_x86" { - xkb_keycodes { include "sun(x86ko)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(pc101)+sun/ko(type5)" }; - xkb_geometry { include "sun(x86ko)" }; -}; - -xkb_keymap "Lithuania5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5basic)+sun/lt(type5)" }; - xkb_geometry { include "sun(type5tuv)" }; -}; - - -xkb_keymap "Latvia5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5basic)+sun/lv(type5)" }; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "MS_US101A_x86" { - xkb_keycodes { include "sun(MS_x86)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(pc104)" }; - xkb_geometry { include "sun(MS_x86)" }; -}; - -xkb_keymap "Netherland4" { - xkb_keycodes { include "sun(type4tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/nl(type4)" }; - xkb_geometry { include "sun(type4tuv)" }; -}; - -xkb_keymap "Netherland5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+nl" }; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "Netherland5_Hobo" { - xkb_keycodes { include "sun(type5tuvhobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5hobo)+nl" }; - xkb_geometry { include "sun(type5tuvhobo)" }; -}; - -xkb_keymap "Netherland6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+nl" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Netherland6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+nl" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Netherland_x86" { - xkb_keycodes { include "sun(x86tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(pc102)+nl" }; - xkb_geometry { include "sun(x86tuv)" }; -}; - -xkb_keymap "Norway4" { - xkb_keycodes { include "sun(type4tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/no(type4)" }; - xkb_geometry { include "sun(type4tuv)" }; -}; - -xkb_keymap "Norway5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/no(type5)"}; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "Norway5_Hobo" { - xkb_keycodes { include "sun(type5tuvhobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5hobo)+sun/no(type5)"}; - xkb_geometry { include "sun(type5tuvhobo)" }; -}; - -xkb_keymap "Norway6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/no(type5)" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Norway6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/no(type5)" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Norway_x86" { - xkb_keycodes { include "sun(x86tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(pc102)+sun/no(type5)" }; - xkb_geometry { include "sun(x86tuv)" }; -}; - -xkb_keymap "Poland5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/pl" }; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "Portugal4" { - xkb_keycodes { include "sun(type4tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/pt(type4)" }; - xkb_geometry { include "sun(type4tuv)" }; -}; - -xkb_keymap "Portugal5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/pt(type5)" }; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "Portugal5_Hobo" { - xkb_keycodes { include "sun(type5tuvhobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5hobo)+sun/pt(type5)"}; - xkb_geometry { include "sun(type5tuvhobo)" }; -}; - -xkb_keymap "Portugal6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/pt(type5)" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Portugal6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/pt(type5)" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Portugal_x86" { - xkb_keycodes { include "sun(x86tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(pc102)+sun/pt(type5)" }; - xkb_geometry { include "sun(x86tuv)" }; -}; - -// xkb_keymap "Russia4" { -// xkb_keycodes { include "sun(type4)" }; -// xkb_types { include "default" }; -// xkb_compatibility { include "default" }; -// xkb_symbols { include "sun/ru" }; -// xkb_geometry { include "sun(type4)" }; -// }; - -xkb_keymap "Russia5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/ru"}; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "Russia6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/ru"}; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Russia6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/ru"}; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "SwedenFin4" { - xkb_keycodes { include "sun(type4tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/se(type4)" }; - xkb_geometry { include "sun(type4tuv)" }; -}; - -xkb_keymap "Sweden5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/se(type5)"}; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "Sweden5_Hobo" { - xkb_keycodes { include "sun(type5tuvhobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5hobo)+sun/se(type5)"}; - xkb_geometry { include "sun(type5tuvhobo)" }; -}; - -xkb_keymap "Sweden6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/se(type5)" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Sweden6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/se(type5)" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Sweden_x86" { - xkb_keycodes { include "sun(x86tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(pc102)+sun/se(type5)" }; - xkb_geometry { include "sun(x86tuv)" }; -}; - -xkb_keymap "Turkey5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/tr" }; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "Turkey6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/tr"}; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "Turkey6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/tr"}; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "TurkeyQ6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/tr(type6Q)"}; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "TurkeyQ6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/tr(type6Q)"}; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "TurkeyF6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/tr(type6F)"}; - xkb_geometry { include "sun(type6)" }; -}; - -xkb_keymap "TurkeyF6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/tr(type6F)"}; - xkb_geometry { include "sun(type6)" }; -}; - -xkb_keymap "Taiwan4" { - xkb_keycodes { include "sun(type4)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/tw(type4)" }; - xkb_geometry { include "sun(type4)" }; -}; - -xkb_keymap "Taiwan5" { - xkb_keycodes { include "sun(type5)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/tw(type5)" }; - xkb_geometry { include "sun(type5)" }; -}; - -xkb_keymap "Taiwan5_Hobo" { - xkb_keycodes { include "sun(type5hobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5hobo)+sun/tw(type5)" }; - xkb_geometry { include "sun(type5hobo)" }; -}; - -xkb_keymap "Taiwan6" { - xkb_keycodes { include "sun(type6)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/tw(type5)" }; - xkb_geometry { include "sun(type6)" }; -}; - -xkb_keymap "Taiwan6_usb" { - xkb_keycodes { include "sun(type6_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/tw(type5)" }; - xkb_geometry { include "sun(type6)" }; -}; - -xkb_keymap "Taiwan_x86" { - xkb_keycodes { include "sun(x86)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc101)" }; - xkb_geometry { include "sun(x86)" }; -}; - -xkb_keymap "UK4" { - xkb_keycodes { include "sun(type4)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/gb(type4)" }; - xkb_geometry { include "sun(type4)" }; -}; - -xkb_keymap "UK5" { - xkb_keycodes { include "sun(type5tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)+sun/gb(type5)" }; - xkb_geometry { include "sun(type5tuv)" }; -}; - -xkb_keymap "UK5_Hobo" { - xkb_keycodes { include "sun(type5tuvhobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5hobo)+sun/gb(type5)" }; - xkb_geometry { include "sun(type5tuvhobo)" }; -}; - -xkb_keymap "UK6" { - xkb_keycodes { include "sun(type6tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type6)+sun/gb(type5)" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "UK6_usb" { - xkb_keycodes { include "sun(type6tuv_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type6)+sun/gb(type5)" }; - xkb_geometry { include "sun(type6tuv)" }; -}; - -xkb_keymap "UK_x86" { - xkb_keycodes { include "sun(x86tuv)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(pc102)+gb" }; - xkb_geometry { include "sun(x86tuv)" }; -}; - -xkb_keymap "US101A_PC" { - xkb_keycodes { include "sun(type5x86)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(pc101)+sun/us(pc101currency)"}; - xkb_geometry { include "sun(x86)" }; -}; - -xkb_keymap "US101A_Sun" { - xkb_keycodes { include "sun(type5x86)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(pc101)+sun/us(US101A_Sun)" }; - xkb_geometry { include "sun(x86)" }; -}; - -xkb_keymap "US101A_x86" { - xkb_keycodes { include "sun(x86)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc101)" }; - xkb_geometry { include "sun(x86)" }; -}; - -xkb_keymap "US4" { - xkb_keycodes { include "sun(type4)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type4)" }; - xkb_geometry { include "sun(type4)" }; -}; - -xkb_keymap "US5" { - xkb_keycodes { include "sun(type5)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)" }; - xkb_geometry { include "sun(type5)" }; -}; - -xkb_keymap "US5_Hobo" { - xkb_keycodes { include "sun(type5hobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5hobo)" }; - xkb_geometry { include "sun(type5hobo)" }; -}; - -xkb_keymap "US_UNIX5" { - xkb_keycodes { include "sun(type5)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5)" }; - xkb_geometry { include "sun(type5unix)" }; -}; - -xkb_keymap "US_UNIX5_Hobo" { - // Same as US5_Hobo - xkb_keycodes { include "sun(type5hobo)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type5hobo)" }; - xkb_geometry { include "sun(type5hobo)" }; -}; - -xkb_keymap "US6" { - xkb_keycodes { include "sun(type6)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type6)" }; - xkb_geometry { include "sun(type6)" }; -}; - -xkb_keymap "US6_usb" { - xkb_keycodes { include "sun(type6_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type6)" }; - xkb_geometry { include "sun(type6)" }; -}; - -xkb_keymap "US_UNIX6" { - xkb_keycodes { include "sun(type6)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type6)" }; - xkb_geometry { include "sun(type6unix)" }; -}; - -xkb_keymap "US_UNIX6_usb" { - xkb_keycodes { include "sun(type6_usb)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun/us(type6)" }; - xkb_geometry { include "sun(type6unix)" }; -}; - +// x86 KEYBOARDS +// +// Generally, x86 keyboards fall into either pc101 (101-key) or pc102 +// (102-key European) categories. Symbol tables are typically formed by +// augmenting sun/us(pc101) or sun/us(pc102) with the "extra" symbols +// from the type5 definition. Geometries and keycodes for many of +// these fall under sun(x86) or sun(x86tuv). +// +// USB KEYBOARDS +// +// Only the keycodes (scancodes) change in the Universal Serial Bus +// keyboard definitions. Symbols are kept the same as in the type5 +// case. The USB HID spec is confusing on this point, but the +// scancodes described in it relate to physical keys, not symbols, as +// it might lead one to believe. +// +// HOBO KEYBOARDS +// +// Hobo keyboards are derived from type5 keyboards, which in turn, +// are all derived from the type5 US keyboard. Use the +// appropriate set of keycodes and geometry (either type5hobo or +// type5tuvhobo) and select the symbol set sun/us(type5hobo) to +// replace sun/us(type5). For example, Sweden5_Hobo: +// +// xkb_keymap "Sweden5_Hobo" { +// xkb_keycodes { include "sun(type5tuvhobo)" }; +// xkb_types { include "default" }; +// xkb_compatibility { include "default" }; +// xkb_symbols { include "sun/us(type5hobo)+sun/se(type5)"}; +// xkb_geometry { include "sun(type5tuvhobo)" }; +// }; +// +// Doing it this way allows all the symbol changes for a particular +// type5 keyboard to hold for a Hobo keyboard; both keyboards, in +// this case, would use sun/se(type5) to augment the symbols in the +// US keboard definition. + +xkb_keymap "Belgian6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+be" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Belgian6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+be" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Canada4" { + xkb_keycodes { include "sun(type4_ca)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/ca(type4)" }; + xkb_geometry { include "sun(type4_ca)" }; +}; + +xkb_keymap "Canada_Fr5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/ca(type5)"}; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "Canada_Fr5_Hobo" { + xkb_keycodes { include "sun(type5tuvhobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5hobo)+sun/ca(type5)"}; + xkb_geometry { include "sun(type5tuvhobo)" }; +}; + +xkb_keymap "Canada_Fr5_TBITS5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/ca(type5tbits5)"}; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "Canada_Fr_x86" { + xkb_keycodes { include "sun(x86ca)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(pc101)+sun/ca(x86)"}; + xkb_geometry { include "sun(x86ca)" }; +}; + +xkb_keymap "Switzer_Fr4" { + xkb_keycodes { include "sun(type4tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/sw(type4fr)" }; + xkb_geometry { include "sun(type4tuv)" }; +}; + +xkb_keymap "Switzer_Fr5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/sw(type5fr)" }; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "Switzer_Fr5_Hobo" { + xkb_keycodes { include "sun(type5tuvhobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5hobo)+sun/sw(type5fr)"}; + xkb_geometry { include "sun(type5tuvhobo)" }; +}; + +xkb_keymap "Switzer_Fr6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/sw(type5fr)"}; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Switzer_Fr6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/sw(type5fr)"}; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Switzer_Fr_x86" { + xkb_keycodes { include "sun(x86tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(pc102)+sun/sw(type5fr)"}; + xkb_geometry { include "sun(x86tuv)" }; +}; + +xkb_keymap "Switzer_Ge4" { + xkb_keycodes { include "sun(type4tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/sw(type4de)" }; + xkb_geometry { include "sun(type4tuv)" }; +}; + +xkb_keymap "Switzer_Ge5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/sw(type5de)"}; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "Switzer_Ge5_Hobo" { + xkb_keycodes { include "sun(type5tuvhobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5hobo)+sun/sw(type5de)"}; + xkb_geometry { include "sun(type5tuvhobo)" }; +}; + +xkb_keymap "Switzer_Ge6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/sw(type5de)"}; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Switzer_Ge6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/sw(type5de)"}; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Switzer_Ge_x86" { + xkb_keycodes { include "sun(x86tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(pc102)+sun/sw(type5de)"}; + xkb_geometry { include "sun(x86tuv)" }; +}; + +xkb_keymap "Czech5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/cz(type5)" }; + xkb_geometry { include "sun(type5tuv)" }; +}; + + +xkb_keymap "Germany4" { + xkb_keycodes { include "sun(type4tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/de(type4)" }; + xkb_geometry { include "sun(type4tuv)" }; +}; + +xkb_keymap "Germany5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+de" }; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "Germany5_Hobo" { + xkb_keycodes { include "sun(type5tuvhobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5hobo)+de"}; + xkb_geometry { include "sun(type5tuvhobo)" }; +}; + +xkb_keymap "Germany6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+de" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Germany6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+de" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Germany_x86" { + xkb_keycodes { include "sun(x86tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(pc102)+de"}; + xkb_geometry { include "sun(x86tuv)" }; +}; + +xkb_keymap "Denmark4" { + xkb_keycodes { include "sun(type4tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/dk(type4)" }; + xkb_geometry { include "sun(type4tuv)" }; +}; + +xkb_keymap "Denmark5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/dk(type5)" }; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "Denmark5_Hobo" { + xkb_keycodes { include "sun(type5tuvhobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5hobo)+sun/dk(type5)" }; + xkb_geometry { include "sun(type5tuvhobo)" }; +}; + +xkb_keymap "Denmark6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/dk(type5)" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Denmark6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/dk(type5)" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Denmark_x86" { + xkb_keycodes { include "sun(x86tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(pc102)+sun/dk(type5)" }; + xkb_geometry { include "sun(x86tuv)" }; +}; + +xkb_keymap "SpainLatAm4" { + xkb_keycodes { include "sun(type4tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/es(type4)" }; + xkb_geometry { include "sun(type4tuv)" }; +}; + +xkb_keymap "Spain5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/es(type5)" }; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "Spain5_Hobo" { + xkb_keycodes { include "sun(type5tuvhobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5hobo)+sun/es(type5)"}; + xkb_geometry { include "sun(type5tuvhobo)" }; +}; + +xkb_keymap "Spain6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/es(type5)" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Spain6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/es(type5)" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Spain_x86" { + xkb_keycodes { include "sun(x86tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(pc102)+sun/es(type5)" }; + xkb_geometry { include "sun(x86tuv)" }; +}; + + +xkb_keymap "Finnish6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/fi"}; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Finnish6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/fi"}; + xkb_geometry { include "sun(type6tuv)" }; +}; + + +xkb_keymap "FranceBelg4" { + xkb_keycodes { include "sun(type4tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/fr(type4)" }; + xkb_geometry { include "sun(type4tuv)" }; +}; + +xkb_keymap "France5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/fr(type5)" }; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "France5_Hobo" { + xkb_keycodes { include "sun(type5tuvhobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5hobo)+sun/fr(type5)"}; + xkb_geometry { include "sun(type5tuvhobo)" }; +}; + +xkb_keymap "France6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/fr(type5)" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "France6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/fr(type5)" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "France_x86" { + xkb_keycodes { include "sun(x86tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(pc102)+sun/fr(type5)" }; + xkb_geometry { include "sun(x86tuv)" }; +}; + +xkb_keymap "Greece5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/gr(type5)" }; + xkb_geometry { include "sun(type5tuv)" }; +}; + + +xkb_keymap "Hungary5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5basic)+sun/hu(type5)" }; + xkb_geometry { include "sun(type5tuv)" }; +}; + + +xkb_keymap "Italy4" { + xkb_keycodes { include "sun(type4tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/it(type4)" }; + xkb_geometry { include "sun(type4tuv)" }; +}; + +xkb_keymap "Italy5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/it(type5)" }; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "Italy5_Hobo" { + xkb_keycodes { include "sun(type5tuvhobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5hobo)+sun/it(type5)"}; + xkb_geometry { include "sun(type5tuvhobo)" }; +}; + +xkb_keymap "Italy6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/it(type5)" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Italy6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/it(type5)" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Italy_x86" { + xkb_keycodes { include "sun(x86tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(pc102)+sun/it(type5)" }; + xkb_geometry { include "sun(x86tuv)" }; +}; + +xkb_keymap "Japan4" { + xkb_keycodes { include "sun(type4_jp)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/jp(type4)" }; + xkb_geometry { include "sun(type4jp)" }; +}; + +xkb_keymap "Japan5" { + xkb_keycodes { include "sun(type5_jp)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/jp(type5)" }; + xkb_geometry { include "sun(type5jp)" }; +}; + +xkb_keymap "Japan5_Hobo" { + xkb_keycodes { include "sun(type5_jphobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/jp(type5hobo)" }; + xkb_geometry { include "sun(type5jphobo)" }; +}; + +xkb_keymap "Japan6" { + xkb_keycodes { include "sun(type6_jp)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default+japan(kana_lock)" }; + xkb_symbols { include "sun/jp(type6)" }; + xkb_geometry { include "sun(type6jp)" }; +}; + +xkb_keymap "Japan6_usb" { + xkb_keycodes { include "sun(type6_jp_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default+japan(kana_lock)" }; + xkb_symbols { include "sun/jp(type6)" }; + xkb_geometry { include "sun(type6jp)" }; +}; + +xkb_keymap "Japan_x86" { + xkb_keycodes { include "sun(x86jp)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/jp(x86)" }; + xkb_geometry { include "sun(x86jp)" }; +}; + +xkb_keymap "J3100" { + xkb_keycodes { include "sun(x86tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/jp(J3100)" }; + xkb_geometry { include "sun(x86tuv)" }; +}; + +xkb_keymap "Japan_Muhenkan_x86" { + xkb_keycodes { include "sun(x86jp)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/jp(Muhenkan_x86)" }; + xkb_geometry { include "sun(x86jp)" }; +}; + +xkb_keymap "Korea4" { + xkb_keycodes { include "sun(type4)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/ko(type4)" }; + xkb_geometry { include "sun(type4)" }; +}; + +xkb_keymap "Korea5" { + xkb_keycodes { include "sun(type5)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/ko(type5)" }; + xkb_geometry { include "sun(type5)" }; +}; + +xkb_keymap "Korea5_Hobo" { + xkb_keycodes { include "sun(type5hobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5hobo)+sun/ko(type5)"}; + xkb_geometry { include "sun(type5hobo)" }; +}; + +xkb_keymap "Korea6" { + xkb_keycodes { include "sun(type6)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/ko(type5)" }; + xkb_geometry { include "sun(type6)" }; +}; + +xkb_keymap "Korea6_usb" { + xkb_keycodes { include "sun(type6_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/ko(type5)" }; + xkb_geometry { include "sun(type6)" }; +}; + +xkb_keymap "Korea_x86" { + xkb_keycodes { include "sun(x86ko)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(pc101)+sun/ko(type5)" }; + xkb_geometry { include "sun(x86ko)" }; +}; + +xkb_keymap "Lithuania5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5basic)+sun/lt(type5)" }; + xkb_geometry { include "sun(type5tuv)" }; +}; + + +xkb_keymap "Latvia5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5basic)+sun/lv(type5)" }; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "MS_US101A_x86" { + xkb_keycodes { include "sun(MS_x86)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(pc104)" }; + xkb_geometry { include "sun(MS_x86)" }; +}; + +xkb_keymap "Netherland4" { + xkb_keycodes { include "sun(type4tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/nl(type4)" }; + xkb_geometry { include "sun(type4tuv)" }; +}; + +xkb_keymap "Netherland5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+nl" }; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "Netherland5_Hobo" { + xkb_keycodes { include "sun(type5tuvhobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5hobo)+nl" }; + xkb_geometry { include "sun(type5tuvhobo)" }; +}; + +xkb_keymap "Netherland6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+nl" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Netherland6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+nl" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Netherland_x86" { + xkb_keycodes { include "sun(x86tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(pc102)+nl" }; + xkb_geometry { include "sun(x86tuv)" }; +}; + +xkb_keymap "Norway4" { + xkb_keycodes { include "sun(type4tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/no(type4)" }; + xkb_geometry { include "sun(type4tuv)" }; +}; + +xkb_keymap "Norway5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/no(type5)"}; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "Norway5_Hobo" { + xkb_keycodes { include "sun(type5tuvhobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5hobo)+sun/no(type5)"}; + xkb_geometry { include "sun(type5tuvhobo)" }; +}; + +xkb_keymap "Norway6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/no(type5)" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Norway6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/no(type5)" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Norway_x86" { + xkb_keycodes { include "sun(x86tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(pc102)+sun/no(type5)" }; + xkb_geometry { include "sun(x86tuv)" }; +}; + +xkb_keymap "Poland5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/pl" }; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "Portugal4" { + xkb_keycodes { include "sun(type4tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/pt(type4)" }; + xkb_geometry { include "sun(type4tuv)" }; +}; + +xkb_keymap "Portugal5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/pt(type5)" }; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "Portugal5_Hobo" { + xkb_keycodes { include "sun(type5tuvhobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5hobo)+sun/pt(type5)"}; + xkb_geometry { include "sun(type5tuvhobo)" }; +}; + +xkb_keymap "Portugal6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/pt(type5)" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Portugal6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/pt(type5)" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Portugal_x86" { + xkb_keycodes { include "sun(x86tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(pc102)+sun/pt(type5)" }; + xkb_geometry { include "sun(x86tuv)" }; +}; + +// xkb_keymap "Russia4" { +// xkb_keycodes { include "sun(type4)" }; +// xkb_types { include "default" }; +// xkb_compatibility { include "default" }; +// xkb_symbols { include "sun/ru" }; +// xkb_geometry { include "sun(type4)" }; +// }; + +xkb_keymap "Russia5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/ru"}; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "Russia6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/ru"}; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Russia6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/ru"}; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "SwedenFin4" { + xkb_keycodes { include "sun(type4tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/se(type4)" }; + xkb_geometry { include "sun(type4tuv)" }; +}; + +xkb_keymap "Sweden5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/se(type5)"}; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "Sweden5_Hobo" { + xkb_keycodes { include "sun(type5tuvhobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5hobo)+sun/se(type5)"}; + xkb_geometry { include "sun(type5tuvhobo)" }; +}; + +xkb_keymap "Sweden6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/se(type5)" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Sweden6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/se(type5)" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Sweden_x86" { + xkb_keycodes { include "sun(x86tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(pc102)+sun/se(type5)" }; + xkb_geometry { include "sun(x86tuv)" }; +}; + +xkb_keymap "Turkey5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/tr" }; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "Turkey6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/tr"}; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "Turkey6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/tr"}; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "TurkeyQ6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/tr(type6Q)"}; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "TurkeyQ6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/tr(type6Q)"}; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "TurkeyF6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/tr(type6F)"}; + xkb_geometry { include "sun(type6)" }; +}; + +xkb_keymap "TurkeyF6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/tr(type6F)"}; + xkb_geometry { include "sun(type6)" }; +}; + +xkb_keymap "Taiwan4" { + xkb_keycodes { include "sun(type4)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/tw(type4)" }; + xkb_geometry { include "sun(type4)" }; +}; + +xkb_keymap "Taiwan5" { + xkb_keycodes { include "sun(type5)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/tw(type5)" }; + xkb_geometry { include "sun(type5)" }; +}; + +xkb_keymap "Taiwan5_Hobo" { + xkb_keycodes { include "sun(type5hobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5hobo)+sun/tw(type5)" }; + xkb_geometry { include "sun(type5hobo)" }; +}; + +xkb_keymap "Taiwan6" { + xkb_keycodes { include "sun(type6)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/tw(type5)" }; + xkb_geometry { include "sun(type6)" }; +}; + +xkb_keymap "Taiwan6_usb" { + xkb_keycodes { include "sun(type6_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/tw(type5)" }; + xkb_geometry { include "sun(type6)" }; +}; + +xkb_keymap "Taiwan_x86" { + xkb_keycodes { include "sun(x86)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc101)" }; + xkb_geometry { include "sun(x86)" }; +}; + +xkb_keymap "UK4" { + xkb_keycodes { include "sun(type4)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/gb(type4)" }; + xkb_geometry { include "sun(type4)" }; +}; + +xkb_keymap "UK5" { + xkb_keycodes { include "sun(type5tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)+sun/gb(type5)" }; + xkb_geometry { include "sun(type5tuv)" }; +}; + +xkb_keymap "UK5_Hobo" { + xkb_keycodes { include "sun(type5tuvhobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5hobo)+sun/gb(type5)" }; + xkb_geometry { include "sun(type5tuvhobo)" }; +}; + +xkb_keymap "UK6" { + xkb_keycodes { include "sun(type6tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type6)+sun/gb(type5)" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "UK6_usb" { + xkb_keycodes { include "sun(type6tuv_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type6)+sun/gb(type5)" }; + xkb_geometry { include "sun(type6tuv)" }; +}; + +xkb_keymap "UK_x86" { + xkb_keycodes { include "sun(x86tuv)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(pc102)+gb" }; + xkb_geometry { include "sun(x86tuv)" }; +}; + +xkb_keymap "US101A_PC" { + xkb_keycodes { include "sun(type5x86)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(pc101)+sun/us(pc101currency)"}; + xkb_geometry { include "sun(x86)" }; +}; + +xkb_keymap "US101A_Sun" { + xkb_keycodes { include "sun(type5x86)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(pc101)+sun/us(US101A_Sun)" }; + xkb_geometry { include "sun(x86)" }; +}; + +xkb_keymap "US101A_x86" { + xkb_keycodes { include "sun(x86)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc101)" }; + xkb_geometry { include "sun(x86)" }; +}; + +xkb_keymap "US4" { + xkb_keycodes { include "sun(type4)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type4)" }; + xkb_geometry { include "sun(type4)" }; +}; + +xkb_keymap "US5" { + xkb_keycodes { include "sun(type5)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)" }; + xkb_geometry { include "sun(type5)" }; +}; + +xkb_keymap "US5_Hobo" { + xkb_keycodes { include "sun(type5hobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5hobo)" }; + xkb_geometry { include "sun(type5hobo)" }; +}; + +xkb_keymap "US_UNIX5" { + xkb_keycodes { include "sun(type5)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5)" }; + xkb_geometry { include "sun(type5unix)" }; +}; + +xkb_keymap "US_UNIX5_Hobo" { + // Same as US5_Hobo + xkb_keycodes { include "sun(type5hobo)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type5hobo)" }; + xkb_geometry { include "sun(type5hobo)" }; +}; + +xkb_keymap "US6" { + xkb_keycodes { include "sun(type6)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type6)" }; + xkb_geometry { include "sun(type6)" }; +}; + +xkb_keymap "US6_usb" { + xkb_keycodes { include "sun(type6_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type6)" }; + xkb_geometry { include "sun(type6)" }; +}; + +xkb_keymap "US_UNIX6" { + xkb_keycodes { include "sun(type6)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type6)" }; + xkb_geometry { include "sun(type6unix)" }; +}; + +xkb_keymap "US_UNIX6_usb" { + xkb_keycodes { include "sun(type6_usb)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun/us(type6)" }; + xkb_geometry { include "sun(type6unix)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sun_vndr/de b/xorg-server/xkeyboard-config/keymap/sun_vndr/de index 4c1ded3fc..e05fdf384 100644 --- a/xorg-server/xkeyboard-config/keymap/sun_vndr/de +++ b/xorg-server/xkeyboard-config/keymap/sun_vndr/de @@ -1,78 +1,77 @@ -// $Xorg: de,v 1.4 2001/02/09 02:05:52 xorgcvs Exp $ -// -//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. -// -xkb_keymap "type4_de" { - xkb_keycodes { include "sun(type4_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun4)+iso9995-3(basic)+de" - }; - xkb_geometry { include "sun(type4)" }; -}; -xkb_keymap "type4_de_nodeadkeys" { - xkb_keycodes { include "sun(type4_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun4)+iso9995-3(nodeadkeys)+de(nodeadkeys)" - }; - xkb_geometry { include "sun(type4)" }; -}; -xkb_keymap "type4_de_openlook" { - xkb_keycodes { include "sun(type4_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun4ol)+iso9995-3(basic)+de" - }; - xkb_geometry { include "sun(type4)" }; -}; -default xkb_keymap "type5_de" { - xkb_keycodes { include "sun(type5_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun5)+iso9995-3(basic)+de" - }; - xkb_geometry { include "sun(type5euro)" }; -}; -xkb_keymap "type5_de_nodeadkeys" { - xkb_keycodes { include "sun(type5_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun5)+iso9995-3(nodeadkeys)+de(nodeadkeys)" - }; - xkb_geometry { include "sun(type5euro)" }; -}; -xkb_keymap "type5_de_openlook" { - xkb_keycodes { include "sun(type5_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun_vndr/us(sun5ol)+iso9995-3+de" }; - xkb_geometry { include "sun(type5euro)" }; -}; +// +//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. +// +xkb_keymap "type4_de" { + xkb_keycodes { include "sun(type4_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun4)+iso9995-3(basic)+de" + }; + xkb_geometry { include "sun(type4)" }; +}; +xkb_keymap "type4_de_nodeadkeys" { + xkb_keycodes { include "sun(type4_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun4)+iso9995-3(nodeadkeys)+de(nodeadkeys)" + }; + xkb_geometry { include "sun(type4)" }; +}; +xkb_keymap "type4_de_openlook" { + xkb_keycodes { include "sun(type4_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun4ol)+iso9995-3(basic)+de" + }; + xkb_geometry { include "sun(type4)" }; +}; +default xkb_keymap "type5_de" { + xkb_keycodes { include "sun(type5_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun5)+iso9995-3(basic)+de" + }; + xkb_geometry { include "sun(type5euro)" }; +}; +xkb_keymap "type5_de_nodeadkeys" { + xkb_keycodes { include "sun(type5_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun5)+iso9995-3(nodeadkeys)+de(nodeadkeys)" + }; + xkb_geometry { include "sun(type5euro)" }; +}; +xkb_keymap "type5_de_openlook" { + xkb_keycodes { include "sun(type5_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun_vndr/us(sun5ol)+iso9995-3+de" }; + xkb_geometry { include "sun(type5euro)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sun_vndr/es b/xorg-server/xkeyboard-config/keymap/sun_vndr/es index 2de81c011..5af8e4222 100644 --- a/xorg-server/xkeyboard-config/keymap/sun_vndr/es +++ b/xorg-server/xkeyboard-config/keymap/sun_vndr/es @@ -1,62 +1,59 @@ -// $TOG: de /main/3 1998/02/10 13:44:36 kaleb $ -// -//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. -// -// $XFree86: xc/programs/xkbcomp/keymap/sun_vndr/es,v 1.2 2000/10/28 00:34:05 dawes Exp $ -// -xkb_keymap "type4_es" { - xkb_keycodes { include "sun(type4_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun4)+iso9995-3(basic)+es" - }; - xkb_geometry { include "sun(type4)" }; -}; -xkb_keymap "type4_es_openlook" { - xkb_keycodes { include "sun(type4_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun4ol)+iso9995-3(basic)+es" - }; - xkb_geometry { include "sun(type4)" }; -}; -default xkb_keymap "type5_es" { - xkb_keycodes { include "sun(type5_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun5)+iso9995-3(basic)+es" - }; - xkb_geometry { include "sun(type5euro)" }; -}; -xkb_keymap "type5_es_openlook" { - xkb_keycodes { include "sun(type5_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun_vndr/us(sun5ol)+iso9995-3+es" }; - xkb_geometry { include "sun(type5euro)" }; -}; +// +//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. +// +xkb_keymap "type4_es" { + xkb_keycodes { include "sun(type4_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun4)+iso9995-3(basic)+es" + }; + xkb_geometry { include "sun(type4)" }; +}; +xkb_keymap "type4_es_openlook" { + xkb_keycodes { include "sun(type4_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun4ol)+iso9995-3(basic)+es" + }; + xkb_geometry { include "sun(type4)" }; +}; +default xkb_keymap "type5_es" { + xkb_keycodes { include "sun(type5_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun5)+iso9995-3(basic)+es" + }; + xkb_geometry { include "sun(type5euro)" }; +}; +xkb_keymap "type5_es_openlook" { + xkb_keycodes { include "sun(type5_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun_vndr/us(sun5ol)+iso9995-3+es" }; + xkb_geometry { include "sun(type5euro)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sun_vndr/fi b/xorg-server/xkeyboard-config/keymap/sun_vndr/fi index 296ef66c4..3e48c7f43 100644 --- a/xorg-server/xkeyboard-config/keymap/sun_vndr/fi +++ b/xorg-server/xkeyboard-config/keymap/sun_vndr/fi @@ -1,62 +1,59 @@ -// $TOG: de /main/3 1998/02/10 13:44:36 kaleb $ -// -//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. -// -// $XFree86: xc/programs/xkbcomp/keymap/sun_vndr/fi,v 1.2 2000/10/28 00:34:05 dawes Exp $ -// -xkb_keymap "type4_fi" { - xkb_keycodes { include "sun(type4_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun4)+iso9995-3(basic)+fi" - }; - xkb_geometry { include "sun(type4)" }; -}; -xkb_keymap "type4_fi_openlook" { - xkb_keycodes { include "sun(type4_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun4ol)+iso9995-3(basic)+fi" - }; - xkb_geometry { include "sun(type4)" }; -}; -default xkb_keymap "type5_fi" { - xkb_keycodes { include "sun(type5_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun5)+iso9995-3(basic)+fi" - }; - xkb_geometry { include "sun(type5euro)" }; -}; -xkb_keymap "type5_fi_openlook" { - xkb_keycodes { include "sun(type5_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun_vndr/us(sun5ol)+iso9995-3+fi" }; - xkb_geometry { include "sun(type5euro)" }; -}; +// +//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. +// +xkb_keymap "type4_fi" { + xkb_keycodes { include "sun(type4_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun4)+iso9995-3(basic)+fi" + }; + xkb_geometry { include "sun(type4)" }; +}; +xkb_keymap "type4_fi_openlook" { + xkb_keycodes { include "sun(type4_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun4ol)+iso9995-3(basic)+fi" + }; + xkb_geometry { include "sun(type4)" }; +}; +default xkb_keymap "type5_fi" { + xkb_keycodes { include "sun(type5_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun5)+iso9995-3(basic)+fi" + }; + xkb_geometry { include "sun(type5euro)" }; +}; +xkb_keymap "type5_fi_openlook" { + xkb_keycodes { include "sun(type5_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun_vndr/us(sun5ol)+iso9995-3+fi" }; + xkb_geometry { include "sun(type5euro)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sun_vndr/fr b/xorg-server/xkeyboard-config/keymap/sun_vndr/fr index 9301ce031..8e15ca017 100644 --- a/xorg-server/xkeyboard-config/keymap/sun_vndr/fr +++ b/xorg-server/xkeyboard-config/keymap/sun_vndr/fr @@ -1,62 +1,59 @@ -// $TOG: de /main/3 1998/02/10 13:44:36 kaleb $ -// -//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. -// -// $XFree86: xc/programs/xkbcomp/keymap/sun_vndr/fr,v 1.2 2000/10/28 00:34:05 dawes Exp $ -// -xkb_keymap "type4_fr" { - xkb_keycodes { include "sun(type4_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun4)+iso9995-3(basic)+fr" - }; - xkb_geometry { include "sun(type4)" }; -}; -xkb_keymap "type4_fr_openlook" { - xkb_keycodes { include "sun(type4_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun4ol)+iso9995-3(basic)+fr" - }; - xkb_geometry { include "sun(type4)" }; -}; -default xkb_keymap "type5_fr" { - xkb_keycodes { include "sun(type5_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun5)+iso9995-3(basic)+fr" - }; - xkb_geometry { include "sun(type5euro)" }; -}; -xkb_keymap "type5_fr_openlook" { - xkb_keycodes { include "sun(type5_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun_vndr/us(sun5ol)+iso9995-3+fr" }; - xkb_geometry { include "sun(type5euro)" }; -}; +// +//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. +// +xkb_keymap "type4_fr" { + xkb_keycodes { include "sun(type4_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun4)+iso9995-3(basic)+fr" + }; + xkb_geometry { include "sun(type4)" }; +}; +xkb_keymap "type4_fr_openlook" { + xkb_keycodes { include "sun(type4_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun4ol)+iso9995-3(basic)+fr" + }; + xkb_geometry { include "sun(type4)" }; +}; +default xkb_keymap "type5_fr" { + xkb_keycodes { include "sun(type5_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun5)+iso9995-3(basic)+fr" + }; + xkb_geometry { include "sun(type5euro)" }; +}; +xkb_keymap "type5_fr_openlook" { + xkb_keycodes { include "sun(type5_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun_vndr/us(sun5ol)+iso9995-3+fr" }; + xkb_geometry { include "sun(type5euro)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sun_vndr/no b/xorg-server/xkeyboard-config/keymap/sun_vndr/no index 45669237e..200df8910 100644 --- a/xorg-server/xkeyboard-config/keymap/sun_vndr/no +++ b/xorg-server/xkeyboard-config/keymap/sun_vndr/no @@ -1,62 +1,59 @@ -// $TOG: de /main/3 1998/02/10 13:44:36 kaleb $ -// -//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. -// -// $XFree86: xc/programs/xkbcomp/keymap/sun_vndr/no,v 1.2 2000/10/28 00:34:05 dawes Exp $ -// -xkb_keymap "type4_no" { - xkb_keycodes { include "sun(type4_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun4)+iso9995-3(basic)+no" - }; - xkb_geometry { include "sun(type4)" }; -}; -xkb_keymap "type4_no_openlook" { - xkb_keycodes { include "sun(type4_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun4ol)+iso9995-3(basic)+no" - }; - xkb_geometry { include "sun(type4)" }; -}; -default xkb_keymap "type5_no" { - xkb_keycodes { include "sun(type5_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun5)+iso9995-3(basic)+no" - }; - xkb_geometry { include "sun(type5euro)" }; -}; -xkb_keymap "type5_no_openlook" { - xkb_keycodes { include "sun(type5_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun_vndr/us(sun5ol)+iso9995-3+no" }; - xkb_geometry { include "sun(type5euro)" }; -}; +// +//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. +// +xkb_keymap "type4_no" { + xkb_keycodes { include "sun(type4_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun4)+iso9995-3(basic)+no" + }; + xkb_geometry { include "sun(type4)" }; +}; +xkb_keymap "type4_no_openlook" { + xkb_keycodes { include "sun(type4_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun4ol)+iso9995-3(basic)+no" + }; + xkb_geometry { include "sun(type4)" }; +}; +default xkb_keymap "type5_no" { + xkb_keycodes { include "sun(type5_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun5)+iso9995-3(basic)+no" + }; + xkb_geometry { include "sun(type5euro)" }; +}; +xkb_keymap "type5_no_openlook" { + xkb_keycodes { include "sun(type5_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun_vndr/us(sun5ol)+iso9995-3+no" }; + xkb_geometry { include "sun(type5euro)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sun_vndr/pl b/xorg-server/xkeyboard-config/keymap/sun_vndr/pl index 904ffb2d7..2da430f27 100644 --- a/xorg-server/xkeyboard-config/keymap/sun_vndr/pl +++ b/xorg-server/xkeyboard-config/keymap/sun_vndr/pl @@ -1,62 +1,59 @@ -// $TOG: de /main/3 1998/02/10 13:44:36 kaleb $ -// -//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. -// -// $XFree86: xc/programs/xkbcomp/keymap/sun_vndr/pl,v 1.2 2000/10/28 00:34:05 dawes Exp $ -// -xkb_keymap "type4_pl" { - xkb_keycodes { include "sun(type4_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun4)+iso9995-3(basic)+pl" - }; - xkb_geometry { include "sun(type4)" }; -}; -xkb_keymap "type4_pl_openlook" { - xkb_keycodes { include "sun(type4_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun4ol)+iso9995-3(basic)+pl" - }; - xkb_geometry { include "sun(type4)" }; -}; -default xkb_keymap "type5_pl" { - xkb_keycodes { include "sun(type5_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun5)+iso9995-3(basic)+pl" - }; - xkb_geometry { include "sun(type5euro)" }; -}; -xkb_keymap "type5_pl_openlook" { - xkb_keycodes { include "sun(type5_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun_vndr/us(sun5ol)+iso9995-3+pl" }; - xkb_geometry { include "sun(type5euro)" }; -}; +// +//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. +// +xkb_keymap "type4_pl" { + xkb_keycodes { include "sun(type4_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun4)+iso9995-3(basic)+pl" + }; + xkb_geometry { include "sun(type4)" }; +}; +xkb_keymap "type4_pl_openlook" { + xkb_keycodes { include "sun(type4_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun4ol)+iso9995-3(basic)+pl" + }; + xkb_geometry { include "sun(type4)" }; +}; +default xkb_keymap "type5_pl" { + xkb_keycodes { include "sun(type5_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun5)+iso9995-3(basic)+pl" + }; + xkb_geometry { include "sun(type5euro)" }; +}; +xkb_keymap "type5_pl_openlook" { + xkb_keycodes { include "sun(type5_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun_vndr/us(sun5ol)+iso9995-3+pl" }; + xkb_geometry { include "sun(type5euro)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sun_vndr/ru b/xorg-server/xkeyboard-config/keymap/sun_vndr/ru index fc7d75b1e..005f27f3c 100644 --- a/xorg-server/xkeyboard-config/keymap/sun_vndr/ru +++ b/xorg-server/xkeyboard-config/keymap/sun_vndr/ru @@ -1,62 +1,59 @@ -// $TOG: de /main/3 1998/02/10 13:44:36 kaleb $ -// -//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. -// -// $XFree86: xc/programs/xkbcomp/keymap/sun_vndr/ru,v 1.2 2000/10/28 00:34:05 dawes Exp $ -// -xkb_keymap "type4_ru" { - xkb_keycodes { include "sun(type4_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun4)+iso9995-3(basic)+ru" - }; - xkb_geometry { include "sun(type4)" }; -}; -xkb_keymap "type4_ru_openlook" { - xkb_keycodes { include "sun(type4_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun4ol)+iso9995-3(basic)+ru" - }; - xkb_geometry { include "sun(type4)" }; -}; -default xkb_keymap "type5_ru" { - xkb_keycodes { include "sun(type5_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun5)+iso9995-3(basic)+ru" - }; - xkb_geometry { include "sun(type5euro)" }; -}; -xkb_keymap "type5_ru_openlook" { - xkb_keycodes { include "sun(type5_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun_vndr/us(sun5ol)+iso9995-3+ru" }; - xkb_geometry { include "sun(type5euro)" }; -}; +// +//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. +// +xkb_keymap "type4_ru" { + xkb_keycodes { include "sun(type4_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun4)+iso9995-3(basic)+ru" + }; + xkb_geometry { include "sun(type4)" }; +}; +xkb_keymap "type4_ru_openlook" { + xkb_keycodes { include "sun(type4_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun4ol)+iso9995-3(basic)+ru" + }; + xkb_geometry { include "sun(type4)" }; +}; +default xkb_keymap "type5_ru" { + xkb_keycodes { include "sun(type5_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun5)+iso9995-3(basic)+ru" + }; + xkb_geometry { include "sun(type5euro)" }; +}; +xkb_keymap "type5_ru_openlook" { + xkb_keycodes { include "sun(type5_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun_vndr/us(sun5ol)+iso9995-3+ru" }; + xkb_geometry { include "sun(type5euro)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sun_vndr/se b/xorg-server/xkeyboard-config/keymap/sun_vndr/se index fad7009e4..cb3cc6d00 100644 --- a/xorg-server/xkeyboard-config/keymap/sun_vndr/se +++ b/xorg-server/xkeyboard-config/keymap/sun_vndr/se @@ -1,56 +1,54 @@ -// $XFree86: xc/programs/xkbcomp/keymap/sun_vndr/se,v 1.2 1998/12/20 09:34:42 dawes Exp $ - -default xkb_keymap "type5c_se_fixdollar" { - xkb_keycodes { include "sun(type5_se)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/se(sun5)+se(fixdollar)" - }; - xkb_geometry { include "sun(type5c_se)" }; -}; -xkb_keymap "type5c_se" { - xkb_keycodes { include "sun(type5_se)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/se(sun5)" - }; - xkb_geometry { include "sun(type5c_se)" }; -}; -xkb_keymap "type5_se" { - xkb_keycodes { include "sun(type5_se)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/se(sun5)" - }; - xkb_geometry { include "sun(type5_se)" }; -}; -xkb_keymap "type4_se_fixdollar_swapctl" { - xkb_keycodes { include "sun(type4_se_swapctl)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/se(sun4)+se(fixdollar)" - }; - xkb_geometry { include "sun(type4_se)" }; -}; -xkb_keymap "type4_se_fixdollar" { - xkb_keycodes { include "sun(type4_se)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/se(sun4)+se(fixdollar)" - }; - xkb_geometry { include "sun(type4_se)" }; -}; -xkb_keymap "type4_se" { - xkb_keycodes { include "sun(type4_se)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/se(sun4)" - }; - xkb_geometry { include "sun(type4_se)" }; -}; +default xkb_keymap "type5c_se_fixdollar" { + xkb_keycodes { include "sun(type5_se)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/se(sun5)+se(fixdollar)" + }; + xkb_geometry { include "sun(type5c_se)" }; +}; +xkb_keymap "type5c_se" { + xkb_keycodes { include "sun(type5_se)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/se(sun5)" + }; + xkb_geometry { include "sun(type5c_se)" }; +}; +xkb_keymap "type5_se" { + xkb_keycodes { include "sun(type5_se)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/se(sun5)" + }; + xkb_geometry { include "sun(type5_se)" }; +}; +xkb_keymap "type4_se_fixdollar_swapctl" { + xkb_keycodes { include "sun(type4_se_swapctl)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/se(sun4)+se(fixdollar)" + }; + xkb_geometry { include "sun(type4_se)" }; +}; +xkb_keymap "type4_se_fixdollar" { + xkb_keycodes { include "sun(type4_se)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/se(sun4)+se(fixdollar)" + }; + xkb_geometry { include "sun(type4_se)" }; +}; +xkb_keymap "type4_se" { + xkb_keycodes { include "sun(type4_se)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/se(sun4)" + }; + xkb_geometry { include "sun(type4_se)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sun_vndr/uk b/xorg-server/xkeyboard-config/keymap/sun_vndr/uk index e1fb4970b..11b3efd58 100644 --- a/xorg-server/xkeyboard-config/keymap/sun_vndr/uk +++ b/xorg-server/xkeyboard-config/keymap/sun_vndr/uk @@ -1,62 +1,59 @@ -// $TOG: de /main/3 1998/02/10 13:44:36 kaleb $ -// -//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. -// -// $XFree86: xc/programs/xkbcomp/keymap/sun_vndr/uk,v 1.2 2000/10/28 00:34:05 dawes Exp $ -// -xkb_keymap "type4_uk" { - xkb_keycodes { include "sun(type4_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun4)+iso9995-3(basic)+uk" - }; - xkb_geometry { include "sun(type4)" }; -}; -xkb_keymap "type4_uk_openlook" { - xkb_keycodes { include "sun(type4_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun4ol)+iso9995-3(basic)+uk" - }; - xkb_geometry { include "sun(type4)" }; -}; -default xkb_keymap "type5_uk" { - xkb_keycodes { include "sun(type5_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { - include "sun_vndr/us(sun5)+iso9995-3(basic)+uk" - }; - xkb_geometry { include "sun(type5euro)" }; -}; -xkb_keymap "type5_uk_openlook" { - xkb_keycodes { include "sun(type5_euro)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun_vndr/us(sun5ol)+iso9995-3+uk" }; - xkb_geometry { include "sun(type5euro)" }; -}; +// +//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. +// +xkb_keymap "type4_uk" { + xkb_keycodes { include "sun(type4_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun4)+iso9995-3(basic)+uk" + }; + xkb_geometry { include "sun(type4)" }; +}; +xkb_keymap "type4_uk_openlook" { + xkb_keycodes { include "sun(type4_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun4ol)+iso9995-3(basic)+uk" + }; + xkb_geometry { include "sun(type4)" }; +}; +default xkb_keymap "type5_uk" { + xkb_keycodes { include "sun(type5_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { + include "sun_vndr/us(sun5)+iso9995-3(basic)+uk" + }; + xkb_geometry { include "sun(type5euro)" }; +}; +xkb_keymap "type5_uk_openlook" { + xkb_keycodes { include "sun(type5_euro)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun_vndr/us(sun5ol)+iso9995-3+uk" }; + xkb_geometry { include "sun(type5euro)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/sun_vndr/us b/xorg-server/xkeyboard-config/keymap/sun_vndr/us index 397482f84..68b41de4b 100644 --- a/xorg-server/xkeyboard-config/keymap/sun_vndr/us +++ b/xorg-server/xkeyboard-config/keymap/sun_vndr/us @@ -1,68 +1,67 @@ -// $Xorg: us,v 1.4 2001/02/09 02:05:52 xorgcvs Exp $ -// -//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. -// -xkb_keymap "type4_us" { - xkb_keycodes { include "sun(type4)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun_vndr/us(sun4)" }; - xkb_geometry { include "sun(type4)" }; -}; -xkb_keymap "type4_us_openlook" { - xkb_keycodes { include "sun(type4)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun_vndr/us(sun4ol)" }; - xkb_geometry { include "sun(type4)" }; -}; -default xkb_keymap "type5_us" { - xkb_keycodes { include "sun(type5)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun_vndr/us(sun5)" }; - xkb_geometry { include "sun(type5)" }; -}; -xkb_keymap "type5_us_openlook" { - xkb_keycodes { include "sun(type5)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun_vndr/us(sun5ol)" }; - xkb_geometry { include "sun(type5)" }; -}; -xkb_keymap "type5_unix" { - xkb_keycodes { include "sun(type5)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun_vndr/us(sun5)" }; - xkb_geometry { include "sun(type5unix)" }; -}; -xkb_keymap "type5_unix_openlook" { - xkb_keycodes { include "sun(type5)" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "sun_vndr/us(sun5ol)" }; - xkb_geometry { include "sun(type5unix)" }; -}; +// +//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. +// +xkb_keymap "type4_us" { + xkb_keycodes { include "sun(type4)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun_vndr/us(sun4)" }; + xkb_geometry { include "sun(type4)" }; +}; +xkb_keymap "type4_us_openlook" { + xkb_keycodes { include "sun(type4)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun_vndr/us(sun4ol)" }; + xkb_geometry { include "sun(type4)" }; +}; +default xkb_keymap "type5_us" { + xkb_keycodes { include "sun(type5)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun_vndr/us(sun5)" }; + xkb_geometry { include "sun(type5)" }; +}; +xkb_keymap "type5_us_openlook" { + xkb_keycodes { include "sun(type5)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun_vndr/us(sun5ol)" }; + xkb_geometry { include "sun(type5)" }; +}; +xkb_keymap "type5_unix" { + xkb_keycodes { include "sun(type5)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun_vndr/us(sun5)" }; + xkb_geometry { include "sun(type5unix)" }; +}; +xkb_keymap "type5_unix_openlook" { + xkb_keycodes { include "sun(type5)" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "sun_vndr/us(sun5ol)" }; + xkb_geometry { include "sun(type5unix)" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/xfree86 b/xorg-server/xkeyboard-config/keymap/xfree86 index 8686f78d8..b65efa12f 100644 --- a/xorg-server/xkeyboard-config/keymap/xfree86 +++ b/xorg-server/xkeyboard-config/keymap/xfree86 @@ -1,377 +1,374 @@ -// $XFree86: xc/programs/xkbcomp/keymap/xfree86,v 3.30 2003/04/03 16:34:49 dawes Exp $ - - -default xkb_keymap "us" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)" }; - xkb_geometry { include "pc" }; -}; - -// "ar" addition by Arabeyes Team, -xkb_keymap "ar" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+ara" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "be" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+be" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "bg" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+bg" }; - xkb_geometry { include "pc(pc102)" }; -}; -// us_intl and br by Ricardo Y. Igarashi (iga@that.com.br) -xkb_keymap "br" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+br" }; - xkb_geometry { include "pc(abnt2)" }; -}; -// cz and sk keymaps by Kamil Toman (ktoman@email.cz) -// are designed to replace old czechoslovakian and czsk keyboards -// and their prog variants. Those are now obsolete and should not be used anymore. -xkb_keymap "cz" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+cz" }; - xkb_geometry { include "pc" }; -}; -xkb_keymap "de" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+de" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "ch_de" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+ch(de)" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "ch_fr" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+ch(fr)" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "dk" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+dk" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "dvorak" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+us(dvorak)"}; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "en_US" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)" }; - xkb_geometry { include "pc" }; -}; -xkb_keymap "es" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+es" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "fr" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+fr" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "fr-latin9" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+fr-latin9" }; - xkb_geometry { include "pc" }; -}; -xkb_keymap "fr_CA" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+ca" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "gb" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+gb" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "hr" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+hr" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "it" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+it" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "jp106" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "jp(jp106)" }; - xkb_geometry { include "pc(jp106)" }; -}; -xkb_keymap "lt" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+lt" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "lt_std" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+lt(std)" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "lv" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+lv" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "mk" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+mk" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "mt" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+mt" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "no" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+no" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "pl" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+pl" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "pt" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+pt" }; - xkb_geometry { include "pc(pc102)" }; -}; -// ro: additions by Cristian Gafton, -xkb_keymap "ro" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+ro(pc101)" }; - xkb_geometry { include "pc(pc101)" }; -}; -xkb_keymap "ro_microsoft" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+ro(pc105)" }; - xkb_geometry { include "pc(pc105)" }; -}; -xkb_keymap "ru" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+ru" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "se_FI" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+fi" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "se_SE" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+se" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "sl" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+si" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "sl_SI" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+si" }; - xkb_geometry { include "pc(pc102)" }; -}; -// cz and sk keymaps by Kamil Toman (ktoman@email.cz) -// are designed to replace old czechoslovakian and czsk keyboards -// and their prog variants. Those are now obsolete and should not be used anymore. -xkb_keymap "sk" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+sk" }; - xkb_geometry { include "pc" }; -}; -// Additions by Emil Soleyman-Zomalan, -xkb_keymap "syr" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+syr" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "th" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+th" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "th_tis" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+th(tis)" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "th_pat" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+th(pat)" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "tr" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+tr" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "uk" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+uk)" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "us_flexpro" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc105)" }; - xkb_geometry { include "keytronic(FlexPro)" }; -}; -// us_intl and br by Ricardo Y. Igarashi (iga@that.com.br) -// us_intl means standard us keyboard plus dead_keys symbols -// these keyboards are very popular in Brazil -xkb_keymap "us_intl" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc101)+us(intl)" }; - xkb_geometry { include "pc" }; -}; -xkb_keymap "us_microsoft" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "us(pc105)" }; - xkb_geometry { include "microsoft" }; -}; - -xkb_keymap "uz" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+uz" }; - xkb_geometry { include "pc(pc102)" }; -}; - -# svu: compatibility keymaps, based on variants -xkb_keymap "cz_qwerty" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+cz(qwerty)" }; - xkb_geometry { include "pc" }; -}; -xkb_keymap "de_CH" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+ch(de)" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "fr_CH" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+ch(fr)" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "mt_us" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+mt(us)" }; - xkb_geometry { include "pc(pc102)" }; -}; -xkb_keymap "sk_qwerty" { - xkb_keycodes { include "xfree86" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "pc(pc105)+sk(qwerty)" }; - xkb_geometry { include "pc" }; -}; +default xkb_keymap "us" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)" }; + xkb_geometry { include "pc" }; +}; + +// "ar" addition by Arabeyes Team, +xkb_keymap "ar" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+ara" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "be" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+be" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "bg" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+bg" }; + xkb_geometry { include "pc(pc102)" }; +}; +// us_intl and br by Ricardo Y. Igarashi (iga@that.com.br) +xkb_keymap "br" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+br" }; + xkb_geometry { include "pc(abnt2)" }; +}; +// cz and sk keymaps by Kamil Toman (ktoman@email.cz) +// are designed to replace old czechoslovakian and czsk keyboards +// and their prog variants. Those are now obsolete and should not be used anymore. +xkb_keymap "cz" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+cz" }; + xkb_geometry { include "pc" }; +}; +xkb_keymap "de" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+de" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "ch_de" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+ch(de)" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "ch_fr" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+ch(fr)" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "dk" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+dk" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "dvorak" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+us(dvorak)"}; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "en_US" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)" }; + xkb_geometry { include "pc" }; +}; +xkb_keymap "es" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+es" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "fr" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+fr" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "fr-latin9" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+fr-latin9" }; + xkb_geometry { include "pc" }; +}; +xkb_keymap "fr_CA" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+ca" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "gb" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+gb" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "hr" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+hr" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "it" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+it" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "jp106" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "jp(jp106)" }; + xkb_geometry { include "pc(jp106)" }; +}; +xkb_keymap "lt" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+lt" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "lt_std" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+lt(std)" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "lv" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+lv" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "mk" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+mk" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "mt" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+mt" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "no" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+no" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "pl" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+pl" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "pt" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+pt" }; + xkb_geometry { include "pc(pc102)" }; +}; +// ro: additions by Cristian Gafton, +xkb_keymap "ro" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+ro(pc101)" }; + xkb_geometry { include "pc(pc101)" }; +}; +xkb_keymap "ro_microsoft" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+ro(pc105)" }; + xkb_geometry { include "pc(pc105)" }; +}; +xkb_keymap "ru" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+ru" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "se_FI" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+fi" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "se_SE" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+se" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "sl" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+si" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "sl_SI" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+si" }; + xkb_geometry { include "pc(pc102)" }; +}; +// cz and sk keymaps by Kamil Toman (ktoman@email.cz) +// are designed to replace old czechoslovakian and czsk keyboards +// and their prog variants. Those are now obsolete and should not be used anymore. +xkb_keymap "sk" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+sk" }; + xkb_geometry { include "pc" }; +}; +// Additions by Emil Soleyman-Zomalan, +xkb_keymap "syr" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+syr" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "th" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+th" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "th_tis" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+th(tis)" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "th_pat" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+th(pat)" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "tr" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+tr" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "uk" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+uk)" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "us_flexpro" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc105)" }; + xkb_geometry { include "keytronic(FlexPro)" }; +}; +// us_intl and br by Ricardo Y. Igarashi (iga@that.com.br) +// us_intl means standard us keyboard plus dead_keys symbols +// these keyboards are very popular in Brazil +xkb_keymap "us_intl" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc101)+us(intl)" }; + xkb_geometry { include "pc" }; +}; +xkb_keymap "us_microsoft" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "us(pc105)" }; + xkb_geometry { include "microsoft" }; +}; + +xkb_keymap "uz" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+uz" }; + xkb_geometry { include "pc(pc102)" }; +}; + +# svu: compatibility keymaps, based on variants +xkb_keymap "cz_qwerty" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+cz(qwerty)" }; + xkb_geometry { include "pc" }; +}; +xkb_keymap "de_CH" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+ch(de)" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "fr_CH" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+ch(fr)" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "mt_us" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+mt(us)" }; + xkb_geometry { include "pc(pc102)" }; +}; +xkb_keymap "sk_qwerty" { + xkb_keycodes { include "xfree86" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "pc(pc105)+sk(qwerty)" }; + xkb_geometry { include "pc" }; +}; diff --git a/xorg-server/xkeyboard-config/keymap/xfree98 b/xorg-server/xkeyboard-config/keymap/xfree98 index b344eedbc..c9beb560e 100644 --- a/xorg-server/xkeyboard-config/keymap/xfree98 +++ b/xorg-server/xkeyboard-config/keymap/xfree98 @@ -1,35 +1,33 @@ -// $Xorg: xfree98,v 1.4 2001/02/09 02:05:52 xorgcvs Exp $ -// -//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. -// -// $XFree86: xc/programs/xkbcomp/keymap/xfree98,v 3.6 2001/01/17 23:45:53 dawes Exp $ - -default xkb_keymap "jp" { - xkb_keycodes { include "xfree98" }; - xkb_types { include "default" }; - xkb_compatibility { include "default" }; - xkb_symbols { include "nec_vndr/jp(pc98)" }; - xkb_geometry { include "nec(pc98)" }; -}; +// +//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. +// + +default xkb_keymap "jp" { + xkb_keycodes { include "xfree98" }; + xkb_types { include "default" }; + xkb_compatibility { include "default" }; + xkb_symbols { include "nec_vndr/jp(pc98)" }; + xkb_geometry { include "nec(pc98)" }; +}; diff --git a/xorg-server/xkeyboard-config/rules/base.hdr.part b/xorg-server/xkeyboard-config/rules/base.hdr.part index d867c8876..6550f864d 100644 --- a/xorg-server/xkeyboard-config/rules/base.hdr.part +++ b/xorg-server/xkeyboard-config/rules/base.hdr.part @@ -1,9 +1,6 @@ -// $Xorg: xfree86,v 1.3 2000/08/17 19:54:42 cpqbld Exp $ - -// -// Rules for resolving XKB components for use with XFree86 -// Copyright 1996 by Joseph Moss -// -// 2002 Modifier: Ivan Pascal The XFree86 Project -// $XFree86: xc/programs/xkbcomp/rules/xfree86,v 3.79 2004/01/09 00:16:01 dawes Exp $ -// +// +// Rules for resolving XKB components for use with XFree86 +// Copyright 1996 by Joseph Moss +// +// 2002 Modifier: Ivan Pascal The XFree86 Project +// diff --git a/xorg-server/xkeyboard-config/rules/base.xml.in b/xorg-server/xkeyboard-config/rules/base.xml.in index 6600d3bcb..919ed4b34 100644 --- a/xorg-server/xkeyboard-config/rules/base.xml.in +++ b/xorg-server/xkeyboard-config/rules/base.xml.in @@ -3061,7 +3061,24 @@ <_description>Laos lao - + + + + basic + <_description>Laos + lao + + + + + + stea + <_description>Laos - STEA (proposed standard layout) + lao + + + + diff --git a/xorg-server/xkeyboard-config/rules/xfree98 b/xorg-server/xkeyboard-config/rules/xfree98 index 4e16c6dc9..1196f7488 100644 --- a/xorg-server/xkeyboard-config/rules/xfree98 +++ b/xorg-server/xkeyboard-config/rules/xfree98 @@ -2,8 +2,6 @@ // Rules for resolving XKB components for use with XFree86 // Copyright 1996 by Joseph Moss // -// $XFree86: xc/programs/xkbcomp/rules/xfree86,v 3.5 1996/12/17 21:03:59 dawes Exp $ -// ! model = keycodes geometry pc98 = xfree98(pc98) nec(pc98) diff --git a/xorg-server/xkeyboard-config/semantics/basic b/xorg-server/xkeyboard-config/semantics/basic index 014e9ca68..71575a3a3 100644 --- a/xorg-server/xkeyboard-config/semantics/basic +++ b/xorg-server/xkeyboard-config/semantics/basic @@ -1,7 +1,6 @@ -// $Xorg: basic,v 1.3 2000/08/17 19:54:42 cpqbld Exp $ -default xkb_semantics "basic" { - -xkb_types { include "basic" }; -xkb_compatibility { include "basic" }; - -}; +default xkb_semantics "basic" { + +xkb_types { include "basic" }; +xkb_compatibility { include "basic" }; + +}; diff --git a/xorg-server/xkeyboard-config/semantics/complete b/xorg-server/xkeyboard-config/semantics/complete index df1632e29..08152e563 100644 --- a/xorg-server/xkeyboard-config/semantics/complete +++ b/xorg-server/xkeyboard-config/semantics/complete @@ -1,7 +1,6 @@ -// $Xorg: complete,v 1.3 2000/08/17 19:54:42 cpqbld Exp $ -default xkb_semantics "complete" { - -xkb_types { include "complete" }; -xkb_compatibility { include "complete" }; - -}; +default xkb_semantics "complete" { + +xkb_types { include "complete" }; +xkb_compatibility { include "complete" }; + +}; diff --git a/xorg-server/xkeyboard-config/semantics/default b/xorg-server/xkeyboard-config/semantics/default index 42e755e3c..2b8defc80 100644 --- a/xorg-server/xkeyboard-config/semantics/default +++ b/xorg-server/xkeyboard-config/semantics/default @@ -1,7 +1,6 @@ -// $Xorg: default,v 1.3 2000/08/17 19:54:42 cpqbld Exp $ -default xkb_semantics "default" { - -xkb_types { include "default" }; -xkb_compatibility { include "default" }; - -}; +default xkb_semantics "default" { + +xkb_types { include "default" }; +xkb_compatibility { include "default" }; + +}; diff --git a/xorg-server/xkeyboard-config/semantics/xtest b/xorg-server/xkeyboard-config/semantics/xtest index d221fe5b4..64a35459b 100644 --- a/xorg-server/xkeyboard-config/semantics/xtest +++ b/xorg-server/xkeyboard-config/semantics/xtest @@ -1,7 +1,6 @@ -// $Xorg: xtest,v 1.3 2000/08/17 19:54:42 cpqbld Exp $ -default xkb_semantics "xtest" { - -xkb_types { include "basic" }; -xkb_compatibility { include "xtest" }; - -}; +default xkb_semantics "xtest" { + +xkb_types { include "basic" }; +xkb_compatibility { include "xtest" }; + +}; diff --git a/xorg-server/xkeyboard-config/symbols/ad b/xorg-server/xkeyboard-config/symbols/ad index 3836ca34d..bce6f6140 100644 --- a/xorg-server/xkeyboard-config/symbols/ad +++ b/xorg-server/xkeyboard-config/symbols/ad @@ -1,34 +1,31 @@ -// $XKeyboardConfig$ - -// -// Catalan Keyboard, as manufactured by Large Format Computing, Inc. -// -// For layout graphic, see http://www.language-keyboard.com/languages/catalan_layout.htm -// -// Contributed by Robert Millan - -partial default alphanumeric_keys -xkb_symbols "basic" { - include "us" - - name[Group1]="Andorra"; - - key { [ 2, at, dead_diaeresis ] }; - key { [ 7, ampersand, dead_acute ] }; - key { [ 9, parenleft, dead_grave ] }; - key { [ w, W, eacute, Eacute ] }; - key { [ e, E, egrave, Egrave ] }; - key { [ y, Y, udiaeresis, Udiaeresis ] }; - key { [ u, U, uacute, Uacute ] }; - key { [ i, I, iacute, Iacute ] }; - key { [ o, O, oacute, Oacute ] }; - key { [ p, P, ograve, Ograve ] }; - key { [ bracketright, braceright, EuroSign ] }; - key { [ a, A, agrave, Agrave ] }; - key { [ k, K, idiaeresis, Idiaeresis ] }; - key { [ l, L, periodcentered ] }; - key { [ c, C, ccedilla, Ccedilla ] }; - - include "level3(ralt_switch)" -}; - +// +// Catalan Keyboard, as manufactured by Large Format Computing, Inc. +// +// For layout graphic, see http://www.language-keyboard.com/languages/catalan_layout.htm +// +// Contributed by Robert Millan + +partial default alphanumeric_keys +xkb_symbols "basic" { + include "us" + + name[Group1]="Andorra"; + + key { [ 2, at, dead_diaeresis ] }; + key { [ 7, ampersand, dead_acute ] }; + key { [ 9, parenleft, dead_grave ] }; + key { [ w, W, eacute, Eacute ] }; + key { [ e, E, egrave, Egrave ] }; + key { [ y, Y, udiaeresis, Udiaeresis ] }; + key { [ u, U, uacute, Uacute ] }; + key { [ i, I, iacute, Iacute ] }; + key { [ o, O, oacute, Oacute ] }; + key { [ p, P, ograve, Ograve ] }; + key { [ bracketright, braceright, EuroSign ] }; + key { [ a, A, agrave, Agrave ] }; + key { [ k, K, idiaeresis, Idiaeresis ] }; + key { [ l, L, periodcentered ] }; + key { [ c, C, ccedilla, Ccedilla ] }; + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/af b/xorg-server/xkeyboard-config/symbols/af index d8a88526a..90bfe127d 100644 --- a/xorg-server/xkeyboard-config/symbols/af +++ b/xorg-server/xkeyboard-config/symbols/af @@ -1,4 +1,3 @@ -// $XKeyboardConfig$ // // Keymap for the Afghan dari keybord layout // Based on the specification "Computer Locale Requirements for diff --git a/xorg-server/xkeyboard-config/symbols/al b/xorg-server/xkeyboard-config/symbols/al index 18f11139e..9f006748c 100644 --- a/xorg-server/xkeyboard-config/symbols/al +++ b/xorg-server/xkeyboard-config/symbols/al @@ -1,44 +1,41 @@ -// $XKeyboardConfig$ - -// based on -// albanian keyboard layout -// done by Pablo Saratxaga -// -// $XFree86: xc/programs/xkbcomp/symbols/al,v 1.2 2002/11/22 04:03:28 dawes Exp $ - -partial default alphanumeric_keys -xkb_symbols "basic" { - - include "latin(type3)" - - name[Group1]="Albania"; - - key { [ 1, exclam, asciitilde, dead_tilde ] }; - key { [ 2, quotedbl, dead_caron, oneeighth ] }; - key { [ 3, numbersign, dead_circumflex, sterling ] }; - key { [ 4, dollar, dead_breve, dollar ] }; - key { [ 5, percent, dead_abovering, threeeighths] }; - key { [ 6, asciicircum, dead_ogonek, fiveeighths ] }; - key { [ 7, ampersand, grave, dead_grave ] }; - key { [ 8, asterisk, dead_abovedot, trademark ] }; - key { [ 9, parenleft, dead_acute, plusminus ] }; - key { [ 0, parenright, dead_doubleacute, degree ] }; - key { [ minus, underscore, dead_diaeresis, questiondown] }; - - key { [ e, E, EuroSign, EuroSign ] }; - key { [ ccedilla, Ccedilla, division, dead_abovering ] }; - key { [ at, apostrophe, multiply, dead_macron ] }; - - key { [ s, S, dstroke, section ] }; - key { [ d, D, Dstroke, ETH ] }; - key { [ediaeresis, Ediaeresis, dollar, dead_doubleacute ] }; - key { [bracketleft, braceleft, ssharp, dead_caron ] }; - key { [ backslash, bar, notsign, notsign ] }; - - key { [bracketright, braceright, currency, dead_breve ] }; - key { [ comma, semicolon, less, multiply ] }; - key { [ period, colon, greater, division ] }; - key { [ slash, question, dead_belowdot, dead_abovedot ] }; - - include "level3(ralt_switch)" -}; +// based on +// albanian keyboard layout +// done by Pablo Saratxaga +// + +partial default alphanumeric_keys +xkb_symbols "basic" { + + include "latin(type3)" + + name[Group1]="Albania"; + + key { [ 1, exclam, asciitilde, dead_tilde ] }; + key { [ 2, quotedbl, dead_caron, oneeighth ] }; + key { [ 3, numbersign, dead_circumflex, sterling ] }; + key { [ 4, dollar, dead_breve, dollar ] }; + key { [ 5, percent, dead_abovering, threeeighths] }; + key { [ 6, asciicircum, dead_ogonek, fiveeighths ] }; + key { [ 7, ampersand, grave, dead_grave ] }; + key { [ 8, asterisk, dead_abovedot, trademark ] }; + key { [ 9, parenleft, dead_acute, plusminus ] }; + key { [ 0, parenright, dead_doubleacute, degree ] }; + key { [ minus, underscore, dead_diaeresis, questiondown] }; + + key { [ e, E, EuroSign, EuroSign ] }; + key { [ ccedilla, Ccedilla, division, dead_abovering ] }; + key { [ at, apostrophe, multiply, dead_macron ] }; + + key { [ s, S, dstroke, section ] }; + key { [ d, D, Dstroke, ETH ] }; + key { [ediaeresis, Ediaeresis, dollar, dead_doubleacute ] }; + key { [bracketleft, braceleft, ssharp, dead_caron ] }; + key { [ backslash, bar, notsign, notsign ] }; + + key { [bracketright, braceright, currency, dead_breve ] }; + key { [ comma, semicolon, less, multiply ] }; + key { [ period, colon, greater, division ] }; + key { [ slash, question, dead_belowdot, dead_abovedot ] }; + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/altwin b/xorg-server/xkeyboard-config/symbols/altwin index 4463fe06c..597b3fb92 100644 --- a/xorg-server/xkeyboard-config/symbols/altwin +++ b/xorg-server/xkeyboard-config/symbols/altwin @@ -1,83 +1,79 @@ -// $XKeyboardConfig$ - -// $XFree86: xc/programs/xkbcomp/symbols/altwin,v 1.5 2003/12/03 14:09:08 pascal Exp $ - -partial modifier_keys -xkb_symbols "meta_alt" { - key { [ Alt_L, Meta_L ] }; - key { type[Group1] = "TWO_LEVEL", - symbols[Group1] = [ Alt_R, Meta_R ] }; - modifier_map Mod1 { Alt_L, Alt_R, Meta_L, Meta_R }; -// modifier_map Mod4 {}; -}; - -// Control is mapped to the Win-keys (and the usual Ctrl keys). -partial modifier_keys -xkb_symbols "ctrl_win" { - key { [ Control_L ] }; - key { [ Control_R ] }; - modifier_map Control { , }; -}; - -// Ctrl is mapped to the Alt-keys, Alt is mapped to the Win-keys, Win is mapped to the Ctrl-keys. -partial modifier_keys -xkb_symbols "ctrl_alt_win" { - key { [ Control_L, Control_L ] }; - key { type[Group1] = "TWO_LEVEL", - symbols[Group1] = [ Control_R, Control_R ] }; - key { [ Alt_L, Meta_L ] }; - key { [ Alt_R, Meta_R ] }; - modifier_map Control { , }; - modifier_map Mod1 { , }; -}; - - -partial modifier_keys -xkb_symbols "meta_win" { - key { [ Alt_L, Alt_L ] }; - key { type[Group1] = "TWO_LEVEL", - symbols[Group1] = [ Alt_R, Alt_R ] }; - key { [ Meta_L ] }; - key { [ Meta_R ] }; - modifier_map Mod1 { Alt_L, Alt_R }; - modifier_map Mod4 { , Meta_L, Meta_R }; -}; - -partial modifier_keys -xkb_symbols "left_meta_win" { - key { [ Alt_L, Alt_L ] }; - key { [ Meta_L ] }; - modifier_map Mod1 { Alt_L }; - modifier_map Mod4 { , Meta_L }; -}; - -partial modifier_keys -xkb_symbols "hyper_win" { - key { [ Hyper_L ] }; - key { [ Hyper_R ] }; - modifier_map Mod4 { Hyper_L, Hyper_R }; -}; - -// Use Menu for the menu key -partial modifier_keys -xkb_symbols "menu" { - key { [ Menu ] }; -}; - -// Layout for Tux key caps with additional right Alt key -partial modifier_keys -xkb_symbols "alt_super_win" { - key { [ Alt_L, Meta_L ] }; - key { [ Alt_R, Meta_R ] }; - key { [ Super_L ] }; - key { [ Super_R ] }; - modifier_map Mod1 { Alt_L, Alt_R, Meta_L, Meta_R }; - modifier_map Mod4 { Super_L, Super_R }; -}; - -partial modifier_keys -xkb_symbols "swap_lalt_lwin" { - key { type[Group1] = "ONE_LEVEL", - symbols[Group1] = [ Super_L ] }; - key { [ Alt_L, Meta_L ] }; -}; +partial modifier_keys +xkb_symbols "meta_alt" { + key { [ Alt_L, Meta_L ] }; + key { type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ Alt_R, Meta_R ] }; + modifier_map Mod1 { Alt_L, Alt_R, Meta_L, Meta_R }; +// modifier_map Mod4 {}; +}; + +// Control is mapped to the Win-keys (and the usual Ctrl keys). +partial modifier_keys +xkb_symbols "ctrl_win" { + key { [ Control_L ] }; + key { [ Control_R ] }; + modifier_map Control { , }; +}; + +// Ctrl is mapped to the Alt-keys, Alt is mapped to the Win-keys, Win is mapped to the Ctrl-keys. +partial modifier_keys +xkb_symbols "ctrl_alt_win" { + key { [ Control_L, Control_L ] }; + key { type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ Control_R, Control_R ] }; + key { [ Alt_L, Meta_L ] }; + key { [ Alt_R, Meta_R ] }; + modifier_map Control { , }; + modifier_map Mod1 { , }; +}; + + +partial modifier_keys +xkb_symbols "meta_win" { + key { [ Alt_L, Alt_L ] }; + key { type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ Alt_R, Alt_R ] }; + key { [ Meta_L ] }; + key { [ Meta_R ] }; + modifier_map Mod1 { Alt_L, Alt_R }; + modifier_map Mod4 { , Meta_L, Meta_R }; +}; + +partial modifier_keys +xkb_symbols "left_meta_win" { + key { [ Alt_L, Alt_L ] }; + key { [ Meta_L ] }; + modifier_map Mod1 { Alt_L }; + modifier_map Mod4 { , Meta_L }; +}; + +partial modifier_keys +xkb_symbols "hyper_win" { + key { [ Hyper_L ] }; + key { [ Hyper_R ] }; + modifier_map Mod4 { Hyper_L, Hyper_R }; +}; + +// Use Menu for the menu key +partial modifier_keys +xkb_symbols "menu" { + key { [ Menu ] }; +}; + +// Layout for Tux key caps with additional right Alt key +partial modifier_keys +xkb_symbols "alt_super_win" { + key { [ Alt_L, Meta_L ] }; + key { [ Alt_R, Meta_R ] }; + key { [ Super_L ] }; + key { [ Super_R ] }; + modifier_map Mod1 { Alt_L, Alt_R, Meta_L, Meta_R }; + modifier_map Mod4 { Super_L, Super_R }; +}; + +partial modifier_keys +xkb_symbols "swap_lalt_lwin" { + key { type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ Super_L ] }; + key { [ Alt_L, Meta_L ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/am b/xorg-server/xkeyboard-config/symbols/am index 6fe84836c..f83548118 100644 --- a/xorg-server/xkeyboard-config/symbols/am +++ b/xorg-server/xkeyboard-config/symbols/am @@ -1,244 +1,240 @@ -// $XKeyboardConfig$ - -// based on a keyboard map from an 'xkb/symbols/am' file -// -// $XFree86: xc/programs/xkbcomp/symbols/am,v 1.4 2003/05/29 12:41:58 pascal Exp $ - -partial default alphanumeric_keys -xkb_symbols "basic" { - - name[Group1]= "Armenia"; - - // Alphanumeric section - key { [ 0x100055d, 0x100055c ] }; - key { [ question, 0x100058a ] }; - key { [ guillemotright, guillemotleft ] }; - - key { [ 0x1000586, 0x1000556 ] }; - key { [ 0x1000571, 0x1000541 ] }; - key { [ 0x1002013, 0x1002014 ] }; - key { [ comma, dollar ] }; - key { [ 0x1000589, 0x1002026 ] }; - key { [ 0x100055e, percent ] }; - key { [ 0x1002024, 0x1000587 ] }; - key { [ 0x100055b, 0x10002bc ] }; - key { [ parenright, parenleft ] }; - key { [ 0x1000585, 0x1000555 ] }; - key { [ 0x1000567, 0x1000537 ] }; - key { [ 0x1000572, 0x1000542 ] }; - - - key { [ 0x1000573, 0x1000543 ] }; - key { [ 0x1000583, 0x1000553 ] }; - key { [ 0x1000562, 0x1000532 ] }; - key { [ 0x100057d, 0x100054d ] }; - key { [ 0x1000574, 0x1000544 ] }; - key { [ 0x1000578, 0x1000548 ] }; - key { [ 0x1000582, 0x1000552 ] }; - key { [ 0x100056f, 0x100053f ] }; - key { [ 0x1000568, 0x1000538 ] }; - key { [ 0x1000569, 0x1000539 ] }; - key { [ 0x100056e, 0x100053e ] }; - key { [ 0x1000581, 0x1000551 ] }; - - key { [ 0x100057b, 0x100054b ] }; - key { [ 0x100057e, 0x100054e ] }; - key { [ 0x1000563, 0x1000533 ] }; - key { [ 0x1000565, 0x1000535 ] }; - key { [ 0x1000561, 0x1000531 ] }; - key { [ 0x1000576, 0x1000546 ] }; - key { [ 0x100056b, 0x100053b ] }; - key { [ 0x100057f, 0x100054f ] }; - key { [ 0x1000570, 0x1000540 ] }; - key { [ 0x100057a, 0x100054a ] }; - key { [ 0x1000580, 0x1000550 ] }; - - key { [ 0x100056a, 0x100053a ] }; - key { [ 0x1000564, 0x1000534 ] }; - key { [ 0x1000579, 0x1000549 ] }; - key { [ 0x1000575, 0x1000545 ] }; - key { [ 0x1000566, 0x1000536 ] }; - key { [ 0x100056c, 0x100053c ] }; - key { [ 0x1000584, 0x1000554 ] }; - key { [ 0x100056d, 0x100053d ] }; - key { [ 0x1000577, 0x1000547 ] }; - key { [ 0x100057c, 0x100054c ] }; - -}; - -partial alphanumeric_keys -xkb_symbols "olpc" { - include "am(basic)" - name[Group1]= "Armenia"; - - include "group(olpc)" -}; - -xkb_symbols "phonetic" { - include "am(basic)" - name[Group1]= "Armenia - Phonetic"; - - key { [ 0x1000577, 0x1000547 ] }; - - key { [ 0x1000567, 0x1000537 ] }; - key { [ 0x1000569, 0x1000539 ] }; - key { [ 0x1000583, 0x1000553 ] }; - key { [ 0x1000571, 0x1000541 ] }; - key { [ 0x100057b, 0x100054b ] }; - key { [ 0x1000582, 0x1000552 ] }; - key { [ 0x1000587, 0x1000587 ] }; - key { [ 0x100057c, 0x100054c ] }; - key { [ 0x1000579, 0x1000549 ] }; - key { [ 0x1000573, 0x1000543 ] }; - key { [ 0x100002D, 0x1002015 ] }; - key { [ 0x100056a, 0x100053a ] }; - - key { [ 0x1000584, 0x1000554 ] }; - key { [ 0x1000578, 0x1000548 ] }; - key { [ 0x1000565, 0x1000535 ] }; - key { [ 0x1000580, 0x1000550 ] }; - key { [ 0x100057f, 0x100054f ] }; - key { [ 0x1000568, 0x1000538 ] }; - key { [ 0x1000582, 0x1000552 ] }; - key { [ 0x100056b, 0x100053b ] }; - key { [ 0x1000585, 0x1000555 ] }; - key { [ 0x100057a, 0x100054a ] }; - key { [ 0x100056d, 0x100053d ] }; - key { [ 0x100056e, 0x100053e ] }; - - key { [ 0x1000561, 0x1000531 ] }; - key { [ 0x100057d, 0x100054d ] }; - key { [ 0x1000564, 0x1000534 ] }; - key { [ 0x1000586, 0x1000556 ] }; - key { [ 0x1000563, 0x1000533 ] }; - key { [ 0x1000570, 0x1000540 ] }; - key { [ 0x1000575, 0x1000545 ] }; - key { [ 0x100056f, 0x100053f ] }; - key { [ 0x100056c, 0x100053c ] }; - key { [ semicolon, 0x1000589 ] }; - key { [ 0x100055b, 0x1000022 ] }; - - key { [ 0x1000566, 0x1000536 ] }; - key { [ 0x1000572, 0x1000542 ] }; - key { [ 0x1000581, 0x1000551 ] }; - key { [ 0x100057e, 0x100054e ] }; - key { [ 0x1000562, 0x1000532 ] }; - key { [ 0x1000576, 0x1000546 ] }; - key { [ 0x1000574, 0x1000544 ] }; - key { [ 0x100002C, 0x10000AB ] }; - key { [ 0x1002024, 0x10000BB ] }; - key { [ 0x100002F, 0x100055e ] }; - -}; - -partial alphanumeric_keys -xkb_symbols "phonetic-alt" { - include "am(phonetic)" - name[Group1]= "Armenia - Alternative Phonetic"; - - key { [ 0x1000580, 0x1000550 ] }; - key { [ 0x100057c, 0x100054c ] }; - -}; - -partial alphanumeric_keys -xkb_symbols "eastern" { - - name[Group1]="Armenia - Eastern"; - - // This is the closer phonetic transliteration for Eastern Armenian - // than the Windows XP layout for Eastern Armenian, which seems - // to have contained a bug, with the reversal of 'g' for keh and 'c' for gim - // Also, AE01 (the colon) has been replaced with the Armenian_full_stop and - // capital AE07 (ken) with the Armenian ligature ew - - key { [ Armenian_separation_mark, Armenian_exclam ] }; -// key { [ colon, KP_1 ] }; - key { [ Armenian_full_stop, KP_1 ] }; - key { [ Armenian_dza, Armenian_DZA ] }; - key { [ Armenian_hi, Armenian_HI ] }; - key { [ Armenian_accent, KP_3 ] }; - key { [ comma, KP_4 ] }; - key { [ minus, KP_9 ] }; - key { [ period, Armenian_ligature_ew ] }; - key { [ guillemotleft, parenleft ] }; - key { [ guillemotright, parenright ] }; - key { [ Armenian_o, Armenian_O ] }; - key { [ Armenian_ra, Armenian_RA ] }; - key { [ Armenian_zhe, Armenian_ZHE ] }; - - key { [ Armenian_khe, Armenian_KHE ] }; - key { [ Armenian_vyun, Armenian_VYUN ] }; - key { [ Armenian_e, Armenian_E ] }; - key { [ Armenian_re, Armenian_RE ] }; - key { [ Armenian_tyun, Armenian_TYUN ] }; - key { [ Armenian_yech, Armenian_YECH ] }; - key { [ Armenian_at, Armenian_AT ] }; - key { [ Armenian_ini, Armenian_INI ] }; - key { [ Armenian_vo, Armenian_VO ] }; - key { [ Armenian_pe, Armenian_PE ] }; - key { [ Armenian_cha, Armenian_CHA ] }; - key { [ Armenian_je, Armenian_JE ] }; - key { [ apostrophe, Armenian_question ] }; - - key { [ Armenian_ayb, Armenian_AYB ] }; - key { [ Armenian_se, Armenian_SE ] }; - key { [ Armenian_da, Armenian_DA ] }; - key { [ Armenian_fe, Armenian_FE ] }; - key { [ Armenian_gim, Armenian_GIM ] }; - key { [ Armenian_ho, Armenian_HO ] }; - key { [ Armenian_tche, Armenian_TCHE ] }; - key { [ Armenian_ken, Armenian_KEN ] }; - key { [ Armenian_lyun, Armenian_LYUN ] }; - key { [ Armenian_to, Armenian_TO ] }; - key { [ Armenian_pyur, Armenian_PYUR ] }; - - key { [ Armenian_za, Armenian_ZA ] }; - key { [ Armenian_tso, Armenian_TSO ] }; - key { [ Armenian_ke, Armenian_KE ] }; - key { [ Armenian_vev, Armenian_VEV ] }; - key { [ Armenian_ben, Armenian_BEN ] }; - key { [ Armenian_nu, Armenian_NU ] }; - key { [ Armenian_men, Armenian_MEN ] }; - key { [ Armenian_sha, Armenian_SHA ] }; - key { [ Armenian_ghat, Armenian_GHAT ] }; - key { [ Armenian_tsa, Armenian_TSA ] }; - -}; - -partial alphanumeric_keys -xkb_symbols "western" { - include "am(eastern)" - name[Group1]="Armenia - Western"; - - // This is exactly the same layout for Western Armenian - // as in Windows XP, except: - // AE01 (the colon) has been replaced with the Armenian_full_stop and - // capital AE07 (ken) with the Armenian ligature ew - - key { [ Armenian_vev, Armenian_VEV ] }; - key { [ Armenian_da, Armenian_DA ] }; - key { [ Armenian_ben, Armenian_BEN ] }; - key { [ Armenian_tyun, Armenian_TYUN ] }; - key { [ Armenian_ken, Armenian_KEN ] }; - key { [ Armenian_ke, Armenian_KE ] }; - key { [ Armenian_gim, Armenian_GIM ] }; - key { [ Armenian_vyun, Armenian_VYUN ] }; - key { [ Armenian_pe, Armenian_PE ] }; - -}; - -partial alphanumeric_keys -xkb_symbols "eastern-alt" { - include "am(eastern)" - name[Group1]="Armenia - Alternative Eastern"; - - // This replicates the Windows XP keyboard layout for Eastern - // Armenian exactly (including the bug), except: - // AE01 (the colon) has been replaced with the Armenian_full_stop and - // capital AE07 (ken) with the Armenian ligature ew - - key { [ Armenian_ke, Armenian_KE ] }; - key { [ Armenian_gim, Armenian_GIM ] }; - -}; +// based on a keyboard map from an 'xkb/symbols/am' file + +partial default alphanumeric_keys +xkb_symbols "basic" { + + name[Group1]= "Armenia"; + + // Alphanumeric section + key { [ 0x100055d, 0x100055c ] }; + key { [ question, 0x100058a ] }; + key { [ guillemotright, guillemotleft ] }; + + key { [ 0x1000586, 0x1000556 ] }; + key { [ 0x1000571, 0x1000541 ] }; + key { [ 0x1002013, 0x1002014 ] }; + key { [ comma, dollar ] }; + key { [ 0x1000589, 0x1002026 ] }; + key { [ 0x100055e, percent ] }; + key { [ 0x1002024, 0x1000587 ] }; + key { [ 0x100055b, 0x10002bc ] }; + key { [ parenright, parenleft ] }; + key { [ 0x1000585, 0x1000555 ] }; + key { [ 0x1000567, 0x1000537 ] }; + key { [ 0x1000572, 0x1000542 ] }; + + + key { [ 0x1000573, 0x1000543 ] }; + key { [ 0x1000583, 0x1000553 ] }; + key { [ 0x1000562, 0x1000532 ] }; + key { [ 0x100057d, 0x100054d ] }; + key { [ 0x1000574, 0x1000544 ] }; + key { [ 0x1000578, 0x1000548 ] }; + key { [ 0x1000582, 0x1000552 ] }; + key { [ 0x100056f, 0x100053f ] }; + key { [ 0x1000568, 0x1000538 ] }; + key { [ 0x1000569, 0x1000539 ] }; + key { [ 0x100056e, 0x100053e ] }; + key { [ 0x1000581, 0x1000551 ] }; + + key { [ 0x100057b, 0x100054b ] }; + key { [ 0x100057e, 0x100054e ] }; + key { [ 0x1000563, 0x1000533 ] }; + key { [ 0x1000565, 0x1000535 ] }; + key { [ 0x1000561, 0x1000531 ] }; + key { [ 0x1000576, 0x1000546 ] }; + key { [ 0x100056b, 0x100053b ] }; + key { [ 0x100057f, 0x100054f ] }; + key { [ 0x1000570, 0x1000540 ] }; + key { [ 0x100057a, 0x100054a ] }; + key { [ 0x1000580, 0x1000550 ] }; + + key { [ 0x100056a, 0x100053a ] }; + key { [ 0x1000564, 0x1000534 ] }; + key { [ 0x1000579, 0x1000549 ] }; + key { [ 0x1000575, 0x1000545 ] }; + key { [ 0x1000566, 0x1000536 ] }; + key { [ 0x100056c, 0x100053c ] }; + key { [ 0x1000584, 0x1000554 ] }; + key { [ 0x100056d, 0x100053d ] }; + key { [ 0x1000577, 0x1000547 ] }; + key { [ 0x100057c, 0x100054c ] }; + +}; + +partial alphanumeric_keys +xkb_symbols "olpc" { + include "am(basic)" + name[Group1]= "Armenia"; + + include "group(olpc)" +}; + +xkb_symbols "phonetic" { + include "am(basic)" + name[Group1]= "Armenia - Phonetic"; + + key { [ 0x1000577, 0x1000547 ] }; + + key { [ 0x1000567, 0x1000537 ] }; + key { [ 0x1000569, 0x1000539 ] }; + key { [ 0x1000583, 0x1000553 ] }; + key { [ 0x1000571, 0x1000541 ] }; + key { [ 0x100057b, 0x100054b ] }; + key { [ 0x1000582, 0x1000552 ] }; + key { [ 0x1000587, 0x1000587 ] }; + key { [ 0x100057c, 0x100054c ] }; + key { [ 0x1000579, 0x1000549 ] }; + key { [ 0x1000573, 0x1000543 ] }; + key { [ 0x100002D, 0x1002015 ] }; + key { [ 0x100056a, 0x100053a ] }; + + key { [ 0x1000584, 0x1000554 ] }; + key { [ 0x1000578, 0x1000548 ] }; + key { [ 0x1000565, 0x1000535 ] }; + key { [ 0x1000580, 0x1000550 ] }; + key { [ 0x100057f, 0x100054f ] }; + key { [ 0x1000568, 0x1000538 ] }; + key { [ 0x1000582, 0x1000552 ] }; + key { [ 0x100056b, 0x100053b ] }; + key { [ 0x1000585, 0x1000555 ] }; + key { [ 0x100057a, 0x100054a ] }; + key { [ 0x100056d, 0x100053d ] }; + key { [ 0x100056e, 0x100053e ] }; + + key { [ 0x1000561, 0x1000531 ] }; + key { [ 0x100057d, 0x100054d ] }; + key { [ 0x1000564, 0x1000534 ] }; + key { [ 0x1000586, 0x1000556 ] }; + key { [ 0x1000563, 0x1000533 ] }; + key { [ 0x1000570, 0x1000540 ] }; + key { [ 0x1000575, 0x1000545 ] }; + key { [ 0x100056f, 0x100053f ] }; + key { [ 0x100056c, 0x100053c ] }; + key { [ semicolon, 0x1000589 ] }; + key { [ 0x100055b, 0x1000022 ] }; + + key { [ 0x1000566, 0x1000536 ] }; + key { [ 0x1000572, 0x1000542 ] }; + key { [ 0x1000581, 0x1000551 ] }; + key { [ 0x100057e, 0x100054e ] }; + key { [ 0x1000562, 0x1000532 ] }; + key { [ 0x1000576, 0x1000546 ] }; + key { [ 0x1000574, 0x1000544 ] }; + key { [ 0x100002C, 0x10000AB ] }; + key { [ 0x1002024, 0x10000BB ] }; + key { [ 0x100002F, 0x100055e ] }; + +}; + +partial alphanumeric_keys +xkb_symbols "phonetic-alt" { + include "am(phonetic)" + name[Group1]= "Armenia - Alternative Phonetic"; + + key { [ 0x1000580, 0x1000550 ] }; + key { [ 0x100057c, 0x100054c ] }; + +}; + +partial alphanumeric_keys +xkb_symbols "eastern" { + + name[Group1]="Armenia - Eastern"; + + // This is the closer phonetic transliteration for Eastern Armenian + // than the Windows XP layout for Eastern Armenian, which seems + // to have contained a bug, with the reversal of 'g' for keh and 'c' for gim + // Also, AE01 (the colon) has been replaced with the Armenian_full_stop and + // capital AE07 (ken) with the Armenian ligature ew + + key { [ Armenian_separation_mark, Armenian_exclam ] }; +// key { [ colon, KP_1 ] }; + key { [ Armenian_full_stop, KP_1 ] }; + key { [ Armenian_dza, Armenian_DZA ] }; + key { [ Armenian_hi, Armenian_HI ] }; + key { [ Armenian_accent, KP_3 ] }; + key { [ comma, KP_4 ] }; + key { [ minus, KP_9 ] }; + key { [ period, Armenian_ligature_ew ] }; + key { [ guillemotleft, parenleft ] }; + key { [ guillemotright, parenright ] }; + key { [ Armenian_o, Armenian_O ] }; + key { [ Armenian_ra, Armenian_RA ] }; + key { [ Armenian_zhe, Armenian_ZHE ] }; + + key { [ Armenian_khe, Armenian_KHE ] }; + key { [ Armenian_vyun, Armenian_VYUN ] }; + key { [ Armenian_e, Armenian_E ] }; + key { [ Armenian_re, Armenian_RE ] }; + key { [ Armenian_tyun, Armenian_TYUN ] }; + key { [ Armenian_yech, Armenian_YECH ] }; + key { [ Armenian_at, Armenian_AT ] }; + key { [ Armenian_ini, Armenian_INI ] }; + key { [ Armenian_vo, Armenian_VO ] }; + key { [ Armenian_pe, Armenian_PE ] }; + key { [ Armenian_cha, Armenian_CHA ] }; + key { [ Armenian_je, Armenian_JE ] }; + key { [ apostrophe, Armenian_question ] }; + + key { [ Armenian_ayb, Armenian_AYB ] }; + key { [ Armenian_se, Armenian_SE ] }; + key { [ Armenian_da, Armenian_DA ] }; + key { [ Armenian_fe, Armenian_FE ] }; + key { [ Armenian_gim, Armenian_GIM ] }; + key { [ Armenian_ho, Armenian_HO ] }; + key { [ Armenian_tche, Armenian_TCHE ] }; + key { [ Armenian_ken, Armenian_KEN ] }; + key { [ Armenian_lyun, Armenian_LYUN ] }; + key { [ Armenian_to, Armenian_TO ] }; + key { [ Armenian_pyur, Armenian_PYUR ] }; + + key { [ Armenian_za, Armenian_ZA ] }; + key { [ Armenian_tso, Armenian_TSO ] }; + key { [ Armenian_ke, Armenian_KE ] }; + key { [ Armenian_vev, Armenian_VEV ] }; + key { [ Armenian_ben, Armenian_BEN ] }; + key { [ Armenian_nu, Armenian_NU ] }; + key { [ Armenian_men, Armenian_MEN ] }; + key { [ Armenian_sha, Armenian_SHA ] }; + key { [ Armenian_ghat, Armenian_GHAT ] }; + key { [ Armenian_tsa, Armenian_TSA ] }; + +}; + +partial alphanumeric_keys +xkb_symbols "western" { + include "am(eastern)" + name[Group1]="Armenia - Western"; + + // This is exactly the same layout for Western Armenian + // as in Windows XP, except: + // AE01 (the colon) has been replaced with the Armenian_full_stop and + // capital AE07 (ken) with the Armenian ligature ew + + key { [ Armenian_vev, Armenian_VEV ] }; + key { [ Armenian_da, Armenian_DA ] }; + key { [ Armenian_ben, Armenian_BEN ] }; + key { [ Armenian_tyun, Armenian_TYUN ] }; + key { [ Armenian_ken, Armenian_KEN ] }; + key { [ Armenian_ke, Armenian_KE ] }; + key { [ Armenian_gim, Armenian_GIM ] }; + key { [ Armenian_vyun, Armenian_VYUN ] }; + key { [ Armenian_pe, Armenian_PE ] }; + +}; + +partial alphanumeric_keys +xkb_symbols "eastern-alt" { + include "am(eastern)" + name[Group1]="Armenia - Alternative Eastern"; + + // This replicates the Windows XP keyboard layout for Eastern + // Armenian exactly (including the bug), except: + // AE01 (the colon) has been replaced with the Armenian_full_stop and + // capital AE07 (ken) with the Armenian ligature ew + + key { [ Armenian_ke, Armenian_KE ] }; + key { [ Armenian_gim, Armenian_GIM ] }; + +}; diff --git a/xorg-server/xkeyboard-config/symbols/ara b/xorg-server/xkeyboard-config/symbols/ara index 90a584475..4606ee719 100644 --- a/xorg-server/xkeyboard-config/symbols/ara +++ b/xorg-server/xkeyboard-config/symbols/ara @@ -1,278 +1,276 @@ -// $XKeyboardConfig$ - -// based on a keyboard map from an 'xkb/symbols/ar' file - -partial default alphanumeric_keys -xkb_symbols "basic" { - name[Group1]= "Arabic"; - -// NOTES: -// -// there is also combined shadda diacritis in AltGr position of simple -// diacritics fatha, fathatan, damma, dammatan, kasra and kasratan -// should a third state be added to Group2 ? -// - - key { [ Arabic_thal, Arabic_shadda ] }; - key { [ 1, exclam ] }; - key { [ 2, at ] }; - key { [ 3, numbersign ] }; - key { [ 4, dollar ] }; - key { [ 5, percent ] }; - key { [ 6, asciicircum ] }; - key { [ 7, ampersand ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenright ] }; - key { [ 0, parenleft ] }; - key { [ minus, underscore ] }; - key { [ equal, plus ] }; - - key { [ Arabic_dad, Arabic_fatha ] }; - key { [ Arabic_sad, Arabic_fathatan ] }; - key { [ Arabic_theh, Arabic_damma ] }; - key { [ Arabic_qaf, Arabic_dammatan ] }; - key { [ Arabic_feh, 0x100fef9, 0x10006a4 ] }; - key { [ Arabic_ghain, Arabic_hamzaunderalef ] }; - key { [ Arabic_ain, grave ] }; - key { [ Arabic_ha, division ] }; - key { [ Arabic_khah, multiply ] }; - key { [ Arabic_hah, Arabic_semicolon ] }; - key { [ Arabic_jeem, less, 0x1000686 ] }; - key { [ Arabic_dal, greater ] }; - - key { [ Arabic_sheen, Arabic_kasra ] }; - key { [ Arabic_seen, Arabic_kasratan ] }; - key { [ Arabic_yeh, bracketright ] }; - key { [ Arabic_beh, bracketleft, 0x100067e ] }; - key { [ Arabic_lam, 0x100fef7 ] }; - key { [ Arabic_alef, Arabic_hamzaonalef ] }; - key { [ Arabic_teh, Arabic_tatweel ] }; - key { [ Arabic_noon, Arabic_comma ] }; - key { [ Arabic_meem, slash ] }; - key { [ Arabic_kaf, colon, 0x10006af ] }; - key { [ Arabic_tah, quotedbl ] }; - - key { [ bar, brokenbar ] }; - key { [Arabic_hamzaonyeh, asciitilde, guillemotright ] }; - key { [ Arabic_hamza, Arabic_sukun, guillemotleft ] }; - key { [Arabic_hamzaonwaw, braceright ] }; - key { [ Arabic_ra, braceleft ] }; - key { [ 0x100fefb, 0x100fef5 ] }; - key { [Arabic_alefmaksura, Arabic_maddaonalef ] }; - key { [Arabic_tehmarbuta, apostrophe ] }; - key { [ Arabic_waw, comma ] }; - key { [ Arabic_zain, period ] }; - key { [ Arabic_zah, Arabic_question_mark ] }; - - include "level3(ralt_switch)" - - // End alphanumeric section -}; - -partial alphanumeric_keys -xkb_symbols "qwerty" { - include "ara(basic)" - name[Group1]= "Arabic - qwerty"; -}; - -partial alphanumeric_keys -xkb_symbols "azerty" { - include "ara(basic)" - name[Group1]= "Arabic - azerty"; - - // the north african arabic keyboard differs from the middle east one - // by the numeric row; it follows French keyboard style - // - // PROBLEM: some chars are inaccessible: ! @ # $ % ^ * - // should they go elsewhere? replace " ' that are now in double ? - // also, dead_circumflex and dead_diaeresis from French keyboard - // as well as ugrave are missing, which questions the utility of the - // other accentuated latin letters. Maybe this is useful only with - // a French keyboard in Group1 ? Then, shouldn't Group1 be filled ? - - key { [ ampersand, 1 ] }; - key { [ eacute, 2 ] }; - key { [ quotedbl, 3 ] }; - key { [ apostrophe, 4 ] }; - key { [ parenleft, 5 ] }; - key { [ minus, 6 ] }; - key { [ egrave, 7 ] }; - key { [ underscore, 8 ] }; - key { [ ccedilla, 9 ] }; - key { [ agrave, 0 ] }; - key { [ parenright, degree ] }; -}; - -partial alphanumeric_keys -xkb_symbols "digits" { - include "ara(basic)" - name[Group1]= "Arabic - digits"; - - // use arabic script digits - - key { [ 0x1000661, exclam ] }; - key { [ 0x1000662, at ] }; - key { [ 0x1000663, numbersign ] }; - key { [ 0x1000664, dollar ] }; - key { [ 0x1000665, Arabic_percent ] }; - key { [ 0x1000666, asciicircum ] }; - key { [ 0x1000667, ampersand ] }; - key { [ 0x1000668, asterisk ] }; - key { [ 0x1000669, parenright ] }; - key { [ 0x1000660, parenleft ] }; -}; - -partial alphanumeric_keys -xkb_symbols "qwerty_digits" { - include "ara(digits)" - name[Group1]= "Arabic - qwerty/digits"; -}; - -partial alphanumeric_keys -xkb_symbols "azerty_digits" { - include "ara(azerty)" - name[Group1]= "Arabic - azerty/digits"; - - key { [ ampersand, 0x1000661 ] }; - key { [ eacute, 0x1000662 ] }; - key { [ quotedbl, 0x1000663 ] }; - key { [ apostrophe, 0x1000664 ] }; - key { [ parenleft, 0x1000665 ] }; - key { [ minus, 0x1000666 ] }; - key { [ egrave, 0x1000667 ] }; - key { [ underscore, 0x1000668 ] }; - key { [ ccedilla, 0x1000669 ] }; - key { [ agrave, 0x1000660 ] }; -}; - -// Arabic keyboard using Buckwalter transliteration -// http://www.qamus.org/transliteration.htm -// Martin Vidner - -// symbol names: see /usr/X11R6/include/X11/keysymdef.h (XFree86-devel.rpm) - -partial alphanumeric_keys -xkb_symbols "buckwalter" { - name[Group1]= "Arabic - Buckwalter"; - - // ARABIC LETTER SUPERSCRIPT ALEF - key { [ 0x1000670, Arabic_shadda ] }; - - // Arabic_0 .. Arabic_9 do not work in Kate, - // Unicode never seems to work worse. - key { [ 0x1000661, VoidSymbol ] }; - key { [ 0x1000662, VoidSymbol ] }; - key { [ 0x1000663, VoidSymbol ] }; - key { [ 0x1000664, Arabic_sheen ] }; - key { [ 0x1000665, Arabic_percent ] }; - key { [ 0x1000666, VoidSymbol ] }; - key { [ 0x1000667, Arabic_hamzaonwaw ] }; - key { [ 0x1000668, Arabic_thal ] }; - // ORNATE LEFT PARENTHESIS - key { [ 0x1000669, 0x100fd3e ] }; - // ORNATE RIGHT PARENTHESIS - key { [ 0x1000660, 0x100fd3f ] }; - key { [ minus, Arabic_tatweel ] }; - key { [ equal, plus ] }; - - key { [ Arabic_qaf, VoidSymbol ] }; - key { [ Arabic_waw, Arabic_hamzaonwaw ] }; - key { [ VoidSymbol, Arabic_ain ] }; - key { [ Arabic_ra, VoidSymbol ] }; - key { [ Arabic_teh, Arabic_tah ] }; - key { [ Arabic_yeh, Arabic_alefmaksura ] }; - key { [ Arabic_damma, VoidSymbol ] }; - key { [ Arabic_kasra, Arabic_hamzaunderalef ] }; - key { [ Arabic_sukun, Arabic_hamzaonalef ] }; - key { [ Arabic_tehmarbuta, VoidSymbol ] }; - // ARABIC LETTER ALEF WASLA - key { [ VoidSymbol, 0x1000671 ] }; - key { [ VoidSymbol, Arabic_hamzaonyeh ] }; - - key { [ Arabic_fatha, Arabic_alef ] }; - key { [ Arabic_seen, Arabic_sad ] }; - key { [ Arabic_dal, Arabic_dad ] }; - key { [ Arabic_feh, Arabic_fathatan ] }; - key { [ Arabic_ghain, VoidSymbol ] }; - key { [ Arabic_ha, Arabic_hah ] }; - key { [ Arabic_jeem, VoidSymbol ] }; - key { [ Arabic_kaf, Arabic_kasratan ] }; - key { [ Arabic_lam, VoidSymbol ] }; - key { [ Arabic_semicolon, VoidSymbol ] }; - key { [ Arabic_hamza, VoidSymbol ] }; - - key { [ VoidSymbol, Arabic_maddaonalef ] }; - -// key { [ bar, brokenbar ] }; - - key { [ Arabic_zain, Arabic_zah ] }; - key { [ Arabic_khah, VoidSymbol ] }; - key { [ VoidSymbol, VoidSymbol ] }; - key { [ Arabic_theh, VoidSymbol ] }; - key { [ Arabic_beh, VoidSymbol ] }; - key { [ Arabic_noon, Arabic_dammatan ] }; - key { [ Arabic_meem, VoidSymbol ] }; - key { [ Arabic_comma, Arabic_hamzaunderalef ] }; - // ARABIC FULL STOP (Urdu) - key { [ 0x10006d4, Arabic_hamzaonalef ] }; - key { [ VoidSymbol, Arabic_question_mark ] }; - - // End alphanumeric section -}; - -partial alphanumeric_keys -xkb_symbols "olpc" { - - include "ara(basic)" - - // As part of the olpc design some changes were made to the Arabic - // keyboard design. Major changes are: - // - // * Removed the lam-alef single character. Poeple type as they - // pronounce, and lam-alef is just a visual formatting of the - // sequence and is not often used on the keyboard. It is - // similar to the Allah single character, which is also not on - // the keyboard. - // * Moved the following keys: - // o Thal from TLDE to AB05: Due to space limitation on the - // keybaord, but also accessibility - // o Shadda from TLDE to AD05 - // * Placed currency letters on number keys and moved the ^ and & - // characters to lower keys (This change is worth revisiting - // before end of test period) - - key { [ grave, asciitilde ] }; - - key { [ 0x1000661, exclam ] }; - key { [ 0x1000662, at ] }; - key { [ 0x1000663, numbersign ] }; - key { [ 0x1000664, dollar ] }; - key { [ 0x1000665, Arabic_percent ] }; - key { [ 0x1000666, sterling ] }; - key { [ 0x1000667, EuroSign ] }; - key { [ 0x1000668, asterisk ] }; - key { [ 0x1000669, parenright ] }; - key { [ 0x1000660, parenleft ] }; - - key { [ Arabic_feh, Arabic_shadda ] }; - - key { [ Arabic_heh, division ] }; - key { [ Arabic_jeem, braceright ] }; - key { [ Arabic_dal, braceleft ] }; - - key { [ Arabic_sheen, greater ] }; - key { [ Arabic_seen, less ] }; - key { [ Arabic_lam, ampersand ] }; - key { [ Arabic_kaf ] }; - key { [ Arabic_tah ] }; - - key { [ backslash, bar ] }; - - - // REH isolated form? - key { [ Arabic_hamzaonwaw, Arabic_kasra ] }; - key { [ Arabic_ra, Arabic_kasratan ] }; - key { [ Arabic_thal, asciicircum ] }; - - include "group(olpc)" -}; +// based on a keyboard map from an 'xkb/symbols/ar' file + +partial default alphanumeric_keys +xkb_symbols "basic" { + name[Group1]= "Arabic"; + +// NOTES: +// +// there is also combined shadda diacritis in AltGr position of simple +// diacritics fatha, fathatan, damma, dammatan, kasra and kasratan +// should a third state be added to Group2 ? +// + + key { [ Arabic_thal, Arabic_shadda ] }; + key { [ 1, exclam ] }; + key { [ 2, at ] }; + key { [ 3, numbersign ] }; + key { [ 4, dollar ] }; + key { [ 5, percent ] }; + key { [ 6, asciicircum ] }; + key { [ 7, ampersand ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenright ] }; + key { [ 0, parenleft ] }; + key { [ minus, underscore ] }; + key { [ equal, plus ] }; + + key { [ Arabic_dad, Arabic_fatha ] }; + key { [ Arabic_sad, Arabic_fathatan ] }; + key { [ Arabic_theh, Arabic_damma ] }; + key { [ Arabic_qaf, Arabic_dammatan ] }; + key { [ Arabic_feh, 0x100fef9, 0x10006a4 ] }; + key { [ Arabic_ghain, Arabic_hamzaunderalef ] }; + key { [ Arabic_ain, grave ] }; + key { [ Arabic_ha, division ] }; + key { [ Arabic_khah, multiply ] }; + key { [ Arabic_hah, Arabic_semicolon ] }; + key { [ Arabic_jeem, less, 0x1000686 ] }; + key { [ Arabic_dal, greater ] }; + + key { [ Arabic_sheen, Arabic_kasra ] }; + key { [ Arabic_seen, Arabic_kasratan ] }; + key { [ Arabic_yeh, bracketright ] }; + key { [ Arabic_beh, bracketleft, 0x100067e ] }; + key { [ Arabic_lam, 0x100fef7 ] }; + key { [ Arabic_alef, Arabic_hamzaonalef ] }; + key { [ Arabic_teh, Arabic_tatweel ] }; + key { [ Arabic_noon, Arabic_comma ] }; + key { [ Arabic_meem, slash ] }; + key { [ Arabic_kaf, colon, 0x10006af ] }; + key { [ Arabic_tah, quotedbl ] }; + + key { [ bar, brokenbar ] }; + key { [Arabic_hamzaonyeh, asciitilde, guillemotright ] }; + key { [ Arabic_hamza, Arabic_sukun, guillemotleft ] }; + key { [Arabic_hamzaonwaw, braceright ] }; + key { [ Arabic_ra, braceleft ] }; + key { [ 0x100fefb, 0x100fef5 ] }; + key { [Arabic_alefmaksura, Arabic_maddaonalef ] }; + key { [Arabic_tehmarbuta, apostrophe ] }; + key { [ Arabic_waw, comma ] }; + key { [ Arabic_zain, period ] }; + key { [ Arabic_zah, Arabic_question_mark ] }; + + include "level3(ralt_switch)" + + // End alphanumeric section +}; + +partial alphanumeric_keys +xkb_symbols "qwerty" { + include "ara(basic)" + name[Group1]= "Arabic - qwerty"; +}; + +partial alphanumeric_keys +xkb_symbols "azerty" { + include "ara(basic)" + name[Group1]= "Arabic - azerty"; + + // the north african arabic keyboard differs from the middle east one + // by the numeric row; it follows French keyboard style + // + // PROBLEM: some chars are inaccessible: ! @ # $ % ^ * + // should they go elsewhere? replace " ' that are now in double ? + // also, dead_circumflex and dead_diaeresis from French keyboard + // as well as ugrave are missing, which questions the utility of the + // other accentuated latin letters. Maybe this is useful only with + // a French keyboard in Group1 ? Then, shouldn't Group1 be filled ? + + key { [ ampersand, 1 ] }; + key { [ eacute, 2 ] }; + key { [ quotedbl, 3 ] }; + key { [ apostrophe, 4 ] }; + key { [ parenleft, 5 ] }; + key { [ minus, 6 ] }; + key { [ egrave, 7 ] }; + key { [ underscore, 8 ] }; + key { [ ccedilla, 9 ] }; + key { [ agrave, 0 ] }; + key { [ parenright, degree ] }; +}; + +partial alphanumeric_keys +xkb_symbols "digits" { + include "ara(basic)" + name[Group1]= "Arabic - digits"; + + // use arabic script digits + + key { [ 0x1000661, exclam ] }; + key { [ 0x1000662, at ] }; + key { [ 0x1000663, numbersign ] }; + key { [ 0x1000664, dollar ] }; + key { [ 0x1000665, Arabic_percent ] }; + key { [ 0x1000666, asciicircum ] }; + key { [ 0x1000667, ampersand ] }; + key { [ 0x1000668, asterisk ] }; + key { [ 0x1000669, parenright ] }; + key { [ 0x1000660, parenleft ] }; +}; + +partial alphanumeric_keys +xkb_symbols "qwerty_digits" { + include "ara(digits)" + name[Group1]= "Arabic - qwerty/digits"; +}; + +partial alphanumeric_keys +xkb_symbols "azerty_digits" { + include "ara(azerty)" + name[Group1]= "Arabic - azerty/digits"; + + key { [ ampersand, 0x1000661 ] }; + key { [ eacute, 0x1000662 ] }; + key { [ quotedbl, 0x1000663 ] }; + key { [ apostrophe, 0x1000664 ] }; + key { [ parenleft, 0x1000665 ] }; + key { [ minus, 0x1000666 ] }; + key { [ egrave, 0x1000667 ] }; + key { [ underscore, 0x1000668 ] }; + key { [ ccedilla, 0x1000669 ] }; + key { [ agrave, 0x1000660 ] }; +}; + +// Arabic keyboard using Buckwalter transliteration +// http://www.qamus.org/transliteration.htm +// Martin Vidner + +// symbol names: see /usr/X11R6/include/X11/keysymdef.h (XFree86-devel.rpm) + +partial alphanumeric_keys +xkb_symbols "buckwalter" { + name[Group1]= "Arabic - Buckwalter"; + + // ARABIC LETTER SUPERSCRIPT ALEF + key { [ 0x1000670, Arabic_shadda ] }; + + // Arabic_0 .. Arabic_9 do not work in Kate, + // Unicode never seems to work worse. + key { [ 0x1000661, VoidSymbol ] }; + key { [ 0x1000662, VoidSymbol ] }; + key { [ 0x1000663, VoidSymbol ] }; + key { [ 0x1000664, Arabic_sheen ] }; + key { [ 0x1000665, Arabic_percent ] }; + key { [ 0x1000666, VoidSymbol ] }; + key { [ 0x1000667, Arabic_hamzaonwaw ] }; + key { [ 0x1000668, Arabic_thal ] }; + // ORNATE LEFT PARENTHESIS + key { [ 0x1000669, 0x100fd3e ] }; + // ORNATE RIGHT PARENTHESIS + key { [ 0x1000660, 0x100fd3f ] }; + key { [ minus, Arabic_tatweel ] }; + key { [ equal, plus ] }; + + key { [ Arabic_qaf, VoidSymbol ] }; + key { [ Arabic_waw, Arabic_hamzaonwaw ] }; + key { [ VoidSymbol, Arabic_ain ] }; + key { [ Arabic_ra, VoidSymbol ] }; + key { [ Arabic_teh, Arabic_tah ] }; + key { [ Arabic_yeh, Arabic_alefmaksura ] }; + key { [ Arabic_damma, VoidSymbol ] }; + key { [ Arabic_kasra, Arabic_hamzaunderalef ] }; + key { [ Arabic_sukun, Arabic_hamzaonalef ] }; + key { [ Arabic_tehmarbuta, VoidSymbol ] }; + // ARABIC LETTER ALEF WASLA + key { [ VoidSymbol, 0x1000671 ] }; + key { [ VoidSymbol, Arabic_hamzaonyeh ] }; + + key { [ Arabic_fatha, Arabic_alef ] }; + key { [ Arabic_seen, Arabic_sad ] }; + key { [ Arabic_dal, Arabic_dad ] }; + key { [ Arabic_feh, Arabic_fathatan ] }; + key { [ Arabic_ghain, VoidSymbol ] }; + key { [ Arabic_ha, Arabic_hah ] }; + key { [ Arabic_jeem, VoidSymbol ] }; + key { [ Arabic_kaf, Arabic_kasratan ] }; + key { [ Arabic_lam, VoidSymbol ] }; + key { [ Arabic_semicolon, VoidSymbol ] }; + key { [ Arabic_hamza, VoidSymbol ] }; + + key { [ VoidSymbol, Arabic_maddaonalef ] }; + +// key { [ bar, brokenbar ] }; + + key { [ Arabic_zain, Arabic_zah ] }; + key { [ Arabic_khah, VoidSymbol ] }; + key { [ VoidSymbol, VoidSymbol ] }; + key { [ Arabic_theh, VoidSymbol ] }; + key { [ Arabic_beh, VoidSymbol ] }; + key { [ Arabic_noon, Arabic_dammatan ] }; + key { [ Arabic_meem, VoidSymbol ] }; + key { [ Arabic_comma, Arabic_hamzaunderalef ] }; + // ARABIC FULL STOP (Urdu) + key { [ 0x10006d4, Arabic_hamzaonalef ] }; + key { [ VoidSymbol, Arabic_question_mark ] }; + + // End alphanumeric section +}; + +partial alphanumeric_keys +xkb_symbols "olpc" { + + include "ara(basic)" + + // As part of the olpc design some changes were made to the Arabic + // keyboard design. Major changes are: + // + // * Removed the lam-alef single character. Poeple type as they + // pronounce, and lam-alef is just a visual formatting of the + // sequence and is not often used on the keyboard. It is + // similar to the Allah single character, which is also not on + // the keyboard. + // * Moved the following keys: + // o Thal from TLDE to AB05: Due to space limitation on the + // keybaord, but also accessibility + // o Shadda from TLDE to AD05 + // * Placed currency letters on number keys and moved the ^ and & + // characters to lower keys (This change is worth revisiting + // before end of test period) + + key { [ grave, asciitilde ] }; + + key { [ 0x1000661, exclam ] }; + key { [ 0x1000662, at ] }; + key { [ 0x1000663, numbersign ] }; + key { [ 0x1000664, dollar ] }; + key { [ 0x1000665, Arabic_percent ] }; + key { [ 0x1000666, sterling ] }; + key { [ 0x1000667, EuroSign ] }; + key { [ 0x1000668, asterisk ] }; + key { [ 0x1000669, parenright ] }; + key { [ 0x1000660, parenleft ] }; + + key { [ Arabic_feh, Arabic_shadda ] }; + + key { [ Arabic_heh, division ] }; + key { [ Arabic_jeem, braceright ] }; + key { [ Arabic_dal, braceleft ] }; + + key { [ Arabic_sheen, greater ] }; + key { [ Arabic_seen, less ] }; + key { [ Arabic_lam, ampersand ] }; + key { [ Arabic_kaf ] }; + key { [ Arabic_tah ] }; + + key { [ backslash, bar ] }; + + + // REH isolated form? + key { [ Arabic_hamzaonwaw, Arabic_kasra ] }; + key { [ Arabic_ra, Arabic_kasratan ] }; + key { [ Arabic_thal, asciicircum ] }; + + include "group(olpc)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/at b/xorg-server/xkeyboard-config/symbols/at index b892af7a8..52382f9c0 100644 --- a/xorg-server/xkeyboard-config/symbols/at +++ b/xorg-server/xkeyboard-config/symbols/at @@ -1,8 +1,4 @@ - // based on a keyboard map from an 'xkb/symbols/de' file -// -// $XKeyboardConfig$ -// $XFree86: xc/programs/xkbcomp/symbols/de,v 1.6 2003/09/08 13:12:51 pascal Exp $ default xkb_symbols "basic" { diff --git a/xorg-server/xkeyboard-config/symbols/az b/xorg-server/xkeyboard-config/symbols/az index 254cf7f8c..4227bc944 100644 --- a/xorg-server/xkeyboard-config/symbols/az +++ b/xorg-server/xkeyboard-config/symbols/az @@ -1,94 +1,92 @@ -// $XKeyboardConfig$ - -// based on: -// symbols definition for a very simple Azerbaidjani keyboard layout. -// 2001 - Pablo Saratxaga - -partial default alphanumeric_keys -xkb_symbols "latin" { - - include "us" - - name[Group1]= "Azerbaijan"; - - key { [ grave, asciitilde, dead_grave, dead_tilde ] }; - - key { [ 3, numbersign, U2166 ] }; - key { [ 6, colon, EuroSign, periodcentered ] }; - key { [ 7, question ] }; - - key { [ 8, asterisk, asciicircum, dead_circumflex ] }; - key { [ minus, underscore, hyphen, emdash ] }; - - key { [ udiaeresis, Udiaeresis ] }; - key { [ r, R, registered ] }; - key { [ i, Iabovedot ] }; - key { [ odiaeresis, Odiaeresis, bracketleft, braceleft ] }; - key { [ gbreve, Gbreve, bracketright, braceright ] }; - - key { [ idotless, I ] }; - key { [ schwa, SCHWA ] }; - - key { [ c, C, copyright, division ] }; - key { [ m, M, periodcentered, currency ] }; - key { [ ccedilla, Ccedilla ] }; - key { [ scedilla, Scedilla ] }; - key { [ period, comma ] }; - // End alphanumeric section - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "cyrillic" { - - name[Group1]= "Azerbaijan - Cyrillic"; - - key {[ 2, quotedbl ] }; - key {[ 3, numbersign ] }; - key {[ 4, semicolon ] }; - key {[ 6, colon ] }; - key {[ 7, question ] }; - key {[ 8, asterisk, braceleft ] }; - key {[ 9, parenleft, bracketleft ] }; - key {[ 0, parenright, bracketright ] }; - key {[ minus, underscore, braceright ] }; - - key {[ Cyrillic_je, Cyrillic_JE ] }; - key {[ Cyrillic_u_straight, Cyrillic_U_straight ] }; - key {[ Cyrillic_u, Cyrillic_U ] }; - key {[ Cyrillic_ka, Cyrillic_KA ] }; - key {[ Cyrillic_ie, Cyrillic_IE ] }; - key {[ Cyrillic_en, Cyrillic_EN ] }; - key {[ Cyrillic_ghe, Cyrillic_GHE ] }; - key {[ Cyrillic_sha, Cyrillic_SHA ] }; - key {[ Cyrillic_shha, Cyrillic_SHHA ] }; - key {[ Cyrillic_ze, Cyrillic_ZE ] }; - key {[ Cyrillic_ha, Cyrillic_HA ] }; - key {[ Cyrillic_che_vertstroke, Cyrillic_CHE_vertstroke ] }; - - key {[ Cyrillic_ef, Cyrillic_EF ] }; - key {[ Cyrillic_yeru, Cyrillic_YERU ] }; - key {[ Cyrillic_ve, Cyrillic_VE ] }; - key {[ Cyrillic_a, Cyrillic_A ] }; - key {[ Cyrillic_pe, Cyrillic_PE ] }; - key {[ Cyrillic_er, Cyrillic_ER ] }; - key {[ Cyrillic_o, Cyrillic_O ] }; - key {[ Cyrillic_el, Cyrillic_EL ] }; - key {[ Cyrillic_de, Cyrillic_DE ] }; - key {[ Cyrillic_zhe, Cyrillic_ZHE ] }; - key {[ Cyrillic_ka_vertstroke,Cyrillic_KA_vertstroke ] }; - - key {[ Cyrillic_schwa, Cyrillic_SCHWA ] }; - key {[ Cyrillic_che, Cyrillic_CHE ] }; - key {[ Cyrillic_es, Cyrillic_ES ] }; - key {[ Cyrillic_em, Cyrillic_EM ] }; - key {[ Cyrillic_i, Cyrillic_I ] }; - key {[ Cyrillic_te, Cyrillic_TE ] }; - key {[ Cyrillic_ghe_bar, Cyrillic_GHE_bar ] }; - key {[ Cyrillic_be, Cyrillic_BE ] }; - key {[ Cyrillic_o_bar, Cyrillic_O_bar ] }; - key {[ period, comma ] }; - - // End alphanumeric section -}; +// based on: +// symbols definition for a very simple Azerbaidjani keyboard layout. +// 2001 - Pablo Saratxaga + +partial default alphanumeric_keys +xkb_symbols "latin" { + + include "us" + + name[Group1]= "Azerbaijan"; + + key { [ grave, asciitilde, dead_grave, dead_tilde ] }; + + key { [ 3, numbersign, U2166 ] }; + key { [ 6, colon, EuroSign, periodcentered ] }; + key { [ 7, question ] }; + + key { [ 8, asterisk, asciicircum, dead_circumflex ] }; + key { [ minus, underscore, hyphen, emdash ] }; + + key { [ udiaeresis, Udiaeresis ] }; + key { [ r, R, registered ] }; + key { [ i, Iabovedot ] }; + key { [ odiaeresis, Odiaeresis, bracketleft, braceleft ] }; + key { [ gbreve, Gbreve, bracketright, braceright ] }; + + key { [ idotless, I ] }; + key { [ schwa, SCHWA ] }; + + key { [ c, C, copyright, division ] }; + key { [ m, M, periodcentered, currency ] }; + key { [ ccedilla, Ccedilla ] }; + key { [ scedilla, Scedilla ] }; + key { [ period, comma ] }; + // End alphanumeric section + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "cyrillic" { + + name[Group1]= "Azerbaijan - Cyrillic"; + + key {[ 2, quotedbl ] }; + key {[ 3, numbersign ] }; + key {[ 4, semicolon ] }; + key {[ 6, colon ] }; + key {[ 7, question ] }; + key {[ 8, asterisk, braceleft ] }; + key {[ 9, parenleft, bracketleft ] }; + key {[ 0, parenright, bracketright ] }; + key {[ minus, underscore, braceright ] }; + + key {[ Cyrillic_je, Cyrillic_JE ] }; + key {[ Cyrillic_u_straight, Cyrillic_U_straight ] }; + key {[ Cyrillic_u, Cyrillic_U ] }; + key {[ Cyrillic_ka, Cyrillic_KA ] }; + key {[ Cyrillic_ie, Cyrillic_IE ] }; + key {[ Cyrillic_en, Cyrillic_EN ] }; + key {[ Cyrillic_ghe, Cyrillic_GHE ] }; + key {[ Cyrillic_sha, Cyrillic_SHA ] }; + key {[ Cyrillic_shha, Cyrillic_SHHA ] }; + key {[ Cyrillic_ze, Cyrillic_ZE ] }; + key {[ Cyrillic_ha, Cyrillic_HA ] }; + key {[ Cyrillic_che_vertstroke, Cyrillic_CHE_vertstroke ] }; + + key {[ Cyrillic_ef, Cyrillic_EF ] }; + key {[ Cyrillic_yeru, Cyrillic_YERU ] }; + key {[ Cyrillic_ve, Cyrillic_VE ] }; + key {[ Cyrillic_a, Cyrillic_A ] }; + key {[ Cyrillic_pe, Cyrillic_PE ] }; + key {[ Cyrillic_er, Cyrillic_ER ] }; + key {[ Cyrillic_o, Cyrillic_O ] }; + key {[ Cyrillic_el, Cyrillic_EL ] }; + key {[ Cyrillic_de, Cyrillic_DE ] }; + key {[ Cyrillic_zhe, Cyrillic_ZHE ] }; + key {[ Cyrillic_ka_vertstroke,Cyrillic_KA_vertstroke ] }; + + key {[ Cyrillic_schwa, Cyrillic_SCHWA ] }; + key {[ Cyrillic_che, Cyrillic_CHE ] }; + key {[ Cyrillic_es, Cyrillic_ES ] }; + key {[ Cyrillic_em, Cyrillic_EM ] }; + key {[ Cyrillic_i, Cyrillic_I ] }; + key {[ Cyrillic_te, Cyrillic_TE ] }; + key {[ Cyrillic_ghe_bar, Cyrillic_GHE_bar ] }; + key {[ Cyrillic_be, Cyrillic_BE ] }; + key {[ Cyrillic_o_bar, Cyrillic_O_bar ] }; + key {[ period, comma ] }; + + // End alphanumeric section +}; diff --git a/xorg-server/xkeyboard-config/symbols/ba b/xorg-server/xkeyboard-config/symbols/ba index 68a887a94..4507d4033 100644 --- a/xorg-server/xkeyboard-config/symbols/ba +++ b/xorg-server/xkeyboard-config/symbols/ba @@ -1,43 +1,40 @@ -// $XKeyboardConfig$ -// - -default partial alphanumeric_keys -xkb_symbols "basic" { - - name[Group1]="Bosnia and Herzegovina"; - - include "rs(latin)" -}; - -partial alphanumeric_keys -xkb_symbols "us" { - - name[Group1]= "Bosnia and Herzegovina - US keyboard with Bosnian letters"; - - include "rs(latinyz)" -}; - - -partial alphanumeric_keys -xkb_symbols "alternatequotes" { - - name[Group1]= "Bosnia and Herzegovina - Use guillemets for quotes"; - - include "rs(latinalternatequotes)" -}; - -partial alphanumeric_keys -xkb_symbols "unicode" { - - name[Group1]= "Bosnia and Herzegovina - Use Bosnian digraphs"; - - include "rs(latinunicode)" -}; - -partial alphanumeric_keys -xkb_symbols "unicodeus" { - - name[Group1]= "Bosnia and Herzegovina - US keyboard with Bosnian digraphs"; - - include "rs(latinunicodeyz)" -}; +default partial alphanumeric_keys +xkb_symbols "basic" { + + name[Group1]="Bosnia and Herzegovina"; + + include "rs(latin)" +}; + +partial alphanumeric_keys +xkb_symbols "us" { + + name[Group1]= "Bosnia and Herzegovina - US keyboard with Bosnian letters"; + + include "rs(latinyz)" +}; + + +partial alphanumeric_keys +xkb_symbols "alternatequotes" { + + name[Group1]= "Bosnia and Herzegovina - Use guillemets for quotes"; + + include "rs(latinalternatequotes)" +}; + +partial alphanumeric_keys +xkb_symbols "unicode" { + + name[Group1]= "Bosnia and Herzegovina - Use Bosnian digraphs"; + + include "rs(latinunicode)" +}; + +partial alphanumeric_keys +xkb_symbols "unicodeus" { + + name[Group1]= "Bosnia and Herzegovina - US keyboard with Bosnian digraphs"; + + include "rs(latinunicodeyz)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/bd b/xorg-server/xkeyboard-config/symbols/bd index 1f622e9fd..4146f1c8f 100644 --- a/xorg-server/xkeyboard-config/symbols/bd +++ b/xorg-server/xkeyboard-config/symbols/bd @@ -1,98 +1,97 @@ -// $XKeyboardConfig$ -// -// XKB symbol :: National Bangla/Bengali Standard Keyboard Layout for Bangladesh -// Ref: http://www.bcc.net.bd/keyboard/bsti_kb_specification.pdf -// -// Author: Jamil Ahmed -// Created: 18-12-2005 -// Last Updated: 08-01-2006 -// Version: 6.01.3 -// -// Issues: -// Khanda-Ta is given U-09CE; But BCC had U-09BA -// U-09BB is added though it is not allocated in Original Unicode -// U-09B3 is added though it is not allocated in Original Unicode -// 3 Conjunct characters are not included -// - -default partial alphanumeric_keys - -xkb_symbols "basic" { - name[Group1]= "Bangladesh"; - key { [ Escape ] }; - -// numbers - key { [ quoteleft, asciitilde, voidsymbol, voidsymbol ] }; - key { [ 0x10009E7, exclam, 0x10009F4, voidsymbol ] }; - key { [ 0x10009E8, at, 0x10009F5, voidsymbol ] }; - key { [ 0x10009E9, numbersign, 0x10009F6, voidsymbol ] }; - key { [ 0x10009EA, dollar, 0x10009F3, 0x10009F2 ] }; - key { [ 0x10009EB, percent, 0x10009F7, voidsymbol ] }; - key { [ 0x10009EC, asciicircum, 0x10009F8, 0x10009B3 ] }; - key { [ 0x10009ED, ampersand, 0x1000902, voidsymbol ] }; - key { [ 0x10009EE, asterisk, voidsymbol, voidsymbol ] }; - key { [ 0x10009EF, parenleft, voidsymbol, voidsymbol ] }; - key { [ 0x10009E6, parenright, 0x10009F9, voidsymbol ] }; - key { [ minus, underscore, 0x100200C, voidsymbol ] }; - key { [ equal, plus, 0x100200D, voidsymbol ] }; - key { [ BackSpace ] }; - -// tab, q to ] - key { [ Tab, ISO_Left_Tab ] }; - key { [ 0x1000999, 0x1000982, 0x10009E2, 0x10009E3 ] }; - key { [ 0x10009AF, 0x10009DF, voidsymbol, voidsymbol ] }; - key { [ 0x10009A1, 0x10009A2, 0x10009C4, voidsymbol ] }; - key { [ 0x10009AA, 0x10009AB, voidsymbol, voidsymbol ] }; - key { [ 0x100099F, 0x10009A0, voidsymbol, voidsymbol ] }; - key { [ 0x100099A, 0x100099B, voidsymbol, voidsymbol ] }; - key { [ 0x100099C, 0x100099D, voidsymbol, voidsymbol ] }; - key { [ 0x10009B9, 0x100099E, 0x10009BD, voidsymbol ] }; - key { [ 0x1000997, 0x1000998, voidsymbol, voidsymbol ] }; - key { [ 0x10009DC, 0x10009DD, voidsymbol, voidsymbol ] }; - key { [ bracketleft, braceleft, voidsymbol, voidsymbol ] }; - key { [ bracketright, braceright, voidsymbol, voidsymbol ] }; - key { [ Return ] }; - -// caps, a to ' -// key { [ Caps_Lock ] }; - key { [ 0x10009C3, 0x10009D7, 0x100098B, 0x10009E0 ] }; - key { [ 0x10009C1, 0x10009C2, 0x1000989, 0x100098A ] }; - key { [ 0x10009BF, 0x10009C0, 0x1000987, 0x1000988 ] }; - key { [ 0x10009AC, 0x10009AD, 0x10009F0, 0x10009F1 ] }; - key { [ 0x10009CD, 0x1000964, 0x1000965, voidsymbol ] }; - key { [ 0x10009BE, 0x1000985, 0x1000986, voidsymbol ] }; - key { [ 0x1000995, 0x1000996, 0x10009BB, voidsymbol ] }; - key { [ 0x10009A4, 0x10009A5, 0x10009CE, voidsymbol ] }; - key { [ 0x10009A6, 0x10009A7, 0x100098C, 0x10009E1 ] }; - key { [ semicolon, colon, voidsymbol, voidsymbol ] }; - key { [ quoteright, quotedbl, voidsymbol, voidsymbol ] }; - -// shift, z to / -// key { [ Shift_L ] }; - key { [ 0x1000981, 0x1000983, 0x10009FA, voidsymbol ] }; - key { [ 0x10009CB, 0x10009CC, 0x1000993, 0x1000994 ] }; - key { [ 0x10009C7, 0x10009C8, 0x100098F, 0x1000990 ] }; - key { [ 0x10009B0, 0x10009B2, voidsymbol, voidsymbol ] }; - key { [ 0x10009A8, 0x10009A3, voidsymbol, voidsymbol ] }; - key { [ 0x10009B8, 0x10009B7, voidsymbol, voidsymbol ] }; - key { [ 0x10009AE, 0x10009B6, voidsymbol, voidsymbol ] }; - key { [ comma, less, voidsymbol, voidsymbol ] }; - key { [ period, greater, 0x10009BC, voidsymbol ] }; - key { [ slash, question, voidsymbol, voidsymbol ] }; - key { [ backslash, bar, voidsymbol, voidsymbol ] }; - -// third level with right-Alt - include "level3(ralt_switch)" - -}; - - -// -// XKB symbol :: Probhat Bangla/Bengali Keyboard Layout -// Ref: www.ankurbangla.org/images/probhat_layout.png -// - -xkb_symbols "probhat" { - include "in(ben_probhat)" - name[Group1]= "Bangladesh - Probhat"; -}; +// +// XKB symbol :: National Bangla/Bengali Standard Keyboard Layout for Bangladesh +// Ref: http://www.bcc.net.bd/keyboard/bsti_kb_specification.pdf +// +// Author: Jamil Ahmed +// Created: 18-12-2005 +// Last Updated: 08-01-2006 +// Version: 6.01.3 +// +// Issues: +// Khanda-Ta is given U-09CE; But BCC had U-09BA +// U-09BB is added though it is not allocated in Original Unicode +// U-09B3 is added though it is not allocated in Original Unicode +// 3 Conjunct characters are not included +// + +default partial alphanumeric_keys + +xkb_symbols "basic" { + name[Group1]= "Bangladesh"; + key { [ Escape ] }; + +// numbers + key { [ quoteleft, asciitilde, voidsymbol, voidsymbol ] }; + key { [ 0x10009E7, exclam, 0x10009F4, voidsymbol ] }; + key { [ 0x10009E8, at, 0x10009F5, voidsymbol ] }; + key { [ 0x10009E9, numbersign, 0x10009F6, voidsymbol ] }; + key { [ 0x10009EA, dollar, 0x10009F3, 0x10009F2 ] }; + key { [ 0x10009EB, percent, 0x10009F7, voidsymbol ] }; + key { [ 0x10009EC, asciicircum, 0x10009F8, 0x10009B3 ] }; + key { [ 0x10009ED, ampersand, 0x1000902, voidsymbol ] }; + key { [ 0x10009EE, asterisk, voidsymbol, voidsymbol ] }; + key { [ 0x10009EF, parenleft, voidsymbol, voidsymbol ] }; + key { [ 0x10009E6, parenright, 0x10009F9, voidsymbol ] }; + key { [ minus, underscore, 0x100200C, voidsymbol ] }; + key { [ equal, plus, 0x100200D, voidsymbol ] }; + key { [ BackSpace ] }; + +// tab, q to ] + key { [ Tab, ISO_Left_Tab ] }; + key { [ 0x1000999, 0x1000982, 0x10009E2, 0x10009E3 ] }; + key { [ 0x10009AF, 0x10009DF, voidsymbol, voidsymbol ] }; + key { [ 0x10009A1, 0x10009A2, 0x10009C4, voidsymbol ] }; + key { [ 0x10009AA, 0x10009AB, voidsymbol, voidsymbol ] }; + key { [ 0x100099F, 0x10009A0, voidsymbol, voidsymbol ] }; + key { [ 0x100099A, 0x100099B, voidsymbol, voidsymbol ] }; + key { [ 0x100099C, 0x100099D, voidsymbol, voidsymbol ] }; + key { [ 0x10009B9, 0x100099E, 0x10009BD, voidsymbol ] }; + key { [ 0x1000997, 0x1000998, voidsymbol, voidsymbol ] }; + key { [ 0x10009DC, 0x10009DD, voidsymbol, voidsymbol ] }; + key { [ bracketleft, braceleft, voidsymbol, voidsymbol ] }; + key { [ bracketright, braceright, voidsymbol, voidsymbol ] }; + key { [ Return ] }; + +// caps, a to ' +// key { [ Caps_Lock ] }; + key { [ 0x10009C3, 0x10009D7, 0x100098B, 0x10009E0 ] }; + key { [ 0x10009C1, 0x10009C2, 0x1000989, 0x100098A ] }; + key { [ 0x10009BF, 0x10009C0, 0x1000987, 0x1000988 ] }; + key { [ 0x10009AC, 0x10009AD, 0x10009F0, 0x10009F1 ] }; + key { [ 0x10009CD, 0x1000964, 0x1000965, voidsymbol ] }; + key { [ 0x10009BE, 0x1000985, 0x1000986, voidsymbol ] }; + key { [ 0x1000995, 0x1000996, 0x10009BB, voidsymbol ] }; + key { [ 0x10009A4, 0x10009A5, 0x10009CE, voidsymbol ] }; + key { [ 0x10009A6, 0x10009A7, 0x100098C, 0x10009E1 ] }; + key { [ semicolon, colon, voidsymbol, voidsymbol ] }; + key { [ quoteright, quotedbl, voidsymbol, voidsymbol ] }; + +// shift, z to / +// key { [ Shift_L ] }; + key { [ 0x1000981, 0x1000983, 0x10009FA, voidsymbol ] }; + key { [ 0x10009CB, 0x10009CC, 0x1000993, 0x1000994 ] }; + key { [ 0x10009C7, 0x10009C8, 0x100098F, 0x1000990 ] }; + key { [ 0x10009B0, 0x10009B2, voidsymbol, voidsymbol ] }; + key { [ 0x10009A8, 0x10009A3, voidsymbol, voidsymbol ] }; + key { [ 0x10009B8, 0x10009B7, voidsymbol, voidsymbol ] }; + key { [ 0x10009AE, 0x10009B6, voidsymbol, voidsymbol ] }; + key { [ comma, less, voidsymbol, voidsymbol ] }; + key { [ period, greater, 0x10009BC, voidsymbol ] }; + key { [ slash, question, voidsymbol, voidsymbol ] }; + key { [ backslash, bar, voidsymbol, voidsymbol ] }; + +// third level with right-Alt + include "level3(ralt_switch)" + +}; + + +// +// XKB symbol :: Probhat Bangla/Bengali Keyboard Layout +// Ref: www.ankurbangla.org/images/probhat_layout.png +// + +xkb_symbols "probhat" { + include "in(ben_probhat)" + name[Group1]= "Bangladesh - Probhat"; +}; diff --git a/xorg-server/xkeyboard-config/symbols/be b/xorg-server/xkeyboard-config/symbols/be index 040f1b42e..8e096e24c 100644 --- a/xorg-server/xkeyboard-config/symbols/be +++ b/xorg-server/xkeyboard-config/symbols/be @@ -1,8 +1,4 @@ -// $XKeyboardConfig$ - // based on a keyboard map from an 'xkb/symbols/be' file -// -// $XFree86: xc/programs/xkbcomp/symbols/be,v 1.3 2003/04/12 10:53:48 pascal Exp $ partial default alphanumeric_keys xkb_symbols "basic" { diff --git a/xorg-server/xkeyboard-config/symbols/bg b/xorg-server/xkeyboard-config/symbols/bg index d10204e8e..d1e6a6356 100644 --- a/xorg-server/xkeyboard-config/symbols/bg +++ b/xorg-server/xkeyboard-config/symbols/bg @@ -1,362 +1,361 @@ -////////////////////////////////////////////////////////////////////////// -// Copyright (C) 1999, 2000, 2007, 2009 by Anton Zinoviev -// -// This software may be used, modified, copied, distributed, and sold, -// both in source and binary form provided that the above copyright -// notice and these terms are retained. The name of the author may not -// be used to endorse or promote products derived from this software -// without prior permission. THIS SOFTWARE IS PROVIDES "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED. IN NO EVENT -// SHALL THE AUTHOR BE LIABLE FOR ANY DAMAGES ARISING IN ANY WAY OUT -// OF THE USE OF THIS SOFTWARE. -// -////////////////////////////////////////////////////////////////////////// -// Version 2.0 - -// The following variants are defined in this file: - -// "bds" - the BDS keyboard layout compliant with the proposed -// Bulgarian state standard BDS 5237:2006 - -// "phonetic" - Bulgarian phonetic layout with traditional position of -// the letters. - -// "bas_phonetic" - the phonetic keyboard layout compliant with the -// proposed Bulgarian state standard BDS 5237:2006 - -// "latin" - an extended variant of the QWERTY layout with symbols -// Bulgarian users will type while the keyboard is in Latin mode. - -// The reasons behind the layout of the symbols in levels 3 and 4 are -// explained in http://arxiv.org/abs/0905.0484 (in Bulgarian). - -// Two notes for the maintainers of xkeyboard-config: - -// 1. Please do not use key names such as for the Bulgarian -// phonetic layouts. The placement of the symbols must stay always -// the same regardless of which one of the alias sets in -// xkb/keycodes/aliases is used. - -// 2. The layouts should not include level3(ralt_switch). - -////////////////////////////////////////////////////////////////////////// - -// Describes Bulgarian keyboard "BDS" modified according to the -// the new state standard BDS 5237:2006 and extended with symbols in -// levels 3 and 4. -partial default alphanumeric_keys -xkb_symbols "bds" { - - name[Group1]= "Bulgaria"; - - key { [ parenleft, parenright, - bracketleft, bracketright ] }; - key { [ 1, exclam ] }; - key { [ 2, question ] }; - key { [ 3, plus, - dagger, dagger ] }; - key { [ 4, quotedbl ] }; - key { [ 5, percent, - U2329, U232A ] }; - key { [ 6, equal, - emdash, emdash ] }; - key { [ 7, colon, - ellipsis, ellipsis ] }; - key { [ 8, slash, - U0300, U0301 ] }; - key { [ 9, endash ] }; - key { [ 0, numerosign ] }; - key { [ minus, dollar, - U2011, EuroSign ] }; - key { [ period, EuroSign ] }; - - - key { [ comma, Cyrillic_yeru, - rightsinglequotemark, leftsinglequotemark ] }; - key { [ Cyrillic_u, Cyrillic_U ] }; - key { [ Cyrillic_ie, Cyrillic_IE, - Cyrillic_e, Cyrillic_E ] }; - key { [ Cyrillic_i, Cyrillic_I, - U045D, U040D ] }; - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; - key { [ Cyrillic_ka, Cyrillic_KA, - copyright, copyright ] }; - key { [ Cyrillic_es, Cyrillic_ES, - copyright, copyright ] }; - key { [ Cyrillic_de, Cyrillic_DE ] }; - key { [ Cyrillic_ze, Cyrillic_ZE ] }; - key { [ Cyrillic_tse, Cyrillic_TSE ] }; - key { [ semicolon, section ] }; - - - key { [ Cyrillic_softsign, U045D, - Cyrillic_yeru, Cyrillic_YERU ] }; - key { [ Cyrillic_ya, Cyrillic_YA, - U0463, U0462 ] }; - key { [ Cyrillic_a, Cyrillic_A ] }; - key { [ Cyrillic_o, Cyrillic_O ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key { [ Cyrillic_te, Cyrillic_TE, - trademark, trademark ] }; - key { [ Cyrillic_en, Cyrillic_EN ] }; - key { [ Cyrillic_ve, Cyrillic_VE ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; - key { [ Cyrillic_che, Cyrillic_CHE ] }; - key { [ doublelowquotemark, leftdoublequotemark, - guillemotleft, guillemotright ] }; - - - key { [ U045D, U040D ] }; - key { [ Cyrillic_yu, Cyrillic_YU ] }; - key { [ Cyrillic_shorti, Cyrillic_SHORTI, - U046D, U046C ] }; - key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN, - U046B, U046A ] }; - key { [ Cyrillic_e, Cyrillic_E ] }; - key { [ Cyrillic_ef, Cyrillic_EF ] }; - key { [ Cyrillic_ha, Cyrillic_HA ] }; - key { [ Cyrillic_pe, Cyrillic_PE ] }; - key { [ Cyrillic_er, Cyrillic_ER, - registered, registered ] }; - key { [ Cyrillic_el, Cyrillic_EL ] }; - key { [ Cyrillic_be, Cyrillic_BE ] }; - - - key { [ space, space, - nobreakspace, nobreakspace ] }; - - - key { type[Group1] = "KEYPAD", - [ KP_Delete, KP_Separator ] }; -}; - -// This is improved variant of the traditional Bulgarian phonetic -// keyboard. Some unnecessary symbols in levels 1 and 2 are replaced -// by more useful (the same way as in "bas_phonetic") and additional -// symbols in levels 3 and 4 are added. -partial alphanumeric_keys -xkb_symbols "phonetic" { - name[Group1]= "Bulgaria - Traditional phonetic"; - - key { [ Cyrillic_che, Cyrillic_CHE ] }; - key { [ 1, exclam ] }; - key { [ 2, at ] }; - key { [ 3, numerosign ] }; - key { [ 4, dollar, - EuroSign, EuroSign ] }; - key { [ 5, percent ] }; - key { [ 6, EuroSign ] }; - key { [ 7, section ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenleft, - bracketleft, U2329 ] }; - key { [ 0, parenright, - bracketright, U232A ] }; - key { [ minus, endash, - U2011, U2011 ] }; - key { [ equal, plus, - emdash, dagger ] }; - - key { [ Cyrillic_ya, Cyrillic_YA, - U0463, U0462 ] }; - key { [ Cyrillic_ve, Cyrillic_VE ] }; - key { [ Cyrillic_ie, Cyrillic_IE, - Cyrillic_e, Cyrillic_E ] }; - key { [ Cyrillic_er, Cyrillic_ER, - registered, registered ] }; - key { [ Cyrillic_te, Cyrillic_TE, - trademark, trademark ] }; - key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN, - U046B, U046A ] }; - key { [ Cyrillic_u, Cyrillic_U ] }; - key { [ Cyrillic_i, Cyrillic_I, - U045D, U040D ] }; - key { [ Cyrillic_o, Cyrillic_O ] }; - key { [ Cyrillic_pe, Cyrillic_PE ] }; - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; - - - key { [ Cyrillic_a, Cyrillic_A ] }; - key { [ Cyrillic_es, Cyrillic_ES, - copyright, copyright ] }; - key { [ Cyrillic_de, Cyrillic_DE ] }; - key { [ Cyrillic_ef, Cyrillic_EF ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key { [ Cyrillic_ha, Cyrillic_HA ] }; - key { [ Cyrillic_shorti, Cyrillic_SHORTI, - U046D, U046C ] }; - key { [ Cyrillic_ka, Cyrillic_KA ] }; - key { [ Cyrillic_el, Cyrillic_EL ] }; - key { [ semicolon, colon, - ellipsis, ellipsis ] }; - key { [ apostrophe, quotedbl, - rightsinglequotemark, leftsinglequotemark ] }; - key { [ Cyrillic_yu, Cyrillic_YU ] }; - - - key { [ U045D, U040D ] }; - key { [ Cyrillic_ze, Cyrillic_ZE ] }; - key { [ Cyrillic_softsign, U045D, - Cyrillic_yeru, Cyrillic_YERU ] }; - key { [ Cyrillic_tse, Cyrillic_TSE, - copyright, copyright ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ Cyrillic_be, Cyrillic_BE ] }; - key { [ Cyrillic_en, Cyrillic_EN ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; - key { [ comma, doublelowquotemark, - guillemotleft, guillemotleft ] }; - key { [ period, leftdoublequotemark, - guillemotright, guillemotright ] }; - key { [ slash, question, - U0300, U0301 ] }; - - - key { [ space, space, - nobreakspace, nobreakspace ] }; - - - key { type[Group1] = "KEYPAD", - [ KP_Delete, KP_Separator ] }; - -}; - -// This is the Bulgarian phonetic keyboard acording to the proposed -// state standard BDS 5237:2006 with additional symbols in -// levels 3 and 4. -partial alphanumeric_keys -xkb_symbols "bas_phonetic" { - include "bg(phonetic)" - name[Group1]= "Bulgaria - New phonetic"; - - key { [ Cyrillic_yu, Cyrillic_YU ] }; - key { [ Cyrillic_che, Cyrillic_CHE ] }; - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Cyrillic_ya, Cyrillic_YA, - U0463, U0462 ] }; - key { [ Cyrillic_softsign, U045D, - Cyrillic_yeru, Cyrillic_YERU ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ Cyrillic_ve, Cyrillic_VE ] }; -}; - - -// This is extended variant of the standard Latin QWERTY layout with -// additional symbols in levels 3 and 4. -partial hidden alphanumeric_keys -xkb_symbols "latin" { - - key { [ grave, asciitilde, - U2248, U2245 ] }; - key { [ 1, exclam, - notsign, notsign ] }; - key { [ 2, at, - twosuperior, enfilledcircbullet ] }; - key { [ 3, numbersign, - threesuperior, notequal ] }; - key { [ 4, dollar, - EuroSign, sterling ] }; - key { [ 5, percent, - U2030, U2030 ] }; - key { [ 6, asciicircum, - logicaland, logicalor ] }; - key { [ 7, ampersand, - section, section ] }; - key { [ 8, asterisk, - infinity, multiply ] }; - key { [ 9, parenleft, - U2202, nabla ] }; - key { [ 0, parenright, - U2300, U2300 ] }; - key { [ minus, underscore, - U2011, endash ] }; - key { [ equal, plus, - emdash, plusminus ] }; - - - key { [ q, Q, - Greek_THETA, Greek_theta ] }; - key { [ w, W, - Greek_OMEGA, Greek_omega ] }; - key { [ e, E, - U2203, Greek_epsilon ] }; - key { [ r, R, - registered, Greek_rho ] }; - key { [ t, T, - trademark, Greek_tau ] }; - key { [ y, Y, - yen, Greek_upsilon ] }; - key { [ u, U, - intersection, union ] }; - key { [ i, I, - integral, Greek_iota ] }; - key { [ o, O, - degree, U222E ] }; - key { [ p, P, - Greek_PI, Greek_pi ] }; - key { [ bracketleft, braceleft, - U2286, includedin ] }; - key { [ bracketright, braceright, - U2208, U2209 ] }; - - - key { [ a, A, - U2200, Greek_alpha ] }; - key { [ s, S, - Greek_SIGMA, Greek_sigma ] }; - key { [ d, D, - Greek_DELTA, Greek_delta ] }; - key { [ f, F, - Greek_PHI, Greek_phi ] }; - key { [ g, G, - Greek_GAMMA, Greek_gamma ] }; - key { [ h, H, - U2225, Greek_eta ] }; - key { [ j, J ] }; - key { [ k, K, - U03F0, Greek_kappa ] }; - key { [ l, L, - Greek_LAMBDA, Greek_lambda ] }; - key { [ semicolon, colon, - division, division ] }; - key { [ apostrophe, quotedbl, - leftdoublequotemark, rightdoublequotemark ] }; - key { [ backslash, bar, - identical, downtack ] }; - - - key { [ less, greater, - U2266, U2267 ] }; - key { [ z, Z, - U2220, Greek_zeta ] }; - key { [ x, X, - Greek_XI, Greek_xi ] }; - key { [ c, C, - copyright, Greek_chi ] }; - key { [ v, V, - Greek_PSI, Greek_psi ] }; - key { [ b, B, - U03D1, Greek_beta ] }; - key { [ n, N, - U207F, Greek_nu ] }; - key { [ m, M, - Greek_mu, Greek_mu ] }; - key { [ comma, less, - U2266, U21D4 ] }; - key { [ period, greater, - U2267, U21D2 ] }; - key { [ slash, question, - leftsinglequotemark, rightsinglequotemark ] }; - - - key { [ space, space, - nobreakspace, nobreakspace ] }; - - - key { type[Group1] = "KEYPAD", - [ KP_Delete, KP_Decimal ] }; -}; - +////////////////////////////////////////////////////////////////////////// +// Copyright (C) 1999, 2000, 2007, 2009 by Anton Zinoviev +// +// This software may be used, modified, copied, distributed, and sold, +// both in source and binary form provided that the above copyright +// notice and these terms are retained. The name of the author may not +// be used to endorse or promote products derived from this software +// without prior permission. THIS SOFTWARE IS PROVIDES "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED. IN NO EVENT +// SHALL THE AUTHOR BE LIABLE FOR ANY DAMAGES ARISING IN ANY WAY OUT +// OF THE USE OF THIS SOFTWARE. +// +////////////////////////////////////////////////////////////////////////// +// Version 2.0 + +// The following variants are defined in this file: + +// "bds" - the BDS keyboard layout compliant with the proposed +// Bulgarian state standard BDS 5237:2006 + +// "phonetic" - Bulgarian phonetic layout with traditional position of +// the letters. + +// "bas_phonetic" - the phonetic keyboard layout compliant with the +// proposed Bulgarian state standard BDS 5237:2006 + +// "latin" - an extended variant of the QWERTY layout with symbols +// Bulgarian users will type while the keyboard is in Latin mode. + +// The reasons behind the layout of the symbols in levels 3 and 4 are +// explained in http://arxiv.org/abs/0905.0484 (in Bulgarian). + +// Two notes for the maintainers of xkeyboard-config: + +// 1. Please do not use key names such as for the Bulgarian +// phonetic layouts. The placement of the symbols must stay always +// the same regardless of which one of the alias sets in +// xkb/keycodes/aliases is used. + +// 2. The layouts should not include level3(ralt_switch). + +////////////////////////////////////////////////////////////////////////// + +// Describes Bulgarian keyboard "BDS" modified according to the +// the new state standard BDS 5237:2006 and extended with symbols in +// levels 3 and 4. +partial default alphanumeric_keys +xkb_symbols "bds" { + + name[Group1]= "Bulgaria"; + + key { [ parenleft, parenright, + bracketleft, bracketright ] }; + key { [ 1, exclam ] }; + key { [ 2, question ] }; + key { [ 3, plus, + dagger, dagger ] }; + key { [ 4, quotedbl ] }; + key { [ 5, percent, + U2329, U232A ] }; + key { [ 6, equal, + emdash, emdash ] }; + key { [ 7, colon, + ellipsis, ellipsis ] }; + key { [ 8, slash, + U0300, U0301 ] }; + key { [ 9, endash ] }; + key { [ 0, numerosign ] }; + key { [ minus, dollar, + U2011, EuroSign ] }; + key { [ period, EuroSign ] }; + + + key { [ comma, Cyrillic_yeru, + rightsinglequotemark, leftsinglequotemark ] }; + key { [ Cyrillic_u, Cyrillic_U ] }; + key { [ Cyrillic_ie, Cyrillic_IE, + Cyrillic_e, Cyrillic_E ] }; + key { [ Cyrillic_i, Cyrillic_I, + U045D, U040D ] }; + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; + key { [ Cyrillic_ka, Cyrillic_KA, + copyright, copyright ] }; + key { [ Cyrillic_es, Cyrillic_ES, + copyright, copyright ] }; + key { [ Cyrillic_de, Cyrillic_DE ] }; + key { [ Cyrillic_ze, Cyrillic_ZE ] }; + key { [ Cyrillic_tse, Cyrillic_TSE ] }; + key { [ semicolon, section ] }; + + + key { [ Cyrillic_softsign, U045D, + Cyrillic_yeru, Cyrillic_YERU ] }; + key { [ Cyrillic_ya, Cyrillic_YA, + U0463, U0462 ] }; + key { [ Cyrillic_a, Cyrillic_A ] }; + key { [ Cyrillic_o, Cyrillic_O ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; + key { [ Cyrillic_te, Cyrillic_TE, + trademark, trademark ] }; + key { [ Cyrillic_en, Cyrillic_EN ] }; + key { [ Cyrillic_ve, Cyrillic_VE ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; + key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ doublelowquotemark, leftdoublequotemark, + guillemotleft, guillemotright ] }; + + + key { [ U045D, U040D ] }; + key { [ Cyrillic_yu, Cyrillic_YU ] }; + key { [ Cyrillic_shorti, Cyrillic_SHORTI, + U046D, U046C ] }; + key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN, + U046B, U046A ] }; + key { [ Cyrillic_e, Cyrillic_E ] }; + key { [ Cyrillic_ef, Cyrillic_EF ] }; + key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [ Cyrillic_pe, Cyrillic_PE ] }; + key { [ Cyrillic_er, Cyrillic_ER, + registered, registered ] }; + key { [ Cyrillic_el, Cyrillic_EL ] }; + key { [ Cyrillic_be, Cyrillic_BE ] }; + + + key { [ space, space, + nobreakspace, nobreakspace ] }; + + + key { type[Group1] = "KEYPAD", + [ KP_Delete, KP_Separator ] }; +}; + +// This is improved variant of the traditional Bulgarian phonetic +// keyboard. Some unnecessary symbols in levels 1 and 2 are replaced +// by more useful (the same way as in "bas_phonetic") and additional +// symbols in levels 3 and 4 are added. +partial alphanumeric_keys +xkb_symbols "phonetic" { + name[Group1]= "Bulgaria - Traditional phonetic"; + + key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ 1, exclam ] }; + key { [ 2, at ] }; + key { [ 3, numerosign ] }; + key { [ 4, dollar, + EuroSign, EuroSign ] }; + key { [ 5, percent ] }; + key { [ 6, EuroSign ] }; + key { [ 7, section ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft, + bracketleft, U2329 ] }; + key { [ 0, parenright, + bracketright, U232A ] }; + key { [ minus, endash, + U2011, U2011 ] }; + key { [ equal, plus, + emdash, dagger ] }; + + key { [ Cyrillic_ya, Cyrillic_YA, + U0463, U0462 ] }; + key { [ Cyrillic_ve, Cyrillic_VE ] }; + key { [ Cyrillic_ie, Cyrillic_IE, + Cyrillic_e, Cyrillic_E ] }; + key { [ Cyrillic_er, Cyrillic_ER, + registered, registered ] }; + key { [ Cyrillic_te, Cyrillic_TE, + trademark, trademark ] }; + key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN, + U046B, U046A ] }; + key { [ Cyrillic_u, Cyrillic_U ] }; + key { [ Cyrillic_i, Cyrillic_I, + U045D, U040D ] }; + key { [ Cyrillic_o, Cyrillic_O ] }; + key { [ Cyrillic_pe, Cyrillic_PE ] }; + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; + + + key { [ Cyrillic_a, Cyrillic_A ] }; + key { [ Cyrillic_es, Cyrillic_ES, + copyright, copyright ] }; + key { [ Cyrillic_de, Cyrillic_DE ] }; + key { [ Cyrillic_ef, Cyrillic_EF ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; + key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [ Cyrillic_shorti, Cyrillic_SHORTI, + U046D, U046C ] }; + key { [ Cyrillic_ka, Cyrillic_KA ] }; + key { [ Cyrillic_el, Cyrillic_EL ] }; + key { [ semicolon, colon, + ellipsis, ellipsis ] }; + key { [ apostrophe, quotedbl, + rightsinglequotemark, leftsinglequotemark ] }; + key { [ Cyrillic_yu, Cyrillic_YU ] }; + + + key { [ U045D, U040D ] }; + key { [ Cyrillic_ze, Cyrillic_ZE ] }; + key { [ Cyrillic_softsign, U045D, + Cyrillic_yeru, Cyrillic_YERU ] }; + key { [ Cyrillic_tse, Cyrillic_TSE, + copyright, copyright ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ Cyrillic_be, Cyrillic_BE ] }; + key { [ Cyrillic_en, Cyrillic_EN ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; + key { [ comma, doublelowquotemark, + guillemotleft, guillemotleft ] }; + key { [ period, leftdoublequotemark, + guillemotright, guillemotright ] }; + key { [ slash, question, + U0300, U0301 ] }; + + + key { [ space, space, + nobreakspace, nobreakspace ] }; + + + key { type[Group1] = "KEYPAD", + [ KP_Delete, KP_Separator ] }; + +}; + +// This is the Bulgarian phonetic keyboard acording to the proposed +// state standard BDS 5237:2006 with additional symbols in +// levels 3 and 4. +partial alphanumeric_keys +xkb_symbols "bas_phonetic" { + include "bg(phonetic)" + name[Group1]= "Bulgaria - New phonetic"; + + key { [ Cyrillic_yu, Cyrillic_YU ] }; + key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Cyrillic_ya, Cyrillic_YA, + U0463, U0462 ] }; + key { [ Cyrillic_softsign, U045D, + Cyrillic_yeru, Cyrillic_YERU ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ Cyrillic_ve, Cyrillic_VE ] }; +}; + + +// This is extended variant of the standard Latin QWERTY layout with +// additional symbols in levels 3 and 4. +partial hidden alphanumeric_keys +xkb_symbols "latin" { + + key { [ grave, asciitilde, + U2248, U2245 ] }; + key { [ 1, exclam, + notsign, notsign ] }; + key { [ 2, at, + twosuperior, enfilledcircbullet ] }; + key { [ 3, numbersign, + threesuperior, notequal ] }; + key { [ 4, dollar, + EuroSign, sterling ] }; + key { [ 5, percent, + U2030, U2030 ] }; + key { [ 6, asciicircum, + logicaland, logicalor ] }; + key { [ 7, ampersand, + section, section ] }; + key { [ 8, asterisk, + infinity, multiply ] }; + key { [ 9, parenleft, + U2202, nabla ] }; + key { [ 0, parenright, + U2300, U2300 ] }; + key { [ minus, underscore, + U2011, endash ] }; + key { [ equal, plus, + emdash, plusminus ] }; + + + key { [ q, Q, + Greek_THETA, Greek_theta ] }; + key { [ w, W, + Greek_OMEGA, Greek_omega ] }; + key { [ e, E, + U2203, Greek_epsilon ] }; + key { [ r, R, + registered, Greek_rho ] }; + key { [ t, T, + trademark, Greek_tau ] }; + key { [ y, Y, + yen, Greek_upsilon ] }; + key { [ u, U, + intersection, union ] }; + key { [ i, I, + integral, Greek_iota ] }; + key { [ o, O, + degree, U222E ] }; + key { [ p, P, + Greek_PI, Greek_pi ] }; + key { [ bracketleft, braceleft, + U2286, includedin ] }; + key { [ bracketright, braceright, + U2208, U2209 ] }; + + + key { [ a, A, + U2200, Greek_alpha ] }; + key { [ s, S, + Greek_SIGMA, Greek_sigma ] }; + key { [ d, D, + Greek_DELTA, Greek_delta ] }; + key { [ f, F, + Greek_PHI, Greek_phi ] }; + key { [ g, G, + Greek_GAMMA, Greek_gamma ] }; + key { [ h, H, + U2225, Greek_eta ] }; + key { [ j, J ] }; + key { [ k, K, + U03F0, Greek_kappa ] }; + key { [ l, L, + Greek_LAMBDA, Greek_lambda ] }; + key { [ semicolon, colon, + division, division ] }; + key { [ apostrophe, quotedbl, + leftdoublequotemark, rightdoublequotemark ] }; + key { [ backslash, bar, + identical, downtack ] }; + + + key { [ less, greater, + U2266, U2267 ] }; + key { [ z, Z, + U2220, Greek_zeta ] }; + key { [ x, X, + Greek_XI, Greek_xi ] }; + key { [ c, C, + copyright, Greek_chi ] }; + key { [ v, V, + Greek_PSI, Greek_psi ] }; + key { [ b, B, + U03D1, Greek_beta ] }; + key { [ n, N, + U207F, Greek_nu ] }; + key { [ m, M, + Greek_mu, Greek_mu ] }; + key { [ comma, less, + U2266, U21D4 ] }; + key { [ period, greater, + U2267, U21D2 ] }; + key { [ slash, question, + leftsinglequotemark, rightsinglequotemark ] }; + + + key { [ space, space, + nobreakspace, nobreakspace ] }; + + + key { type[Group1] = "KEYPAD", + [ KP_Delete, KP_Decimal ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/br b/xorg-server/xkeyboard-config/symbols/br index f9f5cbe5e..be0cd7cc2 100644 --- a/xorg-server/xkeyboard-config/symbols/br +++ b/xorg-server/xkeyboard-config/symbols/br @@ -1,6 +1,3 @@ -// $XKeyboardConfig$ -// $XdotOrg: xc/programs/xkbcomp/symbols/br,v 1.1.4.3 2004/03/05 13:41:32 eich Exp $ -// $XFree86: xc/programs/xkbcomp/symbols/br,v 1.3 2003/04/19 12:22:11 pascal Exp $ // // based on // "a very simple Brasilian ABNT2 keyboard diff --git a/xorg-server/xkeyboard-config/symbols/brai b/xorg-server/xkeyboard-config/symbols/brai index e89bed24f..b748d184b 100644 --- a/xorg-server/xkeyboard-config/symbols/brai +++ b/xorg-server/xkeyboard-config/symbols/brai @@ -1,62 +1,59 @@ -// $XKeyboardConfig$ - -// 10-dot patterns on the home row + v and n -partial default alphanumeric_keys -xkb_symbols "home_row" { - include "brai(keypad)" - - name[Group1]="Braille"; - - key { [ braille_dot_1 ] }; - key { [ braille_dot_2 ] }; - key { [ braille_dot_3 ] }; - key { [ braille_dot_4 ] }; - key { [ braille_dot_5 ] }; - key { [ braille_dot_6 ] }; - key { [ braille_dot_7 ] }; - key { [ braille_dot_8 ] }; - key { [ braille_dot_9 ] }; - key { [ braille_dot_10 ] }; -}; - -// 6-dot patterns for the left hand -partial alphanumeric_keys -xkb_symbols "left_hand" { - include "brai(keypad)" - - name[Group1]="Braille - Left hand"; - - key { [ braille_dot_1 ] }; - key { [ braille_dot_2 ] }; - key { [ braille_dot_3 ] }; - key { [ braille_dot_4 ] }; - key { [ braille_dot_5 ] }; - key { [ braille_dot_6 ] }; -}; - -// 6-dot patterns for the right hand -partial alphanumeric_keys -xkb_symbols "right_hand" { - include "brai(keypad)" - - name[Group1]="Braille - Right hand"; - - key { [ braille_dot_1 ] }; - key { [ braille_dot_2 ] }; - key { [ braille_dot_3 ] }; - key { [ braille_dot_4 ] }; - key { [ braille_dot_5 ] }; - key { [ braille_dot_6 ] }; -}; - -// 6-dot patterns on the keypad -partial hidden keypad_keys -xkb_symbols "keypad" { - key { [ braille_dot_1 ] }; - key { [ braille_dot_2 ] }; - key { [ braille_dot_3 ] }; - key { [ braille_dot_4 ] }; - key { [ braille_dot_5 ] }; - key { [ braille_dot_6 ] }; -}; - +// 10-dot patterns on the home row + v and n +partial default alphanumeric_keys +xkb_symbols "home_row" { + include "brai(keypad)" + + name[Group1]="Braille"; + + key { [ braille_dot_1 ] }; + key { [ braille_dot_2 ] }; + key { [ braille_dot_3 ] }; + key { [ braille_dot_4 ] }; + key { [ braille_dot_5 ] }; + key { [ braille_dot_6 ] }; + key { [ braille_dot_7 ] }; + key { [ braille_dot_8 ] }; + key { [ braille_dot_9 ] }; + key { [ braille_dot_10 ] }; +}; + +// 6-dot patterns for the left hand +partial alphanumeric_keys +xkb_symbols "left_hand" { + include "brai(keypad)" + + name[Group1]="Braille - Left hand"; + + key { [ braille_dot_1 ] }; + key { [ braille_dot_2 ] }; + key { [ braille_dot_3 ] }; + key { [ braille_dot_4 ] }; + key { [ braille_dot_5 ] }; + key { [ braille_dot_6 ] }; +}; + +// 6-dot patterns for the right hand +partial alphanumeric_keys +xkb_symbols "right_hand" { + include "brai(keypad)" + + name[Group1]="Braille - Right hand"; + + key { [ braille_dot_1 ] }; + key { [ braille_dot_2 ] }; + key { [ braille_dot_3 ] }; + key { [ braille_dot_4 ] }; + key { [ braille_dot_5 ] }; + key { [ braille_dot_6 ] }; +}; + +// 6-dot patterns on the keypad +partial hidden keypad_keys +xkb_symbols "keypad" { + key { [ braille_dot_1 ] }; + key { [ braille_dot_2 ] }; + key { [ braille_dot_3 ] }; + key { [ braille_dot_4 ] }; + key { [ braille_dot_5 ] }; + key { [ braille_dot_6 ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/bt b/xorg-server/xkeyboard-config/symbols/bt index d87558371..b1ac22625 100644 --- a/xorg-server/xkeyboard-config/symbols/bt +++ b/xorg-server/xkeyboard-config/symbols/bt @@ -1,88 +1,87 @@ -// $XKeyboardConfig$ -// -// Dzongkha / Tibetan layout for Bhutanese keyboard -// -///////////////////////////////////////////////////////////////// -// -// Based on the official layout for Dzongkha -// approved by the Department of Information Technology & -// Dzongkha Development Authority of the Government of Bhutan -// -// Copyright (C) 2004, Gregory Mokhin -///////////////////////////////////////////////////////////////// -// Version 0.97 2004-01-09 Layout map provided by Chris Fynn -// Version 1.0 2004-07-29 Some correction by Pema Geyleg -///////////////////////////////////////////////////////////////// - -partial default alphanumeric_keys -xkb_symbols "basic" { - name[Group1]= "Bhutan"; - - key { [ 0x1000F09, 0x1000F0A, 0x1000F6C, 0x1000F6D ] }; - -// numbers e.a. - key { [ 0x1000F21, 0x1000F04, 1, exclam ] }; - key { [ 0x1000F22, 0x1000F05, 2, at ] }; - key { [ 0x1000F23, 0x1000F06, 3, numbersign ] }; - key { [ 0x1000F24, 0x1000F48, 4, dollar ] }; - key { [ 0x1000F25, 0x1000F70, 5, percent ] }; - key { [ 0x1000F26, 0x1000F08, 6, 0x1000F01 ] }; - key { [ 0x1000F27, 0x1000F38, 7, ampersand ] }; - key { [ 0x1000F28, 0x1000F34, 8, asterisk ] }; - key { [ 0x1000F29, 0x1000F3C, 9, parenleft ] }; - key { [ 0x1000F20, 0x1000F3D, 0, parenright ] }; - key { [ 0x1000F14, 0x1000F7F, minus, underscore ] }; - key { [ 0x1000F0D, 0x1000F11, equal, plus ] }; - -// consonants ( ka kha ga nga ) - key { [ 0x1000F40, 0x1000F90, 0x1000F88, VoidSymbol ] }; - key { [ 0x1000F41, 0x1000F91, 0x1000F89, VoidSymbol ] }; - key { [ 0x1000F42, 0x1000F92, 0x1000F6E, 0x1000F6F] }; - key { [ 0x1000F44, 0x1000F94, 0x1000F83, 0x1000F82 ] }; - -// vowels ( i u e o ) - key { [ 0x1000F72, 0x1000F80, 0x1000F1A, VoidSymbol ] }; - key { [ 0x1000F74, 0x1000F84, 0x1000F1B, VoidSymbol ] }; - key { [ 0x1000F7A, 0x1000F7B, 0x1000F1C, VoidSymbol ] }; - key { [ 0x1000F7C, 0x1000F7D, 0x1000F1D, 0x1000F17 ] }; - -// consonants ( ca cha ja nya ) - key { [ 0x1000F45, 0x1000F95, 0x1000F1E, 0x1000F18 ] }; - key { [ 0x1000F46, 0x1000F96, 0x1000F1F, 0x1000F19 ] }; - key { [ 0x1000F47, 0x1000F97, bracketleft, 0x1000F3E ] }; - key { [ 0x1000F49, 0x1000F99, bracketright, 0x1000F3F ] }; - -// consonants ( ta tha da na pa pha ba ma tsa tsha dza wa ) - key { [ 0x1000F4F, 0x1000F9F, 0x1000F4A, 0x1000F9A ] }; - key { [ 0x1000F50, 0x1000FA0, 0x1000F4B, 0x1000F9B ] }; - key { [ 0x1000F51, 0x1000FA1, 0x1000F4C, 0x1000F9C ] }; - key { [ 0x1000F53, 0x1000FA3, 0x1000F4E, 0x1000F9E ] }; - key { [ 0x1000F54, 0x1000FA4, 0x1002039, guillemotleft ] }; - key { [ 0x1000F55, 0x1000FA5, 0x100203A, guillemotright ] }; - key { [ 0x1000F56, 0x1000FA6, 0x1000F37, 0x1000F35 ] }; - key { [ 0x1000F58, 0x1000FA8, 0x1000F7E, VoidSymbol ] }; - key { [ 0x1000F59, 0x1000FA9, 0x1000F39, VoidSymbol ] }; - key { [ 0x1000F5A, 0x1000FAA, colon, semicolon ] }; - key { [ 0x1000F5B, 0x1000FAB, apostrophe, quotedbl ] }; - -// TODO: BKSL and LSGT are from gb layout, are there any variants? - key { [ 0x1000F5D, 0x1000FAD, backslash, 0x1000FBA ] }; - key { [ 0x1000F0D, 0x1000F11, 0x1000F10, 0x1000F0F ] }; - -// consonants ( zha za 'a ya ra la sha sa ha a ) - key { [ 0x1000F5E, 0x1000FAE, 0x1000F13, 0x1000F36 ] }; - key { [ 0x1000F5F, 0x1000FAF, 0x1000FBE, 0x1000FBF ] }; - key { [ 0x1000F60, 0x1000F71, 0x1000F03, 0x1000FB0 ] }; - key { [ 0x1000F61, 0x1000FB1, 0x1000F12, 0x1000FBB ] }; - key { [ 0x1000F62, 0x1000FB2, 0x1000F6A, 0x1000FBC ] }; - key { [ 0x1000F63, 0x1000FB3, 0x1000F8A, 0x1000F8B ] }; - key { [ 0x1000F64, 0x1000FB4, 0x1000F65, 0x1000FB5 ] }; - key { [ 0x1000F66, 0x1000FB6, comma, less ] }; - key { [ 0x1000F67, 0x1000FB7, period, greater ] }; - key { [ 0x1000F68, 0x1000FB8, slash, question ] }; - -// space - key { [ 0x1000F0B, space, 0x1000F0C, nobreakspace ] }; - - include "level3(ralt_switch)" -}; +// +// Dzongkha / Tibetan layout for Bhutanese keyboard +// +///////////////////////////////////////////////////////////////// +// +// Based on the official layout for Dzongkha +// approved by the Department of Information Technology & +// Dzongkha Development Authority of the Government of Bhutan +// +// Copyright (C) 2004, Gregory Mokhin +///////////////////////////////////////////////////////////////// +// Version 0.97 2004-01-09 Layout map provided by Chris Fynn +// Version 1.0 2004-07-29 Some correction by Pema Geyleg +///////////////////////////////////////////////////////////////// + +partial default alphanumeric_keys +xkb_symbols "basic" { + name[Group1]= "Bhutan"; + + key { [ 0x1000F09, 0x1000F0A, 0x1000F6C, 0x1000F6D ] }; + +// numbers e.a. + key { [ 0x1000F21, 0x1000F04, 1, exclam ] }; + key { [ 0x1000F22, 0x1000F05, 2, at ] }; + key { [ 0x1000F23, 0x1000F06, 3, numbersign ] }; + key { [ 0x1000F24, 0x1000F48, 4, dollar ] }; + key { [ 0x1000F25, 0x1000F70, 5, percent ] }; + key { [ 0x1000F26, 0x1000F08, 6, 0x1000F01 ] }; + key { [ 0x1000F27, 0x1000F38, 7, ampersand ] }; + key { [ 0x1000F28, 0x1000F34, 8, asterisk ] }; + key { [ 0x1000F29, 0x1000F3C, 9, parenleft ] }; + key { [ 0x1000F20, 0x1000F3D, 0, parenright ] }; + key { [ 0x1000F14, 0x1000F7F, minus, underscore ] }; + key { [ 0x1000F0D, 0x1000F11, equal, plus ] }; + +// consonants ( ka kha ga nga ) + key { [ 0x1000F40, 0x1000F90, 0x1000F88, VoidSymbol ] }; + key { [ 0x1000F41, 0x1000F91, 0x1000F89, VoidSymbol ] }; + key { [ 0x1000F42, 0x1000F92, 0x1000F6E, 0x1000F6F] }; + key { [ 0x1000F44, 0x1000F94, 0x1000F83, 0x1000F82 ] }; + +// vowels ( i u e o ) + key { [ 0x1000F72, 0x1000F80, 0x1000F1A, VoidSymbol ] }; + key { [ 0x1000F74, 0x1000F84, 0x1000F1B, VoidSymbol ] }; + key { [ 0x1000F7A, 0x1000F7B, 0x1000F1C, VoidSymbol ] }; + key { [ 0x1000F7C, 0x1000F7D, 0x1000F1D, 0x1000F17 ] }; + +// consonants ( ca cha ja nya ) + key { [ 0x1000F45, 0x1000F95, 0x1000F1E, 0x1000F18 ] }; + key { [ 0x1000F46, 0x1000F96, 0x1000F1F, 0x1000F19 ] }; + key { [ 0x1000F47, 0x1000F97, bracketleft, 0x1000F3E ] }; + key { [ 0x1000F49, 0x1000F99, bracketright, 0x1000F3F ] }; + +// consonants ( ta tha da na pa pha ba ma tsa tsha dza wa ) + key { [ 0x1000F4F, 0x1000F9F, 0x1000F4A, 0x1000F9A ] }; + key { [ 0x1000F50, 0x1000FA0, 0x1000F4B, 0x1000F9B ] }; + key { [ 0x1000F51, 0x1000FA1, 0x1000F4C, 0x1000F9C ] }; + key { [ 0x1000F53, 0x1000FA3, 0x1000F4E, 0x1000F9E ] }; + key { [ 0x1000F54, 0x1000FA4, 0x1002039, guillemotleft ] }; + key { [ 0x1000F55, 0x1000FA5, 0x100203A, guillemotright ] }; + key { [ 0x1000F56, 0x1000FA6, 0x1000F37, 0x1000F35 ] }; + key { [ 0x1000F58, 0x1000FA8, 0x1000F7E, VoidSymbol ] }; + key { [ 0x1000F59, 0x1000FA9, 0x1000F39, VoidSymbol ] }; + key { [ 0x1000F5A, 0x1000FAA, colon, semicolon ] }; + key { [ 0x1000F5B, 0x1000FAB, apostrophe, quotedbl ] }; + +// TODO: BKSL and LSGT are from gb layout, are there any variants? + key { [ 0x1000F5D, 0x1000FAD, backslash, 0x1000FBA ] }; + key { [ 0x1000F0D, 0x1000F11, 0x1000F10, 0x1000F0F ] }; + +// consonants ( zha za 'a ya ra la sha sa ha a ) + key { [ 0x1000F5E, 0x1000FAE, 0x1000F13, 0x1000F36 ] }; + key { [ 0x1000F5F, 0x1000FAF, 0x1000FBE, 0x1000FBF ] }; + key { [ 0x1000F60, 0x1000F71, 0x1000F03, 0x1000FB0 ] }; + key { [ 0x1000F61, 0x1000FB1, 0x1000F12, 0x1000FBB ] }; + key { [ 0x1000F62, 0x1000FB2, 0x1000F6A, 0x1000FBC ] }; + key { [ 0x1000F63, 0x1000FB3, 0x1000F8A, 0x1000F8B ] }; + key { [ 0x1000F64, 0x1000FB4, 0x1000F65, 0x1000FB5 ] }; + key { [ 0x1000F66, 0x1000FB6, comma, less ] }; + key { [ 0x1000F67, 0x1000FB7, period, greater ] }; + key { [ 0x1000F68, 0x1000FB8, slash, question ] }; + +// space + key { [ 0x1000F0B, space, 0x1000F0C, nobreakspace ] }; + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/bw b/xorg-server/xkeyboard-config/symbols/bw index ea5079e5d..9243da20f 100644 --- a/xorg-server/xkeyboard-config/symbols/bw +++ b/xorg-server/xkeyboard-config/symbols/bw @@ -1,19 +1,18 @@ -partial default alphanumeric_keys -xkb_symbols "tswana" { - - include "us" - - name[Group1]= "Botswana"; - - key { [ semicolon, colon, 0x01000324, 0x01000324 ] }; //COMBINING DIAERESIS BELOW - key { [apostrophe, quotedbl, 0x01000301, 0x01000308 ] }; //COMBINING ACUTE ACCENT, COMBINING DIAERESIS - key { [ grave, asciitilde, 0x01000300, 0x01000303 ] }; //COMBINING GRAVE ACCENT, COMBINING TILDE - key { [ 6, asciicircum, 0x01000302 ] }; //COMBINING CIRCUMFLEX ACCENT - key { [ 8, asterisk, 0x01000307, 0x01000323 ] }; //COMBINING DOT ABOVE, COMBINING DOT BELOW - key { [ 9, parenleft, 0x01000306 ] }; //COMBINING BREVE - key { [ 0, parenright, 0x0100030c ] }; //COMBINING CARON - key { [ minus, underscore, 0x01000304, 0x01000331 ] }; //COMBINING MACRON,COMBINING MACRON BELOW - - include "level3(ralt_switch)" -}; - +partial default alphanumeric_keys +xkb_symbols "tswana" { + + include "us" + + name[Group1]= "Botswana"; + + key { [ semicolon, colon, 0x01000324, 0x01000324 ] }; //COMBINING DIAERESIS BELOW + key { [apostrophe, quotedbl, 0x01000301, 0x01000308 ] }; //COMBINING ACUTE ACCENT, COMBINING DIAERESIS + key { [ grave, asciitilde, 0x01000300, 0x01000303 ] }; //COMBINING GRAVE ACCENT, COMBINING TILDE + key { [ 6, asciicircum, 0x01000302 ] }; //COMBINING CIRCUMFLEX ACCENT + key { [ 8, asterisk, 0x01000307, 0x01000323 ] }; //COMBINING DOT ABOVE, COMBINING DOT BELOW + key { [ 9, parenleft, 0x01000306 ] }; //COMBINING BREVE + key { [ 0, parenright, 0x0100030c ] }; //COMBINING CARON + key { [ minus, underscore, 0x01000304, 0x01000331 ] }; //COMBINING MACRON,COMBINING MACRON BELOW + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/by b/xorg-server/xkeyboard-config/symbols/by index 4409e52dd..2c16f9e7a 100644 --- a/xorg-server/xkeyboard-config/symbols/by +++ b/xorg-server/xkeyboard-config/symbols/by @@ -1,56 +1,51 @@ -// $XKeyboardConfig$ - -// based on -// belarusian standard keyboard -// Alexander Mikhailian -// Reworked to use winkeys by default and russian keymap as base by Paul Lubetsky -// Added third level with russian symbols -// See freedesktop.org bug #23604 - -partial default alphanumeric_keys -xkb_symbols "basic" { - include "ru(winkeys)" - name[Group1]= "Belarus"; - - key { [ Byelorussian_shortu, Byelorussian_SHORTU ] }; - key { [ apostrophe, apostrophe ] }; - key { [ Ukrainian_i, Ukrainian_I ] }; -}; - -partial alphanumeric_keys -xkb_symbols "legacy" { - include "by(basic)" - name[Group1]= "Belarus - Legacy"; - - key { [ 3, numbersign ] }; - key { [ 4, asterisk ] }; - key { [ 5, colon ] }; - key { [ 6, comma ] }; - key { [ 7, period ] }; - key { [ 8, semicolon ] }; - key { [ slash, question ] }; - key { [ backslash, bar ] }; -}; - -// based on a keyboard map from an 'xkb/symbols/iso3335-3' file -// -// $XFree86: xc/programs/xkbcomp/symbols/pc/en_US,v 1.3 2003/01/26 02:01:48 dawes Exp $ - -partial alphanumeric_keys -xkb_symbols "latin" { - include "latin" - name[Group1]= "Belarus - Latin"; - - key { [ w, W, scaron, Scaron ] }; - key { [ u, U, ubreve, Ubreve ] }; - key { [ s, S, sacute, Sacute ] }; - key { [ l, L, lstroke, Lstroke ] }; - key { [ z, Z, zacute, Zacute ] }; - key { [ x, X, zcaron, Zcaron ] }; - key { [ c, C, cacute, Cacute ] }; - key { [ v, V, ccaron, Ccaron ] }; - key { [ n, N, nacute, Nacute ] }; - - include "level3(ralt_switch)" -}; - +// based on +// belarusian standard keyboard +// Alexander Mikhailian +// Reworked to use winkeys by default and russian keymap as base by Paul Lubetsky +// Added third level with russian symbols +// See freedesktop.org bug #23604 + +partial default alphanumeric_keys +xkb_symbols "basic" { + include "ru(winkeys)" + name[Group1]= "Belarus"; + + key { [ Byelorussian_shortu, Byelorussian_SHORTU ] }; + key { [ apostrophe, apostrophe ] }; + key { [ Ukrainian_i, Ukrainian_I ] }; +}; + +partial alphanumeric_keys +xkb_symbols "legacy" { + include "by(basic)" + name[Group1]= "Belarus - Legacy"; + + key { [ 3, numbersign ] }; + key { [ 4, asterisk ] }; + key { [ 5, colon ] }; + key { [ 6, comma ] }; + key { [ 7, period ] }; + key { [ 8, semicolon ] }; + key { [ slash, question ] }; + key { [ backslash, bar ] }; +}; + +// based on a keyboard map from an 'xkb/symbols/iso3335-3' file + +partial alphanumeric_keys +xkb_symbols "latin" { + include "latin" + name[Group1]= "Belarus - Latin"; + + key { [ w, W, scaron, Scaron ] }; + key { [ u, U, ubreve, Ubreve ] }; + key { [ s, S, sacute, Sacute ] }; + key { [ l, L, lstroke, Lstroke ] }; + key { [ z, Z, zacute, Zacute ] }; + key { [ x, X, zcaron, Zcaron ] }; + key { [ c, C, cacute, Cacute ] }; + key { [ v, V, ccaron, Ccaron ] }; + key { [ n, N, nacute, Nacute ] }; + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/ca b/xorg-server/xkeyboard-config/symbols/ca index 63f9e48e6..10427e959 100644 --- a/xorg-server/xkeyboard-config/symbols/ca +++ b/xorg-server/xkeyboard-config/symbols/ca @@ -1,530 +1,527 @@ -// $XKeyboardConfig$ - -default partial -xkb_symbols "fr" { - name[Group1] = "Canada"; - - key { [ numbersign, bar, backslash ] }; - key { [ 1, exclam, plusminus ] }; - key { [ 2, quotedbl, at ] }; - key { [ 3, slash, sterling ] }; - key { [ 4, dollar, cent ] }; - key { [ 5, percent, currency ] }; - key { [ 6, question, notsign ] }; - key { [ 7, ampersand, brokenbar ] }; - key { [ 8, asterisk, twosuperior ] }; - key { [ 9, parenleft, threesuperior ] }; - key { [ 0, parenright, onequarter ] }; - key { [ minus, underscore, onehalf ] }; - key { [ equal, plus, threequarters ] }; - - key { [ q, Q ] }; - key { [ w, W ] }; - key { [ e, E ] }; - key { [ r, R ] }; - key { [ t, T ] }; - key { [ y, Y ] }; - key { [ u, U ] }; - key { [ i, I ] }; - key { [ o, O, section ] }; - key { [ p, P, paragraph ] }; - key { [dead_circumflex, dead_circumflex, bracketleft ] }; - key { [ dead_cedilla, dead_diaeresis, bracketright ] }; - - key { [ a, A ] }; - key { [ s, S ] }; - key { [ d, D ] }; - key { [ f, F ] }; - key { [ g, G ] }; - key { [ h, H ] }; - key { [ j, J ] }; - key { [ k, K ] }; - key { [ l, L ] }; - key { [ semicolon, colon, asciitilde ] }; - key { [dead_grave, dead_grave, braceleft ] }; - key { [ less, greater, braceright ] }; - - key { [guillemotleft, guillemotright, degree] }; - key { [ z, Z ] }; - key { [ x, X ] }; - key { [ c, C ] }; - key { [ v, V ] }; - key { [ b, B ] }; - key { [ n, N ] }; - key { [ m, M, mu ] }; - key { [ comma, apostrophe, macron ] }; - key { [ period, period, hyphen ] }; - key { [ eacute, Eacute, dead_acute ] }; - - key { [ space, space, nobreakspace ] }; - - include "level3(ralt_switch)" -}; - -xkb_symbols "fr-dvorak" { - name[Group1] = "Canada - French Dvorak"; - - key { [ numbersign, bar, backslash ] }; - key { [ 1, exclam, plusminus ] }; - key { [ 2, quotedbl, at ] }; - key { [ 3, slash, sterling ] }; - key { [ 4, dollar, cent ] }; - key { [ 5, percent, currency ] }; - key { [ 6, question, notsign ] }; - key { [ 7, ampersand, brokenbar ] }; - key { [ 8, asterisk, twosuperior ] }; - key { [ 9, parenleft, threesuperior ] }; - key { [ 0, parenright, onequarter ] }; - key { [dead_circumflex, dead_circumflex, bracketleft ] }; - key { [ dead_cedilla, dead_diaeresis, bracketright ] }; - - key { [dead_grave, dead_grave, braceleft ] }; - key { [ comma, apostrophe, macron ] }; - key { [ period, period, hyphen ] }; - key { [ p, P, paragraph ] }; - key { [ y, Y ] }; - key { [ f, F ] }; - key { [ g, G ] }; - key { [ c, C ] }; - key { [ r, R ] }; - key { [ l, L ] }; - key { [ eacute, Eacute, dead_acute ] }; - key { [ equal, plus, threequarters ] }; - - key { [ a, A ] }; - key { [ o, O, section ] }; - key { [ e, E ] }; - key { [ u, U ] }; - key { [ i, I ] }; - key { [ d, D ] }; - key { [ h, H ] }; - key { [ t, T ] }; - key { [ n, N ] }; - key { [ s, S ] }; - key { [ minus, underscore, onehalf ] }; - key { [ less, greater, braceright ] }; - - key { [guillemotleft, guillemotright, degree] }; - key { [ semicolon, colon, asciitilde ] }; - key { [ q, Q ] }; - key { [ j, J ] }; - key { [ k, K ] }; - key { [ x, X ] }; - key { [ b, B ] }; - key { [ m, M, mu ] }; - key { [ w, W ] }; - key { [ v, V ] }; - key { [ z, Z ] }; - - key { [ space, space, nobreakspace ] }; - - include "level3(ralt_switch)" -}; - -partial -xkb_symbols "fr-legacy" { - - name[Group1] = "Canada - French (legacy)"; - - include "ca(fr)" - - key { [ degree, degree, notsign ] }; - key { [ 1, exclam, onesuperior ] }; - - key { [ 3, numbersign, threesuperior ] }; - key { [ 4, dollar, onequarter ] }; - key { [ 5, percent, onehalf ] }; - key { [ 6, question, threequarters ] }; - key { [ 7, ampersand, braceleft ] }; - key { [ 8, asterisk, bracketleft ] }; - key { [ 9, parenleft, bracketright, plusminus ] }; - key { [ 0, parenright, braceright ] }; - key { [ minus, underscore, bar, questiondown] }; - key { [ equal, plus, dead_cedilla ] }; - - key { [ r, R, paragraph, registered ] }; - key { [ y, Y, yen ] }; - key { [ o, O, oslash, Ooblique ] }; - key { [ p, P, thorn, THORN ] }; - key { [dead_circumflex, dead_circumflex, degree ] }; - key { [ ccedilla, Ccedilla, dead_tilde, dead_diaeresis ] }; - - key { [ a, A, ae, AE ] }; - key { [ s, S, ssharp, section ] }; - key { [ d, D, eth, ETH ] }; - key { [ f, F, ordfeminine ] }; - key { [ semicolon, colon, dead_acute, dead_acute ] }; - key { [ egrave, Egrave ] }; - key { [ agrave, Agrave, dead_grave ] }; - - key { [ ugrave, Ugrave, backslash, bar ] }; - key { [ z, Z, guillemotleft ] }; - key { [ x, X, guillemotright ] }; - key { [ c, C, cent, copyright ] }; - key { [ m, M, mu, masculine ] }; - key { [ comma, apostrophe, less ] }; - key { [ period, period, greater ] }; - key { [ eacute, Eacute, slash ] }; -}; - -partial -xkb_symbols "multi" { - - name[Group1] = "Canada - Multilingual, first part"; - - include "ca(fr)" - - key { [ slash, backslash, bar ] }; - key { [ 1, exclam ] }; - key { [ 2, at ] }; - key { [ 3, numbersign ] }; - key { [ 4, dollar ] }; - key { [ 5, percent ] }; - key { [ 6, question ] }; - key { [ 7, ampersand, braceleft ] }; - key { [ 8, asterisk, braceright ] }; - key { [ 9, parenleft, bracketleft ] }; - key { [ 0, parenright, bracketright ] }; - key { [ minus, underscore ] }; - key { [ equal, plus, notsign ] }; - - key { [ o, O ] }; - key { [ p, P ] }; - key { [dead_circumflex, dead_diaeresis, dead_grave ] }; - key { [ ccedilla, Ccedilla, asciitilde ] }; - - key { [ semicolon, colon, degree ] }; - key { [ egrave, Egrave ] }; - key { [ agrave, Agrave ] }; - - key { [ ugrave, Ugrave ] }; - key { [ z, Z, guillemotleft ] }; - key { [ x, X, guillemotright ] }; - key { [ comma, apostrophe, less ] }; - key { [ period, quotedbl, greater ] }; - key { [ eacute, Eacute ] }; -}; - -partial -xkb_symbols "multi-2gr" { - - name[Group1] = "Canada - Multilingual, second part"; - - key { [ NoSymbol, hyphen ] }; - key { [ onesuperior, exclamdown ] }; - key { [ twosuperior, NoSymbol ] }; - key { [ threesuperior, sterling ] }; - key { [ onequarter, currency ] }; - key { [ onehalf,threeeighths ] }; - key { [ threequarters, fiveeighths ] }; - key { [ NoSymbol,seveneighths ] }; - key { [ NoSymbol, trademark ] }; - key { [ NoSymbol, plusminus ] }; - - key { [ NoSymbol, questiondown] }; - key { [ dead_cedilla, dead_ogonek ] }; - - key { [ NoSymbol, Greek_OMEGA ] }; - key { [ lstroke, Lstroke ] }; - key { [ oe, OE ] }; - key { [ paragraph, registered ] }; - key { [ tslash, Tslash ] }; - key { [ leftarrow, yen ] }; - key { [ downarrow, uparrow ] }; - key { [ rightarrow, idotless ] }; - key { [ oslash, Ooblique ] }; - key { [ thorn, THORN ] }; - key { [ NoSymbol, dead_abovering ] }; - key { [ dead_tilde, dead_macron ] }; - - key { [ ae, AE ] }; - key { [ ssharp, section ] }; - key { [ eth, ETH ] }; - key { [ NoSymbol, ordfeminine ] }; - key { [ eng, ENG ] }; - key { [ hstroke, Hstroke ] }; - key { [ U0133, U0132 ] }; - key { [ kra, NoSymbol ] }; - key { [ U0140, U013F ] }; - key { [ dead_acute, dead_doubleacute ] }; - key { [ NoSymbol, dead_caron ] }; - key { [ NoSymbol, dead_breve ] }; - - - key { [ NoSymbol, brokenbar ] }; - - key { [ cent, copyright ] }; - key { [ leftdoublequotemark, leftsinglequotemark ] }; - key { [ rightdoublequotemark, rightsinglequotemark ] }; - key { [ U0149, U266A ] }; - key { [ mu, masculine ] }; - key { [ Greek_horizbar, multiply ] }; - key { [ periodcentered, division ] }; - key { [ NoSymbol, dead_abovedot ] }; - -}; - -// based on -// Inuktitut keyboard for X11 -// written by Pablo Saratxaga - -alphanumeric_keys -xkb_symbols "ike" { - - name[Group1]= "Canada - Inuktitut"; - - key { [ 0x01001595, 1 ] }; - key { [ 0x01001449, 2 ] }; - key { [ 0x01001550, 3 ] }; - key { [ 0x01001483, 4 ] }; - key { [ 0x01001466, 5 ] }; - key { [ 0x01001585, 6 ] }; - key { [ 0x010014bb, 7 ] }; - key { [ 0x010014d0, 8 ] }; - key { [ 0x010014ea, 9 ] }; - key { [ 0x0100153e, 0 ] }; - key { [ minus, underscore ] }; - key { [ 0x0100155d, equal ] }; - - key { [ 0x0100158f, 0x0100148b ] }; - key { [ 0x01001403, 0x01001431 ] }; - key { [ 0x0100157f, 0x01001546 ] }; - key { [ 0x0100146d, 0x01001596 ] }; - key { [ 0x0100144e, 0x01001671 ] }; - key { [ 0x010014ef, 0x01001673 ] }; - key { [ 0x010014a5, 0x01001675 ] }; - key { [ 0x010014c2, 0x010015a4 ] }; - key { [ 0x010014d5, 0x010015a0 ] }; - key { [ 0x01001528, 0x010015a6 ] }; - key { [ 0x010014a1, 0x01001505 ] }; - key { [ dead_abovedot, 0x0100141e] }; - - key { [ 0x01001591, 0x0100148d ] }; - key { [ 0x01001405, 0x01001433 ] }; - key { [ 0x01001581, 0x01001548 ] }; - key { [ 0x0100146f, 0x01001555 ] }; - key { [ 0x01001450, parenleft ] }; - key { [ 0x010014f1, parenright ] }; - key { [ 0x010014a7, 0x0100152a ] }; - key { [ 0x010014c4, 0x01001557 ] }; - key { [ 0x010014d7, 0x010015a2 ] }; - key { [ semicolon, colon ] }; - key { [ apostrophe, quotedbl ] }; - - key { [ 0x01001593, 0x01001490 ] }; - key { [ 0x0100140a, 0x01001438 ] }; - key { [ 0x01001583, 0x0100154b ] }; - key { [ 0x01001472, question ] }; - key { [ 0x01001455, 0x0100157c ] }; - key { [ 0x010014f4, 0x010014c7 ] }; - key { [ 0x010014aa, 0x010014da ] }; - key { [ comma, less ] }; - key { [ period, greater ] }; - key { [ 0x0100152d, 0x01001559 ] }; - - key { [ 0x0100157b, 0x01001575 ] }; - key { [ 0x01001579, 0x01001577 ] }; - key { [ backslash, bar ] }; - -// End alphanumeric section -}; - -partial -xkb_symbols "multix" { - - name[Group1] = "Canada - Multilingual"; - - key.type[group1]="EIGHT_LEVEL_SEMIALPHABETIC"; - key { [ slash, backslash, bar, NoSymbol, - NoSymbol, hyphen ] }; - key { [ 1, exclam, plusminus, NoSymbol, - onesuperior, exclamdown ] }; - key { [ 2, at, at, NoSymbol, - twosuperior, NoSymbol ] }; - key { [ 3, numbersign, sterling, NoSymbol, - threesuperior, sterling ] }; - key { [ 4, dollar, cent, NoSymbol, - onequarter, currency ] }; - key { [ 5, percent, currency, NoSymbol, - onehalf, threeeighths ] }; - key { [ 6, question, notsign, NoSymbol, - threequarters, fiveeighths ] }; - key { [ 7, ampersand, braceleft, NoSymbol, - NoSymbol, seveneighths ] }; - key { [ 8, asterisk, braceright, NoSymbol, - NoSymbol, trademark ] }; - key { [ 9, parenleft, bracketleft, NoSymbol, - NoSymbol, plusminus ] }; - key { [ 0, parenright, bracketright, NoSymbol ] }; - key { [ minus, underscore, onehalf, NoSymbol, - NoSymbol, questiondown] }; - key { [ equal, plus, notsign, NoSymbol, - dead_cedilla, dead_ogonek ] }; - - key.type[group1]="EIGHT_LEVEL_SEMIALPHABETIC"; - key { [ q, Q, NoSymbol, NoSymbol, - NoSymbol, Greek_OMEGA ] }; - key { [ w, W, NoSymbol, NoSymbol, - lstroke, Lstroke ] }; - key { [ e, E, NoSymbol, NoSymbol, - oe, OE ] }; - key { [ r, R, NoSymbol, NoSymbol, - paragraph, registered ] }; - key { [ t, T, NoSymbol, NoSymbol, - tslash, Tslash ] }; - key { [ y, Y, NoSymbol, NoSymbol, - leftarrow, yen ] }; - key { [ u, U, NoSymbol, NoSymbol, - downarrow, uparrow ] }; - key { [ i, I, NoSymbol, NoSymbol, - rightarrow, idotless ] }; - key { [ o, O, section, NoSymbol, - oslash, Ooblique ] }; - key { [ p, P, paragraph, NoSymbol, - thorn, THORN ] }; - - key.type[group1]="EIGHT_LEVEL"; - key { [dead_circumflex, dead_diaeresis, dead_grave, NoSymbol, - NoSymbol, dead_abovering ] }; - - key.type[group1]="EIGHT_LEVEL_SEMIALPHABETIC"; - key { [ ccedilla, Ccedilla, asciitilde, NoSymbol, - dead_tilde, dead_macron ] }; - - key { [ a, A, NoSymbol, NoSymbol, - ae, AE ] }; - key { [ s, S, NoSymbol, NoSymbol, - ssharp, section ] }; - key { [ d, D, NoSymbol, NoSymbol, - eth, ETH ] }; - key { [ f, F, NoSymbol, NoSymbol, - NoSymbol, ordfeminine ] }; - key { [ g, G, NoSymbol, NoSymbol, - eng, ENG ] }; - key { [ h, H, NoSymbol, NoSymbol, - hstroke, Hstroke ] }; - key { [ j, J, NoSymbol, NoSymbol, - U0133, U0132 ] }; - key { [ k, K, NoSymbol, NoSymbol, - kra, NoSymbol ] }; - key { [ l, L, NoSymbol, NoSymbol, - U0140, U013F ] }; - - key.type[group1]="EIGHT_LEVEL"; - key { [ semicolon, colon, degree, NoSymbol, - dead_acute, dead_doubleacute ] }; - - key.type[group1]="EIGHT_LEVEL_SEMIALPHABETIC"; - key { [ egrave, Egrave, braceleft, NoSymbol, - NoSymbol, dead_caron ] }; - key { [ agrave, Agrave, braceright, NoSymbol, - NoSymbol, dead_breve ] }; - - key { [ ugrave, Ugrave, degree, NoSymbol, - NoSymbol, brokenbar ] }; - - key.type[group1]="FOUR_LEVEL_SEMIALPHABETIC"; - key { [ z, Z, guillemotleft, NoSymbol ] }; - key { [ x, X, guillemotright, NoSymbol ] }; - - key.type[group1]="EIGHT_LEVEL_SEMIALPHABETIC"; - key { [ c, C, NoSymbol, NoSymbol, - cent, copyright ] }; - key { [ v, V, NoSymbol, NoSymbol, - leftdoublequotemark, leftsinglequotemark ] }; - key { [ b, B, NoSymbol, NoSymbol, - rightdoublequotemark, rightsinglequotemark ] }; - key { [ n, N, NoSymbol, NoSymbol, - U0149, U266A ] }; - key { [ m, M, mu, NoSymbol, - mu, masculine ] }; - key { [ comma, apostrophe, less, NoSymbol, - Greek_horizbar, multiply ] }; - key { [ period, quotedbl, greater, NoSymbol, - periodcentered, division ] }; - key { [ eacute, Eacute, dead_acute, NoSymbol, - NoSymbol, dead_abovedot ] }; - - include "nbsp(level3s)" - - modifier_map Control{ Control_L }; - - include "level3(ralt_switch)" - include "level5(rctrl_switch)" -}; - -// Secwepemctsin keyboard for X11 -// written by Neskie Manuel - -partial alphanumeric_keys -xkb_symbols "shs" { - - include "us" - - name[Group1]= "Canada - Secwepemctsin"; - - //Using Dead key to get COMBINING COMMA ABOVE for ejectives on - //q, l, t, s, m, g, k, p, w, y, r - //XCompose key is used for the other accute and grave. - - key { [ comma, less, U0313 ] }; - key { [ a, A, aacute, Aacute ] }; - key { [ e, E, eacute, Eacute ] }; - key { [ u, U, uacute, Uacute ] }; - key { [ i, I, iacute, Iacute ] }; - key { [ o, O, oacute, Oacute ] }; - - include "level3(ralt_switch)" - include "compose(rctrl)" -}; - -// OLPC Section -xkb_symbols "olpc" { - - include "ca(fr)" - - key { [ 2, quotedbl, ograve, Ograve ] }; - key { [ 3, slash, at, VoidSymbol ] }; - - key { [ e, E, EuroSign, VoidSymbol] }; - - key { [ period, period, 0x1002010 ] }; - - key { [ guillemotleft, guillemotright, degree, VoidSymbol ] }; -}; - -partial alphanumeric_keys -xkb_symbols "kut" { - - //Ejective U0313 and compose accents are from shs layout - include "ca(shs)" - - name[Group1]= "Canada - Ktunaxa"; - - // Alphanumeric section - - // Alveolar Click - key { [ t, T,U01C2 ,U01C2 ] }; - - //Cent sign - key { [ c, C,U00A2,U00A2 ] }; - - //Mid dot - key { [ period, greater,U00B7 ] }; - - //Glottal stop - key { [ slash, question, U0294 ] }; - - //COMBINING COMMA ABOVE RIGHT - key { [ apostrophe, quotedbl, U0315,U0315 ] }; - - //MODIFIER LETTER RIGHT HALF RING - key { [ semicolon, colon,U02BE,U02BE ] }; -}; - -partial alphanumeric_keys -xkb_symbols "eng" { - name[Group1] = "Canada - English"; - include "us(basic)" -}; - +default partial +xkb_symbols "fr" { + name[Group1] = "Canada"; + + key { [ numbersign, bar, backslash ] }; + key { [ 1, exclam, plusminus ] }; + key { [ 2, quotedbl, at ] }; + key { [ 3, slash, sterling ] }; + key { [ 4, dollar, cent ] }; + key { [ 5, percent, currency ] }; + key { [ 6, question, notsign ] }; + key { [ 7, ampersand, brokenbar ] }; + key { [ 8, asterisk, twosuperior ] }; + key { [ 9, parenleft, threesuperior ] }; + key { [ 0, parenright, onequarter ] }; + key { [ minus, underscore, onehalf ] }; + key { [ equal, plus, threequarters ] }; + + key { [ q, Q ] }; + key { [ w, W ] }; + key { [ e, E ] }; + key { [ r, R ] }; + key { [ t, T ] }; + key { [ y, Y ] }; + key { [ u, U ] }; + key { [ i, I ] }; + key { [ o, O, section ] }; + key { [ p, P, paragraph ] }; + key { [dead_circumflex, dead_circumflex, bracketleft ] }; + key { [ dead_cedilla, dead_diaeresis, bracketright ] }; + + key { [ a, A ] }; + key { [ s, S ] }; + key { [ d, D ] }; + key { [ f, F ] }; + key { [ g, G ] }; + key { [ h, H ] }; + key { [ j, J ] }; + key { [ k, K ] }; + key { [ l, L ] }; + key { [ semicolon, colon, asciitilde ] }; + key { [dead_grave, dead_grave, braceleft ] }; + key { [ less, greater, braceright ] }; + + key { [guillemotleft, guillemotright, degree] }; + key { [ z, Z ] }; + key { [ x, X ] }; + key { [ c, C ] }; + key { [ v, V ] }; + key { [ b, B ] }; + key { [ n, N ] }; + key { [ m, M, mu ] }; + key { [ comma, apostrophe, macron ] }; + key { [ period, period, hyphen ] }; + key { [ eacute, Eacute, dead_acute ] }; + + key { [ space, space, nobreakspace ] }; + + include "level3(ralt_switch)" +}; + +xkb_symbols "fr-dvorak" { + name[Group1] = "Canada - French Dvorak"; + + key { [ numbersign, bar, backslash ] }; + key { [ 1, exclam, plusminus ] }; + key { [ 2, quotedbl, at ] }; + key { [ 3, slash, sterling ] }; + key { [ 4, dollar, cent ] }; + key { [ 5, percent, currency ] }; + key { [ 6, question, notsign ] }; + key { [ 7, ampersand, brokenbar ] }; + key { [ 8, asterisk, twosuperior ] }; + key { [ 9, parenleft, threesuperior ] }; + key { [ 0, parenright, onequarter ] }; + key { [dead_circumflex, dead_circumflex, bracketleft ] }; + key { [ dead_cedilla, dead_diaeresis, bracketright ] }; + + key { [dead_grave, dead_grave, braceleft ] }; + key { [ comma, apostrophe, macron ] }; + key { [ period, period, hyphen ] }; + key { [ p, P, paragraph ] }; + key { [ y, Y ] }; + key { [ f, F ] }; + key { [ g, G ] }; + key { [ c, C ] }; + key { [ r, R ] }; + key { [ l, L ] }; + key { [ eacute, Eacute, dead_acute ] }; + key { [ equal, plus, threequarters ] }; + + key { [ a, A ] }; + key { [ o, O, section ] }; + key { [ e, E ] }; + key { [ u, U ] }; + key { [ i, I ] }; + key { [ d, D ] }; + key { [ h, H ] }; + key { [ t, T ] }; + key { [ n, N ] }; + key { [ s, S ] }; + key { [ minus, underscore, onehalf ] }; + key { [ less, greater, braceright ] }; + + key { [guillemotleft, guillemotright, degree] }; + key { [ semicolon, colon, asciitilde ] }; + key { [ q, Q ] }; + key { [ j, J ] }; + key { [ k, K ] }; + key { [ x, X ] }; + key { [ b, B ] }; + key { [ m, M, mu ] }; + key { [ w, W ] }; + key { [ v, V ] }; + key { [ z, Z ] }; + + key { [ space, space, nobreakspace ] }; + + include "level3(ralt_switch)" +}; + +partial +xkb_symbols "fr-legacy" { + + name[Group1] = "Canada - French (legacy)"; + + include "ca(fr)" + + key { [ degree, degree, notsign ] }; + key { [ 1, exclam, onesuperior ] }; + + key { [ 3, numbersign, threesuperior ] }; + key { [ 4, dollar, onequarter ] }; + key { [ 5, percent, onehalf ] }; + key { [ 6, question, threequarters ] }; + key { [ 7, ampersand, braceleft ] }; + key { [ 8, asterisk, bracketleft ] }; + key { [ 9, parenleft, bracketright, plusminus ] }; + key { [ 0, parenright, braceright ] }; + key { [ minus, underscore, bar, questiondown] }; + key { [ equal, plus, dead_cedilla ] }; + + key { [ r, R, paragraph, registered ] }; + key { [ y, Y, yen ] }; + key { [ o, O, oslash, Ooblique ] }; + key { [ p, P, thorn, THORN ] }; + key { [dead_circumflex, dead_circumflex, degree ] }; + key { [ ccedilla, Ccedilla, dead_tilde, dead_diaeresis ] }; + + key { [ a, A, ae, AE ] }; + key { [ s, S, ssharp, section ] }; + key { [ d, D, eth, ETH ] }; + key { [ f, F, ordfeminine ] }; + key { [ semicolon, colon, dead_acute, dead_acute ] }; + key { [ egrave, Egrave ] }; + key { [ agrave, Agrave, dead_grave ] }; + + key { [ ugrave, Ugrave, backslash, bar ] }; + key { [ z, Z, guillemotleft ] }; + key { [ x, X, guillemotright ] }; + key { [ c, C, cent, copyright ] }; + key { [ m, M, mu, masculine ] }; + key { [ comma, apostrophe, less ] }; + key { [ period, period, greater ] }; + key { [ eacute, Eacute, slash ] }; +}; + +partial +xkb_symbols "multi" { + + name[Group1] = "Canada - Multilingual, first part"; + + include "ca(fr)" + + key { [ slash, backslash, bar ] }; + key { [ 1, exclam ] }; + key { [ 2, at ] }; + key { [ 3, numbersign ] }; + key { [ 4, dollar ] }; + key { [ 5, percent ] }; + key { [ 6, question ] }; + key { [ 7, ampersand, braceleft ] }; + key { [ 8, asterisk, braceright ] }; + key { [ 9, parenleft, bracketleft ] }; + key { [ 0, parenright, bracketright ] }; + key { [ minus, underscore ] }; + key { [ equal, plus, notsign ] }; + + key { [ o, O ] }; + key { [ p, P ] }; + key { [dead_circumflex, dead_diaeresis, dead_grave ] }; + key { [ ccedilla, Ccedilla, asciitilde ] }; + + key { [ semicolon, colon, degree ] }; + key { [ egrave, Egrave ] }; + key { [ agrave, Agrave ] }; + + key { [ ugrave, Ugrave ] }; + key { [ z, Z, guillemotleft ] }; + key { [ x, X, guillemotright ] }; + key { [ comma, apostrophe, less ] }; + key { [ period, quotedbl, greater ] }; + key { [ eacute, Eacute ] }; +}; + +partial +xkb_symbols "multi-2gr" { + + name[Group1] = "Canada - Multilingual, second part"; + + key { [ NoSymbol, hyphen ] }; + key { [ onesuperior, exclamdown ] }; + key { [ twosuperior, NoSymbol ] }; + key { [ threesuperior, sterling ] }; + key { [ onequarter, currency ] }; + key { [ onehalf,threeeighths ] }; + key { [ threequarters, fiveeighths ] }; + key { [ NoSymbol,seveneighths ] }; + key { [ NoSymbol, trademark ] }; + key { [ NoSymbol, plusminus ] }; + + key { [ NoSymbol, questiondown] }; + key { [ dead_cedilla, dead_ogonek ] }; + + key { [ NoSymbol, Greek_OMEGA ] }; + key { [ lstroke, Lstroke ] }; + key { [ oe, OE ] }; + key { [ paragraph, registered ] }; + key { [ tslash, Tslash ] }; + key { [ leftarrow, yen ] }; + key { [ downarrow, uparrow ] }; + key { [ rightarrow, idotless ] }; + key { [ oslash, Ooblique ] }; + key { [ thorn, THORN ] }; + key { [ NoSymbol, dead_abovering ] }; + key { [ dead_tilde, dead_macron ] }; + + key { [ ae, AE ] }; + key { [ ssharp, section ] }; + key { [ eth, ETH ] }; + key { [ NoSymbol, ordfeminine ] }; + key { [ eng, ENG ] }; + key { [ hstroke, Hstroke ] }; + key { [ U0133, U0132 ] }; + key { [ kra, NoSymbol ] }; + key { [ U0140, U013F ] }; + key { [ dead_acute, dead_doubleacute ] }; + key { [ NoSymbol, dead_caron ] }; + key { [ NoSymbol, dead_breve ] }; + + + key { [ NoSymbol, brokenbar ] }; + + key { [ cent, copyright ] }; + key { [ leftdoublequotemark, leftsinglequotemark ] }; + key { [ rightdoublequotemark, rightsinglequotemark ] }; + key { [ U0149, U266A ] }; + key { [ mu, masculine ] }; + key { [ Greek_horizbar, multiply ] }; + key { [ periodcentered, division ] }; + key { [ NoSymbol, dead_abovedot ] }; + +}; + +// based on +// Inuktitut keyboard for X11 +// written by Pablo Saratxaga + +alphanumeric_keys +xkb_symbols "ike" { + + name[Group1]= "Canada - Inuktitut"; + + key { [ 0x01001595, 1 ] }; + key { [ 0x01001449, 2 ] }; + key { [ 0x01001550, 3 ] }; + key { [ 0x01001483, 4 ] }; + key { [ 0x01001466, 5 ] }; + key { [ 0x01001585, 6 ] }; + key { [ 0x010014bb, 7 ] }; + key { [ 0x010014d0, 8 ] }; + key { [ 0x010014ea, 9 ] }; + key { [ 0x0100153e, 0 ] }; + key { [ minus, underscore ] }; + key { [ 0x0100155d, equal ] }; + + key { [ 0x0100158f, 0x0100148b ] }; + key { [ 0x01001403, 0x01001431 ] }; + key { [ 0x0100157f, 0x01001546 ] }; + key { [ 0x0100146d, 0x01001596 ] }; + key { [ 0x0100144e, 0x01001671 ] }; + key { [ 0x010014ef, 0x01001673 ] }; + key { [ 0x010014a5, 0x01001675 ] }; + key { [ 0x010014c2, 0x010015a4 ] }; + key { [ 0x010014d5, 0x010015a0 ] }; + key { [ 0x01001528, 0x010015a6 ] }; + key { [ 0x010014a1, 0x01001505 ] }; + key { [ dead_abovedot, 0x0100141e] }; + + key { [ 0x01001591, 0x0100148d ] }; + key { [ 0x01001405, 0x01001433 ] }; + key { [ 0x01001581, 0x01001548 ] }; + key { [ 0x0100146f, 0x01001555 ] }; + key { [ 0x01001450, parenleft ] }; + key { [ 0x010014f1, parenright ] }; + key { [ 0x010014a7, 0x0100152a ] }; + key { [ 0x010014c4, 0x01001557 ] }; + key { [ 0x010014d7, 0x010015a2 ] }; + key { [ semicolon, colon ] }; + key { [ apostrophe, quotedbl ] }; + + key { [ 0x01001593, 0x01001490 ] }; + key { [ 0x0100140a, 0x01001438 ] }; + key { [ 0x01001583, 0x0100154b ] }; + key { [ 0x01001472, question ] }; + key { [ 0x01001455, 0x0100157c ] }; + key { [ 0x010014f4, 0x010014c7 ] }; + key { [ 0x010014aa, 0x010014da ] }; + key { [ comma, less ] }; + key { [ period, greater ] }; + key { [ 0x0100152d, 0x01001559 ] }; + + key { [ 0x0100157b, 0x01001575 ] }; + key { [ 0x01001579, 0x01001577 ] }; + key { [ backslash, bar ] }; + +// End alphanumeric section +}; + +partial +xkb_symbols "multix" { + + name[Group1] = "Canada - Multilingual"; + + key.type[group1]="EIGHT_LEVEL_SEMIALPHABETIC"; + key { [ slash, backslash, bar, NoSymbol, + NoSymbol, hyphen ] }; + key { [ 1, exclam, plusminus, NoSymbol, + onesuperior, exclamdown ] }; + key { [ 2, at, at, NoSymbol, + twosuperior, NoSymbol ] }; + key { [ 3, numbersign, sterling, NoSymbol, + threesuperior, sterling ] }; + key { [ 4, dollar, cent, NoSymbol, + onequarter, currency ] }; + key { [ 5, percent, currency, NoSymbol, + onehalf, threeeighths ] }; + key { [ 6, question, notsign, NoSymbol, + threequarters, fiveeighths ] }; + key { [ 7, ampersand, braceleft, NoSymbol, + NoSymbol, seveneighths ] }; + key { [ 8, asterisk, braceright, NoSymbol, + NoSymbol, trademark ] }; + key { [ 9, parenleft, bracketleft, NoSymbol, + NoSymbol, plusminus ] }; + key { [ 0, parenright, bracketright, NoSymbol ] }; + key { [ minus, underscore, onehalf, NoSymbol, + NoSymbol, questiondown] }; + key { [ equal, plus, notsign, NoSymbol, + dead_cedilla, dead_ogonek ] }; + + key.type[group1]="EIGHT_LEVEL_SEMIALPHABETIC"; + key { [ q, Q, NoSymbol, NoSymbol, + NoSymbol, Greek_OMEGA ] }; + key { [ w, W, NoSymbol, NoSymbol, + lstroke, Lstroke ] }; + key { [ e, E, NoSymbol, NoSymbol, + oe, OE ] }; + key { [ r, R, NoSymbol, NoSymbol, + paragraph, registered ] }; + key { [ t, T, NoSymbol, NoSymbol, + tslash, Tslash ] }; + key { [ y, Y, NoSymbol, NoSymbol, + leftarrow, yen ] }; + key { [ u, U, NoSymbol, NoSymbol, + downarrow, uparrow ] }; + key { [ i, I, NoSymbol, NoSymbol, + rightarrow, idotless ] }; + key { [ o, O, section, NoSymbol, + oslash, Ooblique ] }; + key { [ p, P, paragraph, NoSymbol, + thorn, THORN ] }; + + key.type[group1]="EIGHT_LEVEL"; + key { [dead_circumflex, dead_diaeresis, dead_grave, NoSymbol, + NoSymbol, dead_abovering ] }; + + key.type[group1]="EIGHT_LEVEL_SEMIALPHABETIC"; + key { [ ccedilla, Ccedilla, asciitilde, NoSymbol, + dead_tilde, dead_macron ] }; + + key { [ a, A, NoSymbol, NoSymbol, + ae, AE ] }; + key { [ s, S, NoSymbol, NoSymbol, + ssharp, section ] }; + key { [ d, D, NoSymbol, NoSymbol, + eth, ETH ] }; + key { [ f, F, NoSymbol, NoSymbol, + NoSymbol, ordfeminine ] }; + key { [ g, G, NoSymbol, NoSymbol, + eng, ENG ] }; + key { [ h, H, NoSymbol, NoSymbol, + hstroke, Hstroke ] }; + key { [ j, J, NoSymbol, NoSymbol, + U0133, U0132 ] }; + key { [ k, K, NoSymbol, NoSymbol, + kra, NoSymbol ] }; + key { [ l, L, NoSymbol, NoSymbol, + U0140, U013F ] }; + + key.type[group1]="EIGHT_LEVEL"; + key { [ semicolon, colon, degree, NoSymbol, + dead_acute, dead_doubleacute ] }; + + key.type[group1]="EIGHT_LEVEL_SEMIALPHABETIC"; + key { [ egrave, Egrave, braceleft, NoSymbol, + NoSymbol, dead_caron ] }; + key { [ agrave, Agrave, braceright, NoSymbol, + NoSymbol, dead_breve ] }; + + key { [ ugrave, Ugrave, degree, NoSymbol, + NoSymbol, brokenbar ] }; + + key.type[group1]="FOUR_LEVEL_SEMIALPHABETIC"; + key { [ z, Z, guillemotleft, NoSymbol ] }; + key { [ x, X, guillemotright, NoSymbol ] }; + + key.type[group1]="EIGHT_LEVEL_SEMIALPHABETIC"; + key { [ c, C, NoSymbol, NoSymbol, + cent, copyright ] }; + key { [ v, V, NoSymbol, NoSymbol, + leftdoublequotemark, leftsinglequotemark ] }; + key { [ b, B, NoSymbol, NoSymbol, + rightdoublequotemark, rightsinglequotemark ] }; + key { [ n, N, NoSymbol, NoSymbol, + U0149, U266A ] }; + key { [ m, M, mu, NoSymbol, + mu, masculine ] }; + key { [ comma, apostrophe, less, NoSymbol, + Greek_horizbar, multiply ] }; + key { [ period, quotedbl, greater, NoSymbol, + periodcentered, division ] }; + key { [ eacute, Eacute, dead_acute, NoSymbol, + NoSymbol, dead_abovedot ] }; + + include "nbsp(level3s)" + + modifier_map Control{ Control_L }; + + include "level3(ralt_switch)" + include "level5(rctrl_switch)" +}; + +// Secwepemctsin keyboard for X11 +// written by Neskie Manuel + +partial alphanumeric_keys +xkb_symbols "shs" { + + include "us" + + name[Group1]= "Canada - Secwepemctsin"; + + //Using Dead key to get COMBINING COMMA ABOVE for ejectives on + //q, l, t, s, m, g, k, p, w, y, r + //XCompose key is used for the other accute and grave. + + key { [ comma, less, U0313 ] }; + key { [ a, A, aacute, Aacute ] }; + key { [ e, E, eacute, Eacute ] }; + key { [ u, U, uacute, Uacute ] }; + key { [ i, I, iacute, Iacute ] }; + key { [ o, O, oacute, Oacute ] }; + + include "level3(ralt_switch)" + include "compose(rctrl)" +}; + +// OLPC Section +xkb_symbols "olpc" { + + include "ca(fr)" + + key { [ 2, quotedbl, ograve, Ograve ] }; + key { [ 3, slash, at, VoidSymbol ] }; + + key { [ e, E, EuroSign, VoidSymbol] }; + + key { [ period, period, 0x1002010 ] }; + + key { [ guillemotleft, guillemotright, degree, VoidSymbol ] }; +}; + +partial alphanumeric_keys +xkb_symbols "kut" { + + //Ejective U0313 and compose accents are from shs layout + include "ca(shs)" + + name[Group1]= "Canada - Ktunaxa"; + + // Alphanumeric section + + // Alveolar Click + key { [ t, T,U01C2 ,U01C2 ] }; + + //Cent sign + key { [ c, C,U00A2,U00A2 ] }; + + //Mid dot + key { [ period, greater,U00B7 ] }; + + //Glottal stop + key { [ slash, question, U0294 ] }; + + //COMBINING COMMA ABOVE RIGHT + key { [ apostrophe, quotedbl, U0315,U0315 ] }; + + //MODIFIER LETTER RIGHT HALF RING + key { [ semicolon, colon,U02BE,U02BE ] }; +}; + +partial alphanumeric_keys +xkb_symbols "eng" { + name[Group1] = "Canada - English"; + include "us(basic)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/capslock b/xorg-server/xkeyboard-config/symbols/capslock index 415e4db1d..288a1d293 100644 --- a/xorg-server/xkeyboard-config/symbols/capslock +++ b/xorg-server/xkeyboard-config/symbols/capslock @@ -1,65 +1,62 @@ -// $XKeyboardConfig$ - -default partial hidden modifier_keys -xkb_symbols "capslock" { - replace key { [ Caps_Lock ] }; - modifier_map Lock { Caps_Lock }; -}; - -partial hidden modifier_keys -xkb_symbols "shiftlock" { - replace key { [ Shift_Lock ] }; - modifier_map Shift { Shift_Lock }; -}; - -partial hidden modifier_keys -xkb_symbols "grouplock" { - replace key { [ ISO_Next_Group, Caps_Lock ] }; -}; - -partial hidden modifier_keys -xkb_symbols "swapescape" { - key { [ Escape ] }; - key { [ Caps_Lock ] }; -}; - -partial hidden modifier_keys -xkb_symbols "groupshift" { - key { - type[Group1]="PC_ALT_LEVEL2", - [ Mode_switch, Caps_Lock ] - }; -}; - -partial hidden modifier_keys -xkb_symbols "escape" { - key { [ Escape ] }; -}; - -partial hidden modifier_keys -xkb_symbols "backspace" { - key { [ BackSpace ] }; -}; - -partial hidden modifier_keys -xkb_symbols "super" { - key { [ Super_L ] }; - modifier_map Mod4 { }; -}; - -partial hidden modifier_keys -xkb_symbols "hyper" { - key { [ Hyper_L ] }; - modifier_map Mod4 { }; -}; - -partial hidden modifier_keys -xkb_symbols "none" { - key { [ VoidSymbol ] }; -}; - -partial hidden modifier_keys -xkb_symbols "numlock" { - key { [ Num_Lock ] }; -}; - +default partial hidden modifier_keys +xkb_symbols "capslock" { + replace key { [ Caps_Lock ] }; + modifier_map Lock { Caps_Lock }; +}; + +partial hidden modifier_keys +xkb_symbols "shiftlock" { + replace key { [ Shift_Lock ] }; + modifier_map Shift { Shift_Lock }; +}; + +partial hidden modifier_keys +xkb_symbols "grouplock" { + replace key { [ ISO_Next_Group, Caps_Lock ] }; +}; + +partial hidden modifier_keys +xkb_symbols "swapescape" { + key { [ Escape ] }; + key { [ Caps_Lock ] }; +}; + +partial hidden modifier_keys +xkb_symbols "groupshift" { + key { + type[Group1]="PC_ALT_LEVEL2", + [ Mode_switch, Caps_Lock ] + }; +}; + +partial hidden modifier_keys +xkb_symbols "escape" { + key { [ Escape ] }; +}; + +partial hidden modifier_keys +xkb_symbols "backspace" { + key { [ BackSpace ] }; +}; + +partial hidden modifier_keys +xkb_symbols "super" { + key { [ Super_L ] }; + modifier_map Mod4 { }; +}; + +partial hidden modifier_keys +xkb_symbols "hyper" { + key { [ Hyper_L ] }; + modifier_map Mod4 { }; +}; + +partial hidden modifier_keys +xkb_symbols "none" { + key { [ VoidSymbol ] }; +}; + +partial hidden modifier_keys +xkb_symbols "numlock" { + key { [ Num_Lock ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/cd b/xorg-server/xkeyboard-config/symbols/cd index 1ba036551..8a12a384e 100644 --- a/xorg-server/xkeyboard-config/symbols/cd +++ b/xorg-server/xkeyboard-config/symbols/cd @@ -1,71 +1,69 @@ -// $XKeyboardConfig$ - -// based on us_intl keyboard map file and a Sinhala keyboard map -// version 0.3 - -partial default alphanumeric_keys -xkb_symbols "basic" { - - name[Group1]= "Congo, Democratic Republic of the"; - - key.type[Group1] = "FOUR_LEVEL"; - - // Alphanumeric section - // TILDE, COMBINING TILDE - key { [ grave, asciitilde, 0x01000303] }; - key { [ ampersand, 1, numbersign ] }; - key { [0x01000301, 2, at ] }; - key { [0x01000300, 3, guillemotleft ] }; - key { [ parenleft, 4, bracketleft ] }; - key { [ braceleft, 5, less ] }; - key { [ braceright, 6, greater ] }; - key { [parenright, 7, bracketright ] }; - key { [0x01000302, 8, guillemotright ] }; - key { [0x0100030c, 9 ] }; - key { [0x01000308, 0, at ] }; - key { [ minus, underscore, percent ] }; - key { [ equal, plus, multiply, division ] }; - - key { [ a, A ] }; - key { [ z, Z ] }; - key { [ e, E ] }; - key { [ r, R ] }; - key { [ t, T ] }; - key { [ y, Y ] }; - key { [ u, U, 0x01000289, 0x01001d7e ] }; - key { [ i, I, 0x01000268, 0x01000197 ] }; - key { [ o, O, oslash, Ooblique ] }; - key { [ p, P ] }; - key { [0x0100025B, 0x01000190, asciicircum ] }; - key { [ asterisk, asciicircum, dollar ] }; - - key { [ q, Q ] }; - key { [ s, S ] }; - key { [ d, D ] }; - key { [ f, F ] }; - key { [ g, G ] }; - key { [ h, H ] }; - key { [ j, J ] }; - key { [ k, K ] }; - key { [ l, L ] }; - key { [ m, M ] }; - key { [0x01000254, 0x01000186 ] }; - key { [ backslash, bar ] }; - - key { [ w, W ] }; - key { [ x, X ] }; - key { [ c, C, ccedilla, Ccedilla ] }; - key { [ v, V ] }; - key { [ b, B ] }; - key { [ n, N ] }; - key { [ comma, question, 0x01000327 ] }; - key { [ semicolon, period ] }; - key { [ colon, slash ] }; - key { [ exclam, apostrophe, 0x01002019 ] }; - key { [ quotedbl, backslash, bar ] }; - - // SPACE, SPACE, SPACE, NO-BREAK SPACE, SPACE - key { [ space, space, nobreakspace, nobreakspace ] }; - - include "level3(ralt_switch)" -}; +// based on us_intl keyboard map file and a Sinhala keyboard map +// version 0.3 + +partial default alphanumeric_keys +xkb_symbols "basic" { + + name[Group1]= "Congo, Democratic Republic of the"; + + key.type[Group1] = "FOUR_LEVEL"; + + // Alphanumeric section + // TILDE, COMBINING TILDE + key { [ grave, asciitilde, 0x01000303] }; + key { [ ampersand, 1, numbersign ] }; + key { [0x01000301, 2, at ] }; + key { [0x01000300, 3, guillemotleft ] }; + key { [ parenleft, 4, bracketleft ] }; + key { [ braceleft, 5, less ] }; + key { [ braceright, 6, greater ] }; + key { [parenright, 7, bracketright ] }; + key { [0x01000302, 8, guillemotright ] }; + key { [0x0100030c, 9 ] }; + key { [0x01000308, 0, at ] }; + key { [ minus, underscore, percent ] }; + key { [ equal, plus, multiply, division ] }; + + key { [ a, A ] }; + key { [ z, Z ] }; + key { [ e, E ] }; + key { [ r, R ] }; + key { [ t, T ] }; + key { [ y, Y ] }; + key { [ u, U, 0x01000289, 0x01001d7e ] }; + key { [ i, I, 0x01000268, 0x01000197 ] }; + key { [ o, O, oslash, Ooblique ] }; + key { [ p, P ] }; + key { [0x0100025B, 0x01000190, asciicircum ] }; + key { [ asterisk, asciicircum, dollar ] }; + + key { [ q, Q ] }; + key { [ s, S ] }; + key { [ d, D ] }; + key { [ f, F ] }; + key { [ g, G ] }; + key { [ h, H ] }; + key { [ j, J ] }; + key { [ k, K ] }; + key { [ l, L ] }; + key { [ m, M ] }; + key { [0x01000254, 0x01000186 ] }; + key { [ backslash, bar ] }; + + key { [ w, W ] }; + key { [ x, X ] }; + key { [ c, C, ccedilla, Ccedilla ] }; + key { [ v, V ] }; + key { [ b, B ] }; + key { [ n, N ] }; + key { [ comma, question, 0x01000327 ] }; + key { [ semicolon, period ] }; + key { [ colon, slash ] }; + key { [ exclam, apostrophe, 0x01002019 ] }; + key { [ quotedbl, backslash, bar ] }; + + // SPACE, SPACE, SPACE, NO-BREAK SPACE, SPACE + key { [ space, space, nobreakspace, nobreakspace ] }; + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/ch b/xorg-server/xkeyboard-config/symbols/ch index 26dcb616f..ffb772d80 100644 --- a/xorg-server/xkeyboard-config/symbols/ch +++ b/xorg-server/xkeyboard-config/symbols/ch @@ -1,7 +1,3 @@ -// $XKeyboardConfig$ -// $Xorg: ch,v 1.3 2000/08/17 19:54:42 cpqbld Exp $ -// $XFree86: xc/programs/xkbcomp/symbols/ch,v 3.6 2002/11/25 14:05:06 eich Exp $ - partial default alphanumeric_keys xkb_symbols "basic" { @@ -215,4 +211,3 @@ xkb_symbols "fr_mac" { [ agrave, adiaeresis, braceleft ] }; }; - diff --git a/xorg-server/xkeyboard-config/symbols/cn b/xorg-server/xkeyboard-config/symbols/cn index 341298056..0d62ab3d4 100644 --- a/xorg-server/xkeyboard-config/symbols/cn +++ b/xorg-server/xkeyboard-config/symbols/cn @@ -1,6 +1,3 @@ -// $XKeyboardConfig$ -// - // // Default Chinese is the same as American // @@ -217,4 +214,3 @@ xkb_symbols "uig" { key { [ backslash, bar ] }; // \ | }; - diff --git a/xorg-server/xkeyboard-config/symbols/compose b/xorg-server/xkeyboard-config/symbols/compose index 84e1a4b04..520d44aaf 100644 --- a/xorg-server/xkeyboard-config/symbols/compose +++ b/xorg-server/xkeyboard-config/symbols/compose @@ -1,59 +1,54 @@ -// $XKeyboardConfig$ - -// $XFree86: xc/programs/xkbcomp/symbols/compose,v 1.1 2001/08/17 16:31:25 dawes Exp $ - -partial modifier_keys -xkb_symbols "ralt" { - key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; -}; - -partial modifier_keys -xkb_symbols "lwin" { - key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; -}; - -partial modifier_keys -xkb_symbols "rwin" { - key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; -}; - -partial modifier_keys -xkb_symbols "menu" { - key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; -}; - -partial modifier_keys -xkb_symbols "rctrl" { - key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; -}; - -partial modifier_keys -xkb_symbols "lctrl" { - key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; -}; - -partial modifier_keys -xkb_symbols "caps" { - key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; -}; - -partial modifier_keys -xkb_symbols "102" { - key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; -}; - -partial modifier_keys -xkb_symbols "paus" { - key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; -}; - -partial modifier_keys -xkb_symbols "prsc" { - key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; -}; - -partial modifier_keys -xkb_symbols "sclk" { - key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; -}; - +partial modifier_keys +xkb_symbols "ralt" { + key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; +}; + +partial modifier_keys +xkb_symbols "lwin" { + key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; +}; + +partial modifier_keys +xkb_symbols "rwin" { + key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; +}; + +partial modifier_keys +xkb_symbols "menu" { + key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; +}; + +partial modifier_keys +xkb_symbols "rctrl" { + key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; +}; + +partial modifier_keys +xkb_symbols "lctrl" { + key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; +}; + +partial modifier_keys +xkb_symbols "caps" { + key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; +}; + +partial modifier_keys +xkb_symbols "102" { + key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; +}; + +partial modifier_keys +xkb_symbols "paus" { + key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; +}; + +partial modifier_keys +xkb_symbols "prsc" { + key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; +}; + +partial modifier_keys +xkb_symbols "sclk" { + key { type[Group1]="TWO_LEVEL", [ Multi_key, Multi_key ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/ctrl b/xorg-server/xkeyboard-config/symbols/ctrl index e11306fa4..189ce739b 100644 --- a/xorg-server/xkeyboard-config/symbols/ctrl +++ b/xorg-server/xkeyboard-config/symbols/ctrl @@ -1,7 +1,3 @@ -// $XKeyboardConfig$ - -// $XFree86: xc/programs/xkbcomp/symbols/ctrl,v 3.2 2003/10/24 20:38:20 tsi Exp $ -// // eliminate the caps lock key completely (replace with control) partial modifier_keys xkb_symbols "nocaps" { diff --git a/xorg-server/xkeyboard-config/symbols/cz b/xorg-server/xkeyboard-config/symbols/cz index 32592799a..d53b8364b 100644 --- a/xorg-server/xkeyboard-config/symbols/cz +++ b/xorg-server/xkeyboard-config/symbols/cz @@ -1,174 +1,170 @@ -// $XKeyboardConfig$ -// $XFree86: xc/programs/xkbcomp/symbols/cz,v 1.2 2002/11/22 04:02:22 dawes -// Exp $ - -partial default alphanumeric_keys -xkb_symbols "basic" { - - // This layout conforms to a new cz compromise standard designed - // to satisfy most unix, windows and mac users. - // 2001 by Kamil Toman - - include "latin" - - name[Group1]= "Czechia"; - - key { [ semicolon, dead_abovering, grave, asciitilde ] }; - key { [ plus, 1, exclam, dead_tilde ] }; - key { [ ecaron, 2, at, dead_caron ] }; - key { [ scaron, 3, numbersign, dead_circumflex ] }; - key { [ ccaron, 4, dollar, dead_breve ] }; - key { [ rcaron, 5, percent, dead_abovering ] }; - key { [ zcaron, 6, asciicircum, dead_ogonek ] }; - key { [ yacute, 7, ampersand, dead_grave ] }; - key { [ aacute, 8, asterisk, dead_abovedot] }; - key { [ iacute, 9, braceleft, dead_acute ] }; - key { [ eacute, 0, braceright, dead_doubleacute ] }; - key { [ equal, percent, NoSymbol, dead_diaeresis ] }; - key { [dead_acute, dead_caron, dead_macron, dead_cedilla ] }; - - key { [ q, Q, backslash, NoSymbol ] }; - key { [ w, W, bar, Nosymbol ] }; - key { [ e, E, EuroSign, NoSymbol ] }; - key { [ r, R, NoSymbol, NoSymbol ] }; - key { [ t, T, NoSymbol, NoSymbol ] }; - key { [ z, Z, NoSymbol, NoSymbol ] }; - key { [ u, U, NoSymbol, NoSymbol ] }; - key { [ i, I, NoSymbol, NoSymbol ] }; - key { [ o, O, NoSymbol, NoSymbol ] }; - key { [ p, P, NoSymbol, NoSymbol ] }; - - key { [ uacute, slash, bracketleft, division ] }; - key { [parenright, parenleft, bracketright, multiply ] }; - - key { [ a, A, asciitilde, NoSymbol ] }; - key { [ s, S, dstroke, NoSymbol ] }; - key { [ d, D, Dstroke, NoSymbol ] }; - key { [ f, F, bracketleft, NoSymbol ] }; - key { [ g, G, bracketright, NoSymbol ] }; - key { [ h, H, grave, NoSymbol ] }; - key { [ j, J, apostrophe, NoSymbol ] }; - key { [ k, K, lstroke, NoSymbol ] }; - key { [ l, L, Lstroke, NoSymbol ] }; - - key { [ uring, quotedbl, dollar, NoSymbol ] }; - key { [ section, exclam, apostrophe, ssharp ] }; - key { [ EuroSign, dead_diaeresis, NoSymbol, NoSymbol ] }; - key { [dead_diaeresis, apostrophe, backslash, bar ] }; - - key { [ backslash, bar, slash, NoSymbol ] }; - key { [ y, Y, degree, NoSymbol ] }; - key { [ x, X, numbersign, Nosymbol ] }; - key { [ c, C, ampersand, NoSymbol ] }; - key { [ v, V, at, NoSymbol ] }; - key { [ b, B, braceleft, NoSymbol ] }; - key { [ n, N, braceright, NoSymbol ] }; - key { [ m, M, asciicircum, NoSymbol ] }; - key { [ comma, question, less, NoSymbol ] }; - key { [ period, colon, greater, NoSymbol ] }; - key { [ minus, underscore, asterisk, NoSymbol ] }; - - key { [ space, space, space, space ] }; - - include "level3(ralt_switch)" -}; - -// Use instead of (useful for keyboard without key) -xkb_symbols "bksl" { - include "cz(basic)" - name[Group1]= "Czechia - With <\|> key"; - - key { [ backslash, bar, slash, NoSymbol ] }; -}; - -partial alphanumeric_keys -xkb_symbols "qwerty" { - - // This layout should work exactly as a cz with the exception - // of 'Z' and 'Y' keys, which are in the qwerty style (ie. swapped). - // 2001 by Kamil Toman - - include "cz(basic)" - name[Group1]= "Czechia - qwerty"; - - key { [ z, Z, degree, NoSymbol ] }; - key { [ y, Y, NoSymbol, NoSymbol ] }; -}; - -// Use instead of (useful for keyboard without key) -xkb_symbols "qwerty_bksl" { - include "cz(qwerty)" - - name[Group1]= "Czechia - qwerty, extended Backslash"; - - key { [ backslash, bar, slash, NoSymbol ] }; -}; - -partial alphanumeric_keys alternate_group -xkb_symbols "ucw" { - - // This layout is usually used as the second group, it contains - // accented characters only, no 'latin' set. - // 2008 by Milan Vancura - - name[Group1]= "Czechia - UCW layout (accented letters only)"; - - key { [zcaron, Zcaron ] }; - key { [ssharp ] }; - key { [ccaron, Ccaron ] }; - key { [ccedilla, Ccedilla ] }; - key { [ntilde, Ntilde ] }; - key { [ncaron, Ncaron ] }; - key { [lacute, Lacute ] }; - - key { [aacute, Aacute ] }; - key { [scaron, Scaron ] }; - key { [dcaron, Dcaron ] }; - key { [ediaeresis, Ediaeresis ] }; - key { [racute, Racute ] }; - key { [uacute, Uacute ] }; - key { [udiaeresis, Udiaeresis ] }; - key { [ocircumflex, Ocircumflex ] }; - key { [lcaron, Lcaron ] }; - - key { [adiaeresis, Adiaeresis ] }; - key { [ecaron, Ecaron ] }; - key { [eacute, Eacute ] }; - key { [rcaron, Rcaron ] }; - key { [tcaron, Tcaron ] }; - key { [yacute, Yacute ] }; - key { [uring, Uring ] }; - key { [iacute, Iacute ] }; - key { [oacute, Oacute ] }; - key { [odiaeresis, Odiaeresis ] }; -}; - -partial alphanumeric_keys -xkb_symbols "dvorak-ucw" { - - // US Dvorak layout extend with UCW - AltGr produces accented characters - - include "us(dvorak)" - - name[Group1]= "Czechia - US Dvorak with CZ UCW support"; - - key { [ j, J, eacute, Eacute ] }; - key { [ k, K, uacute, Uacute ] }; - key { [ z, Z, zcaron, Zcaron ] }; - - key { [ a, A, aacute, Aacute ] }; - key { [ o, O, oacute, Oacute ] }; - key { [ e, E, ecaron, Ecaron ] }; - key { [ u, U, uring, Uring ] }; - key { [ i, I, iacute, Iacute ] }; - key { [ d, D, dcaron, Dcaron ] }; - key { [ t, T, tcaron, Tcaron ] }; - key { [ n, N, ncaron, Ncaron ] }; - key { [ s, S, scaron, Scaron ] }; - - key { [ y, Y, yacute, Yacute ] }; - key { [ c, C, ccaron, Ccaron ] }; - key { [ r, R, rcaron, Rcaron ] }; - - include "level3(ralt_switch)" -}; +partial default alphanumeric_keys +xkb_symbols "basic" { + + // This layout conforms to a new cz compromise standard designed + // to satisfy most unix, windows and mac users. + // 2001 by Kamil Toman + + include "latin" + + name[Group1]= "Czechia"; + + key { [ semicolon, dead_abovering, grave, asciitilde ] }; + key { [ plus, 1, exclam, dead_tilde ] }; + key { [ ecaron, 2, at, dead_caron ] }; + key { [ scaron, 3, numbersign, dead_circumflex ] }; + key { [ ccaron, 4, dollar, dead_breve ] }; + key { [ rcaron, 5, percent, dead_abovering ] }; + key { [ zcaron, 6, asciicircum, dead_ogonek ] }; + key { [ yacute, 7, ampersand, dead_grave ] }; + key { [ aacute, 8, asterisk, dead_abovedot] }; + key { [ iacute, 9, braceleft, dead_acute ] }; + key { [ eacute, 0, braceright, dead_doubleacute ] }; + key { [ equal, percent, NoSymbol, dead_diaeresis ] }; + key { [dead_acute, dead_caron, dead_macron, dead_cedilla ] }; + + key { [ q, Q, backslash, NoSymbol ] }; + key { [ w, W, bar, Nosymbol ] }; + key { [ e, E, EuroSign, NoSymbol ] }; + key { [ r, R, NoSymbol, NoSymbol ] }; + key { [ t, T, NoSymbol, NoSymbol ] }; + key { [ z, Z, NoSymbol, NoSymbol ] }; + key { [ u, U, NoSymbol, NoSymbol ] }; + key { [ i, I, NoSymbol, NoSymbol ] }; + key { [ o, O, NoSymbol, NoSymbol ] }; + key { [ p, P, NoSymbol, NoSymbol ] }; + + key { [ uacute, slash, bracketleft, division ] }; + key { [parenright, parenleft, bracketright, multiply ] }; + + key { [ a, A, asciitilde, NoSymbol ] }; + key { [ s, S, dstroke, NoSymbol ] }; + key { [ d, D, Dstroke, NoSymbol ] }; + key { [ f, F, bracketleft, NoSymbol ] }; + key { [ g, G, bracketright, NoSymbol ] }; + key { [ h, H, grave, NoSymbol ] }; + key { [ j, J, apostrophe, NoSymbol ] }; + key { [ k, K, lstroke, NoSymbol ] }; + key { [ l, L, Lstroke, NoSymbol ] }; + + key { [ uring, quotedbl, dollar, NoSymbol ] }; + key { [ section, exclam, apostrophe, ssharp ] }; + key { [ EuroSign, dead_diaeresis, NoSymbol, NoSymbol ] }; + key { [dead_diaeresis, apostrophe, backslash, bar ] }; + + key { [ backslash, bar, slash, NoSymbol ] }; + key { [ y, Y, degree, NoSymbol ] }; + key { [ x, X, numbersign, Nosymbol ] }; + key { [ c, C, ampersand, NoSymbol ] }; + key { [ v, V, at, NoSymbol ] }; + key { [ b, B, braceleft, NoSymbol ] }; + key { [ n, N, braceright, NoSymbol ] }; + key { [ m, M, asciicircum, NoSymbol ] }; + key { [ comma, question, less, NoSymbol ] }; + key { [ period, colon, greater, NoSymbol ] }; + key { [ minus, underscore, asterisk, NoSymbol ] }; + + key { [ space, space, space, space ] }; + + include "level3(ralt_switch)" +}; + +// Use instead of (useful for keyboard without key) +xkb_symbols "bksl" { + include "cz(basic)" + name[Group1]= "Czechia - With <\|> key"; + + key { [ backslash, bar, slash, NoSymbol ] }; +}; + +partial alphanumeric_keys +xkb_symbols "qwerty" { + + // This layout should work exactly as a cz with the exception + // of 'Z' and 'Y' keys, which are in the qwerty style (ie. swapped). + // 2001 by Kamil Toman + + include "cz(basic)" + name[Group1]= "Czechia - qwerty"; + + key { [ z, Z, degree, NoSymbol ] }; + key { [ y, Y, NoSymbol, NoSymbol ] }; +}; + +// Use instead of (useful for keyboard without key) +xkb_symbols "qwerty_bksl" { + include "cz(qwerty)" + + name[Group1]= "Czechia - qwerty, extended Backslash"; + + key { [ backslash, bar, slash, NoSymbol ] }; +}; + +partial alphanumeric_keys alternate_group +xkb_symbols "ucw" { + + // This layout is usually used as the second group, it contains + // accented characters only, no 'latin' set. + // 2008 by Milan Vancura + + name[Group1]= "Czechia - UCW layout (accented letters only)"; + + key { [zcaron, Zcaron ] }; + key { [ssharp ] }; + key { [ccaron, Ccaron ] }; + key { [ccedilla, Ccedilla ] }; + key { [ntilde, Ntilde ] }; + key { [ncaron, Ncaron ] }; + key { [lacute, Lacute ] }; + + key { [aacute, Aacute ] }; + key { [scaron, Scaron ] }; + key { [dcaron, Dcaron ] }; + key { [ediaeresis, Ediaeresis ] }; + key { [racute, Racute ] }; + key { [uacute, Uacute ] }; + key { [udiaeresis, Udiaeresis ] }; + key { [ocircumflex, Ocircumflex ] }; + key { [lcaron, Lcaron ] }; + + key { [adiaeresis, Adiaeresis ] }; + key { [ecaron, Ecaron ] }; + key { [eacute, Eacute ] }; + key { [rcaron, Rcaron ] }; + key { [tcaron, Tcaron ] }; + key { [yacute, Yacute ] }; + key { [uring, Uring ] }; + key { [iacute, Iacute ] }; + key { [oacute, Oacute ] }; + key { [odiaeresis, Odiaeresis ] }; +}; + +partial alphanumeric_keys +xkb_symbols "dvorak-ucw" { + + // US Dvorak layout extend with UCW - AltGr produces accented characters + + include "us(dvorak)" + + name[Group1]= "Czechia - US Dvorak with CZ UCW support"; + + key { [ j, J, eacute, Eacute ] }; + key { [ k, K, uacute, Uacute ] }; + key { [ z, Z, zcaron, Zcaron ] }; + + key { [ a, A, aacute, Aacute ] }; + key { [ o, O, oacute, Oacute ] }; + key { [ e, E, ecaron, Ecaron ] }; + key { [ u, U, uring, Uring ] }; + key { [ i, I, iacute, Iacute ] }; + key { [ d, D, dcaron, Dcaron ] }; + key { [ t, T, tcaron, Tcaron ] }; + key { [ n, N, ncaron, Ncaron ] }; + key { [ s, S, scaron, Scaron ] }; + + key { [ y, Y, yacute, Yacute ] }; + key { [ c, C, ccaron, Ccaron ] }; + key { [ r, R, rcaron, Rcaron ] }; + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/de b/xorg-server/xkeyboard-config/symbols/de index e597dcf3b..cfe803afb 100644 --- a/xorg-server/xkeyboard-config/symbols/de +++ b/xorg-server/xkeyboard-config/symbols/de @@ -1,600 +1,596 @@ - -// based on a keyboard map from an 'xkb/symbols/de' file -// -// $XKeyboardConfig$ -// $XFree86: xc/programs/xkbcomp/symbols/de,v 1.6 2003/09/08 13:12:51 pascal Exp $ - -default -xkb_symbols "basic" { - - include "latin(type4)" - - name[Group1]="Germany"; - - key { [ 2, quotedbl, twosuperior, oneeighth ] }; - key { [ 3, section, threesuperior, sterling ] }; - key { [ 4, dollar, onequarter, currency ] }; - - key {type[Group1]="FOUR_LEVEL_PLUS_LOCK", symbols[Group1]= - [ssharp, question, backslash, questiondown, 0x1001E9E ]}; -// The unicode capital letter sharp s U+1E9E is transformed to "SS" -// to match the rules for capitalizing sharp s in german. -// If the capital sharp s is needed, delete the line -// starting with from /usr/share/X11/locale/iso8859-15/Compose. -// If both doubled S and capital sharp s are needed, use 0x1001E9E -// for capital sharp s and some free unicode codepoint like 0x1001E9C -// for doubled S. Don`t forget to change this in the Compose file, too. - - key { [dead_acute, dead_grave, dead_cedilla, dead_ogonek ] }; - - key { [ e, E, EuroSign, EuroSign ] }; - key { [ z, Z, leftarrow, yen ] }; - key { [udiaeresis, Udiaeresis, dead_diaeresis, dead_abovering ] }; - key { [ plus, asterisk, dead_tilde, dead_macron ] }; - - key { [ s, S, U017F, U1E9E ] }; - key { [ j, J, dead_belowdot, dead_abovedot ] }; - key { [odiaeresis, Odiaeresis, dead_doubleacute, dead_belowdot ] }; - key { [adiaeresis, Adiaeresis, dead_circumflex, dead_caron ] }; - key { [dead_circumflex, degree, U2032, U2033 ] }; - - key { [numbersign, apostrophe, rightsinglequotemark, dead_breve ] }; - key { [ y, Y, guillemotright, U203A ] }; - key { [ x, X, guillemotleft, U2039 ] }; - key { [ v, V, doublelowquotemark, singlelowquotemark ] }; - key { [ b, B, leftdoublequotemark, leftsinglequotemark ] }; - key { [ n, N, rightdoublequotemark, rightsinglequotemark ] }; - key { [ comma, semicolon, periodcentered, multiply ] }; - key { [ period, colon, U2026, division ] }; - key { [ minus, underscore, endash, emdash ] }; - - include "kpdl(comma)" - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - - // modify the basic German layout to not have any dead keys - - include "de(basic)" - name[Group1]="Germany - Eliminate dead keys"; - - key { [asciicircum, degree, notsign, notsign ] }; - key { [ acute, grave, cedilla, cedilla ] }; - key { [udiaeresis, Udiaeresis, diaeresis, diaeresis ] }; - key { [ plus, asterisk, asciitilde, macron ] }; - key { [odiaeresis, Odiaeresis, doubleacute, doubleacute ] }; - key { [adiaeresis, Adiaeresis, asciicircum, asciicircum ] }; - key { [numbersign, apostrophe, grave, grave ] }; - key { [ minus, underscore, dead_belowdot, abovedot ] }; -}; - -partial alphanumeric_keys -xkb_symbols "deadgraveacute" { - // modify the basic German layout to have only acute and grave - // as dead keys (tilde and circumflex are needed as spacing characters - // in many programming languages) - - include "de(basic)" - name[Group1]="Germany - Dead grave acute"; - - key { [asciicircum, degree, notsign, notsign ] }; - key { [ plus, asterisk, asciitilde, dead_macron ] }; - key { [numbersign, apostrophe, grave, grave ] }; -}; - -partial alphanumeric_keys -xkb_symbols "deadacute" { - // modify the basic German layout to have only acute as - // dead keys (ASCII grave, tilde and circumflex are needed as - // spacing characters in many programming languages and text formatters) - - include "de(deadgraveacute)" - - name[Group1]="Germany - Dead acute"; - - key { [dead_acute, grave, dead_cedilla, dead_ogonek ] }; - key { [numbersign, apostrophe, dead_grave, dead_grave ] }; -}; - -partial alphanumeric_keys -xkb_symbols "ro" { - // add romanian-specific letters to the basic German layout. - // Romanian symbols are accessible with combination of and - // 'a', 's', 't', 'i', 'ä (ä)' (+ for capital letters). - // To view romanian-specific symbols, add "export LC_CTYPE=ro_RO" - // or "export LC_CTYPE=de_DE.utf8" to your .profile. - - include "de(basic)" - - name[Group1]="Germany - Romanian keyboard with German letters"; - - key { [ t, T, tcedilla, Tcedilla ] }; - key { [ i, I, icircumflex, Icircumflex ] }; - key { [ a, A, acircumflex, Acircumflex ] }; - key { [ s, S, scedilla, Scedilla ] }; - key { [ adiaeresis, Adiaeresis, abreve, Abreve ] }; -}; - -partial alphanumeric_keys -xkb_symbols "ro_nodeadkeys" { - // add romanian-specific letters to the German nodeadkeys layout. - // Read the comment for de_ro ! - - include "de(nodeadkeys)" - name[Group1]="Germany - Romanian keyboard with German letters, eliminate dead keys"; - - key { [ t, T, tcedilla, Tcedilla ] }; - key { [ i, I, icircumflex, Icircumflex ] }; - key { [ a, A, acircumflex, Acircumflex ] }; - key { [ s, S, scedilla, Scedilla ] }; - key { [ adiaeresis, Adiaeresis, abreve, Abreve ] }; -}; - -// German Dvorak keymap by Thorsten Staerk (www.staerk.de/thorsten) -// Have acute and grave as dead keys, tilde and circumflex alive as they are needed -// in many programming languages. -// to use this keymap, use a 105-key-keyboard and the command setxkbmap -model pc105 -layout dvorak -variant de -// source: http://www-lehre.informatik.uni-osnabrueck.de/~rfreund/dvorak.php -partial alphanumeric_keys -xkb_symbols "dvorak" { - include "us(dvorak)" - - name[Group1]="Germany - Dvorak"; - - key { [ asciicircum, degree ] }; - - key { [ 1, exclam, onesuperior ] }; - key { [ 2, quotedbl, twosuperior ] }; - key { [ 3, section, threesuperior ] }; - key { [ 4, dollar, bar ] }; - key { [ 5, percent, bar ] }; - key { [ 6, ampersand, brokenbar ] }; - key { [ 7, slash, braceleft ] }; - key { [ 8, parenleft, bracketleft ] }; - key { [ 9, parenright, bracketright ] }; - key { [ 0, equal, braceright ] }; - key { [ plus, asterisk, asciitilde ] }; - key { [ less, greater, dead_grave ] }; - - key { [ udiaeresis, Udiaeresis, at ] }; - key { [ comma, semicolon, dead_diaeresis ] }; - key { [ period, colon ] }; - key { [ c, C, copyright, Cacute ] }; - key { [ t, T, trademark ] }; - key { [ z, Z, zabovedot, Zabovedot ] }; - key { [ question, ssharp ] }; - key { [ slash, backslash, dead_acute ] }; - - key { [ a, A, at, aogonek ] }; - key { [ o, O, oacute, Oacute ] }; - key { [ e, E, EuroSign, eogonek ] }; - key { [ i, I ] }; - key { [ u, U ] }; - key { [ h, H ] }; - key { [ d, D ] }; - key { [ r, R, registered ] }; - key { [ n, N, nacute, Nacute ] }; - key { [ s, S, sacute, Sacute] }; - key { [ l, L, lstroke, Lstroke ] }; - - key { [ odiaeresis, Odiaeresis ] }; - key { [ q, Q, at ] }; - key { [ m, M, mu ] }; - key { [ numbersign, apostrophe ] }; - - key { [ minus, underscore, hyphen, diaeresis] }; - - key { [ adiaeresis, Adiaeresis, bar ] }; - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "Sundeadkeys" { - - // For naming consistency - - include "de(basic)" - -}; - -partial alphanumeric_keys -xkb_symbols "sundeadkeys" { - - // For naming consistency - - include "de(Sundeadkeys)" - - name[Group1]="Germany - Sun dead keys"; -}; - - -// German Neo-Layout Version 2 -// adopted 2004 by Hanno Behrens -// inspired by Dvorak/de-ergo http://www.goebel-consult.de/de-ergo/ -// -// Authors: -// Stephan Hilb -// -// Benjamin Kellermann -// Erik Streb -// and many other contributors -// -// http://www.neo-layout.org -// -// $Revision$, $Date$ - -partial alphanumeric_keys modifier_keys keypad_keys -xkb_symbols "neo_base" { - - // Levels in Neo jargon - // -------------------------------------------------------------- - // Ebene 1: normal - // Ebene 2: Shift - // Ebene 3: Mod3 - // Ebene 4: Mod4 (for marking something use Shift + Mod4) - // Ebene 5: Shift + Mod3 - // Ebene 6: Mod3 + Mod4 - // Compose (not a level): Mod3 + Tab - // Feststelltaste (Capslock): Shift + Shift - // Mod4-Lock: Mod4 + Mod4 - // Mod4-Lock: Shift + Mod3 + Tab - - // Legend - // =============== - // Levels in Xkbmap jargon to be found here in the definitions. - // These are the levels used, and Xorg's translations: - // -------------------------------------------------------------- - // Xorg: Level1 Level2 Level3 Level4 Level5 Level6 Level7 Level8 - // Neo: Ebene1 Ebene2 Ebene3 Ebene5 Ebene4 Pseudo-Ebene Ebene6 ??? - // Keys (Neo): None Shift Mod3 Mod3 + Shift Mod4 Mod4 + Shift Mod3 + Mod4 Mod3 + Mod4 + Shift - - - // Alphanumeric-keys - // =============== - key.type[Group1] = "EIGHT_LEVEL"; - - // Tab as Multi_key (Compose) - // -------------------------------------------------------------- - key { [ Tab, ISO_Left_Tab, Multi_key, ISO_Level5_Lock, NoSymbol, NoSymbol, NoSymbol, ISO_Level5_Lock ] }; - - - // Number row - // -------------------------------------------------------------- - key { [ dead_circumflex, dead_caron, U21BB, U02DE, dead_abovedot, Pointer_EnableKeys, dead_belowdot, NoSymbol ] }; - - key { [ 1, degree, onesuperior, onesubscript, ordfeminine, NoSymbol, notsign, NoSymbol ] }; - key { [ 2, section, twosuperior, twosubscript, masculine, NoSymbol, logicalor, NoSymbol ] }; - key { [ 3, U2113, threesuperior, threesubscript, numerosign, NoSymbol, logicaland, NoSymbol ] }; - key { [ 4, guillemotright, U203A, femalesymbol, NoSymbol, NoSymbol, U22A5, NoSymbol ] }; - key { [ 5, guillemotleft, U2039, malesymbol, periodcentered, NoSymbol, U2221, NoSymbol ] }; - key { [ 6, dollar, cent, U26A5, sterling, NoSymbol, U2225, NoSymbol ] }; - - key { [ 7, EuroSign, yen, U03F0, currency, NoSymbol, rightarrow, NoSymbol ] }; - key { [ 8, doublelowquotemark, singlelowquotemark, U27E8, Tab, ISO_Left_Tab, U221E, NoSymbol ] }; - key { [ 9, leftdoublequotemark, leftsinglequotemark, U27E9, KP_Divide, KP_Divide, variation, NoSymbol ] }; - key { [ 0, rightdoublequotemark, rightsinglequotemark, zerosubscript, KP_Multiply, KP_Multiply, emptyset, NoSymbol ] }; - - key { [ minus, emdash, NoSymbol, U2011, KP_Subtract, KP_Subtract, hyphen, NoSymbol ] }; - key { [ dead_grave, dead_cedilla, dead_abovering, dead_dasia, dead_diaeresis, NoSymbol, dead_macron, NoSymbol ] }; - - // Top row - // -------------------------------------------------------------- - key.type[Group1] = "EIGHT_LEVEL_SEMIALPHABETIC"; - key { [ x, X, ellipsis, Greek_xi, Prior, Prior, Greek_XI, NoSymbol ] }; - key { [ v, V, underscore, NoSymbol, BackSpace, BackSpace, radical, NoSymbol ] }; - key { [ l, L, bracketleft, Greek_lambda, Up, Up, Greek_LAMBDA, NoSymbol ] }; - key { [ c, C, bracketright, Greek_chi, Delete, Delete, U2102, NoSymbol ] }; - key { [ w, W, asciicircum, Greek_omega, Next, Next, Greek_OMEGA, NoSymbol ] }; - - key { [ k, K, exclam, Greek_kappa, exclamdown, NoSymbol, multiply, NoSymbol ] }; - key { [ h, H, less, Greek_psi, KP_7, KP_7, Greek_PSI, NoSymbol ] }; - key { [ g, G, greater, Greek_gamma, KP_8, KP_8, Greek_GAMMA, NoSymbol ] }; - key { [ f, F, equal, Greek_phi, KP_9, KP_9, Greek_PHI, NoSymbol ] }; - key { [ q, Q, ampersand, U03D5, KP_Add, KP_Add, U211A, NoSymbol ] }; - - key { [ ssharp, U1E9E, U017F, Greek_finalsmallsigma, U2212, NoSymbol, jot, NoSymbol ] }; - - key.type[Group1] = "EIGHT_LEVEL"; - key { [ dead_acute, dead_tilde, dead_stroke, dead_psili, dead_doubleacute, NoSymbol, dead_breve, NoSymbol ] }; - - // Middle row - // -------------------------------------------------------------- - key.type[Group1] = "EIGHT_LEVEL_SEMIALPHABETIC"; - key { [ u, U, backslash, NoSymbol, Home, Home, includedin, NoSymbol ] }; - key { [ i, I, slash, Greek_iota, Left, Left, integral, NoSymbol ] }; - key { [ a, A, braceleft, Greek_alpha, Down, Down, U2200, NoSymbol ] }; - key { [ e, E, braceright, Greek_epsilon, Right, Right, U2203, NoSymbol ] }; - key { [ o, O, asterisk, Greek_omicron, End, End, elementof, NoSymbol ] }; - - key { [ s, S, question, Greek_sigma, questiondown, NoSymbol, Greek_SIGMA, NoSymbol ] }; - key { [ n, N, parenleft, Greek_nu, KP_4, KP_4, U2115, NoSymbol ] }; - key { [ r, R, parenright, Greek_rho, KP_5, KP_5, U211D, NoSymbol ] }; - key { [ t, T, minus, Greek_tau, KP_6, KP_6, partialderivative, NoSymbol ] }; - key { [ d, D, colon, Greek_delta, KP_Separator, comma, Greek_DELTA, NoSymbol ] }; - - key { [ y, Y, at, Greek_upsilon, period, KP_Decimal, nabla, NoSymbol ] }; - - // Bottom row - // -------------------------------------------------------------- - key { [ udiaeresis, Udiaeresis, numbersign, NoSymbol, Escape, Escape, union, NoSymbol ] }; - key { [ odiaeresis, Odiaeresis, dollar, U03F5, Tab, Tab, intersection, NoSymbol ] }; - key { [ adiaeresis, Adiaeresis, bar, Greek_eta, Insert, Insert, U2135, NoSymbol ] }; - key { [ p, P, asciitilde, Greek_pi, Return, Return, Greek_PI, NoSymbol ] }; - key { [ z, Z, grave, Greek_zeta, Undo, Undo, U2124, NoSymbol ] }; - - key { [ b, B, plus, Greek_beta, colon, NoSymbol, U21D0, NoSymbol ] }; - key { [ m, M, percent, Greek_mu, KP_1, KP_1, ifonlyif, NoSymbol ] }; - key.type[Group1] = "EIGHT_LEVEL"; - key { [ comma, endash, quotedbl, U03F1, KP_2, KP_2, U21D2, NoSymbol ] }; - key { [ period, enfilledcircbullet, apostrophe, U03D1, KP_3, KP_3, U21A6, NoSymbol ] }; - key.type[Group1] = "EIGHT_LEVEL_SEMIALPHABETIC"; - key { [ j, J, semicolon, Greek_theta, semicolon, NoSymbol, Greek_THETA, NoSymbol ] }; - key.type[Group1] = "EIGHT_LEVEL"; - - // Space key - // -------------------------------------------------------------- - key { [ space, space, space, nobreakspace, KP_0, KP_0, U202F, NoSymbol ] }; - - - // Keypad-keys - // =============== - - // The former Numlock key: - key { [ Tab, ISO_Left_Tab, equal, approxeq, notequal, Pointer_EnableKeys, identical, NoSymbol ] }; - - // Topmost row - // -------------------------------------------------------------- - key { [ KP_Divide, KP_Divide, division, U2300, U2215, NoSymbol, U2223, NoSymbol ] }; - key { [ KP_Multiply, KP_Multiply, U2219, U2299, multiply, NoSymbol, U2297, NoSymbol ] }; - key { [ KP_Subtract, KP_Subtract, U2212, U2296, U2216, NoSymbol, U2238, NoSymbol ] }; - - // Top row - // -------------------------------------------------------------- - key { [ KP_7, U2714, U2195, U226A, KP_Home, KP_Home, upstile, NoSymbol ] }; - key { [ KP_8, U2718, uparrow, intersection, KP_Up, KP_Up, U22C2, NoSymbol ] }; - key { [ KP_9, dagger, U20D7, U226B, KP_Prior, KP_Prior, U2309, NoSymbol ] }; - key { [ KP_Add, KP_Add, plusminus, U2295, U2213, NoSymbol, U2214, NoSymbol ] }; - - // Middle row - // -------------------------------------------------------------- - key { [ KP_4, club, leftarrow, includedin, KP_Left, KP_Left, U2286, NoSymbol ] }; - key { [ KP_5, EuroSign, colon, U22B6, KP_Begin, KP_Begin, U22B7, NoSymbol ] }; - key { [ KP_6, U2023, rightarrow, includes, KP_Right, KP_Right, U2287, NoSymbol ] }; - - // Bottom row - // -------------------------------------------------------------- - key { [ KP_1, diamond, U2194, lessthanequal, KP_End, KP_End, downstile, NoSymbol ] }; - key { [ KP_2, heart, downarrow, union, KP_Down, KP_Down, U22C3, NoSymbol ] }; - key { [ KP_3, U2660, U21CC, greaterthanequal, KP_Next, KP_Next, U230B, NoSymbol ] }; - key { [ KP_Enter, KP_Enter, KP_Enter, KP_Enter, KP_Enter, KP_Enter, KP_Enter, NoSymbol ] }; - key { [ KP_Equal, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol ] }; - - // Bottommost row - // -------------------------------------------------------------- - key { [ KP_0, U2423, percent, U2030, KP_Insert, KP_Insert, U25A1, NoSymbol ] }; - key { [ KP_Separator, period, comma, minutes, KP_Delete, KP_Delete, seconds, NoSymbol ] }; -}; - -partial alphanumeric_keys modifier_keys keypad_keys -xkb_symbols "neo" { - - include "de(neo_base)" - - name[Group1]= "Germany - Neo 2"; - - include "shift(both_capslock)" - include "level3(caps_switch)" - include "level3(bksl_switch)" - include "level5(lsgt_switch)" - include "level5(ralt_switch)" -}; - -// Copied from macintosh_vndr/de -// olh@suse.de very close to MacOS map - -partial alphanumeric_keys -xkb_symbols "mac" { - - include "de" - name[Group1]= "Germany - Macintosh"; - - // Alphanumeric section - key { [ 1, exclam, exclamdown, at ] }; - key { [ 5, percent, bracketleft ] }; - key { [ 6, ampersand, bracketright ] }; - key { [ 7, slash, bar, backslash ] }; - key { [ 8, parenleft, braceleft, asciitilde ] }; - key { [ 9, parenright, braceright ] }; - key { [ q, Q, guillemotleft, guillemotright ] }; - key { [ r, R, registered ] }; - key { [ u, U, diaeresis, Aacute ] }; - key { [ i, I, slash, Ucircumflex ] }; - key { [ udiaeresis, Udiaeresis, periodcentered, degree ] }; - key { [ plus, asterisk, asciitilde ] }; - key { [ a, A, aring, Aring ] }; - key { [ g, G, copyright ] }; - key { [ h, H, ordfeminine ] }; - key { [ l, L, at ] }; - key { [ odiaeresis, Odiaeresis, dead_acute ] }; - key { [ n, N, asciitilde ] }; - -}; - -partial alphanumeric_keys -xkb_symbols "mac_nodeadkeys" { - // modify the standard German mac layout to not have any dead keys - include "de(mac)" - name[Group1]= "Germany - Macintosh, eliminate dead keys"; - key { [ 4, dollar, onequarter, currency ] }; - - key { [ asciicircum, degree, notsign ] }; - key { [ acute, grave, cedilla ] }; - key { [ udiaeresis, Udiaeresis, diaeresis ] }; - key { [ plus, asterisk, asciitilde, macron ] }; - key { [ odiaeresis, Odiaeresis, acute ] }; - key { [ adiaeresis, Adiaeresis, asciicircum ] }; - - key { [ numbersign, apostrophe, grave ] }; -}; - -partial alphanumeric_keys -xkb_symbols "dsb" -{ - name[Group1] = "Germany - Lower Sorbian"; - include "latin(basic)" - include "level3(ralt_switch)" - include "kpdl(comma)" - key { [ z, Z, zcaron, Zcaron ] }; - key { [ x, X, zacute, Zacute ] }; - key { [ c, C, cacute, Cacute ] }; - key { [ v, V, ccaron, Ccaron ] }; - key { [ n, N, nacute, Nacute ] }; - key { [ s, S, sacute, Sacute ] }; - key { [ d, D, scaron, Scaron ] }; - key { [ f, F ] }; - key { [ q, Q ] }; - key { [ w, W ] }; - key { [ e, E, ecaron, Ecaron ] }; - key { [ r, R, racute, Racute ] }; - key { [ t, T, U20B5, EuroSign ] }; - key { [ o, O, oacute, Oacute ] }; -}; - -partial alphanumeric_keys -xkb_symbols "dsb_qwertz" -{ - name[Group1] = "Germany - Lower Sorbian (qwertz)"; - include "latin(basic)" - include "level3(ralt_switch)" - include "kpdl(comma)" - key { [ y, Y ] }; - key { [ x, X ] }; - key { [ c, C, cacute, Cacute ] }; - key { [ v, V, ccaron, Ccaron ] }; - key { [ n, N, nacute, Nacute ] }; - key { [ s, S, sacute, Sacute ] }; - key { [ d, D, scaron, Scaron ] }; - key { [ f, F ] }; - key { [ q, Q ] }; - key { [ w, W ] }; - key { [ e, E, ecaron, Ecaron ] }; - key { [ r, R, racute, Racute ] }; - key { [ t, T, U20B5, EuroSign ] }; - key { [ z, Z, zcaron, Zcaron ] }; - key { [ u, U, zacute, Zacute ] }; - key { [ o, O, oacute, Oacute ] }; -}; - -partial alphanumeric_keys -xkb_symbols "qwerty" { - - // This layout should work exactly as a de with the exception - // of 'Z' and 'Y' keys, which are in the qwerty style (ie. swapped). - // 2008 by Matej Košík - - include "de(basic)" - - name[Group1] = "Germany - qwerty"; - - key { [ z, Z, leftarrow, yen ] }; - key { [ y, Y, guillemotleft, less ] }; -}; - -// layout for Russian letters on an german keyboard -// based on US-RU layout by Ivan Popov 2005-07-17 -// adopted for german layout by Alexey Fisher 2010-08-19 - -partial alphanumeric_keys -xkb_symbols "ru" { - - include "de(basic)" - - name[Group1]= "Germany - Russian phonetic"; - -key.type[group1]="FOUR_LEVEL_ALPHABETIC"; - - key { [ Cyrillic_a, Cyrillic_A ] }; - key { [ Cyrillic_be, Cyrillic_BE ] }; - key { [ Cyrillic_ve, Cyrillic_VE ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key { [ Cyrillic_de, Cyrillic_DE ] }; - key { [ Cyrillic_ie, Cyrillic_IE ] }; - key { [ Cyrillic_io, Cyrillic_IO, asciitilde ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ Cyrillic_ze, Cyrillic_ZE ] }; - key { [ Cyrillic_i, Cyrillic_I ] }; - key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; - key { [ Cyrillic_ka, Cyrillic_KA ] }; - key { [ Cyrillic_el, Cyrillic_EL ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; - key { [ Cyrillic_en, Cyrillic_EN ] }; - key { [ Cyrillic_o, Cyrillic_O ] }; - key { [ Cyrillic_pe, Cyrillic_PE ] }; - key { [ Cyrillic_er, Cyrillic_ER ] }; - key { [ Cyrillic_es, Cyrillic_ES ] }; - key { [ Cyrillic_te, Cyrillic_TE ] }; - key { [ Cyrillic_u, Cyrillic_U ] }; - key { [ Cyrillic_ef, Cyrillic_EF ] }; - key { [ Cyrillic_ha, Cyrillic_HA ] }; - key { [ Cyrillic_tse, Cyrillic_TSE ] }; - key { [ Cyrillic_che, Cyrillic_CHE ] }; - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Cyrillic_shcha, Cyrillic_SHCHA, plus, asterisk ] }; - key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; - key { [ Cyrillic_yeru, Cyrillic_YERU ] }; - key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_e, Cyrillic_E ] }; - key { [ Cyrillic_yu, Cyrillic_YU, numbersign, apostrophe ] }; - key { [ Cyrillic_ya, Cyrillic_YA ] }; - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "htcdream" { - include "inet(htcdream)" - - name[Group1]= "Germany - htcdream"; - - //second row - key { [ q, Q, Tab, Tab ] }; - key { [ w, W, grave, grave ] }; - key { [ e, E, EuroSign, EuroSign ] }; - key { [ r, R, underscore, underscore ] }; - key { [ t, T, sterling, sterling] }; - key { [ z, Z, division, division ] }; - key { [ u, U, udiaeresis, udiaeresis ] }; - key { [ i, I, minus, minus ] }; - key { [ o, O, odiaeresis, odiaeresis ] }; - key { [ p, P, equal, equal ] }; - - //third row - key { [ a, A, adiaeresis, adiaeresis ] }; - key { [ s, S, ssharp, ssharp] }; - key { [ d ,D, backslash, backslash ] }; - key { [ f, F, braceleft, braceleft ] }; - key { [ g, G, braceright, braceright ] }; - key { [ h, H, multiply, multiply ] }; - key { [ j, J, colon, colon ] }; - key { [ k, K, plus, plus ] }; - key { [ l, L, apostrophe, apostrophe ] }; - - //forth row - key { [ y, Y, bar, bar ] }; - key { [ x, X, bracketleft, bracketleft ] }; - key { [ c, C, bracketright, bracketright ] }; - key { [ v, V, less, less ] }; - key { [ b, B, greater, greater ] }; - key { [ n, N, semicolon, semicolon ] }; - key { [ m, M, quotedbl, quotedbl ] }; - key { [ comma, comma, question, question ] }; - - //fifth row - key { [ at, at, asciitilde, asciitilde ] }; - - include "level3(alt_switch)" -}; +// based on a keyboard map from an 'xkb/symbols/de' file + +default +xkb_symbols "basic" { + + include "latin(type4)" + + name[Group1]="Germany"; + + key { [ 2, quotedbl, twosuperior, oneeighth ] }; + key { [ 3, section, threesuperior, sterling ] }; + key { [ 4, dollar, onequarter, currency ] }; + + key {type[Group1]="FOUR_LEVEL_PLUS_LOCK", symbols[Group1]= + [ssharp, question, backslash, questiondown, 0x1001E9E ]}; +// The unicode capital letter sharp s U+1E9E is transformed to "SS" +// to match the rules for capitalizing sharp s in german. +// If the capital sharp s is needed, delete the line +// starting with from /usr/share/X11/locale/iso8859-15/Compose. +// If both doubled S and capital sharp s are needed, use 0x1001E9E +// for capital sharp s and some free unicode codepoint like 0x1001E9C +// for doubled S. Don`t forget to change this in the Compose file, too. + + key { [dead_acute, dead_grave, dead_cedilla, dead_ogonek ] }; + + key { [ e, E, EuroSign, EuroSign ] }; + key { [ z, Z, leftarrow, yen ] }; + key { [udiaeresis, Udiaeresis, dead_diaeresis, dead_abovering ] }; + key { [ plus, asterisk, dead_tilde, dead_macron ] }; + + key { [ s, S, U017F, U1E9E ] }; + key { [ j, J, dead_belowdot, dead_abovedot ] }; + key { [odiaeresis, Odiaeresis, dead_doubleacute, dead_belowdot ] }; + key { [adiaeresis, Adiaeresis, dead_circumflex, dead_caron ] }; + key { [dead_circumflex, degree, U2032, U2033 ] }; + + key { [numbersign, apostrophe, rightsinglequotemark, dead_breve ] }; + key { [ y, Y, guillemotright, U203A ] }; + key { [ x, X, guillemotleft, U2039 ] }; + key { [ v, V, doublelowquotemark, singlelowquotemark ] }; + key { [ b, B, leftdoublequotemark, leftsinglequotemark ] }; + key { [ n, N, rightdoublequotemark, rightsinglequotemark ] }; + key { [ comma, semicolon, periodcentered, multiply ] }; + key { [ period, colon, U2026, division ] }; + key { [ minus, underscore, endash, emdash ] }; + + include "kpdl(comma)" + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "nodeadkeys" { + + // modify the basic German layout to not have any dead keys + + include "de(basic)" + name[Group1]="Germany - Eliminate dead keys"; + + key { [asciicircum, degree, notsign, notsign ] }; + key { [ acute, grave, cedilla, cedilla ] }; + key { [udiaeresis, Udiaeresis, diaeresis, diaeresis ] }; + key { [ plus, asterisk, asciitilde, macron ] }; + key { [odiaeresis, Odiaeresis, doubleacute, doubleacute ] }; + key { [adiaeresis, Adiaeresis, asciicircum, asciicircum ] }; + key { [numbersign, apostrophe, grave, grave ] }; + key { [ minus, underscore, dead_belowdot, abovedot ] }; +}; + +partial alphanumeric_keys +xkb_symbols "deadgraveacute" { + // modify the basic German layout to have only acute and grave + // as dead keys (tilde and circumflex are needed as spacing characters + // in many programming languages) + + include "de(basic)" + name[Group1]="Germany - Dead grave acute"; + + key { [asciicircum, degree, notsign, notsign ] }; + key { [ plus, asterisk, asciitilde, dead_macron ] }; + key { [numbersign, apostrophe, grave, grave ] }; +}; + +partial alphanumeric_keys +xkb_symbols "deadacute" { + // modify the basic German layout to have only acute as + // dead keys (ASCII grave, tilde and circumflex are needed as + // spacing characters in many programming languages and text formatters) + + include "de(deadgraveacute)" + + name[Group1]="Germany - Dead acute"; + + key { [dead_acute, grave, dead_cedilla, dead_ogonek ] }; + key { [numbersign, apostrophe, dead_grave, dead_grave ] }; +}; + +partial alphanumeric_keys +xkb_symbols "ro" { + // add romanian-specific letters to the basic German layout. + // Romanian symbols are accessible with combination of and + // 'a', 's', 't', 'i', 'ä (ä)' (+ for capital letters). + // To view romanian-specific symbols, add "export LC_CTYPE=ro_RO" + // or "export LC_CTYPE=de_DE.utf8" to your .profile. + + include "de(basic)" + + name[Group1]="Germany - Romanian keyboard with German letters"; + + key { [ t, T, tcedilla, Tcedilla ] }; + key { [ i, I, icircumflex, Icircumflex ] }; + key { [ a, A, acircumflex, Acircumflex ] }; + key { [ s, S, scedilla, Scedilla ] }; + key { [ adiaeresis, Adiaeresis, abreve, Abreve ] }; +}; + +partial alphanumeric_keys +xkb_symbols "ro_nodeadkeys" { + // add romanian-specific letters to the German nodeadkeys layout. + // Read the comment for de_ro ! + + include "de(nodeadkeys)" + name[Group1]="Germany - Romanian keyboard with German letters, eliminate dead keys"; + + key { [ t, T, tcedilla, Tcedilla ] }; + key { [ i, I, icircumflex, Icircumflex ] }; + key { [ a, A, acircumflex, Acircumflex ] }; + key { [ s, S, scedilla, Scedilla ] }; + key { [ adiaeresis, Adiaeresis, abreve, Abreve ] }; +}; + +// German Dvorak keymap by Thorsten Staerk (www.staerk.de/thorsten) +// Have acute and grave as dead keys, tilde and circumflex alive as they are needed +// in many programming languages. +// to use this keymap, use a 105-key-keyboard and the command setxkbmap -model pc105 -layout dvorak -variant de +// source: http://www-lehre.informatik.uni-osnabrueck.de/~rfreund/dvorak.php +partial alphanumeric_keys +xkb_symbols "dvorak" { + include "us(dvorak)" + + name[Group1]="Germany - Dvorak"; + + key { [ asciicircum, degree ] }; + + key { [ 1, exclam, onesuperior ] }; + key { [ 2, quotedbl, twosuperior ] }; + key { [ 3, section, threesuperior ] }; + key { [ 4, dollar, bar ] }; + key { [ 5, percent, bar ] }; + key { [ 6, ampersand, brokenbar ] }; + key { [ 7, slash, braceleft ] }; + key { [ 8, parenleft, bracketleft ] }; + key { [ 9, parenright, bracketright ] }; + key { [ 0, equal, braceright ] }; + key { [ plus, asterisk, asciitilde ] }; + key { [ less, greater, dead_grave ] }; + + key { [ udiaeresis, Udiaeresis, at ] }; + key { [ comma, semicolon, dead_diaeresis ] }; + key { [ period, colon ] }; + key { [ c, C, copyright, Cacute ] }; + key { [ t, T, trademark ] }; + key { [ z, Z, zabovedot, Zabovedot ] }; + key { [ question, ssharp ] }; + key { [ slash, backslash, dead_acute ] }; + + key { [ a, A, at, aogonek ] }; + key { [ o, O, oacute, Oacute ] }; + key { [ e, E, EuroSign, eogonek ] }; + key { [ i, I ] }; + key { [ u, U ] }; + key { [ h, H ] }; + key { [ d, D ] }; + key { [ r, R, registered ] }; + key { [ n, N, nacute, Nacute ] }; + key { [ s, S, sacute, Sacute] }; + key { [ l, L, lstroke, Lstroke ] }; + + key { [ odiaeresis, Odiaeresis ] }; + key { [ q, Q, at ] }; + key { [ m, M, mu ] }; + key { [ numbersign, apostrophe ] }; + + key { [ minus, underscore, hyphen, diaeresis] }; + + key { [ adiaeresis, Adiaeresis, bar ] }; + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "Sundeadkeys" { + + // For naming consistency + + include "de(basic)" + +}; + +partial alphanumeric_keys +xkb_symbols "sundeadkeys" { + + // For naming consistency + + include "de(Sundeadkeys)" + + name[Group1]="Germany - Sun dead keys"; +}; + + +// German Neo-Layout Version 2 +// adopted 2004 by Hanno Behrens +// inspired by Dvorak/de-ergo http://www.goebel-consult.de/de-ergo/ +// +// Authors: +// Stephan Hilb +// +// Benjamin Kellermann +// Erik Streb +// and many other contributors +// +// http://www.neo-layout.org +// +// $Revision$, $Date$ + +partial alphanumeric_keys modifier_keys keypad_keys +xkb_symbols "neo_base" { + + // Levels in Neo jargon + // -------------------------------------------------------------- + // Ebene 1: normal + // Ebene 2: Shift + // Ebene 3: Mod3 + // Ebene 4: Mod4 (for marking something use Shift + Mod4) + // Ebene 5: Shift + Mod3 + // Ebene 6: Mod3 + Mod4 + // Compose (not a level): Mod3 + Tab + // Feststelltaste (Capslock): Shift + Shift + // Mod4-Lock: Mod4 + Mod4 + // Mod4-Lock: Shift + Mod3 + Tab + + // Legend + // =============== + // Levels in Xkbmap jargon to be found here in the definitions. + // These are the levels used, and Xorg's translations: + // -------------------------------------------------------------- + // Xorg: Level1 Level2 Level3 Level4 Level5 Level6 Level7 Level8 + // Neo: Ebene1 Ebene2 Ebene3 Ebene5 Ebene4 Pseudo-Ebene Ebene6 ??? + // Keys (Neo): None Shift Mod3 Mod3 + Shift Mod4 Mod4 + Shift Mod3 + Mod4 Mod3 + Mod4 + Shift + + + // Alphanumeric-keys + // =============== + key.type[Group1] = "EIGHT_LEVEL"; + + // Tab as Multi_key (Compose) + // -------------------------------------------------------------- + key { [ Tab, ISO_Left_Tab, Multi_key, ISO_Level5_Lock, NoSymbol, NoSymbol, NoSymbol, ISO_Level5_Lock ] }; + + + // Number row + // -------------------------------------------------------------- + key { [ dead_circumflex, dead_caron, U21BB, U02DE, dead_abovedot, Pointer_EnableKeys, dead_belowdot, NoSymbol ] }; + + key { [ 1, degree, onesuperior, onesubscript, ordfeminine, NoSymbol, notsign, NoSymbol ] }; + key { [ 2, section, twosuperior, twosubscript, masculine, NoSymbol, logicalor, NoSymbol ] }; + key { [ 3, U2113, threesuperior, threesubscript, numerosign, NoSymbol, logicaland, NoSymbol ] }; + key { [ 4, guillemotright, U203A, femalesymbol, NoSymbol, NoSymbol, U22A5, NoSymbol ] }; + key { [ 5, guillemotleft, U2039, malesymbol, periodcentered, NoSymbol, U2221, NoSymbol ] }; + key { [ 6, dollar, cent, U26A5, sterling, NoSymbol, U2225, NoSymbol ] }; + + key { [ 7, EuroSign, yen, U03F0, currency, NoSymbol, rightarrow, NoSymbol ] }; + key { [ 8, doublelowquotemark, singlelowquotemark, U27E8, Tab, ISO_Left_Tab, U221E, NoSymbol ] }; + key { [ 9, leftdoublequotemark, leftsinglequotemark, U27E9, KP_Divide, KP_Divide, variation, NoSymbol ] }; + key { [ 0, rightdoublequotemark, rightsinglequotemark, zerosubscript, KP_Multiply, KP_Multiply, emptyset, NoSymbol ] }; + + key { [ minus, emdash, NoSymbol, U2011, KP_Subtract, KP_Subtract, hyphen, NoSymbol ] }; + key { [ dead_grave, dead_cedilla, dead_abovering, dead_dasia, dead_diaeresis, NoSymbol, dead_macron, NoSymbol ] }; + + // Top row + // -------------------------------------------------------------- + key.type[Group1] = "EIGHT_LEVEL_SEMIALPHABETIC"; + key { [ x, X, ellipsis, Greek_xi, Prior, Prior, Greek_XI, NoSymbol ] }; + key { [ v, V, underscore, NoSymbol, BackSpace, BackSpace, radical, NoSymbol ] }; + key { [ l, L, bracketleft, Greek_lambda, Up, Up, Greek_LAMBDA, NoSymbol ] }; + key { [ c, C, bracketright, Greek_chi, Delete, Delete, U2102, NoSymbol ] }; + key { [ w, W, asciicircum, Greek_omega, Next, Next, Greek_OMEGA, NoSymbol ] }; + + key { [ k, K, exclam, Greek_kappa, exclamdown, NoSymbol, multiply, NoSymbol ] }; + key { [ h, H, less, Greek_psi, KP_7, KP_7, Greek_PSI, NoSymbol ] }; + key { [ g, G, greater, Greek_gamma, KP_8, KP_8, Greek_GAMMA, NoSymbol ] }; + key { [ f, F, equal, Greek_phi, KP_9, KP_9, Greek_PHI, NoSymbol ] }; + key { [ q, Q, ampersand, U03D5, KP_Add, KP_Add, U211A, NoSymbol ] }; + + key { [ ssharp, U1E9E, U017F, Greek_finalsmallsigma, U2212, NoSymbol, jot, NoSymbol ] }; + + key.type[Group1] = "EIGHT_LEVEL"; + key { [ dead_acute, dead_tilde, dead_stroke, dead_psili, dead_doubleacute, NoSymbol, dead_breve, NoSymbol ] }; + + // Middle row + // -------------------------------------------------------------- + key.type[Group1] = "EIGHT_LEVEL_SEMIALPHABETIC"; + key { [ u, U, backslash, NoSymbol, Home, Home, includedin, NoSymbol ] }; + key { [ i, I, slash, Greek_iota, Left, Left, integral, NoSymbol ] }; + key { [ a, A, braceleft, Greek_alpha, Down, Down, U2200, NoSymbol ] }; + key { [ e, E, braceright, Greek_epsilon, Right, Right, U2203, NoSymbol ] }; + key { [ o, O, asterisk, Greek_omicron, End, End, elementof, NoSymbol ] }; + + key { [ s, S, question, Greek_sigma, questiondown, NoSymbol, Greek_SIGMA, NoSymbol ] }; + key { [ n, N, parenleft, Greek_nu, KP_4, KP_4, U2115, NoSymbol ] }; + key { [ r, R, parenright, Greek_rho, KP_5, KP_5, U211D, NoSymbol ] }; + key { [ t, T, minus, Greek_tau, KP_6, KP_6, partialderivative, NoSymbol ] }; + key { [ d, D, colon, Greek_delta, KP_Separator, comma, Greek_DELTA, NoSymbol ] }; + + key { [ y, Y, at, Greek_upsilon, period, KP_Decimal, nabla, NoSymbol ] }; + + // Bottom row + // -------------------------------------------------------------- + key { [ udiaeresis, Udiaeresis, numbersign, NoSymbol, Escape, Escape, union, NoSymbol ] }; + key { [ odiaeresis, Odiaeresis, dollar, U03F5, Tab, Tab, intersection, NoSymbol ] }; + key { [ adiaeresis, Adiaeresis, bar, Greek_eta, Insert, Insert, U2135, NoSymbol ] }; + key { [ p, P, asciitilde, Greek_pi, Return, Return, Greek_PI, NoSymbol ] }; + key { [ z, Z, grave, Greek_zeta, Undo, Undo, U2124, NoSymbol ] }; + + key { [ b, B, plus, Greek_beta, colon, NoSymbol, U21D0, NoSymbol ] }; + key { [ m, M, percent, Greek_mu, KP_1, KP_1, ifonlyif, NoSymbol ] }; + key.type[Group1] = "EIGHT_LEVEL"; + key { [ comma, endash, quotedbl, U03F1, KP_2, KP_2, U21D2, NoSymbol ] }; + key { [ period, enfilledcircbullet, apostrophe, U03D1, KP_3, KP_3, U21A6, NoSymbol ] }; + key.type[Group1] = "EIGHT_LEVEL_SEMIALPHABETIC"; + key { [ j, J, semicolon, Greek_theta, semicolon, NoSymbol, Greek_THETA, NoSymbol ] }; + key.type[Group1] = "EIGHT_LEVEL"; + + // Space key + // -------------------------------------------------------------- + key { [ space, space, space, nobreakspace, KP_0, KP_0, U202F, NoSymbol ] }; + + + // Keypad-keys + // =============== + + // The former Numlock key: + key { [ Tab, ISO_Left_Tab, equal, approxeq, notequal, Pointer_EnableKeys, identical, NoSymbol ] }; + + // Topmost row + // -------------------------------------------------------------- + key { [ KP_Divide, KP_Divide, division, U2300, U2215, NoSymbol, U2223, NoSymbol ] }; + key { [ KP_Multiply, KP_Multiply, U2219, U2299, multiply, NoSymbol, U2297, NoSymbol ] }; + key { [ KP_Subtract, KP_Subtract, U2212, U2296, U2216, NoSymbol, U2238, NoSymbol ] }; + + // Top row + // -------------------------------------------------------------- + key { [ KP_7, U2714, U2195, U226A, KP_Home, KP_Home, upstile, NoSymbol ] }; + key { [ KP_8, U2718, uparrow, intersection, KP_Up, KP_Up, U22C2, NoSymbol ] }; + key { [ KP_9, dagger, U20D7, U226B, KP_Prior, KP_Prior, U2309, NoSymbol ] }; + key { [ KP_Add, KP_Add, plusminus, U2295, U2213, NoSymbol, U2214, NoSymbol ] }; + + // Middle row + // -------------------------------------------------------------- + key { [ KP_4, club, leftarrow, includedin, KP_Left, KP_Left, U2286, NoSymbol ] }; + key { [ KP_5, EuroSign, colon, U22B6, KP_Begin, KP_Begin, U22B7, NoSymbol ] }; + key { [ KP_6, U2023, rightarrow, includes, KP_Right, KP_Right, U2287, NoSymbol ] }; + + // Bottom row + // -------------------------------------------------------------- + key { [ KP_1, diamond, U2194, lessthanequal, KP_End, KP_End, downstile, NoSymbol ] }; + key { [ KP_2, heart, downarrow, union, KP_Down, KP_Down, U22C3, NoSymbol ] }; + key { [ KP_3, U2660, U21CC, greaterthanequal, KP_Next, KP_Next, U230B, NoSymbol ] }; + key { [ KP_Enter, KP_Enter, KP_Enter, KP_Enter, KP_Enter, KP_Enter, KP_Enter, NoSymbol ] }; + key { [ KP_Equal, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol, NoSymbol ] }; + + // Bottommost row + // -------------------------------------------------------------- + key { [ KP_0, U2423, percent, U2030, KP_Insert, KP_Insert, U25A1, NoSymbol ] }; + key { [ KP_Separator, period, comma, minutes, KP_Delete, KP_Delete, seconds, NoSymbol ] }; +}; + +partial alphanumeric_keys modifier_keys keypad_keys +xkb_symbols "neo" { + + include "de(neo_base)" + + name[Group1]= "Germany - Neo 2"; + + include "shift(both_capslock)" + include "level3(caps_switch)" + include "level3(bksl_switch)" + include "level5(lsgt_switch)" + include "level5(ralt_switch)" +}; + +// Copied from macintosh_vndr/de +// olh@suse.de very close to MacOS map + +partial alphanumeric_keys +xkb_symbols "mac" { + + include "de" + name[Group1]= "Germany - Macintosh"; + + // Alphanumeric section + key { [ 1, exclam, exclamdown, at ] }; + key { [ 5, percent, bracketleft ] }; + key { [ 6, ampersand, bracketright ] }; + key { [ 7, slash, bar, backslash ] }; + key { [ 8, parenleft, braceleft, asciitilde ] }; + key { [ 9, parenright, braceright ] }; + key { [ q, Q, guillemotleft, guillemotright ] }; + key { [ r, R, registered ] }; + key { [ u, U, diaeresis, Aacute ] }; + key { [ i, I, slash, Ucircumflex ] }; + key { [ udiaeresis, Udiaeresis, periodcentered, degree ] }; + key { [ plus, asterisk, asciitilde ] }; + key { [ a, A, aring, Aring ] }; + key { [ g, G, copyright ] }; + key { [ h, H, ordfeminine ] }; + key { [ l, L, at ] }; + key { [ odiaeresis, Odiaeresis, dead_acute ] }; + key { [ n, N, asciitilde ] }; + +}; + +partial alphanumeric_keys +xkb_symbols "mac_nodeadkeys" { + // modify the standard German mac layout to not have any dead keys + include "de(mac)" + name[Group1]= "Germany - Macintosh, eliminate dead keys"; + key { [ 4, dollar, onequarter, currency ] }; + + key { [ asciicircum, degree, notsign ] }; + key { [ acute, grave, cedilla ] }; + key { [ udiaeresis, Udiaeresis, diaeresis ] }; + key { [ plus, asterisk, asciitilde, macron ] }; + key { [ odiaeresis, Odiaeresis, acute ] }; + key { [ adiaeresis, Adiaeresis, asciicircum ] }; + + key { [ numbersign, apostrophe, grave ] }; +}; + +partial alphanumeric_keys +xkb_symbols "dsb" +{ + name[Group1] = "Germany - Lower Sorbian"; + include "latin(basic)" + include "level3(ralt_switch)" + include "kpdl(comma)" + key { [ z, Z, zcaron, Zcaron ] }; + key { [ x, X, zacute, Zacute ] }; + key { [ c, C, cacute, Cacute ] }; + key { [ v, V, ccaron, Ccaron ] }; + key { [ n, N, nacute, Nacute ] }; + key { [ s, S, sacute, Sacute ] }; + key { [ d, D, scaron, Scaron ] }; + key { [ f, F ] }; + key { [ q, Q ] }; + key { [ w, W ] }; + key { [ e, E, ecaron, Ecaron ] }; + key { [ r, R, racute, Racute ] }; + key { [ t, T, U20B5, EuroSign ] }; + key { [ o, O, oacute, Oacute ] }; +}; + +partial alphanumeric_keys +xkb_symbols "dsb_qwertz" +{ + name[Group1] = "Germany - Lower Sorbian (qwertz)"; + include "latin(basic)" + include "level3(ralt_switch)" + include "kpdl(comma)" + key { [ y, Y ] }; + key { [ x, X ] }; + key { [ c, C, cacute, Cacute ] }; + key { [ v, V, ccaron, Ccaron ] }; + key { [ n, N, nacute, Nacute ] }; + key { [ s, S, sacute, Sacute ] }; + key { [ d, D, scaron, Scaron ] }; + key { [ f, F ] }; + key { [ q, Q ] }; + key { [ w, W ] }; + key { [ e, E, ecaron, Ecaron ] }; + key { [ r, R, racute, Racute ] }; + key { [ t, T, U20B5, EuroSign ] }; + key { [ z, Z, zcaron, Zcaron ] }; + key { [ u, U, zacute, Zacute ] }; + key { [ o, O, oacute, Oacute ] }; +}; + +partial alphanumeric_keys +xkb_symbols "qwerty" { + + // This layout should work exactly as a de with the exception + // of 'Z' and 'Y' keys, which are in the qwerty style (ie. swapped). + // 2008 by Matej Košík + + include "de(basic)" + + name[Group1] = "Germany - qwerty"; + + key { [ z, Z, leftarrow, yen ] }; + key { [ y, Y, guillemotleft, less ] }; +}; + +// layout for Russian letters on an german keyboard +// based on US-RU layout by Ivan Popov 2005-07-17 +// adopted for german layout by Alexey Fisher 2010-08-19 + +partial alphanumeric_keys +xkb_symbols "ru" { + + include "de(basic)" + + name[Group1]= "Germany - Russian phonetic"; + +key.type[group1]="FOUR_LEVEL_ALPHABETIC"; + + key { [ Cyrillic_a, Cyrillic_A ] }; + key { [ Cyrillic_be, Cyrillic_BE ] }; + key { [ Cyrillic_ve, Cyrillic_VE ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; + key { [ Cyrillic_de, Cyrillic_DE ] }; + key { [ Cyrillic_ie, Cyrillic_IE ] }; + key { [ Cyrillic_io, Cyrillic_IO, asciitilde ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ Cyrillic_ze, Cyrillic_ZE ] }; + key { [ Cyrillic_i, Cyrillic_I ] }; + key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; + key { [ Cyrillic_ka, Cyrillic_KA ] }; + key { [ Cyrillic_el, Cyrillic_EL ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; + key { [ Cyrillic_en, Cyrillic_EN ] }; + key { [ Cyrillic_o, Cyrillic_O ] }; + key { [ Cyrillic_pe, Cyrillic_PE ] }; + key { [ Cyrillic_er, Cyrillic_ER ] }; + key { [ Cyrillic_es, Cyrillic_ES ] }; + key { [ Cyrillic_te, Cyrillic_TE ] }; + key { [ Cyrillic_u, Cyrillic_U ] }; + key { [ Cyrillic_ef, Cyrillic_EF ] }; + key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [ Cyrillic_tse, Cyrillic_TSE ] }; + key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Cyrillic_shcha, Cyrillic_SHCHA, plus, asterisk ] }; + key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; + key { [ Cyrillic_yeru, Cyrillic_YERU ] }; + key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_e, Cyrillic_E ] }; + key { [ Cyrillic_yu, Cyrillic_YU, numbersign, apostrophe ] }; + key { [ Cyrillic_ya, Cyrillic_YA ] }; + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "htcdream" { + include "inet(htcdream)" + + name[Group1]= "Germany - htcdream"; + + //second row + key { [ q, Q, Tab, Tab ] }; + key { [ w, W, grave, grave ] }; + key { [ e, E, EuroSign, EuroSign ] }; + key { [ r, R, underscore, underscore ] }; + key { [ t, T, sterling, sterling] }; + key { [ z, Z, division, division ] }; + key { [ u, U, udiaeresis, udiaeresis ] }; + key { [ i, I, minus, minus ] }; + key { [ o, O, odiaeresis, odiaeresis ] }; + key { [ p, P, equal, equal ] }; + + //third row + key { [ a, A, adiaeresis, adiaeresis ] }; + key { [ s, S, ssharp, ssharp] }; + key { [ d ,D, backslash, backslash ] }; + key { [ f, F, braceleft, braceleft ] }; + key { [ g, G, braceright, braceright ] }; + key { [ h, H, multiply, multiply ] }; + key { [ j, J, colon, colon ] }; + key { [ k, K, plus, plus ] }; + key { [ l, L, apostrophe, apostrophe ] }; + + //forth row + key { [ y, Y, bar, bar ] }; + key { [ x, X, bracketleft, bracketleft ] }; + key { [ c, C, bracketright, bracketright ] }; + key { [ v, V, less, less ] }; + key { [ b, B, greater, greater ] }; + key { [ n, N, semicolon, semicolon ] }; + key { [ m, M, quotedbl, quotedbl ] }; + key { [ comma, comma, question, question ] }; + + //fifth row + key { [ at, at, asciitilde, asciitilde ] }; + + include "level3(alt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/digital_vndr/lk b/xorg-server/xkeyboard-config/symbols/digital_vndr/lk index 4d311c7e5..82a8c90c6 100644 --- a/xorg-server/xkeyboard-config/symbols/digital_vndr/lk +++ b/xorg-server/xkeyboard-config/symbols/digital_vndr/lk @@ -1,131 +1,130 @@ -// $Xorg: lk,v 1.3 2000/08/17 19:54:44 cpqbld Exp $ -// -//Copyright (c) 1996 Digital Equipment Corporation -// -//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. -// -// HISTORY -// Log: lk,v -// Revision 1.2 1996/06/18 09:10:09 erik -// use flags correctly, assorted cleanups and consortium fixes -// -// Revision 1.1.2.2 1995/03/10 17:16:52 William_Walker -// Rename to avoid name conflicts with XKB stuff -// [1995/03/10 17:10:33 William_Walker] -// -// Revision 1.1.2.2 1994/10/31 15:22:00 William_Walker -// New experimental version. -// [1994/10/31 14:48:37 William_Walker] -// -// EndLog -// -// @(#)RCSfile: lk,v Revision: 1.2 (DEC) Date: 1996/01/24 12:14:58 -// -// Symbols common to all the LK-style keyboards. -// -default xkb_symbols "common" { - - // Modifier mappings - modifier_map Shift { Shift_L, Shift_R }; - modifier_map Lock { Caps_Lock }; - modifier_map Control { Control_L, Control_R }; - modifier_map Mod1 { Alt_L, Alt_R, Meta_L, Meta_R }; - modifier_map Mod2 { Num_Lock }; - modifier_map Mod3 { Scroll_Lock }; - - // Additional alphanumeric keys - key { [ less, greater ] }; - key { [ Alt_L, Meta_L ] }; - - // "Function" keys - key { [ F1 ] }; - key { [ F2 ] }; - key { [ F3 ] }; - key { [ F4 ] }; - key { [ F5 ] }; - key { [ F6 ] }; - key { [ F7 ] }; - key { [ F8 ] }; - key { [ F9 ] }; - key { [ F10 ] }; - key { [ Escape, F11 ] }; - key { [ F12 ] }; - key { [ F13 ] }; - key { [ F14 ] }; - key { [ F17 ] }; - key { [ F18 ] }; - key { [ F19 ] }; - key { [ F20 ] }; - - // "Editing" keys - key { [ Help ] }; - key { [ Menu ] }; - key { [ Find ] }; - key { [ Insert ] }; - key { [ Delete ] }; - key { [ Select ] }; - key { [ Prior ] }; - key { [ Next ] }; - - key { [ Up ] }; - key { [ Left ] }; - key { [ Down ] }; - key { [ Right ] }; - - // "Keypad" keys - key { - type= "SHIFT+ALT", - symbols[Group1]=[ KP_F1,Pointer_EnableKeys ] - }; - key { [ KP_F2 ] }; - key { [ KP_F3 ] }; - key { [ KP_F4 ] }; - - key { [ KP_Separator ] }; - key { [ KP_Subtract ] }; - - key { [ KP_7 ] }; - key { [ KP_8 ] }; - key { [ KP_9 ] }; - - key { [ KP_4 ] }; - key { [ KP_5 ] }; - key { [ KP_6 ] }; - - key { [ KP_1 ] }; - key { [ KP_2 ] }; - key { [ KP_3 ] }; - key { [ KP_Enter ] }; - - key { [ KP_0 ] }; - key { [ KP_Decimal ] }; -}; - -xkb_symbols "lk401" { - include "symbols/digital_vndr/lk(common)" - key { [ Alt_R, Meta_R ] }; - key { [ Multi_key ] }; - key { [ Multi_key ] }; -}; +// +//Copyright (c) 1996 Digital Equipment Corporation +// +//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. +// +// HISTORY +// Log: lk,v +// Revision 1.2 1996/06/18 09:10:09 erik +// use flags correctly, assorted cleanups and consortium fixes +// +// Revision 1.1.2.2 1995/03/10 17:16:52 William_Walker +// Rename to avoid name conflicts with XKB stuff +// [1995/03/10 17:10:33 William_Walker] +// +// Revision 1.1.2.2 1994/10/31 15:22:00 William_Walker +// New experimental version. +// [1994/10/31 14:48:37 William_Walker] +// +// EndLog +// +// @(#)RCSfile: lk,v Revision: 1.2 (DEC) Date: 1996/01/24 12:14:58 +// +// Symbols common to all the LK-style keyboards. +// +default xkb_symbols "common" { + + // Modifier mappings + modifier_map Shift { Shift_L, Shift_R }; + modifier_map Lock { Caps_Lock }; + modifier_map Control { Control_L, Control_R }; + modifier_map Mod1 { Alt_L, Alt_R, Meta_L, Meta_R }; + modifier_map Mod2 { Num_Lock }; + modifier_map Mod3 { Scroll_Lock }; + + // Additional alphanumeric keys + key { [ less, greater ] }; + key { [ Alt_L, Meta_L ] }; + + // "Function" keys + key { [ F1 ] }; + key { [ F2 ] }; + key { [ F3 ] }; + key { [ F4 ] }; + key { [ F5 ] }; + key { [ F6 ] }; + key { [ F7 ] }; + key { [ F8 ] }; + key { [ F9 ] }; + key { [ F10 ] }; + key { [ Escape, F11 ] }; + key { [ F12 ] }; + key { [ F13 ] }; + key { [ F14 ] }; + key { [ F17 ] }; + key { [ F18 ] }; + key { [ F19 ] }; + key { [ F20 ] }; + + // "Editing" keys + key { [ Help ] }; + key { [ Menu ] }; + key { [ Find ] }; + key { [ Insert ] }; + key { [ Delete ] }; + key { [ Select ] }; + key { [ Prior ] }; + key { [ Next ] }; + + key { [ Up ] }; + key { [ Left ] }; + key { [ Down ] }; + key { [ Right ] }; + + // "Keypad" keys + key { + type= "SHIFT+ALT", + symbols[Group1]=[ KP_F1,Pointer_EnableKeys ] + }; + key { [ KP_F2 ] }; + key { [ KP_F3 ] }; + key { [ KP_F4 ] }; + + key { [ KP_Separator ] }; + key { [ KP_Subtract ] }; + + key { [ KP_7 ] }; + key { [ KP_8 ] }; + key { [ KP_9 ] }; + + key { [ KP_4 ] }; + key { [ KP_5 ] }; + key { [ KP_6 ] }; + + key { [ KP_1 ] }; + key { [ KP_2 ] }; + key { [ KP_3 ] }; + key { [ KP_Enter ] }; + + key { [ KP_0 ] }; + key { [ KP_Decimal ] }; +}; + +xkb_symbols "lk401" { + include "symbols/digital_vndr/lk(common)" + key { [ Alt_R, Meta_R ] }; + key { [ Multi_key ] }; + key { [ Multi_key ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/digital_vndr/pc b/xorg-server/xkeyboard-config/symbols/digital_vndr/pc index b1faec03c..b8d1fb2bb 100644 --- a/xorg-server/xkeyboard-config/symbols/digital_vndr/pc +++ b/xorg-server/xkeyboard-config/symbols/digital_vndr/pc @@ -1,176 +1,175 @@ -// $Xorg: pc,v 1.3 2000/08/17 19:54:44 cpqbld Exp $ -// -//Copyright (c) 1996 Digital Equipment Corporation -// -//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. -// -// HISTORY -// Log -// Revision 1.2 1996/06/18 09:10:12 erik -// use flags correctly, assorted cleanups and consortium fixes -// -// Revision 1.1.6.4 1995/12/19 19:55:58 William_Walker -// Update to XKB 0.65 -// [1995/12/17 02:37:07 William_Walker] -// -// Revision 1.1.6.3 1995/10/25 21:01:09 William_Walker -// Make sure we use DIN 2137 and VT510 Spec for Group Semantics -// [1995/10/23 15:49:03 William_Walker] -// -// Revision 1.1.6.2 1995/08/07 17:40:40 William_Walker -// Upgrade XKB to protocol 0.62 (dual submit from decx11) -// [1995/08/06 14:06:32 William_Walker] -// -// Revision 1.1.2.7 1995/08/05 15:25:57 William_Walker -// Sync up with Erik's pool. -// [1995/08/03 20:17:15 William_Walker] -// -// Revision 1.1.2.6 1995/06/27 12:18:25 William_Walker -// Add LK201 and LK450 support as well as TW and DP variants. -// [1995/06/26 20:29:52 William_Walker] -// -// Revision 1.1.2.5 1995/06/08 17:10:28 William_Walker -// Make RALT default to Mode_switch -// [1995/06/08 17:08:50 William_Walker] -// -// Revision 1.1.2.4 1995/06/05 19:24:14 William_Walker -// New file. I love keymaps. -// [1995/06/05 18:17:03 William_Walker] -// -// EndLog -// -// @(#)RCSfile: pc Revision: /main/4 (DEC) Date: 1996/01/24 12:15:02 -// - -// ************************************************************** -// * * -// * The symbols common to all Extended PC layouts. * -// * * -// ************************************************************** -xkb_symbols "pc" { - - // Modifier mappings - // - modifier_map Shift { Shift_L, Shift_R }; - modifier_map Lock { Caps_Lock }; - modifier_map Control { Control_L, Control_R }; - modifier_map Mod1 { Alt_L, Alt_R, Meta_L, Meta_R }; - modifier_map Mod3 { Mode_switch }; - modifier_map Mod4 { Num_Lock }; - modifier_map Mod5 { Scroll_Lock }; - - // Common keys - // - key { [ BackSpace, Delete ] }; - key { [ Tab, ISO_Left_Tab ] }; - key { [ Caps_Lock ] }; - key { [ Return ] }; - key { [ Shift_L ] }; - key { [ Shift_R ] }; - key { [ Control_L ] }; - key { [ Alt_L, Meta_L ] }; - key { [ space ] }; - key { [ Mode_switch ] }; - key { [ Control_R ] }; - - // "Function" keys - // - key { [ Escape ] }; - key { [ F1 ] }; - key { [ F2 ] }; - key { [ F3 ] }; - key { [ F4 ] }; - key { [ F5 ] }; - key { [ F6 ] }; - key { [ F7 ] }; - key { [ F8 ] }; - key { [ F9 ] }; - key { [ F10 ] }; - key { [ F11 ] }; - key { [ F12 ] }; - key { - type= "PC_ALT_LEVEL2", - symbols[Group1]= [ Print, Sys_Req ] - }; - key { [ Scroll_Lock ] }; - key { - type= "PC_CONTROL_LEVEL2", - symbols[Group1]= [ Pause, Break ] - }; - - // "Editing" keys - // - key { [ Insert ] }; - key { [ Home ] }; - key { [ Prior ] }; - key { [ Delete ] }; - key { [ End ] }; - key { [ Next ] }; - - key { [ Up ] }; - key { [ Left ] }; - key { [ Down ] }; - key { [ Right ] }; - - // "Keypad" keys - // - key { - type= "SHIFT+ALT", - symbols[Group1]= [ Num_Lock,Pointer_EnableKeys] - }; - key { [ KP_Divide ] }; - key { [ KP_Multiply ] }; - key { [ KP_Subtract ] }; - - key { [ KP_Home, KP_7 ] }; - key { [ KP_Up, KP_8 ] }; - key { [ KP_Prior, KP_9 ] }; - key { [ KP_Add ] }; - - key { [ KP_Left, KP_4 ] }; - key { [ KP_5 ] }; - key { [ KP_Right, KP_6 ] }; - - key { [ KP_End, KP_1 ] }; - key { [ KP_Down, KP_2 ] }; - key { [ KP_Next, KP_3 ] }; - key { [ KP_Enter ] }; - - key { [ KP_Insert, KP_0 ] }; - key { [ KP_Delete, KP_Decimal ] }; - - // Key to support Lock-Down Modifier descriptions for R5 - // - key { [ NoSymbol ] }; -}; - -xkb_symbols "pc104" { - include "digital_vndr/pc(pc)" - - replace key { [ Alt_L ] }; - key { [ Meta_L ] }; - key { [ Meta_R ] }; - key { [ Menu ] }; -}; +// +//Copyright (c) 1996 Digital Equipment Corporation +// +//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. +// +// HISTORY +// Log +// Revision 1.2 1996/06/18 09:10:12 erik +// use flags correctly, assorted cleanups and consortium fixes +// +// Revision 1.1.6.4 1995/12/19 19:55:58 William_Walker +// Update to XKB 0.65 +// [1995/12/17 02:37:07 William_Walker] +// +// Revision 1.1.6.3 1995/10/25 21:01:09 William_Walker +// Make sure we use DIN 2137 and VT510 Spec for Group Semantics +// [1995/10/23 15:49:03 William_Walker] +// +// Revision 1.1.6.2 1995/08/07 17:40:40 William_Walker +// Upgrade XKB to protocol 0.62 (dual submit from decx11) +// [1995/08/06 14:06:32 William_Walker] +// +// Revision 1.1.2.7 1995/08/05 15:25:57 William_Walker +// Sync up with Erik's pool. +// [1995/08/03 20:17:15 William_Walker] +// +// Revision 1.1.2.6 1995/06/27 12:18:25 William_Walker +// Add LK201 and LK450 support as well as TW and DP variants. +// [1995/06/26 20:29:52 William_Walker] +// +// Revision 1.1.2.5 1995/06/08 17:10:28 William_Walker +// Make RALT default to Mode_switch +// [1995/06/08 17:08:50 William_Walker] +// +// Revision 1.1.2.4 1995/06/05 19:24:14 William_Walker +// New file. I love keymaps. +// [1995/06/05 18:17:03 William_Walker] +// +// EndLog +// +// @(#)RCSfile: pc Revision: /main/4 (DEC) Date: 1996/01/24 12:15:02 +// + +// ************************************************************** +// * * +// * The symbols common to all Extended PC layouts. * +// * * +// ************************************************************** +xkb_symbols "pc" { + + // Modifier mappings + // + modifier_map Shift { Shift_L, Shift_R }; + modifier_map Lock { Caps_Lock }; + modifier_map Control { Control_L, Control_R }; + modifier_map Mod1 { Alt_L, Alt_R, Meta_L, Meta_R }; + modifier_map Mod3 { Mode_switch }; + modifier_map Mod4 { Num_Lock }; + modifier_map Mod5 { Scroll_Lock }; + + // Common keys + // + key { [ BackSpace, Delete ] }; + key { [ Tab, ISO_Left_Tab ] }; + key { [ Caps_Lock ] }; + key { [ Return ] }; + key { [ Shift_L ] }; + key { [ Shift_R ] }; + key { [ Control_L ] }; + key { [ Alt_L, Meta_L ] }; + key { [ space ] }; + key { [ Mode_switch ] }; + key { [ Control_R ] }; + + // "Function" keys + // + key { [ Escape ] }; + key { [ F1 ] }; + key { [ F2 ] }; + key { [ F3 ] }; + key { [ F4 ] }; + key { [ F5 ] }; + key { [ F6 ] }; + key { [ F7 ] }; + key { [ F8 ] }; + key { [ F9 ] }; + key { [ F10 ] }; + key { [ F11 ] }; + key { [ F12 ] }; + key { + type= "PC_ALT_LEVEL2", + symbols[Group1]= [ Print, Sys_Req ] + }; + key { [ Scroll_Lock ] }; + key { + type= "PC_CONTROL_LEVEL2", + symbols[Group1]= [ Pause, Break ] + }; + + // "Editing" keys + // + key { [ Insert ] }; + key { [ Home ] }; + key { [ Prior ] }; + key { [ Delete ] }; + key { [ End ] }; + key { [ Next ] }; + + key { [ Up ] }; + key { [ Left ] }; + key { [ Down ] }; + key { [ Right ] }; + + // "Keypad" keys + // + key { + type= "SHIFT+ALT", + symbols[Group1]= [ Num_Lock,Pointer_EnableKeys] + }; + key { [ KP_Divide ] }; + key { [ KP_Multiply ] }; + key { [ KP_Subtract ] }; + + key { [ KP_Home, KP_7 ] }; + key { [ KP_Up, KP_8 ] }; + key { [ KP_Prior, KP_9 ] }; + key { [ KP_Add ] }; + + key { [ KP_Left, KP_4 ] }; + key { [ KP_5 ] }; + key { [ KP_Right, KP_6 ] }; + + key { [ KP_End, KP_1 ] }; + key { [ KP_Down, KP_2 ] }; + key { [ KP_Next, KP_3 ] }; + key { [ KP_Enter ] }; + + key { [ KP_Insert, KP_0 ] }; + key { [ KP_Delete, KP_Decimal ] }; + + // Key to support Lock-Down Modifier descriptions for R5 + // + key { [ NoSymbol ] }; +}; + +xkb_symbols "pc104" { + include "digital_vndr/pc(pc)" + + replace key { [ Alt_L ] }; + key { [ Meta_L ] }; + key { [ Meta_R ] }; + key { [ Menu ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/digital_vndr/us b/xorg-server/xkeyboard-config/symbols/digital_vndr/us index 7e1131a63..95d7301e7 100644 --- a/xorg-server/xkeyboard-config/symbols/digital_vndr/us +++ b/xorg-server/xkeyboard-config/symbols/digital_vndr/us @@ -1,212 +1,211 @@ -// $Xorg: us,v 1.3 2000/08/17 19:54:44 cpqbld Exp $ -// -//Copyright (c) 1996 Digital Equipment Corporation -// -//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. -// -// HISTORY -// Log -// Revision 1.2 1996/06/18 09:10:16 erik -// use flags correctly, assorted cleanups and consortium fixes -// -// Revision 1.1.6.3 1995/12/19 19:56:37 William_Walker -// Update to XKB 0.65 -// [1995/12/17 02:37:44 William_Walker] -// -// Revision 1.1.6.2 1995/10/25 21:01:25 William_Walker -// Add pc104-key support -// [1995/10/23 15:46:27 William_Walker] -// -// Revision 1.1.2.7 1995/06/27 12:18:40 William_Walker -// Add LK201 and LK450 support as well as TW and DP variants. -// [1995/06/26 20:30:33 William_Walker] -// -// Revision 1.1.2.6 1995/06/09 20:55:20 William_Walker -// Add VT105 layout support and ISO group support -// [1995/06/09 20:43:05 William_Walker] -// -// Revision 1.1.2.5 1995/06/08 21:05:49 William_Walker -// Use ISO_Next_Group instead of grouplock -// [1995/06/08 21:03:56 William_Walker] -// -// Revision 1.1.2.4 1995/06/05 19:25:00 William_Walker -// New file. I love keymaps. -// [1995/06/05 18:17:54 William_Walker] -// -// EndLog -// -// @(#)RCSfile: us Revision: /main/4 (DEC) Date: 1996/01/24 12:15:05 -// - -// ************************************************************** -// * * -// * Symbols for en_US.ISO8859-1 - English for U.S. * -// * * -// ************************************************************** - -xkb_symbols "us" { - - key { [ grave, asciitilde ] }; - key { [ 1, exclam ] }; - key { [ 2, at ] }; - key { [ 3, numbersign ] }; - key { [ 4, dollar ] }; - key { [ 5, percent ] }; - key { [ 6, asciicircum ] }; - key { [ 7, ampersand ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ minus, underscore ] }; - key { [ equal, plus ] }; - - key { [ q, Q ] }; - key { [ w, W ] }; - key { [ e, E ] }; - key { [ r, R ] }; - key { [ t, T ] }; - key { [ y, Y ] }; - key { [ u, U ] }; - key { [ i, I ] }; - key { [ o, O ] }; - key { [ p, P ] }; - key { [ bracketleft, braceleft ] }; - key { [ bracketright, braceright ] }; - - key { [ a, A ] }; - key { [ s, S ] }; - key { [ d, D ] }; - key { [ f, F ] }; - key { [ g, G ] }; - key { [ h, H ] }; - key { [ j, J ] }; - key { [ k, K ] }; - key { [ l, L ] }; - key { [ semicolon, colon ] }; - key { [ apostrophe, quotedbl ] }; - key { [ backslash, bar ] }; - - key { [ z, Z ] }; - key { [ x, X ] }; - key { [ c, C ] }; - key { [ v, V ] }; - key { [ b, B ] }; - key { [ n, N ] }; - key { [ m, M ] }; - key { [ comma, less ] }; - key { [ period, greater ] }; - key { [ slash, question ] }; -}; - -// ************************************************************** -// * * -// * The VT105 layouts * -// * * -// * NOTES: The typewriter (TW) and dataprocessing (DP) keys * -// * for the VT108 layout are identical for the US. * -// * * -// ************************************************************** -xkb_symbols "vt105-tw" { - include "digital_vndr/us(us)" - include "digital_vndr/vt(vt105)" - override key { - symbols[Group1]= [ 3, numbersign ], - symbols[Group2]= [ sterling ] - }; - key { [ less, greater ] }; -}; - -xkb_symbols "vt105-dp" { include "digital_vndr/us(vt105-tw)" }; -xkb_symbols "vt105" { include "digital_vndr/us(vt105-tw)" }; - -// ************************************************************** -// * * -// * The VT108 layouts - based upon the LK401-AA * -// * * -// * NOTES: The typewriter (TW) and dataprocessing (DP) keys * -// * for the VT108 layout are identical for the US. * -// * * -// ************************************************************** -xkb_symbols "vt108-tw" { - include "digital_vndr/us(us)" - include "digital_vndr/vt(vt108)" - replace key { [ Multi_key ] }; - override key { - symbols[Group1]= [ 3, numbersign ], - symbols[Group2]= [ sterling ] - }; - key { [ less, greater ] }; -}; - -xkb_symbols "vt108-dp" { include "digital_vndr/us(vt108-tw)" }; -xkb_symbols "vt108" { include "digital_vndr/us(vt108-tw)" }; - -// ************************************************************** -// * * -// * The "unix" layouts - based upon the LK421-AA * -// * * -// * NOTES: The "unix" keyboard emits the same keycodes as the * -// * LK401, but is a shorter keyboard that uses an * -// * "extend" key. To make life easier, we map * -// * to Escape so users do not have to press Extend+F11 * -// * to get Escape. * -// * * -// ************************************************************** -xkb_symbols "unix" { - include "digital_vndr/us(vt108)" - override key { [ Escape ] }; - override key { [ grave, asciitilde ] }; -}; - -// ************************************************************** -// * * -// * The "pcxal" layouts * -// * * -// * NOTES: The pcxal layouts are pretty much standardized for * -// * the US and use a 101-key keyboard. * -// * * -// ************************************************************** -xkb_symbols "pcxalga" { - include "digital_vndr/pc(pc)" - include "digital_vndr/us(us)" - replace key { [ Alt_R, Meta_R ] }; -}; - -xkb_symbols "pcxal" { include "digital_vndr/us(pcxalga)" }; -xkb_symbols "pcxalaa" { include "digital_vndr/us(pcxalga)" }; -xkb_symbols "pcxalfa" { include "digital_vndr/us(pcxalga)" }; -xkb_symbols "pcxalka" { include "digital_vndr/us(pcxalga)" }; -xkb_symbols "lk44x" { include "digital_vndr/us(pcxalga)" }; - -// ************************************************************** -// * * -// * The "pc104" layouts. * -// * * -// ************************************************************** -xkb_symbols "pc104" { - include "digital_vndr/pc(pc104)" - include "digital_vndr/us(us)" - replace key { [ Alt_R ] }; -}; +// +//Copyright (c) 1996 Digital Equipment Corporation +// +//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. +// +// HISTORY +// Log +// Revision 1.2 1996/06/18 09:10:16 erik +// use flags correctly, assorted cleanups and consortium fixes +// +// Revision 1.1.6.3 1995/12/19 19:56:37 William_Walker +// Update to XKB 0.65 +// [1995/12/17 02:37:44 William_Walker] +// +// Revision 1.1.6.2 1995/10/25 21:01:25 William_Walker +// Add pc104-key support +// [1995/10/23 15:46:27 William_Walker] +// +// Revision 1.1.2.7 1995/06/27 12:18:40 William_Walker +// Add LK201 and LK450 support as well as TW and DP variants. +// [1995/06/26 20:30:33 William_Walker] +// +// Revision 1.1.2.6 1995/06/09 20:55:20 William_Walker +// Add VT105 layout support and ISO group support +// [1995/06/09 20:43:05 William_Walker] +// +// Revision 1.1.2.5 1995/06/08 21:05:49 William_Walker +// Use ISO_Next_Group instead of grouplock +// [1995/06/08 21:03:56 William_Walker] +// +// Revision 1.1.2.4 1995/06/05 19:25:00 William_Walker +// New file. I love keymaps. +// [1995/06/05 18:17:54 William_Walker] +// +// EndLog +// +// @(#)RCSfile: us Revision: /main/4 (DEC) Date: 1996/01/24 12:15:05 +// + +// ************************************************************** +// * * +// * Symbols for en_US.ISO8859-1 - English for U.S. * +// * * +// ************************************************************** + +xkb_symbols "us" { + + key { [ grave, asciitilde ] }; + key { [ 1, exclam ] }; + key { [ 2, at ] }; + key { [ 3, numbersign ] }; + key { [ 4, dollar ] }; + key { [ 5, percent ] }; + key { [ 6, asciicircum ] }; + key { [ 7, ampersand ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ minus, underscore ] }; + key { [ equal, plus ] }; + + key { [ q, Q ] }; + key { [ w, W ] }; + key { [ e, E ] }; + key { [ r, R ] }; + key { [ t, T ] }; + key { [ y, Y ] }; + key { [ u, U ] }; + key { [ i, I ] }; + key { [ o, O ] }; + key { [ p, P ] }; + key { [ bracketleft, braceleft ] }; + key { [ bracketright, braceright ] }; + + key { [ a, A ] }; + key { [ s, S ] }; + key { [ d, D ] }; + key { [ f, F ] }; + key { [ g, G ] }; + key { [ h, H ] }; + key { [ j, J ] }; + key { [ k, K ] }; + key { [ l, L ] }; + key { [ semicolon, colon ] }; + key { [ apostrophe, quotedbl ] }; + key { [ backslash, bar ] }; + + key { [ z, Z ] }; + key { [ x, X ] }; + key { [ c, C ] }; + key { [ v, V ] }; + key { [ b, B ] }; + key { [ n, N ] }; + key { [ m, M ] }; + key { [ comma, less ] }; + key { [ period, greater ] }; + key { [ slash, question ] }; +}; + +// ************************************************************** +// * * +// * The VT105 layouts * +// * * +// * NOTES: The typewriter (TW) and dataprocessing (DP) keys * +// * for the VT108 layout are identical for the US. * +// * * +// ************************************************************** +xkb_symbols "vt105-tw" { + include "digital_vndr/us(us)" + include "digital_vndr/vt(vt105)" + override key { + symbols[Group1]= [ 3, numbersign ], + symbols[Group2]= [ sterling ] + }; + key { [ less, greater ] }; +}; + +xkb_symbols "vt105-dp" { include "digital_vndr/us(vt105-tw)" }; +xkb_symbols "vt105" { include "digital_vndr/us(vt105-tw)" }; + +// ************************************************************** +// * * +// * The VT108 layouts - based upon the LK401-AA * +// * * +// * NOTES: The typewriter (TW) and dataprocessing (DP) keys * +// * for the VT108 layout are identical for the US. * +// * * +// ************************************************************** +xkb_symbols "vt108-tw" { + include "digital_vndr/us(us)" + include "digital_vndr/vt(vt108)" + replace key { [ Multi_key ] }; + override key { + symbols[Group1]= [ 3, numbersign ], + symbols[Group2]= [ sterling ] + }; + key { [ less, greater ] }; +}; + +xkb_symbols "vt108-dp" { include "digital_vndr/us(vt108-tw)" }; +xkb_symbols "vt108" { include "digital_vndr/us(vt108-tw)" }; + +// ************************************************************** +// * * +// * The "unix" layouts - based upon the LK421-AA * +// * * +// * NOTES: The "unix" keyboard emits the same keycodes as the * +// * LK401, but is a shorter keyboard that uses an * +// * "extend" key. To make life easier, we map * +// * to Escape so users do not have to press Extend+F11 * +// * to get Escape. * +// * * +// ************************************************************** +xkb_symbols "unix" { + include "digital_vndr/us(vt108)" + override key { [ Escape ] }; + override key { [ grave, asciitilde ] }; +}; + +// ************************************************************** +// * * +// * The "pcxal" layouts * +// * * +// * NOTES: The pcxal layouts are pretty much standardized for * +// * the US and use a 101-key keyboard. * +// * * +// ************************************************************** +xkb_symbols "pcxalga" { + include "digital_vndr/pc(pc)" + include "digital_vndr/us(us)" + replace key { [ Alt_R, Meta_R ] }; +}; + +xkb_symbols "pcxal" { include "digital_vndr/us(pcxalga)" }; +xkb_symbols "pcxalaa" { include "digital_vndr/us(pcxalga)" }; +xkb_symbols "pcxalfa" { include "digital_vndr/us(pcxalga)" }; +xkb_symbols "pcxalka" { include "digital_vndr/us(pcxalga)" }; +xkb_symbols "lk44x" { include "digital_vndr/us(pcxalga)" }; + +// ************************************************************** +// * * +// * The "pc104" layouts. * +// * * +// ************************************************************** +xkb_symbols "pc104" { + include "digital_vndr/pc(pc104)" + include "digital_vndr/us(us)" + replace key { [ Alt_R ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/digital_vndr/vt b/xorg-server/xkeyboard-config/symbols/digital_vndr/vt index 483f1debe..5d3680db4 100644 --- a/xorg-server/xkeyboard-config/symbols/digital_vndr/vt +++ b/xorg-server/xkeyboard-config/symbols/digital_vndr/vt @@ -1,159 +1,158 @@ -// $Xorg: vt,v 1.3 2000/08/17 19:54:44 cpqbld Exp $ -// -//Copyright (c) 1996 Digital Equipment Corporation -// -//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. -// -// HISTORY -// Log -// Revision 1.2 1996/06/18 09:10:19 erik -// use flags correctly, assorted cleanups and consortium fixes -// -// Revision 1.1.6.2 1995/12/19 19:56:39 William_Walker -// Update to XKB 0.65 -// [1995/12/17 02:37:47 William_Walker] -// -// Revision 1.1.2.5 1995/07/11 21:20:50 William_Walker -// Make RALT act as RALT -// [1995/07/11 21:18:28 William_Walker] -// -// Revision 1.1.2.4 1995/06/27 12:18:41 William_Walker -// Add LK201 and LK450 support as well as TW and DP variants. -// [1995/06/26 20:30:37 William_Walker] -// -// Revision 1.1.2.3 1995/06/09 20:55:21 William_Walker -// Add VT105 layout support and ISO group support -// [1995/06/09 20:43:09 William_Walker] -// -// Revision 1.1.2.2 1995/06/05 19:25:04 William_Walker -// New file. I love keymaps. -// [1995/06/05 18:17:58 William_Walker] -// -// EndLog -// -// @(#)RCSfile: vt Revision: /main/3 (DEC) Date: 1996/01/24 12:15:08 -// -xkb_symbols "vt105" { - - // Modifier mappings - // - modifier_map Shift { Shift_L, Shift_R }; - modifier_map Lock { Caps_Lock }; - modifier_map Control { Control_L, Control_R }; - modifier_map Mod1 { Alt_L, Alt_R, Meta_L, Meta_R }; - modifier_map Mod3 { Mode_switch }; - - // Common keys - // - key { [ Delete ] }; - key { [ Tab ] }; - key { [ Return ] }; - key { [ Control_L ] }; - key { [ Caps_Lock ] }; - key { [ Shift_L ] }; - key { [ Shift_R ] }; - key { [ Alt_L, Meta_L ] }; - key { [ space ] }; - - // "Function" keys - // - key { [ F1 ] }; - key { [ F2 ] }; - key { [ F3 ] }; - key { [ F4 ] }; - key { [ F5 ] }; - key { [ F6 ] }; - key { [ F7 ] }; - key { [ F8 ] }; - key { [ F9 ] }; - key { [ F10 ] }; - key { [ Escape, F11 ] }; - key { [ F12 ] }; - key { [ F13 ] }; - key { [ F14 ] }; - key { [ F17 ] }; - key { [ F18 ] }; - key { [ F19 ] }; - key { [ F20 ] }; - - // "Editing" keys - // - key { [ Help ] }; - key { [ Menu ] }; - key { [ Find ] }; - key { [ Insert ] }; - key { [ apLineDel ] }; - key { [ Select ] }; - key { [ Prior ] }; - key { [ Next ] }; - - key { [ Up ] }; - key { [ Left ] }; - key { [ Down ] }; - key { [ Right ] }; - - // "Keypad" keys - // - key { - type= "SHIFT+ALT", - symbols[Group1]= [ KP_F1,Pointer_EnableKeys ] - }; - key { [ KP_F2 ] }; - key { [ KP_F3 ] }; - key { [ KP_F4 ] }; - - key { [ KP_7 ] }; - key { [ KP_8 ] }; - key { [ KP_9 ] }; - key { [ KP_Subtract ] }; - - key { [ KP_4 ] }; - key { [ KP_5 ] }; - key { [ KP_6 ] }; - key { [ KP_Separator ] }; - - key { [ KP_1 ] }; - key { [ KP_2 ] }; - key { [ KP_3 ] }; - key { [ KP_Enter ] }; - - key { [ KP_0 ] }; - key { [ KP_Decimal ] }; - - // Key to support Lock-Down Modifier descriptions for R5 - // - key { [ NoSymbol ] }; -}; - -xkb_symbols "vt108" { - - include "digital_vndr/vt(vt105)" - - replace key { [ Mode_switch ] }; - - key { [ Alt_L, Meta_L ] }; - key { [ Alt_R, Meta_R ] }; - key { [ Multi_key ] }; -}; +// +//Copyright (c) 1996 Digital Equipment Corporation +// +//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 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 DIGITAL EQUIPMENT CORPORATION 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 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. +// +// HISTORY +// Log +// Revision 1.2 1996/06/18 09:10:19 erik +// use flags correctly, assorted cleanups and consortium fixes +// +// Revision 1.1.6.2 1995/12/19 19:56:39 William_Walker +// Update to XKB 0.65 +// [1995/12/17 02:37:47 William_Walker] +// +// Revision 1.1.2.5 1995/07/11 21:20:50 William_Walker +// Make RALT act as RALT +// [1995/07/11 21:18:28 William_Walker] +// +// Revision 1.1.2.4 1995/06/27 12:18:41 William_Walker +// Add LK201 and LK450 support as well as TW and DP variants. +// [1995/06/26 20:30:37 William_Walker] +// +// Revision 1.1.2.3 1995/06/09 20:55:21 William_Walker +// Add VT105 layout support and ISO group support +// [1995/06/09 20:43:09 William_Walker] +// +// Revision 1.1.2.2 1995/06/05 19:25:04 William_Walker +// New file. I love keymaps. +// [1995/06/05 18:17:58 William_Walker] +// +// EndLog +// +// @(#)RCSfile: vt Revision: /main/3 (DEC) Date: 1996/01/24 12:15:08 +// +xkb_symbols "vt105" { + + // Modifier mappings + // + modifier_map Shift { Shift_L, Shift_R }; + modifier_map Lock { Caps_Lock }; + modifier_map Control { Control_L, Control_R }; + modifier_map Mod1 { Alt_L, Alt_R, Meta_L, Meta_R }; + modifier_map Mod3 { Mode_switch }; + + // Common keys + // + key { [ Delete ] }; + key { [ Tab ] }; + key { [ Return ] }; + key { [ Control_L ] }; + key { [ Caps_Lock ] }; + key { [ Shift_L ] }; + key { [ Shift_R ] }; + key { [ Alt_L, Meta_L ] }; + key { [ space ] }; + + // "Function" keys + // + key { [ F1 ] }; + key { [ F2 ] }; + key { [ F3 ] }; + key { [ F4 ] }; + key { [ F5 ] }; + key { [ F6 ] }; + key { [ F7 ] }; + key { [ F8 ] }; + key { [ F9 ] }; + key { [ F10 ] }; + key { [ Escape, F11 ] }; + key { [ F12 ] }; + key { [ F13 ] }; + key { [ F14 ] }; + key { [ F17 ] }; + key { [ F18 ] }; + key { [ F19 ] }; + key { [ F20 ] }; + + // "Editing" keys + // + key { [ Help ] }; + key { [ Menu ] }; + key { [ Find ] }; + key { [ Insert ] }; + key { [ apLineDel ] }; + key { [ Select ] }; + key { [ Prior ] }; + key { [ Next ] }; + + key { [ Up ] }; + key { [ Left ] }; + key { [ Down ] }; + key { [ Right ] }; + + // "Keypad" keys + // + key { + type= "SHIFT+ALT", + symbols[Group1]= [ KP_F1,Pointer_EnableKeys ] + }; + key { [ KP_F2 ] }; + key { [ KP_F3 ] }; + key { [ KP_F4 ] }; + + key { [ KP_7 ] }; + key { [ KP_8 ] }; + key { [ KP_9 ] }; + key { [ KP_Subtract ] }; + + key { [ KP_4 ] }; + key { [ KP_5 ] }; + key { [ KP_6 ] }; + key { [ KP_Separator ] }; + + key { [ KP_1 ] }; + key { [ KP_2 ] }; + key { [ KP_3 ] }; + key { [ KP_Enter ] }; + + key { [ KP_0 ] }; + key { [ KP_Decimal ] }; + + // Key to support Lock-Down Modifier descriptions for R5 + // + key { [ NoSymbol ] }; +}; + +xkb_symbols "vt108" { + + include "digital_vndr/vt(vt105)" + + replace key { [ Mode_switch ] }; + + key { [ Alt_L, Meta_L ] }; + key { [ Alt_R, Meta_R ] }; + key { [ Multi_key ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/dk b/xorg-server/xkeyboard-config/symbols/dk index 16223e9a5..c652ebbb6 100644 --- a/xorg-server/xkeyboard-config/symbols/dk +++ b/xorg-server/xkeyboard-config/symbols/dk @@ -1,77 +1,72 @@ - -// based on a keyboard map from an 'xkb/symbols/dk' file -// -// $XKeyboardConfig$ -// $XFree86: xc/programs/xkbcomp/symbols/dk,v 1.3 2002/12/19 01:07:56 dawes Exp $ - -partial default alphanumeric_keys -xkb_symbols "basic" { - - include "latin(type2)" - - name[Group1]="Denmark"; - - key { [ plus, question, plusminus, questiondown ] }; - key { [dead_acute, dead_grave, bar, brokenbar ] }; - - - key { [ ae, AE, dead_acute, dead_doubleacute ] }; - key { [ oslash, Ooblique, dead_circumflex, dead_caron ] }; - key { [ onehalf, section, threequarters, paragraph ] }; - - key { [apostrophe, asterisk, dead_doubleacute, multiply ] }; - - key { [ less, greater, backslash, notsign ] }; - - include "kpdl(comma)" - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - - include "dk(basic)" - - name[Group1]="Denmark - Eliminate dead keys"; - - key { [ acute, grave, bar, ogonek ] }; - key { [ aring, Aring, diaeresis, degree ] }; - key { [ diaeresis, asciicircum, asciitilde, macron ] }; - key { [ ae, AE, acute, doubleacute ] }; - key { [ oslash, Ooblique, asciicircum, caron ] }; - key { [apostrophe, asterisk, doubleacute, multiply ] }; - key { [ comma, semicolon, cedilla, ogonek ] }; - key { [ period, colon, periodcentered, abovedot ] }; - -}; - -// Copied from macintosh_vndr/dk -partial alphanumeric_keys -xkb_symbols "mac" { - - include "dk" - name[Group1]= "Denmark - Macintosh"; - - key { [ space, space, nobreakspace, nobreakspace ] }; - key { [ minus, underscore, hyphen, macron ] }; - include "kpdl(dot)" -}; - - -partial alphanumeric_keys -xkb_symbols "mac_nodeadkeys" { - include "dk(mac)" - name[Group1]= "Denmark - Macintosh, eliminate dead keys"; - - key { [ acute, grave, bar, ogonek ] }; - key { [diaeresis, asciicircum, asciitilde, dead_macron ] }; -}; - -partial alphanumeric_keys -xkb_symbols "dvorak" { - include "no(dvorak)" - - name[Group1]= "Denmark - Dvorak"; -}; - +// based on a keyboard map from an 'xkb/symbols/dk' file + +partial default alphanumeric_keys +xkb_symbols "basic" { + + include "latin(type2)" + + name[Group1]="Denmark"; + + key { [ plus, question, plusminus, questiondown ] }; + key { [dead_acute, dead_grave, bar, brokenbar ] }; + + + key { [ ae, AE, dead_acute, dead_doubleacute ] }; + key { [ oslash, Ooblique, dead_circumflex, dead_caron ] }; + key { [ onehalf, section, threequarters, paragraph ] }; + + key { [apostrophe, asterisk, dead_doubleacute, multiply ] }; + + key { [ less, greater, backslash, notsign ] }; + + include "kpdl(comma)" + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "nodeadkeys" { + + include "dk(basic)" + + name[Group1]="Denmark - Eliminate dead keys"; + + key { [ acute, grave, bar, ogonek ] }; + key { [ aring, Aring, diaeresis, degree ] }; + key { [ diaeresis, asciicircum, asciitilde, macron ] }; + key { [ ae, AE, acute, doubleacute ] }; + key { [ oslash, Ooblique, asciicircum, caron ] }; + key { [apostrophe, asterisk, doubleacute, multiply ] }; + key { [ comma, semicolon, cedilla, ogonek ] }; + key { [ period, colon, periodcentered, abovedot ] }; + +}; + +// Copied from macintosh_vndr/dk +partial alphanumeric_keys +xkb_symbols "mac" { + + include "dk" + name[Group1]= "Denmark - Macintosh"; + + key { [ space, space, nobreakspace, nobreakspace ] }; + key { [ minus, underscore, hyphen, macron ] }; + include "kpdl(dot)" +}; + + +partial alphanumeric_keys +xkb_symbols "mac_nodeadkeys" { + include "dk(mac)" + name[Group1]= "Denmark - Macintosh, eliminate dead keys"; + + key { [ acute, grave, bar, ogonek ] }; + key { [diaeresis, asciicircum, asciitilde, dead_macron ] }; +}; + +partial alphanumeric_keys +xkb_symbols "dvorak" { + include "no(dvorak)" + + name[Group1]= "Denmark - Dvorak"; +}; diff --git a/xorg-server/xkeyboard-config/symbols/ee b/xorg-server/xkeyboard-config/symbols/ee index e55f20e27..e85037b04 100644 --- a/xorg-server/xkeyboard-config/symbols/ee +++ b/xorg-server/xkeyboard-config/symbols/ee @@ -1,103 +1,100 @@ -// $XKeyboardConfig$ - -// based on -// Estonian XKB-keymap by Ville Hallik -// -// $XFree86: xc/programs/xkbcomp/symbols/ee,v 1.2 2002/11/22 04:03:28 dawes Exp $ - -partial default alphanumeric_keys -xkb_symbols "basic" { - - // Describes the differences between a very simple en_US - // keyboard and a very simple Estonian keyboard - // This layout conforms to both EVS8:1993 and EVS8:2000 standards - - include "latin(type4)" - - name[Group1]="Estonia"; - - key { [ 3, numbersign, sterling, sterling ] }; - key { [ 4, currency, dollar, dollar ] }; - key { [ plus, question, backslash, questiondown ] }; - key { [dead_acute, dead_grave, grave, apostrophe ] }; - - key { [udiaeresis, Udiaeresis, dead_diaeresis, dead_abovering ] }; - key { [ otilde, Otilde, section, dead_macron ] }; - - key { [ s, S, scaron, Scaron ] }; - key { [odiaeresis, Odiaeresis, dead_acute, dead_doubleacute ] }; - key { [adiaeresis, Adiaeresis, asciicircum, dead_caron ] }; - key { [dead_caron, dead_tilde, notsign, notsign ] }; - - key { [apostrophe, asterisk, onehalf, dead_breve ] }; - key { [ z, Z, zcaron, Zcaron ] }; - key { [ comma, semicolon, less, multiply ] }; - key { [ period, colon, greater, division ] }; - - include "level3(ralt_switch)" - include "eurosign(e)" -}; - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - - // Modifies the basic Estonian layout to eliminate all dead keys - - include "ee(basic)" - name[Group1]="Estonia - Eliminate dead keys"; - - key { [asciicircum,asciitilde ] }; - key { [apostrophe, grave ] }; - key { [udiaeresis, Udiaeresis, diaeresis, degree ] }; - key { [ otilde, Otilde, section, macron ] }; - key { [odiaeresis, Odiaeresis, acute, doubleacute ] }; - key { [adiaeresis, Adiaeresis, asciicircum, caron ] }; - key { [apostrophe, asterisk, onehalf, breve ] }; - key { [ minus, underscore, dead_belowdot, abovedot ] }; -}; - -// Dvorak with Estonian characters -partial alphanumeric_keys -xkb_symbols "dvorak" { - include "us(dvorak)" - name[Group1]= "Estonia - Dvorak"; - - key { [ 3, numbersign, sterling ] }; - key { [ 4, dollar, section, currency ] }; - key { [ 8, asterisk, onehalf ] }; - - key { [ a, A, adiaeresis, Adiaeresis ] }; - key { [ o, O, otilde, Otilde ] }; - key { [ e, E, odiaeresis, Odiaeresis ] }; - key { [ u, U, udiaeresis, Udiaeresis ] }; - key { [ s, S, scaron, Scaron ] }; - key { [ z, Z, zcaron, Zcaron ] }; - - include "level3(ralt_switch)" - include "kpdl(comma)" - include "eurosign(5)" -}; - -// Estonian few characters on basic US keymap. -// by Elan Ruusamäe -partial alphanumeric_keys -xkb_symbols "us" { - include "us(euro)" - name[Group1] = "Estonia - US keyboard with Estonian letters"; - - // ž, Ž - key { [ z, Z, zcaron, Zcaron ] }; - // ¢ - key { [ c, C, cent, cent ] }; - // š, Š - key { [ s, S, scaron, Scaron ] }; - key { [ semicolon, colon, odiaeresis, Odiaeresis ] }; - key { [ quoteright, quotedbl, adiaeresis, Adiaeresis ] }; - key { [ bracketleft, braceleft, udiaeresis, Udiaeresis ] }; - key { [ bracketright, braceright, otilde, Otilde ] }; - // £ - key { [ 3, numbersign, sterling, sterling ] }; - - include "level3(ralt_switch)" - include "eurosign(e)" -}; +// based on +// Estonian XKB-keymap by Ville Hallik +// + +partial default alphanumeric_keys +xkb_symbols "basic" { + + // Describes the differences between a very simple en_US + // keyboard and a very simple Estonian keyboard + // This layout conforms to both EVS8:1993 and EVS8:2000 standards + + include "latin(type4)" + + name[Group1]="Estonia"; + + key { [ 3, numbersign, sterling, sterling ] }; + key { [ 4, currency, dollar, dollar ] }; + key { [ plus, question, backslash, questiondown ] }; + key { [dead_acute, dead_grave, grave, apostrophe ] }; + + key { [udiaeresis, Udiaeresis, dead_diaeresis, dead_abovering ] }; + key { [ otilde, Otilde, section, dead_macron ] }; + + key { [ s, S, scaron, Scaron ] }; + key { [odiaeresis, Odiaeresis, dead_acute, dead_doubleacute ] }; + key { [adiaeresis, Adiaeresis, asciicircum, dead_caron ] }; + key { [dead_caron, dead_tilde, notsign, notsign ] }; + + key { [apostrophe, asterisk, onehalf, dead_breve ] }; + key { [ z, Z, zcaron, Zcaron ] }; + key { [ comma, semicolon, less, multiply ] }; + key { [ period, colon, greater, division ] }; + + include "level3(ralt_switch)" + include "eurosign(e)" +}; + +partial alphanumeric_keys +xkb_symbols "nodeadkeys" { + + // Modifies the basic Estonian layout to eliminate all dead keys + + include "ee(basic)" + name[Group1]="Estonia - Eliminate dead keys"; + + key { [asciicircum,asciitilde ] }; + key { [apostrophe, grave ] }; + key { [udiaeresis, Udiaeresis, diaeresis, degree ] }; + key { [ otilde, Otilde, section, macron ] }; + key { [odiaeresis, Odiaeresis, acute, doubleacute ] }; + key { [adiaeresis, Adiaeresis, asciicircum, caron ] }; + key { [apostrophe, asterisk, onehalf, breve ] }; + key { [ minus, underscore, dead_belowdot, abovedot ] }; +}; + +// Dvorak with Estonian characters +partial alphanumeric_keys +xkb_symbols "dvorak" { + include "us(dvorak)" + name[Group1]= "Estonia - Dvorak"; + + key { [ 3, numbersign, sterling ] }; + key { [ 4, dollar, section, currency ] }; + key { [ 8, asterisk, onehalf ] }; + + key { [ a, A, adiaeresis, Adiaeresis ] }; + key { [ o, O, otilde, Otilde ] }; + key { [ e, E, odiaeresis, Odiaeresis ] }; + key { [ u, U, udiaeresis, Udiaeresis ] }; + key { [ s, S, scaron, Scaron ] }; + key { [ z, Z, zcaron, Zcaron ] }; + + include "level3(ralt_switch)" + include "kpdl(comma)" + include "eurosign(5)" +}; + +// Estonian few characters on basic US keymap. +// by Elan Ruusamäe +partial alphanumeric_keys +xkb_symbols "us" { + include "us(euro)" + name[Group1] = "Estonia - US keyboard with Estonian letters"; + + // ž, Ž + key { [ z, Z, zcaron, Zcaron ] }; + // ¢ + key { [ c, C, cent, cent ] }; + // š, Š + key { [ s, S, scaron, Scaron ] }; + key { [ semicolon, colon, odiaeresis, Odiaeresis ] }; + key { [ quoteright, quotedbl, adiaeresis, Adiaeresis ] }; + key { [ bracketleft, braceleft, udiaeresis, Udiaeresis ] }; + key { [ bracketright, braceright, otilde, Otilde ] }; + // £ + key { [ 3, numbersign, sterling, sterling ] }; + + include "level3(ralt_switch)" + include "eurosign(e)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/empty b/xorg-server/xkeyboard-config/symbols/empty index 72eb12736..16443b28c 100644 --- a/xorg-server/xkeyboard-config/symbols/empty +++ b/xorg-server/xkeyboard-config/symbols/empty @@ -1,6 +1,4 @@ -// $XKeyboardConfig$ - -default partial alphanumeric_keys modifier_keys -xkb_symbols "basic" { - name[Group1]= "Empty"; -}; +default partial alphanumeric_keys modifier_keys +xkb_symbols "basic" { + name[Group1]= "Empty"; +}; diff --git a/xorg-server/xkeyboard-config/symbols/epo b/xorg-server/xkeyboard-config/symbols/epo index c9b2d57b2..d5bd762fe 100644 --- a/xorg-server/xkeyboard-config/symbols/epo +++ b/xorg-server/xkeyboard-config/symbols/epo @@ -1,141 +1,139 @@ -// $XKeyboardConfig$ - -// Esperanto keyboard maps -- "Ekverto" -// -// Ekverto A ("legacy") (2004-01-10) -// Chusslove Illich (Ĉaslavo Iliĉo) -// -// Ekverto B ("basic") (2006-12-02) -// Benno Schulenberg (Beno Sĥilenberĥ) -// Chusslove Illich (Ĉaslavo Iliĉo) - -default partial alphanumeric_keys -xkb_symbols "basic" { - - name[Group1]= "Esperanto"; - - include "us(basic)" - - key.type[Group1] = "FOUR_LEVEL_ALPHABETIC"; - - key { [ scircumflex, Scircumflex, q, Q ] }; - key { [ gcircumflex, Gcircumflex, w, W ] }; - key { [ ccircumflex, Ccircumflex, x, X ] }; - key { [ ubreve, Ubreve, y, Y ] }; - - key.type[Group1] = "FOUR_LEVEL_SEMIALPHABETIC"; - - key { [ jcircumflex, Jcircumflex, bracketleft, braceleft ] }; - key { [ hcircumflex, Hcircumflex, bracketright, braceright ] }; - - key { [ o, O, braceleft, braceleft ] }; - key { [ p, P, braceright, braceright ] }; - - key { [ a, A, leftsinglequotemark, NoSymbol ] }; - key { [ s, S, rightsinglequotemark, NoSymbol ] }; - key { [ d, D, leftdoublequotemark, NoSymbol ] }; - key { [ f, F, rightdoublequotemark, NoSymbol ] }; - - key { [ n, N, endash, endash ] }; - key { [ m, M, emdash, emdash ] }; - - key.type[Group1] = "FOUR_LEVEL"; - - key { [ 5, percent, EuroSign, EuroSign ] }; - - include "level3(ralt_switch)" -}; - - -partial alphanumeric_keys -xkb_symbols "legacy" { - - name[Group1]= "Esperanto - displaced semicolon and quote (obsolete)"; - - key.type[Group1] = "FOUR_LEVEL"; - - key { [ grave, asciitilde, NoSymbol, NoSymbol ] }; - key { [ 1, exclam, NoSymbol, NoSymbol ] }; - key { [ 2, quotedbl, NoSymbol, NoSymbol ] }; - key { [ 3, numbersign, NoSymbol, NoSymbol ] }; - key { [ 4, dollar, NoSymbol, NoSymbol ] }; - key { [ 5, percent, NoSymbol, NoSymbol ] }; - key { [ 6, apostrophe, NoSymbol, NoSymbol ] }; - key { [ 7, ampersand, NoSymbol, NoSymbol ] }; - key { [ 8, asterisk, NoSymbol, NoSymbol ] }; - key { [ 9, parenleft, NoSymbol, NoSymbol ] }; - key { [ 0, parenright, NoSymbol, NoSymbol ] }; - key { [ minus, underscore, NoSymbol, NoSymbol ] }; - key { [ equal, plus, NoSymbol, NoSymbol ] }; - - key { [ comma, semicolon, NoSymbol, NoSymbol ] }; - key { [ period, colon, NoSymbol, NoSymbol ] }; - key { [ slash, question, NoSymbol, NoSymbol ] }; - - key { [ bracketleft, braceleft, NoSymbol, NoSymbol ] }; - key { [ bracketright, braceright, NoSymbol, NoSymbol ] }; - - key { [ backslash, bar, NoSymbol, NoSymbol ] }; - key { [ NoSymbol, NoSymbol, NoSymbol, NoSymbol ] }; - - key.type[Group1] = "FOUR_LEVEL_SEMIALPHABETIC"; - - key { [ scircumflex, Scircumflex, at, NoSymbol ] }; - key { [ jcircumflex, Jcircumflex, asciicircum, NoSymbol ] }; - key { [ e, E, EuroSign, NoSymbol ] }; - key { [ r, R, emdash, NoSymbol ] }; - key { [ t, T, endash, NoSymbol ] }; - key { [ gcircumflex, Gcircumflex, NoSymbol, NoSymbol ] }; - key { [ u, U, NoSymbol, NoSymbol ] }; - key { [ i, I, NoSymbol, NoSymbol ] }; - key { [ o, O, NoSymbol, NoSymbol ] }; - key { [ p, P, NoSymbol, NoSymbol ] }; - - key { [ a, A, less, NoSymbol ] }; - key { [ s, S, greater, NoSymbol ] }; - key { [ d, D, leftdoublequotemark, NoSymbol ] }; - key { [ f, F, rightdoublequotemark, NoSymbol ] }; - key { [ g, G, NoSymbol, NoSymbol ] }; - key { [ h, H, NoSymbol, NoSymbol ] }; - key { [ j, J, NoSymbol, NoSymbol ] }; - key { [ k, K, NoSymbol, NoSymbol ] }; - key { [ l, L, NoSymbol, NoSymbol ] }; - key { [ ubreve, Ubreve, NoSymbol, NoSymbol ] }; - key { [ hcircumflex, Hcircumflex, NoSymbol, NoSymbol ] }; - - key { [ z, Z, leftsinglequotemark, NoSymbol ] }; - key { [ ccircumflex, Ccircumflex, rightsinglequotemark, NoSymbol ] }; - key { [ c, C, NoSymbol, NoSymbol ] }; - key { [ v, V, NoSymbol, NoSymbol ] }; - key { [ b, B, NoSymbol, NoSymbol ] }; - key { [ n, N, NoSymbol, NoSymbol ] }; - key { [ m, M, NoSymbol, NoSymbol ] }; - - include "level3(ralt_switch)" -}; - -// Add Esperanto supersignos to the corresponding key in a Qwerty keyboard. -// This is a generic "component" that is not used to the other layouts in this -// file but it is meant to be applied to any layout. If you have any questions -// ask J. Pablo Fernández . -partial -xkb_symbols "qwerty" { - key { [ NoSymbol, NoSymbol, ccircumflex, Ccircumflex ] }; - key { [ NoSymbol, NoSymbol, gcircumflex, Gcircumflex ] }; - key { [ NoSymbol, NoSymbol, hcircumflex, Hcircumflex ] }; - key { [ NoSymbol, NoSymbol, jcircumflex, Jcircumflex ] }; - key { [ NoSymbol, NoSymbol, scircumflex, Scircumflex ] }; - key { [ NoSymbol, NoSymbol, ubreve, Ubreve ] }; -}; - -// Add Esperanto supersignos to the corresponding key in a Dvorak keyboard. -// Same comment as the Qwerty one above applies. -partial -xkb_symbols "dvorak" { - key { [ NoSymbol, NoSymbol, ccircumflex, Ccircumflex ] }; - key { [ NoSymbol, NoSymbol, gcircumflex, Gcircumflex ] }; - key { [ NoSymbol, NoSymbol, hcircumflex, Hcircumflex ] }; - key { [ NoSymbol, NoSymbol, jcircumflex, Jcircumflex ] }; - key { [ NoSymbol, NoSymbol, scircumflex, Scircumflex ] }; - key { [ NoSymbol, NoSymbol, ubreve, Ubreve ] }; -}; +// Esperanto keyboard maps -- "Ekverto" +// +// Ekverto A ("legacy") (2004-01-10) +// Chusslove Illich (Ĉaslavo Iliĉo) +// +// Ekverto B ("basic") (2006-12-02) +// Benno Schulenberg (Beno Sĥilenberĥ) +// Chusslove Illich (Ĉaslavo Iliĉo) + +default partial alphanumeric_keys +xkb_symbols "basic" { + + name[Group1]= "Esperanto"; + + include "us(basic)" + + key.type[Group1] = "FOUR_LEVEL_ALPHABETIC"; + + key { [ scircumflex, Scircumflex, q, Q ] }; + key { [ gcircumflex, Gcircumflex, w, W ] }; + key { [ ccircumflex, Ccircumflex, x, X ] }; + key { [ ubreve, Ubreve, y, Y ] }; + + key.type[Group1] = "FOUR_LEVEL_SEMIALPHABETIC"; + + key { [ jcircumflex, Jcircumflex, bracketleft, braceleft ] }; + key { [ hcircumflex, Hcircumflex, bracketright, braceright ] }; + + key { [ o, O, braceleft, braceleft ] }; + key { [ p, P, braceright, braceright ] }; + + key { [ a, A, leftsinglequotemark, NoSymbol ] }; + key { [ s, S, rightsinglequotemark, NoSymbol ] }; + key { [ d, D, leftdoublequotemark, NoSymbol ] }; + key { [ f, F, rightdoublequotemark, NoSymbol ] }; + + key { [ n, N, endash, endash ] }; + key { [ m, M, emdash, emdash ] }; + + key.type[Group1] = "FOUR_LEVEL"; + + key { [ 5, percent, EuroSign, EuroSign ] }; + + include "level3(ralt_switch)" +}; + + +partial alphanumeric_keys +xkb_symbols "legacy" { + + name[Group1]= "Esperanto - displaced semicolon and quote (obsolete)"; + + key.type[Group1] = "FOUR_LEVEL"; + + key { [ grave, asciitilde, NoSymbol, NoSymbol ] }; + key { [ 1, exclam, NoSymbol, NoSymbol ] }; + key { [ 2, quotedbl, NoSymbol, NoSymbol ] }; + key { [ 3, numbersign, NoSymbol, NoSymbol ] }; + key { [ 4, dollar, NoSymbol, NoSymbol ] }; + key { [ 5, percent, NoSymbol, NoSymbol ] }; + key { [ 6, apostrophe, NoSymbol, NoSymbol ] }; + key { [ 7, ampersand, NoSymbol, NoSymbol ] }; + key { [ 8, asterisk, NoSymbol, NoSymbol ] }; + key { [ 9, parenleft, NoSymbol, NoSymbol ] }; + key { [ 0, parenright, NoSymbol, NoSymbol ] }; + key { [ minus, underscore, NoSymbol, NoSymbol ] }; + key { [ equal, plus, NoSymbol, NoSymbol ] }; + + key { [ comma, semicolon, NoSymbol, NoSymbol ] }; + key { [ period, colon, NoSymbol, NoSymbol ] }; + key { [ slash, question, NoSymbol, NoSymbol ] }; + + key { [ bracketleft, braceleft, NoSymbol, NoSymbol ] }; + key { [ bracketright, braceright, NoSymbol, NoSymbol ] }; + + key { [ backslash, bar, NoSymbol, NoSymbol ] }; + key { [ NoSymbol, NoSymbol, NoSymbol, NoSymbol ] }; + + key.type[Group1] = "FOUR_LEVEL_SEMIALPHABETIC"; + + key { [ scircumflex, Scircumflex, at, NoSymbol ] }; + key { [ jcircumflex, Jcircumflex, asciicircum, NoSymbol ] }; + key { [ e, E, EuroSign, NoSymbol ] }; + key { [ r, R, emdash, NoSymbol ] }; + key { [ t, T, endash, NoSymbol ] }; + key { [ gcircumflex, Gcircumflex, NoSymbol, NoSymbol ] }; + key { [ u, U, NoSymbol, NoSymbol ] }; + key { [ i, I, NoSymbol, NoSymbol ] }; + key { [ o, O, NoSymbol, NoSymbol ] }; + key { [ p, P, NoSymbol, NoSymbol ] }; + + key { [ a, A, less, NoSymbol ] }; + key { [ s, S, greater, NoSymbol ] }; + key { [ d, D, leftdoublequotemark, NoSymbol ] }; + key { [ f, F, rightdoublequotemark, NoSymbol ] }; + key { [ g, G, NoSymbol, NoSymbol ] }; + key { [ h, H, NoSymbol, NoSymbol ] }; + key { [ j, J, NoSymbol, NoSymbol ] }; + key { [ k, K, NoSymbol, NoSymbol ] }; + key { [ l, L, NoSymbol, NoSymbol ] }; + key { [ ubreve, Ubreve, NoSymbol, NoSymbol ] }; + key { [ hcircumflex, Hcircumflex, NoSymbol, NoSymbol ] }; + + key { [ z, Z, leftsinglequotemark, NoSymbol ] }; + key { [ ccircumflex, Ccircumflex, rightsinglequotemark, NoSymbol ] }; + key { [ c, C, NoSymbol, NoSymbol ] }; + key { [ v, V, NoSymbol, NoSymbol ] }; + key { [ b, B, NoSymbol, NoSymbol ] }; + key { [ n, N, NoSymbol, NoSymbol ] }; + key { [ m, M, NoSymbol, NoSymbol ] }; + + include "level3(ralt_switch)" +}; + +// Add Esperanto supersignos to the corresponding key in a Qwerty keyboard. +// This is a generic "component" that is not used to the other layouts in this +// file but it is meant to be applied to any layout. If you have any questions +// ask J. Pablo Fernández . +partial +xkb_symbols "qwerty" { + key { [ NoSymbol, NoSymbol, ccircumflex, Ccircumflex ] }; + key { [ NoSymbol, NoSymbol, gcircumflex, Gcircumflex ] }; + key { [ NoSymbol, NoSymbol, hcircumflex, Hcircumflex ] }; + key { [ NoSymbol, NoSymbol, jcircumflex, Jcircumflex ] }; + key { [ NoSymbol, NoSymbol, scircumflex, Scircumflex ] }; + key { [ NoSymbol, NoSymbol, ubreve, Ubreve ] }; +}; + +// Add Esperanto supersignos to the corresponding key in a Dvorak keyboard. +// Same comment as the Qwerty one above applies. +partial +xkb_symbols "dvorak" { + key { [ NoSymbol, NoSymbol, ccircumflex, Ccircumflex ] }; + key { [ NoSymbol, NoSymbol, gcircumflex, Gcircumflex ] }; + key { [ NoSymbol, NoSymbol, hcircumflex, Hcircumflex ] }; + key { [ NoSymbol, NoSymbol, jcircumflex, Jcircumflex ] }; + key { [ NoSymbol, NoSymbol, scircumflex, Scircumflex ] }; + key { [ NoSymbol, NoSymbol, ubreve, Ubreve ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/es b/xorg-server/xkeyboard-config/symbols/es index 70f8088a8..048a9f03a 100644 --- a/xorg-server/xkeyboard-config/symbols/es +++ b/xorg-server/xkeyboard-config/symbols/es @@ -1,9 +1,6 @@ -// $XKeyboardConfig$ - // based on a keyboard // Modified for a real Spanish Keyboard by Jon Tombs // -// $XFree86: xc/programs/xkbcomp/symbols/es,v 1.2 2002/11/22 04:03:28 dawes Exp $ partial default alphanumeric_keys xkb_symbols "basic" { diff --git a/xorg-server/xkeyboard-config/symbols/et b/xorg-server/xkeyboard-config/symbols/et index f3d4a98db..6f71b2f97 100644 --- a/xorg-server/xkeyboard-config/symbols/et +++ b/xorg-server/xkeyboard-config/symbols/et @@ -1,75 +1,73 @@ -// $XKeyboardConfig$ - -// -// Ethiopia -// Designed as a part of OLPC project -// -// 2007 Sergey Udaltsov -// - -partial default alphanumeric_keys -xkb_symbols "basic" { - include "et(olpc)" - name[Group1]="Ethiopia"; -}; - -partial alphanumeric_keys -xkb_symbols "olpc" { - - name[Group1]="Ethiopia"; - - key { [ 0x01001369, 0x01001372 ] }; // 1 - key { [ 0x0100136a, 0x01001373 ] }; // 2 - key { [ 0x0100136b, 0x01001374 ] }; // 3 - key { [ 0x0100136c, 0x01001375 ] }; // 4 - key { [ 0x0100136d, 0x01001376 ] }; // 5 - key { [ 0x0100136e, 0x01001377 ] }; // 6 - key { [ 0x0100136f, 0x01001378 ] }; // 7 - key { [ 0x01001370, 0x01001379 ] }; // 8 - key { [ 0x01001371, 0x0100137a ] }; // 9 - key { [ 0x0100137b, 0x0100137c ] }; // 0 - key { [ minus, underscore ] }; // -_ - key { [ equal, plus ] }; // =+ - - key { [ 0x01001240, 0x01001250 ] }; // q - key { [ 0x010012C8, VoidSymbol ] }; // w - key { [ e, E ] }; // e - key { [ 0x01001228, VoidSymbol ] }; // r - key { [ 0x01001270, 0x01001320 ] }; // t - key { [ 0x010012E8, VoidSymbol ] }; // y - key { [ u, U ] }; // u - key { [ i, I ] }; // i - key { [ o, O ] }; // o - key { [ 0x01001350, 0x01001330 ] }; // p - key { [ 0x01001340, 0x01001338 ] }; // [ - key { [ 0x01001328, 0x01001280 ] }; // ] - - key { [ a, A ] }; // a - key { [ 0x01001230, 0x01001220 ] }; // s - key { [ 0x010012F0, 0x010012F8 ] }; // d - key { [ 0x01001348, VoidSymbol ] }; // f - key { [ 0x01001308, 0x01001318 ] }; // g - key { [ 0x01001200, 0x01001210 ] }; // h - key { [ 0x01001300, VoidSymbol ] }; // j - key { [ 0x010012A8, 0x010012B8 ] }; // k - key { [ 0x01001208, VoidSymbol ] }; // l - - key { [ 0x01001362, 0x01001361 ] }; // :; - key { [ 0x01001366, 0x01001365 ] }; // '" - - key { [ 0x010012D8, 0x010012E0 ] }; // z - key { [ 0x010012A0, 0x010012D0 ] }; // x - key { [ 0x01001278, VoidSymbol ] }; // c - key { [ 0x01001238, 0x01001268 ] }; // v - key { [ 0x01001260, VoidSymbol ] }; // b - key { [ 0x01001290, 0x01001298 ] }; // n - key { [ 0x01001218, VoidSymbol ] }; // m - - key { [ 0x01001363, VoidSymbol ] }; // < - key { [ 0x01001364, VoidSymbol ] }; // > - key { [ 0x01001367, VoidSymbol ] }; // ? - - key { [ VoidSymbol, 0x01002010 ] }; // bksl - - include "group(olpc)" -}; +// +// Ethiopia +// Designed as a part of OLPC project +// +// 2007 Sergey Udaltsov +// + +partial default alphanumeric_keys +xkb_symbols "basic" { + include "et(olpc)" + name[Group1]="Ethiopia"; +}; + +partial alphanumeric_keys +xkb_symbols "olpc" { + + name[Group1]="Ethiopia"; + + key { [ 0x01001369, 0x01001372 ] }; // 1 + key { [ 0x0100136a, 0x01001373 ] }; // 2 + key { [ 0x0100136b, 0x01001374 ] }; // 3 + key { [ 0x0100136c, 0x01001375 ] }; // 4 + key { [ 0x0100136d, 0x01001376 ] }; // 5 + key { [ 0x0100136e, 0x01001377 ] }; // 6 + key { [ 0x0100136f, 0x01001378 ] }; // 7 + key { [ 0x01001370, 0x01001379 ] }; // 8 + key { [ 0x01001371, 0x0100137a ] }; // 9 + key { [ 0x0100137b, 0x0100137c ] }; // 0 + key { [ minus, underscore ] }; // -_ + key { [ equal, plus ] }; // =+ + + key { [ 0x01001240, 0x01001250 ] }; // q + key { [ 0x010012C8, VoidSymbol ] }; // w + key { [ e, E ] }; // e + key { [ 0x01001228, VoidSymbol ] }; // r + key { [ 0x01001270, 0x01001320 ] }; // t + key { [ 0x010012E8, VoidSymbol ] }; // y + key { [ u, U ] }; // u + key { [ i, I ] }; // i + key { [ o, O ] }; // o + key { [ 0x01001350, 0x01001330 ] }; // p + key { [ 0x01001340, 0x01001338 ] }; // [ + key { [ 0x01001328, 0x01001280 ] }; // ] + + key { [ a, A ] }; // a + key { [ 0x01001230, 0x01001220 ] }; // s + key { [ 0x010012F0, 0x010012F8 ] }; // d + key { [ 0x01001348, VoidSymbol ] }; // f + key { [ 0x01001308, 0x01001318 ] }; // g + key { [ 0x01001200, 0x01001210 ] }; // h + key { [ 0x01001300, VoidSymbol ] }; // j + key { [ 0x010012A8, 0x010012B8 ] }; // k + key { [ 0x01001208, VoidSymbol ] }; // l + + key { [ 0x01001362, 0x01001361 ] }; // :; + key { [ 0x01001366, 0x01001365 ] }; // '" + + key { [ 0x010012D8, 0x010012E0 ] }; // z + key { [ 0x010012A0, 0x010012D0 ] }; // x + key { [ 0x01001278, VoidSymbol ] }; // c + key { [ 0x01001238, 0x01001268 ] }; // v + key { [ 0x01001260, VoidSymbol ] }; // b + key { [ 0x01001290, 0x01001298 ] }; // n + key { [ 0x01001218, VoidSymbol ] }; // m + + key { [ 0x01001363, VoidSymbol ] }; // < + key { [ 0x01001364, VoidSymbol ] }; // > + key { [ 0x01001367, VoidSymbol ] }; // ? + + key { [ VoidSymbol, 0x01002010 ] }; // bksl + + include "group(olpc)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/eurosign b/xorg-server/xkeyboard-config/symbols/eurosign index 61a4057b0..380350174 100644 --- a/xorg-server/xkeyboard-config/symbols/eurosign +++ b/xorg-server/xkeyboard-config/symbols/eurosign @@ -1,5 +1,3 @@ -// $XKeyboardConfig$ - // Most keyboards have the EuroSign engraved on the E key partial xkb_symbols "e" { @@ -23,4 +21,3 @@ partial xkb_symbols "5" { key { [ NoSymbol, NoSymbol, EuroSign, NoSymbol ] }; }; - diff --git a/xorg-server/xkeyboard-config/symbols/extras/apl b/xorg-server/xkeyboard-config/symbols/extras/apl index 512277a75..57cdb0824 100644 --- a/xorg-server/xkeyboard-config/symbols/extras/apl +++ b/xorg-server/xkeyboard-config/symbols/extras/apl @@ -1,296 +1,294 @@ -// APL Keyboard Layouts - -// This file supports: -// - The Sharp APL for Unix (SAX) layout -// - The IBM APL2 layout -// - The Manugistics APL*PLUS II (Version 5.1, 1993) keyboard layout - -// Unicode APL table: http://aplwiki.com/UnicodeAplTable -// ...and another: http://publibfp.boulder.ibm.com/epubs/pdf/h2110611.pdf (appendix A) -// Generic Unicode stuff: http://www.fileformat.info/info/unicode/category/index.htm - -// Tim Nelson (this file's creator) says: - -// This file doesn't deal with all the combining stuff -- I'm not an APL programmer, -// and am not quite sure what's needed here. However, it may be possible to get this -// working with dead keys and the like. Patches gratefully accepted. - -// Some of the shift-key assignments may differ from the APL tradition. If -// that's not considered acceptable, it should be possible to remap the -// shift keys. I have striven, however, to ensure that the use of shift keys -// in these maps is at least self-consistent. - -// I'm assuming that this will be used with another keyboard layout (ie. for -// your language), with a special shift key to use these maps. - -partial alphanumeric_keys modifier_keys -xkb_symbols "common" { - name[Group1]= "APL"; - - key { [ diaeresis ] }; - key { [ U00AF ] }; // ¯ -- Macron - key { [ less ] }; - key { [ U2264 ] }; // ≤ -- Less-than Or Equal To - key { [ equal ] }; - key { [ U2265 ] }; // ≥ -- Greater-than Or Equal To - key { [ greater ] }; - key { [ U2260 ] }; // ≠ -- Not Equal To - key { [ U2228 ] }; // ∨ -- Logical Or - key { [ U2227 ] }; // ∧ -- Logical And - - // Q - key { [ question ] }; - // W - key { [ U2375 ] }; // ⍵ -- APL Functional Symbol Omega - // E - key { [ U220A ] }; // ∊ -- Small Element Of - // R - key { [ U2374 ] }; // ⍴ -- APL Functional Symbol Rho - // T - key { [ asciitilde ] }; - // Y - key { [ U2191 ] }; // ↑ -- Upwards Arrow - // U - key { [ U2193 ] }; // ↓ -- Downwards Arrow - // I - key { [ U2373 ] }; // ⍳ -- APL Functional Symbol Iota - // O - key { [ U25CB ] }; // ○ -- White Circle - // P - key { [ U22C6 ] }; // ⋆ -- Should this be a plain asterisk, or the star operator??? - // [ - key { [ U2190 ] }; // ← -- Leftwards Arrow - - // A - key { [ U237A ] }; // ⍺ -- APL Functional Symbol Alpha - // S - key { [ U2308 ] }; // ⌈ -- Left Ceiling - // D - key { [ U230A ] }; // ⌊ -- Left Floor - // F - key { [ underscore ] }; - // G - key { [ U2207 ] }; // ∇ -- Nabla - // H - key { [ U2206 ] }; // ∆ -- Increment - // J - key { [ U2218 ] }; // ∘ -- Ring Operator - // K - key { [ apostrophe ] }; - // L - key { [ U2395 ] }; // ⎕ -- APL Functional Symbol Quad - - // Z - key { [ U2282 ] }; // ⊂ -- Subset Of - // X - key { [ U2283 ] }; // ⊃ -- Superset Of - // C - key { [ U2229 ] }; // ∩ -- Intersection - // V - key { [ U222A ] }; // ∪ -- Union - // B - key { [ U22A5 ] }; // ⊥ -- Up Tack - // N - key { [ U22A4 ] }; // ⊤ -- Down Tack - // M - key { [ U007C ] }; // | -- Vertical Line -}; - -// Keys common to a number of keyboards that allow normal language usage alongside APL -partial alphanumeric_keys modifier_keys -xkb_symbols "unified" { - name[Group1]= "APL Keyboard Symbols: Unified Layout"; - - include "apl(common)" - - // ` - key { [ U22C4 ] }; // ⋄ -- Diamond Operator - key { [ NoSymbol, U2371 ] }; // ⍱ -- APL Functional Symbol Down Caret Tilde - key { [ NoSymbol, U2372 ] }; // ⍲ -- APL Functional Symbol Up Caret Tilde - // - - key { [ U00D7 ] }; // × -- Multiplication Sign - // = - key { [ U00F7, U2339 ] }; // ÷ ⌹ -- Division Sign / APL Functional Symbol Quad Divide - - // ] - key { [ U2192 ] }; // → -- Rightwards Arrow -}; - -// Layout: http://www.wickensonline.co.uk/apl-unicomp.html -default -partial alphanumeric_keys modifier_keys -xkb_symbols "sax" { - name[Group1]= "APL Keyboard Symbols: Sharp APL for Unix"; - - include "apl(unified)" - - key { [ NoSymbol, U00A1 ] }; // ¡ -- Inverted Exclamation Mark - key { [ NoSymbol, cent ] }; - key { [ NoSymbol, U2342 ] }; // ⍂ -- APL Functional Symbol Quad Backslash - // - - key { [ NoSymbol, U2261 ] }; // ≡ -- Identical To - - // Q - key { [ NoSymbol, U00BF ] }; // ¿ -- Inverted Question Mark - // W - key { [ NoSymbol, U233D ] }; // ⌽ -- APL Functional Symbol Circle Stile - // E - key { [ NoSymbol, U2377 ] }; // ⍷ -- APL Functional Symbol Epsilon Underbar - // T - key { [ NoSymbol, U2349 ] }; // ⍉ -- APL Functional Symbol Circle Backslash - // I - key { [ NoSymbol, U2378 ] }; // ⍸ -- APL Functional Symbol Iota Underbar - // O - key { [ NoSymbol, U2365 ] }; // ⍥ -- APL Functional Symbol Circle Diaeresis - // P - key { [ NoSymbol, U235F ] }; // ⍟ -- APL Functional Symbol Circle Star - - // A - key { [ NoSymbol, U2296 ] }; // ⊖ -- Circled Minus - // F - key { [ NoSymbol, U236B ] }; // ⍫ -- APL Functional Symbol Del Tilde - // G - key { [ NoSymbol, U2352 ] }; // ∇ ⍒ -- APL Functional Symbol Del Stile - // H - key { [ NoSymbol, U234B ] }; // ∆ ⍋ -- APL Functional Symbol Delta Stile - // J - key { [ NoSymbol, U2364 ] }; // ⍤ -- APL Functional Symbol Jot Diaeresis - // K - key { [ NoSymbol, U233B ] }; // ⌻ - // L - key { [ NoSymbol, U235E ] }; // ⍞ -- APL Functional Symbol Quote Quad - // ; - key { [ U22A2 ] }; // ⊢ -- Right Tack - // ' - key { [ U22A3 ] }; // ⊣ -- Left Tack - - // C - key { [ NoSymbol, U235D ] }; // ⍝ -- APL Functional Symbol Up Shoe Jot - // B - key { [ NoSymbol, U234E ] }; // ⍎ -- APL Functional Symbol Down Tack Jot (Unicode got the name wrong; it should have been "Up Tack") - // N - key { [ NoSymbol, U2355 ] }; // ⍕ -- APL Functional Symbol Up Tack Jot (Unicode got the name wrong; it should have been "Down Tack") - // M - key { [ NoSymbol, U2336 ] }; // ⌶ -- APL Functional Symbol I-Beam - // , - key { [ U235E, U236A ] }; // ⍞ ⍪ -- APL Functional Symbol Quote Quad / APL Functional Symbol Comma Bar - // . - key { [ U234E, U2359 ] }; // ⍎ ⍙ -- [See B key] / APL Functional Symbol Delta Underbar - // / - key { [ U2355, U233F ] }; // ⍕ ⌿ -- [See N key] / APL Functional Symbol Slash Bar - - key { [ U235D, U2340 ] }; // ⍝ ⍀ -- APL Functional Symbol Up Shoe Jot / APL Functional Symbol Backslash Bar -}; - -// Layout: http://www.wickensonline.co.uk/apl-unicomp.html -partial alphanumeric_keys modifier_keys -xkb_symbols "apl2" { - name[Group1]= "APL Keyboard Symbols: IBM APL2"; - - include "apl(common)" - - // The first column is NoSymbol because it inherits. The second is NoSymbol because those keys don't do anything - - // ` - key { [ NoSymbol, U233B, U2342 ] }; // ⌻ ⍂ -- - key { [ NoSymbol, NoSymbol, U2336 ] }; // ⌶ -- APL Functional Symbol I-Beam - key { [ NoSymbol, NoSymbol, U236B ] }; // ⍫ -- APL Functional Symbol Del Tilde - key { [ NoSymbol, NoSymbol, U2353 ] }; // ⍒ -- APL Functional Symbol Del Stile - key { [ NoSymbol, NoSymbol, U234B ] }; // ⍋ -- APL Functional Symbol Delta Stile - key { [ NoSymbol, NoSymbol, U233D ] }; // ⌽ -- APL Functional Symbol Circle Stile - key { [ NoSymbol, NoSymbol, U2349 ] }; // ⍉ -- APL Functional Symbol Circle Backslash - key { [ NoSymbol, NoSymbol, U2296 ] }; // ⊖ -- Circled Minus - key { [ NoSymbol, NoSymbol, U235F ] }; // ⍟ -- APL Functional Symbol Circle Star - key { [ NoSymbol, NoSymbol, U2371 ] }; // ⍱ -- APL Functional Symbol Down Caret Tilde - key { [ NoSymbol, NoSymbol, U2372 ] }; // ⍲ -- APL Functional Symbol Up Caret Tilde - // - - key { [ plus, minus, exclam ] }; - // = - key { [ U00D7, U00F7, U2339 ] }; // × ÷ ⌹ -- Multiplication Sign / Division Sign / APL Functional Symbol Quad Divide - - // [ - key { [ NoSymbol, U2192, U235E ] }; // (←) → ⍞ -- Rightwards Arrow / APL Functional Symbol Quote Quad - // ] - key { [ U2337, U2378, U2359 ] }; // ⌷ ⍸ ⍙ -- APL Functional Symbol Squish Quad / APL Functional Symbol Iota Underbar / APL Functional Symbol Delta Underbar - - // ; - key { [ bracketleft, parenleft, U234E ] }; // ⍎ -- [See B key in SAX layout] - // ' - key { [ bracketright, parenright, U2355 ] }; // ⍕ -- [See N key in SAX layout] - - // , - key { [ comma, semicolon, U235D ] }; // ⍝ -- APL Functional Symbol Up Shoe Jot - // . - key { [ period, colon, U2340 ] }; // ⍀ -- APL Functional Symbol Backslash Bar - // / - key { [ slash, backslash, U233F ] }; // ⌿ -- APL Functional Symbol Slash Bar - - key { [ U2261, U2377, U2364 ] }; // ≡ ⍷ ⍤ -- Identical To / APL Functional Symbol Epsilon Underbar / APL Functional Symbol Jot Diaeresis -}; - -partial alphanumeric_keys modifier_keys -xkb_symbols "aplplusII" { - name[Group1]= "APL Keyboard Symbols: Manugistics APL*PLUS II"; - - include "apl(apl2)" - - // ` - key { [ dollar, U22C4, U236A ] }; // ⋄ ⍪ -- Diamond Operator / APL Functional Symbol Comma Bar - key { [ NoSymbol, NoSymbol, U2261 ] }; // ≡ -- Identical To - - // [ - key { [ U2190, NoSymbol, U235E ] }; // ← ⍞ -- Leftwards Arrow / APL Functional Symbol Quote Quad - // ] - key { [ U2192, NoSymbol, U236C ] }; // → ⍬ -- Rightwards Arrow / APL Functional Symbol Zilde - - // ; - key { [ bracketleft, parenleft, U234E ] }; // ⍎ -- [See B key in SAX layout] - // ' - key { [ bracketright, parenright, U2355 ] }; // ⍕ -- [See N key in SAX layout] - - key { [ U22A3, U22A2, U2359 ] }; // ⊣ ⊢ ⍙ -- Left Tack / Right Tack / APL Functional Symbol Delta Underbar -}; - - -// MicroAPL layout: http://aplwiki.com/APLXKeyboardLayouts -// I didn't do the old-style MicroAPL layout; patches gratefully accepted -partial alphanumeric_keys modifier_keys -xkb_symbols "aplx" { - name[Group1]= "APL Keyboard Symbols: APLX Unified APL Layout"; - - include "apl(unified)" - - // ` - key { [ NoSymbol, U235E ] }; // ⍞ -- APL Functional Symbol Quote Quad - key { [ NoSymbol, U2336 ] }; // ⌶ -- APL Functional Symbol I-Beam - key { [ NoSymbol, U236B ] }; // ⍫ -- APL Functional Symbol Del Tilde - key { [ NoSymbol, U2353 ] }; // ⍒ -- APL Functional Symbol Del Stile - key { [ NoSymbol, U234B ] }; // ⍋ -- APL Functional Symbol Delta Stile - key { [ NoSymbol, U233D ] }; // ⌽ -- APL Functional Symbol Circle Stile - key { [ NoSymbol, U2349 ] }; // ⍉ -- APL Functional Symbol Circle Backslash - key { [ NoSymbol, U2296 ] }; // ⊖ -- Circled Minus - key { [ NoSymbol, U235F ] }; // ⍟ -- APL Functional Symbol Circle Star - // - - key { [ NoSymbol, exclam ] }; - - // [ - key { [ NoSymbol, U2347 ] }; // ⍇ -- Box With Left Arrow - // ] - key { [ NoSymbol, U2348 ] }; // ⍈ -- Box With Right Arrow - - // ; - key { [ U234E, U2261 ] }; // ⍎ ≡ -- [See B key in SAX layout] / Identical To - // ' - key { [ U2355, U2262 ] }; // ⍕ ≢ -- [See N key in SAX layout] / Not Identical To - - // , - key { [ U235D, U236A ] }; // ⍝ ⍪ -- APL Functional Symbol Up Shoe Jot / APL Functional Symbol Comma Bar - // . - key { [ U2340, U2364 ] }; // ⍀ ⍤ -- APL Functional Symbol Backslash Bar / APL Functional Symbol Jot Diaeresis - // / - key { [ U233F ] }; // ⌿ -- APL Functional Symbol Slash Bar - - key { [ U22A3, U22A3 ] }; // ⊣ ⊢ -- Left Tack / Right Tack -}; - - +// APL Keyboard Layouts + +// This file supports: +// - The Sharp APL for Unix (SAX) layout +// - The IBM APL2 layout +// - The Manugistics APL*PLUS II (Version 5.1, 1993) keyboard layout + +// Unicode APL table: http://aplwiki.com/UnicodeAplTable +// ...and another: http://publibfp.boulder.ibm.com/epubs/pdf/h2110611.pdf (appendix A) +// Generic Unicode stuff: http://www.fileformat.info/info/unicode/category/index.htm + +// Tim Nelson (this file's creator) says: + +// This file doesn't deal with all the combining stuff -- I'm not an APL programmer, +// and am not quite sure what's needed here. However, it may be possible to get this +// working with dead keys and the like. Patches gratefully accepted. + +// Some of the shift-key assignments may differ from the APL tradition. If +// that's not considered acceptable, it should be possible to remap the +// shift keys. I have striven, however, to ensure that the use of shift keys +// in these maps is at least self-consistent. + +// I'm assuming that this will be used with another keyboard layout (ie. for +// your language), with a special shift key to use these maps. + +partial alphanumeric_keys modifier_keys +xkb_symbols "common" { + name[Group1]= "APL"; + + key { [ diaeresis ] }; + key { [ U00AF ] }; // ¯ -- Macron + key { [ less ] }; + key { [ U2264 ] }; // ≤ -- Less-than Or Equal To + key { [ equal ] }; + key { [ U2265 ] }; // ≥ -- Greater-than Or Equal To + key { [ greater ] }; + key { [ U2260 ] }; // ≠ -- Not Equal To + key { [ U2228 ] }; // ∨ -- Logical Or + key { [ U2227 ] }; // ∧ -- Logical And + + // Q + key { [ question ] }; + // W + key { [ U2375 ] }; // ⍵ -- APL Functional Symbol Omega + // E + key { [ U220A ] }; // ∊ -- Small Element Of + // R + key { [ U2374 ] }; // ⍴ -- APL Functional Symbol Rho + // T + key { [ asciitilde ] }; + // Y + key { [ U2191 ] }; // ↑ -- Upwards Arrow + // U + key { [ U2193 ] }; // ↓ -- Downwards Arrow + // I + key { [ U2373 ] }; // ⍳ -- APL Functional Symbol Iota + // O + key { [ U25CB ] }; // ○ -- White Circle + // P + key { [ U22C6 ] }; // ⋆ -- Should this be a plain asterisk, or the star operator??? + // [ + key { [ U2190 ] }; // ← -- Leftwards Arrow + + // A + key { [ U237A ] }; // ⍺ -- APL Functional Symbol Alpha + // S + key { [ U2308 ] }; // ⌈ -- Left Ceiling + // D + key { [ U230A ] }; // ⌊ -- Left Floor + // F + key { [ underscore ] }; + // G + key { [ U2207 ] }; // ∇ -- Nabla + // H + key { [ U2206 ] }; // ∆ -- Increment + // J + key { [ U2218 ] }; // ∘ -- Ring Operator + // K + key { [ apostrophe ] }; + // L + key { [ U2395 ] }; // ⎕ -- APL Functional Symbol Quad + + // Z + key { [ U2282 ] }; // ⊂ -- Subset Of + // X + key { [ U2283 ] }; // ⊃ -- Superset Of + // C + key { [ U2229 ] }; // ∩ -- Intersection + // V + key { [ U222A ] }; // ∪ -- Union + // B + key { [ U22A5 ] }; // ⊥ -- Up Tack + // N + key { [ U22A4 ] }; // ⊤ -- Down Tack + // M + key { [ U007C ] }; // | -- Vertical Line +}; + +// Keys common to a number of keyboards that allow normal language usage alongside APL +partial alphanumeric_keys modifier_keys +xkb_symbols "unified" { + name[Group1]= "APL Keyboard Symbols: Unified Layout"; + + include "apl(common)" + + // ` + key { [ U22C4 ] }; // ⋄ -- Diamond Operator + key { [ NoSymbol, U2371 ] }; // ⍱ -- APL Functional Symbol Down Caret Tilde + key { [ NoSymbol, U2372 ] }; // ⍲ -- APL Functional Symbol Up Caret Tilde + // - + key { [ U00D7 ] }; // × -- Multiplication Sign + // = + key { [ U00F7, U2339 ] }; // ÷ ⌹ -- Division Sign / APL Functional Symbol Quad Divide + + // ] + key { [ U2192 ] }; // → -- Rightwards Arrow +}; + +// Layout: http://www.wickensonline.co.uk/apl-unicomp.html +default +partial alphanumeric_keys modifier_keys +xkb_symbols "sax" { + name[Group1]= "APL Keyboard Symbols: Sharp APL for Unix"; + + include "apl(unified)" + + key { [ NoSymbol, U00A1 ] }; // ¡ -- Inverted Exclamation Mark + key { [ NoSymbol, cent ] }; + key { [ NoSymbol, U2342 ] }; // ⍂ -- APL Functional Symbol Quad Backslash + // - + key { [ NoSymbol, U2261 ] }; // ≡ -- Identical To + + // Q + key { [ NoSymbol, U00BF ] }; // ¿ -- Inverted Question Mark + // W + key { [ NoSymbol, U233D ] }; // ⌽ -- APL Functional Symbol Circle Stile + // E + key { [ NoSymbol, U2377 ] }; // ⍷ -- APL Functional Symbol Epsilon Underbar + // T + key { [ NoSymbol, U2349 ] }; // ⍉ -- APL Functional Symbol Circle Backslash + // I + key { [ NoSymbol, U2378 ] }; // ⍸ -- APL Functional Symbol Iota Underbar + // O + key { [ NoSymbol, U2365 ] }; // ⍥ -- APL Functional Symbol Circle Diaeresis + // P + key { [ NoSymbol, U235F ] }; // ⍟ -- APL Functional Symbol Circle Star + + // A + key { [ NoSymbol, U2296 ] }; // ⊖ -- Circled Minus + // F + key { [ NoSymbol, U236B ] }; // ⍫ -- APL Functional Symbol Del Tilde + // G + key { [ NoSymbol, U2352 ] }; // ∇ ⍒ -- APL Functional Symbol Del Stile + // H + key { [ NoSymbol, U234B ] }; // ∆ ⍋ -- APL Functional Symbol Delta Stile + // J + key { [ NoSymbol, U2364 ] }; // ⍤ -- APL Functional Symbol Jot Diaeresis + // K + key { [ NoSymbol, U233B ] }; // ⌻ + // L + key { [ NoSymbol, U235E ] }; // ⍞ -- APL Functional Symbol Quote Quad + // ; + key { [ U22A2 ] }; // ⊢ -- Right Tack + // ' + key { [ U22A3 ] }; // ⊣ -- Left Tack + + // C + key { [ NoSymbol, U235D ] }; // ⍝ -- APL Functional Symbol Up Shoe Jot + // B + key { [ NoSymbol, U234E ] }; // ⍎ -- APL Functional Symbol Down Tack Jot (Unicode got the name wrong; it should have been "Up Tack") + // N + key { [ NoSymbol, U2355 ] }; // ⍕ -- APL Functional Symbol Up Tack Jot (Unicode got the name wrong; it should have been "Down Tack") + // M + key { [ NoSymbol, U2336 ] }; // ⌶ -- APL Functional Symbol I-Beam + // , + key { [ U235E, U236A ] }; // ⍞ ⍪ -- APL Functional Symbol Quote Quad / APL Functional Symbol Comma Bar + // . + key { [ U234E, U2359 ] }; // ⍎ ⍙ -- [See B key] / APL Functional Symbol Delta Underbar + // / + key { [ U2355, U233F ] }; // ⍕ ⌿ -- [See N key] / APL Functional Symbol Slash Bar + + key { [ U235D, U2340 ] }; // ⍝ ⍀ -- APL Functional Symbol Up Shoe Jot / APL Functional Symbol Backslash Bar +}; + +// Layout: http://www.wickensonline.co.uk/apl-unicomp.html +partial alphanumeric_keys modifier_keys +xkb_symbols "apl2" { + name[Group1]= "APL Keyboard Symbols: IBM APL2"; + + include "apl(common)" + + // The first column is NoSymbol because it inherits. The second is NoSymbol because those keys don't do anything + + // ` + key { [ NoSymbol, U233B, U2342 ] }; // ⌻ ⍂ -- + key { [ NoSymbol, NoSymbol, U2336 ] }; // ⌶ -- APL Functional Symbol I-Beam + key { [ NoSymbol, NoSymbol, U236B ] }; // ⍫ -- APL Functional Symbol Del Tilde + key { [ NoSymbol, NoSymbol, U2353 ] }; // ⍒ -- APL Functional Symbol Del Stile + key { [ NoSymbol, NoSymbol, U234B ] }; // ⍋ -- APL Functional Symbol Delta Stile + key { [ NoSymbol, NoSymbol, U233D ] }; // ⌽ -- APL Functional Symbol Circle Stile + key { [ NoSymbol, NoSymbol, U2349 ] }; // ⍉ -- APL Functional Symbol Circle Backslash + key { [ NoSymbol, NoSymbol, U2296 ] }; // ⊖ -- Circled Minus + key { [ NoSymbol, NoSymbol, U235F ] }; // ⍟ -- APL Functional Symbol Circle Star + key { [ NoSymbol, NoSymbol, U2371 ] }; // ⍱ -- APL Functional Symbol Down Caret Tilde + key { [ NoSymbol, NoSymbol, U2372 ] }; // ⍲ -- APL Functional Symbol Up Caret Tilde + // - + key { [ plus, minus, exclam ] }; + // = + key { [ U00D7, U00F7, U2339 ] }; // × ÷ ⌹ -- Multiplication Sign / Division Sign / APL Functional Symbol Quad Divide + + // [ + key { [ NoSymbol, U2192, U235E ] }; // (←) → ⍞ -- Rightwards Arrow / APL Functional Symbol Quote Quad + // ] + key { [ U2337, U2378, U2359 ] }; // ⌷ ⍸ ⍙ -- APL Functional Symbol Squish Quad / APL Functional Symbol Iota Underbar / APL Functional Symbol Delta Underbar + + // ; + key { [ bracketleft, parenleft, U234E ] }; // ⍎ -- [See B key in SAX layout] + // ' + key { [ bracketright, parenright, U2355 ] }; // ⍕ -- [See N key in SAX layout] + + // , + key { [ comma, semicolon, U235D ] }; // ⍝ -- APL Functional Symbol Up Shoe Jot + // . + key { [ period, colon, U2340 ] }; // ⍀ -- APL Functional Symbol Backslash Bar + // / + key { [ slash, backslash, U233F ] }; // ⌿ -- APL Functional Symbol Slash Bar + + key { [ U2261, U2377, U2364 ] }; // ≡ ⍷ ⍤ -- Identical To / APL Functional Symbol Epsilon Underbar / APL Functional Symbol Jot Diaeresis +}; + +partial alphanumeric_keys modifier_keys +xkb_symbols "aplplusII" { + name[Group1]= "APL Keyboard Symbols: Manugistics APL*PLUS II"; + + include "apl(apl2)" + + // ` + key { [ dollar, U22C4, U236A ] }; // ⋄ ⍪ -- Diamond Operator / APL Functional Symbol Comma Bar + key { [ NoSymbol, NoSymbol, U2261 ] }; // ≡ -- Identical To + + // [ + key { [ U2190, NoSymbol, U235E ] }; // ← ⍞ -- Leftwards Arrow / APL Functional Symbol Quote Quad + // ] + key { [ U2192, NoSymbol, U236C ] }; // → ⍬ -- Rightwards Arrow / APL Functional Symbol Zilde + + // ; + key { [ bracketleft, parenleft, U234E ] }; // ⍎ -- [See B key in SAX layout] + // ' + key { [ bracketright, parenright, U2355 ] }; // ⍕ -- [See N key in SAX layout] + + key { [ U22A3, U22A2, U2359 ] }; // ⊣ ⊢ ⍙ -- Left Tack / Right Tack / APL Functional Symbol Delta Underbar +}; + + +// MicroAPL layout: http://aplwiki.com/APLXKeyboardLayouts +// I didn't do the old-style MicroAPL layout; patches gratefully accepted +partial alphanumeric_keys modifier_keys +xkb_symbols "aplx" { + name[Group1]= "APL Keyboard Symbols: APLX Unified APL Layout"; + + include "apl(unified)" + + // ` + key { [ NoSymbol, U235E ] }; // ⍞ -- APL Functional Symbol Quote Quad + key { [ NoSymbol, U2336 ] }; // ⌶ -- APL Functional Symbol I-Beam + key { [ NoSymbol, U236B ] }; // ⍫ -- APL Functional Symbol Del Tilde + key { [ NoSymbol, U2353 ] }; // ⍒ -- APL Functional Symbol Del Stile + key { [ NoSymbol, U234B ] }; // ⍋ -- APL Functional Symbol Delta Stile + key { [ NoSymbol, U233D ] }; // ⌽ -- APL Functional Symbol Circle Stile + key { [ NoSymbol, U2349 ] }; // ⍉ -- APL Functional Symbol Circle Backslash + key { [ NoSymbol, U2296 ] }; // ⊖ -- Circled Minus + key { [ NoSymbol, U235F ] }; // ⍟ -- APL Functional Symbol Circle Star + // - + key { [ NoSymbol, exclam ] }; + + // [ + key { [ NoSymbol, U2347 ] }; // ⍇ -- Box With Left Arrow + // ] + key { [ NoSymbol, U2348 ] }; // ⍈ -- Box With Right Arrow + + // ; + key { [ U234E, U2261 ] }; // ⍎ ≡ -- [See B key in SAX layout] / Identical To + // ' + key { [ U2355, U2262 ] }; // ⍕ ≢ -- [See N key in SAX layout] / Not Identical To + + // , + key { [ U235D, U236A ] }; // ⍝ ⍪ -- APL Functional Symbol Up Shoe Jot / APL Functional Symbol Comma Bar + // . + key { [ U2340, U2364 ] }; // ⍀ ⍤ -- APL Functional Symbol Backslash Bar / APL Functional Symbol Jot Diaeresis + // / + key { [ U233F ] }; // ⌿ -- APL Functional Symbol Slash Bar + + key { [ U22A3, U22A3 ] }; // ⊣ ⊢ -- Left Tack / Right Tack +}; diff --git a/xorg-server/xkeyboard-config/symbols/extras/ru b/xorg-server/xkeyboard-config/symbols/extras/ru index 65ea58653..b872be3d8 100644 --- a/xorg-server/xkeyboard-config/symbols/extras/ru +++ b/xorg-server/xkeyboard-config/symbols/extras/ru @@ -56,4 +56,3 @@ xkb_symbols "chu" key { [ Cyrillic_yu, Cyrillic_YU, U2DFB ] }; key { [ period, comma, semicolon, exclam ] }; }; - diff --git a/xorg-server/xkeyboard-config/symbols/extras/us b/xorg-server/xkeyboard-config/symbols/extras/us index b58932c6a..45d9954cf 100644 --- a/xorg-server/xkeyboard-config/symbols/extras/us +++ b/xorg-server/xkeyboard-config/symbols/extras/us @@ -1,147 +1,146 @@ -// XCompose is out! Unicode combining is in! For those of us who live -// on the edge: A keymap using Unicode combining characters instead of -// deadkeys. This variation does not deviate from the lame MS-style -// US-intl layout; but it uses AltGr for combining, like altgr-intl. -// -// This might break your font layout layout systems (because they -// suck), caveat emptor. Also, most of today's software will count -// individual combining marks for selection, deletion, character -// counting &c., and won't be smart enough to do canonical equivalence -// when searching, &c. -// -// With Unicode combining you use "handwriting order", not -// "typewriting order" as with deadkeys. That is, you first type the -// base character, then the diacritics/accents/modifiers. This has -// the advantage of avoiding hidden states --- each keypress changes -// something on screen. -// -// TODO: as of now, this duplicates all us(intl) functionality with -// combining. With care, perhaps we could add more combining marks -// not present in intl, and support all major languages. -partial alphanumeric_keys -xkb_symbols "intl-unicode" { - - name[Group1]= "USA - International (AltGr Unicode combining)"; - - include "us(intl)" - include "level3(ralt_switch)" - - // grave, tilde - key { [grave, asciitilde, U0300, U0303 ] }; - // double acute - key { [ 2, at, twosuperior, U030B ] }; - // macron - key { [ 3, numbersign, threesuperior, U0304 ] }; - // circumflex - key { [ 6, asciicircum, onequarter, U0302 ] }; - // horn - key { [ 7, ampersand, onehalf, U031B ] }; - // ogonek - key { [ 8, asterisk, threequarters, U0328 ] }; - // breve - key { [ 9, parenleft, leftsinglequotemark, U0306 ] }; - // abovering - key { [ 0, parenright, rightsinglequotemark, U030A ] }; - - // belowdot - key { [ minus, underscore, yen, U0323 ] }; - // acute, diaeresis - key { [apostrophe, quotedbl, U0301, U0308 ] }; - // abovedot, caron - key { [ period, greater, U0307, U030C ] }; - // hook - key { [ slash, question, questiondown, 0309 ] }; - - // alt-intl compatibility - // cedilla, caron - key { [ comma, less, U0327, U030C ] }; - // ogonek, diaeresis - key { [ semicolon, colon, U0328, U0308 ] }; - // doubleacute, horn - key { [ equal, plus, U030B, U031B ] }; - - // we don't do combining latin letters and combining enclosures - // because support for those is very rare. -}; - -// XCompose is out! Unicode combining is in! For those of us who live -// on the edge: A keymap using Unicode combining characters instead of -// deadkeys. This variation does break compatibility with us-intl, -// whenever I thought it would be more mnemonic or Unicodeish. -partial alphanumeric_keys -xkb_symbols "alt-intl-unicode" { - - name[Group1]= "USA - International (AltGr Unicode combining, alternative)"; - - include "extras/us(intl-unicode)" - include "level3(ralt_switch)" - - // easier macron; em-dash. - // em-dash is available via compose, but I added here since it's such - // an important typographic character. - key { [ minus, underscore, U0304, U2014 ] }; - - // belowdot, abovedot (caron at coma/less key, per above) - key { [ period, greater, U0323, U0307 ] }; - -}; - -partial alphanumeric_keys -xkb_symbols "ats" { - - include "us" - - name[Group1]= "USA - Atsina"; - - //Using Dead key to get COMBINING COMMA ABOVE for ejectives on - //q, l, t, s, m, g, k, p, w, y, r - //XCompose key is used for the other accute and grave. - - key { [ e, E, eacute, Eacute ] }; - key { [ u, U, uacute, Uacute ] }; - key { [ i, I, iacute, Iacute ] }; - key { [ o, O, oacute, Oacute ] }; - key { [ bracketleft, braceleft, U03B8 ] }; - key { [ bracketright, braceright, U010D, U010C ] }; - //U+010C (uppercase Č) and U+010D (lowercase č). - - key { [ a, A, aacute, Aacute ] }; - - - //Small letter Open use compose to key get acute accent - key { [ c, C, U0254, U0186 ] }; - key { [ comma, less, U0313 ] }; - key { [ slash, question, U0294 ] }; - - include "level3(ralt_switch)" - include "compose(rctrl)" -}; - -partial alphanumeric_keys -xkb_symbols "crd" { - - include "us" - - name[Group1]= "USA - Couer D'alene Salish"; - - // Alphanumeric section - key { [ w, W, U02B7, U02B7 ] }; - key { [ 7, ampersand, U0294 ] }; - key { [ q, Q, U221A ] }; - key { [ v, V, U0259 ] }; - key { [ backslash, bar, U026B ] }; - key { [ e, E, U025B ] }; - key { [ i, I, U026A ] }; - key { [ j, J, U01F0 ] }; - key { [ 6, asciicircum, U0295 ] }; - key { [ s, S, U0161 ] }; - key { [ c, C, U010D ] }; - key { [ o, O, U0254 ] }; - key { [ period, greater, U0323 ] }; - - include "level3(ralt_switch)" - include "compose(rctrl)" - - // End alphanumeric section -}; - +// XCompose is out! Unicode combining is in! For those of us who live +// on the edge: A keymap using Unicode combining characters instead of +// deadkeys. This variation does not deviate from the lame MS-style +// US-intl layout; but it uses AltGr for combining, like altgr-intl. +// +// This might break your font layout layout systems (because they +// suck), caveat emptor. Also, most of today's software will count +// individual combining marks for selection, deletion, character +// counting &c., and won't be smart enough to do canonical equivalence +// when searching, &c. +// +// With Unicode combining you use "handwriting order", not +// "typewriting order" as with deadkeys. That is, you first type the +// base character, then the diacritics/accents/modifiers. This has +// the advantage of avoiding hidden states --- each keypress changes +// something on screen. +// +// TODO: as of now, this duplicates all us(intl) functionality with +// combining. With care, perhaps we could add more combining marks +// not present in intl, and support all major languages. +partial alphanumeric_keys +xkb_symbols "intl-unicode" { + + name[Group1]= "USA - International (AltGr Unicode combining)"; + + include "us(intl)" + include "level3(ralt_switch)" + + // grave, tilde + key { [grave, asciitilde, U0300, U0303 ] }; + // double acute + key { [ 2, at, twosuperior, U030B ] }; + // macron + key { [ 3, numbersign, threesuperior, U0304 ] }; + // circumflex + key { [ 6, asciicircum, onequarter, U0302 ] }; + // horn + key { [ 7, ampersand, onehalf, U031B ] }; + // ogonek + key { [ 8, asterisk, threequarters, U0328 ] }; + // breve + key { [ 9, parenleft, leftsinglequotemark, U0306 ] }; + // abovering + key { [ 0, parenright, rightsinglequotemark, U030A ] }; + + // belowdot + key { [ minus, underscore, yen, U0323 ] }; + // acute, diaeresis + key { [apostrophe, quotedbl, U0301, U0308 ] }; + // abovedot, caron + key { [ period, greater, U0307, U030C ] }; + // hook + key { [ slash, question, questiondown, 0309 ] }; + + // alt-intl compatibility + // cedilla, caron + key { [ comma, less, U0327, U030C ] }; + // ogonek, diaeresis + key { [ semicolon, colon, U0328, U0308 ] }; + // doubleacute, horn + key { [ equal, plus, U030B, U031B ] }; + + // we don't do combining latin letters and combining enclosures + // because support for those is very rare. +}; + +// XCompose is out! Unicode combining is in! For those of us who live +// on the edge: A keymap using Unicode combining characters instead of +// deadkeys. This variation does break compatibility with us-intl, +// whenever I thought it would be more mnemonic or Unicodeish. +partial alphanumeric_keys +xkb_symbols "alt-intl-unicode" { + + name[Group1]= "USA - International (AltGr Unicode combining, alternative)"; + + include "extras/us(intl-unicode)" + include "level3(ralt_switch)" + + // easier macron; em-dash. + // em-dash is available via compose, but I added here since it's such + // an important typographic character. + key { [ minus, underscore, U0304, U2014 ] }; + + // belowdot, abovedot (caron at coma/less key, per above) + key { [ period, greater, U0323, U0307 ] }; + +}; + +partial alphanumeric_keys +xkb_symbols "ats" { + + include "us" + + name[Group1]= "USA - Atsina"; + + //Using Dead key to get COMBINING COMMA ABOVE for ejectives on + //q, l, t, s, m, g, k, p, w, y, r + //XCompose key is used for the other accute and grave. + + key { [ e, E, eacute, Eacute ] }; + key { [ u, U, uacute, Uacute ] }; + key { [ i, I, iacute, Iacute ] }; + key { [ o, O, oacute, Oacute ] }; + key { [ bracketleft, braceleft, U03B8 ] }; + key { [ bracketright, braceright, U010D, U010C ] }; + //U+010C (uppercase Č) and U+010D (lowercase č). + + key { [ a, A, aacute, Aacute ] }; + + + //Small letter Open use compose to key get acute accent + key { [ c, C, U0254, U0186 ] }; + key { [ comma, less, U0313 ] }; + key { [ slash, question, U0294 ] }; + + include "level3(ralt_switch)" + include "compose(rctrl)" +}; + +partial alphanumeric_keys +xkb_symbols "crd" { + + include "us" + + name[Group1]= "USA - Couer D'alene Salish"; + + // Alphanumeric section + key { [ w, W, U02B7, U02B7 ] }; + key { [ 7, ampersand, U0294 ] }; + key { [ q, Q, U221A ] }; + key { [ v, V, U0259 ] }; + key { [ backslash, bar, U026B ] }; + key { [ e, E, U025B ] }; + key { [ i, I, U026A ] }; + key { [ j, J, U01F0 ] }; + key { [ 6, asciicircum, U0295 ] }; + key { [ s, S, U0161 ] }; + key { [ c, C, U010D ] }; + key { [ o, O, U0254 ] }; + key { [ period, greater, U0323 ] }; + + include "level3(ralt_switch)" + include "compose(rctrl)" + + // End alphanumeric section +}; diff --git a/xorg-server/xkeyboard-config/symbols/fi b/xorg-server/xkeyboard-config/symbols/fi index 9d0f6247e..35c9da7a4 100644 --- a/xorg-server/xkeyboard-config/symbols/fi +++ b/xorg-server/xkeyboard-config/symbols/fi @@ -1,208 +1,206 @@ -// -// $XKeyboardConfig$ -// -// X keyboard maps for Finland -// -// SFS 5966 / Kotoistus keymap created by Troy Korjuslommi -// Classic keymap based on traditional by Marko Myllynen -// Eliminate deadkeys alternative sent by Linus Torvalds -// - -// -// Missing from X11/keysymdef.h as of 2010-05-13 -// -// U2030 # PER MILLE SIGN -// U0292 # LATIN SMALL LETTER EZH -// U01B7 # LATIN CAPITAL LETTER EZH -// - -partial alphanumeric_keys default -xkb_symbols "kotoistus" { - - // Official keymap for Finland based on SFS 5966 standard - // - // This keymap implements all the functionality of Annex 1 - // of the standard and additionally defines the following to - // allow entering these characters with keyboars without LSGT. - // - // AE08+4, U+003C : LESS-THAN SIGN (less) - // AE09+4, U+003E : GREATER-THAN SIGN (greater) - // AD08+4, U+007C : VERTICAL LINE (bar) - // - // Annex 3 of the standard is implemented in fi_FI.UTF-8/Compose - - name[Group1]="Finland"; - - key { [ section, onehalf, dead_stroke, NoSymbol ] }; - key { [ 1, exclam, NoSymbol, exclamdown ] }; - key { [ 2, quotedbl, at, rightdoublequotemark ] }; - key { [ 3, numbersign, sterling, guillemotright ] }; - key { [ 4, currency, dollar, guillemotleft ] }; - key { [ 5, percent, U2030, leftdoublequotemark ] }; - key { [ 6, ampersand, singlelowquotemark, doublelowquotemark ] }; - key { [ 7, slash, braceleft, NoSymbol ] }; - key { [ 8, parenleft, bracketleft, less ] }; - key { [ 9, parenright, bracketright, greater ] }; - key { [ 0, equal, braceright, degree ] }; - key { [ plus, question, backslash, questiondown ] }; - key { [ dead_acute, dead_grave, dead_cedilla, dead_ogonek ] }; - - key { [ q, Q, q, Q ] }; - key { [ w, W, w, W ] }; - key { [ e, E, EuroSign, NoSymbol ] }; - key { [ r, R, r, R ] }; - key { [ t, T, thorn, THORN ] }; - key { [ y, Y, y, Y ] }; - key { [ u, U, u, U ] }; - key { [ i, I, idotless, bar ] }; - key { [ o, O, oe, OE ] }; - key { [ p, P, dead_horn, dead_hook ] }; - key { [ aring, Aring, dead_doubleacute, dead_abovering ] }; - key { [ dead_diaeresis, dead_circumflex, dead_tilde, dead_macron ] }; - - key { [ a, A, schwa, SCHWA ] }; - key { [ s, S, ssharp, NoSymbol ] }; - key { [ d, D, eth, ETH ] }; - key { [ f, F, f, F ] }; - key { [ g, G, g, G ] }; - key { [ h, H, h, H ] }; - key { [ j, J, j, J ] }; - key { [ k, K, kra, NoSymbol ] }; - key { [ l, L, dead_stroke, NoSymbol ] }; - key { [ odiaeresis, Odiaeresis, oslash, Oslash ] }; - key { [ adiaeresis, Adiaeresis, ae, AE ] }; - key { [ apostrophe, asterisk, dead_caron, dead_breve ] }; - - key { [ less, greater, bar, NoSymbol ] }; - key { [ z, Z, U0292, U01B7 ] }; - key { [ x, X, multiply, periodcentered ] }; - key { [ c, C, c, C ] }; - key { [ v, V, v, V ] }; - key { [ b, B, b, B ] }; - key { [ n, N, eng, ENG ] }; - key { [ m, M, mu, emdash ] }; - key { [ comma, semicolon, rightsinglequotemark, leftsinglequotemark ] }; - key { [ period, colon, dead_belowdot, dead_abovedot ] }; - key { [ minus, underscore, endash, dead_belowcomma ] }; - - include "nbsp(level4)" - include "nbsp(level3)" - include "kpdl(comma)" - include "level3(ralt_switch)" - include "compose(rwin)" -}; - -partial alphanumeric_keys -xkb_symbols "classic" { - - include "fi(fi)" - - name[Group1]="Finland - Classic"; -}; - -partial alphanumeric_keys hidden -xkb_symbols "fi" { - - // Classic Finnish keyboard layout with dead keys support - // and all ISO-8859-1 and ISO-8859-15 characters available - - key { [ section, onehalf, onequarter, threequarters ] }; - key { [ 1, exclam, exclamdown, onesuperior ] }; - key { [ 2, quotedbl, at, twosuperior ] }; - key { [ 3, numbersign, sterling, threesuperior ] }; - key { [ 4, currency, dollar, cent ] }; - key { [ 5, percent, EuroSign, masculine ] }; - key { [ 6, ampersand, yen, ordfeminine ] }; - key { [ 7, slash, braceleft, plusminus ] }; - key { [ 8, parenleft, bracketleft, guillemotleft ] }; - key { [ 9, parenright, bracketright, guillemotright ] }; - key { [ 0, equal, braceright, degree ] }; - key { [ plus, question, backslash, questiondown ] }; - key { [ dead_acute, dead_grave, dead_cedilla, dead_ogonek ] }; - - key { [ q, Q, q, Q ] }; - key { [ w, W, w, W ] }; - key { [ e, E, EuroSign, cent ] }; - key { [ r, R, registered, NoSymbol ] }; - key { [ t, T, thorn, THORN ] }; - key { [ y, Y, y, Y ] }; - key { [ u, U, u, U ] }; - key { [ i, I, idotless, bar ] }; - key { [ o, O, o, O ] }; - key { [ p, P, paragraph, NoSymbol ] }; - key { [ aring, Aring, oe, OE ] }; - key { [ dead_diaeresis, dead_circumflex, dead_tilde, dead_caron ] }; - - key { [ a, A, schwa, SCHWA ] }; - key { [ s, S, scaron, Scaron ] }; - key { [ d, D, eth, ETH ] }; - key { [ f, F, f, F ] }; - key { [ g, G, eng, ENG ] }; - key { [ h, H, h, H ] }; - key { [ j, J, j, J ] }; - key { [ k, K, kra, NoSymbol ] }; - key { [ l, L, dead_stroke, NoSymbol ] }; - key { [ odiaeresis, Odiaeresis, oslash, Oslash ] }; - key { [ adiaeresis, Adiaeresis, ae, AE ] }; - key { [ apostrophe, asterisk, dead_caron, dead_breve ] }; - - key { [ less, greater, bar, brokenbar ] }; - key { [ z, Z, zcaron, Zcaron ] }; - key { [ x, X, multiply, division ] }; - key { [ c, C, copyright, cent ] }; - key { [ v, V, v, V ] }; - key { [ b, B, ssharp, NoSymbol ] }; - key { [ n, N, ntilde, Ntilde ] }; - key { [ m, M, mu, NoSymbol ] }; - key { [ comma, semicolon, dead_cedilla, dead_ogonek ] }; - key { [ period, colon, periodcentered, notsign ] }; - key { [ minus, underscore, hyphen, dead_macron ] }; - - include "nbsp(level4)" - include "kpdl(comma)" - include "level3(ralt_switch)" - include "compose(rwin)" -}; - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - - // Classic Finnish keyboard layout without dead keys - - include "fi(fi)" - - name[Group1]="Finland - Classic, eliminate dead keys"; - - key { [ acute, grave, cedilla, ogonek ] }; - key { [ diaeresis, asciicircum, asciitilde, caron ] }; - key { [ l, L, l, L ] }; - key { [ apostrophe, asterisk, caron, breve ] }; - key { [ comma, semicolon, cedilla, ogonek ] }; - key { [ minus, underscore, hyphen, macron ] }; -}; - -partial alphanumeric_keys -xkb_symbols "smi" { - - // Describes the differences between a Norwegian Northern Sami - // (keyboard with dead key support) and a Swedish/Finnish Sami - // keyboard according to the specs at: - // http://www.hum.uit.no/a/trond/se-lat9-sefi-keys.html - - include "no(smi)" - - name[Group1]="Finland - Northern Saami"; - - key { [ odiaeresis, Odiaeresis, oslash, Oslash ] }; - key { [ adiaeresis, Adiaeresis, ae, AE ] }; -}; - -partial alphanumeric_keys -xkb_symbols "mac" { - - // Macintosh keyboard for Finland based on Swedish(Macintosh) keyboard - - include "se(mac)" - - name[Group1]="Finland - Macintosh"; -}; +// +// X keyboard maps for Finland +// +// SFS 5966 / Kotoistus keymap created by Troy Korjuslommi +// Classic keymap based on traditional by Marko Myllynen +// Eliminate deadkeys alternative sent by Linus Torvalds +// + +// +// Missing from X11/keysymdef.h as of 2010-05-13 +// +// U2030 # PER MILLE SIGN +// U0292 # LATIN SMALL LETTER EZH +// U01B7 # LATIN CAPITAL LETTER EZH +// + +partial alphanumeric_keys default +xkb_symbols "kotoistus" { + + // Official keymap for Finland based on SFS 5966 standard + // + // This keymap implements all the functionality of Annex 1 + // of the standard and additionally defines the following to + // allow entering these characters with keyboars without LSGT. + // + // AE08+4, U+003C : LESS-THAN SIGN (less) + // AE09+4, U+003E : GREATER-THAN SIGN (greater) + // AD08+4, U+007C : VERTICAL LINE (bar) + // + // Annex 3 of the standard is implemented in fi_FI.UTF-8/Compose + + name[Group1]="Finland"; + + key { [ section, onehalf, dead_stroke, NoSymbol ] }; + key { [ 1, exclam, NoSymbol, exclamdown ] }; + key { [ 2, quotedbl, at, rightdoublequotemark ] }; + key { [ 3, numbersign, sterling, guillemotright ] }; + key { [ 4, currency, dollar, guillemotleft ] }; + key { [ 5, percent, U2030, leftdoublequotemark ] }; + key { [ 6, ampersand, singlelowquotemark, doublelowquotemark ] }; + key { [ 7, slash, braceleft, NoSymbol ] }; + key { [ 8, parenleft, bracketleft, less ] }; + key { [ 9, parenright, bracketright, greater ] }; + key { [ 0, equal, braceright, degree ] }; + key { [ plus, question, backslash, questiondown ] }; + key { [ dead_acute, dead_grave, dead_cedilla, dead_ogonek ] }; + + key { [ q, Q, q, Q ] }; + key { [ w, W, w, W ] }; + key { [ e, E, EuroSign, NoSymbol ] }; + key { [ r, R, r, R ] }; + key { [ t, T, thorn, THORN ] }; + key { [ y, Y, y, Y ] }; + key { [ u, U, u, U ] }; + key { [ i, I, idotless, bar ] }; + key { [ o, O, oe, OE ] }; + key { [ p, P, dead_horn, dead_hook ] }; + key { [ aring, Aring, dead_doubleacute, dead_abovering ] }; + key { [ dead_diaeresis, dead_circumflex, dead_tilde, dead_macron ] }; + + key { [ a, A, schwa, SCHWA ] }; + key { [ s, S, ssharp, NoSymbol ] }; + key { [ d, D, eth, ETH ] }; + key { [ f, F, f, F ] }; + key { [ g, G, g, G ] }; + key { [ h, H, h, H ] }; + key { [ j, J, j, J ] }; + key { [ k, K, kra, NoSymbol ] }; + key { [ l, L, dead_stroke, NoSymbol ] }; + key { [ odiaeresis, Odiaeresis, oslash, Oslash ] }; + key { [ adiaeresis, Adiaeresis, ae, AE ] }; + key { [ apostrophe, asterisk, dead_caron, dead_breve ] }; + + key { [ less, greater, bar, NoSymbol ] }; + key { [ z, Z, U0292, U01B7 ] }; + key { [ x, X, multiply, periodcentered ] }; + key { [ c, C, c, C ] }; + key { [ v, V, v, V ] }; + key { [ b, B, b, B ] }; + key { [ n, N, eng, ENG ] }; + key { [ m, M, mu, emdash ] }; + key { [ comma, semicolon, rightsinglequotemark, leftsinglequotemark ] }; + key { [ period, colon, dead_belowdot, dead_abovedot ] }; + key { [ minus, underscore, endash, dead_belowcomma ] }; + + include "nbsp(level4)" + include "nbsp(level3)" + include "kpdl(comma)" + include "level3(ralt_switch)" + include "compose(rwin)" +}; + +partial alphanumeric_keys +xkb_symbols "classic" { + + include "fi(fi)" + + name[Group1]="Finland - Classic"; +}; + +partial alphanumeric_keys hidden +xkb_symbols "fi" { + + // Classic Finnish keyboard layout with dead keys support + // and all ISO-8859-1 and ISO-8859-15 characters available + + key { [ section, onehalf, onequarter, threequarters ] }; + key { [ 1, exclam, exclamdown, onesuperior ] }; + key { [ 2, quotedbl, at, twosuperior ] }; + key { [ 3, numbersign, sterling, threesuperior ] }; + key { [ 4, currency, dollar, cent ] }; + key { [ 5, percent, EuroSign, masculine ] }; + key { [ 6, ampersand, yen, ordfeminine ] }; + key { [ 7, slash, braceleft, plusminus ] }; + key { [ 8, parenleft, bracketleft, guillemotleft ] }; + key { [ 9, parenright, bracketright, guillemotright ] }; + key { [ 0, equal, braceright, degree ] }; + key { [ plus, question, backslash, questiondown ] }; + key { [ dead_acute, dead_grave, dead_cedilla, dead_ogonek ] }; + + key { [ q, Q, q, Q ] }; + key { [ w, W, w, W ] }; + key { [ e, E, EuroSign, cent ] }; + key { [ r, R, registered, NoSymbol ] }; + key { [ t, T, thorn, THORN ] }; + key { [ y, Y, y, Y ] }; + key { [ u, U, u, U ] }; + key { [ i, I, idotless, bar ] }; + key { [ o, O, o, O ] }; + key { [ p, P, paragraph, NoSymbol ] }; + key { [ aring, Aring, oe, OE ] }; + key { [ dead_diaeresis, dead_circumflex, dead_tilde, dead_caron ] }; + + key { [ a, A, schwa, SCHWA ] }; + key { [ s, S, scaron, Scaron ] }; + key { [ d, D, eth, ETH ] }; + key { [ f, F, f, F ] }; + key { [ g, G, eng, ENG ] }; + key { [ h, H, h, H ] }; + key { [ j, J, j, J ] }; + key { [ k, K, kra, NoSymbol ] }; + key { [ l, L, dead_stroke, NoSymbol ] }; + key { [ odiaeresis, Odiaeresis, oslash, Oslash ] }; + key { [ adiaeresis, Adiaeresis, ae, AE ] }; + key { [ apostrophe, asterisk, dead_caron, dead_breve ] }; + + key { [ less, greater, bar, brokenbar ] }; + key { [ z, Z, zcaron, Zcaron ] }; + key { [ x, X, multiply, division ] }; + key { [ c, C, copyright, cent ] }; + key { [ v, V, v, V ] }; + key { [ b, B, ssharp, NoSymbol ] }; + key { [ n, N, ntilde, Ntilde ] }; + key { [ m, M, mu, NoSymbol ] }; + key { [ comma, semicolon, dead_cedilla, dead_ogonek ] }; + key { [ period, colon, periodcentered, notsign ] }; + key { [ minus, underscore, hyphen, dead_macron ] }; + + include "nbsp(level4)" + include "kpdl(comma)" + include "level3(ralt_switch)" + include "compose(rwin)" +}; + +partial alphanumeric_keys +xkb_symbols "nodeadkeys" { + + // Classic Finnish keyboard layout without dead keys + + include "fi(fi)" + + name[Group1]="Finland - Classic, eliminate dead keys"; + + key { [ acute, grave, cedilla, ogonek ] }; + key { [ diaeresis, asciicircum, asciitilde, caron ] }; + key { [ l, L, l, L ] }; + key { [ apostrophe, asterisk, caron, breve ] }; + key { [ comma, semicolon, cedilla, ogonek ] }; + key { [ minus, underscore, hyphen, macron ] }; +}; + +partial alphanumeric_keys +xkb_symbols "smi" { + + // Describes the differences between a Norwegian Northern Sami + // (keyboard with dead key support) and a Swedish/Finnish Sami + // keyboard according to the specs at: + // http://www.hum.uit.no/a/trond/se-lat9-sefi-keys.html + + include "no(smi)" + + name[Group1]="Finland - Northern Saami"; + + key { [ odiaeresis, Odiaeresis, oslash, Oslash ] }; + key { [ adiaeresis, Adiaeresis, ae, AE ] }; +}; + +partial alphanumeric_keys +xkb_symbols "mac" { + + // Macintosh keyboard for Finland based on Swedish(Macintosh) keyboard + + include "se(mac)" + + name[Group1]="Finland - Macintosh"; +}; diff --git a/xorg-server/xkeyboard-config/symbols/fo b/xorg-server/xkeyboard-config/symbols/fo index 5ac205560..b57c917af 100644 --- a/xorg-server/xkeyboard-config/symbols/fo +++ b/xorg-server/xkeyboard-config/symbols/fo @@ -1,50 +1,48 @@ -// $XKeyboardConfig$ - -partial default alphanumeric_keys -xkb_symbols "basic" { - - include "latin(type2)" - - name[Group1]= "Faroe Islands"; - - key { [ onehalf, section, threequarters, paragraph ] }; - key { [ less, greater, backslash, notsign ] }; - key { [ space, space, nobreakspace, nobreakspace ] }; - - key { [ 5, percent, NoSymbol, cent ] }; - key { [ 6, ampersand, yen, NoSymbol ] }; - key { [ plus, question, plusminus, questiondown ] }; - key { [dead_acute, dead_grave, bar, brokenbar ] }; - - key { [ c, C, copyright, NoSymbol ] }; - key { [ minus, underscore, hyphen, macron ] }; - - key { [ d, D, eth, ETH ] }; - key { [ ae, AE ] }; - key { [ oslash, Ooblique ] }; - - key { [ i, I ] }; - key { [ aring, Aring, dead_diaeresis, dead_circumflex ] }; - key { [ eth, ETH, dead_tilde, dead_caron ] }; - - key { [apostrophe, asterisk, dead_doubleacute, multiply ] }; - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - - include "fo(basic)" - - name[Group1]= "Faroe Islands - Eliminate dead keys"; - - key { [ acute, grave, bar, ogonek ] }; - key { [ aring, Aring, diaeresis, degree ] }; - key { [ diaeresis, asciicircum, asciitilde, macron ] }; - key { [ ae, AE, acute, doubleacute ] }; - key { [ oslash, Ooblique, asciicircum, caron ] }; - key { [apostrophe, asterisk, doubleacute, multiply ] }; - key { [ comma, semicolon, cedilla, ogonek ] }; - key { [ period, colon, periodcentered, abovedot ] }; -}; +partial default alphanumeric_keys +xkb_symbols "basic" { + + include "latin(type2)" + + name[Group1]= "Faroe Islands"; + + key { [ onehalf, section, threequarters, paragraph ] }; + key { [ less, greater, backslash, notsign ] }; + key { [ space, space, nobreakspace, nobreakspace ] }; + + key { [ 5, percent, NoSymbol, cent ] }; + key { [ 6, ampersand, yen, NoSymbol ] }; + key { [ plus, question, plusminus, questiondown ] }; + key { [dead_acute, dead_grave, bar, brokenbar ] }; + + key { [ c, C, copyright, NoSymbol ] }; + key { [ minus, underscore, hyphen, macron ] }; + + key { [ d, D, eth, ETH ] }; + key { [ ae, AE ] }; + key { [ oslash, Ooblique ] }; + + key { [ i, I ] }; + key { [ aring, Aring, dead_diaeresis, dead_circumflex ] }; + key { [ eth, ETH, dead_tilde, dead_caron ] }; + + key { [apostrophe, asterisk, dead_doubleacute, multiply ] }; + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "nodeadkeys" { + + include "fo(basic)" + + name[Group1]= "Faroe Islands - Eliminate dead keys"; + + key { [ acute, grave, bar, ogonek ] }; + key { [ aring, Aring, diaeresis, degree ] }; + key { [ diaeresis, asciicircum, asciitilde, macron ] }; + key { [ ae, AE, acute, doubleacute ] }; + key { [ oslash, Ooblique, asciicircum, caron ] }; + key { [apostrophe, asterisk, doubleacute, multiply ] }; + key { [ comma, semicolon, cedilla, ogonek ] }; + key { [ period, colon, periodcentered, abovedot ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/fr b/xorg-server/xkeyboard-config/symbols/fr index 37038bee4..c804eb09e 100644 --- a/xorg-server/xkeyboard-config/symbols/fr +++ b/xorg-server/xkeyboard-config/symbols/fr @@ -1,8 +1,4 @@ -// $XKeyboardConfig$ - // based on a keyboard map from an 'xkb/symbols/fr' file -// -// $XFree86: xc/programs/xkbcomp/symbols/fr,v 1.2 2002/11/22 04:03:28 dawes Exp $ partial default alphanumeric_keys xkb_symbols "basic" { @@ -282,8 +278,6 @@ xkb_symbols "oss_nodeadkeys" { // Nicolas Mailhot // (XFree86 submission) // -// $XFree86: xc/programs/xkbcomp/symbols/fr-latin9,v 1.1 2002/12/20 02:07:11 dawes Exp $ -// // This layout has long been distributed and refined outside official channels. // To this day it remains more feature-rich and popular than the 'fr' layout. // @@ -1025,4 +1019,3 @@ xkb_symbols "geo" { key { [ 0x010010ed, noSymbol ] }; }; - diff --git a/xorg-server/xkeyboard-config/symbols/fujitsu_vndr/jp b/xorg-server/xkeyboard-config/symbols/fujitsu_vndr/jp index 2f49dea76..0eb277712 100644 --- a/xorg-server/xkeyboard-config/symbols/fujitsu_vndr/jp +++ b/xorg-server/xkeyboard-config/symbols/fujitsu_vndr/jp @@ -1,88 +1,87 @@ -// $Xorg: jp,v 1.4 2001/02/09 02:05:52 xorgcvs Exp $ -// -//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. -// -// Japanese layout for a Fujitsu 140 key keyboard - -xkb_symbols { - override "fujitsu_vndr/us" - augment key { [], [ kana_NU ] }; - key { [ 2, quotedbl ], [ kana_FU ] }; - key { [ 3, numbersign ], [ kana_A, kana_a ] }; - key { [ 4, dollar ], [ kana_U, kana_u ] }; - augment key { [], [ kana_E, kana_e ] }; - key { [ 6, ampersand ], [ kana_O, kana_o ] }; - key { [ 7, apostrophe ], [ kana_YA, kana_ya ] }; - key { [ 8, parenleft ], [ kana_YU, kana_yu ] }; - key { [ 9, parenright ], [ kana_YO, kana_yo ] }; - replace key { [ 0 ], [ kana_WA, kana_WO ] }; - key { [ minus, equal ], [ kana_HO ] }; - key { [ asciicircum, asciitilde ], [ kana_HE ] }; - key { [ backslash, bar ], [ prolongedsound] }; - augment key { [], [ kana_TA ] }; - augment key { [], [ kana_TE ] }; - augment key { [], [ kana_I, kana_i ] }; - augment key { [], [ kana_SU ] }; - augment key { [], [ kana_KA ] }; - augment key { [], [ kana_N ] }; - augment key { [], [ kana_NA ] }; - augment key { [], [ kana_NI ] }; - augment key { [], [ kana_RA ] }; - augment key { [], [ kana_SE ] }; - key { [ at, grave ], [ voicedsound ] }; - key { [ bracketleft, braceleft ], [ semivoicedsound, kana_openingbracket ] }; - augment key { [], [ kana_CHI ] }; - augment key { [], [ kana_TO ] }; - augment key { [], [ kana_SHI ] }; - augment key { [], [ kana_HA ] }; - augment key { [], [ kana_KI ] }; - augment key { [], [ kana_KU ] }; - augment key { [], [ kana_MA ] }; - augment key { [], [ kana_NO ] }; - augment key { [], [ kana_RI ] }; - key { [ semicolon, plus ], [ kana_RE ] }; - key { [ colon, asterisk ], [ kana_KE ] }; - key { [ bracketright, braceright ], [ kana_MU, kana_closingbracket ] }; - augment key { [], [ kana_TSU, kana_tsu ] }; - augment key { [], [ kana_SA ] }; - augment key { [], [ kana_SO ] }; - augment key { [], [ kana_HI ] }; - augment key { [], [ kana_KO ] }; - augment key { [], [ kana_MI ] }; - augment key { [], [ kana_MO ] }; - augment key { [], [ kana_NE, kana_comma ] }; - augment key { [], [ kana_RU, kana_fullstop ] }; - augment key { [], [ kana_ME, kana_conjunctive ] }; - key { [ underscore ], [ kana_RO ] }; - key { [ Select ] }; - key { [ Massyo ] }; - key { [ Touroku ] }; - key { [ Zenkaku_Hankaku ] }; - key { [ Eisu_Shift ] }; - key { [ Mode_switch ] }; - key { [ Cancel ] }; - key { [ Muhenkan ] }; - key { [ Henkan ] }; -}; +// +//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. +// +// Japanese layout for a Fujitsu 140 key keyboard + +xkb_symbols { + override "fujitsu_vndr/us" + augment key { [], [ kana_NU ] }; + key { [ 2, quotedbl ], [ kana_FU ] }; + key { [ 3, numbersign ], [ kana_A, kana_a ] }; + key { [ 4, dollar ], [ kana_U, kana_u ] }; + augment key { [], [ kana_E, kana_e ] }; + key { [ 6, ampersand ], [ kana_O, kana_o ] }; + key { [ 7, apostrophe ], [ kana_YA, kana_ya ] }; + key { [ 8, parenleft ], [ kana_YU, kana_yu ] }; + key { [ 9, parenright ], [ kana_YO, kana_yo ] }; + replace key { [ 0 ], [ kana_WA, kana_WO ] }; + key { [ minus, equal ], [ kana_HO ] }; + key { [ asciicircum, asciitilde ], [ kana_HE ] }; + key { [ backslash, bar ], [ prolongedsound] }; + augment key { [], [ kana_TA ] }; + augment key { [], [ kana_TE ] }; + augment key { [], [ kana_I, kana_i ] }; + augment key { [], [ kana_SU ] }; + augment key { [], [ kana_KA ] }; + augment key { [], [ kana_N ] }; + augment key { [], [ kana_NA ] }; + augment key { [], [ kana_NI ] }; + augment key { [], [ kana_RA ] }; + augment key { [], [ kana_SE ] }; + key { [ at, grave ], [ voicedsound ] }; + key { [ bracketleft, braceleft ], [ semivoicedsound, kana_openingbracket ] }; + augment key { [], [ kana_CHI ] }; + augment key { [], [ kana_TO ] }; + augment key { [], [ kana_SHI ] }; + augment key { [], [ kana_HA ] }; + augment key { [], [ kana_KI ] }; + augment key { [], [ kana_KU ] }; + augment key { [], [ kana_MA ] }; + augment key { [], [ kana_NO ] }; + augment key { [], [ kana_RI ] }; + key { [ semicolon, plus ], [ kana_RE ] }; + key { [ colon, asterisk ], [ kana_KE ] }; + key { [ bracketright, braceright ], [ kana_MU, kana_closingbracket ] }; + augment key { [], [ kana_TSU, kana_tsu ] }; + augment key { [], [ kana_SA ] }; + augment key { [], [ kana_SO ] }; + augment key { [], [ kana_HI ] }; + augment key { [], [ kana_KO ] }; + augment key { [], [ kana_MI ] }; + augment key { [], [ kana_MO ] }; + augment key { [], [ kana_NE, kana_comma ] }; + augment key { [], [ kana_RU, kana_fullstop ] }; + augment key { [], [ kana_ME, kana_conjunctive ] }; + key { [ underscore ], [ kana_RO ] }; + key { [ Select ] }; + key { [ Massyo ] }; + key { [ Touroku ] }; + key { [ Zenkaku_Hankaku ] }; + key { [ Eisu_Shift ] }; + key { [ Mode_switch ] }; + key { [ Cancel ] }; + key { [ Muhenkan ] }; + key { [ Henkan ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/fujitsu_vndr/us b/xorg-server/xkeyboard-config/symbols/fujitsu_vndr/us index e81be028d..73dde7612 100644 --- a/xorg-server/xkeyboard-config/symbols/fujitsu_vndr/us +++ b/xorg-server/xkeyboard-config/symbols/fujitsu_vndr/us @@ -1,145 +1,143 @@ -// $Xorg: us,v 1.4 2001/02/09 02:05:53 xorgcvs Exp $ -// -//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. -// -// US/ASCII layout for a Fujitsu 138 key keyboard -xkb_symbols { - include "us(basic)" - - // A few alphanumeric keys are different - key { [ grave, asciitilde ] }; - key { [ BackSpace ] }; - key { [ backslash, bar ] }; - key { [ ] }; - - key { [ Shift_R ] }; - - key { [ Alt_L ] }; - key { [ Alt_R ] }; - key { [ Meta_L ] }; - key { [ Meta_R ] }; - key { [ Linefeed ] }; - key { [ Multi_key ] }; - // End alphanumeric section - - // Begin "Function" section - key { [ Break ] }; - key { [ Print ] }; - key { [ Kanji ] }; - key { [ Pause ] }; - - key { [ F1 ] }; - key { [ F2 ] }; - key { [ F3 ] }; - key { [ F4 ] }; - key { [ F5 ] }; - key { [ F6 ] }; - key { [ F7 ] }; - key { [ F8 ] }; - key { [ F9 ] }; - key { [ F10 ] }; - key { [ F11 ] }; - key { [ F12 ] }; - key { [ F13 ] }; - key { [ F14 ] }; - key { [ F15 ] }; - key { [ F16 ] }; - key { [ F17 ] }; - key { [ F18 ] }; - key { [ F19 ] }; - key { [ F20 ] }; - key { [ F21 ] }; - key { [ F22 ] }; - key { [ F23 ] }; - key { [ F24 ] }; - key { [ F25 ] }; - key { [ F26 ] }; - key { [ F27 ] }; - key { [ F28 ] }; - key { [ F29 ] }; - key { [ F30 ] }; - key { [ F31 ] }; - key { [ F32 ] }; - // End "Function" section - - // Begin "Editing" section - key { [ Undo ] }; - key { [ F33 ] }; - key { [ F34 ] }; - key { [ F35 ] }; - key { [ Help ] }; - // End "Editing" section - - // Begin "Cursor" section - key { [ ] }; - key { [ ] }; - key { [ ] }; - key { [ Prior ] }; - key { [ Home ] }; - key { [ Next ] }; - key { [ ] }; - key { [ Delete ] }; - key { [ Insert ] }; - key { [ Left ] }; - key { [ Right ] }; - key { [ Up ] }; - key { [ Down ] }; - key { [ Execute ] }; - // End "Cursor" section - - // Begin "Keypad" section - key { [ KP_Multiply ] }; - key { [ KP_Divide ] }; - key { [ KP_Add ] }; - key { [ KP_Subtract ] }; - - key { [ KP_7 ] }; - key { [ KP_8 ] }; - key { [ KP_9 ] }; - key { [ KP_Equal ] }; - - key { [ KP_4 ] }; - key { [ KP_5 ] }; - key { [ KP_6 ] }; - key { [ KP_Decimal ] }; - - key { [ KP_1 ] }; - key { [ KP_2 ] }; - key { [ KP_3 ] }; - key { [ KP_Enter ] }; - - key { [ KP_0 ] }; - key { [ KP_0 ] }; - // End "Keypad" section - - // begin modifier mappings - modifier_map Shift { Shift_R }; - modifier_map Mod1 { Meta_L, Meta_R }; - modifier_map Mod2 { Mode_switch }; - modifier_map Mod3 { Alt_L }; - modifier_map Mod4 { Num_Lock }; - modifier_map Mod5 { F13, F18, F20 }; -}; - +// +//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. +// +// US/ASCII layout for a Fujitsu 138 key keyboard +xkb_symbols { + include "us(basic)" + + // A few alphanumeric keys are different + key { [ grave, asciitilde ] }; + key { [ BackSpace ] }; + key { [ backslash, bar ] }; + key { [ ] }; + + key { [ Shift_R ] }; + + key { [ Alt_L ] }; + key { [ Alt_R ] }; + key { [ Meta_L ] }; + key { [ Meta_R ] }; + key { [ Linefeed ] }; + key { [ Multi_key ] }; + // End alphanumeric section + + // Begin "Function" section + key { [ Break ] }; + key { [ Print ] }; + key { [ Kanji ] }; + key { [ Pause ] }; + + key { [ F1 ] }; + key { [ F2 ] }; + key { [ F3 ] }; + key { [ F4 ] }; + key { [ F5 ] }; + key { [ F6 ] }; + key { [ F7 ] }; + key { [ F8 ] }; + key { [ F9 ] }; + key { [ F10 ] }; + key { [ F11 ] }; + key { [ F12 ] }; + key { [ F13 ] }; + key { [ F14 ] }; + key { [ F15 ] }; + key { [ F16 ] }; + key { [ F17 ] }; + key { [ F18 ] }; + key { [ F19 ] }; + key { [ F20 ] }; + key { [ F21 ] }; + key { [ F22 ] }; + key { [ F23 ] }; + key { [ F24 ] }; + key { [ F25 ] }; + key { [ F26 ] }; + key { [ F27 ] }; + key { [ F28 ] }; + key { [ F29 ] }; + key { [ F30 ] }; + key { [ F31 ] }; + key { [ F32 ] }; + // End "Function" section + + // Begin "Editing" section + key { [ Undo ] }; + key { [ F33 ] }; + key { [ F34 ] }; + key { [ F35 ] }; + key { [ Help ] }; + // End "Editing" section + + // Begin "Cursor" section + key { [ ] }; + key { [ ] }; + key { [ ] }; + key { [ Prior ] }; + key { [ Home ] }; + key { [ Next ] }; + key { [ ] }; + key { [ Delete ] }; + key { [ Insert ] }; + key { [ Left ] }; + key { [ Right ] }; + key { [ Up ] }; + key { [ Down ] }; + key { [ Execute ] }; + // End "Cursor" section + + // Begin "Keypad" section + key { [ KP_Multiply ] }; + key { [ KP_Divide ] }; + key { [ KP_Add ] }; + key { [ KP_Subtract ] }; + + key { [ KP_7 ] }; + key { [ KP_8 ] }; + key { [ KP_9 ] }; + key { [ KP_Equal ] }; + + key { [ KP_4 ] }; + key { [ KP_5 ] }; + key { [ KP_6 ] }; + key { [ KP_Decimal ] }; + + key { [ KP_1 ] }; + key { [ KP_2 ] }; + key { [ KP_3 ] }; + key { [ KP_Enter ] }; + + key { [ KP_0 ] }; + key { [ KP_0 ] }; + // End "Keypad" section + + // begin modifier mappings + modifier_map Shift { Shift_R }; + modifier_map Mod1 { Meta_L, Meta_R }; + modifier_map Mod2 { Mode_switch }; + modifier_map Mod3 { Alt_L }; + modifier_map Mod4 { Num_Lock }; + modifier_map Mod5 { F13, F18, F20 }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/gb b/xorg-server/xkeyboard-config/symbols/gb index f7e5bbe66..60987e68c 100644 --- a/xorg-server/xkeyboard-config/symbols/gb +++ b/xorg-server/xkeyboard-config/symbols/gb @@ -1,8 +1,4 @@ -// $XKeyboardConfig$ - // based on a keyboard map from an 'xkb/symbols/gb' file -// -// $XFree86: xc/programs/xkbcomp/symbols/gb,v 1.6 2003/10/04 10:25:14 pascal Exp $ partial default alphanumeric_keys xkb_symbols "basic" { @@ -201,4 +197,3 @@ xkb_symbols "mac_intl" { include "level3(ralt_switch)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/ge b/xorg-server/xkeyboard-config/symbols/ge index 155a9da66..0746295b5 100644 --- a/xorg-server/xkeyboard-config/symbols/ge +++ b/xorg-server/xkeyboard-config/symbols/ge @@ -1,275 +1,272 @@ -// $XKeyboardConfig$ - -// Georgian Keyboard Layouts by Aiet Kolkhi -// Full layout descriptions available at http://www.gakartuleba.org/layouts/ -// -// This includes the following keyboard layouts: Georgian QWERTY; Georgian Ergonomic; -// Georgian MESS; Georgian AZERTY Tskapo; Georgian Russian. -// -// Layouts include Georgian Mkhedruli alphabeth; most layouts also include some special -// and ancient characters (like Fi, Yn, Elifi, Turned Gan and Ain). Layouts do not -// include Georgian Asomtavruli or Georgian Khutsuri alphabeths which are also present -// in Unicode. -// -// Georgian Typewriter no longer supported, as it is no longer used in Georgia. -// -// some layouts based on Georgian keyboard map, in the so called "latin" layout. -// 1999, Pablo Saratxaga -// - -partial default alphanumeric_keys -xkb_symbols "basic" { - - name[Group1]= "Georgia"; - - key { [ 0x0100201e, 0x0100201c, 0x0100201e, asciitilde ] }; - key { [ 1, exclam, apostrophe ] }; - key { [ 2, at, 0x0100201e ] }; - key { [ 3, numbersign, 0x0100201c ] }; - key { [ 4, dollar, 0x01002116 ] }; - key { [ 5, percent, EuroSign ] }; - key { [ 6, asciicircum ] }; - key { [ 7, ampersand, section ] }; - key { [ 8, asterisk, degree ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ minus, underscore, 0x01002014 ] }; - key { [ equal, plus, 0x01002013 ] }; - - key { [ 0x010010e5, Q ] }; - key { [ 0x010010ec, 0x010010ed ] }; - key { [ 0x010010d4, E, 0x010010f1 ] }; - key { [ 0x010010e0, 0x010010e6, 0x010000ae ] }; - key { [ 0x010010e2, 0x010010d7 ] }; - key { [ 0x010010e7, Y, 0x010010f8 ] }; - key { [ 0x010010e3, U ] }; - key { [ 0x010010d8, I, 0x010010f2 ] }; - key { [ 0x010010dd, O ] }; - key { [ 0x010010de, P ] }; - key { [ bracketleft, braceleft ] }; - key { [ bracketright,braceright ] }; - - key { [ 0x010010d0, A, 0x010010fa ] }; - key { [ 0x010010e1, 0x010010e8 ] }; - key { [ 0x010010d3, D ] }; - key { [ 0x010010e4, F, 0x010010f6 ] }; - key { [ 0x010010d2, G, 0x010010f9 ] }; - key { [ 0x010010f0, H, 0x010010f5 ] }; - key { [ 0x010010ef, 0x010010df, 0x010010f7 ] }; - key { [ 0x010010d9, K ] }; - key { [ 0x010010da, L ] }; - key { [ semicolon, colon ] }; - key { [ apostrophe, quotedbl ] }; - key { [ backslash, bar, asciitilde, asciitilde ] }; - - key { [ guillemotleft,guillemotright ] }; - key { [ 0x010010d6, 0x010010eb ] }; - key { [ 0x010010ee, X, 0x010010f4 ] }; - key { [ 0x010010ea, 0x010010e9, 0x010000a9 ] }; - key { [ 0x010010d5, V, 0x010010f3 ] }; - key { [ 0x010010d1, B ] }; - key { [ 0x010010dc, N, 0x010010fc ] }; - key { [ 0x010010db, M ] }; - key { [ comma, less, guillemotleft ] }; - key { [ period, greater, guillemotright ] }; - key { [ slash, question, 0x010010fb ] }; - - include "level3(ralt_switch)" - -}; - -partial alphanumeric_keys -xkb_symbols "qwerty" { - include "ge(basic)" -}; - -partial alphanumeric_keys -xkb_symbols "ergonomic" { - include "ge(basic)" - - name[Group1]= "Georgia - Ergonomic"; - - key { [ 0x0100201e, apostrophe, 0x0100201e, asciitilde ] }; - key { [ exclam, 1, exclam ] }; - key { [ 0x01002116, 2, at ] }; - key { [ comma, 3, numbersign, section ] }; - key { [ semicolon, 4, dollar ] }; - key { [ percent, 5, EuroSign ] }; - key { [ colon, 6, asciicircum ] }; - key { [ question, 7, ampersand ] }; - key { [ period, 8, asterisk, degree ] }; - key { [ parenleft, 9, parenleft, guillemotleft ] }; - key { [ parenright, 0, parenright, guillemotright ] }; - key { [ minus, plus, 0x01002014, underscore ] }; - key { [ 0x0100201c, equal, equal ] }; - - key { [ 0x010010e9, noSymbol ] }; - key { [ 0x010010de, noSymbol ] }; - key { [ 0x010010e3, noSymbol ] }; - key { [ 0x010010eb, noSymbol, noSymbol, 0x010000ae ] }; - key { [ 0x010010ed, noSymbol, noSymbol, 0x010010d7 ] }; - key { [ 0x010010e2, noSymbol, noSymbol, 0x010010f8 ] }; - key { [ 0x010010d7, noSymbol ] }; - key { [ 0x010010dc, noSymbol, 0x010010fc, I ] }; - key { [ 0x010010d5, noSymbol, 0x010010f3 ] }; - key { [ 0x010010e8, noSymbol ] }; - key { [ 0x010010d9, noSymbol, bracketleft, braceleft ] }; - key { [ 0x010010e5, noSymbol, bracketright,braceright ] }; - - key { [ 0x010010ee, noSymbol, 0x010010f4 ] }; - key { [ 0x010010d8, noSymbol, 0x010010f2 ] }; - key { [ 0x010010d0, noSymbol, 0x010010fa, D ] }; - key { [ 0x010010d4, noSymbol, 0x010010f1 ] }; - key { [ 0x010010dd, noSymbol ] }; - key { [ 0x010010d3, noSymbol ] }; - key { [ 0x010010db, noSymbol ] }; - key { [ 0x010010e1, noSymbol ] }; - key { [ 0x010010e0, noSymbol, L ] }; - key { [ 0x010010d1, noSymbol, colon ] }; - key { [ 0x010010d2, noSymbol, 0x010010f9, quotedbl ] }; - key { [ slash, section, backslash, bar ] }; - - key { [ guillemotleft,guillemotright ] }; - key { [ 0x010010ef, noSymbol ] }; - key { [ 0x010010f0, noSymbol, 0x010010f5, X ] }; - key { [ 0x010010e7, noSymbol, 0x010010f8, C ] }; - key { [ 0x010010e6, noSymbol, 0x010010f7, V ] }; - key { [ 0x010010df, noSymbol ] }; - key { [ 0x010010d6, noSymbol ] }; - key { [ 0x010010ea, noSymbol, noSymbol, M ] }; - key { [ 0x010010da, noSymbol, guillemotleft, less ] }; - key { [ 0x010010e4, noSymbol, 0x010010f6, guillemotright ] }; - key { [ 0x010010ec, noSymbol, 0x010010fb ] }; - - include "level3(ralt_switch)" - -}; - -partial alphanumeric_keys -xkb_symbols "mess" { - include "ge(basic)" - - name[Group1]= "Georgia - MESS"; - - key { [ 0x010010ed, backslash, quoteleft ] }; - key { [ 1, exclam, apostrophe ] }; - key { [ 2, at, asciitilde ] }; - key { [ 3, 0x01002116, numbersign ] }; - key { [ 4, dollar, EuroSign ] }; - key { [ 5, percent ] }; - key { [ 6, asciicircum ] }; - key { [ 7, ampersand, section ] }; - key { [ 8, asterisk, degree ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright, 0x01002014 ] }; - key { [ minus, underscore, 0x01002013 ] }; - key { [ 0x010010df, plus, bar ] }; - key { [ 0x010010e5, Q ] }; - key { [ 0x010010ec, W ] }; - key { [ 0x010010d4, E ] }; - key { [ 0x010010e0, R ] }; - key { [ 0x010010e2, T ] }; - key { [ 0x010010e7, Y ] }; - key { [ 0x010010e3, U ] }; - key { [ 0x010010d8, I, 0x010010f2 ] }; - key { [ 0x010010dd, O ] }; - key { [ 0x010010de, P ] }; - key { [ 0x010010e8, bracketleft, guillemotleft ] }; - key { [ 0x010010e6, bracketright, guillemotright ] }; - key { [ 0x010010d0, A, 0x010010fa ] }; - key { [ 0x010010e1, S ] }; - key { [ 0x010010d3, D ] }; - key { [ 0x010010e4, F, 0x010010f6 ] }; - key { [ 0x010010d2, G, 0x010010f9 ] }; - key { [ 0x010010f0, H, 0x010010f1 ] }; - key { [ 0x010010ef, J, 0x010010f7 ] }; - key { [ 0x010010d9, K ] }; - key { [ 0x010010da, L ] }; - key { [ 0x010010d7,0x0100201e ] }; - key { [ 0x010010e9,0x0100201c ] }; - key { [ equal, slash, bar ] }; - - key { [ guillemotleft, guillemotright ] }; - key { [ 0x010010d6, Z, 0x010010f5 ] }; - key { [ 0x010010ee, X, 0x010010f4 ] }; - key { [ 0x010010ea, C ] }; - key { [ 0x010010d5, V, 0x010010f3 ] }; - key { [ 0x010010d1, B ] }; - key { [ 0x010010dc, N, 0x010010fc ] }; - key { [ 0x010010db, M ] }; - key { [ comma, semicolon, less ] }; - key { [ period, colon, greater ] }; - key { [ 0x010010eb, question, 0x010010fb ] }; - - include "level3(ralt_switch)" - -}; - -partial alphanumeric_keys -xkb_symbols "ru" { - - name[Group1]= "Georgia - Russian"; - - key { [ asciicircum, asciitilde ] }; - key { [ 1, exclam ] }; - key { [ 2, at ] }; - key { [ 3, numbersign ] }; - key { [ 4, semicolon ] }; - key { [ 5, colon ] }; - key { [ 6, comma ] }; - key { [ 7, period ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ minus, underscore ] }; - key { [ numbersign, bar ] }; - - key { [ 0x010010e6, q ] }; - key { [ 0x010010ea, w ] }; - key { [ 0x010010e3, e ] }; - key { [ 0x010010d9, r ] }; - key { [ 0x010010d4, t ] }; - key { [ 0x010010dc, y ] }; - key { [ 0x010010d2, u ] }; - key { [ 0x010010e8, i ] }; - key { [ 0x010010ec, o ] }; - key { [ 0x010010d6, p ] }; - key { [ 0x010010ee, bracketleft ] }; - key { [ 0x010010ef, bracketright ] }; - - key { [ 0x010010e4, a ] }; - key { [ 0x010010d7, s ] }; - key { [ 0x010010d5, d ] }; - key { [ 0x010010d0, f ] }; - key { [ 0x010010de, g ] }; - key { [ 0x010010e0, h ] }; - key { [ 0x010010dd, j ] }; - key { [ 0x010010da, k ] }; - key { [ 0x010010d3, l ] }; - key { [ 0x010010df, semicolon ] }; - key { [ 0x010010eb, percent ] }; - key { [ backslash, bar ] }; - - key { [ guillemotleft,guillemotright ] }; - key { [ 0x010010ed, z ] }; - key { [ 0x010010e9, x ] }; - key { [ 0x010010e1, c ] }; - key { [ 0x010010db, v ] }; - key { [ 0x010010d8, b ] }; - key { [ 0x010010e2, n ] }; - key { [ 0x010010e5, m ] }; - key { [ 0x010010d1, less ] }; - key { [ 0x010010e7, greater ] }; - key { [ 0x010010f0, question ] }; - -}; - -partial alphanumeric_keys -xkb_symbols "os" { - - include "ru(os_legacy)" - - name[Group1]= "Georgia - Ossetian"; - -}; - +// Georgian Keyboard Layouts by Aiet Kolkhi +// Full layout descriptions available at http://www.gakartuleba.org/layouts/ +// +// This includes the following keyboard layouts: Georgian QWERTY; Georgian Ergonomic; +// Georgian MESS; Georgian AZERTY Tskapo; Georgian Russian. +// +// Layouts include Georgian Mkhedruli alphabeth; most layouts also include some special +// and ancient characters (like Fi, Yn, Elifi, Turned Gan and Ain). Layouts do not +// include Georgian Asomtavruli or Georgian Khutsuri alphabeths which are also present +// in Unicode. +// +// Georgian Typewriter no longer supported, as it is no longer used in Georgia. +// +// some layouts based on Georgian keyboard map, in the so called "latin" layout. +// 1999, Pablo Saratxaga +// + +partial default alphanumeric_keys +xkb_symbols "basic" { + + name[Group1]= "Georgia"; + + key { [ 0x0100201e, 0x0100201c, 0x0100201e, asciitilde ] }; + key { [ 1, exclam, apostrophe ] }; + key { [ 2, at, 0x0100201e ] }; + key { [ 3, numbersign, 0x0100201c ] }; + key { [ 4, dollar, 0x01002116 ] }; + key { [ 5, percent, EuroSign ] }; + key { [ 6, asciicircum ] }; + key { [ 7, ampersand, section ] }; + key { [ 8, asterisk, degree ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ minus, underscore, 0x01002014 ] }; + key { [ equal, plus, 0x01002013 ] }; + + key { [ 0x010010e5, Q ] }; + key { [ 0x010010ec, 0x010010ed ] }; + key { [ 0x010010d4, E, 0x010010f1 ] }; + key { [ 0x010010e0, 0x010010e6, 0x010000ae ] }; + key { [ 0x010010e2, 0x010010d7 ] }; + key { [ 0x010010e7, Y, 0x010010f8 ] }; + key { [ 0x010010e3, U ] }; + key { [ 0x010010d8, I, 0x010010f2 ] }; + key { [ 0x010010dd, O ] }; + key { [ 0x010010de, P ] }; + key { [ bracketleft, braceleft ] }; + key { [ bracketright,braceright ] }; + + key { [ 0x010010d0, A, 0x010010fa ] }; + key { [ 0x010010e1, 0x010010e8 ] }; + key { [ 0x010010d3, D ] }; + key { [ 0x010010e4, F, 0x010010f6 ] }; + key { [ 0x010010d2, G, 0x010010f9 ] }; + key { [ 0x010010f0, H, 0x010010f5 ] }; + key { [ 0x010010ef, 0x010010df, 0x010010f7 ] }; + key { [ 0x010010d9, K ] }; + key { [ 0x010010da, L ] }; + key { [ semicolon, colon ] }; + key { [ apostrophe, quotedbl ] }; + key { [ backslash, bar, asciitilde, asciitilde ] }; + + key { [ guillemotleft,guillemotright ] }; + key { [ 0x010010d6, 0x010010eb ] }; + key { [ 0x010010ee, X, 0x010010f4 ] }; + key { [ 0x010010ea, 0x010010e9, 0x010000a9 ] }; + key { [ 0x010010d5, V, 0x010010f3 ] }; + key { [ 0x010010d1, B ] }; + key { [ 0x010010dc, N, 0x010010fc ] }; + key { [ 0x010010db, M ] }; + key { [ comma, less, guillemotleft ] }; + key { [ period, greater, guillemotright ] }; + key { [ slash, question, 0x010010fb ] }; + + include "level3(ralt_switch)" + +}; + +partial alphanumeric_keys +xkb_symbols "qwerty" { + include "ge(basic)" +}; + +partial alphanumeric_keys +xkb_symbols "ergonomic" { + include "ge(basic)" + + name[Group1]= "Georgia - Ergonomic"; + + key { [ 0x0100201e, apostrophe, 0x0100201e, asciitilde ] }; + key { [ exclam, 1, exclam ] }; + key { [ 0x01002116, 2, at ] }; + key { [ comma, 3, numbersign, section ] }; + key { [ semicolon, 4, dollar ] }; + key { [ percent, 5, EuroSign ] }; + key { [ colon, 6, asciicircum ] }; + key { [ question, 7, ampersand ] }; + key { [ period, 8, asterisk, degree ] }; + key { [ parenleft, 9, parenleft, guillemotleft ] }; + key { [ parenright, 0, parenright, guillemotright ] }; + key { [ minus, plus, 0x01002014, underscore ] }; + key { [ 0x0100201c, equal, equal ] }; + + key { [ 0x010010e9, noSymbol ] }; + key { [ 0x010010de, noSymbol ] }; + key { [ 0x010010e3, noSymbol ] }; + key { [ 0x010010eb, noSymbol, noSymbol, 0x010000ae ] }; + key { [ 0x010010ed, noSymbol, noSymbol, 0x010010d7 ] }; + key { [ 0x010010e2, noSymbol, noSymbol, 0x010010f8 ] }; + key { [ 0x010010d7, noSymbol ] }; + key { [ 0x010010dc, noSymbol, 0x010010fc, I ] }; + key { [ 0x010010d5, noSymbol, 0x010010f3 ] }; + key { [ 0x010010e8, noSymbol ] }; + key { [ 0x010010d9, noSymbol, bracketleft, braceleft ] }; + key { [ 0x010010e5, noSymbol, bracketright,braceright ] }; + + key { [ 0x010010ee, noSymbol, 0x010010f4 ] }; + key { [ 0x010010d8, noSymbol, 0x010010f2 ] }; + key { [ 0x010010d0, noSymbol, 0x010010fa, D ] }; + key { [ 0x010010d4, noSymbol, 0x010010f1 ] }; + key { [ 0x010010dd, noSymbol ] }; + key { [ 0x010010d3, noSymbol ] }; + key { [ 0x010010db, noSymbol ] }; + key { [ 0x010010e1, noSymbol ] }; + key { [ 0x010010e0, noSymbol, L ] }; + key { [ 0x010010d1, noSymbol, colon ] }; + key { [ 0x010010d2, noSymbol, 0x010010f9, quotedbl ] }; + key { [ slash, section, backslash, bar ] }; + + key { [ guillemotleft,guillemotright ] }; + key { [ 0x010010ef, noSymbol ] }; + key { [ 0x010010f0, noSymbol, 0x010010f5, X ] }; + key { [ 0x010010e7, noSymbol, 0x010010f8, C ] }; + key { [ 0x010010e6, noSymbol, 0x010010f7, V ] }; + key { [ 0x010010df, noSymbol ] }; + key { [ 0x010010d6, noSymbol ] }; + key { [ 0x010010ea, noSymbol, noSymbol, M ] }; + key { [ 0x010010da, noSymbol, guillemotleft, less ] }; + key { [ 0x010010e4, noSymbol, 0x010010f6, guillemotright ] }; + key { [ 0x010010ec, noSymbol, 0x010010fb ] }; + + include "level3(ralt_switch)" + +}; + +partial alphanumeric_keys +xkb_symbols "mess" { + include "ge(basic)" + + name[Group1]= "Georgia - MESS"; + + key { [ 0x010010ed, backslash, quoteleft ] }; + key { [ 1, exclam, apostrophe ] }; + key { [ 2, at, asciitilde ] }; + key { [ 3, 0x01002116, numbersign ] }; + key { [ 4, dollar, EuroSign ] }; + key { [ 5, percent ] }; + key { [ 6, asciicircum ] }; + key { [ 7, ampersand, section ] }; + key { [ 8, asterisk, degree ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright, 0x01002014 ] }; + key { [ minus, underscore, 0x01002013 ] }; + key { [ 0x010010df, plus, bar ] }; + key { [ 0x010010e5, Q ] }; + key { [ 0x010010ec, W ] }; + key { [ 0x010010d4, E ] }; + key { [ 0x010010e0, R ] }; + key { [ 0x010010e2, T ] }; + key { [ 0x010010e7, Y ] }; + key { [ 0x010010e3, U ] }; + key { [ 0x010010d8, I, 0x010010f2 ] }; + key { [ 0x010010dd, O ] }; + key { [ 0x010010de, P ] }; + key { [ 0x010010e8, bracketleft, guillemotleft ] }; + key { [ 0x010010e6, bracketright, guillemotright ] }; + key { [ 0x010010d0, A, 0x010010fa ] }; + key { [ 0x010010e1, S ] }; + key { [ 0x010010d3, D ] }; + key { [ 0x010010e4, F, 0x010010f6 ] }; + key { [ 0x010010d2, G, 0x010010f9 ] }; + key { [ 0x010010f0, H, 0x010010f1 ] }; + key { [ 0x010010ef, J, 0x010010f7 ] }; + key { [ 0x010010d9, K ] }; + key { [ 0x010010da, L ] }; + key { [ 0x010010d7,0x0100201e ] }; + key { [ 0x010010e9,0x0100201c ] }; + key { [ equal, slash, bar ] }; + + key { [ guillemotleft, guillemotright ] }; + key { [ 0x010010d6, Z, 0x010010f5 ] }; + key { [ 0x010010ee, X, 0x010010f4 ] }; + key { [ 0x010010ea, C ] }; + key { [ 0x010010d5, V, 0x010010f3 ] }; + key { [ 0x010010d1, B ] }; + key { [ 0x010010dc, N, 0x010010fc ] }; + key { [ 0x010010db, M ] }; + key { [ comma, semicolon, less ] }; + key { [ period, colon, greater ] }; + key { [ 0x010010eb, question, 0x010010fb ] }; + + include "level3(ralt_switch)" + +}; + +partial alphanumeric_keys +xkb_symbols "ru" { + + name[Group1]= "Georgia - Russian"; + + key { [ asciicircum, asciitilde ] }; + key { [ 1, exclam ] }; + key { [ 2, at ] }; + key { [ 3, numbersign ] }; + key { [ 4, semicolon ] }; + key { [ 5, colon ] }; + key { [ 6, comma ] }; + key { [ 7, period ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ minus, underscore ] }; + key { [ numbersign, bar ] }; + + key { [ 0x010010e6, q ] }; + key { [ 0x010010ea, w ] }; + key { [ 0x010010e3, e ] }; + key { [ 0x010010d9, r ] }; + key { [ 0x010010d4, t ] }; + key { [ 0x010010dc, y ] }; + key { [ 0x010010d2, u ] }; + key { [ 0x010010e8, i ] }; + key { [ 0x010010ec, o ] }; + key { [ 0x010010d6, p ] }; + key { [ 0x010010ee, bracketleft ] }; + key { [ 0x010010ef, bracketright ] }; + + key { [ 0x010010e4, a ] }; + key { [ 0x010010d7, s ] }; + key { [ 0x010010d5, d ] }; + key { [ 0x010010d0, f ] }; + key { [ 0x010010de, g ] }; + key { [ 0x010010e0, h ] }; + key { [ 0x010010dd, j ] }; + key { [ 0x010010da, k ] }; + key { [ 0x010010d3, l ] }; + key { [ 0x010010df, semicolon ] }; + key { [ 0x010010eb, percent ] }; + key { [ backslash, bar ] }; + + key { [ guillemotleft,guillemotright ] }; + key { [ 0x010010ed, z ] }; + key { [ 0x010010e9, x ] }; + key { [ 0x010010e1, c ] }; + key { [ 0x010010db, v ] }; + key { [ 0x010010d8, b ] }; + key { [ 0x010010e2, n ] }; + key { [ 0x010010e5, m ] }; + key { [ 0x010010d1, less ] }; + key { [ 0x010010e7, greater ] }; + key { [ 0x010010f0, question ] }; + +}; + +partial alphanumeric_keys +xkb_symbols "os" { + + include "ru(os_legacy)" + + name[Group1]= "Georgia - Ossetian"; + +}; diff --git a/xorg-server/xkeyboard-config/symbols/gh b/xorg-server/xkeyboard-config/symbols/gh index a997e9fb0..04c7a8ed4 100644 --- a/xorg-server/xkeyboard-config/symbols/gh +++ b/xorg-server/xkeyboard-config/symbols/gh @@ -1,153 +1,151 @@ -// $XKeyboardConfig$ -// -partial default alphanumeric_keys -xkb_symbols "basic" { - - include "us" - - name[Group1]= "Ghana"; - - key { [ 4, 0x010020B5, dollar, cent ] }; - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "akan" { - include "gh(basic)" - - name[Group1]= "Ghana - Akan"; - - key { [ 0x0100025B, 0x01000190, q, Q ] }; - key { [ 0x01000254, 0x01000186, x, X ] }; -}; - -partial alphanumeric_keys -xkb_symbols "ga" { - include "gh(basic)" - - name[Group1]= "Ghana - Ga"; - - key { [ 0x0100025B, 0x01000190, q, Q ] }; - key { [ 0x01000254, 0x01000186, x, X ] }; - key { [ 0x0100014B, 0x0100014A, c, C ] }; -}; - -partial alphanumeric_keys -xkb_symbols "ewe" { - include "gh(basic)" - - name[Group1]= "Ghana - Ewe"; - - key { [ 0x0100025B, 0x01000190, q, Q ] }; - key { [ 0x0100014B, 0x0100014A, c, C ] }; - key { [ 0x01000254, 0x01000186, braceleft, braceleft ] }; - key { [ 0x0100028B, 0x010001B2, braceright, braceright ] }; - key { [ 0x01000256, 0x01000189, backslash, backslash ] }; - key { [ 0x01000192, 0x01000191, j, J ] }; - key { [ g, G, 0x01000263, 0x01000194 ] }; - -}; - -partial alphanumeric_keys -xkb_symbols "fula" { - include "gh(basic)" - - name[Group1]= "Ghana - Fula"; - - key { [ 0x01000071, 0x01000051, q, Q ] }; - key { [ udiaeresis, Udiaeresis, w, W ] }; - key { [ e, E, EuroSign, cent ] }; - key { [ 0x010001B4, 0x010001B3,bracketleft, braceleft ] }; - key { [ gcaron, Gcaron,bracketright, braceright] }; - key { [ 0x01000257, 0x0100018A, d, D ] }; - key { [ 0x01000131, 0x01000130, semicolon, colon ] }; - key { [ 0x010001DD, 0x0100018E,apostrophe, quotedbl ] }; - key { [ 0x01000272, 0x0100019D, z, Z ] }; - key { [ ntilde, Ntilde, m, M ] }; - key { [ ccedilla, Ccedilla, period, greater ] }; - key { [ scedilla, Scedilla, slash, question ] }; - -}; - -partial alphanumeric_keys -xkb_symbols "hausa" { - include "gh(fula)" - - name[Group1]= "Ghana - Hausa"; -}; - -partial alphanumeric_keys -xkb_symbols "generic" { - include "gh(basic)" - - name[Group1]= "Ghana - Multilingual"; - - key { [ e, E, 0x0100025b, 0x01000190 ] }; - key { [ c, C, 0x01000254, 0x01000186 ] }; - key { [ d, D, 0x01000256, 0x01000189 ] }; - key { [ f, F, 0x01000192, 0x01000191 ] }; - key { [ g, G, 0x01000263, 0x01000194 ] }; - key { [ n, N, 0x0100014b, 0x0100014a ] }; - key { [ z, Z, 0x010001B6, 0x010001B5 ] }; - key { [ v, V, 0x0100028B, 0x010001B2 ] }; - key { [ 4, dollar, 0x010020B5, cent ] }; - include "level3(ralt_switch)" - -}; - -partial alphanumeric_keys -xkb_symbols "avn" { - include "gh(basic)" - - name[Group1]= "Ghana - Avatime"; - - key { [ grave, asciitilde, 0x01000300, 0x01000303 ] }; // combining grave; combining tilde - key { [ 4, dollar, cent, 0x010020B5 ] }; // ¢, ₵ - key { [ minus, underscore, 0x01000304, 0x01000304 ] }; // combining macron - key { [ 0x0100028B, 0x010001B2 ] }; // ʋ, Ʋ - key { [ u, U, 0x0100028A, 0x010001B1 ] }; // ʊ, Ʊ - key { [ i, I, 0x01000269, 0x01000196 ] }; // ɩ, Ɩ - key { [ 0x0100025B, 0x01000190, bracketleft, braceleft ] }; // ɛ, Ɛ - key { [ d, D, 0x01000256, 0x01000189 ] }; // ɖ, Ɖ - key { [ f, F, 0x01000192, 0x01000191 ] }; // ƒ, Ƒ - key { [ 0x0100014B, 0x0100014A ] }; // ŋ, Ŋ - key { [ apostrophe, quotedbl, 0x01000301, 0x01000301 ] }; // combining acute - key { [ 0x01000254, 0x01000186 ] }; // ɔ, Ɔ - - include "level3(ralt_switch)" - -}; - -// This keyboard layout fully imitates the 'Ghana Unicode' layout which is used in GILLBT on Windows with Keyman. -// However, in this layout a 3rd level key (R ALT) is used rather than dead keys. -// Also it has three additional features: -// 1) combining macron above: + + <-> -// 2) cent: + <4> or + + <4> -// 3) ʊ/Ʊ: + / - -partial alphanumeric_keys -xkb_symbols "gillbt" { - include "gh(basic)" - - name[Group1]= "Ghana - GILLBT"; - - key { [ grave, asciitilde, 0x01000300, 0x01000303 ] }; // combining grave; combining tilde - key { [ 4, dollar, cent, 0x010020B5 ] }; // ¢, ₵ - key { [ 6, asciicircum, 0x01000302, 0x01000302 ] }; // combining circumflex accent - key { [ minus, underscore, 0x01000331, 0x01000304 ] }; // combining macron below; combining macron above - key { [ 0x0100014B, 0x0100014A, equal, plus ] }; // ŋ, Ŋ - key { [ 0x0100028B, 0x010001B2, q, Q ] }; // ʋ, Ʋ - key { [ e, E, 0x010001DD, 0x0100018E ] }; // ǝ, Ǝ - key { [ u, U, 0x0100028A, 0x010001B1 ] }; // ʊ, Ʊ - key { [ 0x0100025B, 0x01000190, bracketleft, braceleft ] }; // ɛ, Ɛ - key { [ 0x01000254, 0x01000186, bracketright, braceright ] }; // ɔ, Ɔ - key { [ d, D, 0x01000256, 0x01000189 ] }; // ɖ, Ɖ - key { [ f, F, 0x01000192, 0x01000191 ] }; // ƒ, Ƒ - key { [ g, G, 0x01000263, 0x01000194 ] }; // ɣ, Ɣ - key { [ apostrophe, quotedbl, 0x01000301, 0x01000301 ] }; // combining acute - key { [ z, Z, 0x01000292, 0x010001B7 ] }; // ʒ, Ʒ - key { [ 0x01000269, 0x01000196, x, X ] }; // ɩ, Ɩ - key { [ c, C, 0x010000E7, 0x010000C7 ] }; // ç, Ç - - include "level3(ralt_switch)" -}; +partial default alphanumeric_keys +xkb_symbols "basic" { + + include "us" + + name[Group1]= "Ghana"; + + key { [ 4, 0x010020B5, dollar, cent ] }; + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "akan" { + include "gh(basic)" + + name[Group1]= "Ghana - Akan"; + + key { [ 0x0100025B, 0x01000190, q, Q ] }; + key { [ 0x01000254, 0x01000186, x, X ] }; +}; + +partial alphanumeric_keys +xkb_symbols "ga" { + include "gh(basic)" + + name[Group1]= "Ghana - Ga"; + + key { [ 0x0100025B, 0x01000190, q, Q ] }; + key { [ 0x01000254, 0x01000186, x, X ] }; + key { [ 0x0100014B, 0x0100014A, c, C ] }; +}; + +partial alphanumeric_keys +xkb_symbols "ewe" { + include "gh(basic)" + + name[Group1]= "Ghana - Ewe"; + + key { [ 0x0100025B, 0x01000190, q, Q ] }; + key { [ 0x0100014B, 0x0100014A, c, C ] }; + key { [ 0x01000254, 0x01000186, braceleft, braceleft ] }; + key { [ 0x0100028B, 0x010001B2, braceright, braceright ] }; + key { [ 0x01000256, 0x01000189, backslash, backslash ] }; + key { [ 0x01000192, 0x01000191, j, J ] }; + key { [ g, G, 0x01000263, 0x01000194 ] }; + +}; + +partial alphanumeric_keys +xkb_symbols "fula" { + include "gh(basic)" + + name[Group1]= "Ghana - Fula"; + + key { [ 0x01000071, 0x01000051, q, Q ] }; + key { [ udiaeresis, Udiaeresis, w, W ] }; + key { [ e, E, EuroSign, cent ] }; + key { [ 0x010001B4, 0x010001B3,bracketleft, braceleft ] }; + key { [ gcaron, Gcaron,bracketright, braceright] }; + key { [ 0x01000257, 0x0100018A, d, D ] }; + key { [ 0x01000131, 0x01000130, semicolon, colon ] }; + key { [ 0x010001DD, 0x0100018E,apostrophe, quotedbl ] }; + key { [ 0x01000272, 0x0100019D, z, Z ] }; + key { [ ntilde, Ntilde, m, M ] }; + key { [ ccedilla, Ccedilla, period, greater ] }; + key { [ scedilla, Scedilla, slash, question ] }; + +}; + +partial alphanumeric_keys +xkb_symbols "hausa" { + include "gh(fula)" + + name[Group1]= "Ghana - Hausa"; +}; + +partial alphanumeric_keys +xkb_symbols "generic" { + include "gh(basic)" + + name[Group1]= "Ghana - Multilingual"; + + key { [ e, E, 0x0100025b, 0x01000190 ] }; + key { [ c, C, 0x01000254, 0x01000186 ] }; + key { [ d, D, 0x01000256, 0x01000189 ] }; + key { [ f, F, 0x01000192, 0x01000191 ] }; + key { [ g, G, 0x01000263, 0x01000194 ] }; + key { [ n, N, 0x0100014b, 0x0100014a ] }; + key { [ z, Z, 0x010001B6, 0x010001B5 ] }; + key { [ v, V, 0x0100028B, 0x010001B2 ] }; + key { [ 4, dollar, 0x010020B5, cent ] }; + include "level3(ralt_switch)" + +}; + +partial alphanumeric_keys +xkb_symbols "avn" { + include "gh(basic)" + + name[Group1]= "Ghana - Avatime"; + + key { [ grave, asciitilde, 0x01000300, 0x01000303 ] }; // combining grave; combining tilde + key { [ 4, dollar, cent, 0x010020B5 ] }; // ¢, ₵ + key { [ minus, underscore, 0x01000304, 0x01000304 ] }; // combining macron + key { [ 0x0100028B, 0x010001B2 ] }; // ʋ, Ʋ + key { [ u, U, 0x0100028A, 0x010001B1 ] }; // ʊ, Ʊ + key { [ i, I, 0x01000269, 0x01000196 ] }; // ɩ, Ɩ + key { [ 0x0100025B, 0x01000190, bracketleft, braceleft ] }; // ɛ, Ɛ + key { [ d, D, 0x01000256, 0x01000189 ] }; // ɖ, Ɖ + key { [ f, F, 0x01000192, 0x01000191 ] }; // ƒ, Ƒ + key { [ 0x0100014B, 0x0100014A ] }; // ŋ, Ŋ + key { [ apostrophe, quotedbl, 0x01000301, 0x01000301 ] }; // combining acute + key { [ 0x01000254, 0x01000186 ] }; // ɔ, Ɔ + + include "level3(ralt_switch)" + +}; + +// This keyboard layout fully imitates the 'Ghana Unicode' layout which is used in GILLBT on Windows with Keyman. +// However, in this layout a 3rd level key (R ALT) is used rather than dead keys. +// Also it has three additional features: +// 1) combining macron above: + + <-> +// 2) cent: + <4> or + + <4> +// 3) ʊ/Ʊ: + / + +partial alphanumeric_keys +xkb_symbols "gillbt" { + include "gh(basic)" + + name[Group1]= "Ghana - GILLBT"; + + key { [ grave, asciitilde, 0x01000300, 0x01000303 ] }; // combining grave; combining tilde + key { [ 4, dollar, cent, 0x010020B5 ] }; // ¢, ₵ + key { [ 6, asciicircum, 0x01000302, 0x01000302 ] }; // combining circumflex accent + key { [ minus, underscore, 0x01000331, 0x01000304 ] }; // combining macron below; combining macron above + key { [ 0x0100014B, 0x0100014A, equal, plus ] }; // ŋ, Ŋ + key { [ 0x0100028B, 0x010001B2, q, Q ] }; // ʋ, Ʋ + key { [ e, E, 0x010001DD, 0x0100018E ] }; // ǝ, Ǝ + key { [ u, U, 0x0100028A, 0x010001B1 ] }; // ʊ, Ʊ + key { [ 0x0100025B, 0x01000190, bracketleft, braceleft ] }; // ɛ, Ɛ + key { [ 0x01000254, 0x01000186, bracketright, braceright ] }; // ɔ, Ɔ + key { [ d, D, 0x01000256, 0x01000189 ] }; // ɖ, Ɖ + key { [ f, F, 0x01000192, 0x01000191 ] }; // ƒ, Ƒ + key { [ g, G, 0x01000263, 0x01000194 ] }; // ɣ, Ɣ + key { [ apostrophe, quotedbl, 0x01000301, 0x01000301 ] }; // combining acute + key { [ z, Z, 0x01000292, 0x010001B7 ] }; // ʒ, Ʒ + key { [ 0x01000269, 0x01000196, x, X ] }; // ɩ, Ɩ + key { [ c, C, 0x010000E7, 0x010000C7 ] }; // ç, Ç + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/gn b/xorg-server/xkeyboard-config/symbols/gn index fb47bfe4b..3a693afd6 100644 --- a/xorg-server/xkeyboard-config/symbols/gn +++ b/xorg-server/xkeyboard-config/symbols/gn @@ -1,63 +1,61 @@ -// $XKeyboardConfig$ - -// based on us_intl keyboard map file and a Sinhala keyboard map -// version 0.3 - -partial default alphanumeric_keys -xkb_symbols "basic" { - - name[Group1]="Guinea"; - - key { [0x010007F1, 0x010007C1 ] }; - key { [0x010007EB, 0x010007C2 ] }; - key { [0x010007F5, 0x010007C3, numbersign, sterling ] }; - key { [0x010007F4, 0x010007C4, 0x01002E1C, dollar ] }; - key { [ parenleft, 0x010007C5, 0x01002E1D ] }; - key { [ minus, 0x010007C6, bar ] }; - key { [0x010007EC, 0x010007C7, grave ] }; - key { [0x010007FA, 0x010007C8, backslash ] }; - key { [0x010007ED, 0x010007C9, asciicircum, plusminus ] }; - key { [0x010007EE, 0x010007C0, at, degree ] }; - key { [parenright ] }; - key { [ equal, plus, braceright ] }; - - key { [0x010007CA ] }; - key { [0x010007E0, less ] }; - key { [0x010007CD,0x010007CB ] }; - key { [0x010007D9,0x010007DA ] }; - key { [0x010007D5 ] }; - key { [0x010007E6,0x010007E7 ] }; - key { [0x010007CE,0x010007F6 ] }; - key { [0x010007CC ] }; - key { [0x010007D0,0x010007CF ] }; - key { [0x010007D4 ] }; - key { [0x010007F3 ] }; - key { [ dollar, sterling, currency ] }; - - key { [0x010007EB ] }; - key { [0x010007DB ] }; - key { [0x010007D8 ] }; - key { [0x010007DD ] }; - key { [0x010007DC,0x010007F7 ] }; - key { [0x010007E4 ] }; - key { [0x010007D6,0x010007E8 ] }; - key { [0x010007DE ] }; - key { [0x010007DF,0x010007EA ] }; - key { [0x010007E1 ] }; - key { [0x010007EF, 0x010007F8, percent ] }; - key { [0x010007EC, asciitilde, notsign ] }; - - key { [0x010007D1, asterisk ] }; - key { [0x010007E5 ] }; - key { [0x0100060C ] }; - key { [0x010007D7,0x010007E9 ] }; - key { [0x010007E2 ] }; - key { [0x010007D3 ] }; - key { [0x010007E3,0x010007D2 ] }; - key { [0x010007F8,0x0100061F ] }; - key { [0x0100061B ] }; - key { [0x0100060C, slash ] }; - key { [0x010007F9] }; - - include "level3(ralt_switch)" -}; +// based on us_intl keyboard map file and a Sinhala keyboard map +// version 0.3 + +partial default alphanumeric_keys +xkb_symbols "basic" { + + name[Group1]="Guinea"; + + key { [0x010007F1, 0x010007C1 ] }; + key { [0x010007EB, 0x010007C2 ] }; + key { [0x010007F5, 0x010007C3, numbersign, sterling ] }; + key { [0x010007F4, 0x010007C4, 0x01002E1C, dollar ] }; + key { [ parenleft, 0x010007C5, 0x01002E1D ] }; + key { [ minus, 0x010007C6, bar ] }; + key { [0x010007EC, 0x010007C7, grave ] }; + key { [0x010007FA, 0x010007C8, backslash ] }; + key { [0x010007ED, 0x010007C9, asciicircum, plusminus ] }; + key { [0x010007EE, 0x010007C0, at, degree ] }; + key { [parenright ] }; + key { [ equal, plus, braceright ] }; + + key { [0x010007CA ] }; + key { [0x010007E0, less ] }; + key { [0x010007CD,0x010007CB ] }; + key { [0x010007D9,0x010007DA ] }; + key { [0x010007D5 ] }; + key { [0x010007E6,0x010007E7 ] }; + key { [0x010007CE,0x010007F6 ] }; + key { [0x010007CC ] }; + key { [0x010007D0,0x010007CF ] }; + key { [0x010007D4 ] }; + key { [0x010007F3 ] }; + key { [ dollar, sterling, currency ] }; + + key { [0x010007EB ] }; + key { [0x010007DB ] }; + key { [0x010007D8 ] }; + key { [0x010007DD ] }; + key { [0x010007DC,0x010007F7 ] }; + key { [0x010007E4 ] }; + key { [0x010007D6,0x010007E8 ] }; + key { [0x010007DE ] }; + key { [0x010007DF,0x010007EA ] }; + key { [0x010007E1 ] }; + key { [0x010007EF, 0x010007F8, percent ] }; + key { [0x010007EC, asciitilde, notsign ] }; + + key { [0x010007D1, asterisk ] }; + key { [0x010007E5 ] }; + key { [0x0100060C ] }; + key { [0x010007D7,0x010007E9 ] }; + key { [0x010007E2 ] }; + key { [0x010007D3 ] }; + key { [0x010007E3,0x010007D2 ] }; + key { [0x010007F8,0x0100061F ] }; + key { [0x0100061B ] }; + key { [0x0100060C, slash ] }; + key { [0x010007F9] }; + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/gr b/xorg-server/xkeyboard-config/symbols/gr index ca1a7b789..5fe302200 100644 --- a/xorg-server/xkeyboard-config/symbols/gr +++ b/xorg-server/xkeyboard-config/symbols/gr @@ -1,5 +1,3 @@ -// $XKeyboardConfig$ - // Hellenic keyboard map for X.org // // Original version: diff --git a/xorg-server/xkeyboard-config/symbols/group b/xorg-server/xkeyboard-config/symbols/group index f0b6bfb0d..e85cd6778 100644 --- a/xorg-server/xkeyboard-config/symbols/group +++ b/xorg-server/xkeyboard-config/symbols/group @@ -1,9 +1,6 @@ -// $XKeyboardConfig$ -// $Xorg: group,v 1.3 2000/08/17 19:54:43 cpqbld Exp $ // using the group(switch) map, the right alt key temporarily chooses // the second keyboard group (until it is released). // -// $XFree86: xc/programs/xkbcomp/symbols/group,v 3.9 2003/12/30 13:26:25 pascal Exp $ partial modifier_keys xkb_symbols "switch" { key { diff --git a/xorg-server/xkeyboard-config/symbols/hp_vndr/us b/xorg-server/xkeyboard-config/symbols/hp_vndr/us index 18ce8aeae..7e07198d6 100644 --- a/xorg-server/xkeyboard-config/symbols/hp_vndr/us +++ b/xorg-server/xkeyboard-config/symbols/hp_vndr/us @@ -1,106 +1,104 @@ -// $Xorg: us,v 1.4 2001/02/09 02:05:53 xorgcvs Exp $ -// -//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. -// -// US/ASCII layout for a HP non-PC keyboard -xkb_symbols "hil" { - include "us(basic)" - - // A few alphanumeric keys are different - key { [ grave, asciitilde ]}; - key { [ Shift_R ]}; - key { [ Meta_L ]}; - key { [ Meta_R ]}; - // End alphanumeric section - - // Begin "Function" section - key { [ Break ]}; - key { [ Cancel ]}; - key { [ F1 ] }; - key { [ F2 ] }; - key { [ F3 ] }; - key { [ F4 ] }; - key { [ Menu ] }; - key { [ hpSystem ]}; - key { [ F5 ] }; - key { [ F6 ] }; - key { [ F7 ] }; - key { [ F8 ] }; - key { [ hpClearLine ]}; - key { [ Clear ]}; - key { [ F9 ] }; - key { [ F10 ] }; - key { [ F11 ] }; - key { [ F12 ] }; - // End "Function" section - - // Begin "Editing" section - key { [ Execute, Print ]}; - key { [ hpInsertLine ]}; - key { [ hpDeleteLine ]}; - key { [ hpInsertChar ]}; - key { [ hpDeleteChar ]}; - key { [ Home ] }; - key { [ Prior ] }; - key { [ Next ] }; - key { [ Select ] }; - key { [ Left ] }; - key { [ Down ] }; - key { [ Up ] }; - key { [ Right ]}; - - // End "Editing" section, begin "Keypad" - key { [ KP_Multiply ]}; - key { [ KP_Divide ]}; - key { [ KP_Add ]}; - key { [ KP_Subtract ]}; - - key { [ KP_7 ] }; - key { [ KP_8 ] }; - key { [ KP_9 ] }; - key { [ KP_Enter ]}; - - key { [ KP_4 ] }; - key { [ KP_5 ] }; - key { [ KP_6 ] }; - key { [ KP_Separator ]}; - - key { [ KP_1 ] }; - key { [ KP_2 ] }; - key { [ KP_3 ] }; - key { [ KP_Tab ]}; - - key { [ KP_0 ] }; - key { [ KP_Decimal ] }; - // End "Keypad" section - - - // begin modifier mappings - modifier_map Shift { Shift_R }; - modifier_map Mod1 { Meta_L, Meta_R }; - modifier_map Mod2 { Alt_L }; - modifier_map Mod3 { Mode_switch }; -}; - +// +//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. +// +// US/ASCII layout for a HP non-PC keyboard +xkb_symbols "hil" { + include "us(basic)" + + // A few alphanumeric keys are different + key { [ grave, asciitilde ]}; + key { [ Shift_R ]}; + key { [ Meta_L ]}; + key { [ Meta_R ]}; + // End alphanumeric section + + // Begin "Function" section + key { [ Break ]}; + key { [ Cancel ]}; + key { [ F1 ] }; + key { [ F2 ] }; + key { [ F3 ] }; + key { [ F4 ] }; + key { [ Menu ] }; + key { [ hpSystem ]}; + key { [ F5 ] }; + key { [ F6 ] }; + key { [ F7 ] }; + key { [ F8 ] }; + key { [ hpClearLine ]}; + key { [ Clear ]}; + key { [ F9 ] }; + key { [ F10 ] }; + key { [ F11 ] }; + key { [ F12 ] }; + // End "Function" section + + // Begin "Editing" section + key { [ Execute, Print ]}; + key { [ hpInsertLine ]}; + key { [ hpDeleteLine ]}; + key { [ hpInsertChar ]}; + key { [ hpDeleteChar ]}; + key { [ Home ] }; + key { [ Prior ] }; + key { [ Next ] }; + key { [ Select ] }; + key { [ Left ] }; + key { [ Down ] }; + key { [ Up ] }; + key { [ Right ]}; + + // End "Editing" section, begin "Keypad" + key { [ KP_Multiply ]}; + key { [ KP_Divide ]}; + key { [ KP_Add ]}; + key { [ KP_Subtract ]}; + + key { [ KP_7 ] }; + key { [ KP_8 ] }; + key { [ KP_9 ] }; + key { [ KP_Enter ]}; + + key { [ KP_4 ] }; + key { [ KP_5 ] }; + key { [ KP_6 ] }; + key { [ KP_Separator ]}; + + key { [ KP_1 ] }; + key { [ KP_2 ] }; + key { [ KP_3 ] }; + key { [ KP_Tab ]}; + + key { [ KP_0 ] }; + key { [ KP_Decimal ] }; + // End "Keypad" section + + + // begin modifier mappings + modifier_map Shift { Shift_R }; + modifier_map Mod1 { Meta_L, Meta_R }; + modifier_map Mod2 { Alt_L }; + modifier_map Mod3 { Mode_switch }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/hr b/xorg-server/xkeyboard-config/symbols/hr index 61c6eae18..71b23b607 100644 --- a/xorg-server/xkeyboard-config/symbols/hr +++ b/xorg-server/xkeyboard-config/symbols/hr @@ -1,76 +1,73 @@ -// $XKeyboardConfig$ -// - -default partial alphanumeric_keys -xkb_symbols "basic" { - - name[Group1]="Croatia"; - - include "rs(latin)" - - // Redefine these keys to match XFree86 Croatian layout - key { [ 1, exclam, asciitilde, dead_tilde ] }; - key { [ 3, numbersign, asciicircum, dead_circumflex ] }; - key { [ 5, percent, degree, dead_abovering ] }; - key { [ 7, slash, grave, dead_grave ] }; - key { [ minus, underscore, dead_belowdot, dead_abovedot ] }; -}; - -partial alphanumeric_keys -xkb_symbols "us" { - - name[Group1]= "Croatia - US keyboard with Croatian letters"; - - include "us" - - key { [ any, any, backslash ] }; - key { [ any, any, bar ] }; - key { [ any, any, EuroSign ] }; - key { [ any, any, z, Z ] }; - key { [ any, any, scaron, Scaron ] }; - key { [ any, any, dstroke, Dstroke ] }; - key { [ any, any, bracketleft ] }; - key { [ any, any, bracketright ] }; - key { [ any, any, lstroke ] }; - key { [ any, any, Lstroke ] }; - key { [ any, any, ccaron, Ccaron ] }; - key { [ any, any, cacute, Cacute ] }; - key { [ any, any, bar ] }; - key { [ any, any, y, Y ] }; - key { [ any, any, at ] }; - key { [ any, any, braceleft ] }; - key { [ any, any, braceright ] }; - key { [ any, any, section ] }; - key { [ any, any, semicolon ] }; - key { [ any, any, colon ] }; - key { [ any, any, minus, underscore ] }; - key { [ any, any, zcaron, Zcaron ] }; - - include "level3(ralt_switch)" - -}; - - -partial alphanumeric_keys -xkb_symbols "alternatequotes" { - - name[Group1]= "Croatia - Use guillemets for quotes"; - - include "rs(latinalternatequotes)" -}; - -partial alphanumeric_keys -xkb_symbols "unicode" { - - name[Group1]= "Croatia - Use Croatian digraphs"; - - include "rs(latinunicode)" -}; - -partial alphanumeric_keys -xkb_symbols "unicodeus" { - - name[Group1]= "Croatia - US keyboard with Croatian digraphs"; - - include "rs(latinunicodeyz)" -}; +default partial alphanumeric_keys +xkb_symbols "basic" { + + name[Group1]="Croatia"; + + include "rs(latin)" + + // Redefine these keys to match XFree86 Croatian layout + key { [ 1, exclam, asciitilde, dead_tilde ] }; + key { [ 3, numbersign, asciicircum, dead_circumflex ] }; + key { [ 5, percent, degree, dead_abovering ] }; + key { [ 7, slash, grave, dead_grave ] }; + key { [ minus, underscore, dead_belowdot, dead_abovedot ] }; +}; + +partial alphanumeric_keys +xkb_symbols "us" { + + name[Group1]= "Croatia - US keyboard with Croatian letters"; + + include "us" + + key { [ any, any, backslash ] }; + key { [ any, any, bar ] }; + key { [ any, any, EuroSign ] }; + key { [ any, any, z, Z ] }; + key { [ any, any, scaron, Scaron ] }; + key { [ any, any, dstroke, Dstroke ] }; + key { [ any, any, bracketleft ] }; + key { [ any, any, bracketright ] }; + key { [ any, any, lstroke ] }; + key { [ any, any, Lstroke ] }; + key { [ any, any, ccaron, Ccaron ] }; + key { [ any, any, cacute, Cacute ] }; + key { [ any, any, bar ] }; + key { [ any, any, y, Y ] }; + key { [ any, any, at ] }; + key { [ any, any, braceleft ] }; + key { [ any, any, braceright ] }; + key { [ any, any, section ] }; + key { [ any, any, semicolon ] }; + key { [ any, any, colon ] }; + key { [ any, any, minus, underscore ] }; + key { [ any, any, zcaron, Zcaron ] }; + + include "level3(ralt_switch)" + +}; + + +partial alphanumeric_keys +xkb_symbols "alternatequotes" { + + name[Group1]= "Croatia - Use guillemets for quotes"; + + include "rs(latinalternatequotes)" +}; + +partial alphanumeric_keys +xkb_symbols "unicode" { + + name[Group1]= "Croatia - Use Croatian digraphs"; + + include "rs(latinunicode)" +}; + +partial alphanumeric_keys +xkb_symbols "unicodeus" { + + name[Group1]= "Croatia - US keyboard with Croatian digraphs"; + + include "rs(latinunicodeyz)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/hu b/xorg-server/xkeyboard-config/symbols/hu index 9e97740fa..4595f1d22 100644 --- a/xorg-server/xkeyboard-config/symbols/hu +++ b/xorg-server/xkeyboard-config/symbols/hu @@ -2,7 +2,6 @@ // // Based on old style 'xkb/symbols/hu" // -// $XKeyboardConfig$ // (C) 2002-2004 Soós Péter // (C) 2010 Andras Timar // diff --git a/xorg-server/xkeyboard-config/symbols/ie b/xorg-server/xkeyboard-config/symbols/ie index 22d857247..ce9a0e84d 100644 --- a/xorg-server/xkeyboard-config/symbols/ie +++ b/xorg-server/xkeyboard-config/symbols/ie @@ -1,411 +1,407 @@ -// $XKeyboardConfig$ - -// $XFree86: xc/programs/xkbcomp/symbols/ie,v 1.3 2002/12/31 02:07:04 dawes Exp $ - -// Irish keyboard map - -// Support for Irish (old and new orthography) and English -// Seamus O Ciardhuain (19 December 2002) - -// The general idea is to provide the characters in ISO 8859-1, -// ISO 8859-15, ISO 8859-14, CP1252 and "Extended Latin-8". -// However, not all are accessible directly because there aren't -// enough keys; some need deadkeys to access them, others the -// "Multi_key" compose sequences. - -// Designed to be similar to the layouts used on Windows -// and the Macintosh. - -// Everything is in Group 1 to be compatible with the -// multi-layout keyboard support in XFree86 4.3. - -// The basic layout is a modern keyboard, but dotted consonants are -// accessible using a deadkey (AltGr+H or AltGr+W). -// If a proper Clo Gaelach keyboard is needed, then use the layout -// defined below as ie(CloGaelach), which gives dotted consonants -// without use of a deadkey. - - -partial default alphanumeric_keys -xkb_symbols "basic" { - - // Modern keyboard for Irish and English - // - acute-accented vowels as AltGr+vowel and AltGr+Shift+vowel - // - euro currency sign as AltGr+4 - // - Comhartha Agus (Tironian Sign Et) as AltGr+Shift+7 - // - non-breaking space as AltGr+Space and AltGr+Shift+Space - // - matches hardware (keys and engraved symbols) for Irish keyboards - - name[Group1] = "Ireland"; - - // - // Numeric row `1234567890-= - // - key { [ grave, notsign, brokenbar, NoSymbol ] }; - key { [ 1, exclam, exclamdown, onesuperior ] }; - key { [ 2, quotedbl, trademark, twosuperior ] }; - key { [ 3, sterling, copyright, threesuperior ] }; - key { [ 4, dollar, EuroSign, cent ] }; - key { [ 5, percent, section, dagger ] }; - key { [ 6, asciicircum, dead_circumflex, 0x1002030 ] }; - // per thousand - key { [ 7, ampersand, paragraph, 0x100204A ] }; - // Tironian Et - key { [ 8, asterisk, dead_diaeresis, enfilledcircbullet ] }; - key { [ 9, parenleft, ordfeminine, periodcentered ] }; - key { [ 0, parenright, masculine, degree ] }; - key { [ minus, underscore, endash, emdash ] }; - key { [ equal, plus, notequal, plusminus ] }; - - // - // QWERTYUIOP[] - // - key { [ q, Q, oe, OE ] }; - key { [ w, W, dead_abovedot, dead_abovedot ] }; - key { [ e, E, eacute, Eacute ] }; - key { [ r, R, registered, 0x1002030 ] }; - // per thousand - key { [ t, T, thorn, THORN ] }; - key { [ y, Y, yen, mu ] }; - key { [ u, U, uacute, Uacute ] }; - key { [ i, I, iacute, Iacute ] }; - key { [ o, O, oacute, Oacute ] }; - key { [ p, P, singlelowquotemark, NoSymbol ] }; - key { [ bracketleft, braceleft, leftdoublequotemark, rightdoublequotemark ] }; - key { [ bracketright, braceright, leftsinglequotemark, rightsinglequotemark ] }; - - // - // ASDFGHJKL;'# - // - key { [ a, A, aacute, Aacute ] }; - key { [ s, S, ssharp, NoSymbol ] }; - key { [ d, D, eth, ETH ] }; - key { [ f, F, 0x1000192, NoSymbol ] }; - // f with hook - key { [ g, G, copyright, NoSymbol ] }; - key { [ h, H, dead_abovedot, dead_abovedot ] }; - key { [ j, J, idotless, onequarter ] }; - key { [ k, K, dead_abovering, onehalf ] }; - key { [ l, L, acute, threequarters ] }; - key { [ semicolon, colon, ellipsis, doubledagger ] }; - key { [ apostrophe, at, ae, AE ] }; - key { [ numbersign, asciitilde, guillemotleft, guillemotright ] }; - - - // - // \ZXCVBNM,./ - // - key { [ backslash, bar, dead_grave, dead_acute ] }; - key { [ z, Z, leftanglebracket, rightanglebracket ] }; - key { [ x, X, multiply, approximate ] }; - key { [ c, C, dead_cedilla, cedilla ] }; - key { [ v, V, dead_caron, NoSymbol ] }; - key { [ b, B, diaeresis, NoSymbol ] }; - key { [ n, N, dead_tilde, NoSymbol ] }; - key { [ m, M, macron, NoSymbol ] }; - key { [ comma, less, lessthanequal, doublelowquotemark ] }; - key { [ period, greater, greaterthanequal, singlelowquotemark ] }; - key { [ slash, question, division, questiondown ] }; - - - key { [ space, space, nobreakspace, nobreakspace ] }; - - include "level3(ralt_switch)" - - // NB: putting Shift+ as Multi_key gives odd behaviour since the - // order of pressing keys affects the result. - - include "compose(rwin)" -}; - -partial alphanumeric_keys -xkb_symbols "CloGaelach" { - - // Adds support for Clo Gaelach (old orthography for Irish). - // Changes from "basic": - // - dotted consonants as AltGr+consonant or AltGr+Shift+consonant (TPSDFGCBM) - // - long lowercase r as AltGr+R - // - long lowercase s as AltGr+Z - // - long lowercase s dotted as AltGr+Shift+Z - // - some symbols moved around to retain them - // - several characters unlikely to be used are lost - // The long letters are needed only where the font provides - // both the long and short forms as different glyphs. - - include "ie(basic)" - - name[Group1] = "Ireland - CloGaelach"; - - key { [ grave, notsign, brokenbar, ssharp ] }; - key { [ r, R, 0x100027C, registered ] }; - // long r - key { [ t, T, tabovedot, Tabovedot ] }; - key { [ p, P, pabovedot, Pabovedot ] }; - - key { [ s, S, sabovedot, Sabovedot ] }; - key { [ d, D, dabovedot, Dabovedot ] }; - key { [ f, F, fabovedot, Fabovedot ] }; - key { [ g, G, gabovedot, Gabovedot ] }; - - key { [ z, Z, 0x100017F, 0x1001E9B ] }; - // long s, long s dot - key { [ c, C, cabovedot, Cabovedot ] }; - key { [ b, B, babovedot, Babovedot ] }; - key { [ m, M, mabovedot, Mabovedot ] }; - - key { [ backslash, bar, dead_grave, dead_cedilla ] }; -}; - -partial alphanumeric_keys -xkb_symbols "UnicodeExpert" { - -// This should eventually be a "Unicode Expert" layout like the Mac one. - - name[Group1] = "Ireland - UnicodeExpert"; - - // - // Numeric row `1234567890-= - // - key { [ grave, notsign, 0x10000A6, 0x10000A6 ] }; - // broken bar - key { [ 1, exclam, NoSymbol, NoSymbol ] }; - key { [ 2, quotedbl, dead_doubleacute, dead_doubleacute ] }; - key { [ 3, sterling, NoSymbol, NoSymbol ] }; - key { [ 4, dollar, EuroSign, EuroSign ] }; - key { [ 5, percent, NoSymbol, NoSymbol ] }; - key { [ 6, asciicircum, dead_circumflex, dead_circumflex ] }; - key { [ 7, ampersand, 0x100204A, 0x100204A ] }; - // Tironian Et - key { [ 8, asterisk, dead_abovering, dead_abovering ] }; - key { [ 9, parenleft, dead_breve, dead_breve ] }; - key { [ 0, parenright, dead_ogonek, dead_ogonek ] }; - key { [ minus, underscore, dead_macron, dead_macron ] }; - key { [ equal, plus, NoSymbol, NoSymbol ] }; - - // - // QWERTYUIOP[] - // - key { [ q, Q, NoSymbol, NoSymbol ] }; - key { [ w, W, NoSymbol, NoSymbol ] }; - key { [ e, E, eacute, Eacute ] }; - key { [ r, R, 0x100027C, 0x100027C ] }; - // long r - key { [ t, T, NoSymbol, NoSymbol ] }; - key { [ y, Y, NoSymbol, NoSymbol ] }; - key { [ u, U, uacute, Uacute ] }; - key { [ i, I, iacute, Iacute ] }; - key { [ o, O, oacute, Oacute ] }; - key { [ p, P, NoSymbol, NoSymbol ] }; - key { [ bracketleft, braceleft, dead_hook, dead_hook ] }; - key { [ bracketright, braceright, dead_horn, dead_horn ] }; - - // - // ASDFGHJKL;'# - // - key { [ a, A, aacute, Aacute ] }; - key { [ s, S, NoSymbol, NoSymbol ] }; - key { [ d, D, NoSymbol, NoSymbol ] }; - key { [ f, F, NoSymbol, NoSymbol ] }; - key { [ g, G, NoSymbol, NoSymbol ] }; - key { [ h, H, dead_abovedot, dead_abovedot ] }; - key { [ j, J, NoSymbol, NoSymbol ] }; - key { [ k, K, NoSymbol, NoSymbol ] }; - key { [ l, L, NoSymbol, NoSymbol ] }; - key { [ semicolon, colon, dead_diaeresis, dead_diaeresis ] }; - key { [ apostrophe, at, dead_acute, dead_acute ] }; - key { [ numbersign, asciitilde, dead_tilde, dead_tilde ] }; - - // - // \ZXCVBNM,./ - // - key { [ backslash, bar, dead_grave, dead_grave ] }; - key { [ z, Z, 0x100017F, 0x1001E9B ] }; - // long s, long s dot - key { [ x, X, NoSymbol, NoSymbol ] }; - key { [ c, C, NoSymbol, NoSymbol ] }; - key { [ v, V, dead_caron, dead_caron ] }; - key { [ b, B, NoSymbol, NoSymbol ] }; - key { [ n, N, NoSymbol, NoSymbol ] }; - key { [ m, M, NoSymbol, NoSymbol ] }; - key { [ comma, less, dead_cedilla, dead_cedilla ] }; - key { [ period, greater, dead_abovedot, dead_abovedot ] }; - key { [ slash, question, dead_belowdot, dead_belowdot ] }; - - key { [ space, space, space, nobreakspace ] }; - - include "level3(ralt_switch)" - - include "compose(rwin)" -}; - -// -// Ogham keyboard map for XFree86 -// -// Seamus O Ciardhuain (17 December 2002) -// -// Ogham keyboard layout as recommended in I.S. 434:1999. -// Suitable for multi-layout xkbcomp. -// Character names are given as in the Unicode standard, -// range U+1680 to U+169F. - -partial alphanumeric_keys -xkb_symbols "ogam" { - - name[Group1] = "Ireland - Ogham"; - - key.type[Group1] = "ONE_LEVEL"; - - key { type[Group1]="TWO_LEVEL", - [ 0x100169B, 0x100169C ] }; - // OGHAM FEATHER MARK, OGHAM REVERSED FEATHER MARK - - key { [ 0x1001680 ] }; // OGHAM SPACE MARK - - key { [ 0x100169C ] }; // OGHAM REVERSED FEATHER MARK - - key { [ space ] }; - - // - // Top Row QWERTYUIOP - // - key { [ 0x100168A ] }; // OGHAM LETTER CEIRT - key { [ 0x1001695 ] }; // OGHAM LETTER EABHADH - key { [ 0x1001693 ] }; // OGHAM LETTER EADHADH - key { [ 0x100168F ] }; // OGHAM LETTER RUIS - key { [ 0x1001688 ] }; // OGHAM LETTER TINNE - key { [ 0x1001698 ] }; // OGHAM LETTER IFIN - key { [ 0x1001692 ] }; // OGHAM LETTER UR - key { [ 0x1001694 ] }; // OGHAM LETTER IODHADH - key { [ 0x1001691 ] }; // OGHAM LETTER ONN - key { [ 0x100169A ] }; // OGHAM LETTER PEITH - - // - // Middle Row ASDFGHJKL - // - key { [ 0x1001690 ] }; // OGHAM LETTER AILM - key { [ 0x1001684 ] }; // OGHAM LETTER SAIL - key { [ 0x1001687 ] }; // OGHAM LETTER DAIR - key { [ 0x1001683 ] }; // OGHAM LETTER FEARN - key { [ 0x100168C ] }; // OGHAM LETTER GORT - key { [ 0x1001686 ] }; // OGHAM LETTER UATH - key { [ 0x1001697 ] }; // OGHAM LETTER UILLEANN - key { [ 0x1001696 ] }; // OGHAM LETTER OR - key { [ 0x1001682 ] }; // OGHAM LETTER LUIS - - // - // Bottom Row ZXCVBNM - // - key { [ 0x100168E ] }; // OGHAM LETTER STRAIF - key { [ 0x1001699 ] }; // OGHAM LETTER EAMHANCHOLL - key { [ 0x1001689 ] }; // OGHAM LETTER COLL - key { [ 0x100168D ] }; // OGHAM LETTER NGEADAL - key { [ 0x1001681 ] }; // OGHAM LETTER BEITH - key { [ 0x1001685 ] }; // OGHAM LETTER NION - key { [ 0x100168B ] }; // OGHAM LETTER MUIN - - // As an extension because and may not be - // available or sensible. These are also a bit more - // intuitive on a standard Irish keyboard. - key { [ 0x100169C ] }; // OGHAM REVERSED FEATHER MARK - key { [ 0x100169B ] }; // OGHAM FEATHER MARK - key { [ 0x1001680 ] }; // OGHAM SPACE MARK - - include "compose(rwin)" -}; - -partial alphanumeric_keys -xkb_symbols "ogam_is434" { - - // This has the full layout of IS434 with an Irish QWERTY keyboard, - // and the Ogham characters accessed when CAPS LOCK is on. - - name[Group1] = "Ireland - Ogham IS434"; - - key.type[Group1] = "THREE_LEVEL"; - - key { type[Group1] = "FOUR_LEVEL_ALPHABETIC", - [ backslash, bar, 0x100169B, 0x100169C ] }; - // OGHAM FEATHER MARK, OGHAM REVERSED FEATHER MARK - - key { [ numbersign, asciitilde, 0x1001680 ] }; // OGHAM SPACE MARK - key { [ grave, notsign, 0x100169C ] }; // OGHAM REVERSED FEATHER MARK - key { [ space, space, space ] }; - - // - // Numeric row - // - key { type[Group1]="TWO_LEVEL", [ 1, exclam ] }; - key { type[Group1]="TWO_LEVEL", [ 2, quotedbl ] }; - key { type[Group1]="TWO_LEVEL", [ 3, sterling ] }; - key { [ 4, dollar, EuroSign ] }; - key { type[Group1]="TWO_LEVEL", [ 5, percent ] }; - key { type[Group1]="TWO_LEVEL", [ 6, asciicircum ] }; - key { [ 7, ampersand, 0x100204A ] }; // Tironian Et - key { type[Group1]="TWO_LEVEL", [ 8, asterisk ] }; - key { type[Group1]="TWO_LEVEL", [ 9, parenleft ] }; - key { type[Group1]="TWO_LEVEL", [ 0, parenright ] }; - key { type[Group1]="TWO_LEVEL", [ minus, underscore ] }; - key { type[Group1]="TWO_LEVEL", [ equal, plus ] }; - - // - // Top Row QWERTYUIOP - // - key { [ q, Q, 0x100168A ] }; // OGHAM LETTER CEIRT - key { [ w, W, 0x1001695 ] }; // OGHAM LETTER EABHADH - key { [ e, E, 0x1001693 ] }; // OGHAM LETTER EADHADH - key { [ r, R, 0x100168F ] }; // OGHAM LETTER RUIS - key { [ t, T, 0x1001688 ] }; // OGHAM LETTER TINNE - key { [ y, Y, 0x1001698 ] }; // OGHAM LETTER IFIN - key { [ u, U, 0x1001692 ] }; // OGHAM LETTER UR - key { [ i, I, 0x1001694 ] }; // OGHAM LETTER IODHADH - key { [ o, O, 0x1001691 ] }; // OGHAM LETTER ONN - key { [ p, P, 0x100169A ] }; // OGHAM LETTER PEITH - - // - // Middle Row ASDFGHJKL - // - key { [ a, A, 0x1001690 ] }; // OGHAM LETTER AILM - key { [ s, S, 0x1001684 ] }; // OGHAM LETTER SAIL - key { [ d, D, 0x1001687 ] }; // OGHAM LETTER DAIR - key { [ f, F, 0x1001683 ] }; // OGHAM LETTER FEARN - key { [ g, G, 0x100168C ] }; // OGHAM LETTER GORT - key { [ h, H, 0x1001686 ] }; // OGHAM LETTER UATH - key { [ j, J, 0x1001697 ] }; // OGHAM LETTER UILLEANN - key { [ k, K, 0x1001696 ] }; // OGHAM LETTER OR - key { [ l, L, 0x1001682 ] }; // OGHAM LETTER LUIS - - // - // Bottom Row ZXCVBNM - // - key { [ z, Z, 0x100168E ] }; // OGHAM LETTER STRAIF - key { [ x, X, 0x1001699 ] }; // OGHAM LETTER EAMHANCHOLL - key { [ c, C, 0x1001689 ] }; // OGHAM LETTER COLL - key { [ v, V, 0x100168D ] }; // OGHAM LETTER NGEADAL - key { [ b, B, 0x1001681 ] }; // OGHAM LETTER BEITH - key { [ n, N, 0x1001685 ] }; // OGHAM LETTER NION - key { [ m, M, 0x100168B ] }; // OGHAM LETTER MUIN - - // As an extension because and may not be - // available or sensible. These are also a bit more - // intuitive on a standard Irish keyboard. - key { [ comma, less, 0x100169C ] }; // OGHAM REVERSED FEATHER MARK - key { [ period, greater, 0x100169B ] }; // OGHAM FEATHER MARK - key { [ slash, question, 0x1001680 ] }; // OGHAM SPACE MARK - - // The standard says the Ogham characters should be accessed when - // Caps Lock is down; not clear if this means it should lock but - // seems logical. - - key { type[Group1] = "ONE_LEVEL", [ ISO_Level3_Lock ] }; - - // Also allow access to Ogham characters using RALT for convenience - include "level3(ralt_switch)" - - // Redefine Scroll Lock as locking shift in case that's needed. - // Also overcomes annoying use of Scroll Lock LED inherited from - // US symbols but not relevant here since we're not changing group. - key {type[Group1] = "ONE_LEVEL", [ Shift_Lock ] }; - modifier_map Shift { Shift_Lock }; - - include "compose(rwin)" -}; +// Irish keyboard map + +// Support for Irish (old and new orthography) and English +// Seamus O Ciardhuain (19 December 2002) + +// The general idea is to provide the characters in ISO 8859-1, +// ISO 8859-15, ISO 8859-14, CP1252 and "Extended Latin-8". +// However, not all are accessible directly because there aren't +// enough keys; some need deadkeys to access them, others the +// "Multi_key" compose sequences. + +// Designed to be similar to the layouts used on Windows +// and the Macintosh. + +// Everything is in Group 1 to be compatible with the +// multi-layout keyboard support in XFree86 4.3. + +// The basic layout is a modern keyboard, but dotted consonants are +// accessible using a deadkey (AltGr+H or AltGr+W). +// If a proper Clo Gaelach keyboard is needed, then use the layout +// defined below as ie(CloGaelach), which gives dotted consonants +// without use of a deadkey. + + +partial default alphanumeric_keys +xkb_symbols "basic" { + + // Modern keyboard for Irish and English + // - acute-accented vowels as AltGr+vowel and AltGr+Shift+vowel + // - euro currency sign as AltGr+4 + // - Comhartha Agus (Tironian Sign Et) as AltGr+Shift+7 + // - non-breaking space as AltGr+Space and AltGr+Shift+Space + // - matches hardware (keys and engraved symbols) for Irish keyboards + + name[Group1] = "Ireland"; + + // + // Numeric row `1234567890-= + // + key { [ grave, notsign, brokenbar, NoSymbol ] }; + key { [ 1, exclam, exclamdown, onesuperior ] }; + key { [ 2, quotedbl, trademark, twosuperior ] }; + key { [ 3, sterling, copyright, threesuperior ] }; + key { [ 4, dollar, EuroSign, cent ] }; + key { [ 5, percent, section, dagger ] }; + key { [ 6, asciicircum, dead_circumflex, 0x1002030 ] }; + // per thousand + key { [ 7, ampersand, paragraph, 0x100204A ] }; + // Tironian Et + key { [ 8, asterisk, dead_diaeresis, enfilledcircbullet ] }; + key { [ 9, parenleft, ordfeminine, periodcentered ] }; + key { [ 0, parenright, masculine, degree ] }; + key { [ minus, underscore, endash, emdash ] }; + key { [ equal, plus, notequal, plusminus ] }; + + // + // QWERTYUIOP[] + // + key { [ q, Q, oe, OE ] }; + key { [ w, W, dead_abovedot, dead_abovedot ] }; + key { [ e, E, eacute, Eacute ] }; + key { [ r, R, registered, 0x1002030 ] }; + // per thousand + key { [ t, T, thorn, THORN ] }; + key { [ y, Y, yen, mu ] }; + key { [ u, U, uacute, Uacute ] }; + key { [ i, I, iacute, Iacute ] }; + key { [ o, O, oacute, Oacute ] }; + key { [ p, P, singlelowquotemark, NoSymbol ] }; + key { [ bracketleft, braceleft, leftdoublequotemark, rightdoublequotemark ] }; + key { [ bracketright, braceright, leftsinglequotemark, rightsinglequotemark ] }; + + // + // ASDFGHJKL;'# + // + key { [ a, A, aacute, Aacute ] }; + key { [ s, S, ssharp, NoSymbol ] }; + key { [ d, D, eth, ETH ] }; + key { [ f, F, 0x1000192, NoSymbol ] }; + // f with hook + key { [ g, G, copyright, NoSymbol ] }; + key { [ h, H, dead_abovedot, dead_abovedot ] }; + key { [ j, J, idotless, onequarter ] }; + key { [ k, K, dead_abovering, onehalf ] }; + key { [ l, L, acute, threequarters ] }; + key { [ semicolon, colon, ellipsis, doubledagger ] }; + key { [ apostrophe, at, ae, AE ] }; + key { [ numbersign, asciitilde, guillemotleft, guillemotright ] }; + + + // + // \ZXCVBNM,./ + // + key { [ backslash, bar, dead_grave, dead_acute ] }; + key { [ z, Z, leftanglebracket, rightanglebracket ] }; + key { [ x, X, multiply, approximate ] }; + key { [ c, C, dead_cedilla, cedilla ] }; + key { [ v, V, dead_caron, NoSymbol ] }; + key { [ b, B, diaeresis, NoSymbol ] }; + key { [ n, N, dead_tilde, NoSymbol ] }; + key { [ m, M, macron, NoSymbol ] }; + key { [ comma, less, lessthanequal, doublelowquotemark ] }; + key { [ period, greater, greaterthanequal, singlelowquotemark ] }; + key { [ slash, question, division, questiondown ] }; + + + key { [ space, space, nobreakspace, nobreakspace ] }; + + include "level3(ralt_switch)" + + // NB: putting Shift+ as Multi_key gives odd behaviour since the + // order of pressing keys affects the result. + + include "compose(rwin)" +}; + +partial alphanumeric_keys +xkb_symbols "CloGaelach" { + + // Adds support for Clo Gaelach (old orthography for Irish). + // Changes from "basic": + // - dotted consonants as AltGr+consonant or AltGr+Shift+consonant (TPSDFGCBM) + // - long lowercase r as AltGr+R + // - long lowercase s as AltGr+Z + // - long lowercase s dotted as AltGr+Shift+Z + // - some symbols moved around to retain them + // - several characters unlikely to be used are lost + // The long letters are needed only where the font provides + // both the long and short forms as different glyphs. + + include "ie(basic)" + + name[Group1] = "Ireland - CloGaelach"; + + key { [ grave, notsign, brokenbar, ssharp ] }; + key { [ r, R, 0x100027C, registered ] }; + // long r + key { [ t, T, tabovedot, Tabovedot ] }; + key { [ p, P, pabovedot, Pabovedot ] }; + + key { [ s, S, sabovedot, Sabovedot ] }; + key { [ d, D, dabovedot, Dabovedot ] }; + key { [ f, F, fabovedot, Fabovedot ] }; + key { [ g, G, gabovedot, Gabovedot ] }; + + key { [ z, Z, 0x100017F, 0x1001E9B ] }; + // long s, long s dot + key { [ c, C, cabovedot, Cabovedot ] }; + key { [ b, B, babovedot, Babovedot ] }; + key { [ m, M, mabovedot, Mabovedot ] }; + + key { [ backslash, bar, dead_grave, dead_cedilla ] }; +}; + +partial alphanumeric_keys +xkb_symbols "UnicodeExpert" { + +// This should eventually be a "Unicode Expert" layout like the Mac one. + + name[Group1] = "Ireland - UnicodeExpert"; + + // + // Numeric row `1234567890-= + // + key { [ grave, notsign, 0x10000A6, 0x10000A6 ] }; + // broken bar + key { [ 1, exclam, NoSymbol, NoSymbol ] }; + key { [ 2, quotedbl, dead_doubleacute, dead_doubleacute ] }; + key { [ 3, sterling, NoSymbol, NoSymbol ] }; + key { [ 4, dollar, EuroSign, EuroSign ] }; + key { [ 5, percent, NoSymbol, NoSymbol ] }; + key { [ 6, asciicircum, dead_circumflex, dead_circumflex ] }; + key { [ 7, ampersand, 0x100204A, 0x100204A ] }; + // Tironian Et + key { [ 8, asterisk, dead_abovering, dead_abovering ] }; + key { [ 9, parenleft, dead_breve, dead_breve ] }; + key { [ 0, parenright, dead_ogonek, dead_ogonek ] }; + key { [ minus, underscore, dead_macron, dead_macron ] }; + key { [ equal, plus, NoSymbol, NoSymbol ] }; + + // + // QWERTYUIOP[] + // + key { [ q, Q, NoSymbol, NoSymbol ] }; + key { [ w, W, NoSymbol, NoSymbol ] }; + key { [ e, E, eacute, Eacute ] }; + key { [ r, R, 0x100027C, 0x100027C ] }; + // long r + key { [ t, T, NoSymbol, NoSymbol ] }; + key { [ y, Y, NoSymbol, NoSymbol ] }; + key { [ u, U, uacute, Uacute ] }; + key { [ i, I, iacute, Iacute ] }; + key { [ o, O, oacute, Oacute ] }; + key { [ p, P, NoSymbol, NoSymbol ] }; + key { [ bracketleft, braceleft, dead_hook, dead_hook ] }; + key { [ bracketright, braceright, dead_horn, dead_horn ] }; + + // + // ASDFGHJKL;'# + // + key { [ a, A, aacute, Aacute ] }; + key { [ s, S, NoSymbol, NoSymbol ] }; + key { [ d, D, NoSymbol, NoSymbol ] }; + key { [ f, F, NoSymbol, NoSymbol ] }; + key { [ g, G, NoSymbol, NoSymbol ] }; + key { [ h, H, dead_abovedot, dead_abovedot ] }; + key { [ j, J, NoSymbol, NoSymbol ] }; + key { [ k, K, NoSymbol, NoSymbol ] }; + key { [ l, L, NoSymbol, NoSymbol ] }; + key { [ semicolon, colon, dead_diaeresis, dead_diaeresis ] }; + key { [ apostrophe, at, dead_acute, dead_acute ] }; + key { [ numbersign, asciitilde, dead_tilde, dead_tilde ] }; + + // + // \ZXCVBNM,./ + // + key { [ backslash, bar, dead_grave, dead_grave ] }; + key { [ z, Z, 0x100017F, 0x1001E9B ] }; + // long s, long s dot + key { [ x, X, NoSymbol, NoSymbol ] }; + key { [ c, C, NoSymbol, NoSymbol ] }; + key { [ v, V, dead_caron, dead_caron ] }; + key { [ b, B, NoSymbol, NoSymbol ] }; + key { [ n, N, NoSymbol, NoSymbol ] }; + key { [ m, M, NoSymbol, NoSymbol ] }; + key { [ comma, less, dead_cedilla, dead_cedilla ] }; + key { [ period, greater, dead_abovedot, dead_abovedot ] }; + key { [ slash, question, dead_belowdot, dead_belowdot ] }; + + key { [ space, space, space, nobreakspace ] }; + + include "level3(ralt_switch)" + + include "compose(rwin)" +}; + +// +// Ogham keyboard map for XFree86 +// +// Seamus O Ciardhuain (17 December 2002) +// +// Ogham keyboard layout as recommended in I.S. 434:1999. +// Suitable for multi-layout xkbcomp. +// Character names are given as in the Unicode standard, +// range U+1680 to U+169F. + +partial alphanumeric_keys +xkb_symbols "ogam" { + + name[Group1] = "Ireland - Ogham"; + + key.type[Group1] = "ONE_LEVEL"; + + key { type[Group1]="TWO_LEVEL", + [ 0x100169B, 0x100169C ] }; + // OGHAM FEATHER MARK, OGHAM REVERSED FEATHER MARK + + key { [ 0x1001680 ] }; // OGHAM SPACE MARK + + key { [ 0x100169C ] }; // OGHAM REVERSED FEATHER MARK + + key { [ space ] }; + + // + // Top Row QWERTYUIOP + // + key { [ 0x100168A ] }; // OGHAM LETTER CEIRT + key { [ 0x1001695 ] }; // OGHAM LETTER EABHADH + key { [ 0x1001693 ] }; // OGHAM LETTER EADHADH + key { [ 0x100168F ] }; // OGHAM LETTER RUIS + key { [ 0x1001688 ] }; // OGHAM LETTER TINNE + key { [ 0x1001698 ] }; // OGHAM LETTER IFIN + key { [ 0x1001692 ] }; // OGHAM LETTER UR + key { [ 0x1001694 ] }; // OGHAM LETTER IODHADH + key { [ 0x1001691 ] }; // OGHAM LETTER ONN + key { [ 0x100169A ] }; // OGHAM LETTER PEITH + + // + // Middle Row ASDFGHJKL + // + key { [ 0x1001690 ] }; // OGHAM LETTER AILM + key { [ 0x1001684 ] }; // OGHAM LETTER SAIL + key { [ 0x1001687 ] }; // OGHAM LETTER DAIR + key { [ 0x1001683 ] }; // OGHAM LETTER FEARN + key { [ 0x100168C ] }; // OGHAM LETTER GORT + key { [ 0x1001686 ] }; // OGHAM LETTER UATH + key { [ 0x1001697 ] }; // OGHAM LETTER UILLEANN + key { [ 0x1001696 ] }; // OGHAM LETTER OR + key { [ 0x1001682 ] }; // OGHAM LETTER LUIS + + // + // Bottom Row ZXCVBNM + // + key { [ 0x100168E ] }; // OGHAM LETTER STRAIF + key { [ 0x1001699 ] }; // OGHAM LETTER EAMHANCHOLL + key { [ 0x1001689 ] }; // OGHAM LETTER COLL + key { [ 0x100168D ] }; // OGHAM LETTER NGEADAL + key { [ 0x1001681 ] }; // OGHAM LETTER BEITH + key { [ 0x1001685 ] }; // OGHAM LETTER NION + key { [ 0x100168B ] }; // OGHAM LETTER MUIN + + // As an extension because and may not be + // available or sensible. These are also a bit more + // intuitive on a standard Irish keyboard. + key { [ 0x100169C ] }; // OGHAM REVERSED FEATHER MARK + key { [ 0x100169B ] }; // OGHAM FEATHER MARK + key { [ 0x1001680 ] }; // OGHAM SPACE MARK + + include "compose(rwin)" +}; + +partial alphanumeric_keys +xkb_symbols "ogam_is434" { + + // This has the full layout of IS434 with an Irish QWERTY keyboard, + // and the Ogham characters accessed when CAPS LOCK is on. + + name[Group1] = "Ireland - Ogham IS434"; + + key.type[Group1] = "THREE_LEVEL"; + + key { type[Group1] = "FOUR_LEVEL_ALPHABETIC", + [ backslash, bar, 0x100169B, 0x100169C ] }; + // OGHAM FEATHER MARK, OGHAM REVERSED FEATHER MARK + + key { [ numbersign, asciitilde, 0x1001680 ] }; // OGHAM SPACE MARK + key { [ grave, notsign, 0x100169C ] }; // OGHAM REVERSED FEATHER MARK + key { [ space, space, space ] }; + + // + // Numeric row + // + key { type[Group1]="TWO_LEVEL", [ 1, exclam ] }; + key { type[Group1]="TWO_LEVEL", [ 2, quotedbl ] }; + key { type[Group1]="TWO_LEVEL", [ 3, sterling ] }; + key { [ 4, dollar, EuroSign ] }; + key { type[Group1]="TWO_LEVEL", [ 5, percent ] }; + key { type[Group1]="TWO_LEVEL", [ 6, asciicircum ] }; + key { [ 7, ampersand, 0x100204A ] }; // Tironian Et + key { type[Group1]="TWO_LEVEL", [ 8, asterisk ] }; + key { type[Group1]="TWO_LEVEL", [ 9, parenleft ] }; + key { type[Group1]="TWO_LEVEL", [ 0, parenright ] }; + key { type[Group1]="TWO_LEVEL", [ minus, underscore ] }; + key { type[Group1]="TWO_LEVEL", [ equal, plus ] }; + + // + // Top Row QWERTYUIOP + // + key { [ q, Q, 0x100168A ] }; // OGHAM LETTER CEIRT + key { [ w, W, 0x1001695 ] }; // OGHAM LETTER EABHADH + key { [ e, E, 0x1001693 ] }; // OGHAM LETTER EADHADH + key { [ r, R, 0x100168F ] }; // OGHAM LETTER RUIS + key { [ t, T, 0x1001688 ] }; // OGHAM LETTER TINNE + key { [ y, Y, 0x1001698 ] }; // OGHAM LETTER IFIN + key { [ u, U, 0x1001692 ] }; // OGHAM LETTER UR + key { [ i, I, 0x1001694 ] }; // OGHAM LETTER IODHADH + key { [ o, O, 0x1001691 ] }; // OGHAM LETTER ONN + key { [ p, P, 0x100169A ] }; // OGHAM LETTER PEITH + + // + // Middle Row ASDFGHJKL + // + key { [ a, A, 0x1001690 ] }; // OGHAM LETTER AILM + key { [ s, S, 0x1001684 ] }; // OGHAM LETTER SAIL + key { [ d, D, 0x1001687 ] }; // OGHAM LETTER DAIR + key { [ f, F, 0x1001683 ] }; // OGHAM LETTER FEARN + key { [ g, G, 0x100168C ] }; // OGHAM LETTER GORT + key { [ h, H, 0x1001686 ] }; // OGHAM LETTER UATH + key { [ j, J, 0x1001697 ] }; // OGHAM LETTER UILLEANN + key { [ k, K, 0x1001696 ] }; // OGHAM LETTER OR + key { [ l, L, 0x1001682 ] }; // OGHAM LETTER LUIS + + // + // Bottom Row ZXCVBNM + // + key { [ z, Z, 0x100168E ] }; // OGHAM LETTER STRAIF + key { [ x, X, 0x1001699 ] }; // OGHAM LETTER EAMHANCHOLL + key { [ c, C, 0x1001689 ] }; // OGHAM LETTER COLL + key { [ v, V, 0x100168D ] }; // OGHAM LETTER NGEADAL + key { [ b, B, 0x1001681 ] }; // OGHAM LETTER BEITH + key { [ n, N, 0x1001685 ] }; // OGHAM LETTER NION + key { [ m, M, 0x100168B ] }; // OGHAM LETTER MUIN + + // As an extension because and may not be + // available or sensible. These are also a bit more + // intuitive on a standard Irish keyboard. + key { [ comma, less, 0x100169C ] }; // OGHAM REVERSED FEATHER MARK + key { [ period, greater, 0x100169B ] }; // OGHAM FEATHER MARK + key { [ slash, question, 0x1001680 ] }; // OGHAM SPACE MARK + + // The standard says the Ogham characters should be accessed when + // Caps Lock is down; not clear if this means it should lock but + // seems logical. + + key { type[Group1] = "ONE_LEVEL", [ ISO_Level3_Lock ] }; + + // Also allow access to Ogham characters using RALT for convenience + include "level3(ralt_switch)" + + // Redefine Scroll Lock as locking shift in case that's needed. + // Also overcomes annoying use of Scroll Lock LED inherited from + // US symbols but not relevant here since we're not changing group. + key {type[Group1] = "ONE_LEVEL", [ Shift_Lock ] }; + modifier_map Shift { Shift_Lock }; + + include "compose(rwin)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/il b/xorg-server/xkeyboard-config/symbols/il index cc29b128e..1ae574335 100644 --- a/xorg-server/xkeyboard-config/symbols/il +++ b/xorg-server/xkeyboard-config/symbols/il @@ -1,255 +1,251 @@ -// $XKeyboardConfig$ - -// based on a keyboard map from an 'xkb/symbols/il' file -// -// $XFree86: xc/programs/xkbcomp/symbols/il,v 1.3 2003/01/07 02:03:44 dawes Exp $ - -// This is a partial implemetation of the Israeli standard SI-1452 -// It does not implement changes to the English layout ("Alt-English"), -// as I believe that it is not the job of this layout to modify the English -// layout. -partial default alphanumeric_keys -xkb_symbols "basic" { - // uses the kbd layout in use in Israel. - - name[Group1]= "Israel"; - - key { [ slash, Q ] }; - key { [ apostrophe, W ] }; - key { [ hebrew_resh, R ] }; - key { [ hebrew_aleph,T ] }; - key { [ hebrew_tet, Y ] }; - key { [ hebrew_waw, U ] }; - key { [ hebrew_finalnun, I ] }; - key { [ hebrew_finalmem, O ] }; - key { [ hebrew_pe, P ] }; - - key { [ hebrew_dalet,S ] }; - key { [ hebrew_gimel,D ] }; - key { [ hebrew_kaph, F ] }; - key { [ hebrew_ayin, G ] }; - key { [ hebrew_yod, H ] }; - key { [ hebrew_chet, J ] }; - key { [ hebrew_lamed, K ] }; - key { [ hebrew_finalkaph, L ] }; - key { [ hebrew_finalpe, colon ] }; - key { [ comma, quotedbl ] }; - - key { [ hebrew_zain, Z ] }; - key { [ hebrew_samech, X ] }; - key { [ hebrew_bet, C ] }; - key { [ hebrew_he, V ] }; - key { [ hebrew_nun, B ] }; - key { [ hebrew_mem, N ] }; - key { [ hebrew_zade, M ] }; - // Mirrored: - key { [ hebrew_taw, greater ] }; - key { [ hebrew_finalzade, less ] }; - - key.type[Group1] = "THREE_LEVEL"; - - key { [ semicolon, asciitilde,0x10005b0 ]}; // Sheva - key { [ period, question, 0x10005c3 ]}; // Sof Pasuq - key { [ hebrew_qoph, E, EuroSign ]}; - key { [ hebrew_shin, A, 0x10020AA ]}; - - // The following may get overriden by the iso9995-3(basic101) symbols. - // therefore they are included here. - // Including them isn't a great idea (for instance: what if group 1 uses - // UK keyboard mapping, and maps shift-3 to sterling? This mapping won't - // preserve that, and I'm not sure that this is a good feature. - key { [ 1, exclam , 0x10005b1 ]}; // H. Segol - key { [ 2, at , 0x10005b2 ]}; // H. Patah - key { [ 3, numbersign , 0x10005b3 ]}; // H. Qamats - key { [ 4, dollar , 0x10005b4 ]}; // Hiriq - key { [ 5, percent , 0x10005b5 ]}; // Tsere - key { [ 6, asciicircum , 0x10005b6 ]}; // Segol - key { [ 7, ampersand , 0x10005b7 ]}; // Patah - key { [ 8, asterisk , 0x10005b8 ]}; // Qamats - // Mirrored: - key { [ 9, parenright , 0x10005c2 ]}; // Sin dot - key { [ 0, parenleft , 0x10005c1 ]}; // Shin dot - key { [ minus, underscore , 0x10005b9 ]}; // Holam - key { [ equal, plus , 0x10005bc ]}; // Dagesh/Shuruq - - // Mirrored: - key { [ bracketright, braceright, 0x10005bf ]}; // Rafe - key { [ bracketleft, braceleft, 0x10005bd ]}; // Meteg - - key { [ backslash, bar, 0x10005bb ]}; // Qubuts - - include "level3(ralt_switch)" -}; - - -// nikud patter based on Dekel Tsur's Hebrew mapping for LyX -partial alphanumeric_keys -xkb_symbols "lyx" { - name[Group1]= "Israel - lyx"; - - key { [ semicolon, asciitilde ] }; - // On some key (e.g. AD01, right below) there is not yet mapping for the - // second shift level. Since I could not figure a simple way to map this - // to "emit nothing", it is currently mapped to the same letter of the - // first shift level (avoiding mapping may risk it be used by a character - // from a different group). - key { [ slash, slash ] }; - key { [ apostrophe, apostrophe ] }; - key { [ hebrew_qoph, 0x10005b8 ] }; // Qamats - key { [ hebrew_resh, 0x10005bc ] }; // Dagesh/Shuruq - key { [ hebrew_aleph, 0x100200e ] }; // LRM - key { [ hebrew_tet, 0x100200f ] }; // RLM - key { [ hebrew_waw, 0x10005b9 ] }; // Holam - key { [ hebrew_finalnun,hebrew_finalnun] }; - key { [ hebrew_finalmem,hebrew_finalmem] }; - key { [ hebrew_pe, 0x10005b7 ] }; // Patah - - key { [ hebrew_shin, 0x10005b0 ] }; // Sheva - key { [ hebrew_dalet, 0x10005bc ] }; // Dagesh/Shuruq - key { [ hebrew_gimel, hebrew_gimel ] }; - key { [ hebrew_kaph, hebrew_kaph ] }; - key { [ hebrew_ayin, 0x10005c2 ] }; // Sin dot - key { [ hebrew_yod, 0x10005c1 ] }; // Shin dot - key { [ hebrew_chet, 0x10005b4 ] }; // Hiriq - key { [ hebrew_lamed, 0x10020aa ] }; // NIS - key { [ hebrew_finalkaph,hebrew_finalkaph] }; - key { [ hebrew_finalpe, colon ] }; - key { [ comma, quotedbl ] }; - - key { [ hebrew_zain, hebrew_zain ] }; - key { [ hebrew_samech,0x10005b6 ] }; // Segol - key { [ hebrew_bet, 0x10005bb ] }; // Qubuts - key { [ hebrew_he, 0x10005b1 ] }; // H. Segol - key { [ hebrew_nun, 0x10005b2 ] }; // H. Patah - key { [ hebrew_mem, 0x10005b3 ] }; // H. Qamats - key { [ hebrew_zade, 0x10005b5 ] }; // Tsere - key { [ hebrew_taw, greater ] }; - key { [ hebrew_finalzade, less ] }; - key { [ period, question ] }; - - // Note the parens mirroring below: - key { [ bracketright, braceright ] }; - key { [ bracketleft, braceleft ] }; - key { [ 9 , parenright ] }; - key { [ 0 , parenleft ] }; - - key { [ minus , 0x10005be ] }; // H. Hiphen - key { [ equal , plus ] }; -}; - - -partial alphanumeric_keys -xkb_symbols "phonetic" { - - // uses the phonetic layout from old Slackware 'il.map' file - - name[Group1]= "Israel - Phonetic"; - - key { [ equal, plus, hebrew_doublelowline, hebrew_doublelowline ]}; - - key { [ hebrew_qoph, hebrew_qoph ] }; - key { [ hebrew_waw, hebrew_waw ] }; - key { [ hebrew_aleph, hebrew_aleph ] }; - key { [ hebrew_resh, hebrew_resh ] }; - key { [ hebrew_taw, hebrew_tet ] }; - key { [ hebrew_ayin, hebrew_ayin ] }; - key { [ hebrew_waw, hebrew_waw ] }; - key { [ hebrew_yod, hebrew_yod ] }; - key { [ hebrew_samech, hebrew_samech ] }; - key { [ hebrew_pe, hebrew_finalpe ] }; - - key { [ hebrew_aleph, hebrew_aleph ] }; - key { [ hebrew_shin, hebrew_shin ] }; - key { [ hebrew_dalet, hebrew_dalet ] }; - key { [ hebrew_pe, hebrew_finalpe ] }; - key { [ hebrew_gimel, hebrew_gimel ] }; - key { [ hebrew_he, hebrew_he ] }; - key { [ hebrew_yod, hebrew_yod ] }; - key { [ hebrew_kaph, hebrew_finalkaph ] }; - key { [ hebrew_lamed, hebrew_lamed ] }; - - key { [ hebrew_zain, hebrew_zain ] }; - key { [ hebrew_chet, hebrew_chet ] }; - key { [ hebrew_zade, hebrew_finalzade ] }; - key { [ hebrew_waw, hebrew_waw ] }; - key { [ hebrew_bet, hebrew_bet ] }; - key { [ hebrew_nun, hebrew_finalnun ] }; - key { [ hebrew_mem, hebrew_finalmem ] }; -}; - -// The 'Biblical Hebrew' keyboard layout as defined by Tiro for use with the -// 'SBL Hebrew' font was added 2006.11.13 by Sebastian J. Bronner -// . Its primary features (as compared to the lyx layout) -// are that the consonants are in the Israeli standard positions, that a great -// multitude of glyphs can be input directly from the keyboard, and that it is -// the closest thing to a standard layout a theologian can hope for. -// Documentation (including printable keyboard tables), SBL Hebrew font, and -// keyboard layout for Windows are available at -// http://www.sbl-site.org/Resources/Resources_BiblicalFonts.aspx. -// -// It is of interest that the 'basic' layout defined first in this file (as -// ships with x.org disagrees in the non-consonant characters that the Tiro- -// layout claims to be the Israeli standard. Tiros apparent diligence in the -// PDF-documentation accompanying the keyboard-layout-files lead me to put -// greater stock in their claim than in this file. Therefore, the 'biblical' -// layout below does not include 'il(basic)' but redoes the _whole_ thing from -// scratch. - -partial alphanumeric_keys -xkb_symbols "biblical" { - name[Group1]= "Israel - Biblical Hebrew (Tiro)"; - key.type = "FOUR_LEVEL_SEMIALPHABETIC"; - - key { [ U05C3, U05AE, semicolon, asciitilde ] }; - key { [ 1, U05A9, VoidSymbol, exclam ] }; - key { [ 2, U0599, VoidSymbol, at ] }; - key { [ 3, U0592, VoidSymbol, numbersign ] }; - key { [ 4, U05AF, NewSheqelSign, dollar ] }; - key { [ 5, VoidSymbol, U200D, percent ] }; - key { [ 6, U05B9, U200C, asciicircum ] }; - key { [ 7, U05BF, U034F, ampersand ] }; - key { [ 8, U05C2, U200E, asterisk ] }; - key { [ 9, U05C1, U200F, parenright ] }; - key { [ 0, U059D, U25CC, parenleft ] }; - key { [ U05BE, U05A0, minus, underscore ] }; - key { [ equal, U05BC, VoidSymbol, plus ] }; - - key { [ U0307, U05C4, U0308, slash ] }; - key { [ U05F3, U05AC, U05F4, apostrophe ] }; - key { [ hebrew_qoph, U05AB, U20AC ] }; - key { [ hebrew_resh, U059F ] }; - key { [ hebrew_aleph, U0593 ] }; - key { [ hebrew_tet, U059E ] }; - key { [ hebrew_waw, U059C, U05F0 ] }; - key { [ hebrew_finalnun, U05A1 ] }; - key { [ hebrew_finalmem, U0595 ] }; - key { [ hebrew_pe, U0594 ] }; - key { [ bracketright, U0597, VoidSymbol, braceright ] }; - key { [ bracketleft, U0598, VoidSymbol, braceleft ] }; - key { [ U05C0, U05A8, backslash, bar ] }; - - key { [ hebrew_shin, U05BD ] }; - key { [ hebrew_dalet, U05B0 ] }; - key { [ hebrew_gimel, U05BB ] }; - key { [ hebrew_kaph, U05B4 ] }; - key { [ hebrew_ayin, U05B1 ] }; - key { [ hebrew_yod, U05B6, U05F2 ] }; - key { [ hebrew_chet, U05B5, U05F1 ] }; - key { [ hebrew_lamed, U05B3 ] }; - key { [ hebrew_finalkaph, U05B8, U05C7 ] }; - key { [ hebrew_finalpe, U05B2, VoidSymbol, colon ] }; - key { [ U059a, U05B7, comma, quotedbl ] }; - - key { [ hebrew_zain, U05C5 ] }; - key { [ hebrew_samech, U05A4 ] }; - key { [ hebrew_bet, U05AA, U05A2 ] }; - key { [ hebrew_he, U05A6 ] }; - key { [ hebrew_nun, U05A5, U05C6 ] }; - key { [ hebrew_mem, U05A7 ] }; - key { [ hebrew_zade, U059B ] }; - key { [ hebrew_taw, U0591, VoidSymbol, greater ] }; - key { [ hebrew_finalzade, U0596, VoidSymbol, less ] }; - key { [ U05AD, U05A3, period, question ] }; - - key { [ space, space, thinspace, nobreakspace ] }; -}; +// based on a keyboard map from an 'xkb/symbols/il' file + +// This is a partial implemetation of the Israeli standard SI-1452 +// It does not implement changes to the English layout ("Alt-English"), +// as I believe that it is not the job of this layout to modify the English +// layout. +partial default alphanumeric_keys +xkb_symbols "basic" { + // uses the kbd layout in use in Israel. + + name[Group1]= "Israel"; + + key { [ slash, Q ] }; + key { [ apostrophe, W ] }; + key { [ hebrew_resh, R ] }; + key { [ hebrew_aleph,T ] }; + key { [ hebrew_tet, Y ] }; + key { [ hebrew_waw, U ] }; + key { [ hebrew_finalnun, I ] }; + key { [ hebrew_finalmem, O ] }; + key { [ hebrew_pe, P ] }; + + key { [ hebrew_dalet,S ] }; + key { [ hebrew_gimel,D ] }; + key { [ hebrew_kaph, F ] }; + key { [ hebrew_ayin, G ] }; + key { [ hebrew_yod, H ] }; + key { [ hebrew_chet, J ] }; + key { [ hebrew_lamed, K ] }; + key { [ hebrew_finalkaph, L ] }; + key { [ hebrew_finalpe, colon ] }; + key { [ comma, quotedbl ] }; + + key { [ hebrew_zain, Z ] }; + key { [ hebrew_samech, X ] }; + key { [ hebrew_bet, C ] }; + key { [ hebrew_he, V ] }; + key { [ hebrew_nun, B ] }; + key { [ hebrew_mem, N ] }; + key { [ hebrew_zade, M ] }; + // Mirrored: + key { [ hebrew_taw, greater ] }; + key { [ hebrew_finalzade, less ] }; + + key.type[Group1] = "THREE_LEVEL"; + + key { [ semicolon, asciitilde,0x10005b0 ]}; // Sheva + key { [ period, question, 0x10005c3 ]}; // Sof Pasuq + key { [ hebrew_qoph, E, EuroSign ]}; + key { [ hebrew_shin, A, 0x10020AA ]}; + + // The following may get overriden by the iso9995-3(basic101) symbols. + // therefore they are included here. + // Including them isn't a great idea (for instance: what if group 1 uses + // UK keyboard mapping, and maps shift-3 to sterling? This mapping won't + // preserve that, and I'm not sure that this is a good feature. + key { [ 1, exclam , 0x10005b1 ]}; // H. Segol + key { [ 2, at , 0x10005b2 ]}; // H. Patah + key { [ 3, numbersign , 0x10005b3 ]}; // H. Qamats + key { [ 4, dollar , 0x10005b4 ]}; // Hiriq + key { [ 5, percent , 0x10005b5 ]}; // Tsere + key { [ 6, asciicircum , 0x10005b6 ]}; // Segol + key { [ 7, ampersand , 0x10005b7 ]}; // Patah + key { [ 8, asterisk , 0x10005b8 ]}; // Qamats + // Mirrored: + key { [ 9, parenright , 0x10005c2 ]}; // Sin dot + key { [ 0, parenleft , 0x10005c1 ]}; // Shin dot + key { [ minus, underscore , 0x10005b9 ]}; // Holam + key { [ equal, plus , 0x10005bc ]}; // Dagesh/Shuruq + + // Mirrored: + key { [ bracketright, braceright, 0x10005bf ]}; // Rafe + key { [ bracketleft, braceleft, 0x10005bd ]}; // Meteg + + key { [ backslash, bar, 0x10005bb ]}; // Qubuts + + include "level3(ralt_switch)" +}; + + +// nikud patter based on Dekel Tsur's Hebrew mapping for LyX +partial alphanumeric_keys +xkb_symbols "lyx" { + name[Group1]= "Israel - lyx"; + + key { [ semicolon, asciitilde ] }; + // On some key (e.g. AD01, right below) there is not yet mapping for the + // second shift level. Since I could not figure a simple way to map this + // to "emit nothing", it is currently mapped to the same letter of the + // first shift level (avoiding mapping may risk it be used by a character + // from a different group). + key { [ slash, slash ] }; + key { [ apostrophe, apostrophe ] }; + key { [ hebrew_qoph, 0x10005b8 ] }; // Qamats + key { [ hebrew_resh, 0x10005bc ] }; // Dagesh/Shuruq + key { [ hebrew_aleph, 0x100200e ] }; // LRM + key { [ hebrew_tet, 0x100200f ] }; // RLM + key { [ hebrew_waw, 0x10005b9 ] }; // Holam + key { [ hebrew_finalnun,hebrew_finalnun] }; + key { [ hebrew_finalmem,hebrew_finalmem] }; + key { [ hebrew_pe, 0x10005b7 ] }; // Patah + + key { [ hebrew_shin, 0x10005b0 ] }; // Sheva + key { [ hebrew_dalet, 0x10005bc ] }; // Dagesh/Shuruq + key { [ hebrew_gimel, hebrew_gimel ] }; + key { [ hebrew_kaph, hebrew_kaph ] }; + key { [ hebrew_ayin, 0x10005c2 ] }; // Sin dot + key { [ hebrew_yod, 0x10005c1 ] }; // Shin dot + key { [ hebrew_chet, 0x10005b4 ] }; // Hiriq + key { [ hebrew_lamed, 0x10020aa ] }; // NIS + key { [ hebrew_finalkaph,hebrew_finalkaph] }; + key { [ hebrew_finalpe, colon ] }; + key { [ comma, quotedbl ] }; + + key { [ hebrew_zain, hebrew_zain ] }; + key { [ hebrew_samech,0x10005b6 ] }; // Segol + key { [ hebrew_bet, 0x10005bb ] }; // Qubuts + key { [ hebrew_he, 0x10005b1 ] }; // H. Segol + key { [ hebrew_nun, 0x10005b2 ] }; // H. Patah + key { [ hebrew_mem, 0x10005b3 ] }; // H. Qamats + key { [ hebrew_zade, 0x10005b5 ] }; // Tsere + key { [ hebrew_taw, greater ] }; + key { [ hebrew_finalzade, less ] }; + key { [ period, question ] }; + + // Note the parens mirroring below: + key { [ bracketright, braceright ] }; + key { [ bracketleft, braceleft ] }; + key { [ 9 , parenright ] }; + key { [ 0 , parenleft ] }; + + key { [ minus , 0x10005be ] }; // H. Hiphen + key { [ equal , plus ] }; +}; + + +partial alphanumeric_keys +xkb_symbols "phonetic" { + + // uses the phonetic layout from old Slackware 'il.map' file + + name[Group1]= "Israel - Phonetic"; + + key { [ equal, plus, hebrew_doublelowline, hebrew_doublelowline ]}; + + key { [ hebrew_qoph, hebrew_qoph ] }; + key { [ hebrew_waw, hebrew_waw ] }; + key { [ hebrew_aleph, hebrew_aleph ] }; + key { [ hebrew_resh, hebrew_resh ] }; + key { [ hebrew_taw, hebrew_tet ] }; + key { [ hebrew_ayin, hebrew_ayin ] }; + key { [ hebrew_waw, hebrew_waw ] }; + key { [ hebrew_yod, hebrew_yod ] }; + key { [ hebrew_samech, hebrew_samech ] }; + key { [ hebrew_pe, hebrew_finalpe ] }; + + key { [ hebrew_aleph, hebrew_aleph ] }; + key { [ hebrew_shin, hebrew_shin ] }; + key { [ hebrew_dalet, hebrew_dalet ] }; + key { [ hebrew_pe, hebrew_finalpe ] }; + key { [ hebrew_gimel, hebrew_gimel ] }; + key { [ hebrew_he, hebrew_he ] }; + key { [ hebrew_yod, hebrew_yod ] }; + key { [ hebrew_kaph, hebrew_finalkaph ] }; + key { [ hebrew_lamed, hebrew_lamed ] }; + + key { [ hebrew_zain, hebrew_zain ] }; + key { [ hebrew_chet, hebrew_chet ] }; + key { [ hebrew_zade, hebrew_finalzade ] }; + key { [ hebrew_waw, hebrew_waw ] }; + key { [ hebrew_bet, hebrew_bet ] }; + key { [ hebrew_nun, hebrew_finalnun ] }; + key { [ hebrew_mem, hebrew_finalmem ] }; +}; + +// The 'Biblical Hebrew' keyboard layout as defined by Tiro for use with the +// 'SBL Hebrew' font was added 2006.11.13 by Sebastian J. Bronner +// . Its primary features (as compared to the lyx layout) +// are that the consonants are in the Israeli standard positions, that a great +// multitude of glyphs can be input directly from the keyboard, and that it is +// the closest thing to a standard layout a theologian can hope for. +// Documentation (including printable keyboard tables), SBL Hebrew font, and +// keyboard layout for Windows are available at +// http://www.sbl-site.org/Resources/Resources_BiblicalFonts.aspx. +// +// It is of interest that the 'basic' layout defined first in this file (as +// ships with x.org disagrees in the non-consonant characters that the Tiro- +// layout claims to be the Israeli standard. Tiros apparent diligence in the +// PDF-documentation accompanying the keyboard-layout-files lead me to put +// greater stock in their claim than in this file. Therefore, the 'biblical' +// layout below does not include 'il(basic)' but redoes the _whole_ thing from +// scratch. + +partial alphanumeric_keys +xkb_symbols "biblical" { + name[Group1]= "Israel - Biblical Hebrew (Tiro)"; + key.type = "FOUR_LEVEL_SEMIALPHABETIC"; + + key { [ U05C3, U05AE, semicolon, asciitilde ] }; + key { [ 1, U05A9, VoidSymbol, exclam ] }; + key { [ 2, U0599, VoidSymbol, at ] }; + key { [ 3, U0592, VoidSymbol, numbersign ] }; + key { [ 4, U05AF, NewSheqelSign, dollar ] }; + key { [ 5, VoidSymbol, U200D, percent ] }; + key { [ 6, U05B9, U200C, asciicircum ] }; + key { [ 7, U05BF, U034F, ampersand ] }; + key { [ 8, U05C2, U200E, asterisk ] }; + key { [ 9, U05C1, U200F, parenright ] }; + key { [ 0, U059D, U25CC, parenleft ] }; + key { [ U05BE, U05A0, minus, underscore ] }; + key { [ equal, U05BC, VoidSymbol, plus ] }; + + key { [ U0307, U05C4, U0308, slash ] }; + key { [ U05F3, U05AC, U05F4, apostrophe ] }; + key { [ hebrew_qoph, U05AB, U20AC ] }; + key { [ hebrew_resh, U059F ] }; + key { [ hebrew_aleph, U0593 ] }; + key { [ hebrew_tet, U059E ] }; + key { [ hebrew_waw, U059C, U05F0 ] }; + key { [ hebrew_finalnun, U05A1 ] }; + key { [ hebrew_finalmem, U0595 ] }; + key { [ hebrew_pe, U0594 ] }; + key { [ bracketright, U0597, VoidSymbol, braceright ] }; + key { [ bracketleft, U0598, VoidSymbol, braceleft ] }; + key { [ U05C0, U05A8, backslash, bar ] }; + + key { [ hebrew_shin, U05BD ] }; + key { [ hebrew_dalet, U05B0 ] }; + key { [ hebrew_gimel, U05BB ] }; + key { [ hebrew_kaph, U05B4 ] }; + key { [ hebrew_ayin, U05B1 ] }; + key { [ hebrew_yod, U05B6, U05F2 ] }; + key { [ hebrew_chet, U05B5, U05F1 ] }; + key { [ hebrew_lamed, U05B3 ] }; + key { [ hebrew_finalkaph, U05B8, U05C7 ] }; + key { [ hebrew_finalpe, U05B2, VoidSymbol, colon ] }; + key { [ U059a, U05B7, comma, quotedbl ] }; + + key { [ hebrew_zain, U05C5 ] }; + key { [ hebrew_samech, U05A4 ] }; + key { [ hebrew_bet, U05AA, U05A2 ] }; + key { [ hebrew_he, U05A6 ] }; + key { [ hebrew_nun, U05A5, U05C6 ] }; + key { [ hebrew_mem, U05A7 ] }; + key { [ hebrew_zade, U059B ] }; + key { [ hebrew_taw, U0591, VoidSymbol, greater ] }; + key { [ hebrew_finalzade, U0596, VoidSymbol, less ] }; + key { [ U05AD, U05A3, period, question ] }; + + key { [ space, space, thinspace, nobreakspace ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/in b/xorg-server/xkeyboard-config/symbols/in index dc209978b..5d4dc27b2 100644 --- a/xorg-server/xkeyboard-config/symbols/in +++ b/xorg-server/xkeyboard-config/symbols/in @@ -1,5 +1,3 @@ -// $XKeyboardConfig$ - // This layout includes all Indian layouts, including: // - Bengali // - Gujarati @@ -166,8 +164,6 @@ xkb_symbols "bolnagri" { }; // based on a keyboard map from an 'xkb/symbols/ben' file -// -// $XFree86: xc/programs/xkbcomp/symbols/ben,v 1.2 2002/11/22 04:03:28 dawes Exp $ partial alphanumeric_keys xkb_symbols "ben" { @@ -668,8 +664,6 @@ xkb_symbols "ori" { }; // based on a keyboard map from an 'xkb/symbols/tml' file -// -// $XFree86: xc/programs/xkbcomp/symbols/tml,v 1.2 2002/11/22 04:03:28 dawes Exp $ // INSCRIPT partial alphanumeric_keys xkb_symbols "tam" { @@ -1344,5 +1338,3 @@ xkb_symbols "eng" { include "level3(ralt_switch)" }; - - diff --git a/xorg-server/xkeyboard-config/symbols/inet b/xorg-server/xkeyboard-config/symbols/inet index 3868c8f9c..8f1151768 100644 --- a/xorg-server/xkeyboard-config/symbols/inet +++ b/xorg-server/xkeyboard-config/symbols/inet @@ -1,7 +1,3 @@ -// $XKeyboardConfig$ - -// $XFree86: xc/programs/xkbcomp/symbols/inet,v 1.38 2004/01/17 14:59:37 pascal Exp $ - // EAK (Easy Access, Internet, Multimedia, PDA) keyboards // Copyright (C) 2002 Stanislav Brabec // @@ -126,6 +122,7 @@ xkb_symbols "evdev" { // key { [ ] }; // KEY_MACRO key { [ plusminus ] }; + key { [ XF86LaunchA ] }; key { [ XF86MenuKB ] }; key { [ XF86Calculator ] }; // key { [ ] }; // KEY_SETUP @@ -174,6 +171,7 @@ xkb_symbols "evdev" { key { [ XF86AudioPause ] }; key { [ XF86Launch3 ] }; key { [ XF86Launch4 ] }; + key { [ XF86LaunchB ] }; key { [ XF86Suspend ] }; key { [ XF86Close ] }; key { [ XF86AudioPlay ] }; diff --git a/xorg-server/xkeyboard-config/symbols/iq b/xorg-server/xkeyboard-config/symbols/iq index b2b742b95..f30332940 100644 --- a/xorg-server/xkeyboard-config/symbols/iq +++ b/xorg-server/xkeyboard-config/symbols/iq @@ -1,34 +1,33 @@ -// $XKeyboardConfig$ -// Iraque keyboard layout, - -// 3-Level layout - -partial default alphanumeric_keys -xkb_symbols "basic" { - include "ara(basic)" - name[Group1]= "Iraq"; -}; - -partial alphanumeric_keys -xkb_symbols "ku" { - include "tr(ku)" - name[Group1]= "Iraq - Kurdish, Latin Q"; -}; - -partial alphanumeric_keys -xkb_symbols "ku_f" { - include "tr(ku_f)" - name[Group1]= "Iraq - Kurdish, (F)"; -}; - -partial alphanumeric_keys -xkb_symbols "ku_alt" { - include "tr(ku_alt)" - name[Group1]= "Iraq - Kurdish, Latin Alt-Q"; -}; - -partial alphanumeric_keys -xkb_symbols "ku_ara" { - include "ir(ku_ara)" - name[Group1]= "Iraq - Kurdish, Arabic-Latin"; -}; +// Iraque keyboard layout, + +// 3-Level layout + +partial default alphanumeric_keys +xkb_symbols "basic" { + include "ara(basic)" + name[Group1]= "Iraq"; +}; + +partial alphanumeric_keys +xkb_symbols "ku" { + include "tr(ku)" + name[Group1]= "Iraq - Kurdish, Latin Q"; +}; + +partial alphanumeric_keys +xkb_symbols "ku_f" { + include "tr(ku_f)" + name[Group1]= "Iraq - Kurdish, (F)"; +}; + +partial alphanumeric_keys +xkb_symbols "ku_alt" { + include "tr(ku_alt)" + name[Group1]= "Iraq - Kurdish, Latin Alt-Q"; +}; + +partial alphanumeric_keys +xkb_symbols "ku_ara" { + include "ir(ku_ara)" + name[Group1]= "Iraq - Kurdish, Arabic-Latin"; +}; diff --git a/xorg-server/xkeyboard-config/symbols/ir b/xorg-server/xkeyboard-config/symbols/ir index 8332f84e3..6f4618df7 100644 --- a/xorg-server/xkeyboard-config/symbols/ir +++ b/xorg-server/xkeyboard-config/symbols/ir @@ -1,5 +1,3 @@ -// $XKeyboardConfig$ - // Iranian keyboard layout //////////////////////////////////////// @@ -240,4 +238,3 @@ xkb_symbols "ku_ara" { include "nbsp(zwnj2nb3)" include "level3(ralt_switch)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/is b/xorg-server/xkeyboard-config/symbols/is index 53dddc43e..2a37f9da1 100644 --- a/xorg-server/xkeyboard-config/symbols/is +++ b/xorg-server/xkeyboard-config/symbols/is @@ -1,10 +1,7 @@ -// $XKeyboardConfig$ - // based on // XKB keyboard by Hrafnkell Eiriksson - hkelle@rhi.hi.is // fixes by Olafur Osvaldsson - oli@isnic.is // -// $XFree86: xc/programs/xkbcomp/symbols/is,v 1.3 2002/11/26 01:57:25 dawes Exp $ default partial alphanumeric_keys xkb_symbols "basic" { diff --git a/xorg-server/xkeyboard-config/symbols/it b/xorg-server/xkeyboard-config/symbols/it index 9222a1ca4..631fae591 100644 --- a/xorg-server/xkeyboard-config/symbols/it +++ b/xorg-server/xkeyboard-config/symbols/it @@ -1,9 +1,5 @@ -// $XKeyboardConfig$ - // based on a keyboard map from an 'xkb/symbols/it' file // 17 May 2003 Modified by Sebastiano Vigna (vigna@dsi.unimi.it) -// -// $XFree86: xc/programs/xkbcomp/symbols/it,v 1.4 2003/04/19 12:22:12 pascal Exp $ partial default alphanumeric_keys xkb_symbols "basic" { @@ -259,4 +255,3 @@ xkb_symbols "htcdream" { include "level3(alt_switch)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/jp b/xorg-server/xkeyboard-config/symbols/jp index 5e4ba14b7..64b50a44c 100644 --- a/xorg-server/xkeyboard-config/symbols/jp +++ b/xorg-server/xkeyboard-config/symbols/jp @@ -1,5 +1,3 @@ -// $XKeyboardConfig$ - // based on: // symbols for a Japanese 106 keyboard(by tsuka@kawalab.dnj.ynu.ac.jp) diff --git a/xorg-server/xkeyboard-config/symbols/ke b/xorg-server/xkeyboard-config/symbols/ke index 5ec174b7e..6d75d6780 100644 --- a/xorg-server/xkeyboard-config/symbols/ke +++ b/xorg-server/xkeyboard-config/symbols/ke @@ -1,44 +1,42 @@ -// $XKeyboardConfig$ - -// Keyboard layout for Swahili in Arabic script. -// Based on Martin Vidner's Buckwalter transliteration variant of the Arabic keyboard -// Please notify any corrections or omissions to -// Kevin Donnelly (kevin@dotmon.com) - -partial default alphanumeric_keys -xkb_symbols "swa" { - - include "us" - - name[Group1]= "Kenya"; - - key { [ semicolon, colon, 0x01000324, 0x01000324 ] }; //COMBINING DIAERESIS BELOW - key { [apostrophe, quotedbl, 0x01000301, 0x01000308 ] }; //COMBINING ACUTE ACCENT, COMBINING DIAERESIS - key { [ grave, asciitilde, 0x01000300, 0x01000303 ] }; //COMBINING GRAVE ACCENT, COMBINING TILDE - key { [ 6, asciicircum, 0x01000302 ] }; //COMBINING CIRCUMFLEX ACCENT - key { [ 8, asterisk, 0x01000307, 0x01000323 ] }; //COMBINING DOT ABOVE, COMBINING DOT BELOW - key { [ 9, parenleft, 0x01000306 ] }; //COMBINING BREVE - key { [ 0, parenright, 0x0100030c ] }; //COMBINING CARON - key { [ minus, underscore, 0x01000304, 0x01000331 ] }; //COMBINING MACRON,COMBINING MACRON BELOW - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "kik" { - - include "us" - - name[Group1]= "Kenya - Kikuyu"; - - key { [ semicolon, colon, 0x01000324, 0x01000324 ] }; //COMBINING DIAERESIS BELOW - key { [apostrophe, quotedbl, 0x01000301, 0x01000308 ] }; //COMBINING ACUTE ACCENT, COMBINING DIAERESIS - key { [ grave, asciitilde, 0x01000300, 0x01000303 ] }; //COMBINING GRAVE ACCENT, COMBINING TILDE - key { [ 6, asciicircum, 0x01000302 ] }; //COMBINING CIRCUMFLEX ACCENT - key { [ 8, asterisk, 0x01000307, 0x01000323 ] }; //COMBINING DOT ABOVE, COMBINING DOT BELOW - key { [ 9, parenleft, 0x01000306 ] }; //COMBINING BREVE - key { [ 0, parenright, 0x0100030c ] }; //COMBINING CARON - key { [ minus, underscore, 0x01000304, 0x01000331 ] }; //COMBINING MACRON,COMBINING MACRON BELOW - - include "level3(ralt_switch)" -}; +// Keyboard layout for Swahili in Arabic script. +// Based on Martin Vidner's Buckwalter transliteration variant of the Arabic keyboard +// Please notify any corrections or omissions to +// Kevin Donnelly (kevin@dotmon.com) + +partial default alphanumeric_keys +xkb_symbols "swa" { + + include "us" + + name[Group1]= "Kenya"; + + key { [ semicolon, colon, 0x01000324, 0x01000324 ] }; //COMBINING DIAERESIS BELOW + key { [apostrophe, quotedbl, 0x01000301, 0x01000308 ] }; //COMBINING ACUTE ACCENT, COMBINING DIAERESIS + key { [ grave, asciitilde, 0x01000300, 0x01000303 ] }; //COMBINING GRAVE ACCENT, COMBINING TILDE + key { [ 6, asciicircum, 0x01000302 ] }; //COMBINING CIRCUMFLEX ACCENT + key { [ 8, asterisk, 0x01000307, 0x01000323 ] }; //COMBINING DOT ABOVE, COMBINING DOT BELOW + key { [ 9, parenleft, 0x01000306 ] }; //COMBINING BREVE + key { [ 0, parenright, 0x0100030c ] }; //COMBINING CARON + key { [ minus, underscore, 0x01000304, 0x01000331 ] }; //COMBINING MACRON,COMBINING MACRON BELOW + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "kik" { + + include "us" + + name[Group1]= "Kenya - Kikuyu"; + + key { [ semicolon, colon, 0x01000324, 0x01000324 ] }; //COMBINING DIAERESIS BELOW + key { [apostrophe, quotedbl, 0x01000301, 0x01000308 ] }; //COMBINING ACUTE ACCENT, COMBINING DIAERESIS + key { [ grave, asciitilde, 0x01000300, 0x01000303 ] }; //COMBINING GRAVE ACCENT, COMBINING TILDE + key { [ 6, asciicircum, 0x01000302 ] }; //COMBINING CIRCUMFLEX ACCENT + key { [ 8, asterisk, 0x01000307, 0x01000323 ] }; //COMBINING DOT ABOVE, COMBINING DOT BELOW + key { [ 9, parenleft, 0x01000306 ] }; //COMBINING BREVE + key { [ 0, parenright, 0x0100030c ] }; //COMBINING CARON + key { [ minus, underscore, 0x01000304, 0x01000331 ] }; //COMBINING MACRON,COMBINING MACRON BELOW + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/keypad b/xorg-server/xkeyboard-config/symbols/keypad index 4dfa1a7e2..fb3469850 100644 --- a/xorg-server/xkeyboard-config/symbols/keypad +++ b/xorg-server/xkeyboard-config/symbols/keypad @@ -1,6 +1,3 @@ -// $XKeyboardConfig$ -// $Xorg: keypad,v 1.3 2000/08/17 19:54:43 cpqbld Exp $ - partial hidden keypad_keys xkb_symbols "overlay" { include "keypad(overlay1)" diff --git a/xorg-server/xkeyboard-config/symbols/kg b/xorg-server/xkeyboard-config/symbols/kg index be5424799..8687cb608 100644 --- a/xorg-server/xkeyboard-config/symbols/kg +++ b/xorg-server/xkeyboard-config/symbols/kg @@ -1,135 +1,133 @@ -// $XKeyboardConfig$ - -// Kirghiz (aka Kyrgyz) Standard Keyboard -// -// Standard - Phonetic -// ______________- ________________ -// ё1234567890өң ё1234567890яю -// Ё!"№;%:?*()ӨҢ Ё!"№;%:?-()ЯЮ -// -// йцукенгшщзхъү өүертыуиопчшъ -// фывапролджэ асдфгңйклэь -// ячсмитьбю.(,) зхжвбнмцщ.(,) - -// Authors: -// Timur Jamakeev -// Ilyas Bakirov -// Yury Fedorov -// Emil Asanov -// Ulan Melisbek - - -// Kyrgyz standard keyboard -partial default alphanumeric_keys -xkb_symbols "basic" { - - name[Group1]= "Kyrgyzstan"; - - key { [ 1, exclam ] }; - key { [ 2, quotedbl ] }; - key { [ 3, numerosign ] }; - key { [ 4, semicolon ] }; - key { [ 5, percent ] }; - key { [ 6, colon ] }; - key { [ 7, question ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ Cyrillic_o_bar, Cyrillic_O_bar ] }; - key { [ Cyrillic_en_descender, Cyrillic_EN_descender ] }; - key { [ Cyrillic_u_straight, Cyrillic_U_straight ] }; - key { [ period, comma ] }; - key { [ slash, bar ] }; - - key { [ Cyrillic_io, Cyrillic_IO ] }; - key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; - key { [ Cyrillic_tse, Cyrillic_TSE ] }; - key { [ Cyrillic_u, Cyrillic_U ] }; - key { [ Cyrillic_ka, Cyrillic_KA ] }; - key { [ Cyrillic_ie, Cyrillic_IE ] }; - key { [ Cyrillic_en, Cyrillic_EN ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; - key { [ Cyrillic_ze, Cyrillic_ZE ] }; - key { [ Cyrillic_ha, Cyrillic_HA ] }; - key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; - key { [ Cyrillic_ef, Cyrillic_EF ] }; - key { [ Cyrillic_yeru, Cyrillic_YERU ] }; - key { [ Cyrillic_ve, Cyrillic_VE ] }; - key { [ Cyrillic_a, Cyrillic_A ] }; - key { [ Cyrillic_pe, Cyrillic_PE ] }; - key { [ Cyrillic_er, Cyrillic_ER ] }; - key { [ Cyrillic_o, Cyrillic_O ] }; - key { [ Cyrillic_el, Cyrillic_EL ] }; - key { [ Cyrillic_de, Cyrillic_DE ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ Cyrillic_e, Cyrillic_E ] }; - key { [ Cyrillic_ya, Cyrillic_YA ] }; - key { [ Cyrillic_che, Cyrillic_CHE ] }; - key { [ Cyrillic_es, Cyrillic_ES ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; - key { [ Cyrillic_i, Cyrillic_I ] }; - key { [ Cyrillic_te, Cyrillic_TE ] }; - key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_be, Cyrillic_BE ] }; - key { [ Cyrillic_yu, Cyrillic_YU ] }; -}; - -// Kyrgyz phonetic layout -partial alphanumeric_keys -xkb_symbols "phonetic" { - - name[Group1]="Kyrgyzstan - Phonetic"; - - key { [ 1, exclam ] }; - key { [ 2, quotedbl ] }; - key { [ 3, numerosign ] }; - key { [ 4, semicolon ] }; - key { [ 5, percent ] }; - key { [ 6, colon ] }; - key { [ 7, question ] }; - key { [ 8, minus ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ Cyrillic_ya, Cyrillic_YA ] }; - key { [ Cyrillic_yu, Cyrillic_YU ] }; - - key { [ Cyrillic_che, Cyrillic_CHE ] }; - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; - key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; - key { [ period, comma ] }; - key { [ Cyrillic_tse, Cyrillic_TSE ] }; - key { [ Cyrillic_e, Cyrillic_E ] }; - key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_io, Cyrillic_IO ] }; - - key { [ Cyrillic_o_bar, Cyrillic_O_bar ] }; - key { [ Cyrillic_ze, Cyrillic_ZE ] }; - key { [ Cyrillic_es, Cyrillic_ES ] }; - key { [ Cyrillic_a, Cyrillic_A ] }; - key { [ Cyrillic_u_straight, Cyrillic_U_straight ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ Cyrillic_ha, Cyrillic_HA ] }; - key { [ Cyrillic_de, Cyrillic_DE ] }; - key { [ Cyrillic_ie, Cyrillic_IE ] }; - key { [ Cyrillic_ve, Cyrillic_VE ] }; - key { [ Cyrillic_ef, Cyrillic_EF ] }; - key { [ Cyrillic_te, Cyrillic_TE ] }; - key { [ Cyrillic_er, Cyrillic_ER ] }; - key { [ Cyrillic_en, Cyrillic_EN ] }; - key { [ Cyrillic_be, Cyrillic_BE ] }; - key { [ Cyrillic_en_descender, Cyrillic_EN_descender ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key { [ Cyrillic_yeru, Cyrillic_YERU ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; - key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; - key { [ Cyrillic_u, Cyrillic_U ] }; - key { [ Cyrillic_ka, Cyrillic_KA ] }; - key { [ Cyrillic_i, Cyrillic_I ] }; - key { [ Cyrillic_o, Cyrillic_O ] }; - key { [ Cyrillic_el, Cyrillic_EL ] }; - key { [ Cyrillic_pe, Cyrillic_PE ] }; - -}; +// Kirghiz (aka Kyrgyz) Standard Keyboard +// +// Standard - Phonetic +// ______________- ________________ +// ё1234567890өң ё1234567890яю +// Ё!"№;%:?*()ӨҢ Ё!"№;%:?-()ЯЮ +// +// йцукенгшщзхъү өүертыуиопчшъ +// фывапролджэ асдфгңйклэь +// ячсмитьбю.(,) зхжвбнмцщ.(,) + +// Authors: +// Timur Jamakeev +// Ilyas Bakirov +// Yury Fedorov +// Emil Asanov +// Ulan Melisbek + + +// Kyrgyz standard keyboard +partial default alphanumeric_keys +xkb_symbols "basic" { + + name[Group1]= "Kyrgyzstan"; + + key { [ 1, exclam ] }; + key { [ 2, quotedbl ] }; + key { [ 3, numerosign ] }; + key { [ 4, semicolon ] }; + key { [ 5, percent ] }; + key { [ 6, colon ] }; + key { [ 7, question ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ Cyrillic_o_bar, Cyrillic_O_bar ] }; + key { [ Cyrillic_en_descender, Cyrillic_EN_descender ] }; + key { [ Cyrillic_u_straight, Cyrillic_U_straight ] }; + key { [ period, comma ] }; + key { [ slash, bar ] }; + + key { [ Cyrillic_io, Cyrillic_IO ] }; + key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; + key { [ Cyrillic_tse, Cyrillic_TSE ] }; + key { [ Cyrillic_u, Cyrillic_U ] }; + key { [ Cyrillic_ka, Cyrillic_KA ] }; + key { [ Cyrillic_ie, Cyrillic_IE ] }; + key { [ Cyrillic_en, Cyrillic_EN ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; + key { [ Cyrillic_ze, Cyrillic_ZE ] }; + key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; + key { [ Cyrillic_ef, Cyrillic_EF ] }; + key { [ Cyrillic_yeru, Cyrillic_YERU ] }; + key { [ Cyrillic_ve, Cyrillic_VE ] }; + key { [ Cyrillic_a, Cyrillic_A ] }; + key { [ Cyrillic_pe, Cyrillic_PE ] }; + key { [ Cyrillic_er, Cyrillic_ER ] }; + key { [ Cyrillic_o, Cyrillic_O ] }; + key { [ Cyrillic_el, Cyrillic_EL ] }; + key { [ Cyrillic_de, Cyrillic_DE ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ Cyrillic_e, Cyrillic_E ] }; + key { [ Cyrillic_ya, Cyrillic_YA ] }; + key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_es, Cyrillic_ES ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; + key { [ Cyrillic_i, Cyrillic_I ] }; + key { [ Cyrillic_te, Cyrillic_TE ] }; + key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_be, Cyrillic_BE ] }; + key { [ Cyrillic_yu, Cyrillic_YU ] }; +}; + +// Kyrgyz phonetic layout +partial alphanumeric_keys +xkb_symbols "phonetic" { + + name[Group1]="Kyrgyzstan - Phonetic"; + + key { [ 1, exclam ] }; + key { [ 2, quotedbl ] }; + key { [ 3, numerosign ] }; + key { [ 4, semicolon ] }; + key { [ 5, percent ] }; + key { [ 6, colon ] }; + key { [ 7, question ] }; + key { [ 8, minus ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ Cyrillic_ya, Cyrillic_YA ] }; + key { [ Cyrillic_yu, Cyrillic_YU ] }; + + key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; + key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; + key { [ period, comma ] }; + key { [ Cyrillic_tse, Cyrillic_TSE ] }; + key { [ Cyrillic_e, Cyrillic_E ] }; + key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_io, Cyrillic_IO ] }; + + key { [ Cyrillic_o_bar, Cyrillic_O_bar ] }; + key { [ Cyrillic_ze, Cyrillic_ZE ] }; + key { [ Cyrillic_es, Cyrillic_ES ] }; + key { [ Cyrillic_a, Cyrillic_A ] }; + key { [ Cyrillic_u_straight, Cyrillic_U_straight ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [ Cyrillic_de, Cyrillic_DE ] }; + key { [ Cyrillic_ie, Cyrillic_IE ] }; + key { [ Cyrillic_ve, Cyrillic_VE ] }; + key { [ Cyrillic_ef, Cyrillic_EF ] }; + key { [ Cyrillic_te, Cyrillic_TE ] }; + key { [ Cyrillic_er, Cyrillic_ER ] }; + key { [ Cyrillic_en, Cyrillic_EN ] }; + key { [ Cyrillic_be, Cyrillic_BE ] }; + key { [ Cyrillic_en_descender, Cyrillic_EN_descender ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; + key { [ Cyrillic_yeru, Cyrillic_YERU ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; + key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; + key { [ Cyrillic_u, Cyrillic_U ] }; + key { [ Cyrillic_ka, Cyrillic_KA ] }; + key { [ Cyrillic_i, Cyrillic_I ] }; + key { [ Cyrillic_o, Cyrillic_O ] }; + key { [ Cyrillic_el, Cyrillic_EL ] }; + key { [ Cyrillic_pe, Cyrillic_PE ] }; + +}; diff --git a/xorg-server/xkeyboard-config/symbols/kh b/xorg-server/xkeyboard-config/symbols/kh index a97eb4420..7fb5b74df 100644 --- a/xorg-server/xkeyboard-config/symbols/kh +++ b/xorg-server/xkeyboard-config/symbols/kh @@ -1,114 +1,113 @@ -// $XKeyboardConfig$ -// -// khmer unicode keyboard for XFree86 4.3 or XOrg -// (might work with older versions, not tested) -// -// layout defined by National Information Communications Technology Development Authority (NiDA) -// http://www.nida.gov.kh -// -// version: 1.0.1 -// -// date: 14.09.2005 -// -// author: Jens Herden (jens at khmeros.info) -// -// -// understanding the symbols: -// -// 0x100yyyy = unicode, yyyy is hexcode -// codes that are not assigned in unicode (0x10017fb-0x10017ff), -// are used to make compositions for special vowels -// -// voidsymbol = no symbol for this combination -// -// all other symbol are defined in: /usr/X11/include/X11/keysymdef.h -// but with a leading 'XK_' -// - -partial default alphanumeric_keys -xkb_symbols "basic" { - name[Group1]= "Cambodia"; - -// there are four levels defined: -// -// normal shift right-alt right-alt + shift -// - -// keys: `1234567890-=\ - key { [ guillemotleft, guillemotright, 0x100200d, voidsymbol ] }; - key { [ 0x10017e1, exclam, 0x100200c, 0x10017f1 ] }; - key { [ 0x10017e2, 0x10017d7, at, 0x10017f2 ] }; - key { [ 0x10017e3, quotedbl, 0x10017d1, 0x10017f3 ] }; - key { [ 0x10017e4, 0x10017db, dollar, 0x10017f4 ] }; - key { [ 0x10017e5, percent, EuroSign, 0x10017f5 ] }; - key { [ 0x10017e6, 0x10017cd, 0x10017d9, 0x10017f6 ] }; - key { [ 0x10017e7, 0x10017d0, 0x10017da, 0x10017f7 ] }; - key { [ 0x10017e8, 0x10017cf, asterisk, 0x10017f8 ] }; - key { [ 0x10017e9, parenleft, braceleft, 0x10017f9 ] }; - key { [ 0x10017e0, parenright, braceright, 0x10017f0 ] }; - key { [ 0x10017a5, 0x10017cc, x, voidsymbol ] }; - key { [ 0x10017b2, equal, 0x10017ce, voidsymbol ] }; - key { [ 0x10017ae, 0x10017ad, backslash, voidsymbol ] }; - -// keys: qwertyuiop[] - key { [ 0x1001786, 0x1001788, 0x10017dc, 0x10019e0 ] }; - key { [ 0x10017b9, 0x10017ba, 0x10017dd, 0x10019e1 ] }; - key { [ 0x10017c1, 0x10017c2, 0x10017af, 0x10019e2 ] }; - key { [ 0x100179a, 0x10017ac, 0x10017ab, 0x10019e3 ] }; - key { [ 0x100178f, 0x1001791, 0x10017a8, 0x10019e4 ] }; - key { [ 0x1001799, 0x10017bd, voidsymbol, 0x10019e5 ] }; - key { [ 0x10017bb, 0x10017bc, voidsymbol, 0x10019e6 ] }; - key { [ 0x10017b7, 0x10017b8, 0x10017a6, 0x10019e7 ] }; - key { [ 0x10017c4, 0x10017c5, 0x10017b1, 0x10019e8 ] }; - key { [ 0x1001795, 0x1001797, 0x10017b0, 0x10019e9 ] }; - key { [ 0x10017c0, 0x10017bf, 0x10017a9, 0x10019ea ] }; - key { [ 0x10017aa, 0x10017a7, 0x10017b3, 0x10019eb ] }; - -// keys: asdfghjkl;' - key { [ 0x10017b6, 0x10017ff, voidsymbol, 0x10019ec ] }; - key { [ 0x100179f, 0x10017c3, voidsymbol, 0x10019ed ] }; - key { [ 0x100178a, 0x100178c, voidsymbol, 0x10019ee ] }; - key { [ 0x1001790, 0x1001792, voidsymbol, 0x10019ef ] }; - key { [ 0x1001784, 0x10017a2, voidsymbol, 0x10019f0 ] }; - key { [ 0x10017a0, 0x10017c7, voidsymbol, 0x10019f1 ] }; - key { [ 0x10017d2, 0x1001789, voidsymbol, 0x10019f2 ] }; - key { [ 0x1001780, 0x1001782, 0x100179d, 0x10019f3 ] }; - key { [ 0x100179b, 0x10017a1, voidsymbol, 0x10019f4 ] }; - key { [ 0x10017be, 0x10017fe, 0x10017d6, 0x10019f5 ] }; - key { [ 0x10017cb, 0x10017c9, 0x10017c8, 0x10019f6 ] }; - -// keys: zxcvbnm,./ - key { [ 0x100178b, 0x100178d, voidsymbol, 0x10019f7 ] }; - key { [ 0x1001781, 0x1001783, voidsymbol, 0x10019f8 ] }; - key { [ 0x1001785, 0x1001787, voidsymbol, 0x10019f9 ] }; - key { [ 0x100179c, 0x10017fd, voidsymbol, 0x10019fa ] }; - key { [ 0x1001794, 0x1001796, 0x100179e, 0x10019fb ] }; - key { [ 0x1001793, 0x100178e, voidsymbol, 0x10019fc ] }; - key { [ 0x1001798, 0x10017c6, voidsymbol, 0x10019fd ] }; - key { [ 0x10017fc, 0x10017fb, comma, 0x10019fe ] }; - key { [ 0x10017d4, 0x10017d5, period, 0x10019ff ] }; - key { [ 0x10017ca, question, slash, voidsymbol ] }; - - key { [ 0x100200b, space, 0x10000a0, voidsymbol ] }; - key { [ Alt_R ] }; - -// third level with right-Alt - include "level3(ralt_switch)" - -}; - -partial alphanumeric_keys -xkb_symbols "olpc" { - include "kh(basic)" - -// Contact Walter@laptop.org - - key { [ 0x10017be, 0x10017c8, 0x10017d6, 0x10019f5 ] }; - key { [ 0x10017e1, 0x100200c, exclam, 0x10017f1 ] }; - key { [ 0x10017e3, 0x10017d1, quotedbl, 0x10017f3 ] }; - key { [ 0x10017e5, EuroSign, percent, 0x10017f5 ] }; - key { [ 0x10017b2, 0x10017ce, equal, voidsymbol ] }; - - //language key - include "group(olpc)" -}; +// +// khmer unicode keyboard for XFree86 4.3 or XOrg +// (might work with older versions, not tested) +// +// layout defined by National Information Communications Technology Development Authority (NiDA) +// http://www.nida.gov.kh +// +// version: 1.0.1 +// +// date: 14.09.2005 +// +// author: Jens Herden (jens at khmeros.info) +// +// +// understanding the symbols: +// +// 0x100yyyy = unicode, yyyy is hexcode +// codes that are not assigned in unicode (0x10017fb-0x10017ff), +// are used to make compositions for special vowels +// +// voidsymbol = no symbol for this combination +// +// all other symbol are defined in: /usr/X11/include/X11/keysymdef.h +// but with a leading 'XK_' +// + +partial default alphanumeric_keys +xkb_symbols "basic" { + name[Group1]= "Cambodia"; + +// there are four levels defined: +// +// normal shift right-alt right-alt + shift +// + +// keys: `1234567890-=\ + key { [ guillemotleft, guillemotright, 0x100200d, voidsymbol ] }; + key { [ 0x10017e1, exclam, 0x100200c, 0x10017f1 ] }; + key { [ 0x10017e2, 0x10017d7, at, 0x10017f2 ] }; + key { [ 0x10017e3, quotedbl, 0x10017d1, 0x10017f3 ] }; + key { [ 0x10017e4, 0x10017db, dollar, 0x10017f4 ] }; + key { [ 0x10017e5, percent, EuroSign, 0x10017f5 ] }; + key { [ 0x10017e6, 0x10017cd, 0x10017d9, 0x10017f6 ] }; + key { [ 0x10017e7, 0x10017d0, 0x10017da, 0x10017f7 ] }; + key { [ 0x10017e8, 0x10017cf, asterisk, 0x10017f8 ] }; + key { [ 0x10017e9, parenleft, braceleft, 0x10017f9 ] }; + key { [ 0x10017e0, parenright, braceright, 0x10017f0 ] }; + key { [ 0x10017a5, 0x10017cc, x, voidsymbol ] }; + key { [ 0x10017b2, equal, 0x10017ce, voidsymbol ] }; + key { [ 0x10017ae, 0x10017ad, backslash, voidsymbol ] }; + +// keys: qwertyuiop[] + key { [ 0x1001786, 0x1001788, 0x10017dc, 0x10019e0 ] }; + key { [ 0x10017b9, 0x10017ba, 0x10017dd, 0x10019e1 ] }; + key { [ 0x10017c1, 0x10017c2, 0x10017af, 0x10019e2 ] }; + key { [ 0x100179a, 0x10017ac, 0x10017ab, 0x10019e3 ] }; + key { [ 0x100178f, 0x1001791, 0x10017a8, 0x10019e4 ] }; + key { [ 0x1001799, 0x10017bd, voidsymbol, 0x10019e5 ] }; + key { [ 0x10017bb, 0x10017bc, voidsymbol, 0x10019e6 ] }; + key { [ 0x10017b7, 0x10017b8, 0x10017a6, 0x10019e7 ] }; + key { [ 0x10017c4, 0x10017c5, 0x10017b1, 0x10019e8 ] }; + key { [ 0x1001795, 0x1001797, 0x10017b0, 0x10019e9 ] }; + key { [ 0x10017c0, 0x10017bf, 0x10017a9, 0x10019ea ] }; + key { [ 0x10017aa, 0x10017a7, 0x10017b3, 0x10019eb ] }; + +// keys: asdfghjkl;' + key { [ 0x10017b6, 0x10017ff, voidsymbol, 0x10019ec ] }; + key { [ 0x100179f, 0x10017c3, voidsymbol, 0x10019ed ] }; + key { [ 0x100178a, 0x100178c, voidsymbol, 0x10019ee ] }; + key { [ 0x1001790, 0x1001792, voidsymbol, 0x10019ef ] }; + key { [ 0x1001784, 0x10017a2, voidsymbol, 0x10019f0 ] }; + key { [ 0x10017a0, 0x10017c7, voidsymbol, 0x10019f1 ] }; + key { [ 0x10017d2, 0x1001789, voidsymbol, 0x10019f2 ] }; + key { [ 0x1001780, 0x1001782, 0x100179d, 0x10019f3 ] }; + key { [ 0x100179b, 0x10017a1, voidsymbol, 0x10019f4 ] }; + key { [ 0x10017be, 0x10017fe, 0x10017d6, 0x10019f5 ] }; + key { [ 0x10017cb, 0x10017c9, 0x10017c8, 0x10019f6 ] }; + +// keys: zxcvbnm,./ + key { [ 0x100178b, 0x100178d, voidsymbol, 0x10019f7 ] }; + key { [ 0x1001781, 0x1001783, voidsymbol, 0x10019f8 ] }; + key { [ 0x1001785, 0x1001787, voidsymbol, 0x10019f9 ] }; + key { [ 0x100179c, 0x10017fd, voidsymbol, 0x10019fa ] }; + key { [ 0x1001794, 0x1001796, 0x100179e, 0x10019fb ] }; + key { [ 0x1001793, 0x100178e, voidsymbol, 0x10019fc ] }; + key { [ 0x1001798, 0x10017c6, voidsymbol, 0x10019fd ] }; + key { [ 0x10017fc, 0x10017fb, comma, 0x10019fe ] }; + key { [ 0x10017d4, 0x10017d5, period, 0x10019ff ] }; + key { [ 0x10017ca, question, slash, voidsymbol ] }; + + key { [ 0x100200b, space, 0x10000a0, voidsymbol ] }; + key { [ Alt_R ] }; + +// third level with right-Alt + include "level3(ralt_switch)" + +}; + +partial alphanumeric_keys +xkb_symbols "olpc" { + include "kh(basic)" + +// Contact Walter@laptop.org + + key { [ 0x10017be, 0x10017c8, 0x10017d6, 0x10019f5 ] }; + key { [ 0x10017e1, 0x100200c, exclam, 0x10017f1 ] }; + key { [ 0x10017e3, 0x10017d1, quotedbl, 0x10017f3 ] }; + key { [ 0x10017e5, EuroSign, percent, 0x10017f5 ] }; + key { [ 0x10017b2, 0x10017ce, equal, voidsymbol ] }; + + //language key + include "group(olpc)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/kpdl b/xorg-server/xkeyboard-config/symbols/kpdl index a8bdfb7f9..1e4a537a9 100644 --- a/xorg-server/xkeyboard-config/symbols/kpdl +++ b/xorg-server/xkeyboard-config/symbols/kpdl @@ -1,105 +1,102 @@ -// $XKeyboardConfig$ -// $Xorg: keypad,v 1.3 2000/08/17 19:54:43 cpqbld Exp $ - -// The key is a mess. -// It was probably originally meant to be a decimal separator. -// Except since it was declared by USA people it didn't use the original -// SI separator "," but a "." (since then the USA managed to f-up the SI -// by making "." an accepted alternative, but standards still use "," as -// default) -// As a result users of SI-abiding countries expect either a "." or a "," -// or a "decimal_separator" which may or may not be translated in one of the -// above depending on applications. -// It's not possible to define a default per-country since user expectations -// depend on the conflicting choices of their most-used applications, -// operating system, etc. Therefore it needs to be a configuration setting -// Copyright © 2007 Nicolas Mailhot - - -// Legacy #1 -// This assumes KP_Decimal will be translated in a dot -partial keypad_keys -xkb_symbols "dot" { - - key.type[Group1]="KEYPAD" ; - - key { [ KP_Delete, KP_Decimal ] }; // -}; - - -// Legacy #2 -// This assumes KP_Separator will be translated in a comma -partial keypad_keys -xkb_symbols "comma" { - - key.type[Group1]="KEYPAD" ; - - key { [ KP_Delete, KP_Separator ] }; // -}; - - -// Period , usual keyboard serigraphy in most countries -partial keypad_keys -xkb_symbols "dotoss" { - - key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ; - - key { [ KP_Delete, period, comma, 0x100202F ] }; // . , ⍽ (narrow no-break space) -}; - - -// Period , usual keyboard serigraphy in most countries, latin-9 restriction -partial keypad_keys -xkb_symbols "dotoss_latin9" { - - key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ; - - key { [ KP_Delete, period, comma, nobreakspace ] }; // . , ⍽ (no-break space) -}; - - -// Comma , what most non anglo-saxon people consider the real separator -partial keypad_keys -xkb_symbols "commaoss" { - - key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ; - - key { [ KP_Delete, comma, period, 0x100202F ] }; // , . ⍽ (narrow no-break space) -}; - - -// Momayyez : Bahrain, Iran, Iraq, Kuwait, Oman, Qatar, Saudi Arabia, Syria, UAE -partial keypad_keys -xkb_symbols "momayyezoss" { - - key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ; - - key { [ KP_Delete, 0x100066B, comma, 0x100202F ] }; // ? , ⍽ (narrow no-break space) -}; - - -// Abstracted , pray everything will work out (it usually does not) -partial keypad_keys -xkb_symbols "kposs" { - - key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ; - - key { [ KP_Delete, KP_Decimal, KP_Separator, 0x100202F ] }; // ? ? ⍽ (narrow no-break space) -}; - -// Spreadsheets may be configured to use the dot as decimal -// punctuation, comma as a thousands separator and then semi-colon as -// the list separator. Of these, dot and semi-colon is most important -// when entering data by the keyboard; the comma can then be inferred -// and added to the presentation afterwards. Using semi-colon as a -// general separator may in fact be preferred to avoid ambiguities -// in data files. Most times a decimal separator is hard-coded, it -// seems to be period, probably since this is the syntax used in -// (most) programming languages. -partial keypad_keys -xkb_symbols "semi" { - - key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ; - - key { [ NoSymbol, NoSymbol, semicolon ] }; -}; +// The key is a mess. +// It was probably originally meant to be a decimal separator. +// Except since it was declared by USA people it didn't use the original +// SI separator "," but a "." (since then the USA managed to f-up the SI +// by making "." an accepted alternative, but standards still use "," as +// default) +// As a result users of SI-abiding countries expect either a "." or a "," +// or a "decimal_separator" which may or may not be translated in one of the +// above depending on applications. +// It's not possible to define a default per-country since user expectations +// depend on the conflicting choices of their most-used applications, +// operating system, etc. Therefore it needs to be a configuration setting +// Copyright © 2007 Nicolas Mailhot + + +// Legacy #1 +// This assumes KP_Decimal will be translated in a dot +partial keypad_keys +xkb_symbols "dot" { + + key.type[Group1]="KEYPAD" ; + + key { [ KP_Delete, KP_Decimal ] }; // +}; + + +// Legacy #2 +// This assumes KP_Separator will be translated in a comma +partial keypad_keys +xkb_symbols "comma" { + + key.type[Group1]="KEYPAD" ; + + key { [ KP_Delete, KP_Separator ] }; // +}; + + +// Period , usual keyboard serigraphy in most countries +partial keypad_keys +xkb_symbols "dotoss" { + + key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ; + + key { [ KP_Delete, period, comma, 0x100202F ] }; // . , ⍽ (narrow no-break space) +}; + + +// Period , usual keyboard serigraphy in most countries, latin-9 restriction +partial keypad_keys +xkb_symbols "dotoss_latin9" { + + key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ; + + key { [ KP_Delete, period, comma, nobreakspace ] }; // . , ⍽ (no-break space) +}; + + +// Comma , what most non anglo-saxon people consider the real separator +partial keypad_keys +xkb_symbols "commaoss" { + + key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ; + + key { [ KP_Delete, comma, period, 0x100202F ] }; // , . ⍽ (narrow no-break space) +}; + + +// Momayyez : Bahrain, Iran, Iraq, Kuwait, Oman, Qatar, Saudi Arabia, Syria, UAE +partial keypad_keys +xkb_symbols "momayyezoss" { + + key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ; + + key { [ KP_Delete, 0x100066B, comma, 0x100202F ] }; // ? , ⍽ (narrow no-break space) +}; + + +// Abstracted , pray everything will work out (it usually does not) +partial keypad_keys +xkb_symbols "kposs" { + + key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ; + + key { [ KP_Delete, KP_Decimal, KP_Separator, 0x100202F ] }; // ? ? ⍽ (narrow no-break space) +}; + +// Spreadsheets may be configured to use the dot as decimal +// punctuation, comma as a thousands separator and then semi-colon as +// the list separator. Of these, dot and semi-colon is most important +// when entering data by the keyboard; the comma can then be inferred +// and added to the presentation afterwards. Using semi-colon as a +// general separator may in fact be preferred to avoid ambiguities +// in data files. Most times a decimal separator is hard-coded, it +// seems to be period, probably since this is the syntax used in +// (most) programming languages. +partial keypad_keys +xkb_symbols "semi" { + + key.type[Group1]="FOUR_LEVEL_MIXED_KEYPAD" ; + + key { [ NoSymbol, NoSymbol, semicolon ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/kr b/xorg-server/xkeyboard-config/symbols/kr index 4c2fa9673..013c5c101 100644 --- a/xorg-server/xkeyboard-config/symbols/kr +++ b/xorg-server/xkeyboard-config/symbols/kr @@ -1,30 +1,26 @@ -// $XKeyboardConfig$ -// - -default alphanumeric_keys -xkb_symbols "kr106" { - include "us" - name[Group1]= "Korea, Republic of"; - include "kr(koreankeys)" -}; - -alphanumeric_keys -xkb_symbols "kr104" { - include "us" - name[Group1]= "Korea, Republic of - 101/104 key Compatible"; - include "kr(koreankeys)" - include "kr(koreankeys_raltctl)" -}; - -partial hidden function_keys -xkb_symbols "koreankeys" { - key { [ Hangul ] }; - key { [ Hangul_Hanja ] }; -}; - -partial hidden function_keys -xkb_symbols "koreankeys_raltctl" { - key { [ Hangul ] }; - key { [ Hangul_Hanja ] }; -}; - +default alphanumeric_keys +xkb_symbols "kr106" { + include "us" + name[Group1]= "Korea, Republic of"; + include "kr(koreankeys)" +}; + +alphanumeric_keys +xkb_symbols "kr104" { + include "us" + name[Group1]= "Korea, Republic of - 101/104 key Compatible"; + include "kr(koreankeys)" + include "kr(koreankeys_raltctl)" +}; + +partial hidden function_keys +xkb_symbols "koreankeys" { + key { [ Hangul ] }; + key { [ Hangul_Hanja ] }; +}; + +partial hidden function_keys +xkb_symbols "koreankeys_raltctl" { + key { [ Hangul ] }; + key { [ Hangul_Hanja ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/kz b/xorg-server/xkeyboard-config/symbols/kz index 55bbb1f66..1110cc4ad 100644 --- a/xorg-server/xkeyboard-config/symbols/kz +++ b/xorg-server/xkeyboard-config/symbols/kz @@ -1,218 +1,215 @@ -// $XKeyboardConfig$ - -// Based on http://www.sci.kz/~sairan/keyboard/kzkbd.html -// Baurzhan Ismagulov -// -// $XFree86: xc/programs/xkbcomp/symbols/pc/ru,v 1.4 2003/05/05 12:11:10 pascal Exp $ - -// TODO: -// 1. AltGr with TLDE and LSGT. -// 2. Dead key for ruskaz and kazrus. -// 3. Ctrl + . -// 4. Alt-Tab. - -// RST KazSSR 903-90 -// levels 3 and 4 are non-standard extensions -partial default alphanumeric_keys -xkb_symbols "basic" { - - name[Group1] = "Kazakhstan"; - -key.type[group1] = "FOUR_LEVEL"; - - key { [ parenleft, parenright, Cyrillic_io, Cyrillic_IO ] }; - key { [ doublelowquotemark, exclam ] }; - key { [ comma, semicolon ] }; - key { [ period, colon ] }; - key { [ backslash, slash ] }; - key { [ numerosign, question ] }; - key { [ less, greater, bar, brokenbar ] }; - -key.type[group1] = "ALPHABETIC"; - - key { [ Cyrillic_schwa, Cyrillic_SCHWA ] }; - key { [ Ukrainian_i, Ukrainian_I ] }; - key { [ Cyrillic_en_descender, Cyrillic_EN_descender ] }; - key { [ Cyrillic_ghe_bar, Cyrillic_GHE_bar ] }; - key { [ Cyrillic_u_straight, Cyrillic_U_straight ] }; - key { [ Cyrillic_u_straight_bar, Cyrillic_U_straight_bar ] }; - key { [ Cyrillic_ka_descender, Cyrillic_KA_descender ] }; - key { [ Cyrillic_o_bar, Cyrillic_O_bar ] }; - key { [ Cyrillic_shha, Cyrillic_SHHA ] }; - - key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; - key { [ Cyrillic_tse, Cyrillic_TSE ] }; - key { [ Cyrillic_u, Cyrillic_U ] }; - key { [ Cyrillic_ka, Cyrillic_KA ] }; - key { [ Cyrillic_ie, Cyrillic_IE ] }; - key { [ Cyrillic_en, Cyrillic_EN ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; - key { [ Cyrillic_ze, Cyrillic_ZE ] }; - key { [ Cyrillic_ha, Cyrillic_HA ] }; - key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; - key { [ Cyrillic_ef, Cyrillic_EF ] }; - key { [ Cyrillic_yeru, Cyrillic_YERU ] }; - key { [ Cyrillic_ve, Cyrillic_VE ] }; - key { [ Cyrillic_a, Cyrillic_A ] }; - key { [ Cyrillic_pe, Cyrillic_PE ] }; - key { [ Cyrillic_er, Cyrillic_ER ] }; - key { [ Cyrillic_o, Cyrillic_O ] }; - key { [ Cyrillic_el, Cyrillic_EL ] }; - key { [ Cyrillic_de, Cyrillic_DE ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ Cyrillic_e, Cyrillic_E ] }; - key { [ Cyrillic_ya, Cyrillic_YA ] }; - key { [ Cyrillic_che, Cyrillic_CHE ] }; - key { [ Cyrillic_es, Cyrillic_ES ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; - key { [ Cyrillic_te, Cyrillic_TE ] }; - key { [ Cyrillic_i, Cyrillic_I ] }; - key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_be, Cyrillic_BE ] }; - key { [ Cyrillic_yu, Cyrillic_YU ] }; - -key.type[group1]="TWO_LEVEL"; -}; - -// Kikkarin KZ1 -partial alphanumeric_keys -xkb_symbols "ruskaz" { - - name[Group1] = "Kazakhstan - Russian with Kazakh"; - -key.type[group1] = "FOUR_LEVEL"; - - key { [ 1, exclam ] }; - key { [ 2, quotedbl, at ] }; - key { [ 3, numerosign, numbersign ] }; - key { [ 4, semicolon, dollar ] }; - key { [ 5, percent ] }; - key { [ 6, colon, asciicircum ] }; - key { [ 7, question, ampersand ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ minus, underscore ] }; - key { [ equal, plus ] }; - key { [ backslash, slash, bar ] }; - key { [ period, comma, slash, question ] }; - key { [ less, greater, bar, brokenbar ] }; - -key.type[group1] = "FOUR_LEVEL_ALPHABETIC"; - - key { [ Cyrillic_io, Cyrillic_IO ] }; - key { [ Cyrillic_shorti, Cyrillic_SHORTI, Cyrillic_u_straight_bar, Cyrillic_U_straight_bar ] }; - key { [ Cyrillic_tse, Cyrillic_TSE ] }; - key { [ Cyrillic_u, Cyrillic_U, Cyrillic_u_straight, Cyrillic_U_straight ] }; - key { [ Cyrillic_ka, Cyrillic_KA, Cyrillic_ka_descender, Cyrillic_KA_descender ] }; - key { [ Cyrillic_ie, Cyrillic_IE, Cyrillic_io, Cyrillic_IO ] }; - key { [ Cyrillic_en, Cyrillic_EN, Cyrillic_en_descender, Cyrillic_EN_descender ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE, Cyrillic_ghe_bar, Cyrillic_GHE_bar ] }; - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; - key { [ Cyrillic_ze, Cyrillic_ZE ] }; - key { [ Cyrillic_ha, Cyrillic_HA, Cyrillic_shha, Cyrillic_SHHA ] }; - key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; - key { [ Cyrillic_ef, Cyrillic_EF ] }; - key { [ Cyrillic_yeru, Cyrillic_YERU ] }; - key { [ Cyrillic_ve, Cyrillic_VE ] }; - key { [ Cyrillic_a, Cyrillic_A, Cyrillic_schwa, Cyrillic_SCHWA ] }; - key { [ Cyrillic_pe, Cyrillic_PE ] }; - key { [ Cyrillic_er, Cyrillic_ER ] }; - key { [ Cyrillic_o, Cyrillic_O, Cyrillic_o_bar, Cyrillic_O_bar ] }; - key { [ Cyrillic_el, Cyrillic_EL ] }; - key { [ Cyrillic_de, Cyrillic_DE ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ Cyrillic_e, Cyrillic_E ] }; - key { [ Cyrillic_ya, Cyrillic_YA ] }; - key { [ Cyrillic_che, Cyrillic_CHE ] }; - key { [ Cyrillic_es, Cyrillic_ES ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; - key { [ Cyrillic_te, Cyrillic_TE ] }; - key { [ Cyrillic_i, Cyrillic_I, Ukrainian_i, Ukrainian_I ] }; - key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_be, Cyrillic_BE ] }; - key { [ Cyrillic_yu, Cyrillic_YU ] }; -}; - -// Kikkarin KZ2 -partial alphanumeric_keys -xkb_symbols "kazrus" { - - name[Group1] = "Kazakhstan - Kazakh with Russian"; - -key.type[group1] = "FOUR_LEVEL"; - - key { [ 1, exclam ] }; - key { [ 2, quotedbl, at ] }; - key { [ 3, numerosign, numbersign ] }; - key { [ 4, semicolon, dollar ] }; - key { [ 5, percent ] }; - key { [ 6, colon, asciicircum ] }; - key { [ 7, question, ampersand ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ minus, underscore ] }; - key { [ equal, plus ] }; - key { [ backslash, slash, bar ] }; - key { [ period, comma, slash, question ] }; - key { [ less, greater, bar, brokenbar ] }; - -key.type[group1] = "FOUR_LEVEL_ALPHABETIC"; - - key { [ Cyrillic_io, Cyrillic_IO ] }; - key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; - key { [ Cyrillic_en_descender, Cyrillic_EN_descender, Cyrillic_tse, Cyrillic_TSE ] }; - key { [ Cyrillic_u, Cyrillic_U ] }; - key { [ Cyrillic_ka, Cyrillic_KA, Cyrillic_ka_descender, Cyrillic_KA_descender ] }; - key { [ Cyrillic_ie, Cyrillic_IE, Cyrillic_io, Cyrillic_IO ] }; - key { [ Cyrillic_en, Cyrillic_EN ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Cyrillic_ghe_bar, Cyrillic_GHE_bar, Cyrillic_shcha, Cyrillic_SHCHA ] }; - key { [ Cyrillic_ze, Cyrillic_ZE ] }; - key { [ Cyrillic_ha, Cyrillic_HA, Cyrillic_shha, Cyrillic_SHHA ] }; - key { [ Cyrillic_u_straight_bar, Cyrillic_U_straight_bar, Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; - key { [ Cyrillic_o_bar, Cyrillic_O_bar, Cyrillic_ef, Cyrillic_EF ] }; - key { [ Cyrillic_yeru, Cyrillic_YERU ] }; - key { [ Cyrillic_ka_descender, Cyrillic_KA_descender, Cyrillic_ve, Cyrillic_VE ] }; - key { [ Cyrillic_a, Cyrillic_A ] }; - key { [ Cyrillic_pe, Cyrillic_PE ] }; - key { [ Cyrillic_er, Cyrillic_ER ] }; - key { [ Cyrillic_o, Cyrillic_O ] }; - key { [ Cyrillic_el, Cyrillic_EL ] }; - key { [ Cyrillic_de, Cyrillic_DE ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ Cyrillic_schwa, Cyrillic_SCHWA, Cyrillic_e, Cyrillic_E ] }; - key { [ Cyrillic_ya, Cyrillic_YA ] }; - key { [ Ukrainian_i, Ukrainian_I, Cyrillic_che, Cyrillic_CHE ] }; - key { [ Cyrillic_es, Cyrillic_ES ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; - key { [ Cyrillic_te, Cyrillic_TE ] }; - key { [ Cyrillic_i, Cyrillic_I ] }; - key { [ Cyrillic_u_straight, Cyrillic_U_straight, Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_be, Cyrillic_BE ] }; - key { [ Cyrillic_yu, Cyrillic_YU ] }; -}; - -partial alphanumeric_keys -xkb_symbols "olpc" { - -// Contact: Walter Bender - -// We moved the Cyrillic IO off of the Tilde Key as an Alt-GR character -// and moved it onto the Backslash key, making Backslash and Bar available -// through the Latin side of the keyboard. - - include "kz(basic)" - - name[Group1] = "Kazakhstan"; - - key { [ parenleft, parenright ] }; - key { [ Cyrillic_io, Cyrillic_IO ] }; - - include "group(olpc)" -}; +// Based on http://www.sci.kz/~sairan/keyboard/kzkbd.html +// Baurzhan Ismagulov +// + +// TODO: +// 1. AltGr with TLDE and LSGT. +// 2. Dead key for ruskaz and kazrus. +// 3. Ctrl + . +// 4. Alt-Tab. + +// RST KazSSR 903-90 +// levels 3 and 4 are non-standard extensions +partial default alphanumeric_keys +xkb_symbols "basic" { + + name[Group1] = "Kazakhstan"; + +key.type[group1] = "FOUR_LEVEL"; + + key { [ parenleft, parenright, Cyrillic_io, Cyrillic_IO ] }; + key { [ doublelowquotemark, exclam ] }; + key { [ comma, semicolon ] }; + key { [ period, colon ] }; + key { [ backslash, slash ] }; + key { [ numerosign, question ] }; + key { [ less, greater, bar, brokenbar ] }; + +key.type[group1] = "ALPHABETIC"; + + key { [ Cyrillic_schwa, Cyrillic_SCHWA ] }; + key { [ Ukrainian_i, Ukrainian_I ] }; + key { [ Cyrillic_en_descender, Cyrillic_EN_descender ] }; + key { [ Cyrillic_ghe_bar, Cyrillic_GHE_bar ] }; + key { [ Cyrillic_u_straight, Cyrillic_U_straight ] }; + key { [ Cyrillic_u_straight_bar, Cyrillic_U_straight_bar ] }; + key { [ Cyrillic_ka_descender, Cyrillic_KA_descender ] }; + key { [ Cyrillic_o_bar, Cyrillic_O_bar ] }; + key { [ Cyrillic_shha, Cyrillic_SHHA ] }; + + key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; + key { [ Cyrillic_tse, Cyrillic_TSE ] }; + key { [ Cyrillic_u, Cyrillic_U ] }; + key { [ Cyrillic_ka, Cyrillic_KA ] }; + key { [ Cyrillic_ie, Cyrillic_IE ] }; + key { [ Cyrillic_en, Cyrillic_EN ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; + key { [ Cyrillic_ze, Cyrillic_ZE ] }; + key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; + key { [ Cyrillic_ef, Cyrillic_EF ] }; + key { [ Cyrillic_yeru, Cyrillic_YERU ] }; + key { [ Cyrillic_ve, Cyrillic_VE ] }; + key { [ Cyrillic_a, Cyrillic_A ] }; + key { [ Cyrillic_pe, Cyrillic_PE ] }; + key { [ Cyrillic_er, Cyrillic_ER ] }; + key { [ Cyrillic_o, Cyrillic_O ] }; + key { [ Cyrillic_el, Cyrillic_EL ] }; + key { [ Cyrillic_de, Cyrillic_DE ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ Cyrillic_e, Cyrillic_E ] }; + key { [ Cyrillic_ya, Cyrillic_YA ] }; + key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_es, Cyrillic_ES ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; + key { [ Cyrillic_te, Cyrillic_TE ] }; + key { [ Cyrillic_i, Cyrillic_I ] }; + key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_be, Cyrillic_BE ] }; + key { [ Cyrillic_yu, Cyrillic_YU ] }; + +key.type[group1]="TWO_LEVEL"; +}; + +// Kikkarin KZ1 +partial alphanumeric_keys +xkb_symbols "ruskaz" { + + name[Group1] = "Kazakhstan - Russian with Kazakh"; + +key.type[group1] = "FOUR_LEVEL"; + + key { [ 1, exclam ] }; + key { [ 2, quotedbl, at ] }; + key { [ 3, numerosign, numbersign ] }; + key { [ 4, semicolon, dollar ] }; + key { [ 5, percent ] }; + key { [ 6, colon, asciicircum ] }; + key { [ 7, question, ampersand ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ minus, underscore ] }; + key { [ equal, plus ] }; + key { [ backslash, slash, bar ] }; + key { [ period, comma, slash, question ] }; + key { [ less, greater, bar, brokenbar ] }; + +key.type[group1] = "FOUR_LEVEL_ALPHABETIC"; + + key { [ Cyrillic_io, Cyrillic_IO ] }; + key { [ Cyrillic_shorti, Cyrillic_SHORTI, Cyrillic_u_straight_bar, Cyrillic_U_straight_bar ] }; + key { [ Cyrillic_tse, Cyrillic_TSE ] }; + key { [ Cyrillic_u, Cyrillic_U, Cyrillic_u_straight, Cyrillic_U_straight ] }; + key { [ Cyrillic_ka, Cyrillic_KA, Cyrillic_ka_descender, Cyrillic_KA_descender ] }; + key { [ Cyrillic_ie, Cyrillic_IE, Cyrillic_io, Cyrillic_IO ] }; + key { [ Cyrillic_en, Cyrillic_EN, Cyrillic_en_descender, Cyrillic_EN_descender ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE, Cyrillic_ghe_bar, Cyrillic_GHE_bar ] }; + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; + key { [ Cyrillic_ze, Cyrillic_ZE ] }; + key { [ Cyrillic_ha, Cyrillic_HA, Cyrillic_shha, Cyrillic_SHHA ] }; + key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; + key { [ Cyrillic_ef, Cyrillic_EF ] }; + key { [ Cyrillic_yeru, Cyrillic_YERU ] }; + key { [ Cyrillic_ve, Cyrillic_VE ] }; + key { [ Cyrillic_a, Cyrillic_A, Cyrillic_schwa, Cyrillic_SCHWA ] }; + key { [ Cyrillic_pe, Cyrillic_PE ] }; + key { [ Cyrillic_er, Cyrillic_ER ] }; + key { [ Cyrillic_o, Cyrillic_O, Cyrillic_o_bar, Cyrillic_O_bar ] }; + key { [ Cyrillic_el, Cyrillic_EL ] }; + key { [ Cyrillic_de, Cyrillic_DE ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ Cyrillic_e, Cyrillic_E ] }; + key { [ Cyrillic_ya, Cyrillic_YA ] }; + key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_es, Cyrillic_ES ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; + key { [ Cyrillic_te, Cyrillic_TE ] }; + key { [ Cyrillic_i, Cyrillic_I, Ukrainian_i, Ukrainian_I ] }; + key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_be, Cyrillic_BE ] }; + key { [ Cyrillic_yu, Cyrillic_YU ] }; +}; + +// Kikkarin KZ2 +partial alphanumeric_keys +xkb_symbols "kazrus" { + + name[Group1] = "Kazakhstan - Kazakh with Russian"; + +key.type[group1] = "FOUR_LEVEL"; + + key { [ 1, exclam ] }; + key { [ 2, quotedbl, at ] }; + key { [ 3, numerosign, numbersign ] }; + key { [ 4, semicolon, dollar ] }; + key { [ 5, percent ] }; + key { [ 6, colon, asciicircum ] }; + key { [ 7, question, ampersand ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ minus, underscore ] }; + key { [ equal, plus ] }; + key { [ backslash, slash, bar ] }; + key { [ period, comma, slash, question ] }; + key { [ less, greater, bar, brokenbar ] }; + +key.type[group1] = "FOUR_LEVEL_ALPHABETIC"; + + key { [ Cyrillic_io, Cyrillic_IO ] }; + key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; + key { [ Cyrillic_en_descender, Cyrillic_EN_descender, Cyrillic_tse, Cyrillic_TSE ] }; + key { [ Cyrillic_u, Cyrillic_U ] }; + key { [ Cyrillic_ka, Cyrillic_KA, Cyrillic_ka_descender, Cyrillic_KA_descender ] }; + key { [ Cyrillic_ie, Cyrillic_IE, Cyrillic_io, Cyrillic_IO ] }; + key { [ Cyrillic_en, Cyrillic_EN ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Cyrillic_ghe_bar, Cyrillic_GHE_bar, Cyrillic_shcha, Cyrillic_SHCHA ] }; + key { [ Cyrillic_ze, Cyrillic_ZE ] }; + key { [ Cyrillic_ha, Cyrillic_HA, Cyrillic_shha, Cyrillic_SHHA ] }; + key { [ Cyrillic_u_straight_bar, Cyrillic_U_straight_bar, Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; + key { [ Cyrillic_o_bar, Cyrillic_O_bar, Cyrillic_ef, Cyrillic_EF ] }; + key { [ Cyrillic_yeru, Cyrillic_YERU ] }; + key { [ Cyrillic_ka_descender, Cyrillic_KA_descender, Cyrillic_ve, Cyrillic_VE ] }; + key { [ Cyrillic_a, Cyrillic_A ] }; + key { [ Cyrillic_pe, Cyrillic_PE ] }; + key { [ Cyrillic_er, Cyrillic_ER ] }; + key { [ Cyrillic_o, Cyrillic_O ] }; + key { [ Cyrillic_el, Cyrillic_EL ] }; + key { [ Cyrillic_de, Cyrillic_DE ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ Cyrillic_schwa, Cyrillic_SCHWA, Cyrillic_e, Cyrillic_E ] }; + key { [ Cyrillic_ya, Cyrillic_YA ] }; + key { [ Ukrainian_i, Ukrainian_I, Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_es, Cyrillic_ES ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; + key { [ Cyrillic_te, Cyrillic_TE ] }; + key { [ Cyrillic_i, Cyrillic_I ] }; + key { [ Cyrillic_u_straight, Cyrillic_U_straight, Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_be, Cyrillic_BE ] }; + key { [ Cyrillic_yu, Cyrillic_YU ] }; +}; + +partial alphanumeric_keys +xkb_symbols "olpc" { + +// Contact: Walter Bender + +// We moved the Cyrillic IO off of the Tilde Key as an Alt-GR character +// and moved it onto the Backslash key, making Backslash and Bar available +// through the Latin side of the keyboard. + + include "kz(basic)" + + name[Group1] = "Kazakhstan"; + + key { [ parenleft, parenright ] }; + key { [ Cyrillic_io, Cyrillic_IO ] }; + + include "group(olpc)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/la b/xorg-server/xkeyboard-config/symbols/la index b050cc477..f893a0268 100644 --- a/xorg-server/xkeyboard-config/symbols/la +++ b/xorg-server/xkeyboard-config/symbols/la @@ -1,77 +1,150 @@ -// $XKeyboardConfig$ - -// $XConsortium: lo 2002/11/28 $ -// -// Lao keymap, by Anousak Souphavanh - -partial default alphanumeric_keys -xkb_symbols "basic" { - - // Describes the differences between a very simple US/ASCII - // keyboard and a Lao keyboard - // This keymap uses the Lao keyboard standard [kind of] widely used inLaos - - name[Group1]= "Laos"; - - // Alphanumeric section - key { [ 0x100200D ]}; - key { [ 0x1000ea2, 0x1000ed1 ]}; - key { [ 0x1000ea2, 0x1000ed1 ]}; - key { [ 0x1000e9f, 0x1000ed2 ]}; - key { [ 0x1000ec2, 0x1000ed3 ]}; - key { [ 0x1000e96, 0x1000ed4 ]}; - key { [ 0x1000eb8, 0x1000ecc ]}; - key { [ 0x1000eb9, 0x1000ebc ]}; - key { [ 0x1000e84, 0x1000ed5 ]}; - key { [ 0x1000e95, 0x1000ed6 ]}; - key { [ 0x1000e88, 0x1000ed7 ]}; - key { [ 0x1000e82, 0x1000ed8 ]}; - key { [ 0x1000e8a, 0x1000ed9 ]}; - key { [ 0x1000ecd ]}; - - key { [ 0x1000ebb ]}; - key { [ 0x1000ec4, 0x1000ed0 ]}; - key { [ 0x1000eb3 ]}; - key { [ 0x1000e9e, underscore ]}; - key { [ 0x1000eb0, plus ]}; - key { [ 0x1000eb4 ]}; - key { [ 0x1000eb5 ]}; - key { [ 0x1000ea3, 0x1000eae ]}; - key { [ 0x1000e99 ]}; - key { [ 0x1000e8d, 0x1000ebd ]}; - key { [ 0x1000e9a, minus ]}; - key { [ 0x1000ea5, braceright ]}; - key { [ 0x1000edc, 0x1000edd ]}; - - key { [ 0x1000eb1 ]}; - key { [ 0x1000eab, semicolon ]}; - key { [ 0x1000e81, period ]}; - key { [ 0x1000e94, comma ]}; - key { [ 0x1000ec0, colon ]}; - key { [ 0x1000ec9, 0x1000eca ]}; - key { [ 0x1000ec8, 0x1000ecb ]}; - key { [ 0x1000eb2, exclam ]}; - key { [ 0x1000eaa, question ]}; - key { [ 0x1000ea7, percent ]}; - key { [ 0x1000e87, equal ]}; - - key { [ 0x1000e9c, 0x10020ad ]}; - key { [ 0x1000e9b, parenleft ]}; - key { [ 0x1000ec1, 0x1000eaf ]}; - key { [ 0x1000ead ]}; - key { [ 0x1000eb6 ]}; - key { [ 0x1000eb7 ]}; - key { [ 0x1000e97, 0x1000ec6 ]}; - key { [ 0x1000ea1, quoteleft ]}; - key { [ 0x1000ec3, dollar ]}; - key { [ 0x1000e9d, parenright ]}; - -override key { - type[Group1]="PC_ALT_LEVEL2", - [ Shift_L, ISO_First_Group ] - }; -override key { - type[Group1]="PC_ALT_LEVEL2", - [ Shift_R, ISO_Last_Group ] - }; -}; +// Lao keymap, by Anousak Souphavanh + +partial default alphanumeric_keys +xkb_symbols "basic" { + + // Describes the differences between a very simple US/ASCII + // keyboard and a Lao keyboard + // This keymap uses the Lao keyboard standard [kind of] widely used inLaos + + name[Group1]= "Laos"; + + // Alphanumeric section + key { [ 0x100200D ]}; + key { [ 0x1000ea2, 0x1000ed1 ]}; + key { [ 0x1000ea2, 0x1000ed1 ]}; + key { [ 0x1000e9f, 0x1000ed2 ]}; + key { [ 0x1000ec2, 0x1000ed3 ]}; + key { [ 0x1000e96, 0x1000ed4 ]}; + key { [ 0x1000eb8, 0x1000ecc ]}; + key { [ 0x1000eb9, 0x1000ebc ]}; + key { [ 0x1000e84, 0x1000ed5 ]}; + key { [ 0x1000e95, 0x1000ed6 ]}; + key { [ 0x1000e88, 0x1000ed7 ]}; + key { [ 0x1000e82, 0x1000ed8 ]}; + key { [ 0x1000e8a, 0x1000ed9 ]}; + key { [ 0x1000ecd ]}; + + key { [ 0x1000ebb ]}; + key { [ 0x1000ec4, 0x1000ed0 ]}; + key { [ 0x1000eb3 ]}; + key { [ 0x1000e9e, underscore ]}; + key { [ 0x1000eb0, plus ]}; + key { [ 0x1000eb4 ]}; + key { [ 0x1000eb5 ]}; + key { [ 0x1000ea3, 0x1000eae ]}; + key { [ 0x1000e99 ]}; + key { [ 0x1000e8d, 0x1000ebd ]}; + key { [ 0x1000e9a, minus ]}; + key { [ 0x1000ea5, braceright ]}; + key { [ 0x1000edc, 0x1000edd ]}; + + key { [ 0x1000eb1 ]}; + key { [ 0x1000eab, semicolon ]}; + key { [ 0x1000e81, period ]}; + key { [ 0x1000e94, comma ]}; + key { [ 0x1000ec0, colon ]}; + key { [ 0x1000ec9, 0x1000eca ]}; + key { [ 0x1000ec8, 0x1000ecb ]}; + key { [ 0x1000eb2, exclam ]}; + key { [ 0x1000eaa, question ]}; + key { [ 0x1000ea7, percent ]}; + key { [ 0x1000e87, equal ]}; + + key { [ 0x1000e9c, 0x10020ad ]}; + key { [ 0x1000e9b, parenleft ]}; + key { [ 0x1000ec1, 0x1000eaf ]}; + key { [ 0x1000ead ]}; + key { [ 0x1000eb6 ]}; + key { [ 0x1000eb7 ]}; + key { [ 0x1000e97, 0x1000ec6 ]}; + key { [ 0x1000ea1, quoteleft ]}; + key { [ 0x1000ec3, dollar ]}; + key { [ 0x1000e9d, parenright ]}; + +override key { + type[Group1]="PC_ALT_LEVEL2", + [ Shift_L, ISO_First_Group ] + }; +override key { + type[Group1]="PC_ALT_LEVEL2", + [ Shift_R, ISO_Last_Group ] + }; +}; + +partial +xkb_symbols "stea" { + + // Describes the differences between a very simple US/ASCII + // keyboard and a Lao keyboard + // This keymap uses the proposed Lao keyboard standard by the + // PAN Localization Project + // Science Technology and Environment Agency of Lao PDR + // National University Computer and Emergency Science of Pakistan + // International Development Research Center + // Caveat: assigning multiple codepoints to a single key doesn't + // work in XKB. Therefor the combining codepoint assignments + // have been omitted. + + + name[Group1]= "Laos - STEA (proposed standard layout)"; + + // Alphanumeric section + key { [ quotedbl, apostrophe ]}; + key { [ 0x1000ea2, 1, 0x1000ed1 ]}; + key { [ 0x1000e9f, 2, 0x1000ed2 ]}; + key { [ 0x1000ec2, 3, 0x1000ed3 ]}; + key { [ 0x1000e96, 4, 0x1000ed4 ]}; + key { [ 0x1000eb8, 0x1000ecc, 0x1000ed5 ]}; + key { [ 0x1000eb9, 0x1000ebc, 0x1000ed6 ]}; + key { [ 0x1000e84, 5, 0x1000ed7 ]}; + key { [ 0x1000e95, 6, 0x1000ed8 ]}; + key { [ 0x1000e88, 7, 0x1000ed9 ]}; + key { [ 0x1000e82, 8, 0x1000ed0 ]}; + key { [ 0x1000e8a, 9 ]}; + key { [ 0x1000ecd ]}; + + key { [ 0x1000ebb ]}; + key { [ 0x1000ec4, 0 ]}; + key { [ 0x1000eb3, asterisk ]}; + key { [ 0x1000e9e, underscore ]}; + key { [ 0x1000eb0, plus ]}; + key { [ 0x1000eb4 ]}; + key { [ 0x1000eb5 ]}; + key { [ 0x1000eae, 0x1000ea3 ]}; + key { [ 0x1000e99, 0x1000edc ]}; + key { [ 0x1000e8d, 0x1000ebd ]}; + key { [ 0x1000e9a, minus ]}; + key { [ 0x1000ea5 ]}; + key { [ slash, backslash ]}; + + key { [ 0x1000eb1 ]}; + key { [ 0x1000eab, semicolon ]}; + key { [ 0x1000e81, period ]}; + key { [ 0x1000e94, comma ]}; + key { [ 0x1000ec0, colon ]}; + key { [ 0x1000ec9, 0x1000eca ]}; + key { [ 0x1000ec8, 0x1000ecb ]}; + key { [ 0x1000eb2, exclam ]}; + key { [ 0x1000eaa, question ]}; + key { [ 0x1000ea7, percent ]}; + key { [ 0x1000e87, equal ]}; + + key { [ 0x1000e9c, 0x10020ad ]}; + key { [ 0x1000e9b, parenleft ]}; + key { [ 0x1000ec1, 0x1000eaf ]}; + key { [ 0x1000ead, x ]}; + key { [ 0x1000eb6 ]}; + key { [ 0x1000eb7 ]}; + key { [ 0x1000e97, 0x1000ec6 ]}; + key { [ 0x1000ea1, 0x1000edd ]}; + key { [ 0x1000ec3, dollar ]}; + key { [ 0x1000e9d, parenright ]}; + + key { [ space, nobreakspace, nobreakspace ]}; + + key { [ comma, period ]}; + + include "level3(ralt_switch)" + +}; diff --git a/xorg-server/xkeyboard-config/symbols/latam b/xorg-server/xkeyboard-config/symbols/latam index ffd1ca8bc..de20f2109 100644 --- a/xorg-server/xkeyboard-config/symbols/latam +++ b/xorg-server/xkeyboard-config/symbols/latam @@ -1,9 +1,5 @@ -// $XKeyboardConfig$ - // based on a keyboard // Modified for a real Latin American Keyboard by Fabian Mandelbaum -// -// $XFree86: xc/programs/xkbcomp/symbols/la,v 1.2 2002/11/22 04:03:28 dawes Exp $ partial default alphanumeric_keys xkb_symbols "basic" { diff --git a/xorg-server/xkeyboard-config/symbols/latin b/xorg-server/xkeyboard-config/symbols/latin index 1d8ebbeeb..e8cb03715 100644 --- a/xorg-server/xkeyboard-config/symbols/latin +++ b/xorg-server/xkeyboard-config/symbols/latin @@ -1,8 +1,4 @@ -// $XKeyboardConfig$ - // Common Latin alphabet layout -// -// $XFree86: xc/programs/xkbcomp/symbols/latin,v 1.3 2002/12/20 20:18:34 paulo Exp $ default partial xkb_symbols "basic" { @@ -177,4 +173,3 @@ xkb_symbols "type4_nodeadkeys" { key { [ minus, underscore, dead_belowdot, abovedot ] }; }; - diff --git a/xorg-server/xkeyboard-config/symbols/level3 b/xorg-server/xkeyboard-config/symbols/level3 index c2c6b13a2..599443002 100644 --- a/xorg-server/xkeyboard-config/symbols/level3 +++ b/xorg-server/xkeyboard-config/symbols/level3 @@ -1,200 +1,196 @@ -// $XKeyboardConfig$ - -// these variants assign various XKB keycodes to ISO_Level3_Shift so that -// the third shift level can be reached -// -// $XFree86: xc/programs/xkbcomp/symbols/level3,v 1.7 2003/09/08 14:25:32 eich Exp $ -// - -// the default behavior is for the right Alt key (AltGr) to generate the -// third engraved symbol -default partial modifier_keys -xkb_symbols "ralt_switch" { - key { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; - modifier_map Mod5 { ISO_Level3_Shift }; -}; - -// Right Alt key never chooses 3rd level. -// This option attempts to undo the effect of a layout's -// including ralt_switch. You may also want to select another -// level3 option that maps the level3 shift to some other key. -partial modifier_keys -xkb_symbols "ralt_alt" { - key { - type[Group1]="TWO_LEVEL", - type[Group2]="TWO_LEVEL", - type[Group3]="TWO_LEVEL", - type[Group4]="TWO_LEVEL", - symbols[Group1] = [ Alt_R, Meta_R ], - symbols[Group2] = [ Alt_R, Meta_R ], - symbols[Group3] = [ Alt_R, Meta_R ], - symbols[Group4] = [ Alt_R, Meta_R ] - }; - modifier_map Mod1 { }; -}; - -partial modifier_keys -xkb_symbols "ralt_switch_multikey" { - key { - type[Group1]="TWO_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift, Multi_key ] - }; -}; - -// special case or right Alt switch - for use with grp:alts_toggle -// -partial hidden modifier_keys -xkb_symbols "ralt_switch_for_alts_toggle" { - virtual_modifiers LAlt, AlGr; - key { - type[Group1]="PC_RALT_LEVEL2", - symbols[Group1] = [ Alt_L, ISO_Prev_Group, ISO_Prev_Group ], - virtualMods= LAlt - }; - key { - type[Group1]="PC_ALT_LEVEL2", - symbols[Group1] = [ ISO_Level3_Shift, ISO_Next_Group ], - virtualMods= AltGr - }; - modifier_map Mod5 { ISO_Level3_Shift }; -}; - -// using the level(alt_switch) map, either Alt key temporarily chooses -// the third shift level. (Mostly be used to imitate Mac OS functionality.) -partial modifier_keys -xkb_symbols "alt_switch" { - include "level3(lalt_switch)" - include "level3(ralt_switch)" -}; - -partial modifier_keys -xkb_symbols "lalt_switch" { - key { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; - modifier_map Mod5 { }; -}; - -// using the level(switch) map, the right Control key temporarily -// chooses the third shift level (until it is released). -partial modifier_keys -xkb_symbols "switch" { - key { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; - modifier_map Mod5 { ISO_Level3_Shift }; -}; - -// using the level(menu_switch) map, the Menu key temporarily -// chooses the third shift level (until it is released). -partial modifier_keys -xkb_symbols "menu_switch" { - key { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; - modifier_map Mod5 { ISO_Level3_Shift }; -}; - -// using the level3(win_switch) map, the either Windows' logo key -// temporarily chooses the third shift level. -partial modifier_keys -xkb_symbols "win_switch" { - include "level3(lwin_switch)" - include "level3(rwin_switch)" -}; - -// using the level3(lwin_switch) map, the left Windows' logo key -// temporarily chooses the third shift level. -partial modifier_keys -xkb_symbols "lwin_switch" { - key { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; - modifier_map Mod5 { ISO_Level3_Shift }; -}; - -// using the level(rwin_switch) map, the right Windows' logo key -// temporarily chooses the third shift level. If you use this map, -// you should define your keyboard as pc101 or pc102 instead of pc104 -// or pc105. -partial modifier_keys -xkb_symbols "rwin_switch" { - key { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; - modifier_map Mod5 { ISO_Level3_Shift }; -}; - -// using the level3(enter_switch) map, the Enter key on the keypad -// temporarily chooses the third shift level. This is especially -// useful for Mac laptops which miss the right Alt key. -partial modifier_keys -xkb_symbols "enter_switch" { - key { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; - modifier_map Mod5 { ISO_Level3_Shift }; -}; - -partial modifier_keys -xkb_symbols "caps_switch" { - key { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; - modifier_map Mod5 { ISO_Level3_Shift }; -}; - -partial modifier_keys -xkb_symbols "bksl_switch" { - key { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; - modifier_map Mod5 { ISO_Level3_Shift }; -}; - -partial modifier_keys -xkb_symbols "lsgt_switch" { - key { - type[Group1]="ONE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift ] - }; - modifier_map Mod5 { ISO_Level3_Shift }; -}; - -partial modifier_keys -xkb_symbols "caps_switch_latch" { - key { - type[Group1]="THREE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ] - }; - modifier_map Mod5 { ISO_Level3_Shift }; -}; - -partial modifier_keys -xkb_symbols "bksl_switch_latch" { - key { - type[Group1]="THREE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ] - }; - modifier_map Mod5 { ISO_Level3_Shift }; -}; - -partial modifier_keys -xkb_symbols "lsgt_switch_latch" { - key { - type[Group1]="THREE_LEVEL", - symbols[Group1] = [ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ] - }; - modifier_map Mod5 { ISO_Level3_Shift }; -}; +// these variants assign various XKB keycodes to ISO_Level3_Shift so that +// the third shift level can be reached +// + +// the default behavior is for the right Alt key (AltGr) to generate the +// third engraved symbol +default partial modifier_keys +xkb_symbols "ralt_switch" { + key { + type[Group1]="ONE_LEVEL", + symbols[Group1] = [ ISO_Level3_Shift ] + }; + modifier_map Mod5 { ISO_Level3_Shift }; +}; + +// Right Alt key never chooses 3rd level. +// This option attempts to undo the effect of a layout's +// including ralt_switch. You may also want to select another +// level3 option that maps the level3 shift to some other key. +partial modifier_keys +xkb_symbols "ralt_alt" { + key { + type[Group1]="TWO_LEVEL", + type[Group2]="TWO_LEVEL", + type[Group3]="TWO_LEVEL", + type[Group4]="TWO_LEVEL", + symbols[Group1] = [ Alt_R, Meta_R ], + symbols[Group2] = [ Alt_R, Meta_R ], + symbols[Group3] = [ Alt_R, Meta_R ], + symbols[Group4] = [ Alt_R, Meta_R ] + }; + modifier_map Mod1 { }; +}; + +partial modifier_keys +xkb_symbols "ralt_switch_multikey" { + key { + type[Group1]="TWO_LEVEL", + symbols[Group1] = [ ISO_Level3_Shift, Multi_key ] + }; +}; + +// special case or right Alt switch - for use with grp:alts_toggle +// +partial hidden modifier_keys +xkb_symbols "ralt_switch_for_alts_toggle" { + virtual_modifiers LAlt, AlGr; + key { + type[Group1]="PC_RALT_LEVEL2", + symbols[Group1] = [ Alt_L, ISO_Prev_Group, ISO_Prev_Group ], + virtualMods= LAlt + }; + key { + type[Group1]="PC_ALT_LEVEL2", + symbols[Group1] = [ ISO_Level3_Shift, ISO_Next_Group ], + virtualMods= AltGr + }; + modifier_map Mod5 { ISO_Level3_Shift }; +}; + +// using the level(alt_switch) map, either Alt key temporarily chooses +// the third shift level. (Mostly be used to imitate Mac OS functionality.) +partial modifier_keys +xkb_symbols "alt_switch" { + include "level3(lalt_switch)" + include "level3(ralt_switch)" +}; + +partial modifier_keys +xkb_symbols "lalt_switch" { + key { + type[Group1]="ONE_LEVEL", + symbols[Group1] = [ ISO_Level3_Shift ] + }; + modifier_map Mod5 { }; +}; + +// using the level(switch) map, the right Control key temporarily +// chooses the third shift level (until it is released). +partial modifier_keys +xkb_symbols "switch" { + key { + type[Group1]="ONE_LEVEL", + symbols[Group1] = [ ISO_Level3_Shift ] + }; + modifier_map Mod5 { ISO_Level3_Shift }; +}; + +// using the level(menu_switch) map, the Menu key temporarily +// chooses the third shift level (until it is released). +partial modifier_keys +xkb_symbols "menu_switch" { + key { + type[Group1]="ONE_LEVEL", + symbols[Group1] = [ ISO_Level3_Shift ] + }; + modifier_map Mod5 { ISO_Level3_Shift }; +}; + +// using the level3(win_switch) map, the either Windows' logo key +// temporarily chooses the third shift level. +partial modifier_keys +xkb_symbols "win_switch" { + include "level3(lwin_switch)" + include "level3(rwin_switch)" +}; + +// using the level3(lwin_switch) map, the left Windows' logo key +// temporarily chooses the third shift level. +partial modifier_keys +xkb_symbols "lwin_switch" { + key { + type[Group1]="ONE_LEVEL", + symbols[Group1] = [ ISO_Level3_Shift ] + }; + modifier_map Mod5 { ISO_Level3_Shift }; +}; + +// using the level(rwin_switch) map, the right Windows' logo key +// temporarily chooses the third shift level. If you use this map, +// you should define your keyboard as pc101 or pc102 instead of pc104 +// or pc105. +partial modifier_keys +xkb_symbols "rwin_switch" { + key { + type[Group1]="ONE_LEVEL", + symbols[Group1] = [ ISO_Level3_Shift ] + }; + modifier_map Mod5 { ISO_Level3_Shift }; +}; + +// using the level3(enter_switch) map, the Enter key on the keypad +// temporarily chooses the third shift level. This is especially +// useful for Mac laptops which miss the right Alt key. +partial modifier_keys +xkb_symbols "enter_switch" { + key { + type[Group1]="ONE_LEVEL", + symbols[Group1] = [ ISO_Level3_Shift ] + }; + modifier_map Mod5 { ISO_Level3_Shift }; +}; + +partial modifier_keys +xkb_symbols "caps_switch" { + key { + type[Group1]="ONE_LEVEL", + symbols[Group1] = [ ISO_Level3_Shift ] + }; + modifier_map Mod5 { ISO_Level3_Shift }; +}; + +partial modifier_keys +xkb_symbols "bksl_switch" { + key { + type[Group1]="ONE_LEVEL", + symbols[Group1] = [ ISO_Level3_Shift ] + }; + modifier_map Mod5 { ISO_Level3_Shift }; +}; + +partial modifier_keys +xkb_symbols "lsgt_switch" { + key { + type[Group1]="ONE_LEVEL", + symbols[Group1] = [ ISO_Level3_Shift ] + }; + modifier_map Mod5 { ISO_Level3_Shift }; +}; + +partial modifier_keys +xkb_symbols "caps_switch_latch" { + key { + type[Group1]="THREE_LEVEL", + symbols[Group1] = [ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ] + }; + modifier_map Mod5 { ISO_Level3_Shift }; +}; + +partial modifier_keys +xkb_symbols "bksl_switch_latch" { + key { + type[Group1]="THREE_LEVEL", + symbols[Group1] = [ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ] + }; + modifier_map Mod5 { ISO_Level3_Shift }; +}; + +partial modifier_keys +xkb_symbols "lsgt_switch_latch" { + key { + type[Group1]="THREE_LEVEL", + symbols[Group1] = [ ISO_Level3_Shift, ISO_Level3_Shift, ISO_Level3_Latch ] + }; + modifier_map Mod5 { ISO_Level3_Shift }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/level5 b/xorg-server/xkeyboard-config/symbols/level5 index 99cb4601c..6e9a693cc 100644 --- a/xorg-server/xkeyboard-config/symbols/level5 +++ b/xorg-server/xkeyboard-config/symbols/level5 @@ -1,10 +1,6 @@ -// $XKeyboardConfig$ - // these variants assign various XKB keycodes to ISO_Level5_Shift so that // the third shift level can be reached // -// $XFree86: xc/programs/xkbcomp/symbols/level3,v 1.7 2003/09/08 14:25:32 eich Exp $ -// // using the level(switch) map, the right Control key temporarily // chooses the fifth shift level (until it is released). diff --git a/xorg-server/xkeyboard-config/symbols/lk b/xorg-server/xkeyboard-config/symbols/lk index cfc5b1ff9..8480607de 100644 --- a/xorg-server/xkeyboard-config/symbols/lk +++ b/xorg-server/xkeyboard-config/symbols/lk @@ -1,5 +1,3 @@ -// $XKeyboardConfig$ - // X Keyboard Extension file for Sinhala (Sri Lanka) (2004-04-22) // Maintainer : Harshula Jayasuriya // Last Updated: 2007-06-29 @@ -90,4 +88,3 @@ xkb_symbols "tam_TAB" { include "in(tam_TAB)" name[Group1]= "Sri Lanka - Tamil TAB Typewriter"; }; - diff --git a/xorg-server/xkeyboard-config/symbols/lt b/xorg-server/xkeyboard-config/symbols/lt index 76da16409..5a19dc265 100644 --- a/xorg-server/xkeyboard-config/symbols/lt +++ b/xorg-server/xkeyboard-config/symbols/lt @@ -1,8 +1,4 @@ -// $XKeyboardConfig$ - // Separate keymaps merged into one file by Nerijus Baliūnas, 2002 -// -// $XFree86: xc/programs/xkbcomp/symbols/lt,v 1.3 2002/12/14 22:26:11 dawes Exp $ // Lithuanian Numeric layout - Lithuanian letters on the numeric row // based on Lithuanian keyboard map by Ričardas Čepas @@ -298,4 +294,3 @@ xkb_symbols "lekpa" { key {[ aogonek, Aogonek, greater ]}; key {[ h, H ]}; }; - diff --git a/xorg-server/xkeyboard-config/symbols/lv b/xorg-server/xkeyboard-config/symbols/lv index 556be6c66..960622486 100644 --- a/xorg-server/xkeyboard-config/symbols/lv +++ b/xorg-server/xkeyboard-config/symbols/lv @@ -1,129 +1,127 @@ -// $XKeyboardConfig$ - -// Latvian keymap version 1.1 -// Copyright (C) Dmitry Golubev , 2003-2004 -// -// Reworked to get rid of dead_keys (use of which in this case -// is a dirty hack). It is now not dependent on locale settings -// and GTK_IM_MODULES in Gnome. The map is also providing some of -// ISO9995-3 alternate characters. Note that this version works -// correctly under Gnome 2.6. This is to be put into symbols/ -// directory, or somewhere else. -// -// 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 holder(s) not be used in -// advertising or publicity pertaining to distribution of the software without -// specific, written prior permission. The copyright holder(s) makes no -// representations about the suitability of this software for any purpose. It -// is provided "as is" without express or implied warranty. -// -// THE COPYRIGHT HOLDER(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, -// INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO -// EVENT SHALL THE COPYRIGHT HOLDER(S) 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. - -partial default alphanumeric_keys modifier_keys -xkb_symbols "basic" { - - name[Group1]= "Latvia"; - - key {[grave, asciitilde, acute, asciitilde]}; - key {[1, exclam, onesuperior, exclamdown]}; - key {[2, at, twosuperior, oneeighth]}; - key {[3, numbersign, threesuperior, sterling]}; - key {[4, dollar, EuroSign, cent]}; - key {[5, percent, onehalf, threeeighths]}; - key {[6, asciicircum, threequarters, fiveeighths]}; - key {[7, ampersand, braceleft, seveneighths]}; - key {[8, asterisk, bracketleft, trademark]}; - key {[9, parenleft, bracketright, plusminus]}; - key {[0, parenright, braceright, degree]}; - key {[minus, underscore, backslash, questiondown]}; - key {[equal, plus, endash, emdash]}; - - key {[q, Q, q, Q]}; - key {[w, W, w, W]}; - key {[e, E, emacron, Emacron]}; - key {[r, R, rcedilla, Rcedilla]}; - key {[t, T, t, T]}; - key {[y, Y, y, Y]}; - key {[u, U, umacron, Umacron]}; - key {[i, I, imacron, Imacron]}; - key {[o, O, omacron, Omacron]}; - key {[p, P, p, P]}; - key {[bracketleft, braceleft, guillemotleft, leftdoublequotemark]}; - key {[bracketright, braceright, guillemotright, rightdoublequotemark]}; - - key {[a, A, amacron, Amacron]}; - key {[s, S, scaron, Scaron]}; - key {[d, D, d, D]}; - key {[f, F, f, F]}; - key {[g, G, gcedilla, Gcedilla]}; - key {[h, H, h, H]}; - key {[j, J, j, J]}; - key {[k, K, kcedilla, Kcedilla]}; - key {[l, L, lcedilla, Lcedilla]}; - key {[semicolon, colon, semicolon, colon]}; - key {[apostrophe, quotedbl, leftdoublequotemark, doublelowquotemark]}; - - key {[z, Z, zcaron, Zcaron]}; - key {[x, X, x, X]}; - key {[c, C, ccaron, Ccaron]}; - key {[v, V, v, V]}; - key {[b, B, b, B]}; - key {[n, N, ncedilla, Ncedilla]}; - key {[m, M, m, M]}; - key {[comma, less, horizconnector, multiply]}; - key {[period, greater, periodcentered, division]}; - key {[slash, question, slash, abovedot]}; - key {[backslash, bar, grave, breve]}; - - key {[space, space, space, space]}; - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys modifier_keys -xkb_symbols "apostrophe" { - - include "lv(basic)" - - name[Group1]= "Latvia - Apostrophe (') variant"; - - key {[ISO_Level3_Latch, quotedbl, apostrophe, quotedbl]}; - key {[space, space, apostrophe]}; - modifier_map Mod5 { }; - -}; - -partial alphanumeric_keys modifier_keys -xkb_symbols "tilde" { - - include "lv(basic)" - - name[Group1]= "Latvia - Tilde (~) variant"; - - key {[ISO_Level3_Latch, asciitilde, grave, acute]}; - key {[space, space, asciitilde]}; - modifier_map Mod5 { }; - -}; - -partial alphanumeric_keys modifier_keys -xkb_symbols "fkey" { - - include "lv(basic)" - - name[Group1]= "Latvia - F-letter (F) variant"; - - key {[ISO_Level3_Latch, ISO_Level3_Latch, f, F]}; - key {[space, space, f, F]}; - modifier_map Mod5 { }; - -}; +// Latvian keymap version 1.1 +// Copyright (C) Dmitry Golubev , 2003-2004 +// +// Reworked to get rid of dead_keys (use of which in this case +// is a dirty hack). It is now not dependent on locale settings +// and GTK_IM_MODULES in Gnome. The map is also providing some of +// ISO9995-3 alternate characters. Note that this version works +// correctly under Gnome 2.6. This is to be put into symbols/ +// directory, or somewhere else. +// +// 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 holder(s) not be used in +// advertising or publicity pertaining to distribution of the software without +// specific, written prior permission. The copyright holder(s) makes no +// representations about the suitability of this software for any purpose. It +// is provided "as is" without express or implied warranty. +// +// THE COPYRIGHT HOLDER(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +// INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +// EVENT SHALL THE COPYRIGHT HOLDER(S) 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. + +partial default alphanumeric_keys modifier_keys +xkb_symbols "basic" { + + name[Group1]= "Latvia"; + + key {[grave, asciitilde, acute, asciitilde]}; + key {[1, exclam, onesuperior, exclamdown]}; + key {[2, at, twosuperior, oneeighth]}; + key {[3, numbersign, threesuperior, sterling]}; + key {[4, dollar, EuroSign, cent]}; + key {[5, percent, onehalf, threeeighths]}; + key {[6, asciicircum, threequarters, fiveeighths]}; + key {[7, ampersand, braceleft, seveneighths]}; + key {[8, asterisk, bracketleft, trademark]}; + key {[9, parenleft, bracketright, plusminus]}; + key {[0, parenright, braceright, degree]}; + key {[minus, underscore, backslash, questiondown]}; + key {[equal, plus, endash, emdash]}; + + key {[q, Q, q, Q]}; + key {[w, W, w, W]}; + key {[e, E, emacron, Emacron]}; + key {[r, R, rcedilla, Rcedilla]}; + key {[t, T, t, T]}; + key {[y, Y, y, Y]}; + key {[u, U, umacron, Umacron]}; + key {[i, I, imacron, Imacron]}; + key {[o, O, omacron, Omacron]}; + key {[p, P, p, P]}; + key {[bracketleft, braceleft, guillemotleft, leftdoublequotemark]}; + key {[bracketright, braceright, guillemotright, rightdoublequotemark]}; + + key {[a, A, amacron, Amacron]}; + key {[s, S, scaron, Scaron]}; + key {[d, D, d, D]}; + key {[f, F, f, F]}; + key {[g, G, gcedilla, Gcedilla]}; + key {[h, H, h, H]}; + key {[j, J, j, J]}; + key {[k, K, kcedilla, Kcedilla]}; + key {[l, L, lcedilla, Lcedilla]}; + key {[semicolon, colon, semicolon, colon]}; + key {[apostrophe, quotedbl, leftdoublequotemark, doublelowquotemark]}; + + key {[z, Z, zcaron, Zcaron]}; + key {[x, X, x, X]}; + key {[c, C, ccaron, Ccaron]}; + key {[v, V, v, V]}; + key {[b, B, b, B]}; + key {[n, N, ncedilla, Ncedilla]}; + key {[m, M, m, M]}; + key {[comma, less, horizconnector, multiply]}; + key {[period, greater, periodcentered, division]}; + key {[slash, question, slash, abovedot]}; + key {[backslash, bar, grave, breve]}; + + key {[space, space, space, space]}; + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys modifier_keys +xkb_symbols "apostrophe" { + + include "lv(basic)" + + name[Group1]= "Latvia - Apostrophe (') variant"; + + key {[ISO_Level3_Latch, quotedbl, apostrophe, quotedbl]}; + key {[space, space, apostrophe]}; + modifier_map Mod5 { }; + +}; + +partial alphanumeric_keys modifier_keys +xkb_symbols "tilde" { + + include "lv(basic)" + + name[Group1]= "Latvia - Tilde (~) variant"; + + key {[ISO_Level3_Latch, asciitilde, grave, acute]}; + key {[space, space, asciitilde]}; + modifier_map Mod5 { }; + +}; + +partial alphanumeric_keys modifier_keys +xkb_symbols "fkey" { + + include "lv(basic)" + + name[Group1]= "Latvia - F-letter (F) variant"; + + key {[ISO_Level3_Latch, ISO_Level3_Latch, f, F]}; + key {[space, space, f, F]}; + modifier_map Mod5 { }; + +}; diff --git a/xorg-server/xkeyboard-config/symbols/ma b/xorg-server/xkeyboard-config/symbols/ma index b36cc9bc7..b49d0c762 100644 --- a/xorg-server/xkeyboard-config/symbols/ma +++ b/xorg-server/xkeyboard-config/symbols/ma @@ -322,4 +322,3 @@ xkb_symbols "tifinagh-alt-phonetic" { include "level3(ralt_switch)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/apple b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/apple index fc1742c45..cbbf110d3 100644 --- a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/apple +++ b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/apple @@ -1,7 +1,6 @@ // // Keyboard modification for Apple keyboards // -// $XFree86: xc/programs/xkbcomp/symbols/apple,v 1.2 2003/10/24 20:38:20 tsi Exp $ partial default modifier_keys xkb_symbols "extended" { diff --git a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/ch b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/ch index 4932eb89a..09c2fb32f 100644 --- a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/ch +++ b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/ch @@ -1,102 +1,101 @@ -// $XKeyboardConfig$ -// -// 03.01.2003 -// Andreas Tobler -// modified for Swiss German Apple Extended Keyboard II - -partial alphanumeric_keys -xkb_symbols "extended" { - - name[Group1]= "Switzerland - German, Mac"; - - // Alphanumeric section - - key { [ 1, plus, plusminus, infinity ] }; - key { [ 2, quotedbl, leftdoublequotemark, rightdoublequotemark ] }; - key { [ 3, asterisk, numbersign, leftcaret ] }; - // not displayed here - key { [ 4, ccedilla, Ccedilla, slash ] }; - key { [ 5, percent, bracketleft ] }; - key { [ 6, ampersand, bracketright ] }; - key { [ 7, slash, bar, backslash ] }; - key { [ 8, parenleft, braceleft, Ograve ] }; - key { [ 9, parenright, braceright, Ocircumflex ] }; - key { [ 0, equal, notequal, Uacute ] }; - key { [ apostrophe, question, questiondown, NoSymbol ] }; - key { [ dead_circumflex,dead_grave, dead_acute, asciicircum ] }; - key { [ q, Q, oe, OE ] }; - key { [ w, W, Greek_SIGMA, Aacute ] }; - key { [ e, E, EuroSign, Ediaeresis ] }; - key { [ r, R, registered, Egrave ] }; - key { [ t, T, dagger, Icircumflex ] }; - key { [ z, Z, Greek_OMEGA, Iacute ] }; - key { [ u, U, degree, Ugrave ] }; - key { [ i, I, exclamdown, idotless ] }; - key { [ o, O, oslash, Ooblique ] }; - key { [ p, P, Greek_pi, Greek_PI ] }; - key { [ udiaeresis, egrave, section, ydiaeresis ] }; - key { [ dead_diaeresis, exclam, grave, apostrophe ] }; - key { [ a, A, aring, Aring ] }; - key { [ s, S, ssharp, NoSymbol ] }; - // ligature fl - key { [ d, D, Greek_sigma, NoSymbol ] }; - // partialderivative is not available here att - key { [ f, F, function, doubledagger ] }; - key { [ g, G, at, comma ] }; - key { [ h, H, ordfeminine, periodcentered ] }; - key { [ j, J, masculine, eth ] }; - key { [ k, K, Greek_DELTA, macron ] }; - key { [ l, L, notsign, caret ] }; - key { [ odiaeresis, eacute, cent, breve ] }; - key { [ adiaeresis, agrave, ae, AE ] }; - key { [ y, Y, yen, Ydiaeresis ] }; - key { [ x, X, similarequal, trademark ] }; - key { [ c, C, copyright, NoSymbol ] }; - key { [ v, V, radical, diamond ] }; - key { [ b, B, integral, NoSymbol ] }; - key { [ n, N, dead_tilde, enopencircbullet ] }; - // to be fixed att - key { [ m, M, mu, dead_abovering ] }; - // not sure att - key { [ comma, semicolon, guillemotleft, guillemotright ] }; - key { [ period, colon, ellipsis, division ] }; - key { [ minus, underscore, hyphen, emdash ] }; - key { [ section, degree, NoSymbol, NoSymbol ] }; - // ligature fi // per mille - key { [ space, nobreakspace, nobreakspace ] }; - key { [ less, greater, lessthanequal, greaterthanequal ] }; - key { [ dollar, sterling, paragraph, enfilledcircbullet ] }; - - include "kpdl(comma)" - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "de" { - include "macintosh_vndr/ch(extended)" -}; - -partial alphanumeric_keys -xkb_symbols "fr" { - - // Describes the differences between a very simple US/ASCII - // keyboard and a very simple Swiss/French keybaord - - include "macintosh_vndr/ch(extended)" - name[Group1]= "Switzerland - French, Mac"; - - override key { - [ egrave, udiaeresis, bracketleft ] - }; - override key { - [ eacute, odiaeresis ] - }; - override key { - [ agrave, adiaeresis, braceleft ] - }; -}; - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - include "macintosh_vndr/ch(fr)" // for consistent naming -}; +// +// 03.01.2003 +// Andreas Tobler +// modified for Swiss German Apple Extended Keyboard II + +partial alphanumeric_keys +xkb_symbols "extended" { + + name[Group1]= "Switzerland - German, Mac"; + + // Alphanumeric section + + key { [ 1, plus, plusminus, infinity ] }; + key { [ 2, quotedbl, leftdoublequotemark, rightdoublequotemark ] }; + key { [ 3, asterisk, numbersign, leftcaret ] }; + // not displayed here + key { [ 4, ccedilla, Ccedilla, slash ] }; + key { [ 5, percent, bracketleft ] }; + key { [ 6, ampersand, bracketright ] }; + key { [ 7, slash, bar, backslash ] }; + key { [ 8, parenleft, braceleft, Ograve ] }; + key { [ 9, parenright, braceright, Ocircumflex ] }; + key { [ 0, equal, notequal, Uacute ] }; + key { [ apostrophe, question, questiondown, NoSymbol ] }; + key { [ dead_circumflex,dead_grave, dead_acute, asciicircum ] }; + key { [ q, Q, oe, OE ] }; + key { [ w, W, Greek_SIGMA, Aacute ] }; + key { [ e, E, EuroSign, Ediaeresis ] }; + key { [ r, R, registered, Egrave ] }; + key { [ t, T, dagger, Icircumflex ] }; + key { [ z, Z, Greek_OMEGA, Iacute ] }; + key { [ u, U, degree, Ugrave ] }; + key { [ i, I, exclamdown, idotless ] }; + key { [ o, O, oslash, Ooblique ] }; + key { [ p, P, Greek_pi, Greek_PI ] }; + key { [ udiaeresis, egrave, section, ydiaeresis ] }; + key { [ dead_diaeresis, exclam, grave, apostrophe ] }; + key { [ a, A, aring, Aring ] }; + key { [ s, S, ssharp, NoSymbol ] }; + // ligature fl + key { [ d, D, Greek_sigma, NoSymbol ] }; + // partialderivative is not available here att + key { [ f, F, function, doubledagger ] }; + key { [ g, G, at, comma ] }; + key { [ h, H, ordfeminine, periodcentered ] }; + key { [ j, J, masculine, eth ] }; + key { [ k, K, Greek_DELTA, macron ] }; + key { [ l, L, notsign, caret ] }; + key { [ odiaeresis, eacute, cent, breve ] }; + key { [ adiaeresis, agrave, ae, AE ] }; + key { [ y, Y, yen, Ydiaeresis ] }; + key { [ x, X, similarequal, trademark ] }; + key { [ c, C, copyright, NoSymbol ] }; + key { [ v, V, radical, diamond ] }; + key { [ b, B, integral, NoSymbol ] }; + key { [ n, N, dead_tilde, enopencircbullet ] }; + // to be fixed att + key { [ m, M, mu, dead_abovering ] }; + // not sure att + key { [ comma, semicolon, guillemotleft, guillemotright ] }; + key { [ period, colon, ellipsis, division ] }; + key { [ minus, underscore, hyphen, emdash ] }; + key { [ section, degree, NoSymbol, NoSymbol ] }; + // ligature fi // per mille + key { [ space, nobreakspace, nobreakspace ] }; + key { [ less, greater, lessthanequal, greaterthanequal ] }; + key { [ dollar, sterling, paragraph, enfilledcircbullet ] }; + + include "kpdl(comma)" + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "de" { + include "macintosh_vndr/ch(extended)" +}; + +partial alphanumeric_keys +xkb_symbols "fr" { + + // Describes the differences between a very simple US/ASCII + // keyboard and a very simple Swiss/French keybaord + + include "macintosh_vndr/ch(extended)" + name[Group1]= "Switzerland - French, Mac"; + + override key { + [ egrave, udiaeresis, bracketleft ] + }; + override key { + [ eacute, odiaeresis ] + }; + override key { + [ agrave, adiaeresis, braceleft ] + }; +}; + +partial alphanumeric_keys +xkb_symbols "nodeadkeys" { + include "macintosh_vndr/ch(fr)" // for consistent naming +}; diff --git a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/de b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/de index 92c54916c..4c8bebdf4 100644 --- a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/de +++ b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/de @@ -1,97 +1,94 @@ -// $XConsortium: de /main/4 1996/08/31 12:19:20 kaleb $ -// $XFree86: xc/programs/xkbcomp/symbols/de,v 3.7.2.2 1999/07/13 07:09:56 hohndel Exp $ - -// olh@suse.de very close to MacOS map - -default partial alphanumeric_keys -xkb_symbols "basic" { - - // Describes the differences between a very simple US/ASCII - // keyboard and a very simple German keybaord - - include "latin" - name[Group1]= "Germany - Mac"; - - // Alphanumeric section - key { [ dead_circumflex, degree, notsign ] }; - key { [ 1, exclam, exclamdown, at ] }; - key { [ 2, quotedbl, twosuperior ] }; - key { [ 3, section, threesuperior,sterling ] }; - key { [ 4, dollar, onequarter, currency ] }; - key { [ 5, percent, bracketleft ] }; - key { [ 6, ampersand, bracketright ] }; - key { [ 7, slash, bar, backslash ] }; - key { [ 8, parenleft, braceleft, asciitilde ] }; - key { [ 9, parenright, braceright ] }; - key { [ 0, equal, braceright, degree ] }; - key { [ ssharp, question, backslash, questiondown ] }; - key { [ dead_acute, dead_grave, dead_cedilla ] }; - - key { [ q, Q, guillemotleft,guillemotright ] }; - key { [ e, E, EuroSign ] }; - key { [ r, R, registered ] }; - key { [ t, T ] }; - key { [ z, Z ] }; - key { [ u, U, diaeresis, Aacute ] }; - key { [ i, I, slash, Ucircumflex ] }; - key { [ o, O, oslash, Ooblique ] }; - key { [ udiaeresis, Udiaeresis, periodcentered, degree ] }; - key { [ plus, asterisk, asciitilde ] }; - key { [ a, A, aring, Aring ] }; - key { [ f, F ] }; - key { [ g, G, copyright ] }; - key { [ h, H, ordfeminine ] }; - key { [ l, L, at ] }; - key { [ odiaeresis, Odiaeresis, dead_acute ] }; - key { [ adiaeresis, Adiaeresis, dead_circumflex ] }; - - key { [ less, greater, bar ] }; - key { [ y, Y, guillemotleft,less ] }; - key { [ n, N, asciitilde ] }; - key { [ m, M, mu ] }; - key { [ comma, semicolon ] }; - key { [ period, colon, periodcentered, division ] }; - key { [ minus, underscore ] }; - key { [ numbersign, apostrophe, dead_grave ] }; - - include "kpdl(comma)" - include "level3(ralt_switch)" - -}; - -partial alphanumeric_keys -xkb_symbols "Sundeadkeys" { - // modify the default German layout to use Sun dead keys - include "macintosh_vndr/de(basic)" - name[Group1]= "Germany - Mac, Sun dead keys"; - - key { [ SunFA_Circum, degree, notsign ] }; - key { [ SunFA_Acute, SunFA_Grave, SunFA_Cedilla ] }; - key { [ udiaeresis, Udiaeresis, SunFA_Diaeresis ] }; - key { [ plus, asterisk, SunFA_Tilde, dead_macron ] }; - key { [ odiaeresis, Odiaeresis, SunFA_Acute ] }; - key { [ adiaeresis, Adiaeresis, SunFA_Circum ] }; - - key { [ numbersign, acute, SunFA_Grave ] }; -}; - -partial alphanumeric_keys -xkb_symbols "sundeadkeys" { - include "macintosh_vndr/de(Sundeadkeys)" -}; - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - // modify the default German layout to not have any dead keys - include "macintosh_vndr/de(basic)" - name[Group1]= "Germany - Mac, eliminate dead keys"; - - key { [ asciicircum, degree, notsign ] }; - key { [ acute, grave, cedilla ] }; - key { [ udiaeresis, Udiaeresis, diaeresis ] }; - key { [ plus, asterisk, asciitilde, macron ] }; - key { [ odiaeresis, Odiaeresis, acute ] }; - key { [ adiaeresis, Adiaeresis, asciicircum ] }; - - key { [ numbersign, apostrophe, grave ] }; -}; +// olh@suse.de very close to MacOS map + +default partial alphanumeric_keys +xkb_symbols "basic" { + + // Describes the differences between a very simple US/ASCII + // keyboard and a very simple German keybaord + + include "latin" + name[Group1]= "Germany - Mac"; + + // Alphanumeric section + key { [ dead_circumflex, degree, notsign ] }; + key { [ 1, exclam, exclamdown, at ] }; + key { [ 2, quotedbl, twosuperior ] }; + key { [ 3, section, threesuperior,sterling ] }; + key { [ 4, dollar, onequarter, currency ] }; + key { [ 5, percent, bracketleft ] }; + key { [ 6, ampersand, bracketright ] }; + key { [ 7, slash, bar, backslash ] }; + key { [ 8, parenleft, braceleft, asciitilde ] }; + key { [ 9, parenright, braceright ] }; + key { [ 0, equal, braceright, degree ] }; + key { [ ssharp, question, backslash, questiondown ] }; + key { [ dead_acute, dead_grave, dead_cedilla ] }; + + key { [ q, Q, guillemotleft,guillemotright ] }; + key { [ e, E, EuroSign ] }; + key { [ r, R, registered ] }; + key { [ t, T ] }; + key { [ z, Z ] }; + key { [ u, U, diaeresis, Aacute ] }; + key { [ i, I, slash, Ucircumflex ] }; + key { [ o, O, oslash, Ooblique ] }; + key { [ udiaeresis, Udiaeresis, periodcentered, degree ] }; + key { [ plus, asterisk, asciitilde ] }; + key { [ a, A, aring, Aring ] }; + key { [ f, F ] }; + key { [ g, G, copyright ] }; + key { [ h, H, ordfeminine ] }; + key { [ l, L, at ] }; + key { [ odiaeresis, Odiaeresis, dead_acute ] }; + key { [ adiaeresis, Adiaeresis, dead_circumflex ] }; + + key { [ less, greater, bar ] }; + key { [ y, Y, guillemotleft,less ] }; + key { [ n, N, asciitilde ] }; + key { [ m, M, mu ] }; + key { [ comma, semicolon ] }; + key { [ period, colon, periodcentered, division ] }; + key { [ minus, underscore ] }; + key { [ numbersign, apostrophe, dead_grave ] }; + + include "kpdl(comma)" + include "level3(ralt_switch)" + +}; + +partial alphanumeric_keys +xkb_symbols "Sundeadkeys" { + // modify the default German layout to use Sun dead keys + include "macintosh_vndr/de(basic)" + name[Group1]= "Germany - Mac, Sun dead keys"; + + key { [ SunFA_Circum, degree, notsign ] }; + key { [ SunFA_Acute, SunFA_Grave, SunFA_Cedilla ] }; + key { [ udiaeresis, Udiaeresis, SunFA_Diaeresis ] }; + key { [ plus, asterisk, SunFA_Tilde, dead_macron ] }; + key { [ odiaeresis, Odiaeresis, SunFA_Acute ] }; + key { [ adiaeresis, Adiaeresis, SunFA_Circum ] }; + + key { [ numbersign, acute, SunFA_Grave ] }; +}; + +partial alphanumeric_keys +xkb_symbols "sundeadkeys" { + include "macintosh_vndr/de(Sundeadkeys)" +}; + +partial alphanumeric_keys +xkb_symbols "nodeadkeys" { + // modify the default German layout to not have any dead keys + include "macintosh_vndr/de(basic)" + name[Group1]= "Germany - Mac, eliminate dead keys"; + + key { [ asciicircum, degree, notsign ] }; + key { [ acute, grave, cedilla ] }; + key { [ udiaeresis, Udiaeresis, diaeresis ] }; + key { [ plus, asterisk, asciitilde, macron ] }; + key { [ odiaeresis, Odiaeresis, acute ] }; + key { [ adiaeresis, Adiaeresis, asciicircum ] }; + + key { [ numbersign, apostrophe, grave ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/dk b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/dk index 56ef85bf6..a2ac773e7 100644 --- a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/dk +++ b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/dk @@ -1,79 +1,76 @@ -// $XConsortium: dk /main/3 1996/08/31 12:19:29 kaleb $ -// $XFree86: xc/programs/xkbcomp/symbols/dk,v 3.3.2.1 1999/12/20 12:56:01 hohndel Exp $ -partial alphanumeric_keys -xkb_symbols "basic" { - - // Describes the differences between a very simple en_US - // keyboard and a Danish keyboard with dead key support - // and all of ISO-8859-1 characters available. - - include "latin" - name[Group1]= "Denmark - Mac"; - - key { [ onehalf, section, threequarters, paragraph ]}; - key { [ less, greater, backslash, notsign ]}; - key { [ space, space, nobreakspace, nobreakspace ]}; - key { [ 1, exclam, exclamdown, onesuperior ]}; - key { [ 2, quotedbl, at, twosuperior ]}; - key { [ 3, numbersign, sterling, threesuperior ]}; - key { [ 4, EuroSign, dollar, onequarter ]}; - key { [ 5, percent, NoSymbol, cent ]}; - key { [ 6, ampersand, yen, NoSymbol ]}; - key { [ 7, slash, braceleft, division ]}; - key { [ 8, parenleft, bracketleft, guillemotleft ]}; - key { [ 9, parenright, bracketright, guillemotright ]}; - key { [ 0, equal, braceright, degree ]}; - key { [ comma, semicolon, dead_cedilla, dead_ogonek ]}; - key { [ period, colon, periodcentered, dead_abovedot ]}; - key { [ c, C, copyright, NoSymbol ]}; - key { [ minus, underscore, hyphen, macron ]}; - key { [ a, A, ordfeminine, masculine ]}; - key { [ d, D, eth, ETH ]}; - key { [ e, E, EuroSign, cent ]}; - key { [ r, R, registered, NoSymbol ]}; - key { [ t, T, thorn, THORN ]}; - key { [ i, I, NoSymbol, NoSymbol ]}; - key { [ o, O, oe, OE ]}; - key { [ ae, AE ]}; - key { [ plus, question, plusminus, questiondown ]}; - key { [ oslash, Ooblique ]}; - key { [ apostrophe, asterisk, dead_doubleacute, multiply ]}; - key { [ aring, Aring ]}; - key { [ dead_acute, dead_grave, bar, brokenbar ]}; - key { [ dead_diaeresis, dead_circumflex, dead_tilde, dead_caron ]}; - - // End alphanumeric section - - include "eurosign(e)" - include "level3(ralt_switch)" -}; - - -partial default alphanumeric_keys -xkb_symbols "full" { - include "iso9995-3(full)" - include "dk(basic)" -}; - - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - include "macintosh_vndr/dk(basic)" - name[Group1]= "Denmark - Mac, eliminate dead keys"; - - key { [ acute, grave, bar, ogonek ] }; - key { [ diaeresis, asciicircum, asciitilde, dead_macron ] }; -}; - -partial alphanumeric_keys -xkb_symbols "macbookpro" { - - include "level3(win_switch)" - include "macintosh_vndr/dk(basic)" - - name[Group1]= "Denmark - Mac, MacBook Pro"; - - key { [apostrophe, asterisk, at, at ] }; - key { [ dollar, section, dollar, dollar ] }; -}; - +partial alphanumeric_keys +xkb_symbols "basic" { + + // Describes the differences between a very simple en_US + // keyboard and a Danish keyboard with dead key support + // and all of ISO-8859-1 characters available. + + include "latin" + name[Group1]= "Denmark - Mac"; + + key { [ onehalf, section, threequarters, paragraph ]}; + key { [ less, greater, backslash, notsign ]}; + key { [ space, space, nobreakspace, nobreakspace ]}; + key { [ 1, exclam, exclamdown, onesuperior ]}; + key { [ 2, quotedbl, at, twosuperior ]}; + key { [ 3, numbersign, sterling, threesuperior ]}; + key { [ 4, EuroSign, dollar, onequarter ]}; + key { [ 5, percent, NoSymbol, cent ]}; + key { [ 6, ampersand, yen, NoSymbol ]}; + key { [ 7, slash, braceleft, division ]}; + key { [ 8, parenleft, bracketleft, guillemotleft ]}; + key { [ 9, parenright, bracketright, guillemotright ]}; + key { [ 0, equal, braceright, degree ]}; + key { [ comma, semicolon, dead_cedilla, dead_ogonek ]}; + key { [ period, colon, periodcentered, dead_abovedot ]}; + key { [ c, C, copyright, NoSymbol ]}; + key { [ minus, underscore, hyphen, macron ]}; + key { [ a, A, ordfeminine, masculine ]}; + key { [ d, D, eth, ETH ]}; + key { [ e, E, EuroSign, cent ]}; + key { [ r, R, registered, NoSymbol ]}; + key { [ t, T, thorn, THORN ]}; + key { [ i, I, NoSymbol, NoSymbol ]}; + key { [ o, O, oe, OE ]}; + key { [ ae, AE ]}; + key { [ plus, question, plusminus, questiondown ]}; + key { [ oslash, Ooblique ]}; + key { [ apostrophe, asterisk, dead_doubleacute, multiply ]}; + key { [ aring, Aring ]}; + key { [ dead_acute, dead_grave, bar, brokenbar ]}; + key { [ dead_diaeresis, dead_circumflex, dead_tilde, dead_caron ]}; + + // End alphanumeric section + + include "eurosign(e)" + include "level3(ralt_switch)" +}; + + +partial default alphanumeric_keys +xkb_symbols "full" { + include "iso9995-3(full)" + include "dk(basic)" +}; + + +partial alphanumeric_keys +xkb_symbols "nodeadkeys" { + include "macintosh_vndr/dk(basic)" + name[Group1]= "Denmark - Mac, eliminate dead keys"; + + key { [ acute, grave, bar, ogonek ] }; + key { [ diaeresis, asciicircum, asciitilde, dead_macron ] }; +}; + +partial alphanumeric_keys +xkb_symbols "macbookpro" { + + include "level3(win_switch)" + include "macintosh_vndr/dk(basic)" + + name[Group1]= "Denmark - Mac, MacBook Pro"; + + key { [apostrophe, asterisk, at, at ] }; + key { [ dollar, section, dollar, dollar ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/fi b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/fi index 6cb5fa314..177913737 100644 --- a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/fi +++ b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/fi @@ -1,18 +1,17 @@ - -partial default alphanumeric_keys -xkb_symbols "basic" { - - // Describes the differences between a very simple mac_US - // keyboard and a very simple Swedish(Finland) keybaord - - include "macintosh_vndr/se(basic)" // for consistent naming - name[Group1]= "Finland - Mac"; - -}; - - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - include "macintosh_vndr/se(basic)" // for consistent naming - name[Group1]= "Finland - Mac, eliminate dead keys"; -}; +partial default alphanumeric_keys +xkb_symbols "basic" { + + // Describes the differences between a very simple mac_US + // keyboard and a very simple Swedish(Finland) keybaord + + include "macintosh_vndr/se(basic)" // for consistent naming + name[Group1]= "Finland - Mac"; + +}; + + +partial alphanumeric_keys +xkb_symbols "nodeadkeys" { + include "macintosh_vndr/se(basic)" // for consistent naming + name[Group1]= "Finland - Mac, eliminate dead keys"; +}; diff --git a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/gb b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/gb index 8eb82eb70..5343673c1 100644 --- a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/gb +++ b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/gb @@ -1,21 +1,17 @@ -// $XConsortium: gb /main/3 1996/08/31 12:19:51 kaleb $ -// $XFree86: xc/programs/xkbcomp/symbols/gb,v 3.3 1996/12/23 07:13:25 dawes Exp $ -partial default alphanumeric_keys -xkb_symbols "basic" { - - // Describes the differences between a very simple en_US - // keyboard and a very simple U.K. keyboard layout - - include "latin" - - name[Group1]= "United Kingdom - Mac"; - - key { [ 2, at, EuroSign ] }; - key { [ 3, sterling, numbersign ] }; - - // End alphanumeric section - - include "level3(ralt_switch)" -}; - - +partial default alphanumeric_keys +xkb_symbols "basic" { + + // Describes the differences between a very simple en_US + // keyboard and a very simple U.K. keyboard layout + + include "latin" + + name[Group1]= "United Kingdom - Mac"; + + key { [ 2, at, EuroSign ] }; + key { [ 3, sterling, numbersign ] }; + + // End alphanumeric section + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/is b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/is index 000bcdb0b..d16d92f61 100644 --- a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/is +++ b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/is @@ -1,128 +1,127 @@ -// $XKeyboardConfig$ -// -// This file describes the differences between a Macintosh US Extended -// keymap and an Icelandic keyboard layout in the style of Mac OS and Mac OS X -// -// Copyright (C) 2004, 2006 Ævar Arnfjörð Bjarmason -// -// 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 a copyright holder shall -// not be used in advertising or otherwise to promote the sale, use or -// other dealings in this Software without prior written authorization of -// the copyright holder. -// -// = HISTORY -// * 2004-09-28: -// Initial cleanroom writing of the keymap, I just booted Mac OS X, opened -// TextEdit.app and wrote down what the value produced by each key was when I -// pressed it, a for a, A for shift + a, å for lalt + a etc and made the -// keymap from that information -// -// * 2006-01-14: -// Revised the comments in the file -// -// = NOTES -// * 20 characters in this keymap have no named character defined in -// include/keysymdef.h and as a result their Unicode code points in -// hexadecimal are listed here, these can be generated with the following -// perl command: -// $ perl -CA -e 'printf "U%x\n", ord shift' Æ -// and converted back like: -// $ perl -CO -le '$_=shift;s/[^a-f0-9]//ig;print chr hex' Uc6 -// * The Apple logo appears twice on this keymap like the Mac OS and Mac OS X -// keymaps. In the MacRoman encoding it has the code point 0xF0 (240) but it -// has no assigned code point in Unicode, the code point Apple uses for it is -// U+F8FF (63743) which is in the BMP's Private Use Area (U+E000–U+F8FF) -// * This keymap has only been tested on a PowerBook6,5 (iBook G4) but it -// should work on other Apple laptop models which use the same keyboard -// layout. It will probably work on standard sized keyboards with little or -// no modification but it might not support them fully, please report if -// you're able to get it running with such a keyboard - -partial default alphanumeric_keys -xkb_symbols "basic" { - name[Group1]= "Iceland - Mac"; - - //-- Row 5 (E) --// - key { [ sterling, section, UF8FF, apostrophe ] }; - key { [ 1, exclam, exclamdown, VoidSymbol ] }; - key { [ 2, quotedbl, at, VoidSymbol ] }; - key { [ 3, numbersign, U2122, sterling ] }; - key { [ 4, dollar, U00A2, EuroSign ] }; - key { [ 5, percent, U2030, infinity ] }; - key { [ 6, ampersand, asciicircum, U2044 ] }; - key { [ 7, slash, backslash, U00F7 ] }; - key { [ 8, parenleft, bracketleft, braceleft ] }; - key { [ 9, parenright, bracketright, braceright ] }; - key { [ 0, equal, U2260, U2248 ] }; - key { [ odiaeresis, Odiaeresis, oslash, Ooblique ] }; - key { [ minus, underscore, endash, emdash ] }; - - - //-- Row 4 (D) --// - key { [ q, Q, paragraph, VoidSymbol ] }; - key { [ w, W, U2211, VoidSymbol ] }; - key { [ e, E, dead_grave, VoidSymbol ] }; - key { [ r, R, registered, VoidSymbol ] }; - key { [ t, T, degree, VoidSymbol ] }; - key { [ y, Y, yen, VoidSymbol ] }; - key { [ u, U, dead_diaeresis, VoidSymbol ] }; - key { [ i, I, U0131, U00AA ] }; - key { [ o, O, dead_circumflex,U00BA ] }; - key { [ p, P, Greek_pi, Greek_PI ] }; - key { [ eth, Eth, U201e, U201c ] }; - key { [ apostrophe, question, questiondown, U00B7 ] }; - - - //-- Row 3 (C) --// - key { [ a, A, aring, Aring ] }; - key { [ s, S, ssharp, abovedot ] }; - key { [ d, D, U2202, U2DA ] }; - key { [ f, F, U192, macron ] }; - key { [ g, G, copyright, breve ] }; - key { [ h, H, bar, VoidSymbol ] }; - key { [ j, J, U2206, U2dd ] }; - key { [ k, K, U00AC, VoidSymbol ] }; - key { [ l, L, U2026, caron ] }; - key { [ ae, AE, oe, OE ] }; - key { [ dead_acute, dead_diaeresis, U201A, U2018 ] }; - key { [ plus, asterisk, U2022, plusminus ] }; - - - //-- Row 2 (B) --// - key { [ less, greater, section, UF8FF ] }; - key { [ z, Z, U3A9, VoidSymbol ] }; - key { [ x, X, asciitilde, VoidSymbol ] }; - key { [ c, C, ccedilla, Ccedilla ] }; - key { [ v, V, U221A, U25CA ] }; - key { [ b, B, U222B, VoidSymbol ] }; - key { [ n, N, dead_tilde, VoidSymbol ] }; - key { [ m, M, U00B5, VoidSymbol ] }; - key { [ comma, semicolon, lessthanequal, guillemotleft ] }; - key { [ period, colon, greaterthanequal,guillemotright ] }; - key { [ thorn, Thorn, U2019, U201d ] }; - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - include "macintosh_vndr/is(basic)" // for consistent naming - name[Group1]= "Iceland - Mac, eliminate dead keys"; -}; +// +// This file describes the differences between a Macintosh US Extended +// keymap and an Icelandic keyboard layout in the style of Mac OS and Mac OS X +// +// Copyright (C) 2004, 2006 Ævar Arnfjörð Bjarmason +// +// 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 a copyright holder shall +// not be used in advertising or otherwise to promote the sale, use or +// other dealings in this Software without prior written authorization of +// the copyright holder. +// +// = HISTORY +// * 2004-09-28: +// Initial cleanroom writing of the keymap, I just booted Mac OS X, opened +// TextEdit.app and wrote down what the value produced by each key was when I +// pressed it, a for a, A for shift + a, å for lalt + a etc and made the +// keymap from that information +// +// * 2006-01-14: +// Revised the comments in the file +// +// = NOTES +// * 20 characters in this keymap have no named character defined in +// include/keysymdef.h and as a result their Unicode code points in +// hexadecimal are listed here, these can be generated with the following +// perl command: +// $ perl -CA -e 'printf "U%x\n", ord shift' Æ +// and converted back like: +// $ perl -CO -le '$_=shift;s/[^a-f0-9]//ig;print chr hex' Uc6 +// * The Apple logo appears twice on this keymap like the Mac OS and Mac OS X +// keymaps. In the MacRoman encoding it has the code point 0xF0 (240) but it +// has no assigned code point in Unicode, the code point Apple uses for it is +// U+F8FF (63743) which is in the BMP's Private Use Area (U+E000–U+F8FF) +// * This keymap has only been tested on a PowerBook6,5 (iBook G4) but it +// should work on other Apple laptop models which use the same keyboard +// layout. It will probably work on standard sized keyboards with little or +// no modification but it might not support them fully, please report if +// you're able to get it running with such a keyboard + +partial default alphanumeric_keys +xkb_symbols "basic" { + name[Group1]= "Iceland - Mac"; + + //-- Row 5 (E) --// + key { [ sterling, section, UF8FF, apostrophe ] }; + key { [ 1, exclam, exclamdown, VoidSymbol ] }; + key { [ 2, quotedbl, at, VoidSymbol ] }; + key { [ 3, numbersign, U2122, sterling ] }; + key { [ 4, dollar, U00A2, EuroSign ] }; + key { [ 5, percent, U2030, infinity ] }; + key { [ 6, ampersand, asciicircum, U2044 ] }; + key { [ 7, slash, backslash, U00F7 ] }; + key { [ 8, parenleft, bracketleft, braceleft ] }; + key { [ 9, parenright, bracketright, braceright ] }; + key { [ 0, equal, U2260, U2248 ] }; + key { [ odiaeresis, Odiaeresis, oslash, Ooblique ] }; + key { [ minus, underscore, endash, emdash ] }; + + + //-- Row 4 (D) --// + key { [ q, Q, paragraph, VoidSymbol ] }; + key { [ w, W, U2211, VoidSymbol ] }; + key { [ e, E, dead_grave, VoidSymbol ] }; + key { [ r, R, registered, VoidSymbol ] }; + key { [ t, T, degree, VoidSymbol ] }; + key { [ y, Y, yen, VoidSymbol ] }; + key { [ u, U, dead_diaeresis, VoidSymbol ] }; + key { [ i, I, U0131, U00AA ] }; + key { [ o, O, dead_circumflex,U00BA ] }; + key { [ p, P, Greek_pi, Greek_PI ] }; + key { [ eth, Eth, U201e, U201c ] }; + key { [ apostrophe, question, questiondown, U00B7 ] }; + + + //-- Row 3 (C) --// + key { [ a, A, aring, Aring ] }; + key { [ s, S, ssharp, abovedot ] }; + key { [ d, D, U2202, U2DA ] }; + key { [ f, F, U192, macron ] }; + key { [ g, G, copyright, breve ] }; + key { [ h, H, bar, VoidSymbol ] }; + key { [ j, J, U2206, U2dd ] }; + key { [ k, K, U00AC, VoidSymbol ] }; + key { [ l, L, U2026, caron ] }; + key { [ ae, AE, oe, OE ] }; + key { [ dead_acute, dead_diaeresis, U201A, U2018 ] }; + key { [ plus, asterisk, U2022, plusminus ] }; + + + //-- Row 2 (B) --// + key { [ less, greater, section, UF8FF ] }; + key { [ z, Z, U3A9, VoidSymbol ] }; + key { [ x, X, asciitilde, VoidSymbol ] }; + key { [ c, C, ccedilla, Ccedilla ] }; + key { [ v, V, U221A, U25CA ] }; + key { [ b, B, U222B, VoidSymbol ] }; + key { [ n, N, dead_tilde, VoidSymbol ] }; + key { [ m, M, U00B5, VoidSymbol ] }; + key { [ comma, semicolon, lessthanequal, guillemotleft ] }; + key { [ period, colon, greaterthanequal,guillemotright ] }; + key { [ thorn, Thorn, U2019, U201d ] }; + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "nodeadkeys" { + include "macintosh_vndr/is(basic)" // for consistent naming + name[Group1]= "Iceland - Mac, eliminate dead keys"; +}; diff --git a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/it b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/it index 44435201b..889653f8e 100644 --- a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/it +++ b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/it @@ -1,64 +1,62 @@ - -xkb_symbols "extended" { - - name[Group1]= "Italy - Mac"; - - // Alphanumeric section - key { [ less, greater ] }; - key { [ at, numbersign, periodcentered ] }; - key { [ ampersand, 1, guillemotleft,guillemotright ] }; - key { [ quotedbl, 2 ] }; - key { [ apostrophe, 3 ] }; - key { [ parenleft, 4, braceleft, bracketleft ] }; - key { [ ccedilla, 5, Ccedilla, Iacute ] }; - key { [ egrave, 6, paragraph, periodcentered] }; - key { [ parenright, 7, braceright, bracketright ] }; - key { [ sterling, 8, infinity ] }; - key { [ agrave, 9, acute, Ocircumflex ] }; - key { [ eacute, 0, grave, Oacute ] }; - key { [ minus, underscore ] }; - key { [ equal, plus, notequal, plusminus ] }; - - key { [ q, Q ] }; - key { [ z, Z ] }; - key { [ e, E, EuroSign ] }; - key { [ r, R, registered ] }; - key { [ t, T ] }; - key { [ y, Y, Uacute, ydiaeresis ] }; - key { [ u, U ] }; - key { [ i, I, icircumflex, idiaeresis ] }; - key { [ o, O ] }; - key { [ p, P ] }; - key { [ igrave, asciicircum ] }; - key { [ dollar, asterisk ] }; - key { [ section, degree, at, numbersign ] }; - - key { [ a, A, aring, Aring ] }; - key { [ s, S, ssharp ] }; - key { [ d, D ] }; - key { [ f, F ] }; - key { [ g, G ] }; - key { [ h, H, Igrave, Icircumflex ] }; - key { [ j, J, Idiaeresis, Iacute ] }; - key { [ k, K, Egrave, Ediaeresis ] }; - key { [ l, L, ssharp, bar ] }; - key { [ m, M, mu, Oacute ] }; - key { [ ugrave, percent, ae, AE ] }; - - key { [ w, W ] }; - key { [ x, X ] }; - key { [ c, C, copyright, copyright ] }; - key { [ v, V ] }; - key { [ b, B ] }; - key { [ n, N, dead_tilde ] }; - key { [ comma, question, questiondown ] }; - key { [ semicolon, period ] }; - key { [ colon, slash, bar, backslash ] }; - key { [ ograve, exclam, exclamdown ] }; - - // End alphanumeric section - - include "kpdl(dot)" - include "level3(ralt_switch)" -}; - +xkb_symbols "extended" { + + name[Group1]= "Italy - Mac"; + + // Alphanumeric section + key { [ less, greater ] }; + key { [ at, numbersign, periodcentered ] }; + key { [ ampersand, 1, guillemotleft,guillemotright ] }; + key { [ quotedbl, 2 ] }; + key { [ apostrophe, 3 ] }; + key { [ parenleft, 4, braceleft, bracketleft ] }; + key { [ ccedilla, 5, Ccedilla, Iacute ] }; + key { [ egrave, 6, paragraph, periodcentered] }; + key { [ parenright, 7, braceright, bracketright ] }; + key { [ sterling, 8, infinity ] }; + key { [ agrave, 9, acute, Ocircumflex ] }; + key { [ eacute, 0, grave, Oacute ] }; + key { [ minus, underscore ] }; + key { [ equal, plus, notequal, plusminus ] }; + + key { [ q, Q ] }; + key { [ z, Z ] }; + key { [ e, E, EuroSign ] }; + key { [ r, R, registered ] }; + key { [ t, T ] }; + key { [ y, Y, Uacute, ydiaeresis ] }; + key { [ u, U ] }; + key { [ i, I, icircumflex, idiaeresis ] }; + key { [ o, O ] }; + key { [ p, P ] }; + key { [ igrave, asciicircum ] }; + key { [ dollar, asterisk ] }; + key { [ section, degree, at, numbersign ] }; + + key { [ a, A, aring, Aring ] }; + key { [ s, S, ssharp ] }; + key { [ d, D ] }; + key { [ f, F ] }; + key { [ g, G ] }; + key { [ h, H, Igrave, Icircumflex ] }; + key { [ j, J, Idiaeresis, Iacute ] }; + key { [ k, K, Egrave, Ediaeresis ] }; + key { [ l, L, ssharp, bar ] }; + key { [ m, M, mu, Oacute ] }; + key { [ ugrave, percent, ae, AE ] }; + + key { [ w, W ] }; + key { [ x, X ] }; + key { [ c, C, copyright, copyright ] }; + key { [ v, V ] }; + key { [ b, B ] }; + key { [ n, N, dead_tilde ] }; + key { [ comma, question, questiondown ] }; + key { [ semicolon, period ] }; + key { [ colon, slash, bar, backslash ] }; + key { [ ograve, exclam, exclamdown ] }; + + // End alphanumeric section + + include "kpdl(dot)" + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/latam b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/latam index 085de0e4b..a588ab27c 100644 --- a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/latam +++ b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/latam @@ -1,38 +1,37 @@ - -partial default alphanumeric_keys -xkb_symbols "basic" { - - // Describes the differences between a very simple mac_US - // keyboard and a very simple Spanish keybaord - - include "latin" - name[Group1]= "Latin American - Mac"; - - key { [ bracketleft, bracketright, braceleft, braceright ] }; - key { [ less, greater, bracketleft, braceleft ] }; - key { [ 1, exclamdown ] }; - key { [ 2, exclam, at, oneeighth ] }; - key { [ 3, numbersign, guillemotleft, guillemotright ] }; - key { [ 4, dollar, yen, Icircumflex ] }; - key { [ 5, percent ] }; - key { [ 6, slash, backslash, Idiaeresis ] }; - key { [ 7, ampersand, bar, Iacute ] }; - key { [ 8, asterisk, degree ] }; - key { [ 9, parenleft, sterling, Ocircumflex ] }; - key { [ 0, parenright ] }; - key { [ minus, underscore ] }; - key { [ equal, plus, plusminus ] }; - key { [ dead_grave, degree ] }; - key { [ dead_acute, dead_diaeresis, bar ] }; - - key { [ comma, questiondown ] }; - key { [ period, question ] }; - key { [ ccedilla, Ccedilla ] }; - key { [ ntilde, Ntilde, asciitilde, dead_doubleacute ] }; - key { [ semicolon, colon ] }; - key { [ apostrophe, quotedbl ] }; - - // End alphanumeric section - - include "level3(ralt_switch)" -}; +partial default alphanumeric_keys +xkb_symbols "basic" { + + // Describes the differences between a very simple mac_US + // keyboard and a very simple Spanish keybaord + + include "latin" + name[Group1]= "Latin American - Mac"; + + key { [ bracketleft, bracketright, braceleft, braceright ] }; + key { [ less, greater, bracketleft, braceleft ] }; + key { [ 1, exclamdown ] }; + key { [ 2, exclam, at, oneeighth ] }; + key { [ 3, numbersign, guillemotleft, guillemotright ] }; + key { [ 4, dollar, yen, Icircumflex ] }; + key { [ 5, percent ] }; + key { [ 6, slash, backslash, Idiaeresis ] }; + key { [ 7, ampersand, bar, Iacute ] }; + key { [ 8, asterisk, degree ] }; + key { [ 9, parenleft, sterling, Ocircumflex ] }; + key { [ 0, parenright ] }; + key { [ minus, underscore ] }; + key { [ equal, plus, plusminus ] }; + key { [ dead_grave, degree ] }; + key { [ dead_acute, dead_diaeresis, bar ] }; + + key { [ comma, questiondown ] }; + key { [ period, question ] }; + key { [ ccedilla, Ccedilla ] }; + key { [ ntilde, Ntilde, asciitilde, dead_doubleacute ] }; + key { [ semicolon, colon ] }; + key { [ apostrophe, quotedbl ] }; + + // End alphanumeric section + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/nl b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/nl index b60690e4d..05034701e 100644 --- a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/nl +++ b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/nl @@ -1,17 +1,15 @@ - -partial default alphanumeric_keys -xkb_symbols "basic" { - - // Describes the differences between a very simple mac_US - // keyboard and a very simple netherland keybaord - - include "latin" - - name[Group1]= "Netherlands - Mac"; - - include "level3(ralt_switch)" - -// do just nothing - -}; - +partial default alphanumeric_keys +xkb_symbols "basic" { + + // Describes the differences between a very simple mac_US + // keyboard and a very simple netherland keybaord + + include "latin" + + name[Group1]= "Netherlands - Mac"; + + include "level3(ralt_switch)" + +// do just nothing + +}; diff --git a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/no b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/no index d8bf0d650..442aee9af 100644 --- a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/no +++ b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/no @@ -1,52 +1,50 @@ -// $XConsortium: no /main/3 1996/08/31 12:20:02 kaleb $ -// $XFree86: xc/programs/xkbcomp/symbols/no,v 3.3.2.1 1997/07/26 06:31:01 dawes Exp $ -partial default alphanumeric_keys -xkb_symbols "basic" { - - // Describes the differences between a very simple en_US - // keyboard and a very simple Norwegian keybaord - - include "latin" - - name[Group1]= "Norway - Mac"; - - key { [ bar, section ] }; - key { [ 2, quotedbl, at, oneeighth ] }; - key { [ 4, currency, dollar, dollar ] }; - key { [ 3, numbersign, sterling, sterling ] }; - key { [ 6, ampersand ] }; - key { [ 7, slash, bar, backslash ] }; - key { [ 8, parenleft, bracketleft, braceleft ] }; - key { [ 9, parenright, bracketright, braceright ] }; - key { [ 0, equal ] }; - - key { [ comma, semicolon ] }; - key { [ period, colon ] }; - key { [ minus, underscore ] }; - key { [ oslash, Ooblique, odiaeresis, Odiaeresis ] }; - key { [ plus, question ] }; - key { [ ae, AE ] }; - key { [ aring, Aring ] }; - key { [ dead_grave, dead_acute, acute, dead_ogonek ] }; - key { [ diaeresis, asciicircum, asciitilde, dead_macron ] }; - key { [ at, asterisk ] }; - key { [ less, greater ] }; - - // End alphanumeric section - - include "eurosign(e)" - include "level3(ralt_switch)" -}; - - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - - // Modifies the basic Norwegian layout to eliminate dead keys - include "macintosh_vndr/no(basic)" - name[Group1]= "Norway - Mac, eliminate dead keys"; - - key { [ grave, acute, acute, ogonek ] }; - key { [ diaeresis, asciicircum, asciitilde, macron ] }; - -}; +partial default alphanumeric_keys +xkb_symbols "basic" { + + // Describes the differences between a very simple en_US + // keyboard and a very simple Norwegian keybaord + + include "latin" + + name[Group1]= "Norway - Mac"; + + key { [ bar, section ] }; + key { [ 2, quotedbl, at, oneeighth ] }; + key { [ 4, currency, dollar, dollar ] }; + key { [ 3, numbersign, sterling, sterling ] }; + key { [ 6, ampersand ] }; + key { [ 7, slash, bar, backslash ] }; + key { [ 8, parenleft, bracketleft, braceleft ] }; + key { [ 9, parenright, bracketright, braceright ] }; + key { [ 0, equal ] }; + + key { [ comma, semicolon ] }; + key { [ period, colon ] }; + key { [ minus, underscore ] }; + key { [ oslash, Ooblique, odiaeresis, Odiaeresis ] }; + key { [ plus, question ] }; + key { [ ae, AE ] }; + key { [ aring, Aring ] }; + key { [ dead_grave, dead_acute, acute, dead_ogonek ] }; + key { [ diaeresis, asciicircum, asciitilde, dead_macron ] }; + key { [ at, asterisk ] }; + key { [ less, greater ] }; + + // End alphanumeric section + + include "eurosign(e)" + include "level3(ralt_switch)" +}; + + +partial alphanumeric_keys +xkb_symbols "nodeadkeys" { + + // Modifies the basic Norwegian layout to eliminate dead keys + include "macintosh_vndr/no(basic)" + name[Group1]= "Norway - Mac, eliminate dead keys"; + + key { [ grave, acute, acute, ogonek ] }; + key { [ diaeresis, asciicircum, asciitilde, macron ] }; + +}; diff --git a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/pt b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/pt index 8f1785742..8c3b7173c 100644 --- a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/pt +++ b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/pt @@ -1,63 +1,61 @@ -// $XConsortium: pt /main/3 1996/08/31 12:20:08 kaleb $ -// $XFree86: xc/programs/xkbcomp/symbols/pt,v 3.3.2.1 1999/11/18 15:37:37 hohndel Exp $ -// mac version from Ricardo Cabral - -partial default alphanumeric_keys -xkb_symbols "basic" { - - // Describes the differences between a very simple en_US - // keyboard and a very simple Portuguese keybaord - - include "latin" - - name[Group1]= "Portugal - Mac"; - - key { [ less, greater, bar, brokenbar ] }; - key { [ 2, quotedbl, at, oneeighth ] }; - key { [ 4, dollar, section, dollar ] }; - key { [ 3, numbersign, sterling, sterling ] }; - key { [ 6, ampersand ] }; - key { [ 7, slash ] }; - key { [ 8, parenleft, bracketleft, braceleft ] }; - key { [ 9, parenright, bracketright, braceright ] }; - key { [ 0, equal ] }; - key { [ apostrophe, question ] }; - key { [ plus, asterisk, dead_diaeresis ] }; - key { [ comma, semicolon ] }; - key { [ period, colon ] }; - key { [ minus, underscore ] }; - key { [ ccedilla, Ccedilla ] }; - key { [ dead_tilde, dead_circumflex ] }; - key { [ backslash, bar ] }; - key { [ masculine, ordfeminine ] }; - key { [ dead_acute, dead_grave ] }; - // End alphanumeric section - - include "eurosign(e)" - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "Sundeadkeys" { - include "macintosh_vndr/pt(basic)" // for consistent naming - name[Group1]= "Portugal - Mac, Sun dead keys"; - - key { [ plus, asterisk, SunFA_Diaeresis, SunFA_Diaeresis ] }; - key { [ SunFA_Tilde, SunFA_Circum ] }; - key { [ SunFA_Acute, SunFA_Grave ] }; -}; - -partial alphanumeric_keys -xkb_symbols "sundeadkeys" { - include "macintosh_vndr/pt(Sundeadkeys)" // for consistent naming -}; - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - include "macintosh_vndr/pt(basic)" // for consistent naming - name[Group1]= "Portugal - Mac, eliminate dead keys"; - - key { [ plus, asterisk, quotedbl, quotedbl ] }; - key { [ asciitilde, asciicircum ] }; - key { [ acute, grave ] }; -}; +// mac version from Ricardo Cabral + +partial default alphanumeric_keys +xkb_symbols "basic" { + + // Describes the differences between a very simple en_US + // keyboard and a very simple Portuguese keybaord + + include "latin" + + name[Group1]= "Portugal - Mac"; + + key { [ less, greater, bar, brokenbar ] }; + key { [ 2, quotedbl, at, oneeighth ] }; + key { [ 4, dollar, section, dollar ] }; + key { [ 3, numbersign, sterling, sterling ] }; + key { [ 6, ampersand ] }; + key { [ 7, slash ] }; + key { [ 8, parenleft, bracketleft, braceleft ] }; + key { [ 9, parenright, bracketright, braceright ] }; + key { [ 0, equal ] }; + key { [ apostrophe, question ] }; + key { [ plus, asterisk, dead_diaeresis ] }; + key { [ comma, semicolon ] }; + key { [ period, colon ] }; + key { [ minus, underscore ] }; + key { [ ccedilla, Ccedilla ] }; + key { [ dead_tilde, dead_circumflex ] }; + key { [ backslash, bar ] }; + key { [ masculine, ordfeminine ] }; + key { [ dead_acute, dead_grave ] }; + // End alphanumeric section + + include "eurosign(e)" + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "Sundeadkeys" { + include "macintosh_vndr/pt(basic)" // for consistent naming + name[Group1]= "Portugal - Mac, Sun dead keys"; + + key { [ plus, asterisk, SunFA_Diaeresis, SunFA_Diaeresis ] }; + key { [ SunFA_Tilde, SunFA_Circum ] }; + key { [ SunFA_Acute, SunFA_Grave ] }; +}; + +partial alphanumeric_keys +xkb_symbols "sundeadkeys" { + include "macintosh_vndr/pt(Sundeadkeys)" // for consistent naming +}; + +partial alphanumeric_keys +xkb_symbols "nodeadkeys" { + include "macintosh_vndr/pt(basic)" // for consistent naming + name[Group1]= "Portugal - Mac, eliminate dead keys"; + + key { [ plus, asterisk, quotedbl, quotedbl ] }; + key { [ asciitilde, asciicircum ] }; + key { [ acute, grave ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/se b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/se index d5d8c1c4c..56d77bd0f 100644 --- a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/se +++ b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/se @@ -1,46 +1,44 @@ -// $XConsortium: se /main/3 1996/08/31 12:20:15 kaleb $ -// $XFree86: xc/programs/xkbcomp/symbols/macintosh/se,v 1.1 2000/09/19 12:46:26 eich Exp $ -partial default alphanumeric_keys -xkb_symbols "basic" { - - // Describes the differences between a very simple en_US - // keyboard and a very simple Swedish(Sweden) keybaord - - include "latin" - - name[Group1]= "Sweden - Mac"; - - key { [ section, degree ] }; - - key { [ 1, exclam, copyright, exclamdown ] }; - key { [ 2, quotedbl, at, oneeighth ] }; - key { [ 3, numbersign, sterling, yen ] }; - key { [ 4, currency, dollar, cent ] }; - key { [ 6, ampersand ] }; - key { [ 7, slash, bar, backslash ] }; - key { [ 8, parenleft, bracketleft, braceleft ] }; - key { [ 9, parenright, bracketright, braceright ] }; - key { [ comma, semicolon ] }; - key { [ 0, equal ] }; - key { [ period, colon ] }; - key { [ minus, underscore ] }; - key { [ odiaeresis, Odiaeresis, oslash, Ooblique ] }; - key { [ plus, question ] }; - key { [ adiaeresis, Adiaeresis, ae, AE ] }; - key { [ aring, Aring ] }; - key { [ acute, grave ] }; - key { [ diaeresis, asciicircum, asciitilde ] }; - key { [ apostrophe, asterisk, at ] }; - key { [ less, greater, bar, brokenbar ] }; - - include "kpdl(comma)" - include "eurosign(e)" - include "level3(ralt_switch)" -}; - - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - include "macintosh_vndr/se(basic)" // for consistent naming - name[Group1]= "Sweden - Mac, eliminate dead keys"; -}; +partial default alphanumeric_keys +xkb_symbols "basic" { + + // Describes the differences between a very simple en_US + // keyboard and a very simple Swedish(Sweden) keybaord + + include "latin" + + name[Group1]= "Sweden - Mac"; + + key { [ section, degree ] }; + + key { [ 1, exclam, copyright, exclamdown ] }; + key { [ 2, quotedbl, at, oneeighth ] }; + key { [ 3, numbersign, sterling, yen ] }; + key { [ 4, currency, dollar, cent ] }; + key { [ 6, ampersand ] }; + key { [ 7, slash, bar, backslash ] }; + key { [ 8, parenleft, bracketleft, braceleft ] }; + key { [ 9, parenright, bracketright, braceright ] }; + key { [ comma, semicolon ] }; + key { [ 0, equal ] }; + key { [ period, colon ] }; + key { [ minus, underscore ] }; + key { [ odiaeresis, Odiaeresis, oslash, Ooblique ] }; + key { [ plus, question ] }; + key { [ adiaeresis, Adiaeresis, ae, AE ] }; + key { [ aring, Aring ] }; + key { [ acute, grave ] }; + key { [ diaeresis, asciicircum, asciitilde ] }; + key { [ apostrophe, asterisk, at ] }; + key { [ less, greater, bar, brokenbar ] }; + + include "kpdl(comma)" + include "eurosign(e)" + include "level3(ralt_switch)" +}; + + +partial alphanumeric_keys +xkb_symbols "nodeadkeys" { + include "macintosh_vndr/se(basic)" // for consistent naming + name[Group1]= "Sweden - Mac, eliminate dead keys"; +}; diff --git a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/us b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/us index fed3253cf..6da1c67bf 100644 --- a/xorg-server/xkeyboard-config/symbols/macintosh_vndr/us +++ b/xorg-server/xkeyboard-config/symbols/macintosh_vndr/us @@ -1,151 +1,148 @@ -// $XConsortium: macintosh /main/10 1996/01/29 19:54:54 kaleb $ -// $XFree86: xc/programs/xkbcomp/symbols/macintosh/us,v 1.8 2003/08/04 10:32:31 eich Exp $ - -// symbols definition for a Macintosh "Extended" keyboard - -xkb_symbols "extended" { - - name[Group1]= "USA"; - key { [ Escape ] }; - - // Alphanumeric section - key { [ quoteleft, asciitilde ] }; - key { [ 1, exclam ] }; - key { [ 2, at ] }; - key { [ 3, numbersign ] }; - key { [ 4, dollar ] }; - key { [ 5, percent ] }; - key { [ 6, asciicircum ] }; - key { [ 7, ampersand ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ minus, underscore ] }; - key { [ equal, plus ] }; - - key { [ q, Q ] }; - key { [ w, W ] }; - key { [ e, E ] }; - key { [ r, R ] }; - key { [ t, T ] }; - key { [ y, Y ] }; - key { [ u, U ] }; - key { [ i, I ] }; - key { [ o, O ] }; - key { [ p, P ] }; - key { [ bracketleft, braceleft ] }; - key { [ bracketright, braceright ] }; - key { [ backslash, bar ] }; - - key { [ a, A ] }; - key { [ s, S ] }; - key { [ d, D ] }; - key { [ f, F ] }; - key { [ g, G ] }; - key { [ h, H ] }; - key { [ j, J ] }; - key { [ k, K ] }; - key { [ l, L ] }; - key { [ semicolon, colon ] }; - key { [ quoteright, quotedbl ] }; - - key { [ z, Z ] }; - key { [ x, X ] }; - key { [ c, C ] }; - key { [ v, V ] }; - key { [ b, B ] }; - key { [ n, N ] }; - key { [ m, M ] }; - key { [ comma, less ] }; - key { [ period, greater ] }; - key { [ slash, question ] }; - - key { [ space ] }; - // End alphanumeric section - - - include "eurosign(e)" - include "keypad" - - key { [ equal ] }; -}; - -hidden -xkb_symbols "oldmac" { - - include "macintosh_vndr/us(extended)" - - // Begin "Function" section - key { [ F1 ] }; - key { [ F2 ] }; - key { [ F3 ] }; - key { [ F4 ] }; - key { [ F5 ] }; - key { [ F6 ] }; - key { [ F7 ] }; - key { [ F8 ] }; - key { [ F9 ] }; - key { [ F10 ] }; - key { [ F11 ] }; - key { [ F12 ] }; - key { [ Print ] }; - key { [ Scroll_Lock ] }; - key { [ Pause ] }; - // End "Function" section - - // Begin "Editing" section - key { [ Insert ] }; - key { [ Home ] }; - key { [ Prior ] }; - key { [ Delete ] }; - key { [ End ] }; - key { [ Next ] }; - - key { [ Up ] }; - key { [ Left ] }; - key { [ Down ] }; - key { [ Right ] }; - // End "Editing" section - - key { [ BackSpace ] }; - key { [ Tab, ISO_Left_Tab ] }; - key { [ Return ] }; - key { [ Caps_Lock ] }; - key { [ Num_Lock, Pointer_EnableKeys ] }; - - // Begin "Modifier" section - key { [ Shift_L ] }; - key { [ Shift_R ] }; - key { [ Control_L ] }; - key { [ Control_R ] }; - key { [ Alt_L, Meta_L ] }; - key { [ Alt_R, Meta_R ] }; - key { [ Super_L ] }; - key { [ Super_R ] }; - // End "Modifier" section - - // begin modifier mappings - modifier_map Shift { Shift_L, Shift_R }; - modifier_map Lock { Caps_Lock, ISO_Lock }; - modifier_map Control{ Control_L, Control_R }; - modifier_map Mod2 { Num_Lock }; - - // Fake keys for virtual<->real modifiers mapping - key { [ ISO_Level3_Shift ] }; - key { [ Mode_switch ] }; - modifier_map Mod5 { , }; - - key { [ NoSymbol, Alt_L ] }; - modifier_map Mod1 { , }; - - key { [ NoSymbol, Meta_L ] }; - modifier_map Mod1 { }; - - key { [ NoSymbol, Super_L ] }; - modifier_map Mod4 { }; - - key { [ NoSymbol, Hyper_L ] }; - modifier_map Mod4 { }; - // end modifier mappings - -}; +// symbols definition for a Macintosh "Extended" keyboard + +xkb_symbols "extended" { + + name[Group1]= "USA"; + key { [ Escape ] }; + + // Alphanumeric section + key { [ quoteleft, asciitilde ] }; + key { [ 1, exclam ] }; + key { [ 2, at ] }; + key { [ 3, numbersign ] }; + key { [ 4, dollar ] }; + key { [ 5, percent ] }; + key { [ 6, asciicircum ] }; + key { [ 7, ampersand ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ minus, underscore ] }; + key { [ equal, plus ] }; + + key { [ q, Q ] }; + key { [ w, W ] }; + key { [ e, E ] }; + key { [ r, R ] }; + key { [ t, T ] }; + key { [ y, Y ] }; + key { [ u, U ] }; + key { [ i, I ] }; + key { [ o, O ] }; + key { [ p, P ] }; + key { [ bracketleft, braceleft ] }; + key { [ bracketright, braceright ] }; + key { [ backslash, bar ] }; + + key { [ a, A ] }; + key { [ s, S ] }; + key { [ d, D ] }; + key { [ f, F ] }; + key { [ g, G ] }; + key { [ h, H ] }; + key { [ j, J ] }; + key { [ k, K ] }; + key { [ l, L ] }; + key { [ semicolon, colon ] }; + key { [ quoteright, quotedbl ] }; + + key { [ z, Z ] }; + key { [ x, X ] }; + key { [ c, C ] }; + key { [ v, V ] }; + key { [ b, B ] }; + key { [ n, N ] }; + key { [ m, M ] }; + key { [ comma, less ] }; + key { [ period, greater ] }; + key { [ slash, question ] }; + + key { [ space ] }; + // End alphanumeric section + + + include "eurosign(e)" + include "keypad" + + key { [ equal ] }; +}; + +hidden +xkb_symbols "oldmac" { + + include "macintosh_vndr/us(extended)" + + // Begin "Function" section + key { [ F1 ] }; + key { [ F2 ] }; + key { [ F3 ] }; + key { [ F4 ] }; + key { [ F5 ] }; + key { [ F6 ] }; + key { [ F7 ] }; + key { [ F8 ] }; + key { [ F9 ] }; + key { [ F10 ] }; + key { [ F11 ] }; + key { [ F12 ] }; + key { [ Print ] }; + key { [ Scroll_Lock ] }; + key { [ Pause ] }; + // End "Function" section + + // Begin "Editing" section + key { [ Insert ] }; + key { [ Home ] }; + key { [ Prior ] }; + key { [ Delete ] }; + key { [ End ] }; + key { [ Next ] }; + + key { [ Up ] }; + key { [ Left ] }; + key { [ Down ] }; + key { [ Right ] }; + // End "Editing" section + + key { [ BackSpace ] }; + key { [ Tab, ISO_Left_Tab ] }; + key { [ Return ] }; + key { [ Caps_Lock ] }; + key { [ Num_Lock, Pointer_EnableKeys ] }; + + // Begin "Modifier" section + key { [ Shift_L ] }; + key { [ Shift_R ] }; + key { [ Control_L ] }; + key { [ Control_R ] }; + key { [ Alt_L, Meta_L ] }; + key { [ Alt_R, Meta_R ] }; + key { [ Super_L ] }; + key { [ Super_R ] }; + // End "Modifier" section + + // begin modifier mappings + modifier_map Shift { Shift_L, Shift_R }; + modifier_map Lock { Caps_Lock, ISO_Lock }; + modifier_map Control{ Control_L, Control_R }; + modifier_map Mod2 { Num_Lock }; + + // Fake keys for virtual<->real modifiers mapping + key { [ ISO_Level3_Shift ] }; + key { [ Mode_switch ] }; + modifier_map Mod5 { , }; + + key { [ NoSymbol, Alt_L ] }; + modifier_map Mod1 { , }; + + key { [ NoSymbol, Meta_L ] }; + modifier_map Mod1 { }; + + key { [ NoSymbol, Super_L ] }; + modifier_map Mod4 { }; + + key { [ NoSymbol, Hyper_L ] }; + modifier_map Mod4 { }; + // end modifier mappings + +}; diff --git a/xorg-server/xkeyboard-config/symbols/mao b/xorg-server/xkeyboard-config/symbols/mao index 30c039a0c..b62994b2c 100644 --- a/xorg-server/xkeyboard-config/symbols/mao +++ b/xorg-server/xkeyboard-config/symbols/mao @@ -1,23 +1,21 @@ -// $XKeyboardConfig$ - -partial default alphanumeric_keys -xkb_symbols "basic" { - - // Adds the macrons needed for the Maori language to - // a simple us keyboard layout. - - include "latin" - - name[Group1]="Maori"; - - key { [ a, A, amacron, Amacron ] }; - key { [ e, E, emacron, Emacron ] }; - key { [ i, I, imacron, Imacron ] }; - - key { [ o, O, omacron, Omacron ] }; - key { [ u, U, umacron, Umacron ] }; - - key { type[Group1]="TWO_LEVEL", - [ ISO_Level3_Shift, Multi_key ] }; - modifier_map Mod5 { }; -}; +partial default alphanumeric_keys +xkb_symbols "basic" { + + // Adds the macrons needed for the Maori language to + // a simple us keyboard layout. + + include "latin" + + name[Group1]="Maori"; + + key { [ a, A, amacron, Amacron ] }; + key { [ e, E, emacron, Emacron ] }; + key { [ i, I, imacron, Imacron ] }; + + key { [ o, O, omacron, Omacron ] }; + key { [ u, U, umacron, Umacron ] }; + + key { type[Group1]="TWO_LEVEL", + [ ISO_Level3_Shift, Multi_key ] }; + modifier_map Mod5 { }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/me b/xorg-server/xkeyboard-config/symbols/me index a4b407376..3f1733199 100644 --- a/xorg-server/xkeyboard-config/symbols/me +++ b/xorg-server/xkeyboard-config/symbols/me @@ -1,53 +1,52 @@ -// Montenegro keyboard mapping -// -// Initially, a copy of Serbian variants -// -// $XKeyboardConfig$ - -default partial alphanumeric_keys -xkb_symbols "basic" { - include "rs(latin)" - name[Group1]= "Montenegro"; -}; - - -partial alphanumeric_keys -xkb_symbols "cyrillic" { - include "rs(basic)" - name[Group1]= "Montenegro - Cyrillic"; -}; - - -partial alphanumeric_keys -xkb_symbols "cyrillicyz" { - include "rs(yz)" - name[Group1]= "Montenegro - Cyrillic, Z and ZHE swapped"; -}; - -partial alphanumeric_keys -xkb_symbols "latinunicode" { - include "rs(latinunicode)" - name[Group1]= "Montenegro - Latin unicode"; -}; - -partial alphanumeric_keys -xkb_symbols "latinyz" { - include "rs(latinyz)" - name[Group1]= "Montenegro - Latin qwerty"; -}; - -partial alphanumeric_keys -xkb_symbols "latinunicodeyz" { - include "rs(latinunicodeyz)" - name[Group1]= "Montenegro - Latin unicode qwerty"; -}; - -xkb_symbols "cyrillicalternatequotes" { - include "rs(alternatequotes)" - name[Group1]= "Montenegro - Cyrillic with guillemets"; -}; - -xkb_symbols "latinalternatequotes" { - include "rs(latinalternatequotes)" - name[Group1]= "Montenegro - Latin with guillemets"; -}; +// Montenegro keyboard mapping +// +// Initially, a copy of Serbian variants +// + +default partial alphanumeric_keys +xkb_symbols "basic" { + include "rs(latin)" + name[Group1]= "Montenegro"; +}; + + +partial alphanumeric_keys +xkb_symbols "cyrillic" { + include "rs(basic)" + name[Group1]= "Montenegro - Cyrillic"; +}; + + +partial alphanumeric_keys +xkb_symbols "cyrillicyz" { + include "rs(yz)" + name[Group1]= "Montenegro - Cyrillic, Z and ZHE swapped"; +}; + +partial alphanumeric_keys +xkb_symbols "latinunicode" { + include "rs(latinunicode)" + name[Group1]= "Montenegro - Latin unicode"; +}; + +partial alphanumeric_keys +xkb_symbols "latinyz" { + include "rs(latinyz)" + name[Group1]= "Montenegro - Latin qwerty"; +}; + +partial alphanumeric_keys +xkb_symbols "latinunicodeyz" { + include "rs(latinunicodeyz)" + name[Group1]= "Montenegro - Latin unicode qwerty"; +}; + +xkb_symbols "cyrillicalternatequotes" { + include "rs(alternatequotes)" + name[Group1]= "Montenegro - Cyrillic with guillemets"; +}; + +xkb_symbols "latinalternatequotes" { + include "rs(latinalternatequotes)" + name[Group1]= "Montenegro - Latin with guillemets"; +}; diff --git a/xorg-server/xkeyboard-config/symbols/mk b/xorg-server/xkeyboard-config/symbols/mk index c69439c5d..c8acb1e39 100644 --- a/xorg-server/xkeyboard-config/symbols/mk +++ b/xorg-server/xkeyboard-config/symbols/mk @@ -1,67 +1,65 @@ - -// based on keyboard map: -// Author: Damjan Georgievski -// Revision: 1.5 -// $XKeyboardConfig$ - -partial default alphanumeric_keys -xkb_symbols "basic" { - name[Group1]= "Macedonia"; - - key { [ Cyrillic_ze, Cyrillic_ZE ] }; - key { [ Cyrillic_es, Cyrillic_ES ] }; - key { [ Cyrillic_a, Cyrillic_A ] }; - key { [ Cyrillic_lje, Cyrillic_LJE ] }; - key { [ Cyrillic_nje, Cyrillic_NJE ] }; - key { [ Cyrillic_tse, Cyrillic_TSE ] }; - key { [ Cyrillic_dzhe, Cyrillic_DZHE ] }; - key { [ Cyrillic_de, Cyrillic_DE ] }; - key { [ Cyrillic_ie, Cyrillic_IE ] }; - key { [ Cyrillic_ve, Cyrillic_VE ] }; - key { [ Cyrillic_ef, Cyrillic_EF ] }; - key { [ Cyrillic_te, Cyrillic_TE ] }; - key { [ Cyrillic_er, Cyrillic_ER ] }; - key { [ Cyrillic_en, Cyrillic_EN ] }; - key { [ Cyrillic_be, Cyrillic_BE ] }; - key { [ Cyrillic_ha, Cyrillic_HA ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key { [ Macedonia_dse, Macedonia_DSE ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; - key { [ Cyrillic_je, Cyrillic_JE ] }; - key { [ Cyrillic_u, Cyrillic_U ] }; - key { [ Cyrillic_ka, Cyrillic_KA ] }; - key { [ Cyrillic_i, Cyrillic_I ] }; - key { [ Cyrillic_o, Cyrillic_O ] }; - key { [ Cyrillic_el, Cyrillic_EL ] }; - key { [ Cyrillic_che, Cyrillic_CHE ] }; - key { [ Cyrillic_pe, Cyrillic_PE ] }; - key { [ Macedonia_kje, Macedonia_KJE ] }; - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Macedonia_gje, Macedonia_GJE ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ equal, plus ] }; - key { [ minus, underscore ] }; - key { [ dead_grave, asciitilde ] }; - key { [ 1, exclam ] }; - key { [ 2, doublelowquotemark ] }; - key { [ 3, leftdoublequotemark ] }; - key { [ 4, dollar ] }; - key { [ 5, percent ] }; - key { [ 6, asciicircum ] }; - key { [ 7, ampersand ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ comma, semicolon ] }; - key { [ period, colon ] }; - key { [ slash, question ] }; - - include "kpdl(comma)" -}; - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - include "mk(basic)" - name[Group1]= "Macedonia - Eliminate dead keys"; - key { [ grave, asciitilde ] }; -}; +// based on keyboard map: +// Author: Damjan Georgievski +// Revision: 1.5 + +partial default alphanumeric_keys +xkb_symbols "basic" { + name[Group1]= "Macedonia"; + + key { [ Cyrillic_ze, Cyrillic_ZE ] }; + key { [ Cyrillic_es, Cyrillic_ES ] }; + key { [ Cyrillic_a, Cyrillic_A ] }; + key { [ Cyrillic_lje, Cyrillic_LJE ] }; + key { [ Cyrillic_nje, Cyrillic_NJE ] }; + key { [ Cyrillic_tse, Cyrillic_TSE ] }; + key { [ Cyrillic_dzhe, Cyrillic_DZHE ] }; + key { [ Cyrillic_de, Cyrillic_DE ] }; + key { [ Cyrillic_ie, Cyrillic_IE ] }; + key { [ Cyrillic_ve, Cyrillic_VE ] }; + key { [ Cyrillic_ef, Cyrillic_EF ] }; + key { [ Cyrillic_te, Cyrillic_TE ] }; + key { [ Cyrillic_er, Cyrillic_ER ] }; + key { [ Cyrillic_en, Cyrillic_EN ] }; + key { [ Cyrillic_be, Cyrillic_BE ] }; + key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; + key { [ Macedonia_dse, Macedonia_DSE ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; + key { [ Cyrillic_je, Cyrillic_JE ] }; + key { [ Cyrillic_u, Cyrillic_U ] }; + key { [ Cyrillic_ka, Cyrillic_KA ] }; + key { [ Cyrillic_i, Cyrillic_I ] }; + key { [ Cyrillic_o, Cyrillic_O ] }; + key { [ Cyrillic_el, Cyrillic_EL ] }; + key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_pe, Cyrillic_PE ] }; + key { [ Macedonia_kje, Macedonia_KJE ] }; + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Macedonia_gje, Macedonia_GJE ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ equal, plus ] }; + key { [ minus, underscore ] }; + key { [ dead_grave, asciitilde ] }; + key { [ 1, exclam ] }; + key { [ 2, doublelowquotemark ] }; + key { [ 3, leftdoublequotemark ] }; + key { [ 4, dollar ] }; + key { [ 5, percent ] }; + key { [ 6, asciicircum ] }; + key { [ 7, ampersand ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ comma, semicolon ] }; + key { [ period, colon ] }; + key { [ slash, question ] }; + + include "kpdl(comma)" +}; + +partial alphanumeric_keys +xkb_symbols "nodeadkeys" { + include "mk(basic)" + name[Group1]= "Macedonia - Eliminate dead keys"; + key { [ grave, asciitilde ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/ml b/xorg-server/xkeyboard-config/symbols/ml index 1cac28c41..741d6a206 100644 --- a/xorg-server/xkeyboard-config/symbols/ml +++ b/xorg-server/xkeyboard-config/symbols/ml @@ -1,5 +1,3 @@ -// $XKeyboardConfig$ - partial default alphanumeric_keys xkb_symbols "basic" { diff --git a/xorg-server/xkeyboard-config/symbols/mm b/xorg-server/xkeyboard-config/symbols/mm index 2f5319c42..43218ead5 100644 --- a/xorg-server/xkeyboard-config/symbols/mm +++ b/xorg-server/xkeyboard-config/symbols/mm @@ -1,65 +1,63 @@ -// $XKeyboardConfig$ - -// based on a keyboard map from an 'xkb/symbols/mm' file - -partial default alphanumeric_keys -xkb_symbols "basic" { - name[Group1]= "Myanmar"; - -// Mainly numbers. - key { [ 0x1001041, exclam ] }; - key { [ 0x1001042 ] }; - key { [ 0x1001043 ] }; - key { [ 0x1001044 ] }; - key { [ 0x1001045 ] }; - key { [ 0x1001046 ] }; - key { [ 0x1001047 ] }; - key { [ 0x1001048 ] }; - key { [ 0x1001049, parenleft ] }; - key { [ 0x1001040, parenright ] }; - key { [ minus, 0x1001038 ] }; - key { [ 0x1001052, 0x1001056 ] }; - -// Mainly long vowels - key { [ 0x100102A, 0x100102A ] }; - key { [ 0x1001032, 0x1001032 ] }; - key { [ 0x100102C, 0x1001021 ] }; - key { [ 0x100102E, 0x1001024 ] }; - key { [ 0x1001030, 0x1001026 ] }; - -// Mainly voiced consonants - key { [ 0x1001017, 0x1001018 ] }; - key { [ 0x100101F, 0x1001004 ] }; - key { [ 0x1001002, 0x1001003 ] }; - key { [ 0x1001012, 0x1001013 ] }; - key { [ 0x1001007, 0x1001008 ] }; - key { [ 0x100100d, 0x100100e ] }; - key { [ 0x100100a, 0x1001009 ] }; - -// Mainly short vowels - key { [ 0x1001029, 0x1001029 ] }; - key { [ 0x1001027, 0x1001027 ] }; - key { [ 0x1001039, 0x1001021 ] }; - key { [ 0x100102D, 0x1001023 ] }; - key { [ 0x100102F, 0x1001025 ] }; - -// Mainly unvoiced consonants - key { [ 0x1001015, 0x1001016 ] }; - key { [ 0x100101B, 0x100101B ] }; - key { [ 0x1001000, 0x1001001 ] }; - key { [ 0x1001010, 0x1001011 ] }; - key { [ 0x1001005, 0x1001006 ] }; - key { [ 0x100100b, 0x100100c ] }; - key { [ 0x100104E, 0x100104F ] }; - - key { [ 0x100104C, 0x100104D ] }; - key { [ 0x1001037, 0x1001036 ] }; - key { [ 0x1001019, 0x100100f ] }; - key { [ 0x1001014, 0x1001014 ] }; - key { [ 0x1001017, 0x1001017 ] }; - key { [ 0x100101C, 0x100101C ] }; - key { [ 0x100101E, 0x1001050 ] }; - key { [ comma, 0x1001051 ] }; - key { [ period, 0x100104A ] }; - key { [ slash, 0x100101A ] }; -}; +// based on a keyboard map from an 'xkb/symbols/mm' file + +partial default alphanumeric_keys +xkb_symbols "basic" { + name[Group1]= "Myanmar"; + +// Mainly numbers. + key { [ 0x1001041, exclam ] }; + key { [ 0x1001042 ] }; + key { [ 0x1001043 ] }; + key { [ 0x1001044 ] }; + key { [ 0x1001045 ] }; + key { [ 0x1001046 ] }; + key { [ 0x1001047 ] }; + key { [ 0x1001048 ] }; + key { [ 0x1001049, parenleft ] }; + key { [ 0x1001040, parenright ] }; + key { [ minus, 0x1001038 ] }; + key { [ 0x1001052, 0x1001056 ] }; + +// Mainly long vowels + key { [ 0x100102A, 0x100102A ] }; + key { [ 0x1001032, 0x1001032 ] }; + key { [ 0x100102C, 0x1001021 ] }; + key { [ 0x100102E, 0x1001024 ] }; + key { [ 0x1001030, 0x1001026 ] }; + +// Mainly voiced consonants + key { [ 0x1001017, 0x1001018 ] }; + key { [ 0x100101F, 0x1001004 ] }; + key { [ 0x1001002, 0x1001003 ] }; + key { [ 0x1001012, 0x1001013 ] }; + key { [ 0x1001007, 0x1001008 ] }; + key { [ 0x100100d, 0x100100e ] }; + key { [ 0x100100a, 0x1001009 ] }; + +// Mainly short vowels + key { [ 0x1001029, 0x1001029 ] }; + key { [ 0x1001027, 0x1001027 ] }; + key { [ 0x1001039, 0x1001021 ] }; + key { [ 0x100102D, 0x1001023 ] }; + key { [ 0x100102F, 0x1001025 ] }; + +// Mainly unvoiced consonants + key { [ 0x1001015, 0x1001016 ] }; + key { [ 0x100101B, 0x100101B ] }; + key { [ 0x1001000, 0x1001001 ] }; + key { [ 0x1001010, 0x1001011 ] }; + key { [ 0x1001005, 0x1001006 ] }; + key { [ 0x100100b, 0x100100c ] }; + key { [ 0x100104E, 0x100104F ] }; + + key { [ 0x100104C, 0x100104D ] }; + key { [ 0x1001037, 0x1001036 ] }; + key { [ 0x1001019, 0x100100f ] }; + key { [ 0x1001014, 0x1001014 ] }; + key { [ 0x1001017, 0x1001017 ] }; + key { [ 0x100101C, 0x100101C ] }; + key { [ 0x100101E, 0x1001050 ] }; + key { [ comma, 0x1001051 ] }; + key { [ period, 0x100104A ] }; + key { [ slash, 0x100101A ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/mn b/xorg-server/xkeyboard-config/symbols/mn index 08109b781..44e5e4e67 100644 --- a/xorg-server/xkeyboard-config/symbols/mn +++ b/xorg-server/xkeyboard-config/symbols/mn @@ -1,83 +1,80 @@ -// $XKeyboardConfig$ - -// based on: -// Mongolian standard keyboard -// Author Sanlig Badral -// 2002/12/7 Version 1.0 - -partial default alphanumeric_keys -xkb_symbols "basic" { - - name[Group1]= "Mongolia"; - - key { [ equal, plus, degree ] }; - key { [ 1, numerosign, multiply ] }; - key { [ 2, minus, division ] }; - key { [ 3, quotedbl, plusminus ] }; - key { [ 4, U20ae, notsign ] }; // Tugrik sign - key { [ 5, colon, NoSymbol ] }; - key { [ 6, period, notequal ] }; - key { [ 7, underscore, ampersand ] }; - key { [ 8, comma, asterisk ] }; - key { [ 9, percent, bracketleft ] }; - key { [ 0, question, bracketright ] }; - key { [ Cyrillic_ie, Cyrillic_IE, X ] }; - key { [ Cyrillic_shcha, Cyrillic_SHCHA, L ] }; - - key { [ Cyrillic_ef, Cyrillic_EF, apostrophe ] }; - key { [ Cyrillic_tse, Cyrillic_TSE, grave ] }; - key { [ Cyrillic_u, Cyrillic_U, EuroSign ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE, registered ] }; - key { [ Cyrillic_e, Cyrillic_E, trademark ] }; - key { [ Cyrillic_en, Cyrillic_EN, yen ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE, doublelowquotemark ] }; - key { [ Cyrillic_sha, Cyrillic_SHA, leftdoublequotemark ] }; - key { [ Cyrillic_u_straight,Cyrillic_U_straight,rightdoublequotemark] }; - key { [ Cyrillic_ze, Cyrillic_ZE, NoSymbol ] }; - key { [ Cyrillic_ka, Cyrillic_KA, braceleft ] }; - key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN, braceright ] }; - - key { [ Cyrillic_shorti, Cyrillic_SHORTI, mu ] }; - key { [ Cyrillic_yeru, Cyrillic_YERU, sterling ] }; - key { [ Cyrillic_be, Cyrillic_BE, dollar ] }; - key { [ Cyrillic_o_bar, Cyrillic_O_bar, rightdoublequotemark ] }; - key { [ Cyrillic_a, Cyrillic_A, Cyrillic_yeru ] }; - key { [ Cyrillic_ha, Cyrillic_HA, Cyrillic_YERU ] }; - key { [ Cyrillic_er, Cyrillic_ER, Cyrillic_e ] }; - key { [ Cyrillic_o, Cyrillic_O, Cyrillic_E ] }; - key { [ Cyrillic_el, Cyrillic_EL, numerosign ] }; - key { [ Cyrillic_de, Cyrillic_DE, section ] }; - key { [ Cyrillic_pe, Cyrillic_PE, ellipsis ] }; - key { [ exclam, bar, bar ] }; - - key { [ parenleft, parenright, NoSymbol ] }; - key { [ Cyrillic_ya, Cyrillic_YA, emdash ] }; - key { [ Cyrillic_che, Cyrillic_CHE, endash ] }; - key { [ Cyrillic_io, Cyrillic_IO, copyright ] }; - key { [ Cyrillic_es, Cyrillic_ES, NoSymbol ] }; - key { [ Cyrillic_em, Cyrillic_EM, NoSymbol ] }; - key { [ Cyrillic_i, Cyrillic_I, less ] }; - key { [ Cyrillic_te, Cyrillic_TE, greater ] }; - key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN, guillemotleft ] }; - key { [ Cyrillic_ve, Cyrillic_VE, guillemotright ] }; - key { [ Cyrillic_yu, Cyrillic_YU, backslash ] }; - - // End alphanumeric section - - key { [ space, space, nobreakspace ] }; - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "olpc" { - -// Contact: Walter Bender - - include "mn(basic)" - - key { [ backslash, bar, exclam ] }; - - include "group(olpc)" -}; - +// based on: +// Mongolian standard keyboard +// Author Sanlig Badral +// 2002/12/7 Version 1.0 + +partial default alphanumeric_keys +xkb_symbols "basic" { + + name[Group1]= "Mongolia"; + + key { [ equal, plus, degree ] }; + key { [ 1, numerosign, multiply ] }; + key { [ 2, minus, division ] }; + key { [ 3, quotedbl, plusminus ] }; + key { [ 4, U20ae, notsign ] }; // Tugrik sign + key { [ 5, colon, NoSymbol ] }; + key { [ 6, period, notequal ] }; + key { [ 7, underscore, ampersand ] }; + key { [ 8, comma, asterisk ] }; + key { [ 9, percent, bracketleft ] }; + key { [ 0, question, bracketright ] }; + key { [ Cyrillic_ie, Cyrillic_IE, X ] }; + key { [ Cyrillic_shcha, Cyrillic_SHCHA, L ] }; + + key { [ Cyrillic_ef, Cyrillic_EF, apostrophe ] }; + key { [ Cyrillic_tse, Cyrillic_TSE, grave ] }; + key { [ Cyrillic_u, Cyrillic_U, EuroSign ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE, registered ] }; + key { [ Cyrillic_e, Cyrillic_E, trademark ] }; + key { [ Cyrillic_en, Cyrillic_EN, yen ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE, doublelowquotemark ] }; + key { [ Cyrillic_sha, Cyrillic_SHA, leftdoublequotemark ] }; + key { [ Cyrillic_u_straight,Cyrillic_U_straight,rightdoublequotemark] }; + key { [ Cyrillic_ze, Cyrillic_ZE, NoSymbol ] }; + key { [ Cyrillic_ka, Cyrillic_KA, braceleft ] }; + key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN, braceright ] }; + + key { [ Cyrillic_shorti, Cyrillic_SHORTI, mu ] }; + key { [ Cyrillic_yeru, Cyrillic_YERU, sterling ] }; + key { [ Cyrillic_be, Cyrillic_BE, dollar ] }; + key { [ Cyrillic_o_bar, Cyrillic_O_bar, rightdoublequotemark ] }; + key { [ Cyrillic_a, Cyrillic_A, Cyrillic_yeru ] }; + key { [ Cyrillic_ha, Cyrillic_HA, Cyrillic_YERU ] }; + key { [ Cyrillic_er, Cyrillic_ER, Cyrillic_e ] }; + key { [ Cyrillic_o, Cyrillic_O, Cyrillic_E ] }; + key { [ Cyrillic_el, Cyrillic_EL, numerosign ] }; + key { [ Cyrillic_de, Cyrillic_DE, section ] }; + key { [ Cyrillic_pe, Cyrillic_PE, ellipsis ] }; + key { [ exclam, bar, bar ] }; + + key { [ parenleft, parenright, NoSymbol ] }; + key { [ Cyrillic_ya, Cyrillic_YA, emdash ] }; + key { [ Cyrillic_che, Cyrillic_CHE, endash ] }; + key { [ Cyrillic_io, Cyrillic_IO, copyright ] }; + key { [ Cyrillic_es, Cyrillic_ES, NoSymbol ] }; + key { [ Cyrillic_em, Cyrillic_EM, NoSymbol ] }; + key { [ Cyrillic_i, Cyrillic_I, less ] }; + key { [ Cyrillic_te, Cyrillic_TE, greater ] }; + key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN, guillemotleft ] }; + key { [ Cyrillic_ve, Cyrillic_VE, guillemotright ] }; + key { [ Cyrillic_yu, Cyrillic_YU, backslash ] }; + + // End alphanumeric section + + key { [ space, space, nobreakspace ] }; + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "olpc" { + +// Contact: Walter Bender + + include "mn(basic)" + + key { [ backslash, bar, exclam ] }; + + include "group(olpc)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/mt b/xorg-server/xkeyboard-config/symbols/mt index 5069aa4ed..87307cadb 100644 --- a/xorg-server/xkeyboard-config/symbols/mt +++ b/xorg-server/xkeyboard-config/symbols/mt @@ -1,80 +1,76 @@ -// $XKeyboardConfig$ - -// Maltese keyboard map (based on MSA Standard DMS100) -// by Ramon Casha (ramon.casha@linux.org.mt) -// -// $XFree86: xc/programs/xkbcomp/symbols/mt,v 1.3 2002/12/13 04:18:04 dawes Exp $ - -partial default alphanumeric_keys -xkb_symbols "basic" { - - include "latin" - - name[Group1]="Malta"; - - // Copied from GB layout - key { [ 2, quotedbl, twosuperior, oneeighth ] }; - key { [ 4, dollar, EuroSign, onequarter ] }; - key { [apostrophe, at, dead_circumflex, dead_caron] }; - key { [numbersign, asciitilde, dead_grave, dead_breve ] }; - - // The following four sets are the four additional letters, with the UK - // equivalents - key { [ cabovedot, Cabovedot, grave, notsign ] }; - key { [ gabovedot, Gabovedot, bracketleft, braceleft ] }; - key { [ hstroke, Hstroke, bracketright, braceright ] }; - key { [ zabovedot, Zabovedot, backslash, bar ] }; - - // Euro symbol - key { [ 3, EuroSign, sterling ] }; - - // Long accent - key { [ 6, asciicircum, dead_circumflex, dead_circumflex ] }; - - // Normal accented vowels - key { [ e, E, egrave, Egrave ] }; - key { [ u, U, ugrave, Ugrave ] }; - key { [ i, I, igrave, Igrave ] }; - key { [ o, O, ograve, Ograve ] }; - key { [ a, A, agrave, Agrave ] }; - - include "level3(ralt_switch)" -}; - -// Maltese keyboard map (based on MSA Standard DMS100, annex A) -// by Ramon Casha (ramon.casha@linux.org.mt) - -partial alphanumeric_keys -xkb_symbols "us" { - - include "latin" - - // Describes the differences between the mt - // keyboard and a US-based physical keyboard - - name[Group1]="Malta - Maltese keyboard with US layout"; - - // The following four sets are the four additional letters, with the US - // equivalents - key { [ cabovedot, Cabovedot, grave, asciitilde ] }; - key { [ gabovedot, Gabovedot, bracketleft, braceleft ] }; - key { [ hstroke, Hstroke, bracketright, braceright ] }; - key { [ zabovedot, Zabovedot, backslash, bar ] }; - key { [ zabovedot, Zabovedot, backslash, bar ] }; - - // Euro symbol - key { [ 3, EuroSign, numbersign ] }; - - // Long accent - key { [ 6, asciicircum, dead_circumflex, dead_circumflex ] }; - - // Normal accented vowels - key { [ e, E, egrave, Egrave ] }; - key { [ u, U, ugrave, Ugrave ] }; - key { [ i, I, igrave, Igrave ] }; - key { [ o, O, ograve, Ograve ] }; - key { [ a, A, agrave, Agrave ] }; - - include "level3(ralt_switch)" - -}; +// Maltese keyboard map (based on MSA Standard DMS100) +// by Ramon Casha (ramon.casha@linux.org.mt) + +partial default alphanumeric_keys +xkb_symbols "basic" { + + include "latin" + + name[Group1]="Malta"; + + // Copied from GB layout + key { [ 2, quotedbl, twosuperior, oneeighth ] }; + key { [ 4, dollar, EuroSign, onequarter ] }; + key { [apostrophe, at, dead_circumflex, dead_caron] }; + key { [numbersign, asciitilde, dead_grave, dead_breve ] }; + + // The following four sets are the four additional letters, with the UK + // equivalents + key { [ cabovedot, Cabovedot, grave, notsign ] }; + key { [ gabovedot, Gabovedot, bracketleft, braceleft ] }; + key { [ hstroke, Hstroke, bracketright, braceright ] }; + key { [ zabovedot, Zabovedot, backslash, bar ] }; + + // Euro symbol + key { [ 3, EuroSign, sterling ] }; + + // Long accent + key { [ 6, asciicircum, dead_circumflex, dead_circumflex ] }; + + // Normal accented vowels + key { [ e, E, egrave, Egrave ] }; + key { [ u, U, ugrave, Ugrave ] }; + key { [ i, I, igrave, Igrave ] }; + key { [ o, O, ograve, Ograve ] }; + key { [ a, A, agrave, Agrave ] }; + + include "level3(ralt_switch)" +}; + +// Maltese keyboard map (based on MSA Standard DMS100, annex A) +// by Ramon Casha (ramon.casha@linux.org.mt) + +partial alphanumeric_keys +xkb_symbols "us" { + + include "latin" + + // Describes the differences between the mt + // keyboard and a US-based physical keyboard + + name[Group1]="Malta - Maltese keyboard with US layout"; + + // The following four sets are the four additional letters, with the US + // equivalents + key { [ cabovedot, Cabovedot, grave, asciitilde ] }; + key { [ gabovedot, Gabovedot, bracketleft, braceleft ] }; + key { [ hstroke, Hstroke, bracketright, braceright ] }; + key { [ zabovedot, Zabovedot, backslash, bar ] }; + key { [ zabovedot, Zabovedot, backslash, bar ] }; + + // Euro symbol + key { [ 3, EuroSign, numbersign ] }; + + // Long accent + key { [ 6, asciicircum, dead_circumflex, dead_circumflex ] }; + + // Normal accented vowels + key { [ e, E, egrave, Egrave ] }; + key { [ u, U, ugrave, Ugrave ] }; + key { [ i, I, igrave, Igrave ] }; + key { [ o, O, ograve, Ograve ] }; + key { [ a, A, agrave, Agrave ] }; + + include "level3(ralt_switch)" + +}; diff --git a/xorg-server/xkeyboard-config/symbols/mv b/xorg-server/xkeyboard-config/symbols/mv index 22aa33986..1cbea3586 100644 --- a/xorg-server/xkeyboard-config/symbols/mv +++ b/xorg-server/xkeyboard-config/symbols/mv @@ -1,82 +1,81 @@ -// $XKeyboardConfig$ -// -// NOTES: -// -//Keymap for thaana/divehi script (divehi language) - -partial default alphanumeric_keys -xkb_symbols "basic" { - - name[Group1]="Maldives"; - -// The key should have the same values as US_en keyboard - - key { [ quoteleft, asciitilde ] }; - key { [ 1, exclam ] }; - key { [ 2, at ] }; - key { [ 3, numbersign ] }; - key { [ 4, dollar ] }; - key { [ 5, percent ] }; - key { [ 6, asciicircum ] }; - key { [ 7, ampersand ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ minus, underscore ] }; - key { [ equal, plus ] }; - - key { [ 0x10007B0, 0x10007A4 ] }; - key { [ 0x1000787, 0x10007A2 ] }; - key { [ 0x10007AC, 0x10007AD ] }; - key { [ 0x1000783, 0x100079C ] }; - key { [ 0x100078C, 0x1000793 ] }; - key { [ 0x1000794, 0x10007A0 ] }; - key { [ 0x10007AA, 0x10007AB ] }; - key { [ 0x10007A8, 0x10007A9 ] }; - key { [ 0x10007AE, 0x10007AF ] }; - key { [ 0x1000795, division ] }; -// The following brackets are as they appear on the US_en keyboard. -//Please verify whether the names used are correct. I referred to keysymdef.h - key { [ bracketleft, braceleft ] }; - key { [ bracketright, braceright ] }; - - - key { [ 0x10007A6, 0x10007A7 ] }; - key { [ 0x1000790, 0x1000781 ] }; - key { [ 0x100078B, 0x1000791 ] }; - key { [ 0x100078A, 0x100fdf2 ] }; - key { [ 0x100078E, 0x10007A3 ] }; - key { [ 0x1000780, 0x1000799 ] }; - key { [ 0x1000796, 0x100079B ] }; - key { [ 0x1000786, 0x100079A ] }; - key { [ 0x100078D, 0x1000785 ] }; - key { [ semicolon, colon ] }; -//I used singleloquotemark- if this is the wrong name, please replace with the name for the -//standard US_en keyboard format- its the same in the Thaana phonetic keyboard - key { [ quoteright, quotedbl ] }; - key { [ backslash, bar ] }; - - key { [ bar, brokenbar ] }; - key { [ 0x1000792, 0x10007A1 ] }; -//multiply sign is the same as the algebraic symbol which looks like an italicized x. I am presuming its the same thing here. If not, please substitute an 'x' instead - key { [ multiply, 0x1000798 ] }; - key { [ 0x1000797, 0x100079D ] }; - key { [ 0x1000788, 0x10007A5 ] }; - key { [ 0x1000784, 0x100079E ] }; - key { [ 0x1000782, 0x100078F ] }; - key { [ 0x1000789, 0x100079F ] }; - key { [ Arabic_comma, less ] }; - key { [ period, greater ] }; - key { [ slash, Arabic_question_mark ] }; - - // End alphanumeric section - - // Begin modifier mappings - - modifier_map Shift { Shift_L }; - modifier_map Lock { Caps_Lock, ISO_Lock }; - modifier_map Control{ Control_L }; - modifier_map Mod3 { Mode_switch }; -}; - -// Any additional keys (if need be added) should appear and function exactly as it does on the US_en keyboard. +// +// NOTES: +// +//Keymap for thaana/divehi script (divehi language) + +partial default alphanumeric_keys +xkb_symbols "basic" { + + name[Group1]="Maldives"; + +// The key should have the same values as US_en keyboard + + key { [ quoteleft, asciitilde ] }; + key { [ 1, exclam ] }; + key { [ 2, at ] }; + key { [ 3, numbersign ] }; + key { [ 4, dollar ] }; + key { [ 5, percent ] }; + key { [ 6, asciicircum ] }; + key { [ 7, ampersand ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ minus, underscore ] }; + key { [ equal, plus ] }; + + key { [ 0x10007B0, 0x10007A4 ] }; + key { [ 0x1000787, 0x10007A2 ] }; + key { [ 0x10007AC, 0x10007AD ] }; + key { [ 0x1000783, 0x100079C ] }; + key { [ 0x100078C, 0x1000793 ] }; + key { [ 0x1000794, 0x10007A0 ] }; + key { [ 0x10007AA, 0x10007AB ] }; + key { [ 0x10007A8, 0x10007A9 ] }; + key { [ 0x10007AE, 0x10007AF ] }; + key { [ 0x1000795, division ] }; +// The following brackets are as they appear on the US_en keyboard. +//Please verify whether the names used are correct. I referred to keysymdef.h + key { [ bracketleft, braceleft ] }; + key { [ bracketright, braceright ] }; + + + key { [ 0x10007A6, 0x10007A7 ] }; + key { [ 0x1000790, 0x1000781 ] }; + key { [ 0x100078B, 0x1000791 ] }; + key { [ 0x100078A, 0x100fdf2 ] }; + key { [ 0x100078E, 0x10007A3 ] }; + key { [ 0x1000780, 0x1000799 ] }; + key { [ 0x1000796, 0x100079B ] }; + key { [ 0x1000786, 0x100079A ] }; + key { [ 0x100078D, 0x1000785 ] }; + key { [ semicolon, colon ] }; +//I used singleloquotemark- if this is the wrong name, please replace with the name for the +//standard US_en keyboard format- its the same in the Thaana phonetic keyboard + key { [ quoteright, quotedbl ] }; + key { [ backslash, bar ] }; + + key { [ bar, brokenbar ] }; + key { [ 0x1000792, 0x10007A1 ] }; +//multiply sign is the same as the algebraic symbol which looks like an italicized x. I am presuming its the same thing here. If not, please substitute an 'x' instead + key { [ multiply, 0x1000798 ] }; + key { [ 0x1000797, 0x100079D ] }; + key { [ 0x1000788, 0x10007A5 ] }; + key { [ 0x1000784, 0x100079E ] }; + key { [ 0x1000782, 0x100078F ] }; + key { [ 0x1000789, 0x100079F ] }; + key { [ Arabic_comma, less ] }; + key { [ period, greater ] }; + key { [ slash, Arabic_question_mark ] }; + + // End alphanumeric section + + // Begin modifier mappings + + modifier_map Shift { Shift_L }; + modifier_map Lock { Caps_Lock, ISO_Lock }; + modifier_map Control{ Control_L }; + modifier_map Mod3 { Mode_switch }; +}; + +// Any additional keys (if need be added) should appear and function exactly as it does on the US_en keyboard. diff --git a/xorg-server/xkeyboard-config/symbols/nbsp b/xorg-server/xkeyboard-config/symbols/nbsp index 8ba5afe23..220dae460 100644 --- a/xorg-server/xkeyboard-config/symbols/nbsp +++ b/xorg-server/xkeyboard-config/symbols/nbsp @@ -1,5 +1,3 @@ -// $XKeyboardConfig$ - // Let Space key provide No-Break Space (NBSP), Narrow No-Break Space (NNBSP), // Zero-Width Non-Joiner (ZWNJ), and Zero-Width Joiner (ZWJ) for the desired // levels. @@ -194,4 +192,3 @@ xkb_symbols "zwnj3zwj4" { symbols[Group1]= [ space, space, 0x100200c, 0x100200d ] }; }; - diff --git a/xorg-server/xkeyboard-config/symbols/nec_vndr/jp b/xorg-server/xkeyboard-config/symbols/nec_vndr/jp index 0439677e4..10477a43c 100644 --- a/xorg-server/xkeyboard-config/symbols/nec_vndr/jp +++ b/xorg-server/xkeyboard-config/symbols/nec_vndr/jp @@ -1,167 +1,163 @@ -// $Xorg: jp,v 1.4 2001/02/09 02:05:53 xorgcvs Exp $ -// -//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. -// -// $XFree86: xc/programs/xkbcomp/symbols/nec/jp,v 3.9 2001/01/17 23:46:03 dawes Exp $ -// -// symbols for a NEC PC98 keyboard -default xkb_symbols "pc98" { - - key { [ Escape ] }; - - // Alphanumeric section - key { [ 1, exclam ], [ kana_NU ] }; - key { [ 2, quotedbl ], [ kana_FU ] }; - key { [ 3, numbersign ], [ kana_A, kana_a ] }; - key { [ 4, dollar ], [ kana_U, kana_u ] }; - key { [ 5, percent ], [ kana_E, kana_e ] }; - key { [ 6, ampersand ], [ kana_O, kana_o ] }; - key { [ 7, apostrophe ], [ kana_YA, kana_ya ] }; - key { [ 8, parenleft ], [ kana_YU, kana_yu ] }; - key { [ 9, parenright ], [ kana_YO, kana_yo ] }; - key { [ 0 ], [ kana_WA, kana_WO ] }; - key { [ minus, equal ], [ kana_HO ] }; - key { [ asciicircum, quoteleft ], [ kana_HE ] }; - key { [ backslash, bar ], [ prolongedsound ] }; - key { [ BackSpace ] }; - - key { [ Tab, ISO_Left_Tab ] }; - key { [ q, Q ], [ kana_TA ] }; - key { [ w, W ], [ kana_TE ] }; - key { [ e, E ], [ kana_I, kana_i ] }; - key { [ r, R ], [ kana_SU ] }; - key { [ t, T ], [ kana_KA ] }; - key { [ y, Y ], [ kana_N ] }; - key { [ u, U ], [ kana_NA ] }; - key { [ i, I ], [ kana_NI ] }; - key { [ o, O ], [ kana_RA ] }; - key { [ p, P ], [ kana_SE ] }; - key { [ at, asciitilde ], [ voicedsound ] }; - key { [ bracketleft, braceleft ], [ semivoicedsound, kana_openingbracket ] }; - key { [ Return ] }; - - key { [ Control_L ] }; - key { [ Caps_Lock ] }; - key { [ a, A ], [ kana_CHI ] }; - key { [ s, S ], [ kana_TO ] }; - key { [ d, D ], [ kana_SHI ] }; - key { [ f, F ], [ kana_HA ] }; - key { [ g, G ], [ kana_KI ] }; - key { [ h, H ], [ kana_KU ] }; - key { [ j, J ], [ kana_MA ] }; - key { [ k, K ], [ kana_NO ] }; - key { [ l, L ], [ kana_RI ] }; - key { [ semicolon, plus ], [ kana_RE ] }; - key { [ colon, asterisk ], [ kana_KE ] }; - key { [ bracketright, braceright ], [ kana_MU, kana_closingbracket ] }; - - key { [ Shift_L ] }; - key { [ z, Z ], [ kana_TSU, kana_tsu ] }; - key { [ x, X ], [ kana_SA ] }; - key { [ c, C ], [ kana_SO ] }; - key { [ v, V ], [ kana_HI ] }; - key { [ b, B ], [ kana_KO ] }; - key { [ n, N ], [ kana_MI ] }; - key { [ m, M ], [ kana_MO ] }; - key { [ comma, less ], [ kana_NE, kana_comma ] }; - key { [ period, greater ], [ kana_RU, kana_fullstop ] }; - key { [ slash, question ], [ kana_ME, kana_middledot ] }; - key { [ NoSymbol, underscore ], [ kana_RO ] }; -// key { [ Shift_R ] }; - - key { [ Mode_switch ] }; - key { [ Alt_L ] }; - key { [ Muhenkan ] }; - key { [ space ] }; - key { [ Henkan, Kanji ] }; - - // End alphanumeric section - - // Begin "Function" section - key { [ Break ] }; - key { [ Print ] }; - key { [ F1 ] }; - key { [ F2 ] }; - key { [ F3 ] }; - key { [ F4 ] }; - key { [ F5 ] }; - key { [ F6 ] }; - key { [ F7 ] }; - key { [ F8 ] }; - key { [ F9 ] }; - key { [ F10 ] }; - key { [ F11 ] }; - key { [ F12 ] }; - key { [ F13 ] }; - key { [ F14 ] }; - key { [ F15 ] }; - // End "Function" section - - // Begin "Editing" section - key { [ Insert ] }; - key { [ Delete ] }; - key { [ Prior ] }; - key { [ Next ] }; - key { [ Up ] }; - key { [ Left ] }; - key { [ Right ] }; - key { [ Down ] }; - // End "Editing" section - - // Begin "Keypad" section - key { [ Clear, Home ] }; - key { [ Help ] }; - key { [ KP_Subtract ] }; - key { [ KP_Divide ] }; - - key { [ KP_7 ] }; - key { [ KP_8 ] }; - key { [ KP_9 ] }; - key { [ KP_Multiply ] }; - - key { [ KP_4 ] }; - key { [ KP_5 ] }; - key { [ KP_6 ] }; - key { [ KP_Add ] }; - - key { [ KP_1 ] }; - key { [ KP_2 ] }; - key { [ KP_3 ] }; - key { [ KP_Equal ] }; - - key { [ KP_0 ] }; - key { [ KP_Separator ] }; - key { [ KP_Decimal ] }; -// key { [ KP_Enter ] }; - // End "Keypad" section - - // begin modifier mappings - modifier_map Shift { Shift_L }; - modifier_map Lock { Caps_Lock }; - modifier_map Control{ Control_L }; - modifier_map Mod1 { Alt_L }; - modifier_map Mod2 { Mode_switch }; -}; - +// +//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. +// +// symbols for a NEC PC98 keyboard +default xkb_symbols "pc98" { + + key { [ Escape ] }; + + // Alphanumeric section + key { [ 1, exclam ], [ kana_NU ] }; + key { [ 2, quotedbl ], [ kana_FU ] }; + key { [ 3, numbersign ], [ kana_A, kana_a ] }; + key { [ 4, dollar ], [ kana_U, kana_u ] }; + key { [ 5, percent ], [ kana_E, kana_e ] }; + key { [ 6, ampersand ], [ kana_O, kana_o ] }; + key { [ 7, apostrophe ], [ kana_YA, kana_ya ] }; + key { [ 8, parenleft ], [ kana_YU, kana_yu ] }; + key { [ 9, parenright ], [ kana_YO, kana_yo ] }; + key { [ 0 ], [ kana_WA, kana_WO ] }; + key { [ minus, equal ], [ kana_HO ] }; + key { [ asciicircum, quoteleft ], [ kana_HE ] }; + key { [ backslash, bar ], [ prolongedsound ] }; + key { [ BackSpace ] }; + + key { [ Tab, ISO_Left_Tab ] }; + key { [ q, Q ], [ kana_TA ] }; + key { [ w, W ], [ kana_TE ] }; + key { [ e, E ], [ kana_I, kana_i ] }; + key { [ r, R ], [ kana_SU ] }; + key { [ t, T ], [ kana_KA ] }; + key { [ y, Y ], [ kana_N ] }; + key { [ u, U ], [ kana_NA ] }; + key { [ i, I ], [ kana_NI ] }; + key { [ o, O ], [ kana_RA ] }; + key { [ p, P ], [ kana_SE ] }; + key { [ at, asciitilde ], [ voicedsound ] }; + key { [ bracketleft, braceleft ], [ semivoicedsound, kana_openingbracket ] }; + key { [ Return ] }; + + key { [ Control_L ] }; + key { [ Caps_Lock ] }; + key { [ a, A ], [ kana_CHI ] }; + key { [ s, S ], [ kana_TO ] }; + key { [ d, D ], [ kana_SHI ] }; + key { [ f, F ], [ kana_HA ] }; + key { [ g, G ], [ kana_KI ] }; + key { [ h, H ], [ kana_KU ] }; + key { [ j, J ], [ kana_MA ] }; + key { [ k, K ], [ kana_NO ] }; + key { [ l, L ], [ kana_RI ] }; + key { [ semicolon, plus ], [ kana_RE ] }; + key { [ colon, asterisk ], [ kana_KE ] }; + key { [ bracketright, braceright ], [ kana_MU, kana_closingbracket ] }; + + key { [ Shift_L ] }; + key { [ z, Z ], [ kana_TSU, kana_tsu ] }; + key { [ x, X ], [ kana_SA ] }; + key { [ c, C ], [ kana_SO ] }; + key { [ v, V ], [ kana_HI ] }; + key { [ b, B ], [ kana_KO ] }; + key { [ n, N ], [ kana_MI ] }; + key { [ m, M ], [ kana_MO ] }; + key { [ comma, less ], [ kana_NE, kana_comma ] }; + key { [ period, greater ], [ kana_RU, kana_fullstop ] }; + key { [ slash, question ], [ kana_ME, kana_middledot ] }; + key { [ NoSymbol, underscore ], [ kana_RO ] }; +// key { [ Shift_R ] }; + + key { [ Mode_switch ] }; + key { [ Alt_L ] }; + key { [ Muhenkan ] }; + key { [ space ] }; + key { [ Henkan, Kanji ] }; + + // End alphanumeric section + + // Begin "Function" section + key { [ Break ] }; + key { [ Print ] }; + key { [ F1 ] }; + key { [ F2 ] }; + key { [ F3 ] }; + key { [ F4 ] }; + key { [ F5 ] }; + key { [ F6 ] }; + key { [ F7 ] }; + key { [ F8 ] }; + key { [ F9 ] }; + key { [ F10 ] }; + key { [ F11 ] }; + key { [ F12 ] }; + key { [ F13 ] }; + key { [ F14 ] }; + key { [ F15 ] }; + // End "Function" section + + // Begin "Editing" section + key { [ Insert ] }; + key { [ Delete ] }; + key { [ Prior ] }; + key { [ Next ] }; + key { [ Up ] }; + key { [ Left ] }; + key { [ Right ] }; + key { [ Down ] }; + // End "Editing" section + + // Begin "Keypad" section + key { [ Clear, Home ] }; + key { [ Help ] }; + key { [ KP_Subtract ] }; + key { [ KP_Divide ] }; + + key { [ KP_7 ] }; + key { [ KP_8 ] }; + key { [ KP_9 ] }; + key { [ KP_Multiply ] }; + + key { [ KP_4 ] }; + key { [ KP_5 ] }; + key { [ KP_6 ] }; + key { [ KP_Add ] }; + + key { [ KP_1 ] }; + key { [ KP_2 ] }; + key { [ KP_3 ] }; + key { [ KP_Equal ] }; + + key { [ KP_0 ] }; + key { [ KP_Separator ] }; + key { [ KP_Decimal ] }; +// key { [ KP_Enter ] }; + // End "Keypad" section + + // begin modifier mappings + modifier_map Shift { Shift_L }; + modifier_map Lock { Caps_Lock }; + modifier_map Control{ Control_L }; + modifier_map Mod1 { Alt_L }; + modifier_map Mod2 { Mode_switch }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/ng b/xorg-server/xkeyboard-config/symbols/ng index 5b3a19e27..96a569d3a 100644 --- a/xorg-server/xkeyboard-config/symbols/ng +++ b/xorg-server/xkeyboard-config/symbols/ng @@ -1,117 +1,114 @@ -// $XKeyboardConfig$ -// - -partial default alphanumeric_keys -xkb_symbols "basic" { - - include "us" - - name[Group1]= "Nigeria"; - key { [ 4, 0x010020A6, dollar, cent ] }; - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "yoruba" { - include "ng(basic)" - - name[Group1]= "Nigeria - Yoruba"; - - key { [ 0x01001EB9, 0x01001EB8, q, Q ] }; - key { [ 0x01001ECD, 0x01001ECC, x, X ] }; - key { [ 0x01001E63, 0x01001E62, v, V ] }; -}; - -partial alphanumeric_keys -xkb_symbols "igbo" { - include "ng(basic)" - - name[Group1]= "Nigeria - Igbo"; - - key { [ 0x01001ECB, 0x01001ECA, q, Q ] }; - key { [ 0x01001E45, 0x01001E44, x, X ] }; - key { [ 0x01001EE5, 0x01001EE4, semicolon, colon ] }; - key { [ 0x01001ECD, 0x01001ECC, bracketleft, braceleft ] }; -}; - -partial alphanumeric_keys -xkb_symbols "hausa" { - include "ng(basic)" - - name[Group1]= "Nigeria - Hausa"; - - key { [ 0x01000071, 0x01000051, q, Q ] }; - key { [ udiaeresis, Udiaeresis, w, W ] }; - key { [ e, E, EuroSign, cent ] }; - key { [ 0x010001B4, 0x010001B3,bracketleft, braceleft ] }; - key { [ gcaron, Gcaron,bracketright, braceright] }; - key { [ 0x01000257, 0x0100018A, d, D ] }; - key { [ 0x01000131, 0x01000130, semicolon, colon ] }; - key { [ 0x010001DD, 0x0100018E,apostrophe, quotedbl ] }; - key { [ 0x01000272, 0x0100019D, z, Z ] }; - key { [ ntilde, Ntilde, m, M ] }; - key { [ ccedilla, Ccedilla, period, greater ] }; - key { [ scedilla, Scedilla, slash, question ] }; - -}; - -partial alphanumeric_keys -xkb_symbols "olpc" { - - include "ng(basic)" - - // OLPC West Africa keyboard layout - // See: http://wiki.laptop.org/go/Image:Nigeria-B3.png - - key { [ grave, asciitilde, exclamdown, exclamdown ] }; - key { [ 1, exclam, sterling, sterling ] }; - key { [ 2, at, EuroSign, EuroSign ] }; - key { [ 3, numbersign, dollar, dollar ] }; - key { [ 4, 0x10020A6, 0x1000301, 0x1000301 ] }; // Naira, combining acute - key { [ 5, percent, 0x1000300, 0x1000300 ] }; // combining grave - key { [ 6,asciicircum, 0x100030A, 0x100030A ] }; // combining ring above - key { [ 7, ampersand, 0x1000302, 0x1000302 ] }; // combining circumflex above - key { [ 8, asterisk, 0x1000324, 0x1000324 ] }; // combining caron above - key { [ 9, parenleft, 0x1000307, 0x1000307 ] }; // combining dot above - key { [ 0, parenright, 0x1000308, 0x1000308 ] }; // combining diaeresis above - key { [ minus, underscore, 0x1000304, 0x1000304 ] }; // combining macron above - key { [ equal, plus, 0x1000303, 0x1000303 ] }; // combining tilde above - - key { [ w, W, 0x1001EB9, 0x1001EB8 ] }; // E with dot below - key { [ e, E, 0x10001DD, 0x100018E ] }; // reversed E - key { [ r, R, 0x10001B4, 0x10001B3 ] }; // Y with hook - key { [ t, T, 0x1000327, 0x1000327 ] }; // combining cedilla - key { [ y, Y, 0x1000325, 0x1000325 ] }; // combining ring below - key { [ u, U, 0x100032D, 0x100032D ] }; // combining circumflex below - key { [ i, I, 0x100032C, 0x100032C ] }; // combining caron below - key { [ o, O, 0x1000323, 0x1000323 ] }; // combining dot below - key { [ p, P, 0x1000304, 0x1000304 ] }; // combining diaeresis below - key { [ bracketleft, braceleft, 0x1000331, 0x1000331 ] }; // combining macron below - key { [bracketright, braceright, 0x1000330, 0x1000330 ] }; // combining tilde below - - key { [ a, A, Greek_iota, Greek_IOTA ] }; - key { [ s, S, 0x1001E63, 0x1001E62 ] }; // S with dot below - key { [ d, D, 0x1000257, 0x100018A ] }; // D with hook - key { [ f, F, 0x1001E0D, 0x1001E0C ] }; // D with dot below - key { [ g, G, 0x1000272, 0x100019D ] }; // N with left hook - key { [ h, H, 0x1001EE5, 0x1001EE4 ] }; // U with dot below - key { [ j, J, 0x1001ECB, 0x1001ECA ] }; // I with dot below - key { [ k, K, 0x1000199, 0x1000198 ] }; // K with hook - key { [ l, L, 0x1001E37, 0x1001E36 ] }; // L with dot below - key { [ semicolon, colon, masculine, ordfeminine ] }; - key { [ apostrophe, quotedbl, currency, currency ] }; - key { [ backslash, bar, section, section ] }; - - key { [ c, C, 0x1000254, 0x1000186 ] }; // open O - key { [ v, V, 0x100028B, 0x10001B2 ] }; // V with hook - key { [ b, B, 0x1000253, 0x1000181 ] }; // B with hook - key { [ n, N, eng, ENG ] }; - key { [ m, M, 0x1001E45, 0x1001E44 ] }; // N with dot above - key { [ comma, less, guillemotleft, guillemotleft ] }; - key { [ period, greater, guillemotright, guillemotright ] }; - key { [ slash, question, questiondown, questiondown ] }; - - key { [ multiply, division, ISO_Next_Group, ISO_Prev_Group ] }; - - include "level3(ralt_switch)" -}; +partial default alphanumeric_keys +xkb_symbols "basic" { + + include "us" + + name[Group1]= "Nigeria"; + key { [ 4, 0x010020A6, dollar, cent ] }; + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "yoruba" { + include "ng(basic)" + + name[Group1]= "Nigeria - Yoruba"; + + key { [ 0x01001EB9, 0x01001EB8, q, Q ] }; + key { [ 0x01001ECD, 0x01001ECC, x, X ] }; + key { [ 0x01001E63, 0x01001E62, v, V ] }; +}; + +partial alphanumeric_keys +xkb_symbols "igbo" { + include "ng(basic)" + + name[Group1]= "Nigeria - Igbo"; + + key { [ 0x01001ECB, 0x01001ECA, q, Q ] }; + key { [ 0x01001E45, 0x01001E44, x, X ] }; + key { [ 0x01001EE5, 0x01001EE4, semicolon, colon ] }; + key { [ 0x01001ECD, 0x01001ECC, bracketleft, braceleft ] }; +}; + +partial alphanumeric_keys +xkb_symbols "hausa" { + include "ng(basic)" + + name[Group1]= "Nigeria - Hausa"; + + key { [ 0x01000071, 0x01000051, q, Q ] }; + key { [ udiaeresis, Udiaeresis, w, W ] }; + key { [ e, E, EuroSign, cent ] }; + key { [ 0x010001B4, 0x010001B3,bracketleft, braceleft ] }; + key { [ gcaron, Gcaron,bracketright, braceright] }; + key { [ 0x01000257, 0x0100018A, d, D ] }; + key { [ 0x01000131, 0x01000130, semicolon, colon ] }; + key { [ 0x010001DD, 0x0100018E,apostrophe, quotedbl ] }; + key { [ 0x01000272, 0x0100019D, z, Z ] }; + key { [ ntilde, Ntilde, m, M ] }; + key { [ ccedilla, Ccedilla, period, greater ] }; + key { [ scedilla, Scedilla, slash, question ] }; + +}; + +partial alphanumeric_keys +xkb_symbols "olpc" { + + include "ng(basic)" + + // OLPC West Africa keyboard layout + // See: http://wiki.laptop.org/go/Image:Nigeria-B3.png + + key { [ grave, asciitilde, exclamdown, exclamdown ] }; + key { [ 1, exclam, sterling, sterling ] }; + key { [ 2, at, EuroSign, EuroSign ] }; + key { [ 3, numbersign, dollar, dollar ] }; + key { [ 4, 0x10020A6, 0x1000301, 0x1000301 ] }; // Naira, combining acute + key { [ 5, percent, 0x1000300, 0x1000300 ] }; // combining grave + key { [ 6,asciicircum, 0x100030A, 0x100030A ] }; // combining ring above + key { [ 7, ampersand, 0x1000302, 0x1000302 ] }; // combining circumflex above + key { [ 8, asterisk, 0x1000324, 0x1000324 ] }; // combining caron above + key { [ 9, parenleft, 0x1000307, 0x1000307 ] }; // combining dot above + key { [ 0, parenright, 0x1000308, 0x1000308 ] }; // combining diaeresis above + key { [ minus, underscore, 0x1000304, 0x1000304 ] }; // combining macron above + key { [ equal, plus, 0x1000303, 0x1000303 ] }; // combining tilde above + + key { [ w, W, 0x1001EB9, 0x1001EB8 ] }; // E with dot below + key { [ e, E, 0x10001DD, 0x100018E ] }; // reversed E + key { [ r, R, 0x10001B4, 0x10001B3 ] }; // Y with hook + key { [ t, T, 0x1000327, 0x1000327 ] }; // combining cedilla + key { [ y, Y, 0x1000325, 0x1000325 ] }; // combining ring below + key { [ u, U, 0x100032D, 0x100032D ] }; // combining circumflex below + key { [ i, I, 0x100032C, 0x100032C ] }; // combining caron below + key { [ o, O, 0x1000323, 0x1000323 ] }; // combining dot below + key { [ p, P, 0x1000304, 0x1000304 ] }; // combining diaeresis below + key { [ bracketleft, braceleft, 0x1000331, 0x1000331 ] }; // combining macron below + key { [bracketright, braceright, 0x1000330, 0x1000330 ] }; // combining tilde below + + key { [ a, A, Greek_iota, Greek_IOTA ] }; + key { [ s, S, 0x1001E63, 0x1001E62 ] }; // S with dot below + key { [ d, D, 0x1000257, 0x100018A ] }; // D with hook + key { [ f, F, 0x1001E0D, 0x1001E0C ] }; // D with dot below + key { [ g, G, 0x1000272, 0x100019D ] }; // N with left hook + key { [ h, H, 0x1001EE5, 0x1001EE4 ] }; // U with dot below + key { [ j, J, 0x1001ECB, 0x1001ECA ] }; // I with dot below + key { [ k, K, 0x1000199, 0x1000198 ] }; // K with hook + key { [ l, L, 0x1001E37, 0x1001E36 ] }; // L with dot below + key { [ semicolon, colon, masculine, ordfeminine ] }; + key { [ apostrophe, quotedbl, currency, currency ] }; + key { [ backslash, bar, section, section ] }; + + key { [ c, C, 0x1000254, 0x1000186 ] }; // open O + key { [ v, V, 0x100028B, 0x10001B2 ] }; // V with hook + key { [ b, B, 0x1000253, 0x1000181 ] }; // B with hook + key { [ n, N, eng, ENG ] }; + key { [ m, M, 0x1001E45, 0x1001E44 ] }; // N with dot above + key { [ comma, less, guillemotleft, guillemotleft ] }; + key { [ period, greater, guillemotright, guillemotright ] }; + key { [ slash, question, questiondown, questiondown ] }; + + key { [ multiply, division, ISO_Next_Group, ISO_Prev_Group ] }; + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/nl b/xorg-server/xkeyboard-config/symbols/nl index f4e698a94..727410545 100644 --- a/xorg-server/xkeyboard-config/symbols/nl +++ b/xorg-server/xkeyboard-config/symbols/nl @@ -1,155 +1,150 @@ -// $XKeyboardConfig$ - -// Basic layout based on converted file, from keytable file to xkb/symbols/ file -// with mk_xkb by root@linux.chanae.stben.be Tue Sep 30 00:53:29 MET DST 1997 - -// Converted from the nl-latin.map of the Linux kbd package by -// Pablo Saratxaga -// -// $XFree86: xc/programs/xkbcomp/symbols/nl,v 1.2 2002/11/22 04:03:28 dawes Exp $ - -// Official layout by Benno Schulenberg , January 2007, -// based on http://www.xs4all.nl/~koospol/public/Xmodmap-nl-deadkeys.gz - - -default partial alphanumeric_keys -xkb_symbols "basic" { - - include "latin" - - name[Group1]="Netherlands"; - - key { [ 2, quotedbl, twosuperior, oneeighth ] }; - key { [ 6, ampersand, threequarters, fiveeighths ] }; - key { [ 7, underscore, sterling, seveneighths ] }; - key { [ 8, parenleft, braceleft, bracketleft ] }; - key { [ 9, parenright, braceright, bracketright ] }; - key { [ 0, apostrophe, degree, trademark ] }; - key { [ slash, question, backslash, questiondown ] }; - key { [ degree, dead_tilde, dead_cedilla, dead_ogonek ] }; - - key { [ e, E, EuroSign, cent ] }; - key { [ t, T, thorn, THORN ] }; - key { [ y, Y, ydiaeresis, yen ] }; - key { [ u, U, udiaeresis, Udiaeresis ] }; - key { [ i, I, idiaeresis, Idiaeresis ] }; - key { [ o, O, ograve, Ograve ] }; - key { [ p, P, paragraph, THORN ] }; - key { [dead_diaeresis, dead_circumflex, asciitilde, asciicircum] }; - key { [ asterisk, bar, dead_tilde, dead_macron ] }; - - key { [ a, A, aacute, Aacute ] }; - key { [ f, F, ordfeminine, ordfeminine ] }; - key { [ plus, plusminus, dead_acute, dead_doubleacute ] }; - key { [dead_acute, dead_grave, apostrophe, grave ] }; - key { [ at, section, notsign, notsign ] }; - - key { [ less, greater, dead_grave, dead_breve ] }; - key { [ n, N, ntilde, Ntilde ] }; - key { [ m, M, Greek_mu, masculine ] }; - key { [ comma, semicolon, cedilla, guillemotleft] }; - key { [ period, colon, periodcentered, guillemotright ] }; - key { [ minus, equal, hyphen, dead_abovedot] }; - - key { [bracketright, bracketleft, bar, brokenbar ] }; - - include "level3(ralt_switch)" -}; - - -partial alphanumeric_keys -xkb_symbols "std" { - - name[Group1]= "Netherlands - Standard"; - - key { [ at, section, notsign ] }; - key { [ 1, exclam, onesuperior ] }; - key { [ 2, quotedbl, twosuperior ] }; - key { [ 3, numbersign, threesuperior ] }; - key { [ 4, dollar, onequarter ] }; - key { [ 5, percent, onehalf ] }; - key { [ 6, ampersand, threequarters ] }; - key { [ 7, underscore, sterling ] }; - key { [ 8, parenleft, braceleft ] }; - key { [ 9, parenright, braceright ] }; - key { [ 0, apostrophe ] }; - key { [ slash, question, backslash ] }; - key { [ degree, dead_tilde, dead_cedilla ] }; - - key { [ q, Q ] }; - key { [ w, W ] }; - key { [ e, E, EuroSign ] }; - key { [ r, R, paragraph ] }; - key { [ t, T ] }; - key { [ y, Y ] }; - key { [ u, U ] }; - key { [ i, I ] }; - key { [ o, O ] }; - key { [ p, P ] }; - key { [ dead_diaeresis, dead_circumflex ] }; - key { [ asterisk, bar ] }; - key { [ less, greater ] }; - - key { [ a, A ] }; - key { [ s, S, ssharp ] }; - key { [ d, D ] }; - key { [ f, F ] }; - key { [ g, G ] }; - key { [ h, H ] }; - key { [ j, J ] }; - key { [ k, K ] }; - key { [ l, L ] }; - key { [ plus, plusminus ] }; - key { [ dead_acute, dead_grave ] }; - - key { [ bracketright, bracketleft, bar ] }; - key { [ z, Z, guillemotleft ] }; - key { [ x, X, guillemotright ] }; - key { [ c, C, cent ] }; - key { [ v, V ] }; - key { [ b, B ] }; - key { [ n, N ] }; - key { [ m, M, mu ] }; - key { [ comma, semicolon ] }; - key { [ period, colon, periodcentered ] }; - key { [ minus, equal ] }; - - include "level3(ralt_switch)" -}; - - -partial alphanumeric_keys -xkb_symbols "Sundeadkeys" { - - // For naming consistency - - include "nl(basic)" - -}; - -partial alphanumeric_keys -xkb_symbols "sundeadkeys" { - - // For naming consistency - - include "nl(Sundeadkeys)" - name[Group1]="Netherlands - Sun dead keys"; -}; - -// Copied from macintosh_vndr/nl -partial alphanumeric_keys -xkb_symbols "mac" { - - // Describes the differences between a very simple mac_US - // keyboard and a very simple netherland keybaord - - include "latin" - - name[Group1]= "Netherlands - Macintosh"; - - include "level3(ralt_switch)" - -// do just nothing - -}; - +// Basic layout based on converted file, from keytable file to xkb/symbols/ file +// with mk_xkb by root@linux.chanae.stben.be Tue Sep 30 00:53:29 MET DST 1997 + +// Converted from the nl-latin.map of the Linux kbd package by +// Pablo Saratxaga + +// Official layout by Benno Schulenberg , January 2007, +// based on http://www.xs4all.nl/~koospol/public/Xmodmap-nl-deadkeys.gz + + +default partial alphanumeric_keys +xkb_symbols "basic" { + + include "latin" + + name[Group1]="Netherlands"; + + key { [ 2, quotedbl, twosuperior, oneeighth ] }; + key { [ 6, ampersand, threequarters, fiveeighths ] }; + key { [ 7, underscore, sterling, seveneighths ] }; + key { [ 8, parenleft, braceleft, bracketleft ] }; + key { [ 9, parenright, braceright, bracketright ] }; + key { [ 0, apostrophe, degree, trademark ] }; + key { [ slash, question, backslash, questiondown ] }; + key { [ degree, dead_tilde, dead_cedilla, dead_ogonek ] }; + + key { [ e, E, EuroSign, cent ] }; + key { [ t, T, thorn, THORN ] }; + key { [ y, Y, ydiaeresis, yen ] }; + key { [ u, U, udiaeresis, Udiaeresis ] }; + key { [ i, I, idiaeresis, Idiaeresis ] }; + key { [ o, O, ograve, Ograve ] }; + key { [ p, P, paragraph, THORN ] }; + key { [dead_diaeresis, dead_circumflex, asciitilde, asciicircum] }; + key { [ asterisk, bar, dead_tilde, dead_macron ] }; + + key { [ a, A, aacute, Aacute ] }; + key { [ f, F, ordfeminine, ordfeminine ] }; + key { [ plus, plusminus, dead_acute, dead_doubleacute ] }; + key { [dead_acute, dead_grave, apostrophe, grave ] }; + key { [ at, section, notsign, notsign ] }; + + key { [ less, greater, dead_grave, dead_breve ] }; + key { [ n, N, ntilde, Ntilde ] }; + key { [ m, M, Greek_mu, masculine ] }; + key { [ comma, semicolon, cedilla, guillemotleft] }; + key { [ period, colon, periodcentered, guillemotright ] }; + key { [ minus, equal, hyphen, dead_abovedot] }; + + key { [bracketright, bracketleft, bar, brokenbar ] }; + + include "level3(ralt_switch)" +}; + + +partial alphanumeric_keys +xkb_symbols "std" { + + name[Group1]= "Netherlands - Standard"; + + key { [ at, section, notsign ] }; + key { [ 1, exclam, onesuperior ] }; + key { [ 2, quotedbl, twosuperior ] }; + key { [ 3, numbersign, threesuperior ] }; + key { [ 4, dollar, onequarter ] }; + key { [ 5, percent, onehalf ] }; + key { [ 6, ampersand, threequarters ] }; + key { [ 7, underscore, sterling ] }; + key { [ 8, parenleft, braceleft ] }; + key { [ 9, parenright, braceright ] }; + key { [ 0, apostrophe ] }; + key { [ slash, question, backslash ] }; + key { [ degree, dead_tilde, dead_cedilla ] }; + + key { [ q, Q ] }; + key { [ w, W ] }; + key { [ e, E, EuroSign ] }; + key { [ r, R, paragraph ] }; + key { [ t, T ] }; + key { [ y, Y ] }; + key { [ u, U ] }; + key { [ i, I ] }; + key { [ o, O ] }; + key { [ p, P ] }; + key { [ dead_diaeresis, dead_circumflex ] }; + key { [ asterisk, bar ] }; + key { [ less, greater ] }; + + key { [ a, A ] }; + key { [ s, S, ssharp ] }; + key { [ d, D ] }; + key { [ f, F ] }; + key { [ g, G ] }; + key { [ h, H ] }; + key { [ j, J ] }; + key { [ k, K ] }; + key { [ l, L ] }; + key { [ plus, plusminus ] }; + key { [ dead_acute, dead_grave ] }; + + key { [ bracketright, bracketleft, bar ] }; + key { [ z, Z, guillemotleft ] }; + key { [ x, X, guillemotright ] }; + key { [ c, C, cent ] }; + key { [ v, V ] }; + key { [ b, B ] }; + key { [ n, N ] }; + key { [ m, M, mu ] }; + key { [ comma, semicolon ] }; + key { [ period, colon, periodcentered ] }; + key { [ minus, equal ] }; + + include "level3(ralt_switch)" +}; + + +partial alphanumeric_keys +xkb_symbols "Sundeadkeys" { + + // For naming consistency + + include "nl(basic)" + +}; + +partial alphanumeric_keys +xkb_symbols "sundeadkeys" { + + // For naming consistency + + include "nl(Sundeadkeys)" + name[Group1]="Netherlands - Sun dead keys"; +}; + +// Copied from macintosh_vndr/nl +partial alphanumeric_keys +xkb_symbols "mac" { + + // Describes the differences between a very simple mac_US + // keyboard and a very simple netherland keybaord + + include "latin" + + name[Group1]= "Netherlands - Macintosh"; + + include "level3(ralt_switch)" + +// do just nothing + +}; diff --git a/xorg-server/xkeyboard-config/symbols/no b/xorg-server/xkeyboard-config/symbols/no index 56c3d2c42..9515be154 100644 --- a/xorg-server/xkeyboard-config/symbols/no +++ b/xorg-server/xkeyboard-config/symbols/no @@ -1,230 +1,225 @@ - -// based on a keyboard map from an 'xkb/symbols/no' file -// -// $XKeyboardConfig$ -// $XFree86: xc/programs/xkbcomp/symbols/no,v 1.3 2002/12/19 01:07:56 dawes Exp $ - -partial default alphanumeric_keys -xkb_symbols "basic" { - - // Describes the differences between a very simple en_US - // keyboard and a Norwegian keyboard with dead key support - // and all of ISO-8859-1 characters available. - - include "latin(type2)" - - name[Group1]="Norway"; - - key { [ period, colon, ellipsis, periodcentered ] }; - key { [ minus, underscore, endash, emdash ] }; - key { [ r, R, registered, trademark ] }; - key { [ p, P, Greek_pi, Greek_PI ] }; - key { [ 5, percent, onehalf, 0x1002030 ] }; - - key { [ plus, question, plusminus, questiondown ] }; - key { [ backslash, dead_grave, dead_acute, notsign ] }; - - - key { [ oslash, Ooblique, dead_acute, dead_doubleacute ] }; - key { [ ae, AE, dead_circumflex, dead_caron] }; - key { [ bar, section, brokenbar, paragraph ] }; - - key { [apostrophe, asterisk, dead_doubleacute, multiply ] }; - key { [ less, greater, onehalf, threequarters] }; - - include "nbsp(level3n)" - include "keypad(ossmath)" - include "kpdl(comma)" - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - - // Modifies the basic Norwegian layout to eliminate dead keys - - include "no(basic)" - - name[Group1]="Norway - Eliminate dead keys"; - - key { [ backslash, grave, acute, ogonek ] }; - key { [ diaeresis, asciicircum, asciitilde, macron ] }; - key { [ oslash, Ooblique, acute, doubleacute ] }; - key { [ ae, AE, asciicircum, caron ] }; - key { [ comma, semicolon, cedilla, ogonek ] }; - key { [ period, colon, periodcentered, abovedot ] }; -}; - -// Norwegian Dvorak -partial alphanumeric_keys -xkb_symbols "dvorak" { - include "us(dvorak)" - - name[Group1]="Norway - Dvorak"; - - key { [ bar, section, brokenbar, paragraph ] }; - - key { [ 1, exclam, exclamdown, onesuperior ] }; - key { [ 2, quotedbl, at, twosuperior ] }; - key { [ 3, numbersign, sterling, threesuperior ] }; - key { [ 4, dollar, currency,onequarter ] }; - key { [ 5, percent, onehalf, onehalf ] }; - key { [ 6, ampersand, threequarters, threequarters ] }; - key { [ 7, slash, braceleft, division ] }; - key { [ 8, parenleft, bracketleft ] }; - key { [ 9, parenright, bracketright ] }; - key { [ 0, equal, braceright ] }; - key { [ plus, question, plusminus, questiondown ] }; - key { [ backslash, grave, dead_acute, dead_grave ] }; - - key { [ aring, Aring, braceright, bracketright ] }; - key { [ comma, semicolon, dead_cedilla, cedilla ] }; - key { [ period, colon, periodcentered ] }; - key { [ p, P, thorn, THORN ] }; - key { [ y, Y, yen ] }; - key { [ f, F, ordfeminine ] }; - key { [ c, C, ccedilla, copyright ] }; - key { [ r, R, registered ] }; - key { [ apostrophe, asterisk, dead_circumflex, acute ] }; - key { [ asciitilde, asciicircum, dead_diaeresis, dead_tilde ] }; - - key { [ e, E, EuroSign, cent ] }; - key { [ i, I, idotless, Iabovedot] }; - key { [ d, D, eth, ETH ] }; - key { [ s, S, ssharp ] }; - key { [ minus, underscore, hyphen, diaeresis] }; - - key { [ ae, AE, braceleft, bracketleft] }; - key { [ x, X, multiply ] }; - key { [ m, M, mu ] }; - key { [ less, greater, guillemotleft, guillemotright ] }; - - key { [ space, space, nobreakspace, nobreakspace] }; - - key { [ oslash, Ooblique, bar, backslash ] }; - - // fixed https://bugs.freedesktop.org/show_bug.cgi?id=4397 - include "level3(ralt_switch)" -}; - -// based on -// Northern Sami keyboards for Finland, Norway and Sweden -// -// Describes the differences between a very simple en_US -// keyboard and a Norwegian Northern Sami keyboard (with -// dead key support) according to the spec on -// http://www.hum.uit.no/a/trond/se-lat9-no-keys.html -// Written by Børre Gaup -// -// $XFree86: xc/programs/xkbcomp/symbols/sapmi,v 1.2 2002/11/22 04:03:28 dawes Exp $ - -partial alphanumeric_keys -xkb_symbols "smi" { - include "latin" - - name[Group1]= "Norway - Northern Saami"; - - key { [ 1, exclam, copyright, exclamdown ] }; - key { [ 2, quotedbl, at, registered ] }; - key { [ 3, numbersign, sterling, less ] }; - key { [ 4, dollar, dollar, greater ] }; - key { [ 5, percent, U2022, U2030 ] }; - key { [ 6, ampersand, section, paragraph ] }; - key { [ 7, slash, braceleft, bar ] }; - key { [ 8, parenleft, bracketleft, braceleft ] }; - key { [ 9, parenright, bracketright, braceright ] }; - key { [ 0, equal, braceright, notequal ] }; - key { [ plus, question, division, questiondown ] }; - key { [ backslash, grave, acute, asciitilde ] }; - - key { [ aacute, Aacute, q, Q ] }; - key { [ scaron, Scaron, w, W ] }; - key { [ e, E, eacute, Eacute ] }; - key { [ r, R, registered, trademark ] }; - key { [ y, Y, yacute, Yacute ] }; - key { [ u, U, udiaeresis, Udiaeresis ] }; - key { [ i, I, idiaeresis, Idiaeresis ] }; - key { [ o, O, oe, OE ] }; - key { [ aring, Aring, acircumflex, Acircumflex ] }; - key { [ eng, ENG, quotedbl, asciicircum ] }; - - key { [ a, A, agrave, Agrave ] }; - key { [ s, S, ssharp, apostrophe ] }; - key { [ f, F, ordfeminine, ordfeminine ] }; - key { [ g, G, gcaron, Gcaron ] }; - key { [ h, H, U01E5, U01E4 ] }; - key { [ j, J, notsign, multiply ] }; - key { [ k, K, U01E9, U01E8 ] }; - key { [ l, L, degree, hyphen ] }; - key { [ oslash, Ooblique, odiaeresis, Odiaeresis ] }; - key { [ ae, AE, adiaeresis, Adiaeresis ] }; - key { [ bar, section, brokenbar, paragraph ] }; - - key { [ dstroke, Dstroke, apostrophe, asterisk ] }; - key { [ z, Z, U0292, U01B7 ] }; - key { [ ccaron, Ccaron, x, X ] }; - key { [ c, C, ccedilla, Ccedilla ] }; - key { [ v, V, lessthanequal, guillemotleft ] }; - key { [ b, B, greaterthanequal, guillemotright ] }; - key { [ n, N, leftsinglequotemark, leftdoublequotemark ] }; - key { [ m, M, rightsinglequotemark, rightdoublequotemark ] }; - key { [ comma, semicolon, singlelowquotemark, doublelowquotemark ] }; - key { [ period, colon, ellipsis, periodcentered ] }; - key { [ minus, underscore, endash, emdash ] }; - - key { type[Group1] = "FOUR_LEVEL", - [ zcaron, Zcaron, U01EF, U01EE ] }; - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "smi_nodeadkeys" { - - // Modifies the basic Norwegian layout to eliminate dead keys - - include "no(smi)" - - name[Group1]= "Norway - Northern Saami, eliminate dead keys"; - - key { [ backslash, grave, acute, ogonek ] }; -}; - -// Copied from macintosh_vndr/no -partial alphanumeric_keys -xkb_symbols "mac" { - - // Describes the differences between a very simple en_US - // keyboard and a very simple Norwegian keybaord - - include "latin(type4)" - name[Group1]= "Norway - Macintosh"; - - key { [ bar, section ] }; - key { [ 3, numbersign, sterling, sterling ] }; - key { [ 4, currency, dollar, dollar ] }; - key { [ 6, ampersand, threequarters, fiveeighths ] }; - key { [ 7, slash, bar, backslash ] }; - key { [ 8, parenleft, bracketleft, braceleft ] }; - key { [ 9, parenright, bracketright, braceright ] }; - key { [ oslash, Ooblique, odiaeresis, Odiaeresis ] }; - key { [ plus, question ] }; - key { [ ae, AE ] }; - key { [ aring, Aring ] }; - key { [ dead_grave, dead_acute, acute, dead_ogonek ] }; - key { [ diaeresis, asciicircum, asciitilde, dead_macron ] }; - key { [ at, asterisk ] }; -}; - - -partial alphanumeric_keys -xkb_symbols "mac_nodeadkeys" { - - // Modifies the basic Norwegian layout to eliminate dead keys - include "no(mac)" - name[Group1]= "Norway - Macintosh, eliminate dead keys"; - - key { [ grave, acute, acute, ogonek ] }; - key { [ diaeresis, asciicircum, asciitilde, macron ] }; -}; +// based on a keyboard map from an 'xkb/symbols/no' file + +partial default alphanumeric_keys +xkb_symbols "basic" { + + // Describes the differences between a very simple en_US + // keyboard and a Norwegian keyboard with dead key support + // and all of ISO-8859-1 characters available. + + include "latin(type2)" + + name[Group1]="Norway"; + + key { [ period, colon, ellipsis, periodcentered ] }; + key { [ minus, underscore, endash, emdash ] }; + key { [ r, R, registered, trademark ] }; + key { [ p, P, Greek_pi, Greek_PI ] }; + key { [ 5, percent, onehalf, 0x1002030 ] }; + + key { [ plus, question, plusminus, questiondown ] }; + key { [ backslash, dead_grave, dead_acute, notsign ] }; + + + key { [ oslash, Ooblique, dead_acute, dead_doubleacute ] }; + key { [ ae, AE, dead_circumflex, dead_caron] }; + key { [ bar, section, brokenbar, paragraph ] }; + + key { [apostrophe, asterisk, dead_doubleacute, multiply ] }; + key { [ less, greater, onehalf, threequarters] }; + + include "nbsp(level3n)" + include "keypad(ossmath)" + include "kpdl(comma)" + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "nodeadkeys" { + + // Modifies the basic Norwegian layout to eliminate dead keys + + include "no(basic)" + + name[Group1]="Norway - Eliminate dead keys"; + + key { [ backslash, grave, acute, ogonek ] }; + key { [ diaeresis, asciicircum, asciitilde, macron ] }; + key { [ oslash, Ooblique, acute, doubleacute ] }; + key { [ ae, AE, asciicircum, caron ] }; + key { [ comma, semicolon, cedilla, ogonek ] }; + key { [ period, colon, periodcentered, abovedot ] }; +}; + +// Norwegian Dvorak +partial alphanumeric_keys +xkb_symbols "dvorak" { + include "us(dvorak)" + + name[Group1]="Norway - Dvorak"; + + key { [ bar, section, brokenbar, paragraph ] }; + + key { [ 1, exclam, exclamdown, onesuperior ] }; + key { [ 2, quotedbl, at, twosuperior ] }; + key { [ 3, numbersign, sterling, threesuperior ] }; + key { [ 4, dollar, currency,onequarter ] }; + key { [ 5, percent, onehalf, onehalf ] }; + key { [ 6, ampersand, threequarters, threequarters ] }; + key { [ 7, slash, braceleft, division ] }; + key { [ 8, parenleft, bracketleft ] }; + key { [ 9, parenright, bracketright ] }; + key { [ 0, equal, braceright ] }; + key { [ plus, question, plusminus, questiondown ] }; + key { [ backslash, grave, dead_acute, dead_grave ] }; + + key { [ aring, Aring, braceright, bracketright ] }; + key { [ comma, semicolon, dead_cedilla, cedilla ] }; + key { [ period, colon, periodcentered ] }; + key { [ p, P, thorn, THORN ] }; + key { [ y, Y, yen ] }; + key { [ f, F, ordfeminine ] }; + key { [ c, C, ccedilla, copyright ] }; + key { [ r, R, registered ] }; + key { [ apostrophe, asterisk, dead_circumflex, acute ] }; + key { [ asciitilde, asciicircum, dead_diaeresis, dead_tilde ] }; + + key { [ e, E, EuroSign, cent ] }; + key { [ i, I, idotless, Iabovedot] }; + key { [ d, D, eth, ETH ] }; + key { [ s, S, ssharp ] }; + key { [ minus, underscore, hyphen, diaeresis] }; + + key { [ ae, AE, braceleft, bracketleft] }; + key { [ x, X, multiply ] }; + key { [ m, M, mu ] }; + key { [ less, greater, guillemotleft, guillemotright ] }; + + key { [ space, space, nobreakspace, nobreakspace] }; + + key { [ oslash, Ooblique, bar, backslash ] }; + + // fixed https://bugs.freedesktop.org/show_bug.cgi?id=4397 + include "level3(ralt_switch)" +}; + +// based on +// Northern Sami keyboards for Finland, Norway and Sweden +// +// Describes the differences between a very simple en_US +// keyboard and a Norwegian Northern Sami keyboard (with +// dead key support) according to the spec on +// http://www.hum.uit.no/a/trond/se-lat9-no-keys.html +// Written by Børre Gaup +// + +partial alphanumeric_keys +xkb_symbols "smi" { + include "latin" + + name[Group1]= "Norway - Northern Saami"; + + key { [ 1, exclam, copyright, exclamdown ] }; + key { [ 2, quotedbl, at, registered ] }; + key { [ 3, numbersign, sterling, less ] }; + key { [ 4, dollar, dollar, greater ] }; + key { [ 5, percent, U2022, U2030 ] }; + key { [ 6, ampersand, section, paragraph ] }; + key { [ 7, slash, braceleft, bar ] }; + key { [ 8, parenleft, bracketleft, braceleft ] }; + key { [ 9, parenright, bracketright, braceright ] }; + key { [ 0, equal, braceright, notequal ] }; + key { [ plus, question, division, questiondown ] }; + key { [ backslash, grave, acute, asciitilde ] }; + + key { [ aacute, Aacute, q, Q ] }; + key { [ scaron, Scaron, w, W ] }; + key { [ e, E, eacute, Eacute ] }; + key { [ r, R, registered, trademark ] }; + key { [ y, Y, yacute, Yacute ] }; + key { [ u, U, udiaeresis, Udiaeresis ] }; + key { [ i, I, idiaeresis, Idiaeresis ] }; + key { [ o, O, oe, OE ] }; + key { [ aring, Aring, acircumflex, Acircumflex ] }; + key { [ eng, ENG, quotedbl, asciicircum ] }; + + key { [ a, A, agrave, Agrave ] }; + key { [ s, S, ssharp, apostrophe ] }; + key { [ f, F, ordfeminine, ordfeminine ] }; + key { [ g, G, gcaron, Gcaron ] }; + key { [ h, H, U01E5, U01E4 ] }; + key { [ j, J, notsign, multiply ] }; + key { [ k, K, U01E9, U01E8 ] }; + key { [ l, L, degree, hyphen ] }; + key { [ oslash, Ooblique, odiaeresis, Odiaeresis ] }; + key { [ ae, AE, adiaeresis, Adiaeresis ] }; + key { [ bar, section, brokenbar, paragraph ] }; + + key { [ dstroke, Dstroke, apostrophe, asterisk ] }; + key { [ z, Z, U0292, U01B7 ] }; + key { [ ccaron, Ccaron, x, X ] }; + key { [ c, C, ccedilla, Ccedilla ] }; + key { [ v, V, lessthanequal, guillemotleft ] }; + key { [ b, B, greaterthanequal, guillemotright ] }; + key { [ n, N, leftsinglequotemark, leftdoublequotemark ] }; + key { [ m, M, rightsinglequotemark, rightdoublequotemark ] }; + key { [ comma, semicolon, singlelowquotemark, doublelowquotemark ] }; + key { [ period, colon, ellipsis, periodcentered ] }; + key { [ minus, underscore, endash, emdash ] }; + + key { type[Group1] = "FOUR_LEVEL", + [ zcaron, Zcaron, U01EF, U01EE ] }; + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "smi_nodeadkeys" { + + // Modifies the basic Norwegian layout to eliminate dead keys + + include "no(smi)" + + name[Group1]= "Norway - Northern Saami, eliminate dead keys"; + + key { [ backslash, grave, acute, ogonek ] }; +}; + +// Copied from macintosh_vndr/no +partial alphanumeric_keys +xkb_symbols "mac" { + + // Describes the differences between a very simple en_US + // keyboard and a very simple Norwegian keybaord + + include "latin(type4)" + name[Group1]= "Norway - Macintosh"; + + key { [ bar, section ] }; + key { [ 3, numbersign, sterling, sterling ] }; + key { [ 4, currency, dollar, dollar ] }; + key { [ 6, ampersand, threequarters, fiveeighths ] }; + key { [ 7, slash, bar, backslash ] }; + key { [ 8, parenleft, bracketleft, braceleft ] }; + key { [ 9, parenright, bracketright, braceright ] }; + key { [ oslash, Ooblique, odiaeresis, Odiaeresis ] }; + key { [ plus, question ] }; + key { [ ae, AE ] }; + key { [ aring, Aring ] }; + key { [ dead_grave, dead_acute, acute, dead_ogonek ] }; + key { [ diaeresis, asciicircum, asciitilde, dead_macron ] }; + key { [ at, asterisk ] }; +}; + + +partial alphanumeric_keys +xkb_symbols "mac_nodeadkeys" { + + // Modifies the basic Norwegian layout to eliminate dead keys + include "no(mac)" + name[Group1]= "Norway - Macintosh, eliminate dead keys"; + + key { [ grave, acute, acute, ogonek ] }; + key { [ diaeresis, asciicircum, asciitilde, macron ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/np b/xorg-server/xkeyboard-config/symbols/np index 26085c010..635fa348a 100644 --- a/xorg-server/xkeyboard-config/symbols/np +++ b/xorg-server/xkeyboard-config/symbols/np @@ -1,124 +1,120 @@ -// $XKeyboardConfig$ - -// based on a keyboard map from an 'xkb/symbols/dev' file -// -// $XFree86: xc/programs/xkbcomp/symbols/pc/dev,v 1.2 2002/11/22 04:03:28 dawes Exp $ - -partial default alphanumeric_keys -xkb_symbols "basic" { - - name[Group1]= "Nepal"; - -// `,1,2,3,4,5,6,7,8,9,0,-,= - - key { [ 0x100093D,0x100093C ] }; - key { [ 0x1000967 ] }; - key { [ 0x1000968 ] }; - key { [ 0x1000969 ] }; - key { [ 0x100096A ] }; - key { [ 0x100096B ] }; - key { [ 0x100096C ] }; - key { [ 0x100096D ] }; - key { [ 0x100096e ] }; - key { [ 0x100096F ] }; - key { [ 0x1000966,0x1000970 ] }; - key { [ minus, 0x1000952 ] }; - key { [ equal, 0x100200C ] }; - -// q,w,e,r,t,y,u,i,o,p,[,] - - key { [ 0x100091F, 0x1000920 ] }; - key { [ 0x100094C, 0x1000914 ] }; - key { [ 0x1000947, 0x1000948 ] }; - key { [ 0x1000930, 0x1000943 ] }; - key { [ 0x1000924, 0x1000925 ] }; - key { [ 0x100092F, 0x100091E ] }; - key { [ 0x1000941, 0x1000942 ] }; - key { [ 0x100093F, 0x1000940 ] }; - key { [ 0x100094B, 0x1000913 ] }; - key { [ 0x100092A, 0x100092B ] }; - key { [ 0x1000907, 0x1000908 ] }; - key { [ 0x100090F, 0x1000910 ] }; - -// a,s,d,f,g,h,j,k,l,;,',Backslash - key { [ 0x100093E, 0x1000906 ] }; - key { [ 0x1000938, 0x1000936 ] }; - key { [ 0x1000926, 0x1000927 ] }; - key { [ 0x1000909, 0x100090A ] }; - key { [ 0x1000917, 0x1000918 ] }; - key { [ 0x1000939, 0x1000905 ] }; - key { [ 0x100091C, 0x100091D ] }; - key { [ 0x1000915, 0x1000916 ] }; - key { [ 0x1000932, 0x1000933 ] }; - key { [ semicolon, colon ] }; - key { [ quoteright, quotedbl ] }; - key { [ 0x1000950, 0x1000903 ] }; - - -// z,x,c,v,b,n,m,,,.,/ - key { [ 0x1000937, 0x100090B ] }; - key { [ 0x1000921, 0x1000922 ] }; - key { [ 0x100091B, 0x100091A ] }; - key { [ 0x1000935, 0x1000901 ] }; - key { [ 0x100092C, 0x100092D ] }; - key { [ 0x1000928, 0x1000923 ] }; - key { [ 0x100092E, 0x1000902 ] }; - key { [ comma, 0x1000919 ] }; - key { [ 0x1000964, 0x1000965 ] }; - key { [ 0x100094D, question ] }; -}; - -partial alphanumeric_keys -xkb_symbols "olpc" { - -// Contact: Walter Bender - - include "np" - key { [ grave, asciitilde ] }; - key { [ 0x1000967 ] }; // Nepali digit one - key { [ 0x1000968 ] }; // Nepali digit two - key { [ 0x1000969 ] }; // Nepali digit three - key { [ 0x100096A ] }; // Nepali digit four - key { [ 0x100096B ] }; // Nepali digit five - key { [ 0x100096C, sterling ] }; // Nepali digit six - key { [ 0x100096D, eurosign ] }; // Nepali digit seven - key { [ 0x100096e ] }; // Nepali digit eight - key { [ 0x100096F ] }; // Nepali digit nine - key { [ 0x1000966 ] }; // Nepali digit zero - key { [ 0x1000950, 0x1000903 ] }; // OM, SIGN VISARGA - - key { [ 0x100091C, 0x100091D ] }; // JA, JHA - key { [ 0x1000917, 0x1000918 ] }; // GA, GHA - key { [ 0x100092F, 0x100091E ] }; // YA, YNA - key { [ 0x1000938, 0x1000936 ] }; // SA, SHA - key { [ 0x100090F, 0x1000910 ] }; // E, AI - key { [ 0x100091B, 0x100091A ] }; // CHHA, CHA - key { [ 0x100092A, 0x100092B ] }; // PA, PHA - key { [ 0x1000947, 0x1000948 ] }; // VOWEL SIGN E, VOWEL SIGN AI - key { [ 0x100094B, 0x100093E ] }; // VOWEL SIGN O, VOWEL SIGN AA - key { [ 0x1000924, 0x1000925 ] }; // TA, THA - key { [ 0x1000909, 0x100090A ] }; // HRSHWA U, DIRGHA UU - key { [ 0x100093F, 0x1000940 ] }; // VOWEL SIGN HRSHWA I, VOWEL SIGN DIRGHA II - - key { [ 0x100092E, 0x1000902 ] }; // MA, SIGN ANUSVARA - key { [ 0x1000907, 0x1000908 ] }; // HRSHWA I, DIRGHA II - key { [ 0x1000928, 0x1000923 ] }; // NA, NNA - key { [ 0x100094D, 0x1000921 ] }; // VIRAMA (HALANTA?), DDA - key { [ 0x100091F, 0x1000920 ] }; // TTA, TTHA - key { [ 0x1000926, 0x1000927 ] }; // DA, DHA - key { [ 0x100093E, 0x1000901 ] }; // SIGN AA, SIGN CANDRABINDU - key { [ 0x1000930, 0x1000943 ] }; // RA, VOWEL SIGN VOCALIC R - key { [ 0x1000915, 0x1000916 ] }; // KA, KHA - - key { [ 0x1000937, 0x100090B ] }; // SSA, VOCALIC R (RRI) - key { [ 0x100092C, 0x100092D ] }; // BA, BHA - key { [ 0x1000941, 0x1000942 ] }; // VOWEL SIGN HRSHWA U, VOWEL SIGN DIRGHA U (UU) - key { [ 0x1000939, 0x1000922 ] }; // HA, DDHA - key { [ 0x1000913, 0x1000914 ] }; // O, AU - key { [ 0x1000905, 0x1000906 ] }; // A, AA - key { [ 0x1000932, 0x1000919 ] }; // LA, NGA - key { [ comma, 0x1000935 ] }; // VA - key { [ 0x1000964, 0x1000965 ] }; // PURNA VIRAM, DIRGHA VIRAM - - include "group(olpc)" -}; +// based on a keyboard map from an 'xkb/symbols/dev' file + +partial default alphanumeric_keys +xkb_symbols "basic" { + + name[Group1]= "Nepal"; + +// `,1,2,3,4,5,6,7,8,9,0,-,= + + key { [ 0x100093D,0x100093C ] }; + key { [ 0x1000967 ] }; + key { [ 0x1000968 ] }; + key { [ 0x1000969 ] }; + key { [ 0x100096A ] }; + key { [ 0x100096B ] }; + key { [ 0x100096C ] }; + key { [ 0x100096D ] }; + key { [ 0x100096e ] }; + key { [ 0x100096F ] }; + key { [ 0x1000966,0x1000970 ] }; + key { [ minus, 0x1000952 ] }; + key { [ equal, 0x100200C ] }; + +// q,w,e,r,t,y,u,i,o,p,[,] + + key { [ 0x100091F, 0x1000920 ] }; + key { [ 0x100094C, 0x1000914 ] }; + key { [ 0x1000947, 0x1000948 ] }; + key { [ 0x1000930, 0x1000943 ] }; + key { [ 0x1000924, 0x1000925 ] }; + key { [ 0x100092F, 0x100091E ] }; + key { [ 0x1000941, 0x1000942 ] }; + key { [ 0x100093F, 0x1000940 ] }; + key { [ 0x100094B, 0x1000913 ] }; + key { [ 0x100092A, 0x100092B ] }; + key { [ 0x1000907, 0x1000908 ] }; + key { [ 0x100090F, 0x1000910 ] }; + +// a,s,d,f,g,h,j,k,l,;,',Backslash + key { [ 0x100093E, 0x1000906 ] }; + key { [ 0x1000938, 0x1000936 ] }; + key { [ 0x1000926, 0x1000927 ] }; + key { [ 0x1000909, 0x100090A ] }; + key { [ 0x1000917, 0x1000918 ] }; + key { [ 0x1000939, 0x1000905 ] }; + key { [ 0x100091C, 0x100091D ] }; + key { [ 0x1000915, 0x1000916 ] }; + key { [ 0x1000932, 0x1000933 ] }; + key { [ semicolon, colon ] }; + key { [ quoteright, quotedbl ] }; + key { [ 0x1000950, 0x1000903 ] }; + + +// z,x,c,v,b,n,m,,,.,/ + key { [ 0x1000937, 0x100090B ] }; + key { [ 0x1000921, 0x1000922 ] }; + key { [ 0x100091B, 0x100091A ] }; + key { [ 0x1000935, 0x1000901 ] }; + key { [ 0x100092C, 0x100092D ] }; + key { [ 0x1000928, 0x1000923 ] }; + key { [ 0x100092E, 0x1000902 ] }; + key { [ comma, 0x1000919 ] }; + key { [ 0x1000964, 0x1000965 ] }; + key { [ 0x100094D, question ] }; +}; + +partial alphanumeric_keys +xkb_symbols "olpc" { + +// Contact: Walter Bender + + include "np" + key { [ grave, asciitilde ] }; + key { [ 0x1000967 ] }; // Nepali digit one + key { [ 0x1000968 ] }; // Nepali digit two + key { [ 0x1000969 ] }; // Nepali digit three + key { [ 0x100096A ] }; // Nepali digit four + key { [ 0x100096B ] }; // Nepali digit five + key { [ 0x100096C, sterling ] }; // Nepali digit six + key { [ 0x100096D, eurosign ] }; // Nepali digit seven + key { [ 0x100096e ] }; // Nepali digit eight + key { [ 0x100096F ] }; // Nepali digit nine + key { [ 0x1000966 ] }; // Nepali digit zero + key { [ 0x1000950, 0x1000903 ] }; // OM, SIGN VISARGA + + key { [ 0x100091C, 0x100091D ] }; // JA, JHA + key { [ 0x1000917, 0x1000918 ] }; // GA, GHA + key { [ 0x100092F, 0x100091E ] }; // YA, YNA + key { [ 0x1000938, 0x1000936 ] }; // SA, SHA + key { [ 0x100090F, 0x1000910 ] }; // E, AI + key { [ 0x100091B, 0x100091A ] }; // CHHA, CHA + key { [ 0x100092A, 0x100092B ] }; // PA, PHA + key { [ 0x1000947, 0x1000948 ] }; // VOWEL SIGN E, VOWEL SIGN AI + key { [ 0x100094B, 0x100093E ] }; // VOWEL SIGN O, VOWEL SIGN AA + key { [ 0x1000924, 0x1000925 ] }; // TA, THA + key { [ 0x1000909, 0x100090A ] }; // HRSHWA U, DIRGHA UU + key { [ 0x100093F, 0x1000940 ] }; // VOWEL SIGN HRSHWA I, VOWEL SIGN DIRGHA II + + key { [ 0x100092E, 0x1000902 ] }; // MA, SIGN ANUSVARA + key { [ 0x1000907, 0x1000908 ] }; // HRSHWA I, DIRGHA II + key { [ 0x1000928, 0x1000923 ] }; // NA, NNA + key { [ 0x100094D, 0x1000921 ] }; // VIRAMA (HALANTA?), DDA + key { [ 0x100091F, 0x1000920 ] }; // TTA, TTHA + key { [ 0x1000926, 0x1000927 ] }; // DA, DHA + key { [ 0x100093E, 0x1000901 ] }; // SIGN AA, SIGN CANDRABINDU + key { [ 0x1000930, 0x1000943 ] }; // RA, VOWEL SIGN VOCALIC R + key { [ 0x1000915, 0x1000916 ] }; // KA, KHA + + key { [ 0x1000937, 0x100090B ] }; // SSA, VOCALIC R (RRI) + key { [ 0x100092C, 0x100092D ] }; // BA, BHA + key { [ 0x1000941, 0x1000942 ] }; // VOWEL SIGN HRSHWA U, VOWEL SIGN DIRGHA U (UU) + key { [ 0x1000939, 0x1000922 ] }; // HA, DDHA + key { [ 0x1000913, 0x1000914 ] }; // O, AU + key { [ 0x1000905, 0x1000906 ] }; // A, AA + key { [ 0x1000932, 0x1000919 ] }; // LA, NGA + key { [ comma, 0x1000935 ] }; // VA + key { [ 0x1000964, 0x1000965 ] }; // PURNA VIRAM, DIRGHA VIRAM + + include "group(olpc)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/olpc b/xorg-server/xkeyboard-config/symbols/olpc index 4fda9949c..9e74e47b8 100644 --- a/xorg-server/xkeyboard-config/symbols/olpc +++ b/xorg-server/xkeyboard-config/symbols/olpc @@ -1,22 +1,21 @@ -// $XKeyboardConfig$ -// -// Created by Bernardo Innocenti -// -// Additional symbol definitions for the OLPC keyboards -// - -alphanumeric_keys modifier_keys -xkb_symbols "olpc" { - include "pc(pc105)" - - modifier_map Mod1 { KP_Home }; // KP_Home is the "square" game key - modifier_map Mod3 { KP_End }; // KP_End is the "tick" game key - modifier_map Mod4 { KP_Prior }; // KP_Prior is the "O" game key - modifier_map Mod5 { KP_Next }; // KP_Next is the "X" game key - - key { [ XF86Search ] }; // search key - key { [ XF86Meeting ] }; // fn+search key - key { [ XF86Start ] }; // gear key (fn+space) - key { [ XF86TaskPane ] }; // frame key (the top-right key) - key { [ XF86Messenger ] }; // overlay key (next to frame key) -}; +// +// Created by Bernardo Innocenti +// +// Additional symbol definitions for the OLPC keyboards +// + +alphanumeric_keys modifier_keys +xkb_symbols "olpc" { + include "pc(pc105)" + + modifier_map Mod1 { KP_Home }; // KP_Home is the "square" game key + modifier_map Mod3 { KP_End }; // KP_End is the "tick" game key + modifier_map Mod4 { KP_Prior }; // KP_Prior is the "O" game key + modifier_map Mod5 { KP_Next }; // KP_Next is the "X" game key + + key { [ XF86Search ] }; // search key + key { [ XF86Meeting ] }; // fn+search key + key { [ XF86Start ] }; // gear key (fn+space) + key { [ XF86TaskPane ] }; // frame key (the top-right key) + key { [ XF86Messenger ] }; // overlay key (next to frame key) +}; diff --git a/xorg-server/xkeyboard-config/symbols/pc b/xorg-server/xkeyboard-config/symbols/pc index a6b2063d5..7ccb36dd2 100644 --- a/xorg-server/xkeyboard-config/symbols/pc +++ b/xorg-server/xkeyboard-config/symbols/pc @@ -1,8 +1,3 @@ -// $XKeyboardConfig$ - -// -// $XFree86: xc/programs/xkbcomp/symbols/pc,v 1.9 2003/06/09 19:59:46 dawes Exp $ - default partial alphanumeric_keys modifier_keys xkb_symbols "pc105" { @@ -145,4 +140,3 @@ xkb_symbols "editing" { key { [ Down ] }; key { [ Right ] }; }; - diff --git a/xorg-server/xkeyboard-config/symbols/ph b/xorg-server/xkeyboard-config/symbols/ph index 9ed2112e8..3681562ff 100644 --- a/xorg-server/xkeyboard-config/symbols/ph +++ b/xorg-server/xkeyboard-config/symbols/ph @@ -994,6 +994,3 @@ xkb_symbols "dvorak-bay" { // ┃Ctrl ┃Super ┃Alt ┃ ␣ Space Space ␣ ┃AltGr ⇮┃Meta ┃Menu ┃Ctrl ┃ // ┗━━━━━━━┻━━━━━━━┻━━━━━━━┹─────────────────────────────┺━━━━━━━┻━━━━━━━┻━━━━━━━┻━━━━━━━┛ // - - - diff --git a/xorg-server/xkeyboard-config/symbols/pk b/xorg-server/xkeyboard-config/symbols/pk index c240bb119..586215958 100644 --- a/xorg-server/xkeyboard-config/symbols/pk +++ b/xorg-server/xkeyboard-config/symbols/pk @@ -1,5 +1,3 @@ -// $XKeyboardConfig$ - // Urdu keymap // Developed by: // Zaeem Arshad @@ -8,7 +6,6 @@ //Alt key combinations are yet to be put in. The unavailable keys are those which do not have a corresponding //glyph in unicode. // based on a keyboard map from an 'xkb/symbols/ur' file -// $XFree86$ partial default alphanumeric_keys xkb_symbols "urd-phonetic" { diff --git a/xorg-server/xkeyboard-config/symbols/pl b/xorg-server/xkeyboard-config/symbols/pl index 9ac908779..a90198e78 100644 --- a/xorg-server/xkeyboard-config/symbols/pl +++ b/xorg-server/xkeyboard-config/symbols/pl @@ -1,354 +1,350 @@ -// $XKeyboardConfig$ - -// based on a keyboard map from an 'xkb/symbols/pl' file -// -// $XFree86: xc/programs/xkbcomp/symbols/pl,v 1.3 2003/04/19 12:22:12 pascal Exp $ - -partial default alphanumeric_keys -xkb_symbols "basic" { - - include "latin" - - name[Group1]="Poland"; - - key { [ q, Q ] }; - key { [ w, W ] }; - key { [ e, E, eogonek, Eogonek ] }; - key { [ o, O, oacute, Oacute ] }; - - key { [ a, A, aogonek, Aogonek ] }; - key { [ s, S, sacute, Sacute ] }; - key { [ f, F ] }; - - key { [ z, Z, zabovedot, Zabovedot ] }; - key { [ x, X, zacute, Zacute ] }; - key { [ c, C, cacute, Cacute ] }; - key { [ n, N, nacute, Nacute ] }; - - include "kpdl(comma)" - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "qwertz" { - - // Describes the differences between a very simple en_US - // keyboard and a very simple QWERTZ Polish keybaord - - include "latin(type3)" - - name[Group1]="Poland - qwertz"; - - key { [ 1, exclam, asciitilde, exclamdown ] }; - key { [ 2, quotedbl, dead_caron, oneeighth ] }; - key { [ 3, numbersign, dead_circumflex, sterling ] }; - key { [ 4, dollar, dead_breve, dollar ] }; - key { [ 5, percent, degree, threeeighths ] }; - key { [ 6, ampersand, dead_ogonek, fiveeighths ] }; - key { [ 7, slash, dead_grave, seveneighths ] }; - key { [ 8, parenleft, dead_abovedot, trademark ] }; - key { [ 9, parenright, dead_acute, plusminus ] }; - key { [ 0, equal, dead_doubleacute, degree ] }; - key { [ plus, question, dead_diaeresis, questiondown ] }; - key { [apostrophe, asterisk, dead_cedilla, dead_ogonek ] }; - - key { [ q, Q ] }; - key { [ w, W ] }; - key { [ e, E, EuroSign, cent ] }; - key { [ zabovedot, nacute, division, dead_abovering ] }; - key { [ sacute, cacute, multiply, dead_macron ] }; - - key { [ s, S, dstroke, section ] }; - key { [ d, D, Dstroke, ETH ] }; - key { [ f, F ] }; - key { [ k, K, kra, ampersand ] }; - key { [ l, L, lstroke, Lstroke ] }; - key { [ lstroke, Lstroke, dollar, dead_doubleacute ] }; - key { [ aogonek, eogonek, ssharp, dead_caron ] }; - key { [ abovedot, dead_ogonek, notsign, notsign ] }; - - key { [ oacute, zacute, dead_grave, dead_breve ] }; - key { [ c, C, cent, copyright ] }; - key { [ minus, underscore, dead_belowdot, dead_abovedot ] }; - - include "kpdl(comma)" - - include "level3(ralt_switch)" -}; - -// Polish Dvorak keymaps -// by Rafal Rzepecki - -// The base keymap "pl" places Polish quotes on quotemark key and -// moves the dead symbols from there to "1/!" key. If you are used to common -// dead keys placement, you could use "pl_altquotes"; in this layout -// dead keys remain in the old place, whereas Polish quotes are placed on the -// "1/!" key. If you do not use Polish quotes at all, you can use "pl_basic" map. - -// Basic Polish keymap (without Polish quotes) -partial alphanumeric_keys -xkb_symbols "dvorak" { - include "us(dvorak)" - - name[Group1] = "Poland - Dvorak"; - - key { [ c, C, cacute, Cacute ] }; - key { [ l, L, lstroke, Lstroke ] }; - key { [ a, A, aogonek, Aogonek ] }; - key { [ o, O, oacute, Oacute ] }; - key { [ e, E, eogonek, Eogonek ] }; - key { [ n, N, nacute, Nacute ] }; - key { [ s, S, sacute, Sacute ] }; - key { [ v, V, zacute, Zacute ] }; - key { [ z, Z, zabovedot, Zabovedot ] }; - - include "kpdl(comma)" - - // this to allow writing ALL CAPS with a Shift key - include "level3(ralt_switch)" - - // use one of compose:* options to choose Multi_key, if you will, - // or layout +level3(ralt_switch_multikey) to revert standard behaviour -}; - -// Default Polish keymap with Polish quotes on quotemark key -partial alphanumeric_keys -xkb_symbols "dvorak_quotes" { - include "pl(dvorak)" - - name[Group1] = "Poland - Dvorak, Polish quotes on quotemark key"; - - key { [ apostrophe, quotedbl, doublelowquotemark, rightdoublequotemark ] }; - - // Dead symbols moved to this key - key { [ 1, exclam, dead_acute, dead_diaeresis ] }; -}; - -// Polish keymap with Polish quotes on key "1/!" -partial alphanumeric_keys -xkb_symbols "dvorak_altquotes" { - include "pl(dvorak)" - - name[Group1] = "Poland - Dvorak, Polish quotes on key 1"; - - key { [ 1, exclam, doublelowquotemark, rightdoublequotemark ] }; -}; - -// Polish Programmer Dvorak keymap by Michal Nazarewicz -// based on Programmer Dvorak by Roland Kaufmann -// and Polish Dvorak keymaps by Rafal Rzepecki { [ ampersand, percent, doublelowquotemark, rightdoublequotemark ] }; - - // symbols row, right side - - // upper row, left side - - // // upper row, right side - key { [ c, C, cacute, Cacute ] }; - key { [ l, L, lstroke, Lstroke ] }; - - // home row, left side - key { [ a, A, aogonek, Aogonek ], type[Group1] = "EIGHT_LEVEL_ALPHABETIC" }; - key { [ o, O, oacute, Oacute ] }; - key { [ e, E, eogonek, Eogonek ] }; - - // home row, right side - key { [ n, N, nacute, Nacute ] }; - key { [ s, S, sacute, Sacute ] }; - key { [ minus, underscore, hyphen ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; - key { [ backslash, bar ] }; - - // lower row, left side - key { [ j, J, doublelowquotemark, rightdoublequotemark ] }; - key { [ k, K, leftdoublequotemark, leftsinglequotemark ] }; - key { [ x, X, zacute, Zacute ] }; - - // lower row, right side - key { [ b, B, rightdoublequotemark, rightsinglequotemark ] }; - key { [ v, V, zacute, Zacute ] }; - key { [ z, Z, zabovedot, Zabovedot ] }; - - include "kpdl(comma)" - - // this to allow writing ALL CAPS with a Shift key - include "level3(ralt_switch)" - - // use one of compose:* options to choose Multi_key, if you will, - // or layout +level3(ralt_switch_multikey) to revert standard behaviour -}; - - -partial alphanumeric_keys -xkb_symbols "csb" { - - include "latin" - - name[Group1]="Poland - Kashubian"; - - key { [ q, Q ] }; - key { [ w, W ] }; - key { [ e, E, eacute, Eacute ] }; - key { [ r, R, ediaeresis, Ediaeresis ] }; - key { [ y, Y, EuroSign, cent ] }; - key { [ u, U, ugrave, Ugrave ] }; - key { [ i, I, ograve, Ograve ] }; - key { [ o, O, oacute, Oacute ] }; - key { [ p, P, ocircumflex, Ocircumflex ] }; - - key { [ a, A, aogonek, Aogonek ] }; - key { [ s, S, atilde, Atilde ] }; - key { [ f, F ] }; - key { [ l, L, lstroke, Lstroke ] }; - - key { [ z, Z, zabovedot, Zabovedot ] }; - key { [ n, N, nacute, Nacute ] }; - - include "kpdl(comma)" - - include "level3(ralt_switch)" -}; - -// Russian Polish-phonetic Dvorak -// by Adrian Dziubek -// -// This layout aims to enable Polish Dvorak users to type with Russian -// Cyrillic alphabet by using the sound correspondence between Polish and -// Russian languages. -// -// This keyboard should be intuitive. Please let me know, if my intuition -// lets You down. -// -// The guidelines used: -// - no Cyrillic symbols are placed on punctuation symbols, -// - visual similarities are ignored if there is a sound correspondence: -// no Cyrillic_es on c, no Cyrillic_er on p, no Cyrillic_ha on x etc., -// - the Latin symbols that have close sound correspondence (as read in Polish) -// to Cyrillic symbols (as read in Russian) are mapped respectively: -// * j -> Cyrillic_shorti, -// * k -> Cyrillic_ka, -// * b -> Cyrillic_be, -// * m -> Cyrillic_em, -// * w -> Cyrillic_ve, -// * z -> Cyrillic_ze -// * a -> Cyrillic_a, -// * o -> Cyrillic_o, -// * u -> Cyrillic_u, -// * i -> Cyrillic_i, -// * d -> Cyrillic_de, -// * h -> Cyrillic_ha, -// * t -> Cyrillic_te, -// * n -> Cyrillic_en, -// * s -> Cyrillic_es, -// * p -> Cyrillic_pe, -// * y -> Cyrillic_yeru, -// * f -> Cyrillic_ef, -// * g -> Cyrillic_ghe, -// * c -> Cyrillic_tse, -// * r -> Cyrillic_er, -// * l -> Cyrillic_el, -// - ...and little more distant: -// * AltGr + s (sacute) -> Cyrillic_sha, -// * AltGr + z (zabovedot) -> Cyrillic_zhe, -// * AltGr + c (cacute) -> Cyrillic_che, -// - the soft versions of Russian vowels are accessible through AltGr + vowel: -// * AltGr + a -> Cyrillic_ya, -// * AltGr + o -> Cyrillic_io, -// * AltGr + u -> Cyrillic_yu, -// - ...except for Cyrillic_ie which is more frequently used than Cyrillic_e: -// * AltGr + e -> Cyrillic_e, -// * e -> Cyrillic_ie, -// - q is also mapped to Cyrillic_ya, following the US phonetic keyboard -// choice, as Cyrillic_ya and Cyrillic_a are both often used: -// * q -> Cyrillic_ya, -// - the soft and hard symbols that have no Polish counterparts are mapped -// to rarely used in Polish x character: -// * x -> Cyrillic_softsign -// * AltGr + x -> Cyrillic_hardsign, -// - the soft sign is additionally available as AltGr + consonant combination -// for every consonant that can be softened or separated by soft sign: -// * AltGr + l -> Cyrillic_softsign, -// * AltGr + d -> Cyrillic_softsign, -// * AltGr + n -> Cyrillic_softsign, -// * AltGr + r -> Cyrillic_softsign, -// * AltGr + t -> Cyrillic_softsign, -// * AltGr + p -> Cyrillic_softsign, -// - ...and also because of visual similarity under level3 b: -// * AltGr + b -> Cyrillic_softsign, -// * Shift + AltGr + b -> Cyrillic_hardsign, -// - the Cyrillic_shcha symbol is placed under AltGr + w (visual similarity): -// * AltGr + w -> Cyrillic_shcha -// - v, also rarely unused in Polish is mapped like w: -// * v -> Cyrillic_ve, -// -partial alphanumeric_keys -xkb_symbols "ru_phonetic_dvorak" { - include "us(dvorak)" - - name[Group1] = "Poland - Russian phonetic Dvorak"; - - // lower row - key { [ Cyrillic_ya, Cyrillic_YA ] }; - key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; - key { [ Cyrillic_ka, Cyrillic_KA ] }; - key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; - key { [ Cyrillic_be, Cyrillic_BE, Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; - key { [ Cyrillic_ve, Cyrillic_VE, Cyrillic_shcha, Cyrillic_SHCHA ] }; - key { [ Cyrillic_ve, Cyrillic_VE, Cyrillic_shcha, Cyrillic_SHCHA ] }; - key { [ Cyrillic_ze, Cyrillic_ZE, Cyrillic_zhe, Cyrillic_ZHE ] }; - // home row - key { [ Cyrillic_a, Cyrillic_A, Cyrillic_ya, Cyrillic_YA ] }; - key { [ Cyrillic_o, Cyrillic_O, Cyrillic_io, Cyrillic_IO ] }; - key { [ Cyrillic_ie, Cyrillic_IE, Cyrillic_e, Cyrillic_E ] }; - key { [ Cyrillic_u, Cyrillic_U, Cyrillic_yu, Cyrillic_YU ] }; - key { [ Cyrillic_i, Cyrillic_I ] }; - key { [ Cyrillic_de, Cyrillic_DE, Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_ha, Cyrillic_HA ] }; - key { [ Cyrillic_te, Cyrillic_TE, Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_en, Cyrillic_EN, Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_es, Cyrillic_ES, Cyrillic_sha, Cyrillic_SHA ] }; - // upper row - key { [ Cyrillic_pe, Cyrillic_PE, Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_yeru, Cyrillic_YERU ] }; - key { [ Cyrillic_ef, Cyrillic_EF ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key { [ Cyrillic_tse, Cyrillic_TSE, Cyrillic_che, Cyrillic_CHE ] }; - key { [ Cyrillic_er, Cyrillic_ER, Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_el, Cyrillic_EL, Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; - - include "kpdl(comma)" - - include "level3(ralt_switch)" -}; +// based on a keyboard map from an 'xkb/symbols/pl' file + +partial default alphanumeric_keys +xkb_symbols "basic" { + + include "latin" + + name[Group1]="Poland"; + + key { [ q, Q ] }; + key { [ w, W ] }; + key { [ e, E, eogonek, Eogonek ] }; + key { [ o, O, oacute, Oacute ] }; + + key { [ a, A, aogonek, Aogonek ] }; + key { [ s, S, sacute, Sacute ] }; + key { [ f, F ] }; + + key { [ z, Z, zabovedot, Zabovedot ] }; + key { [ x, X, zacute, Zacute ] }; + key { [ c, C, cacute, Cacute ] }; + key { [ n, N, nacute, Nacute ] }; + + include "kpdl(comma)" + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "qwertz" { + + // Describes the differences between a very simple en_US + // keyboard and a very simple QWERTZ Polish keybaord + + include "latin(type3)" + + name[Group1]="Poland - qwertz"; + + key { [ 1, exclam, asciitilde, exclamdown ] }; + key { [ 2, quotedbl, dead_caron, oneeighth ] }; + key { [ 3, numbersign, dead_circumflex, sterling ] }; + key { [ 4, dollar, dead_breve, dollar ] }; + key { [ 5, percent, degree, threeeighths ] }; + key { [ 6, ampersand, dead_ogonek, fiveeighths ] }; + key { [ 7, slash, dead_grave, seveneighths ] }; + key { [ 8, parenleft, dead_abovedot, trademark ] }; + key { [ 9, parenright, dead_acute, plusminus ] }; + key { [ 0, equal, dead_doubleacute, degree ] }; + key { [ plus, question, dead_diaeresis, questiondown ] }; + key { [apostrophe, asterisk, dead_cedilla, dead_ogonek ] }; + + key { [ q, Q ] }; + key { [ w, W ] }; + key { [ e, E, EuroSign, cent ] }; + key { [ zabovedot, nacute, division, dead_abovering ] }; + key { [ sacute, cacute, multiply, dead_macron ] }; + + key { [ s, S, dstroke, section ] }; + key { [ d, D, Dstroke, ETH ] }; + key { [ f, F ] }; + key { [ k, K, kra, ampersand ] }; + key { [ l, L, lstroke, Lstroke ] }; + key { [ lstroke, Lstroke, dollar, dead_doubleacute ] }; + key { [ aogonek, eogonek, ssharp, dead_caron ] }; + key { [ abovedot, dead_ogonek, notsign, notsign ] }; + + key { [ oacute, zacute, dead_grave, dead_breve ] }; + key { [ c, C, cent, copyright ] }; + key { [ minus, underscore, dead_belowdot, dead_abovedot ] }; + + include "kpdl(comma)" + + include "level3(ralt_switch)" +}; + +// Polish Dvorak keymaps +// by Rafal Rzepecki + +// The base keymap "pl" places Polish quotes on quotemark key and +// moves the dead symbols from there to "1/!" key. If you are used to common +// dead keys placement, you could use "pl_altquotes"; in this layout +// dead keys remain in the old place, whereas Polish quotes are placed on the +// "1/!" key. If you do not use Polish quotes at all, you can use "pl_basic" map. + +// Basic Polish keymap (without Polish quotes) +partial alphanumeric_keys +xkb_symbols "dvorak" { + include "us(dvorak)" + + name[Group1] = "Poland - Dvorak"; + + key { [ c, C, cacute, Cacute ] }; + key { [ l, L, lstroke, Lstroke ] }; + key { [ a, A, aogonek, Aogonek ] }; + key { [ o, O, oacute, Oacute ] }; + key { [ e, E, eogonek, Eogonek ] }; + key { [ n, N, nacute, Nacute ] }; + key { [ s, S, sacute, Sacute ] }; + key { [ v, V, zacute, Zacute ] }; + key { [ z, Z, zabovedot, Zabovedot ] }; + + include "kpdl(comma)" + + // this to allow writing ALL CAPS with a Shift key + include "level3(ralt_switch)" + + // use one of compose:* options to choose Multi_key, if you will, + // or layout +level3(ralt_switch_multikey) to revert standard behaviour +}; + +// Default Polish keymap with Polish quotes on quotemark key +partial alphanumeric_keys +xkb_symbols "dvorak_quotes" { + include "pl(dvorak)" + + name[Group1] = "Poland - Dvorak, Polish quotes on quotemark key"; + + key { [ apostrophe, quotedbl, doublelowquotemark, rightdoublequotemark ] }; + + // Dead symbols moved to this key + key { [ 1, exclam, dead_acute, dead_diaeresis ] }; +}; + +// Polish keymap with Polish quotes on key "1/!" +partial alphanumeric_keys +xkb_symbols "dvorak_altquotes" { + include "pl(dvorak)" + + name[Group1] = "Poland - Dvorak, Polish quotes on key 1"; + + key { [ 1, exclam, doublelowquotemark, rightdoublequotemark ] }; +}; + +// Polish Programmer Dvorak keymap by Michal Nazarewicz +// based on Programmer Dvorak by Roland Kaufmann +// and Polish Dvorak keymaps by Rafal Rzepecki { [ ampersand, percent, doublelowquotemark, rightdoublequotemark ] }; + + // symbols row, right side + + // upper row, left side + + // // upper row, right side + key { [ c, C, cacute, Cacute ] }; + key { [ l, L, lstroke, Lstroke ] }; + + // home row, left side + key { [ a, A, aogonek, Aogonek ], type[Group1] = "EIGHT_LEVEL_ALPHABETIC" }; + key { [ o, O, oacute, Oacute ] }; + key { [ e, E, eogonek, Eogonek ] }; + + // home row, right side + key { [ n, N, nacute, Nacute ] }; + key { [ s, S, sacute, Sacute ] }; + key { [ minus, underscore, hyphen ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ backslash, bar ] }; + + // lower row, left side + key { [ j, J, doublelowquotemark, rightdoublequotemark ] }; + key { [ k, K, leftdoublequotemark, leftsinglequotemark ] }; + key { [ x, X, zacute, Zacute ] }; + + // lower row, right side + key { [ b, B, rightdoublequotemark, rightsinglequotemark ] }; + key { [ v, V, zacute, Zacute ] }; + key { [ z, Z, zabovedot, Zabovedot ] }; + + include "kpdl(comma)" + + // this to allow writing ALL CAPS with a Shift key + include "level3(ralt_switch)" + + // use one of compose:* options to choose Multi_key, if you will, + // or layout +level3(ralt_switch_multikey) to revert standard behaviour +}; + + +partial alphanumeric_keys +xkb_symbols "csb" { + + include "latin" + + name[Group1]="Poland - Kashubian"; + + key { [ q, Q ] }; + key { [ w, W ] }; + key { [ e, E, eacute, Eacute ] }; + key { [ r, R, ediaeresis, Ediaeresis ] }; + key { [ y, Y, EuroSign, cent ] }; + key { [ u, U, ugrave, Ugrave ] }; + key { [ i, I, ograve, Ograve ] }; + key { [ o, O, oacute, Oacute ] }; + key { [ p, P, ocircumflex, Ocircumflex ] }; + + key { [ a, A, aogonek, Aogonek ] }; + key { [ s, S, atilde, Atilde ] }; + key { [ f, F ] }; + key { [ l, L, lstroke, Lstroke ] }; + + key { [ z, Z, zabovedot, Zabovedot ] }; + key { [ n, N, nacute, Nacute ] }; + + include "kpdl(comma)" + + include "level3(ralt_switch)" +}; + +// Russian Polish-phonetic Dvorak +// by Adrian Dziubek +// +// This layout aims to enable Polish Dvorak users to type with Russian +// Cyrillic alphabet by using the sound correspondence between Polish and +// Russian languages. +// +// This keyboard should be intuitive. Please let me know, if my intuition +// lets You down. +// +// The guidelines used: +// - no Cyrillic symbols are placed on punctuation symbols, +// - visual similarities are ignored if there is a sound correspondence: +// no Cyrillic_es on c, no Cyrillic_er on p, no Cyrillic_ha on x etc., +// - the Latin symbols that have close sound correspondence (as read in Polish) +// to Cyrillic symbols (as read in Russian) are mapped respectively: +// * j -> Cyrillic_shorti, +// * k -> Cyrillic_ka, +// * b -> Cyrillic_be, +// * m -> Cyrillic_em, +// * w -> Cyrillic_ve, +// * z -> Cyrillic_ze +// * a -> Cyrillic_a, +// * o -> Cyrillic_o, +// * u -> Cyrillic_u, +// * i -> Cyrillic_i, +// * d -> Cyrillic_de, +// * h -> Cyrillic_ha, +// * t -> Cyrillic_te, +// * n -> Cyrillic_en, +// * s -> Cyrillic_es, +// * p -> Cyrillic_pe, +// * y -> Cyrillic_yeru, +// * f -> Cyrillic_ef, +// * g -> Cyrillic_ghe, +// * c -> Cyrillic_tse, +// * r -> Cyrillic_er, +// * l -> Cyrillic_el, +// - ...and little more distant: +// * AltGr + s (sacute) -> Cyrillic_sha, +// * AltGr + z (zabovedot) -> Cyrillic_zhe, +// * AltGr + c (cacute) -> Cyrillic_che, +// - the soft versions of Russian vowels are accessible through AltGr + vowel: +// * AltGr + a -> Cyrillic_ya, +// * AltGr + o -> Cyrillic_io, +// * AltGr + u -> Cyrillic_yu, +// - ...except for Cyrillic_ie which is more frequently used than Cyrillic_e: +// * AltGr + e -> Cyrillic_e, +// * e -> Cyrillic_ie, +// - q is also mapped to Cyrillic_ya, following the US phonetic keyboard +// choice, as Cyrillic_ya and Cyrillic_a are both often used: +// * q -> Cyrillic_ya, +// - the soft and hard symbols that have no Polish counterparts are mapped +// to rarely used in Polish x character: +// * x -> Cyrillic_softsign +// * AltGr + x -> Cyrillic_hardsign, +// - the soft sign is additionally available as AltGr + consonant combination +// for every consonant that can be softened or separated by soft sign: +// * AltGr + l -> Cyrillic_softsign, +// * AltGr + d -> Cyrillic_softsign, +// * AltGr + n -> Cyrillic_softsign, +// * AltGr + r -> Cyrillic_softsign, +// * AltGr + t -> Cyrillic_softsign, +// * AltGr + p -> Cyrillic_softsign, +// - ...and also because of visual similarity under level3 b: +// * AltGr + b -> Cyrillic_softsign, +// * Shift + AltGr + b -> Cyrillic_hardsign, +// - the Cyrillic_shcha symbol is placed under AltGr + w (visual similarity): +// * AltGr + w -> Cyrillic_shcha +// - v, also rarely unused in Polish is mapped like w: +// * v -> Cyrillic_ve, +// +partial alphanumeric_keys +xkb_symbols "ru_phonetic_dvorak" { + include "us(dvorak)" + + name[Group1] = "Poland - Russian phonetic Dvorak"; + + // lower row + key { [ Cyrillic_ya, Cyrillic_YA ] }; + key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; + key { [ Cyrillic_ka, Cyrillic_KA ] }; + key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; + key { [ Cyrillic_be, Cyrillic_BE, Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; + key { [ Cyrillic_ve, Cyrillic_VE, Cyrillic_shcha, Cyrillic_SHCHA ] }; + key { [ Cyrillic_ve, Cyrillic_VE, Cyrillic_shcha, Cyrillic_SHCHA ] }; + key { [ Cyrillic_ze, Cyrillic_ZE, Cyrillic_zhe, Cyrillic_ZHE ] }; + // home row + key { [ Cyrillic_a, Cyrillic_A, Cyrillic_ya, Cyrillic_YA ] }; + key { [ Cyrillic_o, Cyrillic_O, Cyrillic_io, Cyrillic_IO ] }; + key { [ Cyrillic_ie, Cyrillic_IE, Cyrillic_e, Cyrillic_E ] }; + key { [ Cyrillic_u, Cyrillic_U, Cyrillic_yu, Cyrillic_YU ] }; + key { [ Cyrillic_i, Cyrillic_I ] }; + key { [ Cyrillic_de, Cyrillic_DE, Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [ Cyrillic_te, Cyrillic_TE, Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_en, Cyrillic_EN, Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_es, Cyrillic_ES, Cyrillic_sha, Cyrillic_SHA ] }; + // upper row + key { [ Cyrillic_pe, Cyrillic_PE, Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_yeru, Cyrillic_YERU ] }; + key { [ Cyrillic_ef, Cyrillic_EF ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; + key { [ Cyrillic_tse, Cyrillic_TSE, Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_er, Cyrillic_ER, Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_el, Cyrillic_EL, Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; + + include "kpdl(comma)" + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/pt b/xorg-server/xkeyboard-config/symbols/pt index 509db14ea..951639603 100644 --- a/xorg-server/xkeyboard-config/symbols/pt +++ b/xorg-server/xkeyboard-config/symbols/pt @@ -1,8 +1,4 @@ -// $XKeyboardConfig$ - // based on a keyboard map from an 'xkb/symbols/pt' file -// -// $XFree86: xc/programs/xkbcomp/symbols/pt,v 1.2 2002/11/22 04:03:28 dawes Exp $ partial default alphanumeric_keys xkb_symbols "basic" { @@ -221,4 +217,4 @@ xkb_symbols "nativo-epo" { key { [ scircumflex, Scircumflex, ccedilla, Ccedilla ] }; key { [ gcircumflex, Gcircumflex, q, Q ] }; -}; \ No newline at end of file +}; diff --git a/xorg-server/xkeyboard-config/symbols/ro b/xorg-server/xkeyboard-config/symbols/ro index b2842bd79..9e9663cce 100644 --- a/xorg-server/xkeyboard-config/symbols/ro +++ b/xorg-server/xkeyboard-config/symbols/ro @@ -1,235 +1,233 @@ -// $XKeyboardConfig$ -// $XFree86: xc/programs/xkbcomp/symbols/ro,v 1.6 2003/09/08 13:12:51 pascal Exp $ -// -// Complete set of Romanian keyboards as described in the new Romanian standard -// SR 13392:2004 adopted in December 2004 by ASRO, "Asociatia de Standardizare -// din Romania". -// -// The default mapping is the RO_US/Programmers layout because of the lack of -// Romanian hardware keyboards. The primary standard layout is implemented as -// the "std" variant. If you're determined to get cedillas as in ISO-8859-2 -// (and not commabelow accents as in ISO-8859-16) use the defined variants -// "cedilla" for the default layout or "std_cedilla" for the standard one. -// Pre-Vista MS compatible layout included (use the "winkeys" variant). -// -// Created by Cristian Gafton, (C) 2000 -// Modified by Marius Andreiana, (C) 2001 -// Completed by Misu Moldovan, (C) 2001, 2004-2008. -// v 1.4 - - -partial default alphanumeric_keys -xkb_symbols "basic" { -// This RO_US/Programmers layout, although the secondary layout in the -// Romanian standard, has always been the "de facto" standard in the -// Linux/Unix world. It is implemented here as the default layout and it's -// fully compatible with an US keyboard (Euro on AltGr+5 doesn't count). - - include "us" - - name[Group1]="Romania"; - - key { [ 1, exclam, dead_tilde ] }; - key { [ 2, at, dead_caron ] }; - key { [ 3, numbersign, dead_circumflex ] }; - key { [ 4, dollar, dead_breve ] }; - key { [ 5, percent, dead_abovering ] }; - key { [ 6, asciicircum, dead_ogonek ] }; - key { [ 7, ampersand, dead_grave ] }; - key { [ 8, asterisk, dead_abovedot ] }; - key { [ 9, parenleft, dead_acute ] }; - key { [ 0, parenright, dead_doubleacute ] }; - key { [ minus, underscore, dead_diaeresis, endash ] }; - key { [ equal, plus, dead_cedilla, plusminus ] }; - key { [ q, Q, acircumflex, Acircumflex ] }; - key { [ w, W, ssharp ] }; - key { [ e, E, EuroSign ] }; - key { [ t, T, 0x100021b, 0x100021a ] }; - key { [ i, I, icircumflex, Icircumflex ] }; - key { [ p, P, section ] }; - key { [ bracketleft, braceleft, doublelowquotemark ] }; - key { [ bracketright, braceright, rightdoublequotemark ] }; - key { [ a, A, abreve, Abreve ] }; - key { [ s, S, 0x1000219, 0x1000218 ] }; - key { [ d, D, dstroke, Dstroke ] }; - key { [ l, L, lstroke, Lstroke ] }; - key { [ backslash, bar ] }; - key { [ c, C, copyright ] }; - key { [ comma, less, guillemotleft ] }; - key { [ period, greater, guillemotright ] }; - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "cedilla" { - // Variant of the basic layout with cedillas. - // Implements S and T with cedilllas as in ISO-8859-2. - // Included for compatibility reasons (this used to be the def variant). - - include "ro(basic)" - - name[Group1]="Romania - Cedilla"; - - key { [ t, T, tcedilla, Tcedilla ] }; - key { [ s, S, scedilla, Scedilla ] }; -}; - -partial alphanumeric_keys -xkb_symbols "std" { - // Primary layout in the new Romanian standard. - // Implemented here as a variant because of the lack of hardware - // Romanian keyboards and because of the predilection of Romanian - // X users towards the secondary layout from the new standard. - - include "us" - - name[Group1]="Romania - Standard"; - - key { [ doublelowquotemark, rightdoublequotemark, grave, asciitilde ] }; - key { [ 1, exclam, dead_tilde ] }; - key { [ 2, at, dead_caron ] }; - key { [ 3, numbersign, dead_circumflex ] }; - key { [ 4, dollar, dead_breve ] }; - key { [ 5, percent, dead_abovering ] }; - key { [ 6, asciicircum, dead_ogonek ] }; - key { [ 7, ampersand, dead_grave ] }; - key { [ 8, asterisk, dead_abovedot ] }; - key { [ 9, parenleft, dead_acute ] }; - key { [ 0, parenright, dead_doubleacute ] }; - key { [ minus, underscore, dead_diaeresis, endash ] }; - key { [ equal, plus, dead_cedilla, plusminus ] }; - key { [ e, E, EuroSign ] }; - key { [ p, P, section ] }; - key { [ abreve, Abreve, bracketleft, braceleft ] }; - key { [ icircumflex, Icircumflex, bracketright, braceright ] }; - key { [ acircumflex, Acircumflex, backslash, bar ] }; - key { [ s, S, ssharp ] }; - key { [ d, D, dstroke, Dstroke ] }; - key { [ l, L, lstroke, Lstroke ] }; - key { [ 0x1000219, 0x1000218, semicolon, colon ] }; - key { [ 0x100021b, 0x100021a, apostrophe, quotedbl ] }; - key { [ backslash, bar ] }; - key { [ c, C, copyright ] }; - key { [ comma, semicolon, less, guillemotleft ] }; - key { [ period, colon, greater, guillemotright ] }; - - key { [ KP_Delete, KP_Separator ] }; - - include "level3(ralt_switch)" -}; - - -partial alphanumeric_keys -xkb_symbols "std_cedilla" { - // Variant of the "std" layout with cedillas. - // Implements S and T with cedillas as in ISO-8859-2. - // Included for compatibility reasons. - - include "ro(std)" - - name[Group1]="Romania - Standard (Cedilla)"; - - key { [ scedilla, Scedilla ] }; - key { [ tcedilla, Tcedilla ] }; -}; - - -partial alphanumeric_keys -xkb_symbols "winkeys" { - // Describes the differences between a very simple US/ASCII - // keyboard and a very simple Romanian keybaord - // Created by Manfred Pohler, (C) 2003 - - include "latin" - - name[Group1]="Romania - Winkeys"; - - // Alphanumeric section - key { [ bracketright, bracketleft ] }; - - key { [ 1, exclam, asciitilde, asciitilde ] }; - key { [ 2, quotedbl, at, at ] }; - key { [ 3, numbersign, asciicircum,asciicircum ] }; - key { [ 4, currency ] }; - key { [ 5, percent, degree, degree ] }; - key { [ 6, ampersand ] }; - key { [ 7, slash, grave, grave ] }; - key { [ 8, parenleft ] }; - key { [ 9, parenright ] }; - key { [ 0, equal ] }; - key { [ plus, question ] }; - key { [ apostrophe, asterisk ] }; - - key { [ q, Q, backslash, backslash ] }; - key { [ w, W, bar, bar ] }; - key { [ e, E, EuroSign, EuroSign ] }; - key { [ t, T ] }; - key { [ z, Z ] }; - key { [ u, U ] }; - key { [ i, I ] }; - key { [ abreve, Abreve, division, division ] }; - key { [ icircumflex, Icircumflex, multiply, multiply ] }; - - key { [ f, F ] }; - key { [ g, G ] }; - key { [ scedilla, Scedilla, dollar, dollar ] }; - key { [ tcedilla, Tcedilla, ssharp, ssharp ] }; - - key { [ y, Y ] }; - key { [ b, B, braceleft, braceleft ] }; - key { [ n, N, braceright, braceright ] }; - key { [ m, M, section, section ] }; - key { [ comma, semicolon, less, less ] }; - key { [ period, colon, greater, greater ] }; - key { [ minus, underscore ] }; - - key { [ acircumflex, Acircumflex ] }; - - // End alphanumeric section, begin "Keypad" - include "kpdl(comma)" - // End "Keypad" section - - include "level3(ralt_switch)" - -}; - -// Crimean Tatar (Crimean Turkish) layouts. -partial -xkb_symbols "crh_f" { - include "tr(crh_f)" - - name[Group1]="Romania - Crimean Tatar (Turkish F)"; -}; - -partial -xkb_symbols "crh_alt" { - include "tr(crh_alt)" - - name[Group1]="Romania - Crimean Tatar (Turkish Alt-Q)"; -}; - -partial -xkb_symbols "crh_dobruca1" { - include "tr(crh)" - - name[Group1]="Romania - Crimean Tatar (Dobruca-1 Q)"; - - key { [ t, T, tcedilla, Tcedilla ] }; - key { [ p, P, abreve, Abreve ] }; - - key { [ f, F, ibreve, Ibreve ] }; - key { [ iacute, Iacute, j, J ] }; - - key { [ m, M, trademark, masculine ] }; -}; - -partial -xkb_symbols "crh_dobruca2" { - include "ro(crh_dobruca1)" - - name[Group1]="Romania - Crimean Tatar (Dobruca-2 Q)"; - - key { [ f, F, iacute, Iacute ] }; - key { [ ibreve, Ibreve, j, J ] }; -}; +// +// Complete set of Romanian keyboards as described in the new Romanian standard +// SR 13392:2004 adopted in December 2004 by ASRO, "Asociatia de Standardizare +// din Romania". +// +// The default mapping is the RO_US/Programmers layout because of the lack of +// Romanian hardware keyboards. The primary standard layout is implemented as +// the "std" variant. If you're determined to get cedillas as in ISO-8859-2 +// (and not commabelow accents as in ISO-8859-16) use the defined variants +// "cedilla" for the default layout or "std_cedilla" for the standard one. +// Pre-Vista MS compatible layout included (use the "winkeys" variant). +// +// Created by Cristian Gafton, (C) 2000 +// Modified by Marius Andreiana, (C) 2001 +// Completed by Misu Moldovan, (C) 2001, 2004-2008. +// v 1.4 + + +partial default alphanumeric_keys +xkb_symbols "basic" { +// This RO_US/Programmers layout, although the secondary layout in the +// Romanian standard, has always been the "de facto" standard in the +// Linux/Unix world. It is implemented here as the default layout and it's +// fully compatible with an US keyboard (Euro on AltGr+5 doesn't count). + + include "us" + + name[Group1]="Romania"; + + key { [ 1, exclam, dead_tilde ] }; + key { [ 2, at, dead_caron ] }; + key { [ 3, numbersign, dead_circumflex ] }; + key { [ 4, dollar, dead_breve ] }; + key { [ 5, percent, dead_abovering ] }; + key { [ 6, asciicircum, dead_ogonek ] }; + key { [ 7, ampersand, dead_grave ] }; + key { [ 8, asterisk, dead_abovedot ] }; + key { [ 9, parenleft, dead_acute ] }; + key { [ 0, parenright, dead_doubleacute ] }; + key { [ minus, underscore, dead_diaeresis, endash ] }; + key { [ equal, plus, dead_cedilla, plusminus ] }; + key { [ q, Q, acircumflex, Acircumflex ] }; + key { [ w, W, ssharp ] }; + key { [ e, E, EuroSign ] }; + key { [ t, T, 0x100021b, 0x100021a ] }; + key { [ i, I, icircumflex, Icircumflex ] }; + key { [ p, P, section ] }; + key { [ bracketleft, braceleft, doublelowquotemark ] }; + key { [ bracketright, braceright, rightdoublequotemark ] }; + key { [ a, A, abreve, Abreve ] }; + key { [ s, S, 0x1000219, 0x1000218 ] }; + key { [ d, D, dstroke, Dstroke ] }; + key { [ l, L, lstroke, Lstroke ] }; + key { [ backslash, bar ] }; + key { [ c, C, copyright ] }; + key { [ comma, less, guillemotleft ] }; + key { [ period, greater, guillemotright ] }; + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "cedilla" { + // Variant of the basic layout with cedillas. + // Implements S and T with cedilllas as in ISO-8859-2. + // Included for compatibility reasons (this used to be the def variant). + + include "ro(basic)" + + name[Group1]="Romania - Cedilla"; + + key { [ t, T, tcedilla, Tcedilla ] }; + key { [ s, S, scedilla, Scedilla ] }; +}; + +partial alphanumeric_keys +xkb_symbols "std" { + // Primary layout in the new Romanian standard. + // Implemented here as a variant because of the lack of hardware + // Romanian keyboards and because of the predilection of Romanian + // X users towards the secondary layout from the new standard. + + include "us" + + name[Group1]="Romania - Standard"; + + key { [ doublelowquotemark, rightdoublequotemark, grave, asciitilde ] }; + key { [ 1, exclam, dead_tilde ] }; + key { [ 2, at, dead_caron ] }; + key { [ 3, numbersign, dead_circumflex ] }; + key { [ 4, dollar, dead_breve ] }; + key { [ 5, percent, dead_abovering ] }; + key { [ 6, asciicircum, dead_ogonek ] }; + key { [ 7, ampersand, dead_grave ] }; + key { [ 8, asterisk, dead_abovedot ] }; + key { [ 9, parenleft, dead_acute ] }; + key { [ 0, parenright, dead_doubleacute ] }; + key { [ minus, underscore, dead_diaeresis, endash ] }; + key { [ equal, plus, dead_cedilla, plusminus ] }; + key { [ e, E, EuroSign ] }; + key { [ p, P, section ] }; + key { [ abreve, Abreve, bracketleft, braceleft ] }; + key { [ icircumflex, Icircumflex, bracketright, braceright ] }; + key { [ acircumflex, Acircumflex, backslash, bar ] }; + key { [ s, S, ssharp ] }; + key { [ d, D, dstroke, Dstroke ] }; + key { [ l, L, lstroke, Lstroke ] }; + key { [ 0x1000219, 0x1000218, semicolon, colon ] }; + key { [ 0x100021b, 0x100021a, apostrophe, quotedbl ] }; + key { [ backslash, bar ] }; + key { [ c, C, copyright ] }; + key { [ comma, semicolon, less, guillemotleft ] }; + key { [ period, colon, greater, guillemotright ] }; + + key { [ KP_Delete, KP_Separator ] }; + + include "level3(ralt_switch)" +}; + + +partial alphanumeric_keys +xkb_symbols "std_cedilla" { + // Variant of the "std" layout with cedillas. + // Implements S and T with cedillas as in ISO-8859-2. + // Included for compatibility reasons. + + include "ro(std)" + + name[Group1]="Romania - Standard (Cedilla)"; + + key { [ scedilla, Scedilla ] }; + key { [ tcedilla, Tcedilla ] }; +}; + + +partial alphanumeric_keys +xkb_symbols "winkeys" { + // Describes the differences between a very simple US/ASCII + // keyboard and a very simple Romanian keybaord + // Created by Manfred Pohler, (C) 2003 + + include "latin" + + name[Group1]="Romania - Winkeys"; + + // Alphanumeric section + key { [ bracketright, bracketleft ] }; + + key { [ 1, exclam, asciitilde, asciitilde ] }; + key { [ 2, quotedbl, at, at ] }; + key { [ 3, numbersign, asciicircum,asciicircum ] }; + key { [ 4, currency ] }; + key { [ 5, percent, degree, degree ] }; + key { [ 6, ampersand ] }; + key { [ 7, slash, grave, grave ] }; + key { [ 8, parenleft ] }; + key { [ 9, parenright ] }; + key { [ 0, equal ] }; + key { [ plus, question ] }; + key { [ apostrophe, asterisk ] }; + + key { [ q, Q, backslash, backslash ] }; + key { [ w, W, bar, bar ] }; + key { [ e, E, EuroSign, EuroSign ] }; + key { [ t, T ] }; + key { [ z, Z ] }; + key { [ u, U ] }; + key { [ i, I ] }; + key { [ abreve, Abreve, division, division ] }; + key { [ icircumflex, Icircumflex, multiply, multiply ] }; + + key { [ f, F ] }; + key { [ g, G ] }; + key { [ scedilla, Scedilla, dollar, dollar ] }; + key { [ tcedilla, Tcedilla, ssharp, ssharp ] }; + + key { [ y, Y ] }; + key { [ b, B, braceleft, braceleft ] }; + key { [ n, N, braceright, braceright ] }; + key { [ m, M, section, section ] }; + key { [ comma, semicolon, less, less ] }; + key { [ period, colon, greater, greater ] }; + key { [ minus, underscore ] }; + + key { [ acircumflex, Acircumflex ] }; + + // End alphanumeric section, begin "Keypad" + include "kpdl(comma)" + // End "Keypad" section + + include "level3(ralt_switch)" + +}; + +// Crimean Tatar (Crimean Turkish) layouts. +partial +xkb_symbols "crh_f" { + include "tr(crh_f)" + + name[Group1]="Romania - Crimean Tatar (Turkish F)"; +}; + +partial +xkb_symbols "crh_alt" { + include "tr(crh_alt)" + + name[Group1]="Romania - Crimean Tatar (Turkish Alt-Q)"; +}; + +partial +xkb_symbols "crh_dobruca1" { + include "tr(crh)" + + name[Group1]="Romania - Crimean Tatar (Dobruca-1 Q)"; + + key { [ t, T, tcedilla, Tcedilla ] }; + key { [ p, P, abreve, Abreve ] }; + + key { [ f, F, ibreve, Ibreve ] }; + key { [ iacute, Iacute, j, J ] }; + + key { [ m, M, trademark, masculine ] }; +}; + +partial +xkb_symbols "crh_dobruca2" { + include "ro(crh_dobruca1)" + + name[Group1]="Romania - Crimean Tatar (Dobruca-2 Q)"; + + key { [ f, F, iacute, Iacute ] }; + key { [ ibreve, Ibreve, j, J ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/rs b/xorg-server/xkeyboard-config/symbols/rs index 9aab69119..3929ff4ec 100644 --- a/xorg-server/xkeyboard-config/symbols/rs +++ b/xorg-server/xkeyboard-config/symbols/rs @@ -1,328 +1,327 @@ -// Bosnian, Croatian, Serbian and Slovenian XKB keyboard mapping -// (derived from "Danube" D.2) -// -// Danube D.2 from 2003-05-12 is available at http://srpski.org/dunav/ -// -// Original authors: -// Danilo Segan (Данило Шеган) -// Chusslove Illich (Часлав Илић) -// -// Danilo Segan : -// - Modified for inclusion in XFree86 -// - Further modifications on 2005-08-18 to support Bosnian, Croatian -// and Slovenian in xkeyboard-config -// -// $XKeyboardConfig$ - -default partial alphanumeric_keys -xkb_symbols "basic" { - - name[Group1]= "Serbia"; - - include "rs(cyrlevel3)" - include "rs(common)" - include "rs(cyralpha)" - include "level3(ralt_switch)" -}; - - -partial alphanumeric_keys -xkb_symbols "latin" { - - name[Group1]= "Serbia - Latin"; - - include "latin(type3)" - include "rs(latalpha)" - include "rs(latlevel3)" - include "rs(common)" - include "level3(ralt_switch)" -}; - - -partial alphanumeric_keys -xkb_symbols "yz" { - // Cyrillic_zhe and Cyrillic_ze swapped. - - name[Group1]= "Serbia - Z and ZHE swapped"; - - include "rs(basic)" - - key { [ Cyrillic_zhe, Cyrillic_ZHE, any,any ] }; // y - key { [ Cyrillic_ze, Cyrillic_ZE, any,any ] }; // z -}; - -partial hidden alphanumeric_keys -xkb_symbols "common" { - // "Common" keys: keys which are same for both latin and cyrillic keyboards - - key.type[Group1] = "FOUR_LEVEL"; - - key { [ quoteleft, asciitilde, any,any ] }; // - key { [ 1, exclam, any,any ] }; // - key { [ 2, quotedbl, any,any ] }; // - key { [ 3, numbersign, any,any ] }; // - key { [ 4, dollar, any,any ] }; // - key { [ 5, percent, any,any ] }; // - key { [ 6, ampersand, any,any ] }; // - key { [ 7, slash, any,any ] }; // - key { [ 8, parenleft, any,any ] }; // - key { [ 9, parenright, any,any ] }; // - key { [ 0, equal, any,any ] }; // - key { [ apostrophe, question, any,any ] }; // - key { [ plus, asterisk, any,any ] }; // - - key { [ comma, semicolon, any,any ] }; // - key { [ period, colon, any,any ] }; // - key { [ minus, underscore, any,any ] }; // - - include "kpdl(comma)" -}; - -partial hidden alphanumeric_keys -xkb_symbols "cyralpha" { - - key.type[Group1] = "FOUR_LEVEL_ALPHABETIC"; - - key { [ Cyrillic_lje, Cyrillic_LJE, any,any ] }; // q - key { [ Cyrillic_nje, Cyrillic_NJE, any,any ] }; // w - key { [ Cyrillic_ie, Cyrillic_IE, any,any ] }; // e - key { [ Cyrillic_er, Cyrillic_ER, any,any ] }; // r - key { [ Cyrillic_te, Cyrillic_TE, any,any ] }; // t - key { [ Cyrillic_ze, Cyrillic_ZE, any,any ] }; // y - key { [ Cyrillic_u, Cyrillic_U, any,any ] }; // u - key { [ Cyrillic_i, Cyrillic_I, any,any ] }; // i - key { [ Cyrillic_o, Cyrillic_O, any,any ] }; // o - key { [ Cyrillic_pe, Cyrillic_PE, any,any ] }; // p - key { [ Cyrillic_sha, Cyrillic_SHA, any,any ] }; // [ { - key { [ Serbian_dje, Serbian_DJE, any,any ] }; // ] } - - key { [ Cyrillic_a, Cyrillic_A, any,any ] }; // a - key { [ Cyrillic_es, Cyrillic_ES, any,any ] }; // s - key { [ Cyrillic_de, Cyrillic_DE, any,any ] }; // d - key { [ Cyrillic_ef, Cyrillic_EF, any,any ] }; // f - key { [ Cyrillic_ghe, Cyrillic_GHE, any,any ] }; // g - key { [ Cyrillic_ha, Cyrillic_HA, any,any ] }; // h - key { [ Cyrillic_je, Cyrillic_JE, any,any ] }; // j - key { [ Cyrillic_ka, Cyrillic_KA, any,any ] }; // k - key { [ Cyrillic_el, Cyrillic_EL, any,any ] }; // l - key { [ Cyrillic_che, Cyrillic_CHE, any,any ] }; // ; : - key { [ Serbian_tshe, Serbian_TSHE, any,any ] }; // ' " - key { [ Cyrillic_zhe, Cyrillic_ZHE, any,any ] }; // \ | - - key { [ Cyrillic_zhe, Cyrillic_ZHE, any,any ] }; // z - key { [ Cyrillic_dzhe, Cyrillic_DZHE, any,any ] }; // x - key { [ Cyrillic_tse, Cyrillic_TSE, any,any ] }; // c - key { [ Cyrillic_ve, Cyrillic_VE, any,any ] }; // v - key { [ Cyrillic_be, Cyrillic_BE, any,any ] }; // b - key { [ Cyrillic_en, Cyrillic_EN, any,any ] }; // n - key { [ Cyrillic_em, Cyrillic_EM, any,any ] }; // m -}; - - -partial hidden alphanumeric_keys -xkb_symbols "latalpha" { - - key.type[Group1] = "FOUR_LEVEL_ALPHABETIC"; - - key { [ scaron, Scaron, any,any ] }; // - key { [ dstroke, Dstroke, any,any ] }; // - - key { [ ccaron, Ccaron, any,any ] }; // - key { [ cacute, Cacute, any,any ] }; // - key { [ zcaron, Zcaron, any,any ] }; // - -}; - -partial hidden alphanumeric_keys -xkb_symbols "twoletter" { - // These are letters which are written in latin transcription with two-characters. - - key { type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC", - [ U1C9, U1C8, any, U1C7 ] }; // q - key { type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC", - [ U1CC, U1CB, any, U1CA ] }; // w - key { type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC", - [ U1C6, U1C5, any, U1C4 ] }; // x - - // Also replace letter Y with Zcaron, since Y is of no use any longer - key { [ zcaron, Zcaron, any,any ] }; // -}; - -partial hidden alphanumeric_keys -xkb_symbols "latlevel3" { - key { [ any,any, notsign, notsign ] }; // ` ~ - key { [ any,any, dead_tilde, asciitilde ] }; // 1 ! - key { [ any,any, dead_caron, caron ] }; // 2 @ - key { [ any,any, dead_circumflex, asciicircum ] }; // 3 # - key { [ any,any, dead_breve, breve ] }; // 4 $ - key { [ any,any, dead_abovering, degree ] }; // 5 % - key { [ any,any, dead_ogonek, ogonek ] }; // 6 ^ - key { [ any,any, dead_grave, grave ] }; // 7 & - key { [ any,any, dead_abovedot, abovedot ] }; // 8 * - key { [ any,any, dead_acute, apostrophe ] }; // 9 ( - key { [ any,any, dead_doubleacute, doubleacute ] }; // 0 ) - key { [ any,any, dead_diaeresis, diaeresis ] }; // - _ - key { [ any,any, dead_cedilla, cedilla ] }; // = + - - key { [ any,any, backslash, Greek_OMEGA ] }; // q - key { [ any,any, bar, Lstroke ] }; // w - key { [ any,any, EuroSign, EuroSign ] }; // e - key { [ any,any, paragraph, registered ] }; // r - key { [ any,any, tslash, Tslash ] }; // t // ALPHABETIC - key { [ any,any, leftarrow, yen ] }; // y - key { [ any,any, downarrow, uparrow ] }; // u - key { [ any,any, rightarrow, idotless ] }; // i - key { [ any,any, oslash, Ooblique ] }; // o // ALPHABETIC - key { [ any,any, thorn, THORN ] }; // p // ALPHABETIC - key { [ any,any, division, dead_abovering ] }; // [ - key { [ any,any, multiply, dead_macron ] }; // ] - - key { [ any,any, ae, AE ] }; // a // ALPHABETIC - key { [ any,any, doublelowquotemark, guillemotright ] }; // s - key { [ any,any, leftdoublequotemark, guillemotleft ] }; // d - key { [ any,any, bracketleft, ordfeminine ] }; // f - key { [ any,any, bracketright, ENG ] }; // g - key { [ any,any, hstroke, Hstroke ] }; // h // ALPHABETIC - key { [ any,any, NoSymbol, NoSymbol ] }; // j - key { [ any,any, lstroke, ampersand ] }; // k - key { [ any,any, lstroke, Lstroke ] }; // l - key { [ any,any, dead_acute, dead_doubleacute ] }; // ; - key { [ any,any, ssharp, dead_caron ] }; // ' - key { [ any,any, currency, dead_breve ] }; // \ - - key { [ any,any, leftsinglequotemark, guillemotright ] }; // z - key { [ any,any, rightsinglequotemark,guillemotleft ] }; // x - key { [ any,any, cent, copyright ] }; // c - key { [ any,any, at, grave ] }; // v - key { [ any,any, braceleft, apostrophe ] }; // b - key { [ any,any, braceright, braceright ] }; // n - key { [ any,any, asciicircum, masculine ] }; // m - key { [ any,any, less, multiply ] }; // , < - key { [ any,any, greater, division ] }; // . > - key { [ any,any, emdash, endash ] }; // / ? - -}; - -partial hidden alphanumeric_keys -xkb_symbols "cyrlevel3" { - key { [ any,any, degree, notsign ] }; // ` ~ - key { [ any,any, dead_circumflex, NoSymbol ] }; // 3 # - key { [ any,any, dead_grave, NoSymbol ] }; // 7 & - key { [ any,any, dead_doublegrave, NoSymbol ] }; // 8 * - key { [ any,any, dead_acute, NoSymbol ] }; // 9 ( - key { [ any,any, dead_invertedbreve, NoSymbol ] }; // 0 ) - key { [ any,any, dead_macron, NoSymbol ] }; // - _ - - key { [ any,any, backslash, NoSymbol ] }; // q - key { [ any,any, bar, NoSymbol ] }; // w - key { [ any,any, EuroSign, sterling ] }; // e - key { [ any,any, paragraph, registered ] }; // r - key { [ any,any, ellipsis, NoSymbol ] }; // t // ALPHABETIC - key { [ any,any, leftarrow, yen ] }; // y - key { [ any,any, downarrow, uparrow ] }; // u - key { [ any,any, rightarrow, NoSymbol ] }; // i - key { [ any,any, section, NoSymbol ] }; // o // ALPHABETIC - key { [ any,any, division, NoSymbol ] }; // [ - key { [ any,any, multiply, NoSymbol ] }; // ] - - key { [ any,any, doublelowquotemark, guillemotright ] }; // s - key { [ any,any, leftdoublequotemark, guillemotleft ] }; // d - key { [ any,any, bracketleft, NoSymbol ] }; // f - key { [ any,any, bracketright, NoSymbol ] }; // g - key { [ any,any, currency, NoSymbol ] }; // \ - - key { [ any,any, leftsinglequotemark, NoSymbol ] }; // z - key { [ any,any, rightsinglequotemark,NoSymbol ] }; // x - key { [ any,any, cent, copyright ] }; // c - key { [ any,any, at, NoSymbol ] }; // v - key { [ any,any, braceleft, NoSymbol ] }; // b - key { [ any,any, braceright, NoSymbol ] }; // n - key { [ any,any, asciicircum, NoSymbol ] }; // m - key { [ any,any, less, NoSymbol ] }; // , < - key { [ any,any, greater, NoSymbol ] }; // . > - key { [ any,any, emdash, endash ] }; // / ? -}; - -partial alphanumeric_keys -xkb_symbols "latinunicode" { - // This mapping supports the Unicode characters 0x1c4-0x1cc (dz, lj, and nj - // as single character). You get the title form with AltGr+Shift. - - name[Group1]= "Serbia - Latin Unicode"; - - include "rs(latin)" - include "rs(twoletter)" -}; - -partial alphanumeric_keys -xkb_symbols "latinyz" { - // For those who insist on using "english-position" Z and Y. - - name[Group1]= "Serbia - Latin qwerty"; - - include "rs(latin)" - - key { [ y, Y, any,any ] }; // y - key { [ z, Z, any,any ] }; // z -}; - -partial alphanumeric_keys -xkb_symbols "latinunicodeyz" { - // Unicode, ZHE and Z swapped. - - name[Group1]= "Serbia - Latin Unicode qwerty"; - - include "rs(latinunicode)" - - key { [ zcaron, Zcaron, any,any ] }; // y - key { [ z, Z, any,any ] }; // z -}; - -xkb_symbols "alternatequotes" { - // Another acceptable »pair of quotes« for Serbian - - name[Group1]= "Serbia - With guillemets"; - - include "rs(basic)" - - key { [ any,any, guillemotright, NoSymbol ] }; // s - key { [ any,any, guillemotleft, NoSymbol ] }; // d -}; - -xkb_symbols "latinalternatequotes" { - // Another acceptable »pair of quotes« for Serbian - - name[Group1]= "Serbia - Latin with guillemets"; - - include "rs(latin)" - - key { [ any,any, guillemotright, NoSymbol ] }; // s - key { [ any,any, guillemotleft, NoSymbol ] }; // d -}; - -xkb_symbols "rue" { - // Homophonic layout for Pannonian Rusyn (spoken mainly in Serbia and - // Croatia by the Rusyn people), based on Ukrainian homophonic. - // Author: Ljubomir J. Papuga (Любомир Я. Папуґа) - - name[Group1]= "Serbia - Pannonian Rusyn Homophonic"; - - include "ua(homophonic)" - - key { [ grave, asciitilde ] }; - key { [ 3, doublelowquotemark ] }; - key { [ 4, rightdoublequotemark ] }; - key { [ 7, EuroSign ] }; - key { [ 0x002D, emdash ] }; - key { [ equal, plus ] }; - - key { [ Ukrainian_ie, Ukrainian_IE ] }; - key { [ Cyrillic_yu, Cyrillic_YU ] }; - key { [ Cyrillic_i, Cyrillic_I ] }; - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; - - key { [ Ukrainian_yi, Ukrainian_YI ] }; - key { [ comma, semicolon ] }; - key { [ period, colon ] }; -}; +// Bosnian, Croatian, Serbian and Slovenian XKB keyboard mapping +// (derived from "Danube" D.2) +// +// Danube D.2 from 2003-05-12 is available at http://srpski.org/dunav/ +// +// Original authors: +// Danilo Segan (Данило Шеган) +// Chusslove Illich (Часлав Илић) +// +// Danilo Segan : +// - Modified for inclusion in XFree86 +// - Further modifications on 2005-08-18 to support Bosnian, Croatian +// and Slovenian in xkeyboard-config +// + +default partial alphanumeric_keys +xkb_symbols "basic" { + + name[Group1]= "Serbia"; + + include "rs(cyrlevel3)" + include "rs(common)" + include "rs(cyralpha)" + include "level3(ralt_switch)" +}; + + +partial alphanumeric_keys +xkb_symbols "latin" { + + name[Group1]= "Serbia - Latin"; + + include "latin(type3)" + include "rs(latalpha)" + include "rs(latlevel3)" + include "rs(common)" + include "level3(ralt_switch)" +}; + + +partial alphanumeric_keys +xkb_symbols "yz" { + // Cyrillic_zhe and Cyrillic_ze swapped. + + name[Group1]= "Serbia - Z and ZHE swapped"; + + include "rs(basic)" + + key { [ Cyrillic_zhe, Cyrillic_ZHE, any,any ] }; // y + key { [ Cyrillic_ze, Cyrillic_ZE, any,any ] }; // z +}; + +partial hidden alphanumeric_keys +xkb_symbols "common" { + // "Common" keys: keys which are same for both latin and cyrillic keyboards + + key.type[Group1] = "FOUR_LEVEL"; + + key { [ quoteleft, asciitilde, any,any ] }; // + key { [ 1, exclam, any,any ] }; // + key { [ 2, quotedbl, any,any ] }; // + key { [ 3, numbersign, any,any ] }; // + key { [ 4, dollar, any,any ] }; // + key { [ 5, percent, any,any ] }; // + key { [ 6, ampersand, any,any ] }; // + key { [ 7, slash, any,any ] }; // + key { [ 8, parenleft, any,any ] }; // + key { [ 9, parenright, any,any ] }; // + key { [ 0, equal, any,any ] }; // + key { [ apostrophe, question, any,any ] }; // + key { [ plus, asterisk, any,any ] }; // + + key { [ comma, semicolon, any,any ] }; // + key { [ period, colon, any,any ] }; // + key { [ minus, underscore, any,any ] }; // + + include "kpdl(comma)" +}; + +partial hidden alphanumeric_keys +xkb_symbols "cyralpha" { + + key.type[Group1] = "FOUR_LEVEL_ALPHABETIC"; + + key { [ Cyrillic_lje, Cyrillic_LJE, any,any ] }; // q + key { [ Cyrillic_nje, Cyrillic_NJE, any,any ] }; // w + key { [ Cyrillic_ie, Cyrillic_IE, any,any ] }; // e + key { [ Cyrillic_er, Cyrillic_ER, any,any ] }; // r + key { [ Cyrillic_te, Cyrillic_TE, any,any ] }; // t + key { [ Cyrillic_ze, Cyrillic_ZE, any,any ] }; // y + key { [ Cyrillic_u, Cyrillic_U, any,any ] }; // u + key { [ Cyrillic_i, Cyrillic_I, any,any ] }; // i + key { [ Cyrillic_o, Cyrillic_O, any,any ] }; // o + key { [ Cyrillic_pe, Cyrillic_PE, any,any ] }; // p + key { [ Cyrillic_sha, Cyrillic_SHA, any,any ] }; // [ { + key { [ Serbian_dje, Serbian_DJE, any,any ] }; // ] } + + key { [ Cyrillic_a, Cyrillic_A, any,any ] }; // a + key { [ Cyrillic_es, Cyrillic_ES, any,any ] }; // s + key { [ Cyrillic_de, Cyrillic_DE, any,any ] }; // d + key { [ Cyrillic_ef, Cyrillic_EF, any,any ] }; // f + key { [ Cyrillic_ghe, Cyrillic_GHE, any,any ] }; // g + key { [ Cyrillic_ha, Cyrillic_HA, any,any ] }; // h + key { [ Cyrillic_je, Cyrillic_JE, any,any ] }; // j + key { [ Cyrillic_ka, Cyrillic_KA, any,any ] }; // k + key { [ Cyrillic_el, Cyrillic_EL, any,any ] }; // l + key { [ Cyrillic_che, Cyrillic_CHE, any,any ] }; // ; : + key { [ Serbian_tshe, Serbian_TSHE, any,any ] }; // ' " + key { [ Cyrillic_zhe, Cyrillic_ZHE, any,any ] }; // \ | + + key { [ Cyrillic_zhe, Cyrillic_ZHE, any,any ] }; // z + key { [ Cyrillic_dzhe, Cyrillic_DZHE, any,any ] }; // x + key { [ Cyrillic_tse, Cyrillic_TSE, any,any ] }; // c + key { [ Cyrillic_ve, Cyrillic_VE, any,any ] }; // v + key { [ Cyrillic_be, Cyrillic_BE, any,any ] }; // b + key { [ Cyrillic_en, Cyrillic_EN, any,any ] }; // n + key { [ Cyrillic_em, Cyrillic_EM, any,any ] }; // m +}; + + +partial hidden alphanumeric_keys +xkb_symbols "latalpha" { + + key.type[Group1] = "FOUR_LEVEL_ALPHABETIC"; + + key { [ scaron, Scaron, any,any ] }; // + key { [ dstroke, Dstroke, any,any ] }; // + + key { [ ccaron, Ccaron, any,any ] }; // + key { [ cacute, Cacute, any,any ] }; // + key { [ zcaron, Zcaron, any,any ] }; // + +}; + +partial hidden alphanumeric_keys +xkb_symbols "twoletter" { + // These are letters which are written in latin transcription with two-characters. + + key { type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC", + [ U1C9, U1C8, any, U1C7 ] }; // q + key { type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC", + [ U1CC, U1CB, any, U1CA ] }; // w + key { type[Group1] = "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC", + [ U1C6, U1C5, any, U1C4 ] }; // x + + // Also replace letter Y with Zcaron, since Y is of no use any longer + key { [ zcaron, Zcaron, any,any ] }; // +}; + +partial hidden alphanumeric_keys +xkb_symbols "latlevel3" { + key { [ any,any, notsign, notsign ] }; // ` ~ + key { [ any,any, dead_tilde, asciitilde ] }; // 1 ! + key { [ any,any, dead_caron, caron ] }; // 2 @ + key { [ any,any, dead_circumflex, asciicircum ] }; // 3 # + key { [ any,any, dead_breve, breve ] }; // 4 $ + key { [ any,any, dead_abovering, degree ] }; // 5 % + key { [ any,any, dead_ogonek, ogonek ] }; // 6 ^ + key { [ any,any, dead_grave, grave ] }; // 7 & + key { [ any,any, dead_abovedot, abovedot ] }; // 8 * + key { [ any,any, dead_acute, apostrophe ] }; // 9 ( + key { [ any,any, dead_doubleacute, doubleacute ] }; // 0 ) + key { [ any,any, dead_diaeresis, diaeresis ] }; // - _ + key { [ any,any, dead_cedilla, cedilla ] }; // = + + + key { [ any,any, backslash, Greek_OMEGA ] }; // q + key { [ any,any, bar, Lstroke ] }; // w + key { [ any,any, EuroSign, EuroSign ] }; // e + key { [ any,any, paragraph, registered ] }; // r + key { [ any,any, tslash, Tslash ] }; // t // ALPHABETIC + key { [ any,any, leftarrow, yen ] }; // y + key { [ any,any, downarrow, uparrow ] }; // u + key { [ any,any, rightarrow, idotless ] }; // i + key { [ any,any, oslash, Ooblique ] }; // o // ALPHABETIC + key { [ any,any, thorn, THORN ] }; // p // ALPHABETIC + key { [ any,any, division, dead_abovering ] }; // [ + key { [ any,any, multiply, dead_macron ] }; // ] + + key { [ any,any, ae, AE ] }; // a // ALPHABETIC + key { [ any,any, doublelowquotemark, guillemotright ] }; // s + key { [ any,any, leftdoublequotemark, guillemotleft ] }; // d + key { [ any,any, bracketleft, ordfeminine ] }; // f + key { [ any,any, bracketright, ENG ] }; // g + key { [ any,any, hstroke, Hstroke ] }; // h // ALPHABETIC + key { [ any,any, NoSymbol, NoSymbol ] }; // j + key { [ any,any, lstroke, ampersand ] }; // k + key { [ any,any, lstroke, Lstroke ] }; // l + key { [ any,any, dead_acute, dead_doubleacute ] }; // ; + key { [ any,any, ssharp, dead_caron ] }; // ' + key { [ any,any, currency, dead_breve ] }; // \ + + key { [ any,any, leftsinglequotemark, guillemotright ] }; // z + key { [ any,any, rightsinglequotemark,guillemotleft ] }; // x + key { [ any,any, cent, copyright ] }; // c + key { [ any,any, at, grave ] }; // v + key { [ any,any, braceleft, apostrophe ] }; // b + key { [ any,any, braceright, braceright ] }; // n + key { [ any,any, asciicircum, masculine ] }; // m + key { [ any,any, less, multiply ] }; // , < + key { [ any,any, greater, division ] }; // . > + key { [ any,any, emdash, endash ] }; // / ? + +}; + +partial hidden alphanumeric_keys +xkb_symbols "cyrlevel3" { + key { [ any,any, degree, notsign ] }; // ` ~ + key { [ any,any, dead_circumflex, NoSymbol ] }; // 3 # + key { [ any,any, dead_grave, NoSymbol ] }; // 7 & + key { [ any,any, dead_doublegrave, NoSymbol ] }; // 8 * + key { [ any,any, dead_acute, NoSymbol ] }; // 9 ( + key { [ any,any, dead_invertedbreve, NoSymbol ] }; // 0 ) + key { [ any,any, dead_macron, NoSymbol ] }; // - _ + + key { [ any,any, backslash, NoSymbol ] }; // q + key { [ any,any, bar, NoSymbol ] }; // w + key { [ any,any, EuroSign, sterling ] }; // e + key { [ any,any, paragraph, registered ] }; // r + key { [ any,any, ellipsis, NoSymbol ] }; // t // ALPHABETIC + key { [ any,any, leftarrow, yen ] }; // y + key { [ any,any, downarrow, uparrow ] }; // u + key { [ any,any, rightarrow, NoSymbol ] }; // i + key { [ any,any, section, NoSymbol ] }; // o // ALPHABETIC + key { [ any,any, division, NoSymbol ] }; // [ + key { [ any,any, multiply, NoSymbol ] }; // ] + + key { [ any,any, doublelowquotemark, guillemotright ] }; // s + key { [ any,any, leftdoublequotemark, guillemotleft ] }; // d + key { [ any,any, bracketleft, NoSymbol ] }; // f + key { [ any,any, bracketright, NoSymbol ] }; // g + key { [ any,any, currency, NoSymbol ] }; // \ + + key { [ any,any, leftsinglequotemark, NoSymbol ] }; // z + key { [ any,any, rightsinglequotemark,NoSymbol ] }; // x + key { [ any,any, cent, copyright ] }; // c + key { [ any,any, at, NoSymbol ] }; // v + key { [ any,any, braceleft, NoSymbol ] }; // b + key { [ any,any, braceright, NoSymbol ] }; // n + key { [ any,any, asciicircum, NoSymbol ] }; // m + key { [ any,any, less, NoSymbol ] }; // , < + key { [ any,any, greater, NoSymbol ] }; // . > + key { [ any,any, emdash, endash ] }; // / ? +}; + +partial alphanumeric_keys +xkb_symbols "latinunicode" { + // This mapping supports the Unicode characters 0x1c4-0x1cc (dz, lj, and nj + // as single character). You get the title form with AltGr+Shift. + + name[Group1]= "Serbia - Latin Unicode"; + + include "rs(latin)" + include "rs(twoletter)" +}; + +partial alphanumeric_keys +xkb_symbols "latinyz" { + // For those who insist on using "english-position" Z and Y. + + name[Group1]= "Serbia - Latin qwerty"; + + include "rs(latin)" + + key { [ y, Y, any,any ] }; // y + key { [ z, Z, any,any ] }; // z +}; + +partial alphanumeric_keys +xkb_symbols "latinunicodeyz" { + // Unicode, ZHE and Z swapped. + + name[Group1]= "Serbia - Latin Unicode qwerty"; + + include "rs(latinunicode)" + + key { [ zcaron, Zcaron, any,any ] }; // y + key { [ z, Z, any,any ] }; // z +}; + +xkb_symbols "alternatequotes" { + // Another acceptable »pair of quotes« for Serbian + + name[Group1]= "Serbia - With guillemets"; + + include "rs(basic)" + + key { [ any,any, guillemotright, NoSymbol ] }; // s + key { [ any,any, guillemotleft, NoSymbol ] }; // d +}; + +xkb_symbols "latinalternatequotes" { + // Another acceptable »pair of quotes« for Serbian + + name[Group1]= "Serbia - Latin with guillemets"; + + include "rs(latin)" + + key { [ any,any, guillemotright, NoSymbol ] }; // s + key { [ any,any, guillemotleft, NoSymbol ] }; // d +}; + +xkb_symbols "rue" { + // Homophonic layout for Pannonian Rusyn (spoken mainly in Serbia and + // Croatia by the Rusyn people), based on Ukrainian homophonic. + // Author: Ljubomir J. Papuga (Любомир Я. Папуґа) + + name[Group1]= "Serbia - Pannonian Rusyn Homophonic"; + + include "ua(homophonic)" + + key { [ grave, asciitilde ] }; + key { [ 3, doublelowquotemark ] }; + key { [ 4, rightdoublequotemark ] }; + key { [ 7, EuroSign ] }; + key { [ 0x002D, emdash ] }; + key { [ equal, plus ] }; + + key { [ Ukrainian_ie, Ukrainian_IE ] }; + key { [ Cyrillic_yu, Cyrillic_YU ] }; + key { [ Cyrillic_i, Cyrillic_I ] }; + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; + + key { [ Ukrainian_yi, Ukrainian_YI ] }; + key { [ comma, semicolon ] }; + key { [ period, colon ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/ru b/xorg-server/xkeyboard-config/symbols/ru index b95d6d57e..9cc7683dd 100644 --- a/xorg-server/xkeyboard-config/symbols/ru +++ b/xorg-server/xkeyboard-config/symbols/ru @@ -1,531 +1,527 @@ -// $XKeyboardConfig$ - -// based on -// russian standard keyboard -// AEN -// 2001/12/23 by Leon Kanter -// 2005/12/09 Valery Inozemtsev -// -// $XFree86: xc/programs/xkbcomp/symbols/ru,v 1.3 2003/02/15 22:27:05 dawes Exp $ - -// Windows layout -partial default alphanumeric_keys -xkb_symbols "winkeys" { - include "ru(common)" - - name[Group1]= "Russia"; - - key { [ 3, numerosign ] }; - key { [ 4, semicolon ] }; - key { [ 5, percent ] }; - key { [ 6, colon ] }; - key { [ 7, question ] }; - key { [ 8, asterisk ] }; - - key { [ period, comma ] }; - key { [ backslash, slash ] }; -}; - -partial hidden alphanumeric_keys -xkb_symbols "common" { - - key { [ 1, exclam ] }; - key { [ 2, quotedbl ] }; - key { [ 3, numbersign ] }; - key { [ 4, asterisk ] }; - key { [ 5, colon ] }; - key { [ 6, comma ] }; - key { [ 7, period ] }; - key { [ 8, semicolon ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ minus, underscore ] }; - key { [ equal, plus ] }; - key { [ backslash, bar ] }; - key { [ slash, question ] }; - key { [ slash, bar ] }; - - key { [ Cyrillic_io, Cyrillic_IO ] }; - key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; - key { [ Cyrillic_tse, Cyrillic_TSE ] }; - key { [ Cyrillic_u, Cyrillic_U ] }; - key { [ Cyrillic_ka, Cyrillic_KA ] }; - key { [ Cyrillic_ie, Cyrillic_IE ] }; - key { [ Cyrillic_en, Cyrillic_EN ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; - key { [ Cyrillic_ze, Cyrillic_ZE ] }; - key { [ Cyrillic_ha, Cyrillic_HA ] }; - key { [Cyrillic_hardsign,Cyrillic_HARDSIGN ] }; - key { [ Cyrillic_ef, Cyrillic_EF ] }; - key { [ Cyrillic_yeru, Cyrillic_YERU ] }; - key { [ Cyrillic_ve, Cyrillic_VE ] }; - key { [ Cyrillic_a, Cyrillic_A ] }; - key { [ Cyrillic_pe, Cyrillic_PE ] }; - key { [ Cyrillic_er, Cyrillic_ER ] }; - key { [ Cyrillic_o, Cyrillic_O ] }; - key { [ Cyrillic_el, Cyrillic_EL ] }; - key { [ Cyrillic_de, Cyrillic_DE ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ Cyrillic_e, Cyrillic_E ] }; - key { [ Cyrillic_ya, Cyrillic_YA ] }; - key { [ Cyrillic_che, Cyrillic_CHE ] }; - key { [ Cyrillic_es, Cyrillic_ES ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; - key { [ Cyrillic_i, Cyrillic_I ] }; - key { [ Cyrillic_te, Cyrillic_TE ] }; - key { [Cyrillic_softsign,Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_be, Cyrillic_BE ] }; - key { [ Cyrillic_yu, Cyrillic_YU ] }; - - key.type[group1]="TWO_LEVEL"; - - include "kpdl(comma)" -}; - -partial alphanumeric_keys -xkb_symbols "legacy" { - include "ru(common)" - - name[Group1]= "Russia - Legacy"; -}; - -partial alphanumeric_keys -xkb_symbols "olpc" { - - include "ru(common)" - - key { [ 0x01000451, 0x01000401, grave ] }; // Ñ‘, Ð - key { [ 3, numbersign, 0x01002116 ] }; // â„– - key { [ 4, dollar, semicolon ] }; - key { [ 6, asciicircum, colon ] }; - key { [ 7, ampersand ] }; - key { [ 9, parenleft, acute ] }; - key { [ backslash, bar, slash ] }; - - include "group(olpc)" -}; - -partial alphanumeric_keys -xkb_symbols "typewriter" { - include "ru(common)" - name[Group1]= "Russia - Typewriter"; - key { [ bar, plus ] }; - key { [ numerosign, 1 ] }; - key { [ minus, 2 ] }; - key { [ slash, 3 ] }; - key { [ quotedbl, 4 ] }; - key { [ colon, 5 ] }; - key { [ comma, 6 ] }; - key { [ period, 7 ] }; - key { [ underscore, 8 ] }; - key { [ question, 9 ] }; - key { [ percent, 0 ] }; - key { [ exclam, equal ] }; - key { [ semicolon, backslash ] }; - - key { [ parenright, parenleft ] }; - - key { [Cyrillic_hardsign,Cyrillic_HARDSIGN ] }; - key { [ Cyrillic_io, Cyrillic_IO ] }; -}; - -partial alphanumeric_keys -xkb_symbols "typewriter-legacy" { - include "ru(common)" - name[Group1]= "Russia - Typewriter, legacy"; - key { [ apostrophe, quotedbl ] }; - key { [ exclam, 1 ] }; - key { [ numerosign, 2 ] }; - key { [ slash, 3 ] }; - key { [ semicolon, 4 ] }; - key { [ colon, 5 ] }; - key { [ comma, 6 ] }; - key { [ period, 7 ] }; - key { [ underscore, 8 ] }; - key { [ question, 9 ] }; - key { [ percent, 0 ] }; - key { [ parenleft, parenright ] }; - - key { [Cyrillic_hardsign,Cyrillic_HARDSIGN ] }; - key { [ Cyrillic_io, Cyrillic_IO ] }; -}; - -partial alphanumeric_keys -xkb_symbols "phonetic" { - - name[Group1]= "Russia - Phonetic"; - - key { [ 1, exclam ] }; - key { [ 2, at ] }; - key { [ 3, Cyrillic_io ] }; - key { [ 4, Cyrillic_IO ] }; - key { [ 5, Cyrillic_hardsign ] }; - key { [ 6, Cyrillic_HARDSIGN ] }; - key { [ 7, ampersand ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ minus, underscore ] }; - - key { [ period, greater ] }; - key { [ slash, question ] }; - key { [ comma, less ] }; - key { [ semicolon, colon ] }; - key { [ apostrophe, quotedbl ] }; - key { [ bar, brokenbar ] }; - - key { [ Cyrillic_yu, Cyrillic_YU ] }; - key { [ Cyrillic_ya, Cyrillic_YA ] }; - key { [ Cyrillic_ze, Cyrillic_ZE ] }; - key { [ Cyrillic_es, Cyrillic_ES ] }; - key { [ Cyrillic_a, Cyrillic_A ] }; - key { [ Cyrillic_ve, Cyrillic_VE ] }; - key { [ Cyrillic_tse, Cyrillic_TSE ] }; - key { [Cyrillic_softsign,Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_de, Cyrillic_DE ] }; - key { [ Cyrillic_ie, Cyrillic_IE ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ Cyrillic_ef, Cyrillic_EF ] }; - key { [ Cyrillic_te, Cyrillic_TE ] }; - key { [ Cyrillic_er, Cyrillic_ER ] }; - key { [ Cyrillic_en, Cyrillic_EN ] }; - key { [ Cyrillic_be, Cyrillic_BE ] }; - key { [ Cyrillic_ha, Cyrillic_HA ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key { [ Cyrillic_yeru, Cyrillic_YERU ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; - key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; - key { [ Cyrillic_u, Cyrillic_U ] }; - key { [ Cyrillic_ka, Cyrillic_KA ] }; - key { [ Cyrillic_i, Cyrillic_I ] }; - key { [ Cyrillic_o, Cyrillic_O ] }; - key { [ Cyrillic_el, Cyrillic_EL ] }; - key { [ Cyrillic_pe, Cyrillic_PE ] }; - - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Cyrillic_che, Cyrillic_CHE ] }; - key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; - key { [ Cyrillic_e, Cyrillic_E ] }; -}; - -partial alphanumeric_keys -xkb_symbols "phonetic_winkeys" { - - include "ru(phonetic)" - name[Group1]= "Russia - Phonetic Winkeys"; - - key { [ Cyrillic_ha, Cyrillic_HA ] }; - key { [ Cyrillic_che, Cyrillic_CHE ] }; - key { [ Cyrillic_softsign, Cyrillic_softsign ] }; - -}; - -partial alphanumeric_keys -xkb_symbols "tt" { - include "ru(winkeys)" - name[Group1]= "Russia - Tatar"; - - key.type[group1]="FOUR_LEVEL"; - - key { [ 0x010004bb, 0x010004ba, - Cyrillic_io, Cyrillic_IO ] }; - key { [ 0x010004e9, 0x010004e8, - Cyrillic_tse, Cyrillic_TSE ] }; - key { [ 0x010004d9, 0x010004d8, - Cyrillic_shcha, Cyrillic_SHCHA ] }; - key { [ 0x010004af, 0x010004ae, - Cyrillic_hardsign,Cyrillic_HARDSIGN ] }; - key { [ 0x010004a3, 0x010004a2, - Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ 0x01000497, 0x01000496, - Cyrillic_softsign,Cyrillic_SOFTSIGN ] }; - - include "level3(ralt_switch)" - -}; - -partial alphanumeric_keys -xkb_symbols "os_legacy" { - include "ru(common)" - - name[Group1]= "Russia - Ossetian, legacy"; - - key { [ Cyrillic_e, Cyrillic_E ] }; - key { [ Cyrillic_o, Cyrillic_O, Cyrillic_io, Cyrillic_IO ] }; - key { [ 0x010004D5, 0x010004D4 ] }; -}; - -partial alphanumeric_keys -xkb_symbols "os_winkeys" { - include "ru(winkeys)" - - name[Group1]= "Russia - Ossetian, Winkeys"; - - key { [ Cyrillic_e, Cyrillic_E ] }; - key { [ Cyrillic_o, Cyrillic_O, Cyrillic_io, Cyrillic_IO ] }; - key { [ 0x010004D5, 0x010004D4 ] }; -}; - -partial alphanumeric_keys -xkb_symbols "cv" { - include "ru(winkeys)" - - name[Group1]= "Russia - Chuvash"; - - key.type[group1]="FOUR_LEVEL"; - - key { [ Cyrillic_u, Cyrillic_U, - 0x010004f3, 0x010004f2 ] }; - key { [ Cyrillic_ie, Cyrillic_IE, - 0x01000115, 0x01000114 ] }; - key { [ Cyrillic_a, Cyrillic_A, - abreve, Abreve ] }; - key { [ Cyrillic_es, Cyrillic_ES, - ccedilla, Ccedilla ] }; - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "udm" { - include "ru(winkeys)" - - name[Group1]= "Russia - Udmurt"; - - key.type[group1]="FOUR_LEVEL"; - - key { [ question, exclam, 1, 1 ] }; - key { [ parenleft, quotedbl, 2, 2 ] }; - key { [ parenright, numerosign, 3, 3 ] }; - key { [ colon, semicolon, 4, 4 ] }; - key { [ asterisk, percent, 5, 5 ] }; - key { [ 0x010004dd, 0x010004dc, 6, 6 ] }; - key { [ 0x010004e7, 0x010004e6, 7, 7 ] }; - key { [ 0x010004f5, 0x010004f4, 8, 8 ] }; - key { [ 0x010004e5, 0x010004e4, 9, 9 ] }; - key { [ 0x010004df, 0x010004de, 0, 0 ] }; - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "cv_latin" { - include "us(alt-intl)" - - name[Group1]= "Russia - Chuvash Latin"; - - key.type[group1]="FOUR_LEVEL"; - - key { [ q, Q, 0x01000161, 0x01000160 ] }; - key { [ w, W, udiaeresis, Udiaeresis ] }; - key { [ e, E, 0x01000115, 0x01000114 ] }; - key { [ u, U, udiaeresis, Udiaeresis ] }; - key { [ i, I, 0x0100012d, 0x0100012c ] }; - key { [ o, O, odiaeresis, Odiaeresis ] }; - key { [ a, A, abreve, Abreve ] }; - key { [ s, S, scedilla, Scedilla ] }; - key { [ g, G, gbreve, Gbreve ] }; - key { [ j, J, 0x01000131, 0x01000130 ] }; - key { [ c, C, ccedilla, Ccedilla ] }; - - include "level3(ralt_switch)" - -}; - -// Komi language layout -// based on -// russian standard keyboard -// Vlad Shakhov -// Last Changes 2007/10/23 by Vlad Shakhov - -partial alphanumeric_keys -xkb_symbols "kom" { - - include "ru(winkeys)" - - name[Group1]= "Russia - Komi"; - - key.type[group1]="FOUR_LEVEL_ALPHABETIC"; - -// cyrilllic o with diaeresis - key { [ Cyrillic_o, Cyrillic_O, - U04E7, U04E6 ] }; - -// hard I as additional key for soft Cyrillic_I - key { [ Cyrillic_i, Cyrillic_I, - Ukrainian_i, Ukrainian_I ] }; - - include "level3(ralt_switch)" -}; - -// Yakut language layout -// 2008/04/23 Yakov Aleksandrov -// 2008/04/23 Anatoliy Zhozhikov -// 2008/04/23 Aleksandr Varlamov -partial alphanumeric_keys -xkb_symbols "sah" { - - include "ru(winkeys)" - - name[Group1]= "Russia - Yakut"; - - key.type[group1]="FOUR_LEVEL_ALPHABETIC"; - - key { [ Cyrillic_io, Cyrillic_IO, - U04EB, U04EA ] }; - key { [ Cyrillic_shorti, Cyrillic_SHORTI, - U048B, U048A ] }; - key { [ Cyrillic_u, Cyrillic_U, - Cyrillic_u_straight, Cyrillic_U_straight ] }; - key { [ Cyrillic_ka, Cyrillic_KA, - U04C4, U04C3 ] }; - key { [ Cyrillic_en, Cyrillic_EN, - U04A5, U04A4 ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE, - U0495, U0494 ] }; - key { [ Cyrillic_ze, Cyrillic_ZE, - U04E1, U04E0 ] }; - key { [ Cyrillic_ha, Cyrillic_HA, - Cyrillic_shha, Cyrillic_SHHA ] }; - key { [ Cyrillic_o, Cyrillic_O, - Cyrillic_o_bar, Cyrillic_O_bar ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE, - U0461, U0460 ] }; - key { [ Cyrillic_che, Cyrillic_CHE, - Cyrillic_u_macron, Cyrillic_U_macron ] }; - key { [ Cyrillic_em, Cyrillic_EM, - U04C8, U04C7 ] }; - key { [ Cyrillic_i, Cyrillic_I, - Cyrillic_i_macron, Cyrillic_I_macron ] }; - - include "level3(ralt_switch)" -}; - - -//Kalmyk language layout -//based on the Kalmyk language layout: http://soft.oyrat.org/ -//Nikolay Korneev -//Toli Miron - -partial alphanumeric_keys -xkb_symbols "xal" { - include "ru(winkeys)" - - name[Group1]= "Russia - Kalmyk"; - - key.type[group1]="FOUR_LEVEL"; - - key { [ question, exclam, 1 ] }; - key { [ numerosign, quotedbl, 2 ] }; - key { [ Cyrillic_u_straight, Cyrillic_U_straight, 3 ] }; - key { [ Cyrillic_schwa, Cyrillic_SCHWA, 4 ] }; - key { [ asterisk, percent, 5 ] }; - key { [ Cyrillic_en_descender, Cyrillic_EN_descender, 6 ] }; - key { [ Cyrillic_o_bar, Cyrillic_O_bar, 7 ] }; - key { [ Cyrillic_shha, Cyrillic_SHHA, 8 ] }; - key { [ Cyrillic_zhe_descender, Cyrillic_ZHE_descender, 9 ] }; - key { [ semicolon, colon, 0 ] }; - - key { [ parenleft, parenright, Cyrillic_io, Cyrillic_IO ] }; - - key { [ Cyrillic_tse, Cyrillic_TSE, dollar ] }; - key { [ Cyrillic_u, Cyrillic_U, EuroSign ] }; - key { [ Cyrillic_ka, Cyrillic_KA, registered ] }; - key { [ Cyrillic_ie, Cyrillic_IE, trademark ] }; - key { [ Cyrillic_ha, Cyrillic_HA, bracketleft ] }; - key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN, bracketright ] }; - key { [ Cyrillic_e, Cyrillic_E, apostrophe ] }; - key { [ Cyrillic_es, Cyrillic_ES, copyright ] }; - key { [ Cyrillic_be, Cyrillic_BE, less ] }; - key { [ Cyrillic_yu, Cyrillic_YU, greater ] }; - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "dos" { - - include "ru(common)" - - name[Group1]= "Russia - DOS"; - - key { [ parenright, parenleft ] }; - key { [ 4, currency ] }; - key { [ 9, question ] }; - key { [ 0, percent ] }; - - key { [ Cyrillic_io, Cyrillic_IO ] }; -}; - -partial alphanumeric_keys -xkb_symbols "bak" { - include "ru(winkeys)" - - name[Group1]= "Russia - Bashkirian"; - key.type[group1]="FOUR_LEVEL"; - - key { [ 0x010004d9, 0x010004d8, Cyrillic_io, Cyrillic_IO ] }; - key { [ exclam, quotedbl, 1, 1 ] }; - key { [ 0x010004e9, 0x010004e8, 2, 2 ] }; - key { [ 0x010004a1, 0x010004a0, 3, 3 ] }; - key { [ 0x01000493, 0x01000492, 4, 4 ] }; - key { [ 0x010004ab, 0x010004aa, 5, 5 ] }; - key { [ colon, semicolon, 6, 6 ] }; - key { [ 0x01000499, 0x01000498, 7, 7 ] }; - key { [ 0x010004bb, 0x010004ba, 8, 8 ] }; - key { [ question, parenleft, 9, 9 ] }; - key { [ numerosign, parenright, 0, 0 ] }; - key { [ minus, percent, minus, underscore ]}; - key { [ 0x010004af, 0x010004ae, equal, plus ]}; - key { [ 0x010004a3, 0x010004a2, backslash, slash ]}; - - include "level3(ralt_switch)" -}; - -// Serbian charecters added as third level symbols to Russian keyboard layout. - -partial alphanumeric_keys -xkb_symbols "srp" { - include "ru(common)" - include "level3(ralt_switch)" - - name[Group1]= "Russia - Serbian"; - - key { [ 3, numerosign ] }; - key { [ 4, semicolon ] }; - key { [ 5, percent ] }; - key { [ 6, colon ] }; - key { [ 7, question ] }; - key { [ 8, asterisk ] }; - key { [ period, comma ] }; - key { [ backslash, slash ] }; - key { [ Cyrillic_shorti, Cyrillic_SHORTI, U458, U408 ] }; - key { [ Cyrillic_en, Cyrillic_EN, U45A, U40A ] }; - key { [ Cyrillic_el, Cyrillic_EL, U459, U409 ] }; - key { [ Cyrillic_de, Cyrillic_DE, U45F, U40F ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE, U452, U402 ] }; - key { [ Cyrillic_che, Cyrillic_CHE, U45B, U40B ] }; -}; - -// Mari language layout -// based on Russian standard keyboard -// http://www.marlamuter.ru/ -partial alphanumeric_keys -xkb_symbols "chm" { - include "ru(common)" - - name[Group1]= "Russia - Mari"; - - key.type[group1]="FOUR_LEVEL_ALPHABETIC"; - key { [ Cyrillic_a, Cyrillic_A, U04D3, U04D2 ] }; - key { [ Cyrillic_u, Cyrillic_U, U04F1, U04F0 ] }; - key { [ Cyrillic_ui, Cyrillic_UI, U04F9, U04F8 ] }; - key { [ Cyrillic_n, Cyrillic_N, U04A5, U04A4 ] }; - key { [ Cyrillic_e, Cyrillic_E, U04E9, U04E8 ] }; - key { [ Cyrillic_zh, Cyrillic_ZH, U04EB, U04EA ] }; - key { [ Cyrillic_f, Cyrillic_F, UF537, UF536 ] }; - - include "level3(ralt_switch)" -}; +// based on +// russian standard keyboard +// AEN +// 2001/12/23 by Leon Kanter +// 2005/12/09 Valery Inozemtsev + +// Windows layout +partial default alphanumeric_keys +xkb_symbols "winkeys" { + include "ru(common)" + + name[Group1]= "Russia"; + + key { [ 3, numerosign ] }; + key { [ 4, semicolon ] }; + key { [ 5, percent ] }; + key { [ 6, colon ] }; + key { [ 7, question ] }; + key { [ 8, asterisk ] }; + + key { [ period, comma ] }; + key { [ backslash, slash ] }; +}; + +partial hidden alphanumeric_keys +xkb_symbols "common" { + + key { [ 1, exclam ] }; + key { [ 2, quotedbl ] }; + key { [ 3, numbersign ] }; + key { [ 4, asterisk ] }; + key { [ 5, colon ] }; + key { [ 6, comma ] }; + key { [ 7, period ] }; + key { [ 8, semicolon ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ minus, underscore ] }; + key { [ equal, plus ] }; + key { [ backslash, bar ] }; + key { [ slash, question ] }; + key { [ slash, bar ] }; + + key { [ Cyrillic_io, Cyrillic_IO ] }; + key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; + key { [ Cyrillic_tse, Cyrillic_TSE ] }; + key { [ Cyrillic_u, Cyrillic_U ] }; + key { [ Cyrillic_ka, Cyrillic_KA ] }; + key { [ Cyrillic_ie, Cyrillic_IE ] }; + key { [ Cyrillic_en, Cyrillic_EN ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; + key { [ Cyrillic_ze, Cyrillic_ZE ] }; + key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [Cyrillic_hardsign,Cyrillic_HARDSIGN ] }; + key { [ Cyrillic_ef, Cyrillic_EF ] }; + key { [ Cyrillic_yeru, Cyrillic_YERU ] }; + key { [ Cyrillic_ve, Cyrillic_VE ] }; + key { [ Cyrillic_a, Cyrillic_A ] }; + key { [ Cyrillic_pe, Cyrillic_PE ] }; + key { [ Cyrillic_er, Cyrillic_ER ] }; + key { [ Cyrillic_o, Cyrillic_O ] }; + key { [ Cyrillic_el, Cyrillic_EL ] }; + key { [ Cyrillic_de, Cyrillic_DE ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ Cyrillic_e, Cyrillic_E ] }; + key { [ Cyrillic_ya, Cyrillic_YA ] }; + key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_es, Cyrillic_ES ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; + key { [ Cyrillic_i, Cyrillic_I ] }; + key { [ Cyrillic_te, Cyrillic_TE ] }; + key { [Cyrillic_softsign,Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_be, Cyrillic_BE ] }; + key { [ Cyrillic_yu, Cyrillic_YU ] }; + + key.type[group1]="TWO_LEVEL"; + + include "kpdl(comma)" +}; + +partial alphanumeric_keys +xkb_symbols "legacy" { + include "ru(common)" + + name[Group1]= "Russia - Legacy"; +}; + +partial alphanumeric_keys +xkb_symbols "olpc" { + + include "ru(common)" + + key { [ 0x01000451, 0x01000401, grave ] }; // Ñ‘, Ð + key { [ 3, numbersign, 0x01002116 ] }; // â„– + key { [ 4, dollar, semicolon ] }; + key { [ 6, asciicircum, colon ] }; + key { [ 7, ampersand ] }; + key { [ 9, parenleft, acute ] }; + key { [ backslash, bar, slash ] }; + + include "group(olpc)" +}; + +partial alphanumeric_keys +xkb_symbols "typewriter" { + include "ru(common)" + name[Group1]= "Russia - Typewriter"; + key { [ bar, plus ] }; + key { [ numerosign, 1 ] }; + key { [ minus, 2 ] }; + key { [ slash, 3 ] }; + key { [ quotedbl, 4 ] }; + key { [ colon, 5 ] }; + key { [ comma, 6 ] }; + key { [ period, 7 ] }; + key { [ underscore, 8 ] }; + key { [ question, 9 ] }; + key { [ percent, 0 ] }; + key { [ exclam, equal ] }; + key { [ semicolon, backslash ] }; + + key { [ parenright, parenleft ] }; + + key { [Cyrillic_hardsign,Cyrillic_HARDSIGN ] }; + key { [ Cyrillic_io, Cyrillic_IO ] }; +}; + +partial alphanumeric_keys +xkb_symbols "typewriter-legacy" { + include "ru(common)" + name[Group1]= "Russia - Typewriter, legacy"; + key { [ apostrophe, quotedbl ] }; + key { [ exclam, 1 ] }; + key { [ numerosign, 2 ] }; + key { [ slash, 3 ] }; + key { [ semicolon, 4 ] }; + key { [ colon, 5 ] }; + key { [ comma, 6 ] }; + key { [ period, 7 ] }; + key { [ underscore, 8 ] }; + key { [ question, 9 ] }; + key { [ percent, 0 ] }; + key { [ parenleft, parenright ] }; + + key { [Cyrillic_hardsign,Cyrillic_HARDSIGN ] }; + key { [ Cyrillic_io, Cyrillic_IO ] }; +}; + +partial alphanumeric_keys +xkb_symbols "phonetic" { + + name[Group1]= "Russia - Phonetic"; + + key { [ 1, exclam ] }; + key { [ 2, at ] }; + key { [ 3, Cyrillic_io ] }; + key { [ 4, Cyrillic_IO ] }; + key { [ 5, Cyrillic_hardsign ] }; + key { [ 6, Cyrillic_HARDSIGN ] }; + key { [ 7, ampersand ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ minus, underscore ] }; + + key { [ period, greater ] }; + key { [ slash, question ] }; + key { [ comma, less ] }; + key { [ semicolon, colon ] }; + key { [ apostrophe, quotedbl ] }; + key { [ bar, brokenbar ] }; + + key { [ Cyrillic_yu, Cyrillic_YU ] }; + key { [ Cyrillic_ya, Cyrillic_YA ] }; + key { [ Cyrillic_ze, Cyrillic_ZE ] }; + key { [ Cyrillic_es, Cyrillic_ES ] }; + key { [ Cyrillic_a, Cyrillic_A ] }; + key { [ Cyrillic_ve, Cyrillic_VE ] }; + key { [ Cyrillic_tse, Cyrillic_TSE ] }; + key { [Cyrillic_softsign,Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_de, Cyrillic_DE ] }; + key { [ Cyrillic_ie, Cyrillic_IE ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ Cyrillic_ef, Cyrillic_EF ] }; + key { [ Cyrillic_te, Cyrillic_TE ] }; + key { [ Cyrillic_er, Cyrillic_ER ] }; + key { [ Cyrillic_en, Cyrillic_EN ] }; + key { [ Cyrillic_be, Cyrillic_BE ] }; + key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; + key { [ Cyrillic_yeru, Cyrillic_YERU ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; + key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; + key { [ Cyrillic_u, Cyrillic_U ] }; + key { [ Cyrillic_ka, Cyrillic_KA ] }; + key { [ Cyrillic_i, Cyrillic_I ] }; + key { [ Cyrillic_o, Cyrillic_O ] }; + key { [ Cyrillic_el, Cyrillic_EL ] }; + key { [ Cyrillic_pe, Cyrillic_PE ] }; + + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; + key { [ Cyrillic_e, Cyrillic_E ] }; +}; + +partial alphanumeric_keys +xkb_symbols "phonetic_winkeys" { + + include "ru(phonetic)" + name[Group1]= "Russia - Phonetic Winkeys"; + + key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_softsign, Cyrillic_softsign ] }; + +}; + +partial alphanumeric_keys +xkb_symbols "tt" { + include "ru(winkeys)" + name[Group1]= "Russia - Tatar"; + + key.type[group1]="FOUR_LEVEL"; + + key { [ 0x010004bb, 0x010004ba, + Cyrillic_io, Cyrillic_IO ] }; + key { [ 0x010004e9, 0x010004e8, + Cyrillic_tse, Cyrillic_TSE ] }; + key { [ 0x010004d9, 0x010004d8, + Cyrillic_shcha, Cyrillic_SHCHA ] }; + key { [ 0x010004af, 0x010004ae, + Cyrillic_hardsign,Cyrillic_HARDSIGN ] }; + key { [ 0x010004a3, 0x010004a2, + Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ 0x01000497, 0x01000496, + Cyrillic_softsign,Cyrillic_SOFTSIGN ] }; + + include "level3(ralt_switch)" + +}; + +partial alphanumeric_keys +xkb_symbols "os_legacy" { + include "ru(common)" + + name[Group1]= "Russia - Ossetian, legacy"; + + key { [ Cyrillic_e, Cyrillic_E ] }; + key { [ Cyrillic_o, Cyrillic_O, Cyrillic_io, Cyrillic_IO ] }; + key { [ 0x010004D5, 0x010004D4 ] }; +}; + +partial alphanumeric_keys +xkb_symbols "os_winkeys" { + include "ru(winkeys)" + + name[Group1]= "Russia - Ossetian, Winkeys"; + + key { [ Cyrillic_e, Cyrillic_E ] }; + key { [ Cyrillic_o, Cyrillic_O, Cyrillic_io, Cyrillic_IO ] }; + key { [ 0x010004D5, 0x010004D4 ] }; +}; + +partial alphanumeric_keys +xkb_symbols "cv" { + include "ru(winkeys)" + + name[Group1]= "Russia - Chuvash"; + + key.type[group1]="FOUR_LEVEL"; + + key { [ Cyrillic_u, Cyrillic_U, + 0x010004f3, 0x010004f2 ] }; + key { [ Cyrillic_ie, Cyrillic_IE, + 0x01000115, 0x01000114 ] }; + key { [ Cyrillic_a, Cyrillic_A, + abreve, Abreve ] }; + key { [ Cyrillic_es, Cyrillic_ES, + ccedilla, Ccedilla ] }; + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "udm" { + include "ru(winkeys)" + + name[Group1]= "Russia - Udmurt"; + + key.type[group1]="FOUR_LEVEL"; + + key { [ question, exclam, 1, 1 ] }; + key { [ parenleft, quotedbl, 2, 2 ] }; + key { [ parenright, numerosign, 3, 3 ] }; + key { [ colon, semicolon, 4, 4 ] }; + key { [ asterisk, percent, 5, 5 ] }; + key { [ 0x010004dd, 0x010004dc, 6, 6 ] }; + key { [ 0x010004e7, 0x010004e6, 7, 7 ] }; + key { [ 0x010004f5, 0x010004f4, 8, 8 ] }; + key { [ 0x010004e5, 0x010004e4, 9, 9 ] }; + key { [ 0x010004df, 0x010004de, 0, 0 ] }; + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "cv_latin" { + include "us(alt-intl)" + + name[Group1]= "Russia - Chuvash Latin"; + + key.type[group1]="FOUR_LEVEL"; + + key { [ q, Q, 0x01000161, 0x01000160 ] }; + key { [ w, W, udiaeresis, Udiaeresis ] }; + key { [ e, E, 0x01000115, 0x01000114 ] }; + key { [ u, U, udiaeresis, Udiaeresis ] }; + key { [ i, I, 0x0100012d, 0x0100012c ] }; + key { [ o, O, odiaeresis, Odiaeresis ] }; + key { [ a, A, abreve, Abreve ] }; + key { [ s, S, scedilla, Scedilla ] }; + key { [ g, G, gbreve, Gbreve ] }; + key { [ j, J, 0x01000131, 0x01000130 ] }; + key { [ c, C, ccedilla, Ccedilla ] }; + + include "level3(ralt_switch)" + +}; + +// Komi language layout +// based on +// russian standard keyboard +// Vlad Shakhov +// Last Changes 2007/10/23 by Vlad Shakhov + +partial alphanumeric_keys +xkb_symbols "kom" { + + include "ru(winkeys)" + + name[Group1]= "Russia - Komi"; + + key.type[group1]="FOUR_LEVEL_ALPHABETIC"; + +// cyrilllic o with diaeresis + key { [ Cyrillic_o, Cyrillic_O, + U04E7, U04E6 ] }; + +// hard I as additional key for soft Cyrillic_I + key { [ Cyrillic_i, Cyrillic_I, + Ukrainian_i, Ukrainian_I ] }; + + include "level3(ralt_switch)" +}; + +// Yakut language layout +// 2008/04/23 Yakov Aleksandrov +// 2008/04/23 Anatoliy Zhozhikov +// 2008/04/23 Aleksandr Varlamov +partial alphanumeric_keys +xkb_symbols "sah" { + + include "ru(winkeys)" + + name[Group1]= "Russia - Yakut"; + + key.type[group1]="FOUR_LEVEL_ALPHABETIC"; + + key { [ Cyrillic_io, Cyrillic_IO, + U04EB, U04EA ] }; + key { [ Cyrillic_shorti, Cyrillic_SHORTI, + U048B, U048A ] }; + key { [ Cyrillic_u, Cyrillic_U, + Cyrillic_u_straight, Cyrillic_U_straight ] }; + key { [ Cyrillic_ka, Cyrillic_KA, + U04C4, U04C3 ] }; + key { [ Cyrillic_en, Cyrillic_EN, + U04A5, U04A4 ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE, + U0495, U0494 ] }; + key { [ Cyrillic_ze, Cyrillic_ZE, + U04E1, U04E0 ] }; + key { [ Cyrillic_ha, Cyrillic_HA, + Cyrillic_shha, Cyrillic_SHHA ] }; + key { [ Cyrillic_o, Cyrillic_O, + Cyrillic_o_bar, Cyrillic_O_bar ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE, + U0461, U0460 ] }; + key { [ Cyrillic_che, Cyrillic_CHE, + Cyrillic_u_macron, Cyrillic_U_macron ] }; + key { [ Cyrillic_em, Cyrillic_EM, + U04C8, U04C7 ] }; + key { [ Cyrillic_i, Cyrillic_I, + Cyrillic_i_macron, Cyrillic_I_macron ] }; + + include "level3(ralt_switch)" +}; + + +//Kalmyk language layout +//based on the Kalmyk language layout: http://soft.oyrat.org/ +//Nikolay Korneev +//Toli Miron + +partial alphanumeric_keys +xkb_symbols "xal" { + include "ru(winkeys)" + + name[Group1]= "Russia - Kalmyk"; + + key.type[group1]="FOUR_LEVEL"; + + key { [ question, exclam, 1 ] }; + key { [ numerosign, quotedbl, 2 ] }; + key { [ Cyrillic_u_straight, Cyrillic_U_straight, 3 ] }; + key { [ Cyrillic_schwa, Cyrillic_SCHWA, 4 ] }; + key { [ asterisk, percent, 5 ] }; + key { [ Cyrillic_en_descender, Cyrillic_EN_descender, 6 ] }; + key { [ Cyrillic_o_bar, Cyrillic_O_bar, 7 ] }; + key { [ Cyrillic_shha, Cyrillic_SHHA, 8 ] }; + key { [ Cyrillic_zhe_descender, Cyrillic_ZHE_descender, 9 ] }; + key { [ semicolon, colon, 0 ] }; + + key { [ parenleft, parenright, Cyrillic_io, Cyrillic_IO ] }; + + key { [ Cyrillic_tse, Cyrillic_TSE, dollar ] }; + key { [ Cyrillic_u, Cyrillic_U, EuroSign ] }; + key { [ Cyrillic_ka, Cyrillic_KA, registered ] }; + key { [ Cyrillic_ie, Cyrillic_IE, trademark ] }; + key { [ Cyrillic_ha, Cyrillic_HA, bracketleft ] }; + key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN, bracketright ] }; + key { [ Cyrillic_e, Cyrillic_E, apostrophe ] }; + key { [ Cyrillic_es, Cyrillic_ES, copyright ] }; + key { [ Cyrillic_be, Cyrillic_BE, less ] }; + key { [ Cyrillic_yu, Cyrillic_YU, greater ] }; + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "dos" { + + include "ru(common)" + + name[Group1]= "Russia - DOS"; + + key { [ parenright, parenleft ] }; + key { [ 4, currency ] }; + key { [ 9, question ] }; + key { [ 0, percent ] }; + + key { [ Cyrillic_io, Cyrillic_IO ] }; +}; + +partial alphanumeric_keys +xkb_symbols "bak" { + include "ru(winkeys)" + + name[Group1]= "Russia - Bashkirian"; + key.type[group1]="FOUR_LEVEL"; + + key { [ 0x010004d9, 0x010004d8, Cyrillic_io, Cyrillic_IO ] }; + key { [ exclam, quotedbl, 1, 1 ] }; + key { [ 0x010004e9, 0x010004e8, 2, 2 ] }; + key { [ 0x010004a1, 0x010004a0, 3, 3 ] }; + key { [ 0x01000493, 0x01000492, 4, 4 ] }; + key { [ 0x010004ab, 0x010004aa, 5, 5 ] }; + key { [ colon, semicolon, 6, 6 ] }; + key { [ 0x01000499, 0x01000498, 7, 7 ] }; + key { [ 0x010004bb, 0x010004ba, 8, 8 ] }; + key { [ question, parenleft, 9, 9 ] }; + key { [ numerosign, parenright, 0, 0 ] }; + key { [ minus, percent, minus, underscore ]}; + key { [ 0x010004af, 0x010004ae, equal, plus ]}; + key { [ 0x010004a3, 0x010004a2, backslash, slash ]}; + + include "level3(ralt_switch)" +}; + +// Serbian charecters added as third level symbols to Russian keyboard layout. + +partial alphanumeric_keys +xkb_symbols "srp" { + include "ru(common)" + include "level3(ralt_switch)" + + name[Group1]= "Russia - Serbian"; + + key { [ 3, numerosign ] }; + key { [ 4, semicolon ] }; + key { [ 5, percent ] }; + key { [ 6, colon ] }; + key { [ 7, question ] }; + key { [ 8, asterisk ] }; + key { [ period, comma ] }; + key { [ backslash, slash ] }; + key { [ Cyrillic_shorti, Cyrillic_SHORTI, U458, U408 ] }; + key { [ Cyrillic_en, Cyrillic_EN, U45A, U40A ] }; + key { [ Cyrillic_el, Cyrillic_EL, U459, U409 ] }; + key { [ Cyrillic_de, Cyrillic_DE, U45F, U40F ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE, U452, U402 ] }; + key { [ Cyrillic_che, Cyrillic_CHE, U45B, U40B ] }; +}; + +// Mari language layout +// based on Russian standard keyboard +// http://www.marlamuter.ru/ +partial alphanumeric_keys +xkb_symbols "chm" { + include "ru(common)" + + name[Group1]= "Russia - Mari"; + + key.type[group1]="FOUR_LEVEL_ALPHABETIC"; + key { [ Cyrillic_a, Cyrillic_A, U04D3, U04D2 ] }; + key { [ Cyrillic_u, Cyrillic_U, U04F1, U04F0 ] }; + key { [ Cyrillic_ui, Cyrillic_UI, U04F9, U04F8 ] }; + key { [ Cyrillic_n, Cyrillic_N, U04A5, U04A4 ] }; + key { [ Cyrillic_e, Cyrillic_E, U04E9, U04E8 ] }; + key { [ Cyrillic_zh, Cyrillic_ZH, U04EB, U04EA ] }; + key { [ Cyrillic_f, Cyrillic_F, UF537, UF536 ] }; + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/rupeesign b/xorg-server/xkeyboard-config/symbols/rupeesign index 9851c6ee7..605060af7 100644 --- a/xorg-server/xkeyboard-config/symbols/rupeesign +++ b/xorg-server/xkeyboard-config/symbols/rupeesign @@ -1,7 +1,5 @@ - // keyboards having the RupeeSign on the 4 key partial xkb_symbols "4" { key { [ NoSymbol, NoSymbol, U20B9 ] }; }; - diff --git a/xorg-server/xkeyboard-config/symbols/se b/xorg-server/xkeyboard-config/symbols/se index 6e24202a7..7ba3b36db 100644 --- a/xorg-server/xkeyboard-config/symbols/se +++ b/xorg-server/xkeyboard-config/symbols/se @@ -1,257 +1,253 @@ - -// based on a keyboard map from an 'xkb/symbols/se' file -// -// $XKeyboardConfig$ -// $XFree86: xc/programs/xkbcomp/symbols/se,v 1.5 2003/01/26 02:01:48 dawes Exp $ - -partial default alphanumeric_keys -xkb_symbols "basic" { - include "latin(type2)" - include "se(se)" -}; - -partial alphanumeric_keys -xkb_symbols "se" { - - name[Group1]="Sweden"; - - key { [ 5, percent, EuroSign, cent ] }; - key { [ plus, question, backslash, questiondown ] }; - key { [dead_acute, dead_grave, plusminus, notsign ] }; - - - key { [odiaeresis, Odiaeresis, oslash, Ooblique ] }; - key { [adiaeresis, Adiaeresis, ae, AE ] }; - key { [ section, onehalf, paragraph, threequarters] }; - - key { [apostrophe, asterisk, acute, multiply ] }; - - key { [ space, space, space, nobreakspace ] }; - - key { [ less, greater, bar, brokenbar ] }; - include "kpdl(comma)" - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "nodeadkeys" { - - // Modifies the basic Swedish layout to eliminate all dead keys - - include "latin(type2)" - include "latin(type2_nodeadkeys)" - include "se(se)" - - name[Group1]="Sweden - Eliminate dead keys"; - - key { [ acute, grave, plusminus, notsign ] }; - -}; - -// Swedish Dvorak -partial alphanumeric_keys -xkb_symbols "dvorak" { - - name[Group1]="Sweden - Dvorak"; - - include "se(basic)" - - key { [ aring, Aring, backslash ] }; - key { [ adiaeresis, Adiaeresis, braceleft, bracketleft ] }; - key { [ odiaeresis, Odiaeresis, braceright, bracketright ] }; - key { [ p, P, thorn, THORN ] }; - key { [ y, Y, leftarrow, yen ] }; - key { [ f, F, dstroke, ordfeminine ] }; - key { [ g, G, eng, ENG ] }; - key { [ c, C, copyright, copyright ] }; - key { [ r, R, registered, registered ] }; - key { [ l, L, lstroke, Lstroke ] }; - key { [ comma, semicolon, dead_cedilla, dead_ogonek ] }; - key { [ dead_diaeresis, dead_circumflex, dead_tilde, asciicircum ] }; - - key { [ a, A, ae, AE ] }; - key { [ o, O, oe, OE ] }; - key { [ e, E, EuroSign, cent ] }; - key { [ u, U, downarrow, uparrow ] }; - key { [ i, I, rightarrow, idotless ] }; - key { [ d, D, eth, ETH ] }; - key { [ h, H, hstroke, Hstroke ] }; - key { [ t, T, tslash, Tslash ] }; - key { [ n, N ] }; - key { [ s, S, ssharp, section ] }; - key { [ minus, underscore, dead_belowdot, dead_abovedot ] }; - - key { [ period, colon, periodcentered, dead_abovedot ] }; - key { [ q, Q, at, Greek_OMEGA ] }; - key { [ j, J ] }; - key { [ k, K, kra, ampersand ] }; - key { [ x, X, guillemotright, greater ] }; - key { [ b, B, rightdoublequotemark, apostrophe ] }; - key { [ m, M, mu, masculine ] }; - key { [ w, W, lstroke, Lstroke ] }; - key { [ v, V, leftdoublequotemark, grave ] }; - key { [ z, Z, guillemotleft, less ] }; -}; - -// Ivan Popov, 2005-07-17 -// phonetic layout for Russian cyrillic letters -// on Swedish (latin type2) keyboards - -// level3 modifier is a shortcut to the "se" meaning of the keys where -// we place cyrillic letters, handy for accessing the corresponding -// punctuation marks. -// It is important to have access to punctuation marks, and the rest of -// alphabetical keys are added for being consequent so that the users -// can expect the level3 modifier to give what the key label shows. - -partial alphanumeric_keys -xkb_symbols "rus" { - include "se(basic)" - - name[Group1]="Sweden - Russian phonetic"; - key.type[group1]="ALPHABETIC"; - - key { [ Cyrillic_io, Cyrillic_IO ] }; - key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; - - key { [ Cyrillic_ya, Cyrillic_YA ] }; - key { [ Cyrillic_ve, Cyrillic_VE ] }; - key { [ Cyrillic_ie, Cyrillic_IE ] }; - key { [ Cyrillic_er, Cyrillic_ER ] }; - key { [ Cyrillic_te, Cyrillic_TE ] }; - key { [ Cyrillic_yeru, Cyrillic_YERU ] }; - key { [ Cyrillic_u, Cyrillic_U ] }; - key { [ Cyrillic_i, Cyrillic_I ] }; - key { [ Cyrillic_o, Cyrillic_O ] }; - key { [ Cyrillic_pe, Cyrillic_PE ] }; - key { [ Cyrillic_e, Cyrillic_E ] }; - - key { [ Cyrillic_a, Cyrillic_A ] }; - key { [ Cyrillic_es, Cyrillic_ES ] }; - key { [ Cyrillic_de, Cyrillic_DE ] }; - key { [ Cyrillic_ef, Cyrillic_EF ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key { [ Cyrillic_ha, Cyrillic_HA ] }; - key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; - key { [ Cyrillic_ka, Cyrillic_KA ] }; - key { [ Cyrillic_el, Cyrillic_EL ] }; - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; - key { [ Cyrillic_yu, Cyrillic_YU ] }; - - key { [ Cyrillic_che, Cyrillic_CHE ] }; - key { [ Cyrillic_ze, Cyrillic_ZE ] }; - key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_tse, Cyrillic_TSE ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ Cyrillic_be, Cyrillic_BE ] }; - key { [ Cyrillic_en, Cyrillic_EN ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; -}; - -partial alphanumeric_keys -xkb_symbols "rus_nodeadkeys" { - - include "se(nodeadkeys)" - include "se(rus)" - - name[Group1]="Sweden - Russian phonetic, eliminate dead keys"; - - key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; -}; - -xkb_symbols "smi" { - - // Describes the differences between a Norwegian Northern Sami - // (keyboard with dead key support) and a Swedish/Finnish Sami - // keyboard according to the specs at: - // http://www.hum.uit.no/a/trond/se-lat9-sefi-keys.html - - include "fi(smi)" - - name[Group1]= "Sweden - Northern Saami"; -}; - -// Copied from macintosh_vndr/se -partial alphanumeric_keys -xkb_symbols "mac" { - - // Describes the differences between a very simple en_US - // keyboard and a very simple Swedish(Sweden) keybaord - - include "latin" - name[Group1]= "Sweden - Macintosh"; - - key { [ section, degree ] }; - key { [ 1, exclam, copyright, exclamdown ] }; - key { [ 2, quotedbl, at, oneeighth ] }; - key { [ 3, numbersign, sterling, yen ] }; - key { [ 4, currency, dollar, cent ] }; - key { [ 6, ampersand ] }; - key { [ 7, slash, bar, backslash ] }; - key { [ 8, parenleft, bracketleft, braceleft ] }; - key { [ 9, parenright, bracketright, braceright ] }; - key { [ comma, semicolon ] }; - key { [ 0, equal ] }; - key { [ period, colon ] }; - key { [ minus, underscore ] }; - key { [ odiaeresis, Odiaeresis, oslash, Ooblique ] }; - key { [ plus, question ] }; - key { [ adiaeresis, Adiaeresis, ae, AE ] }; - key { [ aring, Aring ] }; - key { [ acute, grave ] }; - key { [ diaeresis, asciicircum, asciitilde ] }; - key { [ apostrophe, asterisk, at ] }; - - include "kpdl(comma)" - include "level3(ralt_switch)" -}; - -// Svdvorak -// This version of Dvorak follows danish and norwegian style in hope for a -// Scandinavian standard. -partial alphanumeric_keys -xkb_symbols "svdvorak" { - - name[Group1]="Sweden - Svdvorak"; - - include "se(basic)" - - key { [ aring, Aring, braceleft ] }; - key { [ comma, semicolon, bracketleft ] }; - key { [ period, colon, bracketright ] }; - key { [ p, P, braceright ] }; - key { [ y, Y ] }; - key { [ f, F ] }; - key { [ g, G ] }; - key { [ c, C ] }; - key { [ r, R ] }; - key { [ l, L ] }; - key { [ apostrophe, asterisk ] }; - - key { [ a, A ] }; - key { [ o, O, parenleft ] }; - key { [ e, E, parenright ] }; - key { [ u, U ] }; - key { [ i, I ] }; - key { [ d, D ] }; - key { [ h, H ] }; - key { [ t, T ] }; - key { [ n, N ] }; - key { [ s, S, ssharp ] }; - key { [ minus, underscore ] }; - key { [ less, greater, bar ] }; - - key { [ odiaeresis, Odiaeresis ] }; - key { [ adiaeresis, Adiaeresis ] }; - key { [ q, Q ] }; - key { [ j, J ] }; - key { [ k, K ] }; - key { [ x, X ] }; - key { [ b, B ] }; - key { [ m, M ] }; - key { [ w, W ] }; - key { [ v, V ] }; - key { [ z, Z ] }; -}; +// based on a keyboard map from an 'xkb/symbols/se' file + +partial default alphanumeric_keys +xkb_symbols "basic" { + include "latin(type2)" + include "se(se)" +}; + +partial alphanumeric_keys +xkb_symbols "se" { + + name[Group1]="Sweden"; + + key { [ 5, percent, EuroSign, cent ] }; + key { [ plus, question, backslash, questiondown ] }; + key { [dead_acute, dead_grave, plusminus, notsign ] }; + + + key { [odiaeresis, Odiaeresis, oslash, Ooblique ] }; + key { [adiaeresis, Adiaeresis, ae, AE ] }; + key { [ section, onehalf, paragraph, threequarters] }; + + key { [apostrophe, asterisk, acute, multiply ] }; + + key { [ space, space, space, nobreakspace ] }; + + key { [ less, greater, bar, brokenbar ] }; + include "kpdl(comma)" + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "nodeadkeys" { + + // Modifies the basic Swedish layout to eliminate all dead keys + + include "latin(type2)" + include "latin(type2_nodeadkeys)" + include "se(se)" + + name[Group1]="Sweden - Eliminate dead keys"; + + key { [ acute, grave, plusminus, notsign ] }; + +}; + +// Swedish Dvorak +partial alphanumeric_keys +xkb_symbols "dvorak" { + + name[Group1]="Sweden - Dvorak"; + + include "se(basic)" + + key { [ aring, Aring, backslash ] }; + key { [ adiaeresis, Adiaeresis, braceleft, bracketleft ] }; + key { [ odiaeresis, Odiaeresis, braceright, bracketright ] }; + key { [ p, P, thorn, THORN ] }; + key { [ y, Y, leftarrow, yen ] }; + key { [ f, F, dstroke, ordfeminine ] }; + key { [ g, G, eng, ENG ] }; + key { [ c, C, copyright, copyright ] }; + key { [ r, R, registered, registered ] }; + key { [ l, L, lstroke, Lstroke ] }; + key { [ comma, semicolon, dead_cedilla, dead_ogonek ] }; + key { [ dead_diaeresis, dead_circumflex, dead_tilde, asciicircum ] }; + + key { [ a, A, ae, AE ] }; + key { [ o, O, oe, OE ] }; + key { [ e, E, EuroSign, cent ] }; + key { [ u, U, downarrow, uparrow ] }; + key { [ i, I, rightarrow, idotless ] }; + key { [ d, D, eth, ETH ] }; + key { [ h, H, hstroke, Hstroke ] }; + key { [ t, T, tslash, Tslash ] }; + key { [ n, N ] }; + key { [ s, S, ssharp, section ] }; + key { [ minus, underscore, dead_belowdot, dead_abovedot ] }; + + key { [ period, colon, periodcentered, dead_abovedot ] }; + key { [ q, Q, at, Greek_OMEGA ] }; + key { [ j, J ] }; + key { [ k, K, kra, ampersand ] }; + key { [ x, X, guillemotright, greater ] }; + key { [ b, B, rightdoublequotemark, apostrophe ] }; + key { [ m, M, mu, masculine ] }; + key { [ w, W, lstroke, Lstroke ] }; + key { [ v, V, leftdoublequotemark, grave ] }; + key { [ z, Z, guillemotleft, less ] }; +}; + +// Ivan Popov, 2005-07-17 +// phonetic layout for Russian cyrillic letters +// on Swedish (latin type2) keyboards + +// level3 modifier is a shortcut to the "se" meaning of the keys where +// we place cyrillic letters, handy for accessing the corresponding +// punctuation marks. +// It is important to have access to punctuation marks, and the rest of +// alphabetical keys are added for being consequent so that the users +// can expect the level3 modifier to give what the key label shows. + +partial alphanumeric_keys +xkb_symbols "rus" { + include "se(basic)" + + name[Group1]="Sweden - Russian phonetic"; + key.type[group1]="ALPHABETIC"; + + key { [ Cyrillic_io, Cyrillic_IO ] }; + key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; + + key { [ Cyrillic_ya, Cyrillic_YA ] }; + key { [ Cyrillic_ve, Cyrillic_VE ] }; + key { [ Cyrillic_ie, Cyrillic_IE ] }; + key { [ Cyrillic_er, Cyrillic_ER ] }; + key { [ Cyrillic_te, Cyrillic_TE ] }; + key { [ Cyrillic_yeru, Cyrillic_YERU ] }; + key { [ Cyrillic_u, Cyrillic_U ] }; + key { [ Cyrillic_i, Cyrillic_I ] }; + key { [ Cyrillic_o, Cyrillic_O ] }; + key { [ Cyrillic_pe, Cyrillic_PE ] }; + key { [ Cyrillic_e, Cyrillic_E ] }; + + key { [ Cyrillic_a, Cyrillic_A ] }; + key { [ Cyrillic_es, Cyrillic_ES ] }; + key { [ Cyrillic_de, Cyrillic_DE ] }; + key { [ Cyrillic_ef, Cyrillic_EF ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; + key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; + key { [ Cyrillic_ka, Cyrillic_KA ] }; + key { [ Cyrillic_el, Cyrillic_EL ] }; + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; + key { [ Cyrillic_yu, Cyrillic_YU ] }; + + key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_ze, Cyrillic_ZE ] }; + key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_tse, Cyrillic_TSE ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ Cyrillic_be, Cyrillic_BE ] }; + key { [ Cyrillic_en, Cyrillic_EN ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; +}; + +partial alphanumeric_keys +xkb_symbols "rus_nodeadkeys" { + + include "se(nodeadkeys)" + include "se(rus)" + + name[Group1]="Sweden - Russian phonetic, eliminate dead keys"; + + key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; +}; + +xkb_symbols "smi" { + + // Describes the differences between a Norwegian Northern Sami + // (keyboard with dead key support) and a Swedish/Finnish Sami + // keyboard according to the specs at: + // http://www.hum.uit.no/a/trond/se-lat9-sefi-keys.html + + include "fi(smi)" + + name[Group1]= "Sweden - Northern Saami"; +}; + +// Copied from macintosh_vndr/se +partial alphanumeric_keys +xkb_symbols "mac" { + + // Describes the differences between a very simple en_US + // keyboard and a very simple Swedish(Sweden) keybaord + + include "latin" + name[Group1]= "Sweden - Macintosh"; + + key { [ section, degree ] }; + key { [ 1, exclam, copyright, exclamdown ] }; + key { [ 2, quotedbl, at, oneeighth ] }; + key { [ 3, numbersign, sterling, yen ] }; + key { [ 4, currency, dollar, cent ] }; + key { [ 6, ampersand ] }; + key { [ 7, slash, bar, backslash ] }; + key { [ 8, parenleft, bracketleft, braceleft ] }; + key { [ 9, parenright, bracketright, braceright ] }; + key { [ comma, semicolon ] }; + key { [ 0, equal ] }; + key { [ period, colon ] }; + key { [ minus, underscore ] }; + key { [ odiaeresis, Odiaeresis, oslash, Ooblique ] }; + key { [ plus, question ] }; + key { [ adiaeresis, Adiaeresis, ae, AE ] }; + key { [ aring, Aring ] }; + key { [ acute, grave ] }; + key { [ diaeresis, asciicircum, asciitilde ] }; + key { [ apostrophe, asterisk, at ] }; + + include "kpdl(comma)" + include "level3(ralt_switch)" +}; + +// Svdvorak +// This version of Dvorak follows danish and norwegian style in hope for a +// Scandinavian standard. +partial alphanumeric_keys +xkb_symbols "svdvorak" { + + name[Group1]="Sweden - Svdvorak"; + + include "se(basic)" + + key { [ aring, Aring, braceleft ] }; + key { [ comma, semicolon, bracketleft ] }; + key { [ period, colon, bracketright ] }; + key { [ p, P, braceright ] }; + key { [ y, Y ] }; + key { [ f, F ] }; + key { [ g, G ] }; + key { [ c, C ] }; + key { [ r, R ] }; + key { [ l, L ] }; + key { [ apostrophe, asterisk ] }; + + key { [ a, A ] }; + key { [ o, O, parenleft ] }; + key { [ e, E, parenright ] }; + key { [ u, U ] }; + key { [ i, I ] }; + key { [ d, D ] }; + key { [ h, H ] }; + key { [ t, T ] }; + key { [ n, N ] }; + key { [ s, S, ssharp ] }; + key { [ minus, underscore ] }; + key { [ less, greater, bar ] }; + + key { [ odiaeresis, Odiaeresis ] }; + key { [ adiaeresis, Adiaeresis ] }; + key { [ q, Q ] }; + key { [ j, J ] }; + key { [ k, K ] }; + key { [ x, X ] }; + key { [ b, B ] }; + key { [ m, M ] }; + key { [ w, W ] }; + key { [ v, V ] }; + key { [ z, Z ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/sgi_vndr/jp b/xorg-server/xkeyboard-config/symbols/sgi_vndr/jp index 31bb3b59a..00f9ede0f 100644 --- a/xorg-server/xkeyboard-config/symbols/sgi_vndr/jp +++ b/xorg-server/xkeyboard-config/symbols/sgi_vndr/jp @@ -1,46 +1,44 @@ -// $Xorg: jp,v 1.3 2000/08/17 19:54:45 cpqbld Exp $ -xkb_symbols "jp106" { - - name[group1]="Japan/ASCII"; - - key { [ Zenkaku_Hankaku ] }; - key { [ 1, exclam ] }; - key { [ 2, quotedbl ] }; - key { [ 3, numbersign ] }; - key { [ 4, dollar ] }; - key { [ 5, percent ] }; - key { [ 6, ampersand ] }; - key { [ 7, apostrophe ] }; - key { [ 8, parenleft ] }; - key { [ 9, parenright ] }; - key { [ 0, asciitilde ] }; - key { [ minus, equal ] }; - key { [ asciicircum, overbar ] }; - key { [ yen, bar ] }; - - // keys and - are identical to US/ASCII keyboard - key { [ at, grave ] }; - key { [ bracketleft, braceleft ] }; - - key { [ Eisu_Shift, Caps_Lock ] }; - // keys - are identical to US/ASCII keyboard - key { [ semicolon, plus ] }; - key { [ colon, asterisk ] }; - key { [ bracketright, braceright ] }; - - // keys and - are identical to US/ASCII keyboard - key { [ backslash, underscore ] }; - - key { [ Muhenkan ] }; - key { [ Kanji ] }; - key { [ Hiragana_Katakana ] }; -}; - -xkb_symbols "alternate106" { - key { [ 0, overbar ] }; - key { [ asciicircum, asciitilde] }; - key { [ backslash, bar ] }; - key { [ underbar, underscore ] }; - augment "sgi/jp(jp106)" -}; - +xkb_symbols "jp106" { + + name[group1]="Japan/ASCII"; + + key { [ Zenkaku_Hankaku ] }; + key { [ 1, exclam ] }; + key { [ 2, quotedbl ] }; + key { [ 3, numbersign ] }; + key { [ 4, dollar ] }; + key { [ 5, percent ] }; + key { [ 6, ampersand ] }; + key { [ 7, apostrophe ] }; + key { [ 8, parenleft ] }; + key { [ 9, parenright ] }; + key { [ 0, asciitilde ] }; + key { [ minus, equal ] }; + key { [ asciicircum, overbar ] }; + key { [ yen, bar ] }; + + // keys and - are identical to US/ASCII keyboard + key { [ at, grave ] }; + key { [ bracketleft, braceleft ] }; + + key { [ Eisu_Shift, Caps_Lock ] }; + // keys - are identical to US/ASCII keyboard + key { [ semicolon, plus ] }; + key { [ colon, asterisk ] }; + key { [ bracketright, braceright ] }; + + // keys and - are identical to US/ASCII keyboard + key { [ backslash, underscore ] }; + + key { [ Muhenkan ] }; + key { [ Kanji ] }; + key { [ Hiragana_Katakana ] }; +}; + +xkb_symbols "alternate106" { + key { [ 0, overbar ] }; + key { [ asciicircum, asciitilde] }; + key { [ backslash, bar ] }; + key { [ underbar, underscore ] }; + augment "sgi/jp(jp106)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/shift b/xorg-server/xkeyboard-config/symbols/shift index 78951c1ec..64dae8e43 100644 --- a/xorg-server/xkeyboard-config/symbols/shift +++ b/xorg-server/xkeyboard-config/symbols/shift @@ -1,86 +1,84 @@ -// $XKeyboardConfig$ - -partial modifier_keys -xkb_symbols "breaks_caps" { - key { - type = "ALPHABETIC", - actions [Group1] = [ - SetMods(modifiers=Shift), - SetMods(modifiers=Shift+Lock,clearLocks) - ] - }; - key { - type = "ALPHABETIC", - actions [Group1] = [ - SetMods(modifiers=Shift), - SetMods(modifiers=Shift+Lock,clearLocks) - ] - }; -}; - -// When pressed together with another Shift key, set/release Lock. -partial modifier_keys -xkb_symbols "lshift_both_capslock" { - key { - type[Group1]="TWO_LEVEL", - symbols[Group1] = [ Shift_L, Caps_Lock ] - }; -}; -// When pressed together with another Shift key, set or unset Lock. -partial modifier_keys -xkb_symbols "rshift_both_capslock" { - key { - type[Group1]="TWO_LEVEL", - symbols[Group1] = [ Shift_R, Caps_Lock ] - }; -}; -partial modifier_keys -xkb_symbols "both_capslock" { - include "shift(lshift_both_capslock)" - include "shift(rshift_both_capslock)" -}; - -// Release Lock when pressed alone and set Lock when pressed with another Shift key. -partial modifier_keys -xkb_symbols "lshift_both_capslock_cancel" { - key { - type[Group1]="ALPHABETIC", - symbols[Group1] = [ Shift_L, Caps_Lock ] - }; -}; -// Release Lock when pressed alone and set Lock when pressed with another Shift key. -partial modifier_keys -xkb_symbols "rshift_both_capslock_cancel" { - key { - type[Group1]="ALPHABETIC", - symbols[Group1] = [ Shift_R, Caps_Lock ] - }; -}; -partial modifier_keys -xkb_symbols "both_capslock_cancel" { - include "shift(lshift_both_capslock_cancel)" - include "shift(rshift_both_capslock_cancel)" -}; - - -// When pressed together with another Shift key, lock/unlock Shift. -partial modifier_keys -xkb_symbols "lshift_both_shiftlock" { - key { - type[Group1]="TWO_LEVEL", - symbols[Group1] = [ Shift_L, Shift_Lock ] - }; -}; -// When pressed together with another Shift key, lock/unlock Shift. -partial modifier_keys -xkb_symbols "rshift_both_shiftlock" { - key { - type[Group1]="TWO_LEVEL", - symbols[Group1] = [ Shift_R, Shift_Lock ] - }; -}; -partial modifier_keys -xkb_symbols "both_shiftlock" { - include "shift(lshift_both_shiftlock)" - include "shift(rshift_both_shiftlock)" -}; +partial modifier_keys +xkb_symbols "breaks_caps" { + key { + type = "ALPHABETIC", + actions [Group1] = [ + SetMods(modifiers=Shift), + SetMods(modifiers=Shift+Lock,clearLocks) + ] + }; + key { + type = "ALPHABETIC", + actions [Group1] = [ + SetMods(modifiers=Shift), + SetMods(modifiers=Shift+Lock,clearLocks) + ] + }; +}; + +// When pressed together with another Shift key, set/release Lock. +partial modifier_keys +xkb_symbols "lshift_both_capslock" { + key { + type[Group1]="TWO_LEVEL", + symbols[Group1] = [ Shift_L, Caps_Lock ] + }; +}; +// When pressed together with another Shift key, set or unset Lock. +partial modifier_keys +xkb_symbols "rshift_both_capslock" { + key { + type[Group1]="TWO_LEVEL", + symbols[Group1] = [ Shift_R, Caps_Lock ] + }; +}; +partial modifier_keys +xkb_symbols "both_capslock" { + include "shift(lshift_both_capslock)" + include "shift(rshift_both_capslock)" +}; + +// Release Lock when pressed alone and set Lock when pressed with another Shift key. +partial modifier_keys +xkb_symbols "lshift_both_capslock_cancel" { + key { + type[Group1]="ALPHABETIC", + symbols[Group1] = [ Shift_L, Caps_Lock ] + }; +}; +// Release Lock when pressed alone and set Lock when pressed with another Shift key. +partial modifier_keys +xkb_symbols "rshift_both_capslock_cancel" { + key { + type[Group1]="ALPHABETIC", + symbols[Group1] = [ Shift_R, Caps_Lock ] + }; +}; +partial modifier_keys +xkb_symbols "both_capslock_cancel" { + include "shift(lshift_both_capslock_cancel)" + include "shift(rshift_both_capslock_cancel)" +}; + + +// When pressed together with another Shift key, lock/unlock Shift. +partial modifier_keys +xkb_symbols "lshift_both_shiftlock" { + key { + type[Group1]="TWO_LEVEL", + symbols[Group1] = [ Shift_L, Shift_Lock ] + }; +}; +// When pressed together with another Shift key, lock/unlock Shift. +partial modifier_keys +xkb_symbols "rshift_both_shiftlock" { + key { + type[Group1]="TWO_LEVEL", + symbols[Group1] = [ Shift_R, Shift_Lock ] + }; +}; +partial modifier_keys +xkb_symbols "both_shiftlock" { + include "shift(lshift_both_shiftlock)" + include "shift(rshift_both_shiftlock)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/si b/xorg-server/xkeyboard-config/symbols/si index ced6d2fe7..b3b9cbaf8 100644 --- a/xorg-server/xkeyboard-config/symbols/si +++ b/xorg-server/xkeyboard-config/symbols/si @@ -1,33 +1,30 @@ -// $XKeyboardConfig$ -// - -default partial alphanumeric_keys -xkb_symbols "basic" { - - name[Group1]="Slovenia"; - - include "rs(latin)" - - key { type[Group1]="TWO_LEVEL", [ cedilla, diaeresis ] }; -}; - -partial alphanumeric_keys -xkb_symbols "us" { - - name[Group1]= "Slovenia - US keyboard with Slovenian letters"; - - include "rs(latinyz)" - - key { type[Group1]="TWO_LEVEL", [ cedilla, diaeresis ] }; -}; - - -partial alphanumeric_keys -xkb_symbols "alternatequotes" { - - name[Group1]= "Slovenia - Use guillemets for quotes"; - - include "rs(latinalternatequotes)" - - key { type[Group1]="TWO_LEVEL", [ cedilla, diaeresis ] }; -}; +default partial alphanumeric_keys +xkb_symbols "basic" { + + name[Group1]="Slovenia"; + + include "rs(latin)" + + key { type[Group1]="TWO_LEVEL", [ cedilla, diaeresis ] }; +}; + +partial alphanumeric_keys +xkb_symbols "us" { + + name[Group1]= "Slovenia - US keyboard with Slovenian letters"; + + include "rs(latinyz)" + + key { type[Group1]="TWO_LEVEL", [ cedilla, diaeresis ] }; +}; + + +partial alphanumeric_keys +xkb_symbols "alternatequotes" { + + name[Group1]= "Slovenia - Use guillemets for quotes"; + + include "rs(latinalternatequotes)" + + key { type[Group1]="TWO_LEVEL", [ cedilla, diaeresis ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/sk b/xorg-server/xkeyboard-config/symbols/sk index 62d0e7998..342dee6ca 100644 --- a/xorg-server/xkeyboard-config/symbols/sk +++ b/xorg-server/xkeyboard-config/symbols/sk @@ -1,108 +1,103 @@ -// $XKeyboardConfig$ - -// $XFree86: xc/programs/xkbcomp/symbols/sk,v 1.2 2002/11/22 04:02:22 dawes -// Exp $ - -partial default alphanumeric_keys -xkb_symbols "basic" { - - // This layout conforms to a new sk compromise standard designed - // to satisfy most unix, windows and mac users. - // 2001 by Kamil Toman - - include "latin" - - name[Group1] = "Slovakia"; - - key { [ semicolon, dead_abovering, grave, asciitilde ] }; - key { [ plus, 1, exclam, dead_tilde ] }; - key { [ lcaron, 2, at, dead_caron ] }; - key { [ scaron, 3, numbersign, dead_circumflex ] }; - key { [ ccaron, 4, dollar, dead_breve ] }; - key { [ tcaron, 5, percent, dead_abovering ] }; - key { [ zcaron, 6, asciicircum, dead_ogonek ] }; - key { [ yacute, 7, ampersand, dead_grave ] }; - key { [ aacute, 8, asterisk, dead_abovedot ] }; - key { [ iacute, 9, braceleft, dead_acute ] }; - key { [ eacute, 0, braceright, dead_doubleacute ] }; - key { [ equal, percent, NoSymbol, dead_diaeresis ] }; - key { [dead_acute, dead_caron, dead_macron, dead_cedilla ] }; - - key { [ q, Q, backslash, NoSymbol ] }; - key { [ w, W, bar, Nosymbol ] }; - key { [ e, E, EuroSign, NoSymbol ] }; - key { [ r, R, NoSymbol, NoSymbol ] }; - key { [ t, T, NoSymbol, NoSymbol ] }; - key { [ z, Z, NoSymbol, NoSymbol ] }; - key { [ u, U, NoSymbol, NoSymbol ] }; - key { [ i, I, NoSymbol, NoSymbol ] }; - key { [ o, O, NoSymbol, NoSymbol ] }; - key { [ p, P, NoSymbol, NoSymbol ] }; - - key { [ uacute, slash, bracketleft, division ] }; - key { [adiaeresis, parenleft, bracketright, multiply ] }; - - key { [ a, A, asciitilde, NoSymbol ] }; - key { [ s, S, dstroke, NoSymbol ] }; - key { [ d, D, Dstroke, NoSymbol ] }; - key { [ f, F, bracketleft, NoSymbol ] }; - key { [ g, G, bracketright, NoSymbol ] }; - key { [ h, H, grave, NoSymbol ] }; - key { [ j, J, apostrophe, NoSymbol ] }; - key { [ k, K, lstroke, NoSymbol ] }; - key { [ l, L, Lstroke, NoSymbol ] }; - - key { [ocircumflex, quotedbl, dollar, NoSymbol ] }; - key { [ section, exclam, apostrophe, ssharp ] }; - key { [ EuroSign, dead_diaeresis, NoSymbol, NoSymbol ] }; - key { [ ncaron, parenright, backslash, bar ] }; - - key { [ backslash, bar, slash, NoSymbol ] }; - key { [ y, Y, degree, NoSymbol ] }; - key { [ x, X, numbersign, Nosymbol ] }; - key { [ c, C, ampersand, NoSymbol ] }; - key { [ v, V, at, NoSymbol ] }; - key { [ b, B, braceleft, NoSymbol ] }; - key { [ n, N, braceright, NoSymbol ] }; - key { [ m, M, asciicircum, NoSymbol ] }; - key { [ comma, question, less, NoSymbol ] }; - key { [ period, colon, greater, NoSymbol ] }; - key { [ minus, underscore, asterisk, NoSymbol ] }; - - key { [ space, space, nobreakspace, nobreakspace ] }; - - include "level3(ralt_switch)" -}; - -// Use instead of (useful for keyboard without key) -xkb_symbols "bksl" { - include "sk(basic)" - - name[Group1] = "Slovakia - Extended Backslash"; - - key { [ backslash, bar, slash, NoSymbol ] }; -}; - -partial alphanumeric_keys -xkb_symbols "qwerty" { - - // This layout should work exactly as a sk with the exception - // of 'Z' and 'Y' keys, which are in the qwerty style (ie. swapped). - // 2001 by Kamil Toman - - include "sk(basic)" - - name[Group1] = "Slovakia - qwerty"; - - key { [ z, Z, degree, NoSymbol ] }; - key { [ y, Y, NoSymbol, NoSymbol ] }; -}; - -// Use instead of (useful for keyboard without key) -xkb_symbols "qwerty_bksl" { - include "sk(qwerty)" - - name[Group1] = "Slovakia - qwerty, extended Backslash"; - - key { [ backslash, bar, slash, NoSymbol ] }; -}; +partial default alphanumeric_keys +xkb_symbols "basic" { + + // This layout conforms to a new sk compromise standard designed + // to satisfy most unix, windows and mac users. + // 2001 by Kamil Toman + + include "latin" + + name[Group1] = "Slovakia"; + + key { [ semicolon, dead_abovering, grave, asciitilde ] }; + key { [ plus, 1, exclam, dead_tilde ] }; + key { [ lcaron, 2, at, dead_caron ] }; + key { [ scaron, 3, numbersign, dead_circumflex ] }; + key { [ ccaron, 4, dollar, dead_breve ] }; + key { [ tcaron, 5, percent, dead_abovering ] }; + key { [ zcaron, 6, asciicircum, dead_ogonek ] }; + key { [ yacute, 7, ampersand, dead_grave ] }; + key { [ aacute, 8, asterisk, dead_abovedot ] }; + key { [ iacute, 9, braceleft, dead_acute ] }; + key { [ eacute, 0, braceright, dead_doubleacute ] }; + key { [ equal, percent, NoSymbol, dead_diaeresis ] }; + key { [dead_acute, dead_caron, dead_macron, dead_cedilla ] }; + + key { [ q, Q, backslash, NoSymbol ] }; + key { [ w, W, bar, Nosymbol ] }; + key { [ e, E, EuroSign, NoSymbol ] }; + key { [ r, R, NoSymbol, NoSymbol ] }; + key { [ t, T, NoSymbol, NoSymbol ] }; + key { [ z, Z, NoSymbol, NoSymbol ] }; + key { [ u, U, NoSymbol, NoSymbol ] }; + key { [ i, I, NoSymbol, NoSymbol ] }; + key { [ o, O, NoSymbol, NoSymbol ] }; + key { [ p, P, NoSymbol, NoSymbol ] }; + + key { [ uacute, slash, bracketleft, division ] }; + key { [adiaeresis, parenleft, bracketright, multiply ] }; + + key { [ a, A, asciitilde, NoSymbol ] }; + key { [ s, S, dstroke, NoSymbol ] }; + key { [ d, D, Dstroke, NoSymbol ] }; + key { [ f, F, bracketleft, NoSymbol ] }; + key { [ g, G, bracketright, NoSymbol ] }; + key { [ h, H, grave, NoSymbol ] }; + key { [ j, J, apostrophe, NoSymbol ] }; + key { [ k, K, lstroke, NoSymbol ] }; + key { [ l, L, Lstroke, NoSymbol ] }; + + key { [ocircumflex, quotedbl, dollar, NoSymbol ] }; + key { [ section, exclam, apostrophe, ssharp ] }; + key { [ EuroSign, dead_diaeresis, NoSymbol, NoSymbol ] }; + key { [ ncaron, parenright, backslash, bar ] }; + + key { [ backslash, bar, slash, NoSymbol ] }; + key { [ y, Y, degree, NoSymbol ] }; + key { [ x, X, numbersign, Nosymbol ] }; + key { [ c, C, ampersand, NoSymbol ] }; + key { [ v, V, at, NoSymbol ] }; + key { [ b, B, braceleft, NoSymbol ] }; + key { [ n, N, braceright, NoSymbol ] }; + key { [ m, M, asciicircum, NoSymbol ] }; + key { [ comma, question, less, NoSymbol ] }; + key { [ period, colon, greater, NoSymbol ] }; + key { [ minus, underscore, asterisk, NoSymbol ] }; + + key { [ space, space, nobreakspace, nobreakspace ] }; + + include "level3(ralt_switch)" +}; + +// Use instead of (useful for keyboard without key) +xkb_symbols "bksl" { + include "sk(basic)" + + name[Group1] = "Slovakia - Extended Backslash"; + + key { [ backslash, bar, slash, NoSymbol ] }; +}; + +partial alphanumeric_keys +xkb_symbols "qwerty" { + + // This layout should work exactly as a sk with the exception + // of 'Z' and 'Y' keys, which are in the qwerty style (ie. swapped). + // 2001 by Kamil Toman + + include "sk(basic)" + + name[Group1] = "Slovakia - qwerty"; + + key { [ z, Z, degree, NoSymbol ] }; + key { [ y, Y, NoSymbol, NoSymbol ] }; +}; + +// Use instead of (useful for keyboard without key) +xkb_symbols "qwerty_bksl" { + include "sk(qwerty)" + + name[Group1] = "Slovakia - qwerty, extended Backslash"; + + key { [ backslash, bar, slash, NoSymbol ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/sony_vndr/us b/xorg-server/xkeyboard-config/symbols/sony_vndr/us index 76d41053c..a34d7b931 100644 --- a/xorg-server/xkeyboard-config/symbols/sony_vndr/us +++ b/xorg-server/xkeyboard-config/symbols/sony_vndr/us @@ -1,93 +1,91 @@ -// $Xorg: us,v 1.4 2001/02/09 02:05:53 xorgcvs Exp $ -// -//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. -// -// US/ASCII layout for a nwp5461 keyboard -xkb_symbols "nwp5461" { - include "us(basic)" - - key { [ Alt_L, Meta_L ] }; - key { [ Shift_R ] }; - key { [ NoSymbol ] }; - - // Begin "Function" section - key { [ F1 ] }; - key { [ F2 ] }; - key { [ F3 ] }; - key { [ F4 ] }; - key { [ F5 ] }; - key { [ F6 ] }; - key { [ F7 ] }; - key { [ F8 ] }; - key { [ F9 ] }; - key { [ F10 ] }; - key { [ F11 ] }; - key { [ F12 ] }; - key { [ Help ] }; - key { [ Cancel ] }; - key { [ Select ] }; - key { [ Execute ] }; - key { [ Delete ] }; - key { [ Left ] }; - key { [ Right ] }; - key { [ Up ] }; - key { [ Down ] }; - key { [ Prior ] }; - key { [ Next ] }; - key { [ Insert ] }; - key { [ Clear ] }; - // End "Function" section - - // Begin "Keypad" section - key { [ KP_Multiply ] }; - key { [ KP_Divide ] }; - key { [ KP_Add ] }; - - key { [ KP_7 ] }; - key { [ KP_8 ] }; - key { [ KP_9 ] }; - key { [ KP_Subtract ] }; - - key { [ KP_4 ] }; - key { [ KP_5 ] }; - key { [ KP_6 ] }; - key { [ KP_Separator ] }; - - key { [ KP_1 ] }; - key { [ KP_2 ] }; - key { [ KP_3 ] }; - key { [ KP_Enter ] }; - - key { [ KP_0 ] }; - key { [ KP_Decimal ] }; - key { [ KP_Tab ] }; - // End "Keypad" section - - - // begin modifier mappings - modifier_map Shift { Shift_R }; - modifier_map Mod3 { Alt_L }; -}; - +// +//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. +// +// US/ASCII layout for a nwp5461 keyboard +xkb_symbols "nwp5461" { + include "us(basic)" + + key { [ Alt_L, Meta_L ] }; + key { [ Shift_R ] }; + key { [ NoSymbol ] }; + + // Begin "Function" section + key { [ F1 ] }; + key { [ F2 ] }; + key { [ F3 ] }; + key { [ F4 ] }; + key { [ F5 ] }; + key { [ F6 ] }; + key { [ F7 ] }; + key { [ F8 ] }; + key { [ F9 ] }; + key { [ F10 ] }; + key { [ F11 ] }; + key { [ F12 ] }; + key { [ Help ] }; + key { [ Cancel ] }; + key { [ Select ] }; + key { [ Execute ] }; + key { [ Delete ] }; + key { [ Left ] }; + key { [ Right ] }; + key { [ Up ] }; + key { [ Down ] }; + key { [ Prior ] }; + key { [ Next ] }; + key { [ Insert ] }; + key { [ Clear ] }; + // End "Function" section + + // Begin "Keypad" section + key { [ KP_Multiply ] }; + key { [ KP_Divide ] }; + key { [ KP_Add ] }; + + key { [ KP_7 ] }; + key { [ KP_8 ] }; + key { [ KP_9 ] }; + key { [ KP_Subtract ] }; + + key { [ KP_4 ] }; + key { [ KP_5 ] }; + key { [ KP_6 ] }; + key { [ KP_Separator ] }; + + key { [ KP_1 ] }; + key { [ KP_2 ] }; + key { [ KP_3 ] }; + key { [ KP_Enter ] }; + + key { [ KP_0 ] }; + key { [ KP_Decimal ] }; + key { [ KP_Tab ] }; + // End "Keypad" section + + + // begin modifier mappings + modifier_map Shift { Shift_R }; + modifier_map Mod3 { Alt_L }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/srvr_ctrl b/xorg-server/xkeyboard-config/symbols/srvr_ctrl index cf7012b4d..b3d9a865a 100644 --- a/xorg-server/xkeyboard-config/symbols/srvr_ctrl +++ b/xorg-server/xkeyboard-config/symbols/srvr_ctrl @@ -1,130 +1,125 @@ -// $XKeyboardConfig$ - -// $XFree86: xc/programs/xkbcomp/symbols/srvr_ctrl,v 1.4 2003/12/18 14:14:38 pascal Exp $ -// -// Actions which control the server's behavior - -partial keypad_keys function_keys -xkb_symbols "xfree86" { - include "srvr_ctrl(stdkeypad)" - include "srvr_ctrl(fkey2vt)" -}; - -partial keypad_keys -xkb_symbols "stdkeypad" { - -// Ungrab cancels server/keyboard/pointer grabs - key { - type="CTRL+ALT", - symbols[Group1]= [ KP_Divide, XF86_Ungrab ] - }; - -// ClsGrb kills whichever client has a grab in effect - key { - type="CTRL+ALT", - symbols[Group1]= [ KP_Multiply, XF86_ClearGrab ] - }; - -// -VMode switches to the previous video mode - key { - type="CTRL+ALT", - symbols[Group1]= [ KP_Subtract, XF86_Prev_VMode ] - }; - -// +VMode switches to the next video mode - key { - type="CTRL+ALT", - symbols[Group1]= [ KP_Add, XF86_Next_VMode] - }; - -}; - -partial function_keys -xkb_symbols "fkey2vt" { - - key { - type="CTRL+ALT", - symbols[Group1]= [ F1, XF86_Switch_VT_1 ] - }; - - key { - type="CTRL+ALT", - symbols[Group1]= [ F2, XF86_Switch_VT_2 ] - }; - - key { - type="CTRL+ALT", - symbols[Group1]= [ F3, XF86_Switch_VT_3 ] - }; - - key { - type="CTRL+ALT", - symbols[Group1]= [ F4, XF86_Switch_VT_4 ] - }; - - key { - type="CTRL+ALT", - symbols[Group1]= [ F5, XF86_Switch_VT_5 ] - }; - - key { - type="CTRL+ALT", - symbols[Group1]= [ F6, XF86_Switch_VT_6 ] - }; - - key { - type="CTRL+ALT", - symbols[Group1]= [ F7, XF86_Switch_VT_7 ] - }; - - key { - type="CTRL+ALT", - symbols[Group1]= [ F8, XF86_Switch_VT_8 ] - }; - - key { - type="CTRL+ALT", - symbols[Group1]= [ F9, XF86_Switch_VT_9 ] - }; - - key { - type="CTRL+ALT", - symbols[Group1]= [ F10, XF86_Switch_VT_10 ] - }; - - key { - type="CTRL+ALT", - symbols[Group1]= [ F11, XF86_Switch_VT_11 ] - }; - - key { - type="CTRL+ALT", - symbols[Group1]= [ F12, XF86_Switch_VT_12 ] - }; - -}; - -partial function_keys keypad_keys -xkb_symbols "no_srvr_keys" { - - key.type="TWO_LEVEL"; - - key { [ F1, F1 ] }; - key { [ F2, F2 ] }; - key { [ F3, F3 ] }; - key { [ F4, F4 ] }; - key { [ F5, F5 ] }; - key { [ F6, F6 ] }; - key { [ F7, F7 ] }; - key { [ F8, F8 ] }; - key { [ F9, F9 ] }; - key { [ F10, F10 ] }; - key { [ F11, F11 ] }; - key { [ F12, F12 ] }; - - key { [ KP_Divide, KP_Divide ] }; - key { [ KP_Multiply, KP_Multiply ] }; - key { [ KP_Subtract, KP_Subtract ] }; - key { [ KP_Add, KP_Add ] }; -}; - +// Actions which control the server's behavior + +partial keypad_keys function_keys +xkb_symbols "xfree86" { + include "srvr_ctrl(stdkeypad)" + include "srvr_ctrl(fkey2vt)" +}; + +partial keypad_keys +xkb_symbols "stdkeypad" { + +// Ungrab cancels server/keyboard/pointer grabs + key { + type="CTRL+ALT", + symbols[Group1]= [ KP_Divide, XF86_Ungrab ] + }; + +// ClsGrb kills whichever client has a grab in effect + key { + type="CTRL+ALT", + symbols[Group1]= [ KP_Multiply, XF86_ClearGrab ] + }; + +// -VMode switches to the previous video mode + key { + type="CTRL+ALT", + symbols[Group1]= [ KP_Subtract, XF86_Prev_VMode ] + }; + +// +VMode switches to the next video mode + key { + type="CTRL+ALT", + symbols[Group1]= [ KP_Add, XF86_Next_VMode] + }; + +}; + +partial function_keys +xkb_symbols "fkey2vt" { + + key { + type="CTRL+ALT", + symbols[Group1]= [ F1, XF86_Switch_VT_1 ] + }; + + key { + type="CTRL+ALT", + symbols[Group1]= [ F2, XF86_Switch_VT_2 ] + }; + + key { + type="CTRL+ALT", + symbols[Group1]= [ F3, XF86_Switch_VT_3 ] + }; + + key { + type="CTRL+ALT", + symbols[Group1]= [ F4, XF86_Switch_VT_4 ] + }; + + key { + type="CTRL+ALT", + symbols[Group1]= [ F5, XF86_Switch_VT_5 ] + }; + + key { + type="CTRL+ALT", + symbols[Group1]= [ F6, XF86_Switch_VT_6 ] + }; + + key { + type="CTRL+ALT", + symbols[Group1]= [ F7, XF86_Switch_VT_7 ] + }; + + key { + type="CTRL+ALT", + symbols[Group1]= [ F8, XF86_Switch_VT_8 ] + }; + + key { + type="CTRL+ALT", + symbols[Group1]= [ F9, XF86_Switch_VT_9 ] + }; + + key { + type="CTRL+ALT", + symbols[Group1]= [ F10, XF86_Switch_VT_10 ] + }; + + key { + type="CTRL+ALT", + symbols[Group1]= [ F11, XF86_Switch_VT_11 ] + }; + + key { + type="CTRL+ALT", + symbols[Group1]= [ F12, XF86_Switch_VT_12 ] + }; + +}; + +partial function_keys keypad_keys +xkb_symbols "no_srvr_keys" { + + key.type="TWO_LEVEL"; + + key { [ F1, F1 ] }; + key { [ F2, F2 ] }; + key { [ F3, F3 ] }; + key { [ F4, F4 ] }; + key { [ F5, F5 ] }; + key { [ F6, F6 ] }; + key { [ F7, F7 ] }; + key { [ F8, F8 ] }; + key { [ F9, F9 ] }; + key { [ F10, F10 ] }; + key { [ F11, F11 ] }; + key { [ F12, F12 ] }; + + key { [ KP_Divide, KP_Divide ] }; + key { [ KP_Multiply, KP_Multiply ] }; + key { [ KP_Subtract, KP_Subtract ] }; + key { [ KP_Add, KP_Add ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/ara b/xorg-server/xkeyboard-config/symbols/sun_vndr/ara index ea54207b8..d62bb6da9 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/ara +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/ara @@ -114,4 +114,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/ara(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/be b/xorg-server/xkeyboard-config/symbols/sun_vndr/be index d6ce057d4..58abfd6e6 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/be +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/be @@ -96,4 +96,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/be(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/br b/xorg-server/xkeyboard-config/symbols/sun_vndr/br index 4d966f551..3cea0bf9c 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/br +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/br @@ -99,4 +99,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/br(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/ca b/xorg-server/xkeyboard-config/symbols/sun_vndr/ca index 0f0aa2923..6fb72c462 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/ca +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/ca @@ -95,4 +95,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/ca(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/ch b/xorg-server/xkeyboard-config/symbols/sun_vndr/ch index c952fc559..82c0681cc 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/ch +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/ch @@ -131,4 +131,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/ch(de_type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/cz b/xorg-server/xkeyboard-config/symbols/sun_vndr/cz index 6f6b198c5..55859db9a 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/cz +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/cz @@ -103,4 +103,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/cz(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/de b/xorg-server/xkeyboard-config/symbols/sun_vndr/de index 3b1301687..2c46ea941 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/de +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/de @@ -138,4 +138,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/de(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/dk b/xorg-server/xkeyboard-config/symbols/sun_vndr/dk index 4f43112ab..0cc81153d 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/dk +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/dk @@ -145,4 +145,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/dk(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/ee b/xorg-server/xkeyboard-config/symbols/sun_vndr/ee index 1070719a5..914a80dde 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/ee +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/ee @@ -115,4 +115,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/ee(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/es b/xorg-server/xkeyboard-config/symbols/sun_vndr/es index 789df5519..9cb25f382 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/es +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/es @@ -143,4 +143,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/es(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/fi b/xorg-server/xkeyboard-config/symbols/sun_vndr/fi index 817423968..a2f8cd8f4 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/fi +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/fi @@ -87,4 +87,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/fi(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/fr b/xorg-server/xkeyboard-config/symbols/sun_vndr/fr index f52d1956b..e3e6828ef 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/fr +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/fr @@ -94,4 +94,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/fr(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/gb b/xorg-server/xkeyboard-config/symbols/sun_vndr/gb index d21a116cf..fc775cd98 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/gb +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/gb @@ -100,4 +100,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/gb(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/gr b/xorg-server/xkeyboard-config/symbols/sun_vndr/gr index aa5fecbfa..c3a83dad0 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/gr +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/gr @@ -115,4 +115,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/gr(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/it b/xorg-server/xkeyboard-config/symbols/sun_vndr/it index 960bcfc32..7149b0996 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/it +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/it @@ -138,4 +138,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/it(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/jp b/xorg-server/xkeyboard-config/symbols/sun_vndr/jp index 5be8647d2..9b6579e2a 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/jp +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/jp @@ -1,4 +1,3 @@ -// $XdotOrg: $ // // Copyright 2010 Sun Microsystems, Inc. All rights reserved. // @@ -27,7 +26,6 @@ // or other dealings in this Software without prior written authorization // of the copyright holder. // -// $TOG: us /main/5 1998/02/10 13:45:06 kaleb $ // //Copyright 1996, 1998 The Open Group // @@ -816,4 +814,3 @@ xkb_symbols "type7" { key { [ Kana_Lock, Mode_switch ] }; key { [ Alt_R, Alt_R ] }; }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/kr b/xorg-server/xkeyboard-config/symbols/sun_vndr/kr index 51959b23f..0973943bf 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/kr +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/kr @@ -95,4 +95,3 @@ partial default alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/kr(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/lt b/xorg-server/xkeyboard-config/symbols/sun_vndr/lt index 6e51cb342..b82ebcfb9 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/lt +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/lt @@ -116,4 +116,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/lt(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/lv b/xorg-server/xkeyboard-config/symbols/sun_vndr/lv index 6661afddf..d1573868b 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/lv +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/lv @@ -115,4 +115,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/lv(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/nl b/xorg-server/xkeyboard-config/symbols/sun_vndr/nl index 703614277..8469039f7 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/nl +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/nl @@ -146,4 +146,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/nl(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/no b/xorg-server/xkeyboard-config/symbols/sun_vndr/no index 1d1d43449..bbb414da7 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/no +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/no @@ -142,4 +142,3 @@ partial default alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/no(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/pl b/xorg-server/xkeyboard-config/symbols/sun_vndr/pl index 684b54911..6295c3206 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/pl +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/pl @@ -99,4 +99,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/pl(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/pt b/xorg-server/xkeyboard-config/symbols/sun_vndr/pt index 561abb594..b5b108632 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/pt +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/pt @@ -140,4 +140,3 @@ partial default alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/pt(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/ro b/xorg-server/xkeyboard-config/symbols/sun_vndr/ro index df87262ed..f21f9f624 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/ro +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/ro @@ -115,4 +115,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/ro(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/ru b/xorg-server/xkeyboard-config/symbols/sun_vndr/ru index 833576dcc..ec19c9ba3 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/ru +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/ru @@ -109,4 +109,3 @@ partial default alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/ru(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/se b/xorg-server/xkeyboard-config/symbols/sun_vndr/se index ec41629cb..4efaf85fa 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/se +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/se @@ -277,4 +277,3 @@ partial default alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/se(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/sk b/xorg-server/xkeyboard-config/symbols/sun_vndr/sk index f27726013..ee49a7008 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/sk +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/sk @@ -107,4 +107,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/sk(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/tr b/xorg-server/xkeyboard-config/symbols/sun_vndr/tr index 3c95110a1..4eb8d6511 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/tr +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/tr @@ -90,4 +90,3 @@ partial default alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/tr(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/tuv b/xorg-server/xkeyboard-config/symbols/sun_vndr/tuv index 0eda715d8..64037ac42 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/tuv +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/tuv @@ -1,4 +1,3 @@ -// $XdotOrg: $ // // Copyright 2010 Sun Microsystems, Inc. All rights reserved. // @@ -27,7 +26,6 @@ // or other dealings in this Software without prior written authorization // of the copyright holder. // -// $TOG: us /main/5 1998/02/10 13:45:06 kaleb $ // //Copyright 1996, 1998 The Open Group // @@ -261,4 +259,3 @@ xkb_symbols "type5" { key { [ e, E ], [ EuroSign ] }; key { [ backslash, bar ], [ brokenbar ] }; }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/tw b/xorg-server/xkeyboard-config/symbols/sun_vndr/tw index a4c011d45..3f6569d2a 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/tw +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/tw @@ -76,4 +76,3 @@ xkb_symbols "type5" { key { [ backslash, bar, brokenbar ] }; }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/ua b/xorg-server/xkeyboard-config/symbols/sun_vndr/ua index c49b21bce..b18fad4d7 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/ua +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/ua @@ -115,4 +115,3 @@ partial alphanumeric_keys xkb_symbols "basic" { include "sun_vndr/ua(type6)" }; - diff --git a/xorg-server/xkeyboard-config/symbols/sun_vndr/us b/xorg-server/xkeyboard-config/symbols/sun_vndr/us index 8a857a5ab..48d15df17 100644 --- a/xorg-server/xkeyboard-config/symbols/sun_vndr/us +++ b/xorg-server/xkeyboard-config/symbols/sun_vndr/us @@ -398,4 +398,3 @@ xkb_symbols "US101A_Sun" { key { [ Alt_L ] }; key { [ Multi_key ] }; }; - diff --git a/xorg-server/xkeyboard-config/symbols/sy b/xorg-server/xkeyboard-config/symbols/sy index 7825d2376..e5684f191 100644 --- a/xorg-server/xkeyboard-config/symbols/sy +++ b/xorg-server/xkeyboard-config/symbols/sy @@ -1,9 +1,3 @@ -// $XKeyboardConfig$ - -// -// $XFree86: xc/programs/xkbcomp/symbols/syr,v 1.1 2002/11/22 03:06:50 dawes Exp $ -// - partial default alphanumeric_keys xkb_symbols "basic" { include "ara(basic)" @@ -79,9 +73,6 @@ xkb_symbols "syc" { modifier_map Mod2 { Mode_switch }; }; -// -// $XFree86: xc/programs/xkbcomp/symbols/syr_phonetic,v 1.1 2002/11/22 03:06:50 dawes Exp $ -// partial alphanumeric_keys xkb_symbols "syc_phonetic" { @@ -169,4 +160,3 @@ xkb_symbols "ku_alt" { include "tr(ku_alt)" name[Group1]= "Syria - Kurdish, Latin Alt-Q"; }; - diff --git a/xorg-server/xkeyboard-config/symbols/terminate b/xorg-server/xkeyboard-config/symbols/terminate index 47e434d7f..8bb528cf8 100644 --- a/xorg-server/xkeyboard-config/symbols/terminate +++ b/xorg-server/xkeyboard-config/symbols/terminate @@ -1,8 +1,7 @@ -partial default modifier_keys -xkb_symbols "ctrl_alt_bksp" { - key { - type="CTRL+ALT", - symbols[Group1] = [ NoSymbol, Terminate_Server ] - }; -}; - +partial default modifier_keys +xkb_symbols "ctrl_alt_bksp" { + key { + type="CTRL+ALT", + symbols[Group1] = [ NoSymbol, Terminate_Server ] + }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/th b/xorg-server/xkeyboard-config/symbols/th index 050fb5278..1251997f0 100644 --- a/xorg-server/xkeyboard-config/symbols/th +++ b/xorg-server/xkeyboard-config/symbols/th @@ -1,249 +1,245 @@ -// $XKeyboardConfig$ - -// based on a keyboard map from an 'xkb/symbols/th' file -// -// $XFree86: xc/programs/xkbcomp/symbols/th,v 1.3 2003/04/03 16:34:51 dawes Exp $ - -partial default alphanumeric_keys -xkb_symbols "basic" { - name[Group1]= "Thailand"; - - // converted to THai keysysms - Pablo Saratxaga - - key { [ underscore, percent ] }; - key { [ Thai_lakkhangyao, plus ] }; - key { [ slash, Thai_leknung ] }; - key { [ minus, Thai_leksong ] }; - key { [ Thai_phosamphao, Thai_leksam ] }; - key { [ Thai_thothung, Thai_leksi ] }; - key { [ Thai_sarau, Thai_sarauu ] }; - key { [ Thai_saraue, Thai_baht ] }; - key { [ Thai_khokhwai, Thai_lekha ] }; - key { [ Thai_totao, Thai_lekhok ] }; - key { [ Thai_chochan, Thai_lekchet ] }; - key { [ Thai_khokhai, Thai_lekpaet ] }; - key { [ Thai_chochang, Thai_lekkao ] }; - - key { [ Thai_maiyamok, Thai_leksun ] }; - key { [ Thai_saraaimaimalai, quotedbl ] }; - key { [ Thai_saraam, Thai_dochada ] }; - key { [ Thai_phophan, Thai_thonangmontho ] }; - key { [ Thai_saraa, Thai_thothong ] }; - key { [ Thai_maihanakat, Thai_nikhahit ] }; - key { [ Thai_saraii, Thai_maitri ] }; - key { [ Thai_rorua, Thai_nonen ] }; - key { [ Thai_nonu, Thai_paiyannoi ] }; - key { [ Thai_yoyak, Thai_yoying ] }; - key { [ Thai_bobaimai, Thai_thothan ] }; - key { [ Thai_loling, comma ] }; - - key { [ Thai_fofan, Thai_ru ] }; - key { [ Thai_hohip, Thai_khorakhang ] }; - key { [ Thai_kokai, Thai_topatak ] }; - key { [ Thai_dodek, Thai_sarao ] }; - key { [ Thai_sarae, Thai_chochoe ] }; - key { [ Thai_maitho, Thai_maitaikhu ] }; - key { [ Thai_maiek, Thai_maichattawa ] }; - key { [ Thai_saraaa, Thai_sorusi ] }; - key { [ Thai_sosua, Thai_sosala ] }; - key { [ Thai_wowaen, Thai_soso ] }; - key { [ Thai_ngongu, period ] }; - - key { [ Thai_phophung, parenleft ] }; - key { [ Thai_popla, parenright ] }; - key { [ Thai_saraae, Thai_choching ] }; - key { [ Thai_oang, Thai_honokhuk ] }; - key { [ Thai_sarai, Thai_phinthu ] }; - key { [ Thai_sarauee, Thai_thanthakhat ] }; - key { [ Thai_thothahan, question ] }; - key { [ Thai_moma, Thai_thophuthao ] }; - key { [ Thai_saraaimaimuan, Thai_lochula ] }; - key { [ Thai_fofa, Thai_lu ] }; - - key { [ Thai_khokhuat, Thai_khokhon ] }; -}; - -partial alphanumeric_keys -xkb_symbols "pat" { - name[Group1]= "Thailand - Pattachote"; - // The thai layout defines a second keyboard group and changes - // the behavior of a few modifier keys. - - // converted to THai keysysms - Pablo Saratxaga pablo@mandrakesoft.com - // Pattachote modification by Visanu Euarchukiati -- visanu@inet.co.th - key { [ underscore, Thai_baht ] }; - key { [ equal, plus ] }; - key { [ Thai_leksong, quotedbl ] }; - key { [ Thai_leksam, slash ] }; - key { [ Thai_leksi, comma ] }; - key { [ Thai_lekha, question ] }; - key { [ Thai_sarauu, Thai_sarau ] }; - key { [ Thai_lekchet, underscore ] }; - key { [ Thai_lekpaet, period ] }; - key { [ Thai_lekkao, parenleft ] }; - key { [ Thai_leksun, parenright ] }; - key { [ Thai_leknung, minus ] }; - key { [ Thai_lekhok, percent ] }; - - key { [ Thai_maitaikhu, Thai_maitri ] }; - key { [ Thai_totao, Thai_ru ] }; - key { [ Thai_yoyak, Thai_maiyamok ] }; - key { [ Thai_oang, Thai_yoying ] }; - key { [ Thai_rorua, Thai_sorusi ] }; - key { [ Thai_maiek, Thai_saraue ] }; - key { [ Thai_dodek, Thai_fofa ] }; - key { [ Thai_moma, Thai_soso ] }; - key { [ Thai_wowaen, Thai_thothung ] }; - key { [ Thai_saraae, Thai_thophuthao ] }; - key { [ Thai_saraaimaimuan, Thai_paiyannoi ] }; - key { [ Thai_chochoe, Thai_lu ] }; - - key { [ Thai_maitho, Thai_maichattawa] }; - key { [ Thai_thothahan, Thai_thothong ] }; - key { [ Thai_ngongu, Thai_saraam ] }; - key { [ Thai_kokai, Thai_nonen ] }; - key { [ Thai_maihanakat, Thai_thanthakhat] }; - key { [ Thai_saraii, Thai_sarauee ] }; - key { [ Thai_saraaa, Thai_phophung ] }; - key { [ Thai_nonu, Thai_chochang ] }; - key { [ Thai_sarae, Thai_sarao ] }; - key { [ Thai_saraaimaimalai, Thai_khorakhang ] }; - key { [ Thai_khokhai, Thai_thonangmontho ] }; - - key { [ Thai_bobaimai, Thai_dochada ] }; - key { [ Thai_popla, Thai_topatak ] }; - key { [ Thai_loling, Thai_thothan ] }; - key { [ Thai_hohip, Thai_phosamphao ] }; - key { [ Thai_sarai, Thai_phinthu ] }; - key { [ Thai_khokhwai, Thai_sosala ] }; - key { [ Thai_sosua, Thai_honokhuk ] }; - key { [ Thai_saraa, Thai_fofan ] }; - key { [ Thai_chochan, Thai_choching ] }; - key { [ Thai_phophan, Thai_lochula ] }; - - key { [ Thai_lakkhangyao, Thai_nikhahit ] }; -}; - - -partial alphanumeric_keys -xkb_symbols "tis" { - name[Group1]= "Thailand - TIS-820.2538"; - // The thai layout defines a second keyboard group and changes - // the behavior of a few modifier keys. - - // converted to THai keysysms - Pablo Saratxaga - // modified to TIS-820.2538 - Theppitak Karoonboonyanan - key { [ 0x1000e4f, 0x1000e5b ] }; - key { [ Thai_baht, Thai_lakkhangyao] }; - key { [ slash, Thai_leknung ] }; - key { [ minus, Thai_leksong ] }; - key { [ Thai_phosamphao, Thai_leksam ] }; - key { [ Thai_thothung, Thai_leksi ] }; - key { [ Thai_sarau, Thai_sarauu ] }; - key { [ Thai_saraue, 0x1000e4e ] }; - key { [ Thai_khokhwai, Thai_lekha ] }; - key { [ Thai_totao, Thai_lekhok ] }; - key { [ Thai_chochan, Thai_lekchet ] }; - key { [ Thai_khokhai, Thai_lekpaet ] }; - key { [ Thai_chochang, Thai_lekkao ] }; - - key { [ Thai_maiyamok, Thai_leksun ] }; - key { [ Thai_saraaimaimalai, quotedbl ] }; - key { [ Thai_saraam, Thai_dochada ] }; - key { [ Thai_phophan, Thai_thonangmontho ] }; - key { [ Thai_saraa, Thai_thothong ] }; - key { [ Thai_maihanakat, Thai_nikhahit ] }; - key { [ Thai_saraii, Thai_maitri ] }; - key { [ Thai_rorua, Thai_nonen ] }; - key {type[Group1]="THREE_LEVEL", - [ Thai_nonu, Thai_paiyannoi, 0x1000e5a] }; - key { [ Thai_yoyak, Thai_yoying ] }; - key { [ Thai_bobaimai, Thai_thothan ] }; - key { [ Thai_loling, comma ] }; - - key { [ Thai_fofan, Thai_ru ] }; - key { [ Thai_hohip, Thai_khorakhang ] }; - key { [ Thai_kokai, Thai_topatak ] }; - key { [ Thai_dodek, Thai_sarao ] }; - key { [ Thai_sarae, Thai_chochoe ] }; - key { [ Thai_maitho, Thai_maitaikhu ] }; - key { [ Thai_maiek, Thai_maichattawa ] }; - key { [ Thai_saraaa, Thai_sorusi ] }; - key { [ Thai_sosua, Thai_sosala ] }; - key { [ Thai_wowaen, Thai_soso ] }; - key { [ Thai_ngongu, period ] }; - - key { [ Thai_phophung, parenleft ] }; - key { [ Thai_popla, parenright ] }; - key { [ Thai_saraae, Thai_choching ] }; - key { [ Thai_oang, Thai_honokhuk ] }; - key { [ Thai_sarai, Thai_phinthu ] }; - key { [ Thai_sarauee, Thai_thanthakhat ] }; - key { [ Thai_thothahan, question ] }; - key { [ Thai_moma, Thai_thophuthao ] }; - key { [ Thai_saraaimaimuan, Thai_lochula ] }; - key { [ Thai_fofa, Thai_lu ] }; - - key { [ Thai_khokhon, Thai_khokhuat ] }; -}; - -partial alphanumeric_keys -xkb_symbols "olpc" { - - name[Group1]= "Thailand"; - // The OLPC thai layout - // walter@laptop.org - - key { [ 0x1000E4F, 0x1000E5B ] }; - key { [ 0x1000E3F, 0x1000E45 ] }; - key { [ slash, 0x1000E51 ] }; - key { [ minus, 0x1000E52 ] }; - key { [ 0x1000E20, 0x1000E53 ] }; - key { [ 0x1000E16, 0x1000E54 ] }; - key { [ 0x1000E38, 0x1000E39 ] }; - key { [ 0x1000E36, 0x1000E4E ] }; - key { [ 0x1000E04, 0x1000E55 ] }; - key { [ 0x1000E15, 0x1000E56 ] }; - key { [ 0x1000E08, 0x1000E57 ] }; - key { [ 0x1000E02, 0x1000E58 ] }; - key { [ 0x1000E0A, 0x1000E59 ] }; - - key { [ 0x1000E46, 0x1000E50 ] }; - key { [ 0x1000E44, quotedbl ] }; - key { [ 0x1000E33, 0x1000E0E ] }; - key { [ 0x1000E1E, 0x1000E11 ] }; - key { [ 0x1000E30, 0x1000E18 ] }; - key { [ 0x1000E31, 0x1000E4D ] }; - key { [ 0x1000E35, 0x1000E4A ] }; - key { [ 0x1000E23, 0x1000E13 ] }; - key { [ 0x1000E19, 0x1000E2F ] }; - key { [ 0x1000E22, 0x1000E0D ] }; - key { [ 0x1000E1A, 0x1000E10 ] }; - key { [ 0x1000E25, comma ] }; - - key { [ 0x1000E1F, 0x1000E24 ] }; - key { [ 0x1000E2B, 0x1000E06 ] }; - key { [ 0x1000E01, 0x1000E0F ] }; - key { [ 0x1000E14, 0x1000E42 ] }; - key { [ 0x1000E40, 0x1000E0C ] }; - key { [ 0x1000E49, 0x1000E47 ] }; - key { [ 0x1000E48, 0x1000E4B ] }; - key { [ 0x1000E32, 0x1000E29 ] }; - key { [ 0x1000E2A, 0x1000E28 ] }; - key { [ 0x1000E27, 0x1000E0B ] }; - key { [ 0x1000E07, period ] }; - key { [ 0x1000E05, 0x1000E03 ] }; - - key { [ 0x1000E1C, parenleft ] }; - key { [ 0x1000E1B, parenright ] }; - key { [ 0x1000E41, 0x1000E09 ] }; - key { [ 0x1000E2D, 0x1000E2E ] }; - key { [ 0x1000E34, 0x1000E3A ] }; - key { [ 0x1000E37, 0x1000E4C ] }; - key { [ 0x1000E17, question ] }; - key { [ 0x1000E21, 0x1000E12 ] }; - key { [ 0x1000E43, 0x1000E2C ] }; - key { [ 0x1000E1D, 0x1000E26 ] }; - - include "group(olpc)" -}; +// based on a keyboard map from an 'xkb/symbols/th' file + +partial default alphanumeric_keys +xkb_symbols "basic" { + name[Group1]= "Thailand"; + + // converted to THai keysysms - Pablo Saratxaga + + key { [ underscore, percent ] }; + key { [ Thai_lakkhangyao, plus ] }; + key { [ slash, Thai_leknung ] }; + key { [ minus, Thai_leksong ] }; + key { [ Thai_phosamphao, Thai_leksam ] }; + key { [ Thai_thothung, Thai_leksi ] }; + key { [ Thai_sarau, Thai_sarauu ] }; + key { [ Thai_saraue, Thai_baht ] }; + key { [ Thai_khokhwai, Thai_lekha ] }; + key { [ Thai_totao, Thai_lekhok ] }; + key { [ Thai_chochan, Thai_lekchet ] }; + key { [ Thai_khokhai, Thai_lekpaet ] }; + key { [ Thai_chochang, Thai_lekkao ] }; + + key { [ Thai_maiyamok, Thai_leksun ] }; + key { [ Thai_saraaimaimalai, quotedbl ] }; + key { [ Thai_saraam, Thai_dochada ] }; + key { [ Thai_phophan, Thai_thonangmontho ] }; + key { [ Thai_saraa, Thai_thothong ] }; + key { [ Thai_maihanakat, Thai_nikhahit ] }; + key { [ Thai_saraii, Thai_maitri ] }; + key { [ Thai_rorua, Thai_nonen ] }; + key { [ Thai_nonu, Thai_paiyannoi ] }; + key { [ Thai_yoyak, Thai_yoying ] }; + key { [ Thai_bobaimai, Thai_thothan ] }; + key { [ Thai_loling, comma ] }; + + key { [ Thai_fofan, Thai_ru ] }; + key { [ Thai_hohip, Thai_khorakhang ] }; + key { [ Thai_kokai, Thai_topatak ] }; + key { [ Thai_dodek, Thai_sarao ] }; + key { [ Thai_sarae, Thai_chochoe ] }; + key { [ Thai_maitho, Thai_maitaikhu ] }; + key { [ Thai_maiek, Thai_maichattawa ] }; + key { [ Thai_saraaa, Thai_sorusi ] }; + key { [ Thai_sosua, Thai_sosala ] }; + key { [ Thai_wowaen, Thai_soso ] }; + key { [ Thai_ngongu, period ] }; + + key { [ Thai_phophung, parenleft ] }; + key { [ Thai_popla, parenright ] }; + key { [ Thai_saraae, Thai_choching ] }; + key { [ Thai_oang, Thai_honokhuk ] }; + key { [ Thai_sarai, Thai_phinthu ] }; + key { [ Thai_sarauee, Thai_thanthakhat ] }; + key { [ Thai_thothahan, question ] }; + key { [ Thai_moma, Thai_thophuthao ] }; + key { [ Thai_saraaimaimuan, Thai_lochula ] }; + key { [ Thai_fofa, Thai_lu ] }; + + key { [ Thai_khokhuat, Thai_khokhon ] }; +}; + +partial alphanumeric_keys +xkb_symbols "pat" { + name[Group1]= "Thailand - Pattachote"; + // The thai layout defines a second keyboard group and changes + // the behavior of a few modifier keys. + + // converted to THai keysysms - Pablo Saratxaga pablo@mandrakesoft.com + // Pattachote modification by Visanu Euarchukiati -- visanu@inet.co.th + key { [ underscore, Thai_baht ] }; + key { [ equal, plus ] }; + key { [ Thai_leksong, quotedbl ] }; + key { [ Thai_leksam, slash ] }; + key { [ Thai_leksi, comma ] }; + key { [ Thai_lekha, question ] }; + key { [ Thai_sarauu, Thai_sarau ] }; + key { [ Thai_lekchet, underscore ] }; + key { [ Thai_lekpaet, period ] }; + key { [ Thai_lekkao, parenleft ] }; + key { [ Thai_leksun, parenright ] }; + key { [ Thai_leknung, minus ] }; + key { [ Thai_lekhok, percent ] }; + + key { [ Thai_maitaikhu, Thai_maitri ] }; + key { [ Thai_totao, Thai_ru ] }; + key { [ Thai_yoyak, Thai_maiyamok ] }; + key { [ Thai_oang, Thai_yoying ] }; + key { [ Thai_rorua, Thai_sorusi ] }; + key { [ Thai_maiek, Thai_saraue ] }; + key { [ Thai_dodek, Thai_fofa ] }; + key { [ Thai_moma, Thai_soso ] }; + key { [ Thai_wowaen, Thai_thothung ] }; + key { [ Thai_saraae, Thai_thophuthao ] }; + key { [ Thai_saraaimaimuan, Thai_paiyannoi ] }; + key { [ Thai_chochoe, Thai_lu ] }; + + key { [ Thai_maitho, Thai_maichattawa] }; + key { [ Thai_thothahan, Thai_thothong ] }; + key { [ Thai_ngongu, Thai_saraam ] }; + key { [ Thai_kokai, Thai_nonen ] }; + key { [ Thai_maihanakat, Thai_thanthakhat] }; + key { [ Thai_saraii, Thai_sarauee ] }; + key { [ Thai_saraaa, Thai_phophung ] }; + key { [ Thai_nonu, Thai_chochang ] }; + key { [ Thai_sarae, Thai_sarao ] }; + key { [ Thai_saraaimaimalai, Thai_khorakhang ] }; + key { [ Thai_khokhai, Thai_thonangmontho ] }; + + key { [ Thai_bobaimai, Thai_dochada ] }; + key { [ Thai_popla, Thai_topatak ] }; + key { [ Thai_loling, Thai_thothan ] }; + key { [ Thai_hohip, Thai_phosamphao ] }; + key { [ Thai_sarai, Thai_phinthu ] }; + key { [ Thai_khokhwai, Thai_sosala ] }; + key { [ Thai_sosua, Thai_honokhuk ] }; + key { [ Thai_saraa, Thai_fofan ] }; + key { [ Thai_chochan, Thai_choching ] }; + key { [ Thai_phophan, Thai_lochula ] }; + + key { [ Thai_lakkhangyao, Thai_nikhahit ] }; +}; + + +partial alphanumeric_keys +xkb_symbols "tis" { + name[Group1]= "Thailand - TIS-820.2538"; + // The thai layout defines a second keyboard group and changes + // the behavior of a few modifier keys. + + // converted to THai keysysms - Pablo Saratxaga + // modified to TIS-820.2538 - Theppitak Karoonboonyanan + key { [ 0x1000e4f, 0x1000e5b ] }; + key { [ Thai_baht, Thai_lakkhangyao] }; + key { [ slash, Thai_leknung ] }; + key { [ minus, Thai_leksong ] }; + key { [ Thai_phosamphao, Thai_leksam ] }; + key { [ Thai_thothung, Thai_leksi ] }; + key { [ Thai_sarau, Thai_sarauu ] }; + key { [ Thai_saraue, 0x1000e4e ] }; + key { [ Thai_khokhwai, Thai_lekha ] }; + key { [ Thai_totao, Thai_lekhok ] }; + key { [ Thai_chochan, Thai_lekchet ] }; + key { [ Thai_khokhai, Thai_lekpaet ] }; + key { [ Thai_chochang, Thai_lekkao ] }; + + key { [ Thai_maiyamok, Thai_leksun ] }; + key { [ Thai_saraaimaimalai, quotedbl ] }; + key { [ Thai_saraam, Thai_dochada ] }; + key { [ Thai_phophan, Thai_thonangmontho ] }; + key { [ Thai_saraa, Thai_thothong ] }; + key { [ Thai_maihanakat, Thai_nikhahit ] }; + key { [ Thai_saraii, Thai_maitri ] }; + key { [ Thai_rorua, Thai_nonen ] }; + key {type[Group1]="THREE_LEVEL", + [ Thai_nonu, Thai_paiyannoi, 0x1000e5a] }; + key { [ Thai_yoyak, Thai_yoying ] }; + key { [ Thai_bobaimai, Thai_thothan ] }; + key { [ Thai_loling, comma ] }; + + key { [ Thai_fofan, Thai_ru ] }; + key { [ Thai_hohip, Thai_khorakhang ] }; + key { [ Thai_kokai, Thai_topatak ] }; + key { [ Thai_dodek, Thai_sarao ] }; + key { [ Thai_sarae, Thai_chochoe ] }; + key { [ Thai_maitho, Thai_maitaikhu ] }; + key { [ Thai_maiek, Thai_maichattawa ] }; + key { [ Thai_saraaa, Thai_sorusi ] }; + key { [ Thai_sosua, Thai_sosala ] }; + key { [ Thai_wowaen, Thai_soso ] }; + key { [ Thai_ngongu, period ] }; + + key { [ Thai_phophung, parenleft ] }; + key { [ Thai_popla, parenright ] }; + key { [ Thai_saraae, Thai_choching ] }; + key { [ Thai_oang, Thai_honokhuk ] }; + key { [ Thai_sarai, Thai_phinthu ] }; + key { [ Thai_sarauee, Thai_thanthakhat ] }; + key { [ Thai_thothahan, question ] }; + key { [ Thai_moma, Thai_thophuthao ] }; + key { [ Thai_saraaimaimuan, Thai_lochula ] }; + key { [ Thai_fofa, Thai_lu ] }; + + key { [ Thai_khokhon, Thai_khokhuat ] }; +}; + +partial alphanumeric_keys +xkb_symbols "olpc" { + + name[Group1]= "Thailand"; + // The OLPC thai layout + // walter@laptop.org + + key { [ 0x1000E4F, 0x1000E5B ] }; + key { [ 0x1000E3F, 0x1000E45 ] }; + key { [ slash, 0x1000E51 ] }; + key { [ minus, 0x1000E52 ] }; + key { [ 0x1000E20, 0x1000E53 ] }; + key { [ 0x1000E16, 0x1000E54 ] }; + key { [ 0x1000E38, 0x1000E39 ] }; + key { [ 0x1000E36, 0x1000E4E ] }; + key { [ 0x1000E04, 0x1000E55 ] }; + key { [ 0x1000E15, 0x1000E56 ] }; + key { [ 0x1000E08, 0x1000E57 ] }; + key { [ 0x1000E02, 0x1000E58 ] }; + key { [ 0x1000E0A, 0x1000E59 ] }; + + key { [ 0x1000E46, 0x1000E50 ] }; + key { [ 0x1000E44, quotedbl ] }; + key { [ 0x1000E33, 0x1000E0E ] }; + key { [ 0x1000E1E, 0x1000E11 ] }; + key { [ 0x1000E30, 0x1000E18 ] }; + key { [ 0x1000E31, 0x1000E4D ] }; + key { [ 0x1000E35, 0x1000E4A ] }; + key { [ 0x1000E23, 0x1000E13 ] }; + key { [ 0x1000E19, 0x1000E2F ] }; + key { [ 0x1000E22, 0x1000E0D ] }; + key { [ 0x1000E1A, 0x1000E10 ] }; + key { [ 0x1000E25, comma ] }; + + key { [ 0x1000E1F, 0x1000E24 ] }; + key { [ 0x1000E2B, 0x1000E06 ] }; + key { [ 0x1000E01, 0x1000E0F ] }; + key { [ 0x1000E14, 0x1000E42 ] }; + key { [ 0x1000E40, 0x1000E0C ] }; + key { [ 0x1000E49, 0x1000E47 ] }; + key { [ 0x1000E48, 0x1000E4B ] }; + key { [ 0x1000E32, 0x1000E29 ] }; + key { [ 0x1000E2A, 0x1000E28 ] }; + key { [ 0x1000E27, 0x1000E0B ] }; + key { [ 0x1000E07, period ] }; + key { [ 0x1000E05, 0x1000E03 ] }; + + key { [ 0x1000E1C, parenleft ] }; + key { [ 0x1000E1B, parenright ] }; + key { [ 0x1000E41, 0x1000E09 ] }; + key { [ 0x1000E2D, 0x1000E2E ] }; + key { [ 0x1000E34, 0x1000E3A ] }; + key { [ 0x1000E37, 0x1000E4C ] }; + key { [ 0x1000E17, question ] }; + key { [ 0x1000E21, 0x1000E12 ] }; + key { [ 0x1000E43, 0x1000E2C ] }; + key { [ 0x1000E1D, 0x1000E26 ] }; + + include "group(olpc)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/tj b/xorg-server/xkeyboard-config/symbols/tj index 0dcb29d43..fdaf7321d 100644 --- a/xorg-server/xkeyboard-config/symbols/tj +++ b/xorg-server/xkeyboard-config/symbols/tj @@ -1,139 +1,136 @@ -// $XKeyboardConfig$ - -// 17/07/2008 -// ------------------------------------------------------------- -// Standard Tojiki Keyboard Layout, Official Standard -// ------------------------------------------------------------- -// Created by Victor Ibragimov -// Tajik Fedora & Software Localization Team -// ------------------------------------------------------------- -// DUAL INPUT METHOD -// -------------------------------------------------------------------- -// -------------- Tajiki Official Keyboard Layout---------------------- -// -------------------------------------------------------------------- -// - -partial default alphanumeric_keys -xkb_symbols "basic" -{ - name[Group1] = "Tajikistan"; - - include "kpdl(comma)" - include "level3(ralt_switch)" - - key { [ Cyrillic_ya, Cyrillic_YA ] }; // я Я - key { [ Cyrillic_che, Cyrillic_CHE ] }; // ч Ч - key { [ Cyrillic_es, Cyrillic_ES ] }; // с С - key { [ Cyrillic_em, Cyrillic_EM ] }; // м М - key { [ Cyrillic_i, Cyrillic_I ] }; // и И - key { [ Cyrillic_te, Cyrillic_TE ] }; // т Т - key { [ 0x10004e3, 0x10004e2 ] }; // ӣ Ӣ - key { [ Cyrillic_be, Cyrillic_BE ] }; // б Б - key { [ Cyrillic_yu, Cyrillic_YU ] }; // ю Ю - key { [ period, comma ] }; // . , - key { [ Cyrillic_ef, Cyrillic_EF ] }; // ф Ф - key { [ 0x10004b7, 0x10004b6 ] }; // ҷ Ҷ - key { [ Cyrillic_ve, Cyrillic_VE ] }; // в В - key { [ Cyrillic_a, Cyrillic_A ] }; // а А - key { [ Cyrillic_pe, Cyrillic_PE ] }; // п П - key { [ Cyrillic_er, Cyrillic_ER ] }; // р Р - key { [ Cyrillic_o, Cyrillic_O ] }; // о О - key { [ Cyrillic_el, Cyrillic_EL ] }; // л Л - key { [ Cyrillic_de, Cyrillic_DE ] }; // д Д - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; // ж Ж - key { [ Cyrillic_e, Cyrillic_E ] }; // э Э - key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; // й Й - key { [ 0x100049b, 0x100049a ] }; // қ Қ - key { [ Cyrillic_u, Cyrillic_U ] }; // у У - key { [ Cyrillic_ka, Cyrillic_KA ] }; // к К - key { [ Cyrillic_ie, Cyrillic_IE ] }; // е Е - key { [ Cyrillic_en, Cyrillic_EN ] }; // н Н - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; // г Г - key { [ Cyrillic_sha, Cyrillic_SHA ] }; // ш Ш - key { [ 0x10004b3, 0x10004b2 ] }; // ҳ Ҳ - key { [ Cyrillic_ze, Cyrillic_ZE ] }; // з З - key { [ Cyrillic_ha, Cyrillic_HA ] }; // х Х - key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; // ъ Ъ - key { [ 1, exclam, 0x10000a7 ] }; // 1 ! § - key { [ 2, quotedbl, 0x10000ab, 0x10000bb ] }; // 2 " « » - key { [ 3, numerosign ] }; // 3 № - key { [ 4, semicolon ] }; // 4 ; - key { [ 5, percent ] }; // 5 % - key { [ 6, colon, 0x1002013 ] }; // 6 : – - key { [ 7, question, ampersand ] }; // 7 ? & - key { [ 8, asterisk ] }; // 8 * - key { [ 9, parenleft ] }; // 9 ( - key { [ 0, parenright, 0x10000b0 ] }; // 0 ) ° - key { [ 0x1000493, 0x1000492, minus, underscore ] }; // ғ Ғ - _ - key { [ 0x10004ef, 0x10004ee, equal, plus ] }; // ӯ Ӯ = + - key { [ backslash, slash ] }; // \ / - key { [ slash, bar ] }; // / | - key { [ Cyrillic_io, Cyrillic_IO ] }; // ё Ё -}; - -// -------------------------------------------------------------------- -// -------------- Tojiki Rusi Keyboard Layout-------------------------- -// -------------------------------------------------------------------- -// AEN -// 2001/12/23 by Leon Kanter -// 2005/12/09 Valery Inozemtsev -// Pablo Saratxaga (for the dead keys changes) -// -------------------------------------------------------------------- - -xkb_symbols "legacy" -{ - name[Group1] = "Tajikistan - Legacy"; - - include "kpdl(comma)" - include "level3(ralt_switch)" - - key { [ Cyrillic_ya, Cyrillic_YA ] }; // я Я - key { [ Cyrillic_che, Cyrillic_CHE, 0x10004b7, 0x10004b6 ] }; // ч Ч ҷ Ҷ - key { [ Cyrillic_es, Cyrillic_ES ] }; // с С - key { [ Cyrillic_em, Cyrillic_EM ] }; // м М - key { [ Cyrillic_i, Cyrillic_I, 0x10004e3, 0x10004e2 ] }; // и И ӣ Ӣ - key { [ Cyrillic_te, Cyrillic_TE ] }; // т Т - key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; // ь Ь - key { [ Cyrillic_be, Cyrillic_BE ] }; // б Б - key { [ Cyrillic_yu, Cyrillic_YU ] }; // ю Ю - key { [ period, comma ] }; // . , - key { [ Cyrillic_ef, Cyrillic_EF ] }; // ф Ф - key { [ Cyrillic_yeru, Cyrillic_YERU ] }; // ы Ы - key { [ Cyrillic_ve, Cyrillic_VE ] }; // в В - key { [ Cyrillic_a, Cyrillic_A ] }; // а А - key { [ Cyrillic_pe, Cyrillic_PE ] }; // п П - key { [ Cyrillic_er, Cyrillic_ER ] }; // р Р - key { [ Cyrillic_o, Cyrillic_O ] }; // о О - key { [ Cyrillic_el, Cyrillic_EL ] }; // л Л - key { [ Cyrillic_de, Cyrillic_DE ] }; // д Д - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; // ж Ж - key { [ Cyrillic_e, Cyrillic_E ] }; // э Э - key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; // й Й - key { [ Cyrillic_tse, Cyrillic_TSE ] }; // ц Ц - key { [ Cyrillic_u, Cyrillic_U, 0x10004ef, 0x10004ee ] }; // у У ӯ Ӯ - key { [ Cyrillic_ka, Cyrillic_KA, 0x100049b, 0x100049a ] }; // к К қ Қ - key { [ Cyrillic_ie, Cyrillic_IE ] }; // е Е - key { [ Cyrillic_en, Cyrillic_EN ] }; // н Н - key { [ Cyrillic_ghe, Cyrillic_GHE, 0x1000493, 0x1000492 ] }; // г Г ғ Ғ - key { [ Cyrillic_sha, Cyrillic_SHA ] }; // ш Ш - key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; // щ Щ - key { [ Cyrillic_ze, Cyrillic_ZE ] }; // з З - key { [ Cyrillic_ha, Cyrillic_HA, 0x10004b3, 0x10004b2 ] }; // х Х ҳ Ҳ - key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; // ъ Ъ - key { [ 1, exclam, 0x10000a7 ] }; // 1 ! § - key { [ 2, quotedbl, 0x10000ab, 0x10000bb ] }; // 2 " « » - key { [ 3, numerosign ] }; // 3 № - key { [ 4, semicolon ] }; // 4 ; - key { [ 5, percent ] }; // 5 % - key { [ 6, colon, 0x1002013 ] }; // 6 : – - key { [ 7, question, ampersand ] }; // 7 ? & - key { [ 8, asterisk ] }; // 8 * - key { [ 9, parenleft ] }; // 9 ( - key { [ 0, parenright ] }; // 0 ) - key { [ minus, underscore ] }; // - _ - key { [ equal, plus ] }; // = + - key { [ backslash, slash ] }; // \ / - key { [ slash, bar ] }; // / | - key { [ Cyrillic_io, Cyrillic_IO ] }; // ё Ё -}; - +// 17/07/2008 +// ------------------------------------------------------------- +// Standard Tojiki Keyboard Layout, Official Standard +// ------------------------------------------------------------- +// Created by Victor Ibragimov +// Tajik Fedora & Software Localization Team +// ------------------------------------------------------------- +// DUAL INPUT METHOD +// -------------------------------------------------------------------- +// -------------- Tajiki Official Keyboard Layout---------------------- +// -------------------------------------------------------------------- +// + +partial default alphanumeric_keys +xkb_symbols "basic" +{ + name[Group1] = "Tajikistan"; + + include "kpdl(comma)" + include "level3(ralt_switch)" + + key { [ Cyrillic_ya, Cyrillic_YA ] }; // я Я + key { [ Cyrillic_che, Cyrillic_CHE ] }; // ч Ч + key { [ Cyrillic_es, Cyrillic_ES ] }; // с С + key { [ Cyrillic_em, Cyrillic_EM ] }; // м М + key { [ Cyrillic_i, Cyrillic_I ] }; // и И + key { [ Cyrillic_te, Cyrillic_TE ] }; // т Т + key { [ 0x10004e3, 0x10004e2 ] }; // ӣ Ӣ + key { [ Cyrillic_be, Cyrillic_BE ] }; // б Б + key { [ Cyrillic_yu, Cyrillic_YU ] }; // ю Ю + key { [ period, comma ] }; // . , + key { [ Cyrillic_ef, Cyrillic_EF ] }; // ф Ф + key { [ 0x10004b7, 0x10004b6 ] }; // ҷ Ҷ + key { [ Cyrillic_ve, Cyrillic_VE ] }; // в В + key { [ Cyrillic_a, Cyrillic_A ] }; // а А + key { [ Cyrillic_pe, Cyrillic_PE ] }; // п П + key { [ Cyrillic_er, Cyrillic_ER ] }; // р Р + key { [ Cyrillic_o, Cyrillic_O ] }; // о О + key { [ Cyrillic_el, Cyrillic_EL ] }; // л Л + key { [ Cyrillic_de, Cyrillic_DE ] }; // д Д + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; // ж Ж + key { [ Cyrillic_e, Cyrillic_E ] }; // э Э + key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; // й Й + key { [ 0x100049b, 0x100049a ] }; // қ Қ + key { [ Cyrillic_u, Cyrillic_U ] }; // у У + key { [ Cyrillic_ka, Cyrillic_KA ] }; // к К + key { [ Cyrillic_ie, Cyrillic_IE ] }; // е Е + key { [ Cyrillic_en, Cyrillic_EN ] }; // н Н + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; // г Г + key { [ Cyrillic_sha, Cyrillic_SHA ] }; // ш Ш + key { [ 0x10004b3, 0x10004b2 ] }; // ҳ Ҳ + key { [ Cyrillic_ze, Cyrillic_ZE ] }; // з З + key { [ Cyrillic_ha, Cyrillic_HA ] }; // х Х + key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; // ъ Ъ + key { [ 1, exclam, 0x10000a7 ] }; // 1 ! § + key { [ 2, quotedbl, 0x10000ab, 0x10000bb ] }; // 2 " « » + key { [ 3, numerosign ] }; // 3 № + key { [ 4, semicolon ] }; // 4 ; + key { [ 5, percent ] }; // 5 % + key { [ 6, colon, 0x1002013 ] }; // 6 : – + key { [ 7, question, ampersand ] }; // 7 ? & + key { [ 8, asterisk ] }; // 8 * + key { [ 9, parenleft ] }; // 9 ( + key { [ 0, parenright, 0x10000b0 ] }; // 0 ) ° + key { [ 0x1000493, 0x1000492, minus, underscore ] }; // ғ Ғ - _ + key { [ 0x10004ef, 0x10004ee, equal, plus ] }; // ӯ Ӯ = + + key { [ backslash, slash ] }; // \ / + key { [ slash, bar ] }; // / | + key { [ Cyrillic_io, Cyrillic_IO ] }; // ё Ё +}; + +// -------------------------------------------------------------------- +// -------------- Tojiki Rusi Keyboard Layout-------------------------- +// -------------------------------------------------------------------- +// AEN +// 2001/12/23 by Leon Kanter +// 2005/12/09 Valery Inozemtsev +// Pablo Saratxaga (for the dead keys changes) +// -------------------------------------------------------------------- + +xkb_symbols "legacy" +{ + name[Group1] = "Tajikistan - Legacy"; + + include "kpdl(comma)" + include "level3(ralt_switch)" + + key { [ Cyrillic_ya, Cyrillic_YA ] }; // я Я + key { [ Cyrillic_che, Cyrillic_CHE, 0x10004b7, 0x10004b6 ] }; // ч Ч ҷ Ҷ + key { [ Cyrillic_es, Cyrillic_ES ] }; // с С + key { [ Cyrillic_em, Cyrillic_EM ] }; // м М + key { [ Cyrillic_i, Cyrillic_I, 0x10004e3, 0x10004e2 ] }; // и И ӣ Ӣ + key { [ Cyrillic_te, Cyrillic_TE ] }; // т Т + key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; // ь Ь + key { [ Cyrillic_be, Cyrillic_BE ] }; // б Б + key { [ Cyrillic_yu, Cyrillic_YU ] }; // ю Ю + key { [ period, comma ] }; // . , + key { [ Cyrillic_ef, Cyrillic_EF ] }; // ф Ф + key { [ Cyrillic_yeru, Cyrillic_YERU ] }; // ы Ы + key { [ Cyrillic_ve, Cyrillic_VE ] }; // в В + key { [ Cyrillic_a, Cyrillic_A ] }; // а А + key { [ Cyrillic_pe, Cyrillic_PE ] }; // п П + key { [ Cyrillic_er, Cyrillic_ER ] }; // р Р + key { [ Cyrillic_o, Cyrillic_O ] }; // о О + key { [ Cyrillic_el, Cyrillic_EL ] }; // л Л + key { [ Cyrillic_de, Cyrillic_DE ] }; // д Д + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; // ж Ж + key { [ Cyrillic_e, Cyrillic_E ] }; // э Э + key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; // й Й + key { [ Cyrillic_tse, Cyrillic_TSE ] }; // ц Ц + key { [ Cyrillic_u, Cyrillic_U, 0x10004ef, 0x10004ee ] }; // у У ӯ Ӯ + key { [ Cyrillic_ka, Cyrillic_KA, 0x100049b, 0x100049a ] }; // к К қ Қ + key { [ Cyrillic_ie, Cyrillic_IE ] }; // е Е + key { [ Cyrillic_en, Cyrillic_EN ] }; // н Н + key { [ Cyrillic_ghe, Cyrillic_GHE, 0x1000493, 0x1000492 ] }; // г Г ғ Ғ + key { [ Cyrillic_sha, Cyrillic_SHA ] }; // ш Ш + key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; // щ Щ + key { [ Cyrillic_ze, Cyrillic_ZE ] }; // з З + key { [ Cyrillic_ha, Cyrillic_HA, 0x10004b3, 0x10004b2 ] }; // х Х ҳ Ҳ + key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; // ъ Ъ + key { [ 1, exclam, 0x10000a7 ] }; // 1 ! § + key { [ 2, quotedbl, 0x10000ab, 0x10000bb ] }; // 2 " « » + key { [ 3, numerosign ] }; // 3 № + key { [ 4, semicolon ] }; // 4 ; + key { [ 5, percent ] }; // 5 % + key { [ 6, colon, 0x1002013 ] }; // 6 : – + key { [ 7, question, ampersand ] }; // 7 ? & + key { [ 8, asterisk ] }; // 8 * + key { [ 9, parenleft ] }; // 9 ( + key { [ 0, parenright ] }; // 0 ) + key { [ minus, underscore ] }; // - _ + key { [ equal, plus ] }; // = + + key { [ backslash, slash ] }; // \ / + key { [ slash, bar ] }; // / | + key { [ Cyrillic_io, Cyrillic_IO ] }; // ё Ё +}; diff --git a/xorg-server/xkeyboard-config/symbols/tm b/xorg-server/xkeyboard-config/symbols/tm index 241b4e822..56bd85d1e 100644 --- a/xorg-server/xkeyboard-config/symbols/tm +++ b/xorg-server/xkeyboard-config/symbols/tm @@ -1,49 +1,45 @@ -// $XKeyboardConfig$ - -// $XFree86: xc/programs/xkbcomp/symbols/tm,v 0.2 2009/04/02 14:32:05 pascal Exp $ -// Nazar Annagurban , 2009 - -// Default layout (based on Vista Turkmen layout) -default partial -xkb_symbols "basic" { - name[Group1]="Turkmenistan"; - - include "us" - key { [ zcaron, Zcaron, grave, asciitilde ] }; - - key { [ adiaeresis, Adiaeresis, q, Q ] }; - key { [ ncaron, Ncaron, bracketleft, braceleft ] }; - key { [odiaeresis, Odiaeresis, bracketright, braceright ] }; - - key { [udiaeresis, Udiaeresis, x, X ] }; - key { [ ccedilla, Ccedilla, c, C ] }; - key { [ yacute, Yacute, v, V ] }; - - key { [ scedilla, Scedilla, backslash, bar ] }; - - include "level3(ralt_switch)" -}; - -// Turkmen Alt-Q Layout -// This layout provides turkmen letter via the AltGr key -partial -xkb_symbols "alt" { - name[Group1]="Turkmenistan - Alt-Q"; - - include "us" - - key { [ y, Y, yacute, Yacute ] }; - key { [ u, U, udiaeresis, Udiaeresis ] }; - key { [ o, O, odiaeresis, Odiaeresis ] }; - - key { [ a, A, adiaeresis, Adiaeresis ] }; - key { [ s, S, scedilla, Scedilla ] }; - - key { [ z, Z, zcaron, Zcaron ] }; - key { [ c, C, ccedilla, Ccedilla ] }; - key { [ n, N, ncaron, Ncaron ] }; - - include "level3(ralt_switch)" - -}; - +// Nazar Annagurban , 2009 + +// Default layout (based on Vista Turkmen layout) +default partial +xkb_symbols "basic" { + name[Group1]="Turkmenistan"; + + include "us" + key { [ zcaron, Zcaron, grave, asciitilde ] }; + + key { [ adiaeresis, Adiaeresis, q, Q ] }; + key { [ ncaron, Ncaron, bracketleft, braceleft ] }; + key { [odiaeresis, Odiaeresis, bracketright, braceright ] }; + + key { [udiaeresis, Udiaeresis, x, X ] }; + key { [ ccedilla, Ccedilla, c, C ] }; + key { [ yacute, Yacute, v, V ] }; + + key { [ scedilla, Scedilla, backslash, bar ] }; + + include "level3(ralt_switch)" +}; + +// Turkmen Alt-Q Layout +// This layout provides turkmen letter via the AltGr key +partial +xkb_symbols "alt" { + name[Group1]="Turkmenistan - Alt-Q"; + + include "us" + + key { [ y, Y, yacute, Yacute ] }; + key { [ u, U, udiaeresis, Udiaeresis ] }; + key { [ o, O, odiaeresis, Odiaeresis ] }; + + key { [ a, A, adiaeresis, Adiaeresis ] }; + key { [ s, S, scedilla, Scedilla ] }; + + key { [ z, Z, zcaron, Zcaron ] }; + key { [ c, C, ccedilla, Ccedilla ] }; + key { [ n, N, ncaron, Ncaron ] }; + + include "level3(ralt_switch)" + +}; diff --git a/xorg-server/xkeyboard-config/symbols/tr b/xorg-server/xkeyboard-config/symbols/tr index c217a7af0..9e9758c0e 100644 --- a/xorg-server/xkeyboard-config/symbols/tr +++ b/xorg-server/xkeyboard-config/symbols/tr @@ -1,356 +1,352 @@ -// $XKeyboardConfig$ - -// based on -// Turkish keyboard symbols for PC and xkb -// This file distributed without any expressed or implied warranty -// Nilgün Belma Bugüner , 2005 -// -// $XFree86: xc/programs/xkbcomp/symbols/tr,v 1.5 2003/04/19 12:22:12 pascal Exp $ - -//Default Layout (Turkish Q) -default partial -xkb_symbols "basic" { - - include "latin" - - name[Group1]="Turkey"; - - key { [ 1, exclam, greater, exclamdown ] }; - key { [ 2, apostrophe, sterling, twosuperior ] }; - key { [ 3, asciicircum, numbersign, threesuperior ] }; - key { [ 4, plus, dollar, onequarter ] }; - key { [ 6, ampersand, threequarters, VoidSymbol ] }; - key { [ 7, slash, braceleft, VoidSymbol ] }; - key { [ 8, parenleft, bracketleft, VoidSymbol ] }; - key { [ 9, parenright, bracketright, plusminus ] }; - key { [ 0, equal, braceright, degree ] }; - key { [ asterisk, question, backslash, questiondown ] }; - key { [ minus, underscore, bar, VoidSymbol ] }; - - key { [ w, W, VoidSymbol, VoidSymbol ] }; - key { [ e, E, EuroSign, VoidSymbol ] }; - key { [ t, T, trademark, VoidSymbol ] }; - key { [ u, U, ucircumflex, Ucircumflex ] }; - key { type[group1] = "FOUR_LEVEL_ALPHABETIC", - [ idotless, I, icircumflex, Icircumflex ] }; - key { [ o, O, ocircumflex, Ocircumflex ] }; - key { [ p, P, VoidSymbol, VoidSymbol ] }; - key { [ gbreve, Gbreve ] }; - key { [udiaeresis, Udiaeresis, asciitilde, dead_macron ] }; - - key { [ a, A, acircumflex, Acircumflex ] }; - key { [ s, S, section, VoidSymbol ] }; - key { [ d, D, VoidSymbol, VoidSymbol ] }; - key { [ f, F, ordfeminine, VoidSymbol ] }; - key { [ g, G, VoidSymbol, VoidSymbol ] }; - key { [ h, H, VoidSymbol, VoidSymbol ] }; - key { [ k, K, VoidSymbol, VoidSymbol ] }; - key { [ l, L, VoidSymbol, VoidSymbol ] }; - key { [ scedilla, Scedilla, acute, dead_acute ] }; - key { type[group1] = "FOUR_LEVEL_SEMIALPHABETIC", - [ i, Iabovedot, apostrophe, dead_caron ] }; - key { [ quotedbl, eacute, less, degree ] }; - - key { [ comma, semicolon, grave, dead_grave ] }; - key { [ less, greater, bar, brokenbar ] }; - key { [odiaeresis, Odiaeresis, multiply, VoidSymbol ] }; - key { [ ccedilla, Ccedilla, periodcentered, division ] }; - key { [ period, colon, dead_abovedot, dead_abovedot ] }; - - include "kpdl(comma)" - include "level3(ralt_switch)" -}; - - -// Turkish F Layout -partial -xkb_symbols "f" { - - include "latin" - - name[Group1]="Turkey - (F)"; - - key { [ 1, exclam, onesuperior, exclamdown ] }; - key { [ 2, quotedbl, twosuperior, VoidSymbol ] }; - key { [ 3, asciicircum, numbersign, threesuperior ] }; - key { [ 4, dollar, onequarter, VoidSymbol ] }; - key { [ 6, ampersand, threequarters, VoidSymbol ] }; - key { [ 7, apostrophe, braceleft, VoidSymbol ] }; - key { [ 8, parenleft, bracketleft, VoidSymbol ] }; - key { [ 9, parenright, bracketright, plusminus ] }; - key { [ 0, equal, braceright, degree ] }; - key { [ slash, question, backslash, questiondown ] }; - key { [ minus, underscore, bar, VoidSymbol ] }; - - key { [ f, F, at, VoidSymbol ] }; - key { [ g, G, VoidSymbol, VoidSymbol ] }; - key { [ gbreve, Gbreve, VoidSymbol, VoidSymbol ] }; - key { type[group1] = "FOUR_LEVEL_SEMIALPHABETIC", - [ idotless, I, paragraph, VoidSymbol ] }; - key { [ o, O, ocircumflex, Ocircumflex ] }; - key { [ d, D, yen, VoidSymbol ] }; - key { [ r, R, registered, VoidSymbol ] }; - key { [ n, N, VoidSymbol, VoidSymbol ] }; - key { [ h, H, degree, VoidSymbol ] }; - key { [ p, P, sterling, VoidSymbol ] }; - key { [ q, Q, dead_diaeresis, dead_abovering ] }; - key { [ w, W, asciitilde, dead_breve ] }; - - key { [ u, U, ucircumflex, Ucircumflex ] }; - key { type[group1] = "FOUR_LEVEL_ALPHABETIC", - [ i, Iabovedot, icircumflex, Icircumflex ] }; - key { [ e, E, EuroSign, VoidSymbol ] }; - key { [ a, A, acircumflex, Acircumflex ] }; - key { [udiaeresis, Udiaeresis, ucircumflex, Ucircumflex ] }; - key { [ t, T, trademark, VoidSymbol ] }; - key { [ k, K, VoidSymbol, VoidSymbol ] }; - key { [ m, M, mu, VoidSymbol ] }; - key { [ l, L, VoidSymbol, VoidSymbol ] }; - key { [ y, Y, acute, dead_acute ] }; - key { [ scedilla, Scedilla, numbersign, dead_caron ] }; - key { [ plus, asterisk, notsign, plusminus ] }; - - key { [ x, X, grave, dead_grave ] }; - key { [ j, J, guillemotleft, VoidSymbol ] }; - key { [odiaeresis, Odiaeresis, guillemotright, VoidSymbol ] }; - key { [ v, V, leftdoublequotemark, VoidSymbol ] }; - key { [ c, C, cent, copyright ] }; - key { [ ccedilla, Ccedilla, rightdoublequotemark, VoidSymbol] }; - key { [ z, Z, VoidSymbol, VoidSymbol ] }; - key { [ s, S, section, VoidSymbol ] }; - key { [ b, B, multiply, nobreakspace ] }; - key { [ period, colon, division, dead_abovedot] }; - key { [ comma, semicolon, periodcentered, VoidSymbol ] }; - key { [ less, greater, bar, brokenbar ] }; - - include "kpdl(comma)" - include "level3(ralt_switch)" -}; - -// Turkish Alt-Q Layout -partial -xkb_symbols "alt" { - - include "latin" - - name[Group1]="Turkey - Alt-Q"; - - key { [ 7, ampersand, lowleftcorner, upleftcorner ] }; - key { [ 8, asterisk, leftt, topt ] }; - key { [ 9, parenleft, rightt, bott ] }; - key { [ 0, parenright, lowrightcorner, uprightcorner ] }; - key { [ minus, underscore, horizlinescan5, vertbar ] }; - key { [ equal, plus, crossinglines ] }; - - key { [ e, E, EuroSign, VoidSymbol ] }; -// key { [ t, T, trademark, VoidSymbol > - key { [ u, U, udiaeresis, Udiaeresis ] }; - key { [ i, I, idotless, Iabovedot ] }; - key { [ o, O, odiaeresis, Odiaeresis ] }; - key { [ a, A, acircumflex, Acircumflex ] }; - key { [ s, S, scedilla, Scedilla ] }; - key { [ g, G, gbreve, Gbreve ] }; - - key { [ c, C, ccedilla, Ccedilla ] }; - - include "level3(ralt_switch)" -}; - - -partial alphanumeric_keys -xkb_symbols "Sundeadkeys" { - - // For naming consistency - include "tr(basic)" - -}; - -partial alphanumeric_keys -xkb_symbols "sundeadkeys" { - - // For naming consistency - include "tr(Sundeadkeys)" - - name[Group1]="Turkey - Sun dead keys"; -}; - -// Kurdish Q Layout -// Erdal Ronahi , 2006 -// http://ferheng.org -// http://www.pckurd.net - -partial -xkb_symbols "ku" { - - include "tr(basic)" - - name[Group1]="Turkey - Kurdish, Latin Q"; - - key { [ i, I, idotless, I ] }; - key { [ x, X, gbreve, Gbreve ] }; - key { [ucircumflex, Ucircumflex, asciitilde, dead_macron] }; - key { [icircumflex, Icircumflex, apostrophe, dead_caron ] }; - key { [ecircumflex, Ecircumflex, odiaeresis, Odiaeresis ] }; -}; - -// Kurdish F Layout -partial -xkb_symbols "ku_f" { - - include "tr(f)" - - name[Group1]="Turkey - Kurdish, (F)"; - - key { [ x, X, gbreve, Gbreve] }; - key { [ i, I, paragraph, VoidSymbol ] }; - key { [ o, O, ocircumflex, Ocircumflex ] }; - - key { [ ucircumflex, Ucircumflex, udiaeresis, Udiaeresis ] }; - key { [ icircumflex, Icircumflex, i, Iabovedot ] }; - key { [ u, U, udiaeresis, Udiaeresis ] }; - key { [ecircumflex, Ecircumflex, odiaeresis, Odiaeresis ] }; - -}; - -// Kurdish Alt-Q Layout -partial -xkb_symbols "ku_alt" { - - include "tr(alt)" - - name[Group1]="Turkey - Kurdish, Latin Alt-Q"; - - key { [ e, E, ecircumflex, Ecircumflex ] }; - key { [ u, U, ucircumflex, Ucircumflex ] }; - key { [ i, I, icircumflex, Icircumflex ] }; - key { [ o, O, odiaeresis, Odiaeresis ] }; -}; - -// Turkish international Q Layout -// Alexis Pellicier , 2007 -partial -xkb_symbols "intl" { - include "latin" - - name[Group1]="Turkey - International (with dead keys)"; - - key { type[group1] = "FOUR_LEVEL", [ 1, exclam, onesuperior, exclamdown ] }; - key { type[group1] = "FOUR_LEVEL", [ 2, apostrophe, sterling, twosuperior ] }; - key { type[group1] = "FOUR_LEVEL", [ 3, dead_circumflex, numbersign, threesuperior ] }; - key { type[group1] = "FOUR_LEVEL", [ 4, plus, dollar, onequarter ] }; - key { type[group1] = "FOUR_LEVEL", [ 6, ampersand, threequarters, VoidSymbol ] }; - key { type[group1] = "FOUR_LEVEL", [ 7, slash, braceleft, VoidSymbol ] }; - key { type[group1] = "FOUR_LEVEL", [ 8, parenleft, bracketleft, VoidSymbol ] }; - key { type[group1] = "FOUR_LEVEL", [ 9, parenright, bracketright, plusminus ] }; - key { type[group1] = "FOUR_LEVEL", [ 0, equal, braceright, degree ] }; - key { type[group1] = "FOUR_LEVEL", [ asterisk, question, backslash, questiondown ] }; - key { type[group1] = "FOUR_LEVEL", [ minus, underscore, division, VoidSymbol ] }; - key { [ w, W, VoidSymbol, VoidSymbol ] }; - key { [ e, E, EuroSign, cent ] }; - key { [ t, T, trademark, VoidSymbol ] }; - key { [ u, U, ucircumflex, Ucircumflex ] }; - key { [ idotless, I, icircumflex, Icircumflex ] }; - key { [ o, O, ocircumflex, Ocircumflex ] }; - key { [ p, P, VoidSymbol, VoidSymbol ] }; - key { [ gbreve, Gbreve, dead_diaeresis ] }; - key { [udiaeresis, Udiaeresis, dead_tilde, dead_macron ] }; - key { [ a, A, acircumflex, Acircumflex ] }; - key { [ s, S, section, VoidSymbol ] }; - key { [ d, D, VoidSymbol, VoidSymbol ] }; - key { [ f, F, ordfeminine, VoidSymbol ] }; - key { [ g, G, VoidSymbol, VoidSymbol ] }; - key { [ h, H, VoidSymbol, VoidSymbol ] }; - key { [ k, K, VoidSymbol, VoidSymbol ] }; - key { [ l, L, VoidSymbol, VoidSymbol ] }; - key { [ scedilla, Scedilla, dead_acute, dead_acute ] }; - key { [ i, Iabovedot, apostrophe, dead_caron ] }; - key { type[group1] = "FOUR_LEVEL",[ quotedbl, eacute, plusminus, degree ] }; - key { type[group1] = "FOUR_LEVEL",[ comma, semicolon, dead_grave, dead_grave ] }; - key { type[group1] = "FOUR_LEVEL",[ less, greater, bar, brokenbar ] }; - key { [odiaeresis, Odiaeresis, multiply, VoidSymbol ] }; - key { [ ccedilla, Ccedilla, periodcentered, division ] }; - key { type[group1] = "FOUR_LEVEL",[ period, colon, dead_abovedot, dead_abovedot ] }; - - include "nbsp(level3)" - include "level3(ralt_switch)" -}; - - -partial alphanumeric_keys -xkb_symbols "olpc" { - name[Group1]= "Turkey"; - include "tr(intl)" - - key { [ 1, exclam, VoidSymbol, VoidSymbol ] }; - key { [ 6, ampersand, VoidSymbol, VoidSymbol ] }; - key { type[group1] = "FOUR_LEVEL", [ minus, underscore, bar, VoidSymbol ] }; - - - key { [ c, C, leftdoublequotemark, VoidSymbol ] }; - key { [ v, V, rightdoublequotemark, VoidSymbol ] }; - key { [ b, B, VoidSymbol, VoidSymbol ] }; - key { [odiaeresis, Odiaeresis, VoidSymbol, VoidSymbol ] }; - - key { [ ccedilla, Ccedilla, multiply, VoidSymbol ] }; - key { [ period, colon, division, dead_abovedot ] }; - - key { [ less, greater, VoidSymbol, VoidSymbol ] }; - -}; - -// Crimean Tatar (Crimean Turkish) layouts. -// First released: 2009. -// These layouts are currently experimental. In particular, the mapping of letter 'x', -// included for foreign words and shortcuts, might change in the future... -// Reşat SABIQ -// Özgür Qarahan - -// Crimean Tatar (Crimean Turkish) Q Layout -partial -xkb_symbols "crh" { - - include "tr(basic)" - - name[Group1]="Turkey - Crimean Tatar (Turkish Q)"; - - key { [ x, X, asterisk, question ] }; - - key { [ f, F, iacute, Iacute ] }; - key { [ j, J, ibreve, Ibreve ] }; - key { [ quotedbl, backslash, less, degree ] }; - - key { [ ntilde, Ntilde, guillemotright, greater ] }; -}; - -// Crimean Tatar (Crimean Turkish) F Layout -partial -xkb_symbols "crh_f" { - - include "tr(f)" - - name[Group1]="Turkey - Crimean Tatar (Turkish F)"; - - key { [ x, X, slash, question ] }; - - key { type[group1] = "FOUR_LEVEL_SEMIALPHABETIC", - [ idotless, I, iacute, Iacute ] }; - - key { [ k, K, ibreve, Ibreve ] }; - key { [ plus, asterisk, backslash, plusminus ] }; - - key { [ ntilde, Ntilde, grave, dead_grave ] }; -}; - -// Crimean Tatar (Crimean Turkish) Alt-Q Layout -partial -xkb_symbols "crh_alt" { - - include "tr(alt)" - - name[Group1]="Turkey - Crimean Tatar (Turkish Alt-Q)"; - - key { [ f, F, iacute, Iacute ] }; - key { [ j, J, ibreve, Ibreve ] }; - - key { [ n, N, ntilde, Ntilde ] }; -}; +// based on +// Turkish keyboard symbols for PC and xkb +// This file distributed without any expressed or implied warranty +// Nilgün Belma Bugüner , 2005 + +//Default Layout (Turkish Q) +default partial +xkb_symbols "basic" { + + include "latin" + + name[Group1]="Turkey"; + + key { [ 1, exclam, greater, exclamdown ] }; + key { [ 2, apostrophe, sterling, twosuperior ] }; + key { [ 3, asciicircum, numbersign, threesuperior ] }; + key { [ 4, plus, dollar, onequarter ] }; + key { [ 6, ampersand, threequarters, VoidSymbol ] }; + key { [ 7, slash, braceleft, VoidSymbol ] }; + key { [ 8, parenleft, bracketleft, VoidSymbol ] }; + key { [ 9, parenright, bracketright, plusminus ] }; + key { [ 0, equal, braceright, degree ] }; + key { [ asterisk, question, backslash, questiondown ] }; + key { [ minus, underscore, bar, VoidSymbol ] }; + + key { [ w, W, VoidSymbol, VoidSymbol ] }; + key { [ e, E, EuroSign, VoidSymbol ] }; + key { [ t, T, trademark, VoidSymbol ] }; + key { [ u, U, ucircumflex, Ucircumflex ] }; + key { type[group1] = "FOUR_LEVEL_ALPHABETIC", + [ idotless, I, icircumflex, Icircumflex ] }; + key { [ o, O, ocircumflex, Ocircumflex ] }; + key { [ p, P, VoidSymbol, VoidSymbol ] }; + key { [ gbreve, Gbreve ] }; + key { [udiaeresis, Udiaeresis, asciitilde, dead_macron ] }; + + key { [ a, A, acircumflex, Acircumflex ] }; + key { [ s, S, section, VoidSymbol ] }; + key { [ d, D, VoidSymbol, VoidSymbol ] }; + key { [ f, F, ordfeminine, VoidSymbol ] }; + key { [ g, G, VoidSymbol, VoidSymbol ] }; + key { [ h, H, VoidSymbol, VoidSymbol ] }; + key { [ k, K, VoidSymbol, VoidSymbol ] }; + key { [ l, L, VoidSymbol, VoidSymbol ] }; + key { [ scedilla, Scedilla, acute, dead_acute ] }; + key { type[group1] = "FOUR_LEVEL_SEMIALPHABETIC", + [ i, Iabovedot, apostrophe, dead_caron ] }; + key { [ quotedbl, eacute, less, degree ] }; + + key { [ comma, semicolon, grave, dead_grave ] }; + key { [ less, greater, bar, brokenbar ] }; + key { [odiaeresis, Odiaeresis, multiply, VoidSymbol ] }; + key { [ ccedilla, Ccedilla, periodcentered, division ] }; + key { [ period, colon, dead_abovedot, dead_abovedot ] }; + + include "kpdl(comma)" + include "level3(ralt_switch)" +}; + + +// Turkish F Layout +partial +xkb_symbols "f" { + + include "latin" + + name[Group1]="Turkey - (F)"; + + key { [ 1, exclam, onesuperior, exclamdown ] }; + key { [ 2, quotedbl, twosuperior, VoidSymbol ] }; + key { [ 3, asciicircum, numbersign, threesuperior ] }; + key { [ 4, dollar, onequarter, VoidSymbol ] }; + key { [ 6, ampersand, threequarters, VoidSymbol ] }; + key { [ 7, apostrophe, braceleft, VoidSymbol ] }; + key { [ 8, parenleft, bracketleft, VoidSymbol ] }; + key { [ 9, parenright, bracketright, plusminus ] }; + key { [ 0, equal, braceright, degree ] }; + key { [ slash, question, backslash, questiondown ] }; + key { [ minus, underscore, bar, VoidSymbol ] }; + + key { [ f, F, at, VoidSymbol ] }; + key { [ g, G, VoidSymbol, VoidSymbol ] }; + key { [ gbreve, Gbreve, VoidSymbol, VoidSymbol ] }; + key { type[group1] = "FOUR_LEVEL_SEMIALPHABETIC", + [ idotless, I, paragraph, VoidSymbol ] }; + key { [ o, O, ocircumflex, Ocircumflex ] }; + key { [ d, D, yen, VoidSymbol ] }; + key { [ r, R, registered, VoidSymbol ] }; + key { [ n, N, VoidSymbol, VoidSymbol ] }; + key { [ h, H, degree, VoidSymbol ] }; + key { [ p, P, sterling, VoidSymbol ] }; + key { [ q, Q, dead_diaeresis, dead_abovering ] }; + key { [ w, W, asciitilde, dead_breve ] }; + + key { [ u, U, ucircumflex, Ucircumflex ] }; + key { type[group1] = "FOUR_LEVEL_ALPHABETIC", + [ i, Iabovedot, icircumflex, Icircumflex ] }; + key { [ e, E, EuroSign, VoidSymbol ] }; + key { [ a, A, acircumflex, Acircumflex ] }; + key { [udiaeresis, Udiaeresis, ucircumflex, Ucircumflex ] }; + key { [ t, T, trademark, VoidSymbol ] }; + key { [ k, K, VoidSymbol, VoidSymbol ] }; + key { [ m, M, mu, VoidSymbol ] }; + key { [ l, L, VoidSymbol, VoidSymbol ] }; + key { [ y, Y, acute, dead_acute ] }; + key { [ scedilla, Scedilla, numbersign, dead_caron ] }; + key { [ plus, asterisk, notsign, plusminus ] }; + + key { [ x, X, grave, dead_grave ] }; + key { [ j, J, guillemotleft, VoidSymbol ] }; + key { [odiaeresis, Odiaeresis, guillemotright, VoidSymbol ] }; + key { [ v, V, leftdoublequotemark, VoidSymbol ] }; + key { [ c, C, cent, copyright ] }; + key { [ ccedilla, Ccedilla, rightdoublequotemark, VoidSymbol] }; + key { [ z, Z, VoidSymbol, VoidSymbol ] }; + key { [ s, S, section, VoidSymbol ] }; + key { [ b, B, multiply, nobreakspace ] }; + key { [ period, colon, division, dead_abovedot] }; + key { [ comma, semicolon, periodcentered, VoidSymbol ] }; + key { [ less, greater, bar, brokenbar ] }; + + include "kpdl(comma)" + include "level3(ralt_switch)" +}; + +// Turkish Alt-Q Layout +partial +xkb_symbols "alt" { + + include "latin" + + name[Group1]="Turkey - Alt-Q"; + + key { [ 7, ampersand, lowleftcorner, upleftcorner ] }; + key { [ 8, asterisk, leftt, topt ] }; + key { [ 9, parenleft, rightt, bott ] }; + key { [ 0, parenright, lowrightcorner, uprightcorner ] }; + key { [ minus, underscore, horizlinescan5, vertbar ] }; + key { [ equal, plus, crossinglines ] }; + + key { [ e, E, EuroSign, VoidSymbol ] }; +// key { [ t, T, trademark, VoidSymbol > + key { [ u, U, udiaeresis, Udiaeresis ] }; + key { [ i, I, idotless, Iabovedot ] }; + key { [ o, O, odiaeresis, Odiaeresis ] }; + key { [ a, A, acircumflex, Acircumflex ] }; + key { [ s, S, scedilla, Scedilla ] }; + key { [ g, G, gbreve, Gbreve ] }; + + key { [ c, C, ccedilla, Ccedilla ] }; + + include "level3(ralt_switch)" +}; + + +partial alphanumeric_keys +xkb_symbols "Sundeadkeys" { + + // For naming consistency + include "tr(basic)" + +}; + +partial alphanumeric_keys +xkb_symbols "sundeadkeys" { + + // For naming consistency + include "tr(Sundeadkeys)" + + name[Group1]="Turkey - Sun dead keys"; +}; + +// Kurdish Q Layout +// Erdal Ronahi , 2006 +// http://ferheng.org +// http://www.pckurd.net + +partial +xkb_symbols "ku" { + + include "tr(basic)" + + name[Group1]="Turkey - Kurdish, Latin Q"; + + key { [ i, I, idotless, I ] }; + key { [ x, X, gbreve, Gbreve ] }; + key { [ucircumflex, Ucircumflex, asciitilde, dead_macron] }; + key { [icircumflex, Icircumflex, apostrophe, dead_caron ] }; + key { [ecircumflex, Ecircumflex, odiaeresis, Odiaeresis ] }; +}; + +// Kurdish F Layout +partial +xkb_symbols "ku_f" { + + include "tr(f)" + + name[Group1]="Turkey - Kurdish, (F)"; + + key { [ x, X, gbreve, Gbreve] }; + key { [ i, I, paragraph, VoidSymbol ] }; + key { [ o, O, ocircumflex, Ocircumflex ] }; + + key { [ ucircumflex, Ucircumflex, udiaeresis, Udiaeresis ] }; + key { [ icircumflex, Icircumflex, i, Iabovedot ] }; + key { [ u, U, udiaeresis, Udiaeresis ] }; + key { [ecircumflex, Ecircumflex, odiaeresis, Odiaeresis ] }; + +}; + +// Kurdish Alt-Q Layout +partial +xkb_symbols "ku_alt" { + + include "tr(alt)" + + name[Group1]="Turkey - Kurdish, Latin Alt-Q"; + + key { [ e, E, ecircumflex, Ecircumflex ] }; + key { [ u, U, ucircumflex, Ucircumflex ] }; + key { [ i, I, icircumflex, Icircumflex ] }; + key { [ o, O, odiaeresis, Odiaeresis ] }; +}; + +// Turkish international Q Layout +// Alexis Pellicier , 2007 +partial +xkb_symbols "intl" { + include "latin" + + name[Group1]="Turkey - International (with dead keys)"; + + key { type[group1] = "FOUR_LEVEL", [ 1, exclam, onesuperior, exclamdown ] }; + key { type[group1] = "FOUR_LEVEL", [ 2, apostrophe, sterling, twosuperior ] }; + key { type[group1] = "FOUR_LEVEL", [ 3, dead_circumflex, numbersign, threesuperior ] }; + key { type[group1] = "FOUR_LEVEL", [ 4, plus, dollar, onequarter ] }; + key { type[group1] = "FOUR_LEVEL", [ 6, ampersand, threequarters, VoidSymbol ] }; + key { type[group1] = "FOUR_LEVEL", [ 7, slash, braceleft, VoidSymbol ] }; + key { type[group1] = "FOUR_LEVEL", [ 8, parenleft, bracketleft, VoidSymbol ] }; + key { type[group1] = "FOUR_LEVEL", [ 9, parenright, bracketright, plusminus ] }; + key { type[group1] = "FOUR_LEVEL", [ 0, equal, braceright, degree ] }; + key { type[group1] = "FOUR_LEVEL", [ asterisk, question, backslash, questiondown ] }; + key { type[group1] = "FOUR_LEVEL", [ minus, underscore, division, VoidSymbol ] }; + key { [ w, W, VoidSymbol, VoidSymbol ] }; + key { [ e, E, EuroSign, cent ] }; + key { [ t, T, trademark, VoidSymbol ] }; + key { [ u, U, ucircumflex, Ucircumflex ] }; + key { [ idotless, I, icircumflex, Icircumflex ] }; + key { [ o, O, ocircumflex, Ocircumflex ] }; + key { [ p, P, VoidSymbol, VoidSymbol ] }; + key { [ gbreve, Gbreve, dead_diaeresis ] }; + key { [udiaeresis, Udiaeresis, dead_tilde, dead_macron ] }; + key { [ a, A, acircumflex, Acircumflex ] }; + key { [ s, S, section, VoidSymbol ] }; + key { [ d, D, VoidSymbol, VoidSymbol ] }; + key { [ f, F, ordfeminine, VoidSymbol ] }; + key { [ g, G, VoidSymbol, VoidSymbol ] }; + key { [ h, H, VoidSymbol, VoidSymbol ] }; + key { [ k, K, VoidSymbol, VoidSymbol ] }; + key { [ l, L, VoidSymbol, VoidSymbol ] }; + key { [ scedilla, Scedilla, dead_acute, dead_acute ] }; + key { [ i, Iabovedot, apostrophe, dead_caron ] }; + key { type[group1] = "FOUR_LEVEL",[ quotedbl, eacute, plusminus, degree ] }; + key { type[group1] = "FOUR_LEVEL",[ comma, semicolon, dead_grave, dead_grave ] }; + key { type[group1] = "FOUR_LEVEL",[ less, greater, bar, brokenbar ] }; + key { [odiaeresis, Odiaeresis, multiply, VoidSymbol ] }; + key { [ ccedilla, Ccedilla, periodcentered, division ] }; + key { type[group1] = "FOUR_LEVEL",[ period, colon, dead_abovedot, dead_abovedot ] }; + + include "nbsp(level3)" + include "level3(ralt_switch)" +}; + + +partial alphanumeric_keys +xkb_symbols "olpc" { + name[Group1]= "Turkey"; + include "tr(intl)" + + key { [ 1, exclam, VoidSymbol, VoidSymbol ] }; + key { [ 6, ampersand, VoidSymbol, VoidSymbol ] }; + key { type[group1] = "FOUR_LEVEL", [ minus, underscore, bar, VoidSymbol ] }; + + + key { [ c, C, leftdoublequotemark, VoidSymbol ] }; + key { [ v, V, rightdoublequotemark, VoidSymbol ] }; + key { [ b, B, VoidSymbol, VoidSymbol ] }; + key { [odiaeresis, Odiaeresis, VoidSymbol, VoidSymbol ] }; + + key { [ ccedilla, Ccedilla, multiply, VoidSymbol ] }; + key { [ period, colon, division, dead_abovedot ] }; + + key { [ less, greater, VoidSymbol, VoidSymbol ] }; + +}; + +// Crimean Tatar (Crimean Turkish) layouts. +// First released: 2009. +// These layouts are currently experimental. In particular, the mapping of letter 'x', +// included for foreign words and shortcuts, might change in the future... +// Reşat SABIQ +// Özgür Qarahan + +// Crimean Tatar (Crimean Turkish) Q Layout +partial +xkb_symbols "crh" { + + include "tr(basic)" + + name[Group1]="Turkey - Crimean Tatar (Turkish Q)"; + + key { [ x, X, asterisk, question ] }; + + key { [ f, F, iacute, Iacute ] }; + key { [ j, J, ibreve, Ibreve ] }; + key { [ quotedbl, backslash, less, degree ] }; + + key { [ ntilde, Ntilde, guillemotright, greater ] }; +}; + +// Crimean Tatar (Crimean Turkish) F Layout +partial +xkb_symbols "crh_f" { + + include "tr(f)" + + name[Group1]="Turkey - Crimean Tatar (Turkish F)"; + + key { [ x, X, slash, question ] }; + + key { type[group1] = "FOUR_LEVEL_SEMIALPHABETIC", + [ idotless, I, iacute, Iacute ] }; + + key { [ k, K, ibreve, Ibreve ] }; + key { [ plus, asterisk, backslash, plusminus ] }; + + key { [ ntilde, Ntilde, grave, dead_grave ] }; +}; + +// Crimean Tatar (Crimean Turkish) Alt-Q Layout +partial +xkb_symbols "crh_alt" { + + include "tr(alt)" + + name[Group1]="Turkey - Crimean Tatar (Turkish Alt-Q)"; + + key { [ f, F, iacute, Iacute ] }; + key { [ j, J, ibreve, Ibreve ] }; + + key { [ n, N, ntilde, Ntilde ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/typo b/xorg-server/xkeyboard-config/symbols/typo index eb6fbc4ac..5cbf6be3e 100644 --- a/xorg-server/xkeyboard-config/symbols/typo +++ b/xorg-server/xkeyboard-config/symbols/typo @@ -1,53 +1,51 @@ -// $XKeyboardConfig$ - -// typographic keyboard -// Sergei Stolyarov -// -// Initial contribution by Alexey Ten -// -// Based on the layout proposed by Ilya Birman, -// http://ilyabirman.ru/typography-layout/ -// - -// default layout -default partial -xkb_symbols "base" { -// 1st keyboard row - key { [NoSymbol, NoSymbol, NoSymbol, approxeq] }; - key { [NoSymbol, NoSymbol, onesuperior] }; - key { [NoSymbol, NoSymbol, twosuperior, onehalf] }; - key { [NoSymbol, NoSymbol, threesuperior, onethird] }; - key { [NoSymbol, NoSymbol, dollar, onequarter] }; - key { [NoSymbol, NoSymbol, U2030] }; - key { [NoSymbol, NoSymbol, ampersand] }; - key { [NoSymbol, NoSymbol, enfilledcircbullet, oneeighth] }; - key { [NoSymbol, NoSymbol, emdash, hyphen] }; - key { [NoSymbol, NoSymbol, notequal, plusminus] }; - -// 2nd keyboard row - key { [NoSymbol, NoSymbol, EuroSign] }; // "e" - key { [NoSymbol, NoSymbol, registered] }; // "r" - key { [NoSymbol, NoSymbol, trademark] }; // "t" - key { [NoSymbol, NoSymbol, yen] }; // "y" - key { [NoSymbol, NoSymbol, acute, doubleacute] }; // "p" - key { [NoSymbol, NoSymbol, bracketleft, braceleft ] }; // [ - key { [NoSymbol, NoSymbol, bracketright, braceright ] }; // ] - -// 3rd keyboard row - key { [NoSymbol, NoSymbol, U0301, NoSymbol] }; // "a" - key { [NoSymbol, NoSymbol, section]}; // "s" - key { [NoSymbol, NoSymbol, degree, division] }; // "d" - key { [NoSymbol, NoSymbol, sterling, NoSymbol] }; // "f" - key { [NoSymbol, NoSymbol, doublelowquotemark, singlelowquotemark] }; // "j" - key { [NoSymbol, NoSymbol, leftdoublequotemark, leftsinglequotemark] }; // "k" - key { [NoSymbol, NoSymbol, rightdoublequotemark, rightsinglequotemark] }; // "l" - key { [NoSymbol, NoSymbol, leftsinglequotemark, minutes] }; // ";" - key { [NoSymbol, NoSymbol, rightsinglequotemark, seconds] }; // "'" - -// 4th keyboard row - key { [NoSymbol, NoSymbol, multiply, U22C5] }; // "x" - key { [NoSymbol, NoSymbol, copyright, cent] }; // "c" - key { [NoSymbol, NoSymbol, guillemotleft, less] }; // "," - key { [NoSymbol, NoSymbol, guillemotright, greater] }; // "." - key { [NoSymbol, NoSymbol, ellipsis] }; // "/" -}; +// typographic keyboard +// Sergei Stolyarov +// +// Initial contribution by Alexey Ten +// +// Based on the layout proposed by Ilya Birman, +// http://ilyabirman.ru/typography-layout/ +// + +// default layout +default partial +xkb_symbols "base" { +// 1st keyboard row + key { [NoSymbol, NoSymbol, NoSymbol, approxeq] }; + key { [NoSymbol, NoSymbol, onesuperior] }; + key { [NoSymbol, NoSymbol, twosuperior, onehalf] }; + key { [NoSymbol, NoSymbol, threesuperior, onethird] }; + key { [NoSymbol, NoSymbol, dollar, onequarter] }; + key { [NoSymbol, NoSymbol, U2030] }; + key { [NoSymbol, NoSymbol, ampersand] }; + key { [NoSymbol, NoSymbol, enfilledcircbullet, oneeighth] }; + key { [NoSymbol, NoSymbol, emdash, hyphen] }; + key { [NoSymbol, NoSymbol, notequal, plusminus] }; + +// 2nd keyboard row + key { [NoSymbol, NoSymbol, EuroSign] }; // "e" + key { [NoSymbol, NoSymbol, registered] }; // "r" + key { [NoSymbol, NoSymbol, trademark] }; // "t" + key { [NoSymbol, NoSymbol, yen] }; // "y" + key { [NoSymbol, NoSymbol, acute, doubleacute] }; // "p" + key { [NoSymbol, NoSymbol, bracketleft, braceleft ] }; // [ + key { [NoSymbol, NoSymbol, bracketright, braceright ] }; // ] + +// 3rd keyboard row + key { [NoSymbol, NoSymbol, U0301, NoSymbol] }; // "a" + key { [NoSymbol, NoSymbol, section]}; // "s" + key { [NoSymbol, NoSymbol, degree, division] }; // "d" + key { [NoSymbol, NoSymbol, sterling, NoSymbol] }; // "f" + key { [NoSymbol, NoSymbol, doublelowquotemark, singlelowquotemark] }; // "j" + key { [NoSymbol, NoSymbol, leftdoublequotemark, leftsinglequotemark] }; // "k" + key { [NoSymbol, NoSymbol, rightdoublequotemark, rightsinglequotemark] }; // "l" + key { [NoSymbol, NoSymbol, leftsinglequotemark, minutes] }; // ";" + key { [NoSymbol, NoSymbol, rightsinglequotemark, seconds] }; // "'" + +// 4th keyboard row + key { [NoSymbol, NoSymbol, multiply, U22C5] }; // "x" + key { [NoSymbol, NoSymbol, copyright, cent] }; // "c" + key { [NoSymbol, NoSymbol, guillemotleft, less] }; // "," + key { [NoSymbol, NoSymbol, guillemotright, greater] }; // "." + key { [NoSymbol, NoSymbol, ellipsis] }; // "/" +}; diff --git a/xorg-server/xkeyboard-config/symbols/tz b/xorg-server/xkeyboard-config/symbols/tz index 8936a0363..64804d678 100644 --- a/xorg-server/xkeyboard-config/symbols/tz +++ b/xorg-server/xkeyboard-config/symbols/tz @@ -1,63 +1,59 @@ -// $XKeyboardConfig$ - -// Keyboard layout for Swahili in Arabic script. -// Based on Martin Vidner's Buckwalter transliteration variant of the Arabic keyboard -// Please notify any corrections or omissions to -// Kevin Donnelly (kevin@dotmon.com) - -partial default alphanumeric_keys -xkb_symbols "swa" { - name[Group1]= "Tanzania"; - - key { [ 0x1000670, VoidSymbol ] }; - - key { [ 0x1000661, VoidSymbol ] }; - key { [ 0x1000662, VoidSymbol ] }; - key { [ 0x1000663, VoidSymbol ] }; - key { [ 0x1000664, VoidSymbol ] }; - key { [ 0x1000665, Arabic_percent ] }; - key { [ 0x1000666, VoidSymbol ] }; - key { [ 0x1000667, VoidSymbol ] }; - key { [ 0x1000668, VoidSymbol ] }; - key { [ 0x1000669, 0x100fd3e ] }; - key { [ 0x1000660, 0x100fd3f ] }; - key { [ minus, Arabic_tatweel ] }; - key { [ equal, plus ] }; - - key { [ Arabic_qaf, Arabic_gaf ] }; - key { [ Arabic_waw, Arabic_hamzaonwaw ] }; - key { [ 0x1000656, Arabic_ain ] }; - key { [ Arabic_ra, Arabic_tteh ] }; - key { [ Arabic_teh, Arabic_tah ] }; - key { [ Arabic_yeh, Arabic_alefmaksura ] }; - key { [ Arabic_damma, Arabic_dammatan ] }; - key { [ Arabic_kasra, Arabic_hamzaonyeh ] }; - key { [ Arabic_sukun, 0x1000657 ] }; - key { [ Arabic_peh, Arabic_tehmarbuta ] }; - key { [ VoidSymbol, VoidSymbol ] }; - - key { [ Arabic_fatha, Arabic_alef ] }; - key { [ Arabic_seen, Arabic_sad ] }; - key { [ Arabic_dal, Arabic_dad ] }; - key { [ Arabic_feh, Arabic_fathatan ] }; - key { [ 0x10006A0, Arabic_ghain ] }; - key { [ Arabic_ha, Arabic_hah ] }; - key { [ Arabic_jeem, VoidSymbol ] }; - key { [ Arabic_kaf, Arabic_kasratan ] }; - key { [ Arabic_lam, Arabic_shadda ] }; - key { [ Arabic_semicolon, VoidSymbol ] }; - key { [ Arabic_hamza, VoidSymbol ] }; - - key { [ Arabic_zain, Arabic_zah ] }; - key { [ Arabic_khah, VoidSymbol ] }; - key { [ Arabic_tcheh, Arabic_sheen ] }; - key { [ 0x10006A8, Arabic_theh ] }; - key { [ Arabic_beh, Arabic_thal ] }; - key { [ Arabic_noon, VoidSymbol ] }; - key { [ Arabic_meem, VoidSymbol ] }; - key { [ Arabic_comma, Arabic_hamzaunderalef ] }; - key { [ 0x10006d4, Arabic_hamzaonalef ] }; - key { [ VoidSymbol, Arabic_question_mark ] }; -}; - - +// Keyboard layout for Swahili in Arabic script. +// Based on Martin Vidner's Buckwalter transliteration variant of the Arabic keyboard +// Please notify any corrections or omissions to +// Kevin Donnelly (kevin@dotmon.com) + +partial default alphanumeric_keys +xkb_symbols "swa" { + name[Group1]= "Tanzania"; + + key { [ 0x1000670, VoidSymbol ] }; + + key { [ 0x1000661, VoidSymbol ] }; + key { [ 0x1000662, VoidSymbol ] }; + key { [ 0x1000663, VoidSymbol ] }; + key { [ 0x1000664, VoidSymbol ] }; + key { [ 0x1000665, Arabic_percent ] }; + key { [ 0x1000666, VoidSymbol ] }; + key { [ 0x1000667, VoidSymbol ] }; + key { [ 0x1000668, VoidSymbol ] }; + key { [ 0x1000669, 0x100fd3e ] }; + key { [ 0x1000660, 0x100fd3f ] }; + key { [ minus, Arabic_tatweel ] }; + key { [ equal, plus ] }; + + key { [ Arabic_qaf, Arabic_gaf ] }; + key { [ Arabic_waw, Arabic_hamzaonwaw ] }; + key { [ 0x1000656, Arabic_ain ] }; + key { [ Arabic_ra, Arabic_tteh ] }; + key { [ Arabic_teh, Arabic_tah ] }; + key { [ Arabic_yeh, Arabic_alefmaksura ] }; + key { [ Arabic_damma, Arabic_dammatan ] }; + key { [ Arabic_kasra, Arabic_hamzaonyeh ] }; + key { [ Arabic_sukun, 0x1000657 ] }; + key { [ Arabic_peh, Arabic_tehmarbuta ] }; + key { [ VoidSymbol, VoidSymbol ] }; + + key { [ Arabic_fatha, Arabic_alef ] }; + key { [ Arabic_seen, Arabic_sad ] }; + key { [ Arabic_dal, Arabic_dad ] }; + key { [ Arabic_feh, Arabic_fathatan ] }; + key { [ 0x10006A0, Arabic_ghain ] }; + key { [ Arabic_ha, Arabic_hah ] }; + key { [ Arabic_jeem, VoidSymbol ] }; + key { [ Arabic_kaf, Arabic_kasratan ] }; + key { [ Arabic_lam, Arabic_shadda ] }; + key { [ Arabic_semicolon, VoidSymbol ] }; + key { [ Arabic_hamza, VoidSymbol ] }; + + key { [ Arabic_zain, Arabic_zah ] }; + key { [ Arabic_khah, VoidSymbol ] }; + key { [ Arabic_tcheh, Arabic_sheen ] }; + key { [ 0x10006A8, Arabic_theh ] }; + key { [ Arabic_beh, Arabic_thal ] }; + key { [ Arabic_noon, VoidSymbol ] }; + key { [ Arabic_meem, VoidSymbol ] }; + key { [ Arabic_comma, Arabic_hamzaunderalef ] }; + key { [ 0x10006d4, Arabic_hamzaonalef ] }; + key { [ VoidSymbol, Arabic_question_mark ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/ua b/xorg-server/xkeyboard-config/symbols/ua index 150ada562..a585ea2b3 100644 --- a/xorg-server/xkeyboard-config/symbols/ua +++ b/xorg-server/xkeyboard-config/symbols/ua @@ -1,334 +1,330 @@ -// $XKeyboardConfig$ - -// based on -// ukrainian standard keyboard -// AEN & Leon Kanter -// Last Changes 2007/10/03 by Andriy Rysin -// -// $XFree86: xc/programs/xkbcomp/symbols/ua,v 1.4 2003/05/15 11:29:47 pascal Exp $ - -// Unicode - 3d level added with some Unicode symbols (typographic quotes, m-dash, n-dash etc), -// some often used cyrillics from other slavic languages and some ASCII symbols used often (slash, brackets...) -partial default alphanumeric_keys -xkb_symbols "unicode" { - include "ua(winkeys)" - - name[Group1]= "Ukraine"; - - key { [ U2019, apostrophe, U0301, asciitilde ] }; // Apostrophe and Stress symbol - key { [ 1, exclam, onesuperior ] }; - key { [ 2, quotedbl, twosuperior ] }; - key { [ 3, numerosign, U00A7, U20B4 ] }; // Paragraph and Hryvnia sign - key { [ 4, semicolon, dollar, EuroSign ] }; - key { [ 5, percent, degree ] }; - key { [ 6, colon, less ] }; - key { [ 7, question, greater ] }; - key { [ 8, asterisk, enfilledcircbullet ] }; - key { [ 9, parenleft, bracketleft, braceleft ] }; - key { [ 0, parenright, bracketright, braceright] }; - key { [ minus, underscore, emdash, endash ] }; - key { [ equal, plus, notequal, plusminus ] }; - - key { [ Cyrillic_u, Cyrillic_U, Byelorussian_shortu, Byelorussian_SHORTU ]}; - key { [ Cyrillic_ka, Cyrillic_KA, registered ] }; // Registered tm - key { [ Cyrillic_ie, Cyrillic_IE, Cyrillic_io, Cyrillic_IO ] }; - key { [ Ukrainian_yi,Ukrainian_YI, Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; - key { [ Ukrainian_i, Ukrainian_I, Cyrillic_yeru, Cyrillic_YERU ] }; - key { [ Ukrainian_ie,Ukrainian_IE, Cyrillic_e, Cyrillic_E ] }; - - key { [ Ukrainian_ghe_with_upturn, Ukrainian_GHE_WITH_UPTURN, backslash, bar ] }; - - key { [ Cyrillic_es, Cyrillic_ES, copyright ] }; - key { [ Cyrillic_te, Cyrillic_TE, trademark ] }; - key { [ Cyrillic_be, Cyrillic_BE, guillemotleft, doublelowquotemark ] }; - key { [ Cyrillic_yu, Cyrillic_YU, guillemotright, leftdoublequotemark ] }; - key { [ period, comma, slash, ellipsis ] }; - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "legacy" { - - name[Group1]= "Ukraine - Legacy"; - - key { [ apostrophe, asciitilde ] }; - key { [ 1, exclam ] }; - key { [ 2, quotedbl ] }; - key { [ 3, numbersign ] }; - key { [ 4, asterisk ] }; - key { [ 5, colon ] }; - key { [ 6, comma ] }; - key { [ 7, period ] }; - key { [ 8, semicolon ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ minus, underscore ] }; - key { [ equal, plus ] }; - - key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; - key { [ Cyrillic_tse, Cyrillic_TSE ] }; - key { [ Cyrillic_u, Cyrillic_U ] }; - key { [ Cyrillic_ka, Cyrillic_KA ] }; - key { [ Cyrillic_ie, Cyrillic_IE ] }; - key { [ Cyrillic_en, Cyrillic_EN ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; - key { [ Cyrillic_ze, Cyrillic_ZE ] }; - key { [ Cyrillic_ha, Cyrillic_HA ] }; - key { [ Ukrainian_yi, Ukrainian_YI ] }; - key { [ Ukrainian_ghe_with_upturn, Ukrainian_GHE_WITH_UPTURN ] }; - - key { [ Cyrillic_ef, Cyrillic_EF ] }; - key { [ Ukrainian_i, Ukrainian_I ] }; - key { [ Cyrillic_ve, Cyrillic_VE ] }; - key { [ Cyrillic_a, Cyrillic_A ] }; - key { [ Cyrillic_pe, Cyrillic_PE ] }; - key { [ Cyrillic_er, Cyrillic_ER ] }; - key { [ Cyrillic_o, Cyrillic_O ] }; - key { [ Cyrillic_el, Cyrillic_EL ] }; - key { [ Cyrillic_de, Cyrillic_DE ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ Ukrainian_ie, Ukrainian_IE ] }; - - key { [ Cyrillic_ya, Cyrillic_YA ] }; - key { [ Cyrillic_che, Cyrillic_CHE ] }; - key { [ Cyrillic_es, Cyrillic_ES ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; - key { [ Cyrillic_te, Cyrillic_TE ] }; - key { [ Cyrillic_i, Cyrillic_I ] }; - key { [Cyrillic_softsign,Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_be, Cyrillic_BE ] }; - key { [ Cyrillic_yu, Cyrillic_YU ] }; - key { [ slash, question ] }; - - key { [ slash, bar ] }; - // End alphanumeric section -}; - -partial alphanumeric_keys -xkb_symbols "winkeys" { - include "ua(legacy)" - - name[Group1]= "Ukraine - Winkeys"; - - key { [ 3, numerosign ] }; - key { [ 4, semicolon ] }; - key { [ 5, percent ] }; - key { [ 6, colon ] }; - key { [ 7, question ] }; - key { [ 8, asterisk ] }; - key { [ period, comma ] }; -}; - -partial alphanumeric_keys -xkb_symbols "typewriter" { - include "ua(legacy)" - - name[Group1]= "Ukraine - Typewriter"; - - key { [ apostrophe, quotedbl ] }; - key { [ exclam, 1 ] }; - key { [ numerosign, 2 ] }; - key { [ slash, 3 ] }; - key { [ semicolon, 4 ] }; - key { [ colon, 5 ] }; - key { [ comma, 6 ] }; - key { [ period, 7 ] }; - key { [ underscore, 8 ] }; - key { [ question, 9 ] }; - key { [ percent, 0 ] }; - - key { [ Ukrainian_ghe_with_upturn, Ukrainian_GHE_WITH_UPTURN ] }; - - key { [ Cyrillic_i, Cyrillic_I ] }; - - key { [ Ukrainian_i, Ukrainian_I ] }; - - key { [ Ukrainian_yi, Ukrainian_YI ] }; - - key { [ parenleft, parenright ] }; -}; - -partial alphanumeric_keys -xkb_symbols "phonetic" { - include "ua(legacy)" - - name[Group1]= "Ukraine - Phonetic"; - - key { [ Cyrillic_ya, Cyrillic_YA ] }; - key { [ Cyrillic_ve, Cyrillic_VE ] }; - key { [ Cyrillic_ie, Cyrillic_IE ] }; - key { [ Cyrillic_er, Cyrillic_ER ] }; - key { [ Cyrillic_te, Cyrillic_TE ] }; - key { [ Cyrillic_i, Cyrillic_I ] }; - key { [ Cyrillic_u, Cyrillic_U ] }; - key { [ Ukrainian_i, Ukrainian_I ] }; - key { [ Cyrillic_o, Cyrillic_O ] }; - key { [ Cyrillic_pe, Cyrillic_PE ] }; - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; - - key { [ Cyrillic_a, Cyrillic_A ] }; - key { [ Cyrillic_es, Cyrillic_ES ] }; - key { [ Cyrillic_de, Cyrillic_DE ] }; - key { [ Cyrillic_ef, Cyrillic_EF ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key { [ Cyrillic_ha, Cyrillic_HA ] }; - key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; - key { [ Cyrillic_ka, Cyrillic_KA ] }; - key { [ Cyrillic_el, Cyrillic_EL ] }; - key { [ Ukrainian_ghe_with_upturn, Ukrainian_GHE_WITH_UPTURN ] }; - key { [ Cyrillic_che, Cyrillic_CHE ] }; - key { [ Cyrillic_yu, Cyrillic_YU ] }; - - key { [ Cyrillic_ze, Cyrillic_ZE ] }; - key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_tse, Cyrillic_TSE ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ Cyrillic_be, Cyrillic_BE ] }; - key { [ Cyrillic_en, Cyrillic_EN ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; - key { [ Ukrainian_yi, Ukrainian_YI ] }; - key { [ Ukrainian_ie, Ukrainian_IE ] }; - key { [ slash, question ] }; -}; - -// ukrainian keyboard layout RSTU 2019-91 (Respublikanskij STandart Ukrajiny) -// Andrew Porokhnyak -partial alphanumeric_keys -xkb_symbols "rstu" { - include "ua(legacy)" - - name[Group1]= "Ukraine - Standard RSTU"; - - key { [ apostrophe, question ] }; - key { [ exclam, 1 ] }; - key { [ quotedbl, 2 ] }; - key { [ numbersign, 3 ] }; - key { [ semicolon, 4 ] }; - key { [ colon, 5 ] }; - key { [ comma, 6 ] }; - key { [ period, 7 ] }; - key { [ asterisk, 8 ] }; - key { [ parenleft, 9 ] }; - key { [ parenright, 0 ] }; - - key { [ Ukrainian_ghe_with_upturn, Ukrainian_GHE_WITH_UPTURN ] }; - - key { [ Cyrillic_i, Cyrillic_I ] }; - - key { [ Ukrainian_i, Ukrainian_I ] }; - - key { [ Ukrainian_yi, Ukrainian_YI ] }; - - key { [ slash, percent ] }; -}; - -// russian keyboard layout RSTU 2019-91 (Respublikanskij STandart Ukrajiny) -// Andrew Porokhnyak -partial alphanumeric_keys -xkb_symbols "rstu_ru" { - include "ru(common)" - name[Group1]= "Ukraine - Standard RSTU on Russian layout"; - - key { [ apostrophe, question ] }; - key { [ exclam, 1 ] }; - key { [ quotedbl, 2 ] }; - key { [ numbersign, 3 ] }; - key { [ semicolon, 4 ] }; - key { [ colon, 5 ] }; - key { [ comma, 6 ] }; - key { [ period, 7 ] }; - key { [ asterisk, 8 ] }; - key { [ parenleft, 9 ] }; - key { [ parenright, 0 ] }; - key { [ slash, percent ] }; - -key.type[group1]="ALPHABETIC"; - - key { [ Cyrillic_io, Cyrillic_IO ] }; -}; - -//Homophonic keyboard layout (Tomas Marko Miljenović) -//Based on Ukrainian National Transliteration, commonly used phonetic layouts for Mac and Win. -//Existing layout "phonetic" used as template. -partial alphanumeric_keys -xkb_symbols "homophonic" { - include "ua(legacy)" - name[Group1]= "Ukraine - Homophonic"; - - key { [ grave, underscore ] }; - key { [ 1, exclam ] }; - key { [ 2, at ] }; - key { [ 3, semicolon ] }; - key { [ 4, colon ] }; - key { [ 5, percent ] }; - key { [ 6, apostrophe ] }; - key { [ 7, quotedbl ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ Ukrainian_ie, Ukrainian_IE ] }; - key { [ Ukrainian_yi, Ukrainian_YI ] }; - - key { [ Cyrillic_ya, Cyrillic_YA ] }; - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Cyrillic_ie, Cyrillic_IE ] }; - key { [ Cyrillic_er, Cyrillic_ER ] }; - key { [ Cyrillic_te, Cyrillic_TE ] }; - key { [ Cyrillic_i, Cyrillic_I ] }; - key { [ Cyrillic_u, Cyrillic_U ] }; - key { [ Ukrainian_i, Ukrainian_I ] }; - key { [ Cyrillic_o, Cyrillic_O ] }; - key { [ Cyrillic_pe, Cyrillic_PE ] }; - key { [ Cyrillic_yu, Cyrillic_YU ] }; - key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; - - key { [ Cyrillic_a, Cyrillic_A ] }; - key { [ Cyrillic_es, Cyrillic_ES ] }; - key { [ Cyrillic_de, Cyrillic_DE ] }; - key { [ Cyrillic_ef, Cyrillic_EF ] }; - key { [ Ukrainian_ghe_with_upturn, Ukrainian_GHE_WITH_UPTURN ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; - key { [ Cyrillic_ka, Cyrillic_KA ] }; - key { [ Cyrillic_el, Cyrillic_EL ] }; - key { [ Cyrillic_che, Cyrillic_CHE ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; - - key { [ Cyrillic_ze, Cyrillic_ZE ] }; - key { [ Cyrillic_ha, Cyrillic_HA ] }; - key { [ Cyrillic_tse, Cyrillic_TSE ] }; - key { [ Cyrillic_ve, Cyrillic_VE ] }; - key { [ Cyrillic_be, Cyrillic_BE ] }; - key { [ Cyrillic_en, Cyrillic_EN ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; - key { [ comma, less ] }; - key { [ period, greater ] }; - key { [ slash, question ] }; -}; - -// Crimean Tatar (Crimean Turkish) layouts. -partial -xkb_symbols "crh" { - include "tr(crh)" - - name[Group1]="Ukraine - Crimean Tatar (Turkish Q)"; -}; - -partial -xkb_symbols "crh_f" { - include "tr(crh_f)" - - name[Group1]="Ukraine - Crimean Tatar (Turkish F)"; -}; - -partial -xkb_symbols "crh_alt" { - include "tr(crh_alt)" - - name[Group1]="Ukraine - Crimean Tatar (Turkish Alt-Q)"; -}; +// based on +// ukrainian standard keyboard +// AEN & Leon Kanter +// Last Changes 2007/10/03 by Andriy Rysin + +// Unicode - 3d level added with some Unicode symbols (typographic quotes, m-dash, n-dash etc), +// some often used cyrillics from other slavic languages and some ASCII symbols used often (slash, brackets...) +partial default alphanumeric_keys +xkb_symbols "unicode" { + include "ua(winkeys)" + + name[Group1]= "Ukraine"; + + key { [ U2019, apostrophe, U0301, asciitilde ] }; // Apostrophe and Stress symbol + key { [ 1, exclam, onesuperior ] }; + key { [ 2, quotedbl, twosuperior ] }; + key { [ 3, numerosign, U00A7, U20B4 ] }; // Paragraph and Hryvnia sign + key { [ 4, semicolon, dollar, EuroSign ] }; + key { [ 5, percent, degree ] }; + key { [ 6, colon, less ] }; + key { [ 7, question, greater ] }; + key { [ 8, asterisk, enfilledcircbullet ] }; + key { [ 9, parenleft, bracketleft, braceleft ] }; + key { [ 0, parenright, bracketright, braceright] }; + key { [ minus, underscore, emdash, endash ] }; + key { [ equal, plus, notequal, plusminus ] }; + + key { [ Cyrillic_u, Cyrillic_U, Byelorussian_shortu, Byelorussian_SHORTU ]}; + key { [ Cyrillic_ka, Cyrillic_KA, registered ] }; // Registered tm + key { [ Cyrillic_ie, Cyrillic_IE, Cyrillic_io, Cyrillic_IO ] }; + key { [ Ukrainian_yi,Ukrainian_YI, Cyrillic_hardsign, Cyrillic_HARDSIGN ] }; + key { [ Ukrainian_i, Ukrainian_I, Cyrillic_yeru, Cyrillic_YERU ] }; + key { [ Ukrainian_ie,Ukrainian_IE, Cyrillic_e, Cyrillic_E ] }; + + key { [ Ukrainian_ghe_with_upturn, Ukrainian_GHE_WITH_UPTURN, backslash, bar ] }; + + key { [ Cyrillic_es, Cyrillic_ES, copyright ] }; + key { [ Cyrillic_te, Cyrillic_TE, trademark ] }; + key { [ Cyrillic_be, Cyrillic_BE, guillemotleft, doublelowquotemark ] }; + key { [ Cyrillic_yu, Cyrillic_YU, guillemotright, leftdoublequotemark ] }; + key { [ period, comma, slash, ellipsis ] }; + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "legacy" { + + name[Group1]= "Ukraine - Legacy"; + + key { [ apostrophe, asciitilde ] }; + key { [ 1, exclam ] }; + key { [ 2, quotedbl ] }; + key { [ 3, numbersign ] }; + key { [ 4, asterisk ] }; + key { [ 5, colon ] }; + key { [ 6, comma ] }; + key { [ 7, period ] }; + key { [ 8, semicolon ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ minus, underscore ] }; + key { [ equal, plus ] }; + + key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; + key { [ Cyrillic_tse, Cyrillic_TSE ] }; + key { [ Cyrillic_u, Cyrillic_U ] }; + key { [ Cyrillic_ka, Cyrillic_KA ] }; + key { [ Cyrillic_ie, Cyrillic_IE ] }; + key { [ Cyrillic_en, Cyrillic_EN ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; + key { [ Cyrillic_ze, Cyrillic_ZE ] }; + key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [ Ukrainian_yi, Ukrainian_YI ] }; + key { [ Ukrainian_ghe_with_upturn, Ukrainian_GHE_WITH_UPTURN ] }; + + key { [ Cyrillic_ef, Cyrillic_EF ] }; + key { [ Ukrainian_i, Ukrainian_I ] }; + key { [ Cyrillic_ve, Cyrillic_VE ] }; + key { [ Cyrillic_a, Cyrillic_A ] }; + key { [ Cyrillic_pe, Cyrillic_PE ] }; + key { [ Cyrillic_er, Cyrillic_ER ] }; + key { [ Cyrillic_o, Cyrillic_O ] }; + key { [ Cyrillic_el, Cyrillic_EL ] }; + key { [ Cyrillic_de, Cyrillic_DE ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ Ukrainian_ie, Ukrainian_IE ] }; + + key { [ Cyrillic_ya, Cyrillic_YA ] }; + key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_es, Cyrillic_ES ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; + key { [ Cyrillic_te, Cyrillic_TE ] }; + key { [ Cyrillic_i, Cyrillic_I ] }; + key { [Cyrillic_softsign,Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_be, Cyrillic_BE ] }; + key { [ Cyrillic_yu, Cyrillic_YU ] }; + key { [ slash, question ] }; + + key { [ slash, bar ] }; + // End alphanumeric section +}; + +partial alphanumeric_keys +xkb_symbols "winkeys" { + include "ua(legacy)" + + name[Group1]= "Ukraine - Winkeys"; + + key { [ 3, numerosign ] }; + key { [ 4, semicolon ] }; + key { [ 5, percent ] }; + key { [ 6, colon ] }; + key { [ 7, question ] }; + key { [ 8, asterisk ] }; + key { [ period, comma ] }; +}; + +partial alphanumeric_keys +xkb_symbols "typewriter" { + include "ua(legacy)" + + name[Group1]= "Ukraine - Typewriter"; + + key { [ apostrophe, quotedbl ] }; + key { [ exclam, 1 ] }; + key { [ numerosign, 2 ] }; + key { [ slash, 3 ] }; + key { [ semicolon, 4 ] }; + key { [ colon, 5 ] }; + key { [ comma, 6 ] }; + key { [ period, 7 ] }; + key { [ underscore, 8 ] }; + key { [ question, 9 ] }; + key { [ percent, 0 ] }; + + key { [ Ukrainian_ghe_with_upturn, Ukrainian_GHE_WITH_UPTURN ] }; + + key { [ Cyrillic_i, Cyrillic_I ] }; + + key { [ Ukrainian_i, Ukrainian_I ] }; + + key { [ Ukrainian_yi, Ukrainian_YI ] }; + + key { [ parenleft, parenright ] }; +}; + +partial alphanumeric_keys +xkb_symbols "phonetic" { + include "ua(legacy)" + + name[Group1]= "Ukraine - Phonetic"; + + key { [ Cyrillic_ya, Cyrillic_YA ] }; + key { [ Cyrillic_ve, Cyrillic_VE ] }; + key { [ Cyrillic_ie, Cyrillic_IE ] }; + key { [ Cyrillic_er, Cyrillic_ER ] }; + key { [ Cyrillic_te, Cyrillic_TE ] }; + key { [ Cyrillic_i, Cyrillic_I ] }; + key { [ Cyrillic_u, Cyrillic_U ] }; + key { [ Ukrainian_i, Ukrainian_I ] }; + key { [ Cyrillic_o, Cyrillic_O ] }; + key { [ Cyrillic_pe, Cyrillic_PE ] }; + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; + + key { [ Cyrillic_a, Cyrillic_A ] }; + key { [ Cyrillic_es, Cyrillic_ES ] }; + key { [ Cyrillic_de, Cyrillic_DE ] }; + key { [ Cyrillic_ef, Cyrillic_EF ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; + key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; + key { [ Cyrillic_ka, Cyrillic_KA ] }; + key { [ Cyrillic_el, Cyrillic_EL ] }; + key { [ Ukrainian_ghe_with_upturn, Ukrainian_GHE_WITH_UPTURN ] }; + key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_yu, Cyrillic_YU ] }; + + key { [ Cyrillic_ze, Cyrillic_ZE ] }; + key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_tse, Cyrillic_TSE ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ Cyrillic_be, Cyrillic_BE ] }; + key { [ Cyrillic_en, Cyrillic_EN ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; + key { [ Ukrainian_yi, Ukrainian_YI ] }; + key { [ Ukrainian_ie, Ukrainian_IE ] }; + key { [ slash, question ] }; +}; + +// ukrainian keyboard layout RSTU 2019-91 (Respublikanskij STandart Ukrajiny) +// Andrew Porokhnyak +partial alphanumeric_keys +xkb_symbols "rstu" { + include "ua(legacy)" + + name[Group1]= "Ukraine - Standard RSTU"; + + key { [ apostrophe, question ] }; + key { [ exclam, 1 ] }; + key { [ quotedbl, 2 ] }; + key { [ numbersign, 3 ] }; + key { [ semicolon, 4 ] }; + key { [ colon, 5 ] }; + key { [ comma, 6 ] }; + key { [ period, 7 ] }; + key { [ asterisk, 8 ] }; + key { [ parenleft, 9 ] }; + key { [ parenright, 0 ] }; + + key { [ Ukrainian_ghe_with_upturn, Ukrainian_GHE_WITH_UPTURN ] }; + + key { [ Cyrillic_i, Cyrillic_I ] }; + + key { [ Ukrainian_i, Ukrainian_I ] }; + + key { [ Ukrainian_yi, Ukrainian_YI ] }; + + key { [ slash, percent ] }; +}; + +// russian keyboard layout RSTU 2019-91 (Respublikanskij STandart Ukrajiny) +// Andrew Porokhnyak +partial alphanumeric_keys +xkb_symbols "rstu_ru" { + include "ru(common)" + name[Group1]= "Ukraine - Standard RSTU on Russian layout"; + + key { [ apostrophe, question ] }; + key { [ exclam, 1 ] }; + key { [ quotedbl, 2 ] }; + key { [ numbersign, 3 ] }; + key { [ semicolon, 4 ] }; + key { [ colon, 5 ] }; + key { [ comma, 6 ] }; + key { [ period, 7 ] }; + key { [ asterisk, 8 ] }; + key { [ parenleft, 9 ] }; + key { [ parenright, 0 ] }; + key { [ slash, percent ] }; + +key.type[group1]="ALPHABETIC"; + + key { [ Cyrillic_io, Cyrillic_IO ] }; +}; + +//Homophonic keyboard layout (Tomas Marko Miljenović) +//Based on Ukrainian National Transliteration, commonly used phonetic layouts for Mac and Win. +//Existing layout "phonetic" used as template. +partial alphanumeric_keys +xkb_symbols "homophonic" { + include "ua(legacy)" + name[Group1]= "Ukraine - Homophonic"; + + key { [ grave, underscore ] }; + key { [ 1, exclam ] }; + key { [ 2, at ] }; + key { [ 3, semicolon ] }; + key { [ 4, colon ] }; + key { [ 5, percent ] }; + key { [ 6, apostrophe ] }; + key { [ 7, quotedbl ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ Ukrainian_ie, Ukrainian_IE ] }; + key { [ Ukrainian_yi, Ukrainian_YI ] }; + + key { [ Cyrillic_ya, Cyrillic_YA ] }; + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Cyrillic_ie, Cyrillic_IE ] }; + key { [ Cyrillic_er, Cyrillic_ER ] }; + key { [ Cyrillic_te, Cyrillic_TE ] }; + key { [ Cyrillic_i, Cyrillic_I ] }; + key { [ Cyrillic_u, Cyrillic_U ] }; + key { [ Ukrainian_i, Ukrainian_I ] }; + key { [ Cyrillic_o, Cyrillic_O ] }; + key { [ Cyrillic_pe, Cyrillic_PE ] }; + key { [ Cyrillic_yu, Cyrillic_YU ] }; + key { [ Cyrillic_shcha, Cyrillic_SHCHA ] }; + + key { [ Cyrillic_a, Cyrillic_A ] }; + key { [ Cyrillic_es, Cyrillic_ES ] }; + key { [ Cyrillic_de, Cyrillic_DE ] }; + key { [ Cyrillic_ef, Cyrillic_EF ] }; + key { [ Ukrainian_ghe_with_upturn, Ukrainian_GHE_WITH_UPTURN ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; + key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; + key { [ Cyrillic_ka, Cyrillic_KA ] }; + key { [ Cyrillic_el, Cyrillic_EL ] }; + key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; + + key { [ Cyrillic_ze, Cyrillic_ZE ] }; + key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [ Cyrillic_tse, Cyrillic_TSE ] }; + key { [ Cyrillic_ve, Cyrillic_VE ] }; + key { [ Cyrillic_be, Cyrillic_BE ] }; + key { [ Cyrillic_en, Cyrillic_EN ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; + key { [ comma, less ] }; + key { [ period, greater ] }; + key { [ slash, question ] }; +}; + +// Crimean Tatar (Crimean Turkish) layouts. +partial +xkb_symbols "crh" { + include "tr(crh)" + + name[Group1]="Ukraine - Crimean Tatar (Turkish Q)"; +}; + +partial +xkb_symbols "crh_f" { + include "tr(crh_f)" + + name[Group1]="Ukraine - Crimean Tatar (Turkish F)"; +}; + +partial +xkb_symbols "crh_alt" { + include "tr(crh_alt)" + + name[Group1]="Ukraine - Crimean Tatar (Turkish Alt-Q)"; +}; diff --git a/xorg-server/xkeyboard-config/symbols/us b/xorg-server/xkeyboard-config/symbols/us index 092fb747d..8ff7ae537 100644 --- a/xorg-server/xkeyboard-config/symbols/us +++ b/xorg-server/xkeyboard-config/symbols/us @@ -1,1196 +1,1188 @@ -// $XKeyboardConfig$ - -// -// $XdotOrg: xc/programs/xkbcomp/symbols/us,v 1.1.4.3 2004/03/05 13:41:33 eich Exp $ -// $XFree86: xc/programs/xkbcomp/symbols/us,v 1.6 2003/10/31 14:32:05 pascal Exp $ - -default -partial alphanumeric_keys modifier_keys -xkb_symbols "basic" { - - name[Group1]= "USA"; - - // Alphanumeric section - key { [ grave, asciitilde ] }; - key { [ 1, exclam ] }; - key { [ 2, at ] }; - key { [ 3, numbersign ] }; - key { [ 4, dollar ] }; - key { [ 5, percent ] }; - key { [ 6, asciicircum ] }; - key { [ 7, ampersand ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ minus, underscore ] }; - key { [ equal, plus ] }; - - key { [ q, Q ] }; - key { [ w, W ] }; - key { [ e, E ] }; - key { [ r, R ] }; - key { [ t, T ] }; - key { [ y, Y ] }; - key { [ u, U ] }; - key { [ i, I ] }; - key { [ o, O ] }; - key { [ p, P ] }; - key { [ bracketleft, braceleft ] }; - key { [ bracketright, braceright ] }; - - key { [ a, A ] }; - key { [ s, S ] }; - key { [ d, D ] }; - key { [ f, F ] }; - key { [ g, G ] }; - key { [ h, H ] }; - key { [ j, J ] }; - key { [ k, K ] }; - key { [ l, L ] }; - key { [ semicolon, colon ] }; - key { [ apostrophe, quotedbl ] }; - - key { [ z, Z ] }; - key { [ x, X ] }; - key { [ c, C ] }; - key { [ v, V ] }; - key { [ b, B ] }; - key { [ n, N ] }; - key { [ m, M ] }; - key { [ comma, less ] }; - key { [ period, greater ] }; - key { [ slash, question ] }; - - key { [ backslash, bar ] }; - // End alphanumeric section -}; - -partial alphanumeric_keys -xkb_symbols "euro" { - - name[Group1]= "USA - With EuroSign on 5"; - - include "us(basic)" - - include "eurosign(5)" - - include "level3(ralt_switch)" -}; - - -partial alphanumeric_keys -xkb_symbols "intl" { - - name[Group1]= "USA - International (with dead keys)"; - - include "us(basic)" - - // Alphanumeric section - key { [dead_grave, dead_tilde, grave, asciitilde ] }; - key { [ 1, exclam, exclamdown, onesuperior ] }; - key { [ 2, at, twosuperior, dead_doubleacute ] }; - key { [ 3, numbersign, threesuperior, dead_macron ] }; - key { [ 4, dollar, currency, sterling ] }; - key { [ 5, percent, EuroSign, dead_cedilla ] }; - key { [ 6, dead_circumflex, onequarter, asciicircum ] }; - key { [ 7, ampersand, onehalf, dead_horn ] }; - key { [ 8, asterisk, threequarters, dead_ogonek ] }; - key { [ 9, parenleft, leftsinglequotemark, dead_breve ] }; - key { [ 0, parenright, rightsinglequotemark, dead_abovering ] }; - key { [ minus, underscore, yen, dead_belowdot ] }; - key { [ equal, plus, multiply, division ] }; - - key { [ q, Q, adiaeresis, Adiaeresis ] }; - key { [ w, W, aring, Aring ] }; - key { [ e, E, eacute, Eacute ] }; - key { [ r, R, registered, registered ] }; - key { [ t, T, thorn, THORN ] }; - key { [ y, Y, udiaeresis, Udiaeresis ] }; - key { [ u, U, uacute, Uacute ] }; - key { [ i, I, iacute, Iacute ] }; - key { [ o, O, oacute, Oacute ] }; - key { [ p, P, odiaeresis, Odiaeresis ] }; - key { [ bracketleft, braceleft, guillemotleft, leftdoublequotemark ] }; - key { [bracketright, braceright, guillemotright, rightdoublequotemark ] }; - - key { [ a, A, aacute, Aacute ] }; - key { [ s, S, ssharp, section ] }; - key { [ d, D, eth, ETH ] }; - key { [ f, F, f, F ] }; - key { [ g, G, g, G ] }; - key { [ h, H, h, H ] }; - key { [ j, J, j, J ] }; - key { [ k, K, oe, OE ] }; - - key { [ l, L, oslash, Ooblique ] }; - key { [ semicolon, colon, paragraph, degree ] }; - key { [dead_acute, dead_diaeresis, apostrophe, quotedbl ] }; - - key { [ z, Z, ae, AE ] }; - key { [ x, X, x, X ] }; - key { [ c, C, copyright, cent ] }; - key { [ v, V, v, V ] }; - key { [ b, B, b, B ] }; - key { [ n, N, ntilde, Ntilde ] }; - key { [ m, M, mu, mu ] }; - key { [ comma, less, ccedilla, Ccedilla ] }; - key { [ period, greater, dead_abovedot, dead_caron ] }; - key { [ slash, question, questiondown, dead_hook ] }; - key { [ backslash, bar, notsign, brokenbar ] }; - - include "level3(ralt_switch)" -}; - -// Based on symbols/us_intl keyboard map: -// Dead-keys definition for a very simple US/ASCII layout. -// by Conectiva (http://www.conectiva.com.br) -// modified by Ricardo Y. Igarashi (iga@that.com.br) - -// Added the following deadkeys, to make it truly international: -// -// dead_macron: on AltGr-minus -// dead_breve: on AltGr-parenleft -// dead_abovedot: on AltGr-period -// dead_abovering: on AltGr-0 -// dead_doubleacute: on AltGr-equal (as quotedbl is already used) -// dead_caron: on AltGr-less (AltGr-shift-comma) -// dead_cedilla: on AltGr-comma -// dead_ogonek: on AltGr-semicolon -// dead_belowdot: on AltGr-underscore (AltGr-shift-minus) -// dead_hook: on AltGr-question -// dead_horn: on AltGr-plus (AltGr-shift-equal) -// dead_diaeresis: on AltGr-colon (Alt-shift-semicolon) -// -// those were already there: -// dead_grave -// dead_acute -// dead_circumflex -// dead_tilde -// dead_diaeresis - -partial alphanumeric_keys -xkb_symbols "alt-intl" { - - name[Group1]= "USA - Alternative international"; - - include "us" - - key { [ dead_grave, dead_tilde, grave, asciitilde ] }; - key { [ 5, percent, EuroSign ] }; - key { [ 6, dead_circumflex, asciicircum, asciicircum ] }; - key { [ 9, parenleft, leftsinglequotemark, dead_breve ] }; - key { [ 0, parenright, rightsinglequotemark, dead_abovering ] }; - key { [ minus, underscore, dead_macron, dead_belowdot ] }; - key { [ equal, plus, dead_doubleacute, dead_horn ] }; - - key { [ e, E, EuroSign, cent ] }; - - key { [ semicolon, colon, dead_ogonek, dead_diaeresis ] }; - key { [ dead_acute, dead_diaeresis, apostrophe, quotedbl ] }; - - key { [ comma, less, dead_cedilla, dead_caron ] }; - key { [ period, greater, dead_abovedot, dead_circumflex ] }; - key { [ slash, question, dead_hook, dead_hook ] }; - - include "level3(ralt_switch)" -}; - -// based on a keyboard map from an 'xkb/symbols/dk' file -// -// $XFree86: xc/programs/xkbcomp/symbols/dvorak,v 1.5 2004/01/03 16:35:07 herrb Exp $ - -partial alphanumeric_keys -xkb_symbols "dvorak" { - - name[Group1]= "USA - Dvorak"; - - // Alphanumeric section - - key { [ grave, asciitilde, dead_grave, dead_tilde ] }; - - key { [ 1, exclam ] }; - key { [ 2, at ] }; - key { [ 3, numbersign ] }; - key { [ 4, dollar ] }; - key { [ 5, percent ] }; - key { [ 6, asciicircum, dead_circumflex, dead_circumflex ] }; - key { [ 7, ampersand ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenleft, dead_grave] }; - key { [ 0, parenright ] }; - key { [ bracketleft, braceleft ] }; - key { [ bracketright, braceright, dead_tilde] }; - - key { [ apostrophe, quotedbl, dead_acute, dead_diaeresis ] }; - key { [ comma, less, dead_cedilla, dead_caron ] }; - key { [ period, greater, dead_abovedot, periodcentered ] }; - key { [ p, P ] }; - key { [ y, Y ] }; - key { [ f, F ] }; - key { [ g, G ] }; - key { [ c, C ] }; - key { [ r, R ] }; - key { [ l, L ] }; - key { [ slash, question ] }; - key { [ equal, plus ] }; - - key { [ a, A ] }; - key { [ o, O ] }; - key { [ e, E ] }; - key { [ u, U ] }; - key { [ i, I ] }; - key { [ d, D ] }; - key { [ h, H ] }; - key { [ t, T ] }; - key { [ n, N ] }; - key { [ s, S ] }; - key { [ minus, underscore ] }; - - key { [ semicolon, colon, dead_ogonek, dead_doubleacute ] }; - key { [ q, Q ] }; - key { [ j, J ] }; - key { [ k, K ] }; - key { [ x, X ] }; - key { [ b, B ] }; - key { [ m, M ] }; - key { [ w, W ] }; - key { [ v, V ] }; - key { [ z, Z ] }; - - key { [ backslash, bar ] }; -}; - -// Dvorak international with dead keys -// Olivier Mehani (shtrom-xorg@ssji.net) -// Reproduce the per-key mapping of us(intl) for the dvorak layout -// aka "I just swapped my keys over" -partial alphanumeric_keys -xkb_symbols "dvorak-intl" { - - name[Group1]= "USA - Dvorak international (with dead keys)"; - - include "us(dvorak)" - - key { [dead_grave, dead_tilde, grave, asciitilde ] }; - - key { [ 1, exclam, exclamdown, onesuperior ] }; - key { [ 2, at, twosuperior, dead_doubleacute ] }; - key { [ 3, numbersign, threesuperior, dead_macron ] }; - key { [ 4, dollar, currency, sterling ] }; - key { [ 5, percent, EuroSign, dead_cedilla ] }; - key { [ 6, dead_circumflex, onequarter, asciicircum ] }; - key { [ 7, ampersand, onehalf, dead_horn ] }; - key { [ 8, asterisk, threequarters, dead_ogonek ] }; - key { [ 9, parenleft, leftsinglequotemark, dead_breve ] }; - key { [ 0, parenright, rightsinglequotemark, dead_abovering ] }; - key { [ bracketleft, braceleft, guillemotleft, leftdoublequotemark ] }; - key { [bracketright, braceright, guillemotright, rightdoublequotemark ] }; - - key { [dead_acute, dead_diaeresis, apostrophe, quotedbl ] }; - key { [ comma, less, ccedilla, Ccedilla ] }; - key { [ period, greater, dead_abovedot, dead_caron ] }; - key { [ p, P, odiaeresis, Odiaeresis ] }; - key { [ y, Y, udiaeresis, Udiaeresis ] }; - // key { [ f, F ] }; - // key { [ g, G ] }; - key { [ c, C, copyright, cent ] }; - key { [ r, R, registered, registered ] }; - key { [ l, L, oslash, Ooblique ] }; - key { [ slash, question, questiondown, dead_hook ] }; - // key { [ equal, plus, multiply, division ] }; - - key { [ a, A, aacute, Aacute ] }; - key { [ o, O, oacute, Oacute ] }; - key { [ e, E, eacute, Eacute ] }; - key { [ u, U, uacute, Uacute ] }; - key { [ i, I, iacute, Iacute ] }; - key { [ d, D, eth, ETH ] }; - // key { [ h, H ] }; - key { [ t, T, thorn, THORN ] }; - key { [ n, N, ntilde, Ntilde ] }; - key { [ s, S, ssharp, section ] }; - // key { [ minus, underscore, yen, dead_belowdot ] }; - - key { [ semicolon, colon, paragraph, degree ] }; - key { [ q, Q, adiaeresis, Adiaeresis ] }; - // key { [ j, J ] }; - key { [ k, K, oe, OE ] }; - // key { [ x, X ] }; - // key { [ b, B ] }; - key { [ m, M, mu, mu ] }; - key { [ w, W, aring, Aring ] }; - // key { [ v, V ] }; - key { [ z, Z, ae, AE ] }; - - key { [ backslash, bar, notsign, brokenbar ] }; - - include "level3(ralt_switch)" -}; - -// Dvorak international without dead keys -// Stephane Magnenat (stephane at magnenat dot net, http://stephane.magnenat.net) -// Based on information from http://www.poupinou.org/dvorak/index.html -// -// ` 1 2 3 4 5 6 7 8 9 0 [ ] \ -// € -// -// ' , . p y f g c r l / = -// ä ê ë ü ç -// -// a o e u i d h t n s - -// à ô é û î ß -// -// ; q j k x b m w v z -// â ö è ù ï - -partial alphanumeric_keys -xkb_symbols "dvorak-alt-intl" { - - name[Group1]= "USA - Dvorak alternative international (no dead keys)"; - - include "us(dvorak)" - - key { [ 4, dollar, EuroSign ] }; - - key { [ comma, less, adiaeresis, dead_caron ] }; - key { [ period, greater, ecircumflex, periodcentered ] }; - key { [ p, P, ediaeresis, dead_cedilla ] }; - key { [ y, Y, udiaeresis ] }; - key { [ c, C, ccedilla, dead_abovedot ] }; - - key { [ a, A, agrave ] }; - key { [ o, O, ocircumflex ] }; - key { [ e, E, eacute ] }; - key { [ u, U, ucircumflex ] }; - key { [ i, I, icircumflex ] }; - key { [ s, S, ssharp ] }; - - key { [ semicolon, colon, acircumflex ] }; - key { [ q, Q, odiaeresis, dead_ogonek ] }; - key { [ j, J, egrave, dead_doubleacute ] }; - key { [ k, K, ugrave ] }; - key { [ x, X, idiaeresis ] }; - - include "level3(ralt_switch)" -}; - -// Left and right handed dvorak layouts -// by sqweek 2006-01-30 -// Based on the corresponding layouts in the console-tools package. -partial alphanumeric_keys -xkb_symbols "dvorak-l" { - - include "us(dvorak)" - name[Group1]= "USA - Left handed Dvorak"; - - key { [ bracketleft, braceleft ] }; - key { [ bracketright, braceright ] }; - key { [ slash, question ] }; - key { [ p, P ] }; - key { [ f, F ] }; - key { [ m, M ] }; - key { [ l, L ] }; - key { [ j, J ] }; - key { [ 4, dollar ] }; - key { [ 3, numbersign ] }; - key { [ 2, at ] }; - key { [ 1, exclam ] }; - - key { [ semicolon, colon ] }; - key { [ q, Q ] }; - key { [ b, B ] }; - key { [ y, Y ] }; - key { [ u, U ] }; - key { [ r, R ] }; - key { [ s, S ] }; - key { [ o, O ] }; - key { [ period, greater ] }; - key { [ 6, asciicircum ] }; - key { [ 5, percent ] }; - key { [ equal, plus ] }; - - key { [ minus, underscore ] }; - key { [ k, K ] }; - key { [ c, C ] }; - key { [ d, D ] }; - key { [ t, T ] }; - key { [ h, H ] }; - key { [ e, E ] }; - key { [ a, A ] }; - key { [ z, Z ] }; - key { [ 8, asterisk ] }; - key { [ 7, ampersand ] }; - - key { [ apostrophe, quotedbl ] }; - key { [ x, X ] }; - key { [ g, G ] }; - key { [ v, V ] }; - key { [ w, W ] }; - key { [ n, N ] }; - key { [ i, I ] }; - key { [ comma, less ] }; - key { [ 0, parenright ] }; - key { [ 9, parenleft ] }; -}; - -partial alphanumeric_keys -xkb_symbols "dvorak-r" { - - include "us(dvorak)" - name[Group1]= "USA - Right handed Dvorak"; - - key { [ 1, exclam ] }; - key { [ 2, at ] }; - key { [ 3, numbersign ] }; - key { [ 4, dollar ] }; - key { [ j, J ] }; - key { [ l, L ] }; - key { [ m, M ] }; - key { [ f, F ] }; - key { [ p, P ] }; - key { [ slash, question ] }; - key { [ bracketleft, braceleft ] }; - key { [ bracketright, braceright ] }; - - key { [ 5, percent ] }; - key { [ 6, asciicircum ] }; - key { [ q, Q ] }; - key { [ period, greater ] }; - key { [ o, O ] }; - key { [ r, R ] }; - key { [ s, S ] }; - key { [ u, U ] }; - key { [ y, Y ] }; - key { [ b, B ] }; - key { [ semicolon, colon ] }; - key { [ equal, plus ] }; - - key { [ 7, ampersand ] }; - key { [ 8, asterisk ] }; - key { [ z, Z ] }; - key { [ a, A ] }; - key { [ e, E ] }; - key { [ h, H ] }; - key { [ t, T ] }; - key { [ d, D ] }; - key { [ c, C ] }; - key { [ k, K ] }; - key { [ minus, underscore ] }; - - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ x, X ] }; - key { [ comma, less ] }; - key { [ i, I ] }; - key { [ n, N ] }; - key { [ w, W ] }; - key { [ v, V ] }; - key { [ g, G ] }; - key { [ apostrophe, quotedbl ] }; -}; - -// Classic dvorak layout -// by Piter Punk - 2006-07-06 -// Based on dvorak layout and e-mail from Russel L. Harris rlharris@oplink.net -// on xorg list. -partial alphanumeric_keys -xkb_symbols "dvorak-classic" { - - name[Group1]= "USA - Classic Dvorak"; - - // Alphanumeric section - - key { [ grave, asciitilde, dead_grave, dead_tilde ] }; - - key { [ bracketleft, braceleft ] }; - key { [ 7, ampersand ] }; - key { [ 5, percent ] }; - key { [ 3, numbersign ] }; - key { [ 1, exclam ] }; - key { [ 9, parenleft, dead_grave] }; - key { [ 0, parenright ] }; - key { [ 2, at ] }; - key { [ 4, dollar ] }; - key { [ 6, asciicircum, dead_circumflex, dead_circumflex ] }; - key { [ 8, asterisk ] }; - key { [ bracketright, braceright, dead_tilde] }; - - key { [ slash, question ] }; - key { [ comma, less, dead_cedilla, dead_caron ] }; - key { [ period, greater, dead_abovedot, periodcentered ] }; - key { [ p, P ] }; - key { [ y, Y ] }; - key { [ f, F ] }; - key { [ g, G ] }; - key { [ c, C ] }; - key { [ r, R ] }; - key { [ l, L ] }; - key { [ apostrophe, quotedbl, dead_acute, dead_diaeresis ] }; - key { [ equal, plus ] }; - - key { [ a, A ] }; - key { [ o, O ] }; - key { [ e, E ] }; - key { [ u, U ] }; - key { [ i, I ] }; - key { [ d, D ] }; - key { [ h, H ] }; - key { [ t, T ] }; - key { [ n, N ] }; - key { [ s, S ] }; - key { [ minus, underscore ] }; - - key { [ semicolon, colon, dead_ogonek, dead_doubleacute ] }; - key { [ q, Q ] }; - key { [ j, J ] }; - key { [ k, K ] }; - key { [ x, X ] }; - key { [ b, B ] }; - key { [ m, M ] }; - key { [ w, W ] }; - key { [ v, V ] }; - key { [ z, Z ] }; - key { [ backslash, bar ] }; -}; - -// Programmer Dvorak, by Roland Kaufmann -// License: BSD, available at -// Main features: Numbers are in shift position (like French), symbols have been -// placed in locations that give good hand-alternation and finger rolling with -// symbols that usually follows, accented characters are possible for I18N. -partial alphanumeric_keys -xkb_symbols "dvp" { - include "us(dvorak)" - - name[Group1] = "USA - Programmer Dvorak"; - - // Unmodified Shift AltGr Shift+AltGr - // symbols row, left side - key { [ dollar, asciitilde, dead_tilde ] }; - key { [ ampersand, percent ] }; - key { [ bracketleft, 7, currency ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; - key { [ braceleft, 5, cent ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; - key { [ braceright, 3, yen ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; - key { [ parenleft, 1, EuroSign ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; - key { [ equal, 9, sterling ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; - - // symbols row, right side - key { [ asterisk, 0 ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; - key { [ parenright, 2, onehalf ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; - key { [ plus, 4 ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; - key { [ bracketright, 6 ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; - key { [ exclam, 8, exclamdown ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; - key { [ numbersign, grave, dead_grave ] }; - key { [ BackSpace ] }; - - // upper row, left side - key { [ semicolon, colon, dead_diaeresis ] }; - key { [ comma, less, guillemotleft ] }; - key { [ period, greater, guillemotright ] }; - key { [ p, P, paragraph, section ] }; - key { [ y, Y, udiaeresis, Udiaeresis ] }; - - // upper row, right side - key { [ c, C, ccedilla, Ccedilla ] }; - key { [ r, R, registered, trademark ] }; - key { [ slash, question, questiondown ] }; - key { [ at, asciicircum, dead_circumflex, dead_caron ] }; - - // home row, left side - key { [ a, A, aring, Aring ] }; - key { [ o, O, oslash, Ooblique ] }; - key { [ e, E, ae, AE ] }; - key { [ u, U, eacute, Eacute ] }; - - // home row, right side - key { [ d, D, eth, ETH ] }; - key { [ h, H, dead_acute ] }; - key { [ t, T, thorn, THORN ] }; - key { [ n, N, ntilde, Ntilde ] }; - key { [ s, S, ssharp ] }; - key { [ minus, underscore, hyphen ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; - key { [ backslash, bar ] }; - - // lower row, left side - key { [ apostrophe, quotedbl, dead_acute ] }; -}; - -// phonetic layout for Russian letters on an US keyboard -// by Ivan Popov 2005-07-17 - -// level3 modifier is a shortcut to the "us" meaning of the keys where -// we place cyrillic letters, handy for accessing the corresponding -// punctuation marks. -// It is important to have access to punctuation marks, and the rest of -// alphabetical keys are added for being consequent so that the users -// can expect the level3 modifier to give what the key label shows. - -partial alphanumeric_keys -xkb_symbols "rus" { - - name[Group1]= "USA - Russian phonetic"; - - include "us(basic)" - -key.type[group1]="FOUR_LEVEL_ALPHABETIC"; - - key { [ Cyrillic_a, Cyrillic_A ] }; - key { [ Cyrillic_be, Cyrillic_BE ] }; - key { [ Cyrillic_ve, Cyrillic_VE ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key { [ Cyrillic_de, Cyrillic_DE ] }; - key { [ Cyrillic_ie, Cyrillic_IE ] }; - key { [ Cyrillic_io, Cyrillic_IO, grave, asciitilde ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ Cyrillic_ze, Cyrillic_ZE ] }; - key { [ Cyrillic_i, Cyrillic_I ] }; - key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; - key { [ Cyrillic_ka, Cyrillic_KA ] }; - key { [ Cyrillic_el, Cyrillic_EL ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; - key { [ Cyrillic_en, Cyrillic_EN ] }; - key { [ Cyrillic_o, Cyrillic_O ] }; - key { [ Cyrillic_pe, Cyrillic_PE ] }; - key { [ Cyrillic_er, Cyrillic_ER ] }; - key { [ Cyrillic_es, Cyrillic_ES ] }; - key { [ Cyrillic_te, Cyrillic_TE ] }; - key { [ Cyrillic_u, Cyrillic_U ] }; - key { [ Cyrillic_ef, Cyrillic_EF ] }; - key { [ Cyrillic_ha, Cyrillic_HA ] }; - key { [ Cyrillic_tse, Cyrillic_TSE ] }; - key { [ Cyrillic_che, Cyrillic_CHE, semicolon, colon ] }; - key { [ Cyrillic_sha, Cyrillic_SHA, bracketleft, braceleft] }; - key { [ Cyrillic_shcha, Cyrillic_SHCHA, bracketright, braceright ] }; - key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN, equal, plus ] }; - key { [ Cyrillic_yeru, Cyrillic_YERU ] }; - key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_e, Cyrillic_E, backslash, bar ] }; - key { [ Cyrillic_yu, Cyrillic_YU, apostrophe, quotedbl ] }; - key { [ Cyrillic_ya, Cyrillic_YA ] }; - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "mac" { - - include "us(basic)" - name[Group1]= "USA - Macintosh"; - key.type[group1]="FOUR_LEVEL"; - - // Slightly improvised from http://homepage.mac.com/thgewecke/kblayout.jpg - key { [ section, plusminus, section, plusminus ] }; - key { [ grave, asciitilde, dead_grave, dead_horn ] }; - key { [ 1, exclam, exclamdown, U2044 ] }; - key { [ 2, at, trademark, EuroSign ] }; - key { [ 3, numbersign, sterling, U2039 ] }; - key { [ 4, dollar, cent, U203A ] }; - key { [ 5, percent, infinity, UFB01 ] }; - key { [ 6,asciicircum, section, UFB02 ] }; - key { [ 7, ampersand, paragraph, doubledagger ] }; - key { [ 8, asterisk, enfilledcircbullet, degree ] }; - key { [ 9, parenleft, ordfeminine, periodcentered ] }; - key { [ 0, parenright, masculine,singlelowquotemark] }; - key { [ minus, underscore, endash, emdash ] }; - key { [ equal, plus, notequal, plusminus ] }; - - key { [ q, Q, oe, OE ] }; - key { [ w, W, U2211,doublelowquotemark] }; - key { [ e, E, dead_acute, acute ] }; - key { [ r, R, registered, U2030 ] }; - key { [ t, T, dagger, dead_caron ] }; - key { [ y, Y, yen, onequarter ] }; - key { [ u, U, dead_diaeresis, diaeresis ] }; - key { [ i, I, dead_circumflex, U02C6 ] }; - key { [ o, O, oslash, Ooblique ] }; - key { [ p, P, Greek_pi, U220F ] }; - key { [ bracketleft, braceleft, leftdoublequotemark, rightdoublequotemark ] }; - key { [bracketright, braceright, leftsinglequotemark, rightsinglequotemark ] }; - key { [ backslash, bar, guillemotleft, guillemotright ] }; - - key { [ a, A, aring, Aring ] }; - key { [ s, S, ssharp, dead_stroke ] }; - key { [ d, D, partialderivative, eth ] }; - key { [ f, F, function, dead_hook ] }; - key { [ g, G, copyright, dead_doubleacute ] }; - key { [ h, H, dead_abovedot, dead_belowdot ] }; - key { [ j, J, U2206, onehalf ] }; - key { [ k, K,dead_abovering, UF8FF ] }; - - key { [ l, L, notsign, THORN ] }; - key { [ semicolon, colon, U2026, thorn ] }; - key { [apostrophe, quotedbl, ae, AE ] }; - - key { [ z, Z, Greek_OMEGA, dead_cedilla ] }; - key { [ x, X, U2248, dead_ogonek ] }; - // unclear whether "approxeq" is 2248 or 2245 - key { [ c, C, ccedilla, Ccedilla ] }; - key { [ v, V, squareroot, U25CA ] }; - key { [ b, B, integral, idotless ] }; - key { [ n, N, dead_tilde, U02DC ] }; - key { [ m, M, mu, threequarters ] }; - key { [ comma, less, lessthanequal, dead_macron ] }; - key { [ period, greater, greaterthanequal, dead_breve ] }; - key { [ slash, question, division, questiondown ] }; - - include "level3(ralt_switch)" -}; - -// Colemak symbols for xkb on X.Org Server 7.x -// 2006-01-01 Shai Coleman, http://colemak.com/ . Public domain. - -partial alphanumeric_keys -xkb_symbols "colemak" { - include "us" - name[Group1]= "USA - Colemak"; - - // Alphanumeric section - key { [ grave, asciitilde, dead_tilde, asciitilde ] }; - key { [ 1, exclam, exclamdown, onesuperior ] }; - key { [ 2, at, masculine, twosuperior ] }; - key { [ 3, numbersign, ordfeminine, threesuperior ] }; - key { [ 4, dollar, cent, sterling ] }; - key { [ 5, percent, EuroSign, yen ] }; - key { [ 6, asciicircum, hstroke, Hstroke ] }; - key { [ 7, ampersand, eth, ETH ] }; - key { [ 8, asterisk, thorn, THORN ] }; - key { [ 9, parenleft, leftsinglequotemark, leftdoublequotemark ] }; - key { [ 0, parenright, rightsinglequotemark, rightdoublequotemark ] }; - key { [ minus, underscore, endash, emdash ] }; - key { [ equal, plus, multiply, division ] }; - - key { [ q, Q, adiaeresis, Adiaeresis ] }; - key { [ w, W, aring, Aring ] }; - key { [ f, F, atilde, Atilde ] }; - key { [ p, P, oslash, Ooblique ] }; - key { [ g, G, dead_ogonek, asciitilde ] }; - key { [ j, J, dstroke, Dstroke ] }; - key { [ l, L, lstroke, Lstroke ] }; - key { [ u, U, uacute, Uacute ] }; - key { [ y, Y, udiaeresis, Udiaeresis ] }; - key { [ semicolon, colon, odiaeresis, Odiaeresis ] }; - key { [ bracketleft, braceleft, guillemotleft, 0x1002039 ] }; - key { [ bracketright, braceright, guillemotright, 0x100203a ] }; - key { [ backslash, bar, asciitilde, asciitilde ] }; - - key { [ a, A, aacute, Aacute ] }; - key { [ r, R, dead_grave, asciitilde ] }; - key { [ s, S, ssharp, asciitilde ] }; - key { [ t, T, dead_acute, dead_doubleacute ] }; - key { [ d, D, dead_diaeresis, asciitilde ] }; - key { [ h, H, dead_caron, asciitilde ] }; - key { [ n, N, ntilde, Ntilde ] }; - key { [ e, E, eacute, Eacute ] }; - key { [ i, I, iacute, Iacute ] }; - key { [ o, O, oacute, Oacute ] }; - key { [ apostrophe, quotedbl, otilde, Otilde ] }; - - key { [ z, Z, ae, AE ] }; - key { [ x, X, dead_circumflex, asciitilde ] }; - key { [ c, C, ccedilla, Ccedilla ] }; - key { [ v, V, oe, OE ] }; - key { [ b, B, dead_breve, asciitilde ] }; - key { [ k, K, dead_abovering, asciitilde ] }; - key { [ m, M, dead_macron, asciitilde ] }; - key { [ comma, less, dead_cedilla, asciitilde ] }; - key { [ period, greater, dead_abovedot, asciitilde ] }; - key { [ slash, question, questiondown, asciitilde ] }; - - key { [ BackSpace, BackSpace, BackSpace, BackSpace ] }; - key { [ minus, underscore, endash, emdash ] }; - key { [ space, space, space, nobreakspace ] }; - - include "level3(ralt_switch)" -}; - -// I do NOT like dead-keys - the International keyboard as defined by Microsoft -// doesn't fit my needs. Why use two keystrokes for all simple characters (eg ' -// and generates a single ') just to have an é (eacute) in two strokes -// as well? I type ' more often than é (eacute). -// -// This file works just like a regular keyboard, BUT has all dead-keys -// accessible at level3 (through AltGr). An ë (ediaeresis) is now: AltGr+" -// followed by an e. In other words, this keyboard is not international as long -// as you leave the right Alt key alone. -// -// The original MS International keyboard was intended for Latin1 (iso8859-1). -// With the introduction of iso8859-15, the (important) ligature oe (and OE) -// became available. I added them next to ae. Because I write ediaeresis more -// often than registered, I moved registered to be next to copyright and added -// ediaeresis and idiaeresis. - Adriaan - -partial alphanumeric_keys -xkb_symbols "altgr-intl" { - - name[Group1]= "USA - International (AltGr dead keys)"; - - include "us(intl)" - -// five dead keys moved into level3: - - key { [ grave, asciitilde, dead_grave, dead_tilde ] }; - key { [apostrophe,quotedbl, dead_acute, dead_diaeresis ] }; - -// diversions from the MS Intl keyboard: - - key { [ 1, exclam, onesuperior, exclamdown ] }; - key { [ r, R, ediaeresis, Ediaeresis ] }; - key { [ j, J, idiaeresis, Idiaeresis ] }; - key { [ x, X, oe, OE ] }; - key { [ v, V, registered, registered ] }; - -// onequarter etc (not in iso8859-15) moved to get three unshifted deadkeys: - - key { [ 6, asciicircum, dead_circumflex, onequarter ] }; - key { [ 7, ampersand, dead_horn, onehalf ] }; - key { [ 8, asterisk, dead_ogonek, threequarters ] }; - - include "level3(ralt_switch)" -}; - -// Intel ClassmatePC Keyboard Layout -// by Piter PUNK -// -// The keyboard layouts below maps the us(basic), us(intl) and us(alt-intl) -// to ClassmatePC keyboard. All layouts uses RCTL as level3(switch) since -// the keyboard doesn't have AltGr key. The EuroSign is engraved at 5 key. - -// classmate - us(basic) -partial alphanumeric_keys -xkb_symbols "classmate" { - include "us(basic)" - name[Group1]= "USA - ClassmatePC"; - - key { [ backslash, bar, backslash, bar ] }; - - include "eurosign(5)" - include "level3(switch)" -}; - -// classmate-intl - us(intl) -// RCTL is generated by Fn+Alt, because that, when trying to access -// the level3 symbols at 7,8,9,0,u,i,o,p,j,k,l,;,m,. and / we got -// the keypad keycodes. The keypad is changed to make Fn+Alt+ -// generate the same symbol as the original key. -partial alphanumeric_keys -xkb_symbols "classmate-intl" { - include "us(intl)" - name[Group1]= "USA - ClassmatePC (International)"; - key.type[Group1]="FOUR_LEVEL"; - - key { [ backslash, bar, backslash, bar ] }; - - key { [ KP_Home, KP_7, - onehalf, dead_horn ] }; - key { [ KP_Up, KP_8, - threequarters, dead_ogonek ] }; - key { [ KP_Prior, KP_9, - leftsinglequotemark, dead_breve ] }; - key { [ KP_Multiply, KP_Multiply, - rightsinglequotemark, dead_abovering ] }; - - key { [ KP_Left, KP_4, - uacute, Uacute ] }; - key { [ KP_Begin, KP_5, - iacute, Iacute ] }; - key { [ KP_Right, KP_6, - oacute, Oacute ] }; - key { [ KP_Subtract, KP_Subtract, - odiaeresis, Odiaeresis ] }; - - key { [ KP_Down, KP_2, - oe, OE ] }; - key { [ KP_Next, KP_3, - oslash, Ooblique ] }; - key { [ KP_Add, KP_Add, - paragraph, degree ] }; - - key { [ KP_Insert, KP_0, - mu, mu ] }; - key { [ KP_Delete, KP_Decimal, - dead_abovedot, dead_caron ] }; - key { [ KP_Divide, KP_Divide, - questiondown, dead_hook ] }; - - include "level3(switch)" -}; - -// classmate-alt-intl - us(alt-intl) -// RCTL is generated by Fn+Alt, because that, when trying to access -// the level3 symbols at 7,8,9,0,u,i,o,p,j,k,l,;,m,. and / we got -// the keypad keycodes. The keypad is changed to make Fn+Alt+ -// generate the same symbol as the original key. -partial alphanumeric_keys -xkb_symbols "classmate-alt-intl" { - include "us(alt-intl)" - name[Group1]= "USA - ClassmatePC (Alternative international)"; - key.type[Group1]="FOUR_LEVEL"; - - key { [ backslash, bar, backslash, bar ] }; - - key { [ KP_Subtract, KP_Subtract ] }; - - key { [ KP_Prior, KP_9, - leftsinglequotemark, dead_breve ] }; - key { [ KP_Multiply, KP_Multiply, - rightsinglequotemark, dead_abovering ] }; - - key { [ KP_Add, KP_Add, - dead_ogonek, dead_diaeresis ] }; - - key { [ KP_Delete, KP_Decimal, - dead_abovedot, dead_circumflex ] }; - key { [ KP_Divide, KP_Divide, - dead_hook, dead_hook ] }; - - include "level3(switch)" -}; - -// classmate-altgr-intl - us(altgr-intl) -// RCTL is generated by Fn+Alt, because that, when trying to access -// the level3 symbols at 7,8,9,0,u,i,o,p,j,k,l,;,m,. and / we got -// the keypad keycodes. The keypad is changed to make Fn+Alt+ -// generate the same symbol as the original key. -partial alphanumeric_keys -xkb_symbols "classmate-altgr-intl" { - include "us(altgr-intl)" - name[Group1]= "USA - ClassmatePC (International Fn+Alt dead-keys)"; - key.type[Group1]="FOUR_LEVEL"; - - key { [ backslash, bar, backslash, bar ] }; - - key { [ KP_Home, KP_7, - dead_horn, dead_horn ] }; - key { [ KP_Up, KP_8, - dead_ogonek, dead_ogonek ] }; - key { [ KP_Prior, KP_9, - leftsinglequotemark, dead_breve ] }; - key { [ KP_Multiply, KP_Multiply, - rightsinglequotemark, dead_abovering ] }; - - key { [ KP_Left, KP_4, - uacute, Uacute ] }; - key { [ KP_Begin, KP_5, - iacute, Iacute ] }; - key { [ KP_Right, KP_6, - oacute, Oacute ] }; - key { [ KP_Subtract, KP_Subtract, - odiaeresis, Odiaeresis ] }; - - key { [ KP_End, KP_1, - idiaeresis, Idiaeresis ] }; - key { [ KP_Down, KP_2, - oe, OE ] }; - key { [ KP_Next, KP_3, - oslash, Ooblique ] }; - key { [ KP_Add, KP_Add, - paragraph, degree ] }; - - key { [ KP_Insert, KP_0, - mu, mu ] }; - key { [ KP_Delete, KP_Decimal, - dead_abovedot, dead_caron ] }; - key { [ KP_Divide, KP_Divide, - questiondown, dead_hook ] }; - - include "level3(switch)" -}; - -partial alphanumeric_keys -xkb_symbols "olpc" { - - include "us(basic)" - name[Group1]= "USA"; - - // OLPC international US English keyboard layout. - // It's a little different from the usual international layout. - // See: http://wiki.laptop.org/go/Image:Keyboard_english.png - - key { [ grave, asciitilde, dead_grave, dead_tilde ] }; - key { [ 1, exclam, exclamdown, exclamdown ] }; - key { [ 2, at, notsign, notsign ] }; - key { [ 3, numbersign, 0x1000300, 0x1000300 ] }; // combining grave - key { [ 4, dollar, 0x1000301, 0x1000301 ] }; // combining acute - key { [ 5, percent, 0x1000306, 0x1000306 ] }; // combining breve above - key { [ 6,asciicircum, 0x100030A, 0x100030A ] }; // combining ring above - key { [ 7, ampersand, 0x1000302, 0x1000302 ] }; // combining circumflex above - key { [ 8, asterisk, 0x100030C, 0x100030C ] }; // combining caron above - key { [ 9, parenleft, 0x1000307, 0x1000307 ] }; // combining dot above - key { [ 0, parenright, 0x1000308, 0x1000308 ] }; // combining diaeresis above - key { [ minus, underscore, 0x1000304, 0x1000304 ] }; // combining macron above - key { [ equal, plus, 0x1000303, 0x1000303 ] }; // combining tilde above - - key { [ q, Q, Greek_omega, Greek_OMEGA ] }; - key { [ w, W, oslash, Oslash ] }; - key { [ e, E, oe, OE ] }; - key { [ r, R, 0x1000327, 0x1000327 ] }; // combining cedilla - key { [ t, T, 0x100032E, 0x100032E ] }; // combining breve below - key { [ y, Y, 0x1000325, 0x1000325 ] }; // combining ring below - key { [ u, U, 0x100032D, 0x100032D ] }; // combining circumflex below - key { [ i, I, 0x100032C, 0x100032C ] }; // combining caron below - key { [ o, O, 0x1000323, 0x1000323 ] }; // combining dot below - key { [ p, P, 0x1000324, 0x1000324 ] }; // combining diaeresis below - key { [ bracketleft, braceleft, 0x1000331, 0x1000331 ] }; // combining macron below - key { [bracketright, braceright, 0x1000330, 0x1000330 ] }; // combining tilde below - - key { [ a, A, ae, AE ] }; - key { [ s, S, ssharp, 0x1001E9C ] }; // uppercase S sharp - key { [ d, D, eth, ETH ] }; - key { [ f, F, thorn, THORN ] }; - key { [ h, H, sterling, sterling ] }; - key { [ j, J, EuroSign, EuroSign ] }; - key { [ semicolon, colon, masculine, ordfeminine ] }; - key { [ apostrophe, quotedbl, currency, currency ] }; - key { [ backslash, bar, section, section ] }; - - key { [ c, C, ccedilla, Ccedilla ] }; - key { [ n, N, ntilde, Ntilde ] }; - key { [ m, M, mu, mu ] }; - key { [ comma, less, guillemotleft, guillemotleft ] }; - key { [ period, greater, guillemotright, guillemotright ] }; - key { [ slash, question, questiondown, questiondown ] }; - - key { [ multiply, division, ISO_Next_Group, ISO_Prev_Group ] }; - - include "level3(ralt_switch)" -}; - -partial alphanumeric_keys -xkb_symbols "olpc2" { - include "us(olpc)" - name[Group1]= "USA - Layout toggle on multiply/divide key"; - include "group(olpc)" -}; - -// Based on Cherokee Nation Official Layout -// http://www.cherokee.org/extras/downloads/font/Keyboard.htm - -partial alphanumeric_keys modifier_keys -xkb_symbols "chr" { - - name[Group1]= "USA - Cherokee"; - key.type[group1]="ALPHABETIC"; - - // Alphanumeric section - key { [ grave, U13CA ] }; - key { [ 1, U13B1 ] }; - key { [ 2, U13C7 ] }; - key { [ 3, U13E7 ] }; - key { [ U13D9, U13B0 ] }; - key { [ U13E6, U13B9 ] }; - key { [ U13DC, U13DD ] }; - key { [ U13CB, U13E1 ] }; - key { [ U13D6, U13BA ] }; - key { [ U13D2, parenleft ] }; - key { [ U13C4, parenright ] }; - key { [ U13BF, U13BC ] }; - key { [ U13F3, U13BD ] }; - - key { [ U13AA, U13C6 ] }; - key { [ U13B3, U13EB ] }; - key { [ U13A1, U13E3 ] }; - key { [ U13DB, U13CF ] }; - key { [ U13D4, U13D8 ] }; - key { [ U13EF, U13F2 ] }; - key { [ U13A4, U13AD ] }; - key { [ U13A2, U13F1 ] }; - key { [ U13A3, U13EC ] }; - key { [ U13C1, U13EA ] }; - key { [ U13D5, U13D1 ] }; - key { [ U13B6, U13E4 ] }; - key { [ U13E9, U13EE ] }; - - key { [ U13A0, U13CC ] }; - key { [ U13CD, U13CE ] }; - key { [ U13D7, U13D0 ] }; - key { [ U13A9, U13C8 ] }; - key { [ U13A6, U13E5 ] }; - key { [ U13AF, U13B2 ] }; - key { [ U13DA, U13AB ] }; - key { [ U13B8, U13A7 ] }; - key { [ U13B5, U13AE ] }; - key { [ U13E8, U13E0 ] }; - key { [ apostrophe, quotedbl ] }; - - key { [ U13AC, U13C3 ] }; - key { [ U13F4, U13ED ] }; - key { [ U13D3, U13DF ] }; - key { [ U13A5, U13DE ] }; - key { [ U13A8, U13F0 ] }; - key { [ U13BE, U13BB ] }; - key { [ U13C5, U13B7 ] }; - key { [ comma, U13E2 ] }; - key { [ period, U13B4 ] }; - key { [ U13C2, U13C9 ] }; - - // End alphanumeric section -}; - -// Serbian charecters added as third level symbols to US keyboard layout. - -partial alphanumeric_keys -xkb_symbols "hbs" { - - name[Group1]= "USA - Serbo-Croatian"; - - include "us" - - key { [ grave, asciitilde ] }; - key { [ 6, dead_caron, asciicircum, asciicircum ] }; - key { [ l, L, U1C9, U1C8 ] }; - key { [ n, N, U1CC, U1CB ] }; - key { [ z, Z, U1C6, U1C5 ] }; - key { [ e, E, EuroSign, cent ] }; - key { [ d, D, dstroke, Dstroke ] }; - key { [ dead_acute, quotedbl, apostrophe, apostrophe ] }; - key { [ space, space, nobreakspace, nobreakspace ] }; - key { [ comma, less, NoSymbol, guillemotright ] }; - key { [ period, greater, NoSymbol, guillemotleft ] }; - - include "level3(ralt_switch)" -}; - -//based on http://upload.wikimedia.org/wikipedia/commons/1/18/T-Mobile_G1_launch_event_2.jpg -partial alphanumeric_keys -xkb_symbols "htcdream" { - include "inet(htcdream)" - name[Group1]= "USA - htcdream"; - - //second row - key { [ q, Q, Tab, Tab ] }; - key { [ w, W, grave, grave ] }; - key { [ e, E, underscore, underscore ] }; - key { [ r, R, sterling, sterling ] }; - key { [ t, T, EuroSign, EuroSign ] }; - key { [ y, Y, division, division ] }; - key { [ u, U, multiply, multiply ] }; - key { [ i, I, minus, minus ] }; - key { [ o, O, plus, plus ] }; - key { [ p, P, equal, equal ] }; - - //third row - key { [ a, A, NoSymbol, NoSymbol ] }; - key { [ s, S, bar, bar ] }; - key { [ d ,D, backslash, backslash ] }; - key { [ f, F, braceleft, braceleft ] }; - key { [ g, G, braceright, braceright ] }; - key { [ h, H, colon, colon ] }; - key { [ j, J, semicolon, semicolon ] }; - key { [ k, K, quotedbl, quotedbl ] }; - key { [ l, L, apostrophe, apostrophe ] }; - - //forth row - key { [ z, Z, NoSymbol, NoSymbol ] }; - key { [ x, X, NoSymbol, NoSymbol ] }; - key { [ c, C, NoSymbol, NoSymbol ] }; - key { [ v, V, bracketleft, bracketleft ] }; - key { [ b, B, bracketright, bracketright ] }; - key { [ n, N, less, less ] }; - key { [ m, M, greater, greater ] }; - key { [ comma, comma, question, question ] }; - - //fifth row - key { [ at, at, asciitilde, asciitilde ] }; - - include "level3(alt_switch)" -}; +default +partial alphanumeric_keys modifier_keys +xkb_symbols "basic" { + + name[Group1]= "USA"; + + // Alphanumeric section + key { [ grave, asciitilde ] }; + key { [ 1, exclam ] }; + key { [ 2, at ] }; + key { [ 3, numbersign ] }; + key { [ 4, dollar ] }; + key { [ 5, percent ] }; + key { [ 6, asciicircum ] }; + key { [ 7, ampersand ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ minus, underscore ] }; + key { [ equal, plus ] }; + + key { [ q, Q ] }; + key { [ w, W ] }; + key { [ e, E ] }; + key { [ r, R ] }; + key { [ t, T ] }; + key { [ y, Y ] }; + key { [ u, U ] }; + key { [ i, I ] }; + key { [ o, O ] }; + key { [ p, P ] }; + key { [ bracketleft, braceleft ] }; + key { [ bracketright, braceright ] }; + + key { [ a, A ] }; + key { [ s, S ] }; + key { [ d, D ] }; + key { [ f, F ] }; + key { [ g, G ] }; + key { [ h, H ] }; + key { [ j, J ] }; + key { [ k, K ] }; + key { [ l, L ] }; + key { [ semicolon, colon ] }; + key { [ apostrophe, quotedbl ] }; + + key { [ z, Z ] }; + key { [ x, X ] }; + key { [ c, C ] }; + key { [ v, V ] }; + key { [ b, B ] }; + key { [ n, N ] }; + key { [ m, M ] }; + key { [ comma, less ] }; + key { [ period, greater ] }; + key { [ slash, question ] }; + + key { [ backslash, bar ] }; + // End alphanumeric section +}; + +partial alphanumeric_keys +xkb_symbols "euro" { + + name[Group1]= "USA - With EuroSign on 5"; + + include "us(basic)" + + include "eurosign(5)" + + include "level3(ralt_switch)" +}; + + +partial alphanumeric_keys +xkb_symbols "intl" { + + name[Group1]= "USA - International (with dead keys)"; + + include "us(basic)" + + // Alphanumeric section + key { [dead_grave, dead_tilde, grave, asciitilde ] }; + key { [ 1, exclam, exclamdown, onesuperior ] }; + key { [ 2, at, twosuperior, dead_doubleacute ] }; + key { [ 3, numbersign, threesuperior, dead_macron ] }; + key { [ 4, dollar, currency, sterling ] }; + key { [ 5, percent, EuroSign, dead_cedilla ] }; + key { [ 6, dead_circumflex, onequarter, asciicircum ] }; + key { [ 7, ampersand, onehalf, dead_horn ] }; + key { [ 8, asterisk, threequarters, dead_ogonek ] }; + key { [ 9, parenleft, leftsinglequotemark, dead_breve ] }; + key { [ 0, parenright, rightsinglequotemark, dead_abovering ] }; + key { [ minus, underscore, yen, dead_belowdot ] }; + key { [ equal, plus, multiply, division ] }; + + key { [ q, Q, adiaeresis, Adiaeresis ] }; + key { [ w, W, aring, Aring ] }; + key { [ e, E, eacute, Eacute ] }; + key { [ r, R, registered, registered ] }; + key { [ t, T, thorn, THORN ] }; + key { [ y, Y, udiaeresis, Udiaeresis ] }; + key { [ u, U, uacute, Uacute ] }; + key { [ i, I, iacute, Iacute ] }; + key { [ o, O, oacute, Oacute ] }; + key { [ p, P, odiaeresis, Odiaeresis ] }; + key { [ bracketleft, braceleft, guillemotleft, leftdoublequotemark ] }; + key { [bracketright, braceright, guillemotright, rightdoublequotemark ] }; + + key { [ a, A, aacute, Aacute ] }; + key { [ s, S, ssharp, section ] }; + key { [ d, D, eth, ETH ] }; + key { [ f, F, f, F ] }; + key { [ g, G, g, G ] }; + key { [ h, H, h, H ] }; + key { [ j, J, j, J ] }; + key { [ k, K, oe, OE ] }; + + key { [ l, L, oslash, Ooblique ] }; + key { [ semicolon, colon, paragraph, degree ] }; + key { [dead_acute, dead_diaeresis, apostrophe, quotedbl ] }; + + key { [ z, Z, ae, AE ] }; + key { [ x, X, x, X ] }; + key { [ c, C, copyright, cent ] }; + key { [ v, V, v, V ] }; + key { [ b, B, b, B ] }; + key { [ n, N, ntilde, Ntilde ] }; + key { [ m, M, mu, mu ] }; + key { [ comma, less, ccedilla, Ccedilla ] }; + key { [ period, greater, dead_abovedot, dead_caron ] }; + key { [ slash, question, questiondown, dead_hook ] }; + key { [ backslash, bar, notsign, brokenbar ] }; + + include "level3(ralt_switch)" +}; + +// Based on symbols/us_intl keyboard map: +// Dead-keys definition for a very simple US/ASCII layout. +// by Conectiva (http://www.conectiva.com.br) +// modified by Ricardo Y. Igarashi (iga@that.com.br) + +// Added the following deadkeys, to make it truly international: +// +// dead_macron: on AltGr-minus +// dead_breve: on AltGr-parenleft +// dead_abovedot: on AltGr-period +// dead_abovering: on AltGr-0 +// dead_doubleacute: on AltGr-equal (as quotedbl is already used) +// dead_caron: on AltGr-less (AltGr-shift-comma) +// dead_cedilla: on AltGr-comma +// dead_ogonek: on AltGr-semicolon +// dead_belowdot: on AltGr-underscore (AltGr-shift-minus) +// dead_hook: on AltGr-question +// dead_horn: on AltGr-plus (AltGr-shift-equal) +// dead_diaeresis: on AltGr-colon (Alt-shift-semicolon) +// +// those were already there: +// dead_grave +// dead_acute +// dead_circumflex +// dead_tilde +// dead_diaeresis + +partial alphanumeric_keys +xkb_symbols "alt-intl" { + + name[Group1]= "USA - Alternative international"; + + include "us" + + key { [ dead_grave, dead_tilde, grave, asciitilde ] }; + key { [ 5, percent, EuroSign ] }; + key { [ 6, dead_circumflex, asciicircum, asciicircum ] }; + key { [ 9, parenleft, leftsinglequotemark, dead_breve ] }; + key { [ 0, parenright, rightsinglequotemark, dead_abovering ] }; + key { [ minus, underscore, dead_macron, dead_belowdot ] }; + key { [ equal, plus, dead_doubleacute, dead_horn ] }; + + key { [ e, E, EuroSign, cent ] }; + + key { [ semicolon, colon, dead_ogonek, dead_diaeresis ] }; + key { [ dead_acute, dead_diaeresis, apostrophe, quotedbl ] }; + + key { [ comma, less, dead_cedilla, dead_caron ] }; + key { [ period, greater, dead_abovedot, dead_circumflex ] }; + key { [ slash, question, dead_hook, dead_hook ] }; + + include "level3(ralt_switch)" +}; + +// based on a keyboard map from an 'xkb/symbols/dk' file + +partial alphanumeric_keys +xkb_symbols "dvorak" { + + name[Group1]= "USA - Dvorak"; + + // Alphanumeric section + + key { [ grave, asciitilde, dead_grave, dead_tilde ] }; + + key { [ 1, exclam ] }; + key { [ 2, at ] }; + key { [ 3, numbersign ] }; + key { [ 4, dollar ] }; + key { [ 5, percent ] }; + key { [ 6, asciicircum, dead_circumflex, dead_circumflex ] }; + key { [ 7, ampersand ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft, dead_grave] }; + key { [ 0, parenright ] }; + key { [ bracketleft, braceleft ] }; + key { [ bracketright, braceright, dead_tilde] }; + + key { [ apostrophe, quotedbl, dead_acute, dead_diaeresis ] }; + key { [ comma, less, dead_cedilla, dead_caron ] }; + key { [ period, greater, dead_abovedot, periodcentered ] }; + key { [ p, P ] }; + key { [ y, Y ] }; + key { [ f, F ] }; + key { [ g, G ] }; + key { [ c, C ] }; + key { [ r, R ] }; + key { [ l, L ] }; + key { [ slash, question ] }; + key { [ equal, plus ] }; + + key { [ a, A ] }; + key { [ o, O ] }; + key { [ e, E ] }; + key { [ u, U ] }; + key { [ i, I ] }; + key { [ d, D ] }; + key { [ h, H ] }; + key { [ t, T ] }; + key { [ n, N ] }; + key { [ s, S ] }; + key { [ minus, underscore ] }; + + key { [ semicolon, colon, dead_ogonek, dead_doubleacute ] }; + key { [ q, Q ] }; + key { [ j, J ] }; + key { [ k, K ] }; + key { [ x, X ] }; + key { [ b, B ] }; + key { [ m, M ] }; + key { [ w, W ] }; + key { [ v, V ] }; + key { [ z, Z ] }; + + key { [ backslash, bar ] }; +}; + +// Dvorak international with dead keys +// Olivier Mehani (shtrom-xorg@ssji.net) +// Reproduce the per-key mapping of us(intl) for the dvorak layout +// aka "I just swapped my keys over" +partial alphanumeric_keys +xkb_symbols "dvorak-intl" { + + name[Group1]= "USA - Dvorak international (with dead keys)"; + + include "us(dvorak)" + + key { [dead_grave, dead_tilde, grave, asciitilde ] }; + + key { [ 1, exclam, exclamdown, onesuperior ] }; + key { [ 2, at, twosuperior, dead_doubleacute ] }; + key { [ 3, numbersign, threesuperior, dead_macron ] }; + key { [ 4, dollar, currency, sterling ] }; + key { [ 5, percent, EuroSign, dead_cedilla ] }; + key { [ 6, dead_circumflex, onequarter, asciicircum ] }; + key { [ 7, ampersand, onehalf, dead_horn ] }; + key { [ 8, asterisk, threequarters, dead_ogonek ] }; + key { [ 9, parenleft, leftsinglequotemark, dead_breve ] }; + key { [ 0, parenright, rightsinglequotemark, dead_abovering ] }; + key { [ bracketleft, braceleft, guillemotleft, leftdoublequotemark ] }; + key { [bracketright, braceright, guillemotright, rightdoublequotemark ] }; + + key { [dead_acute, dead_diaeresis, apostrophe, quotedbl ] }; + key { [ comma, less, ccedilla, Ccedilla ] }; + key { [ period, greater, dead_abovedot, dead_caron ] }; + key { [ p, P, odiaeresis, Odiaeresis ] }; + key { [ y, Y, udiaeresis, Udiaeresis ] }; + // key { [ f, F ] }; + // key { [ g, G ] }; + key { [ c, C, copyright, cent ] }; + key { [ r, R, registered, registered ] }; + key { [ l, L, oslash, Ooblique ] }; + key { [ slash, question, questiondown, dead_hook ] }; + // key { [ equal, plus, multiply, division ] }; + + key { [ a, A, aacute, Aacute ] }; + key { [ o, O, oacute, Oacute ] }; + key { [ e, E, eacute, Eacute ] }; + key { [ u, U, uacute, Uacute ] }; + key { [ i, I, iacute, Iacute ] }; + key { [ d, D, eth, ETH ] }; + // key { [ h, H ] }; + key { [ t, T, thorn, THORN ] }; + key { [ n, N, ntilde, Ntilde ] }; + key { [ s, S, ssharp, section ] }; + // key { [ minus, underscore, yen, dead_belowdot ] }; + + key { [ semicolon, colon, paragraph, degree ] }; + key { [ q, Q, adiaeresis, Adiaeresis ] }; + // key { [ j, J ] }; + key { [ k, K, oe, OE ] }; + // key { [ x, X ] }; + // key { [ b, B ] }; + key { [ m, M, mu, mu ] }; + key { [ w, W, aring, Aring ] }; + // key { [ v, V ] }; + key { [ z, Z, ae, AE ] }; + + key { [ backslash, bar, notsign, brokenbar ] }; + + include "level3(ralt_switch)" +}; + +// Dvorak international without dead keys +// Stephane Magnenat (stephane at magnenat dot net, http://stephane.magnenat.net) +// Based on information from http://www.poupinou.org/dvorak/index.html +// +// ` 1 2 3 4 5 6 7 8 9 0 [ ] \ +// € +// +// ' , . p y f g c r l / = +// ä ê ë ü ç +// +// a o e u i d h t n s - +// à ô é û î ß +// +// ; q j k x b m w v z +// â ö è ù ï + +partial alphanumeric_keys +xkb_symbols "dvorak-alt-intl" { + + name[Group1]= "USA - Dvorak alternative international (no dead keys)"; + + include "us(dvorak)" + + key { [ 4, dollar, EuroSign ] }; + + key { [ comma, less, adiaeresis, dead_caron ] }; + key { [ period, greater, ecircumflex, periodcentered ] }; + key { [ p, P, ediaeresis, dead_cedilla ] }; + key { [ y, Y, udiaeresis ] }; + key { [ c, C, ccedilla, dead_abovedot ] }; + + key { [ a, A, agrave ] }; + key { [ o, O, ocircumflex ] }; + key { [ e, E, eacute ] }; + key { [ u, U, ucircumflex ] }; + key { [ i, I, icircumflex ] }; + key { [ s, S, ssharp ] }; + + key { [ semicolon, colon, acircumflex ] }; + key { [ q, Q, odiaeresis, dead_ogonek ] }; + key { [ j, J, egrave, dead_doubleacute ] }; + key { [ k, K, ugrave ] }; + key { [ x, X, idiaeresis ] }; + + include "level3(ralt_switch)" +}; + +// Left and right handed dvorak layouts +// by sqweek 2006-01-30 +// Based on the corresponding layouts in the console-tools package. +partial alphanumeric_keys +xkb_symbols "dvorak-l" { + + include "us(dvorak)" + name[Group1]= "USA - Left handed Dvorak"; + + key { [ bracketleft, braceleft ] }; + key { [ bracketright, braceright ] }; + key { [ slash, question ] }; + key { [ p, P ] }; + key { [ f, F ] }; + key { [ m, M ] }; + key { [ l, L ] }; + key { [ j, J ] }; + key { [ 4, dollar ] }; + key { [ 3, numbersign ] }; + key { [ 2, at ] }; + key { [ 1, exclam ] }; + + key { [ semicolon, colon ] }; + key { [ q, Q ] }; + key { [ b, B ] }; + key { [ y, Y ] }; + key { [ u, U ] }; + key { [ r, R ] }; + key { [ s, S ] }; + key { [ o, O ] }; + key { [ period, greater ] }; + key { [ 6, asciicircum ] }; + key { [ 5, percent ] }; + key { [ equal, plus ] }; + + key { [ minus, underscore ] }; + key { [ k, K ] }; + key { [ c, C ] }; + key { [ d, D ] }; + key { [ t, T ] }; + key { [ h, H ] }; + key { [ e, E ] }; + key { [ a, A ] }; + key { [ z, Z ] }; + key { [ 8, asterisk ] }; + key { [ 7, ampersand ] }; + + key { [ apostrophe, quotedbl ] }; + key { [ x, X ] }; + key { [ g, G ] }; + key { [ v, V ] }; + key { [ w, W ] }; + key { [ n, N ] }; + key { [ i, I ] }; + key { [ comma, less ] }; + key { [ 0, parenright ] }; + key { [ 9, parenleft ] }; +}; + +partial alphanumeric_keys +xkb_symbols "dvorak-r" { + + include "us(dvorak)" + name[Group1]= "USA - Right handed Dvorak"; + + key { [ 1, exclam ] }; + key { [ 2, at ] }; + key { [ 3, numbersign ] }; + key { [ 4, dollar ] }; + key { [ j, J ] }; + key { [ l, L ] }; + key { [ m, M ] }; + key { [ f, F ] }; + key { [ p, P ] }; + key { [ slash, question ] }; + key { [ bracketleft, braceleft ] }; + key { [ bracketright, braceright ] }; + + key { [ 5, percent ] }; + key { [ 6, asciicircum ] }; + key { [ q, Q ] }; + key { [ period, greater ] }; + key { [ o, O ] }; + key { [ r, R ] }; + key { [ s, S ] }; + key { [ u, U ] }; + key { [ y, Y ] }; + key { [ b, B ] }; + key { [ semicolon, colon ] }; + key { [ equal, plus ] }; + + key { [ 7, ampersand ] }; + key { [ 8, asterisk ] }; + key { [ z, Z ] }; + key { [ a, A ] }; + key { [ e, E ] }; + key { [ h, H ] }; + key { [ t, T ] }; + key { [ d, D ] }; + key { [ c, C ] }; + key { [ k, K ] }; + key { [ minus, underscore ] }; + + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ x, X ] }; + key { [ comma, less ] }; + key { [ i, I ] }; + key { [ n, N ] }; + key { [ w, W ] }; + key { [ v, V ] }; + key { [ g, G ] }; + key { [ apostrophe, quotedbl ] }; +}; + +// Classic dvorak layout +// by Piter Punk - 2006-07-06 +// Based on dvorak layout and e-mail from Russel L. Harris rlharris@oplink.net +// on xorg list. +partial alphanumeric_keys +xkb_symbols "dvorak-classic" { + + name[Group1]= "USA - Classic Dvorak"; + + // Alphanumeric section + + key { [ grave, asciitilde, dead_grave, dead_tilde ] }; + + key { [ bracketleft, braceleft ] }; + key { [ 7, ampersand ] }; + key { [ 5, percent ] }; + key { [ 3, numbersign ] }; + key { [ 1, exclam ] }; + key { [ 9, parenleft, dead_grave] }; + key { [ 0, parenright ] }; + key { [ 2, at ] }; + key { [ 4, dollar ] }; + key { [ 6, asciicircum, dead_circumflex, dead_circumflex ] }; + key { [ 8, asterisk ] }; + key { [ bracketright, braceright, dead_tilde] }; + + key { [ slash, question ] }; + key { [ comma, less, dead_cedilla, dead_caron ] }; + key { [ period, greater, dead_abovedot, periodcentered ] }; + key { [ p, P ] }; + key { [ y, Y ] }; + key { [ f, F ] }; + key { [ g, G ] }; + key { [ c, C ] }; + key { [ r, R ] }; + key { [ l, L ] }; + key { [ apostrophe, quotedbl, dead_acute, dead_diaeresis ] }; + key { [ equal, plus ] }; + + key { [ a, A ] }; + key { [ o, O ] }; + key { [ e, E ] }; + key { [ u, U ] }; + key { [ i, I ] }; + key { [ d, D ] }; + key { [ h, H ] }; + key { [ t, T ] }; + key { [ n, N ] }; + key { [ s, S ] }; + key { [ minus, underscore ] }; + + key { [ semicolon, colon, dead_ogonek, dead_doubleacute ] }; + key { [ q, Q ] }; + key { [ j, J ] }; + key { [ k, K ] }; + key { [ x, X ] }; + key { [ b, B ] }; + key { [ m, M ] }; + key { [ w, W ] }; + key { [ v, V ] }; + key { [ z, Z ] }; + key { [ backslash, bar ] }; +}; + +// Programmer Dvorak, by Roland Kaufmann +// License: BSD, available at +// Main features: Numbers are in shift position (like French), symbols have been +// placed in locations that give good hand-alternation and finger rolling with +// symbols that usually follows, accented characters are possible for I18N. +partial alphanumeric_keys +xkb_symbols "dvp" { + include "us(dvorak)" + + name[Group1] = "USA - Programmer Dvorak"; + + // Unmodified Shift AltGr Shift+AltGr + // symbols row, left side + key { [ dollar, asciitilde, dead_tilde ] }; + key { [ ampersand, percent ] }; + key { [ bracketleft, 7, currency ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ braceleft, 5, cent ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ braceright, 3, yen ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ parenleft, 1, EuroSign ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ equal, 9, sterling ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + + // symbols row, right side + key { [ asterisk, 0 ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ parenright, 2, onehalf ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ plus, 4 ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ bracketright, 6 ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ exclam, 8, exclamdown ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ numbersign, grave, dead_grave ] }; + key { [ BackSpace ] }; + + // upper row, left side + key { [ semicolon, colon, dead_diaeresis ] }; + key { [ comma, less, guillemotleft ] }; + key { [ period, greater, guillemotright ] }; + key { [ p, P, paragraph, section ] }; + key { [ y, Y, udiaeresis, Udiaeresis ] }; + + // upper row, right side + key { [ c, C, ccedilla, Ccedilla ] }; + key { [ r, R, registered, trademark ] }; + key { [ slash, question, questiondown ] }; + key { [ at, asciicircum, dead_circumflex, dead_caron ] }; + + // home row, left side + key { [ a, A, aring, Aring ] }; + key { [ o, O, oslash, Ooblique ] }; + key { [ e, E, ae, AE ] }; + key { [ u, U, eacute, Eacute ] }; + + // home row, right side + key { [ d, D, eth, ETH ] }; + key { [ h, H, dead_acute ] }; + key { [ t, T, thorn, THORN ] }; + key { [ n, N, ntilde, Ntilde ] }; + key { [ s, S, ssharp ] }; + key { [ minus, underscore, hyphen ], type[Group1] = "FOUR_LEVEL_ALPHABETIC" }; + key { [ backslash, bar ] }; + + // lower row, left side + key { [ apostrophe, quotedbl, dead_acute ] }; +}; + +// phonetic layout for Russian letters on an US keyboard +// by Ivan Popov 2005-07-17 + +// level3 modifier is a shortcut to the "us" meaning of the keys where +// we place cyrillic letters, handy for accessing the corresponding +// punctuation marks. +// It is important to have access to punctuation marks, and the rest of +// alphabetical keys are added for being consequent so that the users +// can expect the level3 modifier to give what the key label shows. + +partial alphanumeric_keys +xkb_symbols "rus" { + + name[Group1]= "USA - Russian phonetic"; + + include "us(basic)" + +key.type[group1]="FOUR_LEVEL_ALPHABETIC"; + + key { [ Cyrillic_a, Cyrillic_A ] }; + key { [ Cyrillic_be, Cyrillic_BE ] }; + key { [ Cyrillic_ve, Cyrillic_VE ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; + key { [ Cyrillic_de, Cyrillic_DE ] }; + key { [ Cyrillic_ie, Cyrillic_IE ] }; + key { [ Cyrillic_io, Cyrillic_IO, grave, asciitilde ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ Cyrillic_ze, Cyrillic_ZE ] }; + key { [ Cyrillic_i, Cyrillic_I ] }; + key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; + key { [ Cyrillic_ka, Cyrillic_KA ] }; + key { [ Cyrillic_el, Cyrillic_EL ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; + key { [ Cyrillic_en, Cyrillic_EN ] }; + key { [ Cyrillic_o, Cyrillic_O ] }; + key { [ Cyrillic_pe, Cyrillic_PE ] }; + key { [ Cyrillic_er, Cyrillic_ER ] }; + key { [ Cyrillic_es, Cyrillic_ES ] }; + key { [ Cyrillic_te, Cyrillic_TE ] }; + key { [ Cyrillic_u, Cyrillic_U ] }; + key { [ Cyrillic_ef, Cyrillic_EF ] }; + key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [ Cyrillic_tse, Cyrillic_TSE ] }; + key { [ Cyrillic_che, Cyrillic_CHE, semicolon, colon ] }; + key { [ Cyrillic_sha, Cyrillic_SHA, bracketleft, braceleft] }; + key { [ Cyrillic_shcha, Cyrillic_SHCHA, bracketright, braceright ] }; + key { [ Cyrillic_hardsign, Cyrillic_HARDSIGN, equal, plus ] }; + key { [ Cyrillic_yeru, Cyrillic_YERU ] }; + key { [ Cyrillic_softsign, Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_e, Cyrillic_E, backslash, bar ] }; + key { [ Cyrillic_yu, Cyrillic_YU, apostrophe, quotedbl ] }; + key { [ Cyrillic_ya, Cyrillic_YA ] }; + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "mac" { + + include "us(basic)" + name[Group1]= "USA - Macintosh"; + key.type[group1]="FOUR_LEVEL"; + + // Slightly improvised from http://homepage.mac.com/thgewecke/kblayout.jpg + key { [ section, plusminus, section, plusminus ] }; + key { [ grave, asciitilde, dead_grave, dead_horn ] }; + key { [ 1, exclam, exclamdown, U2044 ] }; + key { [ 2, at, trademark, EuroSign ] }; + key { [ 3, numbersign, sterling, U2039 ] }; + key { [ 4, dollar, cent, U203A ] }; + key { [ 5, percent, infinity, UFB01 ] }; + key { [ 6,asciicircum, section, UFB02 ] }; + key { [ 7, ampersand, paragraph, doubledagger ] }; + key { [ 8, asterisk, enfilledcircbullet, degree ] }; + key { [ 9, parenleft, ordfeminine, periodcentered ] }; + key { [ 0, parenright, masculine,singlelowquotemark] }; + key { [ minus, underscore, endash, emdash ] }; + key { [ equal, plus, notequal, plusminus ] }; + + key { [ q, Q, oe, OE ] }; + key { [ w, W, U2211,doublelowquotemark] }; + key { [ e, E, dead_acute, acute ] }; + key { [ r, R, registered, U2030 ] }; + key { [ t, T, dagger, dead_caron ] }; + key { [ y, Y, yen, onequarter ] }; + key { [ u, U, dead_diaeresis, diaeresis ] }; + key { [ i, I, dead_circumflex, U02C6 ] }; + key { [ o, O, oslash, Ooblique ] }; + key { [ p, P, Greek_pi, U220F ] }; + key { [ bracketleft, braceleft, leftdoublequotemark, rightdoublequotemark ] }; + key { [bracketright, braceright, leftsinglequotemark, rightsinglequotemark ] }; + key { [ backslash, bar, guillemotleft, guillemotright ] }; + + key { [ a, A, aring, Aring ] }; + key { [ s, S, ssharp, dead_stroke ] }; + key { [ d, D, partialderivative, eth ] }; + key { [ f, F, function, dead_hook ] }; + key { [ g, G, copyright, dead_doubleacute ] }; + key { [ h, H, dead_abovedot, dead_belowdot ] }; + key { [ j, J, U2206, onehalf ] }; + key { [ k, K,dead_abovering, UF8FF ] }; + + key { [ l, L, notsign, THORN ] }; + key { [ semicolon, colon, U2026, thorn ] }; + key { [apostrophe, quotedbl, ae, AE ] }; + + key { [ z, Z, Greek_OMEGA, dead_cedilla ] }; + key { [ x, X, U2248, dead_ogonek ] }; + // unclear whether "approxeq" is 2248 or 2245 + key { [ c, C, ccedilla, Ccedilla ] }; + key { [ v, V, squareroot, U25CA ] }; + key { [ b, B, integral, idotless ] }; + key { [ n, N, dead_tilde, U02DC ] }; + key { [ m, M, mu, threequarters ] }; + key { [ comma, less, lessthanequal, dead_macron ] }; + key { [ period, greater, greaterthanequal, dead_breve ] }; + key { [ slash, question, division, questiondown ] }; + + include "level3(ralt_switch)" +}; + +// Colemak symbols for xkb on X.Org Server 7.x +// 2006-01-01 Shai Coleman, http://colemak.com/ . Public domain. + +partial alphanumeric_keys +xkb_symbols "colemak" { + include "us" + name[Group1]= "USA - Colemak"; + + // Alphanumeric section + key { [ grave, asciitilde, dead_tilde, asciitilde ] }; + key { [ 1, exclam, exclamdown, onesuperior ] }; + key { [ 2, at, masculine, twosuperior ] }; + key { [ 3, numbersign, ordfeminine, threesuperior ] }; + key { [ 4, dollar, cent, sterling ] }; + key { [ 5, percent, EuroSign, yen ] }; + key { [ 6, asciicircum, hstroke, Hstroke ] }; + key { [ 7, ampersand, eth, ETH ] }; + key { [ 8, asterisk, thorn, THORN ] }; + key { [ 9, parenleft, leftsinglequotemark, leftdoublequotemark ] }; + key { [ 0, parenright, rightsinglequotemark, rightdoublequotemark ] }; + key { [ minus, underscore, endash, emdash ] }; + key { [ equal, plus, multiply, division ] }; + + key { [ q, Q, adiaeresis, Adiaeresis ] }; + key { [ w, W, aring, Aring ] }; + key { [ f, F, atilde, Atilde ] }; + key { [ p, P, oslash, Ooblique ] }; + key { [ g, G, dead_ogonek, asciitilde ] }; + key { [ j, J, dstroke, Dstroke ] }; + key { [ l, L, lstroke, Lstroke ] }; + key { [ u, U, uacute, Uacute ] }; + key { [ y, Y, udiaeresis, Udiaeresis ] }; + key { [ semicolon, colon, odiaeresis, Odiaeresis ] }; + key { [ bracketleft, braceleft, guillemotleft, 0x1002039 ] }; + key { [ bracketright, braceright, guillemotright, 0x100203a ] }; + key { [ backslash, bar, asciitilde, asciitilde ] }; + + key { [ a, A, aacute, Aacute ] }; + key { [ r, R, dead_grave, asciitilde ] }; + key { [ s, S, ssharp, asciitilde ] }; + key { [ t, T, dead_acute, dead_doubleacute ] }; + key { [ d, D, dead_diaeresis, asciitilde ] }; + key { [ h, H, dead_caron, asciitilde ] }; + key { [ n, N, ntilde, Ntilde ] }; + key { [ e, E, eacute, Eacute ] }; + key { [ i, I, iacute, Iacute ] }; + key { [ o, O, oacute, Oacute ] }; + key { [ apostrophe, quotedbl, otilde, Otilde ] }; + + key { [ z, Z, ae, AE ] }; + key { [ x, X, dead_circumflex, asciitilde ] }; + key { [ c, C, ccedilla, Ccedilla ] }; + key { [ v, V, oe, OE ] }; + key { [ b, B, dead_breve, asciitilde ] }; + key { [ k, K, dead_abovering, asciitilde ] }; + key { [ m, M, dead_macron, asciitilde ] }; + key { [ comma, less, dead_cedilla, asciitilde ] }; + key { [ period, greater, dead_abovedot, asciitilde ] }; + key { [ slash, question, questiondown, asciitilde ] }; + + key { [ BackSpace, BackSpace, BackSpace, BackSpace ] }; + key { [ minus, underscore, endash, emdash ] }; + key { [ space, space, space, nobreakspace ] }; + + include "level3(ralt_switch)" +}; + +// I do NOT like dead-keys - the International keyboard as defined by Microsoft +// doesn't fit my needs. Why use two keystrokes for all simple characters (eg ' +// and generates a single ') just to have an é (eacute) in two strokes +// as well? I type ' more often than é (eacute). +// +// This file works just like a regular keyboard, BUT has all dead-keys +// accessible at level3 (through AltGr). An ë (ediaeresis) is now: AltGr+" +// followed by an e. In other words, this keyboard is not international as long +// as you leave the right Alt key alone. +// +// The original MS International keyboard was intended for Latin1 (iso8859-1). +// With the introduction of iso8859-15, the (important) ligature oe (and OE) +// became available. I added them next to ae. Because I write ediaeresis more +// often than registered, I moved registered to be next to copyright and added +// ediaeresis and idiaeresis. - Adriaan + +partial alphanumeric_keys +xkb_symbols "altgr-intl" { + + name[Group1]= "USA - International (AltGr dead keys)"; + + include "us(intl)" + +// five dead keys moved into level3: + + key { [ grave, asciitilde, dead_grave, dead_tilde ] }; + key { [apostrophe,quotedbl, dead_acute, dead_diaeresis ] }; + +// diversions from the MS Intl keyboard: + + key { [ 1, exclam, onesuperior, exclamdown ] }; + key { [ r, R, ediaeresis, Ediaeresis ] }; + key { [ j, J, idiaeresis, Idiaeresis ] }; + key { [ x, X, oe, OE ] }; + key { [ v, V, registered, registered ] }; + +// onequarter etc (not in iso8859-15) moved to get three unshifted deadkeys: + + key { [ 6, asciicircum, dead_circumflex, onequarter ] }; + key { [ 7, ampersand, dead_horn, onehalf ] }; + key { [ 8, asterisk, dead_ogonek, threequarters ] }; + + include "level3(ralt_switch)" +}; + +// Intel ClassmatePC Keyboard Layout +// by Piter PUNK +// +// The keyboard layouts below maps the us(basic), us(intl) and us(alt-intl) +// to ClassmatePC keyboard. All layouts uses RCTL as level3(switch) since +// the keyboard doesn't have AltGr key. The EuroSign is engraved at 5 key. + +// classmate - us(basic) +partial alphanumeric_keys +xkb_symbols "classmate" { + include "us(basic)" + name[Group1]= "USA - ClassmatePC"; + + key { [ backslash, bar, backslash, bar ] }; + + include "eurosign(5)" + include "level3(switch)" +}; + +// classmate-intl - us(intl) +// RCTL is generated by Fn+Alt, because that, when trying to access +// the level3 symbols at 7,8,9,0,u,i,o,p,j,k,l,;,m,. and / we got +// the keypad keycodes. The keypad is changed to make Fn+Alt+ +// generate the same symbol as the original key. +partial alphanumeric_keys +xkb_symbols "classmate-intl" { + include "us(intl)" + name[Group1]= "USA - ClassmatePC (International)"; + key.type[Group1]="FOUR_LEVEL"; + + key { [ backslash, bar, backslash, bar ] }; + + key { [ KP_Home, KP_7, + onehalf, dead_horn ] }; + key { [ KP_Up, KP_8, + threequarters, dead_ogonek ] }; + key { [ KP_Prior, KP_9, + leftsinglequotemark, dead_breve ] }; + key { [ KP_Multiply, KP_Multiply, + rightsinglequotemark, dead_abovering ] }; + + key { [ KP_Left, KP_4, + uacute, Uacute ] }; + key { [ KP_Begin, KP_5, + iacute, Iacute ] }; + key { [ KP_Right, KP_6, + oacute, Oacute ] }; + key { [ KP_Subtract, KP_Subtract, + odiaeresis, Odiaeresis ] }; + + key { [ KP_Down, KP_2, + oe, OE ] }; + key { [ KP_Next, KP_3, + oslash, Ooblique ] }; + key { [ KP_Add, KP_Add, + paragraph, degree ] }; + + key { [ KP_Insert, KP_0, + mu, mu ] }; + key { [ KP_Delete, KP_Decimal, + dead_abovedot, dead_caron ] }; + key { [ KP_Divide, KP_Divide, + questiondown, dead_hook ] }; + + include "level3(switch)" +}; + +// classmate-alt-intl - us(alt-intl) +// RCTL is generated by Fn+Alt, because that, when trying to access +// the level3 symbols at 7,8,9,0,u,i,o,p,j,k,l,;,m,. and / we got +// the keypad keycodes. The keypad is changed to make Fn+Alt+ +// generate the same symbol as the original key. +partial alphanumeric_keys +xkb_symbols "classmate-alt-intl" { + include "us(alt-intl)" + name[Group1]= "USA - ClassmatePC (Alternative international)"; + key.type[Group1]="FOUR_LEVEL"; + + key { [ backslash, bar, backslash, bar ] }; + + key { [ KP_Subtract, KP_Subtract ] }; + + key { [ KP_Prior, KP_9, + leftsinglequotemark, dead_breve ] }; + key { [ KP_Multiply, KP_Multiply, + rightsinglequotemark, dead_abovering ] }; + + key { [ KP_Add, KP_Add, + dead_ogonek, dead_diaeresis ] }; + + key { [ KP_Delete, KP_Decimal, + dead_abovedot, dead_circumflex ] }; + key { [ KP_Divide, KP_Divide, + dead_hook, dead_hook ] }; + + include "level3(switch)" +}; + +// classmate-altgr-intl - us(altgr-intl) +// RCTL is generated by Fn+Alt, because that, when trying to access +// the level3 symbols at 7,8,9,0,u,i,o,p,j,k,l,;,m,. and / we got +// the keypad keycodes. The keypad is changed to make Fn+Alt+ +// generate the same symbol as the original key. +partial alphanumeric_keys +xkb_symbols "classmate-altgr-intl" { + include "us(altgr-intl)" + name[Group1]= "USA - ClassmatePC (International Fn+Alt dead-keys)"; + key.type[Group1]="FOUR_LEVEL"; + + key { [ backslash, bar, backslash, bar ] }; + + key { [ KP_Home, KP_7, + dead_horn, dead_horn ] }; + key { [ KP_Up, KP_8, + dead_ogonek, dead_ogonek ] }; + key { [ KP_Prior, KP_9, + leftsinglequotemark, dead_breve ] }; + key { [ KP_Multiply, KP_Multiply, + rightsinglequotemark, dead_abovering ] }; + + key { [ KP_Left, KP_4, + uacute, Uacute ] }; + key { [ KP_Begin, KP_5, + iacute, Iacute ] }; + key { [ KP_Right, KP_6, + oacute, Oacute ] }; + key { [ KP_Subtract, KP_Subtract, + odiaeresis, Odiaeresis ] }; + + key { [ KP_End, KP_1, + idiaeresis, Idiaeresis ] }; + key { [ KP_Down, KP_2, + oe, OE ] }; + key { [ KP_Next, KP_3, + oslash, Ooblique ] }; + key { [ KP_Add, KP_Add, + paragraph, degree ] }; + + key { [ KP_Insert, KP_0, + mu, mu ] }; + key { [ KP_Delete, KP_Decimal, + dead_abovedot, dead_caron ] }; + key { [ KP_Divide, KP_Divide, + questiondown, dead_hook ] }; + + include "level3(switch)" +}; + +partial alphanumeric_keys +xkb_symbols "olpc" { + + include "us(basic)" + name[Group1]= "USA"; + + // OLPC international US English keyboard layout. + // It's a little different from the usual international layout. + // See: http://wiki.laptop.org/go/Image:Keyboard_english.png + + key { [ grave, asciitilde, dead_grave, dead_tilde ] }; + key { [ 1, exclam, exclamdown, exclamdown ] }; + key { [ 2, at, notsign, notsign ] }; + key { [ 3, numbersign, 0x1000300, 0x1000300 ] }; // combining grave + key { [ 4, dollar, 0x1000301, 0x1000301 ] }; // combining acute + key { [ 5, percent, 0x1000306, 0x1000306 ] }; // combining breve above + key { [ 6,asciicircum, 0x100030A, 0x100030A ] }; // combining ring above + key { [ 7, ampersand, 0x1000302, 0x1000302 ] }; // combining circumflex above + key { [ 8, asterisk, 0x100030C, 0x100030C ] }; // combining caron above + key { [ 9, parenleft, 0x1000307, 0x1000307 ] }; // combining dot above + key { [ 0, parenright, 0x1000308, 0x1000308 ] }; // combining diaeresis above + key { [ minus, underscore, 0x1000304, 0x1000304 ] }; // combining macron above + key { [ equal, plus, 0x1000303, 0x1000303 ] }; // combining tilde above + + key { [ q, Q, Greek_omega, Greek_OMEGA ] }; + key { [ w, W, oslash, Oslash ] }; + key { [ e, E, oe, OE ] }; + key { [ r, R, 0x1000327, 0x1000327 ] }; // combining cedilla + key { [ t, T, 0x100032E, 0x100032E ] }; // combining breve below + key { [ y, Y, 0x1000325, 0x1000325 ] }; // combining ring below + key { [ u, U, 0x100032D, 0x100032D ] }; // combining circumflex below + key { [ i, I, 0x100032C, 0x100032C ] }; // combining caron below + key { [ o, O, 0x1000323, 0x1000323 ] }; // combining dot below + key { [ p, P, 0x1000324, 0x1000324 ] }; // combining diaeresis below + key { [ bracketleft, braceleft, 0x1000331, 0x1000331 ] }; // combining macron below + key { [bracketright, braceright, 0x1000330, 0x1000330 ] }; // combining tilde below + + key { [ a, A, ae, AE ] }; + key { [ s, S, ssharp, 0x1001E9C ] }; // uppercase S sharp + key { [ d, D, eth, ETH ] }; + key { [ f, F, thorn, THORN ] }; + key { [ h, H, sterling, sterling ] }; + key { [ j, J, EuroSign, EuroSign ] }; + key { [ semicolon, colon, masculine, ordfeminine ] }; + key { [ apostrophe, quotedbl, currency, currency ] }; + key { [ backslash, bar, section, section ] }; + + key { [ c, C, ccedilla, Ccedilla ] }; + key { [ n, N, ntilde, Ntilde ] }; + key { [ m, M, mu, mu ] }; + key { [ comma, less, guillemotleft, guillemotleft ] }; + key { [ period, greater, guillemotright, guillemotright ] }; + key { [ slash, question, questiondown, questiondown ] }; + + key { [ multiply, division, ISO_Next_Group, ISO_Prev_Group ] }; + + include "level3(ralt_switch)" +}; + +partial alphanumeric_keys +xkb_symbols "olpc2" { + include "us(olpc)" + name[Group1]= "USA - Layout toggle on multiply/divide key"; + include "group(olpc)" +}; + +// Based on Cherokee Nation Official Layout +// http://www.cherokee.org/extras/downloads/font/Keyboard.htm + +partial alphanumeric_keys modifier_keys +xkb_symbols "chr" { + + name[Group1]= "USA - Cherokee"; + key.type[group1]="ALPHABETIC"; + + // Alphanumeric section + key { [ grave, U13CA ] }; + key { [ 1, U13B1 ] }; + key { [ 2, U13C7 ] }; + key { [ 3, U13E7 ] }; + key { [ U13D9, U13B0 ] }; + key { [ U13E6, U13B9 ] }; + key { [ U13DC, U13DD ] }; + key { [ U13CB, U13E1 ] }; + key { [ U13D6, U13BA ] }; + key { [ U13D2, parenleft ] }; + key { [ U13C4, parenright ] }; + key { [ U13BF, U13BC ] }; + key { [ U13F3, U13BD ] }; + + key { [ U13AA, U13C6 ] }; + key { [ U13B3, U13EB ] }; + key { [ U13A1, U13E3 ] }; + key { [ U13DB, U13CF ] }; + key { [ U13D4, U13D8 ] }; + key { [ U13EF, U13F2 ] }; + key { [ U13A4, U13AD ] }; + key { [ U13A2, U13F1 ] }; + key { [ U13A3, U13EC ] }; + key { [ U13C1, U13EA ] }; + key { [ U13D5, U13D1 ] }; + key { [ U13B6, U13E4 ] }; + key { [ U13E9, U13EE ] }; + + key { [ U13A0, U13CC ] }; + key { [ U13CD, U13CE ] }; + key { [ U13D7, U13D0 ] }; + key { [ U13A9, U13C8 ] }; + key { [ U13A6, U13E5 ] }; + key { [ U13AF, U13B2 ] }; + key { [ U13DA, U13AB ] }; + key { [ U13B8, U13A7 ] }; + key { [ U13B5, U13AE ] }; + key { [ U13E8, U13E0 ] }; + key { [ apostrophe, quotedbl ] }; + + key { [ U13AC, U13C3 ] }; + key { [ U13F4, U13ED ] }; + key { [ U13D3, U13DF ] }; + key { [ U13A5, U13DE ] }; + key { [ U13A8, U13F0 ] }; + key { [ U13BE, U13BB ] }; + key { [ U13C5, U13B7 ] }; + key { [ comma, U13E2 ] }; + key { [ period, U13B4 ] }; + key { [ U13C2, U13C9 ] }; + + // End alphanumeric section +}; + +// Serbian charecters added as third level symbols to US keyboard layout. + +partial alphanumeric_keys +xkb_symbols "hbs" { + + name[Group1]= "USA - Serbo-Croatian"; + + include "us" + + key { [ grave, asciitilde ] }; + key { [ 6, dead_caron, asciicircum, asciicircum ] }; + key { [ l, L, U1C9, U1C8 ] }; + key { [ n, N, U1CC, U1CB ] }; + key { [ z, Z, U1C6, U1C5 ] }; + key { [ e, E, EuroSign, cent ] }; + key { [ d, D, dstroke, Dstroke ] }; + key { [ dead_acute, quotedbl, apostrophe, apostrophe ] }; + key { [ space, space, nobreakspace, nobreakspace ] }; + key { [ comma, less, NoSymbol, guillemotright ] }; + key { [ period, greater, NoSymbol, guillemotleft ] }; + + include "level3(ralt_switch)" +}; + +//based on http://upload.wikimedia.org/wikipedia/commons/1/18/T-Mobile_G1_launch_event_2.jpg +partial alphanumeric_keys +xkb_symbols "htcdream" { + include "inet(htcdream)" + name[Group1]= "USA - htcdream"; + + //second row + key { [ q, Q, Tab, Tab ] }; + key { [ w, W, grave, grave ] }; + key { [ e, E, underscore, underscore ] }; + key { [ r, R, sterling, sterling ] }; + key { [ t, T, EuroSign, EuroSign ] }; + key { [ y, Y, division, division ] }; + key { [ u, U, multiply, multiply ] }; + key { [ i, I, minus, minus ] }; + key { [ o, O, plus, plus ] }; + key { [ p, P, equal, equal ] }; + + //third row + key { [ a, A, NoSymbol, NoSymbol ] }; + key { [ s, S, bar, bar ] }; + key { [ d ,D, backslash, backslash ] }; + key { [ f, F, braceleft, braceleft ] }; + key { [ g, G, braceright, braceright ] }; + key { [ h, H, colon, colon ] }; + key { [ j, J, semicolon, semicolon ] }; + key { [ k, K, quotedbl, quotedbl ] }; + key { [ l, L, apostrophe, apostrophe ] }; + + //forth row + key { [ z, Z, NoSymbol, NoSymbol ] }; + key { [ x, X, NoSymbol, NoSymbol ] }; + key { [ c, C, NoSymbol, NoSymbol ] }; + key { [ v, V, bracketleft, bracketleft ] }; + key { [ b, B, bracketright, bracketright ] }; + key { [ n, N, less, less ] }; + key { [ m, M, greater, greater ] }; + key { [ comma, comma, question, question ] }; + + //fifth row + key { [ at, at, asciitilde, asciitilde ] }; + + include "level3(alt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/uz b/xorg-server/xkeyboard-config/symbols/uz index b37a6ca3f..a6c67e8d1 100644 --- a/xorg-server/xkeyboard-config/symbols/uz +++ b/xorg-server/xkeyboard-config/symbols/uz @@ -1,122 +1,120 @@ -// $XKeyboardConfig$ -// Uzbek standard keyboard -// -// Mashrab Kuvatov -// -// History: -// -// Jun 2, 2003. Mashrab Kuvatov -// -// Created based on Russian standard keyboard. AEN -// The following symbols of Russian standard keyboard were replaced: -// minus (key ) with Byelorussian_shortu (U045e), -// equal (key ) with Cyrillic_ka_descender (U049b) -// Cyrillic_ha (key ) with Cyrillic_ghe_bar (U0493) -// Cyrillic_hardsign (key ) with Cyrillic_ha_descender (U04b3) -// The following symbols of Russian standard keyboard were moved: -// Cyrillic_ze to key (english 's'), -// Cyrillic_sha to key (english 'i'), -// Cyrillic_ha to key (english 'o'), -// Cyrillic_hardsign to key (english 'p'). -// -// Feb 25, 2007. Mashrab Kuvatov -// -// Made cyrillic and latin variants. Default is cyrillic. -// Cyrillic variant is standard compliant. The standard -// was accepted by the official body of Uzbekistan. See -// http://www.uznet.net/index.php?option=com_content&task=view&id=288&Itemid=58 -// -// Latin variant is somewhat experimental, since there is no -// official standard for it. It is a copy of "us" layout, where -// apostrophe is replaced with U02BB. -// -// $XFree86: xc/programs/xkbcomp/symbols/uz,v 1.2 2003/06/21 13:01:59 pascal Exp $ - -partial default alphanumeric_keys -xkb_symbols "cyrillic" { - - name[Group1]= "Uzbekistan"; - - key { [ 1, exclam ] }; - key { [ 2, quotedbl ] }; - key { [ 3, numerosign ] }; - key { [ 4, semicolon ] }; - key { [ 5, percent ] }; - key { [ 6, colon ] }; - key { [ 7, question ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ backslash, bar ] }; - key { [ period, comma ] }; - key { [ slash, bar ] }; - -key.type[group1]="ALPHABETIC"; - - key { [Cyrillic_ghe_bar, Cyrillic_GHE_bar ] }; - key { [Cyrillic_ha_descender, Cyrillic_HA_descender ] }; - key { [ Cyrillic_io, Cyrillic_IO ] }; - key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; - key { [ Cyrillic_tse, Cyrillic_TSE ] }; - key { [ Cyrillic_u, Cyrillic_U ] }; - key { [ Cyrillic_ka, Cyrillic_KA ] }; - key { [ Cyrillic_ie, Cyrillic_IE ] }; - key { [ Cyrillic_en, Cyrillic_EN ] }; - key { [ Cyrillic_ghe, Cyrillic_GHE ] }; - key { [ Cyrillic_sha, Cyrillic_SHA ] }; - key { [ Byelorussian_shortu, Byelorussian_SHORTU ] }; - key { [ Cyrillic_ze, Cyrillic_ZE ] }; - key { [ Cyrillic_ha, Cyrillic_HA ] }; - key { [Cyrillic_hardsign,Cyrillic_HARDSIGN ] }; - key { [ Cyrillic_ef, Cyrillic_EF ] }; - key { [Cyrillic_ka_descender, Cyrillic_KA_descender ] }; - key { [ Cyrillic_ve, Cyrillic_VE ] }; - key { [ Cyrillic_a, Cyrillic_A ] }; - key { [ Cyrillic_pe, Cyrillic_PE ] }; - key { [ Cyrillic_er, Cyrillic_ER ] }; - key { [ Cyrillic_o, Cyrillic_O ] }; - key { [ Cyrillic_el, Cyrillic_EL ] }; - key { [ Cyrillic_de, Cyrillic_DE ] }; - key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; - key { [ Cyrillic_e, Cyrillic_E ] }; - key { [ Cyrillic_ya, Cyrillic_YA ] }; - key { [ Cyrillic_che, Cyrillic_CHE ] }; - key { [ Cyrillic_es, Cyrillic_ES ] }; - key { [ Cyrillic_em, Cyrillic_EM ] }; - key { [ Cyrillic_te, Cyrillic_TE ] }; - key { [ Cyrillic_i, Cyrillic_I ] }; - key { [Cyrillic_softsign,Cyrillic_SOFTSIGN ] }; - key { [ Cyrillic_be, Cyrillic_BE ] }; - key { [ Cyrillic_yu, Cyrillic_YU ] }; - - // End alphanumeric section -}; - -partial alphanumeric_keys -xkb_symbols "latin" { - include "us" - name[Group1]= "Uzbekistan - Latin"; - key { [0x010002BB, quotedbl] }; -}; - -// Crimean Tatar (Crimean Turkish) layouts. -partial -xkb_symbols "crh" { - include "tr(crh)" - - name[Group1]="Uzbekistan - Crimean Tatar (Turkish Q)"; -}; - -partial -xkb_symbols "crh_f" { - include "tr(crh_f)" - - name[Group1]="Uzbekistan - Crimean Tatar (Turkish F)"; -}; - -partial -xkb_symbols "crh_alt" { - include "tr(crh_alt)" - - name[Group1]="Uzbekistan - Crimean Tatar (Turkish Alt-Q)"; -}; +// Uzbek standard keyboard +// +// Mashrab Kuvatov +// +// History: +// +// Jun 2, 2003. Mashrab Kuvatov +// +// Created based on Russian standard keyboard. AEN +// The following symbols of Russian standard keyboard were replaced: +// minus (key ) with Byelorussian_shortu (U045e), +// equal (key ) with Cyrillic_ka_descender (U049b) +// Cyrillic_ha (key ) with Cyrillic_ghe_bar (U0493) +// Cyrillic_hardsign (key ) with Cyrillic_ha_descender (U04b3) +// The following symbols of Russian standard keyboard were moved: +// Cyrillic_ze to key (english 's'), +// Cyrillic_sha to key (english 'i'), +// Cyrillic_ha to key (english 'o'), +// Cyrillic_hardsign to key (english 'p'). +// +// Feb 25, 2007. Mashrab Kuvatov +// +// Made cyrillic and latin variants. Default is cyrillic. +// Cyrillic variant is standard compliant. The standard +// was accepted by the official body of Uzbekistan. See +// http://www.uznet.net/index.php?option=com_content&task=view&id=288&Itemid=58 +// +// Latin variant is somewhat experimental, since there is no +// official standard for it. It is a copy of "us" layout, where +// apostrophe is replaced with U02BB. +// + +partial default alphanumeric_keys +xkb_symbols "cyrillic" { + + name[Group1]= "Uzbekistan"; + + key { [ 1, exclam ] }; + key { [ 2, quotedbl ] }; + key { [ 3, numerosign ] }; + key { [ 4, semicolon ] }; + key { [ 5, percent ] }; + key { [ 6, colon ] }; + key { [ 7, question ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ backslash, bar ] }; + key { [ period, comma ] }; + key { [ slash, bar ] }; + +key.type[group1]="ALPHABETIC"; + + key { [Cyrillic_ghe_bar, Cyrillic_GHE_bar ] }; + key { [Cyrillic_ha_descender, Cyrillic_HA_descender ] }; + key { [ Cyrillic_io, Cyrillic_IO ] }; + key { [ Cyrillic_shorti, Cyrillic_SHORTI ] }; + key { [ Cyrillic_tse, Cyrillic_TSE ] }; + key { [ Cyrillic_u, Cyrillic_U ] }; + key { [ Cyrillic_ka, Cyrillic_KA ] }; + key { [ Cyrillic_ie, Cyrillic_IE ] }; + key { [ Cyrillic_en, Cyrillic_EN ] }; + key { [ Cyrillic_ghe, Cyrillic_GHE ] }; + key { [ Cyrillic_sha, Cyrillic_SHA ] }; + key { [ Byelorussian_shortu, Byelorussian_SHORTU ] }; + key { [ Cyrillic_ze, Cyrillic_ZE ] }; + key { [ Cyrillic_ha, Cyrillic_HA ] }; + key { [Cyrillic_hardsign,Cyrillic_HARDSIGN ] }; + key { [ Cyrillic_ef, Cyrillic_EF ] }; + key { [Cyrillic_ka_descender, Cyrillic_KA_descender ] }; + key { [ Cyrillic_ve, Cyrillic_VE ] }; + key { [ Cyrillic_a, Cyrillic_A ] }; + key { [ Cyrillic_pe, Cyrillic_PE ] }; + key { [ Cyrillic_er, Cyrillic_ER ] }; + key { [ Cyrillic_o, Cyrillic_O ] }; + key { [ Cyrillic_el, Cyrillic_EL ] }; + key { [ Cyrillic_de, Cyrillic_DE ] }; + key { [ Cyrillic_zhe, Cyrillic_ZHE ] }; + key { [ Cyrillic_e, Cyrillic_E ] }; + key { [ Cyrillic_ya, Cyrillic_YA ] }; + key { [ Cyrillic_che, Cyrillic_CHE ] }; + key { [ Cyrillic_es, Cyrillic_ES ] }; + key { [ Cyrillic_em, Cyrillic_EM ] }; + key { [ Cyrillic_te, Cyrillic_TE ] }; + key { [ Cyrillic_i, Cyrillic_I ] }; + key { [Cyrillic_softsign,Cyrillic_SOFTSIGN ] }; + key { [ Cyrillic_be, Cyrillic_BE ] }; + key { [ Cyrillic_yu, Cyrillic_YU ] }; + + // End alphanumeric section +}; + +partial alphanumeric_keys +xkb_symbols "latin" { + include "us" + name[Group1]= "Uzbekistan - Latin"; + key { [0x010002BB, quotedbl] }; +}; + +// Crimean Tatar (Crimean Turkish) layouts. +partial +xkb_symbols "crh" { + include "tr(crh)" + + name[Group1]="Uzbekistan - Crimean Tatar (Turkish Q)"; +}; + +partial +xkb_symbols "crh_f" { + include "tr(crh_f)" + + name[Group1]="Uzbekistan - Crimean Tatar (Turkish F)"; +}; + +partial +xkb_symbols "crh_alt" { + include "tr(crh_alt)" + + name[Group1]="Uzbekistan - Crimean Tatar (Turkish Alt-Q)"; +}; diff --git a/xorg-server/xkeyboard-config/symbols/vn b/xorg-server/xkeyboard-config/symbols/vn index acebae572..4aed75eb8 100644 --- a/xorg-server/xkeyboard-config/symbols/vn +++ b/xorg-server/xkeyboard-config/symbols/vn @@ -1,41 +1,39 @@ -// $XKeyboardConfig$ - -// based on: -// vn, TCVN 5712:1993 -// Le Hong Boi -// August 1999 -// Further modified by Ashley Clark -// July 2000 for X 4.0 -// Fix accents into combining marks by Samuel Thibault -// July 2009 - - -partial default alphanumeric_keys -xkb_symbols "basic" { - - include "us" - - name[Group1]= "Vietnam"; - - // Alphanumeric section - key { [ quoteleft, asciitilde ] }; - key { [ abreve, Abreve ] }; - key { [ acircumflex, Acircumflex ] }; - key { [ ecircumflex, Ecircumflex ] }; - key { [ ocircumflex, Ocircumflex ] }; - key { [ 0x1000300, percent, dead_grave, percent ] }; - key { [ 0x1000309, asciicircum, dead_hook, asciicircum ] }; - key { [ 0x1000303, ampersand, dead_tilde, ampersand ] }; - key { [ 0x1000301, asterisk, dead_acute, asterisk ] }; - key { [ 0x1000323, parenleft, dead_belowdot, parenleft ] }; - key { [ dstroke, Dstroke ] }; - key { [ minus, underscore ] }; - key { [ DongSign, plus ] }; - - key { [ uhorn, Uhorn ] }; - key { [ ohorn, Ohorn ] }; - - // End alphanumeric section - - include "level3(ralt_switch)" -}; +// based on: +// vn, TCVN 5712:1993 +// Le Hong Boi +// August 1999 +// Further modified by Ashley Clark +// July 2000 for X 4.0 +// Fix accents into combining marks by Samuel Thibault +// July 2009 + + +partial default alphanumeric_keys +xkb_symbols "basic" { + + include "us" + + name[Group1]= "Vietnam"; + + // Alphanumeric section + key { [ quoteleft, asciitilde ] }; + key { [ abreve, Abreve ] }; + key { [ acircumflex, Acircumflex ] }; + key { [ ecircumflex, Ecircumflex ] }; + key { [ ocircumflex, Ocircumflex ] }; + key { [ 0x1000300, percent, dead_grave, percent ] }; + key { [ 0x1000309, asciicircum, dead_hook, asciicircum ] }; + key { [ 0x1000303, ampersand, dead_tilde, ampersand ] }; + key { [ 0x1000301, asterisk, dead_acute, asterisk ] }; + key { [ 0x1000323, parenleft, dead_belowdot, parenleft ] }; + key { [ dstroke, Dstroke ] }; + key { [ minus, underscore ] }; + key { [ DongSign, plus ] }; + + key { [ uhorn, Uhorn ] }; + key { [ ohorn, Ohorn ] }; + + // End alphanumeric section + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/symbols/xfree68_vndr/amiga b/xorg-server/xkeyboard-config/symbols/xfree68_vndr/amiga index dcc143bb0..48ea37ca4 100644 --- a/xorg-server/xkeyboard-config/symbols/xfree68_vndr/amiga +++ b/xorg-server/xkeyboard-config/symbols/xfree68_vndr/amiga @@ -1,132 +1,126 @@ -// $Xorg: amiga,v 1.3 2000/08/17 19:54:46 cpqbld Exp $ - - - -// $XFree86: xc/programs/xkbcomp/symbols/xfree68/amiga,v 1.2 2000/06/23 00:44:37 dawes Exp $ - -default xkb_symbols "usa1" { - - name[Group1]= "usa1"; - key { [ Escape ] }; - - // Begin "Function" section - key { [ F1 ] }; - key { [ F2 ] }; - key { [ F3 ] }; - key { [ F4 ] }; - key { [ F5 ] }; - key { [ F6 ] }; - key { [ F7 ] }; - key { [ F8 ] }; - key { [ F9 ] }; - key { [ F10 ] }; - // End "Function" section - - // Alphanumeric section - key { [ quoteleft, asciitilde ] }; - key { [ 1, exclam ] }; - key { [ 2, at ] }; - key { [ 3, numbersign ] }; - key { [ 4, dollar ] }; - key { [ 5, percent ] }; - key { [ 6, asciicircum ] }; - key { [ 7, ampersand ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ minus, underscore ] }; - key { [ equal, plus ] }; - key { [ backslash, bar ] }; - key { [ BackSpace ] }; - - key { [ Tab, ISO_Left_Tab ] }; - key { [ q, Q ] }; - key { [ w, W ] }; - key { [ e, E ] }; - key { [ r, R ] }; - key { [ t, T ] }; - key { [ y, Y ] }; - key { [ u, U ] }; - key { [ i, I ] }; - key { [ o, O ] }; - key { [ p, P ] }; - key { [ bracketleft, braceleft ] }; - key { [ bracketright, braceright ] }; - key { [ Return ] }; - - key { [ Control_L ] }; - key { [ Caps_Lock ] }; - key { [ a, A ] }; - key { [ s, S ] }; - key { [ d, D ] }; - key { [ f, F ] }; - key { [ g, G ] }; - key { [ h, H ] }; - key { [ j, J ] }; - key { [ k, K ] }; - key { [ l, L ] }; - key { [ semicolon, colon ] }; - key { [ quoteright, quotedbl ] }; - - key { [ Shift_L ] }; - key { [ z, Z ] }; - key { [ x, X ] }; - key { [ c, C ] }; - key { [ v, V ] }; - key { [ b, B ] }; - key { [ n, N ] }; - key { [ m, M ] }; - key { [ comma, less ] }; - key { [ period, greater ] }; - key { [ slash, question ] }; - key { [ Shift_R ] }; - - key { [ Alt_L, Meta_L ] }; - key { [ Mode_switch ] }; - key { [ space ] }; - key { [ Multi_key ] }; - key { [ Alt_R, Meta_R ] }; - // End alphanumeric section - - // Begin "Editing" section - key { [ Delete ] }; - key { [ Help ] }; - key { [ Up ] }; - key { [ Left ] }; - key { [ Down ] }; - key { [ Right ] }; - // End "Editing" section - - // Begin "Keypad" section - key { [ Num_Lock ] }; - key { [ Scroll_Lock ] }; - key { [ KP_Divide ] }; - key { [ KP_Multiply, Print ] }; - - key { [ KP_7, KP_Home ] }; - key { [ KP_8, KP_Up ] }; - key { [ KP_9, KP_Prior ] }; - key { [ KP_Subtract ] }; - - key { [ KP_4, KP_Left ] }; - key { [ KP_5 ] }; - key { [ KP_6, KP_Right ] }; - key { [ KP_Add ] }; - - key { [ KP_1, KP_End ] }; - key { [ KP_2, KP_Down ] }; - key { [ KP_3, KP_Next ] }; - - key { [ KP_0, KP_Insert ] }; - key { [ KP_Decimal, KP_Delete ] }; - key { [ KP_Enter ] }; - // End "Keypad" section - - // begin modifier mappings - modifier_map Shift { Shift_L, Shift_R }; - modifier_map Lock { Caps_Lock }; - modifier_map Control{ Control_L }; - modifier_map Mod1 { Alt_L, Alt_R }; - modifier_map Mod2 { Mode_switch }; - modifier_map Mod3 { Meta_L, Meta_R }; -}; +default xkb_symbols "usa1" { + + name[Group1]= "usa1"; + key { [ Escape ] }; + + // Begin "Function" section + key { [ F1 ] }; + key { [ F2 ] }; + key { [ F3 ] }; + key { [ F4 ] }; + key { [ F5 ] }; + key { [ F6 ] }; + key { [ F7 ] }; + key { [ F8 ] }; + key { [ F9 ] }; + key { [ F10 ] }; + // End "Function" section + + // Alphanumeric section + key { [ quoteleft, asciitilde ] }; + key { [ 1, exclam ] }; + key { [ 2, at ] }; + key { [ 3, numbersign ] }; + key { [ 4, dollar ] }; + key { [ 5, percent ] }; + key { [ 6, asciicircum ] }; + key { [ 7, ampersand ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ minus, underscore ] }; + key { [ equal, plus ] }; + key { [ backslash, bar ] }; + key { [ BackSpace ] }; + + key { [ Tab, ISO_Left_Tab ] }; + key { [ q, Q ] }; + key { [ w, W ] }; + key { [ e, E ] }; + key { [ r, R ] }; + key { [ t, T ] }; + key { [ y, Y ] }; + key { [ u, U ] }; + key { [ i, I ] }; + key { [ o, O ] }; + key { [ p, P ] }; + key { [ bracketleft, braceleft ] }; + key { [ bracketright, braceright ] }; + key { [ Return ] }; + + key { [ Control_L ] }; + key { [ Caps_Lock ] }; + key { [ a, A ] }; + key { [ s, S ] }; + key { [ d, D ] }; + key { [ f, F ] }; + key { [ g, G ] }; + key { [ h, H ] }; + key { [ j, J ] }; + key { [ k, K ] }; + key { [ l, L ] }; + key { [ semicolon, colon ] }; + key { [ quoteright, quotedbl ] }; + + key { [ Shift_L ] }; + key { [ z, Z ] }; + key { [ x, X ] }; + key { [ c, C ] }; + key { [ v, V ] }; + key { [ b, B ] }; + key { [ n, N ] }; + key { [ m, M ] }; + key { [ comma, less ] }; + key { [ period, greater ] }; + key { [ slash, question ] }; + key { [ Shift_R ] }; + + key { [ Alt_L, Meta_L ] }; + key { [ Mode_switch ] }; + key { [ space ] }; + key { [ Multi_key ] }; + key { [ Alt_R, Meta_R ] }; + // End alphanumeric section + + // Begin "Editing" section + key { [ Delete ] }; + key { [ Help ] }; + key { [ Up ] }; + key { [ Left ] }; + key { [ Down ] }; + key { [ Right ] }; + // End "Editing" section + + // Begin "Keypad" section + key { [ Num_Lock ] }; + key { [ Scroll_Lock ] }; + key { [ KP_Divide ] }; + key { [ KP_Multiply, Print ] }; + + key { [ KP_7, KP_Home ] }; + key { [ KP_8, KP_Up ] }; + key { [ KP_9, KP_Prior ] }; + key { [ KP_Subtract ] }; + + key { [ KP_4, KP_Left ] }; + key { [ KP_5 ] }; + key { [ KP_6, KP_Right ] }; + key { [ KP_Add ] }; + + key { [ KP_1, KP_End ] }; + key { [ KP_2, KP_Down ] }; + key { [ KP_3, KP_Next ] }; + + key { [ KP_0, KP_Insert ] }; + key { [ KP_Decimal, KP_Delete ] }; + key { [ KP_Enter ] }; + // End "Keypad" section + + // begin modifier mappings + modifier_map Shift { Shift_L, Shift_R }; + modifier_map Lock { Caps_Lock }; + modifier_map Control{ Control_L }; + modifier_map Mod1 { Alt_L, Alt_R }; + modifier_map Mod2 { Mode_switch }; + modifier_map Mod3 { Meta_L, Meta_R }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/xfree68_vndr/ataritt b/xorg-server/xkeyboard-config/symbols/xfree68_vndr/ataritt index c06431fb8..8c6277fb1 100644 --- a/xorg-server/xkeyboard-config/symbols/xfree68_vndr/ataritt +++ b/xorg-server/xkeyboard-config/symbols/xfree68_vndr/ataritt @@ -1,161 +1,155 @@ -// $Xorg: ataritt,v 1.3 2000/08/17 19:54:46 cpqbld Exp $ - - - -// $XFree86: xc/programs/xkbcomp/symbols/xfree68/ataritt,v 1.2 2000/06/23 00:44:37 dawes Exp $ - -default xkb_symbols "us" { - - name[Group1]= "US/ASCII"; - key { [ Escape ] }; - - // Alphanumeric section - key { [ 1, exclam ] }; - key { [ 2, at ] }; - key { [ 3, numbersign ] }; - key { [ 4, dollar ] }; - key { [ 5, percent ] }; - key { [ 6, asciicircum ] }; - key { [ 7, ampersand ] }; - key { [ 8, asterisk ] }; - key { [ 9, parenleft ] }; - key { [ 0, parenright ] }; - key { [ minus, underscore ] }; - key { [ equal, plus ] }; - key { [ quoteleft, asciitilde ] }; - key { [ BackSpace ] }; - - key { [ Tab, ISO_Left_Tab ] }; - key { [ q, Q ] }; - key { [ w, W ] }; - key { [ e, E ] }; - key { [ r, R ] }; - key { [ t, T ] }; - key { [ y, Y ] }; - key { [ u, U ] }; - key { [ i, I ] }; - key { [ o, O ] }; - key { [ p, P ] }; - key { [ bracketleft, braceleft ] }; - key { [ bracketright, braceright ] }; - key { [ Return ] }; - key { [ Delete ] }; - - key { [ Control_L ] }; - key { [ a, A ] }; - key { [ s, S ] }; - key { [ d, D ] }; - key { [ f, F ] }; - key { [ g, G ] }; - key { [ h, H ] }; - key { [ j, J ] }; - key { [ k, K ] }; - key { [ l, L ] }; - key { [ semicolon, colon ] }; - key { [ quoteright, quotedbl ] }; - key { [ backslash, bar ] }; - - key { [ Shift_L ] }; - key { [ z, Z ] }; - key { [ x, X ] }; - key { [ c, C ] }; - key { [ v, V ] }; - key { [ b, B ] }; - key { [ n, N ] }; - key { [ m, M ] }; - key { [ comma, less ] }; - key { [ period, greater ] }; - key { [ slash, question ] }; - key { [ Shift_R ] }; - - key { [ Meta_L ] }; - key { [ space ] }; - key { [ Caps_Lock ] }; - // End alphanumeric section - - // Begin "Function" section - key { [ F1 ] }; - key { [ F2 ] }; - key { [ F3 ] }; - key { [ F4 ] }; - key { [ F5 ] }; - key { [ F6 ] }; - key { [ F7 ] }; - key { [ F8 ] }; - key { [ F9 ] }; - key { [ F10 ] }; - // End "Function" section - - // Begin "Editing" section - key { [ Help ] }; - key { [ Undo ] }; - key { [ Insert ] }; - key { [ Up ] }; - key { [ Home, Clear ] }; - key { [ Left ] }; - key { [ Down ] }; - key { [ Right ] }; - // End "Editing" section - - // Begin "Keypad" section - key { [ KP_F1 ] }; - key { [ KP_F2 ] }; - key { [ KP_Divide ] }; - key { [ KP_Multiply ] }; - key { [ KP_7 ] }; - key { [ KP_8 ] }; - key { [ KP_9 ] }; - key { [ KP_Subtract ] }; - key { [ KP_4 ] }; - key { [ KP_5 ] }; - key { [ KP_6 ] }; - key { [ KP_Add ] }; - key { [ KP_1 ] }; - key { [ KP_2 ] }; - key { [ KP_3 ] }; - key { [ KP_0 ] }; - key { [ KP_Decimal ] }; - key { [ KP_Enter ] }; - // End "Keypad" section - - // begin modifier mappings - modifier_map Shift { Shift_L, Shift_R }; - modifier_map Lock { Caps_Lock }; - modifier_map Control{ Control_L }; - modifier_map Mod1 { Meta_L }; -}; - -xkb_symbols "de" { - include "ataritt(us)" - - name[Group1]= "German"; - - // Alphanumeric section - key { [ 2, quotedbl ] }; - key { [ 3, section ] }; - key { [ 6, ampersand ] }; - key { [ 7, slash ] }; - key { [ 8, parenleft ] }; - key { [ 9, parenright ] }; - key { [ 0, equal ] }; - key { [ ssharp, question ] }; - key { [ quoteright, quoteleft ] }; - key { [ numbersign, asciicircum ] }; - - key { [ z, Z ] }; - key { [ udiaeresis, Udiaeresis ], - [ at, backslash ] }; - key { [ plus, asterisk ] }; - - key { [ odiaeresis, Odiaeresis ], - [ bracketleft, braceleft ] }; - key { [ adiaeresis, Adiaeresis ], - [ bracketright, braceright ] }; - key { [ asciitilde, bar ] }; - - key { [ less, greater ] }; - key { [ y, Y ] }; - key { [ comma, semicolon ] }; - key { [ period, colon ] }; - key { [ minus, underscore ] }; -}; +default xkb_symbols "us" { + + name[Group1]= "US/ASCII"; + key { [ Escape ] }; + + // Alphanumeric section + key { [ 1, exclam ] }; + key { [ 2, at ] }; + key { [ 3, numbersign ] }; + key { [ 4, dollar ] }; + key { [ 5, percent ] }; + key { [ 6, asciicircum ] }; + key { [ 7, ampersand ] }; + key { [ 8, asterisk ] }; + key { [ 9, parenleft ] }; + key { [ 0, parenright ] }; + key { [ minus, underscore ] }; + key { [ equal, plus ] }; + key { [ quoteleft, asciitilde ] }; + key { [ BackSpace ] }; + + key { [ Tab, ISO_Left_Tab ] }; + key { [ q, Q ] }; + key { [ w, W ] }; + key { [ e, E ] }; + key { [ r, R ] }; + key { [ t, T ] }; + key { [ y, Y ] }; + key { [ u, U ] }; + key { [ i, I ] }; + key { [ o, O ] }; + key { [ p, P ] }; + key { [ bracketleft, braceleft ] }; + key { [ bracketright, braceright ] }; + key { [ Return ] }; + key { [ Delete ] }; + + key { [ Control_L ] }; + key { [ a, A ] }; + key { [ s, S ] }; + key { [ d, D ] }; + key { [ f, F ] }; + key { [ g, G ] }; + key { [ h, H ] }; + key { [ j, J ] }; + key { [ k, K ] }; + key { [ l, L ] }; + key { [ semicolon, colon ] }; + key { [ quoteright, quotedbl ] }; + key { [ backslash, bar ] }; + + key { [ Shift_L ] }; + key { [ z, Z ] }; + key { [ x, X ] }; + key { [ c, C ] }; + key { [ v, V ] }; + key { [ b, B ] }; + key { [ n, N ] }; + key { [ m, M ] }; + key { [ comma, less ] }; + key { [ period, greater ] }; + key { [ slash, question ] }; + key { [ Shift_R ] }; + + key { [ Meta_L ] }; + key { [ space ] }; + key { [ Caps_Lock ] }; + // End alphanumeric section + + // Begin "Function" section + key { [ F1 ] }; + key { [ F2 ] }; + key { [ F3 ] }; + key { [ F4 ] }; + key { [ F5 ] }; + key { [ F6 ] }; + key { [ F7 ] }; + key { [ F8 ] }; + key { [ F9 ] }; + key { [ F10 ] }; + // End "Function" section + + // Begin "Editing" section + key { [ Help ] }; + key { [ Undo ] }; + key { [ Insert ] }; + key { [ Up ] }; + key { [ Home, Clear ] }; + key { [ Left ] }; + key { [ Down ] }; + key { [ Right ] }; + // End "Editing" section + + // Begin "Keypad" section + key { [ KP_F1 ] }; + key { [ KP_F2 ] }; + key { [ KP_Divide ] }; + key { [ KP_Multiply ] }; + key { [ KP_7 ] }; + key { [ KP_8 ] }; + key { [ KP_9 ] }; + key { [ KP_Subtract ] }; + key { [ KP_4 ] }; + key { [ KP_5 ] }; + key { [ KP_6 ] }; + key { [ KP_Add ] }; + key { [ KP_1 ] }; + key { [ KP_2 ] }; + key { [ KP_3 ] }; + key { [ KP_0 ] }; + key { [ KP_Decimal ] }; + key { [ KP_Enter ] }; + // End "Keypad" section + + // begin modifier mappings + modifier_map Shift { Shift_L, Shift_R }; + modifier_map Lock { Caps_Lock }; + modifier_map Control{ Control_L }; + modifier_map Mod1 { Meta_L }; +}; + +xkb_symbols "de" { + include "ataritt(us)" + + name[Group1]= "German"; + + // Alphanumeric section + key { [ 2, quotedbl ] }; + key { [ 3, section ] }; + key { [ 6, ampersand ] }; + key { [ 7, slash ] }; + key { [ 8, parenleft ] }; + key { [ 9, parenright ] }; + key { [ 0, equal ] }; + key { [ ssharp, question ] }; + key { [ quoteright, quoteleft ] }; + key { [ numbersign, asciicircum ] }; + + key { [ z, Z ] }; + key { [ udiaeresis, Udiaeresis ], + [ at, backslash ] }; + key { [ plus, asterisk ] }; + + key { [ odiaeresis, Odiaeresis ], + [ bracketleft, braceleft ] }; + key { [ adiaeresis, Adiaeresis ], + [ bracketright, braceright ] }; + key { [ asciitilde, bar ] }; + + key { [ less, greater ] }; + key { [ y, Y ] }; + key { [ comma, semicolon ] }; + key { [ period, colon ] }; + key { [ minus, underscore ] }; +}; diff --git a/xorg-server/xkeyboard-config/symbols/za b/xorg-server/xkeyboard-config/symbols/za index 0d53b1c1a..8c277c7be 100644 --- a/xorg-server/xkeyboard-config/symbols/za +++ b/xorg-server/xkeyboard-config/symbols/za @@ -1,44 +1,42 @@ -// $XKeyboardConfig$ -// -// based on the Latvian and GB keyboard maps - -partial default alphanumeric_keys modifier_keys -xkb_symbols "basic" { - - // Describes the differences between an en_US - // keyboard and a South African layout with - // dead keys. By Dwayne Bailey (dwayne@translate.org.za) - - include "latin" - - name[Group1]="South Africa"; - - key { [ grave, asciitilde, dead_grave ] }; - key { [ 2, at, yen ] }; - key { [ 3, numbersign, sterling ] }; - key { [ 4, dollar, dollar ] }; - key { [ 5, percent, EuroSign ] }; - key { [ 6, asciicircum, dead_circumflex ] }; - - key { [ e, E, ediaeresis, Ediaeresis ] }; - key { [ r, R, ecircumflex, Ecircumflex ] }; - key { [ t, T, U1e71, U1e70 ] }; - key { [ y, Y, ucircumflex, Ucircumflex ] }; - key { [ u, U, udiaeresis, Udiaeresis ] }; - key { [ i, I, idiaeresis, Idiaeresis ] }; - key { [ o, O, odiaeresis, Odiaeresis ] }; - key { [ p, P, ocircumflex, Ocircumflex ] }; - - key { [ a, A, adiaeresis, Adiaeresis ] }; - key { [ s, S, scaron, Scaron ] }; - key { [ d, D, U1e13, U1e12 ] }; - key { [ l, L, U1e3d, U1e3c ] }; - key { [ semicolon, colon, dead_diaeresis ] }; - key { [apostrophe, quotedbl, dead_acute ] }; - - key { [ n, N, U1e4b, U1e4a ] }; - key { [ m, M, U1e45, U1e44 ] }; - key { [ period, greater, dead_abovedot ] }; - - include "level3(ralt_switch)" -}; +// based on the Latvian and GB keyboard maps + +partial default alphanumeric_keys modifier_keys +xkb_symbols "basic" { + + // Describes the differences between an en_US + // keyboard and a South African layout with + // dead keys. By Dwayne Bailey (dwayne@translate.org.za) + + include "latin" + + name[Group1]="South Africa"; + + key { [ grave, asciitilde, dead_grave ] }; + key { [ 2, at, yen ] }; + key { [ 3, numbersign, sterling ] }; + key { [ 4, dollar, dollar ] }; + key { [ 5, percent, EuroSign ] }; + key { [ 6, asciicircum, dead_circumflex ] }; + + key { [ e, E, ediaeresis, Ediaeresis ] }; + key { [ r, R, ecircumflex, Ecircumflex ] }; + key { [ t, T, U1e71, U1e70 ] }; + key { [ y, Y, ucircumflex, Ucircumflex ] }; + key { [ u, U, udiaeresis, Udiaeresis ] }; + key { [ i, I, idiaeresis, Idiaeresis ] }; + key { [ o, O, odiaeresis, Odiaeresis ] }; + key { [ p, P, ocircumflex, Ocircumflex ] }; + + key { [ a, A, adiaeresis, Adiaeresis ] }; + key { [ s, S, scaron, Scaron ] }; + key { [ d, D, U1e13, U1e12 ] }; + key { [ l, L, U1e3d, U1e3c ] }; + key { [ semicolon, colon, dead_diaeresis ] }; + key { [apostrophe, quotedbl, dead_acute ] }; + + key { [ n, N, U1e4b, U1e4a ] }; + key { [ m, M, U1e45, U1e44 ] }; + key { [ period, greater, dead_abovedot ] }; + + include "level3(ralt_switch)" +}; diff --git a/xorg-server/xkeyboard-config/types/basic b/xorg-server/xkeyboard-config/types/basic index cf1ee648b..70292ea38 100644 --- a/xorg-server/xkeyboard-config/types/basic +++ b/xorg-server/xkeyboard-config/types/basic @@ -1,31 +1,29 @@ -// $Xorg: basic,v 1.3 2000/08/17 19:54:48 cpqbld Exp $ - -default xkb_types "basic" { - - // Fairly standard definitions for - // the four required key types - - virtual_modifiers NumLock; - - type "ONE_LEVEL" { - modifiers = None; - map[None] = Level1; - level_name[Level1]= "Any"; - }; - - type "TWO_LEVEL" { - modifiers = Shift; - map[Shift] = Level2; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - }; - - type "ALPHABETIC" { - modifiers = Shift+Lock; - map[Shift] = Level2; - map[Lock] = Level2; - level_name[Level1] = "Base"; - level_name[Level2] = "Caps"; - }; - -}; +default xkb_types "basic" { + + // Fairly standard definitions for + // the four required key types + + virtual_modifiers NumLock; + + type "ONE_LEVEL" { + modifiers = None; + map[None] = Level1; + level_name[Level1]= "Any"; + }; + + type "TWO_LEVEL" { + modifiers = Shift; + map[Shift] = Level2; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + }; + + type "ALPHABETIC" { + modifiers = Shift+Lock; + map[Shift] = Level2; + map[Lock] = Level2; + level_name[Level1] = "Base"; + level_name[Level2] = "Caps"; + }; + +}; diff --git a/xorg-server/xkeyboard-config/types/cancel b/xorg-server/xkeyboard-config/types/cancel index 478c99c4b..ec5d7191d 100644 --- a/xorg-server/xkeyboard-config/types/cancel +++ b/xorg-server/xkeyboard-config/types/cancel @@ -1,12 +1,11 @@ -// $Xorg: cancel,v 1.3 2000/08/17 19:54:48 cpqbld Exp $ -partial default xkb_types "Shift_Cancels_Caps" { - -override type "TWO_LEVEL" { - modifiers = Shift+Lock; - map[Shift] = Level2; - preserve[Lock]= Lock; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; -}; - -}; +partial default xkb_types "Shift_Cancels_Caps" { + +override type "TWO_LEVEL" { + modifiers = Shift+Lock; + map[Shift] = Level2; + preserve[Lock]= Lock; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; +}; + +}; diff --git a/xorg-server/xkeyboard-config/types/caps b/xorg-server/xkeyboard-config/types/caps index 7936df12f..08a7211b9 100644 --- a/xorg-server/xkeyboard-config/types/caps +++ b/xorg-server/xkeyboard-config/types/caps @@ -1,170 +1,168 @@ -// $XFree86: xc/programs/xkbcomp/types/caps,v 1.3 2002/11/26 02:14:02 dawes Exp $ - -// CapsLock uses internal capitalization rules -// Shift "pauses" CapsLock -partial xkb_types "internal" { - type "ALPHABETIC" { - modifiers = Shift+Lock; - map[Shift] = Level2; - preserve[Lock] = Lock; - level_name[Level1] = "Base"; - level_name[Level2] = "Caps"; - }; - - type "FOUR_LEVEL_ALPHABETIC" { - modifiers = Shift+Lock+LevelThree; - map[None] = Level1; - map[Shift] = Level2; - preserve[Lock] = Lock; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - map[Lock+LevelThree] = Level3; - map[Lock+Shift+LevelThree] = Level3; - preserve[Lock+LevelThree] = Lock; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; - }; - - type "FOUR_LEVEL_SEMIALPHABETIC" { - modifiers = Shift+Lock+LevelThree; - map[None] = Level1; - map[Shift] = Level2; - preserve[Lock] = Lock; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - map[Lock+LevelThree] = Level3; - map[Lock+Shift+LevelThree] = Level4; - preserve[Lock+LevelThree] = Lock; - preserve[Lock+Shift+LevelThree] = Lock; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; - }; -}; -// CapsLock uses internal capitalization rules -// Shift doesn't cancel CapsLock -partial xkb_types "internal_nocancel" { - type "ALPHABETIC" { - modifiers = Shift; - map[Shift] = Level2; - level_name[Level1] = "Base"; - level_name[Level2] = "Caps"; - }; - - type "FOUR_LEVEL_ALPHABETIC" { - modifiers = Shift+LevelThree; - map[None] = Level1; - map[Shift] = Level2; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; - }; - - type "FOUR_LEVEL_SEMIALPHABETIC" { - // the same as FOUR_LEVEL_ALPHABETIC - modifiers = Shift+LevelThree; - map[None] = Level1; - map[Shift] = Level2; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; - }; -}; -// CapsLock acts as Shift with locking -// Shift "pauses" CapsLock -partial xkb_types "shift" { - type "ALPHABETIC" { - modifiers = Shift+Lock; - map[Shift] = Level2; - map[Lock] = Level2; - level_name[Level1] = "Base"; - level_name[Level2] = "Caps"; - }; - - type "FOUR_LEVEL_ALPHABETIC" { - modifiers = Shift+Lock+LevelThree; - map[None] = Level1; - map[Shift] = Level2; - map[Lock] = Level2; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - map[Lock+LevelThree] = Level4; - map[Shift+Lock+LevelThree] = Level3; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; - }; - - type "FOUR_LEVEL_SEMIALPHABETIC" { - modifiers = Shift+Lock+LevelThree; - map[None] = Level1; - map[Shift] = Level2; - map[Lock] = Level2; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - map[Lock+LevelThree] = Level3; - map[Lock+Shift+LevelThree] = Level4; - preserve[Lock+LevelThree] = Lock; - preserve[Lock+Shift+LevelThree] = Lock; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; - }; -}; -// CapsLock acts as Shift with locking -// Shift doesn't cancel CapsLock -partial xkb_types "shift_nocancel" { - type "ALPHABETIC" { - modifiers = Shift+Lock; - map[Shift] = Level2; - map[Lock] = Level2; - map[Shift+Lock] = Level2; - level_name[Level1] = "Base"; - level_name[Level2] = "Caps"; - }; - - type "FOUR_LEVEL_ALPHABETIC" { - modifiers = Shift+Lock+LevelThree; - map[None] = Level1; - map[Shift] = Level2; - map[Lock] = Level2; - map[Shift+Lock] = Level2; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - map[Lock+LevelThree] = Level4; - map[Shift+Lock+LevelThree] = Level4; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; - }; - - type "FOUR_LEVEL_SEMIALPHABETIC" { - modifiers = Shift+Lock+LevelThree; - map[None] = Level1; - map[Shift] = Level2; - map[Lock] = Level2; - map[Shift+Lock] = Level2; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - map[Lock+LevelThree] = Level3; - map[Lock+Shift+LevelThree] = Level4; - preserve[Lock+LevelThree] = Lock; - preserve[Lock+Shift+LevelThree] = Lock; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; - }; -}; +// CapsLock uses internal capitalization rules +// Shift "pauses" CapsLock +partial xkb_types "internal" { + type "ALPHABETIC" { + modifiers = Shift+Lock; + map[Shift] = Level2; + preserve[Lock] = Lock; + level_name[Level1] = "Base"; + level_name[Level2] = "Caps"; + }; + + type "FOUR_LEVEL_ALPHABETIC" { + modifiers = Shift+Lock+LevelThree; + map[None] = Level1; + map[Shift] = Level2; + preserve[Lock] = Lock; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + map[Lock+LevelThree] = Level3; + map[Lock+Shift+LevelThree] = Level3; + preserve[Lock+LevelThree] = Lock; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; + }; + + type "FOUR_LEVEL_SEMIALPHABETIC" { + modifiers = Shift+Lock+LevelThree; + map[None] = Level1; + map[Shift] = Level2; + preserve[Lock] = Lock; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + map[Lock+LevelThree] = Level3; + map[Lock+Shift+LevelThree] = Level4; + preserve[Lock+LevelThree] = Lock; + preserve[Lock+Shift+LevelThree] = Lock; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; + }; +}; +// CapsLock uses internal capitalization rules +// Shift doesn't cancel CapsLock +partial xkb_types "internal_nocancel" { + type "ALPHABETIC" { + modifiers = Shift; + map[Shift] = Level2; + level_name[Level1] = "Base"; + level_name[Level2] = "Caps"; + }; + + type "FOUR_LEVEL_ALPHABETIC" { + modifiers = Shift+LevelThree; + map[None] = Level1; + map[Shift] = Level2; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; + }; + + type "FOUR_LEVEL_SEMIALPHABETIC" { + // the same as FOUR_LEVEL_ALPHABETIC + modifiers = Shift+LevelThree; + map[None] = Level1; + map[Shift] = Level2; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; + }; +}; +// CapsLock acts as Shift with locking +// Shift "pauses" CapsLock +partial xkb_types "shift" { + type "ALPHABETIC" { + modifiers = Shift+Lock; + map[Shift] = Level2; + map[Lock] = Level2; + level_name[Level1] = "Base"; + level_name[Level2] = "Caps"; + }; + + type "FOUR_LEVEL_ALPHABETIC" { + modifiers = Shift+Lock+LevelThree; + map[None] = Level1; + map[Shift] = Level2; + map[Lock] = Level2; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + map[Lock+LevelThree] = Level4; + map[Shift+Lock+LevelThree] = Level3; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; + }; + + type "FOUR_LEVEL_SEMIALPHABETIC" { + modifiers = Shift+Lock+LevelThree; + map[None] = Level1; + map[Shift] = Level2; + map[Lock] = Level2; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + map[Lock+LevelThree] = Level3; + map[Lock+Shift+LevelThree] = Level4; + preserve[Lock+LevelThree] = Lock; + preserve[Lock+Shift+LevelThree] = Lock; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; + }; +}; +// CapsLock acts as Shift with locking +// Shift doesn't cancel CapsLock +partial xkb_types "shift_nocancel" { + type "ALPHABETIC" { + modifiers = Shift+Lock; + map[Shift] = Level2; + map[Lock] = Level2; + map[Shift+Lock] = Level2; + level_name[Level1] = "Base"; + level_name[Level2] = "Caps"; + }; + + type "FOUR_LEVEL_ALPHABETIC" { + modifiers = Shift+Lock+LevelThree; + map[None] = Level1; + map[Shift] = Level2; + map[Lock] = Level2; + map[Shift+Lock] = Level2; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + map[Lock+LevelThree] = Level4; + map[Shift+Lock+LevelThree] = Level4; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; + }; + + type "FOUR_LEVEL_SEMIALPHABETIC" { + modifiers = Shift+Lock+LevelThree; + map[None] = Level1; + map[Shift] = Level2; + map[Lock] = Level2; + map[Shift+Lock] = Level2; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + map[Lock+LevelThree] = Level3; + map[Lock+Shift+LevelThree] = Level4; + preserve[Lock+LevelThree] = Lock; + preserve[Lock+Shift+LevelThree] = Lock; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; + }; +}; diff --git a/xorg-server/xkeyboard-config/types/complete b/xorg-server/xkeyboard-config/types/complete index 96d4fd572..2ac68082e 100644 --- a/xorg-server/xkeyboard-config/types/complete +++ b/xorg-server/xkeyboard-config/types/complete @@ -1,17 +1,9 @@ -// $XKeyboardConfig$ -// $Xorg: complete,v 1.3 2000/08/17 19:54:48 cpqbld Exp $ -// -// -// -// -// $XFree86: xc/programs/xkbcomp/types/complete,v 1.2 2001/05/18 23:35:35 dawes Exp $ - -default xkb_types "complete" { - include "basic" - include "mousekeys" - include "pc" - include "iso9995" - include "level5" - include "extra" - include "numpad" -}; +default xkb_types "complete" { + include "basic" + include "mousekeys" + include "pc" + include "iso9995" + include "level5" + include "extra" + include "numpad" +}; diff --git a/xorg-server/xkeyboard-config/types/default b/xorg-server/xkeyboard-config/types/default index 18859b742..45e1ad18c 100644 --- a/xorg-server/xkeyboard-config/types/default +++ b/xorg-server/xkeyboard-config/types/default @@ -1,12 +1,9 @@ -// $XKeyboardConfig$ -// $Xorg: default,v 1.3 2000/08/17 19:54:48 cpqbld Exp $ - -default xkb_types "default" { - include "basic" - include "pc" - include "iso9995" - include "extra" - include "numpad" - include "level5" - include "mousekeys" -}; +default xkb_types "default" { + include "basic" + include "pc" + include "iso9995" + include "extra" + include "numpad" + include "level5" + include "mousekeys" +}; diff --git a/xorg-server/xkeyboard-config/types/extra b/xorg-server/xkeyboard-config/types/extra index a82fd10d2..06b1fec78 100644 --- a/xorg-server/xkeyboard-config/types/extra +++ b/xorg-server/xkeyboard-config/types/extra @@ -1,185 +1,183 @@ -// $XFree86: xc/programs/xkbcomp/types/extra,v 1.3 2002/11/26 02:14:02 dawes Exp $ - -partial default xkb_types "default" { - // Definition for a key type used for the czech keymap, for instance. - // Defines style a with four level shift. It is similar to three_level - // type used for iso9995 but it lets the shift key behave "normally". - - virtual_modifiers LevelThree; - - type "FOUR_LEVEL" { - modifiers = Shift+LevelThree; - map[None] = Level1; - map[Shift] = Level2; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; - }; - - type "FOUR_LEVEL_ALPHABETIC" { - modifiers = Shift+Lock+LevelThree; - map[None] = Level1; - map[Shift] = Level2; - map[Lock] = Level2; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - map[Lock+LevelThree] = Level4; - map[Lock+Shift+LevelThree] = Level3; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; - }; - - type "FOUR_LEVEL_SEMIALPHABETIC" { - modifiers = Shift+Lock+LevelThree; - map[None] = Level1; - map[Shift] = Level2; - map[Lock] = Level2; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - map[Lock+LevelThree] = Level3; - map[Lock+Shift+LevelThree] = Level4; - preserve[Lock+LevelThree] = Lock; - preserve[Lock+Shift+LevelThree] = Lock; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; - }; - - // Another four level keypad variant - // First two levels are controled by NumLock (with active Shift-ing like - // in KEYPAD). LevelThree overrides this mode, with two additional - // Shift-ed levels - // NumLock state is intentionnaly ignored when LevelThree is active - type "FOUR_LEVEL_MIXED_KEYPAD" { - modifiers = Shift+NumLock+LevelThree; - map[None] = Level1; - map[Shift+NumLock] = Level1; - map[NumLock] = Level2; - map[Shift] = Level2; - map[LevelThree] = Level3; - map[NumLock+LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - map[Shift+NumLock+LevelThree] = Level4; - level_name[Level1] = "Base"; - level_name[Level2] = "Number"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; - }; - - // Base level, two Shift-ed LevelThree levels, one Ctrl+Alt command level - type "FOUR_LEVEL_X" { - modifiers = Shift+LevelThree+Control+Alt; - map[None] = Level1; - map[LevelThree] = Level2; - map[Shift+LevelThree] = Level3; - map[Control+Alt] = Level4; - level_name[Level1] = "Base"; - level_name[Level2] = "Alt Base"; - level_name[Level3] = "Shift Alt"; - level_name[Level4] = "Ctrl+Alt"; - }; - -// Special type for keys used in Serbian Latin Unicode map -// It makes it possible to use all three forms of latin letters -// present in Unicode that are made up of two separate letters -// (forms like LJ, Lj, and lj; NJ, Nj, and nj; etc) - - type "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC" { - modifiers = Shift+Lock+LevelThree; - map[None] = Level1; - map[Shift] = Level2; - map[Lock] = Level4; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - map[Lock+LevelThree] = Level3; - map[Lock+Shift+LevelThree] = Level3; - preserve[Lock]= Lock; - preserve[Lock+LevelThree]= Lock; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "AltGr Base"; - level_name[Level4] = "Shift AltGr"; - }; - -// type for e.g. german ssharp which is capitalized SS. -// CHARACTERISTICS: -// It is FOUR_LEVEL with the exception that the fifth level -// is mapped to the Lock modifier. -// If other modifiers are used, the Lock state is ignored. -// DETAILS ABOUT GERMAN: -// The capital form of ssharp (called sharp s) only exists for -// completely capitalized Text, not at the beginning of sentences -// or nouns (nouns have a captial letter at the beginning in german). -// The ssharp key, to the right of the zero key, takes this into -// account and has a questionmark mapped on shift-ssharp since -// normally no capital version is needed. -// When typing with active capsLock, this key type is needed to -// output two capital letters S because this is the only german key -// whose capital letter is not the same as the one typed with shift. - - type "FOUR_LEVEL_PLUS_LOCK" { - modifiers = Shift+Lock+LevelThree; - map[None] = Level1; - map[Shift] = Level2; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - map[Lock] = Level5; - map[Lock+Shift] = Level2; - map[Lock+LevelThree] = Level3; - map[Lock+Shift+LevelThree] = Level4; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; - level_name[Level5] = "Lock"; - }; -}; - -// This enables the four level shifting also for the keypad. -partial xkb_types "keypad" { - virtual_modifiers LevelThree; - - type "FOUR_LEVEL_KEYPAD" { - modifiers = Shift+NumLock+LevelThree; - map[None] = Level1; - map[Shift] = Level2; - map[NumLock] = Level2; - map[Shift+NumLock] = Level1; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - map[NumLock+LevelThree] = Level4; - map[Shift+NumLock+LevelThree] = Level3; - level_name[Level1] = "Base"; - level_name[Level2] = "Number"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Alt Number"; - }; -}; - -// This enables the four level shifting also for the keypad, -// but levels 1 and 2, and 3 and 4 are swapped on Mac keypads. -partial xkb_types "mac_keypad" { - virtual_modifiers LevelThree; - - type "FOUR_LEVEL_KEYPAD" { - modifiers = Shift+NumLock+LevelThree; - map[None] = Level2; - map[Shift] = Level1; - map[NumLock] = Level1; - map[Shift+NumLock] = Level2; - map[LevelThree] = Level4; - map[Shift+LevelThree] = Level3; - map[NumLock+LevelThree] = Level3; - map[Shift+NumLock+LevelThree] = Level4; - level_name[Level2] = "Base"; - level_name[Level1] = "Number"; - level_name[Level4] = "Alt Base"; - level_name[Level3] = "Alt Number"; - }; -}; +partial default xkb_types "default" { + // Definition for a key type used for the czech keymap, for instance. + // Defines style a with four level shift. It is similar to three_level + // type used for iso9995 but it lets the shift key behave "normally". + + virtual_modifiers LevelThree; + + type "FOUR_LEVEL" { + modifiers = Shift+LevelThree; + map[None] = Level1; + map[Shift] = Level2; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; + }; + + type "FOUR_LEVEL_ALPHABETIC" { + modifiers = Shift+Lock+LevelThree; + map[None] = Level1; + map[Shift] = Level2; + map[Lock] = Level2; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + map[Lock+LevelThree] = Level4; + map[Lock+Shift+LevelThree] = Level3; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; + }; + + type "FOUR_LEVEL_SEMIALPHABETIC" { + modifiers = Shift+Lock+LevelThree; + map[None] = Level1; + map[Shift] = Level2; + map[Lock] = Level2; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + map[Lock+LevelThree] = Level3; + map[Lock+Shift+LevelThree] = Level4; + preserve[Lock+LevelThree] = Lock; + preserve[Lock+Shift+LevelThree] = Lock; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; + }; + + // Another four level keypad variant + // First two levels are controled by NumLock (with active Shift-ing like + // in KEYPAD). LevelThree overrides this mode, with two additional + // Shift-ed levels + // NumLock state is intentionnaly ignored when LevelThree is active + type "FOUR_LEVEL_MIXED_KEYPAD" { + modifiers = Shift+NumLock+LevelThree; + map[None] = Level1; + map[Shift+NumLock] = Level1; + map[NumLock] = Level2; + map[Shift] = Level2; + map[LevelThree] = Level3; + map[NumLock+LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + map[Shift+NumLock+LevelThree] = Level4; + level_name[Level1] = "Base"; + level_name[Level2] = "Number"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; + }; + + // Base level, two Shift-ed LevelThree levels, one Ctrl+Alt command level + type "FOUR_LEVEL_X" { + modifiers = Shift+LevelThree+Control+Alt; + map[None] = Level1; + map[LevelThree] = Level2; + map[Shift+LevelThree] = Level3; + map[Control+Alt] = Level4; + level_name[Level1] = "Base"; + level_name[Level2] = "Alt Base"; + level_name[Level3] = "Shift Alt"; + level_name[Level4] = "Ctrl+Alt"; + }; + +// Special type for keys used in Serbian Latin Unicode map +// It makes it possible to use all three forms of latin letters +// present in Unicode that are made up of two separate letters +// (forms like LJ, Lj, and lj; NJ, Nj, and nj; etc) + + type "SEPARATE_CAPS_AND_SHIFT_ALPHABETIC" { + modifiers = Shift+Lock+LevelThree; + map[None] = Level1; + map[Shift] = Level2; + map[Lock] = Level4; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + map[Lock+LevelThree] = Level3; + map[Lock+Shift+LevelThree] = Level3; + preserve[Lock]= Lock; + preserve[Lock+LevelThree]= Lock; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "AltGr Base"; + level_name[Level4] = "Shift AltGr"; + }; + +// type for e.g. german ssharp which is capitalized SS. +// CHARACTERISTICS: +// It is FOUR_LEVEL with the exception that the fifth level +// is mapped to the Lock modifier. +// If other modifiers are used, the Lock state is ignored. +// DETAILS ABOUT GERMAN: +// The capital form of ssharp (called sharp s) only exists for +// completely capitalized Text, not at the beginning of sentences +// or nouns (nouns have a captial letter at the beginning in german). +// The ssharp key, to the right of the zero key, takes this into +// account and has a questionmark mapped on shift-ssharp since +// normally no capital version is needed. +// When typing with active capsLock, this key type is needed to +// output two capital letters S because this is the only german key +// whose capital letter is not the same as the one typed with shift. + + type "FOUR_LEVEL_PLUS_LOCK" { + modifiers = Shift+Lock+LevelThree; + map[None] = Level1; + map[Shift] = Level2; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + map[Lock] = Level5; + map[Lock+Shift] = Level2; + map[Lock+LevelThree] = Level3; + map[Lock+Shift+LevelThree] = Level4; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; + level_name[Level5] = "Lock"; + }; +}; + +// This enables the four level shifting also for the keypad. +partial xkb_types "keypad" { + virtual_modifiers LevelThree; + + type "FOUR_LEVEL_KEYPAD" { + modifiers = Shift+NumLock+LevelThree; + map[None] = Level1; + map[Shift] = Level2; + map[NumLock] = Level2; + map[Shift+NumLock] = Level1; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + map[NumLock+LevelThree] = Level4; + map[Shift+NumLock+LevelThree] = Level3; + level_name[Level1] = "Base"; + level_name[Level2] = "Number"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Alt Number"; + }; +}; + +// This enables the four level shifting also for the keypad, +// but levels 1 and 2, and 3 and 4 are swapped on Mac keypads. +partial xkb_types "mac_keypad" { + virtual_modifiers LevelThree; + + type "FOUR_LEVEL_KEYPAD" { + modifiers = Shift+NumLock+LevelThree; + map[None] = Level2; + map[Shift] = Level1; + map[NumLock] = Level1; + map[Shift+NumLock] = Level2; + map[LevelThree] = Level4; + map[Shift+LevelThree] = Level3; + map[NumLock+LevelThree] = Level3; + map[Shift+NumLock+LevelThree] = Level4; + level_name[Level2] = "Base"; + level_name[Level1] = "Number"; + level_name[Level4] = "Alt Base"; + level_name[Level3] = "Alt Number"; + }; +}; diff --git a/xorg-server/xkeyboard-config/types/iso9995 b/xorg-server/xkeyboard-config/types/iso9995 index 80f3ee5cf..893a6b341 100644 --- a/xorg-server/xkeyboard-config/types/iso9995 +++ b/xorg-server/xkeyboard-config/types/iso9995 @@ -1,20 +1,18 @@ -// $Xorg: iso9995,v 1.3 2000/08/17 19:54:48 cpqbld Exp $ -partial default xkb_types "default" { - - // Definition for a key type which - // can be used to implement ISO9995 - // style level three shift - virtual_modifiers LevelThree; - - type "THREE_LEVEL" { - modifiers = Shift+LevelThree; - map[None] = Level1; - map[Shift] = Level2; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level3; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "Level3"; - }; -}; - +partial default xkb_types "default" { + + // Definition for a key type which + // can be used to implement ISO9995 + // style level three shift + virtual_modifiers LevelThree; + + type "THREE_LEVEL" { + modifiers = Shift+LevelThree; + map[None] = Level1; + map[Shift] = Level2; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level3; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Level3"; + }; +}; diff --git a/xorg-server/xkeyboard-config/types/level5 b/xorg-server/xkeyboard-config/types/level5 index 05dafecf6..671f4b3e8 100644 --- a/xorg-server/xkeyboard-config/types/level5 +++ b/xorg-server/xkeyboard-config/types/level5 @@ -1,217 +1,213 @@ -// $XKeyboardConfig$ -// $XFree86: xc/programs/xkbcomp/types/extra,v 1.3 2002/11/26 02:14:02 dawes Exp $ - -partial default xkb_types "default" { - // Definition for a key type used for the czech keymap, for instance. - // Defines style a with four level shift. It is similar to three_level - // type used for iso9995 but it lets the shift key behave "normally". - - virtual_modifiers LevelThree,ScrollLock,LevelFive; - - type "EIGHT_LEVEL" { - modifiers = Shift+LevelThree+LevelFive; - map[None] = Level1; - map[Shift] = Level2; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - map[LevelFive] = Level5; - map[Shift+LevelFive] = Level6; - map[LevelThree+LevelFive] = Level7; - map[Shift+LevelThree+LevelFive] = Level8; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; - level_name[Level5] = "X"; - level_name[Level6] = "X Shift"; - level_name[Level7] = "X Alt Base"; - level_name[Level8] = "X Shift Alt"; - }; - - type "EIGHT_LEVEL_ALPHABETIC" { - modifiers = Shift+Lock+LevelThree+LevelFive; - map[None] = Level1; - map[Shift] = Level2; - map[Lock] = Level2; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - map[Lock+LevelThree] = Level4; - map[Lock+Shift+LevelThree] = Level3; - - map[LevelFive] = Level5; - map[Shift+LevelFive] = Level6; - map[Lock+LevelFive] = Level6; - map[LevelThree+LevelFive] = Level7; - map[Shift+LevelThree+LevelFive] = Level8; - map[Lock+LevelThree+LevelFive] = Level8; - map[Lock+Shift+LevelThree+LevelFive] = Level7; - - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; - level_name[Level5] = "X"; - level_name[Level6] = "X Shift"; - level_name[Level7] = "X Alt Base"; - level_name[Level8] = "X Shift Alt"; - }; - -// type "EIGHT_LEVEL_LEVEL_FIVE_LOCK" { -// // Level5-Lock is implemented by using NumLock, because a real modifier -// // is required. -// -// modifiers = Shift + Lock + LevelThree + NumLock + LevelFive; -// -// map[None] = Level1; -// map[Shift] = Level2; -// map[LevelThree] = Level3; -// map[LevelThree+Shift] = Level4; -// -// map[LevelFive] = Level5; -// map[LevelFive+Shift] = Level6; -// map[LevelFive+LevelThree] = Level7; -// map[LevelFive+LevelThree+Shift] = Level8; -// -// map[NumLock] = Level5; -// map[NumLock+Shift] = Level6; -// map[NumLock+LevelThree] = Level7; -// map[NumLock+LevelThree+Shift] = Level8; -// -// map[NumLock+LevelFive] = Level1; -// map[NumLock+LevelFive+Shift] = Level2; -// map[NumLock+LevelFive+LevelThree] = Level3; -// map[NumLock+LevelFive+LevelThree+Shift] = Level4; -// -// // Lock has no effect -// map[Lock] = Level1; -// map[Lock+Shift] = Level2; -// map[Lock+LevelThree] = Level3; -// map[Lock+LevelThree+Shift] = Level4; -// -// map[Lock+LevelFive] = Level5; -// map[Lock+LevelFive+Shift] = Level6; -// map[Lock+LevelFive+LevelThree] = Level7; -// map[Lock+LevelFive+LevelThree+Shift] = Level8; -// -// map[Lock+NumLock] = Level5; -// map[Lock+NumLock+Shift] = Level6; -// map[Lock+NumLock+LevelThree] = Level7; -// map[Lock+NumLock+LevelThree+Shift] = Level8; -// -// map[Lock+NumLock+LevelFive] = Level1; -// map[Lock+NumLock+LevelFive+Shift] = Level2; -// map[Lock+NumLock+LevelFive+LevelThree] = Level3; -// map[Lock+NumLock+LevelFive+LevelThree+Shift] = Level4; -// -// preserve[LevelFive+Shift] = Shift; -// preserve[NumLock+Shift] = Shift; -// preserve[Lock+LevelFive+Shift] = Shift; -// preserve[Lock+NumLock+Shift] = Shift; -// -// level_name[Level1] = "Base"; -// level_name[Level2] = "Shift"; -// level_name[Level3] = "Alt Base"; -// level_name[Level4] = "Shift Alt"; -// level_name[Level5] = "X"; -// level_name[Level6] = "X Shift"; -// level_name[Level7] = "X Alt Base"; -// level_name[Level8] = "X Shift Alt"; -// }; -// -// type "EIGHT_LEVEL_ALPHABETIC_LEVEL_FIVE_LOCK" { -// // Level5-Lock is implemented by using NumLock, because a real modifier -// // is required. -// -// modifiers = Shift + Lock + LevelThree + NumLock + LevelFive; -// -// map[None] = Level1; -// map[Shift] = Level2; -// map[LevelThree] = Level3; -// map[LevelThree+Shift] = Level4; -// -// map[LevelFive] = Level5; -// map[LevelFive+Shift] = Level6; -// map[LevelFive+LevelThree] = Level7; -// map[LevelFive+LevelThree+Shift] = Level8; -// -// map[NumLock] = Level5; -// map[NumLock+Shift] = Level6; -// map[NumLock+LevelThree] = Level7; -// map[NumLock+LevelThree+Shift] = Level8; -// -// map[NumLock+LevelFive] = Level1; -// map[NumLock+LevelFive+Shift] = Level2; -// map[NumLock+LevelFive+LevelThree] = Level3; -// map[NumLock+LevelFive+LevelThree+Shift] = Level4; -// -// // Lock interchanges Level1 and Level2 -// map[Lock] = Level2; -// map[Lock+Shift] = Level1; -// map[Lock+LevelThree] = Level3; -// map[Lock+LevelThree+Shift] = Level4; -// -// map[Lock+LevelFive] = Level5; -// map[Lock+LevelFive+Shift] = Level6; -// map[Lock+LevelFive+LevelThree] = Level7; -// map[Lock+LevelFive+LevelThree+Shift] = Level8; -// -// map[Lock+NumLock] = Level5; -// map[Lock+NumLock+Shift] = Level6; -// map[Lock+NumLock+LevelThree] = Level7; -// map[Lock+NumLock+LevelThree+Shift] = Level8; -// -// map[Lock+NumLock+LevelFive] = Level2; -// map[Lock+NumLock+LevelFive+Shift] = Level1; -// map[Lock+NumLock+LevelFive+LevelThree] = Level4; -// map[Lock+NumLock+LevelFive+LevelThree+Shift] = Level3; -// -// preserve[LevelFive+Shift] = Shift; -// preserve[NumLock+Shift] = Shift; -// -// level_name[Level1] = "Base"; -// level_name[Level2] = "Shift"; -// level_name[Level3] = "Alt Base"; -// level_name[Level4] = "Shift Alt"; -// level_name[Level5] = "X"; -// level_name[Level6] = "X Shift"; -// level_name[Level7] = "X Alt Base"; -// level_name[Level8] = "X Shift Alt"; -// }; - - type "EIGHT_LEVEL_SEMIALPHABETIC" { - modifiers = Shift+Lock+LevelThree+LevelFive; - map[None] = Level1; - map[Shift] = Level2; - map[Lock] = Level2; - map[LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - map[Lock+LevelThree] = Level3; - map[Lock+Shift+LevelThree] = Level4; - - map[LevelFive] = Level5; - map[Shift+LevelFive] = Level6; - map[Lock+LevelFive] = Level6; - map[LevelThree+LevelFive] = Level7; - map[Shift+LevelThree+LevelFive] = Level8; - map[Lock+LevelThree+LevelFive] = Level7; - map[Lock+Shift+LevelThree+LevelFive] = Level8; - - preserve[Lock+LevelThree] = Lock; - preserve[Lock+Shift+LevelThree] = Lock; - preserve[Lock+LevelFive] = Lock; - preserve[Lock+Shift+LevelFive] = Lock; - preserve[Lock+LevelThree+LevelFive] = Lock; - preserve[Lock+Shift+LevelThree+LevelFive] = Lock; - - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "Alt Base"; - level_name[Level4] = "Shift Alt"; - level_name[Level5] = "X"; - level_name[Level6] = "X Shift"; - level_name[Level7] = "X Alt Base"; - level_name[Level8] = "X Shift Alt"; - }; - -}; - +partial default xkb_types "default" { + // Definition for a key type used for the czech keymap, for instance. + // Defines style a with four level shift. It is similar to three_level + // type used for iso9995 but it lets the shift key behave "normally". + + virtual_modifiers LevelThree,ScrollLock,LevelFive; + + type "EIGHT_LEVEL" { + modifiers = Shift+LevelThree+LevelFive; + map[None] = Level1; + map[Shift] = Level2; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + map[LevelFive] = Level5; + map[Shift+LevelFive] = Level6; + map[LevelThree+LevelFive] = Level7; + map[Shift+LevelThree+LevelFive] = Level8; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; + level_name[Level5] = "X"; + level_name[Level6] = "X Shift"; + level_name[Level7] = "X Alt Base"; + level_name[Level8] = "X Shift Alt"; + }; + + type "EIGHT_LEVEL_ALPHABETIC" { + modifiers = Shift+Lock+LevelThree+LevelFive; + map[None] = Level1; + map[Shift] = Level2; + map[Lock] = Level2; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + map[Lock+LevelThree] = Level4; + map[Lock+Shift+LevelThree] = Level3; + + map[LevelFive] = Level5; + map[Shift+LevelFive] = Level6; + map[Lock+LevelFive] = Level6; + map[LevelThree+LevelFive] = Level7; + map[Shift+LevelThree+LevelFive] = Level8; + map[Lock+LevelThree+LevelFive] = Level8; + map[Lock+Shift+LevelThree+LevelFive] = Level7; + + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; + level_name[Level5] = "X"; + level_name[Level6] = "X Shift"; + level_name[Level7] = "X Alt Base"; + level_name[Level8] = "X Shift Alt"; + }; + +// type "EIGHT_LEVEL_LEVEL_FIVE_LOCK" { +// // Level5-Lock is implemented by using NumLock, because a real modifier +// // is required. +// +// modifiers = Shift + Lock + LevelThree + NumLock + LevelFive; +// +// map[None] = Level1; +// map[Shift] = Level2; +// map[LevelThree] = Level3; +// map[LevelThree+Shift] = Level4; +// +// map[LevelFive] = Level5; +// map[LevelFive+Shift] = Level6; +// map[LevelFive+LevelThree] = Level7; +// map[LevelFive+LevelThree+Shift] = Level8; +// +// map[NumLock] = Level5; +// map[NumLock+Shift] = Level6; +// map[NumLock+LevelThree] = Level7; +// map[NumLock+LevelThree+Shift] = Level8; +// +// map[NumLock+LevelFive] = Level1; +// map[NumLock+LevelFive+Shift] = Level2; +// map[NumLock+LevelFive+LevelThree] = Level3; +// map[NumLock+LevelFive+LevelThree+Shift] = Level4; +// +// // Lock has no effect +// map[Lock] = Level1; +// map[Lock+Shift] = Level2; +// map[Lock+LevelThree] = Level3; +// map[Lock+LevelThree+Shift] = Level4; +// +// map[Lock+LevelFive] = Level5; +// map[Lock+LevelFive+Shift] = Level6; +// map[Lock+LevelFive+LevelThree] = Level7; +// map[Lock+LevelFive+LevelThree+Shift] = Level8; +// +// map[Lock+NumLock] = Level5; +// map[Lock+NumLock+Shift] = Level6; +// map[Lock+NumLock+LevelThree] = Level7; +// map[Lock+NumLock+LevelThree+Shift] = Level8; +// +// map[Lock+NumLock+LevelFive] = Level1; +// map[Lock+NumLock+LevelFive+Shift] = Level2; +// map[Lock+NumLock+LevelFive+LevelThree] = Level3; +// map[Lock+NumLock+LevelFive+LevelThree+Shift] = Level4; +// +// preserve[LevelFive+Shift] = Shift; +// preserve[NumLock+Shift] = Shift; +// preserve[Lock+LevelFive+Shift] = Shift; +// preserve[Lock+NumLock+Shift] = Shift; +// +// level_name[Level1] = "Base"; +// level_name[Level2] = "Shift"; +// level_name[Level3] = "Alt Base"; +// level_name[Level4] = "Shift Alt"; +// level_name[Level5] = "X"; +// level_name[Level6] = "X Shift"; +// level_name[Level7] = "X Alt Base"; +// level_name[Level8] = "X Shift Alt"; +// }; +// +// type "EIGHT_LEVEL_ALPHABETIC_LEVEL_FIVE_LOCK" { +// // Level5-Lock is implemented by using NumLock, because a real modifier +// // is required. +// +// modifiers = Shift + Lock + LevelThree + NumLock + LevelFive; +// +// map[None] = Level1; +// map[Shift] = Level2; +// map[LevelThree] = Level3; +// map[LevelThree+Shift] = Level4; +// +// map[LevelFive] = Level5; +// map[LevelFive+Shift] = Level6; +// map[LevelFive+LevelThree] = Level7; +// map[LevelFive+LevelThree+Shift] = Level8; +// +// map[NumLock] = Level5; +// map[NumLock+Shift] = Level6; +// map[NumLock+LevelThree] = Level7; +// map[NumLock+LevelThree+Shift] = Level8; +// +// map[NumLock+LevelFive] = Level1; +// map[NumLock+LevelFive+Shift] = Level2; +// map[NumLock+LevelFive+LevelThree] = Level3; +// map[NumLock+LevelFive+LevelThree+Shift] = Level4; +// +// // Lock interchanges Level1 and Level2 +// map[Lock] = Level2; +// map[Lock+Shift] = Level1; +// map[Lock+LevelThree] = Level3; +// map[Lock+LevelThree+Shift] = Level4; +// +// map[Lock+LevelFive] = Level5; +// map[Lock+LevelFive+Shift] = Level6; +// map[Lock+LevelFive+LevelThree] = Level7; +// map[Lock+LevelFive+LevelThree+Shift] = Level8; +// +// map[Lock+NumLock] = Level5; +// map[Lock+NumLock+Shift] = Level6; +// map[Lock+NumLock+LevelThree] = Level7; +// map[Lock+NumLock+LevelThree+Shift] = Level8; +// +// map[Lock+NumLock+LevelFive] = Level2; +// map[Lock+NumLock+LevelFive+Shift] = Level1; +// map[Lock+NumLock+LevelFive+LevelThree] = Level4; +// map[Lock+NumLock+LevelFive+LevelThree+Shift] = Level3; +// +// preserve[LevelFive+Shift] = Shift; +// preserve[NumLock+Shift] = Shift; +// +// level_name[Level1] = "Base"; +// level_name[Level2] = "Shift"; +// level_name[Level3] = "Alt Base"; +// level_name[Level4] = "Shift Alt"; +// level_name[Level5] = "X"; +// level_name[Level6] = "X Shift"; +// level_name[Level7] = "X Alt Base"; +// level_name[Level8] = "X Shift Alt"; +// }; + + type "EIGHT_LEVEL_SEMIALPHABETIC" { + modifiers = Shift+Lock+LevelThree+LevelFive; + map[None] = Level1; + map[Shift] = Level2; + map[Lock] = Level2; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + map[Lock+LevelThree] = Level3; + map[Lock+Shift+LevelThree] = Level4; + + map[LevelFive] = Level5; + map[Shift+LevelFive] = Level6; + map[Lock+LevelFive] = Level6; + map[LevelThree+LevelFive] = Level7; + map[Shift+LevelThree+LevelFive] = Level8; + map[Lock+LevelThree+LevelFive] = Level7; + map[Lock+Shift+LevelThree+LevelFive] = Level8; + + preserve[Lock+LevelThree] = Lock; + preserve[Lock+Shift+LevelThree] = Lock; + preserve[Lock+LevelFive] = Lock; + preserve[Lock+Shift+LevelFive] = Lock; + preserve[Lock+LevelThree+LevelFive] = Lock; + preserve[Lock+Shift+LevelThree+LevelFive] = Lock; + + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Alt Base"; + level_name[Level4] = "Shift Alt"; + level_name[Level5] = "X"; + level_name[Level6] = "X Shift"; + level_name[Level7] = "X Alt Base"; + level_name[Level8] = "X Shift Alt"; + }; + +}; diff --git a/xorg-server/xkeyboard-config/types/mousekeys b/xorg-server/xkeyboard-config/types/mousekeys index 85440ca7f..03225990a 100644 --- a/xorg-server/xkeyboard-config/types/mousekeys +++ b/xorg-server/xkeyboard-config/types/mousekeys @@ -1,13 +1,10 @@ -// $Xorg: mousekeys,v 1.3 2000/08/17 19:54:48 cpqbld Exp $ -// -partial default xkb_types "default" { - virtual_modifiers Alt; - - type "SHIFT+ALT" { - modifiers = Shift+Alt; - map[Shift+Alt] = Level2; - level_name[Level1] = "Base"; - level_name[Level2] = "Shift+Alt"; - }; -}; - +partial default xkb_types "default" { + virtual_modifiers Alt; + + type "SHIFT+ALT" { + modifiers = Shift+Alt; + map[Shift+Alt] = Level2; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift+Alt"; + }; +}; diff --git a/xorg-server/xkeyboard-config/types/numpad b/xorg-server/xkeyboard-config/types/numpad index a48e76a64..82c22a917 100644 --- a/xorg-server/xkeyboard-config/types/numpad +++ b/xorg-server/xkeyboard-config/types/numpad @@ -1,72 +1,71 @@ - -partial default xkb_types "pc" { - type "KEYPAD" { - modifiers = Shift+NumLock; - map[None] = Level1; - map[Shift] = Level2; - map[NumLock] = Level2; - map[Shift+NumLock] = Level1; - level_name[Level1] = "Base"; - level_name[Level2] = "Number"; - }; - include "extra(keypad)" -}; - -// On Mac keypads, level 1 and 2 are swapped -partial xkb_types "mac" { - type "KEYPAD" { - modifiers = Shift+NumLock; - map[None] = Level2; - map[Shift] = Level1; - map[NumLock] = Level1; - map[Shift+NumLock] = Level2; - level_name[Level2] = "Base"; - level_name[Level1] = "Number"; - }; - include "extra(mac_keypad)" -}; - -partial xkb_types "microsoft" { - type "KEYPAD" { - modifiers = Shift+NumLock; - map[None] = Level1; - preserve[Shift] = Shift; - map[NumLock] = Level2; - level_name[Level1] = "Base"; - level_name[Level2] = "Number"; - }; - include "extra(keypad)" -}; - -// Swiss-German style numeric keypad: Shift and NumLock operates as -// two independent modifiers; however, since we want shift state for -// the cursor keys, only three levels are used from the key mappings. -// Closest type is actually FOUR_LEVEL_X, but most numpad layouts uses -// FOUR_LEVEL_MIXED_KEYPAD so that's the one we are going to override. -partial xkb_types "shift3" { - type "FOUR_LEVEL_MIXED_KEYPAD" { - modifiers = Shift+NumLock+Control+Alt; - - // NumLock Off => navigate using cursor keys - map[None] = Level1; - - // NumLock Off + Shift pressed => select using cursor keys - preserve[Shift] = Shift; - - // NumLock On => decimal digits - map[NumLock] = Level2; - - // NumLock On + Shift pressed => auxiliary symbols, - // e.g. hexadecimal digits - map[Shift+NumLock] = Level3; - - // Ctrl + Alt, regardless of NumLock and Shift => command keys - map[Control+Alt] = Level4; - - // reverse map from levels to modifiers - level_name[Level1] = "Base"; - level_name[Level2] = "NumLock"; - level_name[Level3] = "Shift+NumLock"; - level_name[Level4] = "Ctrl+Alt"; - }; -}; +partial default xkb_types "pc" { + type "KEYPAD" { + modifiers = Shift+NumLock; + map[None] = Level1; + map[Shift] = Level2; + map[NumLock] = Level2; + map[Shift+NumLock] = Level1; + level_name[Level1] = "Base"; + level_name[Level2] = "Number"; + }; + include "extra(keypad)" +}; + +// On Mac keypads, level 1 and 2 are swapped +partial xkb_types "mac" { + type "KEYPAD" { + modifiers = Shift+NumLock; + map[None] = Level2; + map[Shift] = Level1; + map[NumLock] = Level1; + map[Shift+NumLock] = Level2; + level_name[Level2] = "Base"; + level_name[Level1] = "Number"; + }; + include "extra(mac_keypad)" +}; + +partial xkb_types "microsoft" { + type "KEYPAD" { + modifiers = Shift+NumLock; + map[None] = Level1; + preserve[Shift] = Shift; + map[NumLock] = Level2; + level_name[Level1] = "Base"; + level_name[Level2] = "Number"; + }; + include "extra(keypad)" +}; + +// Swiss-German style numeric keypad: Shift and NumLock operates as +// two independent modifiers; however, since we want shift state for +// the cursor keys, only three levels are used from the key mappings. +// Closest type is actually FOUR_LEVEL_X, but most numpad layouts uses +// FOUR_LEVEL_MIXED_KEYPAD so that's the one we are going to override. +partial xkb_types "shift3" { + type "FOUR_LEVEL_MIXED_KEYPAD" { + modifiers = Shift+NumLock+Control+Alt; + + // NumLock Off => navigate using cursor keys + map[None] = Level1; + + // NumLock Off + Shift pressed => select using cursor keys + preserve[Shift] = Shift; + + // NumLock On => decimal digits + map[NumLock] = Level2; + + // NumLock On + Shift pressed => auxiliary symbols, + // e.g. hexadecimal digits + map[Shift+NumLock] = Level3; + + // Ctrl + Alt, regardless of NumLock and Shift => command keys + map[Control+Alt] = Level4; + + // reverse map from levels to modifiers + level_name[Level1] = "Base"; + level_name[Level2] = "NumLock"; + level_name[Level3] = "Shift+NumLock"; + level_name[Level4] = "Ctrl+Alt"; + }; +}; diff --git a/xorg-server/xkeyboard-config/types/pc b/xorg-server/xkeyboard-config/types/pc index 3c1986aa3..c2d085ed5 100644 --- a/xorg-server/xkeyboard-config/types/pc +++ b/xorg-server/xkeyboard-config/types/pc @@ -1,111 +1,108 @@ -// $Xorg: pc,v 1.3 2000/08/17 19:54:48 cpqbld Exp $ -// - -partial default xkb_types "default" { - - // Some types that are necessary - // for a full implementation of - // a PC compatible keyboard. - virtual_modifiers Alt; - virtual_modifiers LevelThree; - virtual_modifiers LAlt; - virtual_modifiers RAlt; - virtual_modifiers RControl; - virtual_modifiers LControl; - - type "PC_CONTROL_LEVEL2" { - modifiers = Control; - map[None] = Level1; - map[Control] = Level2; - level_name[Level1] = "Base"; - level_name[Level2] = "Control"; - }; - - type "PC_LCONTROL_LEVEL2" { - modifiers = LControl; - map[None] = Level1; - map[LControl] = Level2; - level_name[Level1] = "Base"; - level_name[Level2] = "LControl"; - }; - - type "PC_RCONTROL_LEVEL2" { - modifiers = RControl; - map[None] = Level1; - map[RControl] = Level2; - level_name[Level1] = "Base"; - level_name[Level2] = "RControl"; - }; - - type "PC_ALT_LEVEL2" { - modifiers = Alt; - map[None] = Level1; - map[Alt] = Level2; - level_name[Level1] = "Base"; - level_name[Level2] = "Alt"; - }; - - type "PC_LALT_LEVEL2" { - modifiers = LAlt; - map[None] = Level1; - map[LAlt] = Level2; - level_name[Level1] = "Base"; - level_name[Level2] = "LAlt"; - }; - - type "PC_RALT_LEVEL2" { - modifiers = RAlt; - map[None] = Level1; - map[RAlt] = Level2; - level_name[Level1] = "Base"; - level_name[Level2] = "RAlt"; - }; - - type "CTRL+ALT" { - modifiers = Control+Alt; - map[Control+Alt] = Level2; - level_name[Level1] = "Base"; - level_name[Level2] = "Ctrl+Alt"; - }; - - // Local eight level - // Needed when you want part of your layout eight-level but can not use - // LevelFive as modifier, as this will take over right ctrl by default - // for all the layout and is too invasive for your average four-level user - // Needed to fix bug #9529 - // FIXME Should really use RControl but it's seems not to be enabled by - // default and touching this requires a lot of testing - type "LOCAL_EIGHT_LEVEL" { - modifiers = Shift+Lock+LevelThree+Control; - - map[None] = Level1; - map[Lock+Shift] = Level1; - map[Shift] = Level2; - map[Lock] = Level2; - - map[LevelThree] = Level3; - map[Lock+Shift+LevelThree] = Level3; - map[Shift+LevelThree] = Level4; - map[Lock+LevelThree] = Level4; - - map[Control] = Level5; - map[Lock+Shift+Control] = Level5; - map[Shift+Control] = Level6; - map[Lock+Control] = Level6; - - map[LevelThree+Control] = Level7; - map[Lock+Shift+LevelThree+Control] = Level7; - map[Shift+LevelThree+Control] = Level8; - map[Lock+LevelThree+Control] = Level8; - - level_name[Level1] = "Base"; - level_name[Level2] = "Shift"; - level_name[Level3] = "Level3"; - level_name[Level4] = "Shift Level3"; - level_name[Level5] = "Ctrl"; - level_name[Level6] = "Shift Ctrl"; - level_name[Level7] = "Level3 Ctrl"; - level_name[Level8] = "Shift Level3 Ctrl"; - }; - -}; +partial default xkb_types "default" { + + // Some types that are necessary + // for a full implementation of + // a PC compatible keyboard. + virtual_modifiers Alt; + virtual_modifiers LevelThree; + virtual_modifiers LAlt; + virtual_modifiers RAlt; + virtual_modifiers RControl; + virtual_modifiers LControl; + + type "PC_CONTROL_LEVEL2" { + modifiers = Control; + map[None] = Level1; + map[Control] = Level2; + level_name[Level1] = "Base"; + level_name[Level2] = "Control"; + }; + + type "PC_LCONTROL_LEVEL2" { + modifiers = LControl; + map[None] = Level1; + map[LControl] = Level2; + level_name[Level1] = "Base"; + level_name[Level2] = "LControl"; + }; + + type "PC_RCONTROL_LEVEL2" { + modifiers = RControl; + map[None] = Level1; + map[RControl] = Level2; + level_name[Level1] = "Base"; + level_name[Level2] = "RControl"; + }; + + type "PC_ALT_LEVEL2" { + modifiers = Alt; + map[None] = Level1; + map[Alt] = Level2; + level_name[Level1] = "Base"; + level_name[Level2] = "Alt"; + }; + + type "PC_LALT_LEVEL2" { + modifiers = LAlt; + map[None] = Level1; + map[LAlt] = Level2; + level_name[Level1] = "Base"; + level_name[Level2] = "LAlt"; + }; + + type "PC_RALT_LEVEL2" { + modifiers = RAlt; + map[None] = Level1; + map[RAlt] = Level2; + level_name[Level1] = "Base"; + level_name[Level2] = "RAlt"; + }; + + type "CTRL+ALT" { + modifiers = Control+Alt; + map[Control+Alt] = Level2; + level_name[Level1] = "Base"; + level_name[Level2] = "Ctrl+Alt"; + }; + + // Local eight level + // Needed when you want part of your layout eight-level but can not use + // LevelFive as modifier, as this will take over right ctrl by default + // for all the layout and is too invasive for your average four-level user + // Needed to fix bug #9529 + // FIXME Should really use RControl but it's seems not to be enabled by + // default and touching this requires a lot of testing + type "LOCAL_EIGHT_LEVEL" { + modifiers = Shift+Lock+LevelThree+Control; + + map[None] = Level1; + map[Lock+Shift] = Level1; + map[Shift] = Level2; + map[Lock] = Level2; + + map[LevelThree] = Level3; + map[Lock+Shift+LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + map[Lock+LevelThree] = Level4; + + map[Control] = Level5; + map[Lock+Shift+Control] = Level5; + map[Shift+Control] = Level6; + map[Lock+Control] = Level6; + + map[LevelThree+Control] = Level7; + map[Lock+Shift+LevelThree+Control] = Level7; + map[Shift+LevelThree+Control] = Level8; + map[Lock+LevelThree+Control] = Level8; + + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + level_name[Level3] = "Level3"; + level_name[Level4] = "Shift Level3"; + level_name[Level5] = "Ctrl"; + level_name[Level6] = "Shift Ctrl"; + level_name[Level7] = "Level3 Ctrl"; + level_name[Level8] = "Shift Level3 Ctrl"; + }; + +}; -- cgit v1.2.3