summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-03-21 12:55:09 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2012-03-27 11:50:40 -0700
commit8384075e1a0fb3189f9c37c17f9e12e1aae5102c (patch)
tree2ef3a1cf71bff62caa3d7abc9b59cc1f9457c1d2
parentd9a9788bb163731f681951e9f0ac0e37fd095e6b (diff)
Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com> (cherry picked from commit 9838b7032ea9792bec21af424c53c07078636d21)
-rw-r--r--Xext/bigreq.c16
-rw-r--r--Xext/dpms.c109
-rw-r--r--Xext/dpmsproc.h2
-rw-r--r--Xext/dpmsstubs.c6
-rw-r--r--Xext/geext.c87
-rw-r--r--Xext/geext.h16
-rw-r--r--Xext/geint.h11
-rw-r--r--Xext/panoramiX.c1258
-rw-r--r--Xext/panoramiX.h29
-rw-r--r--Xext/panoramiXSwap.c101
-rw-r--r--Xext/panoramiXh.h16
-rw-r--r--Xext/panoramiXprocs.c2732
-rw-r--r--Xext/panoramiXsrv.h35
-rw-r--r--Xext/saver.c1666
-rw-r--r--Xext/security.c750
-rw-r--r--Xext/securitysrv.h45
-rw-r--r--Xext/shape.c1311
-rw-r--r--Xext/shm.c1077
-rw-r--r--Xext/shmint.h14
-rw-r--r--Xext/sleepuntil.c230
-rw-r--r--Xext/sleepuntil.h14
-rw-r--r--Xext/sync.c2392
-rw-r--r--Xext/syncsdk.h5
-rw-r--r--Xext/syncsrv.h103
-rw-r--r--Xext/xace.c398
-rw-r--r--Xext/xace.h35
-rw-r--r--Xext/xacestr.h2
-rw-r--r--Xext/xcmisc.c70
-rw-r--r--Xext/xf86bigfont.c739
-rw-r--r--Xext/xres.c184
-rw-r--r--Xext/xselinux.h116
-rw-r--r--Xext/xselinux_ext.c308
-rw-r--r--Xext/xselinux_hooks.c654
-rw-r--r--Xext/xselinux_label.c239
-rw-r--r--Xext/xselinuxint.h859
-rw-r--r--Xext/xtest.c459
-rw-r--r--Xext/xvdisp.c2252
-rw-r--r--Xext/xvdix.h250
-rw-r--r--Xext/xvmain.c1332
-rw-r--r--Xext/xvmc.c629
-rw-r--r--Xext/xvmcext.h138
-rw-r--r--Xi/allowev.c32
-rw-r--r--Xi/allowev.h6
-rw-r--r--Xi/chgdctl.c91
-rw-r--r--Xi/chgdctl.h10
-rw-r--r--Xi/chgfctl.c455
-rw-r--r--Xi/chgfctl.h6
-rw-r--r--Xi/chgkbd.c2
-rw-r--r--Xi/chgkbd.h6
-rw-r--r--Xi/chgkmap.c8
-rw-r--r--Xi/chgkmap.h6
-rw-r--r--Xi/chgprop.c43
-rw-r--r--Xi/chgprop.h6
-rw-r--r--Xi/chgptr.c6
-rw-r--r--Xi/chgptr.h14
-rw-r--r--Xi/closedev.c40
-rw-r--r--Xi/closedev.h6
-rw-r--r--Xi/devbell.c68
-rw-r--r--Xi/devbell.h6
-rw-r--r--Xi/exevents.c1777
-rw-r--r--Xi/exglobals.h3
-rw-r--r--Xi/extinit.c823
-rw-r--r--Xi/getbmap.c12
-rw-r--r--Xi/getbmap.h10
-rw-r--r--Xi/getdctl.c58
-rw-r--r--Xi/getdctl.h10
-rw-r--r--Xi/getfctl.c110
-rw-r--r--Xi/getfctl.h10
-rw-r--r--Xi/getfocus.c18
-rw-r--r--Xi/getfocus.h10
-rw-r--r--Xi/getkmap.c22
-rw-r--r--Xi/getkmap.h10
-rw-r--r--Xi/getmmap.c10
-rw-r--r--Xi/getmmap.h10
-rw-r--r--Xi/getprop.c63
-rw-r--r--Xi/getprop.h18
-rw-r--r--Xi/getselev.c72
-rw-r--r--Xi/getselev.h10
-rw-r--r--Xi/getvers.c10
-rw-r--r--Xi/getvers.h10
-rw-r--r--Xi/grabdev.c73
-rw-r--r--Xi/grabdev.h20
-rw-r--r--Xi/grabdevb.c46
-rw-r--r--Xi/grabdevb.h6
-rw-r--r--Xi/grabdevk.c43
-rw-r--r--Xi/grabdevk.h6
-rw-r--r--Xi/gtmotion.c48
-rw-r--r--Xi/gtmotion.h10
-rw-r--r--Xi/listdev.c133
-rw-r--r--Xi/listdev.h12
-rw-r--r--Xi/opendev.c53
-rw-r--r--Xi/opendev.h10
-rw-r--r--Xi/queryst.c93
-rw-r--r--Xi/queryst.h10
-rw-r--r--Xi/selectev.c41
-rw-r--r--Xi/selectev.h6
-rw-r--r--Xi/sendexev.c54
-rw-r--r--Xi/sendexev.h6
-rw-r--r--Xi/setbmap.c12
-rw-r--r--Xi/setbmap.h10
-rw-r--r--Xi/setdval.c26
-rw-r--r--Xi/setdval.h10
-rw-r--r--Xi/setfocus.c10
-rw-r--r--Xi/setfocus.h6
-rw-r--r--Xi/setmmap.c14
-rw-r--r--Xi/setmmap.h10
-rw-r--r--Xi/setmode.c33
-rw-r--r--Xi/setmode.h10
-rw-r--r--Xi/stubs.c8
-rw-r--r--Xi/ungrdev.c12
-rw-r--r--Xi/ungrdev.h6
-rw-r--r--Xi/ungrdevb.c31
-rw-r--r--Xi/ungrdevb.h6
-rw-r--r--Xi/ungrdevk.c37
-rw-r--r--Xi/ungrdevk.h6
-rw-r--r--Xi/xiallowev.c67
-rw-r--r--Xi/xiallowev.h2
-rw-r--r--Xi/xichangecursor.c35
-rw-r--r--Xi/xichangecursor.h6
-rw-r--r--Xi/xichangehierarchy.c217
-rw-r--r--Xi/xichangehierarchy.h6
-rw-r--r--Xi/xigetclientpointer.c30
-rw-r--r--Xi/xigetclientpointer.h12
-rw-r--r--Xi/xigrabdev.c32
-rw-r--r--Xi/xigrabdev.h2
-rw-r--r--Xi/xipassivegrab.c135
-rw-r--r--Xi/xipassivegrab.h5
-rw-r--r--Xi/xiproperty.c819
-rw-r--r--Xi/xiproperty.h43
-rw-r--r--Xi/xiquerydevice.c235
-rw-r--r--Xi/xiquerydevice.h20
-rw-r--r--Xi/xiquerypointer.c63
-rw-r--r--Xi/xiquerypointer.h10
-rw-r--r--Xi/xiqueryversion.c18
-rw-r--r--Xi/xiqueryversion.h4
-rw-r--r--Xi/xiselectev.c140
-rw-r--r--Xi/xiselectev.h4
-rw-r--r--Xi/xisetclientpointer.c29
-rw-r--r--Xi/xisetclientpointer.h6
-rw-r--r--Xi/xisetdevfocus.c28
-rw-r--r--Xi/xisetdevfocus.h4
-rw-r--r--Xi/xiwarppointer.c69
-rw-r--r--Xi/xiwarppointer.h6
-rw-r--r--composite/compalloc.c754
-rw-r--r--composite/compext.c699
-rw-r--r--composite/compinit.c243
-rw-r--r--composite/compint.h195
-rw-r--r--composite/compositeext.h4
-rw-r--r--composite/compoverlay.c93
-rw-r--r--composite/compwindow.c800
-rw-r--r--config/config-backends.h18
-rw-r--r--config/config.c31
-rw-r--r--config/dbus-core.c19
-rw-r--r--config/dbus.c38
-rw-r--r--config/hal.c263
-rw-r--r--config/udev.c58
-rw-r--r--config/wscons.c334
-rw-r--r--damageext/damageext.c424
-rw-r--r--damageext/damageext.h4
-rw-r--r--damageext/damageextint.h24
-rw-r--r--dbe/dbe.c838
-rw-r--r--dbe/dbestruct.h117
-rw-r--r--dbe/midbe.c524
-rw-r--r--dbe/midbe.h14
-rw-r--r--dbe/midbestr.h14
-rw-r--r--dix/atom.c143
-rw-r--r--dix/colormap.c3575
-rw-r--r--dix/cursor.c394
-rw-r--r--dix/devices.c1476
-rw-r--r--dix/dispatch.c3351
-rw-r--r--dix/dispatch.h212
-rw-r--r--dix/dixfonts.c2405
-rw-r--r--dix/dixutils.c677
-rw-r--r--dix/enterleave.c1073
-rw-r--r--dix/enterleave.h59
-rw-r--r--dix/eventconvert.c794
-rw-r--r--dix/events.c4202
-rw-r--r--dix/extension.c222
-rw-r--r--dix/ffs.c3
-rw-r--r--dix/gc.c1292
-rw-r--r--dix/getevents.c484
-rw-r--r--dix/globals.c48
-rw-r--r--dix/glyphcurs.c116
-rw-r--r--dix/grabs.c503
-rw-r--r--dix/initatoms.c207
-rw-r--r--dix/inpututils.c187
-rw-r--r--dix/main.c360
-rw-r--r--dix/pixmap.c52
-rw-r--r--dix/privates.c297
-rw-r--r--dix/property.c506
-rw-r--r--dix/ptrveloc.c699
-rw-r--r--dix/region.c1166
-rw-r--r--dix/registry.c247
-rw-r--r--dix/resource.c641
-rw-r--r--dix/selection.c156
-rw-r--r--dix/swaprep.c613
-rw-r--r--dix/swapreq.c311
-rw-r--r--dix/tables.c1038
-rw-r--r--dix/touch.c244
-rw-r--r--dix/window.c4099
-rw-r--r--exa/exa.c627
-rw-r--r--exa/exa.h223
-rw-r--r--exa/exa_accel.c1634
-rw-r--r--exa/exa_classic.c164
-rw-r--r--exa/exa_driver.c114
-rw-r--r--exa/exa_glyphs.c988
-rw-r--r--exa/exa_migration_classic.c702
-rw-r--r--exa/exa_migration_mixed.c275
-rw-r--r--exa/exa_mixed.c221
-rw-r--r--exa/exa_offscreen.c692
-rw-r--r--exa/exa_priv.h495
-rw-r--r--exa/exa_render.c1463
-rw-r--r--exa/exa_unaccel.c706
-rw-r--r--fb/fb.h1801
-rw-r--r--fb/fb24_32.c803
-rw-r--r--fb/fb24_32.h25
-rw-r--r--fb/fballpriv.c31
-rw-r--r--fb/fbarc.c189
-rw-r--r--fb/fbbits.c2
-rw-r--r--fb/fbbits.h1430
-rw-r--r--fb/fbblt.c1372
-rw-r--r--fb/fbbltone.c964
-rw-r--r--fb/fbcmap_mi.c37
-rw-r--r--fb/fbcopy.c522
-rw-r--r--fb/fbfill.c326
-rw-r--r--fb/fbfillrect.c127
-rw-r--r--fb/fbfillsp.c111
-rw-r--r--fb/fbgc.c303
-rw-r--r--fb/fbgetsp.c73
-rw-r--r--fb/fbglyph.c583
-rw-r--r--fb/fbimage.c492
-rw-r--r--fb/fbline.c184
-rw-r--r--fb/fboverlay.c444
-rw-r--r--fb/fboverlay.h109
-rw-r--r--fb/fbpict.c380
-rw-r--r--fb/fbpict.h75
-rw-r--r--fb/fbpixmap.c408
-rw-r--r--fb/fbpoint.c200
-rw-r--r--fb/fbpush.c331
-rw-r--r--fb/fbrop.h21
-rw-r--r--fb/fbscreen.c238
-rw-r--r--fb/fbseg.c1053
-rw-r--r--fb/fbsetsp.c118
-rw-r--r--fb/fbsolid.c252
-rw-r--r--fb/fbstipple.c348
-rw-r--r--fb/fbtile.c246
-rw-r--r--fb/fbtrap.c244
-rw-r--r--fb/fbutil.c483
-rw-r--r--fb/fbwindow.c200
-rw-r--r--glx/clientinfo.c12
-rw-r--r--glx/createcontext.c6
-rw-r--r--glx/dispatch.h16912
-rw-r--r--glx/extension_string.c96
-rw-r--r--glx/extension_string.h36
-rw-r--r--glx/glapi.c332
-rw-r--r--glx/glapi.h62
-rw-r--r--glx/glapi_gentable.c7074
-rw-r--r--glx/glapitable.h1962
-rw-r--r--glx/glprocs.h2995
-rw-r--r--glx/glthread.c144
-rw-r--r--glx/glthread.h69
-rw-r--r--glx/glxbyteorder.h4
-rw-r--r--glx/glxcmds.c2107
-rw-r--r--glx/glxcmdsswap.c338
-rw-r--r--glx/glxcontext.h91
-rw-r--r--glx/glxdrawable.h28
-rw-r--r--glx/glxdri.c995
-rw-r--r--glx/glxdri2.c448
-rw-r--r--glx/glxdricommon.c249
-rw-r--r--glx/glxdricommon.h16
-rw-r--r--glx/glxdriswrast.c260
-rw-r--r--glx/glxext.c365
-rw-r--r--glx/glxext.h11
-rw-r--r--glx/glxscreens.c454
-rw-r--r--glx/glxscreens.h53
-rw-r--r--glx/glxserver.h79
-rw-r--r--glx/glxutil.h14
-rw-r--r--glx/indirect_dispatch.c6252
-rw-r--r--glx/indirect_dispatch.h1021
-rw-r--r--glx/indirect_dispatch_swap.c7370
-rw-r--r--glx/indirect_program.c131
-rw-r--r--glx/indirect_reqsize.c88
-rw-r--r--glx/indirect_reqsize.h198
-rw-r--r--glx/indirect_size.h8
-rw-r--r--glx/indirect_size_get.c3
-rw-r--r--glx/indirect_size_get.h14
-rw-r--r--glx/indirect_table.c1654
-rw-r--r--glx/indirect_table.h8
-rw-r--r--glx/indirect_texture_compression.c129
-rw-r--r--glx/indirect_util.c251
-rw-r--r--glx/indirect_util.h34
-rw-r--r--glx/render2.c249
-rw-r--r--glx/render2swap.c372
-rw-r--r--glx/renderpix.c36
-rw-r--r--glx/renderpixswap.c62
-rw-r--r--glx/rensize.c475
-rw-r--r--glx/single2.c399
-rw-r--r--glx/single2swap.c232
-rw-r--r--glx/singlepix.c433
-rw-r--r--glx/singlepixswap.c543
-rw-r--r--glx/singlesize.c204
-rw-r--r--glx/singlesize.h8
-rw-r--r--glx/swap_interval.c40
-rw-r--r--glx/unpack.h41
-rw-r--r--glx/xfont.c151
-rw-r--r--hw/dmx/config/Canvas.c132
-rw-r--r--hw/dmx/config/Canvas.h8
-rw-r--r--hw/dmx/config/CanvasP.h10
-rw-r--r--hw/dmx/config/dmxcompat.c160
-rw-r--r--hw/dmx/config/dmxconfig.c340
-rw-r--r--hw/dmx/config/dmxconfig.h4
-rw-r--r--hw/dmx/config/dmxparse.c473
-rw-r--r--hw/dmx/config/dmxparse.h329
-rw-r--r--hw/dmx/config/dmxprint.c373
-rw-r--r--hw/dmx/config/dmxprint.h4
-rw-r--r--hw/dmx/config/dmxtodmx.c7
-rw-r--r--hw/dmx/config/vdltodmx.c10
-rw-r--r--hw/dmx/config/xdmxconfig.c1263
-rw-r--r--hw/dmx/dmx-config.h2
-rw-r--r--hw/dmx/dmx.c782
-rw-r--r--hw/dmx/dmx.h268
-rw-r--r--hw/dmx/dmx_glxvisuals.c904
-rw-r--r--hw/dmx/dmx_glxvisuals.h26
-rw-r--r--hw/dmx/dmxcb.c161
-rw-r--r--hw/dmx/dmxcb.h2
-rw-r--r--hw/dmx/dmxclient.h20
-rw-r--r--hw/dmx/dmxcmap.c136
-rw-r--r--hw/dmx/dmxcmap.h7
-rw-r--r--hw/dmx/dmxcursor.c522
-rw-r--r--hw/dmx/dmxcursor.h9
-rw-r--r--hw/dmx/dmxdpms.c117
-rw-r--r--hw/dmx/dmxdpms.h6
-rw-r--r--hw/dmx/dmxextension.c1770
-rw-r--r--hw/dmx/dmxextension.h99
-rw-r--r--hw/dmx/dmxfont.c597
-rw-r--r--hw/dmx/dmxfont.h4
-rw-r--r--hw/dmx/dmxgc.c382
-rw-r--r--hw/dmx/dmxgc.h11
-rw-r--r--hw/dmx/dmxgcops.c476
-rw-r--r--hw/dmx/dmxgcops.h64
-rw-r--r--hw/dmx/dmxinit.c850
-rw-r--r--hw/dmx/dmxinit.h16
-rw-r--r--hw/dmx/dmxinput.c27
-rw-r--r--hw/dmx/dmxinput.h78
-rw-r--r--hw/dmx/dmxlog.c310
-rw-r--r--hw/dmx/dmxlog.h18
-rw-r--r--hw/dmx/dmxpict.c1405
-rw-r--r--hw/dmx/dmxpict.h54
-rw-r--r--hw/dmx/dmxpixmap.c177
-rw-r--r--hw/dmx/dmxpixmap.h19
-rw-r--r--hw/dmx/dmxprop.c241
-rw-r--r--hw/dmx/dmxprop.h13
-rw-r--r--hw/dmx/dmxscrinit.c531
-rw-r--r--hw/dmx/dmxscrinit.h2
-rw-r--r--hw/dmx/dmxshadow.c27
-rw-r--r--hw/dmx/dmxshadow.h2
-rw-r--r--hw/dmx/dmxstat.c115
-rw-r--r--hw/dmx/dmxstat.h14
-rw-r--r--hw/dmx/dmxsync.c78
-rw-r--r--hw/dmx/dmxsync.h2
-rw-r--r--hw/dmx/dmxvisual.c82
-rw-r--r--hw/dmx/dmxvisual.h10
-rw-r--r--hw/dmx/dmxwindow.c1019
-rw-r--r--hw/dmx/dmxwindow.h47
-rw-r--r--hw/dmx/examples/dmxaddinput.c20
-rw-r--r--hw/dmx/examples/dmxaddscreen.c61
-rw-r--r--hw/dmx/examples/dmxinfo.c129
-rw-r--r--hw/dmx/examples/dmxreconfig.c139
-rw-r--r--hw/dmx/examples/dmxresize.c27
-rw-r--r--hw/dmx/examples/dmxrminput.c13
-rw-r--r--hw/dmx/examples/dmxrmscreen.c15
-rw-r--r--hw/dmx/examples/dmxwininfo.c748
-rw-r--r--hw/dmx/examples/ev.c218
-rw-r--r--hw/dmx/examples/evi.c21
-rw-r--r--hw/dmx/examples/res.c32
-rw-r--r--hw/dmx/examples/xbell.c45
-rw-r--r--hw/dmx/examples/xinput.c215
-rw-r--r--hw/dmx/examples/xled.c28
-rw-r--r--hw/dmx/examples/xtest.c14
-rw-r--r--hw/dmx/glxProxy/compsize.c866
-rw-r--r--hw/dmx/glxProxy/compsize.h2
-rw-r--r--hw/dmx/glxProxy/g_disptab.c1128
-rw-r--r--hw/dmx/glxProxy/g_disptab.h1252
-rw-r--r--hw/dmx/glxProxy/g_renderswap.c2735
-rw-r--r--hw/dmx/glxProxy/global.c2
-rw-r--r--hw/dmx/glxProxy/glxcmds.c4513
-rw-r--r--hw/dmx/glxProxy/glxcmds.h12
-rw-r--r--hw/dmx/glxProxy/glxcmdsswap.c927
-rw-r--r--hw/dmx/glxProxy/glxcontext.h56
-rw-r--r--hw/dmx/glxProxy/glxdrawable.h5
-rw-r--r--hw/dmx/glxProxy/glxerror.h1
-rw-r--r--hw/dmx/glxProxy/glxext.c409
-rw-r--r--hw/dmx/glxProxy/glxext.h45
-rw-r--r--hw/dmx/glxProxy/glxfbconfig.c128
-rw-r--r--hw/dmx/glxProxy/glxfbconfig.h5
-rw-r--r--hw/dmx/glxProxy/glxscreens.c499
-rw-r--r--hw/dmx/glxProxy/glxscreens.h7
-rw-r--r--hw/dmx/glxProxy/glxserver.h189
-rw-r--r--hw/dmx/glxProxy/glxsingle.c1332
-rw-r--r--hw/dmx/glxProxy/glxsingle.h30
-rw-r--r--hw/dmx/glxProxy/glxswap.c588
-rw-r--r--hw/dmx/glxProxy/glxswap.h12
-rw-r--r--hw/dmx/glxProxy/glxutil.c5
-rw-r--r--hw/dmx/glxProxy/glxutil.h9
-rw-r--r--hw/dmx/glxProxy/glxvendor.c753
-rw-r--r--hw/dmx/glxProxy/glxvendor.h27
-rw-r--r--hw/dmx/glxProxy/glxvisuals.c140
-rw-r--r--hw/dmx/glxProxy/glxvisuals.h12
-rw-r--r--hw/dmx/glxProxy/render2swap.c219
-rw-r--r--hw/dmx/glxProxy/renderpixswap.c445
-rw-r--r--hw/dmx/glxProxy/unpack.h41
-rw-r--r--hw/dmx/input/ChkNotMaskEv.c68
-rw-r--r--hw/dmx/input/ChkNotMaskEv.h2
-rw-r--r--hw/dmx/input/atKeynames.h40
-rw-r--r--hw/dmx/input/dmxarg.c69
-rw-r--r--hw/dmx/input/dmxarg.h10
-rw-r--r--hw/dmx/input/dmxbackend.c359
-rw-r--r--hw/dmx/input/dmxbackend.h26
-rw-r--r--hw/dmx/input/dmxcommon.c395
-rw-r--r--hw/dmx/input/dmxcommon.h40
-rw-r--r--hw/dmx/input/dmxconsole.c727
-rw-r--r--hw/dmx/input/dmxconsole.h34
-rw-r--r--hw/dmx/input/dmxdetach.c4
-rw-r--r--hw/dmx/input/dmxdummy.c50
-rw-r--r--hw/dmx/input/dmxevents.c412
-rw-r--r--hw/dmx/input/dmxevents.h4
-rw-r--r--hw/dmx/input/dmxinputinit.c829
-rw-r--r--hw/dmx/input/dmxinputinit.h271
-rw-r--r--hw/dmx/input/dmxmap.c28
-rw-r--r--hw/dmx/input/dmxmap.h2
-rw-r--r--hw/dmx/input/dmxmotion.c84
-rw-r--r--hw/dmx/input/dmxmotion.h11
-rw-r--r--hw/dmx/input/dmxsigio.c115
-rw-r--r--hw/dmx/input/dmxsigio.h4
-rw-r--r--hw/dmx/input/dmxxinput.c17
-rw-r--r--hw/dmx/input/lnx-keyboard.c1116
-rw-r--r--hw/dmx/input/lnx-keyboard.h44
-rw-r--r--hw/dmx/input/lnx-ms.c201
-rw-r--r--hw/dmx/input/lnx-ms.h26
-rw-r--r--hw/dmx/input/lnx-ps2.c173
-rw-r--r--hw/dmx/input/lnx-ps2.h26
-rw-r--r--hw/dmx/input/usb-common.c331
-rw-r--r--hw/dmx/input/usb-common.h15
-rw-r--r--hw/dmx/input/usb-keyboard.c441
-rw-r--r--hw/dmx/input/usb-keyboard.h17
-rw-r--r--hw/dmx/input/usb-mouse.c67
-rw-r--r--hw/dmx/input/usb-mouse.h17
-rw-r--r--hw/dmx/input/usb-other.c85
-rw-r--r--hw/dmx/input/usb-other.h17
-rw-r--r--hw/dmx/input/usb-private.h22
-rw-r--r--hw/kdrive/ephyr/XF86dri.c329
-rw-r--r--hw/kdrive/ephyr/ephyr.c1465
-rw-r--r--hw/kdrive/ephyr/ephyr.h105
-rw-r--r--hw/kdrive/ephyr/ephyr_draw.c76
-rw-r--r--hw/kdrive/ephyr/ephyrdri.c328
-rw-r--r--hw/kdrive/ephyr/ephyrdri.h77
-rw-r--r--hw/kdrive/ephyr/ephyrdriext.c1480
-rw-r--r--hw/kdrive/ephyr/ephyrdriext.h10
-rw-r--r--hw/kdrive/ephyr/ephyrglxext.c704
-rw-r--r--hw/kdrive/ephyr/ephyrglxext.h3
-rw-r--r--hw/kdrive/ephyr/ephyrhostglx.c666
-rw-r--r--hw/kdrive/ephyr/ephyrhostglx.h59
-rw-r--r--hw/kdrive/ephyr/ephyrhostproxy.c51
-rw-r--r--hw/kdrive/ephyr/ephyrhostproxy.h26
-rw-r--r--hw/kdrive/ephyr/ephyrhostvideo.c1053
-rw-r--r--hw/kdrive/ephyr/ephyrhostvideo.h237
-rw-r--r--hw/kdrive/ephyr/ephyrinit.c494
-rw-r--r--hw/kdrive/ephyr/ephyrlog.h10
-rw-r--r--hw/kdrive/ephyr/ephyrproxyext.c82
-rw-r--r--hw/kdrive/ephyr/ephyrproxyext.h3
-rw-r--r--hw/kdrive/ephyr/ephyrvideo.c1573
-rw-r--r--hw/kdrive/ephyr/hostx.c1798
-rw-r--r--hw/kdrive/ephyr/hostx.h240
-rw-r--r--hw/kdrive/ephyr/os.c22
-rw-r--r--hw/kdrive/ephyr/xf86dri.h80
-rw-r--r--hw/kdrive/fake/fake.c446
-rw-r--r--hw/kdrive/fake/fake.h85
-rw-r--r--hw/kdrive/fake/fakeinit.c86
-rw-r--r--hw/kdrive/fake/kbd.c12
-rw-r--r--hw/kdrive/fake/mouse.c9
-rw-r--r--hw/kdrive/fake/os.c13
-rw-r--r--hw/kdrive/fbdev/fbdev.c789
-rw-r--r--hw/kdrive/fbdev/fbdev.h56
-rw-r--r--hw/kdrive/fbdev/fbinit.c98
-rw-r--r--hw/kdrive/linux/evdev.c292
-rw-r--r--hw/kdrive/linux/keyboard.c1015
-rw-r--r--hw/kdrive/linux/linux.c385
-rw-r--r--hw/kdrive/linux/mouse.c956
-rw-r--r--hw/kdrive/linux/ms.c134
-rw-r--r--hw/kdrive/linux/ps2.c142
-rw-r--r--hw/kdrive/linux/tslib.c48
-rw-r--r--hw/kdrive/src/fourcc.h3
-rw-r--r--hw/kdrive/src/kcmap.c159
-rw-r--r--hw/kdrive/src/kdrive.c1205
-rw-r--r--hw/kdrive/src/kdrive.h555
-rw-r--r--hw/kdrive/src/kinfo.c71
-rw-r--r--hw/kdrive/src/kinput.c1357
-rw-r--r--hw/kdrive/src/kmode.c542
-rw-r--r--hw/kdrive/src/kshadow.c43
-rw-r--r--hw/kdrive/src/kxv.c2885
-rw-r--r--hw/kdrive/src/kxv.h318
-rw-r--r--hw/vfb/InitInput.c65
-rw-r--r--hw/vfb/InitOutput.c811
-rw-r--r--hw/xfree86/common/compiler.h1524
-rw-r--r--hw/xfree86/common/fourcc.h3
-rw-r--r--hw/xfree86/common/vidmodeproc.h39
-rw-r--r--hw/xfree86/common/xf86.h377
-rw-r--r--hw/xfree86/common/xf86AutoConfig.c172
-rw-r--r--hw/xfree86/common/xf86Bus.c296
-rw-r--r--hw/xfree86/common/xf86Bus.h32
-rw-r--r--hw/xfree86/common/xf86Config.c2163
-rw-r--r--hw/xfree86/common/xf86Config.h10
-rw-r--r--hw/xfree86/common/xf86Configure.c827
-rw-r--r--hw/xfree86/common/xf86Cursor.c1170
-rw-r--r--hw/xfree86/common/xf86DGA.c1382
-rw-r--r--hw/xfree86/common/xf86DPMS.c68
-rw-r--r--hw/xfree86/common/xf86Events.c519
-rw-r--r--hw/xfree86/common/xf86Globals.c95
-rw-r--r--hw/xfree86/common/xf86Helper.c1339
-rw-r--r--hw/xfree86/common/xf86InPriv.h2
-rw-r--r--hw/xfree86/common/xf86Init.c2146
-rw-r--r--hw/xfree86/common/xf86Mode.c2339
-rw-r--r--hw/xfree86/common/xf86Module.h110
-rw-r--r--hw/xfree86/common/xf86Opt.h135
-rw-r--r--hw/xfree86/common/xf86Option.c817
-rw-r--r--hw/xfree86/common/xf86Optionstr.h16
-rw-r--r--hw/xfree86/common/xf86PM.c223
-rw-r--r--hw/xfree86/common/xf86PciInfo.h23
-rw-r--r--hw/xfree86/common/xf86Priv.h136
-rw-r--r--hw/xfree86/common/xf86Privstr.h120
-rw-r--r--hw/xfree86/common/xf86RandR.c505
-rw-r--r--hw/xfree86/common/xf86VGAarbiter.c626
-rw-r--r--hw/xfree86/common/xf86VGAarbiter.h3
-rw-r--r--hw/xfree86/common/xf86VGAarbiterPriv.h211
-rw-r--r--hw/xfree86/common/xf86VidMode.c357
-rw-r--r--hw/xfree86/common/xf86Xinput.c468
-rw-r--r--hw/xfree86/common/xf86Xinput.h177
-rw-r--r--hw/xfree86/common/xf86cmap.c1212
-rw-r--r--hw/xfree86/common/xf86cmap.h48
-rw-r--r--hw/xfree86/common/xf86fbBus.c16
-rw-r--r--hw/xfree86/common/xf86fbman.c2175
-rw-r--r--hw/xfree86/common/xf86fbman.h221
-rw-r--r--hw/xfree86/common/xf86noBus.c2
-rw-r--r--hw/xfree86/common/xf86pciBus.c1440
-rw-r--r--hw/xfree86/common/xf86pciBus.h6
-rw-r--r--hw/xfree86/common/xf86sbusBus.c711
-rw-r--r--hw/xfree86/common/xf86sbusBus.h53
-rw-r--r--hw/xfree86/common/xf86str.h898
-rw-r--r--hw/xfree86/common/xf86xv.c3153
-rw-r--r--hw/xfree86/common/xf86xv.h365
-rw-r--r--hw/xfree86/common/xf86xvmc.c218
-rw-r--r--hw/xfree86/common/xf86xvmc.h112
-rw-r--r--hw/xfree86/common/xf86xvpriv.h78
-rw-r--r--hw/xfree86/common/xisb.c136
-rw-r--r--hw/xfree86/common/xisb.h30
-rw-r--r--hw/xfree86/common/xorgHelper.c1
-rw-r--r--hw/xfree86/common/xorgVersion.h26
-rw-r--r--hw/xfree86/ddc/ddc.c351
-rw-r--r--hw/xfree86/ddc/ddcProperty.c31
-rw-r--r--hw/xfree86/ddc/edid.h327
-rw-r--r--hw/xfree86/ddc/interpret_edid.c521
-rw-r--r--hw/xfree86/ddc/print_edid.c644
-rw-r--r--hw/xfree86/ddc/xf86DDC.h64
-rw-r--r--hw/xfree86/dixmods/dbemodule.c25
-rw-r--r--hw/xfree86/dixmods/extmod/dgaproc.h128
-rw-r--r--hw/xfree86/dixmods/extmod/modinit.c189
-rw-r--r--hw/xfree86/dixmods/extmod/modinit.h17
-rw-r--r--hw/xfree86/dixmods/extmod/xf86dga2.c552
-rw-r--r--hw/xfree86/dixmods/extmod/xf86vmode.c2458
-rw-r--r--hw/xfree86/dixmods/extmod/xvmod.c1
-rw-r--r--hw/xfree86/dixmods/extmod/xvmodproc.h8
-rw-r--r--hw/xfree86/dixmods/fbmodule.c28
-rw-r--r--hw/xfree86/dixmods/glxmodule.c51
-rw-r--r--hw/xfree86/dixmods/recordmod.c23
-rw-r--r--hw/xfree86/dixmods/shmodule.c23
-rw-r--r--hw/xfree86/dixmods/xkbKillSrv.c2
-rw-r--r--hw/xfree86/dixmods/xkbPrivate.c19
-rw-r--r--hw/xfree86/dixmods/xkbVT.c8
-rw-r--r--hw/xfree86/dri/dri.c2423
-rw-r--r--hw/xfree86/dri/dri.h295
-rw-r--r--hw/xfree86/dri/drimodule.c40
-rw-r--r--hw/xfree86/dri/dristruct.h95
-rw-r--r--hw/xfree86/dri/sarea.h33
-rw-r--r--hw/xfree86/dri/xf86dri.c473
-rw-r--r--hw/xfree86/dri2/dri2.c946
-rw-r--r--hw/xfree86/dri2/dri2.h178
-rw-r--r--hw/xfree86/dri2/dri2ext.c228
-rw-r--r--hw/xfree86/exa/examodule.c153
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.c1173
-rw-r--r--hw/xfree86/fbdevhw/fbdevhw.h98
-rw-r--r--hw/xfree86/fbdevhw/fbdevhwstub.c92
-rw-r--r--hw/xfree86/fbdevhw/fbpriv.h330
-rw-r--r--hw/xfree86/i2c/bt829.c1110
-rw-r--r--hw/xfree86/i2c/bt829.h90
-rw-r--r--hw/xfree86/i2c/bt829_module.c27
-rw-r--r--hw/xfree86/i2c/fi1236.c277
-rw-r--r--hw/xfree86/i2c/fi1236.h110
-rw-r--r--hw/xfree86/i2c/fi1236_module.c33
-rw-r--r--hw/xfree86/i2c/msp3430.c1184
-rw-r--r--hw/xfree86/i2c/msp3430.h53
-rw-r--r--hw/xfree86/i2c/msp3430_module.c33
-rw-r--r--hw/xfree86/i2c/tda8425.c103
-rw-r--r--hw/xfree86/i2c/tda8425.h29
-rw-r--r--hw/xfree86/i2c/tda8425_module.c33
-rw-r--r--hw/xfree86/i2c/tda9850.c176
-rw-r--r--hw/xfree86/i2c/tda9850.h21
-rw-r--r--hw/xfree86/i2c/tda9850_module.c33
-rw-r--r--hw/xfree86/i2c/tda9885.c148
-rw-r--r--hw/xfree86/i2c/tda9885.h62
-rw-r--r--hw/xfree86/i2c/tda9885_module.c33
-rw-r--r--hw/xfree86/i2c/uda1380.c267
-rw-r--r--hw/xfree86/i2c/uda1380.h17
-rw-r--r--hw/xfree86/i2c/uda1380_module.c33
-rw-r--r--hw/xfree86/i2c/xf86i2c.c459
-rw-r--r--hw/xfree86/i2c/xf86i2c.h103
-rw-r--r--hw/xfree86/int10/generic.c262
-rw-r--r--hw/xfree86/int10/helper_exec.c547
-rw-r--r--hw/xfree86/int10/helper_mem.c182
-rw-r--r--hw/xfree86/int10/stub.c2
-rw-r--r--hw/xfree86/int10/xf86int10.c1238
-rw-r--r--hw/xfree86/int10/xf86int10.h70
-rw-r--r--hw/xfree86/int10/xf86int10module.c23
-rw-r--r--hw/xfree86/int10/xf86x86emu.c38
-rw-r--r--hw/xfree86/loader/loader.c55
-rw-r--r--hw/xfree86/loader/loader.h4
-rw-r--r--hw/xfree86/loader/loaderProcs.h10
-rw-r--r--hw/xfree86/loader/loadext.c264
-rw-r--r--hw/xfree86/loader/loadmod.c1097
-rw-r--r--hw/xfree86/loader/os.c2
-rw-r--r--hw/xfree86/modes/xf86Crtc.c3693
-rw-r--r--hw/xfree86/modes/xf86Crtc.h496
-rw-r--r--hw/xfree86/modes/xf86Cursors.c632
-rw-r--r--hw/xfree86/modes/xf86DiDGA.c199
-rw-r--r--hw/xfree86/modes/xf86DisplayIDModes.c481
-rw-r--r--hw/xfree86/modes/xf86EdidModes.c1068
-rw-r--r--hw/xfree86/modes/xf86Modes.c636
-rw-r--r--hw/xfree86/modes/xf86Modes.h70
-rw-r--r--hw/xfree86/modes/xf86RandR12.c2146
-rw-r--r--hw/xfree86/modes/xf86RandR12.h21
-rw-r--r--hw/xfree86/modes/xf86Rename.h2
-rw-r--r--hw/xfree86/modes/xf86Rotate.c658
-rw-r--r--hw/xfree86/modes/xf86cvt.c63
-rw-r--r--hw/xfree86/modes/xf86gtf.c84
-rw-r--r--hw/xfree86/os-support/bsd/alpha_video.c606
-rw-r--r--hw/xfree86/os-support/bsd/arm_video.c741
-rw-r--r--hw/xfree86/os-support/bsd/bsd_VTsw.c56
-rw-r--r--hw/xfree86/os-support/bsd/bsd_apm.c96
-rw-r--r--hw/xfree86/os-support/bsd/bsd_axp.c65
-rw-r--r--hw/xfree86/os-support/bsd/bsd_bell.c48
-rw-r--r--hw/xfree86/os-support/bsd/bsd_ev56.c30
-rw-r--r--hw/xfree86/os-support/bsd/bsd_init.c778
-rw-r--r--hw/xfree86/os-support/bsd/bsd_kmod.c7
-rw-r--r--hw/xfree86/os-support/bsd/bsd_kqueue_apm.c134
-rw-r--r--hw/xfree86/os-support/bsd/i386_video.c1113
-rw-r--r--hw/xfree86/os-support/bsd/memrange.h57
-rw-r--r--hw/xfree86/os-support/bsd/ppc_video.c105
-rw-r--r--hw/xfree86/os-support/bsd/sparc64_video.c40
-rw-r--r--hw/xfree86/os-support/bus/Pci.c2
-rw-r--r--hw/xfree86/os-support/bus/Pci.h5
-rw-r--r--hw/xfree86/os-support/bus/Sbus.c627
-rw-r--r--hw/xfree86/os-support/bus/nobus.c6
-rw-r--r--hw/xfree86/os-support/bus/xf86Pci.h11
-rw-r--r--hw/xfree86/os-support/bus/xf86Sbus.h2
-rw-r--r--hw/xfree86/os-support/hurd/hurd_init.c43
-rw-r--r--hw/xfree86/os-support/hurd/hurd_mmap.c84
-rw-r--r--hw/xfree86/os-support/hurd/hurd_video.c109
-rw-r--r--hw/xfree86/os-support/linux/int10/linux.c544
-rw-r--r--hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c390
-rw-r--r--hw/xfree86/os-support/linux/lnx_acpi.c118
-rw-r--r--hw/xfree86/os-support/linux/lnx_agp.c461
-rw-r--r--hw/xfree86/os-support/linux/lnx_apm.c153
-rw-r--r--hw/xfree86/os-support/linux/lnx_axp.c166
-rw-r--r--hw/xfree86/os-support/linux/lnx_bell.c2
-rw-r--r--hw/xfree86/os-support/linux/lnx_ev56.c30
-rw-r--r--hw/xfree86/os-support/linux/lnx_init.c343
-rw-r--r--hw/xfree86/os-support/linux/lnx_kmod.c127
-rw-r--r--hw/xfree86/os-support/linux/lnx_video.c808
-rw-r--r--hw/xfree86/os-support/misc/SlowBcopy.c87
-rw-r--r--hw/xfree86/os-support/shared/VTsw_noop.c8
-rw-r--r--hw/xfree86/os-support/shared/VTsw_usl.c34
-rw-r--r--hw/xfree86/os-support/shared/agp_noop.c23
-rw-r--r--hw/xfree86/os-support/shared/bios_mmap.c128
-rw-r--r--hw/xfree86/os-support/shared/ioperm_noop.c5
-rw-r--r--hw/xfree86/os-support/shared/kmod_noop.c5
-rw-r--r--hw/xfree86/os-support/shared/pm_noop.c4
-rw-r--r--hw/xfree86/os-support/shared/posix_tty.c847
-rw-r--r--hw/xfree86/os-support/shared/sigio.c300
-rw-r--r--hw/xfree86/os-support/shared/sigiostubs.c19
-rw-r--r--hw/xfree86/os-support/shared/vidmem.c317
-rw-r--r--hw/xfree86/os-support/shared/xf86Axp.c41
-rw-r--r--hw/xfree86/os-support/shared/xf86Axp.h37
-rw-r--r--hw/xfree86/os-support/solaris/sun_VTsw.c115
-rw-r--r--hw/xfree86/os-support/solaris/sun_agp.c389
-rw-r--r--hw/xfree86/os-support/solaris/sun_apm.c123
-rw-r--r--hw/xfree86/os-support/solaris/sun_bell.c43
-rw-r--r--hw/xfree86/os-support/solaris/sun_init.c502
-rw-r--r--hw/xfree86/os-support/solaris/sun_vid.c177
-rw-r--r--hw/xfree86/os-support/stub/stub_bios.c4
-rw-r--r--hw/xfree86/os-support/stub/stub_init.c2
-rw-r--r--hw/xfree86/os-support/stub/stub_video.c4
-rw-r--r--hw/xfree86/os-support/xf86OSpriv.h32
-rw-r--r--hw/xfree86/os-support/xf86_OSlib.h409
-rw-r--r--hw/xfree86/os-support/xf86_OSproc.h101
-rw-r--r--hw/xfree86/parser/Configint.h17
-rw-r--r--hw/xfree86/parser/DRI.c101
-rw-r--r--hw/xfree86/parser/Device.c531
-rw-r--r--hw/xfree86/parser/Extensions.c66
-rw-r--r--hw/xfree86/parser/Files.c299
-rw-r--r--hw/xfree86/parser/Flags.c649
-rw-r--r--hw/xfree86/parser/Input.c217
-rw-r--r--hw/xfree86/parser/InputClass.c24
-rw-r--r--hw/xfree86/parser/Layout.c838
-rw-r--r--hw/xfree86/parser/Module.c329
-rw-r--r--hw/xfree86/parser/Monitor.c1465
-rw-r--r--hw/xfree86/parser/Pointer.c290
-rw-r--r--hw/xfree86/parser/Screen.c874
-rw-r--r--hw/xfree86/parser/Vendor.c270
-rw-r--r--hw/xfree86/parser/Video.c346
-rw-r--r--hw/xfree86/parser/configProcs.h86
-rw-r--r--hw/xfree86/parser/read.c376
-rw-r--r--hw/xfree86/parser/scan.c1541
-rw-r--r--hw/xfree86/parser/write.c187
-rw-r--r--hw/xfree86/parser/xf86Optrec.h24
-rw-r--r--hw/xfree86/parser/xf86Parser.h721
-rw-r--r--hw/xfree86/parser/xf86tokens.h19
-rw-r--r--hw/xfree86/ramdac/BT.c158
-rw-r--r--hw/xfree86/ramdac/BT.h15
-rw-r--r--hw/xfree86/ramdac/BTPriv.h8
-rw-r--r--hw/xfree86/ramdac/IBM.c838
-rw-r--r--hw/xfree86/ramdac/IBM.h73
-rw-r--r--hw/xfree86/ramdac/IBMPriv.h22
-rw-r--r--hw/xfree86/ramdac/TI.c838
-rw-r--r--hw/xfree86/ramdac/TI.h41
-rw-r--r--hw/xfree86/ramdac/TIPriv.h6
-rw-r--r--hw/xfree86/ramdac/xf86Cursor.c366
-rw-r--r--hw/xfree86/ramdac/xf86Cursor.h21
-rw-r--r--hw/xfree86/ramdac/xf86CursorPriv.h45
-rw-r--r--hw/xfree86/ramdac/xf86HWCurs.c433
-rw-r--r--hw/xfree86/ramdac/xf86RamDac.c30
-rw-r--r--hw/xfree86/ramdac/xf86RamDac.h103
-rw-r--r--hw/xfree86/ramdac/xf86RamDacCmap.c24
-rw-r--r--hw/xfree86/ramdac/xf86RamDacPriv.h4
-rw-r--r--hw/xfree86/shadowfb/sfbmodule.c23
-rw-r--r--hw/xfree86/shadowfb/shadow.c2014
-rw-r--r--hw/xfree86/shadowfb/shadowfb.h18
-rw-r--r--hw/xfree86/utils/cvt/cvt.c100
-rw-r--r--hw/xfree86/utils/gtf/gtf.c324
-rw-r--r--hw/xfree86/vbe/vbe.c1032
-rw-r--r--hw/xfree86/vbe/vbe.h208
-rw-r--r--hw/xfree86/vbe/vbeModes.c520
-rw-r--r--hw/xfree86/vbe/vbeModes.h30
-rw-r--r--hw/xfree86/vbe/vbe_module.c7
-rw-r--r--hw/xfree86/vgahw/vgaCmap.c332
-rw-r--r--hw/xfree86/vgahw/vgaHW.c1385
-rw-r--r--hw/xfree86/vgahw/vgaHW.h184
-rw-r--r--hw/xfree86/vgahw/vgaHWmodule.c20
-rw-r--r--hw/xfree86/x86emu/debug.c507
-rw-r--r--hw/xfree86/x86emu/decode.c1068
-rw-r--r--hw/xfree86/x86emu/fpu.c449
-rw-r--r--hw/xfree86/x86emu/ops.c2873
-rw-r--r--hw/xfree86/x86emu/ops2.c1877
-rw-r--r--hw/xfree86/x86emu/prim_ops.c3147
-rw-r--r--hw/xfree86/x86emu/sys.c427
-rw-r--r--hw/xfree86/x86emu/validate.c50
-rw-r--r--hw/xfree86/x86emu/x86emu.h75
-rw-r--r--hw/xfree86/x86emu/x86emu/debug.h163
-rw-r--r--hw/xfree86/x86emu/x86emu/decode.h57
-rw-r--r--hw/xfree86/x86emu/x86emu/fpu.h23
-rw-r--r--hw/xfree86/x86emu/x86emu/fpu_regs.h44
-rw-r--r--hw/xfree86/x86emu/x86emu/ops.h6
-rw-r--r--hw/xfree86/x86emu/x86emu/prim_asm.h251
-rw-r--r--hw/xfree86/x86emu/x86emu/prim_ops.h189
-rw-r--r--hw/xfree86/x86emu/x86emu/prim_x86_gcc.h36
-rw-r--r--hw/xfree86/x86emu/x86emu/regs.h101
-rw-r--r--hw/xfree86/x86emu/x86emu/types.h23
-rw-r--r--hw/xfree86/x86emu/x86emu/x86emui.h34
-rw-r--r--hw/xfree86/xaa/xaa.h1872
-rw-r--r--hw/xfree86/xaa/xaaBitBlt.c246
-rw-r--r--hw/xfree86/xaa/xaaBitOrder.c8
-rw-r--r--hw/xfree86/xaa/xaaBitmap.c653
-rw-r--r--hw/xfree86/xaa/xaaCpyArea.c476
-rw-r--r--hw/xfree86/xaa/xaaCpyPlane.c286
-rw-r--r--hw/xfree86/xaa/xaaCpyWin.c46
-rw-r--r--hw/xfree86/xaa/xaaDashLine.c497
-rw-r--r--hw/xfree86/xaa/xaaFallback.c282
-rw-r--r--hw/xfree86/xaa/xaaFillArc.c163
-rw-r--r--hw/xfree86/xaa/xaaFillPoly.c1387
-rw-r--r--hw/xfree86/xaa/xaaFillRect.c1666
-rw-r--r--hw/xfree86/xaa/xaaGC.c710
-rw-r--r--hw/xfree86/xaa/xaaGCmisc.c709
-rw-r--r--hw/xfree86/xaa/xaaImage.c873
-rw-r--r--hw/xfree86/xaa/xaaInit.c652
-rw-r--r--hw/xfree86/xaa/xaaInitAccel.c2331
-rw-r--r--hw/xfree86/xaa/xaaLine.c614
-rw-r--r--hw/xfree86/xaa/xaaLineMisc.c165
-rw-r--r--hw/xfree86/xaa/xaaNonTEGlyph.c194
-rw-r--r--hw/xfree86/xaa/xaaNonTEText.c726
-rw-r--r--hw/xfree86/xaa/xaaOffscreen.c141
-rw-r--r--hw/xfree86/xaa/xaaOverlay.c81
-rw-r--r--hw/xfree86/xaa/xaaOverlayDF.c1135
-rw-r--r--hw/xfree86/xaa/xaaPCache.c4123
-rw-r--r--hw/xfree86/xaa/xaaPict.c863
-rw-r--r--hw/xfree86/xaa/xaaROP.c242
-rw-r--r--hw/xfree86/xaa/xaaRect.c149
-rw-r--r--hw/xfree86/xaa/xaaSpans.c1378
-rw-r--r--hw/xfree86/xaa/xaaStateChange.c2264
-rw-r--r--hw/xfree86/xaa/xaaStipple.c1197
-rw-r--r--hw/xfree86/xaa/xaaTEGlyph.c1382
-rw-r--r--hw/xfree86/xaa/xaaTEText.c338
-rw-r--r--hw/xfree86/xaa/xaaTables.c198
-rw-r--r--hw/xfree86/xaa/xaaWideLine.c1265
-rw-r--r--hw/xfree86/xaa/xaacexp.h95
-rw-r--r--hw/xfree86/xaa/xaalocal.h2582
-rw-r--r--hw/xfree86/xaa/xaarop.h10
-rw-r--r--hw/xfree86/xaa/xaawrap.h6
-rw-r--r--hw/xnest/Args.c262
-rw-r--r--hw/xnest/Args.h20
-rw-r--r--hw/xnest/Color.c676
-rw-r--r--hw/xnest/Color.h21
-rw-r--r--hw/xnest/Cursor.c193
-rw-r--r--hw/xnest/Display.c274
-rw-r--r--hw/xnest/Display.h8
-rw-r--r--hw/xnest/Drawable.h2
-rw-r--r--hw/xnest/Events.c261
-rw-r--r--hw/xnest/Events.h2
-rw-r--r--hw/xnest/Font.c70
-rw-r--r--hw/xnest/GC.c412
-rw-r--r--hw/xnest/GCOps.c323
-rw-r--r--hw/xnest/GCOps.h58
-rw-r--r--hw/xnest/Handlers.c6
-rw-r--r--hw/xnest/Handlers.h4
-rw-r--r--hw/xnest/Init.c117
-rw-r--r--hw/xnest/Init.h2
-rw-r--r--hw/xnest/Keyboard.c375
-rw-r--r--hw/xnest/Keyboard.h4
-rw-r--r--hw/xnest/Pixmap.c162
-rw-r--r--hw/xnest/Pointer.c89
-rw-r--r--hw/xnest/Pointer.h4
-rw-r--r--hw/xnest/Screen.c644
-rw-r--r--hw/xnest/Screen.h2
-rw-r--r--hw/xnest/Visual.c50
-rw-r--r--hw/xnest/Visual.h4
-rw-r--r--hw/xnest/Window.c740
-rw-r--r--hw/xnest/XNCursor.h25
-rw-r--r--hw/xnest/XNFont.h4
-rw-r--r--hw/xnest/XNGC.h5
-rw-r--r--hw/xnest/XNPixmap.h7
-rw-r--r--hw/xnest/XNWindow.h29
-rw-r--r--hw/xnest/Xnest.h8
-rw-r--r--hw/xnest/xnest-config.h2
-rw-r--r--hw/xquartz/GL/capabilities.c651
-rw-r--r--hw/xquartz/GL/capabilities.h2
-rw-r--r--hw/xquartz/GL/glcontextmodes.c586
-rw-r--r--hw/xquartz/GL/glcontextmodes.h34
-rw-r--r--hw/xquartz/GL/indirect.c459
-rw-r--r--hw/xquartz/GL/visualConfigs.c282
-rw-r--r--hw/xquartz/X11Application.h96
-rw-r--r--hw/xquartz/X11Application.m2004
-rw-r--r--hw/xquartz/X11Controller.h71
-rw-r--r--hw/xquartz/X11Controller.m1346
-rw-r--r--hw/xquartz/applewm.c301
-rw-r--r--hw/xquartz/applewmExt.h59
-rw-r--r--hw/xquartz/console_redirect.c222
-rw-r--r--hw/xquartz/darwin.c540
-rw-r--r--hw/xquartz/darwin.h49
-rw-r--r--hw/xquartz/darwinEvents.c569
-rw-r--r--hw/xquartz/darwinEvents.h49
-rw-r--r--hw/xquartz/darwinXinput.c27
-rw-r--r--hw/xquartz/darwinfb.h30
-rw-r--r--hw/xquartz/keysym2ucs.c1622
-rw-r--r--hw/xquartz/keysym2ucs.h2
-rw-r--r--hw/xquartz/mach-startup/bundle-main.c496
-rw-r--r--hw/xquartz/mach-startup/launchd_fd.c56
-rw-r--r--hw/xquartz/mach-startup/launchd_fd.h2
-rw-r--r--hw/xquartz/mach-startup/mach_startup_types.h2
-rw-r--r--hw/xquartz/mach-startup/stub.c210
-rw-r--r--hw/xquartz/pbproxy/app-main.m62
-rw-r--r--hw/xquartz/pbproxy/main.m87
-rw-r--r--hw/xquartz/pbproxy/pbproxy.h24
-rw-r--r--hw/xquartz/pbproxy/trick_autotools.c6
-rw-r--r--hw/xquartz/pbproxy/x-input.m176
-rw-r--r--hw/xquartz/pbproxy/x-selection.h66
-rw-r--r--hw/xquartz/pbproxy/x-selection.m1747
-rw-r--r--hw/xquartz/pseudoramiX.c270
-rw-r--r--hw/xquartz/quartz.c220
-rw-r--r--hw/xquartz/quartz.h54
-rw-r--r--hw/xquartz/quartzCocoa.m15
-rw-r--r--hw/xquartz/quartzCommon.h10
-rw-r--r--hw/xquartz/quartzKeyboard.c771
-rw-r--r--hw/xquartz/quartzKeyboard.h8
-rw-r--r--hw/xquartz/quartzRandR.c393
-rw-r--r--hw/xquartz/quartzRandR.h15
-rw-r--r--hw/xquartz/quartzStartup.c55
-rw-r--r--hw/xquartz/sanitizedCarbon.h4
-rw-r--r--hw/xquartz/sanitizedCocoa.h4
-rw-r--r--hw/xquartz/xpr/appledri.c211
-rw-r--r--hw/xquartz/xpr/appledri.h61
-rw-r--r--hw/xquartz/xpr/appledristr.h309
-rw-r--r--hw/xquartz/xpr/dri.c549
-rw-r--r--hw/xquartz/xpr/dri.h58
-rw-r--r--hw/xquartz/xpr/driWrap.c275
-rw-r--r--hw/xquartz/xpr/driWrap.h2
-rw-r--r--hw/xquartz/xpr/dristruct.h31
-rw-r--r--hw/xquartz/xpr/x-hash.c188
-rw-r--r--hw/xquartz/xpr/x-hash.h64
-rw-r--r--hw/xquartz/xpr/x-hook.c73
-rw-r--r--hw/xquartz/xpr/x-hook.h14
-rw-r--r--hw/xquartz/xpr/x-list.c164
-rw-r--r--hw/xquartz/xpr/x-list.h54
-rw-r--r--hw/xquartz/xpr/xpr.h11
-rw-r--r--hw/xquartz/xpr/xprAppleWM.c71
-rw-r--r--hw/xquartz/xpr/xprCursor.c101
-rw-r--r--hw/xquartz/xpr/xprEvent.c39
-rw-r--r--hw/xquartz/xpr/xprEvent.h2
-rw-r--r--hw/xquartz/xpr/xprFrame.c224
-rw-r--r--hw/xquartz/xpr/xprScreen.c268
-rw-r--r--hw/xwin/InitInput.c92
-rw-r--r--hw/xwin/InitOutput.c1104
-rw-r--r--hw/xwin/ddraw.h2158
-rw-r--r--hw/xwin/glx/glwindows.h20
-rw-r--r--hw/xwin/glx/glwrap.c84
-rw-r--r--hw/xwin/glx/indirect.c2688
-rw-r--r--hw/xwin/glx/wgl_ext_api.h40
-rw-r--r--hw/xwin/glx/winpriv.c58
-rw-r--r--hw/xwin/win.h990
-rw-r--r--hw/xwin/winallpriv.c162
-rw-r--r--hw/xwin/winauth.c164
-rw-r--r--hw/xwin/winblock.c77
-rw-r--r--hw/xwin/winclip.c6
-rw-r--r--hw/xwin/winclipboard.h44
-rw-r--r--hw/xwin/winclipboardinit.c137
-rw-r--r--hw/xwin/winclipboardtextconv.c166
-rw-r--r--hw/xwin/winclipboardthread.c688
-rw-r--r--hw/xwin/winclipboardunicode.c32
-rw-r--r--hw/xwin/winclipboardwndproc.c870
-rw-r--r--hw/xwin/winclipboardwrappers.c557
-rw-r--r--hw/xwin/winclipboardxevents.c1379
-rw-r--r--hw/xwin/wincmap.c809
-rw-r--r--hw/xwin/winconfig.c1515
-rw-r--r--hw/xwin/winconfig.h448
-rw-r--r--hw/xwin/wincreatewnd.c906
-rw-r--r--hw/xwin/wincursor.c864
-rw-r--r--hw/xwin/windialogs.c977
-rw-r--r--hw/xwin/winengine.c408
-rw-r--r--hw/xwin/winerror.c114
-rw-r--r--hw/xwin/winfillsp.c1535
-rw-r--r--hw/xwin/winfont.c50
-rw-r--r--hw/xwin/wingc.c199
-rw-r--r--hw/xwin/wingetsp.c217
-rw-r--r--hw/xwin/winglobals.c96
-rw-r--r--hw/xwin/winglobals.h57
-rw-r--r--hw/xwin/winkeybd.c643
-rw-r--r--hw/xwin/winkeybd.h520
-rw-r--r--hw/xwin/winkeyhook.c189
-rw-r--r--hw/xwin/winkeynames.h40
-rw-r--r--hw/xwin/winlayouts.h96
-rw-r--r--hw/xwin/winmessages.h2051
-rw-r--r--hw/xwin/winmisc.c121
-rw-r--r--hw/xwin/winmonitors.c33
-rw-r--r--hw/xwin/winmonitors.h12
-rw-r--r--hw/xwin/winmouse.c458
-rw-r--r--hw/xwin/winms.h2
-rw-r--r--hw/xwin/winmsg.c167
-rw-r--r--hw/xwin/winmsg.h19
-rw-r--r--hw/xwin/winmultiwindowclass.c436
-rw-r--r--hw/xwin/winmultiwindowclass.h79
-rw-r--r--hw/xwin/winmultiwindowicons.c1043
-rw-r--r--hw/xwin/winmultiwindowshape.c259
-rw-r--r--hw/xwin/winmultiwindowwindow.c1289
-rw-r--r--hw/xwin/winmultiwindowwm.c2408
-rw-r--r--hw/xwin/winmultiwindowwndproc.c1746
-rw-r--r--hw/xwin/winnativegdi.c629
-rw-r--r--hw/xwin/winpfbdd.c976
-rw-r--r--hw/xwin/winpixmap.c211
-rw-r--r--hw/xwin/winpolyline.c24
-rw-r--r--hw/xwin/winprefs.c1157
-rw-r--r--hw/xwin/winprefs.h159
-rw-r--r--hw/xwin/winprocarg.c1762
-rw-r--r--hw/xwin/winrandr.c228
-rw-r--r--hw/xwin/winregistry.c44
-rw-r--r--hw/xwin/winresource.h2
-rw-r--r--hw/xwin/winrop.c134
-rw-r--r--hw/xwin/winscrinit.c1082
-rw-r--r--hw/xwin/winsetsp.c239
-rw-r--r--hw/xwin/winshaddd.c1838
-rw-r--r--hw/xwin/winshadddnl.c1898
-rw-r--r--hw/xwin/winshadgdi.c1630
-rw-r--r--hw/xwin/wintrayicon.c235
-rw-r--r--hw/xwin/winvalargs.c210
-rw-r--r--hw/xwin/winvideo.c95
-rw-r--r--hw/xwin/winwakeup.c28
-rw-r--r--hw/xwin/winwin32rootless.c1427
-rw-r--r--hw/xwin/winwin32rootlesswindow.c583
-rw-r--r--hw/xwin/winwin32rootlesswndproc.c1929
-rw-r--r--hw/xwin/winwindow.c719
-rw-r--r--hw/xwin/winwindow.h84
-rw-r--r--hw/xwin/winwindowswm.c789
-rw-r--r--hw/xwin/winwndproc.c2029
-rw-r--r--include/XIstubs.h27
-rw-r--r--include/Xprintf.h46
-rw-r--r--include/callback.h38
-rw-r--r--include/client.h13
-rw-r--r--include/closestr.h107
-rw-r--r--include/closure.h13
-rw-r--r--include/colormap.h207
-rw-r--r--include/colormapst.h74
-rw-r--r--include/cursor.h130
-rw-r--r--include/cursorstr.h29
-rw-r--r--include/dix.h725
-rw-r--r--include/dixaccess.h58
-rw-r--r--include/dixevents.h72
-rw-r--r--include/dixfont.h187
-rw-r--r--include/dixfontstr.h6
-rw-r--r--include/dixgrabs.h45
-rw-r--r--include/dixstruct.h165
-rw-r--r--include/eventconvert.h2
-rw-r--r--include/events.h2
-rw-r--r--include/eventstr.h57
-rw-r--r--include/exevents.h403
-rw-r--r--include/extension.h11
-rw-r--r--include/extinit.h16
-rw-r--r--include/extnsionst.h62
-rw-r--r--include/gc.h140
-rw-r--r--include/gcstruct.h434
-rw-r--r--include/globals.h4
-rw-r--r--include/hotplug.h2
-rw-r--r--include/input.h699
-rw-r--r--include/inputstr.h556
-rw-r--r--include/inpututils.h23
-rw-r--r--include/list.h15
-rw-r--r--include/misc.h93
-rw-r--r--include/miscstruct.h11
-rw-r--r--include/opaque.h6
-rw-r--r--include/optionstr.h3
-rw-r--r--include/os.h578
-rw-r--r--include/pixmap.h41
-rw-r--r--include/pixmapstr.h41
-rw-r--r--include/privates.h80
-rw-r--r--include/property.h72
-rw-r--r--include/propertyst.h20
-rw-r--r--include/ptrveloc.h71
-rw-r--r--include/region.h3
-rw-r--r--include/regionstr.h183
-rw-r--r--include/registry.h8
-rw-r--r--include/resource.h181
-rw-r--r--include/rgb.h7
-rw-r--r--include/screenint.h21
-rw-r--r--include/scrnintstr.h798
-rw-r--r--include/selection.h17
-rw-r--r--include/servermd.h142
-rw-r--r--include/site.h9
-rw-r--r--include/swaprep.h430
-rw-r--r--include/swapreq.h8
-rw-r--r--include/validate.h2
-rw-r--r--include/window.h302
-rw-r--r--include/windowstr.h123
-rw-r--r--include/xkbfile.h354
-rw-r--r--include/xkbrules.h105
-rw-r--r--include/xkbsrv.h1468
-rw-r--r--include/xkbstr.h763
-rw-r--r--include/xserver-properties.h2
-rw-r--r--mi/mi.h827
-rw-r--r--mi/miarc.c5238
-rw-r--r--mi/mibitblt.c853
-rw-r--r--mi/mibstore.c2
-rw-r--r--mi/mibstore.h2
-rw-r--r--mi/micmap.c685
-rw-r--r--mi/micmap.h32
-rw-r--r--mi/micoord.h2
-rw-r--r--mi/micopy.c449
-rw-r--r--mi/micursor.c3
-rw-r--r--mi/midash.c40
-rw-r--r--mi/midispcur.c548
-rw-r--r--mi/mieq.c348
-rw-r--r--mi/miexpose.c759
-rw-r--r--mi/mifillarc.c900
-rw-r--r--mi/mifillarc.h31
-rw-r--r--mi/mifillrct.c93
-rw-r--r--mi/mifpoly.h40
-rw-r--r--mi/mifpolycon.c207
-rw-r--r--mi/migc.c307
-rw-r--r--mi/migc.h64
-rw-r--r--mi/miglblt.c186
-rw-r--r--mi/miinitext.c260
-rw-r--r--mi/miline.h49
-rw-r--r--mi/mioverlay.c2466
-rw-r--r--mi/mioverlay.h24
-rw-r--r--mi/mipointer.c319
-rw-r--r--mi/mipointer.h175
-rw-r--r--mi/mipointrst.h31
-rw-r--r--mi/mipoly.c77
-rw-r--r--mi/mipoly.h80
-rw-r--r--mi/mipolycon.c98
-rw-r--r--mi/mipolygen.c101
-rw-r--r--mi/mipolypnt.c87
-rw-r--r--mi/mipolyrect.c198
-rw-r--r--mi/mipolyseg.c12
-rw-r--r--mi/mipolytext.c62
-rw-r--r--mi/mipolyutil.c88
-rw-r--r--mi/mipushpxl.c274
-rw-r--r--mi/miscanfill.h13
-rw-r--r--mi/miscrinit.c199
-rw-r--r--mi/mispans.c719
-rw-r--r--mi/mispans.h45
-rw-r--r--mi/misprite.c700
-rw-r--r--mi/misprite.h8
-rw-r--r--mi/mistruct.h17
-rw-r--r--mi/mivalidate.h14
-rw-r--r--mi/mivaltree.c895
-rw-r--r--mi/miwideline.c3144
-rw-r--r--mi/miwideline.h81
-rw-r--r--mi/miwindow.c958
-rw-r--r--mi/mizerarc.c1127
-rw-r--r--mi/mizerarc.h10
-rw-r--r--mi/mizerclip.c370
-rw-r--r--mi/mizerline.c389
-rw-r--r--miext/cw/cw.c355
-rw-r--r--miext/cw/cw.h82
-rw-r--r--miext/cw/cw_ops.c223
-rw-r--r--miext/cw/cw_render.c378
-rw-r--r--miext/damage/damage.c2479
-rw-r--r--miext/damage/damage.h85
-rw-r--r--miext/damage/damagestr.h72
-rw-r--r--miext/rootless/rootless.h81
-rw-r--r--miext/rootless/rootlessCommon.c188
-rw-r--r--miext/rootless/rootlessCommon.h46
-rw-r--r--miext/rootless/rootlessConfig.h22
-rw-r--r--miext/rootless/rootlessGC.c427
-rw-r--r--miext/rootless/rootlessScreen.c233
-rw-r--r--miext/rootless/rootlessValTree.c589
-rw-r--r--miext/rootless/rootlessWindow.c387
-rw-r--r--miext/rootless/rootlessWindow.h15
-rw-r--r--miext/shadow/shadow.c92
-rw-r--r--miext/shadow/shadow.h114
-rw-r--r--miext/shadow/shalloc.c9
-rw-r--r--miext/shadow/shpacked.c128
-rw-r--r--miext/shadow/shplanar.c162
-rw-r--r--miext/shadow/shplanar8.c151
-rw-r--r--miext/shadow/shrotate.c425
-rw-r--r--miext/shadow/shrotpack.h111
-rw-r--r--miext/shadow/shrotpackYX.h151
-rw-r--r--miext/sync/misync.c81
-rw-r--r--miext/sync/misync.h52
-rw-r--r--miext/sync/misyncstr.h56
-rw-r--r--os/WaitFor.c607
-rw-r--r--os/access.c2000
-rw-r--r--os/auth.c323
-rw-r--r--os/backtrace.c235
-rw-r--r--os/client.c120
-rw-r--r--os/connection.c1045
-rw-r--r--os/io.c1201
-rw-r--r--os/log.c306
-rw-r--r--os/mitauth.c151
-rw-r--r--os/oscolor.c3058
-rw-r--r--os/osdep.h116
-rw-r--r--os/osinit.c285
-rw-r--r--os/rpcauth.c113
-rw-r--r--os/strcasecmp.c4
-rw-r--r--os/strcasestr.c28
-rw-r--r--os/strlcat.c41
-rw-r--r--os/strlcpy.c35
-rw-r--r--os/strndup.c18
-rw-r--r--os/utils.c1666
-rw-r--r--os/xdmauth.c516
-rw-r--r--os/xdmcp.c1644
-rw-r--r--os/xprintf.c41
-rw-r--r--os/xsha1.c79
-rw-r--r--os/xstrans.c4
-rw-r--r--randr/randr.c394
-rw-r--r--randr/randrstr.h681
-rw-r--r--randr/rrcrtc.c1504
-rw-r--r--randr/rrdispatch.c347
-rw-r--r--randr/rrinfo.c310
-rw-r--r--randr/rrmode.c385
-rw-r--r--randr/rroutput.c527
-rw-r--r--randr/rrpointer.c151
-rw-r--r--randr/rrproperty.c775
-rw-r--r--randr/rrscreen.c1321
-rw-r--r--randr/rrsdispatch.c184
-rw-r--r--randr/rrtransform.c368
-rw-r--r--randr/rrtransform.h53
-rw-r--r--randr/rrxinerama.c311
-rw-r--r--record/record.c2758
-rw-r--r--record/set.c338
-rw-r--r--record/set.h38
-rw-r--r--render/animcur.c386
-rw-r--r--render/filter.c339
-rw-r--r--render/glyph.c894
-rw-r--r--render/glyphstr.h91
-rw-r--r--render/matrix.c18
-rw-r--r--render/miindex.c432
-rw-r--r--render/mipict.c786
-rw-r--r--render/mipict.h153
-rw-r--r--render/mirect.c237
-rw-r--r--render/mitrap.c58
-rw-r--r--render/mitri.c43
-rw-r--r--render/picture.c2023
-rw-r--r--render/picture.h115
-rw-r--r--render/picturestr.h702
-rw-r--r--render/render.c3784
-rw-r--r--test/ddxstubs.c48
-rw-r--r--test/fixes.c53
-rw-r--r--test/input.c445
-rw-r--r--test/list.c110
-rw-r--r--test/misc.c10
-rw-r--r--test/string.c13
-rw-r--r--test/touch.c30
-rw-r--r--test/xfree86.c17
-rw-r--r--test/xi2/protocol-common.c92
-rw-r--r--test/xi2/protocol-common.h24
-rw-r--r--test/xi2/protocol-eventconvert.c453
-rw-r--r--test/xi2/protocol-xigetclientpointer.c27
-rw-r--r--test/xi2/protocol-xigetselectedevents.c88
-rw-r--r--test/xi2/protocol-xipassivegrabdevice.c91
-rw-r--r--test/xi2/protocol-xiquerydevice.c339
-rw-r--r--test/xi2/protocol-xiquerypointer.c45
-rw-r--r--test/xi2/protocol-xiqueryversion.c27
-rw-r--r--test/xi2/protocol-xiselectevents.c130
-rw-r--r--test/xi2/protocol-xisetclientpointer.c23
-rw-r--r--test/xi2/protocol-xiwarppointer.c40
-rw-r--r--test/xi2/xi2.c16
-rw-r--r--test/xkb.c17
-rw-r--r--test/xtest.c27
-rw-r--r--xfixes/cursor.c1165
-rw-r--r--xfixes/region.c758
-rw-r--r--xfixes/saveset.c32
-rw-r--r--xfixes/select.c302
-rw-r--r--xfixes/xfixes.c260
-rw-r--r--xfixes/xfixes.h17
-rw-r--r--xfixes/xfixesint.h174
-rw-r--r--xkb/XKBAlloc.c412
-rw-r--r--xkb/XKBGAlloc.c1044
-rw-r--r--xkb/XKBMAlloc.c1481
-rw-r--r--xkb/XKBMisc.c1354
-rw-r--r--xkb/ddxBeep.c455
-rw-r--r--xkb/ddxCtrls.c32
-rw-r--r--xkb/ddxKillSrv.c2
-rw-r--r--xkb/ddxLEDs.c40
-rw-r--r--xkb/ddxList.c350
-rw-r--r--xkb/ddxLoad.c384
-rw-r--r--xkb/ddxPrivate.c2
-rw-r--r--xkb/ddxVT.c2
-rw-r--r--xkb/maprules.c1340
-rw-r--r--xkb/xkb.c9037
-rw-r--r--xkb/xkbAccessX.c872
-rw-r--r--xkb/xkbActions.c2063
-rw-r--r--xkb/xkbDflts.h780
-rw-r--r--xkb/xkbEvents.c1199
-rw-r--r--xkb/xkbInit.c588
-rw-r--r--xkb/xkbLEDs.c1497
-rw-r--r--xkb/xkbPrKeyEv.c151
-rw-r--r--xkb/xkbSwap.c188
-rw-r--r--xkb/xkbUtils.c1292
-rw-r--r--xkb/xkbfmisc.c624
-rw-r--r--xkb/xkbgeom.h829
-rw-r--r--xkb/xkbout.c1551
-rw-r--r--xkb/xkbtext.c1883
-rw-r--r--xkb/xkmread.c1831
1258 files changed, 264651 insertions, 259934 deletions
diff --git a/Xext/bigreq.c b/Xext/bigreq.c
index a939e1699..49355c4a4 100644
--- a/Xext/bigreq.c
+++ b/Xext/bigreq.c
@@ -43,16 +43,16 @@ from The Open Group.
void BigReqExtensionInit(INITARGS);
static int
-ProcBigReqDispatch (ClientPtr client)
+ProcBigReqDispatch(ClientPtr client)
{
REQUEST(xBigReqEnableReq);
xBigReqEnableReply rep;
if (client->swapped) {
- swaps(&stuff->length);
+ swaps(&stuff->length);
}
if (stuff->brReqType != X_BigReqEnable)
- return BadRequest;
+ return BadRequest;
REQUEST_SIZE_MATCH(xBigReqEnableReq);
client->big_requests = TRUE;
memset(&rep, 0, sizeof(xBigReqEnableReply));
@@ -61,10 +61,10 @@ ProcBigReqDispatch (ClientPtr client)
rep.sequenceNumber = client->sequence;
rep.max_request_size = maxBigRequestSize;
if (client->swapped) {
- swaps(&rep.sequenceNumber);
- swapl(&rep.max_request_size);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.max_request_size);
}
- WriteToClient(client, sizeof(xBigReqEnableReply), (char *)&rep);
+ WriteToClient(client, sizeof(xBigReqEnableReply), (char *) &rep);
return Success;
}
@@ -72,6 +72,6 @@ void
BigReqExtensionInit(INITARGS)
{
AddExtension(XBigReqExtensionName, 0, 0,
- ProcBigReqDispatch, ProcBigReqDispatch,
- NULL, StandardMinorOpcode);
+ ProcBigReqDispatch, ProcBigReqDispatch,
+ NULL, StandardMinorOpcode);
}
diff --git a/Xext/dpms.c b/Xext/dpms.c
index 0c8f18f47..348c87289 100644
--- a/Xext/dpms.c
+++ b/Xext/dpms.c
@@ -55,11 +55,11 @@ ProcDPMSGetVersion(ClientPtr client)
rep.majorVersion = DPMSMajorVersion;
rep.minorVersion = DPMSMinorVersion;
if (client->swapped) {
- swaps(&rep.sequenceNumber);
- swaps(&rep.majorVersion);
- swaps(&rep.minorVersion);
+ swaps(&rep.sequenceNumber);
+ swaps(&rep.majorVersion);
+ swaps(&rep.minorVersion);
}
- WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *)&rep);
+ WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *) &rep);
return Success;
}
@@ -77,9 +77,9 @@ ProcDPMSCapable(ClientPtr client)
rep.capable = DPMSCapableFlag;
if (client->swapped) {
- swaps(&rep.sequenceNumber);
+ swaps(&rep.sequenceNumber);
}
- WriteToClient(client, sizeof(xDPMSCapableReply), (char *)&rep);
+ WriteToClient(client, sizeof(xDPMSCapableReply), (char *) &rep);
return Success;
}
@@ -99,12 +99,12 @@ ProcDPMSGetTimeouts(ClientPtr client)
rep.off = DPMSOffTime / MILLI_PER_SECOND;
if (client->swapped) {
- swaps(&rep.sequenceNumber);
- swaps(&rep.standby);
- swaps(&rep.suspend);
- swaps(&rep.off);
+ swaps(&rep.sequenceNumber);
+ swaps(&rep.standby);
+ swaps(&rep.suspend);
+ swaps(&rep.off);
}
- WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *)&rep);
+ WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *) &rep);
return Success;
}
@@ -115,16 +115,14 @@ ProcDPMSSetTimeouts(ClientPtr client)
REQUEST_SIZE_MATCH(xDPMSSetTimeoutsReq);
- if ((stuff->off != 0)&&(stuff->off < stuff->suspend))
- {
- client->errorValue = stuff->off;
- return BadValue;
+ if ((stuff->off != 0) && (stuff->off < stuff->suspend)) {
+ client->errorValue = stuff->off;
+ return BadValue;
+ }
+ if ((stuff->suspend != 0) && (stuff->suspend < stuff->standby)) {
+ client->errorValue = stuff->suspend;
+ return BadValue;
}
- if ((stuff->suspend != 0)&&(stuff->suspend < stuff->standby))
- {
- client->errorValue = stuff->suspend;
- return BadValue;
- }
DPMSStandbyTime = stuff->standby * MILLI_PER_SECOND;
DPMSSuspendTime = stuff->suspend * MILLI_PER_SECOND;
@@ -142,9 +140,9 @@ ProcDPMSEnable(ClientPtr client)
REQUEST_SIZE_MATCH(xDPMSEnableReq);
if (DPMSCapableFlag) {
- DPMSEnabled = TRUE;
- if (!was_enabled)
- SetScreenSaverTimer();
+ DPMSEnabled = TRUE;
+ if (!was_enabled)
+ SetScreenSaverTimer();
}
return Success;
@@ -172,14 +170,13 @@ ProcDPMSForceLevel(ClientPtr client)
REQUEST_SIZE_MATCH(xDPMSForceLevelReq);
if (!DPMSEnabled)
- return BadMatch;
+ return BadMatch;
if (stuff->level != DPMSModeOn &&
stuff->level != DPMSModeStandby &&
- stuff->level != DPMSModeSuspend &&
- stuff->level != DPMSModeOff) {
- client->errorValue = stuff->level;
- return BadValue;
+ stuff->level != DPMSModeSuspend && stuff->level != DPMSModeOff) {
+ client->errorValue = stuff->level;
+ return BadValue;
}
DPMSSet(client, stuff->level);
@@ -202,38 +199,37 @@ ProcDPMSInfo(ClientPtr client)
rep.state = DPMSEnabled;
if (client->swapped) {
- swaps(&rep.sequenceNumber);
- swaps(&rep.power_level);
+ swaps(&rep.sequenceNumber);
+ swaps(&rep.power_level);
}
- WriteToClient(client, sizeof(xDPMSInfoReply), (char *)&rep);
+ WriteToClient(client, sizeof(xDPMSInfoReply), (char *) &rep);
return Success;
}
static int
-ProcDPMSDispatch (ClientPtr client)
+ProcDPMSDispatch(ClientPtr client)
{
REQUEST(xReq);
- switch (stuff->data)
- {
+ switch (stuff->data) {
case X_DPMSGetVersion:
- return ProcDPMSGetVersion(client);
+ return ProcDPMSGetVersion(client);
case X_DPMSCapable:
- return ProcDPMSCapable(client);
+ return ProcDPMSCapable(client);
case X_DPMSGetTimeouts:
- return ProcDPMSGetTimeouts(client);
+ return ProcDPMSGetTimeouts(client);
case X_DPMSSetTimeouts:
- return ProcDPMSSetTimeouts(client);
+ return ProcDPMSSetTimeouts(client);
case X_DPMSEnable:
- return ProcDPMSEnable(client);
+ return ProcDPMSEnable(client);
case X_DPMSDisable:
- return ProcDPMSDisable(client);
+ return ProcDPMSDisable(client);
case X_DPMSForceLevel:
- return ProcDPMSForceLevel(client);
+ return ProcDPMSForceLevel(client);
case X_DPMSInfo:
- return ProcDPMSInfo(client);
+ return ProcDPMSInfo(client);
default:
- return BadRequest;
+ return BadRequest;
}
}
@@ -332,29 +328,28 @@ SProcDPMSInfo(ClientPtr client)
}
static int
-SProcDPMSDispatch (ClientPtr client)
+SProcDPMSDispatch(ClientPtr client)
{
REQUEST(xReq);
- switch (stuff->data)
- {
+ switch (stuff->data) {
case X_DPMSGetVersion:
- return SProcDPMSGetVersion(client);
+ return SProcDPMSGetVersion(client);
case X_DPMSCapable:
- return SProcDPMSCapable(client);
+ return SProcDPMSCapable(client);
case X_DPMSGetTimeouts:
- return SProcDPMSGetTimeouts(client);
+ return SProcDPMSGetTimeouts(client);
case X_DPMSSetTimeouts:
- return SProcDPMSSetTimeouts(client);
+ return SProcDPMSSetTimeouts(client);
case X_DPMSEnable:
- return SProcDPMSEnable(client);
+ return SProcDPMSEnable(client);
case X_DPMSDisable:
- return SProcDPMSDisable(client);
+ return SProcDPMSDisable(client);
case X_DPMSForceLevel:
- return SProcDPMSForceLevel(client);
+ return SProcDPMSForceLevel(client);
case X_DPMSInfo:
- return SProcDPMSInfo(client);
+ return SProcDPMSInfo(client);
default:
- return BadRequest;
+ return BadRequest;
}
}
@@ -362,6 +357,6 @@ void
DPMSExtensionInit(INITARGS)
{
AddExtension(DPMSExtensionName, 0, 0,
- ProcDPMSDispatch, SProcDPMSDispatch,
- NULL, StandardMinorOpcode);
+ ProcDPMSDispatch, SProcDPMSDispatch,
+ NULL, StandardMinorOpcode);
}
diff --git a/Xext/dpmsproc.h b/Xext/dpmsproc.h
index c1df56fdf..7494dfd6f 100644
--- a/Xext/dpmsproc.h
+++ b/Xext/dpmsproc.h
@@ -9,7 +9,7 @@
#include "dixstruct.h"
-int DPMSSet(ClientPtr client, int level);
+int DPMSSet(ClientPtr client, int level);
Bool DPMSSupported(void);
#endif
diff --git a/Xext/dpmsstubs.c b/Xext/dpmsstubs.c
index f0f54d293..80f13f5df 100644
--- a/Xext/dpmsstubs.c
+++ b/Xext/dpmsstubs.c
@@ -34,12 +34,14 @@ Equipment Corporation.
#define FALSE 0
-Bool DPMSSupported(void)
+Bool
+DPMSSupported(void)
{
return FALSE;
}
-int DPMSSet(ClientPtr client, int level)
+int
+DPMSSet(ClientPtr client, int level)
{
return Success;
}
diff --git a/Xext/geext.c b/Xext/geext.c
index a8718ccbd..07028238e 100644
--- a/Xext/geext.c
+++ b/Xext/geext.c
@@ -35,18 +35,18 @@
DevPrivateKeyRec GEClientPrivateKeyRec;
-int RT_GECLIENT = 0;
+int RT_GECLIENT = 0;
GEExtension GEExtensions[MAXEXTENSIONS];
/* Major available requests */
static const int version_requests[] = {
- X_GEQueryVersion, /* before client sends QueryVersion */
- X_GEQueryVersion, /* must be set to last request in version 1 */
+ X_GEQueryVersion, /* before client sends QueryVersion */
+ X_GEQueryVersion, /* must be set to last request in version 1 */
};
/* Forward declarations */
-static void SGEGenericEvent(xEvent* from, xEvent* to);
+static void SGEGenericEvent(xEvent *from, xEvent *to);
#define NUM_VERSION_REQUESTS (sizeof (version_requests) / sizeof (version_requests[0]))
#define EXT_MASK(ext) ((ext) & 0x7F)
@@ -60,6 +60,7 @@ ProcGEQueryVersion(ClientPtr client)
{
GEClientInfoPtr pGEClient = GEGetClient(client);
xGEQueryVersionReply rep;
+
REQUEST(xGEQueryVersionReq);
REQUEST_SIZE_MATCH(xGEQueryVersionReq);
@@ -77,22 +78,20 @@ ProcGEQueryVersion(ClientPtr client)
pGEClient->major_version = stuff->majorVersion;
pGEClient->minor_version = stuff->minorVersion;
- if (client->swapped)
- {
- swaps(&rep.sequenceNumber);
- swapl(&rep.length);
- swaps(&rep.majorVersion);
- swaps(&rep.minorVersion);
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swaps(&rep.majorVersion);
+ swaps(&rep.minorVersion);
}
- WriteToClient(client, sizeof(xGEQueryVersionReply), (char*)&rep);
+ WriteToClient(client, sizeof(xGEQueryVersionReply), (char *) &rep);
return Success;
}
-int (*ProcGEVector[GENumberRequests])(ClientPtr) = {
+int (*ProcGEVector[GENumberRequests]) (ClientPtr) = {
/* Version 1.0 */
- ProcGEQueryVersion
-};
+ProcGEQueryVersion};
/************************************************************/
/* swapped request handlers */
@@ -106,14 +105,12 @@ SProcGEQueryVersion(ClientPtr client)
REQUEST_SIZE_MATCH(xGEQueryVersionReq);
swaps(&stuff->majorVersion);
swaps(&stuff->minorVersion);
- return(*ProcGEVector[stuff->ReqType])(client);
+ return (*ProcGEVector[stuff->ReqType]) (client);
}
-int (*SProcGEVector[GENumberRequests])(ClientPtr) = {
+int (*SProcGEVector[GENumberRequests]) (ClientPtr) = {
/* Version 1.0 */
- SProcGEQueryVersion
-};
-
+SProcGEQueryVersion};
/************************************************************/
/* callbacks */
@@ -124,6 +121,7 @@ static int
ProcGEDispatch(ClientPtr client)
{
GEClientInfoPtr pGEClient = GEGetClient(client);
+
REQUEST(xGEReq);
if (pGEClient->major_version >= NUM_VERSION_REQUESTS)
@@ -131,7 +129,7 @@ ProcGEDispatch(ClientPtr client)
if (stuff->ReqType > version_requests[pGEClient->major_version])
return BadRequest;
- return (ProcGEVector[stuff->ReqType])(client);
+ return (ProcGEVector[stuff->ReqType]) (client);
}
/* dispatch swapped requests */
@@ -141,7 +139,7 @@ SProcGEDispatch(ClientPtr client)
REQUEST(xGEReq);
if (stuff->ReqType >= GENumberRequests)
return BadRequest;
- return (*SProcGEVector[stuff->ReqType])(client);
+ return (*SProcGEVector[stuff->ReqType]) (client);
}
/**
@@ -151,13 +149,11 @@ SProcGEDispatch(ClientPtr client)
* used in the furture for versioning support.
*/
static void
-GEClientCallback(CallbackListPtr *list,
- pointer closure,
- pointer data)
+GEClientCallback(CallbackListPtr *list, pointer closure, pointer data)
{
- NewClientInfoRec *clientinfo = (NewClientInfoRec *) data;
- ClientPtr pClient = clientinfo->client;
- GEClientInfoPtr pGEClient = GEGetClient(pClient);
+ NewClientInfoRec *clientinfo = (NewClientInfoRec *) data;
+ ClientPtr pClient = clientinfo->client;
+ GEClientInfoPtr pGEClient = GEGetClient(pClient);
pGEClient->major_version = 0;
pGEClient->minor_version = 0;
@@ -165,7 +161,7 @@ GEClientCallback(CallbackListPtr *list,
/* Reset extension. Called on server shutdown. */
static void
-GEResetProc(ExtensionEntry *extEntry)
+GEResetProc(ExtensionEntry * extEntry)
{
DeleteCallback(&ClientStateCallback, GEClientCallback, 0);
EventSwapVector[GenericEvent] = NotImplemented;
@@ -179,13 +175,12 @@ GEResetProc(ExtensionEntry *extEntry)
* work.
*/
static void
-SGEGenericEvent(xEvent* from, xEvent* to)
+SGEGenericEvent(xEvent *from, xEvent *to)
{
- xGenericEvent* gefrom = (xGenericEvent*)from;
- xGenericEvent* geto = (xGenericEvent*)to;
+ xGenericEvent *gefrom = (xGenericEvent *) from;
+ xGenericEvent *geto = (xGenericEvent *) to;
- if ((gefrom->extension & 0x7f) > MAXEXTENSIONS)
- {
+ if ((gefrom->extension & 0x7f) > MAXEXTENSIONS) {
ErrorF("GE: Invalid extension offset for event.\n");
return;
}
@@ -203,23 +198,23 @@ GEExtensionInit(void)
{
ExtensionEntry *extEntry;
- if (!dixRegisterPrivateKey(&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec)))
+ if (!dixRegisterPrivateKey
+ (&GEClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(GEClientInfoRec)))
FatalError("GEExtensionInit: GE private request failed.\n");
- if(!AddCallback(&ClientStateCallback, GEClientCallback, 0))
- {
+ if (!AddCallback(&ClientStateCallback, GEClientCallback, 0)) {
FatalError("GEExtensionInit: register client callback failed.\n");
}
- if((extEntry = AddExtension(GE_NAME,
- 0, GENumberErrors,
- ProcGEDispatch, SProcGEDispatch,
- GEResetProc, StandardMinorOpcode)) != 0)
- {
+ if ((extEntry = AddExtension(GE_NAME,
+ 0, GENumberErrors,
+ ProcGEDispatch, SProcGEDispatch,
+ GEResetProc, StandardMinorOpcode)) != 0) {
memset(GEExtensions, 0, sizeof(GEExtensions));
EventSwapVector[GenericEvent] = (EventSwapPtr) SGEGenericEvent;
- } else {
+ }
+ else {
FatalError("GEInit: AddExtensions failed.\n");
}
@@ -238,24 +233,22 @@ GEExtensionInit(void)
*/
void
GERegisterExtension(int extension,
- void (*ev_swap)(xGenericEvent* from, xGenericEvent* to))
+ void (*ev_swap) (xGenericEvent *from, xGenericEvent *to))
{
- if (EXT_MASK(extension) >= MAXEXTENSIONS)
+ if (EXT_MASK(extension) >= MAXEXTENSIONS)
FatalError("GE: extension > MAXEXTENSIONS. This should not happen.\n");
/* extension opcodes are > 128, might as well save some space here */
GEExtensions[EXT_MASK(extension)].evswap = ev_swap;
}
-
/* Sets type and extension field for a generic event. This is just an
* auxiliary function, extensions could do it manually too.
*/
void
-GEInitEvent(xGenericEvent* ev, int extension)
+GEInitEvent(xGenericEvent *ev, int extension)
{
ev->type = GenericEvent;
ev->extension = extension;
ev->length = 0;
}
-
diff --git a/Xext/geext.h b/Xext/geext.h
index 8e6dbeb24..d2a15dcb9 100644
--- a/Xext/geext.h
+++ b/Xext/geext.h
@@ -37,10 +37,9 @@ from the author.
/** Struct to keep information about registered extensions */
typedef struct _GEExtension {
/** Event swapping routine */
- void (*evswap)(xGenericEvent* from, xGenericEvent* to);
+ void (*evswap) (xGenericEvent *from, xGenericEvent *to);
} GEExtension, *GEExtensionPtr;
-
/* All registered extensions and their handling functions. */
extern _X_EXPORT GEExtension GEExtensions[MAXEXTENSIONS];
@@ -70,14 +69,15 @@ extern _X_EXPORT GEExtension GEExtensions[MAXEXTENSIONS];
GEEXT(ev) == (ext) && \
GEV(ev)->evtype == (ev_type))
-
/* Interface for other extensions */
-extern _X_EXPORT void GERegisterExtension(
- int extension,
- void (*ev_dispatch)(xGenericEvent* from, xGenericEvent* to));
+extern _X_EXPORT void GERegisterExtension(int extension,
+ void (*ev_dispatch) (xGenericEvent
+ *from,
+ xGenericEvent
+ *to));
-extern _X_EXPORT void GEInitEvent(xGenericEvent* ev, int extension);
+extern _X_EXPORT void GEInitEvent(xGenericEvent *ev, int extension);
extern _X_EXPORT void GEExtensionInit(void);
-#endif /* _GEEXT_H_ */
+#endif /* _GEEXT_H_ */
diff --git a/Xext/geint.h b/Xext/geint.h
index 3e2b8e187..f76d14809 100644
--- a/Xext/geint.h
+++ b/Xext/geint.h
@@ -38,16 +38,17 @@
#include <X11/extensions/geproto.h>
extern _X_EXPORT DevPrivateKeyRec GEClientPrivateKeyRec;
+
#define GEClientPrivateKey (&GEClientPrivateKeyRec)
typedef struct _GEClientInfo {
- CARD32 major_version;
- CARD32 minor_version;
+ CARD32 major_version;
+ CARD32 minor_version;
} GEClientInfoRec, *GEClientInfoPtr;
#define GEGetClient(pClient) ((GEClientInfoPtr)(dixLookupPrivate(&((pClient)->devPrivates), GEClientPrivateKey)))
-extern _X_EXPORT int (*ProcGEVector[/*GENumRequests*/])(ClientPtr);
-extern _X_EXPORT int (*SProcGEVector[/*GENumRequests*/])(ClientPtr);
+extern _X_EXPORT int (*ProcGEVector[ /*GENumRequests */ ]) (ClientPtr);
+extern _X_EXPORT int (*SProcGEVector[ /*GENumRequests */ ]) (ClientPtr);
-#endif /* _GEINT_H_ */
+#endif /* _GEINT_H_ */
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index fae7c81c9..98d327f26 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -64,24 +64,23 @@ Equipment Corporation.
#ifdef GLXPROXY
extern VisualPtr glxMatchVisual(ScreenPtr pScreen,
- VisualPtr pVisual,
- ScreenPtr pMatchScreen);
+ VisualPtr pVisual, ScreenPtr pMatchScreen);
#endif
/*
* PanoramiX data declarations
*/
-int PanoramiXPixWidth = 0;
-int PanoramiXPixHeight = 0;
-int PanoramiXNumScreens = 0;
+int PanoramiXPixWidth = 0;
+int PanoramiXPixHeight = 0;
+int PanoramiXNumScreens = 0;
-static RegionRec PanoramiXScreenRegion = {{0, 0, 0, 0}, NULL};
+static RegionRec PanoramiXScreenRegion = { {0, 0, 0, 0}, NULL };
-static int PanoramiXNumDepths;
-static DepthPtr PanoramiXDepths;
-static int PanoramiXNumVisuals;
-static VisualPtr PanoramiXVisuals;
+static int PanoramiXNumDepths;
+static DepthPtr PanoramiXDepths;
+static int PanoramiXNumVisuals;
+static VisualPtr PanoramiXVisuals;
RESTYPE XRC_DRAWABLE;
RESTYPE XRT_WINDOW;
@@ -97,9 +96,9 @@ XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr = &VisualsEqual;
*/
static int panoramiXGeneration;
-static int ProcPanoramiXDispatch(ClientPtr client);
+static int ProcPanoramiXDispatch(ClientPtr client);
-static void PanoramiXResetProc(ExtensionEntry*);
+static void PanoramiXResetProc(ExtensionEntry *);
/*
* External references for functions and data variables
@@ -107,22 +106,25 @@ static void PanoramiXResetProc(ExtensionEntry*);
#include "panoramiXh.h"
-int (* SavedProcVector[256]) (ClientPtr client) = { NULL, };
+int (*SavedProcVector[256]) (ClientPtr client) = {
+NULL,};
static DevPrivateKeyRec PanoramiXGCKeyRec;
+
#define PanoramiXGCKey (&PanoramiXGCKeyRec)
static DevPrivateKeyRec PanoramiXScreenKeyRec;
+
#define PanoramiXScreenKey (&PanoramiXScreenKeyRec)
typedef struct {
- DDXPointRec clipOrg;
- DDXPointRec patOrg;
- GCFuncs *wrapFuncs;
+ DDXPointRec clipOrg;
+ DDXPointRec patOrg;
+ GCFuncs *wrapFuncs;
} PanoramiXGCRec, *PanoramiXGCPtr;
typedef struct {
- CreateGCProcPtr CreateGC;
- CloseScreenProcPtr CloseScreen;
+ CreateGCProcPtr CreateGC;
+ CloseScreenProcPtr CloseScreen;
} PanoramiXScreenRec, *PanoramiXScreenPtr;
static void XineramaValidateGC(GCPtr, unsigned long, DrawablePtr);
@@ -147,18 +149,17 @@ static GCFuncs XineramaGCFuncs = {
pGCPriv->wrapFuncs = (pGC)->funcs;\
(pGC)->funcs = &XineramaGCFuncs;
-
static Bool
-XineramaCloseScreen (int i, ScreenPtr pScreen)
+XineramaCloseScreen(int i, ScreenPtr pScreen)
{
PanoramiXScreenPtr pScreenPriv = (PanoramiXScreenPtr)
- dixLookupPrivate(&pScreen->devPrivates, PanoramiXScreenKey);
+ dixLookupPrivate(&pScreen->devPrivates, PanoramiXScreenKey);
pScreen->CloseScreen = pScreenPriv->CloseScreen;
pScreen->CreateGC = pScreenPriv->CreateGC;
if (pScreen->myNum == 0)
- RegionUninit(&PanoramiXScreenRegion);
+ RegionUninit(&PanoramiXScreenRegion);
free((pointer) pScreenPriv);
@@ -170,21 +171,21 @@ XineramaCreateGC(GCPtr pGC)
{
ScreenPtr pScreen = pGC->pScreen;
PanoramiXScreenPtr pScreenPriv = (PanoramiXScreenPtr)
- dixLookupPrivate(&pScreen->devPrivates, PanoramiXScreenKey);
+ dixLookupPrivate(&pScreen->devPrivates, PanoramiXScreenKey);
Bool ret;
pScreen->CreateGC = pScreenPriv->CreateGC;
- if((ret = (*pScreen->CreateGC)(pGC))) {
- PanoramiXGCPtr pGCPriv = (PanoramiXGCPtr)
- dixLookupPrivate(&pGC->devPrivates, PanoramiXGCKey);
+ if ((ret = (*pScreen->CreateGC) (pGC))) {
+ PanoramiXGCPtr pGCPriv = (PanoramiXGCPtr)
+ dixLookupPrivate(&pGC->devPrivates, PanoramiXGCKey);
- pGCPriv->wrapFuncs = pGC->funcs;
+ pGCPriv->wrapFuncs = pGC->funcs;
pGC->funcs = &XineramaGCFuncs;
- pGCPriv->clipOrg.x = pGC->clipOrg.x;
- pGCPriv->clipOrg.y = pGC->clipOrg.y;
- pGCPriv->patOrg.x = pGC->patOrg.x;
- pGCPriv->patOrg.y = pGC->patOrg.y;
+ pGCPriv->clipOrg.x = pGC->clipOrg.x;
+ pGCPriv->clipOrg.y = pGC->clipOrg.y;
+ pGCPriv->patOrg.x = pGC->patOrg.x;
+ pGCPriv->patOrg.y = pGC->patOrg.y;
}
pScreen->CreateGC = XineramaCreateGC;
@@ -192,139 +193,129 @@ XineramaCreateGC(GCPtr pGC)
}
static void
-XineramaValidateGC(
- GCPtr pGC,
- unsigned long changes,
- DrawablePtr pDraw
-){
- Xinerama_GC_FUNC_PROLOGUE (pGC);
-
- if((pDraw->type == DRAWABLE_WINDOW) && !(((WindowPtr)pDraw)->parent)) {
- /* the root window */
- int x_off = pGC->pScreen->x;
- int y_off = pGC->pScreen->y;
- int new_val;
-
- new_val = pGCPriv->clipOrg.x - x_off;
- if(pGC->clipOrg.x != new_val) {
- pGC->clipOrg.x = new_val;
- changes |= GCClipXOrigin;
- }
- new_val = pGCPriv->clipOrg.y - y_off;
- if(pGC->clipOrg.y != new_val) {
- pGC->clipOrg.y = new_val;
- changes |= GCClipYOrigin;
- }
- new_val = pGCPriv->patOrg.x - x_off;
- if(pGC->patOrg.x != new_val) {
- pGC->patOrg.x = new_val;
- changes |= GCTileStipXOrigin;
- }
- new_val = pGCPriv->patOrg.y - y_off;
- if(pGC->patOrg.y != new_val) {
- pGC->patOrg.y = new_val;
- changes |= GCTileStipYOrigin;
- }
- } else {
- if(pGC->clipOrg.x != pGCPriv->clipOrg.x) {
- pGC->clipOrg.x = pGCPriv->clipOrg.x;
- changes |= GCClipXOrigin;
- }
- if(pGC->clipOrg.y != pGCPriv->clipOrg.y) {
- pGC->clipOrg.y = pGCPriv->clipOrg.y;
- changes |= GCClipYOrigin;
- }
- if(pGC->patOrg.x != pGCPriv->patOrg.x) {
- pGC->patOrg.x = pGCPriv->patOrg.x;
- changes |= GCTileStipXOrigin;
- }
- if(pGC->patOrg.y != pGCPriv->patOrg.y) {
- pGC->patOrg.y = pGCPriv->patOrg.y;
- changes |= GCTileStipYOrigin;
- }
+XineramaValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw)
+{
+ Xinerama_GC_FUNC_PROLOGUE(pGC);
+
+ if ((pDraw->type == DRAWABLE_WINDOW) && !(((WindowPtr) pDraw)->parent)) {
+ /* the root window */
+ int x_off = pGC->pScreen->x;
+ int y_off = pGC->pScreen->y;
+ int new_val;
+
+ new_val = pGCPriv->clipOrg.x - x_off;
+ if (pGC->clipOrg.x != new_val) {
+ pGC->clipOrg.x = new_val;
+ changes |= GCClipXOrigin;
+ }
+ new_val = pGCPriv->clipOrg.y - y_off;
+ if (pGC->clipOrg.y != new_val) {
+ pGC->clipOrg.y = new_val;
+ changes |= GCClipYOrigin;
+ }
+ new_val = pGCPriv->patOrg.x - x_off;
+ if (pGC->patOrg.x != new_val) {
+ pGC->patOrg.x = new_val;
+ changes |= GCTileStipXOrigin;
+ }
+ new_val = pGCPriv->patOrg.y - y_off;
+ if (pGC->patOrg.y != new_val) {
+ pGC->patOrg.y = new_val;
+ changes |= GCTileStipYOrigin;
+ }
+ }
+ else {
+ if (pGC->clipOrg.x != pGCPriv->clipOrg.x) {
+ pGC->clipOrg.x = pGCPriv->clipOrg.x;
+ changes |= GCClipXOrigin;
+ }
+ if (pGC->clipOrg.y != pGCPriv->clipOrg.y) {
+ pGC->clipOrg.y = pGCPriv->clipOrg.y;
+ changes |= GCClipYOrigin;
+ }
+ if (pGC->patOrg.x != pGCPriv->patOrg.x) {
+ pGC->patOrg.x = pGCPriv->patOrg.x;
+ changes |= GCTileStipXOrigin;
+ }
+ if (pGC->patOrg.y != pGCPriv->patOrg.y) {
+ pGC->patOrg.y = pGCPriv->patOrg.y;
+ changes |= GCTileStipYOrigin;
+ }
}
-
- (*pGC->funcs->ValidateGC)(pGC, changes, pDraw);
- Xinerama_GC_FUNC_EPILOGUE (pGC);
+
+ (*pGC->funcs->ValidateGC) (pGC, changes, pDraw);
+ Xinerama_GC_FUNC_EPILOGUE(pGC);
}
static void
XineramaDestroyGC(GCPtr pGC)
{
- Xinerama_GC_FUNC_PROLOGUE (pGC);
- (*pGC->funcs->DestroyGC)(pGC);
- Xinerama_GC_FUNC_EPILOGUE (pGC);
+ Xinerama_GC_FUNC_PROLOGUE(pGC);
+ (*pGC->funcs->DestroyGC) (pGC);
+ Xinerama_GC_FUNC_EPILOGUE(pGC);
}
static void
-XineramaChangeGC (
- GCPtr pGC,
- unsigned long mask
-){
- Xinerama_GC_FUNC_PROLOGUE (pGC);
-
- if(mask & GCTileStipXOrigin)
- pGCPriv->patOrg.x = pGC->patOrg.x;
- if(mask & GCTileStipYOrigin)
- pGCPriv->patOrg.y = pGC->patOrg.y;
- if(mask & GCClipXOrigin)
- pGCPriv->clipOrg.x = pGC->clipOrg.x;
- if(mask & GCClipYOrigin)
- pGCPriv->clipOrg.y = pGC->clipOrg.y;
+XineramaChangeGC(GCPtr pGC, unsigned long mask)
+{
+ Xinerama_GC_FUNC_PROLOGUE(pGC);
+
+ if (mask & GCTileStipXOrigin)
+ pGCPriv->patOrg.x = pGC->patOrg.x;
+ if (mask & GCTileStipYOrigin)
+ pGCPriv->patOrg.y = pGC->patOrg.y;
+ if (mask & GCClipXOrigin)
+ pGCPriv->clipOrg.x = pGC->clipOrg.x;
+ if (mask & GCClipYOrigin)
+ pGCPriv->clipOrg.y = pGC->clipOrg.y;
(*pGC->funcs->ChangeGC) (pGC, mask);
- Xinerama_GC_FUNC_EPILOGUE (pGC);
+ Xinerama_GC_FUNC_EPILOGUE(pGC);
}
static void
-XineramaCopyGC (
- GCPtr pGCSrc,
- unsigned long mask,
- GCPtr pGCDst
-){
+XineramaCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst)
+{
PanoramiXGCPtr pSrcPriv = (PanoramiXGCPtr)
- dixLookupPrivate(&pGCSrc->devPrivates, PanoramiXGCKey);
- Xinerama_GC_FUNC_PROLOGUE (pGCDst);
+ dixLookupPrivate(&pGCSrc->devPrivates, PanoramiXGCKey);
- if(mask & GCTileStipXOrigin)
+ Xinerama_GC_FUNC_PROLOGUE(pGCDst);
+
+ if (mask & GCTileStipXOrigin)
pGCPriv->patOrg.x = pSrcPriv->patOrg.x;
- if(mask & GCTileStipYOrigin)
+ if (mask & GCTileStipYOrigin)
pGCPriv->patOrg.y = pSrcPriv->patOrg.y;
- if(mask & GCClipXOrigin)
+ if (mask & GCClipXOrigin)
pGCPriv->clipOrg.x = pSrcPriv->clipOrg.x;
- if(mask & GCClipYOrigin)
+ if (mask & GCClipYOrigin)
pGCPriv->clipOrg.y = pSrcPriv->clipOrg.y;
(*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
- Xinerama_GC_FUNC_EPILOGUE (pGCDst);
+ Xinerama_GC_FUNC_EPILOGUE(pGCDst);
}
static void
-XineramaChangeClip (
- GCPtr pGC,
- int type,
- pointer pvalue,
- int nrects
-){
- Xinerama_GC_FUNC_PROLOGUE (pGC);
+XineramaChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects)
+{
+ Xinerama_GC_FUNC_PROLOGUE(pGC);
(*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
- Xinerama_GC_FUNC_EPILOGUE (pGC);
+ Xinerama_GC_FUNC_EPILOGUE(pGC);
}
static void
XineramaCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
{
- Xinerama_GC_FUNC_PROLOGUE (pgcDst);
- (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
- Xinerama_GC_FUNC_EPILOGUE (pgcDst);
+ Xinerama_GC_FUNC_PROLOGUE(pgcDst);
+ (*pgcDst->funcs->CopyClip) (pgcDst, pgcSrc);
+ Xinerama_GC_FUNC_EPILOGUE(pgcDst);
}
static void
XineramaDestroyClip(GCPtr pGC)
{
- Xinerama_GC_FUNC_PROLOGUE (pGC);
- (* pGC->funcs->DestroyClip)(pGC);
- Xinerama_GC_FUNC_EPILOGUE (pGC);
+ Xinerama_GC_FUNC_PROLOGUE(pGC);
+ (*pGC->funcs->DestroyClip) (pGC);
+ Xinerama_GC_FUNC_EPILOGUE(pGC);
}
int
@@ -335,16 +326,16 @@ XineramaDeleteResource(pointer data, XID id)
}
typedef struct {
- int screen;
- int id;
-} PanoramiXSearchData;
+ int screen;
+ int id;
+} PanoramiXSearchData;
-static Bool
+static Bool
XineramaFindIDByScrnum(pointer resource, XID id, pointer privdata)
{
- PanoramiXRes *res = (PanoramiXRes*)resource;
- PanoramiXSearchData *data = (PanoramiXSearchData*)privdata;
-
+ PanoramiXRes *res = (PanoramiXRes *) resource;
+ PanoramiXSearchData *data = (PanoramiXSearchData *) privdata;
+
return res->info[data->screen].id == data->id;
}
@@ -354,32 +345,32 @@ PanoramiXFindIDByScrnum(RESTYPE type, XID id, int screen)
PanoramiXSearchData data;
pointer val;
- if(!screen) {
- dixLookupResourceByType(&val, id, type, serverClient, DixReadAccess);
- return val;
+ if (!screen) {
+ dixLookupResourceByType(&val, id, type, serverClient, DixReadAccess);
+ return val;
}
data.screen = screen;
data.id = id;
return LookupClientResourceComplex(clients[CLIENT_ID(id)], type,
- XineramaFindIDByScrnum, &data);
+ XineramaFindIDByScrnum, &data);
}
typedef struct _connect_callback_list {
- void (*func)(void);
+ void (*func) (void);
struct _connect_callback_list *next;
} XineramaConnectionCallbackList;
static XineramaConnectionCallbackList *ConnectionCallbackList = NULL;
Bool
-XineramaRegisterConnectionBlockCallback(void (*func)(void))
+XineramaRegisterConnectionBlockCallback(void (*func) (void))
{
XineramaConnectionCallbackList *newlist;
- if(!(newlist = malloc(sizeof(XineramaConnectionCallbackList))))
- return FALSE;
+ if (!(newlist = malloc(sizeof(XineramaConnectionCallbackList))))
+ return FALSE;
newlist->next = ConnectionCallbackList;
newlist->func = func;
@@ -388,44 +379,48 @@ XineramaRegisterConnectionBlockCallback(void (*func)(void))
return TRUE;
}
-static void XineramaInitData(void)
+static void
+XineramaInitData(void)
{
int i, w, h;
RegionNull(&PanoramiXScreenRegion);
FOR_NSCREENS(i) {
- BoxRec TheBox;
- RegionRec ScreenRegion;
+ BoxRec TheBox;
+ RegionRec ScreenRegion;
- ScreenPtr pScreen = screenInfo.screens[i];
+ ScreenPtr pScreen = screenInfo.screens[i];
- TheBox.x1 = pScreen->x;
- TheBox.x2 = TheBox.x1 + pScreen->width;
- TheBox.y1 = pScreen->y;
- TheBox.y2 = TheBox.y1 + pScreen->height;
+ TheBox.x1 = pScreen->x;
+ TheBox.x2 = TheBox.x1 + pScreen->width;
+ TheBox.y1 = pScreen->y;
+ TheBox.y2 = TheBox.y1 + pScreen->height;
- RegionInit(&ScreenRegion, &TheBox, 1);
- RegionUnion(&PanoramiXScreenRegion, &PanoramiXScreenRegion,
- &ScreenRegion);
- RegionUninit(&ScreenRegion);
+ RegionInit(&ScreenRegion, &TheBox, 1);
+ RegionUnion(&PanoramiXScreenRegion, &PanoramiXScreenRegion,
+ &ScreenRegion);
+ RegionUninit(&ScreenRegion);
}
PanoramiXPixWidth = screenInfo.screens[0]->x + screenInfo.screens[0]->width;
- PanoramiXPixHeight = screenInfo.screens[0]->y + screenInfo.screens[0]->height;
+ PanoramiXPixHeight =
+ screenInfo.screens[0]->y + screenInfo.screens[0]->height;
FOR_NSCREENS_FORWARD_SKIP(i) {
- ScreenPtr pScreen = screenInfo.screens[i];
- w = pScreen->x + pScreen->width;
- h = pScreen->y + pScreen->height;
-
- if (PanoramiXPixWidth < w)
- PanoramiXPixWidth = w;
- if (PanoramiXPixHeight < h)
- PanoramiXPixHeight = h;
+ ScreenPtr pScreen = screenInfo.screens[i];
+
+ w = pScreen->x + pScreen->width;
+ h = pScreen->y + pScreen->height;
+
+ if (PanoramiXPixWidth < w)
+ PanoramiXPixWidth = w;
+ if (PanoramiXPixHeight < h)
+ PanoramiXPixHeight = h;
}
}
-void XineramaReinitData(void)
+void
+XineramaReinitData(void)
{
RegionUninit(&PanoramiXScreenRegion);
XineramaInitData();
@@ -436,103 +431,104 @@ void XineramaReinitData(void)
* Called from InitExtensions in main().
* Register PanoramiXeen Extension
* Initialize global variables.
- */
+ */
-void PanoramiXExtensionInit(int argc, char *argv[])
+void
+PanoramiXExtensionInit(int argc, char *argv[])
{
- int i;
- Bool success = FALSE;
- ExtensionEntry *extEntry;
- ScreenPtr pScreen = screenInfo.screens[0];
- PanoramiXScreenPtr pScreenPriv;
+ int i;
+ Bool success = FALSE;
+ ExtensionEntry *extEntry;
+ ScreenPtr pScreen = screenInfo.screens[0];
+ PanoramiXScreenPtr pScreenPriv;
- if (noPanoramiXExtension)
- return;
+ if (noPanoramiXExtension)
+ return;
if (!dixRegisterPrivateKey(&PanoramiXScreenKeyRec, PRIVATE_SCREEN, 0)) {
- noPanoramiXExtension = TRUE;
- return;
+ noPanoramiXExtension = TRUE;
+ return;
}
- if (!dixRegisterPrivateKey(&PanoramiXGCKeyRec, PRIVATE_GC, sizeof(PanoramiXGCRec))) {
- noPanoramiXExtension = TRUE;
- return;
+ if (!dixRegisterPrivateKey
+ (&PanoramiXGCKeyRec, PRIVATE_GC, sizeof(PanoramiXGCRec))) {
+ noPanoramiXExtension = TRUE;
+ return;
}
PanoramiXNumScreens = screenInfo.numScreens;
- if (PanoramiXNumScreens == 1) { /* Only 1 screen */
- noPanoramiXExtension = TRUE;
- return;
+ if (PanoramiXNumScreens == 1) { /* Only 1 screen */
+ noPanoramiXExtension = TRUE;
+ return;
}
while (panoramiXGeneration != serverGeneration) {
- extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0,0,
- ProcPanoramiXDispatch,
- SProcPanoramiXDispatch, PanoramiXResetProc,
- StandardMinorOpcode);
- if (!extEntry)
- break;
-
- /*
- * First make sure all the basic allocations succeed. If not,
- * run in non-PanoramiXeen mode.
- */
-
- FOR_NSCREENS(i) {
- pScreen = screenInfo.screens[i];
- pScreenPriv = malloc(sizeof(PanoramiXScreenRec));
- dixSetPrivate(&pScreen->devPrivates, PanoramiXScreenKey,
- pScreenPriv);
- if(!pScreenPriv) {
- noPanoramiXExtension = TRUE;
- return;
- }
-
- pScreenPriv->CreateGC = pScreen->CreateGC;
- pScreenPriv->CloseScreen = pScreen->CloseScreen;
-
- pScreen->CreateGC = XineramaCreateGC;
- pScreen->CloseScreen = XineramaCloseScreen;
- }
-
- XRC_DRAWABLE = CreateNewResourceClass();
- XRT_WINDOW = CreateNewResourceType(XineramaDeleteResource,
- "XineramaWindow");
- if (XRT_WINDOW)
- XRT_WINDOW |= XRC_DRAWABLE;
- XRT_PIXMAP = CreateNewResourceType(XineramaDeleteResource,
- "XineramaPixmap");
- if (XRT_PIXMAP)
- XRT_PIXMAP |= XRC_DRAWABLE;
- XRT_GC = CreateNewResourceType(XineramaDeleteResource,
- "XineramaGC");
- XRT_COLORMAP = CreateNewResourceType(XineramaDeleteResource,
- "XineramaColormap");
-
- if (XRT_WINDOW && XRT_PIXMAP && XRT_GC && XRT_COLORMAP) {
- panoramiXGeneration = serverGeneration;
- success = TRUE;
- }
- SetResourceTypeErrorValue(XRT_WINDOW, BadWindow);
- SetResourceTypeErrorValue(XRT_PIXMAP, BadPixmap);
- SetResourceTypeErrorValue(XRT_GC, BadGC);
- SetResourceTypeErrorValue(XRT_COLORMAP, BadColor);
+ extEntry = AddExtension(PANORAMIX_PROTOCOL_NAME, 0, 0,
+ ProcPanoramiXDispatch,
+ SProcPanoramiXDispatch, PanoramiXResetProc,
+ StandardMinorOpcode);
+ if (!extEntry)
+ break;
+
+ /*
+ * First make sure all the basic allocations succeed. If not,
+ * run in non-PanoramiXeen mode.
+ */
+
+ FOR_NSCREENS(i) {
+ pScreen = screenInfo.screens[i];
+ pScreenPriv = malloc(sizeof(PanoramiXScreenRec));
+ dixSetPrivate(&pScreen->devPrivates, PanoramiXScreenKey,
+ pScreenPriv);
+ if (!pScreenPriv) {
+ noPanoramiXExtension = TRUE;
+ return;
+ }
+
+ pScreenPriv->CreateGC = pScreen->CreateGC;
+ pScreenPriv->CloseScreen = pScreen->CloseScreen;
+
+ pScreen->CreateGC = XineramaCreateGC;
+ pScreen->CloseScreen = XineramaCloseScreen;
+ }
+
+ XRC_DRAWABLE = CreateNewResourceClass();
+ XRT_WINDOW = CreateNewResourceType(XineramaDeleteResource,
+ "XineramaWindow");
+ if (XRT_WINDOW)
+ XRT_WINDOW |= XRC_DRAWABLE;
+ XRT_PIXMAP = CreateNewResourceType(XineramaDeleteResource,
+ "XineramaPixmap");
+ if (XRT_PIXMAP)
+ XRT_PIXMAP |= XRC_DRAWABLE;
+ XRT_GC = CreateNewResourceType(XineramaDeleteResource, "XineramaGC");
+ XRT_COLORMAP = CreateNewResourceType(XineramaDeleteResource,
+ "XineramaColormap");
+
+ if (XRT_WINDOW && XRT_PIXMAP && XRT_GC && XRT_COLORMAP) {
+ panoramiXGeneration = serverGeneration;
+ success = TRUE;
+ }
+ SetResourceTypeErrorValue(XRT_WINDOW, BadWindow);
+ SetResourceTypeErrorValue(XRT_PIXMAP, BadPixmap);
+ SetResourceTypeErrorValue(XRT_GC, BadGC);
+ SetResourceTypeErrorValue(XRT_COLORMAP, BadColor);
}
if (!success) {
- noPanoramiXExtension = TRUE;
- ErrorF(PANORAMIX_PROTOCOL_NAME " extension failed to initialize\n");
- return;
+ noPanoramiXExtension = TRUE;
+ ErrorF(PANORAMIX_PROTOCOL_NAME " extension failed to initialize\n");
+ return;
}
-
+
XineramaInitData();
/*
- * Put our processes into the ProcVector
+ * Put our processes into the ProcVector
*/
- for (i = 256; i--; )
- SavedProcVector[i] = ProcVector[i];
+ for (i = 256; i--;)
+ SavedProcVector[i] = ProcVector[i];
ProcVector[X_CreateWindow] = PanoramiXCreateWindow;
ProcVector[X_ChangeWindowAttributes] = PanoramiXChangeWindowAttributes;
@@ -586,19 +582,20 @@ void PanoramiXExtensionInit(int argc, char *argv[])
ProcVector[X_StoreColors] = PanoramiXStoreColors;
ProcVector[X_StoreNamedColor] = PanoramiXStoreNamedColor;
- PanoramiXRenderInit ();
+ PanoramiXRenderInit();
#ifdef XFIXES
- PanoramiXFixesInit ();
+ PanoramiXFixesInit();
#endif
#ifdef COMPOSITE
- PanoramiXCompositeInit ();
+ PanoramiXCompositeInit();
#endif
}
extern Bool CreateConnectionBlock(void);
-Bool PanoramiXCreateConnectionBlock(void)
+Bool
+PanoramiXCreateConnectionBlock(void)
{
int i, j, length;
Bool disableBackingStore = FALSE;
@@ -611,40 +608,41 @@ Bool PanoramiXCreateConnectionBlock(void)
ScreenPtr pScreen;
/*
- * Do normal CreateConnectionBlock but faking it for only one screen
+ * Do normal CreateConnectionBlock but faking it for only one screen
*/
- if(!PanoramiXNumDepths) {
- ErrorF("Xinerama error: No common visuals\n");
- return FALSE;
+ if (!PanoramiXNumDepths) {
+ ErrorF("Xinerama error: No common visuals\n");
+ return FALSE;
}
- for(i = 1; i < screenInfo.numScreens; i++) {
- pScreen = screenInfo.screens[i];
- if(pScreen->rootDepth != screenInfo.screens[0]->rootDepth) {
- ErrorF("Xinerama error: Root window depths differ\n");
- return FALSE;
- }
- if(pScreen->backingStoreSupport != screenInfo.screens[0]->backingStoreSupport)
- disableBackingStore = TRUE;
+ for (i = 1; i < screenInfo.numScreens; i++) {
+ pScreen = screenInfo.screens[i];
+ if (pScreen->rootDepth != screenInfo.screens[0]->rootDepth) {
+ ErrorF("Xinerama error: Root window depths differ\n");
+ return FALSE;
+ }
+ if (pScreen->backingStoreSupport !=
+ screenInfo.screens[0]->backingStoreSupport)
+ disableBackingStore = TRUE;
}
if (disableBackingStore) {
- for (i = 0; i < screenInfo.numScreens; i++) {
- pScreen = screenInfo.screens[i];
- pScreen->backingStoreSupport = NotUseful;
- }
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ pScreen = screenInfo.screens[i];
+ pScreen->backingStoreSupport = NotUseful;
+ }
}
i = screenInfo.numScreens;
screenInfo.numScreens = 1;
if (!CreateConnectionBlock()) {
- screenInfo.numScreens = i;
- return FALSE;
+ screenInfo.numScreens = i;
+ return FALSE;
}
screenInfo.numScreens = i;
-
+
root = (xWindowRoot *) (ConnectionInfo + connBlockScreenStart);
length = connBlockScreenStart + sizeof(xWindowRoot);
@@ -652,42 +650,40 @@ Bool PanoramiXCreateConnectionBlock(void)
root->nDepths = PanoramiXNumDepths;
for (i = 0; i < PanoramiXNumDepths; i++) {
- depth = (xDepth *) (ConnectionInfo + length);
- depth->depth = PanoramiXDepths[i].depth;
- depth->nVisuals = PanoramiXDepths[i].numVids;
- length += sizeof(xDepth);
- visual = (xVisualType *)(ConnectionInfo + length);
-
- for (j = 0; j < depth->nVisuals; j++, visual++) {
- visual->visualID = PanoramiXDepths[i].vids[j];
-
- for (pVisual = PanoramiXVisuals;
- pVisual->vid != visual->visualID;
- pVisual++)
- ;
-
- visual->class = pVisual->class;
- visual->bitsPerRGB = pVisual->bitsPerRGBValue;
- visual->colormapEntries = pVisual->ColormapEntries;
- visual->redMask = pVisual->redMask;
- visual->greenMask = pVisual->greenMask;
- visual->blueMask = pVisual->blueMask;
- }
-
- length += (depth->nVisuals * sizeof(xVisualType));
+ depth = (xDepth *) (ConnectionInfo + length);
+ depth->depth = PanoramiXDepths[i].depth;
+ depth->nVisuals = PanoramiXDepths[i].numVids;
+ length += sizeof(xDepth);
+ visual = (xVisualType *) (ConnectionInfo + length);
+
+ for (j = 0; j < depth->nVisuals; j++, visual++) {
+ visual->visualID = PanoramiXDepths[i].vids[j];
+
+ for (pVisual = PanoramiXVisuals;
+ pVisual->vid != visual->visualID; pVisual++);
+
+ visual->class = pVisual->class;
+ visual->bitsPerRGB = pVisual->bitsPerRGBValue;
+ visual->colormapEntries = pVisual->ColormapEntries;
+ visual->redMask = pVisual->redMask;
+ visual->greenMask = pVisual->greenMask;
+ visual->blueMask = pVisual->blueMask;
+ }
+
+ length += (depth->nVisuals * sizeof(xVisualType));
}
connSetupPrefix.length = bytes_to_int32(length);
for (i = 0; i < PanoramiXNumDepths; i++)
- free(PanoramiXDepths[i].vids);
+ free(PanoramiXDepths[i].vids);
free(PanoramiXDepths);
PanoramiXDepths = NULL;
/*
* OK, change some dimensions so it looks as if it were one big screen
*/
-
+
old_width = root->pixWidth;
old_height = root->pixHeight;
@@ -698,13 +694,13 @@ Bool PanoramiXCreateConnectionBlock(void)
root->mmWidth *= width_mult;
root->mmHeight *= height_mult;
- while(ConnectionCallbackList) {
- pointer tmp;
+ while (ConnectionCallbackList) {
+ pointer tmp;
- tmp = (pointer)ConnectionCallbackList;
- (*ConnectionCallbackList->func)();
- ConnectionCallbackList = ConnectionCallbackList->next;
- free(tmp);
+ tmp = (pointer) ConnectionCallbackList;
+ (*ConnectionCallbackList->func) ();
+ ConnectionCallbackList = ConnectionCallbackList->next;
+ free(tmp);
}
return TRUE;
@@ -723,14 +719,14 @@ static Bool
VisualsEqual(VisualPtr a, ScreenPtr pScreenB, VisualPtr b)
{
return ((a->class == b->class) &&
- (a->ColormapEntries == b->ColormapEntries) &&
- (a->nplanes == b->nplanes) &&
- (a->redMask == b->redMask) &&
- (a->greenMask == b->greenMask) &&
- (a->blueMask == b->blueMask) &&
- (a->offsetRed == b->offsetRed) &&
- (a->offsetGreen == b->offsetGreen) &&
- (a->offsetBlue == b->offsetBlue));
+ (a->ColormapEntries == b->ColormapEntries) &&
+ (a->nplanes == b->nplanes) &&
+ (a->redMask == b->redMask) &&
+ (a->greenMask == b->greenMask) &&
+ (a->blueMask == b->blueMask) &&
+ (a->offsetRed == b->offsetRed) &&
+ (a->offsetGreen == b->offsetGreen) &&
+ (a->offsetBlue == b->offsetBlue));
}
static void
@@ -741,29 +737,29 @@ PanoramiXMaybeAddDepth(DepthPtr pDepth)
Bool found = FALSE;
FOR_NSCREENS_FORWARD_SKIP(j) {
- pScreen = screenInfo.screens[j];
- for (k = 0; k < pScreen->numDepths; k++) {
- if (pScreen->allowedDepths[k].depth == pDepth->depth) {
- found = TRUE;
- break;
- }
- }
+ pScreen = screenInfo.screens[j];
+ for (k = 0; k < pScreen->numDepths; k++) {
+ if (pScreen->allowedDepths[k].depth == pDepth->depth) {
+ found = TRUE;
+ break;
+ }
+ }
}
if (!found)
- return;
+ return;
j = PanoramiXNumDepths;
PanoramiXNumDepths++;
PanoramiXDepths = realloc(PanoramiXDepths,
- PanoramiXNumDepths * sizeof(DepthRec));
+ PanoramiXNumDepths * sizeof(DepthRec));
PanoramiXDepths[j].depth = pDepth->depth;
PanoramiXDepths[j].numVids = 0;
/* XXX suboptimal, should grow these dynamically */
- if(pDepth->numVids)
- PanoramiXDepths[j].vids = malloc(sizeof(VisualID) * pDepth->numVids);
+ if (pDepth->numVids)
+ PanoramiXDepths[j].vids = malloc(sizeof(VisualID) * pDepth->numVids);
else
- PanoramiXDepths[j].vids = NULL;
+ PanoramiXDepths[j].vids = NULL;
}
static void
@@ -774,60 +770,60 @@ PanoramiXMaybeAddVisual(VisualPtr pVisual)
Bool found = FALSE;
FOR_NSCREENS_FORWARD_SKIP(j) {
- pScreen = screenInfo.screens[j];
- found = FALSE;
+ pScreen = screenInfo.screens[j];
+ found = FALSE;
- for (k = 0; k < pScreen->numVisuals; k++) {
- VisualPtr candidate = &pScreen->visuals[k];
+ for (k = 0; k < pScreen->numVisuals; k++) {
+ VisualPtr candidate = &pScreen->visuals[k];
- if ((*XineramaVisualsEqualPtr)(pVisual, pScreen, candidate)
+ if ((*XineramaVisualsEqualPtr) (pVisual, pScreen, candidate)
#ifdef GLXPROXY
- && glxMatchVisual(screenInfo.screens[0], pVisual, pScreen)
+ && glxMatchVisual(screenInfo.screens[0], pVisual, pScreen)
#endif
- ) {
- found = TRUE;
- break;
- }
- }
-
- if (!found)
- return;
+ ) {
+ found = TRUE;
+ break;
+ }
+ }
+
+ if (!found)
+ return;
}
/* found a matching visual on all screens, add it to the subset list */
j = PanoramiXNumVisuals;
PanoramiXNumVisuals++;
PanoramiXVisuals = realloc(PanoramiXVisuals,
- PanoramiXNumVisuals * sizeof(VisualRec));
+ PanoramiXNumVisuals * sizeof(VisualRec));
memcpy(&PanoramiXVisuals[j], pVisual, sizeof(VisualRec));
for (k = 0; k < PanoramiXNumDepths; k++) {
- if (PanoramiXDepths[k].depth == pVisual->nplanes) {
- PanoramiXDepths[k].vids[PanoramiXDepths[k].numVids] = pVisual->vid;
- PanoramiXDepths[k].numVids++;
- break;
- }
- }
+ if (PanoramiXDepths[k].depth == pVisual->nplanes) {
+ PanoramiXDepths[k].vids[PanoramiXDepths[k].numVids] = pVisual->vid;
+ PanoramiXDepths[k].numVids++;
+ break;
+ }
+ }
}
extern void
PanoramiXConsolidate(void)
{
- int i;
+ int i;
PanoramiXRes *root, *defmap, *saver;
- ScreenPtr pScreen = screenInfo.screens[0];
- DepthPtr pDepth = pScreen->allowedDepths;
- VisualPtr pVisual = pScreen->visuals;
+ ScreenPtr pScreen = screenInfo.screens[0];
+ DepthPtr pDepth = pScreen->allowedDepths;
+ VisualPtr pVisual = pScreen->visuals;
PanoramiXNumDepths = 0;
PanoramiXNumVisuals = 0;
for (i = 0; i < pScreen->numDepths; i++)
- PanoramiXMaybeAddDepth(pDepth++);
+ PanoramiXMaybeAddDepth(pDepth++);
for (i = 0; i < pScreen->numVisuals; i++)
- PanoramiXMaybeAddVisual(pVisual++);
+ PanoramiXMaybeAddVisual(pVisual++);
root = malloc(sizeof(PanoramiXRes));
root->type = XRT_WINDOW;
@@ -837,14 +833,15 @@ PanoramiXConsolidate(void)
saver->type = XRT_WINDOW;
FOR_NSCREENS(i) {
- ScreenPtr pScreen = screenInfo.screens[i];
- root->info[i].id = pScreen->root->drawable.id;
- root->u.win.class = InputOutput;
+ ScreenPtr pScreen = screenInfo.screens[i];
+
+ root->info[i].id = pScreen->root->drawable.id;
+ root->u.win.class = InputOutput;
root->u.win.root = TRUE;
saver->info[i].id = pScreen->screensaver.wid;
saver->u.win.class = InputOutput;
saver->u.win.root = TRUE;
- defmap->info[i].id = pScreen->defColormap;
+ defmap->info[i].id = pScreen->defColormap;
}
AddResource(root->info[0].id, XRT_WINDOW, root);
@@ -860,169 +857,167 @@ PanoramiXTranslateVisualID(int screen, VisualID orig)
int i;
for (i = 0; i < PanoramiXNumVisuals; i++) {
- if (orig == PanoramiXVisuals[i].vid) {
- pVisual = &PanoramiXVisuals[i];
- break;
- }
+ if (orig == PanoramiXVisuals[i].vid) {
+ pVisual = &PanoramiXVisuals[i];
+ break;
+ }
}
if (!pVisual)
- return 0;
+ return 0;
/* if screen is 0, orig is already the correct visual ID */
if (screen == 0)
- return orig;
+ return orig;
/* found the original, now translate it relative to the backend screen */
for (i = 0; i < pOtherScreen->numVisuals; i++) {
- VisualPtr pOtherVisual = &pOtherScreen->visuals[i];
+ VisualPtr pOtherVisual = &pOtherScreen->visuals[i];
- if ((*XineramaVisualsEqualPtr)(pVisual, pOtherScreen, pOtherVisual))
- return pOtherVisual->vid;
+ if ((*XineramaVisualsEqualPtr) (pVisual, pOtherScreen, pOtherVisual))
+ return pOtherVisual->vid;
}
return 0;
}
-
/*
* PanoramiXResetProc()
* Exit, deallocating as needed.
*/
-static void PanoramiXResetProc(ExtensionEntry* extEntry)
+static void
+PanoramiXResetProc(ExtensionEntry * extEntry)
{
- int i;
+ int i;
- PanoramiXRenderReset ();
+ PanoramiXRenderReset();
#ifdef XFIXES
- PanoramiXFixesReset ();
+ PanoramiXFixesReset();
#endif
screenInfo.numScreens = PanoramiXNumScreens;
- for (i = 256; i--; )
- ProcVector[i] = SavedProcVector[i];
+ for (i = 256; i--;)
+ ProcVector[i] = SavedProcVector[i];
}
-
int
-ProcPanoramiXQueryVersion (ClientPtr client)
+ProcPanoramiXQueryVersion(ClientPtr client)
{
/* REQUEST(xPanoramiXQueryVersionReq); */
- xPanoramiXQueryVersionReply rep;
+ xPanoramiXQueryVersionReply rep;
- REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
+ REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
rep.majorVersion = SERVER_PANORAMIX_MAJOR_VERSION;
rep.minorVersion = SERVER_PANORAMIX_MINOR_VERSION;
- if (client->swapped) {
+ if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
swaps(&rep.majorVersion);
swaps(&rep.minorVersion);
}
- WriteToClient(client, sizeof (xPanoramiXQueryVersionReply), (char *)&rep);
+ WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *) &rep);
return Success;
}
int
ProcPanoramiXGetState(ClientPtr client)
{
- REQUEST(xPanoramiXGetStateReq);
- WindowPtr pWin;
- xPanoramiXGetStateReply rep;
- int rc;
-
- REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.state = !noPanoramiXExtension;
- rep.window = stuff->window;
- if (client->swapped) {
- swaps(&rep.sequenceNumber);
- swapl(&rep.length);
- swapl(&rep.window);
- }
- WriteToClient (client, sizeof (xPanoramiXGetStateReply), (char *) &rep);
- return Success;
+ REQUEST(xPanoramiXGetStateReq);
+ WindowPtr pWin;
+ xPanoramiXGetStateReply rep;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.state = !noPanoramiXExtension;
+ rep.window = stuff->window;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.window);
+ }
+ WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *) &rep);
+ return Success;
}
-int
+int
ProcPanoramiXGetScreenCount(ClientPtr client)
{
- REQUEST(xPanoramiXGetScreenCountReq);
- WindowPtr pWin;
- xPanoramiXGetScreenCountReply rep;
- int rc;
-
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- rep.ScreenCount = PanoramiXNumScreens;
- rep.window = stuff->window;
- if (client->swapped) {
- swaps(&rep.sequenceNumber);
- swapl(&rep.length);
- swapl(&rep.window);
- }
- WriteToClient (client, sizeof (xPanoramiXGetScreenCountReply), (char *) &rep);
- return Success;
+ REQUEST(xPanoramiXGetScreenCountReq);
+ WindowPtr pWin;
+ xPanoramiXGetScreenCountReply rep;
+ int rc;
+
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ rep.ScreenCount = PanoramiXNumScreens;
+ rep.window = stuff->window;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.window);
+ }
+ WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *) &rep);
+ return Success;
}
-int
+int
ProcPanoramiXGetScreenSize(ClientPtr client)
{
- REQUEST(xPanoramiXGetScreenSizeReq);
- WindowPtr pWin;
- xPanoramiXGetScreenSizeReply rep;
- int rc;
-
- if (stuff->screen >= PanoramiXNumScreens)
- return BadMatch;
-
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
- rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
- if (rc != Success)
- return rc;
-
- rep.type = X_Reply;
- rep.length = 0;
- rep.sequenceNumber = client->sequence;
- /* screen dimensions */
- rep.width = screenInfo.screens[stuff->screen]->width;
- rep.height = screenInfo.screens[stuff->screen]->height;
- rep.window = stuff->window;
- rep.screen = stuff->screen;
- if (client->swapped) {
- swaps(&rep.sequenceNumber);
- swapl(&rep.length);
- swapl(&rep.width);
- swapl(&rep.height);
- swapl(&rep.window);
- swapl(&rep.screen);
- }
- WriteToClient (client, sizeof (xPanoramiXGetScreenSizeReply), (char *) &rep);
- return Success;
-}
+ REQUEST(xPanoramiXGetScreenSizeReq);
+ WindowPtr pWin;
+ xPanoramiXGetScreenSizeReply rep;
+ int rc;
+ if (stuff->screen >= PanoramiXNumScreens)
+ return BadMatch;
+
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
+ rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+
+ rep.type = X_Reply;
+ rep.length = 0;
+ rep.sequenceNumber = client->sequence;
+ /* screen dimensions */
+ rep.width = screenInfo.screens[stuff->screen]->width;
+ rep.height = screenInfo.screens[stuff->screen]->height;
+ rep.window = stuff->window;
+ rep.screen = stuff->screen;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.width);
+ swapl(&rep.height);
+ swapl(&rep.window);
+ swapl(&rep.screen);
+ }
+ WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *) &rep);
+ return Success;
+}
int
ProcXineramaIsActive(ClientPtr client)
{
/* REQUEST(xXineramaIsActiveReq); */
- xXineramaIsActiveReply rep;
+ xXineramaIsActiveReply rep;
REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
@@ -1031,28 +1026,27 @@ ProcXineramaIsActive(ClientPtr client)
rep.sequenceNumber = client->sequence;
#if 1
{
- /* The following hack fools clients into thinking that Xinerama
- * is disabled even though it is not. */
- rep.state = !noPanoramiXExtension && !PanoramiXExtensionDisabledHack;
+ /* The following hack fools clients into thinking that Xinerama
+ * is disabled even though it is not. */
+ rep.state = !noPanoramiXExtension && !PanoramiXExtensionDisabledHack;
}
#else
rep.state = !noPanoramiXExtension;
#endif
if (client->swapped) {
- swaps(&rep.sequenceNumber);
- swapl(&rep.length);
- swapl(&rep.state);
- }
- WriteToClient (client, sizeof (xXineramaIsActiveReply), (char *) &rep);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.state);
+ }
+ WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep);
return Success;
}
-
int
ProcXineramaQueryScreens(ClientPtr client)
{
/* REQUEST(xXineramaQueryScreensReq); */
- xXineramaQueryScreensReply rep;
+ xXineramaQueryScreensReply rep;
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
@@ -1061,58 +1055,56 @@ ProcXineramaQueryScreens(ClientPtr client)
rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
if (client->swapped) {
- swaps(&rep.sequenceNumber);
- swapl(&rep.length);
- swapl(&rep.number);
- }
- WriteToClient (client, sizeof (xXineramaQueryScreensReply), (char *) &rep);
-
- if(!noPanoramiXExtension) {
- xXineramaScreenInfo scratch;
- int i;
-
- FOR_NSCREENS(i) {
- scratch.x_org = screenInfo.screens[i]->x;
- scratch.y_org = screenInfo.screens[i]->y;
- scratch.width = screenInfo.screens[i]->width;
- scratch.height = screenInfo.screens[i]->height;
-
- if(client->swapped) {
- swaps(&scratch.x_org);
- swaps(&scratch.y_org);
- swaps(&scratch.width);
- swaps(&scratch.height);
- }
- WriteToClient (client, sz_XineramaScreenInfo, (char *) &scratch);
- }
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.number);
+ }
+ WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *) &rep);
+
+ if (!noPanoramiXExtension) {
+ xXineramaScreenInfo scratch;
+ int i;
+
+ FOR_NSCREENS(i) {
+ scratch.x_org = screenInfo.screens[i]->x;
+ scratch.y_org = screenInfo.screens[i]->y;
+ scratch.width = screenInfo.screens[i]->width;
+ scratch.height = screenInfo.screens[i]->height;
+
+ if (client->swapped) {
+ swaps(&scratch.x_org);
+ swaps(&scratch.y_org);
+ swaps(&scratch.width);
+ swaps(&scratch.height);
+ }
+ WriteToClient(client, sz_XineramaScreenInfo, (char *) &scratch);
+ }
}
return Success;
}
-
static int
-ProcPanoramiXDispatch (ClientPtr client)
-{ REQUEST(xReq);
- switch (stuff->data)
- {
- case X_PanoramiXQueryVersion:
- return ProcPanoramiXQueryVersion(client);
- case X_PanoramiXGetState:
- return ProcPanoramiXGetState(client);
- case X_PanoramiXGetScreenCount:
- return ProcPanoramiXGetScreenCount(client);
- case X_PanoramiXGetScreenSize:
- return ProcPanoramiXGetScreenSize(client);
- case X_XineramaIsActive:
- return ProcXineramaIsActive(client);
- case X_XineramaQueryScreens:
- return ProcXineramaQueryScreens(client);
+ProcPanoramiXDispatch(ClientPtr client)
+{
+ REQUEST(xReq);
+ switch (stuff->data) {
+ case X_PanoramiXQueryVersion:
+ return ProcPanoramiXQueryVersion(client);
+ case X_PanoramiXGetState:
+ return ProcPanoramiXGetState(client);
+ case X_PanoramiXGetScreenCount:
+ return ProcPanoramiXGetScreenCount(client);
+ case X_PanoramiXGetScreenSize:
+ return ProcPanoramiXGetScreenSize(client);
+ case X_XineramaIsActive:
+ return ProcXineramaIsActive(client);
+ case X_XineramaQueryScreens:
+ return ProcXineramaQueryScreens(client);
}
return BadRequest;
}
-
#if X_BYTE_ORDER == X_LITTLE_ENDIAN
#define SHIFT_L(v,s) (v) << (s)
#define SHIFT_R(v,s) (v) >> (s)
@@ -1124,34 +1116,31 @@ ProcPanoramiXDispatch (ClientPtr client)
static void
CopyBits(char *dst, int shiftL, char *src, int bytes)
{
- /* Just get it to work. Worry about speed later */
+ /* Just get it to work. Worry about speed later */
int shiftR = 8 - shiftL;
- while(bytes--) {
- *dst |= SHIFT_L(*src, shiftL);
- *(dst + 1) |= SHIFT_R(*src, shiftR);
- dst++; src++;
- }
+ while (bytes--) {
+ *dst |= SHIFT_L(*src, shiftL);
+ *(dst + 1) |= SHIFT_R(*src, shiftR);
+ dst++;
+ src++;
+ }
}
-
/* Caution. This doesn't support 2 and 4 bpp formats. We expect
1 bpp and planar data to be already cleared when presented
to this function */
void
-XineramaGetImageData(
- DrawablePtr *pDrawables,
- int left,
- int top,
- int width,
- int height,
- unsigned int format,
- unsigned long planemask,
- char *data,
- int pitch,
- Bool isRoot
-){
+XineramaGetImageData(DrawablePtr *pDrawables,
+ int left,
+ int top,
+ int width,
+ int height,
+ unsigned int format,
+ unsigned long planemask,
+ char *data, int pitch, Bool isRoot)
+{
RegionRec SrcRegion, ScreenRegion, GrabRegion;
BoxRec SrcBox, *pbox;
int x, y, w, h, i, j, nbox, size, sizeNeeded, ScratchPitch, inOut, depth;
@@ -1163,129 +1152,136 @@ XineramaGetImageData(
/* find box in logical screen space */
SrcBox.x1 = left;
SrcBox.y1 = top;
- if(!isRoot) {
- SrcBox.x1 += pDraw->x + screenInfo.screens[0]->x;
- SrcBox.y1 += pDraw->y + screenInfo.screens[0]->y;
+ if (!isRoot) {
+ SrcBox.x1 += pDraw->x + screenInfo.screens[0]->x;
+ SrcBox.y1 += pDraw->y + screenInfo.screens[0]->y;
}
SrcBox.x2 = SrcBox.x1 + width;
SrcBox.y2 = SrcBox.y1 + height;
-
+
RegionInit(&SrcRegion, &SrcBox, 1);
RegionNull(&GrabRegion);
depth = (format == XYPixmap) ? 1 : pDraw->depth;
FOR_NSCREENS(i) {
- BoxRec TheBox;
- ScreenPtr pScreen;
- pDraw = pDrawables[i];
- pScreen = pDraw->pScreen;
-
- TheBox.x1 = pScreen->x;
- TheBox.x2 = TheBox.x1 + pScreen->width;
- TheBox.y1 = pScreen->y;
- TheBox.y2 = TheBox.y1 + pScreen->height;
-
- RegionInit(&ScreenRegion, &TheBox, 1);
- inOut = RegionContainsRect(&ScreenRegion, &SrcBox);
- if(inOut == rgnPART)
- RegionIntersect(&GrabRegion, &SrcRegion, &ScreenRegion);
- RegionUninit(&ScreenRegion);
-
- if(inOut == rgnIN) {
- (*pScreen->GetImage)(pDraw,
- SrcBox.x1 - pDraw->x - screenInfo.screens[i]->x,
- SrcBox.y1 - pDraw->y - screenInfo.screens[i]->y,
- width, height, format, planemask, data);
- break;
- } else if (inOut == rgnOUT)
- continue;
-
- nbox = RegionNumRects(&GrabRegion);
-
- if(nbox) {
- pbox = RegionRects(&GrabRegion);
-
- while(nbox--) {
- w = pbox->x2 - pbox->x1;
- h = pbox->y2 - pbox->y1;
- ScratchPitch = PixmapBytePad(w, depth);
- sizeNeeded = ScratchPitch * h;
-
- if(sizeNeeded > size) {
- char *tmpdata = ScratchMem;
- ScratchMem = realloc(ScratchMem, sizeNeeded);
- if(ScratchMem)
- size = sizeNeeded;
- else {
- ScratchMem = tmpdata;
- break;
- }
- }
-
- x = pbox->x1 - pDraw->x - screenInfo.screens[i]->x;
- y = pbox->y1 - pDraw->y - screenInfo.screens[i]->y;
-
- (*pScreen->GetImage)(pDraw, x, y, w, h,
- format, planemask, ScratchMem);
-
- /* copy the memory over */
-
- if(depth == 1) {
- int k, shift, leftover, index, index2;
-
- x = pbox->x1 - SrcBox.x1;
- y = pbox->y1 - SrcBox.y1;
- shift = x & 7;
- x >>= 3;
- leftover = w & 7;
- w >>= 3;
-
- /* clean up the edge */
- if(leftover) {
- int mask = (1 << leftover) - 1;
- for(j = h, k = w; j--; k += ScratchPitch)
- ScratchMem[k] &= mask;
- }
-
- for(j = 0, index = (pitch * y) + x, index2 = 0; j < h;
- j++, index += pitch, index2 += ScratchPitch)
- {
- if(w) {
- if(!shift)
- memcpy(data + index, ScratchMem + index2, w);
- else
- CopyBits(data + index, shift,
- ScratchMem + index2, w);
- }
-
- if(leftover) {
- data[index + w] |=
- SHIFT_L(ScratchMem[index2 + w], shift);
- if((shift + leftover) > 8)
- data[index + w + 1] |=
- SHIFT_R(ScratchMem[index2 + w],(8 - shift));
- }
- }
- } else {
- j = BitsPerPixel(depth) >> 3;
- x = (pbox->x1 - SrcBox.x1) * j;
- y = pbox->y1 - SrcBox.y1;
- w *= j;
-
- for(j = 0; j < h; j++) {
- memcpy(data + (pitch * (y + j)) + x,
- ScratchMem + (ScratchPitch * j), w);
- }
- }
- pbox++;
- }
-
- RegionSubtract(&SrcRegion, &SrcRegion, &GrabRegion);
- if(!RegionNotEmpty(&SrcRegion))
- break;
- }
-
+ BoxRec TheBox;
+ ScreenPtr pScreen;
+
+ pDraw = pDrawables[i];
+ pScreen = pDraw->pScreen;
+
+ TheBox.x1 = pScreen->x;
+ TheBox.x2 = TheBox.x1 + pScreen->width;
+ TheBox.y1 = pScreen->y;
+ TheBox.y2 = TheBox.y1 + pScreen->height;
+
+ RegionInit(&ScreenRegion, &TheBox, 1);
+ inOut = RegionContainsRect(&ScreenRegion, &SrcBox);
+ if (inOut == rgnPART)
+ RegionIntersect(&GrabRegion, &SrcRegion, &ScreenRegion);
+ RegionUninit(&ScreenRegion);
+
+ if (inOut == rgnIN) {
+ (*pScreen->GetImage) (pDraw,
+ SrcBox.x1 - pDraw->x -
+ screenInfo.screens[i]->x,
+ SrcBox.y1 - pDraw->y -
+ screenInfo.screens[i]->y, width, height,
+ format, planemask, data);
+ break;
+ }
+ else if (inOut == rgnOUT)
+ continue;
+
+ nbox = RegionNumRects(&GrabRegion);
+
+ if (nbox) {
+ pbox = RegionRects(&GrabRegion);
+
+ while (nbox--) {
+ w = pbox->x2 - pbox->x1;
+ h = pbox->y2 - pbox->y1;
+ ScratchPitch = PixmapBytePad(w, depth);
+ sizeNeeded = ScratchPitch * h;
+
+ if (sizeNeeded > size) {
+ char *tmpdata = ScratchMem;
+
+ ScratchMem = realloc(ScratchMem, sizeNeeded);
+ if (ScratchMem)
+ size = sizeNeeded;
+ else {
+ ScratchMem = tmpdata;
+ break;
+ }
+ }
+
+ x = pbox->x1 - pDraw->x - screenInfo.screens[i]->x;
+ y = pbox->y1 - pDraw->y - screenInfo.screens[i]->y;
+
+ (*pScreen->GetImage) (pDraw, x, y, w, h,
+ format, planemask, ScratchMem);
+
+ /* copy the memory over */
+
+ if (depth == 1) {
+ int k, shift, leftover, index, index2;
+
+ x = pbox->x1 - SrcBox.x1;
+ y = pbox->y1 - SrcBox.y1;
+ shift = x & 7;
+ x >>= 3;
+ leftover = w & 7;
+ w >>= 3;
+
+ /* clean up the edge */
+ if (leftover) {
+ int mask = (1 << leftover) - 1;
+
+ for (j = h, k = w; j--; k += ScratchPitch)
+ ScratchMem[k] &= mask;
+ }
+
+ for (j = 0, index = (pitch * y) + x, index2 = 0; j < h;
+ j++, index += pitch, index2 += ScratchPitch) {
+ if (w) {
+ if (!shift)
+ memcpy(data + index, ScratchMem + index2, w);
+ else
+ CopyBits(data + index, shift,
+ ScratchMem + index2, w);
+ }
+
+ if (leftover) {
+ data[index + w] |=
+ SHIFT_L(ScratchMem[index2 + w], shift);
+ if ((shift + leftover) > 8)
+ data[index + w + 1] |=
+ SHIFT_R(ScratchMem[index2 + w],
+ (8 - shift));
+ }
+ }
+ }
+ else {
+ j = BitsPerPixel(depth) >> 3;
+ x = (pbox->x1 - SrcBox.x1) * j;
+ y = pbox->y1 - SrcBox.y1;
+ w *= j;
+
+ for (j = 0; j < h; j++) {
+ memcpy(data + (pitch * (y + j)) + x,
+ ScratchMem + (ScratchPitch * j), w);
+ }
+ }
+ pbox++;
+ }
+
+ RegionSubtract(&SrcRegion, &SrcRegion, &GrabRegion);
+ if (!RegionNotEmpty(&SrcRegion))
+ break;
+ }
+
}
free(ScratchMem);
diff --git a/Xext/panoramiX.h b/Xext/panoramiX.h
index 71651e558..6578dfa17 100644
--- a/Xext/panoramiX.h
+++ b/Xext/panoramiX.h
@@ -26,7 +26,6 @@ Equipment Corporation.
******************************************************************/
-
/* THIS IS NOT AN X PROJECT TEAM SPECIFICATION */
/*
@@ -47,25 +46,25 @@ Equipment Corporation.
#include "dixstruct.h"
typedef struct _PanoramiXInfo {
- XID id ;
+ XID id;
} PanoramiXInfo;
typedef struct {
PanoramiXInfo info[MAXSCREENS];
RESTYPE type;
union {
- struct {
- char visibility;
- char class;
- char root;
- } win;
- struct {
- Bool shared;
- } pix;
- struct {
- Bool root;
- } pict;
- char raw_data[4];
+ struct {
+ char visibility;
+ char class;
+ char root;
+ } win;
+ struct {
+ Bool shared;
+ } pix;
+ struct {
+ Bool root;
+ } pict;
+ char raw_data[4];
} u;
} PanoramiXRes;
@@ -77,4 +76,4 @@ typedef struct {
#define IS_SHARED_PIXMAP(r) (((r)->type == XRT_PIXMAP) && (r)->u.pix.shared)
#define IS_ROOT_DRAWABLE(d) (((d)->type == XRT_WINDOW) && (d)->u.win.root)
-#endif /* _PANORAMIX_H_ */
+#endif /* _PANORAMIX_H_ */
diff --git a/Xext/panoramiXSwap.c b/Xext/panoramiXSwap.c
index 79277021a..b6ff6f918 100644
--- a/Xext/panoramiXSwap.c
+++ b/Xext/panoramiXSwap.c
@@ -48,89 +48,86 @@ Equipment Corporation.
#include "panoramiXh.h"
static int
-SProcPanoramiXQueryVersion (ClientPtr client)
+SProcPanoramiXQueryVersion(ClientPtr client)
{
- REQUEST(xPanoramiXQueryVersionReq);
+ REQUEST(xPanoramiXQueryVersionReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH (xPanoramiXQueryVersionReq);
- return ProcPanoramiXQueryVersion(client);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq);
+ return ProcPanoramiXQueryVersion(client);
}
static int
SProcPanoramiXGetState(ClientPtr client)
{
- REQUEST(xPanoramiXGetStateReq);
+ REQUEST(xPanoramiXGetStateReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
- swapl(&stuff->window);
- return ProcPanoramiXGetState(client);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xPanoramiXGetStateReq);
+ swapl(&stuff->window);
+ return ProcPanoramiXGetState(client);
}
-static int
+static int
SProcPanoramiXGetScreenCount(ClientPtr client)
{
- REQUEST(xPanoramiXGetScreenCountReq);
+ REQUEST(xPanoramiXGetScreenCountReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
- swapl(&stuff->window);
- return ProcPanoramiXGetScreenCount(client);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq);
+ swapl(&stuff->window);
+ return ProcPanoramiXGetScreenCount(client);
}
-static int
+static int
SProcPanoramiXGetScreenSize(ClientPtr client)
{
- REQUEST(xPanoramiXGetScreenSizeReq);
+ REQUEST(xPanoramiXGetScreenSizeReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
- swapl(&stuff->window);
- swapl(&stuff->screen);
- return ProcPanoramiXGetScreenSize(client);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq);
+ swapl(&stuff->window);
+ swapl(&stuff->screen);
+ return ProcPanoramiXGetScreenSize(client);
}
-
-static int
+static int
SProcXineramaIsActive(ClientPtr client)
{
- REQUEST(xXineramaIsActiveReq);
+ REQUEST(xXineramaIsActiveReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
- return ProcXineramaIsActive(client);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXineramaIsActiveReq);
+ return ProcXineramaIsActive(client);
}
-
-static int
+static int
SProcXineramaQueryScreens(ClientPtr client)
{
- REQUEST(xXineramaQueryScreensReq);
+ REQUEST(xXineramaQueryScreensReq);
- swaps(&stuff->length);
- REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
- return ProcXineramaQueryScreens(client);
+ swaps(&stuff->length);
+ REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
+ return ProcXineramaQueryScreens(client);
}
-
int
-SProcPanoramiXDispatch (ClientPtr client)
-{ REQUEST(xReq);
- switch (stuff->data)
- {
- case X_PanoramiXQueryVersion:
- return SProcPanoramiXQueryVersion(client);
- case X_PanoramiXGetState:
- return SProcPanoramiXGetState(client);
- case X_PanoramiXGetScreenCount:
- return SProcPanoramiXGetScreenCount(client);
- case X_PanoramiXGetScreenSize:
- return SProcPanoramiXGetScreenSize(client);
- case X_XineramaIsActive:
- return SProcXineramaIsActive(client);
- case X_XineramaQueryScreens:
- return SProcXineramaQueryScreens(client);
+SProcPanoramiXDispatch(ClientPtr client)
+{
+ REQUEST(xReq);
+ switch (stuff->data) {
+ case X_PanoramiXQueryVersion:
+ return SProcPanoramiXQueryVersion(client);
+ case X_PanoramiXGetState:
+ return SProcPanoramiXGetState(client);
+ case X_PanoramiXGetScreenCount:
+ return SProcPanoramiXGetScreenCount(client);
+ case X_PanoramiXGetScreenSize:
+ return SProcPanoramiXGetScreenSize(client);
+ case X_XineramaIsActive:
+ return SProcXineramaIsActive(client);
+ case X_XineramaQueryScreens:
+ return SProcXineramaQueryScreens(client);
}
return BadRequest;
}
diff --git a/Xext/panoramiXh.h b/Xext/panoramiXh.h
index 31b8f90b6..2762a59ac 100644
--- a/Xext/panoramiXh.h
+++ b/Xext/panoramiXh.h
@@ -16,7 +16,7 @@ extern int PanoramiXUnmapSubwindows(ClientPtr client);
extern int PanoramiXConfigureWindow(ClientPtr client);
extern int PanoramiXCirculateWindow(ClientPtr client);
extern int PanoramiXGetGeometry(ClientPtr client);
-extern int PanoramiXTranslateCoords(ClientPtr client);
+extern int PanoramiXTranslateCoords(ClientPtr client);
extern int PanoramiXCreatePixmap(ClientPtr client);
extern int PanoramiXFreePixmap(ClientPtr client);
extern int PanoramiXChangeGC(ClientPtr client);
@@ -40,7 +40,7 @@ extern int PanoramiXPolyFillRectangle(ClientPtr client);
extern int PanoramiXPutImage(ClientPtr client);
extern int PanoramiXGetImage(ClientPtr client);
extern int PanoramiXPolyText8(ClientPtr client);
-extern int PanoramiXPolyText16(ClientPtr client);
+extern int PanoramiXPolyText16(ClientPtr client);
extern int PanoramiXImageText8(ClientPtr client);
extern int PanoramiXImageText16(ClientPtr client);
extern int PanoramiXCreateColormap(ClientPtr client);
@@ -57,11 +57,11 @@ extern int PanoramiXAllocColorPlanes(ClientPtr client);
#define PROC_EXTERN(pfunc) extern int pfunc(ClientPtr)
-PROC_EXTERN(ProcPanoramiXQueryVersion);
-PROC_EXTERN(ProcPanoramiXGetState);
-PROC_EXTERN(ProcPanoramiXGetScreenCount);
-PROC_EXTERN(ProcPanoramiXGetScreenSize);
-
+PROC_EXTERN(ProcPanoramiXQueryVersion);
+PROC_EXTERN(ProcPanoramiXGetState);
+PROC_EXTERN(ProcPanoramiXGetScreenCount);
+PROC_EXTERN(ProcPanoramiXGetScreenSize);
+
PROC_EXTERN(ProcXineramaQueryScreens);
PROC_EXTERN(ProcXineramaIsActive);
@@ -70,4 +70,4 @@ extern int SProcPanoramiXDispatch(ClientPtr client);
extern int connBlockScreenStart;
extern xConnSetupPrefix connSetupPrefix;
-extern int (* SavedProcVector[256]) (ClientPtr client);
+extern int (*SavedProcVector[256]) (ClientPtr client);
diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c
index 9ea461173..6a91e35d0 100644
--- a/Xext/panoramiXprocs.c
+++ b/Xext/panoramiXprocs.c
@@ -25,7 +25,6 @@ Equipment Corporation.
/* Massively rewritten by Mark Vojkovich <markv@valinux.com> */
-
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
@@ -52,12 +51,14 @@ Equipment Corporation.
#define INPUTONLY_LEGAL_MASK (CWWinGravity | CWEventMask | \
CWDontPropagate | CWOverrideRedirect | CWCursor )
-int PanoramiXCreateWindow(ClientPtr client)
+int
+PanoramiXCreateWindow(ClientPtr client)
{
PanoramiXRes *parent, *newWin;
PanoramiXRes *backPix = NULL;
PanoramiXRes *bordPix = NULL;
- PanoramiXRes *cmap = NULL;
+ PanoramiXRes *cmap = NULL;
+
REQUEST(xCreateWindowReq);
int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
int result, len, j;
@@ -66,54 +67,55 @@ int PanoramiXCreateWindow(ClientPtr client)
Bool parentIsRoot;
REQUEST_AT_LEAST_SIZE(xCreateWindowReq);
-
+
len = client->req_len - bytes_to_int32(sizeof(xCreateWindowReq));
if (Ones(stuff->mask) != len)
return BadLength;
- result = dixLookupResourceByType((pointer *)&parent, stuff->parent,
- XRT_WINDOW, client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &parent, stuff->parent,
+ XRT_WINDOW, client, DixWriteAccess);
if (result != Success)
return result;
- if(stuff->class == CopyFromParent)
- stuff->class = parent->u.win.class;
+ if (stuff->class == CopyFromParent)
+ stuff->class = parent->u.win.class;
- if((stuff->class == InputOnly) && (stuff->mask & (~INPUTONLY_LEGAL_MASK)))
+ if ((stuff->class == InputOnly) && (stuff->mask & (~INPUTONLY_LEGAL_MASK)))
return BadMatch;
- if ((Mask)stuff->mask & CWBackPixmap) {
- pback_offset = Ones((Mask)stuff->mask & (CWBackPixmap - 1));
- tmp = *((CARD32 *) &stuff[1] + pback_offset);
- if ((tmp != None) && (tmp != ParentRelative)) {
- result = dixLookupResourceByType((pointer *)&backPix, tmp,
- XRT_PIXMAP, client, DixReadAccess);
- if (result != Success)
- return result;
- }
- }
- if ((Mask)stuff->mask & CWBorderPixmap) {
- pbord_offset = Ones((Mask)stuff->mask & (CWBorderPixmap - 1));
- tmp = *((CARD32 *) &stuff[1] + pbord_offset);
- if (tmp != CopyFromParent) {
- result = dixLookupResourceByType((pointer *)&bordPix, tmp,
- XRT_PIXMAP, client, DixReadAccess);
- if (result != Success)
- return result;
- }
- }
- if ((Mask)stuff->mask & CWColormap) {
- cmap_offset = Ones((Mask)stuff->mask & (CWColormap - 1));
- tmp = *((CARD32 *) &stuff[1] + cmap_offset);
- if ((tmp != CopyFromParent) && (tmp != None)) {
- result = dixLookupResourceByType((pointer *)&cmap, tmp,
- XRT_COLORMAP, client, DixReadAccess);
- if (result != Success)
- return result;
- }
- }
-
- if(!(newWin = malloc(sizeof(PanoramiXRes))))
+ if ((Mask) stuff->mask & CWBackPixmap) {
+ pback_offset = Ones((Mask) stuff->mask & (CWBackPixmap - 1));
+ tmp = *((CARD32 *) &stuff[1] + pback_offset);
+ if ((tmp != None) && (tmp != ParentRelative)) {
+ result = dixLookupResourceByType((pointer *) &backPix, tmp,
+ XRT_PIXMAP, client, DixReadAccess);
+ if (result != Success)
+ return result;
+ }
+ }
+ if ((Mask) stuff->mask & CWBorderPixmap) {
+ pbord_offset = Ones((Mask) stuff->mask & (CWBorderPixmap - 1));
+ tmp = *((CARD32 *) &stuff[1] + pbord_offset);
+ if (tmp != CopyFromParent) {
+ result = dixLookupResourceByType((pointer *) &bordPix, tmp,
+ XRT_PIXMAP, client, DixReadAccess);
+ if (result != Success)
+ return result;
+ }
+ }
+ if ((Mask) stuff->mask & CWColormap) {
+ cmap_offset = Ones((Mask) stuff->mask & (CWColormap - 1));
+ tmp = *((CARD32 *) &stuff[1] + cmap_offset);
+ if ((tmp != CopyFromParent) && (tmp != None)) {
+ result = dixLookupResourceByType((pointer *) &cmap, tmp,
+ XRT_COLORMAP, client,
+ DixReadAccess);
+ if (result != Success)
+ return result;
+ }
+ }
+
+ if (!(newWin = malloc(sizeof(PanoramiXRes))))
return BadAlloc;
newWin->type = XRT_WINDOW;
@@ -123,326 +125,346 @@ int PanoramiXCreateWindow(ClientPtr client)
panoramix_setup_ids(newWin, client, stuff->wid);
if (stuff->class == InputOnly)
- stuff->visual = CopyFromParent;
+ stuff->visual = CopyFromParent;
orig_visual = stuff->visual;
orig_x = stuff->x;
orig_y = stuff->y;
- parentIsRoot = (stuff->parent == screenInfo.screens[0]->root->drawable.id) ||
- (stuff->parent == screenInfo.screens[0]->screensaver.wid);
+ parentIsRoot = (stuff->parent == screenInfo.screens[0]->root->drawable.id)
+ || (stuff->parent == screenInfo.screens[0]->screensaver.wid);
FOR_NSCREENS_BACKWARD(j) {
stuff->wid = newWin->info[j].id;
stuff->parent = parent->info[j].id;
- if (parentIsRoot) {
- stuff->x = orig_x - screenInfo.screens[j]->x;
- stuff->y = orig_y - screenInfo.screens[j]->y;
- }
- if (backPix)
- *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[j].id;
- if (bordPix)
- *((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[j].id;
- if (cmap)
- *((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[j].id;
- if ( orig_visual != CopyFromParent )
- stuff->visual = PanoramiXTranslateVisualID(j, orig_visual);
- result = (*SavedProcVector[X_CreateWindow])(client);
- if(result != Success) break;
+ if (parentIsRoot) {
+ stuff->x = orig_x - screenInfo.screens[j]->x;
+ stuff->y = orig_y - screenInfo.screens[j]->y;
+ }
+ if (backPix)
+ *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[j].id;
+ if (bordPix)
+ *((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[j].id;
+ if (cmap)
+ *((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[j].id;
+ if (orig_visual != CopyFromParent)
+ stuff->visual = PanoramiXTranslateVisualID(j, orig_visual);
+ result = (*SavedProcVector[X_CreateWindow]) (client);
+ if (result != Success)
+ break;
}
if (result == Success)
AddResource(newWin->info[0].id, XRT_WINDOW, newWin);
- else
+ else
free(newWin);
return result;
}
-
-int PanoramiXChangeWindowAttributes(ClientPtr client)
+int
+PanoramiXChangeWindowAttributes(ClientPtr client)
{
PanoramiXRes *win;
PanoramiXRes *backPix = NULL;
PanoramiXRes *bordPix = NULL;
- PanoramiXRes *cmap = NULL;
+ PanoramiXRes *cmap = NULL;
+
REQUEST(xChangeWindowAttributesReq);
int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
int result, len, j;
XID tmp;
REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
-
+
len = client->req_len - bytes_to_int32(sizeof(xChangeWindowAttributesReq));
if (Ones(stuff->valueMask) != len)
return BadLength;
- result = dixLookupResourceByType((pointer *)&win, stuff->window,
- XRT_WINDOW, client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &win, stuff->window,
+ XRT_WINDOW, client, DixWriteAccess);
if (result != Success)
return result;
- if((win->u.win.class == InputOnly) &&
- (stuff->valueMask & (~INPUTONLY_LEGAL_MASK)))
+ if ((win->u.win.class == InputOnly) &&
+ (stuff->valueMask & (~INPUTONLY_LEGAL_MASK)))
return BadMatch;
- if ((Mask)stuff->valueMask & CWBackPixmap) {
- pback_offset = Ones((Mask)stuff->valueMask & (CWBackPixmap - 1));
- tmp = *((CARD32 *) &stuff[1] + pback_offset);
- if ((tmp != None) && (tmp != ParentRelative)) {
- result = dixLookupResourceByType((pointer *)&backPix, tmp,
- XRT_PIXMAP, client, DixReadAccess);
- if (result != Success)
- return result;
- }
- }
- if ((Mask)stuff->valueMask & CWBorderPixmap) {
- pbord_offset = Ones((Mask)stuff->valueMask & (CWBorderPixmap - 1));
- tmp = *((CARD32 *) &stuff[1] + pbord_offset);
- if (tmp != CopyFromParent) {
- result = dixLookupResourceByType((pointer *)&bordPix, tmp,
- XRT_PIXMAP, client, DixReadAccess);
- if (result != Success)
- return result;
- }
- }
- if ((Mask)stuff->valueMask & CWColormap) {
- cmap_offset = Ones((Mask)stuff->valueMask & (CWColormap - 1));
- tmp = *((CARD32 *) &stuff[1] + cmap_offset);
- if ((tmp != CopyFromParent) && (tmp != None)) {
- result = dixLookupResourceByType((pointer *)&cmap, tmp,
- XRT_COLORMAP, client, DixReadAccess);
- if (result != Success)
- return result;
- }
+ if ((Mask) stuff->valueMask & CWBackPixmap) {
+ pback_offset = Ones((Mask) stuff->valueMask & (CWBackPixmap - 1));
+ tmp = *((CARD32 *) &stuff[1] + pback_offset);
+ if ((tmp != None) && (tmp != ParentRelative)) {
+ result = dixLookupResourceByType((pointer *) &backPix, tmp,
+ XRT_PIXMAP, client, DixReadAccess);
+ if (result != Success)
+ return result;
+ }
+ }
+ if ((Mask) stuff->valueMask & CWBorderPixmap) {
+ pbord_offset = Ones((Mask) stuff->valueMask & (CWBorderPixmap - 1));
+ tmp = *((CARD32 *) &stuff[1] + pbord_offset);
+ if (tmp != CopyFromParent) {
+ result = dixLookupResourceByType((pointer *) &bordPix, tmp,
+ XRT_PIXMAP, client, DixReadAccess);
+ if (result != Success)
+ return result;
+ }
+ }
+ if ((Mask) stuff->valueMask & CWColormap) {
+ cmap_offset = Ones((Mask) stuff->valueMask & (CWColormap - 1));
+ tmp = *((CARD32 *) &stuff[1] + cmap_offset);
+ if ((tmp != CopyFromParent) && (tmp != None)) {
+ result = dixLookupResourceByType((pointer *) &cmap, tmp,
+ XRT_COLORMAP, client,
+ DixReadAccess);
+ if (result != Success)
+ return result;
+ }
}
FOR_NSCREENS_BACKWARD(j) {
stuff->window = win->info[j].id;
- if (backPix)
- *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[j].id;
- if (bordPix)
- *((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[j].id;
- if (cmap)
- *((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[j].id;
- result = (*SavedProcVector[X_ChangeWindowAttributes])(client);
+ if (backPix)
+ *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[j].id;
+ if (bordPix)
+ *((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[j].id;
+ if (cmap)
+ *((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[j].id;
+ result = (*SavedProcVector[X_ChangeWindowAttributes]) (client);
}
return result;
}
-
-int PanoramiXDestroyWindow(ClientPtr client)
+int
+PanoramiXDestroyWindow(ClientPtr client)
{
PanoramiXRes *win;
- int result, j;
+ int result, j;
+
REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
- result = dixLookupResourceByType((pointer *)&win, stuff->id, XRT_WINDOW,
- client, DixDestroyAccess);
+ result = dixLookupResourceByType((pointer *) &win, stuff->id, XRT_WINDOW,
+ client, DixDestroyAccess);
if (result != Success)
- return result;
+ return result;
FOR_NSCREENS_BACKWARD(j) {
- stuff->id = win->info[j].id;
- result = (*SavedProcVector[X_DestroyWindow])(client);
- if(result != Success) break;
+ stuff->id = win->info[j].id;
+ result = (*SavedProcVector[X_DestroyWindow]) (client);
+ if (result != Success)
+ break;
}
/* Since ProcDestroyWindow is using FreeResource, it will free
- our resource for us on the last pass through the loop above */
-
+ our resource for us on the last pass through the loop above */
+
return result;
}
-
-int PanoramiXDestroySubwindows(ClientPtr client)
+int
+PanoramiXDestroySubwindows(ClientPtr client)
{
PanoramiXRes *win;
- int result, j;
+ int result, j;
+
REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
- result = dixLookupResourceByType((pointer *)&win, stuff->id, XRT_WINDOW,
- client, DixDestroyAccess);
+ result = dixLookupResourceByType((pointer *) &win, stuff->id, XRT_WINDOW,
+ client, DixDestroyAccess);
if (result != Success)
- return result;
+ return result;
FOR_NSCREENS_BACKWARD(j) {
- stuff->id = win->info[j].id;
- result = (*SavedProcVector[X_DestroySubwindows])(client);
- if(result != Success) break;
+ stuff->id = win->info[j].id;
+ result = (*SavedProcVector[X_DestroySubwindows]) (client);
+ if (result != Success)
+ break;
}
/* DestroySubwindows is using FreeResource which will free
- our resources for us on the last pass through the loop above */
+ our resources for us on the last pass through the loop above */
return result;
}
-
-int PanoramiXChangeSaveSet(ClientPtr client)
+int
+PanoramiXChangeSaveSet(ClientPtr client)
{
PanoramiXRes *win;
- int result, j;
+ int result, j;
+
REQUEST(xChangeSaveSetReq);
REQUEST_SIZE_MATCH(xChangeSaveSetReq);
- result = dixLookupResourceByType((pointer *)&win, stuff->window,
- XRT_WINDOW, client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &win, stuff->window,
+ XRT_WINDOW, client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
FOR_NSCREENS_BACKWARD(j) {
- stuff->window = win->info[j].id;
- result = (*SavedProcVector[X_ChangeSaveSet])(client);
- if(result != Success) break;
+ stuff->window = win->info[j].id;
+ result = (*SavedProcVector[X_ChangeSaveSet]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXReparentWindow(ClientPtr client)
+int
+PanoramiXReparentWindow(ClientPtr client)
{
PanoramiXRes *win, *parent;
- int result, j;
- int x, y;
- Bool parentIsRoot;
+ int result, j;
+ int x, y;
+ Bool parentIsRoot;
+
REQUEST(xReparentWindowReq);
REQUEST_SIZE_MATCH(xReparentWindowReq);
- result = dixLookupResourceByType((pointer *)&win, stuff->window,
- XRT_WINDOW, client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &win, stuff->window,
+ XRT_WINDOW, client, DixWriteAccess);
if (result != Success)
- return result;
+ return result;
- result = dixLookupResourceByType((pointer *)&parent, stuff->parent,
- XRT_WINDOW, client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &parent, stuff->parent,
+ XRT_WINDOW, client, DixWriteAccess);
if (result != Success)
- return result;
+ return result;
x = stuff->x;
y = stuff->y;
- parentIsRoot = (stuff->parent == screenInfo.screens[0]->root->drawable.id) ||
- (stuff->parent == screenInfo.screens[0]->screensaver.wid);
+ parentIsRoot = (stuff->parent == screenInfo.screens[0]->root->drawable.id)
+ || (stuff->parent == screenInfo.screens[0]->screensaver.wid);
FOR_NSCREENS_BACKWARD(j) {
- stuff->window = win->info[j].id;
- stuff->parent = parent->info[j].id;
- if(parentIsRoot) {
- stuff->x = x - screenInfo.screens[j]->x;
- stuff->y = y - screenInfo.screens[j]->y;
- }
- result = (*SavedProcVector[X_ReparentWindow])(client);
- if(result != Success) break;
+ stuff->window = win->info[j].id;
+ stuff->parent = parent->info[j].id;
+ if (parentIsRoot) {
+ stuff->x = x - screenInfo.screens[j]->x;
+ stuff->y = y - screenInfo.screens[j]->y;
+ }
+ result = (*SavedProcVector[X_ReparentWindow]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXMapWindow(ClientPtr client)
+int
+PanoramiXMapWindow(ClientPtr client)
{
PanoramiXRes *win;
- int result, j;
+ int result, j;
+
REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
- result = dixLookupResourceByType((pointer *)&win, stuff->id,
- XRT_WINDOW, client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &win, stuff->id,
+ XRT_WINDOW, client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
FOR_NSCREENS_FORWARD(j) {
- stuff->id = win->info[j].id;
- result = (*SavedProcVector[X_MapWindow])(client);
- if(result != Success) break;
+ stuff->id = win->info[j].id;
+ result = (*SavedProcVector[X_MapWindow]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXMapSubwindows(ClientPtr client)
+int
+PanoramiXMapSubwindows(ClientPtr client)
{
PanoramiXRes *win;
- int result, j;
+ int result, j;
+
REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
- result = dixLookupResourceByType((pointer *)&win, stuff->id,
- XRT_WINDOW, client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &win, stuff->id,
+ XRT_WINDOW, client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
FOR_NSCREENS_FORWARD(j) {
- stuff->id = win->info[j].id;
- result = (*SavedProcVector[X_MapSubwindows])(client);
- if(result != Success) break;
+ stuff->id = win->info[j].id;
+ result = (*SavedProcVector[X_MapSubwindows]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXUnmapWindow(ClientPtr client)
+int
+PanoramiXUnmapWindow(ClientPtr client)
{
PanoramiXRes *win;
- int result, j;
+ int result, j;
+
REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
- result = dixLookupResourceByType((pointer *)&win, stuff->id,
- XRT_WINDOW, client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &win, stuff->id,
+ XRT_WINDOW, client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
FOR_NSCREENS_FORWARD(j) {
- stuff->id = win->info[j].id;
- result = (*SavedProcVector[X_UnmapWindow])(client);
- if(result != Success) break;
+ stuff->id = win->info[j].id;
+ result = (*SavedProcVector[X_UnmapWindow]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXUnmapSubwindows(ClientPtr client)
+int
+PanoramiXUnmapSubwindows(ClientPtr client)
{
PanoramiXRes *win;
- int result, j;
+ int result, j;
+
REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
- result = dixLookupResourceByType((pointer *)&win, stuff->id,
- XRT_WINDOW, client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &win, stuff->id,
+ XRT_WINDOW, client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
FOR_NSCREENS_FORWARD(j) {
- stuff->id = win->info[j].id;
- result = (*SavedProcVector[X_UnmapSubwindows])(client);
- if(result != Success) break;
+ stuff->id = win->info[j].id;
+ result = (*SavedProcVector[X_UnmapSubwindows]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXConfigureWindow(ClientPtr client)
+int
+PanoramiXConfigureWindow(ClientPtr client)
{
PanoramiXRes *win;
PanoramiXRes *sib = NULL;
- WindowPtr pWin;
- int result, j, len, sib_offset = 0, x = 0, y = 0;
- int x_offset = -1;
- int y_offset = -1;
+ WindowPtr pWin;
+ int result, j, len, sib_offset = 0, x = 0, y = 0;
+ int x_offset = -1;
+ int y_offset = -1;
+
REQUEST(xConfigureWindowReq);
REQUEST_AT_LEAST_SIZE(xConfigureWindowReq);
@@ -452,92 +474,97 @@ int PanoramiXConfigureWindow(ClientPtr client)
return BadLength;
/* because we need the parent */
- result = dixLookupResourceByType((pointer *)&pWin, stuff->window,
- RT_WINDOW, client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &pWin, stuff->window,
+ RT_WINDOW, client, DixWriteAccess);
if (result != Success)
- return result;
+ return result;
- result = dixLookupResourceByType((pointer *)&win, stuff->window,
- XRT_WINDOW, client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &win, stuff->window,
+ XRT_WINDOW, client, DixWriteAccess);
if (result != Success)
- return result;
+ return result;
+
+ if ((Mask) stuff->mask & CWSibling) {
+ XID tmp;
- if ((Mask)stuff->mask & CWSibling) {
- XID tmp;
- sib_offset = Ones((Mask)stuff->mask & (CWSibling - 1));
- if ((tmp = *((CARD32 *) &stuff[1] + sib_offset))) {
- result = dixLookupResourceByType((pointer *)&sib, tmp, XRT_WINDOW,
- client, DixReadAccess);
- if (result != Success)
- return result;
- }
+ sib_offset = Ones((Mask) stuff->mask & (CWSibling - 1));
+ if ((tmp = *((CARD32 *) &stuff[1] + sib_offset))) {
+ result = dixLookupResourceByType((pointer *) &sib, tmp, XRT_WINDOW,
+ client, DixReadAccess);
+ if (result != Success)
+ return result;
+ }
}
- if(pWin->parent && ((pWin->parent == screenInfo.screens[0]->root) ||
- (pWin->parent->drawable.id == screenInfo.screens[0]->screensaver.wid)))
- {
- if ((Mask)stuff->mask & CWX) {
- x_offset = 0;
- x = *((CARD32 *)&stuff[1]);
- }
- if ((Mask)stuff->mask & CWY) {
- y_offset = (x_offset == -1) ? 0 : 1;
- y = *((CARD32 *) &stuff[1] + y_offset);
- }
+ if (pWin->parent && ((pWin->parent == screenInfo.screens[0]->root) ||
+ (pWin->parent->drawable.id ==
+ screenInfo.screens[0]->screensaver.wid))) {
+ if ((Mask) stuff->mask & CWX) {
+ x_offset = 0;
+ x = *((CARD32 *) &stuff[1]);
+ }
+ if ((Mask) stuff->mask & CWY) {
+ y_offset = (x_offset == -1) ? 0 : 1;
+ y = *((CARD32 *) &stuff[1] + y_offset);
+ }
}
/* have to go forward or you get expose events before
- ConfigureNotify events */
+ ConfigureNotify events */
FOR_NSCREENS_FORWARD(j) {
- stuff->window = win->info[j].id;
- if(sib)
- *((CARD32 *) &stuff[1] + sib_offset) = sib->info[j].id;
- if(x_offset >= 0)
- *((CARD32 *) &stuff[1] + x_offset) = x - screenInfo.screens[j]->x;
- if(y_offset >= 0)
- *((CARD32 *) &stuff[1] + y_offset) = y - screenInfo.screens[j]->y;
- result = (*SavedProcVector[X_ConfigureWindow])(client);
- if(result != Success) break;
+ stuff->window = win->info[j].id;
+ if (sib)
+ *((CARD32 *) &stuff[1] + sib_offset) = sib->info[j].id;
+ if (x_offset >= 0)
+ *((CARD32 *) &stuff[1] + x_offset) = x - screenInfo.screens[j]->x;
+ if (y_offset >= 0)
+ *((CARD32 *) &stuff[1] + y_offset) = y - screenInfo.screens[j]->y;
+ result = (*SavedProcVector[X_ConfigureWindow]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXCirculateWindow(ClientPtr client)
+int
+PanoramiXCirculateWindow(ClientPtr client)
{
PanoramiXRes *win;
- int result, j;
+ int result, j;
+
REQUEST(xCirculateWindowReq);
REQUEST_SIZE_MATCH(xCirculateWindowReq);
- result = dixLookupResourceByType((pointer *)&win, stuff->window,
- XRT_WINDOW, client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &win, stuff->window,
+ XRT_WINDOW, client, DixWriteAccess);
if (result != Success)
- return result;
+ return result;
FOR_NSCREENS_FORWARD(j) {
- stuff->window = win->info[j].id;
- result = (*SavedProcVector[X_CirculateWindow])(client);
- if(result != Success) break;
+ stuff->window = win->info[j].id;
+ result = (*SavedProcVector[X_CirculateWindow]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXGetGeometry(ClientPtr client)
+int
+PanoramiXGetGeometry(ClientPtr client)
{
- xGetGeometryReply rep;
+ xGetGeometryReply rep;
DrawablePtr pDraw;
int rc;
+
REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
rc = dixLookupDrawable(&pDraw, stuff->id, client, M_ANY, DixGetAttrAccess);
if (rc != Success)
- return rc;
+ return rc;
rep.type = X_Reply;
rep.length = 0;
@@ -549,33 +576,35 @@ int PanoramiXGetGeometry(ClientPtr client)
rep.x = rep.y = rep.borderWidth = 0;
if (stuff->id == rep.root) {
- xWindowRoot *root = (xWindowRoot *)
- (ConnectionInfo + connBlockScreenStart);
-
- rep.width = root->pixWidth;
- rep.height = root->pixHeight;
- } else
- if (WindowDrawable(pDraw->type))
- {
- WindowPtr pWin = (WindowPtr)pDraw;
- rep.x = pWin->origin.x - wBorderWidth (pWin);
- rep.y = pWin->origin.y - wBorderWidth (pWin);
- if((pWin->parent == screenInfo.screens[0]->root) ||
- (pWin->parent->drawable.id == screenInfo.screens[0]->screensaver.wid))
- {
- rep.x += screenInfo.screens[0]->x;
- rep.y += screenInfo.screens[0]->y;
- }
- rep.borderWidth = pWin->borderWidth;
+ xWindowRoot *root = (xWindowRoot *)
+ (ConnectionInfo + connBlockScreenStart);
+
+ rep.width = root->pixWidth;
+ rep.height = root->pixHeight;
+ }
+ else if (WindowDrawable(pDraw->type)) {
+ WindowPtr pWin = (WindowPtr) pDraw;
+
+ rep.x = pWin->origin.x - wBorderWidth(pWin);
+ rep.y = pWin->origin.y - wBorderWidth(pWin);
+ if ((pWin->parent == screenInfo.screens[0]->root) ||
+ (pWin->parent->drawable.id ==
+ screenInfo.screens[0]->screensaver.wid)) {
+ rep.x += screenInfo.screens[0]->x;
+ rep.y += screenInfo.screens[0]->y;
+ }
+ rep.borderWidth = pWin->borderWidth;
}
WriteReplyToClient(client, sizeof(xGetGeometryReply), &rep);
return Success;
}
-int PanoramiXTranslateCoords(ClientPtr client)
+int
+PanoramiXTranslateCoords(ClientPtr client)
{
INT16 x, y;
+
REQUEST(xTranslateCoordsReq);
int rc;
WindowPtr pWin, pDst;
@@ -594,172 +623,177 @@ int PanoramiXTranslateCoords(ClientPtr client)
rep.sameScreen = xTrue;
rep.child = None;
- if((pWin == screenInfo.screens[0]->root) ||
- (pWin->drawable.id == screenInfo.screens[0]->screensaver.wid))
- {
- x = stuff->srcX - screenInfo.screens[0]->x;
- y = stuff->srcY - screenInfo.screens[0]->y;
- } else {
- x = pWin->drawable.x + stuff->srcX;
- y = pWin->drawable.y + stuff->srcY;
+ if ((pWin == screenInfo.screens[0]->root) ||
+ (pWin->drawable.id == screenInfo.screens[0]->screensaver.wid)) {
+ x = stuff->srcX - screenInfo.screens[0]->x;
+ y = stuff->srcY - screenInfo.screens[0]->y;
+ }
+ else {
+ x = pWin->drawable.x + stuff->srcX;
+ y = pWin->drawable.y + stuff->srcY;
}
pWin = pDst->firstChild;
while (pWin) {
- BoxRec box;
- if ((pWin->mapped) &&
- (x >= pWin->drawable.x - wBorderWidth (pWin)) &&
- (x < pWin->drawable.x + (int)pWin->drawable.width +
- wBorderWidth (pWin)) &&
- (y >= pWin->drawable.y - wBorderWidth (pWin)) &&
- (y < pWin->drawable.y + (int)pWin->drawable.height +
- wBorderWidth (pWin))
- /* When a window is shaped, a further check
- * is made to see if the point is inside
- * borderSize
- */
- && (!wBoundingShape(pWin) ||
- RegionContainsPoint(wBoundingShape(pWin),
- x - pWin->drawable.x,
- y - pWin->drawable.y, &box))
- )
- {
- rep.child = pWin->drawable.id;
- pWin = (WindowPtr) NULL;
- }
- else
- pWin = pWin->nextSib;
+ BoxRec box;
+
+ if ((pWin->mapped) &&
+ (x >= pWin->drawable.x - wBorderWidth(pWin)) &&
+ (x < pWin->drawable.x + (int) pWin->drawable.width +
+ wBorderWidth(pWin)) &&
+ (y >= pWin->drawable.y - wBorderWidth(pWin)) &&
+ (y < pWin->drawable.y + (int) pWin->drawable.height +
+ wBorderWidth(pWin))
+ /* When a window is shaped, a further check
+ * is made to see if the point is inside
+ * borderSize
+ */
+ && (!wBoundingShape(pWin) ||
+ RegionContainsPoint(wBoundingShape(pWin),
+ x - pWin->drawable.x,
+ y - pWin->drawable.y, &box))
+ ) {
+ rep.child = pWin->drawable.id;
+ pWin = (WindowPtr) NULL;
+ }
+ else
+ pWin = pWin->nextSib;
}
rep.dstX = x - pDst->drawable.x;
rep.dstY = y - pDst->drawable.y;
- if((pDst == screenInfo.screens[0]->root) ||
- (pDst->drawable.id == screenInfo.screens[0]->screensaver.wid))
- {
- rep.dstX += screenInfo.screens[0]->x;
- rep.dstY += screenInfo.screens[0]->y;
+ if ((pDst == screenInfo.screens[0]->root) ||
+ (pDst->drawable.id == screenInfo.screens[0]->screensaver.wid)) {
+ rep.dstX += screenInfo.screens[0]->x;
+ rep.dstY += screenInfo.screens[0]->y;
}
WriteReplyToClient(client, sizeof(xTranslateCoordsReply), &rep);
return Success;
}
-int PanoramiXCreatePixmap(ClientPtr client)
+int
+PanoramiXCreatePixmap(ClientPtr client)
{
PanoramiXRes *refDraw, *newPix;
int result, j;
+
REQUEST(xCreatePixmapReq);
REQUEST_SIZE_MATCH(xCreatePixmapReq);
client->errorValue = stuff->pid;
- result = dixLookupResourceByClass((pointer *)&refDraw, stuff->drawable,
- XRC_DRAWABLE, client, DixReadAccess);
+ result = dixLookupResourceByClass((pointer *) &refDraw, stuff->drawable,
+ XRC_DRAWABLE, client, DixReadAccess);
if (result != Success)
- return (result == BadValue) ? BadDrawable : result;
+ return (result == BadValue) ? BadDrawable : result;
- if(!(newPix = malloc(sizeof(PanoramiXRes))))
- return BadAlloc;
+ if (!(newPix = malloc(sizeof(PanoramiXRes))))
+ return BadAlloc;
newPix->type = XRT_PIXMAP;
newPix->u.pix.shared = FALSE;
panoramix_setup_ids(newPix, client, stuff->pid);
-
+
FOR_NSCREENS_BACKWARD(j) {
- stuff->pid = newPix->info[j].id;
- stuff->drawable = refDraw->info[j].id;
- result = (*SavedProcVector[X_CreatePixmap])(client);
- if(result != Success) break;
+ stuff->pid = newPix->info[j].id;
+ stuff->drawable = refDraw->info[j].id;
+ result = (*SavedProcVector[X_CreatePixmap]) (client);
+ if (result != Success)
+ break;
}
if (result == Success)
- AddResource(newPix->info[0].id, XRT_PIXMAP, newPix);
- else
- free(newPix);
+ AddResource(newPix->info[0].id, XRT_PIXMAP, newPix);
+ else
+ free(newPix);
return result;
}
-
-int PanoramiXFreePixmap(ClientPtr client)
+int
+PanoramiXFreePixmap(ClientPtr client)
{
PanoramiXRes *pix;
- int result, j;
+ int result, j;
+
REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
client->errorValue = stuff->id;
- result = dixLookupResourceByType((pointer *)&pix, stuff->id, XRT_PIXMAP,
- client, DixDestroyAccess);
+ result = dixLookupResourceByType((pointer *) &pix, stuff->id, XRT_PIXMAP,
+ client, DixDestroyAccess);
if (result != Success)
- return result;
+ return result;
FOR_NSCREENS_BACKWARD(j) {
- stuff->id = pix->info[j].id;
- result = (*SavedProcVector[X_FreePixmap])(client);
- if(result != Success) break;
+ stuff->id = pix->info[j].id;
+ result = (*SavedProcVector[X_FreePixmap]) (client);
+ if (result != Success)
+ break;
}
/* Since ProcFreePixmap is using FreeResource, it will free
- our resource for us on the last pass through the loop above */
-
+ our resource for us on the last pass through the loop above */
+
return result;
}
-
-int PanoramiXCreateGC(ClientPtr client)
+int
+PanoramiXCreateGC(ClientPtr client)
{
PanoramiXRes *refDraw;
PanoramiXRes *newGC;
PanoramiXRes *stip = NULL;
PanoramiXRes *tile = NULL;
PanoramiXRes *clip = NULL;
+
REQUEST(xCreateGCReq);
int tile_offset = 0, stip_offset = 0, clip_offset = 0;
int result, len, j;
XID tmp;
REQUEST_AT_LEAST_SIZE(xCreateGCReq);
-
+
client->errorValue = stuff->gc;
len = client->req_len - bytes_to_int32(sizeof(xCreateGCReq));
if (Ones(stuff->mask) != len)
return BadLength;
- result = dixLookupResourceByClass((pointer *)&refDraw, stuff->drawable,
- XRC_DRAWABLE, client, DixReadAccess);
- if (result != Success)
- return (result == BadValue) ? BadDrawable : result;
-
- if ((Mask)stuff->mask & GCTile) {
- tile_offset = Ones((Mask)stuff->mask & (GCTile - 1));
- if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) {
- result = dixLookupResourceByType((pointer *)&tile, tmp, XRT_PIXMAP,
- client, DixReadAccess);
- if (result != Success)
- return result;
- }
- }
- if ((Mask)stuff->mask & GCStipple) {
- stip_offset = Ones((Mask)stuff->mask & (GCStipple - 1));
- if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) {
- result = dixLookupResourceByType((pointer *)&stip, tmp, XRT_PIXMAP,
- client, DixReadAccess);
- if (result != Success)
- return result;
- }
- }
- if ((Mask)stuff->mask & GCClipMask) {
- clip_offset = Ones((Mask)stuff->mask & (GCClipMask - 1));
- if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) {
- result = dixLookupResourceByType((pointer *)&clip, tmp, XRT_PIXMAP,
- client, DixReadAccess);
- if (result != Success)
- return result;
- }
- }
-
- if(!(newGC = malloc(sizeof(PanoramiXRes))))
+ result = dixLookupResourceByClass((pointer *) &refDraw, stuff->drawable,
+ XRC_DRAWABLE, client, DixReadAccess);
+ if (result != Success)
+ return (result == BadValue) ? BadDrawable : result;
+
+ if ((Mask) stuff->mask & GCTile) {
+ tile_offset = Ones((Mask) stuff->mask & (GCTile - 1));
+ if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) {
+ result = dixLookupResourceByType((pointer *) &tile, tmp, XRT_PIXMAP,
+ client, DixReadAccess);
+ if (result != Success)
+ return result;
+ }
+ }
+ if ((Mask) stuff->mask & GCStipple) {
+ stip_offset = Ones((Mask) stuff->mask & (GCStipple - 1));
+ if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) {
+ result = dixLookupResourceByType((pointer *) &stip, tmp, XRT_PIXMAP,
+ client, DixReadAccess);
+ if (result != Success)
+ return result;
+ }
+ }
+ if ((Mask) stuff->mask & GCClipMask) {
+ clip_offset = Ones((Mask) stuff->mask & (GCClipMask - 1));
+ if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) {
+ result = dixLookupResourceByType((pointer *) &clip, tmp, XRT_PIXMAP,
+ client, DixReadAccess);
+ if (result != Success)
+ return result;
+ }
+ }
+
+ if (!(newGC = malloc(sizeof(PanoramiXRes))))
return BadAlloc;
newGC->type = XRT_GC;
@@ -768,223 +802,235 @@ int PanoramiXCreateGC(ClientPtr client)
FOR_NSCREENS_BACKWARD(j) {
stuff->gc = newGC->info[j].id;
stuff->drawable = refDraw->info[j].id;
- if (tile)
- *((CARD32 *) &stuff[1] + tile_offset) = tile->info[j].id;
- if (stip)
- *((CARD32 *) &stuff[1] + stip_offset) = stip->info[j].id;
- if (clip)
- *((CARD32 *) &stuff[1] + clip_offset) = clip->info[j].id;
- result = (*SavedProcVector[X_CreateGC])(client);
- if(result != Success) break;
+ if (tile)
+ *((CARD32 *) &stuff[1] + tile_offset) = tile->info[j].id;
+ if (stip)
+ *((CARD32 *) &stuff[1] + stip_offset) = stip->info[j].id;
+ if (clip)
+ *((CARD32 *) &stuff[1] + clip_offset) = clip->info[j].id;
+ result = (*SavedProcVector[X_CreateGC]) (client);
+ if (result != Success)
+ break;
}
if (result == Success)
AddResource(newGC->info[0].id, XRT_GC, newGC);
- else
+ else
free(newGC);
return result;
}
-int PanoramiXChangeGC(ClientPtr client)
+int
+PanoramiXChangeGC(ClientPtr client)
{
PanoramiXRes *gc;
PanoramiXRes *stip = NULL;
PanoramiXRes *tile = NULL;
PanoramiXRes *clip = NULL;
+
REQUEST(xChangeGCReq);
int tile_offset = 0, stip_offset = 0, clip_offset = 0;
int result, len, j;
XID tmp;
REQUEST_AT_LEAST_SIZE(xChangeGCReq);
-
+
len = client->req_len - bytes_to_int32(sizeof(xChangeGCReq));
if (Ones(stuff->mask) != len)
return BadLength;
- result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
- if ((Mask)stuff->mask & GCTile) {
- tile_offset = Ones((Mask)stuff->mask & (GCTile - 1));
- if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) {
- result = dixLookupResourceByType((pointer *)&tile, tmp, XRT_PIXMAP,
- client, DixReadAccess);
- if (result != Success)
- return result;
- }
+ if ((Mask) stuff->mask & GCTile) {
+ tile_offset = Ones((Mask) stuff->mask & (GCTile - 1));
+ if ((tmp = *((CARD32 *) &stuff[1] + tile_offset))) {
+ result = dixLookupResourceByType((pointer *) &tile, tmp, XRT_PIXMAP,
+ client, DixReadAccess);
+ if (result != Success)
+ return result;
+ }
}
- if ((Mask)stuff->mask & GCStipple) {
- stip_offset = Ones((Mask)stuff->mask & (GCStipple - 1));
- if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) {
- result = dixLookupResourceByType((pointer *)&stip, tmp, XRT_PIXMAP,
- client, DixReadAccess);
- if (result != Success)
- return result;
- }
+ if ((Mask) stuff->mask & GCStipple) {
+ stip_offset = Ones((Mask) stuff->mask & (GCStipple - 1));
+ if ((tmp = *((CARD32 *) &stuff[1] + stip_offset))) {
+ result = dixLookupResourceByType((pointer *) &stip, tmp, XRT_PIXMAP,
+ client, DixReadAccess);
+ if (result != Success)
+ return result;
+ }
}
- if ((Mask)stuff->mask & GCClipMask) {
- clip_offset = Ones((Mask)stuff->mask & (GCClipMask - 1));
- if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) {
- result = dixLookupResourceByType((pointer *)&clip, tmp, XRT_PIXMAP,
- client, DixReadAccess);
- if (result != Success)
- return result;
- }
+ if ((Mask) stuff->mask & GCClipMask) {
+ clip_offset = Ones((Mask) stuff->mask & (GCClipMask - 1));
+ if ((tmp = *((CARD32 *) &stuff[1] + clip_offset))) {
+ result = dixLookupResourceByType((pointer *) &clip, tmp, XRT_PIXMAP,
+ client, DixReadAccess);
+ if (result != Success)
+ return result;
+ }
}
-
FOR_NSCREENS_BACKWARD(j) {
stuff->gc = gc->info[j].id;
- if (tile)
- *((CARD32 *) &stuff[1] + tile_offset) = tile->info[j].id;
- if (stip)
- *((CARD32 *) &stuff[1] + stip_offset) = stip->info[j].id;
- if (clip)
- *((CARD32 *) &stuff[1] + clip_offset) = clip->info[j].id;
- result = (*SavedProcVector[X_ChangeGC])(client);
- if(result != Success) break;
+ if (tile)
+ *((CARD32 *) &stuff[1] + tile_offset) = tile->info[j].id;
+ if (stip)
+ *((CARD32 *) &stuff[1] + stip_offset) = stip->info[j].id;
+ if (clip)
+ *((CARD32 *) &stuff[1] + clip_offset) = clip->info[j].id;
+ result = (*SavedProcVector[X_ChangeGC]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXCopyGC(ClientPtr client)
+int
+PanoramiXCopyGC(ClientPtr client)
{
PanoramiXRes *srcGC, *dstGC;
- int result, j;
+ int result, j;
+
REQUEST(xCopyGCReq);
REQUEST_SIZE_MATCH(xCopyGCReq);
- result = dixLookupResourceByType((pointer *)&srcGC, stuff->srcGC, XRT_GC,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &srcGC, stuff->srcGC, XRT_GC,
+ client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
- result = dixLookupResourceByType((pointer *)&dstGC, stuff->dstGC, XRT_GC,
- client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &dstGC, stuff->dstGC, XRT_GC,
+ client, DixWriteAccess);
if (result != Success)
- return result;
+ return result;
FOR_NSCREENS(j) {
- stuff->srcGC = srcGC->info[j].id;
- stuff->dstGC = dstGC->info[j].id;
- result = (*SavedProcVector[X_CopyGC])(client);
- if(result != Success) break;
+ stuff->srcGC = srcGC->info[j].id;
+ stuff->dstGC = dstGC->info[j].id;
+ result = (*SavedProcVector[X_CopyGC]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXSetDashes(ClientPtr client)
+int
+PanoramiXSetDashes(ClientPtr client)
{
PanoramiXRes *gc;
- int result, j;
+ int result, j;
+
REQUEST(xSetDashesReq);
REQUEST_FIXED_SIZE(xSetDashesReq, stuff->nDashes);
- result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixWriteAccess);
if (result != Success)
- return result;
+ return result;
FOR_NSCREENS_BACKWARD(j) {
- stuff->gc = gc->info[j].id;
- result = (*SavedProcVector[X_SetDashes])(client);
- if(result != Success) break;
+ stuff->gc = gc->info[j].id;
+ result = (*SavedProcVector[X_SetDashes]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXSetClipRectangles(ClientPtr client)
+int
+PanoramiXSetClipRectangles(ClientPtr client)
{
PanoramiXRes *gc;
- int result, j;
+ int result, j;
+
REQUEST(xSetClipRectanglesReq);
REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq);
- result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixWriteAccess);
if (result != Success)
- return result;
+ return result;
FOR_NSCREENS_BACKWARD(j) {
- stuff->gc = gc->info[j].id;
- result = (*SavedProcVector[X_SetClipRectangles])(client);
- if(result != Success) break;
+ stuff->gc = gc->info[j].id;
+ result = (*SavedProcVector[X_SetClipRectangles]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXFreeGC(ClientPtr client)
+int
+PanoramiXFreeGC(ClientPtr client)
{
PanoramiXRes *gc;
- int result, j;
+ int result, j;
+
REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
- result = dixLookupResourceByType((pointer *)&gc, stuff->id, XRT_GC,
- client, DixDestroyAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->id, XRT_GC,
+ client, DixDestroyAccess);
if (result != Success)
- return result;
+ return result;
FOR_NSCREENS_BACKWARD(j) {
- stuff->id = gc->info[j].id;
- result = (*SavedProcVector[X_FreeGC])(client);
- if(result != Success) break;
+ stuff->id = gc->info[j].id;
+ result = (*SavedProcVector[X_FreeGC]) (client);
+ if (result != Success)
+ break;
}
/* Since ProcFreeGC is using FreeResource, it will free
- our resource for us on the last pass through the loop above */
-
+ our resource for us on the last pass through the loop above */
+
return result;
}
-
-int PanoramiXClearToBackground(ClientPtr client)
+int
+PanoramiXClearToBackground(ClientPtr client)
{
PanoramiXRes *win;
- int result, j, x, y;
- Bool isRoot;
+ int result, j, x, y;
+ Bool isRoot;
+
REQUEST(xClearAreaReq);
REQUEST_SIZE_MATCH(xClearAreaReq);
- result = dixLookupResourceByType((pointer *)&win, stuff->window,
- XRT_WINDOW, client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &win, stuff->window,
+ XRT_WINDOW, client, DixWriteAccess);
if (result != Success)
- return result;
+ return result;
x = stuff->x;
y = stuff->y;
isRoot = win->u.win.root;
FOR_NSCREENS_BACKWARD(j) {
- stuff->window = win->info[j].id;
- if(isRoot) {
- stuff->x = x - screenInfo.screens[j]->x;
- stuff->y = y - screenInfo.screens[j]->y;
- }
- result = (*SavedProcVector[X_ClearArea])(client);
- if(result != Success) break;
- }
-
+ stuff->window = win->info[j].id;
+ if (isRoot) {
+ stuff->x = x - screenInfo.screens[j]->x;
+ stuff->y = y - screenInfo.screens[j]->y;
+ }
+ result = (*SavedProcVector[X_ClearArea]) (client);
+ if (result != Success)
+ break;
+ }
+
return result;
}
-
/*
For Window to Pixmap copies you're screwed since each screen's
pixmap will look like what it sees on its screen. Unless the
@@ -995,821 +1041,882 @@ int PanoramiXClearToBackground(ClientPtr client)
have to fix this later. (MArk).
*/
-int PanoramiXCopyArea(ClientPtr client)
+int
+PanoramiXCopyArea(ClientPtr client)
{
- int j, result, srcx, srcy, dstx, dsty;
- PanoramiXRes *gc, *src, *dst;
- Bool srcIsRoot = FALSE;
- Bool dstIsRoot = FALSE;
- Bool srcShared, dstShared;
+ int j, result, srcx, srcy, dstx, dsty;
+ PanoramiXRes *gc, *src, *dst;
+ Bool srcIsRoot = FALSE;
+ Bool dstIsRoot = FALSE;
+ Bool srcShared, dstShared;
+
REQUEST(xCopyAreaReq);
REQUEST_SIZE_MATCH(xCopyAreaReq);
- result = dixLookupResourceByClass((pointer *)&src, stuff->srcDrawable,
- XRC_DRAWABLE, client, DixReadAccess);
+ result = dixLookupResourceByClass((pointer *) &src, stuff->srcDrawable,
+ XRC_DRAWABLE, client, DixReadAccess);
if (result != Success)
- return (result == BadValue) ? BadDrawable : result;
+ return (result == BadValue) ? BadDrawable : result;
srcShared = IS_SHARED_PIXMAP(src);
- result = dixLookupResourceByClass((pointer *)&dst, stuff->dstDrawable,
- XRC_DRAWABLE, client, DixWriteAccess);
+ result = dixLookupResourceByClass((pointer *) &dst, stuff->dstDrawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
if (result != Success)
- return (result == BadValue) ? BadDrawable : result;
+ return (result == BadValue) ? BadDrawable : result;
dstShared = IS_SHARED_PIXMAP(dst);
- if(dstShared && srcShared)
- return (* SavedProcVector[X_CopyArea])(client);
+ if (dstShared && srcShared)
+ return (*SavedProcVector[X_CopyArea]) (client);
- result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixReadAccess);
if (result != Success)
- return result;
-
- if((dst->type == XRT_WINDOW) && dst->u.win.root)
- dstIsRoot = TRUE;
- if((src->type == XRT_WINDOW) && src->u.win.root)
- srcIsRoot = TRUE;
+ return result;
- srcx = stuff->srcX; srcy = stuff->srcY;
- dstx = stuff->dstX; dsty = stuff->dstY;
- if((dst->type == XRT_PIXMAP) && (src->type == XRT_WINDOW)) {
- DrawablePtr drawables[MAXSCREENS];
- DrawablePtr pDst;
- GCPtr pGC;
+ if ((dst->type == XRT_WINDOW) && dst->u.win.root)
+ dstIsRoot = TRUE;
+ if ((src->type == XRT_WINDOW) && src->u.win.root)
+ srcIsRoot = TRUE;
+
+ srcx = stuff->srcX;
+ srcy = stuff->srcY;
+ dstx = stuff->dstX;
+ dsty = stuff->dstY;
+ if ((dst->type == XRT_PIXMAP) && (src->type == XRT_WINDOW)) {
+ DrawablePtr drawables[MAXSCREENS];
+ DrawablePtr pDst;
+ GCPtr pGC;
char *data;
- int pitch, rc;
-
- FOR_NSCREENS(j) {
- rc = dixLookupDrawable(drawables+j, src->info[j].id, client, 0,
- DixGetAttrAccess);
- if (rc != Success)
- return rc;
- }
-
- pitch = PixmapBytePad(stuff->width, drawables[0]->depth);
- if(!(data = calloc(1, stuff->height * pitch)))
- return BadAlloc;
-
- XineramaGetImageData(drawables, srcx, srcy,
- stuff->width, stuff->height, ZPixmap, ~0, data, pitch,
- srcIsRoot);
-
- FOR_NSCREENS_BACKWARD(j) {
- stuff->gc = gc->info[j].id;
- VALIDATE_DRAWABLE_AND_GC(dst->info[j].id, pDst, DixWriteAccess);
- if(drawables[0]->depth != pDst->depth) {
- client->errorValue = stuff->dstDrawable;
- free(data);
- return BadMatch;
- }
-
- (*pGC->ops->PutImage) (pDst, pGC, pDst->depth, dstx, dsty,
- stuff->width, stuff->height,
- 0, ZPixmap, data);
-
- if(dstShared) break;
- }
-
- free(data);
- } else {
- DrawablePtr pDst = NULL, pSrc = NULL;
- GCPtr pGC = NULL;
- RegionRec totalReg;
- int rc;
-
- RegionNull(&totalReg);
- FOR_NSCREENS_BACKWARD(j) {
- RegionPtr pRgn;
- stuff->dstDrawable = dst->info[j].id;
- stuff->srcDrawable = src->info[j].id;
- stuff->gc = gc->info[j].id;
- if (srcIsRoot) {
- stuff->srcX = srcx - screenInfo.screens[j]->x;
- stuff->srcY = srcy - screenInfo.screens[j]->y;
- }
- if (dstIsRoot) {
- stuff->dstX = dstx - screenInfo.screens[j]->x;
- stuff->dstY = dsty - screenInfo.screens[j]->y;
- }
-
- VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, DixWriteAccess);
-
- if (stuff->dstDrawable != stuff->srcDrawable) {
- rc = dixLookupDrawable(&pSrc, stuff->srcDrawable, client, 0,
- DixReadAccess);
- if (rc != Success)
- return rc;
-
- if ((pDst->pScreen != pSrc->pScreen) ||
- (pDst->depth != pSrc->depth)) {
- client->errorValue = stuff->dstDrawable;
- return BadMatch;
- }
- } else
- pSrc = pDst;
-
- pRgn = (*pGC->ops->CopyArea)(pSrc, pDst, pGC,
- stuff->srcX, stuff->srcY,
- stuff->width, stuff->height,
- stuff->dstX, stuff->dstY);
- if(pGC->graphicsExposures && pRgn) {
- if(srcIsRoot) {
- RegionTranslate(pRgn,
- screenInfo.screens[j]->x, screenInfo.screens[j]->y);
- }
- RegionAppend(&totalReg, pRgn);
- RegionDestroy(pRgn);
- }
-
- if(dstShared)
- break;
- }
-
- if(pGC->graphicsExposures) {
- Bool overlap;
- RegionValidate(&totalReg, &overlap);
- (*pDst->pScreen->SendGraphicsExpose)(
- client, &totalReg, stuff->dstDrawable, X_CopyArea, 0);
- RegionUninit(&totalReg);
- }
+ int pitch, rc;
+
+ FOR_NSCREENS(j) {
+ rc = dixLookupDrawable(drawables + j, src->info[j].id, client, 0,
+ DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
+ }
+
+ pitch = PixmapBytePad(stuff->width, drawables[0]->depth);
+ if (!(data = calloc(1, stuff->height * pitch)))
+ return BadAlloc;
+
+ XineramaGetImageData(drawables, srcx, srcy,
+ stuff->width, stuff->height, ZPixmap, ~0, data,
+ pitch, srcIsRoot);
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->gc = gc->info[j].id;
+ VALIDATE_DRAWABLE_AND_GC(dst->info[j].id, pDst, DixWriteAccess);
+ if (drawables[0]->depth != pDst->depth) {
+ client->errorValue = stuff->dstDrawable;
+ free(data);
+ return BadMatch;
+ }
+
+ (*pGC->ops->PutImage) (pDst, pGC, pDst->depth, dstx, dsty,
+ stuff->width, stuff->height,
+ 0, ZPixmap, data);
+
+ if (dstShared)
+ break;
+ }
+
+ free(data);
+ }
+ else {
+ DrawablePtr pDst = NULL, pSrc = NULL;
+ GCPtr pGC = NULL;
+ RegionRec totalReg;
+ int rc;
+
+ RegionNull(&totalReg);
+ FOR_NSCREENS_BACKWARD(j) {
+ RegionPtr pRgn;
+
+ stuff->dstDrawable = dst->info[j].id;
+ stuff->srcDrawable = src->info[j].id;
+ stuff->gc = gc->info[j].id;
+ if (srcIsRoot) {
+ stuff->srcX = srcx - screenInfo.screens[j]->x;
+ stuff->srcY = srcy - screenInfo.screens[j]->y;
+ }
+ if (dstIsRoot) {
+ stuff->dstX = dstx - screenInfo.screens[j]->x;
+ stuff->dstY = dsty - screenInfo.screens[j]->y;
+ }
+
+ VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, DixWriteAccess);
+
+ if (stuff->dstDrawable != stuff->srcDrawable) {
+ rc = dixLookupDrawable(&pSrc, stuff->srcDrawable, client, 0,
+ DixReadAccess);
+ if (rc != Success)
+ return rc;
+
+ if ((pDst->pScreen != pSrc->pScreen) ||
+ (pDst->depth != pSrc->depth)) {
+ client->errorValue = stuff->dstDrawable;
+ return BadMatch;
+ }
+ }
+ else
+ pSrc = pDst;
+
+ pRgn = (*pGC->ops->CopyArea) (pSrc, pDst, pGC,
+ stuff->srcX, stuff->srcY,
+ stuff->width, stuff->height,
+ stuff->dstX, stuff->dstY);
+ if (pGC->graphicsExposures && pRgn) {
+ if (srcIsRoot) {
+ RegionTranslate(pRgn,
+ screenInfo.screens[j]->x,
+ screenInfo.screens[j]->y);
+ }
+ RegionAppend(&totalReg, pRgn);
+ RegionDestroy(pRgn);
+ }
+
+ if (dstShared)
+ break;
+ }
+
+ if (pGC->graphicsExposures) {
+ Bool overlap;
+
+ RegionValidate(&totalReg, &overlap);
+ (*pDst->pScreen->SendGraphicsExpose) (client, &totalReg,
+ stuff->dstDrawable,
+ X_CopyArea, 0);
+ RegionUninit(&totalReg);
+ }
}
return Success;
}
-
-int PanoramiXCopyPlane(ClientPtr client)
+int
+PanoramiXCopyPlane(ClientPtr client)
{
- int j, srcx, srcy, dstx, dsty, rc;
- PanoramiXRes *gc, *src, *dst;
- Bool srcIsRoot = FALSE;
- Bool dstIsRoot = FALSE;
- Bool srcShared, dstShared;
- DrawablePtr psrcDraw, pdstDraw = NULL;
- GCPtr pGC = NULL;
- RegionRec totalReg;
+ int j, srcx, srcy, dstx, dsty, rc;
+ PanoramiXRes *gc, *src, *dst;
+ Bool srcIsRoot = FALSE;
+ Bool dstIsRoot = FALSE;
+ Bool srcShared, dstShared;
+ DrawablePtr psrcDraw, pdstDraw = NULL;
+ GCPtr pGC = NULL;
+ RegionRec totalReg;
+
REQUEST(xCopyPlaneReq);
REQUEST_SIZE_MATCH(xCopyPlaneReq);
- rc = dixLookupResourceByClass((pointer *)&src, stuff->srcDrawable,
- XRC_DRAWABLE, client, DixReadAccess);
+ rc = dixLookupResourceByClass((pointer *) &src, stuff->srcDrawable,
+ XRC_DRAWABLE, client, DixReadAccess);
if (rc != Success)
- return (rc == BadValue) ? BadDrawable : rc;
+ return (rc == BadValue) ? BadDrawable : rc;
srcShared = IS_SHARED_PIXMAP(src);
- rc = dixLookupResourceByClass((pointer *)&dst, stuff->dstDrawable,
- XRC_DRAWABLE, client, DixWriteAccess);
+ rc = dixLookupResourceByClass((pointer *) &dst, stuff->dstDrawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
if (rc != Success)
- return (rc == BadValue) ? BadDrawable : rc;
+ return (rc == BadValue) ? BadDrawable : rc;
dstShared = IS_SHARED_PIXMAP(dst);
- if(dstShared && srcShared)
- return (* SavedProcVector[X_CopyPlane])(client);
+ if (dstShared && srcShared)
+ return (*SavedProcVector[X_CopyPlane]) (client);
- rc = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixReadAccess);
+ rc = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixReadAccess);
if (rc != Success)
- return rc;
+ return rc;
- if((dst->type == XRT_WINDOW) && dst->u.win.root)
- dstIsRoot = TRUE;
- if((src->type == XRT_WINDOW) && src->u.win.root)
- srcIsRoot = TRUE;
+ if ((dst->type == XRT_WINDOW) && dst->u.win.root)
+ dstIsRoot = TRUE;
+ if ((src->type == XRT_WINDOW) && src->u.win.root)
+ srcIsRoot = TRUE;
+
+ srcx = stuff->srcX;
+ srcy = stuff->srcY;
+ dstx = stuff->dstX;
+ dsty = stuff->dstY;
- srcx = stuff->srcX; srcy = stuff->srcY;
- dstx = stuff->dstX; dsty = stuff->dstY;
-
RegionNull(&totalReg);
FOR_NSCREENS_BACKWARD(j) {
- RegionPtr pRgn;
- stuff->dstDrawable = dst->info[j].id;
- stuff->srcDrawable = src->info[j].id;
- stuff->gc = gc->info[j].id;
- if (srcIsRoot) {
- stuff->srcX = srcx - screenInfo.screens[j]->x;
- stuff->srcY = srcy - screenInfo.screens[j]->y;
- }
- if (dstIsRoot) {
- stuff->dstX = dstx - screenInfo.screens[j]->x;
- stuff->dstY = dsty - screenInfo.screens[j]->y;
- }
-
- VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, DixWriteAccess);
- if (stuff->dstDrawable != stuff->srcDrawable) {
- rc = dixLookupDrawable(&psrcDraw, stuff->srcDrawable, client, 0,
- DixReadAccess);
- if (rc != Success)
- return rc;
+ RegionPtr pRgn;
+
+ stuff->dstDrawable = dst->info[j].id;
+ stuff->srcDrawable = src->info[j].id;
+ stuff->gc = gc->info[j].id;
+ if (srcIsRoot) {
+ stuff->srcX = srcx - screenInfo.screens[j]->x;
+ stuff->srcY = srcy - screenInfo.screens[j]->y;
+ }
+ if (dstIsRoot) {
+ stuff->dstX = dstx - screenInfo.screens[j]->x;
+ stuff->dstY = dsty - screenInfo.screens[j]->y;
+ }
+
+ VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, DixWriteAccess);
+ if (stuff->dstDrawable != stuff->srcDrawable) {
+ rc = dixLookupDrawable(&psrcDraw, stuff->srcDrawable, client, 0,
+ DixReadAccess);
+ if (rc != Success)
+ return rc;
if (pdstDraw->pScreen != psrcDraw->pScreen) {
- client->errorValue = stuff->dstDrawable;
- return BadMatch;
- }
- } else
- psrcDraw = pdstDraw;
-
- if(stuff->bitPlane == 0 || (stuff->bitPlane & (stuff->bitPlane - 1)) ||
- (stuff->bitPlane > (1L << (psrcDraw->depth - 1)))) {
- client->errorValue = stuff->bitPlane;
- return BadValue;
- }
-
- pRgn = (*pGC->ops->CopyPlane)(psrcDraw, pdstDraw, pGC,
- stuff->srcX, stuff->srcY,
- stuff->width, stuff->height,
- stuff->dstX, stuff->dstY, stuff->bitPlane);
- if(pGC->graphicsExposures && pRgn) {
- RegionAppend(&totalReg, pRgn);
- RegionDestroy(pRgn);
- }
-
- if(dstShared)
- break;
- }
-
- if(pGC->graphicsExposures) {
- Bool overlap;
- RegionValidate(&totalReg, &overlap);
- (*pdstDraw->pScreen->SendGraphicsExpose)(
- client, &totalReg, stuff->dstDrawable, X_CopyPlane, 0);
- RegionUninit(&totalReg);
+ client->errorValue = stuff->dstDrawable;
+ return BadMatch;
+ }
+ }
+ else
+ psrcDraw = pdstDraw;
+
+ if (stuff->bitPlane == 0 || (stuff->bitPlane & (stuff->bitPlane - 1)) ||
+ (stuff->bitPlane > (1L << (psrcDraw->depth - 1)))) {
+ client->errorValue = stuff->bitPlane;
+ return BadValue;
+ }
+
+ pRgn = (*pGC->ops->CopyPlane) (psrcDraw, pdstDraw, pGC,
+ stuff->srcX, stuff->srcY,
+ stuff->width, stuff->height,
+ stuff->dstX, stuff->dstY,
+ stuff->bitPlane);
+ if (pGC->graphicsExposures && pRgn) {
+ RegionAppend(&totalReg, pRgn);
+ RegionDestroy(pRgn);
+ }
+
+ if (dstShared)
+ break;
+ }
+
+ if (pGC->graphicsExposures) {
+ Bool overlap;
+
+ RegionValidate(&totalReg, &overlap);
+ (*pdstDraw->pScreen->SendGraphicsExpose) (client, &totalReg,
+ stuff->dstDrawable,
+ X_CopyPlane, 0);
+ RegionUninit(&totalReg);
}
return Success;
}
-
-int PanoramiXPolyPoint(ClientPtr client)
+int
+PanoramiXPolyPoint(ClientPtr client)
{
PanoramiXRes *gc, *draw;
- int result, npoint, j;
- xPoint *origPts;
- Bool isRoot;
+ int result, npoint, j;
+ xPoint *origPts;
+ Bool isRoot;
+
REQUEST(xPolyPointReq);
REQUEST_AT_LEAST_SIZE(xPolyPointReq);
- result = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
+ result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
if (result != Success)
- return (result == BadValue) ? BadDrawable : result;
+ return (result == BadValue) ? BadDrawable : result;
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolyPoint])(client);
+ if (IS_SHARED_PIXMAP(draw))
+ return (*SavedProcVector[X_PolyPoint]) (client);
- result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyPointReq));
if (npoint > 0) {
origPts = malloc(npoint * sizeof(xPoint));
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
- FOR_NSCREENS_FORWARD(j){
+ FOR_NSCREENS_FORWARD(j) {
- if(j) memcpy(&stuff[1], origPts, npoint * sizeof(xPoint));
+ if (j)
+ memcpy(&stuff[1], origPts, npoint * sizeof(xPoint));
if (isRoot) {
int x_off = screenInfo.screens[j]->x;
int y_off = screenInfo.screens[j]->y;
- if(x_off || y_off) {
- xPoint *pnts = (xPoint*)&stuff[1];
- int i = (stuff->coordMode==CoordModePrevious) ? 1 : npoint;
+ if (x_off || y_off) {
+ xPoint *pnts = (xPoint *) & stuff[1];
+ int i =
+ (stuff->coordMode == CoordModePrevious) ? 1 : npoint;
- while(i--) {
- pnts->x -= x_off;
- pnts->y -= y_off;
- pnts++;
+ while (i--) {
+ pnts->x -= x_off;
+ pnts->y -= y_off;
+ pnts++;
}
- }
+ }
}
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_PolyPoint])(client);
- if(result != Success) break;
+ stuff->drawable = draw->info[j].id;
+ stuff->gc = gc->info[j].id;
+ result = (*SavedProcVector[X_PolyPoint]) (client);
+ if (result != Success)
+ break;
}
free(origPts);
return result;
- } else
- return Success;
+ }
+ else
+ return Success;
}
-
-int PanoramiXPolyLine(ClientPtr client)
+int
+PanoramiXPolyLine(ClientPtr client)
{
PanoramiXRes *gc, *draw;
- int result, npoint, j;
- xPoint *origPts;
- Bool isRoot;
+ int result, npoint, j;
+ xPoint *origPts;
+ Bool isRoot;
+
REQUEST(xPolyLineReq);
REQUEST_AT_LEAST_SIZE(xPolyLineReq);
- result = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
+ result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
if (result != Success)
- return (result == BadValue) ? BadDrawable : result;
+ return (result == BadValue) ? BadDrawable : result;
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolyLine])(client);
+ if (IS_SHARED_PIXMAP(draw))
+ return (*SavedProcVector[X_PolyLine]) (client);
- result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
isRoot = IS_ROOT_DRAWABLE(draw);
npoint = bytes_to_int32((client->req_len << 2) - sizeof(xPolyLineReq));
- if (npoint > 0){
+ if (npoint > 0) {
origPts = malloc(npoint * sizeof(xPoint));
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
- FOR_NSCREENS_FORWARD(j){
+ FOR_NSCREENS_FORWARD(j) {
- if(j) memcpy(&stuff[1], origPts, npoint * sizeof(xPoint));
+ if (j)
+ memcpy(&stuff[1], origPts, npoint * sizeof(xPoint));
if (isRoot) {
int x_off = screenInfo.screens[j]->x;
int y_off = screenInfo.screens[j]->y;
- if(x_off || y_off) {
- xPoint *pnts = (xPoint*)&stuff[1];
- int i = (stuff->coordMode==CoordModePrevious) ? 1 : npoint;
+ if (x_off || y_off) {
+ xPoint *pnts = (xPoint *) & stuff[1];
+ int i =
+ (stuff->coordMode == CoordModePrevious) ? 1 : npoint;
- while(i--) {
- pnts->x -= x_off;
- pnts->y -= y_off;
- pnts++;
- }
- }
+ while (i--) {
+ pnts->x -= x_off;
+ pnts->y -= y_off;
+ pnts++;
+ }
+ }
}
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_PolyLine])(client);
- if(result != Success) break;
+ stuff->drawable = draw->info[j].id;
+ stuff->gc = gc->info[j].id;
+ result = (*SavedProcVector[X_PolyLine]) (client);
+ if (result != Success)
+ break;
}
free(origPts);
return result;
- } else
- return Success;
+ }
+ else
+ return Success;
}
-
-int PanoramiXPolySegment(ClientPtr client)
+int
+PanoramiXPolySegment(ClientPtr client)
{
- int result, nsegs, i, j;
+ int result, nsegs, i, j;
PanoramiXRes *gc, *draw;
- xSegment *origSegs;
- Bool isRoot;
+ xSegment *origSegs;
+ Bool isRoot;
+
REQUEST(xPolySegmentReq);
REQUEST_AT_LEAST_SIZE(xPolySegmentReq);
- result = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
+ result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
if (result != Success)
- return (result == BadValue) ? BadDrawable : result;
+ return (result == BadValue) ? BadDrawable : result;
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolySegment])(client);
+ if (IS_SHARED_PIXMAP(draw))
+ return (*SavedProcVector[X_PolySegment]) (client);
- result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
isRoot = IS_ROOT_DRAWABLE(draw);
nsegs = (client->req_len << 2) - sizeof(xPolySegmentReq);
- if(nsegs & 4) return BadLength;
+ if (nsegs & 4)
+ return BadLength;
nsegs >>= 3;
if (nsegs > 0) {
- origSegs = malloc(nsegs * sizeof(xSegment));
+ origSegs = malloc(nsegs * sizeof(xSegment));
memcpy((char *) origSegs, (char *) &stuff[1], nsegs * sizeof(xSegment));
- FOR_NSCREENS_FORWARD(j){
+ FOR_NSCREENS_FORWARD(j) {
- if(j) memcpy(&stuff[1], origSegs, nsegs * sizeof(xSegment));
+ if (j)
+ memcpy(&stuff[1], origSegs, nsegs * sizeof(xSegment));
if (isRoot) {
int x_off = screenInfo.screens[j]->x;
int y_off = screenInfo.screens[j]->y;
- if(x_off || y_off) {
- xSegment *segs = (xSegment*)&stuff[1];
+ if (x_off || y_off) {
+ xSegment *segs = (xSegment *) & stuff[1];
- for (i = nsegs; i--; segs++) {
- segs->x1 -= x_off;
- segs->x2 -= x_off;
- segs->y1 -= y_off;
- segs->y2 -= y_off;
- }
- }
+ for (i = nsegs; i--; segs++) {
+ segs->x1 -= x_off;
+ segs->x2 -= x_off;
+ segs->y1 -= y_off;
+ segs->y2 -= y_off;
+ }
+ }
}
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_PolySegment])(client);
- if(result != Success) break;
- }
- free(origSegs);
- return result;
- } else
- return Success;
+ stuff->drawable = draw->info[j].id;
+ stuff->gc = gc->info[j].id;
+ result = (*SavedProcVector[X_PolySegment]) (client);
+ if (result != Success)
+ break;
+ }
+ free(origSegs);
+ return result;
+ }
+ else
+ return Success;
}
-
-int PanoramiXPolyRectangle(ClientPtr client)
+int
+PanoramiXPolyRectangle(ClientPtr client)
{
- int result, nrects, i, j;
+ int result, nrects, i, j;
PanoramiXRes *gc, *draw;
- Bool isRoot;
- xRectangle *origRecs;
+ Bool isRoot;
+ xRectangle *origRecs;
+
REQUEST(xPolyRectangleReq);
REQUEST_AT_LEAST_SIZE(xPolyRectangleReq);
- result = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
+ result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
if (result != Success)
- return (result == BadValue) ? BadDrawable : result;
+ return (result == BadValue) ? BadDrawable : result;
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolyRectangle])(client);
+ if (IS_SHARED_PIXMAP(draw))
+ return (*SavedProcVector[X_PolyRectangle]) (client);
- result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
isRoot = IS_ROOT_DRAWABLE(draw);
nrects = (client->req_len << 2) - sizeof(xPolyRectangleReq);
- if(nrects & 4) return BadLength;
+ if (nrects & 4)
+ return BadLength;
nrects >>= 3;
- if (nrects > 0){
- origRecs = malloc(nrects * sizeof(xRectangle));
- memcpy((char *)origRecs,(char *)&stuff[1],nrects * sizeof(xRectangle));
- FOR_NSCREENS_FORWARD(j){
-
- if(j) memcpy(&stuff[1], origRecs, nrects * sizeof(xRectangle));
-
- if (isRoot) {
- int x_off = screenInfo.screens[j]->x;
- int y_off = screenInfo.screens[j]->y;
-
-
- if(x_off || y_off) {
- xRectangle *rects = (xRectangle *) &stuff[1];
-
- for (i = nrects; i--; rects++) {
- rects->x -= x_off;
- rects->y -= y_off;
- }
- }
- }
-
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_PolyRectangle])(client);
- if(result != Success) break;
- }
- free(origRecs);
- return result;
- } else
- return Success;
-}
+ if (nrects > 0) {
+ origRecs = malloc(nrects * sizeof(xRectangle));
+ memcpy((char *) origRecs, (char *) &stuff[1],
+ nrects * sizeof(xRectangle));
+ FOR_NSCREENS_FORWARD(j) {
+
+ if (j)
+ memcpy(&stuff[1], origRecs, nrects * sizeof(xRectangle));
+
+ if (isRoot) {
+ int x_off = screenInfo.screens[j]->x;
+ int y_off = screenInfo.screens[j]->y;
+ if (x_off || y_off) {
+ xRectangle *rects = (xRectangle *) &stuff[1];
+
+ for (i = nrects; i--; rects++) {
+ rects->x -= x_off;
+ rects->y -= y_off;
+ }
+ }
+ }
+
+ stuff->drawable = draw->info[j].id;
+ stuff->gc = gc->info[j].id;
+ result = (*SavedProcVector[X_PolyRectangle]) (client);
+ if (result != Success)
+ break;
+ }
+ free(origRecs);
+ return result;
+ }
+ else
+ return Success;
+}
-int PanoramiXPolyArc(ClientPtr client)
+int
+PanoramiXPolyArc(ClientPtr client)
{
- int result, narcs, i, j;
+ int result, narcs, i, j;
PanoramiXRes *gc, *draw;
- Bool isRoot;
- xArc *origArcs;
+ Bool isRoot;
+ xArc *origArcs;
+
REQUEST(xPolyArcReq);
REQUEST_AT_LEAST_SIZE(xPolyArcReq);
- result = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
+ result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
if (result != Success)
- return (result == BadValue) ? BadDrawable : result;
+ return (result == BadValue) ? BadDrawable : result;
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolyArc])(client);
+ if (IS_SHARED_PIXMAP(draw))
+ return (*SavedProcVector[X_PolyArc]) (client);
- result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
isRoot = IS_ROOT_DRAWABLE(draw);
narcs = (client->req_len << 2) - sizeof(xPolyArcReq);
- if(narcs % sizeof(xArc)) return BadLength;
+ if (narcs % sizeof(xArc))
+ return BadLength;
narcs /= sizeof(xArc);
- if (narcs > 0){
- origArcs = malloc(narcs * sizeof(xArc));
- memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc));
- FOR_NSCREENS_FORWARD(j){
-
- if(j) memcpy(&stuff[1], origArcs, narcs * sizeof(xArc));
-
- if (isRoot) {
- int x_off = screenInfo.screens[j]->x;
- int y_off = screenInfo.screens[j]->y;
-
- if(x_off || y_off) {
- xArc *arcs = (xArc *) &stuff[1];
-
- for (i = narcs; i--; arcs++) {
- arcs->x -= x_off;
- arcs->y -= y_off;
- }
- }
+ if (narcs > 0) {
+ origArcs = malloc(narcs * sizeof(xArc));
+ memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc));
+ FOR_NSCREENS_FORWARD(j) {
+
+ if (j)
+ memcpy(&stuff[1], origArcs, narcs * sizeof(xArc));
+
+ if (isRoot) {
+ int x_off = screenInfo.screens[j]->x;
+ int y_off = screenInfo.screens[j]->y;
+
+ if (x_off || y_off) {
+ xArc *arcs = (xArc *) & stuff[1];
+
+ for (i = narcs; i--; arcs++) {
+ arcs->x -= x_off;
+ arcs->y -= y_off;
+ }
+ }
}
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_PolyArc])(client);
- if(result != Success) break;
+ stuff->drawable = draw->info[j].id;
+ stuff->gc = gc->info[j].id;
+ result = (*SavedProcVector[X_PolyArc]) (client);
+ if (result != Success)
+ break;
}
- free(origArcs);
- return result;
- } else
- return Success;
+ free(origArcs);
+ return result;
+ }
+ else
+ return Success;
}
-
-int PanoramiXFillPoly(ClientPtr client)
+int
+PanoramiXFillPoly(ClientPtr client)
{
- int result, count, j;
+ int result, count, j;
PanoramiXRes *gc, *draw;
- Bool isRoot;
- DDXPointPtr locPts;
+ Bool isRoot;
+ DDXPointPtr locPts;
+
REQUEST(xFillPolyReq);
REQUEST_AT_LEAST_SIZE(xFillPolyReq);
- result = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
+ result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
if (result != Success)
- return (result == BadValue) ? BadDrawable : result;
+ return (result == BadValue) ? BadDrawable : result;
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_FillPoly])(client);
+ if (IS_SHARED_PIXMAP(draw))
+ return (*SavedProcVector[X_FillPoly]) (client);
- result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
isRoot = IS_ROOT_DRAWABLE(draw);
count = bytes_to_int32((client->req_len << 2) - sizeof(xFillPolyReq));
- if (count > 0){
- locPts = malloc(count * sizeof(DDXPointRec));
- memcpy((char *)locPts, (char *)&stuff[1], count * sizeof(DDXPointRec));
- FOR_NSCREENS_FORWARD(j){
-
- if(j) memcpy(&stuff[1], locPts, count * sizeof(DDXPointRec));
-
- if (isRoot) {
- int x_off = screenInfo.screens[j]->x;
- int y_off = screenInfo.screens[j]->y;
-
- if(x_off || y_off) {
- DDXPointPtr pnts = (DDXPointPtr)&stuff[1];
- int i = (stuff->coordMode==CoordModePrevious) ? 1 : count;
-
- while(i--) {
- pnts->x -= x_off;
- pnts->y -= y_off;
- pnts++;
- }
- }
- }
-
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_FillPoly])(client);
- if(result != Success) break;
- }
- free(locPts);
- return result;
- } else
- return Success;
-}
+ if (count > 0) {
+ locPts = malloc(count * sizeof(DDXPointRec));
+ memcpy((char *) locPts, (char *) &stuff[1],
+ count * sizeof(DDXPointRec));
+ FOR_NSCREENS_FORWARD(j) {
+
+ if (j)
+ memcpy(&stuff[1], locPts, count * sizeof(DDXPointRec));
+
+ if (isRoot) {
+ int x_off = screenInfo.screens[j]->x;
+ int y_off = screenInfo.screens[j]->y;
+ if (x_off || y_off) {
+ DDXPointPtr pnts = (DDXPointPtr) & stuff[1];
+ int i = (stuff->coordMode == CoordModePrevious) ? 1 : count;
-int PanoramiXPolyFillRectangle(ClientPtr client)
+ while (i--) {
+ pnts->x -= x_off;
+ pnts->y -= y_off;
+ pnts++;
+ }
+ }
+ }
+
+ stuff->drawable = draw->info[j].id;
+ stuff->gc = gc->info[j].id;
+ result = (*SavedProcVector[X_FillPoly]) (client);
+ if (result != Success)
+ break;
+ }
+ free(locPts);
+ return result;
+ }
+ else
+ return Success;
+}
+
+int
+PanoramiXPolyFillRectangle(ClientPtr client)
{
- int result, things, i, j;
+ int result, things, i, j;
PanoramiXRes *gc, *draw;
- Bool isRoot;
- xRectangle *origRects;
+ Bool isRoot;
+ xRectangle *origRects;
+
REQUEST(xPolyFillRectangleReq);
REQUEST_AT_LEAST_SIZE(xPolyFillRectangleReq);
- result = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
+ result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
if (result != Success)
- return (result == BadValue) ? BadDrawable : result;
+ return (result == BadValue) ? BadDrawable : result;
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolyFillRectangle])(client);
+ if (IS_SHARED_PIXMAP(draw))
+ return (*SavedProcVector[X_PolyFillRectangle]) (client);
- result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
isRoot = IS_ROOT_DRAWABLE(draw);
things = (client->req_len << 2) - sizeof(xPolyFillRectangleReq);
- if(things & 4) return BadLength;
+ if (things & 4)
+ return BadLength;
things >>= 3;
- if (things > 0){
- origRects = malloc(things * sizeof(xRectangle));
- memcpy((char*)origRects,(char*)&stuff[1], things * sizeof(xRectangle));
- FOR_NSCREENS_FORWARD(j){
-
- if(j) memcpy(&stuff[1], origRects, things * sizeof(xRectangle));
-
- if (isRoot) {
- int x_off = screenInfo.screens[j]->x;
- int y_off = screenInfo.screens[j]->y;
-
- if(x_off || y_off) {
- xRectangle *rects = (xRectangle *) &stuff[1];
-
- for (i = things; i--; rects++) {
- rects->x -= x_off;
- rects->y -= y_off;
- }
- }
- }
-
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_PolyFillRectangle])(client);
- if(result != Success) break;
- }
- free(origRects);
- return result;
- } else
- return Success;
-}
+ if (things > 0) {
+ origRects = malloc(things * sizeof(xRectangle));
+ memcpy((char *) origRects, (char *) &stuff[1],
+ things * sizeof(xRectangle));
+ FOR_NSCREENS_FORWARD(j) {
+
+ if (j)
+ memcpy(&stuff[1], origRects, things * sizeof(xRectangle));
+
+ if (isRoot) {
+ int x_off = screenInfo.screens[j]->x;
+ int y_off = screenInfo.screens[j]->y;
+
+ if (x_off || y_off) {
+ xRectangle *rects = (xRectangle *) &stuff[1];
+
+ for (i = things; i--; rects++) {
+ rects->x -= x_off;
+ rects->y -= y_off;
+ }
+ }
+ }
+ stuff->drawable = draw->info[j].id;
+ stuff->gc = gc->info[j].id;
+ result = (*SavedProcVector[X_PolyFillRectangle]) (client);
+ if (result != Success)
+ break;
+ }
+ free(origRects);
+ return result;
+ }
+ else
+ return Success;
+}
-int PanoramiXPolyFillArc(ClientPtr client)
+int
+PanoramiXPolyFillArc(ClientPtr client)
{
PanoramiXRes *gc, *draw;
- Bool isRoot;
- int result, narcs, i, j;
- xArc *origArcs;
+ Bool isRoot;
+ int result, narcs, i, j;
+ xArc *origArcs;
+
REQUEST(xPolyFillArcReq);
REQUEST_AT_LEAST_SIZE(xPolyFillArcReq);
- result = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
+ result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
if (result != Success)
- return (result == BadValue) ? BadDrawable : result;
+ return (result == BadValue) ? BadDrawable : result;
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolyFillArc])(client);
+ if (IS_SHARED_PIXMAP(draw))
+ return (*SavedProcVector[X_PolyFillArc]) (client);
- result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
isRoot = IS_ROOT_DRAWABLE(draw);
narcs = (client->req_len << 2) - sizeof(xPolyFillArcReq);
- if (narcs % sizeof(xArc)) return BadLength;
+ if (narcs % sizeof(xArc))
+ return BadLength;
narcs /= sizeof(xArc);
if (narcs > 0) {
- origArcs = malloc(narcs * sizeof(xArc));
- memcpy((char *) origArcs, (char *)&stuff[1], narcs * sizeof(xArc));
- FOR_NSCREENS_FORWARD(j){
-
- if(j) memcpy(&stuff[1], origArcs, narcs * sizeof(xArc));
-
- if (isRoot) {
- int x_off = screenInfo.screens[j]->x;
- int y_off = screenInfo.screens[j]->y;
-
- if(x_off || y_off) {
- xArc *arcs = (xArc *) &stuff[1];
-
- for (i = narcs; i--; arcs++) {
- arcs->x -= x_off;
- arcs->y -= y_off;
- }
- }
- }
-
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_PolyFillArc])(client);
- if(result != Success) break;
- }
- free(origArcs);
- return result;
- } else
- return Success;
-}
+ origArcs = malloc(narcs * sizeof(xArc));
+ memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc));
+ FOR_NSCREENS_FORWARD(j) {
+
+ if (j)
+ memcpy(&stuff[1], origArcs, narcs * sizeof(xArc));
+ if (isRoot) {
+ int x_off = screenInfo.screens[j]->x;
+ int y_off = screenInfo.screens[j]->y;
-int PanoramiXPutImage(ClientPtr client)
+ if (x_off || y_off) {
+ xArc *arcs = (xArc *) & stuff[1];
+
+ for (i = narcs; i--; arcs++) {
+ arcs->x -= x_off;
+ arcs->y -= y_off;
+ }
+ }
+ }
+
+ stuff->drawable = draw->info[j].id;
+ stuff->gc = gc->info[j].id;
+ result = (*SavedProcVector[X_PolyFillArc]) (client);
+ if (result != Success)
+ break;
+ }
+ free(origArcs);
+ return result;
+ }
+ else
+ return Success;
+}
+
+int
+PanoramiXPutImage(ClientPtr client)
{
PanoramiXRes *gc, *draw;
- Bool isRoot;
- int j, result, orig_x, orig_y;
+ Bool isRoot;
+ int j, result, orig_x, orig_y;
+
REQUEST(xPutImageReq);
REQUEST_AT_LEAST_SIZE(xPutImageReq);
- result = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
+ result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
if (result != Success)
- return (result == BadValue) ? BadDrawable : result;
+ return (result == BadValue) ? BadDrawable : result;
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PutImage])(client);
+ if (IS_SHARED_PIXMAP(draw))
+ return (*SavedProcVector[X_PutImage]) (client);
- result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
isRoot = IS_ROOT_DRAWABLE(draw);
orig_x = stuff->dstX;
orig_y = stuff->dstY;
- FOR_NSCREENS_BACKWARD(j){
- if (isRoot) {
- stuff->dstX = orig_x - screenInfo.screens[j]->x;
- stuff->dstY = orig_y - screenInfo.screens[j]->y;
- }
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- result = (* SavedProcVector[X_PutImage])(client);
- if(result != Success) break;
+ FOR_NSCREENS_BACKWARD(j) {
+ if (isRoot) {
+ stuff->dstX = orig_x - screenInfo.screens[j]->x;
+ stuff->dstY = orig_y - screenInfo.screens[j]->y;
+ }
+ stuff->drawable = draw->info[j].id;
+ stuff->gc = gc->info[j].id;
+ result = (*SavedProcVector[X_PutImage]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXGetImage(ClientPtr client)
+int
+PanoramiXGetImage(ClientPtr client)
{
- DrawablePtr drawables[MAXSCREENS];
- DrawablePtr pDraw;
- PanoramiXRes *draw;
- xGetImageReply xgi;
- Bool isRoot;
- char *pBuf;
- int i, x, y, w, h, format, rc;
- Mask plane = 0, planemask;
- int linesDone, nlines, linesPerBuf;
- long widthBytesLine, length;
+ DrawablePtr drawables[MAXSCREENS];
+ DrawablePtr pDraw;
+ PanoramiXRes *draw;
+ xGetImageReply xgi;
+ Bool isRoot;
+ char *pBuf;
+ int i, x, y, w, h, format, rc;
+ Mask plane = 0, planemask;
+ int linesDone, nlines, linesPerBuf;
+ long widthBytesLine, length;
REQUEST(xGetImageReq);
REQUEST_SIZE_MATCH(xGetImageReq);
if ((stuff->format != XYPixmap) && (stuff->format != ZPixmap)) {
- client->errorValue = stuff->format;
+ client->errorValue = stuff->format;
return BadValue;
}
- rc = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
+ rc = dixLookupResourceByClass((pointer *) &draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
if (rc != Success)
- return (rc == BadValue) ? BadDrawable : rc;
+ return (rc == BadValue) ? BadDrawable : rc;
- if(draw->type == XRT_PIXMAP)
- return (*SavedProcVector[X_GetImage])(client);
+ if (draw->type == XRT_PIXMAP)
+ return (*SavedProcVector[X_GetImage]) (client);
- rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
- DixReadAccess);
+ rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0, DixReadAccess);
if (rc != Success)
- return rc;
+ return rc;
- if(!((WindowPtr)pDraw)->realized)
- return BadMatch;
+ if (!((WindowPtr) pDraw)->realized)
+ return BadMatch;
x = stuff->x;
y = stuff->y;
@@ -1820,367 +1927,377 @@ int PanoramiXGetImage(ClientPtr client)
isRoot = IS_ROOT_DRAWABLE(draw);
- if(isRoot) {
- if( /* check for being onscreen */
- x < 0 || x + w > PanoramiXPixWidth ||
- y < 0 || y + h > PanoramiXPixHeight )
- return BadMatch;
- } else {
- if( /* check for being onscreen */
- screenInfo.screens[0]->x + pDraw->x + x < 0 ||
- screenInfo.screens[0]->x + pDraw->x + x + w > PanoramiXPixWidth ||
- screenInfo.screens[0]->y + pDraw->y + y < 0 ||
- screenInfo.screens[0]->y + pDraw->y + y + h > PanoramiXPixHeight ||
- /* check for being inside of border */
- x < - wBorderWidth((WindowPtr)pDraw) ||
- x + w > wBorderWidth((WindowPtr)pDraw) + (int)pDraw->width ||
- y < -wBorderWidth((WindowPtr)pDraw) ||
- y + h > wBorderWidth ((WindowPtr)pDraw) + (int)pDraw->height)
- return BadMatch;
+ if (isRoot) {
+ if ( /* check for being onscreen */
+ x < 0 || x + w > PanoramiXPixWidth ||
+ y < 0 || y + h > PanoramiXPixHeight)
+ return BadMatch;
+ }
+ else {
+ if ( /* check for being onscreen */
+ screenInfo.screens[0]->x + pDraw->x + x < 0 ||
+ screenInfo.screens[0]->x + pDraw->x + x + w > PanoramiXPixWidth
+ || screenInfo.screens[0]->y + pDraw->y + y < 0 ||
+ screenInfo.screens[0]->y + pDraw->y + y + h > PanoramiXPixHeight
+ ||
+ /* check for being inside of border */
+ x < -wBorderWidth((WindowPtr) pDraw) ||
+ x + w > wBorderWidth((WindowPtr) pDraw) + (int) pDraw->width ||
+ y < -wBorderWidth((WindowPtr) pDraw) ||
+ y + h > wBorderWidth((WindowPtr) pDraw) + (int) pDraw->height)
+ return BadMatch;
}
drawables[0] = pDraw;
FOR_NSCREENS_FORWARD_SKIP(i) {
- rc = dixLookupDrawable(drawables+i, draw->info[i].id, client, 0,
- DixGetAttrAccess);
- if (rc != Success)
- return rc;
+ rc = dixLookupDrawable(drawables + i, draw->info[i].id, client, 0,
+ DixGetAttrAccess);
+ if (rc != Success)
+ return rc;
}
- xgi.visual = wVisual (((WindowPtr) pDraw));
+ xgi.visual = wVisual(((WindowPtr) pDraw));
xgi.type = X_Reply;
xgi.sequenceNumber = client->sequence;
xgi.depth = pDraw->depth;
- if(format == ZPixmap) {
- widthBytesLine = PixmapBytePad(w, pDraw->depth);
- length = widthBytesLine * h;
-
+ if (format == ZPixmap) {
+ widthBytesLine = PixmapBytePad(w, pDraw->depth);
+ length = widthBytesLine * h;
- } else {
- widthBytesLine = BitmapBytePad(w);
- plane = ((Mask)1) << (pDraw->depth - 1);
- /* only planes asked for */
- length = widthBytesLine * h *
- Ones(planemask & (plane | (plane - 1)));
+ }
+ else {
+ widthBytesLine = BitmapBytePad(w);
+ plane = ((Mask) 1) << (pDraw->depth - 1);
+ /* only planes asked for */
+ length = widthBytesLine * h * Ones(planemask & (plane | (plane - 1)));
}
xgi.length = bytes_to_int32(length);
if (widthBytesLine == 0 || h == 0)
- linesPerBuf = 0;
+ linesPerBuf = 0;
else if (widthBytesLine >= XINERAMA_IMAGE_BUFSIZE)
- linesPerBuf = 1;
+ linesPerBuf = 1;
else {
- linesPerBuf = XINERAMA_IMAGE_BUFSIZE / widthBytesLine;
- if (linesPerBuf > h)
- linesPerBuf = h;
+ linesPerBuf = XINERAMA_IMAGE_BUFSIZE / widthBytesLine;
+ if (linesPerBuf > h)
+ linesPerBuf = h;
}
length = linesPerBuf * widthBytesLine;
- if(!(pBuf = malloc(length)))
- return BadAlloc;
+ if (!(pBuf = malloc(length)))
+ return BadAlloc;
- WriteReplyToClient(client, sizeof (xGetImageReply), &xgi);
+ WriteReplyToClient(client, sizeof(xGetImageReply), &xgi);
if (linesPerBuf == 0) {
- /* nothing to do */
+ /* nothing to do */
}
else if (format == ZPixmap) {
linesDone = 0;
while (h - linesDone > 0) {
- nlines = min(linesPerBuf, h - linesDone);
+ nlines = min(linesPerBuf, h - linesDone);
- if(pDraw->depth == 1)
- memset(pBuf, 0, nlines * widthBytesLine);
+ if (pDraw->depth == 1)
+ memset(pBuf, 0, nlines * widthBytesLine);
- XineramaGetImageData(drawables, x, y + linesDone, w, nlines,
- format, planemask, pBuf, widthBytesLine, isRoot);
+ XineramaGetImageData(drawables, x, y + linesDone, w, nlines,
+ format, planemask, pBuf, widthBytesLine,
+ isRoot);
- (void)WriteToClient(client,
- (int)(nlines * widthBytesLine),
- pBuf);
- linesDone += nlines;
+ (void) WriteToClient(client, (int) (nlines * widthBytesLine), pBuf);
+ linesDone += nlines;
}
- } else { /* XYPixmap */
+ }
+ else { /* XYPixmap */
for (; plane; plane >>= 1) {
- if (planemask & plane) {
- linesDone = 0;
- while (h - linesDone > 0) {
- nlines = min(linesPerBuf, h - linesDone);
+ if (planemask & plane) {
+ linesDone = 0;
+ while (h - linesDone > 0) {
+ nlines = min(linesPerBuf, h - linesDone);
- memset(pBuf, 0, nlines * widthBytesLine);
+ memset(pBuf, 0, nlines * widthBytesLine);
- XineramaGetImageData(drawables, x, y + linesDone, w,
- nlines, format, plane, pBuf,
- widthBytesLine, isRoot);
+ XineramaGetImageData(drawables, x, y + linesDone, w,
+ nlines, format, plane, pBuf,
+ widthBytesLine, isRoot);
- (void)WriteToClient(client,
- (int)(nlines * widthBytesLine),
- pBuf);
+ (void) WriteToClient(client,
+ (int) (nlines * widthBytesLine), pBuf);
- linesDone += nlines;
- }
+ linesDone += nlines;
+ }
}
- }
+ }
}
free(pBuf);
return Success;
}
-
/* The text stuff should be rewritten so that duplication happens
at the GlyphBlt level. That is, loading the font and getting
the glyphs should only happen once */
-int
+int
PanoramiXPolyText8(ClientPtr client)
{
PanoramiXRes *gc, *draw;
- Bool isRoot;
- int result, j;
- int orig_x, orig_y;
+ Bool isRoot;
+ int result, j;
+ int orig_x, orig_y;
+
REQUEST(xPolyTextReq);
REQUEST_AT_LEAST_SIZE(xPolyTextReq);
- result = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
+ result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
if (result != Success)
- return (result == BadValue) ? BadDrawable : result;
+ return (result == BadValue) ? BadDrawable : result;
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolyText8])(client);
+ if (IS_SHARED_PIXMAP(draw))
+ return (*SavedProcVector[X_PolyText8]) (client);
- result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
isRoot = IS_ROOT_DRAWABLE(draw);
orig_x = stuff->x;
orig_y = stuff->y;
- FOR_NSCREENS_BACKWARD(j){
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- if (isRoot) {
- stuff->x = orig_x - screenInfo.screens[j]->x;
- stuff->y = orig_y - screenInfo.screens[j]->y;
- }
- result = (*SavedProcVector[X_PolyText8])(client);
- if(result != Success) break;
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->drawable = draw->info[j].id;
+ stuff->gc = gc->info[j].id;
+ if (isRoot) {
+ stuff->x = orig_x - screenInfo.screens[j]->x;
+ stuff->y = orig_y - screenInfo.screens[j]->y;
+ }
+ result = (*SavedProcVector[X_PolyText8]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-int
+int
PanoramiXPolyText16(ClientPtr client)
{
PanoramiXRes *gc, *draw;
- Bool isRoot;
- int result, j;
- int orig_x, orig_y;
+ Bool isRoot;
+ int result, j;
+ int orig_x, orig_y;
+
REQUEST(xPolyTextReq);
REQUEST_AT_LEAST_SIZE(xPolyTextReq);
- result = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
+ result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
if (result != Success)
- return (result == BadValue) ? BadDrawable : result;
+ return (result == BadValue) ? BadDrawable : result;
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_PolyText16])(client);
+ if (IS_SHARED_PIXMAP(draw))
+ return (*SavedProcVector[X_PolyText16]) (client);
- result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
isRoot = IS_ROOT_DRAWABLE(draw);
orig_x = stuff->x;
orig_y = stuff->y;
- FOR_NSCREENS_BACKWARD(j){
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- if (isRoot) {
- stuff->x = orig_x - screenInfo.screens[j]->x;
- stuff->y = orig_y - screenInfo.screens[j]->y;
- }
- result = (*SavedProcVector[X_PolyText16])(client);
- if(result != Success) break;
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->drawable = draw->info[j].id;
+ stuff->gc = gc->info[j].id;
+ if (isRoot) {
+ stuff->x = orig_x - screenInfo.screens[j]->x;
+ stuff->y = orig_y - screenInfo.screens[j]->y;
+ }
+ result = (*SavedProcVector[X_PolyText16]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXImageText8(ClientPtr client)
+int
+PanoramiXImageText8(ClientPtr client)
{
- int result, j;
+ int result, j;
PanoramiXRes *gc, *draw;
- Bool isRoot;
- int orig_x, orig_y;
+ Bool isRoot;
+ int orig_x, orig_y;
+
REQUEST(xImageTextReq);
REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars);
- result = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
+ result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
if (result != Success)
- return (result == BadValue) ? BadDrawable : result;
+ return (result == BadValue) ? BadDrawable : result;
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_ImageText8])(client);
+ if (IS_SHARED_PIXMAP(draw))
+ return (*SavedProcVector[X_ImageText8]) (client);
- result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
isRoot = IS_ROOT_DRAWABLE(draw);
orig_x = stuff->x;
orig_y = stuff->y;
- FOR_NSCREENS_BACKWARD(j){
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- if (isRoot) {
- stuff->x = orig_x - screenInfo.screens[j]->x;
- stuff->y = orig_y - screenInfo.screens[j]->y;
- }
- result = (*SavedProcVector[X_ImageText8])(client);
- if(result != Success) break;
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->drawable = draw->info[j].id;
+ stuff->gc = gc->info[j].id;
+ if (isRoot) {
+ stuff->x = orig_x - screenInfo.screens[j]->x;
+ stuff->y = orig_y - screenInfo.screens[j]->y;
+ }
+ result = (*SavedProcVector[X_ImageText8]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXImageText16(ClientPtr client)
+int
+PanoramiXImageText16(ClientPtr client)
{
- int result, j;
+ int result, j;
PanoramiXRes *gc, *draw;
- Bool isRoot;
- int orig_x, orig_y;
+ Bool isRoot;
+ int orig_x, orig_y;
+
REQUEST(xImageTextReq);
REQUEST_FIXED_SIZE(xImageTextReq, stuff->nChars << 1);
- result = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
+ result = dixLookupResourceByClass((pointer *) &draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
if (result != Success)
- return (result == BadValue) ? BadDrawable : result;
+ return (result == BadValue) ? BadDrawable : result;
- if(IS_SHARED_PIXMAP(draw))
- return (*SavedProcVector[X_ImageText16])(client);
+ if (IS_SHARED_PIXMAP(draw))
+ return (*SavedProcVector[X_ImageText16]) (client);
- result = dixLookupResourceByType((pointer *)&gc, stuff->gc, XRT_GC,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &gc, stuff->gc, XRT_GC,
+ client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
isRoot = IS_ROOT_DRAWABLE(draw);
orig_x = stuff->x;
orig_y = stuff->y;
- FOR_NSCREENS_BACKWARD(j){
- stuff->drawable = draw->info[j].id;
- stuff->gc = gc->info[j].id;
- if (isRoot) {
- stuff->x = orig_x - screenInfo.screens[j]->x;
- stuff->y = orig_y - screenInfo.screens[j]->y;
- }
- result = (*SavedProcVector[X_ImageText16])(client);
- if(result != Success) break;
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->drawable = draw->info[j].id;
+ stuff->gc = gc->info[j].id;
+ if (isRoot) {
+ stuff->x = orig_x - screenInfo.screens[j]->x;
+ stuff->y = orig_y - screenInfo.screens[j]->y;
+ }
+ result = (*SavedProcVector[X_ImageText16]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-
-int PanoramiXCreateColormap(ClientPtr client)
+int
+PanoramiXCreateColormap(ClientPtr client)
{
- PanoramiXRes *win, *newCmap;
- int result, j, orig_visual;
+ PanoramiXRes *win, *newCmap;
+ int result, j, orig_visual;
+
REQUEST(xCreateColormapReq);
REQUEST_SIZE_MATCH(xCreateColormapReq);
- result = dixLookupResourceByType((pointer *)&win, stuff->window,
- XRT_WINDOW, client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &win, stuff->window,
+ XRT_WINDOW, client, DixReadAccess);
if (result != Success)
- return result;
+ return result;
- if(!(newCmap = malloc(sizeof(PanoramiXRes))))
+ if (!(newCmap = malloc(sizeof(PanoramiXRes))))
return BadAlloc;
newCmap->type = XRT_COLORMAP;
panoramix_setup_ids(newCmap, client, stuff->mid);
orig_visual = stuff->visual;
- FOR_NSCREENS_BACKWARD(j){
- stuff->mid = newCmap->info[j].id;
- stuff->window = win->info[j].id;
- stuff->visual = PanoramiXTranslateVisualID(j, orig_visual);
- result = (* SavedProcVector[X_CreateColormap])(client);
- if(result != Success) break;
- }
-
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->mid = newCmap->info[j].id;
+ stuff->window = win->info[j].id;
+ stuff->visual = PanoramiXTranslateVisualID(j, orig_visual);
+ result = (*SavedProcVector[X_CreateColormap]) (client);
+ if (result != Success)
+ break;
+ }
+
if (result == Success)
AddResource(newCmap->info[0].id, XRT_COLORMAP, newCmap);
- else
+ else
free(newCmap);
return result;
}
-
-int PanoramiXFreeColormap(ClientPtr client)
+int
+PanoramiXFreeColormap(ClientPtr client)
{
PanoramiXRes *cmap;
- int result, j;
+ int result, j;
+
REQUEST(xResourceReq);
REQUEST_SIZE_MATCH(xResourceReq);
client->errorValue = stuff->id;
- result = dixLookupResourceByType((pointer *)&cmap, stuff->id, XRT_COLORMAP,
- client, DixDestroyAccess);
+ result = dixLookupResourceByType((pointer *) &cmap, stuff->id, XRT_COLORMAP,
+ client, DixDestroyAccess);
if (result != Success)
return result;
FOR_NSCREENS_BACKWARD(j) {
stuff->id = cmap->info[j].id;
- result = (* SavedProcVector[X_FreeColormap])(client);
- if(result != Success) break;
+ result = (*SavedProcVector[X_FreeColormap]) (client);
+ if (result != Success)
+ break;
}
/* Since ProcFreeColormap is using FreeResource, it will free
- our resource for us on the last pass through the loop above */
+ our resource for us on the last pass through the loop above */
return result;
}
-
int
PanoramiXCopyColormapAndFree(ClientPtr client)
{
PanoramiXRes *cmap, *newCmap;
- int result, j;
+ int result, j;
+
REQUEST(xCopyColormapAndFreeReq);
REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq);
client->errorValue = stuff->srcCmap;
- result = dixLookupResourceByType((pointer *)&cmap, stuff->srcCmap,
- XRT_COLORMAP, client,
- DixReadAccess | DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &cmap, stuff->srcCmap,
+ XRT_COLORMAP, client,
+ DixReadAccess | DixWriteAccess);
if (result != Success)
return result;
- if(!(newCmap = malloc(sizeof(PanoramiXRes))))
+ if (!(newCmap = malloc(sizeof(PanoramiXRes))))
return BadAlloc;
newCmap->type = XRT_COLORMAP;
@@ -2188,231 +2305,246 @@ PanoramiXCopyColormapAndFree(ClientPtr client)
FOR_NSCREENS_BACKWARD(j) {
stuff->srcCmap = cmap->info[j].id;
- stuff->mid = newCmap->info[j].id;
- result = (* SavedProcVector[X_CopyColormapAndFree])(client);
- if(result != Success) break;
+ stuff->mid = newCmap->info[j].id;
+ result = (*SavedProcVector[X_CopyColormapAndFree]) (client);
+ if (result != Success)
+ break;
}
if (result == Success)
AddResource(newCmap->info[0].id, XRT_COLORMAP, newCmap);
- else
+ else
free(newCmap);
return result;
}
-
-int PanoramiXInstallColormap(ClientPtr client)
+int
+PanoramiXInstallColormap(ClientPtr client)
{
REQUEST(xResourceReq);
- int result, j;
+ int result, j;
PanoramiXRes *cmap;
REQUEST_SIZE_MATCH(xResourceReq);
client->errorValue = stuff->id;
- result = dixLookupResourceByType((pointer *)&cmap, stuff->id, XRT_COLORMAP,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &cmap, stuff->id, XRT_COLORMAP,
+ client, DixReadAccess);
if (result != Success)
return result;
- FOR_NSCREENS_BACKWARD(j){
- stuff->id = cmap->info[j].id;
- result = (* SavedProcVector[X_InstallColormap])(client);
- if(result != Success) break;
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->id = cmap->info[j].id;
+ result = (*SavedProcVector[X_InstallColormap]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXUninstallColormap(ClientPtr client)
+int
+PanoramiXUninstallColormap(ClientPtr client)
{
REQUEST(xResourceReq);
- int result, j;
+ int result, j;
PanoramiXRes *cmap;
REQUEST_SIZE_MATCH(xResourceReq);
-
+
client->errorValue = stuff->id;
- result = dixLookupResourceByType((pointer *)&cmap, stuff->id, XRT_COLORMAP,
- client, DixReadAccess);
+ result = dixLookupResourceByType((pointer *) &cmap, stuff->id, XRT_COLORMAP,
+ client, DixReadAccess);
if (result != Success)
return result;
FOR_NSCREENS_BACKWARD(j) {
- stuff->id = cmap->info[j].id;
- result = (* SavedProcVector[X_UninstallColormap])(client);
- if(result != Success) break;
+ stuff->id = cmap->info[j].id;
+ result = (*SavedProcVector[X_UninstallColormap]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXAllocColor(ClientPtr client)
+int
+PanoramiXAllocColor(ClientPtr client)
{
- int result, j;
+ int result, j;
PanoramiXRes *cmap;
+
REQUEST(xAllocColorReq);
REQUEST_SIZE_MATCH(xAllocColorReq);
client->errorValue = stuff->cmap;
- result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
- XRT_COLORMAP, client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &cmap, stuff->cmap,
+ XRT_COLORMAP, client, DixWriteAccess);
if (result != Success)
return result;
- FOR_NSCREENS_BACKWARD(j){
- stuff->cmap = cmap->info[j].id;
- result = (* SavedProcVector[X_AllocColor])(client);
- if(result != Success) break;
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->cmap = cmap->info[j].id;
+ result = (*SavedProcVector[X_AllocColor]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXAllocNamedColor(ClientPtr client)
+int
+PanoramiXAllocNamedColor(ClientPtr client)
{
- int result, j;
- PanoramiXRes *cmap;
+ int result, j;
+ PanoramiXRes *cmap;
+
REQUEST(xAllocNamedColorReq);
REQUEST_FIXED_SIZE(xAllocNamedColorReq, stuff->nbytes);
client->errorValue = stuff->cmap;
- result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
- XRT_COLORMAP, client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &cmap, stuff->cmap,
+ XRT_COLORMAP, client, DixWriteAccess);
if (result != Success)
return result;
- FOR_NSCREENS_BACKWARD(j){
+ FOR_NSCREENS_BACKWARD(j) {
stuff->cmap = cmap->info[j].id;
- result = (* SavedProcVector[X_AllocNamedColor])(client);
- if(result != Success) break;
+ result = (*SavedProcVector[X_AllocNamedColor]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXAllocColorCells(ClientPtr client)
+int
+PanoramiXAllocColorCells(ClientPtr client)
{
- int result, j;
- PanoramiXRes *cmap;
+ int result, j;
+ PanoramiXRes *cmap;
+
REQUEST(xAllocColorCellsReq);
REQUEST_SIZE_MATCH(xAllocColorCellsReq);
client->errorValue = stuff->cmap;
- result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
- XRT_COLORMAP, client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &cmap, stuff->cmap,
+ XRT_COLORMAP, client, DixWriteAccess);
if (result != Success)
return result;
-
- FOR_NSCREENS_BACKWARD(j){
- stuff->cmap = cmap->info[j].id;
- result = (* SavedProcVector[X_AllocColorCells])(client);
- if(result != Success) break;
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->cmap = cmap->info[j].id;
+ result = (*SavedProcVector[X_AllocColorCells]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXAllocColorPlanes(ClientPtr client)
+int
+PanoramiXAllocColorPlanes(ClientPtr client)
{
- int result, j;
- PanoramiXRes *cmap;
+ int result, j;
+ PanoramiXRes *cmap;
+
REQUEST(xAllocColorPlanesReq);
REQUEST_SIZE_MATCH(xAllocColorPlanesReq);
client->errorValue = stuff->cmap;
- result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
- XRT_COLORMAP, client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &cmap, stuff->cmap,
+ XRT_COLORMAP, client, DixWriteAccess);
if (result != Success)
return result;
-
- FOR_NSCREENS_BACKWARD(j){
- stuff->cmap = cmap->info[j].id;
- result = (* SavedProcVector[X_AllocColorPlanes])(client);
- if(result != Success) break;
+
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->cmap = cmap->info[j].id;
+ result = (*SavedProcVector[X_AllocColorPlanes]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-
-int PanoramiXFreeColors(ClientPtr client)
+int
+PanoramiXFreeColors(ClientPtr client)
{
- int result, j;
- PanoramiXRes *cmap;
+ int result, j;
+ PanoramiXRes *cmap;
+
REQUEST(xFreeColorsReq);
REQUEST_AT_LEAST_SIZE(xFreeColorsReq);
client->errorValue = stuff->cmap;
- result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
- XRT_COLORMAP, client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &cmap, stuff->cmap,
+ XRT_COLORMAP, client, DixWriteAccess);
if (result != Success)
return result;
FOR_NSCREENS_BACKWARD(j) {
stuff->cmap = cmap->info[j].id;
- result = (* SavedProcVector[X_FreeColors])(client);
+ result = (*SavedProcVector[X_FreeColors]) (client);
}
return result;
}
-
-int PanoramiXStoreColors(ClientPtr client)
+int
+PanoramiXStoreColors(ClientPtr client)
{
- int result, j;
- PanoramiXRes *cmap;
+ int result, j;
+ PanoramiXRes *cmap;
+
REQUEST(xStoreColorsReq);
REQUEST_AT_LEAST_SIZE(xStoreColorsReq);
client->errorValue = stuff->cmap;
- result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
- XRT_COLORMAP, client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &cmap, stuff->cmap,
+ XRT_COLORMAP, client, DixWriteAccess);
if (result != Success)
return result;
- FOR_NSCREENS_BACKWARD(j){
- stuff->cmap = cmap->info[j].id;
- result = (* SavedProcVector[X_StoreColors])(client);
- if(result != Success) break;
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->cmap = cmap->info[j].id;
+ result = (*SavedProcVector[X_StoreColors]) (client);
+ if (result != Success)
+ break;
}
return result;
}
-
-int PanoramiXStoreNamedColor(ClientPtr client)
+int
+PanoramiXStoreNamedColor(ClientPtr client)
{
- int result, j;
- PanoramiXRes *cmap;
+ int result, j;
+ PanoramiXRes *cmap;
+
REQUEST(xStoreNamedColorReq);
REQUEST_FIXED_SIZE(xStoreNamedColorReq, stuff->nbytes);
client->errorValue = stuff->cmap;
- result = dixLookupResourceByType((pointer *)&cmap, stuff->cmap,
- XRT_COLORMAP, client, DixWriteAccess);
+ result = dixLookupResourceByType((pointer *) &cmap, stuff->cmap,
+ XRT_COLORMAP, client, DixWriteAccess);
if (result != Success)
return result;
- FOR_NSCREENS_BACKWARD(j){
- stuff->cmap = cmap->info[j].id;
- result = (* SavedProcVector[X_StoreNamedColor])(client);
- if(result != Success) break;
+ FOR_NSCREENS_BACKWARD(j) {
+ stuff->cmap = cmap->info[j].id;
+ result = (*SavedProcVector[X_StoreNamedColor]) (client);
+ if (result != Success)
+ break;
}
return result;
}
diff --git a/Xext/panoramiXsrv.h b/Xext/panoramiXsrv.h
index 39d495203..7c605fe66 100644
--- a/Xext/panoramiXsrv.h
+++ b/Xext/panoramiXsrv.h
@@ -15,8 +15,9 @@ extern _X_EXPORT int PanoramiXPixHeight;
extern _X_EXPORT VisualID PanoramiXTranslateVisualID(int screen, VisualID orig);
extern _X_EXPORT void PanoramiXConsolidate(void);
extern _X_EXPORT Bool PanoramiXCreateConnectionBlock(void);
-extern _X_EXPORT PanoramiXRes * PanoramiXFindIDByScrnum(RESTYPE, XID, int);
-extern _X_EXPORT Bool XineramaRegisterConnectionBlockCallback(void (*func)(void));
+extern _X_EXPORT PanoramiXRes *PanoramiXFindIDByScrnum(RESTYPE, XID, int);
+extern _X_EXPORT Bool
+XineramaRegisterConnectionBlockCallback(void (*func) (void));
extern _X_EXPORT int XineramaDeleteResource(pointer, XID);
extern _X_EXPORT void XineramaReinitData(void);
@@ -35,24 +36,20 @@ extern _X_EXPORT RESTYPE XRT_PICTURE;
* layers agree that the visuals are equal. The first visual is always from
* screen 0.
*/
-typedef Bool (*XineramaVisualsEqualProcPtr)(VisualPtr, ScreenPtr, VisualPtr);
+typedef Bool (*XineramaVisualsEqualProcPtr) (VisualPtr, ScreenPtr, VisualPtr);
extern _X_EXPORT XineramaVisualsEqualProcPtr XineramaVisualsEqualPtr;
-extern _X_EXPORT void XineramaGetImageData(
- DrawablePtr *pDrawables,
- int left,
- int top,
- int width,
- int height,
- unsigned int format,
- unsigned long planemask,
- char *data,
- int pitch,
- Bool isRoot
-);
-
-static inline void panoramix_setup_ids(PanoramiXRes *resource,
- ClientPtr client, XID base_id)
+extern _X_EXPORT void XineramaGetImageData(DrawablePtr *pDrawables,
+ int left,
+ int top,
+ int width,
+ int height,
+ unsigned int format,
+ unsigned long planemask,
+ char *data, int pitch, Bool isRoot);
+
+static inline void
+panoramix_setup_ids(PanoramiXRes * resource, ClientPtr client, XID base_id)
{
int j;
@@ -62,4 +59,4 @@ static inline void panoramix_setup_ids(PanoramiXRes *resource,
}
}
-#endif /* _PANORAMIXSRV_H_ */
+#endif /* _PANORAMIXSRV_H_ */
diff --git a/Xext/saver.c b/Xext/saver.c
index 18d5e468d..159153c23 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -26,7 +26,6 @@ in this Software without prior written authorization from the X Consortium.
* Author: Keith Packard, MIT X Consortium
*/
-
#ifdef HAVE_DIX_CONFIG_H
#include <dix-config.h>
#endif
@@ -62,39 +61,32 @@ in this Software without prior written authorization from the X Consortium.
static int ScreenSaverEventBase = 0;
-
-static Bool ScreenSaverHandle (
- ScreenPtr /* pScreen */,
- int /* xstate */,
- Bool /* force */
- );
+static Bool ScreenSaverHandle(ScreenPtr /* pScreen */ ,
+ int /* xstate */ ,
+ Bool /* force */
+ );
static Bool
-CreateSaverWindow (
- ScreenPtr /* pScreen */
- );
+ CreateSaverWindow(ScreenPtr /* pScreen */
+ );
static Bool
-DestroySaverWindow (
- ScreenPtr /* pScreen */
- );
+ DestroySaverWindow(ScreenPtr /* pScreen */
+ );
static void
-UninstallSaverColormap (
- ScreenPtr /* pScreen */
- );
+ UninstallSaverColormap(ScreenPtr /* pScreen */
+ );
static void
-CheckScreenPrivate (
- ScreenPtr /* pScreen */
- );
+ CheckScreenPrivate(ScreenPtr /* pScreen */
+ );
-static void SScreenSaverNotifyEvent (
- xScreenSaverNotifyEvent * /* from */,
- xScreenSaverNotifyEvent * /* to */
- );
+static void SScreenSaverNotifyEvent(xScreenSaverNotifyEvent * /* from */ ,
+ xScreenSaverNotifyEvent * /* to */
+ );
-static RESTYPE SuspendType; /* resource type for suspension records */
+static RESTYPE SuspendType; /* resource type for suspension records */
typedef struct _ScreenSaverSuspension *ScreenSaverSuspensionPtr;
@@ -107,18 +99,16 @@ static ScreenSaverSuspensionPtr suspendingClients = NULL;
* the client disconnects. count is the number of times the client has
* requested the screensaver be suspended.
*/
-typedef struct _ScreenSaverSuspension
-{
- ScreenSaverSuspensionPtr next;
- ClientPtr pClient;
- XID clientResource;
- int count;
+typedef struct _ScreenSaverSuspension {
+ ScreenSaverSuspensionPtr next;
+ ClientPtr pClient;
+ XID clientResource;
+ int count;
} ScreenSaverSuspensionRec;
-static int ScreenSaverFreeSuspend(
- pointer /*value */,
- XID /* id */
-);
+static int ScreenSaverFreeSuspend(pointer /*value */ ,
+ XID /* id */
+ );
/*
* each screen has a list of clients requesting
@@ -128,91 +118,83 @@ static int ScreenSaverFreeSuspend(
* entry from the per-screen queue.
*/
-static RESTYPE SaverEventType; /* resource type for event masks */
+static RESTYPE SaverEventType; /* resource type for event masks */
typedef struct _ScreenSaverEvent *ScreenSaverEventPtr;
typedef struct _ScreenSaverEvent {
- ScreenSaverEventPtr next;
- ClientPtr client;
- ScreenPtr screen;
- XID resource;
- CARD32 mask;
+ ScreenSaverEventPtr next;
+ ClientPtr client;
+ ScreenPtr screen;
+ XID resource;
+ CARD32 mask;
} ScreenSaverEventRec;
-static int ScreenSaverFreeEvents(
- pointer /* value */,
- XID /* id */
-);
+static int ScreenSaverFreeEvents(pointer /* value */ ,
+ XID /* id */
+ );
-static Bool setEventMask (
- ScreenPtr /* pScreen */,
- ClientPtr /* client */,
- unsigned long /* mask */
-);
+static Bool setEventMask(ScreenPtr /* pScreen */ ,
+ ClientPtr /* client */ ,
+ unsigned long /* mask */
+ );
-static unsigned long getEventMask (
- ScreenPtr /* pScreen */,
- ClientPtr /* client */
-);
+static unsigned long getEventMask(ScreenPtr /* pScreen */ ,
+ ClientPtr /* client */
+ );
/*
* when a client sets the screen saver attributes, a resource is
* kept to be freed when the client exits
*/
-static RESTYPE AttrType; /* resource type for attributes */
+static RESTYPE AttrType; /* resource type for attributes */
typedef struct _ScreenSaverAttr {
- ScreenPtr screen;
- ClientPtr client;
- XID resource;
- short x, y;
- unsigned short width, height, borderWidth;
- unsigned char class;
- unsigned char depth;
- VisualID visual;
- CursorPtr pCursor;
- PixmapPtr pBackgroundPixmap;
- PixmapPtr pBorderPixmap;
- Colormap colormap;
- unsigned long mask; /* no pixmaps or cursors */
- unsigned long *values;
+ ScreenPtr screen;
+ ClientPtr client;
+ XID resource;
+ short x, y;
+ unsigned short width, height, borderWidth;
+ unsigned char class;
+ unsigned char depth;
+ VisualID visual;
+ CursorPtr pCursor;
+ PixmapPtr pBackgroundPixmap;
+ PixmapPtr pBorderPixmap;
+ Colormap colormap;
+ unsigned long mask; /* no pixmaps or cursors */
+ unsigned long *values;
} ScreenSaverAttrRec, *ScreenSaverAttrPtr;
-static int ScreenSaverFreeAttr (
- pointer /* value */,
- XID /* id */
-);
+static int ScreenSaverFreeAttr(pointer /* value */ ,
+ XID /* id */
+ );
-static void FreeAttrs (
- ScreenSaverAttrPtr /* pAttr */
-);
+static void FreeAttrs(ScreenSaverAttrPtr /* pAttr */
+ );
-static void FreeScreenAttr (
- ScreenSaverAttrPtr /* pAttr */
-);
+static void FreeScreenAttr(ScreenSaverAttrPtr /* pAttr */
+ );
static void
-SendScreenSaverNotify (
- ScreenPtr /* pScreen */,
- int /* state */,
- Bool /* forced */
-);
+ SendScreenSaverNotify(ScreenPtr /* pScreen */ ,
+ int /* state */ ,
+ Bool /* forced */
+ );
typedef struct _ScreenSaverScreenPrivate {
- ScreenSaverEventPtr events;
- ScreenSaverAttrPtr attr;
- Bool hasWindow;
- Colormap installedMap;
+ ScreenSaverEventPtr events;
+ ScreenSaverAttrPtr attr;
+ Bool hasWindow;
+ Colormap installedMap;
} ScreenSaverScreenPrivateRec, *ScreenSaverScreenPrivatePtr;
-static ScreenSaverScreenPrivatePtr
-MakeScreenPrivate (
- ScreenPtr /* pScreen */
- );
+static ScreenSaverScreenPrivatePtr MakeScreenPrivate(ScreenPtr /* pScreen */
+ );
static DevPrivateKeyRec ScreenPrivateKeyRec;
+
#define ScreenPrivateKey (&ScreenPrivateKeyRec)
#define GetScreenPrivate(s) ((ScreenSaverScreenPrivatePtr) \
@@ -224,387 +206,370 @@ static DevPrivateKeyRec ScreenPrivateKeyRec;
#define New(t) (malloc(sizeof (t)))
static void
-CheckScreenPrivate (ScreenPtr pScreen)
+CheckScreenPrivate(ScreenPtr pScreen)
{
- SetupScreen (pScreen);
+ SetupScreen(pScreen);
if (!pPriv)
- return;
+ return;
if (!pPriv->attr && !pPriv->events &&
- !pPriv->hasWindow && pPriv->installedMap == None)
- {
- free(pPriv);
- SetScreenPrivate (pScreen, NULL);
- pScreen->screensaver.ExternalScreenSaver = NULL;
+ !pPriv->hasWindow && pPriv->installedMap == None) {
+ free(pPriv);
+ SetScreenPrivate(pScreen, NULL);
+ pScreen->screensaver.ExternalScreenSaver = NULL;
}
}
static ScreenSaverScreenPrivatePtr
-MakeScreenPrivate (ScreenPtr pScreen)
+MakeScreenPrivate(ScreenPtr pScreen)
{
- SetupScreen (pScreen);
+ SetupScreen(pScreen);
if (pPriv)
- return pPriv;
- pPriv = New (ScreenSaverScreenPrivateRec);
+ return pPriv;
+ pPriv = New(ScreenSaverScreenPrivateRec);
if (!pPriv)
- return 0;
+ return 0;
pPriv->events = 0;
pPriv->attr = 0;
pPriv->hasWindow = FALSE;
pPriv->installedMap = None;
- SetScreenPrivate (pScreen, pPriv);
+ SetScreenPrivate(pScreen, pPriv);
pScreen->screensaver.ExternalScreenSaver = ScreenSaverHandle;
return pPriv;
}
static unsigned long
-getEventMask (ScreenPtr pScreen, ClientPtr client)
+getEventMask(ScreenPtr pScreen, ClientPtr client)
{
SetupScreen(pScreen);
- ScreenSaverEventPtr pEv;
+ ScreenSaverEventPtr pEv;
if (!pPriv)
- return 0;
+ return 0;
for (pEv = pPriv->events; pEv; pEv = pEv->next)
- if (pEv->client == client)
- return pEv->mask;
+ if (pEv->client == client)
+ return pEv->mask;
return 0;
}
static Bool
-setEventMask (ScreenPtr pScreen, ClientPtr client, unsigned long mask)
+setEventMask(ScreenPtr pScreen, ClientPtr client, unsigned long mask)
{
SetupScreen(pScreen);
- ScreenSaverEventPtr pEv, *pPrev;
-
- if (getEventMask (pScreen, client) == mask)
- return TRUE;
- if (!pPriv)
- {
- pPriv = MakeScreenPrivate (pScreen);
- if (!pPriv)
- return FALSE;
+ ScreenSaverEventPtr pEv, *pPrev;
+
+ if (getEventMask(pScreen, client) == mask)
+ return TRUE;
+ if (!pPriv) {
+ pPriv = MakeScreenPrivate(pScreen);
+ if (!pPriv)
+ return FALSE;
}
for (pPrev = &pPriv->events; (pEv = *pPrev) != 0; pPrev = &pEv->next)
- if (pEv->client == client)
- break;
- if (mask == 0)
- {
- FreeResource (pEv->resource, SaverEventType);
- *pPrev = pEv->next;
- free(pEv);
- CheckScreenPrivate (pScreen);
+ if (pEv->client == client)
+ break;
+ if (mask == 0) {
+ FreeResource(pEv->resource, SaverEventType);
+ *pPrev = pEv->next;
+ free(pEv);
+ CheckScreenPrivate(pScreen);
}
- else
- {
- if (!pEv)
- {
- pEv = New (ScreenSaverEventRec);
- if (!pEv)
- {
- CheckScreenPrivate (pScreen);
- return FALSE;
- }
- *pPrev = pEv;
- pEv->next = NULL;
- pEv->client = client;
- pEv->screen = pScreen;
- pEv->resource = FakeClientID (client->index);
- if (!AddResource (pEv->resource, SaverEventType, (pointer) pEv))
- return FALSE;
- }
- pEv->mask = mask;
+ else {
+ if (!pEv) {
+ pEv = New(ScreenSaverEventRec);
+ if (!pEv) {
+ CheckScreenPrivate(pScreen);
+ return FALSE;
+ }
+ *pPrev = pEv;
+ pEv->next = NULL;
+ pEv->client = client;
+ pEv->screen = pScreen;
+ pEv->resource = FakeClientID(client->index);
+ if (!AddResource(pEv->resource, SaverEventType, (pointer) pEv))
+ return FALSE;
+ }
+ pEv->mask = mask;
}
return TRUE;
}
static void
-FreeAttrs (ScreenSaverAttrPtr pAttr)
+FreeAttrs(ScreenSaverAttrPtr pAttr)
{
- PixmapPtr pPixmap;
- CursorPtr pCursor;
+ PixmapPtr pPixmap;
+ CursorPtr pCursor;
if ((pPixmap = pAttr->pBackgroundPixmap) != 0)
- (*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap);
+ (*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap);
if ((pPixmap = pAttr->pBorderPixmap) != 0)
- (*pPixmap->drawable.pScreen->DestroyPixmap)(pPixmap);
+ (*pPixmap->drawable.pScreen->DestroyPixmap) (pPixmap);
if ((pCursor = pAttr->pCursor) != 0)
- FreeCursor (pCursor, (Cursor) 0);
+ FreeCursor(pCursor, (Cursor) 0);
}
static void
-FreeScreenAttr (ScreenSaverAttrPtr pAttr)
+FreeScreenAttr(ScreenSaverAttrPtr pAttr)
{
- FreeAttrs (pAttr);
+ FreeAttrs(pAttr);
free(pAttr->values);
free(pAttr);
}
static int
-ScreenSaverFreeEvents (pointer value, XID id)
+ScreenSaverFreeEvents(pointer value, XID id)
{
- ScreenSaverEventPtr pOld = (ScreenSaverEventPtr)value;
+ ScreenSaverEventPtr pOld = (ScreenSaverEventPtr) value;
ScreenPtr pScreen = pOld->screen;
- SetupScreen (pScreen);
- ScreenSaverEventPtr pEv, *pPrev;
+
+ SetupScreen(pScreen);
+ ScreenSaverEventPtr pEv, *pPrev;
if (!pPriv)
- return TRUE;
+ return TRUE;
for (pPrev = &pPriv->events; (pEv = *pPrev) != 0; pPrev = &pEv->next)
- if (pEv == pOld)
- break;
+ if (pEv == pOld)
+ break;
if (!pEv)
- return TRUE;
+ return TRUE;
*pPrev = pEv->next;
free(pEv);
- CheckScreenPrivate (pScreen);
+ CheckScreenPrivate(pScreen);
return TRUE;
}
static int
-ScreenSaverFreeAttr (pointer value, XID id)
+ScreenSaverFreeAttr(pointer value, XID id)
{
- ScreenSaverAttrPtr pOldAttr = (ScreenSaverAttrPtr)value;
- ScreenPtr pScreen = pOldAttr->screen;
- SetupScreen (pScreen);
+ ScreenSaverAttrPtr pOldAttr = (ScreenSaverAttrPtr) value;
+ ScreenPtr pScreen = pOldAttr->screen;
+
+ SetupScreen(pScreen);
if (!pPriv)
- return TRUE;
+ return TRUE;
if (pPriv->attr != pOldAttr)
- return TRUE;
- FreeScreenAttr (pOldAttr);
+ return TRUE;
+ FreeScreenAttr(pOldAttr);
pPriv->attr = NULL;
- if (pPriv->hasWindow)
- {
- dixSaveScreens (serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);
- dixSaveScreens (serverClient, SCREEN_SAVER_FORCER, ScreenSaverActive);
+ if (pPriv->hasWindow) {
+ dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset);
+ dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverActive);
}
- CheckScreenPrivate (pScreen);
+ CheckScreenPrivate(pScreen);
return TRUE;
}
static int
-ScreenSaverFreeSuspend (pointer value, XID id)
+ScreenSaverFreeSuspend(pointer value, XID id)
{
ScreenSaverSuspensionPtr data = (ScreenSaverSuspensionPtr) value;
ScreenSaverSuspensionPtr *prev, this;
/* Unlink and free the suspension record for the client */
- for (prev = &suspendingClients; (this = *prev); prev = &this->next)
- {
- if (this == data)
- {
- *prev = this->next;
- free(this);
- break;
- }
+ for (prev = &suspendingClients; (this = *prev); prev = &this->next) {
+ if (this == data) {
+ *prev = this->next;
+ free(this);
+ break;
+ }
}
/* Reenable the screensaver if this was the last client suspending it. */
- if (screenSaverSuspended && suspendingClients == NULL)
- {
- screenSaverSuspended = FALSE;
+ if (screenSaverSuspended && suspendingClients == NULL) {
+ screenSaverSuspended = FALSE;
- /* The screensaver could be active, since suspending it (by design)
- doesn't prevent it from being forceably activated */
+ /* The screensaver could be active, since suspending it (by design)
+ doesn't prevent it from being forceably activated */
#ifdef DPMSExtension
- if (screenIsSaved != SCREEN_SAVER_ON && DPMSPowerLevel == DPMSModeOn)
+ if (screenIsSaved != SCREEN_SAVER_ON && DPMSPowerLevel == DPMSModeOn)
#else
- if (screenIsSaved != SCREEN_SAVER_ON)
+ if (screenIsSaved != SCREEN_SAVER_ON)
#endif
- {
- UpdateCurrentTimeIf();
- lastDeviceEventTime = currentTime;
- SetScreenSaverTimer();
- }
+ {
+ UpdateCurrentTimeIf();
+ lastDeviceEventTime = currentTime;
+ SetScreenSaverTimer();
+ }
}
return Success;
}
static void
-SendScreenSaverNotify (ScreenPtr pScreen, int state, Bool forced)
+SendScreenSaverNotify(ScreenPtr pScreen, int state, Bool forced)
{
- ScreenSaverScreenPrivatePtr pPriv;
- ScreenSaverEventPtr pEv;
- unsigned long mask;
- xScreenSaverNotifyEvent ev;
- int kind;
+ ScreenSaverScreenPrivatePtr pPriv;
+ ScreenSaverEventPtr pEv;
+ unsigned long mask;
+ xScreenSaverNotifyEvent ev;
+ int kind;
- UpdateCurrentTimeIf ();
+ UpdateCurrentTimeIf();
mask = ScreenSaverNotifyMask;
if (state == ScreenSaverCycle)
- mask = ScreenSaverCycleMask;
+ mask = ScreenSaverCycleMask;
pScreen = screenInfo.screens[pScreen->myNum];
pPriv = GetScreenPrivate(pScreen);
if (!pPriv)
- return;
+ return;
if (pPriv->attr)
- kind = ScreenSaverExternal;
+ kind = ScreenSaverExternal;
else if (ScreenSaverBlanking != DontPreferBlanking)
- kind = ScreenSaverBlanked;
+ kind = ScreenSaverBlanked;
else
- kind = ScreenSaverInternal;
- for (pEv = pPriv->events; pEv; pEv = pEv->next)
- {
- if (!(pEv->mask & mask))
- continue;
- ev.type = ScreenSaverNotify + ScreenSaverEventBase;
- ev.state = state;
- ev.timestamp = currentTime.milliseconds;
- ev.root = pScreen->root->drawable.id;
- ev.window = pScreen->screensaver.wid;
- ev.kind = kind;
- ev.forced = forced;
- WriteEventsToClient (pEv->client, 1, (xEvent *) &ev);
+ kind = ScreenSaverInternal;
+ for (pEv = pPriv->events; pEv; pEv = pEv->next) {
+ if (!(pEv->mask & mask))
+ continue;
+ ev.type = ScreenSaverNotify + ScreenSaverEventBase;
+ ev.state = state;
+ ev.timestamp = currentTime.milliseconds;
+ ev.root = pScreen->root->drawable.id;
+ ev.window = pScreen->screensaver.wid;
+ ev.kind = kind;
+ ev.forced = forced;
+ WriteEventsToClient(pEv->client, 1, (xEvent *) &ev);
}
}
static void
-SScreenSaverNotifyEvent (xScreenSaverNotifyEvent *from,
- xScreenSaverNotifyEvent *to)
+SScreenSaverNotifyEvent(xScreenSaverNotifyEvent * from,
+ xScreenSaverNotifyEvent * to)
{
to->type = from->type;
to->state = from->state;
- cpswaps (from->sequenceNumber, to->sequenceNumber);
- cpswapl (from->timestamp, to->timestamp);
- cpswapl (from->root, to->root);
- cpswapl (from->window, to->window);
+ cpswaps(from->sequenceNumber, to->sequenceNumber);
+ cpswapl(from->timestamp, to->timestamp);
+ cpswapl(from->root, to->root);
+ cpswapl(from->window, to->window);
to->kind = from->kind;
to->forced = from->forced;
}
static void
-UninstallSaverColormap (ScreenPtr pScreen)
+UninstallSaverColormap(ScreenPtr pScreen)
{
SetupScreen(pScreen);
- ColormapPtr pCmap;
+ ColormapPtr pCmap;
int rc;
- if (pPriv && pPriv->installedMap != None)
- {
- rc = dixLookupResourceByType((pointer *)&pCmap, pPriv->installedMap,
- RT_COLORMAP, serverClient,
- DixUninstallAccess);
- if (rc == Success)
- (*pCmap->pScreen->UninstallColormap) (pCmap);
- pPriv->installedMap = None;
- CheckScreenPrivate (pScreen);
+ if (pPriv && pPriv->installedMap != None) {
+ rc = dixLookupResourceByType((pointer *) &pCmap, pPriv->installedMap,
+ RT_COLORMAP, serverClient,
+ DixUninstallAccess);
+ if (rc == Success)
+ (*pCmap->pScreen->UninstallColormap) (pCmap);
+ pPriv->installedMap = None;
+ CheckScreenPrivate(pScreen);
}
}
static Bool
-CreateSaverWindow (ScreenPtr pScreen)
+CreateSaverWindow(ScreenPtr pScreen)
{
- SetupScreen (pScreen);
- ScreenSaverStuffPtr pSaver;
- ScreenSaverAttrPtr pAttr;
- WindowPtr pWin;
- int result;
- unsigned long mask;
- Colormap *installedMaps;
- int numInstalled;
- int i;
- Colormap wantMap;
- ColormapPtr pCmap;
+ SetupScreen(pScreen);
+ ScreenSaverStuffPtr pSaver;
+ ScreenSaverAttrPtr pAttr;
+ WindowPtr pWin;
+ int result;
+ unsigned long mask;
+ Colormap *installedMaps;
+ int numInstalled;
+ int i;
+ Colormap wantMap;
+ ColormapPtr pCmap;
pSaver = &pScreen->screensaver;
- if (pSaver->pWindow)
- {
- pSaver->pWindow = NullWindow;
- FreeResource (pSaver->wid, RT_NONE);
- if (pPriv)
- {
- UninstallSaverColormap (pScreen);
- pPriv->hasWindow = FALSE;
- CheckScreenPrivate (pScreen);
- }
+ if (pSaver->pWindow) {
+ pSaver->pWindow = NullWindow;
+ FreeResource(pSaver->wid, RT_NONE);
+ if (pPriv) {
+ UninstallSaverColormap(pScreen);
+ pPriv->hasWindow = FALSE;
+ CheckScreenPrivate(pScreen);
+ }
}
if (!pPriv || !(pAttr = pPriv->attr))
- return FALSE;
+ return FALSE;
pPriv->installedMap = None;
if (GrabInProgress && GrabInProgress != pAttr->client->index)
- return FALSE;
-
- pWin = CreateWindow (pSaver->wid, pScreen->root,
- pAttr->x, pAttr->y, pAttr->width, pAttr->height,
- pAttr->borderWidth, pAttr->class,
- pAttr->mask, (XID *)pAttr->values,
- pAttr->depth, serverClient, pAttr->visual,
- &result);
+ return FALSE;
+
+ pWin = CreateWindow(pSaver->wid, pScreen->root,
+ pAttr->x, pAttr->y, pAttr->width, pAttr->height,
+ pAttr->borderWidth, pAttr->class,
+ pAttr->mask, (XID *) pAttr->values,
+ pAttr->depth, serverClient, pAttr->visual, &result);
if (!pWin)
- return FALSE;
+ return FALSE;
if (!AddResource(pWin->drawable.id, RT_WINDOW, pWin))
- return FALSE;
+ return FALSE;
mask = 0;
- if (pAttr->pBackgroundPixmap)
- {
- pWin->backgroundState = BackgroundPixmap;
- pWin->background.pixmap = pAttr->pBackgroundPixmap;
- pAttr->pBackgroundPixmap->refcnt++;
- mask |= CWBackPixmap;
+ if (pAttr->pBackgroundPixmap) {
+ pWin->backgroundState = BackgroundPixmap;
+ pWin->background.pixmap = pAttr->pBackgroundPixmap;
+ pAttr->pBackgroundPixmap->refcnt++;
+ mask |= CWBackPixmap;
}
- if (pAttr->pBorderPixmap)
- {
- pWin->borderIsPixel = FALSE;
- pWin->border.pixmap = pAttr->pBorderPixmap;
- pAttr->pBorderPixmap->refcnt++;
- mask |= CWBorderPixmap;
+ if (pAttr->pBorderPixmap) {
+ pWin->borderIsPixel = FALSE;
+ pWin->border.pixmap = pAttr->pBorderPixmap;
+ pAttr->pBorderPixmap->refcnt++;
+ mask |= CWBorderPixmap;
}
- if (pAttr->pCursor)
- {
- if (!pWin->optional)
- if (!MakeWindowOptional (pWin))
- {
- FreeResource (pWin->drawable.id, RT_NONE);
- return FALSE;
- }
- pAttr->pCursor->refcnt++;
- if (pWin->optional->cursor)
- FreeCursor (pWin->optional->cursor, (Cursor)0);
- pWin->optional->cursor = pAttr->pCursor;
- pWin->cursorIsNone = FALSE;
- CheckWindowOptionalNeed (pWin);
- mask |= CWCursor;
+ if (pAttr->pCursor) {
+ if (!pWin->optional)
+ if (!MakeWindowOptional(pWin)) {
+ FreeResource(pWin->drawable.id, RT_NONE);
+ return FALSE;
+ }
+ pAttr->pCursor->refcnt++;
+ if (pWin->optional->cursor)
+ FreeCursor(pWin->optional->cursor, (Cursor) 0);
+ pWin->optional->cursor = pAttr->pCursor;
+ pWin->cursorIsNone = FALSE;
+ CheckWindowOptionalNeed(pWin);
+ mask |= CWCursor;
}
if (mask)
- (*pScreen->ChangeWindowAttributes) (pWin, mask);
+ (*pScreen->ChangeWindowAttributes) (pWin, mask);
if (pAttr->colormap != None)
- (void) ChangeWindowAttributes (pWin, CWColormap, &pAttr->colormap,
- serverClient);
+ (void) ChangeWindowAttributes(pWin, CWColormap, &pAttr->colormap,
+ serverClient);
- MapWindow (pWin, serverClient);
+ MapWindow(pWin, serverClient);
pPriv->hasWindow = TRUE;
pSaver->pWindow = pWin;
/* check and install our own colormap if it isn't installed now */
- wantMap = wColormap (pWin);
+ wantMap = wColormap(pWin);
if (wantMap == None)
- return TRUE;
- installedMaps = malloc(pScreen->maxInstalledCmaps * sizeof (Colormap));
+ return TRUE;
+ installedMaps = malloc(pScreen->maxInstalledCmaps * sizeof(Colormap));
numInstalled = (*pWin->drawable.pScreen->ListInstalledColormaps)
- (pScreen, installedMaps);
- for (i = 0; i < numInstalled; i++)
- if (installedMaps[i] == wantMap)
- break;
+ (pScreen, installedMaps);
+ for (i = 0; i < numInstalled; i++)
+ if (installedMaps[i] == wantMap)
+ break;
free((char *) installedMaps);
if (i < numInstalled)
- return TRUE;
+ return TRUE;
- result = dixLookupResourceByType((pointer *)&pCmap, wantMap, RT_COLORMAP,
- serverClient, DixInstallAccess);
+ result = dixLookupResourceByType((pointer *) &pCmap, wantMap, RT_COLORMAP,
+ serverClient, DixInstallAccess);
if (result != Success)
- return TRUE;
+ return TRUE;
pPriv->installedMap = wantMap;
@@ -614,229 +579,221 @@ CreateSaverWindow (ScreenPtr pScreen)
}
static Bool
-DestroySaverWindow (ScreenPtr pScreen)
+DestroySaverWindow(ScreenPtr pScreen)
{
SetupScreen(pScreen);
- ScreenSaverStuffPtr pSaver;
+ ScreenSaverStuffPtr pSaver;
if (!pPriv || !pPriv->hasWindow)
- return FALSE;
+ return FALSE;
pSaver = &pScreen->screensaver;
- if (pSaver->pWindow)
- {
- pSaver->pWindow = NullWindow;
- FreeResource (pSaver->wid, RT_NONE);
+ if (pSaver->pWindow) {
+ pSaver->pWindow = NullWindow;
+ FreeResource(pSaver->wid, RT_NONE);
}
pPriv->hasWindow = FALSE;
- CheckScreenPrivate (pScreen);
- UninstallSaverColormap (pScreen);
+ CheckScreenPrivate(pScreen);
+ UninstallSaverColormap(pScreen);
return TRUE;
}
static Bool
-ScreenSaverHandle (ScreenPtr pScreen, int xstate, Bool force)
+ScreenSaverHandle(ScreenPtr pScreen, int xstate, Bool force)
{
- int state = 0;
- Bool ret = FALSE;
- ScreenSaverScreenPrivatePtr pPriv;
-
- switch (xstate)
- {
- case SCREEN_SAVER_ON:
- state = ScreenSaverOn;
- ret = CreateSaverWindow (pScreen);
- break;
- case SCREEN_SAVER_OFF:
- state = ScreenSaverOff;
- ret = DestroySaverWindow (pScreen);
- break;
- case SCREEN_SAVER_CYCLE:
- state = ScreenSaverCycle;
- pPriv = GetScreenPrivate (pScreen);
- if (pPriv && pPriv->hasWindow)
- ret = TRUE;
-
+ int state = 0;
+ Bool ret = FALSE;
+ ScreenSaverScreenPrivatePtr pPriv;
+
+ switch (xstate) {
+ case SCREEN_SAVER_ON:
+ state = ScreenSaverOn;
+ ret = CreateSaverWindow(pScreen);
+ break;
+ case SCREEN_SAVER_OFF:
+ state = ScreenSaverOff;
+ ret = DestroySaverWindow(pScreen);
+ break;
+ case SCREEN_SAVER_CYCLE:
+ state = ScreenSaverCycle;
+ pPriv = GetScreenPrivate(pScreen);
+ if (pPriv && pPriv->hasWindow)
+ ret = TRUE;
+
}
#ifdef PANORAMIX
- if(noPanoramiXExtension || !pScreen->myNum)
+ if (noPanoramiXExtension || !pScreen->myNum)
#endif
- SendScreenSaverNotify (pScreen, state, force);
+ SendScreenSaverNotify(pScreen, state, force);
return ret;
}
static int
-ProcScreenSaverQueryVersion (ClientPtr client)
+ProcScreenSaverQueryVersion(ClientPtr client)
{
- xScreenSaverQueryVersionReply rep;
- REQUEST_SIZE_MATCH (xScreenSaverQueryVersionReq);
+ xScreenSaverQueryVersionReply rep;
+
+ REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
rep.majorVersion = SERVER_SAVER_MAJOR_VERSION;
rep.minorVersion = SERVER_SAVER_MINOR_VERSION;
if (client->swapped) {
- swaps(&rep.sequenceNumber);
- swapl(&rep.length);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
}
- WriteToClient(client, sizeof (xScreenSaverQueryVersionReply), (char *)&rep);
+ WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), (char *) &rep);
return Success;
}
static int
-ProcScreenSaverQueryInfo (ClientPtr client)
+ProcScreenSaverQueryInfo(ClientPtr client)
{
REQUEST(xScreenSaverQueryInfoReq);
- xScreenSaverQueryInfoReply rep;
- int rc;
- ScreenSaverStuffPtr pSaver;
- DrawablePtr pDraw;
- CARD32 lastInput;
- ScreenSaverScreenPrivatePtr pPriv;
-
- REQUEST_SIZE_MATCH (xScreenSaverQueryInfoReq);
+ xScreenSaverQueryInfoReply rep;
+ int rc;
+ ScreenSaverStuffPtr pSaver;
+ DrawablePtr pDraw;
+ CARD32 lastInput;
+ ScreenSaverScreenPrivatePtr pPriv;
+
+ REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq);
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
- DixGetAttrAccess);
+ DixGetAttrAccess);
if (rc != Success)
- return rc;
+ return rc;
rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, pDraw->pScreen,
- DixGetAttrAccess);
+ DixGetAttrAccess);
if (rc != Success)
- return rc;
+ return rc;
pSaver = &pDraw->pScreen->screensaver;
- pPriv = GetScreenPrivate (pDraw->pScreen);
+ pPriv = GetScreenPrivate(pDraw->pScreen);
- UpdateCurrentTime ();
+ UpdateCurrentTime();
lastInput = GetTimeInMillis() - lastDeviceEventTime.milliseconds;
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
rep.window = pSaver->wid;
- if (screenIsSaved != SCREEN_SAVER_OFF)
- {
- rep.state = ScreenSaverOn;
- if (ScreenSaverTime)
- rep.tilOrSince = lastInput - ScreenSaverTime;
- else
- rep.tilOrSince = 0;
+ if (screenIsSaved != SCREEN_SAVER_OFF) {
+ rep.state = ScreenSaverOn;
+ if (ScreenSaverTime)
+ rep.tilOrSince = lastInput - ScreenSaverTime;
+ else
+ rep.tilOrSince = 0;
}
- else
- {
- if (ScreenSaverTime)
- {
- rep.state = ScreenSaverOff;
- if (ScreenSaverTime < lastInput)
- rep.tilOrSince = 0;
- else
- rep.tilOrSince = ScreenSaverTime - lastInput;
- }
- else
- {
- rep.state = ScreenSaverDisabled;
- rep.tilOrSince = 0;
- }
+ else {
+ if (ScreenSaverTime) {
+ rep.state = ScreenSaverOff;
+ if (ScreenSaverTime < lastInput)
+ rep.tilOrSince = 0;
+ else
+ rep.tilOrSince = ScreenSaverTime - lastInput;
+ }
+ else {
+ rep.state = ScreenSaverDisabled;
+ rep.tilOrSince = 0;
+ }
}
rep.idle = lastInput;
- rep.eventMask = getEventMask (pDraw->pScreen, client);
+ rep.eventMask = getEventMask(pDraw->pScreen, client);
if (pPriv && pPriv->attr)
- rep.kind = ScreenSaverExternal;
+ rep.kind = ScreenSaverExternal;
else if (ScreenSaverBlanking != DontPreferBlanking)
- rep.kind = ScreenSaverBlanked;
+ rep.kind = ScreenSaverBlanked;
else
- rep.kind = ScreenSaverInternal;
- if (client->swapped)
- {
- swaps(&rep.sequenceNumber);
- swapl(&rep.length);
- swapl(&rep.window);
- swapl(&rep.tilOrSince);
- swapl(&rep.idle);
- swapl(&rep.eventMask);
+ rep.kind = ScreenSaverInternal;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.length);
+ swapl(&rep.window);
+ swapl(&rep.tilOrSince);
+ swapl(&rep.idle);
+ swapl(&rep.eventMask);
}
- WriteToClient(client, sizeof (xScreenSaverQueryInfoReply), (char *)&rep);
+ WriteToClient(client, sizeof(xScreenSaverQueryInfoReply), (char *) &rep);
return Success;
}
static int
-ProcScreenSaverSelectInput (ClientPtr client)
+ProcScreenSaverSelectInput(ClientPtr client)
{
REQUEST(xScreenSaverSelectInputReq);
- DrawablePtr pDraw;
- int rc;
+ DrawablePtr pDraw;
+ int rc;
- REQUEST_SIZE_MATCH (xScreenSaverSelectInputReq);
- rc = dixLookupDrawable (&pDraw, stuff->drawable, client, 0,
- DixGetAttrAccess);
+ REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq);
+ rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
+ DixGetAttrAccess);
if (rc != Success)
- return rc;
+ return rc;
rc = XaceHook(XACE_SCREENSAVER_ACCESS, client, pDraw->pScreen,
- DixSetAttrAccess);
+ DixSetAttrAccess);
if (rc != Success)
- return rc;
+ return rc;
- if (!setEventMask (pDraw->pScreen, client, stuff->eventMask))
- return BadAlloc;
+ if (!setEventMask(pDraw->pScreen, client, stuff->eventMask))
+ return BadAlloc;
return Success;
}
static int
-ScreenSaverSetAttributes (ClientPtr client)
+ScreenSaverSetAttributes(ClientPtr client)
{
REQUEST(xScreenSaverSetAttributesReq);
- DrawablePtr pDraw;
- WindowPtr pParent;
- ScreenPtr pScreen;
+ DrawablePtr pDraw;
+ WindowPtr pParent;
+ ScreenPtr pScreen;
ScreenSaverScreenPrivatePtr pPriv = 0;
- ScreenSaverAttrPtr pAttr = 0;
- int ret, len, class, bw, depth;
- unsigned long visual;
- int idepth, ivisual;
- Bool fOK;
- DepthPtr pDepth;
- WindowOptPtr ancwopt;
- unsigned int *pVlist;
- unsigned long *values = 0;
- unsigned long tmask, imask;
- unsigned long val;
- Pixmap pixID;
- PixmapPtr pPixmap;
- Cursor cursorID;
- CursorPtr pCursor;
- Colormap cmap;
- ColormapPtr pCmap;
-
- REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq);
+ ScreenSaverAttrPtr pAttr = 0;
+ int ret, len, class, bw, depth;
+ unsigned long visual;
+ int idepth, ivisual;
+ Bool fOK;
+ DepthPtr pDepth;
+ WindowOptPtr ancwopt;
+ unsigned int *pVlist;
+ unsigned long *values = 0;
+ unsigned long tmask, imask;
+ unsigned long val;
+ Pixmap pixID;
+ PixmapPtr pPixmap;
+ Cursor cursorID;
+ CursorPtr pCursor;
+ Colormap cmap;
+ ColormapPtr pCmap;
+
+ REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
ret = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
- DixGetAttrAccess);
+ DixGetAttrAccess);
if (ret != Success)
- return ret;
+ return ret;
pScreen = pDraw->pScreen;
pParent = pScreen->root;
ret = XaceHook(XACE_SCREENSAVER_ACCESS, client, pScreen, DixSetAttrAccess);
if (ret != Success)
- return ret;
+ return ret;
- len = stuff->length - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
+ len = stuff->length - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
if (Ones(stuff->mask) != len)
return BadLength;
- if (!stuff->width || !stuff->height)
- {
- client->errorValue = 0;
+ if (!stuff->width || !stuff->height) {
+ client->errorValue = 0;
return BadValue;
}
- switch (class = stuff->c_class)
- {
+ switch (class = stuff->c_class) {
case CopyFromParent:
case InputOnly:
case InputOutput:
- break;
+ break;
default:
- client->errorValue = class;
- return BadValue;
+ client->errorValue = class;
+ return BadValue;
}
bw = stuff->borderWidth;
depth = stuff->depth;
@@ -845,12 +802,11 @@ ScreenSaverSetAttributes (ClientPtr client)
/* copied directly from CreateWindow */
if (class == CopyFromParent)
- class = pParent->drawable.class;
+ class = pParent->drawable.class;
- if ((class != InputOutput) && (class != InputOnly))
- {
- client->errorValue = class;
- return BadValue;
+ if ((class != InputOutput) && (class != InputOnly)) {
+ client->errorValue = class;
+ return BadValue;
}
if ((class != InputOnly) && (pParent->drawable.class == InputOnly))
@@ -863,73 +819,61 @@ ScreenSaverSetAttributes (ClientPtr client)
depth = pParent->drawable.depth;
ancwopt = pParent->optional;
if (!ancwopt)
- ancwopt = FindWindowWithOptional(pParent)->optional;
+ ancwopt = FindWindowWithOptional(pParent)->optional;
if (visual == CopyFromParent)
- visual = ancwopt->visual;
+ visual = ancwopt->visual;
/* Find out if the depth and visual are acceptable for this Screen */
- if ((visual != ancwopt->visual) || (depth != pParent->drawable.depth))
- {
- fOK = FALSE;
- for(idepth = 0; idepth < pScreen->numDepths; idepth++)
- {
- pDepth = (DepthPtr) &pScreen->allowedDepths[idepth];
- if ((depth == pDepth->depth) || (depth == 0))
- {
- for (ivisual = 0; ivisual < pDepth->numVids; ivisual++)
- {
- if (visual == pDepth->vids[ivisual])
- {
- fOK = TRUE;
- break;
- }
- }
- }
- }
- if (fOK == FALSE)
- return BadMatch;
+ if ((visual != ancwopt->visual) || (depth != pParent->drawable.depth)) {
+ fOK = FALSE;
+ for (idepth = 0; idepth < pScreen->numDepths; idepth++) {
+ pDepth = (DepthPtr) & pScreen->allowedDepths[idepth];
+ if ((depth == pDepth->depth) || (depth == 0)) {
+ for (ivisual = 0; ivisual < pDepth->numVids; ivisual++) {
+ if (visual == pDepth->vids[ivisual]) {
+ fOK = TRUE;
+ break;
+ }
+ }
+ }
+ }
+ if (fOK == FALSE)
+ return BadMatch;
}
if (((stuff->mask & (CWBorderPixmap | CWBorderPixel)) == 0) &&
- (class != InputOnly) &&
- (depth != pParent->drawable.depth))
- {
+ (class != InputOnly) && (depth != pParent->drawable.depth)) {
return BadMatch;
}
if (((stuff->mask & CWColormap) == 0) &&
- (class != InputOnly) &&
- ((visual != ancwopt->visual) || (ancwopt->colormap == None)))
- {
- return BadMatch;
+ (class != InputOnly) &&
+ ((visual != ancwopt->visual) || (ancwopt->colormap == None))) {
+ return BadMatch;
}
/* end of errors from CreateWindow */
- pPriv = GetScreenPrivate (pScreen);
- if (pPriv && pPriv->attr)
- {
- if (pPriv->attr->client != client)
- return BadAccess;
+ pPriv = GetScreenPrivate(pScreen);
+ if (pPriv && pPriv->attr) {
+ if (pPriv->attr->client != client)
+ return BadAccess;
}
- if (!pPriv)
- {
- pPriv = MakeScreenPrivate (pScreen);
- if (!pPriv)
- return FALSE;
+ if (!pPriv) {
+ pPriv = MakeScreenPrivate(pScreen);
+ if (!pPriv)
+ return FALSE;
}
- pAttr = New (ScreenSaverAttrRec);
- if (!pAttr)
- {
- ret = BadAlloc;
- goto bail;
+ pAttr = New(ScreenSaverAttrRec);
+ if (!pAttr) {
+ ret = BadAlloc;
+ goto bail;
}
/* over allocate for override redirect */
- pAttr->values = values = malloc((len + 1) * sizeof (unsigned long));
- if (!values)
- {
- ret = BadAlloc;
- goto bail;
+ pAttr->values = values = malloc((len + 1) * sizeof(unsigned long));
+ if (!values) {
+ ret = BadAlloc;
+ goto bail;
}
pAttr->screen = pScreen;
pAttr->client = client;
@@ -953,318 +897,297 @@ ScreenSaverSetAttributes (ClientPtr client)
pAttr->mask = tmask = stuff->mask | CWOverrideRedirect;
pVlist = (unsigned int *) (stuff + 1);
while (tmask) {
- imask = lowbit (tmask);
- tmask &= ~imask;
- switch (imask)
- {
- case CWBackPixmap:
- pixID = (Pixmap )*pVlist;
- if (pixID == None)
- {
- *values++ = None;
- }
- else if (pixID == ParentRelative)
- {
- if (depth != pParent->drawable.depth)
- {
- ret = BadMatch;
- goto PatchUp;
- }
- *values++ = ParentRelative;
- }
- else
- {
- ret = dixLookupResourceByType((pointer *)&pPixmap, pixID, RT_PIXMAP,
- client, DixReadAccess);
- if (ret == Success)
- {
- if ((pPixmap->drawable.depth != depth) ||
- (pPixmap->drawable.pScreen != pScreen))
- {
+ imask = lowbit(tmask);
+ tmask &= ~imask;
+ switch (imask) {
+ case CWBackPixmap:
+ pixID = (Pixmap) * pVlist;
+ if (pixID == None) {
+ *values++ = None;
+ }
+ else if (pixID == ParentRelative) {
+ if (depth != pParent->drawable.depth) {
+ ret = BadMatch;
+ goto PatchUp;
+ }
+ *values++ = ParentRelative;
+ }
+ else {
+ ret =
+ dixLookupResourceByType((pointer *) &pPixmap, pixID,
+ RT_PIXMAP, client, DixReadAccess);
+ if (ret == Success) {
+ if ((pPixmap->drawable.depth != depth) ||
+ (pPixmap->drawable.pScreen != pScreen)) {
+ ret = BadMatch;
+ goto PatchUp;
+ }
+ pAttr->pBackgroundPixmap = pPixmap;
+ pPixmap->refcnt++;
+ pAttr->mask &= ~CWBackPixmap;
+ }
+ else {
+ client->errorValue = pixID;
+ goto PatchUp;
+ }
+ }
+ break;
+ case CWBackPixel:
+ *values++ = (CARD32) *pVlist;
+ break;
+ case CWBorderPixmap:
+ pixID = (Pixmap) * pVlist;
+ if (pixID == CopyFromParent) {
+ if (depth != pParent->drawable.depth) {
+ ret = BadMatch;
+ goto PatchUp;
+ }
+ *values++ = CopyFromParent;
+ }
+ else {
+ ret =
+ dixLookupResourceByType((pointer *) &pPixmap, pixID,
+ RT_PIXMAP, client, DixReadAccess);
+ if (ret == Success) {
+ if ((pPixmap->drawable.depth != depth) ||
+ (pPixmap->drawable.pScreen != pScreen)) {
ret = BadMatch;
- goto PatchUp;
- }
- pAttr->pBackgroundPixmap = pPixmap;
- pPixmap->refcnt++;
- pAttr->mask &= ~CWBackPixmap;
- }
- else
- {
- client->errorValue = pixID;
- goto PatchUp;
- }
- }
- break;
- case CWBackPixel:
- *values++ = (CARD32) *pVlist;
- break;
- case CWBorderPixmap:
- pixID = (Pixmap ) *pVlist;
- if (pixID == CopyFromParent)
- {
- if (depth != pParent->drawable.depth)
- {
- ret = BadMatch;
- goto PatchUp;
- }
- *values++ = CopyFromParent;
- }
- else
- {
- ret = dixLookupResourceByType((pointer *)&pPixmap, pixID, RT_PIXMAP,
- client, DixReadAccess);
- if (ret == Success)
- {
- if ((pPixmap->drawable.depth != depth) ||
- (pPixmap->drawable.pScreen != pScreen))
- {
- ret = BadMatch;
- goto PatchUp;
- }
- pAttr->pBorderPixmap = pPixmap;
- pPixmap->refcnt++;
- pAttr->mask &= ~CWBorderPixmap;
- }
- else
- {
- client->errorValue = pixID;
- goto PatchUp;
- }
- }
- break;
- case CWBorderPixel:
+ goto PatchUp;
+ }
+ pAttr->pBorderPixmap = pPixmap;
+ pPixmap->refcnt++;
+ pAttr->mask &= ~CWBorderPixmap;
+ }
+ else {
+ client->errorValue = pixID;
+ goto PatchUp;
+ }
+ }
+ break;
+ case CWBorderPixel:
+ *values++ = (CARD32) *pVlist;
+ break;
+ case CWBitGravity:
+ val = (CARD8) *pVlist;
+ if (val > StaticGravity) {
+ ret = BadValue;
+ client->errorValue = val;
+ goto PatchUp;
+ }
+ *values++ = val;
+ break;
+ case CWWinGravity:
+ val = (CARD8) *pVlist;
+ if (val > StaticGravity) {
+ ret = BadValue;
+ client->errorValue = val;
+ goto PatchUp;
+ }
+ *values++ = val;
+ break;
+ case CWBackingStore:
+ val = (CARD8) *pVlist;
+ if ((val != NotUseful) && (val != WhenMapped) && (val != Always)) {
+ ret = BadValue;
+ client->errorValue = val;
+ goto PatchUp;
+ }
+ *values++ = val;
+ break;
+ case CWBackingPlanes:
*values++ = (CARD32) *pVlist;
break;
- case CWBitGravity:
- val = (CARD8 )*pVlist;
- if (val > StaticGravity)
- {
- ret = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- *values++ = val;
- break;
- case CWWinGravity:
- val = (CARD8 )*pVlist;
- if (val > StaticGravity)
- {
- ret = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- *values++ = val;
- break;
- case CWBackingStore:
- val = (CARD8 )*pVlist;
- if ((val != NotUseful) && (val != WhenMapped) && (val != Always))
- {
- ret = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- *values++ = val;
- break;
- case CWBackingPlanes:
- *values++ = (CARD32) *pVlist;
- break;
- case CWBackingPixel:
- *values++ = (CARD32) *pVlist;
- break;
- case CWSaveUnder:
- val = (BOOL) *pVlist;
- if ((val != xTrue) && (val != xFalse))
- {
- ret = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- *values++ = val;
- break;
- case CWEventMask:
- *values++ = (CARD32) *pVlist;
- break;
- case CWDontPropagate:
- *values++ = (CARD32) *pVlist;
- break;
- case CWOverrideRedirect:
- if (!(stuff->mask & CWOverrideRedirect))
- pVlist--;
- else
- {
- val = (BOOL ) *pVlist;
- if ((val != xTrue) && (val != xFalse))
- {
- ret = BadValue;
- client->errorValue = val;
- goto PatchUp;
- }
- }
- *values++ = xTrue;
- break;
- case CWColormap:
- cmap = (Colormap) *pVlist;
- ret = dixLookupResourceByType((pointer *)&pCmap, cmap, RT_COLORMAP,
- client, DixUseAccess);
- if (ret != Success)
- {
- client->errorValue = cmap;
- goto PatchUp;
- }
- if (pCmap->pVisual->vid != visual || pCmap->pScreen != pScreen)
- {
- ret = BadMatch;
- goto PatchUp;
- }
- pAttr->colormap = cmap;
- pAttr->mask &= ~CWColormap;
- break;
- case CWCursor:
- cursorID = (Cursor ) *pVlist;
- if ( cursorID == None)
- {
- *values++ = None;
- }
- else
- {
- ret = dixLookupResourceByType((pointer *)&pCursor, cursorID,
- RT_CURSOR, client, DixUseAccess);
- if (ret != Success)
- {
- client->errorValue = cursorID;
- goto PatchUp;
- }
- pCursor->refcnt++;
- pAttr->pCursor = pCursor;
- pAttr->mask &= ~CWCursor;
- }
- break;
- default:
- ret = BadValue;
- client->errorValue = stuff->mask;
- goto PatchUp;
- }
- pVlist++;
+ case CWBackingPixel:
+ *values++ = (CARD32) *pVlist;
+ break;
+ case CWSaveUnder:
+ val = (BOOL) * pVlist;
+ if ((val != xTrue) && (val != xFalse)) {
+ ret = BadValue;
+ client->errorValue = val;
+ goto PatchUp;
+ }
+ *values++ = val;
+ break;
+ case CWEventMask:
+ *values++ = (CARD32) *pVlist;
+ break;
+ case CWDontPropagate:
+ *values++ = (CARD32) *pVlist;
+ break;
+ case CWOverrideRedirect:
+ if (!(stuff->mask & CWOverrideRedirect))
+ pVlist--;
+ else {
+ val = (BOOL) * pVlist;
+ if ((val != xTrue) && (val != xFalse)) {
+ ret = BadValue;
+ client->errorValue = val;
+ goto PatchUp;
+ }
+ }
+ *values++ = xTrue;
+ break;
+ case CWColormap:
+ cmap = (Colormap) * pVlist;
+ ret = dixLookupResourceByType((pointer *) &pCmap, cmap, RT_COLORMAP,
+ client, DixUseAccess);
+ if (ret != Success) {
+ client->errorValue = cmap;
+ goto PatchUp;
+ }
+ if (pCmap->pVisual->vid != visual || pCmap->pScreen != pScreen) {
+ ret = BadMatch;
+ goto PatchUp;
+ }
+ pAttr->colormap = cmap;
+ pAttr->mask &= ~CWColormap;
+ break;
+ case CWCursor:
+ cursorID = (Cursor) * pVlist;
+ if (cursorID == None) {
+ *values++ = None;
+ }
+ else {
+ ret = dixLookupResourceByType((pointer *) &pCursor, cursorID,
+ RT_CURSOR, client, DixUseAccess);
+ if (ret != Success) {
+ client->errorValue = cursorID;
+ goto PatchUp;
+ }
+ pCursor->refcnt++;
+ pAttr->pCursor = pCursor;
+ pAttr->mask &= ~CWCursor;
+ }
+ break;
+ default:
+ ret = BadValue;
+ client->errorValue = stuff->mask;
+ goto PatchUp;
+ }
+ pVlist++;
}
if (pPriv->attr)
- FreeScreenAttr (pPriv->attr);
+ FreeScreenAttr(pPriv->attr);
pPriv->attr = pAttr;
- pAttr->resource = FakeClientID (client->index);
- if (!AddResource (pAttr->resource, AttrType, (pointer) pAttr))
- return BadAlloc;
+ pAttr->resource = FakeClientID(client->index);
+ if (!AddResource(pAttr->resource, AttrType, (pointer) pAttr))
+ return BadAlloc;
return Success;
-PatchUp:
- FreeAttrs (pAttr);
-bail:
- CheckScreenPrivate (pScreen);
- if (pAttr) free(pAttr->values);
+ PatchUp:
+ FreeAttrs(pAttr);
+ bail:
+ CheckScreenPrivate(pScreen);
+ if (pAttr)
+ free(pAttr->values);
free(pAttr);
return ret;
}
static int
-ScreenSaverUnsetAttributes (ClientPtr client)
+ScreenSaverUnsetAttributes(ClientPtr client)
{
REQUEST(xScreenSaverSetAttributesReq);
- DrawablePtr pDraw;
- ScreenSaverScreenPrivatePtr pPriv;
- int rc;
+ DrawablePtr pDraw;
+ ScreenSaverScreenPrivatePtr pPriv;
+ int rc;
- REQUEST_SIZE_MATCH (xScreenSaverUnsetAttributesReq);
+ REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
rc = dixLookupDrawable(&pDraw, stuff->drawable, client, 0,
- DixGetAttrAccess);
+ DixGetAttrAccess);
if (rc != Success)
- return rc;
- pPriv = GetScreenPrivate (pDraw->pScreen);
- if (pPriv && pPriv->attr && pPriv->attr->client == client)
- {
- FreeResource (pPriv->attr->resource, AttrType);
- FreeScreenAttr (pPriv->attr);
- pPriv->attr = NULL;
- CheckScreenPrivate (pDraw->pScreen);
+ return rc;
+ pPriv = GetScreenPrivate(pDraw->pScreen);
+ if (pPriv && pPriv->attr && pPriv->attr->client == client) {
+ FreeResource(pPriv->attr->resource, AttrType);
+ FreeScreenAttr(pPriv->attr);
+ pPriv->attr = NULL;
+ CheckScreenPrivate(pDraw->pScreen);
}
return Success;
}
static int
-ProcScreenSaverSetAttributes (ClientPtr client)
+ProcScreenSaverSetAttributes(ClientPtr client)
{
#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- REQUEST(xScreenSaverSetAttributesReq);
- PanoramiXRes *draw;
- PanoramiXRes *backPix = NULL;
- PanoramiXRes *bordPix = NULL;
- PanoramiXRes *cmap = NULL;
- int i, status, len;
- int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
- XID orig_visual, tmp;
-
- REQUEST_AT_LEAST_SIZE (xScreenSaverSetAttributesReq);
-
- status = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
- if (status != Success)
- return (status == BadValue) ? BadDrawable : status;
-
- len = stuff->length - bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
- if (Ones(stuff->mask) != len)
- return BadLength;
-
- if((Mask)stuff->mask & CWBackPixmap) {
- pback_offset = Ones((Mask)stuff->mask & (CWBackPixmap - 1));
- tmp = *((CARD32 *) &stuff[1] + pback_offset);
- if ((tmp != None) && (tmp != ParentRelative)) {
- status = dixLookupResourceByType((pointer *)&backPix, tmp,
- XRT_PIXMAP, client,
- DixReadAccess);
- if (status != Success)
- return status;
- }
- }
-
- if ((Mask)stuff->mask & CWBorderPixmap) {
- pbord_offset = Ones((Mask)stuff->mask & (CWBorderPixmap - 1));
- tmp = *((CARD32 *) &stuff[1] + pbord_offset);
- if (tmp != CopyFromParent) {
- status = dixLookupResourceByType((pointer *)&bordPix, tmp,
- XRT_PIXMAP, client,
- DixReadAccess);
- if (status != Success)
- return status;
- }
- }
-
- if ((Mask)stuff->mask & CWColormap) {
- cmap_offset = Ones((Mask)stuff->mask & (CWColormap - 1));
- tmp = *((CARD32 *) &stuff[1] + cmap_offset);
- if ((tmp != CopyFromParent) && (tmp != None)) {
- status = dixLookupResourceByType((pointer *)&cmap, tmp,
- XRT_COLORMAP, client,
- DixReadAccess);
- if (status != Success)
- return status;
- }
- }
-
- orig_visual = stuff->visualID;
-
- FOR_NSCREENS_BACKWARD(i) {
- stuff->drawable = draw->info[i].id;
- if (backPix)
- *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[i].id;
- if (bordPix)
- *((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[i].id;
- if (cmap)
- *((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[i].id;
-
- if (orig_visual != CopyFromParent)
- stuff->visualID = PanoramiXTranslateVisualID(i, orig_visual);
-
- status = ScreenSaverSetAttributes(client);
- }
-
- return status;
+ if (!noPanoramiXExtension) {
+ REQUEST(xScreenSaverSetAttributesReq);
+ PanoramiXRes *draw;
+ PanoramiXRes *backPix = NULL;
+ PanoramiXRes *bordPix = NULL;
+ PanoramiXRes *cmap = NULL;
+ int i, status, len;
+ int pback_offset = 0, pbord_offset = 0, cmap_offset = 0;
+ XID orig_visual, tmp;
+
+ REQUEST_AT_LEAST_SIZE(xScreenSaverSetAttributesReq);
+
+ status = dixLookupResourceByClass((pointer *) &draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
+ if (status != Success)
+ return (status == BadValue) ? BadDrawable : status;
+
+ len =
+ stuff->length -
+ bytes_to_int32(sizeof(xScreenSaverSetAttributesReq));
+ if (Ones(stuff->mask) != len)
+ return BadLength;
+
+ if ((Mask) stuff->mask & CWBackPixmap) {
+ pback_offset = Ones((Mask) stuff->mask & (CWBackPixmap - 1));
+ tmp = *((CARD32 *) &stuff[1] + pback_offset);
+ if ((tmp != None) && (tmp != ParentRelative)) {
+ status = dixLookupResourceByType((pointer *) &backPix, tmp,
+ XRT_PIXMAP, client,
+ DixReadAccess);
+ if (status != Success)
+ return status;
+ }
+ }
+
+ if ((Mask) stuff->mask & CWBorderPixmap) {
+ pbord_offset = Ones((Mask) stuff->mask & (CWBorderPixmap - 1));
+ tmp = *((CARD32 *) &stuff[1] + pbord_offset);
+ if (tmp != CopyFromParent) {
+ status = dixLookupResourceByType((pointer *) &bordPix, tmp,
+ XRT_PIXMAP, client,
+ DixReadAccess);
+ if (status != Success)
+ return status;
+ }
+ }
+
+ if ((Mask) stuff->mask & CWColormap) {
+ cmap_offset = Ones((Mask) stuff->mask & (CWColormap - 1));
+ tmp = *((CARD32 *) &stuff[1] + cmap_offset);
+ if ((tmp != CopyFromParent) && (tmp != None)) {
+ status = dixLookupResourceByType((pointer *) &cmap, tmp,
+ XRT_COLORMAP, client,
+ DixReadAccess);
+ if (status != Success)
+ return status;
+ }
+ }
+
+ orig_visual = stuff->visualID;
+
+ FOR_NSCREENS_BACKWARD(i) {
+ stuff->drawable = draw->info[i].id;
+ if (backPix)
+ *((CARD32 *) &stuff[1] + pback_offset) = backPix->info[i].id;
+ if (bordPix)
+ *((CARD32 *) &stuff[1] + pbord_offset) = bordPix->info[i].id;
+ if (cmap)
+ *((CARD32 *) &stuff[1] + cmap_offset) = cmap->info[i].id;
+
+ if (orig_visual != CopyFromParent)
+ stuff->visualID = PanoramiXTranslateVisualID(i, orig_visual);
+
+ status = ScreenSaverSetAttributes(client);
+ }
+
+ return status;
}
#endif
@@ -1272,25 +1195,25 @@ ProcScreenSaverSetAttributes (ClientPtr client)
}
static int
-ProcScreenSaverUnsetAttributes (ClientPtr client)
+ProcScreenSaverUnsetAttributes(ClientPtr client)
{
#ifdef PANORAMIX
- if(!noPanoramiXExtension) {
- REQUEST(xScreenSaverUnsetAttributesReq);
- PanoramiXRes *draw;
- int rc, i;
+ if (!noPanoramiXExtension) {
+ REQUEST(xScreenSaverUnsetAttributesReq);
+ PanoramiXRes *draw;
+ int rc, i;
- rc = dixLookupResourceByClass((pointer *)&draw, stuff->drawable,
- XRC_DRAWABLE, client, DixWriteAccess);
- if (rc != Success)
- return (rc == BadValue) ? BadDrawable : rc;
+ rc = dixLookupResourceByClass((pointer *) &draw, stuff->drawable,
+ XRC_DRAWABLE, client, DixWriteAccess);
+ if (rc != Success)
+ return (rc == BadValue) ? BadDrawable : rc;
- for(i = PanoramiXNumScreens - 1; i > 0; i--) {
+ for (i = PanoramiXNumScreens - 1; i > 0; i--) {
stuff->drawable = draw->info[i].id;
ScreenSaverUnsetAttributes(client);
- }
+ }
- stuff->drawable = draw->info[0].id;
+ stuff->drawable = draw->info[0].id;
}
#endif
@@ -1298,7 +1221,7 @@ ProcScreenSaverUnsetAttributes (ClientPtr client)
}
static int
-ProcScreenSaverSuspend (ClientPtr client)
+ProcScreenSaverSuspend(ClientPtr client)
{
ScreenSaverSuspensionPtr *prev, this;
@@ -1307,22 +1230,21 @@ ProcScreenSaverSuspend (ClientPtr client)
/* Check if this client is suspending the screensaver */
for (prev = &suspendingClients; (this = *prev); prev = &this->next)
- if (this->pClient == client)
- break;
+ if (this->pClient == client)
+ break;
- if (this)
- {
- if (stuff->suspend == TRUE)
- this->count++;
- else if (--this->count == 0)
- FreeResource (this->clientResource, RT_NONE);
+ if (this) {
+ if (stuff->suspend == TRUE)
+ this->count++;
+ else if (--this->count == 0)
+ FreeResource(this->clientResource, RT_NONE);
- return Success;
+ return Success;
}
/* If we get to this point, this client isn't suspending the screensaver */
if (stuff->suspend == FALSE)
- return Success;
+ return Success;
/*
* Allocate a suspension record for the client, and stop the screensaver
@@ -1330,85 +1252,81 @@ ProcScreenSaverSuspend (ClientPtr client)
* to the record, so the screensaver will be reenabled and the record freed
* if the client disconnects without reenabling it first.
*/
- this = malloc(sizeof (ScreenSaverSuspensionRec));
+ this = malloc(sizeof(ScreenSaverSuspensionRec));
if (!this)
- return BadAlloc;
+ return BadAlloc;
- this->next = NULL;
- this->pClient = client;
- this->count = 1;
- this->clientResource = FakeClientID (client->index);
+ this->next = NULL;
+ this->pClient = client;
+ this->count = 1;
+ this->clientResource = FakeClientID(client->index);
- if (!AddResource (this->clientResource, SuspendType, (pointer) this))
- {
- free(this);
- return BadAlloc;
+ if (!AddResource(this->clientResource, SuspendType, (pointer) this)) {
+ free(this);
+ return BadAlloc;
}
*prev = this;
- if (!screenSaverSuspended)
- {
- screenSaverSuspended = TRUE;
- FreeScreenSaverTimer();
+ if (!screenSaverSuspended) {
+ screenSaverSuspended = TRUE;
+ FreeScreenSaverTimer();
}
return Success;
}
-static int (*NormalVector[]) (ClientPtr /* client */) = {
- ProcScreenSaverQueryVersion,
- ProcScreenSaverQueryInfo,
- ProcScreenSaverSelectInput,
- ProcScreenSaverSetAttributes,
- ProcScreenSaverUnsetAttributes,
- ProcScreenSaverSuspend,
-};
+static int (*NormalVector[]) (ClientPtr /* client */ ) = {
+ProcScreenSaverQueryVersion,
+ ProcScreenSaverQueryInfo,
+ ProcScreenSaverSelectInput,
+ ProcScreenSaverSetAttributes,
+ ProcScreenSaverUnsetAttributes, ProcScreenSaverSuspend,};
#define NUM_REQUESTS ((sizeof NormalVector) / (sizeof NormalVector[0]))
static int
-ProcScreenSaverDispatch (ClientPtr client)
+ProcScreenSaverDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data < NUM_REQUESTS)
- return (*NormalVector[stuff->data])(client);
+ return (*NormalVector[stuff->data]) (client);
return BadRequest;
}
static int
-SProcScreenSaverQueryVersion (ClientPtr client)
+SProcScreenSaverQueryVersion(ClientPtr client)
{
REQUEST(xScreenSaverQueryVersionReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq);
- return ProcScreenSaverQueryVersion (client);
+ return ProcScreenSaverQueryVersion(client);
}
static int
-SProcScreenSaverQueryInfo (ClientPtr client)
+SProcScreenSaverQueryInfo(ClientPtr client)
{
REQUEST(xScreenSaverQueryInfoReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverQueryInfoReq);
swapl(&stuff->drawable);
- return ProcScreenSaverQueryInfo (client);
+ return ProcScreenSaverQueryInfo(client);
}
static int
-SProcScreenSaverSelectInput (ClientPtr client)
+SProcScreenSaverSelectInput(ClientPtr client)
{
REQUEST(xScreenSaverSelectInputReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverSelectInputReq);
swapl(&stuff->drawable);
swapl(&stuff->eventMask);
- return ProcScreenSaverSelectInput (client);
+ return ProcScreenSaverSelectInput(client);
}
static int
-SProcScreenSaverSetAttributes (ClientPtr client)
+SProcScreenSaverSetAttributes(ClientPtr client)
{
REQUEST(xScreenSaverSetAttributesReq);
swaps(&stuff->length);
@@ -1422,45 +1340,43 @@ SProcScreenSaverSetAttributes (ClientPtr client)
swapl(&stuff->visualID);
swapl(&stuff->mask);
SwapRestL(stuff);
- return ProcScreenSaverSetAttributes (client);
+ return ProcScreenSaverSetAttributes(client);
}
static int
-SProcScreenSaverUnsetAttributes (ClientPtr client)
+SProcScreenSaverUnsetAttributes(ClientPtr client)
{
REQUEST(xScreenSaverUnsetAttributesReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverUnsetAttributesReq);
swapl(&stuff->drawable);
- return ProcScreenSaverUnsetAttributes (client);
+ return ProcScreenSaverUnsetAttributes(client);
}
static int
-SProcScreenSaverSuspend (ClientPtr client)
+SProcScreenSaverSuspend(ClientPtr client)
{
REQUEST(xScreenSaverSuspendReq);
swaps(&stuff->length);
REQUEST_SIZE_MATCH(xScreenSaverSuspendReq);
- return ProcScreenSaverSuspend (client);
+ return ProcScreenSaverSuspend(client);
}
-static int (*SwappedVector[]) (ClientPtr /* client */) = {
- SProcScreenSaverQueryVersion,
- SProcScreenSaverQueryInfo,
- SProcScreenSaverSelectInput,
- SProcScreenSaverSetAttributes,
- SProcScreenSaverUnsetAttributes,
- SProcScreenSaverSuspend,
-};
+static int (*SwappedVector[]) (ClientPtr /* client */ ) = {
+SProcScreenSaverQueryVersion,
+ SProcScreenSaverQueryInfo,
+ SProcScreenSaverSelectInput,
+ SProcScreenSaverSetAttributes,
+ SProcScreenSaverUnsetAttributes, SProcScreenSaverSuspend,};
static int
-SProcScreenSaverDispatch (ClientPtr client)
+SProcScreenSaverDispatch(ClientPtr client)
{
REQUEST(xReq);
if (stuff->data < NUM_REQUESTS)
- return (*SwappedVector[stuff->data])(client);
+ return (*SwappedVector[stuff->data]) (client);
return BadRequest;
}
@@ -1468,29 +1384,27 @@ void
ScreenSaverExtensionInit(INITARGS)
{
ExtensionEntry *extEntry;
- int i;
- ScreenPtr pScreen;
+ int i;
+ ScreenPtr pScreen;
if (!dixRegisterPrivateKey(&ScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
- return;
+ return;
AttrType = CreateNewResourceType(ScreenSaverFreeAttr, "SaverAttr");
- SaverEventType = CreateNewResourceType(ScreenSaverFreeEvents,
- "SaverEvent");
- SuspendType = CreateNewResourceType(ScreenSaverFreeSuspend,
- "SaverSuspend");
-
- for (i = 0; i < screenInfo.numScreens; i++)
- {
- pScreen = screenInfo.screens[i];
- SetScreenPrivate (pScreen, NULL);
+ SaverEventType = CreateNewResourceType(ScreenSaverFreeEvents, "SaverEvent");
+ SuspendType = CreateNewResourceType(ScreenSaverFreeSuspend, "SaverSuspend");
+
+ for (i = 0; i < screenInfo.numScreens; i++) {
+ pScreen = screenInfo.screens[i];
+ SetScreenPrivate(pScreen, NULL);
}
if (AttrType && SaverEventType && SuspendType &&
- (extEntry = AddExtension(ScreenSaverName, ScreenSaverNumberEvents, 0,
- ProcScreenSaverDispatch, SProcScreenSaverDispatch,
- NULL, StandardMinorOpcode)))
- {
- ScreenSaverEventBase = extEntry->eventBase;
- EventSwapVector[ScreenSaverEventBase] = (EventSwapPtr) SScreenSaverNotifyEvent;
+ (extEntry = AddExtension(ScreenSaverName, ScreenSaverNumberEvents, 0,
+ ProcScreenSaverDispatch,
+ SProcScreenSaverDispatch, NULL,
+ StandardMinorOpcode))) {
+ ScreenSaverEventBase = extEntry->eventBase;
+ EventSwapVector[ScreenSaverEventBase] =
+ (EventSwapPtr) SScreenSaverNotifyEvent;
}
}
diff --git a/Xext/security.c b/Xext/security.c
index df5bd5822..3699510d3 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -42,16 +42,17 @@ in this Software without prior written authorization from The Open Group.
#include "protocol-versions.h"
/* Extension stuff */
-static int SecurityErrorBase; /* first Security error number */
-static int SecurityEventBase; /* first Security event number */
+static int SecurityErrorBase; /* first Security error number */
+static int SecurityEventBase; /* first Security event number */
-RESTYPE SecurityAuthorizationResType; /* resource type for authorizations */
+RESTYPE SecurityAuthorizationResType; /* resource type for authorizations */
static RESTYPE RTEventClient;
static CallbackListPtr SecurityValidateGroupCallback = NULL;
/* Private state record */
static DevPrivateKeyRec stateKeyRec;
+
#define stateKey (&stateKeyRec)
/* This is what we store as client security state */
@@ -84,7 +85,6 @@ static const Mask SecurityDeviceMask =
static const Mask SecurityServerMask = DixGetAttrAccess | DixGrabAccess;
static const Mask SecurityClientMask = DixGetAttrAccess;
-
/* SecurityAudit
*
* Arguments:
@@ -97,33 +97,34 @@ static const Mask SecurityClientMask = DixGetAttrAccess;
* Writes the message to the log file if security logging is on.
*/
-static void _X_ATTRIBUTE_PRINTF(1,2)
+static void
+_X_ATTRIBUTE_PRINTF(1, 2)
SecurityAudit(const char *format, ...)
{
va_list args;
if (auditTrailLevel < SECURITY_AUDIT_LEVEL)
- return;
+ return;
va_start(args, format);
VAuditF(format, args);
va_end(args);
-} /* SecurityAudit */
+} /* SecurityAudit */
/*
* Performs a Security permission check.
*/
static int
-SecurityDoCheck(SecurityStateRec *subj, SecurityStateRec *obj,
- Mask requested, Mask allowed)
+SecurityDoCheck(SecurityStateRec * subj, SecurityStateRec * obj,
+ Mask requested, Mask allowed)
{
if (!subj->haveState || !obj->haveState)
- return Success;
+ return Success;
if (subj->trustLevel == XSecurityClientTrusted)
- return Success;
+ return Success;
if (obj->trustLevel != XSecurityClientTrusted)
- return Success;
+ return Success;
if ((requested | allowed) == allowed)
- return Success;
+ return Success;
return BadAccess;
}
@@ -151,7 +152,6 @@ SecurityLookupRequestName(ClientPtr client)
return LookupRequestName(client->majorOp, client->minorOp);
}
-
/* SecurityDeleteAuthorization
*
* Arguments:
@@ -165,11 +165,9 @@ SecurityLookupRequestName(ClientPtr client)
*/
static int
-SecurityDeleteAuthorization(
- pointer value,
- XID id)
+SecurityDeleteAuthorization(pointer value, XID id)
{
- SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)value;
+ SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr) value;
unsigned short name_len, data_len;
const char *name;
char *data;
@@ -179,74 +177,67 @@ SecurityDeleteAuthorization(
/* Remove the auth using the os layer auth manager */
- status = AuthorizationFromID(pAuth->id, &name_len, &name,
- &data_len, &data);
+ status = AuthorizationFromID(pAuth->id, &name_len, &name, &data_len, &data);
assert(status);
status = RemoveAuthorization(name_len, name, data_len, data);
assert(status);
- (void)status;
+ (void) status;
/* free the auth timer if there is one */
- if (pAuth->timer) TimerFree(pAuth->timer);
+ if (pAuth->timer)
+ TimerFree(pAuth->timer);
/* send revoke events */
- while ((pEventClient = pAuth->eventClients))
- {
- /* send revocation event event */
- xSecurityAuthorizationRevokedEvent are;
- are.type = SecurityEventBase + XSecurityAuthorizationRevoked;
- are.authId = pAuth->id;
- WriteEventsToClient(rClient(pEventClient), 1, (xEvent *)&are);
- FreeResource(pEventClient->resource, RT_NONE);
+ while ((pEventClient = pAuth->eventClients)) {
+ /* send revocation event event */
+ xSecurityAuthorizationRevokedEvent are;
+
+ are.type = SecurityEventBase + XSecurityAuthorizationRevoked;
+ are.authId = pAuth->id;
+ WriteEventsToClient(rClient(pEventClient), 1, (xEvent *) &are);
+ FreeResource(pEventClient->resource, RT_NONE);
}
/* kill all clients using this auth */
- for (i = 1; i<currentMaxClients; i++)
- if (clients[i]) {
- SecurityStateRec *state;
- state = dixLookupPrivate(&clients[i]->devPrivates, stateKey);
- if (state->haveState && state->authId == pAuth->id)
- CloseDownClient(clients[i]);
- }
+ for (i = 1; i < currentMaxClients; i++)
+ if (clients[i]) {
+ SecurityStateRec *state;
+
+ state = dixLookupPrivate(&clients[i]->devPrivates, stateKey);
+ if (state->haveState && state->authId == pAuth->id)
+ CloseDownClient(clients[i]);
+ }
SecurityAudit("revoked authorization ID %d\n", pAuth->id);
free(pAuth);
return Success;
-} /* SecurityDeleteAuthorization */
-
+} /* SecurityDeleteAuthorization */
/* resource delete function for RTEventClient */
static int
-SecurityDeleteAuthorizationEventClient(
- pointer value,
- XID id)
+SecurityDeleteAuthorizationEventClient(pointer value, XID id)
{
OtherClientsPtr pEventClient, prev = NULL;
- SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)value;
+ SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr) value;
for (pEventClient = pAuth->eventClients;
- pEventClient;
- pEventClient = pEventClient->next)
- {
- if (pEventClient->resource == id)
- {
- if (prev)
- prev->next = pEventClient->next;
- else
- pAuth->eventClients = pEventClient->next;
- free(pEventClient);
- return Success;
- }
- prev = pEventClient;
+ pEventClient; pEventClient = pEventClient->next) {
+ if (pEventClient->resource == id) {
+ if (prev)
+ prev->next = pEventClient->next;
+ else
+ pAuth->eventClients = pEventClient->next;
+ free(pEventClient);
+ return Success;
+ }
+ prev = pEventClient;
}
- /*NOTREACHED*/
- return -1; /* make compiler happy */
-} /* SecurityDeleteAuthorizationEventClient */
-
+ /*NOTREACHED*/ return -1; /* make compiler happy */
+} /* SecurityDeleteAuthorizationEventClient */
/* SecurityComputeAuthorizationTimeout
*
@@ -263,26 +254,23 @@ SecurityDeleteAuthorizationEventClient(
*/
static CARD32
-SecurityComputeAuthorizationTimeout(
- SecurityAuthorizationPtr pAuth,
- unsigned int seconds)
+SecurityComputeAuthorizationTimeout(SecurityAuthorizationPtr pAuth,
+ unsigned int seconds)
{
/* maxSecs is the number of full seconds that can be expressed in
* 32 bits worth of milliseconds
*/
- CARD32 maxSecs = (CARD32)(~0) / (CARD32)MILLI_PER_SECOND;
+ CARD32 maxSecs = (CARD32) (~0) / (CARD32) MILLI_PER_SECOND;
- if (seconds > maxSecs)
- { /* only come here if we want to wait more than 49 days */
- pAuth->secondsRemaining = seconds - maxSecs;
- return maxSecs * MILLI_PER_SECOND;
+ if (seconds > maxSecs) { /* only come here if we want to wait more than 49 days */
+ pAuth->secondsRemaining = seconds - maxSecs;
+ return maxSecs * MILLI_PER_SECOND;
}
- else
- { /* by far the common case */
- pAuth->secondsRemaining = 0;
- return seconds * MILLI_PER_SECOND;
+ else { /* by far the common case */
+ pAuth->secondsRemaining = 0;
+ return seconds * MILLI_PER_SECOND;
}
-} /* SecurityStartAuthorizationTimer */
+} /* SecurityStartAuthorizationTimer */
/* SecurityAuthorizationExpired
*
@@ -304,26 +292,21 @@ SecurityComputeAuthorizationTimeout(
*/
static CARD32
-SecurityAuthorizationExpired(
- OsTimerPtr timer,
- CARD32 time,
- pointer pval)
+SecurityAuthorizationExpired(OsTimerPtr timer, CARD32 time, pointer pval)
{
- SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr)pval;
+ SecurityAuthorizationPtr pAuth = (SecurityAuthorizationPtr) pval;
assert(pAuth->timer == timer);
- if (pAuth->secondsRemaining)
- {
- return SecurityComputeAuthorizationTimeout(pAuth,
- pAuth->secondsRemaining);
+ if (pAuth->secondsRemaining) {
+ return SecurityComputeAuthorizationTimeout(pAuth,
+ pAuth->secondsRemaining);
}
- else
- {
- FreeResource(pAuth->id, RT_NONE);
- return 0;
+ else {
+ FreeResource(pAuth->id, RT_NONE);
+ return 0;
}
-} /* SecurityAuthorizationExpired */
+} /* SecurityAuthorizationExpired */
/* SecurityStartAuthorizationTimer
*
@@ -339,104 +322,91 @@ SecurityAuthorizationExpired(
*/
static void
-SecurityStartAuthorizationTimer(
- SecurityAuthorizationPtr pAuth)
+SecurityStartAuthorizationTimer(SecurityAuthorizationPtr pAuth)
{
pAuth->timer = TimerSet(pAuth->timer, 0,
- SecurityComputeAuthorizationTimeout(pAuth, pAuth->timeout),
- SecurityAuthorizationExpired, pAuth);
-} /* SecurityStartAuthorizationTimer */
-
+ SecurityComputeAuthorizationTimeout(pAuth,
+ pAuth->timeout),
+ SecurityAuthorizationExpired, pAuth);
+} /* SecurityStartAuthorizationTimer */
/* Proc functions all take a client argument, execute the request in
* client->requestBuffer, and return a protocol error status.
*/
static int
-ProcSecurityQueryVersion(
- ClientPtr client)
+ProcSecurityQueryVersion(ClientPtr client)
{
/* REQUEST(xSecurityQueryVersionReq); */
- xSecurityQueryVersionReply rep;
+ xSecurityQueryVersionReply rep;
REQUEST_SIZE_MATCH(xSecurityQueryVersionReq);
- rep.type = X_Reply;
- rep.sequenceNumber = client->sequence;
- rep.length = 0;
- rep.majorVersion = SERVER_SECURITY_MAJOR_VERSION;
- rep.minorVersion = SERVER_SECURITY_MINOR_VERSION;
- if(client->swapped)
- {
- swaps(&rep.sequenceNumber);
- swaps(&rep.majorVersion);
- swaps(&rep.minorVersion);
+ rep.type = X_Reply;
+ rep.sequenceNumber = client->sequence;
+ rep.length = 0;
+ rep.majorVersion = SERVER_SECURITY_MAJOR_VERSION;
+ rep.minorVersion = SERVER_SECURITY_MINOR_VERSION;
+ if (client->swapped) {
+ swaps(&rep.sequenceNumber);
+ swaps(&rep.majorVersion);
+ swaps(&rep.minorVersion);
}
- (void)WriteToClient(client, SIZEOF(xSecurityQueryVersionReply),
- (char *)&rep);
+ (void) WriteToClient(client, SIZEOF(xSecurityQueryVersionReply),
+ (char *) &rep);
return Success;
-} /* ProcSecurityQueryVersion */
-
+} /* ProcSecurityQueryVersion */
static int
-SecurityEventSelectForAuthorization(
- SecurityAuthorizationPtr pAuth,
- ClientPtr client,
- Mask mask)
+SecurityEventSelectForAuthorization(SecurityAuthorizationPtr pAuth,
+ ClientPtr client, Mask mask)
{
OtherClients *pEventClient;
for (pEventClient = pAuth->eventClients;
- pEventClient;
- pEventClient = pEventClient->next)
- {
- if (SameClient(pEventClient, client))
- {
- if (mask == 0)
- FreeResource(pEventClient->resource, RT_NONE);
- else
- pEventClient->mask = mask;
- return Success;
- }
+ pEventClient; pEventClient = pEventClient->next) {
+ if (SameClient(pEventClient, client)) {
+ if (mask == 0)
+ FreeResource(pEventClient->resource, RT_NONE);
+ else
+ pEventClient->mask = mask;
+ return Success;
+ }
}
-
+
pEventClient = malloc(sizeof(OtherClients));
if (!pEventClient)
- return BadAlloc;
+ return BadAlloc;
pEventClient->mask = mask;
pEventClient->resource = FakeClientID(client->index);
pEventClient->next = pAuth->eventClients;
- if (!AddResource(pEventClient->resource, RTEventClient,
- (pointer)pAuth))
- {
- free(pEventClient);
- return BadAlloc;
+ if (!AddResource(pEventClient->resource, RTEventClient, (pointer) pAuth)) {
+ free(pEventClient);
+ return BadAlloc;
}
pAuth->eventClients = pEventClient;
return Success;
-} /* SecurityEventSelectForAuthorization */
-
+} /* SecurityEventSelectForAuthorization */
static int
-ProcSecurityGenerateAuthorization(
- ClientPtr client)
+ProcSecurityGenerateAuthorization(ClientPtr client)
{
REQUEST(xSecurityGenerateAuthorizationReq);
- int len; /* request length in CARD32s*/
- Bool removeAuth = FALSE; /* if bailout, call RemoveAuthorization? */
- SecurityAuthorizationPtr pAuth = NULL; /* auth we are creating */
- int err; /* error to return from this function */
- XID authId; /* authorization ID assigned by os layer */
- xSecurityGenerateAuthorizationReply rep; /* reply struct */
+ int len; /* request length in CARD32s */
+ Bool removeAuth = FALSE; /* if bailout, call RemoveAuthorization? */
+ SecurityAuthorizationPtr pAuth = NULL; /* auth we are creating */
+ int err; /* error to return from this function */
+ XID authId; /* authorization ID assigned by os layer */
+ xSecurityGenerateAuthorizationReply rep; /* reply struct */
unsigned int trustLevel; /* trust level of new auth */
- XID group; /* group of new auth */
- CARD32 timeout; /* timeout of new auth */
- CARD32 *values; /* list of supplied attributes */
- char *protoname; /* auth proto name sent in request */
- char *protodata; /* auth proto data sent in request */
+ XID group; /* group of new auth */
+ CARD32 timeout; /* timeout of new auth */
+ CARD32 *values; /* list of supplied attributes */
+ char *protoname; /* auth proto name sent in request */
+ char *protodata; /* auth proto data sent in request */
unsigned int authdata_len; /* # bytes of generated auth data */
- char *pAuthdata; /* generated auth data */
- Mask eventMask; /* what events on this auth does client want */
+ char *pAuthdata; /* generated auth data */
+ Mask eventMask; /* what events on this auth does client want */
/* check request length */
@@ -444,84 +414,75 @@ ProcSecurityGenerateAuthorization(
len = bytes_to_int32(SIZEOF(xSecurityGenerateAuthorizationReq));
len += bytes_to_int32(stuff->nbytesAuthProto);
len += bytes_to_int32(stuff->nbytesAuthData);
- values = ((CARD32 *)stuff) + len;
+ values = ((CARD32 *) stuff) + len;
len += Ones(stuff->valueMask);
if (client->req_len != len)
- return BadLength;
+ return BadLength;
/* check valuemask */
- if (stuff->valueMask & ~XSecurityAllAuthorizationAttributes)
- {
- client->errorValue = stuff->valueMask;
- return BadValue;
+ if (stuff->valueMask & ~XSecurityAllAuthorizationAttributes) {
+ client->errorValue = stuff->valueMask;
+ return BadValue;
}
/* check timeout */
timeout = 60;
- if (stuff->valueMask & XSecurityTimeout)
- {
- timeout = *values++;
+ if (stuff->valueMask & XSecurityTimeout) {
+ timeout = *values++;
}
/* check trustLevel */
trustLevel = XSecurityClientUntrusted;
- if (stuff->valueMask & XSecurityTrustLevel)
- {
- trustLevel = *values++;
- if (trustLevel != XSecurityClientTrusted &&
- trustLevel != XSecurityClientUntrusted)
- {
- client->errorValue = trustLevel;
- return BadValue;
- }
+ if (stuff->valueMask & XSecurityTrustLevel) {
+ trustLevel = *values++;
+ if (trustLevel != XSecurityClientTrusted &&
+ trustLevel != XSecurityClientUntrusted) {
+ client->errorValue = trustLevel;
+ return BadValue;
+ }
}
/* check group */
group = None;
- if (stuff->valueMask & XSecurityGroup)
- {
- group = *values++;
- if (SecurityValidateGroupCallback)
- {
- SecurityValidateGroupInfoRec vgi;
- vgi.group = group;
- vgi.valid = FALSE;
- CallCallbacks(&SecurityValidateGroupCallback, (pointer)&vgi);
-
- /* if nobody said they recognized it, it's an error */
-
- if (!vgi.valid)
- {
- client->errorValue = group;
- return BadValue;
- }
- }
+ if (stuff->valueMask & XSecurityGroup) {
+ group = *values++;
+ if (SecurityValidateGroupCallback) {
+ SecurityValidateGroupInfoRec vgi;
+
+ vgi.group = group;
+ vgi.valid = FALSE;
+ CallCallbacks(&SecurityValidateGroupCallback, (pointer) &vgi);
+
+ /* if nobody said they recognized it, it's an error */
+
+ if (!vgi.valid) {
+ client->errorValue = group;
+ return BadValue;
+ }
+ }
}
/* check event mask */
eventMask = 0;
- if (stuff->valueMask & XSecurityEventMask)
- {
- eventMask = *values++;
- if (eventMask & ~XSecurityAllEventMasks)
- {
- client->errorValue = eventMask;
- return BadValue;
- }
+ if (stuff->valueMask & XSecurityEventMask) {
+ eventMask = *values++;
+ if (eventMask & ~XSecurityAllEventMasks) {
+ client->errorValue = eventMask;
+ return BadValue;
+ }
}
- protoname = (char *)&stuff[1];
+ protoname = (char *) &stuff[1];
protodata = protoname + bytes_to_int32(stuff->nbytesAuthProto);
/* call os layer to generate the authorization */
authId = GenerateAuthorization(stuff->nbytesAuthProto, protoname,
- stuff->nbytesAuthData, protodata,
- &authdata_len, &pAuthdata);
- if ((XID) ~0L == authId)
- {
- err = SecurityErrorBase + XSecurityBadAuthorizationProtocol;
- goto bailout;
+ stuff->nbytesAuthData, protodata,
+ &authdata_len, &pAuthdata);
+ if ((XID) ~0L == authId) {
+ err = SecurityErrorBase + XSecurityBadAuthorizationProtocol;
+ goto bailout;
}
/* now that we've added the auth, remember to remove it if we have to
@@ -532,10 +493,9 @@ ProcSecurityGenerateAuthorization(
/* associate additional information with this auth ID */
pAuth = malloc(sizeof(SecurityAuthorizationRec));
- if (!pAuth)
- {
- err = BadAlloc;
- goto bailout;
+ if (!pAuth) {
+ err = BadAlloc;
+ goto bailout;
}
/* fill in the auth fields */
@@ -544,29 +504,27 @@ ProcSecurityGenerateAuthorization(
pAuth->timeout = timeout;
pAuth->group = group;
pAuth->trustLevel = trustLevel;
- pAuth->refcnt = 0; /* the auth was just created; nobody's using it yet */
+ pAuth->refcnt = 0; /* the auth was just created; nobody's using it yet */
pAuth->secondsRemaining = 0;
pAuth->timer = NULL;
pAuth->eventClients = NULL;
/* handle event selection */
- if (eventMask)
- {
- err = SecurityEventSelectForAuthorization(pAuth, client, eventMask);
- if (err != Success)
- goto bailout;
+ if (eventMask) {
+ err = SecurityEventSelectForAuthorization(pAuth, client, eventMask);
+ if (err != Success)
+ goto bailout;
}
- if (!AddResource(authId, SecurityAuthorizationResType, pAuth))
- {
- err = BadAlloc;
- goto bailout;
+ if (!AddResource(authId, SecurityAuthorizationResType, pAuth)) {
+ err = BadAlloc;
+ goto bailout;
}
/* start the timer ticking */
if (pAuth->timeout != 0)
- SecurityStartAuthorizationTimer(pAuth);
+ SecurityStartAuthorizationTimer(pAuth);
/* tell client the auth id and data */
@@ -576,37 +534,36 @@ ProcSecurityGenerateAuthorization(
rep.authId = authId;
rep.dataLength = authdata_len;
- if (client->swapped)
- {
- swapl(&rep.length);
- swaps(&rep.sequenceNumber);
- swapl(&rep.authId);
- swaps(&rep.dataLength);
+ if (client->swapped) {
+ swapl(&rep.length);
+ swaps(&rep.sequenceNumber);
+ swapl(&rep.authId);
+ swaps(&rep.dataLength);
}
WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply),
- (char *)&rep);
+ (char *) &rep);
WriteToClient(client, authdata_len, pAuthdata);
- SecurityAudit("client %d generated authorization %d trust %d timeout %d group %d events %d\n",
- client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
- pAuth->group, eventMask);
+ SecurityAudit
+ ("client %d generated authorization %d trust %d timeout %d group %d events %d\n",
+ client->index, pAuth->id, pAuth->trustLevel, pAuth->timeout,
+ pAuth->group, eventMask);
/* the request succeeded; don't call RemoveAuthorization or free pAuth */
return Success;
-bailout:
+ bailout:
if (removeAuth)
- RemoveAuthorization(stuff->nbytesAuthProto, protoname,
- authdata_len, pAuthdata);
+ RemoveAuthorization(stuff->nbytesAuthProto, protoname,
+ authdata_len, pAuthdata);
free(pAuth);
return err;
-} /* ProcSecurityGenerateAuthorization */
+} /* ProcSecurityGenerateAuthorization */
static int
-ProcSecurityRevokeAuthorization(
- ClientPtr client)
+ProcSecurityRevokeAuthorization(ClientPtr client)
{
REQUEST(xSecurityRevokeAuthorizationReq);
SecurityAuthorizationPtr pAuth;
@@ -614,39 +571,35 @@ ProcSecurityRevokeAuthorization(
REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
- rc = dixLookupResourceByType((pointer *)&pAuth, stuff->authId,
- SecurityAuthorizationResType, client,
- DixDestroyAccess);
+ rc = dixLookupResourceByType((pointer *) &pAuth, stuff->authId,
+ SecurityAuthorizationResType, client,
+ DixDestroyAccess);
if (rc != Success)
- return rc;
+ return rc;
FreeResource(stuff->authId, RT_NONE);
return Success;
-} /* ProcSecurityRevokeAuthorization */
-
+} /* ProcSecurityRevokeAuthorization */
static int
-ProcSecurityDispatch(
- ClientPtr client)
+ProcSecurityDispatch(ClientPtr client)
{
REQUEST(xReq);
- switch (stuff->data)
- {
- case X_SecurityQueryVersion:
- return ProcSecurityQueryVersion(client);
- case X_SecurityGenerateAuthorization:
- return ProcSecurityGenerateAuthorization(client);
- case X_SecurityRevokeAuthorization:
- return ProcSecurityRevokeAuthorization(client);
- default:
- return BadRequest;
+ switch (stuff->data) {
+ case X_SecurityQueryVersion:
+ return ProcSecurityQueryVersion(client);
+ case X_SecurityGenerateAuthorization:
+ return ProcSecurityGenerateAuthorization(client);
+ case X_SecurityRevokeAuthorization:
+ return ProcSecurityRevokeAuthorization(client);
+ default:
+ return BadRequest;
}
-} /* ProcSecurityDispatch */
+} /* ProcSecurityDispatch */
static int
-SProcSecurityQueryVersion(
- ClientPtr client)
+SProcSecurityQueryVersion(ClientPtr client)
{
REQUEST(xSecurityQueryVersionReq);
@@ -655,12 +608,10 @@ SProcSecurityQueryVersion(
swaps(&stuff->majorVersion);
swaps(&stuff->minorVersion);
return ProcSecurityQueryVersion(client);
-} /* SProcSecurityQueryVersion */
-
+} /* SProcSecurityQueryVersion */
static int
-SProcSecurityGenerateAuthorization(
- ClientPtr client)
+SProcSecurityGenerateAuthorization(ClientPtr client)
{
REQUEST(xSecurityGenerateAuthorizationReq);
CARD32 *values;
@@ -673,20 +624,18 @@ SProcSecurityGenerateAuthorization(
swaps(&stuff->nbytesAuthData);
swapl(&stuff->valueMask);
values_offset = bytes_to_int32(stuff->nbytesAuthProto) +
- bytes_to_int32(stuff->nbytesAuthData);
- if (values_offset >
- stuff->length - bytes_to_int32(sz_xSecurityGenerateAuthorizationReq))
- return BadLength;
- values = (CARD32 *)(&stuff[1]) + values_offset;
- nvalues = (((CARD32 *)stuff) + stuff->length) - values;
+ bytes_to_int32(stuff->nbytesAuthData);
+ if (values_offset >
+ stuff->length - bytes_to_int32(sz_xSecurityGenerateAuthorizationReq))
+ return BadLength;
+ values = (CARD32 *) (&stuff[1]) + values_offset;
+ nvalues = (((CARD32 *) stuff) + stuff->length) - values;
SwapLongs(values, nvalues);
return ProcSecurityGenerateAuthorization(client);
-} /* SProcSecurityGenerateAuthorization */
-
+} /* SProcSecurityGenerateAuthorization */
static int
-SProcSecurityRevokeAuthorization(
- ClientPtr client)
+SProcSecurityRevokeAuthorization(ClientPtr client)
{
REQUEST(xSecurityRevokeAuthorizationReq);
@@ -694,32 +643,28 @@ SProcSecurityRevokeAuthorization(
REQUEST_SIZE_MATCH(xSecurityRevokeAuthorizationReq);
swapl(&stuff->authId);
return ProcSecurityRevokeAuthorization(client);
-} /* SProcSecurityRevokeAuthorization */
-
+} /* SProcSecurityRevokeAuthorization */
static int
-SProcSecurityDispatch(
- ClientPtr client)
+SProcSecurityDispatch(ClientPtr client)
{
REQUEST(xReq);
- switch (stuff->data)
- {
- case X_SecurityQueryVersion:
- return SProcSecurityQueryVersion(client);
- case X_SecurityGenerateAuthorization:
- return SProcSecurityGenerateAuthorization(client);
- case X_SecurityRevokeAuthorization:
- return SProcSecurityRevokeAuthorization(client);
- default:
- return BadRequest;
+ switch (stuff->data) {
+ case X_SecurityQueryVersion:
+ return SProcSecurityQueryVersion(client);
+ case X_SecurityGenerateAuthorization:
+ return SProcSecurityGenerateAuthorization(client);
+ case X_SecurityRevokeAuthorization:
+ return SProcSecurityRevokeAuthorization(client);
+ default:
+ return BadRequest;
}
-} /* SProcSecurityDispatch */
+} /* SProcSecurityDispatch */
-static void
-SwapSecurityAuthorizationRevokedEvent(
- xSecurityAuthorizationRevokedEvent *from,
- xSecurityAuthorizationRevokedEvent *to)
+static void
+SwapSecurityAuthorizationRevokedEvent(xSecurityAuthorizationRevokedEvent * from,
+ xSecurityAuthorizationRevokedEvent * to)
{
to->type = from->type;
to->detail = from->detail;
@@ -755,14 +700,14 @@ SecurityDevice(CallbackListPtr *pcbl, pointer unused, pointer calldata)
obj = dixLookupPrivate(&serverClient->devPrivates, stateKey);
if (rec->dev != inputInfo.keyboard)
- /* this extension only supports the core keyboard */
- allowed = requested;
+ /* this extension only supports the core keyboard */
+ allowed = requested;
if (SecurityDoCheck(subj, obj, requested, allowed) != Success) {
- SecurityAudit("Security denied client %d keyboard access on request "
- "%s\n", rec->client->index,
- SecurityLookupRequestName(rec->client));
- rec->status = BadAccess;
+ SecurityAudit("Security denied client %d keyboard access on request "
+ "%s\n", rec->client->index,
+ SecurityLookupRequestName(rec->client));
+ rec->status = BadAccess;
}
}
@@ -800,42 +745,41 @@ SecurityResource(CallbackListPtr *pcbl, pointer unused, pointer calldata)
/* disable background None for untrusted windows */
if ((requested & DixCreateAccess) && (rec->rtype == RT_WINDOW))
- if (subj->haveState && subj->trustLevel != XSecurityClientTrusted)
- ((WindowPtr)rec->res)->forcedBG = TRUE;
+ if (subj->haveState && subj->trustLevel != XSecurityClientTrusted)
+ ((WindowPtr) rec->res)->forcedBG = TRUE;
/* additional permissions for specific resource types */
if (rec->rtype == RT_WINDOW)
- allowed |= SecurityWindowExtraMask;
+ allowed |= SecurityWindowExtraMask;
/* special checks for server-owned resources */
if (cid == 0) {
- if (rec->rtype & RC_DRAWABLE)
- /* additional operations allowed on root windows */
- allowed |= SecurityRootWindowExtraMask;
+ if (rec->rtype & RC_DRAWABLE)
+ /* additional operations allowed on root windows */
+ allowed |= SecurityRootWindowExtraMask;
- else if (rec->rtype == RT_COLORMAP)
- /* allow access to default colormaps */
- allowed = requested;
+ else if (rec->rtype == RT_COLORMAP)
+ /* allow access to default colormaps */
+ allowed = requested;
- else
- /* allow read access to other server-owned resources */
- allowed |= DixReadAccess;
+ else
+ /* allow read access to other server-owned resources */
+ allowed |= DixReadAccess;
}
if (clients[cid] != NULL) {
- obj = dixLookupPrivate(&clients[cid]->devPrivates, stateKey);
- if (SecurityDoCheck(subj, obj, requested, allowed) == Success)
- return;
+ obj = dixLookupPrivate(&clients[cid]->devPrivates, stateKey);
+ if (SecurityDoCheck(subj, obj, requested, allowed) == Success)
+ return;
}
SecurityAudit("Security: denied client %d access %x to resource 0x%x "
- "of client %d on request %s\n", rec->client->index,
- requested, rec->id, cid,
- SecurityLookupRequestName(rec->client));
- rec->status = BadAccess; /* deny access */
+ "of client %d on request %s\n", rec->client->index,
+ requested, rec->id, cid,
+ SecurityLookupRequestName(rec->client));
+ rec->status = BadAccess; /* deny access */
}
-
static void
SecurityExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata)
{
@@ -846,16 +790,16 @@ SecurityExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata)
subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
if (subj->haveState && subj->trustLevel == XSecurityClientTrusted)
- return;
+ return;
while (SecurityTrustedExtensions[i])
- if (!strcmp(SecurityTrustedExtensions[i++], rec->ext->name))
- return;
+ if (!strcmp(SecurityTrustedExtensions[i++], rec->ext->name))
+ return;
SecurityAudit("Security: denied client %d access to extension "
- "%s on request %s\n",
- rec->client->index, rec->ext->name,
- SecurityLookupRequestName(rec->client));
+ "%s on request %s\n",
+ rec->client->index, rec->ext->name,
+ SecurityLookupRequestName(rec->client));
rec->status = BadAccess;
}
@@ -869,12 +813,12 @@ SecurityServer(CallbackListPtr *pcbl, pointer unused, pointer calldata)
subj = dixLookupPrivate(&rec->client->devPrivates, stateKey);
obj = dixLookupPrivate(&serverClient->devPrivates, stateKey);
-
+
if (SecurityDoCheck(subj, obj, requested, allowed) != Success) {
- SecurityAudit("Security: denied client %d access to server "
- "configuration request %s\n", rec->client->index,
- SecurityLookupRequestName(rec->client));
- rec->status = BadAccess;
+ SecurityAudit("Security: denied client %d access to server "
+ "configuration request %s\n", rec->client->index,
+ SecurityLookupRequestName(rec->client));
+ rec->status = BadAccess;
}
}
@@ -890,16 +834,16 @@ SecurityClient(CallbackListPtr *pcbl, pointer unused, pointer calldata)
obj = dixLookupPrivate(&rec->target->devPrivates, stateKey);
if (SecurityDoCheck(subj, obj, requested, allowed) != Success) {
- SecurityAudit("Security: denied client %d access to client %d on "
- "request %s\n", rec->client->index, rec->target->index,
- SecurityLookupRequestName(rec->client));
- rec->status = BadAccess;
+ SecurityAudit("Security: denied client %d access to client %d on "
+ "request %s\n", rec->client->index, rec->target->index,
+ SecurityLookupRequestName(rec->client));
+ rec->status = BadAccess;
}
}
static void
SecurityProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata)
-{